Search code examples
brightnesshalconexposure

Halcon - Set image brightness/exposure


I'm trying few things in Halcon for the first time. But couldnt figure out, not even in the documentation, how to set the exposure for the image aquisition... my code so far is this, but my test environment is dark, and would like to brighten up the image a little bit:

open_framegrabber ('uEye', 1, 1, 0, 0, 0, 0, 'default', -1, 'default', -1, 'default', 'default', 'default', -1, -1, AcqHandle)

dev_open_window (0, 0, 500, 300, 'light gray', WindowHandleButton)

i := 0

create_bar_code_model ([], [], BarCodeHandle)

while (i < 100)
   grab_image (Image, AcqHandle)
   find_bar_code (Image, SymbolRegions, BarCodeHandle, 'auto', DecodedDataStrings)
   get_bar_code_result (BarCodeHandle, 'all', 'decoded_types', BarCodeResults)     
   i:= i+1    
endwhile

close_framegrabber (AcqHandle)

Solution

  • You can set the exposure with:

    set_framegrabber_param (AcqHandle, 'exposure', 10.0)
    

    Using Halcon assistants is an easy way of finding and setting the parameters Assistants->Open New Image Acquisition->Source(uEye)->Connect->Parameters:

    enter image description here

    You could change the parameters there and use the last tab to generate the code automatically.

    Also using the example program examples/hdevelop/Image/Acquisition/ueye_parameters.hdev will give you the list of all available parameters on your camera:

    enter image description here