MATLAB Answers

How to detect the boundary (binary image)

5 views (last 30 days)
How do I write a program to delete the line L1 (binary image) and make the red line around the boundary area (B2) with the matlab language. From aree.supha@gmail.com

  0 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 1 Dec 2019
One way is to call imclose(), then cast the image to double and then blur it with conv2() and threshold it. Then remove any holes that remain.
mask = imclose(mask, true(7));
mask = conv2(double(mask), ones(3), 'same') > 3; % Adjust number to control the size of the new mask.
mask = imfill(mask, 'holes'); % Remove any interior holes.
Another way might be to use activecontour(). See attached demo. Attach your image if you can't figure it out.

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.