Battery OverHang detection method
By extracting preset intermediate row pixel points in the battery CT tomographic image, forming a two-dimensional feature image and performing grayscale value analysis and line feature extraction, the problem of battery OverHang detection in the prior art is solved, and a fast and efficient detection effect is achieved.
Patent Information
- Application Number
- CN202510122817.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, battery OverHang detection takes a long time and has poor accuracy, making it difficult to achieve automation, which limits its application in actual production.
By acquiring all CT tomographic images of the battery to be detected, extracting preset intermediate row pixel points, forming two-dimensional feature images to be detected, performing grayscale value analysis and line feature extraction, determining the pixel points corresponding to the pole slice, and calculating the OverHang value.
This greatly shortens the battery OverHang detection time, improves detection efficiency, and improves detection accuracy through optimization and updates.
Smart Images

Figure CN120047412A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery detection, and particularly to a method for detecting the OverHang of a battery. Background Art
[0002] In recent years, with the growth of the demand for electric vehicles and energy storage systems, the performance, lifespan, and safety of batteries have become crucial.
[0003] OverHang refers to the part where the length of the cathode electrode sheet of the battery exceeds that of the anode electrode sheet. In the design of the battery, the size of the OverHang has an important impact on the electrochemical performance of the battery. To avoid internal short - circuit in the battery, the length of the cathode electrode sheet is designed to be slightly longer than that of the anode electrode sheet. At the same time, to ensure the optimal performance of the battery, the size of the OverHang needs to be strictly controlled within a specific specification range.
[0004] The existing OverHang detection methods rely on dedicated CT software, and manual marking is required to assist in positioning the anode and cathode, so as to calculate the OverHang value. This method is not only time - consuming but also requires a large amount of manual operation, making it difficult to achieve automation and restricting its application in actual production.
[0005] Therefore, there is an urgent need for a technical solution that can quickly detect the OverHang of the battery. Summary of the Invention
[0006] In view of the above analysis, the embodiments of the present invention aim to provide a method for detecting the OverHang of a battery to solve the problems of long detection time and poor accuracy in the existing OverHang detection.
[0007] The embodiments of the present invention provide a method for detecting the OverHang of a battery, and the detection method includes:
[0008] Obtain all CT tomographic images of the battery to be detected, extract the preset intermediate - row pixel points in each CT tomographic image, and form a two - dimensional feature image to be detected by arranging all the preset intermediate - row pixel points according to the tomographic serial number; wherein, in the two - dimensional feature image to be detected, the abscissa of each pixel point is the pixel serial number and the ordinate is the tomographic serial number;
[0009] Accumulate the gray values of the pixel points corresponding to each pixel serial number in all tomographic serial numbers in the two - dimensional feature image to be detected to obtain the total gray value corresponding to each pixel serial number; determine the pixel serial numbers corresponding to all electrode sheets in the battery to be detected according to the total gray value corresponding to each pixel serial number;
[0010] Perform line feature extraction on the two-dimensional feature image to be detected to obtain all line segments in the two-dimensional feature image to be detected; divide all line segments among all pole pieces according to the pole piece thickness and the pixel numbers corresponding to all pole pieces, and determine the pixel points corresponding to each pole piece.
[0011] Determine the difference in the fault numbers between adjacent cathode and anode pole pieces according to the maximum fault number of the pixel points corresponding to each pole piece, and combine the height of each CT tomographic image to obtain the OverHang of the battery to be detected.
[0012] Based on a further improvement of the above detection method, the extraction of the preset intermediate row pixel points in each CT tomographic image includes:
[0013] Determine the area where the battery core is located in the CT tomographic image according to the design parameters of the battery to obtain the core area.
[0014] Determine the range of row pixel numbers corresponding to the core area in terms of row pixel numbers to obtain the core row pixel number range.
[0015] Select one row from the core row pixel number range as the preset intermediate row, and use all the pixel points of the preset intermediate row in the CT tomographic image as the preset intermediate row pixel points.
[0016] Based on a further improvement of the above detection method, after forming the two-dimensional feature image to be detected by arranging all the preset intermediate row pixel points according to the fault number, optimize and update the two-dimensional feature image to be detected. The optimization and update include:
[0017] Perform gray level adjustment and filtering on the two-dimensional feature image to be detected, and delete the pixel points with gray levels greater than the preset gray level threshold to obtain an intermediate two-dimensional feature image.
[0018] Use the Sobel operator to calculate the gradient value of each pixel point in the intermediate two-dimensional feature image in the pixel number direction to obtain the horizontal gradient value of each pixel point in the intermediate two-dimensional feature image.
[0019] Compare the horizontal gradient value of each pixel point in the intermediate two-dimensional feature image with the preset gradient change threshold respectively, and delete the pixel points with horizontal gradient values less than the gradient change threshold in the intermediate two-dimensional feature image to obtain the updated two-dimensional feature image to be detected.
[0020] Based on a further improvement of the above detection method, the determination of the pixel numbers corresponding to all pole pieces in the battery to be detected according to the total gray level corresponding to each pixel number includes:
[0021] Use the moving average method to smooth the total gray levels corresponding to all pixel numbers to obtain a smoothed gray level sequence.
[0022] The peak-valley detection method is used to determine multiple gray-level local peaks and multiple gray-level local valleys in the smoothed gray-level sequence;
[0023] The pixel serial number corresponding to each gray-level local peak is used as the pixel serial number of an anode plate, and at the same time, the pixel serial number corresponding to each gray-level local valley is used as the pixel serial number of a cathode plate.
[0024] Based on a further improvement of the above detection method, line features are extracted from the two-dimensional feature image to be detected, and all straight line segments in the two-dimensional feature image to be detected are obtained, including:
[0025] The gradient amplitude and horizontal line angle of each pixel point in the two-dimensional feature image to be detected are respectively determined by using a preset mask, and the pixel points in the two-dimensional feature image to be detected with a gradient amplitude lower than the preset gradient threshold are deleted to obtain the remaining pixel points;
[0026] According to the gradient amplitude and horizontal line angle of the remaining pixel points, and in combination with a preset tolerance value, the remaining pixel points are divided into multiple line support regions;
[0027] According to the gradient amplitude of all pixel points in each line support region, the center and orientation angle of the approximation rectangle corresponding to each line support region are determined; after meeting the center and orientation angle of the approximation rectangle corresponding to each line support region, the minimum circumscribed rectangle containing all pixel points in each line support region is used as the approximation rectangle corresponding to each line support region, and approximation rectangles corresponding to multiple line support regions are obtained;
[0028] The approximation rectangles corresponding to each line support region are screened, and the screened approximation rectangles are used as straight line segments to obtain all straight line segments in the two-dimensional feature image to be detected.
[0029] Based on a further improvement of the above detection method, the step of respectively determining the gradient amplitude and horizontal line angle of each pixel point in the two-dimensional feature image to be detected by using a preset mask includes:
[0030] The gradient amplitude of each pixel point in the pixel serial number direction and the gradient amplitude in the fault serial number direction are calculated through the preset mask;
[0031] The gradient amplitude and horizontal line angle of each pixel point are calculated through the following formula:
[0032]
[0033] where G(x, y) represents the gradient amplitude of each pixel point, x and y represent the pixel serial number and fault serial number of each pixel point, θ represents the horizontal line angle of each pixel point, and g x (x, y) represents the gradient amplitude of each pixel point in the pixel serial number direction, and g y(x, y) represents the gradient magnitude of each pixel point in the tomographic sequence direction.
[0034] Based on the further improvement of the above detection method, each line support region is determined through the following steps:
[0035] Step S701: Use the pixel point with the largest gradient magnitude among the remaining pixel points as the seed pixel point of this line support region. Take the horizontal line angle of the pixel point with the largest gradient magnitude as the first deflection angle of this line support region. Add the seed pixel point to the pixel set of this line support region, and at the same time delete the seed pixel point from the remaining pixel points;
[0036] Step S702: Determine the eight-neighborhood pixel points of each pixel point in the pixel set from the remaining pixel points, and compare the deviation angle between the horizontal line angle of the eight-neighborhood pixel points and the first deflection angle of this line support region; if the deviation angle is less than the preset tolerance value, add the corresponding eight-neighborhood pixel point to the pixel set, and at the same time delete the corresponding eight-neighborhood pixel point from the remaining pixel points, and update the first deflection angle of this line support region based on the horizontal line angles of all pixel points in the pixel set;
[0037] Step S703: Loop and execute Step S702 until the deviation angles of the eight-neighborhood pixel points of each pixel point in the pixel set are not less than the preset tolerance value, then use the obtained pixel set as the pixel points finally included in this line support region.
[0038] Based on the further improvement of the above detection method, calculate the center and orientation angle of the approximation rectangle corresponding to each line support region through the following formula:
[0039]
[0040] Mv = λv;
[0041]
[0042]
[0043] Where, c x 、c y respectively represent the pixel sequence coordinates and tomographic sequence coordinates of the center. G(j) represents the gradient magnitude of the j-th pixel point in each line support region. x(j) represents the pixel sequence of the j-th pixel point in each line support region. y(j) represents the tomographic sequence of the j-th pixel point in each line support region. region represents the pixel point set included in each line support region; M represents the inertia matrix of the approximation rectangle, λ represents the minimum eigenvalue of the inertia matrix, v represents the eigenvector associated with the minimum eigenvalue, v y represents the component of the eigenvector in the tomographic sequence direction, v xdenotes the component of the eigenvector in the pixel sequence number direction, θ′ denotes the orientation angle of the approximated rectangle, and m xx 、m yy and m xy respectively denote the elements of the inertia matrix.
[0044] Based on a further improvement of the above detection method, the screening of the approximated rectangles corresponding to each line support region, and the approximated rectangles after screening are used as straight line segments, including:
[0045] Calculate the second deflection angle between the horizontal line angle of each pixel point in each line support region and the orientation angle of the approximated rectangle respectively;
[0046] Take the pixel points with the second deflection angle lower than the preset second deflection angle as the alignment points of each approximated rectangle, and determine the alignment point density of each approximated rectangle in combination with all pixel points included in the approximated rectangle;
[0047] Judge whether the alignment point density of each approximated rectangle is greater than the preset alignment point density; if so, take this approximated rectangle as a straight line segment in the two-dimensional feature image to be detected.
[0048] Based on a further improvement of the above detection method, the dividing all straight line segments into all pole pieces according to the pole piece thickness and the pixel sequence numbers corresponding to all pole pieces, and determining the pixel points corresponding to each pole piece, including:
[0049] Determine the pixel sequence number range corresponding to this pole piece according to the pixel sequence number corresponding to this pole piece and the pole piece thickness;
[0050] Screen out the straight line segments with pixel sequence numbers within the pixel sequence number range corresponding to this pole piece as the straight line segments corresponding to this pole piece, and all pixel points in the straight line segments are used as the pixel points corresponding to this pole piece.
[0051] Compared with the prior art, the present invention can at least achieve one of the following beneficial effects:
[0052] 1. By extracting the predicted intermediate row pixel points in all CT tomographic images of the battery to be detected, and then analyzing the gray values of the composed two-dimensional feature image to be detected to determine the pixel sequence numbers corresponding to all pole pieces of the battery to be detected, and determining the pixel points corresponding to all pole pieces of the battery to be detected according to the straight line segments extracted from the two-dimensional feature image to be detected, the battery OverHang of the battery to be detected is obtained, greatly shortening the detection time of the battery OverHang and improving the detection efficiency;
[0053] 2. Optimize and update the two-dimensional feature image to be detected, improve the contrast of the gray values of each pixel, reduce the background pixels in the two-dimensional feature image to be detected, and further improve the detection efficiency of the battery OverHang.
[0054] In the present invention, the above technical solutions can also be combined with each other to achieve more preferred combined solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can be made obvious from the description, or understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained from the content specifically pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The drawings are only for the purpose of showing specific embodiments and are not considered as limiting the present invention. Throughout the drawings, the same reference numerals represent the same components.
[0056] Figure 1 It is a schematic flow chart of a method for detecting the OverHang of a battery provided by an embodiment of the present invention;
[0057] Figure 2 It is a schematic structural diagram of a CT tomographic image provided by an embodiment of the present invention;
[0058] Figure 3 It is a schematic structural diagram of a two-dimensional feature image to be detected provided by an embodiment of the present invention;
[0059] Figure 4 It is a schematic curve diagram of a smoothed gray level sequence provided by an embodiment of the present invention;
[0060] Figure 5 It is a schematic flow chart of determining each line support region provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0061] The following will specifically describe the preferred embodiments of the present invention with reference to the drawings, where the drawings form a part of this application and are used together with the embodiments of the present invention to explain the principles of the present invention, rather than to limit the scope of the present invention.
[0062] A specific embodiment of the present invention discloses a method for detecting the OverHang of a battery, as Figure 1 shown, the detection method includes:
[0063] Step S101: Obtain all CT tomographic images of the battery to be detected, extract the preset intermediate row pixel points in each CT tomographic image, and form a two-dimensional feature image to be detected by arranging all the preset intermediate row pixel points according to the tomographic serial numbers; wherein, in the two-dimensional feature image to be detected, the abscissa of each pixel point is the pixel serial number and the ordinate is the tomographic serial number;
[0064] Step S102: Accumulate the gray values of the pixel points corresponding to each pixel serial number in all tomogram serial numbers in the two-dimensional feature image to be detected, and obtain the total gray value corresponding to each pixel serial number; determine the pixel serial numbers corresponding to all the electrode plates in the battery to be detected according to the total gray value corresponding to each pixel serial number.
[0065] Step S103: Perform line feature extraction on the two-dimensional feature image to be detected to obtain all the straight line segments in the two-dimensional feature image to be detected; divide all the straight line segments among all the electrode plates according to the electrode plate thickness and the pixel serial numbers corresponding to all the electrode plates, and determine the pixel points corresponding to each electrode plate.
[0066] Step S104: Determine the tomogram serial number difference between the adjacent cathode and anode electrode plates according to the maximum tomogram serial number of the pixel points corresponding to each electrode plate, and combine the height of each CT tomogram image to obtain the OverHang of the battery to be detected.
[0067] Specifically, as Figure 1 shown, in Step S101, an industrial CT scanner with high-resolution imaging ability, which can clearly present the internal structure of the battery, is selected. The battery to be detected is placed in the detection area of the industrial CT scanner to ensure that the entire structure of the battery to be detected can be completely and clearly captured by the CT scanner, and the CT tomogram images of the battery to be detected are collected. The collected CT tomogram images are as Figure 2 shown.
[0068] Specifically, as Figure 2 shown, all the CT tomogram images have the same length and width, that is, the number of horizontal pixels included in each CT tomogram image is the same, and the number of vertical pixels is the same, which are set as M pixels and N pixels respectively. At the same time, the number of all the CT tomogram images is set as L.
[0069] Specifically, in Step S101, the preset middle row pixel points are set in advance, and at least one core pixel point is included in the preset middle row pixel points. Exemplarily, the N / 2 row is selected for the preset middle row.
[0070] Specifically, all the preset middle row pixel points are formed into a two-dimensional feature image to be detected according to the tomogram serial numbers, as Figure 3 shown. In the two-dimensional feature image to be detected, the abscissa of each pixel point is set as the pixel serial number, which are 0 - M in sequence, and the ordinate of each pixel point is set as the tomogram serial number, which are 0 - L in sequence.
[0071] Preferably, the extraction of the preset middle row pixel points in each CT tomogram image includes:
[0072] Determine the area where the battery core is located in the CT tomogram image according to the design parameters of the battery to obtain the core area.
[0073] Determine the range of row pixel numbers corresponding to the core region in the row pixel numbers, and obtain the core row pixel number range;
[0074] Select one row from the core row pixel number range as the preset intermediate row, and take all the pixel points of the preset intermediate row in the CT tomographic image as the preset intermediate row pixel points.
[0075] Specifically, for batteries of different models, the area occupied by the battery core in the whole battery is different. The core region where the core is located can be determined according to the design parameters of the battery to be detected, and then the range of horizontal pixel numbers and the range of vertical pixel numbers where the core region is located in the CT tomographic image can be determined, that is, the range of row pixel numbers and the range of column pixel numbers of the core region can be determined. Any row can be selected from the row pixel number range as the preset intermediate row, and all the pixel points in the preset intermediate row are used as the preset intermediate row pixel points.
[0076] Preferably, after forming the two-dimensional feature image to be detected by arranging all the preset intermediate row pixel points according to the tomographic number, the two-dimensional feature image to be detected is optimized and updated. The optimization and update include:
[0077] Perform gray level adjustment and filtering processing on the two-dimensional feature image to be detected, and delete the pixel points with gray levels greater than the preset gray level threshold to obtain an intermediate two-dimensional feature image;
[0078] Use the Sobel operator to calculate the gradient value of each pixel point in the pixel number direction in the intermediate two-dimensional feature image to obtain the horizontal gradient value of each pixel point in the intermediate two-dimensional feature image;
[0079] Compare the horizontal gradient value of each pixel point in the intermediate two-dimensional feature image with the preset gradient change threshold respectively, and delete the pixel points with horizontal gradient values less than the gradient change threshold in the intermediate two-dimensional feature image to obtain the updated two-dimensional feature image to be detected.
[0080] Specifically, as Figure 3 shown, when optimizing and updating the two-dimensional feature image to be detected, the two-dimensional feature image to be detected formed by arranging all the preset intermediate row pixel points according to the tomographic number may have weak image contrast or large noise, and the two-dimensional feature image to be detected is enhanced through gray level adjustment and filtering processing.
[0081] Specifically, when performing gray level adjustment, the linear gray level stretching algorithm is adopted to expand the gray level range of the two-dimensional feature image to be detected to the entire display range, making the details in the image more clearly visible. Exemplarily, the entire display range is set to (0, 255).
[0082] Specifically, when performing filtering processing, Gaussian filtering is used to remove the random noise in the two-dimensional feature image to be detected while retaining the edge and detail information of the image.
[0083] Specifically, as Figure 3 shown, the battery housing appears as a high gray-scale value area in the image, with a significant gray-scale difference from the battery electrode. To eliminate the influence of the housing, a threshold segmentation algorithm is used. By setting a gray-scale threshold, the pixel points with gray-scale values greater than the gray-scale threshold are regarded as the housing area and deleted, obtaining an intermediate two-dimensional feature image.
[0084] Specifically, the horizontal gradient value of each pixel point in the intermediate two-dimensional feature image can highlight the areas with large gray-scale changes in the image, thereby effectively identifying the areas of the cathode and anode electrodes of the battery to be detected. Furthermore, the areas of the cathode and anode electrodes of the battery to be detected are retained for the next calculation, reducing the amount of calculation and enabling faster detection of the battery OverHang.
[0085] Specifically, the Sobel operator is selected to calculate the gradient value of each pixel point in the intermediate two-dimensional feature image in the pixel serial number direction, obtaining the horizontal gradient value of each pixel point in the intermediate two-dimensional feature image. Set a gradient change threshold. If the gradient value of a certain pixel point in the pixel serial number direction, that is, the horizontal gradient value, is greater than the gradient change threshold, it indicates that the certain pixel point may be the cathode and anode electrodes of the battery to be detected, and then it is retained, obtaining an optimized and updated two-dimensional feature image to be detected.
[0086] Specifically, in step S102, as Figure 3 shown, accumulate the gray-scale values of the pixel points corresponding to each pixel serial number in all slice serial numbers in the two-dimensional feature image to be detected, and then the total gray-scale value corresponding to each pixel serial number from 0 to M can be obtained; determine the pixel serial numbers corresponding to all the electrodes in the battery to be detected according to the total gray-scale value corresponding to each pixel serial number.
[0087] Preferably, the determining the pixel serial numbers corresponding to all the electrodes in the battery to be detected according to the total gray-scale value corresponding to each pixel serial number includes:
[0088] Smoothing the total gray-scale values corresponding to all pixel serial numbers by using the moving average method to obtain a smoothed gray-scale sequence;
[0089] Adopting a peak-valley value detection method to determine multiple gray-scale local peaks and multiple gray-scale local valleys in the smoothed gray-scale sequence;
[0090] Taking the pixel serial number corresponding to each gray-scale local peak as the pixel serial number of an anode electrode, and at the same time taking the pixel serial number corresponding to each gray-scale local valley as the pixel serial number of a cathode electrode.
[0091] Specifically, according to the moving average method, the total gray values corresponding to all pixel numbers are smoothed. The sliding window can be selected as 3, that is, the total gray value corresponding to each pixel number after smoothing is the average of the total gray values corresponding to each pixel number, the previous pixel number, and the next pixel number before smoothing. It should be noted that when the window moves to the edge of the data sequence, it may exceed the range of the data sequence. The data sequence can be extended by repeating the boundary points so that the window is always within the data range, and finally a smoothed gray sequence is obtained, as Figure 4 shown.
[0092] Specifically, in the peak-valley detection method, the total gray values corresponding to a certain pixel number and the previous and next two pixel numbers are compared. If the total gray value corresponding to a certain pixel number is greater than the total gray values corresponding to the previous and next two pixel numbers at the same time, it can be determined that the total gray value corresponding to a certain pixel number is a local gray peak; similarly, if the total gray value corresponding to a certain pixel number is less than the total gray values corresponding to the previous and next two pixel numbers at the same time, it can be determined that the total gray value corresponding to a certain pixel number is a local gray valley.
[0093] Specifically, according to the imaging characteristics of the battery electrode plate, it can be known that the local gray peak corresponds to the column where the anode plate is located, and the local gray valley corresponds to the column where the cathode plate is located, that is, the pixel numbers of the anode plate and the cathode plate in the battery to be detected are determined.
[0094] It can be understood that in the battery to be detected, there are multiple cathode plates and anode plates arranged in sequence. The adjacent cathode plate and anode plate are taken as a group, and the height difference between the adjacent cathode plate and anode plate is determined as the battery OverHang.
[0095] Specifically, in step S103, line feature extraction is performed on the two-dimensional feature image to be detected, and all straight line segments in the two-dimensional feature image to be detected are obtained. It should be noted that due to the uneven distribution of the gray values of the pixel points of the electrode plate, each electrode plate may correspond to multiple straight line segments.
[0096] Preferably, the performing line feature extraction on the two-dimensional feature image to be detected to obtain all straight line segments in the two-dimensional feature image to be detected includes:
[0097] Using a preset mask to respectively determine the gradient amplitude and horizontal line angle of each pixel point in the two-dimensional feature image to be detected, deleting the pixel points in the two-dimensional feature image to be detected whose gradient amplitude is lower than the preset gradient threshold, and obtaining the remaining pixel points;
[0098] According to the gradient amplitude and horizontal line angle of the remaining pixel points, and in combination with a preset tolerance value, the remaining pixel points are divided into multiple line support regions;
[0099] Determine the center and orientation angle of the approximation rectangle corresponding to each line support region according to the gradient magnitudes of all pixel points in each line support region; after satisfying the center and orientation angle of the approximation rectangle corresponding to each line support region, use the minimum bounding rectangle containing all pixel points in each line support region as the approximation rectangle corresponding to each line support region, and obtain the approximation rectangles corresponding to multiple line support regions;
[0100] Screen the approximation rectangles corresponding to each line support region, and use the screened approximation rectangles as straight line segments to obtain all straight line segments in the two-dimensional feature image to be detected.
[0101] Specifically, preset the mask to 2×2, and calculate the gradient magnitude and horizontal line angle of each pixel point respectively, that is, calculate the gradient magnitude of each pixel point in the pixel serial number direction and the gradient magnitude in the slice serial number direction.
[0102] Preferably, the method for respectively determining the gradient magnitude and horizontal line angle of each pixel point in the two-dimensional feature image to be detected by using a preset mask includes:
[0103] Calculate the gradient magnitude of each pixel point in the pixel serial number direction and the gradient magnitude in the slice serial number direction through the preset mask;
[0104] Calculate the gradient magnitude and horizontal line angle of each pixel point through the following formula:
[0105]
[0106]
[0107] Among them, G(x, y) represents the gradient magnitude of each pixel point, x and y represent the pixel serial number and slice serial number of each pixel point, θ represents the horizontal line angle of each pixel point, and g x (x, y) represents the gradient magnitude of each pixel point in the pixel serial number direction, and g y (x, y) represents the gradient magnitude of each pixel point in the slice serial number direction.
[0108] Specifically, calculate the gradient magnitude of each pixel point in the pixel serial number direction and the gradient magnitude in the slice serial number direction through the following formula:
[0109]
[0110] Among them, i(x, y) represents the gray value corresponding to the pixel point with pixel serial number x and slice serial number y.
[0111] It should be noted that the pixel points with small gradient magnitudes correspond to the smooth or variably exchanged regions in the image, and they will cause large gradient calculation errors during quantization calculation. By screening out the pixel points with gradient magnitudes less than the preset gradient threshold through the preset gradient threshold, the calculation accuracy is improved, and further the accuracy of detecting the battery OverHang is improved.
[0112] Specifically, after determining the remaining pixel points, the remaining pixel points are divided into multiple line support regions by combining the gradient magnitudes and horizontal line angles of the remaining pixel points with a preset tolerance value.
[0113] Preferably, as Figure 5 shown, each line support region is determined through the following steps:
[0114] Step S701: Use the pixel point with the largest gradient magnitude among the remaining pixel points as the seed pixel point of this line support region, use the horizontal line angle of the pixel point with the largest gradient magnitude as the first deflection angle of this line support region, add the seed pixel point to the pixel set of this line support region, and at the same time delete the seed pixel point from the remaining pixel points;
[0115] Step S702: Determine the eight-neighborhood pixel points of each pixel point in the pixel set from the remaining pixel points, and compare the deviation angle between the horizontal line angle of the eight-neighborhood pixel points and the first deflection angle of this line support region; if the deviation angle is less than the preset tolerance value, add the corresponding eight-neighborhood pixel point to the pixel set, and at the same time delete the corresponding eight-neighborhood pixel point from the remaining pixel points, and update the first deflection angle of this line support region based on the horizontal line angles of all pixel points in the pixel set;
[0116] Step S703: Loop and execute Step S702 until the deviation angles of the eight-neighborhood pixel points of each pixel point in the pixel set are not less than the preset tolerance value, then use the obtained pixel set as the pixel points finally included in this line support region.
[0117] It should be noted that, as Figure 3 shown, for multiple pixel points in the area where the same pole piece is located, the gradient magnitudes and horizontal line angles are almost the same. Through Step S701, Step S702, and Step S703, multiple pixel points in the area where each pole piece is located are jointly divided into a set as a line support region. It can be understood that considering the problem of uneven gray distribution of the same pole piece, the area where the same pole piece is located may be divided into multiple line support regions.
[0118] Specifically, as Figure 5As shown, at step S701, when determining each line support region, a pixel set of the line support region is established. The pixel point with the largest gradient magnitude is selected from the remaining pixel points as the seed pixel point of the line support region and added to the pixel set of the line support region. The horizontal line angle of the pixel point with the largest gradient magnitude is used as the first deflection angle of the line support region. At the same time, the seed pixel point of the line support region is deleted from the remaining pixel points, and the remaining pixel points are updated.
[0119] It should be noted that by setting the seed pixel points, the regions where the polar plates with higher contrast are located can be screened out in an orderly manner until all the regions where the polar plates are located are screened out.
[0120] Specifically, in step S702, the eight-neighborhood pixel points of each pixel point in the pixel set of the line support region are determined from the remaining pixel points. The remaining pixel points are further updated according to step S702, and at the same time, the first deflection angle of the line support region is updated according to the following formula:
[0121]
[0122] where, θ region represents the updated first deflection angle of the line support region, θ j represents the horizontal line angle of the j-th pixel point in the pixel set of the line support region, and ∑ j represents all the pixel points in the pixel set of the line support region.
[0123] Specifically, as Figure 5 shown, in step S703, by repeatedly executing step S702 until all the pixel points that satisfy the line support region are determined, the obtained pixel set is used as the pixel points finally included in the line support region.
[0124] Specifically, by repeatedly executing step S701, step S702, and step S703, the remaining pixel points can be divided into multiple line support regions, and each line support region corresponds to multiple pixel points.
[0125] Specifically, according to the gradient magnitudes of all the pixel points in each line support region, the center and orientation angle of the approximation rectangle corresponding to each line support region are determined.
[0126] Preferably, the center and orientation angle of the approximation rectangle corresponding to each line support region are calculated by the following formula:
[0127]
[0128]
[0129] Mv = λv;
[0130]
[0131] Among them, c x and c y respectively represent the pixel sequence number coordinates and slice sequence number coordinates of the center. G(j) represents the gradient amplitude of the j-th pixel point in each line support region, x(j) represents the pixel sequence number of the j-th pixel point in each line support region, y(j) represents the slice sequence number of the j-th pixel point in each line support region, and region represents the set of pixel points included in each line support region; M represents the inertia matrix of the approximation rectangle, λ represents the minimum eigenvalue of the inertia matrix, v represents the eigenvector associated with the minimum eigenvalue, v y represents the component of the eigenvector in the slice sequence number direction, v x represents the component of the eigenvector in the pixel sequence number direction, θ′ represents the orientation angle of the approximation rectangle, m xx and m yy and m xy respectively represent the elements of the inertia matrix.
[0132] Specifically, after determining the center and orientation angle of the approximation rectangle corresponding to each line support region, the minimum circumscribed rectangle containing all pixel points in each line support region is used as the approximation rectangle corresponding to each line support region, and approximation rectangles corresponding to multiple line support regions are obtained, with each line support region corresponding to one approximation rectangle.
[0133] It should be noted that, as Figure 3 shown, each line support region includes multiple pixel points, and the distribution of the multiple pixel points is irregular. Calculating the approximation rectangle corresponding to each line support region, that is, the pixel points included in the approximation rectangle need to include multiple pixel points of the line support region, reducing the influence of the uneven part of the pole piece gray value and improving the detection accuracy.
[0134] Specifically, the approximation rectangles corresponding to each line support region are screened, and the screened approximation rectangles are used as straight line segments to obtain all straight line segments in the two-dimensional feature image to be detected.
[0135] Preferably, the screening of the approximation rectangles corresponding to each line support region, and the screened approximation rectangles being used as straight line segments, includes:
[0136] Calculating the second deflection angle between the horizontal line angle of each pixel point in each line support region and the orientation angle of the approximation rectangle respectively;
[0137] Taking the pixel points with the second deflection angle lower than the preset second deflection angle as the alignment points of each approximation rectangle, and determining the alignment point density of each approximation rectangle in combination with all pixel points included in the approximation rectangle;
[0138] Determine whether the alignment point density of each approximated rectangle is greater than a preset alignment point density; if yes, regard the approximated rectangle as a straight line segment in the two-dimensional feature image to be detected.
[0139] Specifically, calculate the angular deviation between the horizontal line angle of all pixel points in each line support region and the orientation angle of the approximated rectangle corresponding to the line support region as the second deviation angle. Combine the preset second deflection angle to determine the alignment points, and calculate the alignment point density through the following formula:
[0140]
[0141] Among them, D(r) represents the alignment point density of the r-th approximated rectangle, k represents the number of alignment points of the approximated rectangle, length(r) and width(r) respectively represent the number of pixels included in the approximated rectangle in the pixel serial number direction and the number of pixels included in the tomogram serial number direction.
[0142] Specifically, compare the alignment point density of each approximated rectangle with the preset alignment point density, and screen out the approximated rectangles with an alignment point density greater than the preset alignment point density as a straight line segment in the two-dimensional feature image to be detected, and finally obtain all the straight line segments in the two-dimensional feature image to be detected.
[0143] It should be noted that as Figure 3 shown, the straight line segment corresponds to the local line feature in the figure, and the approximated rectangle describes a pixel region. When the alignment point density in the approximated rectangle is too small, that is, the alignment points account for a small proportion of all pixel points included in the approximated rectangle, the matching degree between the approximated rectangle and the line feature is poor, and it cannot fit the actual line feature well. At this time, it needs to be discarded to further improve the detection result of the straight line segment.
[0144] Specifically, as Figure 1 shown, in step S103, according to the pole piece thickness and the pixel serial numbers corresponding to all pole pieces, divide all straight line segments among all pole pieces to determine the pixel points corresponding to each pole piece.
[0145] Preferably, the step of dividing all straight line segments among all pole pieces according to the pole piece thickness and the pixel serial numbers corresponding to all pole pieces to determine the pixel points corresponding to each pole piece includes:
[0146] Determine the pixel serial number range corresponding to the pole piece according to the pixel serial number corresponding to the pole piece and the pole piece thickness;
[0147] Screen out the straight line segments with pixel serial numbers within the pixel serial number range corresponding to the pole piece as the straight line segments corresponding to the pole piece, and all pixel points in the straight line segments are used as the pixel points corresponding to the pole piece.
[0148] Specifically, in step S102, the pixel numbers corresponding to all the electrodes in the battery to be detected are obtained. Combining with the electrode thickness, the pixel number range where the electrode is located can be determined, and all the line segments within the pixel number range where the electrode is located are used as the line segments corresponding to the electrode.
[0149] It should be noted that, theoretically, each electrode corresponds to one line segment. However, due to the uneven gray-scale distribution of the electrode, each electrode may correspond to multiple line segments. All the pixel points in the line segment are used as the pixel points corresponding to the electrode.
[0150] Specifically, as Figure 1 shown, in step S104, all the pixel points corresponding to each electrode are determined. At this time, the maximum value of the fault layer numbers among all the pixel points is determined.
[0151] Specifically, as Figure 3 shown, it can be understood that the abscissa of each pixel point is the pixel number, and the ordinate is the fault layer number. Calculate the difference in the fault layer numbers between the adjacent cathode electrode and anode electrode, that is, how many CT tomographic image distances the adjacent cathode electrode and anode electrode differ in the direction of the fault layer number. Combining with the height of the CT tomographic images set and saved when the CT scanner scans the battery to be detected, the height difference between the adjacent cathode electrode and anode electrode can be calculated. Sequentially obtain the height differences between all the cathodes and anodes in the battery to be detected, that is, obtain the OverHang of the battery to be detected.
[0152] Compared with the prior art, the method for detecting the battery OverHang provided by the embodiment of the present invention extracts the predicted intermediate row pixel points in all the CT tomographic images of the battery to be detected, then analyzes the gray-scale values of the composed two-dimensional feature image to be detected to determine the pixel numbers corresponding to all the electrodes of the battery to be detected, determines the pixel points corresponding to all the electrodes of the battery to be detected according to the line segments extracted from the two-dimensional feature image to be detected, and obtains the battery OverHang of the battery to be detected, greatly shortening the detection time of the battery OverHang and improving the detection efficiency; at the same time, optimizing and updating the two-dimensional feature image to be detected, improving the contrast of the gray-scale values of each pixel, and reducing the background pixels in the two-dimensional feature image to be detected, further improving the detection efficiency of the battery OverHang.
[0153] Those skilled in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium is a magnetic disk, an optical disk, a read-only memory or a random access memory, etc.
[0154] The above are only the preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for detecting battery OverHang, characterized in that: The detection method comprises: Obtain all CT slice images of the battery to be tested, extract the preset middle row pixel points in each CT slice image, and form all the preset middle row pixel points into a two-dimensional feature image to be tested according to the slice sequence number; wherein the horizontal coordinate of each pixel point in the two-dimensional feature image to be tested is the pixel sequence number, and the vertical coordinate is the slice sequence number; Accumulate the pixel grayscale values corresponding to each pixel number in all fault numbers in the two-dimensional feature image to be detected to obtain the total grayscale value corresponding to each pixel number; determine the pixel numbers corresponding to all pole pieces in the battery to be detected according to the total grayscale value corresponding to each pixel number; Line feature extraction is performed on the two-dimensional feature image to be detected to obtain all straight line segments in the two-dimensional feature image to be detected; all straight line segments are divided into all pole pieces according to the thickness of the pole piece and the pixel sequence numbers corresponding to all pole pieces, and the pixel points corresponding to each pole piece are determined; The difference in the fault numbers of the adjacent cathode and anode pole pieces is determined according to the maximum fault number of the pixel points corresponding to each pole piece, and the OverHang of the battery to be tested is obtained in combination with the height of each CT tomographic image.
2. The detection method according to claim 1, characterized in that: The step of extracting a preset middle row of pixel points from each CT tomographic image comprises: Determine the area where the battery core is located in the CT tomographic image according to the design parameters of the battery, and obtain the core area; Determine the row pixel number range corresponding to the core area on the row pixel number to obtain the core row pixel number range; A row is selected from the core row pixel number range as a preset middle row, and all pixel points of the preset middle row in the CT tomographic image are used as pixel points of the preset middle row.
3. The detection method according to claim 1, characterized in that: After all the preset middle row pixels are combined into a two-dimensional feature image to be detected according to the fault sequence number, the two-dimensional feature image to be detected is optimized and updated, and the optimization and updating includes: The grayscale of the two-dimensional feature image to be detected is adjusted and filtered, and the pixels with grayscale values greater than a preset threshold are deleted to obtain an intermediate two-dimensional feature image. The Sobel operator is used to calculate the gradient value of each pixel point in the intermediate two-dimensional feature image in the direction of the pixel number, and the lateral gradient value of each pixel point in the intermediate two-dimensional feature image is obtained; The lateral gradient value of each pixel in the intermediate two-dimensional feature image is compared with the preset gradient change threshold, and the pixel points in the intermediate two-dimensional feature image whose lateral gradient value is less than the gradient change threshold are deleted to obtain an updated two-dimensional feature image to be detected.
4. The detection method according to claim 1, characterized in that: The step of determining the pixel numbers corresponding to all the electrodes in the battery to be tested according to the total grayscale value corresponding to each pixel number includes: The total grayscale values corresponding to all pixel numbers are smoothed using the sliding average method to obtain a smooth grayscale sequence; A peak-valley value detection method is used to determine a plurality of gray-level local peak values and a plurality of gray-level local valley values in a smooth gray-level sequence; The pixel number corresponding to each local grayscale peak is used as the pixel number of an anode electrode, and the pixel number corresponding to each local grayscale valley is used as the pixel number of a cathode electrode.
5. The detection method according to claim 4, characterized in that: The line feature extraction is performed on the two-dimensional feature image to be detected to obtain all straight line segments in the two-dimensional feature image to be detected, including: Using a preset mask, the gradient amplitude and horizontal line angle of each pixel point in the two-dimensional feature image to be detected are determined respectively, and the pixel points whose gradient amplitude in the two-dimensional feature image to be detected is lower than the preset gradient threshold are deleted to obtain the remaining pixel points; According to the gradient amplitude and horizontal line angle of the remaining pixels and the preset tolerance value, the remaining pixels are divided into multiple line support areas; According to the gradient amplitude of all pixels in each line support area, the center and orientation angle of the approximation rectangle corresponding to each line support area are determined; after satisfying the center and orientation angle of the approximation rectangle corresponding to each line support area, the minimum circumscribed rectangle containing all pixels in each line support area is used as the approximation rectangle corresponding to each line support area, and the approximation rectangles corresponding to multiple line support areas are obtained; The approximate rectangle corresponding to each line support area is screened, and the screened approximate rectangle is used as a straight line segment to obtain all the straight line segments in the two-dimensional feature image to be detected.
6. The detection method according to claim 5, characterized in that: The method of using a preset mask to respectively determine the gradient amplitude and the horizontal line angle of each pixel point in the two-dimensional feature image to be detected includes: The gradient amplitude of each pixel point in the direction of the pixel number and the gradient amplitude in the direction of the fault number are calculated by using a preset mask; The gradient amplitude and horizontal line angle of each pixel are calculated by the following formula: Among them, G(x, y) represents the gradient amplitude of each pixel, x and y represent the pixel number and slice number of each pixel, θ represents the horizontal line angle of each pixel, and g x (x, y) represents the gradient amplitude of each pixel in the direction of the pixel number, g y (x, y) represents the gradient amplitude of each pixel in the direction of the fault number.
7. The detection method according to claim 6, characterized in that: Determine each line support region by following these steps: Step S701: taking the pixel with the largest gradient amplitude among the remaining pixels as the seed pixel of the line support area, taking the horizontal line angle of the pixel with the largest gradient amplitude as the first deflection angle of the line support area, adding the seed pixel to the pixel set of the line support area, and deleting the seed pixel from the remaining pixels; Step S702: Determine eight neighborhood pixel points of each pixel point in the pixel set from the remaining pixel points, and compare the deviation angle between the horizontal line angle of the eight neighborhood pixel points and the first deflection angle of the line support area; if the deviation angle is less than a preset tolerance value, add the corresponding eight neighborhood pixel points to the pixel set, delete the corresponding eight neighborhood pixel points from the remaining pixel points, and update the first deflection angle of the line support area based on the horizontal line angle of all pixel points in the pixel set; Step S703: loop through step S702 until the deviation angles of the eight neighborhood pixels of each pixel in the pixel set are no less than the preset tolerance value, and then use the obtained pixel set as the pixel points finally included in the line support area.
8. The detection method according to claim 7, characterized in that: The center and orientation angle of the approximate rectangle corresponding to each line support area are calculated using the following formula: Mv=λv; Among them, c x 、c y Represent the pixel number coordinates and fault number coordinates of the center, respectively; G(j) represents the gradient amplitude of the j-th pixel point in each line support area; x(j) represents the pixel number of the j-th pixel point in each line support area; y(j) represents the fault number of the j-th pixel point in each line support area; reglon represents the set of pixels contained in each line support area; M represents the inertia matrix of the approximate rectangle; λ represents the minimum eigenvalue of the inertia matrix; v represents the eigenvector associated with the minimum eigenvalue; v y represents the component of the characteristic vector in the direction of the fault number, v x represents the component of the feature vector in the direction of the pixel number, θ′ represents the orientation angle of the approximation rectangle, and m xx 、m yy and m xy They represent the elements of the inertia matrix respectively.
9. The detection method according to claim 5, characterized in that: The filtering of the approximate rectangle corresponding to each line support area, and using the filtered approximate rectangle as a straight line segment, includes: Calculate the second deflection angle of the horizontal line angle of each pixel point in each line support area and the orientation angle of the approximate rectangle respectively; Using the pixel points whose second deflection angle is lower than the preset second deflection angle as the alignment points of each approximation rectangle, and determining the alignment point density of each approximation rectangle in combination with all the pixel points included in the approximation rectangle; It is determined whether the alignment point density of each approximation rectangle is greater than a preset alignment point density; if so, the approximation rectangle is used as a straight line segment in the two-dimensional feature image to be detected.
10. The detection method according to claim 9, characterized in that: The method of dividing all straight line segments to all pole pieces according to the pole piece thickness and the pixel numbers corresponding to all pole pieces, and determining the pixel points corresponding to each pole piece, comprises: Determine the pixel number range corresponding to the pole piece according to the pixel number corresponding to the pole piece and the thickness of the pole piece; The straight line segments with pixel numbers within the range of pixel numbers corresponding to the pole piece are selected as the straight line segments corresponding to the pole piece, and all pixel points in the straight line segments are used as pixel points corresponding to the pole piece.
Citation Information
Cited By
Battery monitoring method, device, system, equipment, medium and program product
CN120778017A