You are on page 1of 2

Leukemia Cancer Detection

rgb = imread('D:\Leukemia Cancer\F1.jpg’);


figure, imshow(rgb);
grayim = rgb2gray(rgb);
imshow(grayim);
[centers, radii] = imfindcircles(rgb,[35 60],'ObjectPolarity','dark','Sensitivity',0.9);
imshow(rgb);
h = viscircles(centers,radii);
cell=length(centers);
red=rgb(:,:,1);green= rgb(:,:,2); blue= rgb(:,:,3);
%p=impixel(rgb);
out=red>25 & red<123 &green<135 & blue>167 & blue<201;
imshow(out);
out1=imfill(out,'holes');
imshow(out1);
out2=bwmorph(out1,'dilate',2);
imshow(out2);
[l,NUM]=bwlabel(out2,4);
Cancer=(NUM/cell)*100;
if Cancer<25
disp('initial stage');
disp('Cancer percentage is')
disp(Cancer);
end
Before Detection

After Detection

You might also like