Defect detection method, device, equipment, storage medium and program product
By performing pixel segmentation and connected domain labeling on infrared images, combined with geometric models and temperature thresholds, the problems of unclear equipment boundaries and noise interference in traditional infrared defect location methods are solved, and accurate positioning and type assessment of defects in power equipment are achieved.
Patent Information
- Application Number
- CN202510713084.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-05-30
AI Technical Summary
In traditional infrared defect positioning methods, the device boundaries are unclear, and the device outline of the infrared imaging is intertwined with the background, which cannot fully exploit the continuity information of the device pixel points, resulting in insufficient defect positioning accuracy. It is also easily affected by environmental noise and difficult to accurately identify the device's true temperature information and defect location.
By performing pixel segmentation on the infrared image, the device and background pixels are marked separately, and the connected area of the device pixels is determined using the connected domain labeling algorithm. The initial defect area is corrected based on the connected area of the device pixels. The defect area is identified by combining the geometric model and temperature threshold, eliminating false detection and improving positioning accuracy.
It achieves precise positioning of infrared defect areas of power equipment, improves positioning accuracy, reduces noise interference, reduces false detection rate, and provides accurate defect type assessment and repair priority recommendations for equipment.
Smart Images

Figure CN120235867B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a defect detection method, apparatus, device, storage medium and program product. Background Art
[0002] Currently, the detection and location of power equipment faults typically rely on manual inspection, infrared thermal imaging, and basic image processing algorithms. However, traditional infrared defect location methods have the following shortcomings:
[0003] The device's boundaries are unclear, and the infrared image's outline blends seamlessly with the background. Traditional methods rely on simple threshold segmentation and edge detection, which fail to fully exploit the continuity of device pixels, resulting in insufficient defect location accuracy. Furthermore, infrared images are susceptible to interference from factors such as environmental noise and reflections, making it difficult to accurately identify the device's true temperature and defect location. Summary of the Invention
[0004] Based on this, it is necessary to provide a defect detection method, device, equipment, storage medium and program product that can accurately locate defects in power equipment to address the above technical problems.
[0005] In a first aspect, the present application provides a defect detection method, comprising:
[0006] Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area;
[0007] Marking the device pixel points and the background pixel points respectively;
[0008] Determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0009] An initial defect area in the infrared image to be measured is identified, and the initial defect area is corrected based on the device pixel connected area to obtain a corrected defect area.
[0010] In one embodiment, segmenting the pixels of the infrared image to be measured includes:
[0011] Performing edge detection on the infrared image to be tested to determine a device edge area of the device to be tested;
[0012] Determining a device grayscale value interval based on an operating temperature range of the device under test;
[0013] Pixels whose grayscale values belong to the device grayscale value interval and are in the device edge area are determined as the device pixels, and the remaining pixels in the infrared image to be measured except the device pixels are determined as the background pixels.
[0014] In one embodiment, determining the device pixel connected area in the infrared image to be measured based on the markers of the device pixels and the markers of the background pixels includes:
[0015] Marking the device pixel as a first preset value and marking the background pixel as a second preset value;
[0016] Based on the first preset value and the second preset value, determining a plurality of initial connected regions including device pixels by a connected domain labeling algorithm;
[0017] Grayscale value differences between adjacent pixels in an initial connected region are calculated, continuous pixels in the initial connected region are determined based on the grayscale value differences, and the device pixel connected region is determined based on the continuous pixels.
[0018] In one embodiment, the identifying an initial defect area in the infrared image to be measured, and correcting the initial defect area based on the device pixel connected area to obtain a corrected defect area, includes:
[0019] Obtaining a defect temperature threshold and a corresponding defect temperature grayscale threshold, determining pixels in the infrared image to be measured whose grayscale values are greater than the defect temperature grayscale threshold as defect pixels, and determining a set of the defect pixels as the initial defect area;
[0020] An intersection between the initial defect area and the device pixel connected area is determined as the corrected defect area.
[0021] In one embodiment, the method further comprises:
[0022] Obtaining a geometric model of the device under test, and determining the device spatial coordinates based on the geometric model;
[0023] The pixel coordinates of the corrected defect area are mapped to the device space coordinates through geometric transformation to obtain the predicted defect position corresponding to the corrected defect area.
[0024] In one embodiment, the method further comprises:
[0025] Evaluate the defect type of the current defect based on the defect temperature data, the area size, and the operating status of the device under test of the corrected defect area;
[0026] Corresponding repair measures and processing priorities are obtained based on the defect type and the predicted defect location.
[0027] In a second aspect, the present application further provides a defect detection device, comprising:
[0028] a segmentation module, configured to acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area;
[0029] a marking module, configured to mark the device pixels and the background pixels respectively;
[0030] a determination module, configured to determine a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0031] The correction module is used to identify an initial defect area in the infrared image to be measured, and correct the initial defect area based on the device pixel connected area to obtain a corrected defect area.
[0032] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area;
[0034] Marking the device pixel points and the background pixel points respectively;
[0035] Determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0036] An initial defect area in the infrared image to be measured is identified, and the initial defect area is corrected based on the device pixel connected area to obtain a corrected defect area.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0038] Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area;
[0039] Marking the device pixel points and the background pixel points respectively;
[0040] Determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0041] An initial defect area in the infrared image to be measured is identified, and the initial defect area is corrected based on the device pixel connected area to obtain a corrected defect area.
[0042] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:
[0043] Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area;
[0044] Marking the device pixel points and the background pixel points respectively;
[0045] Determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0046] An initial defect area in the infrared image to be measured is identified, and the initial defect area is corrected based on the device pixel connected area to obtain a corrected defect area.
[0047] The above-mentioned defect detection method, apparatus, equipment, storage medium and program product first perform pixel segmentation on the infrared image to be tested, mark the device pixels and background pixels separately, and then determine the connected area of the device pixels based on the marking information of the device pixels. Based on the connected area of the device pixels, the initial defect area is corrected to obtain a more accurate defect area, thereby improving the accuracy of defect location. This application can solve the problems of insufficient positioning accuracy, severe noise interference, and low processing efficiency in traditional infrared image processing methods, and accurately locate the infrared defect area of power equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 A flowchart of a defect detection method in one embodiment;
[0050] Figure 2 A schematic diagram of an application scenario of a defect detection method in an embodiment;
[0051] Figure 3 A schematic diagram of an application scenario of a defect detection method in another embodiment;
[0052] Figure 4 is a structural block diagram of a defect detection device in one embodiment;
[0053] Figure 5 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0055] Currently, the detection and location of power equipment faults typically rely on manual inspection, infrared thermal imaging, and basic image processing algorithms. However, traditional infrared defect location methods face the following difficulties:
[0056] Blurred device area: The device boundary is unclear, and the infrared imaging device outline is intertwined with the background; Noise interference: Infrared images are easily interfered with by environmental noise, reflection and other factors, making it difficult to accurately identify the device's true temperature information and defect location; Low positioning accuracy: Traditional methods rely on simple threshold segmentation and edge detection, which cannot fully exploit the continuity information of device pixels, resulting in insufficient defect positioning accuracy.
[0057] In order to solve these problems, this application proposes a precise infrared defect positioning method based on the continuity of device pixels, which can accurately locate the infrared defect area of power equipment through mathematical algorithms and topological rules.
[0058] Specifically, in one embodiment, Figure 1 As shown, a defect detection method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0059] Step 101: Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to the device area and background pixels belonging to the background area;
[0060] Step 102: Mark the device pixel points and the background pixel points respectively;
[0061] Step 103: determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0062] Step 104 : identifying an initial defect area in the infrared image to be measured, and correcting the initial defect area based on the device pixel connected area to obtain a corrected defect area.
[0063] The infrared image to be tested is an infrared image of the device to be tested captured by an infrared imaging device (such as an infrared thermal imager or a drone, etc.), and each pixel in the image contains the temperature value of the position.
[0064] The device area refers to the area formed by the set of device pixels in the infrared image to be measured, which is obtained through segmentation. All pixels in the infrared image to be measured except the device pixels are background pixels, and the set of background pixels forms the background area.
[0065] The device pixels and background pixels are labeled differently to facilitate subsequent continuity analysis based on the labels, thereby determining the connected device pixel area. The initial defect area is corrected based on the obtained connected device pixel area. This is because during defect detection, some defects may be falsely detected, and the detected initial defect area is not within the actual device area. These falsely detected defects can be removed through correction.
[0066] In some embodiments, assuming that each point (x, y) in the infrared image to be measured I(x, y) has a temperature value T(x, y), the infrared image to be measured needs to be preprocessed to make the temperature difference between the device and the defect area more obvious.
[0067] Specifically, the commonly used denoising method is Gaussian filtering. The formula of Gaussian filtering can be found in Formula 1:
[0068] ;
[0069] Among them, G(x,y) is the Gaussian kernel, Is the standard deviation, which controls the degree of smoothing. The image I(x,y) is smoothed by convolution operation:
[0070] See Equation 2:
[0071] ;
[0072] Where * represents the convolution operation.
[0073] The defect detection method provided in this embodiment segments the device area and background area of the infrared image to be tested, and based on the segmentation results, determines the device pixel connected area, which can accurately locate the device area in the infrared image to be tested. Based on the device pixel connected area, the detected initial defect area is corrected to obtain a corrected defect area, thus avoiding the problem of false detection. This application can solve the problems of insufficient positioning accuracy, severe noise interference, and low processing efficiency in traditional infrared image processing methods, and can accurately locate infrared defect areas of power equipment.
[0074] In an exemplary embodiment, segmenting the pixels of the infrared image to be measured includes:
[0075] Edge detection is performed on the infrared image to be tested to determine the device edge area of the device to be tested; based on the operating temperature range of the device to be tested, the device grayscale value interval is determined; the pixel points whose grayscale values belong to the device grayscale value interval and are within the device edge area are determined as the device pixel points, and the remaining pixel points in the infrared image to be tested except the device pixel points are determined as the background pixel points.
[0076] Edge detection is used to perform preliminary positioning of electrical equipment, extract the outline of the equipment, and separate the equipment area from the background. This is because the shape of each electrical equipment is continuous, but if you want to separate the equipment area of the electrical equipment from the background area, you need to first determine the edge position of the electrical equipment shape. Figure 2 , exemplary, Figure 2 201 and 202 are edges of insulators extracted from an original infrared image to be tested. Through edge detection, the power equipment can be preliminarily distinguished from the background to obtain the outline of the power equipment.
[0077] Specifically, an edge detection algorithm (such as Canny edge detection) is used to extract the edge of the device. Edge detection calculates the gradient of each pixel. Assume that the gradient is calculated as:
[0078] Formula 3:
[0079] ;
[0080] gradient After calculation, the edge area is retained through non-maximum suppression and double threshold method.
[0081] An edge detection algorithm is an image processing technique used to identify the outlines of objects in an image. The algorithm calculates the gradient (i.e., the degree of grayscale change) of each pixel, then uses non-maximum suppression and a double threshold method to determine which pixels are true edges. The result is an image that preserves the outlines of the objects. In this embodiment, the edge detection algorithm is used to extract the edge regions of power equipment in the infrared image under test.
[0082] The role of non-maximum suppression is to compare the gradient of each pixel and only retain the pixel with the largest value in the gradient direction, while suppressing the rest. This can keep the edge line thin while removing unnecessary pixels.
[0083] The dual-threshold method further determines which edges are true edges. Two thresholds are set: a high threshold and a low threshold. If the gradient value of a pixel is above the high threshold, it is considered a strong edge; if it is below the low threshold, it is considered a weak edge. If the value is between the two thresholds, the pixel is judged based on whether it is connected to a strong edge pixel, ultimately retaining the true edge.
[0084] Then, the temperature threshold method is used to ) is classified as a device pixel or a background pixel. Assume that the grayscale value range corresponding to the normal operating temperature range of the device is , the classification result is:
[0085] Formula 4:
[0086] ;
[0087] Pixels whose grayscale values belong to the device grayscale value interval and are in the device edge area are determined as the device pixels, and the remaining pixels in the infrared image to be measured except the device pixels are determined as the background pixels.
[0088] By combining denoising, edge detection algorithm and temperature threshold method, the edge and device area of the image can be accurately extracted, and noise and unnecessary edges can be effectively removed to obtain a clear edge image.
[0089] In an exemplary embodiment, determining the device pixel connected area in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels includes:
[0090] Marking the device pixel as a first preset value and the background pixel as a second preset value; determining a plurality of initial connected regions including the device pixel using a connected domain marking algorithm based on the first preset value and the second preset value;
[0091] Grayscale value differences between adjacent pixels in an initial connected region are calculated, continuous pixels in the initial connected region are determined based on the grayscale value differences, and the device pixel connected region is determined based on the continuous pixels.
[0092] As shown in Formula 4, illustratively, device pixels may be marked as 1 and background pixels may be marked as 0, thereby obtaining a pixel marking set of the device area according to the infrared image to be measured.
[0093] For example, whether pixels are connected can be determined by the following method:
[0094] First, the continuity of the pixels is determined. The steps include:
[0095] Based on the 8-neighborhood method, a connected region labeling algorithm (such as the Flood Fill algorithm) is used to identify each connected region in the image. Specifically, starting with a starting pixel in the pixel labeling set of the infrared image to be tested, if the pixel belongs to the device region (i.e., marked as 1), its 8-neighborhood pixels are checked. All pixels connected to the starting pixel are labeled as the same region until no new pixels can be labeled. Finally, this algorithm generates a set of connected regions, each of which contains a set of connected device region pixels.
[0096] For example, assume that the marker set of a certain device area in the image is shown in the following matrix:
[0097] Formula 5:
[0098] ;
[0099] In the 5x5 matrix in Formula 5, the values marked with 1 represent the device area, and 0 represent the background. We need to determine whether these pixels belong to the same connected region. Starting from the pixel at (1,1), we check its adjacent pixels.
[0100] When applying the Flood Fill algorithm, assuming the starting point is (1,1), the algorithm traverses its adjacent 1s until the entire device area, including (1,1), (1,2), (2,1), (2,2), etc., is marked as a connected area. In this way, the connected area of the pixels can be extracted.
[0101] Furthermore, the grayscale value difference detection is performed on the connected area of pixels obtained by continuity judgment: Assuming that the pixel Grayscale values of its adjacent pixels The difference is , if the difference is less than a set threshold , then the two pixels are considered to be connected and belong to the device area, see Formula 6.
[0102] Formula 6:
[0103] ;
[0104] in, is any adjacent pixel in the 8-neighborhood. Thus, a more accurate device pixel connected area is obtained through connectivity judgment and grayscale value difference.
[0105] To better align the connected region of device pixels with the actual device geometry, topology optimization can be performed. Common methods include morphological operations such as dilation and erosion. Dilation expands the device region to remove small noise, while erosion shrinks the device region to remove isolated pixels. These operations optimize the shape of the resulting connected region of device pixels.
[0106] In an exemplary embodiment, identifying an initial defect area in the infrared image to be measured, and correcting the initial defect area based on the device pixel connected area to obtain a corrected defect area includes:
[0107] Obtain a defect temperature threshold and a corresponding defect temperature grayscale threshold, determine pixels in the infrared image to be measured whose grayscale values are greater than the defect temperature grayscale threshold as defect pixels, determine the set of defect pixels as the initial defect area; and determine the intersection between the initial defect area and the device pixel connected area as the corrected defect area.
[0108] After completing the device area extraction, the next step is to identify and locate the defect area. Set a defect temperature grayscale threshold based on the operating temperature range of the device. If the temperature of a pixel in the infrared image to be tested exceeds this threshold, the pixel is considered to be part of the defect area. For example, the normal operating temperature range of the device is 60°C to 80°C. If 90°C is set as the defect temperature threshold, then pixels with temperatures above this threshold (such as points above 90°C) will be considered defect areas. For example, please refer to Table 1:
[0109] Table 1 Pixel temperature table
[0110]
[0111] In Table 1, 90°C, 92°C, 95°C, 93°C, 97°C, 94°C, 99°C, and 95°C represent defective areas. After setting the temperature threshold, pixels in the defective area can be extracted and marked as defective pixels. The set of defective pixels is then determined as the initial defective area.
[0112] Because in the actual detection process, the interference items in the background area may be mistakenly detected as defect areas, it is necessary to correct the initial defect area through the device pixel connected area. For example, the final corrected defect area can be determined by taking the intersection between the initial defect area and the device pixel connected area. For example, see Figure 3 ,If when detecting by the temperature threshold, it is detected that there are pixels in the 203 and 204 areas of the background area with a temperature higher than the ,defective temperature grayscale threshold, but since they do not belong to the device area, ,they are excluded after correction.
[0113] In an exemplary embodiment, the method further comprises:
[0114] Obtain a geometric model of the device under test, and determine the device space coordinates based on the geometric model; map the pixel coordinates of the corrected defect area to the device space coordinates through geometric transformation to obtain the predicted defect position corresponding to the corrected defect area.
[0115] Combining the device's geometric characteristics and spatial location information, the device's spatial coordinates are determined; the defect's location is precisely calibrated based on geometric mapping. Furthermore, the device's connectivity information can be used to determine whether the defect area belongs to a specific device part and further refine its location.
[0116] This spatial positioning and error correction approach combines the device's geometric model with a geometric transformation to match the pixels in the defect area with the device's actual spatial coordinates, thereby determining the defect's location. Based on the device's shape and connectivity information, the defect area can be corrected to eliminate falsely detected defects.
[0117] In an exemplary embodiment, the method further comprises:
[0118] Based on the defect temperature data, area size and operating status of the corrected defect area, the defect type of the current defect is evaluated; and based on the defect type and the predicted defect location, corresponding repair measures and processing priorities are obtained.
[0119] Once the defect area is successfully identified and located, a defect assessment report can be generated. The report includes the following contents: defect area temperature, recording the highest temperature value of the defect area; defect severity assessment, evaluating the severity of the defect type based on the temperature value, defect area size and equipment operating status; predicted defect location, accurately marking the specific location where the predicted defect will occur; maintenance recommendations, giving maintenance measures and priorities based on the type and location of the defect.
[0120] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0121] Based on the same inventive concept, the present application also provides a defect detection device for implementing the aforementioned defect detection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more defect detection device embodiments provided below can be found in the above-mentioned limitations of the defect detection method and will not be repeated here.
[0122] In an exemplary embodiment, Figure 4 As shown, a defect detection device is provided, including: a segmentation module 301, a marking module 302, a determination module 303 and a correction module 304, wherein:
[0123] The segmentation module 301 is used to obtain an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to the device area and background pixels belonging to the background area;
[0124] A marking module 302 is used to mark the device pixel points and the background pixel points respectively;
[0125] A determination module 303 is configured to determine a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0126] The correction module 304 is configured to identify an initial defect region in the infrared image to be measured, and correct the initial defect region based on the device pixel connected area to obtain a corrected defect region.
[0127] The segmentation module 301 is further configured to:
[0128] Performing edge detection on the infrared image to be tested to determine a device edge area of the device to be tested;
[0129] Determining a device grayscale value interval based on an operating temperature range of the device under test;
[0130] Pixels whose grayscale values belong to the device grayscale value interval and are in the device edge area are determined as the device pixels, and the remaining pixels in the infrared image to be measured except the device pixels are determined as the background pixels.
[0131] The marking module 302 is further configured to:
[0132] Marking the device pixel as a first preset value and marking the background pixel as a second preset value;
[0133] Based on the first preset value and the second preset value, determining a plurality of initial connected regions including device pixels by a connected domain labeling algorithm;
[0134] Grayscale value differences between adjacent pixels in an initial connected region are calculated, continuous pixels in the initial connected region are determined based on the grayscale value differences, and the device pixel connected region is determined based on the continuous pixels.
[0135] The correction module 304 is further configured to:
[0136] Obtaining a defect temperature threshold and a corresponding defect temperature grayscale threshold, determining pixels in the infrared image to be measured whose grayscale values are greater than the defect temperature grayscale threshold as defect pixels, and determining a set of the defect pixels as the initial defect area;
[0137] An intersection between the initial defect area and the device pixel connected area is determined as the corrected defect area.
[0138] The defect detection device further includes:
[0139] A mapping module, configured to obtain a geometric model of the device under test and determine the spatial coordinates of the device based on the geometric model;
[0140] The pixel coordinates of the corrected defect area are mapped to the device space coordinates through geometric transformation to obtain the predicted defect position corresponding to the corrected defect area.
[0141] An evaluation module, configured to evaluate a defect type of a current defect based on defect temperature data of the corrected defect area, area size, and operating status of the device under test;
[0142] Corresponding repair measures and processing priorities are obtained based on the defect type and the predicted defect location.
[0143] Each module in the aforementioned defect detection device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0144] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via wired or wireless communication, and the wireless communication can be implemented via Wi-Fi, a mobile cellular network, near field communication (NFC), or other technologies. When executed by the processor, the computer program implements a defect detection method.
[0145] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0146] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0147] Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area;
[0148] Marking the device pixel points and the background pixel points respectively;
[0149] Determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0150] An initial defect area in the infrared image to be measured is identified, and the initial defect area is corrected based on the device pixel connected area to obtain a corrected defect area.
[0151] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0152] Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area;
[0153] Marking the device pixel points and the background pixel points respectively;
[0154] Determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0155] An initial defect area in the infrared image to be measured is identified, and the initial defect area is corrected based on the device pixel connected area to obtain a corrected defect area.
[0156] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0157] Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area;
[0158] Marking the device pixel points and the background pixel points respectively;
[0159] Determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels;
[0160] An initial defect area in the infrared image to be measured is identified, and the initial defect area is corrected based on the device pixel connected area to obtain a corrected defect area.
[0161] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0162] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0163] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A defect detection method, characterized in that: The method comprises: Acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area; Marking the device pixel points and the background pixel points respectively; Determining a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels; Identifying an initial defect area in the infrared image to be measured, and correcting the initial defect area based on the device pixel connected area to obtain a corrected defect area; The step of determining the connected area of device pixels in the infrared image to be measured based on the markers of the device pixels and the markers of the background pixels includes: Marking the device pixel as a first preset value and marking the background pixel as a second preset value; Based on the first preset value and the second preset value, determining a plurality of initial connected regions including device pixels by a connected domain labeling algorithm; Grayscale value differences between adjacent pixels in an initial connected region are calculated, continuous pixels in the initial connected region are determined based on the grayscale value differences, and the device pixel connected region is determined based on the continuous pixels.
2. The method according to claim 1, characterized in that The segmenting of the pixels of the infrared image to be measured includes: Performing edge detection on the infrared image to be tested to determine a device edge area of the device to be tested; Determining a device grayscale value interval based on an operating temperature range of the device under test; Pixels whose grayscale values belong to the device grayscale value interval and are in the device edge area are determined as the device pixels, and the remaining pixels in the infrared image to be measured except the device pixels are determined as the background pixels.
3. The method according to claim 1, characterized in that The identifying of an initial defect area in the infrared image to be measured, and correcting the initial defect area based on the device pixel connected area to obtain a corrected defect area, includes: Obtaining a defect temperature threshold and a corresponding defect temperature grayscale threshold, determining pixels in the infrared image to be measured whose grayscale values are greater than the defect temperature grayscale threshold as defect pixels, and determining a set of the defect pixels as the initial defect area; An intersection between the initial defect area and the device pixel connected area is determined as the corrected defect area.
4. The method according to claim 3, characterized in that The method further comprises: Obtaining a geometric model of the device under test, and determining the device spatial coordinates based on the geometric model; The pixel coordinates of the corrected defect area are mapped to the device space coordinates through geometric transformation to obtain the predicted defect position corresponding to the corrected defect area.
5. The method according to claim 4, characterized in that The method further comprises: Evaluate the defect type of the current defect based on the defect temperature data, the area size, and the operating status of the device under test of the corrected defect area; Corresponding repair measures and processing priorities are obtained based on the defect type and the predicted defect location.
6. A defect detection device, characterized in that: The device comprises: a segmentation module, configured to acquire an infrared image to be measured, and segment the pixels of the infrared image to be measured to obtain device pixels belonging to a device area and background pixels belonging to a background area; a marking module, configured to mark the device pixels and the background pixels respectively; a determination module, configured to determine a connected region of device pixels in the infrared image to be measured based on the labels of the device pixels and the labels of the background pixels; a correction module, configured to identify an initial defect area in the infrared image to be measured, and correct the initial defect area based on the device pixel connected area to obtain a corrected defect area; Among them, the marking module is also used to: mark the device pixel points as a first preset value and mark the background pixel points as a second preset value; based on the first preset value and the second preset value, determine multiple initial connected areas including device pixel points through a connected domain marking algorithm; calculate the grayscale value difference of adjacent pixel points in the initial connected area, determine the continuous pixel points in the initial connected area based on the grayscale value difference, and determine the device pixel connected area based on the continuous pixel points.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Substation electrical equipment thermal defect detection method based on infrared image
CN117934360A
Substation anomaly detection method and system
CN118505606A