5 #include <opencv2/imgproc.hpp>
7 #include <Image/ByteImage.h>
11 #include <VisionX/interface/components/Calibration.h>
16 cv::Mat cv_rgb(cv::Size(ivt_rgb.width, ivt_rgb.height), CV_8UC3);
17 std::memcpy(cv_rgb.data, ivt_rgb.pixels,
18 static_cast<unsigned int>(ivt_rgb.width * ivt_rgb.height * ivt_rgb.bytesPerPixel));
20 cv_gray.create(cv::Size(ivt_rgb.width, ivt_rgb.height), CV_8UC1);
21 cv::cvtColor(cv_rgb, cv_gray, cv::COLOR_RGB2GRAY);
29 const float nodalPointX = cameraParam.principalPoint.at(0);
30 const float nodalPointY = cameraParam.principalPoint.at(1);
31 const float focalLengthX = cameraParam.focalLength.at(0);
32 const float focalLengthY = cameraParam.focalLength.at(1);
34 cv::Mat camera_matrix = cv::Mat(3, 4, CV_64F, 0.0);
35 camera_matrix.at<
double>(0, 2) =
double(nodalPointX);
36 camera_matrix.at<
double>(1, 2) =
double(nodalPointY);
37 camera_matrix.at<
double>(0, 0) =
double(focalLengthX);
38 camera_matrix.at<
double>(1, 1) =
double(focalLengthY);
39 camera_matrix.at<
double>(2, 2) = 1.0;