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 struct CV_EXPORTS_W_SIMPLE UsacParams
{ // in alphabetical order { // in alphabetical order
double confidence = 0.99; CV_WRAP UsacParams();
bool isParallel = false; CV_PROP_RW double confidence;
int loIterations = 5; CV_PROP_RW bool isParallel;
LocalOptimMethod loMethod = LocalOptimMethod::LOCAL_OPTIM_INNER_LO; CV_PROP_RW int loIterations;
int loSampleSize = 14; CV_PROP_RW LocalOptimMethod loMethod;
int maxIterations = 5000; CV_PROP_RW int loSampleSize;
NeighborSearchMethod neighborsSearch = NeighborSearchMethod::NEIGH_GRID; CV_PROP_RW int maxIterations;
int randomGeneratorState = 0; CV_PROP_RW NeighborSearchMethod neighborsSearch;
SamplingMethod sampler = SamplingMethod::SAMPLING_UNIFORM; CV_PROP_RW int randomGeneratorState;
ScoreMethod score = ScoreMethod::SCORE_METHOD_MSAC; CV_PROP_RW SamplingMethod sampler;
double threshold = 1.5; CV_PROP_RW ScoreMethod score;
CV_PROP_RW double threshold;
}; };
/** @brief Converts a rotation matrix to a rotation vector or vice versa. /** @brief Converts a rotation matrix to a rotation vector or vice versa.

@ -197,6 +197,21 @@ public:
Mat tvec; 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, bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
InputArray _cameraMatrix, InputArray _distCoeffs, InputArray _cameraMatrix, InputArray _distCoeffs,
OutputArray _rvec, OutputArray _tvec, bool useExtrinsicGuess, OutputArray _rvec, OutputArray _tvec, bool useExtrinsicGuess,

Loading…
Cancel
Save