## 2 Materials and Methods
### Threshold Method  
After we obtained the shadow index image with the proposed previously developed mixed property-based shadow index, we applied an optimal threshold to the shadow index image, in which the optimal threshold could be obtained automatically by using several typical threshold methods,  
Figure 2: Sampling curves with respect to the reflectivity difference values between the normalized reflectivity values of the red (R) band and the near infrared (NIR) band for both shadow regions and vegetation cover types in nonshadow regions.  
such as the Otsu threshold method [30] and the neighborhood valley-emphasis threshold method (NVETM) [33].  
Practically, the Otsu threshold method is well known for its simplicity and easy realization, making it one of the typical threshold methods commonly used in practical applications. The Otsu threshold method works well for images of histograms in bimodal distribution or close to bimodal distribution. However, when histograms of the test images are unimodally distributed or close to it, extra measures are needed for the Otsu threshold method to determine an optimal threshold for these images [33]. Furthermore, based on the Otsu method and the previous work of [PERSON] in 2006 [41], [PERSON] et al. developed a new automatic threshold method in 2012, called the neighborhood valley-emphasis threshold method (NVETM). This NVETM has been applied to detecting shadows in high-resolution remote sensing images, and presents satisfactory thresholding results for most images with histograms in either bimodal or unimodal [19]. Therefore, this automatic NVETM was applied in our approach, which was combined with our developed mixed property-based shadow index for detecting shadows in VHR multispectral remote sensing images.  
The NVETM is described as follows [33]. First, for gray-level \(g\), the corresponding frequency \(h(g)\) is calculated using Equation (17), and the sum of the neighborhood gray probability \(\overline{h}(g)\) in interval \(2m+1\) is defined as:  
\[h(g)=\frac{f(g)}{n},g=0,1,\ldots,L-1 \tag{17}\]  
\[\overline{h}(g)=\sum\limits_{i=-m}^{m}h(g+i) \tag{18}\]  
where \(f(g)\) is the amount of the pixels with gray level \(g\), \(L\) is the number of gray levels, and \(n\) is the number of pixels in the test image.  
Then, the test image is binarized into two classes, either 0 or 1, by a predefined threshold \(t\), which is computed with Equation (19):  
\[\left\{\begin{array}{l}p_{0}(t)=\sum\limits_{g=0}^{t}h(g)\\ p_{1}(t)=\sum\limits_{g=t+1}^{L-1}h(g)\end{array}\right. \tag{19}\]  
After that, the mathematical expectations of the two classes above are calculated as:  
\[\left\{\begin{array}{l}\mu_{0}(t)=\left.\begin{bmatrix}\sum\limits_{g=0}^{t} gh(g)\\ \mu_{1}(t)=\left.\begin{bmatrix}\sum\limits_{g=t+1}^{L-1}gh(g)\\ \end{bmatrix}\end{array}\right.\right\rvert/p_{0}(t) \tag{20}\]  
Finally, the NVETM determines an optimal threshold \(T\) by maximizing the revised within-class variance \(\xi(t)\), as shown in Equation (21):  
\[\xi(t)=\Big{(}1-\overline{h}(t)\Big{)}\Big{[}p_{0}(t)\mu_{0}^{2}(t)+p_{1}(t) \mu_{1}^{2}(t)\Big{]} \tag{21}\]  
Considering that histogram images may have various distributions, we selected the NVETM by [PERSON] et al. to automatically determine an optimal threshold \(T\). With the optimal threshold \(T\) obtained above, the shadow image could finally be constructed, combined with our proposed shadow index image by assigning a value of 0 to the pixel with a gray level below the optimal threshold \(T\), and by assigning a value of 1 to that with a gray level above \(T\) in the original image, which were regarded as the shadow pixel and the nonshadow pixel, respectively. Figure 3 shows the flow chart of the proposed shadow detection approach.