Image Processing

Similar documents
SRCEM, Banmore(M.P.), India

Performance Evaluation of Edge Detection Techniques for Images in Spatial Domain

Comparison between Various Edge Detection Methods on Satellite Image

Sobel Edge Detection Algorithm

Local Image preprocessing (cont d)

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Digital Image Processing. Image Enhancement - Filtering

Lecture 7: Most Common Edge Detectors

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

Lecture: Edge Detection

Feature Detectors - Sobel Edge Detector

SURVEY ON IMAGE PROCESSING IN THE FIELD OF DE-NOISING TECHNIQUES AND EDGE DETECTION TECHNIQUES ON RADIOGRAPHIC IMAGES

Edge Detection Lecture 03 Computer Vision

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

Edge detection. Stefano Ferrari. Università degli Studi di Milano Elaborazione delle immagini (Image processing I)

Digital Image Processing COSC 6380/4393

CS534: Introduction to Computer Vision Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Comparative analysis of different Edge detection techniques for biomedical images using MATLAB

Edge Detection (with a sidelight introduction to linear, associative operators). Images

Anno accademico 2006/2007. Davide Migliore

Edge Detection. CMPUT 206: Introduction to Digital Image Processing. Nilanjan Ray. Source:

Other Linear Filters CS 211A

Feature Detectors - Canny Edge Detector

Biomedical Image Analysis. Point, Edge and Line Detection

Edge Detection. CSE 576 Ali Farhadi. Many slides from Steve Seitz and Larry Zitnick

An Algorithm for Blurred Thermal image edge enhancement for security by image processing technique

Survey Paper on Object Counting and Detection Counting Mathamatical objects form images

Edge Detection CSC 767

A Distributed Canny Edge Detector and Its Implementation on FPGA

Image Processing. BITS Pilani. Dr Jagadish Nayak. Dubai Campus

EECS490: Digital Image Processing. Lecture #19

Edge detection. Convert a 2D image into a set of curves. Extracts salient features of the scene More compact than pixels

Types of Edges. Why Edge Detection? Types of Edges. Edge Detection. Gradient. Edge Detection

CS5670: Computer Vision

A Robust Method for Circle / Ellipse Extraction Based Canny Edge Detection

Edge detection. Gradient-based edge operators

DIGITAL IMAGE PROCESSING

Neighborhood operations

Filtering Images. Contents

Image Segmentation Image Thresholds Edge-detection Edge-detection, the 1 st derivative Edge-detection, the 2 nd derivative Horizontal Edges Vertical

Lecture 6: Edge Detection

What is an edge? Paint. Depth discontinuity. Material change. Texture boundary

Concepts in. Edge Detection

Line, edge, blob and corner detection

Review of Filtering. Filtering in frequency domain

Edge Detection. CSC320: Introduction to Visual Computing Michael Guerzhoy. René Magritte, Decalcomania. Many slides from Derek Hoiem, Robert Collins

Assignment 3: Edge Detection

Edge detection. Goal: Identify sudden. an image. Ideal: artist s line drawing. object-level knowledge)

Edge and Texture. CS 554 Computer Vision Pinar Duygulu Bilkent University

Topic 4 Image Segmentation

Algorithms for Edge Detection and Enhancement for Real Time Images: A Comparative Study

Edges and Binary Images

CS 4495 Computer Vision. Linear Filtering 2: Templates, Edges. Aaron Bobick. School of Interactive Computing. Templates/Edges

CMPUT 206. Introduction to Digital Image Processing

Edge Detection. Today s reading. Cipolla & Gee on edge detection (available online) From Sandlot Science

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

Prof. Feng Liu. Winter /15/2019

Implementation of Canny Edge Detection Algorithm on FPGA and displaying Image through VGA Interface

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

Edge detection. Winter in Kraków photographed by Marcin Ryczek

Comparison of Some Motion Detection Methods in cases of Single and Multiple Moving Objects

Computer Vision I. Announcement. Corners. Edges. Numerical Derivatives f(x) Edge and Corner Detection. CSE252A Lecture 11

Edge and local feature detection - 2. Importance of edge detection in computer vision

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

Edge Detection. Computer Vision Shiv Ram Dubey, IIIT Sri City

EDGE DETECTION-APPLICATION OF (FIRST AND SECOND) ORDER DERIVATIVE IN IMAGE PROCESSING

Edge detection. Winter in Kraków photographed by Marcin Ryczek

Announcements. Edge Detection. An Isotropic Gaussian. Filters are templates. Assignment 2 on tracking due this Friday Midterm: Tuesday, May 3.

Solution: filter the image, then subsample F 1 F 2. subsample blur subsample. blur

Edge and corner detection

Announcements. Edges. Last Lecture. Gradients: Numerical Derivatives f(x) Edge Detection, Lines. Intro Computer Vision. CSE 152 Lecture 10

SECTION 5 IMAGE PROCESSING 2

Ulrik Söderström 16 Feb Image Processing. Segmentation

Digital filters. Remote Sensing (GRS-20306)

Edge Detection. CS664 Computer Vision. 3. Edges. Several Causes of Edges. Detecting Edges. Finite Differences. The Gradient

What Are Edges? Lecture 5: Gradients and Edge Detection. Boundaries of objects. Boundaries of Lighting. Types of Edges (1D Profiles)

Evaluation Of Image Detection Techniques

Lesson 6: Contours. 1. Introduction. 2. Image filtering: Convolution. 3. Edge Detection. 4. Contour segmentation

EN1610 Image Understanding Lab # 3: Edges

Segmentation and Grouping

Design of Improved Canny Edge Detection Algorithm

Segmentation I: Edges and Lines

FPGA IMPLEMENTATION FOR REAL TIME SOBEL EDGE DETECTOR BLOCK USING 3-LINE BUFFERS

[Dixit*, 4.(9): September, 2015] ISSN: (I2OR), Publication Impact Factor: 3.785

Classification of image operations. Image enhancement (GW-Ch. 3) Point operations. Neighbourhood operation

Edge Detection. EE/CSE 576 Linda Shapiro

Image Analysis. Edge Detection

Detection of Edges Using Mathematical Morphological Operators

Comparative Analysis of Various Edge Detection Techniques in Biometric Application

JNTUWORLD. 4. Prove that the average value of laplacian of the equation 2 h = ((r2 σ 2 )/σ 4 ))exp( r 2 /2σ 2 ) is zero. [16]

A Comparative Assessment of the Performances of Different Edge Detection Operator using Harris Corner Detection Method

The application of a new algorithm for noise removal and edges detection in captured image by WMSN

Lectures Remote Sensing

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Separable Kernels and Edge Detection

Practical Image and Video Processing Using MATLAB

Digital Image Processing. Prof. P. K. Biswas. Department of Electronic & Electrical Communication Engineering

EE795: Computer Vision and Intelligent Systems

Transcription:

Image Processing 159.731 Canny Edge Detection Report Syed Irfanullah, Azeezullah 00297844 Danh Anh Huynh 02136047 1

Canny Edge Detection INTRODUCTION Edges Edges characterize boundaries and are therefore a problem of fundamental importance in image processing. Edges in images are areas with strong intensity contrasts a jump in intensity from one pixel to the next. Edge detecting an image significantly reduces the amount of data and filters out useless information, while preserving the important structural properties in an image. Canny edge detection algorithm is also known as the optimal edge detector. Canny's intentions were to enhance the many edge detectors in the image. The first criterion should have low error rate and filter out unwanted information while the useful information preserve. The second criterion is to keep the lower variation as possible between the original image and the processed image. Third criterion removes multiple responses to an edge. Based on these criteria, the canny edge detector first smoothes the image to eliminate noise. It then finds the image gradient to highlight regions with high spatial derivatives. The algorithm then tracks along these regions and suppresses any pixel that is not at the maximum using non-maximum suppression. The gradient array is now further reduced by hysteresis to remove streaking and thinning the edges. 2

Filter out noise Convolution First step to Canny edge detection require some method of filter out any noise and still preserve the useful image. Convolution is a simple mathematic method to many common image-processing operators. Figure 1: An example small image (left), kernel (right) Convolution operation: Convolution is performed by sliding the kernel or mask over a grey-level image. The kernel starts from the top left corner and moves through entire image within image boundaries. Each kernel position corresponds to a single output pixel. Each pixel is multiplied with the kernel cell value and added together. Example for pixel value at position 57 below: Mathematically we can write: 3

The output image will have M-m+1 rows and N-n+1 columns, M image rows and N image columns, m kernel rows and n kernel columns. The output image will be smaller when compared to the original image. This is due to the bottom and right edge pixels, which can t be completely mapped by the kernel therefore m 1 right hand pixels and n-1 bottom pixels can t be used. Step 1: Gaussian filtering to remove noise The first step of canny edge detection is to filter out any noise in the original image before trying to locate and detect any edges. The Gaussian filter is used to blur and remove unwanted detail and noise. By calculating a suitable 5 X 5 mask, the Gaussian smoothing can be performed using standard convolution method. A convolution mask is much smaller than the actual image. As a result, the mask is slid over the image, calculating every square of pixels at a time. Gaussian filter uses 2D distribution to perform convolution. The larger the width of the Gaussian mask, the lower is the detector's sensitivity to noise. The weight of the matrix is concentrated at the centre, therefore any noise appearing in the outside columns and rows will be eliminated, as the weight decreases outward from the centre value. The localization error in the detected edges also increases slightly as the Gaussian width is increased. The increasing of standard deviation reduces or blurs the intensity of the noise. 2D Isotropic Gaussian equation is given below as an example: 4

Figure: original image (left), Gaussian filtered image (right) 5

Step 2: Sobel Operator After smoothing the image and eliminating the noise, the next step is to find the edge strength by taking the gradient of the image. The Sobel operator performs a 2-D spatial gradient measurement on an image. The gradient magnitude is given by: Then, the approximate absolute gradient magnitude (edge strength) at each point can be found by the formula below which is simpler to calculate compared to the above exact gradient magnitude. Approximate gradient magnitude given below: G = Gx + Gy The Sobel operator uses a pair of 3x3 convolution masks, one estimating the gradient in the x-direction (columns) and the other estimating the gradient in the y-direction (rows). Sobel Gx and Gy masks shown below each one estimates gradient x direction and y direction respectively: 6

Figure: original image (left), with Sobel operation (right) Step 3: Finding Gradient angle Finding the edge direction is trivial once the gradient in the x and y directions are known. However, you will generate an error whenever sum of Gx is equal to zero i.e. Gx value in denominator meaning calculating arctan of infinity. So the edge direction will equal to 90 or 0 degrees depend on Gx value and 0 degrees depend on Gy value. The formula for finding the edge direction is given below: theta = invtan (Gy / Gx) 7

Step 4: Tracing the edge in the image using theta( angle ) Once the edge direction is known, the next step is to relate the edge direction to a direction that can be traced in an image. So if use the 5x5 matrix to calculate the angle of the edge, the smaller the matrix the fewer angles would have in the image. x x x x x x x x x x x x a x x x x x x x x x x x x By looking at the centre pixel "a", there are four possible directions when describing the surrounding pixels - 0 degrees (in the horizontal direction), 45 degrees (along the positive diagonal), 90 degrees (in the vertical direction), or 135 degrees (along the negative diagonal), 180 degrees region is just an mirror region of 0 degrees region. Therefore any edge direction calculated will be round up to the closest angle. E D C B A So any edge direction falling within the A and E (0 to 22.5 & 157.5 to 180 degrees) is set to 0 degrees. Any edge direction falling in the D (22.5 to 67.5 degrees) is set to 45 degrees. Any edge direction falling in the C (67.5 to 112.5 degrees) is set to 90 degrees. And finally, any edge direction falling within the B (112.5 to 157.5 degrees) is set to 135 degrees. 8

The bigger the matrix the more number of angles one could get, which implies the edge angle will be more precise i.e. will follow the edge better, but on the down side it will be a bigger computation task as now the kernel/mask size is bigger. Step 5: Non maximum Suppression After the edge directions are known, non-maximum suppression is applied. Nonmaximum suppression is used to trace along the gradient in the edge direction and compare the value perpendicular to the gradient. Two perpendicular pixel values are compared with the value in the edge direction. If their value is lower than the pixel on the edge then they are suppressed i.e. their pixel value is changed to 0, else the higher pixel value is set as the edge and the other two suppressed with a pixel value of 0. We wish to mark points along the curve where the magnitude is biggest. We can do this by looking for a maximum along a slice normal to the curve (non-maximum suppression). These points should form a curve. There are then two algorithmic issues: at which point is the maximum, and where is the next one? 9

Step 6: Hysteresis Finally, hysteresis is used as a means of eliminating streaking. Streaking is the breaking up of an edge contour caused by the operator output fluctuating above and below the threshold. If a single threshold, T1 is applied to an image, and an edge has an average strength equal to T1, then due to noise, there will be instances where the edge dips below the threshold. Equally it will also extend above the threshold making an edge look like a dashed line. To avoid this, hysteresis uses 2 thresholds, a high and a low. Any pixel in the image that has a value greater than T1 is presumed to be an edge pixel, and is marked as such immediately. Then, any pixels that are connected to 10

this edge pixel and that have a value greater than T2 are also selected as edge pixels. If you think of following an edge, you need a gradient of T2 to start but you don't stop till you hit a gradient below T1. The above output images show the effect of hysteresis thresholding. 11

Comparison of different edge detection algorithms Original Image Outputs from Roberts, Sobel, Prewitt, Marr edge detection algorithms 12

Canny edge detection output 13

Conclusion: Edge detection applying the Canny edge detection algorithm was discussed. The various steps in performing Canny s algorithm i.e. gaussian, sobel, non-maximum suppression and hysteresis were explained in detail. References: 1. Classical feature detection http://www.dai.ed.ac.uk/cvonline/local_copies/owens/lect6/node2.html 2. Canny interactive demo http://www.cs.washington.edu/research/imagedatabase/demo/edge/ 3. Edge detection tutorial http://www.pages.drexel.edu/~weg22/edge.html 4. Overview of detection of edges http://www.cs.wustl.edu/~pless/519/lecture3.pdf 5. Canny edge detection tutorial http://www.pages.drexel.edu/~weg22/can_tut.html 6. Convolution http://www.cee.hw.ac.uk/hipr/html/convolve.html 7. Masks / kernels http://www.dai.ed.ac.uk/hipr2/kernel.htm 8. Spatial domains http://www.dai.ed.ac.uk/hipr2/spatdom.htm 9. Sobel edge detection algorithm http://www.dai.ed.ac.uk/hipr2/sobel.htm 10. Gaussian filtering http://robotics.eecs.berkeley.edu/~mayi/imgproc/gademo.html 14