A method and device for detecting image anomalies in power inspection, an electronic device and a computer readable storage medium
By performing equipment type identification and segmentation, multi-scale decomposition and enhancement processing on power inspection images, and combining this with analysis of a normal image database, the problem of poor accuracy in detecting subtle anomalies in existing technologies has been solved, achieving precise anomaly detection in power inspection images.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CSG EHV POWER TRANSMISSION
- Filing Date
- 2025-08-06
- Publication Date
- 2026-05-05
AI Technical Summary
Existing methods for detecting anomalies in power line inspection images are unable to accurately capture the features of subtle parts, resulting in poor anomaly detection accuracy and failing to meet current needs.
By acquiring power line inspection images, identification and segmentation are performed based on the type of equipment to be inspected. Multi-scale decomposition and feature extraction are carried out, and combined with enhancement processing and comparative analysis, abnormal detection areas are determined. Matching and comparison are then performed using a normal image database.
It improves the accuracy of detecting anomalies in subtle parts of power line inspection images, meeting current detection needs.
Smart Images

Figure CN121191019B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid inspection technology, and more specifically, to a method, apparatus, electronic device, and computer-readable storage medium for detecting anomalies in power grid inspection images. Background Technology
[0002] With the rapid development of artificial intelligence technology, image recognition-based power inspection methods have been widely used in power systems. Compared with traditional manual inspection methods, using intelligent image analysis systems mounted on drones for power facility inspection not only significantly improves work efficiency but also reduces the workload and safety risks for operators, making it particularly suitable for inspection work in complex and dangerous areas.
[0003] Currently, existing methods for detecting anomalies in power inspection images often fail to fully extract the rich details contained in power inspection images when detecting the features of small components and hidden parts of power equipment. For example, when detecting minor anomalies such as slight wear on conductors or tiny cracks in insulators, it is difficult to accurately capture the features of these small parts, and these minor anomalies are easily overlooked during detection, resulting in poor accuracy of anomaly detection and failing to meet current needs. Summary of the Invention
[0004] In view of this, the present invention proposes a method, apparatus, electronic device and computer-readable storage medium for detecting anomalies in power inspection images, aiming to solve one or more of the technical problems mentioned in the background section above.
[0005] In a first aspect, embodiments of the present invention provide a method for detecting anomalies in power line inspection images. The method includes: acquiring a power line inspection image; identifying and segmenting the power line inspection image based on the type of equipment to be inspected to obtain a target inspection image; performing multi-scale decomposition and extraction on the target inspection image to obtain scale features; mapping the target inspection image based on the scale features to determine a target detection region image; performing enhancement processing on the target detection region image to obtain an enhanced image; and comparing and analyzing the enhanced image with a normal image at the target detection region image to obtain an anomaly detection result, wherein the normal image at the target detection region image is obtained by detecting and matching the target detection region image in a normal image database.
[0006] Further, the power inspection image is identified and segmented based on the type of the equipment to be inspected to obtain a target inspection image, including: performing edge processing on the power inspection image to obtain an edge image; for each inspection equipment in the first inspection equipment, extracting the contour of the edge image based on the type of each inspection equipment to obtain a first edge contour of each inspection equipment; wherein, the first inspection equipment is the equipment to be inspected determined at the beginning of the power inspection; performing feature analysis on the first edge contour of each inspection equipment to obtain a first contour feature, and performing feature transformation on the boundary points of the first edge contour of each inspection equipment to obtain a second contour feature; determining the inspection equipment in the first inspection equipment that meets the preset requirements as the second inspection equipment based on the first contour feature and the second contour feature of each inspection equipment; and segmenting the power inspection image based on the second inspection equipment and the second edge contour of the second inspection equipment to obtain the target inspection image.
[0007] Furthermore, the power inspection image is segmented based on the second inspection device and its second edge contour to obtain the target inspection image. This includes: constructing a topology graph of the power inspection image using each connected region in the power inspection image as a node and the adjacency relationship between connected regions as an edge; filtering nodes in the topology graph based on the second inspection device to obtain a set of nodes belonging to the second inspection device; matching the second edge contour with the node set to obtain a matching result, and mapping the matching result with the topology graph to determine the topology of the second inspection device; performing region growing on the power inspection image based on the topology of the second inspection device to determine the segmentation range, and segmenting the power inspection image based on the segmentation range to obtain the target inspection image.
[0008] Furthermore, the target inspection image is decomposed and extracted at multiple scales to obtain scale features, including: performing multi-scale wavelet decomposition on the target inspection image based on a preset objective function to obtain low-frequency components and multiple high-frequency components; extracting features from the low-frequency and high-frequency components at each scale based on the decomposition scale to obtain a low-frequency component feature set and a high-frequency component feature set; filtering the low-frequency component feature set and the high-frequency component feature set based on the type of the second inspection device to obtain a first abnormal feature set and a second abnormal feature set; and fusing the first abnormal feature set and the second abnormal feature set at different scales to obtain scale features.
[0009] Further, mapping the target inspection image based on the scale features to determine the target detection region image includes: performing fuzzy clustering on the scale features to obtain clustering results, and dividing the pixels of the target inspection image based on the clustering results to obtain multiple cluster categories; filtering and eliminating multiple cluster categories to obtain a filtered pixel set; performing morphological operations on the filtered pixel set to determine the target pixel set; performing connected component analysis based on the target pixel set to determine the boundaries of each connected component; and merging adjacent and feature-similar connected components based on the boundaries of each connected component to obtain the target detection region image.
[0010] Further, the target detection region image is enhanced to obtain an enhanced image, including: performing local image enhancement on the target detection region image to obtain a first enhanced image; and performing contrast enhancement on the first enhanced image to obtain a second enhanced image.
[0011] Further, local image enhancement is performed on the target detection region image to obtain a first enhanced image, including: constructing a guide image using the target detection region image as input, and filtering the target detection region image based on the linear relationship between the target detection region image and the guide image to obtain a filtered image; extracting multimodal features from the filtered image to obtain color features, texture features, and edge features; determining enhancement weights based on the correlation between the color features, texture features, and edge features and the abnormal features of the second inspection equipment; and enhancing the filtered image based on the enhancement weights to obtain the first enhanced image.
[0012] Further, the first enhanced image is contrast-enhanced to obtain a second enhanced image, including: converting the first enhanced image from the RGB color space to a preset color space to obtain a color-converted image; dividing the color-converted image into multiple sub-regions, and performing brightness statistical processing on each sub-region to obtain the statistics of each sub-region; determining the stretching coefficient of each sub-region based on the statistics of each sub-region and a preset stretching function; performing contrast stretching on the pixels in each sub-region based on the stretching coefficient to obtain a stretched image; and converting the stretched image of each sub-region back from the preset color space to the RGB color space to obtain the second enhanced image.
[0013] Further, the enhanced image is compared and analyzed with the normal image at the target detection region to obtain anomaly detection results, including: comparing the similarity between the enhanced image and the normal image at the target detection region to obtain a similarity comparison result; if the similarity comparison result is less than a preset threshold, an anomaly exists, and the distribution of pixel differences between the enhanced image and the normal image at the target detection region is analyzed to determine the location and range of the abnormal region.
[0014] Secondly, embodiments of the present invention also provide an apparatus for detecting anomalies in power line inspection images. The apparatus includes: an acquisition unit for acquiring power line inspection images; an identification and segmentation unit for identifying and segmenting the power line inspection images based on the type of equipment to be inspected, to obtain a target inspection image; a decomposition and extraction unit for performing multi-scale decomposition and extraction on the target inspection image to obtain scale features; a mapping unit for mapping the target inspection image based on the scale features to determine a target detection region image; an enhancement unit for enhancing the target detection region image to obtain an enhanced image; and a comparison and analysis unit for comparing and analyzing the enhanced image with a normal image at the target detection region image to obtain an anomaly detection result, wherein the normal image at the target detection region image is obtained by detecting and matching the target detection region image in a normal image database.
[0015] Furthermore, the identification and cutting unit is also used for: performing edge processing on the power inspection image to obtain an edge image; extracting the contour of the edge image based on the type of each inspection device in the first inspection equipment to obtain a first edge contour of each inspection device; wherein, the first inspection device is the device to be inspected determined at the beginning of the power inspection; performing feature analysis on the first edge contour of each inspection device to obtain a first contour feature, and performing feature transformation on the boundary points of the first edge contour of each inspection device to obtain a second contour feature; determining the inspection device that meets the preset requirements in the first inspection equipment as the second inspection device based on the first contour feature and the second contour feature of each inspection device; and cutting the power inspection image based on the second inspection device and the second edge contour of the second inspection device to obtain a target inspection image.
[0016] Furthermore, the power inspection image is segmented based on the second inspection device and its second edge contour to obtain the target inspection image. This includes: constructing a topology graph of the power inspection image using each connected region in the power inspection image as a node and the adjacency relationship between connected regions as an edge; filtering nodes in the topology graph based on the second inspection device to obtain a set of nodes belonging to the second inspection device; matching the second edge contour with the node set to obtain a matching result, and mapping the matching result with the topology graph to determine the topology of the second inspection device; performing region growing on the power inspection image based on the topology of the second inspection device to determine the segmentation range, and segmenting the power inspection image based on the segmentation range to obtain the target inspection image.
[0017] Furthermore, the decomposition and extraction unit is also used to: perform multi-scale wavelet decomposition on the target inspection image based on a preset objective function to obtain low-frequency components and multiple high-frequency components; extract features from the low-frequency components and high-frequency components at each scale based on the decomposition scale to obtain a low-frequency component feature set and a high-frequency component feature set; filter the low-frequency component feature set and the high-frequency component feature set based on the type of the second inspection device to obtain a first abnormal feature set and a second abnormal feature set; and fuse the first abnormal feature set and the second abnormal feature set at different scales to obtain scale features.
[0018] Furthermore, the mapping unit is also used to: perform fuzzy clustering on the scale features to obtain clustering results, and divide the pixels of the target inspection image based on the clustering results to obtain multiple cluster categories; filter and remove multiple cluster categories to obtain a filtered pixel set; perform morphological operations on the filtered pixel set to determine the target pixel set; perform connected component analysis based on the target pixel set to determine the boundaries of each connected component; and merge adjacent and feature-similar connected components based on the boundaries of each connected component to obtain the target detection region image.
[0019] Furthermore, the enhancement unit is also used to: perform local image enhancement on the target detection region image to obtain a first enhanced image; and perform contrast enhancement on the first enhanced image to obtain a second enhanced image.
[0020] Further, local image enhancement is performed on the target detection region image to obtain a first enhanced image, including: constructing a guide image using the target detection region image as input, and filtering the target detection region image based on the linear relationship between the target detection region image and the guide image to obtain a filtered image; extracting multimodal features from the filtered image to obtain color features, texture features, and edge features; determining enhancement weights based on the correlation between the color features, texture features, and edge features and the abnormal features of the second inspection equipment; and enhancing the filtered image based on the enhancement weights to obtain the first enhanced image.
[0021] Further, the first enhanced image is contrast-enhanced to obtain a second enhanced image, including: converting the first enhanced image from the RGB color space to a preset color space to obtain a color-converted image; dividing the color-converted image into multiple sub-regions, and performing brightness statistical processing on each sub-region to obtain the statistics of each sub-region; determining the stretching coefficient of each sub-region based on the statistics of each sub-region and a preset stretching function; performing contrast stretching on the pixels in each sub-region based on the stretching coefficient to obtain a stretched image; and converting the stretched image of each sub-region back from the preset color space to the RGB color space to obtain the second enhanced image.
[0022] Furthermore, the comparison and analysis unit is also used to: compare the similarity between the enhanced image and the normal image at the target detection region image to obtain a similarity comparison result; if the similarity comparison result is less than a preset threshold, an anomaly exists; analyze the distribution of pixel differences between the enhanced image and the normal image at the target detection region image to determine the location and range of the abnormal region.
[0023] Thirdly, embodiments of the present invention also provide an electronic device, including: a processor; a memory for storing processor-executable instructions; and a processor for reading executable instructions from the memory and executing the instructions to implement the methods provided in the above embodiments.
[0024] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods provided in the above embodiments.
[0025] The method and apparatus for detecting anomalies in power line inspection images provided in this invention identify and segment the power line inspection image according to the type of equipment to be inspected, obtaining a target inspection image of the target equipment with irrelevant background removed, reducing background noise and interference, and initially improving the accuracy of subsequent anomaly detection. Furthermore, based on the scale features obtained by multi-scale decomposition and extraction of the target inspection image, the rich detail information contained in the inspection image can be more comprehensively mined, solving the problem of not being able to mine rich detail information. Combined with the enhancement processing after mapping and recognition of the scale features and the target inspection image, the features of small parts and hidden areas in the target detection area are highlighted, avoiding the neglect of anomalies in subtle areas. Finally, a comparative analysis of the enhanced image and the normal image is obtained, achieving accurate anomaly detection in power line inspection images. The method provided in this invention can more fully mine the rich detail information contained in power line inspection images, avoid neglecting anomalies in subtle areas, improve the accuracy of anomaly detection, and thus meet current needs. Attached Figure Description
[0026] Figure 1 A flowchart of a method for detecting anomalies in power line inspection images provided in an embodiment of the present invention;
[0027] Figure 2 for Figure 1 A flowchart of a preferred embodiment of the method shown;
[0028] Figure 3 for Figure 1 A flowchart of a preferred embodiment of the method shown;
[0029] Figure 4 for Figure 1A flowchart of a preferred embodiment of the method shown;
[0030] Figure 5 for Figure 1 A flowchart of a preferred embodiment of the method shown;
[0031] Figure 6 This is a schematic diagram of the structure of a device for detecting anomalies in power line inspection images according to an embodiment of the present invention;
[0032] Figure 7 A block diagram of an electronic device provided as an exemplary embodiment of the present invention. Detailed Implementation
[0033] Exemplary embodiments of the invention will now be described with reference to the accompanying drawings. However, the invention may be embodied in many different forms and is not limited to the embodiments described herein. These embodiments are provided to fully and completely disclose the invention and to fully convey its scope to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the drawings is not intended to limit the invention. In the drawings, the same units / elements are referred to by the same reference numerals.
[0034] Unless otherwise stated, the terms used herein (including technical terms) have their common meaning as understood by one of ordinary skill in the art. Furthermore, it is understood that terms defined in commonly used dictionaries should be understood to have a meaning consistent with the context of their relevant field, and not to be interpreted as having an idealized or overly formal meaning.
[0035] Figure 1 This is a flowchart of a method for detecting anomalies in power line inspection images according to an embodiment of the present invention.
[0036] like Figure 1 As shown, the method includes:
[0037] Step S10: Obtain power line inspection images.
[0038] Optionally, each power grid inspection route is equipped with corresponding camera equipment. The camera equipment can be deployed at preset locations or on drones, and the power grid inspection images are captured by the camera equipment.
[0039] Step S20: Identify and segment the power inspection image based on the type of equipment to be inspected to obtain the target inspection image.
[0040] Optionally, after acquiring the power inspection image, the anomaly detection system first determines the equipment to be inspected (i.e., the first inspection equipment) during the power inspection process. The equipment to be inspected includes a single device or a combination of multiple devices, so there may be multiple devices simultaneously recorded in the power inspection image during the inspection. Therefore, the anomaly detection system performs recognition processing on the power inspection image according to the characteristics of each type of equipment to be inspected, obtains the recognition result, and then segments the power inspection image according to the recognition result. The power inspection image is segmented according to the characteristics of each group of equipment to be inspected to obtain the final target inspection image. The specific process is described in steps S201-S205.
[0041] Furthermore, power line inspection images often contain a large amount of background information, such as the surrounding environment and other unrelated equipment. This background information increases the computational load in the initial anomaly detection of the inspected equipment in the power line inspection image and can also interfere with the judgment of the target equipment's anomaly. Therefore, the anomaly detection system performs segmentation processing on the power line inspection image based on the detection and recognition results. This can remove background information in the image that is unrelated to the target inspected equipment, reduce the amount of data for subsequent processing, and improve processing efficiency. At the same time, segmenting for specific equipment makes subsequent analysis more focused on the target object, improving the accuracy of anomaly detection.
[0042] Furthermore, in one embodiment, it is assumed that the first inspection device is a specific type of transformer with a unique shape and color markings (i.e., equipment characteristics). When identifying the acquired power inspection image based on the transformer characteristics, the identification results that match the transformer characteristics in the power inspection image are identified. Then, based on the identification results that match the transformer characteristics in the power inspection image, the power inspection image is segmented to finally obtain the target inspection image that matches the transformer characteristics for subsequent anomaly detection processing.
[0043] Step S30: Perform multi-scale decomposition and extraction on the target inspection image to obtain scale features.
[0044] Optionally, the anomaly detection system uses a multi-scale analysis method to decompose the target inspection image into multiple scales after acquiring it, so as to better capture feature information of different sizes in the image at different scales. Finally, feature extraction is performed based on the feature information at different scales to obtain scale features. The specific process is described in steps S301 to S304.
[0045] Furthermore, since image features at a single scale often cannot fully reflect the information of an image, focusing only on the overall features of the image may overlook some subtle anomalies, while focusing only on detailed features may miss abnormal changes in the overall structure. Therefore, anomaly detection systems can more effectively detect anomalies by comprehensively considering information at different levels through multi-scale analysis.
[0046] Furthermore, in one embodiment, for a target inspection image containing a transmission line, a multi-scale analysis method (wavelet transform) is used to perform multi-scale decomposition. At a large scale, the direction and overall layout of the transmission line can be clearly seen; at a small scale, the texture details of the transmission line surface can be observed, such as whether there are signs of wear or corrosion. By extracting features at different scales, a comprehensive feature description of the transmission line is obtained.
[0047] Step S40: Map the target inspection image based on scale features to determine the target detection area image.
[0048] Optionally, the anomaly detection system maps the target inspection image based on the acquired scale features to more accurately determine the target detection area, as described in steps S401-S405, in order to further eliminate interference from the background and other non-target devices, so that subsequent image enhancement and anomaly detection can focus on the target device, thereby improving the accuracy and efficiency of detection.
[0049] Step S50: Enhance the image of the target detection region to obtain an enhanced image.
[0050] Optionally, after determining the target detection area in the target inspection image, the anomaly detection system processes the target detection area using image enhancement methods, such as local enhancement, overall enhancement, or contrast enhancement, to improve the image clarity and make subtle anomalies that might otherwise be ignored visible. The specific process is described in steps S501-S502.
[0051] Step S60: Compare and analyze the enhanced image with the normal image at the target detection region to obtain the anomaly detection result. The normal image at the target detection region is obtained by detecting and matching the target detection region image in the normal image database.
[0052] Optionally, the anomaly detection system first establishes a normal image database, which stores a large number of normal state images of the equipment to be inspected under different environmental conditions. Then, the image of the determined target detection area is matched against the normal image database to obtain the normal image at the corresponding target detection area. After obtaining the enhanced image, image matching and difference analysis algorithms can be used to compare and analyze the enhanced image with the normal images in the database one by one. The degree of difference in the comparison analysis determines whether an anomaly exists, as described in steps S601-S602.
[0053] This invention, through the identification and segmentation of power inspection images based on the type of equipment to be inspected, yields target inspection images of the target equipment with irrelevant backgrounds removed, reducing background noise and interference and initially improving the accuracy of subsequent anomaly detection. Furthermore, by performing multi-scale decomposition and extraction of scale features from the target inspection image, the rich detail information contained within the image can be more comprehensively mined, solving the problem of not being able to extract rich detail information. Combined with the enhancement processing after mapping and recognition of scale features and the target inspection image, the features of small components and hidden parts in the target detection area are highlighted, avoiding the neglect of anomalies in subtle areas. Finally, a comparative analysis of the enhanced image and the normal image is obtained, achieving accurate anomaly detection in power inspection images. The method provided by this invention can more fully mine the rich detail information contained in power inspection images, avoid neglecting anomalies in subtle areas, improve the accuracy of anomaly detection, and thus meet current needs.
[0054] Figure 2 for Figure 1 A flowchart of a preferred embodiment of the method shown.
[0055] like Figure 2 As shown, in a preferred embodiment, step S20 includes:
[0056] Step S201: Perform edge processing on the power inspection image to obtain an edge image.
[0057] Optionally, the anomaly detection system employs an edge detection algorithm (such as the Canny edge detection algorithm) to perform edge processing on the power line inspection images. Specifically, firstly, the power line inspection images are subjected to Gaussian filtering to smooth the image and reduce noise interference. Next, the gradient magnitude and direction of each pixel in the image are calculated. When calculating the gradient, the Sobel operator is used for template convolution in the horizontal and vertical directions to approximate the gradient. Then, to preserve the accurate location of edges, non-maximum suppression is applied to the gradient magnitude, removing pixels that are not true edges. Finally, edges in the image are determined through double threshold detection and edge concatenation, resulting in an edge image.
[0058] Step S202: For each inspection device in the first inspection device, extract the contour of the edge image based on the type of each inspection device to obtain the first edge contour of each inspection device; wherein, the first inspection device is the device to be inspected determined at the beginning of the power inspection.
[0059] Optionally, the anomaly detection system pre-builds a contour template library for different types of inspection equipment. For each type of inspection equipment in the first inspection system, a contour extraction algorithm, such as a chain code-based contour extraction algorithm, is used. In the edge image, starting from a starting point, the system tracks the edge pixels according to certain search rules (such as clockwise or counterclockwise direction), recording the position information of each edge pixel to form a closed contour, i.e., the first edge contour. During the tracking process, the search rules and judgment conditions are adjusted according to the characteristics of different inspection equipment types. For example, for transformers with relatively regular shapes, their symmetry and other characteristics can be used to optimize the contour extraction process; for insulators with complex shapes, more detailed tracking rules can be set based on their common shape features. This allows for contour extraction for different types of inspection equipment, fully utilizing the unique shape features of each type of equipment and improving the accuracy and specificity of contour extraction.
[0060] Furthermore, in one embodiment, taking a first inspection device comprising a transformer and an insulator as an example, for the transformer device, based on its shape characteristics of a combination of circles and rectangles, starting from a point suspected to be the edge of the transformer in the edge image, tracing in a clockwise direction, and utilizing its symmetry, the complete first edge contour is quickly determined. For the insulator device, based on its complex umbrella skirt shape and columnar structure, different tracing rules are adopted for different parts during contour extraction, ultimately successfully extracting the first edge contour of the insulator.
[0061] Step S203: Perform feature analysis on the first edge contour of each inspection device to obtain the first contour feature, and perform feature transformation on the boundary points of the first edge contour of each inspection device to obtain the second contour feature.
[0062] Optionally, the anomaly detection system performs feature analysis on the first edge contour of each inspection device, including extracting the geometric features of the contour, such as perimeter, area, and aspect ratio. Specifically, when calculating the contour perimeter, assume there are n boundary points P on the contour. i (x i y i ), i = 1, ..., n, can be obtained through the formula Calculate the perimeter of the profile where p i These are points on the contour. Green's formula can be used to calculate the area A of the contour:
[0063] Green's formula is used to transform area calculation into operations on the coordinates of boundary points on the contour. Then, the anomaly detection system performs a Fourier transform on the boundary points of the first edge contour of each inspection device, treating the boundary point coordinate sequence as a discrete signal and performing a Discrete Fourier Transform (DFT). The Fourier transform converts a time-domain signal to the frequency domain. By analyzing the frequency domain characteristics, the characteristic representation of the boundary point sequence at different frequency components can be obtained; these frequency domain characteristics are the second contour features. For example, if the contour boundary point sequence is {x(n), y(n)}, its Discrete Fourier Transform is... k = 0, ..., N-1; The time-domain boundary point coordinate sequence is transformed to the frequency domain using a formula to obtain the frequency domain features.
[0064] Step S204: Based on the first contour features and the second contour features of each inspection device, determine the inspection device that meets the preset requirements among the first inspection devices as the second inspection device.
[0065] Optionally, the preset requirement is that both the first contour feature and the second contour feature are in the preset inspection equipment contour feature library.
[0066] Optionally, the anomaly detection system pre-constructs a contour feature library for inspection equipment. This library stores the first and second contour features of various known types of inspection equipment under normal conditions. For the contour features of each inspection equipment extracted from actual power inspection images, its first contour features (such as perimeter, area, aspect ratio, etc.) and second contour features (such as frequency domain features after Fourier transform) are matched and compared with features in the pre-constructed feature library. A similarity calculation method, such as Euclidean distance, is used to calculate the distance in the feature space. For the first contour feature, the Euclidean distance between the actual feature and the feature in the library is calculated in the geometric feature space; for the second contour feature, the Euclidean distance in the frequency domain feature space is calculated. If both distances are less than a preset threshold, it indicates that the contour feature of the inspection equipment matches the feature of a certain type of inspection equipment in the pre-constructed feature library, and it is identified as the second type of inspection equipment. By matching with the pre-constructed feature library, known types of inspection equipment can be quickly and accurately identified, and the matching based on two different types of contour features improves the accuracy and reliability of the identification.
[0067] Furthermore, in one embodiment, taking Euclidean distance calculation as an example, let the first contour feature vector of the actual device be... The first contour feature vector of a certain type of device in the preset feature library is: Then the Euclidean distance between them For the second contour feature vector and Euclidean distance The device is matched by comparing the magnitudes of d1 and d2 with a preset threshold.
[0068] Step S205: Based on the second inspection device and the second edge contour of the second inspection device, the power inspection image is segmented to obtain the target inspection image.
[0069] Optionally, after identifying the second inspection device, the anomaly detection system segments the power inspection image based on the second inspection device and its second edge contour to accurately obtain a target inspection image containing only the second inspection device. The specific process is described in steps S2051-S2054, enabling precise acquisition of images of the inspection devices requiring focused detection, removing irrelevant background and other equipment information, significantly reducing the amount of data required for subsequent anomaly detection, and improving detection efficiency.
[0070] This invention fully utilizes the shape features of different inspection devices, accurately identifies target inspection devices through multi-dimensional contour feature analysis and matching with a preset feature library, and precisely segments them. This improves the processing efficiency and accuracy of target devices in power inspection images, provides a high-quality data foundation for subsequent anomaly detection, and helps to more effectively ensure the safe and stable operation of the power system.
[0071] In a real-time example, steps S2051-S2054 are described as follows:
[0072] Step S2051: Construct a topology graph of the power inspection image, using each connected region in the power inspection image as a node and the adjacency relationship between connected regions as an edge.
[0073] Optionally, the anomaly detection system performs connected component analysis on the power line inspection image. A scan-line-based connected component labeling algorithm is used, scanning the image line by line starting from the top left corner. Let the power line inspection image be I. ch u For each pixel (x, y), if its pixel value is not a background value (e.g., in a binarized image, the background value is 0 and the target value is 1), and at least one of its left neighbor (x-1, y) and its top neighbor (x, y-1) has been labeled as a connected region, then the pixel is labeled as a connected region of the same type as its left or top neighbor. If neither the left nor the top neighbor is labeled or belongs to a different connected region, then a new connected region label is created for the pixel. After completing the connected region labeling, each connected region is considered as a node. For adjacent connected regions, i.e., those with adjacent boundary pixels in the image, an edge is created to represent their adjacency relationship, constructing a topology graph of the power line inspection image. For example, if connected regions A and B have adjacent boundaries in the image, then an edge connecting node A and node B is added to the topology graph.
[0074] Furthermore, taking a power line inspection image containing poles, insulators, and some background debris as an example, a connected component labeling algorithm based on scan lines is used to label each part of the pole as a connected component, the insulator as another connected component, and the background debris as multiple connected components. Then, based on adjacency relationships, edges are established between the connected components of the pole and adjacent connected components of the insulator, as well as between other adjacent connected components, thereby constructing a topological graph of the power line inspection image.
[0075] Step S2052: Based on the second inspection device, the topology map is filtered to obtain the set of nodes belonging to the second inspection device.
[0076] The node characteristics belonging to this type of equipment are determined by traversing all nodes in the topology graph. For each node, its relevant characteristics are calculated. Based on the calculated characteristics, they are compared with the characteristic criteria of the second inspection equipment type. If they match, the node is selected, and finally, the set of nodes belonging to the second inspection equipment is obtained.
[0077] Furthermore, in one embodiment, taking a transformer as an example of the second inspection device, it is known that a transformer has specific shape and structural features, and the position and adjacency relationships of its corresponding connected regions in the topology graph have certain patterns. Based on these features, the nodes in the topology graph are traversed. For each node, the shape features (such as area, perimeter, shape complexity, etc.) of its corresponding connected regions and its connection relationships with adjacent nodes are analyzed to see if they conform to the characteristic patterns of the transformer. If they do, the node is selected, and finally, the set of nodes belonging to the second inspection device (transformer) is obtained.
[0078] Step S2053: Match the second edge contour with the node set to obtain the matching result, and map the matching result with the topology map to determine the topology of the second inspection device.
[0079] Optionally, the anomaly detection system matches the extracted second edge contour of the second inspection device with the selected set of nodes. For each node in the node set, the degree of overlap between its corresponding connected region boundary and the second edge contour is determined. A contour matching algorithm, such as a Hausdorff distance-based matching algorithm, can be used. The Hausdorff distance between the connected region boundary contour of the node and the second edge contour is calculated; a smaller distance indicates a higher degree of overlap. Based on the matching results, it is determined which nodes' connected regions truly belong to the contour range of the second inspection device. Then, these matched nodes and their edges are mapped in the topology graph to determine the topological structure of the second inspection device in the topology graph, i.e., to clarify the connection relationships and spatial layout between the various parts of the second inspection device.
[0080] Step S2054: Based on the topology of the second inspection device, perform region growing on the power inspection image, determine the cutting range, and cut the power inspection image based on the cutting range to obtain the target inspection image.
[0081] Optionally, the anomaly detection system performs a region growing operation on the power inspection image based on the determined topology of the second inspection device. Using a key node in the topology (e.g., the node corresponding to the main body of the transformer) as a seed point, the system expands the region in the image according to certain growth rules based on the characteristics (such as grayscale value, color, etc.) of the connected region corresponding to that node. The growth rule could be: if the grayscale value or color of an adjacent pixel differs from the average grayscale value or color of the connected region where the seed point is located within a certain range, then that adjacent pixel is included in the growing region. This process is repeated until the growing region covers the entire area of the second inspection device in the image, thus determining the cutting range. Finally, using an image cutting algorithm, such as rectangular cutting or polygon cutting (depending on the shape of the growing region), the determined cutting range is cut out from the power inspection image to obtain the target inspection image.
[0082] This invention fully utilizes the spatial structure information of images and the feature information of equipment to accurately extract images of target inspection equipment from complex power inspection images. This improves the accuracy and specificity of the extraction process, providing a high-quality data foundation for subsequent anomaly detection. It helps to more effectively discover potential anomalies in power equipment and ensures the safe and stable operation of the power system.
[0083] Figure 3 for Figure 1 A flowchart of a preferred embodiment of the method shown.
[0084] like Figure 3 As shown, step S30 includes:
[0085] Step S301: Perform multi-scale wavelet decomposition on the target inspection image based on the preset objective function to obtain low-frequency components and multiple high-frequency components.
[0086] Optionally, since traditional wavelet basis functions may not be well adapted to the characteristics of target equipment in power line inspection images in some cases, the anomaly detection system modifies and adjusts the parameters of classic wavelet basis functions (such as Haar wavelets) to construct new wavelet basis functions (i.e., preset target functions) ψ. new (t). Let the original Haar wavelet basis function be ψ. Haar (t), by introducing adjustment parameters α and β, the new wavelet basis function is defined as ψ new (t)=αψ Haar(βt). Through multiple experiments, suitable α and β values were determined for different types of power line inspection images and target equipment, enabling the preset objective function to better capture the detailed features of the target equipment at different scales. Subsequently, the anomaly detection system uses the constructed preset objective function to perform multi-scale wavelet decomposition on the target inspection image. In the two-dimensional case, the target inspection image is processed through a series of high-pass and low-pass filters. In each decomposition level, the image passes through a low-pass filter to obtain low-frequency components, which represent the general outline and slowly changing parts of the image; a high-pass filter obtains high-frequency components, which contain detailed information such as edges and textures. As the decomposition scale increases, the low-frequency components are further decomposed, resulting in low-frequency and high-frequency components at different scales.
[0087] Step S302: Based on the decomposition scale, extract features from the low-frequency components and high-frequency components of each scale to obtain the low-frequency component feature set and the high-frequency component feature set.
[0088] Optionally, the anomaly detection system extracts features such as energy, mean, and entropy from the acquired low-frequency components and features such as gradient magnitude, edge density, and texture from the high-frequency components. Then, it combines the energy, mean, and entropy features of the low-frequency components at each scale into a low-frequency component feature set, and combines the gradient magnitude, edge density, and texture features of the high-frequency components into a high-frequency component feature set.
[0089] Furthermore, for the low-frequency component, let the low-frequency component A be... j (x, y) represents the j-th low-frequency component, and its energy characteristic is calculated using the following formula: Its energy reflects the intensity distribution of low-frequency components in the image. The formula for calculating the mean feature... Where M and N are the image dimensions, representing the average gray level of the low-frequency components. The formula for calculating entropy features is... This reflects the richness of information in the low-frequency components. For the high-frequency components, the horizontal high-frequency component H... j Taking (x, y) as an example, the gradient magnitude feature is calculated by calculating the first derivative in the horizontal direction (e.g., using the Sobel operator). With H j Convolution yields the gradient magnitude. For edge density features, the proportion of pixels with gradient magnitudes greater than a certain threshold in high-frequency components is counted out of the total number of pixels. For texture features, the contrast, correlation, and other features of the texture are calculated using the Gray-Level Co-occurrence Matrix (GLCM).
[0090] Step S303: Based on the type of the second inspection equipment, the low-frequency component feature set and the high-frequency component feature set are screened respectively to obtain the first abnormal feature set and the second abnormal feature set.
[0091] Optionally, the anomaly detection system selects the most representative features for anomaly detection based on the type of the second inspection equipment. For example, for tower equipment, its low-frequency components mainly exhibit larger structural and contour features, while high-frequency components show edge and local detail features. By analyzing the low-frequency and high-frequency component features of a large number of normal and abnormal sample images of tower equipment, features related to tower anomalies are determined. Specifically, for the low-frequency component feature set, Principal Component Analysis (PCA) is used to reduce the dimensionality of the features, and a Support Vector Machine (SVM) classifier is used to filter the features. Let the low-frequency component feature set be {F}. low,1 F low,2 F low,n First, perform PCA dimensionality reduction to map the high-dimensional features to a low-dimensional space, obtaining the principal component features {PC1, PC2, ..., PC...}. k (k < n). Then, an SVM classifier is used to train the principal component features. Based on classification accuracy and feature importance evaluation, the features that contribute most to distinguishing between normal and abnormal towers are selected to form the first abnormal feature set. For the high-frequency component feature set, a Random Forest (RF) algorithm is used for feature selection. The Random Forest classifies and regresses the high-frequency component features by constructing multiple decision trees. The importance score of each feature in the Random Forest is calculated, for example, by calculating the reduction in the Gini impurity of the feature. An importance threshold is set, and features with importance scores greater than the threshold are selected to form the second abnormal feature set.
[0092] Furthermore, in one embodiment, taking pole / tower equipment as an example, after PCA dimensionality reduction in the low-frequency component feature set, five principal component features are obtained. After training with an SVM classifier, it is found that principal component features PC1 (related to the overall structure of the pole / tower) and PC3 (related to the main contour changes of the pole / tower) contribute significantly to the accuracy of distinguishing normal and abnormal poles / towers, and are therefore included in the first abnormal feature set. In the high-frequency component feature set, random forest is used to calculate features. (gradient magnitude) and If the importance score of (texture contrast) is high and exceeds the set threshold, they will be included in the second abnormal feature set.
[0093] Step S304: Fuse the first and second anomalous feature sets at different scales to obtain scale features.
[0094] Optionally, the anomaly detection system fuses the obtained first and second anomaly feature sets using feature concatenation. The first and second anomaly feature sets at different scales are concatenated in scale order. Let there be s scales in total, and let F be the first anomaly feature set at the j-th scale. 1,j ={f1,j1 f 1,j2 , ..., f 1,jk The second abnormal feature set is F. 2,j ={f 2,j1 f 2,j2 , ..., f 2,jl The fused scale feature vector F = {F} 1,1 ,F 2,1 ,F 1,2 ,F 2,2 ,…,F 1,s ,F 2,s That is, to arrange the anomalous features at all scales into a long vector in order.
[0095] Furthermore, in one embodiment, it is assumed that there are three scales in total. At scale 1, the first anomaly feature set F 1,1 ={0.5,0.3}, the second abnormal feature set F 2,1 ={0.7, 0.4}; at scale 2, the first anomaly feature set F 1,2 ={0.6,0.2}, the second abnormal feature set F 2,2 ={0.8,0.5}; at scale 3, the first anomaly feature set F 1,3 ={0.4,0.1}, the second abnormal feature set F 2,3 ={0.6,0.3}; the concatenated eigenvectors are F = {0.5, 0.3, 0.7, 0.4, 0.6, 0.2, 0.8, 0.5, 0.4, 0.1, 0.6, 0.3}.
[0096] This invention, through multi-scale wavelet decomposition based on a preset objective function, comprehensive feature extraction, targeted feature selection, and effective feature fusion, can accurately extract scale features related to anomalies in the second inspection equipment. These scale features integrate information from images at different scales, reducing redundancy and improving the accuracy and efficiency of anomaly detection, thus providing a solid data foundation for subsequent anomaly detection analysis.
[0097] Figure 4 for Figure 1 A flowchart of a preferred embodiment of the method shown.
[0098] like Figure 4 As shown, step S40 includes:
[0099] Step S401: Perform fuzzy clustering on the scale features to obtain clustering results, and divide the pixels of the target inspection image based on the clustering results to obtain multiple cluster categories.
[0100] Optionally, the anomaly detection system uses the fuzzy C-means clustering (FCM) algorithm to cluster the scale features, obtaining the clustering results. Specifically, let the scale feature vector be... in Let be the scale feature vector corresponding to the i-th pixel, and n be the total number of pixels. The goal of the FCM algorithm is to divide these feature vectors into c clusters, which is achieved by minimizing the objective function. The objective function is... where U=[u ij ] is the fuzzy membership matrix, u ij This represents the membership degree of the i-th feature vector to the j-th cluster category, with values ranging from [0, 1]. It is the set of cluster center vectors. The membership matrix U and cluster centers V are the centers of the j-th cluster category; m is the fuzzy weighting index, usually m>1, typically 2. The membership matrix U and cluster centers V are updated by iteratively optimizing the objective function. l The membership update formula is as follows: The formula for updating cluster centers is: After multiple iterations, when the objective function value converges to a certain threshold range, the final clustering result is obtained. Then, based on the obtained fuzzy membership matrix U, each pixel is assigned to the cluster with the highest membership degree, thus dividing the pixels of the target inspection image into c clusters.
[0101] Furthermore, in one embodiment, taking a target inspection image as an example that includes a transformer, the scale feature vector set obtained through the preceding steps... Set the clustering categories c = 3 and the fuzzy weighting index m = 2). The objective function of the FCM algorithm is iteratively optimized, and after 10 iterations, the objective function value converges. At this point, the fuzzy membership matrix U is obtained, for example, the scale feature vector of a certain pixel. Its membership degree u k1 =0.2, u k2 =0.7, u k3 If the value is 0.1, the pixel is assigned to the second cluster. By dividing all pixels, three clusters are obtained, each containing pixels related to different parts of the transformer or the background.
[0102] Step S402: Filter and remove multiple cluster categories to obtain the filtered pixel set.
[0103] Optionally, the anomaly detection system calculates feature statistics for each cluster category. For example, it calculates the mean of the scale eigenvectors within each cluster category. Where n j C is the number of pixels in the j-th cluster category. jLet represent the set of pixels in the j-th cluster. Calculate the variance of the scale eigenvectors in each cluster. Next, based on the type of the second inspection equipment and the known target characteristics, screening rules are set. For example, for transformer equipment, the cluster categories of the target area typically have a specific mean range and a small variance. Let the mean range of the transformer target area be... The variance threshold is σ tres For each cluster category, if its mean... Within the target mean range, and the variance trace(Σ) j )<σ tres , (where trace(∑ j ) represents the matrix ∑ j If the sum of the elements on the main diagonal (a measure of variance) is found, then that cluster is retained; otherwise, it is discarded. Pixels in the retained clusters are merged to obtain the filtered pixel set.
[0104] Furthermore, in one embodiment, among the three cluster categories obtained in step 401, for the first cluster category, the mean of its scale feature vector is calculated. Sum and variance ∑1. Assume the mean range of the transformer target region is [μ] min μ max Given that the variance threshold σ tres =0.5. Calculated, It is not within the target mean range, and trace(∑1)=0.8>σ tres If the first cluster category is not found, then the second cluster category will be removed. Within the target mean range, and trace(∑2)=0.3<σ tres The first cluster is retained. The third cluster is evaluated in the same way. Finally, the pixels of the retained clusters are merged to obtain the filtered pixel set, which mainly contains pixels related to the transformer target area.
[0105] Step S403: Perform morphological operations on the filtered pixel set to determine the target pixel set.
[0106] Optionally, the anomaly detection system performs an erosion operation on the binary image composed of the filtered pixel set (setting the filtered pixels to 1 and the others to 0). A structuring element B (e.g., a 3×3 square structuring element) is used, and the erosion operation is defined as follows: Where I0 is the image composed of the filtered pixel set. Erosion removes isolated noise points and fine burrs from the image, making the boundaries of the target region smoother. Dilation is then performed; the dilation operation is defined as... The dilation operation fills small holes within the target area and connects adjacent target areas, making the target area more complete. Then, the opening operation is performed, which is equivalent to erosion followed by dilation. Opening operations are used to further remove noise and smooth the boundaries. Finally, closing operations are performed, which are equivalent to dilation followed by erosion. Closing operations can fill small cracks within the target area, making the target area more continuous. After this series of morphological operations, the resulting set of pixels in the image is the target pixel set.
[0107] Step S404: Perform connected component analysis based on the target pixel set to determine the boundaries of each connected component.
[0108] Optionally, the anomaly detection system employs a scan-line-based connected component labeling algorithm to perform connected component analysis on the image composed of the target pixel set. The image is scanned line by line starting from the top left corner. Let the image be I(x, y). For each pixel (x, y), if its pixel value is 1 (i.e., it belongs to the target pixel set), and at least one of its left neighbor (x-1, y) and top neighbor (x, y-1) has been labeled as a connected component, then the pixel is labeled as belonging to the same connected component as its left or top neighbor. If neither the left nor top neighbor is labeled or belongs to a different connected component, a new connected component label is created for that pixel. After completing the connected component labeling, the boundary of each connected component is determined. This can be achieved by traversing the pixels of the connected component and finding its leftmost, rightmost, topmost, and bottommost pixels, thus determining the rectangular boundary of the connected component. For more precise boundaries, contour tracking algorithms, such as chain code-based contour tracking algorithms, can be used. Starting from a boundary point of the connected region, search along the boundary in a certain direction (such as clockwise), recording the direction of each point relative to the previous point (using chain code, such as 8-chain code representing 8 directions respectively), until returning to the starting point, thus obtaining the precise boundary of the connected region.
[0109] Step S405: Merge adjacent and similar connected regions based on the boundaries of each connected region to obtain the target detection region image.
[0110] Optionally, the anomaly detection system calculates the feature similarity between adjacent connected regions. This can be done by calculating features such as the mean and variance of the scale feature vectors of pixels along the boundary of the connected regions. For example, given two adjacent connected regions R1 and R2, the mean of the scale feature vectors of pixels along the boundary of R1 is calculated. Sum of variances ∑ R1 The mean of the pixel-scale feature vectors on the R2 boundary Sum of variances ∑ R2 The similarity of the means is measured using Euclidean distance. Bach distance is used to measure the similarity of variances. (det represents the determinant of the matrix). Set a similarity threshold. and when and If the similarity is found to be similar between two adjacent connected regions, they are merged. The merging can be achieved by performing a union operation on the pixel sets of the two connected regions. This similarity calculation and merging operation is performed on all adjacent connected regions until no more adjacent connected regions meet the merging criteria. The image portion corresponding to the final merged connected region is then extracted to obtain the target detection region image.
[0111] Figure 5 for Figure 1 A flowchart of a preferred embodiment of the method shown.
[0112] like Figure 5 As shown, in a preferred embodiment, step S50 includes:
[0113] Step S501: Perform local image enhancement on the target detection region image to obtain the first enhanced image;
[0114] Step S502: Perform contrast enhancement on the first enhanced image to obtain the second enhanced image.
[0115] Optionally, after determining the target detection area in the target inspection image, the anomaly detection system processes the target detection area using local image enhancement to obtain a first enhanced image after local enhancement, as described in steps S5011-S5014. The first enhanced image after local enhancement improves the image clarity. Then, the anomaly detection system performs contrast enhancement on the first enhanced image, further improving the overall contrast of the image based on the local enhancement, making the distinction between the target and the background in the image more obvious, and obtaining a second enhanced image, as described in steps S5021-S5025.
[0116] Furthermore, since anomalies in power line inspection images may be more noticeable in localized areas, and the overall image contrast may be low, affecting the observation of anomalies, the anomaly detection system first applies local image enhancement to the target detection area. This highlights the detailed information in each local area within the target detection region, making subtle anomalies that might otherwise be overlooked visible. Then, based on the local enhancement, contrast enhancement is applied to further improve the overall image contrast, making the distinction between the target and the background in the image clearer, which helps to detect anomalies more accurately. The combination of these two enhancement steps comprehensively improves image quality, providing clearer image data for subsequent anomaly detection.
[0117] Furthermore, in one embodiment, taking an image of a target detection area containing an insulator as an example, the surface of the insulator may have some minor cracks or other anomalies. Local histogram equalization is used to highlight the texture details of the insulator surface, resulting in a first enhanced image. Then, CLAHE is applied to the first enhanced image to further improve the contrast between the insulator and the background. In the second enhanced image, the previously imperceptible minor cracks become more clearly visible.
[0118] In one embodiment, steps S5011-S5014 are described as follows:
[0119] Step S5011: Construct a guide image using the target detection region image as input, and filter the target detection region image based on the linear relationship between the target detection region image and the guide image to obtain a filtered image.
[0120] Optionally, the anomaly detection system first processes the target detection region image using Gaussian blur to construct a guide image. Gaussian blur is achieved by convolving a two-dimensional Gaussian function with the target detection region image, as shown in the formula: Where (x, y) are the image pixel coordinates, and σ is the standard deviation, controlling the degree of blurring. By adjusting the value of σ, guide images with different degrees of blur can be obtained. For example, when σ = 2, Gaussian blurring is applied to the target detection region image to obtain the guide image. Then, filtering is performed based on the linear relationship between the target detection region image and the guide image, using a guided filtering algorithm. Let the target detection region image I... mu Let p be the guiding image and q be the filtered image. Within the local window ω... k Inside, q and I mu Satisfy linear relationship Where i is the index of the pixel within the window, a k and b k In the window ω k Internally, minimize the cost function The definite coefficient, ∈ is a regularization parameter used to prevent a k The value is too large. The final filtered image q is obtained by calculating the coefficients within all windows and then weighting them according to pixel location.
[0121] Step S5012: Perform multimodal feature extraction on the filtered image to obtain color features, texture features and edge features respectively.
[0122] Optionally, the anomaly detection system uses a color histogram method to extract color features from the filtered image. The image's color space (e.g., RGB space) is divided into several intervals, and the frequency of pixel occurrences within each interval is counted to form a color histogram. By counting the number of times each pixel's color value falls into each interval, a 512-dimensional color histogram vector is obtained; this vector represents the image's color features. For texture feature extraction, the Gray-Level Co-occurrence Matrix (GLCM) method can be used. GLCM describes texture by calculating the joint probability distribution of gray values of pixel pairs with specific spatial relationships (e.g., horizontal adjacency, vertical adjacency, etc.). For the filtered image, a certain distance and angle are selected to calculate the GLCM matrix. Various texture features, such as energy, entropy, and contrast, can be extracted from the GLCM matrix. For edge feature extraction, the Canny edge detection algorithm is used.
[0123] Step S5013: Determine the enhancement weights based on the correlation between color features, texture features, and edge features and the abnormal features of the second inspection equipment.
[0124] Optionally, the anomaly detection system pre-constructs a second inspection equipment anomaly feature library, which contains typical values or ranges of color features, texture features, and edge features of the equipment under different types of anomalies. For color feature correlation analysis, the similarity between the color histogram of the filtered image and the color histogram in the anomaly feature library is calculated, using methods such as Bach distance. For texture feature correlation, the absolute value of the difference between the GLCM features (such as energy, entropy, and contrast) of the filtered image and the corresponding features in the anomaly feature library is calculated; for example, the difference |Ef-Ea| between the energy Ef of the filtered image and the energy Ea under a certain anomaly in the anomaly feature library is calculated, and the smaller the difference, the stronger the correlation. For edge feature correlation, the matching degree between the edge pixel positions and intensities of the filtered image and the edge features in the anomaly feature library is compared. For example, the correlation is measured by calculating the overlap rate of edge pixel positions and the mean square error of intensity. Based on these correlation calculation results, the enhancement weight of each feature is determined. Linear weighting methods can be used, where the color feature correlation is r. c The correlation of texture features is r t The correlation of edge features is r e Total correlation R = ω c r c +ω t r t +ω e r e , where ω c ω t ω e It is a pre-set weighting coefficient ω c +ω t +ω e=1, and these coefficients are adjusted to balance the importance of different features. Then, based on the comparison between the total relevance R and a preset threshold, the relevance result of each feature is adjusted to obtain the final enhancement weight ω′. c ,ω′ t ,ω′ e .
[0125] Step S5014: Enhance the filtered image based on the enhancement weights to obtain the first enhanced image.
[0126] Optionally, the anomaly detection system employs methods such as image fusion to enhance the filtered image based on enhancement weights. For example, for color feature enhancement, the color values of the filtered image are adjusted according to the color feature enhancement weights ω′. c Adjustments are made. Assuming the color value of a pixel in the RGB color space of the filtered image is (r, g, b), the enhanced color value is (r′, g′, b′) = (r × ω′). c , g×ω′ c ,b×ω′ c (For simplicity, actual implementation may also require consideration of color space conversion and normalization.) For texture feature enhancement, the image is processed using filtering algorithms (such as variants of Gaussian filtering), and the filtering parameters (such as standard deviation) are adjusted according to the texture feature enhancement weights ω′. t For example, if the standard deviation of the original Gaussian filter is σ0, it is adjusted to σ = σ0 × (1 + ω′) during enhancement. t The image is re-filtered to highlight texture features. For edge feature enhancement, an edge enhancement algorithm (such as the Laplacian operator) is used, based on the edge feature enhancement weights ω′. e Adjust the intensity of edge enhancement. For example, the Laplacian operator is used to convolve the image to obtain an edge-enhanced image, and then the edge-enhanced image is combined with the original filtered image according to weight ω′. e The images are then fused to obtain the edge-enhanced image. Finally, the color-enhanced image, texture-enhanced image, and edge-enhanced image are fused to obtain the first enhanced image. The fusion method can employ weighted averaging or similar approaches. Let the pixel value of the fused image be I′(x, y), then I′(x, y) = ω′ c I c (x, y) + ω′ t I t (x, y) + ω′ e I e (x, y), where I c (x,y), I t (x,y), I e (x, y) are the pixel values at (x, y) of the images after color enhancement, texture enhancement, and edge enhancement, respectively.
[0127] In one embodiment, steps S5021-S5025 are described as follows:
[0128] Step S5021: Convert the first enhanced image from the RGB color space to the preset color space to obtain a color-converted image.
[0129] Optionally, after obtaining the first enhanced image, the anomaly detection system converts the first enhanced image from the RGB color space to a preset color space, typically the HSV (Hue-Saturation-Value) color space. The conversion formula is as follows:
[0130] Let the color value of a pixel in the RGB color space be (R, G, B). First, normalize it to the interval [0, 1], that is, r = R / 255, g = G / 255, b = B / 255.
[0131] Calculate max = max(r, g, b) and min = min(r, g, b).
[0132] Brightness V = max.
[0133] Saturation S: If max = 0, S = 0; otherwise
[0134] Hue H: If max = min, H = 0; otherwise, if max = r, H = 60 × ((gb) / (max-min)1) (when g ≥ b), H = 60 × ((gb) / (max-min)) + 360 (when g < b); if max = g, H = 60 × ((br) / (max-min)) + 120; if max = b, H = 60 × ((rg) / (max-min)) + 240. Based on these calculations, the RGB image is converted to an image in the HSV color space, resulting in a color-converted image. After conversion to the HSV color space, brightness (value) and contrast (related to saturation) can be adjusted independently, avoiding unnecessary impact on the hue when adjusting contrast, making the image enhancement process more targeted and controllable.
[0135] Step S5022: Divide the color conversion image into multiple sub-regions, and perform brightness statistical processing on each sub-region to obtain the statistical value of each sub-region.
[0136] Optionally, the anomaly detection system uses a uniform grid to divide the color-converted image into regions. For example, the image is divided into n×n equal-sized sub-regions, where the value of n depends on the image size and processing requirements, typically 8, 16, etc. For each sub-region, the mean μ and standard deviation σ of its brightness (value in HSV space) are calculated as statistics. The formula for calculating the mean μ is... Where γ is the number of pixels in the sub-region, Z i It is the brightness value of the i-th pixel within the sub-region. The formula for calculating the standard deviation σ is: By calculating the mean and standard deviation, the brightness distribution of each sub-region can be understood. The mean reflects the average brightness level of the sub-region, and the standard deviation reflects the dispersion of brightness. This allows for region segmentation and brightness statistics, enabling targeted processing based on the brightness characteristics of different regions of the image. By separately statistically analyzing the brightness information of each sub-region, contrast stretching can be performed more accurately on each region, avoiding over-enhancement or under-enhancement of some areas due to applying uniform enhancement parameters to the entire image.
[0137] Step S5023: Determine the stretching coefficient of each sub-region based on the statistics of each sub-region and the preset stretching function.
[0138] Optionally, the anomaly detection system uses a linear function based on the mean and standard deviation to determine a preset stretching function, where the mean brightness of the sub-region is μ, the standard deviation is σ, and the stretching coefficient is k. l The calculation formula is k l =α l *σ+β l *(μ-μ l ), where α l and β l It is a preset coefficient, μ l It is a reference brightness average, usually taken as the average brightness value of the entire image. For example, α l =2,β l =1,μ l =0.5. This formula calculates the stretching coefficient based on the luminance statistics of the sub-region. If the standard deviation of the sub-region is large, it indicates a more dispersed luminance distribution, and the stretching coefficient will increase accordingly to enhance the contrast of that region. Similarly, if the mean of the sub-region differs significantly from the reference mean, it will also affect the stretching coefficient, resulting in a larger stretching coefficient for areas with lower luminance, thus improving their luminance and contrast.
[0139] Step S5024: Perform contrast stretching on the pixels in each sub-region based on the stretching coefficient to obtain the stretched image.
[0140] Optionally, the anomaly detection system, based on the determined stretching factor, performs contrast stretching on the luminance values of pixels within each sub-region in the HSV color space. Let the original luminance value of a pixel within the sub-region be Z0, and the stretching factor be k. l The stretched brightness value Z0 * The calculation formula is Z0 * =k l *(Z0-μ p )+μ p , where μ p This is the average brightness of the sub-region. Using this formula, the brightness value of each pixel is adjusted according to the stretching factor. If the stretching factor k... l If k > 1, it will amplify the difference between the pixel brightness value and the mean, thus enhancing contrast; if k l If the value is less than 1, this difference will be reduced, decreasing the contrast. Pixels with brightness values outside the range [0, 1] are truncated; that is, if Z0 < 1, the pixel value is truncated. * <0, then Z0 * =0; if Z0 * If Z > 0, then Z0 * =1. After adjusting the brightness values of all pixels within each sub-region, the stretched image is obtained.
[0141] Step S5025: Convert the stretched image of each sub-region from the preset color space back to the RGB color space to obtain the second enhanced image.
[0142] Optionally, the anomaly detection system converts the stretched image back from the HSV color space to the RGB color space using the following conversion formula:
[0143] Let the hue of a pixel in the HSV color space be H, the saturation be S, and the brightness be V.
[0144] First, convert the hue H to an angle value h = H / 60, take its integer part i = [h], and its decimal part f = hi. Let p0 = V × (1-S), q0 = V × (1-f × S), t0 = V × (1-(1-f) × S).
[0145] Determine the RGB value based on the value of i:
[0146] When i = 0, R = V, G = t0, B = p0;
[0147] When i = 1, R = q, G = V, B = p0;
[0148] When i = 2, R = p0, G = V, B = t0;
[0149] When i = 3, R = p0, G = q0, B = V;
[0150] When i = 4, R = t0, G = p0, B = V;
[0151] When i = 5, R = V, G = p0, B = q0.
[0152] Finally, the R, G, and B values are multiplied by 255 and converted back to the [0, 255] range to obtain the pixel values in the RGB color space. This conversion is performed on the stretched image of each sub-region, and the conversion results of all sub-regions are stitched together to obtain the second enhanced image.
[0153] This invention enables targeted contrast adjustments based on the brightness characteristics of different regions in power inspection images, avoiding over-enhancement or under-enhancement issues caused by uniform enhancement parameters. Converting to the HSV color space for processing makes brightness and contrast adjustments more controllable, and finally converting back to the RGB color space facilitates observation and subsequent processing. This method comprehensively improves image contrast and quality, highlighting the details and features of power equipment, providing clearer and more accurate image data for subsequent anomaly detection, and contributing to improved accuracy and efficiency in anomaly detection.
[0154] In one embodiment, steps S601-S602 are described as follows:
[0155] Step S601: Compare the similarity between the enhanced image and the normal image at the target detection region to obtain the similarity comparison result;
[0156] Step S602: If the similarity comparison result is less than the preset threshold, there is an anomaly. Analyze the distribution of pixel differences between the enhanced image and the normal image at the target detection area to determine the location and range of the anomaly area.
[0157] Optionally, the similarity comparison between the enhanced image and the normal image at the target detection region can be achieved using an algorithm such as the Structural Similarity Index (SSIM). This involves comparing the enhanced image with each normal image in the database and calculating the structural similarity index between them. The SSIM algorithm compares images in terms of brightness, contrast, and structure. The calculated SSIM value determines the degree of similarity between the enhanced and normal images. If the SSIM value is lower than a preset threshold (determined according to different inspection devices), it indicates a significant difference between the enhanced and normal images, potentially suggesting an anomaly. Further analysis of the differences, such as calculating the distribution of pixel differences, determines the location and extent of the abnormal region, ultimately yielding the anomaly detection analysis result. This achieves the goal of accurately determining whether anomalies exist in the target detection region through comparative analysis with normal images.
[0158] Furthermore, in one embodiment, taking the target detection area image of a power transmission line as an example, when performing anomaly detection on the target detection area image of the power transmission line, a normal image database stores normal state images of the power transmission line under different environmental conditions. The enhanced image after enhancement processing is compared with the normal images in the database using SSIM (Signal Simulation Method), and it is found that the SSIM value of a certain area is significantly lower than the threshold. Further analysis of the pixel difference distribution determines that there is an anomaly of line wear in this area, obtaining accurate anomaly detection analysis results.
[0159] Figure 6 A schematic diagram of a device for detecting anomalies in power line inspection images according to an embodiment of the present invention is shown.
[0160] like Figure 6 As shown, the device includes:
[0161] Acquisition unit 601 is used to acquire power inspection images;
[0162] The identification and cutting unit 602 is used to identify and cut the power inspection image based on the type of equipment to be inspected, so as to obtain the target inspection image;
[0163] The decomposition and extraction unit 603 is used to perform multi-scale decomposition and extraction on the target inspection image to obtain scale features;
[0164] The mapping unit 604 is used to map the target inspection image based on scale features to determine the target detection region image;
[0165] Enhancement unit 605 is used to enhance the image of the target detection region to obtain an enhanced image;
[0166] The comparison and analysis unit 606 is used to compare and analyze the enhanced image with the normal image at the target detection region image to obtain the anomaly detection result. The normal image at the target detection region image is obtained by detecting and matching the target detection region image in a normal image database.
[0167] Furthermore, the identification and cutting unit 602 is also used for:
[0168] Edge processing is performed on power line inspection images to obtain edge images;
[0169] For each inspection device in the first inspection equipment, the edge image is extracted based on the type of each inspection device to obtain the first edge contour of each inspection device; wherein, the first inspection device is the device to be inspected determined at the beginning of the power inspection.
[0170] The first edge contour of each inspection device is analyzed to obtain the first contour feature, and the boundary points of the first edge contour of each inspection device are transformed to obtain the second contour feature.
[0171] Based on the first and second contour features of each inspection device, the inspection device that meets the preset requirements in the first inspection device is identified as the second inspection device.
[0172] The power inspection image is segmented based on the second inspection device and the second edge contour of the second inspection device to obtain the target inspection image.
[0173] Furthermore, the power inspection image is segmented based on the second inspection device and its second edge contour to obtain the target inspection image, including:
[0174] A topological graph of the power inspection image is constructed by using each connected region in the power inspection image as a node and the adjacency relationship between connected regions as an edge.
[0175] Based on the second inspection device, the nodes of the topology graph are filtered to obtain the set of nodes belonging to the second inspection device.
[0176] The matching results are obtained by matching the second edge contour with the node set, and the matching results are mapped to the topology map to determine the topology of the second inspection equipment.
[0177] Based on the topology of the second inspection device, region growing is performed on the power inspection image to determine the cutting range. The power inspection image is then cut based on the cutting range to obtain the target inspection image.
[0178] Furthermore, the decomposition and extraction unit 603 is also used for:
[0179] Based on a preset objective function, the target inspection image is decomposed into a multi-scale wavelet decomposition to obtain low-frequency components and multiple high-frequency components.
[0180] Based on the decomposition scale, feature extraction is performed on the low-frequency component and high-frequency component of each scale to obtain the low-frequency component feature set and the high-frequency component feature set.
[0181] Based on the type of the second inspection equipment, the low-frequency component feature set and the high-frequency component feature set are filtered to obtain the first abnormal feature set and the second abnormal feature set;
[0182] The scale features are obtained by fusing the first and second anomaly feature sets at different scales.
[0183] Furthermore, the mapping unit 604 is also used for:
[0184] Fuzzy clustering is performed on the scale features to obtain clustering results, and the pixels of the target inspection image are divided based on the clustering results to obtain multiple cluster categories;
[0185] Multiple cluster categories are filtered and eliminated to obtain the filtered pixel set;
[0186] Perform morphological operations on the filtered pixel set to determine the target pixel set;
[0187] Connectivity analysis is performed based on the target pixel set to determine the boundaries of each connected region.
[0188] Based on the boundaries of each connected region, adjacent and similar connected regions are merged to obtain the target detection region image.
[0189] Furthermore, the enhancement unit 605 is also used for:
[0190] Local image enhancement is performed on the target detection region image to obtain the first enhanced image;
[0191] The first enhanced image is contrast-enhanced to obtain the second enhanced image.
[0192] Further, local image enhancement is performed on the target detection region image to obtain a first enhanced image, including:
[0193] A guide image is constructed using the target detection region image as input, and the target detection region image is filtered based on the linear relationship between the target detection region image and the guide image to obtain a filtered image.
[0194] Multimodal feature extraction is performed on the filtered image to obtain color features, texture features, and edge features, respectively;
[0195] Enhancement weights are determined based on the correlation between color features, texture features, and edge features and the abnormal features of the second inspection equipment, respectively.
[0196] The filtered image is enhanced based on the enhancement weights to obtain the first enhanced image.
[0197] Further, the first enhanced image is contrast-enhanced to obtain a second enhanced image, including:
[0198] The first enhanced image is converted from the RGB color space to the preset color space to obtain the color-converted image;
[0199] The color-converted image is divided into regions to obtain multiple sub-regions, and brightness statistics are performed on each sub-region to obtain the statistics for each sub-region.
[0200] Based on the statistics of each sub-region and the preset stretching function, the stretching coefficient of each sub-region is determined;
[0201] The contrast of pixels in each sub-region is stretched based on the stretching coefficient to obtain the stretched image;
[0202] The stretched image of each sub-region is converted from the preset color space back to the RGB color space to obtain the second enhanced image.
[0203] Furthermore, the comparison and analysis unit 606 is also used for:
[0204] The similarity between the enhanced image and the normal image at the target detection region is compared to obtain the similarity comparison result;
[0205] If the similarity comparison result is less than the preset threshold, an anomaly is found. The distribution of pixel differences between the enhanced image and the normal image at the target detection area is analyzed to determine the location and range of the anomaly area.
[0206] This invention, through identification and segmentation of power inspection images based on the type of equipment to be inspected, yields target inspection images of the target equipment with irrelevant backgrounds removed, reducing background noise and interference and initially improving the accuracy of subsequent anomaly detection. Furthermore, by performing multi-scale decomposition and extraction of scale features from the target inspection image, the rich detail information contained within the image can be more comprehensively mined, solving the problem of not being able to extract rich detail information. Combined with the enhancement processing after mapping and recognition of scale features and the target inspection image, the features of small components and hidden parts in the target detection area are highlighted, avoiding the omission of anomalies in subtle areas. Finally, a comparative analysis of the enhanced image and the normal image is obtained, achieving accurate anomaly detection in power inspection images. The device provided by this invention can more fully mine the rich detail information contained in power inspection images, avoiding the omission of anomalies in subtle areas, improving the accuracy of anomaly detection, and thus meeting current needs.
[0207] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0208] Figure 7 This is a block diagram of an electronic device provided as an exemplary embodiment of the present invention. (See diagram below.) Figure 7As shown, the electronic device includes one or more processors 710 and memory 720.
[0209] The processor 710 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0210] The memory 720 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 710 may execute the program instructions to implement the methods for data access based on dimensional information and / or other desired functions of the software programs of the various embodiments of the present invention described above. In one example, the electronic device may also include an input device 730 and an output device 740, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0211] In addition, the input device 730 may also include, for example, a keyboard, a mouse, etc.
[0212] The output device 740 can output various types of information to the outside. The output device 740 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0213] Of course, for the sake of simplicity, Figure 7 Only some of the components of the electronic device relevant to the present invention are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0214] In addition to the methods and apparatus described above, embodiments of the present invention may also be computer program products and computer-readable storage media, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps of the methods for detecting anomalies in power inspection images according to various embodiments of the present invention as described in the "Exemplary Methods" section of this specification.
[0215] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present invention. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0216] Furthermore, embodiments of the present invention may also be computer-readable storage media storing a computer program thereon, which, when run by a processor, causes the processor to perform the steps of the method for detecting anomalies in power inspection images according to various embodiments of the present invention as described in the "Exemplary Methods" section above.
[0217] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0218] The basic principles of the present invention have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in the present invention are merely examples and not limitations, and should not be considered as essential features of each embodiment of the present invention. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the present invention to the necessity of employing the aforementioned specific details.
[0219] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0220] The block diagrams of devices, apparatuses, devices, and systems involved in this invention are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0221] The methods and apparatus of the present invention may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the method is for illustrative purposes only, and the steps of the method of the present invention are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the present invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the method according to the present invention. Thus, the present invention also covers recording media storing programs for performing the method according to the present invention.
[0222] It should also be noted that in the apparatus, device, and method of the present invention, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered equivalents of the present invention. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the invention. Therefore, the invention is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0223] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the invention to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A method for detecting anomalies in power line inspection images, characterized in that, The method includes: Acquire power line inspection images; The power inspection image is identified and segmented based on the type of equipment to be inspected to obtain the target inspection image. The target inspection image is decomposed and extracted at multiple scales to obtain scale features; The target inspection image is mapped based on the scale features to determine the target detection region image; The image of the target detection region is enhanced to obtain an enhanced image; The enhanced image is compared and analyzed with the normal image at the target detection region to obtain the anomaly detection result. The normal image at the target detection region is obtained by detecting and matching the target detection region image in a normal image database. The target inspection image is decomposed and extracted at multiple scales to obtain scale features, including: Based on a preset objective function, the target inspection image is decomposed into a multi-scale wavelet decomposition to obtain low-frequency components and multiple high-frequency components. Based on the decomposition scale, feature extraction is performed on the low-frequency component and high-frequency component of each scale to obtain the low-frequency component feature set and the high-frequency component feature set. Based on the type of the second inspection equipment, the low-frequency component feature set and the high-frequency component feature set are filtered to obtain the first abnormal feature set and the second abnormal feature set; The scale features are obtained by fusing the first and second anomaly feature sets at different scales. The process of mapping the target inspection image based on the scale features to determine the target detection region image includes: Fuzzy clustering is performed on the scale features to obtain clustering results, and the pixels of the target inspection image are divided based on the clustering results to obtain multiple cluster categories; Multiple cluster categories are filtered and eliminated to obtain the filtered pixel set; Perform morphological operations on the filtered pixel set to determine the target pixel set; Connectivity analysis is performed based on the target pixel set to determine the boundaries of each connected region. Based on the boundaries of each connected region, adjacent and similar connected regions are merged to obtain the target detection region image.
2. The method according to claim 1, characterized in that, The power inspection image is identified and segmented based on the type of equipment to be inspected to obtain the target inspection image, including: Edge processing is performed on the power inspection images to obtain edge images; For each inspection device in the first inspection equipment, the edge image is extracted based on the type of each inspection device to obtain the first edge contour of each inspection device; wherein, the first inspection device is the device to be inspected determined at the beginning of the power inspection. The first edge contour of each inspection device is analyzed to obtain the first contour feature, and the boundary points of the first edge contour of each inspection device are transformed to obtain the second contour feature. Based on the first and second contour features of each inspection device, the inspection device that meets the preset requirements in the first inspection device is identified as the second inspection device. The power inspection image is segmented based on the second inspection device and the second edge contour of the second inspection device to obtain the target inspection image.
3. The method according to claim 2, characterized in that, The power inspection image is segmented based on the second inspection device and its second edge contour to obtain the target inspection image, including: A topological graph of the power inspection image is constructed by using each connected region in the power inspection image as a node and the adjacency relationship between connected regions as an edge. Based on the second inspection device, the nodes of the topology graph are filtered to obtain the set of nodes belonging to the second inspection device. The matching results are obtained by matching the second edge contour with the node set, and the matching results are mapped to the topology map to determine the topology of the second inspection equipment. Based on the topology of the second inspection device, region growing is performed on the power inspection image to determine the cutting range. The power inspection image is then cut based on the cutting range to obtain the target inspection image.
4. The method according to claim 1, characterized in that, The image of the target detection region is enhanced to obtain an enhanced image, including: Local image enhancement is performed on the target detection region image to obtain the first enhanced image; The first enhanced image is contrast-enhanced to obtain the second enhanced image.
5. The method according to claim 4, characterized in that, Local image enhancement is performed on the target detection region image to obtain the first enhanced image, which includes: A guide image is constructed using the target detection region image as input, and the target detection region image is filtered based on the linear relationship between the target detection region image and the guide image to obtain a filtered image. Multimodal feature extraction is performed on the filtered image to obtain color features, texture features, and edge features, respectively; Enhancement weights are determined based on the correlation between color features, texture features, and edge features and the abnormal features of the second inspection equipment, respectively. The filtered image is enhanced based on the enhancement weights to obtain the first enhanced image.
6. The method according to claim 4, characterized in that, The first enhanced image is contrast-enhanced to obtain the second enhanced image, which includes: The first enhanced image is converted from the RGB color space to the preset color space to obtain the color-converted image; The color-converted image is divided into regions to obtain multiple sub-regions, and brightness statistics are performed on each sub-region to obtain the statistics for each sub-region. Based on the statistics of each sub-region and the preset stretching function, the stretching coefficient of each sub-region is determined; The contrast of pixels in each sub-region is stretched based on the stretching coefficient to obtain the stretched image; The stretched image of each sub-region is converted from the preset color space back to the RGB color space to obtain the second enhanced image.
7. The method according to claim 1, characterized in that, The enhanced image is compared and analyzed with the normal image at the target detection region to obtain anomaly detection results, including: The enhanced image is compared with the normal image at the target detection region to obtain the similarity comparison result; If the similarity comparison result is less than the preset threshold, an anomaly is found. The distribution of pixel differences between the enhanced image and the normal image at the target detection area is analyzed to determine the location and range of the abnormal area.
8. A device for detecting anomalies in power line inspection images, characterized in that, The device includes: The acquisition unit is used to acquire power inspection images; The identification and cutting unit is used to identify and cut the power inspection image based on the type of equipment to be inspected, so as to obtain the target inspection image; The decomposition and extraction unit is used to perform multi-scale decomposition and extraction on the target inspection image to obtain scale features; The mapping unit is used to map the target inspection image based on the scale features to determine the target detection region image; An enhancement unit is used to enhance the image of the target detection region to obtain an enhanced image; The comparison and analysis unit is used to compare and analyze the enhanced image with the normal image at the target detection region image to obtain an anomaly detection result, wherein the normal image at the target detection region image is obtained by detecting and matching the target detection region image in a normal image database; The decomposition and extraction unit is further configured to: Based on a preset objective function, the target inspection image is decomposed into a multi-scale wavelet decomposition to obtain low-frequency components and multiple high-frequency components. Based on the decomposition scale, feature extraction is performed on the low-frequency component and high-frequency component of each scale to obtain the low-frequency component feature set and the high-frequency component feature set. Based on the type of the second inspection equipment, the low-frequency component feature set and the high-frequency component feature set are filtered to obtain the first abnormal feature set and the second abnormal feature set; The scale features are obtained by fusing the first and second anomaly feature sets at different scales. The mapping unit is further configured to: Fuzzy clustering is performed on the scale features to obtain clustering results, and the pixels of the target inspection image are divided based on the clustering results to obtain multiple cluster categories; Multiple cluster categories are filtered and eliminated to obtain the filtered pixel set; Perform morphological operations on the filtered pixel set to determine the target pixel set; Connectivity analysis is performed based on the target pixel set to determine the boundaries of each connected region. Based on the boundaries of each connected region, adjacent and similar connected regions are merged to obtain the target detection region image.
9. The apparatus according to claim 8, characterized in that, The identification and cutting unit is also used for: Edge processing is performed on the power inspection images to obtain edge images; For each inspection device in the first inspection equipment, the edge image is extracted based on the type of each inspection device to obtain the first edge contour of each inspection device; wherein, the first inspection device is the device to be inspected determined at the beginning of the power inspection. The first edge contour of each inspection device is analyzed to obtain the first contour feature, and the boundary points of the first edge contour of each inspection device are transformed to obtain the second contour feature. Based on the first and second contour features of each inspection device, the inspection device that meets the preset requirements in the first inspection device is identified as the second inspection device. The power inspection image is segmented based on the second inspection device and the second edge contour of the second inspection device to obtain the target inspection image.
10. The apparatus according to claim 9, characterized in that, The power inspection image is segmented based on the second inspection device and its second edge contour to obtain the target inspection image, including: A topological graph of the power inspection image is constructed by using each connected region in the power inspection image as a node and the adjacency relationship between connected regions as an edge. Based on the second inspection device, the nodes of the topology graph are filtered to obtain the set of nodes belonging to the second inspection device. The matching results are obtained by matching the second edge contour with the node set, and the matching results are mapped to the topology map to determine the topology of the second inspection equipment. Based on the topology of the second inspection device, region growing is performed on the power inspection image to determine the cutting range. The power inspection image is then cut based on the cutting range to obtain the target inspection image.
11. The apparatus according to claim 8, characterized in that, The enhancement unit is further configured to: Local image enhancement is performed on the target detection region image to obtain the first enhanced image; The first enhanced image is contrast-enhanced to obtain the second enhanced image.
12. The apparatus according to claim 11, characterized in that, Local image enhancement is performed on the target detection region image to obtain the first enhanced image, which includes: A guide image is constructed using the target detection region image as input, and the target detection region image is filtered based on the linear relationship between the target detection region image and the guide image to obtain a filtered image. Multimodal feature extraction is performed on the filtered image to obtain color features, texture features, and edge features, respectively; Enhancement weights are determined based on the correlation between color features, texture features, and edge features and the abnormal features of the second inspection equipment, respectively. The filtered image is enhanced based on the enhancement weights to obtain the first enhanced image.
13. The apparatus according to claim 11, characterized in that, The first enhanced image is contrast-enhanced to obtain the second enhanced image, which includes: The first enhanced image is converted from the RGB color space to the preset color space to obtain the color-converted image; The color-converted image is divided into regions to obtain multiple sub-regions, and brightness statistics are performed on each sub-region to obtain the statistics for each sub-region. Based on the statistics of each sub-region and the preset stretching function, the stretching coefficient of each sub-region is determined; The contrast of pixels in each sub-region is stretched based on the stretching coefficient to obtain the stretched image; The stretched image of each sub-region is converted from the preset color space back to the RGB color space to obtain the second enhanced image.
14. The apparatus according to claim 8, characterized in that, The comparison and analysis unit is also used for: The enhanced image is compared with the normal image at the target detection region to obtain the similarity comparison result; If the similarity comparison result is less than the preset threshold, an anomaly is found. The distribution of pixel differences between the enhanced image and the normal image at the target detection area is analyzed to determine the location and range of the abnormal area.
15. An electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method of any one of claims 1-7.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.
Citation Information
Patent Citations
Unmanned aerial vehicle routing inspection line adaptive obstacle detection method and system based on monocular camera
CN119672577A
Transformer substation inspection method and device, computer equipment, storage medium and computer program product
CN120124831A