A seal nail broken weld detection method and a seal nail broken weld detection system
By using template matching and image processing techniques and leveraging the characteristics of sealing nail depth images, the high cost and computational power requirements of sealing nail welding inspection have been addressed, enabling efficient and accurate detection of broken seal nail welds.
Patent Information
- Application Number
- CN202310764136.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-06-26
AI Technical Summary
Existing methods for inspecting sealing nail welding rely on manual inspection, which is costly and inefficient. Furthermore, deep learning inspection methods require high-performance imaging systems and computing power, making it difficult to efficiently and accurately detect the welding quality of sealing nails.
A template matching algorithm is used to obtain the depth image of the sealing nail. The region of interest is determined by fast template matching with gradient integral. The welding point is determined by first-order forward difference and variance. Combined with image processing technology, the broken weld of the sealing nail is detected.
It achieves high-precision, low-cost detection of broken seal nails, reduces dependence on imaging systems and computing power, and improves detection speed and accuracy.
Smart Images

Figure CN116758041B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery processing technology, and in particular to a method and system for detecting broken welds on sealing nails. Background Technology
[0002] In the production process of lithium-ion batteries and other batteries, after the electrolyte is injected, sealing pin welding is required to prevent electrolyte leakage. Sealing pin welding is a crucial step in achieving complete isolation between the battery's internal structure and the external environment. Because electrolyte residue may remain in the cover plate's receiving groove during injection and handling, and crystals may form after prolonged standing, sealing pin welding often results in broken welds. This can significantly reduce battery performance or even render the battery unusable. Therefore, it is necessary to inspect the welding quality of the sealing pins.
[0003] Currently, the inspection of sealing nail welding is usually carried out by manual visual inspection or by photometric stereo and deep learning inspection methods. However, manual inspection is not only costly but also inefficient. On the other hand, photometric stereo and deep learning inspection methods rely heavily on the initial imaging system setup and stability, and deep learning also relies on a large amount of manually labeled data, which requires a lot of computing power.
[0004] Therefore, improvements to existing technologies are necessary.
[0005] The above information is provided as background information only to aid in understanding this disclosure and does not constitute an assertion or admission that any of the above content can be used as prior art relative to this disclosure. Summary of the Invention
[0006] This invention provides a method and system for detecting broken welds on sealing nails, thereby overcoming the shortcomings of the prior art.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] In a first aspect, the present invention provides a method for detecting broken welds on sealing studs, the method comprising:
[0009] Obtain a depth image of the sealing nail as the image to be inspected;
[0010] A template matching algorithm is used to match the image to be inspected with a template image in order to determine a circular region of interest (ROI) in the image to be inspected that matches the trajectory of the sealing nail.
[0011] Select n points at equal intervals on the circular ROI, and draw a perpendicular line at each selected point to obtain the perpendicular line segment corresponding to each selected point, where n is a positive integer;
[0012] Extract the depth value covered by each of the vertical line segments to obtain n sets of sequences, which are represented as follows:
[0013] Pi:v i,1 v i,2 , ..., v i,m (i = 1, 2, ..., n); where m is the number of depth values covered by the vertical line segment;
[0014] The first-order forward difference is calculated for the sequence corresponding to each of the vertical segments using the following formula:
[0015] g ij =v i,j+1 -v i,j ,i∈[1,n], j∈[1,m-1];
[0016] Based on the obtained first-order forward difference sequence, the variance of the first-order forward difference sequence is calculated using the following formula:
[0017]
[0018]
[0019] The judgment obtained Is it greater than the first set threshold?
[0020] If so, then the above The corresponding point is identified as a broken weld point;
[0021] If not, then the above The corresponding point is determined to be a normal welding point.
[0022] Furthermore, in the method for detecting broken welds on sealing nails, the circular ROI coincides with the center of the welding ring, and the circular ROI is located in the middle of the welding ring.
[0023] Furthermore, in the method for detecting broken welds on sealing nails, the step of using a template matching algorithm to match the image to be inspected with a template image to determine a circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail includes:
[0024] A fast template matching algorithm based on gradient integral is used to match the image to be inspected with the template image in order to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
[0025] Furthermore, in the method for detecting broken welds on sealing nails, the method further includes:
[0026] Obtain a depth image of a standard sealing pin;
[0027] The area of the sealing nail that needs to be inspected is cropped to obtain the template image;
[0028] Draw a circular ROI on the template image.
[0029] Furthermore, in the method for detecting broken welds on sealing nails, the length of the vertical segment is less than the width of the welding ring.
[0030] Furthermore, in the method for detecting broken welds on sealing nails, when the σ i 2 After determining the corresponding point as the solder joint break point, the method further includes:
[0031] Determine whether the number of consecutive broken solder joints is greater than a second set threshold;
[0032] If so, it is determined to be a broken weld;
[0033] If not, it is determined to be a false detection.
[0034] Furthermore, in the method for detecting broken welds on sealing nails, after the step of determining it as a false detection, the method further includes:
[0035] The consecutive broken weld points that were identified as false positives were corrected to normal weld points.
[0036] Secondly, the present invention provides a sealing nail weld breakage detection system, the system comprising:
[0037] The image acquisition module is used to acquire depth images of the sealing nails as images to be inspected;
[0038] The ROI determination module is used to match the image to be inspected with a template image using a template matching algorithm, so as to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
[0039] The equidistant point selection module is used to select n points at equal intervals on the circular ROI, and draw a perpendicular line at each selected point to obtain the perpendicular line segment corresponding to each selected point, where n is a positive integer.
[0040] The depth value extraction module is used to extract the depth value covered by each vertical line segment, resulting in n sets of sequences, which are represented as follows:
[0041] Pi:v i,1 v i,2 , ..., v i,m (i = 1, 2, ..., n); where m is the number of depth values covered by the vertical line segment;
[0042] The first calculation module is used to calculate the first-order forward difference of the sequence corresponding to each of the vertical line segments using the following formula:
[0043] g ij =v i,j+1 -v i,j ,i∈[1,n], j∈[1,m-1];
[0044] The second calculation module is used to calculate the variance of the first-order forward difference sequence based on the obtained first-order forward difference sequence using the following formula:
[0045]
[0046]
[0047] The threshold determination module is used to determine the obtained threshold value. Is it greater than a first preset threshold? If so, then... The corresponding point is determined to be a broken solder joint; if not, then the aforementioned point is... The corresponding point is determined to be a normal welding point.
[0048] Furthermore, in the sealing nail weld breakage detection system, the circular ROI coincides with the center of the welding ring, and the circular ROI is located in the middle of the welding ring.
[0049] Furthermore, in the aforementioned sealing nail weld failure detection system, the ROI determination module is specifically used for:
[0050] A fast template matching algorithm based on gradient integral is used to match the image to be inspected with the template image in order to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
[0051] Furthermore, in the sealing nail weld breakage detection system, the system also includes a template image creation module, used for:
[0052] Obtain a depth image of a standard sealing pin;
[0053] The area of the sealing nail that needs to be inspected is cropped to obtain the template image;
[0054] Draw a circular ROI on the template image.
[0055] Furthermore, in the sealing nail weld breakage detection system, the length of the vertical segment is less than the width of the welding ring.
[0056] Furthermore, in the sealing nail weld breakage detection system, the system also includes a judgment correction module, used for:
[0057] In the above After determining the corresponding point as the solder joint break point, it is determined whether the number of consecutive solder joint break points is greater than the second set threshold.
[0058] If so, it is determined to be a broken weld;
[0059] If not, it is determined to be a false detection.
[0060] Furthermore, in the aforementioned sealing nail weld breakage detection system, the judgment correction module is also used for:
[0061] After the step of determining a false alarm, the consecutive broken solder joints that were determined to be false alarms are corrected to normal solder joints.
[0062] Thirdly, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the sealing nail weld breakage detection method as described in the first aspect above.
[0063] Fourthly, the present invention provides a storage medium containing computer-executable instructions, characterized in that the computer-executable instructions are executed by a computer processor to implement the sealing nail weld breakage detection method as described in the first aspect above.
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] This invention provides a method and system for detecting broken welds on sealing nails. Based on the depth image of the sealing nail, it utilizes the characteristic that normal weld points on the sealing nail appear flatter in the depth image, while broken weld points appear uneven with significant differences in depth values. Combined with image processing, it can realize the detection of broken welds on sealing nails. This method not only has low requirements for the imaging system and computing power, but also does not rely on a large amount of data. Furthermore, it has a fast detection speed, high accuracy, and lower cost. Attached Figure Description
[0066] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0067] Figure 1 This is a flowchart illustrating a sealing nail weld breakage detection method provided in Embodiment 1 of the present invention;
[0068] Figure 2 A schematic diagram of the circular ROI mentioned in Embodiment 1 of the present invention, which coincides with the center of the welding ring and is located in the middle of the welding ring.
[0069] Figure 3A schematic diagram of selecting 8 points on a circular ROI as mentioned in Embodiment 1 of the present invention;
[0070] Figure 4 A schematic diagram of the depth image of a sealing nail with a broken weld defect mentioned in Embodiment 1 of the present invention;
[0071] Figure 5 The schematic diagram mentioned in Embodiment 1 of the present invention shows that 200 points are selected on a circular ROI, and the number of depth values covered by the vertical line segment corresponding to each selected point is 100.
[0072] Figure 6 A schematic diagram of the weld breakage detection results mentioned in Embodiment 1 of the present invention;
[0073] Figure 7 A schematic diagram of the corrected weld breakage detection results mentioned in Embodiment 1 of the present invention;
[0074] Figure 8 This is a functional module diagram of a sealing nail weld breakage detection system provided in Embodiment 2 of the present invention;
[0075] Figure 9 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Detailed Implementation
[0076] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, those skilled in the art will understand that with technological development and the emergence of new scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0077] In the description of this application, it should be understood that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. Furthermore, any terminology used is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0078] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.
[0079] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0080] Example 1
[0081] In view of the shortcomings of existing sealing nail welding inspection technologies, the applicant, based on years of practical experience and professional knowledge in this field, and combined with theoretical application, has actively researched and innovated to create a technology that can overcome the shortcomings of existing technologies, making sealing nail welding inspection technology more practical. After continuous research, design, and repeated prototype production and improvements, this invention, which has proven to be of practical value, has finally been created.
[0082] Please refer to Figure 1 This invention provides a flowchart illustrating a method for detecting weld breakage in sealing nails. This method is applicable to scenarios requiring inspection of the welding quality of sealing nails. The method is executed by a sealing nail weld breakage detection system, which can be implemented using software and / or hardware. The method specifically includes the following steps:
[0083] S101. Obtain the depth image of the sealing nail as the image to be inspected.
[0084] It should be noted that in this embodiment, a 3D line scan camera is used to obtain the depth information of the sealing nail through laser scanning to form a depth image of the sealing nail.
[0085] S102. Using a template matching algorithm, the image to be inspected is matched with a template image to determine a circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
[0086] It should be noted that the circular ROI (Region of Interest) coincides with the center of the welding ring, and the circular ROI is located in the middle of the welding ring, such as... Figure 2 As shown, d1 = d2.
[0087] In this embodiment, step S102 can be further refined to include the following steps:
[0088] A fast template matching algorithm based on gradient integral is used to match the image to be inspected with the template image in order to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
[0089] It should be noted that the specific fast template matching algorithm based on gradient integral is as follows:
[0090] (1) Perform image pyramid decomposition on the template image and the image to be inspected to obtain a series of templates and original images with progressively decreasing resolution from the bottom to the top of the pyramid. The image with the highest resolution is called the bottom image, and the image with the lowest resolution is called the top image. (The template set contains at least 30 contour points at the lowest resolution).
[0091] (2) Calculate the outline of the template at different angles and scales and its corresponding gradient at different resolutions;
[0092] (3) Calculate the gradient of all pixels in the top layer of the original image and normalize it;
[0093] (4) Calculate the gradient integral of the top-level image of the original image based on the size of the top-level image of the template. If the gradient integral at a certain position in the top-level image of the original image is lower than the sum of the gradient values corresponding to the contour points of the top-level image of the template, then that position will not participate in the similarity calculation in (5); otherwise, the similarity calculation will be performed. The gradient integral calculation method is as follows:
[0094] Sum(m,n)=gg(x,y)+gg(u,v)-gg(x,v)-gg(u,y);
[0095] Among them, m=xu, n=yu, gg(x, y)=∑ x′≤x,y′≤y g(x′,y′) and g(x′,y′) are the gradient values at relevant locations on the image to be inspected;
[0096] (5) First, multiply the gradient vectors at the contours of different directions and scales on the template with the gradient vectors at the corresponding positions in the sub-image. Then, sum the products. Finally, based on the final values, obtain a series of target positions, target scales, and target directions that meet the similarity requirements. The similarity calculation formula is:
[0097]
[0098] Where p′, d′ i They are p and d respectively. i The larger the final calculated value, the higher the similarity between the template and the subgraph.
[0099] (6) Repeat the similarity calculation in the vicinity of the target position, target scale and target direction obtained in step (5) until the bottom layer, and finally perform fitting to obtain a high-precision result. (The fitting method can be sub-pixel fitting or curve fitting after spline interpolation of the result).
[0100] In this embodiment, the method further includes a template image creation process, namely, the following steps:
[0101] Obtain a depth image of a standard sealing pin;
[0102] The area of the sealing nail that needs to be inspected is cropped to obtain the template image;
[0103] Draw a circular ROI on the template image.
[0104] S103. Select n points at equal intervals on the circular ROI, and draw a perpendicular line at each selected point to obtain the perpendicular line segment corresponding to each selected point, where n is a positive integer.
[0105] It should be noted that when the number of selected points is n, these points are P1, P2, ..., Pn. A perpendicular line segment is taken at each selected point, as follows: Figure 3 As shown, in Figure 3 In the given n=8, d3=d4. The length of the vertical segment should be less than the width of the weld ring, i.e., d3+d4<d1+d2.
[0106] S104. Extract the depth value covered by each vertical line segment to obtain n sets of sequences, which are represented as follows:
[0107] Pi:v i,1, v i,2 , ..., v i,m (i = 1, 2, ..., n); where m is the number of depth values covered by the vertical segment and serves as the length of the vertical segment, which is adjustable.
[0108] It should be noted that, as Figure 4 As shown, Figure 4 This is a depth image of a sealing nail with a broken weld defect. In this depth image, the successfully welded areas are smoother, while the unwelded areas are rougher.
[0109] For example, taking n=200 and m=100 as an example, Figure 5 As shown, the following sequence can be obtained:
[0110] Point 1 P1: v 1,1 v 1,2 , ..., v 1,100 ;
[0111] Point 2 P2: v 2,1 v 2,2 , ..., v 2,100 ; ...;
[0113] Point 200: v 200,1 v 200,2 , ..., v 200,100 .
[0114] S105. Using the following formula, calculate the first-order forward difference of the sequence corresponding to each of the vertical segments:
[0115] g ij =v i,j+1 -v i,j ,i∈[1,n],j∈[1,m-1].
[0116] For example, take the first point P1 as an example:
[0117] P1:g 1,1 g 1,2 , ..., g 1,99 .
[0118] S106. Based on the obtained first-order forward difference sequence, calculate the variance of the first-order forward difference sequence using the following formula:
[0119]
[0120]
[0121] For example, take the first point P1 as an example:
[0122] The mean of the first-order forward difference series is:
[0123] The variance of the first-order forward difference series is:
[0124] S107, Determine the obtained... Is it greater than the first set threshold? If yes, proceed to step S108; if no, proceed to step S109.
[0125] It should be noted that the first set threshold can be arbitrarily set by technicians based on experience and actual application scenarios, and this embodiment does not impose specific limitations here.
[0126] S108, the above The corresponding point is identified as a broken weld point.
[0127] S109, the above The corresponding point is determined to be a normal welding point.
[0128] For example, taking the first point P1 as an example, when If the value is greater than the first set threshold t = 0.01, then point P1 is considered a broken solder joint. This is used to calculate all selected points Pn, and the detection results are as follows: Figure 6 The red areas represent detected broken weld points, and the green areas represent normal weld points.
[0129] In this embodiment, after step S108, the method further includes the following steps:
[0130] Determine whether the number of consecutive broken solder joints is greater than a second set threshold;
[0131] If so, it is determined to be a broken weld;
[0132] If not, it is determined to be a false detection.
[0133] It should be noted that the second threshold can be arbitrarily set by technicians based on experience and actual application scenarios, and this embodiment does not impose specific limitations on it.
[0134] This step is a protective measure against false detections. In this embodiment, a broken solder joint is only identified when the number of consecutively identified broken solder joints exceeds a second set threshold; otherwise, it is identified as a false detection.
[0135] In this embodiment, after the step of determining it as a false detection, the method further includes:
[0136] The consecutive broken weld points that were identified as false positives were corrected to normal weld points.
[0137] It should be noted that... Figure 6 After correcting the continuous broken solder joints that were initially identified as false positives, the resulting image is as follows. Figure 7 As shown.
[0138] Although this application frequently uses terms such as depth image, template image, region of interest, and vertical segment, the possibility of using other terms is not excluded. These terms are used merely for the convenience of describing and explaining the essence of the invention; interpreting them as any additional limitation would contradict the spirit of the invention.
[0139] This invention provides a method for detecting broken welds on sealing nails. Based on the depth image of the sealing nail, it utilizes the characteristic that normal weld points on the sealing nail appear flatter in the depth image, while broken weld points appear uneven with significant differences in depth values. By combining image processing, the method can detect broken welds on sealing nails. It not only has low requirements for the imaging system and computing power, but also does not rely on a large amount of data. Furthermore, it has a fast detection speed, high accuracy, and lower cost.
[0140] Example 2
[0141] Please refer to Figure 8 , Figure 8 This is a functional module diagram of a sealing nail weld breakage detection system provided in Embodiment 2 of the present invention. This system is applicable to executing the sealing nail weld breakage detection method provided in this embodiment of the present invention. The system specifically includes the following modules:
[0142] Image acquisition module 201 is used to acquire a depth image of the sealing nail as the image to be inspected;
[0143] The ROI determination module 202 is used to match the image to be inspected with a template image using a template matching algorithm, so as to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
[0144] The equidistant point selection module 203 is used to select n points at equal intervals on the circular ROI, and draw a perpendicular line at each selected point to obtain the perpendicular line segment corresponding to each selected point, where n is a positive integer.
[0145] The depth value extraction module 204 is used to extract the depth value covered by each vertical line segment, resulting in n sets of sequences, which are represented as follows:
[0146] Pi:v i,1 v i,2 , ..., v i,m (i = 1, 2, ..., n); where m is the number of depth values covered by the vertical line segment;
[0147] The first calculation module 205 is used to calculate the first-order forward difference of the sequence corresponding to each of the vertical line segments using the following formula:
[0148] g ij =v i,j+1 -v i,j ,i∈[1,n], j∈[1,m-1];
[0149] The second calculation module 206 is used to calculate the variance of the first-order forward difference sequence based on the obtained first-order forward difference sequence using the following formula:
[0150]
[0151]
[0152] Threshold determination module 207 is used to determine the obtained threshold value. Is it greater than a first preset threshold? If so, then... The corresponding point is determined to be a broken solder joint; if not, then the aforementioned point is... The corresponding point is determined to be a normal welding point.
[0153] Preferably, in the sealing nail weld breakage detection system, the circular ROI coincides with the center of the welding ring, and the circular ROI is located in the middle of the welding ring.
[0154] Preferably, in the sealing nail weld failure detection system, the ROI determination module 202 is specifically used for:
[0155] A fast template matching algorithm based on gradient integral is used to match the image to be inspected with the template image in order to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
[0156] Preferably, in the sealing nail weld failure detection system, the system further includes a template image creation module, used for:
[0157] Obtain a depth image of a standard sealing pin;
[0158] The area of the sealing nail that needs to be inspected is cropped to obtain the template image;
[0159] Draw a circular ROI on the template image.
[0160] Preferably, in the sealing nail weld breakage detection system, the length of the vertical segment is less than the width of the welding ring.
[0161] Preferably, in the sealing nail weld breakage detection system, the system further includes a judgment and correction module, used for:
[0162] In the above After determining the corresponding point as the solder joint break point, it is determined whether the number of consecutive solder joint break points is greater than the second set threshold.
[0163] If so, it is determined to be a broken weld;
[0164] If not, it is determined to be a false detection.
[0165] Preferably, in the sealing nail weld breakage detection system, the judgment correction module is further used for:
[0166] After the step of determining a false alarm, the consecutive broken solder joints that were determined to be false alarms are corrected to normal solder joints.
[0167] This invention provides a sealing nail weld breakage detection system. Based on the depth image of the sealing nail, it utilizes the characteristic that normal welding points of the sealing nail appear flatter in the depth image, while broken welding points appear uneven with large differences in depth values. Combined with image processing, it can realize the detection of broken welding points of sealing nails. It not only has low requirements for the imaging system and computing power, but also does not rely on a large amount of data. Moreover, it has fast detection speed, high accuracy, and lower cost.
[0168] The above system can execute the methods provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the methods.
[0169] Example 3
[0170] Figure 9 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 9A block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present invention is shown. Figure 9 The computer device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0171] like Figure 9 As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0172] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0173] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0174] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 9 Not shown; usually referred to as a "hard drive"). Although Figure 9 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0175] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0176] Computer device 12 can also communicate with one or more external devices 15 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although... Figure 9 As not shown, it can be used in conjunction with computer device 12 with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0177] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the sealing nail weld breakage detection method provided in the embodiments of the present invention.
[0178] Example 4
[0179] Embodiment 4 of the present invention provides a computer-readable storage medium storing computer-executable instructions thereon, which, when executed by a processor, implement the sealing nail weld breakage detection method provided in all embodiments of the present application.
[0180] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0181] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0182] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0183] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0184] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of this application can be combined with each other, and any combination of features in different embodiments is also within the protection scope of this application. That is to say, the multiple embodiments described above can also be arbitrarily combined according to actual needs.
[0185] It should be noted that all the above figures are exemplary illustrations of this application and do not represent the actual size of the product. Furthermore, the dimensional proportions between the components in the figures are not intended to limit the actual product of this application.
[0186] Finally, it should be noted that the above descriptions are merely some embodiments and implementations of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. The scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for detecting broken welds on sealing nails, characterized in that, The method includes: Obtain the depth image of the sealing nail as the image to be inspected; A template matching algorithm is used to match the image to be inspected with a template image in order to determine a circular region of interest (ROI) in the image to be inspected that matches the trajectory of the sealing nail. On the circular ROI, n points are selected at equal intervals, and a perpendicular line is drawn at each selected point to obtain the perpendicular line segment corresponding to each selected point, where n is a positive integer; Extract the depth value covered by each of the vertical line segments to obtain n sets of sequences, which are represented as follows: ;in, m is the number of depth values covered by the vertical line segment; The first-order forward difference is calculated for the sequence corresponding to each of the vertical segments using the following formula: ; Based on the obtained first-order forward difference sequence, the variance of the first-order forward difference sequence is calculated using the following formula: ; ; The judgment obtained Is it greater than the first set threshold? If so, then the above The corresponding point is identified as a broken weld point; If not, then the above The corresponding point is determined to be a normal welding point; The step of using a template matching algorithm to match the image to be inspected with a template image to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail includes: A fast template matching algorithm based on gradient integral is used to match the image to be inspected with the template image in order to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
2. The method for detecting broken welds on sealing nails according to claim 1, characterized in that, The circular ROI coincides with the center of the welding ring, and the circular ROI is located in the middle of the welding ring.
3. The method for detecting broken welds on sealing nails according to claim 1, characterized in that, The method further includes: Obtain a depth image of a standard sealing pin; The area of the sealing nail that needs to be inspected is cropped to obtain the template image; Draw a circular ROI on the template image.
4. The method for detecting broken welds on sealing nails according to claim 1, characterized in that, The length of the vertical segment is less than the width of the welding ring.
5. The method for detecting broken welds on sealing nails according to claim 1, characterized in that, In the above After determining the corresponding point as the solder joint break point, the method further includes: Determine whether the number of consecutive broken solder joints is greater than a second set threshold; If so, it is determined to be a broken weld; If not, it is determined to be a false detection.
6. The method for detecting broken welds on sealing nails according to claim 5, characterized in that, After the step of determining a false detection, the method further includes: The consecutive broken weld points that were identified as false positives were corrected to normal weld points.
7. A sealing nail weld breakage detection system, characterized in that, The system includes: The image acquisition module is used to acquire depth images of the sealing nails as images to be inspected; The ROI determination module is used to match the image to be inspected with a template image using a template matching algorithm, so as to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail. The equidistant point selection module is used to select n points at equal intervals on the circular ROI, and draw a perpendicular line at each selected point to obtain the perpendicular line segment corresponding to each selected point, where n is a positive integer. The depth value extraction module is used to extract the depth value covered by each vertical line segment, resulting in n sets of sequences, which are represented as follows: ;in, m is the number of depth values covered by the vertical line segment; The first calculation module is used to calculate the first-order forward difference of the sequence corresponding to each of the vertical line segments using the following formula: ; The second calculation module is used to calculate the variance of the first-order forward difference sequence based on the obtained first-order forward difference sequence using the following formula: ; ; The threshold determination module is used to determine the obtained threshold value. Is it greater than a first preset threshold? If so, then... The corresponding point is determined to be a broken solder joint; if not, then the aforementioned point is... The corresponding point is determined to be a normal welding point; The ROI determination module is specifically used for: A fast template matching algorithm based on gradient integral is used to match the image to be inspected with the template image in order to determine the circular region of interest (ROI) in the image to be inspected that conforms to the trajectory of the sealing nail.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the sealing nail breakage detection method as described in any one of claims 1-6.
9. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions are executed by a computer processor to implement the sealing nail breakage detection method as described in any one of claims 1-6.
Citation Information
Patent Citations
Fuzzy boundary circular ring center detection method and system
CN115908566A