39 #ifndef _vpVideoReader_h_
40 #define _vpVideoReader_h_
44 #include <visp3/io/vpDiskGrabber.h>
46 #if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_VIDEOIO) && defined(HAVE_OPENCV_HIGHGUI)
47 #include <opencv2/videoio/videoio.hpp>
48 #include <opencv2/highgui/highgui.hpp>
169 #if defined(HAVE_OPENCV_HIGHGUI) && defined(HAVE_OPENCV_VIDEOIO)
171 cv::VideoCapture m_capture;
173 bool m_lastframe_unknown;
203 vpVideoFormatType m_formatType;
206 std::string m_videoName;
207 std::string m_frameName;
218 bool m_firstFrameIndexIsSet;
219 bool m_lastFrameIndexIsSet;
237 if (m_frameStep > 0) {
238 if (m_frameCount + m_frameStep > m_lastFrame)
241 else if (m_frameStep < 0) {
242 if (m_frameCount + m_frameStep < m_firstFrame)
312 bool isVideoFormat()
const;
328 void setFileName(
const std::string &filename);
340 m_firstFrameIndexIsSet =
true;
341 m_firstFrame = first_frame;
353 this->m_lastFrameIndexIsSet =
true;
354 m_lastFrame = last_frame;
365 inline void setFrameStep(
const long frame_step) { m_frameStep = frame_step; }
368 vpVideoFormatType getFormat(
const std::string &filename)
const;
369 static std::string getExtension(
const std::string &filename);
370 void findFirstFrameIndex();
371 void findLastFrameIndex();
372 bool isImageExtensionSupported()
const;
373 bool isVideoExtensionSupported()
const;
374 bool checkImageNameFormat(
const std::string &format)
const;
375 void getProperties();
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.
virtual void open(vpImage< unsigned char > &I)=0
virtual void acquire(vpImage< unsigned char > &I)=0
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
void setLastFrameIndex(const long last_frame)
void setFirstFrameIndex(const long first_frame)
long getFirstFrameIndex()
void setFrameStep(const long frame_step)
long getFrameStep() const
std::string getFrameName() const
long getFrameIndex() const