Added missed file

pull/13383/head
Alexey Spizhevoy 13 years ago
parent f6e2ad6144
commit 404d66d4ef
  1. 32
      modules/videostab/src/frame_source.cpp

@ -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
Loading…
Cancel
Save