StereoVision source documentation

Utilities for 3d reconstruction using stereo cameras.

Modules:

  • stereo_cameras - Camera interfaces
  • calibration - Tools for calibrating stereo cameras
  • blockmatchers - Blockmatching algorithm matchers
  • point_cloud - Point clouds
  • ui_utils - Utilities for user interaction
  • exceptions - Various exceptions

Import structure:

Camera interfaces

Camera calibration

Block matchers

Point clouds

Point cloud class generated from stereo image pairs.

Classes:

  • PointCloud - Point cloud with RGB colors
class stereovision.point_cloud.PointCloud(coordinates, colors)[source]

Bases: object

3D point cloud generated from a stereo image pair.

Initialize point cloud with given coordinates and associated colors.

coordinates and colors should be numpy arrays of the same length, in which coordinates is made of three-dimensional point positions (X, Y, Z) and colors is made of three-dimensional spectral data, e.g. (R, G, B).

ply_header = 'ply\nformat ascii 1.0\nelement vertex {vertex_count}\nproperty float x\nproperty float y\nproperty float z\nproperty uchar red\nproperty uchar green\nproperty uchar blue\nend_header\n'

Header for exporting point cloud to PLY

write_ply(output_file)[source]

Export PointCloud to PLY file for viewing in MeshLab.

filter_infinity()[source]

Filter infinite distances from PointCloud.

User interface utilities

Exceptions

Various exceptions for working with stereovision.

Classes:

  • ChessboardNotFoundError

  • BadBlockMatcherArgumentError

    • StereoBMError

      • InvalidBMPresetError
      • InvalidSearchRangeError
      • InvalidWindowSizeError
    • StereoSGBMError

      • InvalidNumDisparitiesError
      • InvalidSADWindowSizeError
      • InvalidFirstDisparityChangePenaltyError
      • InvalidSecondDisparityChangePenaltyError
      • InvalidUniquenessRatioError
      • InvalidSpeckleWindowSizeError
      • InvalidSpeckleRangeError
exception stereovision.exceptions.ChessboardNotFoundError[source]

Bases: Exception

No chessboard could be found in searched image.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.BadBlockMatcherArgumentError[source]

Bases: Exception

Bad argument supplied for a BlockMatcher.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.StereoBMError[source]

Bases: stereovision.exceptions.BadBlockMatcherArgumentError

Bad argument supplied for a StereoBM.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.StereoSGBMError[source]

Bases: stereovision.exceptions.BadBlockMatcherArgumentError

Bad argument supplied for a StereoSGBM.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidBMPresetError[source]

Bases: stereovision.exceptions.StereoBMError

Invalid BM preset.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidSearchRangeError[source]

Bases: stereovision.exceptions.StereoBMError

Invalid search range.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidWindowSizeError[source]

Bases: stereovision.exceptions.StereoBMError

Invalid search range.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidNumDisparitiesError[source]

Bases: stereovision.exceptions.StereoSGBMError

Invalid number of disparities.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidSADWindowSizeError[source]

Bases: stereovision.exceptions.StereoSGBMError

Invalid search window size.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidFirstDisparityChangePenaltyError[source]

Bases: stereovision.exceptions.StereoSGBMError

Invalid first disparity change penalty.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidSecondDisparityChangePenaltyError[source]

Bases: stereovision.exceptions.StereoSGBMError

Invalid second disparity change penalty.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidUniquenessRatioError[source]

Bases: stereovision.exceptions.StereoSGBMError

Invalid uniqueness ratio.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidSpeckleWindowSizeError[source]

Bases: stereovision.exceptions.StereoSGBMError

Invalid speckle window size.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception stereovision.exceptions.InvalidSpeckleRangeError[source]

Bases: stereovision.exceptions.StereoSGBMError

Invalid speckle range.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.