Title: Image Based Information Processing
1Image Based Information Processing
- Lecturer Steve Maybank
- School of Computer Science and Information
Systems - sjmaybank_at_dcs.bbk.ac.uk
- http//www.dcs.bbk.ac.uk/sjmaybank
- Spring 2009
- Week 2a Detection of Corners, Edges and Lines
2Grey Level Discontinuities
Grey level discontinuities often have
useful physical interpretations, e.g. as
boundaries of objects
http//hlab.phys.rug.nl/imlib/c1001_1200/index.htm
l
3Corners
Highlight Small feature on a surface
Corner of an object
4Uniform Regions and Edges
Edges
Uniform grey levels
Object boundary Surface marking Convex fold,
Concave fold Shadow boundary
Part of a single object Part of a uniform
region, e.g. road, field, sky
Image interpretation is difficult because a
single grey level patch usually has many possible
interpretations.
5Edges in an Image of a Natural Scene
Original image at http//hlab.phys.rug.nl/imlib/c1
001_1200/index.html
6Problem
- When is an image patch a corner, an edge or a
line? - Pragmatic solution design a plausible algorithm
for detecting corners. Define anything it detects
to be a corner. - Theoretical solution make a mathematical model
of an ideal corner. Define any image patch which
matches the model to be a corner. - The two solutions lead to similar results.
7Algorithm for Structure Detection
- Apply to the image one or more linear filters
which have large responses to the structure in
question. - Choose a threshold.
- Detect the structure in those parts of the image
where a well chosen function of the filter values
exceeds the threshold.
8Linear Filter for Recognising Corners
Response8
Filter mask (Gon.W.)
Response3
Response5
9Responses to the Corner Detector
Filter mask
Original image
Filtered imageabsolute values of the
filter responses
10Top 1000 Responses
Threshold234
Original image
Locations of top 1000 responses shown by
3x3 blocks of peak white
11Top 100 Responses
Threshold384
Original image
Locations of top 100 responses shown by
3x3 blocks of peak white
12Histogram of Absolute Values of Filter Responses
Threshold for top 1000 responses 234 Threshold
for top 100 responses 384
13Edges
- An edge is an image region in which the grey
level gradients have a common direction and large
magnitudes.
- But which image regions are edges?
14Grey Level Gradient ideal version
- The grey levels vary smoothly over the image.
- The grey level gradient at an image point p is a
vector v. - The direction of v is the direction at p in which
the grey level increases most rapidly. - The magnitude of v is the rate of increase of
grey level in the direction of v.
15Analogy
- Think of the image as a contour map and think of
the grey level as height. - Let v be the gradient at a point p on the map.
- The direction of v is uphill.
- The magnitude of v is the slope of the hill in
the direction of v.
16Grey Level Gradient expensive practical version
Form the sum
Find a,b,c for which V is a minimum. Gradient at
(2,2) (a,b).
17Grey Level Gradient cheap practical version
Filter the image with the Sobel masks
Let the two responses at a pixel p be g1(p),
g2(p). The gradient at p is (g1(p), g2(p)). The
magnitude of the gradient at p is
(g1(p)2g2(p)2)1/2.
18Top 1000 Edge Responses
Top 1000 edges. Threshold245.6
Original image
19Top 100 Edge Responses
Top 100 edges. Threshold422.1
Original image
20Histogram of Sobel Edge Magnitudes
Threshold for top 1000 responses 245.6 Threshold
for top 100 responses 422.1
21Specification of a Line
y
Line not containing the origin give polar
coordinates (r,?) of the point on the line
closest to the origin.
p
r
x
Line containing the origin r0, ?slope of
normal to the line.
?
Equation of line (x, y).(cos(?), sin(?))r.
22Parameter Space for Lines in a Disk
- Radius of diskR.
- Origin of coordinates at the centre of the disk.
- Range of values of r 0ltrltR.
- Range of values of ? 0lt?lt2p.
- Parameter space for lines0,R)x0, 2p).
23Sobel Edge Magnitudes
Original image
Sobel edge magnitudes
24Hough Transform Method for Line Detection
- Divide 0,R)x0,2p) into small rectangles (bins,
accumulators). - Compute the Sobel edge magnitudes of the image.
- Find the locations (x1,y1), (x2,y2), of the
largest Sobel edge magnitudes. - For each i, increment all the accumulators
containing lines which pass through (xi,yi). - Find the accumulators with the largest values.
The centres of these accumulators are the
detected lines.
25Lines Passing Through (x,y)
Line (r,?)
The points (r,?) in 0,R)x0,2p) corresponding to
lines through (x,y) satisfy x cos(?)y sin(?)r
(x,y)
Origin
26Accumulator Cells
?
Accumulator cells which contain lines through
(x,y).
r
27Results of Hough Transform
Lines corresponding To the 10 accumulators with
the largest values
Largest 1000 Sobel magnitudes
Original image
28Problems with the Hough Transform
- Thresholds needed for the edge magnitudes and the
accumulator values. - How should the parameter space 0,R)x0,2p) for
lines be divided into accumulators? - Chance alignments in the image can lead to
spurious detections of lines.
29References
- See chapter 15 of Computer Visiona modern
approach by D.A. Forsyth and J. Ponce for an
excellent discussion of the Hough transform. - Also see Section 10.2.2 of Digital Image
Processing by R.C. Gonzalez and R.E. Woods.