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

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

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

Other Linear Filters CS 211A

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

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

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

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

Anno accademico 2006/2007. Davide Migliore

Edge Detection. EE/CSE 576 Linda Shapiro

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

CS5670: Computer Vision

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

An edge is not a line... Edge Detection. Finding lines in an image. Finding lines in an image. How can we detect lines?

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

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

Lecture 7: Most Common Edge Detectors

Edge and corner detection

CS4670: Computer Vision Noah Snavely

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

Edge detection. Gradient-based edge operators

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

Generalized Hough Transform, line fitting

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

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

Lecture 4: Finding lines: from detection to model fitting

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

Edge Detection CSC 767

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

Lecture 9: Hough Transform and Thresholding base Segmentation

Lecture 6: Edge Detection

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

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

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

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

Announcements. Hough Transform [ Patented 1962 ] Generalized Hough Transform, line fitting. Assignment 2: Due today Midterm: Thursday, May 5 in class

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

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

Prof. Feng Liu. Winter /15/2019

Lecture 8: Fitting. Tuesday, Sept 25

Digital Image Processing. Image Enhancement - Filtering

Biomedical Image Analysis. Point, Edge and Line Detection

Lecture 15: Segmentation (Edge Based, Hough Transform)

Straight Lines and Hough

Local Image preprocessing (cont d)

DIGITAL IMAGE PROCESSING

Image Processing

Neighborhood operations

EE795: Computer Vision and Intelligent Systems

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

Image gradients and edges April 11 th, 2017

Model Fitting. Introduction to Computer Vision CSE 152 Lecture 11

Image Analysis. Edge Detection

Image gradients and edges April 10 th, 2018

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

Feature Detectors and Descriptors: Corners, Lines, etc.

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

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

Lecture: Edge Detection

Feature extraction. Bi-Histogram Binarization Entropy. What is texture Texture primitives. Filter banks 2D Fourier Transform Wavlet maxima points

Edge Detection Lecture 03 Computer Vision

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

Practical Image and Video Processing Using MATLAB

Filtering Images. Contents

Image features. Image Features

Image Understanding Edge Detection

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

Digital Image Processing COSC 6380/4393

GENERALIZING THE HOUGH TRANSFORM TO DETECT ARBITRARY SHAPES. D. H. Ballard Pattern Recognition Vol. 13 No

Fitting: Voting and the Hough Transform April 23 rd, Yong Jae Lee UC Davis

Segmentation (Part 2)

Segmentation and Grouping

Capturing, Modeling, Rendering 3D Structures

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

HOUGH TRANSFORM CS 6350 C V

Edges and Binary Images

Fitting. Lecture 8. Cristian Sminchisescu. Slide credits: K. Grauman, S. Seitz, S. Lazebnik, D. Forsyth, J. Ponce

Image gradients and edges

Edges and Lines Readings: Chapter 10: better edge detectors line finding circle finding

Outlines. Medical Image Processing Using Transforms. 4. Transform in image space

E0005E - Industrial Image Analysis

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

Announcements. Segmentation (Part 2) Image Segmentation. From images to objects. Image histograms. What do histograms look like?

Comparison between Various Edge Detection Methods on Satellite Image

Review of Filtering. Filtering in frequency domain

Line, edge, blob and corner detection

School of Computing University of Utah

ECG782: Multidimensional Digital Signal Processing

Issues with Curve Detection Grouping (e.g., the Canny hysteresis thresholding procedure) Model tting They can be performed sequentially or simultaneou

Finding 2D Shapes and the Hough Transform

Image Analysis. Edge Detection

EE795: Computer Vision and Intelligent Systems

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

Computer Vision. Image Segmentation. 10. Segmentation. Computer Engineering, Sejong University. Dongil Han

Image Processing. Traitement d images. Yuliya Tarabalka Tel.

Edges and Lines Readings: Chapter 10: better edge detectors line finding circle finding

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

EECS490: Digital Image Processing. Lecture #19

Image gradients and edges

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

Computer Vision 6 Segmentation by Fitting

Transcription:

Edge Detection

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

Origin of Edges surface normal discontinuity depth discontinuity surface color discontinuity illumination discontinuity Edges are caused by a variety of factors

Edge detection How can you tell that a pixel is on an edge?

Profiles of image intensity edges

Edge detection 1. Detection of short linear edge segments (edgels) 2. Aggregation of edgels into extended edges (maybe parametric description)

Edgel detection Difference operators Parametric-model matchers

Edge is Where Change Occurs Change is measured by derivative in 1D Biggest change, derivative has maximum magnitude Or 2 nd derivative is zero.

Image gradient The gradient of an image: The gradient points in the direction of most rapid change 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

The discrete gradient How can we differentiate a digital image f[x,y]? Option 1: reconstruct a continuous image, then take gradient Option 2: take discrete derivative (finite difference) How would you implement this as a cross-correlation?

The Sobel operator Better approximations of the derivatives exist The Sobel operators below are very commonly used -1 0 1 1 2 1-2 0 2 0 0 0-1 0 1-1 -2-1 The standard defn. of the Sobel operator omits the 1/8 term doesn t make a difference for edge detection the 1/8 term is needed to get the right gradient value, however

Gradient operators (a): Roberts cross operator (b): 3x3 Prewitt operator (c): Sobel operator (d) 4x4 Prewitt operator

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

Solution: smooth first Where is the edge? Look for peaks in

Derivative theorem of convolution This saves us one operation:

Laplacian of Gaussian Consider Laplacian of Gaussian operator Where is the edge? Zero-crossings of bottom graph

2D edge detection filters Laplacian of Gaussian Gaussian derivative of Gaussian is the Laplacian operator:

Optimal Edge Detection: Canny Assume: Linear filtering Additive iid Gaussian noise Edge detector should have: Good Detection. Filter responds to edge, not noise. Good Localization: detected edge near true edge. Single Response: one per edge.

Optimal Edge Detection: Canny (continued) Optimal Detector is approximately Derivative of Gaussian. Detection/Localization trade-off More smoothing improves detection And hurts localization. This is what you might guess from (detect change) + (remove noise)

The Canny edge detector original image (Lena)

The Canny edge detector norm of the gradient

The Canny edge detector thresholding

The Canny edge detector thinning (non-maximum suppression)

Non-maximum suppression Check if pixel is local maximum along gradient direction requires checking interpolated pixels p and r

Predicting the next edge point 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). (Forsyth & Ponce)

Hysteresis Check that maximum value of gradient value is sufficiently large drop-outs? use hysteresis use a high threshold to start edge curves and a low threshold to continue them.

Effect of σ (Gaussian kernel size) original Canny with Canny with The choice of depends on desired behavior large detects large scale edges small detects fine features

Scale Smoothing Eliminates noise edges. Makes edges smoother. Removes fine detail. (Forsyth & Ponce)

fine scale high threshold

coarse scale, high threshold

coarse scale low threshold

Scale space (Witkin 83) first derivative peaks larger Gaussian filtered signal Properties of scale space (w/ Gaussian smoothing) edge position may shift with increasing scale (σ) two edges may merge with increasing scale an edge may not split into two with increasing scale

Edge detection by subtraction original

Edge detection by subtraction smoothed (5x5 Gaussian)

Edge detection by subtraction Why does this work? smoothed original (scaled by 4, offset +128) filter demo

Gaussian - image filter Gaussian delta function Laplacian of Gaussian

An edge is not a line... How can we detect lines?

Finding lines in an image Option 1: Search for the line at every possible position/orientation What is the cost of this operation? Option 2: Use a voting scheme: Hough transform

Finding lines in an image y b b 0 image space x m 0 Hough space m Connection between image (x,y) and Hough (m,b) spaces A line in the image corresponds to a point in Hough space To go from image space to Hough space: given a set of points (x,y), find all (m,b) such that y = mx + b

Finding lines in an image y b y 0 x 0 image space x Hough space m Connection between image (x,y) and Hough (m,b) spaces A line in the image corresponds to a point in Hough space To go from image space to Hough space: given a set of points (x,y), find all (m,b) such that y = mx + b What does a point (x 0, y 0 ) in the image space map to? A: the solutions of b = -x 0 m + y 0 this is a line in Hough space

Hough transform algorithm Typically use a different parameterization d is the perpendicular distance from the line to the origin θ is the angle this perpendicular makes with the x axis Why?

Hough transform algorithm Typically use a different parameterization d is the perpendicular distance from the line to the origin θ is the angle this perpendicular makes with the x axis Why? Basic Hough transform algorithm 1. Initialize H[d, θ]=0 2. for each edge point I[x,y] in the image for θ = 0 to 180 H[d, θ] += 1 3. Find the value(s) of (d, θ) where H[d, θ] is maximum 4. The detected line in the image is given by What s the running time (measured in # votes)?

Extensions Extension 1: Use the image gradient 1. same 2. for each edge point I[x,y] in the image compute unique (d, θ) based on image gradient at (x,y) H[d, θ] += 1 3. same 4. same What s the running time measured in votes? Extension 2 give more votes for stronger edges Extension 3 change the sampling of (d, θ) to give more/less resolution Extension 4 The same procedure can be used with circles, squares, or any other shape

Extensions Extension 1: Use the image gradient 1. same 2. for each edge point I[x,y] in the image compute unique (d, θ) based on image gradient at (x,y) H[d, θ] += 1 3. same 4. same What s the running time measured in votes? Extension 2 give more votes for stronger edges Extension 3 change the sampling of (d, θ) to give more/less resolution Extension 4 The same procedure can be used with circles, squares, or any other shape

Hough demos Line : http://www/dai.ed.ac.uk/hipr2/houghdemo.html http://www.dis.uniroma1.it/~iocchi/slides/icra2001/java/hough.html Circle : http://www.markschulze.net/java/hough/

Hough Transform for Curves The H.T. can be generalized to detect any curve that can be expressed in parametric form: Y = f(x, a1,a2, ap) a1, a2, ap are the parameters The parameter space is p-dimensional The accumulating array is LARGE!

Generalizing the H.T. The H.T. can be used even if the curve has not a simple analytic form! (x c,y c ) r i φ i α i P i x c = x i + r i cos(α i ) y c = y i + r i sin(α i ) 1. Pick a reference point (x( c,y c ) 2. For i = 1,,n : 1. Draw segment to P i on the boundary. 2. Measure its length r i, and its orientation α i. 3. Write the coordinates of (x( c,y c ) as a function of r i and α i 4. Record the gradient orientation φ i at P i. 3. Build a table with the data, indexed by φ i.

Generalizing the H.T. Suppose, there were m different gradient orientations: (m <= n) (x c,y c ) α j r j r i φ j φ i α i P i x c = x i + r i cos(α i ) y c = y i + r i sin(α i ) φ 1 φ 2... φ m (r 1 1,α 1 1),(r 1 2,α 1 2),,(r 1 n1,α 1 n1 ) (r 2 1,α 2 1),(r 2 2,α 1 2),,(r 2 n2,α 1 n2 )... (r m 1,α m 1),(r m 2,α m 2),,( ),,(r m nm,α m nm ) H.T. table

Generalized H.T. Algorithm: Finds a rotated, scaled, and translated version of the curve: Sr α j j φ j P j θ P i (x c,y c ) Sr φ i α i i θ x c = x i + r i cos(α i ) y c = y i + r i sin(α i ) φ i Sr k α k P k 1. Form an A accumulator array of possible reference points (x( c,y c ), scaling factor S and Rotation angle θ. 2. For each edge (x,y) in the image: 1. Compute φ(x,y) 2. For each (r,α) ) corresponding to θ φ(x,y) do: 1. For each S and θ: 1. x c = x i + r(φ) ) S cos[α(φ) ) + θ] 2. y c = y i + r(φ) ) S sin[α(φ) ) + θ] 3. A(x c,y c,s,θ) ) ++ 3. Find maxima of A.

H.T. Summary H.T. is a voting scheme points vote for a set of parameters describing a line or curve. The more votes for a particular set the more evidence that the corresponding curve is present in the image. Can detect MULTIPLE curves in one shot. Computational cost increases with the number of parameters describing the curve.

Corner detection Corners contain more edges than lines. A point on a line is hard to match.

Corners contain more edges than lines. A corner is easier

Edge Detectors Tend to Fail at Corners

Finding Corners Intuition: Right at corner, gradient is ill defined. Near corner, gradient has two different values.

Formula for Finding Corners We look at matrix: Sum over a small region, the hypothetical corner Gradient with respect to x, times gradient with respect to y C = I I x 2 x I y I x y 2 y I I Matrix is symmetric WHY THIS?

= = 2 1 2 2 0 0 λ λ y y x y x x I I I I I I C First, consider case where: This means all gradients in neighborhood are: (k,0) or (0, c) or (0, 0) (or off-diagonals cancel). What is region like if: 1. λ1 = 0? 2. λ2 = 0? 3. λ1 = 0 and λ2 = 0? 4. λ1 > 0 and λ2 > 0?

General Case: From Linear Algebra, it follows that because C is symmetric: C = R λ 0 1 1 0 λ2 R With R a rotation matrix. So every case is like one on last slide.

So, to detect corners Filter image. Compute magnitude of the gradient everywhere. We construct C in a window. Use Linear Algebra to find λ1 and λ2. If they are both big, we have a corner.