


\chapter{Existing technologies}
There exists a number of methods to perform the mapping of surfaces.
\section{Contact}
Contact profilometry utilizes a stylus moving across the surface to directly sample its vertical displacement. Both vertical and horizontal resolution are determined by the dimensions of the stylus tip and the force applied to it. The ISO standard defines these to be a cone with 20 $\mu$m tip radius, 60$^{\circ}$ or 90$^{\circ}$ tip angle, and 750 $\mu$N measuring force \cite{ISO3274}. The tip material is typically diamond due to its high hardness and low coefficient of friction.
\section{Laser triangulation}
Laser triangulation uses a laser emitter and a camera in set relative position. The laser projects a point or a line onto the surface. The surface profile is calculated based on the projection's position in the camera's field of view. The setup further examined in this paper falls into this category.
\section{Confocal microscopy}
\section{Interferometry}
\section{Digital holography}

\chapter{Mathematical description}
The geometry of an idealized laser emitter-camera system can be fully described with three variables (laser plane to camera distance $d$, camera altitude angle $\sigma$, and camera transverse angle $\psi$). Four more values describe the camera itself (field of view $\phi_x$, $\phi_y$, and pixel dimensions $X_m$, $Y_m$). This system assumes the laser is thin enough to appear only 1 pixel thick in the camera's field of view.

Introducing a flat mirror into the system adds three new independent values (camera-mirror distance, two orientation angles) if we assume the camera's field of view to be fully reflected by the mirror.  Under this assumption any plane-camera-mirror system has an equivalent plane-camera system.

Given two planes in 3-space, any point not in either of these planes defines a non-linear bijective map between them (\ref{fig_m_1}). This point is the projection focus. In case of parallel planes there are no singularities. In case of intersecting planes there is one line in each plane which maps to infinity.

\begin{figure}[h]
    \centering
    \begin{subfigure}{.5\textwidth}
        \centering
        \includegraphics[width=\linewidth]{obrazky-figures/fig_m_1.png}
    \end{subfigure}%
    \begin{subfigure}{.5\textwidth}
        \centering
        \includegraphics[width=.8\linewidth]{obrazky-figures/fig_m_2.png}
    \end{subfigure}
    \caption{Side and top view - x axis going out of image and parallel, respectively}
    \label{fig_m_1}
\end{figure}

Imposing an orthonormal coordinates on both planes such that the intersection line is the x axis and the origin is the point in the intersection closest to the projection focus yields the following:

$$\frac{a}{b} = \frac{y'.sin(\alpha)}{d.sin(\beta)}$$
$$d.y'.sin(\alpha + \beta) = d.y.sin(\beta) + y.y'.sin(\alpha)$$

Therefore:

$$x' = x.(1 + \frac{y}{d.sin(\alpha + \beta)-y.sin(\alpha)})$$
$$y' = \frac{d.y.sin(\beta)}{d.sin(\alpha + \beta)-y.sin(\alpha)}$$

One of these planes is the laser plane, which has a fixed position. The other is the camera-normal plane, which can be placed arbitrarily. If we place it so that the normal to the laser plane at the origin contains the camera we get the following (\ref{fig_m_3}):

\begin{figure}[h]
    \centering
    \includegraphics[width=\linewidth]{obrazky-figures/fig_m_3.png}
    \caption{Laser-camera system}
    \label{fig_m_3}
\end{figure}

$$b = d.cos(\sigma)$$

The coordinates of the center of the camera's field of view in the normal plane and the resulting linear transformation from the camera's pixel grid to the normal plane:

$$\begin{pmatrix}x_c\\y_c\end{pmatrix}
=
\begin{pmatrix}0\\d.sin(\sigma)\end{pmatrix}
$$
$$\begin{pmatrix}x\\y\end{pmatrix}
= 
\begin{pmatrix}x_c\\y_c\end{pmatrix}
+ R(\psi)
\begin{pmatrix}\Delta_x\\\Delta_y\end{pmatrix}
$$

$$\Delta_x = b.tan(\frac{\phi_x}{2})(\frac{2X+1}{X_m}-1)$$
$$\Delta_y = b.tan(\frac{\phi_y}{2})(\frac{2Y+1}{Y_m}+1)$$

Per-pixel depth resolution here.
Address laser width problem here.
PCM to PC conversion here.

$$e^{e^e}$$