Dual-Camera Coregistration

Dual-Camera Coregistration

This tool is dedicated to performing the coregistration of images from Dual-Camera Imaging systems from LabeoTech. Its goal is to ensure that the outputs of both cameras are aligned.

Open from DataViewer

Choose Utilities > OiS 2-Cam Alignment. The active Save Folder must have AcqInfos.MultiCam=true. DataViewer passes the folder and, when available, rig plus project/subject/session context.

Current dual-camera coregistration interface showing the Recalibrate action
The current tool with an active rig calibration; the source action is exposed as Recalibrate.

Normally a one-time hardware calibration
Repeat the calibration when a camera is moved, the optical path changes, or image alignment no longer passes visual quality control. Once a calibration is active, a dual-camera data-import function such as run_ImagesClassification automatically applies it to camera-2 data during import.

Calibration source

Choose Start Initial Calibration and select only the raw acquisition folder. The tool reads the acquisition through ReadInfoFile, requires MultiCam=true, and classifies the recording with default settings in a temporary Save Folder. The temporary data are removed when calibration finishes, is cancelled, or fails; source recordings and existing Save Folders are never used as calibration output.

When a calibration is already active, the same control becomes Recalibrate. After confirmation, the current calibration is preserved and temporarily deactivated so the same raw-data preparation path produces unregistered camera images. A successful save activates the new resource and keeps the previous resource in history. Cancelling, closing the tool, or encountering an error restores the previous active calibration automatically.

Step-by-step procedure

  1. Record a calibration target. Acquire a short dual-camera recording of a stable, high-contrast pattern that is clearly visible on both cameras. A grid is particularly useful because translations, rotations, and scale differences are easy to recognize.

    High-contrast grid visible in both camera acquisition windows
    Example high-contrast calibration target recorded simultaneously by both cameras.

  2. Open the tool. In DataViewer, open a dual-camera session and choose Utilities > OiS 2-Cam Alignment. Confirm that the selected rig is the rig whose physical camera arrangement you are calibrating.
  3. Prepare the source images. Click Start Initial Calibration, or Recalibrate when a calibration is already active. For recalibration, read and accept the confirmation describing rollback protection. Select the raw acquisition folder from step 1; do not select or create a Save Folder. The tool validates MultiCam=true and prepares temporary, unregistered camera images automatically.
  4. Estimate the transform. Use Use enhanced contrast and Flip Horizontally when needed to make corresponding structures comparable, then click Run Automatic coregistration.
  5. Inspect and refine the alignment. Compare the cameras with Alternate View, then use False Color Overlay to expose residual offsets. In a good result, corresponding edges overlap and appear neutral; separated green and magenta edges indicate misregistration. Adjust Transformation, Step size, and Apply Step until the important structures overlap.

    Examples of good and poor dual-camera alignment in false-color overlay
    Good alignment has overlapping structures; colored duplicate edges reveal a poor alignment.

  6. Save and activate. Click Save Coregistration and confirm. The new calibration becomes the active rig resource only after it is saved successfully. During recalibration, the previous calibration remains available in history.
  7. Verify the managed file. Open Manage Coregistration Files and confirm that the intended calibration is marked ACTIVE. Use Review for another visual check without changing resource state.
ControlPurpose
Start Initial Calibration / RecalibrateSelects a raw dual-camera acquisition, validates it, and prepares temporary unregistered camera images. Recalibration is offered only when an active calibration exists.
Alternate View / False Color OverlayCompares cameras without changing data.
Use enhanced contrast / Flip HorizontallyPrepares the alignment view.
Run Automatic coregistrationEstimates a candidate transform.
Transformation / Step size / Apply StepFine-tunes translation, rotation, or scale.
Save CoregistrationAfter confirmation, stores the transform as a rig-managed resource when rig context is available and updates local camera coregistration state.
Manage Coregistration FilesReviews and manages the current rig's active, available, and archived calibration files.

Manage coregistration files

Manage Coregistration Files opens a compact file manager. Select one calibration to see its status, creation time, UUID, and description. The list is ordered newest first. File management is unavailable while initial calibration or recalibration is in progress.

Coregistration file manager with active and archived calibration files
Actions are enabled according to the selected file's lifecycle status.

  • Review loads any selected calibration into the preview without changing its status.
  • Make Active activates an available calibration and returns the previously active calibration to available status.
  • Archive moves an available calibration into archive storage. To archive the active calibration, first make a different calibration active.
  • Restore returns an archived calibration to available status without activating it.
  • Purge permanently deletes an archived calibration after explicit confirmation.

Files and application of the transform

Save Coregistration does not rewrite the raw calibration acquisition. It saves the transform and preview information as a managed resource for the selected rig. The workflow-owned temporary classified folder is deleted after the resource is successfully saved and activated.

When that calibration is applied during dual-camera import or by the controlled application helper:

  • camera-2 channel .dat files are warped in place with nearest-neighbour interpolation;
  • camera-1 .dat files are not changed;
  • AcqInfos.mat supplies channel, camera, size, binning, flip, and rotation information but is not itself geometrically transformed;
  • a local tformDualCam.mat copy records the adjusted transform used for that processed folder.

Where the calibration is stored

The full calibration belongs to the rig's managed coregistration history. Its record includes tform, tformInfo, raw-source and creation information, and stored preview images. Use Manage Coregistration Files for lifecycle operations; do not move or delete managed files manually.

Quality control

Use Alternate View and False Color Overlay to compare vessels and field-of-view borders from both cameras before saving. The local QC summary records translation in pixels, rotation in degrees, X/Y scale, and the transform determinant. These values help identify unexpectedly large or reflected transforms but do not replace visual inspection.

DataViewer refresh

DataViewer waits for the utility to close and then reports closure. The currently displayed data is not automatically rewritten by this utility.

Rig-level resource
Camera coregistration belongs to the rig, not one subject. Verify the physical camera arrangement before making a transform active.


Back to top

Copyright © LabeoTech 2023. This work is licensed under the GNU General Public License, Version 3.0.