In this example: https://github.com/luxonis/depthai-experiments/blob/master/gen2-social-distancing/depthai_utils.py
It shows the depth set up with the rgb:
camRgb = pipeline.create(dai.node.ColorCamera)
spatialDetectionNetwork = pipeline.create(dai.node.MobileNetSpatialDetectionNetwork)
monoLeft = pipeline.create(dai.node.MonoCamera)
monoRight = pipeline.create(dai.node.MonoCamera)
stereo = pipeline.create(dai.node.StereoDepth)
xoutRgb = pipeline.create(dai.node.XLinkOut)
camRgb.preview.link(xoutRgb.input)
xoutNN = pipeline.create(dai.node.XLinkOut)
xoutRgb.setStreamName("rgb")
xoutNN.setStreamName("detections")
# Properties
camRgb.setPreviewSize(544, 320)
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
camRgb.setInterleaved(False)
camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoLeft.setBoardSocket(dai.CameraBoardSocket.LEFT)
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoRight.setBoardSocket(dai.CameraBoardSocket.RIGHT)
# Setting node configs
stereo.setConfidenceThreshold(255)
spatialDetectionNetwork.setBlobPath(blobconverter.from_zoo(name=model_name, shaves=6))
spatialDetectionNetwork.setConfidenceThreshold(0.5)
spatialDetectionNetwork.input.setBlocking(False)
spatialDetectionNetwork.setBoundingBoxScaleFactor(0.5)
spatialDetectionNetwork.setDepthLowerThreshold(100)
spatialDetectionNetwork.setDepthUpperThreshold(5000)
# Linking
monoLeft.out.link(stereo.left)
monoRight.out.link(stereo.right)
camRgb.preview.link(spatialDetectionNetwork.input)
spatialDetectionNetwork.out.link(xoutNN.input)
stereo.depth.link(spatialDetectionNetwork.inputDepth)
stereo.setDepthAlign(dai.CameraBoardSocket.RGB)
The rgb frame is set to 544,320 into the SpatialDetectionNetwork.
The depth resolution is set, but never the size.
The only alignment or "matching" comes from this line: stereo.setDepthAlign(dai.CameraBoardSocket.RGB)
Are the previous alignment checks no longer necessary?
stereo->setLeftRightCheck(true);
stereo->setOutputSize(st->rgb_dai_preview_x, st->depth_rgb_preview_y);