A method for detecting surface defects of a flexible photovoltaic module based on machine vision
By using centroid point and Hu moment vector analysis to analyze wrinkle confidence and optimize edge pixel gradient values in the surface inspection of flexible photovoltaic modules, the interlayer peeling defect area of flexible photovoltaic modules can be identified, solving the problem of high false detection rate in existing technologies and improving the accuracy and efficiency of inspection.
Patent Information
- Application Number
- CN202511368876.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-24
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-09-24
AI Technical Summary
Existing technologies struggle to accurately identify interlayer peeling defects in flexible photovoltaic modules, leading to a high false detection rate and impacting detection efficiency and accuracy.
By acquiring suspected interference areas in grayscale images, the confidence of wrinkles is analyzed using centroid points and Hu moment vectors, the gradient values of edge pixels are optimized, and the Canny edge detection algorithm is used to identify interlayer peeling defect areas.
It significantly reduced the false detection rate caused by wrinkles, ensuring the accuracy of subsequent defect classification and location, and improving detection efficiency.
Smart Images

Figure CN120852432B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a flexible photovoltaic module surface defect detection method based on machine vision. BACKGROUND
[0002] Flexible photovoltaic modules are widely used in building integrated photovoltaics (BIPV) and power generation systems in various special environments due to their lightness, flexibility and ease of integration. These application scenarios have high safety requirements and strict requirements for power generation efficiency and stability. Therefore, it is required that the flexible photovoltaic module be strictly detected for defects before leaving the factory.
[0003] Due to the interlayer peeling defect in the flexible photovoltaic module, the bonding between the encapsulation layer and the cell sheet will fail, hindering the current transmission, causing the output power of the module to decrease and the power generation efficiency to decrease. At the same time, the peeling area is easy to accumulate water vapor and impurities, accelerating electrochemical corrosion, and more likely to produce cracks and peeling expansion in complex outdoor environments. In severe cases, it may cause local hot spot effect, bringing overheating and even fire safety hazards. Moreover, the polymer film substrate (such as ETFE, PEN, etc.), encapsulation material and new thin film photovoltaic material (such as thin film silicon, copper indium gallium selenide CIGS, organic photovoltaic, etc.) used in flexible modules are expensive, and the overall process production cost is high. Therefore, it is particularly important to detect the interlayer peeling defect in the flexible photovoltaic module.
[0004] The traditional method usually uses a Canny edge detection algorithm to detect the interlayer peeling defect area in the flexible photovoltaic module. However, during the production stage of the flexible photovoltaic module, the polymer film substrate will produce internal stress due to uneven thermal expansion or different cooling rates during lamination or cooling and winding processes. When the internal stress exceeds the elastic limit of the material, local micro undulations will appear on the surface of the film, forming wrinkles on the surface of the photovoltaic module. These wrinkles will change the local reflection intensity of the light source, and the image will show a patch-like area similar to interlayer peeling. This micro local undulation usually only affects the surface morphology and does not damage the bonding between the encapsulation layer and the cell sheet, nor does it affect the current transmission path, so it is not a defect area. The Canny edge detection algorithm only distinguishes edge pixels by the abrupt change of pixel gray scale gradient, and cannot distinguish the physical causes, resulting in the recognition of the wrinkle interference area and the formation of edges and target areas, so that the wrinkle area is retained in the subsequent detection analysis, interfering with the subsequent processing, and easily causing high false detection and reducing the defect detection efficiency.
[0005] Therefore, how to accurately identify the interlayer peeling defect area in the flexible photovoltaic module becomes a problem to be solved. SUMMARY
[0006] Therefore, the embodiment of the present application provides a flexible photovoltaic module surface defect detection method based on machine vision to solve the problem of how to accurately identify the interlayer peeling defect area in the flexible photovoltaic module.
[0007] The embodiment of the present application provides a flexible photovoltaic module surface defect detection method based on machine vision, which comprises the following steps:
[0008] An image of the flexible photovoltaic module to be detected is acquired, and a Canny edge detection algorithm is used to acquire at least one suspected interference area in the image.
[0009] A two-dimensional rectangular coordinate system is established with the lower left corner of the image as the origin, the horizontal direction as the horizontal axis, and the vertical direction as the vertical axis. The centroid point and the Hu moment vector of each suspected interference area are acquired in the two-dimensional rectangular coordinate system. The template Hu moment vector is acquired according to the centroid point and the Hu moment vector of each suspected interference area. The wrinkle confidence of each suspected interference area is acquired according to the position difference of the centroid point of each suspected interference area, the difference between the Hu moment vector of each suspected interference area and the template Hu moment vector, and the gray level change difference feature of the pixel points in each interference area.
[0010] At least one wrinkle interference area in the image is acquired according to the wrinkle confidence of each suspected interference area. The gradient value of the edge pixel points of each wrinkle interference area in the image is optimized according to the wrinkle confidence of each wrinkle interference area, and an optimized image is obtained.
[0011] The Canny edge detection algorithm is used to detect the optimized image, and the interlayer peeling defect area of the flexible photovoltaic module to be detected is identified.
[0012] Preferably, the centroid point and the Hu moment vector of each suspected interference area are acquired in the two-dimensional rectangular coordinate system, which comprises:
[0013] For any suspected interference area, the centroid of the suspected interference area is acquired in the two-dimensional rectangular coordinate system, and the pixel point where the centroid is located is recorded as the centroid point of the suspected interference area.
[0014] The Hu moment of the suspected interference area is acquired, and the Hu moment comprises seven invariant moments. For any invariant moment, the absolute value of the invariant moment is logarithmically transformed to obtain a logarithmic result, and the logarithmic result is normalized to obtain a normalized result of the invariant moment.
[0015] The normalized results of each invariant moment are acquired to form the Hu moment vector of the suspected interference area.
[0016] Preferably, the template Hu moment vector is obtained according to the center point of each suspected interference region and the Hu moment vector, comprising:
[0017] Fitting all the center points in the two-dimensional rectangular coordinate system to obtain a fitting straight line and at least one inner point, and grouping the elements of each dimension in the Hu moment vector of the suspected interference region where all the inner points are located to form an element set, dividing the elements in the element set into 7 element subsets according to the dimensions, and obtaining the median of each element subset to form a template Hu moment vector.
[0018] Preferably, the wrinkle confidence of each suspected interference region is obtained according to the position difference of the center point of each suspected interference region, the difference between the Hu moment vector of each suspected interference region and the template Hu moment vector, and the gray variation difference feature of the pixel points in each interference region.
[0019] For any suspected interference region, the first wrinkle confidence of the any suspected interference region is obtained according to the position difference between the center point of the any suspected interference region and the fitting straight line, and the difference between the Hu moment vector of the any suspected interference region and the template Hu moment vector.
[0020] The second wrinkle confidence of the any suspected interference region is obtained according to the gray variation difference feature of the pixel points in the any suspected interference region.
[0021] The wrinkle confidence of the any suspected interference region is obtained according to the average value between the first wrinkle confidence and the second wrinkle confidence of the any suspected interference region.
[0022] Preferably, the first wrinkle confidence of the any suspected interference region is obtained according to the position difference between the center point of the any suspected interference region and the fitting straight line, and the difference between the Hu moment vector of the any suspected interference region and the template Hu moment vector, comprising:
[0023] The ratio of the number of inner points to the number of all center points is obtained to obtain the first wrinkle feature value of the any suspected interference region.
[0024] The distance between the center point of the any suspected interference region and the fitting straight line is obtained, the distance is normalized to obtain a normalized distance value, the difference between the constant 1 and the normalized distance value is calculated to obtain the closeness of the any suspected interference region.
[0025] The absolute value of the difference between the Hu moment vector of any suspected interference region and the element of the same dimension in the template Hu moment vector is accumulated to obtain an element difference accumulation value, the element difference accumulation value is normalized to obtain a normalized element difference accumulation value, the difference between a constant 1 and the normalized element difference accumulation value is calculated to obtain the similarity degree of any suspected interference region;
[0026] The mean of the proximity and the similarity degree is obtained to obtain the second wrinkle feature value of any suspected interference region;
[0027] The product between the first wrinkle feature value and the second wrinkle feature value is obtained to obtain the first wrinkle confidence of any suspected interference region.
[0028] Preferably, the second wrinkle confidence of any suspected interference region is obtained according to the gray level change difference feature of the pixel points in the suspected interference region, comprising:
[0029] The gradient similarity degree of any suspected interference region is obtained according to the gradient distribution feature of the pixel points in the suspected interference region;
[0030] The gray value fluctuation degree of any suspected interference region is obtained according to the gray level distribution feature of the pixel points in the suspected interference region;
[0031] The second wrinkle confidence of any suspected interference region is obtained according to the mean between the gradient similarity degree and the gray value fluctuation degree.
[0032] Preferably, the gradient similarity degree of any suspected interference region is obtained according to the gradient distribution feature of the pixel points in the suspected interference region, comprising:
[0033] The edge pixel points of any suspected interference region are obtained, the pixel points in any suspected interference region except edge pixel points are recorded as internal pixel points, the gradient mean of all edge pixel points in any suspected interference region is obtained and recorded as edge gradient mean, the gradient mean of all internal pixel points in any suspected interference region is obtained and recorded as internal gradient mean;
[0034] The absolute value of the difference between the edge gradient mean and the internal gradient mean is normalized to obtain a normalized gradient difference value, and the difference between a constant 1 and the normalized gradient difference value is calculated to obtain the gradient similarity degree of any suspected interference region.
[0035] Preferably, the gray value fluctuation degree of any suspected interference region is obtained according to the gray level distribution feature of the pixel points in the suspected interference region, comprising:
[0036] Obtaining the average of the gray scale of all internal pixel points in the any suspected interference region, denoted as internal gray scale average, obtaining the mean difference of the gray scale value of the internal pixel points in the any suspected interference region, and performing normalization processing on the mean difference to obtain the gray scale value fluctuation degree of the any suspected interference region.
[0037] Preferably, the method further comprises:
[0038] If the wrinkle confidence of any suspected interference region is greater than a preset wrinkle confidence threshold, the any suspected interference region is a wrinkle interference region.
[0039] Preferably, the method further comprises:
[0040] For any edge pixel point in any wrinkle interference region, obtaining the difference between a constant 1 and the wrinkle confidence of the any wrinkle interference region to obtain an adjustment degree, and obtaining the product of the gradient value of the any edge pixel point and the adjustment degree to obtain the optimized gradient value of the any edge pixel point.
[0041] Obtaining the optimized gradient value of each edge pixel point in each wrinkle interference region in the gray scale image, and replacing the gradient value of each edge pixel point in each wrinkle interference region in the gray scale image with the optimized gradient value of each edge pixel point in each wrinkle interference region in the gray scale image to obtain an optimized image.
[0042] Compared with the prior art, the embodiment of the present application has the following beneficial effects:
[0043] The application obtains a gray image of a flexible photovoltaic module to be detected, uses a Canny edge detection algorithm to obtain at least one suspected interference region in the gray image; establishes a two-dimensional rectangular coordinate system with the lower left corner of the gray image as the origin, the horizontal direction as the horizontal axis, and the vertical direction as the vertical axis, obtains the center of mass point and the Hu moment vector of each suspected interference region in the two-dimensional rectangular coordinate system, obtains a template Hu moment vector according to the center of mass point and the Hu moment vector of each suspected interference region, and obtains the wrinkle confidence of each suspected interference region according to the position difference of the center of mass point of each suspected interference region, the difference between the Hu moment vector of each suspected interference region and the template Hu moment vector, and the gray level change difference feature of the pixel points in each interference region; at least one wrinkle interference region in the gray image is obtained according to the wrinkle confidence of each suspected interference region, the gradient value of the edge pixel points of each wrinkle interference region in the gray image is optimized according to the wrinkle confidence of each wrinkle interference region, and an optimized image is obtained; the optimized image is detected by using the Canny edge detection algorithm, and the interlayer peeling defect region of the flexible photovoltaic module to be detected is identified. Wherein, the wrinkle confidence of each suspected interference region is obtained according to the position difference of the center of mass point of each suspected interference region, the difference between the Hu moment vector of each suspected interference region and the template Hu moment vector, and the gray level change difference feature of the pixel points in each interference region, the possibility of analyzing the suspected interference region as a wrinkle interference region is analyzed, and then at least one wrinkle interference region in the gray image is obtained according to the wrinkle confidence of each suspected interference region; then the gradient value of the edge pixel points of each wrinkle interference region in the gray image is optimized according to the wrinkle confidence of each wrinkle interference region, and an optimized image is obtained, the Canny edge detection is performed on the optimized image, the wrinkle interference is effectively weakened on the basis of retaining the integrity of the edge of the real interlayer peeling region, the false detection rate caused by the wrinkle is significantly reduced, and the accuracy of subsequent defect classification and positioning is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative labor.
[0045] Figure 1 It is a method flow chart of a flexible photovoltaic module surface defect detection method based on machine vision provided by the first embodiment of the present application. DETAILED DESCRIPTION
[0046] Embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. The embodiments described below by reference to the drawings are exemplary and are intended to explain the present disclosure, and are not to be understood as limiting the present disclosure.
[0047] It should be noted that the terms "first", "second", and the like in the description of the present disclosure and the above drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation described in the following exemplary embodiments does not represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure.
[0048] In order to illustrate the technical solutions of the present application, the following will be described by specific embodiments.
[0049] Referring to Figure 1 , a method flow chart of a flexible photovoltaic module surface defect detection method based on machine vision provided by Embodiment One of the present application is shown in Figure 1 , which can include:
[0050] Step S101, obtaining a gray image of a flexible photovoltaic module to be detected, and using a Canny edge detection algorithm to obtain at least one suspected interference region in the gray image.
[0051] Flexible photovoltaic modules are widely used in building integration (BIPV) and power generation systems in various special environments due to their lightness, flexibility and ease of integration. These application scenarios have high safety requirements and strict requirements on power generation efficiency and stability, so flexible photovoltaic modules need to be strictly tested for defects before leaving the factory. Among them, the detection of interlayer peeling defects in flexible photovoltaic modules is particularly important.
[0052] In this embodiment, an industrial camera is used to take pictures of a flexible photovoltaic module to be detected fixed on a detection table to obtain a surface image of the flexible photovoltaic module. Then, the surface image is subjected to gray scale processing to obtain a gray image, and Gaussian filtering is used to remove high-frequency noise in the gray image, and histogram equalization is used to enhance contrast to highlight defect details, to obtain a processed gray image for defect detection. The gray scale processing, Gaussian filtering and histogram equalization belong to the prior art and will not be described here. The gray images described later in this embodiment are all processed gray images.
[0053] The traditional method usually uses a Canny edge detection algorithm to detect the interlayer peeling defect area in the flexible photovoltaic assembly, distinguishes the edge pixel points through the mutation of the pixel point gray gradient, and then connects the edge pixel points to obtain the defect area. However, during the production stage of the flexible photovoltaic assembly, the polymer film substrate will produce internal stress due to uneven thermal expansion or different cooling rates during the lamination or cooling and winding process. When the internal stress exceeds the elastic limit of the material, local micro undulations will appear on the surface of the film, and wrinkles will be formed on the surface of the photovoltaic assembly. The reflection intensity of these wrinkles under the light source changes locally, and the image shows a patch-like area similar to interlayer peeling. This micro local undulation usually only affects the surface morphology and does not damage the adhesion of the encapsulation layer and the cell piece, nor does it affect the current transmission path, so it is not a defect area. The Canny edge detection algorithm only distinguishes the edge pixel points through the mutation of the pixel point gray gradient, and cannot distinguish the physical causes, resulting in the recognition of the wrinkle interference area and the formation of the edge and the target area, so that the wrinkle area is retained in the subsequent detection analysis, which interferes with the subsequent processing and easily causes high false detection, reducing the defect detection efficiency.
[0054] Therefore, in the embodiment, first, a suspected interference area in a gray image of a flexible photovoltaic assembly to be detected is obtained, then a wrinkle confidence of each suspected interference area is obtained, and the wrinkle confidence of each suspected interference area is used to obtain at least one wrinkle interference area in the gray image. The gradient value of the edge pixel point of each wrinkle interference area is optimized to obtain an optimized image, and finally the Canny edge detection algorithm is used to detect the optimized image to accurately identify the interlayer peeling defect area in the flexible photovoltaic assembly.
[0055] The method for obtaining the suspected interference area in the gray image of the flexible photovoltaic assembly to be detected is as follows: the Canny edge detection algorithm is used to obtain the edge pixel points in the gray image, and then the edge pixel points in the gray image are connected by using morphological closing operation to obtain at least one suspected interference area. The Canny edge detection algorithm and the morphological closing operation belong to the prior art, and will not be described here.
[0056] In step S102, a two-dimensional rectangular coordinate system is established with the lower left corner of the gray image as the origin, the horizontal direction as the horizontal axis, and the vertical direction as the vertical axis. The centroid point and the Hu moment vector of each suspected interference area are obtained in the two-dimensional rectangular coordinate system. The template Hu moment vector is obtained according to the centroid point and the Hu moment vector of each suspected interference area. The wrinkle confidence of each suspected interference area is obtained according to the position difference of the centroid point of each suspected interference area, the difference between the Hu moment vector of each suspected interference area and the template Hu moment vector, and the gray variation difference feature of the pixel points in each interference area.
[0057] Due to the tension and compression stress on the polymer film substrate of the flexible photovoltaic module during lamination or cooling winding, when the film tension is uneven or the local friction / tension difference, the local stress concentration will be caused, thereby forming the wrinkle, but based on the standardized process of the production process, the continuous stress application and strong direction consistency of the roll direction and the compression roller direction are fixed, so the local stress concentration tends to form continuous or semi-continuous undulations along a specific direction, which leads to the fact that multiple wrinkle regions on the same flexible photovoltaic module show the characteristics of consistent direction and obvious extension trend in spatial distribution. At the same time, due to the constraints of production equipment and material physical properties, when the stress exceeds the elastic limit, the film substrate will deform in the way of minimum energy, and the shape (profile) of the wrinkle will appear high similarity on the surface of the same flexible photovoltaic module.
[0058] Therefore, taking the lower left corner of the gray image as the origin, the horizontal direction as the transverse axis, and the vertical direction as the longitudinal axis, a two-dimensional rectangular coordinate system is established, and the possibility of the suspected interference region being a wrinkle interference region can be judged according to the spatial distribution characteristics and shape similarity of each suspected interference region in the two-dimensional rectangular coordinate system. The specific method is as follows:
[0059] (1) Obtain the centroid point and Hu moment vector of each suspected interference region in the two-dimensional rectangular coordinate system.
[0060] Specifically, for any suspected interference region, the centroid of the any suspected interference region is obtained in the two-dimensional rectangular coordinate system, and the pixel point where the centroid is located is recorded as the centroid point of the any suspected interference region.
[0061] Obtain the Hu moment of the any suspected interference region, which includes 7 invariants. Due to the large difference in the magnitude of different orders, for any invariant, the absolute value of the any invariant is logarithmically transformed (logarithm with base 10), to obtain the logarithmic result, compress the overall difference, and then normalize the logarithmic result to obtain the normalized result of the any invariant.
[0062] Obtain the normalized result of each invariant to form the Hu moment vector of the any suspected interference region.
[0063] Similarly, the centroid point and Hu moment vector of each suspected interference region are obtained.
[0064] (2) Obtain the template Hu moment vector according to the centroid point and Hu moment vector of each suspected interference region.
[0065] Specifically, the RANSAC algorithm is used to fit all centroids in the two-dimensional rectangular coordinate system to obtain a fitted line and at least one interior point. The RANSAC algorithm is an existing technology and will not be described in detail here. The elements of each dimension of the Hu moment vector of the suspected interference region where all interior points are located are used to form an element set. The elements in the element set are divided into 7 element subsets according to the dimension. The median of each element subset is used to form the template Hu moment vector.
[0066] (3) For any suspected interference region, based on the positional difference between the centroid of the suspected interference region and the fitted straight line, and the difference between the Hu moment vector of the suspected interference region and the template Hu moment vector, the first wrinkle confidence of the suspected interference region is obtained.
[0067] Specifically, the ratio of the number of interior points to the total number of centroids is obtained to get the first fold feature value of any suspected interference region;
[0068] Obtain the distance between the centroid of any suspected interference region and the fitted straight line, normalize the distance to obtain a normalized distance value, calculate the difference between the constant 1 and the normalized distance value, and obtain the proximity of any suspected interference region.
[0069] The absolute values of the differences between the Hu moment vector of any suspected interference region and the elements of the same dimension in the template Hu moment vector are accumulated to obtain the element difference accumulation value. The element difference accumulation value is normalized to obtain the normalized element difference accumulation value. The difference between the constant 1 and the normalized element difference accumulation value is calculated to obtain the similarity of any suspected interference region.
[0070] The average of the proximity and similarity is obtained to obtain the second wrinkle feature value of any suspected interference region;
[0071] The product of the first wrinkle feature value and the second wrinkle feature value is obtained to obtain the first wrinkle confidence level of any suspected interference region.
[0072] In one implementation, the first Taking a suspected interference area as an example, the first... The formula for calculating the confidence level of the first fold of a suspected interference region is:
[0073]
[0074] in, For the first The confidence level of the first fold in a suspected interference region; m is the number of interior points; M is the number of centroids; For the first The distance between the centroid of a suspected interference region and the fitted line L; For the first The element of the t-th dimension in the Hu moment vector of a suspected interference region; Let be the element of the t-th dimension in the template Hu moment vector; This is the normalization function; 7 represents the absolute value symbol; 7 represents the number of elements in each Hu moment vector.
[0075] It should be noted that, For the first The first fold feature value of a suspected interference region, The larger the value, the more likely the centroids of suspected interference regions fall along the principal direction (the direction of the fitted line). This means that more suspected interference regions exhibit a clear consistency in direction and trend, which better matches the characteristic of folded interference regions exhibiting consistent direction in spatial distribution. The larger it is; For the first The proximity of suspected interference areas The larger the value, the more likely it is to be the first. The distance between the centroid of a suspected interference region and the fitted line L The smaller, the first The closer a suspected interference region is to the fitted straight line, that is, the closer it is to the principal direction of the suspected interference region, The larger it is; For the first The degree of similarity between suspected interference areas The larger the value, the more likely it is to be the first. The more the direction of the Hu moment vector in a suspected interference region matches the direction of the fitted line, the better. The larger it is.
[0076] Furthermore, due to the different formation mechanisms of delamination and wrinkling, there are still some obvious differences in the internal features of delamination defect areas and wrinkle interference areas in grayscale images. The main differences are as follows: Delamination is the separation between material layers, and the interface edge is a physical fracture or gap. Light is reflected abruptly at this interface, forming a strong jump between light and dark. Therefore, in grayscale images, the gradient value of the boundary of the delamination defect area is significantly higher than that of its internal area. In contrast, wrinkling is a continuous undulating deformation of the material surface. The boundary of the wrinkle interference area is not a sharp dividing line, but a texture transition area.
[0077] At the same time, the wrinkle is a deformation caused by uneven heating or stress concentration. When the light source irradiates the wrinkle surface, the incident angle and the reflection direction of each micro facet element are different, and the internal pixel points in the gray scale image thus present a sharp gray scale fluctuation. The interlayer peeling is an interface failure in the material, i.e. a local separation between two layers to generate a gap. The interlayer peeling changes the optical path (refractive index difference, reflection interface position change) of the region, but the internal cavity often makes the reflection of light relatively uniform. Except for the position where the refraction / reflection changes sharply at the boundary, the gray scale value of the internal pixel points in the gray scale image changes relatively stably.
[0078] Therefore, for any suspected interference region, the second wrinkle confidence of the any suspected interference region can be obtained according to the gray scale change difference feature of the pixel points in the any suspected interference region, and then the wrinkle confidence of the any suspected interference region can be obtained by combining the first wrinkle confidence and the second wrinkle confidence, which is used to judge whether the suspected interference region is a wrinkle interference region.
[0079] The method for obtaining the second wrinkle confidence of the any suspected interference region according to the gray scale change difference feature of the pixel points in the any suspected interference region is as follows:
[0080] (1) The gradient similarity degree of the any suspected interference region is obtained according to the gradient distribution feature of the pixel points in the any suspected interference region.
[0081] Specifically, the edge pixel points of the any suspected interference region are obtained, the pixel points in the any suspected interference region except the edge pixel points are recorded as internal pixel points, the gradient mean value of all the edge pixel points in the any suspected interference region is recorded as an edge gradient mean value, and the gradient mean value of all the internal pixel points in the any suspected interference region is recorded as an internal gradient mean value.
[0082] The absolute value of the difference between the edge gradient mean value and the internal gradient mean value is normalized to obtain a normalized gradient difference value, and the difference between the constant 1 and the normalized gradient difference value is calculated to obtain the gradient similarity degree of the any suspected interference region.
[0083] In an embodiment, the first suspected interference region is taken as an example, and the gradient similarity degree of the first suspected interference region is calculated as follows: The calculation formula of the gradient similarity degree of the first suspected interference region is as follows:
[0084]
[0085] wherein, is the gradient similarity degree of the first suspected interference region; is the gradient similarity degree of the first suspected interference region; is the gradient similarity degree of the first suspected interference region; a gradient value of an rth edge pixel point in the s th suspected interference region; N is a number of pixel points in the s th suspected interference region; a gradient value of an rth edge pixel point in the s th suspected interference region; N is a number of pixel points in the s th suspected interference region; a gradient value of an rth edge pixel point in the s th suspected interference region; N is a number of pixel points in the s th suspected interference region; is a normalization function; is an absolute value symbol.
[0086] It should be noted that, The smaller the value is, the closer the gradient values of the edge pixel points and the internal pixel points in the s th suspected interference region are, The larger the value is, the more intense the gradient value fluctuation of the internal pixel points in the s th suspected interference region is, The larger the value is, the more intense the gradient value fluctuation of the internal pixel points in the s th suspected interference region is,
[0087] (2) According to the gray level distribution characteristics of the pixel points in any suspected interference region, the gray level fluctuation degree of the suspected interference region is obtained.
[0088] Specifically, the gray level mean of all internal pixel points in the suspected interference region is obtained, which is denoted as internal gray level mean, the mean difference of the gray level values of the internal pixel points in the suspected interference region is obtained, and the mean difference is normalized to obtain the gray level fluctuation degree of the suspected interference region.
[0089] In an embodiment, taking the s th suspected interference region as an example, the calculation formula of the gray level fluctuation degree of the s th suspected interference region is:
[0090]
[0091] wherein, is the gray level fluctuation degree of the s th suspected interference region; is the gray level fluctuation degree of the s th suspected interference region; is the gray level value of an rth internal pixel point in the s th suspected interference region; N is a number of pixel points in the s th suspected interference region; n is a number of edge pixel points in the s th suspected interference region; is the gray level fluctuation degree of the s th suspected interference region; is a normalization function; is an absolute value symbol.
[0092] It should be noted that, The larger the mean difference of the gray level values of the internal pixel points in the s th suspected interference region is, The more intense the gray level fluctuation of the internal pixel points in the s th suspected interference region is, The larger the value is, the more intense the gray level fluctuation of the internal pixel points in the s th suspected interference region is, The larger the value is, the more intense the gray level fluctuation of the internal pixel points in the s th suspected interference region is, The larger the value is, the more intense the gray level fluctuation of the internal pixel points in the s th suspected interference region is,
[0093] (3) Based on the mean between the gradient similarity and the gray value fluctuation, the second fold confidence of any suspected interference region is obtained.
[0094] In one implementation, the first Taking a suspected interference area as an example, the first... The formula for calculating the confidence level of the second fold of a suspected interference region is as follows:
[0095]
[0096] in, For the first The second fold confidence level of a suspected interference region; For the first Gradient similarity of suspected interference regions; For the first The degree of grayscale value fluctuation in the suspected interference area.
[0097] It should be noted that, The larger it is, the more likely it is to be the first The closer the gradient values of edge pixels and internal pixels in a suspected interference region, the more it matches the characteristic that the boundary of the wrinkled interference region is a texture transition area. The larger it is; The larger it is, the more likely it is to be the first The more drastic the fluctuation in grayscale values of pixels within a suspected interference region, the more consistent it is with the characteristic of drastic grayscale fluctuations in pixels within a wrinkled interference region. The larger it is.
[0098] Furthermore, the method for obtaining the wrinkle confidence level of any suspected interference region by combining the first wrinkle confidence level and the second wrinkle confidence level is as follows:
[0099] The wrinkle confidence level of any suspected interference region is obtained by averaging the first wrinkle confidence level and the second wrinkle confidence level of any suspected interference region.
[0100] In one implementation, the first Taking a suspected interference area as an example, the first... The formula for calculating the confidence level of folds in a suspected interference region is as follows:
[0101]
[0102] in, For the first Confidence level of folds in a suspected interference region; For the first The first fold confidence level of a suspected interference region; For the first The second fold confidence level of the suspected interference region.
[0103] According to the above... The method for obtaining the wrinkle confidence score of each suspected interference region is as follows: Obtain the wrinkle confidence score for each suspected interference region. Thus, the wrinkle confidence score for each suspected interference region is obtained.
[0104] Step S103: Based on the wrinkle confidence of each suspected interference region, at least one wrinkle interference region in the grayscale image is obtained. Based on the wrinkle confidence of each wrinkle interference region, the gradient value of the edge pixel of each wrinkle interference region in the grayscale image is optimized to obtain an optimized image.
[0105] After obtaining the wrinkle confidence score for each suspected interference region, it is determined whether the suspected interference region is indeed a wrinkle interference region. The higher the wrinkle confidence score of a suspected interference region, the more likely it is to be a wrinkle interference region. Therefore, if the wrinkle confidence score of any suspected interference region is greater than the preset wrinkle confidence score threshold, then that suspected interference region is confirmed as a wrinkle interference region. Since setting the wrinkle confidence score threshold too high may cause some wrinkle interference regions to be missed, resulting in interference with defective regions, while setting it too low may cause actual defective regions to be misjudged as wrinkles, thus causing false detection, the preset wrinkle confidence score threshold is set to 0.65 in this embodiment. This is not a limitation and can be set according to the specific implementation scenario.
[0106] Since the presence of edge pixels in the wrinkle interference region will interfere with subsequent defect detection, it is necessary to optimize the gradient value of the edge pixels in each wrinkle interference region in the grayscale image based on the wrinkle confidence of each wrinkle interference region to obtain an optimized image for defect detection.
[0107] The method for optimizing the gradient value of the edge pixels of each wrinkle interference region in the grayscale image is as follows, based on the wrinkle confidence level of each wrinkle interference region:
[0108] For any edge pixel in any wrinkle interference region, the difference between the constant 1 and the wrinkle confidence of the wrinkle interference region is obtained to obtain the adjustment degree. The product of the gradient value of the edge pixel and the adjustment degree is obtained to obtain the optimized gradient value of the edge pixel.
[0109] In one embodiment, taking the j-th edge pixel in the i-th wrinkle interference region as an example, the formula for calculating the optimized gradient value of the j-th edge pixel in the i-th wrinkle interference region is as follows:
[0110]
[0111] wherein, is an optimized gradient value of the jth edge pixel point in the ith wrinkle interference region; is a gradient value of the jth edge pixel point in the ith wrinkle interference region; is a wrinkle confidence of the ith wrinkle interference region.
[0112] It should be noted that, The greater the value is, the more likely the ith wrinkle interference region is misidentified as a defect region when detected by using the Canny edge detection algorithm. Therefore, the gradient value of the jth edge pixel point in the ith wrinkle interference region needs to be reduced, and the smaller the value is.
[0113] Further, according to the method for obtaining the optimized gradient value of the jth edge pixel point in the ith wrinkle interference region, the optimized gradient value of each edge pixel point in each wrinkle interference region in the gray-scale image is obtained, and the optimized gradient value of each edge pixel point in each wrinkle interference region in the gray-scale image is replaced by the gradient value of each edge pixel point in each wrinkle interference region in the gray-scale image to obtain an optimized image.
[0114] Thus, the optimized image is obtained.
[0115] In step S104, the Canny edge detection algorithm is used to detect the optimized image to identify the interlayer peeling defect region of the flexible photovoltaic assembly to be detected.
[0116] After the optimized image is obtained, the Canny edge detection algorithm is used to detect defects in the optimized image to identify the interlayer peeling defect region of the flexible photovoltaic assembly to be detected. On the basis of retaining the integrity of the edges of the real interlayer peeling region, the wrinkle interference is effectively weakened, the false detection rate caused by the wrinkle is significantly reduced, and the accuracy of subsequent defect classification and positioning is ensured. Wherein, the Canny edge detection algorithm is used to detect defects in the optimized image, which belongs to the prior art, and will not be described here.
[0117] In summary, the embodiment of the present application obtains a gray image of a flexible photovoltaic module to be detected, and uses a Canny edge detection algorithm to obtain at least one suspected interference region in the gray image; a two-dimensional rectangular coordinate system is established with the lower left corner of the gray image as the origin, the horizontal direction as the horizontal axis, and the vertical direction as the vertical axis, the centroid point and the Hu moment vector of each suspected interference region are obtained in the two-dimensional rectangular coordinate system, the template Hu moment vector is obtained according to the centroid point and the Hu moment vector of each suspected interference region, the wrinkle confidence of each suspected interference region is obtained according to the position difference of the centroid point of each suspected interference region, the difference between the Hu moment vector of each suspected interference region and the template Hu moment vector, and the gray level change difference feature of the pixel points in each interference region; at least one wrinkle interference region in the gray image is obtained according to the wrinkle confidence of each suspected interference region, the gradient value of the edge pixel points of each wrinkle interference region in the gray image is optimized according to the wrinkle confidence of each wrinkle interference region, and an optimized image is obtained; the optimized image is detected using the Canny edge detection algorithm to identify the interlayer peeling defect region of the flexible photovoltaic module to be detected. Wherein, the wrinkle confidence of each suspected interference region is obtained according to the position difference of the centroid point of each suspected interference region, the difference between the Hu moment vector of each suspected interference region and the template Hu moment vector, and the gray level change difference feature of the pixel points in each interference region, the possibility of analyzing the suspected interference region as a wrinkle interference region, and then obtaining at least one wrinkle interference region in the gray image according to the wrinkle confidence of each suspected interference region; then the gradient value of the edge pixel points of each wrinkle interference region in the gray image is optimized according to the wrinkle confidence of each wrinkle interference region, and an optimized image is obtained, the Canny edge detection is performed on the optimized image, the wrinkle interference is effectively weakened on the basis of retaining the integrity of the edge of the real interlayer peeling region, the false detection rate caused by the wrinkle is significantly reduced, and the accuracy of subsequent defect classification and positioning is ensured.
[0118] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for detecting surface defects in a flexible photovoltaic module based on machine vision, characterized in that, The method comprises the following steps: An image of the flexible photovoltaic module is acquired, and a Canny edge detection algorithm is used to acquire at least one suspected interference region in the image; A two-dimensional rectangular coordinate system is established with the lower left corner of the image as the origin, the horizontal direction as the horizontal axis, and the vertical direction as the vertical axis. The centroid and the Hu moment vector of each suspected interference region are acquired in the two-dimensional rectangular coordinate system. A template Hu moment vector is acquired according to the centroid and the Hu moment vector of each suspected interference region. A wrinkle confidence of each suspected interference region is acquired according to the position difference of the centroid of each suspected interference region, the difference between the Hu moment vector of each suspected interference region and the template Hu moment vector, and the gray variation difference feature of the pixel points in each suspected interference region. At least one wrinkle interference region in the image is acquired according to the wrinkle confidence of each suspected interference region. The gradient value of the edge pixel points of each wrinkle interference region in the image is optimized according to the wrinkle confidence of each wrinkle interference region, and an optimized image is obtained. The optimized image is detected by using the Canny edge detection algorithm, and the interlayer peeling defect region of the flexible photovoltaic module is identified. The method comprises the following steps: For any suspected interference region, the centroid of the suspected interference region is acquired in the two-dimensional rectangular coordinate system. The pixel point at the centroid is recorded as the centroid point of the suspected interference region. The Hu moment of the suspected interference region is acquired. The Hu moment comprises seven invariant moments. For any invariant moment, the absolute value of the invariant moment is logarithmically transformed to obtain a logarithmic result. The logarithmic result is normalized to obtain a normalized result of the invariant moment. The normalized results of each invariant moment are acquired to form the Hu moment vector of the suspected interference region. The method comprises the following steps: All the centroid points in the two-dimensional rectangular coordinate system are fitted to obtain a fitting straight line and at least one inner point. The elements of each dimension in the Hu moment vector of the suspected interference region where all the inner points are located are combined to form an element set. The elements in the element set are divided into seven element sub-sets according to the dimensions. The median of each element sub-set is combined to form a template Hu moment vector.
2. A method for detecting surface defects of a flexible photovoltaic module based on machine vision according to claim 1, characterized in that, The method comprises the following steps: For any suspected interference region, a first wrinkle confidence of the suspected interference region is acquired according to the position difference between the centroid of the suspected interference region and the fitting straight line, and the difference between the Hu moment vector of the suspected interference region and the template Hu moment vector. According to the gray level change difference feature of the pixel points in the any suspected interference region, a second wrinkle confidence of the any suspected interference region is obtained; According to the mean value between the first wrinkle confidence and the second wrinkle confidence of the any suspected interference region, a wrinkle confidence of the any suspected interference region is obtained.
3. A method for detecting surface defects of a flexible photovoltaic module based on machine vision according to claim 2, characterized in that, The first wrinkle confidence of the any suspected interference region is obtained according to the position difference between the centroid point of the any suspected interference region and the fitting straight line, and the difference between the Hu moment vector of the any suspected interference region and the template Hu moment vector, comprising: A ratio of the number of inliers to the number of all centroid points is obtained to obtain a first wrinkle feature value of the any suspected interference region; A distance between the centroid point of the any suspected interference region and the fitting straight line is obtained, and a normalized distance value is obtained by normalizing the distance, and a difference between a constant 1 and the normalized distance value is calculated to obtain a proximity of the any suspected interference region; An element difference accumulation value is obtained by accumulating the absolute value of the difference between the same dimension elements in the Hu moment vector of the any suspected interference region and the template Hu moment vector, and a normalized element difference accumulation value is obtained by normalizing the element difference accumulation value, and a difference between a constant 1 and the normalized element difference accumulation value is calculated to obtain a similarity of the any suspected interference region; A mean value of the proximity and the similarity is obtained to obtain a second wrinkle feature value of the any suspected interference region; A product between the first wrinkle feature value and the second wrinkle feature value is obtained to obtain the first wrinkle confidence of the any suspected interference region.
4. The method for detecting surface defects of a flexible photovoltaic module based on machine vision according to claim 2, characterized in that, The second wrinkle confidence of the any suspected interference region is obtained according to the gray level change difference feature of the pixel points in the any suspected interference region, comprising: A gradient similarity of the any suspected interference region is obtained according to the gradient distribution feature of the pixel points in the any suspected interference region; A gray value fluctuation degree of the any suspected interference region is obtained according to the gray level distribution feature of the pixel points in the any suspected interference region; A mean value between the gradient similarity and the gray value fluctuation degree is obtained to obtain the second wrinkle confidence of the any suspected interference region.
5. A machine vision based method for detecting surface defects of a flexible photovoltaic module as claimed in claim 4, wherein, The gradient similarity of the any suspected interference region is obtained according to the gradient distribution feature of the pixel points in the any suspected interference region, comprising: Edge pixel points of the any suspected interference region are obtained, and pixel points other than the edge pixel points in the any suspected interference region are recorded as internal pixel points, a gradient mean value of all edge pixel points in the any suspected interference region is recorded as an edge gradient mean value, and a gradient mean value of all internal pixel points in the any suspected interference region is recorded as an internal gradient mean value; A normalized gradient difference value is obtained by normalizing the absolute value of the difference between the edge gradient mean value and the internal gradient mean value, and a difference between a constant 1 and the normalized gradient difference value is calculated to obtain the gradient similarity of the any suspected interference region.
6. The method for detecting surface defects of a flexible photovoltaic module based on machine vision according to claim 5, characterized in that, The gray value fluctuation degree of the any suspected interference region is obtained according to the gray distribution characteristics of the pixels in the any suspected interference region, and the method comprises the following steps: The gray mean value of all the internal pixels in the any suspected interference region is obtained, and is recorded as the internal gray mean value; the mean value difference of the gray values of the internal pixels in the any suspected interference region is obtained; and the mean value difference is normalized to obtain the gray value fluctuation degree of the any suspected interference region.
7. The method for detecting surface defects of a flexible photovoltaic module based on machine vision according to claim 1, wherein, The at least one wrinkle interference region in the gray image is obtained according to the wrinkle confidence of each suspected interference region, and the method comprises the following steps: If the wrinkle confidence of the any suspected interference region is greater than a preset wrinkle confidence threshold, the any suspected interference region is a wrinkle interference region.
8. The method for detecting surface defects of a flexible photovoltaic module based on machine vision according to claim 1, characterized in that, The gradient value of the edge pixel in each wrinkle interference region in the gray image is optimized according to the wrinkle confidence of each wrinkle interference region to obtain an optimized image, and the method comprises the following steps: For the any edge pixel in the any wrinkle interference region, the difference between a constant 1 and the wrinkle confidence of the any wrinkle interference region is obtained to obtain an adjustment degree; and the product of the gradient value of the any edge pixel and the adjustment degree is obtained to obtain the optimized gradient value of the any edge pixel; The optimized gradient value of each edge pixel in each wrinkle interference region in the gray image is obtained; and the optimized gradient value of each edge pixel in each wrinkle interference region in the gray image is substituted for the gradient value of each edge pixel in each wrinkle interference region in the gray image to obtain an optimized image.
Citation Information
Patent Citations
Corrugated paper production quality visual auxiliary detection method
CN116977358A
Case stamping quality detection method
CN117764990A