Operator Reference

set_hsiT_set_hsiSetHsiSetHsiset_hsi (Operator)

set_hsiT_set_hsiSetHsiSetHsiset_hsi — Define output colors (HSI-coded).

Signature

set_hsi( : : WindowHandle, Hue, Saturation, Intensity : )

Herror T_set_hsi(const Htuple WindowHandle, const Htuple Hue, const Htuple Saturation, const Htuple Intensity)

void SetHsi(const HTuple& WindowHandle, const HTuple& Hue, const HTuple& Saturation, const HTuple& Intensity)

void HWindow::SetHsi(const HTuple& Hue, const HTuple& Saturation, const HTuple& Intensity) const

void HWindow::SetHsi(Hlong Hue, Hlong Saturation, Hlong Intensity) const

def set_hsi(window_handle: HHandle, hue: MaybeSequence[int], saturation: MaybeSequence[int], intensity: MaybeSequence[int]) -> None

Description

set_hsiset_hsiSetHsiSetHsiset_hsi sets the region output color(s)/gray value(s) for the valid window. Colors are passed as HueHueHuehuehue, SaturationSaturationSaturationsaturationsaturation, and IntensityIntensityIntensityintensityintensity. Transformation from HSI to RGB is done with:

The value range is clipped to 0 to 255.

If only one combination is passed, all output will take place in that color. If a tuple of colors is passed, the output color of regions and geometric objects is modulo to the number of colors. HALCON always begins output with the first color passed. Note, that the number of output colors depends on the number of objects that are displayed in one operator call. If only single objects are displayed, they always appear in the first color, even if the consist of more than one connected components.

Selected colors are used until the next call of set_colorset_colorSetColorSetColorset_color,set_rgbset_rgbSetRgbSetRgbset_rgb or set_grayset_graySetGraySetGrayset_gray. Colors are relevant to windows, i.e., only the colors of the valid window can be set. Region output colors are used by operators like disp_regiondisp_regionDispRegionDispRegiondisp_region, disp_linedisp_lineDispLineDispLinedisp_line, disp_rectangle1disp_rectangle1DispRectangle1DispRectangle1disp_rectangle1, disp_rectangle2disp_rectangle2DispRectangle2DispRectangle2disp_rectangle2, disp_arrowdisp_arrowDispArrowDispArrowdisp_arrow, etc. It is also used by operators with gray value output in certain output modes (e.g., '3d_plot'"3d_plot""3d_plot""3d_plot""3d_plot", see set_paintset_paintSetPaintSetPaintset_paint).

Attention

The colors are internally stored as RGB triples. Some HSI triples can not be represented by a valid RGB triple (i.e. in the range 0..255). In this case the nearest color which can be represented is used instead.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

HueHueHuehuehue (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Hue for region output.

Default: 30

Value range: 0 ≤ Hue Hue Hue hue hue ≤ 255

SaturationSaturationSaturationsaturationsaturation (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Saturation for region output.

Default: 255

Value range: 0 ≤ Saturation Saturation Saturation saturation saturation ≤ 255

IntensityIntensityIntensityintensityintensity (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Intensity for region output.

Default: 84

Value range: 0 ≤ Intensity Intensity Intensity intensity intensity ≤ 255

Result

set_hsiset_hsiSetHsiSetHsiset_hsi returns 2 ( H_MSG_TRUE) if the window is valid and the output colors are displayable. Otherwise an exception is raised.

Possible Predecessors

get_hsiget_hsiGetHsiGetHsiget_hsi

Possible Successors

disp_regiondisp_regionDispRegionDispRegiondisp_region

See also

get_hsiget_hsiGetHsiGetHsiget_hsi, trans_from_rgbtrans_from_rgbTransFromRgbTransFromRgbtrans_from_rgb, trans_to_rgbtrans_to_rgbTransToRgbTransToRgbtrans_to_rgb, disp_regiondisp_regionDispRegionDispRegiondisp_region

Module

Foundation