edge and boundary detection

Upload: coolth2

Post on 02-Jun-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Edge and Boundary Detection

    1/52

    EDGE /BOUNDARY

    DETECTIONSobelLaplacian

    Canny

    pB

  • 8/9/2019 Edge and Boundary Detection

    2/52

    Edge detection

    Goal: Identify sudden changes

    (discontinuities) in an image

    Intuitively, most semantic and

    shape information from the imagecan be encoded in the edges

    More compact than pixels

    Ideal: artists line drawing (but artist

    is also using object-level knowledge

  • 8/9/2019 Edge and Boundary Detection

    3/52

    Why do we care about edges?

    Extract information, recognize objects

    Recover geometry and viewpoint

  • 8/9/2019 Edge and Boundary Detection

    4/52

    Origin of edges

    Edges are caused by a variety of factors

  • 8/9/2019 Edge and Boundary Detection

    5/52

    Closeup of edges

  • 8/9/2019 Edge and Boundary Detection

    6/52

    Closeup of edges

  • 8/9/2019 Edge and Boundary Detection

    7/52

    Closeup of edges

  • 8/9/2019 Edge and Boundary Detection

    8/52

    An edge is a place of rapid change in the image intensity function

    Characterization of edges

  • 8/9/2019 Edge and Boundary Detection

    9/52

  • 8/9/2019 Edge and Boundary Detection

    10/52

  • 8/9/2019 Edge and Boundary Detection

    11/52

    Consider a single row or column of the image

    Plotting intensity as a function of position gives a signal

    Effects of noise

  • 8/9/2019 Edge and Boundary Detection

    12/52

    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 we do about it?

    Effects of noise

  • 8/9/2019 Edge and Boundary Detection

    13/52

    Solution: smooth first

    Effects of noise

  • 8/9/2019 Edge and Boundary Detection

    14/52

    Tradeoff between smoothing and

    localization

    Smoothed derivative removes noise, but blurs edge. Also finds edges at

    different scales.

  • 8/9/2019 Edge and Boundary Detection

    15/52

    Designing an edge detector

    Criteria for a good edge detector:

    Good detection:

    the optimal detector should find all real edges, ignoring noise or other artifacts

    Good localization:

    the edges detected must be as close as possible to the true edges

    the detector must return one point only for each true edge point

    Cues of edge detection

    Differences in color, intensity, or texture across the boundaryContinuity and closure

    High-level knowledge

    Source: L. Fei-Fei

  • 8/9/2019 Edge and Boundary Detection

    16/52

    Edge detection

    An edge is the boundary between two regions with relatively distinct gray-

    level properties.

    Assumption: The regions in question are sufficiently homogeneous so that

    the transition between two regions can be determined on the basis of gray-level discontinuities alone.

    The idea underlying most edge-detection techniques is the computation of a

    local derivative operator.

  • 8/9/2019 Edge and Boundary Detection

    17/52

    Edge detection

    Edge detection by derivative operators:

    (a) light strips on a dark background; (b)dark strip on a light background. Note that

    the second derivative has a zero crossing

    at the location of each edge.

  • 8/9/2019 Edge and Boundary Detection

    18/52

    Profile of gray-level at the edge is modelled as a smooth change of gray-level.

    First derivative of the gray level profile is positive at the leading edge of a

    transition, negative at the edge, and zero in areas of constant gray level.

    The second derivative is positive for that part of the transition associated withthe dark side of the edge, and negative for that part of the transition

    associated with the light side of the edge.

    Hence, the second derivative can be used to determine whether an edge pixel

    lies on the dark or light side of an edge.

    Edge detection

  • 8/9/2019 Edge and Boundary Detection

    19/52

    The gradient of an image f(x, y) at location (x,y) is given by :

    Gradient Operators

    The gradient vector points in the direction of maximum rate of change.

    In edge detection, an important quantity is the magnitude of , which is referredto simply as gradient, where

  • 8/9/2019 Edge and Boundary Detection

    20/52

    Gradient Operators

    Gradient is commonly approximated by the absolute values:

    Where angle is measured with respect to thex-axis.

  • 8/9/2019 Edge and Boundary Detection

    21/52

    Derivatives may be implemented in digital form in several ways.

    Sobel operators have the advantage of providing both a differencing and a

    smoothing effect.

    As differencing or dervatives in digital image processing enhance noise, thesmoothing effect of Sobel operators is an attractive features.

    Sobel

  • 8/9/2019 Edge and Boundary Detection

    22/52

    Sobel

  • 8/9/2019 Edge and Boundary Detection

    23/52

    Sobel

    Derivatives based on Sobel masks are

    Computation of the gradient at the central location of the mask then uses eqn

    (4) & (5) to give one value of the gradient.

    The mask in then moved to the next location, and the process is repeated. We

    will obtain a gradient image which is of the same size as the original image.

    Mask operations on the image border are implemented by using the

    appropriate partial neighbours.

  • 8/9/2019 Edge and Boundary Detection

    24/52

    Sobel

  • 8/9/2019 Edge and Boundary Detection

    25/52

    Laplacian

    Laplacian of a 2-D function f(x,y) is

    The mask used in this case must have a positive central pixel, and the outer

    pixels must be negative. In addition, the sum of the coefficients must be zero.

  • 8/9/2019 Edge and Boundary Detection

    26/52

    Laplacian responds to transition in intensity, but is seldom used in practice for edge

    detection, because

    1. As a second order derivative, it is unacceptably sensitive to noise.

    2. It produces double edges (See previous Fig).

    3. It is unable to detect edge direction.

    Laplacian usually play a secondary role of detector for establishing whether a pixel

    is on the dark or light side of an edge.

    A more general use of Laplacian is in the finding the location of edges using its

    zero crossing property

  • 8/9/2019 Edge and Boundary Detection

    27/52

    Laplacian

    The concept is based on convolving an image with the Laplacian of a 2-DGaussian function of the form.

  • 8/9/2019 Edge and Boundary Detection

    28/52

    Laplacian

    The average value of the Laplacian operator h^2 is zero, so as the image

    obtained by convolving with it.

    This operator will blur the image with the degree of blurring being

    proportional to . It can be used for noise-reduction, but its usefulness lies in

    its zero-crossing.

  • 8/9/2019 Edge and Boundary Detection

    29/52

    Fig. 9 shows an example of edge detection with the ^2h operator, with = 4.

    Laplacian

  • 8/9/2019 Edge and Boundary Detection

    30/52

    Some Remarks on Gradient Operations in Edge Detection

    1. They tend to work well in cases involving images with sharp intensity

    transitions and relatively low noise.

    2. *Zero-crossings offer an alternative in cases when edges are blurry or when a

    high noise content is present.

    *They offer reliable edge location, and the smoothing properties of ^2h reduce

    the effect of noise.

    *Computational complex & intensive.

  • 8/9/2019 Edge and Boundary Detection

    31/52

    Canny Edge detector

    This is probably the most widely used edge detector in computer vision

    Theoretical model: step-edges corrupted by additive Gaussian noise

    Canny has shown that the first derivative of the Gaussian closelyapproximates the operator that optimizes the product of signal-to-noise ratio

    and localization

    J. Canny, A Com putat ional Appro ach To Edge Detect ion, IEEE Trans. Pattern Analysis and

    Machine Intelligence, 8:679-714, 1986.

  • 8/9/2019 Edge and Boundary Detection

    32/52

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    33/52

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    34/52

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    35/52

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    36/52

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    37/52

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    38/52

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    39/52

    Hysteresis thresholding

    Threshold at low/high levels to get weak/strong edge pixels

    Do connected components, starting from strong edge pixels

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    40/52

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    41/52

    Canny Edge detector

    Final Canny Edges

  • 8/9/2019 Edge and Boundary Detection

    42/52

    1. Filter image with x, y derivatives of Gaussian

    2. Find magnitude and orientation of gradient

    3. Non-maximum suppression:

    Thin multi-pixel wide ridges down to single pixel width

    4. 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

    MATLAB: edge(image, canny)

    Source: D. Lowe, L. Fei-Fei

    Canny Edge detector

  • 8/9/2019 Edge and Boundary Detection

    43/52

    Effect of (Gaussian kernel spread/size)

    The choice of depends on desired behavior

    large detects large scale edges

    small detects fine features

  • 8/9/2019 Edge and Boundary Detection

    44/52

    Where do humans see boundaries?

  • 8/9/2019 Edge and Boundary Detection

    45/52

    pB Boundary detector

  • 8/9/2019 Edge and Boundary Detection

    46/52

  • 8/9/2019 Edge and Boundary Detection

    47/52

  • 8/9/2019 Edge and Boundary Detection

    48/52

  • 8/9/2019 Edge and Boundary Detection

    49/52

  • 8/9/2019 Edge and Boundary Detection

    50/52

  • 8/9/2019 Edge and Boundary Detection

    51/52

  • 8/9/2019 Edge and Boundary Detection

    52/52