In computer vision and 3D computer graphics, the pinhole camera model describes the mathematical relationship between the coordinates of a point in three-dimensional space and its projection onto the image plane of an ideal pinhole camera, where the camera aperture is described as a point and no lenses are used to focus light. The model does not include, for example, geometric distortions or blurring of unfocused objects caused by lenses and finite area apertures. It also does not take into account that most practical cameras have only discrete image coordinates (pixel indices). This means that the pinhole camera model can only be used as a first order approximation of the mapping from a 3D scene to an image plane. Its validity depends on the quality of the camera and, in general, decreases from the center to the edges of the image, as lens distortion effects increase. Some of the effects that the pinhole camera model does not take into account can be compensated, for example by applying suitable coordinate transformations on the image coordinates; other effects are sufficiently small to be neglected if a high quality camera is used. This means that the pinhole camera model often can be used as a reasonable description of how a camera depicts a 3D scene.
Geometry
The geometry related to the mapping of a pinhole camera is illustrated in the figure. The figure contains the following basic objects:
A 3D orthogonal coordinate system with its origin at O. This is also where the camera aperture is located. The three axes of the coordinate system are referred to as X1, X2, X3. Axis X3 is pointing in the viewing direction of the camera and is referred to as the optical axis, principal axis, or principal ray. The plane which is spanned by axes X1 and X2 is the front side of the camera, or principal plane. An image plane, where the 3D world is projected through the aperture of the camera. The image plane is parallel to axes X1 and X2 and is located at distance f {\displaystyle f} from the origin O in the negative direction of the X3 axis, where f is the focal length of the pinhole camera. A practical implementation of a pinhole camera implies that the image plane is located such that it intersects the X3 axis at coordinate -f where f > 0. A point R at the intersection of the optical axis and the image plane. This point is referred to as the principal point or image center. A point P somewhere in the world at coordinate ( x 1 , x 2 , x 3 ) {\displaystyle (x_{1},x_{2},x_{3})} relative to the axes X1, X2, and X3. The projection line of point P into the camera. This is the green line which passes through point P and the point O. The projection of point P onto the image plane, denoted Q. This point is given by the intersection of the projection line (green) and the image plane. In any practical situation we can assume that x 3 {\displaystyle x_{3}} > 0 which means that the intersection point is well defined. There is also a 2D coordinate system in the image plane, with origin at R and with axes Y1 and Y2 which are parallel to X1 and X2, respectively. The coordinates of point Q relative to this coordinate system is ( y 1 , y 2 ) {\displaystyle (y_{1},y_{2})} . The pinhole aperture of the camera, through which all projection lines must pass, is assumed to be infinitely small, a point. In the literature this point in 3D space is referred to as the optical (or lens or camera) center.
Formulation Next we want to understand how the coordinates ( y 1 , y 2 ) {\displaystyle (y_{1},y_{2})} of point Q depend on the coordinates ( x 1 , x 2 , x 3 ) {\displaystyle (x_{1},x_{2},x_{3})} of point P. This can be done with the help of the following figure which shows the same scene as the previous figure but now from above, looking down in the negative direction of the X2 axis.
In this figure we see two similar triangles, both having parts of the projection line (green) as their hypotenuses. The catheti of the left triangle are − y 1 {\displaystyle -y_{1}} and f and the catheti of the right triangle are x 1 {\displaystyle x_{1}} and x 3 {\displaystyle x_{3}} . Since the two triangles are similar it follows that
− y 1 f = x 1 x 3 {\displaystyle {\frac {-y_{1}}{f}}={\frac {x_{1}}{x_{3}}}} or y 1 = − f x 1 x 3 {\displaystyle y_{1}=-{\frac {f\,x_{1}}{x_{3}}}}
… excerpt ends here. Continue reading the full article.




