2025-08-16 15:25:29 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include <opencv2/opencv.hpp>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
|
|
#define ENABLE_FISH_EYE 0
|
|
|
|
|
|
#define ENABLE_DEBUG 1
|
|
|
|
|
|
#define ENABLE_GEN_IMAGE 0
|
|
|
|
|
|
|
|
|
|
|
|
/*Breif<69><66><EFBFBD>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD>⺯<EFBFBD><E2BAAF>*/
|
|
|
|
|
|
void detectCorners(const cv::Mat& img,
|
|
|
|
|
|
const cv::Size& patternSize,
|
|
|
|
|
|
std::vector<cv::Point2f>& corners);
|
|
|
|
|
|
|
|
|
|
|
|
/*Breif<69><66>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
void detectCirclePoints(const cv::Mat& img,
|
|
|
|
|
|
const cv::Size& patternSize,
|
|
|
|
|
|
std::vector<cv::Point2f>& corners);
|
|
|
|
|
|
|
2025-08-28 11:03:16 +08:00
|
|
|
|
/*Breif<69><66><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD>궨<EFBFBD><EAB6A8><EFBFBD>ǵ㺯<C7B5><E3BAAF>*/
|
|
|
|
|
|
void detectCharucoCorners(const cv::Mat& img,
|
|
|
|
|
|
const cv::Size& patternSize,
|
|
|
|
|
|
float sqSize,
|
|
|
|
|
|
float mkSize,
|
|
|
|
|
|
std::vector<int>& markerIds,
|
|
|
|
|
|
std::vector<std::vector<cv::Point2f> >& markerCorners,
|
|
|
|
|
|
std::vector<int>& charucoIds,
|
|
|
|
|
|
std::vector<cv::Point2f>& charucoCorners);
|
|
|
|
|
|
|
|
|
|
|
|
/*Breif<69><66><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD><CCB8><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
void monocularCalibration_chessboard(
|
2025-08-16 15:25:29 +08:00
|
|
|
|
const std::vector<std::vector<cv::Point2f>>& imagePoints,
|
|
|
|
|
|
const cv::Size& imageSize,
|
|
|
|
|
|
const cv::Size& patternSize,
|
|
|
|
|
|
const float squareSize,
|
|
|
|
|
|
cv::Mat& cameraMatrix,
|
|
|
|
|
|
cv::Mat& distCoeffs,
|
|
|
|
|
|
std::vector<double>& reprojectionError);
|
|
|
|
|
|
|
2025-08-28 11:03:16 +08:00
|
|
|
|
/*Breif<69><66><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD>궨<EFBFBD>嵥Ŀ<E5B5A5><C4BF><EFBFBD><EFBFBD><EFBFBD>궨<EFBFBD><EAB6A8><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
void monocularCalibration_charuco(
|
|
|
|
|
|
std::vector<std::vector<int>>& charucoIds,
|
|
|
|
|
|
std::vector<std::vector<cv::Point2f>>& charucoCorners,
|
|
|
|
|
|
const cv::Size& imageSize,
|
|
|
|
|
|
const cv::Size& patternSize,
|
|
|
|
|
|
const float squareSize,
|
|
|
|
|
|
cv::Mat& cameraMatrix,
|
|
|
|
|
|
cv::Mat& distCoeffs,
|
|
|
|
|
|
std::vector<double>& reprojectionError);
|
|
|
|
|
|
|
2025-08-16 15:25:29 +08:00
|
|
|
|
/*Brief: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD><CCB8>ǵ<EFBFBD>ƽ<EFBFBD><C6BD>*/
|
2025-08-30 16:11:06 +08:00
|
|
|
|
void fitChessboardPlane_chessboard(
|
|
|
|
|
|
std::vector<cv::Point2f>& corners,
|
|
|
|
|
|
const cv::Mat& cameraMatrix,
|
|
|
|
|
|
const cv::Mat& distCoeffs,
|
|
|
|
|
|
const cv::Size& patternSize,
|
|
|
|
|
|
const float squareSize,
|
|
|
|
|
|
cv::Vec4f& planeEquation);
|
|
|
|
|
|
|
|
|
|
|
|
/*Brief: <20><><EFBFBD>϶<EFBFBD>ά<EFBFBD><CEAC><EFBFBD>궨<EFBFBD><EAB6A8><EFBFBD>ǵ<EFBFBD>ƽ<EFBFBD><C6BD>*/
|
|
|
|
|
|
void fitChessboardPlane_charuco(
|
|
|
|
|
|
std::vector<int>& charucoIds,
|
|
|
|
|
|
std::vector<cv::Point2f>& corners,
|
2025-08-16 15:25:29 +08:00
|
|
|
|
const cv::Mat& cameraMatrix,
|
|
|
|
|
|
const cv::Mat& distCoeffs,
|
|
|
|
|
|
const cv::Size& patternSize,
|
|
|
|
|
|
const float squareSize,
|
|
|
|
|
|
cv::Vec4f& planeEquation);
|
|
|
|
|
|
|
|
|
|
|
|
/*Brief: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DFBC>⺯<EFBFBD><E2BAAF>*/
|
|
|
|
|
|
std::vector<cv::Point2f> detectLaserLine(
|
|
|
|
|
|
const cv::Mat& inputImage);
|
|
|
|
|
|
|
|
|
|
|
|
/*Breif: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD>2d<32><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3dֵ*/
|
|
|
|
|
|
std::vector<cv::Point3f> project2DTo3D(
|
|
|
|
|
|
const std::vector<cv::Point2f>& imagePoints,
|
|
|
|
|
|
const cv::Vec4f& planeEquation, // [a,b,c,d] for ax+by+cz+d=0
|
|
|
|
|
|
const cv::Mat& cameraMatrix, // <20><><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>K
|
|
|
|
|
|
const cv::Mat& distCoeffs); // <20><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>D
|
|
|
|
|
|
|
|
|
|
|
|
/*Breif: <20><><EFBFBD><EFBFBD>ƽ<EFBFBD>淽<EFBFBD><E6B7BD>*/
|
|
|
|
|
|
cv::Vec4f fitPlaneToPoints(const std::vector<cv::Point3f>& points);
|