• DepthAI-v2
  • All output queues are None, not getting any frames

Hello @jakaskerl

I am working on a simple DepthAI pipeline script to test the OAK-D S2 camera and review Preview and ISP images along with scaled ISP images using the ImageManip node.

However, strangely I am not getting any frames. All my queues are always None.

DepthAI version being used is 2.25.0.0

Here is the script I am using for this test

from pathlib import Path
import cv2
import depthai as dai
import time

print("Delay Started")
time.sleep(17)
print("Delay Completed")

scaling = True
W, H = (640, 480)

# Create pipeline
pipeline = dai.Pipeline()

# Define sources and outputs
camRgb = pipeline.create(dai.node.ColorCamera)
xoutRgb = pipeline.create(dai.node.XLinkOut)
xoutISP = pipeline.create(dai.node.XLinkOut)

manip = pipeline.create(dai.node.ImageManip)
xoutManip = pipeline.create(dai.node.XLinkOut)

xoutRgb.setStreamName("rgb")
xoutISP.setStreamName("ISP")
xoutManip.setStreamName("Manip")

# Properties
camRgb.setPreviewSize(W, H)
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_12_MP)
camRgb.setInterleaved(False)
camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
camRgb.setFps(25)

manip.initialConfig.setKeepAspectRatio(False) #True
manip.initialConfig.setResize(W, H)
# Change to RGB image than BGR - Yishu
manip.initialConfig.setFrameType(dai.ImgFrame.Type.BGR888p) #dai.ImgFrame.Type.RGB888p
# setMaxOutputFrameSize to avoid image bigger than max frame size error - Yishu
#manip.setMaxOutputFrameSize(1228800)

xoutISP.input.setBlocking(False)
xoutISP.input.setQueueSize(10)
xoutManip.input.setBlocking(False)
xoutManip.input.setQueueSize(10)

camRgb.isp.link(xoutISP.input)
camRgb.preview.link(xoutRgb.input)
camRgb.isp.link(manip.inputImage)
manip.out.link(xoutManip.input)

# Connect to device and start pipeline
with dai.Device(pipeline) as device:

    # Output queues will be used to get the rgb frames and nn data from the outputs defined above
    qISP = device.getOutputQueue("ISP", 4, blocking=False)
    qRGB = device.getOutputQueue("rgb", 4, blocking=False)
    qManip = device.getOutputQueue("Manip", 4, blocking=False)

    frame = None
    rgb_preview_frame = None
    manip_frame = None
    num = 0

    while True:
        
        ###Create the folder that will contain capturing
        folder_name = "D:\\Camera_Setup_Caliberation_Data"
        path = Path(folder_name)
        path.mkdir(parents=True, exist_ok=True)

        inRGB = qRGB.tryGet()
        print("RGB_Preview: ", inRGB)
        
        inISP = qISP.tryGet()
        print("ISP: ", inISP)
        
        inManip = qManip.tryGet()
        print("Manip: ", inManip)

        if inRGB is not None:
            rgb_preview_frame = inRGB.getCvFrame()

        '''if rgb_preview_frame is not None:
            cv2.namedWindow("RGB Preview", cv2.WINDOW_NORMAL)
            cv2.imshow("RGB Preview", rgb_preview_frame)'''

        if inManip is not None:
            print("Manip not None")
            manip_frame = inManip.getCvFrame()
        
        #if manip_frame is not None:
            #cv2.imwrite("D:\\Camera_Setup_Caliberation_Data\\Manip{}.png".format(num),manip_frame)
            #cv2.namedWindow("Manip", cv2.WINDOW_NORMAL)
            #cv2.imshow("Manip", manip_frame)
        
        if inISP is not None:
            print("ISP not none")
            frame = inISP.getCvFrame()

        #if frame is not None:    
            #cv2.imwrite("D:\\Camera_Setup_Caliberation_Data\\ISP{}.png".format(num),frame)
            #cv2.namedWindow("ISP", cv2.WINDOW_NORMAL)
            #cv2.imshow("ISP", frame)
        
        num = num + 1

When I run the script I always see the following output where I am printing each queue

RGB_Preview:  None
ISP:  None
Manip:  None

Can you help me out figure why this is happening for this script whereas my other scripts work fine on the same camera.

Thanks,
Yishu

    Hi @yishu_corpex
    Are you sure no frames come through? Most loop cycles will show NONE because tryGet will return it when it doesn't have any frames waiting.

    yishu_corpex
    while True:
    ###Create the folder that will contain capturing
    folder_name = "D:\Camera_Setup_Caliberation_Data"
    path = Path(folder_name)
    path.mkdir(parents=True, exist_ok=True)

    This is bad practice, put it outside while loop.

    Thanks,
    Jaka

    Hi @jakaskerl

    I carried out some more experiments to investigate.

    As I have set blocking to False I make use of tryGet. However I have never had this issue before. It looks like no frames are coming through. I tried using get() as well but it gives me a Fata Error

    [critical] Fatal error. Please report to developers. Log: 'ResourceLocker' '358'
    [host] [warning] Device crashed, but no crash dump could be extracted.

    I ran another script right now where I am using tryGet as well but don't seem to have any issue and I am getting the frames as expected.

    Also, yes you are right about the path code lines. I have put them outside the while loop.

    Thanks,
    Yishu

    Hi @jakaskerl

    I also see this particular device the OAK-D S2 is crashing a few times today especially when out putting 12MP frame.

    It runs for sometime perfectly and the crashes.

    Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: 'depth' (X_LINK_ERROR)'
      File "C:\Spatial_3D_Measurement_Scripts\spatial_yolov6n.py", line 142, in <module>
        depth = depthQueue.get()
    RuntimeError: Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: 'depth' (X_LINK_ERROR)']

    Thanks,
    Yishu