Apriltag location and identification

 

 1. Apriltag positioning and identification - Zhihu (zhihu.com)

 

2. Basics of Computer Vision - Camera Calibration - Zhihu (zhihu.com) 

 For fisheye lens distortion correction, please refer to:

三、sFisheye Calibration Basics - MATLAB & Simulink (mathworks.com)

 

 

 V is a known quantity determined only by the homography matrix, and the vector b and matrix B can be obtained by solving the above linear equation. Vector b contains 6 unknowns, V is a 2n x 6 matrix, and n represents the number of homography matrices (or the number of images), so at least three images at different positions or angles need to be collected to solve the above equation. In practice, in order to reduce errors, 15-20 images will be collected.

Regarding the solution of the form of Ax = 0, the proof can refer to the article, thank you for taking it away.

https://www.cnblogs.com/BellaVita/p/10003528.html

Now that the B matrix has been calculated, the next thing is easy, just edit the program according to the formula. The relationship between camera intrinsic parameters A and B matrices (according to formula 2-8) is derived as follows

2.3 Optimization

Some people may think that this is the end, and the internal and external parameters have been calculated. Don't forget that there is still a lens distortion coefficient that has not been processed. Then how to calculate this, assuming that there is no distortion at the beginning, and the distortion coefficients are all 0. When there is no distortion, the internal and external parameters are the closed-loop solutions obtained in Section 2.2. Isn't this just giving you the initial value, and then xxxx, yes, it's optimization.

Regarding optimization, objective functions, constraints, optimization methods, and optimization variables are required. In camera calibration, the objective function is to minimize the reprojection error, that is, project the spatial coordinates onto the image according to the estimated projection equation, and obtain the pixel estimated value, so that the value between the value and the actual observed value (for example: checkerboard corner coordinates) The error is the smallest. Does this feel very familiar, students who are doing visual slam, think about BA, hehe.

Objective function:

Initial value of optimization variable: closed-loop solution, distortion coefficient is initially 0

Optimization method: LM

The mathematical knowledge involved in this section is more and more difficult to understand. For students who need in-depth study, recommend good information, thank you for taking it away, please google it yourself.

On chained differential: advanced mathematics, any textbook

Regarding nonlinear optimization: DTU: Methods for non-linear least squares problems, it is recommended to read the entire set of documents, starting from the steepest descent, Newton's method, and then look at LM.

On Lie algebra and matrix derivation: Time Derivative of Rotation Matrices

About camera calibration non-linear optimization opencv source code: calibration.cpp

 

3 results

1. Matlab has a ready-made calibration interface, which is very cool

Figure 8 Matlab calibration interface

2. Opencv has a very good checkerboard detection effect. If you want to improve the accuracy, please refer to the articles on corner point optimization and sub-pixel accuracy.

Figure 9 Schematic diagram of checkerboard corner detection

Guess you like

Origin blog.csdn.net/weixin_45834800/article/details/127057463