Lithium battery integrated cover plate plug detection system based on machine vision

By using a machine vision-based inspection system that combines multi-angle image acquisition and multi-source quantitative scoring, the problem of traditional inspection equipment being unable to detect the three-dimensional features of lithium battery integrated cover plugs has been solved. This has enabled efficient plug inspection and quality assessment, improving the accuracy and reliability of the inspection.

CN122244000APending Publication Date: 2026-06-19BENGBU JINSHI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BENGBU JINSHI TECH CO LTD
Filing Date
2026-04-27
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Traditional testing equipment cannot effectively detect the three-dimensional features of lithium battery integrated cover plugs, resulting in a high rate of missed detection of three-dimensional defects. Furthermore, the defect judgment criteria are vague, making it difficult to distinguish between minor and serious defects.

Method used

A machine vision-based inspection system is adopted, which combines multi-angle image acquisition, image preprocessing and ROI extraction, two-dimensional appearance defect detection, three-dimensional pose detection and deep learning defect classification. Three-dimensional point cloud data is acquired through a line laser profilometer, and combined with a multi-source quantitative scoring and comprehensive judgment module, the plug can be fully inspected and quantitatively evaluated.

Benefits of technology

It enables comprehensive three-dimensional morphological evaluation of lithium battery integrated cover plugs, improves the detection rate of structural defects, scientifically distinguishes between minor flaws and fatal defects, generates intuitive inspection reports, and facilitates quality traceability and process optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244000A_ABST
    Figure CN122244000A_ABST
Patent Text Reader

Abstract

This invention discloses a machine vision-based lithium battery integrated cover plug inspection system. This invention relates to the field of visual defect detection technology, solving the technical problems of single detection dimension and vague defect judgment standards. By combining a line laser profilometer with a two-dimensional vision system, this invention utilizes two-dimensional vision to detect surface scratches, dimensions, and misalignments while simultaneously acquiring three-dimensional point cloud data using line laser scanning. Through statistical filtering, mesh mapping, and grayscale threshold segmentation, it accurately extracts the pin tip height, perpendicularity, and coplanarity, overcoming the bottleneck of traditional two-dimensional equipment's inability to detect height information. A multi-source quantitative scoring and comprehensive judgment module is established, independently scoring two-dimensional appearance, three-dimensional pose, and deep learning classification, and then weighted summing to obtain a comprehensive score. By introducing a position sensitivity coefficient and a severity coefficient, it can scientifically distinguish between minor flaws and fatal defects, avoiding misjudgments caused by a one-size-fits-all approach.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual defect detection technology, specifically a lithium battery integrated cover plug detection system based on machine vision. Background Technology

[0002] With the rapid development of the new energy vehicle industry, lithium battery integrated covers, as a key safety component of battery packs, are facing increasingly complex structures and stringent quality requirements. Integrated covers typically contain numerous metal connectors, which not only provide electrical connections but also directly affect the sealing and safety of the battery pack. Therefore, on the cover production line, rigorous inspection of the connectors' surface appearance, geometric dimensions, positional accuracy, and three-dimensional morphology is essential.

[0003] Traditional inspection equipment mostly uses two-dimensional vision systems, which can only detect surface scratches, stains or simple planar dimensions. They are not good at suppressing specular reflection interference on the surface of metal plugs, and cannot effectively detect three-dimensional features such as the protrusion height, perpendicularity and coplanarity of the pins, resulting in a high rate of missed detection of three-dimensional defects. Existing technologies often rely on manually setting simple thresholds for binary judgment of pass / fail, lacking quantitative assessment of defect severity and having a weak ability to distinguish between minor and serious defects, which can easily lead to misjudgment or missed judgment. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a machine vision-based lithium battery integrated cover plug inspection system, which solves the problems of single inspection dimension and vague defect judgment criteria.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a machine vision-based lithium battery integrated cover plug detection system, comprising: Multi-angle image acquisition module, used to acquire original images of the cover plate from multiple perspectives using an industrial camera; The image preprocessing and ROI extraction module is used to preprocess the original image to obtain a preprocessed image, and based on the standard template image, calculate the transformation matrix through feature matching to map the standard ROI boundary to the image to be detected, and crop out the independent image sub-region of each plug to obtain the ROI image. The 2D appearance defect detection module is used to perform 2D appearance defect detection on ROI images, including surface scratch and pit detection, size measurement, misalignment detection, and tilt and skew detection. The 3D pose detection module is used to perform 3D scanning of the plug area using a line laser profilometer to obtain 3D point cloud data. After preprocessing, dimensionality reduction and pin positioning, the pin extension length is calculated and compared with a preset difference to determine whether there is an anomaly. The deep learning defect classification module is used to build a convolutional neural network classification model, which takes the plug ROI image as input and outputs the defect category and probability. The multi-source quantization scoring and comprehensive judgment module is used to quantify and score the two-dimensional appearance detection results, three-dimensional pose detection results, and deep learning classification results respectively, and then calculate the comprehensive score by weighted summation. Based on the comprehensive score, the quality level is determined and an inspection report is generated.

[0006] As a further aspect of the present invention, the specific processing flow of the image preprocessing and ROI extraction module includes: The original image is subjected to median or Gaussian filtering to eliminate noise, and lens distortion is corrected according to the camera calibration parameters; A standard template image of the integrated cover plate is established, and the standard position areas and size information of each plug structure are marked. The scale-invariant feature transformation algorithm is used to extract the matching feature point pairs between the preprocessed image to be detected and the standard template image. The affine transformation matrix or perspective transformation matrix is ​​calculated, and the boundary coordinates of each plug standard ROI marked on the standard template image are mapped to the image to be detected to obtain the actual ROI boundary and crop the ROI image.

[0007] As a further aspect of the present invention, the processing method for surface scratch and pit detection by the two-dimensional appearance defect detection module includes: The plug ROI image to be detected is registered and aligned with the pre-stored standard defect-free template image. A pixel-by-pixel difference operation is performed to obtain a difference image. The difference image is binarized, and areas with grayscale differences exceeding a preset threshold are extracted as suspected defect areas. Morphological opening operations are used to remove isolated noise points, and morphological closing operations are used to close small holes to form continuous connected regions. The area of ​​each connected region, the aspect ratio of the bounding rectangle, the average gray-scale contrast of the pixels in the region, and the circularity or compactness of the region are calculated. If the area of ​​a connected region exceeds a preset area threshold and the aspect ratio is greater than a preset ratio, it is determined to be a scratch-type defect. If the area of ​​a connected region exceeds the area threshold and the aspect ratio is less than a preset ratio, it is determined to be a pit-type defect.

[0008] As a further aspect of the present invention, the processing method for dimensional measurement in the two-dimensional appearance defect detection module includes: The image is processed by grayscale conversion, grayscale enhancement and bilateral filtering for noise reduction, gradient magnitude and direction are calculated, edge pixels are extracted by dual threshold segmentation strategy, various geometric features of the plug are identified, closed contours are obtained by contour tracking algorithm, minimum bounding rectangle is calculated, and target contours representing the plug body contour and each pin contour are selected by preset geometric constraints. The length and width of the minimum bounding rectangle of the plug body contour are taken as the length and width of the plug body. The length and width of the minimum bounding rectangle of each pin contour are calculated as the pin length and width. The minimum distance between adjacent pin contours is calculated as the pin spacing. The projection deviation of the center point of each pin on the fitted line is calculated to obtain the pin arrangement consistency. The measured values ​​are compared with the preset standard size values ​​and tolerance ranges. If any size parameter exceeds the tolerance range, it is deemed unqualified.

[0009] As a further aspect of the present invention, the processing method of the two-dimensional appearance defect detection module for deviation detection includes: identifying reference features in the preprocessed image, including the center point of the positioning hole, the center point of the explosion-proof valve, or the corner point of the cover plate edge, and establishing a reference coordinate system of the cover plate image with the identified reference features as a reference. Transform the theoretical coordinates of the plug in the standard template image to the reference coordinate system to obtain the coordinates of the plug's theoretical position. In the plug's ROI image, use the center point of the smallest bounding rectangle to locate the center. Transform the plug's center coordinates from the ROI local coordinate system to the cover plate's reference coordinate system to obtain the coordinates of the plug's actual position. Calculate the offset between the actual position coordinates and the theoretical position coordinates of the plug. If the offset in both directions is within the tolerance range, it is considered qualified.

[0010] As a further aspect of the present invention, the two-dimensional appearance defect detection module includes the following processing methods for tilt and skew detection: In the plug ROI image, the center line of the long side of the smallest bounding rectangle of the plug outline is taken as the main axis. The standard axis is determined by the direction line of the long side of the smallest bounding rectangle of the plug outline in the standard template. The angle between the actual extracted main axis and the standard axis is calculated. If it exceeds the preset angle threshold, it is judged as skewed and unqualified.

[0011] As a further aspect of the present invention, the processing flow of the three-dimensional pose detection module includes: The line laser profilometer continuously collects the contour data of the plug area at a preset sampling frequency, and combines them to form three-dimensional point cloud data in the form of a two-dimensional matrix. Statistical filtering is used to remove outlier noise points, and a two-dimensional grid coordinate system corresponding to the scanning area is established. The height values ​​of all points falling into each grid cell are statistically analyzed and linearly mapped to the gray range of 0-255 to generate a two-dimensional grayscale image. In the generated grayscale image, the ROI region is used as prior information to limit the range. The pin tip region is extracted by grayscale threshold segmentation. Combined with morphological processing, the position coordinates of each pin are accurately determined. Extract the height value of the pin tip area and the height value of the reference plane, calculate the pin extension length, and compare it with the preset difference. If the height difference is greater than the preset difference, it indicates that there is an abnormality in the pin extension length.

[0012] As a further aspect of the present invention, the method for quantitatively scoring two-dimensional appearance inspection includes: For surface scratch and pit detection, all defects within a single plug ROI area are obtained, and a defect score is calculated for each defect. The defect score is calculated by weighting the normalized defect area, the normalized defect contrast, and the position sensitivity coefficient. For the scoring of dimensional measurement, the relative deviation between the measured value and the standard value is calculated. If the relative deviation is ≤1, full marks are awarded; otherwise, the score is reduced according to the formula. For the offset detection score, the Euclidean distance between the actual coordinates and the theoretical coordinates of the plug center is calculated. If it exceeds the maximum allowable offset, it is scored as 0 points. For tilt and skew detection scoring, the score is calculated based on the measured tilt angle and the maximum allowable tilt angle; Finally, a weighted formula is used to sum the scores of the above items to obtain the comprehensive score for the two-dimensional appearance inspection.

[0013] As a further aspect of the present invention, the method for quantifying and scoring three-dimensional pose detection includes: For the scoring of the protrusion length of the pin, a standard length and upper and lower tolerances are set. If the measured value exceeds the danger threshold, it will be scored as 0 points. If it exceeds the tolerance threshold but does not exceed the danger threshold, points will be deducted. If it is within the tolerance range, full marks will be awarded. For the pin perpendicularity score, the score is calculated based on the measured perpendicular angle and the maximum allowable perpendicular angle; For pin coplanarity scoring, the score is calculated based on the range of all pin tip heights and the maximum permissible coplanarity. Set the scoring weights for pin extension length and pin perpendicularity, perform weighted summation to obtain the score for a single pin, and then summarize to obtain the overall three-dimensional comprehensive score for the entire board.

[0014] As a further aspect of the present invention, the multi-source quantitative scoring and comprehensive judgment module generates the detection report in the following manner: The severity coefficient r is preset according to the defect type: r=0.2 for minor scratches, r=0.5 for obvious scratches, r=0.8 for deep dents, and r=1 for severely deformed pins. The deep learning classification score is calculated based on the probability output by the model and the preset severity coefficient. The total defect score is obtained by combining the scores from 2D appearance inspection, 3D inspection, and deep learning classification, and assigning different weights to each. A total score of ≥90 is considered excellent; a total score of 80-89 is considered good; a total score of 60-79 is considered acceptable; and a total score of less than 60 is considered unacceptable.

[0015] This invention provides a machine vision-based detection system for the integrated cover plug of a lithium battery. Compared with existing technologies, it has the following advantages: This invention combines a line laser profilometer with a two-dimensional vision system. While using two-dimensional vision to detect surface scratches, dimensions, and misalignments, it uses line laser scanning to acquire three-dimensional point cloud data. Through statistical filtering, mesh mapping, and grayscale threshold segmentation, it accurately extracts the tip height, perpendicularity, and coplanarity of the pin. This overcomes the bottleneck of traditional two-dimensional equipment being unable to detect height information, enabling a comprehensive assessment of the three-dimensional morphology of the pin and improving the detection rate of structural defects.

[0016] This invention establishes a multi-source quantitative scoring and comprehensive judgment module, which independently scores two-dimensional appearance, three-dimensional pose, and deep learning classification, and obtains a comprehensive score by weighted summation. By introducing position sensitivity coefficient and severity coefficient, it can scientifically distinguish between minor defects and fatal defects, avoiding misjudgments caused by a one-size-fits-all approach. The generated comprehensive score can intuitively reflect the overall quality level of the product, which is convenient for quality traceability and process optimization on the production line. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the lithium battery integrated cover plate plug detection system of the present invention; Figure 2 This is a flowchart illustrating the implementation of the lithium battery integrated cover plug detection system of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] First Embodiment Please see Figure 1 This application provides a machine vision-based lithium battery integrated cover plug detection system, and a multi-angle image acquisition module for acquiring multi-view original images of the cover through an industrial camera; The image preprocessing and ROI extraction module is used to preprocess the original image to obtain a preprocessed image, and based on the standard template image, calculate the transformation matrix through feature matching to map the standard ROI boundary to the image to be detected, and crop out the independent image sub-region of each plug to obtain the ROI image. The 2D appearance defect detection module is used to perform 2D appearance defect detection on ROI images, including surface scratch and pit detection, size measurement, misalignment detection, and tilt and skew detection. The 3D pose detection module is used to perform 3D scanning of the plug area using a line laser profilometer to obtain 3D point cloud data. After preprocessing, dimensionality reduction and pin positioning, the pin extension length is calculated and compared with a preset difference to determine whether there is an anomaly. The deep learning defect classification module is used to build a convolutional neural network classification model, which takes the plug ROI image as input and outputs the defect category and probability. The multi-source quantization scoring and comprehensive judgment module is used to quantify and score the two-dimensional appearance detection results, three-dimensional pose detection results, and deep learning classification results respectively, and then calculate the comprehensive score by weighted summation. Based on the comprehensive score, the quality level is determined and an inspection report is generated.

[0020] Second Embodiment As a second embodiment of the present invention, it is implemented based on the first embodiment, and the difference from the first embodiment is as follows: The multi-angle image acquisition module places the positioned lithium battery integrated cover plate on a rotatable inspection platform. The inspection platform is connected to the output shaft of a servo motor, which drives the inspection platform to rotate in steps at a preset angle. Multiple industrial cameras are fixedly installed in the space around the inspection platform. Each industrial camera is aimed at the integrated cover plate from a different azimuth angle, and the optical axes of each industrial camera converge at the central axis of the inspection platform.

[0021] When the inspection stage rotates the integrated cover plate to the first preset inspection position, all industrial cameras are triggered to synchronously acquire images once, obtaining the first set of raw images. Subsequently, the servo motor drives the inspection stage to rotate to the second preset inspection position, triggering all industrial cameras to synchronously acquire images again, obtaining the second set of raw images. The above rotation and synchronous acquisition process is repeated until the image acquisition of all preset inspection positions is completed, thereby achieving multi-angle full coverage of the plug structure in space, and finally obtaining multi-view raw images of the lithium battery integrated cover plate plug.

[0022] Preferably, the preset angle step value is 90° or 180°, and the number of multiple industrial cameras is at least two, preferably four, arranged in the front, back, left and right directions of the inspection stage. More preferably, the industrial cameras adopt telecentric lenses, and when acquiring images synchronously each time, multi-angle ring light source or coaxial light source is triggered to provide supplementary lighting to suppress specular reflection interference on the surface of the metal plug.

[0023] The image preprocessing and ROI extraction module first preprocesses the acquired raw images to obtain preprocessed images. Specifically, median filtering or Gaussian filtering is used to eliminate image noise, followed by histogram equalization to improve contrast. Next, lens distortion is corrected according to camera calibration parameters. Finally, images acquired by multiple cameras are registered and stitched together to form a complete image of the cover plate. Specifically, a feature point-based registration method is first used to extract common feature points in each image, and the homography transformation matrix between images is calculated. Then, the images are transformed to the same reference coordinate system according to the homography transformation matrix. Finally, a weighted average or multi-band fusion algorithm is used to fuse overlapping areas and stitch them together to form a complete image covering the entire integrated cover plate. The preprocessed image is input into the ROI extraction module to extract the plug region. A standard template image of the integrated cover plate is pre-established, and the standard position regions and size information of each plug structure are marked on the standard template image. The scale-invariant feature transformation algorithm is used to extract the matching feature point pairs between the preprocessed image to be detected and the standard template image. Based on the matching feature point pairs, the affine transformation matrix or perspective transformation matrix of the image to be detected relative to the standard template image is calculated. The boundary coordinates of the standard ROI of each plug marked on the standard template image are mapped to the image to be detected through the transformation matrix to obtain the actual ROI boundary of the corresponding plug in the image to be detected. Based on the mapped ROI boundary, the independent image sub-region of each plug is cropped from the image to be detected to obtain the ROI image.

[0024] The two-dimensional appearance defect detection module performs two-dimensional appearance defect detection on the obtained ROI image, specifically including surface scratch and pit detection, size measurement, misalignment detection, tilt and skew detection. For surface scratch and pit detection, the plug ROI image to be detected is registered and aligned with a pre-stored standard defect-free template image. Then, pixel-by-pixel difference operation is performed on the two registered images to obtain a difference image. The standard defect-free template image is obtained from the image acquisition and annotation of qualified cover plugs of the same model. The obtained difference image is binarized, and regions with gray-level differences exceeding a preset threshold are extracted as suspected defect regions. Then, morphological opening operations are used to remove isolated noise points, and morphological closing operations are used to close small holes within the defect regions, forming continuous connected regions. For each connected region, its area, the aspect ratio of its bounding rectangle, the average gray-level contrast of pixels within the region, and the roundness or compactness of the region are calculated. The average gray-level contrast is the difference between the average gray-level contrast and the average gray-level contrast of the surrounding normal region. These feature parameters are then compared with preset defect discrimination rules. If the area of ​​a connected region exceeds a preset area threshold and the aspect ratio is greater than a preset ratio, it is determined to be a scratch-type defect. If the area of ​​a connected region exceeds the area threshold and the aspect ratio is less than a preset ratio, it is determined to be a pit-type defect. For size measurement, the image is first converted to grayscale and enhanced to improve contrast. Then, bilateral filtering is used for noise reduction. Next, the gradient magnitude and direction of the image are calculated. Edges are thinned by non-maximum suppression. Finally, edge pixels are extracted using a dual threshold segmentation strategy. Then, the various geometric features of the plug are identified from the extracted edge contours. A contour tracking algorithm is used to obtain all closed contours. The minimum bounding rectangle of each contour is calculated. Target contours representing the plug body contour and each pin contour are selected by preset geometric constraints, such as the area range, aspect ratio, and convexity of the contours. Then, the length and width of the minimum bounding rectangle of the plug body contour are taken as the length and width of the plug body. The length and width of the minimum bounding rectangle of each pin contour are calculated as the pin length and width. The minimum distance between adjacent pin contours is calculated as the pin spacing. The projection deviation of the center point of each pin on the fitted line is calculated to obtain the pin arrangement consistency. Finally, the measured values ​​are compared with the preset standard size values ​​and tolerance ranges. If any size parameter exceeds the tolerance range and the specific value of the tolerance range is set by the operator, the size measurement item of the plug is determined to be unqualified, and the specific out-of-tolerance item and deviation value are recorded. For offset detection, the reference features on the cover plate are identified in the preprocessed image, specifically including the center point of the positioning hole, the center point of the explosion-proof valve, or the corner point of the cover plate edge. Then, the reference coordinate system of the cover plate image is established with the identified reference features as a reference. When multiple reference features are used, a right-hand rectangular coordinate system is established with the center point of the positioning hole as the origin and the line connecting the centers of the two positioning holes as the X-axis, or a coordinate system is established with the geometric center of the cover plate as the origin and the long side direction of the cover plate as the X-axis. The theoretical coordinate values ​​of the plug in the standard template image are transformed to this reference coordinate system to obtain the coordinate values ​​of the theoretical position of the plug. The center of the plug is located using the center point of the smallest bounding rectangle in the plug's ROI image. The plug's center coordinates are transformed from the ROI's local coordinate system to the cover plate's reference coordinate system to obtain the actual position coordinates of the plug. The offset between the actual and theoretical position coordinates of the plug is then calculated. If the offset in both directions is within the tolerance range, it is considered qualified. For tilt and skew detection, in the plug ROI image, the center line of the longest side of the smallest bounding rectangle of the plug contour is taken as the principal axis. The standard axis is determined by the direction line of the longest side of the smallest bounding rectangle of the plug contour in the standard template, and the angle between the actual extracted principal axis and the standard axis is calculated. ,like If the angle exceeds the preset threshold, it is judged as skewed and unqualified.

[0025] The three-dimensional pose detection module has a line laser profilometer fixedly installed above the detection platform. The laser line is perpendicular to the surface of the cover plate and passes through the center of the plug area. When the detection platform moves the cover plate at a constant speed in a preset direction, the line laser profilometer continuously collects the contour data of the plug area at a preset sampling frequency. Each collection obtains one contour line. Multiple contour lines are combined according to the step distance in the direction of movement to form a two-dimensional matrix of three-dimensional point cloud data of the plug area. Statistical filtering is used to remove outlier noise points. Specifically, the statistical filtering is performed by calculating the average distance between each point and its k neighboring points. If the distance exceeds a preset multiple of the global average distance, it is determined to be an outlier point and is removed. Next, a two-dimensional grid coordinate system corresponding to the scanning area is established. The grid resolution is consistent with the resolution of the point cloud in the x and y directions. For each grid cell, the height values ​​of all points falling into the cell are statistically analyzed, and the statistical values ​​are linearly mapped to the gray range of 0-255 to generate a two-dimensional grayscale image. The gray value of each pixel represents the height information of each corresponding position. Then, in the generated grayscale image, the ROI region is used as prior information to limit the range. Within the limited range, the pin tip region is extracted by grayscale thresholding, specifically representing the region where the gray value corresponds to the maximum height. Combined with morphological processing, the position coordinates of each pin are accurately determined. For the obtained pin, extract the height value of the pin tip area and the height value of the reference plane, calculate the pin extension length, and compare it with the preset difference. If the height difference is greater than the preset difference, it indicates that the extension length of the pin is abnormal.

[0026] The deep learning defect classification module constructs a convolutional neural network classification model to classify defects in plug ROI images. The convolutional neural network adopts a residual connection structure. The input of the model is the plug ROI image, and the output is the defect category and probability. The training dataset includes qualified plug images and plug images with multiple defective categories, with no less than 500 samples for each defect category. The dataset size is expanded through data augmentation techniques.

[0027] Third Embodiment As a third embodiment of the present invention, it is implemented based on the second embodiment, and the difference from the second embodiment is as follows: The multi-source quantitative scoring and comprehensive judgment module performs quantitative scoring on two-dimensional appearance inspection. It scores surface scratches and dents, acquiring all defects within a single plug's ROI area and denoting them as j, where j = 1, 2, ..., m, and m represents the number of defects. For each defect j, a defect score is calculated according to the formula... Obtain the defect score corresponding to defect j. ,in This represents the normalized defect area. This represents the normalized defect contrast. Represents the normalized position sensitivity coefficient. , and These are weighting coefficients, which can be calibrated experimentally, for example... =30, =20, =10, then according to the formula The total score of surface defects of a single plug was calculated. ,in Each defect has a weight, and in this embodiment, each defect has the same weight. In special cases, if the defect is located in a prohibited area, such as a scratch on the surface of the pin, it will be scored as 0 points. If there is no defect, it will be scored as 100 points. For size measurement scoring, obtain the plug's size parameter k, and set the standard value as [value missing]. The tolerance zone is At the same time, the measured values ​​were obtained. ,calculate relative deviation If relative deviation ≤1, then the score for a single item If relative deviation >1, then the score for a single item At the same time, according to the formula Calculate the overall score for dimensional measurement. , where K represents the number of dimensional parameters; For the offset detection score, obtain the actual coordinates of the plug center. and theoretical coordinates And calculate the Euclidean distance between them. And set the maximum allowed offset. According to the scoring formula The deviation detection score was calculated. ,like > ,but =0; For tilt and skew detection scoring, obtain the maximum allowable tilt angle. According to the scoring formula Obtain tilt and skew scores ; Based on the inspection scores obtained from the above analysis, a weighted summation formula is used. The weights of each item can be allocated according to the actual quality requirements, such as 40% for surface defects, 30% for dimensional measurement, 20% for misalignment, and 10% for tilting. The comprehensive score for two-dimensional appearance inspection is then calculated.

[0028] Quantization scoring is performed on both 3D pose detection and deep learning classification. 3D detection mainly includes pin extension length, pin perpendicularity, and pin array coplanarity. Each pin is scored individually, and then the scores are aggregated. Specifically, the scoring focuses on pin extension length, where the measured extension length of a single pin i is denoted as... The standard length is The lower tolerance is The upper tolerance is If the actual measured extension length Standard Length Then the deviation rate Conversely, if the actual measured extension length is... ≥Standard length Then the deviation rate If the actual measured extension length exist The length of the protruding pin is scored. If the length exceeds the tolerance threshold but does not exceed the danger threshold, the pin extension length will be scored. If the value exceeds the danger threshold, it will be directly judged as 0; For the pin perpendicularity scoring, the measured perpendicular angle is set. Maximum allowed vertical angle According to the formula For the pin coplanarity score, according to the formula ,in This represents the range of all pin tip heights. This indicates the maximum permissible coplanarity. Next, the weighting for the pin extension length is set to 0.7, and the weighting for the pin perpendicularity is set to 0.3. A weighted sum is then performed to obtain the score for a single pin. Simultaneously, according to the formula... The overall three-dimensional comprehensive score of the entire board was calculated. Where N is the total number of pins. ; Next, the deep learning classifications are quantitatively scored. A severity coefficient r is preset based on the defect type: r=0.2 for minor scratches, r=0.5 for obvious scratches, r=0.8 for deep dents, and r=1 for severely deformed pins. The scoring is then calculated according to the following formula. ,in The probability output by the model.

[0029] This module integrates the scores from 2D appearance inspection, 3D inspection, and deep learning classification, assigning different weights to each. These weights are allocated based on actual quality requirements; for example, 2D appearance has a weight of 40%, 3D inspection 49%, and deep learning classification 20%. A weighted sum is then used to obtain the total defect score, and a quality level is determined based on this score. A total score ≥ 90 is considered excellent, 80-89 is good, 60-79 is acceptable, and below 60 is unacceptable. An inspection report is generated for each cover plate, including: a unique identifier readable by RFID, detailed data and judgment results for each inspection item, defect location markings, a comprehensive score and quality level, inspection time, and inspection equipment number.

[0030] Fourth embodiment As a fourth embodiment of the present invention, the focus is on combining the implementation processes of all the above embodiments.

[0031] Some of the data in the above formulas are numerical calculations with dimensions removed, and the contents not described in detail in this specification are all prior art known to those skilled in the art.

[0032] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. A machine vision-based lithium battery integrated cover plug detection system, characterized in that, include: Multi-angle image acquisition module, used to acquire original images of the cover plate from multiple perspectives using an industrial camera; The image preprocessing and ROI extraction module is used to preprocess the original image to obtain a preprocessed image, and based on the standard template image, calculate the transformation matrix through feature matching to map the standard ROI boundary to the image to be detected, and crop out the independent image sub-region of each plug to obtain the ROI image. The 2D appearance defect detection module is used to perform 2D appearance defect detection on ROI images, including surface scratch and pit detection, size measurement, misalignment detection, and tilt and skew detection. The 3D pose detection module is used to perform 3D scanning of the plug area using a line laser profilometer to obtain 3D point cloud data. After preprocessing, dimensionality reduction and pin positioning, the pin extension length is calculated and compared with a preset difference to determine whether there is an anomaly. The deep learning defect classification module is used to build a convolutional neural network classification model, which takes the plug ROI image as input and outputs the defect category and probability. The multi-source quantization scoring and comprehensive judgment module is used to quantify and score the two-dimensional appearance detection results, three-dimensional pose detection results, and deep learning classification results respectively, and then calculate the comprehensive score by weighted summation. Based on the comprehensive score, the quality level is determined and an inspection report is generated.

2. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, The specific processing flow of the image preprocessing and ROI extraction module includes: The original image is subjected to median or Gaussian filtering to eliminate noise, and lens distortion is corrected according to the camera calibration parameters; A standard template image of the integrated cover plate is established, and the standard position areas and size information of each plug structure are marked. The scale-invariant feature transformation algorithm is used to extract the matching feature point pairs between the preprocessed image to be detected and the standard template image. The affine transformation matrix or perspective transformation matrix is ​​calculated, and the boundary coordinates of each plug standard ROI marked on the standard template image are mapped to the image to be detected to obtain the actual ROI boundary and crop the ROI image.

3. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, The two-dimensional appearance defect detection module handles surface scratches and dents using the following methods: The plug ROI image to be detected is registered and aligned with the pre-stored standard defect-free template image. A pixel-by-pixel difference operation is performed to obtain a difference image. The difference image is binarized, and areas with grayscale differences exceeding a preset threshold are extracted as suspected defect areas. Morphological opening operations are used to remove isolated noise points, and morphological closing operations are used to close small holes to form continuous connected regions. The area of ​​each connected region, the aspect ratio of the bounding rectangle, the average gray-scale contrast of the pixels in the region, and the circularity or compactness of the region are calculated. If the area of ​​a connected region exceeds a preset area threshold and the aspect ratio is greater than a preset ratio, it is determined to be a scratch-type defect. If the area of ​​a connected region exceeds the area threshold and the aspect ratio is less than a preset ratio, it is determined to be a pit-type defect.

4. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, The two-dimensional appearance defect detection module handles dimensional measurements using the following methods: The image is processed by grayscale conversion, grayscale enhancement and bilateral filtering for noise reduction, gradient magnitude and direction are calculated, edge pixels are extracted by dual threshold segmentation strategy, various geometric features of the plug are identified, closed contours are obtained by contour tracking algorithm, minimum bounding rectangle is calculated, and target contours representing the plug body contour and each pin contour are selected by preset geometric constraints. The length and width of the minimum bounding rectangle of the plug body contour are taken as the length and width of the plug body. The length and width of the minimum bounding rectangle of each pin contour are calculated as the pin length and width. The minimum distance between adjacent pin contours is calculated as the pin spacing. The projection deviation of the center point of each pin on the fitted line is calculated to obtain the pin arrangement consistency. The measured values ​​are compared with the preset standard size values ​​and tolerance ranges. If any size parameter exceeds the tolerance range, it is deemed unqualified.

5. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, The two-dimensional appearance defect detection module's processing method for offset detection includes: identifying reference features in the preprocessed image, including the center point of the positioning hole, the center point of the explosion-proof valve, or the corner point of the cover plate edge, and establishing a reference coordinate system for the cover plate image based on the identified reference features; Transform the theoretical coordinates of the plug in the standard template image to the reference coordinate system to obtain the coordinates of the plug's theoretical position. In the plug's ROI image, use the center point of the smallest bounding rectangle to locate the center. Transform the plug's center coordinates from the ROI local coordinate system to the cover plate's reference coordinate system to obtain the coordinates of the plug's actual position. Calculate the offset between the actual position coordinates and the theoretical position coordinates of the plug. If the offset in both directions is within the tolerance range, it is considered qualified.

6. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, The two-dimensional appearance defect detection module handles tilt and skew detection using the following methods: In the plug ROI image, the center line of the long side of the smallest bounding rectangle of the plug outline is taken as the main axis. The standard axis is determined by the direction line of the long side of the smallest bounding rectangle of the plug outline in the standard template. The angle between the actual extracted main axis and the standard axis is calculated. If it exceeds the preset angle threshold, it is judged as skewed and unqualified.

7. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, The processing flow of the 3D pose detection module includes: The line laser profilometer continuously collects the contour data of the plug area at a preset sampling frequency, and combines them to form three-dimensional point cloud data in the form of a two-dimensional matrix. Statistical filtering is used to remove outlier noise points, and a two-dimensional grid coordinate system corresponding to the scanning area is established. The height values ​​of all points falling into each grid cell are statistically analyzed and linearly mapped to the gray range of 0-255 to generate a two-dimensional grayscale image. In the generated grayscale image, the ROI region is used as prior information to limit the range. The pin tip region is extracted by grayscale threshold segmentation. Combined with morphological processing, the position coordinates of each pin are accurately determined. Extract the height value of the pin tip area and the height value of the reference plane, calculate the pin extension length, and compare it with the preset difference. If the height difference is greater than the preset difference, it indicates that there is an abnormality in the pin extension length.

8. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, Methods for quantifying and scoring two-dimensional appearance inspection include: For surface scratch and pit detection, all defects within a single plug ROI area are obtained, and a defect score is calculated for each defect. The defect score is calculated by weighting the normalized defect area, the normalized defect contrast, and the position sensitivity coefficient. For the scoring of dimensional measurement, the relative deviation between the measured value and the standard value is calculated. If the relative deviation is ≤1, full marks are awarded; otherwise, the score is reduced according to the formula. For the offset detection score, the Euclidean distance between the actual coordinates and the theoretical coordinates of the plug center is calculated. If it exceeds the maximum allowable offset, it is scored as 0 points. For tilt and skew detection scoring, the score is calculated based on the measured tilt angle and the maximum allowable tilt angle; Finally, a weighted formula is used to sum the scores of the above items to obtain the comprehensive score for the two-dimensional appearance inspection.

9. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, Methods for quantifying and scoring 3D pose detection include: For the scoring of the protrusion length of the pin, a standard length and upper and lower tolerances are set. If the measured value exceeds the danger threshold, it will be scored as 0 points. If it exceeds the tolerance threshold but does not exceed the danger threshold, points will be deducted. If it is within the tolerance range, full marks will be awarded. For the pin perpendicularity score, the score is calculated based on the measured perpendicular angle and the maximum allowable perpendicular angle; For pin coplanarity scoring, the score is calculated based on the range of all pin tip heights and the maximum permissible coplanarity. Set the scoring weights for pin extension length and pin perpendicularity, perform weighted summation to obtain the score for a single pin, and then summarize to obtain the overall three-dimensional comprehensive score for the entire board.

10. The lithium battery integrated cover plug detection system based on machine vision according to claim 1, characterized in that, The multi-source quantitative scoring and comprehensive judgment module generates the test report in the following way: The severity coefficient r is preset according to the defect type: r=0.2 for minor scratches, r=0.5 for obvious scratches, r=0.8 for deep dents, and r=1 for severely deformed pins. The deep learning classification score is calculated based on the probability output by the model and the preset severity coefficient. The total defect score is obtained by combining the scores from 2D appearance inspection, 3D inspection, and deep learning classification, and assigning different weights to each. A total score of ≥90 is considered excellent; a total score of 80-89 is considered good; a total score of 60-79 is considered acceptable; and a total score of less than 60 is considered unacceptable.