Does bwboundaries work properly ?
이전 댓글 표시
hi all , I am wondering if bwboundaries function of the IPT works properly , i use it for fourier descriptors but it generates very very poor results ,
i used this code for getting fourier descriptors for tow identical but different in size ovals
im1 = imread('sc1.gif');
im2 = imread('sc2.gif');
im1 = im2bw(im1);
im2 = im2bw(im2);
b1 = bwboundaires(im1);
b2 = bwboundaries(im2);
f1 = frdescp(b1{1});
f2 = frdescp(b2{1});
f1 = f1(2:10);
f1 = abs(f1);
f1 = f1/f1(1);
f2 = f2(2:10);
f2 = f2/f2(1);
f2 = abs(f2);
and the result was f2 = 1.00 0.7534 0.6284 1.4481 and others f1 = 1.00 1.8451 1.1260 1.9316 and others !!
so what i need is to know if this function returns an ordered set of points in a boundary or not , or i need to know how to generate fourier descriptors for an object !!
답변 (1개)
Walter Roberson
2012년 4월 18일
0 개 추천
The documentation for bwboundaries does not promise that the pixels returned will be in any particular order, just that they will be boundary pixels.
If you need an ordered trace, check bwtraceboundary() . Watch out, though, for the tracing of corners, as it might not come out exactly as you expect.
댓글 수: 2
Adham
2012년 4월 18일
Walter Roberson
2012년 4월 18일
bwtraceboundary() -- but experiment with some corner shapes to be sure you understand the trace order at corners.
카테고리
도움말 센터 및 File Exchange에서 Object Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!