Skip to content

Commit

Permalink
fix light contrib conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Apr 29, 2024
1 parent 1f55836 commit 0cb2f04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tutorial/ar/tutorial-panda3d-renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ void displayLightDifference(const vpImage<vpRGBa> &colorImage, const vpImage<vpR
{
#pragma omp parallel for
for (int i = 0; i < colorImage.getSize(); ++i) {
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<unsigned char>(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<unsigned char>(round(abs(I1 - I2)));
}
vpDisplay::display(lightDifference);
vpDisplay::flush(lightDifference);
Expand Down

0 comments on commit 0cb2f04

Please sign in to comment.