39 #ifndef VP_VIDEO_READER_H
40 #define VP_VIDEO_READER_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>
183 #if defined(HAVE_OPENCV_HIGHGUI) && defined(HAVE_OPENCV_VIDEOIO)
185 cv::VideoCapture m_capture;
187 bool m_lastframe_unknown;
217 vpVideoFormatType m_formatType;
220 std::string m_videoName;
221 std::string m_frameName;
232 bool m_firstFrameIndexIsSet;
233 bool m_lastFrameIndexIsSet;
251 if (m_frameStep > 0) {
252 if (m_frameCount + m_frameStep > m_lastFrame)
255 else if (m_frameStep < 0) {
256 if (m_frameCount + m_frameStep < m_firstFrame)
326 bool isVideoFormat()
const;
342 void setFileName(
const std::string &filename);
354 m_firstFrameIndexIsSet =
true;
355 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 bool checkImageNameFormat(
const std::string &format)
const;
389 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