Stitched field of view (2D2C)
Two cameras side by side see different parts of the same light sheet. PIVlab stitches them into one larger image and analyses it like a normal 2D measurement, so u and v cover the whole stitched field.
The same two cameras can give all three velocity components instead, if they look at one piece of the sheet from different directions: Stereo-PIV analysis (2D3C). PIVlab chooses between the two from the camera geometry.
Overview
- Record both cameras with an overlap between their views.
- Lens calibration and board image for each camera.
- Compute stereo / 3D alignment: both cameras become one image.
- Measure disparity: the position of the light sheet at the seam.
- Analyse the stitched image like any 2D measurement.
Stereo-PIV or stitching
Both modes are loaded the same way (Import images of two cameras) and both are set up in the Stereo-PIV / stitching panel (Analysis → Stereo-PIV / stitching, Ctrl+Shift+W). Compute stereo / 3D alignment measures both views on the board and picks the mode:
| Views overlap | Angle between the lines of sight | Mode |
|---|---|---|
| at least 50 % of the smaller view | at least 10° | Stereo-PIV: u, v and w on the overlap |
| anything else — small overlap, no overlap, or nearly parallel cameras | Stitched field of view: u and v on both views together | |
The decision is the first line of the report, e.g. "Overlap of the views 18 % (stereo-PIV needs 50 %) → stitched field of view (u, v)". Cameras side by side with a small overlap see the seam from opposite angles, so the angle alone does not make it a stereo set-up.
Lens calibration and board image
As for stereo-PIV, each camera needs its own lens calibration and one image of the ChArUco board in the light sheet, recorded with the laser off.
- One board for both cameras, reaching into both views and photographed by both at the same moment. It ties the two cameras together.
- The board should cover about a third of each view or more. A large board over both views is the best case.
- The board plane is the plane of the stitched image: x and y of the result follow the board axes.
Stitching the two cameras
Compute stereo / 3D alignment then turns the two cameras into one data set. Every frame is composed of the two raw frames, with lens distortion removed and both mapped onto the board plane; the seam sits in the middle of the overlap, and the part that no camera sees is black.
- The camera switch disappears: the window holds a normal 2D data set with the stitched images.
- The spatial calibration (px → mm) is filled in; only the time step is missing.
- The region of interest is set automatically inside the part the cameras see.
- Lens undistortion and rectification are already in the stitched images, so the two camera calibration checkboxes stay off.
- Masks, background images and results are removed (PIVlab asks first). Draw masks after the alignment.
The report gives the viewing angle of each camera, the size of the stitched image in pixels and millimetres, the scale, the camera pixel on the sheet for both cameras, the width of the overlap, and how many board corners were used.
Light sheet position
The board is never exactly in the light sheet, so the two cameras do not match at the seam straight away. Measure disparity correlates both cameras in their overlap, computes where the light sheet is relative to the board and maps both cameras onto the sheet.
Its report gives the offset of the sheet from the board and its tilt along the overlap, and how well the cameras match at the seam before and after, in pixels rms and maximum. Above 0.5 px rms, PIVlab says so: check the lens calibrations, the board images and the particle images in the overlap.
Analysis
From here on nothing is special: pre-processing, masks, PIV settings, ANALYZE, validation, derived parameters and export work on the stitched image as on any other 2D measurement. Enter the time step, the rest of the calibration is already there.
From a script
pivlab.combineCameras does the same as the panel
(command-line API):
for k = 1:2
imgs{k} = pivlab.readImages(files{k}, "pairwise");
imgs{k} = pivlab.preprocess(imgs{k}, Camera=lens_files{k});
end
imgs = pivlab.combineCameras(imgs, {"board_cam1.tif", "board_cam2.tif"}, board);
res = pivlab.analyze(pivlab.preprocess(imgs, CLAHE=true));
res = pivlab.toMetric(pivlab.filter(res), DeltaT=0.001);
The result is one ordinary image set. Sheet=false skips the light sheet
measurement and uses the board plane.