Re: Fitting a 3D circle to a lobsided set of points
- From: spellucci@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (Peter Spellucci)
- Date: Tue, 25 Nov 2008 13:50:13 +0100 (CET)
In article <84a6d604-e243-425c-be7d-610c8ccd63bd@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Dave the Funkatron <dave.rudolf@xxxxxxxx> writes:
Hi all,
Suppose I have a set of 3D points that are roughly in one quadrant of
a circle, and I want to find the plane that they are on, as well as
they are on a plane or on the sphere ???? or inside the ?? orthnat of the
sphere?
if you can fit by a plane, then there are many spheres which satisfy your
description, so i guess you mean "on" the sphere:
well
sum_{i=1 to N} ( sqrt((x_i -xmid)^2+(y_i-ymid)^2+(z_i-zmid)^2)-radius)^2
= min subject to xmid,ymid,zmid,radius.
well, nonlinear, -> levenberg-marquardt or gauss-newton -> elsunc
(this is software on http://plato.asu.edu/sub/nonlsq.html)
but you need an initial guess
well
multiply the summand by ( sqrt(....) + radius)^2 getting
sum_{i=1 to N} ( (x_i -xmid)^2+(y_i-ymid)^2+(z_i-zmid)^2 - radius^2)^2 =min
simplify ...
sum_{i=1 to N} ( a_i + b_i*xmid + c_i*ymid + d_i*zmid + t )^2 = min
where
a_i = x_i^2+y_i^2+z_i^2 , b_i =-2*x_i , c_i = -2*y_i ,
d_i = -2*z_i
and t=xmid^2+ymid^2+zmid^2-radius^2
this is now linear least sqaures in the four unknowns from which you also can
recover the radius
if you meant "inside the sphere" then it becomes a little bit harder:
minimize f(xmid,ymid,zmid,radius) = radius
subject to
radius^2 >= (x_i -xmid)^+(y_i-ymid)^2 + (z_i-zmid)^2 i=1,...,N
this is a nonlinear constrained problem, software again at the source above,
again you need an initial guess: midpoint=center of gravity, radius the
largest distance
hth
peter
the center of the circle (and, maybe its radius). Finding the plane.
isn't too hard -- simple least-squares fit. Getting the actual circle
is somewhat harder.
I have seen least-squares types of approaches that use SVD, but they
all assume that the center of the circle is at the centroid of the 3D
points. In my case, this is not true.
I have also seen global optimization methods that try to solve similar
problems (like for the center and radius of a sphere). However, I am
worried that such an approach will be quite slow if I do not have some
bounds on how large the circle's radius can be.
So, I'm wondering what other options are out there. Any ideas would be
appreciated.
Thanks.
Dave
- Follow-Ups:
- Re: Fitting a 3D circle to a lobsided set of points
- From: Dave the Funkatron
- Re: Fitting a 3D circle to a lobsided set of points
- References:
- Fitting a 3D circle to a lobsided set of points
- From: Dave the Funkatron
- Fitting a 3D circle to a lobsided set of points
- Prev by Date: Fitting a 3D circle to a lobsided set of points
- Next by Date: Research assistantship in brain science
- Previous by thread: Fitting a 3D circle to a lobsided set of points
- Next by thread: Re: Fitting a 3D circle to a lobsided set of points
- Index(es):
Relevant Pages
|
Loading