Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/calib3d/test/test_chessboardgenerator.hpp
16337 views
1
// This file is part of OpenCV project.
2
// It is subject to the license terms in the LICENSE file found in the top-level directory
3
// of this distribution and at http://opencv.org/license.html.
4
#ifndef CV_CHESSBOARDGENERATOR_H143KJTVYM389YTNHKFDHJ89NYVMO3VLMEJNTBGUEIYVCM203P
5
#define CV_CHESSBOARDGENERATOR_H143KJTVYM389YTNHKFDHJ89NYVMO3VLMEJNTBGUEIYVCM203P
6
7
namespace cv
8
{
9
10
using std::vector;
11
12
class ChessBoardGenerator
13
{
14
public:
15
double sensorWidth;
16
double sensorHeight;
17
size_t squareEdgePointsNum;
18
double min_cos;
19
mutable double cov;
20
Size patternSize;
21
int rendererResolutionMultiplier;
22
23
ChessBoardGenerator(const Size& patternSize = Size(8, 6));
24
Mat operator()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, std::vector<Point2f>& corners) const;
25
Mat operator()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, const Size2f& squareSize, std::vector<Point2f>& corners) const;
26
Mat operator()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, const Size2f& squareSize, const Point3f& pos, std::vector<Point2f>& corners) const;
27
Size cornersSize() const;
28
29
mutable std::vector<Point3f> corners3d;
30
private:
31
void generateEdge(const Point3f& p1, const Point3f& p2, std::vector<Point3f>& out) const;
32
Mat generateChessBoard(const Mat& bg, const Mat& camMat, const Mat& distCoeffs,
33
const Point3f& zero, const Point3f& pb1, const Point3f& pb2,
34
float sqWidth, float sqHeight, const std::vector<Point3f>& whole, std::vector<Point2f>& corners) const;
35
void generateBasis(Point3f& pb1, Point3f& pb2) const;
36
37
Mat rvec, tvec;
38
};
39
40
}
41
42
43
#endif
44
45