15.11   Named Parameters

Python offers users the choice to specify the name of function parameters on the call site. As seen with the call to open_framegrabber, this can help improve readability of code.

framegrabber = ha.open_framegrabber(
    name='File',
    horizontal_resolution=1,
    vertical_resolution=1,
    image_width=0,
    image_height=0,
    start_row=0,
    start_column=0,
    field='default',
    bits_per_channel=-1,
    color_space='default',
    generic=-1,
    external_trigger='default',
    camera_type='board/board.seq',
    device='default',
    port=1,
    line_in=-1
)

Compare this to a version without named parameters:

framegrabber = ha.open_framegrabber('File', 1, 1, 0, 0, 0, 0, 'default', -1,
  'default', -1, 'default', 'board/board.seq', 'default', 1, -1
)

For example, what does the 0 at position 7 mean?

We suggest using named parameters where it makes it easier for readers to understand what is going on.

Note that HALCON does not offer 100% backwards compatibility for operator parameter names. Should a parameter change, this will be noted in the compatibility notes, and can be quickly addressed with some string replacements.