Stratified Template Matching to Support Refugee Camp Analysis in OBIA Workflows

Accurate and reliable information about the situation in refugee or internally displaced person camps is very important for planning any kind of help like health care, infrastructure, or vaccination campaigns. The number and spatial distribution of single dwellings extracted semi-automatically from very high-resolution (VHR) satellite imagery as an indicator for population estimations can provide such important information. The accuracy of the extracted dwellings can vary quite a lot depending on various factors. To enhance established single dwelling extraction approaches, we have tested the integration of stratified template matching methods in object-based image analysis (OBIA) workflows. A template library for various dwelling types (template samples are taken from ten different sites using 16 satellite images), incorporating the shadow effect of dwellings, was established. Altogether, 18 template classes were created covering typically occurring dwellings and their cast shadows. The created template library aims to be generally applicable in similar conditions. Compared to pre-existing OBIA classifications, the approach could increase the producer’s accuracy by 11.7 percentage points on average and slightly increase the user’s accuracy. These results show that the stratified integration of template matching approaches in OBIA workflows is a possibility to further improve the results of semi-automated dwelling extraction, especially in complex situations.


Introduction
The number of refugees and internally displaced persons (IDPs) hit an all time high in 2015.By the end of 2015, more than 65 million people were forcibly displaced [1] caused by natural disasters, changing environmental conditions, and violent conflicts, which overall constitute the main reasons for displacement.Camps and temporary settlements provide refuge for many of the displaced people [2,3].Accurate, reliable, and up-to-date information about the population in refugee or IDP camps is key to health care, infrastructure planning, or vaccination campaigns.Camp management, often carried out by first-responding humanitarian relief organizations, cannot obtain this information by field assessments alone, due to security reasons and other immediate duties.Furthermore, incorrect information is sometimes provided by stakeholders, who may overestimate the number of refugees for various reasons, or other political interests may lead to reduced numbers of reported IDPs.IDPs have not crossed a recognized international border and therefore remain under legal protection from their home governments, which limits assistance, such as regulated camp access and management, to a large degree.To cope with these challenges, very high-resolution (VHR) satellite imagery is a critical source for deriving the number and spatial distribution of single camp dwellings [4][5][6][7][8][9][10][11][12].Most of the approaches for automated dwelling extraction from VHR data documented in the literature (cf. a comprehensive review by [13]) rely on OBIA [14,15].Nevertheless, the accuracy of the extracted dwellings can vary quite a lot depending on various factors, such as the contrast of dwelling types to surroundings, the seasonal or actual weather situation, but also the dwelling density [16,17].
A specific limitation of existing object-based workflows is related to the initial segmentation of the image.This process creates segments for image areas based on the similarity of neighboring pixel values, which can lead to under-segmentation when dwellings and their surroundings have very similar spectral reflectance, for example under dusty conditions.In such situations, dwellings and their associated cast shadows can help distinguish them from non-elevated ground.Still, proper segmentation that separates dwellings and the shadow area is required.The upper left image in Figure 1 shows an example where the shadow of a dwelling is not as clearly captured by a segment as compared to the upper right image.Here, the use of shadow as an identifier for a dwelling is limited, in particular when using automated routines.At the bottom of Figure 1, dark dwellings are shown with very low contrast to their surroundings, where the cast shadow is, in fact, the only indicator for the presence of dwellings at all.In this case, segmentation based on internal homogeneity criteria would fail in extracting relevant candidate objects for the classification process later on.
Remote Sens. 2017, 9, 326 2 of 16 (cf.a comprehensive review by [13]) rely on OBIA [14,15].Nevertheless, the accuracy of the extracted dwellings can vary quite a lot depending on various factors, such as the contrast of dwelling types to surroundings, the seasonal or actual weather situation, but also the dwelling density [16,17].
A specific limitation of existing object-based workflows is related to the initial segmentation of the image.This process creates segments for image areas based on the similarity of neighboring pixel values, which can lead to under-segmentation when dwellings and their surroundings have very similar spectral reflectance, for example under dusty conditions.In such situations, dwellings and their associated cast shadows can help distinguish them from non-elevated ground.Still, proper segmentation that separates dwellings and the shadow area is required.The upper left image in Figure 1 shows an example where the shadow of a dwelling is not as clearly captured by a segment as compared to the upper right image.Here, the use of shadow as an identifier for a dwelling is limited, in particular when using automated routines.At the bottom of Figure 1, dark dwellings are shown with very low contrast to their surroundings, where the cast shadow is, in fact, the only indicator for the presence of dwellings at all.In this case, segmentation based on internal homogeneity criteria would fail in extracting relevant candidate objects for the classification process later on.To enhance single object detection in such difficult situations, we have tested the integration of template matching in object-based image analysis workflows.In the template generation process, the object to be detected and the surroundings can be taken into account, which is in our case different dwelling types and their cast shadows.Thus, matches include information regarding the orientation, and can be used in the analyses to reduce false positives and partly overcome the difficulties in the segmentation process by including the correlation layer in the segmentation steps.
The concept of template matching can be summarized as the process of comparing patterns with regards to their similarity, enabling single object detection.In signal processing, analyzing the correlation of signals is a standard approach.The mathematical methods and algorithms are also used in image processing for the detection of image features [18,19].A typically applied method in image analysis is 2D-correlation, based on the correlation calculation using a moving window approach as one of the simplest template matching techniques.Templates are represented as vectors.The correlation between the template and the image is calculated by sliding the template over the image.There are different similarity measurements such as the normalized cross-correlation, the sum of absolute differences, the sum of squared differences, and the Euclidean distance.A maximum or a minimum in the correlation matrix represents a match depending on the calculation of the similarity.There can be multiple matches with the same value [18,20].To enhance single object detection in such difficult situations, we have tested the integration of template matching in object-based image analysis workflows.In the template generation process, the object to be detected and the surroundings can be taken into account, which is in our case different dwelling types and their cast shadows.Thus, matches include information regarding the orientation, and can be used in the analyses to reduce false positives and partly overcome the difficulties in the segmentation process by including the correlation layer in the segmentation steps.
The concept of template matching can be summarized as the process of comparing patterns with regards to their similarity, enabling single object detection.In signal processing, analyzing the correlation of signals is a standard approach.The mathematical methods and algorithms are also used in image processing for the detection of image features [18,19].A typically applied method in image analysis is 2D-correlation, based on the correlation calculation using a moving window approach as one of the simplest template matching techniques.Templates are represented as vectors.The correlation between the template and the image is calculated by sliding the template over the image.There are different similarity measurements such as the normalized cross-correlation, the sum of absolute differences, the sum of squared differences, and the Euclidean distance.A maximum or a minimum in the correlation matrix represents a match depending on the calculation of the similarity.There can be multiple matches with the same value [18,20].
In the specific field of remote sensing, template matching is widely used to address a variety of problems such as the extraction of road centerlines from high-resolution images [21], and the monitoring of mass movements and their surface velocity for monitoring glaciers, ice shelves, ice caps, and also landslides [22][23][24].Further examples of object recognition using satellite and aerial images are aircraft and crater detection [25,26], tree crown detection, oil palm and species detection, and counting in forestry [27][28][29][30][31] and dwelling extraction [32].
The literature review as well as a recently published review article by [20] reveal that template matching techniques and OBIA methods for object detection are typically handled separately.There is little research on combining both methods in one workflow.A study by [33], that combined template matching with OBIA methods analyzing the effect of tree growth in camps impairing dwelling detection in a refugee camp, suggested that the overall classification could be improved by applying template matching within an object-based framework.
The combination of the two approaches aims to tackle typical problems of template matching, such as the high number of false positives in complex images, by masking relevant parts of the image, for example focusing on the camp area only or certain spectrally relevant objects, which we term stratified template matching.We expect that the incorporation of the shadow effect of dwellings can improve the dwelling detection rate in an OBIA workflow, improving segmentation and the dwelling detection rate.
In this research, we aim to establish a template library, which is generally applicable under similar conditions and can be easily integrated into existing workflows for object-based dwelling extraction.A pre-condition is the presence of shadows cast by the dwelling.A visual investigation of different refugee camps in Eastern Africa revealed that the same shelter types commonly occur (bright, blue, and dark/brown dwellings) as well as large and small structures with typical geometrical properties (Figure 2).The template library was developed based on sixteen single VHR scenes.In order to check the accuracy of the approach, it was tested on three sites of different image complexities.The results were compared to a visual image interpretation as well as to pre-existing (independent) OBIA classifications.
Remote Sens. 2017, 9, 326 3 of 16 In the specific field of remote sensing, template matching is widely used to address a variety of problems such as the extraction of road centerlines from high-resolution images [21], and the monitoring of mass movements and their surface velocity for monitoring glaciers, ice shelves, ice caps, and also landslides [22][23][24].Further examples of object recognition using satellite and aerial images are aircraft and crater detection [25,26], tree crown detection, oil palm and species detection, and counting in forestry [27][28][29][30][31] and dwelling extraction [32].
The literature review as well as a recently published review article by [20] reveal that template matching techniques and OBIA methods for object detection are typically handled separately.There is little research on combining both methods in one workflow.A study by [33], that combined template matching with OBIA methods analyzing the effect of tree growth in camps impairing dwelling detection in a refugee camp, suggested that the overall classification could be improved by applying template matching within an object-based framework.
The combination of the two approaches aims to tackle typical problems of template matching, such as the high number of false positives in complex images, by masking relevant parts of the image, for example focusing on the camp area only or certain spectrally relevant objects, which we term stratified template matching.We expect that the incorporation of the shadow effect of dwellings can improve the dwelling detection rate in an OBIA workflow, improving segmentation and the dwelling detection rate.
In this research, we aim to establish a template library, which is generally applicable under similar conditions and can be easily integrated into existing workflows for object-based dwelling extraction.A pre-condition is the presence of shadows cast by the dwelling.A visual investigation of different refugee camps in Eastern Africa revealed that the same shelter types commonly occur (bright, blue, and dark/brown dwellings) as well as large and small structures with typical geometrical properties (Figure 2).The template library was developed based on sixteen single VHR scenes.In order to check the accuracy of the approach, it was tested on three sites of different image complexities.The results were compared to a visual image interpretation as well as to pre-existing (independent) OBIA classifications.

Study Area and Data
For the creation of the dwelling template library, subsets of sixteen VHR optical image scenes were used.The spatial resolution ranges between 0.5 m and 0.6 m ground sample distance (GSD) for pan-sharpened VHR data.For testing purposes, the subsets cover parts of different camps and two small towns, all located in Eastern Africa.The distribution of the sites is shown in Figure 3. Existing semi-automated dwelling classifications were provided by the Department of Geoinformatics-Z_GIS, University of Salzburg, within an operational service for Médecins Sans Frontières (MSF) for three sites (El Redis, Sudan 3 December 2015, Yida, South Sudan 10 December 2012, Yida 4 March 2013; Table 1) in order to compare the outcome of the dwelling template library with existing and verified results.

Study Area and Data
For the creation of the dwelling template library, subsets of sixteen VHR optical image scenes were used.The spatial resolution ranges between 0.5 m and 0.6 m ground sample distance (GSD) for pan-sharpened VHR data.For testing purposes, the subsets cover parts of different camps and two small towns, all located in Eastern Africa.The distribution of the sites is shown in Figure 3. Existing semi-automated dwelling classifications were provided by the Department of Geoinformatics-Z_GIS,

Template Matching Library
One of the objectives of this work was to create a template library for camp dwellings that can be integrated into existing workflows for dwelling extraction, applicable to different kinds of dwellings .The library is best suited for satellite images with a non-zenith sun position, where the depicted objects cast a shadow depending on their height.The samples for the templates are taken from different camps (Figure 3) to capture the variety of dwelling types at different locations, time slots, and weather conditions such as rainy and dry season or the effects after a sandstorm and different sun azimuth angles.The library is most suitable for resolution levels between 0.5 and 0.6 m GSD, but it also can be scaled to other image resolutions.The applied workflow for creating a template and integration into the library is presented in Figure 4.
The template library is structured according to the properties of the templates (color intensity, dwelling shape, size, and shadow direction) that support several combinations of a dwelling type and the cast shadow.Moreover, new dwelling templates can be added to the library to customize it

Template Matching Library
One of the objectives of this work was to create a template library for camp dwellings that can be integrated into existing workflows for dwelling extraction, applicable to different kinds of dwellings.The library is best suited for satellite images with a non-zenith sun position, where the depicted objects cast a shadow depending on their height.The samples for the templates are taken from different camps (Figure 3) to capture the variety of dwelling types at different locations, time slots, and weather conditions such as rainy and dry season or the effects after a sandstorm and different sun azimuth angles.The library is most suitable for resolution levels between 0.5 and 0.6 m GSD, but it also can be scaled to other image resolutions.The applied workflow for creating a template and integration into the library is presented in Figure 4.
The template library is structured according to the properties of the templates (color intensity, dwelling shape, size, and shadow direction) that support several combinations of a dwelling type and the cast shadow.Moreover, new dwelling templates can be added to the library to customize it to the dwelling arrangement.The naming convention follows this logic, allowing the right dwelling templates to be found without screening all available template images.The following subchapters describe the structure of the template library in detail.
Remote Sens. 2017, 9, 326 5 of 16 templates to be found without screening all available template images.The following subchapters describe the structure of the template library in detail.

Dwelling Shape
Small objects in the satellite image, such as camp dwellings, may appear as if the image was taken from the nadir position, while VHR imagery is usually not.The lean effect is only visible on taller buildings [34].Therefore, only the dwelling roofs are visible, and dwelling shapes are reduced to two-dimensional geometric shapes.Camp dwellings typically have rather simple shapes.The generic types are quadratic or rectangular cuboids and cones.The template library comprises the following three dwelling types: square, rectangular, and circular.

Template Size
The template size is defined by the height and width of a rectangle.Templates should cover the dwelling, the cast shadow, and a reasonable share of the surrounding area.

Dwelling Brightness
Here, the templates were calculated on one image band only, i.e., using grey scale intensities.The template library is divided into two intensity levels: strong intensity-bright dwellings, and weak intensity-dark dwellings.Empirical testing was performed to compare the correlation of the samples of a given template with the pan-sharpened multi-spectral bands (blue, green, red, and NIR).The contrast of the bright dwellings compared to the surrounding areas proved best using the blue band.For dark dwellings, the best results were achieved using the near-infrared (NIR) band.

Shadow Direction
The third property is the shadow cast by a dwelling.It determines the rotation angle of the samples, which is dependent on the shape of the object.Objects in optical VHR satellite images taken in daylight with the sun as the only relevant source of light cast simple shadows.From the simplified shapes, cones either cast a shadow or no shadow, while rectangular cuboids have three options: no shadow, a shadow on one of four sides and shadows on two sides.
Corresponding to the shadow, objects with a circular layout only require one template, square dwellings require two templates, and dwellings with a rectangular layout require three templates because the shadow can be on one side only, on the short and the long side, or on the long and the short side, which cannot be solved by rotation.
The library is divided into the following main template classes (Figure 5): (a) dwellings with strong intensity (structures appear bright) and dwellings with low intensity (structures appear dark

Dwelling Shape
Small objects in the satellite image, such as camp dwellings, may appear as if the image was taken from the nadir position, while VHR imagery is usually not.The lean effect is only visible on taller buildings [34].Therefore, only the dwelling roofs are visible, and dwelling shapes are reduced to two-dimensional geometric shapes.Camp dwellings typically have rather simple shapes.The generic types are quadratic or rectangular cuboids and cones.The template library comprises the following three dwelling types: square, rectangular, and circular.

Template Size
The template size is defined by the height and width of a rectangle.Templates should cover the dwelling, the cast shadow, and a reasonable share of the surrounding area.

Dwelling Brightness
Here, the templates were calculated on one image band only, i.e., using grey scale intensities.The template library is divided into two intensity levels: strong intensity-bright dwellings, and weak intensity-dark dwellings.Empirical testing was performed to compare the correlation of the samples of a given template with the pan-sharpened multi-spectral bands (blue, green, red, and NIR).The contrast of the bright dwellings compared to the surrounding areas proved best using the blue band.For dark dwellings, the best results were achieved using the near-infrared (NIR) band.

Shadow Direction
The third property is the shadow cast by a dwelling.It determines the rotation angle of the samples, which is dependent on the shape of the object.Objects in optical VHR satellite images taken in daylight with the sun as the only relevant source of light cast simple shadows.From the simplified shapes, cones either cast a shadow or no shadow, while rectangular cuboids have three options: no shadow, a shadow on one of four sides and shadows on two sides.
Corresponding to the shadow, objects with a circular layout only require one template, square dwellings require two templates, and dwellings with a rectangular layout require three templates because the shadow can be on one side only, on the short and the long side, or on the long and the short side, which cannot be solved by rotation.
The library is divided into the following main template classes (Figure 5): (a) dwellings with strong intensity (structures appear bright) and dwellings with low intensity (structures appear dark or grey); (b) dwellings of different shapes that can be a square, rectangular, or circular; (c) the direction of the shadow cast by the dwellings, which can be on one side or on two sides.

Application of the Template Matching Library
The application of the templates from the library is an interactive but straightforward process applied within the eCognition (Trimble Geospatial) OBIA software environment.The implemented template matching algorithm in eCognition is normalized cross-correlation [35].The choice of the right templates depends on the occurrence of dwelling types.Rotation steps of the templates can be adjusted.If, for example, four rotation steps are applied, the rotation angles of the template are 0°, 90°, 180°, and 270°.A suitable rotation angle is always the prevailing shadow orientation of dwellings in the image.A second parameter is the correlation threshold.If the correlation between the template and the image at a given location is higher than the predefined threshold, a point (local maxima within a given neighborhood) will be created in addition to the correlation layer to represent a dwelling match.The resulting point layer contains numerous false positives that can be reduced by adjusting the correlation thresholds and filtering adequate rotation angles of the templates

Application of the Template Matching Library
The application of the templates from the library is an interactive but straightforward process applied within the eCognition (Trimble Geospatial) OBIA software environment.The implemented template matching algorithm in eCognition is normalized cross-correlation [35].The choice of the right templates depends on the occurrence of dwelling types.Rotation steps of the templates can be adjusted.If, for example, four rotation steps are applied, the rotation angles of the template are 0 • , 90 • , 180 • , and 270 • .A suitable rotation angle is always the prevailing shadow orientation of dwellings in the image.A second parameter is the correlation threshold.If the correlation between the template and the image at a given location is higher than the predefined threshold, a point (local maxima within a given neighborhood) will be created in addition to the correlation layer to represent a dwelling match.The resulting point layer contains numerous false positives that can be reduced by adjusting the correlation thresholds and filtering adequate rotation angles of the templates corresponding to the current shadow direction.The computation time is dependent on the size of the image and on the number of rotation steps selected (Table 1).

Integration of Template Matching in an Object-Based Image Analysis Workflow
In order to overcome some of the inherent limitations of template matching (dual or multiple matches, ambiguous targets) that inevitably lead to a large number of false positives, we use a stratification strategy.In other words, we integrate the developed template library in an OBIA workflow (Figure 6) using the following steps: (1) The area of interest, in this case the camp extent, is derived using an initial rough OBIA classification of the dwellings and a dwelling density calculation [7] to stratify the template matching to the camp area only and to save computation time; (2) The template library is applied, and the templates and rotation of templates are selected according to visual inspection of the dwelling types and shadow directions; (3) Segmentation of the satellite image is improved by including the correlation layer of the template matching in the segmentation process; (4) Exclusion (masking) of areas that are not relevant for the analysis such as vegetation and bare soil (based on spectral properties) and elongated structures such as fences or walls (based on geometrical properties), see [4,7,17] for a detailed description of the algorithms.This helps to minimize false positives created in the template matching process; (5) Classification of the image objects based on two steps: (i) classification of dwellings using the template point layer and (ii) additional classification of the dwellings by applying OBIA methods (objects that do not match the template, but show other general characteristics of dwellings regarding spectral, form, and spatial features).

Integration of Template Matching in an Object-Based Image Analysis Workflow
In order to overcome some of the inherent limitations of template matching (dual or multiple matches, ambiguous targets) that inevitably lead to a large number of false positives, we use a stratification strategy.In other words, we integrate the developed template library in an OBIA workflow (Figure 6) using the following steps: (1) The area of interest, in this case the camp extent, is derived using an initial rough OBIA classification of the dwellings and a dwelling density calculation [7] to stratify the template matching to the camp area only and to save computation time; (2) The template library is applied, and the templates and rotation of templates are selected according to visual inspection of the dwelling types and shadow directions; (3) Segmentation of the satellite image is improved by including the correlation layer of the template matching in the segmentation process; (4) Exclusion (masking) of areas that are not relevant for the analysis such as vegetation and bare soil (based on spectral properties) and elongated structures such as fences or walls (based on geometrical properties), see [4,7,17] for a detailed description of the algorithms.This helps to minimize false positives created in the template matching process; (5) Classification of the image objects based on two steps: (i) classification of dwellings using the template point layer and (ii) additional classification of the dwellings by applying OBIA methods (objects that do not match the template, but show other general characteristics of dwellings regarding spectral, form, and spatial features).

Results for the Three Test Images
The template library was applied to three images showing different levels of complexity in terms of dwelling extraction.The camps under investigation were El Redis in Sudan and Yida in South Sudan (Table 2).The latter was captured in two slots.The provided images cover parts of the Yida camp and the complete El Redis site.In the following, the results of three different methods are presented: (1) template library based on greyscale image template matching (TM); (2) template library for dwelling extraction within an object-based framework (TMOB); (3) pre-existing OBIA only classifications (OB).
Applying more than one template sometimes creates several hits on one dwelling.To obtain a comparable result for the TM method, multiple hits were not counted.

Results for the Three Test Images
The template library was applied to three images showing different levels of complexity in terms of dwelling extraction.The camps under investigation were El Redis in Sudan and Yida in South Sudan (Table 2).The latter was captured in two slots.The provided images cover parts of the Yida camp and the complete El Redis site.In the following, the results of three different methods are presented: Applying more than one template sometimes creates several hits on one dwelling.To obtain a comparable result for the TM multiple hits were not counted.The complexity of the dwelling extraction for the El Redis camp image, acquired 12 March 2015, can be considered as low (see subset of the camp image in Figure 3).The camp mostly consists of bright dwellings, which can be clearly distinguished from surrounding areas.Still, some darker dwellings are harder to distinguish.The structure of the camp is quite clear.There is almost no vegetation such as trees and bushes that could be mistaken as dwellings within the camp area.Fences, which can look like a shadow cast by a dwelling, rarely occur.
Without a differentiation between dwelling types, the application of the TM approach resulted in the highest number of detected dwellings (2159, for details, see Figure 7), which was expected since TM methods are prone to high numbers of false positives [20].When integrated into object-based framework (TMOB approach) the number of classified dwellings reduced to 1542.In comparison to these results, the existing OBIA classification (OB approach) detects 1426 dwellings.When differentiating between dwelling types, the OB and TMOB approaches show similar distributions (Figure 7).Overall, the new TMOB approach detects 116 dwellings more than the pre-existing results in the same area.
Remote Sens. 2017, 9, 326 8 of 16 The complexity of the dwelling extraction for the El Redis camp image, acquired 12 Mar 2015, can be considered as low (see subset of the camp image in Figure 3).The camp mostly consists of bright dwellings, which can be clearly distinguished from surrounding areas.Still, some darker dwellings are harder to distinguish.The structure of the camp is quite clear.There is almost no vegetation such as trees and bushes that could be mistaken as dwellings within the camp area.Fences, which can look like a shadow cast by a dwelling, rarely occur.
Without a differentiation between dwelling types, the application of the TM approach resulted in the highest number of detected dwellings (2159, for details, see Figure 7), which was expected since TM methods are prone to high numbers of false positives [20].When integrated into an object-based framework (TMOB approach) the number of classified dwellings reduced to 1542.In comparison to these results, the existing OBIA classification (OB approach) detects 1426 dwellings.When differentiating between dwelling types, the OB and TMOB approaches show similar distributions (Figure 7).Overall, the new TMOB approach detects 116 dwellings more than the pre-existing results in the same area.A reason for the difference is that the pre-existing OBIA classification lacks the capability of creating discrete segments for dwellings that are built near each other.Thus, a segment can include more than one object.If the area of this segment is greater than the threshold for small structures, it is classified as a large structure instead of two or more smaller structures.The new approach can improve this shortcoming by integrating a correlation layer in the segmentation process.
The complexity of the Yida image, acquired on 12 October 2012, is classed as moderate (see Figure 8, left).It consists mostly of bright and blue dwellings, typically built with local material and covered A reason for the difference is that the pre-existing OBIA classification lacks the capability of creating discrete segments for dwellings that are built near each other.Thus, a segment can include more than one object.If the area of this segment is greater than the threshold for small structures, is classified as a large structure instead of two or more smaller structures.The new approach can improve this shortcoming by integrating a correlation layer in the segmentation process.
The complexity of the Yida image, acquired on 12 October 2012, is classed as moderate (see Figure 8, left).It consists mostly of bright and blue dwellings, typically built with local material and covered by white or blue plastic sheets the rainy season [36].Bright structures can be clearly distinguished from surrounding areas as compared to darker structures that are more difficult to detect.The detection rate of blue dwellings depends on the intensity and similarity of the surrounding areas.The camp structure can be described as somewhat chaotic.The reason for this is that the development of the camp in its initial phase was not managed by a humanitarian relief organization [37].Most of the dwellings are located in a dispersed manner.Between these structures, trees and other vegetation such as grassland and rust-colored earthen patches can be found.All of this increases the complexity of dwelling extraction.Especially if structures are partially hidden by tree crowns ( [33]) or look similar to surrounding areas, the differentiation of dwellings is hampered.The image was taken at the end of the rainy season in October.Therefore, the vegetation appears intense, and the dwelling roofs are less dusty.Overall, that increases the contrast between the dwellings and surrounding areas.Occasionally fences that appear similar to shadows cast by a dwelling occur.Overall, the TM approach detected 5447 dwellings in this image; the TMOB extracted 4674 dwellings.
Remote Sens. 2017, 9, 326 9 of 16 similar to surrounding areas, the differentiation of dwellings is hampered.The image was taken at the end of the rainy season in October.Therefore, the vegetation appears intense, and the dwelling roofs are less dusty.Overall, that increases the contrast between the dwellings and surrounding areas.
Occasionally fences that appear similar to shadows cast by a dwelling occur.Overall, the TM approach detected 5447 dwellings in this image; the TMOB extracted 4674 dwellings.In comparison, the pre-existing OB classification again obtained the lowest detection rate with a total of 4430 dwellings (Figure 7).The differences in bright and blue dwellings result from slightly different thresholds that distinguish these structures.Overall, the TMOB approach detects 217 dwellings more than the pre-existing OBIA classification in the same area.
The third image, also covering the Yida camp, was taken six months later in early April 2013.The different pixel dimensions (Table 2) of the subsets are due to the different GSDs of different sensors (QuickBird 0.6m GSD vs. WorldView-2 0.5 m).The scene was chosen in order to compare the effects and impacts of the dry versus rainy seasons.There were only minor changes in terms of the camp structure, distribution of dwellings, and occurrence of fences.However, the image was taken at the end of the dry season.The impact of this change is that the complexity for dwelling extraction increases to high.Dwelling roofs look dusty and are similar to the surroundings, where mainly rustcolored earth and some trees can be found (Figure 8, right).Overall, there is less contrast between the image objects to be distinguished.
Here, the TM approach obtained 4789 dwellings.The pre-existing OB classification detected 4429 dwellings.In comparison, TMOB yielded a total of 5532 dwellings.Broken down by classes, the OB obtains a considerably lower rate for bright and brown dwellings compared to the TMOB approach (Figure 7).Overall, 1103 additional dwellings were extracted by TMOB compared to the OB approach.
It needs to be emphasized that this time the TM approach detected fewer dwellings than the In comparison, the pre-existing OB classification again obtained the lowest detection rate with a total of 4430 dwellings (Figure 7).The differences in bright and blue dwellings result from slightly different thresholds that distinguish these structures.Overall, the TMOB approach detects 217 dwellings more than the pre-existing OBIA classification in the same area.
The third image, also covering the Yida camp, was taken six months later in early April 2013.The different pixel dimensions (Table 2) of the subsets are due to the different GSDs of different sensors (QuickBird 0.6m GSD vs. WorldView-2 0.5 m).The scene was chosen in order to compare the effects and impacts of the dry versus rainy seasons.There were only minor changes in terms of the camp structure, distribution of dwellings, and occurrence of fences.However, the image was taken at the end of the dry season.The impact of this change is that the complexity for dwelling extraction increases to high.Dwelling roofs look dusty and are similar to the surroundings, where mainly rust-colored earth and some trees can be found (Figure 8, right).Overall, there is less contrast between the image objects to be distinguished.
Here, the TM approach obtained 4789 dwellings.The pre-existing OB classification detected 4429 dwellings.In comparison, TMOB yielded a total 5532 dwellings.Broken down by classes, the OB obtains a considerably lower rate for bright and brown dwellings compared to the TMOB approach (Figure 7).Overall, 1103 additional dwellings were extracted by TMOB compared to the OB approach.
It needs to be emphasized that this time the TM approach detected fewer dwellings than the combined TMOB approach.Most likely, the applied templates did not cover the whole variety of occurring dwellings-especially the dusty caused by the dry season resulted in a limited distinction between bright and dark structures, hampering template matching using grey level based templates only.

Accuracy Assessment
In general, the success of a method coincides with its applicability and accuracy.In order to verify the latter, the results from the three test sites were compared with a visual interpretation based on the satellite images.The visual interpretation was performed on randomly selected 200 m × 200 m sample areas.In the El Redis camp, two sample areas were created because of the small camp size.In the Yida camp, five sample areas were created (Figure 9).The sample areas in the Yida camp are the same for both years (2012 and 2013), which allows a detailed comparison of the development in these parts of the camp.The visual interpretation includes a point file for every occurring dwelling in the sample areas, including properties of the dwelling type.

Accuracy Assessment: Not Differentiated between Dwelling Types
For El Redis, the visual interpretation revealed 657 dwellings within the randomly selected sample areas.Results are shown in Figure 10.TM shows a user's accuracy (UA) of approximately 74% and a producer's accuracy (PA) of 92%.TMOB extracted the same number of correctly extracted dwellings (same PA), but the user accuracy increased to approximately 98% based on the reduction of false positives.In comparison, the pre-existing OB already has a very high UA of 96% but a lower PA of 83% compared to the other approaches (Figure 10).
For the image of the Yida camp, captured in October 2012, visual interpretation detected 587 dwellings within the sample areas.Applying the TM approach, a UA of 75% and a PA of 70% was reached.TMOB increased the correctly detected structures, resulting in a PA of 77%.False positives are strongly reduced, which is reflected in the enhanced UA of 93%.For comparison, the pre-existing OB classification extracted 397 dwellings with a high UA of 90% and a PA of 68% (Figure 10).

Accuracy Assessment: Not Differentiated between Dwelling Types
For El Redis, the visual interpretation revealed 657 dwellings within the randomly selected sample areas.Results are shown in Figure 10.TM shows a user's accuracy (UA) of approximately 74% and a producer's accuracy (PA) of 92%.TMOB extracted the same number of correctly extracted dwellings (same PA), but the user accuracy increased to approximately 98% based on the reduction of false positives.In comparison, the pre-existing OB already has a very high UA of 96% but a lower PA of 83% compared to the other approaches (Figure 10).
For the image of the Yida camp, captured in October 2012, visual interpretation detected 587 dwellings within the sample areas.Applying the TM approach, a UA of 75% and a PA of 70% was reached.TMOB increased the correctly detected structures, resulting in a PA of 77%.False positives are strongly reduced, which is reflected in the enhanced UA of 93%.For comparison, the pre-existing OB classification extracted 397 dwellings with a high UA of 90% and a PA of 68% (Figure 10).
PA of 83% compared to the other approaches (Figure 10).
For the image of the Yida camp, captured in October 2012, visual interpretation detected 587 dwellings within the sample areas.Applying the TM approach, a UA of 75% and a PA of 70% was reached.TMOB increased the correctly detected structures, resulting in a PA of 77%.False positives are strongly reduced, which is reflected in the enhanced UA of 93%.For comparison, the pre-existing OB classification extracted 397 dwellings with a high UA of 90% and a PA of 68% (Figure 10).For the same area, but based on the image acquired six months later, the visual interpretation revealed 504 dwellings.TM shows a UA of 65% and a PA of 49%.TMOB increased the extracted number of dwellings and hence also the PA to 74%.Moreover, the UA rises to 77%.The pre-existing OB classification correctly extracted 284 dwellings with a UA of 78% and a quite low PA of 56% (Figure 10).Across all test sites, the TMOB method increases the average PA by 11.7 percentage points and slightly increases the UA by 0.9 percentage points compared to pre-existing OB classifications (average over all test sites, not differentiated by dwelling type).This corresponds to the initial problem description that OB methods are good in classifying objects if the initial segmentation works well (high contrast of dwellings and surroundings), which leads to the already quite high UA reported.The increased PA of the TMOB method means that the incorporation of the shadow effect of dwellings can improve the dwelling detection rate in an OBIA workflow, thereby improving the segmentation and dwelling detection rate.

Accuracy Assessment: Differentiated between Dwelling Types
Differentiation between dwelling types was conducted for the TMOB and the pre-existing OB classifications only.The reason is that the implemented template matching method frequently results in multiple hits per dwelling.A dark dwelling template can create a match on structures appearing dark and for structures that appear brighter (but with similar contrast), and vice versa for a bright dwelling template.Consequently, no precise and accurate distinction of dwelling types could be conducted without intensive post-processing.
Differentiated between dwelling types, TMOB correctly detected 598 dwellings in the El Redis camp test site (for details see Table 3).The UA and PA decreased less than 1% compared to the result without the differentiation between dwelling types.Looking at the single classes, the PA is very high for bright dwellings (95%) and large structures (100%) but only moderate for brown dwellings (66%).The overall accuracy reduction of the OB classification compared to the result without the differentiation between the dwelling types is also less than 1%.It is important to mention the high PA rates for bright dwellings (90%) and large structures (100%) while there is a very low value for brown dwellings (34%), which are much better detected by the TMOB approach.The low accuracy values for brown dwellings do not influence the overall accuracy of both classifications because their share is approximately only 15%.For the image of the Yida camp (October 2012), TMOB correctly extracted 452 dwellings, which is less than that without a dwelling distinction (see Table 4).Hence, this reduces the UA and PA (UA: 91%, PA: 75%).The class-specific UA and PA again highly depend on dwelling types (higher values for the bright dwelling types).As a comparison, the overall UA is 88%, and the PA is 66% for the OB classification.The class-specific UA and PA develop in a similar way.Interestingly, the TMOB method detects blue dwellings much better than the OB classification only.For the second image taken of the Yida camp (April 2013), showing the most complex situation between the three test sites, the TMOB method correctly detects 344 dwellings (differentiated by type, see Table 5).The PA drops to 68% and the UA to 71%.A detailed look at the class-specific accuracy again reveals that darker structures, usually a lower contrast to the surroundings, are harder to extract.The OB classification extracted 238 dwellings in total, with a UA of 65% and a PA of 47%.The class-specific accuracy shows that the detection rate for all classes apart from large structures is low in comparison to the TMOB approach.For both Yida test sites, the accuracy using the OB method is quite weak for the large structures, which is most likely a problem of the object generation in the segmentation process.If the spectral difference of dwellings and their surroundings is weak, or if the dwellings are directly neighboring each other, the segmentation may result in one segment instead of several and the size of the delineated object is biased towards a detection of larger dwellings.The integration of the template matching correlation layer in the segmentation step shows an improvement of the results.
Figure 11 presents the accuracy differentiated by the dwelling type summarized across all test sites; total accuracy values are slightly lower than for the calculation without a differentiation of dwelling types (e.g., blue dwellings recognized as dark dwellings are counted as errors).The figure gives a good impression of how the TMOB approach is especially helpful in improving the detection of additional dark dwellings and other non-bright structures, resulting in a considerably increased PA (by 12.4 percentage points).Limitations of this template matching implementation include the missing support for multiband images, the fact that templates are not scale invariant, and that the rotation angle could not be set directly but only the number of rotations, which increases the computation time (redundant usage of templates) in the process.
The accuracy of the greyscale template matching can also be increased if a multiband template matching approach is used.First tests in the software Ciratefi (v.1.05)revealed quite promising results, but the combination with OBIA workflows is still limited due to the lack of geospatial data support and reduced radiometric depth allowed per image band.For a multiband approach, the template library also needs to be extended, which could hamper the general applicability along with increasing computation time.

Figure 1 .
Figure 1.Top: QuickBird 2 subsets of the Yida camp area (acquisition date: 12 October 2012, band combination NIR-R-G (near infrared-red-green)) showing initial image segmentation of two bright dwellings and the cast shadows.Bottom: dark dwellings with very low contrast to the surroundings, where segmentation fails in extracting meaningful objects (Yida camp, 4 March 2013, WorldView-2, R-G-B (red-green-blue)).

Figure 1 .
Figure 1.Top: QuickBird 2 subsets of the Yida camp area (acquisition date: 12 October 2012, band combination NIR-R-G (near infrared-red-green)) showing initial image segmentation of two bright dwellings and the cast shadows.Bottom: dark dwellings with very low contrast to the surroundings, where segmentation fails in extracting meaningful objects (Yida camp, 4 March 2013, WorldView-2, R-G-B (red-green-blue)).

Figure 2 .
Figure 2. Examples of typical dwelling types detected in refugee and IDP (internally displaced persons) camps in Eastern Africa.Source: [2], adapted.

Figure 2 .
Figure 2. Examples of typical dwelling types detected in refugee and IDP (internally displaced persons) camps in Eastern Africa.Source: [2], adapted.

Figure 3 .
Figure 3. Spatial distribution of the test sites used for the creation of the dwelling template library and the dwelling extraction analyses (band combination of images: R-G-B).The smaller scale bar is valid for the depicted image subsets.

Figure 3 .
Figure 3. Spatial distribution of the test sites used for the creation of the dwelling template library and the dwelling extraction analyses (band combination of images: R-G-B).The smaller scale bar is valid for the depicted image subsets.

Figure 4 .
Figure 4. Generalized workflow of template generation applied in this study.

Figure 4 .
Figure 4. Generalized workflow of template generation applied in this study.

Figure 5 .
Figure 5. Examples of different template classes and their structural properties, such as shadow direction, shape, type, and size of dwellings, in the template library.In this visualization, the shadows are simulated for the location of the camp Yida, which is located in South Sudan, to illustrate how different sun angles can influence the direction of the shadow.The aerial view is north-oriented while the 45° view is southwest-oriented.The orange arrow shows the applied rotation angle and the green rectangle indicates the (relative) size of the samples for a dwelling template.The shadow direction is encoded within the name of the template (e.g., 1001 shows a shadow on two sides. 1 stands for shadow and 0 for no shadow.The cast shadow is counted clockwise starting at the top).

Figure 5 .
Figure 5. Examples of different template classes and their structural properties, such as shadow direction, shape, type, and size of dwellings, in the template library.In this visualization, the shadows are simulated for the location of the camp Yida, which is located in South Sudan, to illustrate how different sun angles can influence the direction of the shadow.The aerial view is north-oriented while the 45 • view is southwest-oriented.The orange arrow shows the applied rotation angle and the green rectangle indicates the (relative) size of the samples for a dwelling template.The shadow direction is encoded within the name of the template (e.g., 1001 shows a shadow on two sides. 1 stands for shadow and 0 for no shadow.The cast shadow is counted clockwise starting at the top).

Figure 6 .
Figure 6.Integrated workflow combining object-based image analysis (OBIA) and template matching for dwelling extraction.

Figure 6 .
Figure 6.Integrated workflow combining object-based image analysis (OBIA) and template matching for dwelling extraction.

Figure 7 .
Figure 7. Number of detected dwellings for the three test sites.The template matching (TM) approach was applied without differentiation into dwelling types.

Figure 7 .
Figure 7. Number of detected dwellings for the three test sites.The template matching (TM) approach was applied without differentiation into dwelling types.

Figure 8 .
Figure 8.Comparison of the same area of the Yida camp (80 m × 40 m) between October 2012 (left column, QuickBird) and April 2013 (right column, WorldView-2).In the rainy season (left), dwellings show higher contrast to their surroundings compared to the dry season (right).The top row shows the true color image (band combination R-G-B) and the bottom row shows the blue band in grayscale, which was used for the template matching of bright dwellings.

Figure 8 .
Figure 8.Comparison of the same area of the Yida camp (80 m × 40 m) between October 2012 (left column, QuickBird) and April 2013 (right column, WorldView-2).In the rainy season (left), dwellings show higher contrast to their surroundings compared to the dry season (right).The top row shows the true color image (band combination R-G-B) and the bottom row shows the blue band in grayscale, which was used for the template matching of bright dwellings.
Remote Sens. 2017, 9, 326 10 of 16 sample areas.In the El Redis camp, two sample areas were created because of the small camp size.In the Yida camp, five sample areas were created (Figure9).The sample areas in the Yida camp are the same for both years (2012 and 2013), which allows a detailed comparison of the development in these parts of the camp.The visual interpretation includes a point file for every occurring dwelling in the sample areas, including properties of the dwelling type.

Figure 9 .
Figure 9.El Redis camp (2015, band combination R-G-B, left) and Yida camp (2012, band combination R-G-B, right) with 200 m × 200 m squares randomly selected for visual interpretation and accuracy assessment.

Figure 9 .
Figure 9.El Redis camp (2015, band combination R-G-B, left) and Yida camp (2012, band combination R-G-B, right) with 200 m × 200 m squares randomly selected for visual interpretation and accuracy assessment.

Figure 10 .
Figure 10.Accuracy assessment for the randomly selected sample areas.Dwellings are not differentiated by type.UA = User's accuracy, PA = Producer's accuracy.

Figure 10 .
Figure 10.Accuracy assessment for the randomly selected sample areas.Dwellings are not differentiated by type.UA = User's accuracy, PA = Producer's accuracy.

Table 1 .
Computation time of the template matching implementation for different image sizes and different numbers of rotation steps (time in seconds on a standard PC).

Table 1 .
Computation time of the template matching implementation for different image sizes and different numbers of rotation steps (time in seconds on a standard PC).

Table 2 .
Sites to which the template library is applied including information about acquisition date, size, and complexity regarding dwelling extraction.

Table 2 .
Sites to which the template library is applied including information about acquisition date, size, and complexity regarding dwelling extraction.

Table 3 .
Accuracy assessment for randomly selected sample areas in the El Redis camp.The dwellings are differentiated by type.Number (No.) of true positives (TP) and false positives (FP), user's accuracy (UA), producer's accuracy (PA), template library within an object-based framework (TMOB), and pre-existing OBIA classification (Pre-existing OB).