Why does bwperim give wrong perimeter?
이전 댓글 표시
I wanted to get the perimeter of the following circle. I used two methods, but got completely different results!

1. I used bwperim (after getting binary):
%% BW is the binary image of original greyscale image
BW_perim = bwperim(BW);
L = sum(sum(BW_perim));
I got this:

2. I used imfindcircle:
[centers,radius] = imfindcircles(greyscale);
L2 = 2*pi*radius
and I got this:

The results are completely different. The first one value is about 7 times the second one (in dimensional domain, the second one is reasonable).
I do not know why! Interesting is that the area is almost correct and the results are similar, but the perimeter is not!
1. What is wrong with the first method? Because my other images are not full circles and I have to use bwperim to get the perimeter.
Thanks so much!
채택된 답변
추가 답변 (1개)
Walter Roberson
2014년 4월 15일
0 개 추천
Consider using imclose() on the labeled image and then taking the perimeter.
카테고리
도움말 센터 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!