View
215
Download
0
Tags:
Embed Size (px)
Citation preview
EE663Image ProcessingEdge Detection 2
Dr. Samir H. Abdul-Jauwad
Electrical Engineering Department
King Fahd University of Petroleum & Minerals
2
Image Features• Image features – may appear in two contexts:
− Global properties of the image (average gray level, etc) – global features
− Parts of the image with special properties (line, circle, textured region) – local features
• Here, assume second context for image features:− Local, meaningful, detectable parts of the image
• Detection of image features− Detection algorithms – produce feature descriptors− Example – line segment descriptor: coordinates of mid-point,
length, orientation
3
Edge Detection• Definition of edges
− Edges are significant local changes of intensity in an image.− Edges typically occur on the boundary between two different
regions in an image.
5
Edge Detection• Goal of edge detection
− Produce a line drawing of a scene from an image of that scene.− 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., segmentation, recognition).
7
Edge Detection• What causes intensity changes?
− Geometric events− object boundary (discontinuity in depth and/or surface color and
texture)
− surface boundary (discontinuity in surface orientation and/or surface color and texture)
− Non-geometric events− specularity
− shadows (from other objects or from the same object)
− inter-reflections
8
Edge Detection• Edge descriptors
− Edge normal: unit vector in the direction of maximum intensity change.− Edge direction: unit vector to perpendicular to the edge normal.− Edge position or center: the image position at which the edge is located.− Edge strength: related to the local image contrast along the normal.
9
Modeling Intensity Changes
• Edges can be modeled according to their intensity profiles:
• Step edge:− the image intensity
abruptly changes from one value to one side of the discontinuity to a different value on the opposite side.
• Ramp edge:− a step edge where the
intensity change is not instantaneous but occurs over a finite distance.
10
Modeling Intensity Changes
• Ridge edge:− the image intensity abruptly changes value but then returns to the
starting value within some short distance− generated usually by lines
11
Modeling Intensity Changes
• Roof edge:− a ridge edge where the intensity change is not instantaneous but
occurs over a finite distance− generated usually by the intersection of surfaces
12
Edge Detection• The four steps of edge detection:
− Smoothing: suppress as much noise as possible, without destroying the true edges.
− Enhancement: apply a filter that responds to edges in the image− Detection: determine which edge pixels should be discarded as
noise and which should be retained (usually, thresholding provides the criterion used for detection).
− Localization: determine the exact location of an edge (sub-pixel resolution might be required for some applications, that is, estimate the location of an edge to better than the spacing between pixels). Edge thinning and linking are usually required in this step.
13
Edge Detection
• Edge detection using derivatives
− Calculus describes changes of continuous functions using derivatives.
− 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
15
Edge Detection
• Differencing 1D signals:− To compute the derivative of a signal, we approximate the
derivative by finite differences
• Computing the 1st derivative:
16
Edge Detection
• Computing the 1st derivative – cont.
)1()1()( xfxfxf
)()1()( xfxfxf
)1()()( xfxfxf Backward difference
Forward difference
Central difference
17
Edge Detection
• Computing the 1st derivative – cont.− Examples using the edge models and the mask [ -1 0 1] (centered
about x):
18
Edge Detection
• Computing the 2nd derivative:
− This approximation is centered about x + 1− By replacing x + 1 by x we obtain:
23
Derivatives and Noise
• Derivatives are strongly affected by noise− obvious reason: image noise results in pixels that look very
different from their neighbors− The larger the noise - the stronger the response
• What is to be done?− Neighboring pixels look alike− Pixel along an edge look alike− Image smoothing should help − Force pixels different to their neighbors (possibly noise) to look like
neighbors
24
Derivatives and Noise
Increasing noise
− Need to perform image smoothing as a preliminary step− Generally – use Gaussian smoothing
25
Edge Detection
• Gradient operators− Roberts− Prewitt− Sobel
• Gradient of Gaussian (Canny)• Laplacian of Gaussian (Marr-Hildreth)• Facet Model Based Edge Detector (Haralick)
• Possible detectors:
26
Edge Detection Using the Gradient
• Definition of the gradient:
• To save computations, the magnitude of gradient is usually approximated by:
27
Edge Detection Using the Gradient
• Properties of the gradient:
− The magnitude of gradient provides information about the strength of the edge
− The direction of gradient is always perpendicular to the direction of the edge
• Main idea:
− Compute derivatives in x and y directions− Find gradient magnitude− Threshold gradient magnitude