Article three-dimensional semantic key point manufacturing and detecting method based on triangularization principle
Through a method based on the triangulation principle and combined with a high-resolution network, the three-dimensional semantic key point detection of item objects is realized, which solves the problem of difficulty in capturing specific information of items in the existing technology and improves the accuracy and information richness of detection. Assist robots to perform tasks.
Patent Information
- Application Number
- CN202410720715.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-10
AI Technical Summary
The existing technology is difficult to capture specific information such as the size and shape of objects, and it is difficult to fully represent the interaction details between objects through relative pose relationships, making it unable to meet the needs of service robots.
A method for producing and detecting three-dimensional semantic key points of items based on the triangulation principle is adopted. By constructing a visual benchmark, the camera pose and image data from multiple perspectives are obtained, the semantic key points are marked, the depth value is calculated, converted into three-dimensional coordinates, and using high-definition The resolution network performs feature fusion and prediction to achieve three-dimensional coordinate detection of semantic key points of object objects.
It realizes the rapid production of three-dimensional semantic key point data sets, abstracts the size, shape, posture and other information of object objects, assists robots in performing operating tasks, and improves detection accuracy and information richness.
Smart Images

Figure CN118628455A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of deep learning and image processing, and specifically relates to a method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle. Background Art
[0002] With the development of robotics technology, the application of robots has gradually shifted from industrial scenarios to service scenarios. In real life, when service robots operate objects to perform tasks, they need to interpret the scene before planning and execution. Understanding the state of the object is a key step. Therefore, it is very important to detect objects in the scene and extract information such as the location, size, shape or posture of the objects for subsequent robots to perform related tasks.
[0003] However, most of the current research focuses on target detection or pose estimation of objects, and pose estimation is even limited to the instance level, which is difficult to meet the needs of service robots. Moreover, only performing target detection and pose estimation may not be able to capture pose information changes caused by changes in shape and size within a class, nor can it obtain more specific information such as the size and shape of the object. At the same time, it is also impossible to fully represent the interaction details between objects only through relative pose relationships. Summary of the invention
[0004] In order to solve the shortcomings of the prior art and realize the detection of the three-dimensional coordinates of the semantic key points of the same type of objects, so as to abstract the specific information of the object, the present invention adopts the following technical solution:
[0005] The method for making and detecting three-dimensional semantic key points of objects based on the triangulation principle includes the following steps:
[0006] Step 1: Build a visual benchmark and calibrate the robot;
[0007] Step 2: Obtain the position and posture of the camera carried by the robot under multiple perspectives;
[0008] Step 3: Obtain image data from multiple perspectives through the camera;
[0009] Step 4: annotate the corresponding semantic key points of the images from different perspectives, determine the perspective corresponding to the image according to the position and posture of the camera under multiple perspectives, calculate the depth of each annotated semantic key point based on the triangulation principle, and obtain the annotation results based on the camera coordinate system under different perspectives. The annotation results are converted through the visual reference and propagated to all images to obtain three-dimensional semantic key points including image plane and depth.
[0010] Step 5: Based on the data set consisting of three-dimensional semantic key points, train a neural network for detecting three-dimensional semantic key points of object objects.
[0011] Furthermore, in step 1, based on the visual reference system, a visual reference board is constructed using multiple visual tags, and a visual reference tag is constructed using one of the visual tags for subsequent camera pose detection; in step 2, the visual reference board is arranged and the positions of multiple viewing angles are pre-set, the RGB camera is fixed at the end of the robot, the robot moves to multiple viewing angles in sequence and detects the visual tags, and the pose of the camera relative to the visual reference tag is calculated through the detection results of the multiple visual tags. The use of multiple visual tags can improve positioning accuracy.
[0012] Furthermore, step 4 comprises the following steps:
[0013] Step 4.1: Select two frames of images I1 and I2 with large changes in viewing angle for initial annotation. When annotating semantic key points, first annotate n key points on the I1 image. The n key points have different semantic information and can abstract the size, shape, posture and other information of the object. Then annotate n key points in the same order on the I2 image. The key points with the same sequence number represent the same semantics in the two frames of images.
[0014] Step 4.2: Using the I1 image as a reference, determine the viewing angles corresponding to the I1 and I2 images. Based on the camera poses at all viewing angles obtained in step 2, calculate the transformation matrix between the viewing angle corresponding to the I2 image and the viewing angle corresponding to the I1 image.
[0015] Step 4.3: Calculate the depth value of each annotated semantic key point based on the triangulation principle;
[0016] Step 4.4: Represent the key points relative to the visual reference to obtain the coordinates of the key points in the three-dimensional space. Through the transformation relationship of the camera at each viewing angle relative to the visual reference, convert the coordinates in the three-dimensional space to the camera coordinate system at all viewing angles to obtain the pixel coordinates and depth in the image plane, and complete the propagation of the annotation results on multiple frames of images.
[0017] Furthermore, the transformation matrix in step 4.2 is:
[0018]
[0019] Among them, R represents the rotation matrix and t represents the translation vector.
[0020] Furthermore, the depth value of each semantic key point in step 4.3 is:
[0021] [Rp1-p2]λ=-t
[0022] Among them, p1 and p2 are the normalized plane coordinates of key points with the same semantics in images I1 and I2, respectively, and both represent the projection of the same point P in three-dimensional space in different images, λ=[λ1 λ2] T , where λ1 and λ2 represent the depth values of P after projection in I1 and I2 respectively. The least squares solution of formula (2) is the result of λ. After the solution is completed, the annotation results based on the camera coordinate system under two perspectives can be obtained.
[0023] Furthermore, in step 4, the annotated key points are fine-tuned based on the least squares principle. Due to the randomness of annotation, there will still be errors in the back-projection calculation using only the annotation results of two images. Therefore, images from different perspectives are switched to check the annotated results and fine-tune them. By minimizing the three-dimensional distance error of all feature points, the results under all perspectives are optimized and the annotation is finally completed.
[0024] Furthermore, the step 5 comprises the following steps:
[0025] Step 5.1: In order to enable the network to always retain the original high-resolution feature information throughout the entire process of feature extraction and avoid frequent up-sampling and down-sampling resulting in more information loss, a high-resolution network HRNet is used to connect high-to-low sub-networks of different resolutions in parallel, and branches of different resolutions are allowed to exchange information to build the backbone network;
[0026] Step 5.2: Perform feature fusion on the branches with different resolutions output in parallel from the backbone network. Upsample all low-resolution feature maps to the highest resolution in each branch, add them bit by bit, and implement multi-scale information fusion through 3×3 convolution.
[0027] Step 5.3: The fused features are predicted through the prediction branch to obtain the three-dimensional coordinates of the semantic key points of the object; the prediction branch includes a prediction module, which is composed of three convolution modules. The first two convolution modules also include a batch normalization layer and a ReLU activation layer. The three prediction branches are used to build losses for training, and the two-dimensional key point heat map, the center vector map and the depth information of the key points are predicted respectively. The pixel coordinates of the key points in the image are obtained from the two-dimensional key point heat map; the center vector is a vector composed of all the key points of an object and its center point. The center point is calculated based on all the annotated key points, and the position and number of objects in the image are judged by the center point; the depth map is used to reflect the depth value of the object.
[0028] Furthermore, the loss of the two-dimensional keypoint heat map uses binary cross entropy:
[0029]
[0030] Among them, pcij Represents the value of the position coordinate index (i, j) in the heat map obtained by predicting the key point of type c, y cij Represents the value of the position coordinate index (i, j) in the true value heat map corresponding to the key point of the cth type.
[0031] Furthermore, the center loss of the center vector map uses Smooth L1:
[0032]
[0033] in, and v cij They represent the predicted value and true value of the center vector composed of the key point and center point of the cth type, respectively. It is a binary value indicating whether the heat map value of the c-type key point at the position coordinate index (i, j) is non-zero.
[0034] Furthermore, the depth loss of the depth information uses an L1 loss function:
[0035]
[0036] in, and z cij Represents the predicted value and true value of the c-type key point at the position coordinate index (i, j).
[0037] The final loss is the weighted value of the above losses:
[0038] L=λ heatmap L heatmap +λ center L center +λ depth L depth
[0039] Among them, λ heatmap , center and λ depth Represent the weights of two-dimensional key points, center vector and depth loss respectively.
[0040] The advantages and beneficial effects of the present invention are:
[0041] The triangulation-based object three-dimensional semantic key point production and detection method of the present invention can quickly produce a three-dimensional semantic key point data set of similar objects for training, realize the detection of the three-dimensional coordinates of the semantic key points of similar object objects, and abstract the size, shape, posture and other rich information of the object with the help of semantic key points to assist the robot in performing operation tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1The figure is a flow chart of a method according to an embodiment of the present invention.
[0043] Figure 2 Schematic diagram of the multi-view camera pose acquisition process in an embodiment of the present invention.
[0044] Figure 3 Schematic diagram of a multi-view image data acquisition process in an embodiment of the present invention.
[0045] Figure 4a This is one of the schematic diagrams for labeling semantic key points in an embodiment of the present invention.
[0046] Figure 4b This is the second schematic diagram of semantic key point labeling in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.
[0048] like Figure 1 As shown, the method for making and detecting three-dimensional semantic key points of an object based on the triangulation principle includes the following steps:
[0049] Step 1: If Figure 2 As shown, multiple AprilTag QR codes are used to build an AprilTags board; a laser tracker is used to calibrate the robot to reduce the robot's repeated positioning accuracy.
[0050] AprilTag can accurately identify QR codes under conditions such as high-speed movement, low light or long distance, with high recognition accuracy and low computing cost. In order to prevent a single AprilTag QR code from being lost in the process of the robot carrying a camera to scan the scene, multiple QR codes are laid out in A2 size to form an AprilTags board, and one of the QR codes, Tag0, is used to build a benchmark for subsequent camera posture detection.
[0051] In order to improve the repeated positioning accuracy of the robot, a laser tracker is used to calibrate the robot to obtain accurate DH parameters.
[0052] Step 2: If Figure 3 As shown, the robot carries a camera to obtain the camera pose under multiple perspectives.
[0053] Arrange the AprilTags board and pre-set the positions of multiple viewing angles. Fix the RGB camera at the end of the robot. The robot moves through multiple viewing angles in sequence and detects the AprilTag QR code. The position of the camera relative to the reference QR code Tag0 is calculated based on the detection results of multiple QR codes.
[0054] Step 3: The robot carries a camera to obtain RGB image data from multiple perspectives.
[0055] Use a robot to carry a camera and move to multiple pre-set viewing positions in sequence. Collect RGB image data through the camera, use the ROS topic to obtain the image and encode it into a rosbag file.
[0056] Step 4: Figure 4a , Figure 4b As shown, the semantic key points are annotated based on the triangulation principle and the predefined object semantic key points, and the annotation results are propagated to all images.
[0057] The three-dimensional coordinates of the semantic key points of an object are annotated based on the triangulation principle, including the following steps:
[0058] Step 4.1: Select two frames of images I1 and I2 with large changes in perspective for initial annotation. When annotating semantic key points, first annotate n key points on the I1 image. These n key points have different semantic information and can abstract the size, shape, posture and other information of the object. Then annotate n key points in the same order on the I2 image. The key points with the same sequence number represent the same semantics in the two frames of images.
[0059] Step 4.2: Using image I1 as a reference, determine the viewing angles corresponding to images I1 and I2. Based on the camera poses at all viewing angles obtained in step 2, calculate the transformation matrix between the viewing angle corresponding to image I2 and the viewing angle corresponding to image I1:
[0060]
[0061] Among them, R represents the rotation matrix, t represents the translation vector;
[0062] Step 4.3: Calculate the depth value of each semantic key point marked based on the triangulation principle:
[0063] [Rp1-p2]λ=-t (2)
[0064] Among them, p1 and p2 are the normalized plane coordinates of the key points with the same semantics in images I1 and I2, respectively, and both represent the projection of the same point P in three-dimensional space in different images, λ=[λ1 λ2] T represents the depth value of P after projection in I1 and I2. The least squares solution of formula (2) is the result of λ. After the solution is completed, the annotation results based on the camera coordinate system under two perspectives can be obtained;
[0065] Step 4.4: Express the annotation results relative to the reference coordinates (the coordinate system corresponding to the reference QR code Tag0) to obtain the coordinates of the key points in three-dimensional space. Then, through the transformation relationship of the camera at each viewing angle relative to the reference coordinates, convert the three-dimensional coordinates to the camera coordinate system at all viewing angles to obtain the depth value and the pixel coordinates in the image plane, completing the propagation of the annotation results on multiple frames of images.
[0066] Fine-tune the labeled key points based on the least squares principle.
[0067] Due to the randomness of annotation, there will still be errors in the back-projection calculation based only on the annotation results of two images. Therefore, we switch images from different perspectives to check the annotation results and make fine adjustments. By minimizing the 3D distance error of all feature points, we optimize the results under all perspectives and finally complete the annotation.
[0068] Step 5: Build a 3D semantic key point detection network based on HRNet (High-Resolution Network), and realize the 3D coordinate detection of semantic key points of single or multiple objects through multi-branch prediction.
[0069] Based on the 3D semantic key point dataset constructed in steps 1 to 4, a 3D semantic key point detection network is constructed using the HRNet network, and the 3D coordinate detection of the semantic key points of a single or multiple objects is realized through multi-branch prediction;
[0070] Step 5.1: In order to enable the network to always retain the original high-resolution feature information throughout the entire process of feature extraction and avoid frequent up- and down-sampling resulting in more information loss, HRNet is used to connect the high-to-low sub-networks in parallel, and branches with different resolutions are allowed to exchange information to build the backbone network;
[0071] Step 5.2: The four branches with different resolutions output in parallel by the backbone network are subjected to feature fusion. All low-resolution feature maps are upsampled to the highest resolution among the four branches, added bit by bit, and multi-scale information fusion is achieved through 3×3 convolution.
[0072] Step 5.3: The output result of step 5.2 is input into the prediction branch for prediction. The prediction branch mainly includes a prediction module, which is composed of three convolution modules. The first two convolution modules also include a batch normalization layer and a ReLU activation layer. Use three prediction branches for prediction, respectively predicting the two-dimensional key point heat map, the center vector map, and the depth information of the key points. The pixel coordinates of the key points in the image can be obtained from the two-dimensional key point heat map; the center vector is a vector composed of all the key points of an object and its center point. The center point is calculated based on all the annotated key points. The position and number of objects in the image can be determined by the center point; the depth map reflects the depth value. Finally, the detection of the three-dimensional coordinates of the semantic key points of single or multiple objects is realized.
[0073] The 2D coordinate heatmap loss uses binary cross entropy:
[0074]
[0075] Among them, p cij Represents the value of the position index (i, j) in the heat map obtained by predicting the key point of type c, y cij The value corresponding to the position index (i, j) in the true value heat map of the key point of the cth type.
[0076] The center loss uses Smooth L1:
[0077]
[0078] in, and v cij They represent the predicted value and true value of the center vector composed of the key point and center point of the cth type, respectively. Is a binary value indicating whether the heat map value of the c-type keypoint at position index (i, j) is non-zero.
[0079] The depth loss uses the L1 loss function:
[0080]
[0081] in, and z cij Represents the predicted value and true value of the c-type key point at the position index (i, j).
[0082] The final loss is the weighted value of the above losses:
[0083] L=λ heatmap L heatmap +λ center L center +λ depth L depth (6)
[0084] Among them, λ heatmap , center and λ depth Represent the weights of two-dimensional key points, center vector and depth loss respectively.
[0085] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for making and detecting three-dimensional semantic key points of objects based on the triangulation principle, characterized in that The steps include: Step 1: Build a visual benchmark and calibrate the robot; Step 2: Obtain the position and posture of the camera carried by the robot under multiple perspectives; Step 3: Obtain image data from multiple perspectives through the camera; Step 4: annotate the corresponding semantic key points of the images from different perspectives, determine the perspective corresponding to the image according to the position and posture of the camera under multiple perspectives, calculate the depth of each annotated semantic key point based on the triangulation principle, and obtain the annotation results based on the camera coordinate system under different perspectives. The annotation results are converted through the visual reference and propagated to all images to obtain three-dimensional semantic key points including image plane and depth. Step 5: Based on the data set consisting of three-dimensional semantic key points, train a neural network for detecting three-dimensional semantic key points of object objects.
2. The method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 1 is characterized in that: In the step 1, based on the visual reference system, a plurality of visual labels are used to construct a visual reference plate, and one of the visual labels is used to construct a visual reference label; In step 2, a visual reference plate is arranged and positions of multiple viewing angles are pre-set, a camera is fixed at the end of the robot, the robot moves through multiple viewing angles in sequence and detects visual tags, and the position and posture of the camera relative to the visual reference tag is calculated based on the detection results of multiple visual tags.
3. The method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 1 is characterized in that: The step 4 comprises the following steps: Step 4.1: Select two frames of images I1 and I2 with large perspective changes for initial annotation. When annotating semantic key points, first annotate n key points on the I1 image, and the n key points have different semantic information; then annotate n key points in the same order on the I2 image, and the key points with the same sequence number represent the same semantics in the two frames of images; Step 4.2: Using the I1 image as a reference, determine the viewing angles corresponding to the I1 and I2 images. Based on the camera poses at all viewing angles obtained in step 2, calculate the transformation matrix between the viewing angle corresponding to the I2 image and the viewing angle corresponding to the I1 image. Step 4.3: Calculate the depth value of each annotated semantic key point based on the triangulation principle; Step 4.4: Represent relative to the visual reference to obtain the coordinates of the key points in the three-dimensional space. Through the transformation relationship of the camera at each viewing angle relative to the visual reference, the coordinates in the three-dimensional space are converted to the camera coordinate system at all viewing angles to obtain the pixel coordinates and depth in the image plane.
4. The method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 3 is characterized in that: The transformation matrix in step 4.2 is: Among them, R represents the rotation matrix and t represents the translation vector.
5. The method for making and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 3 is characterized in that: The depth value of each semantic key point in step 4.3: [Rp1-p2]λ=-t Among them, p1 and p2 are the normalized plane coordinates of key points with the same semantics in images I1 and I2, respectively, and both represent the projection of the same point P in three-dimensional space in different images, λ=[λ1λ2] T , where λ1 and λ2 represent the depth values of P after projection in I1 and I2 respectively.
6. The method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 1, characterized in that: In step 4, the annotated key points are fine-tuned based on the least squares principle, and images of different perspectives are switched to check the annotated results and fine-tune them. By minimizing the three-dimensional distance error of all feature points, the results under all perspectives are optimized, and the annotation is finally completed.
7. The method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 1 is characterized in that: The step 5 comprises the following steps: Step 5.1: Use the high-resolution network to connect sub-networks of different resolutions in parallel, and let branches of different resolutions exchange information to build the backbone network; Step 5.2: Perform feature fusion on the branches with different resolutions output in parallel from the backbone network, and upsample all low-resolution feature maps to the highest resolution in each branch; Step 5.3: Predict the fused features through the prediction branch to obtain the three-dimensional coordinates of the semantic key points of the object; use three prediction branches to build losses for training, predict the two-dimensional key point heat map, the center vector map and the depth information of the key points respectively, and obtain the pixel coordinates of the key points in the image from the two-dimensional key point heat map; the center vector is a vector composed of all the key points of an object and its center point. The center point is calculated based on all the annotated key points, and the position and number of objects in the image are judged by the center point; the depth map is used to reflect the depth value of the object.
8. The method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 7 is characterized in that: The loss of the 2D keypoint heatmap uses binary cross entropy: Among them, p cij Represents the value of the position coordinate index (i, j) in the heat map obtained by predicting the key point of type c, y cij Represents the value of the position coordinate index (i, j) in the true value heat map corresponding to the key point of the cth type.
9. The method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 7, characterized in that: The center loss of the center vector map uses Smooth L1: in, and v cij They represent the predicted value and true value of the center vector composed of the key point and center point of the cth type, respectively. It is a binary value indicating whether the heat map value of the c-type key point at the position coordinate index (i, j) is non-zero.
10. The method for producing and detecting three-dimensional semantic key points of an object based on the triangulation principle according to claim 7, characterized in that: The depth loss of the depth information uses the L1 loss function: in, and z cij Represents the predicted value and true value of the c-type key point at the position coordinate index (i, j).
