Disclosure of Invention
In view of the defects in the prior art, the present invention provides a method and a system for calculating a low-dimensional bundle adjustment. The invention expresses the depth of field of the multiple views as a function of relative motion parameters of every two views, realizes the direct recovery of the motion parameters from the multiple views, and then obtains the three-dimensional scene point coordinates from the analysis of the motion parameters.
The invention provides a low-dimensional bundle adjustment calculation method, which comprises the following steps:
step 1: determining an initial value of the motion parameter;
step 2: performing minimum calculation on the objective function of the motion parameters to obtain optimized motion parameters;
and step 3: and calculating the coordinates of the three-dimensional scene points according to the optimized motion parameters.
Preferably, the step 1 comprises the steps of:
step 1.1: for a dual-view image formed by the jth view and the jth view +1, j is 1, 2.. and n-1, image feature points corresponding to the common matching feature point set { j, j +1} on the dual-view image are solved by adopting a direct linear transformation algorithm (R) to solve the relative pose (R) of the jth view +1 relative to the jth viewj,j+1,tj,j+1);
Wherein:
n is the number of views participating in bundle adjustment;
Rj,j+1the relative posture of the j +1 th view relative to the j view is shown;
tj,j+1is a unit relative displacement vector of the j +1 th view relative to the jth view, i.e. | tj,j+1||=1;
Calculating the three-dimensional coordinates of the ith matching image point pair corresponding to the common matching feature point set { j, j +1} in the jth view coordinate system
And the three-dimensional coordinates of the ith matching image point pair corresponding to the common matching feature point set { j, j +1} in the j +1 view coordinate system
Wherein:
i=1,2,...,m(j,j+1);
m(j,j+1)representing the number of matched image point pairs in the dual view formed by the jth view and the jth +1 th view;
normalized image point coordinates of an ith matching image point pair corresponding to the public matching feature point set { j, j +1} on a jth view;
normalized image point coordinates of an ith matching image point pair corresponding to the public matching feature point set { j, j +1} on a j +1 th view;
representing the three-dimensional coordinates of the ith matching image point pair corresponding to the public matching feature point set { j, j +1} in the jth view coordinate system;
representing the three-dimensional coordinates of the ith matching image point pair corresponding to the public matching feature point set { j, j +1} in the j +1 view coordinate system;
step 1.2: fixed | | | T1,21, |; for the three views of j-1, j-1 and j +1, j is 2,3Calculating the scale of relative displacement | | | T by using a point set { j-1, j, j +1}, and calculatingj,j+1||/||Tj-1,j| | obtaining a relative displacement vector T with uniform dimensionj,j+1:
Tj,j+1=||Tj,j+1||tj,j+1;
Wherein:
T1,2is the relative displacement vector of the 2 nd view relative to the 1 st view;
Tj,j+1a relative displacement vector of the j +1 th view relative to the j view;
Tj-1,jis the relative displacement vector of the jth view relative to the jth-1 view;
m(j-1,j,j+1)representing the number of common matching image point pairs in three views consisting of the j-1 th view, the j +1 th view and the j +1 th view;
representing three-dimensional coordinates of an ith matching image point pair corresponding to the common matching feature point set { j-1, j } on the jth view and the jth view in a jth view coordinate system;
representing three-dimensional coordinates of an ith matching image point pair corresponding to a common matching feature point set { j, j +1} on jth and jth +1 views in a jth view coordinate system;
tj,j+1a unit relative displacement vector of the j +1 th view relative to the j view;
step 1.3: according to absolute pose (R) of jth viewj,Tj) And calculating to obtain the absolute pose (R) of the j +1 th viewj+1,Tj+1):
Rj+1=Rj,j+1Rj
Tj+1=Tj,j+1+Rj,j+1Tj
Wherein:
Rjrepresenting the absolute pose of the jth view;
Rj+1represents the absolute pose of the j +1 th view;
Rj,j+1the relative posture of the j +1 th view relative to the j view is shown;
Tjan absolute displacement vector representing the jth view;
Tj+1absolute displacement vector representing the j +1 th view;
Tj,j+1a relative displacement vector of the j +1 th view relative to the j view;
when referring to the first view:
(R1,t1)≡(I3,03×1)
wherein:
R1representing an absolute pose of the first view;
T1an absolute displacement vector representing the first view;
I3representing a 3-dimensional identity matrix;
03×1a zero matrix of 3 rows and 1 column is shown.
Preferably, in step 2, the objective function of the motion parameter is specifically as follows:
motion parameter θ ═ (R)j,Tj)j=1,2,...nThe minimization objective function δ (θ) of (d) is given as follows:
e3=[0 0 1]T
wherein:
theta represents the set of absolute pose parameters for all views;
δ (·) represents the minimization objective function;
m(j,k)representing the number of matched image point pairs in the double view formed by the jth view and the kth view;
normalized image point coordinates of an ith matched image point corresponding to the common matched feature point set { j, k } on the jth view and the kth view;
normalized image point coordinates of the ith matched image point corresponding to the common matched feature point set { j, k } on the jth view and the kth view on the jth view;
Rj,kthe relative posture of the kth view relative to the jth view is taken;
Tj,kis the relative displacement vector of the kth view relative to the jth view.
Preferably, the motion parameter θ given in step 2 is (R ═ R)j,Tj)j=1,2,...nThe premise of minimizing the objective function δ (θ) is: the same three-dimensional scene point is equidistant from the same view.
Preferably, the step 3 comprises the steps of:
the motion parameter theta (R) obtained by optimizationj,Tj)j=1,2,...nFor the double-view composed of the jth view and the kth view, the coordinates of the three-dimensional scene point are calculated in a weighted manner as follows:
Tj,k=Tk-Rj,kTj
wherein:
Xithree-dimensional coordinates representing the ith three-dimensional scene point, XiCorresponding to the s-th image feature point in the double view formed by the jth view and the kth view;
representing the ith three-dimensional scene point X
iWhether an identification function is visible in the dual view formed by the jth and kth views, i.e. when X is
iWhen visible in this double view the image is,
otherwise, then
RjRepresenting the absolute pose of the jth view;
Tj,ka relative displacement vector of the kth view relative to the jth view;
representing the coordinates of the normalized image point of the s-th matched image point corresponding to the common matched feature point set { j, k } on the j-th view;
representing the common set of matching feature points { j, k }The coordinates of the normalized image point of the s-th matched image point pair on the k-th view;
Rkrepresenting the absolute pose of the kth view;
Tjan absolute displacement vector representing the jth view;
Tkan absolute displacement vector representing the kth view;
Rj,krepresenting the relative pose of the kth view with respect to the jth view;
Tj,krepresenting the relative displacement vector of the kth view with respect to the jth view.
Preferably, the low-dimensional bundle adjustment calculation method considers the situation that the camera is calibrated, and assumes that matching image point pairs between the views have been determined.
According to the present invention, a low-dimensional bundle adjustment calculation system includes a computer readable storage medium storing a computer program, and the computer program, when executed by a processor, implements the steps of the low-dimensional bundle adjustment calculation method described above.
Compared with the prior art, the invention has the following beneficial effects:
the invention is a low-dimensional cluster adjustment method with simple and convenient initialization, good Lu bang property, higher calculation speed and higher calculation precision. The invention can be used as a core calculation engine for unmanned vehicle/unmanned aerial vehicle visual navigation, visual three-dimensional reconstruction, augmented reality and other applications.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
The invention represents the depth of field as a function of the motion parameters, thereby eliminating the three-dimensional scene point coordinates from the parameter optimization process of cluster adjustment. For the case of m three-dimensional scene points and n views, the parameter space is 6 x n dimensions. Compared with the current mainstream method, the bundling adjustment method provided by the invention greatly reduces the dimensionality of the parameter space.
The present invention considers the situation where the camera is calibrated and assumes that matching pairs of image points between the views have been determined.
The following definitions are illustrative of the general forms of the formulae:
assuming n as the number of views for bundle adjustment, numbered sequentially view 1, view 2, … view n;
(Ri,Ti) Representing the absolute pose of the ith view;
Rirepresenting the absolute pose of the ith view;
Ti=||Ti||tian absolute displacement vector representing the ith view;
tithe unit absolute displacement vector representing the ith view, i.e. | ti||=1;
Theta represents the set of absolute pose parameters for all views;
representing the relative pose of the kth view with respect to the jth view;
Tj,k≡Tk-RjkTjrepresenting a relative displacement vector of the kth view relative to the jth view;
Tj,k=||Tj,k||tj,k,tj,kis a unit relative displacement vector of the kth view relative to the jth view, namely | | tj,k||=1;
(Rj,k,tj,k) Represents the k-th webRelative pose of view with respect to jth view;
{ j } represents all feature point sets on the jth view;
{ j, k } represents a common set of matching feature points on the jth and kth views, { j, k. } and so on, representing common sets of matching feature points on more than three views;
(j, k) represents a dual view composed of the jth view and the kth view;
m(j,k)representing the number of matched image point pairs in the double view formed by the jth view and the kth view;
the coordinates of the ith matching image point in the double views respectively consisting of the jth view and the kth view are normalized image point coordinates on the jth view and the kth view, namely the coordinates of the image point after calibration are obtained in the first two components, and the coordinate of the image point after calibration is obtained in the third component, namely 1.
The invention provides a low-dimensional bundling adjustment method, which comprises the following steps:
step 1: determining an initial value of the motion parameter;
step 2: performing minimum calculation on the objective function of the motion parameters to obtain optimized motion parameters;
and step 3: and calculating the coordinates of the three-dimensional scene points according to the optimized motion parameters.
The respective steps will be described in detail below.
The step 1 comprises the following steps:
step 1.1: for a double-view image formed by the jth view and the jth +1 th view, j is 1, 2.. and n-1, image feature points corresponding to a common matching feature point set { j, j +1} on the double-view image are solved by adopting a Direct Linear Transformation (DLT) algorithm to solve the relative pose (R) of the jth +1 th view relative to the jth viewj,j+1,tj,j+1);
Wherein:
n is the number of views participating in bundle adjustment;
Rj,j+1the relative posture of the j +1 th view relative to the j view is shown;
tj,j+1is a unit relative displacement vector of the j +1 th view relative to the jth view, i.e. | tj,j+1||=1;
Calculating the three-dimensional coordinates of the ith matching image point pair corresponding to the common matching feature point set { j, j +1} in the jth view coordinate system
And the three-dimensional coordinates of the ith matching image point pair corresponding to the common matching feature point set { j, j +1} in the j +1 view coordinate system
Wherein:
i=1,2,...,m(j,j+1);
m(j,j+1)representing the number of matched image point pairs in the dual view formed by the jth view and the jth +1 th view;
normalized image point coordinates of an ith matching image point pair corresponding to the public matching feature point set { j, j +1} on a jth view;
normalized image point coordinates of an ith matching image point pair corresponding to the public matching feature point set { j, j +1} on a j +1 th view;
representing the three-dimensional coordinates of the ith matching image point pair corresponding to the public matching feature point set { j, j +1} in the jth view coordinate system;
representing the three-dimensional coordinates of the ith matching image point pair corresponding to the public matching feature point set { j, j +1} in the j +1 view coordinate system;
step 1.2: without loss of generality, | T is fixed1,21, |; for a three-view composed of a j-1 th view, a j-1 th view and a j +1 th view, j is 2,3j,j+1||/||Tj-1,j| | obtaining a relative displacement vector T with uniform dimensionj,j+1:
Tj,j+1=||Tj,j+1||tj,j+1;
Wherein:
T1,2is the relative displacement vector of the 2 nd view relative to the 1 st view;
Tj,j+1a relative displacement vector of the j +1 th view relative to the j view;
Tj-1,jis the relative displacement vector of the jth view relative to the jth-1 view;
m(j-1,j,j+1)representing the number of common matching image point pairs in three views consisting of the j-1 th view, the j +1 th view and the j +1 th view;
representing the three-dimensional coordinates of the ith matching image point pair corresponding to the common matching feature point set { j-1, j } on the jth view and the jth view in the jth view coordinate system;
Representing three-dimensional coordinates of an ith matching image point pair corresponding to a common matching feature point set { j, j +1} on jth and jth +1 views in a jth view coordinate system;
tj,j+1a unit relative displacement vector of the j +1 th view relative to the j view;
step 1.3: according to absolute pose (R) of jth viewj,Tj) And calculating to obtain the absolute pose (R) of the j +1 th viewj+1,Tj+1):
Rj+1=Rj,j+1Rj
Tj+1=Tj,j+1+Rj,j+1Tj
Wherein:
Rjrepresenting the absolute pose of the jth view;
Rj+1represents the absolute pose of the j +1 th view;
Rj,j+1the relative posture of the j +1 th view relative to the j view is shown;
Tjan absolute displacement vector representing the jth view;
Tj+1absolute displacement vector representing the j +1 th view;
Tj,j+1a relative displacement vector of the j +1 th view relative to the j view;
when referring to the first view:
(R1,t1)≡(I3,03×1)
wherein:
R1representing an absolute pose of the first view;
T1an absolute displacement vector representing the first view;
I3representing a 3-dimensional identity matrix;
03×1a zero matrix representing 3 rows and 1 columns;
it should be noted that:
in step 1.1, j has the value j 1, 2.., n-1;
in step 1.2, j has the value j 2, 3.
In step 1.3, j has the value j 1, 2.
In step 2, the objective function of the motion parameter is specifically as follows:
on the premise that the distances from the same three-dimensional scene point to the same view are equal, the motion parameter θ is equal to (R)j,Tj)j=1,2,...nThe minimization objective function δ (θ) of (d) is given as follows:
e3=[0 0 1]T
wherein:
theta represents the set of absolute pose parameters for all views;
δ (·) represents the minimization objective function;
m(j,k)representing the number of matched image point pairs in the double view formed by the jth view and the kth view;
normalized image point coordinates of an ith matched image point corresponding to the common matched feature point set { j, k } on the jth view and the kth view;
normalized image point coordinates of the ith matched image point corresponding to the common matched feature point set { j, k } on the jth view and the kth view on the jth view;
Rj,kthe relative posture of the kth view relative to the jth view is taken;
Tj,ka relative displacement vector of the kth view relative to the jth view;
since the initial value of the motion parameter obtained in step 1 is already optimized in step 2, and the optimized value of the motion parameter is obtained, step 3 is performed according to the optimized value of the motion parameter. Specifically, the step 3 includes the following steps:
the motion parameter theta (R) obtained by optimizationj,Tj)j=1,2,...nFor the double-view composed of the jth view and the kth view, the coordinates of the three-dimensional scene point are calculated in a weighted manner as follows:
Tj,k=Tk-Rj,kTj
wherein:
Xithree-dimensional coordinates representing the ith three-dimensional scene point, XiCorresponding to the s-th image feature point in the double view formed by the jth view and the kth view;
representing the ith three-dimensional scene point X
iWhether or not a mark is visible in a dual view formed by a jth view and a kth viewIdentification function, i.e. when X
iWhen visible in this double view the image is,
otherwise, then
RjRepresenting the absolute pose of the jth view;
Tj,ka relative displacement vector of the kth view relative to the jth view;
representing the coordinates of the normalized image point of the s-th matched image point corresponding to the common matched feature point set { j, k } on the j-th view;
representing the coordinates of the normalized image points of the s-th matched image point pair corresponding to the common matched feature point set { j, k } on the k-th view;
Rkrepresenting the absolute pose of the kth view;
Tjan absolute displacement vector representing the jth view;
Tkan absolute displacement vector representing the kth view;
Rj,krepresenting the relative pose of the kth view with respect to the jth view;
Tj,krepresenting the relative displacement vector of the kth view with respect to the jth view.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.