Self-adaptive relay voltage plate row and column coordinate detection method
By employing an adaptive relay voltage board row and column coordinate detection method, and utilizing asymmetric feature center compensation and multi-criteria recursive line segment merging technology, the robustness and accuracy issues of relay voltage board detection in existing technologies are resolved, achieving high-precision row and column alignment in complex industrial environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-01
AI Technical Summary
Existing row and column detection schemes suffer from poor robustness, inability to handle angle skew, and lack of class center compensation when dealing with relay voltage boards, resulting in disordered topology and an inability to achieve high-precision row and column alignment.
An adaptive relay plate row and column coordinate detection method is adopted. Through asymmetric feature center compensation, dynamic threshold generation based on neighborhood analysis, and multi-criteria recursive line segment merging technology, accurate spatial row and column detection of the plate array is achieved.
It significantly improves the robustness and detection accuracy of topology extraction, can cope with complex industrial environments, ensures that feature points are accurately merged into the corresponding row and column sequences, avoids misconnection or disconnection, and achieves accurate conversion of spatial physical coordinates to row and column logical numbers.
Smart Images

Figure CN121962855A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and industrial automation inspection, specifically relating to an adaptive relay plate row and column coordinate detection method. Background Technology
[0002] In the field of automated operation and intelligent maintenance of power systems, relay panel status identification is a crucial link in ensuring the safe operation of the power grid. Traditional relay panel inspection mainly relies on manual on-site visual verification, which is not only labor-intensive but also susceptible to fatigue and subjective factors, leading to missed detections or misjudgments. In recent years, deep learning-based target detection technologies (such as the YOLO model) have been widely applied to relay panel status identification systems, enabling automated detection of relay panel location, type (square or round), color (red, yellow, white), and on / off status ("on" or "off"). However, in actual relay protection cabinet inspection scenarios, identifying the status of only a single relay panel is insufficient. To achieve logical verification and consistency evaluation of the power system, the system must be able to accurately identify the specific row and column position information of the relay panel in the array, thereby establishing a one-to-one correspondence between the visual inspection results and the logical points of the dispatching system.
[0003] In achieving this goal, existing row and column recognition technologies face extremely severe challenges: First, the complex industrial environment leads to severe geometric distortion. Substation cabinets are usually densely packed, and inspection robots or handheld terminals often struggle to obtain an ideal view of the pressure plate array when capturing images. Due to limitations in the shooting angle, severe perspective distortion often accompanies the images, causing the pressure plate array, which is originally linearly arranged in physical space, to appear as tilted, convergent, or nonlinear in the image coordinate system. Traditional division methods based on fixed XY coordinate thresholds are prone to classifying adjacent rows of pressure plates into the same row or classifying pressure plates in the same column as multiple columns when faced with tilts exceeding a certain angle, resulting in complete disruption of the topological relationships. Second, there is asymmetry between the visual features of components and their logical alignment centers. There are many types of pressure plates, and the visual center of gravity of different types of pressure plates (such as rotary pressure plates and plug-in pressure plates) will shift significantly in the "throw-in" or "retracted" state. The detection boxes generated by deep learning models typically encompass the entire outer contour of the pressure plate. However, when aligning rows and columns, the mechanical rotation center of the pressure plate or the base connection point is the true logical alignment reference. If the geometric center of the detection box is directly used for row and column aggregation, the center of gravity shift caused by state switching will be converted into geometric noise, severely interfering with the fitting accuracy of the row and column axes. Furthermore, the incompleteness of the detection results places high demands on topology reconstruction. In practical applications, pressure plates may be missed in the image due to uneven lighting, metal reflections, or cabinet obstruction. When a "node" in the array is missing, simple neighbor point growth algorithms often fail due to chain breakage. In addition, there may be interference objects such as silkscreen printing and bolts on the cabinet, which may be misdetected as pressure plates. These "outliers" will greatly interfere with the automatic search and generation of row and column axes. Finally, the system lacks an adaptive inference mechanism for industrial array characteristics. The spacing and arrangement density of the pressure plates vary among different specifications of relay protection cabinets. Existing technologies mostly use manually preset fixed spacing parameters, lacking an intelligent processing solution that can dynamically perceive target density based on image content, adaptively adjust aggregation threshold, and perform closed-loop verification by combining global boundary contours (such as the convex hull edge of the pressure plate array).
[0004] In summary, existing row and column detection schemes suffer from poor robustness, inability to handle angular skew, and lack of category center compensation when dealing with industrial targets such as relay voltage boards, which have strong topological constraints, high-precision alignment requirements, and complex operating conditions. Therefore, developing a row and column detection method that can integrate component category characteristics, adapt to spatial distortion, and possess global geometric reasoning capabilities is of significant practical importance for improving the intelligence level and reliability of pressure plate status recognition systems. Summary of the Invention
[0005] To address the aforementioned issues, this invention discloses an adaptive relay plate row and column coordinate detection method. Through asymmetric feature center compensation, dynamic threshold generation based on neighborhood analysis, and multi-criteria recursive segment merging technology, it achieves accurate spatial row and column detection of the relay plate array.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows:
[0007] An adaptive relay board row and column coordinate detection method specifically includes the following steps:
[0008] Step 1. Obtain the initial detection box coordinates and category of the target plate in the image using a deep learning object detection model;
[0009] Step 2. Perform asymmetric center point compensation preprocessing on different pressure plates according to category attributes to establish characteristic center points that conform to different state categories of pressure plates;
[0010] Step 3. By calculating the minimum neighborhood distance of the global feature center point, dynamically derive the point-line merging distance and angle threshold applicable to the current image scale;
[0011] Step 4. Construct a global convex hull using all feature center points, extract boundary vertices and perform edge point cloud completion to establish a physical contour reference for the voltage plate array;
[0012] Step 5. Based on the multi-criteria decision conditions of directional consistency and distance proximity, recursively fit and extract the row and column dual-axis framework, and aggregate the fragmented point set into stable row and column candidate main axes;
[0013] Step 6. Extract mutually perpendicular dual-axis clusters using the maximum angle search algorithm, and automatically determine row and column attributes based on slope distribution to decouple master and slave axis directions;
[0014] Step 7. Project the target feature points to the intersection of the two axes to achieve a precise conversion from spatial physical coordinates to row and column logical numbers, thereby outputting the row and column logical index of the target.
[0015] As the target determinant detection method for relay plate identification according to the present invention, in step 1, the acquired relay plate image is input into a pre-trained YOLO (You Only Look Once) convolutional neural network. The YOLO model predicts the bounding box coordinates of the relay plate target through a single forward propagation. Confidence level and category labels The target set of the output This provides the raw spatial data for subsequent geometric aggregation. The bounding box coordinates output by the YOLO convolutional neural network. The precise physical coverage area of each relay plate target in the image is defined: the coordinate system is typically based on the top-left corner of the input image as the origin, with horizontal coordinates extending to the right. Positive axis direction, vertically downward The positive direction of the axis is denoted as . For horizontal boundary constraints, This represents the minimum x-coordinate (left boundary) of the target bounding box of the pressure plate in the image coordinate system. It represents its maximum x-coordinate (right boundary). Vertical boundary constraints The minimum ordinate (upper boundary) of the target bounding box of the pressure plate. It represents its maximum ordinate (lower boundary).
[0016] As the target matrix detection method for voltage plate identification described in this invention, step 2 does not directly calculate the midpoint of the horizontal and vertical coordinates, but instead performs offset correction for voltage plates of different state categories. Let the corrected feature center point be... The initial detection box coordinates are ,
[0017] ;
[0018] For the x-axis Introducing asymmetric offset weights :
[0019] ;
[0020] As the target matrix detection method for relay board identification described in this invention, in step 3, in order to enable the algorithm to adapt to scale changes caused by different shooting distances, this method calculates the global minimum neighborhood distance and dynamically derives core parameters such as the point-line merging distance threshold, the line-line merging distance threshold, and the line-line merging angle threshold.
[0021] Calculate any two feature center points Euclidean distance: Coordinates are , Coordinates are :
[0022] ;
[0023] Search for the minimum neighborhood distance of each point and take its global minimum. ,according to The following core parameters are dynamically derived: , , For custom parameters:
[0024] Distance threshold for dot-line merging Used to determine whether a point belongs to a fitted line;
[0025] Line merging distance threshold Used to determine whether two line segments can be merged;
[0026] Line merging angle threshold Used to determine the consistency of line segment direction.
[0027] As the target matrix detection method for relay board identification described in this invention, in step 4, for a feature center point set containing 3 or more targets... This method calculates the minimum circumscribed convex polygon to lock the outermost contour of the pressure plate array. Within this polygonal structure, a set of line segments consisting of a series of adjacent vertex pairs is defined. Each line segment Given the coordinates of two vertices and The only certainty.
[0028] For non-vertices, calculate non-vertices. A straight line segment to any adjacent vertex of the convex hull distance To ensure calculation accuracy under various complex viewpoints (horizontal, vertical, or arbitrary tilt), the system performs the following classification distance calculation:
[0029] (1) Determination of perpendicular boundary: If the x-coordinates of the two endpoints of the line segment are equal (i.e., If the boundary is perpendicular, then the distance from the point to the line is considered the boundary. for:
[0030] ;
[0031] (2) Horizontal boundary determination: If the ordinates of the two endpoints of a line segment are equal (i.e., ... If the boundary is horizontal, then the distance from the point to the line is considered horizontal. for:
[0032] ;
[0033] (3) General slope boundary determination: For a boundary with any slope angle, the system first uses the least squares method to perform univariate linear fitting on the two endpoints of the line segment to establish the straight line equation. Then, the general formula for the distance from a point to a line is used to calculate:
[0034] ;
[0035] in, The fitted slope, The intercept is given. This formula eliminates errors caused by coordinate system scaling, ensuring the objectivity of distance measurements.
[0036] The calculated geometric distance Distance threshold for merging with dynamically generated point lines in step 3 Perform quantitative comparison: Judgment criteria: If satisfied , and point Not the line segment The endpoints, then the point The index is merged into the member list of the boundary line segment, thereby expanding the simple line segment that originally consisted of only two vertices into a "point cloud line segment" containing multiple collinear points. This makes the edge reference line more resistant to noise and statistically significant, effectively mitigating the impact of single vertex offset on global boundary fitting.
[0037] As the target determinant detection method for relay plate identification described in this invention, in step 5, a global boundary reference system is established to calculate the set of feature center points of all detected targets. The spatial extrema are used to establish the global bounding rectangle boundary of the array:
[0038] Minimum x-coordinate With the largest x-coordinate (Define the left and right boundaries);
[0039] Minimum y-coordinate with the maximum ordinate (Define the upper and lower boundaries).
[0040] By traversing each line segment to be processed Calculate its physical intersection with the global boundary. To ensure the robustness of the mathematical calculations, the following three cases are handled:
[0041] (1) Determination of perpendicular line segments (x-coordinate is constant): If the x-coordinate of the line segment point set satisfies This line is determined to be strictly perpendicular. In this case, the line does not pass through the left or right boundaries; its intersection with the top and bottom boundaries is directly identified as:
[0042] , ;
[0043] (2) Horizontal line segment determination (y-coordinate constant): If the y-coordinate of the line segment point set satisfies It is determined to be a strictly horizontal line. Its intersection points with the left and right boundaries are locked as follows:
[0044] , ;
[0045] (3) Determination of general inclined line segments (regression projection): For line segments without special orientation, first use the least squares method to fit the straight line. And calculate its mathematical intersections with the four boundary extension lines:
[0046] Intersection of vertical boundaries: and ,in .
[0047] Intersection of horizontal boundaries: and ,in .
[0048] When processing geometric boundary intersections, a composite screening mechanism combining dynamic tolerance filtering and spatial aggregation deduplication is employed. This aims to accurately extract valid points located on the rectangular boundary from the candidate intersections generated by mathematical calculations, while eliminating duplicate points that are too close together. To handle minor fluctuations in the calculation process, a tolerance factor is introduced during verification. .
[0049] For the intersection points calculated on the left and right vertical boundaries, their ordinates and It must fall within the vertical span of the rectangle Within its tolerance range, it serves as a vertical boundary check. That is, it satisfies:
[0050] ;
[0051] For the intersection points calculated on the upper and lower horizontal boundaries, their x-coordinates It must fall within the horizontal span of the rectangle Within its tolerance range, horizontal boundary verification is performed. That is, it satisfies:
[0052] ;
[0053] After a point is determined to be "valid," spatial deduplication logic is executed to ensure the sparsity and representativeness of the point set. The current candidate point is compared with every existing point in its set, and the Euclidean distance between them is calculated. If the candidate point coordinates are... The coordinates of a point within the point set are Then the distance for:
[0054] ;
[0055] Introducing a spatial neighborhood threshold If the distance between a candidate point and any point in the point set is... Less than the threshold This indicates that there are already representative sampling points in the area, so the current candidate point is discarded. The distance between the candidate point and all points in the existing point set... All are greater than or equal to the threshold If a point is found to be spatially unique, it is considered to be significantly unique and is added to the result set. The two points with the greatest Euclidean distance from each other are then calculated from this set. and These two points represent the local line segment. The highest span prediction in the global array is defined as the extended probe vector.
[0056] Next, we will analyze the candidate line segments. and The merging decision is performed based on the following four criteria:
[0057] (1) Calculate candidate line segments extension endpoint and arrive The distance between the lines is obtained by fitting the data using the least squares method. If the maximum distance... (Calculated from step 3), and is determined to be collinear.
[0058] (2) Determine candidate line segments and Do common points exist? Use the least squares method to check them separately. and Performing first-order linear regression yields two fitted lines. and Calculate the angle in radians between the two lines:
[0059] ;
[0060] If two line segments have a common point and their directions form an angle (As defined in step 3), perform the merge.
[0061] (3) Calculate candidate line segments Each point to Distance to fitted straight line, candidate line segment Each point to The distances between fitted lines are compared, and the minimum distance is retained. If two candidate line segments... and The minimum distance between points is less than And the included angle of direction is less than It is determined to be a neighboring segment.
[0062] (4) Calculate candidate line segments Each point to The distance to the fitted line; if the distance is less than... (Calculated from step 3), then the point falls on Within the neighborhood, detection Are there two or more points that fall within the range? If it exists in the neighborhood, perform a merge.
[0063] Once any of the above merger criteria are met, then Merging the point set And delete Through recursive iteration, until the global topology reaches a stable state, candidate principal axes that accurately cover the row and column paths are finally formed.
[0064] As the target matrix detection method for relay board identification described in this invention, wherein: in step 6, the candidate principal axes obtained from step 5 are... In the process, the line segment containing the most discrete points is selected as the initial seed line to determine the initial index. ,satisfy:
[0065] , ;
[0066] Initial seed line This ensures that the main axis construction begins in the region with the highest data signal-to-noise ratio and the most obvious features.
[0067] Define Boolean vectors Used to mark point sets Each point in the seed line is marked as "assigned" if it has already been assigned to a specific axis. In each iteration, the set of points closest to the current axis is first searched globally. The nearest unmarked point, calculate all unassigned points. (satisfy The distance to the fitted straight line from the current known set of axes is calculated. The point with the smallest distance is selected as the current "activation growth point." This "activation growth point" is the unassigned point closest to the current set of axes, ensuring that the axes extend along the geometrically most relevant path. This is achieved by utilizing... The Nearest Neighbor (KNN) algorithm retrieves local neighborhood structural features, constructs a neighborhood point set, calculates the Euclidean distance between the current "activated growth point" and the global point set, and sorts all calculated distances in ascending order:
[0068] ;
[0069] extract The nearest Euclidean distance neighbors are used as the local topological neighborhood set. :
[0070] ;
[0071] in, The value is determined by the adaptive parameter. To prevent index out-of-bounds errors due to insufficient point set size, the actual number of neighborhoods selected was determined. satisfy:
[0072] ;
[0073] ;
[0074] The final local topological neighborhood set is obtained. .against Candidate points in ,calculate A directed line segment formed by the growth target point and the current "activated growth point" as the growth starting point. This represents a potential direction in which the algorithm attempts to "grow outwards," and it needs to be verified whether this "growth direction" is consistent with the reference axis point set. The direction remains consistent, referencing the axis point set. The most recently updated axis is usually chosen as the reference. This is done to ensure the continuity of growth, that is, "growth following the most recent trend." Extract all unique point-to-point combinations. .for The vector generated by each pair of points in Calculate its relationship with the test vector The minimum deviation angle :
[0075] ;
[0076] ;
[0077] ;
[0078] Calculate the arithmetic mean of all combined angles as the final trend deviation. :
[0079] ;
[0080] Set minimum deviation angle threshold If satisfied If the condition is met, it is determined to be a geometric inflection point, and this point serves as the starting point of the new axis branch. If the condition is met... Then, the multi-criteria judgment condition in step 5 is executed to merge the topology. At the same time, a conflict detection mechanism is introduced. If a point is found to be assigned to multiple axes, it means that the current point is at a complex geometric intersection. The algorithm will mark the point and search for the next candidate point. If there is no conflict, the axis topology is officially updated, and the "activated growth point" and the neighborhood matching point are added. Marked as processed status ( When all points related to this geometric trend are marked as processed ( When no new points can be absorbed, the first main axis is completed. The final parsing description.
[0081] For the candidate principal axes obtained from step 5 Each line segment in Iterate through each point index it contains, and if the point exists simultaneously with... If a line segment is defined on a given axis, its index is recorded. Calculate the line segment. The span Number of axes :
[0082] ;
[0083] Select All line segments that reach the maximum value constitute the candidate set of the second principal axis. For the candidate set of the second principal axis For each line segment in the equation, calculate its relationship with the first principal axis. The included angle between all non-isolated point line segments Using the least squares method to perform first-order linear regression, two fitted lines are obtained. and Calculate the included angle in radians between the two lines and calculate the average included angle:
[0084] ;
[0085] ;
[0086] in yes The total number of valid line segments in the array. The retrieval process... The largest candidate line segment is used as the initial seed line for the second principal axis, ensuring that it is consistent with... For the line segment with the largest included angle and the densest concentration of points, repeat the analytical description of the first principal axis to complete the second principal axis. The evolution and construction of.
[0087] The calculated first principal axis Second spindle The average slope of each set of axes, for each pair of non-repeating points in each set of axes. The average slope of the formation : Coordinates are , Coordinates are :
[0088] ;
[0089] ;
[0090] when To avoid division by zero errors and preserve orthogonal characteristics, the algorithm is forcibly defined as follows: .in, This represents the number of effective point pairs. If the absolute value of the average slope... It is determined to be a set of horizontal axes, and the points of each axis are used. The coordinate mean values are sorted vertically (from top to bottom). If the absolute value of the average slope... It is determined to be a set of vertical axes, and the points of each axis are used. The coordinate mean values are sorted horizontally (from left to right).
[0091] As described in the present invention, the target matrix detection method for relay board identification includes: step 7 sorting the first principal axis set... With the second principal axis set Define them as row reference systems based on their horizon attribute ( ) and column reference system ( Iterate through each target point and retrieve its value from the first principal axis set. Or the second principal axis set Extract the corresponding row number from the index. and column number :
[0092] ;
[0093] ;
[0094] The bounding box coordinates of the predicted pressure plate target and category labels logical attributes Dimensional concatenation is performed to construct a preliminary structured feature vector. The lexicographical sorting operator is then invoked, setting the row index as a global first-level control variable to ensure all points are initially clustered by row number (from top to bottom); the column index is a local second-level control variable, ensuring points within the same row are arranged by column number (from left to right). This sorting mechanism logically achieves a scanning-style aggregation of discrete points in physical space: row aggregation is completed vertically using first-level keys, and element order is determined horizontally using second-level keys, ultimately yielding the precise row and column logical indices of the target.
[0095] The beneficial effects of this invention are as follows:
[0096] 1. This invention introduces a verification mechanism based on trend bias, which can effectively address global or local geometric distortions caused by changes in shooting angle in industrial field acquisition environments. When performing feature merging, the algorithm does not rely on absolute physical coordinate alignment, but instead quantifies the offset between candidate feature points and existing growth trends. This ensures that feature points can still be accurately merged into the corresponding row and column sequences in scenarios such as perspective distortion and image stretching, significantly improving the robustness of topology extraction.
[0097] 2. This invention demonstrates excellent anti-interference capabilities for complex scenarios with missing edges, non-uniform point cloud distribution, or local feature defects. By recursively fitting the main axis framework through multi-criteria judgment conditions, the algorithm can overcome spatial gaps and accurately assign logically related feature points to their respective logical axes. This mechanism effectively avoids the problem of misconnection or disconnection that traditional algorithms are prone to when facing incomplete edges, ensuring that even in the case of missing features, the complete row and column logical relationship can still be restored.
[0098] 3. This invention combines the target bounding box coordinates extracted by a deep learning model to establish a fast conversion path from image space to logical space. By using the precise physical coverage area defined by the bounding box as a spatial reference, it not only limits the effective range of feature search and reduces the complexity of global computation, but also provides a scale reference for subsequent adaptive distance constraints. This design enables the invention to significantly improve processing efficiency while ensuring detection accuracy, meeting the requirements for response speed in real-time monitoring environments, and realizing the accurate conversion of spatial physical coordinates to row and column logical numbers. Attached Figure Description
[0099] Figure 1 This is the overall flowchart of the present invention;
[0100] Figure 2 This is a schematic diagram of edge completion based on global convex hull in this invention;
[0101] Figure 3 This is a structural diagram of the multi-criteria recursive line segment fitting evolution process in this invention;
[0102] Figure 4 This is a block diagram of the multi-criteria row and column main axis iterative search and merging logic in this invention;
[0103] Figure 5 This is a comparison diagram of the effects of mapping physical coordinate space to logical matrix index in this invention;
[0104] Figure 6 These are relay board images and corresponding dual-axis cluster experimental results when dealing with local array defects and non-uniform distribution in the embodiments of the present invention.
[0105] Figure 7 These are relay board images and corresponding dual-axis cluster experimental results when processing large-scale arrays with distortion and coordinate perturbation in embodiments of the present invention.
[0106] Figure 8 These are relay plate images and corresponding dual-axis cluster experimental results when processing local arrangement distortion in embodiments of the present invention. Detailed Implementation
[0107] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.
[0108] Example 1
[0109] Reference Figure 1-5 As one embodiment of the present invention, an adaptive relay board row and column coordinate detection method is provided, such as... Figure 1 As shown, it includes the following steps:
[0110] S1: Target localization and category recognition: Use a pre-trained convolutional neural network to obtain the initial bounding box coordinates and category label of the pressure plate target;
[0111] Furthermore, the acquired images of the relay plate are input into a pre-trained YOLO (You Only LookOnce) convolutional neural network. The YOLO model predicts the bounding box coordinates of the plate target simultaneously through a single forward propagation. Confidence level and category labels The target set of the output This provides the raw spatial data for subsequent geometric aggregation.
[0112] S2: Feature center asymmetric correction: Asymmetric weight compensation is performed on the center of the detection box according to the category attribute to establish the feature center point that conforms to the different state category pressure plates;
[0113] Furthermore, to eliminate the deviation between the physical center and the visual center caused by visual perspective and the structure of the pressing plate itself, this step does not directly calculate the midpoint of the horizontal and vertical coordinates, but instead performs offset correction for pressing plates of different state categories. Let the corrected feature center point be... :
[0114] ;
[0115] For the x-axis Introducing asymmetric offset weights :
[0116] ;
[0117] In this embodiment, pressure plates (categories 9, 10, and 11) with specific physical offset characteristics are considered. The value is 0.75, and the other types of pressing plates... The value is set to 0.5. This step enhances the spatial collinearity of the same row of pressure plates by compensating for visual bias.
[0118] S3: Neighborhood Analysis and Dynamic Threshold Calculation: Dynamically determine the geometric merging scale threshold applicable to the current image environment through global minimum neighborhood distance search;
[0119] Furthermore, to enable the algorithm to adapt to scale changes caused by different shooting distances, this method dynamically derives core parameters by calculating the global minimum neighborhood distance. It calculates the center points of any two feature points. Euclidean distance:
[0120] ;
[0121] Search for the minimum neighborhood distance of each point and take its global minimum. ,according to The following core parameters are dynamically derived:
[0122] Distance threshold for dot-line merging : Used to determine whether a point belongs to a fitted line. In this example, The value is 3;
[0123] Line merging distance threshold Used to determine whether two line segments can be merged. In this example, The value is 3;
[0124] Line merging angle threshold Used for determining the consistency of line segment direction. In this example, The value is 10.
[0125] S4: Global boundary construction and edge completion: The outer contour of the array is locked using the convex polygon algorithm, and the complete edge point cloud sequence is restored based on distance constraints;
[0126] Furthermore, refer to Figure 2 For feature center point sets containing 3 or more targets This method calculates the minimum circumscribed convex polygon to lock the outermost contour of the pressure plate array. Within this polygonal structure, a set of line segments consisting of a series of adjacent vertex pairs is defined. Each line segment Given the coordinates of two vertices and The only certainty.
[0127] For non-vertices, calculate non-vertices. A straight line segment to any adjacent vertex of the convex hull distance To ensure calculation accuracy under various complex viewpoints (horizontal, vertical, or arbitrary tilt), the system performs the following classification distance calculation:
[0128] Vertical boundary determination: If the x-coordinates of the two endpoints of a line segment are equal (i.e., ... If the boundary is perpendicular, then the distance from the point to the line is considered the boundary. for:
[0129] ;
[0130] Horizontal boundary determination: If the ordinates of the two endpoints of a line segment are equal (i.e., ... If the boundary is horizontal, then the distance from the point to the line is considered horizontal. for:
[0131] ;
[0132] General slope boundary determination: For boundaries with arbitrary slope angles, the system first uses the least squares method to perform univariate linear fitting on the two endpoints of the line segment to establish the straight line equation. Then, the general formula for the distance from a point to a line is used to calculate:
[0133] ;
[0134] in, The fitted slope, The intercept is given. This formula eliminates errors caused by coordinate system scaling, ensuring the objectivity of distance measurements.
[0135] The calculated geometric distance Distance threshold for merging with dynamically generated point lines in step 3 Perform quantitative comparison: Judgment criteria: If satisfied , and point Not the line segment The endpoints, then the point The index is merged into the member list of the boundary line segment, thereby expanding the simple line segment that originally consisted of only two vertices into a "point cloud line segment" containing multiple collinear points. This makes the edge reference line more resistant to noise and statistically significant, effectively mitigating the impact of single vertex offset on global boundary fitting.
[0136] S5: Multi-criteria recursive line segment fitting and merging: Based on directional consistency and distance proximity, fragmented point sets are aggregated into stable row and column candidate main axes;
[0137] Furthermore, refer to Figure 3 Calculate the set of feature centers of all detected targets. The spatial extrema are used to establish the global bounding rectangle boundary of the array: ;
[0138] Minimum x-coordinate With the largest x-coordinate (Define the left and right boundaries);
[0139] Minimum y-coordinate with the maximum ordinate (Define the upper and lower boundaries).
[0140] By traversing each line segment to be processed Calculate the physical intersection point between it and the global boundary.
[0141] When processing geometric boundary intersections, a composite screening mechanism combining dynamic tolerance filtering and spatial aggregation deduplication is employed. This aims to accurately extract valid points located on the rectangular boundary from the candidate intersections generated by mathematical calculations, while eliminating duplicate points that are too close together. To handle minor fluctuations in the calculation process, a tolerance factor is introduced during verification. In this example, The value is 5.
[0142] For the intersection points calculated on the left and right vertical boundaries, their ordinates and It must fall within the vertical span of the rectangle Within its tolerance range, it serves as a vertical boundary check. That is, it satisfies:
[0143] ;
[0144] For the intersection points calculated on the upper and lower horizontal boundaries, their x-coordinates It must fall within the horizontal span of the rectangle Within its tolerance range, horizontal boundary verification is performed. That is, it satisfies:
[0145] ;
[0146] After a point is determined to be "valid," spatial deduplication logic is executed to ensure the sparsity and representativeness of the point set. The current candidate point is compared with every existing point in its set, and the Euclidean distance between them is calculated. If the candidate point coordinates are... The coordinates of a point within the point set are Then the distance for:
[0147] ;
[0148] Introducing a spatial neighborhood threshold In this example, The value is 10. If the distance between the candidate point and any point in the point set is... Less than the threshold This indicates that there are already representative sampling points in the area, so the current candidate point is discarded. The distance between the candidate point and all points in the existing point set... All are greater than or equal to the threshold If a point is found to be spatially unique, it is considered to be significantly unique and is added to the result set. The two points with the greatest Euclidean distance from each other are then calculated from this set. and These two points represent the local line segment. Predict the highest span in the global array. Next, analyze the candidate segments. and The consolidation decision is made based on the following four criteria. If any one of these criteria is met, the consolidation will proceed. Merging the point set And delete Through recursive iteration, until the global topology reaches a stable state, candidate principal axes that accurately cover the row and column paths are finally formed.
[0149] Line identity determination based on probe vectors: Calculate candidate line segments extension endpoint and arrive The distance between the lines is obtained by fitting the data using the least squares method. If the maximum distance... (Calculated from step 3), perform the merge.
[0150] Topology verification based on the angle between common points and directions: determining candidate line segments and Do common points exist? Use the least squares method to check them separately. and Performing first-order linear regression yields two fitted lines. and Calculate the angle in radians between the two lines:
[0151] ;
[0152] If two line segments have a common point and their directions form an angle (As defined in step 3), perform the merge.
[0153] Based on the directional consistency determination of the distance between neighboring points: calculate candidate line segments. Each point to Distance to fitted straight line, candidate line segment Each point to The distances between fitted lines are compared, and the minimum distance is retained. If two candidate line segments... and The minimum distance between points is less than And the included angle of direction is less than , execute the merge.
[0154] Point cloud density verification based on neighborhood coverage: Calculating candidate line segments Each point to The distance to the fitted line; if the distance is less than... (Calculated from step 3), then the point falls on Within the neighborhood, detection Are there two or more points that fall within the range? If it exists in the neighborhood, perform a merge.
[0155] S6: Dual-axis decoupling detection and orientation determination: Extracts clusters of mutually perpendicular dual axes through the maximum angle search algorithm, and automatically determines row and column attributes based on slope distribution;
[0156] Furthermore, refer to Figure 4 Candidate principal axes obtained from step 5 In the process, the line segment containing the most discrete points is selected as the initial seed line to determine the initial index. ,satisfy:
[0157] , ;
[0158] Define Boolean vectors Used to mark point sets Each point in the seed line is marked as "assigned" if it has already been assigned to a specific axis. In each iteration, the set of points closest to the current axis is first searched globally. The nearest unmarked point, calculate all unassigned points. (satisfy The distance to the fitted straight line from the current known set of axes is calculated. The point with the smallest distance is selected as the current "activation growth point." This "activation growth point" is the unassigned point closest to the current set of axes, ensuring that the axes extend along the geometrically most relevant path. This is achieved by utilizing... The Nearest Neighbor (KNN) algorithm retrieves local neighborhood structural features, constructs a neighborhood point set, calculates the Euclidean distance between the current "activated growth point" and the global point set, and sorts all calculated distances in ascending order:
[0159] ;
[0160] extract The nearest Euclidean distance neighbors are used as the local topological neighborhood set. :
[0161] ;
[0162] in, The value is determined by the adaptive parameter. In this instance, it is decided that... The value is 20. This is the actual number of neighborhoods selected to prevent index out-of-bounds errors due to insufficient point set size. satisfy:
[0163] ;
[0164] ;
[0165] The final local topological neighborhood set is obtained. ,in This represents the number of points in the global point set. (For...) Candidate points in ,calculate A directed line segment formed by the growth target point and the current "activated growth point" as the growth starting point. .from Extract all unique point-to-point combinations. For the reference axis point set The most recently updated axis is selected as the reference. For The vector generated by each pair of points in Calculate its relationship with the test vector minimum included angle :
[0166] ;
[0167] ;
[0168] ;
[0169] Calculate the arithmetic mean of all combined angles as the final trend deviation. :
[0170] ;
[0171] Set minimum deviation angle threshold In this example, the minimum deviation angle threshold The value is 18, if it satisfies If the condition is met, it is determined to be a geometric inflection point, and this point serves as the starting point of the new axis branch. If the condition is met... Then, the multi-criteria judgment condition in step 5 is executed to merge the topology. At the same time, a conflict detection mechanism is introduced. If a point is found to be assigned to multiple axes, it means that the current point is at a complex geometric intersection. The algorithm will mark the point and search for the next candidate point. If there is no conflict, the axis topology is officially updated, and the "activated growth point" and the neighborhood matching point are added. Marked as processed status ( When all points related to this geometric trend are marked as processed ( When no new points can be absorbed, the first main axis is completed. The final parsing description.
[0172] For the candidate principal axes obtained from step 5 Each line segment in Iterate through each point index it contains, and if the point exists simultaneously with... If a line segment is defined on a given axis, its index is recorded. Calculate the line segment. The span Number of axes :
[0173] ;
[0174] Select All line segments that reach the maximum value constitute the candidate set of the second principal axis. For the candidate set of the second principal axis For each line segment in the equation, calculate its relationship with the first principal axis. The included angle between all non-isolated point line segments Using the least squares method to perform first-order linear regression, two fitted lines are obtained. and Calculate the included angle in radians between the two lines and calculate the average included angle:
[0175] ;
[0176] ;
[0177] in yes The total number of valid line segments in the array. The retrieval process... The largest candidate line segment is used as the initial seed line for the second principal axis, ensuring that it is consistent with... For the line segment with the largest included angle and the densest concentration of points, repeat the analytical description of the first principal axis to complete the second principal axis. The evolution and construction of.
[0178] The calculated first principal axis Second spindle The average slope of each set of axes, for each pair of non-repeating points in each set of axes. The average slope of the formation :
[0179] ;
[0180] ;
[0181] when To avoid division by zero errors and preserve orthogonal characteristics, the algorithm is forcibly defined as follows: .in, This represents the number of effective point pairs. If the absolute value of the average slope... It is determined to be a set of horizontal axes, and the points of each axis are used. The coordinate mean values are sorted vertically (from top to bottom). If the absolute value of the average slope... It is determined to be a set of vertical axes, and the points of each axis are used. The coordinate mean values are sorted horizontally (from left to right).
[0182] S7: Topological Index Mapping and Result Output: Projects the target feature points to the intersection of the two axes, realizing the accurate conversion of spatial physical coordinates to row and column logical numbers;
[0183] Furthermore, the already sorted first axis set With the second principal axis set Based on its horizon attribute, each is defined as a row reference system. ) and column reference system ( Iterate through each target point and retrieve its value from the first principal axis set. Or the second principal axis set Extract the corresponding row number from the index. and column number :
[0184] ;
[0185] ;
[0186] The bounding box coordinates of the predicted pressure plate target and category labels logical attributes Perform dimensional concatenation to construct a preliminary structured feature vector. (Refer to...) Figure 5 This maps the set of feature centers in physical space to a sequence of logical matrix indices. For each target point, its index in the row and column reference frames is extracted. The lexicographical sort operator is invoked, and the row index is set as a global first-level control variable, ensuring that all points are first clustered by "row number" (from top to bottom); the column index is set as a local second-level control variable, ensuring that points are arranged by "column number" (from left to right) within the same row. This achieves the scanning and aggregation of discrete points in physical space and outputs the accurate row and column logical index of the target.
[0187] Example 2
[0188] This embodiment verifies the effectiveness of the adaptive relay plate row and column coordinate detection method described in this invention by performing row and column detection on three sets of scattered points with different topological features. The relay plate image and the corresponding dual-axis cluster experimental results are as follows: Figure 6-8 As shown, the dots represent feature center points, and the connecting lines represent the row and column main axis paths detected by the algorithm.
[0189] Reference Figure 6 This demonstrates the algorithm's ability to identify incomplete and non-uniformly distributed arrays. In this scenario, feature point 29 in the lower right corner is in a relatively isolated position at the edge of the array. Point 29 and the line clusters on the left (such as the column containing 3-8-6 or the column containing 2-25-11) have a certain detection space. Due to the local incompleteness in this area, point 29 is easily mistakenly merged into an adjacent column. The algorithm accurately verifies whether the directional deviation exceeds the minimum deviation angle threshold in step 6, and accurately assigns point 29 to the column containing 31-16-15 as the same axis. This verifies that the algorithm can quantitatively evaluate the coherence of the growth trend. When facing scenarios with incomplete arrays and non-uniform distributions, the algorithm can effectively isolate interfering columns that are physically close but have inconsistent logical trends through "geometric turning points," ensuring extremely high accuracy in row and column merging.
[0190] Reference Figure 7 This demonstrates the algorithm's ability to recognize large-scale arrays with distortion and coordinate perturbations. In this scenario, for a pressure plate image containing 43 feature center points, the algorithm constructs a topological mesh structure with 9 vertical and 5 horizontal lines. Although the point array exhibits a trapezoidal distortion that is "wider at the top and narrower at the bottom" in the image, the algorithm, through recursive line segment fitting evolution based on multi-criteria judgment conditions in step 5, is still able to adapt to the distortion trend and establish accurate vertical and horizontal topological paths. It successfully achieves precise mapping from an unordered set of feature points to a structured row and column index sequence. At the same time, by verifying whether the directional deviation exceeds the minimum deviation angle threshold in step 6, the feature points are accurately merged into the axis, verifying that the algorithm still has stable structural resolution capabilities when dealing with local array incompleteness under distortion conditions.
[0191] Reference Figure 8 This demonstrates the algorithm's ability to recognize local array distortions. In this scenario, the middle row (4-2-9-20-23-1-10-15) and the bottom row (7-5-11-18-17-22-13-14-0) in the array are not perfectly straight lines. However, the algorithm can still recover the complete edge point cloud sequence based on distance constraints. Through the multi-criteria judgment conditions in step 5, it performs recursive line segment fitting evolution to establish accurate longitudinal and lateral topological paths. At the same time, by verifying whether the directional deviation is within the minimum deviation angle threshold in step 6, it accurately merges the feature points into the axis. This verifies that even when there are small-range random jitters in the physical space and local array defects, the algorithm can still maintain the logical coherence of the topological structure and correctly extract the features of the entire row.
[0192] It should be noted that the above content merely illustrates the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. For those skilled in the art, various improvements and modifications can be made without departing from the principle of the present invention, and all such improvements and modifications fall within the scope of protection of the claims of the present invention.
Claims
1. An adaptive relay plate row and column coordinate detection method, characterized in that, Includes the following steps: Step 1. Obtain the initial detection box coordinates and category of the target plate in the image using a deep learning object detection model; Step 2. Perform asymmetric center point compensation preprocessing on different pressure plates according to category attributes to establish characteristic center points that conform to different state categories of pressure plates; Step 3. By calculating the minimum neighborhood distance of the global feature center point, dynamically derive the point-line merging distance and angle threshold applicable to the current image scale; Step 4. Construct a global convex hull using all feature center points, extract boundary vertices and perform edge point cloud completion to establish a physical contour reference for the voltage plate array; Step 5. Based on the multi-criteria decision conditions of directional consistency and distance proximity, recursively fit and extract the row and column dual-axis framework, and aggregate the fragmented point set into stable candidate row and column main axes; Step 6. Extract mutually perpendicular dual-axis clusters using the maximum angle search algorithm, and automatically determine row and column attributes based on slope distribution to decouple master and slave axis directions; Step 7. Project the target feature points to the intersection of the two axes to achieve a precise conversion from spatial physical coordinates to row and column logical numbers, thereby outputting the row and column logical index of the target.
2. The adaptive relay plate row and column coordinate detection method according to claim 1, characterized in that: In step 2, the initial detection box coordinates are set as follows: The coordinates of the feature center point are The calculation method is as follows: ; For the x-axis Introducing asymmetric offset weights : 。 3. The adaptive relay board row and column coordinate detection method according to claim 1, characterized in that: In step 3, the process of dynamically deriving the threshold includes: calculating the Euclidean distance between any two feature center points and extracting the global minimum neighborhood distance. The point-line merging distance threshold The line merging distance threshold The line merging angle threshold .
4. The adaptive relay plate row and column coordinate detection method according to claim 1, characterized in that: In step 4, the process of constructing the physical contour reference includes: calculating the minimum hull convex polygon of the feature center point set; and determining the distance from the feature center point to the boundary line segment of the convex polygon. If satisfied If so, the point is merged into the member list of the boundary line segment, and the line segment is expanded into a point cloud line segment through point cloud completion.
5. The adaptive relay board row and column coordinate detection method according to claim 1, characterized in that: In step 5, the global circumscribed rectangle boundary of the array is first established, and the minimum and maximum x and y coordinates are obtained. It then iterates through the line segments to be processed and calculates their physical intersections with the global boundary. A tolerance factor was introduced when processing effective feature points. For the intersection points calculated on the left and right vertical boundaries, their ordinates are... It must fall within the vertical span of the rectangle Within its tolerance range, for the intersection points calculated on the upper and lower horizontal boundaries, its x-coordinate It must fall within the horizontal span of the rectangle Within its tolerance range; introduce a spatial neighborhood threshold. If the distance between a candidate point and any point in the point set is... Less than the threshold Discard the current candidate point if the distance between the candidate point and all points in the existing point set is... All are greater than or equal to the threshold If the candidate line segment is selected, it is stored in the result set; and The consolidation decision is made based on the following four criteria. If any one of these criteria is met, the consolidation will proceed. Merging the point set And delete ; a: Based on the linear identity determination of the probe vector: calculate the two points with the greatest Euclidean distance in the point set. and These two points represent the local line segment. Predict the highest span in the global array; calculate candidate line segments. extension endpoint and arrive The distance between the lines is obtained by fitting the data using the least squares method; if the maximum distance... Perform the merge; b: Topological verification based on the angle between the common point and the direction: determining candidate line segments and Do common points exist? Use the least squares method to check them separately. and Performing first-order linear regression yields two fitted lines. and Calculate the angle in radians between the two lines: ; If two line segments have a common point and their directions form an angle Perform the merge; c: Determine the direction consistency based on the distance between neighboring points: Calculate candidate line segments Each point to Distance to fitted straight line, candidate line segment Each point to The distance between the fitted lines is compared, and the minimum distance is retained; if two candidate line segments... and The minimum distance between points is less than And the included angle of direction is less than Perform the merge; d: Point cloud density verification based on neighborhood coverage: Calculate candidate line segments Each point to The distance to the fitted line, if the distance is less than Then the point falls on Within the neighborhood, detection Are there two or more points that fall within the range? Within the neighborhood of; if there exist 2 or more points falling within. Within the neighborhood, perform the merge; The above-mentioned standard is used to recursively aggregate stable clusters of candidate row and column axes until the global topology is stable.
6. The adaptive relay board row and column coordinate detection method according to claim 1, characterized in that: In step 6, the process of determining row and column attributes includes: from the candidate principal axes obtained in step 5... In the process, the line segment containing the most discrete points is retrieved as the initial seed line, and its ownership status flag is initialized. Globally, the nearest unmarked point to the current axis set is found, and the distance between all unassigned points and the fitted line to the current known axis set is calculated. The point with the smallest distance is selected as the current "activation growth point." The nearest neighbor algorithm retrieves the structural features of its local neighborhood and constructs a neighborhood point set; it then calculates the directed line segment formed by the points in the neighborhood point set as growth target points and the current "activated growth point" as the growth starting point. Extract all unique point pairs from the current axis set. ,for The vector generated by each pair of points in Calculate its relationship with the test vector The minimum included angle : ; ; ; Calculate the arithmetic mean of all combined angles as the final trend deviation. : ; If satisfied If a point is found to be a geometric turning point, then this point is considered the starting point of the new axis branch, provided that the following conditions are met: Then, the multi-criteria judgment condition in step 5 is executed to perform topology merging; a conflict detection mechanism is introduced. If a point is found to be assigned to multiple axes, it means that the current point is at a complex geometric intersection. The algorithm will mark the point and search for the next candidate point. If there is no conflict, the axis topology is officially updated, and the "activated growth point" and the neighborhood matching point are marked as processed. When all points related to this geometric trend are marked as processed and no new points can be absorbed, the first principal axis is completed. The final analytical description; calculate the average slope of each axis. ,like If it is determined to be a row reference frame, It is determined to be a column reference frame.
7. The adaptive relay plate row and column coordinate detection method according to claim 6, characterized in that: In step 6, after parsing the first principal axis... The subsequent process of screening the candidate set of the second principal axis and determining the initial seed line of the second principal axis includes: from the candidate principal axes obtained in step 5... Each line segment to be processed in Iterate through each point index contained therein, and if the point also exists on the first principal axis that has been resolved... In the middle, the corresponding axis index is recorded; through the formula Calculate line segments The span Number of axes Select All line segments that reach the maximum value constitute the candidate set of the second principal axis; for each line segment in the candidate set of the second principal axis, calculate its relationship with the first principal axis. The included angle between all non-isolated point line segments First-order linear regression was performed using the least squares method, resulting in two fitted lines. and Calculate the included angle in radians between the two lines and calculate the average included angle: ; ; Search makes The largest candidate line segment is used as the initial seed line for the second principal axis.
8. The adaptive relay plate row and column coordinate detection method according to claim 1, characterized in that: In step 7, the lexicographical sorting operator is invoked to establish a sorting sequence with row index as the first priority and column index as the second priority; the row index is set as the first-level control variable, following a top-down order; the column index is set as the second-level control variable, following a left-to-right order; through the above sorting logic, a unique logical row and column coordinates are assigned to each pressure plate target in the physical space. Finally, the output contains a logical index that includes the type of pressure plate and precise row and column position information, thus completing the detection of the target matrix.