I am trying to rotate an image in OpenCV.
I\'ve used this code that I found here on Stack Overflow:
Mat source(img);
Point2f src_center(source.cols/2
Norman in his blog describes the following (Although it is not 2.0, it should apply to your problem.):
To transform from CvMat to IplImage, Use function:
IplImage* cvGetImage( const CvArr* arr, IplImage* image_header );
The function cvGetImage returns image header for the input array that can be matrix - CvMat*, or image - IplImage*. In the case of image the function simply returns the input pointer. In the case of CvMat* it initializes image_header structure with parameters of the input matrix. Usage:
IplImage stub, *dst_img;
dst_img = cvGetImage(src_mat, &stub);