IplImage * img;
Mat temp = cvarrToMat(img); // IplImage* 格式 ==》 Mat 格式
img = (IplImage *)&temp; // IplImage* 格式 《== Mat 格式
IplImage* 格式与Mat 格式的转换
原文:https://www.cnblogs.com/roscangjie/p/12148181.html