CameraManager

scanimage.components.CameraManager, reachable as hSI.hCameraManager, wraps every configured camera device in a scanimage.components.cameramanager.CameraWrapper and keeps each wrapper’s alignment to reference space.


Component

Member

Description

hCameraWrappers

Array of CameraWrapper objects, one per configured camera.

hSelectedCameraWrapper

The camera currently selected for viewing.

hSI.hCameraManager.resetTransforms()

Reset every camera’s alignment to reference space.

hSI.hCameraManager.save() / load()

Persist the camera alignments to the class data file.

hSI.hCameraManager.manageCameras()

Rebuild the wrapper list after cameras were added or removed.

hWrapper = hSI.hCameraManager.hSelectedCameraWrapper;
hWrapper.name

CameraWrapper

The wrapper holds the ScanImage-side state; the actual device lives in hDevice and follows the camera device API.

Member

Description

hDevice

Read-only handle to the dabs.resources.devices.Camera object.

name

The camera’s unique name.

hCSZAffineLut

The camera’s coordinate system, named 'Camera - <name>' and parented to reference space.

cameraToRefTransform

Legacy 3x3 affine from camera space to reference space.

pixelToCameraTransform

Read-only 3x3 affine from pixel coordinates to camera space.

pixelToRefTransform

Read-only 3x3 affine from pixel coordinates to reference space.

focalDepth

Points object, in reference or sample-absolute coordinates, giving the depth the camera is focused at. Empty when unknown.

hWrapper.startAcq(rate) / stopAcq() / isRunning()

Start, stop and query the polled frame acquisition.

[xx,yy] = hWrapper.getMeshgrid(gridResolution)

Meshgrid over the camera’s field, in camera space.

[xx,yy] = hWrapper.getRefMeshgrid(gridResolution)

The same grid in reference space.

[xx,yy] = hWrapper.getRefCornerPoints()

Corner points of the camera image, in reference space.

Camera space is the unit square with corners [-.5 -.5], [.5 -.5], [.5 .5], [-.5 .5], so pixelToCameraTransform normalizes out the sensor resolution and hCSZAffineLut carries the alignment.

hWrapper = hSI.hCameraManager.hSelectedCameraWrapper;

img = hWrapper.hDevice.snapshot();
[xx,yy] = hWrapper.getRefCornerPoints();
fprintf('camera covers x = %.2f..%.2f deg\n',min(xx),max(xx));