Photovoltaic cell grid line detection method based on machine vision and terminal
Through machine vision technology, the silicon wafer area is positioned using threshold segmentation and morphology processing of channel images, the gate line features are extracted and detected, and the gray value variance is calculated to determine the thick line area, which solves the problem of low generalization and time detection in the prior art The high cost problem achieves efficient and accurate photovoltaic cell grid line detection.
Patent Information
- Application Number
- CN202411010460.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-12
AI Technical Summary
The existing photovoltaic cell grid line detection method has low generalization when detecting thick line defects, which can easily lead to misjudgment. The template matching positioning method increases the detection time cost and cannot correctly match the grid line offset situation. Causes detection failure.
Using a machine vision-based detection method, by acquiring the image to be tested and converting it into a channel image, first threshold segmentation, first morphological processing and affine transformation are performed to locate the silicon wafer area, crop the image to exclude the background, and extract the gate line area. , and calculate the thickness of the line by the second threshold value segmentation and gray value variance to avoid misjudgment caused by exposure.
It improves the accuracy and efficiency of grid line detection of photovoltaic cell cells, reduces detection time, effectively avoids misjudgment caused by exposure, and enhances the detection accuracy of line thickness defects.
Smart Images

Figure CN118941534A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a photovoltaic cell grid line detection method and terminal based on machine vision. Background Art
[0002] In recent years, the width of the screen-printed grid lines of photovoltaic cells has gradually decreased, so as to save slurry and reduce costs as much as possible while ensuring the solar energy conversion efficiency. However, as the width of the grid lines decreases, the difficulty of printing will also increase. Therefore, photovoltaic cells may have thick grid lines and virtual printing. Among them, the thick grid line defect mainly refers to the fact that when the photovoltaic cell is printing the grid lines, due to excessive slurry or other process problems, the thickness of a part of the grid line exceeds the normal range, making the thickness of each grid line of the photovoltaic cell uneven. At present, in order to detect the defect of thick grid lines of photovoltaic cells, some studies first obtain a template of the grid line area based on a standard cell, and then locate the grid line area in the cell to be tested based on the template, and then convert it into a width value through a quantized grayscale method. Finally, it is judged whether the grid line is thick based on the quantized grid line width. There are also studies that extract the grid line area through Blob (connected area) analysis, and then judge whether the grid line is thick through a quantized grayscale method or by comparing the grid line template and the extracted grid line area.
[0003] However, some cells may be affected by exposure and other factors during imaging, causing the grayscale value of normal gate lines to increase. The method of converting the quantized grayscale into width alone to determine whether it is a line thickness defect has low generalization and is prone to misjudgment. In addition, although the template matching method is usually effective in locating the gate line area or detecting line thickness, it will greatly increase the time cost of detection, and if the gate line is slightly offset, it may not be able to correctly match the gate line area, resulting in failure to detect normally. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a photovoltaic cell grid line detection method and terminal based on machine vision, which can improve the detection efficiency while realizing accurate detection of grid line coarse defects.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A photovoltaic cell grid line detection method based on machine vision, comprising:
[0007] Acquire an image to be tested, and convert the image to be tested into a channel image;
[0008] Performing a first threshold segmentation, a first morphological processing and an affine transformation on the channel image in sequence to obtain a target silicon wafer area;
[0009] According to the target silicon wafer area, the image to be tested and the channel image are respectively cropped to obtain a silicon wafer image;
[0010] Extracting a gate line region from the silicon wafer image based on gate line features;
[0011] Cutting the silicon wafer image according to the gate line area to obtain a gate line image;
[0012] Performing a second threshold segmentation on the gate line image to obtain a target area to be tested, and calculating the grayscale value variance in the target area to be tested;
[0013] It is detected whether the gray value variance of the target area to be tested is greater than a preset threshold value. If so, the target area to be tested is marked as a thick line area.
[0014] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0015] A photovoltaic cell grid line detection terminal based on machine vision comprises a memory, a processor and a computer program stored in the memory and running on the processor. When the processor executes the computer program, each step of the above-mentioned photovoltaic cell grid line detection method based on machine vision is implemented.
[0016] The beneficial effects of the present invention are: the image to be tested of the photovoltaic cell is converted into a channel image, and the target silicon wafer area is determined by performing a first threshold segmentation, a first morphological treatment and an affine transformation on the channel image, so as to respectively cut the image to be tested and the channel image to obtain the silicon wafer image, thereby eliminating the useless background in the image to be tested. The gate line area is extracted from the silicon wafer image by the gate line feature to exclude some interference areas, so as to ensure the accuracy of the subsequent detection area. The gate line image is obtained based on the gate line area, and after the gate line image is subjected to a second threshold segmentation, the gray value variance in the target area to be tested is calculated, and the line thick area is determined based on the gray value variance. Since there is an exposure problem in the imaging process, the pixel values of the normal gate line and the surrounding area are significantly improved, so the gray value variance in the detection area can effectively avoid the misjudgment caused by exposure, and the detection accuracy of the line thick defect is effectively improved. In addition, compared with the existing template matching positioning method, the present invention only uses basic threshold segmentation and morphological processing to locate the area, and the algorithm consumes less time, which can effectively improve the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A flowchart of a photovoltaic cell grid line detection method based on machine vision provided by an embodiment of the present invention;
[0018] Figure 2Another flow chart of a photovoltaic cell grid line detection method based on machine vision provided by an embodiment of the present invention;
[0019] Figure 3 A schematic diagram of a thick line area of a photovoltaic cell grid line detection method based on machine vision provided by an embodiment of the present invention;
[0020] Figure 4 A schematic diagram of the structure of a photovoltaic cell grid line detection terminal based on machine vision provided by an embodiment of the present invention;
[0021] Description of labels:
[0022] 100. A photovoltaic cell grid line detection terminal based on machine vision; 101. Memory; 102. Processor. DETAILED DESCRIPTION
[0023] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0024] The embodiment of the present invention provides a photovoltaic cell grid line detection method based on machine vision, comprising:
[0025] Acquire an image to be tested, and convert the image to be tested into a channel image;
[0026] Performing a first threshold segmentation, a first morphological processing and an affine transformation on the channel image in sequence to obtain a target silicon wafer area;
[0027] According to the target silicon wafer area, the image to be tested and the channel image are respectively cropped to obtain a silicon wafer image;
[0028] Extracting a gate line region from the silicon wafer image based on gate line features;
[0029] Cutting the silicon wafer image according to the gate line area to obtain a gate line image;
[0030] Performing a second threshold segmentation on the gate line image to obtain a target area to be tested, and calculating the grayscale value variance in the target area to be tested;
[0031] It is detected whether the gray value variance of the target area to be tested is greater than a preset threshold value. If so, the target area to be tested is marked as a thick line area.
[0032] As can be known from the above description, the beneficial effects of the present invention are: the image to be tested of the photovoltaic cell is converted into a channel image, and the target silicon wafer area is determined by performing the first threshold segmentation, the first morphological treatment and the affine transformation on the channel image, thereby cutting the image to be tested and the channel image respectively to obtain the silicon wafer image, thereby eliminating the useless background in the image to be tested. The gate line area is extracted from the silicon wafer image by the gate line feature to exclude some interference areas, so as to ensure the accuracy of the subsequent detection area. The gate line image is obtained based on the gate line area, and after the gate line image is performed the second threshold segmentation, the gray value variance in the target area to be tested is calculated again, and the line thick area is determined based on the gray value variance. Due to the exposure problem in the imaging process, the normal gate line and the surrounding area pixel values will be significantly improved, so the gray value variance in the detection area can effectively avoid the misjudgment caused by exposure, and the detection accuracy of the line thick defect is effectively improved. In addition, compared with the existing template matching positioning method, the present invention only uses the basic threshold segmentation and morphological treatment positioning area, and the algorithm consumes less time, which can effectively improve the detection efficiency.
[0033] Furthermore, converting the image to be tested into a channel image comprises:
[0034] Convert the image to be tested into a first channel image in RGB color space;
[0035] The target silicon wafer region is obtained by sequentially performing the first threshold segmentation, the first morphological processing and the affine transformation on the channel image as follows:
[0036] The first channel image is sequentially subjected to first threshold segmentation, first morphological processing and affine transformation to obtain a target silicon wafer region.
[0037] As can be seen from the above description, the first channel image is an image in the RGB color space, where the RGB color space includes the R (red) channel, the G (green) channel, and the B (blue) channel. Since different regions have different features in different color spaces, and the features of the silicon wafer region in the RGB color space are more obvious, the silicon wafer region can be accurately located through the first channel image.
[0038] Further, the step of sequentially performing first threshold segmentation, first morphological processing, and affine transformation on the first channel image to obtain the target silicon wafer area includes:
[0039] Performing a first threshold segmentation and a first morphological processing on the first channel image to obtain a rough silicon wafer area;
[0040] Measuring the contour line of the rough silicon wafer area, and determining the coordinate information of the rough silicon wafer area according to the contour line;
[0041] Affine transformation is performed on the rough silicon wafer area according to the coordinate information to obtain a target silicon wafer area.
[0042] From the above description, it can be seen that the rough silicon wafer area is first located through the first threshold segmentation and the first morphological processing, and then the coordinate information is determined through the contour line of the area. Based on the coordinate information, the target silicon wafer area is corrected through affine transformation to eliminate the interference of non-silicon wafer areas, thereby effectively improving the positioning accuracy of the silicon wafer area.
[0043] Furthermore, converting the image to be tested into a channel image further comprises:
[0044] Converting the image to be tested into a second channel image in the CIEXYZ color space;
[0045] The silicon wafer image includes a first silicon wafer image and a second silicon wafer image;
[0046] The step of clipping the image to be tested and the channel image according to the target silicon wafer area to obtain the silicon wafer image comprises:
[0047] Cropping the image to be tested according to the target silicon wafer area to obtain a first silicon wafer image;
[0048] Cropping the second channel image according to the target silicon wafer area to obtain a second silicon wafer image;
[0049] The step of cropping the silicon wafer image according to the gate line area to obtain the gate line image is specifically as follows:
[0050] The second silicon wafer image is cropped according to the gate line area to obtain a gate line image.
[0051] As can be seen from the above description, the second channel image is an image under the CIEXYZ color space. The CIEXYZ color space is a color space based on human visual perception, which can more accurately represent the colors seen by the human eye, wherein the CIEXYZ color space includes an X (red stimulus value) channel, a Y (green stimulus value) and a Z (blue stimulus value). By accurately positioning the target silicon wafer area, different channel images are cut to obtain silicon wafer images of the target silicon wafer area under different color spaces, so as to facilitate the subsequent identification and positioning of the gate lines in the silicon wafer area. In addition, since the characteristics of the gate line thick defect under the second channel image are more obvious, the gate line image is determined based on the second silicon wafer image cut out from the second channel image to perform the line thick detection step to ensure the accuracy of the subsequent line thick detection.
[0052] Further, the grid line features include a harpoon line area feature and a main grid line ellipse length feature, and the grid line region includes a harpoon line region and a main grid line region;
[0053] The extracting of the gate line area from the silicon wafer image based on the gate line feature comprises:
[0054] Converting the first silicon wafer image into an original grayscale image;
[0055] Performing image enhancement on the original grayscale image to obtain a first grayscale image, and performing mean filtering on the first grayscale image to obtain a second grayscale image;
[0056] Subtracting the second grayscale image from the first grayscale image to obtain a first standard image, and performing global threshold segmentation on the first standard image to obtain an edge image;
[0057] Extracting a harpoon line area from the edge image based on the harpoon line area feature;
[0058] A main grid line area is extracted from the edge image based on the main grid line ellipse length feature and the harpoon line area.
[0059] From the above description, it can be seen that the second grayscale image after image enhancement and mean filtering can effectively highlight the main grid lines and harpoon lines in the image, thereby effectively improving the positioning accuracy. The interference area in the image can be effectively filtered out through the harpoon line area feature and the main grid line ellipse length feature to ensure the accuracy of area detection.
[0060] Furthermore, the gate line feature further includes a fine gate line area feature, and the gate line region further includes a fine gate line region;
[0061] The extracting the gate line area from the silicon wafer image based on the gate line feature also includes:
[0062] Performing mean filtering and dynamic threshold segmentation on the second silicon wafer image to obtain a second standard image;
[0063] A fine grid line area is extracted from the second standard image based on the fine grid line area feature, the harpoon line area and the main grid line area.
[0064] From the above description, we can see that the mean filter makes the image smoother, that is, it reduces the edges and details in the image and increases the image background, so that the subsequent threshold segmentation can obtain more stable and reliable results. Since the main grid lines and fine grid lines have different image features in different channels, images in different channels are used for extraction to ensure the accuracy of area extraction.
[0065] Further, the grid line image includes a harpoon line image and a main grid line image;
[0066] The step of cutting the second silicon wafer image according to the gate line area to obtain the gate line image comprises:
[0067] Convert the harpoon line area into a first minimum circumscribed rectangular area, and convert the main grid line area into a second minimum circumscribed rectangular area;
[0068] Dilate the first minimum circumscribed rectangular area and the second minimum circumscribed rectangular area to obtain a first standard area and a second standard area;
[0069] The second silicon wafer image is cropped according to the first standard area and the second standard area to obtain a harpoon line image and a main gate line image.
[0070] From the above description, it can be seen that the harpoon line area and the main grid line area are converted into a minimum circumscribed rectangle to unify the area shape in the image for subsequent image detection, and at the same time, the minimum circumscribed rectangular area is expanded to ensure that these rectangular areas can contain the complete main grid line or harpoon line area. In addition, since the line thickness feature is easily detected in the CIEXYZ color space, the harpoon line image and the main grid line image under the second silicon wafer image are obtained to facilitate subsequent line thickness detection.
[0071] Further, the grid line image includes a fine grid line image;
[0072] The step of cutting the second silicon wafer image according to the gate line area to obtain the gate line image comprises:
[0073] Expanding the thin grid line region to obtain a third standard region;
[0074] Performing image enhancement and grayscale expansion processing on the second silicon wafer image to obtain a target silicon wafer image;
[0075] The target silicon wafer image is cropped according to the third standard area to obtain a fine grid line image.
[0076] From the above description, it can be seen that the fine gate line area is expanded to ensure that the complete fine gate line area can be obtained. At the same time, the second silicon wafer image is enhanced and grayscale expanded to highlight the fine gate line features in the image, so as to improve the accuracy of subsequent line thickness detection in the fine gate line area.
[0077] Furthermore, performing a second threshold segmentation on the gate line image to obtain a target area to be tested, and calculating the grayscale value variance in the target area to be tested includes:
[0078] Performing second threshold segmentation on the grid line image to obtain an initial area to be tested;
[0079] Based on the preset regional area characteristics and regional width characteristics, the initial region to be tested is screened to obtain a target region to be tested, and the target region to be tested is expanded;
[0080] The grayscale value variance in the target area to be tested after the dilation process is calculated.
[0081] From the above description, it can be seen that due to the problem of uneven printing during the printing process of the battery cell, even normal gate lines may have high pixels in small sections, and this situation will cause the normal gate line to be almost the same width as the thick line area after threshold segmentation, so it may not be screened out only by the regional width feature screening, so the interference area is further filtered based on the regional area. If there is an exposure problem during the imaging process, the pixel values of the normal gate line and the surrounding area will be significantly increased. At this time, neither the gate line feature nor the width feature can be screened out. Considering that the image grayscale value variance of the normal thick line and the surrounding area is small at this time, the grayscale variance is combined to further distinguish the thick line area, thereby effectively reducing the detection error rate.
[0082] Another embodiment of the present invention provides a photovoltaic cell grid line detection terminal based on machine vision, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements each step of the above-mentioned photovoltaic cell grid line detection method based on machine vision.
[0083] As can be known from the above description, the beneficial effects of the present invention are: the image to be tested of the photovoltaic cell is converted into a channel image, and the target silicon wafer area is determined by performing the first threshold segmentation, the first morphological treatment and the affine transformation on the channel image, so as to cut the channel image to obtain the silicon wafer image and eliminate the useless background in the image to be tested. The gate line area is extracted from the silicon wafer image by the gate line feature to exclude some interference areas, so as to ensure the accuracy of the subsequent detection area. The gate line image is obtained based on the gate line area, and after the gate line image is subjected to the second threshold segmentation, the gray value variance in the target area to be tested is calculated again, and the line thick area is determined based on the gray value variance. Due to the exposure problem in the imaging process, the normal gate line and the surrounding area pixel values are significantly improved, so the gray value variance in the detection area can effectively avoid the misjudgment caused by exposure, and the detection accuracy of the line thick defect is effectively improved. In addition, compared with the existing template matching positioning method, the present invention only locates the area by the basic threshold segmentation and morphological treatment, and the algorithm consumes less time, which can effectively improve the detection efficiency.
[0084] The embodiments of the present invention provide a photovoltaic cell grid line detection method and terminal based on machine vision, which can be applied to the photovoltaic cell grid line line thick defect detection scenario, which can improve the detection efficiency while realizing accurate detection of grid line thick defects. The following is explained by specific embodiments:
[0085] Please refer to Figures 1 to 3 , Embodiment 1 of the present invention is:
[0086] A photovoltaic cell grid line detection method based on machine vision, comprising:
[0087] S1. Acquire an image to be tested, and convert the image to be tested into a channel image.
[0088] Specifically, converting the image to be tested into a channel image includes:
[0089] S11, converting the image to be tested into a first channel image in an RGB color space and a second channel image in a CIEXYZ color space respectively.
[0090] In some embodiments, the image to be tested is an image in RGB format, the first channel image is an R channel image, and the second channel image is an X channel image corresponding to the R channel image. The RGB color space can be converted to the CIEXYZ color space based on the following formula:
[0091]
[0092] Among them, X∈[0,1], Y∈[0,1], Z∈[0,1].
[0093] S2. Performing a first threshold segmentation, a first morphological processing and an affine transformation on the channel image in sequence to obtain a target silicon wafer region.
[0094] In an optional implementation, the step S2 is specifically:
[0095] S21 . Performing first threshold segmentation, first morphological processing and affine transformation on the first channel image in sequence to obtain a target silicon wafer area.
[0096] In some embodiments, the target silicon wafer region is located based on the R channel image.
[0097] Specifically, the step S21 includes:
[0098] S211 . Perform a first threshold segmentation and a first morphological processing on the first channel image to obtain a rough silicon wafer area.
[0099] In some embodiments, the first threshold segmentation is specifically: performing global threshold segmentation on the first channel image by setting a target threshold to determine edge information in the image.
[0100] In some embodiments, the first morphological processing is specifically: connecting the under-segmented area inside the target segmentation area through a closing operation, and then disconnecting the connection between the target segmentation area and the non-target segmentation area through an opening operation, so as to subsequently filter out the target segmentation area through regional features.
[0101] S212, measuring the contour line of the rough silicon wafer area, and determining the coordinate information of the rough silicon wafer area according to the contour line.
[0102] In some embodiments, the four-side contour lines of the rough silicon wafer area are traversed in sequence, and each contour line is extended to obtain the coordinates of four intersection points, thereby obtaining the coordinate information of the rough silicon wafer area.
[0103] S213 . Performing an affine transformation on the rough silicon wafer area according to the coordinate information to obtain a target silicon wafer area.
[0104] In some embodiments, a continuous rectangular area with preset length and width is established along the coordinate information, and the grayscale value change is detected in each rectangular area along the direction of the vertical contour line. When the grayscale change at a certain point is greater than the set threshold, it is determined to be the edge contour line of the rough silicon wafer area. The target silicon wafer area can be obtained by connecting the edge contour lines detected in all rectangular areas.
[0105] In some embodiments, after step S213, it also includes: performing positioning threshold segmentation and positioning morphological processing on the first channel image according to the target silicon wafer area to exclude the four-corner background area, so as to further adjust the target silicon wafer area and ensure the accuracy of regional positioning. Among them, the positioning threshold segmentation is specifically: performing global threshold segmentation on the first channel image by setting the positioning threshold to determine the edge information of the four-corner area. The positioning morphological processing is specifically: performing dilation operation and corrosion operation on the first channel image after positioning threshold segmentation in sequence, so as to delete the non-silicon wafer area while ensuring that the silicon wafer area is not corroded and missing, so as to obtain the target silicon wafer area.
[0106] S3, cropping the image to be tested and the channel image according to the target silicon wafer area to obtain a silicon wafer image, wherein the silicon wafer image includes a first silicon wafer image and a second silicon wafer image.
[0107] Specifically, step S3 includes:
[0108] S31 . Crop the image to be tested according to the target silicon wafer area to obtain a first silicon wafer image.
[0109] S32: cropping the second channel image according to the target silicon wafer area to obtain a second silicon wafer image.
[0110] In some embodiments, the main regions of the photovoltaic cell sheet include a main grid line region, a fine grid line region, a harpoon line region, and an electrode region. Since the main grid line region, the harpoon line region, and the electrode region have obvious regional features under the first channel image, the main grid line region, the harpoon line region, and the electrode region are located based on the first silicon wafer image, and the fine grid line region has obvious regional features under the second channel image, so the fine grid line region is located based on the second silicon wafer image. This ensures the positioning accuracy of each region.
[0111] S4. Extracting a gate line region from the silicon wafer image based on gate line features.
[0112] In an optional embodiment, the grid line feature includes a harpoon line area feature and a main grid line ellipse length feature, and the grid line region includes a harpoon line region and a main grid line region, then the step S4 includes:
[0113] S41, converting the first silicon wafer image into an original grayscale image.
[0114] S42: Perform image enhancement on the original grayscale image to obtain a first grayscale image, and perform mean filtering on the first grayscale image to obtain a second grayscale image.
[0115] S43: Subtract the second grayscale image from the first grayscale image to obtain a first standard image, and perform global threshold segmentation on the first standard image to obtain an edge image.
[0116] In some embodiments, global threshold segmentation is specifically as follows: selecting pixels whose grayscale value g satisfies the following interval from the first standard image: a preset minimum grayscale value ≤ g ≤ a preset maximum grayscale value. The edge image can be obtained by extracting all pixels that meet the above interval in the first standard image. If multiple grayscale value intervals are set, each grayscale value interval returns a separate area.
[0117] S44, extracting a harpoon line area from the edge image based on the harpoon line area feature.
[0118] S45, extracting a main grid line area from the edge image based on the main grid line ellipse length feature and the harpoon line area.
[0119] In some embodiments, the harpoon line area feature refers to the size of the area that the harpoon line may occupy. The main grid line ellipse length feature refers to the length of the main radius and the secondary radius of the ellipse equivalent to the main grid line.
[0120] In some embodiments, the grid line area also includes the electrode area. After the edge image is obtained by global threshold segmentation, the edge image includes the main grid line area, the harpoon line area and the electrode area after preliminary screening. Before executing steps S44 and S45, it is also necessary to remove the interference area connected to the main grid line area, the harpoon line area and the electrode area through the opening and closing operation of morphological processing, and then screen out the small area interference area that is not connected to the main grid line area, the harpoon line area and the electrode area based on the grid line area feature, thereby obtaining the main grid line area, the harpoon line area and the electrode area after the final screening. Steps S44 and S45 are executed based on the main grid line area, the harpoon line area and the electrode area after the final screening, so as to extract the accurate main grid line area, the harpoon line area and the electrode area.
[0121] In some embodiments, in the edge image, for the harpoon line area, the extraction is performed directly based on the harpoon line area feature; for the main grid line area, the harpoon line area is removed based on the harpoon line area feature, and then the electrode area is removed by the opening operation of the morphological processing, and finally the main grid line area is extracted based on the main grid line ellipse length feature. For the electrode area, the main grid line area and the harpoon line area are first removed by the opening operation of the morphological processing, and then the electrode area is extracted by the intersection area feature with the main grid line area.
[0122] In an optional implementation, the gate line feature further includes a fine gate line area feature, and the gate line region further includes a fine gate line region, and the step S4 further includes:
[0123] S46, performing mean filtering and dynamic threshold segmentation on the second silicon wafer image to obtain a second standard image.
[0124] S47, extracting a thin grid line area from the second standard image based on the thin grid line area feature, the harpoon line area and the main grid line area.
[0125] In some embodiments, the second silicon wafer image obtained by cropping the X channel image is subjected to mean filtering to smooth the second silicon wafer image. The second silicon wafer image after smoothing is subjected to dynamic threshold segmentation to obtain a second standard image, and the harpoon line area, the main grid line area and the electrode area in the second standard image are eliminated, thereby obtaining the fine grid line area A1 after preliminary screening. At the same time, the unconnected fine grid line area in the second standard image is screened out by the height characteristics and width characteristics of the fine grid line area, and the fine grid line area A2 is connected based on the expansion processing of morphological processing. The connected fine grid line area A2 is compared with the fine grid line area A1 obtained by dynamic threshold segmentation to obtain the difference set area A3 between the two, and the difference set area A3 is merged with the fine grid line area A1 obtained by dynamic threshold segmentation to fill the broken area in the second standard image. Finally, the complete fine grid line area is extracted from the second standard image based on the fine grid line area feature.
[0126] In some embodiments, the dynamic threshold segmentation of step S46 is specifically as follows: if the extraction area is set to the "light" segmentation mode, then the gray value g in the second silicon wafer image is extracted. 0 Pixels that meet the following conditions: g 0 ≥g t +offset, where g t is the second silicon wafer image after mean filtering. If the extraction area is set to the “dark” segmentation mode, the gray value g in the second silicon wafer image is extracted. 0 Pixels that meet the following conditions: g 0 ≤g t -offset. If the extraction area is set to "equal" segmentation mode, the gray value g in the second silicon wafer image is extracted 0 Pixels that meet the following conditions: g t -offset≤g 0 ≤g t + offset. If the extraction area is set to the "not_equal" segmentation mode, the gray value g in the second silicon wafer image is extracted 0 Pixels that meet the following conditions: g t -offset>g 0 or 0 >g t +offset.
[0127] S5. Cut the silicon wafer image according to the gate line area to obtain a gate line image.
[0128] The step S5 is specifically as follows:
[0129] S51 . Crop the second silicon wafer image according to the gate line area to obtain a gate line image.
[0130] In an optional implementation, the grid line image includes a harpoon line image and a main grid line image, and the step S51 includes:
[0131] S511, converting the harpoon line area into a first minimum circumscribed rectangular area, and converting the main grid line area into a second minimum circumscribed rectangular area.
[0132] In some embodiments, the harpoon line area and the main gate line area are converted into a minimum circumscribed rectangular area parallel to a coordinate axis, wherein the coordinate axis takes the corner point of the second silicon wafer image as the origin, the vertical direction of the second silicon wafer image as the x-axis, and the horizontal direction of the second silicon wafer image as the y-axis.
[0133] S512: Dilate the first minimum circumscribed rectangular area and the second minimum circumscribed rectangular area to obtain a first standard area and a second standard area respectively.
[0134] S513 , cropping the second silicon wafer image according to the first standard area and the second standard area to obtain a harpoon line image and a main gate line image.
[0135] In an optional implementation, the grid line image includes a fine grid line image, and the step S51 includes:
[0136] S514, dilating the thin gate line region to obtain a third standard region.
[0137] S515 , performing image enhancement and grayscale expansion processing on the second silicon wafer image to obtain a target silicon wafer image.
[0138] S516 , cropping the target silicon wafer image according to the third standard area to obtain a fine gate line image.
[0139] S6. Perform a second threshold segmentation on the gate line image to obtain a target area to be tested, and calculate the grayscale value variance in the target area to be tested.
[0140] Specifically, step S6 includes:
[0141] S61, performing a second threshold segmentation on the gate line image to obtain an initial area to be tested.
[0142] In some embodiments, if the grid line image is a harpoon line image and a main grid line image, the second threshold segmentation is an automatic global threshold segmentation. If the grid line image is a fine grid line image, the second threshold segmentation is a custom global threshold segmentation. Since the pixel features of the main grid line and the harpoon line are relatively prominent, the automatic global threshold segmentation can achieve a better segmentation effect, while the pixel features of the fine grid line are low. If the automatic global threshold segmentation is applied to the fine grid line, it is easy to cause too many non-fine grid areas to be segmented out. Therefore, the custom global threshold segmentation is used for the fine grid line to ensure the segmentation effect of the fine grid line.
[0143] S62: Screening the initial region to be tested based on preset region area features and region width features to obtain a target region to be tested, and performing expansion processing on the target region to be tested.
[0144] In some embodiments, since the initial area to be tested is directly segmented according to a preset threshold value, the grayscale values in this area are all within a certain threshold range, and the grayscale value variance is not much different. Therefore, expansion processing is performed to include part of the background area in the image to increase the difference in grayscale value variance. Only then can the grayscale value variance be calculated to determine whether the current area is a line thickness defect or a misjudgment of a line thickness defect caused by high exposure.
[0145] In some embodiments, since the area and width of the thick line region are often larger than those of normal gate lines, step S62 screens the initial area to be tested based on preset area characteristics and area width characteristics, that is, sets the area threshold and the width threshold, thereby screening out gate line regions with larger areas and thicker gate lines.
[0146] S63, calculating the grayscale value variance in the target area to be measured after the dilation process.
[0147] S7. Detect whether the grayscale value variance of the target area to be tested is greater than a preset threshold. If so, mark the target area to be tested as a thick line area.
[0148] Please refer to Figure 4 , Embodiment 2 of the present invention is:
[0149] A photovoltaic cell grid line detection terminal 100 based on machine vision includes a memory 101, a processor 102, and a computer program stored in the memory 101 and running on the processor 102. When the processor 102 executes the computer program, each step of a photovoltaic cell grid line detection method based on machine vision in Example 1 is implemented.
[0150] In summary, the present invention provides a photovoltaic cell grid line detection method and terminal based on machine vision, which converts the image to be tested of the photovoltaic cell into a channel image under different color spaces, and based on the characteristics of the silicon chip area under different channel images, performs a first threshold segmentation, a first morphological processing and an affine transformation based on the first channel image to determine the target silicon chip area, thereby respectively cutting the image to be tested and the second channel image to obtain the first silicon chip image and the second silicon chip image, thereby eliminating the useless background in the image. At the same time, based on the characteristics of different grid line areas under different channel images, different types of grid line areas are extracted from the first silicon chip image and the second silicon chip image respectively through the grid line features, thereby ensuring the accuracy of the extraction of the grid line area, effectively eliminating the interference area, and ensuring the accuracy of subsequent defect detection. Based on different types of grid line areas, the second silicon chip image is cut to obtain a grid line image, and after the second threshold segmentation is performed on the grid line image, the gray value variance in the target area to be tested is calculated, so as to judge the thick line area according to the gray value variance, avoid misjudgment caused by exposure, and effectively improve the detection accuracy of thick line defects. In addition, compared with the existing template matching positioning method, the present invention only locates the area through basic threshold segmentation and morphological processing, the algorithm consumes less time and can effectively improve the detection efficiency.
[0151] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A photovoltaic cell grid line detection method based on machine vision, It is characterized in that include: Acquire an image to be tested, and convert the image to be tested into a channel image; Performing a first threshold segmentation, a first morphological processing and an affine transformation on the channel image in sequence to obtain a target silicon wafer area; According to the target silicon wafer area, the image to be tested and the channel image are respectively cropped to obtain a silicon wafer image; Extracting a gate line region from the silicon wafer image based on gate line features; Cutting the silicon wafer image according to the gate line area to obtain a gate line image; Performing a second threshold segmentation on the gate line image to obtain a target area to be tested, and calculating the grayscale value variance in the target area to be tested; It is detected whether the gray value variance of the target area to be tested is greater than a preset threshold value. If so, the target area to be tested is marked as a thick line area.
2. The method according to claim 1, It is characterized in that The step of converting the image to be tested into a channel image comprises: Convert the image to be tested into a first channel image in RGB color space; The target silicon wafer region is obtained by sequentially performing the first threshold segmentation, the first morphological processing and the affine transformation on the channel image as follows: The first channel image is sequentially subjected to first threshold segmentation, first morphological processing and affine transformation to obtain a target silicon wafer region.
3. The method according to claim 2, It is characterized in that The step of sequentially performing first threshold segmentation, first morphological processing, and affine transformation on the first channel image to obtain a target silicon wafer area includes: Performing a first threshold segmentation and a first morphological processing on the first channel image to obtain a rough silicon wafer area; Measuring the contour line of the rough silicon wafer area, and determining the coordinate information of the rough silicon wafer area according to the contour line; Affine transformation is performed on the rough silicon wafer area according to the coordinate information to obtain a target silicon wafer area.
4. The method according to claim 2, It is characterized in that The step of converting the image to be tested into a channel image further comprises: Converting the image to be tested into a second channel image in the CIEXYZ color space; The silicon wafer image includes a first silicon wafer image and a second silicon wafer image; The step of clipping the image to be tested and the channel image according to the target silicon wafer area to obtain the silicon wafer image comprises: Cropping the image to be tested according to the target silicon wafer area to obtain a first silicon wafer image; Cropping the second channel image according to the target silicon wafer area to obtain a second silicon wafer image; The step of cropping the silicon wafer image according to the gate line area to obtain the gate line image is specifically as follows: The second silicon wafer image is cropped according to the gate line area to obtain a gate line image.
5. The method according to claim 4, It is characterized in that The grid line features include a harpoon line area feature and a main grid line ellipse length feature, and the grid line region includes a harpoon line region and a main grid line region; The extracting of the gate line area from the silicon wafer image based on the gate line feature comprises: Converting the first silicon wafer image into an original grayscale image; Performing image enhancement on the original grayscale image to obtain a first grayscale image, and performing mean filtering on the first grayscale image to obtain a second grayscale image; Subtracting the second grayscale image from the first grayscale image to obtain a first standard image, and performing global threshold segmentation on the first standard image to obtain an edge image; Extracting a harpoon line area from the edge image based on the harpoon line area feature; A main grid line area is extracted from the edge image based on the main grid line ellipse length feature and the harpoon line area.
6. The method according to claim 5, It is characterized in that The gate line feature further includes a fine gate line area feature, and the gate line region further includes a fine gate line region; The extracting the gate line area from the silicon wafer image based on the gate line feature also includes: Performing mean filtering and dynamic threshold segmentation on the second silicon wafer image to obtain a second standard image; A fine grid line area is extracted from the second standard image based on the fine grid line area feature, the harpoon line area and the main grid line area.
7. The method according to claim 5, It is characterized in that The grid line image includes a harpoon line image and a main grid line image; The step of cutting the second silicon wafer image according to the gate line area to obtain the gate line image comprises: Convert the harpoon line area into a first minimum circumscribed rectangular area, and convert the main grid line area into a second minimum circumscribed rectangular area; Dilate the first minimum circumscribed rectangular area and the second minimum circumscribed rectangular area to obtain a first standard area and a second standard area; The second silicon wafer image is cropped according to the first standard area and the second standard area to obtain a harpoon line image and a main gate line image.
8. The method according to claim 6, It is characterized in that The grid line image includes a fine grid line image; The step of cutting the second silicon wafer image according to the gate line area to obtain the gate line image comprises: Expanding the thin grid line region to obtain a third standard region; Performing image enhancement and grayscale expansion processing on the second silicon wafer image to obtain a target silicon wafer image; The target silicon wafer image is cropped according to the third standard area to obtain a fine grid line image.
9. The method according to claim 7 or 8, It is characterized in that The step of performing a second threshold segmentation on the gate line image to obtain a target region to be tested, and calculating the grayscale value variance in the target region to be tested includes: Performing second threshold segmentation on the grid line image to obtain an initial area to be tested; Based on the preset regional area characteristics and regional width characteristics, the initial region to be tested is screened to obtain a target region to be tested, and the target region to be tested is expanded; The grayscale value variance in the target area to be tested after the dilation process is calculated.
10. A photovoltaic cell grid line detection terminal based on machine vision, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, It is characterized in that When the processor executes the computer program, each step of the photovoltaic cell grid line detection method based on machine vision as described in any one of claims 1 to 9 is implemented.
