Does bwboundaries work properly ?
Afficher commentaires plus anciens
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 !!
Réponses (1)
Walter Roberson
le 18 Avr 2012
0 votes
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 commentaires
Adham
le 18 Avr 2012
Walter Roberson
le 18 Avr 2012
bwtraceboundary() -- but experiment with some corner shapes to be sure you understand the trace order at corners.
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!