1

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)
sharkyenergy
  • 3,842
  • 10
  • 46
  • 97

1 Answers1

1

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

Vladimir Perković
  • 1,351
  • 3
  • 12
  • 30
  • Thank you, could you upload the images please? – sharkyenergy May 13 '20 at 06:20
  • Which images do you mean? – Vladimir Perković May 13 '20 at 06:41
  • in your post.. i cant see the two images – sharkyenergy May 13 '20 at 07:05
  • the biggest difficulty I am having at the moment with halcon is that I dont know what to do to get a certain result. so, for example, if i want to read a barcode, i have first to declare a model, then to search, then to get the result.. while most other solutions do this all automatically, you just say "barcode".. took me days to figure this out about barcodes. for every thing you want to do there are X steps you have to take before.. how can I figure out what i have to do to accomplish a specific task? – sharkyenergy May 13 '20 at 07:50
  • 1
    I think the best way to do that is look for HDevelop examples: File -> Browse HDevelop Example programs. – Vladimir Perković May 13 '20 at 09:33
  • a current example: how to set whitebalance? neither google nor the examples show how to set the WB for example for a GigE camera. – sharkyenergy May 13 '20 at 11:15
  • Don't you have the whitebalance listed under the parameter in Image Acquisition assistant? – Vladimir Perković May 13 '20 at 11:52
  • nope, could not find it... I also just created a new question for this... https://stackoverflow.com/questions/61773459/halcon-how-to-set-white-balance – sharkyenergy May 13 '20 at 11:54
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/213777/discussion-between-vladimir-perkovic-and-sharkyenergy). – Vladimir Perković May 13 '20 at 11:56