How to find the coordinates of inner boundary of the object?

7 views (last 30 days)
I want to find the coordinates of the just inner boundary of the object as in figure 1. How can I find the coordinates of the boundary in figure 2 based on figure 1.

Answers (2)

Walter Roberson
Walter Roberson on 19 Jan 2017
imerode() or bwmorph() the image, and then bwboundaries or bwtraceboundary

Image Analyst
Image Analyst on 19 Jan 2017
Draw a line across the inner gap, then call bwboundaries(), then throw away the outer boundary, and remove gap pixels. Not hard, so give it a try.
  2 Comments
AKASH G
AKASH G on 19 Jan 2017
Thanks for answering, but can you please elaborate. How to differentiate between inner and outer boundaries?
Walter Roberson
Walter Roberson on 19 Jan 2017
If you draw a line across the inner gap, then you can imfill the hole. Subtract the unfilled but closed version from that to get an object that fills the hole and nothing else. trace the boundary of that and that will be the coordinates of the inside of the gap.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!