Re: Fitting a 3D circle to a lobsided set of points




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
.



Relevant Pages

  • Re: Fit sphere to planar circles
    ... My approach so far has been to use hough circle detection in the area of = ... sphere regions of the sphere, and I am using some logic = ... I have a similar problem and I abandoned the hough transform. ... normalization though) at the radius of interest. ...
    (comp.soft-sys.matlab)
  • Re: two rotations make a sphere
    ... take only one-half rotation of a circle to produce a sphere ... and only one complete rotation ... since there is no ebb and flow in this third plane. ...
    (sci.physics)
  • Re: [Embedded troll] Easy Questions
    ... and travels due north for one kilometer, ... which assumes you are working on a flat plane. ... the surface of a sphere is a closed ... On a circle, if you keep ...
    (comp.arch.embedded)
  • Re: Simple (?) Problem
    ... R^3 (the intersection of a plane and a sphere), ... to q that is on the circle. ... I need an explicit solution to this problem. ... Starting from a sphere with radius 1 centered at the ...
    (sci.math)
  • Re: circle through 3 points in 3-space
    ... What I need is the Center point to the according circle ... Rotate the plane of the points into ... that plane and the normal vector to ... surface of the sphere. ...
    (comp.soft-sys.matlab)

Loading