# 成像模型 (Camera_Projection)

## Camera Coords to Film Coords (3D to 2D)

x=X \cdot \frac{f}{Z} = f\frac{X}{Z} y=Y \cdot \frac{f}{Z} = f\frac{Y}{Z}

\left[\begin{array}{c} x\\ y \\ z \end{array}\right]=\left[\begin{array}{llll} f & 0 & 0 & 0 \\ 0 & f & 0 & 0 \\ 0 & 0 & 1 & 0 \end{array}\right]\left[\begin{array}{c} X \\ Y \\ Z \\ 1 \end{array}\right]

## World Coords to Camera Coords (3D to 3D)

\begin{gathered} \mathbf{P}_{\mathbf{C}}=\mathbf{R}\left(\mathbf{P}_{\mathbf{W}}-\mathbf{C}\right) \\ \left(\begin{array}{l} \mathrm{X} \\ \mathrm{Y} \\ \mathrm{Z} \\ 1 \end{array}\right)=\left(\begin{array}{llll} \mathrm{r}_{11} & \mathrm{r}_{12} & \mathrm{r}_{13} & 0 \\ \mathrm{r}_{21} & \mathrm{r}_{22} & \mathrm{r}_{23} & 0 \\ \mathrm{r}_{31} & \mathrm{r}_{32} & \mathrm{r}_{33} & 0 \\ 0 & 0 & 0 & 1 \end{array}\right)\left(\begin{array}{llll} 1 & 0 & 0 & -c_{x} \\ 0 & 1 & 0 & -c_{y} \\ 0 & 0 & 1 & -c_{z} \\ 0 & 0 & 0 & 1 \end{array}\right)\left(\begin{array}{c} \mathrm{U} \\ \mathrm{V} \\ \mathrm{W} \\ 1 \end{array}\right) \end{gathered}

## 通常写法

\mathbf{R}\cdot(\mathbf{P}_W-\mathbf{C})\\ = \mathbf{R}\mathbf{P}_W-\mathbf{R}\mathbf{C}\\ = \mathbf{R}\mathbf{P}_W-\mathbf{T}\\ \left( \begin{array}{c} \mathrm{X}\\ \mathrm{Y}\\ \mathrm{Z}\\ 1\\ \end{array} \right) =\left( \begin{matrix}{l} \mathrm{r}_{11}& \mathrm{r}_{12}& \mathrm{r}_{13}& 0\\ \mathrm{r}_{21}& \mathrm{r}_{22}& \mathrm{r}_{23}& 0\\ \mathrm{r}_{31}& \mathrm{r}_{32}& \mathrm{r}_{33}& 0\\ 0& 0& 0& 1\\ \end{matrix} \right) \left( \begin{matrix} 1& 0& 0& -c_x\\ 0& 1& 0& -c_y\\ 0& 0& 1& -c_z\\ 0& 0& 0& 1\\ \end{matrix} \right) \left( \begin{array}{c} \mathrm{U}\\ \mathrm{V}\\ \mathrm{W}\\ 1\\ \end{array} \right) \\ =\left( \begin{matrix} \mathrm{r}_{11}& \mathrm{r}_{12}& \mathrm{r}_{13}& t_x\\ \mathrm{r}_{21}& \mathrm{r}_{22}& \mathrm{r}_{23}& t_y\\ \mathrm{r}_{31}& \mathrm{r}_{32}& \mathrm{r}_{33}& t_z\\ 0& 0& 0& 1\\ \end{matrix} \right) \left( \begin{array}{c} \mathrm{U}\\ \mathrm{V}\\ \mathrm{W}\\ 1\\ \end{array} \right)

## Film Coords to Pixel Coords (2D to 2D)

• 偏移量 offset: o
• 尺度变换 scales： s

u=\frac{1}{\mathrm{~s}_{\mathrm{x}}} f\cdot x+o_{x} =\frac{1}{\mathrm{~s}_{\mathrm{x}}} f \frac{X}{Z}+o_{x} \\
v=\frac{1}{\mathrm{~s}_{\mathrm{y}}} f\cdot y+o_{y}=\frac{1}{\mathrm{~s}_{\mathrm{y}}} f \frac{Y}{Z}+o_{y}

## Send CommentEdit Comment

|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
（╯‵□′）╯︵┴─┴
￣﹃￣
(/ω＼)
∠( ᐛ 」∠)＿
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ｀)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ(￣∇￣o)
ヾ(´･ ･｀｡)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò｡)
Σ(っ °Д °;)っ
( ,,´･ω･)ﾉ"(´っω･｀｡)
╮(╯▽╰)╭
o(*////▽////*)q
＞﹏＜
( ๑´•ω•) "(ㆆᴗㆆ)

Emoji