How to convert a Mat variable type in an IplImage variable type in OpenCV 2.0?

前端 未结 4 1772
别跟我提以往
别跟我提以往 2020-12-10 04:22

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         


        
4条回答
  •  渐次进展
    2020-12-10 04:47

    In the new OpenCV 2.0 C++ interface it's not really necessary to change from back and forth between Mat and IplImage, but if you want to you can use the IplImage operator:

    IplImage dst_img = dst;
    

    Note that only the IplImage header is created and the data (pixels) will be shared. For more info see the OpenCV C++ interface or the image.cpp example in the OpenCV-2.0/samples/c directory.

提交回复
热议问题