# Volumetric Tooth Wear Measurement of Scraper Conveyor Sprocket Using Shape from Focus-Based Method
## 3 Improved SFF
### Normal Distribution Operator Image Filtering
#### 3.2.3 Algorithm Verification and Evaluation Analyzes  
To verify the feasibility of the operator filtering, three images of a vegetable, a ball and a human, respectively, were selected as test objects. (These images, shown in Figure 9, were chosen from a book named Detailed Explanation of Image Processing Example in MATLAB.) Salt-and-pepper noise with a density of 0.01 was added to the images, and we performed median filtering and normal distribution operator filtering on the noise images (threshold value \(K\): 2.2).  
Figure 8: 3 \(\times\) 3 filter evaluation window.  
To evaluate the quality of median filtering and normal distribution operator filtering quantitatively, we selected correlation and the peak signal-to-noise ratio (PSNR) as quantitative assessment criteria. Correlation was used to evaluate the similarity between the reference and real data, where a greater correlation value indicates that the reference data are more consistent with the real data. PSNR was used to measure image quality after filtering, where a greater PSNR value indicates less image distortion. The formulas for correlation and PSNR are given follows.  
\[Cor=\frac{\sum\limits_{i=1}^{M}\sum\limits_{j=1}^{N}\left\{\left[I^{\prime}(x, y)-\overline{I^{\prime}(x,y)}\right]\times\left[I(x,y)-\overline{I(x,y)} \right]\right\}}{\sqrt{\sum\limits_{i=1}^{M}\sum\limits_{j=1}^{N}\left[I^{ \prime}(x,y)-\overline{I^{\prime}(x,y)}\right]^{2}\times\sum\limits_{i=1}^{M} \sum\limits_{j=1}^{N}\left[I(x,y)-\overline{I(x,y)}\right]^{2}}} \tag{10}\]  
\[PSNR=10\times\log\left(\frac{255^{2}}{MSE}\right) \tag{11}\]  
\[MSE=\frac{1}{M\times N}{\sum\limits_{i=1}^{M}\sum\limits_{j=1}^{N}\left[I^{ \prime}(x,y)-I(x,y)\right]} \tag{12}\]  
In Equations (10)-(12), \(M\) represents the width of the image, \(N\) denotes the height of the image, \(I^{\prime}(x,y)\) stands for the actual grey value of the pixel point \((x,y)\), and \(\overline{I^{\prime}(i,j)}\) represents the estimated average grey value for all pixels in the image. While \(I(x,y)\) denotes the grey value of the pixels \((x,y)\) after filtering, and \(\overline{I(i,j)}\) stands for the estimated average grey value for all pixels after filtering in the image, \(MSE\) represents the mean square error.  
Figure 10 shows the noise and filter processing results with a density of 0.01. Here, the first, second and third columns show images with density of 0.01, images processed using median filtering and images processed using normal distribution operator filtering, respectively. As shown in Figure 10a, the images contain large number of errors. Note that these errors are reduced significantly by filtering the noise image. In addition, the median filtered images (Figure 10b) are more blurred than the original image and the filtering effect is poor. However, images obtained via normal operator filter processing are closer in appearance to the corresponding original images.  
Figure 9: Test objects: (**a**) Vegetable; (**b**) Ball; (**c**) Human.  
Table 1 shows the correlation and root mean squared error (RMSE) data for three sequence images processed by adding noise and by applying median filtering and normal distribution operator filtering. As can be seen, the correlation and RMSE values obtained by the two filtering methods are greater than those obtained with the noisy image sequence. Furthermore, the increase to these values is more obvious with normal distribution operator filtering. Both filtering methods improve the accuracy of image filtering; however, the results demonstrate that normal distribution operator filtering is better.