On searching a contour map for a given terrain elevation profile

On searching a contour map for a given terrain elevation profile

Journal of The Franklin Institute DEVOTED T O S C I E N C E A N D T H E M E C H A N I C A R T S Volume 284, Number 1 1uly 1967 On Searching a Conto...

2MB Sizes 8 Downloads 23 Views

Journal of The Franklin Institute DEVOTED T O S C I E N C E A N D T H E M E C H A N I C A R T S

Volume 284, Number 1

1uly 1967

On Searching a Contour Map for a Given Terrain Elevation Profile by H. FREEMAN D e p a r t m e n t of Electrical Engineering N e w Y o r k University, Bronx, N e w York

and s .

1,. M O R S E

I B M T h o m a s 1. W a t s o n Research Center Y o r k t o w n Heights, N e w Y o r k

ABSTRACT:This paper is concerned with the problem of using a digital computer to locate a ground track of known shape on a contour map, given the terrain elevation profile associated with the track. Such a problem is encountered, for example, when locating the ground track of an aircraft, given the elevation of the terrain below the aircraft during flight. The problem is characterized by the requirement to search for a specific solution out of an infinite number of possibilities. Exhaustive searching is impractical; therefore, what is needed is an e.~icient search strategy, suitable for programming on a digital computer, which will yield the solution in a reasonable time. The solution described takes advantage of the topological properties of the contour map. The given terrain elevation profile is first converted into a sequence of numbers describing the elevation values of the contour lines intersected by the unknown ground track. A graph of the map topology is then used to identify all the possible contour lines that could have been intersected by the ground track. Narrow bands are constructed, satisfying the topological constraints of the terrain elevation profile and the geometric constraints of the flight path. Results are based on actual computer map searches. Introduction

Consider the following problem: An aircraft pilot has flown a path of known shape but unknown location or orientation over terrain for which a contour map is available. During the flight the pilot recorded the elevation of the terrain below the aircraft as a function of distance along the flight path, thereby obtaining a terrain elevation profile for the flight path. Upon return to base, the

H. Freeman'and S. P. Morse

~

CONTOURMAP

DIGITAL COMPUTER

SHAPEOF FLIGHT PATH

Y

SOLUTION (FLIGHT PATH LOCATED ON MAP)

TERRAIN ELEVATION PROFILE Fie. 1. The contour map search problem. data for the terrain elevation profile and the flight-path shape are entered in a digital computer, together with the complete contour map data. The computer is then to locate rapidly and efficiently the ground track of the aircraft on the contour map. The foregoing problem, called the contour-map search problem, is illustrated in Fig. 1. It is encountered in flying over remote areas where normal navigation aids may not be available, but where precise position locating may be important, say, for geological survey purposes. The problem arises also in locating the position of a ship using contour maps of the ocean bottom and for navigating a space ship over the surface of the moon. In general, the given flight path will have to be translated and rotated over the contour map to locate the ground track. However, on the surface of the earth only translation of the flight path is likely to be required since the direction of north is usually known. The solution of the contour-map search problem is the subject of this paper. Some reflection will quickly indicate that one should not expect to find a simple algorithm that will yield a solution to this problem. The only approach toward a solution appears to be to perform a systematic search of the contour map. However, if such a search is attempted, one is quickly overwhelmed by the enormous number of possibilities that are presented by the map. Also, the problem has the perverse characteristic that one may be very close to the solution and yet have no inkling that this is so, or conversely a solution may seem to be almost at hand when this is not at all the case. An exhaustive search is not

Journal of The Franklin Institute

On 8earching a Contour Map practical (nor indeed possible) for maps of appreciable size because the data processing requirements would exceed the capabilities of even the largest conceivable computers (1). What is needed is a search strategy that utilizes all available information to focus attention as quickly as possible on those areas of the map where the ground track is likely to be located. The search strategy must take into account that the data (contour map, flight path shape, and elevation profile) are all somewhat corrupted by noise and that at best only the "most probable" location of the ground track can be found. The problem has many of the characteristics already encountered in computer solutions of problems such as jigsaw puzzles (2), optimum two-dimensional layout (3), and pattern recognition (4, 5). The method described here for solving the contour-map search problem is based on an exploitation of the topological properties of contour maps. The method is divided into three successive phases. In the first phase a graph is constructed which displays the topology of the map and this is searched for those paths on the graph (corresponding to areas on the map) that match the topological classification of the given terrain elevation profile. As a result of this purely topological property search, it is usually possible to eliminate a large fraction of the map as areas where the flight path could not possibly have been located, irrespective of the flight path's shape! In the second phase, a simple geometric test is applied to the possible paths (topologically described) obtained from the first phase. This results in a further narrowing down of the regions on the contour map in which the desired ground track may lie. In the third and final phase, maze-like regions are constructed to delineate the permissible regions on the contour map for the flight path. These maze-like regions are then combined, taking into account the known shape of the flight path. Attempts are next made to fit the flight path into the combined mazes. For those combined mazes for which a fit is possible (if more than one), a figure of merit is obtained that gives an indication of the quality of the fit. The location of best fit is then taken as the desired location of the ground track. Topology of a C o n t o u r M a p Before undertaking the solution of the contour-map search problem, it is necessary to introduce a set of definitions and to examine in detail the topological properties of contour maps. The definitions given here, as well as some of the restrictions to be introduced, are appropriate for the search problem; for other problems involving the processing of contour map data, different definitions may be preferable (6). Consider a continuous, bounded function of two variables, E = f(x, y). Let x and y represent two geographical coordinates of position so that the range of (x, y) defines a particular section of terrain, and let E represent the elevation function of this terrain. Assume that Emax and Emin are, respectively, the maxi-

Vol. 284, No. 1, July 1967

3

H. Freeman and S. P. Morse

m u m and minimum elevation values over the specified range of (x, y). Now select a number E and assign elevation values e~, i = 1, 2, . . . , n, such that

e~+l -- e~ = E

for all

i

and Emin ~ el ~ Emin -]- E Em~= - E ~ e~ ~ Em~

For purposes of the contour-map search problem it is desirable to restrict consideration to contour maps t h a t display elevation as a single-valued function of geographical position. Although this restriction eliminates the possibility of displaying vertical or overhanging cliffs and underground caves, there is no loss of generality as far as surface searching is concerned. Cliffs will be permitted to approach but never quite to reach the vertical, a condition which is in no way inconsistent with the predilections of natural terrain. A second restriction to be imposed is t h a t the terrain may possess no plateaus (regions of constant elevation) whose elevation is precisely equal to e~, i = 1, 2, . . . , n, and that no maxima or minima m a y occur at elevations precisely equal to e~.1

Definition 1. A contour line of value e~ is a line drawn in the x, y plane that separates points of elevation greater than e~ from those of elevation less than e~. Contour lines are labeled Li, j = 1, 2, . . . , m, with the subscripts assigned in arbitrary order. The combined symbol LJe~ is used when it is desirable to indicate also the value e~ of the contour line. Note that there m a y be m a n y contour lines having the same value e~ but all having distinct labels. Definition 2. A contour map is a complete set of contour lines of values e~, i = 1, 2, - . . , n, all drawn in the x, y plane. I t is a two-dimensional representation of the elevation function for the specified terrain in which the elevation function is quantized in increments of E. A typical contour map is shown in Fig. 2. The numerals next to the contour lines refer to the elevation values of the contour lines. Definition 3. Two contour lines are said to be adjacent if a line (not necessarily straight) can be drawn t h a t connects the two contour lines and intersects no other contour line. Note that b y this definition a contour line is adjacent to itself and that two contour lines can be adjacent to a third contour line and yet not be adjacent to each other. Certain properties of contour lines can now be identified. These properties are valid for all contour maps defined as above and for which the aforementioned restrictions apply. Property I. All contour lines are closed curves. (Contour lines that intersect 1 This restriction imposes no practical problems since it is always possible to change the values of critical elevations by minute amounts without materially affecting the validity of the data.

4

Journal of The Franklin Institute

On Searching a Contour Map 2 ~ 3-.-4-~

4

+ 3 3

3 ~'-

4-*"

5-*'-6"*-

7-*-

-,,-7.-.-6-,~5

5-"-6-'-

Fro. 2. Contour map No. 1.

the border of the contour map are assumed to be closed through the border in such a way that they will contain, in their interior, adjacent contour lines of next higher elevation. Thus in Fig. 2, the contour lines intersecting the border are assumed closed through the border as indicated by the small arrows.) Definition 4. The interior set of a given contour line is the set of all contour lines contained within the interior of the contour line.

Definition 5. The exterior set of a given contour line is the set of all contour lines in whose interior the given contour line lies. Definition 6. A contour line L1 is called an interior (exterior) contour line of a contour line L~ if L1 is adjacent to L2 and belongs to the interior (exterior) set of L2. Definition 7. Two contour lines are disjoint if neither lies in the interior set of the other. The validity of the following properties is easily established by inspection of the map of Fig. 2. Property 2. Contour lines do not intersect each other. Property 3. All contour lines adjacent to a contour line L form two sets whose intersection is L such that all contour lines in each set are adjacent to all other contour lines in that set. The two sets are the union of L with the set of all contour lines adjacent to L and lying in the interior set of L, and the union of L with the set of all contour lines adjacent to L but not lying in the interior set of L. The two sets are called the interior adjacency set (IAS) and exterior adjacency set (EAS), respectively, of L. Each adjacency set corresponds to an inter-contour region and vice versa. The EAS of a contour line L is the same as

Vol. 284, No. i, July 1967

5

H. Freeman and S. P. Morse

/7o//// tlv/,, (o) RI SE

(e) PASS

(b) DEPRESSION

{f) BAR

"

(c} WALL

{g) POCKET

:( (d) MOAT

{h) TRAY

FIG. 3. Basic IAS configurations. the IAS of the exterior contour line of L. Similarly, the IAS of L is the same as the EAS of any of the interior contour lines of L.

Property 4. The contour lines in the adjacency sets of the contour line of value e~ m a y have only the values e~, e~_l, and e~+l. I n any single adjacency set, both el and e~_~, or both e~ and e~+~ m a y be present, but never e~_~ and e~+s. Property 5. If one of the adjacency sets of a contour line of value e~ contains a contour line of value either e~+l or e~-l, the other adjacency set m a y not contain any contour line having this same value. Property 6. If a contour line L~ of value e~ has an exterior contour line L2 of value e~ and an interior contour line L3 of value e~_l(e~+l), then the exterior contour line L4 of L2 must be either of value e~ or e~-l(e~+l). If L4 is of value e~, then the exterior contour line L~ of L4 must be either of value ei or e~+s(e~_l). I t is apparent from Properties 4, 5 and 6 that there are very specific limitations on the values of the contour lines in an interior adjacency set. The various permissible IAS configurations are now examined in some detail. Consider a contour line L~ of value e~ that has a single interior contour line L2. Contour line L~ m a y be of value e~+~, e~-l, or e~. If L~ is of value e~+~, the configuration indicates an increase of elevation toward the interior. The term rise will be used to describe this IAS configuration. If L2 is of value e~_l, the elevation decreases toward the interior and the name depression is appropriate. If L2 is of value el, the configuration is ambiguous and one must look for clarification toward another contour line L3 that is either in the EAS of L~ or the IAS of L2. If L3 is of value e~_~, the inter-contour region between L1 and L~ is of elevation greater than e~ and, hence, this IAS configuration will be referred to as a

6

Journal of The Franklin Institute

On Searching a Contour Map

/,,,.

x -._i~

/." ,,"-I ~/~.

I÷(

/,..

.4,".

~ ~ ~ . . ,~.~\~.

/ - ?/

FIG. 4. Flow lines for a pass. wall. If L3 is of value e~+l, the inter-contour region between L1 a n d / ~ is of elevation less than e~, suggesting the name moat for this configuration. The four con-

figurations are illustrated in Fig. 3 (a) through (d). Observe t h a t these are the only permissible adjacency configurations of two contour lines. Now consider a contour line with an IAS of two disjoint contour lines. There are four distinct comfigurations, 2 as illustrated in Fig. 3 (e) through (h). The terms pass, bar (e.g., a sand bar), pocket and tray are used to describe these IAS configurations. I t m a y help to visualize the terrain described b y these contourline patterns if one traces out the manner in which rainwater would flow in each case. The flow lines for a pass are illustrated in Fig. 4. The eight IAS configurations of Fig. 3 are characteristic of eight distinct terrain features (7, 8). T h e y are the most basic forms of interior adjacency sets, and all more complicated IAS's can be regarded as merely combined versions of these basic ones. Note that any contour map can be broken down into either these basic forms or combined versions of them. Thus the contour map of Fig. 5 can be viewed as an assembly of two rises (L1, L2) and (Ls, Ls), two depressions (L3, 54) and (LT, Lg), a wall (Ls, L~), and a combined form consisting of a pass (L2, Ls, L6) and two pockets (L~, L3, L5 and L2, L3, L6). P r o p e r t y 7. A contour line of value e~ that has no interior contour line but whose EAS contains a contour line of value e~-l(e~+l) encloses a peak (pit) of elevation. The graph of a contour map is the topological dual of the contour map. I t consists of nodes interconnected with directed branches. Each node of the graph corresponds to an inter-contour region of the map, and each branch corresponds to a contour line separating two inter-contour regions. The direction of a branch

2 There is a permissible fifth configuration, in which all contour lines have the same value. However, this configuration can be considered to be a generalized form of wall or moat and hence will not be taken as an additional distinct configuration.

Vol.284,No. i, July 1957

7

H. Freeman and S. P. Morse L/4

FIa. 5. Contour map No. 2. is always taken from the exterior to the interior of the corresponding contour line. The graph of the contour map of Fig. 5 is shown in Fig. 6, and the graphs of the basic IAS configurations of Fig. 3 are shown in Fig. 7. Observe that a graph is a complete, unique topological description of a contour map. The following properties are easily deduced for the graph of a contour map: Property 8. A node may have any number of branches directed away from it; however, only one branch may be directed toward any node. Hence, all contour-map graphs are of the form of trees. Property 9. If a node has a branch directed toward it but none directed away from it, the node corresponds to either a peak or pit of elevation. (Prop. 7).

P r o p e r t y lO. If a node has branches directed away from it but none directed towards it, the node corresponds to the exterior of the entire contour map. (There can, of course, be only one such node.) Topological C o n s t r a i n t s

The first phase in the solution of the contour-map search problem consists of finding those areas of the contour map that satisfy the topological constraints implicit in the given terrain elevation profile (9). The procedure for this is as follows: Given the terrain elevation profile, it is possible to write a sequence of numbers, called a track sequence that indicates the contour lines intersected by the (as yet unknown) track on the contour map. The track sequence is thus a topological description (in elevation) of the ground track. It can be obtained simply by super-imposing horizontal lines over the terrain elevation profile at ordinates equal to the contour-line values of the map and then writing in sequence

8

Journal of The Franklin Institute

On Searching a Contour Map Lf/4~L2/5

/

. . ~ L/6

-,<.

1-3// ~

/6

io

k/7

Fro. 6. Graph of contour map No. 2. the values of the lines intersected b y the profile. Thus, the track sequence for the terrain elevation profile of Fig. 8(a) is (from left to right) 3, 4, 5, 6, 6, 5, 4, 4, 5, 6. From Properties 4, 5, and 6 of a contour map, the following two properties of track sequences follow at once: P r o p e r t y 11. Successive terms in a track sequence must either have the same value or must differ in value by one elevation increment E. P r o p e r t y 12. If there are an even number of identical terms in succession, a change from ascending to descending or vice versa is indicated in the sequence ei c~

gi+ I .Y.- c

eI ~

o

o

(o)

el_ I

eI

o

OEPRESSION

~

ei

c

-'- o

el+ I

eI

o---.-m----c,,

(c)

(d)

WALL

MOAT

i+l

eI

(el

b ~

{g)

POCKET

b

eI

eI

C

I-I

If)

PASS

el

b

(b)

RISE

o-.-.-m..---.c

el_ I i~ C

BAR

o el

b '~ee~ -I

{h)

TRAY

FIO. 7. Graphs of the basic IAS configurations.

Vol. 284, No. 1, July 1967

9

H. Freeman and S. P. Morse 7 6

"

4

3

~

J l

It

/]

[ ] Il E t TERRAIN 1 J I s I

I l ] l

+ I

/

i

I 1 ] (o) ELEVATION I t ]

+~++J++.~.

4

\

I

I 4 - -

; ' ~

Jl

i !

I I

i 1 I I

+

t

PROFILE i I

t I

\

i

I

F

+.~

+6/

l

CONTOUR MAP Fio. 8. A terrain elevation profile and its corresponding contour map

trac]~.

of elevation values. If the number of identical terms in succession is odd, the previous direction of change (ascending or descending) will be maintained. 8 The track sequence, obtained from the given terrain elevation profile, represents a set of topological constraints that must be satisfied by the unknown ground track. To relate these constraints to the contour map, the concept of a path is introduced. A path on a graph is a sequence of connected branches from an initial node to a terminal node. A branch m a y appear more than once in a path and may even appear more than once in succession. A path is specified by listing the labels of the branches in the order in which they are traversed. Each ground track on a contour map will have associated with it a specific path on the graph of this contour map. Further, all ground tracks having the same path will have the same track sequence. Since, however, a track sequence is merely a sequence of branch values and does not identify specific branches, there m a y be m a n y paths on a graph that correspond to a single track sequence. For example, consider the track sequence 5, 6, 7 associated with an unknown a T h i s a s s u m e s t h a t t h e g r o u n d t r a c k n e v e r lies t a n g e n t to a c o n t o u r line. A g r a p h s t r u c t u r e t h a t is n o t s u b j e c t to t h i s l i m i t a t i o n is described elsewhere (9).

10

jo~

of The Franklin Institute

On Searching a Contour Map track on the map of Fig. 5. The following paths are both able to satisfy this track sequence (see Fig. 6): L~, L6, L6 L3, L6, 56 Note that the path Lg, LT, Ls, L6, Ls (which also begins with a contour line of value 5 and ends with one of value 7) cannot satisfy the track sequence because it contains a wall represented by LT, Ls. To begin the actual solution of a contour-map search problem, one first finds the track sequence for the given terrain elevation profile and then determines all paths on the contour map that are able to satisfy this track sequence. The paths are determined as follows: Assume that the first term of the track sequence is e~. Construct a list of all branches whose value is el. Next assume that the second term of the track sequence is e~+~. Any el entry in the list for which more than one transition from el to e~+~is possible (e.g., at a pass) is first repeated in the list as many times as such transitions are possible. Then the labels for the distinct e~+l-valued branches are entered as before. At this stage the list will contain all possible two-branch paths on the map that satisfy the sequence e~e~+~. Now assume that the next term of the track sequence is also e~+l. Then each last entry is immediately entered again, alongside itself. In addition, all those paths for which it is possible to make transitions to new branches of value e~+l are repeated in toto as many times as such transitions are possible, and the appropriate new labels are then entered. All possible paths that satisfy the sequence e~e~+le~l will now be in the list. The foregoing procedure is continued, term by term, over the entire track sequence. At each stage, those entries in the list that do not permit the indicated transition in elevation are discarded and not considered further. Whenever there is an entry for which more than one transition is possible, the entire path leading up to this entry must first be copied down as many times as there are possible transitions before the labels of the new branches can be entered in the list. The paths remaining in the list after the complete track sequence has been considered are the only paths on the graph that satisfy the entire sequence. Therefore, only those inter-contour regions that correspond to the nodes of these paths can contain the desired ground track, and only these need be considered further in the search for this track.

Path Elimination Test Thus far neither the shape of the flight path nor that of the contour lines has been considered. The search for the ground track has been narrowed down purely oil the basis of topological constraints. It will now be assumed that a ground track consists either of a single straight line or of a series of connected straight-line segments of known lengths and known

Vol. 284, No. 1, July 1967

11

H. Freeman and ,g. P. Morse

angles between successive segments. This assumption, which is perfectly reasonable for practical applications of the search problem, imposes important geometric constraints on the possible location of the ground track. The first step following the determination of the path list is to attempt to reduce the number of paths in the list through the use of a simple minimumdistance test. From the flight path and the terrain-elevation profile, one can compute the straight-line distances 4 between any two contour-line crossings listed in the track sequence. Also, a relatively simple algorithm (10) exists for determining the minimum distances between any two contour lines of the contour map. The path elimination test thus consists of obtaining the minimum distance between a pair of contour lines in a path and comparing this distance with the actual distance associated with the corresponding entries in the track sequence. If the distance associated with the track sequence entries is less than the minimum for the path contour lines (with some allowance for measurement errors), this path is rejected and no further tests made on it. If not, another pair of contour lines in this path is tested. At the completion of the test, the only paths remaining in the list will be those for which all possible contour-line pairs have minimum distances that are less than the actual distances associated with the corresponding entries in the track sequence. For example, consider the two paths L~, L6, L8 and L3, L6, L8 that satisfy the track sequence 5, 6, 7 for the contour map of Fig. 5. Let the distances associated with the track-sequence entries and the minimum distances for the contour-line pairs be as follows: Track Sequence 5-6: 1.7 6-7: 0.7 5-7: 2.4

Contour-Line Pairs L3-L6 : 1.53 L3-Ls : 2.55 Lo-L8 : 0.55 Lr-L6 : 0.95 L~-L8 : 1.55

For the path L3, Le, L8 the minimum distance between L3 and L0 is less than the 5-6 distance of 1.7, and the test is passed. The minimum for L r L s similarly is less than the 6-7 distance of 0.7; the test is passed again. When the minimum for the pair L3-Ls is checked against the 5-7 distance, however, it is found to be in excess (2.55 against 2.4), causing rejection of the L3, Le, L8 path. The same test applied to the L~, L6, L8 path does not yield a rejection; if it had, all paths would have been rejected and the ground track could not be located anywhere on this contour map. The path elimination test 5 can, of course, not eliminate all possible false paths. The test cannot be applied too strictly because an allowance must be made for "noise" in both the contour map and the flight data. For those paths that are not rejected (if more than one), a further search procedure is required. 4 As the crow flies; the distance along the flight path may well be longer. 6 The test could be expanded to include also permissible maximum distances; though, such a test would require considerably more computation than the minimum-distance one.

12

Journal of The Franklin Institute

On Searching a Contour Map

Contour-Map Mazes The region of minimal area in which all straight lines must fie that intersect certain specified contour lines and not others will be called a simple maze. Observe that inclusion of a straight line in a maze is merely a necessary condition that the straight line intersect the contour lines as specified; it is not a sufficient condition. However, by requiring the maze to be a region of minimal area, the possibility is minimized (but not eliminated), that straight lines lying within the maze do not intersect the contour lines as specified (11). When two or more simple mazes are combined to obtain the region in which all assemblies of two or more connected straight-line segments having specified lengths and specified angles between successive segments must lie, the result is called a compound maze. Two Disjoint Contour Lines

Consider the simple maze for two disjoint contour lines illustrated in Fig. 9. Clearly all straight lines intersecting both contour lines must lie wholly in the maze, and no region of smaller interior area has this property. The following observations can be made about this maze: 1) Each maze boundary is composed of connected straight-line segments. 2) Each such straight-line segment, if extended, is tangent to the two contour lines. 3) A straight-line segment used in forming the maze boundary cannot extend across a point of tangency at either contour line. 4) If a line is added to either maze boundary such t h a t a closed figure is formed, that figure is convex. 5) The first straight-line segment of one maze boundary and the last straightline segment of the other maze boundary are collinear. In the following discussion, the disjoint contour lines will be labeled LI and

FIG. 9. Simple maze for two disjoint contour lines.

VoL 284, No. J, J ~

~7

13

H. Freeman and S. P. Morse

Fro. 10. Simple maze for two disjoint and one interior contour line.

L2, and the maze will be assigned a positive direction from L1 to L~. The maze boundary on the right of the maze will be called the right maze boundary and the maze boundary on the left will be called the left maze boundary. One Interior Contour Line Consider a straight line t h a t intersects two disjoint contour lines L1 and L2 but does not intersect a contour line La that is interior to L2. This configuration is shown in Fig. 10. Note t h a t in this case the maze boundary does not consist entirely of straight-line segments. A portion of L3 contributes to the maze boundary. Hence, observation (1) for two disjoint contour lines can be made to apply in this case only if it is modified to read: 1) Each maze boundary is composed of straight-line segments and portions of convex hulls 6 of contour lines. Two straight-line segments of a maze boundary are said to be adjacent if e The convex hull of a contour line is the convex figure of m i n i m u m area containing the contour line. A figure is said to be convex if a n y two points in the interior of t h e figure can be

connected by a straight line that is wholly contained in the interior of the figure.

14

Journal of The Franklin Institute

On Searching a Contour Map

Lj

(o)

(b)

(c)

(d)

FIG. 11. Mazes for two disjoint contour lines, each with an interior contour hne. they are connected either directly or through a portion of a convex hull of a contour line. Two additional properties of mazes can now be noted: 6) Two adjacent straight-line segments of a maze boundary are tangent to the same contour line. 7) If two adjacent straight-line segments of a maze boundary will intersect only if both segments are extended beyond their points of tangency on a particular contour line, then the portion of the contour line lying between these points of tangency and closer to this intersection will form a part of the maze boundary. I n t e r i o r C o n t o u r L i n e s in G e n e r a l

Consider two disjoint contour lines, each containing one interior contour line. There will be four mazes for this configuration, as illustrated in Fig. 11. If two disjoint contour lines each have more than one interior contour hne, m a n y more distinct mazes m a y exist. However, note t h a t it will be most unusual to find instances of contour fines with more than two interior contour lines in any contour map representing natural terrain. C o m m o n Exterior C o n t o u r L i n e

Consider again the simple maze for two disjoint contour lines (Fig. 9) but now with the added condition that the straight line intersecting the two disjoint contour lines must do so without intersecting a common exterior contour line. The maze for the two disjoint contour lines can be found first, without regard to the exterior contour line. Then if the common exterior contour line does not intersect the central section of this maze, that is, the finite-length section lying between the disjoint contour lines, then this maze is also the maze for the configuration t h a t includes the exterior contour line. Otherwise the maze must be

VoL2u, No. ~, july ~7

15

H. Freeman and S. P. Morse

{o)

"'~.

/1 ~

Fro. 12. Modification of maze boundaries to account for a common exterior contour line. (a) Central section modified only. (b) Central and outer sections modified. (Original maze boundaries indicated by dashed lines.)

/L3~

modified to satisfy the added condition. The modification m a y affect both the central section of the maze as well as the outside sections, as illustrated in Fig. 12.

Concave Contour L i n e s I n constructing the mazes for the previously mentioned contour-line configurations it was assumed t h a t each intersected contour line was to be intersected exactly twice. This is always the case if the contour lines are convex. If one or more of the contour lines in a configuration are c o n c a v e / a s is usually the case, the situation becomes more complicated. Now it m a y be possible for a concave contour line to be intersected more t h a n twice (but always an even number!). The convex hull of a convex contour line is the contour line itself. A cave is a segment of a contour line t h a t does not lie on the convex hull and cannot be extended without intersecting the convex hull. A convex contour line has no caves. The door of a cave is the portion of the convex hull t h a t is not a p a r t of the contour line and that, together with the cave, forms a closed figure. A door of a cave is always a straight line. A cavoid is the closed figure consisting of a cave and its door. If a cavoid is a concave figure, it contains one or more caves of its own. Whenever reference is made to the "caves of a contour line," it shall be assumed that this includes also all caves t h a t are caves of other caves. If the orientation of a concave contour line with respect to another contour line is such that any straight line t h a t intersects the latter cannot intersect the the concave contour line more t h a n twice, then the two contour lines are said to be relatively convex. This is illustrated in Fig. 13 (a). I n general, the presence of caves in a contour line will result in the existence of a n u m b e r of distinct 7 A contour line is said to be concave if it is not convex.

16

Journal of The Franklin

Institute

On Searching a Contour Map

~///////i//////////////z///////f

(> ;,

(al

1111//////////////////////I/'2~

Ad~-LdL~//////////////////////////zHL/J ~ "~

~(b)

Fio. 13. Mazes for concave contour lines with two intersections. (a) Relatively convex pair. (b) Three distinct maze configurations for a contour-line pair that is not relatively convex.

maze configurations for two intersections of the contour line with a straight line, as shown in Fig. 13(b). F o r concave contour lines it is possible for four (or more) intersections with a straight line to exist. Consider a straight line t h a t intersects two disjoint contour lines, L1 and L2, where L1 is convex and L2 is concave, such t h a t the n u m b e r of intersections with L1 is two and with L~ is four. Assume L~ has one cave. Such a configuration is shown in Fig. 14 (a). Clearly the middle two intersections of L2 must occur in a cave and further, both m u s t occur in the same cave. Also, the straight line m a y not cross the door of this cave but must pass through the door of any other cave intersected. Note t h a t depending on the relative orientation of L1 and L~, there m a y sometimes be one or two possible mazes. An orientation yielding two mazes is illustrated in Fig. 14(b). I n general, if a straight line intersects a contour line 2k times, it m u s t intersect exactly k - 1 caves without crossing their doors. I t m a y intersect other caves provided it crosses the doors of these caves.

Other Configurations The process of determining the mazes for various contour-line configurations can, of course, be carried on ad infinitum. Fortunately, there appears to be no great need for doing this; the basic configurations already described are usually adequate for defining narrow bands on a contour m a p in which the desired ground track must be located. I t is of interest to point out t h a t the existence of maze boundaries is not

Vol. 284, No. i, July 1967

17

H. Freeman and S. P. Morse

-(b)

FIG. 14. Mazes for concave contour lines with four intersections. always assured. For example, maze boundaries do not exist for two disjoint contour lines if either contour line intersects or is contained inside the convex hull of the other contour line. This is illustrated in Fig. 15. As the two disjoint contour lines in Fig. 15 are brought closer together, the maze boundary first degenerates into two lines and then vanishes altogether. Such degenerate configurations are of no value in any process to localize the search for an unknown ground track.

Obtaining Maze Boundaries Before starting to obtain the maze boundaries it is desirable to determine whether maze boundaries indeed exist. This is done by checking whether the convex hulls of the disjoint contour lines overlap. The algorithm that generates convex hulls can simultaneously also generate a list of caves of the contour line. This list is useful for determining the possibilities of multiple intersections. The algorithm starts by considering a tangent to the concave contour line at a point that has been selected so that the tangent does not intersect the contour line at any additional point. The point of tangency is then moved clockwise along the contour line until the tangent line becomes tangent to the contour line at two points. There will be two portions of the contour line connecting these two points. The portion that is closer to the tangent line is a cave, and the

]8

Journal of The Franklin

Institute

On Searching a Contour Map

J

(a)

(b)

(cl

I d )

FIG. 15. Example of maze degeneration. segment of the tangent line between the two points is the door of the cave. The door of the cave as well as the portion of the contour line for which the tangent line intersected the contour line only once are placed on a list of convex hull portions. The clockwise advance of the tangent point is then continued, starting with the newly found point of tangency. After the tangent line has been rotated through 2~r radians, the entries in the list of convex hull portions represent the entire convex hull, and no further entires are made in this list. The algorithm is next applied to each cavoid on the list of cavoids to obtain still more entries on the list of cavoids. The process is continued until the last entry on the list of cavoids generates no additional cavoids. For the remainder of this section all references to contour lines will actually refer to the convex hulls of these contour lines. The initial step in obtaining the first line of the maze boundary is to obtain a straight line intersecting both LI and L2 and having the greatest clockwise orientation. The algorithm that accomplishes this starts with a straight line drawn between L1 and L2. This straight line is rotated clockwise about the midpoint of its segment between L1 and L2 until it becomes tangent to one of the disjoint contour lines. The straight line is then rotated further but with the condition that it remain tangent to this contour line. The rotation is terminated when the straight line becomes tangent to the other contour line as well. The next step is to place all interior contour lines of L1 or L~ on their desired sides of the straight line. The algorithm that accomplishes this starts with the straight line intersecting both L1 and L2 and having the greatest possible clockwise orientation. Each interior contour line is considered, one at a time, to determine whether it is on the desired side of the straight line. If the contour line is on the desired side, the next interior contour line is considered. If not, the straight line is rotated counter-clockwise until the contour line is on the desired side. The process will end with each interior contour line on its desired side or with a realization that the desired maze is not possible. If the straight line intersects L1 twice and L~ twice, no further conditions are added. If, however, L1 is intersected 2ka times and L~ is intersected 2kb times, where either ka or kb is greater than unity, then the straight line must pass through at least ka -- 1 cavoids of L1 and kb -- 1 cavoids of L~ but may not pass through the doors of these cavoids. (See (11) for detailed descriptions of the algorithms for constructing a maze.)

Vol. 284, No. I, July 1967

19

H. Freeman and S. P. Morse

~

L2

FLIGHT PATH

//

/

L5

F I G . 16. A c o m p o u n d

maze.

F i t t i n g of Flight P a t h Contour map mazes provide a very effective means for narrowing down the search for the unknown track. Their use is as follows: Given a path, the contour lines in its sequence are examined to find those that are intersected two or more times in succession. These contour lines are termed critical contour lines because of their suitability for maze construction. All pairs of critical contour lines occurring successively in the path are considered and their supposed intersections with the flight path are noted. Simple mazes are then constructed for all those critical contour-line pairs between which the flight path is a straight line. As soon as two mazes that occur successively in the path have been obtained, they are combined into a compound maze, taking full account of their respective locations on the contour map. A check is then made to determine whether it is possible to locate the flight path in this compound maze. If the result is negative, the entire path is rejected. If affirmative, the next maze in sequence is computed and added to the compound maze. The procedure is repeated until either the compound maze for the entire path has been obtained or the path has been rejected. All the paths that survived the path elimination test are considered, one at a time. When finished, only those paths will remain whose compound mazes are able to accommodate the entire flight path. (It is likely that at this stage all but the true path will have been eliminated). A sketch of a compound maze is shown in Fig. 16. The compound mazes that satisfy the entire flight path will delineate fairly narrow bands on the contour map within which the desired ground track must lie. The final step for finding the ground track is then essentially a fitting-type operation. A line is drawn in the compound maze having the precise shape of

20

Journal of The Franklin Institute

On Searching a Contour Map

I"~ONTOUR-MAPI {/ ELEVATION TERRAIN ] S FLIGHT I DATA PROFILE PATH

hETERM' NAT'ONthETERM'NAT'ONI | OFGRAPH I |OF TRACKSEQ.] PATHLIST I ~

ICALCULATION|~ ."'=,

..~1

|

/

//~

" * , I

CALCULATION I I OF

I

/

I CALCULATION I

I

OF FLIGHT PATHI

",,

I

I

PATH ELIMINATION

CON'CT,ON} SIMPLE MAZES1

1

OUND MAZES~

I FITTING OF FLIGHT PATH SELECTION GROUNDTRACK FIG. 17. Flow chart for solution of contour-map search problem. the flight path. This line is positioned so that the intersection with the first critical contour line coincides with the known intersection of the flight path. The distance to the next critical contour line from this point is then compared to the corresponding distance on the flight path. 8 A search procedure is then undertaken to find the positions on these two contour lines that yield a distance equal to the corresponding distance on the flight path. The procedure is repeated for other critical contour-line intersections, each time yielding a more precise positioning of the flight path and resolving ambiguities for intersections that were not uniquely defined. A least-squares fitting routing can then be used to obtain the final position of the flight path, which is of course, the desired ground track. If it is found that the flight path cannot be fitted into a compound maze within the allowed tolerances, the associated path is rejected. If all paths are rejected, the ground track does not lie anywhere on the given contour map or the "noise" on the data exceeds the allowed tolerances. If more than one compound maze yields an acceptable flight-path position, the one yielding the lowest 8 Already known from the path-elimination test calculations.

VoL 284,No. ~, ju~y ~ 7

21

H. Freeman and S. P. Morse

FIG. 18. Photograph of contour map. (Fall River Pass, Colo.)

i~

15,910 m

]--.-73,0'-4

START

MARKER

"'O~o%F

"/e, oA

INISH

Fxo. 19. Flight path for illustrative problem.

22

Journal of The Franklin Institute

On Searching a Contour Map I~00

12.~0

IZgCV I~0C

Ii¢?0O

IOn00

i

',

t 't ;

! ! !I

; i iI

! !

K i

i i

/i

/ / 96OO

/ / * 2

/

i

t 4

i

I 6

if,

~ 8

i

DISTANCE

i IO

I (IN

i 12

i

I 14

THOUSANDS

I

i 16 OF

i

I 18

i

i 20

i

i 22

I

I 24

i

I 26

i1 26

FEET)

Fro. 20. Terrain elevation profile for illustrative problem. error value in the least-squares fitting routine is taken as the desired ground track. An overall flow chart for the solution of the contour-map search problem is shown in Fig. 17.

Computer Program The foregoing procedure for the solution of contour-map search problems was programmed for a digital computer. The program was written in F O R T R A N IV and utilized a large collection of F O R T R A N subroutines specifically written for the processing of graphical data. T h e central processing was done on a CDC 6600 and the graphical I / 0 functions were carried out on a P D P 5 computer. Not all the techniques described were included in the program; though, provisions were made to incorporate them later. Thus the program included neither the path elimination test nor the multiple intersection feature for use in the construction of mazes. The program consisted of over 2500 F O R T R A N statements, and even in its limited form proved capable of solving fairly complicated contourmap search problems.

Illustrative Problem T o illustrate the effectiveness of the foregoing techniques, the solution of a realistic contour-map search problem was undertaken. A contour map of the Fall River Pass quadrangle in Colorado was obtained from the U. S. Geological Survey. The map covered the region from 40o22'30 '' to 40°30'00" north latitude and from 105°45'00" to 105052'30" west long. The scale of the map was 1 : 24,000. Contour lines on the map were given in 40-foot increments; however, for this problem only every fifth contour line was considered (200-foot increments).

vo). 2s4, No. 1, July 19~7

23

H. Freeman and S. P. Morse

5.

POSITIVE ? gX[$ (XIO s ) 10.

15.

$0.

~0.

Fro. 21. Contour map with superimposed ground track.

The contour lines were encoded for a digital computer using the so-called chainencoding scheme (10). One unit of the quantization grid corresponded to 200 feet of terrain distance. The entire contour map data required approximately 500 punched cards. A photograph of the contour map (Fig. 18) was prepared (reduced in the ratio 1:2.67) and a "flight" was then made on this photograph. The flight path consisted of a straight line beginning at 40°25'41 t' north, 105°51'08 '' west and

24

Journal of The Franklin Institute

On Searchsng a Contour Map

running for 15,910 feet in a northeasterly direction to 40°27r26 p' north, 105°48r38 '' west, then a 30 ° right turn, followed b y a straight-line run of 12,040 feet, to 40°27t51" north, 105°46'07 '' west. Elevation readings were taken at 215-ft. intervals along the flight p a t h and quantized to the nearest 40 feet. A drawing of the flight p a t h is shown in Fig. 19, and the associated terrain elevation profile is given in Fig. 20. The terrain elevation profile can be assumed to contain a realistic amount of "noise" because the elevation readings were t a k e n off the reduced photograph (which exhibited some distortion) without a n y great care and were quantized to the nearest 40 feet. T h e program was able to solve the problem without difficulty. Either of the two straight-line portions of the flight p a t h was found to be sufficient b y itself to locate the ground track on the contour map. When only the first portion was used, the total running time on the C D C 6600 was 948 seconds; when only the second portion was used, it was 496 seconds. To test the precision of the ground track found b y the computer, a marker was specified along the flight path, 7310 feet from the starting point. The known position of the marker was at 40°26'29" north, 105050'00" west. The position of the marker, using the computer-determined location of the flight p a t h was found to be 40°26'30" north, 105°50'00" west, a discrepancy of only 1 second of arc. The location of the ground track on the encoded contour m a p is shown in Fig. 21.

This research was supported by the National Aeronautics and Space Agency under Grant NGR-33-O16-038.

References (1) H. J. Bremermann, "Optimization Through Evolution and Recombination" in SelfOrganizing Systems 1962, Wash., D.C., Spartan Books, pp. 93-99, 1962. (2) H. Freeman and L. Garder, "Apietorial Jig-Saw Puzzles: The Computer Solution of a problem in Pattern Recognition," I E E E Trans. Electron. Comp., vol. EC-13, No. 2, pp. 118--127, April 1964. (3) M. J. Hairns, "On the Optimum Two-Dimensional Allocation Problem," doct. dis.; also Tech. Rept. 400-136, Dept. of Elec. Eng., New York Univ., Bronx, N.Y., June 1966. (4) M. Minsky, "Steps toward Artificial Intelligence," Proc. IRE, vol. 49, pp. 8-30, Jan. 1961. (5) J. Feder and H. Freeman, "Digital Curve Matching Using a Contour Correlation Algorithm," 1966 I E E E Int'l. Cony. Record, pt. 3, pp. 69-85, March 1966. (6) S. P. Morse, "Mathematical Model for the Analysis of Contour-Line Data," Tech. Rept. 400-124, Dept. of Elec. Eng., New York Univ., Bronx, N.Y., Oct. 1965. (7) Cayley, "On Contour and Slope Lines," Phil. Mag., Oct. 1859. (8) J. C. Maxwell, "On Hills and Dales," Phil. Mag., Dec. 1870. (9) S. P. Morse, "A Topological Approach to the Problem of Searching on a Contour Map," Tech. Rept. 400-129, Dept. of Elee. Eng., New York Univ., Bronx, N.Y., Jan. 1966. (1O) H. Freeman, "Techniques for the Digital Computer Analysis of Chain-Encoded Arbitrary Plane Curves," Proc. Natl. Electron, Conf., Vol. 17, pp. 421-432, Chicago, Ill., Oct. 1961. (11) S. P. Morse, "Generalized Computer Techniques for the Solution of Contour-Map Problems," doct. dis., Dept. of Elec. Eng., New York Univ., Bronx, N.Y., 1967.

Vol. 284, No. 1, July 1957

25