Re: Least squares fit of a model to a skeleton consisting out of 3D points. [message #64153 is a reply to message #64029] |
Wed, 03 December 2008 06:14   |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On Dec 2, 10:50 am, Johan <jo...@jmarais.com> wrote:
> On Nov 27, 1:53 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
>
>
>
>> On Nov 26, 3:40 am, Johan <jo...@jmarais.com> wrote:
>
>>> On Nov 24, 4:35 pm, Wox <s...@nomail.com> wrote:
>
>>>> On Mon, 24 Nov 2008 17:22:53 +0100, Wox <s...@nomail.com> wrote:
>>>> >X=[X,Y,Z] ; (you need to extract the seperate X, Y and Z in your user
>>>> >routine)
>>>> >Y=replicate(1,n_elements(X))
>
>>>> Woops, redefined X :-). I mean Y=replicate(1,n3Dpoints).
>
>>> Thank you, it seems that krellipsoidfit.pro works rather well. I do
>>> have another question regarding this and will appreciate if can advise
>>> me.
>
>>> I need to get the 3 angles and axis lengths and use the following code
>>> to get it from the given eigenvalues (evals) and eigenvectors (evec):
>
>>> semia = sqrt(evals[0]) * 2.0
>>> semib = sqrt(evals[1]) * 2.0
>>> semic = sqrt(evals[2]) * 2.0
>
>>> a = semia * 2.0
>>> b = semib * 2.0
>>> c = semic * 2.0
>>> semiAxes = [semia, semib, semic]
>>> axes = [a, b, c]
>
>>> eigenvector = evec[*,0]
>>> eigenvector2 = evec[*,1]
>>> eigenvector3 = evec[*,2]
>
>>> orientation1 = atan(eigenvector1[1], eigenvector1[0])*!RADEG
>>> orientation2 = atan(eigenvector2[1], eigenvector2[0])*!RADEG
>>> orientation3 = atan(eigenvector3[1], eigenvector3[0])*!RADEG
>>> angles = [orientation1, orientation2, orientation3]
>
>>> Is this correct or do I need made some adjustments, especially to the
>>> orientation?
>
>>> Thanks
>>> Johan Marais
>
>> That does indeed give you 3 angles, but it doesn't fully specify the
>> orientation. Which angles are you looking for?
>
>> Incidentally, I'm not quite sure why you have that factor of 2 in the
>> definition of semia etc., but I suppose it depends what went into the
>> matrix you're diagonalizing...
>
>> -Jeremy.- Hide quoted text -
>
>> - Show quoted text -
>
> I tried different ways of getting the angles but it seems I am still
> at a lost. The angles I am looking for is as follow:
> If you have an orthogonal reference framework and the ellipsoid are
> tilted in it. I am looking for the angles that the 3 axes of the
> ellipsoid make with the xy-plane, the yz-plane and yz-plane of the
> reference framework. I assume that for each of them you need to use
> all 3 relevant eigenvectors for each axes of the ellipsoid, or it
> could be only 2?
That's 9 angles, so I'm still not quite sure what you mean. Maybe the
Euler angles would be useful?
-Jeremy.
|
|
|