Thermal battery assembly defect detection method
Through industrial camera acquisition and multi-angle image processing technology, unpacked thermal batteries are directly detected, solving the problem of expensive and uncorrectable equipment for detecting existing thermal battery assembly defects, and achieving efficient and economical detection and correction, which is suitable for production lines automation.
Patent Information
- Application Number
- CN202411187245.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-03
AI Technical Summary
The existing thermal battery assembly defect detection methods have problems such as expensive equipment, complex operation, inability to correct after inspection, and limited resolution, resulting in high production costs and waste of materials.
Industrial cameras are used to directly collect unpacked thermal battery images, and non-destructive detection and timely correction are achieved through multi-angle template matching, image preprocessing, stack segmentation and defect feature recognition.
It improves inspection efficiency, saves economic costs, reduces waste and losses in the production process, is suitable for integration with production lines, and reduces the dependence of manual identification.
Smart Images

Figure BDA0005013862600000031 
Figure BDA0005013862600000032 
Figure BDA0005013862600000033
Abstract
Description
Technical Field
[0001] The invention belongs to thermal battery detection technology, and in particular relates to a thermal battery assembly defect detection method. Background Art
[0002] Thermal batteries, also known as heat-activated reserve batteries, have been widely used in aerospace and military fields because of their excellent storage time, strong overload resistance and excellent adaptability to extreme environments. Due to the special use of thermal batteries, the requirements for their non-destructive testing are extremely strict. The main body of a thermal battery is composed of a battery stack consisting of multiple single cells. Its common structural failures are mostly caused by assembly defects of single cells, which are usually caused by lax process control and manual assembly errors. Since thermal batteries are disposable batteries, traditional electrochemical performance testing and internal material structure inspection methods will damage the battery and make it unusable. Therefore, how to perform accurate and efficient non-destructive testing without damaging thermal batteries has become a challenging topic. At present, the commonly used non-destructive testing technologies in the field of battery defect identification mainly include X-ray detection, infrared detection and air-coupled ultrasonic detection. However, in the field of thermal battery testing, there is no direct detection method for thermal batteries during assembly.
[0003] The application of computer image processing technology in the field of battery defect detection has made significant progress. With the development of high-resolution image acquisition technology, modern industrial cameras are able to capture tiny defects in batteries. These technologies can automatically identify and classify defects through image analysis, improving the accuracy and efficiency of detection. Real-time image processing enables the detection process to provide instant feedback and correct production problems, thereby reducing defective rates and production costs. In addition, the integration of multimodal image technologies, such as infrared and X-ray images, provides more comprehensive defect analysis capabilities. Automated inspection systems not only increase processing speed, but also reduce the possibility of human error. The introduction of data analysis and visualization functions helps engineers gain a deeper understanding of defect distribution and production trends, and further optimize the production process. These technological advances have made battery defect detection more intelligent and precise, providing strong support for quality control and efficiency improvement of battery production.
[0004] Most of the existing thermal battery assembly defect detection methods are based on X-ray penetrating scanning of packaged batteries. After the X-rays pass through the thermal battery to be detected, an enlarged X-ray image is formed on the flat-panel detector. Due to the different internal structural densities of the thermal battery, the negative electrode, electrolyte, positive electrode, heating powder and current collector can be observed, and it can be judged whether there are assembly defects. Reference [1] proposed a battery stack image extraction method based on integral projection and enhanced the local details of the battery stack. After extracting feature parameters through grayscale line scanning, two classification models were studied, and the weighted average method was used to fuse the classification results. Reference [2] used an improved grayscale normalization method to preprocess the input thermal battery image to be detected and the battery stack area template library image, and obtained the most similar template through rough matching of the template library. The template size and rotation angle were adaptively adjusted using the adaptive template matching method to accurately extract the battery stack area. The extracted battery stack area may be rotated at a small angle. The rotation angle is calculated through corner detection, and the angle of the battery stack area is corrected by affine transformation. Then the defect features of the battery stack are extracted and matched with the defect features of the battery defect library. Combined with the self-contrast of the single-cell features, the calculation results are input into the CART (classification and regression tree) classifier to realize the detection of thermal battery assembly defects. Reference [3] proposed an improved grayscale peak coordinate comparison algorithm with local contrast enhancement to address the problem of unclear local texture features of X-ray transmission images caused by the voltage limitation of the X-ray source tube. The problem of accuracy in extracting the coordinates of the trough of the oblique incident X-ray is solved, and the detection of missing collector defects and sequence errors is correct.
[0005] The above methods have the following main problems when applied to thermal battery defect detection:
[0006] 1) However, these methods face some obvious shortcomings. X-ray equipment is usually bulky and expensive, difficult to operate, and has a complicated detection process. Workers need to place the packaged batteries separately in the CT room for detection, which not only leads to poor timeliness, but also makes these devices difficult to integrate into the production line, thereby increasing production costs.
[0007] 2) After the packaged batteries are identified and tested, if assembly defects are found, these hot batteries are usually scrapped. Since the test is performed after the battery is packaged, any defects found mean that the previous production process has generated irrecoverable waste, thereby increasing production costs and affecting overall economic benefits.
[0008] 3) X-ray inspection requires specialized operators and strict safety measures to prevent radiation from causing harm to the human body and the environment, which further increases operational complexity and cost.
[0009] 4) Although X-ray inspection has high resolution, its ability to identify certain complex defects or tiny structures may be limited, especially in terms of battery sealing and internal structural abnormalities.
[0010] References:
[0011] [1] Zhou Wei, Wang Rui, Meng Fanqin, et al. Research on image recognition method of internal defects of thermal batteries[J]. Applied Optics, 2022, 43(1): 60-66.
[0012] [2] Zhou Wei, Xiao Xin, Wang Rui, et al. Thermal battery assembly defect detection based on image recognition[J]. Manufacturing Automation, 2022, 44(6): 87-91.
[0013] [3] Zhao Tao, Zhang Sixiang, Wang Zhe, Xu Wenchao, Xiao Xin, Wang Rui. Thermal battery defect detection algorithm with local contrast enhancement[J]. Laser Journal, 2022, 43(1): 24-28. Summary of the invention
[0014] In view of the shortcomings of the above method in thermal battery assembly defect detection, the present invention provides a thermal battery assembly defect detection method.
[0015] A thermal battery assembly defect detection method of the present invention comprises the following steps:
[0016] Step 1: Acquisition of thermal battery images.
[0017] Before shooting, place the battery in the camera's field of view and use a suitable light source to illuminate the battery surface to ensure that the captured battery image data information is complete and consistent. The servo motor drives the battery fixture to rotate at a fixed angle to obtain battery stack images at multiple angles.
[0018] Step 2: Multi-angle image processing.
[0019] Step 2.1: Multi-angle template matching.
[0020] The battery image is extracted from the original data image using template matching: first, a standard battery stack image is used as template T, and template T is moved on the searched image, i.e., the hot battery image, according to the template matching idea. The area where template T, i.e., the battery stack image slides on the hot battery image S to be detected is called sub-image S. ij ; The obtained coordinates (i, j) are the search subgraph S ij The search range is the entire captured image, and the template T and all searched sub-areas S ijSort the matching similarities, find the matching position with the greatest similarity, and complete the template matching; here we use the standard square difference matching algorithm, and the calculation formula is as follows:
[0021]
[0022] Among them, R(x,y) represents the correlation between the area centered at (x,y) in the original image and the template. x' and y' traverse all pixel coordinates of the template image. T(x',y') represents the pixel value of the template image at position (x',y'), and I(x+x',y+y') represents the pixel value of the original image at position (x+x',y+y').
[0023] Step 2.2: Image preprocessing.
[0024] The image data is smoothed by using mean filtering, which is also called linear filtering. The method used is the neighborhood averaging method. The basic principle of linear filtering is to replace the pixel values in the original image with the mean, that is, for the current pixel point (x, y) to be processed, select a template composed of several pixels of its neighbors, calculate the mean of all pixels in the template, and then assign the mean to the current pixel point (x, y), which is the grayscale g(x, y) of the processed image at this point. The formula is:
[0025]
[0026] Among them, s is the set of pixels in the template centered at point (i, j), and the template size is m×n.
[0027] Since the angle tilt algorithm is added to the multi-angle template matching algorithm, the tilt angle is calculated when the battery stack is tilted at a certain angle. This angle is used to assist in the rotation correction of the battery stack image. First, the area is identified by the color feature of the middle lead-out piece, which is yellow. Since the cylindrical surface presents a rectangular feature, the angle formed by the rectangular feature of the lead-out piece and the horizontal plane is calculated, and the angle is summed with the tilt angle calculated by template matching to obtain the average value. The average value is used to perform affine transformation on the thermal battery stack image. In two-dimensional image transformation, the expression is:
[0028]
[0029] It can be regarded as the superposition of linear transformation R and translation transformation T.
[0030] Step 3: Battery stack image segmentation.
[0031] The reflective properties of the single heating sheet are used to separate the rest of the structure.
[0032] Step 3.1: Identification and extraction of single heating plate area.
[0033] Due to the reflection of the single heater, the feature presented is the brightest area on the surface of the battery stack. The highlight area recognition algorithm is used to identify the highlight area on the surface of the battery stack, which is the reflective area of the single heater. In order to make the single heater area more accurate, an adaptive threshold binarization algorithm is added, and finally the binary image is opened and closed to remove excess noise and holes.
[0034] Step 3.2: Extraction of segmentation boundary lines.
[0035] Since the identified single heating plate area is a rectangle and the side length of the rectangle is not smooth, the contour extraction algorithm first identifies the lower contour of the rectangle, and then uses the Sobel edge detection algorithm to perform contour recognition on the image. The Sobel operator contains two sets of 3×3 matrices, which are horizontal and vertical templates respectively. By performing a planar convolution with the image, the approximate horizontal and vertical brightness differences can be obtained respectively.
[0036] Detection of horizontal direction along the transverse template:
[0037]
[0038] Detect the template along the vertical direction:
[0039]
[0040] The approximate horizontal and vertical gradients of each pixel of the image are combined with the following formula to calculate the magnitude of the gradient:
[0041]
[0042] Then use the following formula to calculate the gradient direction:
[0043]
[0044] The extracted lower edge of the single heating sheet is then used to realize the division between the monomers.
[0045] Step 4: Defect feature identification.
[0046] Step 4.1: Single image enhancement.
[0047] The preprocessed single image is subjected to a grayscale transformation operation. The grayscale transformation is a transformation that maps each pixel of the image according to a grayscale mapping function. It acts on each pixel. Here, a grayscale linear transformation is directly performed on the preprocessed data.
[0048] Step 4.2: Feature definition.
[0049] The internal structure of the monomer is composed of a substrate, a composite sheet, a negative electrode sheet assembly and a single heating sheet. Among them, the single heating sheet is the highlighted area, which is the brightest part in the monomer grayscale image. This structure has been preferentially identified and marked during the monomer segmentation process. After the grayscale linear transformation operation, the composite sheet has gray-black area characteristics, while the negative electrode sheet assembly has white characteristics. The difference between the two is relatively obvious and they are attached together from top to bottom, so they can be clearly distinguished.
[0050] Then, the multi-angle battery stack image is used to identify the substrate at multiple angles for the same cell. The specific identification steps are as follows:
[0051] S1: First locate the position of the substrate and extract the area. The substrate is at the positive end of the composite sheet. Since the negative end of the composite sheet is the substrate, which is a white area, the substrate with extremely small features at the other end is at the edge of the gray-black area of the composite sheet. Due to the two situations of tight and loose fitting, there will be black gaps with grayscale values less than the gray-black area or no black gap features in this area. If there are black gaps, then the entire black gap area is directly extracted as the substrate feature area, otherwise the angle is deemed to have no substrate features.
[0052] S2: Regional preprocessing. Since there are three types of substrate features: (1) clearly prominent; (2) darker; and (3) vaguely visible, the same image enhancement algorithm cannot be used for the three types. First, the substrate feature of the substrate area is determined based on the statistical results of the grayscale histogram of the image, and then different degrees of image enhancement algorithms are used to make the image features of the originally darker area more obvious.
[0053] S3: Use HSV color space to filter the extracted area, remove the darker black gap part, and the remaining area with larger gray value is the substrate point. Due to the burr interference inside the monomer, the gray value of the burr part is close to the substrate point, so it is necessary to extract the black gap outline of the substrate area to determine whether the substrate point is inside the outline, otherwise it is excluded; the morphological edge based on grayscale morphological expansion, corrosion, opening operation and closing operation is defined as:
[0054]
[0055] Among them, the grayscale image is f(x,y), the structural element is b, and the dilation operation is recorded as The erosion operation is recorded as
[0056] Dilate the grayscale image f with the structure element b, defined as:
[0057]
[0058] The grayscale image f is eroded with the structural element b, which is defined as:
[0059]
[0060] After obtaining the black gap outline, the four structures inside the monomer are identified and the results are output in sequence.
[0061] Furthermore, the specific steps of the highlight area recognition algorithm in step 3 are:
[0062] S1: Convert the thermal battery stack area into a grayscale image and then perform normalization.
[0063] S2: Determine the highlight area; because the highlight area of a single heater needs to be identified, the thresh threshold is calculated by gray*gray*gray to make the bright areas in the original image brighter, and the average value is taken as the threshold, and the mask is obtained by binarization.
[0064] S3: Smooth transition of the edge of the mask area: Assuming light is 50, the mask area value of midrate is 1.5, the black area is 1, and the transition area is 1 to 1.5; the mask area of brightrate is 0.125, the black area is 0, and the transition area is 0 to 0.125.
[0065] S4: Brighten the highlight area according to midrate and brightrate. For non-highlight areas, midrate is 1 and brightrate is 0, which means there is no change. For highlight areas, midrate is 1.5 and brightrate is 0.125, so the color values are increased, bringing a brightening effect. For edge areas, midrate and brightrate play a good transition role.
[0066] The beneficial technical effects of the present invention are:
[0067] The method of the present invention uses an industrial camera to directly collect images of batteries that have been assembled but not yet packaged. After defect identification is completed, the defective batteries can be corrected in a timely manner. This method not only improves detection efficiency, but also effectively saves economic costs because it allows defects to be processed before battery packaging, thereby reducing possible waste and losses in the production process. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 The basic flow chart of a thermal battery assembly defect detection method of the present invention. DETAILED DESCRIPTION
[0069] The present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0070] A thermal battery assembly defect detection method of the present invention is as follows: Figure 1 As shown, it includes four parts: thermal battery image acquisition, multi-angle image processing, battery stack image segmentation and defect feature recognition. Specifically, it includes the following steps:
[0071] Step 1: Acquisition of thermal battery images.
[0072] Before shooting, place the battery in the camera's field of view and use a suitable light source to illuminate the battery surface to ensure that the captured battery image data information is complete and consistent. The servo motor drives the battery fixture to rotate a fixed angle to obtain battery stack images at multiple angles for comparison and output of detection results to ensure the accuracy of battery assembly defect detection.
[0073] The device used in this method to collect thermal battery image data is the MV-CH310 industrial camera produced by Hangzhou Hikvision Digital Technology Co., Ltd.
[0074] Step 2: Multi-angle image processing.
[0075] Step 2.1: Multi-angle template matching.
[0076] When the industrial camera takes the thermal battery image, in theory, the collected data are all thermal batteries containing background environmental interference, and due to the influence of fixture equipment, operator experience, environmental factors, etc., the battery data will inevitably be tilted. Use template matching (matchTemplate) to extract the battery image from the original data image. The segmentation idea of template matching is to obtain the battery stack position through matching and then segment it through the mask method. The matching is to compare the prepared standard template with the searched area in the image, and compare to get the position with the highest similarity. First, a standard battery stack image is used as template T, and template T is moved on the searched image, that is, the thermal battery image, according to the template matching idea. The area where template T, that is, the battery stack image slides on the thermal battery image S to be detected is called sub-image S. ij ; The obtained coordinates (i, j) are the search subgraph S ij The search range is the entire captured image, and the template T and all searched sub-areas S ij Sort the matching similarities, find the matching position with the greatest similarity, and complete the template matching; here we use the standard square difference matching algorithm, and the calculation formula is as follows:
[0077]
[0078] Among them, R(x,y) represents the correlation between the area centered at (x,y) in the original image and the template. x' and y' traverse all pixel coordinates of the template image. T(x',y') represents the pixel value of the template image at position (z',y'), and I(z+x',y+y') represents the pixel value of the original image at position (x+x',y+y').
[0079] The basic template matching algorithm has certain limitations. If the matching target in the original image is slightly rotated or changes in size, the template matching score will decrease, resulting in a decrease in matching accuracy or even errors. Therefore, it is required that the target object can only be translated in the image. However, in the actual shooting process, when the worker places the battery in the fixture, it cannot completely ensure that the angle of the battery is consistent. The battery image may be tilted to a certain extent, and the shooting requirement is to collect data from multiple angles of the battery stack. There will also be certain differences on the surface of the battery stack. Therefore, the conventional template matching algorithm cannot completely guarantee that the hot battery is completely extracted from the image. Therefore, the research method of the present invention improves the template matching algorithm for the above problems. In order to make the template more adaptable to the tilt of the battery angle, the template can be rotated, and the tilted battery can be matched in sequence using templates of different angles until the best matching position is found. This method may prolong the time of the matching algorithm. For this purpose, the template and the image to be matched can also be pyramid down-sampled. The image pyramid is a multi-scale expression of the image. The images of each scale are arranged from small to large according to the resolution, and from top to bottom, forming a pyramid-like structure, so it is called an image pyramid. Start matching from the image at the top of the pyramid. Since the resolution is small, the matching time is short. Then, based on this position, continue matching in the local area around this position in the next layer until the last layer is matched. Finally, since the visual features of the battery at different angles are slightly different, but there is only one battery template for a model, the remaining angles cannot achieve the highest matching accuracy during the matching process. If the matching coefficient is set to 1, the matching result will be wrong. After experiments, the matching coefficient is set to a value closer to 1 for template matching, which can completely match the battery stack images at multiple angles from the background.
[0080] Step 2.2: Image preprocessing.
[0081] After obtaining a single image, due to the noise generated by the equipment acquisition imaging process and the influence of the structural properties of the object being measured on the imaging of the light on the surface of the thermal battery, the transition between the pixels of the data is not smooth, so the mean filter is used to smooth the image data. The mean filter is also called linear filtering. The method used is the neighborhood average method. The basic principle of linear filtering is to replace the pixel values in the original image with the mean, that is, for the current pixel point (x, y) to be processed, select a template composed of several pixels of its neighbors, calculate the mean of all pixels in the template, and then assign the mean to the current pixel point (x, y), which is the grayscale g(x, y) of the processed image at this point, that is, the formula is:
[0082]
[0083] Among them, s is the set of pixels in the template centered at point (i, j), and the template size is m×n.
[0084] Since the angle tilt algorithm is added to the multi-angle template matching algorithm, the tilt angle is calculated when the battery stack is tilted at a certain angle, and the angle is used to assist in the rotation correction of the battery stack image. First, the area is identified by the color feature of the middle lead-out piece, which is yellow. Since the cylindrical surface presents a rectangular feature, the angle formed by the rectangular feature of the lead-out piece and the horizontal plane is calculated, and the angle is summed with the tilt angle calculated by template matching to obtain the average value. The average value is used to perform affine transformation on the thermal battery stack image. Affine transformation is an important transformation in the two-dimensional plane and is widely used in the field of image graphics. In two-dimensional image transformation, the expression is:
[0085]
[0086] It can be regarded as the superposition of linear transformation R and translation transformation T.
[0087] Step 3: Battery stack image segmentation.
[0088] After preprocessing, a clear and complete image of the battery stack is obtained. The battery stack is composed of stacked monomers. This method studies a single heating plate edge positioning algorithm to achieve accurate segmentation of the battery stack. First, when the light source is concentrated on the surface of the battery stack, the reflective properties of the single heating plate can be used to separate the remaining structures.
[0089] Step 3.1: Identification and extraction of single heating plate area.
[0090] Due to the reflection of the single heater, the feature presented is the brightest area on the surface of the battery stack. The highlight area recognition algorithm is used to identify the highlight area on the surface of the battery stack, which is the reflective area of the single heater. In order to make the single heater area more accurate, an adaptive threshold binarization algorithm is added, and finally the binary image is opened and closed to remove excess noise and holes.
[0091] The specific steps of the highlight area recognition algorithm are:
[0092] S1: Convert the thermal battery stack area into a grayscale image and then perform normalization.
[0093] S2: Determine the highlight area; because the highlight area of a single heater needs to be identified, the thresh threshold is calculated by gray*gray*gray to make the bright areas in the original image brighter, and the average value is taken as the threshold, and the mask is obtained by binarization.
[0094] S3: Smooth transition of the edge of the mask area: Assuming light is 50, the mask area value of midrate is 1.5, the black area is 1, and the transition area is 1 to 1.5; the mask area of brightrate is 0.125, the black area is 0, and the transition area is 0 to 0.125.
[0095] S4: Brighten the highlight area according to midrate and brightrate. For non-highlight areas, midrate is 1 and brightrate is 0, which means there is no change. For highlight areas, midrate is 1.5 and brightrate is 0.125, so the color values are increased, bringing a brightening effect. For edge areas, midrate and brightrate play a good transition role.
[0096] Step 3.2: Extraction of segmentation boundary lines.
[0097] Since the identified single heating plate area is a rectangle, and the side length of the rectangle is not smooth, the contour extraction algorithm first identifies the lower contour of the rectangle, and uses the Sobel edge detection algorithm to identify the contour of the image. The Sobel operator is an edge detection operator based on the first-order derivative. It introduces an operation similar to the local average, which has a certain smoothing effect on noise and can effectively eliminate the influence of noise. The Sobel operator contains two sets of 3×3 matrices, which are horizontal and vertical templates. By performing a plane convolution with the image, the horizontal and vertical brightness difference approximations can be obtained respectively.
[0098] Detection of horizontal direction along the transverse template:
[0099]
[0100] Detect the template along the vertical direction:
[0101]
[0102] The approximate horizontal and vertical gradients of each pixel of the image are combined with the following formula to calculate the magnitude of the gradient:
[0103]
[0104] Then use the following formula to calculate the gradient direction:
[0105]
[0106] In the above example, if the angle θ=0, it means that the image has a vertical edge, and the left side is darker than the right side. The extracted lower edge of the single heating sheet is then used to achieve segmentation between the monomers.
[0107] Step 4: Defect feature identification.
[0108] Step 4.1: Single image enhancement.
[0109] After the preprocessing of the single image, the gray value difference between different structures is not obvious, which affects the judgment between the structures. Therefore, it is necessary to perform a grayscale transformation operation on the preprocessed single image. Grayscale transformation is a transformation that maps each pixel of the image according to the grayscale mapping function, which acts on each pixel. Grayscale transformation is generally used for image enhancement, improving image contrast, and improving image grayscale distribution. Grayscale transformation is divided into linear function transformation, logarithmic function transformation, and power function transformation according to the grayscale transformation function. This method directly performs a grayscale linear transformation on the preprocessed data.
[0110] Step 4.2: Feature definition.
[0111] The internal structure of the monomer is composed of a substrate, a composite sheet, a negative electrode sheet assembly and a single heating sheet. Among them, the single heating sheet is the highlighted area, which is the brightest part in the monomer grayscale image. This structure has been preferentially identified and marked during the monomer segmentation process. After the grayscale linear transformation operation, the composite sheet has gray-black area characteristics, while the negative electrode sheet assembly has white characteristics. The difference between the two is relatively obvious and they are attached together from top to bottom, so they can be clearly distinguished.
[0112] In the identification of internal structures, the substrate is a major difficulty. Since the thickness of the substrate is extremely small and the diameter of the substrate is smaller than that of the other three structures, after assembly, the substrate is mostly invisible on the surface of the monomer. Therefore, it is impossible to complete the identification and detection of the substrate by relying on visual features from only one angle. To address this problem, the present invention uses multi-angle battery stack images to perform substrate identification at multiple angles on the same monomer. The specific identification steps are as follows:
[0113] S1: Since the rest of the structure as the background will greatly affect the internal judgment, the position of the substrate is first located and the area is extracted. The substrate is at the positive end of the composite sheet. Since the negative end of the composite sheet is the substrate, it is a white area. The substrate with extremely small features at the other end is at the edge of the gray-black area of the composite sheet. Due to the two situations of close and loose fitting, there will be black gaps with grayscale values less than the gray-black area or no black gap features in this area. If there are black gaps, then the entire black gap area is directly extracted as the substrate feature area, otherwise the angle is deemed to be free of substrate features.
[0114] S2: Regional preprocessing. Since there are three types of substrate features: (1) clearly prominent; (2) darker; and (3) vaguely visible, the same image enhancement algorithm cannot be used for the three types. First, the substrate feature of the substrate area is determined based on the statistical results of the grayscale histogram of the image, and then different degrees of image enhancement algorithms are used to make the image features of the originally darker area more obvious.
[0115] S3: Use the HSV color space to filter the extracted area, remove the darker black gap part, and the remaining area with a larger gray value is the substrate point. Due to the burr interference inside the monomer, the gray value of the burr part is close to the substrate point, so it is necessary to extract the black gap outline of the substrate area to determine whether the substrate point is inside the outline, otherwise it is excluded. This method uses a grayscale morphological edge detection algorithm to better extract the black gap edge, which is not affected by internal noise. The morphological edge based on grayscale morphological expansion, corrosion, opening and closing operations is defined as:
[0116]
[0117] After obtaining the black gap outline, the influence of the burrs on the negative electrode assembly can be basically eliminated. The four structures inside the single cell are identified and the results are output in sequence.
[0118] The present invention has the following technical advantages:
[0119] 1) There are some existing thermal battery assembly defect detection algorithms. These methods usually perform detection after battery packaging and generate CT images through laser penetration scanning. However, the quality of these CT images is often not high. In contrast, the algorithm proposed in this invention directly captures the internal image of the thermal battery before packaging. The use of industrial cameras for high-precision imaging makes the image acquisition process simpler and solves the shortcomings of laser equipment in image quality.
[0120] 2) Existing thermal battery defect detection algorithms usually perform detection on packaged batteries. If assembly defects are found, the battery can only be scrapped and cannot be returned to the factory for reassembly, which leads to material waste and increased costs. The method of the present invention performs detection before battery packaging. If defects are found, the battery can be directly disassembled and the assembly sequence can be adjusted to correct them, thereby effectively saving economic costs.
[0121] 3) Current thermal battery defect detection algorithms usually require batches of batteries to be brought into a closed room for CT scanning equipment for detection, which is not suitable for use at the assembly site. The detection algorithm proposed in the present invention can be used in conjunction with the production line, improving the automation of the production line, eliminating the process of manual visual recognition, and thus improving the efficiency of the production site.
Claims
1. A method for detecting thermal battery assembly defects, characterized in that: The following steps are involved: Step 1: Acquisition of thermal battery images; Before shooting, place the battery in the camera's field of view and use a suitable light source to illuminate the battery surface to ensure that the captured battery image data information is complete and consistent. The servo motor drives the battery fixture to rotate at a fixed angle to obtain battery stack images at multiple angles. Step 2: Multi-angle image processing; Step 2.1: Multi-angle template matching; The battery image is extracted from the original data image using template matching: first, a standard battery stack image is used as template T, and template T is moved on the searched image, i.e., the hot battery image, according to the template matching idea. The area where template T, i.e., the battery stack image slides on the hot battery image S to be detected is called sub-image S. ij ; The obtained coordinates (i, j) are the search subgraph S ij The search range is the entire captured image, and the template T and all searched sub-areas S ij Sort the matching similarities, find the matching position with the greatest similarity, and complete the template matching; here we use the standard square difference matching algorithm, and the calculation formula is as follows: Where R(x,y) represents the correlation between the area centered at (x,y) in the original image and the template, x′ and y′ traverse all pixel coordinates of the template image, T(x′,y′) represents the pixel value of the template image at position (x′,y′), and I(x+x′,y+y′) represents the pixel value of the original image at position (x+x′,y+y′); Step 2.2: Image preprocessing; The image data is smoothed by using mean filtering, which is also called linear filtering. The method used is the neighborhood averaging method. The basic principle of linear filtering is to replace the pixel values in the original image with the mean, that is, for the current pixel point (x, y) to be processed, select a template composed of several pixels of its neighbors, calculate the mean of all pixels in the template, and then assign the mean to the current pixel point (x, y), which is the grayscale g(x, y) of the processed image at this point. The formula is: Among them, s is the set of pixels in the template centered at point (i, j), and the template size is m×n; Since the angle tilt algorithm is added to the multi-angle template matching algorithm, the tilt angle is calculated when the battery stack is tilted at a certain angle. This angle is used to assist in the rotation correction of the battery stack image. First, the area is identified by the color feature of the middle lead-out piece, which is yellow. Since the cylindrical surface presents a rectangular feature, the angle formed by the rectangular feature of the lead-out piece and the horizontal plane is calculated, and the angle is summed with the tilt angle calculated by template matching to obtain the average value. The average value is used to perform affine transformation on the thermal battery stack image. In two-dimensional image transformation, the expression is: It is regarded as the superposition of linear transformation R and translation transformation T; Step 3: Battery stack image segmentation; The reflective properties of the single heating sheet are used to separate the rest of the structure; Step 3.1: single heating plate area identification and extraction; Due to the reflection of the single heater, the feature presented is the brightest area on the surface of the battery stack. The highlight area recognition algorithm is used to identify the highlight area on the surface of the battery stack, which is the reflective area of the single heater. In order to make the single heater area more accurate, an adaptive threshold binarization algorithm is added. Finally, the binary image is opened and closed to remove excess noise and holes. Step 3.2: Extraction of segmentation boundary lines; Since the identified single heating plate area is a rectangle and the side length of the rectangle is not smooth, the contour extraction algorithm first identifies the lower contour of the rectangle, and uses the Sobel edge detection algorithm to perform contour recognition on the image. The Sobel operator contains two sets of 3×3 matrices, which are horizontal and vertical templates respectively. By performing plane convolution with the image, the horizontal and vertical brightness difference approximations can be obtained respectively; Detection along the horizontal template: Detect the template along the vertical direction: The approximate horizontal and vertical gradients of each pixel of the image are combined with the following formula to calculate the magnitude of the gradient: Then use the following formula to calculate the gradient direction: Then the extracted lower edge of the single heating sheet is used to realize the segmentation between the monomers; Step 4: Defect feature identification; Step 4.1: Single image enhancement; Perform grayscale transformation on the preprocessed single image. Grayscale transformation is a transformation that maps each pixel of the image according to the grayscale mapping function. It acts on each pixel. Here, the preprocessed data is directly subjected to grayscale linear transformation. Step 4.2: Feature definition; The internal structure of the monomer is composed of a substrate, a composite sheet, a negative electrode sheet assembly and a single heating sheet. The single heating sheet is a highlight area, that is, the brightest part of the monomer grayscale image. This structure has been preferentially identified and marked during the monomer segmentation process. After the grayscale linear transformation operation, the composite sheet has gray-black regional features, while the negative electrode sheet assembly has white features. The difference between the two is relatively obvious and they are attached together from top to bottom, so they can be clearly distinguished. Then, the multi-angle battery stack image is used to identify the substrate at multiple angles for the same cell. The specific identification steps are as follows: S1: First locate the position of the substrate and extract the area. The substrate is at the positive end of the composite sheet. Since the negative end of the composite sheet is the substrate, it is a white area. Then the substrate with extremely small features at the other end is at the edge of the gray-black area of the composite sheet. Due to the two situations of close and loose fitting, there will be black gaps with gray values less than the gray-black area in this area or no black gap features. If there are black gaps, then all black gap areas are directly extracted as substrate feature areas, otherwise it is considered that there is no substrate feature at this angle; S2: Regional preprocessing. Since substrate features exist in three situations: (1) clearly prominent; (2) darker; and (3) vaguely visible, the same image enhancement algorithm cannot be used for the three situations. First, the substrate feature of the substrate region is determined based on the statistical results of the grayscale histogram of the image, and then different degrees of image enhancement algorithms are used to make the image features of the originally darker region more obvious. S3: Use HSV color space to filter the extracted area, remove the darker black gap part, and the remaining area with larger gray value is the substrate point. Due to the burr interference inside the monomer, the gray value of the burr part is close to the substrate point, so it is necessary to extract the black gap outline of the substrate area to determine whether the substrate point is inside the outline, otherwise it is excluded; the morphological edge based on grayscale morphological expansion, corrosion, opening operation and closing operation is defined as: Among them, the grayscale image is f(x,y), the structural element is b, and the dilation operation is recorded as The erosion operation is recorded as After obtaining the black gap outline, the four structures inside the monomer are identified and the results are output in sequence.
2. A thermal battery assembly defect detection method according to claim 1, characterized in that: The specific steps of the highlight area recognition algorithm in step 3 are: S1: Convert the thermal battery stack area into a grayscale image and then perform normalization processing; S2: Determine the highlight area; because the highlight area of a single heater needs to be identified, the thresh threshold is calculated by gray*gray*gray to make the bright areas in the original image brighter, and the average value is taken as the threshold, and the mask is obtained by binarization; S3: Smooth transition of the mask area edge: Assuming light is 50, the mask area value of midrate is 1.5, the black area is 1, and the transition area is 1 to 1.5; the mask area of brightrate is 0.125, the black area is 0, and the transition area is 0 to 0.125; S4: Brighten the highlight area according to midrate and brightrate. For non-highlight areas, midrate is 1 and brightrate is 0, which means there is no change. For highlight areas, midrate is 1.5 and brightrate is 0.125, so the color values are increased, bringing a brightening effect. For edge areas, midrate and brightrate play a good transition role.
