- The transformation matrices from that section act on whole images, and the way you apply them to a pixel grid decides whether the result has holes.
- Lines and points are dual under the cross product in homogeneous form: joining two points and intersecting two lines are the same operation.
- Implicit image representations (SIREN-style networks that map ) let you read an image at any sub-pixel location without an interpolation kernel, so a geometric transformation becomes an evaluation at inverse-transformed coordinates.
Code
Code
Heterogeneous and homogeneous coordinates
The homogeneous coordinates section introduced the extra coordinate. The book calls the heterogeneous form of a 2D point and its homogeneous form. Every vector with lies on the same ray through the origin and stands for the same 2D point, and dividing by recovers . The figure below draws that ray where it crosses the plane . The two helpers below convert between the forms, and the rest of the section uses them.Code
Code
2D image transformations
Every transformation that follows is a matrix acting on homogeneous points. The homogeneous coordinates section sorts these matrices into rigid, similarity, affine and projective families and lists what each family keeps. Here the same matrices act on an image. The book applies them to a photograph of a clock. A wall-clock image stands in for it, and each matrix warps the actual pixels (first figure below). The second figure collects the elementary matrices in one place: translation, scaling, rotation and shear.Code
Code
Geometric transformation as a convolution
If you represent an image as a set of triples (intensity plus explicit position), then a rotation is a 1D convolution on the position channels: Intensity passes through untouched; only the coordinate channels are mixed, as the figure below shows. This framing makes it natural to learn warps with neural networks that operate on coordinate channels, and the rest of the section builds that bridge.Lines and points: cross-product duality
In homogeneous coordinates, a 2D line is the vector , and incidence is . Two operations turn out to be the same cross product: Parallel lines intersect at a point with . This is the point at infinity that the homogeneous coordinates section calls an ideal point, and it is the homogeneous form of a vanishing point. The section on 3D motion and its 2D projection uses exactly this construction.Image warping: forward and backward mapping
Applying a transformation to an image should give you a new image. The naive way, forward mapping, walks the input pixels, transforms each location, and writes its intensity to the nearest target pixel. That leaves holes, because an expansion spreads the input pixels too thinly to cover the target grid. The correct way, backward mapping, walks the target pixels and pulls each back through , so every output pixel gets one well-defined intensity. A small checkerboard makes the artifacts easy to see.Code
Code
Differentiable warping with Kornia
The hand-writtenbackward_warp above shows the principle. In practice you use Kornia, a differentiable computer vision library built on PyTorch. Its warp_affine performs the same backward mapping, but with bilinear interpolation (so no nearest-neighbor aliasing), in batches, and differentiably end to end. The next cell feeds it the same matrix and compares the result with the hand-written version.
Code
Code
Implicit image representations (SIREN)
Backward mapping at sub-pixel locations needs an interpolation kernel, but only because the image is stored as a discrete grid. SIREN (Sitzmann et al., NeurIPS 2020) does away with the grid: it represents an image as a small network whose layers use activations. The trained network is the image, and you can evaluate it at any continuous coordinate. Geometric warping then becomes a coordinate transform with no interpolation kernel: The next cells train a small SIREN on the cameraman test image and warp it by feeding pre-transformed coordinates. The training is deliberately short: the point is to demonstrate the representation, not to maximize reconstruction quality.Code
Code
Concluding remarks
The section moves forward one step at a time:- From matrices to warps: the transformation matrices act on images, and backward mapping applies them without leaving holes.
- From points and lines to cross-product duality: incidence, joins, and intersections collapse into one operation. Parallel lines meet at points with , so vanishing points get a coordinate.
- From a discrete grid to an implicit function: with SIREN, the image is its parameters. Warping becomes an inverse-coordinate query and interpolation kernels disappear.
Found an error on this page? Report an issue.

