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.
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
| Operator | Description |
|---|---|
| Sobel | Detects horizontal & vertical edges |
| Prewitt | Simple gradient-based |
| Roberts | Fast but noise sensitive |
| Canny | Best, 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
| Shape | Application |
|---|---|
| Lines | Road detection |
| Circles | Coin 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
| Type | Explanation |
|---|---|
| Global | One threshold for whole image |
| Local | Different thresholds |
| Adaptive | Threshold 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
| Advantage | Disadvantage |
|---|---|
| Accurate | Sensitive to noise |
| Simple | Needs 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
| Aspect | Splitting | Merging |
|---|---|---|
| Direction | Top‑down | Bottom‑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
| Advantage | Disadvantage |
|---|---|
| Precise | Over‑segmentation |
| Good for medical images | Noise sensitive |
Overall Comparison Table
| Method | Based On | Best For |
|---|---|---|
| Edge Detection | Intensity change | Shape detection |
| Thresholding | Pixel value | Simple images |
| Region Growing | Similarity | Medical images |
| Watershed | Topography | Complex objects |
Exam Memory Tricks
- Edge → Boundary
- Threshold → Cutoff
- Region Growing → Seed
- Morphology → Shape
- Watershed → Flooding