Spatial calibration (px → mm)

This converts your results from pixels and frames into physical units — millimeters and seconds (or velocities). It's independent of camera calibration & rectification, which instead corrects lens distortion and image alignment.

Open via the top-level Spatial calibration (px → mm) menu, or Ctrl+Z.

PIVlab Calibration panel
The Calibration panel.

Optional: a dedicated calibration image

If you photographed a ruler or a target with known dimensions separately from your PIV images, click Load calibration image (optional) to calibrate against that instead of your PIV data. Enhance image contrast (on by default) makes the reference markings easier to see.

Works together with camera calibration If you've enabled camera undistortion and/or rectification, the same correction is applied to your calibration image too — so the reference length you pick stays valid and consistent with your (corrected) PIV images.
The calibration image must match your setup exactly The dedicated calibration image must have the same dimensions (pixel resolution) as your PIV images. The ruler or target must be placed exactly in the laser sheet. Otherwise, the dedicated calibration image isn't useful.

Setting the scale

  1. Click Pick reference length [px] and drag a line across a distance you know the real-world size of (a ruler, a known gap, etc.) — or type the pixel length directly into Reference length in px.
  2. Enter that distance's real-world size in Real distance in mm.
  3. Enter the time between your two images in time step in ms.
A reference line drawn across a calibration target of known size; a label reports its length in pixels (1165.61 px) for a real distance of 120 mm
Picking the reference length: a line drawn across a known distance on a calibration target. PIVlab reports its length in pixels (here 1165.61 px), which you pair with the real-world distance (120 mm) to set the scale.
Time step of 0 = displacements, not velocities Entering 0 for the time step tells PIVlab you want raw displacements instead of velocities — useful when the time between frames isn't meaningful or known.

Setting up axis directions and origin

By default, image data has its origin at the top left, with x increasing right and y increasing downward. The Setup Offsets panel lets you match PIVlab's coordinate system to your own:

ControlEffect
x increases towards the (right/left)Flips the direction of positive x.
y increases towards the (bottom/top)Flips the direction of positive y — e.g. choose "top" for a conventional bottom-left-origin coordinate system.
Set x & y offsetsClick a point in the calibration image and enter the physical (x, y) coordinate it represents, moving the origin there.

Applying the calibration

Once everything is set, click Apply calibration to convert the whole session's results — not just the current frame. Click Clear calibration to revert to raw pixels/frames.

Calibrate early Where practical, calibrate before running heavy validation. Velocity-limit thresholds are much easier to set and interpret once you're looking at physical units (mm/s) rather than raw pixels/frame.