45 #ifndef vpVideoReader_H
46 #define vpVideoReader_H
50 #include <visp3/io/vpDiskGrabber.h>
52 #if VISP_HAVE_OPENCV_VERSION >= 0x020200
53 #include "opencv2/highgui/highgui.hpp"
54 #elif VISP_HAVE_OPENCV_VERSION >= 0x020000
55 #include "opencv/highgui.h"
176 #if VISP_HAVE_OPENCV_VERSION >= 0x020100
177 cv::VideoCapture capture;
207 vpVideoFormatType formatType;
210 char fileName[FILENAME_MAX];
221 bool firstFrameIndexIsSet;
222 bool lastFrameIndexIsSet;
261 if (frameCount + frameStep > lastFrame)
263 }
else if (frameStep < 0) {
264 if (frameCount + frameStep < firstFrame)
276 double getFramerate()
293 inline long getFrameIndex()
const {
return frameCount; }
300 inline long getFirstFrameIndex()
312 inline long getLastFrameIndex()
324 inline long getFrameStep()
const {
return frameStep; }
339 inline void resetFrameCounter() { frameCount = firstFrame; }
340 void setFileName(
const char *filename);
341 void setFileName(
const std::string &filename);
350 inline void setFirstFrameIndex(
const long first_frame)
352 this->firstFrameIndexIsSet =
true;
353 this->firstFrame = first_frame;
362 inline void setLastFrameIndex(
const long last_frame)
364 this->lastFrameIndexIsSet =
true;
365 this->lastFrame = last_frame;
376 inline void setFrameStep(
const long frame_step) { this->frameStep = frame_step; }
379 vpVideoFormatType getFormat(
const char *filename);
380 static std::string getExtension(
const std::string &filename);
381 void findFirstFrameIndex();
382 void findLastFrameIndex();
383 bool isImageExtensionSupported();
384 bool isVideoExtensionSupported();
385 long extractImageIndex(
const std::string &imageName,
const std::string &format);
386 bool checkImageNameFormat(
const std::string &format);
387 void getProperties();