Page 3 - Important Information
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 otherdocumentation. Nation...
Page 4 - Conventions
Conventions The following conventions are used in this manual: » The » symbol leads you through nested menu items and dialog box options to a final action. The sequence File»Page Setup»Options directs you to pull down the File menu, select the Page Setup item, and select Options from the last dialog...
Page 5 - Contents
© National Instruments Corporation v IMAQ Vision for LabWindows/CVI User Manual Contents Chapter 1Introduction to IMAQ Vision About IMAQ Vision ...................................................................................................... 1-1Documentation and Examples ..........................
Page 7 - Glossary
Contents © National Instruments Corporation vii IMAQ Vision for LabWindows/CVI User Manual Training the Color Pattern Matching Algorithm............................... 5-20Defining a Search Area ..................................................................... 5-21Setting Matching Parameters and...
Page 8 - 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 softwareand associated software products, discusses the documentation andexamples available, outlines the IMAQ Vision function org...
Page 9 - Application Development Environments; IMAQ Vision Function Tree
Chapter 1 Introduction to IMAQ Vision IMAQ Vision for LabWindows/CVI User Manual 1-2 ni.com Documentation»IMAQ Vision for LabWindows/CVI FunctionReference . • Example programs—If you want examples of how to create specificapplications, go to cvi\samples\vision . • Application Notes—If you want to kn...
Page 11 - IMAQ Machine Vision Function Tree
Chapter 1 Introduction to IMAQ Vision IMAQ Vision for LabWindows/CVI User Manual 1-4 ni.com 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 lists the IMAQ Machine Vision f...
Page 12 - Creating IMAQ Vision Applications
Chapter 1 Introduction to IMAQ Vision © National Instruments Corporation 1-5 IMAQ Vision for LabWindows/CVI User Manual Creating IMAQ Vision Applications Figures 1-1 and 1-2 illustrate the steps for creating an application withIMAQ Vision. Figure 1-1 describes the general steps to designing a Vision...
Page 14 - Set Up Your Imaging System
© National Instruments Corporation 2-1 IMAQ Vision for LabWindows/CVI User Manual 2 Getting Measurement-ReadyImages This chapter describes how to set up your imaging system, acquire anddisplay an image, analyze the image, and prepare the image for additionalprocessing. Set Up Your Imaging System Bef...
Page 15 - 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 image acquisition device that meets your needs. NationalInstruments offers several image acquisition (IMAQ) devices, such asanalog color and monochrome IMAQ devices as well as digitaldevices...
Page 17 - 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 havesource image and destination image input parameters. The source imagereceives the image to process. The d...
Page 18 - 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 firstsource image. • imaqAdd(myImageB, myImageA, myImageB); This fun...
Page 19 - 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 NationalInstruments image acquisition (IMAQ) device: • Acquire a single image using imaqEasyAcquire() . When you call this fun...
Page 20 - 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 forpattern matching, or overlay informa...
Page 21 - 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 toeach image you acquire, use imaqCopyCalibrationInfo() . This function takes in a source image conta...
Page 22 - Improve an Image; Lookup Tables
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-9 IMAQ Vision for LabWindows/CVI User Manual this range in processing functions, such as determining a threshold rangeduring blob analysis. If the image quality does not meet your needs, try to improve the imagingconditi...
Page 23 - Filters
Chapter 2 Getting Measurement-Ready Images IMAQ Vision for LabWindows/CVI User Manual 2-10 ni.com transformations. For more information about these lookup tables, seeChapter 5, Image Processing , in the IMAQ Vision Concepts Manual . • imaqLookup() —Converts the pixel values of an image by replacing ...
Page 24 - Nth Order Filter; Grayscale Morphology; FFT
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-11 IMAQ Vision for LabWindows/CVI User Manual Nth Order Filter The imaqNthOrderFilter() function allows you to define a lowpass or highpass filter depending on the value of N that you choose. One specific Nth order filte...
Page 26 - Complex Image Operations
Chapter 2 Getting Measurement-Ready Images © National Instruments Corporation 2-13 IMAQ Vision for LabWindows/CVI User Manual 3. To transform your image back to the spatial domain, use imaqInverseFFT() . Complex Image Operations The imaqExtractComplexPlane() and imaqReplaceComplexPlane() functions a...
Page 27 - Interactively Defining Regions
© National Instruments Corporation 3-1 IMAQ Vision for LabWindows/CVI User Manual 3 Grayscale and ColorMeasurements This chapter describes how to take measurements from grayscale and colorimages. You can make inspection decisions based on image statistics, suchas the mean intensity level in a region...
Page 32 - Programmatically Defining Regions
Chapter 3 Grayscale and Color Measurements IMAQ Vision for LabWindows/CVI User Manual 3-6 ni.com You can also use imaqSelectPoint() , imaqSelectLine() , imaqSelectRect() , and imaqSelectAnnulus() to define regions of interest. Follow these steps to use these functions: 1. Call the function to displa...
Page 33 - Measure Grayscale Statistics
Chapter 3 Grayscale and Color Measurements © National Instruments Corporation 3-7 IMAQ Vision for LabWindows/CVI User Manual 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 tomake a new binary image. For mo...
Page 34 - Comparing Colors
Chapter 3 Grayscale and Color Measurements IMAQ Vision for LabWindows/CVI User Manual 3-8 ni.com image. Using imaqReplaceColorPlanes() , you can reassemble a color image from a set of three 8-bit images, where each image becomes one ofthe three primary components. Figure 3-4 illustrates how a color ...
Page 35 - Learning Color Information
Chapter 3 Grayscale and Color Measurements © National Instruments Corporation 3-9 IMAQ Vision for LabWindows/CVI User Manual 2. Use the entire image or regions in the image to learn the colorinformation using imaqLearnColor() , which outputs a color spectrum that contains a compact description of th...
Page 36 - Specifying the Color Information to Learn; Using the Entire Image; Using a Region in the Image
Chapter 3 Grayscale and Color Measurements IMAQ Vision for LabWindows/CVI User Manual 3-10 ni.com Figure 3-5. Template Color Information Specifying the Color Information to Learn You can learn the color information associated with an entire image,a region in an image, or multiple regions in an image...
Page 37 - Using Multiple Regions in the Image
Chapter 3 Grayscale and Color Measurements © National Instruments Corporation 3-11 IMAQ Vision for LabWindows/CVI User Manual Figure 3-7. Using a Single Region to Learn Color Distribution Using Multiple Regions in the Image The interaction of light with an object’s surface creates the observedcolor ...
Page 38 - Choosing a Color Representation Sensitivity
Chapter 3 Grayscale and Color Measurements IMAQ Vision for LabWindows/CVI User Manual 3-12 ni.com Figure 3-8. Using Multiple Regions to Learn Color Distribution Choosing a Color Representation Sensitivity When you learn a color, you need to specify the sensitivity required tospecify the color inform...
Page 39 - Ignoring Learned Colors
Chapter 3 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 thecorresponding component in the input color spectrum array to –1. Forexample, by repl...
Page 41 - Correct Image Distortion; Create a Binary Image
Chapter 4 Blob Analysis IMAQ Vision for LabWindows/CVI User Manual 4-2 ni.com Correct Image Distortion If you need to make accurate shape measurements based on the blobs inan image containing perspective and nonlinear distortion errors, correctthe distortion using the calibration information you att...
Page 42 - Improve the Binary Image; Removing Unwanted Blobs
Chapter 4 Blob Analysis © National Instruments Corporation 4-3 IMAQ Vision for LabWindows/CVI User Manual Improve the Binary Image After you threshold your image, you may want to improve the resultingbinary image with binary morphology. You can use primary binarymorphology or advanced binary morphol...
Page 43 - Separating Touching Blobs; Improving Blob Shapes; Make Particle Measurements
Chapter 4 Blob Analysis IMAQ Vision for LabWindows/CVI User Manual 4-4 ni.com If you know enough about the shape features of the blobs you want to keep,use imaqParticleFilter() to filter out particles that do not interest you. If you do not have enough information about the particles you want tokeep...
Page 46 - Convert Pixel Coordinates to Real-World Coordinates
Chapter 4 Blob Analysis © National Instruments Corporation 4-7 IMAQ Vision for LabWindows/CVI User Manual Convert Pixel Coordinates to Real-World Coordinates If you need to find the location of the center of mass or the boundingrectangle of the blobs in real-world units, use imaqTransformPixelToReal...
Page 48 - Locate Objects to Inspect
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-2 ni.com Figure 5-1 illustrates the basic steps involved in performing machinevision. Diagram items enclosed with dashed lines are optional steps. Figure 5-1. Steps to Performing Machine Vision Locate Objects to Inspect In a typic...
Page 49 - Using Edge Detection to Build a Coordinate Transform
Chapter 5 Machine Vision © National Instruments Corporation 5-3 IMAQ Vision for LabWindows/CVI User Manual appears shifted and rotated in the image you need to process. Thiscoordinate system is referred to as the measurement coordinate system.The measurement methods automatically move the ROIs to th...
Page 51 - Using Pattern Matching to Build a Coordinate Transform
Chapter 5 Machine Vision © National Instruments Corporation 5-5 IMAQ Vision for LabWindows/CVI User Manual Figure 5-3. Locating Coordinate System Axes with Two Search Areas 2. Use the options parameter to choose the options you need to locate the edges on the object, the coordinate system axis direc...
Page 53 - Choosing a Method to Build the Coordinate Transform
Chapter 5 Machine Vision © National Instruments Corporation 5-7 IMAQ Vision for LabWindows/CVI User Manual Choosing a Method to Build the Coordinate Transform The following flowchart guides you through choosing the best method forbuilding a coordinate transform for your application. Figure 5-4. Buil...
Page 55 - Finding Features Using Edge Detection
Chapter 5 Machine Vision © National Instruments Corporation 5-9 IMAQ Vision for LabWindows/CVI User Manual Programmatically Defining Regions When you have an automated application, you need to define regions ofinterest programmatically. You can programmatically define regions intwo ways: • Specify t...
Page 57 - Finding Edge Points Along One Search Contour
Chapter 5 Machine Vision © 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 bestfits the edge, as shown in Figure 5-6, use imaqFindCircularEdge() . Figure 5-6. Finding a Circular Feature These f...
Page 58 - Finding Edge Points Along Multiple Search Contours
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-12 ni.com These functions require you to input the coordinates of the points along thesearch contour. Use imaqROIProfile() to obtain the coordinates along the edge of each contour in an ROI. If you have a straight line, use imaqGe...
Page 59 - Finding Points Using Pattern Matching; Defining and Create Good Template Images; Symmetry
Chapter 5 Machine Vision © 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 similaritybetween an idealized representation of a feature, called a template, and thefeature t...
Page 60 - Feature detail; Positional information
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-14 ni.com Figure 5-7. Symmetry Feature detail A template with relatively coarse features is less sensitive to variations insize and rotation than a model with fine features. However, the model mustcontain enough detail to identify...
Page 61 - Background information; Training the Pattern Matching Algorithm; Defining a Search Area
Chapter 5 Machine Vision © National Instruments Corporation 5-15 IMAQ Vision for LabWindows/CVI User Manual Background information Unique background information in a template improves searchperformance and accuracy. Figure 5-10. Background Information Training the Pattern Matching Algorithm After yo...
Page 62 - Setting Matching Parameters and Tolerances
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-16 ni.com incorrect results. To avoid this, reduce the search area so that only thedesired pattern lies within the search area. The time required to locate a pattern in an image depends on both thetemplate size and the search area...
Page 63 - Match Mode; Minimum Contrast; Rotation Angle Ranges
Chapter 5 Machine Vision © National Instruments Corporation 5-17 IMAQ Vision for LabWindows/CVI User Manual However, there may be applications in which the assumptions used in thealgorithm are not optimal. Knowing your particular application and theimages you want to process is useful in selecting t...
Page 64 - Testing the Search Algorithm on Test Images; Finding Points Using Color Pattern Matching
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-18 ni.com Testing the Search Algorithm on Test Images To determine if your selected template or reference pattern is appropriatefor your machine vision application, test the template on a few test imagesby using imaqMatchPattern()...
Page 65 - Defining and Creating Good Color Template Images; Color Information
Chapter 5 Machine Vision © National Instruments Corporation 5-19 IMAQ Vision for LabWindows/CVI User Manual Color pattern matching returns the location of the center of the template andthe template orientation. Follow these general steps to find features in animage using color pattern matching: 1. D...
Page 66 - Training the Color Pattern Matching Algorithm
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-20 ni.com Feature Detail A template with relatively coarse features is less sensitive to variations insize and rotation than a model with fine features. However, the model mustcontain enough detail to identify it. Positional Infor...
Page 69 - Color Sensitivity; Search Strategy
Chapter 5 Machine Vision © National Instruments Corporation 5-23 IMAQ Vision for LabWindows/CVI User Manual The following are some elements in the IMAQ Vision pattern matchingalgorithm and how they influence pattern matching: color sensitivity,search strategy, color score weight, ignore background c...
Page 70 - Color Score Weight
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-24 ni.com Note Use the IMAQ_CONSERVATIVE strategy if you have multiple targets located very close to each other in the image. Decide on the best strategy by experimenting with the different options. Color Score Weight When you sea...
Page 71 - Finding Points Using Color Location
Chapter 5 Machine Vision © National Instruments Corporation 5-25 IMAQ Vision for LabWindows/CVI User Manual reference pattern in all cases, you have selected a good template.Otherwise, refine the current template, or select a better template until bothtraining and testing are successful. Finding Poi...
Page 72 - Distance Measurements
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-26 ni.com Convert Pixel Coordinates to Real-World Coordinates The measurement points you located with edge detection and patternmatching are in pixel coordinates. If you need to make measurements usingreal-world units, use imaqTra...
Page 73 - Analytic Geometry Measurements
Chapter 5 Machine Vision © National Instruments Corporation 5-27 IMAQ Vision for LabWindows/CVI User Manual Analytic Geometry Measurements Use the following functions to make geometrical measurements from thepoints you detect in the image: • imaqFitLine() —Fits a line to a set of points and computes...
Page 74 - Display Results
Chapter 5 Machine Vision IMAQ Vision for LabWindows/CVI User Manual 5-28 ni.com Use imaqFindLCDSegments() to calculate the regions of interest around each digit in an LCD or LED. To find the area of each digit, all the segmentsof the indicator must be activated. Use imaqReadLCD() to read multiple di...
Page 76 - Perspective and Nonlinear Distortion Calibration
© National Instruments Corporation 6-1 IMAQ Vision for LabWindows/CVI User Manual 6 Calibration This chapter describes how to calibrate your imaging system, savecalibration information, and attach calibration information to an image. After you set up your imaging system, you may want to calibrate yo...
Page 77 - Defining a Calibration Template; Defining a Reference Coordinate System
Chapter 6 Calibration IMAQ Vision for LabWindows/CVI User Manual 6-2 ni.com Defining a Calibration Template You can define a calibration template by supplying an image of a grid orproviding a list of pixel coordinates and their corresponding real-worldcoordinates. This section discusses the grid met...
Page 80 - Learning Calibration Information
Chapter 6 Calibration © 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 ofthe grid using the current imaging setup. For i...
Page 81 - Specifying Scaling Factors; Choosing a Region of Interest; Choosing a Learning Algorithm
Chapter 6 Calibration 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 thecalibration grid in the x and y directions and the units in which the distancesare measured. Use the GridDescriptor structure to ...
Page 82 - Using the Learning Score
Chapter 6 Calibration © National Instruments Corporation 6-7 IMAQ Vision for LabWindows/CVI User Manual IMAQ_PERSPECTIVE to choose the perspective calibration algorithm. Learning and applying perspective projection is less computationallyintensive than the nonlinear method. However, perspective proj...
Page 83 - Learning the Error Map; Learning the Correction Table; Setting the Scaling Method; Calibration Invalidation
Chapter 6 Calibration IMAQ Vision for LabWindows/CVI User Manual 6-8 ni.com Also, adjust the range parameter to distinguish the dots from the background. 3. Select another learning algorithm. When nonlinear lens distortion ispresent, using perspective projection sometimes results in a lowlearning sc...
Page 84 - Simple Calibration
Chapter 6 Calibration © 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 lensdistortion is negligible, use simple calibration. In simple calibration, a pixelcoordinate is transforme...
Page 85 - Save Calibration Information
Chapter 6 Calibration 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 donot have to relearn the information for subsequent processing. Use imaqWriteVisionFile() to save the image of the grid ...
Page 86 - Technical Support Resources; Web Support; Customer Education; System Integration
© National Instruments Corporation A-1 IMAQ Vision for LabWindows/CVI User Manual A Technical Support Resources Web Support National Instruments Web support is your first stop for help in solvinginstallation, configuration, and application problems and questions. Onlineproblem-solving and diagnostic...
Page 87 - Worldwide Support
Appendix A Technical Support Resources IMAQ Vision for LabWindows/CVI User Manual A-2 ni.com Worldwide Support National Instruments has offices located around the world to help addressyour support needs. You can access our branch office Web sites from theWorldwide Offices section of ni.com . Branch ...
Page 107 - Index
© National Instruments Corporation I-1 IMAQ Vision for LabWindows/CVI User Manual Index A acquiring measurement-ready images. See measurement-ready images, acquiring. analytic geometry measurements, 5-27analyzing images, 2-8 to 2-9Annulus tool (table), 3-2application development, 1-5 to 1-6 general ...