samedi 28 mars 2015

How to rotate image so it would be parallel with x axis?

I'm trying to rotate geometrical objects (binary image) so at least one side (the longest would be best) would be parallel with x axis. I am using regionprops(img,'Orientation') and imrorate functions, but this doesn't produce the desired picture. I need to find the angle of rotation, which is different for each picture. Is there any way how to do this?


This is input image:


enter image description here


This is what I want:


enter image description here


Aucun commentaire:

Enregistrer un commentaire