# Focus Estimation Methods for Use in Industrial SFF Imaging Systems
## 3 Results
### Comparison of Results for Different Image Contrast  
One of the interferences studied is the impact of contrast in the source image on the quality of the resulting height map. The contrast was not digitally changed by applying image transformations. The contrast was modified in an analogue approach corresponding to conditions encountered on industrial production lines. The contrast in the image was modified by adjusting the exposure time of the sensor of the vision system. Such a change under static conditions is equivalent to changing the illuminator power.  
Measurements were taken for exposure time sequences ranging from 600 us to 87 us with a step of 50 us (Figure 13). Twelve samples were thus obtained, showing the relationship of error values to contrast in the source images. The value 87 us is obtained due to the minimum sensor exposure time. For a value of 600 us, a pixel saturation effect is obtained. It was decided to extend the set to include images with saturation because this negative phenomenon could also be observed in industrial applications (Figure 13c). Saturation causes a clipping of the pixel intensity values in the digital image related to the analogue light signal. As a consequence, the contrast in the digital image is reduced.  
Figure 14 shows the AFE values as a function of the sensor exposure time. The results for both methods of determining the focus plane are within a range of up to 2. The exception is the SSTD operator, which for low-contrast images--exposure times of 87 us and 100 us--obtained an error of more than 15. For the other operators, the error values are small enough that no trend of AFE depe  
Figure 12: Values of RMSE as a function of the window size used for both methods of determining the focus plane.  
Noticeable differences can be observed in Figure 15. It shows the value of the RSME error as a contrast function for both methods of determining the focus plane. A noticeable trend is that the error decreases with increasing contrast. This is a common trend for each of the operators considered. Operators achieve the best results with a variable kernel size. For the maximum method for times above 100 us, the RMSE error remains below 10. For exposure time above 200 us, it reaches values below 4. For the CoG method, performance improvement for the DSLT, DPTT, and SVAR operators is noticeable. For exposure time above 150 us, the error value falls below 5.  
The exception to the decreasing trend is the value obtained for 600 us. The error value increases. This effect is caused by the presence of saturated pixels, leading to a reduction in contrast in this image.  
The impact of contrast was examined indirectly by changing the sensor exposure time. Changes in contrast had a marginal effect on the AFE value. The exception was the SSTD operator, which significantly deviated in AFE error value for exposure times below 150 us. The low error values did not allow a trend in the effect of contrast on AFE to be observed.  
The RMSE value better shows the effect of contrast on the height map representation. As the contrast is increased up to 550 us, the value of the obtained RMSE decreases. The exception is the measurement for an exposure time of 600 us, for which the error increases. This is caused by the saturation of some of the pixels. The saturation reduces the contrast and lowers the quality of the representation of the scene by the height map.  
Figure 14: AFE values as a function of contrast (exposure time) for the operators selected for comparison.  
Figure 13: Recorded images of the metallic surface for different contrast: (**a**) exposure time 87 μs, (**b**) exposure time 300 μs, (**c**) exposure time 600 μs.