Depther project - part 1: collect calibration data
This post is an introduction to the task of OpenCV camera calibration and creating a deep image from a stereo vision camera. The first topic is to get the right calibration data.
Dual camera device
In my experiments I use the Antmicro OV5640 Dual Camera Board camera (brother of this camera), which is connected via the MIPI Serial Camera Interface 2. The distance between the cameras is about 7 cm. With such a base, we should be able to achieve depth for the image in the range of about 0.5m to 3m.
Checkerboard target
I use the standard checkerboard pattern from kalibr toolbox. The source of the calibration target from the 7x6 (inside corners count) checkerboard is in the pdf file. When I printed it on A3 size paper, I obtained squares with a side of 0.0417 meters.
Source code
This task is not difficult - just collect the image for the left and right cameras simultaneously. For ease of use, they have the same name but go to different folders. If that’s enough for you, I invite you to the source code. Note which camera ID is on the left - this will be important at later stages.
An interesting thing is to use .grab()
and .retrieve()
instead of .read()
. According to the documentation, .grab()
is used when we have multiple cameras and hardware synchronization is not guaranteed. The operation .retrieve()
is time consuming, so first get frames for both cameras, then decode it. Therefore, using the .read()
method, which performs both operations one after the other, increasing the chance of reading off-time.
Leave a comment