Hi,
I have a simple code that creates a pipeline that captures both L+R mono images and the disparity map, using OAK-D SR module.
This code works perfectly when running from python3.10 environment (Distro: Linux Mint 21.3 Virginia base: Ubuntu 22.04 jammy).
When I am running the code within 3D slicer scripted module environment (python 3.9), the same pipeline is stuck in the creation (dai.Device(pipeline)).
This is the debug dump I get when there is a successful run:
[2024-12-12 22:18:15.973] [depthai] [debug] Python bindings - version: 2.29.0.0 from build: 2024-11-24 09:54:26 +0000
[2024-12-12 22:18:15.973] [depthai] [debug] Library information - version: 2.29.0, commit: d6a37a5ba8ba2ee187fabc9208b813db5f75d4a7 from 2024-11-22 15:48:55 +0100, build: 2024-11-24 09:39:00 +0000, libusb enabled: true
[2024-12-12 22:18:15.978] [depthai] [debug] Initialize - finished
[2024-12-12 22:18:16.094] [depthai] [debug] Resources - Archive 'depthai-bootloader-fwp-0.0.28.tar.xz' open: 3ms, archive read: 116ms
[2024-12-12 22:18:16.643] [depthai] [debug] Resources - Archive 'depthai-device-fwp-4d360b5c56225f23e9a3d3a3999ce46c90cfdeaf.tar.xz' open: 2ms, archive read: 666ms
/home/ajax/dev/cflow/cflow_slicer_ext/cflow_pc/point_cloud/test_camera_depth_post_processing.py:43: DeprecationWarning: HIGH_DENSITY is deprecated, will be removed in future releases and replaced with DEFAULT.
depth.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_DENSITY)
[2024-12-12 22:18:20.538] [host] [debug] Device - OpenVINO version: universal
[14442C101130B1D200] [3.2] [1734034700.538] [host] [debug] Device - BoardConfig: {"camera":[],"emmc":null,"gpio":[],"imu":null,"logDevicePrints":null,"logPath":null,"logSizeMax":null,"logVerbosity":null,"network":{"mtu":0,"xlinkTcpNoDelay":true},"nonExclusiveMode":false,"pcieInternalClock":null,"sysctl":[],"uart":[],"usb":{"flashBootedPid":63037,"flashBootedVid":999,"manufacturer":"","maxSpeed":4,"pid":63035,"productName":"","vid":999},"usb3PhyInternalClock":null,"uvc":null,"watchdogInitialDelayMs":null,"watchdogTimeoutMs":null}
libnop:
0000: b9 12 b9 07 81 e7 03 81 3b f6 81 e7 03 81 3d f6 04 bd 00 bd 00 b9 02 00 01 ba 00 be be bb 00 bb
0020: 00 be be be be be be be 00 bb 00 be be
[2024-12-12 22:18:21.508] [depthai] [debug] Searching for booted device: DeviceInfo(name=3.2, mxid=14442C101130B1D200, X_LINK_BOOTED, X_LINK_USB_VSC, X_LINK_MYRIAD_X, X_LINK_SUCCESS), name used as hint only
[14442C101130B1D200] [3.2] [1.270] [system] [info] Memory Usage - DDR: 0.12 / 333.26 MiB, CMX: 2.04 / 2.50 MiB, LeonOS Heap: 7.50 / 81.70 MiB, LeonRT Heap: 2.89 / 39.87 MiB / NOC ddr: 25 MB/s
[14442C101130B1D200] [3.2] [1.270] [system] [info] Temperatures - Average: 31.22C, CSS: 32.73C, MSS 30.56C, UPA: 30.56C, DSS: 31.04C
…
When Running within the 3D slicer, I get the following debug dump:
[2024-12-12 22:29:03.376] [depthai] [debug] Python bindings - version: 2.29.0.0 from build: 2024-11-24 09:50:04 +0000
[2024-12-12 22:29:03.376] [depthai] [debug] Library information - version: 2.29.0, commit: d6a37a5ba8ba2ee187fabc9208b813db5f75d4a7 from 2024-11-22 15:48:55 +0100, build: 2024-11-24 09:39:00 +0000, libusb enabled: true
[2024-12-12 22:29:03.380] [depthai] [debug] Initialize - finished
[2024-12-12 22:29:17.994] [host] [debug] Device - OpenVINO version: universal
[14442C101130B1D200] [3.2] [1734035357.995] [host] [debug] Device - BoardConfig: {"camera":[],"emmc":null,"gpio":[],"imu":null,"logDevicePrints":null,"logPath":null,"logSizeMax":null,"logVerbosity":null,"network":{"mtu":0,"xlinkTcpNoDelay":true},"nonExclusiveMode":false,"pcieInternalClock":null,"sysctl":[],"uart":[],"usb":{"flashBootedPid":63037,"flashBootedVid":999,"manufacturer":"","maxSpeed":4,"pid":63035,"productName":"","vid":999},"usb3PhyInternalClock":null,"uvc":null,"watchdogInitialDelayMs":null,"watchdogTimeoutMs":null}
libnop:
0000: b9 12 b9 07 81 e7 03 81 3b f6 81 e7 03 81 3d f6 04 bd 00 bd 00 b9 02 00 01 ba 00 be be bb 00 bb
0020: 00 be be be be be be be 00 bb 00 be be
The sample code is below (stuck on the last line):
# Closer-in minimum depth, disparity range is doubled (from 95 to 190):
extended_disparity = False
# Better accuracy for longer distance, fractional disparity 32-levels:
subpixel = False
# Better handling for occlusions:
lr_check = False
# Create pipeline
pipeline = dai.Pipeline()
# Define sources and outputs
monoLeft = pipeline.create(dai.node.MonoCamera)
monoRight = pipeline.create(dai.node.MonoCamera)
depth = pipeline.create(dai.node.StereoDepth)
xout = pipeline.create(dai.node.XLinkOut)
sync = pipeline.create(dai.node.Sync)
xout.setStreamName("disparity")
xout_01 = pipeline.create(dai.node.XLinkOut)
xout_01.input.setBlocking(False)
xout_01.setStreamName("mono")
# Properties
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_800_P)
monoLeft.setFps(10)
monoLeft.setCamera("left")
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_800_P)
monoRight.setCamera("right")
monoLeft.setFps(10)
# Create a node that will produce the depth map (using disparity output as it's easier to visualize depth this way)
depth.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_DENSITY)
depth.setLeftRightCheck(lr_check)
depth.setExtendedDisparity(extended_disparity)
depth.setSubpixel(subpixel)
config = depth.initialConfig.get()
config.postProcessing.median = dai.MedianFilter.KERNEL_7x7
config.postProcessing.speckleFilter.enable = True
config.postProcessing.speckleFilter.speckleRange = 10
config.postProcessing.temporalFilter.enable = False
config.postProcessing.spatialFilter.enable = True
config.postProcessing.spatialFilter.holeFillingRadius = 20
config.postProcessing.spatialFilter.numIterations = 1
config.postProcessing.thresholdFilter.minRange = 0
config.postProcessing.thresholdFilter.maxRange = 10000
config.postProcessing.decimationFilter.decimationFactor = 1
depth.initialConfig.set(config)
# Linking
monoLeft.out.link(depth.left)
monoLeft.out.link(sync.inputs['rgb'])
monoRight.out.link(depth.right)
depth.disparity.link(xout.input)
monoLeft.out.link(xout_01.input)
# Connect to device and start pipeline
with dai.Device(pipeline) as device:
Thank you for your help.