mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Warning fixes continued
This commit is contained in:
@@ -355,7 +355,7 @@ Mat estimateGlobalMotionRobust(
|
||||
|
||||
Mat_<float> M = estimateGlobalMotionLeastSquares(subset0, subset1, model, 0);
|
||||
|
||||
int ninliers = 0;
|
||||
int numinliers = 0;
|
||||
for (int i = 0; i < npoints; ++i)
|
||||
{
|
||||
p0 = points0_[i];
|
||||
@@ -363,12 +363,12 @@ Mat estimateGlobalMotionRobust(
|
||||
x = M(0,0)*p0.x + M(0,1)*p0.y + M(0,2);
|
||||
y = M(1,0)*p0.x + M(1,1)*p0.y + M(1,2);
|
||||
if (sqr(x - p1.x) + sqr(y - p1.y) < params.thresh * params.thresh)
|
||||
ninliers++;
|
||||
numinliers++;
|
||||
}
|
||||
if (ninliers >= ninliersMax)
|
||||
if (numinliers >= ninliersMax)
|
||||
{
|
||||
bestM = M;
|
||||
ninliersMax = ninliers;
|
||||
ninliersMax = numinliers;
|
||||
subset0best.swap(subset0);
|
||||
subset1best.swap(subset1);
|
||||
}
|
||||
@@ -657,8 +657,8 @@ Mat KeypointBasedMotionEstimator::estimate(const Mat &frame0, const Mat &frame1,
|
||||
|
||||
// perform outlier rejection
|
||||
|
||||
IOutlierRejector *outlierRejector = static_cast<IOutlierRejector*>(outlierRejector_);
|
||||
if (!dynamic_cast<NullOutlierRejector*>(outlierRejector))
|
||||
IOutlierRejector *outlRejector = static_cast<IOutlierRejector*>(outlierRejector_);
|
||||
if (!dynamic_cast<NullOutlierRejector*>(outlRejector))
|
||||
{
|
||||
pointsPrev_.swap(pointsPrevGood_);
|
||||
points_.swap(pointsGood_);
|
||||
|
||||
@@ -130,9 +130,9 @@ void ConsistentMosaicInpainter::inpaint(int idx, Mat &frame, Mat &mask)
|
||||
CV_Assert(mask.size() == frame.size() && mask.type() == CV_8U);
|
||||
|
||||
Mat invS = at(idx, *stabilizationMotions_).inv();
|
||||
vector<Mat_<float> > motions(2*radius_ + 1);
|
||||
vector<Mat_<float> > vmotions(2*radius_ + 1);
|
||||
for (int i = -radius_; i <= radius_; ++i)
|
||||
motions[radius_ + i] = getMotion(idx, idx + i, *motions_) * invS;
|
||||
vmotions[radius_ + i] = getMotion(idx, idx + i, *motions_) * invS;
|
||||
|
||||
int n;
|
||||
float mean, var;
|
||||
@@ -154,7 +154,7 @@ void ConsistentMosaicInpainter::inpaint(int idx, Mat &frame, Mat &mask)
|
||||
for (int i = -radius_; i <= radius_; ++i)
|
||||
{
|
||||
const Mat_<Point3_<uchar> > &framei = at(idx + i, *frames_);
|
||||
const Mat_<float> &Mi = motions[radius_ + i];
|
||||
const Mat_<float> &Mi = vmotions[radius_ + i];
|
||||
int xi = cvRound(Mi(0,0)*x + Mi(0,1)*y + Mi(0,2));
|
||||
int yi = cvRound(Mi(1,0)*x + Mi(1,1)*y + Mi(1,2));
|
||||
if (xi >= 0 && xi < framei.cols && yi >= 0 && yi < framei.rows)
|
||||
@@ -339,12 +339,12 @@ MotionInpainter::MotionInpainter()
|
||||
void MotionInpainter::inpaint(int idx, Mat &frame, Mat &mask)
|
||||
{
|
||||
priority_queue<pair<float,int> > neighbors;
|
||||
vector<Mat> motions(2*radius_ + 1);
|
||||
vector<Mat> vmotions(2*radius_ + 1);
|
||||
|
||||
for (int i = -radius_; i <= radius_; ++i)
|
||||
{
|
||||
Mat motion0to1 = getMotion(idx, idx + i, *motions_) * at(idx, *stabilizationMotions_).inv();
|
||||
motions[radius_ + i] = motion0to1;
|
||||
vmotions[radius_ + i] = motion0to1;
|
||||
|
||||
if (i != 0)
|
||||
{
|
||||
@@ -370,7 +370,7 @@ void MotionInpainter::inpaint(int idx, Mat &frame, Mat &mask)
|
||||
int neighbor = neighbors.top().second;
|
||||
neighbors.pop();
|
||||
|
||||
Mat motion1to0 = motions[radius_ + neighbor - idx].inv();
|
||||
Mat motion1to0 = vmotions[radius_ + neighbor - idx].inv();
|
||||
|
||||
// warp frame
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ void MotionStabilizationPipeline::stabilize(
|
||||
{
|
||||
stabilizers_[i]->stabilize(size, updatedMotions, range, &stabilizationMotions_[0]);
|
||||
|
||||
for (int i = 0; i < size; ++i)
|
||||
stabilizationMotions[i] = stabilizationMotions_[i] * stabilizationMotions[i];
|
||||
for (int k = 0; k < size; ++k)
|
||||
stabilizationMotions[k] = stabilizationMotions_[k] * stabilizationMotions[k];
|
||||
|
||||
for (int j = 0; j + 1 < size; ++j)
|
||||
{
|
||||
@@ -90,10 +90,10 @@ void MotionFilterBase::stabilize(
|
||||
}
|
||||
|
||||
|
||||
void GaussianMotionFilter::setParams(int radius, float stdev)
|
||||
void GaussianMotionFilter::setParams(int _radius, float _stdev)
|
||||
{
|
||||
radius_ = radius;
|
||||
stdev_ = stdev > 0.f ? stdev : sqrt(static_cast<float>(radius));
|
||||
radius_ = _radius;
|
||||
stdev_ = _stdev > 0.f ? _stdev : sqrt(static_cast<float>(_radius));
|
||||
|
||||
float sum = 0;
|
||||
weight_.resize(2*radius_ + 1);
|
||||
|
||||
@@ -158,8 +158,8 @@ bool StabilizerBase::doOneIteration()
|
||||
|
||||
void StabilizerBase::setUp(const Mat &firstFrame)
|
||||
{
|
||||
InpainterBase *inpainter = static_cast<InpainterBase*>(inpainter_);
|
||||
doInpainting_ = dynamic_cast<NullInpainter*>(inpainter) == 0;
|
||||
InpainterBase *inpaint = static_cast<InpainterBase*>(inpainter_);
|
||||
doInpainting_ = dynamic_cast<NullInpainter*>(inpaint) == 0;
|
||||
if (doInpainting_)
|
||||
{
|
||||
inpainter_->setMotionModel(motionEstimator_->motionModel());
|
||||
@@ -370,11 +370,11 @@ static void saveMotions(
|
||||
void TwoPassStabilizer::runPrePassIfNecessary()
|
||||
{
|
||||
if (!isPrePassDone_)
|
||||
{
|
||||
{
|
||||
// check if we must do wobble suppression
|
||||
|
||||
WobbleSuppressorBase *wobbleSuppressor = static_cast<WobbleSuppressorBase*>(wobbleSuppressor_);
|
||||
doWobbleSuppression_ = dynamic_cast<NullWobbleSuppressor*>(wobbleSuppressor) == 0;
|
||||
WobbleSuppressorBase *wobble = static_cast<WobbleSuppressorBase*>(wobbleSuppressor_);
|
||||
doWobbleSuppression_ = dynamic_cast<NullWobbleSuppressor*>(wobble) == 0;
|
||||
|
||||
// estimate motions
|
||||
|
||||
@@ -471,8 +471,8 @@ void TwoPassStabilizer::setUp(const Mat &firstFrame)
|
||||
for (int i = -radius_; i <= 0; ++i)
|
||||
at(i, frames_) = firstFrame;
|
||||
|
||||
WobbleSuppressorBase *wobbleSuppressor = static_cast<WobbleSuppressorBase*>(wobbleSuppressor_);
|
||||
doWobbleSuppression_ = dynamic_cast<NullWobbleSuppressor*>(wobbleSuppressor) == 0;
|
||||
WobbleSuppressorBase *wobble = static_cast<WobbleSuppressorBase*>(wobbleSuppressor_);
|
||||
doWobbleSuppression_ = dynamic_cast<NullWobbleSuppressor*>(wobble) == 0;
|
||||
if (doWobbleSuppression_)
|
||||
{
|
||||
wobbleSuppressor_->setFrameCount(frameCount_);
|
||||
|
||||
Reference in New Issue
Block a user