Abstract
Digital terrain model (DTM) is currently used n various applications. However, there have not any that organization provide the DTM data for public. In this paper, we try to generate the DTM data by ourselves. The terrain elevation information is acquired by using scanner machine over the topographic map with scale 1:50,000. Three couples of thresholds are applied to the digitized color map for obtaining the binary contour map. The contour thinning is attained by skeleton procedure while the contour connection is performed by manual editing. The cubic spline interpolation is applied to calculate the height of each pixel in order to plot on the screen as 3-dimentional graphic. Finally the satellite data are combined with this graphic to obtain 3-dimentional image.
Introduction
Since it is quire difficult to imagine the terrain elevation by using the contours information from topographic map. However, there have not any thai organization who takes in charge the responsibility for producing digital terrain model (DTM). Therefore, we try to generate the DTM data by ourselves with based on microcomputer ourselves with based on microcomputer. By this ways the remote organization, which has not so much budget, can be accomplished the work concerned with the terrain elevation.
The DTM data can be acquired by using scanner machine which is connected to the microcomputer. The contours topographic map are digitized and stored in the binary from. Th obtained contours are thicked and broken, so thinning and connecting process are applied to generate the perfect contours.
The cubic spline is used a interpolate technique for calculating the height of the pixels located between the contours. The 3 dimensional graphic is plotted by using the high information. Finally, the reflectance from satellite imagery data is combined into the graphic for reconstructing a 3-dimensional image. The detail of each process can be described as the following paragraph.
Thinning Procedure
The contour lines are obtained by scanning the topographic map. Since the topographic map is colored. Therefore, a set of threshold from each color band (red, green, blue) is applied to obtain a binary contour map. The contour liens in the resultant map are thicks. Then the thinning algorithm (30 is applied to yield the one pixel thickness contour lines. These thinning algorithm can be described by the following.

Figure 1 Coloured contour map

Figure 2 Binary contour map
Supposed that in the contour region, a contour pixel P1 is any pixel with value 1 and having at least one 8 neighbour valued 01. The thinning procedure compose of 2 steps.
Step 1 A contour pixel P1 will be deleted if the following condition are satisfied.
a) 2 < N(P1) < 6
b) S(P1) = 1;
c) P2.P4.P6 = 0
d) P4.P6.P8 = 0
Where N(P1) is the number of nonzero neighbors of P1 and S(P1) is the number of 0 to 1 transitions in the ordered sequence of P2, P3,……….,P8, P9
If one or more of conditions (a) - (d) are violated., the value of the pixel in question is not changed.
Step 2 The conditions (a) and (b) still remain the same as in step 1, but the condition (c) and (d) will be changed to
c) P2 . P4 . P8 =0
d) P2. P6. P8 = 0
This step is applied to the resulting data in exactly the same manner as step 1.
The procedure will be applied iteratively until no further promits are deleted. A thin contour ma will be achieved.
| P9 |
P2 |
P3 |
| P8 |
P1 |
P4 |
| P7 |
P6 |
P5 |
Figure 3 8-neighbor of contour pixel p1
By applying this procedure to the image in Fig 2. The result of thin contours is shown in Fig 4.

Figure 4 Thin contour map
However, there are some broken contour lines and also the map symbols still present in the resultants. The manual correction is den for connecting the contour liens and deleting the map symbols to obtain a perfect contour map as shown in fig.5. The height of each contour line ill be assigned in the computer memory.

Figure 5 Perdect contour map