How can I rotate a figure in an image according to its principal axis?

Good day!
I have read some papers that indicates that as part of their image pre-processing, specifically the image with the hand pattern, they rotate the images first. As for example, the papers would indicate that the image in Figure A will be rotated to look like Figure B but they do not indicate the necessary steps on how to do it. They just simply mentioned that they are rotated according to its principal axis. How will I be able to rotate the images to Figure B even if the hand is oriented in different manner than Figure A? Thank you very much!

 Respuesta aceptada

Image Analyst
Image Analyst el 24 de Sept. de 2014
I have code to do exactly that posted in my Answer http://www.mathworks.com/matlabcentral/answers/154523#answer_151500. Take a look at the code and plug in your image name.

Más respuestas (1)

Use regionprops to find the _'orientation'_and imrotate to rotate it with this information
doc regionprops
doc imrotate

Categorías

Preguntada:

el 24 de Sept. de 2014

Respondida:

el 24 de Sept. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by