Defining regions programmatically, Defining regions with masks – National Instruments IMAQ Vision for LabWindows TM /CVI User Manual

Page 35

Advertising
background image

Chapter 3

Making Grayscale and Color Measurements

IMAQ Vision for LabWindows/CVI User Manual

3-6

ni.com

The following list describes how you can display the tools palette in a
separate window and manipulate the palette.

Use

imaqShowToolWindow()

to display the tools palette in a floating

window.

Use

imaqSetupToolWindow()

to configure the appearance of the

tools palette.

Use

imaqMoveToolWindow()

to move the tools palette.

Use

imaqCloseToolWindow()

to close the tools palette.

If you want to draw an ROI without using an ROI constructor or displaying
the tools palette in a separate window, use

imaqSetCurrentTool()

.

This function allows you to select a contour from the tools palette without
opening the palette.

Defining Regions Programmatically

When you have an automated application, you may need to define regions
of interest programmatically. To programmatically define an ROI, create
the ROI using

imaqCreateROI()

, and then add the individual contours.

A contour is a shape that defines an ROI. You can create contours from
points, lines, rectangles, ovals, polygons, and annuli. For example, to add a
rectangular contour to an ROI, use

imaqAddRectContour()

.

Specify regions by providing basic parameters that describe the region you
want to define. For example, define a point by providing the x-coordinate
and y-coordinate. Define a line by specifying the start and end coordinates.
Define a rectangle by specifying the coordinates of the top, left point; the
width and height; and in the case of a rotated rectangle, the rotation angle.

Defining Regions with Masks

You can define regions to process with image masks. An image mask is
an 8-bit image of the same size as or smaller than the image you want to
process. Pixels in the mask image determine whether the corresponding
pixel in the source image needs to be processed. If a pixel in the image
mask has a value different than 0, the corresponding pixel in the source
image is processed. If a pixel in the image mask has a value of 0, the
corresponding pixel in the source image is left unchanged.

When you need to make intensity measurements on particles in an image,
you can use a mask to define the particles. First, threshold your image to
make a new binary image. For more information about binary images, refer
to Chapter 4,

Performing Particle Analysis

. You can input the binary image

Advertising