Preprocessing - Filtering: edge detection Flashcards
What is an edge?
An edge is defined by a set of contiguous pixel positions where the gradient in one direction is high whereas the gradient in the orthogonal direction is low.
Eine Kante wird durch eine Reihe von zusammenhängenden Pixelpositionen definiert, bei denen der Kontrast in einer Richtung hoch ist, während der Gradient in der orthogonalen Richtung niedrig ist.
Properties:
• Related to object boundaries, patterns (e.g. brickwall), shadows, …
• Discontinuity in intensity values (due to varying depth, surface orientation, material properties, scene illumination)
• Property attached to each pixel
• Calculated using the image intensities of neighboring pixels
What are the edge detection steps?
- Filtering:
• edge detectors: based on intensity values of a small neighborhood of points
• susceptible to noise
• filtering improves the performance of the edge detector w.r.t. noise
• trade-off between edge strength and noise reduction - Enhancement:
• computes the change in local intensity values
• e.g. by computing the gradient magnitude - Detection:
• not all points with non-zero gradient are edges
• determines which points are edge points, e.g. by thresholding - Localization:
• If required: estimation of the location of the edge with subpixel resolution
• Or estimation of the edge orientation
How can the intensity changes be computed?
Gradient-based edge detectors • partial derivative in x • partial derivative in y • maximum gradient amplitude Laplacian edge detectors • second derivative • zero-crossings
What does the gradient vector of a gradient-based edge detection show?
Points in the direction of the maximum change.
How is gradient-based edge detection implemented?
Discrete world: differentiation is approximated by finite differencing
Use two consecutive rows/columns to make it less susceptible to noise:
Note: these kernels evaluate an approximation of the derivative at half-pixel locations, Ix(x−1/2, y) and Iy(x, y − 1/2).
Algorithm
- computeix =gx ⊗i
- computeiy =gy ⊗i
- compute ∥∇ii, j∥ for all pixels (i, j) using your favorite method
- apply a threshold ∥∇ii, j∥≥θ to detect edge pixels (edgels)
- compute the orientation α of the edge pixels
What does Canny-Edge-Detection?
• Post-processing: optimizes gradient-based edge images
• Slower than basic gradient-based edge detectors due to optimization post-processing
• Systematically cleans noise effects
• Two separate optimization processes:
1. Non-maximum suppression
• A single real edge may appear as having wide ridges around it.
• Non-maximum suppression thins such ridges down to 1-pixel wide edges.
2. hysteresis thresholding: Strong (high) & weak (low) thresholds
• Accept all pixels > strong threshold
• Potential edgels: pixels > weak threshold
• Accept those edgels connected to strong thresholds
step 1: conversion to grayscale
step 2: smoothing with a Gaussian filter (σ = 2)
step 3: Sobel gradient in x direction
step 3: Sobel gradient in y direction
step 3: magnitude of the Sobel gradient
step 4: discretizing edges into four groups based on their
step 5: non-maximum suppression
step 6: hysteresis: θlow = 50, θhigh = 150 orientation
What is the Laplacian Edge Detection?
- Another way to detect the extrema of the first derivative: zero-crossings of the second derivative
- Result of the Laplacian is scalar
- Magnitude of the change of a bivariate function
- No edge orientation information
Notes:
• negative values on one side of the edge
• positive values on the other side of the edge
• Solution:
- smooth the image with a Gaussian filter gGauss
- apply the Laplacian filter gLaplace
How can a Image Hierarchy with Different Levels of Detail be created?
by using different degrees of smoothing:
• e.g.Gaussian with different σ values
• kernels of different sizes, i.e. 3×3, 5×5, 7×7, …
Design decisions:
• Kernelsize:
• no single good size
• depends on the size of the objects in the image
• Speed vs .accuracy:
• Gaussian vs. median, gradient-based vs. Laplacian-based, Canny vs. Sobel
Systematic approach: try different resolutions
• Create formal model for each resolution & study change of model at different resolutions
• Or maintain pyramid of images at different resolutions
What is sharpening?
Common filtering operation for contrast enhancement
Goal: visually more pleasant image
• texture and finer details more prominent
• image looks sharper, crisper
- Improving image parts where sudden intensity change occurs because here inaccuracies introduced by digital data capturing process
- Edge detectors: filtering operation give high response at sudden intensity changes
- Simple way of sharpening: superimpose the original image with edge magnitude image
What is the Unsharp Mask doing?
- Widely used by image processing software packages
- Based on old photographic film technique
- Called unsharp masking, because it first blurs/unsharpens the image
add the difference to from the smoothed edge to the original edge