A method, apparatus, equipment and medium for welding based on 3D vision
By using a 3D vision-based welding method, the welding position of the electrical box is automatically identified and the welding trajectory is generated, which solves the problem of low efficiency of manual teaching in sheet metal processing and improves the automation level and product quality of electrical box welding.
Patent Information
- Application Number
- CN202310923462.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-26
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-07-26
AI Technical Summary
Current sheet metal processing for electrical box welding suffers from problems such as small workpiece batches, diverse styles, low efficiency of manual teaching, poor jig repeatability, and inability to adapt to product deformation.
Using a 3D vision-based method, edge contour images are obtained by scanning template products, the lines to be welded and endpoints are determined, the target welding trajectory is generated, and automatic welding is performed using a robotic arm or robot.
It achieves automatic identification of welding positions, saves labor costs, improves production efficiency and product qualification rate, and is easy to operate.
Smart Images

Figure CN117817162B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated processing technology, and in particular to a method, apparatus, equipment and medium for welding based on 3D vision. Background Technology
[0002] Sheet metal processing refers to the processing of thin sheet metal parts through methods such as stamping, bending, and stretching. A general definition is that it involves parts or products whose thickness remains constant during processing. Electrical boxes are one type of sheet metal processing product. Sheet metal products are divided into standard parts and non-standard parts. Electrical boxes are standard parts, but can also be called non-standard parts. Some electrical boxes are custom-made to specific dimensions for user convenience, and are one type of non-standard electrical box.
[0003] Electrical boxes are categorized into distribution boxes and low-voltage boxes. These boxes are all fabricated from sheet metal. The sheet metal boxes are then welded by a robot with human intervention at specific points. Due to the small batch size and variety of workpieces, the repeatability of fixtures is poor. Manual teaching is inefficient; existing vision-guided systems require manual instruction of weld positions and welding postures, which is complex and tedious. Each new model requires extensive pre-planning, and because sheet metal boxes deform during manufacturing, specialized fixtures are needed, as conventional equipment cannot accommodate product deformation. Summary of the Invention
[0004] To address the shortcomings of the existing technology, the present invention aims to provide a welding method based on 3D vision. This invention can automatically identify welding positions, automatically generate welding locations and processes, save labor costs, significantly improve unit production efficiency, increase product qualification rate, and is easy to operate.
[0005] According to an embodiment of the present invention, a first solution is provided: a welding method based on 3D vision, the method comprising: scanning a template product to obtain a template image corresponding to the template product; acquiring an edge contour image of the template image; determining at least one line to be welded and at least two welding endpoints based on the edge contour image; determining a target welding trajectory based on the at least one line to be welded and the at least two welding endpoints, wherein an execution device performs welding according to the target welding trajectory.
[0006] Furthermore, as a more preferred embodiment of the present invention, determining at least one line to be welded and at least two welding endpoints based on the edge contour image includes: establishing a first spatial coordinate system based on the template image; obtaining the X-axis and Y-axis in the first spatial coordinate system, wherein the X-axis and Y-axis are perpendicular to each other; extracting a first line to be welded from the edge contour image in the positive direction of the X-axis; extracting a second line to be welded from the edge contour image in the positive direction of the Y-axis; extracting a third line to be welded from the edge contour image in the negative direction of the X-axis; and obtaining at least two welding endpoints based on the first line to be welded, the second line to be welded, and the third line to be welded.
[0007] Furthermore, as a more preferred embodiment of the present invention, determining the target welding trajectory based on the at least one welding line and the at least two welding endpoints includes: segmenting each of the at least one welding line to obtain multiple welding segments with the same spacing; and obtaining the segment points other than the at least two welding endpoints. Obtain the paragraph circle corresponding to the paragraph point; perform positive and negative copy offset on the paragraph circle to obtain a positive paragraph circle and a negative paragraph circle corresponding to each paragraph circle; obtain the target welding length based on the positive and negative paragraph circles corresponding to each paragraph circle; connect the target welding length with the at least two welding endpoints to obtain the target welding trajectory.
[0008] Furthermore, as a more preferred embodiment of the present invention, after connecting the target welding length with the at least two welding endpoints to obtain the target welding trajectory, the method further includes: obtaining the Z-axis coordinate of the edge contour in the first spatial coordinate system; moving the target welding trajectory along the positive Z-axis according to a preset segment length to obtain an elevated welding trajectory, wherein the execution device performs welding according to the elevated welding trajectory.
[0009] Furthermore, as a more preferred embodiment of the present invention, obtaining the edge contour image of the template image includes: obtaining pixels in the template image; filtering out target pixels that meet a preset grayscale value; selecting the region of the target pixels to form an edge contour image.
[0010] According to an embodiment of the present invention, a second solution provided by the present invention is: a welding apparatus based on 3D vision, characterized in that the apparatus comprises: a scanning module for scanning a template product to obtain a template image corresponding to the template product; an acquisition module for acquiring an edge contour image of the template image; a determination module for determining at least one line to be welded and at least two welding endpoints based on the edge contour image; the determination module is further configured to determine a target welding trajectory based on the at least one line to be welded and the at least two welding endpoints, wherein an execution device performs welding according to the target welding trajectory.
[0011] According to an embodiment of the present invention, a third solution is provided by the present invention: a computer device including a memory and a processor, the memory storing a computer program, the computer program being executed by the processor, the program including instructions for use as in the first solution.
[0012] According to an embodiment of the present invention, a fourth solution is provided by the present invention: a computer storage medium is provided, the computer storage medium storing one or more instructions, the one or more instructions being adapted to be loaded by a processor and executed as described in the first solution above and any possible implementation thereof.
[0013] This application first scans the template product to obtain a template image corresponding to the template product. Next, it acquires the edge contour image of the template image. Then, based on the edge contour image, it determines at least one line to be welded and at least two welding endpoints. Finally, it determines a target welding trajectory based on the at least one line to be welded and the at least two welding endpoints. The executing device then performs welding according to the target welding trajectory. This invention can automatically identify welding positions and automatically generate welding locations and processes, saving labor costs, significantly improving unit production efficiency, increasing product qualification rate, and simplifying operation. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0015] Figure 1 A schematic flowchart illustrating a welding method based on 3D vision provided in an embodiment of this application; Figure 2A This is a schematic diagram of a partial scanning module provided in an embodiment of this application; Figure 2B This application provides a schematic diagram of a completed module image after splicing, as shown in an embodiment. Figure 2CThis is a schematic diagram of the edge contour image of a product provided in an embodiment of this application; Figure 2D This is a schematic diagram illustrating three welding methods provided in an embodiment of this application; Figure 2E A schematic diagram of the welding length provided for an embodiment of this application; Figure 2F A schematic diagram illustrating the entire welding process using 3D vision, provided for an embodiment of this application; Figure 3 A schematic flowchart illustrating a welding method based on 3D vision provided in an embodiment of this application; Figure 4 A schematic diagram of a welding device based on 3D vision provided in an embodiment of this application; Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0016] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the 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.
[0017] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on or indirectly set on the other component; when a component is referred to as being "connected to" another component, it can be directly connected to or indirectly connected to the other component.
[0018] It should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", and "outer" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or component referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0019] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" or "several" means two or more, unless otherwise explicitly specified.
[0020] It should be noted that the structures, proportions, sizes, etc., shown in the accompanying drawings of this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the conditions under which this application can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size should still fall within the scope of the technical content disclosed in this application, provided that they do not affect the effects and purposes that this application can produce.
[0021] The embodiments of this application are described below with reference to the accompanying drawings.
[0022] Please see Figure 1 , Figure 1 This is a flowchart illustrating a welding method based on 3D vision provided in an embodiment of this application. The method may include: 101. The computer equipment scans the template product to obtain a template image corresponding to the template product.
[0023] In this process, a visual tool is used to perform 3D scanning of the template product to obtain a template image. In one embodiment, the scope of a single scan is limited. For medium to large-sized products, multiple scans are required, and then the results of the multiple scans are stitched together to obtain a complete template image.
[0024] The aforementioned template products can be electrical boxes or sheet metal boxes, etc., and are not limited to a single type.
[0025] For example, such as Figure 2A As shown, medium and large-sized products are divided into six modules. (For example...) Figure 2B As shown, Figure 2B This is the complete template image for splicing.
[0026] 102. Obtain the edge contour image of the template image.
[0027] The aforementioned edge contour image is a shape image of the product.
[0028] In one possible example, obtaining the edge contour image of the template image includes: obtaining pixels in the template image; filtering out target pixels that meet a preset grayscale value; selecting the region of the target pixels to form an edge contour image.
[0029] The preset grayscale value can be set manually or obtained based on experience; there is no single limitation here.
[0030] like Figure 2C As shown in the figure, the edge contour image of the product is shown in the figure.
[0031] 103. Based on the edge contour image, determine at least one line to be welded and at least two welding endpoints.
[0032] Among them, if Figure 2C As shown in the edge contour image, there are three lines to be welded and four welding endpoints. The right edge does not need to be welded.
[0033] If the model product is a quadrilateral, welding is only required on any one side. Therefore, this solution requires welding on at least one side and two endpoints.
[0034] In one possible example, determining at least one line to be welded and at least two welding endpoints based on the edge contour image includes: establishing a first spatial coordinate system based on the template image; obtaining the X-axis and Y-axis in the first spatial coordinate system, wherein the X-axis and Y-axis are perpendicular to each other; extracting a first line to be welded from the edge contour image in the positive direction of the X-axis; extracting a second line to be welded from the edge contour image in the positive direction of the Y-axis; extracting a third line to be welded from the edge contour image in the negative direction of the X-axis; and obtaining at least two welding endpoints based on the first line to be welded, the second line to be welded, and the third line to be welded.
[0035] like Figure 2C As shown, a camera space coordinate system (XYZ) is established in the template image.
[0036] In one possible example, obtaining at least two welding endpoints based on the first, second, and third welding lines includes: obtaining the intersection endpoints of the first, second, and third welding lines and the endpoint of each welding line; obtaining the coordinates of the intersection endpoints and the coordinates of the endpoints of each welding line; if there are identical coordinates, merging the two welding endpoints with the same coordinates into one welding endpoint; and combining the merged welding endpoint with the unmerged welding endpoints to form at least two welding endpoints.
[0037] In this process, the intersecting endpoints do not need to be welded repeatedly to the endpoints of each line to be welded; that is, after merging, a single welding endpoint is obtained.
[0038] 104. A target welding trajectory is determined based on the at least one line to be welded and the at least two welding endpoints, wherein the execution device performs welding based on the target welding trajectory.
[0039] The execution device can be a robotic arm, robotic hand, or robot, or other equipment capable of welding.
[0040] The welding trajectory mentioned above can be a discontinuous trajectory, that is, a trajectory with intervals.
[0041] Optionally, the execution device can perform welding according to the above-mentioned target welding trajectory, in which case the welding is welding with a safe distance already in place.
[0042] The welding method for the welding endpoints is spot welding. The welding method for the wire to be welded can be segment welding or continuous welding. The welding method for the wire to be welded is set by the user or obtained from historical template products, and is not limited to a single method here.
[0043] like Figure 2D As shown, Figure 2D This is a schematic diagram of three welding methods.
[0044] In one possible example, determining the target welding trajectory based on the at least one line to be welded and the at least two welding endpoints includes: segmenting each of the at least one line to be welded to obtain multiple welding segments with the same spacing; obtaining segment points other than the at least two welding endpoints; obtaining the segment circles corresponding to the segment points; performing positive and negative copy offsets on the segment circles to obtain a positive segment circle and a negative segment circle for each segment circle; obtaining the target welding length based on the positive and negative segment circles for each segment circle; and connecting the target welding length with the at least two welding endpoints to obtain the target welding trajectory.
[0045] The segmentation process described above can be customized based on human settings or the size of the module product to determine the number of welding segments, thereby creating welding segments with the same spacing.
[0046] Among them, such as Figure 2E As shown, the circle B is the segment point, and B is the segment circle. Move B along the X-axis, positive and negative. Move it in the positive direction and copy a circle A of the same size as B, and A and B do not intersect or overlap, only their edges are adjacent. Move B in the negative direction and copy a circle C of the same size as B, and C and B do not intersect or overlap, only their edges are adjacent. That is, A, B, and C are on the same horizontal line and do not intersect or overlap.
[0047] In the process of connecting the target welding length with the at least two welding endpoints to obtain the target welding trajectory, the target welding trajectory may not be a continuous line, but may be a trajectory with gaps.
[0048] In one possible example, obtaining the target welding length based on the positive and negative segment circles corresponding to each segment circle includes: obtaining the radius of the positive segment circle as a first radius; obtaining the radius of the negative segment circle as a second radius; connecting the first radius, the diameter of the segment circle, and the second radius to obtain a first target welding length, wherein the first target welding length is included within the target welding length, and the target welding length is the connection length of multiple first target welding lengths.
[0049] Among them, the first target welding length is as follows Figure 2E As shown, the circle representing a paragraph is B, the circle representing a positive paragraph is A, and the circle representing a negative paragraph is C. Figure 2E The red line in the diagram represents the first target welding length.
[0050] In one possible example, after connecting the target welding length with the at least two welding endpoints to obtain the target welding trajectory, the method further includes: obtaining the Z-axis coordinates of the edge contour in the first spatial coordinate system; moving the target welding trajectory along the positive Z-axis according to a preset segment length to obtain an elevated welding trajectory, wherein the execution device performs welding according to the elevated welding trajectory.
[0051] The preset paragraph length can be determined based on the template product type, and a specified safety factor can be obtained based on the template product type. The preset paragraph length is determined based on the safety factor.
[0052] It is evident that the welding trajectory after elevation can make welding safer and better protect the product.
[0053] Optionally, the target welding trajectory in the camera coordinate system can be converted into the welding trajectory corresponding to the robot space coordinate system. The robot performs welding operations directly based on the welding trajectory corresponding to the robot's spatial coordinate system.
[0054] like Figure 2F The diagram illustrates the entire welding process using 3D vision. It includes four parts: the first part is the process of establishing calibration relationships; the second part is the process of creating a template image; the third part is the process of generating the welding trajectory; and the fourth part is the execution process after the welding trajectory is generated. The third part, the welding trajectory generation process, is one implementation of the present invention.
[0055] In the first part, the calibration block is first scanned to obtain an image. Then, a vision tool is used to obtain four feature points on the calibration block. The calibration block is placed in the robot's execution space. The robot utility tool executes to the four feature points on the calibration block, fills the two sets of data into the calibration tool for calculation, and obtains a set of calibration data.
[0056] In the second part, the template product is first placed in the camera scanning range against the reference edge, which is at a right angle. The angle of the model product does not change by more than 30°. The robot holds a laser 3D camera and scans multiple fixed positions. Multiple point cloud images are obtained by scanning multiple fixed positions. The feature positions of each point cloud image float within the field of view of the 3D camera. Therefore, the area toolbox is deployed in advance to reduce the impact of the environment on the images. The images are stitched together by scanning the relative position of each photo by the robot, and the images obtained from different positions are combined.
[0057] In the third part, the stitched images are processed using the image. An edge is taken in the positive X direction, the negative X direction, and the positive Y direction of the point cloud image using the camera spatial coordinate system. These three edges are merged in the order of X-positive-Y-negative. Points are generated at the endpoints of each edge for spot welding. After merging, overlapping endpoints are combined into one endpoint. The number of welding segments between each pair of endpoints is input, and the edge length is evenly divided according to the number of points. The length of each edge segment is set, and each point is offset by a positive or negative vector. Positive points are the arc starting points, and negative points are the arc ending points. All points are copied and raised as transition and safety points. All points are sorted clockwise to obtain the welding trajectory. After obtaining the welding trajectory, the absolute coordinates of the execution device are calculated using calibration relationships.
[0058] In the fourth part, the execution tool first receives the welding trajectory based on 3D vision of this solution, and then performs welding according to the welding trajectory.
[0059] This application first scans the template product to obtain a template image corresponding to the template product. Next, it acquires the edge contour image of the template image. Then, based on the edge contour image, it determines at least one line to be welded and at least two welding endpoints. Finally, it determines a target welding trajectory based on the at least one line to be welded and the at least two welding endpoints. The executing device then performs welding according to the target welding trajectory. This invention can automatically identify welding positions and automatically generate welding locations and processes, saving labor costs, significantly improving unit production efficiency, increasing product qualification rate, and simplifying operation.
[0060] Figure 3 This is a flowchart illustrating another welding method based on 3D vision provided in an embodiment of this application, as shown below. Figure 3As shown, the method includes: 301. Scan the template product to obtain a template image corresponding to the template product; 302. Obtain the edge contour image of the template image; 303. Establish a first spatial coordinate system based on the template image, and obtain the X-axis and Y-axis in the first spatial coordinate system, wherein the X-axis and Y-axis are perpendicular to each other; 304. Extract the first line to be welded from the edge contour image in the positive X-axis direction, extract the second line to be welded from the edge contour image in the positive Y-axis direction, and extract the third line to be welded from the edge contour image in the negative X-axis direction; 305. Obtain the intersection points of the first line to be welded, the second line to be welded, and the third line to be welded, as well as the endpoint of each line to be welded; obtain the coordinates of the intersection points and the coordinates of the endpoints of each line to be welded. 306. If there are identical coordinates, the two welding endpoints corresponding to the identical coordinates shall be merged into one welding endpoint, and the merged welding endpoint shall be combined with the unmerged welding endpoints to form at least two welding endpoints. 307. Segment each of the at least one welding lines to be welded to obtain multiple welding segments with the same spacing, obtain segment points other than the at least two welding endpoints, obtain the segment circles corresponding to the segment points, perform positive and negative copy offsets on the segment circles to obtain a positive segment circle and a negative segment circle for each segment circle, obtain the target welding length based on the positive and negative segment circles corresponding to each segment circle, and connect the target welding length with the at least two welding endpoints to obtain the target welding trajectory; 308. Obtain the Z-axis coordinate of the edge contour in the first spatial coordinate system, move the target welding trajectory along the positive direction of the Z-axis according to the preset segment length to obtain the raised welding trajectory, wherein the execution device performs welding according to the raised welding trajectory.
[0061] This application first scans a template product to obtain a template image corresponding to the template product. Next, it acquires the edge contour image of the template image. Then, based on the edge contour image, it determines at least one line to be welded and at least two welding endpoints. Finally, it determines a target welding trajectory based on the at least one line to be welded and the at least two welding endpoints. The executing device then performs welding according to the target welding trajectory. This invention can automatically identify welding positions and automatically generate welding locations and processes, saving labor costs, significantly improving unit production efficiency, increasing product qualification rate, and simplifying operation.
[0062] Based on the description of the above-described method embodiments for welding based on 3D vision, this application also discloses an apparatus for welding based on 3D vision, such as... Figure 4 As shown, the welding apparatus 400 based on 3D vision includes: The scanning module 401 is used to scan the template product to obtain a template image corresponding to the template product; The acquisition module 402 is used to acquire the edge contour image of the template image; The determining module 403 is used to determine at least one line to be welded and at least two welding endpoints based on the edge contour image; The determining module 403 is further configured to determine a target welding trajectory based on the at least one line to be welded and the at least two welding endpoints, wherein the executing device performs welding based on the target welding trajectory.
[0063] This application first scans the template product to obtain a template image corresponding to the template product. Next, it acquires the edge contour image of the template image. Then, based on the edge contour image, it determines at least one line to be welded and at least two welding endpoints. Finally, it determines a target welding trajectory based on the at least one line to be welded and the at least two welding endpoints. The executing device then performs welding according to the target welding trajectory. This invention can automatically identify welding positions and automatically generate welding locations and processes, saving labor costs, significantly improving unit production efficiency, increasing product qualification rate, and simplifying operation.
[0064] This application also provides a computer storage medium (Memory), which is a memory device in an electronic device used to store programs and data. It is understood that the computer storage medium here can include both built-in storage media in the electronic device and extended storage media supported by the electronic device. The computer storage medium provides storage space that stores the operating system of the electronic device. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer storage medium located remotely from the aforementioned processor.
[0065] In one embodiment, a processor may load and execute one or more instructions stored in a computer storage medium to implement the corresponding steps in the above embodiments; specifically, one or more instructions in the computer storage medium may be loaded and executed by a processor. Figure 1 And / or any step of the method in Figure 2, which will not be described in detail here.
[0066] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0067] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the division of modules is merely a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. The coupling, direct coupling, or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, apparatuses, or modules, and may be electrical, mechanical, or other forms.
[0068] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules.
[0069] Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0070] Figure 5 An internal structural diagram of a computer device is shown in one embodiment. This computer device may be a terminal. Figure 5 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium may contain an operating system and a computer program. When executed by the processor, this computer program enables the processor to implement the aforementioned 3D vision-based welding method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to perform the aforementioned 3D vision-based welding method. Those skilled in the art will understand that... Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the device to which the present application is applied. Specific devices may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.
[0071] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the welding method based on 3D vision in any of the above embodiments.
[0072] A computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the welding method based on 3D vision in any of the above embodiments.
[0073] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media can be read-only memory (ROM), random access memory (RAM), or magnetic media, such as floppy disks, hard disks, magnetic tapes, magnetic disks, or optical media, such as digital versatile discs (DVDs), or semiconductor media, such as solid state disks (SSDs).
[0074] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method of welding based on 3D vision, characterized in that, The method includes: The template product is scanned to obtain a template image corresponding to the template product; Obtain the edge contour image of the template image; Based on the edge contour image, at least one line to be welded and at least two welding endpoints are determined, and a first spatial coordinate system is established based on the template image. The first spatial coordinate system is the camera spatial coordinate system. The target welding trajectory is determined based on the at least one line to be welded and the at least two welding endpoints; The step of determining the target welding trajectory based on the at least one line to be welded and the at least two welding endpoints includes: Each of the at least one lines to be welded is segmented to obtain multiple welding segments with the same spacing. Obtain the segment points other than the at least two welding endpoints, where each segment point is the center of the segment circle; Obtain the paragraph circle corresponding to the paragraph point; The segment circle is copied and offset positively and negatively along the extension direction of the line to be welded to obtain a positive segment circle and a negative segment circle tangent to the edge of each segment circle. The positive segment circle and the negative segment circle are located on both sides of the segment circle, and the positive segment circle, the segment circle, and the negative segment circle do not overlap with each other. The target welding length is obtained based on the positive and negative segment circles corresponding to each segment circle; By connecting the target welding length with the at least two welding endpoints, the target welding trajectory is obtained; The step of obtaining the target welding length based on the positive and negative segment circles corresponding to each segment circle includes: The radius of the positive segment circle is obtained as the first radius; The radius of the negative segment circle is obtained as the second radius; The first target welding length is defined by connecting the first radius, the diameter of the segment circle, and the second radius, wherein the first target welding length is included within the target welding length, and the target welding length is the connection length of multiple first target welding lengths; The method further includes, after connecting the target weld length with the at least two weld endpoints to obtain the target weld trajectory: Obtain the Z-axis coordinate of the edge contour in the first spatial coordinate system; The target welding trajectory is moved along the positive Z-axis according to a preset segment length to obtain an elevated welding trajectory. The elevated welding trajectory is then converted into a welding trajectory in the spatial coordinate system of the execution device, whereby the execution device performs welding based on the elevated welding trajectory.
2. The method of claim 1, wherein, The step of determining at least one line to be welded and at least two welding endpoints based on the edge contour image includes: Obtain the X-axis and Y-axis in the first spatial coordinate system, wherein the X-axis and Y-axis are perpendicular to each other; The first line to be welded is captured in the positive X-axis direction of the edge contour image; The edge contour image is cropped to capture the second line to be welded in the positive Y-axis direction; The third line to be welded is extracted from the edge contour image in the negative X-axis direction; Based on the first line to be welded, the second line to be welded, and the third line to be welded, at least two welding endpoints are obtained.
3. The method of claim 2, wherein, The step of obtaining at least two welding endpoints based on the first welding line, the second welding line, and the third welding line includes: Obtain the intersection points of the first line to be welded, the second line to be welded, and the third line to be welded, as well as the endpoints of each line to be welded; Obtain the coordinates of the intersecting endpoints and the coordinates of the endpoints of each line to be welded; If there are identical coordinates, then the two welding endpoints corresponding to the identical coordinates are merged into one welding endpoint; The merged welding endpoints are combined with the unmerged welding endpoints to form at least two welding endpoints.
4. The method according to claim 1, characterized in that, The step of obtaining the edge contour image of the template image includes: Obtain the pixels in the template image; Filter out target pixels that match the preset grayscale value; The region of the target pixel is selected to form an edge contour image.
5. A welding device based on 3D vision, characterized in that, The apparatus for applying the method according to any one of claims 1 to 4 comprises: The scanning module is used to scan the template product to obtain a template image corresponding to the template product; The acquisition module is used to acquire the edge contour image of the template image; The determining module is used to determine at least one line to be welded and at least two welding endpoints based on the edge contour image; The determining module is further configured to determine a target welding trajectory based on the at least one line to be welded and the at least two welding endpoints, wherein the execution device performs welding based on the target welding trajectory.
6. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the welding method based on 3D vision as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a processor, causes the processor to perform the steps of the welding method based on 3D vision as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Robot welding device and method for acquiring welding seam track
CN110449783A
