Added missed file

This commit is contained in:
Alexey Spizhevoy 2012-03-19 13:57:38 +00:00
parent f6e2ad6144
commit 404d66d4ef

View File

@ -0,0 +1,32 @@
#include "precomp.hpp"
#include "opencv2/videostab/frame_source.hpp"
using namespace std;
namespace cv
{
namespace videostab
{
VideoFileSource::VideoFileSource(const string &path, bool volatileFrame)
: path_(path), volatileFrame_(volatileFrame) { reset(); }
void VideoFileSource::reset()
{
reader_.release();
reader_.open(path_);
if (!reader_.isOpened())
throw runtime_error("can't open file: " + path_);
}
Mat VideoFileSource::nextFrame()
{
Mat frame;
reader_ >> frame;
return volatileFrame_ ? frame : frame.clone();
}
} // namespace videostab
} // namespace cv