# File-YOLO: A Faster, Lighter, and More Efficient Strategy for Autonomous Tower Crane Hook Detection
## 4 The Proposed Method
### The Coordinate Positioning and Tracking of Crane Hooks  
In the process of tower crane operations, the hooks are in motion. To ensure that the hooks are visible in the camera footage for operational purposes, after identifying the hooks in the camera footage, subsequent tracking of the hooks is achieved through gimbal control of the camera. By calculating the difference between the center position of the hook detection box and the center of the camera frame, the spherical camera's rotation is controlled to ensure that the hook remains at the center of the camera frame, thereby achieving intelligent hook tracking. Figure 8: Dyhead organically unifies three perceptual states. Figure 9: The architecture of the Dyhead. Step 1: Calculation of the center coordinates of the crane hook. The target detection algorithm provides the coordinates of the top-left and bottom-right corners of the detection box. By calculating the coordinates of the center point of the detection box, it is approximated as the center point coordinates of the crane hook. Equations (5) and (6) illustrate the method used in this paper to compute the center point coordinates. \[center\_point\_x=left+(right-left)/2 \tag{5}\]  
\[center\_point\_y=top+(bottom-top)/2 \tag{6}\]  
In the equations, \((center\_point\_x,center\_point\_y)\) represents the approximate 2D coordinates of the center point of the crane hook in the frame, (top, left) denotes the 2D coordinates of the top-left corner of the detection box in the frame, and (bottom, right) represents the 2D coordinates of the bottom-right corner of the detection box in the frame. As shown in Figure 10, the red dot within the detection box represents the central point, abbreviated as CP (Center Point). The values in parentheses denote the two-dimensional coordinates representing the center point of the crane hook within the frame. Step 2: Calculation of the difference. By utilizing the image. Shape attribute within the OpenCV library to acquire the height and width of the spherical camera's captured image, denoted as height and width, respectively. The coordinates of the center point in the camera frame are calculated as shown in Equations (7) and (8). The difference between the center point coordinates of the crane hook and the center point coordinates of the camera frame is expressed in (9) and (10). \[Center\_x=width/2 \tag{7}\]  
\[Center\_y=height/2 \tag{8}\]  
\[\Delta x=Center\_x-center\_point\_x \tag{9}\]  
\[\Delta y=Center\_y-center\_point\_y \tag{10}\]  
In the equations, \((Center\_x,Center\_y)\) represents the coordinates of the center point in the camera frame, while \(\Delta x\) and \(\Delta y\) denote the differences between the horizontal and vertical coordinates of the crane hook's center point and camera frame's center point, respectively. Step 3: Pan-Tilt Control for Automatic Tracking of the Crane Hook. In this work, we employed a spherical camera from Hikvision to capture images of the crane hook. Based on the control protocol, corresponding instructions are continuously  
Figure 10: The two-dimensional coordinate positioning of a tower crane hook. transmitted to the serial port via the transmission of coordinate differences, enabling automated tracking of the crane hook. Equation (11) illustrates the scheduling strategy for the camera. \[T=\left\{ \begin{array}{ll}1&\Delta x>0,\\ 2&\Delta x<0,\\ 3&\Delta y>0,\\ 4&\Delta y<0,\\ 0&\text{else}\end{array} \right. \tag{11}\]  
\(T\) denotes the direction of control for the pan-tilt unit. If \(T\) equals 1, it instructs the pan-tilt unit to move horizontally to the left; if \(T\) equals 2, it directs the pan-tilt unit to move horizontally to the right. Similarly, if \(T\) equals 3, it commands the pan-tilt unit to move vertically upwards; if \(T\) equals 4, it instructs the pan-tilt unit to move vertically downwards. When \(T\) equals 0, it indicates that the pan-tilt unit should remain stationary. Through the camera scheduling strategy, the pan-tilt unit's movements are judiciously adjusted to achieve automatic tracking of the crane hook.