Merge pull request #18598 from aleromar:Issue18595_UsacParams_PythonBinding

pull/18621/head
Alexander Alekhin 4 years ago
commit adac1da64e
  1. 23
      modules/calib3d/include/opencv2/calib3d.hpp
  2. 15
      modules/calib3d/src/solvepnp.cpp

@ -550,17 +550,18 @@ enum NeighborSearchMethod { NEIGH_FLANN_KNN, NEIGH_GRID, NEIGH_FLANN_RADIUS };
struct CV_EXPORTS_W_SIMPLE UsacParams
{ // in alphabetical order
double confidence = 0.99;
bool isParallel = false;
int loIterations = 5;
LocalOptimMethod loMethod = LocalOptimMethod::LOCAL_OPTIM_INNER_LO;
int loSampleSize = 14;
int maxIterations = 5000;
NeighborSearchMethod neighborsSearch = NeighborSearchMethod::NEIGH_GRID;
int randomGeneratorState = 0;
SamplingMethod sampler = SamplingMethod::SAMPLING_UNIFORM;
ScoreMethod score = ScoreMethod::SCORE_METHOD_MSAC;
double threshold = 1.5;
CV_WRAP UsacParams();
CV_PROP_RW double confidence;
CV_PROP_RW bool isParallel;
CV_PROP_RW int loIterations;
CV_PROP_RW LocalOptimMethod loMethod;
CV_PROP_RW int loSampleSize;
CV_PROP_RW int maxIterations;
CV_PROP_RW NeighborSearchMethod neighborsSearch;
CV_PROP_RW int randomGeneratorState;
CV_PROP_RW SamplingMethod sampler;
CV_PROP_RW ScoreMethod score;
CV_PROP_RW double threshold;
};
/** @brief Converts a rotation matrix to a rotation vector or vice versa.

@ -197,6 +197,21 @@ public:
Mat tvec;
};
UsacParams::UsacParams()
{
confidence = 0.99;
isParallel = false;
loIterations = 5;
loMethod = LocalOptimMethod::LOCAL_OPTIM_INNER_LO;
loSampleSize = 14;
maxIterations = 5000;
neighborsSearch = NeighborSearchMethod::NEIGH_GRID;
randomGeneratorState = 0;
sampler = SamplingMethod::SAMPLING_UNIFORM;
score = ScoreMethod::SCORE_METHOD_MSAC;
threshold = 1.5;
}
bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
InputArray _cameraMatrix, InputArray _distCoeffs,
OutputArray _rvec, OutputArray _tvec, bool useExtrinsicGuess,

Loading…
Cancel
Save