RQDecomp3x3 returns wrongly signed euler y-angle (Feature #743)
Description
The corrected line should be:
eulerAngles->y = acos(_Qyr0r0) * (_Qyr2r0 >= 0 ? 1 : -1) * (180.0 / CV_PI);
I'm still a bit confused why all your rotation matrices are transposed.
Associated revisions
Merge pull request #743 from jet47:fix-sparsemat-iterator
History
Updated by Sven Lange almost 14 years ago
I think tlangner is right. I also think, that the bug should be fixed very soon, because currently the function is useless for calculating euler angles.
I did some testing and compared the results with the analogous matlab function. The result was always a wrong signed rotation around the y axis. Values are correctly.
The reason for the wrong calculation has its origin within the rotation matrices. If you compare them with the matrices in “Multiple View Geometry (Hartley and Zisserman)” p. 579, you will see that Qx and Qz are the transposed matrices and Qy is not transposed. So Qy should be [c 0 -s; 0 1 0; s 0 c].
As a result the index for calculation of the sign for the y rotation is wrong. It should use index 3,1.
Updated by Vadim Pisarevsky almost 14 years ago
thanks! the patch has been applied in r4965
- Status changed from Open to Done
- (deleted custom field) set to fixed