## 3 Overall System
### Visual Recognition System
#### 3.1.3 Intersection Point Recognition System
\[\rho=x\text{cos}\theta+y\text{sin}\theta \tag{5}\]  
where \((x,y)\) represents a pixel in the image, \(\rho\) is the perpendicular distance from the origin of the image coordinates to the line, and \(\theta\) is the angle between the perpendicular line and the x-axis. The Hough Transform detects a line by converting each edge point into a curve in the parameter space. When voting points accumulate in the parameter space to form a peak, this indicates that a line has been detected. In the standard Hough Transform, each edge point votes across the entire parameter space, resulting in high computational cost. To improve efficiency, this study adopts the Probabilistic Hough Transform (PHT). Unlike the standard method, PHT randomly samples a subset of edge points for voting, significantly reducing redundant computations. Moreover, PHT not only estimates line parameters but also directly detects the start and end points of line segments, enabling the results to be visualized as actual segments in the image. This approach enhances both computational efficiency and detection clarity. The specific steps of the Probabilistic Hough Transform (PHT) are as follows. First, the pruned skeleton image is input, and the skeleton points are extracted. PHT detection is then performed only on these points. A random subset of edge points is selected for voting. For each selected point \((x_{0},y_{0})\), its corresponding curve in the parameter space \((\rho,\theta)\) is computed, and the associated cells in the accumulator are incremented. After voting, cells with the highest votes indicate that multiple points are aligned; on the same line, thus, a line is detected. Unlike the standard Hough Transform, PHT directly outputs the start and end points of the detected line segments by connecting the actual skeleton points, avoiding the unnecessary extension of lines to image boundaries and ensuring that the extracted segments accurately represent the true object contours. In the probabilistic Hough Transform, the accumulator is used to record the vote count for each line in the parameter space. Typically, the accumulator is a two-dimensional matrix \(A(\rho,\theta)\), where each cell corresponds to a specific combination of \(\rho\) and \(\theta\). In the standard Hough Transform, this matrix reserves a cell for every possible combination of \(\rho\) and \(\theta\), even though many cells may not receive any votes. This results in a large number of empty cells, especially when there are few line segments in the image. To address this issue, we utilize a hash table to efficiently store accumulator data, recording only the points that have received votes, which significantly reduces memory consumption. For the Hough Transform accumulator, the hash table maps the parameters \((\rho,\theta)\) to their corresponding vote counts. The key is the \((\rho,\theta)\) pair, and the value is the vote count. For example, if a particular \((\rho,\theta)\) cell has accumulated three votes, the hash table will store this as \(\{(\rho,\theta):3\}\). If no votes are cast for a particular cell, no corresponding record is made. A hash table provides constant time complexity for operations such as lookup, insertion, and deletion, ensuring that execution time remains nearly constant, regardless of data size. This makes it highly suitable for frequently updating vote counts in the accumulator. Moreover, the hash table stores only parameter pairs with actual votes, avoiding unneces  
Figure 6: Pruning process of skeletonized image for enhanced line detection. sary memory allocation for empty accumulator cells. This is especially beneficial in images with few lines, where most cells would otherwise remain empty. Additionally, the hash table enables the faster retrieval of high-vote cells, reducing traversal time and accelerating the detection process, particularly for large images or high-resolution accumulators. The flowchart of the Hough Transform detection process is shown in Figure 7.  
After the Hough Transform detection, multiple line segments are obtained.