Ask Your Question
0

i need help with dealing with wrap affine can sombody help me plz

asked 2014-03-21 12:10:52 -0600

Ayesh gravatar image

i am trying to do image forward rotation by using this Point2f vector is it possible to convert point2f into Mat without using wrap affine

double AffineMat[3][3] = { { cos(angle*PI / 180), sin(angle*PI / 180), 0 },
{ -1 * sin(angle*PI / 180), cos(angle*PI / 180), 0 }, { 0, 0, 1 } };

this matrix how to multiply this matrix with mat image and if it possible plz can any body show me how to multiply image with mask ?? plz help me

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-03-22 11:11:12 -0600

GrumbleLion gravatar image

First you have to create the 2x3 rotation matrix.

cv::Point2f center(((float)imageSize.width * 0.5f), ((float)imageSize.height * 0.5f)); cv::mat RotMap = cv::getRotationMatrix2D( center, Rot, 1.0);

then rotate your image

cv::warpAffine(ImageMatIn, RotatedImageMatOut, RotMap, CameraAvgImage.size(), cv::INTER_LINEAR, cv::BORDER_REPLICATE , cv::Scalar(127,127,127));

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-03-21 12:10:52 -0600

Seen: 159 times

Last updated: Mar 22 '14