Image Segmentation of human skin

조회 수: 4 (최근 30일)
khaled arja
khaled arja 2019년 2월 26일
댓글: khaled arja 2019년 2월 27일
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

채택된 답변

Shunichi Kusano
Shunichi Kusano 2019년 2월 27일
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
khaled arja
khaled arja 2019년 2월 27일
Sir ,
you are the man
thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by