About fourier descriptors

Hi , is the following code right for getting fourier descriptors for a shape ?
[x3,y3] = find(im3,1);
[x4,y4] = find(im4,1);
b3 = bwtraceboundary(im3,[x3 , y3],'N',8,nnz(im3),'clockwise');
b4 = bwtraceboundary(im4,[x4 , y4],'N',8,nnz(im4),'clockwise');
f3 = frdescp(b3);
f4 = frdescp(b4);
f3 = abs(f3);
f4 = abs(f4);
f3 = f3(2:10);
f4 = f4(2:10);
f3 = f3/f3(1);
f4 = f4/f4(1);
is that true ? providing that when i plotted the two boundaries i got those two figures
Note that f3 has the following values
1.0000
0.6550
0.4776
0.6454
0.1478
0.8498
0.4893
0.9819
0.7874
and f4
1.0000
2.0077
0.4963
0.3795
0.5872
1.0960
0.8823
0.8092
0.8482
Both pics have the same size as well
So what is wrong ?

1 Comment

What difference do you see between what you get and what you expect?

Sign in to comment.

Answers (1)

Hayan Tariq
Hayan Tariq on 3 May 2012

0 votes

I am also trying to use fourier descriptor. why do you think there is something wrong. does the descriptor retrieve back almost the original shape? if yes then it is ok.
I am trying to use fourier descriptors as a feature for a classifier like neural net. but i don't know how to use it. can I use like the first 10 descriptor like how you extract the first 10, just use them as an input or there is another way?
thanks

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Asked:

on 25 Apr 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!