Hello everyone,
I am using the Oak-1 Lite and I am having an issue with image noise. I included some snippets of my code below as well as a picture. I would like to know if the device has any feature I might not be using that could improve image quality. The issue becomes even more noticeable when applying digital zoom.
I have already tried settings such as:
setInterpolation(dai.Interpolation.BILINEAR)
setSharpness(4)
setLumaDenoise(4)
setChromaDenoise(4)
but none of them helped.
This is a portion of the code:
`
def _create_pipeline(self):
Build DepthAI pipeline with camera, manip, encoder and XLink streams
pipeline = dai.Pipeline()
cam = pipeline.create(dai.node.ColorCamera)
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_4_K)
cam.setPreviewSize(483, 362)
cam.setInterleaved(False)
xout_preview = pipeline.create(dai.node.XLinkOut)
xout_preview.setStreamName("preview")
cam.preview.link(xout_preview.input)
manip = pipeline.create(dai.node.ImageManip)
manip.setMaxOutputFrameSize(13271040)
manip.initialConfig.setResize(self.width, self.height)
manipConfigIn = pipeline.create(dai.node.XLinkIn)
manipConfigIn.setStreamName("manip_config")
manipConfigIn.out.link(manip.inputConfig)
cam.video.link(manip.inputImage)
xout_still = pipeline.create(dai.node.XLinkOut)
xout_still.setStreamName("still_frame")
manip.out.link(xout_still.input)
enc = pipeline.create(dai.node.VideoEncoder)
enc.setDefaultProfilePreset(
self.fps, dai.VideoEncoderProperties.Profile.H264_HIGH)
manip.out.link(enc.input)
xout_enc = pipeline.create(dai.node.XLinkOut)
xout_enc.setStreamName("h264")
enc.bitstream.link(xout_enc.input)
controlIn = pipeline.create(dai.node.XLinkIn)
controlIn.setStreamName("control")
controlIn.out.link(cam.inputControl)
return pipeline
def _capture_frames(self):
Thread function that continuously captures preview frames and encoded packets
pipeline = self._create_pipeline()
with dai.Device(pipeline) as device:
logging.info({"message": "Starting frame capture using OAK camera"})
controlQueue = device.getInputQueue('control')
manipQueue = device.getInputQueue('manip_config')
q_still = device.getOutputQueue("still_frame", maxSize=1, blocking=False)
q_preview = device.getOutputQueue("preview", maxSize=30, blocking=False)
h264_queue = device.getOutputQueue("h264", maxSize=30, blocking=False)
while self.capture_thread_running:
if not self.enable_camera:
pass
self._apply_camera_control(controlQueue)
try:
frame = q_preview.get().getCvFrame()
if not self.frame_queue.full():
self.frame_queue.put(frame)
except Exception as e:
logging.debug({"message": f"Error capturing preview frame: {e}"})
try:
self.frame = q_still.get()
except Exception as e:
logging.debug({"message": f"Error capturing still frame: {e}"})
if self.is_camera_in_use:
try:
h264_packet = h264_queue.get()
if not self.h264_queue.full():
self.h264_queue.put(h264_packet)
except Exception as e:
logging.debug({"message": f"Error capturing H264 packet: {e}"})
logging.info({"message": "Frame capture thread stopped"})
def _apply_camera_control(self, controlQueue):
ctrl = dai.CameraControl()
ctrl.setBrightness(self.brightness)
ctrl.setContrast(self.contrast)
ctrl.setSaturation(self.saturation)
ctrl.setAntiBandingMode(dai.CameraControl.AntiBandingMode.MAINS_60_HZ)
ctrl.setManualExposure(
int(self.exposure_time_ms * 1000), self.iso)
controlQueue = device.getInputQueue('control')
controlQueue.send(ctrl)
`
