45 #ifndef vpVideoReader_H 46 #define vpVideoReader_H 50 #include <visp3/io/vpDiskGrabber.h> 52 #if VISP_HAVE_OPENCV_VERSION >= 0x020200 53 #include "opencv2/highgui/highgui.hpp" 54 #elif VISP_HAVE_OPENCV_VERSION >= 0x020000 55 #include "opencv/highgui.h" 176 #if VISP_HAVE_OPENCV_VERSION >= 0x020100 177 cv::VideoCapture m_capture;
180 bool m_lastframe_unknown;
209 vpVideoFormatType m_formatType;
212 std::string m_fileName;
223 bool m_firstFrameIndexIsSet;
224 bool m_lastFrameIndexIsSet;
262 if (m_frameStep > 0) {
263 if (m_frameCount + m_frameStep > m_lastFrame)
265 }
else if (m_frameStep < 0) {
266 if (m_frameCount + m_frameStep < m_firstFrame)
328 bool isVideoFormat()
const;
344 void setFileName(
const std::string &filename);
355 m_firstFrameIndexIsSet =
true;
356 m_firstFrame = first_frame;
367 this->m_lastFrameIndexIsSet =
true;
368 m_lastFrame = last_frame;
379 inline void setFrameStep(
const long frame_step) { m_frameStep = frame_step; }
382 vpVideoFormatType getFormat(
const std::string &filename)
const;
383 static std::string getExtension(
const std::string &filename);
384 void findFirstFrameIndex();
385 void findLastFrameIndex();
386 bool isImageExtensionSupported()
const;
387 bool isVideoExtensionSupported()
const;
388 long extractImageIndex(
const std::string &imageName,
const std::string &format)
const;
389 bool checkImageNameFormat(
const std::string &format)
const;
390 void getProperties();
long getFrameIndex() const
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
long getFirstFrameIndex()
virtual void open(vpImage< unsigned char > &I)=0
long getFrameStep() const
Class to grab (ie. read) images from the disk.
Base class for all video devices. It is designed to provide a front end to video sources.
void setLastFrameIndex(const long last_frame)
void setFrameStep(const long frame_step)
void setFirstFrameIndex(const long first_frame)
virtual void acquire(vpImage< unsigned char > &I)=0