Cylindrical battery liquid injection hole positioning detection method and system based on labview and halcon
Through the joint development platform of Labview and Halcon, a lithium battery filling hole detection system was built, which achieved efficient and stable lithium battery filling hole detection, solved the problems of high development difficulty, high cost and single UI interface in the existing technology, and improved the detection accuracy and system maintainability.
Patent Information
- Application Number
- CN202211143658.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-09-20
AI Technical Summary
In the existing technology, the development of lithium battery filling hole detection systems is difficult and costly, the UI interface is simple and the detection effect is poor. The HALCON algorithm library image processing has high requirements for personnel and lacks a human-computer interaction interface. The joint development of LabVIEW graphical programming and HALCON is complex.
A CCD detection system was built using the joint development platform of Labview and Halcon. An industrial camera was used to capture images in real time to detect the center of the battery outer circle, the position of the injection hole, and the deflection angle. The motor rotation was controlled to achieve angle correction. Combined with Labview data processing and UI interface development, interface interaction and data interaction were quickly realized.
It improves the accuracy and stability of lithium battery filling hole detection, reduces manual detection costs, solves the problems of difficult development, high cost and single UI interface, and achieves efficient detection results and system maintainability.
Smart Images

Figure CN115511963B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine vision, and in particular to a method and system for detecting the positioning of a liquid filling hole of a cylindrical battery based on Labview and Halcon. Background Art
[0002] With the rapid development of machine vision technology, an increasing number of machine vision technologies and products are being applied in industries such as automotive, new energy, consumer electronics, and smart manufacturing. Due to its high precision, high speed, and high stability, machine vision inspection technology is widely used to replace manual inspection, reducing inspection costs and improving inspection efficiency. Due to the unique characteristics of the lithium battery industry, high-precision inspection of battery product dimensions has always been a challenge in visual inspection technology. Due to the diverse and complex, unpredictable appearance of battery products, as well as issues with hardware configuration and software inspection algorithms, CCD visual inspection systems can suffer from misjudgments. To prevent defective products from reaching end customers, the lithium battery industry currently primarily utilizes a multi-station approach of manual and machine inspection for visual inspection. To expedite the development and implementation of CCD inspection systems, selecting a suitable CCD software algorithm platform is crucial. Powerful visual algorithm processing software can effectively improve product inspection results, reduce misjudgment rates, increase software system development efficiency, and reduce labor costs. Conventional software development methods are not only time-consuming, but visual inspection algorithms can also lead to significant misjudgments due to inherent product characteristics. Therefore, selecting an efficient visual inspection algorithm software and interface development platform is crucial.
[0003] Technical solutions of existing technology:
[0004] Due to the differences in liquid filling equipment among battery manufacturers, each equipment manufacturer develops its own CCD inspection software for the liquid filling port, which generally meets the technical requirements. However, due to inherent product issues, the CCD inspection system often misjudgments, and maintenance personnel need to learn and familiarize themselves with various CCD inspection software, which hinders the widespread application of the software system. For the development and introduction of liquid filling equipment in new factories, the CCD inspection software is subject to manufacturer copyright restrictions and cost control, which also hinders the subsequent full-scale implementation. Therefore, the development of a universal CCD visual inspection system is particularly important. The existing invention patent application document "A method for detecting positive and negative poles of lithium battery modules based on halcon" with publication number CN109859186A includes the following steps: 1) using a camera to capture the initial image of the lithium battery module; extracting the image edges and marking them as Edges; 2) dividing the edges of the image into straight edges and circular edges; 3) selecting straight edges and circular edges according to the length value and convexity value, fitting arcs of a certain length, and generating multiple circular ROI areas; 4) extracting the center coordinates and radius of n batteries; 5) generating a circular ROI area with a radius of 2 / 3 at the center of the i-th circle, and performing threshold segmentation on the image within the ROI area; 6) obtaining the area of the extracted area. When the area of the extracted area is greater than the set value, it is the positive pole of the battery, otherwise it is the negative pole of the battery; and so on, until i=n. The prior art uses Halcon to detect the positive and negative poles of the lithium battery module, but it can be seen from the implementation content of the prior art that the prior art lacks the specific logic for setting the UI interactive page, resulting in a lack of human-computer interaction in the system. At the same time, the prior art is used to detect the positive and negative poles and is not suitable for smaller features such as injection holes. At the same time, since the prior art uses the Halcon algorithm, the development cost requirements are relatively high. The existing invention patent document "A method, device and storage medium for detecting color difference of solar cells" with publication number CN110400290A adjusts the vertical height and focal length of the shooting device to eliminate lens distortion and obtain the image to be detected; grayscales the image to be detected to obtain a corresponding grayscale value image; binarizes the grayscale value image, extracts the grayscale value area within the preset threshold range and fills the holes; opens the grayscale value area and narrows the domain to obtain the cell area to be detected and performs a cutout process to obtain a segmented image to be detected; takes the mean of the RGB channels of the segmented image to obtain the corresponding grayscale image and performs a smoothing filter process, calculates the peak value and grayscale spacing of the grayscale image, and determines whether there is color difference in the cell to be detected. This existing technology uses the grayscale histogram peak difference to perform intra-chip chromatic aberration detection. However, it can be seen from the embodiments of this existing solution that this solution requires manual adjustment of parameters such as the height and focal length of the shooting device, and the use of manual adjustment of the calibration plate to eliminate lens distortion, resulting in the image distortion and feature accuracy being affected by manual operation.At the same time, the existing technology does not fully consider the irregularity, missingness, occlusion, etc. of the edge shape of image features, which reduces the detection accuracy and the image feature detection and extraction effect.
[0005] Disadvantages of existing technology:
[0006] 1. The development of HALCON algorithm library image processing requires high personnel requirements, and requires certain theoretical knowledge of image processing algorithms and code programming skills;
[0007] 2. The HALCON image processing algorithm library lacks a human-computer interaction interface development module, and the UI interface requires development on other software platforms.
[0008] 3. LabVIEW graphical programming is different from traditional text programming, and joint development with HALCON requires a certain programming development foundation.
[0009] In summary, the existing technology has technical problems such as high development difficulty and cost, single UI interface and poor detection effect. Summary of the Invention
[0010] The technical problem to be solved by the present invention is how to solve the technical problems of the present invention such as high development difficulty and high cost, single UI interface and poor detection effect.
[0011] The present invention solves the above technical problems by adopting the following technical solutions: A cylindrical battery filling hole positioning detection method based on Labview and Halcon includes:
[0012] S1. Use Labview system development platform and Halcon image processing platform to build CCD detection system;
[0013] S2. Use the HALCON image processing platform and the industrial camera component interface to collect battery inspection images in real time. Based on the battery inspection images, the coordinates of the center of the battery outer circle, the position coordinates of the injection hole, and the deflection angle of the injection hole are detected. The preset motor rotation is controlled accordingly to achieve battery angle correction.
[0014] This invention is used to detect the angular position of the injection hole in lithium battery cells. It utilizes LabVIEW combined with HALCON's visual software system development approach, effectively improving software system development efficiency and reducing manual inspection costs. The invention utilizes HALCON to locate and inspect the injection hole. HALCON's powerful visual inspection algorithms can effectively perform various image processing on the target product, extract product features, and obtain the required inspection information, effectively improving the accuracy and stability of injection hole inspection and enhancing battery inspection results.
[0015] At the same time, the present invention develops and adopts Labview data processing and UI interface to quickly realize interface development and data interaction with PLC and other control equipment. The system has good detection effect and is easy to maintain, which is convenient for widespread promotion and use in the battery production process, and solves the problems of low development efficiency, high development cost, and poor maintainability of the software system in the existing CCD visual inspection system.
[0016] In a more specific technical solution, S21, obtaining the incoming battery position, and setting an outer circle search ROI area based on the position, wherein the outer circle search ROI area covers the fluctuation range of the outer circle edge of the measured battery, and narrows the outer circle detection range of the image to detect the coordinates of the center position of the outer circle of the battery;
[0017] S22. When the outer circle edge is not detected in step S21, locate the outer circle processing ROI area, where the outer circle processing ROI area covers the edge of the battery under test, and extract the outer circle features by grayscale processing of the image, based on which the coordinates of the outer circle center point are calculated;
[0018] S23, setting an injection hole search ROI region according to the outer circle center position coordinates, fitting two large circles and small circles with the same center but different radii using the outer circle center position coordinates, extracting an annular ROI detection region for the injection hole between the large circle and the small circle, and locating and obtaining the injection hole position coordinates using a template matching algorithm based on the annular ROI detection region for the injection hole;
[0019] S24. When the template matching algorithm fails to locate the position coordinates of the injection hole, the battery detection image is processed using Blob grayscale in the annular ROI detection area of the injection hole to extract the injection hole area coordinates, which are then processed to obtain the injection hole deflection angle to control the rotation of the preset motor, thereby achieving angle correction of the battery under test.
[0020] In a more specific technical solution, step S1 includes:
[0021] S11. Design and develop the host computer interface based on the Labview system development platform to display the collected image data and interact with the PLC control unit;
[0022] S12, using a PLC control unit to control a mechanical rotating mechanism in the CCD detection system;
[0023] S13. Use the Labview visual development platform to write the collected and calculated data into the local database for query.
[0024] The present invention designs and develops a host computer interface based on the Labview high-level language platform, displays the collected image data, communicates with control units such as PLC for data interaction, and the PLC controls the mechanical rotation mechanism. Labview is responsible for writing the collected and calculated data into a local file or database for easy query, thereby solving the problems of low development efficiency, high development cost, and poor maintainability of the CCD visual inspection system.
[0025] In a more specific technical solution, step S21 includes:
[0026] S211, using the HALCON outer circle contour point search operator to process the battery inspection image to find and obtain outer circle contour points;
[0027] S212, using the HALCON fitting operator to process the number of outer circle contour points, and fitting to obtain the outer circle of the battery;
[0028] S213. Calculate the outer circle of the battery using the HALCON outer circle processing operator to obtain the outer edge contour and center coordinates of the battery, and thereby obtain the center position coordinates of the outer circle of the battery.
[0029] In a more specific technical solution, HALCON outer circle contour point search operators include: get_metrology_object_measures operator, gen_cross_contour_xld operator and gen_contour_polygon_xld operator;
[0030] HALCON fitting operators include: gen_circle_contour_xld operator and gen_circle_contour_xld operator;
[0031] HALCON outer circle processing operators include: gen_cross_contour_xld operator and dev_disp_text operator.
[0032] In a more specific technical solution, step S22 includes:
[0033] S221, positioning the outer circle processing ROI circular area, and making the outer circle processing ROI circular area cover the edge of the battery;
[0034] S222, using a threshold operator to binarize the battery detection image to obtain a binary image, and using the HALCON center extraction operator to extract the central bright area and surrounding areas of the tested battery;
[0035] S223, using the fill_up operator to fill the middle area of the binary image to obtain a complete battery center circular area of the tested battery;
[0036] S224. Use the shape_trans operator of HALCON to convert the circular region in the center of the complete battery into a true circular region.
[0037] S225 , processing the true circular area to obtain and display the outer edge contour of the battery and the coordinates of the outer center point.
[0038] In a more specific technical solution, the HALCON center extraction operators include: connection operator and select_shape operator.
[0039] In a more specific technical solution, step S23 includes:
[0040] S231. Create a liquid injection hole template using the create_shape_model operator of HALCON, wherein the liquid injection hole template file includes: characteristic information such as the shape and edge of the liquid injection hole;
[0041] S232, using a real-time image acquisition operator to find the injection hole in the battery inspection image, and performing template matching using the injection hole template;
[0042] S233. When the template matching is successful, the center coordinates of the injection hole are calculated and displayed using a display operator, wherein the display operator includes: a read_shape_model operator, a get_shape_model_contours operator, and a find_shape_model operator. The find_shape_model operator searches the real-time battery inspection image for objects similar to the injection hole template based on the shape, size, and deformation degree of the injection hole.
[0043] The image acquisition and image processing algorithm module of the present invention is written by Halcon, and Halcon is used to call relevant operator functions to realize image acquisition and image processing of the target product, such as binarization, image enhancement, filtering, edge sharpening search, positioning recognition, etc. Image processing obtains feature information and data, thereby improving the algorithm accuracy and stability of the CCD visual inspection system.
[0044] In a more specific technical solution, step S24 includes:
[0045] S241, using a threshold operator to binarize the injection hole annular ROI detection area and extract dark areas with grayscale values close to the injection hole, thereby distinguishing the injection hole from the surrounding background area, wherein the dark areas are connected to form connected domains using a dark area connectivity operator;
[0046] S242, using the fill_up operator to fill the middle hole area of the injection hole to calculate the midpoint coordinates of the injection hole area;
[0047] S243, using the corrosion and expansion operator to process the battery inspection image to retain the original feature information of the injection hole;
[0048] S244, using the smallest_circle operator to calculate the minimum circumscribed circle of the injection hole area, and based on this, calculate and display the coordinates of the center of the minimum circumscribed circle;
[0049] S245. Use the angle_ll operator to calculate the coordinates of the center of the battery outer circle and the center of the injection hole to obtain the angle between the line connecting the two points and the horizontal line, and use this to obtain the deflection angle of the injection hole. The deflection angle of the injection hole includes: the deflection angle of the injection hole relative to the horizontal and the deflection angle of the injection hole relative to the vertical.
[0050] S246. Send the injection hole deflection angle data to the PLC control unit.
[0051] This invention uses Labview host software to directly call Halcon's hdev program via a .NET interface to obtain test result data. Labview processes and analyzes the acquired feature data and sends a signal to a PLC or other lower-level control device to control motor rotation to achieve battery angle correction. This reduces the error rate of existing CCD visual inspection software algorithms in battery filling port detection operations.
[0052] In a more specific technical solution, the dark area connectivity operator includes: a connection operator and a select_shape operator, which selects the injection hole area according to the area and shape of the connected domain;
[0053] Erosion and dilation operators include: erosion_circle operator and dilation_circle operator.
[0054] The present invention first uses LabVIEW to initialize relevant variables, establishes a communication connection with a PLC or other device, and waits for the PLC to trigger a detection signal after the connection is successful. After the visual system receives the PLC detection signal, LabVIEW calls the HALCON program, which performs image acquisition and image algorithm processing. After processing, the detection angle data is output to LabVIEW variables. LabVIEW then processes the detection angle data and sends it to a control unit such as a PLC for angle correction. This improves the accuracy and stability of battery filling port detection operations, can replace manual inspection, reduce labor costs, improve inspection efficiency, and prevent failure of the filling machine to fill due to inadequate battery angle correction.
[0055] In a more specific technical solution, the cylindrical battery filling hole positioning detection system based on Labview and Halcon includes:
[0056] Detection system construction module, used to build a CCD detection system using the Labview system development platform and the Halcon image processing platform;
[0057] The CCD detection system is used to use the HALCON image processing platform and the industrial camera component interface to collect battery detection images in real time, and detect the coordinates of the center position of the battery outer circle, the position coordinates of the injection hole, and the deflection angle of the injection hole based on the battery detection image to control the rotation of the preset motor, thereby realizing the angle correction of the tested battery. The battery information extraction module is connected to the detection system construction module.
[0058] The present invention has the following advantages over existing technologies: It is used to detect the angular position of the liquid injection hole in lithium battery cells. It utilizes a visual software system developed using LabVIEW and HALCON, effectively improving software system development efficiency and reducing manual inspection costs. The present invention utilizes HALCON to locate and inspect the liquid injection hole. HALCON's powerful visual inspection algorithms can effectively perform various image processing on target products, extract product features, and obtain the required inspection information. This effectively improves the accuracy and stability of liquid injection hole inspection, thereby enhancing battery inspection effectiveness.
[0059] At the same time, the present invention develops and adopts Labview data processing and UI interface to quickly realize interface development and data interaction with PLC and other control equipment. The system has good detection effect and is easy to maintain, which is convenient for widespread promotion and use in the battery production process, and solves the problems of low development efficiency, high development cost, and poor maintainability of the software system in the existing CCD visual inspection system.
[0060] The present invention designs and develops a host computer interface based on the Labview high-level language platform, displays the collected image data, communicates with control units such as PLC for data interaction, and the PLC controls the mechanical rotation mechanism. Labview is responsible for writing the collected and calculated data into a local file or database for easy query, thereby solving the problems of low development efficiency, high development cost, and poor maintainability of the CCD visual inspection system.
[0061] The image acquisition and image processing algorithm module of the present invention is written by Halcon, and Halcon is used to call relevant operator functions to realize image acquisition and image processing of the target product, such as binarization, image enhancement, filtering, edge sharpening search, positioning recognition, etc. Image processing obtains feature information and data, thereby improving the algorithm accuracy and stability of the CCD visual inspection system.
[0062] This invention uses Labview host software to directly call Halcon's hdev program via a .NET interface to obtain test result data. Labview processes and analyzes the acquired feature data and sends a signal to a PLC or other lower-level control device to control motor rotation to achieve battery angle correction. This reduces the error rate of existing CCD visual inspection software algorithms in battery filling port detection operations.
[0063] The present invention first uses LabVIEW to initialize relevant variables, establishes a communication connection with PLC and other devices, and waits for the PLC to trigger a detection signal after the connection is successful. After the visual system receives the PLC detection signal, LabVIEW calls the HALCON program, HALCON performs image acquisition and image algorithm processing, and outputs the detection angle data to the LabVIEW variable after processing. LabVIEW processes the detection angle data and sends it to the PLC and other control unit devices for angle correction. The accuracy and stability of the battery filling hole detection operation are improved, which can replace manual detection to reduce labor costs, improve detection efficiency, and prevent the battery angle from being incorrectly corrected, causing the filling machine to fail to inject. The present invention solves the technical problems existing in the prior art, such as high development difficulty and cost, single UI interface, and poor detection effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 Schematic diagram of the basic logical steps of the HALCON detection algorithm used in the cylindrical battery filling hole positioning detection method based on Labview and Halcon in Example 2 of the present invention;
[0065] Figure 2 1 is a schematic diagram of a detailed flow chart of a method for detecting the location of a cylindrical battery filling hole based on Labview and Halcon according to Example 2 of the present invention;
[0066] Figure 3 1 is a schematic diagram of the HALCON image processing logic flow of Example 2 of the present invention;
[0067] Figure 4 2 is a schematic diagram of the flow chart of liquid injection hole area detection in Example 2 of the present invention;
[0068] Figure 5 2 is a schematic diagram of a specific process of Blob morphological processing and analysis according to Example 2 of the present invention;
[0069] Figure 6 It is the main interface of the LabVIEW visual software system of embodiment 1 of the present invention;
[0070] Figure 7 This is the main interface of the HALCON image processing algorithm platform of Example 1 of the present invention;
[0071] Figure 8 1 is a schematic diagram of the outer circle detection algorithm 1-ROI detection area of Example 1 of the present invention;
[0072] Figure 9 1 is a schematic diagram of the XLD contour of the outer circle search point of the outer circle detection algorithm 1 of the embodiment 1 of the present invention;
[0073] Figure 10 1 is a schematic diagram of the outer circle detection algorithm 1-XLD contour and circle contour fitting according to embodiment 1 of the present invention;
[0074] Figure 11 The outer circle detection algorithm 1 of the embodiment 1 of the present invention is the fitting circle contour magnification Figure 1 Schematic diagram;
[0075] Figure 12 The outer circle detection algorithm 1 of the embodiment 1 of the present invention is the fitting circle contour magnification Figure 2 Schematic diagram;
[0076] Figure 13 1 is a schematic diagram of an outer circle edge contour of an outer circle detection algorithm 1 according to embodiment 1 of the present invention;
[0077] Figure 14 1 is a schematic diagram of the outer circle edge contour and center coordinates of the outer circle detection algorithm 1 of Example 1 of the present invention;
[0078] Figure 15 2 is a schematic diagram of the outer circle detection algorithm 2-ROI detection area of Example 1 of the present invention;
[0079] Figure 16 2 is a schematic diagram of binarization of an ROI region image in an outer circle detection algorithm according to embodiment 1 of the present invention;
[0080] Figure 17 2 is a schematic diagram of an enlarged image of the ROI region binarization of the outer circle detection algorithm according to embodiment 1 of the present invention;
[0081] Figure 18 2 is a schematic diagram of the outer circle detection algorithm 2-ROI region image connected domain and shape processing in Example 1 of the present invention;
[0082] Figure 19 2 is a schematic diagram of the outer circle detection algorithm 2-ROI area image filling process of Example 1 of the present invention;
[0083] Figure 20 2 is a schematic diagram of the outer circle detection algorithm 2-ROI region image shape conversion in Example 1 of the present invention;
[0084] Figure 21 2 is a schematic diagram of an enlarged view of the circumscribed circle of the ROI region in the outer circle detection algorithm of Example 1 of the present invention;
[0085] Figure 22 2 is a schematic diagram of the outer circle edge of the ROI region in the outer circle detection algorithm of Example 1 of the present invention;
[0086] Figure 23 2 is a schematic diagram of an enlarged view of the outer circle edge of the ROI region in the outer circle detection algorithm of Example 1 of the present invention;
[0087] Figure 24 2 is a schematic diagram of the outer circle edge and center coordinates of the ROI region in the outer circle detection algorithm of Example 1 of the present invention;
[0088] Figure 25 Schematic diagram of the injection hole detection algorithm 1-ROI detection area (the annular portion between the two circles) according to Example 1 of the present invention;
[0089] Figure 26 1 is a schematic diagram of an image of a ROI region of a liquid injection hole detection algorithm according to Example 1 of the present invention;
[0090] Figure 27 Schematic diagram of the injection hole detection algorithm 1-ROI region image template matching to locate the injection hole in Example 1 of the present invention;
[0091] Figure 28 1 is a schematic diagram of an enlarged view of the injection hole positioning center in the ROI region of the injection hole detection algorithm 1 of Example 1 of the present invention;
[0092] Figure 29 2 is a schematic diagram of the binarization of the ROI annular detection area image according to the liquid injection hole detection algorithm of Example 1 of the present invention;
[0093] Figure 30 2 is a schematic diagram of a binary enlarged view of the ROI annular detection area of the liquid injection hole detection algorithm according to Example 1 of the present invention;
[0094] Figure 31 2-ROI annular detection area image connected domain processing schematic diagram of the injection hole detection algorithm of Example 1 of the present invention;
[0095] Figure 32 2 is a schematic diagram of the image filling process of the ROI annular detection area of the liquid injection hole detection algorithm according to embodiment 1 of the present invention;
[0096] Figure 33 2 is a schematic diagram of image expansion processing of the ROI annular detection area of the injection hole detection algorithm according to Example 1 of the present invention;
[0097] Figure 34 2 is a schematic diagram of image corrosion processing of the ROI annular detection area of the injection hole detection algorithm according to Example 1 of the present invention;
[0098] Figure 35This is a schematic diagram of a cross mark on the center point of the liquid injection hole in an image according to the liquid injection hole detection algorithm 2 of Example 1 of the present invention;
[0099] Figure 36 This is an enlarged schematic diagram of the cross mark at the center of the liquid injection hole in the image according to the liquid injection hole detection algorithm 2 of Example 1 of the present invention;
[0100] Figure 37a 1 is a schematic diagram of calculating the deflection angle of the injection hole in Example 1 of the present invention;
[0101] Figure 37b Schematic diagram showing the deflection angle of the liquid injection hole in Example 1 of the present invention. DETAILED DESCRIPTION
[0102] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0103] Example 1
[0104] like Figure 1 As shown, the HALCON detection algorithm logic used in the cylindrical battery filling hole positioning detection method based on Labview and Halcon of the present invention includes the following basic steps:
[0105] S1, detect the center coordinates of the battery outer circle;
[0106] S2, detecting the position coordinates of the injection hole;
[0107] S3. Calculate the deflection angle of the liquid injection hole to accurately locate the deflection angle of the liquid injection hole.
[0108] like Figure 2 As shown, in this embodiment, the cylindrical battery filling hole positioning detection method based on Labview and Halcon provided by the present invention also includes the following development patent implementation detailed process:
[0109] S1', use LabVIEW high-level language to design the visual software system interface, including data image display, detection parameter setting, communication interaction, etc.;
[0110] S2', design and develop image processing algorithm modules based on the HALCON software algorithm platform, including image preprocessing, image enhancement, binarization, blob analysis, image corrosion and expansion, opening and closing operations, template matching, edge detection, etc., to extract the outer circle edge of the battery and the location of the injection hole and other feature information in the image;
[0111] S3', use LabVIEW control to call HALCON image acquisition and processing algorithm program based on .net interface to obtain the detection results of HALCON software image processing algorithm. LabVIEW will process the obtained data and transmit the detection angle and other results to PLC and other control devices for correction.
[0112] like Figure 3 As shown, the HALCON image processing logic in step S3' includes the following specific steps:
[0113] S31', after acquiring the image, first perform outer circle search to locate the outer circle center, set the outer circle detection ROI area, the ROI area slightly covers the outer circle edge, the outer circle detection algorithm uses the outer circle search tool, set the outer circle search tool related detection parameters for detection;
[0114] S32', in order to prevent misjudgment, after the outer circle search detection algorithm fails, Blob morphological processing is continued to be used to extract the center area of the cylindrical battery and fit the outer circle to detect the center position of the battery;
[0115] S33', when both of the outer circle center detection algorithms fail, the system detects NG and triggers the equipment line alarm;
[0116] S34', when the outer circle detection is successful, enter the injection hole area detection process;
[0117] like Figure 4 As shown, in this embodiment, step S34' includes the following specific steps:
[0118] S341', setting a ring-shaped ROI detection area for the injection hole according to the center of the outer circle; in this embodiment, the ring-shaped detection area helps to improve image processing efficiency and reduce the error rate of injection hole detection;
[0119] S342', the injection hole detection algorithm first uses the find_shape_model template matching algorithm in HALCON to create an injection hole template file;
[0120] S343', use the find_shape_model algorithm to match the template in the real-time image. If the template matching is successful, the coordinates of the center point of the liquid injection hole are output, and the deflection angle between the center point of the liquid injection hole and the center of the outer circle is calculated; in this embodiment, since the edge shape of the battery liquid injection hole may be irregular, missing, blocked, etc., positioning failure or positioning misjudgment may occur, so a Blob grayscale processing algorithm is added based on template matching.
[0121] S344', if the template matching positioning fails, use Blob morphological processing to analyze the annular area, extract the grayscale area of the injection hole, and calculate the position coordinates of the center point of the injection hole by fitting based on the grayscale area of the area;
[0122] like Figure 5 As shown, in this embodiment, step S344' further includes the following specific steps:
[0123] S3441', perform image binarization on the region;
[0124] S3442', after binarization, the graph is processed for connected domains to extract regions of appropriate size;
[0125] S3443', fill the area;
[0126] S3444', after filling, expansion corrosion is performed to repair the shape of the injection hole area;
[0127] S3445', perform minimum circumscribed circle fitting;
[0128] S3446', if the fitting is successful, the injection hole positioning detection is successful, and after the detection is successful, the deflection angle between the injection hole and the center of the outer circle is calculated;
[0129] S3447', the software system sends the final detection angle to PLC and other devices.
[0130] Example 2
[0131] In this embodiment, according to the workshop survey of the Lujiang Phase I and Phase II battery factories, before the liquid filling process of cylindrical batteries, the CCD hole correction system is crucial for the liquid filling of the liquid filling machine. Uncertainty in the position of the incoming material of the liquid filling hole will cause the liquid filling machine to be unable to fill or fail to fill. The liquid filling process needs to be carried out after the battery cell is assembled. Due to the different angles of the incoming material of the battery cells, the position of the battery liquid filling holes needs to be adjusted to the same direction manually or by machine to ensure that the liquid filling machine can successfully inject the electrolyte into a group of battery cells synchronously. At present, the battery position correction adopts the CCD visual positioning system + PLC control system, and the overall operating effect is good. Due to differences in the software algorithms of the CCD hole correction system of the liquid filling machine of the equipment manufacturer, the small size of the battery cell liquid filling hole, and the dirtiness of the battery surface, the visual inspection system sometimes makes misjudgments. The differences in the software system make personnel maintenance and upgrades relatively difficult, so it is particularly important to develop a universal CCD liquid filling hole positioning visual inspection system. According to the on-site visual inspection hardware design plan, the existing CCD visual system is modified and updated.
[0132] like Figure 6As shown, the cylindrical battery injection hole positioning detection method based on Labview and Halcon of the present invention adopts a cylindrical battery injection hole positioning detection system based on Labview and Halcon. The system main interface is developed and designed by Labview language. The main interface of the LabVIEW visual software system includes the coordinates of the center of the outer circle, the coordinates of the center of the injection hole, the deflection angle of the injection hole, the processed image display, the Log log record, the PLC communication parameter setting, etc., which meets the technical requirements of visual detection.
[0133] like Figure 7 As shown, in this embodiment, the visual inspection algorithm utilizes the mainstream HALCON algorithm platform. The HALCON image processing algorithm platform enables real-time image acquisition through an industrial camera component interface. It utilizes HALCON's extensive built-in image processing and detection algorithms to detect target area features within the image and extract the required information data. The HALCON software algorithm platform includes a menu bar, toolbar, image window, variable window, and code window, meeting nearly all functional requirements for image processing data.
[0134] Battery outer circle detection algorithm 1:
[0135] like Figure 8 As shown, in this embodiment, the ROI area for outer circle search is first set according to the incoming battery position. The ROI area covers the possible fluctuation range of the outer edge of the battery, and at the same time narrows the outer circle detection range of the image, effectively improving the detection efficiency and accuracy.
[0136] like Figure 9 As shown, in this embodiment, the outer circle contour points can be effectively found by using HALCON's get_metrology_object_measures, gen_cross_contour_xld, gen_contour_polygon_xld and other operators.
[0137] like Figure 10 As shown, the gen_circle_contour_xld and gen_circle_contour_xld operators can be used to fit an outer circle according to the number of contour points found.
[0138] like Figure 11 and Figure 12 As shown, in this embodiment, by zooming in to find and fit the outer circle contour edge, we found that the battery outer edge search accuracy is high, and the missing of local outer contour points does not affect the outer circle fitting result.
[0139] like Figure 13 and Figure 14As shown, in this embodiment, finally, the gen_cross_contour_xld, dev_disp_text and other operators calculate and display the outer circle contour and center coordinates of the battery.
[0140] Battery outer circle detection algorithm 2:
[0141] If the outer circle search algorithm does not detect the outer circle edge, we use image grayscale processing to extract the outer circle features and then calculate the coordinates of the outer circle center point.
[0142] like Figure 15 As shown, in this embodiment, the outer circle processing ROI circular area is first located, and the area needs to cover the edge of the battery in order to extract the complete battery image information.
[0143] like Figure 16 As shown, in this embodiment, the threshold operator is used to perform binarization processing on the image to extract the bright area in the center of the battery, and some areas around the battery are also extracted.
[0144] like Figure 17 、 Figure 18 and Figure 19 As shown in this example, by zooming in on the binary image, we can see that there are dark gaps around the outer edges of the battery. Using HALCON's connection and select_shape operators, we can effectively extract the center of the battery. Then, using the fill_up operator to fill the middle area of the image, we can obtain a relatively complete circular region in the center of the battery.
[0145] like Figures 20 to 24 As shown, in this example, the circular battery region obtained is not a true circle; only the red thread feature is close to a circle. Using HALCON's shape_trans operator, this region is converted into a true circle. A magnified view of the circular region shows that the circle's boundary almost coincides with the battery's outer edge, indicating a high degree of accuracy in locating the outer circle. Finally, the battery's outer edge contour and center coordinates are calculated and displayed, demonstrating good outer circle edge detection.
[0146] Battery filling hole detection algorithm 1:
[0147] like Figure 25 and Figure 26 As shown, in this embodiment, after the battery outer circle is detected, the outer circle center is used to set the injection hole to find the ROI area. The outer circle center is then used to fit two circles of different sizes with the same center and the same radius, and the annular image area between the two circles is extracted. Detecting the injection hole in the annular image area greatly improves detection efficiency and reduces the false positive rate.
[0148] like Figure 27 and Figure 28 As shown, in this embodiment, we first use HALCON's create_shape_model operator to create an injection hole template. The template file contains the shape and edge information of the injection hole. Then, during real-time image acquisition and processing, we use operators such as read_shape_model, get_shape_model_contours, and find_shape_model to search for the presence of the injection hole in the image for template matching. If the match is successful, the center coordinates of the injection hole are calculated and displayed. HALCON's template matching algorithm find_shape_model needs to search the real-time image for objects similar to the injection hole template based on the shape, size, and degree of deformation of the injection hole. Because the injection hole is sometimes affected by electrolyte contamination, the shape of the injection hole may become irregular, deformed, or the surface may be obstructed. In this case, the visual software will fail to match or make an incorrect match.
[0149] Battery filling hole detection algorithm 2:
[0150] like Figure 29 and Figure 30 As shown, in this embodiment, in order to further improve the stability of the visual inspection software algorithm, after the template matching algorithm fails to locate, we use Blob grayscale processing image in the annular ROI detection area of the injection hole to extract and calculate the coordinates of the injection hole area. First, the threshold operator is used to binarize the ROI area and extract the dark area with similar grayscale values to the injection hole, separating the injection hole from the surrounding background area, while also introducing interference from other dark areas.
[0151] like Figure 31 As shown, in this embodiment, after extraction, the dark area is formed into a connected domain using the connection and select_shape operators, and the injection hole area is separately screened out by selecting the area and shape.
[0152] like Figure 32 As shown, in this embodiment, the fill_up operator is used to fill the hole area in the middle of the injection hole, so as to calculate the coordinates of the midpoint of the injection hole area.
[0153] like Figure 33 and Figure 34 As shown, in this embodiment, in order to further remove the burr interference around the injection hole area, erosion_circle and dilation_circle are used to perform erosion and dilation processing on the image to eliminate the noise interference around the injection hole while retaining the original feature information of the injection hole.
[0154] like Figure 35 、 Figure 36 As shown, in this embodiment, the smallest_circle operator is finally used to calculate the minimum circumscribed circle of the injection hole area, and the center coordinates of the minimum circumscribed circle are calculated and displayed.
[0155] like Figure 37a and Figure 37b As shown, in this embodiment, using the coordinates of the battery's outer circle center and the injection hole's center, we can use the angle_ll operator to calculate the angle between the line connecting the two points and the horizontal line, thereby obtaining the injection hole's deflection angle relative to the horizontal or vertical direction. HALCON detects the injection hole angle, and LabVIEW software runs to obtain HALCON's execution results. This angle is then transmitted via Ethernet to a device such as a PLC to control motor rotation for correction, rotating the injection hole to the specified direction for injection. If the CCD vision system ultimately fails to locate the hole, an alarm is triggered, requiring manual intervention.
[0156] In summary, the present invention is used to detect the angular position of the injection hole of a lithium battery cell. This invention utilizes a visual software system developed using LabVIEW and HALCON, effectively improving software system development efficiency and reducing manual inspection costs. The present invention utilizes HALCON to locate and inspect the injection hole. HALCON's powerful visual inspection algorithms can effectively perform various image processing on the target product, extract product features, and obtain the required inspection information, effectively improving the accuracy and stability of injection hole inspection and enhancing battery inspection results.
[0157] At the same time, the present invention develops and adopts Labview data processing and UI interface to quickly realize interface development and data interaction with PLC and other control equipment. The system has good detection effect and is easy to maintain, which is convenient for widespread promotion and use in the battery production process, and solves the problems of low development efficiency, high development cost, and poor maintainability of the software system in the existing CCD visual inspection system.
[0158] The present invention designs and develops a host computer interface based on the Labview high-level language platform, displays the collected image data, communicates with control units such as PLC for data interaction, and the PLC controls the mechanical rotation mechanism. Labview is responsible for writing the collected and calculated data into a local file or database for easy query, thereby solving the problems of low development efficiency, high development cost, and poor maintainability of the CCD visual inspection system.
[0159] The image acquisition and image processing algorithm module of the present invention is written by Halcon, and Halcon is used to call relevant operator functions to realize image acquisition and image processing of the target product, such as binarization, image enhancement, filtering, edge sharpening search, positioning recognition, etc. Image processing obtains feature information and data, thereby improving the algorithm accuracy and stability of the CCD visual inspection system.
[0160] This invention uses Labview host software to directly call Halcon's hdev program via a .NET interface to obtain test result data. Labview processes and analyzes the acquired feature data and sends a signal to a PLC or other lower-level control device to control motor rotation to achieve battery angle correction. This reduces the error rate of existing CCD visual inspection software algorithms in battery filling port detection operations.
[0161] The present invention first uses LabVIEW to initialize relevant variables, establishes a communication connection with PLC and other devices, and waits for the PLC to trigger a detection signal after the connection is successful. After the visual system receives the PLC detection signal, LabVIEW calls the HALCON program, HALCON performs image acquisition and image algorithm processing, and outputs the detection angle data to the LabVIEW variable after processing. LabVIEW processes the detection angle data and sends it to the PLC and other control unit devices for angle correction. The accuracy and stability of the battery filling hole detection operation are improved, which can replace manual detection to reduce labor costs, improve detection efficiency, and prevent the battery angle from being incorrectly corrected, causing the filling machine to fail to inject. The present invention solves the technical problems existing in the prior art, such as high development difficulty and cost, single UI interface, and poor detection effect.
[0162] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A cylindrical battery filling hole positioning detection method based on Labview and Halcon, characterized in that: The method comprises: S1. Use Labview system development platform and Halcon image processing platform to build CCD detection system; S2. Use the HALCON image processing platform and the industrial camera component interface to collect battery inspection images in real time. Detect the coordinates of the center of the battery outer circle, the position coordinates of the injection hole, and the deflection angle of the injection hole based on the battery inspection image. Control the rotation of the preset motor accordingly to achieve angular correction of the tested battery. S2 also includes: S21. Obtain the incoming battery material location and set an outer circle search ROI area based on the location. The outer circle search ROI area covers the fluctuation range of the outer circle edge of the measured battery and narrows the outer circle detection range of the image to detect the coordinates of the center of the outer circle of the battery. S22. When the outer circle edge is not detected in step S21, locate the outer circle processing ROI area, where the outer circle processing ROI area covers the edge of the battery under test, extract the outer circle features through image grayscale processing, and calculate the coordinates of the outer circle center point based on the features; S23, setting an injection hole search ROI region according to the outer circle center position coordinates, fitting two large circles and small circles with the same center but different radii using the outer circle center position coordinates, extracting an annular ROI detection region for the injection hole between the large circle and the small circle, and locating and obtaining the injection hole position coordinates using a template matching algorithm based on the annular ROI detection region for the injection hole; S24. When the template matching algorithm fails to locate the injection hole position coordinates, the battery detection image is processed using Blob grayscale in the injection hole annular ROI detection area to extract the injection hole area coordinates, and the injection hole deflection angle is obtained based on the processing.
2. The method for detecting the location of the liquid filling hole of a cylindrical battery based on Labview and Halcon according to claim 1 is characterized in that: The step S1 comprises: S11. Design and develop a host computer interface based on the Labview system development platform to display the collected image data and interact with the PLC control unit; S12, using the PLC control unit to control the mechanical rotation mechanism in the CCD detection system; S13, using the Labview system development platform to write the collected and calculated data into a local database for query.
3. The method for detecting the location of the liquid filling hole of a cylindrical battery based on Labview and Halcon according to claim 1 is characterized in that: The step S21 includes: S211, using the HALCON outer circle contour point search operator to process the battery inspection image to search for and obtain outer circle contour points; S212, using the HALCON fitting operator to process the number of outer circle contour points, and fitting to obtain the outer circle of the battery; S213. Calculate the outer circle of the battery using the HALCON outer circle processing operator to obtain the outer edge contour and center coordinates of the battery, and thereby obtain the center position coordinates of the outer circle of the battery.
4. The method for detecting the location of the liquid filling hole of a cylindrical battery based on Labview and Halcon according to claim 3 is characterized in that: The HALCON outer circle contour point search operator includes: get_metrology_object_measures operator, gen_cross_contour_xld operator and gen_contour_polygon_xld operator; The HALCON fitting operators include: gen_circle_contour_xld operator and gen_circle_contour_xld operator; The HALCON outer circle processing operators include: gen_cross_contour_xld operator and dev_disp_text operator.
5. The method for detecting the location of the liquid filling hole of a cylindrical battery based on Labview and Halcon according to claim 1 is characterized in that: The step S22 includes: S221, positioning the outer circle processing ROI circular area so that the outer circle processing ROI circular area covers the edge of the battery; S222, binarizing the battery detection image using a threshold operator to obtain a binarized image, and extracting the central bright area and surrounding area of the tested battery using a HALCON center extraction operator; S223, using the fill_up operator to fill the middle area of the binary image to obtain a complete battery center circular area of the tested battery; S224, using the shape_trans operator of HALCON to convert the circular region in the center of the complete battery into a true circular region; S225 , processing the true circular area to obtain and display the outer circle edge contour of the battery and the coordinates of the outer circle center point.
6. The method for detecting the location of the liquid filling hole of a cylindrical battery based on Labview and Halcon according to claim 5 is characterized in that: The HALCON center extraction operator includes: a connection operator and a select_shape operator.
7. The method for detecting the location of the liquid filling hole of a cylindrical battery based on Labview and Halcon according to claim 1 is characterized in that: The step S23 includes: S231. Create a liquid injection hole template using the create_shape_model operator of HALCON, wherein the liquid injection hole template file includes: liquid injection hole shape and edge information; S232, using a real-time image acquisition operator to search for a liquid injection hole in the battery inspection image, and performing template matching using the liquid injection hole template; S233. When the template matching is successful, the center coordinates of the injection hole are calculated and displayed using a display operator, wherein the display operator includes: a read_shape_model operator, a get_shape_model_contours operator, and a find_shape_model operator. The find_shape_model operator searches the real-time battery inspection image for an object similar to the injection hole template based on the shape, size, and deformation degree of the injection hole.
8. The method for detecting the location of the liquid filling hole of a cylindrical battery based on Labview and Halcon according to claim 1 is characterized in that: The step S24 includes: S241, using a threshold operator to binarize the injection hole annular ROI detection area and extract dark areas with similar grayscale values to the injection hole, thereby distinguishing the injection hole from the surrounding background area, wherein the dark areas are connected to form a connected domain using a dark area connectivity operator, wherein the dark area connectivity operator includes a connection operator and a select_shape operator, and the injection hole area is selected based on the area and shape of the connected domain; S242, using the fill_up operator to fill the middle hole area of the injection hole to calculate the midpoint coordinates of the injection hole area; S243, using an erosion-dilation operator to process the battery inspection image to retain original feature information of the injection hole, wherein the erosion-dilation operator includes: an erosion_circle operator and a dilation_circle operator; S244, using the smallest_circle operator to calculate the smallest circumscribed circle of the injection hole area, and based on the smallest circumscribed circle, calculate and display the center coordinates of the smallest circumscribed circle; S245. Calculate the coordinates of the center of the battery outer circle and the center of the injection hole using the angle_ll operator to obtain the angle between the line connecting the two points and the horizontal line, and use this angle to obtain the deflection angle of the injection hole. The deflection angle of the injection hole includes a deflection angle of the injection hole relative to the horizontal and a deflection angle of the injection hole relative to the vertical. S246. Send the injection hole deflection angle data to the PLC control unit.
9. A cylindrical battery filling hole positioning detection system based on Labview and Halcon, used to execute the cylindrical battery filling hole positioning detection method based on Labview and Halcon according to any one of claims 1 to 8, characterized in that: The system comprises: Detection system construction module, used to build a CCD detection system using the Labview system development platform and the Halcon image processing platform; The CCD detection system is used to use the HALCON image processing platform to use the industrial camera component interface to collect battery detection images in real time, and detect the coordinates of the center position of the battery outer circle, the position coordinates of the injection hole, and the deflection angle of the injection hole based on the battery detection image, and control the rotation of the preset motor accordingly to achieve angular correction of the battery under test.
Citation Information
Patent Citations
Halcon-based lithium battery module positive and negative electrode detection method
CN109859186A
Solar cell chromatic aberration detection method and device and storage medium
CN110400290A