IplImage、IplImage、Mat之间的转换
作者:互联网
IplImage是OpenCV中C语言的图像类型;
cv::Mat是OpenCV中C++语言的图像类型;
一、Mat—>IplImage
Mat image;
if(!image.data)
{
cout<<“Could not open or find the image”<<endl;
return -1;
}
//convert to IplImage
IplImage ipl_img(image);
二、 Mat—>IplImage*
IplImage *frame;
Mat Img;
frame=&IplImage(Img);//*frame=IplImage(Img);
三、IplImage*—>Mat
IplImage* iplimg = cvLoadImage(“heels.jpg”);
Mat matImg;
matImg = Mat(iplimg);
————————————————
版权声明:本文为CSDN博主「那年聪聪」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/duan19920101/article/details/51153300
标签:转换,Mat,Img,image,OpenCV,IplImage,frame 来源: https://blog.csdn.net/Nyiragongo/article/details/104440945