## 3 Proposed BMI System
### Feature Extraction  
In this study, given a pixel under analysis, the ADT filter is employed to extract the following features: color gradient direction, color component percentage, intensity, high order statistic, B channel and Illumination Invariant (ILL) feature. Color gradient direction featureAccording with [PERSON] et al. [9], the reflectance of a shadow boundary for each pixel is locally constant, hence, the color gradient direction is identical in each channel, since the RGB illumination gradients are all perpendicular to shadow boundary. After calculating three gradient directions by Sobel filter, the gradient direction difference is measured for each color as follows:  
\[\rho_{rg}=min(|\rho_{r}-\rho_{g}|,2\pi-|\rho_{r}-\rho_{g}|) \tag{1}\]  
\[\rho_{gb}=min(|\rho_{g}-\rho_{b}|,2\pi-|\rho_{g}-\rho_{b}|) \tag{2}\]  
\[\rho_{br}=min(|\rho_{b}-\rho_{r}|,2\pi-|\rho_{b}-\rho_{r}|) \tag{3}\]  
where \(\rho_{r}\) is the gradient direction of red channel, \(\rho_{g}\) and \(\rho_{b}\) represent the gradient direction of green channel and blue channel, respectively, while \(2\pi\) is used to achieve the translation of the absolute value of the gradient direction difference under analysis. Hence, a color gradient direction feature vector sized \(1\times 3\) is extracted. Color component percentage featureThe component percentage feature, especially the blue component ratio in RGB color space is very important in detecting shadow boundaries [9]. Shadow has a blue mask under the sun, consequently, the proportion of blue chromatic content takes more percentage in RGB color space. However, it is worth mentioning that it is impossible to distinguish shadow boundaries from other object boundaries by only such feature, because some object boundaries may share the similar properties. Hence, ratio of blue component to other color components is used to avoid error from detecting boundaries and consequently improve the accuracy significantly. Since the pixel values in shadow are always lower than those in sunlit areas, high values represent bright areas while low values represent shadow areas. Let define the following ratios:  
\[T_{r}=(L_{r}+1)/(H_{r}+1) \tag{4}\]  
\[T_{g}=(L_{g}+1)/(H_{g}+1) \tag{5}\]  
\[T_{b}=(L_{b}+1)/(H_{b}+1 \tag{6}\]  
where \(H_{r}\), \(H_{g}\), \(H_{b}\) are pixel values of bright, sunlit edge for red green and blue channels, respectively; while, \(L_{r}\), \(L_{g}\), \(L_{b}\) are those for the dark edge. In order to enhance accuracy performance in determining shade, we defined \(T_{all}\), \(T_{br}\) and \(T_{bg}\) to represent the ratio of blue component at each pixel in RGB color space, where:  
\[T_{all}=T_{b}/(T_{r}+T_{g}+T_{b})) \tag{7}\]  
\[T_{br}=T_{b}/T_{r} \tag{8}\]  
\[T_{bg}=T_{b}/T_{g} \tag{9}\]  
Hence, a color component percentage feature vector sized \(1\times 3\) is extracted. Intensity featureSuch feature is typically used in several shadow detection algorithms for its discriminative properties [11; 47; 48]. The original image is transformed into a gray scale image to obtain the intensity of illumination on object boundaries. Such feature is evaluated on both side of the boundary by applying 3 ADT filters sized \(5\times 3\), \(7\times 3\) and \(11\times 3\), respectively. The result is an intensity features vector of \(1\times 6\) (as 3 values per side are estimated). It is to be noted that if the light intensity feature on both sides of a pixel are the same, the pixel under analysis does not belong to the shadow edge. High Order Statistic (HOS) featuresHere, HOS analysis includes the extraction of two features: skewness \(\gamma\) and kurtosis \(\kappa\). Skewness is a measure of the asymmetry of the probability distribution for a real-valued random variable defined as:  
\[\gamma=E\left[\left(\frac{\left(X-\mu\right)}{\sigma}\right)^{3}\right] \tag{10}\]  
where \(\mu\) is the mean value, \(\sigma\) is the standard deviation, \(E\) is the expectation operator. The skewness of data is calculated on the direction of object boundaries.