A fast minimal solver for absolute camera pose with unknown focal length and radial distortion from four planar points

# A fast minimal solver for absolute camera pose with unknown focal length and radial distortion from four planar points

Centre for Mathematical Sciences
Lund University
Lund, Sweden
magnuso@maths.lth.se
###### Abstract

In this paper we present a fast minimal solver for absolute camera pose estimation from four known points that lie in a plane. We assume a perspective camera model with unknown focal length and unknown radial distortion. The radial distortion is modelled using the division model with one parameter. We show that the solutions to this problem can be found from a univariate six-degree polynomial. This results in a very fast and numerically stable solver.

## 1 Introduction

The camera pose estimation problem is a classic problem in computer vision. Given a number of known 3D-points, and their projections in a camera, the object is to estimate the pose of the camera, i.e. the location and viewing direction. Different number of 3D-points and different knowledge of the calibration of the camera will give different problems. We will in this paper give a solution to one such special pose problem, namely camera pose estimation from four coplanar 3D-points, where the unknown radial distortion and unknown focal length of the camera are also estimated. This was one of the problems studied and solved in . In this paper we will present a simpler solution, that gives a faster solver.

## 2 Parametrization of the problem

We will use the same parametrization that was described in , and we include the derivations here for completeness. We have four given 3D-points, that all lie in a plane. We can without loss generality assume that these lie in the plane . This means that we represent our 3D-points in homogeneous coordinates as

 Ui=⎡⎢⎣XiYi1⎤⎥⎦,i=i=1,…,4. (1)

Since we have dropped the third coordinate of our points, we simply remove the third column in the camera matrix in our projection equation. We have a calibrated camera with unknown focal length, , i.e.

 P=⎡⎢⎣10001000w⎤⎥⎦⎡⎢⎣r11r12txr21r22tyr31r32tz⎤⎥⎦, (2)

where . Using the division model for radial distortion , our undistorted image coordinate can be represented in homogeneous coordinates as

 ui=⎡⎢⎣xiyi1+kr2i⎤⎥⎦,i=1,…,4, (3)

where . This gives us the following projection equations

 λiui=PUi,i=1,…,4. (4)

Taking the cross-product with with eliminates the unknown depths ,

 ui×PUi=0,i=1,…,4. (5)

This gives for each point three constraints, out of which only two are linearly independent. The third such constraint for each point is special in the sense that it neither involves the unknown radial distortion parameter nor the focal length parameter . If we take these constraints using all four points we get four linear constraints on the six elements of the first two rows of . Since the scale of the camera is arbitrary we can write the first two rows of using a single unknown . The second row of (5) is

 (1+kr2i)(p11Xi+p12Yi+p14)−xi(p31Xi+p32Yi+p34)=0 (6)

The elements from the first row of are already parametrized with . In addition we have elements from the third row of . We now use three of the constraints in (5) and write them as

 C3×3⎡⎢⎣p31p32p34⎤⎥⎦=D3×4⎡⎢ ⎢ ⎢⎣βkβk1⎤⎥ ⎥ ⎥⎦, (7)

where and only depends on known data. If , and are not collinear we can express the elements in as

 ⎡⎢⎣p31p32p34⎤⎥⎦=C−1D⎡⎢ ⎢ ⎢⎣βkβk1⎤⎥ ⎥ ⎥⎦. (8)

The first two columns of are from scaled rotation matrix, and they must hence be orthogonal and of equal length. We can express these two constraints using the elements of by introducing the two vectors and as

 f1 =vT1v2=0, (9) f2 =vT1v1−vT2v2=0. (10)

These two equations together with the fourth constraint (which we denote ) from (5) give us the three equations needed to solve for the unknown , and . In  they solved this system using the action matrix method. In the next section we will show how we can find a univariate polynomial in

## 3 Our new solver

The final contraints only involves the unknown and and can be written

 c31kβ+c32k+c33β+c34=0. (11)

If we solve for we can write the solution as

 k=−c33β+c34c31β+c32. (12)

Inserting the solution into and gives two new equations in only and . These are rational functions, but multiplying by an appropriate power of the denominator in (12) gives two new polynomial constraints and . The original polynomials and involved only constant factors and powers of twos in terms of the unknown . Since the solution in (12) doesn’t involve the same will hold true for and . This means that they can be written in the following form

 c11(β)w2+c12 =0, (13) c21(β)w2+c22 =0. (14)

These equations can be written in matrix form as

 BW=0, (15)

with and

 B=[c11(β)c12c21(β)c22]. (16)

Since (15) should have a non-trivial solution then . This gives us our sought univariate polynomial in . The determinant constructed in this way contains the denominator of (12) as a factor but this can easily be factored out symbolically. This leaves a six-degree polynomial whose coefficients can be determnined directly from the input data. This gives six potential solutions for . The corresponding solutions for are then found from the nullspace of and the solutions for are found from (12).

## 4 Evaluation of solver

We have implemented a version of this solver in Matlab.111 The code is publicly available at
The complete solver including all datamanipulation and extraction of rotation matrices runs in 0.3 ms. In order to test the numerical stability of our solver we generated 100,000 random instances of four corresponding image and world points. We then ran our solver and extracted the solutions for each instance. Using the estimated camera pose and calibration parameters we can calculate the reprojected image points and compare with the input image points. A histogram of the reprojection errors on a log-scale can be seen in figure 1. As we are estimating our parameters from a minimal set of datapoints, in theory we should have zero reprojection error. Due to numerical instabilities in solvers this may not be the case, but as can be seen from the graph our solver performs close to machine precision.

## 5 Conclusion

We have presented some simple derivations that gives the means for formulating the camera pose problem with unknown radial distortion and unknown focal length given four coplanar points in terms of a univariate six-degree polynomial. By finding the roots of theis polynomial we can find the six possible solutions to the pose problem. This gives a stable and very fast solver.

## References

•  M. Bujnak, Z. Kukelova, and T. Pajdla. New efficient solution to the absolute pose problem for camera with unknown focal length and radial distortion. In Asian Conference on Computer Vision, pages 11–24. Springer, 2010.
•  A. W. Fitzgibbon. Simultaneous linear estimation of multiple view geometry and lens distortion. In Computer Vision and Pattern Recognition, 2001. CVPR 2001. Proceedings of the 2001 IEEE Computer Society Conference on, volume 1, pages I–I. IEEE, 2001.
You are adding the first comment!
How to quickly get a good reply:
• Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
• Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
• Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters   