comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Least squares fit of a model to a skeleton consisting out of 3D points.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Least squares fit of a model to a skeleton consisting out of 3D points. [message #63921] Mon, 24 November 2008 08:04
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Nov 24, 10:56 am, Johan <jo...@jmarais.com> wrote:
> On Nov 24, 3:13 pm, Paolo <pgri...@gmail.com> wrote:
>
>
>
>> Johan wrote:
>>> I have the following problem to solve and was wondering whether the
>>> mpfit routines of Craig Markwardt will do the job?
>
>>> Do have the following model:
>>> Let g(X,Y,Z)=1 be a quadratic function in the coordinate system
>>> (O,Z,Y,Z) defined by the long, horizontal and vertical axes
>>> (ellipsoid). Write the equation of this quadratic function in matrix
>>> notation as follows:
>
>>> g(X,Y,Z) = [X, Y, Z]*[[A1,A4,A5],[A4,A2,A6],[A5,A6,A3]]*[[X],[Y],[Z]]
>>> + [X, Y, Z]*[[A7],[A8],[A9]]
>
>>> Need to fit this model to a 3D skeleton of N points by using least
>>> squares by calculating the coefficients Ai .
>
>>> This is achieved by minimizing the total squared error between the
>>> exact position of the points (Xi, Yi, Zi) on the quadratic surface and
>>> their real position in the coordinate system (O, X, Y, Z).
>
>> I am confused by this statement. In which system are Xi,Yi,Zi
>> measured?
>> What are "exact" and "real" position? This is very confusing...
>
>> Paolo
>
>>> The
>>> minimizing is performed from the derivative of the equation below with
>>> respect to A1 ... A9:
>
>>> J(A1 ... A9) = for i=0,N sigma(1 (Xi, Yi, Zi))^2
>
>>> This equation yields a linear system of nine equations in which the
>>> values of coefficients A1 ... A9 are unknown.
>
>>> Anyone that can help?
>>> Johan Marais- Hide quoted text -
>
>> - Show quoted text -- Hide quoted text -
>
>> - Show quoted text -
>
> The description I gave is an extract from a publication from which I
> want to implement a specific algorithm and it doesn’t seem to be that
> clear in general.
>
> The problem I want to solve is as follows:
> I have a set of points in 3D from my data that are represented by in a
> specific cartesian coordinate system. I want to fit a 3D ellipsoid (in
> the same coordinate system) to these points to get the long,
> horizontal and vertical axes (their dimensions and orientations) of
> the fitted ellipsoid. My understanding is that the “real” position is
> the position of the specific data points of the data and the “exact”
> position is the position of each point should they fall on the fitted
> ellipsoid’s surface.

You know, I'm pretty sure I used to have IDL code that solved exactly
this problem, but which died during The Great Hard Drive Crash Of
2000. :-( But there's a chance it was from after that... let me see
if I can find it.

-Jeremy.
Re: Least squares fit of a model to a skeleton consisting out of 3D points. [message #63923 is a reply to message #63921] Mon, 24 November 2008 07:56 Go to previous message
Johan is currently offline  Johan
Messages: 5
Registered: November 2008
Junior Member
On Nov 24, 3:13 pm, Paolo <pgri...@gmail.com> wrote:
> Johan wrote:
>> I have the following problem to solve and was wondering whether the
>> mpfit routines of Craig Markwardt will do the job?
>
>> Do have the following model:
>> Let g(X,Y,Z)=1 be a quadratic function in the coordinate system
>> (O,Z,Y,Z) defined by the long, horizontal and vertical axes
>> (ellipsoid). Write the equation of this quadratic function in matrix
>> notation as follows:
>
>> g(X,Y,Z) = [X, Y, Z]*[[A1,A4,A5],[A4,A2,A6],[A5,A6,A3]]*[[X],[Y],[Z]]
>> + [X, Y, Z]*[[A7],[A8],[A9]]
>
>> Need to fit this model to a 3D skeleton of N points by using least
>> squares by calculating the coefficients Ai .
>
>> This is achieved by minimizing the total squared error between the
>> exact position of the points (Xi, Yi, Zi) on the quadratic surface and
>> their real position in the coordinate system (O, X, Y, Z).
>
> I am confused by this statement. In which system are Xi,Yi,Zi
> measured?
> What are "exact" and "real" position? This is very confusing...
>
> Paolo
>
>
>
>> The
>> minimizing is performed from the derivative of the equation below with
>> respect to A1 ... A9:
>
>> J(A1 ... A9) = for i=0,N sigma(1 (Xi, Yi, Zi))^2
>
>> This equation yields a linear system of nine equations in which the
>> values of coefficients A1 ... A9 are unknown.
>
>> Anyone that can help?
>> Johan Marais- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

The description I gave is an extract from a publication from which I
want to implement a specific algorithm and it doesn’t seem to be that
clear in general.

The problem I want to solve is as follows:
I have a set of points in 3D from my data that are represented by in a
specific cartesian coordinate system. I want to fit a 3D ellipsoid (in
the same coordinate system) to these points to get the long,
horizontal and vertical axes (their dimensions and orientations) of
the fitted ellipsoid. My understanding is that the “real” position is
the position of the specific data points of the data and the “exact”
position is the position of each point should they fall on the fitted
ellipsoid’s surface.
Re: Least squares fit of a model to a skeleton consisting out of 3D points. [message #63924 is a reply to message #63923] Mon, 24 November 2008 07:13 Go to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Johan wrote:
> I have the following problem to solve and was wondering whether the
> mpfit routines of Craig Markwardt will do the job?
>
> Do have the following model:
> Let g(X,Y,Z)=1 be a quadratic function in the coordinate system
> (O,Z,Y,Z) defined by the long, horizontal and vertical axes
> (ellipsoid). Write the equation of this quadratic function in matrix
> notation as follows:
>
> g(X,Y,Z) = [X, Y, Z]*[[A1,A4,A5],[A4,A2,A6],[A5,A6,A3]]*[[X],[Y],[Z]]
> + [X, Y, Z]*[[A7],[A8],[A9]]
>
> Need to fit this model to a 3D skeleton of N points by using least
> squares by calculating the coefficients Ai .
>
> This is achieved by minimizing the total squared error between the
> exact position of the points (Xi, Yi, Zi) on the quadratic surface and
> their real position in the coordinate system (O, X, Y, Z).
I am confused by this statement. In which system are Xi,Yi,Zi
measured?
What are "exact" and "real" position? This is very confusing...

Paolo

> The
> minimizing is performed from the derivative of the equation below with
> respect to A1 ... A9:
>
> J(A1 ... A9) = for i=0,N sigma(1 � (Xi, Yi, Zi))^2
>
> This equation yields a linear system of nine equations in which the
> values of coefficients A1 ... A9 are unknown.
>
> Anyone that can help?
> Johan Marais
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Real time application
Next Topic: Resolution returned from MAP_PROJ_IMAGE?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:51:54 PDT 2025

Total time taken to generate the page: 0.00693 seconds