Home | History | Annotate | Download | only in test
      1 #ifndef CV_CHESSBOARDGENERATOR_H143KJTVYM389YTNHKFDHJ89NYVMO3VLMEJNTBGUEIYVCM203P
      2 #define CV_CHESSBOARDGENERATOR_H143KJTVYM389YTNHKFDHJ89NYVMO3VLMEJNTBGUEIYVCM203P
      3 
      4 #include "opencv2/calib3d.hpp"
      5 
      6 namespace cv
      7 {
      8 
      9 class ChessBoardGenerator
     10 {
     11 public:
     12     double sensorWidth;
     13     double sensorHeight;
     14     size_t squareEdgePointsNum;
     15     double min_cos;
     16     mutable double cov;
     17     Size patternSize;
     18     int rendererResolutionMultiplier;
     19 
     20     ChessBoardGenerator(const Size& patternSize = Size(8, 6));
     21     Mat operator()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, std::vector<Point2f>& corners) const;
     22     Mat operator()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, const Size2f& squareSize, std::vector<Point2f>& corners) const;
     23     Mat operator()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, const Size2f& squareSize, const Point3f& pos, std::vector<Point2f>& corners) const;
     24     Size cornersSize() const;
     25 
     26     mutable std::vector<Point3f> corners3d;
     27 private:
     28     void generateEdge(const Point3f& p1, const Point3f& p2, std::vector<Point3f>& out) const;
     29     Mat generateChessBoard(const Mat& bg, const Mat& camMat, const Mat& distCoeffs,
     30         const Point3f& zero, const Point3f& pb1, const Point3f& pb2,
     31         float sqWidth, float sqHeight, const std::vector<Point3f>& whole, std::vector<Point2f>& corners) const;
     32     void generateBasis(Point3f& pb1, Point3f& pb2) const;
     33 
     34     Mat rvec, tvec;
     35 };
     36 
     37 }
     38 
     39 
     40 #endif
     41