Power battery flatness detection method based on image recognition
By using an image recognition-based method, a point cloud map of the power battery surface is generated, a reference plane is fitted, and abnormal areas are marked. This solves the accuracy and efficiency problems of power battery flatness detection in the prior art, and realizes high-precision, visualized flatness assessment and quality control.
Patent Information
- Application Number
- CN202511722190.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-10
AI Technical Summary
Current methods for testing the flatness of power batteries rely on manual visual inspection or traditional mechanical methods, which suffer from low accuracy and efficiency, cannot achieve online or rapid batch testing, and lack unified identification standards and quantifiable evaluation indicators. As a result, flatness anomalies are difficult to detect in a timely manner, affecting battery performance and safety.
An image recognition-based method is used to acquire images of the power battery and calibration board information, establish pixel mapping relationships, generate a point cloud map of the battery surface, fit a reference plane, calculate point cloud deviation, mark bulge and depression areas, evaluate flatness, and output a 3D rendering map.
It enables unified testing of batteries of different models and surface textures, improves testing accuracy and comparability, accurately identifies local abnormal areas, provides quantitative flatness assessment and visual reference, and supports battery production quality control and batch testing.
Smart Images

Figure CN121504898A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image detection, in particular to a power battery flatness detection method based on image recognition. BACKGROUND
[0002] Power batteries are widely used in new energy vehicles, energy storage devices and industrial mobile devices, and their performance and safety directly affect the reliability and service life of the whole system. However, the existing power battery flatness detection mainly relies on manual visual inspection or traditional mechanical contact measurement method, which has the problems of limited detection accuracy, low efficiency and difficulty in unified standard for batch detection. Although some high-precision measurement devices can obtain the surface topography of the battery, they are often bulky and expensive, and cannot realize online or rapid batch detection. In addition, the traditional method lacks unified recognition standard and quantifiable evaluation index when facing batteries of different sizes, different models and different surface textures, making it difficult to realize accurate positioning and grading processing of local abnormalities such as bulges and depressions. These problems lead to the fact that flatness abnormalities in the production process of power batteries cannot be discovered in time, which may affect the thermal management, electrochemical performance and overall safety of the battery. SUMMARY
[0003] Therefore, it is necessary to provide a power battery flatness detection method based on image recognition to solve at least one of the above technical problems.
[0004] To achieve the above-mentioned purpose, a power battery flatness detection method based on image recognition comprises the following steps: Step S1: Obtain the image of the power battery and the calibration plate information, and determine the pixel mapping relationship; generate the battery surface point cloud map using the pixel mapping relationship; Step S2: Fit the reference plane using the battery surface point cloud map, and calculate the point cloud deviation; mark the battery bulge area according to the point cloud deviation; calculate the height deviation of the battery bulge area to determine the bulge degree; Step S3: Mark the surface depression points based on the battery surface point cloud map, and calculate the depression depth of the surface depression points; when the depression depth is greater than the depression threshold, mark it as a depression abnormal area; Step S4: Evaluate the flatness of the power battery according to the bulge degree and the depression abnormal area; convert the flatness of the power battery into a three-dimensional rendering map, and output the flat area grading result.
[0005] The present application has the following advantages: (1) By obtaining the image of the power battery and combining the calibration plate information, the pixel mapping relationship is established, which realizes the unified point cloud reconstruction of batteries of different models and different surface textures, and ensures the accuracy and comparability of the flatness detection data.
[0006] (2) In the reference plane fitting link, the grid division and candidate point screening method are used to gradually generate the initial plane and iteratively adjust, which realizes the high-precision deviation calculation of the battery surface, and improves the accuracy of the identification of the bulge and depression abnormal area.
[0007] (3) In the bulge and depression area marking process, combined with potential abnormal point clustering, isolated point elimination and main texture direction analysis, the continuity identification and hierarchical processing of the local abnormal area are realized, and the refinement degree and reliability of the power battery flatness evaluation are improved.
[0008] (4) In the three-dimensional rendering output link, the bulge degree and depression abnormal area are converted into visual three-dimensional rendering diagram, and the flat area hierarchical result is output, which provides intuitive and quantitative reference for battery production quality control, batch detection and subsequent process adjustment. BRIEF DESCRIPTION OF DRAWINGS
[0009] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-restrictive embodiments made with reference to the accompanying drawings: Fig. 1 The step flowchart of the power battery flatness detection method based on image recognition of the present application is shown in the figure. Fig. 2 The power battery schematic diagram in the present application is shown in the figure. Fig. 3 The pixel mapping relationship schematic diagram in the present application is shown in the figure. The implementation of the purpose of the present application, functional characteristics and advantages will be further described with reference to the accompanying drawings. DETAILED DESCRIPTION
[0010] The technical method of the present application will be described clearly and completely below in combination with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0011] In addition, the accompanying drawings are only schematic diagrams of the present application, and are not necessarily drawn to scale. The same reference signs in the drawings represent the same or similar parts, and thus repeated description thereof will be omitted. Some block diagrams shown in the drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0012] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0013] To achieve the above objectives, please refer to Figs. 1 to 3 This invention provides a method for detecting the flatness of a power battery based on image recognition, the method comprising the following steps: Step S1: Acquire images of the power battery and calibration board information, and determine the pixel mapping relationship; use the pixel mapping relationship to generate a point cloud map of the battery surface; In one embodiment, an industrial camera (1080p resolution) is used to acquire images of the power battery surface, and a calibration board is placed for checkerboard calibration to obtain the camera's intrinsic and extrinsic parameters (R, T). A mapping relationship is established between the physical coordinates of the calibration board and the pixel coordinates, mapping each pixel to a three-dimensional spatial coordinate system to generate a point cloud map of the battery surface. Subsequently, noise filtering and downsampling processing are performed on the point cloud: a statistical filter with a radius of 0.5mm is used to remove isolated points, and a voxel mesh method is used to unify the point spacing to 0.5mm to ensure uniform point cloud density, providing accurate input for subsequent plane fitting and anomaly detection.
[0014] In another embodiment, assuming 1200 images of the power battery are acquired, the calibration board is 9×7 grids, the camera intrinsic parameters fx=1250, fy=1230, and the extrinsic parameters... , The generated point cloud contains approximately 600,000 points, evenly distributed across the battery surface. After noise filtering, 550,000 valid points are retained, with an average spacing of approximately 0.45 mm between points, providing a high-precision foundation for subsequent bulge and dent detection.
[0015] Step S2: Fit a reference plane using the battery surface point cloud map and calculate the point cloud deviation; mark the battery bulging area based on the point cloud deviation; calculate the height deviation of the battery bulging area to determine the degree of bulging; In one embodiment, a least squares method is used to fit a reference plane to the point cloud: three sets of non-collinear points are randomly selected to construct an initial plane, the vertical distance from each point to the plane is calculated, the average deviation is calculated, and the plane parameters are iteratively adjusted until the deviation converges (e.g., the convergence condition is average deviation < 0.1 mm). Points in the point cloud that deviate from the reference plane by more than a bulge threshold (e.g., 0.5 mm) are marked as potential bulge points. Potential bulge points are clustered (density threshold of 5 mm) to identify continuous bulge regions, and the average height deviation of each region is calculated as an indicator of bulge severity. For example, the deviation at the highest point can be used as the maximum bulge value, and the standard deviation of height within the region can measure the uniformity of bulge distribution.
[0016] In another embodiment, assuming a total point cloud of 500,000 points and a maximum deviation of 0.08 mm after fitting to the reference plane, approximately 1,800 bulge points were detected, clustered into four bulge regions with height deviations of 0.85 mm, 1.15 mm, 0.9 mm, and 1.05 mm, respectively, a mean standard deviation of 0.12 mm, and a total area covering the battery surface of approximately 35 cm². 2 This step can help to initially identify the location and severity of the bulge.
[0017] Step S3: Mark surface depression points based on the battery surface point cloud map and calculate the depression depth of the surface depression points; when the depression depth is greater than the depression threshold, mark it as a depression anomaly area; In one embodiment, based on a reference plane, the negative deviation value of each point is calculated, and points smaller than a depression threshold (e.g., -0.4 mm) are marked as suspected depression points. Subsequently, the average height difference is calculated within the neighborhood (radius 5 mm) of each suspected point, and points with deviations lower than the neighborhood mean are identified as depression anomaly regions. Finally, the area and depth of the depression anomaly regions are statistically analyzed as indicators of depression severity.
[0018] In another embodiment, assuming approximately 900 suspected depressions are detected, 420 anomalous depressions are confirmed after neighborhood analysis. The area of the depression region ranges from 15 to 50 mm. 2 The maximum indentation depth was 0.65 mm, and the average indentation depth was 0.48 mm. These values can be used to determine the distribution and severity of local indentations on the battery surface, providing a quantitative basis for overall flatness assessment.
[0019] Step S4: Assess the flatness of the power battery based on the degree of bulging and abnormal dent areas; convert the flatness of the power battery into a 3D rendering and output the grading results of the flat areas.
[0020] In one embodiment, the flatness index of the power battery is calculated by combining the bulge height deviation and the dent depth (flatness index = 1 – (bulge coefficient + dent coefficient) / 2, with a value range of 0–1). Each region in the point cloud is then rendered in 3D according to the flatness index: good areas, slightly abnormal areas, and severely abnormal areas are displayed using color coding. The flatness region classification results are output, and a visualized 3D model is generated for production line quality control or subsequent analysis.
[0021] In another embodiment, assuming a maximum bulge height of 1.15mm and a maximum dent depth of 0.65mm, a flatness index of 0.81 is calculated. A 3D rendering is generated, showing 60% good areas, 28% slightly abnormal areas, and 12% severely abnormal areas. Color coding visually displays the flatness level of each area, aiding in determining whether rework or adjustments to production process parameters are necessary.
[0022] Of particular importance, step S4, which assesses the flatness of the power battery based on the degree of bulging and abnormal dent areas, includes: Identify severely bulging areas of the battery based on the degree of bulging; merge the severely bulging areas and abnormal dent areas of the battery to determine the boundaries of the abnormal areas; In one embodiment, based on the battery surface point cloud data and the calculated bulge height offset value, bulges exceeding a preset threshold (e.g., ...) are filtered out. The vertices of the marked depression anomaly points are used to form a set of severe bulge points. Then, the neighborhood of the marked set of depression anomaly points and the set of severe bulge points is expanded in 3D space (e.g., with a radius of 5mm). Adjacent or overlapping areas are merged to generate preliminary anomaly regions. For the merged anomaly regions, their outer contour point sequences are extracted, and the boundary curves of the anomaly regions are generated using convex hull or α-shape algorithms. The coordinates of the boundary points and the area of the regions are recorded to provide basic data for subsequent deformation contour analysis.
[0023] In another embodiment, suppose a point cloud on a battery surface contains 1500 vertices, of which approximately 200 vertices have severe bulging and approximately 120 vertices have abnormal dents. After merging the two types of vertices in 3D space with a neighborhood radius of 5mm, a total of approximately 280 abnormal region vertices are obtained. After processing with a convex hull algorithm, a total of 80 boundary points of the abnormal region are obtained, with a maximum boundary length of approximately 42mm, a minimum boundary length of approximately 18mm, and an average region area of approximately 450mm². 2 This boundary clearly marks the overlapping area of bulges and dents, which can be used for subsequent power battery deformation assessment.
[0024] The deformation profile is determined by the boundary of the abnormal region, and the flatness of the power battery is evaluated.
[0025] In one embodiment, the boundary points of the abnormal region are projected onto a reference plane on the battery surface, and continuous contour lines are generated by connecting the boundary points to form the battery deformation contour. Local height deviations are calculated for all vertices within the contour area, including the amount of bulges being too high and dents being too low, and their statistical indices (such as average deviation, maximum deviation, standard deviation, etc.) are calculated to quantify the flatness of the power battery. By visualizing the local deviations as heat maps or surface color maps, the degree of deformation in each region is intuitively displayed, enabling flatness assessment and defect location.
[0026] In another embodiment, assuming the merged abnormal region boundary contains 80 vertices, the resulting profile length after projection onto a reference plane is 40–45 mm. The vertex height deviation within the profile region ranges from -0.35 mm to +0.72 mm, with an average deviation of approximately 0.18 mm and a standard deviation of 0.21 mm. The maximum deviation is 0.72 mm in the bulge concentration area, corresponding to a local area of approximately 12 mm × 10 mm; the maximum deviation in the depression area is -0.35 mm, corresponding to a local area of approximately 8 mm × 7 mm. By mapping the deviation values to a color gradient (red representing bulges and blue representing depressions), a deformation heatmap is obtained, which can provide a quantitative basis for quality control in power battery manufacturing.
[0027] Of particular importance, step S4, which utilizes the flatness of the power battery to convert it into a 3D rendering, includes: The flatness of the power battery is used to determine the surface features of the battery and perform three-dimensional mapping to obtain the three-dimensional coordinates of the battery surface; a three-dimensional mesh region is divided based on the three-dimensional coordinates of the battery surface. In one embodiment, point cloud data of the power battery surface is first acquired (e.g., XYZ coordinates are acquired using a structured light 3D scanner or laser scanner, with a resolution of approximately 0.1 mm). The local height deviation and flatness index of each point are calculated, and points with abnormal flatness or local protrusions / indentations are marked as surface feature points. Subsequently, based on the marked points and the complete point cloud, all feature points are mapped to the three-dimensional space of the battery surface to obtain a complete three-dimensional coordinate set. Based on the three-dimensional coordinate set, a three-dimensional grid is divided in the X, Y, and Z directions according to a preset grid size (e.g., 5 mm × 5 mm × 5 mm). The point cloud data is allocated to the corresponding grid cells to obtain a three-dimensional grid area covering the entire battery surface. Each grid records vertex coordinates, average height, and local flatness values for subsequent three-dimensional rendering and morphological analysis.
[0028] In another embodiment, it is assumed that the collected point cloud of the battery surface contains 2000 vertices, of which approximately 250 are points of unevenness. After mapping all points to the 3D coordinate system of the battery surface, a 40×30 grid is divided in the X and Y directions, and a 10-layer grid is divided in the Z direction according to the height range of the point cloud, resulting in a total of 12,000 grid cells. The average height, maximum height difference, and standard deviation of each grid are calculated. For example, the average height of the grid in a raised area is 0.65 mm, and the standard deviation is 0.12 mm; the average height of the grid in a recessed area is -0.42 mm, and the standard deviation is 0.08 mm. Through this 3D grid division, the spatial location and quantitative analysis of the changes in the flatness of the battery surface can be performed, providing accurate input for 3D rendering.
[0029] Lighting and texture rendering are performed on a 3D mesh area to obtain a 3D rendered image.
[0030] In one embodiment, the 3D mesh region is input into a 3D rendering engine (such as OpenGL, Unity, or a self-developed visualization module), and local normal calculations are applied to each mesh cell to generate a lighting direction vector. Combined with battery surface texture information (such as RGB images or surface reflection characteristics), each mesh cell is rendered using a Phong or Blinn-Phong lighting model to obtain a 3D rendering of the battery surface with clear highlights, shadows, and texture details. Dynamic lighting or multi-angle viewing modes can be selected to intuitively visualize surface protrusions, depressions, and areas with abnormal flatness.
[0031] In another embodiment, it is assumed that the 3D mesh comprises 12,000 cells, with each cell mapping RGB texture information containing an average of 24-bit color channels. During rendering, the light source direction is set to a 45° oblique incidence, and two point light sources are used to simulate ambient light in the workshop. After rendering, a 3D rendering image with a resolution of 1920×1080 is obtained, in which the bulging area is displayed as a red gradient with a maximum height of 0.65mm; the concave area is displayed as a blue gradient with a maximum depth of -0.42mm. The rendering image allows for intuitive differentiation of different deformation areas, enabling visual evaluation and quality inspection of the surface flatness of the power battery.
[0032] Preferably, step S1, which involves acquiring the power battery image and calibration board information, and determining the pixel mapping relationship, includes: Acquire images of the power battery and calibration board information as the raw acquisition dataset; perform camera calibration processing on the raw acquisition dataset, and perform distortion correction on the calibrated raw acquisition dataset to obtain the corrected image dataset; In one embodiment, an industrial camera (1920×1080 resolution) is used to capture images of the power battery surface from multiple angles, while a standard checkerboard calibration board is placed as a calibration reference. The original dataset includes 60 images captured from the front, side, and top surfaces at a frequency of 30Hz. Camera calibration is performed on the original images: the Zhang Zhengyou checkerboard calibration method is used to extract corner coordinates and calculate the camera's intrinsic parameters (focal length, principal point, distortion coefficients) and extrinsic parameters (rotation matrix R and translation vector T). Subsequently, distortion correction is performed on the original dataset. Radial and tangential distortion correction models are used to perform pixel-level correction on the images, generating a corrected image dataset. This ensures that straight lines in the calibrated images remain straight and that pixel mapping accuracy reaches the 0.05mm level, providing high-precision input for subsequent point cloud generation.
[0033] In another embodiment, it is assumed that 80 images of the power battery are acquired, and the calibration plate is 9×7 grids, with each grid having a side length of 25mm. The camera calibration yields the following intrinsic parameters: focal length fx=1220, fy=1200, principal point (u0,v0)=(960,540), radial distortion coefficients k1=0.01, k2=–0.0005, tangential distortion p1=0.0003, p2=–0.0002; extrinsic parameters... , After distortion correction of 80 original images using calibration parameters, 80 corrected images were obtained, with each image having a pixel spacing corresponding to a spatial accuracy of approximately 0.05 mm. This corrected image dataset can be used for subsequent accurate point cloud generation and bulge / depression detection.
[0034] Pixel mapping relationships are established based on the physical coordinates of the calibration image dataset and calibration plate information.
[0035] In one embodiment, for each calibration image, the corner pixel coordinates (u, v) on the calibration board are extracted using a sub-pixel level corner detection algorithm, and the physical coordinates (X, Y, Z=0) corresponding to each corner are recorded in a list, where Z=0 represents the calibration board plane. Then, a projection matrix is constructed using the camera intrinsic parameter K and extrinsic parameter (R, T). Through formula Map the pixel coordinates of each corner point to three-dimensional space coordinates. To cover the entire battery surface, for non-corner pixels, bilinear interpolation or spline interpolation methods are used to generate a complete 2D pixel-to-3D coordinate mapping table. The resulting pixel mapping table can be directly used to generate the battery surface point cloud, providing basic data for subsequent bulge detection and dent analysis.
[0036] In another embodiment, it is assumed that a total of 50 calibration images are acquired, with a resolution of 1920×1080. Each image has 63 corner points on the calibration board (9×7 grids), and the pixel coordinates (u,v) are obtained through a sub-pixel algorithm. Each grid on the calibration board has a side length of 25mm, corresponding to physical coordinates. , The camera intrinsic parameters are assumed to be... External reference , The 3D coordinates of each corner point are calculated using a projection formula, with a spatial accuracy of approximately 0.05 mm. Then, bilinear interpolation is performed on all corner point coordinates to generate a pixel mapping table covering the entire image resolution, containing approximately 600,000 points with a pixel spacing of approximately 0.5 mm. This mapping table can be directly used to generate point clouds of the power battery surface and provides accurate 3D data support for subsequent baseline plane fitting and bulge region identification.
[0037] Preferably, distortion correction is performed on the calibrated original acquired dataset to obtain a corrected image dataset, including: Based on the preset distortion coefficients, the distorted spatial coordinate system of the calibrated original acquired data is converted into an ideal coordinate system; for the non-integer pixel positions generated during the mapping process, their color values are calculated to obtain pixel distribution data. In one embodiment, for the calibrated raw acquired image dataset, the coordinates of each pixel in the image are first converted from the radial and tangential distortion parameters of the camera to an ideal coordinate system position. During the mapping process, for pixels falling at non-integer coordinate positions, their color values are calculated by weighted averaging of their surrounding neighboring pixels, thereby generating complete pixel distribution data. This process ensures that each pixel has accurate spatial position and color information in the ideal coordinate system, providing a reliable foundation for subsequent pixel rearrangement.
[0038] In another embodiment, assuming the original acquired image resolution is 1920×1080 with significant distortion, approximately 35% of the pixels fall into non-integer positions after mapping to the ideal coordinate system. For these non-integer pixels, color interpolation is performed using the weighted average of their four surrounding pixels to form complete pixel distribution data. In the generated data, the average color error in the edge region is approximately 0.8 color units, and the average error in the central region is approximately 0.3 color units, which meets the accuracy requirements for industrial inspection.
[0039] The pixels are rearranged based on the pixel distribution data to obtain rearranged pixel data; the original acquired dataset is then distorted using the rearranged pixel data to obtain the corrected image dataset.
[0040] In one embodiment, based on pixel distribution data, each pixel is rearranged to its corresponding position in an ideal coordinate system, generating complete pixel rearrangement data. This pixel rearrangement data is then applied to the original image to achieve distortion correction, resulting in a corrected image dataset. The corrected image exhibits geometrically accurate edges and central regions, uniform color, and accurately reflects the true geometric shape of the object, providing a reliable data foundation for subsequent detection of bulging or dented power batteries.
[0041] In another embodiment, assuming the image resolution is 1280×720 during pixel rearrangement, the maximum geometric deviation of the rearranged edge region is approximately 0.15 mm, and the average deviation of the center region is approximately 0.08 mm. Through this rearrangement and correction method, the obtained corrected image dataset can completely restore the color and geometric information of the original image. In a test of 10 consecutive images, the maximum edge deviation was 0.18 mm, and the average center deviation was 0.07 mm, fully meeting the industrial-grade accuracy requirements for detecting surface defects in power batteries.
[0042] Preferably, establishing pixel mapping relationships based on the physical coordinates of the calibration image dataset and calibration plate information includes: Two-dimensional pixel coordinates are recorded based on the calibration image dataset; a mapping relationship is established using the two-dimensional pixel coordinates and the physical coordinates of the calibration plate information. In one embodiment, the calibrated image dataset is first processed, recording the two-dimensional pixel coordinates (column and row) corresponding to each calibration point on the image to form a complete list of pixel coordinates. Simultaneously, using the known physical coordinates (in millimeters or meters) on the calibration board, a mapping relationship between the two-dimensional pixel coordinates and the physical coordinates is established. During the mapping process, each pixel coordinate is mapped one-to-one with its corresponding physical coordinate, forming a preliminary mapping matrix to ensure that the spatial position of each calibration point remains consistent with the image pixel position. This mapping relationship can be used for subsequent camera intrinsic and extrinsic parameter calculations, 3D reconstruction, or distortion correction verification.
[0043] In another embodiment, assuming the calibration image resolution is 1920×1080, and the calibration board has 9×6 grid points, totaling 54 physical calibration points. During initial mapping, it was found that 7 pixel coordinates did not match their physical coordinates, including 3 missing pixels and 4 incorrectly mapped pixels. By recording the difference between the position of each pixel in the image and the actual physical position on the calibration board, the positions of the mismatched or missing pixels were estimated using nearest-neighbor interpolation, resulting in a complete pixel coordinate-physical coordinate correspondence table, ensuring that all 54 points are mapped.
[0044] If, during the process of establishing the mapping relationship, it is found that the two-dimensional pixel coordinates do not match the physical coordinates or are missing, the corresponding order of the pixel coordinates and physical coordinates is adjusted and corrected and then remapped.
[0045] In one embodiment, if a mismatch or missing element is found between the two-dimensional pixel coordinates and physical coordinates during the mapping process, the mapping is re-established by adjusting and correcting the correspondence between the pixel coordinates and physical coordinates. Specifically, this involves: first, identifying all pixels with discrepancies; then, re-matching these pixels according to their row and column indices or the nearest physical point; and finally, updating the mapping matrix. After adjustment, the mapping matrix is verified to ensure that each pixel corresponds one-to-one with its physical location. Once the remapping is complete, the pixel coordinates of the entire image dataset accurately reflect the physical spatial location, providing a reliable foundation for subsequent image distortion correction, 3D reconstruction, or precise measurement.
[0046] In another embodiment, it is assumed that in 10 consecutively recorded calibration images, each image has approximately 50 calibration points. During the initial mapping, each image has an average of 5 mismatched or incorrectly positioned pixels. By pairing each mismatched pixel with its nearest neighbor's physical coordinates, adjusting the order, and remapping, all calibration points in each image eventually achieve accurate correspondence. After remapping, the maximum pixel position error across the 10 images is 0.12 mm, and the average error is 0.05 mm, ensuring the spatial consistency of the entire calibration image dataset.
[0047] Preferably, step S2, which involves fitting a reference plane using a point cloud map of the battery surface and calculating the point cloud deviation, includes: Divide the battery surface point cloud map into several equal rectangular grid regions; calculate the three-dimensional coordinate centroid position in each rectangular grid region, find the point cloud vertex with the smallest distance from the three-dimensional coordinate centroid position, and record it as the baseline candidate point set; In one embodiment, the acquired 3D point cloud data of the battery surface is first divided into several equal rectangular grid regions along the XY plane, with each grid measuring 10mm × 10mm. For each rectangular grid region, the arithmetic mean of the 3D coordinates of all point cloud vertices within that region is calculated to obtain the centroid position of that region. Subsequently, the point cloud vertex with the smallest Euclidean distance to the centroid position is found within each grid region, and these points are selected as the baseline candidate point set for that grid region. This operation ensures that the candidate points are uniformly distributed across the entire battery surface, providing an initial reference for subsequent plane fitting.
[0048] In another embodiment, assuming the acquired battery surface point cloud contains approximately 50,000 vertices, it is divided into 20×15 rectangular grid regions (300 grids in total), with each grid having a side length of approximately 8 mm. The centroid of each grid region is calculated, and the point closest to the centroid is found, resulting in an initial set of 300 baseline candidate points. The average distance from each candidate point to its centroid is approximately 0.6 mm, ensuring that the candidate points are evenly distributed and closely approximate the true contour of the battery surface.
[0049] The initial planar frame is determined by the first three non-collinear point cloud vertices in the reference candidate point set, and the remaining point cloud vertices in the reference candidate point set are projected onto the initial planar frame one by one, and the vertical deviation value is recorded. In one embodiment, the first three non-collinear point cloud vertices are selected from the baseline candidate point set as the vertices of the initial planar frame to construct the initial planar model. Subsequently, the remaining point cloud vertices in the baseline candidate point set are projected one by one onto this initial plane, and the vertical deviation value from the plane to each vertex is calculated. The vertical deviation can be calculated through vector dot product or geometric projection, and the deviation data for each vertex is recorded to form an initial deviation matrix. This step is used to evaluate the fit between the initial planar frame and the actual point cloud surface, providing a basis for iterative optimization.
[0050] In another embodiment, assuming points P1, P2, and P3 are selected from the set of reference candidate points as the initial planar frame, the planar equation is constructed. Project the remaining 297 points one by one and calculate the vertical deviation. The deviation ranges from -1.2mm to 1.5mm, with an average deviation of approximately 0.42mm. Record the vertical deviation of each point for use in the next iteration to adjust the plane.
[0051] The initial planar frame is iteratively adjusted based on the vertical deviation value. The projection is repeated and the vertical deviation value is calculated until the deviation converges to obtain the reference plane, and the point cloud deviation is calculated.
[0052] In one embodiment, the initial planar frame is iteratively adjusted using the initial vertical deviation value. Specifically, the correction amount for the planar parameters is first calculated based on the deviations at all points. The plane equations are updated; then, the candidate points are projected onto the updated plane one by one, and the vertical deviation values are recalculated. This projection and plane parameter update process is repeated until the change in vertical deviation of all candidate points is less than a preset convergence threshold ε (e.g., 0.01 mm). After convergence, the final plane is determined as the reference plane for the battery surface, and the final deviation value for each point cloud vertex is calculated for subsequent plane quality analysis, surface flatness assessment, or defect detection.
[0053] In another embodiment, it is assumed that the iteration process is set to a maximum of 30 times, with each iteration correcting the plane parameters. The initial maximum variations were approximately 0.05, 0.04, and 0.03. After 15 iterations, the vertical deviation variation at all points was less than 0.01 mm, and the final equation of the reference plane was... The final deviation ranged from -0.85mm to 1.1mm, with an average deviation of 0.38mm. The deviation heatmap visually displays the distribution of battery surface flatness, with slightly larger deviations in the edge areas and higher flatness in the central area, providing a quantitative reference for subsequent point cloud quality control and bulge detection.
[0054] Preferably, determining the initial planar frame using the first three non-collinear point cloud vertices in the baseline candidate point set includes: Read the first point cloud vertex from the baseline candidate point set as the reference point; read the remaining point cloud vertices in sequence, determine whether they are collinear with the reference point, and obtain the first three non-collinear point cloud vertices. In one embodiment, the first point cloud vertex is read from the baseline candidate point set as a reference point. Subsequently, the remaining points in the candidate point set are read sequentially. Each time a new point is read, it is determined whether it is collinear with the first two selected points. This determination is made by analyzing the spatial relative positions of the points, ensuring that the three points are not on the same straight line. Once a third non-collinear point is found, the reading operation stops. This operation ensures that the initial plane does not degenerate, providing a stable reference for subsequent plane construction, while also ensuring that the plane covers the entire point cloud region.
[0055] In another embodiment, assuming the baseline candidate point set contains 300 points, the first three non-collinear points selected after point-by-point inspection are located at the upper left, upper right and lower left corners of the point cloud, respectively. The spatial straight-line distances between the three points are 8mm, 11mm and 13mm, respectively, forming a stable triangular region covering the entire point cloud, providing a spatial reference for the subsequent construction of the planar frame.
[0056] The initial planar frame is determined using the first three non-collinear point cloud vertices.
[0057] In one embodiment, the three points selected in step S1 are used to determine an initial planar frame in three-dimensional space. The construction of this planar frame includes determining the plane normal direction and reference position, which can serve as a reference for projecting the remaining point cloud vertices onto the plane, while providing a stable reference for subsequent deviation calculation and iterative optimization.
[0058] In another embodiment, assuming the three points are located at the upper left, upper right, and lower edges of the candidate point cloud surface, respectively, an initial plane is constructed that is approximately parallel to the overall surface of the point cloud, covering the entire candidate point region. This plane serves as an initial framework, allowing the remaining points to be projected onto the plane point by point for vertical deviation measurement, which is used to analyze the surface inhomogeneity of the point cloud and subsequent plane optimization.
[0059] Preferably, step S2, marking the battery bulge area based on point cloud deviation, includes: Vertices with point cloud deviations greater than a preset deviation threshold are marked as potential bulge points; all potential bulge points are clustered and a potential bulge point set is recorded; for a potential bulge point set, the sum of the coordinate values of all vertices in the x, y, and z directions is calculated, and then divided by the total number of points in the potential bulge point set to determine the center point of the potential bulge. In one embodiment, the collected battery surface point cloud data is analyzed point by point, and the local plane fitting deviation between each vertex and its adjacent vertices is calculated. If the vertex deviation is greater than a preset deviation threshold (e.g., 0.8 mm), the vertex is marked as a potential bulge point. Subsequently, all potential bulge points are clustered using a clustering method based on Euclidean distance, grouping spatially close potential bulge points into the same cluster, and recording the point coordinate information of the point set within each cluster to obtain a set of potential bulge points.
[0060] For each potential bulge point set, computation is performed in three spatial dimensions. The sum of all vertex coordinates, divided by the total number of points in the point cloud, yields the coordinates of the cluster's center point, i.e., the potential bulge center point. This center point represents the spatial location of the bulge in the cluster and serves as a reference for subsequent region labeling. In this way, anomalous protrusions in the point cloud can be quickly extracted as candidate bulge locations, providing a foundation for accurate detection and subsequent analysis.
[0061] In another embodiment, assuming the acquired battery point cloud contains 50,000 vertices, approximately 350 potential bulge points are selected using a deviation threshold of 0.9 mm. After clustering, four potential bulge point sets are obtained: cluster 1 (90 points), cluster 2 (80 points), cluster 3 (95 points), and cluster 4 (85 points). The center points of the four potential bulges are obtained by averaging their coordinates, with the following coordinates: , , , These center points provide precise spatial references for subsequent area delineation.
[0062] Mark the battery bulge area using the center point of the potential bulge.
[0063] In one embodiment, the potential bulge center point is visualized and marked in the point cloud, and a battery bulge region is formed by extending outward from the center point by a certain radius (e.g., 10 mm). All points within the region are marked as bulge region points, which can be used for subsequent size measurement, bulge volume calculation, or health status assessment. Simultaneously, different clusters of bulge regions can be assigned different colors to visually distinguish the locations of each bulge in 3D visualization.
[0064] In another embodiment, the expansion radii corresponding to the four potential bulge center points are assumed to be: cluster 1 = 12mm, cluster 2 = 10mm, cluster 3 = 15mm, and cluster 4 = 11mm, respectively. Based on these radii, all point cloud vertices surrounding the center points are marked as bulge regions, covering a total of: cluster 1 = 210 points, cluster 2 = 180 points, cluster 3 = 230 points, and cluster 4 = 190 points, respectively. In this way, four clearly defined battery bulge regions are formed, providing a spatial information basis for subsequent bulge analysis, volume calculation, and thermal characteristic research.
[0065] Preferably, marking the battery bulge area using the potential bulge center point includes: The potential bump area is obtained by extending a preset radius outward from the center point of the potential bump; within the potential bump area, isolated points with abnormal mutations are removed to determine the main texture direction; In one embodiment, the potential bulge center points are first utilized, and each center point is extended outward by a certain radius to form a potential bulge region. For example, a preset region radius of 10mm can be set, and all vertices within the radius in the 3D point cloud are selected with the center point as the center to form a preliminary potential bulge region. Subsequently, local topological analysis is performed on the point cloud within this region to remove isolated points and anomalous abrupt changes. These points typically deviate from the average position of their neighborhood by more than 2 standard deviations and can be removed using distance thresholds or local density methods, thereby ensuring the continuity of the regional point cloud.
[0066] After obtaining continuous potential bulge regions, the principal texture direction of the local point cloud is calculated. Specifically, PCA analysis is performed on the region point cloud to extract the principal direction vector. The eigenvector corresponding to the largest eigenvalue is the principal texture direction, representing the extension direction of the bulge on the battery surface. This principal texture direction will serve as the reference direction for subsequent bulge region selection and aggregation.
[0067] In another embodiment, assuming four potential bulge center points are detected, with coordinates as follows: , , , If the preset radius of the affected area is set to 12mm, then the number of points contained in the potential bulge area formed by each center point is as follows: After removing isolated points (such as those deviating from the average position of their neighborhood by more than 2.5 mm), the remaining valid points are as follows: PCA analysis was performed on each region, yielding the principal texture direction vectors as follows: , .
[0068] Along the main texture direction, point cloud vertices with vertical deviations greater than the vertical threshold are selected and aggregated sequentially to form the battery bulge region.
[0069] In one embodiment, the point cloud within the potential bulge region is scanned point by point along the main texture direction. For each point, its vertical deviation relative to the main texture direction is calculated. If the deviation is greater than a preset vertical threshold (e.g., 0.5 mm), the point is marked as a bulge candidate. Subsequently, adjacent bulge candidate points are aggregated according to their spatial neighborhood, using the main texture direction as a reference, to form a complete battery bulge region. This aggregation process can employ density clustering or neighborhood connectivity analysis methods to ensure that the formed bulge region is continuous and covers the main structure of the bulge protrusion. The final output bulge region can be used for volume calculation, shape analysis, or thermal characteristic simulation.
[0070] In another embodiment, assuming that after obtaining valid points from four potential bump regions, they are scanned along the main texture direction, with a vertical deviation threshold set to 0.6 mm. The number of candidate bump points obtained after filtering are as follows: Neighboring candidate points are aggregated along the main texture direction (spatial neighborhood radius set to 5mm) to form the battery bulge region: cluster 1 covers 180 points, cluster 2 covers 165 points, cluster 3 covers 190 points, and cluster 4 covers 175 points. In this way, the generated bulge region continuously covers the raised surface, and the region boundary can be displayed in three dimensions, facilitating subsequent bulge quantitative analysis and safety assessment.
[0071] Preferably, determining the main texture direction includes: Taking any vertex in the potential bulge region as the center, extract the point cloud set of that vertex within a preset domain and record the coordinates of the domain points; calculate the curvature change based on the domain point coordinates; In one embodiment, for each vertex within a potential bulge region, a neighborhood radius of 5 mm is defined. A set of point clouds (approximately 20-30 neighboring points) is extracted from the vertex's neighborhood. The three-dimensional covariance matrix of each neighborhood is calculated, and the eigenvalues are determined. ,use The curvature variation is used to reflect the degree of local convexity. The curvature variation of each vertex is recorded, and a local curvature distribution map is generated to provide basic data for subsequent analysis of significant extension directions.
[0072] In another embodiment, assuming the potential bulge region contains 600 vertices, a neighborhood radius of 5 mm, and each vertex has 22-25 neighboring points, the curvature variation is calculated. The range is from 0.015 to 0.090, with an average of approximately 0.052. Record the three-dimensional coordinates of each vertex, for example, the coordinates of vertex 1 are (12.3, 8.5, 0.6) mm, vertex 2 are (12.5, 8.7, 0.61) mm, ... vertex 600 are (15.2, 10.1, 0.65) mm.
[0073] Based on the curvature change degree, the direction of the maximum curvature change is identified, and the significant extension direction within the preset range is determined; all significant extension directions are weighted and statistically analyzed to determine the main texture direction.
[0074] In one embodiment, for each vertex and its curvature variation extracted in step S1, a weighted average vector of neighboring points along each direction is calculated. The direction with the largest curvature variation is the significant extension direction of that vertex. Subsequently, the significant extension direction vectors of all vertices within the potential bulge region are subjected to weighted statistics or principal component analysis to obtain the main texture direction vector of the entire potential bulge region, providing a reference for subsequent aggregation of vertices along this direction and determination of the bulge region morphology.
[0075] In another embodiment, assume that the significant extension directions of the 600 vertices are respectively The corresponding curvature variation κ are 0.050, 0.054, 0.048…0.051, respectively. The main texture direction vector is obtained through weighted statistics. This reflects the trend of potential bulges along the main extension direction on the battery surface, providing a benchmark for subsequent bulge region identification and vertex aggregation.
[0076] Preferably, step S3, which involves marking surface depressions based on the battery surface point cloud map, includes: The spatial offset value of each vertex is calculated based on the point cloud map of the battery surface; vertices with negative spatial offset values that exceed the preset lower threshold are initially marked as suspected depression points. In one embodiment, spatial registration is performed on the point cloud on the battery surface to obtain the height value of each vertex on the reference plane. And calculate its spatial offset value. ,in This represents the height of the fitted plane in the local neighborhood of the vertex. For all vertices, filter out... The vertices are initially marked as potential depressions. The 3D coordinates and offset values of each potential depression are recorded, and a set of potential depressions is generated to provide basic data for subsequent neighborhood height analysis.
[0077] In another embodiment, assuming the point cloud on the battery surface contains 1200 vertices, the spatial offset value is calculated. The range is from -0.65mm to 0.12mm, with approximately 180 vertices... These are initially marked as suspected depressions. For example, the coordinates of vertex 1 are... , The coordinates of vertex 2 are , The coordinates of vertex 180 are , Record this vertex information for subsequent precise concavity confirmation.
[0078] Within the neighborhood of each suspected depression, the average height is calculated and compared with the height of the suspected depression. If the height of the suspected depression is 0.3-0.5 mm lower than the average height, the surface depression is marked.
[0079] In one embodiment, for the initially screened suspected depression points, neighboring vertices are extracted within a 5mm radius around each point, and the average neighborhood height is calculated. The height of the suspected indentation point. and In comparison, if If a point is identified as a surface depression, it is marked as such. The three-dimensional coordinates, offset, and average height of the neighborhood are recorded for each confirmed depression point, used to create a depression heatmap or for further quantitative analysis.
[0080] In another embodiment, we assume the average height of the neighborhood of 180 initially suspected depressions. The range is 0.48–0.55 mm, corresponding to the height of the respective points. Comparison. Calculations show that 112 vertices satisfy... These are marked as surface depressions. For example, vertex 1. Marked as a depression; vertex 2 Marked as a depression; vertex 112 These are marked as depressions. By statistically analyzing each depression point and its offset, a heat map of the depression area can be generated for subsequent comprehensive analysis of bulges and depressions.
[0081] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.
[0082] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A method for detecting the flatness of a power battery based on image recognition, characterized in that, Includes the following steps: Step S1: Acquire the image of the power battery and the calibration board information, and determine the pixel mapping relationship; Generate a point cloud map of the battery surface using pixel mapping relationships; Step S2: Fit a reference plane using the battery surface point cloud map and calculate the point cloud deviation; mark the battery bulging area based on the point cloud deviation; calculate the height deviation of the battery bulging area to determine the degree of bulging; Step S3: Mark surface depression points based on the battery surface point cloud map and calculate the depression depth of the surface depression points; when the depression depth is greater than the depression threshold, mark it as a depression anomaly area; Step S4: Assess the flatness of the power battery based on the degree of bulging and abnormal dent areas; convert the flatness of the power battery into a 3D rendering and output the grading results of the flat areas.
2. The image recognition-based method for detecting the flatness of a power battery according to claim 1, characterized in that, Step S1 involves acquiring the power battery image and calibration board information, and determining the pixel mapping relationship, including: Acquire images of the power battery and calibration board information as the raw acquisition dataset; perform camera calibration processing on the raw acquisition dataset, and perform distortion correction on the calibrated raw acquisition dataset to obtain the corrected image dataset; Pixel mapping relationships are established based on the physical coordinates of the calibration image dataset and calibration plate information.
3. The image recognition-based method for detecting the flatness of a power battery according to claim 2, characterized in that, Distortion correction is performed on the calibrated original acquired dataset to obtain the corrected image dataset, which includes: Based on the preset distortion coefficients, the distorted spatial coordinate system of the calibrated original acquired data is converted into an ideal coordinate system; for the non-integer pixel positions generated during the mapping process, their color values are calculated to obtain pixel distribution data. The pixels are rearranged based on the pixel distribution data to obtain rearranged pixel data; the original acquired dataset is then distorted using the rearranged pixel data to obtain the corrected image dataset.
4. The image recognition-based method for detecting the flatness of a power battery according to claim 2, characterized in that, Establishing pixel mapping relationships based on the physical coordinates of the calibration image dataset and calibration plate information includes: Two-dimensional pixel coordinates are recorded based on the calibration image dataset; a mapping relationship is established using the two-dimensional pixel coordinates and the physical coordinates of the calibration plate information. If, during the process of establishing the mapping relationship, it is found that the two-dimensional pixel coordinates do not match the physical coordinates or are missing, the corresponding order of the pixel coordinates and physical coordinates is adjusted and corrected and then remapped.
5. The image recognition-based method for detecting the flatness of a power battery according to claim 1, characterized in that, Step S2 involves fitting a reference plane using the battery surface point cloud map and calculating the point cloud deviation, including: Divide the battery surface point cloud map into several equal rectangular grid regions; calculate the three-dimensional coordinate centroid position in each rectangular grid region, find the point cloud vertex with the smallest distance from the three-dimensional coordinate centroid position, and record it as the baseline candidate point set; The initial planar frame is determined by the first three non-collinear point cloud vertices in the reference candidate point set, and the remaining point cloud vertices in the reference candidate point set are projected onto the initial planar frame one by one, and the vertical deviation value is recorded. The initial planar frame is iteratively adjusted based on the vertical deviation value. The projection is repeated and the vertical deviation value is calculated until the deviation converges to obtain the reference plane, and the point cloud deviation is calculated.
6. The image recognition-based method for detecting the flatness of a power battery according to claim 5, characterized in that, Determining the initial planar frame using the first three non-collinear point cloud vertices in the baseline candidate point set includes: Read the first point cloud vertex from the baseline candidate point set as the reference point; read the remaining point cloud vertices in sequence, determine whether they are collinear with the reference point, and obtain the first three non-collinear point cloud vertices. The initial planar frame is determined using the first three non-collinear point cloud vertices.
7. The image recognition-based method for detecting the flatness of a power battery according to claim 1, characterized in that, Step S2, which involves marking the battery bulge area based on point cloud deviation, includes: Vertices with point cloud deviations greater than a preset deviation threshold are marked as potential bulge points; all potential bulge points are clustered and a potential bulge point set is recorded; for a potential bulge point set, the sum of the coordinate values of all vertices in the x, y, and z directions is calculated, and then divided by the total number of points in the potential bulge point set to determine the center point of the potential bulge. Mark the battery bulge area using the center point of the potential bulge.
8. The image recognition-based method for detecting the flatness of a power battery according to claim 7, characterized in that, Marking the battery bulge area using the potential bulge center point includes: The potential bump area is obtained by extending a preset radius outward from the center point of the potential bump; within the potential bump area, isolated points with abnormal mutations are removed to determine the main texture direction; Along the main texture direction, point cloud vertices with vertical deviations greater than the vertical threshold are selected and aggregated sequentially to form the battery bulge region.
9. The image recognition-based method for detecting the flatness of a power battery according to claim 8, characterized in that, Determining the main texture direction includes: Taking any vertex in the potential bulge region as the center, extract the point cloud set of that vertex within a preset domain and record the coordinates of the domain points; calculate the curvature change based on the domain point coordinates; Based on the curvature change degree, the direction of the maximum curvature change is identified, and the significant extension direction within the preset range is determined; all significant extension directions are weighted and statistically analyzed to determine the main texture direction.
10. The image recognition-based method for detecting the flatness of a power battery according to claim 1, characterized in that, Step S3, which involves marking surface depressions based on the battery surface point cloud map, includes: The spatial offset value of each vertex is calculated based on the point cloud map of the battery surface; vertices with negative spatial offset values that exceed the preset lower threshold are initially marked as suspected depression points. Within the neighborhood of each suspected depression, the average height is calculated and compared with the height of the suspected depression. If the height of the suspected depression is 0.3-0.5 mm lower than the average height, the surface depression is marked.
Citation Information
Cited By
Thickness detection method for detecting qualification rate of woven valve bag
CN121953842A