Re: One ellipse to rule them all [message #58622] |
Mon, 11 February 2008 15:06  |
ianpaul.freeley
Messages: 18 Registered: March 2007
|
Junior Member |
|
|
On Feb 11, 4:51 pm, David Fanning <n...@dfanning.com> wrote:
> ianpaul.free...@gmail.com writes:
>> I'm hoping someone has done this before and can help me out.
>
>> I have a bunch of x,y points, and I'd like to find the ellipse (with
>> minimum area) that encompasses all of them. Any thoughts?
>
> I can show you how to find an ellipse:
>
> http://www.dfanning.com/ip_tips/fit_ellipse.html
>
> To enclose all the points I would, uh, expand it
> slowly. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
My gut tells me I should be able to do it analytically. I *think* the
two points that have the largest separation should define the major
axis and position angle. Then I just need to fit for the minor axis
from the rest of the points, and the largest one is the winner.
|
|
|
|
Re: One ellipse to rule them all [message #58706 is a reply to message #58622] |
Tue, 12 February 2008 08:08  |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
> My gut tells me I should be able to do it analytically. I *think* the
> two points that have the largest separation should define the major
> axis and position angle. Then I just need to fit for the minor axis
> from the rest of the points, and the largest one is the winner.
I agree with the thoughts of this posting. A little work with a pen
can go a long way.
Personally I would
- start with the ellipse you define, and maybe enlarge it some to be
sure.
- define a cost function for ameoba that adjusts the tilt angle, semi-
minor and semi-major axis where the cost is the area of the ellipse
and you can be sure it has all the points but the cost for not being
huge.
- run it and see what you get
Of course standing on the shoulders of giants is better, so if any of
the mentioned references are good (I didnt read them) then go that
route.
Cheers,
Brian
------------------------------------------------------------ -------------
Brian Larsen
Boston University
Center for Space Physics
|
|
|
Re: One ellipse to rule them all [message #58720 is a reply to message #58622] |
Mon, 11 February 2008 15:55  |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
On Feb 11, 5:06 pm, ianpaul.free...@gmail.com wrote:
> On Feb 11, 4:51 pm, David Fanning <n...@dfanning.com> wrote:
>
>> ianpaul.free...@gmail.com writes:
>>> I'm hoping someone has done this before and can help me out.
>
>>> I have a bunch of x,y points, and I'd like to find the ellipse (with
>>> minimum area) that encompasses all of them. Any thoughts?
>
>> I can show you how to find an ellipse:
>
>> http://www.dfanning.com/ip_tips/fit_ellipse.html
>
>> To enclose all the points I would, uh, expand it
>> slowly. :-)
>
>> Cheers,
>
>> David
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> My gut tells me I should be able to do it analytically. I *think* the
> two points that have the largest separation should define the major
> axis and position angle. Then I just need to fit for the minor axis
> from the rest of the points, and the largest one is the winner.
Look here - and references therein:
http://www-eleves-isia.cma.fr/documentation/CgalDoc2.4/basic _lib/Optimisation_ref/Class_Min_ellipse_2.html
|
|
|
Re: One ellipse to rule them all [message #58721 is a reply to message #58622] |
Mon, 11 February 2008 15:55  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
ianpaul.free...@gmail.com wrote:
> On Feb 11, 4:51 pm, David Fanning <n...@dfanning.com> wrote:
>> ianpaul.free...@gmail.com writes:
>>> I'm hoping someone has done this before and can help me out.
>>
>>> I have a bunch of x,y points, and I'd like to find the ellipse (with
>>> minimum area) that encompasses all of them. Any thoughts?
>>
>> I can show you how to find an ellipse:
>>
>> http://www.dfanning.com/ip_tips/fit_ellipse.html
>>
>> To enclose all the points I would, uh, expand it
>> slowly. :-)
>>
>> Cheers,
>>
>> David
>>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> My gut tells me I should be able to do it analytically. I *think* the
> two points that have the largest separation should define the major
> axis and position angle.
I don't think that is true in general.
Take three points building an equilateral triangle. The minimum
area ellipse including them is the circle centered on the geometric
center of the triangle, not any ellipse whose major axis connects
two points on the triangle.
Cheers,
Paolo
Then I just need to fit for the minor axis
> from the rest of the points, and the largest one is the winner.
|
|
|