makecform('srgb2lab')
Mostrar comentarios más antiguos
Hello again,
I tried the syntax - srgb2lab - and it doesn't convert the colour space. I received an error message: >> C = makecform('srgb2lab') ??? Undefined function or variable 'makecform'.
Anyone knows how to solve this problem? Many Thanks, v
5 comentarios
Chandra Kurniawan
el 4 de Dic. de 2011
Your Matlab doesn't recognize 'makecform' command. Did you have 'image processing toolbox' installed on your machine?
V
el 4 de Dic. de 2011
Chandra Kurniawan
el 4 de Dic. de 2011
I think what's wrong with your Matlab.
I typed the same command in my command window
>> cform = makecform('srgb2lab')
And the result :
cform =
c_func: @applycformsequence
ColorSpace_in: 'rgb'
ColorSpace_out: 'lab'
encoding: 'double'
cdata: [1x1 struct]
>>
No error message shown.
Chandra Kurniawan
el 4 de Dic. de 2011
Try to type 'help makecform' in the command window
If the screen display message : makecform not found
Then your machine cannot recognize command 'makecform'
Walter Roberson
el 4 de Dic. de 2011
Image Processing might be installed, but is it licensed?
Also, what MATLAB version are you using? If it is sufficiently old, that routine might not yet have existed.
Respuestas (2)
Image Analyst
el 4 de Dic. de 2011
0 votos
If you don't have the Image Processing Toolbox licensed, you can do it yourself with these equations: http://www.easyrgb.com/index.php?X=MATH
shafyn
el 6 de Abr. de 2017
0 votos
Hello,
I have digital camera images (in RGB form) and I need to convert them to Lab values. I need to know the values of each L, a, and b.It is the image of leaf decay and instead of using a colorimeter to get the Lab values, I want to directly convert the RGB values to the Lab. I want the value of each L, a, and b be displayed when I run the script. Could anyone help me with the script and command on how to do this?
Really appreciate your help. Thank you very much. Siti, Uni of Birmingham, UK
3 comentarios
Image Analyst
el 6 de Abr. de 2017
You can use
labImage = rgb2lab(rgbImage);
to convert the RGB to LAB using book formulas. This WILL NOT give you the same LAB values that you get from your colorimeter because you have not calibrated your system. Think about it. Your object does not change its intrinsic color but you can get virtually any RGB out that you want by changing the exposure time or the color of the lighting. Consequently your LAB values will change. The way to make sure you get the same LAB values out is to calibrate your system with an X-rite Color Checker Chart and a procedure like in the attached presentation.
shafyn
el 7 de Abr. de 2017
Thank you very much. Yes I will need to do some sort of 'calibration curve' where I will plot the Lab values of a colour chart from the colourimeter against the Lab values of the same colour chart image from RGB. From there I can use the curve to predict the Lab values (colourimeter) for other digital camera images.
Image Analyst
el 7 de Abr. de 2017
No plotting needs to be done. What you need to do is a least squares regression to find a model to give estimated LAB values from images. Note, you cannot use that transform that you developed for that camera and that lighting condition to other cameras like you said. Each time you change either the camera or the lighting (geometry, color, intensity) you will need to recompute a new RGB-to-LAB transform (because your RGB values will now be different).
Categorías
Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!