Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!a29g2000pra.googlegroups.com!not-for-mail
From: Richard Brown <rgbrown@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Best fit ellipse given vertice and a few points
Date: Fri, 31 Oct 2008 00:56:57 -0700 (PDT)
Organization: http://groups.google.com
Lines: 76
Message-ID: <00192181-63d0-42dc-8c58-acdafe97fa52@a29g2000pra.googlegroups.com>
References: <gdfuiq$det$1@fred.mathworks.com> <gdkaed$bhd$1@fred.mathworks.com> 
	<gdkd4l$5on$1@fred.mathworks.com> <gdkfhh$s5q$1@fred.mathworks.com>
NNTP-Posting-Host: 121.73.120.162
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1225439818 29910 127.0.0.1 (31 Oct 2008 07:56:58 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 31 Oct 2008 07:56:58 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: a29g2000pra.googlegroups.com; posting-host=121.73.120.162; 
	posting-account=5DWgtQoAAADZdTVggSYh0-5t5XsYVHS8
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) 
	Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 nc5 (NetCache NetApp/6.0.5P1)
Bytes: 4322
Xref: news.mathworks.com comp.soft-sys.matlab:498186


On Oct 22, 12:48=A0am, "Conrad Andrew" <conr...@gmx.net> wrote:
> "John D'Errico" <woodch...@rochester.rr.com> wrote in message <gdkd4l$5o.=
..@fred.mathworks.com>...
> > "Conrad Andrew" <conr...@gmx.net> wrote in message <gdkaed$bh...@fred.m=
athworks.com>...
> > > "Conrad Andrew" <conr...@gmx.net> wrote in message <gdfuiq$de...@fred=
.mathworks.com>...
> > > > Hi,
>
> > > > Is it possible to obtain a best-fit ellipse given a few known point=
s:
> > > > =A0. One of the vertices
> > > > =A0. several points (up to 5) located on one of the quadrants which=
 is adjacent to the known vertex point
>
> > > > I tried using theFitEllipsefunction but it doesn't appear to work w=
ell with the data that I have. Is there another function that works similar=
ly toFitEllipseusing the points that I have?
>
> > > > Thanks
>
> > > If it's not possible to solve this problem the way it is, could someo=
ne please let me know?
>
> > Yes, it is possible to "fit an ellipse" to data.
>
> > It is also true that you have not provided
> > enough information about your definition of
> > what fitting an ellipse means to you. Do you
> > mean a fit with errors allowed in both x and y?
> > Will your ellipse be allowed to tilt? What was
> > inadequate about the fit with the code that
> > you tried? Does that data have a better fitting
> > ellipse known to you? Some people want to
> > achieve a degree of fit to some data that is
> > wildly better than the data merits. There are
> > many things we may want in this world that
> > cannot be achieved.
>
> > Finally, you say that you have UP to 5 points
> > to fit an ellipse. However, a fully general
> > ellipse will require AT LEAST 5 points. Any
> > less than that number and the fit will not
> > even be unique. More than 5 points and the
> > fit will not in general be exact, however there
> > will generally be an optimal choice for the
> > parameters, regardless of whether the
> > chosen fitting scheme succeeds in the task.
>
> > John
>
> Thanks for your reply John. To answer your questions, I want to fit the d=
ata with errors allowed for both x and y. The ellipse may be tilted if the =
data dictates it. The problem that I have is that Fitelllipse assumes (I th=
ink so anyway) that the data provided is spread around the ellipse to be ap=
proximated while what I have (5 points) belongs to only one of the quadrant=
s. One additional point provided belongs to the vertex of the ellipse, adja=
cent to the 5 points provided. What I want is a best fit of an ellipse base=
d on this data if it's possible.
>
> Thanks for your time
>
> Conrad

Is it my fitellipse that you are using? ( http://www.mathworks.com/matlabce=
ntral/fileexchange/15125
)
This uses nonlinear least squares and might work for your data - it
doesn't *assume* that your data is spread around the whole ellipse per
se.

Can you post a sample of your data?

cheers,

Richard