National Instruments IMAQ User Manual

Manual is about: Vision for Visual Basic

Summary of IMAQ

  • Page 1

    Imaq tm imaq vision for visual basic user manual imaq vision for visual basic user manual august 2004 edition part number 371257a-01.

  • Page 2

    Support worldwide technical support and product information ni.Com national instruments corporate headquarters 11500 north mopac expressway austin, texas 78759-3504 usa tel: 512 683 0100 worldwide offices australia 1800 300 800, austria 43 0 662 45 79 90 0, belgium 32 0 2 757 00 20, brazil 55 11 326...

  • 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 other documentation. Nati...

  • Page 4: Contents

    © national instruments corporation v imaq vision for visual basic user manual contents about this manual conventions ...................................................................................................................Ix related documentation...............................................

  • Page 5

    Contents imaq vision for visual basic user manual vi ni.Com improve an image.......................................................................................................... 2-9 lookup tables................................................................................................. 2-...

  • Page 6

    Contents © national instruments corporation vii imaq vision for visual basic user manual set search areas ............................................................................................................5-8 defining regions interactively.......................................................

  • Page 7

    Contents imaq vision for visual basic user manual viii ni.Com chapter 6 calibrating images perspective and nonlinear distortion calibration......................................................... 6-1 defining a calibration template.......................................................................

  • Page 8: About This Manual

    © national instruments corporation ix imaq vision for visual basic user manual about this manual the imaq vision for visual basic user manual is intended for engineers and scientists who have knowledge of microsoft visual basic and need to create machine vision and image processing applications usin...

  • Page 9: Related Documentation

    About this manual imaq vision for visual basic user manual x ni.Com related documentation this manual assumes that you are familiar with visual basic and can use activex controls in visual basic. The following are good sources of information about visual basic and activex controls: • msdn.Microsoft....

  • Page 10

    About this manual © national instruments corporation xi imaq vision for visual basic user manual • ni vision builder for automated inspection: inspection help —if you need information about how to run an automated vision inspection system using ni vision builder ai, refer to this help file. Other do...

  • Page 11: Introduction to Imaq Vision

    © national instruments corporation 1-1 imaq vision for visual basic user manual 1 introduction to imaq vision this chapter describes the imaq vision for visual basic software and associated software products, discusses the documentation and examples available, outlines the imaq vision for visual bas...

  • Page 12

    Chapter 1 introduction to imaq vision imaq vision for visual basic user manual 1-2 ni.Com in addition to this manual, several documentation resources are available to help you create a vision application: • imaq vision concepts manual —if you are new to machine vision and imaging, read this manual t...

  • Page 13

    Chapter 1 introduction to imaq vision © national instruments corporation 1-3 imaq vision for visual basic user manual cwimaq.Ocx cwimaq.Ocx contains the following three activex controls and a collection of activex objects: cwimaq, cwimaqvision, and cwimaqviewer. Refer to the activex objects section ...

  • Page 14

    Chapter 1 introduction to imaq vision imaq vision for visual basic user manual 1-4 ni.Com niocr.Ocx niocr.Ocx provides one activex control and a collection of activex objects you use in a machine vision application to perform optical character recognition (ocr). Niocr control use this control to per...

  • Page 15

    Chapter 1 introduction to imaq vision © national instruments corporation 1-5 imaq vision for visual basic user manual tip refer to the source code of the cwmachinevision control for an example of how to use the cwimaqvision methods. Activex objects use the objects to group related input parameters a...

  • Page 16

    Chapter 1 introduction to imaq vision imaq vision for visual basic user manual 1-6 ni.Com figure 1-1. General steps for designing a vision application set up your imaging system calibrate your imaging system create an image acquire or read an image display an image attach calibration information ana...

  • Page 17

    Chapter 1 introduction to imaq vision © national instruments corporation 1-7 imaq vision for visual basic user manual figure 1-2. Inspection steps for building a vision application define regions of interest chapter 3: making grayscale and color measurements measure grayscale statistics measure colo...

  • Page 18: Getting Measurement-Ready

    © national instruments corporation 2-1 imaq vision for visual basic user manual 2 getting measurement-ready images this chapter describes how to set up an imaging system, acquire and display an image, analyze the image, and prepare the image for additional processing. Set up your imaging system befo...

  • Page 19: Create An Image

    Chapter 2 getting measurement-ready images imaq vision for visual basic user manual 2-2 ni.Com color and monochrome devices as well as digital devices. Visit ni.Com/imaq for more information about imaq devices. 4. Configure the driver software for the image acquisition device. If you have a national...

  • Page 20

    Chapter 2 getting measurement-ready images © national instruments corporation 2-3 imaq vision for visual basic user manual • complex • 32-bit rgb • 32-bit hsl • 64-bit rgb when you create an image, it is an 8-bit image by default. You can set the type property on the image object to change the image...

  • Page 21: Acquire Or Read An Image

    Chapter 2 getting measurement-ready images imaq vision for visual basic user manual 2-4 ni.Com acquire or read an image after you create an image, you can acquire an image into the imaging system in one of the following three ways: • acquire an image with a camera through the image acquisition devic...

  • Page 22

    Chapter 2 getting measurement-ready images © national instruments corporation 2-5 imaq vision for visual basic user manual if you want to acquire multiple frames, set the image count to the number of frames you want to acquire. This operation is called a sequence . Use a sequence for applications th...

  • Page 23: Display An Image

    Chapter 2 getting measurement-ready images imaq vision for visual basic user manual 2-6 ni.Com private sub stop_click() cwimaq1.Stop end sub reading a file use the cwimaqvision.Readimage method to open and read data from a file stored on the computer into the image reference. You can read from image...

  • Page 24: Analyze An Image

    Chapter 2 getting measurement-ready images © national instruments corporation 2-7 imaq vision for visual basic user manual the viewer. You can set the cwimaqpalette.Type property to apply predefined color palettes. For example, if you need to display a binary image—an image that contains particle re...

  • Page 25

    Chapter 2 getting measurement-ready images imaq vision for visual basic user manual 2-8 ni.Com use cwimaqvision.Histogram2 to analyze the overall grayscale distribution in the image. Use the histogram of the image to analyze two important criteria that define the quality of an image—saturation and c...

  • Page 26: Improve An Image

    Chapter 2 getting measurement-ready images © national instruments corporation 2-9 imaq vision for visual basic user manual improve an image using the information you gathered from analyzing the image, you may want to improve the quality of the image for inspection. You can improve the image with loo...

  • Page 27

    Chapter 2 getting measurement-ready images imaq vision for visual basic user manual 2-10 ni.Com highpass filters emphasize details, such as edges, object boundaries, or cracks. These details represent sharp transitions in intensity value. You can define your own highpass filter with cwimaqvision.Con...

  • Page 28

    Chapter 2 getting measurement-ready images © national instruments corporation 2-11 imaq vision for visual basic user manual use cwimaqvision.Graymorphology to perform one of the following seven transformations: • erosion—reduces the brightness of pixels that are surrounded by neighbors with a lower ...

  • Page 29

    Chapter 2 getting measurement-ready images imaq vision for visual basic user manual 2-12 ni.Com 2. Improve the image in the frequency domain with a lowpass or highpass frequency filter. Specify which type of filter to use with cwimaqvision.Cxattenuate or cwimaqvision.Cxtruncate . Lowpass filters smo...

  • Page 30: Making Grayscale and Color

    © national instruments corporation 3-1 imaq vision for visual basic 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 in ...

  • Page 31

    Chapter 3 making grayscale and color measurements imaq vision for visual basic user manual 3-2 ni.Com table 3-1. Tools palette functions tool name function none disable the tools. Selection tool select an roi in the image and adjust the position of its control points and contours. Action: click the ...

  • Page 32

    Chapter 3 making grayscale and color measurements © national instruments corporation 3-3 imaq vision for visual basic user manual hold down when drawing an roi if you want to constrain the roi to the horizontal, vertical, or diagonal axes, when possible. Use the selection tool to position an roi by ...

  • Page 33

    Chapter 3 making grayscale and color measurements imaq vision for visual basic user manual 3-4 ni.Com figure 3-2. Tools information 1 anchoring coordinates of a region of interest 2 size of the image 3 zoom factor 4 image type indicator (8-bit, 16-bit, float, rgb32, rgbu64, hsl, complex) 5 pixel int...

  • Page 34

    Chapter 3 making grayscale and color measurements © national instruments corporation 3-5 imaq vision for visual basic user manual during design time, use the menu property page to select which tools appear in the right-click menu. You also can designate a default tool from this property page. During...

  • Page 35: Measure Grayscale Statistics

    Chapter 3 making grayscale and color measurements imaq vision for visual basic user manual 3-6 ni.Com cwimaqregion contains. When you know the type of shape that the region contains, you can set the region into a shape variable and use that variable to manipulate the shape properties. For example, t...

  • Page 36: Measure Color Statistics

    Chapter 3 making grayscale and color measurements © national instruments corporation 3-7 imaq vision for visual basic user manual minimum intensity, and maximum intensity. Use cwmachinevision.Lightmeterrectangle to get the pixel value statistics within a rectangular region in an image. Use cwimaqvis...

  • Page 37

    Chapter 3 making grayscale and color measurements imaq vision for visual basic user manual 3-8 ni.Com figure 3-3. Primary components of an 32-bit color image figure 3-4. Primary components of a 64-bit color image a color pixel encoded as a long value can be decomposed into its individual components ...

  • Page 38

    Chapter 3 making grayscale and color measurements © national instruments corporation 3-9 imaq vision for visual basic 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 follow...

  • Page 39

    Chapter 3 making grayscale and color measurements imaq vision for visual basic user manual 3-10 ni.Com specifying the color information to learn because color matching only uses color information to measure similarity, the image or regions in the image representing the object should contain only the...

  • Page 40

    Chapter 3 making grayscale and color measurements © national instruments corporation 3-11 imaq vision for visual basic user manual using a region in the image you can select a region in the image to provide the color information for comparison. A region is helpful for pulling out the useful color in...

  • Page 41

    Chapter 3 making grayscale and color measurements imaq vision for visual basic user manual 3-12 ni.Com fuses much better and results in high match scores—around 800—for both the fuses. You can use an unlimited number of samples to learn the representative color spectrum for a specified template. Fig...

  • Page 42

    Chapter 3 making grayscale and color measurements © national instruments corporation 3-13 imaq vision for visual basic user manual ignoring learned colors you can ignore certain color components in color matching by setting the corresponding component in the input color spectrum array to –1. To set ...

  • Page 43: Performing Particle Analysis

    © national instruments corporation 4-1 imaq vision for visual basic user manual 4 performing particle analysis this chapter describes how to perform particle analysis on the images. Use particle analysis to find statistical information about particles, such as the presence, size, number, and locatio...

  • Page 44: Improve The Binary Image

    Chapter 4 performing particle analysis imaq vision for visual basic user manual 4-2 ni.Com if all the objects in the grayscale image are either brighter or darker than the background, you can use cwimaqvision.Autothreshold to automatically determine the optimal threshold range and threshold the imag...

  • Page 45

    Chapter 4 performing particle analysis © national instruments corporation 4-3 imaq vision for visual basic user manual removing unwanted particles use cwimaqvision.Rejectborder to remove particles that touch the border of the image. Reject particles on the border of the image when you suspect that t...

  • Page 46: Make Particle Measurements

    Chapter 4 performing particle analysis imaq vision for visual basic user manual 4-4 ni.Com improving particle shapes use cwimaqvision.Fillhole to fill holes in the particles. Use cwimaqvision.Morphology to perform a variety of operations on the particles. You can use the open, close, proper open, pr...

  • Page 47

    Chapter 4 performing particle analysis © national instruments corporation 4-5 imaq vision for visual basic user manual cwimaqmeasurementaveragehorizsegmentlength average length of a horizontal segment in the particle. Cwimaqmeasurementaveragevertsegmentlength average length of a vertical segment in ...

  • Page 48

    Chapter 4 performing particle analysis imaq vision for visual basic user manual 4-6 ni.Com cwimaqmeasurementconvexhullperimeter perimeter of the smallest convex polygon containing all points in the particle. Cwimaqmeasurementelongationfactor max feret diameter divided by equivalent rect short side (...

  • Page 49

    Chapter 4 performing particle analysis © national instruments corporation 4-7 imaq vision for visual basic user manual cwimaqmeasurementholesarea sum of the areas of each hole in the particle. Cwimaqmeasurementholesperimeter sum of the perimeters of each hole in the particle. Cwimaqmeasurementhumome...

  • Page 50

    Chapter 4 performing particle analysis imaq vision for visual basic user manual 4-8 ni.Com cwimaqmeasurementmaxferetdiameterstarty y-coordinate of the start of the line segment connecting the two perimeter points that are the furthest apart. Cwimaqmeasurementmaxhorizsegmentlengthleft x-coordinate of...

  • Page 51

    Chapter 4 performing particle analysis © national instruments corporation 4-9 imaq vision for visual basic user manual cwimaqmeasurementnormmomentofinertiaxy the normalized moment of inertia in the x and y directions. Cwimaqmeasurementnormmomentofinertiaxyy the normalized moment of inertia in the x ...

  • Page 52

    Chapter 4 performing particle analysis imaq vision for visual basic user manual 4-10 ni.Com cwimaqmeasurementsumxxy the sum of all x-coordinates squared times y-coordinates in the particle. Cwimaqmeasurementsumxy the sum of all x-coordinates times y-coordinates in the particle. Cwimaqmeasurementsumx...

  • Page 53: Performing Machine Vision

    © national instruments corporation 5-1 imaq vision for visual basic user manual 5 performing machine vision tasks this chapter describes how to perform many common machine vision inspection tasks. The most common inspection tasks are detecting the presence or absence of parts in an image and measuri...

  • Page 54: Locate Objects to Inspect

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-2 ni.Com figure 5-1. Steps to performing machine vision note diagram items enclosed with dashed lines are optional steps. Locate objects to inspect in a typical machine vision application, you extract measurements f...

  • Page 55

    Chapter 5 performing machine vision tasks © national instruments corporation 5-3 imaq vision for visual basic user manual to as the measurement coordinate system. The measurement methods automatically move the rois to the correct position using the position of the measurement coordinate system with ...

  • Page 56

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-4 ni.Com figure 5-2. Coordinate systems of a reference image and inspection image b. If you use cwmachinevision.Findcoordtransformusingtworects , specify two rectangular rois, each containing one separate, straight ...

  • Page 57

    Chapter 5 performing machine vision tasks © national instruments corporation 5-5 imaq vision for visual basic user manual figure 5-3. Locating coordinate system axes with two search areas 2. Choose the parameters you need to locate the edges on the object. 3. Choose the coordinate system axis direct...

  • Page 58

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-6 ni.Com 1. Define a template that represents the part of the object that you want to use as a reference feature. For more information about defining a template, refer to the find measurement points section. 2. Defi...

  • Page 59

    Chapter 5 performing machine vision tasks © national instruments corporation 5-7 imaq vision for visual basic user manual choosing a method to build the coordinate transformation figure 5-4 guides you through choosing the best method for building a coordinate transformation for the application. Figu...

  • Page 60: Set Search Areas

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-8 ni.Com set search areas select rois in the images to limit the areas in which you perform the processing and inspection. You can define rois interactively or programmatically. Defining regions interactively follow...

  • Page 61: Find Measurement Points

    Chapter 5 performing machine vision tasks © national instruments corporation 5-9 imaq vision for visual basic user manual defining regions programmatically when you have an automated application, you need to define regions of interest programmatically. You can programmatically define regions by prov...

  • Page 62

    Chapter 5 performing machine vision tasks imaq vision for visual basic 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 cwmachinevision.Findstraightedge and cwmachinevision.Findconcentricedge . Cwmachinev...

  • Page 63

    Chapter 5 performing machine vision tasks © national instruments corporation 5-11 imaq vision for visual basic user manual figure 5-6. Finding a circular feature these methods locate the intersection points between a set of search lines in the search region and the edge of an object. Specify the sep...

  • Page 64

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-12 ni.Com finding edge points along multiple search contours use the cwimaqvision.Rake , cwimaqvision.Spoke , and cwimaqvision.Concentricrake methods to find edge points along multiple search contours. These methods...

  • Page 65

    Chapter 5 performing machine vision tasks © national instruments corporation 5-13 imaq vision for visual basic user manual 3. Define an image or an area of an image as the search area. A small search area reduces the time to find the features. 4. Set the tolerances and parameters to specify how the ...

  • Page 66

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-14 ni.Com feature detail a template with relatively coarse features is less sensitive to variations in size and rotation than a model with fine features. However, the model must contain enough detail to identify it....

  • Page 67

    Chapter 5 performing machine vision tasks © national instruments corporation 5-15 imaq vision for visual basic user manual background information unique background information in a template improves search performance and accuracy. Figure 5-10. Background information training the pattern matching al...

  • Page 68

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-16 ni.Com defining a search area two equally important factors define the success of a pattern matching algorithm: accuracy and speed. You can define a search area to reduce ambiguity in the search process. For exam...

  • Page 69

    Chapter 5 performing machine vision tasks © national instruments corporation 5-17 imaq vision for visual basic 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 image...

  • Page 70

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-18 ni.Com minimum contrast contrast is the difference between the smallest and largest pixel values in a region. You can set the minimum contrast to potentially increase the speed of the pattern matching algorithm. ...

  • Page 71

    Chapter 5 performing machine vision tasks © national instruments corporation 5-19 imaq vision for visual basic user manual using a ranking method to verify results the manner in which you interpret the pattern matching results depends on the application. For typical alignment applications, such as f...

  • Page 72

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-20 ni.Com 5. Set the tolerances and parameters to specify how the algorithm operates at run time using cwimaqmatchcolorpatternoptions . 6. Test the search algorithm on test images using cwimaqvision.Matchcolorpatter...

  • Page 73

    Chapter 5 performing machine vision tasks © national instruments corporation 5-21 imaq vision for visual basic user manual background information unique background information in a template improves search performance and accuracy during the grayscale pattern matching phase. This requirement could c...

  • Page 74

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-22 ni.Com defining a search area two equally important factors define the success of a color pattern matching algorithm—accuracy and speed. You can define a search area to reduce ambiguity in the search process. For...

  • Page 75

    Chapter 5 performing machine vision tasks © national instruments corporation 5-23 imaq vision for visual basic 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 red...

  • Page 76

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-24 ni.Com use one of the following four search strategies: • very aggressive—uses the largest step size, the most sub-sampling and only the dominant color from the template to search for the template. Use this strat...

  • Page 77

    Chapter 5 performing machine vision tasks © national instruments corporation 5-25 imaq vision for visual basic user manual minimum contrast use the minimum contrast to increase the speed of the color pattern matching algorithm. The color pattern matching algorithm ignores all image regions where gra...

  • Page 78: Make Measurements

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-26 ni.Com • does not always require the location with sub-pixel accuracy • does not require shape information for the region complete the following steps to find features in an image using color location: 1. Define ...

  • Page 79

    Chapter 5 performing machine vision tasks © national instruments corporation 5-27 imaq vision for visual basic user manual the rake method, and then they compute the distance between the points detected on the edges along each search line of the rake and return the largest or smallest distance in ei...

  • Page 80

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-28 ni.Com • findmidline —finds the line that is midway between a point and a line and is parallel to the line. • findpolygonarea —calculates the area of a polygon specified by its vertex points. Instrument reader me...

  • Page 81

    Chapter 5 performing machine vision tasks © national instruments corporation 5-29 imaq vision for visual basic user manual before you classify objects, you must create a classifier file with samples of the objects using the ni classification training interface. Go to start» programs»national instrum...

  • Page 82

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-30 ni.Com types: codabar, code 39, code 93, code 128, ean 8, ean 13, interleaved 2 of 5, msi, and upca. Read data matrix barcode use cwimaqvision.Readdatamatrixbarcode to read values encoded in a data matrix barcode...

  • Page 83: Display Results

    Chapter 5 performing machine vision tasks © national instruments corporation 5-31 imaq vision for visual basic user manual by default, cwimaqvision.Readdatamatrixbarcode automatically detects the type of barcode to read. You can improve the performance of the function by specifying the type of barco...

  • Page 84

    Chapter 5 performing machine vision tasks imaq vision for visual basic user manual 5-32 ni.Com • drawrectangle —overlays a cwimaqrectangle object on an image. • drawoval —overlays a cwimaqoval object on an image. • drawarc —overlays a cwimaqarc object on an image. • drawpicture —overlays a picture o...

  • Page 85

    Chapter 5 performing machine vision tasks © national instruments corporation 5-33 imaq vision for visual basic user manual to true . With cwmachinevision.Findpattern , you can overlay the search area and the result. Use cwimaqoverlay.Clear to clear any previous overlay information from the image. Us...

  • Page 86: Calibrating Images

    © national instruments corporation 6-1 imaq vision for visual basic user manual 6 calibrating images this chapter describes how to calibrate the imaging system, save calibration information, and attach calibration information to an image. After you set up the imaging system, you may want to calibrat...

  • Page 87

    Chapter 6 calibrating images imaq vision for visual basic 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 supp...

  • Page 88

    Chapter 6 calibrating images © national instruments corporation 6-3 imaq vision for visual basic user manual defining a reference coordinate system to express measurements in real-world units, you must define a coordinate system in the image of the grid. Use cwimaqlearncalibrationoptions.Calibration...

  • Page 89

    Chapter 6 calibrating images imaq vision for visual basic user manual 6-4 ni.Com figure 6-3. A calibration grid and an image of the grid note if you specify a list of points instead of a grid for the calibration process, the software defines a default coordinate system, as follows: 1. The origin is ...

  • Page 90

    Chapter 6 calibrating images © national instruments corporation 6-5 imaq vision for visual basic 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 setup....

  • Page 91

    Chapter 6 calibrating images imaq vision for visual basic 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 cwimaqcalibrationgridopti...

  • Page 92

    Chapter 6 calibrating images © national instruments corporation 6-7 imaq vision for visual basic user manual choose the perspective projection algorithm when the system exhibits perspective errors only. A perspective projection calibration has an accurate transformation even in areas not covered by ...

  • Page 93

    Chapter 6 calibrating images imaq vision for visual basic user manual 6-8 ni.Com note a high score does not reflect the accuracy of the system. If the learning process returns a learning score below 600, try the following: 1. Make sure the grid complies with the guidelines listed in the defining a c...

  • Page 94: Simple Calibration

    Chapter 6 calibrating images © national instruments corporation 6-9 imaq vision for visual basic user manual calibration invalidation any image processing operation that changes the image size or orientation voids the calibration information in a calibrated image. Examples of methods that void calib...

  • Page 95: Save Calibration Information

    Chapter 6 calibrating images imaq vision for visual basic user manual 6-10 ni.Com figure 6-7. Defining a simple calibration 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 cwim...

  • Page 96

    Chapter 6 calibrating images © national instruments corporation 6-11 imaq vision for visual basic user manual cwimaqvision.Convertpixeltorealworldcoordinates . If the application requires shape measurements, correct the image by removing distortion with cwimaqvision.Correctcalibratedimage . Note cor...

  • Page 97: Technical Support and

    © national instruments corporation a-1 imaq vision for visual basic user manual a technical support and professional services visit the following sections of the national instruments web site at ni.Com for technical support and professional services: • support —online technical support resources at ...

  • Page 98: Glossary

    © national instruments corporation g-1 imaq vision for visual basic 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 imag...

  • Page 99

    Glossary imaq vision for visual basic user manual g-2 ni.Com barycenter the grayscale value representing the centroid of the range of an image’s grayscale values in the image histogram. Binary image an image in which the objects usually have a pixel intensity of 1 (or 255) and the background has a p...

  • Page 100

    Glossary © national instruments corporation g-3 imaq vision for visual basic user manual c caliper (1) a function in the ni vision assistant and in ni vision builder for automated inspection that calculates distances, angles, circular fits, and the center of mass based on positions given by edge det...

  • Page 101

    Glossary imaq vision for visual basic user manual g-4 ni.Com connectivity-4 only pixels adjacent in the horizontal and vertical directions are considered neighbors. Connectivity-8 all adjacent pixels are considered neighbors. Contrast a constant multiplication factor applied to the luma and chroma c...

  • Page 102

    Glossary © national instruments corporation g-5 imaq vision for visual basic user manual edge steepness the number of pixels that corresponds to the slope or transition area of an edge. Energy center the center of mass of a grayscale image. See center of mass . Equalize function see histogram equali...

  • Page 103

    Glossary imaq vision for visual basic user manual g-6 ni.Com gradient filter an edge detection algorithm that extracts the contours in gray-level values. Gradient filters include the prewitt and sobel filters. Gray level the brightness of a pixel in an image. Gray-level dilation increases the bright...

  • Page 104

    Glossary © national instruments corporation g-7 imaq vision for visual basic user manual hit-miss function locates objects in the image similar to the pattern defined in the structuring element. Hsi a color encoding scheme in hue, saturation, and intensity. Hsl a color encoding scheme using hue, sat...

  • Page 105

    Glossary imaq vision for visual basic user manual g-8 ni.Com image enhancement the process of improving the quality of an image that you acquire from a sensor in terms of signal-to-noise ratio, image contrast, edge definition, and so on. Image file a file containing pixel data and additional informa...

  • Page 106

    Glossary © national instruments corporation g-9 imaq vision for visual basic user manual intensity calibration assigns user-defined quantities such as optical densities or concentrations to the gray-level values in an image. Intensity profile the gray-level distribution of the pixels along an roi in...

  • Page 107

    Glossary imaq vision for visual basic user manual g-10 ni.Com linear filter a special algorithm that calculates the value of a pixel based on its own pixel value as well as the pixel values of its neighbors. The sum of this calculation is divided by the sum of the elements in the matrix to obtain a ...

  • Page 108

    Glossary © national instruments corporation g-11 imaq vision for visual basic user manual m m (1) mega, the standard metric prefix for 1 million or 10 6 , when used with units of measure such as volts and hertz. (2) mega, the prefix for 1,048,576, or 220, when used with b to quantify data or compute...

  • Page 109

    Glossary imaq vision for visual basic user manual g-12 ni.Com ni-imaq the driver software for national instruments imaq hardware. Nonlinear filter replaces each pixel value with a nonlinear function of its surrounding pixels. Nonlinear gradient filter a highpass edge-extraction filter that favors ve...

  • Page 110

    Glossary © national instruments corporation g-13 imaq vision for visual basic user manual optical representation contains the low-frequency information at the center and the high- frequency information at the corners of an fft-transformed image. Outer gradient finds the outer boundary of objects. P ...

  • Page 111

    Glossary imaq vision for visual basic user manual g-14 ni.Com proper-closing a finite combination of successive closing and opening operations that you can use to fill small holes and smooth the boundaries of objects. Proper-opening a finite combination of successive opening and closing operations t...

  • Page 112

    Glossary © national instruments corporation g-15 imaq vision for visual basic user manual roi region of interest. (1) an area of the image that is graphically selected from a window displaying the image. This area can be used focus further processing. (2) a hardware-programmable rectangular portion ...

  • Page 113

    Glossary imaq vision for visual basic user manual g-16 ni.Com spatial filters alter the intensity of a pixel relative to variations in intensities of its neighboring pixels. You can use these filters for edge detection, image enhancement, noise reduction, smoothing, and so forth. Spatial resolution ...

  • Page 114

    Glossary © national instruments corporation g-17 imaq vision for visual basic user manual v value the grayscale intensity of a color pixel computed as the average of the maximum and minimum red, green, and blue values of that pixel..

  • Page 115: Index

    © national instruments corporation i-1 imaq vision for visual basic user manual index numerics 1d barcodes, 5-29 reading, 5-29 a acquiring images, 2-4 continuous acquisition, 2-5 one-shot acquisition, 2-4 acquisition type combo box, 2-4 activex objects, 1-5 adding shapes to rois, 3-5 analyzing image...

  • Page 116

    Index imaq vision for visual basic user manual i-2 ni.Com color pattern matching finding points, 5-19 optimize speed with search strategy, 5-23 setting rotation angle ranges, 5-25 color pattern matching algorithms training, 5-21 using contrast, 5-25 color scores, 5-24 color sensitivity, using to con...

  • Page 117

    Index © national instruments corporation i-3 imaq vision for visual basic user manual documentation conventions used in manual, ix ni resources, a-1 related documentation, x drivers ni resources, a-1 ni-imaq, xi e edge detection, 5-3 finding features, 5-9 edge points, finding along multiple search c...

  • Page 118

    Index imaq vision for visual basic user manual i-4 ni.Com imaging systems, setting up, 2-1 imaq vision applications, creating, 1-5 improving binary images, 4-2 images, 2-9 particle shapes, 4-4 increasing speed of the color pattern matching algorithm, 5-25 speed of the pattern matching algorithm, 5-1...

  • Page 119

    Index © national instruments corporation i-5 imaq vision for visual basic user manual o objects classifying, 5-29 detecting, 5-2 locating, 5-2 ocr, 5-29 one-shot acquisition, 2-4 optimizing speed of the color pattern matching algorithm, 5-23 oval tool, 3-2 p pan tool, 3-3 particle analysis, 4-1 perf...

  • Page 120

    Index imaq vision for visual basic user manual i-6 ni.Com rois adding shapes, 3-5 programmatically defining, 3-5 rotated rectangle tool, 3-2 rotation angle ranges setting for color pattern matching, 5-25 setting for pattern matching, 5-18 rotationally symmetric template, 5-20 s saving calibration in...

  • Page 121

    Index © national instruments corporation i-7 imaq vision for visual basic user manual testing search algorithms, 5-18, 5-25 tolerances, setting for pattern matching, 5-17 touching particles, separating, 4-3 training characters, 5-29 color pattern matching algorithms, 5-21 pattern matching algorithm,...