0
0
Computer Visionml~12 mins

Edge detection (Canny) in Computer Vision - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - Edge detection (Canny)

The Canny edge detection pipeline finds edges in images by smoothing, finding gradients, and selecting strong edges. It helps computers see outlines like we do.

Data Flow - 6 Stages
1Input Image
1 image x 256 height x 256 width x 1 channel (grayscale)Original grayscale image loaded1 image x 256 x 256 x 1
A photo of a cat in grayscale
2Gaussian Blur
1 image x 256 x 256 x 1Smooth image to reduce noise using Gaussian filter1 image x 256 x 256 x 1
Blurred cat image with less sharp noise
3Gradient Calculation
1 image x 256 x 256 x 1Calculate intensity change (gradient magnitude and direction) using Sobel filters1 image x 256 x 256 x 2 (magnitude and angle)
Gradient map showing edges' strength and direction
4Non-Maximum Suppression
1 image x 256 x 256 x 2Thin edges by keeping only local maxima in gradient direction1 image x 256 x 256 x 1 (thinned edges)
Thin lines highlighting strongest edges
5Double Threshold
1 image x 256 x 256 x 1Classify edges as strong, weak, or non-edges using two thresholds1 image x 256 x 256 x 1 (edge classification)
Strong edges in white, weak edges in gray, others black
6Edge Tracking by Hysteresis
1 image x 256 x 256 x 1Keep weak edges connected to strong edges, discard others1 image x 256 x 256 x 1 (final edge map)
Clear edge outlines of the cat
Training Trace - Epoch by Epoch
Loss
0.5 |****
0.4 |***
0.3 |**
0.2 |*
0.1 | 
    +---------
    Epochs 1-5
EpochLoss ↓Accuracy ↑Observation
10.450.60Initial edge detection with many false edges
20.300.75Better edge clarity after tuning thresholds
30.200.85Edges are sharper and noise reduced
40.150.90Strong edges well detected, weak edges properly filtered
50.120.92Converged to stable edge detection performance
Prediction Trace - 6 Layers
Layer 1: Input Image
Layer 2: Gaussian Blur
Layer 3: Gradient Calculation
Layer 4: Non-Maximum Suppression
Layer 5: Double Threshold
Layer 6: Edge Tracking by Hysteresis
Model Quiz - 3 Questions
Test your understanding
What is the main purpose of the Gaussian Blur step in Canny edge detection?
ATo classify edges as strong or weak
BTo find the gradient direction
CTo reduce noise and smooth the image
DTo thin the edges to one pixel
Key Insight
Canny edge detection works by carefully smoothing, finding gradients, and selecting edges with thresholds. This step-by-step process helps computers find clear edges like humans do, improving with tuning and iteration.