You are on page 1of 22

The Topographic Primal Sketch

Robert Haralick
Layne Watson
Thomas Laey
The International Journal Of Robotics
Research
Vol 2 No 1 Spring 1983
1
The Topographic Primal Sketch
Classify the underlying image inten-
sity surface patches according to the
categories dened by monotonic gray
tone invariant functions of directional
derivatives.
Peak
Pit
Ridge
Ravine
Saddle
Flat
Hillside
2
The Gradient Vector
The gradient f of f is a vector whose
magnitude at a given point (r, c) is the
maximum rate of change of f at that
point and whose direction is the direc-
tion in which the surface has the great-
est rate of change.
f =

f
r
f
c

3
Directional Derivative
The directional derivative of a function
f at the point (r, c) in the direction is
denoted by f

(r, c).
f

(r, c) = lim
h0
f(r + hsin , c + hcos ) f(r, c)
h
The direction is the clockwise angle
from the column axis.
f

(r, c) =
f
r
(r, c) sin +
f
c
(r, c) cos
= (sin cos )f
4
Hessian
H =

2
f

2
r

2
f
rc

2
f
rc

2
f

2
c

We denote the second derivative of f


at the point (r, c) in the direction by
f

(r, c)
f

(r, c) = (sin cos )H

sin
cos

5
Notation
f gradient vector of a function f
f gradient magnitude of f

1
unit vector in the direction in
which second directional derivative-
has the greatest magnitude

2
unit vector in the direction in
which second directional derivative
has the smallest magnitude

1
value of second directional deriva-
tive in the direction of
1

2
value of second directional deriva-
tive in the direction of
2
f
1
value of rst directional deriva-
tive in the direction of
1
f
2
value of rst directional deriva-
tive in the direction of
2
6
Curvature
There is a direct relationship between
the eigenvalues
1
and
2
and the cur-
vature in the directions
1
and
2
.
When the rst directional derivative
f
i
=0, then the curvature in the
direction
i
is
=

i

1 + f f
7
Peak
A peak occurs where there is local max-
ima in all directions.
f(r, c) =0

1
< 0

2
< 0
8
Pit
A pit occurs where there is local min-
ima in all directions.
f(r, c) =0

1
> 0

2
> 0
9
Ridge
A ridge occurs where there is a lo-
cal maximum in one direction. As we
walk along a ridge, the points to the
right and left of us are lower than the
ones we are on. The direction across
the ridge is the direction in which the
curvature is extremized.
10
Sloped or Curved Ridge
A sloped or curved ridge must satisfy
one or the other of the following sets
of conditions.
f(r, c) = 0

1
< 0
f(r, c)
1
= 0
f(r, c) = 0

2
< 0
f(r, c)
2
= 0
11
Flat Ridge
A at ridge must satisfy one of the
following sets of conditions.
f(r, c) = 0

1
< 0

2
= 0
f(r, c) = 0

1
= 0

2
< 0
12
Ravine
A ravine (valley) is identical to a ridge
except that it is a local minimum (rather
than maximum) in one direction. As
we walk along the ravine line, the points
to the right and left of us are higher
than the point we are on. A ravine
may be sloped or curved or at.
13
Sloped or Curved Ravine
f(r, c) = 0

1
> 0
f(r, c)
1
= 0
f(r, c) = 0

2
> 0
f(r, c)
2
= 0
14
Flat Ravine
A at ravine must satisfy one of the
following sets of conditions.
f(r, c) = 0

1
> 0

2
= 0
f(r, c) = 0

1
= 0

2
> 0
15
Saddle Point
f(r, c) = 0

1

2
< 0
16
Flat
A at (plain) is a simple horizontal
surface. It must have zero gradient
and no curvature.
f(r, c) = 0

1
= 0

2
= 0
17
Hillside
A hillside is anything not covered by
the previous categories. It has nonzero
gradient and no strict extrema in the
directions of maximum and minimum
second directional derivative.
Any one of the four conditions imply
a hillside.
f
1
= 0
f
2
= 0
f
1
= 0

2
= 0
f
2
= 0

1
= 0
f = 0

1
= 0

2
= 0
18
Hillside Subcategories
Slope if
1
=
2
= 0
Convex if
1
> 0 and
2
0 or

2
> 0 and
1
0
Concave if
1
< 0 and
2
0 or

2
< 0 and
1
0
Saddle if
1

2
< 0
19
Ridge Ravine Continua
Entire areas may be classied as ridge
or ravine.
Right circular cone: f(r, c) =

r
2
+ c
2
Hemisphere: f(r, c) =

k
2
r
2
c
2
Any function of the form h(r
2
+ c
2
)
20
Surface Estimation
If we assume that the observed sur-
face is a noisy discretely sampled ob-
servation, then there is a problem of
how to estimate derivatives. Methods
based strictly on nite dierences will
fail miserably in noise. Least squares
estimation or robust least squares es-
timation must be used.
21
Classication
1. Estimate the surface around each
pixel by a local least squares or local
robust least squares.
2. Use the estimated surface to nd
the gradient, gradient magnitude, and
the eigenvalues and eigenvectors of
the Hessian at the center of the pixels
neighborhood (0,0).
3. Search in the direction of the eigen-
vectors calculated in step 2 for a
zero-crossing of the rst directional
derivative within the pixels area. If
the eigenvalues of the Hessian are
equal and nonzero, then search in
the Newton direction.
4. Recompute the gradient, gradient
magnitude, and values of the sec-
ond directional derivative extrema
at each zero-corssing. Then apply
the labeling scheme.
22

You might also like