Q10Digital Image Processing
Question
Q.5. (a) Discuss image segmentation based on global thresholding. [8]
(b) Explain the fundamentals of edge-based segmentation. [8]
Answer
Global thresholding segments an image by classifying every pixel as foreground or background based on a single intensity threshold, with Otsu's method providing an automatic, optimal threshold by maximizing between-class variance; edge-based segmentation instead detects intensity discontinuities using gradient or Laplacian operators and links the resulting edge pixels into closed object boundaries.
(a) Segmentation Based on Global Thresholding
Global thresholding is one of the simplest and most widely used image segmentation techniques. A single threshold value T is chosen for the entire image, and every pixel is classified into one of two classes purely based on comparing its intensity to this threshold: pixels with intensity greater than T are labeled as foreground (object), and pixels with intensity less than or equal to T are labeled as background (or vice versa, depending on convention).
Global thresholding works well and produces clean segmentation results specifically when the image's gray-level histogram is clearly bimodal, meaning it exhibits two well-separated peaks, one corresponding to the population of object pixels and the other corresponding to the population of background pixels, with a clear valley (low-density region) between them where the threshold T can be placed to cleanly separate the two populations.
Otsu's method is a widely used algorithm for automatically and optimally choosing the global threshold value T, without requiring manual selection. It works directly on the image histogram, treating the choice of T as splitting all pixels into two classes (below and above T), and computes, for every possible candidate threshold value, the between-class variance, a quantity that measures how well-separated the mean intensities of the two resulting classes are, weighted by the proportion of pixels falling into each class. Otsu's method searches over all possible threshold values and selects the one that maximizes this between-class variance (equivalently, this also minimizes the within-class variance of the two resulting classes), since a threshold that maximizes the separation between the two classes' means, relative to their sizes, produces the cleanest possible bimodal split of the histogram into two distinct populations. This makes Otsu's method fully automatic, statistically grounded, and one of the most commonly used approaches for global threshold selection in practical image segmentation applications.
(b) Fundamentals of Edge-Based Segmentation
Edge-based segmentation approaches the segmentation problem from a fundamentally different angle than thresholding: rather than classifying pixels based on absolute intensity values, it detects discontinuities in intensity, i.e., edges, which typically mark the true boundaries between distinct objects or regions in the image, and then uses these detected edges to delineate segmented regions.
Edge detection is commonly performed using first-derivative (gradient-based) operators such as the Sobel, Prewitt, or Roberts operators. These operators are small convolution masks that approximate the local intensity gradient (rate of change) at each pixel in both the horizontal and vertical directions; the gradient magnitude is large wherever there is a rapid, significant change in intensity (an edge) and small in flat, uniform regions. Edges detected using these gradient-based operators are typically identified as local maxima of the gradient magnitude, i.e., pixels where the rate of intensity change peaks relative to their immediate surroundings. Alternatively, edges can be detected using the Laplacian operator, a second-derivative-based approach; since the second derivative crosses through zero exactly at the location of an intensity edge (having opposite signs on either side of the edge), edges detected via the Laplacian are identified as zero-crossings of the second-derivative response, an approach that tends to give more precisely localized edge positions but is also more sensitive to noise than gradient-based first-derivative methods.
Because edge detection operators typically produce a scattered set of individual edge pixels rather than clean, continuous, closed boundaries (due to noise, weak gradients along parts of a true boundary, or other imperfections), an additional edge linking step is required to connect these individual edge pixels into meaningful, continuous boundary curves suitable for segmentation. Local edge-linking techniques examine each detected edge pixel's immediate neighborhood and connect it to nearby edge pixels that have similar gradient magnitude and, importantly, similar gradient direction (since pixels along the same true boundary tend to share a consistent edge orientation), progressively building up connected boundary segments. Global edge-linking techniques, such as the Hough transform, instead work by mapping edge pixels into a parameter space (for example, a slope-intercept or angle-radius parameter space for detecting straight lines, or analogous parameter spaces for detecting circles or other parametric curves) and identifying strong accumulator peaks in that parameter space, which correspond to sets of edge pixels that are collinear (or otherwise consistent with a particular parametric curve shape), even if those pixels are not immediately adjacent to each other in the original image; this makes the Hough transform particularly robust to gaps and noise in the raw edge-detection output. Once edges are reliably linked into complete, closed boundary curves, these boundaries directly define the segmented regions of the image.
The Sobel operator uses a pair of 3x3 masks approximating horizontal and vertical gradients Gx and Gy, incorporating built-in smoothing that makes it more robust to noise than the simpler, equally-weighted Prewitt masks; the Roberts operator uses smaller 2x2 diagonal-difference masks, making it computationally cheap but more sensitive to noise. The gradient magnitude at each pixel is typically computed as sqrt(Gx^2 + Gy^2), or approximated as |Gx| + |Gy| for computational speed, and compared against a threshold to decide whether the pixel qualifies as an edge. Edge-based segmentation is particularly effective for images containing objects with strong, well-defined boundaries against a relatively uniform background, but can struggle in the presence of heavy noise (which introduces many spurious weak edges) or low-contrast boundaries (which fail to produce a strong enough gradient response to be reliably detected), situations where region-based methods such as thresholding or the watershed transform may perform more robustly.
In practice, global thresholding performs poorly when an image exhibits non-uniform illumination across its extent (such as a scene lit unevenly by a single light source), since a single global threshold value cannot simultaneously correctly separate foreground from background in both brightly-lit and dimly-lit regions of the same image - this limitation motivates adaptive (local) thresholding techniques, in which the threshold value is computed separately for each local neighborhood or region of the image (based on the local mean and/or standard deviation of intensity within that neighborhood), allowing the effective threshold to adapt to slowly-varying illumination conditions across the image while still providing the same basic simplicity and computational efficiency advantages of the thresholding approach within each local region.