Mercurial Hosting > traffic-intelligence
view c/InputVideoFileModule.cpp @ 554:7d051afcb22d
added back simple makefile to install the feature-based tracking executable and the scripts in /usr/local/bin so that they are accessible without typing the path to the source folder
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 11 Jul 2014 16:25:57 -0400 |
parents | 2be846d36dec |
children |
line wrap: on
line source
#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) { } void InputVideoFileModule::setFrameNumber(const unsigned int& frameNumber) { mVideoCapture.set(CV_CAP_PROP_POS_FRAMES, frameNumber); } bool InputVideoFileModule::getNextFrame(cv::Mat& outputPicture) { bool success = false; if(mInit) { mVideoCapture >> outputPicture; success = !outputPicture.empty(); } return success; }