Title: 3-D Computer Vision CSc 83020
13-D Computer VisionCSc 83020
- Feature Detection and Grouping
2Finding Corners
3What Is a Corner?
Large gradients in more than one direction.
4A Simple Corner Detector
Find eigenvalues of C
If the smaller eigenvalue is above a threshold
then we have a corner.
5A Simple Corner Detector
Find eigenvalues of C
If the smaller eigenvalue is above a threshold
then we have a corner.
6A Simple Corner Detector
7Sobel Operator
-1 -2 -1 0 0 0 1 2 1
-1 0 1 -2 0 2 -1 0 1
S1
S2
Edge Magnitude
2
2
S1 S2
Edge Direction
8Sobel in Matlab
9Canny Edge Detector
10Comparison
Canny
Sobel
11Canny Edge Detection
- Steps
- Apply derivative of Gaussian
- Non-maximum suppression
- Thin multi-pixel wide ridges down to single
pixel width - Linking and thresholding
- Low, high edge-strength thresholds
- Accept all edges over low threshold that are
connected to edge over high threshold
12Non-Maximum Supression
Non-maximum suppression Select the single
maximum point across the width of an edge.
13Linking to the Next Edge Point
Assume the marked point q is an edge point.
Take the normal to the gradient at that point
and use this to predict continuation points
(either r or p).
14Edge Hysteresis
- Hysteresis A lag or momentum factor
- Idea Maintain two thresholds khigh and klow
- Use khigh to find strong edges to start edge
chain - Use klow to find weak edges which continue edge
chain - Typical ratio of thresholds is roughly
- khigh / klow 2
15Canny Edge Detection (Example)
Strong connected weak edges
Original image
Strong edges only
Weak edges
courtesy of G. Loy
16Canny Edge Detection (Example)
Using Matlab with default thresholds
17Bridge Example Again
edge(im,canny)
18Summary Canny Edge Detection
- Most commonly used method
- Traces edges, accommodates variations in contrast
- Not a linear filter!
- Problems with corners
19Towards Global Features
Local versus global
20From Edges to Lines
21Finding Lines
- Assume edge detection
- Each pixel is either edge or not
- How do we find the line?
22Finding Lines
- Assume edge detection
- Each pixel is either edge or not
- How do we find the line?
23Least Squares Fitting of Lines
Minimize E
24Least Squares Fitting of Lines
Minimize E
Problem E must be formulated carefully!
25Least Squares Fitting of Lines
Minimize E
26Hough Transform
y
x
27Hough Transform Quantization
y
x
m
Detecting Lines by finding maxima / clustering in
parameter space
28Hough Transform Algorithm
- For each image point, determine
- most likely line parameters b,m (direction of
gradient) - strength (magnitude of gradient)
- Increment parameter counter by strength value
- Cluster in parameter space, pick local maxima
29Hough Transform Results
Hough Transform
Image
Edge detection
30Finding Lines Using the Hough Transform
31Algorithm
- Discretize the parameter spaces ? and ?.
- Create Accumulator array A(1..R,1..T).
- Set A(k,h)0 for all k and h.
- For each image edge E(i,j)1
- For h1T
- ? i cos?d(h)j sin?d (h)
- Find index k ?d is closest to ?
- Increment A(h,k) by one.
- Find all local maxima (kp, hp) such that A (kp,
hp)gtt
32Finding Lines Using the Hough Transform
Strong local peaks correspond to lines.
33Finding Lines Using the Hough Transform
Resolution Issues
34From Forsyth and Ponce
35Summary Hough Transform
- Smart counting
- Local evidence for global features
- Organized in a table
- Careful with parameterization!
- Problem Curse of dimensionality
- Works great for simple features with 3 unknowns
- Will fail for complex objects
- Problem Not a local algorithm
36Finding Circles by Hough Transform
y
r
b0
(xi,yi)
x
a0
Equation of Circle
37Finding Circles by Hough Transform
y
r
b0
(xi,yi)
x
a0
Equation of Circle
Circles!
If radius r is known
b
y
(xi,yi)
x
a
Accumulator array A(a,b)
38Finding Circles by Hough Transform
y
r
b0
(xi,yi)
x
a0
If r is not known Use accumulator array
A(a,b,r) For each (xi,yi) increment A(a,b,r)
such that
39Using Gradient Information
Can save lot of computations!
Given location (xi,yi) Edge direction fi
y
x
40Using Gradient Information
Can save lot of computations!
Given location (xi,yi) Edge direction fi
y
x
Assume r is known
ax-rcosf by-rsinf Need to increment only one
point in Accumulator Array.
(xi,yi)
y
fi
(a,b)
x
41Hough Transform for Curves
- Curve yf(x,a)
- aa1, , ap the parameters of the curve.
- Limitation size of parameter space wrt of
parameters. - Solution variable-resolution parameter space.
42Hough Transform
- Pattern Matching.
- More efficient than template matching.
- Handles occlusion.
- Finds all instances of pattern.
- Handling inaccurate edge locations?
- Drawbacks?