How to calibrate a perspective lens Camera - PIX4Dmatic
PIX4Dmatic provides the option for perspective camera lens calibration through the internal camera parameters window, optimizing camera performance for accurate photogrammetry. This article details the camera calibration process.
IN THIS ARTICLE
Description
Image requirements
Calibration Procedure
Verify the calibration
Using the saved parameters
Description
PIX4Dmatic requires as input the internal parameters of the camera used to acquire the images for processing. These parameters are used for the 3D reconstruction and therefore, must be accurate to achieve an optimal 3D reconstruction.
By default, PIX4Dmatic optimizes the internal parameters in each project, starting from the saved values, because small consumer-grade cameras are sensitive to vibration, temperature, etc. Saved parameters matter most for projects whose geometry cannot determine the internal parameters by itself, typically nadir-only flights over flat terrain. In such projects, a wrong focal length can be compensated by a wrong flight height, and the reconstruction still looks correct. The calibration dataset must therefore have a stronger geometry than the projects it is used for, and its result must be verified independently, as described below.
Image requirements
- Enough images: 100 - 300 images.
- High overlap and rich texture.
- Nadir and oblique images of the same area, processed together in one project:
- Tilt the camera 30 - 45° from vertical. A few degrees of tilt is not enough.
- Capture the oblique images from at least two opposite directions, ideally four (for example a double grid). A single back-and-forth grid works only if the drone turns at the end of each line, so that the camera faces opposite directions on alternate lines. If the drone keeps a constant heading, all oblique images face the same way.
- Tilt the gimbal relative to the drone, so that the camera looks in the direction of flight. Ensure good overlap between the oblique and the nadir images.
- Nadir-only flights are not sufficient, even at several heights. With nadir images, a longer focal length combined with a higher flight height produces almost the same images, so the focal length cannot be determined reliably. Several flight heights help only if the image positions are very accurate (RTK/PPK).
- Non-planar scene: objects at different heights, ideally several meters of relief (buildings, walls). Note that a uniform slope does not help if the drone follows the terrain.
- Identical camera settings for all images: manual focus locked at infinity, no zoom, no change of focus or lens between flights.
- Rolling shutter cameras: fly slowly or hover while capturing, and enable the rolling shutter correction in the processing settings.
- Original images, with NO distortion correction applied.
- Ground Control Points (GCPs), if possible:
- Spread them over the whole area, not clustered, and if possible at different heights.
- Keep at least 2 - 3 of them as checkpoints, not used in the calibration, to verify the result.
- Specify the full coordinate system of the GCPs.
- Correct image geolocation coordinate system, especially the vertical part (ellipsoidal or geoid height). A wrong vertical datum causes a height offset that can bias the calibration.
Calibration procedure
The procedure to Calibrate a Perspective camera lens in PIX4Dmatic is described below:
- Create a new project: File > New
- Import the images: File > Import > Images
- Configure the image properties:
-
-
- (optional, recommended) Import an image geolocation and orientation file
- Select the image coordinate system
- Edit the internal camera parameters.
- In the Camera Model Parameters section, select Perspective Lens and set the following values:
-
Focal Length [mm] or [px] Set the focal length in millimeters or pixels. Principal Point x [mm] or [px] Set the principal point in the center of the image, i.e. set the value to ImageWidth/2. Principal Point y [mm] or [px] Set the principal point in the center of the image, i.e. set the value to ImageHeight/2. Radial Distortion R1 = 0 Radial Distortion R2 = 0 Radial Distortion R3 = 0 Tangential Distortion T1 = 0 Tangential Distortion T2 = 0
-
- Click Apply
- Click on Calibration and select the Map template. Set the confidence of the internal camera parameters to Low, so that all parameters are fully optimized.
- (optional) Import GCPs without marking them: How to import and mark ground control points (GCPs)
- Click Start.
- (optional) If the project has an image geolocation file and GCPs in a known coordinate system, mark the GCPs using the image viewer How to import and mark ground control points (GCPs).
- After marking the Ground Control Points click on the Reoptimization step.
- Mark at least 5 MTPs, spread over the scene, with as many marks as possible in each image. This step is essential: without independent MTP checkpoints the calibration cannot be verified. Mark GCPs that you keep as checkpoints as checkpoints, not as GCPs.
- Verify the quality of the reconstruction by:
- Assessing the Quality Report.
-
- Selecting Automatic Tie Points at different locations in the point cloud and verifying the reprojection in the image viewer.
- Selecting the GCPs in the 3D viewer and verifying the reprojection in the image viewer.
- If the reconstruction is not good enough, mark Manual Tie Points in the areas that are not well reconstructed and run Reoptimization: How to import and mark Manual Tie Points (MTPs).
- Generate the Quality Report by clicking File > Export > Quality Report and repeat the following procedure until the values (before and after the Load optimized parameters button) converge.
- Open the Camera internals window and click on the Load optimized parameters button.
- Run Reoptimization.
- Open the Camera internals window and click on the Load optimized parameters button.
- Run Reoptimization.
- ...
Note: Convergence only shows that the optimization is stable, not that the parameters are correct. With a weak dataset (for example nadir images only) it can converge to wrong values. Always verify the result as described in the next section.
- Once the reconstruction is good, save the optimized camera parameters by ticking on the respective box in the Camera internals window so that they can be used as initial values for other projects.
Verifying the calibration
The Quality Report and the reprojection of tie points and GCPs used in calibration show how well the parameters fit this dataset. They do not prove that the parameters are correct: a wrong focal length combined with a wrong flight height can fit the images and the GCPs equally well. Before saving the parameters, check that:
-
Checkpoints (GCPs and/or MTPs not used in the calibration) have a small error: about 1 pixel reprojection error, and a 3D error in the range of the checkpoint survey accuracy.
-
The focal length is plausible: compare it with the nominal value of the lens. A difference of more than a 1-2% indicates a problem with the dataset.
-
GCPs used in the calibration have an error in the range of their survey accuracy.
-
The initial image positions and orientations are sensible (from GPS and IMU): a bias or rotation can mean they are misinterpreted, for example a wrong IMU angle convention.
-
There is no systematic height offset between the image geolocation and the computed camera positions. Such an offset is the typical sign of a wrong focal length. If there is one, also check the vertical coordinate system of the image geolocation.
-
The result is repeatable (recommended): calibrating a second, independent dataset of the same camera gives similar parameters.
Once all checks pass, save the optimized camera parameters by ticking the respective box in the Camera internals window.
Using the saved parameters
The saved parameters are used as initial values in other projects with the same camera. For projects with weak geometry, such as nadir-only flights over flat terrain, increase the confidence of the internal camera parameters, so that the saved values are kept instead of being re-optimized.