Shadow Detection Method Based on HMRF with Soft Edges for High-Resolution Remote-Sensing Images ()
1. Introduction
Remote sensing images are applied in many fields, including geography mapping, agriculture, change detection, etc. Unfortunately, shadows in these images obstruct these applications because of the reduction or even loss of radiance in the shadow areas. To detect shadows, early works extracted spectral features of shadow areas, such as lower intensity [1], higher saturation [2], large hue value and blow blue color value [3], etc. Later, in order to take full advantages of spectral features of multiband images, some researches explored invariant color spaces to stress the differences between shadows and non-shadows [4] [5] [6]. Also, some efforts on combining different spectral features [7] [8] have achieved some good results in their intended realms. However, there are still some limits in these methods because of the absence of other information such as edges and spatial context information.
As for spatial information, the well-known probabilistic model HMRF which serve as a powerful formal tool to present neighborhood interactions is a natural choice [9]. In recent years, many researchers have attempted to incorporate more information into it to improve the performance of HMRF [10] [11]. Our latest work [12] adds edge constraints into the iterative clustering procedure based on HMRF. In this work, an edges consistency model is proposed to describe the similarity between the clustering edges and the pre-detected ones. This method can obtain more clear boundaries along with the homogeneous area. However, it is not a good idea to determine whether a pixel is the edge or not strictly because the spectral features of pixels on the shadow boundaries are not discriminable enough.
In this paper, a soft edge model is raised to present the probability of a pixel being considered as an edge pixel. Thus, pixels with lower probability should be labeled according its spectral features and the neighbor interaction, which tend to obtain more homogeneous area. Comparatively, label assigned to pixels which have higher edge probability should lead to more clear boundaries. It means that we should balance the influence of different pixels in the iterative procedure. So, there came a new object function, which is defined to ensure that different roles are assigned to more likely edge pixels and the other ones. Given all that, there are two main contributions in this paper. One is the soft edge model, and the other is a new object function based on which an iterative shadow detection method is proposed.
This paper is organized as follows. In Section 2, we will describe the soft edge model and the proposed clustering method with edge constraints, which followed by the analysis of experiments on remote sensing images in Section 3. Finally, conclusions are drawn in Section 4.
2. Shadow Detection Method with Soft Edges
2.1. Soft Edges Model
As mentioned in section 1, a natural way to describe shadow edges is using the soft manner. Therefore, an essential indicator must be defined to measure the probability of pixels being considered as shadow edges.
Let Y denote an intensity image defined on a
rectangular lattice set,
denote the set of pixel sites. Then the corresponding shadow image can be defined as
, in which, 0 is the label for non-shadows while 1 is for shadows.
Edges typically are detected according gradient. Pixels with larger gradient should be considered as edges. Therefore, many researches explored shadow detection method using threshold of gradient. Taking “Canny edge detection” as example, two thresholds of gradient are used to determine whether a pixel is an edge one or not. We can introduce these two thresholds into the soft edges model, shown as:
(1)
In which,
is the gradient of
pixel,
is the larger threshold in Canny detection while
is the small one. Therefore,
indicate the degree of
pixel belonging to an edge in view of gradient.
In actual images, not all pixels with higher gradient value are true edges, for example, noises. To exclude this, a shadow detection using intensity features will be employed as the initial detection and then neighbor pixels would be exploited. Generally, neighbors of a noise pixel belong to the same class, which means they should have the same label. In other words, the more shadow neighbors a pixel has, the lower edge probability it should be assigned. Aiming at achieving an edge probability for each pixel, the soft edge indicator should take the two terms into account.
So, the indicator can be defined as:
(2)
where
denote the neighborhood of ith pixel while N is the number of the neighbors.
is a factor who can balance the power of two terms.
2.2. Shadow Detection Method with Soft Edges
Aiming at partitioning an image into shadow areas and non-shadow areas, the procedure of shadow detection can be treated as a process of image labeling. As known, HRMFs can be found in most image labeling methods for the excellent capability of spatial description. At the same time, Fuzzy C-means (FCM) clustering is also one of the most widely used algorithms which can retain enough information from the original images compared to threshold methods. Hereby, HMRF-FCM [13] combining the benefits of HMRF and FCM to deal with the fuzziness and region homogeneity of the labeled images becomes a natural choice.
HMRF-FCM incorporates the HMRF into FCM by understanding HMRF in a fuzzy way. It treats kth HMRF models as a fuzzy classification. The fuzzy classification is defined as:
in which,
denotes the membership of ith pixel to the kth cluster (
in our shadow detection task). And an iterative procedure is carried out to updating the membership matrix. Our proposed soft edge model is employed in the iterative updating procedure to impose edge constraints. As mentioned above, labels of edge pixels should lead to more accurate boundaries while that of shadow ones should be of benefit to region homogeneity.
Considering that boundaries generally are continuous along a certain direction, a novel membership is defined as:
(3)
In which,
denotes neighborhoods of ith pixel along direction s.
is a function denoted as:
According Equation (3), along direction s, the more same labeled neighbors the pixel has, the larger value be assigned to
. In other words, it is also a membership of ith pixel to the kth cluster. But the main consideration about
is that the label k given to ith pixel should make the pixel have more same labeled neighbors along one direction. The direction s is determined by:
(4)
Based on this, the objective function of this iterative clustering procedure can be defined as:
(5)
in which,
(6)
And
is the pointwise prior probabilities of the HMRF model states, which can be denoted as:
(7)
To sum up, the proposed algorithm for shadow detection comprises the following steps.
1) Get the detected edge image
by edge detection method
2) Initialize the membership matrix
by the original FCM algorithm, and derive the mean
and the standard deviation
3) Estimate the label field
by defuzzification.
4) Compute the edge probability matrix
.
5) Compute the membership matrix
6) Get the pointwise prior probabilities according Equation (7).
7) Compute the distance matrix
that is given by Equation (6).
8) Update the membership matrix
, the mean
and the standard deviation
.
9) If it converge then stop, otherwise, set 𝑡 = 𝑡 + 1 and go to step 3).
3. Experiments and Analysis
3.1. Data
To evaluate the performance of proposed shadow detection method, we chose three pieces of remote sensing urban images among which the main variation is the complexity of scenes contents (Figures 1-4).
Image 1: The first image is acquired in September 2003, refers to a 280 × 280 pixel image in the visible spectrum. As shown in Figure 1, it mainly consists of grass areas, buildings, and their shadows.
Image 2: Beijing in May 2011. The second image is scene of Beijing acquired in May 2011 and its size is 300×300. It mainly contains trees, grass, buildings, blue roofs, and shadows.
Image 3: Beijing in April 2011. The second image is scene of Beijing acquired in May 2011 and its size is 300×300. The land covers in it are same with Image 2, except for roads.
Image 4: Wuhan University in 2004. The fourth image represents a crop of 256 × 256 pixels of the Wuhan University acquired in 2004. There are six land covers: roads, bared land, trees, buildings, water, and shadows.
3.2. Compression Approaches
To verify the superiority of the proposed shadow detection method to the ones without edge constraints, three methods are employed as the competitors: bithreshold method [7], PCAHSI [8], and soft Shadow Detection method [12].
Bithreshold method
Bithreshold method tries to use two spectral features of shadow areas. Firstly, transform the image into HIS color space, compute the normalized difference of intensity (𝐼) and saturation (𝑆) components, and obtain the initial detection by its threshold. Then, get the detection result of 𝐼 channel by histogram threshold. The final result is obtained by performing AND operation on two detected results mentioned above.
PCAHSI
Firstly, compute the shadow index (SI) based on principal component transformation and HIS model. Then, image is divided into the shadow area and nonshadow area by SI histogram threshold.
Soft shadow
This method introduces the concept of opacity of image matting into shadow detection and puts forward a new concept of shadow probability. Firstly, compute the shadow probability according the intensity and opacity. Then this probability is employed as the class conditional probability and an iterative procedure based on MRF is used to segment the image into shadow areas and the nonshadows.
3.3. Experiments and Discussion
In this section, the performance of the proposed method is verified by experimental results. Some parameters in our experiments were chosen empirically. In detail, for Potts model and
for soft edge indicator. Another important parameter, the window size of neighborhood for HMRF is set as 3 × 3 because it can preserve as much as possible the image details.
Visual Comparison
Experimental results on the first image using different methods (bi-threshold, PCA method, soft shadow method, the proposed method) are shown in Figure 5. Figure 5(e) is the ground truth of image 1.
Obviously, there are many misdetection in Figure 5(a) and Figure 5(b) because these two methods only used thershold of spectual features. It is not efficient enough to distinguish dark objects from shadows. These defects are removed in soft shadow method shown in Figure 5(c), which thanks for the soft shadow model. Also because of the use of HMRF, soft shadow method obtained more homogenous regions. But, region boundaries in Figure 5(c) are so smooth that some details are missing, even some trivial shadow areas. Seen from Figure 5(d), the proposed method is superior to the competitive ones. It can obtain more accurate boundaries as well as homogenous regions for the constrainsts of edgs. These comparisons can also be presented in Figure 6, Figure 7 and Figure 8. From the comparison of results of four images, we can see that as the complexity
of land covers increases, the greater misdetection occurs.
Quantitative Comparisons
To obtain a quantitative comparison between different algorithms, both recall and precision are employed as the performance metrics. Recall represents how many true shadow pixels have been detected as shadow pixels, which is denoted by
(8)
where
is the number of true shadow pixels, while
is the number of pixels detected as shadows correctly.
is computed by performing AND operation on the detected result and the true shadow mask.
Precision indicates that in the detected shadow pixels, how many correct ones are there. It can be denoted as:
(9)
where
is the number of pixels labeled as shadow. From the definition, it is easy to conclude that the recall favors over detection and the precision favors under detection. That is to say, high recall combined with a low precision means over detection shadows. We measured the recall and precision of each method and listed their values in Table 1. From the quantitative results as shown in Table 1, it is easy to conclude that the proposed method can obtain more accurate shadow detection results than the competitors.
4. Conclusion
In this paper, in order to add edge constraints into shadow detection, a soft edge model is put forward, considering the fact that shadow edges are not discriminate clearly. Based on this, an iterative shadow detection method with edge constraints based on HMRF is proposed. Experiments on remote sensing images have illustrated that the proposed method can get more clearly edges as well as homogenous regions.
Funding
This work is supported in part by the National Natural Science Foundation of China under Grants 41001251, the Key Technology Projects of Henan province of China (No. 132102210212), the Key Technology Projects of the Educational Department of Henan Province of China (No. 16A520036).