Hi,
I'm trying to use the following code (with an OAK-1), but still got no success on canceling the frequency banding on the image. Any ideas on the problem? Thanks!
import cv2
import depthai as dai
pipeline = dai.Pipeline()
camRgb = pipeline.create(dai.node.ColorCamera)
controlIn = pipeline.create(dai.node.XLinkIn)
controlIn.setStreamName('control')
xoutVideo = pipeline.create(dai.node.XLinkOut)
xoutVideo.setStreamName("video")
camRgb.setBoardSocket(dai.CameraBoardSocket.RGB)
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_4_K)
xoutVideo.input.setBlocking(False)
xoutVideo.input.setQueueSize(1)
camRgb.video.link(xoutVideo.input)
controlIn.out.link(camRgb.inputControl)
frameWidth, frameHeight = camRgb.getResolutionWidth(), camRgb.getResolutionHeight()
w = int(frameWidth / 5)
h = int(frameHeight / 5)
with dai.Device(pipeline) as device:
video = device.getOutputQueue(name="video", maxSize=1, blocking=False)
controlQueue = device.getInputQueue('control')
while True:
ctrl = dai.CameraControl()
ctrl.setManualFocus(115)
ctrl.setManualExposure(3000, 500)
ctrl.setAntiBandingMode(dai.CameraControl.AntiBandingMode.MAINS_60_HZ)
controlQueue.send(ctrl)
videoIn = video.get()
frame = videoIn.getCvFrame()
frame = cv2.resize(frame, (w, h))
cv2.imshow("video", frame)
if cv2.waitKey(1) == ord('q'):
break