Page 3 - Important Information; Warranty; WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. Nati...
Page 4 - Contents; About This Manual
© National Instruments Corporation v IMAQ Vision for LabWindows/CVI User Manual Contents About This Manual Conventions ................................................................................................................... ixRelated Documentation.............................................
Page 7 - Glossary
Contents IMAQ Vision for LabWindows/CVI User Manual viii ni.com Appendix ATechnical Support and Professional Services Glossary Index
Page 8 - Conventions; File»Page Setup»Options
© National Instruments Corporation ix IMAQ Vision for LabWindows/CVI User Manual About This Manual The IMAQ Vision for LabWindows/CVI User Manual is intended for engineers and scientists who have knowledge of the LabWindows ™ /CVI ™ programming environment and need to create machine vision and image...
Page 9 - Related Documentation; IMAQ Vision
About This Manual IMAQ Vision for LabWindows/CVI User Manual x ni.com Related Documentation In addition to this manual, the following documentation resources are available to help you create your vision application. IMAQ Vision • IMAQ Vision Concepts Manual —If you are new to machine vision and imag...
Page 10 - Other Documentation
About This Manual © National Instruments Corporation xi IMAQ Vision for LabWindows/CVI User Manual Other Documentation • Your National Instruments image acquisition (IMAQ) device user manual—If you need installation instructions and device-specific information, refer to your device user manual. • Ge...
Page 11 - Introduction to IMAQ Vision; About IMAQ Vision
© National Instruments Corporation 1-1 IMAQ Vision for LabWindows/CVI User Manual 1 Introduction to IMAQ Vision This chapter describes the IMAQ Vision for LabWindows/CVI software, outlines the IMAQ Vision function organization, and lists the steps for making a machine vision application. Note Refer ...
Page 12 - IMAQ Vision Function Tree; Function Type
Chapter 1 Introduction to IMAQ Vision IMAQ Vision for LabWindows/CVI User Manual 1-2 ni.com IMAQ Vision Function Tree The IMAQ Vision function tree ( NIVision.lfp ) contains separate classes corresponding to groups or types of functions. Table 1-1 lists the IMAQ Vision function types and gives a des...
Page 13 - IMAQ Machine Vision Function Tree
Chapter 1 Introduction to IMAQ Vision © National Instruments Corporation 1-3 IMAQ Vision for LabWindows/CVI User Manual IMAQ Machine Vision Function Tree The IMAQ Machine Vision function tree ( NIMachineVision.fp ) contains separate classes corresponding to groups or types of functions. Table 1-2 li...
Page 14 - Creating IMAQ Vision Applications
Chapter 1 Introduction to IMAQ Vision IMAQ Vision for LabWindows/CVI User Manual 1-4 ni.com Creating IMAQ Vision Applications Figures 1-1 and 1-2 illustrate the steps for creating an application with IMAQ Vision. Figure 1-1 describes the general steps to designing a Vision application. The last step...
Page 17 - Set Up Your Imaging System
© National Instruments Corporation 2-1 IMAQ Vision for LabWindows/CVI User Manual 2 Getting Measurement-Ready Images This chapter describes how to set up your imaging system, acquire and display an image, analyze the image, and prepare the image for additional processing. Set Up Your Imaging System ...
Page 18 - Calibrate Your Imaging System; Create an Image
Chapter 2 Getting Measurement-Ready Images IMAQ Vision for LabWindows/CVI User Manual 2-2 ni.com 3. Select an IMAQ device that meets your needs. National Instruments offers several IMAQ devices, including analog color and monochrome devices as well as digital devices. Visit ni.com/imaq for more info...
Page 19 - Value
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-3 IMAQ Vision for LabWindows/CVI User Manual You can create multiple images by executing imaqCreateImage() as many times as you want. Determine the number of required images through an analysis of your intended applicati...
Page 20 - Source and Destination Images
Chapter 2 Getting Measurement-Ready Images IMAQ Vision for LabWindows/CVI User Manual 2-4 ni.com Source and Destination Images Some IMAQ Vision functions that modify the contents of an image have source image and destination image input parameters. The source image receives the image to process. The...
Page 21 - mask; Acquire or Read an Image
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-5 IMAQ Vision for LabWindows/CVI User Manual • imaqAdd(myImageA, myImageA, myImageB); This function adds two source images and stores the result in the first source image. • imaqAdd(myImageB, myImageA, myImageB); This fu...
Page 22 - Acquiring an Image; Reading a File
Chapter 2 Getting Measurement-Ready Images IMAQ Vision for LabWindows/CVI User Manual 2-6 ni.com Acquiring an Image Use one of the following methods to acquire images with a National Instruments IMAQ device. • Acquire a single image using imaqEasyAcquire() . When you call this function, it initializ...
Page 23 - Converting an Array to an Image; Display an Image
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-7 IMAQ Vision for LabWindows/CVI User Manual Use imaqReadVisionFile() to open an image file containing additional information, such as calibration information, template information for pattern matching, or overlay inform...
Page 24 - Attach Calibration Information; Analyze an Image
Chapter 2 Getting Measurement-Ready Images IMAQ Vision for LabWindows/CVI User Manual 2-8 ni.com Attach Calibration Information If you want to attach the calibration information of the current setup to each image you acquire, use imaqCopyCalibrationInfo() . This function takes in a source image cont...
Page 25 - Improve an Image
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-9 IMAQ Vision for LabWindows/CVI User Manual If the image quality meets your needs, use the histogram to determine the range of pixel values that correspond to objects in the image. You can use this range in processing f...
Page 26 - Lookup Tables; Filters
Chapter 2 Getting Measurement-Ready Images IMAQ Vision for LabWindows/CVI User Manual 2-10 ni.com Lookup Tables Apply lookup table (LUT) transformations to highlight image details in areas containing significant information at the expense of other areas. A LUT transformation converts input grayscale...
Page 27 - Convolution Filter; Grayscale Morphology
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-11 IMAQ Vision for LabWindows/CVI User Manual Convolution Filter The imaqConvolve() function allows you to use a predefined set of lowpass and highpass filters. Each filter is defined by a kernel of coefficients. Use ima...
Page 28 - FFT
Chapter 2 Getting Measurement-Ready Images IMAQ Vision for LabWindows/CVI User Manual 2-12 ni.com • Closing—Removes dark pixels isolated in bright regions and smooths boundaries. • Proper-opening—Removes bright pixels isolated in dark regions and smooths the inner contours of particles. • Proper-clo...
Page 29 - Complex Image Operations
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-13 IMAQ Vision for LabWindows/CVI User Manual attenuation increases. This operation preserves all of the zero frequency information. Zero frequency information corresponds to the DC component of the image or the average ...
Page 30 - Defining Regions Interactively
© National Instruments Corporation 3-1 IMAQ Vision for LabWindows/CVI User Manual 3 Making Grayscale and Color Measurements This chapter describes how to take measurements from grayscale and color images. You can make inspection decisions based on image statistics, such as the mean intensity level i...
Page 31 - Icon
Chapter 3 Making Grayscale and Color Measurements IMAQ Vision for LabWindows/CVI User Manual 3-2 ni.com Table 3-1 describes each of the tools and the manner in which you use them. Table 3-1. Tools Palette Functions Icon Tool Name Function Selection Tool Select an ROI in the image and adjust the posi...
Page 33 - OK
Chapter 3 Making Grayscale and Color Measurements IMAQ Vision for LabWindows/CVI User Manual 3-4 ni.com You can display the IMAQ Vision tools palette as part of an ROI constructor window or in a separate, floating window. Follow these steps to invoke an ROI constructor and define an ROI from within ...
Page 34 - Tools Palette Transformation
Chapter 3 Making Grayscale and Color Measurements © National Instruments Corporation 3-5 IMAQ Vision for LabWindows/CVI User Manual 3. Click OK to populate a structure representing the ROI. You can use this structure as an input to a variety of functions, such as the following functions that measure...
Page 35 - Defining Regions Programmatically
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. • ...
Page 36 - Measure Grayscale Statistics
Chapter 3 Making Grayscale and Color Measurements © National Instruments Corporation 3-7 IMAQ Vision for LabWindows/CVI User Manual or a labeled version of the binary image as a mask image to the intensity measurement function. If you want to make color comparisons, convert the binary image into an ...
Page 38 - Comparing Colors; Learning Color Information; Specifying the Color Information to Learn
Chapter 3 Making Grayscale and Color Measurements © National Instruments Corporation 3-9 IMAQ Vision for LabWindows/CVI User Manual Comparing Colors You can use the color matching capability of IMAQ Vision to compare or evaluate the color content of an image or regions in an image. Complete the foll...
Page 39 - Using the Entire Image; Using a Region in the Image
Chapter 3 Making Grayscale and Color Measurements IMAQ Vision for LabWindows/CVI User Manual 3-10 ni.com Figure 3-6. Template Color Information The following sections explain when to learn the color information associated with an entire image, a region in an image, or multiple regions in an image. U...
Page 40 - Using Multiple Regions in the Image
Chapter 3 Making Grayscale and Color Measurements © National Instruments Corporation 3-11 IMAQ Vision for LabWindows/CVI User Manual Figure 3-8. Using a Single Region to Learn Color Distribution Using Multiple Regions in the Image The interaction of light with the object surface creates the observed...
Page 41 - Choosing a Color Representation Sensitivity; sensitivity
Chapter 3 Making Grayscale and Color Measurements IMAQ Vision for LabWindows/CVI User Manual 3-12 ni.com Figure 3-9. Using Multiple Regions to Learn Color Distribution Choosing a Color Representation Sensitivity When you learn a color, you need to specify the sensitivity required to specify the colo...
Page 42 - Ignoring Learned Colors
Chapter 3 Making Grayscale and Color Measurements © National Instruments Corporation 3-13 IMAQ Vision for LabWindows/CVI User Manual Ignoring Learned Colors Ignore certain color components in color matching by replacing the corresponding component in the input color spectrum array to –1. For example...
Page 44 - Improve the Binary Image
Chapter 4 Performing Particle Analysis IMAQ Vision for LabWindows/CVI User Manual 4-2 ni.com If all the objects in your grayscale image are either brighter or darker than your background, you can use imaqAutoThreshold() to automatically determine the optimal threshold range and threshold your image....
Page 45 - Removing Unwanted Particles; Separating Touching Particles; Improving Particle Shapes
Chapter 4 Performing Particle Analysis © National Instruments Corporation 4-3 IMAQ Vision for LabWindows/CVI User Manual Removing Unwanted Particles Use imaqRejectBorder() to remove particles that touch the border of the image. Reject particles on the border of the image when you suspect that the in...
Page 46 - Make Particle Measurements; Measurement
Chapter 4 Performing Particle Analysis IMAQ Vision for LabWindows/CVI User Manual 4-4 ni.com isthmuses while close widens the isthmuses. Close and proper-close fill small holes in the particle. Auto-median removes isthmuses and fills holes. Refer to Chapter 9, Binary Morphology , of the IMAQ Vision ...
Page 54 - Locate Objects to Inspect
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-2 ni.com Figure 5-1 illustrates the basic steps involved in performing machine vision inspection tasks. Figure 5-1. Steps to Performing Machine Vision Note Diagram items enclosed with dashed lines are optional ste...
Page 56 - Using Edge Detection to Build a Coordinate Transform
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-4 ni.com Using Edge Detection to Build a Coordinate Transform You can build a coordinate transform using two edge detection techniques. Use imaqFindTransformRect() to define a coordinate system using one rectangul...
Page 57 - options; mode
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-5 IMAQ Vision for LabWindows/CVI User Manual b. If you use imaqFindTransformRects() , specify two rectangular objects, each containing one separate, straight boundary of the object, as shown in Figure 5-3. The boundaries ...
Page 58 - Using Pattern Matching to Build a Coordinate Transform
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-6 ni.com Using Pattern Matching to Build a Coordinate Transform You can build a coordinate transform using pattern matching. Use imaqFindTransformPattern() to define a coordinate system based on the location of a ...
Page 59 - Choosing a Method to Build the Coordinate Transform
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-7 IMAQ Vision for LabWindows/CVI User Manual Choosing a Method to Build the Coordinate Transform Figure 5-4 guides you through choosing the best method for building a coordinate transform for your application. Figure 5-4....
Page 61 - Find Measurement Points; Finding Features Using Edge Detection
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-9 IMAQ Vision for LabWindows/CVI User Manual Defining Regions Programmatically When you have an automated application, you need to define ROIs programmatically. You can programmatically define regions in two ways: • Speci...
Page 62 - Finding Lines or Circles
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-10 ni.com Finding Lines or Circles If you want to find points along the edge of an object and find a line describing the edge, use imaqFindEdge() and imaqFindConcentricEdges() . The imaqFindEdge() function finds e...
Page 63 - Finding Edge Points Along One Search Contour
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-11 IMAQ Vision for LabWindows/CVI User Manual If you want to find points along a circular edge and find the circle that best fits the edge, as shown in Figure 5-6, use imaqFindCircularEdge() . Figure 5-6. Finding a Circul...
Page 64 - Finding Edge Points Along Multiple Search Contours
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-12 ni.com These functions require you to input the coordinates of the points along the search contour. Use imaqROIProfile() to obtain the coordinates along the edge of each contour in an ROI. If you have a straigh...
Page 65 - Finding Points Using Pattern Matching; Defining and Creating Good Template Images
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-13 IMAQ Vision for LabWindows/CVI User Manual Finding Points Using Pattern Matching The pattern matching algorithms in IMAQ Vision measure the similarity between an idealized representation of a feature, called a template...
Page 66 - Feature Detail
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-14 ni.com Symmetry A rotationally symmetric template, shown in Figure 5-7a, is less sensitive to changes in rotation than one that is rotationally asymmetric, shown in Figure 5-7b. A rotationally symmetric templat...
Page 67 - Background Information; Training the Pattern Matching Algorithm
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-15 IMAQ Vision for LabWindows/CVI User Manual Positional Information A template with strong edges in both the x and y directions is easier to locate. Figure 5-9a shows good positional information in both the x and y direc...
Page 68 - learningMode; Defining a Search Area
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-16 ni.com the template that are necessary for shift-invariant matching. However, if you want to match the template at any orientation, use rotation-invariant matching. Use the learningMode parameter of imaqLearnPa...
Page 69 - Setting Matching Parameters and Tolerances; Match Mode
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-17 IMAQ Vision for LabWindows/CVI User Manual Figure 5-11. Selecting a Search Area for Grayscale Pattern Matching Setting Matching Parameters and Tolerances Every pattern matching algorithm makes assumptions about the ima...
Page 70 - Minimum Contrast; Rotation Angle Ranges; Testing the Search Algorithm on Test Images
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-18 ni.com Minimum Contrast The pattern matching algorithm ignores all image regions in which contrast values fall below a set minimum contrast value. Contrast is the difference between the smallest and largest pix...
Page 71 - Using a Ranking Method to Verify Results
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-19 IMAQ Vision for LabWindows/CVI User Manual Using a Ranking Method to Verify Results The manner in which you interpret the pattern matching algorithm depends on your application. For typical alignment applications, such...
Page 72 - Defining and Creating Good Color Template Images; Color Information
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-20 ni.com 5. Set the tolerances and parameters to specify how the algorithm operates at run time using the options parameter of imaqMatchColorPattern() . 6. Test the search algorithm on test images using imaqMatch...
Page 73 - Training the Color Pattern Matching Algorithm
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-21 IMAQ Vision for LabWindows/CVI User Manual Background Information Unique background information in a template improves search performance and accuracy during the grayscale pattern matching phase. This requirement could...
Page 75 - Color Sensitivity; Search Strategy
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-23 IMAQ Vision for LabWindows/CVI User Manual The time required to locate a pattern in an image depends on both the template size and the search area. By reducing the search area or increasing the template size, you can r...
Page 76 - Color Score Weight
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-24 ni.com Choose from the following search strategies: • IMAQ_CONSERVATIVE —Uses a very small step size, the least amount of subsampling, and all the color information present in the template. The conservative str...
Page 78 - Convert Pixel Coordinates to Real-World Coordinates; Distance Measurements
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-26 ni.com 6. Test the color location algorithm on test images using imaqMatchColorPattern() . 7. Verify the results using a ranking method. You can save the template image using imaqWriteVisionFile() . Convert Pix...
Page 79 - Analytic Geometry Measurements
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-27 IMAQ Vision for LabWindows/CVI User Manual Analytic Geometry Measurements Use the following functions to make geometrical measurements from the points you detect in the image: • imaqFitLine() — Fits a line to a set of ...
Page 80 - Identify Parts Under Inspection; Classifying Samples; Start»Programs»National Instruments»Classification Training
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-28 ni.com Use imaqFindLCDSegments() to calculate the ROI around each digit in an LCD or LED. To find the area of each digit, all the segments of the indicator must be activated. Use imaqReadLCD() to read multiple ...
Page 81 - Reading Characters; Start»Programs»National Instruments»Vision»OCR
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-29 IMAQ Vision for LabWindows/CVI User Manual The following code sample provides an example of a typical classification application. ClassifierSession* session; Image* image; ROI* roi; char* fileName; // The classifier fi...
Page 82 - Reading Barcodes; type; Reading Data Matrix Barcodes
Chapter 5 Performing Machine Vision Tasks IMAQ Vision for LabWindows/CVI User Manual 5-30 ni.com Reading Barcodes Use barcode reading functions to read values encoded into 1D barcodes, Data Matrix barcodes, and PDF417 barcodes. Reading 1D Barcodes To read a 1D barcode, locate the barcode in the imag...
Page 83 - Reading PDF417 Barcodes; Display Results
Chapter 5 Performing Machine Vision Tasks © National Instruments Corporation 5-31 IMAQ Vision for LabWindows/CVI User Manual By default, imaqReadDataMatrixBarcode() assumes the barcode cells are square. If the barcodes you need to read have round cells, set the cellShape element of the options param...
Page 86 - Calibrating Images; Perspective and Nonlinear Distortion Calibration
© National Instruments Corporation 6-1 IMAQ Vision for LabWindows/CVI User Manual 6 Calibrating Images This chapter describes how to calibrate your imaging system, save calibration information, and attach calibration information to an image. After you set up your imaging system, you may want to cali...
Page 87 - Defining a Calibration Template; Start»Programs»National Instruments»Vision»Documentation»
Chapter 6 Calibrating Images IMAQ Vision for LabWindows/CVI User Manual 6-2 ni.com Refer to Chapter 5, Performing Machine Vision Tasks , for more information about applying calibration information before making measurements. Defining a Calibration Template You can define a calibration template by su...
Page 88 - Defining a Reference Coordinate System
Chapter 6 Calibrating Images © National Instruments Corporation 6-3 IMAQ Vision for LabWindows/CVI User Manual Defining a Reference Coordinate System To express measurements in real-world units, you need to define a coordinate system in the image of the grid. Use the CoordinateSystem structure to de...
Page 90 - Learning Calibration Information
Chapter 6 Calibrating Images © National Instruments Corporation 6-5 IMAQ Vision for LabWindows/CVI User Manual Figure 6-4. Defining a Coordinate System Learning Calibration Information After you define a calibration grid and reference axis, acquire an image of the grid using the current imaging setu...
Page 91 - Specifying Scaling Factors; Choosing a Region of Interest; roi; Choosing a Learning Algorithm
Chapter 6 Calibrating Images IMAQ Vision for LabWindows/CVI User Manual 6-6 ni.com Specifying Scaling Factors Scaling factors are the real-world distances between the dots in the calibration grid in the x and y directions and the units in which the distances are measured. Use the GridDescriptor stru...
Page 92 - Using the Learning Score
Chapter 6 Calibrating Images © National Instruments Corporation 6-7 IMAQ Vision for LabWindows/CVI User Manual Choose the perspective projection algorithm when your system exhibits perspective errors only. A perspective projection calibration has an accurate transformation even in areas not covered ...
Page 93 - range; Learning the Error Map; Learning the Correction Table; Setting the Scaling Method; Calibration Invalidation
Chapter 6 Calibrating Images IMAQ Vision for LabWindows/CVI User Manual 6-8 ni.com If the learning process returns a learning score below 600, try the following: 1. Make sure your grid complies with the guidelines listed in the Defining a Calibration Template section of this chapter. 2. Check the li...
Page 94 - Simple Calibration; system
Chapter 6 Calibrating Images © National Instruments Corporation 6-9 IMAQ Vision for LabWindows/CVI User Manual Simple Calibration When the axis of your camera is perpendicular to the image plane and lens distortion is negligible, use simple calibration. In simple calibration, a pixel coordinate is t...
Page 95 - Save Calibration Information
Chapter 6 Calibrating Images IMAQ Vision for LabWindows/CVI User Manual 6-10 ni.com Save Calibration Information After you learn the calibration information, you can save it so that you do not have to relearn the information for subsequent processing. Use imaqWriteVisionFile() to save the image of t...
Page 97 - Numbers
© National Instruments Corporation G-1 IMAQ Vision for LabWindows/CVI User Manual Glossary Numbers 1D One-dimensional. 2D Two-dimensional. 3D Three-dimensional. A AIPD The National Instruments internal image file format used for saving complex images and calibration information associated with an im...
Page 114 - Index; Numerics
© National Instruments Corporation I-1 IMAQ Vision for LabWindows/CVI User Manual Index Numerics 1D barcodes, reading, 5-302D arrays, converting to images, 2-5, 2-7 A acquiring, images, 2-5analyzing components of color images, 3-7images, 2-8particles, 4-1 applications, creating Vision, 1-4applying, ...