Code covered by the BSD License  

Highlights from
Elliptic fourier for shape analysis

image thumbnail

Elliptic fourier for shape analysis

by

 

06 Sep 2011 (Updated )

Implementation of elliptic fourier for shape analysis.

calc_traversal_dist(ai)
function output = calc_traversal_dist(ai)

% This function will generate position coordinates of chain code (ai). Number of 
% harmonic elements (n), and number of points for reconstruction (m) must be 
% specified.  

    x_ = 0;
    y_ = 0;
    
    for i = 1 : size(ai, 2)        
        x_ = x_ + sign(6 - ai(i)) * sign(2 - ai(i));
        y_ = y_ + sign(4 - ai(i)) * sign(ai(i));
        p(i, 1) = x_;
        p(i, 2) = y_;
    end
    
    output = p;
    
end

Contact us