## 3 Comparison of Image Estimation Functions
Therefore, based on the Brenner function, the longitudinal gray gradient is added, and the calculation method is as follows [31]:  
\[E=\sum_{x}\sum_{y}{((f(x+2,y)-f(x,y))^{2}+(f(x,y+2)-f(x,y))^{2})}. \tag{5}\]  
Table 2 lists the Brenner function evaluation values of the focus position and the position of the front and back three steps in eight scenes. The fourth row of data presents the focus position function value. (3) Variance  
A clear image has a larger gray scale difference than a fuzzy image, which shows that the variance of the image is larger, so the variance function is usually used to represent the gradient information of the image. The variance function can be expressed as \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Scene a** & **Scene b** & **Scene c** & **Scene d** & **Scene e** & **Scene f** & **Scene g** & **Scene h** \\ \hline
0.7430 & 0.9486 & 0.8742 & 0.8537 & 0.8926 & 0.9478 & 0.8835 & 0.9784 \\
0.7636 & 0.9522 & 0.8851 & 0.9236 & 0.9234 & 0.9585 & 0.9127 & 0.9922 \\
0.9685 & 0.9987 & 0.9295 & 0.9412 & 0.9537 & 0.9635 & 0.9648 & 0.9993 \\
1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\
0.8469 & 0.9657 & 0.9091 & 0.9318 & 0.9618 & 0.9697 & 0.9730 & 0.9458 \\
0.7962 & 0.9274 & 0.8611 & 0.8662 & 0.9062 & 0.9256 & 0.9123 & 0.9176 \\
0.7406 & 0.8486 & 0.8428 & 0.7475 & 0.8275 & 0.8925 & 0.8403 & 0.8992 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The change of the Brenner function during focusing in different scenes. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Scene a** & **Scene b** & **Scene c** & **Scene d** & **Scene e** & **Scene f** & **Scene g** & **Scene h** \\ \hline
0.7430 & 0.9486 & 0.8742 & 0.8537 & 0.8926 & 0.9478 & 0.8835 & 0.9784 \\
0.7636 & 0.9522 & 0.8851 & 0.9236 & 0.9234 & 0.9585 & 0.9127 & 0.9922 \\
0.9685 & 0.9987 & 0.9295 & 0.9412 & 0.9537 & 0.9635 & 0.9648 & 0.9993 \\
1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\
0.8469 & 0.9657 & 0.9091 & 0.9318 & 0.9618 & 0.9697 & 0.9730 & 0.9458 \\
0.7962 & 0.9274 & 0.8611 & 0.8662 & 0.9062 & 0.9256 & 0.9123 & 0.9176 \\
0.7406 & 0.8486 & 0.8428 & 0.7475 & 0.8275 & 0.8925 & 0.8403 & 0.8992 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The change of the Tenengrad function during focusing in different scenes. \[E=\sum_{x}\sum_{y}\left[f(x,y)-u\right]^{2} \tag{6}\]  
where \(u\) represents the average gray level of the image, and takes the following form:  
\[u=\frac{1}{MN}\sum_{x}\sum_{y}f(x,y) \tag{7}\]  
where \(M\) and \(N\) are the image dimensions. Table 3 lists the variance function evaluation values of the focus position and the position of the front and back three steps in eight scenes. The fourth row of data presents the focus position function value. (4) Laplace Function  
The Laplace function is also a commonly used method to evaluate the gray difference in an image, including 4-domain and 8-domain Laplace templates. In order to maximize the gradient information of the image, 8-domain Laplace templates were used in the experiment and can be obtained as  
\[E=\sum_{x}\sum_{y}\left| \begin{array}{l}8f(x,y)-f(x-1,y-1)-f(x-1,y)\\ -f(x-1,y+1)-f(x,y-1)-f(x,y+1)\\ -f(x+1,y-1)-f(x+1,y)-f(x+1,y+1)\end{array} \right|. \tag{8}\]  
Table 4 lists the Laplace function evaluation values of the focus position and the position of the front and back three steps in eight scenes. The fourth row of data presents the focus position function value. (5) Entropy  
The entropy function is based on the premise that the clearer the image is, the more information it contains--that is, the greater the entropy of the image--so the entropy function can also be used to reflect the clarity of the image. The entropy function is calculated by  
\[E=\sum_{x}\sum_{y}-f(x,y)\ln[f(x,y)]. \tag{9}\]