Stereo vision made Simple.
SimpleStereo is 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/
Before starting, be sure to have the latest setuptools
package by running pip install --upgrade setuptools
. Then proceed with one of the two options below.
Install package from PyPI with:
pip3 install simplestereo
Clone or download the latest version and unzip. Then, from the folder containing setup.py
, run:
pip3 install .
I am aware of some issues while installing SimpleStereo. If you have errors during installation, please open an issue.
If during installation you get, together with other messages, the following error:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Please install the Microsoft C++ Build Tools as indicated. These are required to build C++ extensions that are part of SimpleStereo. More information about compiling on Windows is available at https://wiki.python.org/moin/WindowsCompilers.
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 examples available in the examples folder.
StereoRig
, RectifiedStereoRig
and StructuredLightRig
classes to easily manage your stereo rigs and their calibrationcv2.videoCapture
ss.calibration.chessboardProCam
)ss.calibration.chessboardProCamWhite
)ss.rectification.fusielloRectify
)ss.rectification.stereoRectify
)ss.rectification.loopRectify
)ss.rectification.directRectify
, see also DirectStereoRectification)Documentation follows numpydoc style guide.
Install documentation prerequisites with:
pip install Sphinx numpydoc
Build documentation with:
cd sphinx-documentation-generator
sh BUILD_SCRIPT.sh
cd ..
Reporting issues and proposing integrations of other stereo vision algorithms is highly encouraged and it will be acknowledged. Please share your issues!