OpponentSIFT color space conversion: wrong clipping (Bug #1764)
Description
The conversion of images to the opponent color space clips values < 0 and > 255 without shifting the resulting values for the O_1 into the positive range.
E.g. O_1 is calculated in features2d/src/descriptors.cpp/convertBGRImageToOpponentColorSpace() as
O_1 = min(255, max (0, (R - G) / sqrt(2) ))
That means that for all pixels where the green component is larger than its red component, the value of the resulting O_1 channel is 0.
O_1 = min(255, max (0, 0.5 * (R - G) + 128 / sqrt(2) ))
Associated revisions
fixed #1764
History
Updated by Sebastian Gerke almost 13 years ago
It seems that the end of my report is missing, the second pseudocode is a proposal how to fix it for the first channel.
Updated by Alexander Shishkov almost 13 years ago
- Description changed from The conversion of images to the opponent color space clips values < 0 and ... to The conversion of images to the opponent color space clips values < 0 and ... More
Updated by Maria Dimashova over 12 years ago
Thanks for the report. I agree that the previous conversion looked weird. I fixed it to fit resulting channel values into uchar type in r8869. If you'll disagree with my changes (they are not exactly the same ones that you suggested), please reopen this issues.
- Status changed from Open to Done
Updated by Andrey Kamaev over 12 years ago
- Target version set to 2.4.2