Hi,
I’m sending RGB images at THE_1080_P and point clouds at THE_400_P from an OAK-D Pro to a Raspberry 5 over a USB 3 connection. If I’m not aligning the point cloud to the image, I’m achieving 26 FPS. But when I do align them, I only get 6 FPS. Can someone please explain why aligning the point cloud to the image slows things down so much and/or how to achieve higher frame rates?
Here is the code I’m using:
import depthai as dai
import time
pipeline = dai.Pipeline()
camRgb = pipeline.create(dai.node.ColorCamera)
monoLeft = pipeline.create(dai.node.MonoCamera)
monoRight = pipeline.create(dai.node.MonoCamera)
depth = pipeline.create(dai.node.StereoDepth)
pointcloud = pipeline.create(dai.node.PointCloud)
sync = pipeline.create(dai.node.Sync)
xOut = pipeline.create(dai.node.XLinkOut)
xOut.input.setBlocking(False)
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
camRgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)
camRgb.setFps(30)
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoLeft.setCamera("left")
monoLeft.setFps(30)
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoRight.setCamera("right")
monoRight.setFps(30)
depth.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_DENSITY)
depth.initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_7x7)
depth.setLeftRightCheck(True)
depth.setExtendedDisparity(False)
depth.setSubpixel(False)
depth.setDepthAlign(dai.CameraBoardSocket.CAM_A)
monoLeft.out.link(depth.left)
monoRight.out.link(depth.right)
depth.depth.link(pointcloud.inputDepth)
camRgb.isp.link(sync.inputs["rgb"])
pointcloud.outputPointCloud.link(sync.inputs["pcl"])
pointcloud.initialConfig.setSparse(False)
sync.out.link(xOut.input)
xOut.setStreamName("out")
with dai.Device(pipeline) as device:
q = device.getOutputQueue(name="out", maxSize=4, blocking=False)
startTime = time.time()
for i in range(1, 100):
inMessage = q.get()
print(1/((time.time() - startTime)/100))
Thank you in advance for any help.
Cheers,
Tim