Commit 40a61ec6 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #11647 from sanchom:3.4

parents 6912c203 dbab7eca
...@@ -78,10 +78,7 @@ class RANSACPointSetRegistrator : public PointSetRegistrator ...@@ -78,10 +78,7 @@ class RANSACPointSetRegistrator : public PointSetRegistrator
public: public:
RANSACPointSetRegistrator(const Ptr<PointSetRegistrator::Callback>& _cb=Ptr<PointSetRegistrator::Callback>(), RANSACPointSetRegistrator(const Ptr<PointSetRegistrator::Callback>& _cb=Ptr<PointSetRegistrator::Callback>(),
int _modelPoints=0, double _threshold=0, double _confidence=0.99, int _maxIters=1000) int _modelPoints=0, double _threshold=0, double _confidence=0.99, int _maxIters=1000)
: cb(_cb), modelPoints(_modelPoints), threshold(_threshold), confidence(_confidence), maxIters(_maxIters) : cb(_cb), modelPoints(_modelPoints), threshold(_threshold), confidence(_confidence), maxIters(_maxIters) {}
{
checkPartialSubsets = false;
}
int findInliers( const Mat& m1, const Mat& m2, const Mat& model, Mat& err, Mat& mask, double thresh ) const int findInliers( const Mat& m1, const Mat& m2, const Mat& model, Mat& err, Mat& mask, double thresh ) const
{ {
...@@ -143,17 +140,9 @@ public: ...@@ -143,17 +140,9 @@ public:
ms1ptr[i*esz1 + k] = m1ptr[idx_i*esz1 + k]; ms1ptr[i*esz1 + k] = m1ptr[idx_i*esz1 + k];
for( k = 0; k < esz2; k++ ) for( k = 0; k < esz2; k++ )
ms2ptr[i*esz2 + k] = m2ptr[idx_i*esz2 + k]; ms2ptr[i*esz2 + k] = m2ptr[idx_i*esz2 + k];
if( checkPartialSubsets && !cb->checkSubset( ms1, ms2, i+1 ))
{
// we may have selected some bad points;
// so, let's remove some of them randomly
i = rng.uniform(0, i+1);
iters++;
continue;
}
i++; i++;
} }
if( !checkPartialSubsets && i == modelPoints && !cb->checkSubset(ms1, ms2, i)) if( i == modelPoints && !cb->checkSubset(ms1, ms2, i) )
continue; continue;
break; break;
} }
...@@ -261,7 +250,6 @@ public: ...@@ -261,7 +250,6 @@ public:
Ptr<PointSetRegistrator::Callback> cb; Ptr<PointSetRegistrator::Callback> cb;
int modelPoints; int modelPoints;
bool checkPartialSubsets;
double threshold; double threshold;
double confidence; double confidence;
int maxIters; int maxIters;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment