Updated videostab module

This commit is contained in:
Alexey Spizhevoy
2012-04-02 12:26:05 +00:00
parent abbfa848ba
commit 56b5e6d8a8
6 changed files with 19 additions and 39 deletions

View File

@@ -199,11 +199,11 @@ void StabilizerBase::stabilizeFrame(const Mat &stabilizationMotion)
OnePassStabilizer::OnePassStabilizer()
{
setMotionFilter(new GaussianMotionFilter());
resetImpl();
reset();
}
void OnePassStabilizer::resetImpl()
void OnePassStabilizer::reset()
{
curPos_ = -1;
curStabilizedPos_ = -1;
@@ -238,8 +238,6 @@ void OnePassStabilizer::setUp(Mat &firstFrame)
at(0, frames_) = firstFrame;
motionFilter_->update();
StabilizerBase::setUp(cacheSize, firstFrame);
}
@@ -327,11 +325,6 @@ void TwoPassStabilizer::runPrePassIfNecessary()
motions_.push_back(Mat::eye(3, 3, CV_32F));
log_->print("\n");
IMotionStabilizer *motionStabilizer = static_cast<IMotionStabilizer*>(motionStabilizer_);
MotionFilterBase *motionFilterBase = dynamic_cast<MotionFilterBase*>(motionStabilizer);
if (motionFilterBase)
motionFilterBase->update();
stabilizationMotions_.resize(frameCount_);
motionStabilizer_->stabilize(&motions_[0], frameCount_, &stabilizationMotions_[0]);