EDGE DETECTION Instructor: Dr. Engr. Junaid Zafar.

Slides:



Advertisements
Similar presentations
Boundary Detection - Edges Boundaries of objects –Usually different materials/orientations, intensity changes.
Advertisements

Regional Processing Convolutional filters. Smoothing  Convolution can be used to achieve a variety of effects depending on the kernel.  Smoothing, or.
EDGE DETECTION ARCHANA IYER AADHAR AUTHENTICATION.
Instructor: Mircea Nicolescu Lecture 6 CS 485 / 685 Computer Vision.
Sliding Window Filters and Edge Detection Longin Jan Latecki Computer Graphics and Image Processing CIS 601 – Fall 2004.
EDGE DETECTION.
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Edge and Corner Detection Reading: Chapter 8 (skip 8.1) Goal: Identify sudden changes (discontinuities) in an image This is where most shape information.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Lecture 4 Edge Detection
Filtering and Edge Detection
Computer Vision Group Edge Detection Giacomo Boracchi 5/12/2007
Canny Edge Detector.
Edge detection. Edge Detection in Images Finding the contour of objects in a scene.
Image processing. Image operations Operations on an image –Linear filtering –Non-linear filtering –Transformations –Noise removal –Segmentation.
EE663 Image Processing Edge Detection 2 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Canny Edge Detector1 1)Smooth image with a Gaussian optimizes the trade-off between noise filtering and edge localization 2)Compute the Gradient magnitude.
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering
CS485/685 Computer Vision Dr. George Bebis
Segmentation (Section 10.2)
Introduction to Computer Vision CS / ECE 181B Thursday, April 22, 2004  Edge detection (HO #5)  HW#3 due, next week  No office hours today.
EE663 Image Processing Edge Detection 3 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
Lecture 4: Edge Based Vision Dr Carole Twining Thursday 18th March 2:00pm – 2:50pm.
© 2010 Cengage Learning Engineering. All Rights Reserved.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Computer Vision Spring ,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30 – 11:50am.
Discrete Images (Chapter 7) Fourier Transform on discrete and bounded domains. Given an image: 1.Zero boundary condition 2.Periodic boundary condition.
Edges. Edge detection schemes can be grouped in three classes: –Gradient operators: Robert, Sobel, Prewitt, and Laplacian (3x3 and 5x5 masks) –Surface.
EDGE DETECTION IN COMPUTER VISION SYSTEMS PRESENTATION BY : ATUL CHOPRA JUNE EE-6358 COMPUTER VISION UNIVERSITY OF TEXAS AT ARLINGTON.
Instructor: S. Narasimhan
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
October 7, 2014Computer Vision Lecture 9: Edge Detection II 1 Laplacian Filters Idea: Smooth the image, Smooth the image, compute the second derivative.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 15/16 – TP7 Spatial Filters Miguel Tavares Coimbra.
Edge Based Segmentation Xinyu Chang. Outline Introduction Canny Edge detector Edge Relaxation Border Tracing.
Chapter 9: Image Segmentation
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
CSE 6367 Computer Vision Image Operations and Filtering “You cannot teach a man anything, you can only help him find it within himself.” ― Galileo GalileiGalileo.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Course 5 Edge Detection. Image Features: local, meaningful, detectable parts of an image. edge corner texture … Edges: Edges points, or simply edges,
Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Computer Vision Image Features Instructor: Dr. Sherif Sami Lecture 4.
EDGE DETECTION Presentation by Sumit Tandon Department of Electrical Engineering University of Texas at Arlington Course # EE6358 Computer Vision.
Instructor: Mircea Nicolescu Lecture 7
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Lecture 8: Edges and Feature Detection
Digital Image Processing CSC331
September 26, 2013Computer Vision Lecture 8: Edge Detection II 1Gradient In the one-dimensional case, a step edge corresponds to a local peak in the first.
Sliding Window Filters Longin Jan Latecki October 9, 2002.
1 Edge Operators a kind of filtering that leads to useful features.
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
EDGE DETECTION Dr. Amnach Khawne. Basic concept An edge in an image is defined as a position where a significant change in gray-level values occur. An.
Miguel Tavares Coimbra
Edge Detection slides taken and adapted from public websites:
EDGE DETECTION Presentation by Sumit Tandon
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering Northern Arizona University.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Linear Filters and Edges Chapters 7 and 8
Edge Detection CS 678 Spring 2018.
Computer Vision Lecture 9: Edge Detection II
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Edge Detection Prof. B.A.Khivsara.
a kind of filtering that leads to useful features
a kind of filtering that leads to useful features
Feature Detection .
IT472 Digital Image Processing
IT472 Digital Image Processing
Presentation transcript:

EDGE DETECTION Instructor: Dr. Engr. Junaid Zafar

2 CONTENTS  Introduction  Types of Edges  Steps in Edge Detection  Methods of Edge Detection First Order Derivative Methods  First Order Derivative Methods - Summary Second Order Derivative Methods  Second Order Derivative Methods - Summary Optimal Edge Detectors  Canny Edge Detection  Edge Detector Performance  Line Detection Convolution based technique Hough transform  Application areas

Edges (or Edge points) are pixels at or around which the image values undergo a sharp variation. Edge Detection: Given an image corrupted by acquisition noise, locate the edges most likely to be generated by scene elements, not by noise.

Edge Formation: 1.Occluding Contours 1.Two regions are images of two different surfaces 2.Discontinuity in surface orientation or reflectance properties

Mathematical Model of edges and noise

More Realistically, due to blurring and noise, we generally have

Image Gradients The gradient of a differentiable function I gives the direction in which the values of the function change most rapidly. Its magnitude gives you the rate of change.

Approximating Derivatives

Local Operators (Differential Operators) accentuate noise !! (why?) Therefore, need smoothing before computing image gradients. Motivation: Smoothing removes local intensity variation and what remains are the prominent edges. Gaussian Smoothing with exponential kernel function

Three Steps of Edge Detection 1.Noise Smoothing: Suppress as much of the image noise as possible. In the absence of specific information, assume the noise white and Gaussian 2.Edge Enhancement: Designe a filter responding to edges. The filter’s output is large at edge pixels and low elsewhere. Edges can be located as the local maxima in the filters’ output. 3.Edge Localization: Decide which local maxima in the filter’s output are edges and which are just caused by noise. 1.Thinning wide edges to 1-pixel with (nonmaximum suppression); 2. Establishing the minimum value to declare a local maximum an edge ( thresholding )

Edge Descriptors (The output of an edge detector) 1.Edge normal: The direction of the maximum intensity variation at the edge point. 2.Edge direction: The direction tangent to the edge. 3.Edge Position : The location of the edge in image 4.Edge strength: A measure of local image contrast. How significance the intensity variation is across the edge.

13 Steps in Edge Detection  Edge - Area of significant change in the image intensity / contrast  Edge Detection – Locating areas with strong intensity contrasts  Use of Edge Detection – Extracting information about the image. E.g. location of objects present in the image, their shape, size, image sharpening and enhancement

14 TYPES OF EDGES  Variation of Intensity / Gray Level Step Edge Ramp Edge Line Edge Roof Edge

15 Steps in Edge Detection  Filtering – Filter image to improve performance of the Edge Detector wrt noise  Enhancement – Emphasize pixels having significant change in local intensity  Detection – Identify edges - thresholding  Localization – Locate the edge accurately, estimate edge orientation

16 METHODS OF EDGE DETECTION  First Order Derivative / Gradient Methods Roberts Operator Sobel Operator Prewitt Operator  Second Order Derivative Laplacian Laplacian of Gaussian Difference of Gaussian  Optimal Edge Detection Canny Edge Detection

17 First Derivative  At the point of greatest slope, the first derivative has maximum value E.g. For a Continuous 1- dimensional function f(t)

18 Gradient  For a continuous two dimensional function Gradient is defined as

19 Gradient  Approximation of Gradient for a discrete two dimensional function  Convolution Mask Gx = Gy =  Differences are computed at the interpolated points [i, j+1/2] and [i+1/2, j]

EE Computer Vision20 Gradient Methods – Roberts Operator  Provides an approximation to the gradient  Convolution Mask Gx= Gy =  Differences are computed at the interpolated points [i+1/2, j+1/2] and not [i, j]

21 Roberts Operator - Example  The output image has been scaled by a factor of 5  Spurious dots indicate that the operator is susceptible to noise

22 Gradient Methods – Sobel Operator  The 3X3 convolution mask smoothes the image by some amount, hence it is less susceptible to noise. But it produces thicker edges. So edge localization is poor  Convolution Mask Gx = Gy=  The differences are calculated at the center pixel of the mask

23 Sobel Operator - Example  Compare the output of the Sobel Operator with that of the Roberts Operator: The spurious edges are still present but they are relatively less intense compared to genuine lines Roberts operator has missed a few edges Sobel operator detects thicker edges Will become more clear with the final demo Outputs of Sobel (top) and Roberts operator

24 Gradient Methods – Prewitt Operator  It is similar to the Sobel operator but uses slightly different masks  Convolution Mask Px = Py =

25 First Order Derivative Methods - Summary  Noise – simple edge detectors are affected by noise – filters can be used to reduce noise  Edge Thickness – Edge is several pixels wide for Sobel operator– edge is not localized properly  Roberts operator is very sensitive to noise  Sobel operator goes for averaging and emphasizes on the pixel closer to the center of the mask. It is less affected by noise and is one of the most popular Edge Detectors.

26 Second Order Derivative Methods  Zero crossing of the second derivative of a function indicates the presence of a maxima

27 Second Order Derivative Methods - Laplacian  Defined as  Mask  Very susceptible to noise, filtering required, use Laplacian of Gaussian

28 Second Order Derivative Methods - Laplacian of Gaussian  Also called Marr-Hildreth Edge Detector  Steps Smooth the image using Gaussian filter Enhance the edges using Laplacian operator Zero crossings denote the edge location Use linear interpolation to determine the sub-pixel location of the edge

29 Laplacian of Gaussian – contd.  Defined as  Greater the value of , broader is the Gaussian filter, more is the smoothing  Too much smoothing may make the detection of edges difficult

30 Laplacian of Gaussian - contd.  Also called the Mexican Hat operator

31 Laplacian of Gaussian – contd.  Mask Discrete approximation to LoG function with Gaussian = 1.4

32 Second Order Derivative Methods - Difference of Gaussian - DoG  LoG requires large computation time for a large edge detector mask  To reduce computational requirements, approximate the LoG by the difference of two LoG – the DoG

33 Difference of Gaussian – contd.  Advantage of DoG Close approximation of LoG Less computation effort Width of edge can be adjusted by changing 1 and 2

34 Second Order Derivative Methods - Summary  Second Order Derivative methods especially Laplacian, are very sensitive to noise  Probability of false and missing edges remain  Localization is better than Gradient Operators

35 Optimal Edge Detector  Optimal edge detector depending on Low error rate – edges should not be missed and there must not be spurious responses Localization – distance between points marked by the detector and the actual center of the edge should be minimum Response – Only one response to a single edge  One dimensional formulation Assume that 2D images have constant cross section in some direction

36 Mathematical Formulation of Performance Criteria  Notation Edge : G(x) Noise : n(x) Impulse response of Filter : f(x)  Assumptions The edge is located at x=0 Filter has finite response bounded by [-W, W] Noise is of Gaussian nature n 0 : Root mean squared noise amplitude per unit length

37 First Criterion: Edge Detection  Response of filter to the edge:  RMS response of filter to noise :  First criterion: output Signal to Noise Ratio

38 Second Criterion: Edge Localization  A measure that increases as the localization increases is needed  Reciprocal of RMS distance of the marked edge from center of true edge is taken as the measure of localization  Localization is defined as:

39 Maximizing the product  The design problem is reduced to maximization of the product:

40 Third Criterion – Elimination of multiple responses  In presence of noise several maxima are detected – it is difficult to separate noise from edge  We try to obtain an expression for the distance between adjacent noise peaks  The mean distance between the adjacent maxima in the output is twice the distance between the adjacent zero crossings in the derivative of output operator

41 Elimination of Multiple Responses – contd.  Expected number of noise maxima in the region of width 2W is given by  Fixing k will restrict the number of noise maxima that could lead to false response – this is a constraint imposed on the design

42 Finding Optimal Detectors by Numerical Optimization  It is not possible to find a function f which will maximize the SNR, Localization product in the presence of the multiple response constraint  If the function f is discrete then the computation is simplified to four inner products  Additional constraints can be included by the use of Penalty Function – it has non-zero value when the constraint is violated  f is then found out for maximizing the following expression

43 Detector for Step Edges  G(x) = Au -1 (x)

44 Spatial scaling  We can scale the filter width  Detection improves with width, localization degrades with increase in width  The uncertainty principle is

45 Efficient approximation  Depending on the above principles, several optimal edge detectors are calculated  Best approximation to the above detectors is the First Derivative of Gaussian  It is chosen because of the ease of computation in 2 dimensions

46 Noise estimation  Important to estimate the amount of noise in the image to set thresholds  Noise component can be efficiently isolated using Weiner Filtering – requires the knowledge of the autocorrelation of individual components and their cross- correlation  Noise strength is estimated by Global Histogram Estimation

47 Thresholding  Broken edges due to fluctuation of operator output above and below the threshold – results in Streaking  Use double thresholding to eliminate streaking

48 Two Dimensional Edge Detection  In two dimensions edge has both position and direction  A 2-D mask is created by convolving a linear edge detection function aligned normal to the edge direction with a projection function parallel the edge direction  Projection function is Gaussian with same deviation as the detection function  The image is convolved with a symmetric 2-D Gaussian and then differentiated normal to the edge direction

49 Need for multiple widths and Feature Synthesis  Width is chosen to give best tradeoff between detection and localization  For different edges, width has to be different since SNR is different  Feature Synthesis Smaller operator responses are used to predict the larger operator response New edge points are marked if the actual large operator output varies significantly from the predicted output

50 Implementation of Canny Edge Detector  Step 1 Noise is filtered out – usually a Gaussian filter is used Width is chosen carefully  Step 2 Edge strength is found out by taking the gradient of the image A Roberts mask or a Sobel mask can be used

51 Implementation of Canny Edge Detector – contd.  Step 3 Find the edge direction  Step 4 Resolve edge direction

52 Canny Edge Detector – contd.  Step 5 Non-maxima suppression – trace along the edge direction and suppress any pixel value not considered to be an edge. Gives a thin line for edge  Step 6 Use double / hysterisis thresholding to eliminate streaking

53 Canny Edge Detector – contd.  Compare the results of Sobel and Canny

54 Edge Localization – Subpixel Location Estimation  Take Gaussian edge detector output without non-maxima suppression  Error displacement is computed by taking the weighted mean of distance, along the edge gradient on either side of the edge

55 Edge Detector Performance  Criteria Probability of false edges Probability of missing edges Error in estimation of edge angle Mean square distance of edge estimate from true edge Tolerance to distorted edges and other features such as corners and junctions

56 Figure of Merit  Basic errors in a Edge Detector Missing Edges Error in localizing Classification of noise as Edge I A : detected edges I I : ideal edges d : distance between actual and ideal edges  : penalty factor for displaced edges

57 Line Detection  Lines in an image present another form of discontinuity  It is worthwhile to consider them separately since they are very frequent  Methods Use of Convolution Mask Hough Transform

58 Line Detection using Convolution Mask  We need to decide the orientation and width of line to be detected  Following masks are for single pixel wide lines in four directions

59 Line Detection using Convolution Mask – contd.  The mask for horizontal orientation is applied  Lines are 5 pixels wide, mask is tuned for detecting 1 pixel wide line  Line detector acts as edge detector

60 Line detection – Hough Transform  Method to isolate the shapes from an image  Performed after edge detection  Not affected by noise or gaps in the edges  Technique Thresholding is used to isolate pixels with strong edge gradient Parametric equation of straight line is used to map the edge points to the Hough parameter space Points of intersection in the Hough parameter space gives the equation of line on actual image

61 Hough Transform - contd  Parametric Equation of Straight Line

62 Hough Transform – contd. Edge Detected Image Mapping of Edge Points in Hough Parameter Space

63 Applications  Enhancement of noisy images – satellite images, x-rays, medical images like cat scans  Text detection  Mapping of roads  Video surveillance, etc.

64 Applications  Canny Edge Detector for Remote Sensing Images Reasons to go for Canny Edge Detector – Remote sensed images are inherently noisy Other edge detectors are very sensitive to noise

65 Edge map of remote sensed image using Canny

66 Image enhancement and sharpening using canny

Canny Edge Detector Original Image Edges

68 MATLAB Demo  Get an image from the internet  Apply following operators on the image and display the results Roberts Sobel Prewitt Laplacian of Gaussian Canny