#pragma once #include #include #define ENABLE_FISH_EYE 0 #define ENABLE_DEBUG 1 #define ENABLE_GEN_IMAGE 0 /*Breif:角点检测函数*/ void detectCorners(const cv::Mat& img, const cv::Size& patternSize, std::vector& corners); /*Breif:圆形网格函数*/ void detectCirclePoints(const cv::Mat& img, const cv::Size& patternSize, std::vector& corners); /*Breif:二维码标定板角点函数*/ void detectCharucoCorners(const cv::Mat& img, const cv::Size& patternSize, float sqSize, float mkSize, std::vector& markerIds, std::vector >& markerCorners, std::vector& charucoIds, std::vector& charucoCorners); /*Breif:棋盘格单目相机标定函数*/ void monocularCalibration_chessboard( const std::vector>& imagePoints, const cv::Size& imageSize, const cv::Size& patternSize, const float squareSize, cv::Mat& cameraMatrix, cv::Mat& distCoeffs, std::vector& reprojectionError); /*Breif:二维码标定板单目相机标定函数*/ void monocularCalibration_charuco( std::vector>& charucoIds, std::vector>& charucoCorners, const cv::Size& imageSize, const cv::Size& patternSize, const float squareSize, cv::Mat& cameraMatrix, cv::Mat& distCoeffs, std::vector& reprojectionError); /*Brief: 拟合棋盘格角点平面*/ void fitChessboardPlane( const std::vector& corners, const cv::Mat& cameraMatrix, const cv::Mat& distCoeffs, const cv::Size& patternSize, const float squareSize, cv::Vec4f& planeEquation); /*Brief: 激光线检测函数*/ std::vector detectLaserLine( const cv::Mat& inputImage); /*Breif: 根据棋盘格平面和2d坐标计算3d值*/ std::vector project2DTo3D( const std::vector& imagePoints, const cv::Vec4f& planeEquation, // [a,b,c,d] for ax+by+cz+d=0 const cv::Mat& cameraMatrix, // 相机内参K const cv::Mat& distCoeffs); // 畸变系数D /*Breif: 拟合平面方程*/ cv::Vec4f fitPlaneToPoints(const std::vector& points);