[AMR] More fixes

This commit is contained in:
2026-06-17 14:57:36 +02:00
parent 4a3f2fb9c8
commit 5bf9d9a022
10 changed files with 56 additions and 29 deletions
@@ -12,9 +12,12 @@ with $f$ the distance to the lens and $z$ the full distance
\newpage \newpage
$u = c_u + f \cdot x'$ and $v = c_v + f \cdot y'$ where $x' = t_x \div t_z$ and $y' = t_y \div t_z$ $u = c_u + f \cdot x'$ and $v = c_v + f \cdot y'$ where $x' = t_x \div t_z$ and $y' = t_y \div t_z$
where $u, v$ are the pixel $x, y$ coords, $\vec{c} = [c_u, c_v]^\top$ is optical centre of cam in pixel coords, $f$ scale factor, where $u, v$ are the pixel $x, y$ coords, $\vec{c} = [c_u, c_v]^\top$ is optical centre of cam in pixel coords, $f$ scale factor,
and $\vec{{_C}\vec{t}_P} = [t_x, t_y, t_z]^\top$ % and $\vec{{_C}\vec{t}_P} = [t_x, t_y, t_z]^\top$
The full proj: $\vec{u} = \begin{bmatrix} The full proj:
$\vec{u} =
{\scriptsize
\begin{bmatrix}
\lambda u \\ \lambda u \\
\lambda v \\ \lambda v \\
\lambda \lambda
@@ -28,23 +31,27 @@ The full proj: $\vec{u} = \begin{bmatrix}
\begin{bmatrix} \begin{bmatrix}
t_x \\t_y\\t_z t_x \\t_y\\t_z
\end{bmatrix} \end{bmatrix}
}
= \mat{K}\; {_C}\vec{t}_P$ = \mat{K}\; {_C}\vec{t}_P$
If p. in diff frame ${_W} \vec{t}_P$, then $\vec{u} = \mat{K}[\mat{R}_{CW}\; {_C}\vec{t}_{CW}] = {_W}\vec{t}_P$ If p. in diff frame ${_W} \vec{t}_P$, then $\vec{u} = \mat{K}[\mat{R}_{CW}\; {_C}\vec{t}_{CW}] {_W}\vec{t}_P$
\subsubsection{Pinhole Camera Projection with distortion} \subsubsection{Pinhole Camera Projection with distortion}
\shortdefinition Model: $\vec{u} = \vec{k}(\vec{d}(\vec{p}({_C}\vec{t}_P)))$, with: \shortdefinition Model: $\vec{u} = \vec{k}(\vec{d}(\vec{p}({_C}\vec{t}_P)))$, with ($\vec{c}$ as above):
(Projection) $\vec{x'} = \vec{p}({_C}\vec{t}_P) = t_z^{-1} \cdot [t_x, t_y]^\top$ (Projection) $\vec{x'} = \vec{p}({_C}\vec{t}_P) = t_z^{-1} \cdot [t_x, t_y]^\top$
(Distortion model, $r^2 = x'^2 + y'^2$, $\vec{x''} = \vec{d}(\vec{x'})$\\ (Distortion model) $r^2 = x'^2 + y'^2$, $\vec{x''} = \vec{d}(\vec{x'})$\\
$\vec{x''} = \! \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} \vec{x'} $\vec{x''} = \! \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} \vec{x'}
+ \begin{bmatrix} +
{\scriptsize
\begin{bmatrix}
2p_1 x' y' + p_2(r^2 + 2x'^2) \\ 2p_1 x' y' + p_2(r^2 + 2x'^2) \\
p_1 (r^2 + 2y'^2) + 2p_2 x'y' p_1 (r^2 + 2y'^2) + 2p_2 x'y'
\end{bmatrix}$ \end{bmatrix}
}$
(Scale and Centre) $\vec{u} = \vec{k}(\vec{x''}) = \text{diag}([f_u, f_v]) \cdot \vec{x''} + \vec{x}$ (Scale and Centre) $\vec{u} = \vec{k}(\vec{x''}) = \text{diag}([f_u, f_v]) \cdot \vec{x''} + \vec{c}$
All with $k_i$ radial distortion params, optional for $i > 2$, $p_i$ tang. dist. param, $f_u, f_v$ focal length in pixels All with $k_i$ radial distortion params, optional for $i > 2$, $p_i$ tang. dist. param, $f_u, f_v$ focal length in pixels
@@ -13,17 +13,23 @@ $z = \frac{b \cdot f}{u_r - u_l}$ with $u_l = f\cdot \frac{x}{z} + c_u$ and $u_r
\subsubsection{Time of Flight, Projection} \subsubsection{Time of Flight, Projection}
{\color{ForestGreen}No occlusions/shadows}, {\color{red}Interference with other dev, multipath leading to larger distances sensed} {\color{ForestGreen}No occlusions/shadows}, {\color{red}Interference with other dev, multipath leading to larger distances sensed}
\bi{Proj.} $\vec{z} = \begin{bmatrix} \bi{Proj.} $\vec{z} =
{\scriptsize
\begin{bmatrix}
\vec{u} \\ d \vec{u} \\ d
\end{bmatrix} = \end{bmatrix} =
\begin{bmatrix} \begin{bmatrix}
\vec{k}(\vec{d}(\vec{p}({_C}\vec{t}_P))) \\ \vec{k}(\vec{d}(\vec{p}({_C}\vec{t}_P))) \\
[0, 0, 1] {_c}\vec{t}_P [0, 0, 1] {_c}\vec{t}_P
\end{bmatrix}$ \end{bmatrix}
}$
\bi{Back}: ${_C}\vec{t}_P \bi{Back}: ${_C}\vec{t}_P
= \begin{bmatrix} =
{\scriptsize
\begin{bmatrix}
d \vec{x'} \\d d \vec{x'} \\d
\end{bmatrix}$ \end{bmatrix}
}$
\subsubsection{Range Sensors} \subsubsection{Range Sensors}
@@ -3,5 +3,5 @@ $\vec{f}(\vec{x}) \approx \vec{f}(\vec{\overline{x}}) + \mat{J}_{\vec{f}} \big|_
\shortdefinition[Jac.] $\mat{J}_{\vec{f}}$ rows for eq of $\vec{f}$ cols for vars of each eq. \shortdefinition[Jac.] $\mat{J}_{\vec{f}}$ rows for eq of $\vec{f}$ cols for vars of each eq.
Approximation using finite differences $\frac{f(\overline{x} + h) - f(\overline{x})}{h}$,\\ Part. diff; Approx. using finite differences $\frac{f(\overline{x} + h) - f(\overline{x})}{h}$,\\
or central differences (vector of $\frac{\vec{f}(\vec{\overline{x}}) + h_i \vec{e_i}}{h_i}$, with $\vec{e_i}$ unit vec) or central differences (vector of $\frac{\vec{f}(\vec{\overline{x}}) + h_i \vec{e_i}}{h_i}$, with $\vec{e_i}$ unit vec)
@@ -3,8 +3,8 @@
\bi{Man. sol.}: comp. $M = A^\top A$, $b' = A^\top b$, then $Mx = b'$. \bi{Man. sol.}: comp. $M = A^\top A$, $b' = A^\top b$, then $Mx = b'$.
\bi{Prob. sol.}: $\text{argmax} p(\vec{x} \divider \vec{z})$ with \bi{Prob. sol.}: $\text{argmax} \; \P(\vec{x} \divider \vec{z})$ with Maximum \dots
\begin{itemize} \begin{itemize}
\item \bi{Max. Like} $p(\vec{x} | \vec{z}) \propto p(\vec{z} | \vec{x}) = \prod_{i = 1}^N p(\vec{z}_i | \vec{x})$ \item \bi{Likelihood} $\P(\vec{x} | \vec{z}) \propto \P(\vec{z} | \vec{x}) = \prod_{i = 1}^N \P(\vec{z}_i | \vec{x})$
\item \bi{M a Post} $p(\vec{x} | \vec{z}) \propto p(\vec{z} | \vec{x}) p(\vec{x}) = p(\vec{x}) \prod_{i = 1}^N p(\vec{z}_i | \vec{x})$ \item \bi{a Post} $\P(\vec{x} | \vec{z}) \propto \P(\vec{z} | \vec{x}) \P(\vec{x}) = \P(\vec{x}) \prod_{i = 1}^N \P(\vec{z}_i | \vec{x})$
\end{itemize} \end{itemize}
@@ -1,5 +1,5 @@
\subsection{Non-Linear Least Squares} \subsection{Non-Linear Least Squares}
Find $\vec{x}^* = \text{argmax} p(\vec{x} | \vec{z}) = \argmin{}(-\log(p(\vec{x}|\vec{z})))$ Find $\vec{x}^* = \text{argmax}\; \P(\vec{x} | \vec{z}) = \argmin{}(-\log(\P(\vec{x}|\vec{z})))$
\bi{Gauss-Newton} % TODO: Do we really need these? If so, use from NumCS (much simpler notation) \bi{Gauss-Newton} % TODO: Do we really need these? If so, use from NumCS (much simpler notation)
@@ -1,4 +1,4 @@
\subsection{Bayes Filter} \subsection{Bayes Filter (in DAG)}
$\vec{x}_k^R$ state at time k, $\vec{z}_k^p$ dist. meas., $\vec{u}^p_k$ wheel odometry (= meas.). $\vec{x}_k^R$ state at time k, $\vec{z}_k^p$ dist. meas., $\vec{u}^p_k$ wheel odometry (= meas.).
Typ. care ab. curr. state: altern. pred. \& update. Typ. care ab. curr. state: altern. pred. \& update.
% TODO: Do we really need the below? % TODO: Do we really need the below?
@@ -10,3 +10,5 @@ Non-l. state trans. model $\vec{x}_k = \vec{f}(\vec{x}_{k - 1}, \vec{u}_k, \vec{
\item \bi{Meas. residual}: $\vec{y}_k = \tilde{\vec{z}}_k - \vec{h}(\hat{\vec{x}}_{k | k - 1})$ \item \bi{Meas. residual}: $\vec{y}_k = \tilde{\vec{z}}_k - \vec{h}(\hat{\vec{x}}_{k | k - 1})$
\end{itemize} \end{itemize}
Difference to above: $\mat{H}$ becomes $\mat{H}_k$, and $\mat{H}^\top$ is $\mat{H}_k^\top$ Difference to above: $\mat{H}$ becomes $\mat{H}_k$, and $\mat{H}^\top$ is $\mat{H}_k^\top$
% TODO: Consider adding examples
@@ -1,11 +1,14 @@
\subsection{Keypoints} \subsection{Keypoints}
\bi{Corner det.} $SSD(\Delta_x, \Delta_y) \approx [\Delta_x \; \Delta_y] \mat{M} [\Delta_x \; \Delta_y]^\top$ \bi{Corner det.} $SSD(\Delta x, \Delta y) \approx [\Delta_x \; \Delta_y] \mat{M} [\Delta_x \; \Delta_y]^\top$
with $\mat{M} = \mat{R}^\top \text{diag}(\lambda_1, \lambda_2) \mat{R}$; $\lambda_i$ E.V. of $M$; with $\mat{M} = \mat{R}^\top \text{diag}(\lambda_1, \lambda_2) \mat{R}$; $\lambda_i$ E.V. of $M$; $\kappa$ const 0.04-0.15;
$\mat{R} = \det(M) - \kappa \cdot \text{trace}(M)^2 = \lambda_1\lambda_2 - \kappa(\lambda_1 + \lambda_2)^2$; $\mat{R} = \det(M) - \kappa \cdot \text{TR}(M)^2 = \lambda_1\lambda_2 - \kappa(\lambda_1 + \lambda_2)^2$;\\
$\displaystyle M = \sum_{x, y \in P} \begin{bmatrix} $M = \sum_{x, y \in P}
{\scriptsize
\begin{bmatrix}
I_x^2 & I_x I_y \\ I_x^2 & I_x I_y \\
I_x I_y & I_y^2 I_x I_y & I_y^2
\end{bmatrix}$ \end{bmatrix}
}$
\shade{gray}{Blob Detection} ($I$ is the image) \shade{gray}{Blob Detection} ($I$ is the image)
@@ -1,9 +1,11 @@
\subsection{Bootstrapping} \subsection{Bootstrapping}
\bi{PnP Problem} {\scriptsize Persp. n-P.} \bi{PnP Problem} {\scriptsize Persp. $n$-P.}
Find sol. for camera pose \textit{directly} Find sol. for camera pose \textit{directly}
\bi{RANSAC} {\scriptsize RANdom SAmpling Consensus} for find. outliers \& correct \bi{RANSAC} {\scriptsize RANdom SAmpling Consensus} for find. outliers \& correct
% TODO: Do we need to know this algorithm / be able to implement it?
% -> likely not
\bi{Stereo Triang.} Given two rays (known poses for points in 2D). \bi{Stereo Triang.} Given two rays (known poses for points in 2D).
Find good point in 3D. Fast sol: \bi{Midpoint Method}: Find good point in 3D. Fast sol: \bi{Midpoint Method}:
@@ -16,15 +18,22 @@ Find good point in 3D. Fast sol: \bi{Midpoint Method}:
\rmvspace \rmvspace
\bi{2} Solve normal equation $\mat{A} \vec{\lambda} = \vec{b}$ with $\vec{q} = -{_W}\vec{e}^\top_1 {_W}\vec{e}_2$: \bi{2} Solve normal equation $\mat{A} \vec{\lambda} = \vec{b}$ with $\vec{q} = -{_W}\vec{e}^\top_1 {_W}\vec{e}_2$:
\[ \[
\mat{A} = \begin{bmatrix} \mat{A} =
{\scriptsize
\begin{bmatrix}
1 & \vec{q} \\ 1 & \vec{q} \\
\vec{q} & 1 \vec{q} & 1
\end{bmatrix} \end{bmatrix}
}
\quad \quad
\vec{b} = \begin{bmatrix} \vec{b} =
{\scriptsize
\begin{bmatrix}
\vec{e}_1^\top \cdot ({_W}\vec{t}_{C_2} - {_W}\vec{t}_{C_1}) \\ \vec{e}_1^\top \cdot ({_W}\vec{t}_{C_2} - {_W}\vec{t}_{C_1}) \\
-\vec{e}_2^\top \cdot ({_W}\vec{t}_{C_2} - {_W}\vec{t}_{C_1}) -\vec{e}_2^\top \cdot ({_W}\vec{t}_{C_2} - {_W}\vec{t}_{C_1})
\end{bmatrix} \end{bmatrix}
}
\quad C_i \text{ cam}
\] \]
\bi{3} Pick midp. ${_W}\vec{t}_P \! = \! 0.5(\tau_1 \! + \! \tau_2)$; $\tau_n \! = \! {_W}\vec{t}_{C_n} + \lambda_n{_W}\vec{e}_n)$ \bi{3} Pick midp. ${_W}\vec{t}_P \! = \! 0.5(\tau_1 \! + \! \tau_2)$; $\tau_n \! = \! {_W}\vec{t}_{C_n} + \lambda_n{_W}\vec{e}_n)$