From 0cb2f04eac10958d3a461472e79ef6be7a7c6078 Mon Sep 17 00:00:00 2001 From: Samuel Felton Date: Mon, 29 Apr 2024 20:27:52 +0200 Subject: [PATCH] fix light contrib conversion --- tutorial/ar/tutorial-panda3d-renderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorial/ar/tutorial-panda3d-renderer.cpp b/tutorial/ar/tutorial-panda3d-renderer.cpp index fc779132ca..c85a05be44 100644 --- a/tutorial/ar/tutorial-panda3d-renderer.cpp +++ b/tutorial/ar/tutorial-panda3d-renderer.cpp @@ -48,9 +48,9 @@ void displayLightDifference(const vpImage &colorImage, const vpImage(abs(I1 - I2)); + float I1 = 0.299 * colorImage.bitmap[i].R + 0.587 * colorImage.bitmap[i].G + 0.114 * colorImage.bitmap[i].B; + float I2 = 0.299 * colorDiffuseOnly.bitmap[i].R + 0.587 * colorDiffuseOnly.bitmap[i].G + 0.114 * colorDiffuseOnly.bitmap[i].B; + lightDifference.bitmap[i] = static_cast(round(abs(I1 - I2))); } vpDisplay::display(lightDifference); vpDisplay::flush(lightDifference);