A method for sorting protection device pressure plates based on pixel coordinates
Through the pin plate sorting method based on pixel coordinates, the clustering screening method and distance sorting principle are used to solve the problem of pin plate sorting accuracy of different shooting angles, and the pin plate sorting with high accuracy is achieved.
Patent Information
- Application Number
- CN202211356133.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-01
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-11-01
AI Technical Summary
The prior art is difficult to accurately identify the arrangement order of the relay protection device's pressure plates at different shooting angles, resulting in the identification system that may misjudgment the pressure plate throwing state.
The press plate sorting method based on pixel coordinates is adopted. By obtaining the press plate coordinate set to be sorted, using the relative position clustering screening method and the angle clustering screening method, the press plate coordinate object set that meets the clustering conditions is selected, and the sorting of the press plate coordinate object set is completed based on the order principle of increasing distances in sequence.
In the press plate photos taken by multiple angles, the sorting of press plate objects can be accurately obtained, which significantly improves the sorting accuracy of the press plate coordinate sequences under different shooting angles.
Smart Images

Figure CN115661237B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of intelligent operation and maintenance of relay protection devices in power systems, and particularly relates to a method for sorting protection device pressure plates based on pixel coordinates. Background Art
[0002] Relay protection pressure plates play an important role in the entire relay protection system (hereinafter referred to as pressure plates for all), which is related to whether faults can be reliably cut off. The pressure plates are divided into function pressure plates and outlet pressure plates according to their functions. The function pressure plates are responsible for the input and withdrawal of relevant protection functions, and the outlet pressure plates are responsible for correctly transmitting the outlet tripping signal to the circuit breaker operating mechanism to complete the tripping of the circuit breaker. It can be seen that whether the pressure plates are correctly input and withdrawn directly affects whether the protection can act correctly.
[0003] In order to monitor whether the pressure plates are correctly input and withdrawn, currently, a pressure plate recognition technology based on visual object detection has emerged, which completes the monitoring of the pressure plate state through image recognition. However, the object detection obtained is the coordinate values of the object detection frames of each object, and the arrangement order of each pressure plate object cannot be obtained. Generally, the arrangement order of on-site protection pressure plates is from left to right and from top to bottom. If the position of the photographed picture is in the center of the pressure plate panel, the order of the pressure plates can be obtained through simple processing of the recognized pressure plate order and position. However, due to the shooting angle on site, there will be a large error in the angle. In this case, it is difficult to correctly identify the order and position of the pressure plates. If the position order of the pressure plates cannot be correctly identified, it will cause the recognition system to misjudge the input and withdrawal state of the pressure plates. Therefore, correctly obtaining the position order of the pressure plates is one of the key factors for correctly identifying the position state of the pressure plates. How to overcome the deficiencies of the existing technology is an urgent problem to be solved in the current technical field. Summary of the Invention
[0004] The purpose of the present invention is to solve the deficiencies of the existing technology and provide a method for sorting protection device pressure plates based on pixel coordinates.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0006] A method for sorting protection device pressure plates based on pixel coordinates includes the following steps:
[0007] Step 1: Obtain the set of pressure plate coordinates to be sorted;
[0008] Step 2: Find a pressure plate coordinate object in the coordinate set that has the shortest distance from the reference point in the y-axis direction;
[0009] Step 3: Using the pressure plate coordinate object obtained in Step 2 as a reference, use the relative position clustering screening method to screen out the set of pressure plate coordinate objects that meet the relative position clustering conditions;
[0010] Step 4: Based on the set of platen coordinates selected in Step 3, find a platen coordinate object with the shortest distance from the reference point in the x-axis direction;
[0011] Step 5: Using the platen coordinate object obtained in Step 4 as a reference, apply the angle clustering screening method to screen out a set of platen coordinate objects that meet the angle clustering conditions;
[0012] Step 6: Based on the set of platen coordinate objects selected in Step 5, use the clustering screening method based on the angle difference to obtain the same row set, and then, based on the sorting principle of increasing distance in sequence, complete the sequential arrangement of this set of platen coordinate objects from the reference point along the x-axis to the other side, obtaining a sequence of platen coordinate objects in one row;
[0013] Step 7: Delete the sorted set of platen coordinate objects from the set of platen coordinate objects to be sorted;
[0014] Step 8: Determine whether all sorting is completed. If not, repeat Steps 2 to 7.
[0015] Further, preferably, in Step 1, the specific method for obtaining the set of platen coordinate objects to be sorted is as follows:
[0016] Cover each platen with a minimum bounding rectangle, and let the platen coordinates be (x1, y1, x2, y2). As Figure 3 shown, use this coordinate as a platen coordinate object, where the coordinates (x1, y1) are the coordinates of the upper left vertex of the minimum bounding rectangle, and (x2, y2) are the coordinates of the lower right vertex of the minimum bounding rectangle; in the same coordinate system, collect the corresponding position coordinate data of all platens to form the set items_set1.
[0017] Further, preferably, in Step 3, the specific method of the relative position clustering screening method is as follows:
[0018]
[0019] In formula (1), h is the height of the minimum bounding rectangle, α is the upper limit value coefficient, β is the lower limit value coefficient, and the value limit condition is: α < β;
[0020] min_y1 represents the y-axis direction coordinate value of the upper left vertex of the platen coordinate object with the shortest distance obtained in Step 2;
[0021]
[0022] Use formula (2) to complete the screening of the platen coordinate objects. item_y1 is the y-axis direction coordinate value of the upper left vertex of an item in the set of platen coordinate objects to be sorted, and item_y2 is the y-axis direction coordinate value of the lower right vertex of an item in the set of platen coordinate objects to be sorted; items_set_1 and items_set_2 are the sets of platen coordinate objects obtained by filtering through the above conditions, and the finally obtained items_set2 is the union of items_set_1 and items_set_2.
[0023] Further, preferably, α is the upper limit value coefficient, and its value range is: 0.0 < α < 1.0. β is the lower limit value coefficient, and its value range is: 0.0 < β < 1.0.
[0024] Further, preferably, in step 5, the angle clustering and screening method is as follows: Using the platen coordinate objects obtained in step 4 as reference objects, select the upper right vertex of the smallest inscribed rectangle of the reference object as the reference point; in the set of platen coordinates, use other platen coordinate objects to be sorted as calculation objects, and select the upper right vertex of the smallest inscribed rectangle of the calculation object as the calculation point. Calculate the distance and angle between each calculation point and the reference point in turn, and use them as the distance value and angle value of the platen coordinate object to be sorted. The calculation methods of the distance and angle are as Figure 2 shown;
[0025] The specific method for screening the set of platen coordinates is:
[0026] items_set3 = {item ∈ items_set2 | -90° < item_angle < 90°} (3)
[0027] Use formula (3) as the criterion for the first filtering to obtain the set of platen coordinates items_set3 that meets this condition; item represents the platen coordinate object, Items_set2 is the set of platen coordinate objects screened in step 3, and item_angle represents the angle value of the platen coordinate object.
[0028] Further, preferably, in step 6, the specific method of the clustering and screening method based on the angle difference is:
[0029] Obtain the set of platen coordinate objects items_set3 screened in step 5 and the distance value and angle value between the platen coordinate object in this set and the reference point. Take the angle angle_min with the smallest absolute value among them. Based on this angle, obtain the set items_set4 that satisfies formula (4):
[0030]
[0031] In Equation (4), angle_diff_thsold is the angle difference threshold of 5°, item represents the platen coordinate object, Items_set3 is the set of platen coordinate objects filtered in Step 5, angle1 is the upper limit value of the angle, angle2 is the lower limit value of the angle, and item_angle represents the angle value of the platen coordinate object;
[0032] Take each platen coordinate in the items_set4 set as the calculation object, obtain the distance value between the calculation object and the reference object, and sort the distance values of the platen coordinate objects in the items_set4 set based on the principle of increasing distance in sequence, either from small to large or from large to small, to obtain a sequence of platen objects arranged in the x direction in a row.
[0033] Further, preferably, angle_diff_thsold is the angle difference threshold, and its value is 5°.
[0034] Further, preferably, in Step 7, delete the sorted platen coordinate set from the platen coordinate set to be sorted according to Equation (5) to obtain the set items_set5;
[0035]
[0036] In Equation (5), item represents the coordinate object, Items_set1 is the set of platen coordinate objects filtered in Step 1, and Items_set4 is the set of platen coordinate objects filtered in Step 6.
[0037] Further, preferably, the specific method of Step 8 is as follows:
[0038] Judge whether there is still an object in the items_set5 set. If there is, directly jump to Step 2; if not, it means the sorting is completed.
[0039] In the present invention, the reference point is the origin of the coordinate system in a pixel coordinate system.
[0040] In the present invention, for the size of the minimum bounding rectangle of the platen coordinate objects in the set, considering the different working states of the platen, shooting angles, and shooting positions, there are differences in the sizes of the drawn minimum bounding rectangles.
[0041] In the present invention, the reference point and the calculation point are points obtained through the coordinates of the minimum bounding rectangle of the platen coordinate object. This point can be the centroid, upper left vertex, lower right vertex, lower left vertex, and upper right vertex of the minimum bounding rectangle, and is used for distance and angle calculations. The selection principles of the reference point and the calculation point must be the same.
[0042] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0043] (1) The present invention can directly complete the arrangement of the platen coordinate objects in multiple rows (columns) by using the coordinate set of the platen sequence;
[0044] (2) The present invention can obtain an accurate sorting of the platen objects based on the platen coordinates in the platen photos taken from multiple angles, and can effectively improve the sorting accuracy rate of the platen coordinate sequences under different shooting angles. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is the flowchart of the method of the present invention;
[0046] Figure 2 is the schematic diagram of the distance and angle calculation between the reference point and the calculation point of the present invention;
[0047] Figure 3 is the schematic diagram of the position of the platen coordinate object in the coordinate system of the present invention;
[0048] Figure 4 is the sorting result of the platen sequence of the embodiment of the present invention; DETAILED DESCRIPTION OF THE EMBODIMENTS
[0049] The present invention will be further described in detail below with reference to the embodiments.
[0050] Those skilled in the art will understand that the following embodiments are only used to illustrate the present invention and should not be construed as limiting the scope of the present invention. For those not specified in the embodiments, the techniques or conditions described in the literature in the art or according to the product specifications are followed. Those materials or equipment not specified in the manufacturer are all conventional products that can be obtained by purchase.
[0051] Embodiment 1
[0052] As Figure 1 shown, a method for sorting the platen of a protection device based on pixel coordinates includes the following steps:
[0053] Step 1: Obtain the platen coordinate set to be sorted;
[0054] Step 2: Find a platen coordinate object in the coordinate set that has the shortest distance from the reference point in the y-axis direction;
[0055] Step 3: Using the platen coordinate object obtained in Step 2 as a reference, use the relative position clustering screening method to screen out the set of platen coordinate objects that meet the relative position clustering conditions;
[0056] Step 4: Based on the platen coordinate set screened out in Step 3, find a platen coordinate object that has the shortest distance from the reference point in the x-axis direction;
[0057] Step 5: Taking the platen coordinate object obtained in Step 4 as a reference, use the angle clustering screening method to screen out the set of platen coordinate objects that meet the angle clustering conditions;
[0058] Step 6: Based on the set of platen coordinate objects screened in Step 5, use the clustering screening method based on the angle difference to obtain the same row set, and then based on the sorting principle of increasing distance in turn, complete the sequential arrangement of the set of platen coordinate objects from the reference point along the x-axis to the other side, and obtain a sequence of platen coordinate objects in one row;
[0059] Step 7: Delete the sorted set of platen coordinate objects from the set of platen coordinate objects to be sorted;
[0060] Step 8: Determine whether all sorting is completed. If not, repeat Steps 2 to 7.
[0061] Embodiment 2
[0062] As Figure 1 shown, a method for sorting the platen of a protection device based on pixel coordinates includes the following steps:
[0063] Step 1: Obtain the set of platen coordinates to be sorted;
[0064] Step 2: Find a platen coordinate object in the coordinate set that is the shortest distance from the reference point in the y-axis direction;
[0065] Step 3: Taking the platen coordinate object obtained in Step 2 as a reference, use the relative position clustering screening method to screen out the set of platen coordinate objects that meet the relative position clustering conditions;
[0066] Step 4: Based on the set of platen coordinates screened in Step 3, find a platen coordinate object that is the shortest distance from the reference point in the x-axis direction;
[0067] Step 5: Taking the platen coordinate object obtained in Step 4 as a reference, use the angle clustering screening method to screen out the set of platen coordinate objects that meet the angle clustering conditions;
[0068] Step 6: Based on the set of platen coordinate objects screened in Step 5, use the clustering screening method based on the angle difference to obtain the same row set, and then based on the sorting principle of increasing distance in turn, complete the sequential arrangement of the set of platen coordinate objects from the reference point along the x-axis to the other side, and obtain a sequence of platen coordinate objects in one row;
[0069] Step 7: Delete the sorted set of platen coordinate objects from the set of platen coordinate objects to be sorted;
[0070] Step 8: Determine whether all sorting is completed. If not, repeat Steps 2 to 7.
[0071] In step 1, the specific method for obtaining the set of platen coordinate objects to be sorted is as follows:
[0072] Cover each platen with a minimum bounding rectangle. Let the platen coordinates be (x1, y1, x2, y2), where the platen coordinates are the coordinate data of the platen graphic element in the picture. As Figure 3 shown, take these coordinates as a platen coordinate object. Among them, the coordinates (x1, y1) are the coordinates of the upper left vertex of the minimum bounding rectangle, and (x2, y2) are the coordinates of the lower right vertex of the minimum bounding rectangle; in the same coordinate system, collect the corresponding position coordinate data of all platens to form the set items_set1.
[0073] In step 2, the reference point is the origin of the coordinate system in a pixel coordinate system. Obtain a point as the calculation point through the platen coordinate object. This point can be the centroid, upper left vertex, lower right vertex, lower left vertex, or upper right vertex of the platen coordinate object. The shortest distance represents the shortest distance in the vertical axis direction between the reference point and the calculation point.
[0074] In step 3, the specific method of the relative position clustering and screening method is as follows:
[0075]
[0076] In formula (1), h is the height of the minimum bounding rectangle, α is the upper limit coefficient, β is the lower limit coefficient, and the value limit condition is: α < β;
[0077] min_y1 represents the y-axis coordinate value of the upper left vertex of a platen coordinate object with the shortest distance obtained in step 2;
[0078]
[0079] Use formula (2) to complete the screening of the platen coordinate objects. item_y1 is the y-axis coordinate value of the upper left vertex of an item in the set of platen coordinate objects to be sorted, and item_y2 is the y-axis coordinate value of the lower right vertex of an item in the set of platen coordinate objects to be sorted; items_set_1 and items_set_2 are the sets of platen coordinate objects obtained by filtering through the above conditions, and the finally obtained items_set2 is the union of items_set_1 and items_set_2.
[0080] α is the upper limit coefficient, and its value range is: 0.0 < α < 1.0. β is the lower limit coefficient, and its value range is: 0.0 < β < 1.0.
[0081] Example 3
[0082] As Figure 1 shown, a method for sorting the pressure plate of a protection device based on pixel coordinates includes the following steps:
[0083] Step 1: Obtain the set of pressure plate coordinates to be sorted;
[0084] Step 2: Find a pressure plate coordinate object in the coordinate set that has the shortest distance from the reference point in the y-axis direction;
[0085] Step 3: Using the pressure plate coordinate object obtained in Step 2 as a reference, use the relative position clustering and screening method to screen out the set of pressure plate coordinate objects that meet the relative position clustering conditions;
[0086] Step 4: Based on the set of pressure plate coordinates screened in Step 3, find a pressure plate coordinate object that has the shortest distance from the reference point in the x-axis direction;
[0087] Step 5: Using the pressure plate coordinate object obtained in Step 4 as a reference, use the angle clustering and screening method to screen out the set of pressure plate coordinate objects that meet the angle clustering conditions;
[0088] Step 6: Based on the set of pressure plate coordinate objects screened in Step 5, use the clustering and screening method based on the angle difference to obtain the same row set, and then based on the sorting principle of increasing distance in turn, complete the sequential arrangement of the set of pressure plate coordinate objects from the reference point along the x-axis to the other side, and obtain the sequence of pressure plate coordinate objects in one row;
[0089] Step 7: Delete the sorted set of pressure plate coordinate objects from the set of pressure plate coordinate objects to be sorted;
[0090] Step 8: Determine whether all sorting is completed. If not, repeat Steps 2 to 7.
[0091] In Step 1, the specific method for obtaining the set of pressure plate coordinate objects is as follows:
[0092] Cover each pressure plate with a minimum bounding rectangle, and let the pressure plate coordinates be (x1, y1, x2, y2). The pressure plate coordinates are the coordinate data of the pressure plate graphic element in the picture. As Figure 3 shown, use this coordinate as a pressure plate coordinate object, where the coordinates (x1, y1) are the coordinates of the upper left vertex of the minimum bounding rectangle, and (x2, y2) are the coordinates of the lower right vertex of the minimum bounding rectangle; in the same coordinate system, collect the corresponding position coordinate data of all pressure plates to form the set items_set1.
[0093] In step 2, the reference point is the origin of the coordinate system in a pixel coordinate system. A point is obtained through the platen coordinate object as the calculation point. This point can be the centroid, the upper left vertex, the lower right vertex, the lower left vertex, or the upper right vertex of the platen coordinate object. The shortest distance indicates the shortest distance in the vertical axis direction between the reference point and the calculation point.
[0094] In step 3, the specific method of the relative position clustering and screening method is as follows:
[0095]
[0096] In formula (1), h is the height of the minimum bounding rectangle, α is the upper limit coefficient, β is the lower limit coefficient, and the value limit condition is: α < β;
[0097] min_y1 represents the y-axis coordinate value of the upper left vertex of a platen coordinate object with the shortest distance obtained in step 2;
[0098]
[0099] Use formula (2) to complete the screening of the platen coordinate object. item_y1 is the y-axis coordinate value of the upper left vertex of an item in the set of platen coordinate objects to be sorted, and item_y2 is the y-axis coordinate value of the lower right vertex of an item in the set of platen coordinate objects to be sorted; items_set_1 and items_set_2 are the sets of platen coordinate objects obtained by filtering through the above conditions, and the finally obtained items_set2 is the union of items_set_1 and items_set_2.
[0100] α is the upper limit coefficient, and its value range is: 0.0 < α < 1.0. β is the lower limit coefficient, and its value range is: 0.0 < β < 1.0.
[0101] In step 4, the reference point is the origin of the coordinate system in a pixel coordinate system. Additionally, a point is obtained through the platen coordinate object as the calculation point. This point can be the centroid, the upper left vertex, the lower right vertex, the lower left vertex, or the upper right vertex of the platen coordinate object. The shortest distance indicates the shortest distance in the horizontal axis direction between the reference point and the calculation point.
[0102] In step 5, the angle clustering and screening method is as follows: Using the platen coordinate object obtained in step 4 as the reference object, select the upper right vertex of the minimum bounding rectangle of the reference object as the reference point; in the set of platen coordinates, use other platen coordinate objects to be sorted as the calculation objects, and select the upper right vertex of the minimum bounding rectangle of the calculation object as the calculation point. Calculate the distance and angle between each calculation point and the reference point in turn as the distance value and angle value of the platen coordinate object to be sorted. The calculation methods of the distance and angle are asFigure 2 as shown
[0103] The specific method for screening the set of press plate coordinates is as follows:
[0104] items_set3 = {item ∈ items_set2 | -90° < item_angle < 90°} (3)
[0105] Using Equation (3) as the criterion for the first filtering, obtain the set of press plate coordinates items_set3 that meet this condition; item represents the press plate coordinate object, Items_set2 is the set of press plate coordinate objects screened in Step 3, and item_angle represents the angle value of the press plate coordinate object.
[0106] In Step 6, the specific method of the clustering and screening method based on the angle difference is as follows:
[0107] Obtain the set of press plate coordinates items_set3 screened in Step 5, and the distance value and angle value between the press plate coordinate object in this set and the reference point. Take the angle angle_min with the smallest absolute value among them. Based on this angle, obtain the set items_set4 that meets Equation (4):
[0108]
[0109] In Equation (4), angle_diff_thsold is the angle difference threshold of 5°. item represents the press plate coordinate object, Items_set3 is the set of press plate coordinate objects screened in Step 5, angle1 is the upper limit value of the angle, angle2 is the lower limit value of the angle, and item_angle represents the angle value of the press plate coordinate object;
[0110] Take each press plate coordinate in the items_set4 set as the calculation object, obtain the distance value between the calculation object and the reference object, and sort the distance values of the press plate coordinate objects in the items_set4 set based on the principle of increasing distance in sequence, either from small to large or from large to small, to obtain a sequence of press plate objects arranged in the x - direction in a row.
[0111] angle_diff_thsold is the angle difference threshold, and its value is 5°. Its meaning is that for the set of press plates in the same row (column), their relative angles to the first reference point are basically the same, and those within this range can be determined to be in the same row (column).
[0112] In Step 7, delete the sorted set of press plate coordinates from the set of press plate coordinates to be sorted according to Equation (5) to obtain the set items_set5;
[0113]
[0114] In formula (5), item represents a coordinate object, Items_set1 is the set of platen coordinate objects screened in step 1, and Items_set4 is the set of platen coordinate objects screened in step 6.
[0115] The specific method of step 8 is as follows:
[0116] Judge whether there are still objects in the set items_set5. If so, directly jump to step 2; if not, it means that the sorting has been completed.
[0117] Application example
[0118] In this example, the platen coordinate objects of a hydropower plant obtained through marking and positioning are used. Here, the sorting principle from left to right and from top to bottom is adopted for verification. The marked coordinates are pixel coordinate values. The specific platen sequence is shown in Table 1.
[0119] Table 1 Sequence of platen objects to be sorted
[0120]
[0121]
[0122] Taking the sorting of the first row as an example, a detailed description is as follows:
[0123] The first step is to obtain the set of platen coordinate objects to be sorted in Table 1;
[0124] The second step is to find a point that is closest to the origin of the pixel coordinates in the y-axis direction. It is obtained from the list of objects to be sorted. The coordinate object of the 19th platen is found as the reference object for the first row, and its coordinates are (410, 1013, 516, 1177). The reference point obtained through it is (516, 1013);
[0125] Step 3: At the coordinate object of the 19th pressing plate, with parameter h = 164, α = 0.25, β = 0.75, w1 = 1054, and w2 = 1136; filter out items_set2: (410.0, 1013.0, 516.0, 1177.0), (509.0, 1065.0, 610.0, 1235.0), (611.0, 1119.0, 735.0, 1290.0), (727.0, 1178.0, 847.0, 1359.0), (852.0, 1240.0, 970.0, 1419.0), (979.0, 1303.0, 1096.0, 1492.0), (1119.0, 1378.0, 1242.0, 1570.0), (1269.0, 1449.0, 1400.0, 1650.0).
[0126] Step 4: Among the set items_set2, find the pressing plate coordinate object that is closest to the origin of the pixel coordinates in the y-axis direction, which is the 19th pressing plate coordinate object;
[0127] Step 5: The filtered set is items_set3: (410.0, 1013.0, 516.0, 1177.0), (852.0, 1240.0, 970.0, 1419.0), (1269.0, 1449.0, 1400.0, 1650.0), (509.0, 1065.0, 610.0, 1235.0), (611.0, 1119.0, 735.0, 1290.0), (727.0, 1178.0, 847.0, 1359.0), (979.0, 1303.0, 1096.0, 1492.0), (1119.0, 1378.0, 1242.0, 1570.0)
[0128] Step 6: After screening, the angles obtained for the 20th coordinate are angle_min - 26.9°, angle1 = -21.9°, angle2 = -31.9°, and angle_diff_thsold = 5°. Filter out items_set4. On this basis, calculate the distance values between the pressing plate coordinate objects in the items_set4 set and the 19th pressing plate coordinate object and sort them. The sorted result is in the format [pressing plate object number, distance value]: [19, 0], [26, 111.8], [18, 227.2], [6, 357.4], [10, 496.9], [2, 638.6], [3, 797.4], [20, 963.3], obtaining items_set5.
[0129] Step 7: Exclude the sorted items_set5 from the set of items to be sorted items_set1.
[0130] Step 8: Determine whether the sorting is completed. If not, jump to Step 2 to continue with the sorting until all sorting is completed.
[0131] If simply arranging in order from left to right and top to bottom according to the coordinate size cannot obtain the accurate sorting order, by using the sorting method of the present invention, the sorting of the platen coordinate sequence can be correctly completed. The following is the sorted number order: 19, 26, 18, 6, 10, 2, 3, 20 (first row); 25, 24, 16, 13, 11, 4, 12, 7 (second row); 21, 28, 27, 22, 31, 1, 5, 29 (third row); 30, 32, 23, 15, 17, 14, 9, 8 (fourth row). The specific arrangement is as Figure 4 shown.
[0132] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for sorting the pressure plates of a protection device based on pixel coordinates, characterized in that, It includes the following steps: Step 1: Obtain the set of platen coordinates to be sorted; Step 2: Find a platen coordinate object in the coordinate set that has the shortest distance from the reference point in the y-axis direction; Step 3: Using the platen coordinate object obtained in Step 2 as a reference, and by means of the relative position clustering and screening method, screen out the set of platen coordinate objects that meet the relative position clustering conditions; Step 4: Based on the set of platen coordinates screened out in Step 3, find a platen coordinate object that has the shortest distance from the reference point in the x-axis direction; Step 5: Using the platen coordinate object obtained in Step 4 as a reference, and by means of the angle clustering and screening method, screen out the set of platen coordinate objects that meet the angle clustering conditions; Step 6: Based on the set of platen coordinate objects screened out in Step 5, use the clustering and screening method based on the angle difference to obtain the same row set, and then, based on the sorting principle of increasing distance in sequence, complete the sequential arrangement of the set of platen coordinate objects from the reference point along the x-axis to the other side, so as to obtain the sequence of platen coordinate objects in one row; Step 7: Delete the sorted set of platen coordinate objects from the set of platen coordinate objects to be sorted; Step 8: Judge whether all sorting is completed. If not, repeat Steps 2 to 7; In Step 3, the specific method of the relative position clustering and screening method is as follows: In formula (1), h is the height of the minimum bounding rectangle, α is the upper limit value coefficient, β is the lower limit value coefficient, and the value limit condition is: α < β; min_y1 represents the y-axis direction coordinate value of the upper left corner vertex of the platen coordinate object with the shortest distance obtained in Step 2; Use formula (2) to complete the screening of the platen coordinate object. item_y1 is the y-axis direction coordinate value of the upper left corner vertex of an item in the set of platen coordinate objects to be sorted, item_y2 is the y-axis direction coordinate value of the lower right corner vertex of an item in the set of platen coordinate objects to be sorted; items_set_1 and items_set_2 are the sets of platen coordinate objects obtained by filtering through the above conditions, and the finally obtained items_set2 is the union of items_set_1 and items_set_2; In Step 5, the angle clustering and screening method is: Using the platen coordinate object obtained in Step 4 as a reference object, select the upper right corner vertex of the minimum bounding rectangle of the reference object as the reference point; in the set of platen coordinates, take other platen coordinate objects to be sorted as calculation objects, and select the upper right corner vertex of the minimum bounding rectangle of the calculation object as the calculation point, and calculate the distance and angle between each calculation point and the reference point in turn, as the distance value and angle value of the platen coordinate object to be sorted; The specific method of screening the set of platen coordinates is as follows: items_set3 = {item ∈ items_set2 | -90° < item_angle < 90°} (3) Using Equation (3) as the criterion for the first filtering, obtain the set of platen coordinate objects items_set3 that meet this condition; item represents a platen coordinate object, Items_set2 is the set of platen coordinate objects obtained by screening in Step 3, and item_angle represents the angle value of the platen coordinate object.
2. The method for sorting the pressing plates of the protection device based on pixel coordinates according to claim 1, wherein In Step 1, the specific method for obtaining the set of platen coordinate objects to be sorted is as follows: Cover each platen with a minimum bounding rectangle. Let the platen coordinates be (x1, y1, x2, y2), and use these coordinates as a platen coordinate object. Among them, the coordinates (x1, y1) are the coordinates of the upper left vertex of the minimum bounding rectangle, and (x2, y2) are the coordinates of the lower right vertex of the minimum bounding rectangle; in the same coordinate system, collect the corresponding position coordinate data of all platens to form the set items_set1.
3. The method for sorting the pressure plates of the protection device based on pixel coordinates according to claim 1, wherein α is the upper limit value coefficient, and its value range is: 0.0 < α < 1.
0. β is the lower limit value coefficient, and its value range is: 0.0 < β < 1.
0.
4. The method for sorting the pressing plates of the protection device based on pixel coordinates according to claim 1, wherein In Step 6, the specific method of the clustering and screening method based on the angle difference is as follows: Obtain the set of platen coordinate objects items_set3 obtained by screening in Step 5, as well as the distance values and angle values between the platen coordinate objects in this set and the reference point. Take the angle angle_min with the smallest absolute value among them. Based on this angle, obtain the set items_set4 that meets Equation (4): In Equation (4), angle_diff_thsold is the angle difference threshold, item represents a platen coordinate object, Items_set3 is the set of platen coordinate objects obtained by screening in Step 5, angle1 is the upper limit value of the angle, angle2 is the lower limit value of the angle, and item_angle represents the angle value of the platen coordinate object; Take each platen coordinate in the items_set4 set as the calculation object, obtain the distance value between the calculation object and the reference object, and sort the distance values of the platen coordinate objects in the items_set4 set based on the sorting principle of increasing distance in sequence, either from small to large or from large to small, to obtain a sequence of platen objects arranged in the x direction in sequence.
5. The method for sorting the pressing plates of the protection device based on pixel coordinates according to claim 4, characterized in that, angle_diff_thsold takes a value of 5°.
6. The method for sorting the pressure plates of the protection device based on pixel coordinates according to claim 4, wherein In Step 7, delete the sorted set of platen coordinates from the set of platen coordinates to be sorted according to Equation (5) to obtain the set items_set5; In Equation (5), item represents a coordinate object, Items_set1 is the set of platen coordinate objects obtained by screening in Step 1, and Items_set4 is the set of platen coordinate objects obtained by screening in Step 6.
7. The method for sorting the protection device pressing plates based on pixel coordinates according to claim 6, wherein The specific method of Step 8 is as follows: Judge whether there are still objects in the items_set5 set. If there are, directly jump to Step 2; if not, it means that the sorting has been completed.
Citation Information
Patent Citations
Transformer substation pressing plate state identification method and device
CN112528741A
Pressing plate row and column position sorting method and device
CN113743492A