Chapter2 GettingMeasurement-Ready Images
©NationalInstruments Corporation 2-7 IMAQVision for LabWindows/CVI User Manual
UseimaqReadVisionFile() to open an image file containing additional
information, such as calibration information, template information for
pattern matching, or overlayinform ation. Formore inform ation about
pattern matching templatesand overlays, see Chapter 5, Machine Vision.
Youcan also use imaqGetFileInfo() to retrieve image
properties—imagesize, recommended image type,and calibration
units—without actually reading all the image data.
Converting an Array to an Image
Use imaqArrayToImage()to convert a 2D array to an image. You can
also use imaqImageToArray()to convert an image to a 2D array.
Display an ImageDisplay an image in an external window using imaqDisplayImage().
You can display images in 16 different external windows. Use the other
display functionsto configure the appearance of each external window.
Properties you can set include whether the window has scroll bars, is
resizable,or hasa title bar. You can also use imaqMoveWindow()to
positionthe external image window at a particular location on you monitor.
See the IMAQ Vision for LabWindows/CVI function reference for a
complete list of display functions.
Note Imagewindows are not LabWindows/CVI panels. They aremanaged directly by
IMAQ Visi on.
Youcan use a color palette to display grayscale images by applying a color
paletteto the window. Use imaqSetWindowPalette() to set predefined
color palettes. Forexample, if you need to display a binary im age—an
imagecon taining particle regions with pixel valuesof 1 and a background
regionwith pi xelvalues of 0—apply the predefined binary palette. For
more information about color palettes, see the Chapter 2, Display,ofthe
IMAQ Vision Concepts Manual.
Note At the end of your application, you should close all open external windows using
imaqCloseWindow().