how to extract the a and b channel from the lab color space
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
how to extract the a and b channel from the lab color space
0 comentarios
Respuestas (2)
Geoff Hayes
el 14 de Feb. de 2015
Sathiya - if you have access to the Image Processing Toolbox, try using the rgb2lab function which will convert your RGB image to L*a*b*. For example,
rgbImg = imread('someImage.jpg');
labImg = rgb2lab(rgbImg);
Then, to get the a* and b* channels, just access the third dimension of the labImg as
% get the a channel
aChannel = labImg(:,:,2);
% get the b channel
bChannel = labImg(:,:,3);
Try the above and see what happens!
0 comentarios
Image Analyst
el 14 de Feb. de 2015
Attached is a very useful demo, an adaptation of a demo the leader of the Image Processing Team at the Mathworks sent to me. It gets LAB and HSV and then displays the colors for a variety of L and V values. Here's two of the images it produces. LAB is useful if you want to get color differences but is probably not as good as HSV if you want to do color segmentation. I do all my color segmentation in hsv color space. Notice how the colors seems to change depending on the L level (like blue going to cyan), but how the colors don't change in HSV space. So if you want to get blue, you'll have to take L into account in LAB color space (in fact there isn't even any pure deep blue for higher L values), but if you want blue and you use HSV color space, you do not need to worry about V.


0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!