cvtcolor RGB to XYZ
In modules/imgproc/src/color.cpp, line 678:
static const int coeffs0[] =
{
1689, 1465, 739,
871, 2929, 296,
79, 488, 3892
};
Could anybody tell me where this matrix comes from?
I guess it was somehow computed from
and
(see http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html)
but how and why?
Thank you for your help.
Update (posted this as an answer but not allowed because I'm a new member):
OK I hope somebody can have a better answer.
It is actually
(correction: 2^12 instead of 2^16, sorry. In the code, 12 is defined as the shift)
This is for defining cv::RGB2XYZ_i that will be used in the case the input data are integer ('i' for integer).
I guess the main reason for such a conversion is PRECISION (for cv::RGB2XYZ_f, this conversion is not needed, please refer to the source code for details).