Compute Rotation Angle from Procrustes Rotation Matrix
Ältere Kommentare anzeigen
Hi!
I'm experimenting with procrustes matlab funcion for image alignment. My problem is that I need to compute the actual rotation angle and not just the transform. Could someonde give me some tip in computing the angle from the rotation matrix.
Thanks!
Akzeptierte Antwort
Weitere Antworten (2)
Instead of using procrustes and doing extra processing on its output, you could use this FEX file which, in addition to performing the registration, will compute the rotation angle for you (for 2D data)
Maryana
am 20 Jun. 2013
0 Stimmen
3 Kommentare
Roger Stafford
am 20 Jun. 2013
Bearbeitet: Roger Stafford
am 20 Jun. 2013
There's something amiss here, Maryana. Here is a quote from Mathworks' documentation for 'procrustes': "X and Y must have the same number of points (rows), and procrustes matches Y(i) to X(i). Points in Y can have smaller dimension (number of columns) than those in X. In this case, procrustes adds columns of zeros to Y as necessary." That would imply that your X and Y inputs for the two images should have just two columns corresponding to coordinates in the respective images and as many rows as in the set of matching points you have chosen between the two images. Presumably the T matrix returned would then be 2-by-2.
I recommend a very careful reading of the 'procrustes' documentation to be sure you understand how it works and what information you should present to it.
Roger Stafford
am 20 Jun. 2013
This is to add to my previous comment. In the Mathworks' site
http://www.mathworks.com/help/stats/procrustes.html
look carefully at the example given there at the end. They have selected a set of ten corresponding points in X and Y in which the one set is rotated (and otherwise altered) with respect to the other. That is what you must do in your two images. Find sets of points in the respective images that correspond to each other and give their respective coordinates in the X and Y arrays.
The figures you gave suggest that you simply input the two images as your X and Y arrays, and this would not be right at all. The 'procrustes' function is not capable of performing pattern recognition to find points that match. You have to do that yourself.
Maryana
am 20 Jun. 2013
Kategorien
Mehr zu Dimensionality Reduction and Feature Extraction finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!