Power battery protection top cover deformation detection method and system

By using the Canny operator to extract the main edge line and multimodal features in the detection of the top cover of the power battery, and combining sliding window traversal and cosine similarity, the problem of feature confusion between sensitive and non-sensitive areas in the existing technology is solved, and high-precision deformation detection is achieved.

CN121660968APending Publication Date: 2026-03-13JINLIMEI INTELLIGENT TECH (DONGTAI) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies for detecting deformation of the top cover of power batteries, the features of sensitive and non-sensitive areas are analyzed together. This results in redundant information from non-sensitive areas diluting the deformation features of sensitive areas, making it difficult to meet the requirements for high-precision detection.

Method used

The Canny operator is used to extract the main edge line, and a baseline region is formed by expanding it outward and outward with a preset pixel width. The sensitive area is focused, and the cosine similarity is calculated to generate a deformation response map by combining multimodal features and sliding window traversal. Binarization and connected component analysis are then performed to filter the deformation region.

Benefits of technology

It significantly improves the sensitivity and accuracy of deformation detection of the top cover of the power battery, avoids the dilution of deformation features by redundant information in non-sensitive areas, and achieves accurate quantification and high-precision detection of minute deformations at the edges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121660968A_ABST
    Figure CN121660968A_ABST
Patent Text Reader

Abstract

The invention provides a power battery protection top cover deformation detection method and system, and relates to the technical field of battery top cover deformation detection, and the method specifically comprises the steps: obtaining a reference image and a to-be-detected image, and dividing the reference image and the to-be-detected image into three regions; adopting a Canny operator to extract a main edge line for each partition, and expanding by taking the main edge line as a center to form a reference band area; extracting a multi-modal feature in the reference band to construct a reference feature vector; performing sliding window traversal on the reference zone area of the to-be-detected image, extracting a window feature vector, calculating cosine similarity between the window feature vector and the reference feature vector, and generating a deformation response graph; and comprehensively judging whether deformation exists or not through binarization, morphological processing and connected domain analysis. According to the method, the problem of missing detection caused by a rough matching mode in the prior art is effectively solved by focusing the key area, enhancing the feature anti-interference performance and refining the matching precision, and the sensitivity and the accuracy of deformation detection of the power battery top cover are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of battery top cover deformation detection technology, specifically to a method and system for detecting deformation of a power battery protective top cover. Background Technology

[0002] As a core component of new energy vehicles, the structural integrity of the protective cover of the power battery directly affects the battery's safety and sealing performance. The cover is mostly made of metal (such as aluminum alloy), and during production, assembly, or use, it is prone to deformation such as edge warping, localized dents, and bulges due to stamping stress, assembly errors, and external impacts. If the deformation exceeds the safety threshold, it may lead to battery sealing failure, internal structural compression, or even thermal runaway. Therefore, high-precision deformation testing is necessary before leaving the factory and during operation and maintenance.

[0003] A prior art method and system for detecting battery cover deformation, disclosed in CN117495783A, includes the following steps: Step S1: Acquire battery cover image information and segment it into three regions; Step S2: Determine the first contour lines of the three regions and generate second contour lines inward based on the first contour lines; Step S3: Perform grayscale processing on the segmented image and select the grayscale information of the second contour images of the three regions as reference information; Step S4: Perform binarization processing based on the grayscale of the edge contour lines and other parts within this region to obtain a binarized image; Step S5: Determine whether the battery cover has deformed based on the binarized image. This method detects deformation of the battery cover within a battery pack, reducing errors caused by visual inspection and improving the accuracy of battery cover deformation detection.

[0004] However, the following shortcomings still exist: In the existing technology, other parts of the area are not defined in any way, including both deformation-sensitive areas near the edge and non-sensitive planar areas far from the edge. Since the deformation of the battery cover is mainly concentrated in the edge and a few adjacent pixels (i.e., the sensitive area), the existing technology analyzes the features of the sensitive area and the non-sensitive area together, without differentiating the key areas where deformation occurs frequently. This results in a large amount of redundant information in the non-sensitive area "diluting" the deformation features of the sensitive area, causing the key deformation that should be identified to be missed due to signal flooding. This leads to a significant decrease in detection sensitivity, making it difficult to meet the high-precision detection requirements of power batteries for minute deformations.

[0005] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this invention is to provide a method and system for detecting deformation of the protective top cover of a power battery, so as to solve the problems mentioned in the background art.

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

[0008] A method for detecting deformation of a power battery protective cover, comprising the following steps:

[0009] S1. Obtain the reference image of the battery top cover and the image of the battery top cover to be detected. Divide the image into three partitions according to the preset rules. For each partition, use the Canny operator to perform edge detection, extract the main edge line, and expand the preset pixel width to both the inner and outer sides with the main edge line as the center to form a reference band area covering the main edge line and the adjacent pixels.

[0010] S2. In each reference band region of the battery top cover reference image, extract multimodal features and combine them to construct the reference feature vector of the corresponding partition;

[0011] S3. In the image of the battery top cover to be detected, in the reference band area of ​​each partition, the multimodal features in each sliding window are extracted and the window feature vector is constructed by traversing the sliding window. The cosine similarity is calculated by combining the reference feature vector and the cosine similarity value is assigned to the center pixel of the sliding window to obtain the deformation response map of each partition.

[0012] S4. Binarize the deformation response map of each partition to segment out the strong response region, and perform morphological processing on the region to obtain the mask of the target deformation region.

[0013] S5. Perform connected component analysis on the target deformation region mask for each partition, filter out deformation regions that meet the preset conditions, and comprehensively judge whether the top cover of the battery to be detected has deformation based on the filtering results of each partition.

[0014] Furthermore, the multimodal features include the median of the pixel gradient, the mode of the local binary pattern encoding of the pixel, and the median of the pixel grayscale.

[0015] Furthermore, the preset rule refers to determining the direction, proportion, and division method of the image partitions based on the structural characteristics of the battery top cover, and dividing the image into three partitions according to the preset rule. The specific logic is as follows:

[0016] Get the width and height of the battery top cover image, where the width is the number of pixels in the horizontal direction and the height is the number of pixels in the vertical direction.

[0017] Based on preset rules, the horizontal or vertical direction of the image is selected as the dividing direction;

[0018] Along the selected division direction, the image is divided proportionally into three consecutive and non-overlapping regions, specifically including:

[0019] Calculate the total number of pixels in the division direction;

[0020] Based on the preset ratio, determine the pixel range of the three partitions in the division direction;

[0021] Divide the area into three consecutive pixel regions, which will be designated as three partitions.

[0022] Each partition corresponds to a continuous pixel region in the image, and the partition boundaries are determined by the above division steps to ensure that the entire image is covered and there are no overlapping areas between partitions.

[0023] Furthermore, the Canny operator is used for edge detection to extract the main edge lines. The specific logic is as follows:

[0024] Set the low and high thresholds for the Canny operator;

[0025] Calculate the gradient magnitude and gradient direction of the image, and extract candidate edge points;

[0026] The binary edge image of the partition is obtained by nonmaximum suppression and double threshold detection;

[0027] In a binary edge image, identify all continuous edge curves and calculate the number of pixels and average gradient intensity for each edge curve.

[0028] Based on the calculation results, the edge curve with the most pixels or the highest average gradient intensity is selected as the main edge line;

[0029] If multiple edge curves simultaneously meet the above conditions, the edge line closest to the design position of the top cover structure shall be selected first.

[0030] Using the selected main edge line as the center line, extend a preset pixel width to both the inner and outer sides to form a reference band area covering the main edge line and adjacent pixels. The specific logic is as follows:

[0031] For each pixel on the main edge line, calculate the vertical vector of its gradient direction;

[0032] The preset pixel width is extended inward and outward along this vertical direction to form the boundary line of the strip-shaped region;

[0033] Connect all the expanded boundary lines to form a closed strip-shaped region;

[0034] The pixels within this strip region are marked as a reference strip region, which covers the main edge line and its adjacent pixels.

[0035] Furthermore, a sliding window is divided into the baseband region of each partition, with the specific logic as follows:

[0036] Set the number of sliding windows within each partition to... :

[0037]

[0038]

[0039]

[0040] in, This represents the number of windows in the horizontal direction. This represents the number of windows in the vertical direction. The width of the baseband area for each partition. The height of the reference band area for each partition, The width of the sliding window. The height of the sliding window. For horizontal step size, The vertical step size, Indicates rounding down;

[0041] The cosine similarity between the window feature vector and the baseline feature vector is calculated using the following logic:

[0042] The first The window feature vector of each sliding window is denoted as... :

[0043]

[0044] Let the baseline feature vector be denoted as :

[0045]

[0046] in, For the first The first sliding window A multimodal feature, The first in the baseline eigenvector A multimodal feature, For indexing multimodal features, These are the median of the pixel gradient, the mode of the pixel's local binary mode encoding, and the median of the pixel's grayscale, respectively. For the index of the sliding window, ;

[0047]

[0048] in, For the first The cosine similarity value of each sliding window.

[0049] Furthermore, the cosine similarity value is assigned to the center pixel of the sliding window to obtain the deformation response map of each partition. The specific logic is as follows:

[0050] For each sliding window, starting from the top left corner, move it to the right by half the window width and down by half the window height to obtain the pixel coordinates of the window center. Then, assign the cosine similarity value of the sliding window to the center pixel of the sliding window.

[0051] Repeat the above steps for all sliding windows within the reference band region, and assign the cosine similarity value of all windows to the corresponding center pixel in turn to form a preliminary deformation response map.

[0052] For pixels not covered by the center of the sliding window, bilinear interpolation is used to fill them;

[0053] The pixel values ​​already assigned by the window center in the preliminary deformation response map are integrated with the fill pixel values ​​obtained through bilinear interpolation according to spatial coordinates:

[0054] For each pixel within the reference band region, if it already has a value assigned in the preliminary response map, then that value is retained; if it is an uncovered pixel, then the interpolated fill value is used.

[0055] The response values ​​of the reference band region are retained at the corresponding pixel positions of the partition. For pixels in the partition that are not in the reference band, the response values ​​of these pixels are set to "1". The response values ​​of the reference band region and the response values ​​of the non-reference band region are merged to form a two-dimensional matrix covering all pixels in the entire partition, which is the deformation response map of the partition.

[0056] Furthermore, the deformation response map of each partition is binarized to segment out the strong response regions. The specific logic is as follows:

[0057] For the deformation response map of each partition, a binarization threshold is set. ;

[0058] Iterate through each pixel in the partitioned deformation response map, and compare the pixel value with the threshold. Comparison:

[0059] If the pixel value is not greater than the threshold This is identified as a strong response pixel and assigned a value of 1.

[0060] If the pixel value is greater than the threshold Pixels that are not strongly responsive are identified and assigned a value of 0.

[0061] By using the threshold judgment mentioned above, the continuous deformation response map is converted into a binary image, where the area with a pixel value of 1 is the segmented strong response area.

[0062] Furthermore, connected component analysis is performed on the target deformation region mask for each partition to filter deformation regions that meet preset conditions. The specific logic is as follows:

[0063] Connectivity labeling is performed on the morphologically processed target deformation region mask. The 8-neighborhood connectivity rule is adopted, that is, adjacent pixels in the vertical, horizontal and diagonal directions are considered connected. All sets of interconnected pixels in the mask are identified, and each connected set corresponds to an independent suspected deformation region.

[0064] Calculate the area of ​​each connected region, which is the total number of pixels contained in the suspected deformed region;

[0065] The preset filtering criteria are: the area of ​​the connected components is greater than or equal to the preset minimum number of pixels and less than or equal to the preset maximum number of pixels;

[0066] Verify each connected component of each partition one by one, and retain all connected components that meet the above conditions as the valid deformation region of that partition.

[0067] Based on the effective deformation region results of the three zones, a comprehensive judgment is made as to whether the top cover of the battery under test has deformed.

[0068] If the number of valid deformation areas in any partition is greater than or equal to 1, and the area of ​​at least one valid deformation area exceeds a preset threshold, then the top cover of the battery to be tested is determined to be deformed.

[0069] If the number of effective deformation areas in all three partitions is 0, or the area of ​​all effective deformation areas does not exceed the preset threshold, then the top cover of the battery to be tested is determined to be without deformation.

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

[0071] A deformation detection system for a power battery protective top cover, the system being used to perform the aforementioned deformation detection method for a power battery protective top cover, comprising:

[0072] The image processing module is used to acquire the reference image of the battery top cover and the image of the battery top cover to be detected. According to the preset rules, the image is divided into three partitions. For each partition, the Canny operator is used to perform edge detection, extract the main edge line, and expand the preset pixel width to both the inner and outer sides with the main edge line as the center to form a reference band area covering the main edge line and the adjacent pixels.

[0073] The benchmark construction module is used to extract multimodal features in each benchmark band region of the battery top cover benchmark image and combine them to construct the benchmark feature vector of the corresponding partition.

[0074] The data calculation module is used to extract multimodal features within each sliding window and construct window feature vectors in the reference band area of ​​each partition using a sliding window traversal method. The cosine similarity is calculated by combining the reference feature vectors and the cosine similarity value is assigned to the center pixel of the sliding window to obtain the deformation response map of each partition.

[0075] The segmentation module is used to binarize the deformation response map of each partition, segment out the strong response region, and perform morphological processing on the region to obtain the mask of the target deformation region.

[0076] The comprehensive judgment module is used to perform connected component analysis on the target deformation region mask of each partition, filter deformation regions that meet preset conditions, and comprehensively judge whether the top cover of the battery to be detected has deformation based on the filtering results of each partition.

[0077] Compared with the prior art, the beneficial effects of the present invention are:

[0078] This invention uses the Canny operator to accurately extract the main edge line of the battery top cover, and expands it to both sides with a preset pixel width as the center to construct a dedicated reference band area. This area only covers the edge and the adjacent deformation-sensitive area, directly excluding the non-sensitive planar area far from the edge. This avoids the "dilution" of deformation features by redundant information in non-sensitive areas from the source, and significantly improves the targeting of detection.

[0079] Within the baseline region, a multimodal feature combination of the pixel gradient median, the local binary mode encoding mode, and the pixel grayscale median is extracted to construct a more robust baseline feature vector. Simultaneously, by traversing the sensitive area through a sliding window, the cosine similarity between each window feature vector and the baseline feature vector is calculated to generate a pixel-level continuous deformation response map, thereby achieving accurate quantification of minute edge deformations.

[0080] In summary, by focusing on key areas, enhancing the anti-interference ability of features, and refining the matching accuracy, this invention effectively solves the problem of missed detection caused by the coarse matching method in the prior art, and significantly improves the sensitivity and accuracy of power battery top cover deformation detection. Attached Figure Description

[0081] Figure 1 This is a schematic diagram of the overall method flow of the present invention;

[0082] Figure 2 This is a block diagram of the module composition of the present invention. Detailed Implementation

[0083] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

[0084] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0085] Example:

[0086] Please see Figure 1 The present invention provides a technical solution:

[0087] A method for detecting deformation of a power battery protective cover, comprising the following steps:

[0088] S1. Obtain the reference image of the battery top cover and the image of the battery top cover to be detected. Divide the image into three partitions according to the preset rules. For each partition, use the Canny operator to perform edge detection, extract the main edge line, and expand the preset pixel width to both the inner and outer sides with the main edge line as the center to form a reference band area covering the main edge line and the adjacent pixels.

[0089] Based on the above embodiments, the method for obtaining the battery top cover image is as follows:

[0090] An industrial camera with a ring LED light source is used. The optical axis of the camera lens is perpendicular to the plane of the battery top cover. The shooting distance is fixed at 300mm±5mm to ensure that the image is free of perspective distortion. The acquisition environment should avoid strong direct light or reflection interference. A matte black curtain is used as the background to reduce the impact of ambient stray light on image quality.

[0091] Select a standard battery top cover sample that has been manually inspected and confirmed to be free of any deformation (including no dents, bulges, scratches, or edge warping), and fix it in the center of the stage; start the camera to continuously acquire 3-5 images, and select the one with the highest clarity as the reference image;

[0092] The top cover of the battery to be tested is fixed on the stage in the same posture as the reference sample, ensuring that the parameters of the acquisition equipment are completely consistent with those of the reference image acquisition. One image is acquired for each test. If there are abnormalities such as image blurring, positional shift, or reflection, the re-shooting mechanism is automatically triggered to ensure that the acquisition conditions of the image to be tested are consistent with those of the reference image, thereby reducing detection errors caused by environmental or equipment differences.

[0093] The acquired reference image and the image to be detected are preprocessed in a unified manner: slight positional shifts are eliminated by image registration algorithm, high-frequency noise is removed by Gaussian filtering, and effective ROIs containing only the battery top cover area are extracted from the image.

[0094] Based on the above embodiments, the preset rule refers to determining the direction, proportion, and division method of the image partitions according to the structural characteristics of the battery top cover, and dividing the image into three partitions according to the preset rule. The specific logic is as follows:

[0095] Get the width and height of the battery top cover image, where the width is the number of pixels in the horizontal direction and the height is the number of pixels in the vertical direction.

[0096] Based on preset rules, the horizontal or vertical direction of the image is selected as the dividing direction;

[0097] Along the selected division direction, the image is divided proportionally into three consecutive and non-overlapping regions, specifically including:

[0098] Calculate the total number of pixels in the division direction;

[0099] Based on the preset ratio, determine the pixel range of the three partitions in the division direction;

[0100] Divide the area into three consecutive pixel regions, which will be designated as three partitions.

[0101] Each partition corresponds to a continuous pixel region in the image, and the partition boundaries are determined by the above division steps to ensure that the entire image is covered and there are no overlapping areas between partitions.

[0102] Based on the above embodiments, the Canny operator is used for edge detection to extract the main edge line. The specific logic is as follows:

[0103] Based on the statistical distribution of image gradient magnitude: calculate the gradient magnitude of all pixels in the partition and construct a gradient magnitude matrix. Take the 70th-80th percentile of the magnitude distribution as the high threshold, and the low threshold is usually set to 1 / 2 to 1 / 3 of the high threshold.

[0104] The Sobel operator is used to calculate the gradients in the horizontal and vertical directions;

[0105] Using the horizontal and vertical gradients, the gradient magnitude and gradient direction of the image are calculated, and the directions are classified into four main directions: 0°, 45°, 90°, and 135°.

[0106] Pixels with gradient magnitude greater than 0 are selected as edge candidate points;

[0107] For each edge candidate point, determine whether the point has the maximum gradient magnitude in its neighborhood based on its gradient direction:

[0108] If the gradient direction is close to 0°, compare the gradient magnitude of the current point with the gradient magnitude of the left and right adjacent pixels, and only retain the point with the maximum value;

[0109] If the gradient direction is close to 45°, compare the gradient magnitude of the current point with the gradient magnitude of the adjacent pixels in the upper right and lower left, and only retain the point with the maximum value;

[0110] If the gradient direction is close to 90°, compare the gradient magnitude of the current point with the gradient magnitude of the adjacent pixels above and below, and only retain the point with the maximum value;

[0111] If the gradient direction is close to 135°, compare the gradient magnitude of the current point with the gradient magnitude of the adjacent pixels at the top left and bottom right, and only retain the point with the maximum value.

[0112] Suppress non-maximum points by setting their gradient magnitude to 0 to obtain a refined edge contour.

[0113] Based on the relationship between gradient magnitude and high and low thresholds, pixels are divided into three categories:

[0114] Strong edge points: If the gradient magnitude is greater than or equal to the high threshold, it is identified as an edge and is directly retained;

[0115] Weak edge points: Low threshold ≤ gradient magnitude < high threshold, may be edges, further verification is needed;

[0116] Non-edge points: If the gradient magnitude is less than the low threshold, they are directly removed and set to 0;

[0117] Perform connectivity analysis on weak edge points: If a weak edge point is directly or indirectly connected to a strong edge point, it can be determined by the 8-neighborhood and then classified as an edge point and retained; otherwise, it is considered noise and removed.

[0118] The edge points that are ultimately retained are assigned a value of 255 (white), and the non-edge points are assigned a value of 0 (black), resulting in a binary image that only contains edges;

[0119] Connectivity components are labeled using the 8-neighborhood connectivity rule for binary edge images:

[0120] Starting from the top left corner of the image, scan pixel by pixel. When an unmarked edge pixel is encountered, initiate region growing: group the pixel and all consecutive edge pixels in its 8-neighborhood into the same connected region and assign a unique identifier.

[0121] Repeat the scan until all edge pixels are marked, with each connected component corresponding to a continuous edge curve;

[0122] For each edge curve, calculate its pixel count and average gradient intensity;

[0123] From all edge curves, select curves that meet one of the following conditions as candidate principal edge lines:

[0124] The number of pixels is the highest among all edge curves, or the average gradient intensity is the highest among all edge curves;

[0125] If there is only one candidate edge line, it is directly designated as the main edge line of the partition.

[0126] If multiple candidate edge lines exist, they are filtered by structural position matching:

[0127] Import the structural design drawings of the battery top cover in advance, obtain the pixel coordinate range of the theoretical edge line in the partition, calculate the centroid coordinates of each candidate edge line, and select the candidate edge line with the smallest Euclidean distance between the centroid coordinates and the design position coordinates as the final main edge line;

[0128] For each pixel on the main edge line, calculate the direction vector perpendicular to the gradient direction based on the gradient direction;

[0129] Set the extended pixel width to K, where K = 5-10 pixels, based on the deformation sensitivity range near the edge;

[0130] For each pixel on the main edge line, move it K pixels inward along the vertical gradient direction vector, i.e., closer to the center of the top cover, to obtain the inner boundary point; move it K pixels outward, i.e. farther away from the center of the top cover, to obtain the outer boundary point.

[0131] Connect all inner boundary points sequentially according to the pixel order of the main edge line to form the inner boundary line, and connect all outer boundary points to form the outer boundary line.

[0132] Connect the two endpoints of the inner boundary line and the outer boundary line to form a closed strip-shaped outline;

[0133] Traverse the image pixels and mark all pixels located within the band outline, including the main edge pixels and the pixels in the extended areas on both sides, to form the reference band region.

[0134] By focusing on the edges and adjacent areas with high deformation incidence, non-sensitive areas far from the edges are directly excluded, completely avoiding the "dilution" of deformation features by redundant information in non-sensitive areas (such as surface stains and textures). This allows feature extraction and matching to target only the key areas that truly need attention, compressing interference from a spatial dimension. This lays a precise foundation for subsequent multimodal feature analysis and micro-deformation, significantly improving detection targeting and sensitivity, and effectively capturing micro-deformations at the edges.

[0135] S2. In each reference band region of the battery top cover reference image, extract multimodal features and combine them to construct the reference feature vector of the corresponding partition;

[0136] Based on the above embodiments, the multimodal features include the median of the pixel gradient, the mode of the local binary pattern encoding of the pixel, and the median of the pixel grayscale.

[0137] Gradient features describe the rate of change of pixel gray levels and can effectively characterize the steepness of edges. They are a key indicator for distinguishing between "real edges" and "blurred areas".

[0138] Using the "median" instead of the average value can avoid the interference of local abnormal gradients on the overall features and more stably represent the concentration trend of the edge intensity of the baseline band region. For the edge of the battery top cover, the gradient median can quantify the "average steepness of the normal edge". When deformation occurs, this value will deviate significantly from the baseline, thereby realizing difference identification.

[0139] LBP encoding generates binary codes by comparing the grayscale differences between pixels and their neighbors, which can accurately describe the microstructure of the area near the edge.

[0140] By selecting the "mode" (i.e. the LBP code that appears most frequently), the dominant texture pattern in the region can be focused, and the accidental texture variations caused by minor scratches and stains can be filtered out, so as to stably reflect the inherent texture features of the reference band.

[0141] Grayscale features are the most basic visual attributes of an image, reflecting the overall brightness level of a region.

[0142] Using the "median" instead of the average value reduces the impact of extreme brightness values ​​and more accurately represents the overall brightness distribution of the reference band area.

[0143] Multimodal feature vectors integrate three types of information: gradient (reflecting edge strength), texture (reflecting microstructure), and grayscale (reflecting basic brightness), characterizing the baseline state from different dimensions. Even if one feature is disturbed, other features can still maintain the stability of the baseline, avoiding misjudgments caused by the drift of a single feature and ensuring the reliability of the comparison baseline.

[0144] Based on the above embodiments, the methods for extracting the median of pixel gradient, the mode of pixel local binary mode encoding, and the median of pixel grayscale are as follows:

[0145] The gradient magnitude matrix is ​​invoked to filter out the gradient magnitudes of all pixels within the reference band region, forming a gradient magnitude set.

[0146] Sort the gradient magnitudes in the set from smallest to largest. If the total number of pixels in the reference band region is odd, take the value in the middle position after sorting as the median; if the total number of pixels in the reference band region is even, take the average of the two middle values ​​as the median of the pixel gray level.

[0147] The 8-neighborhood LBP operator is used, that is, for each pixel, take 8 surrounding pixels in a 3×3 neighborhood centered on it;

[0148] Take the gray values ​​of the 8 surrounding pixels in its 3×3 neighborhood and compare them with the gray value of the center pixel;

[0149] If the grayscale value of the surrounding pixels is greater than or equal to the grayscale value of the center pixel, it is recorded as 1; otherwise, it is recorded as 0, resulting in an 8-bit binary number.

[0150] Convert the binary number to a decimal number, which will be used as the LBP code value for that pixel;

[0151] Collect the LBP encoding values ​​of all pixels within the reference band region to form an encoding set. The encoding value that appears most frequently in the set is the mode of the local binary mode encoding of the pixel.

[0152] Extract the original gray values ​​of all pixels within the reference band region of the reference image to form a gray value set;

[0153] Sort the gray values ​​in the set from smallest to largest. If the total number of pixels in the reference band region is odd, take the value in the middle position after sorting as the median; if the total number of pixels in the reference band region is even, take the average of the two middle values ​​as the median of the pixel gray value.

[0154] The baseline feature vector extracts multimodal features (median pixel gradient, mode of LBP texture, and median grayscale) from the baseline region (edge-sensitive area), transforming the "undeformed standard battery top cover edge state" into a quantifiable numerical vector. This vector acts as a "template," providing a clear comparison scale for the features of the corresponding region in the subsequent image to be detected—by calculating the cosine similarity between the features to be detected and the baseline vector, it is possible to objectively determine whether the region to be detected deviates from the standard state.

[0155] The baseline feature vector is extracted only from the baseline zone (edges and adjacent sensitive areas), excluding redundant information from non-sensitive areas. This allows the "baseline" represented by the vector to accurately focus on the key features of areas prone to deformation. When a small deformation occurs in this area of ​​the image to be detected, the difference between its feature vector and the baseline vector will be more significant, thereby improving the identification of deformation.

[0156] S3. In the image of the battery top cover to be detected, in the reference band area of ​​each partition, the multimodal features in each sliding window are extracted and the window feature vector is constructed by traversing the sliding window. The cosine similarity is calculated by combining the reference feature vector and the cosine similarity value is assigned to the center pixel of the sliding window to obtain the deformation response map of each partition.

[0157] Based on the above embodiments, the method for extracting multimodal features within each sliding window is the same as that for extracting multimodal features within each reference band region, and will not be described in detail here.

[0158] Based on the above embodiments, a sliding window is divided for the reference band region of each partition, and the specific logic is as follows:

[0159] Set the number of sliding windows within each partition to... :

[0160]

[0161]

[0162]

[0163] in, This represents the number of windows in the horizontal direction. This represents the number of windows in the vertical direction. The width of the baseband area for each partition. The height of the reference band area for each partition, The width of the sliding window. The height of the sliding window. For horizontal step size, The vertical step size, Indicates rounding down;

[0164] The cosine similarity between the window feature vector and the baseline feature vector is calculated using the following logic:

[0165] The first The window feature vector of each sliding window is denoted as... :

[0166]

[0167] Let the baseline feature vector be denoted as :

[0168]

[0169] in, For the first The first sliding window A multimodal feature, The first in the baseline eigenvector A multimodal feature, For indexing multimodal features, These are the median of the pixel gradient, the mode of the pixel's local binary mode encoding, and the median of the pixel's grayscale, respectively. For the index of the sliding window, ;

[0170]

[0171] in, For the first The cosine similarity value of each sliding window.

[0172] Based on the above embodiments, a cosine similarity value is assigned to the center pixel of the sliding window to obtain the deformation response map of each partition. The specific logic is as follows:

[0173] For each sliding window, starting from the top left corner, move it to the right by half the window width and down by half the window height to obtain the pixel coordinates of the window center. Then, assign the cosine similarity value of the sliding window to the center pixel of the sliding window.

[0174] Repeat the above steps for all sliding windows within the reference band region, and assign the cosine similarity value of all windows to the corresponding center pixel in turn to form a preliminary deformation response map.

[0175] For pixels not covered by the center of the sliding window, bilinear interpolation is used to fill them;

[0176] The pixel values ​​already assigned by the window center in the preliminary deformation response map are integrated with the fill pixel values ​​obtained through bilinear interpolation according to spatial coordinates:

[0177] For each pixel within the reference band region, if it already has a value assigned in the preliminary response map, then that value is retained; if it is an uncovered pixel, then the interpolated fill value is used.

[0178] The response values ​​of the reference band region are retained at the corresponding pixel positions of the partition. For pixels in the partition that are not in the reference band, the response values ​​of these pixels are set to "1". The response values ​​of the reference band region and the response values ​​of the non-reference band region are merged to form a two-dimensional matrix covering all pixels in the entire partition, which is the deformation response map of the partition.

[0179] Specifically, bilinear interpolation is used to fill pixels not covered by the center of the sliding window, and the specific method is as follows:

[0180] 1) Find the four nearest assigned pixels around the blank pixel, i.e., the center of the sliding window;

[0181] 2) Calculate the relative position of the blank pixel in the rectangle formed by these 4 pixels, and determine the weight of each known pixel, where the closer the pixel is, the greater its weight.

[0182] 3) First, sum the known pixel values ​​horizontally, then sum them vertically to obtain the fill value for the blank pixels.

[0183] By traversing the baseline region using a sliding window, the sensitive area is subdivided into multiple local windows, each corresponding to a small region adjacent to the edge. Multimodal features within the window are extracted and vectors are constructed. Cosine similarity is calculated between these vectors and the baseline feature vectors to quantify the feature changes in local micro-regions, thus solving the problem that existing technologies cannot capture subtle differences in overall region comparison.

[0184] The cosine similarity value of each window is assigned to the center pixel of the window, and the blank area is filled by interpolation to form a continuous deformation response map covering the entire reference band. This map presents the degree of difference between each position in the sensitive area and the reference at pixel-level resolution, making the spatial distribution of small deformations visible and providing a precise basis for subsequent location of specific deformations.

[0185] Because window traversal is performed only within the reference band area, interference from non-sensitive areas is eliminated, and multimodal feature fusion improves noise resistance, enabling even weak deformation signals to form significant low-similarity regions in the response map. This effectively avoids the problem of small deformations being masked by noise in existing technologies, and significantly improves the sensitivity of deformation detection.

[0186] S4. Binarize the deformation response map of each partition to segment out the strong response region, and perform morphological processing on the region to obtain the mask of the target deformation region.

[0187] Based on the above embodiments, the deformation response map of each partition is binarized to segment out the strong response regions. The specific logic is as follows:

[0188] For the deformation response map of each partition, a binarization threshold is set. ;

[0189] Specifically, by analyzing the deformation response maps of a large number of undeformed battery top cover images, the distribution range of cosine similarity values ​​within the reference band region was statistically analyzed, and the lower limit of this distribution was taken as the binarization threshold. ;

[0190] Iterate through each pixel in the partitioned deformation response map, and compare the pixel value with the binarization threshold. Comparison:

[0191] If the pixel value is not greater than This is identified as a strong response pixel and assigned a value of 1.

[0192] If the pixel value is greater than Pixels that are not strongly responsive are identified and assigned a value of 0.

[0193] By using the threshold judgment mentioned above, the continuous deformation response map is converted into a binary image, where the area with a pixel value of 1 is the segmented strong response area.

[0194] Based on the above embodiments, morphological processing is performed on the strong response region to obtain a mask for the target deformation region. The specific logic is as follows:

[0195] Select a structuring element of a preset size, such as a 3×3 or 5×5 square structuring element, and perform an erosion operation on the segmented binary image of the strong response region:

[0196] Iterate through each pixel of the image, and only keep the pixel as 1 if all pixels within the coverage area of ​​the structuring element are strongly responsive pixels; otherwise, assign it a value of 0.

[0197] This operation eliminates isolated, tiny noise points with areas smaller than the structuring element in the strong response region, thus preventing noise from interfering with subsequent detection.

[0198] Using a structuring element of the same size as the erosion operation, perform a dilation operation on the eroded image:

[0199] Iterate through each pixel of the image. If there is at least one strongly responsive pixel within the coverage area of ​​the structuring element, assign the value 1 to that pixel; otherwise, keep it as 0.

[0200] Expansion operations can fill tiny voids within a strong response region and connect fractured areas caused by corrosion or original segmentation, making the deformed region profile more complete and continuous.

[0201] Pixel verification is performed on a binary image that has undergone erosion followed by dilation.

[0202] Retain all pixel regions with a value of 1, and treat regions with a value of 0 as normal background;

[0203] The processed binary image is used as a mask for the target deformation region. This mask is directly used for subsequent connected component analysis to accurately mark the suspected deformation locations within the partition of the battery top cover to be detected.

[0204] S5. Perform connected component analysis on the target deformation region mask for each partition, filter out deformation regions that meet the preset conditions, and comprehensively judge whether the top cover of the battery to be detected has deformation based on the filtering results of each partition.

[0205] Based on the above embodiments, connected component analysis is performed on the target deformation region mask of each partition to filter deformation regions that meet preset conditions. The specific logic is as follows:

[0206] Connectivity labeling is performed on the morphologically processed target deformation region mask. The 8-neighborhood connectivity rule is adopted, that is, adjacent pixels in the vertical, horizontal and diagonal directions are considered connected. All sets of interconnected pixels in the mask are identified, and each connected set corresponds to an independent suspected deformation region.

[0207] Calculate the area of ​​each connected region, which is the total number of pixels contained in the suspected deformed region;

[0208] The preset filtering criteria are: the area of ​​the connected components is greater than or equal to the preset minimum number of pixels and less than or equal to the preset maximum number of pixels;

[0209] Verify each connected component of each partition one by one, and retain all connected components that meet the above conditions as the valid deformation region of that partition.

[0210] Based on the effective deformation region results of the three zones, a comprehensive judgment is made as to whether the top cover of the battery under test has deformed.

[0211] If the number of valid deformation areas in any partition is greater than or equal to 1, and the area of ​​at least one valid deformation area exceeds a preset threshold, then the top cover of the battery to be tested is determined to be deformed.

[0212] If the number of effective deformation areas in all three partitions is 0, or the area of ​​all effective deformation areas does not exceed the preset threshold, then the top cover of the battery to be tested is determined to be without deformation.

[0213] In this process, a large number of known qualified (i.e., without deformation or with minor acceptable deformation) and unqualified (i.e. with significant deformation) battery top cover samples are collected. The area of ​​the smallest deformation region in the unqualified samples is counted, and a preset threshold is set to be slightly lower than the area of ​​the smallest deformation region.

[0214] Please see Figure 2 The present invention also provides a technical solution:

[0215] A deformation detection system for a power battery protective top cover, the system being used to perform the aforementioned deformation detection method for a power battery protective top cover, comprising:

[0216] The image processing module is used to acquire the reference image of the battery top cover and the image of the battery top cover to be detected. According to the preset rules, the image is divided into three partitions. For each partition, the Canny operator is used to perform edge detection, extract the main edge line, and expand the preset pixel width to both the inner and outer sides with the main edge line as the center to form a reference band area covering the main edge line and the adjacent pixels.

[0217] The benchmark construction module is used to extract multimodal features in each benchmark band region of the battery top cover benchmark image and combine them to construct the benchmark feature vector of the corresponding partition.

[0218] The data calculation module is used to extract multimodal features within each sliding window and construct window feature vectors in the reference band area of ​​each partition using a sliding window traversal method. The cosine similarity is calculated by combining the reference feature vectors and the cosine similarity value is assigned to the center pixel of the sliding window to obtain the deformation response map of each partition.

[0219] The segmentation module is used to binarize the deformation response map of each partition, segment out the strong response region, and perform morphological processing on the region to obtain the mask of the target deformation region.

[0220] The comprehensive judgment module is used to perform connected component analysis on the target deformation region mask of each partition, filter deformation regions that meet preset conditions, and comprehensively judge whether the top cover of the battery to be detected has deformation based on the filtering results of each partition.

[0221] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0222] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by software, electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.

[0223] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0224] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for detecting deformation of a power battery protective top cover, characterized in that, The specific steps include: S1. Obtain the reference image of the battery top cover and the image of the battery top cover to be detected. Divide the image into three partitions according to the preset rules. For each partition, use the Canny operator to perform edge detection, extract the main edge line, and expand the preset pixel width to both the inner and outer sides with the main edge line as the center to form a reference band area covering the main edge line and the adjacent pixels. S2. In each reference band region of the battery top cover reference image, extract multimodal features and combine them to construct the reference feature vector of the corresponding partition; S3. In the image of the battery top cover to be detected, in the reference band area of ​​each partition, the multimodal features in each sliding window are extracted and the window feature vector is constructed by traversing the sliding window. The cosine similarity is calculated by combining the reference feature vector and the cosine similarity value is assigned to the center pixel of the sliding window to obtain the deformation response map of each partition. S4. Binarize the deformation response map of each partition to segment out the strong response region, and perform morphological processing on the region to obtain the mask of the target deformation region. S5. Perform connected component analysis on the target deformation region mask for each partition, filter out deformation regions that meet the preset conditions, and comprehensively judge whether the top cover of the battery to be detected has deformation based on the filtering results of each partition.

2. The method for detecting deformation of the protective top cover of a power battery according to claim 1, characterized in that, The multimodal features include the median of the pixel gradient, the mode of the local binary pattern encoding of the pixel, and the median of the pixel grayscale.

3. The method for detecting deformation of the protective top cover of a power battery according to claim 1, characterized in that, The preset rules refer to determining the direction, proportion, and division method of the image partitions based on the structural characteristics of the battery top cover, and dividing the image into three partitions according to the preset rules. The specific logic is as follows: Get the width and height of the battery top cover image, where the width is the number of pixels in the horizontal direction and the height is the number of pixels in the vertical direction. Based on preset rules, the horizontal or vertical direction of the image is selected as the division direction; Along the selected division direction, the image is divided proportionally into three consecutive and non-overlapping regions, specifically including: Calculate the total number of pixels in the division direction; Based on the preset ratio, determine the pixel range of the three partitions in the division direction; Divide the area into three consecutive pixel regions, which will be designated as three partitions. Each partition corresponds to a continuous pixel region in the image, and the partition boundaries are determined by the above division steps to ensure that the entire image is covered and there are no overlapping areas between partitions.

4. The method for detecting deformation of the protective top cover of a power battery according to claim 3, characterized in that, Edge detection is performed using the Canny operator to extract the main edge lines. The specific logic is as follows: Set the low and high thresholds for the Canny operator; Calculate the gradient magnitude and gradient direction of the image, and extract candidate edge points; The binary edge image of the partition is obtained by nonmaximum suppression and double threshold detection; In a binary edge image, identify all continuous edge curves and calculate the number of pixels and average gradient intensity for each edge curve. Based on the calculation results, the edge curve with the most pixels or the highest average gradient intensity is selected as the main edge line; If multiple edge curves simultaneously meet the above conditions, the edge line closest to the design position of the top cover structure shall be selected first. Using the selected main edge line as the center line, extend a preset pixel width to both the inner and outer sides to form a reference band area covering the main edge line and adjacent pixels. The specific logic is as follows: For each pixel on the main edge line, calculate the vertical vector of its gradient direction; The preset pixel width is extended inward and outward along this vertical direction to form the boundary line of the strip-shaped region; Connect all the expanded boundary lines to form a closed strip-shaped region; The pixels within this strip region are marked as a reference strip region, which covers the main edge line and its adjacent pixels.

5. The method for detecting deformation of the protective top cover of a power battery according to claim 2, characterized in that, The reference band region for each partition is divided into sliding windows, and the specific logic is as follows: Set the number of sliding windows within each partition to... : in, This represents the number of windows in the horizontal direction. This represents the number of windows in the vertical direction. The width of the baseband area for each partition. The height of the reference band area for each partition, The width of the sliding window. The height of the sliding window. For horizontal step size, The vertical step size, Indicates rounding down; The cosine similarity between the window feature vector and the baseline feature vector is calculated using the following logic: The first The feature vector of each sliding window is denoted as... : Let the baseline feature vector be denoted as : in, For the first The first sliding window A multimodal feature, The first in the baseline eigenvector A multimodal feature, For indexing multimodal features, These are the median of the pixel gradient, the mode of the pixel's local binary mode encoding, and the median of the pixel's grayscale, respectively. For the index of the sliding window, ; in, For the first The cosine similarity value of each sliding window.

6. The method for detecting deformation of the protective top cover of a power battery according to claim 5, characterized in that, Assigning the cosine similarity value to the center pixel of the sliding window yields the deformation response map for each partition. The specific logic is as follows: For each sliding window, starting from the top left corner, move it to the right by half the window width and down by half the window height to obtain the pixel coordinates of the window center. Then, assign the cosine similarity value of the sliding window to the center pixel of the sliding window. Repeat the above steps for all sliding windows within the reference band region, and assign the cosine similarity value of all windows to the corresponding center pixel in turn to form a preliminary deformation response map. For pixels not covered by the center of the sliding window, bilinear interpolation is used to fill them; The pixel values ​​already assigned by the window center in the preliminary deformation response map are integrated with the fill pixel values ​​obtained through bilinear interpolation according to spatial coordinates: For each pixel within the reference band region, if it already has a value assigned in the preliminary response map, then that value is retained; if it is an uncovered pixel, then the interpolated fill value is used. The response values ​​of the reference band region are retained at the corresponding pixel positions of the partition. For pixels in the partition that are not in the reference band, the response values ​​of these pixels are set to "1". The response values ​​of the reference band region and the response values ​​of the non-reference band region are merged to form a two-dimensional matrix covering all pixels in the entire partition, which is the deformation response map of the partition.

7. The method for detecting deformation of the protective top cover of a power battery according to claim 6, characterized in that, The deformation response map of each partition is binarized to segment out the strong response regions. The specific logic is as follows: For the deformation response map of each partition, a binarization threshold is set. ; Iterate through each pixel in the partitioned deformation response map, and compare the pixel value with the threshold. Comparison: If the pixel value is not greater than the threshold This is identified as a strong response pixel and assigned a value of 1. If the pixel value is greater than the threshold The pixel is determined to be a non-strong response pixel and assigned a value of 0. By using the threshold judgment mentioned above, the continuous deformation response map is converted into a binary image, where the area with a pixel value of 1 is the segmented strong response area.

8. The method for detecting deformation of the protective top cover of a power battery according to claim 7, characterized in that, For each partition, a connected component analysis is performed on the target deformation region mask to filter deformation regions that meet preset conditions. The specific logic is as follows: Connectivity labeling is performed on the morphologically processed target deformation region mask. The 8-neighborhood connectivity rule is adopted, that is, adjacent pixels in the vertical, horizontal and diagonal directions are considered connected. All sets of interconnected pixels in the mask are identified, and each connected set corresponds to an independent suspected deformation region. Calculate the area of ​​each connected region, which is the total number of pixels contained in the suspected deformed region; The preset filtering criteria are: the area of ​​the connected components is greater than or equal to the preset minimum number of pixels and less than or equal to the preset maximum number of pixels; Verify each connected component of each partition one by one, and retain all connected components that meet the above conditions as the valid deformation region of that partition. Based on the effective deformation region results of the three zones, a comprehensive judgment is made as to whether the top cover of the battery under test has deformed. If the number of valid deformation areas in any partition is greater than or equal to 1, and the area of ​​at least one valid deformation area exceeds a preset threshold, then the top cover of the battery to be tested is determined to be deformed. If the number of effective deformation areas in all three partitions is 0, or the area of ​​all effective deformation areas does not exceed the preset threshold, then the top cover of the battery to be tested is determined to be without deformation.

9. A deformation detection system for a power battery protective top cover, the system being used to execute the deformation detection method for a power battery protective top cover according to any one of claims 1-8, characterized in that, include: The image processing module is used to acquire the reference image of the battery top cover and the image of the battery top cover to be detected. According to the preset rules, the image is divided into three partitions. For each partition, the Canny operator is used to perform edge detection, extract the main edge line, and expand the preset pixel width to both the inner and outer sides with the main edge line as the center to form a reference band area covering the main edge line and the adjacent pixels. The benchmark construction module is used to extract multimodal features in each benchmark band region of the battery top cover benchmark image and combine them to construct the benchmark feature vector of the corresponding partition. The data calculation module is used to extract multimodal features within each sliding window and construct window feature vectors in the reference band area of ​​each partition using a sliding window traversal method. The cosine similarity is calculated by combining the reference feature vectors and the cosine similarity value is assigned to the center pixel of the sliding window to obtain the deformation response map of each partition. The segmentation module is used to binarize the deformation response map of each partition, segment out the strong response region, and perform morphological processing on the region to obtain a mask of the target deformation region. The comprehensive judgment module is used to perform connected component analysis on the target deformation region mask of each partition, filter deformation regions that meet preset conditions, and comprehensively judge whether the top cover of the battery to be detected has deformation based on the filtering results of each partition.

Citation Information

Patent Citations

  • Target positioning method, system and device based on template matching and medium

    CN113128554A

  • Pantograph foreign matter detection method and device based on image comparison and storage medium

    CN114494161A

  • Silicon wafer quality evaluation method based on image features

    CN116958127A

  • Wafer edge defect detection method and device

    CN117115130A

  • Battery cover plate deformation detection method and system

    CN117495783A