Image Analysis. Edge Detection

Similar documents
Image Analysis. Edge Detection

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

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

Edge and corner detection

Lecture 7: Most Common Edge Detectors

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

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

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

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

Edge Detection CSC 767

Review of Filtering. Filtering in frequency domain

Lecture 6: Edge Detection

Edges and Binary Images

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

DIGITAL IMAGE PROCESSING

Prof. Feng Liu. Winter /15/2019

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

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

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

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

Biomedical Image Analysis. Point, Edge and Line Detection

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

Digital Image Processing COSC 6380/4393

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

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

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

Local Image preprocessing (cont d)

Edge Detection Lecture 03 Computer Vision

Anno accademico 2006/2007. Davide Migliore

Digital Image Processing. Image Enhancement - Filtering

Lecture 4: Finding lines: from detection to model fitting

2%34 #5 +,,% ! # %& ()% #% +,,%. & /%0%)( 1 ! # %& % %()# +(& ,.+/ +&0%//#/ &

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

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

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

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

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

CS5670: Computer Vision

Segmentation and Grouping

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

Image gradients and edges

Other Linear Filters CS 211A

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

[ ] Review. Edges and Binary Images. Edge detection. Derivative of Gaussian filter. Image gradient. Tuesday, Sept 16

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

PERFORMANCE ANALYSIS OF CANNY AND OTHER COMMONLY USED EDGE DETECTORS Sandeep Dhawan Director of Technology, OTTE, NEW YORK

Topic 4 Image Segmentation

Image gradients and edges April 11 th, 2017

Image Analysis Image Segmentation (Basic Methods)

Image gradients and edges April 10 th, 2018

Low-level Vision Processing Algorithms Speaker: Ito, Dang Supporter: Ishii, Toyama and Y. Murakami

Comparison between Various Edge Detection Methods on Satellite Image

Does everyone have an override code?

Image gradients and edges

Neighborhood operations

Edge Detection. EE/CSE 576 Linda Shapiro

Filtering in frequency domain

CS4670: Computer Vision Noah Snavely

Edges and Binary Image Analysis April 12 th, 2018

Image Understanding Edge Detection

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

Image features. Image Features

CS 2770: Computer Vision. Edges and Segments. Prof. Adriana Kovashka University of Pittsburgh February 21, 2017

Previously. Edge detection. Today. Thresholding. Gradients -> edges 2/1/2011. Edges and Binary Image Analysis

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

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

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

Image Processing

Edges, interpolation, templates. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Edge detection. Gradient-based edge operators

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

Filtering and Edge Detection. Computer Vision I. CSE252A Lecture 10. Announcement

Filtering Applications & Edge Detection. GV12/3072 Image Processing.

Robust Zero Watermarking for Still and Similar Images Using a Learning Based Contour Detection

Filtering Images. Contents

EE795: Computer Vision and Intelligent Systems

SRCEM, Banmore(M.P.), India

Feature Detectors - Canny Edge Detector

Lecture: Edge Detection

EECS490: Digital Image Processing. Lecture #20

CPSC 425: Computer Vision

CAP 5415 Computer Vision Fall 2012

Edge Detection. Ziv Yaniv School of Engineering and Computer Science The Hebrew University, Jerusalem, Israel.

Straight Lines and Hough

Local Features: Detection, Description & Matching

COMPARATIVE STUDY OF IMAGE EDGE DETECTION ALGORITHMS

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

Line, edge, blob and corner detection

Edges and Binary Image Analysis. Thurs Jan 26 Kristen Grauman UT Austin. Today. Edge detection and matching

How and what do we see? Segmentation and Grouping. Fundamental Problems. Polyhedral objects. Reducing the combinatorics of pose estimation

ME/CS 132: Introduction to Vision-based Robot Navigation! Low-level Image Processing" Larry Matthies"

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

Practical Image and Video Processing Using MATLAB

Introduction to Medical Imaging (5XSA0)

Feature Detectors and Descriptors: Corners, Lines, etc.

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

Concepts in. Edge Detection

Advanced Video Content Analysis and Video Compression (5LSH0), Module 4

Filtering and Enhancing Images

Transcription:

Image Analysis Edge Detection Christophoros Nikou cnikou@cs.uoi.gr Images taken from: Computer Vision course by Kristen Grauman, University of Texas at Austin (http://www.cs.utexas.edu/~grauman/courses/spring2011/index.html). Computer Vision course by Svetlana Lazebnik, University of North Carolina at Chapel Hill (http://www.cs.unc.edu/~lazebnik/spring10/). D. Forsyth and J. Ponce. Computer Vision: A Modern Approach, Prentice Hall, 2003. R. Gonzalez and R. Woods. Digital Image Processing, Prentice Hall, 2008. University of Ioannina - Department of Computer Science and Engineering

2 Edge detection Goal: Identify sudden changes (discontinuities) in an image. Intuitively, most semantic and shape information from the image can be encoded in the edges. More compact than pixels. Ideal: artist s line drawing (artist also uses object-level knowledge) Source: D. Lowe

3 Origin of Edges surface normal discontinuity depth discontinuity surface color discontinuity illumination discontinuity Edges are caused by a variety of factors Source: Steve Seitz

4 Edge model

5 Edge model (cont.) Edge point detection Magnitude of the first derivative. Sign change of the second derivative. Observations: Second derivative produces two values for an edge (undesirable). Its zero crossings may be used to locate the centres of thick edges.

6 Image gradient The gradient of an image: The gradient points in the direction of most rapid increase in intensity The gradient direction is given by how does this relate to the direction of the edge? The edge strength is given by the gradient magnitude Source: Steve Seitz

7 Differentiation and convolution Recall, for 2D function, f(x,y): f x lim f x, y 0 This is linear and shift invariant. It is therefore the result of a convolution. f x,y Approximation: f x f x n 1,y f x n, y x which is a convolution with the mask: -1 1 Source: D. Forsyth, D. Lowe

8 Finite difference filters Other approximations of derivative filters: Source: K. Grauman

9 Finite differences: example

10 Effect of Finite Differences on White Noise Let f be an observed instance of the image f 0 corrupted by noise w: f f w 0 with noise samples having mean value E[w(n)]=0 and being uncorrelated with respect to location: 2, m n E[ w( m) w( n)] 0, m n

11 Effect of Finite Differences on White Noise (cont.) Applying a filter h to the degraded image: g h* f 0 h*( f w) h* f h* w 0 The expected value of the output is: E[ g] E[ h* f ] E[ h* w] 0 0 h* f h*0 h* f0 0 The noise is removed in average. h* f h* E[ w]

12 Effect of Finite Differences on White Noise (cont.) What happens to the standard deviation of g? N 2 2 2 g h i 1 ( k) Assume that a finite difference filter is used, which approximates the first derivative: -1 1 2 2 2 g

13 Effect of Finite Differences on White Noise (cont.) For a second derivative approximation: 0 1 0 0-2 0 0 1 0 6 2 2 g The standard deviation increases sharply! Higher order coefficients form a Pascal triangle.

14 Effect of Finite Differences on White Noise (cont.) Another perspective: differentiation in the Fourier domain: d f ( x ) j F ( ) dx High frequencies are heavily emphasized with respect to low spatial frequencies.

15 Edge model and noise Intensity profile First derivative Second derivative

16 Edge model and noise (cont.) Intensity profile First derivative Second derivative

17 Noise Edge detectors respond strongly to sharp changes and noise is a sharp change. As we have seen, simple finite differences are unusable. Noise is sometimes useful! Pictures in a dark room with the lens cap on helps to determine information about the camera temperature.

18 Noise (cont.) Independent additive stationary Gaussian noise is the simplest model. Issues this model allows noise values that could be greater than maximum camera output or less than zero. for small standard deviations, this isn t too much of a problem - it s a fairly good model. independence may not be justified (e.g. damage to lens). may not be stationary (e.g. thermal gradients in the ccd).

19 Why smoothing helps Smoothing (e.g. average) kernels have N N N N 2 h( i, j) 1 h ( i, j) 1 i 1 j 1 i 1 j 1 Therefore, the noise standard deviation is reduced at the output, as we saw before. Also, after smoothing (e.g. average), noise samples are no longer independent. They look like their neighbors and the derivatives are smaller.

20 Application of noise smoothing In computer graphics, noise smoothing is widely used as it is a source of representing natural textures (e.g. smoke).

21 Noisy Edge Smoothing f g f * g d dx ( f g) To find edges, look for peaks in ( f g) d dx Source: S. Seitz

22 Convolution property d dx ( f g) Convolve with the derivative of the filter. f d dx g f d dx g f d dx g Source: S. Seitz

23 Derivative of Gaussian * [1-1] =

24 Derivative of Gaussian (cont.) x-direction y-direction

25 Tradeoff between smoothing and localization σ =1 σ =3 σ =7 Smoothed derivative removes noise but blurs edge. It also finds edges at different scales affecting the semantics of the edge. Source: D. Forsyth

26 The LoG operator A good place to look for edges is the maxima of the first derivative or the zeros of the second derivative. The 2D extension approximates the second derivative by the Laplacian operator (which is rotationally invariant): f x f y 2 2 2 f ( x, y) 2 2 Marr and Hildreth [1980] argued that a satisfactory operator that could be tuned in scale to detect edges is the Laplacian of the Gaussian (LoG). D. Marr and E. Hildreth. Theory of Edge Detection, Proceedings of the Royal Society of London, B-207, pp. 187-207, 1980.

27 The LoG operator (cont.) G( x, y)* f ( x, y) G( x, y)* f ( x, y) 2 2 The LoG operator is given by: 2 2 2 2 2 2 2 x y 2 G G x y 2 2 2 G( x, y) e 2 2 4 x y The zero crossings of the operator indicate edge pixels. These may be computed, for instance, by using a 3x3 window around a pixel and detect if two of its opposite neighbors have different signs (and their difference is significant compared to a threshold) in result of the LoG operator.

28 The LoG operator (cont.) 2 2 2 2 2 2 2 x y 2 G G x y 2 2 2 G( x, y) e 2 2 4 x y

29 The LoG operator (cont.) Image LoG Zero crossings Zero crossings with a threshold of 4% of the image max

30 The LoG operator (cont.) Threshold = 1% of max Threshold = 4% of max σ =2 σ =4

31 The LoG operator (cont.) Filter the image at various scales and keep the zero crossings that are common to all responses. Marr and Hildreth [1980] showed that LoG may be approximated by a difference of Gaussians (DOG): 2 2 2 2 x y x y 2 2 2 1 2 2 2 2 1 2 1 1 DoG( x, y) e e, 1 2 2 2 Certain channels of the human visual system are selective with respect to orientation and frequency and can be modeled by a DoG with a ratio of standard deviations of 1.75.

32 The LoG operator (cont.) Meaningful comparison between LoG and DoG may be obtained after selecting the value of σ for LoG so that LoG has the same zero crossings as DoG: 2 2 2 2 1 2 1 ln 2 2 2 1 2 2 The two functions should also be scaled to have the same value at the origin.

33 The LoG operator (cont.) LoG has fallen to some disfavour. It is not oriented and its response averages the responses across the two directions. Poor response at corners. Difficulty in recording the topology of T-junctions (trihedral vertices). Several studies showed that image components along an edge contribute to the response of LoG to noise but not to a true edge. Thus, zero crossings may not lie exactly on an edge.

34 The LoG operator (cont.) Poor corner and trihedral vertices detection

35 Problems with gradient-based edge detectors There are three major issues: σ =1 σ =2 1. The gradient magnitude at different scales is different; which scale should we choose? 2. The gradient magnitude is large along thick trail; how do we identify only the significant points? 3. How do we link the relevant points up into curves?

36 Designing an optimal edge detector Criteria for an optimal edge detector [Canny 1986]: Good detection: the optimal detector must minimize the probability of false positives (detecting spurious edges caused by noise), as well as that of false negatives (missing real edges). Good localization: the edges detected must be as close as possible to the true edges Single response: the detector must return one point only for each true edge point; that is, minimize the number of local maxima around the true edge. Source: L. Fei-Fei

37 Canny edge detector 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 closely approximates the operator that optimizes the product of signalto-noise ratio and localization. J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986. Source: L. Fei-Fei

38 Canny edge detector (cont.) 1. Filter image with derivative of Gaussian. 2. Find magnitude and orientation of gradient. 3. Non-maximum suppression: Thin multi-pixel wide ridges down to single pixel width. 4. Linking and thresholding (hysteresis): Define two thresholds: low and high Use the high threshold to start edge curves and the low threshold to continue them. Source: D. Lowe, L. Fei-Fei

39 Canny edge detector (cont.) original image

40 Canny edge detector (cont.) Gradient magnitude

41 Canny edge detector (cont.) Non-maximum suppression and hysteresis thresholding

42 Non-maximum suppression (cont.) We wish to mark points along the curve where the gradient magnitude is biggest. We can do this by looking for a maximum along a slice normal to the curve (nonmaximum 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? Source: D. Forsyth

43 Non-maximum suppression (cont.) At pixel q, we have a maximum if the value of the gradient magnitude is larger than the values at both p and at r. Interpolation provides these values. Source: D. Forsyth

44 Edge linking Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s). Source: D. Forsyth

45 Hysteresis Thresholding Reduces false edge pixels. It uses a low (T L ) and a high threshold (T H ) to create two additional images from the gradient magnitude image g (x,y): g( x, y) g( x, y) TL g( x, y) g( x, y) T gl( x, y), gh( x, y) 0 otherwise 0 otherwise g L (x,y) has more non zero pixels than g H (x,y). We eliminate from g L (x,y) all the common non zero pixels: g ( x, y) g ( x, y) g ( x, y) L L H g L (x,y) and g H (x,y) may be viewed as weak and strong edge pixels. Canny suggested a ratio of 2:1 to 3:1 between the thresholds. Source: S. Seitz H

46 Hysteresis Thresholding (cont.) After the thresholdings, all strong pixels are assumed to be valid edge pixels. Depending on the value of T H, the edges in g H (x,y) typically have gaps. All pixels in g L (x,y) are considered valid edge pixels if they are 8-connected to a valid edge pixel in g H (x,y). Source: S. Seitz

47 Hysteresis thresholding (cont.) high threshold (strong edges) low threshold (weak edges) hysteresis threshold Source: L. Fei-Fei

48 Canny vs LoG Image Thresholded gradient LoG Canny

49 Canny vs LoG Image Thresholded gradient LoG Canny

50 Edge Linking Even after hysteresis thresholding, the detected pixels do not completely characterize edges completely due to occlusions, non-uniform illumination and noise. Edge linking may be: Local: requiring knowledge of edge points in a small neighborhood. Regional: requiring knowledge of edge points on the boundary of a region. Global: the Hough transform, involving the entire edge image, will be presented at a later stage in the course.

51 Edge Linking by Local Processing A simple algorithm: 1. Compute the gradient magnitude and angle arrays M(x,y) and a(x,y) of the input image f(x,y). 2. Let S xy denote the neighborhood of pixel (x,y). 3. A pixel (s,t) in S xy in is linked to (x,y) if: M( x, y) M( s, t) E and a( x, y) a( s, t) A A record of linked points must be kept as the center of S xy moves. Computationally expensive as all neighbors of every pixel should be examined.

52 Edge Linking by Local Processing A faster algorithm: 1. Compute the gradient magnitude and angle arrays M(x,y) and a(x,y) of the input image f(x,y). 2. Form a binary image: (cont.) g( x, y) 1 M ( x, y) TM and a( x, y) [ A TA, A TA] 0 otherwise 3. Scan the rows of g(x,y) (for Α=0) and fill (set to 1) all gaps (zeros) that do not exceed a specified length K. 4. To detect gaps in any other direction Α=θ, rotate g(x,y) by θ and apply the horizontal scanning.

53 Edge Linking by Local Processing Image Gradient magnitude Horizontal linking (cont.) We may detect the licence plate from the ratio width/length (2:1 in the USA) Vertical linking Logical OR Morphological thinning

54 Edge Linking by Regional Processing Often, the location of regions of interest is known and pixel membership to regions is available. Approximation of the region boundary by fitting a polygon. Polygons are attractive because: They capture the essential shape. They keep the representation simple. Requirements Two starting points must be specified (e.g. rightmost and leftmost points). The points must be ordered (e.g. clockwise).

55 Edge Linking by Regional Processing (cont.) Variations of the algorithm handle both open and closed curves. If this is not provided, it may be determined by distance criteria: Uniform separation between points indicate a closed curve. A relatively large distance between consecutive points with respect to the distances between other points indicate an open curve. We present here the basic mechanism for polygon fitting.

56 Given the end points A and B, compute the straight line AB. Compute the perpendicular distance from all other points to this line. If this distance exceeds a threshold, the corresponding point C having the maximum distance from AB is declared a vertex. Compute lines AC and CB and continue. Edge Linking by Regional Processing (cont.)

57 Edge Linking by Regional Processing (cont.) Regional processing for edge linking is used in combination with other methods in a chain of processing.

58 Edge detection is just the beginning image human segmentation gradient magnitude Berkeley segmentation database: http://www.eecs.berkeley.edu/research/projects/cs/vision/grouping/segbench/

59 Learning to detect image boundaries Learn from humans which combination of features is most indicative of a good contour? D. Martin, C. Fowlkes and J. Malik. Learning to detect natural image boundaries using local brightness, color and texture cues. IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 26, No 5, pp. 530-549, 2004.

60 What features are responsible for perceived edges? Feature profiles (oriented energy, brightness, color, and texture gradients) along the patch s horizontal diameter D. Martin, C. Fowlkes and J. Malik. Learning to detect natural image boundaries using local brightness, color and texture cues. IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 26, No 5, pp. 530-549, 2004.

61 What features are responsible for perceived edges? (cont.) D. Martin, C. Fowlkes and J. Malik. Learning to detect natural image boundaries using local brightness, color and texture cues. IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 26, No 5, pp. 530-549, 2004.

62 Edges - crucial points Edges are caused by changes in orientation changes in albedo object boundaries other effects (specularities, lighting, etc.) No edge detector can discriminate between these cases so edge maps can be hard to use There are numerous good edge-detectors available Most are based on maximum of gradient magnitude