How to detect and label edges of a binary image?

11 次查看(过去 30 天)
I am trying to get the pixel positions of the outer edge and the inner edge of the image separately.
I am trying to do so by using the edge function (with sobel method) which gives good results. Here are the problems I am facing:
  1. I want the outer most edge and the inner edge. All the other noises/separated islands in the images are something I would like to filter out. Is there any way to run the edge detection/any other function to do that?
  2. I want to get the pixel positions of the outermost edge and the inner most edge separately. Is there anyway to label the continuous edges so that I can store them separately?
I am open to suggestion about any other way to achieve the above mentioned goals. Thank you.

采纳的回答

Trevor
Trevor 2020-9-4
Well, I felt like I should post the solution in case someone needs it in future.
I filtered out the islands/discontinuous edges by using bwareaopen() .
I detected the edge using edge() function
Then I used bwconncomp() function followed by labelmatrix() to label the edges.

更多回答(0 个)

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by