ClassesClasses | | Operators

disp_imagedisp_imageDispImageDispImage (Operator)

Name

disp_imagedisp_imageDispImageDispImage — Displays gray value images.

Signature

disp_image(Image : : WindowHandle : )

Herror disp_image(const Hobject Image, const Hlong 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)

Description

disp_imagedisp_imageDispImageDispImageDispImage 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")) or of the whole image (set_comprise(::WindowHandle,'image':)set_comprise(WindowHandle,"image")SetComprise(WindowHandle,"image")SetComprise(WindowHandle,"image")SetComprise(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_colorSetColorSetColorSetColor) 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_systemGetSystemGetSystemGetSystem. Before opening the first window this value can be modified by set_systemset_systemSetSystemSetSystemSetSystem. 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_regionLabelToRegionLabelToRegionLabelToRegion 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_grayMinMaxGrayMinMaxGrayMinMaxGray can be used. If neccessary the image can be transformed or converted by scale_imagescale_imageScaleImageScaleImageScaleImage and convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeConvertImageType before it is displayed.

Attention

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

Execution Information

Parameters

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

Gray value image to display.

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

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");
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_imageDispImageDispImageDispImage returns 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowOpenWindow, set_rgbset_rgbSetRgbSetRgbSetRgb, set_lutset_lutSetLutSetLutSetLut, set_hsiset_hsiSetHsiSetHsiSetHsi, scale_imagescale_imageScaleImageScaleImageScaleImage, convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeConvertImageType, min_max_graymin_max_grayMinMaxGrayMinMaxGrayMinMaxGray

Alternatives

disp_objdisp_objDispObjDispObjDispObj, disp_colordisp_colorDispColorDispColorDispColor

See also

open_windowopen_windowOpenWindowOpenWindowOpenWindow, reset_obj_dbreset_obj_dbResetObjDbResetObjDbResetObjDb, set_paintset_paintSetPaintSetPaintSetPaint, set_lutset_lutSetLutSetLutSetLut, paint_graypaint_grayPaintGrayPaintGrayPaintGray, scale_imagescale_imageScaleImageScaleImageScaleImage, convert_image_typeconvert_image_typeConvertImageTypeConvertImageTypeConvertImageType, dump_windowdump_windowDumpWindowDumpWindowDumpWindow

Module

Foundation


ClassesClasses | | Operators