# pose estimation

I am doing a final year project which involves finding the position and orientation of a screw which has to be opened by a robot hand having a screw driver as an end effector.

I have developed a program in matlab that detects the screw and returns its centroid, I have also gone ahead to calibrate the camera and I have obtained both the intrinsic and the extrinsic parameters.

How do I obtain the rotation and translation matrix to enable me extract the eulers angles of a screw?

I am trying to imagine how the detected screw is represented. Even if you have the centroid point and some representation of the shape, you need to estimate plane in which the screw lays. Such estimation would be very inaccurate given just the elliptic shape of the screw, which is usually small and its perspective and even affine deformation would be negligible in the image.

Furthermore, a small ambiguity came to my mind, see the picture (red dots are the centroids):

Although both screws may be represented by the same ellipses (up to centroid position), their rotations about vertical axis are different.

Maybe you are aware of that.

I think pose estimation problems are covered in Hartley & Zisserman: "Multiple View Geometry". Of course it is much more accurate to estimate object pose when you have more views (e.g. stereo cameras).

You say that you have the extrinsic parameters. If that is true, then you already have the pose, thus, the position and rotation (There is usually some confusion on the topic, so check this answer to clarify things.).

Extrinsic parameters matrix is the same as pose matrix, a $3x4$ matrix:

$$Pose = Extrinsics = \begin{bmatrix} R_{11}&R_{12}&R_{13}&T_x\\R_{21}&R_{22}&R_{23}&T_y\\R_{31}&R_{32}&R_{33}&T_z \end{bmatrix}$$

Geting translation is trivial, if you want Euler angles from the rotation matrix then you just need a conversion. Have a look at this page for conversions.

It is very common the use of quaternions too. Converting a matrix to a quaterion is easy, and then getting angles from a quaternion is easy too. I use euaclideanspace for this kind of mathematical issues with 3D transformations.

• I think he has position of the camera relative to the world, but not to the screw. He tries to find the location of the screw in the world coordinates. – buq2 Jul 1 '12 at 5:28

My understanding is that you can not calculate homography from a single conic (conic is projection of a circle, in this case edge of the round screw). When camera calibration and homography between sensor and another plane (in you case the plane of the head of the screw) are known, you can calculate the orientation and location of the camera compared to the plane (or vice versa).

But, you can estimate homography from four known points. If you have slot/flat head screw, accurate estimation of the screw position and orientation can be very hard as the measurement error for the the corners of the slot will be relatively big compared to distance of the points. If you have cross type head, the four known points can be more spread apart and the homography estimation and therefore location/orientation estimation will be more accurate.

You can most likely combine the knowledge about the points of the slot corners and the edge of the screw (conic) to form even better estimation of the homography.

There is quite recent paper on the topic of estimating homography with different techniques. Note that there are many cases in which particular method of homography estimation does not work. For example the paper describes a method for computing homography from a point and a line, but it does not warn you that the point can not lie on the same line.

I have always recommended master thesis of Liljequist as good introduction paper about how to estimate camera location when camera calibration and homography are known. As Libor suggested, Multiple View Geometry by Hartley and Zisserman is good book about the camera geometry and algorithms related to it, but is also quite heavy compared to what you need for basic algorithms.