Method and System for Detecting Template Matching Defects in Screen Printing of BC Solar Cells

By using a template matching defect detection method, the problems of low defect positioning accuracy and high false detection rate in BC battery cell screen printing were solved. It enabled functional area differentiation detection and general trend recognition, improving the accuracy and efficiency of detection.

CN121724988BActive Publication Date: 2026-06-30PEIYU PHOTO-ELECTRIC TECH (SHANGHAI) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PEIYU PHOTO-ELECTRIC TECH (SHANGHAI) CO LTD
Filing Date
2026-02-25
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing BC cell screen printing defect detection technology is difficult to achieve differentiated detection of different functional areas. It has low defect location accuracy, high false detection rate, and cannot identify the general trend of defects. Furthermore, the image registration process is easily affected by the placement deviation of the cells, which affects the efficiency of subsequent sorting and rework.

Method used

The template matching defect detection method obtains the calibration point feature vector of the template image, divides the functional regions, generates functional region masks, constructs a mapping matrix for image calibration, performs rapid difference diagnosis and comparison, identifies and divides abnormal regions, matches defect types and judges general trends.

Benefits of technology

It improves the positioning accuracy and targeting of defect detection, reduces the false detection rate, ensures the precise correspondence between defect coordinates and original image positions, improves sorting and rework efficiency, provides targeted data support, and provides accurate data for printing process optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724988B_ABST
    Figure CN121724988B_ABST
Patent Text Reader

Abstract

This invention discloses a template matching defect detection method and system for screen printing of BC solar cells, belonging to the field of defect detection technology. It aims to solve the problems of weak targeting, low positioning accuracy, and difficulty in identifying general defect trends in existing detection methods. The method includes: acquiring a template image, marking calibration points, and constructing a calibration dataset; generating functional area masks for the functional regions of the template image, and obtaining functional area template sub-images; acquiring observation images and cropping them into observation sub-images, matching calibration points to generate and correcting the affine mapping matrix to obtain a calibration observation image aligned with the template image; comparing the calibration observation image with the template image to generate an effective difference image and determine abnormal regions; and combining a defect feature library to identify defect types and classify levels, and retrieving abnormal functional area observation sub-images to determine general defect trends. This application achieves accurate positioning, classification, and trend identification of printing defects in BC solar cells, improving detection efficiency and reliability, and providing data support for production optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, and more specifically to a template matching defect detection method and system for screen printing of BC solar cells. Background Technology

[0002] Against the backdrop of the rapid development of the photovoltaic industry, BC cells have become mainstream products due to their advantages such as high conversion efficiency and low degradation rate. The quality of their screen printing process directly determines the electrical performance and reliability of the cells. However, BC cells are prone to various defects during the screen printing process, such as broken grids, missing lines, short circuits, and excess adhesive. Moreover, the causes and effects of defects in different functional areas, such as the main grid, fine grid, via pads, and conductive adhesive, differ significantly, posing stringent requirements for testing accuracy and specificity. Existing BC solar cell printing defect detection technologies mostly employ full-domain image comparison, single threshold judgment, or general feature matching methods, which have significant technical bottlenecks: They lack differentiated detection logic for different functional areas, making it difficult to adapt to the identification of minute defects in fine structures such as fine grids and the filtering of redundant defects in coarse structures such as main grids, resulting in low defect location accuracy and high false detection rates; defect type identification and classification rely on single feature parameters, failing to comprehensively reflect the degree of defect impact on battery performance and easily leading to misclassification; they can only achieve isolated detection of single defects, making it difficult to identify the distribution patterns and general trends of the same type of defect across the entire domain, and failing to provide targeted data support for printing process optimization; simultaneously, the image registration process is easily affected by factors such as solar cell placement deviation and uneven grayscale, leading to a mismatch between defect coordinate location and the original solar cell's physical location, affecting subsequent sorting and rework efficiency. These problems severely restrict the improvement of BC solar cell production quality and the intelligent upgrading of the inspection process. Therefore, to overcome these limitations, this invention proposes a template matching defect detection method and system for BC solar cell screen printing. Summary of the Invention

[0003] To address the shortcomings of existing technologies, the present invention aims to provide a template matching defect detection method and system for BC battery cell screen printing, which solves the problem of how to accurately locate, identify, classify, and determine the general trend of BC battery cell screen printing defects, while ensuring the accurate correspondence between defect markings and the original observation image positions.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] A method for detecting stencil matching defects in BC cell screen printing includes:

[0006] Obtain the template image, mark the calibration points of the template image, extract the feature vectors of the calibration points, and construct the calibration dataset;

[0007] The template image is divided into functional regions, a functional region mask for each functional region is generated, and a pixel-level AND operation is performed with the template image to obtain the template sub-image of each functional region.

[0008] The observation image of each BC cell to be tested is acquired, cropped according to the boundary coordinates to obtain the observation sub-image, the target matching position of the calibration point of the calibration dataset in the observation sub-image is identified to generate the initial affine mapping matrix between the observation sub-image and the template image, and corrected by geometric deviation constraints to construct the mapping matrix, which is used to generate the calibration observation image that matches the spatial position of the template image.

[0009] A rapid difference diagnosis and comparison analysis is performed between the calibration observation image and the template image to generate an effective difference image. It is then determined whether the image meets the quality qualification criteria. If not, an abnormal area location operation is initiated to identify the non-compliant functional areas in the effective difference image and to delineate the initial suspected abnormal areas. By calculating the shrinkage index and the morphological feature overlap measure, the initial suspected abnormal areas are narrowed and abnormal areas are delineated.

[0010] Based on the defect feature library corresponding to each functional area, the defect type of the abnormal area is matched and the defect level is classified; and according to the defect type, the abnormal functional area observation sub-image of the calibration observation image where the abnormal area is located is matched and searched to determine whether there is a general trend in the abnormal area.

[0011] Based on the mapping matrix, the coordinate positions of each abnormal region in the observation submap are calculated through matrix inverse transformation, and defects are marked.

[0012] Specifically, the steps for constructing the calibration dataset include:

[0013] Acquire the full-area image of the back of the template sample, and crop to remove invalid background areas and interfering pixels at the image edges to obtain the template image;

[0014] The calibration points of the calibration template image and the observation sub-icon calibration points refer to the characteristic position points used to characterize the overall geometric distribution relationship of the printed pattern on the back of the BC battery cell;

[0015] For each calibration point of a mark, a preset range image area centered on the calibration point is extracted from the template image. The size of the preset range image area of ​​the observation sub-image is configured according to the size characteristics of the printing structure to which the calibration point belongs and the type of the calibration point.

[0016] Obtain the pixel coordinates of the preset range image region of each calibration point in the template image, and extract the multi-dimensional features of the preset range image region of the calibration point, including gray-scale distribution features, contour features, and texture features;

[0017] The multi-dimensional features of each calibration point are normalized, and each calibration point is uniquely numbered according to preset rules.

[0018] Based on the normalized multi-dimensional features, a feature vector corresponding to each calibration point is generated; according to the type of calibration point, the feature vectors, corresponding pixel coordinates, unique numbers and type identifiers of all calibration points are classified and organized to form a structured calibration dataset.

[0019] Specifically, the steps to obtain the template sub-images for each functional area include:

[0020] The template image is divided into functional areas, including the main gate functional area, the fine gate functional area, the via pad functional area, and the conductive adhesive functional area.

[0021] Based on the boundary features and structural morphology of each functional region, the main functional mask of each functional region is generated through image segmentation and contour extraction.

[0022] Identify the intersection areas between functional areas, and generate functional intersection sub-masks containing only a single belonging according to the preset intersection area belonging rules. Perform pixel-level OR operation between the functional intersection sub-masks and the corresponding main functional masks to form the functional area masks of each functional area.

[0023] Each functional area mask is ANDed with the template image at the pixel level to obtain a region image containing only a single function, which is then used as the functional area template sub-image.

[0024] Specifically, the steps for constructing the mapping matrix include:

[0025] Acquire observation images for each BC solar cell to be tested, and crop and remove invalid background areas and interfering pixels according to the boundary coordinates of the observation images to obtain observation sub-images;

[0026] Extract the type identifier, feature vector, and pixel coordinates of the calibration points in the calibration dataset; within the preset range image region corresponding to each type of calibration point, calculate the similarity between the local features of the preset range image region corresponding to the observation sub-image and the feature vector of the same type of calibration point in the calibration dataset, and identify the candidate positions of each calibration point;

[0027] For each calibration point's candidate location, based on the relative position of the calibration point's pixel coordinates, a calibration point geometric association verification model is constructed to identify the target matching location for each calibration point.

[0028] Based on the pixel coordinates corresponding to the target matching positions of each calibration point in the observation sub-image and the pixel coordinates of the corresponding calibration points in the calibration dataset, a coordinate correspondence pair is established; the least squares method is used to fit the coordinate correspondence pair, and the affine transformation equation system is solved to obtain the initial affine mapping matrix between the observation sub-image and the template image.

[0029] Extract the functional area masks corresponding to the main gate functional area and the fine gate functional area, and obtain the center line pixel coordinates of the main gate line and the center line pixel coordinates of the fine gate line from the functional area masks;

[0030] The initial affine mapping matrix is ​​applied to the observation sub-image to obtain the observation sub-image after preliminary transformation. The geometric deviation between the center line of the main grid, the center line of the fine grid in the observation sub-image after preliminary transformation and the corresponding center line pixel coordinates in the template image is calculated. Using this geometric deviation as a constraint term, a constraint optimization function is constructed to correct the initial affine mapping matrix and obtain the mapping matrix.

[0031] Specifically, the steps for generating a calibration observation image that matches the spatial location of the template image include:

[0032] Perform a geometric transformation pixel by pixel on the observed sub-image. Substitute the original two-dimensional coordinates of each pixel in the observed sub-image into the inverse transformation formula of the mapping matrix to calculate the target coordinates of the pixel in the template image coordinate system. If the target coordinates are non-integer pixel coordinates, use bilinear interpolation to calculate the pixel gray value corresponding to the target coordinates.

[0033] Based on the pixel size and coordinate range of the template image, all transformed pixels are rearranged according to the target coordinates to form a preliminary calibration observation image;

[0034] Edge scanning is performed on the preliminary calibration observation image to identify pixels whose target coordinates exceed the effective coordinate range of the template image, which are then designated as redundant edge pixels. The gray values ​​of all redundant edge pixels are then set to a uniform gray value to obtain the calibration observation image.

[0035] Select a grayscale reference region in the template image, calculate the average grayscale value and grayscale standard deviation of each grayscale reference region by pixel traversal, and record the coordinate range of each grayscale reference region.

[0036] In the calibration observation image, based on the coordinate range of the gray-level reference area of ​​the template image, the corresponding gray-level reference area is located, the average gray-level value and gray-level standard deviation are calculated, and the gray-level parameters of the calibration observation image are adjusted to be consistent with those of the template image using a linear gray-level correction method.

[0037] Specifically, the steps for rapid difference diagnosis and comparison analysis between the calibration observation image and the template image include:

[0038] The calibration observation image and the template image are imported into the same image processing coordinate system. A pixel-level difference algorithm is used to calculate the gray-level difference between corresponding positions of the calibration observation image and the template image pixel by pixel to obtain the initial difference image. Then, noise suppression processing is performed on the initial difference image to obtain the denoised effective difference image.

[0039] The effective difference image is quantized, and the absolute value of the gray level difference of all non-zero gray level pixels in the effective difference image is counted. The mean and maximum gray level difference of the absolute value of the gray level difference of non-zero gray level pixels are calculated. A dynamic threshold division method is adopted to set the difference judgment threshold according to the functional area.

[0040] Based on the difference judgment threshold of each region, perform regional difference statistics on the effective difference image, count the number of difference pixels in each functional region whose absolute gray-level difference exceeds the corresponding difference judgment threshold, and calculate the proportion of difference pixels in each functional region.

[0041] If the percentage of difference pixels in each functional area does not exceed the preset area percentage threshold, the printing quality of the BC battery cell corresponding to the calibration observation image is deemed compliant; otherwise, the abnormal area location operation is initiated.

[0042] Specifically, the steps for dividing abnormal regions include:

[0043] Functional regions whose percentage of differential pixels exceeds the regional percentage threshold are classified as non-compliant functional regions.

[0044] Within the non-standard functional area, identify all connected regions composed of differing pixels, and mark each connected region as an independent initial suspected abnormal region;

[0045] The total number of differing pixels, the mean and median of the absolute value of the grayscale difference are counted in each initial suspected anomaly region. Combined with the difference judgment threshold of the corresponding functional region, a narrowing index calculation model is constructed to calculate the signal strength screening threshold corresponding to each initial suspected anomaly region. The signal strength screening threshold of the observed sub-image is a dynamic multiple of the difference judgment threshold of the corresponding functional region.

[0046] Using the absolute value of the grayscale difference of the difference pixels as the signal strength index, high signal strength difference pixels with a grayscale difference higher than the corresponding signal strength screening threshold are selected in the initial suspected abnormal region to form several high signal connected sub-regions; and the minimum bounding rectangle of each high signal connected sub-region is used as the narrowed suspected abnormal region.

[0047] Call the functional area template sub-image corresponding to the functional area that exceeds the standard, extract the typical morphological features of the printed structure in the functional area; and perform morphological matching on the suspected abnormal area after shrinkage, calculate the comprehensive overlap between each local sub-region of the suspected abnormal area and the typical morphological features.

[0048] Local sub-regions with a comprehensive overlap greater than a preset overlap threshold are selected as shape-fitting regions. After removing shape-fitting regions from the suspected abnormal regions, they are designated as abnormal regions and an abnormal region mask is generated.

[0049] Specifically, the steps for matching defect types in abnormal regions and classifying defect levels include:

[0050] The defect feature library corresponding to the functional area to which the abnormal area belongs is called. Based on the abnormal area mask, a local image of the abnormal area is extracted from the calibration observation image. The defect feature parameters are extracted and standardized according to the unified format of the defect feature library to form a standardized feature parameter set of the abnormal area.

[0051] The standardized feature parameter set of the abnormal region is matched with the typical defect feature parameter set of the corresponding functional region in the defect feature library one by one to calculate the similarity, and a differentiated similarity judgment threshold standard is set according to the functional region.

[0052] If the similarity between an abnormal region and a typical defect is greater than the similarity threshold, the defect type of the abnormal region is determined to be the typical defect; if the similarity between the abnormal region and all typical defects is not greater than the similarity threshold, it is marked as an atypical defect, triggering the manual review process.

[0053] By combining the proportion of abnormal area and the matching similarity of typical defects, the defect level of abnormal area is classified through a multi-indicator weighted fusion judgment logic.

[0054] Specifically, the steps to determine whether an anomaly region exhibits a general trend include:

[0055] Based on the identified defect types in abnormal regions, a subset of typical defect feature parameters for that abnormal region defect type is extracted from the corresponding functional region defect feature library.

[0056] Based on the template sub-map mask of the functional area corresponding to the functional area to which the abnormal area belongs, an abnormal functional area observation sub-map of the abnormal area is generated, and a full-domain scan of the abnormal functional area observation sub-map is performed through a sliding window.

[0057] Calculate the matching similarity between the image defect features and the typical defect feature parameter subset within each sliding window, filter out the sliding window regions with matching similarity greater than the preset potential matching threshold, mark them as potential abnormal regions, and perform deduplication on the marked potential abnormal regions to form a set of potential abnormal regions.

[0058] A multi-dimensional distribution feature analysis was performed on the set of potential anomaly regions. The total number of potential anomaly regions and the proportion of potential anomalies in the total area of ​​potential anomaly regions to the total area of ​​the observed submap were counted. The observed submap of the anomaly functional area was divided into several uniform grid cells. The number of potential anomaly regions in each grid cell was counted, and the frequency of anomaly distribution in each grid cell was recorded. The center-to-center distance between any two potential anomaly regions was measured, and the distribution direction of the potential anomaly regions was fitted by the directional vector clustering method.

[0059] Based on the statistical results of the multi-dimensional distribution characteristic analysis, a general trend determination is performed.

[0060] A template matching defect detection system for screen printing of BC solar cells includes a calibration construction module, a template generation module, an observation and calibration module, an anomaly location module, a trend determination module, and a defect annotation module.

[0061] The observation sub-image calibration construction module is used to construct the calibration dataset of the template image; the observation sub-image template generation module is used to divide the template image into functional regions and obtain template sub-images for each functional region; the observation sub-image observation calibration module is used to collect observation images, match the target positions of calibration points, construct a mapping matrix, and generate calibration observation images that match the spatial positions of the template images; the observation sub-image anomaly localization module is used to perform rapid difference diagnosis and comparison analysis between the calibration observation images and the template images, initiate anomaly region localization operations, and divide anomaly regions; the observation sub-image trend determination module is used to match the defect types of anomaly regions, classify defect levels, and determine whether there is a general trend in anomaly regions; the observation sub-image defect annotation module is used to annotate defects based on the mapping matrix.

[0062] The beneficial effects of this invention are:

[0063] This application achieves precise image registration and grayscale correction by dividing template images into functional regions and generating dedicated template sub-images, combined with a calibration dataset constructed from multi-dimensional features. This effectively improves the targeting and positioning accuracy of defect detection in different functional regions. Through a combination of dynamic threshold division, narrowing index calculation, and morphological feature overlap measurement, the false detection rate of defects is significantly reduced, ensuring the accuracy of abnormal region division. Utilizing a dedicated defect feature library for functional regions and a multi-index weighted fusion judgment logic, accurate identification of defect types and reasonable classification of levels are achieved. By performing full-domain matching retrieval and multi-dimensional distribution feature analysis on the observed sub-images of abnormal functional regions, the general trend of defects can be effectively identified, providing targeted data support for printing process optimization. Simultaneously, defect annotation is achieved through inverse coordinate transformation based on the corrected mapping matrix, ensuring accurate correspondence between defect coordinates and the physical location of the original observed image, significantly improving subsequent sorting and rework efficiency, and comprehensively optimizing the accuracy, comprehensiveness, and practicality of BC battery cell screen printing defect detection. Attached Figure Description

[0064] Figure 1 This is a flowchart of the template matching defect detection method for screen printing of BC battery cells according to the present invention;

[0065] Figure 2 This is a flowchart illustrating the process of obtaining template sub-images for each functional area in this invention;

[0066] Figure 3This is a flowchart illustrating the process of generating a calibration observation image that matches the spatial location of a template image in this invention.

[0067] Figure 4 This is a flowchart illustrating the rapid difference diagnosis and comparison analysis between the calibration observation image and the template image according to the present invention.

[0068] Figure 5 This is a flowchart of the abnormal area location operation of the present invention. Detailed Implementation

[0069] Please see Figure 1 This embodiment describes a method for detecting template matching defects in screen printing of BC solar cells, including:

[0070] Step S1: Select a BC solar cell with stable printing quality as a template sample. Use a high-resolution imaging device to acquire a complete image of the back of the template sample, which will serve as the template image. Based on the actual structural features of the BC solar cell and the screen printing design drawings, determine and mark calibration points in the template image. These calibration points include the alignment points at the four corners of the solar cell, the intersection points of the main grid lines, the center position of the feature vias, and the center position of the conductive adhesive reference block. The selected calibration points must simultaneously meet the requirements of stable visibility and geometric structure representation, comprehensively reflecting the overall geometric distribution of the printed pattern on the back of the BC solar cell, providing a precise positioning reference for subsequent image alignment operations. Extract the feature vectors of the calibration points to construct a calibration dataset.

[0071] In this embodiment, the template sample refers to a BC solar cell that has undergone multi-dimensional quality verification to ensure that the back screen-printed pattern is free from any defects such as local smearing, missing prints, interconnections, offsets, or reverse placement, and that the geometric dimensions, positional accuracy, and electrical performance of the printed structure meet the preset production standards. It can be used as a benchmark for subsequent inspection and comparison and can be obtained through manual or semi-automatic screening. The marked calibration points can accurately characterize the geometric structure of the back printed pattern of the BC solar cell. The constructed calibration dataset can provide a reliable basis for efficient alignment of subsequent observation images and rapid positioning of calibration points, ensuring the accuracy and stability of subsequent defect detection from the source.

[0072] Preferably, the specific steps for constructing the calibration dataset include:

[0073] The entire image of the back of the template sample is acquired. Invalid background areas and interfering pixels at the edges of the image are removed by cropping, and the effective image area containing only the complete printed structure of the BC battery cell is retained as the template image. This ensures that the edge contours and details of each printed structure in the template image are not blurred or distorted.

[0074] Based on the actual structural characteristics of the BC solar cell and the screen design drawings, the calibration points of the template image are determined. The calibration points are characteristic position points that have stable visibility and can accurately represent the overall geometric distribution relationship of the printed pattern on the back of the BC solar cell, including the collimation points at the four corners of the solar cell, the intersection points of the main grid lines, the center position of the characteristic vias, and the center position of the conductive adhesive reference block.

[0075] For each calibration point, a preset range image region centered on the calibration point is extracted from the template image. The size of the preset range image region is configured according to the size characteristics of the printing structure to which the calibration point belongs and the type of the calibration point, ensuring that the extracted region can fully contain the core features of the calibration point and cover sufficient information of the surrounding related structures, avoiding incomplete feature extraction due to the region being too small or irrelevant interference introduced due to the region being too large.

[0076] The pixel coordinates of the preset range image region of each calibration point in the template image are obtained to clarify the spatial location information of the region. Simultaneously, multi-dimensional features of the preset range image region of the calibration point are extracted, including gray-level distribution features, contour features, and texture features. Specifically, gray-level distribution features are obtained by statistically analyzing the distribution pattern, peak value, and dispersion of pixel gray-level values ​​within the region using gray-level histograms. Contour extraction algorithms are used to obtain the edge contours of the printed structure within the region, and morphological analysis methods are combined to calculate parameters such as the area, perimeter, and roundness of the contours, extracting contour features. Texture feature extraction algorithms are used to analyze the pixel arrangement pattern, gray-level change frequency, and spatial correlation within the region, obtaining texture features to ensure that multi-dimensional features can comprehensively characterize the unique attributes of the calibration point.

[0077] The multi-dimensional features of each calibration point are normalized. The standardization method is used to convert the feature parameters of different dimensions to a unified numerical range, eliminate the differences in dimensions and numerical ranges between different feature parameters, avoid interference with subsequent feature matching and localization due to the different magnitudes of feature parameters, and ensure that each feature parameter has equal weight in subsequent processing.

[0078] Each calibration point is uniquely numbered according to preset rules. The numbering rules are formulated based on the type of calibration point and its spatial position order in the template image to ensure that the numbering can clearly distinguish different calibration points. A feature vector corresponding to each calibration point is generated based on the normalized multi-dimensional features. According to the type of calibration point, the feature vectors, corresponding pixel coordinates, unique numbers and type identifiers of all calibration points are classified and organized to establish the association mapping relationship between the calibration point type and the feature vector, coordinate information and unique number, forming a structured calibration dataset.

[0079] Step S2: Based on the functional attributes of each printed structure on the back of the BC solar cell, the template image is divided into functional regions, clearly defining different functional regions such as the main grid functional region, fine grid functional region, via pad functional region, and conductive adhesive functional region. Considering the staggered distribution and overlapping boundaries of the functional regions of the BC solar cell, a masking technique is used to process the template image. By constructing a functional region mask that corresponds one-to-one with each functional region, the image information of the target functional region is retained in the template image, while the image information of irrelevant functional regions is removed, generating functional region template sub-images. Each functional region template sub-image contains only the complete image information of a single functional region, laying the foundation for subsequent targeted defect detection of functional regions.

[0080] In this embodiment, by dividing the printed structure on the back of the BC cell into zones based on its functional attributes, the range of different functional areas such as the main grid, fine grid, via pads, and conductive adhesive can be accurately defined, effectively avoiding the problem of area confusion caused by the overlapping distribution and boundaries of various functional areas. At the same time, by using a masking technique that corresponds one-to-one with the functional areas to process the template image, the complete image information of the target functional area can be preserved while completely eliminating interference information from irrelevant areas. The generated functional area template sub-images are not only completely consistent in size with the original template image, but can also present the detailed features of a single functional area. This solves the problem that traditional templates cannot focus on a single functional area, and provides a clear and interference-free comparison benchmark for subsequent special defect detection of different functional areas, greatly improving the accuracy and efficiency of subsequent defect identification.

[0081] Please see Figure 2 Preferably, the specific steps for generating the functional area template sub-diagram include:

[0082] Based on the functional attributes of the printed structure on the back of the BC solar cell, the template image is divided into functional areas. Each functional area refers to an image area that carries a specific electrical transmission or connection function and is composed of the corresponding printed structure and its associated areas. These areas include the main grid functional area, the fine grid functional area, the via pad functional area, and the conductive adhesive functional area. Specifically, the main grid functional area is defined by the main grid lines and their extended coverage area; the fine grid functional area is defined by the cluster of fine grid lines and their connection area with the main grid and vias; the via pad functional area is defined by the via body and the surrounding pre-set pad coverage area; and the conductive adhesive functional area is defined by the conductive adhesive block and its contact area with the main grid. This division method accurately defines the spatial boundaries of each functional area, ensuring that the partitioning not only meets the actual functional requirements but also completely covers the corresponding printed structure.

[0083] Based on the boundary features and structural morphology of each functional region, a main functional mask for each region is generated through image segmentation and contour extraction: For the main gate functional region, directional filtering is used to enhance the grayscale contrast of the main gate lines, and then an adaptive threshold segmentation algorithm is used to extract the main gate region. Morphological dilation is combined to optimize the edge contour, generating the main gate main functional mask. For the fine gate functional region, the fine gate line clusters are extracted, and the connection regions between the fine gate, main gate, and vias are integrated through connected component analysis to generate the fine gate main functional mask. For the via pad functional region, a circular detection algorithm is used to locate the via body, and the pad region is expanded outward from the via center as a reference before contour filling, generating the via pad main functional mask. For the conductive adhesive functional region, a grayscale threshold segmentation algorithm is used to extract the conductive adhesive block region, and edge smoothing is applied to eliminate contour jaggedness, generating the conductive adhesive main functional mask.

[0084] The system identifies the intersection areas between functional areas and generates functional intersection sub-masks containing only a single attribute based on preset intersection area assignment rules. These sub-masks are then subjected to pixel-level OR operations with the corresponding main functional mask to fuse the intersection area and main functional area masks, forming a complete functional area mask. This ensures that the intersection area is uniquely identified within its corresponding functional area mask. The preset intersection area assignment rules are unique assignment criteria established for overlapping areas formed by different functional areas, based on the core functional priorities, current transmission paths, and screen printing process design goals of each printed structure on the back of the BC solar cell. These rules are determined by combining the electrical design scheme of the BC solar cell with the functional priority ranking of each printed structure.

[0085] The merged functional area masks are subjected to pixel-level AND operations with the template images. The template image pixels corresponding to the valid identifiers in the functional area masks retain the original grayscale values, edge details, and texture features, while the grayscale values ​​of the template image pixels corresponding to the invalid identifiers are set to a uniform background value. This achieves accurate preservation of image information of the target functional area and complete removal of interference information from irrelevant areas.

[0086] After the above calculations, images containing only a single functional area are obtained and used as functional area template sub-images. Contour integrity detection, edge clarity detection, and background purity detection are performed on each functional area template sub-image. For sub-images that do not meet the preset standards, the generation parameters of the corresponding functional mask or the rules for assigning cross regions are adjusted, and the mask generation and calculation process is re-executed until all functional area template sub-images meet the comparison requirements for subsequent defect detection. The final generated functional area template sub-images are completely consistent in size with the original template image.

[0087] Step S3: At the inspection station of the BC solar cell screen printing production line, an imaging device with the same resolution as the template image is used to acquire images of the back side of each BC solar cell to be inspected, obtaining the observation image to be inspected. The acquired observation image is first cropped to remove invalid areas at the image edges. Then, based on the calibration points calibrated in step S1, an image registration technique is used to construct a mapping matrix between the observation image and the template image. This mapping matrix is ​​used to perform geometric transformation on the observation image to achieve precise spatial alignment between the observation image and the template image, generating a calibration observation image that matches the spatial position of the template image.

[0088] In this embodiment, by using an imaging device with the same resolution as the template image acquisition at the production line inspection station, the pixel scale of the observed image and the template image is consistent, avoiding image deviations introduced by equipment differences. Cropping the observed image can quickly remove invalid background interference and focus on the core inspection area of ​​the battery cell. Based on the calibration points in step S1, a mapping matrix is ​​constructed and geometric transformation is performed to achieve precise alignment between the observed image and the template image in spatial position. The generated calibrated observed image can eliminate positional interference caused by the placement deviation of the battery cell to be inspected, providing a spatially unified and interference-free comparison basis for subsequent identification of printing defects through template matching, effectively ensuring the spatial accuracy of defect detection and the reliability of subsequent difference comparison.

[0089] Preferably, the specific steps for constructing the mapping matrix between the observed image and the template image include:

[0090] A full-domain image of the back of each BC solar cell to be tested is acquired to obtain an observation image. The boundary coordinates of the BC solar cells in the observation image are extracted by an edge detection algorithm. Invalid background areas and interfering pixels at the image edges are cropped and removed based on the boundary coordinates to obtain an observation sub-image containing only the complete printed structure of the BC solar cells to be tested.

[0091] The calibration dataset constructed in step S1 is called, and the type identifier, feature vector, and pixel coordinates of the calibration points in the calibration dataset are extracted. The observation sub-image is divided into regions according to the type of calibration point. Within the preset range image region corresponding to each type of calibration point, the feature vector cosine similarity comparison algorithm is used to calculate the similarity between the local features of the preset range image region corresponding to the observation sub-image and the feature vectors of the same type of calibration points in the calibration dataset. Candidate positions of each calibration point with a similarity higher than a preset threshold are identified.

[0092] For each calibration point's candidate location, based on the relative position of the calibration point's pixel coordinates, a geometric association verification model is constructed to identify the target matching location for each calibration point:

[0093] Extract geometric correlation parameters such as relative distance and included angle between calibration points of the same type from the calibration dataset, and establish a calibration point geometric correlation benchmark library;

[0094] All candidate positions of the same type of calibration points in the observation sub-map are combined and traversed, and geometric parameters such as relative distance and included angle between each group of candidate positions are calculated. The calculated geometric parameters are compared with the corresponding parameters in the geometric association benchmark library to filter out candidate position combinations whose geometric parameter deviation is less than the preset deviation threshold.

[0095] Finally, among the candidate position combinations that meet the deviation requirements, the similarity of the feature vector of each candidate position with the corresponding calibration point in the calibration dataset is calculated. The candidate position with the highest similarity and the smallest geometric parameter deviation is selected as the target matching position of the calibration point, ensuring that the matching position of each calibration point is consistent with the geometric relationship of the calibration point in the template image.

[0096] Based on the pixel coordinates corresponding to the target matching positions of each calibration point in the observation sub-image and the pixel coordinates of the corresponding calibration points in the calibration dataset, a coordinate correspondence pair is established. The least squares method is used to fit the coordinate correspondence pair and solve the affine transformation equations to obtain the initial affine mapping matrix between the observation sub-image and the template image. The initial affine mapping matrix contains translation, rotation, scaling, and shearing parameters, which are used to initially describe the spatial transformation relationship from the observation sub-image to the template image.

[0097] Extract the functional area masks corresponding to the main grid functional area and the fine grid functional area generated in step S2. Obtain the center line pixel coordinates of the main grid line and the fine grid line from the mask as printing structure constraints. Apply the initial affine mapping matrix to the observation sub-image to obtain the observation sub-image after preliminary transformation. Calculate the geometric deviation between the center line of the main grid and the center line of the fine grid in the observation sub-image after preliminary transformation and the corresponding center line pixel coordinates in the template image, including the straight line offset of the center line and the parallelism deviation of adjacent center lines. Using this geometric deviation as a constraint term, construct a constraint optimization function. Iteratively adjust the parameters of the initial affine mapping matrix using the gradient descent method to correct the initial affine mapping matrix, so that the geometric deviation is gradually reduced to within the preset constraint threshold, and the optimized mapping matrix is ​​obtained.

[0098] Please see Figure 3 Preferably, the specific steps for generating a calibration observation image that matches the spatial location of the template image include:

[0099] Based on the optimized mapping matrix constructed in step S3, and taking the preprocessed observation sub-image containing only the complete printed structure of the BC battery cell to be detected as the processing object, a geometric transformation is performed pixel by pixel on the observation sub-image: the original two-dimensional coordinates of each pixel are substituted into the inverse transformation formula of the mapping matrix. This formula is derived from the affine transformation parameters and includes translation, rotation, and scaling coefficients to calculate the target coordinates of the pixel in the template image coordinate system. If the target coordinates are non-integer pixel coordinates, the bilinear interpolation method is used to calculate the pixel gray value corresponding to the coordinates. That is, the four nearest integer coordinate pixels around the target coordinates are selected, and the gray values ​​are assigned according to the distance weight between each pixel and the target coordinates. The gray values ​​of the target coordinates are obtained by weighted summation, thereby ensuring the pixel continuity and detail integrity of the transformed image and avoiding pixel loss or jagged edges. Finally, according to the pixel size and coordinate range of the template image, all transformed pixels are rearranged according to the target coordinates to form a preliminary calibration observation image, and the size of the preliminary calibration observation image is completely consistent with the template image.

[0100] Edge scanning is performed on the preliminary calibration observation image to identify pixels whose target coordinates exceed the effective coordinate range of the template image. These pixels are defined as edge redundant pixels. The gray values ​​of all edge redundant pixels are set to a uniform gray value consistent with the background of the template image to completely eliminate interference information that exceeds the effective area. This ensures that the effective area of ​​the preliminary calibration observation image completely overlaps with the template image, thus obtaining the calibration observation image.

[0101] Several uniformly distributed grayscale reference regions are selected in the template image. The selection criteria are that there are no intersecting printed structures and no noise interference within the regions. Specifically, straight sections of main grid lines that do not intersect and blank areas between fine grid lines can be selected. The average grayscale value and grayscale standard deviation of each grayscale reference region are calculated by pixel traversal, and the coordinate range of each grayscale reference region is recorded. Next, in the calibration observation image, the corresponding grayscale reference regions are located according to the coordinate range of the grayscale reference regions in the template image, and the average grayscale value and grayscale standard deviation of these corresponding regions are calculated in the same way. Finally, a linear grayscale correction method is used to adjust the grayscale parameters of the calibration observation image to be consistent with the template image, thereby achieving grayscale consistency optimization of the entire calibration observation image.

[0102] Step S4: Perform rapid difference diagnosis and comparison analysis on the calibration observation image and the template image to determine whether the degree of difference between the two meets the quality acceptance criteria. If the degree of difference meets the criteria, the BC battery cell printing quality corresponding to the calibration observation image is directly determined to be compliant, and no further inspection process is required. If the degree of difference exceeds the criteria, an abnormal area location operation is initiated. Based on the intensity and distribution characteristics of the difference signal, the abnormal area is narrowed down step by step, from the initial large suspected abnormal area to the actual abnormal area. At the same time, an abnormal area mask is generated. Combined with the functional area template sub-image generated in step S2, the functional area to which the abnormal area belongs is located by mask matching, providing targeted location for subsequent functional area-specific inspection.

[0103] In this embodiment, by performing rapid difference diagnosis and comparison between the calibration observation image and the template image, BC battery cells with compliant printing quality can be directly screened out, simplifying the inspection process and improving inspection efficiency. For battery cells whose differences exceed the judgment criteria, the abnormal area is narrowed down and located step by step by using the difference signal intensity and distribution characteristics, accurately locking the abnormal area. By combining the matching of the functional area template sub-image and the abnormal area mask, the functional area to which the abnormal area belongs can be quickly identified, avoiding the blindness of full-area scanning in traditional inspection. This provides precise targeting guidance for subsequent special defect inspection of specific functional areas, ensuring the targeting and efficiency of defect inspection, while reducing the time cost loss caused by invalid inspection operations.

[0104] Please see Figure 4 Preferably, the specific steps for rapid difference diagnosis and comparison analysis between the calibration observation image and the template image include:

[0105] The calibration observation image and the template image are imported into the same image processing coordinate system to ensure a one-to-one correspondence between their pixel coordinates. Targeting the grayscale characteristics of the BC battery cell printing structure, a pixel-level difference algorithm is used to calculate the grayscale difference between corresponding positions in the calibration observation image and the template image pixel by pixel, resulting in an initial difference image. Noise suppression processing is applied to the initial difference image, using a Gaussian filtering algorithm to smooth the image and eliminate spurious difference signals caused by imaging noise. Simultaneously, morphological opening operations are used to remove tiny isolated noise points, preserving the complete contours of the true difference regions, resulting in a denoised effective difference image, providing a clear signal foundation for subsequent difference analysis.

[0106] The difference signals in the effective difference image are quantized, and the absolute value of the gray level difference of all non-zero gray level pixels in the effective difference image is statistically analyzed. The mean and maximum gray level difference of the absolute value of the gray level difference of non-zero gray level pixels are calculated. Considering the quality tolerance of different printing structures of BC solar cells, a dynamic threshold division method is adopted to set the difference judgment threshold for each functional area. Because the main grid functional area and via pad functional area have large structural dimensions, small gray level differences do not affect the function, so a higher threshold is adopted. The fine grid functional area and conductive adhesive functional area have delicate structures, and small differences may cause functional abnormalities, so a lower threshold is adopted, thus forming a regional difference judgment threshold system.

[0107] Based on the regional difference judgment threshold, regional difference statistics are performed on the effective difference image: the effective difference image is divided into functional regions according to the division in step S2, and the number of difference pixels whose absolute grayscale difference exceeds the corresponding difference judgment threshold in each functional region is counted, and the proportion of difference pixels in each functional region is calculated; if the proportion of difference pixels in each functional region does not exceed the preset region proportion threshold, the BC cell printing quality corresponding to the calibration observation image is judged to be compliant; if the proportion of difference pixels in any functional region exceeds the region proportion threshold, the degree of difference is judged to exceed the judgment standard, and the abnormal region location operation is initiated. Among them, the preset region proportion threshold refers to the maximum proportion limit of allowable difference pixels to the total pixels in each functional region, which is set separately for each functional region according to the printing process requirements, core function importance and quality control standards of each functional region of the BC cell. The preset region proportion threshold for the main grid functional region and the via pad functional region is higher than the preset region proportion threshold for the fine grid functional region and the conductive adhesive functional region.

[0108] Please see Figure 5 Preferably, the specific steps for abnormal area location operations include:

[0109] Based on the effective difference image, functional regions where the proportion of difference pixels exceeds the region proportion threshold are identified as out-of-standard functional regions. Within the out-of-standard functional regions, a connected component analysis algorithm is used to identify all connected regions composed of difference pixels, and each connected region is marked as an independent initial suspected abnormal region. The coordinates of the minimum bounding rectangle of each initial suspected abnormal region are recorded to clarify its approximate distribution range in the effective difference image, thus completing the preliminary delineation of the abnormal regions.

[0110] The total number of differing pixels, the mean and median of the absolute value of grayscale difference are statistically analyzed within each initial suspected anomaly region. Combined with the difference judgment threshold of the corresponding functional region, a narrowing index calculation model is constructed to calculate the signal strength screening threshold for each initial suspected anomaly region. The narrowing index calculation model configures weighting factors based on functional region type, with weighting factors set according to the structural refinement, process tolerance, and defect impact of the functional region. For example, the main gate functional region and via pad functional region are given lower weights, while the fine gate functional region and conductive adhesive functional region are given higher weights. Simultaneously, the proportion of the total number of differing pixels and the concentration of grayscale difference are also considered. The coefficient serves as the core input factor. The proportion of the total number of difference pixels refers to the ratio of the number of difference pixels in the functional area to the total number of pixels in the functional area. The gray-level difference concentration coefficient refers to the ratio of the mean absolute value of gray-level difference in the functional area to the median absolute value of gray-level difference. The two core input factors and the weight factor work together to obtain the dynamic multiple. The signal strength screening threshold is the product of the difference judgment threshold of the corresponding functional area and the dynamic multiple. Among them, areas with dense difference pixels and concentrated gray-level differences correspond to higher dynamic multiples, while areas with sparse difference pixels and dispersed gray-level differences correspond to lower dynamic multiples, forming a personalized narrowing index that adapts to the difference characteristics of each area.

[0111] For each initial suspected anomaly region, the difference pixels are sorted by signal intensity. The absolute value of the gray-level difference of the difference pixels is used as the signal intensity index to filter out high signal intensity difference pixels in the initial suspected anomaly region whose absolute gray-level difference is higher than the personalized signal intensity screening threshold for that region. Then, a connected component analysis algorithm is used to analyze the connectivity of the high signal intensity difference pixels to form several high signal connected sub-regions. The minimum bounding rectangle of each high signal connected sub-region is used as the narrowed suspected anomaly region. Edge pixel regions in the initial suspected anomaly region with signal intensity less than or equal to the screening threshold are discarded to achieve the first narrowing of the anomaly region range and focus on the high-probability anomaly core area.

[0112] The system calls up the functional area template sub-image corresponding to the out-of-limit functional area. For example, if the fine grid functional area exceeds the limit, the fine grid functional area template sub-image is called; if the main grid functional area exceeds the limit, the main grid functional area template sub-image is called. Through edge detection and morphological analysis, the system extracts the typical morphological features of the printed structure within the functional area. Specifically, this includes structural contour features, such as the straight contour of the fine grid lines, the circular contour of the via pads, and the rectangular contour of the conductive adhesive; structural size features, such as the width of the fine grid lines, the diameter of the via pads, and the side length of the conductive adhesive; and structural distribution features, such as the parallel spacing of the fine grid lines and the vertical orientation of the main grid lines.

[0113] Based on the extracted typical morphological features, morphological matching is performed on the narrowed suspected abnormal regions: the suspected abnormal regions are divided into several local sub-regions of equal size, and the morphological features of each local sub-region are calculated, including: contour features, structural size features, and structural distribution features; then the similarity between each morphological feature of each local sub-region and the typical morphological features is calculated, and the comprehensive overlap between each local sub-region and the typical morphological features is obtained by weighted summation; the weights are set according to the importance of the functional region structure, such as the weight of the contour similarity of fine grid lines being higher than the weight of the size deviation rate;

[0114] Based on the structural fault tolerance of different functional areas, a preset overlap threshold is set. For example, if the fault tolerance of the conductive adhesive structure is low, the threshold is set high; if the fault tolerance of the main grid circuit is high, the threshold is set low. Local sub-regions with a comprehensive overlap greater than the threshold are selected and defined as morphological fitting regions, that is, regions that conform to the normal printed structural morphology. All morphological fitting regions are removed from the suspected abnormal regions after shrinking, and the remaining regions are the final abnormal regions. At the same time, the pixel coordinate range and morphological feature deviation parameters of the final abnormal regions are recorded.

[0115] Based on the pixel coordinate range of the abnormal region, an abnormal region mask with the same size as the effective difference image is generated. Pixels in the mask that coincide with the abnormal region are marked as valid identifiers, and the remaining pixels are marked as invalid identifiers.

[0116] Step S5: Call the defect feature library corresponding to the functional area to which the abnormal area belongs to identify the defect type and classify the defect level of the abnormal area; the defect feature library pre-stores typical defect feature parameters of typical printing in each functional area, such as the main grid functional area corresponding to defects such as broken grid and necking, the fine grid functional area corresponding to defects such as missing lines and short circuits, the via pad functional area corresponding to defects such as missing printing and misalignment, and the conductive adhesive functional area corresponding to defects such as overflow and insufficient adhesive; extract the morphological feature deviation parameters of the final abnormal area, and perform similarity matching calculation with the typical defect features in the defect feature library one by one. Determine the defect type according to the matching results, and classify the defect level according to the defect area, morphological deviation degree and functional impact weight in combination with the BC cell printing quality grading standard; at the same time, based on the existing The defect type characteristics are determined, and a full-domain sliding matching search is performed on the calibration observation sub-map corresponding to the functional area to which the abnormal area belongs. The number, distribution density, and spatial correlation of potential abnormal areas with similarity to the target defect characteristics that meet the preset threshold are statistically analyzed to determine whether there is a general trend of abnormal areas. If the potential abnormal areas are scattered and isolated and the number proportion is lower than the preset proportion, they are judged as local isolated anomalies. If the potential abnormal areas are concentrated and clustered or scattered throughout the entire domain and the number proportion is higher than the preset proportion, they are judged as having a general trend of abnormal areas. Finally, the defect type, defect level, abnormal distribution characteristics, and process problem judgment results are integrated to generate a complete inspection report, associate and store relevant image data and analysis parameters, and output corresponding sorting, rework, or process adjustment instructions.

[0117] In this embodiment, by calling a dedicated defect feature library for functional areas and combining the precise similarity matching of abnormal area morphological feature deviation parameters with typical defect features, rapid identification and accurate classification of printing defect types in different functional areas of BC solar cells are achieved, ensuring the professionalism and specificity of defect judgment. Simultaneously, a dedicated matching template is generated based on the identified defect types, and a full-domain sliding search is performed on the corresponding functional area's calibrated abnormal functional area observation sub-map. By statistically analyzing the proportion, distribution density, and spatial correlation of potential abnormal areas, local isolated anomalies are effectively distinguished from anomalies with general trends. This avoids missing common printing process problems caused by detecting a single abnormal area and prevents excessive process adjustments caused by misjudging local anomalies as general problems. Finally, multi-dimensional detection data is integrated to generate a complete report and output targeted processing instructions. This not only provides accurate basis for solar cell sorting and rework but also provides targeted improvement directions for screen printing process optimization, significantly improving the comprehensiveness, accuracy, and guiding value of BC solar cell printing quality inspection for production processes.

[0118] Preferably, the specific steps for identifying defect types and classifying defect levels in abnormal areas include:

[0119] The defect feature library corresponding to the functional area to which the abnormal region belongs is invoked. Based on the abnormal region mask, a local image of the abnormal region is extracted from the calibration observation image, and defect feature parameters are extracted: contour feature parameters, such as the number of fractures and boundary regularity, are obtained through edge detection and contour tracking techniques; dimensional feature parameters, such as the length, width, area, and dimensional deviation parameters of the abnormal region compared with normal structures, are obtained through dimensional measurement techniques; and grayscale feature parameters, such as the grayscale mean, grayscale variation amplitude, and grayscale abrupt change parameters, are obtained through grayscale statistical analysis. All extracted feature parameters are standardized according to the unified format of the defect feature library to eliminate the influence of differences in pixel scale and imaging conditions, forming a standardized feature parameter set for the abnormal region.

[0120] A weighted similarity calculation method is used to match the standardized feature parameter set of the abnormal region with the feature parameter sets of each typical defect in the corresponding functional region of the defect feature library. Differential similarity threshold standards are set according to the degree of structural refinement of the functional region; a higher similarity standard is used for fine-structure functional regions, while a relatively lenient similarity standard is used for macro-structure functional regions. If the matching similarity between the abnormal region and a typical defect is greater than the similarity threshold, the defect type of the abnormal region is determined to be that typical defect; if the matching similarity with all typical defects is not greater than the similarity threshold, it is marked as an atypical defect, triggering a manual review process.

[0121] By combining the area proportion of abnormal regions and the matching similarity of typical defects, a multi-indicator weighted fusion judgment logic is used to classify the defect levels of abnormal regions: the impact of defects on the electrical function of BC solar cells is used as the core weight factor. Functional defects such as broken grids and short circuits are given high weights, while non-functional defects such as minor glue overflow and slight misalignment are given low weights. Combining the quantitative contribution of the area proportion of abnormal regions and the matching similarity of typical defects, the defect levels are classified as follows: minor defects refer to defects whose matching similarity meets the judgment criteria, have a small area proportion, and a low functional impact weight, and have no substantial impact on the basic function of the solar cell; general defects refer to defects with a relatively high matching similarity, a moderate area proportion, and a moderate functional impact weight, which may affect the performance stability of the solar cell; severe defects refer to defects with a high matching similarity, a large area proportion, or a heavy functional impact weight, which directly lead to the functional failure or a significant decrease in performance of the solar cell. The consistency of the classified defect levels is verified by referring to the historical level judgment data of similar defects in the corresponding functional areas to ensure the rationality and uniformity of the level classification.

[0122] Preferably, the specific steps for determining whether an abnormal region exhibits a general trend include:

[0123] Based on the abnormal area defect type determined in step S5, extract a subset of typical defect feature parameters of the abnormal area defect type from the corresponding functional area defect feature library;

[0124] Based on the functional area template sub-image mask corresponding to the functional area to which the abnormal region belongs, an abnormal functional area observation sub-image is generated. A sliding window retrieval method is used to perform a full-domain scan of this abnormal functional area observation sub-image. The size of the sliding window is adapted and adjusted according to the typical size of the target defect and the structural density of the functional area to ensure complete coverage of the core features of a single target defect. During the traversal, the image defect features within each sliding window are compared with a subset of typical defect feature parameters to calculate the matching similarity. Sliding window regions with a matching similarity greater than a preset potential matching threshold are selected and marked as potential abnormal regions. The marked potential abnormal regions are deduplicated, and duplicate regions with high overlap are removed to form a set of potential abnormal regions without redundancy. The preset potential matching threshold is a judgment threshold set based on the fineness of the functional area structure and the sensitivity requirements of defect retrieval. The threshold for fine-structure functional areas is higher than that for macro-structure functional areas, and this threshold is lower than the defect type judgment threshold to balance the comprehensiveness and accuracy of potential abnormal region retrieval.

[0125] A multi-dimensional distribution characteristic analysis was performed on the set of potential anomaly regions. The total number of potential anomaly regions and the proportion of potential anomalies in the total area of ​​potential anomaly regions to the total area of ​​the observed submap were counted. The observed submap of the anomaly functional area was divided into several uniform grid units. The number of potential anomaly regions in each grid unit was counted, and the frequency of anomaly distribution in each grid unit was recorded. The center-to-center distance between any two potential anomaly regions was measured, and the distribution direction of the potential anomaly regions was fitted by clustering methods to determine whether there is a concentrated directional distribution pattern.

[0126] Based on the statistical results of the multi-dimensional distribution characteristic analysis, a general trend determination is performed. For example, if the total number of potential abnormal areas is small, the proportion of potential abnormalities is low, and the frequency of abnormal distribution in each grid unit is scattered with no concentrated high-frequency grid units, and the distribution direction does not show obvious clustering characteristics, it is determined to be a local isolated abnormality. If the total number of potential abnormal areas is large, the proportion of potential abnormalities is high, and there are multiple consecutive grid units forming an abnormal distribution frequency cluster, or the frequency of abnormal distribution in each grid unit evenly covers most grids, or the distribution direction shows significant clustering characteristics, it is determined that the abnormal area has a general trend.

[0127] Step S6: Based on the optimized mapping matrix constructed in Step S3, perform inverse coordinate transformation to determine the precise spatial location of each abnormal region in the observation sub-image. By substituting the pixel coordinates of the abnormal regions recorded in Step S4 in the template image coordinate system into the inverse transformation model of the mapping matrix, the corresponding coordinate set of each abnormal region in the original observation sub-image is obtained through reverse solving. This ensures the accurate mapping of the abnormal region location from the template image coordinate system to the observation sub-image coordinate system, eliminating the influence of geometric transformation on coordinate positioning. Based on the coordinate set obtained from the inverse transformation, standardized defect annotations are performed on the abnormal regions in the observation sub-image. The annotation content includes the boundary contour line, center marker point, and associated attribute labels of the abnormal region. The attribute labels include the defect type, defect level, functional area, and general trend judgment result. The annotation form adopts differentiated visual identifiers, where different defect levels correspond to different colored boundary contour lines, and general trends and local isolated anomalies correspond to center marker points of different shapes. The attribute labels are annotated in the form of structured text near the abnormal region to ensure that the annotation information is intuitive, identifiable, and unambiguous. After the annotation is completed, the observation sub-image with defect annotation is associated with the complete inspection report generated in step S5 and stored synchronously in the inspection data management system, providing a visual positioning basis and accurate coordinate data support for subsequent cell sorting, rework verification and process traceability.

[0128] This embodiment introduces a template matching defect detection system for screen printing of BC solar cells, including a calibration construction module, a template generation module, an observation and calibration module, an anomaly location module, a trend determination module, and a defect annotation module;

[0129] The core function of the calibration construction module is to generate a structured calibration dataset to support image registration. First, a full-area image of the back of a BC solar cell template sample, verified for multi-dimensional quality, is acquired and cropped to retain the template image containing the complete printed structure. Next, calibration points are marked in the template image, combining the structural features of the BC solar cell with the screen printing design drawings. Then, a preset range of image area is extracted for each calibration point, and three types of features—grayscale distribution, contour, and texture—are extracted and normalized. Finally, the calibrated points are numbered and feature vectors are generated. A mapping is established between the calibration point type and the feature vector, pixel coordinates, and number, forming the calibration dataset.

[0130] The template generation module is used to generate functional area template sub-images for single functional regions. First, according to the functional attributes of the BC battery cell printing structure, the template image is divided into main grid functional area, fine grid functional area, via pad functional area, and conductive adhesive functional area. Next, a main functional mask is generated for each functional area. Then, the functional area intersection is identified, and a functional intersection sub-mask is generated according to a preset attribution rule. This sub-mask is then merged with the main functional mask to form a complete functional area mask. Finally, the complete mask and the template image are subjected to pixel-level AND operation to retain the target area information and remove invalid information, resulting in a functional area template sub-image. Quality inspection is then performed to ensure that it meets subsequent requirements.

[0131] The observation calibration module is responsible for converting the observation image of the BC solar cell to be tested into a calibration observation image that matches the template image space. First, an image of the back of the BC solar cell to be tested is acquired and cropped to obtain an observation sub-image containing the complete printed structure. Next, the calibration dataset is called, and the target matching position of the calibration point is determined through feature comparison and geometric verification, and a mapping matrix is ​​constructed and optimized. Subsequently, a geometric transformation is performed on the observation sub-image based on the mapping matrix, non-integer coordinates are processed and redundant pixels at the edges are removed to form a preliminary calibration observation image. Finally, through grayscale reference region comparison and linear correction, the grayscale parameters of the calibration observation image are made consistent with those of the template image.

[0132] The anomaly localization module is used to achieve difference diagnosis and anomaly region localization. First, the calibration observation image and the template image are compared to generate a difference image, and after denoising, an effective difference image is obtained. Next, the difference signal is quantified and a difference judgment threshold is set according to the functional area to form a regional threshold system. Then, the proportion of difference pixels in each functional area is counted. If it exceeds the standard, localization is initiated: first, the initial suspected anomaly area in the functional area exceeding the standard is marked, and then the high signal area is screened and the range is narrowed by combining the regional weight and difference parameters. Finally, the template sub-image of the corresponding functional area is called to perform morphological matching. After removing the normal area, the final anomaly area is obtained. The coordinates and feature deviations are recorded and an anomaly area mask is generated.

[0133] The trend determination module is used to identify defect types, classify levels, determine general trends, and generate inspection reports. First, it calls the defect feature library for the corresponding functional area, extracts local images based on anomaly area masks, extracts features, and standardizes them into a parameter set. Next, it compares the parameter set with typical defects, sets similarity thresholds according to the functional area's precision, and determines the defect type. Then, it combines the proportion of anomaly area, matching similarity, and functional impact weight to classify defect levels and verify their rationality. Simultaneously, it extracts a subset of typical defect feature parameters to generate anomaly functional area observation sub-images, filters potential anomaly areas using a sliding window scan, and removes duplicates. It analyzes the distribution characteristics of potential anomaly areas to determine whether they are isolated local anomalies or general trends. Finally, it integrates all results to generate a complete inspection report and correlates the data.

[0134] The defect annotation module is used to implement coordinate mapping and defect annotation. First, the optimized mapping matrix is ​​called to inversely transform the pixel coordinates of the abnormal area in the template image coordinate system to obtain its coordinate set in the original observation sub-image. Next, standardized annotation is performed on the observation sub-image based on the coordinate set, and differentiated visual labels are used to ensure information clarity. Finally, the annotated observation sub-image is associated with the inspection report and stored in the data management system to support subsequent sorting, rework, and traceability.

[0135] Working principle and its effects:

[0136] This invention, centered on template matching, constructs a closed-loop process for the precise detection of screen printing defects in BC solar cells: First, it acquires template images of qualified BC solar cells, marks calibration points, and extracts multi-dimensional features to construct a calibration dataset. Simultaneously, it divides regions such as main grids and fine grids according to function, generating functional area masks and dedicated template sub-images. Next, it acquires and crops observation images of the solar cells to be inspected, constructs a mapping matrix through calibration point matching and geometric deviation constraint correction, and converts the observation sub-images into calibration observation images aligned with the template space, while simultaneously performing grayscale correction to eliminate interference. Then, it compares the calibration image with the template to generate an effective difference image, locates out-of-specification areas according to functional area dynamic thresholds, and filters precise abnormal areas by combining shrinkage indicators and morphological features. It calls a partitioned defect feature library to match defect types and classify levels, scans abnormal functional area observation sub-images to analyze general defect trends, and finally achieves precise coordinate labeling of defects and original observation sub-images through matrix inverse transformation.

[0137] This invention's differentiated detection of functional areas adapts to different structural defect requirements. Multi-dimensional calibration points and geometric constraint calibration significantly improve positioning accuracy and registration accuracy, reducing false detection rate. Partitioned defect feature library and multi-index level classification avoid type misjudgment and level deviation. Manual review of atypical defects ensures reliability. Defect general trend analysis breaks through the limitations of isolated detection, providing targeted data for process optimization. Precise coordinate labeling solves the problem of mismatch between defect location and actual battery cell, improving sorting and rework efficiency.

[0138] In summary, this invention deeply integrates template matching and functional area analysis to achieve precise processing of BC solar cell printing defects from positioning, identification, grading to trend analysis throughout the entire process. This ensures efficient connection between test results and production applications, significantly improves the level of intelligent testing and its practical value, and provides a reliable technical solution for photovoltaic cell quality control.

[0139] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method for template matching defect detection for screen printing of BC battery sheet, characterized in that, include: Obtain the template image, mark the calibration points of the template image, extract the feature vectors of the calibration points, and construct the calibration dataset; The template image is divided into functional regions, a functional region mask for each functional region is generated, and a pixel-level AND operation is performed with the template image to obtain the template sub-image of each functional region. The observation image of each BC cell to be tested is acquired, cropped according to the boundary coordinates to obtain the observation sub-image, the target matching position of the calibration point of the calibration dataset in the observation sub-image is identified to generate the initial affine mapping matrix between the observation sub-image and the template image, and corrected by geometric deviation constraints to construct the mapping matrix, which is used to generate the calibration observation image that matches the spatial position of the template image. A rapid difference diagnosis and comparison analysis is performed between the calibration observation image and the template image to generate an effective difference image. It is then determined whether the image meets the quality qualification criteria. If not, an abnormal area location operation is initiated to identify the non-compliant functional areas in the effective difference image and to delineate the initial suspected abnormal areas. By calculating the shrinkage index and the morphological feature overlap measure, the initial suspected abnormal areas are narrowed and abnormal areas are delineated. Based on the defect feature library corresponding to each functional area, the defect type of the abnormal area is matched and the defect level is classified; and according to the defect type, the abnormal functional area observation sub-image of the calibration observation image where the abnormal area is located is matched and searched to determine whether there is a general trend in the abnormal area. Based on the mapping matrix, the coordinate positions of each abnormal region in the observation submap are calculated through matrix inverse transformation, and defects are marked.

2. The method for template matching defect detection for screen printing of BC battery sheet as claimed in claim 1, wherein, The steps for constructing the calibration dataset include: Acquire the full-area image of the back of the template sample, and crop to remove invalid background areas and interfering pixels at the image edges to obtain the template image; The calibration points of the calibration template image are characteristic position points used to characterize the overall geometric distribution relationship of the printed pattern on the back of the BC battery cell; For each calibration point of a mark, a preset range image area centered on the calibration point is extracted from the template image. The size of the preset range image area is configured according to the size characteristics of the printing structure to which the calibration point belongs and the type of the calibration point. Obtain the pixel coordinates of the preset range image region of each calibration point in the template image, and extract the multi-dimensional features of the preset range image region of the calibration point, including gray-scale distribution features, contour features, and texture features; The multi-dimensional features of each calibration point are normalized, and each calibration point is uniquely numbered according to preset rules. Based on the normalized multi-dimensional features, a feature vector corresponding to each calibration point is generated; according to the type of calibration point, the feature vectors, corresponding pixel coordinates, unique numbers and type identifiers of all calibration points are classified and organized to form a structured calibration dataset.

3. The method for template matching defect detection for screen printing of BC battery sheet as claimed in claim 1 wherein, The steps for obtaining the template sub-images of each functional area include: The template image is divided into functional areas, including a main gate functional area, a fine gate functional area, a via pad functional area, and a conductive adhesive functional area. Based on the boundary features and structural morphology of each functional region, the main functional mask of each functional region is generated through image segmentation and contour extraction. Identify the intersection areas between functional areas, and generate functional intersection sub-masks containing only a single belonging according to the preset intersection area belonging rules. Perform pixel-level OR operation between the functional intersection sub-masks and the corresponding main functional masks to form the functional area masks of each functional area. Each functional area mask is ANDed with the template image at the pixel level to obtain a region image containing only a single function, which is then used as the functional area template sub-image.

4. The method for template matching defect detection for screen printing of BC battery sheet as claimed in claim 3, wherein, The steps for constructing the mapping matrix include: Acquire observation images for each BC solar cell to be tested, and crop and remove invalid background areas and interfering pixels according to the boundary coordinates of the observation images to obtain observation sub-images; Extract the type identifier, feature vector, and pixel coordinates of the calibration points in the calibration dataset; within the preset range image region corresponding to each type of calibration point, calculate the similarity between the local features of the preset range image region corresponding to the observation sub-image and the feature vector of the same type of calibration point in the calibration dataset, and identify the candidate positions of each calibration point; For each calibration point's candidate location, based on the relative position of the calibration point's pixel coordinates, a calibration point geometric association verification model is constructed to identify the target matching location for each calibration point. Based on the pixel coordinates corresponding to the target matching positions of each calibration point in the observation sub-image and the pixel coordinates of the corresponding calibration points in the calibration dataset, a coordinate correspondence pair is established; the least squares method is used to fit the coordinate correspondence pair, and the affine transformation equation system is solved to obtain the initial affine mapping matrix between the observation sub-image and the template image. Extract the functional area masks corresponding to the main gate functional area and the fine gate functional area, and obtain the center line pixel coordinates of the main gate line and the center line pixel coordinates of the fine gate line from the functional area masks; The initial affine mapping matrix is ​​applied to the observation sub-image to obtain the observation sub-image after preliminary transformation. The geometric deviation between the center line of the main grid, the center line of the fine grid in the observation sub-image after preliminary transformation and the corresponding center line pixel coordinates in the template image is calculated. Using this geometric deviation as a constraint term, a constraint optimization function is constructed to correct the initial affine mapping matrix and obtain the mapping matrix.

5. The method for template matching defect detection for screen printing of BC battery sheet as claimed in claim 1, wherein, The specific steps for generating a calibration observation image that matches the spatial location of the template image include: Perform a geometric transformation pixel by pixel on the observed sub-image. Substitute the original two-dimensional coordinates of each pixel in the observed sub-image into the inverse transformation formula of the mapping matrix to calculate the target coordinates of the pixel in the template image coordinate system. If the target coordinates are non-integer pixel coordinates, use bilinear interpolation to calculate the pixel gray value corresponding to the target coordinates. Based on the pixel size and coordinate range of the template image, all transformed pixels are rearranged according to the target coordinates to form a preliminary calibration observation image; Edge scanning is performed on the preliminary calibration observation image to identify pixels whose target coordinates exceed the effective coordinate range of the template image, which are then designated as redundant edge pixels. The gray values ​​of all redundant edge pixels are then set to a uniform gray value to obtain the calibration observation image. Select a grayscale reference region in the template image, calculate the average grayscale value and grayscale standard deviation of each grayscale reference region by pixel traversal, and record the coordinate range of each grayscale reference region. In the calibration observation image, based on the coordinate range of the gray-level reference area of ​​the template image, the corresponding gray-level reference area is located, the average gray-level value and gray-level standard deviation are calculated, and the gray-level parameters of the calibration observation image are adjusted to be consistent with those of the template image using a linear gray-level correction method.

6. The method for template matching defect detection for screen printing of BC battery sheet as claimed in claim 1 wherein, The steps for rapid difference diagnosis and comparison analysis between the calibration observation image and the template image include: The calibration observation image and the template image are imported into the same image processing coordinate system. A pixel-level difference algorithm is used to calculate the gray-level difference between corresponding positions of the calibration observation image and the template image pixel by pixel to obtain the initial difference image. Then, noise suppression processing is performed on the initial difference image to obtain the denoised effective difference image. The effective difference image is quantized, and the absolute value of the gray level difference of all non-zero gray level pixels in the effective difference image is counted. The mean and maximum gray level difference of the absolute value of the gray level difference of non-zero gray level pixels are calculated. A dynamic threshold division method is adopted to set the difference judgment threshold according to the functional area. Based on the difference judgment threshold of each region, perform regional difference statistics on the effective difference image, count the number of difference pixels in each functional region whose absolute gray-level difference exceeds the corresponding difference judgment threshold, and calculate the proportion of difference pixels in each functional region. If the percentage of difference pixels in each functional area does not exceed the preset area percentage threshold, the printing quality of the BC battery cell corresponding to the calibration observation image is deemed compliant; otherwise, the abnormal area location operation is initiated.

7. The method for template matching defect detection for screen printing of BC battery sheet as claimed in claim 6, wherein, The steps for dividing the abnormal regions include: Functional regions whose percentage of differential pixels exceeds the regional percentage threshold are classified as non-compliant functional regions. Within the non-standard functional area, identify all connected regions composed of differing pixels, and mark each connected region as an independent initial suspected abnormal region; The total number of differing pixels, the mean and median of the absolute value of the grayscale difference are counted in each initial suspected abnormal region. Combined with the difference judgment threshold of the corresponding functional region, a narrowing index calculation model is constructed to calculate the signal strength screening threshold corresponding to each initial suspected abnormal region. The signal strength screening threshold is a dynamic multiple of the difference judgment threshold of the corresponding functional region. Using the absolute value of the grayscale difference of the difference pixels as the signal strength index, high signal strength difference pixels with a grayscale difference higher than the corresponding signal strength screening threshold are selected in the initial suspected abnormal region to form several high signal connected sub-regions; and the minimum bounding rectangle of each high signal connected sub-region is used as the narrowed suspected abnormal region. Call the functional area template sub-image corresponding to the functional area that exceeds the standard, extract the typical morphological features of the printed structure in the functional area; and perform morphological matching on the suspected abnormal area after shrinkage, calculate the comprehensive overlap between each local sub-region of the suspected abnormal area and the typical morphological features. Local sub-regions with a comprehensive overlap greater than a preset overlap threshold are selected as shape-fitting regions. After removing shape-fitting regions from the suspected abnormal regions, they are designated as abnormal regions and an abnormal region mask is generated.

8. The method for template matching defect detection for screen printing of BC battery sheet as claimed in claim 1, wherein, The steps of matching the defect type of the abnormal region and classifying the defect level include: The defect feature library corresponding to the functional area to which the abnormal area belongs is called. Based on the abnormal area mask, a local image of the abnormal area is extracted from the calibration observation image. The defect feature parameters are extracted and standardized according to the unified format of the defect feature library to form a standardized feature parameter set of the abnormal area. The standardized feature parameter set of the abnormal region is matched with the typical defect feature parameter set of the corresponding functional region in the defect feature library one by one to calculate the similarity, and a differentiated similarity judgment threshold standard is set according to the functional region. If the similarity between an abnormal region and a typical defect is greater than the similarity threshold, the defect type of the abnormal region is determined to be the typical defect; if the similarity between the abnormal region and all typical defects is not greater than the similarity threshold, it is marked as an atypical defect, triggering the manual review process. By combining the proportion of abnormal area and the matching similarity of typical defects, the defect level of abnormal area is classified through a multi-indicator weighted fusion judgment logic.

9. The method for template matching defect detection for screen printing of BC battery sheet as claimed in claim 1, wherein, The steps for determining whether an abnormal region exhibits a general trend include: Based on the identified defect types in abnormal regions, a subset of typical defect feature parameters for that abnormal region defect type is extracted from the corresponding functional region defect feature library. Based on the template sub-map mask of the functional area corresponding to the functional area to which the abnormal area belongs, an abnormal functional area observation sub-map of the abnormal area is generated, and a full-domain scan of the abnormal functional area observation sub-map is performed through a sliding window. Calculate the matching similarity between the image defect features and the typical defect feature parameter subset within each sliding window, filter out the sliding window regions with matching similarity greater than the preset potential matching threshold, mark them as potential abnormal regions, and perform deduplication on the marked potential abnormal regions to form a set of potential abnormal regions. A multi-dimensional distribution feature analysis was performed on the set of potential anomaly regions. The total number of potential anomaly regions and the proportion of potential anomalies in the total area of ​​potential anomaly regions to the total area of ​​the observed submap were counted. The observed submap of the anomaly functional area was divided into several uniform grid cells. The number of potential anomaly regions in each grid cell was counted, and the frequency of anomaly distribution in each grid cell was recorded. The center-to-center distance between any two potential anomaly regions was measured, and the distribution direction of the potential anomaly regions was fitted by the directional vector clustering method. Based on the statistical results of the multi-dimensional distribution characteristic analysis, a general trend determination is performed.

10. A stencil matching defect detection system for BC cell screen printing for implementing the stencil matching defect detection method for BC cell screen printing according to any one of claims 1 to 9, characterized in that, It includes a calibration construction module, a template generation module, an observation and calibration module, an anomaly location module, a trend determination module, and a defect annotation module; The calibration construction module is used to construct a calibration dataset of template images; the template generation module is used to divide the template images into functional regions and obtain template sub-images for each functional region; the observation calibration module is used to collect observation images to match the positions of calibration point targets, construct a mapping matrix, and generate calibration observation images that match the spatial positions of the template images; the anomaly localization module is used to perform rapid difference diagnosis and comparison analysis between the calibration observation images and the template images, initiate anomaly region localization operations, and divide anomaly regions; the trend determination module is used to match the defect types of anomaly regions, classify defect levels, and determine whether there is a general trend in the anomaly regions. The defect annotation module is used to annotate defects based on the mapping matrix.