comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Regarding the Fit_Ellipse Program
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Regarding the Fit_Ellipse Program [message #59004 is a reply to message #58903] Thu, 28 February 2008 09:10 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
plim.dream...@gmail.com wrote:

[skip]
> I certainly don't understand why there isn't a fit_ellipse program
> that works with the x,y array of the contour vertices instead of the
> pixel indices of the image of a contour (I wish I knew how to make one
> myself).

In general, if you have a number of x and y coordinates for the
boundary
of the ellipse it is not possible to directly use the method used
in fit_ellipse, beacuse if there are, say, twice as many points in
the left side of the ellipse than in the right side, the center of
mass
and moment of inertia will be shifted to the left.

One could then try to "fill out" a two dimensional shape.
Using polyfillv is not a good idea because the results depend in
general on the ordering of the x and y vector (if I swap two
points, the polygon will be different, but the best fit ellipse should
not depend on ordering or labeling of the points).
One could try and use a convex hull insetad, but this may lead to
overestimation of the size of the ellipse and would be really badly
sensitive to outliers.

In such a situation (given unsorted x,y coordinates)
I think that it would probably better to use a minimization function,
with the weight being minimized as the sum of the squares of the
distances of each point to the ellipse. This should not be too hard
to implement.

Paolo




> B
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Histogram: Normalised Occurrence Frequency
Next Topic: google summer of code 2008

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 01:47:50 PDT 2025

Total time taken to generate the page: 0.79726 seconds