How can I convert a Mat element to IplImage * element? Please Help!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Mat mat_img; //.... IplImage ipl_img = mat_img;
This puts a header of IplImage
on top of mat_img
so there is no copying. You can pass &ipl_img
to function which need IplImage*
.
回答2:
Mat to IplImage :
IplImage *image = new IplImage(mat_img);
IplImage to Mat :
Mat image(ipl_img);