## 3 Comparison of Image Estimation Functions  
Different scenes, as captured by the EOTS, are shown in Figure 3. In the experiment, the CCD was first adjusted to find the correct focus position for each case. Then, the stepper motor was controlled to give a fixed clockwise and counterclockwise rotation angle, leading to a fixed moving distance of  
Figure 1: (a) Auto-focus diagram of a Cassegrain telescope system; (b) Hardware experiment system. Figure 2: Auto-focus search process. IEF, image estimation function. the primary mirror. When the CCD camera was in front of, located at, and behind the image plane, 17 pictures were obtained continuously for each of the scenarios shown in Figure 3.  
In our auto-focus process, the sharpness of the image captured by the CCD camera should be estimated firstly. Currently, the most commonly used image intelligibility estimation functions (IEF) are mainly performed in the spatial and frequency domains. Spatial domain IEFs include the Tenengrad function [25], Brenner function [26], variance function, and Laplace function [27], while the frequency domain IEFs mainly include the wavelet function and statistical gray level entropy functions [28]. Compared to blurred images, clear images have more detailed information in the spatial domain, and the gray scale gradients of adjacent pixels are relatively large. A suitable image function supports us in determining whether the image is focused or not, which is a pivotal step in the auto-focus process [29]. In order to provide an accurate comparison of the focusing sensitivity, the estimation function was normalized by the ratio of the peak deviation to the maximum value of the function and defined as  
\[S=\frac{E_{max}-E_{min}}{E_{max}} \tag{1}\]  
where \(S\) is the normalized function value, and \(E_{\max}\) and \(E_{\min}\) are the maximum and minimum values, respectively, of the original estimation function. (1) Tenengrad Function  
The Tenengrad function takes the sum of the squares of image gradients as the evaluation index, and the gradients include horizontal and vertical directions [30]. The Sobel operator and image convolution are used to realize the function, which is written as  
\[E=\sum_{x}\sum_{y}\left[S(x,y)\right]^{2} \tag{2}\]  
where \(S(x,y)\) is the convolution of the pixel value of point \((x,y)\) and the Sobel operator, and it can be calculated as  
\[S(x,y)=\sqrt{G_{x}^{2}(x,y)+G_{y}^{2}(x,y)} \tag{3}\]  
Figure 3: Different experimental scenes of the electro-optical tracking system (EOTS) auto-focus: (**a**) Windows of distant buildings, (**b**) Air conditioner outdoor unit, (**c**) Billboard, (**d**) Pipes on the roof, (**e**) Tower crane at a construction site, (**f**) Roof decoration of tall buildings, (**g**) Leaves in the distance, (**h**) Top railing of a building. where \(Gx\) and \(Gy\) are the horizontal and vertical gradients extracted by the Sobel operator, respectively. Table 1 lists the Tenengrad 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 values. (2) Brenner Function  
The traditional Brenner function can extract the gradient information by calculating the gray difference between two adjacent pixels. It is the simplest method of gradient image evaluation. It can be expressed as  
\[E=\sum_{x}\sum_{y}{[f(x+2,y)-f(x,y)]^{2}}. \tag{4}\]  
In order to ensure the focal length of the EOTS, the field-of-view angle is very small, so even if the distance is several kilometers, the field of view of telescope observation is also very small, as only a small part of the object is the target. If this part of the object does not have obvious texture, the Brenner function only contains the gradient information in the transverse direction and does not provide statistics on the longitudinal gradient; this may cause that part of the edge information to be lost, which affects the focusing accuracy.