Method and device for segmenting defect area of cable accessory and electronic equipment
By performing the balanced processing and target detection of the infrared images of the cable accessories, combined with the threshold segmentation algorithm, the problem of manual reading dependencies in existing technologies is solved, and the accuracy and reliability of cable accessories defect recognition is improved.
Patent Information
- Application Number
- CN202411387236.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, when using infrared image defect recognition method to detect defects in cable accessories, it often relies on manual interpretation, resulting in low defect recognition efficiency and susceptible to personal subjective factors, resulting in low detection accuracy.
Collect the original infrared images of the attachment of the cable attachment through the target equipment, perform the balanced processing of the histogram, and test it based on the target detection algorithm. The threshold segmentation algorithm is used to divide the test results to obtain the target area information.
It improves the accuracy and reliability of cable accessories defect recognition, reduce the dependence of manual reading, enhance the ability to identify the characteristics of cable accessories, and effectively prevent the occurrence of electricity accidents.
Smart Images

Figure CN119359742A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cable detection, and in particular to a method, device and electronic equipment for segmenting a defective area of a cable accessory. Background Art
[0002] With the rapid development of the power industry, cable accessories are key components in the power system, and their safety and stability are crucial to the operation of the entire power system. However, since cable accessories operate in a complex and changeable environment for a long time, they are easily affected by various factors, resulting in defects such as aging, breakage, poor contact, etc. If these defects are not discovered and handled in time, they may lead to power accidents, thus posing a serious threat to the safety of life and property.
[0003] In order to effectively identify and prevent defects in cable accessories, infrared imaging technology is widely used in power system inspections. Infrared images can reflect the temperature distribution of cable accessories, thereby helping workers find potential defects. However, traditional infrared image analysis methods mainly rely on manual interpretation, which is not only inefficient but also easily affected by human factors, leading to misjudgment or missed judgments.
[0004] When using infrared image defect recognition methods to detect defects in cable accessories in related technologies, they often rely on manual interpretation, resulting in low defect recognition efficiency and being easily affected by personal subjective factors, leading to low accuracy in detecting cable accessories. No effective solution has been proposed yet. Summary of the invention
[0005] The main purpose of the present application is to provide a method, device and electronic device for segmenting the defective area of a cable accessory, so as to solve the problem that when the infrared image defect recognition method is used in the related technology to detect defects of cable accessories, it often relies on manual interpretation, resulting in low defect recognition efficiency and being easily affected by personal subjective factors, resulting in low accuracy in detecting cable accessories.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for segmenting a defective area of a cable accessory is provided, the method comprising: collecting an original infrared image of the cable accessory through a target device; performing histogram equalization processing on the original infrared image to obtain a first image; detecting the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information about an area where defects exist in the cable accessory; and segmenting the first area information using a threshold segmentation algorithm to obtain target area information.
[0007] Furthermore, the original infrared image is subjected to histogram equalization processing to obtain a first image, including: determining a first grayscale value of each pixel in the original infrared image, and the number of pixels and the total number of pixels corresponding to each first grayscale value; calculating a second grayscale value of each pixel based on the number of pixels corresponding to each first grayscale value, the number of pixels and the grayscale value of each pixel; and obtaining the first image based on the second grayscale value of each pixel in the original infrared image.
[0008] Furthermore, the first image is detected based on a target detection algorithm to obtain first area information, including: dividing the first image according to a preset size to obtain a plurality of grids; for each of the plurality of grids, predicting the coordinate information of a bounding box of the grid according to the target detection algorithm; predicting the category probability of the bounding box according to the target detection algorithm, and predicting the confidence score of the bounding box; and obtaining the first area information based on the coordinate information of the bounding box, the category probability of the bounding box, and the confidence score of the bounding box.
[0009] Furthermore, a threshold segmentation algorithm is used to perform segmentation processing on the first area information to obtain target area information, including: determining a target threshold based on the grayscale value of the first image; determining a coordinate value range of the defect area based on the first area information; for each pixel point in the coordinate value range, comparing the grayscale value of the pixel point with the target threshold to obtain a comparison result for each pixel point; and obtaining the target area information based on the comparison result of each pixel point.
[0010] Furthermore, determining a target threshold based on the grayscale value of the first image includes: calculating a grayscale histogram of the first image, and determining multiple candidate thresholds based on each grayscale value contained in the grayscale histogram; for each candidate threshold among the multiple candidate thresholds, grouping pixels of the first image according to the candidate threshold, and calculating each group of pixels to obtain multiple groups of pixels corresponding to each candidate threshold, as well as an average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; calculating the inter-group variance corresponding to each candidate threshold based on the multiple groups of pixels corresponding to each candidate threshold, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; and determining the target threshold based on the candidate threshold corresponding to the maximum inter-group variance among the inter-group variances corresponding to each candidate threshold.
[0011] Furthermore, the target device at least includes: a detector, which collects the original infrared image of the cable accessories through the target device, including: based on the infrared radiation of the cable accessories received by the detector; converting the infrared radiation of the cable accessories into temperature change information; converting the temperature change information into an electrical signal, and processing the electrical signal to obtain a digital signal; and determining the original infrared image based on the digital signal.
[0012] Furthermore, after using a threshold segmentation algorithm to perform segmentation processing on the first area information to obtain the target area information, the method also includes: generating image annotation information based on the first area information and the target area information, wherein the image annotation information includes at least one of the following: defect type, defect location, defect area; merging the image annotation information with the second image of the cable accessory to obtain an annotated second image, wherein the second image is an image of the cable accessory captured by a visible light camera device; and displaying the second image on a display device of the target object.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a device for segmenting a defective area of a cable accessory is provided, and the device includes: an acquisition unit, used to acquire the original infrared image of the cable accessory through a target device; a processing unit, used to perform histogram equalization processing on the original infrared image to obtain a first image; a detection unit, used to detect the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information of an area where a defective cable accessory exists; a segmentation unit, used to perform segmentation processing on the first area information using a threshold segmentation algorithm to obtain target area information.
[0014] Furthermore, the processing unit includes: a first determination subunit, used to determine the first grayscale value of each pixel in the original infrared image, as well as the number of pixels and the total number of pixels corresponding to each first grayscale value; a calculation subunit, used to calculate the second grayscale value of each pixel based on the number of pixels corresponding to each first grayscale value, the number of pixels and the grayscale value of each pixel; a second determination subunit, used to obtain the first image based on the second grayscale value of each pixel in the original infrared image.
[0015] Furthermore, the detection unit includes: a division subunit, used to divide the first image according to a preset size to obtain a plurality of grids; a first prediction subunit, used to predict the coordinate information of the bounding box of each grid in the plurality of grids according to the target detection algorithm; a second prediction subunit, used to predict the category probability of the bounding box according to the target detection algorithm, and predict the confidence score of the bounding box; a third determination subunit, used to obtain the first area information based on the coordinate information of the bounding box, the category probability of the bounding box and the confidence score of the bounding box.
[0016] Furthermore, the segmentation unit includes: a fourth determination subunit, used to determine a target threshold based on the grayscale value of the first image; a fifth determination subunit, used to determine a coordinate value range of the defective area based on the first area information; a comparison subunit, used to compare the grayscale value of each pixel point in the coordinate value range with the target threshold to obtain a comparison result for each pixel point; and a sixth determination subunit, used to obtain the target area information based on the comparison result of each pixel point.
[0017] Furthermore, the fourth determination subunit includes: a first calculation module, used to calculate the grayscale histogram of the first image, and determine multiple candidate thresholds based on each grayscale value contained in the grayscale histogram; a second calculation module, used to group the pixels of the first image according to each candidate threshold in the multiple candidate thresholds, and calculate each group of pixels to obtain multiple groups of pixels corresponding to each candidate threshold, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; a third calculation module, used to calculate the inter-group variance corresponding to each candidate threshold based on the multiple groups of pixels corresponding to each candidate threshold, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; a determination module, used to determine the target threshold based on the candidate threshold corresponding to the maximum inter-group variance among the inter-group variances corresponding to each candidate threshold.
[0018] Furthermore, the target device at least includes: a detector, and the acquisition unit includes: a receiving subunit, which is used to receive the infrared radiation of the cable accessories based on the detector; a first conversion subunit, which is used to convert the infrared radiation of the cable accessories into temperature change information; a second conversion subunit, which is used to convert the temperature change information into an electrical signal and process the electrical signal to obtain a digital signal; and a seventh determination subunit, which is used to determine the original infrared image based on the digital signal.
[0019] Furthermore, the device also includes: a generating unit, which is used to generate image annotation information based on the first area information and the target area information after segmenting the first area information using a threshold segmentation algorithm to obtain the target area information, wherein the image annotation information includes at least one of the following: defect type, defect location, defect area; a merging unit, which is used to merge the image annotation information and the second image of the cable accessory to obtain a labeled second image, wherein the second image is an image of the cable accessory captured by a visible light camera device; and a display unit, which is used to display the second image on a display device of the target object.
[0020] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the method for segmenting the defective area of a cable accessory described in any one of the above items, and which, when executed by a processor, implements the steps of the method for segmenting the defective area of a cable accessory described in each embodiment of the present application.
[0021] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes stored computer instructions, wherein when the computer instructions are executed by a processor, the method for segmenting the defective area of the cable accessory described in any one of the above-mentioned items is implemented.
[0022] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an electronic device is provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the method for segmenting the defective area of the cable accessory described in any one of the above-mentioned items.
[0023] Through the present application, the following steps are adopted: collecting the original infrared image of the cable accessory through the target device; performing histogram equalization processing on the original infrared image to obtain a first image; detecting the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information about the area where the cable accessory has defects; using a threshold segmentation algorithm to segment the first area information to obtain target area information, which solves the problem that when using the infrared image defect recognition method to detect defects of cable accessories in the related art, it often relies on manual interpretation, resulting in low defect recognition efficiency and being easily affected by personal subjective factors, resulting in low accuracy in detecting cable accessories. By performing histogram equalization on the collected thermal infrared images, the histogram distribution of the image can be adjusted, the contrast and clarity of the image can be enhanced, the surface temperature distribution can be more obvious, the defect features can be more prominent and easy to identify, which helps the system to detect defects more accurately and improves the reliability of cable accessory defect identification. At the same time, by adopting the target detection algorithm for target detection and using the threshold segmentation algorithm to process the target detection results, it is not only possible to quickly locate the cable accessories and identify their potential defective areas, but also to automatically and accurately separate the defective areas from the background to obtain clearer target area information, further improving the accuracy and reliability of cable accessory defect identification, effectively preventing the occurrence of power accidents, and ensuring the safe and stable operation of the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0025] Figure 1 is a flow chart of a method for segmenting a defective area of a cable accessory provided in Embodiment 1 of the present application;
[0026] Figure 2 It is a flowchart of an optional method for segmenting a defective area of a cable accessory provided in accordance with the first embodiment of the present application;
[0027] Figure 3 is a schematic diagram of a device for segmenting a defective area of a cable accessory provided in accordance with Embodiment 2 of the present application;
[0028] Figure 4 It is a schematic diagram of an electronic device for segmenting a defective area of a cable accessory provided in Embodiment 5 of the present application. DETAILED DESCRIPTION
[0029] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0030] It should be noted that the user information (including but not limited to user device information, user personal information, collected data, used data, generated data, processed data, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, collected information, used information, generated information, processed information, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of relevant countries and regions, necessary confidentiality measures are taken, and public order and good morals are not violated, and corresponding operation portals are provided for users to choose to authorize or refuse. For example, an interface is set between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0031] It should be noted that this application provides users with corresponding operation entrances for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0035] YOLOV3: YOLOV3 is an advanced target detection algorithm that uses Darknet-53 as the backbone network and demonstrates powerful feature extraction capabilities. It achieves accurate detection of targets of different sizes through a multi-scale prediction mechanism, and can effectively identify large, medium, and small targets. At the same time, YOLOV3 also cleverly uses the intersection over union (IoU) to determine positive and negative samples, thereby significantly improving the accuracy of detection. Due to its outstanding performance and efficiency, YOLOV3 is highly respected in the field of target detection and is widely used in various practical scenarios, such as autonomous driving, security monitoring, etc.
[0036] Threshold segmentation algorithm: Threshold segmentation algorithm is a basic technology in image processing, which classifies pixels based on the gray value of the image. Set one or more thresholds, and divide the image into foreground and background parts according to the comparison between the pixel gray value and the threshold. This algorithm is widely used in image processing in infrared images, remote sensing images, medical images and agricultural engineering. Its advantages are simple implementation, small amount of calculation, stable performance, and can greatly compress the amount of data and simplify the analysis steps.
[0037] Histogram equalization: It is a commonly used image enhancement technique. Its basic principle is to change the histogram distribution of the image into an approximately uniform distribution, thereby enhancing the contrast of the image. A histogram is a graph used to represent the distribution of brightness in a digital image. It counts the frequency of occurrence of the brightness value of each pixel. It is necessary to count the number of occurrences of each pixel value (or brightness level) in the image to obtain the histogram of the image; then, the cumulative distribution function is calculated based on the histogram. The cumulative distribution function represents the sum of the number of pixels in the histogram that are less than or equal to a specific pixel value. This process is equivalent to performing an accumulation operation on each bar graph in the histogram; next, a mapping function is created that maps the original pixel value to the new pixel value. This mapping function is based on the cumulative distribution function, and its purpose is to stretch the pixel value distribution of the original image to the entire possible pixel value range (for example, for an 8-bit grayscale image, the range is 0-255). In this way, the pixel values originally distributed in a narrow range will be extended to a wider range, thereby improving the contrast of the image; finally, the mapping function is used to adjust each pixel value in the original image to obtain an equalized image.
[0038] Embodiment 1
[0039] The present invention is described below in conjunction with preferred implementation steps. Figure 1 : is a flow chart of a method for segmenting a defective area of a cable accessory provided in Embodiment 1 of the present application. Figure 1 As shown, the method comprises the following steps:
[0040] Step S101: collecting an original infrared image of a cable accessory through a target device.
[0041] Cable accessories refer to various devices and accessories used in power cable lines to provide connection, branching, termination, protection and support for cables. Cable accessories play a key role in the installation, operation and maintenance of cable systems, including but not limited to the following types: cable joints, cable terminals, cable protective sleeves, cable supports, among which cable joints are used to connect cables so that cable lines can be extended or branched. According to their use occasions and functions, cable joints can be divided into straight joints, branch joints, transition joints, etc.; cable terminals are located at the end of the cable and are used to connect the cable to electrical equipment or overhead lines; cable protective sleeves are used to protect the cable from external environmental influences, such as waterproofing, dustproofing, corrosion resistance, etc., while providing physical protection to prevent the cable from physical damage; cable supports are used to support and fix the cable so that it maintains appropriate spacing and position during installation to avoid excessive stress on the cable, such as cable trays, bridges, hangers, etc.
[0042] The design and manufacture of cable accessories need to take into account multiple factors such as cable type, voltage level, and use environment to ensure that they can work properly under various conditions and maintain the stability and safety of the cable line. In the power system, the quality and status of cable accessories are directly related to the reliability and efficiency of power transmission.
[0043] In the first embodiment, in order to detect defective areas of cable accessories, it is necessary to use an infrared thermal imaging device (i.e., the target device mentioned above) to scan the cable accessories to obtain image information of their surface temperature distribution. The infrared thermal imaging device detects the infrared radiation emitted by the cable accessories and converts it into electrical signals to form a visual original infrared image. These original infrared images can intuitively display the temperature differences of the cable accessories, and temperature anomalies are often associated with potential defects of the cable accessories, such as overheating, poor contact, insulation damage, etc., so that the defective areas in the cable accessories can be detected based on the original infrared images, and the cable accessories can be maintained and processed to avoid accidents, thereby achieving the effect of improving the safety of the power system.
[0044] Step S102: performing histogram equalization processing on the original infrared image to obtain a first image.
[0045] Due to the characteristics of infrared imaging technology, the original infrared image may lack contrast and clarity. Especially when the temperature difference between the cable accessories and the background is not large, the details in the original infrared image may not be obvious enough, resulting in the risk of reduced detection accuracy when performing defect detection on cable accessories.
[0046] In the first embodiment, in order to enhance the contrast and brightness of the original infrared image, it is necessary to adjust the distribution of the pixel grayscale values in the image through histogram equalization processing, so that the pixel values originally distributed in a narrow range are expanded to a wider range, thereby enhancing the contrast of the image. Through this preprocessing step, not only the image quality of the original infrared image is improved, making the subsequent analysis results of cable accessory defects more accurate, but also the misjudgment or missed judgment caused by poor image quality is reduced, and the accuracy of cable accessory defect identification is improved.
[0047] Step S103: Detect the first image based on a target detection algorithm to obtain first region information, wherein the first region information is information about a region where a defect exists in the cable accessory.
[0048] In the first embodiment of the present invention, it is necessary to use a target detection algorithm to perform target detection on the first image after histogram equalization processing, identify the cable accessories and defective areas of the cable accessories in the image, and locate the specific information of these defective areas to obtain the above-mentioned first area information, that is, the information of the area where the cable accessories have defects, including the type, location and size of the defects.
[0049] In an optional embodiment, the target detection algorithm may use the YOLOv3 (You Only Look Once v3) algorithm. The YOLOv3 algorithm can divide the image into multiple grids, predict the bounding box and category probability of each grid, thereby identifying the defective area where the cable accessories are defective, and can also locate the specific location of the defective area. By detecting the first image based on the target detection algorithm, the first area information is obtained, and the target detection algorithm can be used in the deep learning framework to automatically analyze the preprocessed infrared image to identify and locate the cable accessories and their possible defective areas, thereby improving the efficiency of detection and improving the accuracy of recognition.
[0050] Step S104: Use a threshold segmentation algorithm to segment the first region information to obtain target region information.
[0051] In the first embodiment of the present invention, a threshold segmentation algorithm is required to more accurately locate the defective area of the cable accessories in the first area information to obtain the target area information, thereby further refining the detection results and making the defective area more accurate. At the same time, it also eliminates the noise and false alarms that may be generated during the detection process, thereby improving the recognition accuracy and reliability of the cable accessories.
[0052] In summary, the method for segmenting the defective area of a cable accessory provided in Example 1 of the present application collects the original infrared image of the cable accessory through a target device; performs histogram equalization processing on the original infrared image to obtain a first image; detects the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information about an area where defects exist in the cable accessory; and uses a threshold segmentation algorithm to segment the first area information to obtain target area information. This solves the problem that when using an infrared image defect recognition method to detect defects in cable accessories in the related art, the method often relies on manual interpretation, resulting in low defect recognition efficiency and is easily affected by personal subjective factors, resulting in low accuracy in detecting cable accessories. By performing histogram equalization on the collected thermal infrared images, the histogram distribution of the image can be adjusted, the contrast and clarity of the image can be enhanced, the surface temperature distribution can be more obvious, the defect features can be more prominent and easy to identify, which helps the system to detect defects more accurately and improves the reliability of cable accessory defect identification. At the same time, by adopting the target detection algorithm for target detection and using the threshold segmentation algorithm to process the target detection results, it is not only possible to quickly locate the cable accessories and identify their potential defective areas, but also to automatically and accurately separate the defective areas from the background to obtain clearer target area information, further improving the accuracy and reliability of cable accessory defect identification, effectively preventing the occurrence of power accidents, and ensuring the safe and stable operation of the power system.
[0053] Optionally, in the method for segmenting the defective area of a cable accessory provided in Example 1 of the present application, the original infrared image is subjected to histogram equalization processing to obtain a first image, including: determining the first grayscale value of each pixel in the original infrared image, and the number of pixels and the total number of pixels corresponding to each first grayscale value; calculating the second grayscale value of each pixel based on the number of pixels corresponding to each first grayscale value, the number of pixels and the grayscale value of each pixel; and obtaining the first image based on the second grayscale value of each pixel in the original infrared image.
[0054] In the first embodiment, in order to improve the contrast and clarity of the original infrared image and make the defects of the cable accessories more prominent and easy to identify, the original infrared image can be subjected to histogram equalization. First, the grayscale values of all pixels in the original infrared image (i.e., the first grayscale value mentioned above) are counted. Each pixel in the original infrared image represents the temperature of the surface of the cable accessories, and the grayscale value (or brightness level) reflects the temperature. Exemplarily, for an 8-bit image, the grayscale value ranges from 0 to 255, where 0 represents the darkest (lowest temperature) and 255 represents the brightest (highest temperature).
[0055] Then, count the number of pixels of each gray value in the original infrared image. For example, if there are 100 pixels with a gray value of 100 in the original infrared image, then the number of pixels with a gray value of 100 is 100. At the same time, record the total number of pixels in the original infrared image to calculate the gray value after histogram equalization.
[0056] Secondly, the grayscale value of each pixel in the original infrared image is mapped through the histogram equalization technology, the purpose is to make the grayscale value distribution of the original infrared image more uniform, stretch the grayscale value distribution of the original infrared image to the entire possible grayscale value range, and ensure that the pixel values originally distributed in a narrow range are extended to a wider range. This process can significantly enhance the details in the original infrared image, thereby improving the contrast. The formula for calculating the second grayscale value can be shown in Formula 1,
[0057]
[0058] Among them, the gray value in the original infrared image is r k , the probability of each gray value appearing is p r , r j represents the gray value of the jth pixel, n j The gray value is r j The number of pixels is the number of pixels corresponding to each first gray value mentioned above, N is the total number of pixels in the original infrared image, and k refers to the maximum gray value in the original infrared image. For example, for an 8-bit gray image, k is 255 because the gray value range is from 0 to 255.
[0059] Finally, the image is reconstructed according to the second grayscale value of each pixel to obtain the first image after histogram equalization. Compared with the original infrared image, the image after histogram equalization has higher contrast and clarity, making the defects of cable accessories (such as abnormal temperature areas) more prominent, providing more favorable conditions for subsequent target detection and defect identification.
[0060] Optionally, in the defect area segmentation method of the cable accessory provided in the first embodiment of the present application, the first image is detected based on the target detection algorithm to obtain the first area information, including: dividing the first image according to a preset size to obtain a plurality of grids; for each of the plurality of grids, predicting the coordinate information of the bounding box of the grid according to the target detection algorithm; predicting the category probability of the bounding box and the confidence score of the bounding box according to the target detection algorithm; and obtaining the first area information based on the coordinate information of the bounding box, the category probability of the bounding box and the confidence score of the bounding box.
[0061] In the first embodiment, the target detection algorithm may be a YOLOv3 algorithm, which first divides the image into fixed-size grids. Each grid is responsible for predicting the objects inside it. The preset size may be set according to the expected size of the cable accessories and the resolution of the infrared image, in order to ensure that each grid can cover the potential defect area while avoiding excessive data calculation due to too small a grid. Grid division can simplify the calculation process, and each grid is predicted independently, which is conducive to parallel processing and improved detection speed.
[0062] Then, in each grid, one or more bounding boxes and their center coordinates are predicted by the YOLOv3 algorithm. The purpose of the bounding box is to locate potential targets within the grid, that is, defects in cable accessories. The coordinate information includes the center point coordinates (x, y) of the bounding box and the width (w) and height (h) of the bounding box. Coordinate prediction ensures the accuracy of the defect location and can locate specific targets even in complex backgrounds.
[0063] Secondly, YOLOv3 is used to predict the probability that the target in the bounding box belongs to different defect categories. Exemplarily, different defect categories include but are not limited to: normal state, aging, breakage, poor contact and other defect categories. The prediction of category probability can identify the defect type of cable accessories and provide necessary information for subsequent processing and maintenance. The confidence score indicates the confidence that the target exists in the bounding box. The confidence score combined with the category probability can determine the credibility of the defect area of a cable accessory. Exemplarily, after obtaining the category probability of the bounding box and the confidence score of the bounding box, by setting the threshold of the confidence score, low-quality predictions can be filtered out, false alarms can be reduced, and the accuracy of detection can be improved.
[0064] Finally, the first area information, i.e., detailed information of the defective area on the cable accessory, including the location, size, and type, is determined based on the coordinate information of the bounding box, the category probability of the bounding box, and the confidence score of the bounding box. Exemplarily, all predicted bounding boxes can be classified according to the confidence score of each bounding box, and the bounding boxes with confidence scores higher than the threshold of the confidence score are classified into the first category, and the bounding boxes with confidence scores equal to or less than the threshold of the confidence score are classified into the second category; the treatment measures for each bounding box are determined based on the classification category of the bounding box, i.e., the defective area in the first category of the bounding box is repaired, and the defective area in the second category of the bounding box is observed in detail.
[0065] By segmenting infrared images into grids and predicting the bounding box coordinates, category probability, and confidence score of possible defects in each grid, it is possible to automatically identify and locate specific defects on cable accessories and provide precise regional information, thereby effectively improving the efficiency and accuracy of detecting defective areas of cable accessories.
[0066] Optionally, in the defect area segmentation method of the cable accessory provided in Example 1 of the present application, a threshold segmentation algorithm is used to perform segmentation processing on the first area information to obtain target area information, including: determining the target threshold based on the grayscale value of the first image; determining the coordinate value range of the defective area based on the first area information; for each pixel point in the coordinate value range, comparing the grayscale value of the pixel point with the target threshold to obtain the comparison result of each pixel point; and obtaining the target area information based on the comparison result of each pixel point.
[0067] In an optional embodiment, the Otsu method can be used to determine the target threshold, which is used to distinguish the foreground (defective area) and the background in the image. The Otsu method calculates the grayscale histogram to find the optimal threshold, that is, the threshold with the largest inter-class variance between the foreground and the background after image segmentation, thereby effectively separating the defective area from the background.
[0068] Then, the specific position of the defective area in the image, that is, the coordinate value range of the defective area, is determined according to the center coordinates, width, and height of the bounding box in the first area information. Each pixel point within the coordinate value range is traversed, and the grayscale value of each pixel point is compared with the target threshold to obtain the comparison result of each pixel point, for example, the grayscale value of pixel point C1 is higher than the target threshold, and the grayscale value of pixel point C2 is lower than the target threshold, etc.
[0069] Finally, after the comparison between the pixel and the target threshold is completed, a binary image is generated. For example, if the gray value of the pixel is higher than the target threshold, the pixel is considered to belong to the defective part (i.e., the foreground), and the pixel is marked as white (or other highlight colors); if the gray value of the pixel is lower than or equal to the target threshold, the pixel is considered to belong to the background, and the pixel is marked as black. According to the foreground area in the generated binary image, the boundary of the defective area, the coordinate value range included in the defective area, the area of the defective area, and other information are determined to obtain the above-mentioned target area information, which clearly shows the position and shape of the defective area, and provides a basis for subsequent defect analysis and processing.
[0070] Through the above steps, the defective area information of the cable accessories can be effectively identified and highlighted from the infrared image, thereby improving the accuracy and efficiency of defect identification.
[0071] Optionally, in the defect area segmentation method of the cable accessory provided in the first embodiment of the present application, the target threshold is determined based on the grayscale value of the first image, including: calculating the grayscale histogram of the first image, and determining multiple candidate thresholds based on each grayscale value contained in the grayscale histogram; for each candidate threshold among the multiple candidate thresholds, grouping the pixels of the first image according to the candidate threshold, and calculating each group of pixels to obtain multiple groups of pixels corresponding to each candidate threshold, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; calculating the inter-group variance corresponding to each candidate threshold based on the multiple groups of pixels corresponding to each candidate threshold, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; determining the target threshold based on the candidate threshold corresponding to the maximum inter-group variance among the inter-group variances corresponding to each candidate threshold.
[0072] In an optional embodiment, in order to determine the target threshold in the threshold segmentation algorithm, it is necessary to calculate the grayscale histogram of the first image. The grayscale histogram is a chart that counts the frequency of occurrence of different grayscale values in an image. Through this histogram, the distribution of different grayscale values in the image can be understood. Based on the grayscale histogram, multiple candidate thresholds can be determined. The selection of candidate thresholds is usually based on the shape and features of the histogram, such as peaks, valleys, etc. These candidate thresholds will be used in subsequent image segmentation attempts, with the goal of finding the threshold that can most effectively distinguish between foreground and background.
[0073] Then, for each candidate threshold, the pixels of the first image are divided into two groups according to the candidate threshold, one group with grayscale values higher than the candidate threshold (corresponding to the foreground), and the other group with grayscale values lower than or equal to the candidate threshold (corresponding to the background), and the average grayscale value and number of pixels of these two groups of pixels (foreground pixels, background pixels) are calculated.
[0074] Secondly, based on the average grayscale value and number of pixels in each group of pixels calculated above, the inter-group variance corresponding to different candidate thresholds can be calculated. The inter-group variance is a statistic that measures the degree of difference between two groups of pixels (foreground pixels and background pixels). The larger its value, the more obvious the difference between the two groups. The Otsu method determines the optimal segmentation threshold by maximizing the inter-group variance, that is, the threshold found can maximize the contrast between the foreground and background.
[0075] Finally, the candidate threshold with the largest inter-group variance is selected from the inter-group variances corresponding to all candidate thresholds as the target threshold mentioned above. The target threshold can most effectively segment the image into foreground and background, thereby highlighting the potential defect area.
[0076] By calculating the grayscale histogram to determine the target threshold, the subjectivity and uncertainty of manually selected thresholds are avoided, the accuracy and stability of image segmentation are improved, and the method is particularly suitable for processing infrared images with uneven grayscale distribution and low contrast, and can effectively identify and highlight defective parts of cable accessories.
[0077] Optionally, in the method for segmenting defective areas of cable accessories provided in Example 1 of the present application, the above-mentioned target device includes at least: a detector, which collects the original infrared image of the cable accessories through the target device, including: infrared radiation of the cable accessories received by the detector; converting the infrared radiation of the cable accessories into temperature change information; converting the temperature change information into an electrical signal, and processing the electrical signal to obtain a digital signal; and determining the original infrared image based on the digital signal.
[0078] In an optional embodiment, the detector in the infrared thermal imager (i.e., the target device mentioned above) can be a microbolometer, or a thermopile, etc. The infrared radiation from the cable accessories is received by the detector. Infrared radiation is a part of the electromagnetic wave naturally radiated by the cable accessories at a specific temperature, and the wavelength is usually between 700 nanometers and 1 millimeter, corresponding to the transfer of heat energy.
[0079] Then, through the response of the sensitive material inside the detector to the infrared radiation, the temperature of the sensitive material will increase as the received infrared radiation energy increases, thereby converting the radiation energy into a measurable temperature change. The signal conversion circuit in the infrared thermal imager generates an electrical signal through the thermoelectric effect (i.e., temperature changes cause changes in the charge state inside the material) or the photovoltaic effect (voltage is generated after infrared radiation is absorbed by the photodetector). The electrical signal undergoes a series of signal processing steps such as amplification and filtering to remove noise and enhance the signal, and then it is converted into a digital signal by an analog-to-digital converter (ADC) for subsequent calculation and analysis. Digital signal processing technology allows more accurate and flexible analysis of the signal, such as temperature correction and image processing.
[0080] Finally, through specific algorithms and software, the temperature information of each pixel contained in the digital signal is mapped into different grayscale values to form the original infrared image. The different grayscales of the pixels in the original infrared image represent the different temperatures of the cable accessories, which is conducive to subsequent defect detection.
[0081] Illustratively, a microbolometer is a sensor that detects infrared radiation based on changes in electrical resistance. It works by utilizing a specific material (such as amorphous silicon, vanadium oxide, etc.) whose electrical resistance changes with temperature. When infrared radiation falls on the microbolometer, it absorbs the radiation and heats up, causing the material's resistance to change. This change is converted into an electrical signal, which is then read and processed by the infrared camera's circuitry to form an image. The advantage of a microbolometer is that it does not require external cooling, so it can be made into a small, lightweight device suitable for a variety of portable and fixed infrared imaging applications.
[0082] Illustratively, a thermopile is a device that converts thermal energy into electrical energy. It consists of a series of thermocouples connected in series, each of which consists of two conductors of different materials. When there is a temperature difference between the two ends, a voltage is generated. In infrared imaging technology, thermopiles can be used to detect infrared radiation emitted by objects and convert it into electrical signals. Thermopile pixel hybrid technology generally refers to the integration of thermopile sensors with image processing circuits to form a pixel array, and each pixel contains one or more thermopiles. The advantage of this technology is that it can provide high thermal sensitivity and good image resolution, and is suitable for occasions requiring high-precision temperature measurement and high-resolution imaging.
[0083] By receiving the infrared radiation of cable accessories through the detector and going through a series of signal conversion and processing steps, it is possible to generate original infrared images that can be used for target detection and defect identification, providing a technical basis for defect identification of cable accessories.
[0084] Optionally, in the method for segmenting the defective area of a cable accessory provided in Example 1 of the present application, after the first area information is segmented and processed using a threshold segmentation algorithm to obtain the target area information, the method further includes: generating image annotation information based on the first area information and the target area information, wherein the image annotation information includes at least one of the following: defect type, defect location, defect area; merging the image annotation information and the second image of the cable accessory to obtain an annotated second image, wherein the second image is an image of the cable accessory captured by a visible light camera device; and displaying the second image on a display device of the target object.
[0085] In the first embodiment, in order to help the staff (i.e., the target object mentioned above) understand the defect of the cable accessories more clearly and accurately, the detection result of the defective area of the cable accessories (i.e., the first area information and / or the target area information mentioned above) can be combined with the visible light image of the cable accessories to display the defect information of the cable accessories in a more intuitive way:
[0086] In an optional embodiment, the target area information can be further accurately located and segmented based on the position and type of the cable accessory defect area in the first area information and the threshold segmentation algorithm to generate image annotation information, including but not limited to the type of defect (such as hot spots, breakage, etc.), the specific position of the defect in the image (coordinates, bounding box, confidence score of the bounding box) and the area of the defect area.
[0087] Then, a second image of the cable accessory is captured by a visible light camera. The second image provides information about the appearance of the cable accessory under natural light, which helps the staff to intuitively identify and locate defects. The second image and the image annotation information are merged, that is, the defect information identified in the infrared image is covered or annotated on the second image, for example, the boundary box, type description and area value of the defect area are annotated on the second image containing the cable accessory.
[0088] Finally, the annotated second image, that is, the visible light image annotated with defect information, is transmitted to a display device (such as a staff member's tablet computer, a large screen in a monitoring center, etc.) for display, so that users or staff can view the defects of cable accessories, facilitating further analysis and decision-making.
[0089] By combining the target area information of the defective area of the cable accessories with the appearance information of the visible light image, a comprehensive, accurate and easy-to-understand cable accessories defect report can be provided, thereby improving the efficiency and accuracy of power system inspections. In this way, staff do not need to analyze infrared images and visible light images separately, but can directly obtain all necessary defect information from the annotated visible light image, providing strong support for the maintenance and safety of the power system.
[0090] Optionally, in this embodiment 1, Figure 2 It is a flow chart of an optional method for segmenting defective areas of cable accessories provided in accordance with the first embodiment of the present application. First, the original infrared image of the cable accessories is acquired through the target device. The target device may be a Model X infrared thermal imager having a high resolution of at least 800x600 and a temperature measurement range of -20°C to 120°C, which ensures the clarity of the infrared image and the accuracy of the temperature information. The image data is transmitted from the thermal imager to the image processing device through the wireless transmission device 102 based on the Bluetooth 5.0 standard, thereby realizing fast and stable data transmission.
[0091] Then, the original infrared image is processed by histogram equalization to obtain the first image mentioned above. By stretching the histogram of the original infrared image, the image contrast is enhanced, making the details of the cable accessories clearer, which is convenient for subsequent defect identification. In addition, contrast stretching and gamma correction technology can be used to further improve the image quality and ensure the obvious presentation of defect features in the infrared image.
[0092] Secondly, the optimized YOLOv3 algorithm is used to identify the defective area in the first image to obtain the first area information. YOLOv3 is a fast target detection algorithm. By adjusting the number of network layers and hyperparameters, this module can more accurately and quickly identify cable accessories and their potential defects, such as hot spots, breakage, loose connections, etc. The optimized algorithm not only improves the recognition speed, but also enhances the recognition accuracy, which is suitable for defect recognition in complex scenarios such as cable accessories.
[0093] Finally, the Otsu method (or maximum entropy threshold method) is used to determine the target threshold, and the first region information is accurately segmented according to the target threshold, that is, the defect region detected in the first region information is accurately located. The Otsu method divides the image into foreground and background by calculating the gray value and segmentation threshold of the image, thereby accurately locating the defect region. The maximum entropy threshold rule automatically sets the threshold by maximizing the entropy difference between the foreground and the background, achieving a more refined defect region segmentation.
[0094] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0095] Embodiment 2
[0096] The second embodiment of the present application also provides a device for segmenting a defective area of a cable accessory. It should be noted that the device for segmenting a defective area of a cable accessory in the second embodiment of the present application can be used to execute the method for segmenting a defective area of a cable accessory provided in the first embodiment of the present application. The device for segmenting a defective area of a cable accessory provided in the second embodiment of the present application is introduced below.
[0097] Figure 3 Schematic diagram of a device for segmenting defective areas of a cable accessory according to the second embodiment of the present application. Figure 3 As shown, the device includes: a collection unit 301, a processing unit 302, a detection unit 303 and a segmentation unit 304.
[0098] Specifically, the acquisition unit 301 is used to acquire the original infrared image of the cable accessory through the target device.
[0099] The processing unit 302 is used to perform histogram equalization processing on the original infrared image to obtain a first image.
[0100] The detection unit 303 is used to detect the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information about an area where a defect exists in the cable accessory.
[0101] The segmentation unit 304 is used to segment the first region information using a threshold segmentation algorithm to obtain target region information.
[0102] The device for segmenting defective areas of cable accessories provided in the second embodiment of the present application uses an acquisition unit 301 to acquire an original infrared image of the cable accessories through a target device; a processing unit 302 performs histogram equalization processing on the original infrared image to obtain a first image; a detection unit 303 detects the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information about an area where defects exist in the cable accessories; a segmentation unit 304 uses a threshold segmentation algorithm to segment the first area information to obtain target area information, thereby solving the problem that when using an infrared image defect recognition method to detect defects in cable accessories in the related art, the method often relies on manual interpretation, resulting in low defect recognition efficiency and being easily affected by personal subjective factors, resulting in low accuracy in detecting cable accessories. By performing histogram equalization on the collected thermal infrared images, the histogram distribution of the image can be adjusted, the contrast and clarity of the image can be enhanced, the surface temperature distribution can be more obvious, the defect features can be more prominent and easy to identify, which helps the system to detect defects more accurately and improves the reliability of cable accessory defect identification. At the same time, by adopting the target detection algorithm for target detection and using the threshold segmentation algorithm to process the target detection results, it is not only possible to quickly locate the cable accessories and identify their potential defective areas, but also to automatically and accurately separate the defective areas from the background to obtain clearer target area information, further improving the accuracy and reliability of cable accessory defect identification, effectively preventing the occurrence of power accidents, and ensuring the safe and stable operation of the power system.
[0103] Optionally, in the defect area segmentation device of the cable accessory provided in the second embodiment of the present application, the above-mentioned processing unit 302 includes: a first determination subunit, used to determine the first grayscale value of each pixel in the original infrared image, and the number of pixels and the total number of pixels corresponding to each first grayscale value; a calculation subunit, used to calculate the second grayscale value of each pixel based on the number of pixels corresponding to each first grayscale value, the number of pixels and the grayscale value of each pixel; a second determination subunit, used to obtain the first image based on the second grayscale value of each pixel in the original infrared image.
[0104] Optionally, in the defect area segmentation device of the cable accessory provided in the second embodiment of the present application, the above-mentioned detection unit 303 includes: a division subunit, used to divide the first image according to a preset size to obtain multiple grids; a first prediction subunit, used to predict the coordinate information of the bounding box of the grid according to the target detection algorithm for each grid in the multiple grids; a second prediction subunit, used to predict the category probability of the bounding box and the confidence score of the predicted bounding box according to the target detection algorithm; a third determination subunit, used to obtain the first area information based on the coordinate information of the bounding box, the category probability of the bounding box and the confidence score of the bounding box.
[0105] Optionally, in the defect area segmentation device of the cable accessory provided in Example 2 of the present application, the above-mentioned segmentation unit 304 includes: a fourth determination subunit, used to determine the target threshold based on the grayscale value of the first image; a fifth determination subunit, used to determine the coordinate value range of the defective area based on the first area information; a comparison subunit, used to compare the grayscale value of each pixel point in the coordinate value range with the target threshold to obtain the comparison result of each pixel point; and a sixth determination subunit, used to obtain the target area information based on the comparison result of each pixel point.
[0106] Optionally, in the defect area segmentation device of the cable accessory provided in the second embodiment of the present application, the above-mentioned fourth determination subunit includes: a first calculation module, used to calculate the grayscale histogram of the first image, and determine multiple candidate thresholds based on each grayscale value contained in the grayscale histogram; a second calculation module, used to group the pixels of the first image according to the candidate threshold for each of the multiple candidate thresholds, and calculate each group of pixels to obtain multiple groups of pixels corresponding to each candidate threshold, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; a third calculation module, used to calculate the inter-group variance corresponding to each candidate threshold based on the multiple groups of pixels corresponding to each candidate threshold, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; a determination module, used to determine the target threshold based on the candidate threshold corresponding to the maximum inter-group variance among the inter-group variances corresponding to each candidate threshold.
[0107] Optionally, in the defect area segmentation device of the cable accessories provided in the second embodiment of the present application, the above-mentioned target device includes at least: a detector, and the above-mentioned acquisition unit 301 includes: a receiving subunit, which is used to receive the infrared radiation of the cable accessories based on the detector; a first conversion subunit, which is used to convert the infrared radiation of the cable accessories into temperature change information; a second conversion subunit, which is used to convert the temperature change information into an electrical signal, and process the electrical signal to obtain a digital signal; and a seventh determination subunit, which is used to determine the original infrared image based on the digital signal.
[0108] Optionally, in the device for segmenting the defective area of a cable accessory provided in Example 2 of the present application, the device further includes: a generation unit, for segmenting the first area information using a threshold segmentation algorithm to obtain the target area information, and then generating image annotation information based on the first area information and the target area information, wherein the image annotation information includes at least one of the following: defect type, defect location, defect area; a merging unit, for merging the image annotation information with the second image of the cable accessory to obtain a labeled second image, wherein the second image is an image of the cable accessory captured by a visible light camera; and a display unit, for displaying the second image on a display device of the target object.
[0109] The device for segmenting the defective area of the cable accessory includes a processor and a memory. The above-mentioned acquisition unit 301, processing unit 302, detection unit 303 and segmentation unit 304 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0110] The processor includes a kernel, and the kernel calls the corresponding program unit from the memory. One or more kernels can be set, and the accuracy of detecting the defective area of the cable accessories can be improved by adjusting the kernel parameters.
[0111] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0112] A third embodiment of the present invention provides a computer-readable storage medium having a program stored thereon, and when the program is executed by a processor, a method for segmenting a defective area of a cable accessory is implemented.
[0113] A fourth embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes a method for segmenting a defective area of a cable accessory when the program is running.
[0114] like Figure 4 As shown, embodiment 5 of the present invention provides an electronic device, the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: acquiring an original infrared image of a cable accessory through a target device; performing histogram equalization processing on the original infrared image to obtain a first image; detecting the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information of an area where defects exist in the cable accessory; and performing segmentation processing on the first area information using a threshold segmentation algorithm to obtain target area information.
[0115] When the processor executes the program, the following steps are also implemented: the original infrared image is subjected to histogram equalization processing to obtain a first image, including: determining a first grayscale value of each pixel in the original infrared image, and the number of pixels and the total number of pixels corresponding to each first grayscale value; calculating a second grayscale value of each pixel based on the number of pixels corresponding to each first grayscale value, the number of pixels and the grayscale value of each pixel; and obtaining a first image based on the second grayscale value of each pixel in the original infrared image.
[0116] When the processor executes the program, the following steps are also implemented: based on the target detection algorithm, the first image is detected to obtain the first area information, including: the first image is divided according to a preset size to obtain a plurality of grids; for each of the plurality of grids, the coordinate information of the bounding box of the grid is predicted based on the target detection algorithm; the category probability of the bounding box is predicted based on the target detection algorithm, and the confidence score of the bounding box is predicted; the first area information is obtained based on the coordinate information of the bounding box, the category probability of the bounding box and the confidence score of the bounding box.
[0117] When the processor executes the program, the following steps are also implemented: the first area information is segmented using a threshold segmentation algorithm to obtain target area information, including: determining a target threshold based on the grayscale value of the first image; determining a coordinate value range of the defective area based on the first area information; for each pixel point in the coordinate value range, comparing the grayscale value of the pixel point with the target threshold value to obtain a comparison result for each pixel point; and obtaining the target area information based on the comparison result of each pixel point.
[0118] When the processor executes the program, the following steps are also implemented: determining a target threshold value based on the grayscale value of the first image, including: calculating a grayscale histogram of the first image, and determining multiple candidate threshold values based on each grayscale value contained in the grayscale histogram; for each candidate threshold value among the multiple candidate threshold values, grouping pixels of the first image according to the candidate threshold value, and calculating each group of pixels to obtain multiple groups of pixels corresponding to each candidate threshold value, as well as an average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; calculating the inter-group variance corresponding to each candidate threshold value based on the multiple groups of pixels corresponding to each candidate threshold value, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; determining the target threshold value based on the candidate threshold value corresponding to the maximum inter-group variance among the inter-group variances corresponding to each candidate threshold value.
[0119] When the processor executes the program, the following steps are also implemented: the above-mentioned target device includes at least: a detector, which collects the original infrared image of the cable accessories through the target device, including: based on the infrared radiation of the cable accessories received by the detector; converting the infrared radiation of the cable accessories into temperature change information; converting the temperature change information into an electrical signal, and processing the electrical signal to obtain a digital signal; determining the original infrared image based on the digital signal.
[0120] When the processor executes the program, the following steps are also implemented: after the first area information is segmented and processed by using a threshold segmentation algorithm to obtain the target area information, the above method also includes: generating image annotation information based on the first area information and the target area information, wherein the image annotation information includes at least one of the following: defect type, defect location, defect area; merging the image annotation information and the second image of the cable accessory to obtain a labeled second image, wherein the second image is an image of the cable accessory captured by a visible light camera device; and displaying the second image on a display device of the target object.
[0121] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0122] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps: acquiring an original infrared image of a cable accessory through a target device; performing histogram equalization processing on the original infrared image to obtain a first image; detecting the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information about an area where defects exist in the cable accessory; and segmenting the first area information using a threshold segmentation algorithm to obtain target area information.
[0123] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: performing histogram equalization processing on the original infrared image to obtain a first image, including: determining the first grayscale value of each pixel in the original infrared image, and the number of pixels and the total number of pixels corresponding to each first grayscale value; calculating the second grayscale value of each pixel based on the number of pixels corresponding to each first grayscale value, the number of pixels and the grayscale value of each pixel; obtaining the first image based on the second grayscale value of each pixel in the original infrared image.
[0124] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: detecting a first image based on a target detection algorithm to obtain first area information, including: dividing the first image according to a preset size to obtain multiple grids; for each grid in the multiple grids, predicting the coordinate information of the bounding box of the grid based on the target detection algorithm; predicting the category probability of the bounding box based on the target detection algorithm, and predicting the confidence score of the bounding box; obtaining the first area information based on the coordinate information of the bounding box, the category probability of the bounding box and the confidence score of the bounding box.
[0125] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: using a threshold segmentation algorithm to segment the first area information to obtain target area information, including: determining the target threshold based on the grayscale value of the first image; determining the coordinate value range of the defective area based on the first area information; for each pixel point in the coordinate value range, comparing the grayscale value of the pixel point with the target threshold value to obtain the comparison result of each pixel point; and obtaining the target area information based on the comparison result of each pixel point.
[0126] When executed on a data processing device, it is also suitable for executing a program that is initialized with the following method steps: determining a target threshold value based on the grayscale value of a first image, including: calculating a grayscale histogram of the first image, and determining multiple candidate threshold values based on each grayscale value contained in the grayscale histogram; for each candidate threshold value among the multiple candidate threshold values, grouping pixels of the first image according to the candidate threshold value, and calculating each group of pixels to obtain multiple groups of pixels corresponding to each candidate threshold value, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; calculating the inter-group variance corresponding to each candidate threshold value based on the multiple groups of pixels corresponding to each candidate threshold value, as well as the average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; determining the target threshold value based on the candidate threshold value corresponding to the maximum inter-group variance among the inter-group variances corresponding to each candidate threshold value.
[0127] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: the above-mentioned target device includes at least: a detector, and the original infrared image of the cable accessories is collected through the target device, including: based on the infrared radiation of the cable accessories received by the detector; converting the infrared radiation of the cable accessories into temperature change information; converting the temperature change information into an electrical signal, and processing the electrical signal to obtain a digital signal; determining the original infrared image based on the digital signal.
[0128] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: after using a threshold segmentation algorithm to segment the first area information and obtain the target area information, the above method also includes: generating image annotation information based on the first area information and the target area information, wherein the image annotation information includes at least one of the following: defect type, defect location, defect area; merging the image annotation information and the second image of the cable accessory to obtain a labeled second image, wherein the second image is an image of the cable accessory captured by a visible light camera; and displaying the second image on a display device of the target object.
[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0131] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0133] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0134] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0135] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0136] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0138] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for segmenting a defective area of a cable accessory, characterized in that: include: Collect raw infrared images of cable accessories through target equipment; Performing histogram equalization processing on the original infrared image to obtain a first image; Detecting the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information about an area where a defect exists in the cable accessory; The first region information is segmented using a threshold segmentation algorithm to obtain target region information.
2. The method according to claim 1, characterized in that Performing histogram equalization processing on the original infrared image to obtain a first image includes: Determine a first grayscale value of each pixel in the original infrared image, and the number of pixels corresponding to each first grayscale value and the total number of pixels; Calculating a second grayscale value for each pixel based on the number of pixels corresponding to each first grayscale value, the number of pixels, and the grayscale value of each pixel; The first image is obtained according to the second grayscale value of each pixel in the original infrared image.
3. The method according to claim 1, characterized in that Detecting the first image based on a target detection algorithm to obtain first region information includes: Dividing the first image according to a preset size to obtain a plurality of grids; For each grid in the plurality of grids, predicting coordinate information of a bounding box of the grid according to the target detection algorithm; Predicting the category probability of the bounding box according to the object detection algorithm, and predicting the confidence score of the bounding box; The first region information is obtained according to the coordinate information of the bounding box, the category probability of the bounding box, and the confidence score of the bounding box.
4. The method according to claim 1, characterized in that: The first region information is segmented using a threshold segmentation algorithm to obtain target region information, including: determining a target threshold value according to the grayscale value of the first image; Determining a coordinate value range of the defective area according to the first area information; For each pixel point in the coordinate value range, the grayscale value of the pixel point is compared with the target threshold value to obtain a comparison result of each pixel point; The target area information is obtained according to the comparison result of each pixel point.
5. The method according to claim 4, characterized in that Determining a target threshold according to the grayscale value of the first image includes: Calculating a grayscale histogram of the first image, and determining a plurality of candidate thresholds according to each grayscale value included in the grayscale histogram; For each candidate threshold value among the multiple candidate threshold values, group the pixels of the first image according to the candidate threshold value, and perform calculations on each group of pixels to obtain multiple groups of pixels corresponding to each candidate threshold value, as well as an average grayscale value of each group of pixels in the multiple groups of pixels and the number of pixels in each group of pixels; Calculating the inter-group variance corresponding to each candidate threshold value according to the multiple groups of pixels corresponding to each candidate threshold value, the average grayscale value of each group of pixels in the multiple groups of pixels, and the number of pixels in each group of pixels; The target threshold is determined according to the candidate threshold corresponding to the maximum inter-group variance among the inter-group variances corresponding to each candidate threshold.
6. The method according to claim 1, characterized in that The target device at least includes: a detector, and the original infrared image of the cable accessory is collected by the target device, including: Based on infrared radiation of the cable accessory received by the detector; converting the infrared radiation of the cable accessories into temperature change information; Converting the temperature change information into an electrical signal, and processing the electrical signal to obtain a digital signal; The original infrared image is determined according to the digital signal.
7. The method according to claim 1, characterized in that After segmenting the first region information using a threshold segmentation algorithm to obtain target region information, the method further includes: Generate image annotation information according to the first region information and the target region information, wherein the image annotation information includes at least one of the following: defect type, defect location, and defect region area; Merging the picture annotation information and the second image of the cable accessory to obtain an annotated second image, wherein the second image is an image of the cable accessory captured by a visible light camera device; The second image is displayed on a display device of the target object.
8. A device for segmenting defective areas of a cable accessory, characterized in that: include: A collection unit, used for collecting original infrared images of cable accessories through a target device; A processing unit, configured to perform histogram equalization processing on the original infrared image to obtain a first image; A detection unit, configured to detect the first image based on a target detection algorithm to obtain first area information, wherein the first area information is information about an area where a defective cable accessory exists; The segmentation unit is used to segment the first region information using a threshold segmentation algorithm to obtain target region information.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes stored computer instructions, wherein when the computer instructions are executed by a processor, the method for segmenting a defective area of a cable accessory according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: It comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for segmenting the defective area of the cable accessory as described in any one of claims 1 to 7.
Citation Information
Cited By
Power transmission and distribution line iron accessory temperature abnormity control method and system
CN120747152A
A power transmission line accessory fitting temperature anomaly control method and system
CN120747152B