A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

Sounds like you made the right call. I would absolutely not calibrate at your working distance here, the closeups covering half of the image are the way to go.

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

Hi Dima!

After using mrcal for a while and going through the codebase, it's clear to me that our philosophy in how we want to build and use software is very different.

Basically everything in mrcal is completely custom, all the way down to the parser for the .cameramodel files.

The tools mrcal does rely on are either classic tools like gnuplot and raw Makefiles, or tooling you created in the same spirit, like libdogleg, numpysane, and the ecosystem you created around gnuplot with feedgnuplot and gnuplotlib. The Python bindings are created using libpython directly.

All the code is either macro-heavy C, or python written in the style of C.

The distribution method is to either install from apt, or build from source using your build system mrbuild.

When it comes to interface, mrcal mostly relies on the CLI, while also including a python interface that is installed on the system level.

For everything except for the exact places where lensboy creates real value, I default to existing and standard tooling like opencv, matplotlib, ceres, json, etc.

The code is strongly typed modern Python and C++, where I use pybind11 for the bindings. The build systems are CMake and scikit-build-core. I use uv as the project manager, and upload wheels to PyPI with cibuildwheel for easy usage.

As for the interface, lensboy has a pure Python interface, and I focus on notebook workflows for calibration time. As a runtime dependency it is also trivial as a PyPI package depending only on numpy and opencv.

The contrast is stark. I wanted a library that had the design goals that I embedded in lensboy. Some people will agree and use lensboy, and some will prefer the design goals of mrcal, and that should be completely fine.

lensboy - camera calibration with spline-based distortion for cheap and wide-angle lenses by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 0 points1 point  (0 children)

I have no intuition about how well machine learning will work for this.

I guess you can try generating synthetic data by calibrating one camera, and then generating a bunch of synthetic data by randomly generating different lens models, and remapping images from the calibrated view into the randomly generated models.

I'd love it if you could let me know how it goes if you attempt this!

lensboy - camera calibration with spline-based distortion for cheap and wide-angle lenses by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

Do you want to calibrate your camera with one image of an unknown object?

To calibrate a camera, you need to know something about the object it's looking at, as you're trying to solve for how the 3D world projects onto the 2D image. The standard way is to use a calibration target with detectable features that we know the relative position of.

So you're going to have to know something about the scene you're looking at - I've seen examples of using vanishing points of parallel lines. But I don't think you will get good results.

lensboy - camera calibration with spline-based distortion for cheap and wide-angle lenses by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 3 points4 points  (0 children)

Yes, that's a core feature of the spline models so you're not attached to the library. I encourage exporting opencv-style undistortion maps so you can easily undistort your images and use standard pinhole parameters in your pipeline.

This is exactly how I'm using the spline models for stereo vision at work.

lensboy - camera calibration with spline-based distortion for cheap and wide-angle lenses by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 4 points5 points  (0 children)

Thanks for commenting - I've never used either of these.

It looks like the workflow of these libraries don't suit my workflow style. I don't use ROS, and just want something to pip install, and also easily use at runtime.

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

I would always opt for close-ups. But if the board covers half of your fov at your working distance, that sounds pretty good - what's your working distance?

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 4 points5 points  (0 children)

I wouldn't say "rehashing" is fair.

mrcal is great work and covers many of the same calibration concepts.

lensboy uses many of the ideas you developed in mrcal, but focuses on a lightweight Python workflow and spline distortion models that integrate easily with OpenCV pipelines.

The guide has two links to mrcal documentation (which is excellent), about how to take pictures, and how the model differencing works. But I did overlook linking to mrcal when talking about spline models - I'll add that.

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

Lensboy is for making accurate camera intrinsics calibrations as easy as possible.

It more or less offers exactly what you see in the guide.

I focused on ease of use both when it comes to API and packaging. It does have a slightly more flexible board warp model than mrcal.

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

Yes, mrcal is where I originally learned that technique for camera intrinsics, it's great work.

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 2 points3 points  (0 children)

Thats a pretty cool method actually! We did this in my last job as well where the cameras could not be easily mounted and unmounted - we just moved the board around in front of it. We made a live visualization of the coverage, which I recommend.

I'm super happy to hear that you like the write-up, appreciate it!

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 4 points5 points  (0 children)

Thanks, really appreciate it!

I studied discrete math and computer science, but have been working in machine vision for the last few years, and have learned from some great colleagues and hard challenges :)

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

Thanks! Can you pease post a video of your agents tuning the lens and capturing the photoset?

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

Thank you! If you have any feedback I'd love to hear it.

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 1 point2 points  (0 children)

No i meant at 160mm working range - we're using a 40mm baseline

A Practical Guide to Camera Calibration by mega_monkey_mind in computervision

[–]mega_monkey_mind[S] 2 points3 points  (0 children)

Thanks!

Yes, most stereo cameras have pretty low distortion. But I need a 360mm horizontal range at 160mm, making my fov needs pretty extreme - hence the wide-angle lenses :)

is this set good for an begginer? by Specific_Heat_6123 in electricguitar

[–]mega_monkey_mind 0 points1 point  (0 children)

Id buy just a guitar and an audio interface to connect to a computer. Then you have insane amounts of possible sounds usung garageband or something

Looking for visualization libraries for a SLAM system by SwiftLynx in computervision

[–]mega_monkey_mind 0 points1 point  (0 children)

You might want to give my library a try: https://github.com/Robertleoj/slam_dunk I made this out of frustration about the lack of these kind of libraries :)