how to extract a region of white pixel bounded by black pixel from white background

1 view (last 30 days)

Accepted Answer

Image Analyst
Image Analyst on 10 Jun 2016
It looks like a binary image. If it is, call imclearborder
binaryImage = imclearborder(binaryImage);
This will get rid of all white/1/true regions touching the edge of the image.
  3 Comments
Image Analyst
Image Analyst on 11 Jun 2016
When you say that you want to "extract a region of white pixel bounded by black pixel" I'm assuming that you want to get rid of the white surrounding region that is touching the border. To do that you use imclearborder. I show proof with the attached m-file and this image that is creates. So explain why you said it's "not working" because the white blob is surrounded by black.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!