sksurgeryimage.acquire.stereo_video module¶
Module for stereo video source acquisition.
-
class
sksurgeryimage.acquire.stereo_video.
StereoVideo
(layout, channels, dims=None)[source]¶ Bases:
object
Provides a convenient object to manage various stereo input styles. Developed firstly for laparoscopic surgery, but broadly applicable to any stereo setup using our TimestampedVideoSource and VideoSourceWrapper.
Design Principles:
- Fail early, throwing exceptions for all errors.
- Works with or without camera parameters.
- If no camera parameters, calling get_undistorted() or get_rectified() is an Error.
-
get_rectified
()[source]¶ Returns the 2 channels, rectified, as a list of images.
Returns: list of images Raises: ValueError, TypeError - if camera parameters are not set.
-
get_undistorted
()[source]¶ Returns the 2 channels, undistorted, as a list of images.
Returns: list of images Raises: ValueError - if you haven’t already provided camera parameters
-
set_extrinsic_parameters
(rotation, translation, dims)[source]¶ Sets the stereo extrinsic parameters.
Parameters: - rotation – 3x3 numpy array representing rotation matrix.
- translation – 3x1 numpy array representing translation vector.
- dims – new image size for rectification
Raises: ValueError, TypeError