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;
202 vpVideoFormatType m_formatType;
205 std::string m_videoName;
206 std::string m_frameName;
217 bool m_firstFrameIndexIsSet;
218 bool m_lastFrameIndexIsSet;
236 if (m_frameStep > 0) {
237 if (m_frameCount + m_frameStep > m_lastFrame)
239 }
else if (m_frameStep < 0) {
240 if (m_frameCount + m_frameStep < m_firstFrame)
307 bool isVideoFormat()
const;
323 void setFileName(
const std::string &filename);
334 m_firstFrameIndexIsSet =
true;
335 m_firstFrame = first_frame;
346 this->m_lastFrameIndexIsSet =
true;
347 m_lastFrame = last_frame;
358 inline void setFrameStep(
const long frame_step) { m_frameStep = frame_step; }
361 vpVideoFormatType getFormat(
const std::string &filename)
const;
362 static std::string getExtension(
const std::string &filename);
363 void findFirstFrameIndex();
364 void findLastFrameIndex();
365 bool isImageExtensionSupported()
const;
366 bool isVideoExtensionSupported()
const;
367 bool checkImageNameFormat(
const std::string &format)
const;
368 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
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