# Camera and laser scanner calibration final approach questions

A while ago I posted this question about camera and laser scanner calibration. I've been away from this project for a while and now I need to come back and get a final approach to calibrate properly this system.

So having Cedron Dawg's as a good answer to get the laser plane and also having the method described in this article, I have the next approach (assuming I got already the camera intrinsic parameters and the distortion is corrected ):

1. Get the camera extrinsics (R|t) placing a chessboard in front of the camera on the scanning area.
3. Having the above functions obviously we need a third equation to match the number of equations and variables, so I though to use this answer approach to get the laser plane equation and with this I will be able to solve the three equation system for the world coordinates (X,Y,Z).

So assuming that for every camera frame I've got the laser pixel input image coordinates (x,y) I will be able to transform them to world coordinates (X,Y,Z) with the above equations.

is all of this correct? is there in this approach any mistake?

EDIT

I edit in order to clarify more what I'm trying to do. The next picture illustrates an example about what I'm trying to do:

The object will change in width (B) and height (A) uniformly ( assume laser,camera and target are stationary), so applying the laser I need to measure (for each laser point) height and width changes. So the aim is, for each camera frame, draw a calibrated laser profile of the object.

What would it be the best way to solve this?

The solution I gave in the other answer assumed that the plane in question was fixed relative to the camera location. Thus a mapping from the 2D pixel locations to a 2D location on the plane could be made. Using the same calibration points, a reverse mapping can also be made. These mappings contain the distortion of the lens, the location of the camera relative to the plane, and the perspective effects. The mappings can be made more accurate by using higher order equations and more calibration points.

Once you have the 2D coordinates on the plane, call them (x,y), you can convert into real world 3D coordinates using a vector parameterization of the plane:

$$\vec r = x \vec a + y \vec b + \vec c$$

Where $\vec a$ is the 3D real world unit vector in the x direction on the plane, $\vec b$ is the 3D real world unit vector in the y direction on the plane, and $\vec c$ is the 3D real world unit vector of the origin on the plane.

If the situation is more complicated than that, e.g. the laser plane moves, or the camera moves, then a different solution is called for.

I have Python code for a generalized mapping solution. You can contact me at the email address on my profile page.

Hope this helps.

Ced

• Thanks for your answer and help, Just to clarify: the laser and camera positions are fix, but the laser measures a deflection always on the same plane, the camera I'm working with is already calibrated and it's distortion is corrected. Do you mean with '2D pixel locations' (mi,ni) the pixels I'm receiving from the camera and the '2D locations on the plane' (xi,yi) the pixels on the laser plane? – joe Apr 9 '18 at 7:38
• If this is like that how can I find the pixels on the plane (xi,yi) matrix R to solve A,B,C,D,E,F or the U matrix on the equation you proposed: M*U=R? – joe Apr 9 '18 at 7:46
• @joe, That's where something like a chessboard comes in handy. You could also expand the R array to three columns and use real world coordinates there and bypass the two step process. As long as they are all in the same plane the mapping you get should give you good results. Your matrix based approach is linear, the approach I gave can be expanded to any power giving a better fit to any distortion in your setup. In Python, it is better to use the "np.linalg.solve" function on the MtM*U=MtR equation than using the "np.linalg.inv" function. No matter how you do it, you have to calibrate. – Cedron Dawg Apr 9 '18 at 13:04
• thanks again for your help, I have clear I've got to find the calibration plane and the equations you presented but still don't have clear how to proceed with the calibration. I've only got the imcoming pixels (m,n), how could I exactly find these (x,y) world coordinates in calibration? With a chessboard only I will have the extrinsic parameters for a given position how could I find the laser world X,Y or/and Z to solve U ? – joe Apr 9 '18 at 19:39
• @Joe, What is your ultimate goal? Are you trying to find real world coordinates for points on the plane or are you going to want to know the distances between two points on the plane. What is the real world coordinate system you ultimately want? Are you considering the focal point of the camera your origin? If all you want is a coordinate system on the plane, a printed piece of paper with a lattice pattern of evenly (known spacing) dots placed in the plane is sufficient for calibration, then you can go 2D to 2D. – Cedron Dawg Apr 9 '18 at 20:11