alliedvision / VimbaPython

Old Allied Vision Vimba Python API. The successor to this API is VmbPy
BSD 2-Clause "Simplified" License
93 stars 40 forks source link

ExposureAuto "Continuous" mode not working properly #110

Open AleksiJoo opened 2 years ago

AleksiJoo commented 2 years ago

Hey,

I am using Mako G-192B camera and Vimba SDK 6.0 (ARM64) on Raspberry Pi 4. I want to grab synchronous frames. I setup my camera and set ExposureAuto feature to continuous in code as seen below.

def setup_camera(cam: Camera):
    with cam:

        try:
            cam.GVSPAdjustPacketSize.run()
            while not cam.GVSPAdjustPacketSize.is_done():
                pass
        except (AttributeError, VimbaFeatureError):
            pass

        try:
            cam.ExposureAuto.set("Continuous")
        except (AttributeError, VimbaFeatureError):
            pass
        try:
            cam.ExposureAutoTarget.set(35)
        except (AttributeError, VimbaFeatureError):
            pass

I grab frames using cam.get_frame() method like seen below.

with Vimba.get_instance() as vimba:
        cams = vimba.get_all_cameras()

        with cams[0] as cam:
            setup_camera(cam)

            while True:
                frame = cam.get_frame()
                cv2.imwrite("img.jpg", frame.as_opencv_image())
                print(cam.ExposureTimeAbs.get())
... <my own code>

The problem is that even though ExposureAuto feature is set to Continuous it doesn't update the ExposureTimeAbs if the light conditions changes. It works for several cycles after rebooting camera and then it gets stuck to some value (for example 50_000). If i use camera from Vimba Viewer the feature works perfectly fine.

It also feels like ExposureAutoTarget feature is doing nothing even if i change the value. Am i doing something wrong with setting up these features or is there a problem in API?

Thanks in advance!

nordeh commented 2 years ago

Hi,

please check if ExposureAuto is limited by the value of ExposureAutoMax. That typically happens in the dark.

Thanks, Norman

AleksiJoo commented 2 years ago

Hey,

Thanks for reply. ExposureAuto Max/Min is not limiting. Those are at default values (14 and 50_000) if i remember correctly.

It seems like at first software tried to adjust the exposure time, but after few cycles it gets stuck to certain value. After that its stuck even if the picture is competely overexposed.

Manually setting ExposureAuto to Off and exposure time works, but i would like to use continuous operating mode.

nordeh commented 2 years ago

Please contact our support team to clarify your firmware version: https://www.alliedvision.com/de/kontakt/technischer-support-reparatur-/-rma/

AleksiJoo commented 2 years ago

Hey,

I checked the firmware version of camera with Python SDK and it is: 00.01.54.20700

I dont think the problem is in camera firmware version since continuous mode is working perfectly with Vimba Viewer.