Image Formation

Pinhole Camera

Components

clipboard.png

Mathematical Perspective

clipboard.png

Perspective Projection

P=XZ=xfx=fXZ\begin{align*} \vec{P} &= \frac{X}{Z} = -\frac{x}{f} \\ &\Rightarrow x = -\frac{fX}{Z} \end{align*}

clipboard.png

Effect of it

  • Assume there are 2 line segments defined by (5,Z)(-5, Z) and (5,Z)(5, Z)
  • ZZ ranges from 1010 to 10001000 (distance from aperture to the real-world object)
  • f=1f = 1
# predefined params
X1 = -5
X2 = 5
Z = np.linspace(10, 1000, 990)
f = 1

# two lines
x1 = -(f * X1) / Z
x2 = -(f * X2) / Z

# plot the distance between two lines as Z increases
plt.plot(Z, np.abs(x1 - x2))
plt.show()

clipboard.png

Important

2 lines get closer to each other when the distance between the aperture and the real-world coordinate increases

clipboard.png