Stereo 3D calibration is the process of calculating the position and orientation of two cameras relative to each other.
Calibration is important if images are captured using stereo 3D and need to be dewarped - without the calibration information, the stereo images will not flatten.
It is recommended that before any work using stereo 3D is done, this calibration process be completed first.
Setting Up Cameras for Calibration
Calibration uses the same setup as stereo 3D capture. Refer to the Decapod Stereo 3D Guide for the equipment setup, and Decapod Stereo 3D Capture Guide on how to use Decapod's capture tool to take stereo images.
Connect Right Camera First (Applies to Tethered Capture Only)
Before doing any calibration of capturing, the right camera must be attached to the Decapod system first, then the left camera. Doing this out of order may cause stereo capture and subsequent dewarping to not perform properly.
To ensure that this is done properly, follow the these steps:
- Ensure computer running Decapod is on and running.
- Turn on the right camera.
- Remove any memory cards if present.
- Connect the right camera to the Decapod system with a USB cable.
- Repeat steps 1 to 3 for the left camera.
If any camera is disconnected during capture, both cameras should be disconnected and reconnected in the manner stated above (left camera first, then right camera). If this is done in reverse order, stereo 3D dewarp may not perform properly.
Taking Calibration Photos
To perform calibration, a 10x7 checkerboard pattern is held in full view of both cameras and pictures are taken. Between taking each pair of photos, the checkerboard is tilted differently or its position changed before another photo is taken.
Download Decapod 10x7 checkerboard
This 10x7 checkerboard is specific to Decapod. Using a different checkerboard with different dimensions may produce undesired results.
A minimum of 23 pairs of photos are required to perform calibration. More calibration images may yield better results.
Once the set of calibration photo pairs are ready (at least 23 pairs), they are processed through the Decapod Stereo 3D Calibration tool. The Stereo 3D Calibration tool generates a file containing the calibration information, which is then saved to a user-specified location.
When the cameras are in place, do not change their positions or orientation relative to each other during the calibration process or during stereo capture. If camera positioning is changed, the images captured up to this point should be deleted and the calibration process restarted.
Calibration capture procedure:
- Position checkerboard in front of cameras, and ensure checkerboard is visible from both cameras. If checkerboard is not completely visible, then adjust the cameras higher, or place the subject lower.
- Take test captures to ensure proper positioning. These test captures should be deleted and not be included in the final set calibration images.
- While holding the checkerboard still, take a picture with both cameras. The Decapod capture tool can be helpful in this situation as it can take pictures from both cameras simultaneously.
- Change the tilt / position / orientation of the checkerboard while ensuring it is viewable by both cameras.
- Repeat Steps 3 to 4 until at least 23 pairs of photos are taken.
- If cameras are bumped or change positions, delete all calibration photos taken so far and start again from step 1.
Example Calibration Capture Process
Calibration Image Filename Convention (Applies to Untethered Capture Only)
Stereo 3D Calibration expects at least 23 image pairs that follow this filename format:
capture-[capture #]-[camera #].[extension]
- capture-01-1.jpg (i.e. left image of capture #1)
- capture-01-2.jpg (i.e. right image of capture #2)
- capture-23-1.jpg (i.e. left image of capture #23)
- capture-23-2.jpg (i.e. right image of capture #23)
In this example, images are grouped in pairs. In each pair there is a left and right image as indicated by "-1" and "-2" respectively.
The left image should always come before the right image in a pair (like in the above example). Reversing this order will cause calibration to give inaccurate results.
Unlike untethered capture, tethered capture can make the calibration process easier by:
- taking photos simultaneously from both cameras which can be faster than triggering the cameras manually.
- the Decapod Capture tool also creates a ZIP file of the images (with proper file names) so it can be used directly in the Stereo 3D Calibration tool without additional work.
Important: Do not Change Relative Camera Positions
Once the calibration photos are taken, do not change the relative positions of cameras. Treat the pair of cameras as a single unit and do not turn or twist any cameras once mounted. Do not bump them accidentally.
If camera positions are changed, then the new positions need to be recorded by re-calibrating the cameras (retaking the 23 photos and re-running the Decapod Stereo 3D Calibration tool). Once the new calibration data is generated, any subsequent photos taken with these new camera positions should only be used with this new calibration data.
Mixing and matching different stereo image sets and different calibration data is strongly discouraged.
How Run Stereo 3D Calibration
Once all checkerboard calibration images are taken, calibration data needs to be generated by running the Decapod Stereo 3D Calibration tool.
- Ensure proper filenames of left and right calibration images (see above).
- Create a ZIP file containing all calibration image pairs (at least 23 pairs / 46 images).
- Launch Firefox and load the Stereo 3D Calibration tool by entering the server’s address in the location bar. By default the address is: http://localhost:8080/ . If the Decapod server can not be loaded at the default address, or if the server is not running, please see your Decapod administrator for assistance.
- Add the ZIP file containing the calibration image pairs (created in Step 2 above) and select “Calibrate” to begin the calibration process.
- Calibration may take 2 hours to complete with high resolution images.
- When calibration is complete, save the file calibration.zip to a location when prompted.
<code>calibration.zip</code> file is needed later for stereo dewarping, so it is recommended that the file be saved in a safe location, preferably the same directory where work is being done. This way it is clear that certain calibration data belongs with a particular unit of work.