Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 1.62 KB

stereo_depth_custom_mesh.rst

File metadata and controls

52 lines (33 loc) · 1.62 KB

Stereo Depth custom Mesh

This example shows how you can load custom mesh to the device and use it for depth calculation. In this example, mesh files are generated from camera calibration data, but you can also use your own mesh files.

By default, StereoDepth will use the same logic as inside the def getMesh() to calculate mesh files whenever horizontal FOV is larger than 90°. You could also force calculate the mesh using:

stereo = pipeline.create(dai.node.StereoDepth)
# Enable mesh calculation to correct distortion:
stereo.enableDistortionCorrection(True)

StereoDepth node also allows you to load mesh files directly from a file path:

stereo = pipeline.create(dai.node.StereoDepth)
stereo.loadMeshFiles('path/to/left_mesh', 'path/to/right_mesh')

Demo

image

On the image above you can see that the rectified frame isn't as wide FOV as the original one, that's because the distortion correction is applied (in this case via custom mesh files), so the disparity matching can be performed correctly.

Setup

Source code

Python

Also available on GitHub

../../../../examples/StereoDepth/stereo_depth_custom_mesh.py