# Analysis of Blur Measure Operators for Single Image Blur Segmentation
## 3 Material and Method
### Methodology
#### 3.2.3 Multiscale Inference  
Usually, the blurred images have spatially varying blur sizes. In such a case, the consideration of only one size for the local image neighborhood window may not help in inferring about the blurriness accurately [53]. Therefore, three sizes for the local neighborhood window are considered for blur map generation which correspond to three scales, \(s=1,2,3\).  
Given an input image, the blur measures are computed at three different scales by applying an operator \(B\) and then alpha matting is applied at each scale for classification. After acquiring \(\alpha\)-maps at three different scales, these are fused together using a multi-scale graphical model as proposed by [11]. The total energy on the graphical model is expressed as  
\[E(\bar{\alpha})=\sum_{s=1}^{3}\sum_{i}|\bar{\alpha}_{i}^{(s)}-\hat{\alpha}_{i }^{(s)}|+\beta\bigg{(}\sum_{s=1}^{3}\sum_{i}\sum_{j\in\mathcal{N}_{i}^{(s)}}| \bar{\alpha}_{i}^{(s)}-\bar{\alpha}_{j}^{(s)}|+\sum_{s=1}^{2}\sum_{i}|\bar{ \alpha}_{i}^{(s)}-\bar{\alpha}_{i}^{(s+1)}|\bigg{)}, \tag{5}\]  
where \(\bar{\alpha}_{i}^{(s)}\) represents the optimized alpha map for a pixel \(i\) at a particular scale \(s\) and \(\bar{\alpha}_{i}^{(s)}\) is the alpha map to be inferred. This multi-scale inference makes it feasible to extract small and large sized blur, which makes our methodology more effective. The first data term on the right is the cost of assigning the alpha map values. The second term consists of two parts and it enforces smoothness in the same scale and across different scales. The first part represents the spatial affinity in the four neighbor set \(\mathcal{N}_{i}^{(s)}\) for pixel \(i\) in the \(s\) scale. The second part accounts for the inter-scale affinity. The weight \(\beta\)  
Figure 3: Comparison for the setting of thresholds in the alpha matting step either by some predefined fixed values or computing them adaptively through interquartile range (IQR). Initial alpha maps are obtained by applying Kurtosis in a neighborhood window of size \(21\times 21\) pixels. First row shows the initial alpha maps computed by taking the randomly selected thresholds (**a**) \(T_{1}=0.02,T_{2}=0.75\), (**b**) \(T_{1}=0.05,T_{2}=0.7\) and (**c**) \(T_{1}=0.1,T_{2}=0.5\). (**d**) represents the normalized initial blur map of the input image. (**e**) IQR for the histogram of (**d**) where \(Q_{1}=0.204\) and \(Q_{2}=0.317\). (**f**) Initial alpha map by setting \(T_{1}=Q_{1},T_{2}=Q_{2}\) as in Equation (3).  
steers the relative importance of these two terms. Equation (5) can be optimized using loopy belief propagation [54].  
Finally, the output of the proposed methodology is the gray scale image \(\bar{\alpha}_{i}^{(3)}\) which is the inferred blur map at the largest scale. However, as the ground truth is in binary (1 and 0), so \(\bar{\alpha}_{i}^{(3)}\) has also been binarized into 1 and 0 s accordingly by simply applying an adaptive threshold \(T_{seg}\),  
\[\bar{\alpha}_{i}^{(3)}=\begin{cases}0,&\text{if }\bar{\alpha}_{i}^{(3)}<T_{seg} \\ 1,&\text{if }\bar{\alpha}_{i}^{(3)}>T_{seg}.\end{cases} \tag{6}\]