Added load and save motion args into videostab sample

This commit is contained in:
Alexey Spizhevoy
2012-03-22 09:30:28 +00:00
parent e64c08d5d9
commit 45fd8a6a63
3 changed files with 98 additions and 5 deletions

View File

@@ -163,6 +163,9 @@ public:
virtual void reset() { resetImpl(); }
virtual Mat nextFrame();
// available after pre-pass, before it's empty
std::vector<Mat> motions() const;
private:
void resetImpl();
void runPrePassIfNecessary();

View File

@@ -278,6 +278,16 @@ Mat TwoPassStabilizer::nextFrame()
}
vector<Mat> TwoPassStabilizer::motions() const
{
if (frameCount_ == 0)
return vector<Mat>();
vector<Mat> res(frameCount_ - 1);
copy(motions_.begin(), motions_.begin() + frameCount_ - 1, res.begin());
return res;
}
void TwoPassStabilizer::resetImpl()
{
isPrePassDone_ = false;