Image processing-based method and system for identifying the state of separation and energy storage indicator signs

Through image processing-based methods, Hough line detection and angle screening technology are used to identify the switching and energy storage sign status in the substation field, solving the problem of insufficient recognition accuracy in the intelligent inspection system and achieving high accuracy and robustness. Sticky state recognition.

CN118521968BActive Publication Date: 2024-10-01DONGFANG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411000980.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-10-01
Estimated Expiration
2044-07-25

AI Technical Summary

Technical Problem

The existing intelligent inspection system lacks a method for identifying the status of switching and energy storage signs that is highly versatile and highly accurate, resulting in insufficient identification accuracy in automatic intelligent identification of equipment in the substation field.

Method used

Using an image processing-based method, through steps such as obtaining preset pictures, calibration identification information, target detection model detection processing, Hough line detection and angle screening, the status of the switching and energy storage signs is identified to improve identification accuracy and robustness.

Benefits of technology

By calculating the angle and weight of the detection straight line, the accuracy and robustness of the recognition are improved, the impact of noise is reduced, high-quality pointer status recognition is ensured, the false alarm rate is reduced, and the recognition efficiency and system stability are improved. sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118521968B_ABST
    Figure CN118521968B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, and discloses a method and system for identifying the state of a separation and energy storage indicator based on image processing. The method comprises: obtaining a preset position image; calibrating the preset position image to obtain identification information required for state recognition; the identification information comprises the coordinates of a center point of a pointer circle; based on the identification information required for state recognition, detecting and processing a target object of the preset position image using a target detection model to obtain target state information, state coordinate points and confidence of the target object; identifying the state of the target object according to the target state information, state coordinate points and confidence, and outputting a state recognition result; calculating a first angle and a second angle of a detection straight line, and combining weight screening and minimum angle recognition state, and this series of steps is intended to improve the accuracy and robustness of recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a method and system for recognizing the state of a separation and combination and energy storage indicator board based on image processing. Background Art

[0002] With the continuous advancement of artificial intelligence and Internet of Things technologies, intelligent and digital means have received more and more attention and become important solutions for all walks of life. In the field of substation, the traditional inspection method can no longer meet the needs of the current rapidly developing modern society, and the intelligent inspection system is an intelligent detection method that has gradually emerged with the continuous development of the power industry. As one of the hottest topics in today's science and technology field, the intelligent inspection system has gradually replaced the traditional manual inspection mode with its high efficiency, accuracy and cost-saving characteristics, and has become an important means of automatic intelligent identification of equipment in the field of substation.

[0003] The equipment for intelligent inspection in the field of substation mainly includes pointer instruments, oil level gauges, split and close and energy storage signs and other components that require intelligent analysis. Some equipment, such as circuit breakers, is a kind of equipment used to protect the power system. It is directly related to the operation safety and stability of the substation. It can quickly trip when the circuit is overloaded or short-circuited to prevent the equipment from overheating or burning, and ensure the safety and reliability of the circuit operation. The split and close and energy storage indicators are important components of the circuit breaker. Their function is to indicate the split and close and energy storage status of the circuit breaker, provide operators with information about the current status of the circuit breaker, and ensure safe operation. Therefore, during the intelligent inspection process, operators will have higher requirements for the state recognition accuracy of the split and close and energy storage signs. Moreover, the split and close and energy storage signs have a variety of appearance styles, including pointer type, Chinese character type, I / O type, etc.; the pointer styles include needle type, arrow type (straight line and S type), hollow type, triangle, etc. The pointer is used to indicate the identification area of ​​the split and close and energy storage status; the pointer color includes yellow, white, red, black, etc.

[0004] However, so far, there is still no method for identifying the state of the split and energy storage sign with strong versatility and high recognition accuracy in the intelligent patrol system. Based on the above problems, it is necessary to find a universal method for identifying the state of the split and energy storage sign. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a method for identifying the state of a separation and energy storage indicator based on image processing, which specifically includes the following steps:

[0006] Step S1, obtaining a preset position image;

[0007] Step S2, calibrating the preset position image to obtain identification information required for state identification; the identification information includes the coordinates of the center point of the pointer;

[0008] Step S3, based on the identification information required for state identification, the target object in the preset position image is detected and processed using the target detection model to obtain the target state information, state coordinate points and confidence of the target object;

[0009] Step S4, identifying the state of the target object according to the target state information, state coordinate points and confidence, and outputting the state identification result.

[0010] Furthermore, the state of the target object is identified according to the target state information, the state coordinate points and the confidence level, which specifically includes the following steps:

[0011] Step S41, screening the target objects according to the confidence level, and taking the target object with the highest confidence level as the pointer target;

[0012] Step S42, capturing a pointer target area image where the pointer target is located from the preset position image;

[0013] Step S43, preprocessing the pointer target area image;

[0014] Step S44, performing Hough line detection on the pre-processed pointer target area image to obtain a number of detection lines;

[0015] Step S45, obtaining the pointer contour line of the pointer target area image by edge detection algorithm, and finding a real straight line identical to the pointer contour line from a plurality of detected straight lines;

[0016] Step S46, determining the endpoints of the true straight line, and performing straight line fitting according to the endpoints to obtain a fitted straight line, and obtaining the vertex coordinates of the pointer contour line according to the fitted straight line;

[0017] Step S47, calculating the third angle between the line connecting the center point coordinates of the pointer and the state coordinate point and the pointer contour line according to the vertex coordinates, and determining the minimum angle among the third angles;

[0018] Step S48, determining the final recognition state of the target object according to the minimum angle.

[0019] Further, a true straight line identical to the pointer contour line is found from a plurality of detected straight lines, specifically including:

[0020] Step S451, calculating the first angles between a plurality of detection lines and the pointer contour line; defining a weight function according to the first angle, calculating the first angle weight, and screening the pre-selected detection lines according to the first angle weight;

[0021] Step S452, selecting a point on the preselected detection line that is closest to the state coordinate point, connecting the point with the state coordinate point to form a state connection line, and calculating a second angle between the state connection line and the preselected detection line;

[0022] Step S453, defining the pre-selected detection straight line with the smallest second angle as a true straight line.

[0023] Further, calculating the first angles between the plurality of detection straight lines and the pointer contour line specifically includes:

[0024] Step S4511, obtaining line parameters of a plurality of detection lines, and determining the inclination angle of the detection line according to the line parameters; the line parameters include the vertical distance between the detection line and the coordinates of the center point of the pointer circle, and the angle between the detection line and the horizontal axis;

[0025] Step S4512, obtaining the pointer contour angle;

[0026] Step S4513, calculating the first angle according to the inclination angle of the detection straight line and the angle of the pointer contour line.

[0027] Furthermore, the calculation of the first angle weight specifically includes:

[0028] Obtain the first angles between all detected straight lines and the pointer contour, and convert the first angles into initial weights in the range of 0-1 using a Gaussian function;

[0029] Get the vertical distances between all detected lines and the center point of the pointer from the line parameters, and calculate the lengths of all detected lines;

[0030] Determine the confidence level of all detected lines;

[0031] A preset vertical distance is set according to the vertical distance between all the detection lines and the center coordinate point of the circle; a preset length is set according to the length of all the detection lines, and a preset maximum length is determined according to the preset length; a minimum confidence level is determined according to the confidence level of all the detection lines;

[0032] The first angle weight is calculated according to the initial weight, the vertical distance between the detection line and the coordinates of the center point of the pointer, the length of the detection line, the confidence of the detection line, the preset vertical distance, the preset length, the preset maximum length, and the minimum confidence.

[0033] Furthermore, the weight function is:

[0034] ;

[0035] In the formula, represents the weight function, theta represents the first angle, Convert the first angle to the initial weight value, represents the standard deviation parameter, Represents the vertical distance between the detection line and the center point of the pointer. represents the preset vertical distance, represents the preset vertical distance, L is the length of the detection line, Represents the preset length, represents the preset maximum length, C represents the confidence level of the detected straight line, Represents the preset minimum confidence threshold for detecting straight lines. Represents the adjustment factor.

[0036] Furthermore, the final recognition state of the target object includes a separation state and an energy storage state.

[0037] The present invention also provides a separation and combination and energy storage indicator state recognition system based on image processing, which is used to execute a separation and combination and energy storage indicator state recognition method based on image processing, and the system comprises:

[0038] Preset position image acquisition module: used to obtain preset position images;

[0039] Identification information acquisition module: connected to the preset position image acquisition module, used to calibrate the preset position image and obtain the identification information required for state recognition;

[0040] Target object detection processing module: connected to the recognition information acquisition module, used to detect and process the target object of the preset position image based on the recognition information required for state recognition using the target detection model, and obtain the target state information, state coordinate points and confidence of the target object;

[0041] State recognition module: connected to the target object detection processing module, used to identify the state of the target object according to the target state information, state coordinate points and confidence, and output the state recognition result.

[0042] The embodiments of the present invention have the following technical effects:

[0043] 1. In the process of pointer state recognition, the first angle and the second angle of the detection line are calculated, and the weight screening and minimum angle recognition state are combined. This series of steps aims to improve the accuracy and robustness of recognition.

[0044] 2. By calculating the first angle and screening out straight lines close to 90°, you can give priority to straight lines that better match the expected angle. Since the pointer often forms an approximately perpendicular relationship with the center of the circle, this can eliminate many non-pointer interfering straight lines.

[0045] 3. In real environments, images contain noise, interfering lines or irrelevant visual elements. Through weighted screening, the impact of noise can be reduced to ensure that only high-quality straight lines that meet the expected angles are further considered.

[0046] 4. Calculate the second angle for the pre-selected detection line, select the line with the smallest angle as the true line, and further refine the candidate lines to ensure that the final selected line is the one that best represents the true pointer state.

[0047] 5. The whole process combines angle screening and weight calculation, which can effectively cope with real-world challenges such as light changes, image blur, and diverse pointer styles, and improve the stability and reliability of the recognition system under various conditions. Through multi-step screening and angle comparison, it reduces the possibility of misidentifying non-pointer lines as pointers, reduces the false alarm rate, reduces unnecessary calculations, and improves the efficiency of the recognition process. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0049] Figure 1 is a flow chart of a method for identifying the state of a separation and energy storage indicator based on image processing provided in the first embodiment of the present invention;

[0050] Figure 2 It is a structural diagram of a separation and combination and energy storage indicator state recognition system based on image processing provided in the second embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. 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 belong to the scope of protection of the present invention.

[0052] Embodiment 1: Figure 1 As shown, the present invention provides a method for identifying the state of a separation and energy storage indicator based on image processing, comprising the following steps:

[0053] Step S1, obtaining a preset position image;

[0054] Specifically, there are usually multiple cameras or multiple preset positions of a camera in the substation to shoot the images of the separation and energy storage sign equipment at different locations. The recognition system controls the PTZ to adjust the camera to the preset position based on the preset position information imported by each camera, and then captures the corresponding preset position image after waiting for 10 to 15 seconds.

[0055] Step S2, calibrating the preset position image to obtain identification information required for state identification;

[0056] The identification information includes:

[0057] Point code: It is the unique identifier of each preset position image, which is used to quickly locate and extract relevant information in the database.

[0058] Device type: describes the type of sign, such as pointer type, Chinese character type, I / O type, etc. This is crucial for the subsequent selection of recognition algorithms.

[0059] Pointer center point coordinates: In pointer-type signs, the pointer center point coordinates are crucial for calculating the pointer's direction.

[0060] Pointer color: The color information of the pointer is used to assist in identification and classification.

[0061] State value and its coordinate information: including the name of the separation state, energy storage state and the position coordinates in the picture. This information is especially important for non-pointer signs.

[0062] The calibration process is carried out through a special calibration tool, which can automatically obtain the point code of the preset position image. The user needs to enter or select the device type. For non-pointer signs, such as Chinese characters or I / O types, only the point code and device type need to be entered. For pointer signs, users also need to manually or assistedly mark the coordinates of the pointer center point, pointer color, and coordinate information of each state value. After the calibration is completed, the identification information will be stored in the MySql database in JSON format, with the point code as the primary key to ensure the uniqueness and traceability of the information.

[0063] After obtaining the pre-position image, the first step is to parse the pre-position image to determine the type of pre-position image and related equipment that needs to be processed. The parsing process includes:

[0064] Get point code: Extract the point code from the task information, which is the retrieval key for identification information.

[0065] Read identification information: Read the stored identification information from the database according to the point code, including device type, pointer center point coordinates, pointer color and status value coordinates, etc.

[0066] Prepare the recognition process: Prepare the corresponding recognition process and algorithm according to the device type to ensure that subsequent image processing and status recognition can proceed smoothly.

[0067] The preset position image point code is used as the unique identifier of the stored information. The device type is preferably a pointer type.

[0068] Step S3, based on the identification information required for state identification, the target object in the preset position image is detected and processed using the target detection model to obtain the target state information, state coordinate points and confidence of the target object;

[0069] Use the pre-trained YOLOv5 target detection model to process the preset position image. The model can identify the target objects in the image, such as the separation and combination signs, energy storage signs, etc., and return the target's state information, state coordinate points, and confidence. The confidence indicates the degree of certainty of the model on the detection result.

[0070] Step S4, identifying the state of the target object according to the target state information, state coordinate points and confidence, and outputting the state identification result;

[0071] In this embodiment, the target object is a pointer on the opening and closing and energy storage indicator board, and its status includes but is not limited to energy stored, no energy stored, closed, open, etc.

[0072] The specific steps include:

[0073] Step S41, screening the target objects according to the confidence level, and taking the target object with the highest confidence level as the pointer target;

[0074] First, this embodiment screens the target objects, selects the target objects with the highest confidence as the pointer targets, and selects the pointers with the highest confidence as the objects for analysis. Confidence refers to the confidence of the target detection model in target recognition. The higher the confidence, the more confident the model is that the target is a real pointer.

[0075] Step S42, capturing an image of a pointer target area where the pointer target is located from the preset position image;

[0076] Next, the pointer target area image is captured from the preset position image. In this step, the present embodiment focuses on the previously selected pointer target and separates it from the entire image for more detailed analysis and processing.

[0077] Step S43, preprocessing the pointer target area image;

[0078] The pointer target area image is preprocessed. The preprocessing process includes Gaussian blur, grayscale, adaptive threshold segmentation, dilation, corrosion and other operations, the purpose is to enhance the image contrast, remove noise, and highlight the edge features of the pointer.

[0079] Gaussian blur uses the GaussianBlur function, in which the Gaussian kernel size is 5, and the standard deviation of the Gaussian kernel function in the x and y directions is set to 1; the adaptive threshold segmentation uses the adaptiveThreshold function, in which the local neighborhood size is set to 15 and the offset value adjustment is set to 3; the edge detection method uses the Canny function, in which the strong edge detection threshold is set to 150, the weak edge detection threshold is set to 255, and the Sobel operator size is set to 3.

[0080] Step S44, performing Hough line detection on the pre-processed pointer target area image to obtain a number of detection lines;

[0081] Perform Hough line detection on the preprocessed pointer target area image to obtain several detected lines. Hough transform is a commonly used line detection algorithm that can identify straight line features in an image.

[0082] Step S45, obtaining the pointer contour line of the pointer target area image by edge detection algorithm, and finding a real straight line identical to the pointer contour line from a plurality of detected straight lines;

[0083] Step S451, calculating the first angles between a plurality of detection lines and the pointer contour line, defining a weight function according to the first angles, calculating the first angle weights, and screening pre-selected detection lines according to the first angle weights;

[0084] First, determine the relative angle between each detection line and the pointer outline. Since the pointer outline is usually vertical or horizontal, this embodiment focuses on the detection lines that form an angle close to 90° with the pointer outline, because these detection lines are more likely to be real pointers. Exemplarily, this embodiment is processing a horizontal pointer, and the line to be found should be vertical.

[0085] In order to define “close to 90°”, this embodiment sets a threshold , , so that the first angle theta is at In this implementation, for each detection line, the first angle theta satisfies the following conditions: , it is considered that the first angle of the current detection line is close to 90°.

[0086] Affected by image quality, all detected straight lines that form an angle close to 90° with the pointer contour are not necessarily true straight lines. This embodiment defines a weight function based on the first angle, calculates the first angle weight, and screens pre-selected detected straight lines with first angles close to 90° based on the first angle weight; the larger the first angle weight of the current detected straight line, the closer the first angle of the current detected straight line is to 90°, which means it is a pre-selected detected straight line.

[0087] The calculation of the first angle weight specifically includes:

[0088] Get the first angle between all detected lines and the pointer contour, and convert the first angle into an initial weight in the range of 0-1 using a Gaussian function; get the vertical distance between all detected lines and the coordinates of the center point of the pointer from the line parameters, and calculate the length of all detected lines;

[0089] Extract the vertical distance between each detected line and the coordinates of the center point of the pointer from the line parameters of the detected line, and calculate the length of each detected line. The calculation of the length of the detected line is usually determined based on the coordinates of the two end points of the detected line. Determine the confidence of all detected lines; the confidence reflects the reliability of the detected line, which is usually output by the target detection model. For example, the YOLOv5 model will give a confidence score when detecting a line. The coordinates of the endpoints of the detected line can be calculated by the line parameters.

[0090] A preset vertical distance is set according to the vertical distance between all the detection lines and the coordinates of the center point of the pointer circle; a preset length is set according to the length of all the detection lines, and a preset maximum length is determined according to the preset length; a minimum confidence level is determined according to the confidence level of all the detection lines;

[0091] In order to calculate the first angle weight, some preset values ​​need to be set. The preset vertical distance and preset length are determined based on the distribution of the vertical distance and length between all the detection lines and the coordinates of the center point of the pointer circle, and the preset maximum length is the maximum allowable length determined on the basis of the preset length. In addition, a preset minimum confidence threshold for the detection line needs to be determined to filter out the detection lines with too low confidence.

[0092] The first angle weight is calculated based on the initial weight, the vertical distance between the detection line and the coordinates of the center point of the pointer, the length of the detection line, the confidence of the detection line, the preset vertical distance, the preset length, the preset maximum length, and the preset minimum confidence threshold of the detection line.

[0093] The first angle weight of each detected line is calculated by comprehensively considering the initial weight, the vertical distance between the detected line and the coordinates of the center point of the pointer, the length of the detected line, the confidence of the detected line, the preset vertical distance, the preset length, the preset maximum length and the preset minimum confidence threshold of the detected line.

[0094] The larger the first angle weight calculated by the weight function, the closer the first angle of the corresponding detection line is to 90°. Therefore, detection lines with higher first angle weights and first angles within the preselected range are selected as preselected detection lines. Preferably, in this embodiment, detection lines with first angle weights of 0.8-1 are selected as preselected detection lines. The first angles of the selected preselected detection lines are all within the range of within the preselected range.

[0095] The calculation formula of the weight function is as follows:

[0096] ;

[0097] In the formula, represents the weight function, theta represents the first angle, Convert the first angle to an initial weight value in the range of 0-1, represents the standard deviation parameter, Represents the vertical distance between the detection line and the center point of the pointer. represents the preset vertical distance, represents the preset vertical distance, L is the length of the detection line, Represents the preset length, represents the preset maximum length, C represents the confidence level of the detected straight line, Represents the preset minimum confidence threshold for detecting straight lines. represents the adjustment factor, .

[0098] The above calculation formula, is a Gaussian function, ensuring that when the first angle is close to 90°, the weight function can reach a peak value, thereby obtaining the maximum value of the first angle weight; when the confidence C of the detection line is close to or higher than ,but is close to 0, making Close to 1, it means that the detection line with high confidence will get close to the initial weight. If the straightness of the detection line is much lower than ,Right now is much smaller than 1, then will become larger, resulting in Close to 0, it means that the detection line with low confidence will be given a lower weight, or even regarded as an invalid or unreliable detection line, which means that the detection line is seriously inconsistent with the true line. Therefore, the detection line is eliminated through the above weight function.

[0099] The method of determining the preselected detection line by calculating whether the first angle is within the preselected range is affected by changes in illumination, noise, image resolution, viewing angle differences, lens distortion, etc., all of which may cause the detected straight line angle to deviate from the theoretical value. Therefore, judging the authenticity of a straight line based solely on whether the angle falls within a fixed interval may not be accurate or robust enough. In this regard, this embodiment considers the vertical distance between the detection line and the coordinates of the center point of the pointer, the preset vertical distance, the length of the detection line, the preset length, the preset maximum length, the confidence of the detection line, and the preset minimum confidence of the detection line, and calculates the weight for the first angle, which reflects the quality of the detection line in different dimensions, rather than relying solely on the angle, and helps to improve the accuracy and robustness of straight line detection under complex conditions.

[0100] For example, in a low-light environment, even if the angle of a straight line is close to 90°, the straight line may be ignored due to insufficient contrast. Through the first angle weight calculation, even under unfavorable conditions, as long as the detected straight line is still significant in other dimensions, it may be correctly identified.

[0101] Not only does it improve the accuracy of straight line detection, it also enhances adaptability, allowing it to maintain high detection performance under various environmental conditions. In addition, by adjusting the adjustment parameters in the formula, the sensitivity and specificity of straight line detection can be optimized according to specific application scenarios.

[0102] Step S4511, obtaining line parameters of a plurality of detection lines, and determining the inclination angle of the detection line according to the line parameters; the line parameters include the vertical distance between the detection line and the coordinates of the center point of the pointer circle, and the angle between the detection line and the horizontal axis;

[0103] At this stage, for each detection line, the line parameters are obtained, namely, the vertical distance (ρ) between the detection line and the coordinates of the center point of the pointer circle, and the angle (θ) between the detection line and the horizontal axis. The line parameters are used to determine the inclination angle of the line. Specifically, the output of the Hough transform provides the ρ and θ values ​​of the detection line. Since the vertical distance (ρ) between the detection line and the coordinates of the center point of the pointer circle and the angle (θ) between the detection line and the horizontal axis are known, and the inclination angle is the angle between the detection line and the horizontal axis, the angle between the detection line and the horizontal axis in the line parameters is directly used as the inclination angle of the detection line.

[0104] Step S4512, obtaining the pointer contour angle;

[0105] The pointer contour line angle is the angle between the pointer contour line and the horizontal axis. By converting the pointer contour line into a straight line parameter, the angle between the pointer contour line and the x-axis, that is, the pointer contour line angle, can be directly read. This is the prior art and will not be described in detail.

[0106] Step S4513, calculating the first angle according to the inclination angle of the detection straight line and the angle of the pointer contour line.

[0107] ;

[0108] in, represents the first angle, Represents the inclination angle of the detection line, Represents the pointer outline angle of the detected line.

[0109] Step S452, selecting a point on the preselected detection line that is closest to the state coordinate point, connecting the point with the state coordinate point to form a state connection line, and calculating a second angle between the state connection line and the preselected detection line;

[0110] Calculate the distance between all points on the pre-selected detection line and the state coordinate point, find the nearest point based on the shortest distance, construct the state connection line using the state coordinate point and the nearest point, and use vector operations or trigonometric functions to calculate the second angle between the state connection line and the pre-selected detection line.

[0111] The purpose of calculating the second angle is to determine whether the preselected detection straight line points to the correct state, that is, the state pointed to by the pointer.

[0112] Step S453, defining the pre-selected detection straight line with the smallest second angle as a true straight line.

[0113] Next, from all the pre-selected detection lines that meet the above pre-selected range, find the pre-selected detection line with the smallest second angle. Once the pre-selected detection line that meets the condition of the first angle close to 90° and the smallest second angle is found, it is defined as the "real line", and then the state pointed by the pointer is determined, and the identification of the separation and energy storage indicator state is completed.

[0114] Step S46, determining the endpoints of the true straight line, and fitting the true straight line according to the endpoints to obtain the fitted true straight line, and obtaining the vertex coordinates of the pointer contour line according to the fitted true straight line;

[0115] First, obtain the line parameters of the true line. rho represents the vertical distance from the true line to the coordinates of the center point of the pointer. In the Hough line detection process, the detected line is represented by the polar coordinate system. The polar coordinate system needs to be converted into the point coordinates of the image. Specifically, the following two formulas are used to convert the point coordinates , the specific conversion process is:

[0116] ;

[0117] ;

[0118] ;

[0119] ;

[0120] Where theta represents the first angle of the true straight line; a represents the unit vector parallel to the horizontal axis, and b represents the unit vector parallel to the y-axis.

[0121] According to the above point coordinates and unit vector, the endpoint coordinates of the true straight line are calculated using the following formula:

[0122] ;

[0123] ;

[0124] ;

[0125] ;

[0126] Represents the coordinate point of the first endpoint, Indicates the coordinate point of the second endpoint.

[0127] The coordinates of the two endpoints are and As the input of the fitLine function, the true straight line is fitted to obtain the fitted straight line.

[0128] The coordinates of the two endpoints of the true straight line are used as the vertex coordinates of the pointer contour line, that is, the vertex coordinates of the line segment where the pointer is located.

[0129] Step S47, calculating the third angle between the line connecting the center point coordinates of the pointer and the state coordinate point and the pointer contour line according to the vertex coordinates, and determining the minimum angle among the third angles;

[0130] Calculate the third angle between the line connecting the pointer center point coordinates and the state coordinate point and the pointer contour line, and determine the minimum angle among the third angles. The pointer center usually refers to the center point of the pointer rotation, and the state coordinate point is the position of the different states that the pointer may point to. By calculating the minimum angle, the state that the pointer is currently pointing to can be determined.

[0131] First, calculate all the angles between the line segment where the pointer is located and the line connecting the pointer center point coordinates and the state coordinate point. The calculation formula is as follows:

[0132] ;

[0133] ;

[0134] ;

[0135] ;

[0136] ;

[0137] ;

[0138] ;

[0139] ;

[0140] in, Indicates the coordinates of the center point of the pointer. represents the coordinates of the i-th state, The vector representing the line segment where the pointer is located, Represents the vector where the coordinates of the center point of the pointer and the line connecting the i-th state are located. express The magnitude of a vector, express The magnitude of a vector, express and vector dot product, Represents the angle between the line segment where the pointer is located and the line connecting the coordinates of the center point of the pointer and the i-th state; Represents the component of the line segment where the pointer is located in the horizontal axis direction, Represents the component of the coordinates of the center point of the pointer and the line connecting the i-th state in the horizontal axis direction, Represents the component of the line segment where the pointer is located in the y-axis direction, Represents the component of the line connecting the center point of the pointer and the i-th state in the y-axis direction. PI represents pi, and its value is 3.1416.

[0141] Step S48, determining the final recognition state according to the minimum angle.

[0142] The calculation process of the minimum angle is as follows:

[0143] ;

[0144] ;

[0145] N represents the number of states that need to be identified. Indicates the minimum angle between the line segment where the pointer is located and the coordinates of the center point of the pointer and the line connecting the i-th state. Combine the minimum angles between the line segment where the pointer is located, the coordinates of the center point of the pointer and the lines connecting all states into a set, and take the minimum value from the set. The state where the minimum value is located is the final recognition state.

[0146] The final identification state is determined according to the minimum angle. That is, the specific state indicated by the minimum angle calculated above is judged. The final identification state includes the opening and closing state and the energy storage state. The final identification state can be energy stored, no energy stored, closed, open, etc., thus completing the state identification process.

[0147] Calculate the minimum bounding rectangle area information for the above pointer target, and the calculation formula is as follows:

[0148] ;

[0149] ;

[0150] ;

[0151] ;

[0152] Among them, vector_x is the x-coordinate point set, including the x-coordinates of each state coordinate point and the four vertices of the pointer area; vector_y is the y-coordinate point set, including the y-coordinates of each state coordinate point and the four vertices of the pointer area; through the min_element function, the point sets where vector_x and vector_y are located are traversed respectively, and the minimum value min_x of the x-coordinate, the maximum value max_x of the x-coordinate, the minimum value min_y of the y-coordinate, and the maximum value max_y of the y-coordinate are calculated respectively. Indicates the coordinates of the upper left corner of the recognition result area. Indicates the coordinates of the lower right corner of the recognition result area;

[0153] It is a C++ standard library function that returns an iterator pointing to the smallest element in a range; It is a C++ standard library function that returns an iterator pointing to the largest element in a range;

[0154] In automated inspection and maintenance records, recording the information of the minimum enclosing rectangle (upper left and lower right corner coordinates) can easily track and compare status changes at different time points or for different devices, which is helpful for data analysis and historical trend research. It also allows operators or maintenance personnel to intuitively see which areas have been successfully identified and the exact location of the pointer or sign, which is particularly useful for remote monitoring and fault diagnosis.

[0155] Embodiment 2: Figure 2 As shown, the present invention also proposes a separation and combination and energy storage indicator state recognition system based on image processing, which executes the separation and combination and energy storage indicator state recognition method based on image processing as described above, including the following modules:

[0156] Preset position image acquisition module: used to obtain preset position images;

[0157] Identification information acquisition module: connected to the preset position image acquisition module, used to calibrate the preset position image and obtain the identification information required for state recognition;

[0158] Target object detection processing module: connected to the recognition information acquisition module, used to detect and process the target object of the preset position image based on the recognition information required for state recognition using the target detection model, and obtain the target state information, state coordinate points and confidence of the target object;

[0159] State recognition module: connected to the target object detection processing module, used to identify the state of the target object according to the target state information, state coordinate points and confidence, and output the state recognition result.

[0160] Embodiment 3: An electronic device, comprising:

[0161] Processor and memory;

[0162] The processor is used to execute the steps of the method for identifying the state of an opening and closing and energy storage indicator sign based on image processing as described in any one of Embodiment 1 by calling the program or instruction stored in the memory.

[0163] Embodiment 4: A computer-readable storage medium, the computer-readable storage medium comprising computer program instructions, the computer program instructions causing a computer to execute the steps of the method for identifying the state of a separation and combination and energy storage indicator sign based on image processing as described in any one of Embodiment 1.

[0164] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0165] It should be noted that the terms used in the present invention are only for describing specific embodiments, rather than limiting the scope of the present application. As shown in the present specification, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and / or "the" do not specifically refer to the singular, but may also include the plural. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method or device. In the absence of more restrictions, the elements defined by the sentence "include one..." do not exclude the presence of other identical elements in the process, method or device including the elements.

[0166] It should also be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", etc. should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0167] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying the state of a separation and energy storage indicator based on image processing, characterized in that: The following steps are involved: Step S1, obtaining a preset position image; Step S2, calibrating the preset position image to obtain identification information required for state identification; the identification information includes the coordinates of the center point of the pointer; Step S3, based on the identification information required for state identification, the target object in the preset position image is detected and processed using the target detection model to obtain the target state information, state coordinate points and confidence of the target object; Step S4, according to the target state information, state coordinate points and confidence, the state of the target object is identified, and the state recognition result is output; Step S41, screening the target objects according to the confidence level, and taking the target object with the highest confidence level as the pointer target; Step S42, capturing an image of a pointer target area where the pointer target is located from the preset position image; Step S43, preprocessing the pointer target area image; Step S44, performing Hough line detection on the pre-processed pointer target area image to obtain a number of detection lines; Step S45, obtaining the pointer contour line of the pointer target area image by edge detection algorithm, and finding a real straight line identical to the pointer contour line from a plurality of detected straight lines; Step S451, calculating the first angles between a plurality of detection lines and the pointer contour line; defining a weight function according to the first angle, calculating the first angle weight, and screening the pre-selected detection lines according to the first angle weight; Step S452, selecting a point on the preselected detection line that is closest to the state coordinate point, connecting the point with the state coordinate point to form a state connection line, and calculating a second angle between the state connection line and the preselected detection line; Step S453, defining the pre-selected detection straight line with the smallest second angle as a true straight line; Step S46, determining the endpoints of the true straight line, and performing straight line fitting according to the endpoints to obtain a fitted straight line, and obtaining the vertex coordinates of the pointer contour line according to the fitted straight line; Step S47, calculating the third angle between the line connecting the center point coordinates of the pointer and the state coordinate point and the pointer contour line according to the vertex coordinates, and determining the minimum angle among the third angles; Step S48, determining the final recognition state of the target object according to the minimum angle.

2. The method for identifying the state of a separation and energy storage indicator based on image processing according to claim 1 is characterized in that: Calculate the first angles between several detection lines and the pointer contour line, specifically including: Step S4511, obtaining line parameters of a plurality of detection lines, and determining the inclination angle of the detection line according to the line parameters; the line parameters include the vertical distance between the detection line and the coordinates of the center point of the pointer circle, and the angle between the detection line and the horizontal axis; Step S4512, obtaining the pointer contour angle; Step S4513, calculating the first angle according to the inclination angle of the detection straight line and the angle of the pointer contour line.

3. The method for identifying the state of a separation and energy storage indicator based on image processing according to claim 2 is characterized in that: The calculation of the first angle weight specifically includes: Obtain the first angles between all detected straight lines and the pointer contour, and convert the first angles into initial weights in the range of 0-1 using a Gaussian function; Get the vertical distances between all detected lines and the center point of the pointer from the line parameters, and calculate the lengths of all detected lines; Determine the confidence level of all detected lines; A preset vertical distance is set according to the vertical distance between all the detection lines and the center coordinate point of the circle; a preset length is set according to the length of all the detection lines, and a preset maximum length is determined according to the preset length; a minimum confidence level is determined according to the confidence level of all the detection lines; The first angle weight is calculated according to the initial weight, the vertical distance between the detection line and the coordinates of the center point of the pointer, the length of the detection line, the confidence of the detection line, the preset vertical distance, the preset length, the preset maximum length, and the minimum confidence.

4. The method for identifying the state of a separation and energy storage indicator based on image processing according to claim 3 is characterized in that: The weight function is: ; In the formula, represents the weight function, theta represents the first angle, Convert the first angle to the initial weight value, represents the standard deviation parameter, Represents the vertical distance between the detection line and the center point of the pointer. represents the preset vertical distance, L is the length of the detection line, Represents the preset length, represents the preset maximum length, C represents the confidence level of the detected straight line, Represents the preset minimum confidence threshold for detecting straight lines. Represents the adjustment factor.

5. The method for identifying the state of a separation and energy storage indicator based on image processing according to claim 4 is characterized in that: The final recognition state of the target object includes a separation state and an energy storage state.

6. A system for identifying the state of a separation and energy storage indicator based on image processing, used to execute the method for identifying the state of a separation and energy storage indicator based on image processing according to any one of claims 1 to 5, characterized in that: The system comprises: Preset position image acquisition module: used to obtain preset position images; Identification information acquisition module: connected to the preset position image acquisition module, used to calibrate the preset position image and obtain the identification information required for state recognition; Target object detection processing module: connected to the recognition information acquisition module, used to detect and process the target object of the preset position image based on the recognition information required for state recognition using the target detection model, and obtain the target state information, state coordinate points and confidence of the target object; State recognition module: connected to the target object detection processing module, used to identify the state of the target object according to the target state information, state coordinate points and confidence, and output the state recognition result.