Camera calibration & rectification

These tools correct problems introduced by the camera and lens — distortion and misalignment — before the PIV analysis runs. They're different from Spatial calibration (px → mm), which just converts pixel units to physical units after the fact.

ToolCorrects
Camera calibration (undistortion)Lens distortion (barrel/pincushion effects) using a photographed marker board.
Image rectificationMisalignment between the camera's image plane and your target coordinate system / laser sheet.
Mono setups only, for now Both tools accept a "Camera 2" in their menu (Image settings → Camera calibration), but that option is currently disabled — only a single camera is supported today.

Setting up a marker board

Both calibration and rectification are done by photographing a printed ChArUco board (a checkerboard combined with ArUco markers). Configure it via Image settings → Camera calibration → Setup / define / generate marker board:

FieldMeaning
Board typeCurrently only ChArUco DICT_4X4_1000.
Origin colorColor of the top-left checker (Black/White) — must match your printed board.
Rows / ColumnsCheckerboard dimensions (default 23 × 24).
Checker size / Marker sizePhysical size of the checkers and the ArUco markers printed on them.

Click Guess parameters to have PIVlab estimate these from a photo, or Generate Charuco board to produce a printable board matching your settings.

PIVlab Marker board setup panel
The Marker board setup panel.
A generated printable ChArUco board: a checkerboard with ArUco markers in the black squares, labelled with its dictionary and dimensions
A board produced by Generate Charuco board — print it out and photograph it to calibrate. The header records its exact parameters (dictionary, rows × columns, checker/marker sizes) so PIVlab can detect it.

Camera calibration (lens undistortion)

Open via Image settings → Camera calibration → Camera calibration (undistortion) → Camera 1.

PIVlab Camera calibration panel
The Camera calibration panel.
  1. Click Load target images and select several photos of your marker board from different angles/positions.
  2. If your camera uses a Scheimpflug adapter (tilted sensor), enable Scheimpflug adapter (tilted sensor model) first.
  3. Click Estimate cam parameters to detect the markers and compute the lens model.
  4. Save parameters to reuse this calibration later, or Load parameters to bring back a previous one.

Checking the result

ButtonShows
Show reprojection errorsHow well the model fits — should be below 1 pixel for a valid calibration.
Show camera positionsWhere the camera was relative to the board in each calibration image.
Show lens distortionA visualization of the detected lens distortion.
A visualization of the lens distortion: a colour map showing how far pixels are displaced, smallest in the centre and growing toward the corners, with profile curves along the edges
Show lens distortion — how far each pixel is displaced by the lens. It's smallest at the centre and grows toward the corners, the classic radial distortion pattern being corrected.
A 3D scene showing the calibration board and the estimated camera position for each calibration image as small camera icons
Show camera positions — a 3D reconstruction of where the camera was relative to the board in each calibration photo.

Applying it

Set Output image size — undistorting an image curves its straight edges, so you choose how to handle the resulting black borders: Cut away black borders, keep the Same size as input image, or Include black borders in full. Then tick Enable camera calibration to actually apply the undistortion to your images.

Image rectification

Open via Image settings → Camera calibration → Image rectification / alignment → Camera 1 (you need images loaded first). Rectification aligns the image with your target coordinate system by photographing the marker board positioned inside the laser sheet, aligned with the plane you actually want to measure.

PIVlab Image rectification panel
The Image rectification panel.
  1. Click Load target image and select that photo.
  2. Use Show detected markers, Show rectified board and Show camera position to check the detection before committing.
  3. Set Upscaling (1× or 2×) — upscaling reduces artifacts from image interpolation during rectification, at the cost of slower analysis.
  4. Tick Enable image rectification to apply it.
A calibration-target image after undistortion and rectification: originally straight edges now bow outward, showing the geometric correction that has been applied so the image plane matches the target
A target image after undistortion and rectification. The curved outline shows the geometric correction PIVlab applies so the image plane lines up with your target coordinate system.
Both can be used together Calibration (undistortion) and rectification address different problems and can be enabled at the same time: undistortion first removes lens artifacts, then rectification aligns the corrected image with your coordinate system.