jakaskerl
Thanks,
Indeed, it does not hang with a single camera, but it does when I try to access two cameras. Below is a minimal example:
import depthai as dai
import cv2
# Works if you comment out CAM_A or CAM_D
# Not with both uncommented
stringToCam = {
"CAM_A": dai.CameraBoardSocket.CAM_A,
"CAM_D": dai.CameraBoardSocket.CAM_D,
}
fps = 30
pipeline = dai.Pipeline()
cams = {}
for cam_id in stringToCam.keys():
cam_node = pipeline.createColorCamera()
cam_node.initialControl.setManualFocus(135)
cam_node.setBoardSocket(stringToCam[cam_id])
cam_node.setResolution(dai.ColorCameraProperties.SensorResolution.THE_12_MP)
cam_node.setFps(fps)
cam_node.setImageOrientation(dai.CameraImageOrientation.ROTATE_180_DEG)
cam_node.setInterleaved(False)
manip = pipeline.createImageManip()
manip.initialConfig.setResizeThumbnail(1280, 720) # Hangs
manip.setMaxOutputFrameSize(1280 * 720 * 3)
cam_node.isp.link(manip.inputImage)
out = pipeline.createXLinkOut()
out.setStreamName(cam_id)
manip.out.link(out.input)
cams[cam_id] = cam_node
device = dai.Device()
device.startPipeline(pipeline)
queue = {}
for cam_id in cams.keys():
queue[cam_id] = device.getOutputQueue(cam_id, maxSize=30, blocking=True)
i = 0
while True:
frames = {}
pkts = {}
for cam in cams:
pkts[cam] = queue[cam].get()
for cam, pkt in pkts.items():
cv2.imshow(cam, pkt.getCvFrame())
cv2.waitKey(1)
Looking at the debug output, I see that the CMX memory is already at 2.49/2.5 with a single camera, maybe that's the issue ?
Thanks !
Antoine