Image Processing-Based Stripe Defect Detection Methods, Systems, and Electronic Devices

By combining hierarchical threshold segmentation, connected component aggregation, and fault determination mechanism, the problem of false alarms and missed detections in defect detection of power battery CT scan images is solved, achieving high-precision defect identification and quantitative classification, which is suitable for quality control of power battery production lines.

CN123118587APending Publication Date: 2026-11-17FARASIS TECH (GANZHOU) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611435844.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-16
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing CT scan image defect detection methods for power batteries are prone to false alarms or missed detections when faced with low contrast, uneven local illumination, and complex structures. Furthermore, they are difficult to accurately separate adhesive defects, affecting the accuracy of defect size measurement and the assessment of fault severity.

Method used

A combined approach of hierarchical threshold segmentation, connected component aggregation, geometric feature segmentation, and fault determination mechanism is adopted. The region of interest is determined by hierarchical threshold segmentation, the candidate region of stripes is processed by connected component aggregation, the region is segmented according to geometric features and noise is filtered, and the fault determination mechanism is combined to achieve quantitative hierarchical classification.

Benefits of technology

It improves the accuracy of defect identification, ensures the non-destructive separation of adhesion defects, reduces the false alarm rate, and realizes the quantitative classification from the presence or absence of defects to the severity of defects, which facilitates production line handling and process optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118587A_ABST
    Figure CN123118587A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of computer vision image processing technology, and relates to a stripe defect detection method, system, and electronic device based on image processing. The method includes: performing hierarchical threshold segmentation on the acquired image to be detected to determine the region of interest and foreground feature regions within the region; performing connected component aggregation on the foreground feature regions to obtain at least one candidate connected component for stripes; when the candidate connected component for stripes satisfies a preset adhesion condition, determining a segmentation path based on its geometric features to obtain independent candidate stripe objects; performing multidimensional noise filtering on the candidate stripe objects according to preset geometric rules to determine valid defect stripes; and determining the corresponding quality detection result based on the characteristics of the valid defect stripes through a fault determination mechanism. This invention effectively overcomes the difficulties in segmenting uneven illumination and adhesion defects, significantly reduces the false alarm rate, and achieves quantitative hierarchical judgment from "presence or absence of defects" to "defect severity."
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision image processing technology, and relates to a stripe defect detection method, system and electronic device based on image processing. Background Technology

[0002] During the manufacturing process of power batteries, the internal quality of the battery cells (such as the alignment, wrinkles, fractures, and foreign objects of the electrode sheets) directly affects the safety and lifespan of the battery. Computed tomography (CT) technology is commonly used for non-destructive testing of electrode defects. However, due to the massive amount of data in CT scan images, the traditional method of manually examining slice images layer by layer is inefficient and prone to missed detections due to fatigue. Existing machine-automated identification methods (such as global threshold segmentation or general deep learning models) have insufficient noise resistance and are prone to false alarms or missed detections when faced with the low contrast, uneven local lighting, and complex internal structure of the battery cells characteristic of CT images. When multiple stripe defects in the image adhere together or when defects adhere to the normal texture of the battery cell, existing segmentation algorithms often process them crudely, making it difficult to perform accurate and non-destructive logical segmentation along the adhered neck, which greatly affects the measurement accuracy of defect size and subsequent fault severity assessment. Therefore, how to develop a power battery stripe defect detection scheme that can adaptively overcome uneven CT illumination, achieve high recognition accuracy, and accurately separate adhesion defects is a pressing problem to be solved in the field of non-destructive testing of battery cells. Summary of the Invention

[0003] The purpose of this invention is to address the aforementioned problems in existing technologies by proposing an image processing-based stripe defect detection method.

[0004] The objective of this invention can be achieved through the following technical solution: a stripe defect detection method based on image processing, comprising: The acquired image to be detected is subjected to hierarchical threshold segmentation to determine the region of interest and the foreground feature region within the region of interest; Connectivity aggregation is performed on the foreground feature region to obtain at least one stripe candidate connected region; Determine whether the candidate connected region of the stripe satisfies the preset adhesion condition. If it does, determine the corresponding segmentation path based on the geometric features of the candidate connected region of the stripe to perform segmentation and obtain independent candidate stripe objects. The candidate stripe objects are subjected to noise filtering according to preset geometric rules to determine the effective defect stripes; Based on the characteristics of the effective defect stripes, the corresponding quality inspection results are determined through a fault determination mechanism.

[0005] As an optional embodiment of the present invention, the acquired image to be detected is subjected to hierarchical threshold segmentation to determine the region of interest and the foreground feature region within the region of interest, including: The gray-level difference between the bright and non-bright regions is obtained from the global gray-level histogram of the image to be detected, and the global threshold is calculated based on the gray-level difference. The image to be detected is binarized according to the global threshold, and the region of interest is extracted based on the boundary points in the horizontal or vertical direction after binarization. The foreground feature region is obtained within the region of interest using a sliding window dynamic thresholding method.

[0006] As an optional embodiment of the present invention, the foreground feature region is obtained within the region of interest using a sliding window dynamic thresholding method, including: The region of interest is traversed using a sliding window of a preset size and a preset step size; Calculate the mean gray value and standard deviation of the pixels within the sliding window, use the mean gray value as a local background reference, and determine the dynamic threshold of the current pixel to be processed through a dynamic threshold function; The region of interest is divided into a foreground region and a background region based on the dynamic threshold, and the foreground region is used as the foreground feature region.

[0007] As an optional embodiment of the present invention, connected component aggregation is performed on the foreground feature region to obtain at least one stripe candidate connected component, including: Extract foreground pixels in the foreground feature region that have not yet been assigned to any established connected region as seed points; Based on the principle of 8-connected domains, a diffusion search is performed on the surrounding pixels. Adjacent pixels that meet the connectivity conditions are aggregated into independent stripe candidate connected domains, and the ownership status of the aggregated pixels is updated.

[0008] As an optional embodiment of the present invention, the step of determining the corresponding segmentation path for segmentation based on the geometric features of the candidate connected components of the stripes to obtain independent candidate stripe objects includes: For the candidate connected regions of the stripes that are determined to be adhered, extract their grayscale distribution information or distance transformation information; Local minimum points are found in the gray-scale distribution information or the distance transformation information, and the local minimum points that are determined to be adjacent are connected to form a dividing line; The candidate connected region of the stripe is divided along the dividing line to obtain at least two independent candidate stripe objects.

[0009] As an optional embodiment of the present invention, noise filtering is performed on the candidate stripe objects according to preset geometric rules to determine valid defect stripes, including: Obtain the pixel area, aspect ratio of the bounding box, and geometric principal axis length of the candidate stripe object; Candidate stripe objects whose pixel area is less than a preset area threshold, whose aspect ratio of the bounding box is less than a preset ratio threshold, or whose geometric principal axis length is shorter than a preset length threshold are filtered, and the remaining candidate stripe objects are used as valid defect stripes.

[0010] As an optional embodiment of the present invention, the corresponding quality inspection result is determined through a fault determination mechanism based on the characteristics of the effective defect stripes, including: Extract the defect feature parameter combination of the effective defect stripes. The defect feature parameter combination includes the number of effective defect stripes, total length, maximum single stripe length, and average width. When there are no effective defect stripes, the corresponding parameter value is set to zero. The quality score is obtained by multiplying each parameter value in the defect feature parameter combination by the corresponding weight coefficient and performing a weighted calculation. Based on the preset grading range in which the quality score value falls, output graded quality detection results corresponding to different fault severity levels.

[0011] This invention also proposes an image processing-based stripe defect detection system, comprising: The region segmentation module is used to perform hierarchical threshold segmentation on the acquired image to be detected in order to determine the region of interest and the foreground feature region within the region of interest; The connectivity aggregation module is used to perform connectivity aggregation on the foreground feature region to obtain at least one stripe candidate connectivity region. The stripe cutting module is used to determine whether the stripe candidate connected region meets the preset adhesion condition. When the condition is met, the module determines the corresponding segmentation path based on the geometric features of the stripe candidate connected region to perform segmentation and obtain independent candidate stripe objects. The noise filtering module is used to filter noise from the candidate stripe objects according to preset geometric rules and determine the effective defect stripes. The quality inspection module is used to determine the corresponding quality inspection result based on the characteristics of the effective defect stripes through a fault determination mechanism.

[0012] As an optional embodiment of the present invention, the region segmentation module includes: The global threshold calculation module is used to obtain the gray-level difference between the bright and non-bright regions based on the global gray-level histogram of the image to be detected, and to calculate the global threshold based on the gray-level difference. The region of interest extraction module is used to binarize the image to be detected according to the global threshold, and extract the region of interest based on the boundary points in the horizontal or vertical direction after binarization. The feature region extraction module is used to obtain the foreground feature region within the region of interest using a sliding window dynamic thresholding method.

[0013] The present invention also provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to implement the above-described image processing-based stripe defect detection method when executing executable instructions.

[0014] Compared with the prior art, the present invention has the following beneficial technical effects: (1) By using a hierarchical threshold segmentation strategy, the region of interest can be stably defined and external background noise can be eliminated. It can also adaptively compensate for the effects of uneven local illumination in CT images, effectively enhance the contrast of weak stripe features, and greatly improve the recognition accuracy.

[0015] (2) By performing connected component aggregation on the foreground feature region, discrete pixel clusters that are spatially adjacent and belong to the same physical defect can be integrated into independent stripe candidate connected components, which effectively avoids the falsely high number of defects caused by pixel-level breaks due to imaging noise.

[0016] (3) When adhesion is determined, the segmentation path is adaptively determined based on geometric features for segmentation, which overcomes the defect of traditional morphological corrosion operation that destroys the original long strip geometric shape of the stripes, and ensures the accuracy of size and quantity measurement of multiple adhered stripes after non-destructive separation.

[0017] (4) By using multidimensional preset geometric rules to specifically filter speckle noise, artifacts and non-striated impurities, a highly targeted morphological feature filter is constructed, which can accurately remove impurity interference and significantly reduce the false alarm rate of defects in complex CT imaging backgrounds.

[0018] (5) By using the fault judgment mechanism, the geometric features of effective defect stripes are transformed into objective quality inspection results, realizing the quantitative classification judgment from "whether there is a defect" to "the severity of the defect", which facilitates the production line to implement downgrading or rework, and provides data traceability support for process parameter optimization. Attached Figure Description

[0019] Figure 1 This is a flowchart of a stripe defect detection method based on image processing according to an embodiment of the present invention; Figure 2 This is a block diagram of a stripe defect detection system based on image processing according to an embodiment of the present invention. Detailed Implementation

[0020] The following are specific embodiments of the present invention, which are described in conjunction with the accompanying drawings. However, the present invention is not limited to these embodiments.

[0021] Example 1

[0022] Based on the technical problems highlighted in the background, this embodiment proposes a stripe defect detection method based on image processing, such as... Figure 1 As shown, it includes: S1, perform hierarchical threshold segmentation on the acquired image to be detected to determine the region of interest and the foreground feature region within the region of interest; S2, perform connected component aggregation on the foreground feature region to obtain at least one stripe candidate connected component; S3, determine whether the candidate connected region of the stripe satisfies the preset adhesion condition. If it does, determine the corresponding segmentation path according to the geometric features of the candidate connected region of the stripe to perform segmentation and obtain independent candidate stripe objects. S4. Noise filtering is performed on the candidate stripe objects according to preset geometric rules to determine the effective defect stripes; S5. Based on the characteristics of the effective defect stripes, the corresponding quality inspection result is determined through a fault determination mechanism.

[0023] In this embodiment, the image to be detected is a CT scan image of a power battery. The presence of internal structural defects in the power battery is identified by analyzing the CT scan image. After acquiring the original CT scan image, it is first preprocessed with contrast enhancement and smoothing filtering to remove high-frequency noise and edge artifacts, thus obtaining the image to be detected. Besides the battery cell itself, the image contains a large amount of background area and edge noise. Directly performing local feature retrieval on the entire image would not only consume excessive computational resources, but also easily lead to false detections due to impurities in the background. Furthermore, due to the attenuation of CT rays penetrating the battery cell, the image usually exhibits uneven local brightness distribution (e.g., higher brightness in the central area and darker edge areas). If a single fixed threshold is used for full-image segmentation, false positives are easily generated in darker areas and false negatives in brighter areas. To address these issues, this embodiment adopts a hierarchical threshold segmentation strategy. First, a global threshold is determined based on the overall grayscale distribution characteristics of the image. After binarization, coarse segmentation is performed to extract the region of interest (ROI) of the battery cell. Subsequently, a sliding window dynamic thresholding method is applied within the region of interest to overcome the influence of local brightness fluctuations and accurately extract the foreground feature region containing potential defects (such as dark or bright stripes).

[0024] Due to interference from imaging noise and fluctuations in X-ray attenuation, the defect features identified after binarization often fail to present a completely continuous linear shape, easily breaking into discrete pixel clusters. Directly counting these clusters can lead to a single physically present stripe being misclassified as multiple independent small defects, resulting in an inflated defect count. Therefore, it is necessary to perform connected component aggregation processing on the foreground feature region, aggregating spatially adjacent discrete pixel clusters belonging to the same physical defect into independent connected regions, ensuring that each physically present defect stripe uniquely corresponds to a candidate connected region.

[0025] During the imaging process, due to factors such as uneven local illumination distribution or strong light scattering, spatially adjacent stripe defects are prone to forming adhesion regions in the image. Without segmentation processing, this will significantly affect the accuracy of subsequent measurement of the number and size (such as length) of defects. In this embodiment, the aggregated stripe candidate connected regions are matched with preset adhesion conditions. For adhesion regions that meet the conditions, the optimal segmentation path is determined based on their geometric and grayscale characteristics, and logical segmentation is performed to restore the physically independent morphology of each defect and obtain independent candidate stripe objects.

[0026] After stripping and segmentation, isolated noise points, non-striped impurities, or ring artifacts may still remain in the candidate set. These noises typically do not possess the geometric morphological characteristics of typical striped defects. Therefore, this embodiment pre-sets multi-dimensional geometric rules based on the physical geometric properties of real striped defects to rigorously screen and filter noise from candidate stripe objects, accurately eliminating non-striped interference. The remaining candidate objects are then determined as real and valid defect stripes.

[0027] In actual industrial production, the traditional binary judgment mechanism that only distinguishes between "qualified" and "scrap" lacks flexibility and cannot meet the requirements of refined quality control (for example, some battery cells may only have extremely minor scratches, which can be handled by downgrading or manual review). This embodiment achieves a leap from simple identification of "whether there is a defect" to quantitative grading assessment of "defect severity" through a multi-dimensional feature-weighted fault judgment mechanism. Based on this judgment mechanism, corresponding graded quality inspection results are output, and a final inspection report is generated. This report includes information such as the physical coordinates of the defect mapped back to the original CT scan image from the region of interest, the combination of defect feature parameters, and a screenshot of the defect area, providing data support for subsequent quality traceability and production line feedback.

[0028] Preferably, the acquired image to be detected is subjected to hierarchical threshold segmentation to determine the region of interest and the foreground feature region within the region of interest, including: The gray-level difference between the bright and non-bright regions is obtained from the global gray-level histogram of the image to be detected, and the global threshold is calculated based on the gray-level difference. The image to be detected is binarized according to the global threshold, and the region of interest is extracted based on the boundary points in the horizontal or vertical direction after binarization. The foreground feature region is obtained within the region of interest using a sliding window dynamic thresholding method.

[0029] A global grayscale histogram is calculated for the preprocessed image to be detected. Because there is a significant grayscale step between the battery cell and the external air background in the CT image, the histogram clearly distinguishes the low-grayscale region representing the background from the bright central region representing the battery cell. The grayscale difference between these two regions is then calculated. This grayscale difference is multiplied by a preset adjustment coefficient to obtain the global threshold. The necessity of introducing a preset adjustment coefficient for weighted control lies in the slight fluctuations in material density between different batches of battery cells and the X-ray attenuation substrate of different CT devices. If the threshold is set directly based on the original grayscale difference, it is easily affected by edge halo attenuation or high-frequency artifacts. By introducing a preset adjustment coefficient to proportionally map and correct the gain of the grayscale difference, the binarized threshold can be accurately located at the optimal grayscale gradient boundary between the outer wall of the battery cell and the background, thereby significantly improving the adaptability and robustness of edge localization and eliminating boundary judgment deviations caused by environmental fluctuations.

[0030] The pixel grayscale values ​​in the image to be detected are compared with a global threshold to complete binarization segmentation. In the binarized image, the main body of the battery cell appears as a continuous bright foreground region. By scanning line by line along the horizontal or vertical direction of the image, the outermost boundary pixels of this bright region are captured, and the internal region enclosed by these boundary points is cropped and extracted as the region of interest, effectively eliminating irrelevant background interference outside the battery cell and setting a clear spatial range constraint for the subsequent identification of weak internal features. Subsequently, within the determined region of interest, a dynamic thresholding mechanism based on a sliding window is introduced. By gradually traversing the region of interest through the sliding window, the dynamic threshold is adaptively calculated based on the statistical characteristics within the local window, thereby effectively compensating for the difference in grayscale attenuation between the center and the edge of the CT image and accurately segmenting the foreground feature region containing potential defect stripes.

[0031] Preferably, the foreground feature region is obtained within the region of interest using a sliding window dynamic thresholding method, including: The region of interest is traversed using a sliding window of a preset size and a preset step size; Calculate the mean gray value and standard deviation of the pixels within the sliding window, use the mean gray value as a local background reference, and determine the dynamic threshold of the current pixel to be processed through a dynamic threshold function; The region of interest is divided into a foreground region and a background region based on the dynamic threshold, and the foreground region is used as the foreground feature region.

[0032] A sliding window with a preset window size of W×H (e.g., 32×32 pixels) is set, and the region of interest is scanned step by step with a preset step size S (e.g., 1 pixel or 5 pixels). For the local pixel area currently covered by the sliding window, the grayscale mean of all pixels within the window is calculated. With gray standard deviation Among them, the grayscale mean Used to characterize the background reference brightness of the current local area in real time, while the grayscale standard deviation This is used to reflect the severity of grayscale fluctuations in that local area. Based on this, the dynamic threshold of the current pixel to be processed is calculated using a preset dynamic threshold function. The dynamic threshold function can be specifically expressed as:

[0033] In the formula, This is a preset sensitivity coefficient used to adaptively adjust the algorithm's sensitivity to identifying local weak stripe features.

[0034] The region of interest is divided into foreground and background regions based on the calculated dynamic threshold. Specifically, when the defect to be detected appears as a low-grayscale dark stripe, if the current pixel's grayscale value is less than the corresponding dynamic threshold... If the pixel value is greater than the corresponding dynamic threshold, it is considered a foreground pixel. When the defect to be detected appears as a high-grayscale bright stripe, if the current pixel's grayscale value is greater than the corresponding dynamic threshold... If the pixel is dark, it is identified as a foreground pixel. Through a sliding window adaptive mechanism, the segmentation threshold can be automatically lowered at the darker edges of the region of interest and adaptively raised at the brighter center, thereby fully compensating for the uneven image illumination caused by ray attenuation, accurately extracting the foreground region containing weak stripe features, and using this foreground region as the foreground feature region for subsequent processing.

[0035] As an optional alternative implementation of this embodiment, the thresholding method for segmenting and extracting foreground feature regions described above is not limited to local dynamic thresholding based on sliding windows. It can also be replaced by a method based on adaptive histogram equalization (e.g., contrast-limited adaptive histogram equalization). Specifically, the extracted region of interest is divided into several locally non-overlapping or overlapping image sub-blocks. For each image sub-block, its local gray-level histogram is calculated and gray-level mapping and contrast-limited equalization processing are performed. Bilinear interpolation is used to eliminate the block effect at the sub-block splicing boundary. Through the adaptive histogram equalization operation, the contrast between each local weak defect stripe in the region of interest and the surrounding cell substrate can be adaptively stretched and enhanced, suppressing the influence of overall gray-level attenuation and uneven illumination in CT imaging. On the region of interest enhanced by adaptive histogram equalization, further binarization segmentation is performed by combining global thresholding or fixed relative thresholding, which can also segment and extract the foreground feature regions where potential defect stripes are located with high sensitivity and high signal-to-noise ratio. Through this alternative implementation, the compatibility and engineering feasibility of image enhancement and feature segmentation under different imaging quality scenarios are improved.

[0036] Preferably, the foreground feature region is subjected to connected component aggregation to obtain at least one stripe candidate connected component, including: Extract foreground pixels in the foreground feature region that have not yet been assigned to any established connected region as seed points; Based on the principle of 8-connected domains, a diffusion search is performed on the surrounding pixels. Adjacent pixels that meet the connectivity conditions are aggregated into independent stripe candidate connected domains, and the ownership status of the aggregated pixels is updated.

[0037] Traverse the binarized foreground feature region and find foreground pixels that have not yet been assigned to any established connected region (i.e., pixels with foreground values ​​and in an unvisited state) as starting seed points. Using this seed point as the center, perform a diffusion search to surrounding pixels based on the eight-connected-region principle. Specifically, search neighboring pixels along eight directions: horizontal (left-right), vertical (up-down), and four diagonals. If adjacent pixels are also foreground pixels and satisfy the connectivity condition, they are merged into the currently constructed connected region, and the membership status of these aggregated pixels is simultaneously updated to mark them as visited, preventing duplicate searches.

[0038] The above diffusion search process is continuously iterated until no new adjacent foreground pixels meeting the connectivity conditions can be found in any of the eight directions, thus closing and forming a complete connected region. This region is then assigned a unique candidate object identifier (ID) and used as a stripe candidate connected component. New seed points are extracted iteratively, and the above diffusion aggregation process is repeated until all foreground pixels within the foreground feature region have been assigned a domain.

[0039] Compared to traditional contour finding methods, the diffusion aggregation mechanism based on eight-connected domain flooding can effectively capture weak diagonal connections caused by CT noise or micro-discontinuities, overcome the defect fragmentation problem caused by local pixel-level breaks in polar stripes, and ensure that individual defects at the physical level are accurately aggregated into a single stripe candidate connected domain, avoiding an inflated number of defects. At the same time, feature aggregation of independent objects is completed before performing adhesion segmentation, which greatly reduces the computational complexity of subsequent algorithms.

[0040] Preferably, the step of determining the corresponding segmentation path for segmentation based on the geometric features of the candidate stripe connected components to obtain independent candidate stripe objects includes: For the candidate connected regions of the stripes that are determined to be adhered, extract their grayscale distribution information or distance transformation information; Local minimum points are found in the gray-scale distribution information or the distance transformation information, and the local minimum points that are determined to be adjacent are connected to form a dividing line; The candidate connected region of the stripe is divided along the dividing line to obtain at least two independent candidate stripe objects.

[0041] In this embodiment, connected regions in the stripe candidate connected regions whose area is greater than a preset area threshold (e.g., 500 pixels) or whose circumscribed rectangle size is abnormal are identified as sticky regions (i.e., stripe candidate connected regions that are determined to be sticky). For such sticky regions, their grayscale distribution information along a specific direction (e.g., longitudinal or pole piece extension direction) is extracted, or a distance transformation is performed on them to generate a distance-transformed image (i.e., the Euclidean distance field from each foreground pixel in the region to the nearest background boundary is calculated).

[0042] Local minima are searched for in the obtained grayscale distribution information or distance transformation information, and adjacent local minima are connected to generate a segmentation line. Adjacency refers to a set of local minima that are closest in spatial Euclidean distance and whose direction changes continuously on adjacent scan lines (or adjacent rows / columns of pixels). After determining each local minima, minima satisfying the above adjacency relationship are sequentially connected according to spatial adjacency order, thus constructing a continuous two-dimensional segmentation line spanning the narrow part of the entire adhesion region. Logical segmentation is performed on the candidate connected regions of the adhesion stripes along the generated segmentation line, accurately dividing the originally merged single connected region into at least two physically independent sub-regions with complete boundaries, and classifying each sub-region as an independent candidate stripe object. The segmentation strategy based on local minima paths can adaptively capture the narrowest point of the geometry of the adhesion region for precise cutting, overcoming the defect of traditional morphological erosion operations that easily destroy the original long strip geometry of the stripes.

[0043] As an optional alternative implementation of this embodiment, the segmentation method for the aforementioned adhesion region is not limited to the segmentation strategy based on the connection of local minima. In some implementations, the watershed algorithm can also be used for segmentation. Specifically, by inverting the distance transformation image of the adhesion region or constructing a gradient magnitude map, the local extrema within the adhesion region are used as water injection marker basins. The inundation process is simulated to construct a watershed ridge that separates different catchment basins. The adhesion region is then truncated pixel by pixel along this watershed ridge, which can also accurately locate the adhesion neck and segment it into independent candidate stripe objects.

[0044] In other implementations, a skeletonization cutting method can also be used for segmentation. Specifically, the central skeleton line is extracted by morphological topological refinement of the adhered region, and the intersection nodes (such as ternary or multi-branch points) generated by adhesion and overlap on the skeleton line are detected. At the intersection nodes, the skeleton connection is truncated along the direction perpendicular to the extension of the skeleton trunk, and the original binary adhered region is guided to perform region growth or reverse reconstruction based on the truncated independent skeleton segments, thereby achieving accurate segmentation of the adhered connected domain and extraction of independent candidate stripe objects.

[0045] By providing the above-mentioned multiple optional adaptive segmentation mechanisms, the algorithm can flexibly adapt to various adhesion patterns caused by different imaging factors such as complex illumination distribution and grayscale diffusion, further enhancing the robustness of stripe pattern protection and number counting.

[0046] Preferably, noise filtering is performed on the candidate stripe objects according to preset geometric rules to determine valid defect stripes, including: Obtain the pixel area, aspect ratio of the bounding box, and geometric principal axis length of the candidate stripe object; Candidate stripe objects whose pixel area is less than a preset area threshold, whose aspect ratio of the bounding box is less than a preset ratio threshold, or whose geometric principal axis length is shorter than a preset length threshold are filtered, and the remaining candidate stripe objects are used as valid defect stripes.

[0047] For each candidate stripe object obtained after segmentation and extraction, multidimensional geometric feature parameters are extracted and calculated, including pixel area, aspect ratio of bounding box, and length of geometric principal axis.

[0048] In the specific screening process, the total number of foreground pixels contained in the candidate stripe object is calculated as the pixel area. If the pixel area is less than a preset area threshold (e.g., 10 pixels), the object is identified as a small speckle noise or isolated particle impurity in the CT image and is removed. Simultaneously, a minimum bounding box containing the candidate stripe object is constructed, and the ratio of the long side to the short side of the bounding box is calculated as the aspect ratio of the bounding box. Real electrode wrinkles or misalignments have significant elongated characteristics in their physical morphology, and their aspect ratio is usually high (e.g., greater than 3:1 or 5:1), while most impurities or lighting artifacts are usually close to circular or equiaxed blocks (aspect ratio close to 1:1). Therefore, if the aspect ratio of the bounding box of a candidate stripe object is lower than a preset ratio threshold, it is considered not to meet the stripe characteristics and is removed.

[0049] The geometric principal axis of candidate stripe objects along the main extension direction is extracted, and the physical measurement length along the geometric principal axis is calculated as the geometric principal axis length. If the geometric principal axis length is shorter than a preset length threshold (e.g., 10 pixels), it is judged as a short interference region without continuity and is removed. Candidate stripe objects with a pixel area smaller than a preset area threshold, an aspect ratio of the bounding box lower than a preset ratio threshold, or a geometric principal axis length shorter than a preset length threshold are all judged as non-stripe noise; only candidate stripe objects that simultaneously meet the above geometric rules are retained as the final valid defect stripes. The multi-dimensional geometric feature combination screening mechanism, which combines pixel area, bounding box aspect ratio, and geometric principal axis length, overcomes the technical shortcomings of traditional single thresholds (e.g., relying solely on area size) that cannot effectively distinguish between large-sized block artifacts and thin, weak stripes. It constructs a highly targeted morphological feature filter for polar stripe defects, which can accurately remove residual artifacts and impurities in CT images and significantly reduce the false alarm rate during the detection process.

[0050] Preferably, based on the characteristics of the effective defect stripes, the corresponding quality inspection result is determined through a fault determination mechanism, including: Extract the defect feature parameter combination of the effective defect stripes. The defect feature parameter combination includes the number of effective defect stripes, total length, maximum single stripe length, and average width. When there are no effective defect stripes, the corresponding parameter value is set to zero. The quality score is obtained by multiplying each parameter value in the defect feature parameter combination by the corresponding weight coefficient and performing a weighted calculation. Based on the preset grading range in which the quality score value falls, output graded quality detection results corresponding to different fault severity levels.

[0051] For the final selected and retained valid defect stripes, a defect feature parameter combination is extracted through a fault determination mechanism. This combination includes the number of valid defect stripes, total length, maximum single stripe length, and average width. When no valid defect stripes are detected in the image, the values ​​of each parameter in the defect feature parameter combination are directly initialized to zero.

[0052] After extracting the combination of defect feature parameters, each parameter value is multiplied by its corresponding weighting coefficient and weighted to obtain a comprehensive quality score for evaluating the cell quality. The average width is only used in the inspection report output and does not participate in the scoring. Specifically, a defect scoring function is constructed based on the number of valid defect stripes, the ratio of total length to the maximum single strip length, and a penalty term for the maximum single strip length exceeding a preset maximum allowable length.

[0053] In the formula, The effective number of defect stripes; For the total length, The maximum length of a single strip. This is the preset maximum allowed length; , , These correspond to the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient, respectively. By setting the weighting coefficients, the influence of the number of defects, the concentration of stripe morphology, and the ultra-long defects on the quality score can be adaptively adjusted to ensure that the quality score can accurately and objectively reflect the actual damage status of the cell electrodes inside the battery.

[0054] Based on the calculated quality score and maximum single stripe length, the system outputs graded quality inspection results corresponding to different fault severity levels, compared to preset grading intervals. When the quality score is zero (i.e., no valid defect stripes are found), the output result is "qualified." When the quality score is greater than zero and less than or equal to the preset re-inspection threshold, the current cell is determined to have only a few short stripes, the output result is "minor defect," and it is marked as requiring manual re-inspection. When the quality score is greater than the preset re-inspection threshold, or the maximum single stripe length is greater than the preset severity limit threshold, it is determined to have serious safety hazards such as long or dense stripes, and the output result is directly "severe defect, unqualified product."

[0055] It should be noted that in the above judgment mechanism, the preset severe limit threshold is strictly greater than the preset maximum allowable length. The preset maximum allowable length acts as a flexible boundary in the scoring function, used to continuously weight deduct points for stripes that begin to exceed the safe range; while the preset severe limit threshold acts as a rigid boundary, representing the highest safe limit to which the physical size of a single stripe is intolerable. As long as the maximum length of a single stripe exceeds the preset severe limit threshold, regardless of the quality score, it is directly judged as a severe defect, thus establishing a dual safety guarantee mechanism from flexible score penalty to rigid limit interception.

[0056] After determining the graded quality inspection results, a complete inspection report is generated, including the determination result grade, defect feature parameters, defect screenshot, and defect location coordinates. When calculating the defect location coordinates, the defect pixel coordinates previously located within the effective region of interest are reverse-mapped back to the original CT scan grayscale image, accurately restoring the specific physical location of the defect in the original image and the actual three-dimensional space of the battery cell.

[0057] By establishing a weighted scoring and threshold grading mechanism from image features to quality indicators, the limitations of traditional testing, which can only achieve binary judgment of pass or fail, are overcome. It can accurately quantify and assess the severity of defects, making it easier for battery production lines to implement targeted downgrading, rework, or scrapping based on different defect levels. At the same time, the specific feature parameters and mapping coordinates output by the test report provide key data support for quality traceability and reverse parameter optimization of battery manufacturing processes.

[0058] Example 2

[0059] Based on the principles described in Embodiment 1, an image processing-based stripe defect detection system 100 is also proposed, such as... Figure 2 As shown, it includes: The region segmentation module 110 is used to perform hierarchical threshold segmentation on the acquired image to be detected in order to determine the region of interest and the foreground feature region within the region of interest; The connectivity aggregation module 120 is used to perform connectivity aggregation on the foreground feature region to obtain at least one stripe candidate connectivity region. The stripe cutting module 130 is used to determine whether the stripe candidate connected region meets the preset adhesion condition. When the condition is met, the corresponding segmentation path is determined according to the geometric features of the stripe candidate connected region to perform segmentation and obtain independent candidate stripe objects. Noise filtering module 140 is used to perform noise filtering on the candidate stripe object according to preset geometric rules to determine the effective defect stripes; The quality inspection module 150 is used to determine the corresponding quality inspection result based on the characteristics of the effective defect stripes through a fault determination mechanism.

[0060] Preferably, the region segmentation module 110 includes: The global threshold calculation module is used to obtain the gray-level difference between the bright and non-bright regions based on the global gray-level histogram of the image to be detected, and to calculate the global threshold based on the gray-level difference. The region of interest extraction module is used to binarize the image to be detected according to the global threshold, and extract the region of interest based on the boundary points in the horizontal or vertical direction after binarization. The feature region extraction module is used to obtain the foreground feature region within the region of interest using a sliding window dynamic thresholding method.

[0061] Example 3

[0062] Furthermore, an electronic device is proposed, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to implement the image processing-based stripe defect detection method of Embodiment 1 when executing executable instructions.

[0063] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.

[0064] Furthermore, it should be noted that the use of terms such as "first," "second," and "a" in this invention is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified. The terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two elements or the interaction between two elements, unless otherwise explicitly specified. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0065] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0066] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.

Claims

1. A stripe defect detection method based on image processing, characterized in that, include: The acquired image to be detected is subjected to hierarchical threshold segmentation to determine the region of interest and the foreground feature region within the region of interest; Connectivity aggregation is performed on the foreground feature region to obtain at least one stripe candidate connected region; Determine whether the candidate connected region of the stripe satisfies the preset adhesion condition. If it does, determine the corresponding segmentation path based on the geometric features of the candidate connected region of the stripe to perform segmentation and obtain independent candidate stripe objects. The candidate stripe objects are subjected to noise filtering according to preset geometric rules to determine the effective defect stripes; Based on the characteristics of the effective defect stripes, the corresponding quality inspection results are determined through a fault determination mechanism.

2. The method according to claim 1, characterized in that, The acquired image to be detected is subjected to hierarchical threshold segmentation to determine the region of interest and the foreground feature region within the region of interest, including: The gray-level difference between the bright and non-bright regions is obtained from the global gray-level histogram of the image to be detected, and the global threshold is calculated based on the gray-level difference. The image to be detected is binarized according to the global threshold, and the region of interest is extracted based on the boundary points in the horizontal or vertical direction after binarization. The foreground feature region is obtained within the region of interest using a sliding window dynamic thresholding method.

3. The method according to claim 2, characterized in that, The foreground feature region is obtained within the region of interest using a sliding window dynamic thresholding method, including: The region of interest is traversed using a sliding window of a preset size and a preset step size; Calculate the mean gray value and standard deviation of the pixels within the sliding window, use the mean gray value as a local background reference, and determine the dynamic threshold of the current pixel to be processed through a dynamic threshold function; The region of interest is divided into a foreground region and a background region based on the dynamic threshold, and the foreground region is used as the foreground feature region.

4. The method according to claim 1, characterized in that, Connectivity aggregation is performed on the foreground feature region to obtain at least one stripe candidate connected region, including: Extract foreground pixels in the foreground feature region that have not yet been assigned to any established connected region as seed points; Based on the principle of 8-connected domains, a diffusion search is performed on the surrounding pixels. Adjacent pixels that meet the connectivity conditions are aggregated into independent stripe candidate connected domains, and the ownership status of the aggregated pixels is updated.

5. The method according to claim 1, characterized in that, The step of determining the corresponding segmentation path for segmentation based on the geometric features of the candidate connected components of the stripes to obtain independent candidate stripe objects includes: For the candidate connected regions of the stripes that are determined to be adhered, extract their grayscale distribution information or distance transformation information; Local minimum points are found in the gray-scale distribution information or the distance transformation information, and the local minimum points that are determined to be adjacent are connected to form a dividing line; The candidate connected region of the stripe is divided along the dividing line to obtain at least two independent candidate stripe objects.

6. The method according to claim 1, characterized in that, The candidate stripe objects are subjected to noise filtering according to preset geometric rules to determine valid defect stripes, including: Obtain the pixel area, aspect ratio of the bounding box, and geometric principal axis length of the candidate stripe object; Candidate stripe objects whose pixel area is less than a preset area threshold, whose aspect ratio of the bounding box is less than a preset ratio threshold, or whose geometric principal axis length is shorter than a preset length threshold are filtered, and the remaining candidate stripe objects are used as valid defect stripes.

7. The method according to claim 1, characterized in that, Based on the characteristics of the effective defect stripes, the corresponding quality inspection results are determined through a fault determination mechanism, including: Extract the defect feature parameter combination of the effective defect stripes. The defect feature parameter combination includes the number of effective defect stripes, total length, maximum single stripe length, and average width. When there are no effective defect stripes, the corresponding parameter value is set to zero. The quality score is obtained by multiplying each parameter value in the defect feature parameter combination by the corresponding weight coefficient and performing a weighted calculation. Based on the preset grading range in which the quality score value falls, output graded quality detection results corresponding to different fault severity levels.

8. A stripe defect detection system based on image processing, characterized in that, include: The region segmentation module is used to perform hierarchical threshold segmentation on the acquired image to be detected in order to determine the region of interest and the foreground feature region within the region of interest; The connectivity aggregation module is used to perform connectivity aggregation on the foreground feature region to obtain at least one stripe candidate connectivity region. The stripe cutting module is used to determine whether the stripe candidate connected region meets the preset adhesion condition. When the condition is met, the module determines the corresponding segmentation path based on the geometric features of the stripe candidate connected region to perform segmentation and obtain independent candidate stripe objects. The noise filtering module is used to filter noise from the candidate stripe objects according to preset geometric rules and determine the effective defect stripes. The quality inspection module is used to determine the corresponding quality inspection result based on the characteristics of the effective defect stripes through a fault determination mechanism.

9. The system according to claim 8, characterized in that, The region segmentation module includes: The global threshold calculation module is used to obtain the gray-level difference between the bright and non-bright regions based on the global gray-level histogram of the image to be detected, and to calculate the global threshold based on the gray-level difference. The region of interest extraction module is used to binarize the image to be detected according to the global threshold, and extract the region of interest based on the boundary points in the horizontal or vertical direction after binarization. The feature region extraction module is used to obtain the foreground feature region within the region of interest using a sliding window dynamic thresholding method.

10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the image processing-based stripe defect detection method according to any one of claims 1-7 when executing executable instructions.