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.

PIVlab 3.14 Two cameras are not available in PIVlab 3.14.

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.

3D view of two cameras side by side, each looking straight at its own part of the calibration board in the light sheet; their view cones overlap in the middle. Next to it the board as camera 1 and camera 2 see it, and a report that gives 36 % overlap, a combined field of view of 335 by 205 mm and the decision for the stitched field of view.
Camera arrangement for image stitching; the image shown is from PIVlab's simulator.

Overview

  1. Record both cameras with an overlap between their views.
  2. Lens calibration and board image for each camera.
  3. Compute stereo / 3D alignment: both cameras become one image.
  4. Measure disparity: the position of the light sheet at the seam.
  5. 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 overlapAngle between the lines of sightMode
at least 50 % of the smaller viewat least 10°Stereo-PIV: u, v and w on the overlap
anything else — small overlap, no overlap, or nearly parallel camerasStitched 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.

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 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.

A narrow overlap The tilt across the overlap can only be measured in a wide enough overlap; in a narrow one PIVlab assumes 0 and writes that in the report.

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.