# Pointer Meter Reading Recognition Based on YOLOv11-OBB Rotated Object Detection
## 3 Materials and Methods
### Implementation of Meter Pointer Coordinate Mapping by Template Matching  
#### 3.2.1 Standard Model Construction of Pointer Meter  
The construction of the standard model for the pointer table involves two primary steps: model registration and calibration.  
(1) Model Registration  
During the registration stage of the pointer meter model, the first step involves capturing clear frontal images of diverse pointer meters to serve as template images, as shown in Figure 3. These provide templates for variations in the inner diameter among different pointer meters. By optimizing the minRadius parameter, the model effectively accommodates these differences, ensuring precise pointer recognition. The outer diameter of the pointer is determined by the scale point, with detailed scale information acquired during subsequent calibration and fitting procedures. The standard model image is then loaded and uniformly resized to \(500\times 500\) pixels to ensure template consistency and eliminate potential interference arising from variations in image sizes. Figure 3 shows the processed standard model image for comparative analysis, further enhancing method stability across different scenarios and improving model recognition accuracy.  
(2) Calibration and fitting of scale  
Calibration and fitting of scale are crucial for instrument recognition and involve three key steps: recording the interactive rectangular frame coordinates, performing circular fitting and angle calculation, and determining the pointer area.  
* Interactive recording of rectangular frame coordinates: Real-time tracking of mouse interaction enables the automatic conversion of drawn rectangular frames into precise center mark points on a scale. This enhances the efficiency and accuracy of scale positioning, as illustrated in Figure 4a, and supplies crucial data for subsequent calculations and analyses.  
Figure 4: (**a**) The red dots represent scale values; (**b**) The circle of scale fitting; (**c**) Pointer area determined by scale and inner diameter.  
Figure 3: Different types of pointer template images. (**a**) Template images 1; (**b**) Template images 2; (**c**) Template images 3; (**d**) Template images 4.  
Circle fitting and angle calculation: Circle fitting employs the least squares method using the coordinate data of all calibration points to determine the center coordinates and radius, as illustrated in Figure 4b. This process is crucial for accurately defining the pointer's center of rotation. Following this, the center coordinates of the circle are established, and the offset and angle of each rectangular box's center point relative to the circle's center are computed to verify that the angle value conforms to the specified range.
* Pointer area determination: The circle's radius from the fitting process is utilized as the outer radius for the pointer area. By integrating this with the predetermined inner radius parameter, as illustrated in Figure 4c, the extent of the pointer area can be precisely established.  
Upon completion of the calibration process, essential parameters, including the group of rectangle center points, center coordinates, array of angles, mask image, original image, initial angle offset, and calibration array, are stored in a binary file.