Modified Canny Edge Detection

download Modified Canny Edge Detection

of 11

Transcript of Modified Canny Edge Detection

  • 8/13/2019 Modified Canny Edge Detection

    1/11

  • 8/13/2019 Modified Canny Edge Detection

    2/11

  • 8/13/2019 Modified Canny Edge Detection

    3/11

    Modified Canny Edge Detection

    Modified Canny Edge Detection 0.1 IntroductionIn this article we will look at Modified canny edge detection which willprovide output corresponding to different thresholds.We will alsoconsider the use of color gradients instead of gray scale gradients

    Canny Edge detection algorithm is optimal edge detection algo-rithm.

    The result is a binary image,where the edge approximate the true edges of the image

    Canny edge detection algorithm provides a computational method to achieve

    Robust Detection Good Localization Single response to edge

    Canny Edge detection algorithm consists of 5 steps Smoothing Computing Gradients Non-Maxima Suppression Double thresholding Hysterisis

    The first step is to perform Gaussian Smoothing to eliminate the noise in the image

    The gaussian filter is optimal filter in the sense that in increases the SNR and provide the best localization characteristics.This have been proved in the paper .

    After gaussian smoothing edge detection is performed to ob- tain the gradients along the x and y directions.

  • 8/13/2019 Modified Canny Edge Detection

    4/11

    Modified Canny Edge Detection

    Next step is non maxima suppression,which selects the locally dominant gradient

    Let us extract the edge orientation and resolve it into one oforientation at 0,45,90,135.

  • 8/13/2019 Modified Canny Edge Detection

    5/11

    Modified Canny Edge Detection

    Thus we compute the dominant edge direction about the neigh-borhood and check if the magnitude of gradient is strongest along neighborhood pixels along the gradient.

    If the gradient value is maximum,it is retained else value is set to 0 The result is shown in figure 1d

    (a) original image (b) smoothing (c) magnitude image

    (d) suppressed (e) lower threshs (f) higher threshs

    The input to canny edge detection algorithm is a pair of thresh-olds,lower and higher threshold.

    Any pixel in the image greater than lower threshold is considered to be an edge pixel and marked accordingly.The thresholded images are shown in figure 1e and figure 1f.

    The pixels indicated in figure 1f indicate points which are surely

    edges. The pixels indicated in figure 1e may be an edge.

    If any pixels in the image are connected to these edge pixels and have gradient greater than higher threshold,they are alsomarked as edge pixels.

  • 8/13/2019 Modified Canny Edge Detection

    6/11

    Modified Canny Edge Detection

    Thus this can be considered as following edge .To begin withwe need a pixel with gradient magnitude greater than higher threshold,and edge following is done till be encounted a neigh-borhood where all the pixels are lower than the lower threshold.

    To check if a neighbour is connected to edge ,we simple check ifpoint is possibly and edge

    This process is called hysterisis thresholding.

    We will use a stack based implementation of connceted compo- nent analysis.

  • 8/13/2019 Modified Canny Edge Detection

    7/11

    Modified Canny Edge Detection

  • 8/13/2019 Modified Canny Edge Detection

    8/11

    Modified Canny Edge Detection

    The output is show in figure 1g

    (g) final edge (h) color edge (i) color supressed

    (j) final cedge

    Robust edge detection is typically a difficult task in real time environment due to varying illumination,shadows etc.

    The gradient computation is performed on a grayscale image

    As a modification to canny ,gradients are computed for each ofchannels of color image individually.

    Orientation corresponding to dominant orientation is retained.

    Non maxima supression is performed on this final image Theoutput is seen in figure 1h, 1j and

    It can be seen that much better edge image is obtained usingcolor gradients.

    It may also be required that we perform thresholding at differ- ent levels

  • 8/13/2019 Modified Canny Edge Detection

    9/11

    Modified Canny Edge Detection

    Thus we can pass a vector of thresholds to canny as input and get a vector of images at output.

    Only the function from the point of hysteris is performed for

    each pair of threshold.

  • 8/13/2019 Modified Canny Edge Detection

    10/11

    Modified Canny Edge Detection

    0.2 Code

    The code for modified canny edge detector can be found in the git repository in files Img- Proc/edgedetector.cpp and ImgProc/edgedetector.hpp files.

    https://github.com/pi19404/OpenVision/
  • 8/13/2019 Modified Canny Edge Detection

    11/11

    Bibliography

    Bibliography

    http://dx.doi.org/http://doi.acm.org/10.1145/11274.11275