Hello, im currently using the OAK-D PRO using USB 3.0 and was programming a script that activates the camera and records the color, left and right streams using UDP signals that will all be used later on for pose estimation. I ran into a problem where while giving as input the fps as 60 i get 40 fps for the Color and if i enable the creation of the Left and Right streams, that fps is dropped to 22 fps, I got a USB Controller just for the camera alone to try to see if it improves anything it didnt. I would like some help in what can be causing this issue. Also im using Depthai = 2.21.2.0 version
`
import time
from datetime import timedelta
import depthai as dai
extended_disparity = False
subpixel = True
lr_check = False
def getStereoCamera(pipeline):
stereo = pipeline.createStereoDepth()
stereo.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_DENSITY)
stereo.setDepthAlign(dai.CameraBoardSocket.LEFT)
stereo.initialConfig.setConfidenceThreshold(175)
stereo.initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_7x7)
stereo.setLeftRightCheck(lr_check)
stereo.setSubpixel(subpixel)
config = stereo.initialConfig.get()
stereo.initialConfig.set(config)
return stereo
def getMonoCamera(pipeline, left, mono_reso, fps,shape):
mono = pipeline.createMonoCamera()
mono.setResolution(mono_reso)
if left:
mono.setBoardSocket(dai.CameraBoardSocket.LEFT)
else :
mono.setBoardSocket(dai.CameraBoardSocket.RIGHT)
shape = (640,400)
if(mono_reso==dai.MonoCameraProperties.SensorResolution.THE_720_P):
shape = (1280,720)
if(mono_reso==dai.MonoCameraProperties.SensorResolution.THE_800_P):
shape = (1280,800)
mono.setFps(fps)
return mono, shape
def getColorCamera(pipeline, color_reso,fps_record):
color = pipeline.createColorCamera()
color.setBoardSocket(dai.CameraBoardSocket.CENTER)
color.setResolution(color_reso)
shape = (1920,1080)
if(color_reso==dai.ColorCameraProperties.SensorResolution.THE_4_K):
shape = (3840,2160)
if(color_reso==dai.ColorCameraProperties.SensorResolution.THE_12_MP):
shape = (4056,3040)
color.setFps(fps_record)
return color , shape
def getFrame(queue):
frame = queue.get()
return frame.getCvFrame()
def getXLinkOut(pipeline, name):
link = pipeline.createXLinkOut()
link.setStreamName(name)
link.input.setBlocking(False)
link.input.setQueueSize(10) # Ensure this queue size is large enough
return link
def addImage(frames,msg, type):
frames[type] = msg[type].getCvFrame()
return frames
`
thats the utility file that i use to customize the pipeline.
`COLOR_RESOLUTION = dai.ColorCameraProperties.SensorResolution.THE_1080_P
COLOR_RESOLUTION_2 = dai.ColorCameraProperties.SensorResolution.THE_800_P
MONO_RESOLUTION = dai.MonoCameraProperties.SensorResolution.THE_800_P
MONO_RESOLUTION_2 = dai.MonoCameraProperties.SensorResolution.THE_400_P
def getPipeline(device):
pipeline = dai.Pipeline()
if len(device.getIrDrivers())>0:
device.setIrLaserDotProjectorBrightness(1200)
global TARGET_COLOR_SHAPE
global TARGET_MONO_SHAPE
global fps_video
fps_video = 60
fps_mono = 60
colorCam, TARGET_COLOR_SHAPE = getColorCamera(pipeline,COLOR_RESOLUTION,fps_record=fps_video)
outColor = getXLinkOut(pipeline,"color")
if left_right :
leftCam, TARGET_MONO_SHAPE = getMonoCamera(pipeline= pipeline , left = True, fps= fps_mono, mono_reso= MONO_RESOLUTION_2,shape=TARGET_COLOR_SHAPE)
rightCam, TARGET_MONO_SHAPE = getMonoCamera(pipeline= pipeline , left = False, fps= fps_mono, mono_reso= MONO_RESOLUTION_2,shape=TARGET_COLOR_SHAPE)
outLeft = getXLinkOut(pipeline= pipeline , name= "left")
outRight = getXLinkOut(pipeline= pipeline , name= "right")
colorCam.video.link(outColor.input)
if left_right :
leftCam.out.link(outLeft.input)
rightCam.out.link(outRight.input)
return pipeline
`
and this is how i create the streams in the main pipeline. Is there a way to have every stream works in 60 fps or it will always drop since im using multiple streams ?