Projective Geometry

From McCwiki
Jump to: navigation, search

This is a compilation of what I've learned about photogrammetry/projective geometry.

Methods from "Passive 3D Photography"[1]

<math>W = MS + t</math>, where:

W is a 2f×n matrix of reference points
which are themselves 2×1 matrices of image pixel coordinates (u,v).
M is a 2f×3 projection matrix describing the transform from 2D to 3D coordinates
S is a 3×n collection of scene coordinates
which are themselves 3×1 matrices of spatial coordinates (x,y,z).
t is the a 2×1 image offset matrix
f is the number of images to be used
n is the number of reference points

If the scene origin is the centroid of 3D points and the image origin is the centroid of 2D points, then t may be dropped. Thus:

<math>\Large{}\left[\begin{matrix} u_1^1 & u_2^1 & \cdots & u_n^1 \\ u_1^2 & u_2^2 & \cdots & u_n^2 \\ \vdots & \vdots & \ddots & \vdots \\ u_1^f & u_2^f & \cdots & u_n^f\end{matrix}\right] = \left[\begin{matrix}m^1 \\ m^2 \\ \vdots \\ m^f\end{matrix}\right]\times{}\left[\begin{matrix}X_1 & X_2 & \cdots & X_n\end{matrix}\right]</math>

Question: How do you solve M?

Methods from "Camera Calibration...Scenes"[2]

Perspective projection from 3-space (i.e. x,y,z) to a flat image can be represented by a 3×4 projection matrix P:

<math>\Large{}\lambda{}_i\left[\begin{matrix}u_i\\

v_i\\ 1\end{matrix}\right] = \left[\begin{matrix}p_{11} & p_{12} & p_{13} & p_{14}\\ p_{21} & p_{22} & p_{23} & p_{24}\\ p_{31} & p_{32} & p_{33} & p_{34}\end{matrix}\right]\left[\begin{matrix}X_i\\ Y_i\\ Z_i\\

1\end{matrix}\right]</math>
(1)

The projection matrix is the matrix composed of pcr points.

This can be decomposed into the orientation/position of the camera relative to the world coordinates:

<math>\Large{}P = K\left[R\ T\right]</math> (2)
R is a 3×3 rotation matrix
T is a 3×1 translation matrix
K is a 3×3 camera calibration matrix
<math>K = \left[\begin{matrix}a_u & s & u_0\\

0 & a_v & v_0\\

0 & 0 & 1\end{matrix}\right]</math>
(3)
au and av are scale factors; can usually assume 1 (aspect ratio of 1:1)
s is a skew parameter; can assume 0 if image has been deskewed
u0,v0 are the pixel coordinates of the principal point (intersection of optical axis with image plane)

Vanishing Points

The vanishing points correspond to 3D "infinity" for a given axis. They can be computed by calculating the intersection of presupposed parallel lines in a scene, which converge in an image. Since we have three axes to deal with, we will expand our left-hand image matrix and right-hand spatial matrix to account for these three different coordinates.

Thus:

<math>\Large{}\left[\begin{matrix}\lambda_1u_1 & \lambda_2u_2 & \lambda_3u_3\\

\lambda_1v_1 & \lambda_2v_2 & \lambda_3v_3\\ \lambda_1 & \lambda_2 & \lambda_3\end{matrix}\right] = P\left[\begin{matrix}1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\\

0 & 0 & 0\end{matrix}\right]</math>
(4)

λi represent scaling factors that are initially unknown. The spatial matrix by which P is multiplied represents the infinite nature (each column represents a different coordinate axis: 1, 2, 3) of a given vanishing point.

This equation can be rearranged and expressed in terms of K and R. P is a 3×4 matrix, but our spatial coordinate matrix is 4×3, which implies that the resulting matrix from their multiplication will also be 3×3. Because the spatial matrix is almost the identity matrix, the final column of P drops out entirely. K and R are both 3×3 matrices, thus they yield a 3×3 matrix.

<math>\Large{}\left[\begin{matrix}u_1 & u_2 & u_3\\

v_1 & v_2 & v_3\\ 1 & 1 & 1\end{matrix}\right]\left[\begin{matrix}\lambda_1 & 0 & 0\\ 0 & \lambda_2 & 0\\

0 & 0 & \lambda_3\end{matrix}\right] = KR</math>
(5)

Assuming no skew and square aspect ratio, (5) can be re-written thus:

<math>\Large{}\left[\begin{matrix}\lambda_1u_1 & \lambda_2u_2 & \lambda_3u_3\\

\lambda_1v_1 & \lambda_2v_2 & \lambda_3v_3\\ \lambda_1 & \lambda_2 & \lambda_3\end{matrix}\right] = \left[\begin{matrix}1 & 0 & u_0\\ 0 & 1 & v_0\\

0 & 0 & 1\end{matrix}\right]R</math>
(8)

It then follows that:

<math>\Large{}R = \left[\begin{matrix}\lambda_1\left(u_1-u_0\right) & \lambda_2\left(u_2-u_0\right) & \lambda_3\left(u_3-u_0\right)\\

\lambda_1\left(v_1-v_0\right) & \lambda_2\left(v_2-v_0\right) & \lambda_3\left(v_3-v_0\right)\\

\lambda_1 & \lambda_2 & \lambda_3\end{matrix}\right]</math>
(9)

Determining the Principle Point

The paper says that "the orthonormality of R can be used to recover u0 and v0 as well as solving for λi and α. Writing <math>\chi_i = \left(\begin{matrix}u_i\\ v_i\end{matrix}\right)</math> and using the orthogonality of the first two columns of R gives:"

<math>\lambda_1\lambda_2\left(\left(\chi_1-\chi_0\right)\times{}\left(\chi_2-\chi_0\right)+1\right)=0</math> (10)

Since λi is a scaling factor and thus cannot be 0, it can be eliminated and re-written:

<math>\left(\chi_1-\chi_0\right)\times{}\left(\chi_2-\chi_0\right)+1=0</math> (11)

As can the other column pairs of R:

<math>\left(\chi_2-\chi_0\right)\times{}\left(\chi_3-\chi_0\right)+1=0</math> (12)
<math>\left(\chi_1-\chi_0\right)\times{}\left(\chi_3-\chi_0\right)+1=0</math> (13)

It's worth noting at this juncture that the reason this is all true is because of the orthogonal nature of the three independent axes. When one finds the dot product of orthogonal vectors, that product is always zero. That's the key piece of how this starts to fit together.

Subtracting (13) and (11), we get:

<math>\begin{align}\left(\chi_1-\chi_0\right)\cdot\left(\chi_2-\chi_0\right)-\left(\chi_1-\chi_0\right)\cdot\left(\chi_3-\chi_0\right) &= 0\\ \left(\chi_1-\chi_0\right)\cdot\left(\chi_2-\chi_3\right) &= 0\end{align}</math>

It now behooves us to break out of our substitute notation and return to matrices. Bear in mind that we are assume at this juncture that <math>\left(u_1,v_1\right)</math>, <math>\left(u_2,v_2\right)</math>, <math>\left(u_3,v_3\right)</math> are known values, derived from measurements of the source image. Note that a·b = aTb, with T indicating matrix transposition.

<math>\begin{align}\left(\left[\begin{matrix}u_1\\ v_1\end{matrix}\right] - \left[\begin{matrix}u_0\\ v_0\end{matrix}\right]\right)\cdot\left(\left[\begin{matrix}u_2\\ v_2\end{matrix}\right]-\left[\begin{matrix}u_3\\ v_3\end{matrix}\right]\right) &= 0\\ \left(\left[\begin{matrix}u_1-u_0\\ v_1-v_0\end{matrix}\right]\right)\cdot\left(\left[\begin{matrix}u_2-u_3\\ v_2-v_3\end{matrix}\right]\right) &= 0\\ \left(\left[\begin{matrix}\left(u_1-u_0\right) & \left(v_1-v_0\right)\end{matrix}\right]\right)\cdot\left(\left[\begin{matrix}u_2-u_3\\ v_2-v_3\end{matrix}\right]\right) &= 0\\ \left(u_1-u_0\right)\left(u_2-u_3\right)+\left(v_1-v_0\right)\left(v_2-v_3\right) &= 0\\ \left(v_1-v_0\right)\left(v_2-v_3\right) &= \left(u_0-u_1\right)\left(u_3-u_2\right)\\ \left(v_1-v_0\right) &= \frac{\left(u_0-u_1\right)\left(u_3-u_2\right)}{\left(v_2-v_3\right)}\\ v_0 &= -\frac{\left(u_0-u_1\right)\left(u_3-u_2\right)}{\left(v_2-v_3\right)}+v_1\\ \end{align}</math>

The paper mentions "χ0 is the orthocentre of χ1, χ2, χ3." The orthocenter of a triangle is the point at which altitudes dropped from its three corners intersect. We have the image coordinates of these three corners.

<math>A = \left(u_1,v_1\right),\ B = \left(u_3,v_3\right),\ C = \left(u_2,v_2\right)\\ \bar{AB}:\\ v_3 - v_1 = m(u_3 - u_1)\\ m = \frac{v_3-v_1}{u_3-u_1}\\ v = \frac{v_3-v_1}{u_3-u_1}u+\left(v_1-\frac{v_3-v_1}{u_3-u_1}u_1\right)\\ \\ \bar{BC}:\\ v_3 - v_2 = m(u_3 - u_2)\\ m = \frac{v_3-v_2}{u_3-u_2}\\ v = \frac{v_3-v_2}{u_3-u_2}u+\left(v_2-\frac{v_3-v_2}{u_3-u_2}u_2\right)\\ \\ \bar{AC}:\\ v_1 - v_2 = m(u_1 - u_2)\\ m = \frac{v_1-v_2}{u_1-u_2}\\ v = \frac{v_1-v_2}{u_1-u_2}u+\left(v_2-\frac{v_1-v_2}{u_1-u_2}u_2\right)\\ </math>

We know that A is along <math>\perp{}BC</math>, B is along <math>\perp{}AC</math>, and C is along <math>\perp{}AB</math>. Pependicular lines have slopes that multiply together to equal -1. Thus, the slope for the line containing A must be equal to <math>-\left(\frac{v_3-v_2}{u_3-u_2}\right)^{-1}</math>, the slope of the line containing B must be equal to <math>-\left(\frac{v_1-v_2}{u_1-u_2}\right)^{-1}</math>, and the slope of the line containing C must be equal to <math>-\left(\frac{v_3-v_1}{u_3-u_1}\right)^{-1}</math>.

It thus becomes a simple matter to write equations for each of these lines.

<math>\begin{align} \perp{}\bar{BC}&: v-v_1 &= -\left(\frac{v_3-v_2}{u_3-u_2}\right)^{-1}\left(u-u_1\right)\\ \perp{}\bar{AC}&: v-v_3 &= -\left(\frac{v_1-v_2}{u_1-u_2}\right)^{-1}\left(u-u_3\right)\\ \perp{}\bar{AB}&: v-v_2 &= -\left(\frac{v_3-v_1}{u_3-u_1}\right)^{-1}\left(u-u_2\right) \end{align}</math>

These should solve to intersect at the same spot. This is the coordinate of u0, v0.

Methods from "Lecture 9"[3]

Time to tie everything together. There are essentially three coordinate systems in play:

  • World coordinates, which represent the "absolute" position of a point
  • Image coordinates, which represent the camera-transformed position of a point (i.e. distorted projection position)
  • Picture coordinates, which represent the coordinates of the point in the captured image (i.e. pixel position)

Central Projection

"If world and image points are represented by homogeneous vectors, central projection is a linear transformation."
<math>\Large\left[\begin{matrix} u\\ v\\ w\\ \end{matrix}\right] = \left[\begin{matrix} f & 0 & 0 & 0\\ 0 & f & 0 & 0\\ 0 & 0 & 1 & 0\\ \end{matrix}\right] \left[\begin{matrix} x_s\\ y_s\\ z_s\\ 1 \end{matrix}\right]\\ x_i = f\frac{x_s}{z_s} = \frac{u}{w}\\ y_i = f\frac{y_s}{z_s} = \frac{v}{w}\\ </math>

f is the focal length (distance from camera "source" to image plane).

To convert from real lengths to pixels:
<math>\LARGE\left[\begin{matrix} u^\prime\\ v^\prime\\ w^\prime\\ \end{matrix}\right] = \underbrace{\left[\begin{matrix} \alpha_x & s & x_0 & 0\\ 0 & \alpha_y & y_0 & 0\\ 0 & 0 & 1 & 0\\ \end{matrix}\right]}_{K\left[I_3 | O_3\right]} \left[\begin{matrix} x_s\\ y_s\\ z_s\\ 1 \end{matrix}\right]\\ \large \alpha_x = fk_x\\ \alpha_y = -fk_y\\ x_{px} = \frac{u^\prime}{w^\prime}\\ y_{px} = \frac{v^\prime}{w^\prime}</math>

x0, y0 is the image center, kx, ky are scaling factors (from one scale to the other), s is a skew factor (ideally 0?).

Camera Coordinates to World Coordinates

Camera C images world point M ([Xs,Ys,Zs] in world coordinates and [xs,ys,zs] in image coordinates) at image point i [xi,yi,f]. The world has origin O.

  • CO = translation vector T (camera position to world origin)
  • CM = CO + OM
  • I, J, K are the X,Y,Z vectors (ideally 1,1,1)
  • i,j,k are the x,y,z vectors

<math>x_si + y_sj +z_sk = T_xi + T_yj T_zk + X_sI + Y_sJ + Z_sK\\ x_s = T_x + X_sI\cdot{}i + Y_sJ\cdot{}i + Z_sK\cdot{}i\\ \begin{align}\LARGE \left[\begin{matrix} x_s\\ y_s\\ z_s \end{matrix}\right] &= \left[\begin{matrix} T_x\\ T_y\\ T_z \end{matrix}\right] + \left[\begin{matrix} I\cdot{}i & J\cdot{}i & K\cdot{}i\\ I\cdot{}j & J\cdot{}j & K\cdot{}j\\ I\cdot{}k & J\cdot{}k & K\cdot{}k \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s \end{matrix}\right]\\

&= \left[\begin{matrix} I\cdot{}i & J\cdot{}i & K\cdot{}i & T_x\\ I\cdot{}j & J\cdot{}j & K\cdot{}j & T_y\\ I\cdot{}k & J\cdot{}k & K\cdot{}k & T_z\\ 0 & 0 & 0 & 1 \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s \end{matrix}\right]\\

&= \left[\begin{matrix} R & T\\ 0_3^T & 1 \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s \end{matrix}\right] \end{align} </math>

  • CM = OM - OC (i.e. position of M in camera coordinates is position of M in world coordinates minus position of camera in world coordinates)

<math> x_si + y_sj z_sk = \left(X_s - Y_{cam}\right)I + \left(Y_s - Y_{cam}\right)J + \left(Z_s - Z_{cam}\right)K\\ x_s = \left(X_s - X_{cam}\right)I\cdot{}i + \left(Y_s - Y_{cam}\right)J\cdot{}i + \left(Z_s - Z_{cam}\right)K\cdot{}i\\ T = -R\tilde{C} </math>

  • <math>\tilde{C}</math> is OC (in world coordinates).

<math>\left[\begin{matrix} R & -R\tilde{C}\\ 0_3^T & 1 \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s \end{matrix}\right]</math>

Projection and Camera Matrices Combined

<math>\LARGE\begin{align} \left[\begin{matrix} u^\prime\\ v^\prime\\ w^\prime\\ \end{matrix}\right] &= K\left[I_3 | 0_3\right] \left[\begin{matrix} R & -R\tilde{C}\\ 0_3^T & 1 \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s \end{matrix}\right]\\

&= KR\left[I_3|-\tilde{C}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s \end{matrix}\right] \end{align}</math>

Fully Expanded Equation

Assuming world coordinate vectors I,J,K correspond to [1,0,0], [0,1,0], and [0,0,1].

<math>\LARGE\begin{align} \left[\begin{matrix} u^\prime\\ v^\prime\\ w^\prime\\ \end{matrix}\right] &= KR\left[I_3|-\tilde{C}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s\\ 1 \end{matrix}\right]\\

&= \left[\begin{matrix} \alpha_x & 0 & x_0\\ 0 & \alpha_y & y_0\\ 0 & 0 & 1 \end{matrix}\right] \left[\begin{matrix} I\cdot{}i & J\cdot{}i & K\cdot{}i\\ I\cdot{}j & J\cdot{}j & K\cdot{}j\\ I\cdot{}k & J\cdot{}k & K\cdot{}k \end{matrix}\right] \left[\begin{matrix} 1 & 0 & 0 & -X_c\\ 0 & 1 & 0 & -Y_c\\ 0 & 0 & 1 & -Z_c \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s\\ 1 \end{matrix}\right]\\

&= \left[\begin{matrix} \alpha_x & 0 & x_0\\ 0 & \alpha_y & y_0\\ 0 & 0 & 1 \end{matrix}\right] \left[\begin{matrix} I_xi_x & J_yi_y & K_zi_z\\ I_xj_x & J_yj_y & K_zj_z\\ I_xk_x & J_yk_y & K_zk_z \end{matrix}\right] \left[\begin{matrix} 1 & 0 & 0 & -X_c\\ 0 & 1 & 0 & -Y_c\\ 0 & 0 & 1 & -Z_c \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s\\ 1 \end{matrix}\right]\\

&= \left[\begin{matrix} \left(\alpha_xi_x + x_0k_x\right) & \left(\alpha_xi_y + x_0k_y\right) & \left(\alpha_xi_z + x_0k_z\right)\\ \left(\alpha_yj_x + y_0k_x\right) & \left(\alpha_yj_y + y_0k_y\right) & \left(\alpha_yj_z + y_0k_z\right)\\ k_x & k_y & k_z \end{matrix}\right] \left[\begin{matrix} 1 & 0 & 0 & -X_c\\ 0 & 1 & 0 & -Y_c\\ 0 & 0 & 1 & -Z_c \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s\\ 1 \end{matrix}\right]\\


&= \left[\begin{matrix} \left(\alpha_xi_x+x_0k_x\right) & \left(\alpha_xi_y+x_0k_y\right) & \left(\alpha_xi_z + x_0k_z\right) & \left(-X_c\left(\alpha_xi_x + x_0k_x\right) - Y_c\left(\alpha_xi_y + x_0k_y\right) - Z_c\left(\alpha_xi_z + x_0k_z\right)\right)\\

\left(\alpha_yj_x+y_0k_x\right) & \left(\alpha_yj_y+y_0k_y\right) & \left(\alpha_yj_z + y_0k_z\right) & \left(-X_c\left(\alpha_yj_x + y_0k_x\right) - Y_c\left(\alpha_yj_y + y_0k_y\right) - Z_c\left(\alpha_yj_z + y_0k_z\right)\right)\\

\left(k_x\right) & \left(k_y\right) & \left(k_z\right) & \left(-X_ck_x - Y_ck_y - Z_ck_z\right) \end{matrix}\right] \left[\begin{matrix} X_s\\ Y_s\\ Z_s\\ 1 \end{matrix}\right]\\

&= \left[\begin{matrix} X_s\left(\alpha_xi_x+x_0k_x\right) + Y_s\left(\alpha_xi_y+x_0k_y\right) + Z_s\left(\alpha_xi_z + x_0k_z\right) + \left(-X_c\left(\alpha_xi_x + x_0k_x\right) - Y_c\left(\alpha_xi_y + x_0k_y\right) - Z_c\left(\alpha_xi_z + x_0k_z\right)\right)\\

X_s\left(\alpha_yj_x+y_0k_x\right) + Y_s\left(\alpha_yj_y+y_0k_y\right) + Z_s\left(\alpha_yj_z + y_0k_z\right) + \left(-X_c\left(\alpha_yj_x + y_0k_x\right) - Y_c\left(\alpha_yj_y + y_0k_y\right) - Z_c\left(\alpha_yj_z + y_0k_z\right)\right)\\

X_s\left(k_x\right) + Y_s\left(k_y\right) + Z_s\left(k_z\right) + \left(-X_ck_x - Y_ck_y - Z_ck_z\right) \end{matrix}\right]\\

u^\prime &= \left(\alpha_xi_x+x_0k_x\right)\left(X_s-X_c\right) + \left(\alpha_xi_y + x_0k_y\right)\left(Y_s - Y_c\right) + \left(\alpha_xi_z+x_0k_z\right)\left(Z_s-Z_c\right)\\ v^\prime &= \left(\alpha_yj_x+y_0k_x\right)\left(X_s-X_c\right) + \left(\alpha_yj_y+y_0k_y\right)\left(Y_s-Y_c\right) + \left(\alpha_yj_z + y_0k_z\right)\left(Z_s-Z_c\right)\\ w^\prime &= k_x\left(X_s-X_c\right) + k_y\left(Y_s-Y_c\right) + k_z\left(Z_s-Z_c\right) \end{align}</math>


Towards a Solution

Finally, including what we know about u' and v', we can finally say (with scaling factors kx,ky represented as Lx,Ly to avoid confusion with vector k):

<math>\LARGE\begin{align} x_{pix} &= \frac{\left(fL_xi_x+x_0k_x\right)\left(X_s-X_c\right) + \left(fL_xi_y + x_0k_y\right)\left(Y_s - Y_c\right) + \left(fL_xi_z+x_0k_z\right)\left(Z_s-Z_c\right)}{k_x\left(X_s-X_c\right) + k_y\left(Y_s-Y_c\right) + k_z\left(Z_s-Z_c\right)}\\ y_{pix} &= \frac{\left(-fL_yj_x+y_0k_x\right)\left(X_s-X_c\right) + \left(-fL_yj_y+y_0k_y\right)\left(Y_s-Y_c\right) + \left(-fL_yj_z + y_0k_z\right)\left(Z_s-Z_c\right)}{k_x\left(X_s-X_c\right) + k_y\left(Y_s-Y_c\right) + k_z\left(Z_s-Z_c\right)}\\ \end{align}</math>

For all points in the same image:

  • f, L, i, j, k, [x0, y0], [Xc,Yc,Zc] are invariant
  • [Xs,Ys,Zs] vary per-point

For corresponding points in different images:

  • [Xs,Ys,Zs] are invariant
  • f, L, i, j, k, [x0, y0], [Xc,Yc,Zc] vary per image

Computing P

<math>x_i = PX_i</math>, where <math>x_i = \left[\begin{matrix}u^\prime_i & v^\prime_i & w^\prime_i\end{matrix}\right]^T</math>, P is the projection matrix, and <math>X_i = \left[\begin{matrix}X_s_i & Y_s_i & Z_s_i & 1\end{matrix}\right]^T</math>.

<math>x_i</math> and <math>X_i</math> are proportional, so <math>x_i \times{} PX_i = 0</math>[4]

Let <math>P = \left[\begin{matrix}p_1\\ p_2\\ p_3\end{matrix}\right]</math>. We see that <math>PX_i = \left[\begin{matrix}p_1X_i\\ p_2X_i\\ p_3X_i\end{matrix}\right]</math> and <math>x\times{}PX_i = \left[\begin{matrix} v^\prime_ip_3X_i-w^\prime_ip_2X_i\\ w^\prime_ip_1X_i-u^\prime_ip_3X_i\\ u^\prime_ip_2X_i-v^\prime_ip_1X_i \end{matrix}\right]</math>. This is true because <math>\mathbf{a} \times \mathbf{b} = [\mathbf{a}]_{\times} \mathbf{b} = \begin{bmatrix}\,0&\!-a_3&\,\,a_2\\ \,\,a_3&0&\!-a_1\\-a_2&\,\,a_1&\,0\end{bmatrix}\begin{bmatrix}b_1\\b_2\\b_3\end{bmatrix}</math>

This implies <math>\left[\begin{matrix} 0^T_4 & -w^\prime_iX_i & v^\prime_iX_i\\ w^\prime_iX_i & 0^T_4 & -u^\prime_iX_i\\ -v^\prime_iX_i & u^\prime_iX_i & 0^T_R \end{matrix}\right]\left[\begin{matrix} p_1\\ p_2\\ p_3 \end{matrix}\right] = 0</math>, with <math>\left[\begin{matrix} p_1\\ p_2\\ p_3 \end{matrix}\right]</math> being a 12×1 vector. Here's the full version:

<math>\underbrace{\left[\begin{matrix} 0 & 0 & 0 & 0 & -w^\prime_iX_s_i & -w^\prime_iY_s_i & -w^\prime_iZ_s_i & -w^\prime_i1 & v^\prime_iX_s_i & v^\prime_iY_s_i & v^\prime_iZ_s_i & v^\prime_i1\\ w^\prime_iX_s_i & w^\prime_iY_s_i & w^\prime_iZ_s_i & w^\prime_i1 & 0 & 0 & 0 & 0 & -u^\prime_iX_s_i & -u^\prime_iY_s_i & -u^\prime_iZ_s_i & -u^\prime_i1\\ -v^\prime_iX_s_i & -v^\prime_iY_s_i & -v^\prime_iZ_s_i & -v^\prime_i1 & u^\prime_iX_s_i & u^\prime_iY_s_i & u^\prime_iZ_s_i & u^\prime_i1 & 0 & 0 & 0 & 0 \end{matrix}\right]}_{3\times{}12} \underbrace{\left[\begin{matrix} p_{11}\\ p_{12}\\ p_{13}\\ p_{14}\\ p_{21}\\ p_{22}\\ p_{23}\\ p_{24}\\ p_{31}\\ p_{32}\\ p_{33}\\ p_{34} \end{matrix}\right]}_{12\times{}1} = 0</math>

<math>\begin{align} \left[\begin{matrix} -p_{21}w^\prime{}_iX_s_i - p_{22}w^\prime{}_iY_s_i - p_{23}w^\prime{}_iZ_s_i - p_{24}w^\prime{}_i + p_{31}v^\prime{}_iX_s_i + p_{32}v^\prime{}_iY_s_i + p_{33}v^\prime{}_iZ_s_i + p{34}v^\prime{}_i\\ p_{11}w^\prime{}_iX_s_i + p_{12}w^\prime{}_iY_s_i + p_{13}w^\prime{}_iZ_s_i + p_{14}w^\prime{}_i - p_{31}u^\prime{}_iX_s_i - p_{32}u^\prime{}_iY_s_i - p_{33}u^\prime{}_iZ_s_i - p_{34}u^\prime{}_i\\ -p_{11}v^\prime{}_iX_s_i - p_{12}v^\prime{}_iY_s_i - p_{13}v^\prime{}_iZ_s_i - p_{14}v^\prime{}_i + p_{21}u^\prime{}_iX_s_i + p_{22}u^\prime{}_iY_s_i + p_{23}u^\prime{}_iZ_s_i + p_{24}u^\prime{}_i \end{matrix}\right] &= \left[\begin{matrix} 0\\ 0\\ 0 \end{matrix}\right]\\ -p_{21}w^\prime{}_iX_s_i - p_{22}w^\prime{}_iY_s_i - p_{23}w^\prime{}_iZ_s_i - p_{24}w^\prime{}_i + p_{31}v^\prime{}_iX_s_i + p_{32}v^\prime{}_iY_s_i + p_{33}v^\prime{}_iZ_s_i + p_{34}v^\prime{}_i &= 0\\ p_{11}w^\prime{}_iX_s_i + p_{12}w^\prime{}_iY_s_i + p_{13}w^\prime{}_iZ_s_i + p_{14}w^\prime{}_i - p_{31}u^\prime{}_iX_s_i - p_{32}u^\prime{}_iY_s_i - p_{33}u^\prime{}_iZ_s_i - p_{34}u^\prime{}_i &= 0\\ -p_{11}v^\prime{}_iX_s_i - p_{12}v^\prime{}_iY_s_i - p_{13}v^\prime{}_iZ_s_i - p_{14}v^\prime{}_i + p_{21}u^\prime{}_iX_s_i + p_{22}u^\prime{}_iY_s_i + p_{23}u^\prime{}_iZ_s_i + p_{24}u^\prime{}_i &= 0 \end{align}</math>

The third row can be obtained by <math>u^\prime{}_i</math> times the first row added to <math>-v^\prime{}_i</math> times the second row. (Can it?)

References

  1. Passive 3D Photography. Seitz, Steven. Carnegie Mellon University. Date unknown.
  2. Camera calibration from vanishing points in images of architectural scenes. R. Cipolla, T. Drummond and D. Robertson. Department of Engineering, University of Cambridge, Cambridge, UK. Date unknown.
  3. Camera Calibration. Duraiswami, Ramani. University of Maryland. Date unknown.
  4. [1]

See Also