Stereo Recording¶
This example shows how to record disparity map to a file.
Note
Visualization in current example is done with blocking behavor. This means that the program will halt at oak.start()
until the window is closed.
This is done to keep the example simple. For more advanced usage, see Blocking behavior section.
Setup¶
Please run the install script to download all required dependencies. Please note that this script must be ran from git context, so you have to download the depthai repository first and then run the script
git clone https://github.com/luxonis/depthai.git
cd depthai/
python3 install_requirements.py
For additional information, please follow our installation guide.
Pipeline¶
Source Code¶
Also available on GitHub.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import cv2 from depthai_sdk import OakCamera from depthai_sdk.visualize.configs import StereoColor with OakCamera() as oak: color = oak.create_camera('color', resolution='1080p', fps=30) stereo = oak.create_stereo('400p', fps=30) stereo.config_postprocessing( colorize=StereoColor.RGB, colormap=cv2.COLORMAP_JET ) stereo.config_wls( wls_level='high' # options: 'low', 'medium', 'high' ) # Record RGB and disparity to records folder # Record doesn't work with visualize so the config is ignored # oak.record([color.out.main, stereo.out.disparity], 'records') # Record depth only oak.visualize(stereo.out.disparity, record_path='disparity.mp4') oak.start(blocking=True) |