hbldh / pyefd

Python implementation of "Elliptic Fourier Features of a Closed Contour"

Home Page:http://pyefd.readthedocs.org/

Repository from Github https://github.comhbldh/pyefdRepository from Github https://github.comhbldh/pyefd

Method not robust to random index ?

julienguegan opened this issue · comments

Hello,

I wanted to test your method, I do not really know how does it works but it seems that how the point are indexed have some importance as I get strange result when the array is indexed differently ... Is there a way to resolve this ?

Find below illustration of what I mean

normal result when points are correctly ordered
image

abnormal result when points are randomly ordered
image

No, I am afraid not. PyEFD is an implementation of a method described in the paper referenced in the README, and it operates on ordered points. It can never work differently.

Order your points if you want to use this package.

OK ... Actually, I am not quite sure about what "ordered" mean in this case, is it something like the next point in the list should be the nearest (in term of euclidean distance ?) or is it more something according to how we draw the curve ? For example, how would you ordered the points for the contour of the number 8 (especially, the centered points) ?

Read the paper. The definition is there. Practically this means that the consecutive points should form the path you wish to describe.

I wrote this to work well with opencv contour finding method. If you want to use points you extract in any other way you have to put them in the order needed to describe your shape.