Workpiece identification method, device, equipment and storage medium
By acquiring multiple viewing depth images of the workpiece and fusing them into three-dimensional images, the problem of unidentified workpieces is solved, and automated recognition is achieved, and production efficiency is improved.
Patent Information
- Application Number
- CN202111450902.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-12-01
AI Technical Summary
In existing automated production lines, unmarked workpieces cannot be identified, resulting in inefficient production efficiency.
By obtaining depth of field images of multiple perspectives of the workpiece, fuse it into a three-dimensional image, and obtaining the model of the workpiece from the database based on the three-dimensional image parameters, realizing identification without identification.
It realizes automated identification of workpieces of different models, improving the automation level and production efficiency of the production line.
Smart Images

Figure CN114067189B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated auxiliary equipment, and in particular to a workpiece identification device, method, apparatus and storage medium. Background Art
[0002] In industrial production, different types of workpieces need to be processed differently. In the prior art, the dimensions of the workpieces are usually manually visually inspected, or identified based on the logo on the product.
[0003] In some automated production lines, products are identified by machine vision. It is necessary to set a mark on the workpiece to identify the product. However, some products cannot be marked. Therefore, it is impossible to use the existing machine vision solution for identification. This greatly reduces the automation level of the production line and greatly suppresses production efficiency.
[0004] In view of this, the applicant filed this application after studying the existing technology. Summary of the invention
[0005] The present invention provides a workpiece identification device, method, apparatus and storage medium to improve the above technical problems.
[0006] First,
[0007] An embodiment of the present invention provides a workpiece identification method, which comprises the following steps:
[0008] S1. Acquire depth-of-field images of a workpiece at multiple viewing angles, wherein the multiple viewing angles include a side viewing angle that captures width information of the workpiece.
[0009] S2. Obtain the width of the workpiece according to the depth of field image from the side view.
[0010] S5. Fusing depth images of multiple perspectives to obtain a three-dimensional image of the workpiece.
[0011] S6. Obtain the length and height of the workpiece according to the three-dimensional image.
[0012] S7. According to the width, length and height of the workpiece, the model of the workpiece is obtained from the database.
[0013] In an optional embodiment, the workpiece is a rounded rectangular or racetrack-shaped coil.
[0014] Multiple perspectives are four perspectives.
[0015] In an optional embodiment, step S2 specifically includes:
[0016] The outline of the width edge of the workpiece is obtained based on the depth of field image from the side view.
[0017] Get the width of the workpiece based on the contour of the width edge.
[0018] In an optional embodiment, step S5 further includes steps S3 and S4:
[0019] S3. Select a local area of the top surface of the workpiece based on the flatness, wherein the flatness is calculated based on the root mean square.
[0020] S4. Calculate the vertical distance between the local area and the first supporting plane below the workpiece.
[0021] In an optional embodiment, step S5 specifically includes:
[0022] According to the vertical distance, the depth images of multiple perspectives are fused to obtain a three-dimensional image of the workpiece.
[0023] In an optional embodiment, step S6 specifically includes:
[0024] S61. Obtain a first top view according to the three-dimensional model, wherein the first top view includes a first supporting plane.
[0025] S62. Filter the first supporting plane in the first top view according to the vertical distance to obtain a second top view of the top surface of the workpiece.
[0026] S63, binarizing the second top view, and obtaining the length of the workpiece according to the binarized second top view, wherein the length is obtained by multiplying the number of pixels in the length direction of the workpiece in the second top view by the distance value corresponding to the unit pixel.
[0027] In an optional embodiment, step S6 further specifically includes:
[0028] S64, acquiring the top surface of the workpiece and a second supporting plane below the workpiece according to the three-dimensional image, wherein the second supporting plane is located above the first supporting plane and has an area smaller than the first supporting plane.
[0029] S65. Calculate the average distance between the top surface and the second supporting plane to obtain the height of the workpiece.
[0030] Second,
[0031] An embodiment of the present invention provides an artifact recognition device, which includes a control component. The control component includes a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement the artifact recognition method as described in any paragraph of the first aspect.
[0032] In an optional embodiment, the workpiece identification device further includes a first base component, a second base component and a shooting component configured on the first base component, a third base component and a first limit component configured on the second base component, and a fourth base component and a second limit component configured on the third base component. The control component is configured on the first base component.
[0033] The first base is used to drive the second base to rise and fall. The second base is used to drive the third base to approach or move away from the first base. The first limit assembly is used to limit the movement of the third base assembly. The third base is used to drive the fourth base to rotate. The second limit assembly is used to limit the rotation of the fourth base assembly. The fourth base is used to place a workpiece. The shooting assembly is used to shoot a depth of field image above the first base.
[0034] The control component is electrically connected to the first base component, the second base component, the third base component, the fourth base component, the first limit component, the second limit component and the shooting component.
[0035] In an optional embodiment, acquiring depth-of-field images of a workpiece at multiple viewing angles specifically includes:
[0036] Determine whether the second base assembly is at the lowest point.
[0037] When it is determined that the second base assembly is at the lowest point, the subsequent steps are executed. Otherwise, the first base assembly is controlled to drive the second base assembly to descend to the lowest point and then the subsequent steps are executed.
[0038] The second base assembly is controlled to drive the third base assembly away from the first base assembly.
[0039] The first base assembly is controlled to drive the second base assembly to rise, so that the fourth base assembly is supported on the workpiece.
[0040] The second base assembly is controlled to drive the third base assembly to approach the first base assembly.
[0041] The first base assembly is controlled to drive the second base assembly to be lowered, so that the workpiece on the fourth base assembly is located at the shooting position.
[0042] The first limiting assembly is controlled to limit the third base assembly to prevent the third base assembly from moving.
[0043] The second limiting assembly is controlled to limit the fourth base assembly to prevent the fourth base assembly from rotating.
[0044] The shooting component is controlled to shoot a depth-of-field image of a first perspective.
[0045] Repeat the current step to capture depth-of-field images of a predetermined number of viewing angles: control the first limiting component and the second limiting component to release the limit, control the third base component to drive the fourth base component to rotate, control the first limiting component and the second limiting component to limit, and then control the shooting component to capture the depth-of-field image of the next viewing angle.
[0046] After capturing depth images of a predetermined number of viewing angles:
[0047] The first base assembly is controlled to drive the second base assembly to rise.
[0048] Control the second limit component and the first limit component to release the limit;
[0049] The second base assembly is controlled to drive the third base assembly away from the first base assembly.
[0050] The first base assembly is controlled to drive the second base assembly to descend, so that the workpiece is separated from the fourth base assembly.
[0051] The second base assembly is controlled to drive the third base assembly to approach the first base assembly, so as to reset the device.
[0052] Thirdly,
[0053] An embodiment of the present invention provides a workpiece identification device, which includes:
[0054] The image acquisition module is used to acquire depth-of-field images of a workpiece at multiple viewing angles, wherein the multiple viewing angles include a side viewing angle that captures width information of the workpiece.
[0055] The width acquisition module is used to acquire the width of the workpiece according to the depth of field image of the side view.
[0056] The image fusion module is used to fuse depth images of multiple viewing angles to obtain a three-dimensional image of the workpiece.
[0057] The length and height acquisition module is used to obtain the length and height of the workpiece based on the three-dimensional image.
[0058] The model acquisition module is used to obtain the model of the workpiece from the database according to the width, length and height of the workpiece.
[0059] Fourthly,
[0060] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the workpiece identification method as described in any paragraph of the first aspect.
[0061] By adopting the above technical solution, the present invention can achieve the following technical effects:
[0062] The 3D model of the workpiece is obtained by fusing the depth images of the workpiece at multiple angles, and then the model of the workpiece is obtained from the database through the parameters of the 3D model to identify the workpiece. The workpiece can be identified without setting a mark on the workpiece, which has great practical significance.
[0063] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0065] Figure 1 It is an isometric view of the workpiece identification device provided by the first embodiment of the present invention.
[0066] Figure 2 It is an exploded view of the workpiece identification device provided by the first embodiment of the present invention.
[0067] Figure 3 is a flowchart of a workpiece identification method provided by the second embodiment of the present invention
[0068] Figure 4 It is a structural schematic diagram of a workpiece identification device provided by the second embodiment of the present invention. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0070] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0071] It should be clear that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0072] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0073] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0074] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0075] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0076] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments:
[0077] Embodiment 1:
[0078] See also Figures 1 to 3 The first embodiment of the present invention provides a workpiece identification device. The workpiece identification device comprises a first base component 1, a second base component 2 and a shooting component 6 configured on the first base component 1, a third base component 4 and a first limit component 3 configured on the second base component 2, a fourth base component 5 and a second limit component 7 configured on the third base component 4, and a control component configured on the first base component 1. Wherein:
[0079] The first base is used to drive the second base to rise and fall. The second base is used to drive the third base to approach or move away from the first base. The first limit assembly 3 is used to limit the movement of the third base assembly 4. The third base is used to drive the fourth base to rotate. The second limit assembly 7 is used to limit the rotation of the fourth base assembly 5. The fourth base is used to place a workpiece. The shooting assembly 6 is used to shoot a depth of field image above the first base.
[0080] The control component is electrically connected to the first base component 1 , the second base component 2 , the third base component 4 , the fourth base component 5 , the first limit component 3 , the second limit component 7 and the shooting component 6 .
[0081] Specifically, the first base assembly 1 drives the second base assembly 2 to rise and fall, the second base assembly 2 drives the third base assembly 4 to translate in the horizontal direction, the third base assembly 4 drives the fourth base assembly 5 to rotate, the first limit assembly 3 limits the movement of the third base assembly 4, and the second limit assembly 7 limits the rotation of the fourth base assembly 5. The specific structures of these components are all within the scope of those skilled in the art to be realized without creative labor. Those skilled in the art can adopt Figure 1 and Figure 2 The structure shown in the figure, or other existing structures are adopted. The present invention does not limit the specific structures of these components. As long as they can achieve the above functions, they belong to the protection scope of the present invention.
[0082] like Figure 3 As shown, based on the above embodiment, in an optional embodiment of the present invention, the control component includes a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement steps S1, S2, S5, S6 and S7.
[0083] S1. Acquire depth-of-field images of a workpiece at multiple viewing angles, wherein the multiple viewing angles include a side viewing angle that captures width information of the workpiece.
[0084] It is understandable that the control component can be an electronic device with computing performance, such as a portable computer, a desktop computer, a server, a smart phone or a tablet computer. The shooting component 6 is a binocular depth-of-field camera.
[0085] Specifically, the binocular depth of field camera can directly measure the size of the photographed object. However, the object measured by the present invention is a rounded rectangular or runway-shaped coil. It is understandable that the frame of the rounded rectangular or runway-shaped coil cannot be accurately obtained directly from the photographed image. Therefore, it is impossible to identify it using the existing technology.
[0086] Based on the above embodiment, in an optional embodiment of the present invention, the depth images of multiple viewing angles are depth images of four viewing angles. In other embodiments, it can also be other numbers of depth images. The present invention does not specifically limit the angle and number of the depth images.
[0087] like Figure 1 and Figure 2As shown, based on the above embodiment, in an optional embodiment of the present invention, the depth of field images of multiple viewing angles of the workpiece are obtained, specifically including steps S101 to S117.
[0088] S101, determining whether the second base assembly 2 is at the lowest point.
[0089] S102: When it is determined that the second base assembly 2 is at the lowest point, the subsequent steps are executed. Otherwise, the first base assembly 1 is controlled to drive the second base assembly 2 to descend to the lowest point and then the subsequent steps are executed.
[0090] S103 , controlling the second base assembly 2 to drive the third base assembly 4 away from the first base assembly 1 .
[0091] S104, controlling the first base assembly 1 to drive the second base assembly 2 to rise, so that the fourth base assembly 5 is supported on the workpiece.
[0092] S105 , controlling the second base assembly 2 to drive the third base assembly 4 to approach the first base assembly 1 .
[0093] S106, controlling the first base assembly 1 to drive the second base assembly 2 to lower, so that the workpiece on the fourth base assembly 5 is located at the shooting position.
[0094] like Figure 1 and Figure 2 As shown, it should be noted that, usually the coil is hoisted by workers to the front of the workpiece identification device.
[0095] In order to make the lifting and identification process more convenient, the workpiece identification device of the present invention first moves the fourth base assembly 5 from the lowest height to the bottom of the coil, and then raises the fourth base assembly 5 so that the workpiece is supported on the fourth base assembly 5, thereby allowing the lifting equipment to be in a relaxed state, and then releases the lifting equipment to move the workpiece into the shooting range of the shooting assembly 6.
[0096] It is understandable that the lifting device has a fast moving speed and low precision. By moving the fourth base assembly 5 to support the coil, rather than placing the workpiece directly on the fourth base assembly 5 through the lifting device, the impact during contact can be effectively reduced.
[0097] S107 , controlling the first limiting assembly 3 to limit the third base assembly 4 to prevent the third base assembly 4 from moving.
[0098] S108 , controlling the second limiting assembly 7 to limit the fourth base assembly 5 to prevent the fourth base assembly 5 from rotating.
[0099] S109, controlling the shooting component 6 to shoot a depth-of-field image of the first viewing angle.
[0100] Specifically, the first limiting assembly 3 and the second limiting assembly 7 can prevent the coil from moving during the shooting process, thereby ensuring the clarity of the depth of field image obtained by the shooting.
[0101] S111, repeat the current step to capture depth of field images of a predetermined number of viewing angles: control the first limiting component 3 and the second limiting component 7 to release the limit, control the third base component 4 to drive the fourth base component 5 to rotate, control the first limiting component 3 and the second limiting component 7 to limit, and then control the shooting component 6 to capture the depth of field image of the next viewing angle.
[0102] Specifically, in the embodiment of the present invention, by rotating the coil to shoot depth images at different angles, the height and angle of the camera can be guaranteed, so that the subsequent fusion image is more accurate. In other embodiments, multiple sets of binocular depth cameras can be set to shoot depth images at different angles. The present invention does not make specific limitations on this, as long as depth images of multiple viewing angles can be obtained.
[0103] S112, after capturing depth-of-field images of a predetermined number of viewing angles:
[0104] S113, controlling the first base assembly 1 to drive the second base assembly 2 to rise.
[0105] S114, controlling the second limiting component 7 and the first limiting component 3 to release the limiting;
[0106] S115 , controlling the second base assembly 2 to drive the third base assembly 4 away from the first base assembly 1 .
[0107] S116, controlling the first base assembly 1 to drive the second base assembly 2 to descend, so that the workpiece is separated from the fourth base assembly 5.
[0108] S117, controlling the second base assembly 2 to drive the third base assembly 4 to approach the first base assembly 1, so as to reset the device.
[0109] Specifically, after taking depth of field images at different angles, the coil is moved to the initial hoisting position, the hoisting equipment is installed on the coil, and then the fourth base assembly 5 is lowered to separate from the coil. Allowing the fourth base assembly 5 to move downward and separate from the coil, rather than raising the coil to separate from the fourth base assembly 5 by the hoisting equipment, can ensure that the coil is at a lower height and will not rise to a very high position, thereby reducing risks and reducing the impact on the hoisting equipment when the coil and the fourth base assembly 5 are separated.
[0110] It should be noted that, in this embodiment, the coil is transported by hoisting. In other embodiments, the coil can be transported by RGV, and rollers are provided under the coil (or on the top surface of the RGV and the fourth base assembly) to facilitate the movement of the coil between the RGV and the fourth base assembly. The present invention does not limit the specific movement and transportation method of the coil. As long as it can be moved to the workpiece identification device for identification, and leave the workpiece identification device after identification.
[0111] S2. Obtain the width of the workpiece according to the depth of field image from the side view.
[0112] like Figure 1 and Figure 2 As shown in FIG. 1 , the coil has a distinct line profile in the length direction. Therefore, the distance between the contour lines can be captured by the depth of field image.
[0113] Based on the above embodiment, in an optional embodiment of the present invention, step S2 specifically includes step S21 and step S22.
[0114] S21. Acquire the outline of the width edge of the workpiece according to the depth of field image of the side view.
[0115] S22. Obtain the width of the workpiece according to the contour of the width edge.
[0116] It should be noted that obtaining the distance between two points / two lines through a depth of field image is a prior art, which will not be described in detail in the present invention.
[0117] S5. Fusing depth images of multiple perspectives to obtain a three-dimensional image of the workpiece.
[0118] Specifically, synthesizing depth-of-field images from multiple viewing angles into a three-dimensional image belongs to the prior art and will not be described in detail in the present invention.
[0119] It is understandable that, since the coil has a circular arc angle, some current conditions of the coil cannot be captured. Therefore, in the present invention, a method of constructing a three-dimensional image of the workpiece is adopted to obtain the three-dimensional size of the coil.
[0120] Specifically, based on the above embodiment, in an optional embodiment of the present invention, before step S5, steps S3 and S4 are also included:
[0121] S3. Select a local area of the top surface of the workpiece based on the flatness, wherein the flatness is calculated based on the root mean square.
[0122] S4. Calculate the vertical distance between the local area and the first supporting plane below the workpiece.
[0123] Specifically, since the edge of the coil is in an arc shape and the top surface is in a plane shape, it is necessary to determine the plane area on the top of the workpiece by flatness. Then, the vertical distance of the three-dimensional model is determined by the plane area and the first supporting plane.
[0124] It should be noted that the first support plane is the upper surface of the third base assembly 4. The second support plane is the upper surface of the fourth base assembly 5. Since the area of the first support plane is much larger than the area of the second support plane. The height of the coil is the average distance between the plane area at the top of the coil and the second support plane. However, since the area of the second support plane is too small, directly calculating the height of the coil will produce a large error. In this embodiment, the vertical distance of the three-dimensional model is determined by the plane area of the top surface of the workpiece and the first support plane, thereby determining the size information of the three-dimensional model. Instead of simply establishing the shape of the three-dimensional model.
[0125] Specifically, based on the above embodiment, in an optional embodiment of the present invention, step S5 specifically includes: S51, fusing depth of field images of multiple perspectives according to the vertical distance to obtain a three-dimensional image of the workpiece.
[0126] Specifically, by creating a three-dimensional image from multiple images, only the shape can be constructed. In this embodiment, the vertical distance is combined to determine the distances of the three-dimensional model, which has good practical significance.
[0127] Specifically, based on the above embodiment, in an optional embodiment of the present invention, step S5 specifically includes
[0128] S52. Obtain the width of the workpiece according to the three-dimensional image.
[0129] S53, judging whether the error between the width obtained from the depth of field image obtained from the side view and the width obtained from the three-dimensional image is within a preset range, wherein the preset range may be a ratio range of the error, such as within a difference of 2%, or a specific value of the error, such as within a difference of 5 cm.
[0130] S54, when it is determined that the error between the two is within the preset range, continue with the subsequent steps; when it is determined that the error between the two exceeds the preset range, retake the depth of field image of the workpiece and return to step S1. The number of the retaken depth of field images of the workpiece is greater than the number of the depth of field images obtained during the previous recognition.
[0131] S6. Obtain the length and height of the workpiece according to the three-dimensional image.
[0132] Specifically, based on the above embodiment, in an optional embodiment of the present invention, step S6 specifically includes steps S61 to S65.
[0133] S61. Obtain a first top view according to the three-dimensional model, wherein the first top view includes a first supporting plane.
[0134] S62. Filter the first supporting plane in the first top view according to the vertical distance to obtain a second top view of the top surface of the workpiece.
[0135] S63, binarizing the second top view, and obtaining the length of the workpiece according to the binarized second top view, wherein the length is obtained by multiplying the number of pixels in the length direction of the workpiece in the second top view by the distance value corresponding to the unit pixel.
[0136] Specifically, since the edge of the coil is excessively rounded, its edge contour can only be obtained by projection. It is understandable that the three-dimensional model also includes a fourth base component 5 and a third base component 4. These base components will affect the projection effect. Therefore, according to the height information of the three-dimensional model, the third base and the fourth base are cut off. Thus, only part of the three-dimensional model of the coil is retained, so that the projection in the second top view is the projection of the coil itself. Thus, the contour of the workpiece is accurately obtained. And further the length of the workpiece is obtained.
[0137] S64, acquiring the top surface of the workpiece and a second supporting plane below the workpiece according to the three-dimensional image, wherein the second supporting plane is located above the first supporting plane and has an area smaller than the first supporting plane.
[0138] S65. Calculate the average distance between the top surface and the second supporting plane to obtain the height of the workpiece.
[0139] It is understandable that the second support plane of the fourth base assembly 5 is relatively accurate in the three-dimensional model. Therefore, obtaining the distance between the top plane of the coil and the second support plane, that is, the height of the workpiece, through the three-dimensional model can obtain more accurate height data, which has good practical significance.
[0140] S7. According to the width, length and height of the workpiece, the model of the workpiece is obtained from the database.
[0141] Specifically, the 3D model of the workpiece is obtained by fusing the depth images of the workpiece at multiple angles, and then the model of the workpiece is obtained from the database through the parameters of the 3D model to identify the workpiece. The workpiece can be identified without setting a mark on the workpiece, which has great practical significance.
[0142] Embodiment 2
[0143] like Figure 3 As shown, an embodiment of the present invention provides a workpiece identification method, which comprises the following steps:
[0144] S1. Acquire depth-of-field images of a workpiece at multiple viewing angles, wherein the multiple viewing angles include a side viewing angle that captures width information of the workpiece.
[0145] S2. Obtain the width of the workpiece according to the depth of field image from the side view.
[0146] S5. Fusing depth images of multiple perspectives to obtain a three-dimensional image of the workpiece.
[0147] S6. Obtain the length and height of the workpiece according to the three-dimensional image.
[0148] S7. According to the width, length and height of the workpiece, the model of the workpiece is obtained from the database.
[0149] The 3D model of the workpiece is obtained by fusing the depth images of the workpiece at multiple angles, and then the model of the workpiece is obtained from the database through the parameters of the 3D model to identify the workpiece. The workpiece can be identified without setting a mark on the workpiece, which has great practical significance.
[0150] Based on the above embodiment, in an optional embodiment of the present invention, the workpiece is a rounded rectangular or racetrack-shaped coil.
[0151] Multiple perspectives are four perspectives.
[0152] Based on the above embodiment, in an optional embodiment of the present invention, step S2 specifically includes:
[0153] The outline of the width edge of the workpiece is obtained based on the depth of field image from the side view.
[0154] Get the width of the workpiece based on the contour of the width edge.
[0155] Based on the above embodiment, in an optional embodiment of the present invention, before step S5, steps S3 and S4 are also included:
[0156] S3. Select a local area of the top surface of the workpiece based on the flatness, wherein the flatness is calculated based on the root mean square.
[0157] S4. Calculate the vertical distance between the local area and the first supporting plane below the workpiece.
[0158] Based on the above embodiment, in an optional embodiment of the present invention, step S5 specifically includes:
[0159] According to the vertical distance, the depth images of multiple perspectives are fused to obtain a three-dimensional image of the workpiece.
[0160] Based on the above embodiment, in an optional embodiment of the present invention, step S6 specifically includes:
[0161] S61. Obtain a first top view according to the three-dimensional model, wherein the first top view includes a first supporting plane.
[0162] S62. Filter the first supporting plane in the first top view according to the vertical distance to obtain a second top view of the top surface of the workpiece.
[0163] S63, binarizing the second top view, and obtaining the length of the workpiece according to the binarized second top view, wherein the length is obtained by multiplying the number of pixels in the length direction of the workpiece in the second top view by the distance value corresponding to the unit pixel.
[0164] Based on the above embodiment, in an optional embodiment of the present invention, step S6 further specifically includes:
[0165] S64, acquiring the top surface of the workpiece and a second supporting plane below the workpiece according to the three-dimensional image, wherein the second supporting plane is located above the first supporting plane and has an area smaller than the first supporting plane.
[0166] S65. Calculate the average distance between the top surface and the second supporting plane to obtain the height of the workpiece.
[0167] Embodiment 3
[0168] An embodiment of the present invention provides a workpiece identification device, which includes:
[0169] The image acquisition module is used to acquire depth-of-field images of a workpiece at multiple viewing angles, wherein the multiple viewing angles include a side viewing angle that captures width information of the workpiece.
[0170] The width acquisition module is used to acquire the width of the workpiece according to the depth of field image of the side view.
[0171] The image fusion module is used to fuse depth images of multiple viewing angles to obtain a three-dimensional image of the workpiece.
[0172] The length and height acquisition module is used to obtain the length and height of the workpiece based on the three-dimensional image.
[0173] The model acquisition module is used to obtain the model of the workpiece from the database according to the width, length and height of the workpiece.
[0174] Based on the above embodiment, in an optional embodiment of the present invention, the workpiece is a rounded rectangular or racetrack-shaped coil. The multiple viewing angles are four viewing angles.
[0175] Based on the above embodiment, in an optional embodiment of the present invention, the width acquisition module specifically includes:
[0176] The contour unit is used to obtain the contour of the width edge of the workpiece according to the depth image of the side view.
[0177] The width unit is used to obtain the width of the workpiece based on the contour of the width edge.
[0178] On the basis of the above embodiment, in an optional embodiment of the present invention, the workpiece identification device further includes a region acquisition module and a vertical distance acquisition module.
[0179] The region acquisition module is used to select a local region of the top surface of the workpiece based on the flatness, wherein the flatness is calculated based on the root mean square.
[0180] The vertical distance acquisition module is used to calculate the vertical distance between the local area and the first supporting plane below the workpiece.
[0181] On the basis of the above embodiment, in an optional embodiment of the present invention, the image fusion module is specifically used to: fuse depth images of multiple viewing angles according to vertical distance to obtain a three-dimensional image of the workpiece.
[0182] Based on the above embodiment, in an optional embodiment of the present invention, the height acquisition module specifically includes:
[0183] The first top view unit is used to obtain a first top view according to the three-dimensional model, wherein the first top view includes a first supporting plane.
[0184] The second top view unit is used to filter the first supporting plane in the first top view according to the vertical distance to obtain a second top view of the top surface of the workpiece.
[0185] The length acquisition unit is used to binarize the second top view and acquire the length of the workpiece according to the binarized second top view, wherein the length is obtained by multiplying the number of pixels in the length direction of the workpiece in the second top view by the distance value corresponding to the unit pixel.
[0186] On the basis of the above embodiment, in an optional embodiment of the present invention, the height acquisition module further specifically includes:
[0187] The plane acquisition unit is used to acquire the top surface of the workpiece and the second support plane below the workpiece according to the three-dimensional image, wherein the second support plane is located above the first support plane and has a smaller area than the first support plane.
[0188] The height acquisition unit is used to calculate the average distance between the top surface and the second supporting plane to obtain the height of the workpiece.
[0189] Embodiment 4:
[0190] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the workpiece identification method as described in any paragraph of the second embodiment.
[0191] In several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus and method embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0192] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0193] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk. It should be noted that, in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.
[0194] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A workpiece identification method, characterized in that: The workpiece identification method is performed by a workpiece identification device; The workpiece identification method comprises: Acquire depth-of-field images of a workpiece at multiple viewing angles; wherein the multiple viewing angles include a side viewing angle at which width information of the workpiece is captured; Acquiring the width of the workpiece according to the depth of field image of the side viewing angle; fusing the depth images of the multiple viewing angles to obtain a three-dimensional image of the workpiece; According to the three-dimensional image, obtaining the length and height of the workpiece; According to the width, length and height of the workpiece, the model of the workpiece is obtained from the database; The workpiece identification device comprises a first base component, a second base component and a shooting component configured on the first base component, a third base component and a first limit component configured on the second base component, and a fourth base component and a second limit component configured on the third base component; a control component is configured on the first base component; The first base is used to drive the second base to rise and fall; the second base is used to drive the third base to approach or move away from the first base; the first limiting assembly is used to limit the movement of the third base assembly; the third base is used to drive the fourth base to rotate; the second limiting assembly is used to limit the rotation of the fourth base assembly; the fourth base is used to place a workpiece; the shooting assembly is used to shoot a depth of field image above the first base; The control component is electrically connected to the first base component, the second base component, the third base component, the fourth base component, the first limiting component, the second limiting component and the shooting component; The acquiring of depth-of-field images of the workpiece at multiple viewing angles specifically includes: determining whether the second base assembly is at the lowest point; When it is determined that the second base assembly is at the lowest point, the subsequent steps are executed; otherwise, the first base assembly is controlled to drive the second base assembly to descend to the lowest point and then the subsequent steps are executed; Controlling the second base assembly to drive the third base assembly away from the first base assembly; Controlling the first base assembly to drive the second base assembly to rise, so that the fourth base assembly is supported on the workpiece; Controlling the second base assembly to drive the third base assembly to approach the first base assembly; Controlling the first base assembly to drive the second base assembly to lower, so that the workpiece on the fourth base assembly is located at a shooting position; Controlling the first limiting assembly to limit the third base assembly to prevent the third base assembly from moving; Controlling the second limiting assembly to limit the fourth base assembly to prevent the fourth base assembly from rotating; Controlling the shooting component to shoot a depth-of-field image of a first viewing angle; Repeat the current step to capture depth-of-field images of a predetermined number of viewing angles; control the first limiting component and the second limiting component to release the limiting, control the third base component to drive the fourth base component to rotate, control the first limiting component and the second limiting component to limit, and then control the shooting component to capture the depth-of-field image of the next viewing angle; After capturing depth-of-field images of a predetermined number of viewing angles, subsequent actions are performed; Controlling the first base assembly to drive the second base assembly to rise; Controlling the second limit assembly and the first limit assembly to release the limit; Controlling the second base assembly to drive the third base assembly away from the first base assembly; Controlling the first base assembly to drive the second base assembly to descend, so that the workpiece is separated from the fourth base assembly; The second base assembly is controlled to drive the third base assembly to approach the first base assembly, so as to reset the device.
2. The workpiece identification method according to claim 1, characterized in that: The workpiece is a rounded rectangular or racetrack-shaped coil; The multiple viewing angles are four viewing angles.
3. The workpiece identification method according to claim 1, characterized in that: Acquiring the width of the workpiece according to the depth of field image of the side viewing angle specifically includes: Acquiring a profile of a width edge of the workpiece according to the depth of field image of the side viewing angle; The width of the workpiece is obtained according to the profile of the width edge.
4. The workpiece identification method according to claim 1, characterized in that: The depth images of the multiple viewing angles are fused to obtain a three-dimensional image of the workpiece, which also includes: Selecting a local area of the top surface of the workpiece based on the flatness; wherein the flatness is calculated based on the root mean square; calculating a vertical distance between the local area and a first supporting plane below the workpiece; Fusion of the depth images of the multiple viewing angles to obtain a three-dimensional image of the workpiece specifically includes: The depth images of the multiple viewing angles are fused according to the vertical distance to obtain a three-dimensional image of the workpiece.
5. The workpiece identification method according to claim 4, characterized in that: According to the three-dimensional image, the length and height of the workpiece are obtained, specifically including: According to the three-dimensional model, a first top view is obtained; wherein the first top view includes the first supporting plane; filtering the first supporting plane in the first top view according to the vertical distance to obtain a second top view of the top surface of the workpiece; The second top view is binarized, and the length of the workpiece is obtained according to the binarized second top view; wherein the length is obtained by multiplying the number of pixels in the length direction of the workpiece in the second top view by the distance value corresponding to the unit pixel.
6. The workpiece identification method according to claim 5, characterized in that: Acquiring the length and height of the workpiece according to the three-dimensional image further specifically includes: According to the three-dimensional image, the top surface of the workpiece and a second supporting plane below the workpiece are acquired; wherein the second supporting plane is located above the first supporting plane and has an area smaller than that of the first supporting plane; The average distance between the top surface and the second supporting plane is calculated to obtain the height of the workpiece.
7. A workpiece identification device, characterized in that: It comprises a control component; the control component comprises a processor, a memory, and a computer program stored in the memory; the computer program can be executed by the processor to implement the workpiece identification method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the workpiece identification method according to any one of claims 1 to 6.
