UDC 528.932.4(084):681.3 061.3(497.12):528 Geodetu: Workshop "1993" DIGITAL IMAGE PROCESSING IN COMPUTER-SUPPORTED HILL SHADING Mateja Debelak, M.Se. JNGIS, Ljubljana Received forpublication: Aug. 23, 1993 Abstract Numerous software packages, developed far automatic hill shading, are based on algorithms of different quality, which salve phases of mathematically formulated procedures. Good results can be achieved by interactive work, iterative procedures and parameters adapted to local terrain configuration. This turns out to be a ve,y tirne consuming and in practise ve1y unpopular searching and parameter testing. To do this more and more procedures known from the field of digital image processing, which enable faster and more quality work, are used. Keywonlls: automatic hill shading, Bled, computer support, digital images, Geodetic workshop, Slovenia, 1993 INTRODUCTION Man has come to understand very early that by the aid of pictorial images of earth's surface he can simplify his movement and life in environment. So thousands of years before out of the first clumsy attempts of drawing a man's surrounding there slowly emerged cartography, which belongs nowadays to the oldest still living sciences. In contrary to numerous sciences having reached their highest point in the computer era and have then started to die out, at present the cartography is actually experiencing a renaissance. The computer technology enables cartographers the automation of individual work steps and with it a faster, more simple and qualitative elaboration of earth's relief representations, from the classic geographic and thematic maps to new relief representations, impossible to be made by hand in the past because of their complicated nature. The automation in cartography is connected with numerous questions with no satisfactory answers as yet. The basis of a computer-supported map elaboration is a unique mathematical relief formulation, which can not be written due to uneven three-dimensional shape of the Earth, its broken ground and representation measurement (generalization ). In addition, the artistk nature of relief representation and its visual effect upon man aggravate a complete automation of all steps of work - but that is too much to be expected in the nearest future. At present operationally applicable are automated procedures, which enable us to salve individual steps of work, and more complicated iterative procedures of manual elaboration of a clearly defined type of earth's relief representation bound to a man's insight and interference Geodetski vestnik 37 (1993) 3 into his work. In spite of some shortcomings there are numerous advantages of automated work (faster work, more qualitative results, elimination of a subjective human factor at decision-making, substitution of operators by automated procedures at carrying out the toilsome and long-lasting routine tasks), therefore today automated work procedures are used in every modem cartographic house. HILL SHADING Plastic relief representation e.g. it's three-dimensional quality onto the sheet level has always meant a great challenge to cartographers. Following the development of such techniques we first come across simple drawings of rotated „molehills" and heaped-up mounds, follow then all kinds of line-drawing techniques to already perfected procedures, which are up-to-date even now (contour lines, hill shading, use of colours, etc.). ue to its distinct impression of plasticity the hill shading technique belongs to more important and frequently used (accompanying) modes of relief presentation on various geographic and thematic maps. In the course of tirne numerous qualitative procedures have been developed and perfected, for which general characteristics are distinct plasticity, visuality and reality, gained through mathematical semi-correctness of displayed surface. The manual hill shading beeing a toilsome work and requiring skilled and conscientious operators, the automation of this step of work has always been a subject of numerous developmental and research activities. So today cartographers can use numerous for this purpose developed software packages based on different approaches of solving this particular problem. In general these are imitations of already established and efficient manual procedures ( e.g. the Swiss hill shading school), based on the calculation of the amount of exposure of the earth's surface as to the angle and direction of relief inclination, shape, position and amount of exposure, etc.). The used parameters differ in various procedures (linear, flat surface or series of point sources of light, the mode of calculating and taking into consideration diffuse repulsion, realistic hill shading with artificial colour charts and alike ). A compromise between the demanded plasticity of the displayed relief and its reality (or even exactness) may be set up by a right combination of parameters of various values, adapted to local characteristics of the relief. The quality of results depends on tlie quality of algorithms. In general high quality and homogeneous presentations of relief hill shading can be made at comparatively high work rate. On the other hand the work is slowed down and aggravated by numerous shortcomings bound to a time-consuming hill shading parameter searching, adapting procedures to local terrain configuration, unavoidable interactive postprocessing of individual parts of the surface and so forth. Since there are extremely large quantities of data to be processed (expensive computers) in practice these procedures turn out to be only partly efficient. A 11 this makes it a necessity for a continual development of the existing and for .t-\.searching new procedures for computer generated shadows. The improvement of computer technology, especially hardware price reduction along with its ever increasing capacity and additional development of digital image processing, computer sight and artificial intelligence have opened, also in the field of computer supported hill shading, new possibilities which will be discussed further on. Since the Geodetski vestnik 37 (1993) 3 ctevelopment of procedures for digital images processing is a domain of computer people we will present only a few basic procedures, made for optional non cartographic purposes but which can efficiently be implemented also in cartography. Such procedures are a component part of numerous commercial software packages. The results of such a mode are noted for their high quality, exceptional variability as to their outlook and possibility of additional relief evaluation ( e.g. defining trenches and crests). For this purpose we developed a procedure which is based on only vaguely given basic hill shading parameters and the use of standard digital filters within the complex of postprocessing of hill shading relief representation. The procedure is adapted to the capabilities of Intergraph/USA software, the pilot representations were carried out by the workstation of the InterPro 2000 series (MSM Terrain Modeler, ISI2 - Image Station Imager 2, ModelView, MicrosoftStation32). WORK PROCEDURE he used procedure for computer generated hill shading is based on the calculation of the amount of exposure of small enough fini te elements by which the earth's relief is approximated. For this purpose a dense enough DTM grid ( digital termin model) was developed over the test surface. The calculation of exposure is fairly simple and depends on: • absolute position of the test surface in a chosen cartographic projection • in advance defined perspective projection • inclination and inclination course of individual grid cells • type, course and distance of the source of illumination • intensity of illumination source • quantity and characteristics of diffuse repulsions, dependent on local surroundings of the grid cells. As to the given gray or colour scale the system.automatically classifies the gained values of the amount of illumination of individual grid cells. Since there are comparatively high demands in elaboration of standard geographic thematic maps as to their quality and the broken groundness of the relief being very varied (a combination of plain and very broken ground terrain), the quality and visual effect of so simply elaborated shadows (Fig. A) can not satisfy us (too low plasticity, non smoothness, indistinct contrasts ... ). Better results could be obtained by introducing additional sources of illumination ( artificial lights ), se parate processing of individual parts of the area, or improvement of the procedure for generating shadows (programming). All this is connected with a long-term work and unreliable results so it is more simple that shadows, generated by the basic procedure, are later additionally improved by procedures of digital image processing. These procedures are divided into the following basic groups: • smoothing (low-pass filters) • filtration • complete or interval modification of histogram (linear, parametric ... ) • edges focusing (high-pass filters) • contracts magnification • various geometric transformations (addition, rirnltiplication, images division ... ) etc. Geodetski vestnik 37 (1993) 3 he majority of these procedures is based on the processing of the local surroundings (windows) of individual elements (grid cells), which are prior to digital processing transformed into raster format (1 pixel = 1 grid cell + gray value level). The size of the defined window stipulates thc quality of results and velocity of processing whereas at practical task-solving (a huge amount of data) as to the digital shadow image outlook most often we limit the size of windows to 3 x 3 till 9 x 9 pixels. The whole procedure of the computer generated shadows can be summed up to a series of correlative work steps: . • creating a dense enough DTM grid over a chosen area as to the representation scale • defining rough hill shading parameters as to the terrain configuration and demanded outlook of shadows (projection defining, type defining, distance, azimuth and angle of incidence of the source of light, amount of illuniination, amount ofpartial repulsion, raster density, etc.) • generating hill-shading relief (raster format) • visual results control and procedures selection for digital image processing • digital image processing: - histogram generating and analyzing - contrasts and illumination magnification - smoothing (low-pass filter with weights) - binary image segmentation as to the chosen pass threshold - geomctric processing of obtained digital images - adjusting of contrasts and illumination of the resulting image. A ny operator with experience in digital image processing can define in advance J-\.inctividual filters and the necessary work parameters, so the whole procedure runs completely automatically. As to the outlook of the wanted results the mentioned procedure may be adequately modified: • in automatic evaluation of characteristic geomorphological forms of relief we can use filters, which enable edges elimination • in highly contrasted images emphasizing the edges may be a help • for individual parts of the image various procedures may be defined (a combination of hilly and plain parts and alike). CONCLUSION y right combining of procedures for digital image processing we can fully automatically generate hill shading reliefwhich fulfills also the highest cartographic standards. The whole procedure (the combination of filters + specification of edge conditions) may be at wish adjusted to special requirements or to the aim of a result (very luminous, very strong contrasts, outlook of the photography and alike). The work rate depends on: • operator's skill and experience (tirne, needed for defining the main parameters and the unique defining of the digital image processing procedure) • number of grid cells e.g pixels which conditions the digital image processing velocity • chosen digital procedure and the size of the used windows. Geodetski vestnik 37 (1993) 3 A B D E Fig.: A-Shadows, generated by the basic procedure, B-High-pass filtration, C-Low-pass filtration, D-30% contrasts magnification, E-Geometric transformation results, F-Smoothing, G-Edges elimination Geodetski vestnik 37 (1993) 3 of information: we would like to sta te that for the processing of an area of x 1024 pixels (transferred to the map scale and the demanded accuracy of 0,2 mm in 1:50 000 scale it means an area larger than lOkmx 10km) with a workstation InterPro 2000 (low capacity) for computer generated hill shadows (with known ranks of basic parameters) only a few minutes, for further controlled digital image processing 10 minutes at the most are needed. Qualitative output units with a possibility of transferring drawings directly to the film at our disposal, the so generated shadows a.re directly appropriate for printing. Refenmces: Jain, A. K., 1989, Fundamentals of Digital Image Processing, USA, 569 p. Intergraph, 1992, MicroStation GIS Environment/ISI2, User's Guide, USA. Intergraph, 1992, MicroStation Terrain Modeler, User's Guide, USA. Rihtaršič, M, 1989, Glajenje digitalnih slik, Seminarska naloga FAGG, Ljubljana, 38 p. Review: Matjaž Kos DaliborRadovan, MSc. Geodetski vestnik 37 (1993) 3