Distance Measures

Duration: 12 min

This video lesson is available to enrolled students.

Enroll to watch — UPPSC Polytechnic Lecturer 2025 (CS)

AI Summary

An AI-generated summary of this video lecture.

This lecture introduces distance measures in image processing, which are mathematical functions used to calculate the distance between two pixels. The instructor establishes that a valid distance metric must satisfy three fundamental properties: non-negativity, symmetry, and the triangle rule. Non-negativity ensures distance is always greater than or equal to zero, being zero only for the same pixel. Symmetry dictates that the distance from point p to q equals the distance from q to p. The triangle rule states that the direct distance between two points is never greater than the path going through a third point. The lecture then categorizes four common distance measures: Euclidean Distance (De), City-Block Distance (D4), Chessboard Distance (D8), and m-Distance (Dm). Euclidean distance represents the straight-line path, while City-Block measures horizontal and vertical movement only. Chessboard distance allows diagonal movement as well, defined by the maximum of coordinate differences. Finally, m-Distance is introduced as a value-dependent metric where the shortest path length relies on m-adjacency and specific pixel values rather than just geometric coordinates.

Chapters

  1. 0:00 2:00 00:00-02:00

    The lecture begins by defining distance measures as tools to calculate the separation between two pixels in image processing. The instructor presents a slide titled '3. Distance Measures' which lists the three essential properties of any distance metric: non-negativity, symmetry, and the triangle rule. On-screen text explicitly states that distance is always greater than or equal to zero, and equals zero only when comparing a pixel to itself. The symmetry property is defined as the distance from p to q being equal to the distance from q to p. The triangle rule is described as the principle that direct distance is never greater than going through another pixel. This section establishes the theoretical foundation required before introducing specific calculation methods.

  2. 2:00 5:00 02:00-05:00

    The instructor transitions to listing the four common types of distance measures used in image analysis. The slide displays 'Common Distance Measures' followed by Euclidean Distance (De), City-Block Distance (D4), Chessboard Distance (D8), and m-Distance (Dm). The lecture provides the mathematical formula for Euclidean Distance as De(p, q) = sqrt((x - s)^2 + (y - t)^2), identifying it as the straight-line distance between two points. City-Block Distance is introduced next, defined by horizontal and vertical movement only, often referred to as Manhattan distance. The instructor highlights these formulas in black boxes on the slide, emphasizing their geometric interpretations where Euclidean represents a direct line and City-Block represents movement along grid axes.

  3. 5:00 10:00 05:00-10:00

    The lecture details Chessboard Distance (D8) and m-Distance (Dm). The formula for D8 is shown as max(|x - s|, |y - t|), allowing movement in horizontal, vertical, and diagonal directions. This creates a square shape for pixels at the same distance from a center point. The instructor explains that D8 considers 8-neighbors of a pixel. A significant distinction is made for m-Distance, where the slide notes that unlike D4 and D8 which depend only on coordinates, Dm depends on m-adjacency. The definition states that the Dm distance is the length of the shortest m-path between points, which requires checking intermediate pixel values to determine valid paths rather than just calculating geometric coordinates.

  4. 10:00 11:31 10:00-11:31

    The final segment provides a concrete example of m-Distance using a 3x3 grid to demonstrate path dependency. The slide shows four cases analyzing the distance between pixels P and P4 based on whether intermediate pixels p2 and p3 are 0 or 1. The text highlights that Dm depends on the valid m-path between pixels, not just their positions. Case (1) is shown where if p3 = 0 and p2 = 0, the path length changes. The instructor contrasts this value-based dependency with the coordinate-only nature of Euclidean and City-Block distances. The lecture concludes by reiterating the formulas for De and D4, reinforcing that while Euclidean measures straight lines and City-Block measures grid-aligned paths, m-Distance is unique in its reliance on pixel values for path validity.

The lecture systematically builds the concept of distance measures starting from abstract properties to concrete formulas. The progression moves from defining non-negativity, symmetry, and the triangle rule as mandatory conditions for any metric. It then introduces geometric metrics like Euclidean (De) and City-Block (D4), which rely solely on pixel coordinates. The complexity increases with Chessboard Distance (D8) and m-Distance (Dm). D8 expands movement to include diagonals, while Dm introduces a critical distinction: it is not purely geometric but depends on m-adjacency and pixel values. The example of the 3x3 grid illustrates that valid paths in m-Distance are constrained by intermediate pixel states, making it a value-dependent metric unlike the coordinate-only Euclidean or City-Block measures. This distinction is vital for image processing tasks where connectivity and pixel values influence distance calculations.