Count amount of contours in images

조회 수: 1 (최근 30일)
Chok Chuan
Chok Chuan 2015년 5월 4일
댓글: Chok Chuan 2015년 5월 4일
In this picture there are 3 closed small contours ( circle like ) how do I extract them from the picture and I need to count their area too. I inverted the original picture into this so it's clearer to see open contours. I'll show the original picture too

답변 (1개)

Walter Roberson
Walter Roberson 2015년 5월 4일
Use something like bwlabel() to label the image. Then use regionprops to find the Euler number for each of the regions. For contours that have no loops, the number will be 1 (one object minus zero holes), and for open holes the number will be 0 (one object minus one hole).
Note that the long contour near your bright spot includes a closed loop and so would be characteristic 0 just like the open circles. To distinguish that, you could look at the regionprops Eccentricity, which will be close to 0 for the circles.
  댓글 수: 1
Chok Chuan
Chok Chuan 2015년 5월 4일
Hi I am relatively new to this Matlab I havent even use it for like 2 weeks, is there any example?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by