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!