From b3d7887d4d6b60a061a2fb7097a57a0988d15b26 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 20 May 2019 12:08:16 +0200 Subject: [PATCH] fix luminance computation --- plugins/ImageReader/ImageReader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ImageReader/ImageReader.py b/plugins/ImageReader/ImageReader.py index e720ce4854..c59151f1cb 100644 --- a/plugins/ImageReader/ImageReader.py +++ b/plugins/ImageReader/ImageReader.py @@ -99,8 +99,8 @@ class ImageReader(MeshReader): for x in range(0, width): for y in range(0, height): qrgb = img.pixel(x, y) - avg = float(qRed(qrgb) + qGreen(qrgb) + qBlue(qrgb)) / (3 * 255) - height_data[y, x] = avg + luminance = (0.2126 * qRed(qrgb) + 0.7152 * qGreen(qrgb) + 0.0722 * qBlue(qrgb)) / 255 # fast computation ignoring gamma + height_data[y, x] = luminance Job.yieldThread()