Weld joint real-time detection method and system, medium and electronic equipment
By obtaining weld images and segmentation tip points, calculating the change in the linear distance of the weld edge, and detecting the weld position offset in real time, solving the efficient and low-cost problem of weld position detection in automated welding, and achieving a high-precision welding process.
Patent Information
- Application Number
- CN202411871631.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
AI Technical Summary
During the automated welding process, how to efficiently and at low cost to detect whether the weld position is offset to ensure welding accuracy and quality.
By obtaining the weld image and weld segmentation tip points at the current moment, obtaining the straight line of the weld edge, calculating the change in the straight line distance of the edge, and detecting whether the weld position is offset in real time.
It realizes accurate extraction of weld areas, detects changes in weld position in real time, and is suitable for a wide range of welding application scenarios, improving welding accuracy and environmental robustness.
Smart Images

Figure CN119810054A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of welding technology, and in particular relates to a real-time weld detection method, system, medium and electronic equipment. Background Art
[0002] Welding is a widely used forming technology. With the increasing demand for high-precision and high-efficiency welding in industrial production, automated welding technology is gradually replacing traditional manual welding due to its advantages in welding quality, consistency and production safety. In order to ensure the accuracy of welding and improve welding quality, weld tracking and recognition technology is often required in the automated welding process to monitor in real time whether the weld position is offset. Therefore, how to detect the weld position efficiently and at a low cost is a technical problem that needs to be solved urgently by technicians in this field. Summary of the invention
[0003] The purpose of this application is to provide a real-time weld detection method, system, device and storage medium, which can detect the weld position efficiently and at low cost.
[0004] In a first aspect, the present application provides a real-time weld detection method, the method comprising:
[0005] Obtain the current weld edge straight line based on the weld image at the current moment and the weld segmentation prompt point;
[0006] Obtaining the current distance of the current weld edge straight line;
[0007] Calculate the difference between the current distance and the distance to the weld edge straight line at the previous moment;
[0008] The weld position is detected in real time based on the difference variation.
[0009] In an implementation of the first aspect, obtaining a current weld edge straight line based on a weld image at a current moment and a weld segmentation prompt point includes:
[0010] Inputting the weld image and the weld segmentation prompt points at the current moment into the weld segmentation model to obtain a result image;
[0011] Perform contour extraction based on the result image to obtain the accurate area of the weld edge;
[0012] A straight line fitting is performed based on the accurate area of the weld edge to obtain the current weld edge straight line.
[0013] In an implementation of the first aspect, performing contour extraction based on the result image to obtain an accurate weld edge area includes:
[0014] removing the noise area of the mask in the result image;
[0015] Perform contour extraction on the processed mask based on the set minimum area threshold to obtain the contour area;
[0016] The accurate area of the weld edge is selected based on the contour area.
[0017] In an implementation manner of the first aspect, removing the noise area of the mask in the result image includes:
[0018] Create a rectangular kernel;
[0019] An erosion operation and a dilation operation are performed on the mask based on the rectangular kernel to remove a noise region of the mask in the result image.
[0020] In an implementation of the first aspect, selecting the accurate area of the weld edge based on the contour area includes:
[0021] Extracting the circumscribed rectangle of the contour area;
[0022] The upper and lower boundaries of the circumscribed rectangle are reduced inwards to obtain an actual rectangle;
[0023] Acquire a first rectangle and a second rectangle based on the actual rectangle;
[0024] The accurate area of the weld edge is selected based on the first rectangle and the second rectangle.
[0025] In an implementation of the first aspect, detecting the weld position in real time based on the difference variation includes:
[0026] When the difference change is greater than any preset threshold, the weld position shifts;
[0027] When the difference change is not greater than the preset threshold, the weld position is not offset.
[0028] In an implementation of the first aspect, the method further includes acquiring the weld segmentation model; wherein:
[0029] Acquire multiple weld images;
[0030] Creating a corresponding label image for each weld image, wherein the label image includes a weld foreground with a pixel value of 1 and a background with a pixel value of 0;
[0031] Constructing a weld image dataset based on the plurality of weld images and the plurality of label images;
[0032] The visual segmentation model is trained based on the weld image data set to obtain the weld segmentation model.
[0033] In a second aspect, the present application provides a real-time weld detection system, the system comprising:
[0034] An acquisition module, used for acquiring the current weld edge straight line based on the weld image at the current moment and the weld segmentation prompt point;
[0035] A first calculation module, used to obtain the current distance of the current weld edge straight line;
[0036] A second calculation module is used to calculate the difference between the current distance and the distance to the weld edge straight line at the previous moment;
[0037] The real-time detection module is used to detect the weld position in real time based on the difference change.
[0038] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the electronic device performs the above-mentioned real-time weld detection method.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by an electronic device, implements the above-mentioned real-time weld detection method.
[0040] As described above, the real-time weld detection method, system, equipment and storage medium described in the present application have the following beneficial effects: the present application can accurately extract the weld area, detect the weld position changes in real time and make corresponding adjustments, can be applied to a wide range of welding application scenarios, is more robust to the environment, and ensures welding accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 Shown is a schematic diagram of an application scenario of the real-time weld detection method described in this application.
[0042] Figure 2 Shown is a schematic flow chart of a real-time weld detection method according to an embodiment of the present application.
[0043] Figure 3 Shown is a schematic flow chart of a real-time weld detection method according to an embodiment of the present application.
[0044] Figure 4 A schematic diagram showing the weld segmentation prompt points described in an embodiment of the present application in an embodiment.
[0045] Figure 5 Shown is a schematic flow chart of a real-time weld detection method according to an embodiment of the present application.
[0046] Figure 6 Shown is a schematic diagram of the principle of the weld segmentation model described in an embodiment of the present application.
[0047] Figure 7 Shown is a schematic flow chart of a real-time weld detection method according to an embodiment of the present application.
[0048] Figure 8 A schematic diagram showing a straight line of a weld edge according to an embodiment of the present application in one embodiment.
[0049] Figure 9a A schematic diagram showing the distance to the current weld edge straight line according to an embodiment of the present application is shown in one embodiment.
[0050] Figure 9b A schematic diagram showing the distance between the straight lines of the weld edges at a previous moment described in an embodiment of the present application in an embodiment.
[0051] Fig.10 Shown is a schematic structural diagram of a real-time weld detection system in one embodiment of the present application.
[0052] Fig.11 Shown is a schematic structural diagram of an electronic device of the present application in one embodiment. DETAILED DESCRIPTION
[0053] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0054] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0055] In addition, in this application, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0056] In traditional weld tracking and identification methods, it is often necessary to rely on external signals and sensors such as lasers and ultrasound to obtain weld feature information, and to achieve real-time adjustment of the welding path through feedback control. However, these methods usually have high requirements for the environment and are easily disturbed by high temperature, smoke, reflections, etc. during the welding process. At the same time, monitoring systems based on lasers, ultrasound, etc. require additional supporting equipment and special installation and debugging, which increases the overall equipment investment and maintenance costs. Therefore, how to detect the weld position efficiently and at a low cost is a technical problem that needs to be solved urgently by technicians in this field.
[0057] In order to at least solve the above-mentioned problems, an embodiment of the present application provides a real-time weld detection method, which can accurately extract the weld area, detect the weld position change and make corresponding adjustments, can be applicable to a wide range of welding application scenarios, is more robust to the environment, and ensures welding accuracy.
[0058] In some other embodiments, the real-time weld detection method provided in the embodiments of the present application can be applied to Figure 1 The real-time weld detection device shown in FIG. Figure 1 As shown, the real-time weld detection device 1 includes a processor 11 and a database 12. The real-time weld detection method provided in the embodiment of the present application can be applied to the processor 11.
[0059] in, Figure 1 The processor 11 in the embodiment may be a single processor or a processor cluster or a cloud computing center composed of multiple processors, and the specific details are not limited here. Figure 1 Only one processor 11 and one database 12 are shown, but it should be understood that Figure 1 The examples are only used to understand the present solution, and the specific numbers of processors 11 and databases 12 should be flexibly determined based on actual conditions.
[0060] In some other embodiments, the real-time weld detection device 1 may not include the database 12, but only include a processor 11 with a storage function. The real-time weld detection method provided in the embodiment of the present application can be applied to the processor 11. The processor 11 with a storage function may include a computer, a mobile phone, etc., which is not limited here.
[0061] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application.
[0062] The following embodiments of the present application provide a real-time detection method for welds. For example, Figure 1 The processor 11 is shown to implement it. Figure 2 The flowchart of the real-time weld detection method described in the embodiment of the present application is shown as follows: Figure 2 As shown, the real-time weld detection method includes steps S1 to S4.
[0063] S1. Obtain the current weld edge straight line based on the weld image at the current moment and the weld segmentation prompt point.
[0064] Specifically, in order to detect the weld position in real time, it is necessary to accurately extract the weld area, that is, to obtain the current weld edge straight line. Figure 3 The flowchart of the real-time weld detection method described in the embodiment of the present application is shown as follows: Figure 3 As shown, obtaining the current weld edge straight line based on the weld image at the current moment and the weld segmentation prompt points includes steps S11 to S13.
[0065] S11, inputting the weld image and the weld segmentation prompt points at the current moment into a weld segmentation model to obtain a result image.
[0066] In some embodiments, by establishing a visual system, an industrial camera is used to collect weld images in real time without an external light source as the weld image at the current moment. Among them, the camera is the core part of the visual system. When selecting an industrial camera, a high frame rate camera (for example, 30 frames per second or higher) is required to collect weld images in real time. In addition, the welding site usually requires a wide range of vision, so it is necessary to select a lens with an appropriate focal length to ensure that the entire weld area can be clearly captured. In addition, in order to improve the imaging effect in a low-light environment, a large aperture lens (such as f / 2.8 or larger) can be selected to increase the amount of light entering.
[0067] In some embodiments, a five-point method is used to select the weld segmentation prompt points in different scenarios. Figure 4 As shown in the figure, a point is selected at each of the four corners and the center of the weld as the weld segmentation prompt point (refer to Figure 4This can better avoid under-segmentation and over-segmentation of the weld caused by inaccurate prompt points.
[0068] Furthermore, after obtaining the weld image at the current moment and the weld segmentation prompt point, the two are input into the weld segmentation model, and the weld segmentation model inputs the result image, and the result image includes two parts: the weld part and the background.
[0069] Figure 5 The flowchart of the real-time weld detection method described in the embodiment of the present application is shown as follows: Figure 5 As shown, obtaining the weld segmentation model includes steps S111 to S114.
[0070] S111. Acquire multiple weld seam images.
[0071] S112, creating a corresponding label image for each weld image, wherein the label image includes a weld foreground with a pixel value of 1 and a background with a pixel value of 0.
[0072] S113: construct a weld image dataset based on the multiple weld images and the multiple label images.
[0073] In some embodiments, weld image data in different welding scenarios can be captured by an industrial camera, and ImageJ software can be used to create a label image for each weld image. The label image is binary, with only a weld foreground with a pixel value of 1 and a background with a pixel value of 0. In this way, a weld image dataset is constructed using multiple weld images and corresponding label images.
[0074] S114. Training a visual segmentation model based on the weld image dataset to obtain the weld segmentation model.
[0075] Specifically, a visual segmentation model is selected as a basic model for training to obtain the weld segmentation model. In some embodiments, the visual segmentation model may select the SAM 2 model (Segment Anything Model 2), which is capable of generating high-quality object masks given a prompt. The SAM 2 model includes an image encoder, a prompt encoder, a mask decoder, a memory attention module, and a memory repository. The image encoder adopts the tiny-ViT scale, uses the weld image dataset to fine-tune the prompt encoder and mask decoder, and uses prompt points for prompting. Figure 6As shown, the weld image data and cue points in the weld image data set are input into the visual segmentation model, the image passes through the image encoder and the memory attention module in sequence and then enters the mask decoder, while the cue points pass through the cue encoder and then enter the mask decoder, the mask decoder outputs the segmentation result, and the above process is continuously executed to achieve fine-tuning of the cue encoder and the mask decoder using the weld image data set, and finally obtain the weld segmentation model suitable for the weld segmentation application scenario.
[0076] S12: Perform contour extraction based on the result image to obtain the accurate area of the weld edge.
[0077] Specifically, since the result image usually has over-segmentation, the result image cannot be used directly. After the result image is obtained through the weld segmentation model, the result image should be further processed. Figure 7 The flowchart of the real-time weld detection method described in the embodiment of the present application is shown as follows: Figure 7 As shown, performing contour extraction based on the result image to obtain the accurate area of the weld edge includes steps S121 to S123.
[0078] S121, removing the noise area of the mask in the result image.
[0079] Specifically, the implementation method of removing the noise area of the mask in the result image includes: creating a rectangular kernel; and performing an erosion operation and a dilation operation on the mask based on the rectangular kernel to remove the noise area of the mask in the result image.
[0080] In some embodiments, the result image is morphologically processed to create a 5x5 rectangular kernel, and a morphological opening operation is performed on the mask, that is, an erosion operation is performed first and then a dilation operation is performed to remove small noise areas in the mask.
[0081] Among them, during the erosion operation, the 5x5 rectangular kernel will "slide" on the result image. When a complete kernel area in the result image area is "matched", the foreground pixels in the area are retained, otherwise the foreground pixels in the area are removed. That is, during the erosion operation, the rectangular kernel will slide around each pixel of the result image. Only when the rectangular kernel is completely adapted to the current pixel area, the central pixel will remain as the foreground (i.e., white). If any pixel in the kernel is the background (i.e., black), the central pixel will be eroded. Therefore, by using a rectangular kernel of a suitable size (such as 5x5), small noise and spots in the result image can be effectively removed.
[0082] In the dilation operation, the 5x5 rectangular kernel is used to "expand" the foreground area, and the foreground area will expand toward the neighborhood of the rectangular kernel, thereby increasing the area of the foreground part of the image. In other words, the rectangular kernel will "expand" the foreground area. If the rectangular kernel covers a foreground pixel (i.e., white) in the image, the pixels in that area will be expanded into the foreground, thereby making the foreground area larger.
[0083] S122 . Perform contour extraction on the processed mask based on the set minimum area threshold to obtain a contour area.
[0084] Specifically, after removing the noise area of the mask in the result image, in order to retain the required weld edge, it is necessary to set a minimum area threshold, and perform contour extraction on the processed mask based on the set minimum area threshold to obtain the contour area.
[0085] In some embodiments, the minimum area threshold is set to one fifth of the maximum contour area in the result image, and when performing contour extraction, only areas with an area larger than the threshold are retained as the required contour areas.
[0086] S123, selecting the accurate area of the weld edge based on the contour area.
[0087] Specifically, after obtaining the contour area, it is necessary to select an accurate area for extracting the weld edge, that is, the accurate weld edge area. In some embodiments, the implementation method of selecting the accurate weld edge area based on the contour area includes: extracting a circumscribed rectangle of the contour area; shrinking the upper and lower boundaries of the circumscribed rectangle inward to obtain an actual rectangle; obtaining a first rectangle and a second rectangle based on the actual rectangle; and selecting the accurate weld edge area based on the first rectangle and the second rectangle.
[0088] In some embodiments, the circumscribed rectangle A of the contour area is first determined, and the rectangle A can surround the entire contour area. Then, the upper and lower boundaries of the circumscribed rectangle A are each reduced inward by 15% to obtain the actual rectangle B. This reduction operation can remove some unnecessary areas and focus on the actual area of the weld. Then, the left half of the actual rectangle B is selected as rectangle C1, and the right half of the actual rectangle B is selected as rectangle C2. The left edge of the weld can be extracted through the edge in rectangle C1, and the right edge of the weld can be extracted through rectangle C2.
[0089] In some embodiments, there are two welds L1 and L2, and the exact weld edge area needs to be extracted. The actual rectangles of the two welds can be set to B1 and B2 from left to right. Then B1 can select the left edge within B1-C1, and B2 can also select the left edge within B2-C1. It should be noted that the corresponding left and right edges in C1 and C2 can be selected according to the situation. In fact, the inner edges of rectangles C1 and C2 are regarded as the exact edges of the welds, because they focus on the two side areas of the welds, avoid interference areas, and can more accurately extract the true contour of the welds.
[0090] S13, performing straight line fitting based on the accurate area of the weld edge to obtain the current weld edge straight line.
[0091] In some embodiments, after obtaining the accurate area of the weld edge, a least squares straight line is fitted to the edge to obtain the current weld edge straight line, such as Figure 8 shown.
[0092] S2. Obtain the current distance of the current weld edge straight line.
[0093] Specifically, Figure 8 As shown, in fact, the current weld edge straight lines are two boundary lines of the weld edge accurate area, which are recorded as l1 and l2. After the current weld edge straight lines, i.e. l1 and l2, are obtained, the current distance d between the two straight lines can be obtained.
[0094] In some embodiments, when two edge lines are parallel, they can be calculated using the following formula:
[0095]
[0096] Where b1 and b2 are the intercepts of the two lines and m1 is their common slope.
[0097] In some embodiments, if the two edge lines are not parallel, a point on one of the edge lines can be selected and then the distance from the point to the other line can be calculated. Then for point p (x0, y0) and line ax+by+c=0, the shortest distance d from point p to the line is:
[0098]
[0099] S3. Calculate the difference between the current distance and the distance to the weld edge straight line at the previous moment.
[0100] In some embodiments, the current distance is recorded as d t2 , represents the weld image corresponding to the current time t2 (such as Figure 9a As shown in the figure), the distance of the weld edge straight line obtained at the previous moment t1 is recorded as dt1 (like Figure 9b As shown), the difference change Δd = d t2 -d t1 That is, the difference change Δd represents the change of the distance between the edge lines over time. In fact, the distance between the edge lines represents the distance between the edge line of the weld and the edge line of the previous weld.
[0101] It should be noted that the distance of the weld edge straight line at the previous moment is also obtained by executing step S1 to step S2. That is, the method provided by the present application detects the change of the distance of the weld edge straight line in real time to detect the weld position.
[0102] S4. Detect the weld position in real time based on the difference variation.
[0103] Specifically, when the difference change is greater than any preset threshold, the weld position shifts; when the difference change is not greater than the preset threshold, the weld position does not shift.
[0104] In some embodiments, when the difference change amount Δd≤0.2 mm, it indicates that the weld position has not shifted and the welding quality is qualified. On the contrary, if the difference change amount Δd>0.2 mm, it indicates that the weld position has shifted.
[0105] Therefore, the real-time weld detection method described in the embodiment of the present application can accurately extract the weld area, and detect in real time whether the weld position changes according to the change in the distance between the edge straight lines over time, and make corresponding adjustments accordingly. Therefore, the present application can be applicable to a wide range of welding application scenarios, has stronger robustness to the environment, and ensures welding accuracy.
[0106] The protection scope of the real-time weld detection method described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0107] An embodiment of the present application also provides a real-time weld detection system, which can implement the real-time weld detection method described in the present application. However, the implementation device of the real-time weld detection system described in the present application includes but is not limited to the structure of the real-time weld detection system listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0108] Fig.10 The structure diagram of the real-time weld detection system described in the embodiment of the present application is shown as follows: Fig.10As shown, the weld real-time detection system 4 includes an acquisition module 41 , a first calculation module 42 , a second calculation module 43 and a real-time detection module 44 .
[0109] An acquisition module 41 is used to acquire the current weld edge straight line based on the weld image at the current moment and the weld segmentation prompt point;
[0110] A first calculation module 42, used to obtain the current distance of the current weld edge straight line;
[0111] A second calculation module 43 is used to calculate the change in the distance between the current distance and the distance between the weld edge straight line at the previous moment;
[0112] The real-time detection module 44 is used to detect the weld position in real time based on the variation.
[0113] It should be noted that the structures and principles of the acquisition module 41, the first calculation module 42, the second calculation module 43 and the real-time detection module 44 correspond one to one with the steps in the above-mentioned weld real-time detection method, so they are not described in detail here.
[0114] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.
[0115] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0116] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. 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 this application.
[0117] The present application embodiment also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by a program to instruct the processor, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state hard disk (SSD)), etc.
[0118] The embodiment of the present application further provides an electronic device, wherein the electronic device includes a processor and a memory.
[0119] The memory is used to store computer programs.
[0120] The memory includes: ROM, RAM, disk, USB flash drive, memory card or CD and other media that can store program codes.
[0121] The processor is connected to the memory and is used to execute the computer program stored in the memory so that the electronic device executes the above-mentioned real-time weld detection method.
[0122] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0123] like Fig.11 As shown, the electronic device of the present application is in the form of a general computing device. The components of the electronic device may include but are not limited to: one or more processors or processing units 51, a memory 52, and a bus 53 connecting different system components (including the memory 52 and the processing unit 51).
[0124] Bus 53 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0125] Electronic devices typically include a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, removable and non-removable media.
[0126] The memory 52 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 521 and / or cache memory 522. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 523 may be used to read and write non-removable, non-volatile magnetic media ( Fig.11 not shown, usually called a "hard drive"). Although Fig.11Not 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, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 53 via one or more data medium interfaces. The memory 52 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0127] A program / utility 524 having a set (at least one) of program modules 5241 may be stored, for example, in the memory 52, such program modules 5241 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 5241 generally perform the functions and / or methods of the embodiments described herein.
[0128] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, displays, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via input / output (I / O) interface 54. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 55. Fig.11 As shown, the network adapter 55 communicates with other modules of the electronic device via the bus 53. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0129] The present application embodiment may also provide a computer program product, the computer program product including one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer or data center.
[0130] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0131] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0132] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A real-time detection method for welds, characterized in that: The method comprises: Obtain the current weld edge straight line based on the weld image at the current moment and the weld segmentation prompt point; Obtaining the current distance of the current weld edge straight line; Calculate the difference between the current distance and the distance to the weld edge straight line at the previous moment; The weld position is detected in real time based on the difference variation.
2. The real-time weld detection method according to claim 1, characterized in that: Based on the weld image and weld segmentation prompt points at the current moment, the current weld edge straight line is obtained, including: Inputting the weld image and the weld segmentation prompt points at the current moment into the weld segmentation model to obtain a result image; Perform contour extraction based on the result image to obtain the accurate area of the weld edge; A straight line fitting is performed based on the accurate area of the weld edge to obtain the current weld edge straight line.
3. The real-time weld detection method according to claim 2, characterized in that: Performing contour extraction based on the result image to obtain the accurate area of the weld edge includes: removing the noise area of the mask in the result image; Perform contour extraction on the processed mask based on the set minimum area threshold to obtain the contour area; The accurate area of the weld edge is selected based on the contour area.
4. The real-time weld detection method according to claim 3, characterized in that: Removing the noise area of the mask in the result image includes: Create a rectangular kernel; An erosion operation and a dilation operation are performed on the mask based on the rectangular kernel to remove a noise region of the mask in the result image.
5. The real-time detection method for welds according to claim 3, characterized in that: Selecting the accurate area of the weld edge based on the contour area includes: Extracting the circumscribed rectangle of the contour area; The upper and lower boundaries of the circumscribed rectangle are reduced inwards to obtain an actual rectangle; Acquire a first rectangle and a second rectangle based on the actual rectangle; The accurate area of the weld edge is selected based on the first rectangle and the second rectangle.
6. The real-time weld detection method according to claim 1, characterized in that: Detecting the weld position in real time based on the difference variation includes: When the difference change is greater than any preset threshold, the weld position shifts; When the difference change is not greater than the preset threshold, the weld position is not offset.
7. The real-time detection method for welds according to claim 2, characterized in that: The method further includes obtaining the weld segmentation model; wherein: Acquire multiple weld images; Creating a corresponding label image for each weld image, wherein the label image includes a weld foreground with a pixel value of 1 and a background with a pixel value of 0; Constructing a weld image dataset based on the plurality of weld images and the plurality of label images; The visual segmentation model is trained based on the weld image data set to obtain the weld segmentation model.
8. A real-time weld detection system, characterized in that: The system comprises: An acquisition module, used for acquiring the current weld edge straight line based on the weld image at the current moment and the weld segmentation prompt point; A first calculation module, used to obtain the current distance of the current weld edge straight line; A second calculation module is used to calculate the difference between the current distance and the distance to the weld edge straight line at the previous moment; The real-time detection module is used to detect the weld position in real time based on the difference change.
9. An electronic device, characterized in that: include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the electronic device executes the real-time weld detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by an electronic device, the real-time weld detection method described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Ultrasonic image intelligent processing method and system for invisible weld joint
CN121147179A