eric and x.d, I remember reading something like "the Image Processing Toolbox conversion is based on ICC profiles, and it uses a D65 to D50 Bradford adaptation transformation to the D50 white point." That may explain the differences?
Thanks for your great work!
I have used the function “colorspace( )” which can be found in the page of "http://www.mathworks.com/matlabcentral/fileexchange/28790-colorspace-transformations" as follows:
rgb = imread('peppers.png');
C = makecform('srgb2lab');
lab = applycform(rgb,C);
lab_2 = colorspace('lab<-rgb', rgb);
lab_3 = lab2uint8(lab_2);
I was surprised that the values in lab and lab_3 were quite different. I want to know the mistake in my code or my logical.
Thanks a lot.
Could you comment on the differences between your function and what comes with the image processing toolbox? Specifically, for the same XYZ values, why do I get different results using colorspace as compared to makecform and applycform? Are there arguments to makecform that would yield results consistent with colorspace? As an example, I have been using Spectral and XYZ Color Functions (http://www.mathworks.com/matlabcentral/fileexchange/7021-spectral-and-xyz-color-functions) and in the function spectrumRGB I have replaced the makecform and applycform calls with a call to colorspace and comparing the results.