Research Group on Visual Computation

Robust Absolute and Relative Pose Estimation of a Central Camera System from 2D-3D Line Correspondences

Icon of project Related projects: Multi-view Pose Estimation from Line Correspondences

Description

This page contains the proposed algorithm code to estimate the absolute and relative pose of a camera system composed of general central projection cameras such as perspective and omnidirectional cameras. The algorithm has been validated on a large synthetic dataset as well as real data. Experimental results confirm the stable and real-time performance under realistic outlier ratio and noise on the line parameters. Comparative tests show that our method compares favorably to the latest state of the art algorithms.

Files

All the codes are released under the GNU General Public License and contain the methods described in our [1] publication, you can download the full test environment here: code

    The Direct Least Squares Solver and the Minimal Solver
  • To run the Direct Least Squares Solver call: [Poses] = Cayley_LS_solver(input,camNum,lineNum,type);

  • To run the Direct Least Squares Solver for one camera and get back all the valide solutions sorted based on the line backprojection error call: [Poses] = Cayley_LS_solver_all(input,lineNum,type);


  • To run the Minimal Solver call: [Poses] = Cayley_Mini_solver(input,camNum,type);

  • To run the Minimal Solver for one camera and and get back all the valide solutions sorted based on the line backprojection error call: [Poses] = Cayley_Mini_solver_all(input,type);

  • Example input: input: Data for 3 cameras (2 perspective + Omnidirectional) and 60 2D-3D line correspondances

    RANSAC demo
  • To run the solver in a RANSAC way call: [poses] = Cayley_RANSAC(input,lineNum,camNum,type,threshold);

  • Example input: input for the RANSAC demo, the example data has 3 cameras (perspective, perspective and omnidirectional) and 120 lines (60 lines/120 are outliers). 'threshold' is the backprojection value that separate the inliers from the outliers

Input parameters:

  1. input.Camera(:).Line.start = normalized coordinates on the unit sphere of the image line segment startpoints
  2. input.Camera(:).Line.end = normalized coordinates on the unit sphere of the image line segment endpoints
  3. input.line3D.start = start points of the 3D line segments in thw world coordinate system
  4. input.line3D.end = end points of the 3D line segments in the world coordinate system
  5.  
  6. type = referring to the solver generator used in [1] to generate the solver, it can be 1 or 2
    1 : calling the solver generated with the Matlab automatic generator of Kukelova et al.
    2 : calling the solver generated with the c++ solver generator of Kneip ( we used mex to be able to run it from Matlab)
    Please check reference 18 and 16 in [1]
  7. camNum= number of camera.
  8. lineNum= number of 2D-3D line pairs to be used
  9. threshold= only for RANSAC:is the line backprojection threshold that separate the inliers from the outliers
NOTE :
  • The algorithm expects the normalized coordinates of the endpoints on the unit sphere, it means that if our camera is a calibrated perspective camera and we have a 2D homogenous coordinate 'x' then the coordinate of the unit sphere is obtained as follow:
    temp = inv(K) * x;
    x_sphere = temp / norm(temp);
  • We filter out the bad solution using the backprojection error function and geometric constraints that the camera should face the scene. for this, we assumed that the camera is looking for the z+

Output:
poses : a cell which contains a list of poses of 4*4 matrix
poses{1} acts from the world coordinate system to the reference camera ('Absolute pose').
poses{2:camNum} acts from the reference camera to the other cameras ('Relative Poses').
Note that the output poses are already denormalized to the original world
coordinate system

Please cite our [1] publication whenever you use the implementation.

Publications to cite:
  1. Hichem Abdellali, Robert Frohlich, Zoltan Kato, Robust Absolute and Relative Pose Estimation of a Central Camera System from 2D-3D Line Correspondences, In Proceedings of ICCV Workshop on Computer Vision for Road Scene Understanding and Autonomous Driving, Seoul, Korea, 2019. [bibtex]

Hichem Abdellali has been awarded the Doctor of Philosophy (PhD.) degree...

2022-04-30


Hichem Abdellali has been awarded the KÉPAF Kuba Attila prize...

2021-06-24