Visual guidance-based mirror welding method and system for vacuum cup and storage medium
By calibrating the galvanometer laser and camera, and using a circular differential caliper tool to precisely locate the welding point, the problems of long welding gap detection time and positioning deviation were solved, achieving efficient and accurate welding results, and reducing labor costs and occupational hazards.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BOKESHI (SUZHOU) TECH CO LTD
- Filing Date
- 2024-01-25
- Publication Date
- 2026-07-03
AI Technical Summary
The existing welding gap inspection time is too long, and the welding gap positioning is off-target, resulting in poor welding.
By correcting the galvanometer distortion and camera perspective of the galvanometer laser, and combining it with a circular differential caliper tool, the welding point is accurately located. Adaptive threshold binarization is used to reduce noise interference, thus achieving efficient detection and location of weld gaps.
While reducing computational complexity, it improves welding positioning accuracy, reduces the probability of welding failure, increases welding efficiency, reduces labor costs, and reduces hazards in laser-operated jobs.
Smart Images

Figure CN117798497B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of galvanometer welding technology, and in particular to a vision-guided galvanometer welding method, system, and storage medium for thermos cups. Background Technology
[0002] Traditional cup welding involves using lasers to fix and rotate the cup body, fusing the inner liner and outer wall together. This traditional method relies on a fixed rotating mold, requiring manual adjustments to the welding position for different sizes. Furthermore, it cannot memorize the original welding position, resulting in some scrapped products. The new galvanometer welding method first performs high-precision calibration on the galvanometer welding machine, then performs secondary calibration on the camera and galvanometer welding machine coordinate systems to establish high-precision calibration between the camera and the world coordinate system. Visual positioning then reads the different distribution patterns of weld seams for cups of different sizes, independently searching for weld seam locations within a designated area.
[0003] Martin A. Fischler et al. proposed an efficient data fitting method (RANSAC) that can estimate the best-fit model from a set of data, even when the data contains a large number of outliers. It works by first randomly selecting a small subset of samples from the dataset and then attempting to build a model based on these samples. Then, for each other point in the dataset, it is checked; if a point matches the model's prediction, it is considered an inlier; otherwise, it is considered an outlier. In each iteration, RANSAC attempts to find a model with the most inliers.
[0004] Satoshi Suzuki et al. proposed a method for contour extraction from binary images, using boundary tracking to perform topological analysis of digital binary images. This method effectively distinguishes objects from the background when processing digital images, especially in contour detection and recognition.
[0005] Geo.L. Pentti et al. proposed a process for translating, rotating, and scaling one image onto another. It uses the Random Access Scale (RANSAC) algorithm to find the most accurate homography transformation matrix and returns a floating-point matrix representing the transformation.
[0006] Nobuyuki Otsu proposed a simple and efficient algorithm for automatic image binarization. Assuming that the image contains only two levels, foreground and background, the algorithm segments the image into foreground and background by finding a threshold between gray levels.
[0007] Current technology for welding the inner liner and outer wall of thermos cups uses data fitting methods to correlate and locate the weld gap, which results in excessively long weld gap detection times. Furthermore, there are often certain tolerances between the inner liner and outer wall of actually manufactured thermos cups; using the fitting method can cause the weld gap location to deviate from the actual position, leading to poor welding. Summary of the Invention
[0008] This invention provides a vision-guided galvanometer welding method, system, and storage medium for thermos cups, to solve the technical problems of excessively long welding gap detection time and welding gap positioning deviation from the actual position, resulting in poor welding.
[0009] The technical solution provided by this invention is as follows:
[0010] One object of the present invention is to provide a vision-guided method for welding galvanometers of thermos cups, the method comprising the following steps:
[0011] S1. Perform galvanometer distortion correction on the galvanometer laser and camera perspective correction on the camera;
[0012] S2. Calculate the mapping matrix from the camera coordinate system of the camera to the galvanometer coordinate system of the galvanometer laser;
[0013] S3. Place the thermos cup in the working area of the galvanometer laser, and the camera captures an image of the thermos cup;
[0014] Using the mapping matrix described in step S2, the thermos cup image is transformed from the camera coordinate system to the galvanometer coordinate system;
[0015] S4. In the galvanometer coordinate system, extract the mouth area of the thermos cup from the image of the thermos cup, and calculate the center coordinates of the mouth area;
[0016] S5. Based on the center coordinates of the cup mouth area, place a circular differential caliper tool in the cup mouth area so that the circular differential caliper tool covers the circular welding gap area between the inner liner and the outer wall of the thermos cup.
[0017] The circular differential caliper tool includes multiple caliper areas, each of which divides the circular weld seam area of the thermos cup into a sub-region of the weld seam of the thermos cup.
[0018] S6. Rotate each caliper area of the circular differential caliper tool to align the sub-area of the thermos cup welding seam covered by each caliper area and splice them into a straight welding seam of the thermos cup.
[0019] S7. The galvanometer laser welds the circular weld seam between the inner liner and the outer wall of the thermos cup according to the straight weld seam of the thermos cup.
[0020] In a preferred embodiment, step S1 involves correcting the galvanometer distortion of the galvanometer laser, including the following steps:
[0021] S11. Drive the galvanometer laser to mark the galvanometer distortion correction calibration map, wherein the galvanometer distortion correction calibration map includes nine galvanometer distortion correction calibration points;
[0022] S12. Represent the nine galvanometer distortion correction calibration points in the galvanometer distortion correction calibration diagram as a two-dimensional vector;
[0023] S13. Combine the two-dimensional vectors representing the nine galvanometer distortion correction calibration points in step S12 into a first matrix, perform SVD decomposition on the first matrix, and generate the galvanometer distortion correction matrix.
[0024] S14. Using the galvanometer distortion correction matrix, perform galvanometer distortion correction on the galvanometer laser.
[0025] In a preferred embodiment, in step S1, the camera performs camera perspective correction, including the following method steps:
[0026] S15. Select nine second calibration points on the standard chessboard grid, take pictures of the nine second calibration points with the camera, and map the nine second calibration points to the camera coordinate system of the camera to generate a second nine-point calibration map.
[0027] S16. Represent the nine second calibration points in the second nine-point calibration diagram as two-dimensional vectors;
[0028] S17. Combine the two-dimensional vectors representing the nine second calibration points in step S16 into a second matrix, perform SVD decomposition on the second matrix, and generate a camera perspective correction matrix.
[0029] S18. Using the camera perspective correction matrix, perform camera perspective correction on the camera.
[0030] In a preferred embodiment, in step S2, the mapping matrix from the camera coordinate system to the galvanometer coordinate system of the galvanometer laser is calculated using the following method:
[0031] S21. Drive the galvanometer laser to mark the first nine-point calibration map, wherein the first nine-point calibration map includes nine first calibration points;
[0032] S22. The camera captures nine first calibration points, and performs perspective correction on the captured first nine-point calibration map according to the perspective correction matrix of the camera perspective correction, and extracts the coordinates of the nine first calibration points in the camera coordinate system in the perspective-corrected first nine-point calibration map.
[0033] S23. Map the coordinates of the nine first calibration points in the first nine-point calibration diagram in the galvanometer coordinate system to the coordinates of the nine first calibration points in the camera coordinate system in the first nine-point calibration diagram after perspective correction, to obtain a mapping matrix from the camera coordinate system of the camera to the galvanometer coordinate system of the galvanometer laser.
[0034] In a preferred embodiment, in step S22, the first nine-point calibration image after perspective correction is subjected to median filtering using a 5×5 kernel to remove some noise in the image.
[0035] The first nine-point calibration image after perspective correction is then subjected to adaptive threshold binarization.
[0036] In a preferred embodiment, in step S3, the thermos cup image captured by the camera is subjected to median filtering with a 5×5 kernel to remove some noise in the image, and the thermos cup image is subjected to adaptive threshold binarization processing.
[0037] In a preferred embodiment, the thermos cup image is subjected to adaptive threshold binarization processing using the following method:
[0038] Let TH be the grayscale threshold of the thermos cup image;
[0039] Pixels in the thermos image with gray values less than the gray value threshold TH are classified as first-class pixels C1; pixels in the thermos image with gray values greater than the gray value threshold TH are classified as second-class pixels C2.
[0040] Calculate the inter-class variance of pixel C1 (first class) and pixel C2 (second class):
[0041] σ 2 =p1p2(m1-m2) 2 ,
[0042] Where, σ 2 Let p1 be the inter-class variance of pixel C1 and pixel C2, p2 be the probability of being classified as pixel C1, p2 be the probability of being classified as pixel C2, m1 be the mean of pixel C1, and m2 be the mean of pixel C2.
[0043] The inter-class variance σ of the first class pixel C1 and the second class pixel C2 is selected. 2 The grayscale value of the thermos image corresponding to the maximum value is used as the grayscale threshold TH of the thermos image.
[0044] Another objective of this invention is to provide a vision-guided thermos cup galvanometer welding system, the thermos cup galvanometer welding system comprising: a camera, a galvanometer laser, and a ring light source;
[0045] The camera is connected to the galvanometer laser; the ring light source is arranged below the galvanometer laser and the camera;
[0046] The camera is used to capture images of the thermos cup.
[0047] The ring light source is used to provide a light source for the thermos cup placed in the working area of the galvanometer laser;
[0048] The galvanometer laser is used to weld the circular weld seam between the inner liner and the outer wall of the thermos cup according to the image of the thermos cup captured by the camera, based on a vision-guided galvanometer welding method for thermos cups provided by this invention.
[0049] Another object of the present invention is to provide a storage medium for storing computer execution instructions; the computer execution instructions are used to execute a vision-guided thermos cup galvanometer welding method provided by the present invention.
[0050] The above-described technical solution of the present invention has at least the following beneficial effects compared with the prior art:
[0051] This invention provides a vision-guided method, system, and storage medium for welding thermos cups using a galvanometer. It involves correcting galvanometer distortion in the galvanometer laser, performing camera perspective correction on the camera, and using an independent circular differential caliper tool to rotate and align the welding seam sub-region of the thermos cup to extract positioning points, thereby accurately locating the welding points. The thermos cup image undergoes adaptive threshold binarization processing, significantly reducing the probability of welding failures under high noise conditions. This greatly facilitates automated welding operations, reduces manual labor, and improves user efficiency.
[0052] This invention provides a vision-guided galvanometer welding method, system, and storage medium for thermos cups. With lower computational complexity, it can achieve higher welding positioning accuracy, effectively improve welding efficiency, reduce scrap rate during model changes, lower labor costs, and reduce hazards associated with laser operations. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a schematic diagram of the structure of a vision-guided thermos cup galvanometer welding system according to the present invention.
[0055] Figure 2 This is a flowchart of a vision-guided welding method for thermos cups using a galvanometer, according to the present invention.
[0056] Figure 3 This is a schematic diagram of the galvanometer distortion correction calibration diagram marked in this invention.
[0057] Figure 4 This is a schematic diagram of the second nine-point calibration map generated by the camera of this invention.
[0058] Figure 5 This is a schematic diagram of the mouth area of a thermos cup before and after perspective correction by the camera according to the present invention.
[0059] Figure 6 This is a schematic diagram of the nine first calibration points in the first nine-point calibration diagram taken before and after perspective correction of the camera in this invention.
[0060] Figure 7 This is a schematic diagram illustrating the extraction of the rim area of a thermos cup from an image using a galvanometer coordinate system, according to the present invention.
[0061] Figure 8 This is a schematic diagram showing how each caliper area of the present invention covers the weld seam sub-area of the thermos cup, which is rotated and aligned to form a straight weld seam of the thermos cup. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0063] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms “first,” “second,” and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an,” “a,” or “the,” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising,” “including,” or “including,” and similar terms mean that the element or object preceding the word encompasses the element or object listed following the word and its equivalents, without excluding other elements or objects. The terms “connected,” “linked,” or “connected,” and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0064] It should be noted that the terms "up", "down", "left", "right", "front", and "back" used in this invention are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0065] like Figure 1 As shown, according to an embodiment of the present invention, a vision-guided galvanometer welding system for thermos cups is provided, comprising: a camera 200, a galvanometer laser 100, and a ring light source 300. The camera 200 is connected to the galvanometer laser 100, and the ring light source 300 is arranged below the galvanometer laser 100 and the camera 200.
[0066] Camera 200 is used to capture images of the thermos cup B. Ring light source 300 is used to provide light to the thermos cup B, which is placed in the working area of the galvanometer laser 100.
[0067] A galvanometer laser 100 is used to weld the circular weld seam between the inner liner and the outer wall of a thermos cup according to a vision-guided galvanometer welding method for thermos cups, as described in this invention. This vision-guided galvanometer welding method for thermos cups is described in detail below.
[0068] Definition: Galvanometer welding utilizes the reflection and refraction of a galvanometer laser 100 to focus the laser beam at a single point after adjustment, thus achieving the welding purpose.
[0069] In this embodiment, the camera 200 is a 20-megapixel color industrial camera with a high-definition industrial lens, and the ring light source 300 provides a light source for the thermos cup B placed in the working area of the galvanometer laser 100, so that the circular welding gap (detection area) of the thermos cup is uniformly illuminated to highlight the positioning features.
[0070] like Figure 2 As shown in the embodiment of the present invention, a vision-guided galvanometer welding method for thermos cups is provided, comprising the following steps:
[0071] Step S1: Perform galvanometer distortion correction on the galvanometer laser 100 and camera perspective correction on the camera 200.
[0072] According to an embodiment of the present invention, galvanometer distortion correction of the galvanometer laser 100 includes the following steps:
[0073] Step S11: Drive the galvanometer laser 100 and mark the galvanometer distortion correction calibration map, wherein the galvanometer distortion correction calibration map includes nine galvanometer distortion correction calibration points.
[0074] like Figure 3As shown, the galvanometer laser 100 is driven by a galvanometer. The nine galvanometer distortion correction calibration points in the calibrated galvanometer distortion correction calibration diagram are the four corner points of the grid, the four points where the cross coordinate system intersects the grid, and the center point of the cross coordinate system. The nine galvanometer distortion correction calibration points in the calibrated galvanometer distortion correction calibration diagram are as follows: Figure 3 As shown.
[0075] Step S12: Represent the nine galvanometer distortion correction calibration points in the galvanometer distortion correction calibration diagram as two-dimensional vectors.
[0076] Step S13: Combine the two-dimensional vectors representing the nine galvanometer distortion correction calibration points in step S12 into a first matrix, perform SVD decomposition on the first matrix, and generate the galvanometer distortion correction matrix.
[0077] Specifically, SVD decomposition is a linear algebra technique that decomposes a matrix into the product of three matrices. This invention uses SVD decomposition to decompose the first matrix, composed of two-dimensional vectors combining nine galvanometer distortion correction calibration points, into three matrices: matrix U, matrix S, and matrix V.
[0078] Transpose matrix V. The first row and first column of the transposed matrix V form a 3×3 matrix. Then set the determinant of the 3×3 matrix to a positive number to ensure the stability of the matrix. The resulting 3×3 matrix is the galvanometer distortion correction matrix.
[0079] Step S14: Use the galvanometer distortion correction matrix to correct the galvanometer distortion of the galvanometer laser.
[0080] Specifically, the galvanometer distortion correction matrix is loaded into the intrinsic parameters of the galvanometer laser 100 to eliminate the calibration distortion error of the galvanometer laser 100, thereby performing galvanometer distortion correction on the galvanometer laser 100.
[0081] According to an embodiment of the present invention, camera perspective correction includes the following method steps:
[0082] Step S15: Select nine second calibration points on the standard chessboard grid, take pictures of the nine second calibration points with camera 200, and map the nine second calibration points to the camera coordinate system of camera 200 to generate the second nine-point calibration map.
[0083] like Figure 4 As shown, camera 200 captures nine second calibration points and maps these nine points to the camera coordinate system of camera 200, generating a second nine-point calibration map. The nine second calibration points in the second nine-point calibration map are denoted as b1, b2, b3, b4, b5, b6, b7, b8, and b9, respectively. Figure 4 As shown.
[0084] Step S16: Represent the nine second calibration points (b1, b2, b3, b4, b5, b6, b7, b8, b9) in the second nine-point calibration diagram as two-dimensional vectors.
[0085] Step S17: Combine the two-dimensional vectors representing the nine second calibration points (b1, b2, b3, b4, b5, b6, b7, b8, b9) from step S16 into a second matrix, perform SVD decomposition on the second matrix, and generate a camera perspective correction matrix.
[0086] Specifically, the method for generating the camera perspective correction matrix by performing SVD decomposition on the second matrix is the same as the method for generating the galvanometer distortion correction matrix by performing SVD decomposition on the first matrix in step S13, and will not be repeated here.
[0087] Step S18: Perform camera perspective correction on camera 200 using the camera perspective correction matrix.
[0088] Specifically, the camera perspective correction matrix is loaded into the intrinsic parameters of camera 200 to perform camera perspective correction on camera 200.
[0089] After performing camera perspective correction on the camera 200, the camera 200 can perform perspective transformation on the thermos cup B image to compensate for errors caused by the rangefinder assembly or coaxial assembly, correct the thermos cup image from distorted image to the original image, and ensure that the circular differential caliper tool correctly extracts the cup mouth area of the thermos cup B.
[0090] like Figure 5 As shown in one embodiment, this is a schematic diagram of the mouth area of a thermos cup before and after perspective correction by the camera of the present invention. Figure 5 (a) is an image of the mouth area of thermos cup B taken by camera 200 before camera perspective correction; Figure 5 (b) is the image of the mouth area of the thermos cup B taken by camera 200 after perspective correction.
[0091] Step S2: Calculate the mapping matrix from the camera coordinate system of camera 200 to the galvanometer coordinate system of galvanometer laser 100.
[0092] According to an embodiment of the present invention, the mapping matrix from the camera coordinate system to the galvanometer coordinate system of the galvanometer laser is calculated by the following method:
[0093] Step S21: Drive the galvanometer laser 100 to mark the first nine-point calibration map, wherein the first nine-point calibration map includes nine first calibration points. The nine first calibration points in the marked first nine-point calibration map are as follows: Figure 6 As shown in (c).
[0094] Step S22: Camera 200 captures nine first calibration points. Based on the perspective correction matrix of camera 200 (the perspective correction matrix obtained in step S18), the captured first nine-point calibration map is perspective corrected. The coordinates of the nine first calibration points in the camera coordinate system are extracted from the perspective-corrected first nine-point calibration map.
[0095] In a preferred embodiment, the first nine-point calibration image after perspective correction is subjected to median filtering using a 5×5 kernel to remove some noise in the image, and adaptive threshold binarization is performed on the first nine-point calibration image after perspective correction.
[0096] Step S23: Map the coordinates of the nine first calibration points in the first nine-point calibration diagram in the galvanometer coordinate system to the coordinates of the nine first calibration points in the camera coordinate system after perspective correction, to obtain the mapping matrix from the camera coordinate system of camera 200 to the galvanometer coordinate system of galvanometer laser 100.
[0097] like Figure 6 As shown, Figure 6 (c) shows the nine first calibration points in the first nine-point calibration diagram before perspective correction. Figure 6 (d) shows the nine first calibration points in the first nine-point calibration diagram after perspective correction.
[0098] The coordinates of the nine first calibration points in the galvanometer coordinate system are mapped one by one with the coordinates of the nine first calibration points in the camera coordinate system in the first nine-point calibration diagram after perspective correction, so as to obtain the mapping matrix from the camera coordinate system of camera 200 to the galvanometer coordinate system of galvanometer laser 100.
[0099] Step S3: Place the thermos cup B in the working area of the galvanometer laser 100, and the camera 200 takes a picture of the thermos cup B.
[0100] Using the mapping matrix in step S2, the image of thermos cup B is transformed from the camera coordinate system to the galvanometer coordinate system.
[0101] According to an embodiment of the present invention, the thermos cup image B captured by the camera is subjected to median filtering with a 5×5 kernel to remove some noise in the image, and the thermos cup image is subjected to adaptive threshold binarization processing.
[0102] Furthermore, the thermos cup image is subjected to adaptive threshold binarization processing using the following method:
[0103] Let TH be the grayscale threshold of the thermos cup image.
[0104] Pixels in the thermos image with gray values less than the gray value threshold TH are classified as first-class pixels C1; pixels with gray values greater than the gray value threshold TH are classified as second-class pixels C2.
[0105] The mean of the first type of pixel C1 is m1, the mean of the second type of pixel C2 is m2, and the global mean of the thermos cup image is mG. Then:
[0106] p1*m1+p2*m2=mG,
[0107] p1 + p2 = 1,
[0108] Where p1 is the probability of classifying a pixel as the first class C1, and p2 is the probability of classifying a pixel as the second class C2.
[0109] Calculate the inter-class variance of pixel C1 (first class) and pixel C2 (second class):
[0110] σ 2 =p1p2(m1-m2) 2 ,
[0111] Where, σ 2 Let p1 be the inter-class variance of pixel C1 and pixel C2, p2 be the probability of being classified as pixel C1, p2 be the probability of being classified as pixel C2, m1 be the mean of pixel C1, and m2 be the mean of pixel C2.
[0112] The inter-class variance σ of the first class pixel C1 and the second class pixel C2 is selected. 2 The grayscale value of the thermos image corresponding to the maximum value is used as the grayscale threshold TH of the thermos image.
[0113] Step S4: In the galvanometer coordinate system, extract the rim area of the thermos cup from the image of the thermos cup, and calculate the center coordinates of the rim area.
[0114] like Figure 7 As shown, in the rim area of the extracted thermos cup B, the area between the inner liner B1 and the outer wall B2 of the thermos cup is the circular welded seam area H.
[0115] In a preferred embodiment, a closed region operation with a kernel size of 3×3 is performed on the cup mouth area of the extracted thermos cup B to eliminate noise in small areas while ensuring the integrity of the cup mouth area. The cup mouth area is then selected by the effective area and aspect ratio.
[0116] Furthermore, by using the rectangular frame J circumscribed around the mouth area of the thermos cup B, the center coordinates of the mouth area of the thermos cup B are calculated, that is, the coordinates of the center point Z are calculated.
[0117] Step S5: Based on the center coordinates of the cup rim area, place a circular differential caliper tool in the cup rim area so that the caliper tool covers the circular welding gap area between the inner liner and the outer wall of the thermos.
[0118] Specifically, such as Figure 8 As shown, by aligning the center coordinates (coordinates of center point Z) of the cup rim area with the center coordinates of the circular differential caliper tool K, the circular differential caliper tool K is placed in the cup rim area, so that the circular differential caliper tool K covers the circular welding gap area H between the inner liner B1 and the outer wall B2 of the thermos cup.
[0119] According to an embodiment of the present invention, the circular differential caliper tool K includes multiple caliper regions K1, each caliper region K1 dividing the circular weld seam region H of the thermos cup into a weld seam sub-region H1 of the thermos cup.
[0120] Step S6: Rotate each caliper area K1 of the circular differential caliper tool K to align the welding seam sub-area H1 of the thermos cup covered by each caliper area K1 and splice them together to form a straight welding seam L of the thermos cup.
[0121] Specifically, in a single algorithm process of rotating and aligning a caliper area K1 to correspond to a thermos cup welding seam sub-region H1, the remaining caliper areas K1 are filled, the corresponding thermos cup welding seam sub-region H1 is extracted using the four corner points of the caliper area K1, and the thermos cup welding seam sub-region H1 is rotated and aligned.
[0122] Repeat the above process, rotate and align the welding seam sub-area H1 of the thermos cup covered by each caliper area K1, and splice them together to form a straight welding seam L of the thermos cup.
[0123] By rotating each caliper area K1 of the circular differential caliper tool K, the welding seam sub-area H1 covered by each caliper area K1 of the thermos cup is rotated, aligned, and spliced into a straight welding seam L of the thermos cup. The original circular welding seam area H of the thermos cup can be flattened into a straight welding seam L of the thermos cup for the purpose of rejection and correction.
[0124] Step S7: The galvanometer laser 100 welds the circular weld gap H between the inner liner B1 and the outer wall B2 of the thermos cup according to the straight weld gap L of the thermos cup.
[0125] Specifically, each welding seam sub-region H1 of the thermos cup with a straight welding seam L is traversed sequentially. The thermos cup welding seam sub-region H1 with a gray value of 0 is searched. Based on the prior knowledge of the placement of the circular differential caliper tool K, it is determined whether the thermos cup welding seam sub-region H1 is a welding seam. If not, the search continues. If it is, the position of the thermos cup welding seam sub-region H1 is recorded.
[0126] When traversing the next thermos cup welding seam sub-region H1, the position of the next thermos cup welding seam sub-region H1 is compared with the position of the previous thermos cup welding seam sub-region H1. If the position difference is greater than a certain preset value, the next thermos cup welding seam sub-region H1 is identified as an abnormal search point, and the next thermos cup welding seam sub-region H1 is corrected for abnormality.
[0127] This process continues until all the weld seam sub-regions H1 of the thermos cup are output as welding positioning points. The galvanometer laser 100 connects all the welding positioning points to form a welding trajectory, and welds the circular weld seam H between the inner liner B1 and the outer wall B2 of the thermos cup.
[0128] This invention uses a circular differential caliper tool to flatten the circular weld seam region H of a thermos cup into a straight weld seam L. It then traverses the weld seam sub-regions H1 of the straight weld seam L and performs contextual rejection screening to search for weld positioning points. This improves the accuracy of weld seam search without increasing parameter complexity, thanks to the block search structure and homography transformation-like line scan visualization, which significantly reduces the amount of irrelevant data involved in the calculation.
[0129] Finally, the galvanometer laser 100 connects all the welding positioning points to form a welding trajectory for galvanometer welding. This invention improves the accuracy of weld identification under noise interference, shortens visual analysis time, and enhances the real-time performance of the algorithm.
[0130] According to an embodiment of the present invention, a storage medium is provided for storing computer-executable instructions. The computer executes the instructions to perform a vision-guided galvanometer welding method for thermos cups provided by the present invention.
[0131] The following points need to be explained:
[0132] (1) The accompanying drawings of the embodiments of the present invention only involve the structures involved in the embodiments of the present invention. Other structures can refer to the general design.
[0133] (2) For clarity, the thickness of layers or regions is enlarged or reduced in the drawings used to describe embodiments of the present invention; that is, these drawings are not drawn to actual scale. It is understood that when an element such as a layer, film, region, or substrate is referred to as being “above” or “below” another element, the element may be “directly” located “above” or “below” the other element, or there may be intermediate elements.
[0134] (3) Where there is no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other to obtain new embodiments.
[0135] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A visual guidance based mirror welding method for a vacuum cup, characterized in that, The welding method for the thermos cup galvanometer includes the following steps: S1. Perform galvanometer distortion correction on the galvanometer laser and camera perspective correction on the camera; S2. Calculate the mapping matrix from the camera coordinate system of the camera to the galvanometer coordinate system of the galvanometer laser; S3. Place the thermos cup in the working area of the galvanometer laser, and the camera captures an image of the thermos cup; Using the mapping matrix described in step S2, the thermos cup image is transformed from the camera coordinate system to the galvanometer coordinate system; S4. In the galvanometer coordinate system, extract the mouth area of the thermos cup from the image of the thermos cup, and calculate the center coordinates of the mouth area; S5. Based on the center coordinates of the cup mouth area, place a circular differential caliper tool in the cup mouth area so that the circular differential caliper tool covers the circular welding gap area between the inner liner and the outer wall of the thermos cup. The circular differential caliper tool includes multiple caliper areas, each of which divides the circular weld seam area of the thermos cup into a sub-region of the weld seam of the thermos cup. S6. Rotate each caliper area of the circular differential caliper tool to align the sub-area of the thermos cup welding seam covered by each caliper area and splice them into a straight welding seam of the thermos cup. S7. The galvanometer laser welds the circular weld seam between the inner liner and the outer wall of the thermos cup according to the straight weld seam of the thermos cup; In step S3, the thermos cup image captured by the camera is subjected to median filtering with a 5×5 kernel to remove some noise in the image, and the thermos cup image is subjected to adaptive threshold binarization. Specifically, each welding seam sub-region of the thermos cup is traversed sequentially, and a welding seam sub-region with a gray value of 0 is searched. Based on the prior knowledge of the placement of the circular differential caliper tool, it is determined whether the welding seam sub-region of the thermos cup is a welding seam. If not, the search continues. If it is, the position of the welding seam sub-region of the thermos cup is recorded. When traversing the next thermos cup welding seam sub-region, the position of the next thermos cup welding seam sub-region is compared with the position of the previous thermos cup welding seam sub-region. If the position difference is greater than a certain preset value, the next thermos cup welding seam sub-region is identified as an abnormal search point, and the next thermos cup welding seam sub-region is corrected for rejection. This process continues until all the weld seam sub-regions of the thermos cup are output as welding positioning points. The galvanometer laser connects all the welding positioning points one by one to form a welding trajectory, and then welds the circular weld seam between the inner liner and the outer wall of the thermos cup.
2. The thermos flask mirror welding method according to claim 1, characterized by, In step S1, the galvanometer laser undergoes galvanometer distortion correction, including the following steps: S11. Drive the galvanometer laser to mark the galvanometer distortion correction calibration map, wherein the galvanometer distortion correction calibration map includes nine galvanometer distortion correction calibration points; S12. Represent the nine galvanometer distortion correction calibration points in the galvanometer distortion correction calibration diagram as a two-dimensional vector; S13. Combine the two-dimensional vectors representing the nine galvanometer distortion correction calibration points in step S12 into a first matrix, perform SVD decomposition on the first matrix, and generate the galvanometer distortion correction matrix. S14. Using the galvanometer distortion correction matrix, perform galvanometer distortion correction on the galvanometer laser.
3. The welding method for a thermos cup galvanometer according to claim 1, characterized in that, In step S1, the camera performs camera perspective correction, including the following steps: S15. Select nine second calibration points on the standard chessboard grid, take pictures of the nine second calibration points with the camera, and map the nine second calibration points to the camera coordinate system of the camera to generate a second nine-point calibration map. S16. Represent the nine second calibration points in the second nine-point calibration diagram as two-dimensional vectors; S17. Combine the two-dimensional vectors representing the nine second calibration points in step S16 into a second matrix, perform SVD decomposition on the second matrix, and generate a camera perspective correction matrix. S18. Using the camera perspective correction matrix, perform camera perspective correction on the camera.
4. The welding method for a thermos cup galvanometer according to claim 1, characterized in that, In step S2, the mapping matrix from the camera coordinate system to the galvanometer laser coordinate system is calculated using the following method: S21. Drive the galvanometer laser to mark the first nine-point calibration map, wherein the first nine-point calibration map includes nine first calibration points; S22. The camera captures nine first calibration points, and performs perspective correction on the captured first nine-point calibration map according to the perspective correction matrix of the camera perspective correction, and extracts the coordinates of the nine first calibration points in the camera coordinate system in the perspective-corrected first nine-point calibration map. S23. Map the coordinates of the nine first calibration points in the first nine-point calibration diagram in the galvanometer coordinate system to the coordinates of the nine first calibration points in the camera coordinate system in the first nine-point calibration diagram after perspective correction, to obtain a mapping matrix from the camera coordinate system of the camera to the galvanometer coordinate system of the galvanometer laser.
5. The welding method for a thermos cup galvanometer according to claim 4, characterized in that, In step S22, the first nine-point calibration diagram after perspective correction is processed using 5... A 5-kernel median filter is used to remove some noise from the image. The first nine-point calibration image after perspective correction is then subjected to adaptive threshold binarization.
6. The welding method for a thermos cup galvanometer according to claim 1, characterized in that, The following method is used to perform adaptive threshold binarization on the image of the thermos cup: Let TH be the grayscale threshold of the thermos cup image; Pixels in the thermos image with gray values less than the gray value threshold TH are classified as first-class pixels C1; pixels in the thermos image with gray values greater than the gray value threshold TH are classified as second-class pixels C2. Calculate the inter-class variance of pixel C1 (first class) and pixel C2 (second class): , in, Let C1 be the inter-class variance of pixel C1 and pixel C2. The probability of classifying a pixel as the first class C1, The probability of classifying a pixel as the second class C2. The mean value of the first type of pixel C1, The mean value of the second type of pixels C2; Select the inter-class variance of the first class pixel C1 and the second class pixel C2 The grayscale value of the thermos image corresponding to the maximum value is used as the grayscale threshold TH of the thermos image.
7. A vision-guided galvanometer welding system for thermos cups, characterized in that, The thermos cup galvanometer welding system includes: a camera, a galvanometer laser, and a ring light source; The camera is connected to the galvanometer laser; the ring light source is arranged below the galvanometer laser and the camera; The camera is used to capture images of the thermos cup. The ring light source is used to provide a light source for the thermos cup placed in the working area of the galvanometer laser; The galvanometer laser is used to weld the circular weld seam between the inner liner and the outer wall of the thermos cup according to the galvanometer welding method of any one of claims 1 to 6, based on the image of the thermos cup captured by the camera.
8. A storage medium, characterized in that, The storage medium is used to store computer execution instructions; the computer execution instructions are used to execute the thermos cup galvanometer welding method according to any one of claims 1 to 6.