ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.28k stars 1.39k forks source link

Removing reprojection errors from IMU-camera calibration #588

Closed lboroson closed 1 year ago

lboroson commented 1 year ago

Hello,

I'm using the IMU-camera calibration tool. It seems that the optimization includes terms for reprojection errors in each frame, and attempts to also minimize these. Is it possible to disable this, so the optimization will simply use the reprojected corners to find the IMU-camera transform?

Specifically, I'm working with a stereo camera, where the frame for the 3D points from stereo processing does not match the camera frame. I can undistort the keypoints detected in each image and project them to the stereo frame, and I want to do the optimization based on the projected keypoints.

I don't think any of the command-line options allow for this, so I'd appreciate any suggestions for how to do it in the code. I've tried to create a second CameraGeometry with the stereo model to reproject the target observations and I've modified IccCamera.addCameraErrorTerms() to construct the error terms using undistorted corners from that model instead of the original image points, but the optimization is not finding the transform I expect. Are there other places where it would be necessary to change the camera model or make other changes?

goldbattle commented 1 year ago

What you want to do is a bit confusing and not that clear. But if you want to make changes you can make them directly to the code to support what you want.