Allow opencv8 distortion model in PhotonCamera (#1317)

We previously assumed only OpenCV5 but mrcal uses opencv8
This commit is contained in:
Matt
2024-05-29 17:28:35 -04:00
committed by GitHub
parent fcca858a37
commit 19b4802094
17 changed files with 172 additions and 94 deletions

View File

@@ -149,8 +149,23 @@ class PhotonCamera {
*/
const std::string_view GetCameraName() const;
std::optional<cv::Mat> GetCameraMatrix();
std::optional<cv::Mat> GetDistCoeffs();
using CameraMatrix = Eigen::Matrix<double, 3, 3>;
using DistortionMatrix = Eigen::Matrix<double, 8, 1>;
/**
* @brief Get the camera calibration matrix, in standard OpenCV form
*
* @return std::optional<cv::Mat>
*/
std::optional<CameraMatrix> GetCameraMatrix();
/**
* @brief Get the camera calibration distortion coefficients, in OPENCV8 form.
* Higher order terms are set to zero.
*
* @return std::optional<cv::Mat>
*/
std::optional<DistortionMatrix> GetDistCoeffs();
static void SetVersionCheckEnabled(bool enabled);