Visual inspection method and device for welding defects of sealing nails
Through the mapping technology of image sensors and target area contours, the crack area after welding of the battery sealing plate is detected, which solves the problem of cracks caused by temperature changes during the welding process and improves the safety and quality of sealing nail welding.
Patent Information
- Application Number
- CN202410803745.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-06-20
AI Technical Summary
During the welding process of battery seal nails, sudden changes in welding temperature lead to volume changes in the position of the weld and the base material, resulting in cracks, which affects the tightness and safety of the seal. It is difficult to effectively detect and solve this problem with existing technology.
An image sensor is used to acquire images before and after welding, and the target area contour map is used to segment the weld area and the base material area, compare the difference images between the two, and determine whether the welded battery sealing plate meets the preset crack area conditions. Determine weld quality.
Through visual inspection methods, we can accurately determine the crack area on the welded battery sealing plate base material and welds, improve the safety of sealing nail welding, and ensure qualified welding quality.
Smart Images

Figure CN118858285A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of visual inspection, and in particular to a method and device for visual inspection of sealing pin welding defects. Background Art
[0002] With the continuous advancement of science and technology, batteries, as key components for energy storage and supply, have attracted more and more attention for sealing technology in the manufacturing process. Among them, battery sealing nail welding, as a key connection technology, is essential to ensure the safety and performance of batteries. Battery sealing nail welding is a process that firmly connects the sealing nail to the battery shell by welding. This welding technology uses advanced welding equipment to achieve efficient and reliable connection between the sealing nail and the shell by precisely controlling the welding parameters. Sealing nail welding can not only ensure the stability of the internal components of the battery, but also effectively prevent safety hazards such as battery leakage and gas leakage.
[0003] During the welding process of battery sealing nails, the sudden change in temperature during welding can easily cause the weld position and the volume of the substrate to change. After the welding cools down, there is internal stress, which causes cracks. Too many cracks will lead to poor sealing and cause safety problems. Therefore, how to detect defects caused by cracks during the welding of sealing nails is an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide a method and device for visually detecting welding defects of sealing pins to improve the above-mentioned problems.
[0005] A first aspect of an embodiment of the present application provides a method for visually detecting welding defects of sealing pins, the method comprising:
[0006] Acquire a first detection image and a second detection image based on an image sensor, wherein the first detection image is an image of a battery sealing plate to be welded, and the second detection image is an image of the battery sealing plate after sealing nail welding;
[0007] Acquire a target area contour map, where the target area contour map is a map formed by the boundary contour of the area where a weld is to be formed, map the target area contour map to a first detection image, so that the first detection image is divided into a pre-welding area image and a first substrate area image; map the target area contour map to a second detection image, so that the second welding image is divided into a weld area image and a second substrate area image;
[0008] Comparing the first substrate region image with the second substrate region image, and determining whether the battery sealing plate after welding meets a first determination condition based on a difference image between the first substrate region image and the second substrate region image, wherein the first determination condition includes that the substrate crack image area is smaller than a first preset area;
[0009] Determine a weld crack image based on the weld area image, and determine whether the battery sealing plate after welding meets a second determination condition based on the weld crack image, wherein the second determination condition includes that the weld crack image area is smaller than a second preset area;
[0010] Based on the determination results obtained according to the first determination condition and the second determination condition, it is determined whether the battery sealing plate after welding is qualified.
[0011] Optionally, after mapping the target area contour image to the second detection image so that the second welding image is divided into a weld area image and a second substrate area image, the method further comprises:
[0012] Acquire an actual welding profile image based on the second detection image;
[0013] Compare the actual welding contour image with the weld area image, and determine whether the battery sealing plate after welding meets the third judgment condition according to the comparison result, wherein the third judgment condition includes that the actual size and position of the weld are consistent with the expected position;
[0014] Based on the first determination condition and the second determination condition, determining whether the battery sealing plate after welding is qualified also includes:
[0015] Based on the third judgment condition, it is determined whether the battery sealing plate after welding is qualified.
[0016] Optionally, obtaining an actual welding profile image based on the second detection image includes:
[0017] Slice the first detection image to form a plurality of first sub-images, and determine, based on the target area contour map, that a first sub-image constituting the first substrate area image among the plurality of first detection images is a target first sub-image;
[0018] Segmenting the second detection image to form a plurality of second sub-images;
[0019] Comparing the plurality of second sub-images with the target first sub-image, wherein the content of the comparison includes a color temperature parameter, a hue parameter, and a brightness parameter;
[0020] Determine that a plurality of second sub-images having the same data parameters as the target first sub-image are target second sub-images, and the rest are weld sub-images;
[0021] The actual welding contour map is obtained based on multiple weld sub-images.
[0022] Optionally, combining a plurality of weld seam sub-images to form an actual weld seam image comprises:
[0023] Determine that the weld sub-image of the adjacent second sub-image as the target second sub-image is a boundary sub-image;
[0024] Multiple boundary sub-images are connected to form the actual weld contour map.
[0025] Optionally, multiple boundary sub-images are concatenated to form an actual welding contour map, including:
[0026] Smoothing of actual weld contours.
[0027] Optionally, a weld crack image is determined based on the weld area image, and whether the battery sealing plate after welding meets a second determination condition is determined based on the weld crack image, wherein the second determination condition includes that the weld crack image area is smaller than a second preset area, including:
[0028] Obtaining image parameters of each weld sub-image, the image parameters including color temperature parameters, hue parameters and brightness parameters;
[0029] Marking adjacent weld sub-images having the same image parameters among the multiple weld sub-images as target region sub-images, wherein the multiple continuous adjacent weld sub-images constitute an image group;
[0030] Based on the positions of the multiple image groups, an image group consisting of weld sub-images formed by crack images in the multiple image groups is determined, marked as a target image group, and all weld sub-images constituting the target image group are crack sub-images;
[0031] Based on the number of crack sub-images, the crack image area of the weld is determined.
[0032] Optionally, based on the positions of the multiple image groups, an image group consisting of weld sub-images formed by crack images in the multiple image groups is determined, marked as a target image group, and all weld sub-images constituting the target image group are crack sub-images, including:
[0033] Determine the position parameters of each image group, where the position parameters of the image group are the coordinate parameters of the center of the image group graphic;
[0034] A discrete model is established based on coordinate parameters of multiple image groups;
[0035] According to the calculation results of the discrete model, a plurality of image groups having the same image parameters and the highest discreteness of the weld sub-images are determined as the target image groups.
[0036] In a second aspect, the present application proposes a visual inspection device for sealing nail welding defects, which is configured as follows:
[0037] Acquire a first detection image and a second detection image based on an image sensor, wherein the first detection image is an image of a battery sealing plate to be welded, and the second detection image is an image of the battery sealing plate after sealing nail welding;
[0038] Acquire a target area contour map, where the target area contour map is a map formed by the boundary contour of the area where a weld is to be formed, map the target area contour map to a first detection image, so that the first detection image is divided into a pre-welding area image and a first substrate area image; map the target area contour map to a second detection image, so that the second welding image is divided into a weld area image and a second substrate area image;
[0039] Comparing the first substrate region image with the second substrate region image, and determining whether the battery sealing plate after welding meets a first determination condition based on a difference image between the first substrate region image and the second substrate region image, wherein the first determination condition includes that the substrate crack image area is smaller than a first preset area;
[0040] Determine a weld crack image based on the weld area image, and determine whether the battery sealing plate after welding meets a second determination condition based on the weld crack image, wherein the second determination condition includes that the weld crack image area is smaller than a second preset area;
[0041] Based on the determination results obtained according to the first determination condition and the second determination condition, it is determined whether the battery sealing plate after welding is qualified.
[0042] Optionally, the device is configured to:
[0043] Acquire an actual welding profile image based on the second detection image;
[0044] Compare the actual welding contour image with the weld area image, and determine whether the battery sealing plate after welding meets the third judgment condition according to the comparison result, wherein the third judgment condition includes that the actual size and position of the weld are consistent with the expected position;
[0045] Based on the first determination condition and the second determination condition, determining whether the battery sealing plate after welding is qualified also includes:
[0046] Based on the third judgment condition, it is determined whether the battery sealing plate after welding is qualified.
[0047] Optionally, the device is configured to:
[0048] Slice the first detection image to form a plurality of first sub-images, and determine, based on the target area contour map, that a first sub-image constituting the first substrate area image among the plurality of first detection images is a target first sub-image;
[0049] Segmenting the second detection image to form a plurality of second sub-images;
[0050] Comparing the plurality of second sub-images with the target first sub-image, wherein the content of the comparison includes a color temperature parameter, a hue parameter, and a brightness parameter;
[0051] Determine that a plurality of second sub-images having the same data parameters as the target first sub-image are target second sub-images, and the rest are weld sub-images;
[0052] The actual welding contour map is obtained based on multiple weld sub-images.
[0053] Optionally, the device is configured to:
[0054] Determine that the weld sub-image of the adjacent second sub-image as the target second sub-image is a boundary sub-image;
[0055] Multiple boundary sub-images are connected to form the actual weld contour map.
[0056] Optionally, the device is configured to:
[0057] Smoothing of actual weld contours.
[0058] Optionally, the device is configured to:
[0059] Obtaining image parameters of each weld sub-image, the image parameters including color temperature parameters, hue parameters and brightness parameters;
[0060] Marking adjacent weld sub-images having the same image parameters among the multiple weld sub-images as target region sub-images, wherein the multiple continuous adjacent weld sub-images constitute an image group;
[0061] Based on the positions of the multiple image groups, an image group consisting of weld sub-images formed by crack images in the multiple image groups is determined, marked as a target image group, and all weld sub-images constituting the target image group are crack sub-images;
[0062] Based on the number of crack sub-images, the crack image area of the weld is determined.
[0063] Optionally, the device is configured to:
[0064] Determine the position parameters of each image group, where the position parameters of the image group are the coordinate parameters of the center of the image group graphic;
[0065] A discrete model is established based on coordinate parameters of multiple image groups;
[0066] According to the calculation results of the discrete model, a plurality of image groups having the same image parameters and the highest discreteness of the weld sub-images are determined as the target image groups.
[0067] A third aspect of an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0068] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method proposed in the first aspect of the embodiment of the present invention.
[0069] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the first aspect of the embodiment of the present invention.
[0070] In summary, the above method and device have the following technical effects:
[0071] A method for visually detecting welding defects of sealing pins proposed in an embodiment of the present application first obtains a first detection image before welding and a second detection image after welding based on an image sensor, then obtains a contour map of the target area, maps the contour map of the target area to the first detection image, so that the first detection image is divided into a pre-welding area image and a first substrate area image, and then maps the contour map of the target area to the second detection image, so that the second welding image is divided into a weld area image and a second substrate area image; determines whether the crack area on the substrate of the battery sealing plate after welding and the crack area on the weld are both smaller than the preset area, and thereby determines whether the battery sealing plate after welding is qualified. A method for visually detecting welding defects of sealing pins provided in the present application, through image recognition technology, simultaneously obtains the crack ratio on the substrate and the crack ratio on the weld, jointly determines whether the welding is qualified, and improves the safety of sealing pin welding. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 A schematic flow chart of a method for visually detecting sealing pin welding defects proposed in this application. DETAILED DESCRIPTION
[0073] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] The present application embodiment proposes a method for visually detecting sealing pin welding defects. Figure 1 , including the following steps:
[0075] S101: Acquire a first detection image and a second detection image based on an image sensor, wherein the first detection image is an image of a battery sealing plate to be welded, and the second detection image is an image of the battery sealing plate after sealing nails are welded.
[0076] It is understandable that acquiring detection images is the basis of visual inspection technology. In this embodiment, the acquisition angle, lighting conditions, etc. of the first detection image and the second detection image should be as consistent as possible, which can be achieved by fixing the battery sealing plate to be welded on the fixture and shooting at the same position. Of course, in other embodiments, there can also be other fixing methods, which are not limited here.
[0077] S102: Obtain a target area contour map, where the target area contour map is a map formed by the boundary contour of the area where a weld is to be formed, and map the target area contour map to a first detection image so that the first detection image is divided into a pre-welding area image and a first substrate area image; and map the target area contour map to a second detection image so that the second welding image is divided into a weld area image and a second substrate area image.
[0078] Specifically, the target area contour map is a map formed by the boundary contour of the area where the weld needs to be formed. The target area contour map can be directly obtained according to the preset welding data, or it can be considered to be drawn in the process of visual annotation. The specific acquisition method is not limited here. The target area contour map is a frame line map, which divides the corresponding position of the welding area in the image of the entire battery sealing plate by frame lines. In this embodiment, the frame line map is overlapped with the first detection image and the second detection image respectively by feature positioning and other methods, that is, the target area contour map is mapped to the first detection image and the second detection image. In this way, the first detection image can be divided into a pre-welding area image and a first substrate area image, and the second welding image can be divided into a weld area image and a second substrate area image.
[0079] S103: Acquire an actual welding contour map based on the second detection image.
[0080] During the welding process, the molten pool is affected by uncertain factors such as crystal orientation and temperature changes, which causes the stress contraction of the welding material base after cooling, resulting in irregular deformation of the weld and size changes. Due to the uncertainty of deformation, excessive deformation may cause the welding result to fail to meet expectations, which may pose safety issues. Therefore, in this embodiment, the actual welding contour map is obtained through the second detection image, and the actual welding contour map is compared with the size acquisition area of the expected area. The amount of deformation can be determined by the comparison result, and then it can be judged whether the size of the weld area after welding meets expectations.
[0081] Specifically, as an implementation, step S103 may include the following steps:
[0082] S1031: Slice the first detection image to form a plurality of first sub-images, and determine, based on the target area contour map, that a first sub-image constituting the first substrate area image among the plurality of first detection images is a target first sub-image.
[0083] It is understandable that, affected by the performance of the specific processing equipment, within the capacity of the processing equipment, the size of the segmentation is as small as possible, but the size of each first sub-image is at least larger than the size of a single pixel in the first detection image. The segmentation process of the image can be based on the same size edge for equal segmentation, and the algorithm used can be Sobel, Canny, etc., and the specific segmentation process is not described here. In this embodiment, the first sub-image constituting the first substrate area image is determined to be the target first sub-image. As to which image first sub-images constituting the first substrate area image are the target first sub-images, specifically, first, the image parameters of each first sub-image can be obtained, and the image parameters include color temperature parameters, hue parameters and brightness parameters, and then, using the feature extraction algorithm, it is determined which sub-images have the same color temperature parameters, hue parameters and brightness parameters as the first substrate area image parameters, so as to determine which image first sub-images are the target first sub-images. The first substrate area image parameters can be directly calibrated or selected by manual selection or the like, and are not limited here.
[0084] S1032: Segment the second detection image to form a plurality of second sub-images.
[0085] The segmentation process of the second detection image is the same as that of the first detection image, and will not be described in detail here.
[0086] S1033: Compare the plurality of second sub-images with the target first sub-image, wherein the comparison content includes color temperature parameters, hue parameters, and brightness parameters.
[0087] S1034: Determine that a plurality of second sub-images having the same data parameters as the target first sub-image are target second sub-images, and the rest are weld sub-images.
[0088] S1035: Obtaining an actual welding contour image based on multiple weld sub-images.
[0089] It can be understood that the purpose is to determine which second sub-images are the same as the target first sub-image by feature matching, that is, the image of the substrate itself. In addition to the image that constitutes the substrate image, that is, the image that constitutes the actual weld. Of course, the actual weld image at this time may also have some crack images in the weld. Therefore, the boundary determination method can be used to further calibrate the boundary to make the boundary clearer. Specifically, it can be determined that the weld sub-image of the adjacent second sub-image is the target second sub-image as the boundary sub-image, that is, in a weld sub-image image, it is adjacent to a sub-image formed by a substrate image, and it can be understood that the second sub-image is a sub-image at the weld boundary position. By connecting these second sub-images, an actual welding contour map can be formed. Of course, in order to avoid the weld interspersed in the boundary from affecting the actual welding contour map of the connection, the actual welding contour map of the preliminary connection can also be smoothed to avoid the influence of the weld on the breakpoint of the actual welding contour map. In this way, the multiple boundary sub-images connected can form an actual welding contour map.
[0090] S104: Compare the actual welding contour map with the weld area image, and determine whether the battery sealing plate after welding meets the third judgment condition based on the comparison result, wherein the third judgment condition includes whether the actual size and position of the weld are consistent with the expected position.
[0091] It can be understood that since the weld area image is obtained by dividing the target area contour map, the weld area image is the expected size of the weld area. Therefore, in this embodiment, the actual actual welding contour map is compared with the weld area image to determine whether the actual size and position of the weld are consistent with the expected size of the weld area. At this time, multiple methods such as boundary overlap and shadow overlap can be used. For example, whether the overlap of the boundary reaches the expected value, or the actual welding contour map is projected onto the weld area image to determine the image difference size. Of course, other methods can also be used in other embodiments to determine, which is not limited here. Through the above steps, it can be determined whether the actual size and position of the weld are consistent with the expected position.
[0092] S105: Compare the first substrate area image with the second substrate area image, and determine whether the battery sealing plate after welding meets the first determination condition based on the difference image between the first substrate area image and the second substrate area image, wherein the first determination condition includes that the substrate crack image area is smaller than the first preset area.
[0093] It can be understood that in this step, since the first substrate area image is the original image and the second substrate area image is an image with cracks, the difference value algorithm can be directly used to determine the area of the cracks in the second substrate area image, for example, by identifying sub-images with differences through image comparison and other methods. The specific algorithm has been disclosed in the prior art and will not be repeated here. The above method can be used to determine whether the battery sealing plate after welding meets the first judgment condition, wherein the first judgment condition includes that the area of the substrate crack image is less than the first preset area, and the first preset area is also the minimum area when the total amount of cracks on the substrate can meet the qualified conditions.
[0094] S106: Determine the weld crack image based on the weld area image, and determine whether the battery sealing plate after welding meets the second determination condition based on the weld crack image, wherein the second determination condition includes that the weld crack image area is smaller than the second preset area.
[0095] It is understandable that for cracks in the weld, since there is no condition like only crack variables on the substrate, the image recognition process cannot be directly obtained through image comparison. Therefore, in this embodiment, the image recognition method is used to identify the crack image in the weld. It is understandable that the second preset area is the minimum area when the total amount of cracks on the weld can meet the qualified conditions, which is the same as the principle of the first preset area.
[0096] Specifically, as an implementation, step S106 may include the following steps:
[0097] S1061: Obtain image parameters of each weld sub-image, where the image parameters include color temperature parameters, hue parameters, and brightness parameters.
[0098] It can be understood that under uniform lighting conditions, the image parameters of the sub-images forming the cracks in the weld are almost the same. Therefore, it is possible to determine which sub-images constitute the cracks by identifying the image parameters of the weld sub-images.
[0099] S1062: Mark adjacent weld sub-images having the same image parameters among the multiple weld sub-images as target area sub-images, wherein the multiple continuous adjacent weld sub-images constitute an image group.
[0100] It can be understood that since the image of the weld is different from the base image and is not a uniform image, the weld sub-image identified by identifying the image parameters of the weld sub-image includes some other areas in the weld image, such as highlights, concave points, etc. Therefore, the weld sub-image needs to be further identified. Based on the characteristics of discrete distribution of cracks, in this embodiment, adjacent weld sub-images with the same image parameters are marked as target area sub-images, wherein multiple continuous adjacent weld sub-images constitute an image group, that is, an image group is an isolated crack image, or an image of other highlights or concave points, etc.
[0101] S1063: Based on the positions of the multiple image groups, determine an image group consisting of weld sub-images formed by crack images in the multiple image groups, mark it as a target image group, and all weld sub-images constituting the target image group are crack sub-images.
[0102] It is understandable that, according to the discreteness of the crack, it is possible to determine which of the multiple image groups are the target image groups, that is, the image groups formed by the weld crack, that is, the target image groups. Specifically, in this embodiment, the position parameters of each image group can be determined. The position parameters of the image group can be the coordinate parameters of the center of the image group graphic, or the edge coordinate parameters, which are not limited here. Then, based on the coordinate parameters of the multiple image groups, a discrete model is established. The discrete model is a function model used to measure the degree of discreteness of multiple points. Finally, according to the calculation results of the discrete model, it is determined that the image parameters of the weld sub-images are the same and the multiple image groups with the highest discreteness are the target image groups. It is understandable that, because the image parameters of the sub-images forming the cracks in the weld are almost the same under uniform lighting conditions, the image parameters of the weld sub-images are the same and the multiple image groups with the highest discreteness must be the target image groups, that is, the image groups forming the cracks.
[0103] S1064: Determine the crack image area of the weld based on the number of crack sub-images.
[0104] After determining the number of crack sub-images, the crack image area of the weld can be finally obtained through combination and the like, and it can be determined that the weld crack image area is smaller than the second preset area.
[0105] S107: Determine whether the battery sealing plate after welding is qualified based on the judgment results obtained according to the first judgment condition, the second judgment condition and the third judgment condition.
[0106] It can be understood that if any one of the first judgment condition, the second judgment condition and the third judgment condition is not met, it is proved that the welding result is unqualified and the battery sealing plate is a defective workpiece.
[0107] A method for visually detecting welding defects of sealing pins proposed in an embodiment of the present application first obtains a first detection image before welding and a second detection image after welding based on an image sensor, then obtains a contour map of the target area, maps the contour map of the target area to the first detection image, so that the first detection image is divided into a pre-welding area image and a first substrate area image, and then maps the contour map of the target area to the second detection image, so that the second welding image is divided into a weld area image and a second substrate area image; determines whether the crack area on the substrate of the battery sealing plate after welding and the crack area on the weld are both smaller than the preset area, and thereby determines whether the battery sealing plate after welding is qualified. A method for visually detecting welding defects of sealing pins provided in the present application, through image recognition technology, simultaneously obtains the crack ratio on the substrate and the crack ratio on the weld, jointly determines whether the welding is qualified, and improves the safety of sealing pin welding.
[0108] Based on the same inventive concept, an embodiment of the present application further proposes a visual inspection device for sealing nail welding defects, which is configured as follows:
[0109] Acquire a first detection image and a second detection image based on an image sensor, wherein the first detection image is an image of a battery sealing plate to be welded, and the second detection image is an image of the battery sealing plate after sealing nail welding;
[0110] Acquire a target area contour map, where the target area contour map is a map formed by the boundary contour of the area where a weld is to be formed, map the target area contour map to a first detection image, so that the first detection image is divided into a pre-welding area image and a first substrate area image; map the target area contour map to a second detection image, so that the second welding image is divided into a weld area image and a second substrate area image;
[0111] Comparing the first substrate region image with the second substrate region image, and determining whether the battery sealing plate after welding meets a first determination condition based on a difference image between the first substrate region image and the second substrate region image, wherein the first determination condition includes that the substrate crack image area is smaller than a first preset area;
[0112] Determine a weld crack image based on the weld area image, and determine whether the battery sealing plate after welding meets a second determination condition based on the weld crack image, wherein the second determination condition includes that the weld crack image area is smaller than a second preset area;
[0113] Based on the determination results obtained according to the first determination condition and the second determination condition, it is determined whether the battery sealing plate after welding is qualified.
[0114] Optionally, the device is configured to:
[0115] Acquire an actual welding profile image based on the second detection image;
[0116] Compare the actual welding contour image with the weld area image, and determine whether the battery sealing plate after welding meets the third judgment condition according to the comparison result, wherein the third judgment condition includes that the actual size and position of the weld are consistent with the expected position;
[0117] Based on the first determination condition and the second determination condition, determining whether the battery sealing plate after welding is qualified also includes:
[0118] Based on the third judgment condition, it is determined whether the battery sealing plate after welding is qualified.
[0119] Optionally, the device is configured to:
[0120] Slice the first detection image to form a plurality of first sub-images, and determine, based on the target area contour map, that a first sub-image constituting the first substrate area image among the plurality of first detection images is a target first sub-image;
[0121] Segmenting the second detection image to form a plurality of second sub-images;
[0122] Comparing the plurality of second sub-images with the target first sub-image, wherein the content of the comparison includes a color temperature parameter, a hue parameter, and a brightness parameter;
[0123] Determine that a plurality of second sub-images having the same data parameters as the target first sub-image are target second sub-images, and the rest are weld sub-images;
[0124] The actual welding contour map is obtained based on multiple weld sub-images.
[0125] Optionally, the device is configured to:
[0126] Determine that the weld sub-image of the adjacent second sub-image as the target second sub-image is a boundary sub-image;
[0127] Multiple boundary sub-images are connected to form the actual weld contour map.
[0128] Optionally, the device is configured to:
[0129] Smoothing of actual weld contours.
[0130] Optionally, the device is configured to:
[0131] Obtaining image parameters of each weld sub-image, the image parameters including color temperature parameters, hue parameters and brightness parameters;
[0132] Marking adjacent weld sub-images having the same image parameters among the multiple weld sub-images as target region sub-images, wherein the multiple continuous adjacent weld sub-images constitute an image group;
[0133] Based on the positions of the multiple image groups, an image group consisting of weld sub-images formed by crack images in the multiple image groups is determined, marked as a target image group, and all weld sub-images constituting the target image group are crack sub-images;
[0134] Based on the number of crack sub-images, the crack image area of the weld is determined.
[0135] Optionally, the device is configured to:
[0136] Determine the position parameters of each image group, where the position parameters of the image group are the coordinate parameters of the center of the image group graphic;
[0137] A discrete model is established based on coordinate parameters of multiple image groups;
[0138] According to the calculation results of the discrete model, a plurality of image groups having the same image parameters and the highest discreteness of the weld sub-images are determined as the target image groups.
[0139] The embodiment of the present application proposes a visual detection device for sealing nail welding defects. First, based on an image sensor, a first detection image before welding and a second detection image after welding are acquired. Then, a contour map of the target area is acquired. The contour map of the target area is mapped to the first detection image, so that the first detection image is divided into a pre-welding area image and a first substrate area image. Then, the contour map of the target area is mapped to the second detection image, so that the second welding image is divided into a weld area image and a second substrate area image. It is determined whether the crack area on the substrate of the battery sealing plate after welding and the crack area on the weld are both smaller than the preset area, and thereby determines whether the battery sealing plate after welding is qualified. The present application provides a visual detection device for sealing nail welding defects. Through image recognition technology, the crack ratio on the substrate and the crack ratio on the weld are simultaneously acquired to jointly determine whether the welding is qualified, thereby improving the safety of sealing nail welding.
[0140] Based on the same inventive concept, an embodiment of the present application further proposes an electronic device, the electronic device comprising:
[0141] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the visual detection method for sealing pin welding defects of an embodiment of the present application.
[0142] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the visual detection method for sealing pin welding defects of an embodiment of the present application.
[0143] The following is a detailed introduction to the various components of electronic equipment:
[0144] The processor is the control center of the electronic device, which may be a processor or a general term for multiple processing elements. For example, the processor is one or more central processing units (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA).
[0145] Optionally, the processor can perform various functions of the electronic device by running or executing a software program stored in the memory, and calling data stored in the memory.
[0146] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment and will not be repeated here.
[0147] Optionally, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be integrated with the processor, or may exist independently and be coupled to the processor through an interface circuit of the electronic device, which is not specifically limited in the embodiments of the present invention.
[0148] A transceiver is used to communicate with a network device or a terminal device.
[0149] Optionally, the transceiver may include a receiver and a transmitter, wherein the receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0150] Optionally, the transceiver may be integrated with the processor, or may exist independently and be coupled to the processor via an interface circuit of the router, which is not specifically limited in the embodiment of the present invention.
[0151] In addition, the technical effects of the electronic device can refer to the technical effects of the data transmission method in the above method embodiment, which will not be repeated here.
[0152] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0153] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0154] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When a computer instruction or computer program is loaded or executed on a computer, a process or function according to an embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0155] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0156] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0157] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0158] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
Claims
1. A method for visually detecting sealing pin welding defects, characterized in that: The method comprises: Acquire a first detection image and a second detection image based on an image sensor, wherein the first detection image is an image of a battery sealing plate to be welded, and the second detection image is an image of the battery sealing plate after sealing nail welding; Acquire a target area contour map, wherein the target area contour map is a map formed by a boundary contour of an area where a weld is to be formed, map the target area contour map to the first detection image, so that the first detection image is divided into a pre-welding area image and a first substrate area image; map the target area contour map to the second detection image, so that the second welding image is divided into a weld area image and a second substrate area image; Comparing the first substrate region image with the second substrate region image, and determining whether the battery sealing plate after welding meets a first determination condition based on a difference image between the first substrate region image and the second substrate region image, wherein the first determination condition includes that the substrate crack image area is smaller than a first preset area; Determine a weld crack image based on the weld area image, and determine whether the battery sealing plate after welding meets a second determination condition based on the weld crack image, wherein the second determination condition includes that the weld crack image area is smaller than a second preset area; Based on the determination results obtained according to the first determination condition and the second determination condition, it is determined whether the battery sealing plate after welding is qualified.
2. A method for visually detecting sealing pin welding defects according to claim 1, characterized in that: After mapping the target area contour image to the second detection image so that the second welding image is divided into a weld area image and a second substrate area image, the method includes: Acquire an actual welding profile image based on the second detection image; Comparing the actual welding contour image with the weld area image, and determining whether the battery sealing plate after welding meets a third determination condition according to the comparison result, wherein the third determination condition includes that the actual size and position of the weld are consistent with the expected position; Based on the first determination condition and the second determination condition, determining whether the battery sealing plate after welding is qualified also includes: Based on the third judgment condition, it is determined whether the battery sealing plate after welding is qualified.
3. A method for visually detecting sealing pin welding defects according to claim 2, characterized in that: Acquiring an actual welding profile map based on the second detection image includes: Slicing the first detection image to form a plurality of first sub-images, and determining, based on the target area contour map, the first sub-image constituting the first substrate area image among the plurality of first detection images as a target first sub-image; dividing the second detection image into a plurality of second sub-images; Comparing the plurality of second sub-images with the target first sub-image, wherein the comparison content includes color temperature parameters, hue parameters and brightness parameters; Determine that a plurality of the second sub-images having the same data parameters as the target first sub-image are target second sub-images, and the rest are weld sub-images; The actual welding contour map is acquired based on the multiple weld sub-images.
4. A method for visually detecting sealing pin welding defects according to claim 3, characterized in that: Combining a plurality of the weld seam sub-images to form the actual weld seam image comprises: Determining the weld sub-image adjacent to the second sub-image as the target second sub-image as the boundary sub-image; A plurality of the boundary sub-images are connected to form the actual welding contour image.
5. A method for visually inspecting sealing pin welding defects according to claim 4, characterized in that: Connecting a plurality of the boundary sub-images to form the actual welding contour map comprises: The actual welding profile image is smoothed.
6. A method for visually inspecting sealing pin welding defects according to claim 3, characterized in that: Determining a weld crack image based on the weld area image, and determining whether the battery sealing plate after welding meets a second determination condition based on the weld crack image, wherein the second determination condition includes that the weld crack image area is smaller than a second preset area, including: Acquire image parameters of each of the weld sub-images, the image parameters including color temperature parameters, hue parameters, and brightness parameters; Marking the adjacent weld sub-images having the same image parameters among the plurality of weld sub-images as target region sub-images, wherein the plurality of continuous adjacent weld sub-images constitute an image group; Based on the positions of the plurality of image groups, determine an image group consisting of weld sub-images formed by crack images among the plurality of image groups, mark it as a target image group, and all the weld sub-images constituting the target image group are crack sub-images; Based on the number of the crack sub-images, the crack image area of the weld is determined.
7. A method for visually inspecting sealing pin welding defects according to claim 6, characterized in that: The step of determining, based on the positions of the plurality of image groups, an image group consisting of weld sub-images formed by crack images in the plurality of image groups, marking the image group as a target image group, and wherein all the weld sub-images constituting the target image group are crack sub-images, comprises: Determine a position parameter of each of the image groups, where the position parameter of the image group is a coordinate parameter of a center of a graphic of the image group; Establishing a discrete model based on a plurality of image group coordinate parameters; According to the calculation result of the discrete model, it is determined that the plurality of image groups having the same image parameters and the highest discreteness constituting the weld sub-images are the target image groups.
8. A visual inspection device for sealing pin welding defects, characterized in that: The device is configured to: Acquire a first detection image and a second detection image based on an image sensor, wherein the first detection image is an image of a battery sealing plate to be welded, and the second detection image is an image of the battery sealing plate after sealing nail welding; Acquire a target area contour map, wherein the target area contour map is a map formed by a boundary contour of an area where a weld is to be formed, map the target area contour map to the first detection image, so that the first detection image is divided into a pre-welding area image and a first substrate area image; map the target area contour map to the second detection image, so that the second welding image is divided into a weld area image and a second substrate area image; Comparing the first substrate region image with the second substrate region image, and determining whether the battery sealing plate after welding meets a first determination condition based on a difference image between the first substrate region image and the second substrate region image, wherein the first determination condition includes that the substrate crack image area is smaller than a first preset area; Determine a weld crack image based on the weld area image, and determine whether the battery sealing plate after welding meets a second determination condition based on the weld crack image, wherein the second determination condition includes that the weld crack image area is smaller than a second preset area; Based on the first judgment condition and the second judgment condition, it is determined whether the battery sealing plate after welding is qualified.
9. A visual inspection device for sealing pin welding defects according to claim 1, characterized in that: The device is configured to: Acquire an actual welding profile image based on the second detection image; Comparing the actual welding contour image with the weld area image, and determining whether the battery sealing plate after welding meets a third determination condition according to the comparison result, wherein the third determination condition includes that the actual size and position of the weld are consistent with the expected position; Based on the first determination condition and the second determination condition, determining whether the battery sealing plate after welding is qualified also includes: Based on the third judgment condition, it is determined whether the battery sealing plate after welding is qualified.
10. An electronic device, characterized in that: The electronic device comprises: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; when the processor is used to execute the program stored in the memory, the method steps as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Welding seam based image identification method and image identification system
CN105427295A
Flaw detection method and device of printed circuit board and detection equipment
CN105510348A
Welding surface detection device based on machine vision
CN112083010A
Electronic device and solder joint detection method
CN112734706A
Sealing nail welding method and device, electronic equipment and storage medium
CN114092555A
Cited By
Steel pipe production data detection method and system
CN120721036A
