HALCON Reference Manual 10.0.2
Table of Contents / Graphics / Parameters ClassesClassesClasses | | | Operators

set_hsiset_hsiset_hsiSetHsiSetHsi (Operator)

Name

set_hsiset_hsiset_hsiSetHsiSetHsi — Define output colors (HSI-coded).

Signature

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

Herror set_hsi(const Hlong WindowHandle, const Hlong Hue, const Hlong Saturation, const Hlong Intensity)

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

Herror set_hsi(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 HOperatorSetX.SetHsi(
[in] VARIANT WindowHandle, [in] VARIANT Hue, [in] VARIANT Saturation, [in] VARIANT Intensity)

void HWindowX.SetHsi(
[in] VARIANT Hue, [in] VARIANT Saturation, [in] VARIANT Intensity)

static void HOperatorSet.SetHsi(HTuple windowHandle, HTuple hue, HTuple saturation, HTuple intensity)

void HWindow.SetHsi(HTuple hue, HTuple saturation, HTuple intensity)

void HWindow.SetHsi(int hue, int saturation, int intensity)

Description

set_hsiset_hsiset_hsiSetHsiSetHsi sets the region output color(s)/grayvalue(s) for the valid window. Colors are passed as HueHueHueHuehue, SaturationSaturationSaturationSaturationsaturation, and IntensityIntensityIntensityIntensityintensity. Transformation from HSI to RGB is done with:

H = PI * 2.0 * Hue / 255
I = * sqrt(6) * Intensity / 255
M1 = Saturation / 255 * cos(H) / sqrt(6)
M2 = Saturation / 255 * sin(H) / sqrt(2)

R  = (2.0*M1      + I) / 4 * sqrt(6)
G  =    (-M1 + M2 + I) / 4 * sqrt(6)
B  =    (-M1 - M2 + I) / 4 * sqrt(6)

Red = R * 255
Green = G * 255
Blue = B * 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_colorset_colorSetColorSetColor,set_pixelset_pixelset_pixelSetPixelSetPixel, set_rgbset_rgbset_rgbSetRgbSetRgb or set_grayset_grayset_graySetGraySetGray. Colors are relevant to windows, i.e. only the colors of the valid window can be set. Region output colors are used by operatores like disp_regiondisp_regiondisp_regionDispRegionDispRegion, disp_linedisp_linedisp_lineDispLineDispLine, disp_rectangle1disp_rectangle1disp_rectangle1DispRectangle1DispRectangle1, disp_rectangle2disp_rectangle2disp_rectangle2DispRectangle2DispRectangle2, disp_arrowdisp_arrowdisp_arrowDispArrowDispArrow, etc. It is also used by operators with gray value output in certain output modes (e.g. '3d_plot_lines','histogram', 'contourline', etc. See set_paintset_paintset_paintSetPaintSetPaint).

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.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Window_id.

HueHueHueHuehue (input_control)  integer(-array) HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Hue for region output.

Default value: 30

Typical range of values: 0 ≤ Hue Hue Hue Hue hue ≤ 255

Restriction: (0 <= Hue) && (Hue <= 255)

SaturationSaturationSaturationSaturationsaturation (input_control)  integer(-array) HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Saturation for region output.

Default value: 255

Typical range of values: 0 ≤ Saturation Saturation Saturation Saturation saturation ≤ 255

Restriction: (0 <= Saturation) && (Saturation <= 255)

IntensityIntensityIntensityIntensityintensity (input_control)  integer(-array) HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Intensity for region output.

Default value: 84

Typical range of values: 0 ≤ Intensity Intensity Intensity Intensity intensity ≤ 255

Restriction: (0 <= Intensity) && (Intensity <= 255)

Result

set_hsiset_hsiset_hsiSetHsiSetHsi 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_hsiget_hsiGetHsiGetHsi

Possible Successors

disp_regiondisp_regiondisp_regionDispRegionDispRegion

See also

get_hsiget_hsiget_hsiGetHsiGetHsi, get_pixelget_pixelget_pixelGetPixelGetPixel, trans_from_rgbtrans_from_rgbtrans_from_rgbTransFromRgbTransFromRgb, trans_to_rgbtrans_to_rgbtrans_to_rgbTransToRgbTransToRgb, disp_regiondisp_regiondisp_regionDispRegionDispRegion

Module

Foundation


Table of Contents / Graphics / Parameters ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH