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_imageDispImageDispImagedisp_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")set_comprise(WindowHandle,"object")) or of the whole image (set_comprise(::WindowHandle,'image':)set_comprise(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_colorSetColorSetColorset_color) and the window manager. Also depending on the number of bit planes on the used output device often less than 256 colors (eight bit planes) are available. The number of ”colors” actually reserved for the display of gray values can be queried by get_systemget_systemGetSystemGetSystemget_system. Before opening the first window this value can be modified by set_systemset_systemSetSystemSetSystemset_system. For instance for 8 bit planes 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_regionLabelToRegionLabelToRegionlabel_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_grayMinMaxGrayMinMaxGraymin_max_gray can be used. If necessary the image can be transformed or converted by scale_imagescale_imageScaleImageScaleImagescale_image and convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeconvert_image_type before it is displayed.

Attention

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

Execution Information

Parameters

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

Gray value image to display.

WindowHandleWindowHandleWindowHandlewindowHandlewindow_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)

Result

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

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowopen_window, set_rgbset_rgbSetRgbSetRgbset_rgb, set_lutset_lutSetLutSetLutset_lut, set_hsiset_hsiSetHsiSetHsiset_hsi, scale_imagescale_imageScaleImageScaleImagescale_image, convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeconvert_image_type, min_max_graymin_max_grayMinMaxGrayMinMaxGraymin_max_gray

Alternatives

disp_objdisp_objDispObjDispObjdisp_obj, disp_colordisp_colorDispColorDispColordisp_color

See also

open_windowopen_windowOpenWindowOpenWindowopen_window, reset_obj_dbreset_obj_dbResetObjDbResetObjDbreset_obj_db, set_paintset_paintSetPaintSetPaintset_paint, set_lutset_lutSetLutSetLutset_lut, paint_graypaint_grayPaintGrayPaintGraypaint_gray, scale_imagescale_imageScaleImageScaleImagescale_image, convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeconvert_image_type, dump_windowdump_windowDumpWindowDumpWindowdump_window

Module

Foundation