OpenCV three-dimensional reconstruction (3)-camera parameter matrix


Through the previous camera calibration, we can obtain some parametric models. But what does the parameter matrix of these cameras mean? How can we judge whether it is correct? Where does the error come from? Here we must deepen our understanding through specific experiments. It is difficult to collect pictures with camera parameters. Fortunately, I have a good accumulation before-there are two data sets here, one from the third edition of "OpenCV Computer Vision Programming Guide", there seems to be a micro-single in my home. Acquisition, so that we can cross-check to see if the obtained parameters are in line with the actual situation:

Data set 1 comes from the third edition of "OpenCV Computer Vision Programming Guide"
Insert picture description here

Data set 2 comes from "national bed sheets" in the home
Insert picture description here

Since it is an experiment, I want to make a preliminary plan. The first is to clarify what things I can get? Then compare whether these things are as realistic as the book says? Then I will add some distractions and take a look at how these things change when there is wrong data? The last is a summary.

1. What are the things I can get?

Through the previous code, we are probably ready to get something like this:


<?xml version="1.0"?>

<opencv_storage>

3
3

d 1.3589305122261344e+003 0. 5.7505355544729957e+002 0. 1.3565816672769690e+003 6.0423226535731465e+002 0. 0. 1. 1 14 d 9.5113243912423840e+001 1.4262144540955842e+003 5.2119492051277685e-003 2.8847358900241043484e-003 1.2859720255003 2.8847358900241043484e-003 9.5182218776001392e+001 1.4741397414456521e+003 6.8332022963370434e+002 0. 0. 0. 0. 0. 0. ____________________________________________________________________ From the result, I will get these two matrices. The first one is the camera's internal parameter matrix, and the latter one is the external parameter. Then in a group of pictures, the internal parameters must be unchanged; the external parameters must be changed later. But there are also many questions here.

Insert picture description here

Then look at the results in detail. For the first set of pictures, the results we obtained are:


<?xml version="1.0"?>

<opencv_storage>

3
3

d 4.0927176647992695e+002 0. 2.3724719115090161e+002 0. 4.0870629848642727e+002 1.7128731207874495e+002 0. 0. 1. 1 14 d 1.8631118716959048e+001 -5.0639175384902096e+001 -5.2453807582033300e-003 -9.2620440694993842e-003 5.2367454865598742e+000 1.9002289932447418e+001 -4.8948501055979285e+001 -6.5115263545215851e-001 0. 0. 0. 0. 0. 0. _____________________________________________________________________ <?xml version="1.0"?>

<opencv_storage>

3
3

003 0. -002 2.5694845194956913e-002 4.7826938999253371e-001 -1.3315729771950511e + 000.0.0.0.0.0.0. ______________________________________________________________________

For the second set of pictures:

2. Are these things as realistic as the book says?

For the first set of pictures, look at its internal parameter matrix:


+ 002 4.0927176647992695e + 002 2.3724719115090161e + 002 4.0870629848642727e + 002 1.7128731207874495e + 002 0. 1. ______________________________________________________________________

Analysis, fx = fy = 409; U0=237 V0 = 171, this is the code calculation value. From a practical point of view, the
middle of the standard is 268,178, which is more consistent with 237,171.
Insert picture description here

For other information
Insert picture description here

This focal length is far from what we have calculated. How to compare? Further research to obtain the parameters of this camera:
Insert picture description here

It can be obtained, its sensor size is 23.5mm X 15.7mm, then the pixel width is 0.0438 (=23.5/536) and 0.044 respectively, and the focal length is 17.9, which is relatively close.

The information given in the book must have been chosen by ourselves, so we re-collect a set of pictures ourselves, then its inherent parameters are:
Insert picture description here
Insert picture description hereInsert picture description here

The results obtained:


+ 003 3.9136489375791234e + 003 2.6879080836687035e 3.9811430968074164e + 003 1.9454067884808153e + 003 0. 1. ____________________________________________________________________

Translate, fx = 3913.6 fy=3981.1 U0=2687.9 V0=1945.4 First
look at the UV, 5456/2 = 2728 3632/2=1816, in this case, the gap is 1.5%, the gap looks relatively large, but the relative value is better than the book The data provided in should be small.
As for the focal length, the pixel width is 0.00425 (=23.2/5456) and 0.0386 respectively, and the focal length is
calculated as 16.64 and 16.88. The difference between this and 16 is also more appropriate.

3. Add some interference, how about fault tolerance?

The best way is to re-acquire a set of pictures with a fixed camera. For readers, if they are interested, they can do it.

4. Summary

Through comparison, the following features can be found:
1. The pictures collected on the books have a wider range of angles. Therefore, the collection method in the book is of guiding significance for us to do actual collection later;
2. The size of the chessboard has little to do with whether it can produce good results in the end, so a chessboard of appropriate size is enough; in
addition:
3. Especially for visual field comparison In the wide-ranging situation, it should be prioritized to think of efficient solutions. I think the larger the field of view, the greater the error;
4. The processing of large photos is itself a more complicated problem: because the pixels are relatively high, the processing is slower; and it cannot be pre-processed by methods such as compression. , So there will be more problems. Is there a good solution at present;

In addition, you must also consider the failure of the calibration process; you must also consider what mode can be used to make the calibration effect the best.

Thanks for reading so far, hope it helps.

From Wiz

Current direction: image stitching and fusion, image recognition Contact: [email protected]

Guess you like

Origin blog.csdn.net/m0_51233386/article/details/113487355