camera_calibration icon indicating copy to clipboard operation
camera_calibration copied to clipboard

central_opencv raise error with --num_pyramid_levels = 4

Open phamdat09 opened this issue 2 years ago • 1 comments

Hello, I tried to calibrate my camera with your tool. However, when I run your code with central_opencv with --num_pyramid_levels = 4, it raises the error calibration.cc:1060 FATL| CHECK FAILED: !!(state->intrinsics[camera_index]->GetGridResolution(&actual_resolution_x, &actual_resolution_y)) Camera model without GetGridResolution() used with pyramid scheme; set --num_pyramid_levels to 1 . Then, I run with --num_pyramid_levels= 1,but, the result is so poor. Can I run the central_opencv with --num_pyramid_levels = 4 ? One more question, I need the value of focal length, then, Do you have any way to convert the result of central_generic to fx, fy, cx, cy ? Thanks

phamdat09 avatar Mar 18 '22 12:03 phamdat09

The --num_pyramid_levels parameter is only intended for the generic camera models, because those are supposed to be optimized in a multi-resolution scheme in which their grid resolution is gradually increased. In the central_opencv model, there is no parameter grid, therefore this parameter does not apply and must always be set to 1.

A calibration with the central_generic model cannot be directly "converted" to a parametric model, however it is possible to fit a parametric model to the generic calibration result. But I don't remember whether there is an existing way to fit a (distortion-free) pinhole model to a calibration result with the program, or whether the code would need to be modified. As a start, there is existing code to fit a CentralThinPrismFisheyeModel to a calibration result with the --create_fitting_visualization flag, see here:

https://github.com/puzzlepaint/camera_calibration/blob/32173589ae4db7491ace3173b5bdf2bf65f98716/applications/camera_calibration/src/camera_calibration/main.cc#L397

If you are mainly interested in parametric camera model parameters, perhaps a different calibration program could be better suited that focuses on these models.

puzzlepaint avatar Mar 19 '22 15:03 puzzlepaint