Skip to content

disp_imageDispImageDispImagedisp_imageT_disp_imageπŸ”—

Short descriptionπŸ”—

disp_imageDispImageDispImagedisp_imageT_disp_image β€” Displays gray value images.

SignatureπŸ”—

disp_image( image Image, window WindowHandle )void DispImage( const HObject& Image, const HTuple& WindowHandle )static void HOperatorSet.DispImage( HObject image, HTuple windowHandle )def disp_image( image: HObject, window_handle: HHandle ) -> None

Herror T_disp_image( const Hobject Image, const Htuple WindowHandle )

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

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

void HImage.DispImage( HWindow windowHandle )

void HWindow.DispImage( HImage image )

DescriptionπŸ”—

disp_imageDispImage displays the gray values of an image in the output window. The gray value pixels of the definition domain (set_comprise(::WindowHandle,'object':)) or of the whole 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_colorSetColor) 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_systemGetSystem. Before opening the first window this value can be modified by set_systemSetSystem. 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_regionLabelToRegion 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_grayMinMaxGray can be used. If necessary the image can be transformed or converted by scale_imageScaleImage and convert_image_typeConvertImageType before it is displayed.

AttentionπŸ”—

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

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

Imageimageimage (input_object) singlechannelimage β†’ object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)

Gray value image to display.

WindowHandlewindowHandlewindow_handle (input_control) window β†’ (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

ExampleπŸ”—

(HDevelop)

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

ResultπŸ”—

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

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

open_windowOpenWindow, set_rgbSetRgb, set_lutSetLut, set_hsiSetHsi, scale_imageScaleImage, convert_image_typeConvertImageType, min_max_grayMinMaxGray

Alternatives

disp_objDispObj, disp_colorDispColor

See also

open_windowOpenWindow, reset_obj_dbResetObjDb, set_paintSetPaint, set_lutSetLut, paint_grayPaintGray, scale_imageScaleImage, convert_image_typeConvertImageType, dump_windowDumpWindow

ModuleπŸ”—

Foundation