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