12 Star 58 Fork 30

yizhaoyanbo/Camera Calibration

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
calibration.h 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
#pragma once
#include "opencv2\opencv.hpp"
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
using namespace cv;
#define CV
//#define FISHEYE
class CCalibration
{
public:
CCalibration(string patternImgPath, string CalibResultPath, Size boardSize)
{
this->patternImgPath=patternImgPath;
this->calibResultPath=CalibResultPath;
this->boardSize=boardSize;
}
~CCalibration(){}
private:
vector<cv::Point3f> singlePatternPoints;
vector<Mat> patternImgList;
int imgHeight;
int imgWidth;
int imgNum;
float scale = 0.25;
float errThresh = 3000;
string patternImgPath;
string calibResultPath;
Size boardSize;
Mat camK;
Mat camDiscoeff;
private:
int evaluateCalibrationResult(vector<vector<cv::Point3f>> objectPoints, vector<vector<cv::Point2f>> cornerSquare, vector<int> pointCnts, vector<cv::Vec3d> _rvec,
vector<cv::Vec3d> _tvec, cv::Mat _K, cv::Mat _D, int count, vector<int> &outLierIndex, int errThresh);
bool testCorners(vector<cv::Point2f>& corners, int patternWidth, int patternHeight);
void init3DPoints(cv::Size boardSize, cv::Size squareSize, vector<cv::Point3f> &singlePatternPoint);
public:
bool writeParams();
bool readPatternImg();
void calibProcess();
void run();
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/rxdj/camera-calibration.git
git@gitee.com:rxdj/camera-calibration.git
rxdj
camera-calibration
Camera Calibration
master

搜索帮助