MATLAB Answers

0

Image Segmentation of human skin

Asked by khaled arja on 26 Feb 2019
Latest activity Commented on by khaled arja on 27 Feb 2019
Hello,
I am struggling to find a way how to segment the two type of cell that we can see in the image below.
The main goal is to separate the two main zones and not to enter each cell.
I have tried to take a small crop of one zone and correlate it with the image then apply thresholding, but that doesn't give satisfying results, unless my code wasn't good.
I have tried to apply Kmeans, but it was too specific and it has separated the cells and the white and everything.
I would be thankful if you can propose a method or a code that could help me with my project.
skin1.jpg

  0 Comments

Sign in to comment.

1 Answer

Answer by Shunichi Kusano on 27 Feb 2019
 Accepted Answer

I could show a result, though I'm not sure this meets you. The strategy is simple. First, non-skin (air?), shallower skin (bluish in image), and deeper skin are rougly separeted based on color. I used the Color Thresholder app in matlab, generating attached m-files. Then, mask arrays are refined by trial and error through imfill, bwareaopen and so on. I hope this helps.
%% read image
img = imread('skin1.jpeg');
%% mask generation
[BWAir,~] = createMaskSkin(img);
[BWDeepSkin,~] = createMaskShallowSkin(img);
%% Air-mask refinement
figure, imshow(BWAir);
BWAir_fill = imfill(BWAir, 'hole');
BWAir2 = bwareaopen(BWAir_fill, 100000);
figure, imshow(BWAir2);
%% Deepskin-mask refinement
figure, imshow(BWDeepSkin);
BWDeepSkinClose = imclose(BWDeepSkin, strel('disk',3));
BWDeepSkin_fill = imfill(BWDeepSkinClose, 'hole');
BWDeepSkin_fill = bwareaopen(BWDeepSkin_fill, 10000);
BWDeepSkin2 = imcomplement(bwareaopen(imcomplement(BWDeepSkin_fill), 2000));
figure, imshow(BWDeepSkin2)
%% boundaries visualization
figure(99)
imshow(img)
hold on;
visboundaries(BWAir2)
visboundaries(BWDeepSkin2)

  1 Comment

Sir ,
you are the man
thank you

Sign in to comment.