After the internal reference camera image scaling change

After the internal reference camera image scaling change

1. Problem Description

When the collected images related 3D coordinate calculation, need to use the camera internal reference information, but how to change internal control camera after the image is scaled it?

In conclusion the most books give only (assuming halving):
\ [F_X '= \ FRAC} {2} {F_X, f_y' = \ FRAC} {2} {f_y, c_x '= \ FRAC} {c_x {2}, c_y '= \ frac {c_y} {2} \]

2. mathematical derivation

The following function to 3D spatial point \ (P \) projected to pixel coordinates: \ [(X, Y, Z,. 1) \ rightarrow (U, V, S) \]
\ [\ the begin {pmatrix} a_x & 0 & u_0 \\ 0 & a_y & v_0 \\ 0 & 0 & 1 \ end {pmatrix} \ begin {pmatrix} R_ {11} & R_ {12} & R_ {13} & T_x \\ R_ {21} & R_ {22} & R_ {23} & T_y \\ R_ {31} & R_ {32} & R_ {33} & T_z \\ \ end {pmatrix} \ begin {pmatrix} x \\ y \\ z \\ 1 \ end {pmatrix} \]

After, \ [(U, V, S) \ rightarrow (U / S, V / S,. 1) \] to obtain inhomogeneous coordinates of the pixel.

It may be abbreviated as:
\ [U = \ P FRAC m_1} {} {M_3 \\ V = P \ P M_2 FRAC {} {} M_3 P \]
wherein \ (m_i \) of \ (K [R | T] _ {3 \ times4} \) of the projection matrix configuration \ (I \) row, after performing a resize:
\ [U '= \ FRAC} {2} {\\ U V' = \ {2} V {FRAC } \]
Thus:
\ [U '= (1/2) \ P FRAC m_1} {} {M_3 P \\ V' = (1/2) \ P M_2 FRAC {} {} M_3 P \]
converted back to the original the projection equations:
\ [\ left (\ Array the begin {} {} CCC & 0 0 0.5 & 0.5 & & \\ 0 0 \\ 0 & 0. 1 & \ Array End {} \ right) \ left (\ the begin { array} {ccc} a_x & 0 & u_0 \\ 0 & a_y & v_0 \\ 0 & 0 & 1 \ end {array} \ right) \ left (\ begin {array} {ccc} R_ {11} & R_ { 12} & R_ {13} &
T_x \\ R_ {21} & R_ {22} & R_ {23} & T_y \\ R_ {31} & R_ {32} & R_ {33} &T_z \\ \ end {array} \ right) \ left (\ begin {array} {ccc} x \\ y \\ z \\ 1 \ end {array} \ right) \] with the following equivalent form:
\[ \left( \begin{array}{ccc} 0.5 a_x & 0 & 0.5 u_0 \\ 0 & 0.5 a_y & 0.5 v_0 \\ 0 & 0 & 1 \end{array} \right) \left( \begin{array}{ccc} R_{11} & R_{12} & R_{13} & T_x \\ R_{21} & R_{22} & R_{23} & T_y \\ R_{31} & R_{32} & R_{33} & T_z \\ \end{array} \right) \left( \begin{array}{ccc} x \\ y \\ z \\ 1 \end{array} \right) \]

If you are using Matlab similar index starting at 1, and need to use: \ (U '= (U-1) / 2 + 1, V' = (V-1) / 2 + 1 \) replacement, and re-derived

3. For 0.5pixelthe issue of treatment

Also need to be treated:
\ [U '= (U-0.5) /2+0.5 \\ V' = (V-0.5) /2+0.5 \]
can then be obtained (assuming scaled \ (S \) ):
\ [\ begin {pmatrix} sf_x &
0 & sc_x + 0.5s-0.5 \\ 0 & sf_y & sc_y + 0.5s-0.5 \\ 0 & 0 & 1 \ end {pmatrix} \] Accordingly, a corresponding change in internal reference is:
\ [\ begin {aligned} f_x '& = s * f_x \\ f_y' & = s * f_y \\ c_x '& = s * c_x + 0.5s-0.5 \\ c_y' & = s * c_y + 0.5s- 0.5 \ end {aligned} \]

4. References

Guess you like

Origin www.cnblogs.com/jymg/p/11693587.html