Monocular vision pose measuring method based on point characteristics

文档序号:1626270 发布日期:2020-01-14 浏览:10次 中文

阅读说明:本技术 一种基于点特征的单目视觉位姿测量方法 (Monocular vision pose measuring method based on point characteristics ) 是由 王中宇 李亚茹 程银宝 于 2019-10-29 设计创作,主要内容包括:发明涉及一种基于点特征的单目视觉位姿测量方法,属于单目视觉位姿测量领域,其特征在于:(1)根据共面4个特征点之间的位置关系,分别对平行和相交两种情况进行分析;(2)根据特征点的空间坐标、图像坐标和空间位置关系,推导出世界坐标系中3个坐标轴上的向量变换到摄像机坐标系中的单位向量,进而求解出物体相对于摄像机的初始位姿;(3)用LM算法对初始位姿进行优化,得到最终位姿。上述方法仅需给出任意4个特征点的空间相对位置,其中任意3个特征点不共线,不需要给定其他限制条件,就可求解出物体相对于摄像机的位姿。解决单目视觉位姿求解过程中存在的解不唯一、选解难和解的精度不高等问题。(The invention relates to a monocular vision pose measurement method based on point characteristics, which belongs to the field of monocular vision pose measurement and is characterized in that: (1) according to the position relation among the coplanar 4 characteristic points, analyzing the two conditions of parallel and intersection respectively; (2) deducing vectors on 3 coordinate axes in a world coordinate system to be converted into unit vectors in a camera coordinate system according to the spatial coordinates, the image coordinates and the spatial position relation of the feature points, and further solving the initial pose of the object relative to the camera; (3) and optimizing the initial pose by using an LM algorithm to obtain a final pose. The method can solve the pose of the object relative to the camera only by giving the spatial relative positions of any 4 characteristic points, wherein any 3 characteristic points are not collinear, and other limiting conditions are not required to be given. The method solves the problems that the solution is not unique, the solution is difficult to select, the precision is not high and the like in the monocular vision pose solving process.)

1. A monocular vision pose measurement method based on point features is characterized by comprising the following steps:

the method comprises the following steps: acquiring an image shot by a camera, and calibrating the camera by using a Zhangyingyou calibration method to acquire a parameter matrix in the camera;

step two: extracting any 4 non-coplanar feature points P in the imagei(i ═ 1,2,3,4), and the coordinates { q } of the feature point in the imaging plane coordinate system are calculatedi(xi,yiF), i is 1,2,3,4, and the distance between any two feature points is calculated according to the distance formula between two points: d12=|P1P2|、d23=|P2P3|、d13=|P1P3|、d14=|P1P4|;

Step three: let P1Is the origin of the world coordinate system, OcFor the centroid point, the relative positional relationship between given arbitrary 4 feature points that are not collinear is analyzed: when two straight lines where 4 feature points are located are parallel, a feature point correlation distance factor { k } is definediI ═ 1,2,3,4 }; when two straight lines where the 4 feature points are located are intersected, respectively calculating coordinates of the intersection point of the two straight lines in a world coordinate system and coordinates in an imaging coordinate system;

step four: respectively solve X in world coordinate systemw、Yw、ZwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system11,r21,r31);

Step five: and solving the initial position of the object relative to the camera according to the coordinates of the origin of the world coordinate system in the camera, and optimizing the initial pose by an LM algorithm to obtain the initial posture of the object relative to the camera.

2. The method for monocular vision pose measurement based on point features as claimed in claim 1, wherein given 4 coplanar noncollinear feature points P are analyzedi(i is 1,2,3, 4): p1、P2Straight line P of two points1P2And P3、P4Straight line P of two points3P4Parallel and intersecting.

3. The method for measuring monocular vision pose based on point features as claimed in claim 1, wherein P is the median of the four steps1、P2Straight line P of two points1P2And P3、P4Straight line P of two points3P4When in parallel:

x in world coordinate systemwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system11,r21,r31) Is composed of

Figure FDA0002251021090000011

Z in the world coordinate systemwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system13,r23,r33) Is composed of

Figure FDA0002251021090000012

Y in the world coordinate systemwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system12,r22,r32) Is (r)13,r23,r33)×(r11,r21,r31)。

4. The method for measuring monocular vision pose based on point features as claimed in claim 1, wherein P is the median of the four steps1、P2Straight line P of two points1P2And P3、P4Straight line P of two points3P4When intersecting:

x in world coordinate systemwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system11,r21,r31) Is composed of

Figure FDA0002251021090000021

Z in the world coordinate systemwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system13,r23,r33) Is composed of

Figure FDA0002251021090000022

Y in the world coordinate systemwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system12,r22,r32) Is (r)13,r23,r33)×(r11,r21,r31)。

5. The method for measuring monocular vision pose based on point features as claimed in claim 1, wherein P is the number P in the fifth step1、P2Straight line P of two points1P2And P3、P4Straight line P of two points3P4Parallel time, according to the origin P of the world coordinate system1And solving a rotation matrix R and a translational vector t from the world coordinate system to the camera coordinate system:

Figure FDA0002251021090000023

6. the method for measuring monocular vision pose based on point features as claimed in claim 1, wherein P is the number P in the fifth step1、P2Straight line P of two points1P2And P3、P4Straight line P of two points3P4At the time of intersection, according to world coordinatesOrigin P of the system1And solving a rotation matrix R and a translational vector t from the world coordinate system to the camera coordinate system, wherein the Euler angle of the world coordinate system relative to the initial posture of the camera is as follows:

Figure FDA0002251021090000024

Technical Field

The invention belongs to the field of monocular vision pose measurement, relates to a monocular vision pose measurement method based on point characteristics, and solves the problems of non-unique solution, low resolution difficulty in solution selection, and the like in the monocular vision pose solving process.

Technical Field

The vision measurement technology is a technology which projects an object in a three-dimensional space into a two-dimensional image through a camera based on computer vision and then restores the two-dimensional image into three-dimensional information by means of a mathematical model, and can realize measurement of the geometric dimension of the object, the position, the posture and the like of the object in the space. The position and attitude are simply called pose and are usually represented by 6 degrees of freedom, i.e. 3 rotations and 3 translations between two coordinate systems. Pose measurement is currently widely used in the fields of aerospace, target tracking, augmented reality, automatic navigation, visual servo control, industrial manufacturing, and the like. When the pose is solved, firstly, characteristics such as point characteristics, straight line characteristics, quadratic curve characteristics and the like which are commonly used need to be selected. Algorithms based on linear and curvilinear features are generally evolved from point feature algorithms, so that the study of point features is of great significance.

The pose estimation problem based on the Point features is also called a PnP (coherent-n-Point) problem. The scholars at home and abroad carry out a great deal of research on the problem, mainly focus on the number n of points and the algorithm thereof, and the initial conclusion is that when n is less than 3, the PnP problem has infinite solutions; when n is 3, the PnP problem has 4 solutions at most, and if a triangle formed by 3 points is an isosceles triangle and the camera is in a specific area, the PnP problem has a unique solution; when n is 4, if the 4 points are coplanar, the PnP problem has a unique solution, and if the 4 points are not coplanar, the PnP problem has 4 solutions at most; when n is 5, the PnP problem has a maximum of 2 solutions; when n >5, the PnP problem has a unique solution, but the form of the solution is not closed, so the algorithm for solving has limitations. In addition, according to coplanar 4 feature points in quadrilateral distribution, methods for solving pose by using corresponding geometric relations are also applied, but the method has the defects of difficult feature point extraction, non-unique solution, poor robustness, non-convergence of iteration results and the like, and in an actual measurement scene, the feature points are often unknown, and at the moment, the feature point extraction precision has great influence on the precision of pose solution.

Aiming at the problems, the invention provides a monocular vision pose measuring method based on point characteristics, which solves the pose of an object relative to a camera by utilizing the known characteristic of the relative positions of the given 4 non-collinear characteristic points according to the spatial relative positions of the arbitrary non-collinear 4 characteristic points without the conditions of giving an included angle formed by a connecting line of the characteristic points and an optical center, giving the distance from the optical center to the characteristic points, limiting the distribution of the 4 characteristic points in a rectangular or special shape and the like.

Disclosure of Invention

The invention aims to: the method for measuring the monocular vision pose based on the point features is provided, and aims at the problems that solutions are not unique, the solutions are difficult to select, the accuracy is not high and the like in the monocular vision pose solving process.

The invention belongs to the field of monocular vision pose measurement, relates to a monocular vision pose measurement method based on point characteristics, and solves the problems of non-unique solution, low resolution difficulty in solution selection, and the like in the monocular vision pose solving process.

The technical solution of the invention is as follows: a monocular vision pose measurement method based on point characteristics is realized by the following steps:

the method comprises the following steps: acquiring an image shot by a camera, and calibrating the camera by using a Zhangyingyou calibration method to acquire a parameter matrix in the camera;

step two: extracting any 4 non-coplanar feature points P in the imagei(i ═ 1,2,3,4), and the coordinates { q } of the feature point in the imaging plane coordinate system are calculatedi(xi,yiF), i is 1,2,3,4, and the distance between any two feature points is calculated according to the distance formula between two points: d12=|P1P2|、d23=|P2P3|、d13=|P1P3|、d14=|P1P4|;

Step three: let P1Is the origin of the world coordinate system, OcFor the centroid point, the relative positional relationship between given arbitrary 4 feature points that are not collinear is analyzed: when two straight lines where 4 feature points are located are parallel, a feature point correlation distance factor { k } is definediI ═ 1,2,3,4 }; when two straight lines where the 4 feature points are located are intersected, respectively calculating coordinates of the intersection point of the two straight lines in a world coordinate system and coordinates in an imaging coordinate system;

step four: respectively solve X in world coordinate systemw、Yw、ZwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system11,r21,r31);

Step five: and solving the initial position of the object relative to the camera according to the coordinates of the origin of the world coordinate system in the camera, and optimizing the initial pose by an LM algorithm to obtain the initial posture of the object relative to the camera.

Analyzing the given relative position relation of 4 characteristic points in the third step and the fourth step to solve the X in the world coordinate systemw、Yw、ZwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system11,r21,r31) The specific implementation process is as follows:

according to 4 coplanar characteristic points P with 3 arbitrary points not collineari(i is 1,2,3,4) for P1、P2Straight line P of two points1P2And P3、P4Straight line P of two points3P4The two conditions of parallel and intersection are respectively analyzed:

(1) when P is present1P2And P3P4When parallel to each other

Let P1Is the origin of the world coordinate system, OcIs a light center point, point Oc、q3、q4The determined plane is pi1Point of, Oc、q1、q2The determined plane is pi2Point of, OcTo the target feature point Pi(i is 1,2,3,4) and the distance to the image point qiThe distance ratios of (i ═ 1,2,3,4) are ki=|OcPi|/|Ocqi|(i=1,2,3,4)。

According to the vector

Figure BDA0002251021100000021

Calculating a parameter matrix in the camera to obtain a plane pi1Normal vector of

Figure BDA0002251021100000022

Due to the straight line P1P2And a straight line P3P4In parallel, the equation can be derived:

from | P1P2|=d12The equation can be found:

Figure BDA0002251021100000031

simultaneous equations (1) and (2) are solved:

in the same way, according to | P3P4|=d34Obtaining by solution:

therefore, X in the world coordinate systemwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system11,r21,r31) Is composed of

Figure BDA0002251021100000034

ZwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system13,r23,r33) Is composed ofYwTransformation of on-axis vectors to unit vectors (r) in the camera coordinate system12,r22,r32) Is (r)13,r23,r33)×(r11,r21,r31)。

So as to obtain a rotation matrix R from the world coordinate system to the camera coordinate system as follows:

Figure BDA0002251021100000036

from P1The translation vector from the world coordinate system to the camera coordinate system is known as the origin of the world coordinate system

Figure BDA0002251021100000037

(2) When P is present1P2And P3P4At the time of intersection

Let P3P4And P1P2Intersect at a point P0According to given 4 feature points Pi(i ═ 1,2,3,4) coordinates in the world coordinate system to give P0Coordinates in the world coordinate system, point P0Set as the origin of the world coordinate system, P0The projected point in the image coordinate system is q0(x0,y0F), respectively let | P0P1|=d01、|P0P2|=d02、|P0P3|=d03、|P0P4|=d04、|P0P5|=d05. According to the projection point qi(xi,yiF) (i ═ 0,1,2,3,4) to give ∠ P1OcP0、∠P2OcP1、∠P2OcP0、∠P4OcP0、∠P4OcP3And ∠ P3OcP0

At Δ OcP0P2And Δ OcP0P1In, from the sine theorem we can get:

Figure BDA0002251021100000039

solution point P0Coordinates in the camera coordinate system

Figure BDA00022510211000000310

Comprises the following steps:

Figure BDA00022510211000000311

in a similar manner, at Δ OcP0P2And Δ OcP1P2In, the point P is solved by the sine theorem2Coordinates in the camera coordinate systemComprises the following steps:

Figure BDA0002251021100000042

at Δ OcP0P3And Δ OcP3P4In, the point P is solved by the sine theorem3Coordinates in the camera coordinate system

Figure BDA0002251021100000043

Comprises the following steps:

Figure BDA0002251021100000044

then there are:

Figure BDA0002251021100000045

the rotation matrix R and translation vector t from the world coordinate system to the camera coordinate system are solved according to equations (8) and (9). Then, when cos β ≠ 0, knowing the rotation matrix R, solving to obtain a corresponding euler angle as:

Figure BDA0002251021100000047

in summary, starting from 4 feature points with different distributions, a unique pose solution can be obtained by distance and angle constraints and corresponding geometric relationships.

Drawings

FIG. 1 is a flow chart of a monocular vision pose measurement method based on point features according to the present invention;

FIG. 2 is a diagram of a point feature-based monocular vision pose measurement method of the present invention1P2And P3P4A pose measurement schematic diagram in parallel;

FIG. 3 is a diagram of a point-feature-based monocular vision pose measurement method of the present invention1P2And P3P4A pose measurement schematic diagram at the time of intersection;

Detailed Description

The invention is further illustrated by the following figures and examples.

The invention provides a monocular vision pose measurement method based on point features, and provides a monocular vision pose measurement algorithm based on point features aiming at the problems that solutions are not unique, the solutions are difficult to select, the accuracy is not high and the like in the pose solving process.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于三维激光扫描的建筑物外立面测量方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!