Simple Camera Models with NumPy and Matplotlib
Introduction
The code presented in this article can be found here. I suggest you take a look at it and try to play around with it to fully assimilate the concepts that will be presented.
import matplotlib.pyplot as plt
import numpy as np
from camera_models import * # our package
DECIMALS = 2 # how many decimal places to use in print
Disclamer: The theory described in this article is almost entirely taken from the excellent book Multiple View Geometry in Computer Vision by Richard Hartley and Andrew Zisserman. This work is not intended to replace the explanations in the book, but only to present the minimum amount of theory needed so that it can be applied immediately thereafter.
The Pinhole Camera Model
A pinhole camera is a camera with a pinhole aperture and no lens, it is considered the most specialised and simplest camera model. As can be seen from the image above, the image plane, also called the focal plane, is behind the projection centre called the camera centre (𝐂) or optical centre. In what follows, for the sake of simplicity, it is considered to be in front…