-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1209 from luxonis/fix_depth_recording
Fix depth recording
- Loading branch information
Showing
6 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--extra-index-url https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/ | ||
depthai==2.19.1.0.dev+e88af9a9db3dc630a3011dd52d1f5700cf6bf9b8 | ||
depthai-sdk==1.2.1 | ||
depthai-sdk==1.2.1 | ||
numpy==1.26.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from depthai_sdk import OakCamera, RecordType | ||
import depthai as dai | ||
|
||
FPS = 30 | ||
with OakCamera() as oak: | ||
color = oak.create_camera('CAM_A', resolution='1080p', encode='mjpeg', fps=FPS) | ||
color.config_color_camera(isp_scale=(2,3)) # 720P color frames, mjpeg | ||
|
||
stereo = oak.create_stereo(resolution='720p', fps=FPS) | ||
stereo.config_stereo(align=color, subpixel=True, lr_check=True) | ||
stereo.node.setOutputSize(640, 360) # 720p, downscaled to 640x360 (decimation filter, median filtering) | ||
# On-device post processing for stereo depth | ||
config = stereo.node.initialConfig.get() | ||
stereo.node.setPostProcessingHardwareResources(3, 3) | ||
config.postProcessing.speckleFilter.enable = True | ||
config.postProcessing.thresholdFilter.minRange = 400 | ||
config.postProcessing.thresholdFilter.maxRange = 10_000 # 10m | ||
config.postProcessing.decimationFilter.decimationFactor = 2 | ||
config.postProcessing.decimationFilter.decimationMode = dai.StereoDepthConfig.PostProcessing.DecimationFilter.DecimationMode.NON_ZERO_MEDIAN | ||
stereo.node.initialConfig.set(config) | ||
""" | ||
Depth will get encoded on-host with FFV1 codec (it supports 16bit grey), and color will be | ||
encoded on-device with MJPEG codec. FFV1 works well with .avi container, so depth video will be | ||
saved as .avi, and color video will be saved as .mp4. | ||
""" | ||
record_components = [stereo.out.depth, color.out.encoded] | ||
oak.record(record_components, './', record_type=RecordType.VIDEO).configure_syncing(True, threshold_ms=500/30) | ||
oak.start(blocking=True) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters