Hello, we are using a stationary Fixed-Focus POE OAK-D Pro to capture images. We are looking to get 1080p images from the camera. We have noticed that capturing at 4K and resizing (on the ISP) to 1080p gives higher quality images than taking images directly at 1080p. However, the resize on the ISP takes too long (on the order of ~300ms) for our application, so we would like to receive the 1080p frames.
Using this code, I created two captures of the same scene at 1080p & 4k:
import depthai as dai
import time
import cv2
def create_pipeline(resolution):
# Create a pipeline
pipeline = dai.Pipeline()
# Create a ColorCamera node and set its properties
cam = pipeline.createColorCamera()
cam.setResolution(resolution)
cam.setInterleaved(False)
cam.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
# Disable ISP processing features
cam.initialControl.setManualExposure(800, 1200)
cam.initialControl.setLumaDenoise(0)
cam.initialControl.setChromaDenoise(0)
cam.initialControl.setSaturation(0)
cam.initialControl.setSharpness(0)
xout = pipeline.createXLinkOut()
xout.setStreamName("video")
cam.video.link(xout.input)
return pipeline
def capture_and_save(pipeline, filename):
# Connect to the device and start the pipeline
with dai.Device(pipeline) as device:
# Get the video output queue
q = device.getOutputQueue(name="video", maxSize=4, blocking=False)
# Warm-up let capture a few frames to ignore any intial adjustments
for _ in range(5):
q.get()
# Capture and save the image
img = q.get().getCvFrame()
cv2.imwrite(filename, img)
# Create 4k image
pipeline_4k = create_pipeline(dai.ColorCameraProperties.SensorResolution.THE_4_K)
capture_and_save(pipeline_4k, "4k_res_isp.png")
# Create 1080p image
pipeline_1080p = create_pipeline(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
capture_and_save(pipeline_1080p, "1080p_isp.png")
I hope you can see below, there is a clear difference in visual quality (beyond 4k having more pixels). It seems as if there is some ISP processing happening that is more apparent at 1080p. I tried to control for every manual set
function in CameraControl but this was the best set of settings I could find. I also read through this doc on improving image quality, but didn't see any improvement from the suggestions.
1080p:

4K:

Is there anything I might be missing, or any suggestions? I'm also wondering if we can bypass the ISP but keep the resolution crop to 4k/1080p. Thank you