MATLAB: Camera measurements after calibration

camera-calibrationComputer Vision Toolboxdistance measurements

Hi all,
I have calibrated a camera successively using the calibrator app and a checkerboard pattern. I plan to use the camera to measure distances in an industrial process. In the Matlab documentation there is an example of measuring distances between two coins, which is similar to my plan.
However, in my industrial process I cannot have the checkerboard to compare the objects I like to measure. My camera is calibrated keeping the distance from the camera to objects approximately the same as I aspect it be in the process where I plan to put the camera.
Can I measure distances without the checkerboard? What do I have to change in the example code to make it work if it is possible?

Best Answer

Hi Erik,
If you need to measure planar objects with a single camera, then you need to know the camera extrinsics, which are the 3D rotation and translation between your plane of interest (table, conveyor belt, etc.) and the camera's coordinate system. If your camera does not move relative to that plane, then you only need to compute the extrinsics once. You can place a checkerboard on the plane once, compute the rotation and translation using the extrinsics function, save the results, and re-use them for measurements.
Alternatively, you can use a calibrated stereo pair of cameras. In that case, all the measurements will be in the coordinate system attached to one of the cameras, and you do not need a checkerboard in the scene.