Box-packed object-based pose estimation method and device, mechanical arm and medium
The example segmentation algorithm is used to obtain the top surface point cloud of boxed objects and perform plane fitting and optimization, which solves the problem of large pose estimation error of boxed objects, realizes higher-precision pose information acquisition, and improves the robotic arm's Grab stability and precision.
Patent Information
- Application Number
- CN202410955893.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-15
AI Technical Summary
The pose estimation calculation method of existing boxed objects is insufficiently stable, resulting in large errors in pose estimation and affecting the grasping accuracy of the robotic arm.
The top-side point cloud is obtained from the depth image of the boxed object by using an instance segmentation algorithm, and the top-side rectangle is obtained through plane fitting and projection point cloud optimization, and the position information of the boxed object is calculated based on the initial position.
It improves the stability and accuracy of boxed object position estimation, reduces position and rotation errors, and enhances the operation accuracy of the robotic arm.
Smart Images

Figure CN118967803A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robotics, and in particular to a method, device, robotic arm and medium for estimating a posture of a boxed object. Background Art
[0002] In the field of industrial logistics, robotic arms play an increasingly important role, and have great advantages in improving production efficiency and saving labor costs. Boxed objects are common grasping targets in industrial logistics scenarios, and grasping boxed objects is very critical. The existing pose estimation algorithm for boxed objects is not stable enough, resulting in large errors in some pose estimations. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present application provide a method, device, robotic arm and medium for estimating the posture of a boxed object.
[0004] In a first aspect, an embodiment of the present application provides a method for estimating a pose of a boxed object, the method comprising:
[0005] Obtain top surface point cloud from boxed object depth image based on instance segmentation algorithm;
[0006] Performing plane fitting on the top surface point cloud to obtain a fitting plane;
[0007] Projecting the inner points corresponding to the fitting plane onto the fitting plane to obtain a projected point cloud;
[0008] Acquire an optimized top surface rectangle according to the projected point cloud;
[0009] The pose information of the boxed object is obtained according to the optimized top surface rectangle and the initial position of the boxed object.
[0010] In one embodiment, the method of acquiring a top surface point cloud from a boxed object depth image based on an instance segmentation algorithm includes:
[0011] Acquire a top surface segmentation map of the boxed object from the boxed object depth image based on the instance segmentation algorithm;
[0012] Acquiring top surface depth information of the boxed object according to the top surface segmentation map;
[0013] The top surface point cloud of the boxed object is determined according to the top surface depth information and the internal parameters of the depth camera.
[0014] In one implementation, the top surface point cloud includes N points; and performing plane fitting on the top surface point cloud to obtain a fitting plane includes:
[0015] Step 1, randomly selecting K points from the N points;
[0016] Step 2, fitting a plane according to the K points;
[0017] Step 3: for the N points, count the number of inner points whose distance to the plane is less than a preset distance threshold;
[0018] Step 4, the one with the largest number of interior points between the plane fitted in the (i+1)th round and the optimal plane determined in the (i)th round is determined as the optimal plane in the (i+1)th round;
[0019] Step 5, iteratively executing steps 1 to 4 for a preset number of times, and determining the final optimal plane as the fitting plane.
[0020] In one implementation, obtaining an optimized top surface rectangle according to the projected point cloud includes:
[0021] Performing minimum circumscribed rectangle fitting on the projected point cloud to obtain a minimum circumscribed rectangle surrounding the projected point cloud;
[0022] The edges of the minimum circumscribed rectangle are translated toward the center of the rectangle according to a preset iterative translation rule to obtain the optimized top surface rectangle.
[0023] In one embodiment, translating the edge of the minimum circumscribed rectangle toward the center of the rectangle according to a preset iterative translation rule includes:
[0024] Step 1, for each side of the minimum circumscribed rectangle, calculate the distance from all points in the minimum circumscribed rectangle to each side;
[0025] Step 2, iteratively counting the number of target points whose distances to each edge are within the dynamic adjustment length threshold, wherein the initial value of the dynamic adjustment length is 0, and the dynamic adjustment length increases with a fixed step size in each iteration;
[0026] Step 3, during the iteration process, if the number of target points increased in the j-th iteration compared to the j-1-th iteration is greater than the first preset point threshold, or when the number of target points counted in the j-th iteration is greater than the second preset point threshold, then stop the iteration;
[0027] Step 4: translate each edge toward the center of the rectangle by a target distance, where the target distance is the dynamic adjustment length when the iteration is stopped.
[0028] In one embodiment, the posture information includes a posture matrix; and obtaining the posture information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object includes:
[0029] Determining an initial position of the boxed object according to the center of the top surface of the boxed object;
[0030] Taking the geometric center of the optimized top rectangle as the current position of the boxed object;
[0031] The posture matrix is obtained according to the initial position and the current position of the boxed object.
[0032] In one embodiment, the initial position includes a plurality of initial vertex coordinates, the current position includes a plurality of current coordinates, and acquiring the posture matrix according to the initial position and the current position of the boxed object includes:
[0033] According to the one-to-one correspondence between the multiple initial vertex coordinates and the multiple current coordinates, a multiple group point pairs are obtained;
[0034] Constructing an initial matrix according to a plurality of said groups of point pairs;
[0035] Performing singular value decomposition on the initial matrix to obtain the posture matrix.
[0036] In a second aspect, an embodiment of the present application provides a posture estimation device based on a boxed object, and the posture estimation device based on a boxed object includes:
[0037] A first acquisition module is used to acquire a top surface point cloud from a boxed object depth image based on an instance segmentation algorithm;
[0038] A fitting module, used for performing plane fitting on the top surface point cloud to obtain a fitting plane;
[0039] A projection module, used for projecting the inner points corresponding to the fitting plane onto the fitting plane to obtain a projected point cloud;
[0040] A second acquisition module, used for acquiring an optimized top surface rectangle according to the projected point cloud;
[0041] The third acquisition module is used to acquire the position information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object.
[0042] In a third aspect, an embodiment of the present application provides a robotic arm, comprising a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is run by the processor, the pose estimation method based on the boxed object provided in the first aspect is executed.
[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when running on a processor, executes the pose estimation method based on boxed objects provided in the first aspect.
[0044] The above-mentioned method, device, robotic arm and medium based on the pose estimation of the boxed object provided by the present application obtain the top surface point cloud from the depth image of the boxed object based on the instance segmentation algorithm; perform plane fitting on the top surface point cloud to obtain the fitting plane; project the inner points corresponding to the fitting plane onto the fitting plane to obtain the projected point cloud; obtain the optimized top surface rectangle according to the projected point cloud; obtain the pose information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object, so as to obtain more accurate pose information of the boxed object, reduce position and rotation errors, facilitate the execution of operations with higher precision requirements, and improve the operation accuracy of the robotic arm. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.
[0046] Figure 1 A first flow chart of a method for estimating a pose of a boxed object provided in an embodiment of the present application is shown;
[0047] Figure 2 A second flow chart of a method for estimating a pose of a boxed object provided in an embodiment of the present application is shown;
[0048] Figure 3 A third flow chart of a method for estimating a pose of a boxed object provided in an embodiment of the present application is shown;
[0049] Figure 4 A fourth flow chart of a method for estimating a pose of a boxed object provided in an embodiment of the present application is shown;
[0050] Figure 5 A fifth flow chart of a method for estimating a pose of a boxed object provided in an embodiment of the present application is shown;
[0051] Figure 6 A sixth flow chart of a method for estimating a pose of a boxed object provided in an embodiment of the present application is shown;
[0052] Figure 7 A seventh flow chart of a method for estimating a pose of a boxed object provided in an embodiment of the present application is shown;
[0053] Figure 8 A structural schematic diagram of a posture estimation device based on a boxed object provided in an embodiment of the present application is shown.
[0054] Icons: 800 - a pose estimation device based on a boxed object, 801 - a first acquisition module, 802 - a fitting module, 803 - a projection module, 804 - a second acquisition module, 805 - a third acquisition module. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0056] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0057] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.
[0058] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0059] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0060] Example 1
[0061] In order to solve the problems existing in the prior art, the embodiments of the present application provide a method for estimating the posture of boxed objects, which can more stably and accurately predict the posture of boxed objects and facilitate the robot arm to accurately perform grasping tasks.
[0062] See also Figure 1The method for estimating the pose of a boxed object includes steps S101 to S105. The method can be applied to a robot arm, which is equipped with a depth camera. The depth camera can capture depth images for various scenes, for example, capturing depth images corresponding to logistics express boxes in industrial scenes, or capturing depth images corresponding to fully automatic palletizing scenes, etc., without limitation. Each step is described below.
[0063] Step S101 , obtaining a top surface point cloud from a boxed object depth image based on an instance segmentation algorithm.
[0064] In this embodiment, the instance segmentation algorithm is obtained by training the preset segmentation algorithm with the training data set. The preset neural network model can be the yolov8-seg algorithm or other segmentation algorithms, which are not limited here. The process of acquiring the training data set includes: collecting a depth image of a boxed object in a real scene through a depth camera, and marking the collected depth image of the boxed object with a top surface segmentation map of the boxed object, thereby obtaining a training data set.
[0065] It should be noted that corresponding training data sets are collected for boxed objects in different scenarios. For example, the depth image of the boxed object corresponding to the logistics express box forms the corresponding express box training data set, and the depth image of the fully automatic palletizing scene forms the corresponding palletizing training data set. The express box training data set is input into the preset segmentation algorithm for training to obtain the instance segmentation algorithm for the logistics express scene. The palletizing training data set is input into the preset segmentation algorithm for training to obtain the instance segmentation algorithm for the palletizing scene. Using the instance segmentation algorithms corresponding to different scenarios to obtain the top surface point cloud can improve the extraction accuracy of the top surface point cloud.
[0066] See also Figure 2 , step S101 includes step S1011 to step S1013, and each step is described below.
[0067] Step S1011 , obtaining a top surface segmentation map of the boxed object from the boxed object depth image based on the instance segmentation algorithm.
[0068] In this embodiment, the trained instance segmentation model is used to reason the boxed object depth image, and the top surface segmentation map (mask) of each boxed object is predicted. Further, the matching instance segmentation model can be determined according to the specific scene of the boxed object depth image. For example, if the boxed object depth image is an automated palletizing scene, the instance segmentation model matching the automated palletizing scene is selected, and the boxed object depth image is reasoned by the selected instance segmentation model to predict and extract its top surface segmentation map.
[0069] Step S1012: acquiring top surface depth information of the boxed object according to the top surface segmentation map.
[0070] In this embodiment, the top surface depth information includes a depth region of the top surface. The depth region of each top surface is extracted through the top surface segmentation map, and the depth region includes a depth value.
[0071] Step S1013: determining a top surface point cloud of the boxed object according to the top surface depth information and the internal parameters of the depth camera.
[0072] In this embodiment, the top surface point cloud of each boxed object can be calculated based on the depth area of each top surface and the internal parameters of the depth camera. Exemplarily, the following formula can be used for calculation:
[0073]
[0074] Among them, (x, y, z) represents the coordinates of the top surface point cloud of each boxed object in the point cloud coordinate system, (x', y') represents the pixel coordinates in the image coordinate system, D is the depth value, and f x , f y is the focal length of the camera.
[0075] Step S102, performing plane fitting on the top surface point cloud to obtain a fitting plane.
[0076] In this embodiment, the top surface point cloud includes N points, where N is a relatively large positive integer. For example, N may be 500, 300, etc., which is determined according to the number of points actually extracted.
[0077] See also Figure 3 , step S102 includes step S1021-step S1025, and each step is described below.
[0078] Step S1021: randomly select K points from the N points.
[0079] In this embodiment, K is a positive integer less than N. For example, N is 500 and K is 50.
[0080] Step S1022: Fit a plane according to the K points.
[0081] In this embodiment, the RANSAC algorithm can be used for fitting to remove noise points and outliers on the plane. The larger the K value is, the greater the amount of calculation required for fitting by the RANSAC algorithm. The K value can be selected according to actual needs.
[0082] Step S1023: for the N points, count the number of inner points whose distances to the plane are less than a preset distance threshold.
[0083] In this step, the distance to the plane determined in step S1022 is calculated for each point of all N points, and the points whose distance to the plane is less than the preset distance threshold are taken as inner points, and the number of inner points is counted. The preset distance threshold can be selected according to actual needs, and the preset distance threshold is a smaller value, for example, the preset distance threshold can be 5 mm.
[0084] Step S1024, the one with the largest number of inliers between the plane fitted in the (i+1)th round and the optimal plane determined in the i-th round is determined as the optimal plane in the (i+1)th round.
[0085] In this embodiment, in the first round of calculation, the plane determined in the first round is taken as the optimal plane. In the second round, the plane with the largest number of inliers in the first and second rounds is determined as the optimal plane of the second round. When i≥1, if the number of inliers of the plane fitted in the i+1th round is greater than the number of inliers in the optimal plane determined in the i-th round, the plane fitted in the i+1th round is determined as the optimal plane of the i+1th round. If the number of inliers of the plane fitted in the i+1th round is less than the number of inliers in the optimal plane determined in the i-th round, the optimal plane determined in the i-th round is taken as the optimal plane of the i+1th round.
[0086] Step S1025, iteratively executing S1021-S1024 for a preset number of times, and determining the final optimal plane as the fitting plane.
[0087] In this embodiment, the preset number of times may be set by a user, for example, the preset number of times may be 100, which is not limited here.
[0088] Step S103: project the inner points corresponding to the fitting plane onto the fitting plane to obtain a projected point cloud.
[0089] In this embodiment, the inner points corresponding to the fitting plane are projected onto the fitting plane so that all points are projected onto the same plane.
[0090] Step S104: acquiring an optimized top surface rectangle according to the projected point cloud.
[0091] See also Figure 4 , step S104 includes step S1041-step S1042, and each step is described below.
[0092] Step S1041 , performing minimum circumscribed rectangle fitting on the projected point cloud to obtain a minimum circumscribed rectangle surrounding the projected point cloud.
[0093] In this embodiment, since the projected point clouds are located in the same plane, a minimum circumscribed rectangle can be fitted to them to obtain a minimum circumscribed rectangle surrounding all projected point clouds, and each vertex of the minimum circumscribed rectangle is also coplanar with all projected point clouds.
[0094] Step S1042: translating the sides of the minimum circumscribed rectangle toward the center of the rectangle according to a preset iterative translation rule to obtain the optimized top surface rectangle.
[0095] See also Figure 5 , the step S1042 includes the following steps:
[0096] Step S10421: For each side of the minimum circumscribed rectangle, calculate the distances from all points in the minimum circumscribed rectangle to each side.
[0097] In this embodiment, for each side of the minimum circumscribed rectangle, the distances from all projection points within the minimum circumscribed rectangle to each side are calculated respectively.
[0098] Step S10422, iteratively counting the number of target points whose distances to each edge are within the dynamically adjusted length threshold.
[0099] In this embodiment, the initial value of the dynamically adjusted length is 0, and in each iteration, the dynamically adjusted length increases with a fixed step length, which is a relatively small value, for example, 1 mm.
[0100] Step S10423, during the iteration process, if the number of target points increased in the j-th iteration compared to the j-1-th iteration is greater than the first preset point threshold, or when the number of target points counted in the j-th iteration is greater than the second preset point threshold, the iteration is stopped.
[0101] In this embodiment, j is a positive integer approximately equal to 2. Exemplarily, during the iteration process, if the number of target points in the jth iteration is N j , the number of target points in the j-1th iteration is N j-1 , increase the number of target points, that is, N j -N j-1 When the number N is greater than a first preset point threshold (such as 20), or when i When the value is greater than a second preset point threshold (such as 200), the iteration is stopped.
[0102] Step S10424, translate each edge toward the center of the rectangle by a target distance, where the target distance is the dynamically adjusted length when the iteration is stopped.
[0103] Finally, the edge is translated toward the center of the rectangle, and the translation distance is the dynamic adjustment length when the iteration is stopped; this reduces the influence of noise points and outliers at the edge of the circumscribed rectangle, achieving the purpose of optimizing the top surface rectangle.
[0104] Step S105 , obtaining the position information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object.
[0105] In this embodiment, the posture information includes a 6D posture, and the coordinate change and the rotation angle change from the initial position to the actual position of the boxed object are the 6D posture of the boxed object.
[0106] The pose estimation method based on boxed objects provided in this embodiment has good stability and is more conducive to practical use in industrial scenarios. In this embodiment, a deep learning method is not used to directly estimate the 6D pose of a box-shaped object, because the true 6D pose of a box-shaped object is difficult to obtain, which makes it difficult to obtain training data. The present invention directly segments the top surface of the box-shaped object, and the difficulty of data acquisition is greatly reduced. Based on the optimization algorithm of point cloud, the 6D pose of the boxed object can be obtained more accurately, and the position and rotation errors can be reduced, which is convenient for performing operations with higher precision requirements. For example, this method is used in robot arm palletizing scenes, logistics express box scenes, etc. to accurately identify the 6D pose of the boxed objects in the scene, which can effectively improve the stability and accuracy of the robot arm grabbing the boxed objects.
[0107] See also Figure 6 , the step S105 comprises the following steps:
[0108] Step S1051, determining the initial position of the boxed object according to the center of the top surface of the boxed object.
[0109] In the actual grasping process, the robot arm will grasp the top center of the boxed object, and the top center of the boxed object can be regarded as the grasping center. The initial position of the top rectangle of the boxed object is defined as follows: in the camera coordinate system, the four vertices of the top rectangle are in the plane where the x and y coordinate axes are located (the z axis is facing the front of the camera), and the long side of the top rectangle is parallel to the x axis, and the geometric center of the top rectangle is located at the origin of the camera coordinate system (0, 0, 0).
[0110] Step S1052: taking the geometric center of the optimized top rectangle as the current position of the boxed object.
[0111] Step S1053, acquiring the posture matrix according to the initial position and current position of the boxed object.
[0112] In this embodiment, the initial position includes a plurality of initial vertex coordinates, and the current position includes a plurality of current coordinates.
[0113] See also Figure 7 , the step S1053 includes:
[0114] Step S10531, obtaining multiple point pairs based on one-to-one correspondence between the multiple initial vertex coordinates and the multiple current coordinates.
[0115] In this embodiment, the coordinates of the four vertices of the optimized top rectangle are matched one by one with the coordinates of the four vertices of the top rectangle at the initial position, so as to obtain four groups of point pairs.
[0116] Step S10532: construct an initial matrix based on the plurality of point pairs.
[0117] The coordinate value pairs of multiple points measured in two different coordinate systems are constructed into an initial matrix, and the initial matrix is subjected to singular value decomposition to obtain a posture matrix.
[0118] Exemplarily, the pose matrix can be expressed as:
[0119]
[0120] In this embodiment, the rotation matrix needs to be solved 1 P and 2 P corresponds to two sets of point clouds. 1 P. 2 P represents a set of point clouds composed of the coordinates of the four vertices of the top rectangle at the initial position, and a set of point clouds composed of the coordinates of the four vertices of the optimized top rectangle.
[0121] Step S10533, performing singular value decomposition on the initial matrix to obtain the posture matrix.
[0122] In this embodiment, two sets of point clouds are used 1 P and 2 P constructs a matrix H, which is expressed as follows:
[0123]
[0124] Among them, m represents the point cloud 1 P or point cloud 2 The number of P, for example, m can be 4. Representing point clouds 1 The mean of the coordinate points of P, Representing point clouds 2 The mean of the coordinate points of P.
[0125] Perform singular value decomposition on the matrix H and obtain the following formula:
[0126] U·ΔV T =SVD(H)
[0127] It should be noted that the above formula represents the SVD decomposition of the H matrix, that is, the singular value decomposition, which is a mathematical operation. U and V are both unitary matrices, and △ is a singular value matrix;
[0128] Then calculate |V·UT | If the sign is greater than 0, the following formula is used to calculate
[0129]
[0130] If |V·U T | is less than 0, change the sign of any column of V, and substitute the changed V into the formula Calculated
[0131] The pose estimation method based on the boxed object provided in the present embodiment obtains the top surface point cloud from the depth image of the boxed object based on the instance segmentation algorithm; performs plane fitting on the top surface point cloud to obtain a fitting plane; projects the inner points corresponding to the fitting plane onto the fitting plane to obtain a projected point cloud; obtains an optimized top surface rectangle according to the projected point cloud; obtains the pose information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object, so as to obtain more accurate pose information of the boxed object, reduce position and rotation errors, facilitate the execution of operations with higher precision requirements, and improve the operating accuracy of the robotic arm.
[0132] Example 2
[0133] In addition, an embodiment of the present application provides a posture estimation device based on a boxed object.
[0134] like Figure 8 As shown, the pose estimation device 800 based on the boxed object includes:
[0135] A first acquisition module 801 is used to acquire a top surface point cloud from a boxed object depth image based on an instance segmentation algorithm;
[0136] A fitting module 802 is used to perform plane fitting on the top surface point cloud to obtain a fitting plane;
[0137] A projection module 803 is used to project the inner points corresponding to the fitting plane onto the fitting plane to obtain a projected point cloud;
[0138] A second acquisition module 804 is used to acquire an optimized top surface rectangle according to the projected point cloud;
[0139] The third acquisition module 805 is used to acquire the position information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object.
[0140] In one embodiment, the first acquisition module 801 is configured to acquire a top surface segmentation map of the boxed object from the boxed object depth image based on the instance segmentation algorithm;
[0141] Acquiring top surface depth information of the boxed object according to the top surface segmentation map;
[0142] The top surface point cloud of the boxed object is determined according to the top surface depth information and the internal parameters of the depth camera.
[0143] In one embodiment, the top surface point cloud includes N points; the fitting module 802 is used to perform the following steps: step 1, randomly selecting K points from the N points;
[0144] Step 2, fitting a plane according to the K points;
[0145] Step 3: for the N points, count the number of inner points whose distance to the plane is less than a preset distance threshold;
[0146] Step 4, the one with the largest number of interior points between the plane fitted in the (i+1)th round and the optimal plane determined in the (i)th round is determined as the optimal plane in the (i+1)th round;
[0147] Step 5, iteratively executing steps 1 to 4 for a preset number of times, and determining the final optimal plane as the fitting plane.
[0148] In one embodiment, the second acquisition module 804 is further used to perform minimum bounding rectangle fitting on the projected point cloud to obtain a minimum bounding rectangle surrounding the projected point cloud;
[0149] The edges of the minimum circumscribed rectangle are translated toward the center of the rectangle according to a preset iterative translation rule to obtain the optimized top surface rectangle.
[0150] In one implementation, the second acquisition module 804 is further configured to perform the following steps:
[0151] Step 1, for each side of the minimum circumscribed rectangle, calculate the distance from all points in the minimum circumscribed rectangle to each side;
[0152] Step 2, iteratively counting the number of target points whose distances to each edge are within the dynamic adjustment length threshold, wherein the initial value of the dynamic adjustment length is 0, and the dynamic adjustment length increases with a fixed step size in each iteration;
[0153] Step 3, during the iteration process, if the number of target points increased in the j-th iteration compared to the j-1-th iteration is greater than the first preset point threshold, or when the number of target points counted in the j-th iteration is greater than the second preset point threshold, then stop the iteration;
[0154] Step 4: translate each edge toward the center of the rectangle by a target distance, where the target distance is the dynamic adjustment length when the iteration is stopped.
[0155] In one embodiment, the position information includes a posture matrix; the third acquisition module 805 is further used to determine the initial position of the boxed object according to the top center of the boxed object;
[0156] Taking the geometric center of the optimized top rectangle as the current position of the boxed object;
[0157] The posture matrix is obtained according to the initial position and the current position of the boxed object.
[0158] In one embodiment, the initial position includes a plurality of initial vertex coordinates, the current position includes a plurality of current coordinates, and the third acquisition module 805 is further used to obtain a plurality of point pairs according to one-to-one correspondence between the plurality of initial vertex coordinates and the plurality of current coordinates;
[0159] Constructing an initial matrix according to a plurality of said groups of point pairs;
[0160] Performing singular value decomposition on the initial matrix to obtain the posture matrix.
[0161] The apparatus 500 for estimating a pose based on a boxed object provided in this embodiment can implement the method for estimating a pose based on a boxed object provided in Embodiment 1, which will not be described again here to avoid repetition.
[0162] The pose estimation device based on the boxed object provided in the present embodiment obtains the top surface point cloud from the depth image of the boxed object based on the instance segmentation algorithm; performs plane fitting on the top surface point cloud to obtain a fitting plane; projects the inner points corresponding to the fitting plane onto the fitting plane to obtain a projected point cloud; obtains an optimized top surface rectangle according to the projected point cloud; obtains the pose information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object, so as to obtain more accurate pose information of the boxed object, reduce position and rotation errors, facilitate the execution of operations with higher precision requirements, and improve the operating accuracy of the robotic arm.
[0163] Example 3
[0164] In addition, an embodiment of the present application provides a robotic arm, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the pose estimation method based on the boxed object provided in Example 1 is executed.
[0165] The robotic arm provided in this embodiment can implement the pose estimation method based on boxed objects provided in Example 1, and will not be described again here to avoid repetition.
[0166] The robotic arm provided in this embodiment obtains the top surface point cloud from the depth image of the boxed object based on the instance segmentation algorithm; performs plane fitting on the top surface point cloud to obtain a fitting plane; projects the inner points corresponding to the fitting plane to the fitting plane to obtain a projected point cloud; obtains an optimized top surface rectangle according to the projected point cloud; obtains the pose information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object, which can obtain more accurate pose information of the boxed object, reduce position and rotation errors, facilitate the execution of operations with higher precision requirements, and improve the operational accuracy of the robotic arm. For example, in the stacking scene, logistics express box scene, etc., the robotic arm accurately identifies the 6D pose of the boxed object in the scene, which can effectively improve the stability and accuracy of the robotic arm in grasping the boxed object.
[0167] Example 4
[0168] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for estimating the pose of a boxed object provided in Example 1 is implemented.
[0169] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0170] The computer-readable storage medium provided in this embodiment can implement the pose estimation method based on the boxed object provided in Example 1. To avoid repetition, it will not be described here.
[0171] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.
[0172] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0173] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for estimating the pose of a boxed object, characterized in that: The method comprises: Obtain top surface point cloud from boxed object depth image based on instance segmentation algorithm; Performing plane fitting on the top surface point cloud to obtain a fitting plane; Projecting the inner points corresponding to the fitting plane onto the fitting plane to obtain a projected point cloud; Acquire an optimized top surface rectangle according to the projected point cloud; The pose information of the boxed object is obtained according to the optimized top surface rectangle and the initial position of the boxed object.
2. The method according to claim 1, characterized in that: The method of obtaining a top surface point cloud from a boxed object depth image based on an instance segmentation algorithm includes: Acquire a top surface segmentation map of the boxed object from the boxed object depth image based on the instance segmentation algorithm; Acquiring top surface depth information of the boxed object according to the top surface segmentation map; The top surface point cloud of the boxed object is determined according to the top surface depth information and the internal parameters of the depth camera.
3. The method according to claim 1, characterized in that The top surface point cloud includes N points; performing plane fitting on the top surface point cloud to obtain a fitting plane includes: Step 1, randomly selecting K points from the N points; Step 2, fitting a plane according to the K points; Step 3: for the N points, count the number of inner points whose distance to the plane is less than a preset distance threshold; Step 4, the one with the largest number of interior points between the plane fitted in the (i+1)th round and the optimal plane determined in the (i)th round is determined as the optimal plane in the (i+1)th round; Step 5, iteratively executing steps 1 to 4 for a preset number of times, and determining the final optimal plane as the fitting plane.
4. The method according to claim 1, characterized in that: The step of obtaining an optimized top surface rectangle according to the projected point cloud comprises: Performing minimum circumscribed rectangle fitting on the projected point cloud to obtain a minimum circumscribed rectangle surrounding the projected point cloud; The edges of the minimum circumscribed rectangle are translated toward the center of the rectangle according to a preset iterative translation rule to obtain the optimized top surface rectangle.
5. The method according to claim 4, characterized in that The step of translating the edge of the minimum circumscribed rectangle toward the center of the rectangle according to a preset iterative translation rule includes: Step 1, for each side of the minimum circumscribed rectangle, calculate the distance from all points in the minimum circumscribed rectangle to each side; Step 2, iteratively counting the number of target points whose distances to each edge are within the dynamic adjustment length threshold, wherein the initial value of the dynamic adjustment length is 0, and the dynamic adjustment length increases with a fixed step size in each iteration; Step 3, during the iteration process, if the number of target points increased in the j-th iteration compared to the j-1-th iteration is greater than the first preset point threshold, or when the number of target points counted in the j-th iteration is greater than the second preset point threshold, then stop the iteration; Step 4: translate each edge toward the center of the rectangle by a target distance, where the target distance is the dynamic adjustment length when the iteration is stopped.
6. The method according to claim 1, characterized in that The pose information includes a pose matrix; the step of obtaining the pose information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object includes: Determining an initial position of the boxed object according to the center of the top surface of the boxed object; Taking the geometric center of the optimized top rectangle as the current position of the boxed object; The posture matrix is obtained according to the initial position and the current position of the boxed object.
7. The method according to claim 6, characterized in that The initial position includes a plurality of initial vertex coordinates, the current position includes a plurality of current coordinates, and acquiring the posture matrix according to the initial position and the current position of the boxed object includes: According to the one-to-one correspondence between the multiple initial vertex coordinates and the multiple current coordinates, a multiple group point pairs are obtained; Constructing an initial matrix according to a plurality of said groups of point pairs; Performing singular value decomposition on the initial matrix to obtain the posture matrix.
8. A pose estimation device based on a boxed object, characterized in that: The device comprises: A first acquisition module is used to acquire a top surface point cloud from a boxed object depth image based on an instance segmentation algorithm; A fitting module, used for performing plane fitting on the top surface point cloud to obtain a fitting plane; A projection module, used for projecting the inner points corresponding to the fitting plane onto the fitting plane to obtain a projected point cloud; A second acquisition module, used for acquiring an optimized top surface rectangle according to the projected point cloud; The third acquisition module is used to acquire the position information of the boxed object according to the optimized top surface rectangle and the initial position of the boxed object.
9. A robotic arm, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is run on the processor, the method for estimating the pose of a boxed object according to any one of claims 1 to 7 is executed.
10. A computer-readable storage medium, characterized in that: The device stores a computer program, which, when running on a processor, executes the pose estimation method based on a boxed object according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for obtaining volumes of target objects, terminal equipment and storage medium
CN108416804A
Cabinet fit method, apparatus and computer-readable storage medium
CN109035330A
Target object detection method and device and computer equipment
CN110992356A
Unstacking method, device, electronic equipment and system based on visual guidance
CN115533902A
Lidar noise removal using image pixel clusterings
US20190287254A1
Cited By
Box clamping point estimation method and device based on depth camera and electronic equipment
CN121170017A
