• No results found

7.3 Automated procedures for absolute orientation developed in this

7.3.1 Patch matching based on shape

7.3.1.1 Image preparation

As confirmed by the methods described in section 7.2, the first problem when trying to relate a map to an image is to bring both to a common type of representation. In this case the obvious way is to process the image in order to extract the features that will have a similar representation on the map. The method is designed to work with polygons and closed lines. Abbasi-Dezfouli extracted patches of uniform grey level by searching each image using 3x3 pixel windows, he claims that a variation of +/-2 in pixel’s grey value will locate almost all the visible patches in the image. This method was attempted, however, possibly due to the fact that in this case digitised aerial photography is used with a larger scale than the SPOT image, the results obtained were poor. Patches that look homogeneous can present significant variations that are difficult to generalise for the whole image. Therefore it seemed impossible to find a value that would properly enhance individual polygons. Another method attempted consisted of five main steps to achieve an image representation that could be compatible with the map. These steps consisted of:

• Smoothing the image • Thresholding the image

• Application of an edge detector to the thresholded image • Non-maxima suppression and thinning of the edges • “Cleaning” the image from the smaller polygons

The image was smoothed using the software developed by Newton (1993). The edge preserving filter applied (using the e d g e_ p reserv e_ sm o o th program) strengthens the grey level discontinuities while reducing the grey value differences in homogeneous regions. The algorithm used was adopted from the one outlined by Matsuyama and Nagao (1980). Each pixel of the image is considered and the grey value variance is calculated for this pixel in eight cardinal directions and in a square area with the pixel under consideration at the centre. Figure 7.1 shows the nine masks used: (a) four masks oriented North East, North West, South East and South West, (b) four masks oriented North, South, East and West, (c) one mask centred on the pixel and covering nine pixels. The area of lowest variance for each pixel is determined and the mean of this area is assigned to the pixel. This area should not coincide with an edge because edges are areas of high variance.

(a)

(b)

(c)

Figure 7.1 The nine m asks o f the edge preserving sm oothing algorithm

A fter the im age has been sm oothed a th resh o ld is ap p lied so that the d o m in an t polygons are preserved. The extraction o f edges is then perform ed using the program

edge_detection_with_masks developed by N ew ton. E dges are detected by the convolution o f a kernel, or several kernels w ith the im age. The kernels are defined in a text file to be read by the convolving program so that kernels o f any configuration and size can be applied to the image. The m ask is conv o lv ed w ith each pixel o f the im age, and the resultant value is scaled by the num ber o f pixels falling u n d er the mask. In this case the m asks represented below (perform ing the Sobel O perator) w ere used: 0 0 0 kernel a -2 0 2 k e rn e lb - 1 0 1

For each pixel in the im age its edge strength and the direction o f the gradient o f the edge at that point w ere determ ined. The strength o f the edge and the direction o f the gradient at the central pixel o f the kernel is determ ined by:

strength = V R e s u lt o f c o n v o lv in g k e rn e l a^ + R e s u lt o f c o n v o lv in g k e rn e l b^

,. . , /R e s u lt o f c o n v o lv in g k e rn e l a

irec ion - tan c o n v o lv in g k e rn e l b

In this case only the edge strength w as used. T he e x a c t co m p o sitio n o f each convolution kernel may vary greatly, although the Sobel and Laplacian are particularly w idely used (M ath er, 1986). T his excess o f o p e ra to rs in d icates that the p e rfe c t o p erator for all situations has not been found yet and th erefore no single op erato r is

Chapter 7. Map to image matching

likely to perfectly segment the image. To compensate this, post edge detection processing is performed on the results obtained to correct some of the problems . In this case the first operation to be applied to the edges is a non-maximal suppression (using the non maximal program developed by Newton) which removes the edgels that are not local maxima, thus sharpening its representation (Canny, 1986). To further sharpen the edges a thinning algorithm (thin programmed by Landy) that preserves connectivity was used. To clean the image from less significant polygons

filter polygons program was applied (written by Morgado), it reads the pixels that belong to each polygon, and applies a threshold based on their length so that only the polygons with the highest perimeter are preserved.