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

Define output colors (HSI-coded).

set_hsi sets the region output color(s)/grayvalue(s) for the valid window. Colors are passed as Hue, Saturation, and Intensity. Transformation from HSI to RGB is done with: H = PI * 2.0 * Hue / 255 I = * sqrt(6) * Intensity / 255 M1 = Saturation / 255 * sin(H) / sqrt(6) M2 = Saturation / 255 * cos(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 procedure 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_color,set_pixel, set_rgb or set_gray. 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_region, disp_line, disp_rectangle1, disp_rectangle2, disp_arrow, etc. It is also used by procedures with grayvalue output in certain output modes (e.g. '3D-plot','histogram', 'contourline', etc. See set_paint).


Attention

The selected intensities may not be available for the selected hues. In that case, the intensities will be lowered automatically.


Parameters

WindowHandle (input_control)
window -> integer
Window_id.

Hue (input_control)
integer(-array) -> integer
Hue for region output.
Default value: 30
Typical range of values: 0 <= Hue <= 255
Restriction: (0 <= Hue) && (Hue <= 255)

Saturation (input_control)
integer(-array) -> integer
Saturation for region output.
Default value: 255
Typical range of values: 0 <= Saturation <= 255
Restriction: (0 <= Saturation) && (Saturation <= 255)

Intensity (input_control)
integer(-array) -> integer
Intensity for region output.
Default value: 84
Typical range of values: 0 <= Intensity <= 255
Restriction: (0 <= Intensity) && (Intensity <= 255)


Result

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


Parallelization Information

set_hsi is reentrant, local, and processed without parallelization.


Possible Predecessors

get_hsi


Possible Successors

disp_region


See also

get_hsi, get_pixel, trans_from_rgb, trans_to_rgb, disp_region


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH