Skip to content
matthewcm.dev

    ↑ ↓ move · ↵ open · tab scopeopen graph →

    Image Analysis Fundamentals

    My 2021 university notes on image processing, histograms and pattern recognition, distilled: images as intensity functions, contrast stretching, features and classes. The vocabulary underneath modern computer vision.

    Growingtended planted 2 min read
    On this page

    In spring 2021, in my final year at university, I published three posts from an image analysis module: how images are represented, histogram analysis, and pattern recognition. They were revision notes written in public. This is the distilled version, with what I’d add now that deep learning does most of this work.

    Images are functions

    A greyscale image is a 2D function f(x, y) giving an intensity at each pixel, typically 0 (black) to 255 (white) for 8 bits. Two numbers describe it: N, the spatial resolution (how many pixels), and G, the number of grey levels (how finely intensity is quantised). Too few of either and detail disappears. Colour images are just several of these functions stacked, one per channel.

    The biology framing in my notes still helps: the eye has rods for dim, black-and-white vision and cones for colour, and computer vision tries to imitate a pipeline of simple components that together detect meaningful features.

    Histograms tell you about an image before you look

    A grey-level histogram counts how many pixels have each intensity. You can guess an image’s character from it: bunched to the left is dark, bunched to the right is bright, a narrow spike is low contrast.

    Contrast stretching spreads a narrow range of intensities across the full range available. Histogram equalisation is the common way to do it: map intensities so the cumulative distribution becomes roughly uniform, bringing out detail in images that use only part of the range. My original post walked through it in Python with NumPy and matplotlib on a tiny 6×6 array, which is still the clearest way to see what’s happening.

    Pattern recognition: features and classes

    Pattern recognition is about naming the category an object belongs to from measurements of it:

    • A pattern is described by a feature vector: measurable characteristics such as area, edges, texture or colour.
    • A pattern class is a category whose members share common attributes. The same object can belong to different classes depending on what you care about.
    • Classification maps feature vectors to classes, with anything from simple distance rules to statistical classifiers.

    The classic applications in my notes (medical imaging, text recognition, self-driving cars) are all now dominated by deep learning.

    What I’d add in 2026

    The biggest change is who designs the features. In 2021 the module taught hand-crafted features: edge detectors, histograms, morphological operations. Convolutional networks, and now vision transformers, learn their own features from data, and often learn ones humans wouldn’t have thought of (Deep Learning).

    The fundamentals still matter, though. Pre-processing, normalisation and knowing what your input actually looks like still decide whether a model works. And histograms remain the fastest sanity check on any dataset, images or not.

    These notes sit alongside my other university material on Machine Learning and the research in my dissertation (Pathways into Cybercrime).


    Originally written in 2021 → Image Analysis - Image Processing, Histogram Analysis and Pattern Recognition

    • #image-analysis
    • #computer-vision
    • #pattern-recognition
    • #histograms
    • #university

    ↪ Links to (3)