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

Home » Public Forums » archive » Ellipse fitting?
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: Ellipse fitting [message #72471 is a reply to message #66407] Thu, 09 September 2010 06:29 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<a8e942ee-0554-42d6-9bad-caf77b03935b@a11g2000vbn.googlegroups.com>,
Oriol G�ell Riera <oriolguellriera@gmail.com> wrote:

> Hi all,
> I've got a problem when I try to find the orientation of a fitted
> ellipse of a region of interest (http://www.dfanning.com/ip_tips/
> fit_ellipse.html).
> I've got an stack of images of an ellipse rotating. My problem arises
> when I try to find the eigenvectors of the covariance matrix, the
> signs of the components of them change randomly. In other words, I
> start with my ellipse in the 3rd quadrant. The first image gives the
> correct signs for the components of the principal eigenvector, but the
> second image doesn't give the signs of the components well, so in this
> case the eigenvector is located in the 4th quadrant, but my ellipse
> still stands in the 3rd quadrant!
> I don't know if I have explained my problem correctly. The problem
> comes from the indeterminacy of the signs of the eigenvectors. If they
> had the correct signs, I would use the atan2 function, which will give
> the correct orientation. However, the signs aren't correct, so I can't
> get the orientation of the ellipse after a whole rotation.
> Thank you very much

As you say, the signs of the eigenvectors are indeterminate.

If the rotations between successive instances are small, you should
be able to check which option gives you the smaller rotation.
That is, check ATAN(y, x) and ATAN(-y, -x) and see which
gives the smaller angular difference from the previous orientation.
You have to be careful when cross the origin.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Error in graphics webinar example
Next Topic: widget_list() question

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

Current Time: Fri Oct 10 12:13:36 PDT 2025

Total time taken to generate the page: 0.00712 seconds