How to remove in rectangle area in picture
Show older comments
Answers (1)
Walter Roberson
on 29 Jun 2017
data = imread('bw0016.png');
newdata = imopen(data,strel('disk',11));
imshow(newdata)
8 Comments
Adisorn Phanukthong
on 29 Jun 2017
Walter Roberson
on 29 Jun 2017
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);
Adisorn Phanukthong
on 29 Jun 2017
Adisorn Phanukthong
on 29 Jun 2017
Walter Roberson
on 29 Jun 2017
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.
Adisorn Phanukthong
on 29 Jun 2017
Adisorn Phanukthong
on 29 Jun 2017
Walter Roberson
on 29 Jun 2017
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.
Categories
Find more on Image Transforms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

