Jump to: navigation, search

Autopano Video - Lens calibration - Camera preset

This tutorial will show you how to create and use a camera preset. It will be applied to the Izugar MKX-19 fisheye lens.

Lens calibration - Create a camera preset


Camera calibration - 360° panning

To obtain a good lens calibration you need to record a full rotation around the nodal point of the lens.

For that purpose we recommend using a panoramic head. Try as far as possible to use a 10 or 15 clicks rotator to be sure to have still parts in your video.

Once your set-up is ready start recording using the video mode you want to calibrate.

Then pan from 0 to 360° at the horizon.

Be careful, the lens calibration can be different between two modes on the camera, especially if there is a ratio / crop / focal length / FoV change.

If your camera allow taking photos with the exact same FoV & ratio than the video you can take still images instead of a video clip. The quality will generally better in photo mode. Take 10 to 15 images around the horizon. Here with the GoPro I could have taken photos as they capture the same thing than 4:3 video modes.

Image extraction

VLC Cpature Tool

Then you need to extract still images from your video before going to the stitching step. For that purpose yo ucan use VLC Media Player and its snapshot tool.

It's accessible in the video menu or you can add the icon to the interface using the tools menu.

Extract the images when the camera was still, take from 10 to 15 frames around the horizon.

Stitching in Autopano

Now you need to get the best stitching of the extracted images.

Extracted frames

Import all your images in Autopano (Pro or Giga), go into the the image properties before launching the detection. Set your lens type, fisheye in this case, and an approximate value for the focal length (not essential). In the circular crop tab adjust the circle if needed, and make sure to apply these changes to all your images.

Image properties

Circular Crop

Launch the detection. If your shooting was done properly you should have a very good stitching. In every case you have to make sure that you have control points everywhere. That is very important to get the best lens calibration.

Control points distribution

Then you need to adjust the scope of the optimized settings in the main window of Autopano, with the control points tool selected and the advanced mode enabled. As all your images have been taken with the same camera you have to force every image to use the same focal length, distortions and sensor offset. Use the following settings and run a quick optimization.

Optimization scopes

You should get a nice stitching like this. You can use the image selection tool to check that nothing is moving in the overlapping areas.

Calibration result

Creating the camera preset

Now you can copy the optimization results from optimization groups window of Autopano to a new preset file.

Optimization groups window

Create an XML file named after your camera with the appropriate values for the focal length and the 3 levels of distortion.

XML Preset

Put your lens preset file in the right folder

You just need to save this XML file in the appropriate folder. To do so, open the Autopano Video settings, Edition tab and click on the icon next to the Data location folder. Go into the user/presets/camera sub-folder.

Edition window - overview

Use a lens preset to stitch your back-to-back RIG - Izugar Z2X

This part will show you how to stitch your Izugar Z2X footage using the lens / camera preset. As the overlapping area between the two images is really small you will need to manually add some control points to your stitching.

Start by importing your videos in Autopano Video.

Import videos

Synchronize your videos and use the stitching menu to select "Stitch as Izugar Z2X". As you can the software hasn't found any match between the image, this is due to the poor overlapping as I told you before.

Import videos

Click on edit to open the panorama in Autopano. You will notice that the distortion values and the the focal length are the same as in your lens preset. Open the control points editor.

Import videos

Select the two images and add control points by selecting the same areas in each image. Once you have control points all around the images you can run a quick optimization.

Import videos

Go back to the main window of the autopano editor, the result should be perfect by now. If you notice a divergence in the FoV values (~240°) you need to manually reset these values to the approximate FoV (~195°) and re-run a quick optimization.

Save you modifications in AVP, and here you are!

Import videos

Files to download: template IZUGAR z2x and lens calibration

Here are the links to our results. Remember that the lens preset can differ from one lens to another, especially our as it was from the first batches. And the template ("stitch as .pano ...") will help you getting a first result.

Click here to download our IZUGAR z2x lens calibration

Click here to download our IZUGAR z2x template