the small part of the finger above the leaf is really difficult for me to remove. I tried to remove it based on Hue, but it also remove the brown parts of the leaves.
How can I remove everything except leaves?
2 ビュー (過去 30 日間)
古いコメントを表示
Oveis Hassanijalilian
2014 年 12 月 2 日
コメント済み: Mohammad Abouali
2014 年 12 月 2 日
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146295/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146296/image.png)
採用された回答
Mohammad Abouali
2014 年 12 月 2 日
編集済み: Mohammad Abouali
2014 年 12 月 2 日
Use a combination of hsv and activecontour
I=imread('Finger2.png');
hsv=rgb2hsv(I);
m=(hsv(:,:,1)>0.08 & hsv(:,:,1)<0.2);
m2=activecontour(hsv(:,:,1),m,'edge','ContractionBias',-0.1);
imshow(m2)
Movafagh bashi
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176964/image.jpeg)
2 件のコメント
Mohammad Abouali
2014 年 12 月 2 日
mmmm.
How about this?
I=imread('Finger2.png');
hsv=rgb2hsv(I);
m=(hsv(:,:,1)>0.08 & hsv(:,:,1)<0.2);
m=imfill(m,'holes');
m=bwmorph(m,'majority',25);
m2=activecontour(hsv(:,:,1),m,'edge','SmoothFactor',1.5);
imshow(m2)
It doesn't work as good as last one though.
Try some dilation and erosion too.
その他の回答 (1 件)
Deepesh B
2014 年 12 月 2 日
hi
By
imtool
command find exact threshold for leaves color and apply segmentation for that color only finger will be automatically remove d
while fixing threshold use separate threshold for R, G, B with | & conditions
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!