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!