Lecture 10: Lines from Edges, Interest Points, Binary Operations CAP 5415: Computer Vision Fall 2006
Clarification Gradient-Based Edge Detector with no hysterisis or non-maximal suppression is also often called a Sobel Edge Detector –Usually you convolve with a specific filter
PS2 How I would do it: Problem 2.1 –Write a function minimize that minimizes a function using gradient descent –Input:initial value of w (assume the function to be minimized is a function of w), data necessary for the function (this will be training examples later) –Output: Minimum value of the function and the corresponding w –hard code the function in
PS2 How I would do it: Problem 2.1 –Write a function minimize that minimizes a function using gradient descent –Input:initial value of w (assume the function to be minimized is a function of w), data necessary for the function (this will be training examples later) –Output: Minimum value of the function and the corresponding w –Hard code the function in –References: Forsyth and Ponce 22.4
PS2 Problem 2.3 –Write a function that takes a single input patch and builds a feature vector –Write a second function that builds a feature matrix out of all the patches in a directory
PS2-2.4 Write a function that computes Remember for non-edge examples L=
PS2-2.4 Also write a function that computes the gradient Check numerically! Both functions should have three arguments –Weights –Positive Example Matrix –Negative Example Matrix
PS2-2.4 Now, go back to minimize and plug these new functions in You'll need to do gradient ascent instead of descent
Detecting Corners Corners are often useful feature points for tracking and identification –Often denote unique locations on image Also sometimes referred to as interest- point detectors –Kadir and Brady –Lowe –Harris
Harris Corner Detector Step 1: Calculate horizontal and vertical derivatives Step 2: Compute a moment matrix by summing these values over a window Step 3: Analyze the eigenvalues of this matrix (Borrowed from Wikipedia)
Harris Corner Detector Or look at this function, which doesn’t require square roots Results from Kovesi’s implementation at
From Edges to Lines We’ve talked about detecting Edges, but how can we extract lines from those edges? Basic Idea: Let edge points vote for possible lines
Hough Transform Parameterize lines as Every line can be expressed as a pair of values, θ and r To find lines, we’ll let each point vote for the possible lines that it could lie on.
Basic Idea Discretize the space of θ and r Each point “votes” for all (θ, r) combinations that result in a line passing through that point Combinations corresponding to lines should receive many votes θ r (From Slides by Forsyth)
What if there’s noise? (From Slides by Forsyth)
What if there are no lines? (From Slides by Forsyth)
The Hough Transform Advantages: –Don’t need to know the number of lines ahead of time –Conceptually Simple Disadvantages: –Noise leads to lots of phantom lines –Have to pick the right quantization
Changing Gears The edge-detection algorithm gives us a binary map. It would be useful to group these edges into coherent structures.
Connected Components Algorithm Divides binary image into groups of connected pixels First, need to define the neighborhood
Algorithm is easily explained recursively
Connected Components Called bwlabel in MATLAB image processing toolbox
Next Week Image Segmentation