Photovoltaic frame hole defect automatic detection method and system, electronic equipment and medium
By constructing and updating standard hole templates, combined with perspective transformation and intersection ratio calculation, the automatic detection and accurate positioning of hole defects in photovoltaic frames is realized, which solves the problems of low detection accuracy and efficiency in the existing technology and improves the quality of photovoltaic cells. Production efficiency and quality.
Patent Information
- Application Number
- CN202410300467.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-03-15
AI Technical Summary
Existing technology cannot automatically detect and accurately locate hole defects in photovoltaic frames, resulting in low detection accuracy and efficiency. In addition, deep learning methods have not been fully researched and solved on the location and type of holes and the problems of over- and under-detection.
Provides an automatic detection method for photovoltaic frame hole defects. By obtaining the hole parameters and coordinate frame of the photovoltaic frame to be detected, it is judged that it matches the pre-constructed standard hole template. If it matches, it is processed to obtain the detection result. Otherwise, a matching standard hole is constructed. template and update it, and process the coordinate frame based on the updated template to obtain the detection results. The method includes target detection, parameter matching, hole defect detection and template construction modules, and uses perspective transformation matrix and intersection ratio calculation to identify and mark hole defects.
It achieves automatic identification of accurate positioning and type judgment of photovoltaic frame hole defects, avoids over-inspection and missed inspection, improves detection accuracy and efficiency, supports arbitrary layout switching without manual intervention, reduces energy costs, and promotes renewable energy development.
Smart Images

Figure CN118280859B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of photovoltaic modules, and specifically relates to a method and system for automatically detecting photovoltaic frame hole defects, electronic equipment and medium. Background Art
[0002] In the current energy field, photovoltaic modules, as an important clean energy device, are widely used in solar power generation systems. Photovoltaic cells, as the core components of photovoltaic modules, are mainly used to convert light energy into electrical energy.
[0003] The quality of photovoltaic cells is one of the key factors affecting their output performance and lifespan. However, due to defects or damage that may exist during the manufacturing process, such as missing holes or multiple holes in the frame of photovoltaic cells, the quality of the produced cells may be degraded, thereby reducing the overall performance of photovoltaic cells. These quality issues not only affect the power generation efficiency of photovoltaic cells, but may also have a negative impact on their service life.
[0004] At present, the inspection of photovoltaic cell borders mainly relies on manual visual inspection or traditional machine vision technology. However, these methods have many limitations and shortcomings. Manual inspection consumes a lot of time and human resources, and it is difficult to ensure accuracy and consistency. Traditional machine vision technology is limited by issues such as resolution, sensitivity and computing speed, and cannot meet the needs of high-precision and high-efficiency photovoltaic border hole defect detection.
[0005] Deep learning methods are also used in photovoltaic cell border defect detection. However, previous studies have mainly focused on hole detection on the cell border. The specific location and type of holes, as well as whether there are over-detection and missed detection, have not been fully studied and solved. The existence of these problems has limited the application of deep learning methods in cell border defect detection. Summary of the invention
[0006] The purpose of this application is to provide a method and system for automatic detection of photovoltaic frame hole defects, electronic equipment and medium, which are used to solve the technical problem that the existing technology cannot automatically detect and accurately locate photovoltaic frame hole defects, resulting in low detection accuracy and efficiency.
[0007] In a first aspect, the present application provides a method for automatically detecting hole defects in a photovoltaic frame, comprising: obtaining hole parameters and a hole coordinate frame of a photovoltaic frame to be detected; determining whether the hole parameters match a pre-constructed standard hole template; if so, processing the hole coordinate frame based on the standard hole template to obtain a hole defect detection result; otherwise, constructing a standard hole template that matches the hole parameters, and updating the pre-constructed standard hole template; processing the hole coordinate frame based on the updated standard hole template to obtain a hole defect detection result.
[0008] In an implementation of the first aspect, constructing a standard hole template that matches the hole parameters includes: step S410, obtaining the hole parameters of a specific type of photovoltaic frame; step S420, determining whether the hole parameters of the photovoltaic frame to be detected match the hole parameters of the specific type of photovoltaic frame; step S430, if they match, generating a standard hole template corresponding to the specific type of photovoltaic frame based on the hole coordinate frame of the photovoltaic frame to be detected; step S440, if they do not match, obtaining the hole parameters of another specific type of photovoltaic frame, and returning to step S420 until the standard hole template corresponding to the specific type of photovoltaic frame is constructed.
[0009] In an implementation of the first aspect, based on the hole coordinate frame of the photovoltaic frame to be detected, generating a standard hole template corresponding to the specific version of the photovoltaic frame includes: obtaining the corner point coordinates of the hole coordinate frame of the photovoltaic frame to be detected in the camera coordinate system as the corner point coordinates before perspective transformation; obtaining the corner point coordinates of the hole coordinate frame of the photovoltaic frame to be detected in the image coordinate system as the corner point coordinates after perspective transformation; calculating the perspective transformation matrix and the inverse perspective transformation matrix based on the corner point coordinates before the perspective transformation and the corner point coordinates after the perspective transformation; using the hole coordinate frame of the photovoltaic frame to be detected as the standard hole coordinate frame; using the standard hole coordinate frame, the perspective transformation matrix and the inverse perspective transformation matrix as parameters of the standard hole template.
[0010] In an implementation of the first aspect, obtaining the hole parameters and hole coordinate frame of the photovoltaic frame to be detected includes: collecting an image of the photovoltaic frame to be detected; performing target detection on the image of the photovoltaic frame to be detected to obtain the hole parameters and hole coordinate frame of the photovoltaic frame to be detected; the hole parameters include hole type and hole number.
[0011] In an implementation manner of the first aspect, it also includes: performing pixel expansion on the standard hole coordinate frame to obtain an expanded standard hole coordinate frame.
[0012] In an implementation of the first aspect, the hole coordinate frame is processed based on the updated standard hole template to obtain the hole defect detection result, including: using the perspective transformation matrix to perform a perspective transformation on the hole coordinate frame of the photovoltaic frame to be detected to obtain the transformed hole coordinate frame; calculating the intersection-and-union ratio between the transformed hole coordinate frame and the standard hole coordinate frame or the expanded standard hole coordinate frame; if the intersection-and-union ratio is greater than a preset value, it is determined that the hole of the photovoltaic frame to be detected is defective; if the intersection-and-union ratio is equal to the preset value, it is determined that the hole of the photovoltaic frame to be detected is defective, and the defective hole is marked on the image of the photovoltaic frame to be detected.
[0013] In an implementation of the first aspect, determining whether the hole of the photovoltaic frame to be inspected is defective includes: if the hole appears in the photovoltaic frame to be inspected but does not appear on the standard hole template, determining that the hole is an over-inspected hole; if the hole appears in the standard hole template but does not appear on the photovoltaic frame to be inspected, determining that the hole is a missed-detected hole.
[0014] In an implementation method of the first aspect, marking defective holes on the image of the photovoltaic frame to be inspected includes: recording the coordinates of the inspected holes mapped to the standard hole template as the inspected hole coordinates; recording the coordinates of the uninspected holes on the standard hole template as the uninspected hole coordinates; based on the inverse perspective transformation matrix, transforming the inspected hole coordinates and the uninspected hole coordinates to the image of the photovoltaic frame to be inspected, respectively, to obtain transformed inspected hole coordinates and transformed uninspected hole coordinates; marking unqualified marks at the transformed inspected hole coordinates and the transformed uninspected hole coordinates.
[0015] In the second aspect, the present application provides an automatic detection system for hole defects in a photovoltaic frame, including: a target detection module, used to obtain the hole parameters and hole coordinate frame of the photovoltaic frame to be detected; a parameter matching module, used to determine whether the hole parameters match a pre-built standard hole template; a hole defect detection module, used to process the hole coordinate frame based on the standard hole template when matching, to obtain a hole defect detection result; a template construction module, used to construct a standard hole template that matches the hole parameters when there is a mismatch, and update the pre-built standard hole template; the hole defect detection module is also used to process the hole coordinate frame based on the updated standard hole template to obtain a hole defect detection result.
[0016] In a second aspect, the present application provides an electronic device, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the electronic device performs any of the methods described above.
[0017] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements any of the methods described above when executed by a processor.
[0018] As described above, the photovoltaic frame hole defect automatic detection method and system, electronic device and medium described in this application have the following technical effects:
[0019] (1) It can automatically identify hole defects on photovoltaic frames and support the switching of any version without manual intervention, which improves the detection accuracy and efficiency and effectively solves the technical problem that hole defects on photovoltaic cells cannot be automatically detected and accurately located after being framed;
[0020] (2) It can determine the type of hole defects and avoid over-inspection and under-inspection of holes, which is of great significance to improving the production efficiency and quality of photovoltaic cells, reducing energy costs, and promoting the development of renewable energy. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 Shown is a schematic structural diagram of the photovoltaic assembly described in this embodiment in one embodiment.
[0022] Figure 2 Shown is a flow chart of an embodiment of the photovoltaic frame hole defect automatic detection method described in this embodiment.
[0023] Figure 3 Shown is a schematic structural diagram of the photovoltaic frame described in this embodiment in one embodiment.
[0024] Figure 4 Shown is a flow chart of another embodiment of the photovoltaic frame hole defect automatic detection method described in this embodiment.
[0025] Figure 5 Shown is a perspective transformation schematic diagram of an embodiment of the photovoltaic frame hole defect automatic detection method described in this embodiment.
[0026] Figure 6 Shown is a schematic diagram of a hole coordinate frame before and after perspective transformation in an embodiment of the photovoltaic frame hole defect automatic detection method described in this embodiment.
[0027] Figure 7Shown is a schematic diagram comparing a transformed hole coordinate frame and a standard hole coordinate frame in an embodiment of the photovoltaic frame hole defect automatic detection method described in this embodiment.
[0028] Figure 8 Shown is a schematic diagram of the structure of the photovoltaic frame hole defect automatic detection system in one embodiment of the present invention.
[0029] Fig. 9 Shown is a schematic structural diagram of the electronic device described in this embodiment in one embodiment.
[0030] Component number description
[0031] 81 Object Detection Module
[0032] 82 Parameter matching module
[0033] 83 Hole Defect Detection Module
[0034] 84 Template building blocks
[0035] 91 Memory
[0036] 92 processors DETAILED DESCRIPTION
[0037] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0038] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0039] In addition, in this application, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0040] Photovoltaic module refers to the smallest solar cell combination device with packaging and internal connections that can provide direct current alone and is indivisible. It is the core component of the photovoltaic power generation system and is composed of photovoltaic cells, glass, backplane, photovoltaic frame, junction box and silicone. As the core component of photovoltaic modules, photovoltaic cells are mainly used to convert light energy into electrical energy. Photovoltaic frames are used to encapsulate photovoltaic cells, glass, backplane and other materials, enhance the strength of photovoltaic modules, and facilitate transportation, installation and protection of photovoltaic modules. They are usually made of aluminum alloy materials with high strength, strong firmness and good conductivity.
[0041] See also Figure 1 , which is a schematic diagram of the structure of the photovoltaic assembly described in this embodiment. Figure 1 As shown, there are several holes of different sizes on the photovoltaic frame, including mounting holes, drainage holes and grounding holes. Specifically, the mounting holes are used to fix the photovoltaic module to the bracket or other mounting structure; the drainage holes are used to discharge the moisture that may enter the photovoltaic module to prevent damage caused by water accumulation; the grounding holes are used to ensure the electrical safety of the photovoltaic module and eliminate possible static electricity or current through grounding.
[0042] The following embodiments of the present application provide a method and system for automatically detecting hole defects in a photovoltaic frame, an electronic device, and a medium, which can automatically detect and locate hole defects on a photovoltaic frame, improve detection efficiency and accuracy, and ensure the quality and performance of photovoltaic modules. The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings in the embodiments of the present application.
[0043] like Figure 2 As shown, this embodiment provides a method for automatically detecting photovoltaic frame hole defects, including the following steps S10 to S50.
[0044] Step S10, obtaining hole parameters and hole coordinate frame of the photovoltaic frame to be detected.
[0045] Step S20: Determine whether the hole parameters match a pre-built standard hole template.
[0046] Step S30: If yes, the hole coordinate frame is processed based on the standard hole template to obtain a hole defect detection result.
[0047] Step S40: otherwise, construct a standard hole template matching the hole parameters, and update the pre-constructed standard hole template.
[0048] Step S50: Process the hole coordinate frame based on the updated standard hole template to obtain a hole defect detection result.
[0049] In one embodiment of the present application, the step S10 of obtaining the hole parameters and hole coordinate frame of the photovoltaic frame to be detected includes step S110 and step S120.
[0050] Step S110: collecting an image of the photovoltaic frame to be detected.
[0051] Specifically, three cameras are prepared and placed at three different positions on the left, middle and right of a horizontal line; the cameras are ensured to be fixed and stable, and to maintain an appropriate distance from the photovoltaic frame so as to clearly capture the image of the frame; the three cameras are triggered at the same time to capture the image of the photovoltaic frame to be detected, and three original images with different perspectives are obtained.
[0052] It should be noted that in order to improve the clarity of the image, a high-resolution camera can be selected. In addition, the angle of the camera can be adjusted appropriately according to the size and shape of the photovoltaic frame to ensure that different parts of the frame can be fully captured to avoid blind spots or occlusions. By splicing three original images from different perspectives, the photovoltaic frame can be transformed into the global coordinate system to obtain a photovoltaic frame image containing complete information.
[0053] See also Figure 3 , which is a schematic diagram of the structure of the photovoltaic frame described in this embodiment. Figure 3 As shown in the figure, after the three original images are stitched together, there are four borders: top, bottom, left, and right. There are several holes of different sizes distributed on the four borders ( Figure 3 Holes not shown).
[0054] Step S120: performing target detection on the image of the photovoltaic frame to be detected to obtain hole parameters and a hole coordinate frame of the photovoltaic frame to be detected.
[0055] In an embodiment of the present application, a commercially available open source deep learning target detection algorithm model may be used to perform target detection on the image of the photovoltaic frame to be detected.
[0056] Taking YOLO v8 as an example, the three collected original images are input into the computer system; the pre-trained YOLO v8 deep learning target detection algorithm model is used to process these images; the YOLO v8 model will analyze each original image, identify the holes in the image, and output the hole parameters and hole coordinate frame.
[0057] Specifically, the hole parameters include the hole type and the hole number. For example, the hole type can be circular or square; the hole number is the number of holes on the photovoltaic frame, that is, the sum of the number of holes on the photovoltaic frame detected based on the three original images. The hole coordinate frame is a rectangular frame surrounding each detected hole, which is used to locate the precise coordinates of the hole.
[0058] In one embodiment of the present application, the step S20 of determining whether the hole parameters of the photovoltaic frame to be detected match the pre-built standard hole template includes: loading the pre-built standard hole template from a database or a preset configuration file; and then comparing the hole parameters of the photovoltaic frame to be detected with the standard hole template.
[0059] In this embodiment, the pre-constructed standard hole template is related to a photovoltaic frame of a specific version, and the specific version may be the same as or different from the version of the photovoltaic frame to be detected. The holes on the photovoltaic frame of the specific version are standard holes. Usually, the hole parameters of the photovoltaic frame of a specific version are fixed. For example, the 182 version includes 12 mounting holes, 8 leakage holes, and 4 grounding holes; while the 210 version includes 8 mounting holes, 16 leakage holes, and 4 grounding holes.
[0060] Specifically, the pre-constructed standard hole template includes a standard hole coordinate frame, a perspective transformation matrix and a perspective inverse transformation matrix. The standard hole coordinate frame is a rectangular frame surrounding each standard hole, which is used to locate the precise coordinates of the standard hole. The perspective transformation matrix is used to realize the transformation from the camera coordinate system to the image coordinate system; and the perspective inverse transformation matrix is used to realize the transformation from the image coordinate system to the camera coordinate system.
[0061] See also Figure 4 , which is a flow chart of another embodiment of the photovoltaic frame hole defect automatic detection method described in this embodiment.
[0062] In one embodiment of the present application, if the hole parameters match the pre-built standard hole template in step S30, the hole coordinate frame of the photovoltaic frame to be detected is processed based on the standard hole template to obtain the hole defect detection result including:
[0063] Step S310, using the perspective transformation matrix, performing perspective transformation on the hole coordinate frame of the photovoltaic frame to be detected to obtain a transformed hole coordinate frame;
[0064] Step S320, calculating the intersection-and-union ratio between the transformed hole coordinate frame and the standard hole coordinate frame;
[0065] Step S330, if the intersection-and-joint ratio is greater than a preset value, it is determined that the hole of the photovoltaic frame to be inspected has no defects;
[0066] Step S340: If the intersection-and-joint ratio is equal to the preset value, it is determined that the hole of the photovoltaic frame to be detected is defective, and the defective hole is marked on the image of the photovoltaic frame to be detected.
[0067] Specifically, the preset value is 0.
[0068] In the embodiment of the present application, the perspective transformation matrix is used to correct the shape distortion caused by shooting angle, distance, pixel fluctuation, etc. Through perspective transformation, the detected hole coordinate frame can be transformed to a standard hole template for subsequent comparison and analysis.
[0069] See also Figure 5 , which is a schematic diagram of perspective transformation in an embodiment of the photovoltaic frame hole defect automatic detection method described in this embodiment. Figure 5 As shown, two ellipses are provided at both ends of the photovoltaic frame, and the ellipses represent corner points. A photovoltaic frame has two corner points and four coordinate points. The four coordinate points can determine the position and size of the photovoltaic frame, so as to perform accurate positioning and transformation operations.
[0070] In reality, the photovoltaic frame is not necessarily a strict straight line in the image, and may have a certain inclination angle (such as Figure 5 Through the perspective transformation matrix, the size and position relationship of the objects in the image can be adjusted to obtain a straight line border (as shown above). Figure 5 The perspective transformation is a nonlinear transformation that takes into account the perspective projection problem in three-dimensional space. It can transform objects that are straight lines in reality into straight lines that may appear as diagonal lines in the picture.
[0071] See also Figure 6 , which is a schematic diagram of a hole coordinate frame before and after perspective transformation of the photovoltaic frame hole defect automatic detection method described in this embodiment.
[0072] like Figure 6 As shown, the width and height of the photovoltaic frame before and after the perspective transformation remain consistent.
[0073] See also Figure 7, which is a schematic diagram showing a comparison between a transformed hole coordinate frame and a standard hole coordinate frame in an embodiment of the photovoltaic frame hole defect automatic detection method described in this embodiment.
[0074] In the embodiment of the present application, the intersection-over-union (IOU) is used to quantify the overlap between the two coordinate frames, so as to automatically identify the photovoltaic frame holes that do not meet the standards. Specifically, the IOU value is obtained by calculating the ratio of the area of the intersection area of the two coordinate frames to the area of the union area.
[0075]
[0076] Where A represents the area of the transformed hole coordinate frame, and B represents the area of the standard hole coordinate frame.
[0077] When IOU>0, it indicates that the transformed hole coordinate frame and the standard hole coordinate frame have an intersection, that is, the hole detected on the photovoltaic frame at this position meets the design standard. When IOU=0, it indicates that there is an over-detection or missed detection problem at this position.
[0078] Specifically, determining whether the hole of the photovoltaic frame to be inspected is defective includes:
[0079] Step S341: If a hole appears on the photovoltaic frame to be inspected but does not appear on the standard hole template, the hole is determined to be a hole that has passed inspection.
[0080] Step S342: If a hole appears in the standard hole template but does not appear on the photovoltaic frame to be detected, the hole is determined to be a missed hole.
[0081] Specifically, marking defective holes on the image of the photovoltaic frame to be inspected includes:
[0082] Step S343, recording the coordinates of the inspected hole mapped onto the standard hole template as the inspected hole coordinates;
[0083] Step S344, recording the coordinates of the missed hole on the standard hole template as the missed hole coordinates;
[0084] Step S645, based on the inverse perspective transformation matrix, transform the passed-detected hole coordinates and the missed-detected hole coordinates to the image of the photovoltaic frame to be detected, to obtain transformed passed-detected hole coordinates and transformed missed-detected hole coordinates;
[0085] Step S346, marking unqualified marks at the transformed passed-inspection hole coordinates and the transformed missed-inspection hole coordinates.
[0086] In an embodiment of the present application, by recording the coordinate positions of the holes that have passed the inspection and the holes that have missed the inspection, and using a unified inverse perspective transformation matrix to inversely transform these coordinate positions back to the image of the photovoltaic frame to be inspected, the positions of the problematic holes can be clearly marked on the image using NG marks.
[0087] It should be noted that the unqualified marks marked at the transformed passed-inspection hole coordinates and the transformed missed-inspection hole coordinates can be the same or different. For example, two different marks can be customized as needed to distinguish between passed-inspection and missed-inspection situations. This helps to more intuitively identify and distinguish different types of defects, thereby facilitating subsequent processing and analysis.
[0088] In one embodiment of the present application, if the hole parameters of the photovoltaic frame to be detected do not match the pre-constructed standard hole template in step S40, constructing a standard hole template that matches the hole parameters of the photovoltaic frame to be detected includes:
[0089] Step S410, obtaining hole parameters of a photovoltaic frame of a specific type.
[0090] Step S420, determining whether the hole parameters of the photovoltaic frame to be detected match the hole parameters of the photovoltaic frame of the specific version.
[0091] Step S430: If there is a match, a standard hole template corresponding to the photovoltaic frame of the specific version is generated based on the hole coordinate frame of the photovoltaic frame to be detected.
[0092] Step S440, if there is no match, then obtain the hole parameters of another specific type of photovoltaic frame, and return to step S420 until the standard hole template corresponding to the specific type of photovoltaic frame is constructed.
[0093] Through the above steps, this embodiment can determine the specific version of the photovoltaic frame to be detected, so as to construct a corresponding standard hole template.
[0094] In the embodiment of the present application, if the hole parameters of the photovoltaic frame to be detected cannot be completely matched with the pre-built standard hole template, it indicates that the pattern of the photovoltaic frame to be detected is inconsistent with the pattern corresponding to the standard template. This situation may mean that the battery cell or photovoltaic frame has switched to a new pattern, and the currently detected holes may conform to the number and type distribution of holes in the new pattern. At this time, it is necessary to match and model the new pattern, record the relevant hole frame transformation parameters, form a standard hole template for the new pattern, and replace the old standard hole template.
[0095] In the embodiment of the present application, the hole parameters of photovoltaic frames of different formats can be obtained from a format database.
[0096] In one embodiment of the present application, based on the hole coordinate frame of the photovoltaic frame to be detected, generating a standard hole template corresponding to the photovoltaic frame of the specific version includes:
[0097] Step S431, obtaining the corner point coordinates of the hole coordinate frame of the photovoltaic frame to be detected in the camera coordinate system as the corner point coordinates before perspective transformation.
[0098] Step S432, obtaining the corner point coordinates of the hole coordinate frame of the photovoltaic frame to be detected in the image coordinate system as the corner point coordinates after perspective transformation.
[0099] Step S433, calculating a perspective transformation matrix and an inverse perspective transformation matrix based on the corner point coordinates before the perspective transformation and the corner point coordinates after the perspective transformation.
[0100] Step S434, using the hole coordinate frame of the photovoltaic frame to be detected as a standard hole coordinate frame.
[0101] Step S435: using the standard hole coordinate frame, the perspective transformation matrix and the inverse perspective transformation matrix as parameters of the standard hole template.
[0102] In one embodiment of the present application, the method further includes: performing pixel expansion on the standard hole coordinate frame to obtain an expanded standard hole coordinate frame.
[0103] Specifically, the pixel expansion of the standard hole coordinate frame includes: determining the pixel coordinates of the standard hole coordinate frame in the coordinate system; based on these pixel coordinates, further obtaining the starting point coordinates and the width and height of the standard hole coordinate frame; and adjusting the size of the coordinate frame by expanding the standard hole coordinate frame by an equal amount of pixels up, down, left, and right.
[0104] In this implementation, by performing pixel expansion on the standard hole coordinate frame, the detection border of the hole can be widened to ensure that the hole and the standard hole template have a wide matching range during comparison, avoiding the situation where some errors lead to the inability to match within the range. For example, when comparing different coordinate frames, if pixel expansion is not performed, even if the two frames actually have an intersection, they may not match correctly due to the slight calculation error introduced by the perspective transformation matrix. This may lead to erroneous judgments. By manually setting the pixel expansion, the tolerance of the matching process is increased, thereby improving the fault tolerance rate and effectively avoiding the problem of matching failure due to calculation errors.
[0105] In one embodiment of the present application, the hole coordinate frame of the photovoltaic frame to be detected is processed based on the updated standard hole template to obtain the hole defect detection result including:
[0106] Step S610, using the perspective transformation matrix, performing perspective transformation on the hole coordinate frame of the photovoltaic frame to be detected to obtain a transformed hole coordinate frame;
[0107] Step S620, calculating the intersection-and-union ratio between the transformed hole coordinate frame and the standard hole coordinate frame or the expanded standard hole coordinate frame;
[0108] Step S630, if the intersection-and-joint ratio is greater than a preset value, it is determined that the hole of the photovoltaic frame to be inspected has no defects;
[0109] Step S640: If the intersection-and-joint ratio is equal to the preset value, it is determined that the hole of the photovoltaic frame to be detected is defective, and the defective hole is marked on the image of the photovoltaic frame to be detected.
[0110] In this embodiment, the preset value is 0.
[0111] Specifically, determining whether the hole of the photovoltaic frame to be inspected is defective includes:
[0112] Step S641: if a hole appears on the photovoltaic frame to be inspected but does not appear on the standard hole template, the hole is determined to be a hole that has passed inspection.
[0113] Step S642: If a hole appears in the standard hole template but does not appear on the photovoltaic frame to be detected, the hole is determined to be a missed hole.
[0114] Specifically, marking defective holes on the image of the photovoltaic frame to be inspected includes:
[0115] Step S643, recording the coordinates of the inspected hole mapped onto the standard hole template as the inspected hole coordinates;
[0116] Step S644, recording the coordinates of the missed hole on the standard hole template as the missed hole coordinates;
[0117] Step S645, based on the inverse perspective transformation matrix, transform the passed-detected hole coordinates and the missed-detected hole coordinates to the image of the photovoltaic frame to be detected, to obtain transformed passed-detected hole coordinates and transformed missed-detected hole coordinates;
[0118] Step S646, marking unqualified marks at the transformed passed-detected hole coordinates and the transformed missed-detected hole coordinates.
[0119] It should be noted that the unqualified marks marked at the transformed passed-inspection hole coordinates and the transformed missed-inspection hole coordinates can be the same or different. For example, two different marks can be customized as needed to distinguish between passed-inspection and missed-inspection situations. This helps to more intuitively identify and distinguish different types of defects, thereby facilitating subsequent processing and analysis.
[0120] It should be noted that the protection scope of the photovoltaic frame hole defect automatic detection method described in the embodiment of the present application is not limited to the execution order of the steps listed in this embodiment, and all solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0121] like Figure 8 As shown, this embodiment provides a photovoltaic frame hole defect automatic detection system, including:
[0122] The target detection module 81 is used to obtain the hole parameters and hole coordinate frame of the photovoltaic frame to be detected;
[0123] A parameter matching module 82, used to determine whether the hole parameters match a pre-built standard hole template;
[0124] A hole defect detection module 83 is used to process the hole coordinate frame based on the standard hole template during matching to obtain a hole defect detection result;
[0125] A template construction module 84, for constructing a standard hole template matching the hole parameters when there is no match, and updating the pre-constructed standard hole template;
[0126] The hole defect detection module 83 is further used to process the hole coordinate frame based on the updated standard hole template to obtain a hole defect detection result.
[0127] It should be noted that the structures and principles of the target detection module 81, the parameter matching module 82, the hole defect detection module 83 and the template construction module 84 correspond one by one to the steps in the above-mentioned photovoltaic frame hole defect automatic detection method, so they will not be repeated here.
[0128] like Fig. 9 As shown, this embodiment provides an electronic device, characterized in that it includes: a memory 91 and a processor 92.
[0129] The memory 91 is used to store computer programs.
[0130] The processor 92 is configured to execute the computer program stored in the memory 91 so that the electronic device executes any one of the above methods.
[0131] It should be noted that the photovoltaic frame hole defect automatic detection system provided in the embodiment of the present application can implement the photovoltaic frame hole defect automatic detection method described in the present application, but the implementation device of the photovoltaic frame hole defect automatic detection method described in the present application includes but is not limited to the structure of the photovoltaic frame hole defect automatic detection system listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0132] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.
[0133] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0134] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0135] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by the processor, the method described in any of the above items is implemented. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital videodisc, DVD)), or a semiconductor medium (e.g., a solid-state hard disk (solid state disk, SSD)), etc.
[0136] The present application embodiment may also provide a computer program product, the computer program product including one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer or data center.
[0137] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0138] In summary, the present application aims at the phenomenon of missing or porous holes in photovoltaic frames, and provides a method and system, electronic equipment and medium for automatic detection of photovoltaic frame hole defects. The present application first establishes standard hole templates of different versions, and then uses deep learning target detection methods to detect and identify the holes in the three-camera original image respectively. The holes are restored to the standard template through the perspective transformation template to perform intersection and union comparison of the hole detection frames, which can detect where the holes are missing or where the holes appear. The method provided by this application can effectively detect and locate the hole defects of photovoltaic cells after framing, and accurately classify and evaluate them, which can achieve high-precision and high-efficiency photovoltaic cell defect detection, and provide important support for the development of photovoltaic cell defect detection.
[0139] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0140] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A method for automatically detecting photovoltaic frame hole defects. It is characterized in that include: Obtain hole parameters and hole coordinate frame of the photovoltaic frame to be detected; Determining whether the hole parameters match a pre-built standard hole template; If yes, processing the hole coordinate frame based on the standard hole template to obtain a hole defect detection result; Otherwise, construct a standard hole template matching the hole parameters, and update the pre-constructed standard hole template; Processing the hole coordinate frame based on the updated standard hole template to obtain a hole defect detection result; Constructing a standard hole template matching the hole parameters includes: Step S410, obtaining hole parameters of a photovoltaic frame of a specific type; Step S420, determining whether the hole parameters of the photovoltaic frame to be detected match the hole parameters of the photovoltaic frame of the specific version; Step S430: if there is a match, a standard hole template corresponding to the photovoltaic frame of the specific version is generated based on the hole coordinate frame of the photovoltaic frame to be detected; Step S440, if there is no match, then obtain the hole parameters of another specific type of photovoltaic frame, and return to step S420 until the standard hole template corresponding to the specific type of photovoltaic frame is constructed.
2. The method according to claim 1, It is characterized in that Based on the hole coordinate frame of the photovoltaic frame to be detected, generating a standard hole template corresponding to the photovoltaic frame of the specific version includes: Obtaining the corner point coordinates of the hole coordinate frame of the photovoltaic frame to be detected in the camera coordinate system as the corner point coordinates before perspective transformation; Obtaining the corner point coordinates of the hole coordinate frame of the photovoltaic frame to be detected in the image coordinate system as the corner point coordinates after perspective transformation; Calculating a perspective transformation matrix and an inverse perspective transformation matrix based on the corner point coordinates before the perspective transformation and the corner point coordinates after the perspective transformation; Using the hole coordinate frame of the photovoltaic frame to be detected as a standard hole coordinate frame; The standard hole coordinate frame, the perspective transformation matrix and the inverse perspective transformation matrix are used as parameters of the standard hole template.
3. The method according to claim 1, It is characterized in that Obtaining the hole parameters and hole coordinate frame of the photovoltaic frame to be detected includes: Collecting images of the photovoltaic frame to be detected; Target detection is performed on the image of the photovoltaic frame to be detected to obtain hole parameters and a hole coordinate frame of the photovoltaic frame to be detected; the hole parameters include hole type and hole quantity.
4. The method according to claim 2, It is characterized in that Also includes: The standard hole coordinate frame is pixel-expanded to obtain an expanded standard hole coordinate frame.
5. The method according to claim 4, It is characterized in that Processing the hole coordinate frame based on the updated standard hole template to obtain the hole defect detection result includes: Using the perspective transformation matrix, the hole coordinate frame of the photovoltaic frame to be detected is perspective transformed to obtain a transformed hole coordinate frame; Calculating an intersection-and-union ratio between the transformed hole coordinate frame and the standard hole coordinate frame or the expanded standard hole coordinate frame; If the intersection-and-combination ratio is greater than a preset value, it is determined that the hole of the photovoltaic frame to be inspected has no defects; If the intersection-and-joint ratio is equal to the preset value, it is determined that the hole of the photovoltaic frame to be detected is defective, and the defective hole is marked on the image of the photovoltaic frame to be detected.
6. The method according to claim 5, It is characterized in that Determining whether the hole of the photovoltaic frame to be inspected is defective includes: If a hole appears on the photovoltaic frame to be inspected but does not appear on the standard hole template, the hole is determined to be an uninspected hole; If a hole appears in the standard hole template but does not appear on the photovoltaic frame to be detected, the hole is determined to be a missed hole.
7. The method according to claim 6, It is characterized in that Marking defective holes on the image of the photovoltaic frame to be inspected includes: Recording the coordinates of the inspected hole mapped onto the standard hole template as the inspected hole coordinates; Recording the coordinates of the missed hole on the standard hole template as the missed hole coordinates; Based on the inverse perspective transformation matrix, the passed-detected hole coordinates and the missed-detected hole coordinates are transformed to the image of the photovoltaic frame to be inspected, to obtain transformed passed-detected hole coordinates and transformed missed-detected hole coordinates; Unqualified marks are marked at the transformed passed-inspection hole coordinates and the transformed missed-inspection hole coordinates.
8. An automatic detection system for photovoltaic frame hole defects, It is characterized in that include: The target detection module is used to obtain the hole parameters and hole coordinate frame of the photovoltaic frame to be detected; A parameter matching module, used to determine whether the hole parameters match a pre-built standard hole template; A hole defect detection module, used for processing the hole coordinate frame based on the standard hole template during matching to obtain a hole defect detection result; A template construction module, used for constructing a standard hole template matching the hole parameters when there is no match, and updating the pre-constructed standard hole template; The hole defect detection module is also used to process the hole coordinate frame based on the updated standard hole template to obtain a hole defect detection result; Constructing a standard hole template matching the hole parameters includes: Step S410, obtaining hole parameters of a photovoltaic frame of a specific type; Step S420, determining whether the hole parameters of the photovoltaic frame to be detected match the hole parameters of the photovoltaic frame of the specific version; Step S430: if there is a match, a standard hole template corresponding to the photovoltaic frame of the specific version is generated based on the hole coordinate frame of the photovoltaic frame to be detected; Step S440, if there is no match, then obtain the hole parameters of another specific type of photovoltaic frame, and return to step S420 until the standard hole template corresponding to the specific type of photovoltaic frame is constructed.
9. An electronic device, It is characterized in that include: Processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory so as to enable the electronic device to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
