For an image with width $W$ and height $H$, the equations mapping integer pixel coordinates $\bar X=(\bar x,\bar y)$ to normalized device coordinates $x=(x,y)$ are

where $S=max(W,H)$




The process of central maps 3D coordinates p = (X,Y,Z) to 2D coordinates x = (x,y,1) through a pinhole at the camera origin onto a 2D projection plane a distance f along the z axis,
$x=f \frac XZ,y=f \frac YZ$