This tool provides a graphical interface for adjusting the disparity map parameters of a stereo vision system. It includes visualizations for depth maps and point clouds and allows for real-time tuning of stereo vision parameters.
- Disparity Map Adjustment: Adjust parameters like numDisparities, blockSize, preFilterCap, uniquenessRatio, etc.
- Depth Map Visualization: View the depth map in grayscale or color.
- Point Cloud Visualization: Visualize the 3D point cloud generated from the disparity map.
- Image Display Modes: Switch between RGB, BGR, and Greyscale display modes for rectified images.
- Algorithm Toggle: Switch between SGBM and BM stereo matching algorithms.
- WLS Filter: Option to apply WLS (Weighted Least Squares) filter to the disparity map.
- Video Playback: Play, pause, and seek within stereo video files.
- Live Feed Support: Use live stereo camera feeds.
Before running the tool, create a config/config.yml
file with the following structure:
left_folder: path/to/left/images
right_folder: path/to/right/images
left_camera_config: path/to/left/camera/config.yml
right_camera_config: path/to/right/camera/config.yml
baseline: 120 # mm
BGR: False # Leave False for RGB or Greyscale.
Live: False # Set to True for live stereo feed.
Note: The camera configurations should be in OpenCV format.
To set up the virtual environment and install the required dependencies, follow these steps:
-
Create a Virtual Environment:
python -m venv venv
-
Activate the Virtual Environment:
-
On Windows:
venv\Scripts\activate
-
On macOS and Linux:
source venv/bin/activate
-
-
Install the Required Dependencies:
pip install -r requirements.txt
-
Initialize and Run:
python stereo_vision_app.py
-
Adjust Parameters: Use the sliders on the left panel to adjust the disparity map parameters.
-
Switch Modes: Use the buttons on the top panel to switch display modes, toggle depth map color, change algorithms, and apply the WLS filter.
-
Video Controls: Use the play/pause button and slider to control video playback.
-
Live Feed: If using live stereo feed, ensure cameras are properly connected and configured.
To run the application, execute the script:
python stereo_matching.py
The application window will open, allowing you to adjust stereo vision parameters and visualize the results in real-time.
You can save the current settings to a file for later use. Use the 'Save Settings' button and provide a filename.