## 3 Proposed Method
### Saliency Cuts Using Local Adaptive Thresholding
#### 3.2.3 Local Adaptive Triple Thresholding  
This step involves a fast approach for computing local thresholds without compromising the performance of local thresholding using the integral sum image as a prior process for finding the local mean of neighboring pixels in a window, irrespective of window size. Using this technique, we can accomplish a binarization speed close to those of global binarization methods. Next, we categorize each pixel as follows:  
(1) Sum of pixel values \(R_{s}\) over a rectangle \(R\) within a moving window with a size \(S\times S\) was defined so that the window size depended on the image's width \(W\). The window size is very important in local adaptive thresholding methods. [PERSON] and [PERSON] used a window size one-eighth of the image width to calculate the average value. We used one-half of the image width for the window size  
Figure 4: Steps for calculating the Integral image. Figure 5: Example of integral image calculation: (**a**) grayscale image, (**b**) integral image. \(S\) due to the saliency object size in natural scene images. As shown in Figure 6, shadow area \(R\) is on the grayscale image. \[R_{S}=I(x_{2},y_{2})-I(x_{2},y_{1}-1)-I(x_{1}-1,y_{2})+I(x_{1}-1,y_{1}-1) \tag{3}\]  
where \(x_{1},x_{2}=x\pm S/2\) and \(y_{1},y_{2}=y\pm S/2\). (2) The number of pixels in \(R\) can be calculated as  
\[N=(x_{2}-x_{1})\times(y_{2}-y_{1}) \tag{4}\]  
[PERSON] and [PERSON] calculated the optimal threshold value on the basis of comparison [44; 46]--if the value of the current pixel was 15 percent less than the average, it was set to black; otherwise, it was set to white for document images. In the proposed method, we improved this threshold value by assigning it to the local arithmetic mean value using Equations (5) and (6). Because a saliency map of natural scene images mainly consists of black (certain background) with some variety of grayscale values (unknown), we experimentally found that the local arithmetic mean value as a first-level threshold value yielded the best results for a variety of images. Let us assume that the scale of a saliency map is [0; \(L\)], and that the pixel number of each bin in its histogram is \(B=\{b_{0},\ldots b_{i},\ldots b_{L}\}\), where \(i\) represents the saliency value. We can improve the [PERSON] algorithm to obtain three-level thresholds, including \(t_{l}\), \(t_{m}\), and \(t_{h}\) 0 \(<t_{l}<t_{l}<t_{l}<L\), and decompose the histogram of a saliency map into four parts: certain background \(T_{cb}=\) [0; \(t_{l}\)], probable background \(T_{pb}\)= [\(t_{l}+1\); \(t_{m}\)], probable foreground \(T_{pf}\)= [\(t_{m}+1\); \(t_{h}\)], and certain foreground \(T_{cf}\) = [\(t_{h}+1\); \(L\)]. We first calculated \(t_{l}\), then divided the saliency histogram into \(T_{b}\)= [0, \(t_{l}\)] (certain background) and \(T_{u}\) = [\(t_{m}\) +1, \(L\)] (unknown). The unknown regions were initially used to train foreground color models, thus helping the algorithm to identify foreground pixels. We then calculated \(t_{m}\) and \(t_{h}\), and further divided the saliency histogram into \(T_{cb}\), \(T_{pb}\), \(T_{pf}\), and \(T_{cf}\). The numbers of pixels with saliency values in \(T_{b}\) and \(T_{u}\) were \(p_{b}\) and \(p_{u}\), respectively, and the number of pixels in the entire image was \(P=p_{b}+p_{u}\). We could then calculate threshold \(t_{l}\) by averaging the pixels within the window of size \(S\times S\). (3) The local arithmetic mean \(m\) (\(x,y\)) at (\(x,y\)) is the average of the pixels within the window of size \(S\times S\), and could be calculated as  
\[m(x,y)=R_{s}/N \tag{5}\]  
\[t_{l}=m(x,y) \tag{6}\]  
(4) Finally, \(t_{m}\) and \(t_{h}\) could be calculated as follows:  
\[t_{h}=t_{l}+(L-t_{l})/2 \tag{7}\]  
Figure 6: Sum over rectangle \(R\) in grayscale image. where \(L\) is maximum pixel value in the image and  
\[t_{m}=t_{l}+\left(t_{h}-t_{l}\right)/2 \tag{8}\]  
Given a saliency map, initially found \(t_{l}\) maximized the difference between the object region and the background region.