Edge Detection and Geometric Primitive Extraction Jinxiang Chai.

Slides:



Advertisements
Similar presentations
Lecture 2: Convolution and edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Advertisements

Fitting: The Hough transform. Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not.
Edge Detection CSE P 576 Larry Zitnick
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Fitting: The Hough transform
Lecture 4 Edge Detection
Announcements Mailing list: –you should have received messages Project 1 out today (due in two weeks)
EE663 Image Processing Edge Detection 2 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
CSCE 641 Computer Graphics: Image Filtering & Feature Detection Jinxiang Chai.
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Segmentation (Section 10.2)
Lecture 2: Image filtering
Lecture 4: Edge Based Vision Dr Carole Twining Thursday 18th March 2:00pm – 2:50pm.
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
Fitting: The Hough transform
Edge Detection.
Robust estimation Problem: we want to determine the displacement (u,v) between pairs of images. We are given 100 points with a correlation score computed.
Computational Photography: Image Processing Jinxiang Chai.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
כמה מהתעשייה? מבנה הקורס השתנה Computer vision.
Neighborhood Operations
Computer Vision Spring ,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30 – 11:50am.
Computer Vision More Image Features Hyunki Hong School of Integrative Engineering.
Fitting: The Hough transform. Voting schemes Let each feature vote for all the models that are compatible with it Hopefully the noise features will not.
Fitting & Matching Lecture 4 – Prof. Bregler Slides from: S. Lazebnik, S. Seitz, M. Pollefeys, A. Effros.
Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Image processing.
Image Processing Edge detection Filtering: Noise suppresion.
Edges. Edge detection schemes can be grouped in three classes: –Gradient operators: Robert, Sobel, Prewitt, and Laplacian (3x3 and 5x5 masks) –Surface.
Introduction to Image Processing
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection From Sandlot ScienceSandlot Science.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski, Ch 4.1.2, From Sandlot.
SHINTA P. Juli What are edges in an image? Edge Detection Edge Detection Methods Edge Operators Matlab Program.
Fitting: The Hough transform
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.
Many slides from Steve Seitz and Larry Zitnick
Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin - Stout Edge Detection.
Object Detection 01 – Basic Hough Transformation JJCAO.
Announcements Project 0 due tomorrow night. Edge Detection Today’s readings Cipolla and Gee (handout) –supplemental: Forsyth, chapter 9Forsyth For Friday.
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.
Edge Segmentation in Computer Images CSE350/ Sep 03.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Hough Transform CS 691 E Spring Outline Hough transform Homography Reading: FP Chapter 15.1 (text) Some slides from Lazebnik.
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
Winter in Kraków photographed by Marcin Ryczek
Miguel Tavares Coimbra
Edge Detection slides taken and adapted from public websites:
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering Northern Arizona University.
Line Fitting James Hayes.
Detection of discontinuity using
Fitting: The Hough transform
Edge Detection CS 678 Spring 2018.
Edge Detection EE/CSE 576 Linda Shapiro.
Lecture 2: Edge detection
Jeremy Bolton, PhD Assistant Teaching Professor
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Dr. Chang Shu COMP 4900C Winter 2008
Edge Detection CSE 455 Linda Shapiro.
Edge Detection Today’s reading
Lecture 2: Edge detection
Edge Detection Today’s reading
Edge Detection Today’s readings Cipolla and Gee Watt,
Lecture 2: Edge detection
Winter in Kraków photographed by Marcin Ryczek
IT472 Digital Image Processing
Introduction to Artificial Intelligence Lecture 22: Computer Vision II
Presentation transcript:

Edge Detection and Geometric Primitive Extraction Jinxiang Chai

Outline Edge detection Geometric primitive extraction

Edge Detection What are edges in this image?

Edge Detection What are edges in this image?

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

Edge Detection One of the most important vision problems - really easy for human - really difficult for computers - fundamental for computer vision (object recognition, 3D reconstruction, etc.) How to tell a pixel is on the edge?

Characterizing edges An edge is a place of rapid change in the image intensity function image intensity function (along horizontal scanline) first derivative edges are related to derivative

Gradient A vector variable - Direction of the maximum growth of the function - Magnitude of the growth - Perpendicular to the edge direction

Gradients

How to Calculate Gradient? How to compute ? Intensity Pixel column

The Good ole’ Taylor Series Subtracting the second from the first we obtain or…

Discrete Gradient Estimation For discrete functions, we can use the first order approximation of the gradient where h corresponds to the step size

Discrete Gradient Estimation For discrete functions, we can use the first order approximation of the gradient where h corresponds to the step size For our purposes, h corresponds to the width of 1 pixel =>

Discrete Gradient Estimation So how can we compute the image gradient efficiently? - Using our good old friend convolution! - Dropped off the “divide by 2” for speed considerations. - This only scales the gradient.

Taking the Discrete Derivative abs()

Basic Edge Detection Step 1 INPUT IMAGE 1) Edge Enhancement Horizontal [-1 0 1] Vertical [-1 0 1] T But isn’t edge detection susceptible to noise?

Basic Edge Detection Steps 1-2 INPUT IMAGE 2) Edge Enhancement Horizontal [-1 0 1] Vertical [-1 0 1] T 1) Noise Smoothing

Discrete Gradient Estimation Remember that the gradient is a vector and we have calculated the coefficients in the x and y directions at each point in the image After convolving, we get the magnitude of the gradient from at each point (pixel) from In practice, we often sum the absolute values of the components for computational efficiency

Basic Edge Detection (cont’d) INPUT IMAGE 1) Noise Smoothing 2) Edge Enhancement Horizontal [-1 0 1] Vertical [-1 0 1] T “GRADIENT” IMAGE

Basic Edge Detection (cont’d) INPUT IMAGE 1) Noise Smoothing 2) Edge Enhancement Horizontal [-1 0 1] Vertical [-1 0 1] T “GRADIENT” IMAGE What does the gradient image mean?

Basic Edge Detection (cont’d) INPUT IMAGE 1) Noise Smoothing 2) Edge Enhancement Horizontal [-1 0 1] Vertical [-1 0 1] T “GRADIENT” IMAGE What does the gradient image mean? - Magnitude of intensity changes around each pixel

Discrete Gradient Estimation So how do we segment the edges from the rest of the scene? - Thresholding!

The Effects of Thresholding While edge features are independent of illumination, the edge strength is not! Results from threshold values of 50 and 100

Basic Edge Detection Summary INPUT IMAGE 1) Noise Smoothing EDGE IMAGE 2) Edge Enhancement Horizontal [-1 0 1] Vertical [-1 0 1] T “GRADIENT” IMAGE 3)Threshold

The effects of Filtering Noise Threshold 20 Gaussian SmoothingUnsmoothed Edges Threshold 50

Sobel Edge Detection One of the dominant edge detection schemes uses the Sobel operators Convolving each of these with the original image generates horizontal and vertical gradient images that are combined as before

Sobel Edge Detection One of the dominant edge detection schemes uses the Sobel operators - Can be approximated as a derivative of Gaussian - First Gaussian smoothing and then compute derivatives

Sobel Edge Detection One of the dominant edge detection schemes uses the Sobel operators - Can be approximated as a derivative of Gaussian - First Gaussian smoothing and then compute derivatives Why?

Sobel Edge Detection One of the dominant edge detection schemes uses the Sobel operators - Can be approximated as a derivative of Gaussian - First Gaussian smoothing and then compute derivatives - In practice we may still need to smooth for noise

Robert and Prewitt Edge Detectors The Prewitt is similar to the Sobel, but uses a different kernel Roberts was an early edge detector kernel

Sobel Edge Detector Java Applet

Second Derivative Edge Detector Sobel Operator can produce thick edges; ideally we are looking for infinitely thin boundaries

Second Derivative Edge Detector Sobel Operator can produce thick edges; ideally we are looking for infinitely thin boundaries An alternative approach is to look for local extrema in the first derivative A peak in the first derivative corresponds what in the second derivative?

Second Derivative Edge Detector Sobel Operator can produce thick edges; ideally we are looking for infinitely thin boundaries An alternative approach is to look for local extrema in the first derivative A peak in the first derivative corresponds what in the second derivative?

Localization with Laplacian An equivalent measure of the second derivative in 2D is the Laplacian: Numerically, we approximate the Laplacian using the following filtering kernel: Zeros crossings of the filter corresponds to positions of maximum gradient. - can be used for detecting edges - might be sensitive to noise - need to filter the image

Laplacian of Gaussian In the LoG, there are two methods which are mathematically equivalent: - Convolve the image with a gaussian smoothing filter and compute the Laplacian of the result - Convolve the image with the linear filter that is the Laplacian of the Gaussian filter

The Laplacian of Gaussian Kernel

The Laplacian of Gaussian Filter Kernel

To avoid detection of insignificant edges, only the zero crossings whose corresponding first derivative is above some threshold, are selected as edge point. Laplacian Edge Detector Java applet: Click here here

Edge Detection Matlab functions for edge detection: - BW = edge(I,'sobel') % Sobel detector - BW = edge(I,'prewitt') % Prewitt detector - BW = edge(I,'roberts') % Robert detector - BW = edge(I,'log') % Laplacian of Gaussian detector - BW = edge(I,'canny') % canny detector

Outline Edge detection Geometric primitive extraction

Finding straight lines One solution: try many possible lines and see how many points each line passes through Hough transform provides a fast way to do this

Outline of Hough Transform 1.Create a grid of parameter values 2.Each point votes for a set of parameters, incrementing those values in grid 3.Find maximum or local maxima in grid

Finding lines using Hough transform Using m,b parameterization Using r, theta parameterization –Using oriented gradients Practical considerations –Bin size –Smoothing

Hough transform An early type of voting scheme General outline: –Discretize parameter space into bins –For each feature point in the image, put a vote in every bin in the parameter space that could have generated this point –Find bins that have the most votes P.V.C. Hough, Machine Analysis of Bubble Chamber Pictures, Proc. Int. Conf. High Energy Accelerators and Instrumentation, 1959 Image space Hough parameter space

Parameter space representation A line in the image corresponds to a point in Hough space Image spaceHough parameter space Source: S. Seitz

Parameter space representation What does a point (x 0, y 0 ) in the image space map to in the Hough space? Image spaceHough parameter space

Parameter space representation What does a point (x 0, y 0 ) in the image space map to in the Hough space? –Answer: the solutions of b = –x 0 m + y 0 –This is a line in Hough space Image spaceHough parameter space

Parameter space representation Where is the line that contains both (x 0, y 0 ) and (x 1, y 1 )? Image spaceHough parameter space (x 0, y 0 ) (x 1, y 1 ) b = –x 1 m + y 1

Parameter space representation Where is the line that contains both (x 0, y 0 ) and (x 1, y 1 )? –It is the intersection of the lines b = –x 0 m + y 0 and b = –x 1 m + y 1 Image spaceHough parameter space (x 0, y 0 ) (x 1, y 1 ) b = –x 1 m + y 1

Problems with the (m,b) space: –Unbounded parameter domain –Vertical lines require infinite m Parameter space representation

Problems with the (m,b) space: –Unbounded parameter domain –Vertical lines require infinite m Alternative: polar representation Parameter space representation Each point will add a sinusoid in the ( ,  ) parameter space

Algorithm outline Initialize accumulator H to all zeros For each edge point (x,y) in the image For θ = 0 to 180 ρ = x cos θ + y sin θ H(θ, ρ) = H(θ, ρ) + 1 end end Find the value(s) of (θ, ρ) where H(θ, ρ) is a local maximum –The detected line in the image is given by ρ = x cos θ + y sin θ ρ θ

features votes Basic illustration

Square Circle Other shapes

Several lines

A more complicated image

featuresvotes Effect of noise

featuresvotes Effect of noise Peak gets fuzzy and hard to locate

Dealing with noise Choose a good grid / discretization –Too coarse: large votes obtained when too many different lines correspond to a single bucket –Too fine: miss lines because some points that are not exactly collinear cast votes for different buckets Increment neighboring bins (smoothing in accumulator array) Try to get rid of irrelevant features –Take only edge points with significant gradient magnitude

Incorporating image gradients Recall: when we detect an edge point, we also know its gradient direction But this means that the line is uniquely determined! Modified Hough transform: For each edge point (x,y) θ = gradient orientation at (x,y) ρ = x cos θ + y sin θ H(θ, ρ) = H(θ, ρ) + 1 end

Line detection Matlab functions for line detection: [H, theta, rho] = hough(BW)

Hough transform for Other Shapes How many dimensions will the parameter space have?

Hough transform for Other Shapes How many dimensions will the parameter space have? (x0,y0, r)(x0,y0, a,b,theta)

Things to remember Edge detector - First order method: smooth- >gradients->thresholding - Second order method: zero crossings for LOG Hough transform = points vote for shape parameters