A defect identification method and system for new energy power generation equipment

CN122657048APending Publication Date: 2026-08-28SHAANXI CHANGAN POWER COMPREHENSIVE ENERGY SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610793700.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-03
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0004]本发明的目的是为了解决现有技术中存在的难以同时刻画变色区域在细栅线附近的空间变化过程以及由中心向外扩展的分布关系的缺点,而提出的一种面向新能源发电设备的缺陷识别方法及系统

Benefits of technology

1、本发明通过对可见光图像中的细栅线进行骨架提取,并进一步进行邻域扩展与区域修补处理,有效削弱细栅线本身的高对比干扰,使原本被栅线遮蔽或掩盖的变色信息得以恢复与突出,同时结合形态学处理增强变色区域的空间连续性,从而使分散、断裂的变色区域形成稳定且连贯的表达形式,提升了对复杂变色现象的整体表征能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122657048A_ABST
    Figure CN122657048A_ABST
Patent Text Reader

Abstract

The application discloses a kind of defect identification method and system for new energy power generation equipment, it is related to image processing technical field, including: based on the visible light image of photovoltaic module, obtain fine grid line skeleton image;Skeleton pixel point in fine grid line skeleton image is carried out neighborhood extension and union processing, obtain repair initial image, to repair initial image is carried out morphological closed operation, obtain connectivity arrangement image;Based on fine grid line skeleton image generates multiple grid line neighborhood band image, and to grid line neighborhood band image and connectivity arrangement image is carried out interlaced and morphological reconstruction processing, obtain around grid event diagram;In the core discoloration layer image in around grid event region is obtained, and to core discoloration layer image is carried out image difference, obtain halo chromatography;The application improves the overall characterization ability to complex discoloration phenomenon.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and system for defect identification of new energy power generation equipment. Background Technology

[0002] With the large-scale deployment of new energy power generation equipment, photovoltaic modules, as core power generation units, are exposed to complex outdoor environments for extended periods. Their surface structures are continuously subjected to the combined effects of multiple factors, including humid and hot environments, ultraviolet radiation, temperature cycles, and mechanical stress, which can easily lead to changes in the surface material state, abnormal current conduction paths, and differences in local structural responses. In actual operation, photovoltaic module surfaces often exhibit problems such as microcracks, abnormal grid lines, and localized discoloration. Among these, discoloration appears as a thin, elongated strip or sheet-like distribution in visible light inspection images, typically extending near the fine grid lines and exhibiting a certain spatial variation trajectory. Since on-site inspections often rely on drones or fixed cameras to acquire visible light image data, this type of discoloration becomes an important clue for identifying potential defects. However, due to the influence of lighting conditions, surface contamination, and structural details, different types of discoloration appear similar in the images, making it difficult to directly distinguish their origin and nature. This poses a significant challenge to defect identification based on visible light images.

[0003] Existing technologies, when addressing the aforementioned problems, typically focus on extracting and analyzing linear or textured distributions in images. However, these methods primarily focus on single-morphological representations and struggle to simultaneously depict the spatial changes of the discoloration area near the fine grid lines, as well as the distribution relationship expanding outward from the center. This results in a lack of effective criteria for identifying complex discoloration structures that move closer to, further away from, and then closer again around the fine grid lines, accompanied by peripheral diffusion. Consequently, ordinary surface discoloration or contamination is easily misjudged as defects, or abnormal changes with actual risks are ignored, leading to inaccurate identification results. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies that make it difficult to simultaneously characterize the spatial variation process of the color-changing area near the fine grid line and the distribution relationship expanding outward from the center. Therefore, this invention proposes a defect identification method and system for new energy power generation equipment.

[0005] To address the problems existing in the prior art, the present invention adopts the following technical solution: A defect identification method for new energy power generation equipment includes: Based on the visible light image of the photovoltaic module, the fine grid line skeleton image is obtained; Neighborhood expansion and union processing are performed on the skeleton pixels in the fine grid skeleton image to obtain the repaired initial image. Morphological closing operation is then performed on the repaired initial image to obtain the connectivity-sorted image. Multiple grid line neighborhood band images are generated based on the fine grid line skeleton image, and the grid line neighborhood band images and connectivity sorting images are overlapped and morphologically reconstructed to obtain the grid-around event map. The core color-changing layer image is obtained within the grid-around event region, and image difference is performed on the core color-changing layer image to obtain the halo tomography. Obtain the first connected region corresponding to the halo tomography, and obtain the grid-around event kernel region based on the attachment segment, detachment segment and regress segment of the first connected region; overlap the second connected region of the halo tomography with the grid-around event kernel region to obtain the halo-accompanying region; The spatial overlap relationship between the core region of the grid-around event and the accompanying halo layer is determined to obtain the defect identification result.

[0006] Preferably, obtaining the fine grid line skeleton image includes: Acquire visible light images of photovoltaic modules; Local contrast equalization processing is performed on the visible light image to obtain an illumination-equalized image; Multi-directional line structure enhancement is performed on the illumination-equalized image to obtain a line structure enhanced image; Automatic thresholding segmentation is performed on the line structure enhancement image to obtain candidate binary images of fine grid lines; The candidate binary image of the fine grid line is thinned to obtain the skeleton image of the fine grid line.

[0007] Preferably, obtaining the repaired initial image includes: Obtain the skeleton pixels in the fine grid skeleton image; Using each skeleton pixel as the center, the neighborhood of the skeleton pixel is expanded to obtain the local expanded region of the skeleton pixel. The grid line region is obtained by performing a union operation on the locally extended regions. The pixel values ​​of the pixels in the grid area are replaced to obtain the repaired initial image.

[0008] Preferably, obtaining a connectivity-sorted image includes: Morphological reconstruction processing is performed on the repaired initial image to obtain a grid-suppressed image; A top-hat transform is performed on the grid-suppressed image to obtain a color-enhanced image; Morphological closing operations are performed on the color-enhanced image to obtain a connectivity-sorted image.

[0009] Preferably, obtaining the grid-around event graph includes: A distance transformation is performed on the fine grid line skeleton image to obtain a grid line distance image; The distance-layered processing of the grating distance image is performed to obtain multiple grating neighborhood band images; Use the connectivity-optimized image as a candidate image for color change; Each grid line neighborhood band image is overlaid with the color-changing candidate image to obtain a neighborhood color-changing overlay image. Morphological reconstruction is performed on the overlapping color-changing images in the neighborhood to obtain the reconstructed neighborhood image; Differential processing is performed on adjacent neighborhood reconstructed images to obtain interlayer variation images; By overlaying the images of interlayer changes, a grid-around event map is obtained.

[0010] Preferably, obtaining a halo tomography includes: Determine the region of around-the-grid events based on the around-the-grid event graph; Within the area of ​​the grid-around event, the color-changing candidate image is thinned to obtain the color-changing line kernel image; Morphological reconstruction is performed on the color-changing candidate images to obtain the core color-changing layer image; Image difference processing is performed on the candidate color-changing image and the core color-changing layer image to obtain the halo layer image; Image encoding is performed on the grating event map and the halo layer image to obtain the halo tomography map.

[0011] Preferably, the region around the gate event core includes: Obtain the first channel image of the halo tomography; Connectivity analysis was performed on the first channel image to obtain multiple first connected regions; Determine the skeleton lines of the first connected region; Based on the skeleton line of the first connected region, determine the attachment segment, detachment segment, and return segment; The first connected region that simultaneously contains the attachment segment, the detachment segment, and the return segment is identified as the candidate bypass event region. The candidate gate-around event regions are joined to obtain the gate-around event core region.

[0012] Preferably, the halo-associated region includes: Obtain the second channel image of the halo tomography; Connectivity analysis was performed on the second channel image to obtain multiple second connected regions; The neighborhood expansion process is performed on the core region of the gate-around event to obtain the gate-around neighborhood region; Multiple second connected regions are overlapped with the surrounding gate neighborhood regions to obtain multiple overlapping regions; The second connected region with overlapping areas is identified as a candidate region for the halo layer. The candidate regions of the halo layer are subjected to union processing to obtain the halo layer associated regions.

[0013] Preferably, the defect identification results include: Determine whether the kernel region of the around-the-grid event and the halo layer accompanying region are located in the same local image region: When the core region of the grid-around event and the halo layer are located in the same local image region, the presence of a groove-around halo will be used as the defect identification result. When the core region of the grid-around event and the halo layer accompanying region are not located in the same local image region, the absence of a grid-around halo with a hidden trench is taken as the defect identification result.

[0014] To address the above problems, the present invention also provides a defect identification system for new energy power generation equipment, the system comprising: The grid line extraction module obtains a fine grid line skeleton image based on the visible light image of the photovoltaic module; The repair and finishing module performs neighborhood expansion and union processing on the skeleton pixels in the fine grid skeleton image to obtain the repaired initial image, and performs morphological closing operation on the repaired initial image to obtain the connectivity finishing image. The grid-around imaging module generates multiple grid-line neighborhood band images based on the fine grid-line skeleton image, and performs overlapping and morphological reconstruction processing on the grid-line neighborhood band images and the connectivity sorting image to obtain the grid-around event map. The halo layer construction module obtains the core color-changing layer image within the raster event region and performs image difference on the core color-changing layer image to obtain the halo tomographic map. The halo extraction module obtains the first connected region corresponding to the halo tomography, and obtains the grid-around event kernel region based on the attachment segment, detachment segment and regress segment of the first connected region; the second connected region of the halo tomography is overlapped with the grid-around event kernel region to obtain the halo layer accompanying region; The overlap determination module determines the spatial overlap relationship between the core region of the grid-around event and the accompanying halo layer region, and obtains the defect identification result.

[0015] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention extracts the skeleton of fine grid lines in visible light images and further performs neighborhood expansion and region repair processing, which effectively reduces the high contrast interference of the fine grid lines themselves, so that the color change information that was originally obscured or covered by the grid lines can be restored and highlighted. At the same time, the spatial continuity of the color change area is enhanced by combining morphological processing, so that the scattered and broken color change areas form a stable and coherent expression form, thereby improving the overall representation ability of complex color change phenomena.

[0016] 2. This invention constructs multiple neighborhood bands around the fine grid line and performs overlapping, reconstruction, and interlayer difference processing on the color-changing region within each neighborhood. This enables a layer-by-layer characterization of the color-changing region's spatial change process, accurately reflecting the distribution pattern of the color-changing region as it expands outward from the fine grid line. This overcomes the shortcomings of existing methods that only focus on a single morphology and cannot express the spatial change process, allowing for the effective differentiation and identification of grid-related anomalies and improving the recognition accuracy in complex scenarios.

[0017] 3. This invention separates the core layer and the outer extension layer of the discoloration region, and combines the spatial change relationship of attachment, detachment and return in the connected region to further construct the core region of the grid-around event and the halo layer accompanying region. Based on the spatial overlap relationship between the two, the invention makes a judgment, which realizes the accurate identification of the target defect. It can not only effectively distinguish between real anomalies and ordinary surface changes, but also reduce the occurrence of false judgments and false omissions, thereby improving the reliability and stability of defect identification as a whole. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating a defect identification method for new energy power generation equipment according to an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0020] This embodiment provides a defect identification method for new energy power generation equipment. See [link to documentation]. Figure 1 Specifically, this includes: S1, obtaining a fine grid line skeleton image based on a visible light image of a photovoltaic module; In an embodiment of the present invention, obtaining a fine grid line skeleton image includes: Acquire visible light images of photovoltaic modules; A photovoltaic module refers to a power generation unit formed by encapsulating multiple solar cells and used to convert solar radiation energy into electrical energy; a visible light image refers to image data obtained by a camera that reflects the color, brightness, and texture distribution of the surface of a photovoltaic module.

[0021] Photovoltaic modules are photographed using area array cameras, line array cameras, drone-mounted cameras, or fixed inspection cameras to obtain raw color image data. From the raw color image data, the frame lines, corner points, and cell arrangement direction of the photovoltaic modules are identified. Based on the frame lines and corner points, the outer contour region of the photovoltaic module in the raw color image data is determined. Perspective correction is performed on the outer contour region to align the corrected frame direction with the image coordinate direction. The corrected outer contour region is cropped to obtain a module region image containing only the photovoltaic module's light-receiving surface. The module region image is then color space converted, and the luminance channel is extracted as a visible light image. Pixel coordinates are registered for the visible light image so that each pixel in the visible light image corresponds to a position on the photovoltaic module's light-receiving surface. The pixel grayscale value, image width, image height, and pixel coordinate information of the visible light image are saved.

[0022] Local contrast equalization processing is performed on the visible light image to obtain an illumination-equalized image; Read all pixel grayscale values ​​of the visible light image, traverse each pixel position of the image, count the number of pixels that each grayscale value appears, forming the overall grayscale distribution. Traverse each pixel position of the image, extract edge pixels in the image, connect edge pixels to form continuous linear edges, count the horizontal pixel span of each linear edge, remove linear edges whose span deviates significantly from the mainstream range, calculate the arithmetic mean of the horizontal pixel span of the remaining linear edges to obtain the average width of the fine grid lines. Traverse each pixel position of the image, evenly divide the image into multiple non-overlapping rectangular blocks along the horizontal and vertical directions, with the side length of each block maintaining a fixed ratio with the average width of the fine grid lines. Traverse all pixel positions within each rectangular block, count the number of pixels that each grayscale value appears within the block, forming a block grayscale histogram. Starting from the lowest grayscale value to the highest grayscale value, the pixel count corresponding to each grayscale value is sequentially added to the pixel count of all previous grayscale values ​​to obtain the cumulative pixel count for each grayscale value. The cumulative pixel count for each grayscale value is divided by the total pixel count within the block to obtain the cumulative probability value for each grayscale value, forming a cumulative distribution. This process is repeated for each grayscale value in the block grayscale histogram, removing those whose pixel counts deviate significantly from the overall distribution. The pixel counts of the removed block grayscale histogram are then mapped proportionally to the standard grayscale range of the image. Each pixel position within the block is then iterated to find the cumulative probability value corresponding to the original grayscale value of the pixel. The new grayscale value corresponding to this cumulative probability value is used as the target grayscale value for the pixel, completing the pixel grayscale mapping and obtaining the equalization result for a single block. The boundary pixel positions of adjacent blocks are then iterated to perform bilinear interpolation fusion on the equalization results of adjacent blocks. Finally, the block pixel positions at the image edges are iterated to supplement the boundary pixels using a mirror expansion method before interpolation fusion is performed, resulting in a balanced illumination image.

[0023] Multi-directional line structure enhancement is performed on the illumination-equalized image to obtain a line structure enhanced image; Illumination equalization image refers to image data obtained by equalizing local brightness differences in a visible light image, used to reduce the impact of shadows, reflections, and local exposure differences on the expression of image content; line structure enhancement image refers to image data obtained by enhancing the slender line structures in the illumination equalization image, used to highlight the linear grayscale distribution corresponding to the fine grid lines on the surface of photovoltaic modules.

[0024] Traverse each pixel position of the illumination equalization image, extract continuous bright lines parallel to the main grid line direction, count the pixel distance between adjacent continuous bright lines, remove continuous bright lines whose distance deviates significantly from the main grid line range, calculate the arithmetic mean of the pixel distances between the remaining continuous bright lines to obtain the average spacing of the fine grid lines, generate multiple linear structuring elements, the length of each structuring element is a fixed proportion of the average spacing of the fine grid lines, the width of each structuring element is a single pixel, the center of each structuring element is located at its geometric center, the direction of each structuring element is uniformly distributed across the entire angular range, and the directional spacing of adjacent structuring elements remains consistent; Iterate through each linear structuring element, aligning each pixel position of the structuring element with the pixel position of the illumination equalization image. Iterate through each pixel position of the image, replacing the minimum gray value within the area covered by the structuring element with the gray value of the current pixel to complete the erosion operation. Iterate through each pixel position of the eroded image, replacing the maximum gray value within the area covered by the structuring element with the gray value of the current pixel to complete the dilation operation, obtaining the line structure response map in the corresponding direction. Iterate through the line structure response maps in all directions, and for each pixel position, take the maximum gray value of that pixel position in all response maps as the gray value of the fused image. Iterate through each pixel position of the fused image, linearly stretching the gray range of the fused image to the standard gray range of the image, finally obtaining the line structure enhanced image.

[0025] Automatic thresholding segmentation is performed on the line structure enhancement image to obtain candidate binary images of fine grid lines; Candidate binary images of fine grid lines refer to the image representation formed by distinguishing the pixel regions that may correspond to the fine grid line positions from the non-fine grid line regions in the visible light information of the photovoltaic module surface. The fine grid line regions correspond to the metal conductive structures on the surface of the cell used to collect current, and they are represented in the imaging as regions with certain continuity and directionality of brightness or color differences.

[0026] Traverse all pixel positions in the line structure enhanced image, record the grayscale value of each pixel, count the number of times the pixel corresponding to each grayscale value appears, calculate the total number of pixels in the image, calculate the sum of the grayscale values ​​of all pixels in the image, divide the sum of the grayscale values ​​by the total number of pixels to obtain the global average grayscale value, starting from the lowest grayscale value, use each grayscale value as a temporary segmentation threshold, divide the pixels in the image with grayscale values ​​greater than the temporary segmentation threshold into temporary foreground regions, divide the pixels with grayscale values ​​less than or equal to the temporary segmentation threshold into temporary background regions, count the number of pixels in the temporary foreground regions, divide the number of pixels in the temporary foreground regions by the total number of pixels to obtain the pixel ratio of the temporary foreground regions, count the sum of the grayscale values ​​of all pixels in the temporary foreground regions, divide the sum of the grayscale values ​​of the temporary foreground regions by the number of pixels in the temporary foreground regions to obtain the average grayscale value of the temporary foreground regions, count the number of pixels in the temporary background regions, divide the number of pixels in the temporary background regions by the total number of pixels to obtain the pixel ratio of the temporary background regions, and count the sum of the grayscale values ​​of all pixels in the temporary background regions. The average gray value of the temporary background region is obtained by dividing the sum of the gray values ​​of the temporary background region by the number of pixels in the temporary background region. The difference between the average gray value of the temporary foreground region and the global average gray value is calculated. The difference is squared and multiplied by the pixel ratio of the temporary foreground region to obtain the first calculated value. The difference between the average gray value of the temporary background region and the global average gray value is calculated. The difference is squared and multiplied by the pixel ratio of the temporary background region to obtain the second calculated value. The first calculated value and the second calculated value are added to obtain the inter-class variance value corresponding to the temporary segmentation threshold. The inter-class variance value corresponding to each temporary segmentation threshold is recorded. After traversing all gray values, the gray value corresponding to the largest inter-class variance value is found as the final segmentation threshold. All pixel positions of the line structure enhancement image are traversed again. Pixels with gray values ​​greater than the final segmentation threshold are assigned the first gray value, and pixels with gray values ​​less than or equal to the final segmentation threshold are assigned the second gray value. The pixel region corresponding to the first gray value is the possible fine grid line region, and the pixel region corresponding to the second gray value is the non-fine grid line region, thus forming a candidate binary image of fine grid lines.

[0027] The above calculation logic is based on the Otsu method's threshold segmentation principle. Its core idea is to determine the optimal global threshold by maximizing the inter-class variance between the foreground and background classes after segmentation. The inter-class variance quantifies the dispersion of the gray-level distributions of the two classes. The larger the inter-class variance, the more significant the gray-level difference between the foreground and background, and the lower the probability of segmentation errors. The specific derivation process is as follows: the global average gray-level value represents the overall gray-level of the image. The average gray-level values ​​of the temporary foreground region and the temporary background region represent the gray-level centers of the two classes, respectively. The squared difference between the average gray-level values ​​of the two classes and the global average gray-level value reflects the dispersion of the two classes relative to the overall gray-level. Multiplying by the respective pixel proportion is to weight the dispersion based on the distribution ratio of the two classes in the image. The weighted results are added together to obtain the inter-class variance value. When the inter-class variance value reaches its maximum, it means that the temporary segmentation threshold can distinguish the foreground and background pixels to the greatest extent. This threshold is the optimal segmentation threshold. The rationale for this method lies in its automatic calculation of the optimal threshold based entirely on the grayscale distribution of the image itself, without the need for manual parameter presets. This avoids the subjectivity and errors caused by manually setting thresholds. It has good adaptability and robustness for scenes where there is a significant difference in grayscale between fine grid lines and the background in the surface image of photovoltaic modules, and can stably and accurately separate the fine grid line area from the non-fine grid line area.

[0028] The candidate binary image of the fine grid line is thinned to obtain the skeleton image of the fine grid line.

[0029] The fine grid line skeleton image refers to the image representation formed by extracting the center position of the fine grid line region. It is used to reflect the dominant extension path of the fine grid line in space. This path corresponds to the center distribution position of the current collection channel on the surface of the photovoltaic cell and is used to characterize the spatial orientation and connection relationship of the fine grid line on the module surface.

[0030] Fine grid lines refer to the thin, elongated metal conductive lines set on the light-receiving surface of photovoltaic cells. They are used to collect the current generated after the cell is exposed to light and transfer the current to the main grid lines. Fine grid lines are usually distributed in groups along a fixed direction. In visible light images, they appear as regularly arranged, narrow, and continuous linear regions. Their spatial position and orientation can reflect the distribution state of the current collection structure on the surface of the photovoltaic cell.

[0031] Using a candidate binary image with fine grid lines as the processing object, the iteration flag is initialized to true. When the iteration flag is true, the iteration operation is performed, the iteration flag is set to false, the pixel positions of all first gray values ​​in the image are traversed, all pixel gray values ​​in the 3x3 neighborhood around the pixel are obtained, the gray values ​​of the 8 adjacent pixels in the neighborhood are recorded in a clockwise direction, the number of first gray value pixels in the neighborhood is counted, and it is determined whether the pixel is an edge pixel. An edge pixel is a first gray value pixel in the neighborhood that has at least one second gray value pixel in the neighborhood. The algorithm determines whether a pixel is an endpoint of a linear region. An endpoint is a pixel with a first gray value equal to 1 in its neighborhood. It then determines whether removing the pixel would disrupt the connectivity of the linear region. This connectivity is determined by counting the number of connected components of the first gray value pixels in the neighborhood after the pixel is removed. If the number of connected components is not greater than 1, the removal will not disrupt connectivity. If the pixel is an edge pixel and its removal will not disrupt connectivity and it is not an endpoint, then the pixel is marked as a pixel to be removed. After one iteration, the gray values ​​of all pixels to be removed are modified to the second gray value. If there are pixels with modified gray values ​​in this iteration, the iteration flag is reset to true. The iteration operation is repeated until the iteration flag is false. At this point, the remaining first gray value pixels form a continuous linear region with a single pixel width, completely preserving the spatial extension path and connection relationship of the fine grid lines, ultimately resulting in the fine grid line skeleton image.

[0032] S2. Perform neighborhood expansion and union processing on the skeleton pixels in the fine grid skeleton image to obtain the repaired initial image. Perform morphological closing operation on the repaired initial image to obtain the connectivity-sorted image. In an embodiment of the present invention, obtaining the repaired initial image includes: Obtain the skeleton pixels in the fine grid skeleton image; Starting from the top left corner of the fine grid skeleton image, traverse each row of pixels in the image sequentially. In each row, read the grayscale value of each pixel from left to right. The fine grid skeleton image contains only two grayscale values: the target grayscale value representing the skeleton and the non-target grayscale value representing the background. Mark the pixels whose grayscale value is equal to the target grayscale value as skeleton pixels. Record the row and column coordinates of each skeleton pixel in the image until all pixel positions in the image have been traversed, and obtain the position information of all skeleton pixels.

[0033] Using each skeleton pixel as the center, the neighborhood of the skeleton pixel is expanded to obtain the local expanded region of the skeleton pixel. Skeleton pixels refer to the pixels in the skeleton image that represent the center position of the fine grid lines, corresponding to the central extension position of the fine grid lines on the surface of the photovoltaic cell in the image; neighborhood expansion refers to the image processing process of including the adjacent pixels around the skeleton pixel that correspond to the actual width of the fine grid lines in the same region; local expansion region refers to the set of pixels formed after the neighborhood expansion of a single skeleton pixel, corresponding to the local linewidth coverage area near the center position of the fine grid lines.

[0034] Iterate through all skeleton pixels with recorded position information, read the row and column coordinates of each skeleton pixel, determine the number of pixel layers to expand based on the average width of the fine grid lines obtained in the previous steps, create an empty pixel set, and with the row and column coordinates of the skeleton pixel as the center, iterate through all pixels whose row coordinates are within the range of the corresponding number of expansion layers above and below the center row coordinates, and whose column coordinates are within the range of the corresponding number of expansion layers to the left and right of the center column coordinates. Add all the coordinates of these pixels to the empty pixel set, and mark this pixel set as the local expansion region of the current skeleton pixel. Complete the neighborhood expansion of all skeleton pixels in sequence to obtain the local expansion region corresponding to each skeleton pixel.

[0035] The grid line region is obtained by performing a union operation on the locally extended regions. Union refers to the image set operation that merges the pixels contained in multiple local extended regions into the same region; grid line region refers to the region formed by merging multiple local extended regions, which corresponds to the coverage position of the fine grid lines on the surface of the photovoltaic cell in the visible light image.

[0036] Create a binary image with the exact same size as the visible light image. In the initial state of this image, all pixels are background grayscale values. Traverse the local extended region corresponding to each skeleton pixel, read the row and column coordinates of all pixels contained in the local extended region, and set the grayscale value of the pixel at the corresponding row and column coordinate positions in the binary image as the foreground grayscale value. If the same row and column coordinates are read by multiple local extended regions, only one grayscale value setting operation is performed. After all local extended regions have been processed, the set of pixel positions corresponding to all foreground grayscale values ​​in the binary image is the raster region.

[0037] The pixel values ​​of the pixels in the grid area are replaced to obtain the repaired initial image.

[0038] Pixel value replacement refers to the image processing process of rewriting the original grayscale or color value of pixels within the grid area to the alternative grayscale or color value provided by the non-grid area; repairing the initial image refers to the image data formed after the pixels within the grid area have undergone pixel value replacement, which is used to express the surface image of the photovoltaic module after the brightness and darkness response of the fine grid lines has been weakened.

[0039] Traverse all pixel positions belonging to the grid line region in the visible light image. Centered on the pixel position, read the gray values ​​of the pixels adjacent to the pixel position that are not marked as grid line regions. Sum all the read gray values ​​of the non-grid line region pixels and divide by the number of read non-grid line region pixels to obtain the arithmetic mean. Use this arithmetic mean as the target replacement gray value. Rewrite the original gray value of the current grid line region pixel position in the visible light image as the target replacement gray value. After traversing all grid line region pixel positions, the gray values ​​of the grid line region pixels in the visible light image are all replaced with gray values ​​similar to the surrounding non-grid line regions, resulting in the repaired initial image.

[0040] In an embodiment of the present invention, obtaining a connectivity-sorted image includes: Morphological reconstruction processing is performed on the repaired initial image to obtain a grid-suppressed image; Morphological reconstruction processing refers to the image processing process that propagates and restores the pixel grayscale distribution by constraining the spatial connectivity between pixels while maintaining the main structural distribution relationship in the image. It is used to maintain the continuity of the surface structural response of photovoltaic modules. The grid line suppression image refers to image data in which the high contrast response corresponding to the fine grid lines is weakened after morphological reconstruction processing, while the grayscale distribution of other areas on the surface of the photovoltaic module remains continuous.

[0041] Using the repaired initial image as a mask image, a marker image with the same size as the mask image is created. Each pixel position in the marker image is traversed. If the pixel position does not belong to the grid area, the gray value of the position in the marker image is set to the same as the gray value of the corresponding position in the mask image. If the pixel position belongs to the grid area, the gray value of the position in the marker image is set to the minimum gray value of the non-grid area pixels around the position in the mask image. A square structuring element with a side length matching the average width of the fine grid is created. The iteration state is initialized to non-converged. When the iteration state is non-converged, the current marker image is completely copied as a temporary image. A dilation operation is performed on the temporary image using a square structuring element. The dilation operation iterates through each pixel position of the temporary image, updating the gray value of that position to the maximum gray value of all pixels within the area covered by the structuring element. The dilated temporary image is then compared pixel by pixel with the mask image, and the smaller gray value at each pixel position is taken as the gray value of the new labeled image. The new labeled image is then compared pixel by pixel with the labeled image before the iteration. If the gray values ​​at all pixel positions have not changed, the iteration state is set to converged; otherwise, the iteration operation continues. The labeled image obtained after the iteration is completed is the grid line suppression image.

[0042] A top-hat transform is performed on the grid-suppressed image to obtain a color-enhanced image; Top-hat transformation refers to an image processing method that highlights relatively small-scale brightness variation areas by removing local background from an image. It is used to enhance local color changes or subtle brightness changes on the surface of photovoltaic modules. Color-enhanced images refer to image data where gray-scale variation areas on the surface of photovoltaic modules are magnified after top-hat transformation.

[0043] A square structuring element with a side length matching the typical width of the snail-pattern color-changing region on the photovoltaic module surface is created. This structuring element is then used to perform a morphological opening operation on the grid line suppression image. The morphological opening operation first performs an erosion operation, which iterates through each pixel position of the grid line suppression image, updating the gray value at that position to the minimum gray value of all pixels within the structuring element's coverage area, resulting in the eroded image. Then, the same structuring element is used to perform a dilation operation on the eroded image, which iterates through each pixel position of the eroded image, updating the gray value at that position to the maximum gray value of all pixels within the structuring element's coverage area, resulting in the opening image. The gray value of each pixel in the grid line suppression image is subtracted from the corresponding pixel gray value in the opening image to obtain a difference image. The gray values ​​of pixels in the difference image that are less than zero are uniformly set to zero. Finally, the gray range of the difference image is linearly stretched to the standard gray range of the image, resulting in the color-enhanced image.

[0044] Morphological closing operations are performed on the color-enhanced image to obtain a connectivity-sorted image.

[0045] Morphological closing refers to the image processing process that fills the gaps between adjacent regions by performing dilation and erosion on the image, thereby enhancing the connectivity of the regions; connectivity-enhancing images refer to image data in which scattered gray-level variation regions in the image are connected to form continuous regions after morphological closing.

[0046] A square structuring element is created, with its side length determined by the typical gaps between the scattered color-changing regions in the color-enhanced image. The center of the structuring element is located at its geometric center. A morphological dilation operation is performed on the color-enhanced image using this structuring element. The dilation operation iterates through each pixel position of the color-enhanced image, aligning the center of the structuring element with the current pixel position. The grayscale values ​​of all pixels within the coverage area of ​​the structuring element are read, and the grayscale value of the current pixel is updated to the maximum value among these grayscale values. After updating all pixels, the dilated image is obtained. Then, a morphological erosion operation is performed on the dilated image using the same structuring element. The erosion operation iterates through each pixel position of the dilated image, aligning the center of the structuring element with the current pixel position. The grayscale values ​​of all pixels within the coverage area of ​​the structuring element are read, and the grayscale value of the current pixel is updated to the minimum value among these grayscale values. After updating all pixels, the small gaps between the originally scattered grayscale variation regions in the image are filled, and adjacent scattered regions are connected to form a continuous whole, while maintaining the original overall scale and extension direction of the color-changing regions, ultimately resulting in a connected image.

[0047] S3. Generate multiple grid line neighborhood zone images based on the fine grid line skeleton image, and perform overlapping and morphological reconstruction processing on the grid line neighborhood zone images and the connectivity sorting image to obtain the grid-around event map. In an embodiment of the present invention, obtaining a gate-around event graph includes: A distance transformation is performed on the fine grid line skeleton image to obtain a grid line distance image; Create a grid distance image with the exact same size as the fine grid skeleton image. Initialize the gray values ​​of all pixels in the grid distance image to values ​​greater than the diagonal length of the image. Iterate through each pixel position in the fine grid skeleton image. If the pixel is a fine grid skeleton pixel, set the gray value of the corresponding position in the grid distance image to zero. Perform the first scan on the grid distance image. The scanning direction is from the upper left corner to the lower right corner of the image. Iterate through each pixel position row by row and column by column. Read the gray values ​​of the four adjacent pixels above, to the upper left, to the left, and to the lower left of the current pixel position. Calculate the distance increment between the current pixel and these four adjacent pixels. Add the gray values ​​of the adjacent pixels to the corresponding distance increments. Take the minimum value among the four calculation results as the temporary gray value of the current pixel. If the temporary grayscale value is less than the original grayscale value of the current pixel, the grayscale value of the current pixel is updated to the temporary grayscale value. After the first scan is completed, a second scan is performed on the grid line distance image. The scanning direction is from the lower right corner to the upper left corner of the image. Each pixel position is traversed row by row and column by column. The grayscale values ​​of the four adjacent pixels below, to the lower right, to the right, and to the upper right of the current pixel position are read. The distance increment between the current pixel and these four adjacent pixels is calculated respectively. The grayscale values ​​of the adjacent pixels are added to the corresponding distance increments, and the minimum value among the four calculation results is taken as the temporary grayscale value of the current pixel. If the temporary grayscale value is less than the original grayscale value of the current pixel, the grayscale value of the current pixel is updated to the temporary grayscale value. After the two scans are completed, the grayscale value of each pixel in the grid line distance image is the Euclidean distance from that pixel to the nearest fine grid line skeleton pixel, and the grid line distance image is finally obtained.

[0048] The distance-layered processing of the grating distance image is performed to obtain multiple grating neighborhood band images; A grid line distance image refers to image data formed by measuring the spatial distance between each pixel and the nearest grid line, based on the spatial position of the grid line in the image. It reflects the spatial distribution relationship of each position on the surface of the photovoltaic cell relative to the grid line. A grid line neighborhood band image refers to a layered region image formed by dividing the distance range between the pixel and the grid line. It is used to represent different spatial band-shaped regions around the grid line from near to far.

[0049] Traverse all pixel positions of the grid line distance image, read the grayscale value of each pixel, and statistically analyze the distribution of all grayscale values. Find the maximum grayscale value in the grid line distance image, determine the number of layers based on the maximum grayscale value, and divide the distance range from zero to the maximum grayscale value into multiple continuous and non-overlapping distance intervals. The width of each distance interval remains consistent. Create multiple binary images with the same size as the grid line distance image, with the number of binary images matching the number of distance intervals. Each binary image corresponds to one distance interval. Traverse each distance interval, and then traverse each pixel position of the grid line distance image. If the grayscale value of the pixel is within the range of the current distance interval, set the grayscale value of that position in the corresponding binary image as the foreground grayscale value; otherwise, set it as the background grayscale value. After processing all distance intervals, the resulting multiple binary images are multiple grid line neighborhood band images.

[0050] Use the connectivity-optimized image as a candidate image for color change; The connectivity-processed image is used as a candidate image for color change because the pixel distribution in the connectivity-processed image integrates the scattered and discontinuous gray-level variation areas in the original image through spatial connectivity, making these areas form a continuous distribution in space. The color change phenomenon on the surface of photovoltaic modules usually manifests as a continuous distribution of regions extending in a certain direction. Therefore, the image after connectivity processing can more realistically reflect the spatial existence of the color-change area on the module surface, thus making the image a candidate representation of the color-change area.

[0051] Each grid line neighborhood band image is overlaid with the color-changing candidate image to obtain a neighborhood color-changing overlay image. Color-changing candidate images refer to the image representation of areas in the grayscale or color distribution of photovoltaic module surfaces that may correspond to local material changes or surface response changes; neighborhood color-changing overlapping images refer to the regional images formed after the grid line neighborhood band image and the color-changing candidate image overlap in spatial location, used to represent the distribution of color-changing regions within a specific grid line neighborhood.

[0052] Traverse all grid-line neighborhood images, creating a blank neighborhood color-changing overlapping image of the same size as the color-changing candidate image for each grid-line neighborhood image. Iterate row-by-row and column-by-column through each pixel position of the current grid-line neighborhood image and the color-changing candidate image, reading the grayscale value of that position in the grid-line neighborhood image and the grayscale value of that position in the color-changing candidate image. If the grayscale value of that position in the grid-line neighborhood image is the foreground grayscale value and the grayscale value of that position in the color-changing candidate image is greater than the background grayscale value, then set the grayscale value of the corresponding position in the blank neighborhood color-changing overlapping image to the grayscale value of that position in the color-changing candidate image; otherwise, set the grayscale value of the corresponding position in the blank neighborhood color-changing overlapping image to the background grayscale value. After completing the overlapping processing of the current grid-line neighborhood image, the corresponding neighborhood color-changing overlapping image is obtained. After all grid-line neighborhood images have undergone the above processing, all neighborhood color-changing overlapping images are obtained.

[0053] Morphological reconstruction is performed on the overlapping color-changing images in the neighborhood to obtain the reconstructed neighborhood image; Using the neighboring color-changing overlapping image as a mask image, a marker image with the same size as the neighboring color-changing overlapping image is created. The gray values ​​of all pixels in the marker image are initialized to the background gray values. Each pixel position in the neighboring color-changing overlapping image is traversed. If the gray value at that position is greater than the background gray value, the gray value at the corresponding position in the marker image is set to the gray value at that position in the neighboring color-changing overlapping image. A structuring element matching the typical width of the color-changing region is created. The iteration state is initialized to non-converged. When the iteration state is non-converged, the current marker image is copied as a temporary image. The structuring element is used to perform a dilation operation on the temporary image. Each pixel position in the temporary image is traversed, and the center of the structuring element is aligned with the current pixel position. Read the grayscale values ​​of all pixels within the area covered by the structuring element, update the grayscale value of the current pixel to the maximum value among these grayscale values, and take the minimum value pixel by pixel between the dilated temporary image and the mask image to obtain the updated labeled image. Compare the updated labeled image with the labeled image before the iteration. If the grayscale values ​​of all pixels have not changed, the iteration state is set to converged; otherwise, the iteration operation continues. The labeled image obtained after the iteration is completed is the neighborhood reconstruction image.

[0054] Differential processing is performed on adjacent neighborhood reconstructed images to obtain interlayer variation images; Neighborhood reconstruction image refers to image data formed by propagating the pixel distribution while maintaining the spatial connectivity of the overlapping color-changing regions in the neighborhood. It reflects the continuous distribution state of the color-changing regions within the neighborhood. Interlayer variation image refers to image data obtained by calculating the image differences between neighboring layers of different grid lines. It is used to represent the changes in color-changing distribution between layers at different distances.

[0055] Arrange all neighboring reconstructed images in order of proximity to the grid line neighboring images. Starting from the first neighboring reconstructed image, read the current neighboring reconstructed image and the next neighboring reconstructed image sequentially. Create a blank interlayer variation image with the same size as the image. Traverse each pixel position of the two neighboring reconstructed images row by row and column by column. Read the gray value of that position in the current neighboring reconstructed image and the gray value of that position in the next neighboring reconstructed image. Subtract the gray value of the next neighboring reconstructed image from the gray value of the current neighboring reconstructed image to obtain the difference. If the difference is less than zero, invert the difference. Use the processed difference as the gray value of the corresponding position in the interlayer variation image. After traversal, the current interlayer variation image is obtained. Continue processing the next set of adjacent neighboring reconstructed images until all adjacent layers have completed the difference processing to obtain all interlayer variation images.

[0056] By overlaying the images of interlayer changes, a grid-around event map is obtained.

[0057] The grid-around event map refers to image data used to represent the spatial proximity, deviation, and re-proximity of the discolored area on the surface of a photovoltaic module relative to the fine grid lines. It corresponds to the distribution changes of the discolored area around the fine grid lines and can reflect whether the discolored area extends along the vicinity of the fine grid lines, moves away from the vicinity of the fine grid lines, and moves closer to the fine grid lines again.

[0058] Specifically, a blank image with the exact same size as any interlayer variation image is created. The grayscale values ​​of all pixels in the blank image are initialized to zero. All interlayer variation images are traversed sequentially in order of proximity to the raster line neighborhood corresponding to the interlayer variation image. The grayscale value of each pixel position in the current interlayer variation image is read row by row and column by column. The read grayscale value is arithmetically added to the current grayscale value at the corresponding row and column coordinate positions in the blank image. The result is used as the new grayscale value at that position in the blank image and the update is completed. After all interlayer variation images have been superimposed, all pixel positions in the superimposed blank image are traversed. The maximum and minimum values ​​of all pixel grayscale values ​​are counted. The difference between the maximum and minimum values ​​is calculated. If the difference is greater than zero, a linear transformation is performed on the grayscale value of each pixel, mapping the grayscale value range from the minimum to the maximum value to the standard grayscale range of the image. If the difference is equal to zero, the grayscale values ​​of all pixels are uniformly set to the median value of the standard grayscale range. The image after the above processing is the raster event map.

[0059] S4. Obtain the core color-changing layer image within the grid-around event region, and perform image difference on the core color-changing layer image to obtain the halo tomography. In an embodiment of the present invention, obtaining a halo tomography map includes: Determine the region of around-the-grid events based on the around-the-grid event graph; Traverse all pixel positions in the raster event map, record the grayscale value of each pixel, count the number of times the pixel corresponding to each grayscale value appears, calculate the total number of pixels in the image, calculate the sum of the grayscale values ​​of all pixels and divide by the total number of pixels to obtain the global average grayscale value, starting from the lowest grayscale value, take each grayscale value as a temporary segmentation threshold, divide pixels with grayscale values ​​greater than the temporary segmentation threshold into temporary foreground regions, divide pixels with grayscale values ​​less than or equal to the temporary segmentation threshold into temporary background regions, calculate the pixel proportion and average grayscale value of the temporary foreground region and the temporary background region respectively, calculate the square of the difference between the average grayscale value of the temporary foreground region and the global average grayscale value and multiply it by the pixel proportion of the temporary foreground region to obtain the first calculated value, calculate the square of the difference between the average grayscale value of the temporary background region and the global average grayscale value and multiply it by the pixel proportion of the temporary background region to obtain the second calculated value, add the first calculated value and the second calculated value to obtain the inter-class variance corresponding to the temporary segmentation threshold; Record the inter-class variance corresponding to all temporary segmentation thresholds. Find the gray value corresponding to the maximum inter-class variance as the final segmentation threshold. Iterate through all pixel positions of the raster event map again. Mark pixels with gray values ​​greater than the final segmentation threshold as event pixels and pixels with gray values ​​less than or equal to the final segmentation threshold as background pixels. Create a labeled image with the same size as the raster event map. Initialize all pixels in the labeled image to zero. Iterate through all event pixels. If an event pixel is not labeled, start from that pixel and search for all unlabeled event pixels connected to its eight neighbors. Mark these pixels as the same connected region and assign them the same region number. After all event pixels are labeled, each set of pixels with the same region number is a raster event region.

[0060] Within the area of ​​the grid-around event, the color-changing candidate image is thinned to obtain the color-changing line kernel image; The grid-around event region refers to the spatial region in the grid-around event map corresponding to the approach, deviation and reapproach relationship of the color-changing region relative to the fine grid line. It reflects the local change range of the color-changing distribution on the surface of the photovoltaic module around the fine grid line. The color-changing line core image refers to the center line distribution image extracted from the color-changing candidate image, which corresponds to the dominant extension path of the color-changing region on the surface of the module.

[0061] Create a blank image of the same size as the color-changing candidate image. Initialize the grayscale values ​​of all pixels in the blank image to the background grayscale values. Traverse all raster event regions, read all pixel positions contained in the current raster event region, copy the grayscale values ​​of the corresponding positions in the color-changing candidate image to the corresponding positions in the blank image, and obtain the image to be refined containing only the color-changing information within the raster event region. Initialize the iteration flag to true. When the iteration flag is true, perform the iteration operation and set the iteration flag to false. Traverse all pixel positions in the image to be refined where the grayscale value is greater than the background grayscale value. Obtain all pixel grayscale values ​​in the eight neighboring regions of the pixel. Record the grayscale values ​​of the eight adjacent pixels in the neighboring region in a clockwise direction. Count the number of pixels in the neighboring region where the grayscale value is greater than the background grayscale value. Determine whether the pixel is an edge pixel. An edge pixel is a non-background pixel in the neighboring region that has at least one background grayscale value pixel. Determine whether the pixel is the endpoint of a line region. An endpoint is a non-background pixel in the neighboring region where the number of non-background pixels is equal to one. The algorithm determines whether the connectivity of the linear region after removing a pixel is disrupted. This connectivity is determined by counting the number of connected components of non-background pixels in the neighborhood after the pixel is removed. If the number of connected components is no more than one, the removal will not disrupt connectivity. If the pixel is an edge pixel and its removal will not disrupt connectivity and it is not an endpoint, then the pixel is marked as a pixel to be removed. After one iteration, the grayscale values ​​of all pixels to be removed are modified to the background grayscale values. If there are pixels with modified grayscale values ​​in this iteration, the iteration flag is reset to true. The iteration operation is repeated until the iteration flag is false. At this point, the remaining non-background pixels in the image to be refined form a continuous linear region with a single pixel width, completely preserving the spatial extension path and connection relationship of the color-changing region, and finally obtaining the color-changing line kernel image.

[0062] Morphological reconstruction is performed on the color-changing candidate images to obtain the core color-changing layer image; Using the color-changing candidate image as a mask image, a marker image of the exact same size is created. The grayscale values ​​of all pixels in the marker image are initialized to the background grayscale values. Each pixel position in the color-changing kernel image is iterated over; if the grayscale value at that position is greater than the background grayscale value, the corresponding grayscale value in the marker image is set to the grayscale value of that position in the color-changing candidate image. A square structuring element is created, with its side length determined by the average spacing between adjacent non-background pixels in the color-changing kernel image. The center of the structuring element is located at its geometric center. The initial iteration state is set to non-converged. When the iteration state is non-converged, the current marker image is completely copied as a temporary image, and this square element is used. The structuring element performs a dilation operation on the temporary image. The dilation operation traverses each pixel position of the temporary image, aligns the center of the structuring element with the current pixel position, reads the gray values ​​of all pixels within the coverage area of ​​the structuring element, updates the gray value of the current pixel to the maximum value among these gray values, compares the dilated temporary image with the mask image pixel by pixel, takes the smaller gray value at each pixel position as the gray value of the new label image, compares the new label image with the label image before the iteration pixel by pixel. If the gray values ​​at all pixel positions have not changed, the iteration state is set to converged; otherwise, the iteration operation continues. The label image obtained after the iteration is completed is the core color-changing layer image.

[0063] Image difference processing is performed on the candidate color-changing image and the core color-changing layer image to obtain the halo layer image; The core color-changing layer image refers to the image data composed of continuous pixels adjacent to the color-changing line core in the color-changing region, which reflects the main distribution range of the color-changing region on the surface of the component; the halo layer image refers to the image data formed by the extended pixel region outside the core color-changing layer, which corresponds to the distribution part formed by the diffusion of the color-changing region to the surrounding area.

[0064] Specifically, a blank halo layer image with the same size as the color-changing candidate image is created. The grayscale values ​​of all pixels in the blank halo layer image are initialized to the background grayscale values. Each pixel position in the color-changing candidate image and the core color-changing layer image is traversed row by row and column by column. The grayscale value of that position in the color-changing candidate image and the grayscale value of that position in the core color-changing layer image are read. The difference between the grayscale value of the color-changing candidate image and the grayscale value of the core color-changing layer image is obtained. If the difference is greater than zero, the difference is used as the grayscale value of the corresponding position in the halo layer image. If the difference is less than or equal to zero, the grayscale value of that position in the halo layer image is kept as the background grayscale value. After traversing all pixel positions, the halo layer image is obtained.

[0065] Image encoding is performed on the grating event map and the halo layer image to obtain the halo tomography map.

[0066] Halo tomography refers to image data that represents the spatial distribution of discoloration areas on the surface of photovoltaic modules in layers. It is used to show the distribution of discoloration areas relative to the fine grid lines at different locations and the gradual expansion from the center outwards. It can reflect the spatial transition relationship of discoloration areas on the module surface from concentrated distribution to diffuse distribution, and show the distribution difference of discoloration areas near and far from the fine grid lines.

[0067] Read the image width, image height, and grayscale value of each pixel position of the raster event map; read the image width, image height, and grayscale value of each pixel position of the halo image; compare the image width and image height of the raster event map and the halo image; when the two dimensions are inconsistent, use the image width and image height of the raster event map as the target size to resample the halo image so that the resampled halo image has the same number of pixel rows and pixel columns as the raster event map; Create a blank multi-channel image with a first channel and a second channel. The image width and height of the blank multi-channel image are the same as those of the raster event map. Iterate through each pixel position of the raster event map row by row and column by column, and write the gray value of the current pixel position in the raster event map into the first channel of the blank multi-channel image at the same row and column coordinates. Iterate through each pixel position of the resampled halo image row by row and column by column, and write the gray value of the current pixel position in the halo image into the second channel of the blank multi-channel image at the same row and column coordinates. Store the pixel distribution corresponding to the raster event map in the first channel and the pixel distribution corresponding to the halo image in the second channel. After writing all the channels for all pixel positions, use the resulting multi-channel image as the halo tomography map.

[0068] S5. Obtain the first connected region corresponding to the halo tomography, and obtain the grid-around event kernel region based on the attachment segment, detachment segment and return segment of the first connected region; overlap the second connected region of the halo tomography with the grid-around event kernel region to obtain the halo-accompanying region. In an embodiment of the present invention, the obtained gate-around event core region includes: Obtain the first channel image of the halo tomography; Read the image width, image height, and number of channels of the halo tomography. Create a single-channel blank image with the same size as the halo tomography as the first channel image. Starting from the top left corner of the image, traverse each pixel position of the halo tomography row by row and column by column. Read the gray value of the first channel corresponding to the distribution state of the raster event at that pixel position. Write the read gray value to the same row and column coordinates in the first channel image. After writing the gray values ​​of all pixel positions, the first channel image is obtained.

[0069] Connectivity analysis was performed on the first channel image to obtain multiple first connected regions; The first channel image refers to the image data in the halo tomography used to express the distribution state of the grid-around event, which reflects the distribution of the spatial position change of the color-changing region relative to the fine grid line; the first connected region refers to the region in the first channel image composed of mutually adjacent and continuous gray-level pixels, which corresponds to the continuous distribution range of the color-changing region on the surface of the photovoltaic module.

[0070] Create a marker matrix with the same size as the first channel image. Initialize all elements in the marker matrix to an unvisited state and initialize the region number to 1. Starting from the top left corner of the image, traverse each pixel position of the first channel image row by row and column by column, reading the gray value of that pixel. If the gray value of the pixel is greater than the background gray value and the corresponding position in the marker matrix is ​​unvisited, create an empty pixel set, add the coordinates of the current pixel to the pixel set, mark the position of the current pixel in the marker matrix as visited and assign it the current region number. Then, check the positions of the eight adjacent pixels of the current pixel. If the adjacent pixels are in the image... If a pixel is within the image range and its grayscale value is greater than the background grayscale value, and the corresponding position in the marker matrix is ​​unvisited, then the coordinates of the adjacent pixel are added to the pixel set. The position of the adjacent pixel in the marker matrix is ​​marked as visited and assigned a current region number. The next pixel in the pixel set is then processed. The above adjacent pixel checking and marking operations are repeated until all pixels in the pixel set have been processed. The region number is incremented by one, and the process continues to traverse other unvisited pixel positions in the first channel image until all pixel positions have been traversed. Each pixel set with the same region number is a first connected region.

[0071] Determine the skeleton lines of the first connected region; Create an image to be processed with the same size as the image containing the first connected region. Initialize the gray values ​​of all pixels in the image to be processed to the background gray values. Traverse all pixel positions contained in the first connected region and set the gray values ​​of the corresponding positions in the image to be processed to the foreground gray values. Initialize the iteration flag to true. When the iteration flag is true, perform the iteration operation and set the iteration flag to false. Traverse all pixel positions in the image to be processed where the gray value is the foreground gray value. Obtain the gray values ​​of the eight neighboring pixels around the pixel. Count the number of pixels in the neighborhood where the gray value is the foreground gray value. Determine whether the pixel is an edge pixel. An edge pixel is a foreground pixel in the neighborhood where there is at least one background gray value pixel. Determine whether the connectivity of the connected region is destroyed after removing the pixel. The connectivity determination is achieved by counting the number of connected components of the foreground pixels in the neighborhood after removing the pixel. If the number of connected components is no more than one, removal will not destroy connectivity. Determine if the pixel is a skeleton endpoint. A skeleton endpoint is a foreground pixel with one foreground pixel in its neighborhood. If the pixel is an edge pixel and removal will not destroy connectivity and it is not a skeleton endpoint, then mark the pixel as a pixel to be removed. After one traversal, modify the grayscale value of all pixels to be removed to the background grayscale value. If there are pixels with modified grayscale values ​​in this iteration, reset the iteration flag to true. Repeat the iteration operation until the iteration flag is false. At this time, the remaining foreground pixels in the image to be processed form a continuous linear region with a single pixel width, completely preserving the spatial extension path and topological structure of the first connected region, which is the skeleton line of the first connected region.

[0072] Based on the skeleton line of the first connected region, determine the attachment segment, detachment segment, and return segment; The skeleton line refers to the central extension path extracted from the first connected region, which corresponds to the main distribution direction of the strain color region in space; the attached segment refers to the part of the skeleton line that is close to the spatial position of the fine grid line, which corresponds to the distribution of the strain color region close to the fine grid line; the detached segment refers to the part of the skeleton line that extends from the position close to the fine grid line to the position away from the fine grid line, which corresponds to the distribution process of the strain color region expanding from the position near the fine grid line to the distant region; the regressed segment refers to the part of the skeleton line that moves from the position away from the fine grid line back to the position near the fine grid line, which corresponds to the distribution process of the strain color region returning from the outside to the vicinity of the fine grid line.

[0073] Read the coordinates of all fine grid skeleton pixels in the fine grid skeleton image. Traverse the coordinates of each pixel in the first connected region skeleton line, calculate the Euclidean distance between that pixel and each fine grid skeleton pixel, and take the minimum value among all distances as the distance from that skeleton pixel to the fine grid line. Read the maximum distance value corresponding to the neighborhood band of the first layer of grid lines in the grid line distance image, and use this maximum distance value as the attachment distance threshold. Starting from one endpoint of the skeleton line, traverse each skeleton pixel sequentially along the extension direction of the skeleton line, record the distance value of each pixel, and mark pixels with multiple consecutive distance values ​​less than the attachment distance threshold as attachments. The process begins by traversing along the skeleton line from the end pixel of the attached segment. If the distance value of subsequent pixels shows a continuous increasing trend and eventually exceeds the attachment distance threshold, then the continuous pixels in this segment are marked as a detached segment. Starting from the end pixel of the detached segment, the process continues along the skeleton line. If the distance value of subsequent pixels shows a continuous decreasing trend and eventually falls below the attachment distance threshold, then the continuous pixels in this segment are marked as a reverted segment. This marking process for attached segments, detached segments, and reverted segments is repeated until all pixels of the skeleton line have been marked, ultimately resulting in the divided attached segments, detached segments, and reverted segments.

[0074] The first connected region that simultaneously contains the attachment segment, the detachment segment, and the return segment is identified as the candidate bypass event region. It should be noted that the first connected region containing the attachment segment, the detachment segment, and the return segment is identified as the candidate grid-wrap event region because the color change distribution on the surface of the photovoltaic module usually exhibits a continuous spatial change trajectory during the grid-wrap process, starting from the position close to the fine grid line, expanding outward, and then returning to the position near the fine grid line. A region containing only one or two of these segments cannot fully reflect this spatial change process. Only when the attachment segment, the detachment segment, and the return segment appear simultaneously in the same connected region can it be indicated that the color change distribution in that region has undergone a complete spatial back-and-forth change, thus corresponding to the actual distribution state of the grid-wrap behavior on the module surface.

[0075] The candidate grid-around event region refers to the first connected region that simultaneously contains the attachment segment, the detachment segment, and the return segment, and its corresponding strain color region generates spatial back-and-forth changes around the fine grid line.

[0076] The candidate gate-around event regions are joined to obtain the gate-around event core region.

[0077] The grid-around event core region refers to the region formed by merging multiple candidate grid-around event regions, which corresponds to the core distribution range where grid-around behavior occurs on the surface of the photovoltaic module.

[0078] Create a blank image with the same size as the first connected region. Initialize the gray values ​​of all pixels in the blank image to the background gray values. Traverse each candidate raster event region in the candidate raster event region set, read all pixel positions contained in the candidate raster event region, and set the gray values ​​of the corresponding row and column coordinate positions in the blank image to the foreground gray values. After all candidate raster event regions have been pixel-marked, the resulting image is the raster event kernel region.

[0079] In an embodiment of the present invention, the halo-associated region includes: Obtain the second channel image of the halo tomography; Read the image width, image height, and number of channels of the halo tomography. Create a single-channel blank image with the exact same image width and image height as the halo tomography. Use this single-channel blank image as the second channel image. Starting from the top left corner of the image, traverse each pixel position of the halo tomography row by row and column by column. Read the gray value of the second channel component corresponding to the halo layer distribution state at that position in the halo tomography. Write the read gray value to the pixel position with the same row and column coordinates in the second channel image. After traversing all pixel positions, the second channel image is obtained.

[0080] Connectivity analysis was performed on the second channel image to obtain multiple second connected regions; The second channel image refers to the image data in the halo tomography used to express the distribution state of the halo layer, which reflects the spatial distribution of the discoloration area as it expands outward from the core distribution range; the second connected region refers to the region in the second channel image composed of mutually adjacent and continuously grayscale pixels, which corresponds to the continuous distribution range of the halo layer on the surface of the photovoltaic module.

[0081] Create a marker matrix with the same size as the second channel image. Initialize all elements in the marker matrix to an unvisited state and initialize the region number to 1. Starting from the top left corner of the image, traverse each pixel position of the second channel image row by row and column by column, reading the gray value of that pixel. If the gray value of the pixel is greater than the background gray value and the corresponding position in the marker matrix is ​​unvisited, create an empty pixel set, add the coordinates of the current pixel to the pixel set, mark the position of the current pixel in the marker matrix as visited and assign it the current region number. Then, check the positions of the eight neighboring pixels of the current pixel. If the neighboring pixels are in the image... If a pixel is within the image range and its grayscale value is greater than the background grayscale value, and the corresponding position in the marker matrix is ​​unvisited, then the coordinates of the adjacent pixel are added to the pixel set. The position of the adjacent pixel in the marker matrix is ​​marked as visited and assigned a current region number. The next pixel in the pixel set is then processed. The above adjacent pixel checking and marking operations are repeated until all pixels in the pixel set have been processed. The region number is incremented by one, and the process continues to traverse other unvisited pixel positions in the second channel image until all pixel positions have been traversed. Each pixel set with the same region number is a second connected region.

[0082] The neighborhood expansion process is performed on the core region of the gate-around event to obtain the gate-around neighborhood region; Create an image to be processed with the same dimensions as the image containing the grid-around event kernel region. Initialize the grayscale values ​​of all pixels in the image to be processed to the background grayscale values. Iterate through all pixel positions contained in the grid-around event kernel region and set the grayscale values ​​of the corresponding row and column coordinate positions in the image to be processed to the foreground grayscale values. Create a square structuring element. The side length of the structuring element is determined according to the typical expansion width of the color-changing halo layer on the surface of the photovoltaic module. The center of the structuring element is located at its geometric center. Perform a morphological dilation operation on the image to be processed. The dilation operation iterates through each pixel position in the image to be processed, aligns the center of the structuring element with the current pixel position, reads the grayscale values ​​of all pixels within the coverage area of ​​the structuring element, and updates the grayscale value of the current pixel to the maximum value among these grayscale values. After the dilation operation is completed, the region composed of all foreground pixels in the resulting image is the grid-around neighborhood region.

[0083] Multiple second connected regions are overlapped with the surrounding gate neighborhood regions to obtain multiple overlapping regions; The surrounding neighborhood region refers to the region formed by the expansion of the surrounding event kernel region, and the spatial range in which a halo layer may be distributed around the surrounding event kernel region; the overlapping region refers to the pixel region jointly occupied by the second connected region and the surrounding neighborhood region at the same image position, and the position in which the halo layer distribution and the adjacent range of the surrounding event kernel region spatially overlap.

[0084] Create an empty set of overlapping regions. Traverse all second connected regions. Create a blank image with the same size as the image containing the second connected region. Initialize the gray values ​​of all pixels in the blank image to the background gray values. Traverse all pixel positions contained in the current second connected region. Read the gray values ​​of the corresponding row and column coordinate positions in the surrounding neighborhood region. If the gray value of the corresponding position in the surrounding neighborhood region is the foreground gray value, set the gray value of that position in the blank image to the foreground gray value. After traversing all pixels of the current second connected region, the region composed of all foreground pixels in the blank image is the overlapping region of the current second connected region and the surrounding neighborhood region. Add this overlapping region to the set of overlapping regions. Continue processing the next second connected region until all second connected regions have completed the overlapping process, resulting in multiple overlapping regions.

[0085] The second connected region with overlapping areas is identified as a candidate region for the halo layer. Create an empty halo candidate region set, traverse all second connected regions, obtain the overlapping region corresponding to the current second connected region, count the number of pixels in the overlapping region whose gray value is the foreground gray value, if the counted number of pixels is greater than zero, add the second connected region to the halo candidate region set, and after all second connected regions have completed the counting and judgment operations, obtain all halo candidate regions.

[0086] The candidate regions of the halo layer are subjected to union processing to obtain the halo layer associated regions.

[0087] The halo candidate region refers to the extended region related to the grid-around behavior in the color change distribution on the surface of the photovoltaic module. It corresponds to the color change part located outside the core color change range and extending outward. This region reflects the spatial distribution state of color change from concentrated distribution to outward diffusion. The halo accompanying region refers to the overall distribution range of the halo that is spatially adjacent to the grid-around event core region. It corresponds to the continuously extended color change region formed around the location where the grid-around behavior occurs and is used to characterize the peripheral color change distribution caused by the grid-around behavior.

[0088] Create a blank image with the same width and height as the image containing the second connected region. Initialize the gray values ​​of all pixels in the blank image to the background gray values. Iterate through each halo candidate region in the halo candidate region set, read the row and column coordinates of all pixels contained in the halo candidate region, and set the gray values ​​of the corresponding row and column coordinate positions in the blank image to the foreground gray values. After all halo candidate regions have completed the gray value setting operation for pixel positions, the region composed of all pixels in the blank image whose gray values ​​are foreground gray values ​​is the halo accompanying region.

[0089] S6. Determine the spatial overlap relationship between the core region of the grid-around event and the accompanying halo layer region to obtain the defect identification result.

[0090] In embodiments of the present invention, obtaining defect identification results includes: Determine whether the kernel region of the around-the-grid event and the halo layer accompanying region are located in the same local image region: When the core region of the grid-around event and the halo layer are located in the same local image region, the presence of a groove-around halo will be used as the defect identification result. Create a region marker image with the same size as the visible light image of the photovoltaic module. Set all pixels in the region marker image as background values. Write the pixel position corresponding to the core region of the grid-around event into the region marker image and set it as the first marker value. Write the pixel position corresponding to the halo layer accompanying region into the region marker image and set it as the second marker value. Read the row coordinate range and column coordinate range of the pixel corresponding to the first marker value. Read the row coordinate range and column coordinate range of the pixel corresponding to the second marker value. When the two row coordinate ranges have a common coverage area and the two column coordinate ranges have a common coverage area, the two regions are determined to be located in the same local image region, and the presence of a groove-around halo is taken as the defect identification result.

[0091] The first marker value refers to the pixel value used to identify the pixel position corresponding to the raster event kernel region in the region-marked image. It is used to distinguish the spatial position of the raster event kernel region in the image. The second marker value refers to the pixel value used to identify the pixel position corresponding to the halo layer accompanying region in the region-marked image. It is used to distinguish the spatial position of the halo layer accompanying region in the image. By distinguishing different marker values, the distribution of different regions can be clearly represented in the same image.

[0092] When the core region of the grid-around event and the halo layer accompanying region are not located in the same local image region, the absence of a grid-around halo with a hidden trench is taken as the defect identification result.

[0093] Read the row and column coordinate ranges of the pixels corresponding to the kernel region of the circumferential event, and read the row and column coordinate ranges of the pixels corresponding to the halo layer. When the two row coordinate ranges do not have a common coverage area or the two column coordinate ranges do not have a common coverage area, the two regions are determined to be not located in the same local image region, and the absence of a circumferential halo around the grating is taken as the defect identification result.

[0094] The term "groove-around-grid halo" refers to a discoloration distribution phenomenon that forms near the fine grid lines on the surface of a photovoltaic module, caused by changes in internal material stress, uneven current transmission, or local structural anomalies. This phenomenon manifests as a spatial change process in which the discoloration area is distributed close to the fine grid lines, deviates outward, and then approaches the fine grid lines again. At the same time, a gray-scale transition area that gradually expands outward from the center appears around this change path. This gray-scale transition area reflects the distribution state of the discoloration effect spreading from the concentrated area to the periphery.

[0095] The criterion for determining whether the core region of the grid-around event and the halo layer are located in the same local image region is because the actual manifestation of the grid-around halo on the surface of the photovoltaic module is that the color-changing center region and the halo layer formed by its outward expansion are closely adjacent in spatial position. The two reflect the same local abnormal distribution state. When the two are located in the same local area, it indicates that there are both concentrated changes and outward expansion changes in the region, which can correspond to the complete distribution of the grid-around halo. However, when the two are distributed in different local areas, it indicates that there is no spatial relationship between the color-changing center and the expansion area, and a complete grid-around diffusion process cannot be formed. Therefore, it does not constitute the actual distribution state of the grid-around halo.

[0096] It should be noted that the spatial overlap judgment between the core region of the grid-around event and the accompanying halo layer is because the target identified by this method is not ordinary linear color change, but grid-around diffusion defects formed near the fine grid lines in the color change channel on the surface of the photovoltaic module. This defect simultaneously includes a central change region that attaches, detaches, and reverts along the fine grid lines, as well as a halo layer region that expands outward around the central change region. Only when the core region of the grid-around event and the accompanying halo layer are located within the same local image range can it be said that the central change region and the outer diffusion region originate from the same local anomaly, and thus the presence of a grid-around diffusion type color change defect is taken as the defect identification result. If the two are not located within the same local image range, it indicates that there is no spatial correspondence between the central change region and the outer diffusion region, and it cannot be indicated that a complete grid-around diffusion type defect has been formed.

[0097] One embodiment of the present invention also provides a defect identification system for new energy power generation equipment; in this embodiment, the functions of each module / unit are as follows: The grid line extraction module obtains a fine grid line skeleton image based on the visible light image of the photovoltaic module; The repair and finishing module performs neighborhood expansion and union processing on the skeleton pixels in the fine grid skeleton image to obtain the repaired initial image, and performs morphological closing operation on the repaired initial image to obtain the connectivity finishing image. The grid-around imaging module generates multiple grid-line neighborhood band images based on the fine grid-line skeleton image, and performs overlapping and morphological reconstruction processing on the grid-line neighborhood band images and the connectivity sorting image to obtain the grid-around event map. The halo layer construction module obtains the core color-changing layer image within the raster event region and performs image difference on the core color-changing layer image to obtain the halo tomographic map. The halo extraction module obtains the first connected region corresponding to the halo tomography, and obtains the grid-around event kernel region based on the attachment segment, detachment segment and regress segment of the first connected region; the second connected region of the halo tomography is overlapped with the grid-around event kernel region to obtain the halo layer accompanying region; The overlap determination module determines the spatial overlap relationship between the core region of the grid-around event and the accompanying halo layer region, and obtains the defect identification result.

[0098] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A defect identification method for new energy power generation equipment, characterized in that, The process includes the following steps: obtaining a fine grid line skeleton image based on a visible light image of a photovoltaic module; Neighborhood expansion and union processing are performed on the skeleton pixels in the fine grid skeleton image to obtain the repaired initial image. Morphological closing operation is then performed on the repaired initial image to obtain the connectivity-sorted image. Multiple grid line neighborhood band images are generated based on the fine grid line skeleton image, and the grid line neighborhood band images and connectivity sorting images are overlapped and morphologically reconstructed to obtain the grid-around event map. The core color-changing layer image is obtained within the grid-around event region, and image difference is performed on the core color-changing layer image to obtain the halo tomography. Obtain the first connected region corresponding to the halo tomography, and obtain the grid-around event kernel region based on the attachment segment, detachment segment and regress segment of the first connected region; overlap the second connected region of the halo tomography with the grid-around event kernel region to obtain the halo-accompanying region; The spatial overlap relationship between the core region of the grid-around event and the accompanying halo layer is determined to obtain the defect identification result.

2. The defect identification method for new energy power generation equipment according to claim 1, characterized in that, Obtain the fine grid line skeleton image, including: Acquire visible light images of photovoltaic modules; Local contrast equalization processing is performed on the visible light image to obtain an illumination-equalized image; Multi-directional line structure enhancement is performed on the illumination-equalized image to obtain a line structure enhanced image; Automatic thresholding segmentation is performed on the line structure enhancement image to obtain candidate binary images of fine grid lines; The candidate binary image of the fine grid line is thinned to obtain the skeleton image of the fine grid line.

3. The defect identification method for new energy power generation equipment according to claim 2, characterized in that, The initial image for repair is obtained, including: Obtain the skeleton pixels in the fine grid skeleton image; Using each skeleton pixel as the center, the neighborhood of the skeleton pixel is expanded to obtain the local expanded region of the skeleton pixel. The grid line region is obtained by performing a union operation on the locally extended regions. The pixel values ​​of the pixels in the grid area are replaced to obtain the repaired initial image.

4. The defect identification method for new energy power generation equipment according to claim 1, characterized in that, The resulting connectivity-sorted image includes: Morphological reconstruction processing is performed on the repaired initial image to obtain a grid-suppressed image; A top-hat transform is performed on the grid-suppressed image to obtain a color-enhanced image; Morphological closing operations are performed on the color-enhanced image to obtain a connectivity-sorted image.

5. The defect identification method for new energy power generation equipment according to claim 1, characterized in that, The grid event graph is obtained, including: A distance transformation is performed on the fine grid line skeleton image to obtain a grid line distance image; The distance-layered processing of the grating distance image is performed to obtain multiple grating neighborhood band images; Use the connectivity-optimized image as a candidate image for color change; Each grid line neighborhood band image is overlaid with the color-changing candidate image to obtain a neighborhood color-changing overlay image. Morphological reconstruction is performed on the overlapping color-changing images in the neighborhood to obtain the reconstructed neighborhood image; Differential processing is performed on adjacent neighborhood reconstructed images to obtain interlayer variation images; By overlaying the images of interlayer changes, a grid-around event map is obtained.

6. The defect identification method for new energy power generation equipment according to claim 5, characterized in that, Obtain halo tomography, including: Determine the region of around-the-grid events based on the around-the-grid event graph; Within the area of ​​the grid-around event, the color-changing candidate image is thinned to obtain the color-changing line kernel image; Morphological reconstruction is performed on the color-changing candidate images to obtain the core color-changing layer image; Image difference processing is performed on the candidate color-changing image and the core color-changing layer image to obtain the halo layer image; Image encoding is performed on the grating event map and the halo layer image to obtain the halo tomography map.

7. The defect identification method for new energy power generation equipment according to claim 1, characterized in that, The core region of the around-gate event is obtained, including: Obtain the first channel image of the halo tomography; Connectivity analysis was performed on the first channel image to obtain multiple first connected regions; Determine the skeleton lines of the first connected region; Based on the skeleton line of the first connected region, determine the attachment segment, detachment segment, and return segment; The first connected region that simultaneously contains the attachment segment, the detachment segment, and the return segment is identified as the candidate bypass event region. The candidate gate-around event regions are joined to obtain the gate-around event core region.

8. The defect identification method for new energy power generation equipment according to claim 1, characterized in that, The halo layer and its associated region were obtained, including: Obtain the second channel image of the halo tomography; Connectivity analysis was performed on the second channel image to obtain multiple second connected regions; The neighborhood expansion process is performed on the core region of the gate-around event to obtain the gate-around neighborhood region; Multiple second connected regions are overlapped with the surrounding gate neighborhood regions to obtain multiple overlapping regions; The second connected region with overlapping areas is identified as a candidate region for the halo layer. The candidate regions of the halo layer are subjected to union processing to obtain the halo layer associated regions.

9. A defect identification method for new energy power generation equipment according to claim 1, characterized in that, The defect identification results obtained include: Determine whether the kernel region of the around-the-grid event and the halo layer accompanying region are located in the same local image region: When the core region of the grid-around event and the halo layer are located in the same local image region, the presence of a groove-around halo will be used as the defect identification result. When the core region of the grid-around event and the halo layer accompanying region are not located in the same local image region, the absence of a grid-around halo with a hidden trench is taken as the defect identification result.

10. A system applied to the defect identification method for new energy power generation equipment as described in any one of claims 1-9, characterized in that, The system includes: The grid line extraction module obtains a fine grid line skeleton image based on the visible light image of the photovoltaic module; The repair and finishing module performs neighborhood expansion and union processing on the skeleton pixels in the fine grid skeleton image to obtain the repaired initial image, and performs morphological closing operation on the repaired initial image to obtain the connectivity finishing image. The grid-around imaging module generates multiple grid-line neighborhood band images based on the fine grid-line skeleton image, and performs overlapping and morphological reconstruction processing on the grid-line neighborhood band images and the connectivity sorting image to obtain the grid-around event map. The halo layer construction module obtains the core color-changing layer image within the raster event region and performs image difference on the core color-changing layer image to obtain the halo tomographic map. The halo extraction module obtains the first connected region corresponding to the halo tomography, and obtains the grid-around event kernel region based on the attachment segment, detachment segment and regress segment of the first connected region; the second connected region of the halo tomography is overlapped with the grid-around event kernel region to obtain the halo layer accompanying region; The overlap determination module determines the spatial overlap relationship between the core region of the grid-around event and the accompanying halo layer region, and obtains the defect identification result.