Mercurial Hosting > traffic-intelligence
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c/InputVideoFileModule.cpp Mon Jul 29 17:12:45 2013 -0400 @@ -0,0 +1,32 @@ +#include "InputVideoFileModule.h" + +InputVideoFileModule::InputVideoFileModule(const std::string& videoPath) +: mInit(false) +, mNumberOfFrame(0) +{ + mInit = mVideoCapture.open(videoPath.c_str()); + double frameCount; + frameCount = mVideoCapture.get(CV_CAP_PROP_FRAME_COUNT); + mSize = cv::Size(mVideoCapture.get(CV_CAP_PROP_FRAME_WIDTH), mVideoCapture.get(CV_CAP_PROP_FRAME_HEIGHT)); + mNumberOfFrame = (unsigned int)frameCount; +} + +InputVideoFileModule::~InputVideoFileModule(void) +{ + +} + + + + +bool InputVideoFileModule::getNextFrame(cv::Mat& outputPicture) +{ + bool success = false; + if(mInit) + { + mVideoCapture >> outputPicture; + success = !outputPicture.empty(); + } + return success; +} +