Ask Your Question
0

getRotationMatrix2d bug ?

asked 2013-04-19 13:00:42 -0600

yes123 gravatar image

I have OpenCV 2.4.5

If I run:

cout << getRotationMatrix2D(Point2f(250,250),0,1);

I get a Matrix like this:

[1, 0, 0;
 -0, 1, 0]

Consindering I have set a center (250,250) is it right?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-04-19 13:10:59 -0600

berak gravatar image

updated 2013-04-19 13:34:06 -0600

no error here, that's ok.

you supplied an rotation angle of 0, and a scale of 1, so the result is still identity for the rotation part,

1 0
0 1

and (0,0) for the translation

(setting the center value for the rotation will only have an effect if the angle != 0)

edit flag offensive delete link more

Comments

If i want to obtain a matrix that includes the transation and the angle even if the angle = 0 which func should I use?

yes123 gravatar imageyes123 ( 2013-04-19 13:37:31 -0600 )edit

if there's no rotation and no scale, it boils down to p += translation

berak gravatar imageberak ( 2013-04-19 13:43:51 -0600 )edit

Yes, but is there a way to obtain a matrix for this? So I can just use cv::transform to obtain the new location (even with angle = 0 )?

yes123 gravatar imageyes123 ( 2013-04-19 13:45:04 -0600 )edit

Question Tools

Stats

Asked: 2013-04-19 13:00:42 -0600

Seen: 416 times

Last updated: Apr 19 '13