# Optimization Method of Square Hole Measurement Based on Generalized Point Photogrammetry
## 5 Experiments
### Engineering Experiment
#### 5.2.2 Results and Analysis of Engineering Experiments  
The camera resolution is 4096 \(\times\) 3000, with a pixel size of 3.45 \(\upmu\)m. The camera's intrinsic parameters are shown in Table 6. \(f\) represents the focal length, \(\Delta x\) and \(\Delta y\) represent the offset of the image principal point, and \(k_{1}\) and \(k_{2}\) are the radial distortion parameters. Figure 6: Images of the model. Figure 7: Experimental process. The initial spatial coordinates of the four corner points of the square hole calculated through traditional photogrammetry are shown in Table 9.  
The results of straight line fitting at the edge of the square hole are shown in Figure 8.  
The accurate spatial coordinates of the four corner points of the hole calculated through the generalized point adjustment mathematical model are shown in Table 10. \begin{table}
\begin{tabular}{c c c c c c} \hline  & \(f\) (mm) & \(\Delta x\) (mm) & \(\Delta y\) (mm) & \(k_{1}\) & \(k_{2}\) \\ \hline Camera 1 & 34.58 & \(-0.1833\) & 0.0761 & \(-0.0785\) & 1.5814 \\ Camera 2 & 34.45 & \(-0.0187\) & \(-0.1622\) & \(-0.0058\) & 0.2803 \\ \hline \end{tabular}
\end{table} 
Table 6: Camera intrinsic parameters. \begin{table}
\begin{tabular}{c c c} \hline
**Points** & **First Image** & **Second Image** \\ \hline Corner 1 & (\(-7.1382\), \(22.1317\)) & (\(-20.8293\), \(399.0914\)) \\ Corner 2 & (\(-18.0413\), \(39.2535\)) & (\(-324.7541\), \(410.0443\)) \\ Corner 3 & (\(-12.3197\), \(32.7147\)) & (\(-289.9472\), \(85.0483\)) \\ Corner 4 & (\(-1.3404\), \(14.8592\)) & (\(-50.1016\), \(43.9029\)) \\ \hline \end{tabular}
\end{table} 
Table 8: Image plane coordinates of the four corner points. Figure 8: Line fitting. \begin{table}
\begin{tabular}{c c c} \hline
**Points** & **X (mm)** & **Y (mm)** & **Z (mm)** \\ \hline Corner 1 & 1.5321 & 133.2612 & 105.0325 \\ Corner 2 & 134.5622 & 135.6421 & 103.5761 \\ Corner 3 & 132.5415 & 3.5725 & 102.0712 \\ Corner 4 & 3.0754 & \(-1.7523\) & 102.1672 \\ \hline \end{tabular}
\end{table} 
Table 9: Initial spatial coordinates of the four corner points. For engineering experiments, the experimental effect will be evaluated from three aspects: the distance between two points, the perpendicularity of the square hole edge, and the flatness of the fitting plane. As shown in Table 11, the measurement results of the side length of the square hole using the traditional method (TM) and the proposed method (PM) in this article are presented. As shown in Table 12, the measurement results of the perpendicularity between the adjacent sides of the square hole using the traditional method and the method proposed in this article are presented. The result is represented by vector cosine. From Table 11, it can be seen that the maximum length error measured by traditional methods exceeds five millimeters. The length error measured by the proposed method for square holes is very small, and it is close to the true value of the hole after retaining four decimal places. From Table 12, it can be seen that the maximum cosine value of the angle between adjacent sides measured by traditional methods reaches 5.0527. The cosine error of the angle calculated by the measurement method proposed in this article is very small, approaching zero after retaining four decimal places. Using square hole coordinates to fit a plane, the sum of the distances from the two points farthest from the plane on both sides to the plane is the flatness. As shown in Figure 9, it is a schematic diagram for calculating flatness. The gray area represents the fitted plane, the red points are located above the plane, and the blue points are located below the plane. The farthest distance from the point above the plane is \(d_{1}\), and the farthest distance from the point below the plane is \(d_{2}\). The flatness is the sum of \(d_{1}\) and \(d_{2}\). The traditional method calculates the flatness as 0.6532, while the flatness calculated by the method proposed in this article is 0.0000 after retaining four decimal places.