CN109960402A - A virtual-real registration method based on fusion of point cloud and visual features - Google Patents
A virtual-real registration method based on fusion of point cloud and visual features Download PDFInfo
- Publication number
- CN109960402A CN109960402A CN201811549587.6A CN201811549587A CN109960402A CN 109960402 A CN109960402 A CN 109960402A CN 201811549587 A CN201811549587 A CN 201811549587A CN 109960402 A CN109960402 A CN 109960402A
- Authority
- CN
- China
- Prior art keywords
- point cloud
- registration
- point
- virtual
- assembly
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- Human Computer Interaction (AREA)
- Image Analysis (AREA)
Abstract
本发明请求保护一种基于点云和视觉特征融合的虚实注册方法,整个过程分为离线和在线两个阶段完成,具体包括以下步骤:在离线阶段,在CAD环境中将参考对象零件三维CAD模型生成三维点云模型,为装配绝对坐标系的建立和后续的虚实注册做准备,为了加快点云配准及装配坐标系建立过程,在此阶段需要对参考对象零件的点云模型进行精简;在在线阶段,采集装配现场视频流并生成点云,利用参考对象点云和装配现场点云之间的配准完成装配绝对坐标系的定义,基于点云的虚实注册在迭代配准过程中需要一个初始配准阶段,设置初始点云相对位置,获得绝对坐标系下精确的跟踪注册矩阵。本发明既避免了相机移动速度过快时导致的“丢帧”情况,又提高了虚实注册精度。
The present invention claims to protect a virtual-real registration method based on point cloud and visual feature fusion. The whole process is completed in two stages, offline and online, and specifically includes the following steps: in the offline stage, the three-dimensional CAD model of the reference object part is stored in the CAD environment. Generate a 3D point cloud model to prepare for the establishment of the absolute coordinate system of the assembly and the subsequent virtual-real registration. In order to speed up the process of point cloud registration and the establishment of the assembly coordinate system, it is necessary to simplify the point cloud model of the reference object part at this stage; In the online stage, the video stream of the assembly site is collected and a point cloud is generated, and the registration between the point cloud of the reference object and the point cloud of the assembly site is used to complete the definition of the absolute coordinate system of the assembly. The virtual-real registration based on the point cloud requires a In the initial registration stage, the relative position of the initial point cloud is set, and the accurate tracking registration matrix in the absolute coordinate system is obtained. The present invention not only avoids the "frame loss" situation caused when the camera moves too fast, but also improves the accuracy of virtual and real registration.
Description
技术领域technical field
本发明属于增强现实技术领域,具体涉及一种基于点云和视觉特征融合的虚实注册方法。The invention belongs to the technical field of augmented reality, and in particular relates to a virtual-real registration method based on fusion of point clouds and visual features.
背景技术Background technique
虚实注册(即三维跟踪注册)技术就是将计算机生成的虚拟物体或其他信息与真实场景正确匹配或有机结合,其关键是相机的跟踪定位。许多学者针对相机的跟踪定位提出了大量的方法,主要包括基于人工标识和基于自然特征的跟踪定位等。但是由于机械产品装配要求严格,人工标识被严格禁止使用。而且装配环境大多以光滑、缺少纹理的零部件为主,基于自然特征的跟踪注册也难以有效适用。基于稠密点云的跟踪注册方法利用场景深度图像生成点云,并通过点云的配准实现相机的跟踪定位,它能在光照强度较低且表面缺少纹理的机械产品装配环境中表现出较好的鲁棒性,因此受到广大科研工作者的兴趣和关注。The virtual-real registration (ie three-dimensional tracking registration) technology is to correctly match or organically combine the virtual objects or other information generated by the computer with the real scene, and the key is the tracking and positioning of the camera. Many scholars have proposed a large number of methods for camera tracking and positioning, mainly including tracking and positioning based on artificial identification and natural features. However, due to strict assembly requirements for mechanical products, manual marking is strictly prohibited. In addition, the assembly environment is mostly based on smooth and texture-less components, and the tracking registration based on natural features is also difficult to apply effectively. The tracking registration method based on dense point cloud uses scene depth image to generate point cloud, and realizes camera tracking and positioning through point cloud registration. It can perform well in mechanical product assembly environment with low light intensity and lack of surface texture. Therefore, it has attracted the interest and attention of the majority of scientific researchers.
基于点云的虚实注册方法能在光照强度较低且表面缺少纹理的机械产品装配环境中表现出良好的鲁棒性。但是目前基于稠密点云的虚实注册方法仅能估计传感器的相对位姿,对机械产品装配环境不能直接适用。同时,基于稠密点云的虚实注册方法主要采用迭代最近点的方法进行相机位姿估计。但是当相机快速移动时,迭代最近点(ICP)配准算法由于无法获取足够数量的正确初始对应数据点集,迭代过程容易陷入局部最优,难以保证收敛速度和配准精度,甚至造成“丢帧”的情况,导致虚实注册过程的中断。因此如何利用深度传感器同一时刻冗余的彩色图像信息,通过特征点匹配,获取足够数量的正确初始对应数据点集,提高迭代过程收敛速度和相机位姿计算精度成为难点。而且由于装配现场物体表面大多光滑、无纹理,如何获取足够数量的匹配特征点对也是需要解决的问题。The virtual-real registration method based on point cloud can show good robustness in the mechanical product assembly environment with low light intensity and lack of surface texture. However, the current virtual-real registration method based on dense point cloud can only estimate the relative pose of the sensor, which is not directly applicable to the mechanical product assembly environment. At the same time, the virtual-real registration method based on dense point cloud mainly uses the iterative closest point method to estimate the camera pose. However, when the camera moves rapidly, the iterative closest point (ICP) registration algorithm cannot obtain a sufficient number of correct initial corresponding data points, and the iterative process is easy to fall into a local optimum, which is difficult to ensure the convergence speed and registration accuracy, and even causes "lost" frame", resulting in the interruption of the virtual and real registration process. Therefore, how to use the redundant color image information of the depth sensor at the same time, through feature point matching, to obtain a sufficient number of correct initial corresponding data point sets, and improve the convergence speed of the iterative process and the calculation accuracy of the camera pose, become difficult. Moreover, since the surface of objects on the assembly site is mostly smooth and without texture, how to obtain a sufficient number of matching feature point pairs is also a problem that needs to be solved.
虚实注册是AR装配辅助系统虚实融合的首要条件。如何将虚拟装配引导信息稳定、高精度的注册到装配环境中成为研究难点。基于稠密点云的虚实注册方法能在光照强度较低且表面缺少纹理的机械产品装配环境中表现出较好的鲁棒性。该类方法使用点云中的全部或大多数点参与计算过程,运用迭代最近点 (ICP)配准算法对全部对应点对进行迭代运算,获取相机位姿,大大提高了虚实注册精度。但是目前基于稠密点云的虚实注册方法采用的迭代最近点策略,仅能估计传感器相对其初始位置(不固定)的位姿,对于需要绝对装配位置信息的装配场景不能直接适用。同时,当深度传感器移动速度过快,导致无法获取正确的初始对应数据点集时,ICP算法迭代过程容易陷入局部最优,难以保证收敛速度和配准精度。而且在超出深度传感器工作范围(0.15~4m)时,容易造成“丢帧”的情况,导致虚实注册过程的中断。跟踪过程采用的连续帧间配准会也随着传感器运动距离的增大,跟踪精度大幅降低;基于特征点匹配的虚实注册方法在彩色图像中进行特征点提取,然后将特征点映射到三维空间,再通过 RANSAC算法计算对应特征点对间的变换,从而完成摄像机位姿的估计。基于特征点匹配的虚实注册方法响应速度快、对零部件表面要求不高、工作区间范围广,而且在深度传感器超出工作区间范围时仍能很好的完成相机位姿估计。但是该方法对环境光照条件要求较高。因此将基于特征点匹配和点云配准算法相结合是解决机械产品装配环境虚实注册过程失效的有效方法之一。然而由于机械产品装配现场或工装表面缺少足够的纹理特征,采用传统的SIFT或SURF 作为特征检测子或描述子进行变换矩阵估计,容易由于缺少足够的匹配特征点而导致虚实注册失败。Virtual-real registration is the primary condition for virtual-real integration of AR assembly assistance systems. How to register the virtual assembly guidance information into the assembly environment stably and with high precision has become a research difficulty. The virtual-real registration method based on dense point cloud can show better robustness in the assembly environment of mechanical products with low illumination intensity and lack of surface texture. This type of method uses all or most points in the point cloud to participate in the calculation process, and uses the iterative closest point (ICP) registration algorithm to iteratively calculate all corresponding point pairs to obtain the camera pose, which greatly improves the accuracy of virtual and real registration. However, the iterative closest point strategy adopted by the current virtual-real registration method based on dense point cloud can only estimate the pose of the sensor relative to its initial position (not fixed), which is not directly applicable to the assembly scene that requires absolute assembly position information. At the same time, when the depth sensor moves too fast to obtain the correct initial corresponding data point set, the iterative process of the ICP algorithm is easy to fall into a local optimum, and it is difficult to ensure the convergence speed and registration accuracy. Moreover, when it exceeds the working range of the depth sensor (0.15-4m), it is easy to cause a "dropped frame" situation, resulting in the interruption of the virtual and real registration process. The continuous inter-frame registration used in the tracking process will also greatly reduce the tracking accuracy with the increase of the moving distance of the sensor; the virtual-real registration method based on feature point matching extracts feature points in the color image, and then maps the feature points to the three-dimensional space. , and then calculate the transformation between the corresponding feature point pairs through the RANSAC algorithm, so as to complete the estimation of the camera pose. The virtual-real registration method based on feature point matching has a fast response speed, does not have high requirements on the surface of the parts, and has a wide working range, and can still complete the camera pose estimation well when the depth sensor exceeds the working range. However, this method requires high ambient lighting conditions. Therefore, the combination of feature point matching and point cloud registration algorithm is one of the effective methods to solve the failure of virtual and real registration process in mechanical product assembly environment. However, due to the lack of sufficient texture features on the mechanical product assembly site or tooling surface, using traditional SIFT or SURF as a feature detector or descriptor for transformation matrix estimation, it is easy to cause virtual and real registration failure due to lack of sufficient matching feature points.
发明内容SUMMARY OF THE INVENTION
本发明旨在解决以上现有技术的问题。提出了一种既避免了相机移动速度过快时导致的“丢帧”情况,又提高了虚实注册精度的基于点云和视觉特征融合的虚实注册方法。本发明的技术方案如下:The present invention aims to solve the above problems of the prior art. A virtual-real registration method based on the fusion of point cloud and visual features is proposed, which not only avoids the "dropped frame" situation caused by the camera moving too fast, but also improves the accuracy of virtual-real registration. The technical scheme of the present invention is as follows:
一种基于点云和视觉特征融合的虚实注册方法,整个过程分为离线和在线两个阶段完成,具体包括以下步骤:A virtual-real registration method based on the fusion of point clouds and visual features. The whole process is completed in two stages, offline and online, including the following steps:
在离线阶段,在计算机辅助设计CAD环境中将参考对象零件三维CAD模型生成三维点云模型,为装配绝对坐标系的建立和后续的虚实注册做准备,为了加快点云配准及装配坐标系建立过程,在此阶段需要对参考对象零件的点云模型进行精简;In the offline stage, the 3D CAD model of the reference object part is generated in the CAD environment of the computer-aided design to generate a 3D point cloud model to prepare for the establishment of the absolute coordinate system of the assembly and the subsequent virtual-real registration. In order to speed up the point cloud registration and the establishment of the assembly coordinate system At this stage, the point cloud model of the reference object part needs to be simplified;
在在线阶段,采集装配现场视频流并生成点云,利用参考对象点云和装配现场点云之间的配准完成装配绝对坐标系的定义,基于点云的虚实注册在迭代配准过程中需要一个初始配准阶段,设置初始点云相对位置,获得绝对坐标系下精确的跟踪注册矩阵。In the online stage, the video stream of the assembly site is collected and a point cloud is generated. The registration between the reference object point cloud and the assembly site point cloud is used to complete the definition of the absolute coordinate system of the assembly. The virtual and real registration based on the point cloud needs to be in the iterative registration process. In an initial registration stage, the relative position of the initial point cloud is set, and the accurate tracking registration matrix in the absolute coordinate system is obtained.
进一步的,所述在线阶段中,装配环境点云生成及预处理具体包括:Further, in the online stage, the point cloud generation and preprocessing of the assembly environment specifically include:
1)点云生成步骤:对深度图像中的每一个像素点uD进行并行反投影到相机坐标空间,获得顶点,三维顶点Vt(u)及顶点对应的法向量Nt(u)形成三维装配环境点云;1) Point cloud generation step: perform parallel back-projection of each pixel point u D in the depth image to the camera coordinate space to obtain vertices, the three-dimensional vertex V t (u) and the normal vector N t (u) corresponding to the vertex form a three-dimensional Assembly environment point cloud;
2)点云空间索引建立步骤:采用空间索引Kd-tree进行点云数据结构的建立;2) Steps of establishing the point cloud spatial index: using the spatial index Kd-tree to establish the point cloud data structure;
3)Kd-Tree的最近邻搜索步骤。3) The nearest neighbor search step of Kd-Tree.
进一步的,所述步骤1)点云生成步骤中,装配环境深度图像经过降噪修复后,将图像中i时刻的每一个像素点uD=(xd,yd)通过式(1)反投影到深度相机空间坐标系,为了对此过程进行加速,对深度图像中的每一个像素点uD进行并行反投影到相机坐标空间,获得顶点,反投影结果为:Further, in the step 1) point cloud generation step, after the depth image of the assembly environment is repaired by noise reduction, each pixel point u D = (x d , y d ) at time i in the image is reversed by formula (1). Projected to the depth camera space coordinate system. In order to speed up this process, each pixel point u D in the depth image is back-projected to the camera coordinate space in parallel to obtain vertices. The back-projection result is:
Vt(u)=Di(u)Mint_D -1[uD,1] (1)V t (u)=D i (u)M int_D -1 [u D ,1] (1)
式中:Di(u)——i时刻的深度图像;Mint_D——深度相机内部参数。In the formula: D i (u)——the depth image at moment i; M int_D ——internal parameters of the depth camera.
同时,每个顶点对应的法向量Nt(u)用相邻投影点通过如下运算获得:At the same time, the normal vector N t (u) corresponding to each vertex is obtained by using the adjacent projection points through the following operations:
Nt(u)=(Vt(x+1,y)-Vt(x,y))×(Vt(x,y+1)-Vt(x,y)) (2)N t (u)=(V t (x+1,y)-V t (x,y))×(V t (x,y+1)-V t (x,y)) (2)
Vt(x+1,y)对应顶点。x、y表示像素点的横纵坐标;V t (x+1, y) corresponds to a vertex. x, y represent the horizontal and vertical coordinates of the pixel;
将(2)规范化到单位长度Nt/||Nt||2,||Nt||2、Nt表示对应时法向量三维顶点Vt(u)及顶点对应的法向量Nt(u)形成三维装配环境点云。Normalize (2) to unit length N t /||N t || 2 , ||N t || 2 , N t represent the corresponding normal vector three-dimensional vertex V t (u) and the corresponding normal vector N t ( u) Form a 3D assembly environment point cloud.
进一步的,所述步骤2)点云空间索引建立步骤:采用空间索引Kd-tree进行点云数据结构的建立,具体包括:Further, the step 2) point cloud spatial index establishment step: using the spatial index Kd-tree to establish the point cloud data structure, specifically including:
Step1:确定切分点Split域值;Step1: Determine the Split field value of the split point;
Step2:确定根节点Node-data域值;Step2: Determine the value of the Node-data field of the root node;
Step3:确定左子空间和右子空间;Step3: Determine the left subspace and the right subspace;
Step4:递归步骤。Step4: Recursive step.
进一步的,所述步骤3)最邻近查找的基本思路为:Further, the basic idea of the step 3) nearest neighbor search is:
Step1:进行二叉查找,生成搜索路径。要查询的点顺着搜索路径进行快速搜索,找到最邻近的近似点,也就是叶子节点;Step1: Perform a binary search to generate a search path. The point to be queried is quickly searched along the search path to find the nearest approximate point, that is, the leaf node;
Step2:回溯查找,找到的叶子节点并不一定就是最邻近的,最邻近点应该位于以查询点为圆心且通过叶子节点的圆域内,为了找到真正的最近邻,还需要沿搜索路径反向查找是否有距离查询点更近的数据点。Step2: Backtracking search, the found leaf nodes are not necessarily the nearest neighbors. The nearest neighbor points should be located in the circle domain with the query point as the center and passing through the leaf nodes. In order to find the real nearest neighbor, it is necessary to search backwards along the search path. Are there any data points that are closer to the query point.
进一步的,所述装配坐标系建立过程具体包括步骤:Further, the process of establishing the assembly coordinate system specifically includes the steps:
Step1:以水泵外壳为对象,生成点云Step1: Take the pump shell as the object to generate a point cloud
Step2:在线采集t时刻装配现场深度图像Rt(u)(其中u=(x,y)),并对深度图像Rt(u)进行降噪修复,获得降噪修复后的深度图像,然后生成三维环境点云,其中X={x0,x1,x2...xn,N0,N1,N2...Nn}Step2: Collect the depth image R t (u) of the assembly site at time t online (where u=(x, y)), and perform noise reduction and repair on the depth image R t (u) to obtain the depth image after noise reduction and repair, and then Generate a 3D environment point cloud, where X={x 0 ,x 1 ,x 2 ... x n ,N 0 ,N 1 ,N 2 ...N n }
Step3:将三维环境点云与参考对象模型生成的点云 P={p0,p1,p2...pm,n0,n1,n2...nm}使用迭代最近点(ICP)进行配准,采用图形处理器 (GPU)的多线程进行并行运算提高配准速度。为了获得对应配准点,利用 Kd-tree加速匹配搜索,欧氏距离(Euclidiandistance)作为匹配度量(见公式3) 同时为了尽量减少误匹配点数目,加入法向量特征作为额外限制条件。采用点积dij=<mi,mj>对候选点对法向量进行度量,假如dij大于某一阈值ψ,则认为是对应点,并赋予权值1,表示为公式4Step3: Use the point cloud P={p 0 ,p 1 ,p 2 ...p m ,n 0 ,n 1 ,n 2 ...n m } to use the iterative nearest point (ICP) for registration, and multi-threading of graphics processing unit (GPU) is used for parallel operation to improve registration speed. In order to obtain the corresponding registration points, the Kd-tree is used to speed up the matching search, and the Euclidian distance is used as the matching metric (see Equation 3). At the same time, in order to minimize the number of mismatched points, the normal vector feature is added as an additional constraint. The dot product d ij =<m i , m j > is used to measure the normal vector of the candidate point. If d ij is greater than a certain threshold ψ, it is considered to be the corresponding point, and a weight of 1 is assigned, which is expressed as formula 4
Step4:通过采用欧式距离和法向量等特征度量方法之后,便可获得对应点的个数N及每一对对应点的权值wi。采用最小二乘法对位置关系误差矩阵进行求解,确定点云X与点云P之间的变换矩阵,见公式5。Step4: After adopting characteristic measurement methods such as Euclidean distance and normal vector, the number N of corresponding points and the weight wi of each pair of corresponding points can be obtained. Use the least squares method to solve the positional relationship error matrix to determine the transformation matrix between the point cloud X and the point cloud P, see formula 5.
Step5:通过旋转矩阵R和平移向量t的求解,便可完成装配初始绝对坐标系的定义,为后续绝对坐标系下的虚实注册矩阵M的求解做准备Step5: Through the solution of the rotation matrix R and the translation vector t, the definition of the initial absolute coordinate system of the assembly can be completed, preparing for the solution of the virtual and real registration matrix M in the subsequent absolute coordinate system
进一步的,所述点云和视觉特征融合的跟踪注册矩阵具体包括步骤:Further, the tracking registration matrix of the fusion of the point cloud and the visual feature specifically includes the steps:
首先采集装配环境彩色图像和深度图像,然后采用公式(1)和(2)将深度测量值从二维图像坐标转化到全局坐标空间,生成环境点云;同时利用改进的特征描述算子ORB提取彩色图像中的特征点并进行连续帧间匹配;将匹配的 ORB特征点对利用深度信息映射到三维坐标空间,采用随机抽样一致性进行离群点剔除,当两点间距离小于误差值时,保留此特征点对,否则进行离群值剔除,从而获得初始变换矩阵;将计算获得的变换矩阵和正确匹配点对作为ICP 点云配准的初始数据集,利用回环检测与位姿优化策略对点云配准阶段获得的变换矩阵进行优化,最终结合矩阵Minit获得绝对坐标系下精确的跟踪注册矩阵。First collect the color image and depth image of the assembly environment, and then use formulas (1) and (2) to transform the depth measurement value from the two-dimensional image coordinates to the global coordinate space to generate the environment point cloud; at the same time, the improved feature description operator ORB is used to extract The feature points in the color image are matched between consecutive frames; the matched ORB feature point pairs are mapped to the three-dimensional coordinate space using depth information, and outliers are eliminated by random sampling consistency. When the distance between the two points is less than the error value, Retain this feature point pair, otherwise remove outliers to obtain the initial transformation matrix; use the calculated transformation matrix and the correct matching point pair as the initial data set for ICP point cloud registration, and use loopback detection and pose optimization strategy to pair The transformation matrix obtained in the point cloud registration stage is optimized, and finally the accurate tracking registration matrix in the absolute coordinate system is obtained by combining with the matrix M init .
本发明的优点及有益效果如下:The advantages and beneficial effects of the present invention are as follows:
本发明针对机械产品装配环境的特点,首先利用参考模型点云对虚实注册绝对坐标系进行定义,然后设计了一种基于方向向量一致性的视觉特征匹配策略,并基于此设计了稠密点云和视觉特征相结合的RGBD-ICP虚实注册方法,在此基础上加入回环检测和全局优化策略,既避免了相机移动速度过快时导致的“丢帧”情况,又提高了虚实注册精度。Aiming at the characteristics of the mechanical product assembly environment, the invention first uses the reference model point cloud to define the absolute coordinate system of the virtual and real registration, and then designs a visual feature matching strategy based on the consistency of the direction vector, and designs the dense point cloud and The RGBD-ICP virtual-real registration method combined with visual features, on this basis, adds loop detection and global optimization strategies, which not only avoids the "drop frame" situation caused by the camera moving too fast, but also improves the virtual-real registration accuracy.
本发明基于深度图像,建立了装配环境点云。并根据装配环境反光、缺少纹理的特点,设计了一种点云和视觉特征相结合的RGBD-ICP虚实注册方法,为虚实融合景象的生成提供首要条件。The present invention establishes a point cloud of the assembly environment based on the depth image. According to the characteristics of reflective and lack of texture in the assembly environment, a RGBD-ICP virtual-real registration method combining point cloud and visual features is designed, which provides the first condition for the generation of virtual-real fusion scenes.
附图说明Description of drawings
图1是本发明提供优选实施例基于点云和视觉特征融合的虚实注册方法流程图;1 is a flowchart of a virtual-real registration method based on the fusion of point clouds and visual features according to a preferred embodiment of the present invention;
图2表示二维Kd-tree对应的平面切割;Figure 2 shows the plane cut corresponding to the two-dimensional Kd-tree;
图3表示装配环境跟踪注册矩阵求解示意图;Figure 3 shows a schematic diagram of the solution of the assembly environment tracking registration matrix;
图4表示误差度量:(a)点到点(Point-to-Point)之间的欧氏距离(b)点到切平面(Point-to-Tangent Plane)之间的距离;Figure 4 represents the error metric: (a) Euclidean distance between point-to-point (b) point-to-tangent plane (Point-to-Tangent Plane);
图5表示跟踪注册过程中的相机位姿估计回环问题;Figure 5 shows the camera pose estimation loop closure problem in the tracking registration process;
图6表示帧间约束的位姿图结构。Figure 6 shows the pose graph structure for inter-frame constraints.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、详细地描述。所描述的实施例仅仅是本发明的一部分实施例。The technical solutions in the embodiments of the present invention will be described clearly and in detail below with reference to the accompanying drawings in the embodiments of the present invention. The described embodiments are only some of the embodiments of the invention.
本发明解决上述技术问题的技术方案是:The technical scheme that the present invention solves the above-mentioned technical problems is:
本发明基于深度图像,建立了装配环境点云。并根据装配环境反光、缺少纹理的特点,设计了一种点云和视觉特征相结合的RGBD-ICP虚实注册方法,为虚实融合景象的生成提供首要条件。The present invention establishes a point cloud of the assembly environment based on the depth image. According to the characteristics of reflective and lack of texture in the assembly environment, a RGBD-ICP virtual-real registration method combining point cloud and visual features is designed, which provides the first condition for the generation of virtual-real fusion scenes.
算法基本思想和工作流程The basic idea and workflow of the algorithm
算法基本思想和工作流程如图1所示。整个过程分为离线和在线两个阶段完成,在离线阶段,在CAD环境中将参考对象零件三维CAD模型生成三维点云模型,为装配绝对坐标系的建立和后续的虚实注册做准备。为了加快点云配准及装配坐标系建立过程,在此阶段需要对参考对象零件的点云模型进行精简。在在线阶段,采集装配现场视频流并生成点云,利用参考对象点云和装配现场点云之间的配准完成装配绝对坐标系的定义。基于点云的虚实注册在迭代配准过程中需要一个初始配准阶段,合理的初始点云相对位置,能降低迭代次数、减少配准时间,同时避免算法陷入局部最优。本发明采用基于特征点的匹配对 RGBD-ICP配准过程进行初始化,从而完成虚实注册矩阵计算。根据虚实注册矩阵,将零部件三维模型叠加到装配环境中,实现虚拟引导信息在装配环境的注册。The basic idea and workflow of the algorithm are shown in Figure 1. The whole process is completed in two stages, offline and online. In the offline stage, a 3D point cloud model is generated from the 3D CAD model of the reference object part in the CAD environment to prepare for the establishment of the absolute coordinate system of the assembly and the subsequent virtual-real registration. In order to speed up the process of point cloud registration and the establishment of the assembly coordinate system, it is necessary to simplify the point cloud model of the reference object part at this stage. In the online stage, the video stream of the assembly site is collected and the point cloud is generated, and the definition of the absolute coordinate system of the assembly is completed by the registration between the point cloud of the reference object and the point cloud of the assembly site. The virtual-real registration based on point cloud needs an initial registration stage in the iterative registration process. A reasonable relative position of the initial point cloud can reduce the number of iterations, reduce the registration time, and avoid the algorithm from falling into local optimum. The present invention uses feature point-based matching to initialize the RGBD-ICP registration process, thereby completing the virtual-real registration matrix calculation. According to the virtual and real registration matrix, the 3D model of the parts is superimposed into the assembly environment, and the registration of virtual guidance information in the assembly environment is realized.
本发明提出一种基于点云的虚实注册技术。该发明主要包括以下步骤:The invention proposes a virtual-real registration technology based on point cloud. The invention mainly includes the following steps:
1.装配环境点云生成及预处理:1. Assembly environment point cloud generation and preprocessing:
1)点云生成:1) Point cloud generation:
装配环境深度图像经过降噪修复后,将图像中i时刻的每一个像素点 uD=(xd,yd)可以通过式(1)反投影到深度相机空间坐标系。为了对此过程进行加速,利用NVIDIA公司的CUDA并行计算平台,对深度图像中的每一个像素点uD进行并行反投影到相机坐标空间,获得顶点(vertex map),反投影结果为:After the depth image of the assembly environment is repaired by noise reduction, each pixel point u D = (x d , y d ) at time i in the image can be back-projected to the depth camera space coordinate system by formula (1). In order to accelerate this process, the CUDA parallel computing platform of NVIDIA is used to perform parallel back-projection of each pixel point u D in the depth image to the camera coordinate space to obtain a vertex map. The back-projection result is:
Vt(u)=Di(u)Mint_D -1[uD,1] (3)V t (u)=D i (u)M int_D -1 [u D ,1] (3)
式中:where:
Di(u)——i时刻的深度图像;D i (u)——the depth image at time i;
Mint_D——深度相机内部参数。M int_D - Depth camera internal parameters.
同时,每个顶点对应的法向量Nt(u)用相邻投影点通过如下运算获得:At the same time, the normal vector N t (u) corresponding to each vertex is obtained by using the adjacent projection points through the following operations:
Nt(u)=(Vt(x+1,y)-Vt(x,y))×(Vt(x,y+1)-Vt(x,y)) (4)N t (u)=(V t (x+1,y)-V t (x,y))×(V t (x,y+1)-V t (x,y)) (4)
将(2)规范化到单位长度Nt/||Nt||2。三维顶点Vt(u)及顶点对应的法向量Nt(u)形成三维装配环境点云。Normalize (2) to unit length N t /||N t || 2 . The three-dimensional vertex V t (u) and the normal vector N t (u) corresponding to the vertex form a three-dimensional assembly environment point cloud.
2)点云空间索引建立:2) Point cloud spatial index establishment:
上述点云只是目标物体表面点的集合,并不包含点与点之间的几何拓扑关系。为了更高效的实现后文中点云数据配准等运算操作,需要建立点云之间的空间关系。常用的点云空间组织关系有八叉树、规则网格、K维树(K-dimensional tree, Kd-tree)等,本发明采用空间索引Kd-tree进行点云数据结构的建立。The above point cloud is only a collection of surface points of the target object, and does not contain the geometric topology relationship between points. In order to more efficiently realize the operation operations such as point cloud data registration in the following text, it is necessary to establish the spatial relationship between point clouds. Commonly used point cloud spatial organization relationships include octree, regular grid, K-dimensional tree (Kd-tree), etc. The present invention uses the spatial index Kd-tree to establish the point cloud data structure.
Kd-Tree是一棵二叉树,树中存储的是一些K维数据。在一个K维数据集合上构建一棵Kd-Tree代表了对该K维数据集合构成的K维空间的划分。为了说明Kd-Tree的构建过程,以二维数据点为例,假设有六个二维数据点{(2,3),(5,4), (9,6),(4,7),(8,1),(7,2)},数据点位于二维空间中。为了能有效的找到最邻近点,Kd-树采用分治法的思想,所以可以简单地给X,Y两个方向轴编号为 0,1,也即Split={0,1}。Kd-Tree is a binary tree that stores some K-dimensional data. Constructing a Kd-Tree on a K-dimensional data set represents the division of the K-dimensional space formed by the K-dimensional data set. To illustrate the construction process of Kd-Tree, take two-dimensional data points as an example, suppose there are six two-dimensional data points {(2,3), (5,4), (9,6), (4,7), (8,1), (7,2)}, the data points are located in two-dimensional space. In order to effectively find the nearest point, the Kd-tree adopts the idea of divide and conquer, so we can simply number the two axes of X and Y as 0,1, that is, Split={0,1}.
Step1:确定切分点(Split)域值。分别计算上述六个二维数据点X,Y方向上数据的方差最大值,其所对应的维即为Split域的值,所以Split域值首先取0,也就是X轴方向;Step1: Determine the splitting point (Split) domain value. Calculate the maximum variance of the data in the X and Y directions of the above six two-dimensional data points respectively, and the corresponding dimension is the value of the Split field, so the value of the Split field first takes 0, that is, the X-axis direction;
Step2:确定根节点(Node-data)域值。根据X维上的数据2,5,9,4,8,7进行排序,其中值为7,所以Node-data域值为(7,2)。因此该节点的分割超平面就是通过(7,2)点并垂直于Split=0(X轴)的直线,即X=7;Step2: Determine the value of the root node (Node-data) domain. Sort according to the data 2, 5, 9, 4, 8, 7 on the X dimension, where the value is 7, so the Node-data field value is (7, 2). Therefore, the split hyperplane of this node is a straight line passing through the (7,2) point and perpendicular to Split=0 (X axis), that is, X=7;
Step3:确定左子空间和右子空间。分割超平面X=7将整个空间分为两部分, X≤7的部分为左子空间,包含3个节点(2,3),(5,4)和(4,7);X>7的部分为右子空间,包含2个节点(9,6)和(8,1)。Step3: Determine the left subspace and the right subspace. The split hyperplane X=7 divides the entire space into two parts, the part with X≤7 is the left subspace, including 3 nodes (2,3), (5,4) and (4,7); X>7 The part is the right subspace, containing 2 nodes (9,6) and (8,1).
Step4:递归。Kd-tree的构建是一个递归的过程,对左子空间和右子空间内的数据重复根节点的过程就可以得到下一级子节点(5,4)和(9,6)(也就是左右子空间的根节点),同时将空间和数据集进一步细分。如此反复直到空间中只包含一个数据点。六个二维数据点生成的Kd-tree见图2:Step4: Recursion. The construction of Kd-tree is a recursive process. Repeating the process of the root node for the data in the left subspace and the right subspace can get the next level child nodes (5,4) and (9,6) (that is, the left and right subspaces). the root node of the subspace), while further subdividing the space and dataset. And so on until the space contains only one data point. The Kd-tree generated by six 2D data points is shown in Figure 2:
三维空间点云Kd-Tree构建是二维情况的扩展,对于三维Kd-Tree来说,根节点选取X轴,根节点(Node-data)的子节点选取Y轴,子节点的子节点选取 Z轴,这样循环下去。每次均选取对应实例的中位数作为切分点(Split),切分点作为父节点,左右两侧为划分的两个子树。The three-dimensional space point cloud Kd-Tree construction is an extension of the two-dimensional situation. For the three-dimensional Kd-Tree, the root node selects the X axis, the child nodes of the root node (Node-data) select the Y axis, and the child nodes of the child nodes select the Z axis. axis, and so on. Each time, the median of the corresponding instance is selected as the split point (Split), the split point is used as the parent node, and the left and right sides are divided into two subtrees.
3)Kd-Tree的最近邻搜索:3) Nearest neighbor search of Kd-Tree:
在Kd-Tree中进行数据的查找也是点云配准的重要环节,其目的是检索在 Kd-Tree中与查询点距离最近的点云数据。在三维空间中,两个数据点p(x1,x2,x3) 和P(p1,p2,p3)之间的欧氏距离(Euclidian distance)可用式(3)进行表示:Searching for data in Kd-Tree is also an important part of point cloud registration, and its purpose is to retrieve the point cloud data that is closest to the query point in Kd-Tree. In three-dimensional space, the Euclidian distance between two data points p(x 1 ,x 2 ,x 3 ) and P(p 1 ,p 2 ,p 3 ) can be expressed by equation (3):
最邻近查找的基本思路为:The basic idea of nearest neighbor search is:
Step1:进行二叉查找,生成搜索路径。要查询的点顺着搜索路径进行快速搜索,找到最邻近的近似点,也就是叶子节点。Step1: Perform a binary search to generate a search path. The point to be queried is quickly searched along the search path to find the nearest approximate point, that is, the leaf node.
Step2:回溯查找。找到的叶子节点并不一定就是最邻近的,最邻近点应该位于以查询点为圆心且通过叶子节点的圆域内。为了找到真正的最近邻,还需要沿搜索路径反向查找是否有距离查询点更近的数据点,具体过程见文献。Step2: Backtracking search. The found leaf nodes are not necessarily the closest neighbors, and the closest neighbors should be located in the circle with the query point as the center and passing through the leaf nodes. In order to find the true nearest neighbors, it is also necessary to search backwards along the search path to see if there are data points that are closer to the query point. For the specific process, see the literature.
2.装配绝对坐标系建立。2. The assembly absolute coordinate system is established.
将参考对象模型生成绝对坐标系下的点云模型P={p0,p1,p2...pm,n0,n1,n2...nm},其中p0,p1,...pm为模型表面顶点坐标,n0,n1,...nm为顶点对应的法向量。以水泵外壳为对象,Generate a point cloud model P={p 0 , p 1 , p 2 ... p m , n 0 , n 1 , n 2 ... n m } under the absolute coordinate system from the reference object model, where p 0 ,p 1 ,...p m are the vertex coordinates of the model surface, and n 0 ,n 1 ,...n m are the normal vectors corresponding to the vertices. Taking the pump casing as the object,
在装配过程中,在线采集t时刻装配现场深度图像Rt(u)(其中u=(x,y)),并对深度图像Rt(u)采用第二章方法进行降噪修复,获得降噪修复后的深度图像 Dt(u),然后按上述点云生成方法生成三维环境点云X,其中 X={x0,x1,x2...xn,N0,N1,N2...Nn}。将三维环境点云与参考对象模型生成的点云 P={p0,p1,p2...pm,n0,n1,n2...nm}使用迭代最近点(ICP)进行配准,采用图形处理器(GPU)的多线程进行并行运算提高配准速度。为了获得对应配准点,利用 Kd-tree加速匹配搜索,欧氏距离(Euclidian distance)作为匹配度量(见公式3),同时为了尽量减少误匹配点数目,加入法向量特征作为额外限制条件。采用点积dij=<mi,mj>对候选点对法向量进行度量,假如dij大于某一阈值ψ,则认为是对应点,并赋予权值1,表示为:During the assembly process, the depth image R t (u) (where u=(x, y)) of the assembly site is collected online at time t, and the depth image R t (u) is denoised and repaired by the method in Chapter 2, and the reduced Noise-repaired depth image D t (u), and then generate a three-dimensional environment point cloud X according to the above point cloud generation method, where X = {x 0 , x 1 , x 2 ... x n , N 0 , N 1 , N 2 ...N n }. The point cloud P={p 0 , p 1 , p 2 ... p m , n 0 , n 1 , n 2 ... n m } is generated by combining the 3D environment point cloud with the reference object model using the iterative closest point (ICP ) for registration, and multi-threading of a graphics processing unit (GPU) is used to perform parallel operations to improve the registration speed. In order to obtain the corresponding registration points, the Kd-tree is used to speed up the matching search, and the Euclidian distance is used as the matching metric (see Equation 3). At the same time, in order to minimize the number of mismatched points, the normal vector feature is added as an additional constraint. The dot product d ij =<m i ,m j > is used to measure the normal vector of the candidate point. If d ij is greater than a certain threshold ψ, it is considered to be the corresponding point, and a weight of 1 is assigned, which is expressed as:
通过采用欧式距离和法向量等特征度量方法之后,便可获得对应点的个数N 及每一对对应点的权值wi。采用最小二乘法对位置关系误差矩阵进行求解,确定点云X与点云P之间的变换矩阵 After adopting characteristic measurement methods such as Euclidean distance and normal vector, the number N of corresponding points and the weight wi of each pair of corresponding points can be obtained. Use the least squares method to solve the positional relationship error matrix to determine the transformation matrix between the point cloud X and the point cloud P
通过旋转矩阵R和平移向量t的求解,便可完成装配初始绝对坐标系的定义,为后续绝对坐标系下的虚实注册矩阵M的求解做准备。Through the solution of the rotation matrix R and the translation vector t, the definition of the initial absolute coordinate system of the assembly can be completed, and preparations are made for the solution of the virtual and real registration matrix M in the subsequent absolute coordinate system.
3.点云和视觉特征融合的跟踪注册方法。3. Tracking registration method for fusion of point cloud and visual features.
点云和视觉特征融合的跟踪注册示意图如图3所示。首先采集装配环境彩色图像和深度图像,然后采用公式(1)和(2)将深度测量值从二维图像坐标转化到全局坐标空间,生成环境点云。同时利用改进的ORB (Oriented FAST and Rotated BRIEF)算子提取彩色图像中的特征点并进行连续帧间匹配。将匹配的ORB特征点对利用深度信息映射到三维坐标空间,采用随机抽样一致性(RANSAC)进行离群点剔除。当两点间距离小于误差值时,保留此特征点对,否则进行离群值剔除,从而获得初始变换矩阵。将计算获得的变换矩阵和正确匹配点对作为ICP点云配准的初始数据集,从而避免了ICP迭代过程陷入局部最优,同时提高了收敛速度与配准精度。利用回环检测与位姿优化策略对点云配准阶段获得的变换矩阵进行优化,最终结合矩阵Minit获得绝对坐标系下精确的跟踪注册矩阵。A schematic diagram of the tracking registration of point cloud and visual feature fusion is shown in Figure 3. First, the color image and depth image of the assembly environment are collected, and then the depth measurement value is transformed from the two-dimensional image coordinates to the global coordinate space using formulas (1) and (2) to generate the environment point cloud. At the same time, the improved ORB (Oriented FAST and Rotated BRIEF) operator is used to extract the feature points in the color image and perform continuous inter-frame matching. The matched ORB feature point pairs are mapped to the three-dimensional coordinate space using depth information, and outliers are eliminated by random sampling consistency (RANSAC). When the distance between the two points is less than the error value, the feature point pair is retained, otherwise the outliers are eliminated to obtain the initial transformation matrix. The transformation matrix obtained by calculation and the correct matching point pair are used as the initial data set for ICP point cloud registration, thus avoiding the ICP iteration process falling into local optimum, while improving the convergence speed and registration accuracy. The transformation matrix obtained in the point cloud registration stage is optimized by using the loop closure detection and pose optimization strategy, and finally the accurate tracking registration matrix in the absolute coordinate system is obtained by combining the matrix M init .
1)视觉特征提取与匹配:1) Visual feature extraction and matching:
点云和视觉特征融合的跟踪注册的关键步骤是求解深度传感器不同位姿下环境点云数据之间的变换关系。其中迭代最近点算法(ICP)是稳定且高效的方法之一,它能将点云数据匹配问题转换为求解数据集合间距离函数最小化的精确解问题。ICP算法主要分为两步,第一步确定对应数据点集,第二步根据对应点集求解点云数据间的变换关系。正确的初始对应数据点集的获取是ICP算法的首要条件,它是避免算法迭代过程陷入局部最优,保证收敛速度和配准精度的关键。但是当相机快速移动时,ICP配准算法由于无法获取前后两帧点云数据间的初始对应关系,迭代过程容易陷入局部最优。而且当超出深度传感器工作范围(0.15~4m)时,容易造成“丢帧”的情况,导致跟踪注册过程的中断。考虑到深度传感器彩色图像数据和深度图像数据存在一一对应的关系,可将点云的初始匹配问题转化为彩色图像特征点的匹配问题。目前很多局部特征如SIFT、 SURF、ORB、BRISK、FREAK等被广泛应用于图像匹配、物体识别等领域。基于特征点匹配的快速性和稳定性的考虑,本发明采用ORB特征点对作为初始匹配数据点集。但是由于机械产品装配环境或工装表面缺少足够的纹理特征,原始ORB匹配过程难以获得足够数量的匹配点对,且特征点比较集中,不利于保证旋转平移矩阵计算的可靠性。The key step in the tracking registration of point cloud and visual feature fusion is to solve the transformation relationship between the environmental point cloud data under different poses of the depth sensor. Among them, iterative closest point algorithm (ICP) is one of the stable and efficient methods, which can transform the point cloud data matching problem into an exact solution problem that minimizes the distance function between data sets. The ICP algorithm is mainly divided into two steps. The first step is to determine the corresponding data point set, and the second step is to solve the transformation relationship between the point cloud data according to the corresponding point set. Obtaining the correct initial set of corresponding data points is the primary condition of the ICP algorithm. It is the key to avoid the algorithm iteration process falling into local optimum and ensure the convergence speed and registration accuracy. However, when the camera moves rapidly, the ICP registration algorithm is prone to fall into local optimum in the iterative process because it cannot obtain the initial correspondence between the point cloud data of the two frames before and after. Moreover, when it exceeds the working range of the depth sensor (0.15-4m), it is easy to cause a "drop frame" situation, which leads to the interruption of the tracking registration process. Considering that there is a one-to-one correspondence between the color image data of the depth sensor and the depth image data, the initial matching problem of point clouds can be transformed into the matching problem of color image feature points. At present, many local features such as SIFT, SURF, ORB, BRISK, FREAK, etc. are widely used in image matching, object recognition and other fields. Based on the consideration of fastness and stability of feature point matching, the present invention adopts the ORB feature point pair as the initial matching data point set. However, due to the lack of sufficient texture features in the mechanical product assembly environment or tooling surface, it is difficult to obtain a sufficient number of matching point pairs in the original ORB matching process, and the feature points are relatively concentrated, which is not conducive to ensuring the reliability of the rotation-translation matrix calculation.
为了能获取足够数量的正确ORB特征点对作为ICP初始匹配数据点集,本发明需对原始ORB匹配过程进行改进。原始ORB特征匹配算法采用FAST作为特征点检测子,改进的BRIEF作为特征描述子,采用BF(Brute Force)模式匹配算法进行特征描述符匹配。采用原始ORB进行特征提取并采用BF进行描述符匹配的结果。可以看出,原始ORB可以获得足够数量的特征点(9466个),但是匹配点对较少(252个),且其中的误匹配较多。In order to obtain a sufficient number of correct ORB feature point pairs as the ICP initial matching data point set, the present invention needs to improve the original ORB matching process. The original ORB feature matching algorithm uses FAST as the feature point detector, the improved BRIEF as the feature descriptor, and uses the BF (Brute Force) pattern matching algorithm for feature descriptor matching. The result of using the original ORB for feature extraction and BF for descriptor matching. It can be seen that the original ORB can obtain a sufficient number of feature points (9466), but there are fewer matching point pairs (252), and there are more mismatches.
为了消除误匹配,常采用随机抽样一致性检测(RANSAC)算法进行误匹配剔除。采用RANSAC后最终只能获得87个匹配点对,匹配点对数量进一步降低,难以满足ICP初始配准需求。In order to eliminate the mismatch, the random sampling consistency detection (RANSAC) algorithm is often used to eliminate the mismatch. After using RANSAC, only 87 matching point pairs can finally be obtained, and the number of matching point pairs is further reduced, which is difficult to meet the initial registration requirements of ICP.
为了获得足够数量的正确匹配点对,本发明受基于网格的运动统计(GMS) 方法思想启发——运动平滑一致性的匹配点不大可能是随机出现的,匹配点对真假的判别可以通过周围匹配点的简单计数来实现。基于上述思想对OBR特征匹配过程进行改进,本发明称为OGMS,算法思想基于如下假设:In order to obtain a sufficient number of correct matching point pairs, the present invention is inspired by the idea of grid-based motion statistics (GMS) method—the matching points with smooth motion consistency are unlikely to appear randomly, and the matching point pairs can be judged true or false. This is achieved by a simple count of surrounding matching points. Based on the above idea, the OBR feature matching process is improved, the present invention is called OGMS, and the algorithm idea is based on the following assumptions:
假设:正确匹配点对周围邻域内的匹配点对应该具有相同的单位方向向量。Assumption: Matched point pairs in the surrounding neighborhood of correctly matched point pairs should have the same unit direction vector.
设M为某一正确匹配点对邻域内匹配点对连线单位方向向量构成的矩阵:Let M be a matrix composed of unit direction vectors of matching point pairs in the neighborhood of a correct matching point pair:
M=[m1 m2 m3...mn]T (8)M=[m 1 m 2 m 3 ... m n ] T (8)
方向向量mi与mj的相似性用内积dij表示:The similarity between the direction vectors m i and m j is represented by the inner product d ij :
dij=<mi,mj> (9)d ij =<m i ,m j > (9)
方向向量mi(1×2)与匹配点对矩阵中各方向向量的相似度用G表示:Direction vector m i(1×2) and matching point pair matrix The similarity of each direction vector is represented by G:
G=|miMT|/(n-1) (10)G=|m i M T |/(n-1) (10)
将G中所有元素按降序排列,若G中某一元素小于阈值δ,说明所对应的匹配点对的连线方向偏离大部分匹配点对的连线方向,该匹配点对被作为误匹配而被剔除,并采用GMS中的网格划分进行匹配过程中的加速。Arrange all the elements in G in descending order. If an element in G is less than the threshold δ, it means that the connection direction of the corresponding matching point pair deviates from the connection direction of most matching point pairs, and the matching point pair is regarded as a mismatch. are culled, and the meshing in GMS is used to speed up the matching process.
采用上述改进后的ORB进行特征匹配结果。通过改进的ORB对装配环境两相邻视频帧进行特征提取与匹配,正确匹配点数目由原来的87个变为3478个,且该过程耗时较少。视觉特征匹配伪代码见表1。The above improved ORB is used for feature matching results. The improved ORB is used to extract and match the features of two adjacent video frames in the assembly environment. The number of correct matching points is changed from 87 to 3478, and the process takes less time. The visual feature matching pseudocode is shown in Table 1.
表1特征匹配算法伪代码Table 1 Pseudo code of feature matching algorithm
2)融合视觉特征的ICP点云配准:2) ICP point cloud registration fused with visual features:
为了将虚拟装配引导信息在装配环境中准确叠加,需要实时获取绝对坐标系下的跟踪注册矩阵。本部分将通过不同深度图像间点云数据的ICP配准,即对应点云数据间的旋转平移变换关系矩阵求解,以获取当前视角的位置和姿态。为了避免ICP迭代过程陷入局部最优,提高收敛速度与配准精度,同时避免由于相机快速移动造成的跟踪失败问题,通过融合彩色图像中的视觉特征,利用彩色图像数据和深度图像数据间存在一一对应的关系,将点云的初始匹配问题转化为彩色图像特征点的匹配,将计算获得的初始变换矩阵和正确的匹配点对作为ICP点云配准的初始数据集,本发明将此过程称之为RGBD-ICP点云配准,RGBD-ICP点云配准算法伪代码如表2所示。In order to accurately superimpose the virtual assembly guidance information in the assembly environment, it is necessary to obtain the tracking registration matrix in the absolute coordinate system in real time. In this part, the ICP registration of point cloud data between images of different depths, that is, the rotation and translation transformation matrix between the corresponding point cloud data, will be solved to obtain the position and attitude of the current perspective. In order to avoid the ICP iterative process falling into local optimum, improve the convergence speed and registration accuracy, and avoid the problem of tracking failure caused by the rapid movement of the camera, by fusing the visual features in the color image, the existence of a difference between the color image data and the depth image data is used. A corresponding relationship, the initial matching problem of the point cloud is converted into the matching of color image feature points, and the initial transformation matrix obtained by calculation and the correct matching point pair are used as the initial data set for ICP point cloud registration. It is called RGBD-ICP point cloud registration, and the pseudo code of RGBD-ICP point cloud registration algorithm is shown in Table 2.
表2 RGBD-ICP点云配准算法伪代码Table 2 Pseudo code of RGBD-ICP point cloud registration algorithm
首先从装配环境两幅相邻视频帧彩色图像中分别提取ORB(Oriented FAST andRotated BRIEF)特征点集合Fa,Fb,通过改进的ORB特征点匹配算法获得特征点匹配点对集合Cs,Ct。因为ORB特征是在图像上进行提取的,说明在二维空间特征向量存在相似性,但是这并不能说明在三维空间仍然是匹配点对,因为视角的变化会造成空间位置的变化。如果不预先将误匹配点对剔除,而是让其参与变换阵的计算,势必造成利用误匹配点对计算得到的初始变换阵来迭代更新点云变换矩阵,这样会形成一个错误累积。因此本发明首先通过两帧彩色图像对应的深度图像,利用深度传感器的内部参数将匹配点对映射到三维空间形成空间点云集合Ps,Pt。然后利用随机抽样一致性(RANSAC)方法将三维误匹配点对剔除,分别形成内点集合Ps_inliner,Pt_inliner,同时获得初始点云变换矩阵 M'=[R'|t']。First, extract ORB (Oriented FAST and Rotated BRIEF) feature point sets F a , F b from two adjacent video frame color images of the assembly environment respectively, and obtain feature point matching point pair sets C s , C through the improved ORB feature point matching algorithm t . Because the ORB feature is extracted on the image, it shows that there is similarity in the feature vector in the two-dimensional space, but this does not mean that it is still a matching point pair in the three-dimensional space, because the change of the viewing angle will cause the change of the spatial position. If the mismatched point pair is not eliminated in advance, but it participates in the calculation of the transformation matrix, it will inevitably result in the iterative update of the point cloud transformation matrix using the initial transformation matrix calculated from the mismatched point pair, which will form an error accumulation. Therefore, the present invention firstly uses the depth images corresponding to the two frames of color images, and uses the internal parameters of the depth sensor to map the matching point pairs to the three-dimensional space to form a spatial point cloud set P s , P t . Then, the 3D mismatched point pairs are eliminated by random sampling consistency (RANSAC) method to form interior point sets P s_inliner , P t_inliner respectively , and the initial point cloud transformation matrix M'=[R'|t'] is obtained at the same time.
从步骤5开始进入ICP主循环。在第一次迭代中,通过ORB特征点对匹配计算出的初始变换阵M'=[R'|t'],使没有任何先验位姿知识的相邻两帧间点云实现了最近邻初始配准。为了实现点云的进一步精确配准,将点云配准问题转换为求解点云集合间误差函数最小化的精确解问题。将装配环境数据点云间满足误差函数最小的匹配点对作为算法的输入量。不同视角图像间的数据可以看做是多个坐标系间的旋转平移运动,这样我们每做一次旋转平移运动就会更新一次数据,通过反复迭代变换阵更新输入数据从而最小化环境点云数据间的偏移误差函数,不断更新迭代,直到误差满足一定的精度要求。本发明将误差函数分为两个部分,第一部分计算ORB视觉特征匹配点对之间的平均欧氏距离,第二部分计算点云中当前点到目标匹配点切平面(Point-to-Tangent Plane)的距离。点到切平面的点云匹配方法比经典的点到点的匹配方法能产生更准确的配准效果,且迭代收敛速度明显加快。本发明误差函数定义为:Enter the ICP main loop from step 5. In the first iteration, the initial transformation matrix M'=[R'|t'] calculated by ORB feature point pair matching makes the point cloud between two adjacent frames without any prior knowledge of pose realize the nearest neighbor Initial registration. In order to achieve further accurate registration of point clouds, the point cloud registration problem is transformed into an exact solution problem that minimizes the error function between point cloud sets. The matching point pair that satisfies the minimum error function between the assembly environment data point clouds is used as the input of the algorithm. The data between images from different perspectives can be regarded as the rotation and translation motion between multiple coordinate systems, so that each time we do a rotation and translation motion, the data will be updated, and the input data will be updated through repeated iterations of the transformation matrix to minimize the difference between the environmental point cloud data. The offset error function is continuously updated and iteratively updated until the error meets a certain accuracy requirement. The present invention divides the error function into two parts, the first part calculates the average Euclidean distance between pairs of ORB visual feature matching points, and the second part calculates the tangent plane (Point-to-Tangent Plane) between the current point in the point cloud and the target matching point )the distance. The point-to-tangent plane point cloud matching method can produce more accurate registration than the classical point-to-point matching method, and the iterative convergence speed is significantly faster. The error function of the present invention is defined as:
式中:where:
α——为权重值;α—— is the weight value;
——为稠密点云中目标点的法向量,它是通过其周边邻域点作叉乘获得。 —— is the target point in the dense point cloud The normal vector of , which is obtained by the cross product of its surrounding neighborhood points.
为了对ICP配准过程进行加速,利用Kd-tree加速最近点搜索,同时采用图形处理器(GPU)并行运算。在点云变换矩阵误差变化小于阈值δ或者达到最大迭代次数时,ICP主循环停止迭代,否则将会利用最近一次计算的变换矩阵进行点云的重新配准。In order to speed up the ICP registration process, Kd-tree is used to accelerate the nearest point search, and a graphics processing unit (GPU) is used for parallel computing. When the error change of the point cloud transformation matrix is less than the threshold δ or the maximum number of iterations is reached, the ICP main loop stops iterating, otherwise the point cloud will be re-registered using the most recently calculated transformation matrix.
3)回环检测与相机位姿全局优化:3) Loop detection and global optimization of camera pose:
上文采用的连续相邻帧间点云配准是一种较好的短距离跟踪注册方法。然而,相邻两帧之间的配准误差会导致相机位姿的估计随着移动距离的推移而发生漂移,从而导致跟踪注册结果不准确。特别是当相机移动较长距离,最终返回到以前访问过的位置时,这种漂移现象最为明显,这被称为回环问题。为了解决上述问题,需要回环检测来识别相机是否返回到先前访问过的位置。The point cloud registration between consecutive adjacent frames used above is a better short-distance tracking registration method. However, the registration error between two adjacent frames can cause the estimation of the camera pose to drift with the moving distance, resulting in inaccurate tracking registration results. This drift phenomenon is most pronounced especially when the camera moves a long distance, eventually returning to a previously visited location, which is known as the loop closure problem. To address the above issues, loop closure detection is required to identify if the camera has returned to a previously visited location.
以上这些实施例应理解为仅用于说明本发明而不用于限制本发明的保护范围。在阅读了本发明的记载的内容之后,技术人员可以对本发明作各种改动或修改,这些等效变化和修饰同样落入本发明权利要求所限定的范围。The above embodiments should be understood as only for illustrating the present invention and not for limiting the protection scope of the present invention. After reading the contents of the description of the present invention, the skilled person can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811549587.6A CN109960402B (en) | 2018-12-18 | 2018-12-18 | Virtual and real registration method based on point cloud and visual feature fusion |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811549587.6A CN109960402B (en) | 2018-12-18 | 2018-12-18 | Virtual and real registration method based on point cloud and visual feature fusion |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN109960402A true CN109960402A (en) | 2019-07-02 |
| CN109960402B CN109960402B (en) | 2022-04-01 |
Family
ID=67023335
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201811549587.6A Active CN109960402B (en) | 2018-12-18 | 2018-12-18 | Virtual and real registration method based on point cloud and visual feature fusion |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109960402B (en) |
Cited By (23)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110889349A (en) * | 2019-11-18 | 2020-03-17 | 哈尔滨工业大学 | A visual localization method for sparse 3D point cloud images based on VSLAM |
| CN111145268A (en) * | 2019-12-26 | 2020-05-12 | 四川航天神坤科技有限公司 | Video registration method and device |
| CN111216124A (en) * | 2019-12-02 | 2020-06-02 | 广东技术师范大学 | Robot Vision Guidance Method and Device Based on Integrating Global Vision and Local Vision |
| CN111612728A (en) * | 2020-05-25 | 2020-09-01 | 北京交通大学 | A 3D point cloud densification method and device based on binocular RGB images |
| CN112070884A (en) * | 2020-08-29 | 2020-12-11 | 南京翱翔信息物理融合创新研究院有限公司 | A method, system and device for simultaneously realizing three-dimensional reconstruction and AR virtual-real registration |
| CN112258658A (en) * | 2020-10-21 | 2021-01-22 | 河北工业大学 | Augmented reality visualization method based on depth camera and application |
| CN112308776A (en) * | 2020-09-30 | 2021-02-02 | 香港理工大学深圳研究院 | A method to solve the fusion of occluded and incorrectly mapped image sequences and point cloud data |
| CN112381935A (en) * | 2020-09-29 | 2021-02-19 | 西安应用光学研究所 | Synthetic vision generation and multi-element fusion device |
| CN112862870A (en) * | 2020-12-31 | 2021-05-28 | 广东美的白色家电技术创新中心有限公司 | Vehicle point cloud completion method, assembly method, control device and storage medium |
| CN113052883A (en) * | 2021-04-02 | 2021-06-29 | 北方工业大学 | System and method for fusion reality operation navigation registration in large-scale dynamic environment |
| CN113344992A (en) * | 2021-05-31 | 2021-09-03 | 山东大学 | Global point cloud registration method, system, storage medium and equipment |
| CN113593023A (en) * | 2021-07-14 | 2021-11-02 | 中国科学院空天信息创新研究院 | Three-dimensional drawing method, device, equipment and storage medium |
| CN113674574A (en) * | 2021-07-05 | 2021-11-19 | 河南泊云电子科技股份有限公司 | Augmented reality semi-physical complex electromechanical device training system |
| CN114063099A (en) * | 2021-11-10 | 2022-02-18 | 厦门大学 | RGBD-based positioning method and device |
| CN114219717A (en) * | 2021-11-26 | 2022-03-22 | 杭州三坛医疗科技有限公司 | Point cloud registration method, device, electronic device and storage medium |
| CN114529576A (en) * | 2022-01-04 | 2022-05-24 | 重庆邮电大学 | RGBD and IMU hybrid tracking registration method based on sliding window optimization |
| CN114549579A (en) * | 2022-02-07 | 2022-05-27 | 北京三快在线科技有限公司 | A target tracking method and device |
| CN114566272A (en) * | 2021-12-28 | 2022-05-31 | 杭州键嘉机器人有限公司 | Joint registration method, device, equipment and storage medium based on dynamic weight optimization |
| CN114862911A (en) * | 2022-05-05 | 2022-08-05 | 大连理工大学 | A single target tracking method for 3D point cloud based on graph convolution |
| CN115082411A (en) * | 2022-06-30 | 2022-09-20 | 东风汽车有限公司东风日产乘用车公司 | Assembly gap detection method, device, equipment and storage medium |
| CN115690071A (en) * | 2022-11-11 | 2023-02-03 | 江南大学 | An Adaptive Feature Extraction Method for Capsule Endoscopy Images |
| CN117556522A (en) * | 2024-01-10 | 2024-02-13 | 中国建筑西南设计研究院有限公司 | Assembled wood structure building construction method and system based on three-dimensional scanning and BIM |
| CN120374423A (en) * | 2025-06-27 | 2025-07-25 | 南京理工大学 | Hydraulic pump part tracking registration method based on model image joint perception |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102214000A (en) * | 2011-06-15 | 2011-10-12 | 浙江大学 | Hybrid registration method and system for target objects of mobile augmented reality (MAR) system |
| CN102945564A (en) * | 2012-10-16 | 2013-02-27 | 上海大学 | True 3D modeling system and method based on video perspective type augmented reality |
| US20130201291A1 (en) * | 2012-02-08 | 2013-08-08 | Microsoft Corporation | Head pose tracking using a depth camera |
| CN106125907A (en) * | 2016-06-13 | 2016-11-16 | 西安电子科技大学 | A kind of objective registration method based on wire-frame model |
| US20170131085A1 (en) * | 2014-09-10 | 2017-05-11 | Faro Technologies, Inc. | Method for optically measuring three-dimensional coordinates and controlling a three-dimensional measuring device |
-
2018
- 2018-12-18 CN CN201811549587.6A patent/CN109960402B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102214000A (en) * | 2011-06-15 | 2011-10-12 | 浙江大学 | Hybrid registration method and system for target objects of mobile augmented reality (MAR) system |
| US20130201291A1 (en) * | 2012-02-08 | 2013-08-08 | Microsoft Corporation | Head pose tracking using a depth camera |
| CN102945564A (en) * | 2012-10-16 | 2013-02-27 | 上海大学 | True 3D modeling system and method based on video perspective type augmented reality |
| US20170131085A1 (en) * | 2014-09-10 | 2017-05-11 | Faro Technologies, Inc. | Method for optically measuring three-dimensional coordinates and controlling a three-dimensional measuring device |
| CN106125907A (en) * | 2016-06-13 | 2016-11-16 | 西安电子科技大学 | A kind of objective registration method based on wire-frame model |
Non-Patent Citations (1)
| Title |
|---|
| 王欣,袁坤,于晓,章明朝: "基于运动恢复的双目视觉三维重建系统设计", 《光学精密工程》 * |
Cited By (32)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110889349A (en) * | 2019-11-18 | 2020-03-17 | 哈尔滨工业大学 | A visual localization method for sparse 3D point cloud images based on VSLAM |
| CN111216124A (en) * | 2019-12-02 | 2020-06-02 | 广东技术师范大学 | Robot Vision Guidance Method and Device Based on Integrating Global Vision and Local Vision |
| CN111145268A (en) * | 2019-12-26 | 2020-05-12 | 四川航天神坤科技有限公司 | Video registration method and device |
| CN111145268B (en) * | 2019-12-26 | 2023-10-31 | 四川航天神坤科技有限公司 | Video registration method and device |
| CN111612728A (en) * | 2020-05-25 | 2020-09-01 | 北京交通大学 | A 3D point cloud densification method and device based on binocular RGB images |
| CN112070884A (en) * | 2020-08-29 | 2020-12-11 | 南京翱翔信息物理融合创新研究院有限公司 | A method, system and device for simultaneously realizing three-dimensional reconstruction and AR virtual-real registration |
| CN112381935A (en) * | 2020-09-29 | 2021-02-19 | 西安应用光学研究所 | Synthetic vision generation and multi-element fusion device |
| CN112308776A (en) * | 2020-09-30 | 2021-02-02 | 香港理工大学深圳研究院 | A method to solve the fusion of occluded and incorrectly mapped image sequences and point cloud data |
| CN112258658B (en) * | 2020-10-21 | 2023-02-17 | 河北工业大学 | A method and application of augmented reality visualization based on depth camera |
| CN112258658A (en) * | 2020-10-21 | 2021-01-22 | 河北工业大学 | Augmented reality visualization method based on depth camera and application |
| CN112862870A (en) * | 2020-12-31 | 2021-05-28 | 广东美的白色家电技术创新中心有限公司 | Vehicle point cloud completion method, assembly method, control device and storage medium |
| CN113052883B (en) * | 2021-04-02 | 2024-02-02 | 北方工业大学 | Fused reality operation navigation registration system and method in large-scale dynamic environment |
| CN113052883A (en) * | 2021-04-02 | 2021-06-29 | 北方工业大学 | System and method for fusion reality operation navigation registration in large-scale dynamic environment |
| CN113344992B (en) * | 2021-05-31 | 2022-06-28 | 山东大学 | Global point cloud registration method, system, storage medium and equipment |
| CN113344992A (en) * | 2021-05-31 | 2021-09-03 | 山东大学 | Global point cloud registration method, system, storage medium and equipment |
| CN113674574B (en) * | 2021-07-05 | 2023-10-13 | 河南泊云电子科技股份有限公司 | Augmented reality semi-physical complex electromechanical equipment training system |
| CN113674574A (en) * | 2021-07-05 | 2021-11-19 | 河南泊云电子科技股份有限公司 | Augmented reality semi-physical complex electromechanical device training system |
| CN113593023A (en) * | 2021-07-14 | 2021-11-02 | 中国科学院空天信息创新研究院 | Three-dimensional drawing method, device, equipment and storage medium |
| CN113593023B (en) * | 2021-07-14 | 2024-02-02 | 中国科学院空天信息创新研究院 | Three-dimensional drawing method, device, equipment and storage medium |
| CN114063099A (en) * | 2021-11-10 | 2022-02-18 | 厦门大学 | RGBD-based positioning method and device |
| CN114219717A (en) * | 2021-11-26 | 2022-03-22 | 杭州三坛医疗科技有限公司 | Point cloud registration method, device, electronic device and storage medium |
| CN114566272A (en) * | 2021-12-28 | 2022-05-31 | 杭州键嘉机器人有限公司 | Joint registration method, device, equipment and storage medium based on dynamic weight optimization |
| CN114529576A (en) * | 2022-01-04 | 2022-05-24 | 重庆邮电大学 | RGBD and IMU hybrid tracking registration method based on sliding window optimization |
| CN114549579A (en) * | 2022-02-07 | 2022-05-27 | 北京三快在线科技有限公司 | A target tracking method and device |
| CN114862911A (en) * | 2022-05-05 | 2022-08-05 | 大连理工大学 | A single target tracking method for 3D point cloud based on graph convolution |
| CN114862911B (en) * | 2022-05-05 | 2025-01-07 | 大连理工大学 | A 3D point cloud single target tracking method based on graph convolution |
| CN115082411A (en) * | 2022-06-30 | 2022-09-20 | 东风汽车有限公司东风日产乘用车公司 | Assembly gap detection method, device, equipment and storage medium |
| CN115690071A (en) * | 2022-11-11 | 2023-02-03 | 江南大学 | An Adaptive Feature Extraction Method for Capsule Endoscopy Images |
| CN117556522A (en) * | 2024-01-10 | 2024-02-13 | 中国建筑西南设计研究院有限公司 | Assembled wood structure building construction method and system based on three-dimensional scanning and BIM |
| CN117556522B (en) * | 2024-01-10 | 2024-04-02 | 中国建筑西南设计研究院有限公司 | Assembled wood structure building construction method and system based on three-dimensional scanning and BIM |
| CN120374423A (en) * | 2025-06-27 | 2025-07-25 | 南京理工大学 | Hydraulic pump part tracking registration method based on model image joint perception |
| CN120374423B (en) * | 2025-06-27 | 2025-08-22 | 南京理工大学 | A hydraulic pump parts tracking and registration method based on model-image joint perception |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109960402B (en) | 2022-04-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109960402A (en) | A virtual-real registration method based on fusion of point cloud and visual features | |
| CN109544677B (en) | Indoor scene main structure reconstruction method and system based on depth image key frame | |
| Lin et al. | Topology aware object-level semantic mapping towards more robust loop closure | |
| CN107392964B (en) | The indoor SLAM method combined based on indoor characteristic point and structure lines | |
| CN114862949A (en) | Structured scene vision SLAM method based on point, line and surface characteristics | |
| Li et al. | Dense surface reconstruction from monocular vision and LiDAR | |
| Xu et al. | 3D reconstruction method based on second-order semiglobal stereo matching and fast point positioning Delaunay triangulation | |
| CN111402429B (en) | Scale reduction and three-dimensional reconstruction method, system, storage medium and equipment | |
| Guo et al. | Line-based 3d building abstraction and polygonal surface reconstruction from images | |
| Wu et al. | A survey on monocular 3D object detection algorithms based on deep learning | |
| Han et al. | Ro-map: Real-time multi-object mapping with neural radiance fields | |
| Tung et al. | Dynamic surface matching by geodesic mapping for 3d animation transfer | |
| CN114563000A (en) | An indoor and outdoor SLAM method based on improved lidar odometer | |
| CN117253003A (en) | Indoor RGB-D SLAM method integrating direct method and point-plane characteristic method | |
| CN115330861B (en) | Repositioning algorithm based on matching of object plane joint representation and semantic descriptor | |
| Chen et al. | Densefusion: Large-scale online dense pointcloud and dsm mapping for uavs | |
| CN116468786A (en) | A semantic SLAM method based on point-line joint for dynamic environment | |
| Hruby et al. | Handbook on leveraging lines for two-view relative pose estimation | |
| Cao et al. | A tracking registration method for augmented reality based on multi-modal template matching and point clouds | |
| Zhang et al. | A stereo SLAM system with dense mapping | |
| CN118887353A (en) | A SLAM mapping method integrating points, lines and visual labels | |
| Zhu et al. | A survey of indoor 3D reconstruction based on RGB-D cameras | |
| CN118501829A (en) | Non-target camera-radar calibration method based on line segments | |
| Xin et al. | GauLoc: 3D Gaussian Splatting‐based Camera Relocalization | |
| Zhang et al. | Visual localization in 3d maps: Comparing point cloud, mesh, and nerf representations |
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 |