Mat to IplImage
摘自 modules\highgui\cap.cpp 的VideoCapture
void iplImage2Mat(IplImage* iplImage, cv::Mat& mat )
{
if(iplImage->origin == IPL_ORIGIN_TL)
cv::Mat(iplImage).copyTo(mat);
else
{
cv::Mat temp(iplImage);
flip(temp, mat, 0);
}
}
IplImage to Mat
摘自 modules\highgui\cap.cpp 的 VideoWriter
void mat2IplImage(cv::Mat& mat, IplImage* iplImage)
{
IplImage _img = mat;
iplImage = &_img;
}