Hi everyone,
I'm trying to rotate the image frame from my OAK-4S camera by 180 degrees using the depthai library (version 3). I initially tried using setImageOrientation on the camera node, but I received an error stating that the 'depthai.node.Camera' object has no attribute 'setImageOrientation'.
Could someone please guide me on the correct way to achieve image rotation in the current version of depthai? I need the flexibility to rotate to common angles like 90°, 180°, and 270°.
Here is the error for reference:
AttributeError: 'depthai.node.Camera' object has no attribute 'setImageOrientation'
Any help or code examples would be greatly appreciated!
Thanks.
def build_pipeline(p: dai.Pipeline):
cam = p.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_A)
cam.setImageOrientation(dai.CameraImageOrientation.ROTATE_180_DEG)
out = cam.requestOutput((VIDEO_W, VIDEO_H), dai.ImgFrame.Type.NV12, fps=FPS)
q = out.createOutputQueue(maxSize=6, blocking=True)
return q
def main():
info = dai.DeviceInfo(IP_ADDR)
with dai.Pipeline(dai.Device(info)) as p:
video_q = build_pipeline(p)
p.start()