r/computervision • u/kocurvik • 4d ago
Research Publication LiteCalib: Camera Calibration from Single Image
https://kocurvik.github.io/litecalibHi we just released LiteCalib, a fast single-image camera calibration method. You give it one photo and it returns the focal length and lens distortion. Similarly to AnyCalib, it works with pinhole, radial, division, UCM/EUCM, Kannala-Brandt and other radially symmetric models. The network outputs an intermediate representation and you can choose which camera model you fit to it.
This is useful if you have distorted images (e.g. from action camera) and want to run a pipeline that was trained on pinhole images such as 3D reconstruction methods such as VGGT, Pi3, DepthAnythingV3, MapAnything, monocular depth estimators such as MoGe, UniDepth, SurGe or even classical pipelines like COLMAP. It can also estimate focal lengths for individual images if you need to use crowdsourced or user-provided images.
This is not new as previous methods such as AnyCalib or GeoCalib have similar capabilities. However, our network was trained using much broader distribution making it much more accurate than previous SOTA. We have also made the full camera calibartion faster by predicting only a sparse representation instead of dense one and making parts of the network much lighter. Our whole network with the camera model fit runs in 9.7 ms on A100 compared to 50+ ms for AnyCalib. We have also trained ViT-S and ViT-B variants when you are even more compute constrained.
Try it:
pip install litecalib
import litecalib
model = litecalib.load("litecalib_vitl")
calib = model.calibrate("photo.jpg", cam_id="division:1")
calib.K #pinhole intrinsics
undistorted = calib.undistort("photo.jpg") #undistorted image
- More info on our project page: https://kocurvik.github.io/litecalib
3
u/blobules 4d ago
Any constraint on what is photographed? If not, how does it differentiate an undistorted view of a curved object from a distorted view if a straight object?
It seems to me that this can only work if you look at "known objects" (I.e. present in the training set). Is this the case?
2
u/tcdoey 3d ago edited 3d ago
Hey that's great. I do my own camera calibration with a color grid frame 3D printed. I should ask at the github these questions, but just jotting down here. I've been reading the code/md, so far just briefly and I don't see anything about color calibration, but your mapping method is far superior than my simple lens-optical transform-mapping method. Apologies, I'm a noob at this and prob using wrong terminology.
Does this do any kind of, or can added color calibration/grading step be intrinsically included? I know, it may not be necessary, and might just at first thought to leave as an outside step, but the issue I've seen is that color changes with depth on most cameras, becoming more 'vibrant' closer to the cam, and less further away, and even changing hue.
I could describe more but I think that's enough to get the reason for my question across. Thanks, and I'm going to continue to wade through this. Looks super.
2
u/Ribhai 4d ago
Very useful.
1
u/3e8892a 3d ago
Nice! How does accuracy compare to printing a checkerboard and running opencv calibration?
And if I have video, can I gain a more accurate calibration by processing multiple frames?
1
u/bfyvfftujijg 3d ago
Nice! I’m surprised the big foundation models don’t have this capability “built in”.