[go: up one dir, main page]

CN115049737A - Pose marking method, device and system and storage medium - Google Patents

Pose marking method, device and system and storage medium Download PDF

Info

Publication number
CN115049737A
CN115049737A CN202110219672.1A CN202110219672A CN115049737A CN 115049737 A CN115049737 A CN 115049737A CN 202110219672 A CN202110219672 A CN 202110219672A CN 115049737 A CN115049737 A CN 115049737A
Authority
CN
China
Prior art keywords
pose
frame image
target object
coordinate system
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110219672.1A
Other languages
Chinese (zh)
Other versions
CN115049737B (en
Inventor
蒋星
石瑞宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Bozhilin Robot Co Ltd
Original Assignee
Guangdong Bozhilin Robot Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Bozhilin Robot Co Ltd filed Critical Guangdong Bozhilin Robot Co Ltd
Priority to CN202110219672.1A priority Critical patent/CN115049737B/en
Publication of CN115049737A publication Critical patent/CN115049737A/en
Application granted granted Critical
Publication of CN115049737B publication Critical patent/CN115049737B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/11Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Algebra (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Operations Research (AREA)
  • Computing Systems (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention discloses a pose marking method, a pose marking device, a pose marking system and a storage medium. The method comprises the steps that an obtained sequence frame image comprises a reference object and a target object, the sequence frame image comprises a reference frame image and a current frame image, and a first pose conversion relation is obtained based on feature points of the reference object, projection points in the reference frame image and projection points in the current frame image; and determining a second position and posture conversion relation based on the characteristic points of the target object, the projection points in the reference frame image and the first position and posture conversion relation. The characteristic points of the reference object and the characteristic points of the target object are stable and reliable, and a pose transformation matrix can be accurately calculated; based on the calculated second pose conversion relation and the projection point of the target object in any frame of image, automatically determining and marking the pose of the feature point of the target object without manual marking; when the target object is positioned and analyzed based on the pose of the target object, for example, the robot is used for grabbing the target object, so that grabbing efficiency and precision can be improved.

Description

一种位姿标注方法、装置、系统及存储介质A pose labeling method, device, system and storage medium

技术领域technical field

本发明实施例涉及机器人智能检测技术,尤其涉及一种位姿标注方法、装置、系统及存储介质。The embodiments of the present invention relate to a robot intelligent detection technology, and in particular, to a pose labeling method, device, system and storage medium.

背景技术Background technique

目标物体的姿态常用于机器人智能检测领域的一项重要技术。目前,往往采用人工标注方法标注目标物体的位姿数据。在机器人作业过程中,需要采集目标物体的大量的坐标数据。例如,利用机器人识别目标物体和抓取目标物体等视觉伺服业务流程,采集目标物体的大量的坐标数据。基于海量的坐标数据通过人工方式标注目标物体的位姿,耗费大量的人力成本和时间成本,且位姿数据的标注精度较差。The pose of the target object is often used as an important technology in the field of robot intelligent detection. At present, manual labeling methods are often used to label the pose data of target objects. In the process of robot operation, a large amount of coordinate data of the target object needs to be collected. For example, a large amount of coordinate data of the target object is collected by using visual servoing business processes such as the robot to identify the target object and grasp the target object. Manually labeling the pose of the target object based on massive coordinate data consumes a lot of labor and time costs, and the labeling accuracy of the pose data is poor.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供了一种位姿标注方法、装置、系统及存储介质,以实现提高位姿的标注效率和精度的效果。The embodiments of the present invention provide a pose labeling method, device, system and storage medium, so as to achieve the effect of improving the labeling efficiency and accuracy of poses.

第一方面,本发明实施例提供了一种位姿标注方法,该方法包括:In a first aspect, an embodiment of the present invention provides a pose labeling method, which includes:

接收拍摄装置在不同角度下采集的序列帧图像,并确定所述序列帧图像中的参考帧图像和当前帧图像,其中,所述序列帧图像的每帧图像中包括参考物体和目标物体;Receive sequence frame images collected by a photographing device at different angles, and determine a reference frame image and a current frame image in the sequence frame images, wherein each frame image of the sequence frame images includes a reference object and a target object;

基于所述参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系;Based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image, determine the difference between the current frame image coordinate system and the reference frame image coordinate system The first pose conversion relationship between;

基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及所述第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系;Based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first attitude transformation relationship, determine the second coordinate system between the target object coordinate system where the target object is located and the current frame image coordinate system Pose transformation relationship;

基于所述第二位姿转换关系和拍摄装置拍摄的任一帧图像中目标物体的投影点,对目标物体进行位姿标注。Based on the second pose conversion relationship and the projection point of the target object in any frame image captured by the photographing device, the pose labeling is performed on the target object.

第二方面,本发明实施例还提供了一种位姿标注装置,该装置包括:In a second aspect, an embodiment of the present invention further provides a pose labeling device, the device comprising:

图像确定模块,用于接收拍摄装置在不同角度下采集的序列帧图像,并确定所述序列帧图像中的参考帧图像和当前帧图像,其中,所述序列帧图像的每帧图像中包括参考物体和目标物体;An image determination module, configured to receive sequence frame images collected by a photographing device at different angles, and determine a reference frame image and a current frame image in the sequence frame images, wherein each frame image of the sequence frame images includes a reference frame image objects and target objects;

第一位姿转换关系确定模块,用于基于所述参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系;The first attitude conversion relationship determination module is used to determine the current frame image based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image. The first pose conversion relationship between the frame image coordinate system and the reference frame image coordinate system;

第二位姿转换关系确定模块,用于基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及所述第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系;The second pose transformation relationship determination module is used to determine the target object coordinate system where the target object is located based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first pose transformation relationship and the second pose transformation relationship between the current frame image coordinate system;

位姿标注模块,用于基于所述第二位姿转换关系和拍摄装置拍摄的任一帧图像中目标物体的投影点,对目标物体进行位姿标注。The pose labeling module is configured to label the target object on the basis of the second pose conversion relationship and the projection point of the target object in any frame of images captured by the photographing device.

第三方面,本发明实施例还提供了一种位姿标注系统,包括机器人、目标物体和参考物体,其中,机器人包括机械臂、拍摄装置、存储器和处理器;所述机械臂带动所述拍摄装置运动,以使拍摄装置在多个角度下采集序列帧图像;其中,所述序列帧图像的每帧图像中包括参考物体和目标物体,所述目标物体包括多个特征点,所述参考物体上包括多个特征点;In a third aspect, an embodiment of the present invention further provides a pose labeling system, including a robot, a target object, and a reference object, wherein the robot includes a robotic arm, a photographing device, a memory, and a processor; the robotic arm drives the photographing The device moves, so that the photographing device captures a sequence of frame images at multiple angles; wherein, each frame of the sequence of frame images includes a reference object and a target object, the target object includes a plurality of feature points, and the reference object including multiple feature points;

其中,存储器中存在并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现第一方面中任一项所述的位姿标注方法。Wherein, a computer program exists in the memory and can be run on a processor, and the processor implements the pose labeling method according to any one of the first aspects when the processor executes the computer program.

第四方面,本发明实施例还提供了一种包含计算机可执行指令的存储介质,其中,所述计算机可执行指令在由计算机处理器执行时实现如第一方面任一项所述的位姿标注方法。In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, implement the pose according to any one of the first aspect labeling method.

本发明实施例的技术方案,接收拍摄装置在不同角度下采集的序列帧图像,序列帧图像的每帧图像中包括参考物体的和目标物体,使参考物体辅助拍摄装置进行拍摄;确定序列帧图像中的参考帧图像和当前帧图像,基于参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系;基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系。由于参考物体的特征点和目标物体的特征点稳定可靠,能准确的计算第一位姿转换矩阵和第二位姿转换矩阵;在获取到拍摄装置拍摄的任一帧图像时,基于计算得到的第二位姿转换关系和任一帧图像中目标物体的投影点,自动确定目标物体的特征点的位姿,并自动标注目标物体的特征点的位姿,无需人工标注,降低人力成本,且提高位姿计算的可靠性;进一步地,基于目标物体的位姿对目标物体进行定位分析时,可以提高定位精度,尤其是应用在机器人抓取目标物体领域,可以大大提高目标物体的抓取效率和抓取精度。The technical solution of the embodiment of the present invention is to receive the sequence frame images collected by the photographing device at different angles, each frame image of the sequence frame image includes the reference object and the target object, so that the reference object assists the photographing device in photographing; determine the sequence frame image Based on the reference frame image and the current frame image in the reference frame, the coordinates of the current frame image are determined based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image The first pose transformation relationship between the frame and the reference frame image coordinate system; based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first pose transformation relationship, determine the location of the target object. The second pose transformation relationship between the target object coordinate system and the current frame image coordinate system. Since the feature points of the reference object and the feature points of the target object are stable and reliable, the first pose transformation matrix and the second pose transformation matrix can be calculated accurately; The second pose transformation relationship and the projection point of the target object in any frame of images automatically determine the pose of the feature points of the target object, and automatically mark the pose of the feature points of the target object, without manual annotation, reducing labor costs, and Improve the reliability of pose calculation; further, when positioning and analyzing the target object based on the pose of the target object, the positioning accuracy can be improved, especially in the field of robot grasping the target object, which can greatly improve the grasping efficiency of the target object and grasping accuracy.

附图说明Description of drawings

图1为本发明实施例一提供的一种位姿标注方法的流程示意图;1 is a schematic flowchart of a pose labeling method according to Embodiment 1 of the present invention;

图2为本发明实施例二提供的一种位姿标注方法的流程示意图;2 is a schematic flowchart of a pose labeling method according to Embodiment 2 of the present invention;

图3为本发明实施例二提供的各坐标系之间的位姿转换关系的示意图;3 is a schematic diagram of a pose conversion relationship between coordinate systems according to Embodiment 2 of the present invention;

图4为本发明实施例二提供的位姿标注的逻辑示意图;FIG. 4 is a schematic logical diagram of pose labeling according to Embodiment 2 of the present invention;

图5为本发明实施例三提供的一种位姿标注装置的结构示意图;5 is a schematic structural diagram of a pose labeling device according to Embodiment 3 of the present invention;

图6为本发明实施例四提供的一种位姿标注系统的结构示意图。FIG. 6 is a schematic structural diagram of a pose labeling system according to Embodiment 4 of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all structures related to the present invention.

实施例一Example 1

图1为本发明实施例一提供的一种位姿标注方法的流程示意图,本实施例可适用于在自动标注位姿的情况,该方法可以由位姿标注装置来执行,其中该系统可由软件和/或硬件实现,并一般集成在机器人或者具有位姿标注功能的电子设备中,本实施例以机器人为例进行解释。具体参见图1所示,该方法可以包括如下步骤:FIG. 1 is a schematic flowchart of a pose labeling method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of automatically labeling poses, and the method can be performed by a pose labeling device, wherein the system can be performed by software And/or hardware implementation, and is generally integrated in a robot or an electronic device with a pose labeling function, this embodiment is explained by taking a robot as an example. Specifically, as shown in FIG. 1, the method may include the following steps:

S110、接收拍摄装置在不同角度下采集的序列帧图像,并确定序列帧图像中的参考帧图像和当前帧图像。S110. Receive the sequence frame images collected by the photographing device at different angles, and determine the reference frame image and the current frame image in the sequence frame images.

其中,拍摄装置安装在机器人机械臂上,用于采集机器人作业过程中的序列帧图像。拍摄装置可以是相机、摄像头或者激光器,还可以是其他具有图像采集功能的设备。需要说明的是,利用拍摄装置采集序列帧图像时,机械臂按照预先规划的路径带动拍摄装置移动至不同的拍摄点,以使拍摄装置在不同的角度下采集序列帧图像。Among them, the photographing device is installed on the robotic arm of the robot, and is used to collect the sequence frame images during the operation of the robot. The photographing device may be a camera, a camera or a laser, and may also be other devices with an image capturing function. It should be noted that when the camera is used to capture the sequence frame images, the robotic arm drives the camera to move to different shooting points according to a pre-planned path, so that the camera device captures the sequence frame images at different angles.

在一个可能的实施例中,预先规划的路径可以根据机器人的作业路径、机械臂的长度、拍摄装置的安装位置和/或机器人在相邻作业点之间移动的距离确定。在另一个可能的实施例中,该路径可以根据待标注的目标物体中多个特征点的坐标数据和/或参考物体中多个特征点的坐标数据确定。需要说明的是,机械臂的路径的规划方式不限于上述两种方式,还可以基于其他方式生成。In a possible embodiment, the pre-planned path may be determined according to the working path of the robot, the length of the robotic arm, the installation position of the photographing device and/or the distance the robot moves between adjacent working points. In another possible embodiment, the path may be determined according to coordinate data of multiple feature points in the target object to be marked and/or coordinate data of multiple feature points in the reference object. It should be noted that the planning method of the path of the robotic arm is not limited to the above two methods, and can also be generated based on other methods.

其中,序列帧图像可以理解为若干张图像按照时间组成的帧序列。序列帧图像的每帧图像中包括参考物体和目标物体。目标物体可以理解为待抓取或待识别的物体,可以是规则物体也可以是不规则物体。例如,在建筑领域,利用机器人铺贴墙砖或墙纸时,目标物体可以是待抓取的墙砖或者墙纸;在物流运输领域,利用机器人将快递分类,目标物体可以是待识别的快递。目标物体上可以包括一个或多个稳定特征点。Among them, the sequence frame image can be understood as a frame sequence composed of several images according to time. Each frame image of the sequence frame image includes a reference object and a target object. The target object can be understood as the object to be grasped or identified, which can be a regular object or an irregular object. For example, in the field of construction, when a robot is used to lay wall tiles or wallpaper, the target object can be the wall tile or wallpaper to be grabbed; in the field of logistics and transportation, robots are used to classify express delivery, and the target object can be the express delivery to be identified. The target object may include one or more stable feature points.

需要说明的是,参考物体一般位于世界坐标系下且稳定不动,参考物体上包括一个或多个稳定特征点,用于辅助拍摄装置在不同角度下采集序列帧图像,以使采集的每帧图像中均包括参考物体和目标物体。可选地,参考物体为二维码或条形码。It should be noted that the reference object is generally located in the world coordinate system and is stable. The reference object includes one or more stable feature points, which are used to assist the shooting device to collect sequence frame images at different angles, so that each Both reference and target objects are included in the images. Optionally, the reference object is a two-dimensional code or a barcode.

需要说明的是,在采集序列帧图像之前,分别确定参考物体和目标物体的至少一个特征点,以使采集的序列帧图像的每帧图像中包括参考物体的投影点和目标物体的投影点。在一个可选的实施例中,参考物体的特征点可以根据机械臂预先规划的路径确定。在另一个可选的实施例中,参考物体的特征点可以是随机分布的,还可以根据其他规律确定。目标物体的特征点可以包括目标物体的顶点、每条边的中心点、每个面的中心点,还可以包括其他特征点,例如每条边的三分之一点、每个面的非面心点等。It should be noted that, before collecting the sequence frame images, at least one feature point of the reference object and the target object is determined respectively, so that each frame image of the collected sequence frame images includes the projection point of the reference object and the projection point of the target object. In an optional embodiment, the feature points of the reference object may be determined according to a pre-planned path of the robotic arm. In another optional embodiment, the feature points of the reference object may be randomly distributed, and may also be determined according to other laws. The feature points of the target object can include the vertex of the target object, the center point of each edge, the center point of each face, and can also include other feature points, such as the third point of each edge, the non-face of each face Heart point and so on.

其中,参考帧和当前帧可以是序列帧图像中任意选取的两帧图像。通过前述描述可知,当前帧图像和参考帧图像均包括参考物体和目标物体。当前帧图像中包括参考物体的投影点和目标物体的投影点,参考帧图像中包括参考物体的投影点和目标物体的投影点。Wherein, the reference frame and the current frame may be two frames of images arbitrarily selected from the sequence of frame images. It can be known from the foregoing description that both the current frame image and the reference frame image include a reference object and a target object. The current frame image includes the projection point of the reference object and the projection point of the target object, and the reference frame image includes the projection point of the reference object and the projection point of the target object.

S120、基于参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系。S120, determining the difference between the current frame image coordinate system and the reference frame image coordinate system based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image The first pose transformation relationship between them.

在计算第一位姿转换关系之前,确定参考物体所在的坐标系,即世界坐标系,将参考帧图像所在的坐标系定义为参考帧图像坐标系,将当前帧图像所在的坐标系定义为当前帧图像坐标系。Before calculating the first pose transformation relationship, determine the coordinate system where the reference object is located, that is, the world coordinate system, define the coordinate system where the reference frame image is located as the reference frame image coordinate system, and define the coordinate system where the current frame image is located as the current frame image coordinate system. Frame image coordinate system.

可选地,第一位姿转换关系的确定方法,包括:基于所述参考物体的特征点和参考物体的特征点在参考帧图像中的投影点,确定参考物体所在的世界坐标系与参考帧图像坐标系之间的第三位姿转换关系;基于参考物体的特征点和参考物体的特征点在当前帧图像中的投影点,确定世界坐标系与所述当前帧图像坐标系之间的第四位姿转换关系;根据第三位姿转换关系和第四位姿转换关系,确定第一位姿转换关系。Optionally, the method for determining the first pose conversion relationship includes: based on the feature points of the reference object and the projection points of the feature points of the reference object in the reference frame image, determining the world coordinate system where the reference object is located and the reference frame. The third pose transformation relationship between the image coordinate systems; based on the feature points of the reference object and the projection points of the feature points of the reference object in the current frame image, determine the third position between the world coordinate system and the current frame image coordinate system. Four pose transformation relationships; according to the third pose transformation relationship and the fourth pose transformation relationship, determine the first pose transformation relationship.

需要说明的是,参考物体的投影点指的是参考物体的特征点在拍摄装置采集的图像中的投影,也就是说,参考物体的特征点与序列帧图像中每帧图像的投影点对应。It should be noted that the projection point of the reference object refers to the projection of the feature point of the reference object in the image collected by the photographing device, that is, the feature point of the reference object corresponds to the projection point of each frame image in the sequence frame images.

具体地,第三位姿转换关系的确定方法,包括:获取参考物体的特征点在世界坐标系下的位姿和参考物体的投影点在参考帧图像坐标系下的第一坐标数据;根据参考物体的特征点在世界坐标系下的位姿和第一坐标数据,确定世界坐标系和参考帧图像坐标系的第三位姿转换关系。Specifically, the method for determining the third pose conversion relationship includes: acquiring the pose of the feature point of the reference object under the world coordinate system and the first coordinate data of the projection point of the reference object under the reference frame image coordinate system; The pose and first coordinate data of the feature points of the object in the world coordinate system determine the third pose transformation relationship between the world coordinate system and the reference frame image coordinate system.

具体地,第四位姿转换关系的确定方法,包括:获取参考物体的特征点在世界坐标系下的位姿和参考物体的投影点在当前帧图像坐标系下的第二坐标数据;根据参考物体的特征点在世界坐标系下的位姿和第二坐标数据,确定世界坐标系和当前帧图像坐标系的第四位姿转换关系。Specifically, the fourth method for determining a pose conversion relationship includes: obtaining the pose of the feature point of the reference object in the world coordinate system and the second coordinate data of the projection point of the reference object in the current frame image coordinate system; according to the reference The pose and second coordinate data of the feature points of the object in the world coordinate system determine the fourth pose transformation relationship between the world coordinate system and the current frame image coordinate system.

需要说明的是,上述位姿指的是参考物体的特征点在世界坐标系下的六自由度位姿,六自由度位姿可以包括参考物体的特征点沿世界坐标系的x,y,z三个坐标轴方向移动的移动自由度和绕这三个坐标轴转动的转动自由度。第一坐标数据指的是参考物体的投影点在参考帧图像坐标系下的二维坐标,第二坐标数据指的是参考物体的投影点在当前帧图像坐标系下的二维坐标。第三位姿转换关系可以理解为世界坐标系和参考帧图像坐标系之间的转换关系,第四位姿转换关系可以理解为世界坐标系和当前帧图像坐标系之间的转换关系。因此,将世界坐标系作为转换参考物,根据第三位姿转换关系和第四位姿转换关系,确定参考帧图像坐标系和当前帧图像坐标系之间的第一位姿转换关系。It should be noted that the above pose refers to the six-degree-of-freedom pose of the feature point of the reference object in the world coordinate system, and the six-degree-of-freedom pose may include the x, y, z of the feature point of the reference object along the world coordinate system. The movement degrees of freedom for movement in the three coordinate axes and the rotational degrees of freedom for rotation around these three coordinate axes. The first coordinate data refers to the two-dimensional coordinates of the projection point of the reference object in the reference frame image coordinate system, and the second coordinate data refers to the two-dimensional coordinates of the projection point of the reference object in the current frame image coordinate system. The third pose transformation relationship can be understood as the transformation relationship between the world coordinate system and the reference frame image coordinate system, and the fourth pose transformation relationship can be understood as the transformation relationship between the world coordinate system and the current frame image coordinate system. Therefore, the world coordinate system is used as the transformation reference, and the first pose transformation relationship between the reference frame image coordinate system and the current frame image coordinate system is determined according to the third pose transformation relationship and the fourth pose transformation relationship.

S130、基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系。S130. Determine the second coordinate system between the target object coordinate system where the target object is located and the current frame image coordinate system based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first attitude transformation relationship Pose transformation relationship.

在计算第二位姿转换关系之前,将目标物体所在的坐标系定义为目标物体坐标系。可选地,第二位姿转换关系的确定方法,包括:根据目标物体的特征点和目标物体的特征点在参考帧图像中的投影点,确定目标物体坐标系和参考帧图像坐标系之间的第五位姿转换关系;基于第一位姿转换关系和第五位姿转换关系,确定第二位姿转换关系。Before calculating the second pose transformation relationship, the coordinate system where the target object is located is defined as the target object coordinate system. Optionally, the method for determining the second pose conversion relationship includes: determining the distance between the target object coordinate system and the reference frame image coordinate system according to the feature points of the target object and the projection points of the feature points of the target object in the reference frame image. The fifth pose transformation relationship is determined; based on the first pose transformation relationship and the fifth pose transformation relationship, the second pose transformation relationship is determined.

具体地,第五位姿转换关系的确定方法,包括:获取目标物体的特征点在目标物体坐标系下的位姿和目标物体的投影点在参考帧坐标系下的第三坐标数据,基于目标物体的特征点在目标物体坐标系下的位姿和第三坐标数据,计算目标物体坐标系和参考帧坐标系之间的第五位姿转换关系。Specifically, the fifth method for determining a pose conversion relationship includes: acquiring the pose of the feature point of the target object in the target object coordinate system and the third coordinate data of the projection point of the target object in the reference frame coordinate system, based on the target object The pose and third coordinate data of the feature points of the object in the target object coordinate system are used to calculate the fifth pose transformation relationship between the target object coordinate system and the reference frame coordinate system.

需要说明的是,上述位姿指的是目标物体的特征点在目标物体坐标系下的六自由度位姿,六自由度位姿可以包括目标物体的特征点沿目标物体坐标系的x,y,z三个坐标轴方向移动的移动自由度和绕这三个坐标轴转动的转动自由度。第三坐标数据指的是目标物体的投影点在参考帧图像坐标系下的二维坐标。第五位姿转换关系可以理解为参考帧坐标系和目标物体坐标系之间的转换关系,第一位姿转换关系可以理解为参考帧图像坐标系和当前帧图像坐标系之间的转换关系。因此,将参考帧图像坐标系作为转换参考物,根据第一位姿转换关系和第五位姿转换关系,确定目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系。It should be noted that the above pose refers to the six-degree-of-freedom pose of the feature point of the target object in the target object coordinate system, and the six-degree-of-freedom pose may include the x, y of the feature point of the target object along the target object coordinate system. , the movement degrees of freedom of movement in the three coordinate axes of z and the rotational degrees of freedom of rotation around these three coordinate axes. The third coordinate data refers to the two-dimensional coordinates of the projection point of the target object in the reference frame image coordinate system. The fifth pose transformation relationship can be understood as the transformation relationship between the reference frame coordinate system and the target object coordinate system, and the first pose transformation relationship can be understood as the transformation relationship between the reference frame image coordinate system and the current frame image coordinate system. Therefore, the reference frame image coordinate system is used as the transformation reference, and the second pose transformation relationship between the target object coordinate system and the current frame image coordinate system is determined according to the first pose transformation relationship and the fifth pose transformation relationship.

S140、基于第二位姿转换关系和拍摄装置拍摄的任一帧图像中目标物体的投影点,对目标物体进行位姿标注。S140. Perform pose annotation on the target object based on the second pose conversion relationship and the projection point of the target object in any frame of images captured by the photographing device.

其中,拍摄装置拍摄的任一帧图像位于当前帧图像坐标系下。在当前帧图像坐标系下,确定拍摄装置拍摄的图像中目标物体的投影点的坐标数据,根据第二位姿转换矩阵和拍摄的任一帧图像中目标物体的投影点的坐标数据,确定目标物体的投影点对应的目标物体的特征点在目标物体坐标系下的位姿。Wherein, any frame image captured by the photographing device is located in the coordinate system of the current frame image. In the current frame image coordinate system, determine the coordinate data of the projection point of the target object in the image captured by the shooting device, and determine the target according to the second pose transformation matrix and the coordinate data of the projection point of the target object in any frame image captured. The pose of the feature point of the target object corresponding to the projection point of the object in the target object coordinate system.

需要说明的是,拍摄的图像中目标物体的投影点的坐标数据指的是目标物体的投影点在当前帧图像坐标系下的二维坐标,所述位姿指的是目标物体的特征点在目标物体坐标系下的六自由度位姿。因此,根据拍摄的图像中目标物体的投影点的坐标数据以及第二位姿转换矩阵,可以确定目标物体的特征点在目标物体坐标系下的六自由度位姿,并自动标注目标物体的特征点的位姿。It should be noted that the coordinate data of the projection point of the target object in the captured image refers to the two-dimensional coordinates of the projection point of the target object in the current frame image coordinate system, and the pose refers to the feature point of the target object in The 6DOF pose in the target object coordinate system. Therefore, according to the coordinate data of the projection point of the target object in the captured image and the second pose transformation matrix, the six-degree-of-freedom pose of the feature point of the target object in the target object coordinate system can be determined, and the features of the target object can be automatically marked point pose.

本实施例提供的技术方案,接收拍摄装置在不同角度下采集的序列帧图像,序列帧图像的每帧图像中包括参考物体的和目标物体,使参考物体辅助拍摄装置进行拍摄;确定序列帧图像中的参考帧图像和当前帧图像,基于参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系;基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系。由于参考物体的特征点和目标物体的特征点稳定可靠,能准确的计算第一位姿转换矩阵和第二位姿转换矩阵;在获取到拍摄装置拍摄的任一帧图像时,基于计算得到的第二位姿转换关系和任一帧图像中目标物体的投影点,自动确定目标物体的特征点的位姿,并自动标注目标物体的特征点的位姿,无需人工标注,降低人力成本,且提高位姿计算的可靠性;进一步地,基于目标物体的位姿对目标物体进行定位分析时,可以提高定位精度,尤其是应用在机器人抓取目标物体领域,可以大大提高目标物体的抓取效率和抓取精度。In the technical solution provided by this embodiment, the sequence frame images collected by the photographing device from different angles are received, and each frame image of the sequence frame image includes the reference object and the target object, so that the reference object assists the photographing device in photographing; the sequence frame image is determined Based on the reference frame image and the current frame image in the reference frame, the coordinates of the current frame image are determined based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image The first pose transformation relationship between the frame and the reference frame image coordinate system; based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first pose transformation relationship, determine the location of the target object. The second pose transformation relationship between the target object coordinate system and the current frame image coordinate system. Since the feature points of the reference object and the feature points of the target object are stable and reliable, the first pose transformation matrix and the second pose transformation matrix can be calculated accurately; The second pose transformation relationship and the projection point of the target object in any frame of images automatically determine the pose of the feature points of the target object, and automatically mark the pose of the feature points of the target object, without manual annotation, reducing labor costs, and Improve the reliability of pose calculation; further, when positioning and analyzing the target object based on the pose of the target object, the positioning accuracy can be improved, especially in the field of robot grasping the target object, which can greatly improve the grasping efficiency of the target object and grasping accuracy.

实施例二Embodiment 2

图2为本发明实施例二提供的一种位姿标注方法的流程示意图。本实施例的技术方案在上述实施例的基础上进行了细化。具体细化了各位姿转换关系的确定方法以及位姿标注方法。在该方法实施例中未详尽描述的部分请参考上述实施例。具体参见图2所示,该方法可以包括如下步骤:FIG. 2 is a schematic flowchart of a pose labeling method according to Embodiment 2 of the present invention. The technical solution of this embodiment is refined on the basis of the foregoing embodiment. The method of determining the transformation relationship of each pose and the method of labeling the pose are detailed. For the part not described in detail in the method embodiment, please refer to the above-mentioned embodiment. Referring specifically to Figure 2, the method may include the following steps:

S210、接收拍摄装置在不同角度下采集的序列帧图像,并确定序列帧图像中的参考帧图像和当前帧图像。S210: Receive the sequence frame images collected by the photographing device at different angles, and determine the reference frame image and the current frame image in the sequence frame images.

S220、基于参考物体的特征点和参考物体的征点在参考帧图像中的投影点,确定参考物体所在的世界坐标系与参考帧图像坐标系之间的第三位姿转换关系。S220 , based on the feature points of the reference object and the projection points of the feature points of the reference object in the reference frame image, determine a third pose transformation relationship between the world coordinate system where the reference object is located and the reference frame image coordinate system.

可选地,第三位姿转换关系的确定方法,包括:获取拍摄装置预先标定得到的内参矩阵;根据内参矩阵、参考物体的三维特征点、参考物体的特征点在参考帧图像中的二维投影点以及世界坐标系和参考帧图像坐标系之间的当前位姿转换关系,计算第一关系方程;对第一关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为第三位姿转换关系。Optionally, the third method for determining the pose conversion relationship includes: acquiring an internal parameter matrix obtained by pre-calibration of the photographing device; The projection point and the current pose transformation relationship between the world coordinate system and the reference frame image coordinate system, calculate the first relationship equation; iteratively solve the first relationship equation, if the current pose transformation relationship under the current iteration number converges, the The current pose transformation relationship under the current iteration number is used as the third pose transformation relationship.

需要说明的是,内参矩阵可以根据拍摄装置的说明书中的参数确定的,也可以根据位姿标注的精度确定,还可以通过其他方式确定。具体地,在参考帧图像上提取N个参考物体的二维投影点,第i个二维投影点记为

Figure BDA0002954195350000101
第i个二维投影点对应的世界坐标系下的参考物体的三维特征点记为
Figure BDA0002954195350000102
世界坐标系和参考帧图像坐标系之间的当前位姿转换关系记为T_w2r,则第一关系方程的表达式为:It should be noted that the internal parameter matrix may be determined according to the parameters in the description of the photographing device, may also be determined according to the accuracy of the pose annotation, or may be determined in other ways. Specifically, the two-dimensional projection points of N reference objects are extracted on the reference frame image, and the i-th two-dimensional projection point is denoted as
Figure BDA0002954195350000101
The three-dimensional feature point of the reference object in the world coordinate system corresponding to the i-th two-dimensional projection point is recorded as
Figure BDA0002954195350000102
The current pose transformation relationship between the world coordinate system and the reference frame image coordinate system is recorded as T_w2r, then the expression of the first relationship equation is:

Figure BDA0002954195350000103
Figure BDA0002954195350000103

进一步地,采用非线性优化方法求解公式1,在RANSAC(RANdom SampleConsensus,随机采样一致)框架下求解T_w2r的初始值为T0,并采用LM(Levenberg-Marquardt,基于列文伯格-马夸尔特)算法对第一关系方程进行迭代求解,即对T_w2r进行优化,如果当前迭代次数下的当前位姿转换关系达到稳定状态,将当前迭代次数下的当前位姿转换关系作为第三位姿转换关系。Further, the nonlinear optimization method is used to solve Equation 1, and the initial value of T_w2r is solved under the framework of RANSAC (RANdom Sample Consensus) T 0 , and LM (Levenberg-Marquardt, based on Levenberg-Marquardt) is adopted. Special) algorithm iteratively solves the first relationship equation, that is, optimizes T_w2r, if the current pose transformation relationship under the current iteration number reaches a stable state, the current pose transformation relationship under the current iteration number is used as the third pose transformation relation.

可选地,采用LM算法优化T_w2r的计算公式为:Optionally, the calculation formula for optimizing T_w2r using the LM algorithm is:

Figure BDA0002954195350000111
Figure BDA0002954195350000111

其中,xk是第k次迭代次数下的当前位姿转换关系T_w2r,如果k=0,

Figure BDA0002954195350000112
即Δxk是第k次和第k-1次代次数下的当前位姿转换关系T_w2r的变化量,或者说Δxk是优化变量;m是信赖区间的半径。Among them, x k is the current pose transformation relationship T_w2r under the kth iteration number, if k=0,
Figure BDA0002954195350000112
That is, Δx k is the change amount of the current pose conversion relationship T_w2r under the kth and k-1th generation times, or Δx k is the optimization variable; m is the radius of the confidence interval.

其中,

Figure BDA0002954195350000113
ρ是评价指标。若ρ>0.75,m=2m,若ρ<0.25,m=0.5m。并且,如果ρ大于第一阈值,认为可基于公式2求解Δxk,令xk=xk-Δxk-1,根据公式2求解Δxk,即根据公式2求解第k次和第k-1次迭代次数下的当前位姿转换关系T_w2r的变化量,如果变化量大于或等于第二阈值,确定当前迭代次数下的当前位姿转换关系未收敛,令xk=xk+1-Δxk,重新计算ρ,并基于公式2求解第k+1次和第k次代次数下的当前位姿转换关系T_w2r的变化量,基于新确定的变化量确定当前迭代次数(第k+1次)下的当前位姿转换关系是否收敛,如果未收敛,继续迭代计算,直至当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系。in,
Figure BDA0002954195350000113
ρ is the evaluation index. If ρ>0.75, m=2m, if ρ<0.25, m=0.5m. And, if ρ is greater than the first threshold, it is considered that Δx k can be solved based on formula 2, let x k =x k -Δx k-1 , and Δx k is solved according to formula 2, that is, the kth and k-1th times are solved according to formula 2 The change amount of the current pose transformation relationship T_w2r under the number of iterations, if the change amount is greater than or equal to the second threshold, it is determined that the current pose transformation relationship under the current number of iterations has not converged, let x k =x k+1 -Δx k , recalculate ρ, and solve the variation of the current pose conversion relationship T_w2r under the k+1th and kth generation times based on formula 2, and determine the current iteration number (k+1th) based on the newly determined variation. Whether the current pose transformation relationship of , is converged, if not, continue iterative calculation until the current pose transformation relationship under the current iteration number converges, and convert the current pose transformation relationship under the current iteration number.

S230、基于参考物体的特征点和参考物体的特征点在当前帧图像中的投影点,确定世界坐标系与当前帧图像坐标系之间的第四位姿转换关系。S230 , determining a fourth pose transformation relationship between the world coordinate system and the current frame image coordinate system based on the feature points of the reference object and the projection points of the feature points of the reference object in the current frame image.

可选地,第四位姿转换关系的确定方法,包括:获取拍摄装置预先标定得到的内参矩阵;根据所述内参矩阵、所述参考物体的三维特征点、所述参考物体的特征点在当前帧图像中的二维投影点以及世界坐标系与当前帧图像坐标系之间的当前位姿转换关系,计算第二关系方程;对所述第二关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第四位姿转换关系。Optionally, the fourth method for determining the pose conversion relationship includes: acquiring an internal parameter matrix pre-calibrated by a photographing device; The two-dimensional projection point in the frame image and the current pose transformation relationship between the world coordinate system and the current frame image coordinate system, calculate the second relationship equation; iteratively solve the second relationship equation, if the current number of iterations is The current pose transformation relationship converges, and the current pose transformation relationship under the current iteration number is used as the fourth pose transformation relationship.

与前述步骤相同的,内参矩阵可以根据拍摄装置的说明书中的参数确定的,也可以根据位姿标注的精度确定,还可以通过其他方式确定。具体地,在当前帧图像上提取N个参考物体的二维投影点,第i个二维投影点记为

Figure BDA0002954195350000121
第i个二维投影点对应的世界坐标系下的参考物体的三维特征点记为
Figure BDA0002954195350000122
世界坐标系和当前帧图像坐标系之间的当前位姿转换关系记为T_w2c,则第二关系方程的表达式为:Similar to the foregoing steps, the internal parameter matrix may be determined according to the parameters in the description of the photographing device, or may be determined according to the accuracy of the pose annotation, or may be determined in other ways. Specifically, the two-dimensional projection points of N reference objects are extracted on the current frame image, and the i-th two-dimensional projection point is denoted as
Figure BDA0002954195350000121
The three-dimensional feature point of the reference object in the world coordinate system corresponding to the i-th two-dimensional projection point is recorded as
Figure BDA0002954195350000122
The current pose transformation relationship between the world coordinate system and the current frame image coordinate system is recorded as T_w2c, then the expression of the second relationship equation is:

Figure BDA0002954195350000123
Figure BDA0002954195350000123

与前述步骤类似的,采用非线性优化方法求解公式3,在RANSAC(RANdomSampleConsensus,随机采样一致)框架下求解T_w2c的初始值为T0,并采用LM(Levenberg-Marquardt,基于列文伯格-马夸尔特)算法对第二关系方程进行迭代求解,即对T_w2c进行优化,如果当前迭代次数下的当前位姿转换关系达到稳定状态,将当前迭代次数下的当前位姿转换关系作为第四位姿转换关系。需要说明的是,LM算法优化T_w2c的计算公式与公式2一致,本步骤中LM算法中的xk是第k次迭代次数下的当前位姿转换关系T_w2c,利用公式2对所述第二关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第四位姿转换关系。Similar to the previous steps, the nonlinear optimization method is used to solve Equation 3. The initial value of T_w2c is solved under the RANSAC (RANdomSampleConsensus, random sampling consistent) framework, and the initial value of T_w2c is T 0 . Quarte) algorithm iteratively solves the second relationship equation, that is, optimizes T_w2c. If the current pose transformation relationship under the current iteration number reaches a stable state, the current pose transformation relationship under the current iteration number is regarded as the fourth position. Pose transformation relationship. It should be noted that the calculation formula of the LM algorithm optimization T_w2c is consistent with the formula 2. In this step, x k in the LM algorithm is the current pose transformation relationship T_w2c under the kth iteration number, and the second relationship is calculated by using the formula 2. The equation is iteratively solved, and if the current pose transformation relationship under the current iteration number converges, the current pose transformation relationship under the current iteration number is used as the fourth pose transformation relationship.

S240、根据第三位姿转换关系和第四位姿转换关系,确定第一位姿转换关系。S240. Determine the first pose transformation relationship according to the third pose transformation relationship and the fourth pose transformation relationship.

可选地,将第三位姿转换关系和第四位姿转换关系进行矢量相乘,得到第一位姿转换关系。Optionally, the third pose transformation relationship and the fourth pose transformation relationship are vector-multiplied to obtain the first pose transformation relationship.

如图3所示为各坐标系之间的位姿转换关系的示意图,图3中的参考物体为二维码,二维码所在的坐标系为世界坐标系。世界坐标系和参考帧图像坐标系之间的第三位姿转换关系为T_w2r,世界坐标系和当前帧图像坐标系之间的第四位姿转换关系为T_w2c,当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系T_c2r=T_w2r*T_w2c-1Figure 3 is a schematic diagram of the pose transformation relationship between the coordinate systems. The reference object in Figure 3 is a two-dimensional code, and the coordinate system where the two-dimensional code is located is the world coordinate system. The third pose transformation relationship between the world coordinate system and the reference frame image coordinate system is T_w2r, and the fourth pose transformation relationship between the world coordinate system and the current frame image coordinate system is T_w2c, the current frame image coordinate system and the reference frame. The first pose transformation relationship between the image coordinate systems T_c2r=T_w2r*T_w2c -1 .

S250、根据目标物体的特征点和目标物体的特征点在参考帧图像中的投影点,确定目标物体坐标系和参考帧图像坐标系之间的第五位姿转换关系。S250. Determine a fifth pose transformation relationship between the coordinate system of the target object and the coordinate system of the reference frame image according to the feature points of the target object and the projection points of the feature points of the target object in the reference frame image.

可选地,第五位姿转换关系的确定方法,包括:获取拍摄装置预先标定得到的内参矩阵;根据所述内参矩阵、所述目标物体的三维特征点、目标物体的特征点在所述参考帧图像中的二维投影点,计算第三关系方程;对所述第三关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第五位姿转换关系。Optionally, the fifth method for determining a pose conversion relationship includes: acquiring an internal parameter matrix pre-calibrated by a photographing device; The two-dimensional projection point in the frame image is used to calculate the third relationship equation; the third relationship equation is iteratively solved. If the current pose transformation relationship under the current number of iterations converges, the current pose transformation relationship under the current number of iterations is calculated. as the fifth pose conversion relationship.

具体地,在参考帧图像上提取M个目标物体的二维投影点,第j个二维投影点记为

Figure BDA0002954195350000131
第j个二维投影点对应的目标物体坐标系下的目标物体的三维特征点记为
Figure BDA0002954195350000132
世界坐标系和参考帧图像坐标系之间的当前位姿转换关系记为T_o2r,则第三关系方程的表达式为:Specifically, the two-dimensional projection points of M target objects are extracted on the reference frame image, and the j-th two-dimensional projection point is denoted as
Figure BDA0002954195350000131
The three-dimensional feature point of the target object in the target object coordinate system corresponding to the jth two-dimensional projection point is recorded as
Figure BDA0002954195350000132
The current pose transformation relationship between the world coordinate system and the reference frame image coordinate system is recorded as T_o2r, then the expression of the third relationship equation is:

Figure BDA0002954195350000133
Figure BDA0002954195350000133

与前述步骤类似的,采用非线性优化方法求解公式4,在RANSAC(RANdomSampleConsensus,随机采样一致)框架下求解T_o2r的初始值为T0,并采用LM(Levenberg-Marquardt,基于列文伯格-马夸尔特)算法对第三关系方程进行迭代求解,即对T_o2r进行优化,如果当前迭代次数下的当前位姿转换关系达到稳定状态,将当前迭代次数下的当前位姿转换关系作为第五位姿转换关系。需要说明的是,LM算法优化T_o2r的计算公式与公式2一致,本步骤中LM算法中的xk是第k次迭代次数下的当前位姿转换关系T_o2r,利用公式2对所述第三关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第五位姿转换关系。Similar to the previous steps, the nonlinear optimization method is used to solve Equation 4, and the initial value of T_o2r is solved under the framework of RANSAC (RANdomSampleConsensus) T 0 , and LM (Levenberg-Marquardt, based on Levenberg-Marquardt) is used. (Quart) algorithm iteratively solves the third relationship equation, that is, optimizes T_o2r. If the current pose transformation relationship under the current iteration number reaches a stable state, the current pose transformation relationship under the current iteration number is regarded as the fifth position. Pose transformation relationship. It should be noted that the calculation formula of T_o2r optimized by the LM algorithm is consistent with formula 2. In this step, x k in the LM algorithm is the current pose transformation relationship T_o2r under the kth iteration number, and formula 2 is used for the third relationship. The equation is iteratively solved, and if the current pose transformation relationship under the current iteration number converges, the current pose transformation relationship under the current iteration number is used as the fifth pose transformation relationship.

S260、基于第一位姿转换关系和第五位姿转换关系,确定第二位姿转换关系。S260. Determine the second pose transformation relationship based on the first pose transformation relationship and the fifth pose transformation relationship.

可选地,所述基于所述第一位姿转换关系和所述第五位姿转换关系,确定所述第二位姿转换关系,包括:将所述第一位姿转换关系以及所述第五位姿转换关系进行矢量相乘,得到目标物体坐标系下和当前帧图像坐标系之间的当前位姿转换关系;根据相机预先标定得到的内参矩阵、所述目标物体的三维特征点、目标物体的特征点在当前帧图像中的二维投影点、所述目标物体坐标系和当前帧图像坐标系之间的当前位姿转换关系,计算第四关系方程;对所述第四关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第二位姿转换关系。Optionally, the determining the second pose conversion relationship based on the first pose conversion relationship and the fifth pose conversion relationship includes: combining the first pose conversion relationship and the first pose conversion relationship. The five pose transformation relationships are multiplied by vectors to obtain the current pose transformation relationship between the target object coordinate system and the current frame image coordinate system; according to the internal parameter matrix pre-calibrated by the camera, the three-dimensional feature points of the target object, the target object The two-dimensional projection point of the feature point of the object in the current frame image, the current pose transformation relationship between the coordinate system of the target object and the coordinate system of the current frame image, calculate the fourth relation equation; Iteratively solves, if the current pose transformation relationship under the current iteration number converges, the current pose transformation relationship under the current iteration number is used as the second pose transformation relationship.

结合图3,目标物体坐标系和参考帧图像坐标系之间的第五位姿转换关系为T_o2r,参考帧图像坐标系和当前帧图像坐标系之间的第一位姿转换关系为T_c2r,则当前帧图像坐标系与目标物体坐标系之间的第二位姿转换关系T_o2c=T_o2r*T_c2r-1With reference to Figure 3, the fifth pose transformation relationship between the target object coordinate system and the reference frame image coordinate system is T_o2r, and the first pose transformation relationship between the reference frame image coordinate system and the current frame image coordinate system is T_c2r, then The second pose transformation relationship between the current frame image coordinate system and the target object coordinate system T_o2c=T_o2r*T_c2r -1 .

具体地,在当前帧图像上提取M个目标物体的二维投影点,第j个二维投影点记为

Figure BDA0002954195350000151
第j个二维投影点对应的目标物体坐标系下的目标物体的三维特征点记为
Figure BDA0002954195350000152
世界坐标系和当前帧图像坐标系之间的当前位姿转换关系记为T_o2c,则第四关系方程的表达式为:Specifically, the two-dimensional projection points of M target objects are extracted on the current frame image, and the j-th two-dimensional projection point is denoted as
Figure BDA0002954195350000151
The three-dimensional feature point of the target object in the target object coordinate system corresponding to the jth two-dimensional projection point is recorded as
Figure BDA0002954195350000152
The current pose conversion relationship between the world coordinate system and the current frame image coordinate system is recorded as T_o2c, then the expression of the fourth relationship equation is:

Figure BDA0002954195350000153
Figure BDA0002954195350000153

第四关系方程的表达式也可以为如下形式:The expression of the fourth relational equation can also be in the following form:

Figure BDA0002954195350000154
Figure BDA0002954195350000154

与前述步骤类似的,采用非线性优化方法求解公式5或公式6,在RANSAC(RANdomSample Consensus,随机采样一致)框架下求解T_o2c的初始值为T0,并采用LM(Levenberg-Marquardt,基于列文伯格-马夸尔特)算法对第三关系方程进行迭代求解,即对T_o2c进行优化,如果当前迭代次数下的当前位姿转换关系达到稳定状态,将当前迭代次数下的当前位姿转换关系作为第五位姿转换关系。需要说明的是,LM算法优化T_o2c的计算公式与公式2一致,本步骤中LM算法中的xk是第k次迭代次数下的当前位姿转换关系T_o2c,利用公式2对所述第四关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第二位姿转换关系。Similar to the previous steps, the nonlinear optimization method is used to solve Equation 5 or Equation 6, and the initial value of T_o2c is T 0 under the framework of RANSAC (RANdomSample Consensus), and LM (Levenberg-Marquardt, based on Levin Berg-Marquardt) algorithm iteratively solves the third relationship equation, that is, optimizes T_o2c. If the current pose transformation relationship under the current iteration number reaches a stable state, the current pose transformation relationship under the current iteration number as the fifth pose transformation relationship. It should be noted that the calculation formula for optimizing T_o2c of the LM algorithm is consistent with the formula 2. In this step, x k in the LM algorithm is the current pose transformation relationship T_o2c under the kth iteration number, and formula 2 is used to determine the fourth relationship. The equation is iteratively solved, and if the current pose transformation relationship under the current iteration number is converged, the current pose transformation relationship under the current iteration number is used as the second pose transformation relationship.

S270、基于第二位姿转换关系和拍摄装置拍摄的任一帧图像中目标物体的投影点,对目标物体进行位姿标注。可选地,基于第二位姿转换关系和拍摄装置拍摄的任一帧图像中目标物体的投影点,对目标物体进行位姿标注,包括:根据拍摄装置拍摄的任一帧图像中目标物体的投影点、所述第二位姿转换关系以及拍摄装置预先标定得到的内参矩阵,得到所述拍摄装置拍摄的图像中目标物体的特征点的位姿,并对目标物体的特征点进行位姿标注。S270. Perform pose annotation on the target object based on the second pose conversion relationship and the projection point of the target object in any frame of images captured by the photographing device. Optionally, based on the second pose conversion relationship and the projection point of the target object in any frame of images shot by the photographing device, performing pose labeling on the target object, including: according to any frame of images photographed by the photographing device. The projection point, the second pose conversion relationship, and the internal parameter matrix obtained by the pre-calibration of the photographing device, obtain the pose of the feature points of the target object in the image captured by the shooting device, and perform pose labeling on the feature points of the target object .

具体地,拍摄装置拍摄的任一帧图像位于当前帧图像坐标系下。在当前帧图像坐标系下,拍摄的图像中目标物体的投影点,根据拍摄的任一帧图像中目标物体的投影点、第二位姿转换关系以及拍摄装置预先标定得到的内参矩阵相乘,得到拍摄装置拍摄的图像中目标物体的特征点的位姿,即得到目标物体的特征点在目标物体坐标系下的六自由度位姿,并对目标物体进行位姿标注。Specifically, any frame of image photographed by the photographing device is located in the coordinate system of the current frame image. In the current frame image coordinate system, the projection point of the target object in the captured image is multiplied according to the projection point of the target object in any frame image captured, the second pose conversion relationship and the internal parameter matrix pre-calibrated by the capturing device, The pose of the feature points of the target object in the image captured by the photographing device is obtained, that is, the six-degree-of-freedom pose of the feature points of the target object in the target object coordinate system is obtained, and the pose labeling of the target object is performed.

如图4所示为位姿标注的逻辑示意图。结合图4整体的解释上述过程。预先确定机械臂的路径并获取拍摄装置的内参矩阵,机械臂带动拍摄装置按照预先规划的路径采集序列帧图像,从采集的序列帧图像中选择参考帧图像和当前帧;当前帧图像和序列帧图像中包括目标物体和参考物体,根据当前帧图像和序列帧图像中的目标物体的投影点以及参考物体的投影点,以及目标物体的特征点和参考物体的特征点,利用RANSAC框架和LM算法计算目标物体坐标系和当前帧图像坐标系之间的位姿转换;当拍摄装置拍摄到新的图像时,根据新拍摄的图像中的投影点、内参矩阵和位姿关系,确定目标物体的六自由度位姿,直至拍摄装置采集完所有的图像并完成位姿标注。Figure 4 shows the logical schematic diagram of pose annotation. The above process is explained as a whole with reference to FIG. 4 . The path of the robotic arm is determined in advance and the internal parameter matrix of the shooting device is obtained. The robotic arm drives the shooting device to collect the sequence frame images according to the pre-planned path, and selects the reference frame image and the current frame from the collected sequence frame images; the current frame image and the sequence frame image The image includes the target object and the reference object. According to the projection point of the target object and the projection point of the reference object in the current frame image and the sequence frame image, as well as the feature point of the target object and the feature point of the reference object, the RANSAC framework and the LM algorithm are used. Calculate the pose transformation between the target object coordinate system and the current frame image coordinate system; when the camera captures a new image, determine the six Degree of freedom pose, until the camera has collected all the images and completed the pose annotation.

本实施例提供的技术方案,通过根据内参矩阵、参考物体的特征点、目标物体的特征点以及序列帧图像中的投影点,准确的计算目标物体坐标系与当前帧图像坐标系之间的位姿转换关系;进一步基于拍摄装置拍摄到任一帧图像中目标物体的投影点、根据拍摄装置的内参矩阵、位姿转换,精准计算并标注目标物体的特征点的六自由度位姿,无需人工标注,降低人力成本;进一步地,基于目标物体的位姿对目标物体进行定位分析时,可以提高定位精度,尤其是应用在机器人抓取目标物体领域,可以大大提高目标物体的抓取效率和抓取精度。The technical solution provided in this embodiment accurately calculates the position between the coordinate system of the target object and the coordinate system of the current frame image according to the internal reference matrix, the feature points of the reference object, the feature points of the target object, and the projection points in the sequence frame image. Attitude conversion relationship; further based on the projection point of the target object in any frame image captured by the camera, according to the internal parameter matrix of the camera, and the pose transformation, accurately calculate and mark the six-degree-of-freedom pose of the feature points of the target object without manual labor. Labeling can reduce labor costs; further, when positioning and analyzing the target object based on the pose of the target object, the positioning accuracy can be improved, especially in the field of robot grasping the target object, which can greatly improve the grasping efficiency and grasping efficiency of the target object. Take precision.

实施例三Embodiment 3

图5为本发明实施例三提供的一种位姿标注装置的结构示意图。参见图5所示,该系统包括:图像确定模块310、第一位姿转换关系确定模块310、第二位姿转换关系确定模块330以及位姿标注模块340。FIG. 5 is a schematic structural diagram of a pose labeling device according to Embodiment 3 of the present invention. Referring to FIG. 5 , the system includes: an image determination module 310 , a first pose transformation relationship determination module 310 , a second pose transformation relationship determination module 330 , and a pose labeling module 340 .

其中,图像确定模块310,用于接收拍摄装置在不同角度下采集的序列帧图像,并确定所述序列帧图像中的参考帧图像和当前帧图像,其中,所述序列帧图像的每帧图像中包括参考物体和目标物体;The image determination module 310 is configured to receive the sequence frame images collected by the photographing device at different angles, and determine the reference frame image and the current frame image in the sequence frame images, wherein each frame image of the sequence frame images including the reference object and the target object;

第一位姿转换关系确定模块320,用于基于所述参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系;The first attitude conversion relationship determination module 320 is used to determine the feature point of the reference object, the projection point of the feature point of the reference object in the reference frame image, and the projection point of the feature point of the reference object in the current frame image. The first pose conversion relationship between the current frame image coordinate system and the reference frame image coordinate system;

第二位姿转换关系确定模块330,用于基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及所述第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系;The second pose transformation relationship determining module 330 is configured to determine the coordinates of the target object where the target object is located based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first pose transformation relationship The second pose transformation relationship between the frame and the current frame image coordinate system;

位姿标注模块340,用于基于所述第二位姿转换关系和拍摄装置拍摄的任一帧图像中目标物体的投影点,对目标物体进行位姿标注。The pose labeling module 340 is configured to label the target object on the basis of the second pose conversion relationship and the projection point of the target object in any frame of images captured by the photographing device.

本实施例提供的技术方案,接收拍摄装置在不同角度下采集的序列帧图像,序列帧图像的每帧图像中包括参考物体的和目标物体,使参考物体辅助拍摄装置进行拍摄;确定序列帧图像中的参考帧图像和当前帧图像,基于参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系;基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系。由于参考物体的特征点和目标物体的特征点稳定可靠,能准确的计算第一位姿转换矩阵和第二位姿转换矩阵;在获取到拍摄装置拍摄的任一帧图像时,基于计算得到的第二位姿转换关系和任一帧图像中目标物体的投影点,自动确定目标物体的特征点的位姿,并自动标注目标物体的特征点的位姿,无需人工标注,降低人力成本,且提高位姿计算的可靠性;进一步地,基于目标物体的位姿对目标物体进行定位分析时,可以提高定位精度,尤其是应用在机器人抓取目标物体领域,可以大大提高目标物体的抓取效率和抓取精度。In the technical solution provided by this embodiment, the sequence frame images collected by the photographing device from different angles are received, and each frame image of the sequence frame image includes the reference object and the target object, so that the reference object assists the photographing device in photographing; the sequence frame image is determined Based on the reference frame image and the current frame image in the reference frame, the coordinates of the current frame image are determined based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image The first pose transformation relationship between the frame and the reference frame image coordinate system; based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first pose transformation relationship, determine the location of the target object. The second pose transformation relationship between the target object coordinate system and the current frame image coordinate system. Since the feature points of the reference object and the feature points of the target object are stable and reliable, the first pose transformation matrix and the second pose transformation matrix can be calculated accurately; The second pose transformation relationship and the projection point of the target object in any frame of images automatically determine the pose of the feature points of the target object, and automatically mark the pose of the feature points of the target object, without manual annotation, reducing labor costs, and Improve the reliability of pose calculation; further, when positioning and analyzing the target object based on the pose of the target object, the positioning accuracy can be improved, especially in the field of robot grasping the target object, which can greatly improve the grasping efficiency of the target object and grasping accuracy.

可选地,第一位姿转换关系确定模块320还用于,基于所述参考物体的特征点和参考物体的特征点在参考帧图像中的投影点,确定参考物体所在的世界坐标系与所述参考帧图像坐标系之间的第三位姿转换关系;Optionally, the first pose conversion relationship determination module 320 is further configured to, based on the feature points of the reference object and the projection points of the feature points of the reference object in the reference frame image, determine the difference between the world coordinate system where the reference object is located and the The third pose conversion relationship between the reference frame image coordinate systems;

基于所述参考物体的特征点和参考物体的特征点在当前帧图像中的投影点,确定所述世界坐标系与所述当前帧图像坐标系之间的第四位姿转换关系;Determine the fourth pose conversion relationship between the world coordinate system and the current frame image coordinate system based on the feature points of the reference object and the projection points of the feature points of the reference object in the current frame image;

根据所述第三位姿转换关系和所述第四位姿转换关系,确定所述第一位姿转换关系。The first pose transformation relationship is determined according to the third pose transformation relationship and the fourth pose transformation relationship.

可选地,第一位姿转换关系确定模块320还用于,获取拍摄装置预先标定得到的内参矩阵;Optionally, the first pose conversion relationship determining module 320 is further configured to acquire an internal parameter matrix pre-calibrated by the photographing device;

根据所述内参矩阵、所述参考物体的三维特征点、所述参考物体的特征点在参考帧图像中的二维投影点以及世界坐标系和参考帧图像坐标系之间的当前位姿转换关系,计算第一关系方程;According to the internal reference matrix, the three-dimensional feature points of the reference object, the two-dimensional projection points of the feature points of the reference object in the reference frame image, and the current pose transformation relationship between the world coordinate system and the reference frame image coordinate system , calculate the first relation equation;

对所述第一关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第三位姿转换关系。The first relationship equation is iteratively solved, and if the current pose conversion relationship under the current iteration number is converged, the current pose conversion relationship under the current iteration number is used as the third pose conversion relationship.

可选地,第一位姿转换关系确定模块320还用于,获取拍摄装置预先标定得到的内参矩阵;Optionally, the first pose conversion relationship determining module 320 is further configured to acquire an internal parameter matrix pre-calibrated by the photographing device;

根据所述内参矩阵、所述参考物体的三维特征点、所述参考物体的特征点在当前帧图像中的二维投影点以及世界坐标系与当前帧图像坐标系之间的当前位姿转换关系,计算第二关系方程;According to the internal reference matrix, the three-dimensional feature points of the reference object, the two-dimensional projection points of the feature points of the reference object in the current frame image, and the current pose transformation relationship between the world coordinate system and the current frame image coordinate system , calculate the second relation equation;

对所述第二关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第四位姿转换关系。The second relationship equation is iteratively solved, and if the current pose conversion relationship under the current iteration number is converged, the current pose conversion relationship under the current iteration number is used as the fourth pose conversion relationship.

可选地,第二位姿转换关系确定模块330还用于,根据所述目标物体的特征点和目标物体的特征点在参考帧图像中的投影点,确定所述目标物体坐标系和所述参考帧图像坐标系之间的第五位姿转换关系;Optionally, the second pose conversion relationship determination module 330 is further configured to determine the target object coordinate system and the the fifth pose transformation relationship between the reference frame image coordinate systems;

基于所述第一位姿转换关系和所述第五位姿转换关系,确定所述第二位姿转换关系。The second pose transformation relationship is determined based on the first pose transformation relationship and the fifth pose transformation relationship.

可选地,第二位姿转换关系确定模块330还用于,获取拍摄装置预先标定得到的内参矩阵;Optionally, the second pose conversion relationship determination module 330 is further configured to acquire an internal parameter matrix obtained by pre-calibration of the photographing device;

根据所述内参矩阵、所述目标物体的三维特征点、目标物体的特征点在所述参考帧图像中的二维投影点,计算第三关系方程;Calculate a third relational equation according to the internal reference matrix, the three-dimensional feature points of the target object, and the two-dimensional projection points of the feature points of the target object in the reference frame image;

对所述第三关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第五位姿转换关系。The third relationship equation is iteratively solved, and if the current pose conversion relationship under the current iteration number is converged, the current pose conversion relationship under the current iteration number is used as the fifth pose conversion relationship.

可选地,第二位姿转换关系确定模块330还用于,将所述第一位姿转换关系以及所述第五位姿转换关系进行矢量相乘,得到目标物体坐标系下和当前帧图像坐标系之间的当前位姿转换关系;Optionally, the second pose transformation relationship determining module 330 is further configured to perform vector multiplication of the first pose transformation relationship and the fifth pose transformation relationship to obtain the target object coordinate system and the current frame image. The current pose transformation relationship between coordinate systems;

根据相机预先标定得到的内参矩阵、所述目标物体的三维特征点、目标物体的特征点在当前帧图像中的二维投影点、所述目标物体坐标系和当前帧图像坐标系之间的当前位姿转换关系,计算第四关系方程;The internal parameter matrix pre-calibrated according to the camera, the three-dimensional feature points of the target object, the two-dimensional projection points of the feature points of the target object in the current frame image, the current coordinate system between the target object coordinate system and the current frame image coordinate system Pose transformation relationship, calculate the fourth relationship equation;

对所述第四关系方程进行迭代求解,如果当前迭代次数下的当前位姿转换关系收敛,将当前迭代次数下的当前位姿转换关系作为所述第二位姿转换关系。The fourth relationship equation is iteratively solved, and if the current pose conversion relationship under the current iteration number is converged, the current pose conversion relationship under the current iteration number is used as the second pose conversion relationship.

可选地,第一位姿转换关系确定模块320还用于,将所述第三位姿转换关系和所述第四位姿转换关系进行矢量相乘,得到所述第一位姿转换关系。Optionally, the first pose transformation relationship determining module 320 is further configured to perform vector multiplication of the third pose transformation relationship and the fourth pose transformation relationship to obtain the first pose transformation relationship.

可选地,位姿标注模块340还用于,根据拍摄装置拍摄的任一帧图像中目标物体的投影点、所述第二位姿转换关系以及拍摄装置预先标定得到的内参矩阵,得到所述拍摄装置拍摄的图像中目标物体的特征点的位姿,并对目标物体的特征点进行位姿标注。Optionally, the pose labeling module 340 is further configured to, according to the projection point of the target object in any frame image shot by the shooting device, the second pose conversion relationship and the internal parameter matrix pre-calibrated by the shooting device, obtain the The pose of the feature points of the target object in the image captured by the photographing device is used to mark the pose of the feature points of the target object.

可选地,所述拍摄装置包括以下任意一种:相机、摄像头和激光器;所述参考物体包括以下任意一种:二维码、条形码。Optionally, the photographing device includes any one of the following: a camera, a camera, and a laser; the reference object includes any one of the following: a two-dimensional code and a barcode.

实施例四Embodiment 4

图6为本发明实施例四提供的一种位姿标注系统的结构示意图。图6示出了适于用来实现本发明实施方式的示例性机器人的框图。图6显示的机器人仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。FIG. 6 is a schematic structural diagram of a pose labeling system according to Embodiment 4 of the present invention. Figure 6 shows a block diagram of an exemplary robot suitable for use in implementing embodiments of the present invention. The robot shown in FIG. 6 is only an example, and should not impose any limitations on the functions and scope of use of the embodiments of the present invention.

图6所示的位姿标注系统包括机器人、目标物体和参考物体。其中,机器人包括机械臂、拍摄装置、存储器(图中未示出)、处理器(图中未示出)。其中,机械臂带动所述拍摄装置运动,以使拍摄装置在多个角度下采集序列帧图像;其中,所述序列帧图像的每帧图像中包括参考物体和目标物体,所述目标物体包括多个特征点,所述参考物体上包括多个特征点。如图6所示,机器人还包括:基座和末端工具;所述机械臂安装在所述基座上,所述末端工具安装在所述机械臂末端,所述末端工具的一侧安装所述拍摄装置。The pose labeling system shown in Figure 6 includes a robot, a target object and a reference object. The robot includes a robotic arm, a photographing device, a memory (not shown in the figure), and a processor (not shown in the figure). The robotic arm drives the photographing device to move, so that the photographing device captures a sequence of frame images from multiple angles; wherein, each frame of the sequence of frame images includes a reference object and a target object, and the target object includes multiple frames. feature points, and the reference object includes multiple feature points. As shown in FIG. 6 , the robot further includes: a base and an end tool; the robotic arm is mounted on the base, the end tool is mounted on the end of the robotic arm, and the end tool is mounted on one side of the end tool. filming device.

处理器通过运行存储在存储器中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的一种位姿标注方法,该方法包括:The processor executes various functional applications and data processing by running the program stored in the memory, for example, implementing a pose labeling method provided by the embodiment of the present invention, and the method includes:

接收拍摄装置在不同角度下采集的序列帧图像,并确定所述序列帧图像中的参考帧图像和当前帧图像,其中,所述序列帧图像的每帧图像中包括参考物体和目标物体;Receive sequence frame images collected by a photographing device at different angles, and determine a reference frame image and a current frame image in the sequence frame images, wherein each frame image of the sequence frame images includes a reference object and a target object;

基于所述参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系;Based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image, determine the difference between the current frame image coordinate system and the reference frame image coordinate system The first pose conversion relationship between;

基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及所述第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系;Based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first attitude transformation relationship, determine the second coordinate system between the target object coordinate system where the target object is located and the current frame image coordinate system Pose transformation relationship;

基于所述第二位姿转换关系和拍摄装置拍摄的任一帧图像中目标物体的投影点,对目标物体进行位姿标注。Based on the second pose conversion relationship and the projection point of the target object in any frame image captured by the photographing device, the pose labeling is performed on the target object.

当然,本领域技术人员可以理解,处理器还可以实现本发明任意实施例所提供的一种位姿标注方法的技术方案。Of course, those skilled in the art can understand that the processor can also implement the technical solution of the pose labeling method provided by any embodiment of the present invention.

实施例五Embodiment 5

本发明实施例五还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本发明实施例所提供的一种位姿标注,该方法包括:Embodiment 5 of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, implements a pose annotation provided by the embodiment of the present invention, and the method includes:

接收拍摄装置在不同角度下采集的序列帧图像,并确定所述序列帧图像中的参考帧图像和当前帧图像,其中,所述序列帧图像的每帧图像中包括参考物体和目标物体;Receive sequence frame images collected by a photographing device at different angles, and determine a reference frame image and a current frame image in the sequence frame images, wherein each frame image of the sequence frame images includes a reference object and a target object;

基于所述参考物体的特征点、参考物体的特征点在参考帧图像中的投影点以及参考物体的特征点在当前帧图像中的投影点,确定当前帧图像坐标系与参考帧图像坐标系之间的第一位姿转换关系;Based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image, determine the difference between the current frame image coordinate system and the reference frame image coordinate system The first pose conversion relationship between;

基于目标物体的特征点、目标物体的特征点在参考帧图像中的投影点以及所述第一位姿转换关系,确定目标物体所在的目标物体坐标系和当前帧图像坐标系之间的第二位姿转换关系;Based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first attitude transformation relationship, determine the second coordinate system between the target object coordinate system where the target object is located and the current frame image coordinate system Pose transformation relationship;

基于所述第二位姿转换关系和拍摄装置拍摄的任一帧图像中目标物体的投影点,对目标物体进行位姿标注。Based on the second pose conversion relationship and the projection point of the target object in any frame image captured by the photographing device, the pose labeling is performed on the target object.

当然,本发明实施例所提供的一种计算机可读存储介质,其上存储的计算机程序不限于如上的方法操作,还可以执行本发明任意实施例所提供的一种位姿标注方法中的相关操作。Of course, in the computer-readable storage medium provided by the embodiment of the present invention, the computer program stored on the storage medium is not limited to the above method operations, and can also execute the related operations in the pose labeling method provided by any embodiment of the present invention. operate.

本发明实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、系统或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、系统或者器件使用或者与其结合使用。The computer storage medium in the embodiments of the present invention may adopt any combination of one or more computer-readable mediums. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system or device, or a combination of any of the above. More specific examples (a non-exhaustive list) of computer readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device.

计算机可读的信号介质可以包括在第一位姿转换关系、第二位姿转换关系、拍摄的图像中目标物体的投影点等,其中承载了计算机可读的程序代码。这种传播的第一位姿转换关系、第二位姿转换关系、拍摄的图像中目标物体的投影点等形式。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、系统或者器件使用或者与其结合使用的程序。The computer-readable signal medium may include the first pose transformation relationship, the second pose transformation relationship, the projection point of the target object in the captured image, etc., and carry computer-readable program codes therein. The first pose transformation relationship, the second pose transformation relationship, the projection point of the target object in the captured image, etc. A computer-readable signal medium can also be any computer-readable medium, other than a computer-readable storage medium, that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, system, or device .

计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于无线、电线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a computer readable medium may be transmitted using any suitable medium, including - but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional procedural languages, or a combination thereof. Programming Language - such as "C" language or similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).

值得注意的是,上述位姿标注装置的实施例中,所包括的各个模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。It is worth noting that, in the above embodiments of the pose labeling device, the modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, each function The specific names of the units are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present invention.

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention. The scope is determined by the scope of the appended claims.

Claims (14)

1. A pose labeling method is characterized by comprising the following steps:
receiving sequence frame images acquired by a shooting device at different angles, and determining a reference frame image and a current frame image in the sequence frame images, wherein each frame image of the sequence frame images comprises a reference object and a target object;
determining a first pose conversion relation between a current frame image coordinate system and a reference frame image coordinate system based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image and the projection points of the feature points of the reference object in the current frame image;
determining a second pose conversion relation between a target object coordinate system where the target object is located and a current frame image coordinate system based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image and the first pose conversion relation;
and marking the pose of the target object based on the second pose conversion relation and the projection point of the target object in any frame of image shot by the shooting device.
2. The method according to claim 1, wherein determining the first pose conversion relationship between the coordinate system of the current frame image and the coordinate system of the reference frame image based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image, and the projection points of the feature points of the reference object in the current frame image comprises:
determining a third pose conversion relation between a world coordinate system where the reference object is located and a reference frame image coordinate system based on the feature points of the reference object and the projection points of the feature points of the reference object in the reference frame image;
determining a fourth pose conversion relation between the world coordinate system and the current frame image coordinate system based on the feature points of the reference object and the projection points of the feature points of the reference object in the current frame image;
and determining the first attitude conversion relation according to the third attitude conversion relation and the fourth attitude conversion relation.
3. The method according to claim 2, wherein the determining a third pose transformation relationship between the world coordinate system of the reference object and the reference frame image coordinate system based on the feature points of the reference object and the projection points of the feature points of the reference object in the reference frame image comprises:
obtaining an internal reference matrix obtained by pre-calibrating a shooting device;
calculating a first relation equation according to the internal reference matrix, the three-dimensional characteristic points of the reference object, the two-dimensional projection points of the characteristic points of the reference object in the reference frame image and the current pose conversion relation between the world coordinate system and the reference frame image coordinate system;
and carrying out iterative solution on the first relation equation, and if the current pose conversion relation under the current iteration times is converged, taking the current pose conversion relation under the current iteration times as the third pose conversion relation.
4. The method according to claim 2, wherein the determining a fourth pose conversion relationship between the world coordinate system and the current frame image coordinate system based on the feature points of the reference object and the projection points of the feature points of the reference object in the current frame image comprises:
acquiring an internal reference matrix obtained by pre-calibrating a shooting device;
calculating a second relation equation according to the internal reference matrix, the three-dimensional characteristic points of the reference object, the two-dimensional projection points of the characteristic points of the reference object in the current frame image and the current pose conversion relation between the world coordinate system and the current frame image coordinate system;
and carrying out iterative solution on the second relation equation, and if the current position and posture conversion relation under the current iteration times is converged, taking the current position and posture conversion relation under the current iteration times as the fourth position and posture conversion relation.
5. The method according to claim 1, wherein the determining a second pose transformation relationship between the target object coordinate system in which the target object is located and the current frame image coordinate system based on the feature points of the target object, the projection points of the feature points of the target object in the reference frame image, and the first pose transformation relationship comprises:
determining a fifth pose conversion relation between the target object coordinate system and the reference frame image coordinate system according to the feature points of the target object and the projection points of the feature points of the target object in the reference frame image;
determining the second pose transformation relationship based on the first pose transformation relationship and the fifth pose transformation relationship.
6. The method according to claim 5, wherein the determining a fifth pose conversion relationship between the target object coordinate system and the reference frame image coordinate system according to the feature points of the target object and the projection points of the feature points of the target object in the reference frame image comprises:
acquiring an internal reference matrix obtained by pre-calibrating a shooting device;
calculating a third relation equation according to the internal reference matrix, the three-dimensional characteristic points of the target object and the two-dimensional projection points of the characteristic points of the target object in the reference frame image;
and carrying out iterative solution on the third relation equation, and if the current pose conversion relation under the current iteration times is converged, taking the current pose conversion relation under the current iteration times as the fifth pose conversion relation.
7. The method of claim 5, wherein the determining the second pose translation relationship based on the first pose translation relationship and the fifth pose translation relationship comprises:
performing vector multiplication on the first pose conversion relation and the fifth pose conversion relation to obtain a current pose conversion relation between a target object coordinate system and a current frame image coordinate system;
calculating a fourth relation equation according to a reference matrix obtained by calibrating in advance by a camera, the three-dimensional characteristic point of the target object, the two-dimensional projection point of the characteristic point of the target object in the current frame image, the target object coordinate system and the current pose conversion relation between the current frame image coordinate system and the target object coordinate system;
and carrying out iterative solution on the fourth relation equation, and if the current pose conversion relation under the current iteration times is converged, taking the current pose conversion relation under the current iteration times as the second pose conversion relation.
8. The method of claim 2, wherein the determining the first pose translation relationship based on the third pose translation relationship and the fourth pose translation relationship comprises:
and carrying out vector multiplication on the third attitude conversion relation and the fourth attitude conversion relation to obtain the first attitude conversion relation.
9. The method according to claim 1, wherein the pose labeling of the target object based on the second pose transformation relation and the projection point of the target object in any frame of image captured by the capturing device comprises:
and obtaining the pose of the characteristic point of the target object in the image shot by the shooting device according to the projection point of the target object in any frame of image shot by the shooting device, the second pose transformation relation and the internal reference matrix obtained by pre-calibration of the shooting device, and carrying out pose marking on the characteristic point of the target object.
10. The method of claim 1, wherein the camera comprises any one of: a camera, a camera and a laser; and/or, the reference object comprises any one of: two-dimensional codes and bar codes.
11. A pose labeling apparatus, comprising:
the image determining module is used for receiving sequence frame images acquired by a shooting device under different angles and determining a reference frame image and a current frame image in the sequence frame images, wherein each frame image of the sequence frame images comprises a reference object and a target object;
the first pose conversion relation determining module is used for determining a first pose conversion relation between a current frame image coordinate system and a reference frame image coordinate system based on the feature points of the reference object, the projection points of the feature points of the reference object in the reference frame image and the projection points of the feature points of the reference object in the current frame image;
the second pose conversion relation determining module is used for determining a second pose conversion relation between a target object coordinate system where the target object is located and a current frame image coordinate system based on the feature point of the target object, the projection point of the feature point of the target object in the reference frame image and the first pose conversion relation;
and the pose marking module is used for marking the pose of the target object based on the second pose conversion relation and the projection point of the target object in any frame of image shot by the shooting device.
12. A pose marking system comprises a robot, a target object and a reference object, wherein the robot comprises a mechanical arm, a shooting device, a memory and a processor; the method is characterized in that the mechanical arm drives the shooting device to move so that the shooting device can acquire sequence frame images at a plurality of angles; each frame of image of the sequence frame image comprises a reference object and a target object, the target object comprises a plurality of characteristic points, and the reference object comprises a plurality of characteristic points;
a computer program stored in a memory and executable on a processor, the processor implementing the pose labeling method according to any one of claims 1 to 10 when executing the computer program.
13. The system of claim 12, wherein the robot further comprises: a base and a tip tool;
the arm is installed on the base, end tool is installed at the end of the arm, and one side of the end tool is provided with the shooting device.
14. A storage medium containing computer-executable instructions, which when executed by a computer processor implement the pose annotation method according to any one of claims 1-10.
CN202110219672.1A 2021-02-26 2021-02-26 A posture labeling method, device, system and storage medium Active CN115049737B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110219672.1A CN115049737B (en) 2021-02-26 2021-02-26 A posture labeling method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110219672.1A CN115049737B (en) 2021-02-26 2021-02-26 A posture labeling method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN115049737A true CN115049737A (en) 2022-09-13
CN115049737B CN115049737B (en) 2025-04-25

Family

ID=83156748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110219672.1A Active CN115049737B (en) 2021-02-26 2021-02-26 A posture labeling method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN115049737B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567781A (en) * 2022-09-21 2023-01-03 湖南大学 Shooting method and device based on smart camera and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080267453A1 (en) * 2007-04-26 2008-10-30 Ioimage Ltd. Method for estimating the pose of a ptz camera
CN110245611A (en) * 2019-06-14 2019-09-17 腾讯科技(深圳)有限公司 Image-recognizing method, device, computer equipment and storage medium
WO2020114585A1 (en) * 2018-12-05 2020-06-11 Telefonaktiebolaget Lm Ericsson (Publ) Object location determination in frames of a video stream
CN112016568A (en) * 2019-05-31 2020-12-01 北京初速度科技有限公司 Method and device for tracking image feature points of target object

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080267453A1 (en) * 2007-04-26 2008-10-30 Ioimage Ltd. Method for estimating the pose of a ptz camera
WO2020114585A1 (en) * 2018-12-05 2020-06-11 Telefonaktiebolaget Lm Ericsson (Publ) Object location determination in frames of a video stream
CN112016568A (en) * 2019-05-31 2020-12-01 北京初速度科技有限公司 Method and device for tracking image feature points of target object
CN110245611A (en) * 2019-06-14 2019-09-17 腾讯科技(深圳)有限公司 Image-recognizing method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
回丙伟;文贡坚;赵竹新;钟金荣;: "基于平面区域跟踪的目标位姿参数自动测量", 中国图象图形学报, no. 07, 16 July 2012 (2012-07-16) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115567781A (en) * 2022-09-21 2023-01-03 湖南大学 Shooting method and device based on smart camera and computer equipment

Also Published As

Publication number Publication date
CN115049737B (en) 2025-04-25

Similar Documents

Publication Publication Date Title
CN110866496B (en) Robot positioning and mapping method and device based on depth image
CN108986161B (en) Three-dimensional space coordinate estimation method, device, terminal and storage medium
WO2019170166A1 (en) Depth camera calibration method and apparatus, electronic device, and storage medium
CN110842914A (en) Method, system and medium for hand-eye calibration parameter identification based on differential evolution algorithm
CN110070615A (en) A kind of panoramic vision SLAM method based on polyphaser collaboration
CN107843251B (en) Pose Estimation Methods for Mobile Robots
WO2022174711A1 (en) Visual inertial system initialization method and apparatus, medium, and electronic device
CN115213896B (en) Object grasping method, system, device and storage medium based on robotic arm
JP2015147256A (en) Robot, robot system, control device, and control method
EP3881163A1 (en) Automated spatial indexing of images to video
CN115420276B (en) A multi-robot collaborative localization and mapping method for outdoor scenes
CN110111388A (en) Three-dimension object pose parameter estimation method and visual apparatus
CN106845354B (en) Part view library construction method, part positioning and grabbing method and device
KR20130084849A (en) Method and apparatus for camera tracking
CN108537214B (en) An automatic construction method of indoor semantic map
CN116249607A (en) Method and device for robotically gripping three-dimensional objects
JPWO2011108055A1 (en) Object position estimation apparatus, object position estimation method, and object position estimation program
CN111161334B (en) Semantic map construction method based on deep learning
CN111798518A (en) Manipulator attitude detection method, device and equipment and computer storage medium
Fang et al. GraspNet: a large-scale clustered and densely annotated dataset for object grasping
CN115049737A (en) Pose marking method, device and system and storage medium
CN115810188A (en) Method and system for identifying three-dimensional pose of fruit on tree based on single two-dimensional image
CN112596063B (en) Point cloud descriptor construction method and device, and closed loop detection method and device
WO2022110767A1 (en) Localization and mapping method, apparatus, robot, and computer-readable storage medium
CN110849380B (en) Map alignment method and system based on collaborative VSLAM

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant