**4.3 Removal of shadow pixels**

Water and shadow reflectance spectra are on average both very dark. The reflectance level of both decreases with wavelength due to a decreasing proportion of diffuse irradiation (case of shadow) and due to the increasing light absorption (case of water). Additionally, both show a high spectral variability due to different types of shadowed surfaces (case of shadow) and due to varying water constituents and bottom reflection (case of water). However, despite this variation all water reflectance spectra have one thing in common: the pure water itself. Therefore, spectral features of pure water, especially absorption features, can be seen in every reflectance spectrum of water. However, the presence of these spectral features depends on the spectral superimposition of the water constituents and bottom coverage. Section 4.3.1 describes how these aspects can be considered in the development of a knowledge-based classifier for spectrally distinguishing water and shadow. Section 4.3.2 then continues with a spatial analysis.

#### **4.3.1 Spectral analysis for water-shadow-separation based on spectral slopes**

Fig. 8 shows the absorption spectrum of pure water (logarithmic scale) in comparison with selected surface reflectance spectra of different water bodies of the analyzed datasets. It can be seen that the increasing absorption within specific wavelength intervals (1st, 2nd, 4th and 5th light red bar) results in decreasing reflectance for most of the reflectance spectra. The 3rd light red bar represents a short wavelength interval of stagnating absorption where some water reflectance spectra temporarily rise due to increasing reflectance of water constituents or water bottom before decreasing again. However, these effects are not present within all wavelength intervals of all water reflectance spectra because they can be superimposed by the reflectance of the water constituents and water bottom. In order to find the slope combinations that occur for typical water bodies we analyzed 112.041 surface reflectance spectra from five datasets (two from Helgoland, two from Berlin, one from Potsdam). The selected datasets contain several types of water bodies (rivers, lakes, ponds, North Sea; transparent to productive and turbid waters). A first-degree polynomial was fitted to the spectra within each of the five wavelength intervals using the least squares method. If the algebraic sign of the slope within a wavelength interval met the expectation it was coded to 1 otherwise to 0. This resulted in a five-digit binary vector for each analyzed water reflectance spectrum representing the co-occurrence of slopes within the respective diagnostic wavelength intervals that met the expectation. The 25 possible binary vectors

On the Use of Airborne Imaging Spectroscopy Data for the

0

5

10

15

20

25

Relative frequency

30

35

Automatic Detection and Delineation of Surface Water Bodies 13

Relative frequency of the slope combinations for water and shadow areas

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31

Fig. 9. Numbered slope combinations for water and shadow reflectance spectra. Due to the different amount of analyzed pixels of water and shadow (112.041 and 33.721) the *relative* frequency per land cover class is given. Combinations that are occupied by only one bar (or one very big and one very small bar) provide a clear separation between water and shadow.

Pixels of the low albedo mask that have not been identified as water or shadow based on the unambiguous spectral slope combinations are subjected to a consecutive spatial analysis. In this processing the idea is to decide according to the dominating spectral decision (see previous section) made within the neighbourhood of the ambiguous pixels (Fig. 10). The spectral decisions in the neighbourhood are counted using a 3x3 filter kernel resulting in a water score and a no-water score for each ambiguous pixel. If one of the two scores is more than three times higher than the other the ambiguous pixel is either identified as water or as no-water and is written into the respective image of confirmed water or no-water areas. If this is not the case the filter kernel iteratively grows up to a size of 33x33. Thereby, the identified water and no-water pixels are written into the respective image of identified water or no-water areas after each iteration so that they can be counted by the filter of the following iterations. When the filter kernel has reached a size of 33x33 and there are still ambiguous pixels left the decision threshold is reduced to two times higher than the other score and the filter kernel is reset to a size of 3x3. When the filter kernel reached a size of 33x33 for the second time it is again reset to a size of 3x3 and the decision is then simply related to the higher score. At this stage the filter starts growing again without a limit and until a decision was made for every ambiguous pixel. The graduation of the decision threshold has the advantage that pixels with an unambiguous neighbourhood are confirmed first and then accounted for in the following iterations. Finally, after all pixels have been identified either by spectral or spatial processing, the spectrally or spatially identified water pixels are combined into the final water mask. A last

The combinations marked by the orange arrows are spectrally ambiguous

**4.3.2 Spatial analysis for water-shadow-separation** 

Combination number

Water Shadow

were numbered from 0 to 31 whereas the 0 vector (none of the 5 slopes met the expectation) was excluded from further analysis. The numbered combinations are shown in Fig. 9 in comparison with the numbered combinations of 33.721 analyzed shadow spectra. It can be seen that many combinations are occupied either by water or by shadow spectra and thus provide a clear separation between water and shadow. These combinations are implemented in the developed approach so that applied to an image many pixels of the low albedo mask can either be identified as water or rejected as shadow. The other combinations marked by the orange arrows are ambiguous. Pixels that fall into these combinations need a consecutive spatial processing described in Section 4.3.2.

Fig. 8. Absorption of pure water (thick blue line, logarithmic scale, source: WASI (Gege, 2005)) in comparison to water surface reflectance spectra from different water bodies of the analyzed datasets. The increasing absorption within specific wavelength intervals (light red bars) results in decreasing reflectance for most of the reflectance spectra but is partly superimposed by the reflectance of the water constituents and water bottom

were numbered from 0 to 31 whereas the 0 vector (none of the 5 slopes met the expectation) was excluded from further analysis. The numbered combinations are shown in Fig. 9 in comparison with the numbered combinations of 33.721 analyzed shadow spectra. It can be seen that many combinations are occupied either by water or by shadow spectra and thus provide a clear separation between water and shadow. These combinations are implemented in the developed approach so that applied to an image many pixels of the low albedo mask can either be identified as water or rejected as shadow. The other combinations marked by the orange arrows are ambiguous. Pixels that fall into these combinations need a

Water absorption vs water reflectance

450 500 550 600 650 700 750 800 850 900

Fig. 8. Absorption of pure water (thick blue line, logarithmic scale, source: WASI (Gege, 2005)) in comparison to water surface reflectance spectra from different water bodies of the analyzed datasets. The increasing absorption within specific wavelength intervals (light red bars) results in decreasing reflectance for most of the reflectance spectra but is partly

superimposed by the reflectance of the water constituents and water bottom

Wavelength [nm]

consecutive spatial processing described in Section 4.3.2.

Fig. 9. Numbered slope combinations for water and shadow reflectance spectra. Due to the different amount of analyzed pixels of water and shadow (112.041 and 33.721) the *relative* frequency per land cover class is given. Combinations that are occupied by only one bar (or one very big and one very small bar) provide a clear separation between water and shadow. The combinations marked by the orange arrows are spectrally ambiguous

## **4.3.2 Spatial analysis for water-shadow-separation**

Pixels of the low albedo mask that have not been identified as water or shadow based on the unambiguous spectral slope combinations are subjected to a consecutive spatial analysis. In this processing the idea is to decide according to the dominating spectral decision (see previous section) made within the neighbourhood of the ambiguous pixels (Fig. 10). The spectral decisions in the neighbourhood are counted using a 3x3 filter kernel resulting in a water score and a no-water score for each ambiguous pixel. If one of the two scores is more than three times higher than the other the ambiguous pixel is either identified as water or as no-water and is written into the respective image of confirmed water or no-water areas. If this is not the case the filter kernel iteratively grows up to a size of 33x33. Thereby, the identified water and no-water pixels are written into the respective image of identified water or no-water areas after each iteration so that they can be counted by the filter of the following iterations. When the filter kernel has reached a size of 33x33 and there are still ambiguous pixels left the decision threshold is reduced to two times higher than the other score and the filter kernel is reset to a size of 3x3. When the filter kernel reached a size of 33x33 for the second time it is again reset to a size of 3x3 and the decision is then simply related to the higher score. At this stage the filter starts growing again without a limit and until a decision was made for every ambiguous pixel. The graduation of the decision threshold has the advantage that pixels with an unambiguous neighbourhood are confirmed first and then accounted for in the following iterations. Finally, after all pixels have been identified either by spectral or spatial processing, the spectrally or spatially identified water pixels are combined into the final water mask. A last

On the Use of Airborne Imaging Spectroscopy Data for the

Automatic Detection and Delineation of Surface Water Bodies 15

Fig. 11. (continued)

Fig. 10. Spatial processing illustrated by an exemplary subset of the Potsdam test site

aesthetic correction is done by filling up one pixel wholes within water areas which are considered as errors induced by noise. The filling of wholes can optionally be extended onto larger wholes (up to a certain size) which are likely to be boats (see Fig. 11).

No spectral decision

Neighborhood analysis

100

10

1 0

Spectrally rejected no-water

No-water score

Spatially rejected no-water

Spectrally identified water

Water score

Spatially identified water

identified water

Water mask + spectrally

Fig. 10. Spatial processing illustrated by an exemplary subset of the Potsdam test site

larger wholes (up to a certain size) which are likely to be boats (see Fig. 11).

aesthetic correction is done by filling up one pixel wholes within water areas which are considered as errors induced by noise. The filling of wholes can optionally be extended onto

Fig. 11. (continued)

On the Use of Airborne Imaging Spectroscopy Data for the

Automatic Detection and Delineation of Surface Water Bodies 17

Fig. 11. Automatically detected water areas for the ten test sites Berlin\_09:38, Berlin\_10:12, Potsdam, Helgo\_08:32, Helgo\_09:26, Rheinsberg, Dresden\_sub1, Dresden\_sub2, Mönchsgut,

Döberitzer (top to bottom; same order as in Tab. 3)

Fig. 11. (continued)

Fig. 11. (continued)

Fig. 11. Automatically detected water areas for the ten test sites Berlin\_09:38, Berlin\_10:12, Potsdam, Helgo\_08:32, Helgo\_09:26, Rheinsberg, Dresden\_sub1, Dresden\_sub2, Mönchsgut, Döberitzer (top to bottom; same order as in Tab. 3)

On the Use of Airborne Imaging Spectroscopy Data for the

positives for urban surface materials (see Fig. 3).

enabled the spectral identification of water as shown in section 4.3.1.

Fig. 12. A typical surface reflectance spectrum of water (blue) compared to a reflectance

The false alarm ratio (FAR) gives the fraction of false alarm pixels in relation to the number of detected water pixels in the image, i.e. the number of false alarm pixels divided by the total number of classified water pixels ( = commission error of water class). This error measure reveals clearly if to much water pixels have been falsely identified. This is the case for the test sites Berlin\_10:12, Helgo\_08:32, and Dresden\_sub2 as well as in a weakened form for Berlin\_09:38. In all of these test sites the confusion is related to shadow areas classified as water. For the test site Helgo\_08:32 this can be explained by the intertidal zone which is wet even when the water is gone. Therefore, it is possible that there are some small water

spectrum of a small water body with surrounding trees (green)

Automatic Detection and Delineation of Surface Water Bodies 19

background class, i.e. the number of false alarm pixels divided by the total number of ground truth pixels of the background class (= omission error of the no-water class). The achieved POFDs for the test sites are very low (usually below 1 %) showing that water can be well distinguished from no-water surfaces. This is a big step forward compared to the NDWI and MNDWI which applied to high spatial resolution data result in many false

The POD of a class, also known as hit rate, measures the fraction of the detected pixels of the class of interest that were correctly identified, i.e. the number of correctly identified pixels divided by the total number of ground truth pixels of the class (= producer accuracy of the water class). The achieved PODs for most of the test sites are very high (> 98 %) showing that the developed algorithm usually detects almost all water pixels. False negatives occur only for small water bodies (small ponds within the park at the top left in Berlin\_09:38, parts of the river in Berlin\_10:12, and narrow rivers in Rheinsberg). Possible explanations are the adjacency effect (light from neighbouring pixels that is scattered into the instantaneous field of view by the atmosphere) and diffuse illumination of the water surface by surrounding trees. These two effects might be the reason for the spectral shape of the water spectra of small water bodies with surrounding trees that looks much more like a reflectance spectrum of vegetation than one of water (Fig. 12) and do not show the typical decreasing slopes that
