Camera and Scene Calibration
Aegear supports scene calibration directly in the GUI and provides a separate script for lens (intrinsic) calibration. This page explains the difference between the two, how to perform lens calibration using the integrated script, and how to update Aegear with new calibration data.
π― Scene Calibration (GUI)
Scene calibration in Aegear maps the videoβs pixel coordinates to real-world metric units (e.g., centimeters). This is achieved by selecting four reference points in the video that define the scale and orientation of the scene.
- Where?: Available in the Aegear GUI under the Calibrate button.
-
What it does?
- Computes a homography for planar mapping.
- Allows Aegear to report trajectories in metric units.
-
Picking Reference Points
- The user is asked to click 4 reference points in sequence. These should be picked in the order shown below.
π΄ Points 1β4 represent the corners of the reference area used for scaling and orientation.
π Note: Custom scene reference points (beyond 4 corners) are not yet supported in the GUI. If you require this feature, please open a GitHub issueβwe will prioritize adding it.
π Scene calibration does not correct lens distortion.
π· Lens Calibration (Intrinsic Calibration)
Lens calibration, or intrinsic calibration, is a separate process that corrects optical distortions (e.g., barrel or pincushion distortion) and defines camera parameters.
- Where?: Not yet available in the GUI.
- Tool: Use the provided script:
python tools/calibration.py calibration_descriptor.json
π Calibration Descriptor (calibration_descriptor.json
)
Example:
{
"videoPath": "data/videos/2016_0718_200947_002.MOV",
"calibrationDataPath": "data/calibration.xml",
"patternSize": [8, 6],
"subPixWinSize": [5, 5],
"patternSquareSideLength": 1.6,
"skipFrames": 120
}
Fields:
Field | Description |
---|---|
videoPath |
Path to calibration video (checkerboard pattern). |
calibrationDataPath |
Output XML file path for calibration data. |
patternSize |
Size of checkerboard grid (columns, rows). |
subPixWinSize |
Window size for corner refinement (pixels). |
patternSquareSideLength |
Size of one checkerboard square (cm). |
skipFrames |
Process every Nth frame for efficiency. |
π Steps
- Record a video of a checkerboard pattern covering the cameraβs field of view.
- Update
calibration_descriptor.json
with your video and parameters. - Run the calibration script.
- The script produces an updated
calibration.xml
.
π¦ Update Aegear
Copy the resulting calibration.xml
to:
config/calibration.xml
π Summary: Scene vs Lens Calibration
Feature | Scene Calibration | Lens Calibration |
---|---|---|
Corrects Lens Distortion | β | β |
Converts Pixels to Metric | β | β (indirectly) |
Location in Aegear | GUI (Calibrate) | CLI (tools/calibration.py ) |
Output | Homography | Intrinsic matrix & distortion coefficients |
π Notes
- Lens calibration should be performed once per camera setup and reused.
- Scene calibration is required per video if camera/view changes.
- Future versions of Aegear may integrate lens calibration and custom scene reference point systems into the GUI.