Go to the documentation of this file.
15 #include <mrpt/3rdparty/do_opencv_includes.h>
18 (const_cast<CvVideoWriter*>( \
19 static_cast<const CvVideoWriter*>(m_video.get())))
20 #define M_WRITER_PTR (reinterpret_cast<CvVideoWriter**>(m_video.getPtrToPtr()))
39 const std::string& out_file,
double fps,
50 cc = CV_FOURCC_DEFAULT;
52 else if (fourcc.size() == 4)
54 cc = CV_FOURCC(fourcc[0], fourcc[1], fourcc[2], fourcc[3]);
58 std::cerr <<
"[CVideoFileWriter::open] fourcc string must be four "
59 "character length or empty for default."
65 out_file.c_str(), cc, fps, cvSize(frameSize.
x, frameSize.
y),
72 std::cerr <<
"[CVideoFileWriter::open] ERROR: MRPT was compiled without "
114 "Video frame size is %ix%i but image is %ux%u",
m_img_size.
x,
137 "[CVideoFileWriter::writeImage] Error: video frame "
138 "size is %ix%i but image is %ux%u",
148 return 0 != cvWriteFrame(
M_WRITER, &ipl);
virtual ~CVideoFileWriter()
Destructor.
size_t getWidth() const override
Returns the width of the image in pixels.
void asCvMat(cv::Mat &out_img, copy_type_t copy_type) const
Makes a shallow or deep copy of this image into the provided cv::Mat.
Copyright (C) 2010 Hauke Strasdat Imperial College London Copyright (c) 2005-2020,...
bool writeImage(const mrpt::img::CImage &img) const
Write image to the video file (method function, alternative to the operator <<).
bool isOpen() const
Return true if already successfully open with open() and not closed yet.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CVideoFileWriter()
Default constructor, which does not open any file.
mrpt::void_ptr_noncopy m_video
A pointer to CvVideoWriter.
An output stream which takes a sequence of images and writes a video file in any of a given of compat...
#define THROW_EXCEPTION(msg)
void close()
Finish the file writing and close the file output.
const CVideoFileWriter & operator<<(const mrpt::img::CImage &img) const
Write image to the video file.
mrpt::img::TImageSize m_img_size
A copy of the video size.
A class for storing images as grayscale or RGB bitmaps.
size_t getHeight() const override
Returns the height of the image in pixels.
@ SHALLOW_COPY
Shallow copy: the copied object is a reference to the original one.
A pair (x,y) of pixel coordinates (integer resolution).
struct _IplImage IplImage
bool open(const std::string &out_file, double fps, const mrpt::img::TImageSize &frameSize, const std::string &fourcc=std::string(""), bool isColor=true)
Open a file for writing the video.
std::string std::string format(std::string_view fmt, ARGS &&... args)
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020 | |