I am working on a project where I have to find deltaE value of CIElab image... The formula for deltaE is sqrt((L1-L2)^2+(a1-a2)^2+(b1-b2)^2). And also I want to know how to find L1,L2,a1,a2,b1,b2
3 views (last 30 days)
Show older comments
My project is to detect anemia using eye image... So far I have found segmenting red color and mean values... My code is
%Segmentation of eye image
a = imread('eye.jpg');
imshow(a);title('H&E image');
text(size(a,2),size(a,1)+15,...
'Image Courtesy of Alen Partin,Johns Hopkins University',...
'FontSize',7,'HorizontalAlignment','right');
cform = makecform('srgb2lab');
lab_i = applycform(a,cform);
ab = double(lab_i(:,:,2:3));
nrows = size(ab,1);
ncols = size(ab,2);
ab = reshape(ab,nrows*ncols,2);
nColors = 3;
[cluster_idx,cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean',...
'Replicates',3);
pixel_labels = reshape(cluster_idx,nrows,ncols);
imshow(pixel_labels,[]),title('image labeled by clusterindex');
segmented_images = cell(1,3);
rgb_label = repmat(pixel_labels,[1 1 3]);
for k = 1:nColors
color = a;
color(rgb_label~=k) = 0;
segmented_images{k} = color;
end
imshow(segmented_images{1}),title('objects in cluster 1');
imshow(segmented_images{2}),title('objects in cluster 2');
%To make background black null
i2 = segmented_images{2};
background = i2<50;
i2(background) = 0;
impixelinfo % To check whether background black is zero
%Mean values
mean(mean(i2))% Mean R,G,B
% converting i2 Image to lab
cform = makecform('srgb2lab');
lab_Image = applycform(im2double(i2),cform);
imshow(lab_Image)
Now I have to find the L1,L2,a1,a2,b1,b2 values which are needed to find deltaE = (sqrt((L1-L2)^2 + (a1-a2)^2 + (b1_b2)^2)
So please help me with code... Thanks in advance:)
17 Comments
Image Analyst
on 1 Mar 2018
There is a lot wrong with much/most of what you've written above. I don't have time to explain it all now - hopefully tomorrow. In the meantime, I don't see your eye image and reference image posted, so please post them.
Answers (0)
See Also
Categories
Find more on Color in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!