Hello I try to calibrate my camera in Opencv. Unfortunately I get the error
initializer element is not constant const CvMat CameraMatrix = cvMat(3,3,CV_64FC1, camera_matrix);
when compiling my C code. Can someone help me? So far I have only found C ++ examples.
const float camera_matrix[3][3] = {
{1.9109556203786724e+03, 0., 9.7868550610235718e+02},
{0., 1.9067942582652870e+03, 5.3264622851365255e+02},
{0., 0., 1.}};
const CvMat CameraMatrix = cvMat(3,3,CV_64FC1, camera_matrix);
float distortion_coefficients[1][5] = {
{8.4168872817623579e-03, -1.6092726101677710e-01,
1.4210945666220784e-03, -3.9888765134799423e-03,
1.3635442753934679e-01}
};
const CvMat DistortionCoefficients = cvMat(1,5,CV_64FC1, distortion_coefficients);
cvUndistort2(show_img, show_img, CameraMatrix, DistortionCoefficients, CameraMatrix);