Updated by Alexander Shishkov almost 13 years ago
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
<pre>
O_1 = min(255, max (0, (R - G) / sqrt(2) ))
</pre>
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.
<pre>
O_1 = min(255, max (0, 0.5 * (R - G) + 128 / sqrt(2) ))
</pre> <pre>
E.g. O_1 is calculated in features2d/src/descriptors.cpp/convertBGRImageToOpponentColorSpace() as
<pre>
O_1 = min(255, max (0, (R - G) / sqrt(2) ))
</pre>
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.
<pre>
O_1 = min(255, max (0, 0.5 * (R - G) + 128 / sqrt(2) ))
</pre> <pre>