Hacker News new | ask | show | jobs
Show HN: Lensboy – Lightweight camera calibration with spline distortion models (github.com)
2 points by robertleoj 104 days ago
I do a lot camera calibration.

As my need for accuracy increased, I started using mrcal, a great camera calibration tool. But I found it didn't fit my workflow well in terms of workflow and as a software dependency.

What I wanted from a calibration library was:

Accuracy (obviously)

Trivial dependency, both calibration time and runtime

Simple and notebook-friendly python API

Support for both OpenCV and spline distortion models

Great built-in analysis tools

Board warp estimation

Outlier filtering

So that's what I built!

Would love feedback from other robotics / computer vision folks.

1 comments

Hello! I'd love it if this and mrcal could work together. Do you support mrcal .cameramodel files? If not, can you do that? Is your splined representation compatible with the mrcal splined stereographic model? If not, can it? Is your splined lens representation better in some way? If so, should mrcal use some of that logic? I didn't see any documentation about it. If you think the mrcal distribution methods could be improved, and are willing to help improve it, I would be very amenable. Let's collaborate to make both projects better!
Hello Dima!

Thanks for replying - I really admire your work with mrcal, and have used it for a while in my work. And lensboy is heavily inspired by mrcal.

> Is your splined representation compatible with the mrcal splined stereographic model?

No. It was a conscious design decision to only use pinhole models, at least to begin with. As I understand it, the tradeoff is that the pinhole model does not support ultra-wide lenses like the stereoscopic model does. But I have never used a lens that has a field of view close to the limits of pinhole models, so I just went with pinhole models.

However, if I understood your documentation correctly, the distortion model should be identical, it's just the core model that is different.

> Is your splined lens representation better in some way?

I'm pretty sure it's not - I based it entirely off yours, without trying to improve it. However, I did implement regularization slightly differently.

> I didn't see any documentation about it.

Unfortunately I have not written documentation as impressive as you have in mrcal, though I aim to. I wanted to get the project working as soon as possible to use it at work.

> If you think the mrcal distribution methods could be improved, and are willing to help improve it, I would be very amenable.

I actually did attempt this in this fork: https://github.com/Robertleoj/drcal (I'm sorry for the brazen phrasing in the readme, but I believe it is sligtly in the style of the name "numpysane").

The purpose of this was just to have functionality of mrcal but available on pypi, and with a build system I understand better.

However, I abandoned this, instead opting for making a library from scratch, partly because I had a hard time removing numpysane as a dependency (I want to have very minimal dependencies in this project). I'm not sure how to reconcile this, but I'm happy to chat about what I did there.

> Do you support mrcal .cameramodel files? If not, can you do that?

I don't support them currently. I'd love to chat about doing this, even if loading them would lose some information because of different data models.

Don't hesitate to send me an email, you can find it on my github profile.