DATA2001 · Data Science, Big Data and Data Variety
Image Data Processing
Week 12 treats images and multimedia as data: how a digital image is represented as a 2-D array of pixels with a bit depth, and the computer-vision-style processing (filtering, thresholding, segmentation, feature extraction) used to pull information out of it. It completes the tour of data variety — relational to semi-structured to time-series to text to image — and its representation and thresholding ideas are examined in the 50% final exam.
What this chapter covers
- 01Image as a function f(x, y) of intensity; sampling (space) and quantization (amplitude) to a digital image x[n1, n2]
- 02Resolution N1 x N2 (total pixels N1 · N2) and bit depth B (values 0 to 2^B - 1; 8-bit gives 0-255, 0 = black, 255 = white)
- 03Image types: binary/mask (0/1), grayscale (single channel 0-255), colour (RGB three channels), and multi-band
- 04Lossless (PNG/TIFF/GIF) vs lossy (JPEG) formats; metadata (EXIF/XMP): time, camera, GPS, copyright
- 05Processing output levels: low (image to image, e.g. filtering), mid (edges/segments/objects), high (scene understanding)
- 06Filtering and denoising (median/average/Wiener); histograms and contrast; segmentation and thresholding
- 07Global thresholding g = 1 if f >= T else 0 (simple vs adaptive) and image feature vectors for similarity search
Global thresholding of a grayscale patch
- +1Recall the rule and the range. 8-bit intensities run 0 (black) to 255 (white); the threshold maps every pixel at or above T = 128 to 1 (foreground/white) and every pixel below 128 to 0 (background/black).
- +1Row 1 [200, 50, 130]: 200 >= 128 → 1, 50 < 128 → 0, 130 >= 128 → 1, giving [1, 0, 1].
- +1Row 2 [120, 255, 90]: 120 < 128 → 0, 255 >= 128 → 1, 90 < 128 → 0, giving [0, 1, 0]. Row 3 [128, 40, 210]: 128 >= 128 → 1 (equal counts as at-or-above), 40 < 128 → 0, 210 >= 128 → 1, giving [1, 0, 1].
- +1Assemble and count. The mask is [1,0,1], [0,1,0], [1,0,1]; the white (1) pixels are 200, 130, 255, 128 and 210 — that is 5 pixels.
Key terms
- Digital image
- A 2-D array of sample values x[n1, n2] with n1 the row (height) index and n2 the column (width) index, obtained by sampling a continuous image f(x, y) in space and quantizing it in amplitude. Each element is a pixel.
- Bit depth (quantization)
- The number of bits B per pixel, giving values 0 to 2^B - 1. The common 8-bit depth yields 0-255 where 0 is black and 255 is white; too few grey levels in smooth regions causes false contouring.
- Resolution
- An image's pixel dimensions N1 x N2 (total pixels N1 · N2). Showing a low-resolution image enlarged produces a blocky checkerboard/staircase effect from insufficient sampling.
- Colour channels
- A colour image stores three sample arrays for Red, Green and Blue; a grayscale image is a single channel; a binary image/mask is a single 0/1 channel. Print uses CMYK (four channels) and satellite imagery may use many spectral bands.
- Thresholding
- Turning a grayscale image into a binary one with a cutoff T: g(x, y) = 1 if f(x, y) >= T else 0. Simple (global) thresholding uses one T for the whole image; adaptive thresholding varies T to cope with uneven lighting.
- Image feature vector
- A numeric vector (from colour, gradients or metadata) summarising an image so it can be indexed and compared; image similarity search extracts the same features from a query image and finds the nearest vectors, paralleling TF-IDF cosine search for text.
Image Data Processing FAQ
How is a digital image represented as data?
As a 2-D array of pixels x[n1, n2], where n1 indexes the row and n2 the column, produced by sampling a continuous image in space and quantizing its intensity in amplitude. Each pixel's value is an unsigned integer set by the bit depth — commonly 8-bit, so 0 (black) to 255 (white). A colour image is three such arrays (R, G, B), and resolution N1 x N2 is the pixel grid size. To a computer an image is 'just a 2-D array of numbers', which is what makes computer vision hard.
What is the difference between simple and adaptive thresholding?
Both convert grayscale to binary with the rule g = 1 if f >= T else 0. Simple (global) thresholding uses a single cutoff T for the entire image and works well when lighting is consistent and the foreground stands out clearly from the background. Adaptive thresholding varies T across the image, so it stays accurate when illumination is uneven — for example a document photographed with a shadow across one side.
How does image similarity search relate to text similarity?
Both turn the object into a vector and compare vectors. For images you extract a feature vector (from colour, gradients or metadata) per image, index them, and for a query image extract its vector the same way and find the nearest ones — close vectors mean visually similar images. This mirrors representing documents as TF-IDF vectors and comparing them with cosine similarity: the shared idea is mapping content into a vector space where 'similar' becomes 'nearby'.
Can AI help me with image processing in DATA2001?
Yes. Sia can explain image representation and bit depth, work a thresholding or segmentation example, describe filtering and histograms, and connect feature vectors to similarity search, checking your masks and counts. Practise on a small pixel patch. It is a study aid and does not do graded assessment; the University of Sydney academic-integrity policy applies.
Exam move
Image data is mostly conceptual with a couple of small calculations, so anchor on representation and thresholding. Be able to describe a digital image as x[n1, n2], explain sampling vs quantization, and state the 8-bit range (0 black to 255 white) and what resolution and bit depth control (checkerboarding and false contouring). Practise the one computation that appears: apply a global threshold to a small patch and produce the binary mask, watching the inclusive boundary at T, and know when adaptive thresholding is needed instead. Know the image types (binary/grayscale/colour/multi-band), lossy vs lossless formats, the low/mid/high output levels, and how a feature vector enables similarity search — tying image back to the text chapter's vector-space idea and closing the data-variety arc. Ask Sia to set fresh thresholding drills and check your masks; confirm exam details on Canvas.
Working through Image Data Processing in DATA2001? Sia is AskSia’s AI Data Science tutor — ask any DATA2001 Image Data Processing question and get a clear, step-by-step explanation grounded in how DATA2001 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.