how to remove unwanted pixels

1 view (last 30 days)
nkumar
nkumar on 29 Jun 2013
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)

Answers (1)

Image Analyst
Image Analyst on 29 Jun 2013
Edited: Image Analyst on 29 Jun 2013
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 Comment
nkumar
nkumar on 1 Jul 2013
the pic is at
tghe first imaeg is working correctly filled with white region,but second is not as first

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!