set_paintT_set_paintSetPaintSetPaintset_paint (Operator)

Name

set_paintT_set_paintSetPaintSetPaintset_paint — Define the gray value output mode.

Signature

set_paint( : : WindowHandle, Mode : )

Herror T_set_paint(const Htuple WindowHandle, const Htuple Mode)

void SetPaint(const HTuple& WindowHandle, const HTuple& Mode)

void HWindow::SetPaint(const HTuple& Mode) const

static void HOperatorSet.SetPaint(HTuple windowHandle, HTuple mode)

void HWindow.SetPaint(HTuple mode)

def set_paint(window_handle: HHandle, mode: Sequence[Union[int, str, float]]) -> None

Description

set_paintset_paintSetPaintSetPaintSetPaintset_paint defines the output mode for gray value display (single- or multichannel) in the window. The mode is used by disp_objdisp_objDispObjDispObjDispObjdisp_obj, disp_imagedisp_imageDispImageDispImageDispImagedisp_image, and disp_colordisp_colorDispColorDispColorDispColordisp_color.

Different image types and their possible implication on the ModeModeModeModemodemode:

In most cases the setting ModeModeModeModemodemode 'default'"default""default""default""default""default" is the most suitable.

Depending on the selected mode, the ModeModeModeModemodemode may accept a tuple as value. In these cases the entries can be passed the following ways:

If the current mode is 'default'"default""default""default""default""default", HALCON chooses a suitable algorithm for the output of 2- and 3-channel images. No set_paintset_paintSetPaintSetPaintSetPaintset_paint call is necessary in this case.

Apart from set_paintset_paintSetPaintSetPaintSetPaintset_paint there are other operators that affect the output of gray values. The most important of them are set_partset_partSetPartSetPartSetPartset_part, set_part_styleset_part_styleSetPartStyleSetPartStyleSetPartStyleset_part_style and set_lutset_lutSetLutSetLutSetLutset_lut. Some output modes display gray values using region output (e.g., '3d_plot'"3d_plot""3d_plot""3d_plot""3d_plot""3d_plot"). In these modes, parameters set with set_colorset_colorSetColorSetColorSetColorset_color, set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb, set_hsiset_hsiSetHsiSetHsiSetHsiset_hsi, set_shapeset_shapeSetShapeSetShapeSetShapeset_shape, set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidthset_line_width and set_insertset_insertSetInsertSetInsertSetInsertset_insert influence gray value output. In case of unexpected results, check the values of the display parameters.

All available painting modes can be queried with query_paintquery_paintQueryPaintQueryPaintQueryPaintquery_paint. Possible values for ModeModeModeModemodemode:

'default'"default""default""default""default""default"

Optimal display on given hardware (default value). Its behavior depends on the number of channels of the input image:

['3d_plot', Mode, Step, qa, qb, qc, qd, ZoomFac, CenterRow, CenterCol, CenterHeight]["3d_plot", Mode, Step, qa, qb, qc, qd, ZoomFac, CenterRow, CenterCol, CenterHeight]["3d_plot", Mode, Step, qa, qb, qc, qd, ZoomFac, CenterRow, CenterCol, CenterHeight]["3d_plot", Mode, Step, qa, qb, qc, qd, ZoomFac, CenterRow, CenterCol, CenterHeight]["3d_plot", Mode, Step, qa, qb, qc, qd, ZoomFac, CenterRow, CenterCol, CenterHeight]["3d_plot", Mode, Step, qa, qb, qc, qd, ZoomFac, CenterRow, CenterCol, CenterHeight]

Gray values are interpreted as a 3D height field and displayed using OpenGL. Thereby the different parameters are:

Automatic parameter determination: You can set 'qa'"qa""qa""qa""qa""qa" (fourth value in the tuple) or 'ZoomFac'"ZoomFac""ZoomFac""ZoomFac""ZoomFac""ZoomFac" (eighth value in the tuple) to 'auto'"auto""auto""auto""auto""auto". Then, the zooming factor and the center of view are determined automatically such that the plot of the height field fills the window as good as possible. By setting 'qa'"qa""qa""qa""qa""qa" to 'auto'"auto""auto""auto""auto""auto", the previous orientation (or the default one) is kept. By setting 'ZoomFac'"ZoomFac""ZoomFac""ZoomFac""ZoomFac""ZoomFac" to 'auto'"auto""auto""auto""auto""auto", the provided orientation is used. It is important that the part of the window is set correctly (using set_partset_partSetPartSetPartSetPartset_part) before set_paintset_paintSetPaintSetPaintSetPaintset_paint is called. It is not possible to set any parameters after 'auto'"auto""auto""auto""auto""auto" in the tuple. Furthermore 'auto'"auto""auto""auto""auto""auto" will only work correctly if 'scale_plot'"scale_plot""scale_plot""scale_plot""scale_plot""scale_plot" is set to 'true'"true""true""true""true""true" using set_window_paramset_window_paramSetWindowParamSetWindowParamSetWindowParamset_window_param. Example: set_paint(WindowHandle, ['3d_plot','shaded',4,'auto']set_paint(WindowHandle, ["3d_plot","shaded",4,"auto"]SetPaint(WindowHandle, ["3d_plot","shaded",4,"auto"]SetPaint(WindowHandle, ["3d_plot","shaded",4,"auto"]SetPaint(WindowHandle, ["3d_plot","shaded",4,"auto"]set_paint(WindowHandle, ["3d_plot","shaded",4,"auto"]

This mode allows interactive display of the 3D data. For an interactive rate, your graphics card needs to be powerful enough and support OpenGL. See the operator update_window_poseupdate_window_poseUpdateWindowPoseUpdateWindowPoseUpdateWindowPoseupdate_window_pose for an intuitive way of modifying the parameters of the 3D plot (e.g., with the mouse).

The colors of the axis are influenced by the colors set using set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb, set_colorset_colorSetColorSetColorSetColorset_color, and set_coloredset_coloredSetColoredSetColoredSetColoredset_colored. The first three colors set this way are used as colors for row, column, and height axis (in this order).

Additional parameters concerning the 3D plot can be set using the operator set_window_paramset_window_paramSetWindowParamSetWindowParamSetWindowParamset_window_param.

If you intend to use '3d_plot'"3d_plot""3d_plot""3d_plot""3d_plot""3d_plot" on a Unix-like system, make sure you have sufficient permissions on your graphics device.

Restrictions: Only for one-channel images.

Default: ['3d_plot','shaded',8,0.939,-0.052,0.296, -0.165,0.401,0.072, -0.047,-0.073]["3d_plot","shaded",8,0.939,-0.052,0.296, -0.165,0.401,0.072, -0.047,-0.073]["3d_plot","shaded",8,0.939,-0.052,0.296, -0.165,0.401,0.072, -0.047,-0.073]["3d_plot","shaded",8,0.939,-0.052,0.296, -0.165,0.401,0.072, -0.047,-0.073]["3d_plot","shaded",8,0.939,-0.052,0.296, -0.165,0.401,0.072, -0.047,-0.073]["3d_plot","shaded",8,0.939,-0.052,0.296, -0.165,0.401,0.072, -0.047,-0.073]

['vector_field', Mode, Step, MinLength, ScaleLength, CircleSize]["vector_field", Mode, Step, MinLength, ScaleLength, CircleSize]["vector_field", Mode, Step, MinLength, ScaleLength, CircleSize]["vector_field", Mode, Step, MinLength, ScaleLength, CircleSize]["vector_field", Mode, Step, MinLength, ScaleLength, CircleSize]["vector_field", Mode, Step, MinLength, ScaleLength, CircleSize]

Output a vector field. Thus, for ModeModeModeModemodemode 'vector_field'"vector_field""vector_field""vector_field""vector_field""vector_field" a circle is drawn for each vector at the position of the pixel. Furthermore, a line segment is drawn with the current vector. Thereby the different parameters are:

It should be noted that by setting 'vector_field'"vector_field""vector_field""vector_field""vector_field""vector_field" only the internal parameters 'Mode'"Mode""Mode""Mode""Mode""Mode", 'Step'"Step""Step""Step""Step""Step", 'MinLength'"MinLength""MinLength""MinLength""MinLength""MinLength", 'ScaleLength'"ScaleLength""ScaleLength""ScaleLength""ScaleLength""ScaleLength", and 'CircleSize'"CircleSize""CircleSize""CircleSize""CircleSize""CircleSize" are changed. The current display mode is not changed.

Vector field images are always displayed as vector fields, no matter which ModeModeModeModemodemode is selected with set_paintset_paintSetPaintSetPaintSetPaintset_paint.

Example: set_paint(WindowHandle,['vector_field','auto',16,2,3,5])set_paint(WindowHandle,["vector_field","auto",16,2,3,5])SetPaint(WindowHandle,["vector_field","auto",16,2,3,5])SetPaint(WindowHandle,["vector_field","auto",16,2,3,5])SetPaint(WindowHandle,["vector_field","auto",16,2,3,5])set_paint(WindowHandle,["vector_field","auto",16,2,3,5])

This results in an output of every 16th vector, that is longer than 2 pixels. Each vector is multiplied by 3 for output..

Restrictions: Only for vector field images.

Execution Information

Parameters

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

Window handle.

ModeModeModeModemodemode (input_control)  string-array HTupleSequence[Union[int, str, float]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Output mode. Additional parameters possible.

Default value: 'default' "default" "default" "default" "default" "default"

List of values: '3d_plot'"3d_plot""3d_plot""3d_plot""3d_plot""3d_plot", 'default'"default""default""default""default""default", 'vector_field'"vector_field""vector_field""vector_field""vector_field""vector_field"

Result

set_paintset_paintSetPaintSetPaintSetPaintset_paint returns TRUE if the parameter is correct and the window is valid. Otherwise an exception is raised.

Possible Predecessors

query_paintquery_paintQueryPaintQueryPaintQueryPaintquery_paint, get_paintget_paintGetPaintGetPaintGetPaintget_paint

Possible Successors

disp_imagedisp_imageDispImageDispImageDispImagedisp_image

See also

get_paintget_paintGetPaintGetPaintGetPaintget_paint, query_paintquery_paintQueryPaintQueryPaintQueryPaintquery_paint, disp_imagedisp_imageDispImageDispImageDispImagedisp_image, set_shapeset_shapeSetShapeSetShapeSetShapeset_shape, set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb, set_colorset_colorSetColorSetColorSetColorset_color, set_grayset_graySetGraySetGraySetGrayset_gray, set_window_paramset_window_paramSetWindowParamSetWindowParamSetWindowParamset_window_param, update_window_poseupdate_window_poseUpdateWindowPoseUpdateWindowPoseUpdateWindowPoseupdate_window_pose

Module

Foundation