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 defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)
48#include <opencv2/highgui/highgui.hpp>
49#elif defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)
50#include <opencv2/videoio/videoio.hpp>
185#if defined(VISP_HAVE_OPENCV) && \
186 (((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
187 ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)))
189 cv::VideoCapture m_capture;
191 bool m_lastframe_unknown;
221 vpVideoFormatType m_formatType;
224 std::string m_videoName;
225 std::string m_frameName;
236 bool m_firstFrameIndexIsSet;
237 bool m_lastFrameIndexIsSet;
257 if (m_frameStep > 0) {
258 if (m_frameCount + m_frameStep > m_lastFrame)
261 else if (m_frameStep < 0) {
262 if (m_frameCount + m_frameStep < m_firstFrame)
332 bool isVideoFormat()
const;
348 void setFileName(
const std::string &filename);
360 m_firstFrameIndexIsSet =
true;
361 m_firstFrame = first_frame;
373 this->m_lastFrameIndexIsSet =
true;
374 m_lastFrame = last_frame;
385 inline void setFrameStep(
const long frame_step) { m_frameStep = frame_step; }
388 vpVideoFormatType getFormat(
const std::string &filename)
const;
389 static std::string getExtension(
const std::string &filename);
390 void findFirstFrameIndex();
391 void findLastFrameIndex();
392 bool isImageExtensionSupported()
const;
393 bool isVideoExtensionSupported()
const;
394 bool checkImageNameFormat(
const std::string &format)
const;
395 void getProperties();
Class to grab (ie. read) images from the disk.
virtual void open(vpImage< unsigned char > &I)=0
vpFrameGrabber & operator=(const vpFrameGrabber &)=default
virtual void acquire(vpImage< unsigned char > &I)=0
Definition of the vpImage class member functions.
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