how can remove corner of binary image??
1 view (last 30 days)
Iain on 1 Oct 2014
Edited: Iain on 1 Oct 2014
If you repeatedly erode & dilate (imerode & imdilate) the image you should get close to what you want if you use the right "neighbourhoods".
You could alternatively generate ANOTHER binary image, which is 1 (true) where you want to keep it, and 0 where you want to discard it. You'll need to think about how you generate that image, but for a simple version:
other_binary_image = false(size(im));
other_binary_image(:,1:50) = true; % to keep the left 50 columns
new_image = im & other_binary_image;
You'll need to think about how you generate this "mask" to make sure it does what you want it to.