next(calib3d): eliminate CirclesGridFinderParameters2

pull/11256/head
Alexander Alekhin 7 years ago
parent 2385a5870e
commit ca922443db
  1. 17
      modules/calib3d/include/opencv2/calib3d.hpp
  2. 3
      modules/calib3d/misc/java/gen_dict.json
  3. 18
      modules/calib3d/src/calibinit.cpp
  4. 8
      modules/calib3d/src/circlesgrid.cpp
  5. 4
      modules/calib3d/src/circlesgrid.hpp

@ -881,16 +881,15 @@ struct CV_EXPORTS_W_SIMPLE CirclesGridFinderParameters
SYMMETRIC_GRID, ASYMMETRIC_GRID SYMMETRIC_GRID, ASYMMETRIC_GRID
}; };
GridType gridType; GridType gridType;
};
struct CV_EXPORTS_W_SIMPLE CirclesGridFinderParameters2 : public CirclesGridFinderParameters
{
CV_WRAP CirclesGridFinderParameters2();
CV_PROP_RW float squareSize; //!< Distance between two adjacent points. Used by CALIB_CB_CLUSTERING. CV_PROP_RW float squareSize; //!< Distance between two adjacent points. Used by CALIB_CB_CLUSTERING.
CV_PROP_RW float maxRectifiedDistance; //!< Max deviation from predicion. Used by CALIB_CB_CLUSTERING. CV_PROP_RW float maxRectifiedDistance; //!< Max deviation from predicion. Used by CALIB_CB_CLUSTERING.
}; };
#ifndef DISABLE_OPENCV_3_COMPATIBILITY
typedef CirclesGridFinderParameters CirclesGridFinderParameters2;
#endif
/** @brief Finds centers in the grid of circles. /** @brief Finds centers in the grid of circles.
@param image grid view of input circles; it must be an 8-bit grayscale or color image. @param image grid view of input circles; it must be an 8-bit grayscale or color image.
@ -926,13 +925,7 @@ the board to make the detection more robust in various environments.
CV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize, CV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize,
OutputArray centers, int flags, OutputArray centers, int flags,
const Ptr<FeatureDetector> &blobDetector, const Ptr<FeatureDetector> &blobDetector,
CirclesGridFinderParameters parameters); const CirclesGridFinderParameters& parameters);
/** @overload */
CV_EXPORTS_W bool findCirclesGrid2( InputArray image, Size patternSize,
OutputArray centers, int flags,
const Ptr<FeatureDetector> &blobDetector,
CirclesGridFinderParameters2 parameters);
/** @overload */ /** @overload */
CV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize, CV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize,

@ -1,7 +1,6 @@
{ {
"class_ignore_list": [ "class_ignore_list": [
"CirclesGridFinderParameters", "CirclesGridFinderParameters"
"CirclesGridFinderParameters2"
], ],
"missing_consts" : { "missing_consts" : {
"Calib3d": { "Calib3d": {

@ -2094,22 +2094,14 @@ void cv::drawChessboardCorners( InputOutputArray _image, Size patternSize,
nelems, patternWasFound ); nelems, patternWasFound );
} }
bool cv::findCirclesGrid( InputArray image, Size patternSize, bool cv::findCirclesGrid( InputArray _image, Size patternSize,
OutputArray centers, int flags,
const Ptr<FeatureDetector> &blobDetector,
CirclesGridFinderParameters parameters)
{
CirclesGridFinderParameters2 parameters2;
*((CirclesGridFinderParameters*)&parameters2) = parameters;
return cv::findCirclesGrid2(image, patternSize, centers, flags, blobDetector, parameters2);
}
bool cv::findCirclesGrid2( InputArray _image, Size patternSize,
OutputArray _centers, int flags, const Ptr<FeatureDetector> &blobDetector, OutputArray _centers, int flags, const Ptr<FeatureDetector> &blobDetector,
CirclesGridFinderParameters2 parameters) const CirclesGridFinderParameters& parameters_)
{ {
CV_INSTRUMENT_REGION() CV_INSTRUMENT_REGION()
CirclesGridFinderParameters parameters = parameters_; // parameters.gridType is amended below
bool isAsymmetricGrid = (flags & CALIB_CB_ASYMMETRIC_GRID) ? true : false; bool isAsymmetricGrid = (flags & CALIB_CB_ASYMMETRIC_GRID) ? true : false;
bool isSymmetricGrid = (flags & CALIB_CB_SYMMETRIC_GRID ) ? true : false; bool isSymmetricGrid = (flags & CALIB_CB_SYMMETRIC_GRID ) ? true : false;
CV_Assert(isAsymmetricGrid ^ isSymmetricGrid); CV_Assert(isAsymmetricGrid ^ isSymmetricGrid);
@ -2201,7 +2193,7 @@ bool cv::findCirclesGrid2( InputArray _image, Size patternSize,
bool cv::findCirclesGrid( InputArray _image, Size patternSize, bool cv::findCirclesGrid( InputArray _image, Size patternSize,
OutputArray _centers, int flags, const Ptr<FeatureDetector> &blobDetector) OutputArray _centers, int flags, const Ptr<FeatureDetector> &blobDetector)
{ {
return cv::findCirclesGrid2(_image, patternSize, _centers, flags, blobDetector, CirclesGridFinderParameters2()); return cv::findCirclesGrid(_image, patternSize, _centers, flags, blobDetector, CirclesGridFinderParameters());
} }
/* End of file. */ /* End of file. */

@ -565,13 +565,9 @@ CirclesGridFinderParameters::CirclesGridFinderParameters()
minRNGEdgeSwitchDist = 5.f; minRNGEdgeSwitchDist = 5.f;
gridType = SYMMETRIC_GRID; gridType = SYMMETRIC_GRID;
}
CirclesGridFinderParameters2::CirclesGridFinderParameters2() squareSize = 1.0f;
: CirclesGridFinderParameters() maxRectifiedDistance = squareSize/2.0f;
{
squareSize = 1.0f;
maxRectifiedDistance = squareSize/2.0f;
} }
CirclesGridFinder::CirclesGridFinder(Size _patternSize, const std::vector<Point2f> &testKeypoints, CirclesGridFinder::CirclesGridFinder(Size _patternSize, const std::vector<Point2f> &testKeypoints,

@ -49,14 +49,12 @@
#include <numeric> #include <numeric>
#include <map> #include <map>
#include "precomp.hpp"
class CirclesGridClusterFinder class CirclesGridClusterFinder
{ {
CirclesGridClusterFinder& operator=(const CirclesGridClusterFinder&); CirclesGridClusterFinder& operator=(const CirclesGridClusterFinder&);
CirclesGridClusterFinder(const CirclesGridClusterFinder&); CirclesGridClusterFinder(const CirclesGridClusterFinder&);
public: public:
CirclesGridClusterFinder(const cv::CirclesGridFinderParameters2 &parameters) CirclesGridClusterFinder(const cv::CirclesGridFinderParameters &parameters)
{ {
isAsymmetricGrid = parameters.gridType == cv::CirclesGridFinderParameters::ASYMMETRIC_GRID; isAsymmetricGrid = parameters.gridType == cv::CirclesGridFinderParameters::ASYMMETRIC_GRID;
squareSize = parameters.squareSize; squareSize = parameters.squareSize;

Loading…
Cancel
Save