C12 · Coordinates, frequencies, scales
Geometry and interpolation
First decide where a value comes from. Then decide how to estimate it between samples.
Background if needed
Theory
Why the output pixel looks for its source
Forward-moving source pixels can land in the same output cell and leave holes elsewhere. Inverse mapping visits every output center and applies the inverse coordinate transform. It avoids internal holes, but data outside the original frame remain unavailable.
The example rotates and scales around the center of a 16×16 image, then translates along x. Select an output point to inspect its fractional source coordinate. Rotation describes geometry; mixing neighbors is a separate interpolation operation.
Coordinates and interpolation are separate
Rotate the scene. Select an output pixel and inspect the four samples that can determine its brightness.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Inspect the selected point
What the plot shows
Nearest neighbor preserves individual values and produces steps. Bilinear interpolation mixes four values but cannot restore lost resolution.
Parameters and details
Each output pixel center maps back to a source coordinate. Outside the frame is zero; scale and rotation use the image center. Interpolation does not change the coordinate transform.
Select an image point. Arrows move it; Home and End reach row edges. Viewing does not change the calculation.
Changing the example requires JavaScript and Canvas. Computed images remain available above.
A fractional coordinate is not a new measurement
Nearest neighbor rounds a coordinate and takes one value. Bilinear interpolation uses four adjacent centers, with axis weights summing to one. Near a boundary some contributions can come from the declared zero background.
Bicubic, spline and windowed-sinc methods use wider neighborhoods and different signal assumptions. Downsampling needs a low-pass prefilter: bilinear interpolation alone does not guarantee freedom from aliasing. Translucent images also require correct alpha handling.
Which geometric model fits the task
Reference and further methods
Translation, rotation and uniform scale form a similarity transform. Affine models add unequal scales and shear while preserving parallel lines. A projective homography models perspective on one plane and may change parallelism; it does not rectify an arbitrary 3D scene.
Homogeneous coordinates express these maps as matrices. Lens distortion and thin-plate splines need nonlinear maps. Estimating a transform from correspondences belongs to motion. An invertible matrix does not make raster shrinking and enlargement reversible: information has already mixed or vanished.
Practice
Test the idea under another condition. Follow the task above the images; point inspection helps explain the result. This exploration is not scored.
One rotation, two ways to sample brightness
Rotation and scale are fixed initially. Select a slanted edge and change only interpolation. For bilinear sampling, check the four contributions; then select a point near the frame boundary.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Inspect the selected point
What the plot shows
The intensity estimate changes, not the fractional source coordinate. Exterior zeros also contribute: a softer edge does not mean newly recovered detail.
Parameters and details
Each output pixel center maps back to a source coordinate. Outside the frame is zero; scale and rotation use the image center. Interpolation does not change the coordinate transform.
Select an image point. Arrows move it; Home and End reach row edges. Viewing does not change the calculation.
Changing the example requires JavaScript and Canvas. Computed images remain available above.
Games
Test your explanation
Question 1 of 5
What does the rotation matrix select?
Exact values are in the point inspector
Grayscale 0…1: black to white.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Exact values are in the point inspector
Grayscale 0…1: black to white.
Choose one answer. It is checked immediately.
Limitations and references
Limits of this example
The live example implements similarity/translation, nearest/bilinear and zero background. Homography, distortion, TPS and wider interpolators are explained extensions, not hidden capabilities of this console.