openalea.phenomenal.calibration.calibration.CalibrationSetup

class openalea.phenomenal.calibration.calibration.CalibrationSetup(cameras=None, targets=None, image_resolutions=None, image_sizes=None, facings=None, clockwise_rotation=True)[source]

Bases: object

A class for helping the setup of a multi-view imaging systems to be calibrated

__init__(cameras=None, targets=None, image_resolutions=None, image_sizes=None, facings=None, clockwise_rotation=True)[source]

Instantiate a CalibrationSetup for positioning cameras and targets of a multiview acquisition system

Parameters:
  • cameras – {camera_id: (distance, inclination), …}: a dict of parameters for positioning cameras in the system. distance is the distance to the axis of rotation (word units), along camera optical axis. inclination is the angle (degree, positive) between world z+ (axis of rotation) and camera z- (z-axis being optical axis).

  • targets – {target_id: (distance, inclination), …}: a dict of parameters for positioning targets. distance is the distance to the axis of rotation (word units), along target normal direction. inclination is the angle (degree, positive) between world z+ (axis of rotation) and target normal.

  • image_resolutions – a {camera_id: resolution, …} dict of image resolution (pixel per world unit) for an object located near the axis of rotation

  • {camera_id (image_sizes is a) – (width, height), …} dict giving image dimension in pixels

  • facings

    a {target_id: {camera_id: angle, …}, …} dict of dict giving the rotation consigns (degree, positive) for which a chessboard is facing a camera (ie with with topleft corner closest to

    topleft side of the image).

  • clockwise_rotation (bool) – are targets rotating clockwise ? (default True)

Methods

__init__([cameras, targets, ...])

Instantiate a CalibrationSetup for positioning cameras and targets of a multiview acquisition system

alpha(rotation)

setup_calibration(reference_camera, ...)

Setup the cameras and targets

setup_camera([image_size, resolution, ...])

Set up a calibration camera from simple inputs

setup_target([inclination, facing, distance])

setup a target frame

setup_calibration(reference_camera, reference_target)[source]

Setup the cameras and targets

Parameters:
  • reference_camera (str) – the camera_id of the camera to be used to define world frame (cf Calibration)

  • reference_target (str) – the target_id of the target to be used to position cameras

Returns:

targets and cameras

setup_camera(image_size=None, resolution=None, inclination=0, facing=0, distance=0)[source]

Set up a calibration camera from simple inputs

Parameters:
  • image_size

  • resolution – image resolution (pixel per world unit) for an object located near the axis of rotation

  • inclination – the angle (degree, positive) between world z+ (axis of rotation) and camera z- (opposite

  • default (optical axis) . By) –

  • 0 (inclination =) –

  • downwards (that corresponds to a camera pointing) –

  • facing – the rotation consign (degree, positive) for which the reference target is facing the camera (ie with with top left corner closest to top left side of the image).

  • distance – the distance to the axis of rotation (word units), along camera optical axis.

Returns:

A CalibrationCamera positioned in calibration world frame

setup_target(inclination=0, facing=0, distance=0)[source]

setup a target frame

Parameters:
  • inclination – the angle (degree, positive) between world z+ (axis of rotation) and target normal. By default, inclination = 0, that corresponds to a horizontal target

  • facing – the rotation consign (degree, positive) for which the chessboard is facing the reference camera (ie with topleft corner closest to topleft side of the image).

  • distance – the distance to the axis of rotation (word units), along target normal direction.

Returns:

A CalibrationFrame positioned in world frame