Quaternions product with or without minimum rotation arc - rotation

Two questions about quaternion product.
The product of two or more quaternions, all having a minimum rotation arc, produces a quaternion with a minimum rotation arc?
The product of two or more quaternions, if at least one quaternion does not have a minimum rotation arc, produces a quaternion without minimum rotation arc?

Related

Scaling the component axes of a rotation

I have an orientation sensor that outputs a rotation (either quaternion or rotation matrix).
I need to apply a calibration to the output which involves scaling the magnitude of the X,Y and Z axes.
My current approach is to deconstruct the rotations in each plane, calculate and scale the component of the two axes and then recalculte the respective angles. I then reconstruct the modified rotation.
Is there a simpler approach that i'm missing?

Using a homography matrix and decomposing it to find the orientation of a plane fixed in the centre

I currently have two images of a plane in real life from straight above. One to use as a reference image, and another when the plane has undergone a rotation fixed at the centre of the plane thus changing its orientation. The camera stays at a constant position.
I was wondering if I found the homography matrix of this rotation in opencv and then decomposed the homography matrix in order to find the rotation matrix whether this would yield accurate results and I would be able to find the three angles needed to describe the planes rotation in euclidean coordinates to a reasonable degree of accuracy.
Thanks

How to compute 3D rotation matrix by user movement of control point

I have a projected view of a 3D scene. The 2D points are computed by multiplying the 3D points in homogenous coordinates by a view matrix (which includes a translation and rotation) and a perspective matrix. I want to allow the user to move control points which describe the three axes, and update the rotation matrix based on this.
How do I compute the new rotation matrix given a change in projected 2D coordinates, assuming rotation around the origin? Solving for the position of the end of the single axis has a large degeneracy in the set of possible, but maybe solving for rotation in the axes perpendicular to the moved axis might work.

How to calculate an angle from a rotation matrix

I have a given 3x3 rotation matrix and I want to calculate the rotation angle around z axis. How do I get there?
For example, in this case below, how did they calculated the "-30deg rotation around the x axis"? Or how did they get to the "-74deg" value around that axis?
This is my original matrix:
Thank you!
It is simple if the rotation matrix is just a rotation matrix and there is no scaling. Here is a site that explains in more pretty terms then I am willing to diagram here. Basically the rotation matrix is composed of sinf(x) and cosf(x) of euler angles (well you can think of it like that at least). You can therefore use values within it to back calculate the euler angles.
http://nghiaho.com/?page_id=846
If you have scaling involved you will need to normalize each row of the matrix first. Then apply the above method.

affine transformation on the sphere

I have 2 sets of points that are restricted to live on the 3D unit sphere, call them {pi} and {qi} (I'll assume correspondence is known). The goal is to register one set to the other, through rotations and translations. Typically I would have used a transformation of the form:
P = RQ + T
where R is a rotation matrix and T a translation vector.
But in this case there is an extra constraint that all points must live on the sphere, how can I include this condition.
Assuming the sets are 'rigid', so you can slide and rotate the whole set on the sphere, but can not change distances between points within a set, all possible transformations are rotations.
Whenever you rotate the set relative to some axis, points move in planes perpendicular to the axis. So all displacements are vectors normal to the axis vector. So each two displacement vectors should make a vector product parallel to the axis vector.
Now, if you already know the correspondence between P and Q points, calculate displacement vectors di from each qi to a corresponding pi and calculate some vector products:
di × dj = (pi - qi) × (pj - qj)
If they have directions close enough to each other, you can assume you have the rotation axis.
Now for each pair or pi,qi find a point ti on an axis such that the PQT triangle is normal to the axis. The angle at the T vertex defines the rotation to slide qi to pi. If all respective angles are equal, you're done. Otherwise you'll have to seek some approximate solution...

Resources