Lecture 5 - Edges Flashcards
(29 cards)
What is the goal of edge detection?
Identify sudden changes (discontinuities) in an image
– Intuitively, most semantic and shape information from the image can be encoded in the edges
What are the factors to determine edges (what causes a physical edge)?
Surface Normal Discontinuity
Depth Discontinuity
Surface Colour Discontinuity
Illumination Discontinuity
What is an edge?
An edge is defined as a location in an image where there is a sudden change in intensity or pixel value or a sharp change in brightness
How do we detect an edge?
Edge detection is achieved by detecting:
* Local maxima/minima in the first derivative (gradient).
* Zero-crossings in the second derivative (e.g., Laplacian of Gaussian).
Differentiation approximates rate of change, implemented with derivative filters.
What is the basic idea of edge detection?
Look for a neighborhood with strong signs of change.
Problems:
– Neighborhood size
– How to detect change
Differential operators:
– Attempt to approximate the gradient at a pixel via masks.
– Threshold the gradient to select the edge pixels.
What are the characteristics of an edge?
Edge models/types:
– Step
– Ramp
– Roof
What are the main steps in edge detection?
1) Smoothing: suppress as much noise as possible, without destroying true edges.
2) Enhancement: apply differentiation to enhance the quality of edges (i.e., sharpening)
3) Thresholding: determine which edge pixels should be discarded as noise and which should be retained (i.e., threshold edge magnitude).
4) Localization: determine the exact edge location.
How are derivatives used in edge detection?
An image is a 2D function, so operators describing edges are expressed using partial derivatives.
Points which lie on an edge can be detected by either:
– detecting local maxima or minima of the first derivative
– detecting the zero-crossing of the second derivative
REFER TO SLIDES FOR EXAMPLES
What is Image Gradient?
A combination of the partial functions of x and y to create one image
REFER TO SLIDES
How do you differentiate a digital image?
– Option 1: reconstruct a continuous image, f, then compute the derivative
– Option 2: take discrete derivative (finite difference)
REFER TO SLIDES FOR FORMULA
What are the 3 types of discrete derivatives in 1D?
Backward: H = [0, 1, -1]
Forward: H = [-1, 1, 0]
Central: H = [1/2, 0 , -1/2]
Where derivative kernels sum to 0
REFER TO SLIDES FOR FORMULAS AND EXAMPLE (31 - 38)
2D Derivative Filters
REFER TO SLIDES
What is the effect of noise?
Finite difference filters respond strongly to noise
– Image noise results in pixels that look very different from their neighbors
– Generally, the larger the noise the stronger the response
What can be done to reduce noise?
– Smoothing the image should help, by forcing pixels different to their neighbors to look more like neighbors
In other words smooth first
REFER TO SLIDES (includes convolution and gaussian)
What is Gradient of Gaussian (GoG)?
- GoG: Gradient of Gaussian
○ Smooth the image, then apply derivative.
○ Equivalent to convolving image with derivative of Gaussian.
What is Laplacian of Gaussian (LoG)
Highlights regions of rapid intensity change in an image, which are often associated with edges.
○ Second derivative filter.
○ Detects zero-crossings after smoothing.
What is the tradeoff between smoothening imags at different scales (Trade-off in 1D: localization vs noise immunity)?
- Accurate localization: requires less smoothing → sensitive to noise.
- Noise immunity: requires more smoothing → blurs edges.
There is a trade-off: choose σ depending on application needs.
What are the criteria for an optimal edge detector?
- Good detection: Low false positives/negatives.
- Good localization: Detected edge is close to true edge.
- Single response: One response per edge.
What is Sobel operator?
Uses two 3×3 kernels which are convolved with the original image to calculate approximations of the derivatives
One for horizontal changes, and one for vertical
- It involves smoothing + differentiation
REFER TO SLIDES FOR FORMULAS AND EXAMPLES
What are the masks of the sobel operator?
Gx
[-1 0 1]
[-2 0 2]
[-1 -2 1]
Gy
[1 2 1]
[0 0 0]
[-1 -2 -1]
What are some problems with the Sobel filter (operator)?
Poor Localization (Trigger response in multiple adjacent pixels)
Thresholding value favors certain directions over others
– Can miss oblique edges more than horizontal or vertical edges
– False negatives
What is the Canny edge detector?
The Canny edge detector is an edge detection operator that uses a multistage algorithm to detect a wide range of edges in images.
What is the process of the Canny edge detector?
- Filter image with x, y derivatives of Gaussian
- Find magnitude and orientation of gradient
- Non-maximum suppression:
- Thin multi-pixel wide “ridges” down to single pixel width - Thresholding and linking (hysteresis):
- Define two thresholds: low and high
- Use the high threshold to start edge curves and the low threshold to continue them
REFER TO SLIDES FOR STEP THROUGH
What is the effect of sigma in the Canny edge detector?
- Large σ: more smoothing → captures large-scale edges, misses fine details.
- Small σ: less smoothing → sensitive to fine details but may detect noise.