Make writing a habit together! This is the 14th day of my participation in the “Gold Digging Day New Plan Β· April More Text Challenge”. Click here for more details.
Chang’s calibration method
π΄ comes first
Before reading this article, IT is recommended that you have a clear understanding of the transformation between four coordinate systems. If you do not know, please refer to my previous post: Camera model and geometric relation derivation + four coordinate transformation
π΄ Detailed explanation of principle
The following formula has been obtained during the transformation of πππ four-system coordinates:
Through the above formula, we can easily get:
Where, M represents the pixel coordinates of the image plane (u, V,1), and M represents the coordinate points of the world coordinate system (Xw,yw, Zw). R,T represents the rotation and translation matrix, S represents the scale factor (for the convenience of operation, the scale factor does not change the coordinate value for homogeneous coordinates), and A represents the internal parameter matrix of the camera. The expressions are as follows:
Ο\tauΟ stands for the scale deviation of the pixel in the x and Y directions.
π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π π
Here is an introduction to the concept of homopic transformation
A homography transformation is a two-dimensional projection transformation that maps a point in one plane to another plane. (Plane refers to the image or three-dimensional plane surface), the corresponding transformation matrix is called the homography matrix.
When carrying out Chang’s calibration, the calibration object we choose is a plane (usually checkerboard), so we can construct the world coordinate system on the plane Z=0. The anaphylaxis was then calculated. Z=0 can be converted into the following form:
These changes are anopic, Then A [r1r2r3T] A \ left [{\ begin {array} {c} {{r_1}} and {{r_2}} and {\ begin {array} {c} {{r_3}} & T \ end {array}} {array}} \ end \right]A[r1r2r3T] is the homography matrix. And H = A = A \ [r1r2T] H left [{\ begin {array} {c} {{r_1}} and {{r_2}} \ & T end {array}} \ right] H = A [r1r2T], there are:
H is a 3 by 3 matrix with 9 elements. But this is a homogeneous coordinate, so H has eight unknowns to solve for.
Is there a question here? Why do we only have eight unknowns? In fact, we talked about this before, which is the invariance of expansion of homogeneous equations. Let’s say it again through this example. Let’s look at the following equation:
Where H is the matrix of 3×3:
Is:
The above formula can be expressed as:
That is:
Write the above in the form AH=0:
Let’s look at this equation again:
Is:
It can be found that the homography matrix H and aH are exactly the same, that is, the point (X, Y) is (u, v) regardless of whether it is mapped by H or aH. When we take, then we have:
You can see that H has only eight unknowns to solve for.
We know that H has eight unknowns, so to solve for those eight unknowns, we need eight equations. From the above analysis, we can obtain two equations by a set of corresponding (x,y)-(u,v). Where (x,y), as the coordinate of the calibration object, can be controlled by the designer artificially and is a known quantity. (u,v) are pixel coordinates that we can get directly from the camera. So in this case, to solve for eight unknowns, we need four corresponding points, which means that if we give four sets of points, we can calculate the homography matrix H from the image plane to the world plane. This is one of the reasons why the checkerboard with four corners is used as the calibration object.
Well, from the above analysis, we can obtain the homography matrix H from four sets of points. Our ultimate goal is to require both external and internal reference. But, H = A = A \ [r1r2T] H left [{\ begin {array} {c} {{r_1}} and {{r_2}} \ & T end {array}} \ right] H = A [r1r2T] is A combination of internal matrix and the matrix. So this requires us to do something, to figure out the internal parameters, and then we can figure out the external parameters. The specific steps are as follows:
First put H rewrite into three column form, or H = H = \ [h1h2h3] left [{\ begin {array} {c} {{h_1}} and {{h_2}} and {{h_3}} \ end {array}} \ right] H = [h1h2h3]; Let’s look at the following formula:
There are two constraint conditions in the above equation, respectively:
The above two constraints are properties of rotation matrices.
According to formula 1, we can get:
Now we focus on Formula 3 and 4. It can be found from these two formulas that H1 and H2 are the quantities that can be obtained from the homography matrix in the previous step, so the unknowns are concentrated in matrix A, where A is the internal parameter matrix, and there are five parameters, respectively: 1 dx, dy, tau, u0, where v0 \ frac {1}, {{{d_x}}} \ frac {1}, {{{d_y}}} \ tau, {u_0}, {v_0} dx1, dy1, tau, u0, where v0. Now, to solve these five parameters, we need three homography matrices (one matrix can have two sets of equations, and three can produce six equations, thus solving five parameters). Should also can use two single sex matrix, then discard a internal tau \ tau tau, i.e. let tau = 0 \ tau tau = 0 = 0] can now think about it, how can we get three different single matrix should be sex? In fact, we can achieve this by taking three pictures of the calibration plane, of course, we need to change the relative position between the camera and the calibration plate for these three pictures, so that we can obtain different homography matrices. This explains why chang calibration method needs to obtain calibration plate pictures of different shooting angles.
I think I’ve described the process of solving the camera’s internal parameters very well, but what follows is some mathematical changes to the formula above, with no physical implications.
First of all the other:
It can be seen that the BT = (A – TA – 1) T = A – TA – 1 = B ^ T {B} = {({A ^ {T} -} {A ^ {1}}) ^ T} = {A ^ {T} -} {A ^ {1}} = BBT = (A – TA – 1) T = A – TA – 1 = B, BB is a symmetric matrix, so there are only six valid elements of B left (because three pairs of symmetric elements are equal, so you can complete B by solving for the following six elements), and let these six elements form vector B.
Coming up:
Among them,
Combining formula 3, 4 and 5, it can be obtained:
Further written as a matrix:
Formula 6 is the same as formula 3 and 4.
Through a series of operations above, we can calculate the camera’s internal parameter matrix. For the external parameter matrix, we can easily solve it through the following matrix:
To:
At this point, we have the internal and external parameters of the camera.
π΄ finally chatter
This part of the content actually wrote for a long time, but because it is word editing and contains a lot of formulas, on the blog will be garbled, so there is no finishing, the adjusted slightly, but most of the formulas is pictures, so you don’t know will not affect the look and feel of the, if you want to formula is not the picture, you can leave a message for π π π
At this point, we have the internal and external parameters of the camera.