A method for detecting the opening and closing angle of split knife switches based on the midline model

Through the detection method based on the center line model, the problem of low detection accuracy of the split knife gate in the existing technology is solved, accurate detection under complex background is achieved, and the detection speed and accuracy are improved.

CN111127388BActive Publication Date: 2024-10-29ZHANJIANG ZHONGHUI POWER CONSULTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910895596.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-21
Publication Date
2024-10-29
Estimated Expiration
2039-09-21

AI Technical Summary

Technical Problem

The existing technology is difficult to quickly and accurately detect whether the bi-fold knife gate is opened and closed in place. Especially in complex backgrounds, the blurred edges of the knife gate arms in the image affect the detection effect, resulting in the inability to accurately detect the angle between the left and right knife gate arms.

Method used

Using a detection method based on the midline model, the boundary line model of the knife gate arm is established by collecting template images, calculating the midpoint and midline, and applying them to the target image, distinguishing and pairing edge lines, and calculating the angle to determine the opening and closing status. .

Benefits of technology

The detection accuracy and speed are improved, and it can accurately detect whether the knife gate arm is opened and closed in place under different conditions, which has important practical application value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111127388B_ABST
    Figure CN111127388B_ABST
Patent Text Reader

Abstract

The present invention proposes a method for detecting the opening and closing angle of a split knife gate based on a midline model, comprising: collecting a template image and establishing a boundary line model of a 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 split 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 performing symmetrical pairing to determine the final left knife gate arm edge line and right knife gate arm edge line; and 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 detect whether a split knife gate is in place in actual use, and improves the detection 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 detecting the opening and closing angles of a split knife switch based on a midline model. 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 open or close 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 in place. In the prior art, the degree of opening and closing of the knife switch is also determined by calculating the angle between the left and right knife switch arms. 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; the other 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, it is difficult to correctly match the knife switch, which reduces the detection accuracy. In addition, due to the influence of the shooting environment, the edge of the knife switch arm in the image is blurred, 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 split knife gate is fully opened or closed, the present invention proposes a method for detecting the opening and closing angle of a split knife gate based on a midline model.

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

[0006] A method for detecting the opening and closing angle of a split knife switch based on a midline model, comprising:

[0007] The template image of the split knife gate is collected, and the boundary line model of the knife gate arm of the 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;

[0008] At the same position, the target image of the same double-opening knife gate is collected by using the same equipment, and the edge detection is performed on the target image to obtain the edge line set;

[0009] The left midpoint and the right midpoint 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 the updated edge line set;

[0010] The updated edge line set is divided into left and right by using the center line, and the left knife gate arm edge line set and the right knife gate arm edge line set are obtained respectively and symmetrically matched, and the left knife gate arm edge line and the right knife gate arm edge line are determined;

[0011] Calculate the angle between the left and right knife gate arms;

[0012] 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.

[0013] Preferably, the method of "establishing the boundary line model of the switch arm of the model according to the template image and saving it as a model file" is: setting a program on a computer, using the program to open the template image, tracing the upper and lower boundary lines of the switch arm according to the template image, drawing the left insulator center line and the right insulator center line, and saving the line segment endpoint coordinates corresponding to the tracing and the line segment endpoint coordinates corresponding to the left and right insulator center lines as a model file;

[0014] If the knife gate in the template image is in a closed state, the upper and lower boundaries of the entire knife gate arm are outlined;

[0015] If the knife gate in the template image is in a virtual closed or open state, outline it according to the actual upper and lower boundaries of the left and right knife gate arms.

[0016] Preferably, the method of "calculating the midpoint of the knife switch arm according to the model file" is: when the knife switch in the template image is in a closed state, two intersection points of the upper and lower boundary line extension lines of the overall knife switch arm and the left insulator center line extension line are 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 overall 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;

[0017] When the knife switch in the template image 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 box formed by the two left end points and the two right end points is the midpoint of the knife switch arm.

[0018] Preferably, the method of "calculating the center line of the knife gate arm according to the model file" is:

[0019] When the knife gate in the template image is in a closed state, obtain the distortion coefficient of the camera that collects 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 size of the template image, 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; obtain the coordinate position of the device relative to the knife gate during acquisition according to the two left endpoints and the two right endpoints, 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;

[0020] 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.

[0021] 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.

[0022] Preferably, 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: calculating the distance from the left midpoint of the knife gate arm of the target image to each edge line, and calculating the distance from the right midpoint of the knife gate arm of the target image to each edge line; given a left distance threshold and a right distance threshold, obtaining the edge lines whose distance to the left midpoint is within the left distance threshold, obtaining the edge lines whose distance to the right midpoint is 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.

[0023] Preferably, the specific method of "using the center line to distinguish the updated edge line set from the left and right to obtain the left knife gate arm edge line set and the right knife gate arm edge line set respectively" is:

[0024] Directly correspond the midpoint and midline of the knife gate arm calculated according to the model file to the target image, and calculate the unit direction vector perpendicular to the midline and pointing to the right or left on the target image with the midpoint as the starting point.

[0025] 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. 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 If T1 is on the left side of the midline, otherwise it is on the right side of the midline. 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.

[0026] Preferably, the method of "symmetrically pairing the 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:

[0027] Given an angle threshold, the angle of any edge line in the 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, 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 edge lines of the right knife gate arm, any two edge lines of the right knife gate arm whose angle difference is within the angle threshold are divided into the same group, and the edge lines of the right knife gate arm in the same group are sorted from long to short;

[0028] Traverse all the same groups of the left gate arm edge line set and all the same groups of the right gate arm edge line set and pair them one by one, calculate the corrected gate arm edge lines and pairing scores of any two groups, and the corrected left gate arm edge lines and right gate arm edge lines corresponding to the combination with the highest score are the final left gate arm edge lines and right gate arm edge lines.

[0029] Preferably, the method of "traversing all the same groups of the edge lines of the left knife gate arm and all the same groups of the edge lines of the right knife gate arm and performing one-to-one pairing, and calculating the score of each pairing group" is:

[0030] Calculate the average angle of each group. Combine the average angle of each group of left knife gate arm edge lines with the left midpoint to obtain the corrected left knife gate arm edge line of each group of left knife gate arm edge lines. The intersection of the corrected left knife gate arm edge line and the midline is recorded as point A. Combine the average angle of each group of right knife gate arm edge lines with the right midpoint to obtain the corrected right knife gate arm edge line of each group of right knife gate arm edge lines. The intersection of the corrected right knife gate arm edge line and the midline is recorded as point B. Calculate the distance d between point A and point B AB ;

[0031] 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, the same group as point A and the same group as point B will be eliminated;

[0032] The calculation formula for any two pairs of matching scores is set as The coefficient S L S represents the sum of the squares of the lengths of any edge line in the same group of the left knife gate arm edge line set; R Represents the sum of the squares of the lengths of any edge line in the same group of the right knife gate arm edge line set; β is an adjustable sensitivity parameter; 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.

[0033] Preferably, the method of "calculating the angle between the left knife gate arm and the right knife gate arm" is: the angle of the final left knife gate arm edge line relative to 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 |.

[0034] The beneficial effects of the present invention are as follows: the method for detecting the opening and closing angles of a split knife gate based on a midline model 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 midline 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 midline of the knife gate arm obtained according to the model file are matched to the target image as a reference. In actual use, the use of the midpoint and midline 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 midline 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.

[0035] 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 number of edge lines in the same group, the edge line length, and the distance between the intersection of the left and right gate arm edge lines and the center line is fully considered. A score calculation formula that conforms to the actual situation is proposed to improve the accuracy of pairing. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] 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.

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

[0038] 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.

[0039] In the figure:

[0040] 1. Left knife gate arm; 2. Right knife gate arm; 3. Left midpoint; 4. Right midpoint. DETAILED DESCRIPTION

[0041] 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.

[0042] Embodiment 1: A method for detecting the opening and closing angle of a split knife switch based on a midline model, 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 device, and edge detection is performed on the target image to obtain an edge line set; the left midpoint and the right midpoint of the split knife gate in 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, Eliminate the edge lines corresponding to the distances that are not within the threshold range to obtain an updated edge line set; use the center line to divide the updated edge line set into left and right parts, obtain the left knife gate arm edge line set and the right knife gate arm edge line set respectively and perform symmetrical pairing 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; the left midpoint 3 is the center point of the two intersections of the extended line of the left insulator center line and the extended lines of the upper and lower boundary lines of the left knife gate arm 1, and the right midpoint 4 is the center point of the two intersections of the extended line of the right insulator center line and the extended lines of the upper and lower boundary lines of the right knife gate arm 2.

[0043] In Example 1, the method of "establishing the boundary line model of the knife gate arm of this model 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 gate 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 gate in the template image is in a closed state, stroke the upper and lower boundaries of the entire knife gate arm; if the knife gate in the template image is in a virtual closed or open state, stroke according to the actual upper and lower boundaries of the left and right knife gate arms. When establishing 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 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. The state of the knife gate in the template image is manually identified.

[0044] The above-mentioned method of "calculating the midpoint of the knife switch arm according to the model file" is: when the knife switch in the template image is in a closed state, the two intersection points of the upper and lower boundary line extension lines of the overall knife switch arm and the left insulator center line extension line are obtained according to the model file, recorded as two left end points, and the two intersection points of the upper and lower boundary line extension lines of the overall knife switch arm and the right insulator center line extension line are obtained, 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 midpoint of the knife switch arm or the closed segment formed by the two left end points and the two right end points. The midpoint of the box is the midpoint of the knife switch arm; when the knife switch in the template image 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 box formed by the two left end points and the two right end points is the midpoint of the knife switch arm.

[0045] The above 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. Mark; 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 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, 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 centerline of the 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 target 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 above-mentioned 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 knife gate arm of the target image to each edge line, and calculating the distance from the right midpoint of the knife gate arm 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 taken as 0.6 times the width of the side of the left knife gate arm, and the right distance threshold can be taken 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 taken according to the actual situation.

[0048] The specific method of "using the center line to distinguish the updated edge line set from the left and right to obtain the left knife gate arm edge line set and the right knife gate arm edge line set respectively" is:

[0049] Directly correspond the midpoint and midline of the knife gate arm calculated according to the model file to the target image, and calculate the unit direction vector perpendicular to the midline 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. 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 If T1 is on the left side of the midline, otherwise it is on the right side of the midline. 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.

[0050] 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 with the midpoint as the starting point and the direction to the right or left according to 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

[0051] The method of “symmetrically pairing the left knife gate arm edge line set and the right knife gate arm edge line set to determine the left knife gate arm edge line and the right knife gate arm edge line” is as follows: given an angle threshold, the angle of any edge line in the 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, 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 gate arm edge lines, any two right gate arm edge lines whose angle difference is within the angle threshold are divided into the same group, and the right gate arm edge lines in the same group are sorted from long to short; all the same groups of the left gate arm edge line set and all the same groups of the right gate arm edge line set are traversed and paired one by one, and the corrected gate arm edge lines and pairing scores of any two groups are calculated. The corrected left gate arm edge line and the corrected right gate arm edge line corresponding to the combination with the highest score are the final left gate arm edge line and right gate arm edge line.

[0052] The method of "traversing 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 and pairing them one by one, and calculating the corrected knife gate arm edge lines and pairing scores of any two groups" is: Figure 2 As shown, 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 is calculated. 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, the same group as point A and the same group as point B are eliminated; the calculation formula for the pairing score of any two groups is set as The coefficient S L S represents the sum of the squares of the lengths of any edge line in the same group of the left knife gate arm edge line set. Rrepresents the sum of the squares of the lengths of any edge line in the same group of the right knife gate arm edge line set; assuming that the number of edge lines in any group of the left knife gate arm edge line set is K, each edge line can be expressed as L i , calculate the length of the edge line according to its starting and ending coordinates as LLength i , where i=0,1,...,K, then S L =LLength 0 2 +LLength 1 2 ...+LLength K 2 ; Assume that the number of edge lines in any group of the right knife gate arm edge line set is Q, and each edge line can be expressed as R j , calculate the length of the edge line according to its starting and ending coordinates as RLength j , where j = 0, 1, ..., Q,

[0053] Then S R =RLength 0 2 +RLength 1 2 ...+RLength Q 2 ; β is an adjustable sensitivity parameter. In actual use, different scores can be obtained by taking different β values. The pairing results are determined according to different scores. The β value corresponding to the best pairing result is selected as the final β value. Different users can also determine it according to actual conditions. The corrected left knife gate arm edge line at point A corresponding to the highest pairing score S and the corrected right knife gate arm edge line at point B are the final left knife gate arm edge line and right knife gate arm edge line.

[0054] 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 |, determine the final state of the knife switch based on the angle between the left and right knife switch arms and user needs.

[0055] Example 2. Based on Example 1, another method 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: 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.

[0056] 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.

[0057] 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 detecting the opening and closing angles of a split knife switch based on a midline model, characterized in that: include: The template image of the split knife gate is collected, and the 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; the target image of the same split knife gate is collected at the same position using the same equipment, and the edge detection is performed on the target image to obtain an edge line set; the left midpoint and the right midpoint 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. Distance, remove the edge lines corresponding to the distance that is not within the threshold range, and obtain the updated 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 perform symmetrical pairing 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; the left midpoint is the center point of the two intersections of the extended line of the left insulator center line and the extended lines of the upper and lower boundary lines of the left knife gate arm, and the right midpoint is the center point of the two intersections of the extended line of the right insulator center line and the extended lines of the upper and lower boundary lines of the right knife gate arm; The method of "calculating the midpoint of the knife switch arm according to the model file" is as follows: when the knife switch in the template image 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 obtained according to the model file, 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, 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; When the knife switch in the template image 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, which are recorded as 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, which are 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 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 a closed state, obtain the distortion coefficient of the camera that collects 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 target image size, 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; obtain the coordinate position of the device relative to the knife gate during acquisition according to the two left endpoints and the two right endpoints, 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 determine the center line of the knife gate arm 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. The left center line and the right center line are extended to form an intersection; the line connecting the intersection and the midpoint is the center line of the knife gate arm; Another way of "when the knife gate is in a virtual closed or open state, the center line of the knife gate arm is calculated according to the model file" is: according to the intersection of the left center line and the right side of the left knife gate arm, the right center point of the right knife gate arm is obtained, according to the intersection of the right center line and the left side of the right knife gate arm, the left center point of the right knife gate arm is obtained, according to the left center point, the right center point, the left center point and the right center point, the coordinate position relative to the knife gate when the device is collected is obtained, 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 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 end points of the upper and lower boundary lines of the right 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 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 , 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. , 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. , 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 "symmetrically pairing the 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: Given an angle threshold, the angle of any edge line in the 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, and the left knife gate arm edge lines in the same group are sorted from long to short; the angle of any edge line in the right knife gate arm edge line set 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, and the right knife gate arm edge lines in the same group are sorted from long to short; 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 and perform one-to-one pairing, calculate the corrected knife gate arm edge lines and pairing scores of any two groups, and the corrected left knife gate arm edge line and the corrected right knife gate arm edge line corresponding to the combination with the highest score are the final left knife gate arm edge line and right knife gate arm edge line; The method of "traversing 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 and pairing them one by one, and calculating the corrected knife gate arm edge lines and pairing scores of any two groups" is as follows: 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 in 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 in the left knife gate arm edge line set, and the intersection point 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 in the right knife gate arm edge line set, and the intersection point 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 remove the group where point A is located and the group where point B is located; The calculation formula for any two pairs of matching scores is set as , where the coefficient It represents the sum of the squares of the lengths of any edge line in the same group of the left knife gate arm edge line set; It represents the sum of the squares of the lengths of any edge line in the same group of the right knife gate arm edge line set; is an adjustable sensitivity parameter; 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.

2. The method for detecting the opening and closing angles of a split knife switch based on a midline model according to claim 1 is characterized in that: The method of "establishing the boundary line model of the switch arm of this model according to the template image and saving it as a model file" is as follows: setting a program on the computer, using the program to open the template image, tracing the upper and lower boundary lines of the switch arm according to the template image, drawing the left insulator center line and the right insulator center line, and saving the line segment endpoint coordinates corresponding to the tracing and the line segment endpoint coordinates corresponding to the left and right insulator center lines as a model file; If the knife gate in the template image is in a closed state, the upper and lower boundaries of the entire knife gate arm are outlined; If the knife gate in the template image is in a virtual closed or open state, outline it according to the actual upper and lower boundaries of the left and right knife gate arms.

3. The method for detecting the opening and closing angles of a split knife switch based on a midline model according to claim 1 is characterized in that: 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 knife gate arm of the target image to each edge line, and calculating the distance from the right midpoint of the knife gate arm of the target image to each edge line; given a left distance threshold and a 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.

4. The method for detecting the opening and closing angles of a split knife switch based on a midline model according to claim 1 is characterized in that: The method of "calculating the angle between the left and right knife gate arms" 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 The angle of the final edge line of the right knife gate arm relative to the straight line where the knife gate arm is in the closed state is , the final angle between the left and right knife gate arms is .

Citation Information

Patent Citations

  • Knife switch connecting-disconnecting reliability recognition method based on image pattern recognition

    CN102509100A

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

    CN109063764A