How to compute the rotation angle with Hu moment

asked 2016-01-19 09:23:52 -0600

nistar gravatar image

I use matchShapes() to find the similar contour.
Then use minAreaRect(), can compute the centre of contour.
But the angle isn't correct. Because the contour is irregular.

If compare the parameter of 2 Hu moment, can compute the rotation angle?
How to do it???

Thanks a lot

edit retag flag offensive close merge delete

Comments

Isn't it a duplicate?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-19 09:28:55 -0600 )edit

i don't know if you can compute rotation angle by comparing the parameter of 2 Hu moment. but take a look at the sample code to see how the angle of blob can be computed.

sturkmen gravatar imagesturkmen ( 2016-01-19 11:44:34 -0600 )edit
sturkmen gravatar imagesturkmen ( 2016-01-19 12:21:29 -0600 )edit