Image Segmentation of human skin

3 vues (au cours des 30 derniers jours)
khaled arja
khaled arja le 26 Fév 2019
Commenté : khaled arja le 27 Fév 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

Réponse acceptée

Shunichi Kusano
Shunichi Kusano le 27 Fév 2019
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 commentaire
khaled arja
khaled arja le 27 Fév 2019
Sir ,
you are the man
thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by