comparison c/InputVideoFileModule.cpp @ 399:c389fae9689a

Added a class to read list of image instead of video. This is controlled by the use of the database-filename and folder-data parameters in the config file.
author Jean-Philippe Jodoin <jpjodoin@gmail.com>
date Mon, 29 Jul 2013 17:12:45 -0400
parents
children 7ef1071e3cc3
comparison
equal deleted inserted replaced
398:3399bd48cb40 399:c389fae9689a
1 #include "InputVideoFileModule.h"
2
3 InputVideoFileModule::InputVideoFileModule(const std::string& videoPath)
4 : mInit(false)
5 , mNumberOfFrame(0)
6 {
7 mInit = mVideoCapture.open(videoPath.c_str());
8 double frameCount;
9 frameCount = mVideoCapture.get(CV_CAP_PROP_FRAME_COUNT);
10 mSize = cv::Size(mVideoCapture.get(CV_CAP_PROP_FRAME_WIDTH), mVideoCapture.get(CV_CAP_PROP_FRAME_HEIGHT));
11 mNumberOfFrame = (unsigned int)frameCount;
12 }
13
14 InputVideoFileModule::~InputVideoFileModule(void)
15 {
16
17 }
18
19
20
21
22 bool InputVideoFileModule::getNextFrame(cv::Mat& outputPicture)
23 {
24 bool success = false;
25 if(mInit)
26 {
27 mVideoCapture >> outputPicture;
28 success = !outputPicture.empty();
29 }
30 return success;
31 }
32