Computer Vision MT25, Image representation


Flashcards

@Describe two different ways of representing an image.

  1. As a multidimensional array of colour values,
  2. As (samples from) a continuous 2D function $f(x, y)$

Bite-sized

A colour image is stored as an array of shape (height, width, channels) — e.g. (854, 1280, 3) for an HD image with 3 colour channels. OpenCV uses BGR ordering by default; PIL/most other libraries use RGB.

Source: Lecture 2, Images as Pixels slide.

@bite~

Indexing into an image array: the top-left pixel is at index [0, 0], and the bottom-right is at the last index. The first axis is the row (vertical, $y$), the second axis is the column (horizontal, $x$). This is the matrix-major convention, not the usual Cartesian $(x, y)$ convention.

Source: Lecture 2, Images as Pixels slide.

@bite~

A grayscale image is stored as a 2D array of shape (H, W) — a single channel. A colour image is the same but with an extra dimension giving channel count, typically 3 (BGR or RGB) — but RGBA images add a 4th alpha channel for transparency.

Source: Lecture 2, Digital Images slide.

@bite~

For 8-bit-per-channel images, pixel intensities take integer values in $[0, 255]$, with 0 = darkest and 255 = brightest. As floating point, the convention is to normalise to $[0, 1]$ (or sometimes $[-1, 1]$ for inputs to neural networks). The conversion is $f _ \text{float} = f _ \text{int} / 255$.

Source: Lecture 2, Digital Images slide.

@bite~

@Justify why it is useful to view images as samples from a continuous 2D function $f(x, y)$ rather than as discrete pixel arrays.

The functional representation lets us:

  • Express operations (filtering, geometric transformations, derivatives, Fourier analysis) using calculus and analysis — concepts like gradients, integrals, and convolutions all become natural.
  • Reason about sampling and aliasing: the Nyquist-Shannon theorem applies to the underlying continuous signal, not to the discrete grid.
  • Define inter-pixel values via interpolation (bilinear, bicubic) when we need image values at non-integer coordinates, e.g. for warps and resampling.
  • Decouple from resolution: properties like “edge sharpness” or “frequency content” depend on the continuous signal, not on a particular pixel grid.

The discrete array representation is what we implement on a computer, but the continuous function is what we reason about mathematically.

Source Lecture 2, Images as Functions slide.

@bite~

@Define the pixel (image) coordinate system of an image, and contrast it with the normalised coordinate system (∆normalised-coordinate-system) used in the pinhole camera model.

Pixel (image) coordinates: discrete positions indexing the image array. The origin $(0,0)$ is the top-left corner, the first axis is the row (vertical, increasing downward, $y$) and the second the column (horizontal, $x$), with one unit per pixel — the matrix-major convention, not Cartesian (∆bite-image-indexing-row-column-convention).

Normalised (camera) coordinates: continuous image-plane coordinates with the origin at the principal point (image centre) and metric units. The intrinsic matrix $\mathbf K$ converts normalised to pixel coordinates by scaling with $m _ x, m _ y$ pixels per metre (∆bite-pixel-scaling-factors-units) and shifting the origin to the corner via the principal point $(p _ x, p _ y)$ (∆principal-point-definition).

Source Lecture 2, Images as Pixels slide; Lecture 14, Intrinsic Parameters: Principal Point / Scaling Factors slides.

@bite~