Re: Fitting an ellipsoid with MPFITEXPR [message #74264] |
Mon, 10 January 2011 04:54 |
johan[1]
Messages: 11 Registered: December 2010
|
Junior Member |
|
|
On Jan 9, 1:27 am, "Phillip M. Bitzer" <phillipbit...@gmail.com>
wrote:
> Ronn Kling has a routine that may be of some help. See:
>
> http://www.kilvarock.com/cool-stuff.htm
On Jan 9, 1:27 am, "Phillip M. Bitzer" <phillipbit...@gmail.com>
wrote:
> Ronn Kling has a routine that may be of some help. See:
>
> http://www.kilvarock.com/cool-stuff.htm
Thanks for both replies. I used the routines from Ronn Kling for some
time but I do have a problem with it. The values for both the size of
the axis and the angles do not seems to be right but if I use the
calculated second moment values, P, together with k=2 as follow:
theta: 0deg -> 360deg
psi: -90deg -> 90deg
u = [sin(theta)*cos(psi), cos(theta)*cos(psi), sin(psi)]
r = k/sqrt((u # invert(P) # u))
I was able to get the right size and shape of the ellispsoid but still
needed the angles.
The routine mpfitellipse.pro is unfortunately only for 2-D. I did try
to extend it to 3D. Again, the size of the axes are incorrect in my
implementation but in this case the angles are correct!
When I created a "combined" routine by calculating the second moments
and using the angles from the 3D implementation of mpfitellipse.pro I
am able to get the desired result.
This will work for me but I feel uncomfortable with the fact that I do
not get all the correct parameters from either Ron Kling's
krEllipsoidFit or the 3D implementation of mpfitellipse, feeling
something must be wrong and my implementation will not stand the test
of time!
|
|
|
|
|