Camera Parameters: Difference between revisions
Created page with "Camera Parameters ==Intrinsics== ==Extrinsics== ==Resources== * [http://ftp.cs.toronto.edu/pub/psala/VM/camera-parameters.pdf Camera Models and Parameters slides by Pablo S..." |
|||
(13 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
==Intrinsics== | ==Intrinsics== | ||
The is the projection matrix which turns camera coordinates to image coordinates. | |||
It consists of the following: | |||
* Focal Length \(f\) - this determines the field of view. | |||
* Image Center \(\mathbf{o} = (o_x, o_y)\) (also known as principal point) | |||
* Size of pixels \(\mathbf{s} = (s_x, s_y)\) (based on the resolution) | |||
* Axis skew \(s\) typically 0 | |||
The formula for this matrix is: | |||
\[ | |||
\begin{equation} | |||
M_{int} = | |||
\begin{bmatrix} | |||
f/s_x & s & o_x\\ | |||
0 & f/s_x & o_y\\ | |||
0 & 0 & 1 | |||
\end{bmatrix} | |||
\end{equation} | |||
\] | |||
E.g. if your camera has a 90 deg FOV on each side and outputs a resolution of <math>256 \times 256</math>, then the intrinsic matrix should project <math>(1,0,1)</math> to <math>(256, 0)</math>: | |||
\[ | |||
\begin{equation} | |||
M_{int} = | |||
\begin{bmatrix} | |||
128/256 & 0 & 128/256\\ | |||
0 & 128/256 & 128/256\\ | |||
0 & 0 & 1 | |||
\end{bmatrix} | |||
\end{equation} | |||
\] | |||
;Note you can also write <math>f/s_x</math> as <math>f_x</math>, and similar for <math>f_y</math>. | |||
==Extrinsics== | ==Extrinsics== | ||
This is the view matrix which encodes the camera's position and rotation. | |||
Suppose the camera position is \(\mathbf{C}\) and rotation \(\mathbf{R}_c\). | |||
\[ | |||
\begin{equation} | |||
M_{ext}= [\mathbf{R} | \mathbf{t}] = [\mathbf{R}_c^T | -\mathbf{R}_c^T \mathbf{C}] | |||
\end{equation} | |||
\] | |||
==Resources== | ==Resources== | ||
* [http://ftp.cs.toronto.edu/pub/psala/VM/camera-parameters.pdf Camera Models and Parameters slides by Pablo Sala, University of Toronto] | * [http://ftp.cs.toronto.edu/pub/psala/VM/camera-parameters.pdf Camera Models and Parameters slides by Pablo Sala, University of Toronto] | ||
* [https://ksimek.github.io/2012/08/13/introduction/#toc Dissecting the intrinsic matrix blog post by Kyle Simek] | |||
** [https://ksimek.github.io/2012/08/14/decompose/ Part 1: Extrinsic/Intrinsic Decomposition] | |||
** [https://ksimek.github.io/2012/08/22/extrinsic/ Part 2: The Extrinsic Matrix] | |||
** [https://ksimek.github.io/2013/08/13/intrinsic/ Part 3: The Intrinsic Matrix] |
Latest revision as of 17:05, 27 June 2022
Camera Parameters
Intrinsics
The is the projection matrix which turns camera coordinates to image coordinates.
It consists of the following:
- Focal Length \(f\) - this determines the field of view.
- Image Center \(\mathbf{o} = (o_x, o_y)\) (also known as principal point)
- Size of pixels \(\mathbf{s} = (s_x, s_y)\) (based on the resolution)
- Axis skew \(s\) typically 0
The formula for this matrix is: \[ \begin{equation} M_{int} = \begin{bmatrix} f/s_x & s & o_x\\ 0 & f/s_x & o_y\\ 0 & 0 & 1 \end{bmatrix} \end{equation} \]
E.g. if your camera has a 90 deg FOV on each side and outputs a resolution of \(\displaystyle 256 \times 256\), then the intrinsic matrix should project \(\displaystyle (1,0,1)\) to \(\displaystyle (256, 0)\): \[ \begin{equation} M_{int} = \begin{bmatrix} 128/256 & 0 & 128/256\\ 0 & 128/256 & 128/256\\ 0 & 0 & 1 \end{bmatrix} \end{equation} \]
- Note you can also write \(\displaystyle f/s_x\) as \(\displaystyle f_x\), and similar for \(\displaystyle f_y\).
Extrinsics
This is the view matrix which encodes the camera's position and rotation.
Suppose the camera position is \(\mathbf{C}\) and rotation \(\mathbf{R}_c\).
\[ \begin{equation} M_{ext}= [\mathbf{R} | \mathbf{t}] = [\mathbf{R}_c^T | -\mathbf{R}_c^T \mathbf{C}] \end{equation} \]