why does bwperim make the border WHITE?!!
이전 댓글 표시
I want to use bwperim to calculate the perimeter of an object, but I got a strange thing!
I use bwperim in two different states: first to the original binary image and second to its inverse, i.e.,:
%%binaryImage
perim1 = bwperim (binaryImage);
perim2 = bwperim (~binaryImage);
The strange thing is that the first one (perim1) gives an image that is almost black (except the detected boundaries, of course), but:
Exactly, the borders of the whole image, I mean the FIRST row and column and the LAST row and column are white! I mean it has given the value of 1 to the pixels of the image border! Why?!!
For the second one (perim2), this is not the case and it is correct as the original image.
The binary image:
perim1 (with white border):
perim2:
Thanks so much!
Steven
댓글 수: 6
Walter Roberson
2013년 12월 25일
Could you post your binaryImage and your perim1 and perim2 ?
Walter Roberson
2013년 12월 25일
I cannot tell for sure, but it looks to me as if the original might have a single-row outline of 0's all around it.
Steven
2013년 12월 25일
Walter Roberson
2013년 12월 25일
How did you create the binary image? What image did you start with and how did you process it?
Walter Roberson
2013년 12월 25일
but be careful about the possibility that some of your image touches the border.
Steven
2013년 12월 25일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Object Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!