CN-117314843-B - Dry battery negative electrode cover flaw detection and identification method based on image processing
Abstract
The invention discloses a dry battery negative cover flaw detection and identification method based on image processing, which comprises the steps of calibrating a camera and correcting images, shooting battery images by the camera, preprocessing initial images to be subjected to battery positioning by adopting median filtering, processing the preprocessed images to position the battery images, dividing a battery area into an inner circle, an inner ring and an outer ring, carrying out image enhancement on the images of the divided parts, and carrying out flaw detection and identification on the images after image enhancement. The invention can extract the characteristics of the battery negative surface and effectively identify typical flaws, and can be divided into pit holes, liquid leakage and scratches.
Inventors
- Yao Yazhou
- WANG YUWEI
- LIU HUAFENG
- SUN ZEREN
- CHEN TAO
Assignees
- 南京理工大学
Dates
- Publication Date
- 20260508
- Application Date
- 20230914
Claims (6)
- 1. The defect detection and identification method for the negative electrode cover of the dry battery based on image processing is characterized by comprising the following specific steps of: step 1, calibrating a camera and correcting an image; step 2, shooting a battery image by using a camera, and preprocessing an initial image to be subjected to battery positioning by adopting median filtering; step 3, processing the preprocessed image to realize positioning of the battery image; Step 4, dividing the battery area into an inner circle, an inner ring and an outer ring; Step 5, carrying out image enhancement on the images of the divided parts; and 6, performing flaw detection and identification on the image after image enhancement, wherein the identification method of the inner circular pit hole, the greasy dirt and the scratch comprises the following steps: detecting an inner circle binarization image connected region area by using a seed filling algorithm, dividing adjacent points with the same pixel value in eight adjacent areas of each pixel point in the image into the same connected region, and marking by using the same marking value; selecting a second largest connected region for threshold judgment, wherein the second largest connected region is a pit or oil stain if the area of the second largest connected region is larger than the area threshold of the appointed pit, and the second largest connected region is a scratch if the area of the second largest connected region is larger than the area of the appointed scratch and the aspect ratio of the second largest connected region exceeds the area threshold of the appointed pit; The identification method of the flaws of the inner ring and the outer ring comprises the following steps: Taking out the binary image of the inner ring, leading out two parallel lines from the circle center, wherein the distance between the two parallel lines is slightly larger than the distance between the lock holes, projecting the two parallel lines around the circle center for one circle, determining the area with the minimum pixel peak value as a lock hole area, and eliminating the lock hole area; Judging whether the inner ring and the outer ring are defective or not by adopting the following two modes, and judging that any one of the inner ring and the outer ring is defective when the inner ring and the outer ring are defective: straightening the binary image circular rings of the inner ring and the outer ring into rectangular bands, calculating variances of pixels in each row in the rectangular bands, and judging that the pixels are defective if the variances are larger than a certain threshold value; and straightening the gray level images of the inner ring and the outer ring into rectangular bands, calculating the average gradient of each row of pixels by using a convolution kernel, and judging that the pixels are defective if the average gradient exceeds a specified threshold value.
- 2. The method for detecting and identifying defects of a negative cover of a dry battery based on image processing according to claim 1, wherein the specific method for calibrating and correcting the camera is as follows: shooting images of a plurality of ceramic calibration plates in different directions; Acquiring the positions of the corner points of the ceramic calibration plate by adopting a Harris corner detection algorithm, optimizing the sub-pixel precision of the initial integer corner coordinates to obtain the accurate position coordinates of all the corner points, and simultaneously calculating the internal parameters and distortion parameters of the camera; the distorted image is corrected to the correct position using the fixed point iteration de-distortion in OpenCV.
- 3. The image processing-based dry battery negative cover flaw detection and identification method according to claim 1, wherein the specific method for processing the preprocessed image and realizing the positioning of the battery image is as follows: dividing the preprocessed image into a binary image by using an Ojin threshold, wherein the battery is a divided white circle, and the background is black; And carrying out horizontal and vertical projection on the binarized image, and taking an intersection point of a straight line where the peak value of the white pixel is maximum in the horizontal direction and the vertical direction as the center of the battery.
- 4. The image processing-based dry cell negative cap flaw detection and recognition method according to claim 3, wherein horizontal and vertical projections are respectively performed on the binarized image, and a calculation formula of a pixel peak value is as follows: Wherein the method comprises the steps of Representing the binarized image at the first The vertical projection pixel peaks of the columns, Representing the binarized image at the first The horizontal projection of the row has a pixel peak, Representing the pixel values after binarization of the image, And The width and height of the original imaging pictures are respectively.
- 5. The image processing-based method for detecting and identifying defects of a negative electrode cap of a dry battery according to claim 1, wherein the specific method for dividing the battery area is as follows: Dividing three areas of an inner circle, an inner ring and an outer ring according to the radius by using a mask, wherein the dividing formula of the inner circle, the inner ring and the outer ring is as follows: Wherein, the 、 、 Respectively an inner circle, an inner ring and an outer ring, H is the width and height of the battery picture after the useless background is removed, 、 The inner diameter and the outer diameter of the inner ring are respectively, For the radius of the cell i.e. the outer diameter of the outer ring, For the sign of the product of the matrix elements, Is any pixel point coordinate of the binarized image Is used as a mask for the mask, Is inverted 。
- 6. The method for detecting and identifying defects of a negative cap of a dry cell based on image processing according to claim 5, wherein the mask formula is as follows: Wherein, the For the radius of the mask region, To calculate the center of the battery to the pixel point If the Euclidean distance is less than or equal to the radius Belonging to Should be reserved, otherwise should be rejected.
Description
Dry battery negative electrode cover flaw detection and identification method based on image processing Technical Field The invention belongs to the field of image processing of computer vision, and particularly relates to a dry battery negative cover flaw detection and identification method based on image processing. Background In the battery production process, in order to ensure the product quality, flaw detection is required to be carried out on the battery. Surface imperfections not only destroy the aesthetic appeal of the battery, but can also cause serious damage to the performance of the battery. The lack of an effective flaw detection system can result in false classification of battery quality levels; meanwhile, if no flaw is detected and a battery quality problem occurs, a safety accident may be caused. With the continuous increase of consumption level, consumers pay more attention to the appearance and quality of products, and the production of high-quality and high-reliability products has been a trend. For flaw detection of batteries, three detection schemes are currently available, namely manual visual inspection, detection based on image processing and detection based on deep learning. Traditionally, battery production lines employ manual visual inspection to detect and classify the quality of sealed batteries. However, the manual visual inspection has the defects of high labor intensity, poor detection stability and consistency, low automation degree, low production efficiency, difficulty in forming lean production, high labor cost, difficulty in labor, labor and training and the like. Therefore, detection based on image processing and detection based on deep learning gradually replace manual visual inspection. Based on the detection of image processing, defects of the battery, such as pit holes, liquid leakage, scratches, pollution or foreign matters, oxidation or corrosion, poor welding and the like, can be efficiently and stably detected through manual feature extraction and image processing. The image processing has the advantages of maturity, stability, interpretability, high calculation efficiency, simple engineering realization and the like, can meet the real-time requirement, and can be well adapted to various complex working condition environments. The detection based on deep learning is mainly based on using a neural network, the characteristics of a detection object are extracted through using a plurality of convolution layers, a normalization layer and an activation function layer, and flaws are identified and distinguished through a full connection layer. The detection based on deep learning is different from the detection based on image processing in that the detection object features can be automatically learned without manually extracting the flaw features, but has the disadvantage that only the features of the trained sample can be learned, and flaw features outside the sample cannot be processed. Meanwhile, detection based on deep learning requires a large number of sample training and higher hardware requirements, however, manual labeling is time-consuming and expensive, and if labeled samples are inaccurate, training is affected. Disclosure of Invention The invention provides a dry battery negative cover flaw detection and identification method based on image processing. The technical scheme for realizing the purpose of the invention is that the defect detection and identification method for the negative electrode cover of the dry battery based on image processing comprises the following specific steps: step 1, calibrating a camera and correcting an image; step 2, shooting a battery image by using a camera, and preprocessing an initial image to be subjected to battery positioning by adopting median filtering; step 3, processing the preprocessed image to realize positioning of the battery image; Step 4, dividing the battery area into an inner circle, an inner ring and an outer ring; Step 5, carrying out image enhancement on the images of the divided parts; And 6, performing flaw detection and identification on the image after image enhancement. Preferably, the specific method for calibrating the camera and correcting the image is as follows: shooting images of a plurality of ceramic calibration plates in different directions; Acquiring the positions of the corner points of the ceramic calibration plate by adopting a Harris corner detection algorithm, optimizing the sub-pixel precision of the initial integer corner coordinates to obtain the accurate position coordinates of all the corner points, and simultaneously calculating the internal parameters and distortion parameters of the camera; the distorted image is corrected to the correct position using the fixed point iteration de-distortion in OpenCV. Preferably, the preprocessed image is processed, and the specific method for realizing the positioning of the battery image is as follows: dividing the preprocessed image int