Camera calibration

I’m hoping to start a conversation about camera calibration and test how big the usage/interest is.

Do you need a camera calibration package in Julia?
Do you know how to write such a package?

A lot of the basic pieces are already present in CoordinateTransformations.jl. Automatically detecting, say, checkerboards could be done with libcbdetect. Optimizing the intrinsic and extrinsic parameters could be done with one of the many options available to us in Julia. Or we could do it completely differently, see here, and here, and here.

11 Likes

I’d be interested in this. I’d especially like a mean-variance analysis component of such a package.

3 Likes

Wow, that would be awesome, to have you on board!

I haven’t really used it, but I think it could be helpful here: ImageProjectiveGeometry.jl
I discovered it after playing around with my own DLT solver and Optim to fine tune the solutions, which was mostly unsuccessful.

1 Like

I haven’t been active in this space for a few years, but was an avid amateur photog for a while. Regarding calibration, I jumped to color-spaces, but perhaps you want to go the geometry route, or both?
For the color spaces, I have a full XRite system w/ a ColorMunki monitor and print colorimeter for generating icc profiles, and also color standard “swatches” that you include in the image captured (uh, hard to do that with stars and such though!).
Here are a few links that may help, especially open-source tools or that highlight standards in this area: https://www.argyllcms.com/, and software built using that as a base: https://displaycal.net/ this article lists 4 open-source tools: Calibrate your Monitor with these Open Source Tools - LinuxLinks hcfr: hcfr download | SourceForge.net
There’s also a host of tools for camera calibration to test for back/front-focusing (I used vintage and modern rangefinders, which could be a bit tetchy with focusing low f-stop high aperture lenses at times with perhaps only an inch of depth-of-field range when shot wide-open).
Good luck!

1 Like

Cool stuff. I personally am most interested in the geometry kind of calibration, but all interest is great!

I think a good first step might be to separate between the camera model and the machinery of finding all the parameters. This way multiple implementations of this machinery can be implemented – and even used – in parallel. So how about I start with a basic CameraModels repo and we build on that?

OK, started it off with this:
https://github.com/yakir12/CameraModels.jl

Please feel free to comment, contribute, or overwrite!

Slightly off-topic … if using printed checkerboard for camera calibration, sub-pixel detection may not
be sufficient, at least if you need ultra-precise calibration.

We found out that iterating between camera calibration and whole bundle adjustment to re-asses further the location of the corers did the trick. That or use mechanical checkerboard.

he he he, awesome. So to clarify, iterating:

  1. guess parameters
  2. optimize
  3. use optimized parameters as guesses for the next optimization

results in higher accuracy? Or do you do an additional step, like undistort the images using the intrinsic parameters, and then detect the corners again?

Also, come on-board on the camera calibration train!!!

Detected corers in sub-pixel accuracy is done only once, but the real-world position of the corners is iterated upon.

Full camera calibration flow is as follows:
Phase 1:

  1. detect corners and perform normal camera calibration assuming planar checkerboard. (openCV)

Phase 2:

  1. given the detected corners the assumed real-world position of them, the distortion coefficients and the camera calibration.
    perform bundle adjustment keeping the camera calibration and distortion coefficients fixed. optimising the
    real-world location of the corners.

  2. calibrate again using the optimised real-world corners. (using openCV)

repeat 1-2 several times optionally weighting outliers less based on the reprojection error.

Sounds cool. I hope to replace the OpenCV part of that with a Julia-version… See this for a first veryvery basic step:
https://github.com/yakir12/CameraModels.jl

Very interested having this in julia, I endorse your “veryvery basic first step”, CameraModels.jl - happy to contribute and review. I have quite some (10y+) experience with camera calibration methods and robust parameter estimation.

3 Likes

That’s wonderful!!! Looking forward to it!

Hi, I’m also interested in having this in Julia. As a user, I have tested multiple available packages in Matlab and OpenCV to calibrate stereo rigs, and I must say that the one giving the most accurate results is this one: GitHub - justinblaber/camera_calib_matlab: Camera calibration with matlab
As it’s written in Matlab, perhaps it could be translated to Julia without too much hassle. Automatic differentiation should also make things easier.

1 Like

Wow, that camera_calib looks monstrous! It does everything…

Unfortunately, there’s no license, so whoever wants to translate it would need to get the permission of the author of that package and the packages that it is based off of.

Hi good people!
Not much has happened with camera calibration in Julia (that I know of – please correct me if I’m wrong!).

I’m still in need of a free and platform-agnostic solution for camera (spatial) calibration, so I thought I’d ask here: what is everyone currently using…?

I’ve been using Matlab’s camera calibration toolbox (both the Caltech one and the one shipped with Matlab) which is proprietary.

1 Like

So not much of an update, but @touste did point out to me that in camera calibration there are two very different tasks in hand. It might be helpful to consider these as two separate goals, making the road to a camera calibration package in Julia clearer:

  1. detecting the checkerboards corners.
  2. optimizing the intrinsic and extrinsic parameters of the camera.

The first require image analysis while the latter doesn’t.

While we can’t have camera calibration without both of these two parts, getting one will facilitate the creation of the other.

Does anyone have any knowledge about how to code the corner detection algorithm suggested here by Duda and Frese? Or perhaps there is an alternative you might know of?

Hi All,

Just and FYI on camera work we’ve been doing over at JuliaRobotics:

Best,
Dehann

4 Likes