bwlabel changing connectivity of image
이전 댓글 표시
I am trying to use BWLabel to label 1 pixel width line segments. These lines are not straight so I am using a connectivity of 8. When I run bwlabel and view the image of the newly labeled skeleton, it actually is changing layout, size and connectivity of the line segments. The input image is a double. I am using Matlab R2009b.
Am I asking bwlabel to be too sensitive? I am using this as part of a larger code that is trying to find the angle of these segments by using the segment endpoints, so maintaining separation is important.
Below is the code I used to generate the two supplied images
% A = image to be labeled.
figure(1), imshow(A)
A2 = bwlabel(A,8);
figure(2), imshow(A2)
채택된 답변
추가 답변 (1개)
Stephen
2012년 5월 31일
1 개 추천
I agree with Image Analyst. Is your image a jpg or has it been compressed? If so, there are little ghosts that lurk as low intensity values on certain pixels. bwlabel uses any value above 0 (or below?) so those sneaky pixels will get marked. Take a look at what a==0 looks like, or type unique(a) to see a list of the unique intensity values.
카테고리
도움말 센터 및 File Exchange에서 Image Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!