12
COMPUTER VISION, GRAPmCS, AND IMAGEPROCESSING2~, 228-239 (1984) Position Determination Using Generalized Multidirectional Gradient Codes IC P. LAM Division of Electrical Engineering National Research Council Canada, Ottawa, Canada KIA OR8 Received February 26, 1984. With the assumptions that P1 is a subpicture of P2 (in particular, P2 covers a much larger area than P1), and P1, P2 are contour maps each characterized by a set of magnitudes at regularly spaced discrete points over a rectangular area, a method of determining the possible location of P1 in P2 is described. The method is based on first deriving generalized multidirectional gradient or conjugate-gradient codes for PI; a contour map for P2 having the magnitude (c*) of the center point of P1 as one of the isopleth values is then generated. For each point on all c*-isopleths, a 2-1evel classifier is used for determining the possible location of Pl in P2. 1. INTRODUCTION It is widely accepted that contour map patterns form an important class of pictorial data which can be well exploited for practical application. They include various types of geographic elevation maps, isotherm and isobar in weather maps, and biomedical surface potential maps. Early work in contour map processing [1-4] concentrated on the detection and analysis of local features; more recent studies consider the contour map as a global entity, and various issues such as classification [5], syntactic and semantic encoding [6-8], picture retrieval and understanding [9, 10] have been investigated. This paper considers a particular aspect of contour map processing: The problem of position determination in contour maps. Given two contour maps P1 and P2, where P1 is a subpicture of P2, it is required to find the possible location of P1 in P2. It is assumed that the area covered by P2 is much larger than that of P1, and both P1 and P2 are each characterized by a set of magnitudes at regularly spaced discrete points over a rectangular area. To render the problem transparent for application, we consider the following special case of an intelligent probe. Suppose that before a mission, the onboard computer of the probe is encoded with terrain information of a large operating region as P2, where P2 is characterized by {fl~yli = 1..... ml; j = 1..... m2} (Fig. 1). At a certain time instant t of the probe operation, the measuring instruments obtain information of a local terrain as P1, where P1 is characterized by { aiy]i, j = 1,...,n} (Fig. 2). The problem is to determine the possible position of the probe in P2, assuming that neither additional measurements nor radio link are available. A search strategy for finding the best position of P1 in P2 is proposed as follows: The first step is to obtain the generalized multidirectional gradient or conjugate- gradient codes for P1 based on the given information { a~j }; these gradient codes are used as feature vectors of P1. Making use of linear and nonlinear interpolation techniques as described in [6], a contour map for P2 having the magnitude (c*) of the center point of P1 as one of the isopleth values is then generated. A 2-level 228 0734-189X/84 $3.00

Position determination using generalized multidirectional gradient codes

  • Upload
    kp-lam

  • View
    214

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Position determination using generalized multidirectional gradient codes

COMPUTER VISION, GRAPmCS, AND IMAGE PROCESSING 2~, 228-239 (1984)

Position Determination Using Generalized Multidirectional Gradient Codes

IC P. LAM

Division of Electrical Engineering National Research Council Canada, Ottawa, Canada KIA OR8

Received February 26, 1984.

With the assumptions that P1 is a subpicture of P2 (in particular, P2 covers a much larger area than P1), and P1, P2 are contour maps each characterized by a set of magnitudes at regularly spaced discrete points over a rectangular area, a method of determining the possible location of P1 in P2 is described. The method is based on first deriving generalized multidirectional gradient or conjugate-gradient codes for PI; a contour map for P2 having the magnitude (c*) of the center point of P1 as one of the isopleth values is then generated. For each point on all c*-isopleths, a 2-1evel classifier is used for determining the possible location of Pl in P2.

1. INTRODUCTION

It is widely accepted that contour map patterns form an important class of pictorial data which can be well exploited for practical application. They include various types of geographic elevation maps, isotherm and isobar in weather maps, and biomedical surface potential maps. Early work in contour map processing [1-4] concentrated on the detection and analysis of local features; more recent studies consider the contour map as a global entity, and various issues such as classification [5], syntactic and semantic encoding [6-8], picture retrieval and understanding [9, 10] have been investigated.

This paper considers a particular aspect of contour map processing: The problem of position determination in contour maps. Given two contour maps P1 and P2, where P1 is a subpicture of P2, it is required to find the possible location of P1 in P2. It is assumed that the area covered by P2 is much larger than that of P1, and both P1 and P2 are each characterized by a set of magnitudes at regularly spaced discrete points over a rectangular area. To render the problem transparent for application, we consider the following special case of an intelligent probe. Suppose that before a mission, the onboard computer of the probe is encoded with terrain information of a large operating region as P2, where P2 is characterized by {fl~yli = 1 . . . . . ml; j = 1 . . . . . m2} (Fig. 1). At a certain time instant t of the probe operation, the measuring instruments obtain information of a local terrain as P1, where P1 is characterized by { aiy]i, j = 1 , . . . , n} (Fig. 2). The problem is to determine the possible position of the probe in P2, assuming that neither additional measurements nor radio link are available.

A search strategy for finding the best position of P1 in P2 is proposed as follows: The first step is to obtain the generalized multidirectional gradient or conjugate- gradient codes for P1 based on the given information { a~j }; these gradient codes are used as feature vectors of P1. Making use of linear and nonlinear interpolation techniques as described in [6], a contour map for P2 having the magnitude (c*) of the center point of P1 as one of the isopleth values is then generated. A 2-level

228 0734-189X/84 $3.00

Page 2: Position determination using generalized multidirectional gradient codes

MULTIDIRECTIONAL GRADIENT CODES 229

1321

831

811 812 813 " " " 81 m2

Bml,l I - - ~ml,m2

FIG. 1. Contour map for P2 is characterized by { flij }.

classifier based on a minimum-distance criterion and correlation analysis is used to find the most appropriate position of P1 in P2.

2. MULTIDIRECTIONAL GRADIENT CODES

Assume that there are n regularly spaced discrete points on each side of P1 (see Fig. 2), where n is an odd integer given by n = 2k + 1, k = 1, 2 , . . . . Let the magnitude of the center point of P1 be c* (c* = ak+t,k+t) and consider eight directional axes ( ~ t, j }j = 1,2 ..... 8 centered at a k + t, k + 1 (Fig. 3).

The 8-directional gradient code for P1 is defined as the 8-tuple, f~s, given by

0c Oc Oc ) (1)

~'~8 = 0t~1,1 ' ~r . . . . . 0~1,8 '

where c stands for the magnitude, and the partial derivatives are evaluated at the center point of P1, where c = c*. Similarly, the 4-directional gradient code for P1 can be defined as the 4-tuple, f14, where

Oc Oc Oc Oc ) (2)

~r'~4 = 0r , 0 0 1 , 3 ' 0r 5 ' 0q~11,7 "

As there are k + 1 discrete points along each directional axis, an approximation of 0 c / 0 r can be obtained as

0c 1 ~-, c i - c* Oep - k "-" s*i ' (3)

i = l

where c i is the magnitude of the ith point from the center point of P1; s = a when j is odd, s = V~-*a when j is even. Some properties of Oc/Oq~, f14, and ~8 can he observed:

(a) If the magnitude along the @directional axis varies linearly with a constant gradient g (i.e., c i = c* + i*s*g), then

Oc - 1 ~ i*s*g Oep k s*i = g" (4)

i=1

Page 3: Position determination using generalized multidirectional gradient codes

230 K.P. LAM

intelligent [" ~ probe

/ ; t

I I I I

I

I I i t

" I - - I ~"~, , , ~

J/A

CL21

c~31

an,l

m 1 QI2 e l 3

I 1 I ! I I

I I ~-- a .~,~

al,n

FIG. 2. Contour map for P1 is characterized by { . i j }.

(b) If for all j = 1,2 . . . . . 8, Oc/dq~l, j are all negative (positive), then the 8-directional gradient code fls is said to contain a "hill" (" valley") feature.

(c) If for all j -- 1, 2 . . . . ,8, I Oc/Oq, l,jl <- e, where e is a small positive con- stunt, then fls is said to contain a "plain" feature.

(d) Similar properties as (b) and (c) can also be observed for the 4-directional gradient code f14.

Generalized Gradient Codes

In obtaining the 8-directional gradient code using Eqs. (1) and (3), we notice that only 8k of the available (2k + 1) 2 - 1 discrete values of {a~j} (excluding etk+l,k+l) are used. Hence the utiliTation ratio 7 defined as

8k 2 7 = (2k + 1) 2 - 1 = k + 1 (5)

will become small when k is large. To improve the utilization of { aij }, it is useful to construct a generalized multidirectional gradient code based on ~8- Assume that each octant bounded by qh,j and ~l,j(mo,iS)+l (J = 1 , . . . , 8) contains m - 1 direc-

~1,4

~1,5 ~'" /

~1,6

i,3 /1,2

i//1'2 I ..,. " f ~i,l

/ ~ D 11,i

~1,8

( t - l , . . . , m )

The c e n t r e p o i n t of PI : ~k+l,k+l

FIG, 3. Directional axes at the center point of PL

Page 4: Position determination using generalized multidirectional gradient codes

MULTIDIRECTIONAL GRADIENT CODES 231

tional axes (see Fig. 3), where m is an integer greater than or equal to 1. The directional axis q~,j (i = 1 . . . . . m) makes an angle At/ with each of its two neighboring axes, and A0 is given by

1 qt A# . . . . (6)

m 4"

The 8m-directional gradient code is defined as an m x 8 matrix, given by

(ac) ~'~8m = ~ i = 1 , 2 . . . . . m "

" j = 1 , 2 . . . . . 8

(7)

As the discrete values of (a i j } may not lie exactly on each 0-axis, the following procedure based on linear interpolation is used to evaluate Oc/OOi j. For simplicity, consider a directional axis 0 which makes an angle # with ~1,1 (Fig. 4). Using the appropriate values of s, c i in Eq. (3), obtained by

s = a s e e 0 ( 8 )

c, = (c~a - cn=)(Ax /a ) + cfm (9)

Ax = i tanO - Trunc(i tan0) (10)

Cini = ak-Trunc(itanO), k+i+l (II)

Cfin = ak+t-T~,=,~itan0), k+i+t, (12)

where Trunc(-) stands for the largest integer less than or equal to (-), the value of Oc/Oq, can be simply obtained.

Generalized Conjugate-Gradient Codes

It is apparent that Oc/Oq, obtained using Eq. (3) is an average gradient measure of the k neighboring points with respect to ak+t,k+ x along the @directional axis. As an alternative, it is useful to consider a conjugate of ac/Oep, denoted by (Oc/Oep), which is defined as the average of the partial derivatives at each of the k discrete

~k+l,k+l

~1,2

e 2

m'- i ' ~ " ~bl, 1

FIG. 4. Finding 8c/8~.

Page 5: Position determination using generalized multidirectional gradient codes

2 3 2 K . P . L A M

points along the @axis, i.e.,

O-c 1 Oc + Oc + . . . +

= k c* Cl

1 ~ c i - c i_l c k - c * --- . . . . z., c o = c*. (14)

k s k*s ' i = 1

It is readily seen that if the magnitude along the ~ax i s varies linearly with a constant gradient g, then Oc/Or = ( - ~ / ~ ) = g. The calculation of Eq. (14) is much simpler than that of Eq. (3) as the values of Cl, c 2 . . . . . Ck -- 1 are not required.

Following similar reasoning as described in obtaining Ms,,, we can define an 8m-directional conjugate-gradient code ~s, , as an m • 8 matrix

i= l ,2 , . . . ,m" j = 1 , 2 . . . . . 8

3. C O N T O U R M A P P R O C E S S I N G

Data Manipulation

To obtain a contour map for P2 based on the given information (fl~j}, both nonlinear and linear interpolation methods are used:

(a) Nonlinear interpolation. Consider the basic horizontal linear segment shown in Fig. 5; we hypothesize that the magnitude c(x) at point x is determined by values at Xl, x2, and x 3. In particular, c(x) is a linear combination of C(Xl), c(x2), c(x3) and is represented by

subject to the constraint

3

c ( x ) = ~_, w~c(x,) (16) i = 1

3

~] w~ = 1. (17) i = 1

Although there is no fixed rule for the determination of wi, a nonlinear relation- ship should exist between w i and xi - x and probably with wi varies inversely with

x I x 2

d d

( Horizontal )

2d

x 1

x3 x !

x 2

x 3

( Vertical )

FIG. 5. B a s i c l inear segments .

d 2d = g r i d spac ing

of g iven data d

{ all }

2d

Page 6: Position determination using generalized multidirectional gradient codes

MULTIDIRECTIONAL GRADIENT CODES 233

x i - x. By systematically constructing basic horizontal and vertical linear segments based on { flij}, further details of the contour map for P2 can be estimated.

(b) Linear interpolation. This technique is usually used after sufficient details are obtained by applying nonlinear interpolation. Consider a linear segment (hori- zontal or vertical) in which only the magnitudes at the endpoints (x 0 and X/+l) are known, it is required to find the magnitudes of f equally spaced points along this line segment. By using linear interpolation

c ( x , ) = c ( x 1 + l ) - C(Xo) . (x ,_ x0) + (18) X f + 1 - - X 0

and with a sufficiently large value of f , a reasonable approximation of the contour map for P2 can be generated.

Searching for All c*-isopleths

Once the contour map for P2 is obtained with the specification that c* is one of its isopleth values, it is straightforward to locate all c*-isopleths. Various techniques as described in [6], such as crawling, "detect and erase," etc., may be applied to obtain a list of all points on c*-isopleths. However, the implementation requires computer storage of the whole contour map for P2 which may be expensive in our application. An alternative is to embed the searching process in the linear interpola- tion scheme. As it is common to carry out linear interpolation on nonintersecting subareas of P2, the search for c*-points should be initiated once the interpolation process on each subarea has been completed.

Generation of Gradient Codes

Let P be a specific point within the (X, Y) square of P2 (see Figs. 6 and 1) which has a magnitude c*. The position of P is denoted by the 4-tuple (X, Y, x, y), and there are p equally spaced intervals along each side of the (X, Y) square. Without loss of generality, linear interpolation is assumed to apply to obtain the magnitudes of all points ( X, Y, x, y) in P2. The 8m-directional generalized gradient code at P with a maximum specified level k m can then be readily obtained. In essence, the algorithm tries to find the k,, neighboring points in each of the 8m directions and

p equally- spaced

intervals

8i,j p equally-spaced intervals

P(x, Y, x , y) Y

~i,J+l

8i+1,3 8i+l,j+l

(X, Y) = (i, j) = Index for the upper left corner

0 < x < p-l; 0 < y < p-l; x, y are integers.

FIG-. 6. The (X, Y) square.

Page 7: Position determination using generalized multidirectional gradient codes

2 3 4 K . P . L A M

their corresponding magnitudes. For the case of conjugate-gradient code, the al- gorithm requires only to find the kmth point from P. Taking account of the precaution that k m has to be adjusted when P is near the edges of P2, the calculation of f~sm using Eq. (3), or ~s,, using Eq. (14), is straightforward.

A 2-level classifier for position determination can be implemented using either the generalized gradient codes or the conjugate-gradient codes. For simplicity, we consider the case of generalized gradient codes only.

Classifier 1

Based on the multidirectional gradient code for P1, the gradient codes at each c*-point are subjected to a 2-level classification. Let the referenced 8m-directional gradient code for P1 be (flSm)ref = [Uij] and the 8m-directional gradient code at P be flsm = [r~j]. The acceptance criterion of Classifier 1 is to test whether the Euclidean distance between (fl4)ref and f14 is less than or equal to a specified threshold ~ 0 , i.e., the point P will be subjected to second level classification only if

3 E lUl,2i+t - rl.2i+ll 2 -< H0- (19)

i = 0

Classifier 2

Each c*-point which is accepted by Classifier 1 undergoes a second level classifica- tion based on correlation. Two correlation measures 101 and 102 can be used:

�9 ' i j

1 E ( u i j Fti)(rij ri) E ( u i j - 2 102 . . . . . m j J u,) ~"~(r,;j - ~,) (21)

where ~,~ are the mean of {Uiy ) and {r/j), respectively, and ui, r i are the mean of the ith row elements of [uo] and [rift, respectively; Pl is the normalized correlation coefficient and P2 can be interpreted as the average of m correlation coefficients. The c*-point with the maximum value of 101 (or 102) is then chosen to be the best estimate of the location of the center point of P1 in P2. For the case of conjugate-gradient codes, the corresponding values of 101 and Pz are denoted by Pl and 02-

4. EVALUATION OF THE CLASSIFIER

The position determination algorithm described in foregoing sections has been implemented as a software package of Fortran source files on a Data General MV/8000 computer system. The executable program occupies approximately 130K bytes. In the following simulation study, contour map generation of P2 requires an average runtime of 0.7 s, and the computational time (t s or is) for subsequent

Page 8: Position determination using generalized multidirectional gradient codes

MULTIDIRECTIONAL GRADIENT CODES 235

position searching is determined empirically as:

(i) Generalized gradient codes

(/s)max = mN(2"8km + 2.5)msec (22)

tJ(ts)m~ x = {1.47k m + 0.5 +(1 .33km + 2 . O ) ( N s / N ) } / ( 2 . 8 k m + 2.5) (23)

= 0.372 + 0 . 6 2 8 ( N J N ) for k,, = 1, (24)

= 0.525 + 0 . 4 7 5 ( N J N ) for k m ~ oo. (25)

(ii) Generalized conjugate-gradient codes

([,)max = 5 . 5 m N m s e c (26)

fs/(is)max = 0.545 + 0 . 4 5 5 ( N J N ) , (27)

where N s is the number of points for second level classification, and N is the total number of points on all c*-isopleths. From Eqs. (22) and (26), we observe that the ratio ( / s ) m a x / ( i s ) m a x = 0.51k m + 0.45 may vary from 0.96 for k m = 1 to a value close to k , J 2 when k,, is large. With a specified threshold H0, the first level classifier has direct control over N, and hence the computational time (t, or i,). It is desirable to obtain a nonzero Ns, where N s << N, so that the ratio tJ(t , )ma x (or /s//(/,)ma~) will be close to �89

The simulation uses a set of 7*9 discrete values of { f l i j l i = 1 . . . . . 7; j = 1 . . . . . 9} to characterize the contour map of P2 (see Figs. 7a and 8a). The test samples of P1 are generated by centering at certain particular area of P2 and then executing the

I 2 3 4 5 6 7 8 9

I 88S# 871# 868# 855# 839~ 811~ 79#~ 785# 789B

2 888# 897# 895g 88#B 867# 849# 836# 834# 85##

3 8886 9#1B 898# 883B 875B 857B 884g 878# 9B6g

4 873# 8836 881# 874# 874# 862# 8766 9188 93~#

5 874# 869# 868# 8748 865# 831# 915# 931B 929#

6 865~ 853# 862~ 869# 876# 885.,9' 922# 938~ 922# T ^ . 2 ~_?

. 7 8 5 2 . 8 4 7 . 8 5 . 855# 8 . # 8 8 , . 8 9 . 9 . . . .

p 0 . 0 2 5 ~

8445 8377 832~ 8263 8239 8765 8764 8759 8741 8721 --f-- O 0 2 ~ 8437 8385 5388 3249 8225 8761 8759 8755 8731 8712

8454 8387 8332 8277 8255 8758 8753 8738 871~ 8687

8512 8457 8413 8357 8352 8747 8738 872~ 8667 8526

b 8565 8521 8487 8451 8442 C 8737 8727 8699 8631 8575

FIG. 7.

8239 8238 8289 8419 8535

8224 8223 8277 8418 8547

8256 8255 83M8 8451 8585

8352 8355 8412 8537 8657

d 8439 8447 858B 8616 8724

(a) (Bij} of P2 (b) c* = 8332; (c) c* = 8738; (d) c* = 8308.

Page 9: Position determination using generalized multidirectional gradient codes

236 K.P. LAM

I 2 3 4 5 6 7 8 9 _ ~. z_],.s A ~ ~22 ,=.,_7_ ~ 22,2 =j_ ~ =j?_=_,_ ~2 =_,.~ =_~2p~ ,. ~. 2_ ~ ~ !=. = ,_?_ ! ~_ =?_ ~. ~_,_ 7 ~. z] ; ~ ~ ~= ~ ~, ~ ~ = ~?~: ~ =. ~_ :%~, ~ t. ~.., ~ ~., ~j_ �9 ~ ~ ~. ~_ ] '.~2. '_ ~__

=1 fFFFFFFF ~FFFFFFFFFFFF ='=EgEE ~ ID =~r162 ~ ld l ~ ' " ~1~ " | ~ e s " " 77~'G~G6 ss5 l sssss~,~55s~5 I I FFFFF FFFFFFFFF~ EEl BOB : r | 1 | ~4 SSg~ I I I 8 ~77~ KiSt ~ iS6i iS iGt$6i

EEEEE oool Cr162 I l l l l ~ 9~999 sselleeeea?7 7;~TZTleoaNn II GGG GGC, GGG FFFI E ~ (: 8 ~ 9~J~ 88 i BOBglNI~

FF =E oo ccc seee 4111 IIl~lfl l l~ mflNHIIHHNIINNN it ; ~ FFFFF; ~ [[; OUl)Oc, :cccc,~r ee8|8 ;;;&;;;;;;11~8~

! =s ooo ceccc I r162 ooo~ FF E [ )O CCC CCCr163 gr162 CC DDDD E| 3|1| ~H I%1 ~ FFF [EEEE DDDDBDDDDDD C DoDoD DDDODEEEEEFFf l E E FF r

r, EE o ,I)0eo~oeo EEEE FFF r Zl H H $I H I E E EEEE FFF r #I 41 H I F F EEEEE EEIEEEEEEE F FFF eGr HHH I I �9 I r : z : r r ; : :; ; 21 I~H HH II Gr @ f E EE FFFF ~ GG HNHH i ! 31 HIfNH HHHH K i t E [ FF GGGr flHH I} l [

4 l i T 31 F ~IE BI~[IO )@ [ F ; ; . . I I a g g 41 FFFFFFF tF r E O~r : 8 [ F G B Ia { l l a#a KI I I FFrFFF FF ' [ o c COEF r ~ I ,1 ~< 2! FFFCFFFFF! ~ �9 ~ E B r co E F ~ . I a ~K $| TF FFFTTFF r i o c I l l r i F r ~ I a3 K 41 F F i ~ r ~ l~ l r ~F G H ] ~ KXK Z l I [eno~ r . . . . . . . :D-- IF" ~ ' . " i "a r K- 3Z ~ o c c c c c c ( ~ ~r G H I a . 41 FFF EEEI)OOOOOE! EFrgCH. It a ~K I I FFFF EE EEEE �9 r H I a K 21 E~ FFF~ EE F ~ H i *,1 K

FF r W I .1 ~K KKK G H I o KKKKKK KKKKK

E r r . I a KI~ I~K ,

~I eoo [ ~ E r~ ~ I . i1 aaaa aaa :+1 (~oeeDe %or 1oo 1 EEl[ FF (;G HH I I I aaaaaa aoaaaa 4t ODO noOo o EEEE r r G HHH I I rl aa o,1 J

7 616 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a 1234SGTIZ~4S&? 1234S~;7 | ;~34S&7 | 2~t 4667 | 2345G7 )2345S71234S67 I Z~4S&?IZ34Si7 |Z34S~? 1234Sl;~ |Z315&71:~4%(;'t I Z~45E712~4567T

- f - - 0.05

F O . O 5 -

LLK'~ 'O 2 : H": (

L K O H G L K J I HH GG L K J I

( K J

t L " L KK' H

H L KK O'J. M LL KKK

MM L L L I . KK' t l

~ F F F F " E E " ' FFF i

F EEE EEEEE

~ E E

k ~ c ~ ' ~ F F F F F F GGGGG

H H H H I I III

I I l l l I O J OOOOOJOOOOJ K

FFF FF E

E

- V 0 , 2

EE EE

~ j EE O

~ DDDDD CCCC

CC BBB

D C BB AA D C B AA D C B A A 9 9

IGG ' " F F F F F FF FFF

FFF EEEEE

iGkkrF~ IHH GGGi I I I I I H H

I l l ~. 1 O O O O J J O J O K OOOO KKKK KKKKKKKLLLLLi

GH I 0K L M N G H I . ] K L M N

GH IJ KL M N(

LM NO :F.,%m, I NOOP (

- - NO PQQF . . . . . 0 P Q

KL M N P Q R ZL M NO P 0 R M M N ~ O P P Q R S

FIG. 8. (a) Ac = 100; (b) Ac = 50; (e) Ac = 50; (d) '% = 50.

Note. (1) Ac is the isopleth interval. (The increasing magnitude ordering sequence is 0 1 2 -- - 9 A B C - - - Y Z. For example, if "F" = 8740 and ~c = 100, then "G" = 8840, "E" = 8640, etc.) (2) The area covered by P1 is represented by the square with connected isopleths. (3) " F " is chosen to represent the magnitudes at the center points of t'1 and P2.

nonlinear interpolation algorithm a number of times. Random measurement errors with a normal distribution may be introduced. The area ratio between P2 and P1 is given by 6"8"(0.2)2/(0.1) 2 = 192 and hence justifies the assumption that area (P2) >> area (P1).

(a) Test Sample 1 (Figs. 71) and 8b). Let the center point of P1 be selected at (Xo, Yo, Xo, Yo) = (5, 5, 0, 7) and the nonlinear interpolation algorithm is executed

Page 10: Position determination using generalized multidirectional gradient codes

MULTIDIRECTIONAL GRADIENT CODES 237

three times. N o random noise is added; k and k m are chosen as 2 and 6, respectively. The (X, Y) square is divided into 14 equally spaced intervals on each side. The 8-directional gradient code for P1 is then obtained: (flS)ret = (-- 1870, -- 1831.4, -- 599.99, 1286.93, 2320, 3415.32, 3169.99, 1272.79).

The data in Table 1 indicate that the threshold H 0 has a considerable effect on the number of points (Ns) for second level classification. However, even for a small Ns, there is no change in the best estimated position (5, 5, 0, 8) which has the highest correlation coefficient ( = 0.979937) with the referenced 8-directional gradient code

(~'~ 8) ref"

Table 2 shows the results when random disturbances with a normal distribution N(e, a) (e, a are the mean and standard deviation, respectively) are added to P1; H o is fixed to be 1E10. It is readily seen that the estimated position is not sensitive to random measurement errors in P1.

(b) Test Sample 2 (Figs. 7c and 8c). The center point of P1 is changed to (Xo, Yo, Xo, Yo) = (4, 5, 0, 0). Random measurement errors with a normal distribu- tion N(0.0, 2.0) are added. By comparing the data shown in Tables 3 and 1, we observe that the range of useful threshold has changed. The effect of the maximum

TABLE 1

H o 1El0 5E7 1E7 5E6 N s 71 69 31 7 Pl 0.979937 0.979937 0.979937 0.979937

(2o, Yo, ~o, ~o ) (5,5,0,8) (5,5,0,8) (5,5,0,8) (5,5,0,8)

TABLE 2

N(e, o ) (0.0, 2.0) (0,0, 4.0) (0.0, 6.0) (2.0, 4.0) N s 70 68 65 70 Pl 0.979698 0.978158 0.974744 0.976661

(.~'o, Yo, ~o, ~o) (5,5,0,8) (5,5,0,8) (4,5,13,8) (5,5,0,8)

TABLE 3

H o 1El0 1E7 1E6 5E5 N s 253 156 19 7 Pl 0.998252 0.998252 0.998252 0.998252

( .~'o, Yo, YCo, )o ) (4,5,0,0) (4,5,0,0) (4,5,0,0) (4,5,0,0)

TABLE 4

k m 6 4 2 1 N s 253 253 253 253 Pl 0.998252 0.995329 0.984584 0.975362

()fo, Yo, 5Co, 5,o ) (4,5,0,0) (4,5,0,0) (4,5,0,0) (4,5,0,0)

Page 11: Position determination using generalized multidirectional gradient codes

238 K. P. LAM

TABLE 5

H o 1El0 1E8 5E7 3E7 N~ 52 52 28 4 Px 0.720516 0.720516 0.720516 0.720516

(J'0, Y0, $0, )o) (1,8,12,10) (1,8,12,10) (1,8,12,10) (1,8,12,10)

1E7 0 ? ?

TABLE 6

Ac* 0 + 3.0 - 3.0 N s 52 54 51 01 0.720516 0.992189 0.719794

(Xo, Yo, .%, j ,o) (1,8,12,10) (5 ,6 ,0 ,0 ) (1,8,12,10)

level km specified for generation of gradient codes is apparent in Table 4. It appears that a small value of km can give reasonable results.

(c) Test Sample 3 (Figs. 7d and 8d). In this case the center point of P1 is specified at (5, 6,0,0) which is close to a "low." Random errors with a normal distribution N(0.0, 2.0) are added. Table 5 shows that N~ is very sensitive to the value of Ho: a change of H0 from 1E8 to 1E7 reduces N s from 52 to 0. The effect of measurement errors on c* is detailed in Table 6. It is observed that measurement errors in c* near a "low" (or "high") can introduce serious problems in position determination because the actual position of P1 may disappear from P2. A possible method to overcome this drawback is to introduce a perturbation (Ac*) to generate two additional contour maps with (c* + Ac*) and (c* - Ac*) as one of the isopleth values in each map. Table 6 shows that when Ac* = 3.0, the actual position of P1 can be accurately determined.

Performance of Generalized Codes

In providing an extended framework where gradient information along 8m directional axes can be encoded, the generalized gradient code flSm includes the 8-directional code ~8 as a special case. As the computational time (t~) is directly proportional to m, it is expected that the discriminating power of ~8,n in position determination increases with m. However, we conjecture that there should be an upper limit in m, where further increase can result only in marginal improvement. Intuition suggests that this upper limit will be small when k is small and a rough estimate based on Eq. (5) is Trunc[(k + 1)/2]. Using the test samples previously described, it was found that in many cases the classifier based on fls or flsm (m > 1) gives similar results. The difference between using Pl and 02 is not obvious.

Conjugate-Gradient Codes

In contrast to the gradient code, the conjugate-gradient code requires only the data values along the peripheral (i.e., the k th level) of the (a i j } square. However, simulation using the given test samples shows surprisingly good results when compared with the gradien t codes. Although the classifier based on conjugate-gradi- ent codes is more sensitive to measurement noise and the value of k m, the importance of these codes should not be undermined as they have fast computa- tional speed and good position determination potential.

Page 12: Position determination using generalized multidirectional gradient codes

MULTIDIRECTIONAL GRADIENT CODES 239

5. CONCLUSIONS

A 2-level classifier based on the proposed multidirectional gradient or conjugate- gradient codes has been found useful for posit ion determinat ion in contour maps. The range of useful threshold for first level coarse classification, though affecting the computa t iona l requirement of second level classification based on correlation, is no t easy to predetermine as it is highly posit ion-dependent. However, it should be possible to obta in a set of reasonable estimates using training samples. Simulation has indicated some desirable features of the present classification scheme, for instance: the algori thm has fast execution speed; good accuracy is obtained in m a n y cases; and the accuracy appears to be insensitive to measurement errors and the n u m b e r o f levels specified for the generation of gradient codes. There are still p roblems concerning the discrimination of points with similar gradient codes, especially in areas where the variation in gradient is small. The difficulty may be part ial ly overcome by considering a set of P1 contour maps and their associated gradient codes along a specified direction in P2. This strategy is under current invest igation and preliminary simulation results are promising.

ACKNOWLEDGMENT

The au thor would like to thank J. W. Brahan, Head of the Informat ion Science Section, for his comments on an earlier draft of this paper.

REFERENCES 1. S. P. Morse, Computer storage of contour-map data, Proceedings, 23rd ACM National Conference,

1968, pp. 45-51. 2. S. P. Morse, A mathematical model for the analysis of contour line data, J. ACM 15, 1968, 205-220. 3. H. Freeman and S. P. Morse, On searching a contour map for a given terrain elevation profile, J.

Franklin Inst. 248, 1967, 1-25. 4. R. D. Merill, Representation of contours and regions for eilieient computer search, Comm. ACM 16,

1973, 69-82. 5. H. T. Tsui and K. P. Lain, On the problem of classification of weather contour maps, Proceedings,

4th Int. Joint Conf. on Pattern Recognition, 1978, pp. 635-637. 6. K. P. Lain, A Syntactic Method of Weather Pattern Recognition, Master's thesis, The Chinese

University of Hong Kong, 1977. 7. D. Y. Montuno, Y. Yoshida, and T. Fukumura, Structural description of contour maps and its

application to weather maps, Trans. IECE of Japan, E63, 1980, 421-428. 8. D. Y. Monttmo, Y. Yoshida, and T. Fukumura, Representation and storage of contour map data and

their application to weather map data, Proceedings 5th Int. Joint Conf. on Pattern Recognition, 1980, pp. 38-40.

9. R. Taniguchi, M. Yokota, E. Kawaguchi, and T. Tamati, Knowledge based recognition system of weather chart, Proceedings, 5th Int. Joint Conf. on Pattern Recognition, 1980, pp. 333-336.

10. R. Taniguchi, M. Yokota, E. Kawaguchi, and T. Tamati, Picture understanding and retrieving system of weather chart, Proceedings 6th Int. Joint Conf. on Pattern Recognition, 1982, pp. 802-805.