How to remove in rectangle area in picture

Answers (1)

data = imread('bw0016.png');
newdata = imopen(data,strel('disk',11));
imshow(newdata)

8 Comments

I want to remove hand and still this area
newdata = imopen(data, strel('disk',30));
newdata = bwareafilt(newdata, 1);
stats = regionprops(newdata, 'BoundingBox');
cropx = floor(stats.BoundingBox(1));
cropy = floor(stats.BoundingBox(2));
cropped_data = data(cropy:end, cropx:end);
imshow(cropped_data);
if picture show 2 hands ?
There is no rectangular region to remove in this image.
You have not defined which part you want to remove for this. In the previous image you wanted one hand removed but not the other. In this one we do not know if you only want the hand to the left to be removed, or only the hand to the right, or if you want both hands removed.
I want both hands removed.
removed or fill black in hand
imopen() with some appropriate strel disk radius. regionprops to get the bounding box. imcrop the original using that bounding box.
I did not use imcrop in the above because you indicated that you wanted all of what was to the right of the white rectangular area.

Sign in to comment.

Products

Asked:

on 29 Jun 2017

Commented:

on 29 Jun 2017

Community Treasure Hunt

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

Start Hunting!