I am working on a project where I have to find deltaE value of CIElab image... The formula for deltaE is sqrt((L1-L​2)^2+(a1-a​2)^2+(b1-b​2)^2). And also I want to know how to find L1,L2,a1,a2,b1,b2

3 views (last 30 days)
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
Sivasurya J
Sivasurya J on 1 Mar 2018
@jonas:- If I am having two images... one is my reference image(another eye image). Now I need to find DeltaE value. How could you help me with code..? a = imread('eye.jpg'); imshow(a); cform = makecform('srgb2lab'); lab_Image = applycform(im2double(a),cform); LChannel = lab_Image(:,:,1); aChannel = lab_Image(:,:,2); bChannel = lab_Image(:,:,3); [LMean,aMean,bMean] = GetMeanLABValues(LChannel,aChannel,bChannel,mask); lRef = LMean(indexOfReferenceImage); aRef = aMean(indexOfReferenceImage); bRef = bMean(indexOfReferenceImage); deltaLs = LMean - lRef; deltaas = aMean - aRef; deltabs = bMean - bRef; deltaEs = sqrt(deltaLs.^2+deltaas.^2+deltabs.^2); This image shows error at Ref... Can you help me?
Image Analyst
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.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!