## 2 Materials and Methods
### Flood Return-Period Maps
#### 2.3.2 Near Real-Time Operations  
SAR  
Near real-time SAR processing can begin as soon as the processed georegistered SAR image becomes available. Each SAR image is subjected to the following steps. _(a) Calculation of SAR Backscatter Threshold_  
The SAR backscatter threshold that best separates the backscatter values of the water and high land pixels in the training classes is calculated using the Bayes minimum misclassification rule. Equal prior probabilities are assumed for each class. The threshold selected is the backscatter value \(T_{u}\), giving the minimum misclassification of water and high-land (nonwater) pixels [40]. _(b) Flood Detection in Rural Areas_  
As stated in [PERSON] et al. (2012b) [40], \"flood detection in rural areas is object-based and adopts the approach of segmenting the SAR image into regions of homogeneity and then classifying them, rather than classifying each pixel independently using a per-pixel classifier. The use of segmentation techniques provides a number of advantages compared to using per-pixel classification.\" The approach employed for rural flood detection in [20; 21] is adopted, which involves segmentation and classification using the eCognition Developer software (Trimblr Geospatial, Munich; Germany) [58]. Regions of homogeneous SAR backscatter are detected using the multi-resolution segmentation algorithm, and all resulting rural regions with mean backscatter less than the threshold are classed as 'flood'. Details are given in [42]. eCognition Developer is also used to refine the initial rural flood segmentation by using different rules. For example, the backscatter threshold may be raised to include in the flood category regions of rural flooding adjacent to a flooded region that have slightly higher mean backscatter than the threshold \(T_{u}\) (e.g., due to wind ruffling the water surface in more exposed parts of the floodplain). Again, details are given in [42], Figure 11 of which gives a refined rural flood classification for the Wraysbury area for 12 February 2014. _(c) Calculation of Local Waterline Height Threshold Map_  
A local waterline height threshold map is calculated using the rural flood map. The method is based on the assumption that water in the urban areas should not be at a substantially higher level than in the surrounding rural areas. Waterline heights are calculated at positions of low slope in the DSM. The method also requires knowledge of the positions of permanent water bodies. In this case, high-resolution LiDAR data must be available, and, as any region imaged by LiDAR will generally also have land cover data available, permanent water bodies are extracted from a land cover map. However, they could also be extracted from a prefload SAR image. As in the determination of effective heights (Section 2.3.1), the domain is subdivided into nonoverlapping rectangular \(m\times n\)-pixel subdomains, to take into account the fall-off of water level down the reach and the fact that different parts of a domain may be flooded to different depths. In each subdomain, as stated in [PERSON] et al. (2018) [42], \"waterlines are detected by applying the Sobel edge detector to the binary flood extent map. Because the flood map has errors at this stage, edges will be present at the true waterlines, but also in the interior of the water objects due to regions of emergent vegetation and shadow/layover (giving water heights that are too low), as well as above the waterline due to higher water false alarms. To increase the signal-to-noise ratio of true edges, a dilation and erosion operation is performed on the water objects to eliminate some of the artefacts [42]. Water objects are first dilated by 12 m, then eroded by the same amount. It is required that an edge pixel is present at the same location within a 2-m-wide buffer before and after dilation and erosion. The buffer is required because an edge that has been dilated and eroded may be smoother than the original edge, and may be slightly displaced from it as a result.