OpenCV: Mat与IplImage*间的相互转换

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sss_369/article/details/84147194

1. Mat -->IplImage

Mat mat_img=imread("samples.bmp");
IplImage* ipl_img;
ipl_img = &IplImage(mat_img);

2. IplImage--->Mat

IplImage* ipl_img = cvLoadImage("samples.bmp");;
Mat mat_img;
mat_img = Mat(ipl_img);//Mat(const IplImage* img, bool copyData=false);
//mat_img = cvarrToMat(ipl_img);//3.x版本

猜你喜欢

转载自blog.csdn.net/sss_369/article/details/84147194