回答1:
It does provide a conversion to IplImage, creating a header without copying the data. So IplImage* img = new IplImage(mat); should work.
回答2:
Actually, you can do this: IplImage iplimg = mat; and just use &iplimg wherever you need anIplImage. There is no need for dynamic allocation.
回答3:
In the new OpenCV 2.0 C++ interface it's not really necessary to change from back and forth betweenMat 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 theOpenCV C++ interface or the image.cpp example in the OpenCV-2.0/samples/c directory.
本文介绍如何在OpenCV中实现Mat与IplImage之间的转换,无需额外分配内存,直接通过类型转换即可完成。这对于从旧版OpenCV迁移到新版的开发者尤其有用。
1067

被折叠的 条评论
为什么被折叠?



