Hello! I have pipeline configuration for OAK-D camera as can be seen here:
def create_pipeline(window="cam", FPS=FPS):
dict = {'1080': dai.ColorCameraProperties.SensorResolution.THE_1080_P, '12mp': dai.ColorCameraProperties.SensorResolution.THE_12_MP, '4k': dai.ColorCameraProperties.SensorResolution.THE_4_K}
pipeline = dai.Pipeline()
pipeline.setXLinkChunkSize(0) # might decrease the latency
camRgb = pipeline.create(dai.node.ColorCamera)
camRgb.setResolution(dict[args.res]) # Internal Downscaling. It reduces the image res. while keeping aspect ratio and FOV.
camRgb.setInterleaved(False)
camRgb.setFps(FPS)
camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.RGB)
# camRgb.initialControl.setManualFocus(20) # 0..255 0 is far; 255 is near
rgbOut = pipeline.create(dai.node.XLinkOut) # LinkOut node is used to send data from the device to the host via XLink
rgbOut.setStreamName("rgb")
rgbOut.input.setBlocking(False)
rgbOut.input.setQueueSize(1)
# video
h = int(args.height)
if window == "video":
camRgb.video.link(rgbOut.input)
camRgb.setVideoSize(1920, h) # DepthAI is a cropping operation
print(f"[FRAME] get VIDEO height: {camRgb.getVideoHeight()}")
elif window == "cam": # 300x300 preview
camRgb.setPreviewSize(1920,h)
camRgb.setPreviewKeepAspectRatio(False)
camRgb.preview.link(rgbOut.input)
print(f"[FRAME] get CAM height: {camRgb.getPreviewHeight()}")
elif window == "isp":
camRgb.isp.link(rgbOut.input)
# camRgb.setIspScale(2, 3) # 4056x3040 -> 1920
print(f"[FRAME] get ISP height: {camRgb.getIspHeight()}")
elif window == "still":
camRgb.still.link(rgbOut.input)
# camRgb.setIspScale(1, 3) # 4056x3040 -> 1920
print(f"[FRAME] get STILL height: {camRgb.getStillHeight()}")
elif window == "letterbox":
manip = pipeline.create(dai.node.ImageManip)
byteFrame = 1920*3*h
manip.setMaxOutputFrameSize(byteFrame) # 1920, 600x3
manip.initialConfig.setResizeThumbnail(1920, h)
camRgb.video.link(manip.inputImage)
print(f"[FRAME] get LETTERBOX height: {camRgb.getVideoHeight()}")
print(f"[FRAME] get LETTERBOX width: {camRgb.getVideoWidth()}")
manip.out.link(rgbOut.input)
return pipeline
This configuration does not include zooming. I would like to have 540x1920 frame which is the 2x zoomed version of the 1080x1920 frame. I searched on it in the forum but couldn't find any workaround doing this. How can it be achieved?
Thanks, Uce