M01 · Mathematics alongside
Numbers, functions and grids
Start with a selected pixel: where it is, what its value means and which representation processing requires.
Mathematical support for the textbook chapters: start with a small calculation, then an interactive example and precise definitions.
Work through a small example
Three cell errors are 1, −2 and 2. Why is their length 3?
- Squares remove the sign
- Length returns to the original units
The errors sum to 1: signs nearly cancel. Length 3 retains the discrepancy magnitude. MSE for these cells is 9/3 = 3; that numerical equality is incidental, with different units and meanings.
A coordinate is an address; a value is its content
In array , x and y give column and row, and c gives channel. An interface can count addresses from 1 while code counts from 0; the conversion must be explicit. A zoomed screen coordinate is not a new source sample: one source pixel can occupy many screen pixels.
A scalar field stores one value per point; a vector field stores several. RGB, flow direction and a spectrum can all be vectors, but have different units and meaning. A segment ID is a category, not a magnitude. A missing measured channel is not zero: zero can be a real measurement.
Select a cell and channel: the address changes the measured location; the channel changes what its number means. Display magnification adds no samples. This example explains addresses and channels; the norms below are separate mathematical reference material.
What does a cell store?
Switch channels, code average and mask. Coordinates match while number meanings change.
Exact values are in the point inspector
RGB; display range 0…1
Exact values are in the point inspector
Grayscale 0…1: black to white.
Inspect the selected point
What the plot shows
RGB holds three numbers per site; a scalar map holds one. A 0/1 mask indicates membership, not material colour.
Parameters and details
An image is stored as rows × columns × channels. An RGB plane contains measurements or codes; a mask contains membership. This rectangular mask is authored manually, not inferred from colours. The RGB mean here is arithmetic, not physical luminance. Public coordinates start at 1.
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 function maps inputs to outputs
Definitions and details
A tone curve f maps an intensity to another number: . This is a function between declared domains. A local filter depends on a neighborhood: several input values determine one output. Global histogram equalization depends on the entire image.
A continuous model and its finite measured samples are different objects. Enlarging an array requires interpolation but creates no independent observations. Keep scene function, optical averaging, sampling and display rendering distinct.
Signs and fractions belong to the result
Definitions and details
An 8-bit channel has 256 integers from 0 to 255. A derivative can be negative, an average fractional, and amplification can exceed 255. Writing them immediately into a clamped byte buffer discards part of the calculation. Rounding, clipping and color mapping must be separate declared stages.
For example, mean and byte value 19 are not one exact number. Floating-point numbers are finite too: binary cannot represent 0.1 exactly. Numerical comparisons use meaningful absolute or relative tolerances; indices and categories still use exact equality.
Distance between images
Definitions and details
For error , norms give , and . L1 sums absolute values; L2 takes the square root of squared values; L∞ takes the largest absolute value. Inner product sums pairwise products and helps measure direction and projection.
For a grid approximating a continuous domain, sums can include cell area. Otherwise changing resolution changes energy scale. A norm measures the chosen mathematical difference; a small error norm does not guarantee preservation of a meaningful detail such as a digit.