sksurgerycalibration.video.video_calibration_params module

Containers for video calibration parameters.

class sksurgerycalibration.video.video_calibration_params.BaseCalibrationParams[source]

Bases: object

Constructor, no member variables, so just a pure virtual interface.

Not really necessary if you rely on duck-typing, but at least it shows the intention of what derived classes should implement, and means we can use this base class to type check against.

load_data(dir_name: str, file_prefix: str)[source]

Loads all contained data from disk.

reinit()[source]

Used to clear, re-initialise all member variables.

save_data(dir_name: str, file_prefix: str)[source]

Writes all contained data to disk.

class sksurgerycalibration.video.video_calibration_params.MonoCalibrationParams[source]

Bases: sksurgerycalibration.video.video_calibration_params.BaseCalibrationParams

Holds a set of intrinsic and extrinsic camera parameters for 1 camera.

load_data(dir_name: str, file_prefix: str, halt_on_ioerror=True)[source]

Loads calibration parameters from a directory.

Parameters:
  • dir_name – directory to load from
  • file_prefix – prefix for all files
  • halt_on_ioerror – if false, and handeye or pattern2marker are not found they will be left as None
reinit()[source]

Resets data, to identity/empty arrays etc.

save_data(dir_name: str, file_prefix: str)[source]

Saves calibration parameters to a directory.

Parameters:
  • dir_name – directory to save to
  • file_prefix – prefix for all files
set_data(camera_matrix, dist_coeffs, rvecs, tvecs)[source]

Stores the provided parameters, by taking a copy.

set_handeye(handeye_matrix, pattern2marker_matrix)[source]

Stores the provided parameters, by taking a copy.

class sksurgerycalibration.video.video_calibration_params.StereoCalibrationParams[source]

Bases: sksurgerycalibration.video.video_calibration_params.BaseCalibrationParams

Holds a pair of MonoCalibrationParams, and the left-to-right transform.

get_l2r_as_4x4()[source]

Extracts the left-to-right transform as 4x4 matrix.

load_data(dir_name: str, file_prefix: str)[source]

Loads calibration parameters from a directory.

Parameters:
  • dir_name – directory to load from
  • file_prefix – prefix for all files
reinit()[source]

Resets data, to identity/empty arrays etc.

save_data(dir_name: str, file_prefix: str)[source]

Saves calibration parameters to a directory.

Parameters:
  • dir_name – directory to save to
  • file_prefix – prefix for all files
set_data(left_cam_matrix, left_dist_coeffs, left_rvecs, left_tvecs, right_cam_matrix, right_dist_coeffs, right_rvecs, right_tvecs, l2r_rmat, l2r_tvec, essential, fundamental)[source]

Stores the provided parameters, by taking a copy.

set_handeye(left_handeye_matrix, left_pattern2marker_matrix, right_handeye_matrix, right_pattern2marker_matrix)[source]

Call the left/right set_handeye methods.