Hello everyone,
I've been working on a pipeline that uses a 4K resolution camera combined with point clouds, but I'm running into memory issues. Below is the pipeline code I've written, but I get an "Out of memory" error when creating the pool for point cloud frames.
Pipeline Code:
def create_pipeline(self):
pipeline = dai.Pipeline()
# Camera nodes
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)
# Output streams
rgbOut = pipeline.create(dai.node.XLinkOut)
depthOut = pipeline.create(dai.node.XLinkOut)
pclOut = pipeline.create(dai.node.XLinkOut)
rgbOut.setStreamName("rgb")
depthOut.setStreamName("depth")
pclOut.setStreamName("pcl")
# Camera configurations
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_4_K)
camRgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)
camRgb.setIspScale(1, 1)
camRgb.setFps(30)
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoLeft.setBoardSocket(dai.CameraBoardSocket.CAM_B)
monoLeft.setFps(30)
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoRight.setBoardSocket(dai.CameraBoardSocket.CAM_C)
monoRight.setFps(30)
# Depth configuration
depth.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_ACCURACY)
depth.initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_3x3) # Reduced memory usage
depth.setLeftRightCheck(True)
depth.setExtendedDisparity(True) # Optimizes memory usage for distant objects
depth.setSubpixel(False) # Reduces complexity for lower memory consumption
depth.setDepthAlign(dai.CameraBoardSocket.CAM_A)
# Linking mono cameras and depth
monoLeft.out.link(depth.left)
monoRight.out.link(depth.right)
depth.depth.link(pointcloud.inputDepth)
# Asynchronous outputs
camRgb.isp.link(rgbOut.input)
pointcloud.outputPointCloud.link(pclOut.input)
depth.depth.link(depthOut.input)
# Reduce buffer size for XLinkOut nodes
pclOut.input.setBlocking(False)
pclOut.input.setQueueSize(1) # Limit the Point Cloud buffer to 1 frame
rgbOut.input.setBlocking(False)
rgbOut.input.setQueueSize(1) # Limit the RGB buffer to 1 frame
depthOut.input.setBlocking(False)
depthOut.input.setQueueSize(1) # Limit the Depth buffer to 1 frame
return pipeline
The Error I Get:
===Connected to 1844301091399F1200
MXID: 1844301091399F1200
Num of cameras: 3
USB speed: UsbSpeed.SUPER
Board name: OAK-D-LITE
[1844301091399F1200] [3.1.1] [1.219] [PointCloud(4)] [error] Out of memory while creating pool for 'point cloud' frames. Number of frames: 4 each with size: 99532800B
===Connected to 19443010018FF31200
MXID: 19443010018FF31200
Num of cameras: 3
USB speed: UsbSpeed.SUPER
Board name: OAK-D-LITE
[19443010018FF31200] [3.1.2] [1.192] [PointCloud(4)] [error] Out of memory while creating pool for 'point cloud' frames. Number of frames: 4 each with size: 99532800B
Does anyone have suggestions on how to fix this memory issue while still maintaining 4K resolution and point cloud processing? Any advice or tips would be greatly appreciated!
Thanks in advance!