disp_imageT_disp_imageDispImageDispImagedisp_image (Operator)

Name

disp_imageT_disp_imageDispImageDispImagedisp_image — Displays gray value images.

Signature

disp_image(Image : : WindowHandle : )

Herror T_disp_image(const Hobject Image, const Htuple WindowHandle)

void DispImage(const HObject& Image, const HTuple& WindowHandle)

void HImage::DispImage(const HWindow& WindowHandle) const

void HWindow::DispImage(const HImage& Image) const

static void HOperatorSet.DispImage(HObject image, HTuple windowHandle)

void HImage.DispImage(HWindow windowHandle)

void HWindow.DispImage(HImage image)

def disp_image(image: HObject, window_handle: HHandle) -> None

Description

disp_imagedisp_imageDispImageDispImageDispImagedisp_image displays the gray values of an image in the output window. The gray value pixels of the definition domain (set_comprise(::WindowHandle,'object':)set_comprise(WindowHandle,"object")SetComprise(WindowHandle,"object")SetComprise(WindowHandle,"object")SetComprise(WindowHandle,"object")set_comprise(WindowHandle,"object")) or of the whole image (set_comprise(::WindowHandle,'image':)set_comprise(WindowHandle,"image")SetComprise(WindowHandle,"image")SetComprise(WindowHandle,"image")SetComprise(WindowHandle,"image")set_comprise(WindowHandle,"image")) are used. Restriction to the definition domain is the default.

For the display of gray value images the number of gray values is usually reduced. This is due to the fact that colors have to be reserved for the display of graphics (e.g. set_colorset_colorSetColorSetColorSetColorset_color) and the window manager. Also depending on the number of bitplanes on the used output device often less than 256 colors (eight bitplanes) are available. The number of ”colors” actually reserved for the display of gray values can be queried by get_systemget_systemGetSystemGetSystemGetSystemget_system. Before opening the first window this value can be modified by set_systemset_systemSetSystemSetSystemSetSystemset_system. For instance for 8 bitplanes 200 real gray values are the default.

The reduction of the number of gray values does not pose problems as long as only gray value information is displayed, humans cannot distinguish 256 different shades of gray. If certain gray values are used for the representation of region information (which is not the style commonly used in HALCON), confusions might be the result, since different numerical values are displayed on the screen with the same gray value. The operator label_to_regionlabel_to_regionLabelToRegionLabelToRegionLabelToRegionlabel_to_region should be used on these images in order to transform the label data into HALCON objects.

If images of type 'int2', 'int4', 'int8', 'real' or 'complex' are displayed, the smallest and largest gray value is computed. For images of the type 'complex' this computation is based on the corresponding power spectrum. Afterwards the pixel data is rescaled according to the number of available gray values (depending on the output device. e.g. 200). It is possible that some pixels have a very different value than the other pixels. This might lead to the display of an (almost) completely white or black image. In order to decide if the current image is a binary image min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray can be used. If necessary the image can be transformed or converted by scale_imagescale_imageScaleImageScaleImageScaleImagescale_image and convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeConvertImageTypeconvert_image_type before it is displayed.

Attention

If a wrong output mode was set by set_paintset_paintSetPaintSetPaintSetPaintset_paint, the error will be reported when disp_imagedisp_imageDispImageDispImageDispImagedisp_image is used.

Execution Information

Parameters

ImageImageImageImageimageimage (input_object)  singlechannelimage objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)

Gray value image to display.

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

Window handle.

Example (HDevelop)

* Output of a gray image:
read_image(Image,'monkey')
disp_image(Image,WindowHandle)

Example (C)

/* Output of a gray image: */
read_image(&Image,"monkey");
T_disp_image(Image,WindowHandle);

Example (HDevelop)

* Output of a gray image:
read_image(Image,'monkey')
disp_image(Image,WindowHandle)

Example (HDevelop)

* Output of a gray image:
read_image(Image,'monkey')
disp_image(Image,WindowHandle)

Example (HDevelop)

* Output of a gray image:
read_image(Image,'monkey')
disp_image(Image,WindowHandle)

Result

If the used image contains valid values and a correct output mode is set, disp_imagedisp_imageDispImageDispImageDispImagedisp_image returns 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window, set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb, set_lutset_lutSetLutSetLutSetLutset_lut, set_hsiset_hsiSetHsiSetHsiSetHsiset_hsi, scale_imagescale_imageScaleImageScaleImageScaleImagescale_image, convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeConvertImageTypeconvert_image_type, min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGraymin_max_gray

Alternatives

disp_objdisp_objDispObjDispObjDispObjdisp_obj, disp_colordisp_colorDispColorDispColorDispColordisp_color

See also

open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window, reset_obj_dbreset_obj_dbResetObjDbResetObjDbResetObjDbreset_obj_db, set_paintset_paintSetPaintSetPaintSetPaintset_paint, set_lutset_lutSetLutSetLutSetLutset_lut, paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray, scale_imagescale_imageScaleImageScaleImageScaleImagescale_image, convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeConvertImageTypeconvert_image_type, dump_windowdump_windowDumpWindowDumpWindowDumpWindowdump_window

Module

Foundation