Results 1 to 2 of 2

Thread: Quaternions, rigid body rotation (matlab)

  1. #1
    Sep 2010

    Quaternions, rigid body rotation (matlab)

    I've been watching a set of videos on medical image processing, and I'm working through a section on using Quaternions for 3 d image registration. That is, given 2 sets of 3 points in R3, where one set has been rotated about an axis by an unknown amount, find the quaternion that best describes the rotation.

    The problem is described in one of the handouts

    on about page 40.

    I have written matlab code that successfully does this transform.

    I set up a system of equations as below:
    %(pqPrime1 * q) - (q * p1) = 0;
    %(pqPrime2 * q) - (q * p2) = 0;

    where pqPrime is the rotated point/quaternion
    p1 is the non-rotated point
    q is the unknown quaternion we want.

    This becomes a matrix of point coefficients and using singular value decomposition
    U S V = svd(M)

    I find the vector in the null space at V
    ns = V(:,4);

    This solution was spoken by the professor during the video, however, the problem wasn't fully worked out so I'm just trying to work it out myself..

    This works great and I get it - what I'm fuzzy on though is, shouldn't I be minimizing some error E rather than setting the equations = 0? If so, I don't see how I should set up the equations for that....

    Thanks in advance.

    Follow Math Help Forum on Facebook and Google+

  2. #2
    Oct 2012

    Re: Quaternions, rigid body rotation (matlab)

    I'll leave this here for future reference. MATLAB has built-in quaternion support. You may find the functions more useful than writing your own and this may give you the ability to solve the problem with writing minimal code.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Quaternions and Rotation?
    Posted in the Advanced Algebra Forum
    Replies: 6
    Last Post: Mar 21st 2011, 01:48 AM
  2. Replies: 6
    Last Post: Nov 28th 2010, 03:56 AM
  3. vecotr (rigid body) question
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: Nov 9th 2010, 02:03 AM
  4. 3D Equilibrium of a rigid body
    Posted in the Advanced Applied Math Forum
    Replies: 3
    Last Post: Nov 3rd 2008, 09:31 PM
  5. Quaternions xz rotation with preserved y
    Posted in the Advanced Applied Math Forum
    Replies: 2
    Last Post: Jan 3rd 2008, 12:27 PM

Search Tags

/mathhelpforum @mathhelpforum