Lecture 7: Edge Detection

Similar documents
Filtering and Edge Detection

Laplacian Filters. Sobel Filters. Laplacian Filters. Laplacian Filters. Laplacian Filters. Laplacian Filters

Lecture 6: Edge Detection. CAP 5415: Computer Vision Fall 2008

Edge Detection. Introduction to Computer Vision. Useful Mathematics Funcs. The bad news

Edge Detection. CS 650: Computer Vision

Lecture 8: Interest Point Detection. Saad J Bedros

Machine vision. Summary # 4. The mask for Laplacian is given

TRACKING and DETECTION in COMPUTER VISION Filtering and edge detection

Linear Diffusion. E9 242 STIP- R. Venkatesh Babu IISc

Lecture 04 Image Filtering

Machine vision, spring 2018 Summary 4

Roadmap. Introduction to image analysis (computer vision) Theory of edge detection. Applications

Edge Detection. Image Processing - Computer Vision

Lecture 8: Interest Point Detection. Saad J Bedros

Vlad Estivill-Castro (2016) Robots for People --- A project for intelligent integrated systems

Blobs & Scale Invariance

CSE 473/573 Computer Vision and Image Processing (CVIP)

ECE Digital Image Processing and Introduction to Computer Vision. Outline

Digital Image Processing. Lecture 6 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009

Review Smoothing Spatial Filters Sharpening Spatial Filters. Spatial Filtering. Dr. Praveen Sankaran. Department of ECE NIT Calicut.

Edge Detection in Computer Vision Systems

Edges and Scale. Image Features. Detecting edges. Origin of Edges. Solution: smooth first. Effects of noise

Advanced Edge Detection 1

Local Enhancement. Local enhancement

Local enhancement. Local Enhancement. Local histogram equalized. Histogram equalized. Local Contrast Enhancement. Fig 3.23: Another example

Image Gradients and Gradient Filtering Computer Vision

Taking derivative by convolution

Reading. 3. Image processing. Pixel movement. Image processing Y R I G Q

Image Filtering. Slides, adapted from. Steve Seitz and Rick Szeliski, U.Washington

Blob Detection CSC 767

Image Segmentation: Definition Importance. Digital Image Processing, 2nd ed. Chapter 10 Image Segmentation.

Templates, Image Pyramids, and Filter Banks

Feature detection.

Introduction to Computer Vision

Basics on 2-D 2 D Random Signal

Scale-space image processing

Medical Image Analysis

Image Enhancement: Methods. Digital Image Processing. No Explicit definition. Spatial Domain: Frequency Domain:

Detectors part II Descriptors

Feature extraction: Corners and blobs

Harris Corner Detector

Image Analysis. Feature extraction: corners and blobs

Multimedia Databases. Previous Lecture. 4.1 Multiresolution Analysis. 4 Shape-based Features. 4.1 Multiresolution Analysis

Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER? Intensity Transformations and Spatial Filtering: WHICH ONE LOOKS BETTER?

Multimedia Databases. Wolf-Tilo Balke Philipp Wille Institut für Informationssysteme Technische Universität Braunschweig

Multimedia Databases. 4 Shape-based Features. 4.1 Multiresolution Analysis. 4.1 Multiresolution Analysis. 4.1 Multiresolution Analysis

Properties of detectors Edge detectors Harris DoG Properties of descriptors SIFT HOG Shape context

ITK Filters. Thresholding Edge Detection Gradients Second Order Derivatives Neighborhood Filters Smoothing Filters Distance Map Image Transforms

SURF Features. Jacky Baltes Dept. of Computer Science University of Manitoba WWW:

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Dimensionality Reduction Techniques for Modelling Point Spread Functions in Astronomical Images

CS4495/6495 Introduction to Computer Vision. 2A-L6 Edge detection: 2D operators

Suppose that f is continuous on [a, b] and differentiable on (a, b). Then

Today s lecture. Local neighbourhood processing. The convolution. Removing uncorrelated noise from an image The Fourier transform

Gaussian derivatives

The Frequency Domain. Many slides borrowed from Steve Seitz

Medical Image Analysis

SIFT, GLOH, SURF descriptors. Dipartimento di Sistemi e Informatica

Computer Vision Lecture 3

Total Variation Image Edge Detection

CITS 4402 Computer Vision

Slide a window along the input arc sequence S. Least-squares estimate. σ 2. σ Estimate 1. Statistically test the difference between θ 1 and θ 2

Achieving scale covariance

Corner. Corners are the intersections of two edges of sufficiently different orientations.

Linear Operators and Fourier Transform

Corners, Blobs & Descriptors. With slides from S. Lazebnik & S. Seitz, D. Lowe, A. Efros

Computational Photography

Histogram Processing

LoG Blob Finding and Scale. Scale Selection. Blobs (and scale selection) Achieving scale covariance. Blob detection in 2D. Blob detection in 2D

Advanced Features. Advanced Features: Topics. Jana Kosecka. Slides from: S. Thurn, D. Lowe, Forsyth and Ponce. Advanced features and feature matching

Scale & Affine Invariant Interest Point Detectors

CS5670: Computer Vision

Overview. Introduction to local features. Harris interest points + SSD, ZNCC, SIFT. Evaluation and comparison of different detectors

Suppose we have a one-dimensional discrete signal f(x). The convolution of f with a kernel g is defined as h(x) = f(x)*g(x) = w 1. f(i)g(x i), (3.

SIFT: Scale Invariant Feature Transform

Introduction to Linear Systems

Edge Detection PSY 5018H: Math Models Hum Behavior, Prof. Paul Schrater, Spring 2005

I Chen Lin, Assistant Professor Dept. of CS, National Chiao Tung University. Computer Vision: 4. Filtering

SIFT keypoint detection. D. Lowe, Distinctive image features from scale-invariant keypoints, IJCV 60 (2), pp , 2004.

Vectors [and more on masks] Vector space theory applies directly to several image processing/ representation problems

SIFT: SCALE INVARIANT FEATURE TRANSFORM BY DAVID LOWE

Used to extract image components that are useful in the representation and description of region shape, such as

Announcements. Filtering. Image Filtering. Linear Filters. Example: Smoothing by Averaging. Homework 2 is due Apr 26, 11:59 PM Reading:

CS 3710: Visual Recognition Describing Images with Features. Adriana Kovashka Department of Computer Science January 8, 2015

Nonlinear Diffusion. 1 Introduction: Motivation for non-standard diffusion

Lecture Outline. Basics of Spatial Filtering Smoothing Spatial Filters. Sharpening Spatial Filters

Image enhancement. Why image enhancement? Why image enhancement? Why image enhancement? Example of artifacts caused by image encoding

Edge Detection. Computer Vision P. Schrater Spring 2003

Spatial Enhancement Region operations: k'(x,y) = F( k(x-m, y-n), k(x,y), k(x+m,y+n) ]

The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall Many slides borrowed from Steve Seitz

Orientation Map Based Palmprint Recognition

Chapter 16. Local Operations

Extract useful building blocks: blobs. the same image like for the corners

Image Enhancement (Spatial Filtering 2)

Recap: edge detection. Source: D. Lowe, L. Fei-Fei

Digital Image Processing: Sharpening Filtering in Spatial Domain CSC Biomedical Imaging and Analysis Dr. Kazunori Okada

MAT 122 Homework 7 Solutions

CS4670: Computer Vision Kavita Bala. Lecture 7: Harris Corner Detec=on

1) The line has a slope of ) The line passes through (2, 11) and. 6) r(x) = x + 4. From memory match each equation with its graph.

Transcription:

#1 Lecture 7: Edge Detection Saad J Bedros sbedros@umn.edu

Review From Last Lecture Definition of an Edge First Order Derivative Approximation as Edge Detector #2

This Lecture Examples of Edge Detection with first order derivative approximation Edge Detection with Second order derivative Combining Smoothing and Edge Detection with Laplacian of Gaussian #3

Summary: Edge Definition Edge is a boundary between two regions with relatively distinct gray level #4 properties. Edges are pixels where the brightness function changes abruptly. Edge detectors are a collection of very important local image preprocessing methods used to locate (sharp) changes in the intensity function.

Criteria for Optimal Edge Detection (1) Good detection Minimize the probability of false positives (i.e., spurious edges). Minimize the probability of false negatives (i.e., missing real edges). (2) Good localization Detected edges must be as close as possible to the true edges. (3) Single response Minimize the number of local maxima around the true edge.

Edge Detection Using Derivatives Often, points that lie on an edge are detected by: (1) Detecting the local maxima or minima of the first derivative. 1 st derivative (2) Detecting the zero-crossings of the second derivative. 2 nd derivative

Edge Detection Using First Derivative sensitive to horizontal edges! sensitive to vertical edges!

Edge Detection Using First Derivative We can implement and using the following masks: good approximation at (x+1/2,y) good approximation at (x,y+1/2) (x,y+1/2) * * (x+1/2,y)

Approximation of First Derivative ( Gradient ) Consider the arrangement of pixels about the pixel (i, j): 3 x 3 neighborhood: The partial derivatives can be computed by: The constant c implies the emphasis given to pixels closer to the center of the mask.

Prewitt Operator the Prewitt operator:

Sobel Operator the Sobel operator:

Robert Edge Detection The Roberts edge detector #12 This approximation can be implemented by the following masks: Note: M x and M y are approximations at (i + 1/2, j + 1/2)

Roberts Edge Detector #13 There are two forms of the Roberts Edge Detector: The second form of the equation is often used in practice due to its computational efficiency

Roberts Edge Detector A simple approximation to the first derivative #14 Marks edge points only; it does not return any information about the edge orientation Simplest of the edge detection operators and will work best with binary images

Example d dx I d dy I

Edge Detection Using Derivative Image derivatives: #16 I x I * 1 1 Image I I y I * 1 1

Edge Detection Using the Gradient Example cont.: #17 d dx I 2 d dy I 2

Edge Detection Using the Gradient Example cont.: #18 Threshold 100

Derivatives and Noise Derivatives are strongly affected by noise obvious reason: image noise results in pixels that look very different from their neighbors The larger the noise - the stronger the response What is to be done? Neighboring pixels look alike Pixel along an edge look alike Image smoothing should help Force pixels different to their neighbors (possibly noise) to look like neighbors #19

Derivatives and Noise #20 Increasing noise Need to perform image smoothing as a preliminary step Generally use Gaussian smoothing

Edge Detection & Image Noise I( x) Iˆ( x) N( x) N( x) ~ N(0, ) i.i.d #21 Taking differences: I'( x) Iˆ( x 1) N( x ( Iˆ( x 1) Iˆ( x 1)) Iˆ'( x) 1) - ( Iˆ( x N d 1) N( x ( N( x 1) - N( x 1)) ( x) 1)) Output noise: E( N d ( x)) 0 ( 2 2 2 E N d ( x)) E( N ( x 1) N ( x 1) 2N ( x 1) N( x 1) ) 2 2 2 0 2 Increases noise!!

Effects of noise Consider a single row or column of the image Plotting intensity as a function of position gives a signal #22 Where is the edge?

Practical issues: Noise in Edge Detection Differential masks act as high-pass filters tend to amplify noise. Reduce the effects of noise - first smooth with a low-pass filter. 1) The noise suppression-localization tradeoff a larger filter reduces noise, but worsens localization (i.e., it adds uncertainty to the location of the edge) and vice-versa. #23

Solution: smooth first Where is the edge? #24

Derivative theorem of convolution #25 This saves us one operation:

Derivative of Gaussian filters ( I g) h I ( g h) 0.0030 0.0133 0.0219 0.0133 0.0030 0.0133 0.0596 0.0983 0.0596 0.0133 0.0219 0.0983 0.1621 0.0983 0.0219 0.0133 0.0596 0.0983 0.0596 0.0133 0.0030 0.0133 0.0219 0.0133 0.0030 1 1

Derivative of Gaussian filters x-direction y-direction Source: L. Lazebnik

Smoothing with a Gaussian Recall: parameter σ is the scale / width / spread of the Gaussian kernel, and controls the amount of smoothing.

Effect of σ on derivatives The apparent structures differ depending on Gaussian s scale parameter. Larger values: larger scale edges detected Smaller values: finer features detected σ = 1 pixel σ = 3 pixels

Edge Detection Steps Using Gradient (i.e., sqrt is costly!)

Edge Direction Implementation Typically quantize the gradient orientation to a fixed number of orientations You can identify the edges based on magnitude and direction How Many Directions or Levels?

#32

Isotropy #33

Isotropic property of gradient magnitude The magnitude of the gradient detects edges in all directions. d dx I d dy I d d I I dx dy 2 2

Edge Detection Using the Gradient Isotropic property of gradient magnitude: The magnitude of gradient is an isotropic operator (it detects edges in any direction!!) #35

Anisotropic Filtering (i.e., edge preserving smoothing) Symmetric Gaussian smoothing tends to blur out edges rather aggressively. An oriented smoothing operator would work better: (i) Smooth aggressively perpendicular to the gradient (ii) Smooth little along the gradient

Anisotropic filtering - Example result using anisotropic filtering

#38

Edge Detection Using the 2 nd Derivative Edge points can be detected by finding the zerocrossings of the second derivative. #39 There are two approaches that uses the second derivative to identify the edge presence Smoothing then apply Gradient Combine smoothing and Gradient Opertations

Edge Detection Using Second Derivative Approximate finding maxima/minima of gradient magnitude by finding places where: Can t always find discrete pixels where the second derivative is zero look for zerocrossing instead.

Edge Detection Using Second Derivative Computing the 2 nd derivative: #41 This approximation is centered about x + 1 By replacing x + 1 by x we obtain:

Image Derivatives 1 st order 2 nd order

Edge Detection Using Second Derivative (cont d)

Edge Detection Using Second Derivative (cont d) Computing the 2 nd derivative cont. Examples using the edge models: #44

Edge Detection Using Second Derivative (cont d) (upward) step edge (downward) step edge ramp edge roof edge

Edge Detection Using Second Derivative (cont d) Four cases of zero-crossings: {+,-}, {+,0,-},{-,+}, {-,0,+} Slope of zero-crossing {a, -b} is: a+b. To detect strong zero-crossing, threshold the slope.

Second Derivative in 2D: Laplacian

Second Derivative in 2D: Laplacian

Variations of Laplacian

Laplacian - Example detect zero-crossings

Properties of Laplacian It is cheaper to implement than the gradient (i.e., one mask only). It does not provide information about edge direction. It is more sensitive to noise (i.e., differentiates twice). It is an isotropic operator ( equal weights in all directions )

Noise Effect on Derivates Where is the edge??

Solution: smooth first

Effect of Smoothing on Derivatives (cont d)

Combine Smoothing with Differentiation (i.e., saves one operation)

Consider Laplacian of Gaussian Laplacian of Gaussian operator ME5286 Where Lecture is the edge? 6 Zero-crossings of bottom graph Slide credit: Steve Seitz

2D edge detection filters Laplacian of Gaussian Gaussian derivative of Gaussian is the Laplacian operator: Slide credit: Steve Seitz

Laplacian of Gaussian (LoG) (Marr-Hildreth operator) To reduce the noise effect, the image is first smoothed. When the filter chosen is a Gaussian, we call it the LoG edge detector. σ controls smoothing It can be shown that: (inverted LoG) 2σ 2

Laplacian of Gaussian (LoG) (Marr-Hildreth operator) The 2-D Laplacian of Gaussian (LoG) function centered on zero and with Gaussian standard deviation has the form: where σ is the standard deviation The amount of smoothing can be controlled by varying the value of the standard deviation.

Laplacian of Gaussian (LoG) - (inverted LoG) Example (inverted LoG) filtering zero-crossings

Decomposition of LoG It can be shown than LoG can be written as follows: 2 gxy (, ) 2D LoG convolution can be implemented using 4, 1D convolutions. 2 g(, x y)*(, Ixy)

Edge Detection Using the 2 nd Derivative Separability #62 Gaussian Filtering Image g(x) g(y) + I g Laplacian-of-Gaussian Filtering g xx (x) g(x) Image 2 + I * g g yy (y) g(y)

Edge Detection Using the 2 nd Derivative Separability Gaussian: A 2-D Gaussian can be separated into two 1-D Gaussians Perform 2 convolutions with 1-D Gaussians #63 h( x, y) I( x, y)* g( x, y) I( x, y)* g ( x) * g ( ) h( x, y) 2 1 y n 2 multiplications per pixel 2n multiplications per pixel g 1.011.13.6 1.6.13.011 g 2.011.13.6 1.6.13.011

Decomposition of LoG (cont d) Steps

Edge Detection Using LOG Marr-Hildteth (LOG) Algorithm: #65 Compute LoG Use one 2D filter: Use four 1D filters: 2 g( x, y) g( x), g ( x), g( y), g ( y) Find zero-crossings from each row and column Find slope of zero-crossings Apply threshold to slope and mark edges xx yy

Laplacian of Gaussian (LoG) - Example The Laplacian-of-Gaussian (LOG) cont. I I * 2 G #66 Zero crossings of I*( 2 G)

Laplacian of Gaussian (LoG) - Example The Laplacian-of-Gaussian (LOG) cont. #67 1 3 6

Difference of Gaussians (DoG) The Laplacian of Gaussian can be approximated by the difference between two Gaussian functions: approximation actual LoG

Difference of Gaussians (DoG) (cont d) (a) (b) (b) (a)

Gradient vs LoG (cont d) Disadvantage of LOG edge detection: Does not handle corners well #70

Gradient vs LoG Gradient works well when the image contains sharp intensity transitions and low noise. Zero-crossings of LOG offer better localization, especially when the edges are not very sharp. step edge ramp edge

Practical Issues Noise suppression-localization tradeoff. Smoothing depends on mask size (e.g., depends on σ for Gaussian filters). Larger mask sizes reduce noise, but worsen localization (i.e., add uncertainty to the location of the edge) and vice versa. smaller mask larger mask

Choice of Threshold Trade off of threshold value. gradient magnitude low threshold high threshold

Standard thresholding Standard thresholding: - Can only select strong edges. - Does not guarantee continuity. gradient magnitude low threshold high threshold

Hysteresis thresholding Hysteresis thresholding uses two thresholds: - low threshold t l - high threshold t h (usually, t h = 2t l ) t l t h t h t l For maybe edges, decide on the edge if neighboring pixel is a strong edge.

Hysteresis Thresholding Example #76

Edge Detection Review Edge detection operators are based on the idea that edge information in an image is found by looking at the relationship a pixel has with its neighbors If a pixel's gray level value is similar to those around it, there is probably not an edge at that point #77

Edge Detection Review Edge detection operators are often implemented with convolution masks and most are based on discrete approximations to differential operators #78 Differential operations measure the rate of change in a function, in this case, the image brightness function

Edge Detection Review Preprocessing of image is required to eliminate or at least minimize noise effects There is tradeoff between sensitivity and accuracy in edge detection The parameters that we can set so that edge detector is sensitive include the size of the edge detection mask and the value of the gray level threshold A larger mask or a higher gray level threshold will tend to reduce noise effects, but may result in a loss of valid edge points #79