"的等价函数是什么? cvWriteFrame"使用Mat - 图像类型?

时间:2014-05-07 06:17:28

标签: c++ opencv mat writer iplimage

“cvWriteFrame”的等效功能是什么?使用Mat - 图像类型?

在IplImage中,可以使用以下方式完成:

CvVideoWriter *writer;
IplImage* frame = " IMAGE ";   

cvWriteFrame(writer, frame);

如何为Mat文件编写视频。

1 个答案:

答案 0 :(得分:2)

Opencv doc

C++: VideoWriter& VideoWriter::operator<<(const Mat& image)
C++: void VideoWriter::write(const Mat& image)
Python: cv2.VideoWriter.write(image) → None
C: int cvWriteFrame(CvVideoWriter* writer, const IplImage* image)
Python: cv.WriteFrame(writer, image) → int

所以我觉得像是

cv::Mat image;
....
cv::VideoWriter writer;
writer.open(...);
if (writer.isOpened())
  writer << image;