mrcal camera calibration library

A library that claims to be more powerful than opencv, calling itself the "Next-generation camera-modeling toolkit", it is also written in C++ and has a Python API.
Installing the library kills me, it's much more troublesome than python.
The installation tutorial here
is available under ubuntu22.04

apt install mrcal libmrcal-dev python3-mrcal

So I installed a virtual machine. . . .
However, older versions of Ubuntu can also be configured by yourself.

For older distros or if you want to get the latest release of mrcal, you can use the mrcal APT repository. I currently distribute packages for
Debian/buster (10)
Debian/bullseye (11)
Debian/bookworm (12)
Debian/sid (bleeding-edge)
Ubuntu/bionic (18.04 LTS)
Ubuntu/focal (20.04 LTS)
Ubuntu/jammy (22.04 LTS)
amd64 and arm64 architectures only (except Ubuntu/bionic, which is amd64-only). To use these, add to your /etc/apt/sources.list:
deb [trusted=yes] http://mrcal.secretsauce.net/packages/DISTRO/public/ DISTRO main
where DISTRO is one of
buster
bulleye
bookworm
bionic
focal
jammy
Then, apt update && apt install mrcal. The chessboard corner finder, while not strictly required, is needed if you’re doing chessboard-based calibrations. apt install mrgingham
How should I put it? I am a technical person, and my skills are all technical. This tutorial is written very casually and freely.

python api here
python packaged github library code here
rich tutorial here
I encountered a bug at the beginning, its pictures can identify corner points,

mrgingham --jobs 4 --gridn 14 '*.JPG' > corners.vnl 

gridn is the size of the checkerboard, 14 is 14x14, which can be written as

mrgingham --jobs 4 --gridn 9,6 '*.JPG' > corners.vnl 

corners.vnl is output to the corners.vnl file.
–jobs 4 thread
mrgingham command for this library

If points are detected, corners.vnl should look like this
Insert image description here

After that

< corners.vnl       \
  vnl-filter -p x,y | \
  feedgnuplot --domain --square --set 'xrange [0:6000] noextend' --set 'yrange [3376:0] noextend'

vnl-filter is a library that can filter the x, y coordinate values ​​in corners.vnl.
feedgnuplot is used for drawing pictures. It draws the x and y coordinate values ​​on the picture.
However, these two libraries seem to be written by the author of mrcal, which is really awesome.
Insert image description here

Insert image description here
The top is the original image, and the bottom is the detected corners, which look very good.
But when I used it myself, corners could not be detected.
Insert image description here
I am a wolf. . .

It seems to be because mrgingham can only adapt to the NxN checkerboard pattern.
Later I found another running method, mrcal-calibrate-cameras. The author said that this method can be adapted to non-NxN checkerboards.
There are still bugs after running it.

mrcal-calibrate-cameras
    --corners-cache corners.vnl
    --lensmodel LENSMODEL_OPENCV8
    --focal 1700 --object-spacing 0.01 --object-width-n 10
    --outdir /tmp
    --pairs
    'left*.png' 'right*.png'

It seems to be a problem with the installed library version. It's very uncomfortable here. Why is the library in .local/lib/python3.10/site-packages/ called? My virtual virtual environment is obviously ~/anaconda3/envs/ChessBoardCornersDetection/. Confused.

Insert image description here
It seems that the command line directly calls the system library, not the virtual environment library, because my mrcal is built with apt install. If you want to use the virtual environment, you should use make to build the mrcal library yourself. . . Lant's.

But this step seems to be calibration. . . . Not detecting corners. Corners must be detected first before this step can be performed. . . 尻.

How can I put it this way? Matlab is so easy to use. It is a good tool for camera calibration.
Your sordid mrcal is so annoying.
However, I did several comparative experiments later.
Some pictures cannot be recognized by opencv, but matlab can recognize them well. Some pictures can be recognized very poorly by matlab, but opencv can be very good. Each has its own pros and cons.
Generally speaking, opencv is more adaptable, while matlab requires a checkerboard to occupy a larger image area. The inclination angle of the checkerboard cannot be too large.
So I don’t know why the mrcal library is bad, so I won’t work on it for the time being.
The reason why it cannot be detected may be related to pixels. After all, the images provided by the author have high resolution. You may be able to take a few larger photos to try later.

Guess you like

Origin blog.csdn.net/onlyyoujojo/article/details/135090611