how to remove unwanted pixels

2 次查看(过去 30 天)
nkumar
nkumar 2013-6-29
I have a face image and have created mask for it now i want tp remove the shoulder portion,i need only the mask,kindly help
my code
clc
clear all
I=imread('images.jpg');
a=rgb2gray(I);
bw=edge(a,'canny');
imshow(bw)
bw = bwareaopen(bw,30);
se = strel('disk',2);
bw2 = imclose(bw,se);,
bw1 = imfill(bw2,'holes');
L = bwlabel(bw1);
figure,imshow(bw1)

回答(1 个)

Image Analyst
Image Analyst 2013-6-29
编辑:Image Analyst 2013-6-29
I can't view your image on that web site. And I couldn't download it either. That has to be one of the mose annoying file sharing sites I've seen. Why not use snag.gy or tinypic.com or some site where we can immediately see the image and not have to do multiple clicks and download some executable?
In general I don't see that algorithm as being effective. I might try to do skin color detection and then look where the skin is wide (the face) then gets narrow for a stretch (in the neck) and then either vanishes (wearing a shirt) or widens way out again (no shirt covering the shoulders). But it depends on how reproducible and alike your photos are and what kind of hair and clothing you expect to be present on the subjects.
  1 个评论
nkumar
nkumar 2013-7-1
the pic is at
tghe first imaeg is working correctly filled with white region,but second is not as first

请先登录,再进行评论。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by