I’m trying to rotate my frame by 90 degrees but it’s not quite working.
My camera is capturing x 640wx360h image and I’m setting the center of the rotation
at point 320,180 but the img.show() window isn’t showing the whole image.
What am I missing.
Here’s my rotate function:
Mat rotate(Mat src, double angle)
{
Mat dst;
int X = src.cols/2.;
int Y = src.rows/2.;
char buf[12];
int n=sprintf (buf, "x,y of rotation: %d, %d", X,Y);
Point2f pt(X,Y);
cout << cv::format("%s", buf) << endl;
Mat rotatedMat = getRotationMatrix2D(pt, angle, 1.0);
warpAffine(src, dst, rotatedMat, Size(src.cols, src.rows));
return dst;
}
And here’s what I see when I run the code.
If I do not rotate the frame I see this.