Digital Images and 2D Geometry
-
A Pixel Grid and Its Array Shape
A raster image stores samples at discrete grid positions. Its array shape can include height, width, and channel dimensions.
-
Image Rows and Columns Versus Geometric Coordinates
An array often uses row then column. Geometric positions often name the horizontal coordinate first. Agree on the conversion and the vertical direction.
-
Image Channels and Their Order
A multi-channel image stores several values per sample, with meanings assigned by the pixel format and component order.
-
Converting Byte Intensities to a Unit Range
An unsigned eight-bit image sample can be mapped from 0 through 255 to a normalized 0 through 1 range by dividing by 255.
-
Cropping with Half-Open Bounds
A rectangular crop selects a range of rows and a range of columns under a coordinate convention.
-
Transposing and Rotating an Image
A transpose exchanges row and column positions. A right-angle rotation can combine an exchange with a reversal under typical array coordinates.
-
Reflecting an Image Across an Axis
A reflection reverses one coordinate across a declared axis while preserving the other. The index mapping depends on width or height.
-
Nearest-Neighbor Image Resampling
Nearest-neighbor resampling chooses one source sample for each output location using a coordinate mapping and rounding rule.
-
Bilinear Interpolation Between Four Samples
Bilinear interpolation mixes along one axis on each of two rows, then mixes those intermediate values along the other axis.
-
Downsampling and Aliasing in an Image
Keeping fewer samples can turn a fine repeating pattern into a misleading lower-frequency one. Filtering before taking samples can reduce that effect.
-
Creating a Binary Mask with an Intensity Threshold
A threshold turns each numeric sample into one of two states. State how to handle a value exactly at the cutoff.
-
Combining Aligned Image Masks
Two masks on the same grid can be combined by applying logical operations to corresponding positions.
-
A Histogram of Pixel Intensities
An intensity histogram counts how many pixels occupy each value or bin. It does not encode where those pixels occur.
-
Rescaling an Intensity Range
A linear rescale can map a chosen input minimum and maximum to a new interval, with documented rules for values outside it.
-
Clamping a Computed Image Value
Image formats often restrict allowable values. A processing pipeline can compute in a larger range and clamp only when required by the output contract.
-
A Local Averaging Filter
An averaging filter replaces a selected sample with the arithmetic mean of nearby samples under a defined window and boundary rule.
-
Padding at the Edge of an Image Filter
A filter window near an edge may reference positions outside the image. Padding supplies values under an explicit extension rule.
-
Local Image Differences and Edges
Taking numerical differences across nearby samples can identify where intensity changes under the chosen sampling and sign conventions.
-
A Median Filter in a Small Neighborhood
A median filter replaces a position with the median of its neighborhood. One extreme value can have limited influence on that statistic.
-
Four-Neighbor and Eight-Neighbor Grids
Different adjacency rules define which neighboring pixels can connect. Some include diagonals, and others use only horizontal and vertical steps.
-
Labeling Connected Regions in a Binary Image
Connected-component labeling assigns a shared label to every selected cell reachable under the chosen neighborhood rule.
-
A Bounding Box Around Selected Pixels
A bounding box stores row and column extremes covering all selected pixels. Its endpoint convention determines how to crop it.
-
The Centroid of Selected Pixel Positions
An unweighted centroid averages row and column coordinates of selected samples. It can lie between pixels or outside a nonconvex shape.
-
Area from a Pixel Count and Cell Size
When each grid cell represents a fixed physical area, counting selected cells can provide a discrete area estimate.
-
Translating a Point by a Displacement
A translation adds the same displacement vector to each point. Differences between positions stay unchanged.
-
Scaling Positions About a Chosen Center
Scaling around a center subtracts that center, scales the relative coordinates, and adds the center back.
-
Resampling by Mapping Output Points Back to Input
An inverse map can choose the appropriate source coordinate for each output position, reducing holes caused by rounding forward-mapped samples independently.
-
Checking Image Coordinate Transforms with Distinct Corners
Distinct corner values in a small rectangular fixture can reveal swapped axes, reversed directions, and unexpected crop origins.
-
Resizing a Categorical Image
A label image uses pixel values as category codes. Its resampling should preserve permitted labels under the chosen interpretation.
-
Validating a Pixel Array Before Processing
An image operation can require dimensions, channel order, numeric range, and a specific coordinate convention. Shape alone leaves several assumptions open.