Dry battery negative cover flaw detection and identification method based on image processing

By using image processing technology to detect and identify defects in the negative electrode cover of the battery, the problems of low efficiency, high cost and insufficient accuracy in the existing technology have been solved, and efficient and accurate defect identification and low-cost battery production have been achieved.

CN117314843BActive Publication Date: 2026-05-08NANJING UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF SCI & TECH
Filing Date
2023-09-14
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In current battery production, manual visual inspection is inefficient and costly, while image processing-based inspection requires a large number of samples for training and has high hardware requirements. Deep learning-based inspection cannot handle out-of-sample defect features, resulting in insufficient accuracy and efficiency in battery defect detection.

Method used

An image processing-based approach is employed, which involves camera calibration and image correction, image preprocessing, battery image localization, region segmentation, and image enhancement, combined with median filtering, Otsu threshold segmentation, mask segmentation, seed filling algorithm, and convolutional kernel detection, to identify defects in the battery negative electrode cover.

Benefits of technology

It achieves efficient and accurate battery defect detection, capable of identifying typical defects such as pits, leaks and scratches, and can also detect inconspicuous defects. It has low hardware cost and is suitable for large-scale battery production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117314843B_ABST
    Figure CN117314843B_ABST
Patent Text Reader

Abstract

The application discloses a dry battery negative cover flaw detection and identification method based on image processing, which comprises the following steps: calibrating and correcting an image of a camera; taking an image of a battery by using the camera, and adopting a median filter to pretreat an initial image to be positioned; processing the pretreated image to realize positioning of the battery image; segmenting a battery area into three parts of an inner circle, an inner ring and an outer ring; performing image enhancement on the segmented images of the parts; and performing flaw detection and identification on the image-enhanced images. The application can extract features of a negative surface of the battery and effectively identify typical flaws, which are classified into three categories of pits, liquid leakage and scratches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing in computer vision, specifically a method for detecting and recognizing defects in the negative electrode cap of a dry cell battery based on image processing. Background Technology

[0002] In the battery manufacturing process, defect detection is essential to ensure product quality. Surface defects not only detract from the battery's aesthetics but can also severely impair its performance. A lack of an effective defect detection system can lead to incorrect battery quality ratings; furthermore, undetected defects and subsequent battery quality issues can potentially cause safety accidents. With rising living standards, consumers are increasingly focused on the appearance and quality of products, making the production of high-quality, highly reliable products an inevitable trend. Currently, there are three main defect detection methods for batteries: manual visual inspection, image processing-based detection, and deep learning-based detection.

[0003] Traditionally, battery production lines rely on manual visual inspection for the quality testing and classification of sealed batteries. However, manual visual inspection has several drawbacks: high labor intensity, poor inspection stability and consistency, low automation and low production efficiency, difficulty in achieving lean production, high labor costs, and challenges in recruiting, employing, and training workers. Therefore, image processing-based inspection and deep learning-based inspection are gradually replacing manual visual inspection.

[0004] Image processing-based detection, through manual feature extraction and image processing, can efficiently and reliably detect battery defects such as pits, leaks, scratches, contamination or foreign matter, oxidation or corrosion, and poor welding. Image processing has advantages such as maturity, stability, interpretability, high computational efficiency, and simple engineering implementation, meeting real-time requirements and adapting well to various complex working environments.

[0005] Deep learning-based detection primarily utilizes neural networks. It extracts features from the detected object using multiple convolutional layers, normalization layers, and activation function layers, and identifies and distinguishes defects using fully connected layers. Unlike image processing-based detection, deep learning-based detection does not require manual extraction of defect features; it can automatically learn the features of the detected object. However, its drawback is that it can only learn features from the training samples and cannot handle defect features outside the samples. Furthermore, deep learning-based detection requires a large number of samples for training and demands high-end hardware. Manual annotation is time-consuming and expensive, and inaccurate annotation can negatively impact training. Summary of the Invention

[0006] This invention proposes a method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing.

[0007] The technical solution to achieve the purpose of this invention is: a method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing, the specific steps of which are as follows:

[0008] Step 1: Calibrate and correct the camera image;

[0009] Step 2: Use a camera to capture images of the battery, and use median filtering to preprocess the initial images for battery location.

[0010] Step 3: Process the preprocessed image to locate the battery image;

[0011] Step 4: Divide the battery area into three parts: inner circle, inner ring, and outer ring;

[0012] Step 5: Perform image enhancement on each segmented part of the image;

[0013] Step 6: Perform defect detection and recognition on the enhanced image.

[0014] Preferably, the specific method for calibrating and correcting the camera is as follows:

[0015] Take several images of the ceramic calibration plate from different angles;

[0016] The Harris corner detection algorithm is used to obtain the position of the corner of the ceramic calibration plate, and the initial integer corner coordinates are optimized by sub-pixel precision to obtain the precise position coordinates of all corners. At the same time, the camera's internal parameters and distortion parameters are calculated.

[0017] Use fixed-point iteration in OpenCV to correct distortion and restore the distorted image to the correct position.

[0018] Preferably, the specific method for processing the preprocessed image to locate the battery image is as follows:

[0019] The preprocessed image is segmented into a binary image using Otsu thresholding, where the battery is represented by a segmented white circle and the background is black.

[0020] The binarized image is projected horizontally and vertically, and the intersection of the lines where the white pixel peaks are at their maximum in the horizontal and vertical directions is taken as the battery center.

[0021] Preferably, the binarized image is projected horizontally and vertically respectively, and the formula for calculating the pixel peak value is as follows:

[0022]

[0023]

[0024] Where Vp(j) represents the peak value of the vertical projection pixel in the j-th column of the binarized image, Hp(i) represents the peak value of the horizontal projection pixel in the i-th row of the binarized image, b(i,j) represents the pixel value after binarization, and W and H are the width and height of the original image, respectively.

[0025] Preferably, the specific method for dividing the battery region is as follows:

[0026] Using a mask, the system divides the area into three regions: an inner circle, an inner ring, and an outer ring, based on the radius. The formulas for dividing the inner circle, inner ring, and outer ring are as follows:

[0027]

[0028]

[0029]

[0030] Wherein, inside_circle, inside_ring, and outside_ring are the inner circle, inner ring, and outer ring, respectively; w and h are the width and height of the battery image after removing the useless background, respectively; r1 and r2 are the inner and outer diameters of the inner ring, respectively; r is the radius of the battery, which is also the outer diameter of the outer ring; * is the matrix element multiplication symbol; mask(i,j,r) is the mask for the coordinates p(i,j) of any pixel point in the binarized image; and inverse_mask(i,j,r) is the inverted mask.

[0031] Preferably, the mask formula is as follows:

[0032]

[0033]

[0034] Where r is the radius of the mask region, and d(c,p(i,j)) is the Euclidean distance from the center of the battery to the pixel point p(i,j). If it is less than or equal to the radius, then p(i,j) belongs to the mask and should be retained; otherwise, it should be discarded.

[0035] Preferably, the method for identifying inner circular pits, oil stains, and scratches is as follows:

[0036] The seed filling algorithm is used to detect the connected regions of the inner circle binarized image. Points with the same pixel value in the eight-neighborhood of each pixel in the image are divided into the same connected region and marked with the same label value.

[0037] Select the second largest connected region for threshold judgment. If its area is greater than the specified pit area threshold, it is a pit or oil stain. If its area is greater than the specified scratch area and its aspect ratio exceeds the specified threshold, it is a scratch.

[0038] Preferably, the method for identifying defects in the inner and outer rings is as follows:

[0039] Extract the binary image of the inner ring, draw two parallel lines from the center of the circle, and make the distance between the two parallel lines slightly greater than the distance between the keyholes. Project the image around the center of the circle and determine the area with the smallest pixel peak as the keyhole area, and exclude the keyhole area.

[0040] The following two methods are used to determine whether the inner and outer rings are defective. If either one is defective, it is considered defective:

[0041] Straighten the inner and outer rings of the binary image into a rectangular band, calculate the variance of each row of pixels in the rectangular band, and if the variance is greater than a certain threshold, it is judged to be defective.

[0042] The grayscale images of the inner and outer rings are straightened into rectangular bands. The average gradient of each row of pixels is calculated using a convolution kernel. If the average gradient exceeds a specified threshold, it is judged to be defective.

[0043] Compared with existing technologies, the significant advantages of this invention are: from imaging to image preprocessing, and then to defect detection and identification, this invention achieves high accuracy, low hardware cost, and high processing speed, enabling large-scale battery production. This invention can extract features from the negative electrode surface of the battery and effectively identify typical defects, categorized into pits, leaks, and scratches; simultaneously, it can also detect and identify subtle defects that current battery detection solutions have failed to detect or identify.

[0044] The present invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description

[0045] Figure 1 This is a flowchart of the present invention.

[0046] Figure 2 A schematic diagram of the three regions segmented from the battery image.

[0047] Figure 3 Image for locating the center of the battery.

[0048] Figure 4 A schematic diagram for finding the radius of a ray. Detailed Implementation

[0049] A method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing includes accurately locating and segmenting the image of the negative electrode cap from images captured on the production line. The main steps are camera calibration and image correction, image preprocessing, battery image localization, and then separating the three areas of the battery where defects may occur: the inner circle, the inner ring, and the outer ring. Figure 2The identification process is as follows. Image processing techniques are used to detect and identify the battery's negative electrode cover in the segmented image. The specific steps are as follows:

[0050] Step 1: Calibrate and correct the camera image;

[0051] In a further embodiment, the camera images a reference object, and the camera's intrinsic and extrinsic parameters are calculated using digital image processing methods and subsequent spatial arithmetic operations. In some embodiments, a ceramic calibration plate is selected as the reference object.

[0052] In a further embodiment, the specific steps for calibrating and correcting the camera image are as follows:

[0053] First, take multiple images of the ceramic calibration plate from different angles to ensure that the calibration plate is complete and has clear edges.

[0054] Then, the Harris corner detection algorithm is used to obtain the position of the corner of the ceramic calibration plate, and the initial integer corner coordinates are optimized for sub-pixel precision to finally obtain the precise position coordinates of all corners. At the same time, the camera's internal parameters and distortion parameters are calculated.

[0055] Finally, by using fixed-point iterative distortion removal in OpenCV, the distorted image can be corrected to the correct position.

[0056] Step 2: Capture battery images using a camera. Preprocess the initial image for battery location using median filtering to eliminate noise interference and preserve edge features. The median filtering formula is as follows:

[0057] g(x,y)=Median{f(i,j),(i,j∈W)}#(6-1)

[0058] Where g(x,y) is the processed pixel value, f(i,j) is the grayscale value of the pixel before processing, and W is the median filter template with a size of 3×3.

[0059] Step 3: Locate the battery image;

[0060] To address the issue of uncertain battery placement within the camera frame, circular Hough transform or template matching methods are commonly used for battery positioning. However, on battery production lines, traditional methods may not meet time efficiency requirements due to factors such as turntable rotation speed and camera latency. Based on observations of numerous battery samples, the following characteristics were found in the battery images: (1) Despite external forces, the battery images are generally presented within a defined area; (2) The brightness of the battery in the image is significantly higher than that of the turntable because the battery's reflectivity is higher than that of the turntable; (3) The battery images are roughly circular.

[0061] This invention processes images to locate the battery; the specific method is as follows:

[0062] The preprocessed image was segmented into a binary image using OTSU thresholding, where the battery is represented by a segmented white circle and the background is black.

[0063] The battery image is extracted from the binarized image. Since the battery image is almost a circle, horizontal and vertical projections of its binarized image will produce a distinct peak at the center of the circle. The intersection of the lines containing the maximum white pixel peaks in the horizontal and vertical directions is the center of the circle, which is the center of the battery. Figure 3 As shown. This method is simpler and more intuitive than Hough transform and template matching, and is suitable for circular objects with obvious symmetry. Furthermore, this method is simple to implement and requires no extensive computation or parameter adjustments. The binarized image is projected horizontally and vertically, and the formula for calculating the pixel peak value is as follows:

[0064]

[0065]

[0066] Where Vp(j) represents the peak value of the vertical projection pixel in the j-th column of the binarized image, Hp(i) represents the peak value of the horizontal projection pixel in the i-th row of the binarized image, b(i,j) represents the pixel value after binarization, and W and H are the width and height of the original image, respectively.

[0067] Then, after determining the center position of the battery in the image, it is necessary to calculate the radius of the battery's circumcircle to facilitate separation of the battery from the background. This invention uses a statistical voting method to find the maximum possible length of the radius. Specifically, 512 rays are emitted from both sides of the image, the step regions of these rays are located, and their distances to the battery center are calculated. Statistical analysis of these distances yields the radius of the battery's circumcircle. Figure 4 As shown. If the calculated radius does not meet the specified error, the battery is considered unqualified and will not proceed to subsequent defect detection and identification.

[0068] Finally, based on the center coordinates and radius of the battery, a square mask is generated to separate the battery from most of the useless background. Pixels inside the mask are retained, while pixels outside the mask are discarded, resulting in a square battery image with the smallest inscribed circle. This image is then used for region segmentation and related detection algorithms.

[0069] Step 4: Divide the battery area;

[0070] Because the battery has its own characteristics in the inner circle, inner ring, and outer ring, and defects have corresponding distribution patterns in these three areas, the battery image is segmented into three parts—inner circle, inner ring, and outer ring—to improve recognition accuracy. These three parts are then detected and identified separately. Since the battery production conforms to certain specifications, the positions of the inner circle, inner ring, and outer ring relative to the battery center are basically fixed; that is, their radii relative to the battery center are basically fixed. A mask is used to segment the inner circle, inner ring, and outer ring based on their radii. The mask formula is as follows:

[0071]

[0072]

[0073] Here, mask(i,j,r) is the mask at coordinate p(i,j), r is the radius of the mask region, and d(c,p(i,j)) is the Euclidean distance from the center of the battery to the pixel p(i,j). If it is less than or equal to the radius, p(i,j) belongs to the mask and should be retained; otherwise, it should be discarded. inverse_mask(i,j,r) is the inverse mask, which performs the opposite function of the mask. If it is greater than the radius, p(i,j) belongs to the inverse_mask; otherwise, it should be discarded.

[0074] The formulas for dividing the inner circle, inner ring, and outer ring are as follows:

[0075]

[0076]

[0077]

[0078] In this diagram, `inside_circle`, `inside_ring`, and `outside_ring` represent the inner circle, inner ring, and outer ring, respectively. `w` and `h` represent the width and height of the battery image after removing the background. Each pixel in the image is traversed. `r1` and `r2` represent the inner and outer diameters of the inner ring, respectively. `r` is the radius of the battery, which is also the outer diameter of the outer ring. `*` represents the matrix element multiplication symbol. Thus, the images of the inner circle, inner ring, and outer ring can be segmented for subsequent detection and recognition.

[0079] Step 5: Perform image enhancement on each segmented image. Use Fourier high-pass filtering to preserve edge features and suppress texture features, thereby making the edge features clearer and more prominent, which is convenient for subsequent detection and recognition.

[0080] Step 6: Perform defect detection and recognition on the enhanced image.

[0081] For the inner circle of the battery negative terminal cover, the most common defects are pits, oil stains, and scratches. Therefore, the inner circle image is converted into a binary image using the Otsu thresholding algorithm. If there are no pits, oil stains, or scratches inside the battery's inner circle, it should be a pure white image. Otherwise, at least areas with black pixels will appear. However, black pixels may also appear after imaging or image enhancement using the Otsu thresholding algorithm. Therefore, a certain threshold must be exceeded to be identified as pits, oil stains, or scratches. This invention uses a seed filling algorithm to detect connected regions, expanding the pixels around a specific seed point in the image into a connected region and marking it with the same label value. The white background is always the largest connected region, so the second largest connected region is selected for threshold judgment. If its area is greater than a specified pit area threshold, it is a pit or oil stain. If its area is greater than a specified scratch area and its aspect ratio exceeds a specified threshold, it is a scratch.

[0082] The inner and outer rings of a battery typically have minor imperfections, with a few exhibiting pits and oil stains. A qualified battery should have a uniform surface texture. Therefore, the uniformity of pixels along the same circumference in the images of the inner and outer rings is used to determine the presence of defects, employing both binary and grayscale images. The detection method for the inner and outer rings is consistent, but the inner ring contains a keyhole. The binary image of the keyhole is black, which interferes with defect detection, so it needs to be processed separately. The binary image of the inner ring is extracted, and two parallel lines are drawn from the center, with a spacing slightly larger than the spacing of the keyhole. Projecting this image around the center, the area with the smallest pixel peak is the keyhole region, which is excluded from the detection range. Because the width of the inner and outer rings is small, their binary images can be straightened to approximate a rectangular band. The variance of each row of pixels in the rectangular band is calculated; if the variance exceeds a certain threshold, it is considered a defect. In practice, defects may not be obvious, causing the binarized image to fail to segment the defects. Therefore, it is also necessary to distinguish the inner and outer ring grayscale images. The grayscale image is also straightened into rectangular bands for the inner and outer rings. A convolution kernel is used to calculate the average gradient of each row of pixels. If the average gradient exceeds a specified threshold, it is considered to have defects. Either method determining that there are defects indicates the presence of defects.

[0083] This invention provides a highly efficient and complete process for detecting and identifying defects in battery negative electrode caps, from imaging and image preprocessing to defect detection and identification. It boasts high accuracy, low hardware cost, and high processing speed, making it suitable for large-scale battery production. This invention can extract features from the battery negative electrode surface and effectively identify typical defects, categorized into pits, leaks, and scratches. Furthermore, it can detect and identify subtle defects that current battery detection solutions have failed to detect or identify.

[0084] This invention takes into account the actual battery production environment. Image processing-based detection is sufficient to meet production requirements, while requiring low hardware costs and high accuracy in detection and recognition.

Claims

1. A method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing, characterized in that, The specific steps are as follows: Step 1: Calibrate and correct the camera image; Step 2: Use a camera to capture images of the battery, and use median filtering to preprocess the initial images for battery location. Step 3: Process the preprocessed image to locate the battery image; Step 4: Divide the battery area into three parts: inner circle, inner ring, and outer ring; Step 5: Perform image enhancement on each segmented part of the image; Step 6: Perform defect detection and recognition on the enhanced image. The methods for recognizing inner circular pits, oil stains, and scratches are as follows: The seed filling algorithm is used to detect the connected regions of the inner circle binarized image. Points with the same pixel value in the eight-neighborhood of each pixel in the image are divided into the same connected region and marked with the same label value. Select the second largest connected region for threshold judgment. If its area is greater than the specified pit area threshold, it is a pit or oil stain. If its area is greater than the specified scratch area and its aspect ratio exceeds the specified threshold, it is a scratch. The methods for identifying defects in the inner and outer rings are as follows: Extract the binary image of the inner ring, draw two parallel lines from the center of the circle, and make the distance between the two parallel lines slightly greater than the distance between the keyholes. Project the image around the center of the circle and determine the area with the smallest pixel peak as the keyhole area, and exclude the keyhole area. The following two methods are used to determine whether the inner and outer rings are defective. If either one is defective, it is considered defective: Straighten the inner and outer rings of the binary image into a rectangular band, calculate the variance of each row of pixels in the rectangular band, and if the variance is greater than a certain threshold, it is judged to be defective. The grayscale images of the inner and outer rings are straightened into rectangular bands. The average gradient of each row of pixels is calculated using a convolution kernel. If the average gradient exceeds a specified threshold, it is judged to be defective.

2. The method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing according to claim 1, characterized in that, The specific methods for calibrating and correcting the camera image are as follows: Take several images of the ceramic calibration plate from different angles; The Harris corner detection algorithm is used to obtain the position of the corner of the ceramic calibration plate, and the initial integer corner coordinates are optimized by sub-pixel precision to obtain the precise position coordinates of all corners. At the same time, the camera's internal parameters and distortion parameters are calculated. Use fixed-point iteration in OpenCV to correct distortion and restore the distorted image to the correct position.

3. The method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing according to claim 1, characterized in that, The specific method for locating the battery image after preprocessing is as follows: The preprocessed image is segmented into a binary image using Otsu thresholding, where the battery is represented by a segmented white circle and the background is black. The binarized image is projected horizontally and vertically, and the intersection of the lines where the white pixel peaks are at their maximum in the horizontal and vertical directions is taken as the battery center.

4. The method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing according to claim 3, characterized in that, The pixel peak value is calculated by performing horizontal and vertical projections on the binarized image as follows: in The binarized image represents the first... The peak value of the vertical projection pixels of the column. The binarized image represents the first... The peak value of the horizontal projection pixels of the row. This represents the pixel values ​​after image binarization. and These are the width and height of the original image, respectively.

5. The method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing according to claim 1, characterized in that, The specific method for segmenting the battery region is as follows: Using a mask, the system divides the area into three regions: an inner circle, an inner ring, and an outer ring, based on their radii. The formulas for dividing the inner circle, inner ring, and outer ring are as follows: in, , , They are the inner circle, inner ring, and outer ring, respectively. h and h represent the width and height of the battery image after removing the unwanted background, respectively. , These are the inner and outer diameters of the inner ring, respectively. The radius of the battery is also the outer diameter of the outer ring. The symbol for the product of matrix elements. The coordinates of any pixel in the binarized image The mask, For reversal .

6. The method for detecting and identifying defects in the negative electrode cap of a dry cell battery based on image processing according to claim 5, characterized in that, The mask formula is as follows: in, Let the radius of the mask region be . To calculate the distance from the battery center to the pixel The Euclidean distance, if less than or equal to the radius, then belong Items should be retained; otherwise, they should be removed.

Citation Information

Patent Citations

  • Photovoltaic cell defect online detection method and system based on machine vision

    CN113834816A

  • Glass detection method and device, electronic equipment and computer readable storage medium

    CN114693673A

  • Battery pole piece surface defect detection method, device, equipment and product

    CN115035050A

  • Fragment detection method and device based on image recognition, equipment and medium

    CN115937172A