Showing posts with label Photogrammetry. Show all posts
Showing posts with label Photogrammetry. Show all posts

Monday, January 27, 2020

Reduced normal matrix for solving fast photogrammetric bundle adjustment

Reduced normatrix for photogrammetric bundle adjustment based on the collinearity equations

Note: There are $m_1$ photos and $m_2$ object points, and the number of EOPs is 6. If 6*$m_1$ is less than 3*$m_2$, solve unknowns related with EOPs. If not, solve object points coordinates, first. This post shows only the first case, 3*$m_2$ > 6*$m_1$.

[Fig. Normal matrix sample]

$$ \begin{pmatrix} N_1 & N_{12} \\ N_{12}^T & N_2 \end{pmatrix}\begin{pmatrix} X_1 \\ X_2 \end{pmatrix} = \begin{pmatrix} C_1 \\ C_2 \end{pmatrix} $$ $$ N_1 X_1 + N_{12} X_2 = C_1$$ $$ N_{12}^T X_1 + N_2 X_2 = C_2$$ In case $6m_1<3m_2$, let's slove $X_1$ first.
$$ X_2 = N_2^{-1} C_2 - N_2^{-1} N_{12}^T X_1$$, therefore
$$ (N_1 - N_{12} N_2^{-1} N_{12}^T) X_1 = C_1 - N_{12} N_2^{-1} C_2$$ $$ X_1 = (N_1 - N_{12} N_2^{-1} N_{12}^T)^{-1}(C_1 - N_{12} N_2^{-1} C_2)$$ And
$$ X_2 = N_2^{-1}(C_2 - N_{12}^T X_1) $$ For $X_2$, we can avoid solving the inverse matrix of $3m \times 3m$ .
For $i_{th}$ point,
$$ X_{2_i} = N_{2_{i}}^{-1}(C_{2_i} - N_{12_i}^T X_1) $$

Sunday, September 15, 2019

Photogrammetric Intersection

Linear Intersection for a Stereo Pair

There are two images.
Object point vs. image point, in the first image:
$$ \begin{pmatrix} X \\ Y \\ Z \end{pmatrix} = \begin{pmatrix} X^0_a \\ Y^0_a \\ Z^0_a \end{pmatrix} + {\lambda_a}{R_a} \begin{pmatrix} x_a \\ y_a \\ -f_a \end{pmatrix} \tag{1} $$
Object point vs. image point, in the second image:
$$ \begin{pmatrix} X \\ Y \\ Z \end{pmatrix} = \begin{pmatrix} X^0_b \\ Y^0_b \\ Z^0_b \end{pmatrix} + {\lambda_b}{R_b} \begin{pmatrix} x_b \\ y_b \\ -f_b \end{pmatrix} \tag{2} $$
Therefore,
$$ \begin{pmatrix} X^0_b \\ Y^0_b \\ Z^0_b \end{pmatrix} - \begin{pmatrix} X^0_a \\ Y^0_a \\ Z^0_a \end{pmatrix} = {\lambda_a}{R_a} \begin{pmatrix} x_a \\ y_a \\ -f_a \end{pmatrix} - {\lambda_b}{R_b} \begin{pmatrix} x_b \\ y_b \\ -f_b \end{pmatrix} \tag{3} $$ $$ \begin{pmatrix} r_{11_a}x_a + r_{12_a}y_a - r_{13_a}f_a & - r_{11_b}x_b - r_{12_b}y_b + r_{13_b}f_b \\ r_{21_a}x_a + r_{22_a}y_a - r_{23_a}f_a & - r_{21_b}x_b - r_{22_b}y_b + r_{23_b}f_b \\ r_{31_a}x_a + r_{32_a}y_a - r_{33_a}f_a & - r_{31_b}x_b - r_{32_b}y_b + r_{33_b}f_b \end{pmatrix} = \begin{pmatrix} X^0_b - X^0_a \\ Y^0_b - Y^0_a \\ Z^0_b - Z^0_a \end{pmatrix} \tag{4} $$
where, $ \begin{pmatrix} X \ Y \ Z \end{pmatrix}^T $ are object coordinates,
$\begin{pmatrix} X^0_a \ Y^0_a \ Z^0_a \end{pmatrix}^T$, $\begin{pmatrix} X^0_b \ Y^0_b \ Z^0_b \end{pmatrix}^T$, $R_a$, and $R_b$ denote positoions and attitudes of two images. $\begin{pmatrix} x_a \ y_a \ -f_a \end{pmatrix}^T$ and $\begin{pmatrix} x_b \ y_b \ -f_b \end{pmatrix}^T$ are photo coordinates of each image. If two images are obtained by a camera, $f_a = f_b$.
In the equation (4), there are two unknowns ($\lambda_a$ and $\lambda_b$) and three linear equations. Once $\lambda_a$ and $\lambda_b$ are determined, we get two sets of object coordinates from two scale factors and can use mean values of them.

General Case: Linear Intersection for Multiple Images

$$ \left. \begin {matrix} \begin{pmatrix} X \\ Y \\ Z \end{pmatrix} - {\lambda_1}{R_1} \begin{pmatrix} x_1 \\ y_1 \\ -f_1 \end{pmatrix} = \begin{pmatrix} X^0_1 \\ Y^0_1 \\ Z^0_1 \end{pmatrix} \\ \begin{pmatrix} X \\ Y \\ Z \end{pmatrix} - {\lambda_2}{R_2} \begin{pmatrix} x_2 \\ y_2 \\ -f_2 \end{pmatrix} = \begin{pmatrix} X^0_2 \\ Y^0_2 \\ Z^0_2 \end{pmatrix} \\ \vdots \\ \begin{pmatrix} X \\ Y \\ Z \end{pmatrix} - {\lambda_n}{R_n} \begin{pmatrix} x_n \\ y_n \\ -f_n \end{pmatrix} = \begin{pmatrix} X^0_n \\ Y^0_n \\ Z^0_n \end{pmatrix} \end {matrix} \right ] \tag{5} $$
Threrefore,
$$ \begin{pmatrix} 1 & 0 & 0 & -r_{11_1}x_1 - r_{12_1}y_1 + r_{13_1}f_1 & \cdots \\ 0 & 1 & 0 & -r_{21_1}x_1 - r_{22_1}y_1 + r_{23_1}f_1 & \cdots \\ 1 & 0 & 1 & -r_{31_1}x_1 - r_{32_1}y_1 + r_{33_1}f_1 & \cdots \\ 1 & 0 & 0 & 0 & -r_{11_2}x_2 - r_{12_1}y_2 + r_{13_2}f_2 & \cdots \\ 0 & 1 & 0 & 0 & -r_{21_2}x_2 - r_{22_2}y_2 + r_{23_2}f_2 & \cdots \\ 0 & 0 & 1 & 0 & -r_{31_2}x_2 - r_{32_2}y_2 + r_{33_2}f_2 & \cdots \\ \vdots \\ 1 & 0 & 0 & 0 & 0 & \cdots & -r_{11_n}x_n - r_{12_n}y_n + r_{13_n}f_n \\ 0 & 1 & 0 & 0 & 0 & \cdots & -r_{21_n}x_n - r_{22_n}y_n + r_{23_n}f_n \\ 0 & 0 & 1 & 0 & 0 & \cdots & -r_{31_n}x_n - r_{32_n}y_n + r_{33_n}f_n \end{pmatrix} \begin{pmatrix} X \\ Y \\ Z \\ \lambda_1 \\ \lambda_2 \\ \vdots \\ \lambda_n \end{pmatrix} = \begin{pmatrix} X^0_1 \\ Y^0_1 \\ Z^0_1 \\ X^0_2 \\ Y^0_2 \\ Z^0_2 \\ \lambda_2 \\ \vdots \\ X^0_n \\ Y^0_n \\ Z^0_n \end{pmatrix} \tag{6} $$
In the equation (6), there are $(3+n)$ unknowns ($\begin{pmatrix}X&Y&Z\end{pmatrix}^T$, and $3n$ equations. If there are 2 or more than 2 images, there should be redundancy.

Friday, May 18, 2012

Derivation of direct linear transformation for a line scanner

image

clip_image002
clip_image004: focal length
clip_image006: rotation matrix element
clip_image008: CCD array coordinate (column)
clip_image010: offset (for the three line scanner)
clip_image012
clip_image014: First order function of scan line
clip_image016: Constant (zero order function of scan line)
clip_image018: Scan line number
clip_image020
clip_image022
 
clip_image030
clip_image032
clip_image034
clip_image036
-. Matrix form
clip_image040
















Thursday, February 17, 2011

Plane fitting

 

Plane equation:

(1) lx + my + nz =  d

where d is a distance from an origin to the plane,

{l,m,n} is direction consines, and

sqrt(l*l + m*m + n*n)=1.

(2) ax + by + cz = 1

where d presented in (1) can be calculated by 1/sqrt(a*a + b*b + c*c).

(3) Ax + By + Cz = d^2

where (A, B, C) denotes a vector from an origin to the plane, which can be obtained by A = l*d, B=m*d, and C=n*d.

 

For a point cloud, P0, P1, P2, ~ Pn,

Its centroid C, (cx, cy, cz), is on an expected least squre fitted plane.

Therefore, dot product of [l, m, n] and (Pi-C) is zero.

l*xi + m*yi + n*zi = 0

whrer (xi,yi,zi) = Pi

To avoid [l, m, n] are estimated as zero,

a constraint of direction consines is adopted,

l^2 + m^2 + n^2 = 1.0