Hi erik ,
Here is my code.
import cv2
import depthai as dai
import blobconverter
import time
import numpy as np
pipeline = dai.Pipeline()
monoLeft = pipeline.create(dai.node.MonoCamera)
monoLeft.setCamera("left")
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P)
monoLeft.setFps(60)
print(monoLeft.getResolutionSize())
monoRight = pipeline.create(dai.node.MonoCamera)
monoRight.setCamera("right")
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P)
monoRight.setFps(60)
depth = pipeline.create(dai.node.StereoDepth)
depth.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_DENSITY)
depth.initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_7x7)
depth.setLeftRightCheck(True)
depth.setExtendedDisparity(True)
depth.setSubpixel(True)
xdepthout = pipeline.create(dai.node.XLinkOut)
xdepthout.setStreamName('depth')
monoLeft.out.link(xdepthout.input)
monoLeft.out.link(depth.left)
monoRight.out.link(depth.right)
depth.disparity.link(xdepthout.input)
with dai.Device(pipeline) as device:
depth = device.getOutputQueue(name='depth')
while True:
depthFrame = depth.tryGet()
if depthFrame is not None:
print(depthFrame.getCvFrame())
if cv2.waitKey(1) == ord('q'):
break