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.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a small image
  2. Use unequal dimensions in tests

Trace a small image

An image three pixels wide and two high can use shape \((2,3)\) for grayscale in a row-first layout. With three channels following each sample the shape can be \((2,3,3)\). See tensor axis roles.

Use unequal dimensions in tests

A square image hides a swapped height and width. Test transformations on a rectangle with identifiable corners. Row and column positions explain which offset comes first.[1][2]

References

  1. scikit-image Contributors, NumPy Images and Coordinate Conventions ↩
  2. scikit-image Contributors, Image Data Types and Representable Values ↩