A method for accurately detecting the opening and closing angle of a split knife switch

By collecting template images in the flipped blade switch and establishing a boundary line model, combining the midpoint and midline for edge detection and pairing of the target image, the problem of difficulty in accurately detecting the opening and closing state of the knife switch in the prior art is solved, and the problem of realizing the High precision and efficient detection effect.

CN111080570BActive Publication Date: 2025-02-18国网黑龙江省电力有限公司大兴安岭供电公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910895602.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-21
Publication Date
2025-02-18
Estimated Expiration
2039-09-21

AI Technical Summary

Technical Problem

It is difficult for the prior art to quickly and accurately detect whether the knife switch is opened and closed in place, especially in the case of complex background, it is easy to interfere with line segments, affecting the detection effect.

Method used

Collect template images of the flipped knife switch, establish a boundary line model of this model knife switch arm, and calculate the midpoint and midline of the knife switch arm. Then, the target image is collected at the same position, edge detection is performed, the edge line collection is obtained, and the edge line is distinguished and paired through the midpoint and the midline, and the angle is calculated to detect the opening and closing state.

Benefits of technology

It realizes accurate detection of the opening and closing angle of the flip type tool switch, improves the accuracy and speed of detection, and can accurately distinguish the edge lines of the tool switch arm in complex backgrounds to ensure the reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111080570B_ABST
    Figure CN111080570B_ABST
Patent Text Reader

Abstract

The present invention proposes a precise detection method for the opening and closing angle of a split knife gate, comprising: collecting a template image of the knife gate and establishing a boundary line model of the knife gate arm according to the template image and saving it as a model file, and then calculating the midpoint and midline of the knife gate arm; collecting a target image of the same knife gate under the same conditions and performing edge detection to obtain an edge line set; calculating the distance from the left midpoint and the right midpoint of the knife gate arm of the target image to each edge line in the edge line set, eliminating the edge lines corresponding to the distances not within the threshold range, and obtaining an updated edge line set; using the midline to distinguish the updated edge line set from left to right, respectively obtaining the left knife gate arm edge line set and the right knife gate arm edge line set and assigning weights and then performing symmetrical pairing to determine the final left knife gate arm edge line and right knife gate arm edge line; calculating the angle between the left and right knife gate arms. The present invention solves the problem that it is difficult to quickly and accurately identify whether a split knife gate is opened and closed in place in actual use, and improves the recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image recognition, and in particular to a method for accurately detecting the opening and closing angles of a split knife switch. Background Art

[0002] The knife switch is a frequently used electrical appliance in high-voltage switchgear, and plays an isolating role in the circuit. In actual applications, due to the long-term operation of the knife switch, the knife switch may not be closed or opened properly, which will cause an arc between the left and right knife switch arms of the knife switch. The arc is a gas discharge phenomenon. The instantaneous spark generated by the current passing through certain insulating media may cause a fire or threaten personal safety. In addition, the arc temperature is extremely high, which can easily burn the insulating material, causing leakage events or damage to the knife switch equipment. Therefore, the opening and closing state of the knife switch needs to be accurately detected.

[0003] In practice, manual observation is mainly needed to detect whether the double-open knife switch is fully opened or closed. In the prior art, the angle between the left and right knife switch arms is calculated to determine the degree of opening and closing of the knife switch. At present, there are many calculation schemes for calculating the angle between the left and right knife switch arms at home and abroad. One is to modify the internal circuit and add sensors or signal lights. Another is a method based on digital image processing to judge the switch state of the knife switch by monitoring the image. In the method based on digital image processing, due to the complex background, many interference line segments are likely to appear when detecting the edge line of the knife switch arm, making it difficult to accurately distinguish the importance of different edge lines and accurately determine the edge lines of the left and right knife switch arms, which affects the detection effect and cannot accurately detect the angle between the left and right knife switch arms. Summary of the invention

[0004] In order to solve the problem in the prior art that it is difficult to quickly and accurately detect whether a knife switch is fully opened or closed, the present invention proposes a method for accurately detecting the opening and closing angles of a split knife switch.

[0005] The technical solution of the present invention is achieved in this way:

[0006] A method for accurately detecting the opening and closing angles of a split knife gate comprises: collecting a template image of the split knife gate, establishing a boundary line model of the knife gate arm of the model according to the template image and saving it as a model file, and calculating the midpoint and midline of the knife gate arm according to the model file; collecting a target image of the same split knife gate at the same position using the same device, performing edge detection on the target image, and obtaining an edge line set; corresponding the left midpoint and the right midpoint of the split knife gate calculated according to the model file to the target image, obtaining the left midpoint and the right midpoint of the knife gate arm of the target image, and calculating the knife gate arm of the target image. The distances from the left midpoint and the right midpoint to each edge line in the edge line set are calculated, and the edge lines corresponding to the distances not within the threshold range are eliminated to obtain an updated edge line set; the updated edge line set is distinguished between left and right by the midline, and the left knife gate arm edge line set and the right knife gate arm edge line set are obtained respectively and weighted; the left knife gate arm edge line set and the right knife gate arm edge line set after weighting are symmetrically paired to determine the final left knife gate arm edge line and right knife gate arm edge line; the angle between the left knife gate arm and the right knife gate arm is calculated to detect whether the left knife gate arm and the right knife gate arm are in place;

[0007] The left midpoint is the center point of the two intersections of the extended line of the left insulator centerline and the extended lines of the upper and lower boundary lines of the left knife switch arm. The right midpoint is the center point of the two intersections of the extended line of the right insulator centerline and the extended lines of the upper and lower boundary lines of the right knife switch arm.

[0008] Preferably, the method of "establishing a boundary line model of the knife switch arm of this model according to the template image and saving it as a model file" is: setting a program on the computer, using the program to open the template image, stroking the upper and lower boundary lines of the knife switch arm according to the template image, and saving the line segment endpoint coordinates corresponding to the stroke and the line segment endpoint coordinates corresponding to the left and right insulator center lines as a model file; drawing the left insulator center line and the right insulator center line, and if the knife switch in the template image is in a closed state, stroking the upper and lower boundaries of the entire knife switch arm; if the knife switch in the template image is in a virtual closed or open state, stroking according to the actual upper and lower boundaries of the left and right knife switch arms.

[0009] Preferably, the method of "calculating the midpoint of the knife switch arm according to the model file" is: when the knife switch is in a closed state, two intersection points of the upper and lower boundary line extension lines of the whole knife switch arm and the left insulator center line extension line are respectively obtained according to the model file, and recorded as two left end points, and two intersection points of the upper and lower boundary line extension lines of the whole knife switch arm and the right insulator center line extension line are obtained, and recorded as two right end points; the left midpoint and the right midpoint are obtained according to the two left end points and the two right end points, and the midpoint of the line segment between the left midpoint and the right midpoint is the knife switch arm midpoint or the midpoint of the closed frame formed by the two left end points and the two right end points is the knife switch arm midpoint;

[0010] When the knife switch is in a virtual closed or open state, the two intersection points of the upper and lower boundary line extension lines of the left knife switch arm and the left insulator center line extension line are obtained according to the model file, and recorded as the two left end points, and the two intersection points of the upper and lower boundary line extension lines of the right knife switch arm and the right insulator center line extension line are obtained, and recorded as the two right end points; the left midpoint and the right midpoint are obtained according to the two left end points and the two right end points, and the midpoint of the line segment between the left midpoint and the right midpoint is the midpoint of the knife switch arm or the midpoint of the closed frame formed by the two left end points and the two right end points is the midpoint of the knife switch arm.

[0011] Preferably, the method of "calculating the center line of the knife gate arm according to the model file" is: when the knife gate in the template image is in a closed state, the distortion coefficient of the camera that captures the template image is obtained, and the camera matrix camera_matrix = [focal_length, 0, center.x; 0, focal_length, center.y; 0, 0, 1] is calculated according to the size of the template image, wherein focal_length is the width of the template image, and center.x and center.y are the x-coordinate and y-coordinate of the midpoint of the template image respectively; the coordinate position of the device relative to the knife gate during acquisition is obtained according to the two left end points and the two right end points, the projection direction of the Z axis of the device on the template image is the center line direction of the knife gate arm, and the center line of the knife gate arm is determined in combination with the midpoint of the knife gate arm;

[0012] When the knife gate in the template image is in a virtual closed or open state, the left center line is obtained according to the left midpoint and the average slope of the upper and lower boundary lines of the left knife gate arm, and the right center line is obtained according to the right midpoint and the average slope of the upper and lower boundary lines of the right knife gate arm. The left center line and the right center line are extended to form an intersection; the line passing through the intersection and the midpoint is the center line of the knife gate arm.

[0013] Preferably, another way of "when the knife gate is in a virtual closed or open state, calculating the center line of the knife gate arm according to the model file" is: obtaining the right midpoint of the left knife gate arm according to the intersection of the left center line and the right side of the left knife gate arm, obtaining the left midpoint of the right knife gate arm according to the intersection of the right center line and the left side of the right knife gate arm, obtaining the coordinate position of the device relative to the knife gate when collecting according to the left midpoint, the right midpoint, the left midpoint and the right midpoint, the projection direction of the Z axis of the device on the template image is the center line direction of the knife gate arm, and the center line of the knife gate arm is determined in combination with the midpoint of the knife gate arm; the right side of the left knife gate arm is the line connecting the two right side end points of the upper and lower boundary lines of the left knife gate arm, and the left side of the right knife gate arm is the line connecting the two left side end points of the upper and lower boundary lines of the right knife gate arm.

[0014] Preferably, the specific method of "using the center line to distinguish the updated edge line set from the left and right, and respectively obtaining the edge line set of the left knife gate arm and the edge line set of the right knife gate arm" is: directly correspond the midpoint and the center line of the knife gate arm calculated according to the model file to the target image, and calculate the unit direction vector perpendicular to the center line to the left or right with the midpoint as the starting point on the target image.

[0015] Traverse and update the edge lines in the edge line set, record the two endpoints of any edge line as T1 and T2, and record the vector between T1 and the midpoint as The vector between T2 and the midpoint is denoted as calculate and For a unit direction vector pointing to the right like Then T1 is on the right side of the midline, otherwise it is on the left side of the midline; if Then T2 is on the right side of the midline, otherwise on the left side of the midline; for a unit direction vector pointing to the left like Then T1 is on the left side of the midline, otherwise it is on the right side of the midline; if Then T2 is on the left side of the center line, otherwise it is on the right side of the center line; if T1 and T2 are both on the left side of the center line, then the edge line is the edge line of the left knife gate arm, if T1 and T2 are both on the right side of the center line, then the edge line is the edge line of the right knife gate arm, if T1 and T2 are respectively on both sides of the center line, calculate the length of the left and right line segments of the edge line with the center line as the dividing line, and the edge line is the edge line on the longer side of the left and right side segments; in this way, the left knife gate arm edge line set and the right knife gate arm edge line set are obtained.

[0016] Preferably, the method of “weighting the left knife gate arm edge line set and the right knife gate arm edge line set” is: the method of weighting the left knife gate arm edge line set is: traverse all edge lines in the left knife gate arm edge line set, calculate each left knife gate arm edge line angle and classify the left edge according to it, give a high angle threshold and a low angle threshold, set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle greater than the high angle threshold as a vertical edge line, set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle less than the low angle threshold as a horizontal edge line, and set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle between the low angle threshold and the high angle threshold as an inclined edge line;

[0017] For all vertical edge lines of the left knife gate arm, set the x-coordinate value L_x of the left midpoint of the left knife gate arm, and find two edge points corresponding to the x-coordinates with the smallest difference from L_x on the left and right sides of the left midpoint of the left knife gate arm. The x-coordinate values ​​of the two edge points on the left are recorded as L_x1 and L_x2, and L_x1 is greater than L_x2; the x-coordinate values ​​of the two edge points on the right are recorded as R_x1 and R_x2, and R_x1 is greater than R_x2;

[0018] For all horizontal edge lines of the left knife gate arm, set the y coordinate value of the left midpoint of the left knife gate arm as L_y, and find two edge points corresponding to the y coordinates with the smallest difference from L_y on the upper and lower sides of the left midpoint of the left knife gate arm, and the y coordinate values ​​of the two upper edge points are recorded as T_y1 and T_y2, T_y1 is greater than T_y2; the y coordinate values ​​of the two lower edge points are recorded as B_y1 and B_y2, B_y1 is greater than B_y2;

[0019] For all inclined edge lines of the left knife gate arm, set the x-coordinate value and y-coordinate value of the left midpoint of the left knife gate arm as L_xx and L_yy, respectively, and find two edge points corresponding to the x-coordinate with the smallest difference from L_xx and the edge points corresponding to the y-coordinate with the smallest difference from L_yy on the upper left side and lower right side of the left midpoint of the left knife gate arm, the x-coordinate values ​​of the two edge points on the upper left side are recorded as L_xx1 and L_xx2, L_xx1 is greater than _xx2, and the y-coordinate values ​​are recorded as T_yy1 and T_yy2, T_yy1 is greater than T_yy2; the x-coordinate values ​​of the two edge points on the lower right side are recorded as R_xx1 and R_xx2, R_xx1 is greater than R_xx2, and the y-coordinate values ​​are recorded as B_yy1 and B_yy2, B_yy1 is greater than B_yy2;

[0020] The method of obtaining the weight of each vertical edge line is as follows: traverse each edge point on each vertical edge line located to the left of the left midpoint of the left knife gate arm, and when the x-coordinate value of the edge point is greater than or equal to L_x1, its contribution weight is Value_W, and when the x-coordinate value of the edge point is greater than or equal to L_x2 and less than L_x1, its contribution weight is Value_W / 2, otherwise the contribution weight of the edge point is 0; traverse each edge point on the edge line to the right of the left midpoint of the left knife gate arm, and when the x-coordinate value of the edge point is less than or equal to L_x2, its contribution weight is Value_W, and when the x-coordinate value of the edge point is greater than L_x2 and less than or equal to L_x1, its contribution weight is Value_W / 2, otherwise the contribution weight of the edge point is 0, and the sum of the contribution weights of all edge points is the weight of the current vertical edge line;

[0021] The method of obtaining the weight of each horizontal edge line is as follows: traverse each edge point on the edge line located on the upper side of the left midpoint of the left knife gate arm, and when the y coordinate value of the edge point is greater than or equal to T_y1, its contribution weight is Value_W, and when the y coordinate value of the edge point is greater than or equal to T_y2 and less than T_y1, its contribution weight is Value_W / 2, otherwise the contribution weight of the edge point is 0; traverse each edge point on the edge line located on the lower side of the left midpoint of the left knife gate arm, and when the y coordinate value of the edge point is less than or equal to B_y2, its contribution weight is Value_W, and when the y coordinate value of the edge point is greater than B_y2 and less than or equal to B_y1, its contribution weight is Value_W / 2, otherwise the contribution weight of the edge point is 0, and the sum of the contribution weights of all edge points is the weight of the current horizontal edge line;

[0022] The method for obtaining the weight of each inclined edge line is as follows: traverse each edge point on the edge line located on the upper left side of the left midpoint of the left knife gate arm. When the x-coordinate value of the edge point is greater than or equal to L_xx1, its contribution weight is Value_W; when the x-coordinate value of the edge point is greater than or equal to L_xx2 and less than L_xx1, its contribution weight is Value_W / 2; otherwise, the contribution weight of the edge point is 0; when the y-coordinate value of the edge point is greater than or equal to T_yy1, its contribution weight is Value_W; when the y-coordinate value of the edge point is greater than or equal to T_yy2 and less than T_yy1, its contribution weight is Value_W / 2; otherwise, the contribution weight of the edge point is 0; traverse each edge point located on the upper left side of the left midpoint of the left knife gate arm. For each edge point on the edge line to the lower right of the left midpoint of the left knife gate arm, when the x-coordinate value of the edge point is less than or equal to L_xx2, its contribution weight is Value_W; when the x-coordinate value of the edge point is greater than L_xx2 and less than or equal to L_xx1, its contribution weight is Value_W / 2; otherwise, the contribution weight of the edge point is 0; when the y-coordinate value of the edge point is less than or equal to B_yy2, its contribution weight is Value_W; when the y-coordinate value of the edge point is greater than B_yy2 and less than or equal to B_yy1, its contribution weight is Value_W / 2; otherwise, the contribution weight of the edge point is 0; the sum of the contribution weights of all edge points is the weight of the current inclined edge line;

[0023] The way of assigning weights to the right gate arm edge line set is the same as the way of assigning weights to the left gate arm edge line set.

[0024] Preferably, the method of "symmetrically pairing the weighted left gate arm edge line set and the right gate arm edge line set to determine the left gate arm edge line and the right gate arm edge line" is:

[0025] Given an angle threshold, the angle of any edge line in the weighted left knife gate arm edge line set relative to the horizontal position is recorded as M h, h represents different left knife gate arm edge lines, any two left knife gate arm edge lines whose angle difference is within the angle threshold are divided into the same group, the left knife gate arm edge lines in the same group are sorted from long to short, and the angle of any edge line in the right knife gate arm edge line set after weight allocation relative to the horizontal position is recorded as N m , m represents different right knife gate arm edge lines, any two right knife gate arm edge lines whose angle difference is within the angle threshold are divided into the same group, the right knife gate arm edge lines in the same group are sorted from long to short, all the same groups of left knife gate arm edge lines and all the same groups of right knife gate arm edge lines are traversed and paired one by one;

[0026] Traverse all the same groups of the left knife gate arm edge line set and all the same groups of the right knife gate arm edge line set, calculate the average angle of each group, the average angle of each group of the left knife gate arm edge line set is combined with the left midpoint to obtain the corrected left knife gate arm edge line of each group of the left knife gate arm edge line set and calculate the weight of each group of corrected left knife gate arm edge line, the intersection of the corrected left knife gate arm edge line and the midline is recorded as point A, the average angle of each group of the right knife gate arm edge line set is combined with the right midpoint to obtain the corrected right knife gate arm edge line of each group of the right knife gate arm edge line set and calculate the weight of each group of corrected right knife gate arm edge line, the intersection of the corrected right knife gate arm edge line and the midline is recorded as point B, and the distance d between point A and point B is calculated. AB , the distance between the left and right midpoints of the knife gate arm is d 0 ;d AB / d 0 >0.5, the same group as point A and the same group as point B will be eliminated;

[0027] Calculate d AB / d 0 =ratio, set any two groups of corrected left and right knife gate arm edge lines as line_left and line_right, obtain the weights of the corrected left knife gate arm edge line and the corrected right knife gate arm edge line according to the above weight distribution method, record them as weight_left and weight_right respectively, then the calculation formula of the pairing score S is:

[0028] S=a*exp(-(ratio*ratio*a 2 ))*weight_left*weight_righta are adjustment parameters, weight_left and weight_right are the weights of the corrected left knife gate arm edge line and the corrected right knife gate arm edge line of any two groups, and the corrected left knife gate arm edge line at point A and the corrected right knife gate arm edge line at point B corresponding to the highest pairing score S are the final left knife gate arm edge line and right knife gate arm edge line.

[0029] The beneficial effects of the present invention are as follows: the method for accurately detecting the opening and closing angles of a double-leaf knife gate of the present invention first collects a template image, establishes a boundary line model of the knife gate arm of this model in the template image and saves it as a model file, and calculates the midpoint and centerline of the knife gate arm of this model according to the model file. The target image to be detected is collected at the same position using the same device, and the image size of the target image and the template image and the position relative to the acquisition device are the same; therefore, the midpoint and centerline of the knife gate arm in the model file are matched to the target image as a reference. In actual use, the use of the midpoint and centerline can effectively help distinguish the edge lines of the left and right knife gate arms and be used for pairing the edge lines of the left and right knife gate arms, which is beneficial to improving the detection accuracy and detection speed. Combined with the different states of the knife gate in actual use, the centerline of the knife gate arm remains unchanged, and the knife gate arm is detected to be in place based on the calculated angles of the left and right knife gate arms, which has important practical application value.

[0030] Weights are assigned to the left gate arm edge line set and the right gate arm edge line set. The closer the edge line is to the gate arm boundary line, the greater the weight is, and the farther the edge line is from the gate arm boundary line, the smaller the weight is. The weight of the edge line is related to the number of edge points close to the gate arm boundary line on the edge line. Therefore, the larger the weight is, the more edge points close to the gate arm boundary line are on the edge line, and the more likely the edge line is to be the actual gate arm edge line. The weight allocation conforms to the distribution law of the actual gate arm edge line, can improve the accuracy of symmetrical pairing of the gate arm edge lines, and has important practical application value.

[0031] When the left gate arm edge line set and the right gate arm edge line set are symmetrically paired, the gate arm center line is used, and the relationship between the pairing score and the weight of the edge line and the distance between the intersection of the left and right gate arm edge lines and the center line is fully considered. A practical pairing score calculation formula is proposed to improve the pairing accuracy and have higher recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 is the template image of the present invention;

[0034] Figure 2 It is a schematic diagram of the pairing of the edge lines of the left and right knife gate arms in the present invention;

[0035] Figure 3 It is a structural schematic diagram of the vertical edge line on the left knife gate arm in the present invention;

[0036] Figure 4 It is a structural schematic diagram of the horizontal edge line on the left knife gate arm in the present invention;

[0037] Figure 5 It is a structural schematic diagram of the inclined edge line on the left knife gate arm in the present invention.

[0038] In the figure:

[0039] 1. Left center point; 2. Right center point; 3. Vertical edge line; 4. Horizontal edge line; 5. Inclined edge line; 6. Left knife gate arm; 7. Right knife gate arm. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] Embodiment: A method for accurately detecting the opening and closing status of a split knife switch, comprising: Figure 1 As shown, a template image of a split knife gate is collected, a boundary line model of the knife gate arm of this model is established according to the template image and saved as a model file, and the midpoint and midline of the knife gate arm are calculated according to the model file; a target image of the same split knife gate is collected at the same position using the same equipment, and edge detection is performed on the target image to obtain an edge line set; the left midpoint 1 and the right midpoint 2 of the split knife gate calculated according to the model file are matched to the target image to obtain the left midpoint and the right midpoint of the knife gate arm of the target image, and the distance from the left midpoint and the right midpoint of the knife gate arm of the target image to each edge line in the edge line set is calculated, and the edge lines corresponding to the distances that are not within the threshold range are eliminated to obtain an edge line set. Get an updated edge line set; use a center line to distinguish the updated edge line set from left to right, obtain a left knife gate arm edge line set and a right knife gate arm edge line set respectively and distribute weights, symmetrically pair the left knife gate arm edge line set and the right knife gate arm edge line set after weight distribution, and determine the final left knife gate arm edge line and right knife gate arm edge line; calculate the angle between the left knife gate arm and the right knife gate arm, and detect whether the left knife gate arm and the right knife gate arm are opened and closed in place; the left midpoint is the center point of the two intersections of the left insulator center line extension line and the left knife gate arm 6 upper and lower boundary line extension lines, and the right midpoint is the center point of the two intersections of the right insulator center line extension line and the right knife gate arm 7 upper and lower boundary line extension lines.

[0042] In the embodiment, the method of "establishing the boundary line model of the knife switch arm of this model according to the template image and saving it as a model file" is as follows: a program is set on a computer, the template image is opened by the program, the upper and lower boundary lines of the knife switch arm are stroked according to the template image, the left insulator center line and the right insulator center line are drawn, the two intersection points of the upper and lower boundary line extension lines of the knife switch arm and the left insulator center line extension line are the two left end points, the two intersection points of the upper and lower boundary line extension lines of the knife switch arm and the right insulator center line extension line are the two right end points, and the coordinates of the two left end points and the two right end points are saved as a model file; if the knife switch in the template image is in a closed state, the upper and lower boundaries of the entire knife switch arm are stroked; if the knife switch in the template image is in a virtual closed or open state, the upper and lower boundaries of the actual left and right knife switch arms are stroked. The state of the knife switch in the template image is manually identified.

[0043] The method of "calculating the midpoint of the knife switch arm according to the model file" is as follows: when the knife switch is in the closed state, obtain the two intersection points of the upper and lower boundary line extension lines of the whole knife switch arm and the left insulator center line extension line according to the model file, record them as the two left end points, obtain the two intersection points of the upper and lower boundary line extension lines of the whole knife switch arm and the right insulator center line extension line, record them as the two right end points; obtain the left midpoint and the right midpoint according to the two left end points and the two right end points, and the midpoint of the line segment between the left midpoint and the right midpoint is the midpoint of the knife switch arm or the closed box formed by the two left end points and the two right end points. The midpoint of is the midpoint of the knife switch arm; when the knife switch is in a virtual closed or open state, the two intersection points of the upper and lower boundary line extension lines of the left knife switch arm and the left insulator center line extension line are obtained according to the model file, and recorded as the two left end points, and the two intersection points of the upper and lower boundary line extension lines of the right knife switch arm and the right insulator center line extension line are obtained, and recorded as the two right end points; the left midpoint and the right midpoint are obtained according to the two left end points and the two right end points, and the midpoint of the line segment between the left midpoint and the right midpoint is the midpoint of the knife switch arm or the midpoint of the closed frame formed by the two left end points and the two right end points is the midpoint of the knife switch arm.

[0044] The method of "calculating the center line of the knife gate arm according to the model file" is: when the knife gate in the template image is in a closed state, obtain the distortion coefficient of the camera that captures the template image, and calculate the camera matrix camera_matrix = [focal_length, 0, center.x; 0, focal_length, center.y; 0, 0, 1] according to the template image size, where focal_length is the template image width, center.x and center.y are the x-coordinate and y-coordinate of the midpoint of the template image respectively. ; The coordinate position of the device relative to the knife gate during acquisition is obtained according to the two left end points and the two right end points, the projection direction of the Z axis of the device on the template image is the centerline direction of the knife gate arm, and the centerline of the knife gate arm is determined in combination with the midpoint of the knife gate arm; when the knife gate in the template image is in a virtual closed or open state, the left centerline is obtained according to the left midpoint and the average slope of the upper and lower boundary lines of the left knife gate arm, and the right centerline is obtained according to the right midpoint and the average slope of the upper and lower boundary lines of the right knife gate arm, and the left centerline and the right centerline are extended to form an intersection; the line passing through the intersection and the midpoint is the centerline of the knife gate arm.

[0045] In the specific method of "calculating the center line of the knife gate arm according to the model file", when the knife gate is in a virtual closed or open state, another method of calculating the center line of the knife gate arm according to the model file is: according to the intersection of the left center line and the right side edge of the left knife gate arm, the right midpoint of the right knife gate arm is obtained according to the intersection of the right center line and the left side edge of the right knife gate arm, and the coordinate position of the device relative to the knife gate during acquisition is obtained according to the left midpoint, the right midpoint, the left midpoint and the right midpoint. The projection direction of the Z axis of the device on the template image is the center line direction of the knife gate arm, and the center line of the knife gate arm is determined in combination with the midpoint of the knife gate arm; the right side of the left knife gate arm is the line connecting the two right side end points of the upper and lower boundary lines of the left knife gate arm, and the left side of the right knife gate arm is the line connecting the two left side end points of the upper and lower boundary lines of the right knife gate arm.

[0046] The method of "performing edge detection on the target image and obtaining an edge line set" is: performing edge detection on the target image. The edge detection method used here is LSD edge detection. By inputting the target image of the double-leaf knife gate to be detected, all the edge lines of the image can be obtained. At the same time, any method that can help detect the edge of the knife gate arm can be used, such as EDLines, Hough transform straight line detection, etc., to obtain an edge line set.

[0047] The method of "calculating the distance from the left midpoint and the right midpoint of the knife gate arm of the target image to each edge line in the edge line set, eliminating the edge lines corresponding to the distances that are not within the threshold range, and obtaining the updated edge line set" is as follows: calculating the distance from the left midpoint of the target image to each edge line, and calculating the distance from the right midpoint of the target image to each edge line; given the left distance threshold and the right distance threshold, obtaining the edge lines whose distances to the left midpoint are within the left distance threshold, obtaining the edge lines whose distances to the right midpoint are within the right distance threshold, and the edge lines within the left distance threshold and the right distance threshold are the updated edge line set. The left distance threshold can be set as 0.6 times the width of the side of the left knife gate arm, and the right distance threshold can be set as 0.6 times the width of the side of the right knife gate arm. The left distance threshold and the right distance threshold can be set according to actual conditions.

[0048] The specific method of "using the center line to distinguish the updated edge line set from the left and right, and obtaining the edge line set of the left knife gate arm and the edge line set of the right knife gate arm respectively" is: directly correspond the midpoint and center line of the knife gate arm calculated according to the model file to the target image, and calculate the unit direction vector perpendicular to the center line and pointing to the right or left on the target image with the midpoint as the starting point Traverse and update the edge lines in the edge line set, record the two endpoints of any edge line as T1 and T2, and record the vector between T1 and the midpoint as The vector between T2 and the midpoint is denoted as calculate and For a unit direction vector pointing to the right like Then T1 is on the right side of the midline, otherwise it is on the left side of the midline; if Then T2 is on the right side of the midline, otherwise on the left side of the midline; for a unit direction vector pointing to the left like Then T1 is on the left side of the midline, otherwise it is on the right side of the midline; if Then T2 is on the left side of the center line, otherwise it is on the right side of the center line; if T1 and T2 are both on the left side of the center line, then the edge line is the edge line of the left knife gate arm, if T1 and T2 are both on the right side of the center line, then the edge line is the edge line of the right knife gate arm, if T1 and T2 are respectively on both sides of the center line, calculate the length of the left and right line segments of the edge line with the center line as the dividing line, and the edge line is the edge line on the longer side of the left and right side segments; in this way, the left knife gate arm edge line set and the right knife gate arm edge line set are obtained.

[0049] Unit direction vector The specific calculation method is: set the midline of the knife gate arm on the target image to y = kx + b, and the midpoint coordinates to (C x ,C y ), set the equation of the vertical line perpendicular to the midline and passing through the midpoint to y = cx + d, c = -1 / k, C y=-1 / k*C x +d,d=C y +1 / k*C x ; Calculate the unit direction vector starting from the midpoint and pointing to the right based on the straight line equation of the perpendicular line Assume the end point coordinates of the unit direction vector are (n x ,n y ), then (n y -C y ) / (n x -C x )=-1 / k,(n y -C y ) 2 +(n x -C x ) 2 =1, find n x and n y , the unit direction vector

[0050] The method of “assigning weights to the left gate arm edge line set and the right gate arm edge line set” is as follows: Figures 3 to 5As shown, the way to assign weights to the left knife gate arm edge line set is as follows: traverse all edge lines in the left knife gate arm edge line set, calculate the angle of each left knife gate arm edge line and classify the left edge according to it, give a high angle threshold and a low angle threshold, set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle greater than the high angle threshold as a vertical edge line 3, set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle less than the low angle threshold as a horizontal edge line 4, and set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle between the low angle threshold and the high angle threshold as an inclined edge line 5; for all vertical edge lines 3 of the left knife gate arm, set the x coordinate value L_x of the left midpoint of the left knife gate arm, and on the left and right sides of the left midpoint of the left knife gate arm Find two edge points corresponding to the x-coordinates with the smallest difference from L_x respectively, the x-coordinate values ​​of the two edge points on the left are recorded as L_x1 and L_x2, L_x1 is greater than L_x2; the x-coordinate values ​​of the two edge points on the right are recorded as R_x1 and R_x2, R_x1 is greater than R_x2; for all horizontal edge lines 4 of the left knife gate arm, set the y-coordinate value of the left midpoint of the left knife gate arm to L_y, and find two edge points corresponding to the y-coordinates with the smallest difference from L_y on the upper and lower sides of the left midpoint of the left knife gate arm respectively, the y-coordinate values ​​of the two edge points on the upper side are recorded as T_y1 and T_y2, T_y1 is greater than T_y2; the y-coordinate values ​​of the two edge points on the lower side are recorded as B_y1 and B_y2, B_y1 is greater than By2; for all horizontal edge lines 4 of the left knife gate arm, set the y-coordinate value of the left midpoint of the left knife gate arm to L_y, and find two edge points corresponding to the y-coordinates with the smallest difference from L_y on the upper and lower sides of the left midpoint of the left knife gate arm respectively. Incline edge line 5, set the x-coordinate value and y-coordinate value of the left midpoint of the left knife gate arm to L_xx and L_yy, and find two edge points corresponding to the x-coordinate with the smallest difference from L_xx and the edge point corresponding to the y-coordinate with the smallest difference from L_yy on the upper left and lower right sides of the left midpoint of the left knife gate arm respectively. The x-coordinate values ​​of the two edge points on the upper left are recorded as L_xx1 and L_xx2, L_xx1 is greater than _xx2, and the y-coordinate values ​​are recorded as T_yy1 and T_yy2, T_yy1 is greater than T_yy2; the x-coordinate values ​​of the two edge points on the lower right are recorded as R_xx1 and R_xx2, R_xx1 is greater than R_xx2, and the y-coordinate values ​​are recorded as B_yy1 and B_yy2, B_yy1 is greater than B_yy2; obtain each vertical edge The weight of edge line 3 is calculated as follows: traverse each edge point on each vertical edge line to the left of the left midpoint of the left knife gate arm, and when the x-coordinate value of the edge point is greater than or equal to L_x1, its contribution weight is Vertical_W; when the x-coordinate value of the edge point is greater than or equal to L_x2 and less than L_x1, its contribution weight is Vertical_W / 2; otherwise, the contribution weight of the edge point is 0; traverse each edge point on the edge line to the right of the left midpoint of the left knife gate arm, and when the x-coordinate value of the edge point is less than or equal to L_x2, its contribution weight is Vertical_W; when the x-coordinate value of the edge point is greater than L_x2 and less than or equal to L_x1, its contribution weight is Vertical_W / 2; otherwise, the contribution weight of the edge point is 0;The method of obtaining the weight of each horizontal edge line 4 is as follows: traverse each edge point on the edge line located on the upper side of the left midpoint of the left knife gate arm, and when the y coordinate value of the edge point is greater than or equal to T_y1, its contribution weight is Vertical_W, and when the y coordinate value of the edge point is greater than or equal to T_y2 and less than T_y1, its contribution weight is Vertical_W / 2, otherwise the contribution weight of the edge point is 0; traverse each edge point on the edge line located on the lower side of the left midpoint of the left knife gate arm, and when the y coordinate value of the edge point is less than or equal to B_y2, its contribution weight is Vertical_W, and when the y coordinate value of the edge point is greater than B_y2 and less than or equal to B_y1, its contribution weight is Vertical_W / 2, otherwise the contribution weight of the edge point is 0;

[0051] The method for obtaining the weight of each inclined edge line 5 is as follows: traverse each edge point on the edge line located on the upper left side of the left midpoint of the left knife gate arm, when the x-coordinate value of the edge point is greater than or equal to L_xx1, its contribution weight is Vertical_W, when the x-coordinate value of the edge point is greater than or equal to L_xx2 and less than L_xx1, its contribution weight is Vertical_W / 2, otherwise the contribution weight of the edge point is 0, when the y-coordinate value of the edge point is greater than or equal to T_yy1, its contribution weight is Vertical_W, when the y-coordinate value of the edge point is greater than or equal to T_yy2 and less than T_yy1, its contribution weight is Vertical_W / 2, otherwise the edge point is The contribution weight of the point is 0; traverse each edge point on the edge line located on the lower right side of the left midpoint of the left knife gate arm. When the x coordinate value of the edge point is less than or equal to L_xx2, its contribution weight is Vertical_W; when the x coordinate value of the edge point is greater than L_xx2 and less than or equal to L_xx1, its contribution weight is Vertical_W / 2; otherwise, the contribution weight of the edge point is 0; when the y coordinate value of the edge point is less than or equal to B_yy2, its contribution weight is Vertical_W; when the y coordinate value of the edge point is greater than B_yy2 and less than or equal to B_yy1, its contribution weight is Vertical_W / 2; otherwise, the contribution weight of the edge point is 0;

[0052] The way to assign weights to the right gate arm edge line set is the same as the way to assign weights to the left gate arm edge line set. The contribution weight of each edge point is set according to its location, and Value_W can be set to a coefficient of 2 or 4, etc., to facilitate the calculation of contribution weights under different conditions.

[0053] The specific method of symmetrically pairing the weighted left gate arm edge line set and the right gate arm edge line set to determine the left gate arm edge line and the right gate arm edge line is as follows:

[0054] Given an angle threshold, the angle of any edge line in the weighted left knife gate arm edge line set relative to the horizontal position is recorded as Mh , h represents different left knife gate arm edge lines, any two left knife gate arm edge lines whose angle difference is within the angle threshold are divided into the same group, and the left knife gate arm edge lines in the same group are sorted from long to short; for any edge line in the right knife gate arm edge line set, the angle relative to the horizontal position is recorded as N m , m represents different right knife gate arm edge lines, any two right knife gate arm edge lines whose angle difference is within the angle threshold are divided into the same group, and the right knife gate arm edge lines in the same group are sorted from long to short; all the same groups of the left knife gate arm edge line set and all the same groups of the right knife gate arm edge line set are traversed and paired one by one, and the score of each pairing is calculated; all the same groups of the left knife gate arm edge line set and all the same groups of the right knife gate arm edge line set are traversed, and the average angle of each group of the left knife gate arm edge line set is combined with the left midpoint to obtain the corrected left knife gate arm edge line of each group of the left knife gate arm edge line set, and the intersection of the corrected left knife gate arm edge line and the midline is recorded as point A; the average angle of each group of the right knife gate arm edge line set is combined with the right midpoint to obtain the corrected right knife gate arm edge line of each group of the right knife gate arm edge line set, and the intersection of the corrected right knife gate arm edge line and the midline is recorded as point B, and the distance d between point A and point B is calculated. AB ; The distance between the left and right midpoints of the knife gate arm is d 0 , d AB / d 0 The smaller the value, the greater the probability that the paired corrected left knife gate arm edge line and the corrected right knife gate arm edge line are the actual left knife gate arm edge line and the actual right knife gate arm edge line. AB / d 0 >0.5, then remove the group containing point A and point B; calculate d AB / d 0 =ratio, set the corrected left and right knife gate arm edge lines of any two groups as line_left and line_right, obtain the weights of the corrected left knife gate arm edge line and the corrected right knife gate arm edge line according to the above weight distribution, and record them as weight_left and weight_right respectively. The calculation formula of the pairing score S is:

[0055] S=a*exp(-(ratio*ratio*a 2))*weight_left*weight_right, where a is the adjustment parameter, which is set according to multiple experiments and prior knowledge, weight_left and weight_right are the weights of any two groups of corrected left knife gate arm edge lines and corrected right knife gate arm edge lines, and the pairing score calculation formula is inversely proportional to ratio and directly proportional to weigh_tleft and weight_right, indicating that the closer the intersection of the current corrected left knife gate arm edge line and the corrected right knife gate arm edge line with the center line is, the greater the weight of the current corrected left knife gate arm edge line and the corrected right knife gate arm edge line is, the higher the pairing score is, and the more likely the current corrected left knife gate arm edge line and the corrected right knife gate arm edge line are to be the actual left knife gate arm edge line and the actual right knife gate arm edge line, because the actual left knife gate arm edge line and the actual right knife gate arm edge line should intersect the center line at the same point, that is, the corresponding d AB / d 0 =ratio=0, and the actual weight values ​​of the left knife gate arm edge line and the right knife gate arm edge line are larger.

[0056] When performing edge line symmetry pairing, the most important factors affecting the pairing result are the distance between the intersection of the left and right blade gate arm edge lines and the center line of each pair and the weight of the left and right blade gate arm edge lines. The calculation formula shows that the distance d between the intersection of the left and right blade gate arm edge lines and the center line of each pair is AB The smaller it is, and the greater the weight assigned to the corrected left and right gate arm edge lines, the higher the pairing score, and the more likely it is that the left and right gate arm edge lines are paired. The pairing score calculation formula conforms to the actual situation. The corrected left gate arm edge line at point A and the corrected right gate arm edge line at point B corresponding to the highest pairing score S are the final left gate arm edge line and right gate arm edge line.

[0057] like Figure 2 As shown in the figure, the method of "calculating the angle between the left knife gate arm and the right knife gate arm" is: the angle between the edge line of the left knife gate arm and the straight line where the knife gate arm in the closed state is located is α 1 The angle between the edge line of the right knife gate arm and the straight line of the knife gate arm in the closed state is α 2 , the final angle between the left and right knife gate arms is θ=|α 2 -α 1 |, in actual use, the angle range of the knife switch open, virtual closed and closed states can be determined according to user needs, and the final state of the knife switch arm can be determined according to the calculated angle between the knife switch arms.

[0058] A double-opening knife switch refers to a double-column center-break isolating switch. The double columns refer to the vertical insulators on the left and right sides, and the center break refers to the contact position of the left and right knife switch arms when they are in a virtual or closed state. During the opening and closing process of this type of isolating switch, the left and right knife switch arms use the upper end point of the insulator as the rotation point, and the left and right knife switch arms open and close synchronously and symmetrically.

[0059] When creating the model file, the closed state of the knife gate refers to the left and right knife gate arms being in the same straight line, the virtual closed state refers to the left and right knife gate arms being in contact but not in the same straight line, and the open state refers to the left and right knife gate arms not being in contact. The knife gate state here is general, which is different from the knife gate state obtained according to the angle between the knife gate arms. The knife gate state obtained according to the angle between the knife gate arms is the final state of the knife gate in the target image.

[0060] The knife switch referred to in the present invention is an abbreviation of a split knife switch.

[0061] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for accurately detecting the opening and closing angles of a split knife switch, characterized in that: include: A template image of a split knife gate is collected, a boundary line model of the knife gate arm is established according to the template image and saved as a model file, and the midpoint and center line of the knife gate arm are calculated according to the model file; a target image of the same split knife gate is collected at the same position using the same equipment, and edge detection is performed on the target image to obtain an edge line set; the left center point and the right center point of the split knife gate calculated according to the model file are matched to the target image to obtain the left center point and the right center point of the knife gate arm of the target image, and the distance from the left center point and the right center point of the knife gate arm of the target image to each edge line in the edge line set is calculated, and the edge lines corresponding to the distances that are not within the threshold range are eliminated to obtain an updated image. Edge line set; Use the center line to distinguish the updated edge line set from left to right, obtain the left knife gate arm edge line set and the right knife gate arm edge line set respectively and assign weights; Symmetrically pair the left knife gate arm edge line set and the right knife gate arm edge line set after weight assignment to determine the final left knife gate arm edge line and right knife gate arm edge line; Calculate the angle between the left knife gate arm and the right knife gate arm, and detect whether the left knife gate arm and the right knife gate arm are in place; The left midpoint is the center point of the two intersections of the left insulator center line extension line and the left knife gate arm upper and lower boundary line extension lines, and the right midpoint is the center point of the two intersections of the right insulator center line extension line and the right knife gate arm upper and lower boundary line extension lines; The method of "calculating the midpoint of the knife switch arm according to the model file" is: when the knife switch is in the closed state, obtain the two intersection points of the upper and lower boundary line extension lines of the whole knife switch arm and the left insulator center line extension line according to the model file, record them as the two left end points, obtain the two intersection points of the upper and lower boundary line extension lines of the whole knife switch arm and the right insulator center line extension line, record them as the two right end points; obtain the left midpoint and the right midpoint according to the two left end points and the two right end points, and the midpoint of the line segment between the left midpoint and the right midpoint is the midpoint of the knife switch arm or the closed box formed by the two left end points and the two right end points. The midpoint of is the midpoint of the knife switch arm; when the knife switch is in a virtual closing or opening state, the two intersection points of the upper and lower boundary line extension lines of the left knife switch arm and the left insulator center line extension line are obtained according to the model file, recorded as the two left end points, and the two intersection points of the upper and lower boundary line extension lines of the right knife switch arm and the right insulator center line extension line are obtained, recorded as the two right end points; the left midpoint and the right midpoint are obtained according to the two left end points and the two right end points, and the midpoint of the line segment between the left midpoint and the right midpoint is the midpoint of the knife switch arm or the midpoint of the closed frame formed by the two left end points and the two right end points is the midpoint of the knife switch arm; The method of "calculating the center line of the knife gate arm according to the model file" is: when the knife gate in the template image is in the closed state, obtain the distortion coefficient of the camera that captures the template image, and calculate the camera matrix camera_matrix=[focal_length, 0, center.x; 0,focal_length,center.y; 0, 0, 1], where focal_length is the width of the template image, center.x and center.y are the x-coordinate and y-coordinate of the midpoint of the template image respectively; the coordinate position of the device relative to the knife gate during acquisition is obtained according to the two left end points and the two right end points, the projection direction of the Z axis of the device on the template image is the midline direction of the knife gate arm, and the midline of the knife gate arm is determined in combination with the midpoint of the knife gate arm; when the knife gate in the template image is in a virtual closed or open state, the left center line is obtained according to the average slope of the left midpoint and the upper and lower boundary lines of the left knife gate arm, and the right center line is obtained according to the average slope of the right midpoint and the upper and lower boundary lines of the right knife gate arm, and the left center line and the right center line are extended to form an intersection; the line passing through the intersection and the midpoint is the midline of the knife gate arm; The specific method of "using the center line to distinguish the updated edge line set from the left and right, and obtaining the edge line set of the left knife gate arm and the edge line set of the right knife gate arm respectively" is: directly correspond the midpoint and center line of the knife gate arm calculated according to the model file to the target image, and calculate the unit direction vector perpendicular to the center line to the left or right with the midpoint as the starting point on the target image. , traverse and update the edge lines in the edge line set, record the two endpoints of any edge line as T1 and T2, and record the vector between T1 and the midpoint as , let the vector between T2 and the midpoint be ,calculate and , for a unit direction vector pointing to the right ,like , then T1 is on the right side of the midline, otherwise it is on the left side of the midline; if , then T2 is on the right side of the midline, otherwise on the left side of the midline; for a unit direction vector pointing to the left ,like , then T1 is on the left side of the midline, otherwise it is on the right side of the midline; if , then T2 is on the left side of the center line, otherwise on the right side of the center line; if T1 and T2 are both on the left side of the center line, then the edge line is the edge line of the left knife gate arm, if T1 and T2 are both on the right side of the center line, then the edge line is the edge line of the right knife gate arm, if T1 and T2 are on both sides of the center line respectively, calculate the length of the left and right line segments of the edge line with the center line as the dividing line, and the edge line is the edge line on the side with the longer left and right line segments; in this way, the left knife gate arm edge line set and the right knife gate arm edge line set are obtained; The method of "weighting the left knife gate arm edge line set and the right knife gate arm edge line set" is as follows: the method of weighting the left knife gate arm edge line set is as follows: traverse all edge lines in the left knife gate arm edge line set, calculate the angle of each left knife gate arm edge line and classify the left knife gate arm edge according to it, give a high angle threshold and a low angle threshold, set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle greater than the high angle threshold as a vertical edge line, set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle less than the low angle threshold as a horizontal edge line, and set the left knife gate arm edge line corresponding to the left knife gate arm edge line angle between the low angle threshold and the high angle threshold as an inclined edge line; For all vertical edge lines of the left knife gate arm, set the x-coordinate value L_x of the left midpoint of the left knife gate arm, and find two edge points corresponding to the x-coordinates with the smallest difference from L_x on the left and right sides of the left midpoint of the left knife gate arm. The x-coordinate values ​​of the two edge points on the left are recorded as L_x1 and L_x2, and L_x1 is greater than L_x2; the x-coordinate values ​​of the two edge points on the right are recorded as R_x1 and R_x2, and R_x1 is greater than R_x2; For all horizontal edge lines of the left knife gate arm, set the y coordinate value of the left midpoint of the left knife gate arm as L_y, and find two edge points corresponding to the y coordinates with the smallest difference from L_y on the upper and lower sides of the left midpoint of the left knife gate arm, and the y coordinate values ​​of the two upper edge points are recorded as T_y1 and T_y2, T_y1 is greater than T_y2; the y coordinate values ​​of the two lower edge points are recorded as B_y1 and B_y2, B_y1 is greater than B_y2; For all inclined edge lines of the left knife gate arm, set the x-coordinate value and y-coordinate value of the left midpoint of the left knife gate arm as L_xx and L_yy, respectively, and find two edge points corresponding to the x-coordinate with the smallest difference from L_xx and the edge point corresponding to the y-coordinate with the smallest difference from L_yy on the upper left side and lower right side of the left midpoint of the left knife gate arm, the x-coordinate values ​​of the two edge points on the upper left side are recorded as L_xx1 and L_xx2, L_xx1 is greater than _xx2, and the y-coordinate values ​​are recorded as T_yy1 and T_yy2, T_yy1 is greater than T_yy2; the x-coordinate values ​​of the two edge points on the lower right side are recorded as R_xx1 and R_xx2, R_xx1 is greater than R_xx2, and the y-coordinate values ​​are recorded as B_yy1 and B_yy2, B_yy1 is greater than B_yy2; The method of obtaining the weight of each vertical edge line is as follows: traverse each edge point on each vertical edge line located to the left of the left midpoint of the left knife gate arm, and when the x-coordinate value of the edge point is greater than or equal to L_x1, its contribution weight is Value_W, and when the x-coordinate value of the edge point is greater than or equal to L_x2 and less than L_x1, its contribution weight is Value_W / 2, otherwise the contribution weight of the edge point is 0; traverse each edge point on each vertical edge line located to the right of the left midpoint of the left knife gate arm, and when the x-coordinate value of the edge point is less than or equal to L_x2, its contribution weight is Value_W, and when the x-coordinate value of the edge point is greater than L_x2 and less than or equal to L_x1, its contribution weight is Value_W / 2, otherwise the contribution weight of the edge point is 0, and the sum of the contribution weights of all edge points is the weight of the current vertical edge line; The method of obtaining the weight of each horizontal edge line is as follows: traverse each edge point on each horizontal edge line located on the upper side of the left midpoint of the left knife gate arm, and when the y coordinate value of the edge point is greater than or equal to T_y1, its contribution weight is Value_W, and when the y coordinate value of the edge point is greater than or equal to T_y2 and less than T_y1, its contribution weight is Value_W / 2, otherwise the contribution weight of the edge point is 0; traverse each edge point on each horizontal edge line located on the lower side of the left midpoint of the left knife gate arm, and when the y coordinate value of the edge point is less than or equal to B_y2, its contribution weight is Value_W, and when the y coordinate value of the edge point is greater than B_y2 and less than or equal to B_y1, its contribution weight is Value_W / 2, otherwise the contribution weight of the edge point is 0, and the sum of the contribution weights of all edge points is the weight of the current horizontal edge line; The method for obtaining the weight of each inclined edge line is as follows: traverse each edge point on each inclined edge line located on the upper left side of the left midpoint of the left knife gate arm. When the x-coordinate value of the edge point is greater than or equal to L_xx1, its contribution weight is Value_W; when the x-coordinate value of the edge point is greater than or equal to L_xx2 and less than L_xx1, its contribution weight is Value_W / 2; otherwise, the contribution weight of the edge point is 0; when the y-coordinate value of the edge point is greater than or equal to T_yy1, its contribution weight is Value_W; when the y-coordinate value of the edge point is greater than or equal to T_yy2 and less than T_yy1, its contribution weight is Vertical_W / 2; otherwise, the contribution weight of the edge point is 0; traverse each inclined edge located on the lower right side of the left midpoint of the left knife gate arm For each edge point on the line, when the x-coordinate value of the edge point is less than or equal to L_xx2, its contribution weight is Value_W; when the x-coordinate value of the edge point is greater than L_xx2 and less than or equal to L_xx1, its contribution weight is Value_W / 2; otherwise, the contribution weight of the edge point is 0; when the y-coordinate value of the edge point is less than or equal to B_yy2, its contribution weight is Value_W; when the y-coordinate value of the edge point is greater than B_yy2 and less than or equal to B_yy1, its contribution weight is Value_W / 2; otherwise, the contribution weight of the edge point is 0; the sum of the contribution weights of all edge points is the weight of the current inclined edge line; the way of assigning weights to the right knife gate arm edge line set is the same as the way of assigning weights to the left knife gate arm edge line set; The method of "symmetrically pairing the weighted left knife gate arm edge line set and the right knife gate arm edge line set to determine the final left knife gate arm edge line and right knife gate arm edge line" is as follows: given an angle threshold, the angle of any edge line in the weighted left knife gate arm edge line set relative to the horizontal position is recorded as , Representing different left knife gate arm edge lines, any two left knife gate arm edge lines whose angle difference is within the angle threshold are divided into the same group, the left knife gate arm edge lines in the same group are sorted from long to short, and the angle of any edge line in the right knife gate arm edge line set after weighting is assigned relative to the horizontal position is recorded as , Representing different right knife gate arm edge lines, any two right knife gate arm edge lines whose angle difference is within the angle threshold are divided into the same group, the right knife gate arm edge lines in the same group are sorted from long to short, and all the same groups of the left knife gate arm edge line set and all the same groups of the right knife gate arm edge line set are traversed and paired one by one; Traverse all the same groups of the left knife gate arm edge line set and all the same groups of the right knife gate arm edge line set, calculate the average angle of each group, the average angle of each group of the left knife gate arm edge line set is combined with the left midpoint to obtain the corrected left knife gate arm edge line of each group of the left knife gate arm edge line set and calculate the weight of each group of corrected left knife gate arm edge line, the intersection of the corrected left knife gate arm edge line and the midline is recorded as point A, the average angle of each group of the right knife gate arm edge line set is combined with the right midpoint to obtain the corrected right knife gate arm edge line of each group of the right knife gate arm edge line set and calculate the weight of each group of corrected right knife gate arm edge line, the intersection of the corrected right knife gate arm edge line and the midline is recorded as point B, and the distance between point A and point B is calculated. , the distance between the left and right midpoints of the knife gate arm is ; Then the group where point A is located and the group where point B is located are eliminated; calculate , set any two groups of corrected left and right knife gate arm edge lines as line_left and line_right, and obtain the weights of the corrected left knife gate arm edge line and the corrected right knife gate arm edge line according to the above weight distribution method, which are recorded as and , then the pairing score The calculation formula is: , To adjust the parameters, and are the weights of the corrected left gate arm edge line and the corrected right gate arm edge line of any two groups. The corrected left gate arm edge line at point A and the corrected right gate arm edge line at point B corresponding to the highest pairing score S are the final left gate arm edge line and right gate arm edge line.

2. The method for accurately detecting the opening and closing angle of a split knife switch according to claim 1 is characterized in that: The method of "establishing a boundary line model of the knife switch arm according to the template image and saving it as a model file" is as follows: set up a program on the computer, use the program to open the template image, stroke the upper and lower boundary lines of the knife switch arm according to the template image, draw the left insulator center line and the right insulator center line, and save the line segment endpoint coordinates corresponding to the stroke and the line segment endpoint coordinates corresponding to the left and right insulator center lines as a model file; if the knife switch in the template image is in a closed state, stroke the upper and lower boundaries of the entire knife switch arm; if the knife switch in the template image is in a virtual closed or open state, stroke the upper and lower boundaries of the actual left and right knife switch arms.

3. The method for accurately detecting the opening and closing angle of a split knife switch according to claim 1, characterized in that: Another way of "when the knife gate is in a virtual closed or open state, calculate the center line of the knife gate arm according to the model file" is: obtain the right midpoint of the left knife gate arm according to the intersection of the left center line and the right side of the left knife gate arm, obtain the left midpoint of the right knife gate arm according to the intersection of the right center line and the left side of the right knife gate arm, obtain the coordinate position relative to the knife gate when the device is collecting according to the left midpoint, the right midpoint, the left midpoint and the right midpoint, the projection direction of the Z axis of the device on the template image is the center line direction of the knife gate arm, and the center line of the knife gate arm is determined in combination with the midpoint of the knife gate arm; the right side of the left knife gate arm is the line connecting the two right side end points of the upper and lower boundary lines of the left knife gate arm, and the left side of the right knife gate arm is the line connecting the two left side end points of the upper and lower boundary lines of the right knife gate arm.

Citation Information

Patent Citations

  • Methods and systems for determining whether a disconnector is open or closed

    CN102262734A

  • Machine vision-based method for judging the closing operation of disconnector

    CN109063764A