39 #ifndef VP_VIDEO_READER_H
40 #define VP_VIDEO_READER_H
44 #include <visp3/core/vpConfig.h>
45 #include <visp3/io/vpDiskGrabber.h>
47 #if (VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)
48 #include <opencv2/highgui/highgui.hpp>
49 #elif (VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)
50 #include <opencv2/videoio/videoio.hpp>
185 #if ((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI))|| ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO))
187 cv::VideoCapture m_capture;
189 bool m_lastframe_unknown;
219 vpVideoFormatType m_formatType;
222 std::string m_videoName;
223 std::string m_frameName;
234 bool m_firstFrameIndexIsSet;
235 bool m_lastFrameIndexIsSet;
253 if (m_frameStep > 0) {
254 if (m_frameCount + m_frameStep > m_lastFrame)
257 else if (m_frameStep < 0) {
258 if (m_frameCount + m_frameStep < m_firstFrame)
328 bool isVideoFormat()
const;
344 void setFileName(
const std::string &filename);
356 m_firstFrameIndexIsSet =
true;
357 m_firstFrame = first_frame;
369 this->m_lastFrameIndexIsSet =
true;
370 m_lastFrame = last_frame;
381 inline void setFrameStep(
const long frame_step) { m_frameStep = frame_step; }
384 vpVideoFormatType getFormat(
const std::string &filename)
const;
385 static std::string getExtension(
const std::string &filename);
386 void findFirstFrameIndex();
387 void findLastFrameIndex();
388 bool isImageExtensionSupported()
const;
389 bool isVideoExtensionSupported()
const;
390 bool checkImageNameFormat(
const std::string &format)
const;
391 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