Skip to main content

Stereo vision made simple

Project description

SimpleStereo

Stereo Vision Made Simple.

SimpleStereo aims at being a high level framework for stereo vision applications. It is written in Python 3, with C++ extensions. Documentation is available at https://decadenza.github.io/SimpleStereo/

Dependencies

  • Python 3 (tested with 3.9.2)
  • NumPy
  • SciPy
  • OpenCV
  • matplotlib (for data visualisation purposes)

Installation

Option 1

Install package from PyPI with:

pip3 install simplestereo

Option 2

Download the latest version and unzip. Then, from the folder containing setup.py, run:

pip3 install .

Basic example

SimpleStereo helps you with common tasks. You can calibrate two cameras and initialise a stereoRig with:

import simplestereo as ss

# Path to your images
images = [
    ("0_left.png", "0_right"),
    ("1_left.png", "1_right"),
    ("2_left.png", "2_right"),
    ...
    ]

# Calibrate and build StereoRig object
rig = ss.calibration.chessboardStereo( images, chessboardSize=(7,6), squareSize=60.5 )

# Save rig object to file
rig.save("myRig.json")

# Optionally print some info
print("Reprojection error:", rig.reprojectionError)
print("Centers:", rig.getCenters())
print("Baseline:", rig.getBaseline())

More advanced examples available in the examples folder.

Features and Future Work

General

  • StereoRig, RectifiedStereoRig and StructuredLightRig classes to easily manage your stereo rigs and their calibration
  • Basic stereo capture using OpenCV cv2.videoCapture
  • Export and import point cloud to PLY file

Calibration algorithms

  • Chessboard calibration (one and two cameras)
  • Camera-projector calibration adapted (Moreno D. et al.), adapted from procam (ss.calibration.chessboardProCam)
  • Camera-projector calibration alternative version (ss.calibration.chessboardProCamWhite)

Stereo rectification algorithms

  • Fusiello et al., A compact algorithm for rectification of stereo pairs, 2000 (ss.rectification.fusielloRectify)
  • Wrapper of OpenCV algorithm (ss.rectification.stereoRectify)
  • Loop and Zhang, Computing rectifying homographies for stereo vision, 1999 (ss.rectification.loopRectify)
  • Lafiosca and Ceccaroni, Rectifying homographies for stereo vision: analytical solution for minimal distortion, 2022, https://doi.org/10.1007/978-3-031-10464-0_33 (ss.rectification.directRectify, see also DirectStereoRectification)

Passive stereo matching algorithms

  • Adaptive Support Weight algorithm (K. Yoon et al., Adaptive support-weight approach for correspondence search, 2006)
  • Geodesic Support Weight algorithm (simplified implementation, credits Asmaa Hosni et al.)

Active and Structured light algorithms

Unwrapping algorithms

Contributions

Reporting issues and proposing integrations of other stereo vision algorithms is highly encouraged and it will be acknowledged. Please share your thoughts!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SimpleStereo-1.0.3.tar.gz (67.3 kB view details)

Uploaded Source

File details

Details for the file SimpleStereo-1.0.3.tar.gz.

File metadata

  • Download URL: SimpleStereo-1.0.3.tar.gz
  • Upload date:
  • Size: 67.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.60.0 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

File hashes

Hashes for SimpleStereo-1.0.3.tar.gz
Algorithm Hash digest
SHA256 33ba106bfaa5e2d1bc38e71a05e0c4b366d6717e71f1c32c952224f34d868d16
MD5 ef78e98587aadb3cb5213a886c723a08
BLAKE2b-256 e7957b6eaf393b68320fb4bb68d9f795196cb94f4d384bc4c6370eaf4e8f738d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page