• Unable to read exposure time from OAK-PRO W POE

Hello. I need to get the camera frame exposure time for the purpose of my experiment and with using:

camControl = dai.CameraControl()

ET = camControl.getExposureTime().total_seconds() * 1000.

The ET is always 0.0 no matter how dim the illumination of the sample is.

I'm most probably doing something wrong, but I cannot figure out what it is.

How to read it correctly?

thanks, Jan

  • erik replied to this.

    Hi JanKanka ,

    Here's a code snippet that achieves that:

    import cv2
    import depthai as dai
    
    pipeline = dai.Pipeline()
    camRgb = pipeline.create(dai.node.ColorCamera)
    
    xoutRgb = pipeline.create(dai.node.XLinkOut)
    xoutRgb.setStreamName("rgb")
    camRgb.preview.link(xoutRgb.input)
    
    # Connect to device and start pipeline
    with dai.Device(pipeline) as device:
        qRgb = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
        while True:
            inRgb = qRgb.get()  # blocking call, will wait until a new data has arrived
            print(inRgb.getExposureTime())
            cv2.imshow("rgb", inRgb.getCvFrame())
            if cv2.waitKey(1) == ord('q'):
                break

    Thank you for the code snippet.

    Now it is showing 30ms even if the camera is facing dark object and Auto Exposure overbrighten the scene. So there is also some other kind of compensation.

    Anyhow, thank you again!

    J.