Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hackassin
GitHub Repository: hackassin/learnopencv
Path: blob/master/Depth-Perception-Using-Stereo-Camera/README.md
3119 views

Depth Estimation using Stereo Camera and OpenCV

Create a custom low-cost stereo camera and capture depth maps with it using OpenCV.

Directory Structure

All the code files and folders follow the following structure.

├── cpp │ ├── disparity2depth_calib.cpp │ ├── disparity_params_gui.cpp │ ├── obstacle_avoidance.cpp │ └── CMakeLists.txt ├── data │ ├── depth_estimation_params.xml │ ├── depth_estimation_params_cpp.xml │ ├── depth_estmation_params_py.xml │ ├── depth_params.xml │ └── stereo_rectify_maps.xml ├── python │ ├── disparity2depth_calib.py │ ├── disparity_params_gui.py │ ├── obstacle_avoidance.py │ └── requirements.txt └── README.md

Instructions

C++

To run the code in C++, please go into the cpp folder, then compile the disparity_params_gui.cpp, obstacle_avoidance.cpp and disparity2depth_calib.cpp code files, use the following:

mkdir build cd build cmake .. cmake --build . --config Release

Use the following commands to execute the compiled files:

./build/disparity_params_gui ./build/disparity2depth_calib ./build/obstacle_avoidance

Python

To run the code in Python, please go into the python folder and refer to the following to use the disparity_params_gui.py, obstacle_avoidance.py and disparity2depth_calib.py files respectively:

python3 disparity_params_gui.py python3 disparity2depth_calib.py python3 obstacle_avoidance.py

AI Courses by OpenCV

Want to become an expert in AI? AI Courses by OpenCV is a great place to start.