Image Segmentation



Image Segmentation

Image Segmentation is the process of dividing an image into meaningful parts (regions or objects) so that each part becomes easier to analyze.

Image Segmentation

Instead of looking at the whole image, we break it into useful segments.

Simple Real‑Life Analogy

  • Cutting a vegetable into pieces before cooking
  • Dividing a map into states or districts

Purpose of Segmentation

  • Object detection
  • Medical diagnosis
  • Face recognition
  • Satellite image analysis

Edge Detection

An edge is a place in an image where there is a sudden change in intensity (brightness). Example: Boundary between a face and background.

Why Edge Detection?

Edges represent:

  • Object boundaries
  • Shape information

Common Edge Detection Methods

OperatorDescription
SobelDetects horizontal & vertical edges
PrewittSimple gradient-based
RobertsFast but noise sensitive
CannyBest, multi-stage, accurate

Real-Life Example: Like outlining an object with a black marker to highlight its shape.

Edge Linking using Hough Transform

Problem: Edge detection gives broken edges.

Solution: Hough Transform

It connects edge points to detect lines, circles, curves.

Simple Explanation: Instead of working in image space, Hough Transform works in parameter space.

Line Equation: x cosθ + y sinθ = ρ

Uses

ShapeApplication
LinesRoad detection
CirclesCoin detection

Real-Life Example: Connecting dotted lines to form a complete road on a map.

Thresholding

Thresholding converts a grayscale image into a binary image.

Basic Rule

If pixel value ≥ T → Object (white)
If pixel value < T → Background (black)

Types of Thresholding

TypeExplanation
GlobalOne threshold for whole image
LocalDifferent thresholds
AdaptiveThreshold varies automatically

Real-Life Example: Like deciding pass/fail using a cutoff mark.

Region-Based Segmentation

Groups pixels into regions based on similar properties.

Properties Used

  • Intensity
  • Texture
  • Color

Analogy: Grouping students by same class or section.

Region Growing

What is Region Growing?

Starts with a seed point and grows region by adding similar neighboring pixels.

Steps

  • Select seed pixel
  • Compare neighbors
  • Add similar pixels
  • Stop when no match

Advantages & Disadvantages

AdvantageDisadvantage
AccurateSensitive to noise
SimpleNeeds seed selection

Real-Life Example: Spreading ink on paper from one drop.

Region Splitting and Merging

Idea: Uses divide and conquer strategy.

Splitting

  • Divide image into smaller regions
  • Stop when regions are homogeneous

Merging

  • Merge adjacent similar regions

Comparison

AspectSplittingMerging
DirectionTop‑downBottom‑up

Real-Life Example: Breaking land into plots, then combining similar plots.

Morphological Processing

Based on shape and structure of objects using a structuring element.

Used mostly on binary images.

Erosion

Erosion shrinks objects by removing boundary pixels.

Effect

  • Removes small noise
  • Breaks thin connections

Analogy: Rust eating away metal edges.

Dilation

Dilation expands objects by adding pixels to boundaries.

Effect

  • Fills holes
  • Connects broken parts

Analogy: Inflating a balloon.

Segmentation using Morphological Watersheds

Image is treated as a topographic surface:

  • Bright pixels → Hills
  • Dark pixels → Valleys

Water fills valleys and boundaries are formed → segmentation.

Dam Construction (Watershed Concept)

When water from two valleys is about to merge, dams are built.

These dams form segmentation boundaries.

Real-Life Example: Building dams to prevent river flooding.

Watershed Segmentation Algorithm

Steps

  • Convert image to gradient
  • Find local minima
  • Flood regions from minima
  • Build dams at meeting points
  • Final dams → segment boundaries

Advantages & Disadvantages

AdvantageDisadvantage
PreciseOver‑segmentation
Good for medical imagesNoise sensitive

Overall Comparison Table

MethodBased OnBest For
Edge DetectionIntensity changeShape detection
ThresholdingPixel valueSimple images
Region GrowingSimilarityMedical images
WatershedTopographyComplex objects

Exam Memory Tricks

  • Edge → Boundary
  • Threshold → Cutoff
  • Region Growing → Seed
  • Morphology → Shape
  • Watershed → Flooding