I am trying to sample colors in MATLAB using the Color Thresholder App and then use the L * a * b output in OpenCV. But there seems to be a scale mismatch. The following are the L * a * b scales in MATLAB and OpenCV:
- MATLAB: 0 <= L <= 100; -100 <= a <= 100; and -100 <= b <= 100
- OpenCV: 0 <= L <= 100; -127 <= a <= 127; and -127 <= b <= 127
according to these two sources : Source 1; and Source 2
It seems like we need the following L * a * b ranges for 8 bit images in OpenCV :
0 <= L <= 255; 0 <= a <= 255; and 0 <= b <= 255
How do we convert from MATLAB to OpenCV L * a * b color scale for 8 - bit images ?