Open mildsunrise opened 4 years ago
There's a class in the mcc contrib module that permits colorspace conversions (differents RGB colorspaces, and CIE colorspaces, linear or not), but it's not available to the API. May be interesting to expose them ?
I'm wondering if there would be any appetite for to extend COLOR_BayerBG2GRAY
to provide an option to
COLOR_BayerBG2GRAY_BT709
To be specific, this would set the coefficients to be something like: 0.2126, 0.7152, and 0.0722.
My understanding from the code is that the numbers that would have to change
const unsigned G2Y = 9617;
const int R2Y = 4899;
const int B2Y = 1868;
from their values defined by BT.709
const unsigned G2Y = 11717; // 11717.12
const int R2Y = 3483; // 3483..025
const int B2Y = 1183; // 11.82.82
We mainly use opencv's implementation since it is much faster than any that we have seen in the wild.
Thank you for consider.
I'm happy to discuss this in a different issue as well.
I'm opening this to put all color space-related issues (#15717, #4973, #13066) in one place. The current state of things in the color conversion API is (as far as I know):
[ ] The documentation talks about "RGB" in general without specifying the actual color space used.
Some conversions expect sRGB, some expect one of the BT.601 color spaces, some are generic transforms that work on top of any RGB space, etc.
[ ] YCbCr / YUV transforms don't specify what standard they are using (BT.601, BT.709, etc.).
[ ] The documentation doesn't specify whether the values have the space's transfer function applied or not.
Some conversions (such as RGB ↔ XYZ) expect/return physical intensities; while others (such as RGB ↔ Lab) expect/return gamma-corrected values (i.e. they take care of applying the reverse transfer function on the input, or the forward transfer function on the output).
[ ] The documentation on
imdecode
/imencode
doesn't specify the color space, or if it has the transfer function applied or not.[ ] There's no API to manually apply or unapply the transfer function of a color space --is the user supposed to do it themselves?
[ ] There's no API to convert between different RGB color spaces (sRGB, BT.601-625, etc.).
[ ] There's no documentation / API on clipping or how to check for clipped colors (i.e. to check for colors which are outside of the new gamut).