“cvWriteFrame”的等效功能是什么?使用Mat - 图像类型?
在IplImage中,可以使用以下方式完成:
CvVideoWriter *writer;
IplImage* frame = " IMAGE ";
cvWriteFrame(writer, frame);
如何为Mat文件编写视频。
答案 0 :(得分:2)
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;