How to understand segmentation colour in image?

조회 수: 1 (최근 30일)
diah atus
diah atus 2016년 4월 1일
편집: Image Analyst 2016년 4월 1일
Hi all Right now I am in process to understand and learn how to segmented colour in image. I found example coding of programming but I am not very clear with that. Here I attached the example of code in matlab:
cform = makecform('srgb2lab');
lab_he = applycform(he,cform);
ab = double(lab_he(:,:,2:3));
nrows = size(ab,1);
ncols = size(ab,2);
ab = reshape(ab,nrows*ncols,2);
Here is my question; 1. why need to double only 2:3?Why luminosity value no need to be double? 2. What is function to reshape value of ab?

답변 (1개)

Image Analyst
Image Analyst 2016년 4월 1일
편집: Image Analyst 2016년 4월 1일
The image is converted to LAB color space - see picture below.
Then the a and b channels are extracted into a 3D image. Then a list of all [a,b] pairs are formed into a 2D list where each row is the a and b value for that pixel.
I have several color segmentation demos in my File Exchange. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by