Edge Detection
description
Transcript of Edge Detection
![Page 1: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/1.jpg)
Edge Detection
CS485/685 Computer Vision
Dr. George Bebis
![Page 2: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/2.jpg)
Definition of Edges
• Edges are significant local changes of intensity in an image.
![Page 3: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/3.jpg)
What Causes Intensity Changes?• Geometric events
– surface orientation (boundary) discontinuities– depth discontinuities– color and texture discontinuities
• Non-geometric events– illumination changes– specularities– shadows– inter-reflections
depth discontinuity
color discontinuity
illumination discontinuity
surface normal discontinuity
![Page 4: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/4.jpg)
Goal of Edge Detection
• Produce a line “drawing” of a scene from an image of that scene.
![Page 5: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/5.jpg)
Why is Edge Detection Useful?
• Important features can be extracted from the edges of an image (e.g., corners, lines, curves).
• These features are used by higher-level computer vision algorithms (e.g., recognition).
![Page 6: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/6.jpg)
Effect of Illumination
![Page 7: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/7.jpg)
Edge Descriptors
• Edge direction: perpendicular to the direction of maximum intensity change (i.e., edge normal)
• Edge strength: related to the local image contrast along the normal.
• Edge position: the image position at which the edge is located.
![Page 8: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/8.jpg)
Modeling Intensity Changes
• Step edge: the image intensity abruptly changes from one value on one side of the discontinuity to a different value on the opposite side.
![Page 9: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/9.jpg)
Modeling Intensity Changes (cont’d)
• Ramp edge: a step edge where the intensity change is not instantaneous but occur over a finite distance.
![Page 10: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/10.jpg)
Modeling Intensity Changes (cont’d)
• Ridge edge: the image intensity abruptly changes value but then returns to the starting value within some short distance (i.e., usually generated by lines).
![Page 11: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/11.jpg)
Modeling Intensity Changes (cont’d)
• Roof edge: a ridge edge where the intensity change is not instantaneous but occur over a finite distance (i.e., usually generated by the intersection of two surfaces).
![Page 12: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/12.jpg)
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).
![Page 13: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/13.jpg)
Main Steps in Edge Detection (cont’d)
(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.
sub-pixel resolution might be required for some applications to estimate the location of an edge to better than the spacing between pixels.
![Page 14: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/14.jpg)
Edge Detection Using Derivatives
• Often, points that lie on an edge
are detected by:
(1) Detecting the local maxima or
minima of the first derivative.
(2) Detecting the zero-crossings
of the second derivative.2nd derivative
1st derivative
![Page 15: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/15.jpg)
Image Derivatives
• How can we differentiate a digital image?
– Option 1: reconstruct a continuous image, f(x,y), then compute the derivative.
– Option 2: take discrete derivative (i.e., finite differences)
Consider this case first!
![Page 16: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/16.jpg)
Edge Detection Using First Derivative
ramp edge
roof edge
(upward) step edge
(downward) step edge
(centered at x)
1D functions(not centered at x)
![Page 17: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/17.jpg)
Edge Detection Using Second Derivative
• Approximate finding maxima/minima of gradient magnitude by finding places where:
• Can’t always find discrete pixels where the second derivative is zero – look for zero-crossing instead.
![Page 18: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/18.jpg)
Replace x+1 with x (i.e., centered at x):
1D functions:
(centered at x+1)
Edge Detection Using Second Derivative (cont’d)
![Page 19: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/19.jpg)
Edge Detection Using Second Derivative (cont’d)
![Page 20: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/20.jpg)
Edge Detection Using Second Derivative (cont’d)
(upward) step edge
(downward) step edge
ramp edge
roof edge
![Page 21: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/21.jpg)
Edge Detection Using Second Derivative (cont’d)
• Four cases of zero-crossings:
{+,-}, {+,0,-},{-,+}, {-,0,+}
• Slope of zero-crossing {a, -b} is: |a+b|.
• To detect “strong” zero-crossing, threshold the slope.
![Page 22: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/22.jpg)
Effect Smoothing on Derivates
Where is the edge??
![Page 23: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/23.jpg)
Effect of Smoothing on Derivatives (cont’d)
![Page 24: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/24.jpg)
Combine Smoothing with Differentiation
(i.e., saves one operation)
![Page 25: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/25.jpg)
Mathematical Interpretation of combiningsmoothing with differentiation
• Numerical differentiation is an ill-posed problem. - i.e., solution does not exist or it is not unique or it does not depend continuously on initial data)
• Ill-posed problems can be solved using “regularization”- i.e., impose additional constraints
• Smoothing performs image interpolation.
![Page 26: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/26.jpg)
Edge Detection Using First Derivative (Gradient)
• The first derivate of an image can be computed using the gradient:
2D functions:
f
![Page 27: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/27.jpg)
• The gradient is a vector which has magnitude and direction:
• Magnitude: indicates edge strength.
• Direction: indicates edge direction.– i.e., perpendicular to edge direction
| | | |f f
x y
or
(approximation)
Gradient Representation
![Page 28: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/28.jpg)
Approximate Gradient
• Approximate gradient using finite differences:
![Page 29: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/29.jpg)
Approximate Gradient (cont’d)
• Cartesian vs pixel-coordinates:
- j corresponds to x direction
- i to -y direction
![Page 30: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/30.jpg)
Approximate Gradient (cont’d)
sensitive to vertical edges!
sensitive to horizontal edges!
![Page 31: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/31.jpg)
Approximating Gradient (cont’d)
• We can implement and using the following masks:
(x+1/2,y)
(x,y+1/2)*
*
good approximationat (x+1/2,y)
good approximationat (x,y+1/2)
![Page 32: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/32.jpg)
Approximating Gradient (cont’d)
• A different approximation of the gradient:
• and can be implemented using the following masks:
*
(x+1/2,y+1/2)good approximation
![Page 33: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/33.jpg)
Another Approximation
• Consider the arrangement of pixels about the pixel (i, j):
• The partial derivatives can be computed by:
• The constant c implies the emphasis given to pixels closer to the center of the mask.
3 x 3 neighborhood:
![Page 34: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/34.jpg)
Prewitt Operator
• Setting c = 1, we get the Prewitt operator:
![Page 35: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/35.jpg)
Sobel Operator
• Setting c = 2, we get the Sobel operator:
![Page 36: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/36.jpg)
Edge Detection Steps Using Gradient
(i.e., sqrt is costly!)
![Page 37: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/37.jpg)
Example (using Prewitt operator)
Note: in this example, thedivisions by 2 and 3 in the computation of fx and fy are done for normalization purposes only
![Page 38: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/38.jpg)
Another Example
Idx
d
Idy
d
![Page 39: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/39.jpg)
Another Example (cont’d)
22d d
I Idx dy
100Threshold
![Page 40: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/40.jpg)
Isotropic property of gradient magnitude
• The magnitude of the gradient detects edges in all directions.
22d d
I Idx dy
Idx
d Idy
d
![Page 41: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/41.jpg)
Practical Issues
• Noise suppression-localization tradeoff.– Smoothing depends on mask size (e.g., depends on σ for
Gaussian filters).
– Larger mask sizes reduce noise, but worsen localization (i.e., add uncertainty to the location of the edge) and vice versa.
larger masksmaller mask
![Page 42: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/42.jpg)
Practical Issues (cont’d)
• Choice of threshold.gradient magnitude
low threshold high threshold
![Page 43: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/43.jpg)
Practical Issues (cont’d)
• Edge thinning and linking.
![Page 44: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/44.jpg)
Criteria for Optimal Edge Detection
• (1) Good detection– Minimize the probability of false positives (i.e., spurious edges).– Minimize the probability of false negatives (i.e., missing real
edges).
• (2) Good localization– Detected edges must be as close as possible to the true edges.
• (3) Single response– Minimize the number of local maxima around the true edge.
![Page 45: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/45.jpg)
Canny edge detector
• Canny has shown that the first derivative of the Gaussian closely approximates the operator that optimizes the product of signal-to-noise ratio and localization. (i.e., analysis based on "step-edges" corrupted by "Gaussian noise“)
J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986.
![Page 46: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/46.jpg)
Steps of Canny edge detector
![Page 47: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/47.jpg)
Steps of Canny edge detector (cont’d)
(and direction)
![Page 48: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/48.jpg)
Canny edge detector - exampleoriginal image
![Page 49: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/49.jpg)
Canny edge detector – example (cont’d)
Gradient magnitude
![Page 50: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/50.jpg)
Canny edge detector – example (cont’d)
Thresholded gradient magnitude
![Page 51: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/51.jpg)
Canny edge detector – example (cont’d)
Thinning (non-maxima suppression)
![Page 52: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/52.jpg)
Non-maxima suppression
• Check if gradient magnitude at pixel location (i,j)
is local maximum along gradient direction
![Page 53: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/53.jpg)
Non-maxima suppression (cont’d)
(i,j)
Warning: requires checking
interpolated pixels p and r
![Page 54: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/54.jpg)
Hysteresis thresholding• Standard thresholding:
- Can only select “strong” edges.- Does not guarantee “continuity”.
gradient magnitude low threshold high threshold
![Page 55: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/55.jpg)
Hysteresis thresholding (cont’d)
• Hysteresis thresholding uses two thresholds:
• For “maybe” edges, decide on the edge if neighboring pixel is a strong edge.
- low threshold tl
- high threshold th (usually, th = 2tl)
tl
tl
th
th
![Page 56: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/56.jpg)
Hysteresis thresholding/Edge Linking
Idea: use a highhigh threshold to start edge curves and a low low threshold to continue them.
Use edge“direction” forlinking edges
![Page 57: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/57.jpg)
Hysteresis Thresholding/Edge Linking (cont’d)
Note: large gaps are still difficult to bridge. (i.e., more sophisticated algorithms are required)
(using tl and th)
![Page 58: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/58.jpg)
Second Derivative in 2D: Laplacian
![Page 59: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/59.jpg)
Second Derivative in 2D: Laplacian (cont’d)
![Page 60: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/60.jpg)
Variations of Laplacian
![Page 61: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/61.jpg)
Laplacian - Example
detect zero-crossings
![Page 62: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/62.jpg)
Properties of Laplacian
• It is an isotropic operator.
• It is cheaper to implement than the gradient (i.e., one mask only).
• It does not provide information about edge direction.
• It is more sensitive to noise (i.e., differentiates twice).
![Page 63: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/63.jpg)
Laplacian of Gaussian (LoG) (Marr-Hildreth operator)
• To reduce the noise effect, the image is first smoothed.
• When the filter chosen is a Gaussian, we call it the LoG edge detector.
• It can be shown that:
σ controls smoothing
2σ2
(inverted LoG)
![Page 64: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/64.jpg)
Laplacian of Gaussian (LoG) - Example
filtering zero-crossings
(inverted LoG)(inverted LoG)
![Page 65: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/65.jpg)
Decomposition of LoG
• It can be shown than LoG can be written as follows:
• 2D LoG convolution can be implemented using 4, 1D convolutions.
2 ( , )g x y
2 ( , )* ( , )g x y I x y
![Page 66: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/66.jpg)
Decomposition of LoG (cont’d)
Steps
![Page 67: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/67.jpg)
Difference of Gaussians (DoG)• The Laplacian of Gaussian can be approximated by the
difference between two Gaussian functions:
approximationactual LoG
![Page 68: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/68.jpg)
Difference of Gaussians (DoG) (cont’d)
(a) (b) (b)-(a)
![Page 69: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/69.jpg)
Gradient vs LoG
• Gradient works well when the image contains sharp intensity transitions and low noise.
• Zero-crossings of LOG offer better localization, especially when the edges are not very sharp.
step edge
ramp edge
![Page 70: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/70.jpg)
Gradient vs LoG (cont’d)
LoG behaves poorly at corners
![Page 71: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/71.jpg)
Directional Derivative
• The partial derivatives of f(x,y) will give the slope ∂f/∂x in the positive x direction and the slope ∂f /∂y in the positive y direction.
• We can generalize the partial derivatives to calculate the slope in any direction (i.e., directional derivative).
f
![Page 72: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/72.jpg)
Directional Derivative (cont’d)
• Directional derivative computes intensity changes in a specified direction.
Compute derivative in direction u
![Page 73: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/73.jpg)
Directional Derivative (cont’d)
+ =
Directional derivative is a
linear combination of
partial derivatives.
(From vector calculus)
![Page 74: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/74.jpg)
Directional Derivative (cont’d)
+ =cosθ sinθ
cos , sin yxuu
u u cos , sinx yu u
||u||=1
![Page 75: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/75.jpg)
Higher Order Directional Derivatives
' ( , ) cos sinf f
f x yx y
3 3 3 3''' 3 2 2 3
3 2 2 3( , ) cos 3 cos sin 3 cos sin sin
f f f ff x y
x x y x y y
2 2 2'' 2 2
2 2( , ) cos 2 cos sin sin
f f ff x y
x x y y
![Page 76: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/76.jpg)
Edge Detection Using Directional Derivative
• What direction would you use for edge detection?
cos
sin
f
xf
y
Direction of gradient:
![Page 77: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/77.jpg)
Second Directional Derivative(along gradient direction)
cos
sin
f
xf
y
2 2 2'' 2 2
2 2( , ) cos 2 cos sin sin
f f ff x y
x x y y
![Page 78: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/78.jpg)
Edge Detection Using Second Derivative
or
Laplacian:
(i) the second directional derivative is equal to zero and (ii) the third directional derivative is negative.
![Page 79: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/79.jpg)
Properties of Second Directional Derivative (along gradient direction)
![Page 80: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/80.jpg)
Facet Model
• Assumes that an image is an array of samples of a continuous function f(x,y).
• Reconstructs f(x,y) from sampled pixel values.
• Uses directional derivatives which are computed analytically (i.e., without using discrete approximations).
z=f(x,y)
![Page 81: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/81.jpg)
Facet Model (cont’d)
• For complex images, f(x,y) could contain extremely high powers of x and y.
• Idea: model f(x,y) as a piece-wise function.
• Approximate each pixel value by fitting a bi-cubic polynomial in a small neighborhood around the pixel (facet).
![Page 82: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/82.jpg)
Facet Model (cont’d)
Steps(1) Fit a bi-cubic polynomial to a small neighborhood of
each pixel (this step provides smoothing too).
(2) Compute (analytically) the second and third directional derivatives in the direction of gradient.
(3) Find points where (i) the second derivative is equal to zero and (ii) the third derivative is negative.
![Page 83: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/83.jpg)
Fitting bi-cubic polynomial
• If a 5 x 5 neighborhood is used, the masks below can be used to compute the coefficients.– Equivalent to least-squares (e.g., SVD)
![Page 84: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/84.jpg)
Analytic computations of second and third directional derivatives
• Using polar coordinates
![Page 85: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/85.jpg)
Compute analytically second and third directional derivatives
• Gradient angle θ (with positive y-axis at (0,0)):
Locally approximate surface by a plane and use the normalto the plane to approximatethe gradient.
![Page 86: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/86.jpg)
Computing directional derivatives (cont’d)
• The derivatives can be computed as follows:
Second derivative equalto zero implies:
Third derivativenegative implies:
![Page 87: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/87.jpg)
Edge Detection Using Facet Model (cont’d)
Steps
![Page 88: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/88.jpg)
Anisotropic Filtering (i.e., edge preserving smoothing)
• Symmetric Gaussian smoothing tends to blur out edges rather aggressively.
• An “oriented” smoothing operator would work better:(i) Smooth aggressively perpendicular to the gradient
(ii) Smooth little along the gradient
• Mathematically formulated using diffusion
equation.
![Page 89: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/89.jpg)
Anisotropic filtering - Example
result using anisotropic filtering
![Page 90: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/90.jpg)
Effect of scale (i.e., σ)
original
– Small σ detects fine features.
– Large σ detects large scale edges.
![Page 91: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/91.jpg)
Multi-scale Processing
• A formal theory for handling image structures at different scales.
• Process images multiple scales.
• Determine which structures (e.g., edges) are most significant by considering the range of scales over which they occur.
![Page 92: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/92.jpg)
Multi-scale Processing (cont’d)
σ=1
σ=2σ=4
σ=16σ=8
•Interesting scales: scales at which important structures are present. e.g., in the image above, people can be detected at scales [1.0 - 4.0]
![Page 93: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/93.jpg)
Scale Space (Witkin 1983)
Gaussian filtered signal
• Detect and plot the zero-crossing of a 1D function over a continuum of scales σ.
• Instead of treating zero- crossings at a single scale as a single point, we can now treat them at multiple scales as contours.
σ
xA. Witkin, "Scale-space filtering", 8th Int. Joint Conf. Art. Intell., Karlsruhe, Germany,1019–1022, 1983
![Page 94: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/94.jpg)
Scale Space (cont’d)
• Properties of scale space (assuming Gaussian smoothing): – Zero-crossings may shift with increasing scale ().– Two zero-crossing may merge with increasing scale.– A contour may not split into two with increasing scale.
![Page 95: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/95.jpg)
Multi-scale processing (cont’d)
![Page 96: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/96.jpg)
Multi-scale processing (cont’d)
![Page 97: Edge Detection](https://reader030.fdocuments.us/reader030/viewer/2022032805/5681332a550346895d9a1b57/html5/thumbnails/97.jpg)
Edge detection is just the beginning…
• Berkeley segmentation database:http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/
image human segmentation gradient magnitude