## 1 Introduction
### Step 4: Binarization  
A shadow mask is often accomplished by binarizing the previously acquired shadow index image with a certain threshold manually selected or automatically with a certain thresholding algorithm [20; 23; 24]. Several thresholding methods are widely used in the image binarization stage, such as the Otsu method [21], the valley-emphasis method (VEM) [36], and the (NVEM) thresholding method [27]. The Otsu thresholding method is a typical automatic one widely used in image binarization for images with a histogram distributed in a bimodal form [21]. However, difficulties occur when image histogram appears in a unimodal or approximately unimodal distribution. Additionally, in order to determine optimal threshold values for both unimodal and bimodal distributions, [PERSON] [36] attempts to revise the Otsu method by applying a weight to the Otsu method resulting in the VEM thresholding method. Based on the study by [PERSON] and [PERSON] [21; 36], [PERSON] et al. [27] propose the NVEM thresholding method, in which the between-class variance is further modified with the sum of the neighborhood gray probability with an interval of \(2m+1\). According to the description in the work by [PERSON] et al. [27], the NVEM thresholding method is briefly introduced as follows. Figure 3: Comparison between the linear function \(f(x)=x\) and the natural logarithm function \(f(x)=\ln(x+1)\) in compressing data scale. The gray probability of a certain gray value \(g\) is calculated with Equation (25), and the sum of the neighborhood gray probability with an interval of \(2m+1\) is calculated with Equation (26):  
\[h(g)=\frac{f(g)}{n},g=0,1,\ldots,L-1 \tag{25}\]  
\[\overline{h}(g)=\sum_{i=-m}^{m}h(g+i) \tag{26}\]  
where \(f(g)\) is the pixel number of gray value \(g\), \(L\) is the image gray level, and \(n\) is the total pixel number. The image is initially divided into two classes (background and object, or object and background) with a certain threshold \(t\). The probabilities of the two classes are calculated with Equation (27). \[\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{27}\]  
Then, the mathematical expectations of the two classes are computed with Equation (28). \[\left\{ \begin{array}{l}\mu_{0}(t)=\left[\sum\limits_{g=0}^{t}gh(g)\right] /p_{0}(t)\\ \mu_{1}(t)=\left[\sum\limits_{g=t+1}^{L-1}gh(g)\right]/p_{1}(t)\end{array} \right. \tag{28}\]  
With consideration of the sum of the neighborhood gray probability in an interval of \(2m+1\), the between-class variance is modified by [PERSON] et al. as shown in Equation (29). \[\xi(t)=\left(1-\overline{h}(t)\right)\left[p_{0}(t)\mu_{0}^{2}(t)+p_{1}(t)\mu_ {1}^{2}(t)\right] \tag{29}\]  
Finally, the optimal threshold \(T\) is determined by maximizing the modified between-class variance with \(t\) in the range of \(0\) to \(L-1\), as shown in Equation (30). \[T=\underset{0<t<L-1}{\operatorname{argmax}}(\xi(t)) \tag{30}\]  
As described above, we particularly employ the NVEM thresholding method for its efficiency and automation. Consequently, a shadow candidate is generated by binarizing the \(LSI\) image with the NVEM thresholding method. Accordingly, the \(LSI\) index image is particularly segmented with the solution of Equation (31):  
\[A=\left\{ \begin{array}{l}0,\text{ if }LSI<T\\ 1,\text{ otherwise}\end{array} \right. \tag{31}\]  
where \(T\) is the optimal threshold determined with the NVEM thresholding method for the binarization of the \(LSI\) index image, and \(A\) is the binarized result with the acquired optimal threshold \(T\). Additionally, we optimize the shadow candidate by applying a series of morphological operations over the binary shadow candidate. In particular, the morphological opening and closing operations are mainly employed with a certain structuring element [29], as presented in Equations (32) and (33). The morphological operation contributes to the final optimized shadow image.