# Research on the Precision Measurement Method of Flat Screen Gap Based on Mobile Vision
## 4 Experiment and Analysis  
### Verification of the Algorithm using Key Parameters  
The key algorithm parameters in this paper are sub-block width \(d\) = 381, sub-block number \(k\) = 13, and the Hough transform discretization angle \(\theta_{h}\) = 0.01\({}^{\circ}\). When the following experimental verification is performed, the CPU frequency is 2.4 GHz and the running memory is 4 GB on a laptop computer.  
The outer border straight lines are recognized under various \(d\) values as the test data, and 320 correctly detected local images in the R region are used as the supervision data to confirm the accuracy of region extraction and segmentation. As illustrated in Figure 8, the influence of the sub-block width \(d\) on the error rate is achieved when the detection results show that the midpoint error of the straight line surpasses 2 pixels. The results show that the error rate can be reduced by increasing the sub-block width \(d\), and value that is too large would reduce the accuracy of pixel statistics. The maximum error rate is 0.3125% when \(311<d<441\). The accuracy of region extraction and segmentation in this algorithm is as high as 99.68%. The statistical region's statistics are prone to blemishes and scratches when \(d\) is too small. The properties of the target edge in the statistical window will be diminished when \(d\) is too large. The measurement error will rise in the two aforementioned situations.  
Different \(k\) values were tested to evaluate the average time consumption of region extraction and segmentation in 16 photos as well as the average time consumption of the algorithm in order to confirm the efficiency of region extraction and segmentation. Figure 9 displays the data and demonstrates that the time required for region extraction and segmentation increased linearly as the \(k\) value rose. When the \(k\) value is relatively small, the proportion of region extraction and segmentation in the total time of the algorithm is small, allowing the algorithm to spend the majority of its time generating high-precision iterative values. The time consumption of region extraction and segmentation in this paper was less than 60 ms, and the total processing time was less than 200 ms.  
To verify the high accuracy of adaptive line detection, this paper quantitatively simulated the local image of the R region according to the theoretical analysis of surface imaging and image characteristics. The position and angle of the outer edge of the image were known, and rotation transformation was used to derive theoretical values for various angles and positions of the outer edge. The algorithm in this paper was used to detect the external edge to obtain the detection value and compare the angle and position errors of the external edge's linear detection. The outcomes are displayed in Figure 10, which demonstrates that the angle error of the outer edge line detection was less than 0.01\({}^{\circ}\), and the position error was less than 0.2 pixels. Of course, the smaller the \(\theta_{h}\) value, the higher the accuracy of line detection and the smaller the detection error of the algorithm to the edge, but the execution speed of the algorithm will greatly increase.  
Figure 8: Effect of sub-block width on error rate.  
Figure 9: The influence of the sub-block number on the average time consumption of the algorithm.