Home

NI Vision Assistant Tutorial

image

Contents

1. Select Mid Point in the Geometric Feature listbox Click points 3 and 4 to obtain the second measurement Width Center which specifies the center of the bracket width Click Measure to compute the center of the bracket width and add the Width Center measurement to the results table as shown in Figure 4 7 Click OK to add this step to the script Select Caliper in the Machine Vision tab or select Machine Vision Caliper again The center of the bracket width appears as point 5 4 8 ni com Chapter 4 Using Gauging for Part Inspection Caliper Setup Script Untitled Script 2 SEENE Figure 4 7 Using the Caliper Function to Find Width Center 12 Select Angle Defined by 3 Points in the Geometric Feature listbox Click points 1 5 and 2 in this order to find the third measurement Bracket Angle which measures the angle of the bracket arms with respect to a vertex at point 5 as shown in Figure 4 8 13 Click Measure to compute the angle of the bracket arms and add the measurement to the results table Figure 4 8 shows the image with Bracket Distance and Bracket Angle selected on the image and displayed in the results table National Instruments Corporation 4 9 NI Vision Assistant Tutorial Chapter 4 Using Gauging for Part Inspection Caliper Setup Figure 4 8 Using the Caliper Tool to Collect Measurements 14 Click OK to add these caliper measurements to the script and close the caliper
2. 1 6 circular particles analyzing 3 9 isolating 3 8 clamp 1 7 closing Vision Assistant 2 6 color image processing functions color location 1 5 color matching 1 5 color operators 1 5 color pattern matching 1 5 color plane extraction 1 5 color threshold 1 5 color location 1 5 color matching 1 5 color operators 1 5 color pattern matching 1 5 color plane extraction 1 5 color processing functions 1 5 color threshold 1 5 continuous acquisition grabbing images 2 9 conventions used in manual vii creating a LabVIEW VI 3 12 D diagnostic tools NI resources A 1 documentation conventions used in manual vii NI resources A 1 related documentation viii drivers NI resources A 1 NI Vision Assistant Tutorial Index E edge detection 1 7 edge detector 4 6 edges finding in image 4 6 Embedded Help window 1 8 environment Vision Assistant 1 2 examples NI resources A 1 exiting Vision Assistant 1 2 F features 1 3 fill holes 3 7 filtering 1 6 filtering images 3 4 find circular edge 1 7 find straight edge 1 7 finding edges 4 6 full size view Image Browser 2 2 functions binary processing and analysis functions 1 6 calibration functions 1 7 color image processing functions 1 5 grayscale image processing functions 1 6 machine vision functions 1 7 morphological functions 3 7 G gauging analyzing results 4 10 bracket specifications figure 4 2 definiti
3. Click the Settings tab Set Number of Matches to Find to 1 Set the Minimum Score to 600 to ensure that Vision Assistant finds matches that are similar but not identical to the template Click Sub pixel Accuracy With the Rectangle Tool draw an ROI around the right side of the bracket as shown in Figure 4 4 Vision Assistant automatically locates the template in the region bound by the rectangle and displays the score and location of the match Figure 4 4 Selecting the Second Search Area The score of the second match is not a perfect 1000 but it is high enough for you to consider it a match to the template Click OK to add this step to the script 4 5 NI Vision Assistant Tutorial Chapter 4 Using Gauging for Part Inspection Finding Edges in the Image Before you can compute measurements to determine if a bracket meets specifications you must detect edges on which you can base the measurements The Edge Detector function finds edges along a line that you draw with the Line Tool from the Tools palette 1 Select Edge Detector in the Machine Vision tab of the Inspection steps or select Machine Vision Edge Detector 2 Select the Advanced Edge Tool The Advanced Edge Tool is effective on images with poor contrast between the background and objects 3 Select First amp Last Edge so that Vision Assistant finds and labels only the first and last edges along the line you draw 4 Set the Contrast to 40 The dete
4. Images and scripts that you must have to complete the example tutorials in this manual e Help folder Online help files e CG folder LabVIEW VI and C code creation support files e manuals folder PDF versions of this manual and the JMAQ Vision Concepts Manual e Resources folder Resource files e plugins folder Image processing functions e readme wri Late breaking information about Vision Assistant e solutions folder Example images and scripts Launching and Exiting Vision Assistant To launch Vision Assistant on Windows select Start Programs National Instruments Vision Assistant 7 1 To exit Vision Assistant complete the following steps 1 Close the Parameter window 2 Save the open script and images if necessary 3 Click File Exit Vision Assistant Environment NI Vision Assistant Tutorial Vision Assistant is a tool for prototyping and testing image processing applications To prototype an image processing application build custom algorithms with the Vision Assistant scripting feature The scripting feature records every step of the processing algorithm After completing the algorithm you can test it on other images to make sure it works The algorithm is recorded in a Builder file which is an ASCII text file that lists the processing functions and relevant parameters for an algorithm that you prototype in Vision Assistant Using the LabVIEW VI Creation Wizard you can create a LabVIEW VI th
5. Assistant functions and how to use them If you have purchased IMAQ Vision software from National Instruments you also have one of the following sets of documentation which might be helpful as you work through this tutorial e LabVIEW IMAQ Vision for LabVIEW User Manual Contains information about how to build a Vision application using IMAQ Vision for LabVIEW LabVIEW VI Reference Help Contains reference information about IMAQ Vision VIs To open this help file click Help IMAQ Vision in LabVIEW e LabWindows CVI IMAQ Vision for LabWindows CVI User Manual Contains information about how to build a vision application using IMAQ Vision for LabWindows CVI IMAQ Vision for LabWindows CVI Function Reference Contains reference information about IMAQ Vision functions for LabWindows CVI e Measurement Studio NI Vision Assistant Tutorial IMAQ Vision for Visual Basic User Manual Contains information about how to build a Vision application using IMAQ Vision for Visual Basic IMAQ Vision for Visual Basic Function Reference Contains reference information about IMAQ Vision for Visual Basic viii ni com System Requirements and Installation This chapter lists system requirements and installation instructions and introduces the NI Vision Assistant environment System Requirements To run Vision Assistant your system must meet the following minimum requirements e Personal computer using a 233 MHz
6. Image Mask Builds a mask from an entire IPE image or a selected region of interest File Edit Image Color Grayscale Binary Machine Vision View Tools Help zla a E PeR S IM 512512171 4 Haw al s e gt 40 e aa Original Image Convolution Highlight Threshold 1 a ob Fill holes 1 Remove border abjects gt National Instruments Corporation Figure 3 4 Modifying Particles with Morphological Functions 3 7 NI Vision Assistant Tutorial Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal Isolating Circular Particles Complete the following steps to define a particle filter that isolates and keeps the circular particles and removes the non circular particles from the image 1 Select Particle Filter from the Binary tab of the Processing Functions palette or select Binary Particle Filter 2 Select Heywood Circularity Factor from the list of particle filters This function calculates the ratio of the perimeter of the particle to the perimeter of the circle with the same area The more circular the particle the closer the ratio to 1 3 To find more circular and less oblong particles enter a Minimum Value of 0 and a Maximum Value of 1 06 for the parameter range 4 Select the Keep option to keep circular p
7. National Instruments Corporation 2 1 NI Vision Assistant Tutorial Chapter 2 Introduction to Image Processing with Vision Assistant DYNI Vision Assistant Browsing images in the Image Browser When you are viewing the image in full size view use the VCR buttons at the bottom of the Image Browser to navigate the images You also can use these buttons to scan the images in reverse or forward order and view the images continuously Vision Assistant displays the current location image size and type and the file type below the image When you have are viewing images in thumbnail view you can double click any image to begin processing it RB Note The Image Browser displays the thumbnail views in groups of 16 If there are more than 16 images in the Image 1 Image Browser 4 Thumbnail Full Size Toggle 7 Image Type 2 Image Location 5 Close Selected Image s 8 File Format 3 Browse Buttons 6 Image Size Figure 2 1 Image Browser You can view new images in either thumbnail view as shown in Figure 2 1 or in full size view which shows a single full size view of the selected image 5 Click the Thumbnail Full Size View Toggle button to view the first image in full size 6 Double click the Metal1 jpg image to begin processing it Vision Assistant loads the image into the Processing window as shown in Figure 2 2 NI Vision Assistant Tutorial 2 2 ni com Chapter 2 Introduction to Image Processing with V
8. Pentium class processor Using a Pentium III or Celeron 600 MHz or equivalent is recommended e Microsoft Windows 2000 NT XP If you are using Windows NT 4 0 you must have Service Pack 6 or later installed to run Vision Assistant e 1024 x 768 resolution or higher video adapter 65 536 colors 16 bit or higher e Minimum of 128 MB RAM 256 MB recommended e Minimum of 200 MB of free hard disk space e Ifyou are acquiring images the system must have National Instruments image acquisition IMAQ hardware and NI IMAQ 3 0 or later or NI IMAQ for IEEE 1394 Cameras 1 5 or later installed 3 Note You must have Microsoft Excel 97 or later installed to complete some steps in the second tutorial Installing Vision Assistant 3 Note To install Vision Assistant on a Windows 2000 NT XP system you must be logged in with Administrator privileges Insert the Vision Assistant CD into the CD ROM drive 2 Ifyou do not have autorun enabled double click autorun exe If you have autorun enabled autorun exe runs automatically 3 Follow the onscreen instructions National Instruments Corporation 1 1 NI Vision Assistant Tutorial Chapter 1 System Requirements and Installation By default the Vision Assistant installation program creates a new folder C Program Files National Instruments Vision Assistant 7 1 that contains the following items e Vision Assistant exe function libraries and other related program files e examples folder
9. Site cece ce ee eeeceeeeeecseeseeeeeessesseeaeeeneed Vision ASsistant Scripts easset isini aae a E A N aiaa Chapter 2 Introduction to Image Processing with Vision Assistant Getting Started in Vision Assistant seseeesesesesessesesisiststststsesesesestsesesteerernnsesrseneseseses 2 1 Acquiring Images in Vision Assistant 0 ccc eseeeeecseeeeeeesecaeseessseeaeeeseessesaeeeege 2 6 Opening the Acquisition WindoW cee eseescescnecseeeceeesesseseeseeeeeeetaeea 2 6 SNAPPING an MABE oases aa E EA veseituacs event cs cennecesveveowetes 2 8 Grabbing an TMA perunan nna e aa a ledbesnovesseenes 2 9 Acquiring a Sequence of Images sssesesssesesesesstsssssisistsesestsesesenesesenesenereses 2 9 National Instruments Corporation v NI Vision Assistant Tutorial Contents Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal Chapter 4 Using Gauging for Part Inspection What Is Gau Sine icc csvseitecsscesees orrea E EEA E OEE E Loading Images into Vision Assistant cscescesesseeeeceseeeeneeeeeeaeeneeese Preparing an Image for Particle Analysis cceseesseseeeeeeeceeeseeneeeeees Examining the Image eee eeesseeseeeeseeeeceeeeseseeeeeeeesaeeneeees Filtering the Uma ge scsi sevsciessacivseensencertinas anion aa Examining the Results of the Filtering 0 0 ee eeeeeeeseeeeeees Separating Particles from the Background with Thresholding Modifying Parti
10. Under the copyright laws this publication may not be reproduced or transmitted in any form electronic or mechanical including photocopying recording storing in an information retrieval system or translating in whole or in part without the prior written consent of National Instruments Corporation Trademarks CVI IMAQ LabVIEW Measurement Studio National Instruments National Instruments Alliance Partner NI ni com NI Developer Zone and NI IMAQ are trademarks of National Instruments Corporation Product and company names mentioned herein are trademarks or trade names of their respective companies Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no agency partnership or joint venture relationship with National Instruments Patents For patents covering National Instruments products refer to the appropriate location Help Patents in your software the patents txt file on your CD or ni com patents WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS 1 NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN 2 IN ANY APPLICATION INCLUDING THE ABOVE RELIABILITY
11. Vision Assistant You can select an image to process by double clicking it in the Image Browser Refer to Figure 2 1 Image Browser to view images loaded into the Image Browser e Processing window Updates the image as you change parameters Because this view immediately reflects the changes you have made in the Parameter window you can continue modifying parameters until you get the result you want Refer to Figure 2 2 Processing an Image to view an image loaded into the Processing window e Functions window Parameter window Displays a list of image processing functions you can use to develop an algorithm or displays parameters that you can set for an image processing function Each function available through the Functions window has a Parameter National Instruments Corporation 1 3 NI Vision Assistant Tutorial Chapter 1 System Requirements and Installation window in which you set the parameters for that function Refer to Figure 2 3 Thresholding an Image to view an example of the Parameter window for the Threshold function Reference window Embedded Help window The Image tab of the Reference window displays the image source as you manipulate it in the Processing window The other tabs in the Embedded Help window contain context help for the function you are using Refer to Figure 2 2 Processing an Image to view an image in the Reference window Solution Wizard Displays a list of industries and corresponding quality
12. Web site at ni com info and enter the info code feedback 1999 2004 National Instruments Corporation All rights reserved 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 National Instruments will at its option repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period National Instruments does not warrant that the operation of the software shall be uninterrupted or error free A Return Material Authorization RMA number must be obtained from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty National Instruments believes that the information in this document is accurate The document has been carefully reviewed for technical accuracy In the event that technical or typographical errors exist National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition The reader should consult National Instruments if errors are suspected In no ev
13. assurance tasks that those industries perform The wizard loads an IMAQ Vision based solution for the task you select Performance Meter Estimates how long a script will take to complete on a given image LabVIEW VI Creation Creates a LabVIEW VI corresponding to the algorithm you prototype in Vision Assistant Based on the options you select the LabVIEW VI Creation Wizard creates a new VI that implements the image processing steps of the current script or of a saved script file C Code Creation Creates a C file corresponding to the algorithm you prototype in Vision Assistant Based on the options you select the C Code Creation Wizard creates a C function that implements the image processing steps of the current script Builder File ASCT text file that lists the C and Microsoft Visual Basic functions and parameters for the algorithm you prototyped in Vision Assistant Image Analysis Functions Vision Assistant provides the following image analysis functions NI Vision Assistant Tutorial Histogram Counts the total number of pixels in each grayscale value and graphs the result Line Profile Returns the grayscale values of the pixels along a line that you draw with the Line Tool from the Tools palette and graphs the result Measure Calculates measurement statistics associated with a region of interest in the image 3D View Displays an image using an isometric view Each pixel from the image source is represented a
14. edge detection 1 7 find circular edge 1 7 find straight edge 1 7 magnifying an image 4 7 Measurement amp Automation Explorer MAX 2 6 measurements for gauging See gauging morphology 3 7 National Instruments support and services A 1 Web site 1 9 NI IMAQ 2 6 National Instruments Corporation l 3 Index 0 opening images 2 1 3 2 4 3 operators 1 6 P Parameter window 1 3 part inspection 4 1 particle 3 1 particle analysis 1 6 analyzing circular particles 3 9 definition 3 1 estimating processing time 3 11 examining image 3 3 filtering 3 4 introduction 3 1 isolating circular particles 3 8 modifying particles with morphological functions 3 7 morphology 3 7 opening images 3 2 overview 3 1 particle analysis 3 9 particle filter 3 8 preparing images for processing 3 2 saving the script 3 11 separating particles from background 3 5 testing the script 3 9 thresholding 3 5 particle filter 3 8 particle filtering 1 6 particles separating from background with thresholding 3 5 pattern matching 1 7 pattern matching for finding measurement points 4 3 Performance Meter 1 4 3 12 Preview Image window 3 2 4 3 Processing window 1 3 programming examples NI resources A 1 NI Vision Assistant Tutorial Index Q quantify 1 6 R Reference window definition 1 4 purpose 2 3 using to browse images 3 10 related documentation viii remove border objects 3 7 Run S
15. image for quantitative analysis such as finding the area perimeter or orientation Using Particle Analysis to Analyze the Structure of a Metal Use the following steps to apply two morphological functions to the image The first function fills holes in the particles and the second removes objects that touch the border of the image 1 Select Adv Morphology in the Binary tab of the Processing Functions palette or select Binary Adv Morphology Select Fill holes from the Morphology Advanced function list Click OK to add this step to the script Select Adv Morphology in the Binary tab of the Processing Functions palette or select Binary Adv Morphology Select Remove border objects to remove any objects that touch the border of the image as shown in Figure 3 4 Click OK to add this step to the script and close the Parameters window Image When To Metall jpg 8 bit 512x512 mT T ole s gouge abe Histogram Counts the total number of Utada pixels in each grayscale value and graphs it Line Profile Displays the grayscale EHG distribution along a line of pixels in an image Th Measure Calculates measurement IMU statistics associated with a region of interest in the image 30 View Displays the light intensity in a three dimensional coordinate system Brightness Alters the brightness contrast Hillis and gamma of an image Fog
16. in the image This function performs an edge extraction and then finds edge pairs based on specified criteria such as the distance between the leading and trailing edges edge contrasts and so forth closing A dilation followed by an erosion A closing fills small holes in objects and smooths the boundaries of objects contrast A constant multiplication factor applied to the luma and chroma components of a color pixel in the color decoding process National Instruments Corporation G 1 NI Vision Assistant Tutorial Glossary D definition digital image dilation driver E edge edge detection erosion F function G gauging grayscale image NI Vision Assistant Tutorial The number of values a pixel can take on which is the number of colors or shades that you can see in the image An image f x y that has been converted into a discrete number of pixels Both spatial coordinates and brightness are specified Increases the size of an object along its boundary and removes tiny holes in the object Software that controls a specific hardware device such as an IMAQ or DAQ device Defined by a sharp change transition in the pixel intensities in an image or along an array of pixels Any of several techniques to identify the edges of objects in an image Reduces the size of an object along its boundary and eliminates isolated points in the image A set of software instructions executed by a singl
17. 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 box This icon denotes a tip which alerts you to advisory information This icon denotes a note which alerts you to important information Bold text denotes items that you must select or click in the software such as menu items and dialog box options Bold text also denotes parameter names Italic text denotes variables emphasis a cross reference or an introduction to a key concept This font also denotes text that is a placeholder for a word or value that you must supply Text in this font denotes text or characters that you should enter from the keyboard sections of code programming examples and syntax examples This font is also used for the proper names of disk drives paths directories programs subprograms subroutines device names functions operations variables filenames and extensions National Instruments Corporation vii NI Vision Assistant Tutorial About This Manual Related Documentation The following list includes additional documents that you might find helpful as you work through this tutorial e IMAQ Vision Concepts Manual Installs with Vision Assistant and contains vision conceptual information Refer to this document if you are new to Vision e Vision Assistant Help Details each of the Vision
18. B color information where each pixel in the color image is encoded using 32 bits eight bits for red eight bits for green eight bits for blue and eight bits for the alpha value unused G 5 NI Vision Assistant Tutorial Glossary ROI rotation invariant matching S saturation shift invariant matching T template threshold Tools palette value VI NI Vision Assistant Tutorial 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 of the acquisition window A pattern matching technique in which the reference pattern can be located at any orientation in the test image as well as rotated at any degree The amount of white added to a pure color Saturation relates to the richness of a color A saturation of zero corresponds to a pure color with no white added Pink is a red with low saturation A pattern matching technique in which the reference pattern can be located anywhere in the test image but cannot be rotated or scaled Color shape or pattern that you are trying to match in an image using the color matching shape matching or pattern matching functions A template can be a region selected from an image or it can be an entire image Separates objects from the background by assigning all pixels with intensities within a specified range to the object an
19. CI 1409 is installed Figure 2 6 IMAQ Devices and Channels 3 Note The hardware devices listed in the Parameter window vary according to the devices installed Snapping an Image NI Vision Assistant Tutorial Pe eS Click File Acquire Image Click Acquire Image in the Acquisition function list Select the appropriate device and channel Click the Acquire Single Image button to acquire a single image with the IMAQ device and display it Click the Store Acquired Image in Browser button to send the image to the Image Browser Click Close to exit the Parameter window Process the image as you would any other image in Vision Assistant Refer to Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal and Chapter 4 Using Gauging for Part Inspection for examples of processing images in Vision Assistant 2 8 ni com Grabbing an Image m rz 1 2 3 4 Chapter 2 Introduction to Image Processing with Vision Assistant Select F
20. DATING THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION INCLUDING WITHOUT LIMITATION THE APPROPRIATE DESIGN PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION Contents About This Manual Convention Sitea desea os cacinenlebedt cuah a a a a a a vii Related Documentation cccccccccscccccsssssccccessceececeseeececesseeeceesssceeeceeesseeeeesessseeeeeeeaes Vili Chapter 1 System Requirements and Installation Systemi Requirements isaer inasa a E E E OE Installing Visto Assistants osne a a a aE A ais aE Launching and Exiting Vision Assistant Vision Assistant Environment ina E E E A EAT S TEE Image Analysis FUnctions sparsene conin a a Color Image Processing Functions esesesesesssessssssssisisrsesisesenesenesesenesesereses Grayscale Image Processing and Analysis Functions Binary Processing and Analysis Functions sseseseeeeseeseereeisresrerersrerrerreeresrs Machine Vision Functions e s sssesesesssesseeseseseseserssesesrsrsesenenentnrnenesenenenerenen Vision Assistant Calibration Functions esssesssssesessseseressreersreesrseseseseseses Gettins Help igi ate a i a a a T aO ea AES Vision Assistant Embedded Help Window s s s Vision Assistant Online Help oo ee cece ces ceeecsecsesseeeessseseeseeaeses Vision Assistant Documentation eee cee eees eee eecseeeceeeetsesseeeesesaeeeeee National Instruments Web
21. Filholes 1 Remove border object ok Lead ia gt Figure 3 7 Testing the Particle Analysis Script 6 Adjust the minimum threshold value until the particles are clearly separated A minimum value of 150 works well 7 Click OK 8 Click Run Once to rerun the script Notice that only the circular particles now appear in the final processed image Saving the Particle Analysis Script Now that you have written a particle analysis algorithm and tested it on another image you can save the script to use on similar images You also can perform batch processing with this script 1 Select File Save Script 2 Save the script as particle analysis scr Estimating Processing Time National Instruments Corporation 3 11 Vision Assistant can estimate the time in milliseconds that IMAQ Vision will take to process the active image with the open script The Performance Meter gives both an estimate of the total time IMAQ Vision will take to process the image and an estimate of the time each function within the script will require Complete the following steps to estimate how many NI Vision Assistant Tutorial Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal milliseconds IMAQ Vision will use to process Metal3 jpg with particle analysis scr 1 Select Tools Performance Meter The Performance Meter estimates the total time IMAQ Vision will take to run the script 2 Click Details to view
22. IMAQ NI Vision Assistant Tutorial We NATIONAL August 2004 Edition gt INSTRUMENTS Part Number 372228A 01 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 3262 3599 Canada Calgary 403 274 9391 Canada Ottawa 613 233 5949 Canada Qu bec 450 510 3055 Canada Toronto 905 785 0085 Canada Vancouver 604 685 7530 China 86 21 6555 7838 Czech Republic 420 224 235 774 Denmark 45 45 76 26 00 Finland 385 0 9 725 725 11 France 33 0 1 48 14 24 24 Germany 49 0 89 741 31 30 India 91 80 51190000 Israel 972 0 3 6393737 Italy 39 02 413091 Japan 81 3 5472 2970 Korea 82 02 3451 3400 Malaysia 603 9131 0918 Mexico 01 800 010 0793 Netherlands 31 0 348 433 466 New Zealand 0800 553 322 Norway 47 0 66 90 76 60 Poland 48 22 3390150 Portugal 351 210 311 210 Russia 7 095 783 68 51 Singapore 65 6226 5886 Slovenia 386 3 425 4200 South Africa 27 0 11 805 8197 Spain 34 91 640 0085 Sweden 46 0 8 587 895 00 Switzerland 41 56 200 51 51 Taiwan 886 2 2528 7227 Thailand 662 992 7519 United Kingdom 44 0 1635 523545 For further support information refer to the Technical Support and Professional Services appendix To comment on National Instruments documentation refer to the National Instruments
23. OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY ADVERSE FACTORS INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY COMPUTER HARDWARE MALFUNCTIONS COMPUTER OPERATING SYSTEM SOFTWARE FITNESS FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION INSTALLATION ERRORS SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES TRANSIENT FAILURES OF ELECTRONIC SYSTEMS HARDWARE AND OR SOFTWARE UNANTICIPATED USES OR MISUSES OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER ADVERSE FACTORS SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED SYSTEM FAILURES ANY APPLICATION WHERE A SYSTEM FAILURE WOULD CREATE A RISK OF HARM TO PROPERTY OR PERSONS INCLUDING THE RISK OF BODILY INJURY AND DEATH SHOULD NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE TO AVOID DAMAGE INJURY OR DEATH THE USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES INCLUDING BUT NOT LIMITED TO BACK UP OR SHUT DOWN MECHANISMS BECAUSE EACH END USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL INSTRUMENTS THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALI
24. an itemized list of the time IMAQ Vision will take to perform each function in the script 3 Click OK to close the Performance Meter Creating a LabVIEW VI Vision Assistant features a wizard that creates a LabVIEW and IMAQ Vision VI that implements the different steps of the script 3 Note You must have LabVIEW 6 1 or later and IMAQ Vision 7 1 for LabVIEW or later installed to use the Vision Assistant LabVIEW VI Creation Wizard Complete the following steps to create a LabVIEW VI 1 Select Tools Create LabVIEW VI aye Note If several versions of LabVIEW and IMAQ Vision are installed on the computer the wizard searches the machine and displays a list of the available LabVIEW and IMAQ Vision versions you can use to create the VI 2 Select the version of LabVIEW in which you want to create a VI Select the location to which you want to save the VI enter a File name and click Save Click Next Select the appropriate Vision Assistant script option and click Next Select the image source Select Image File as the image source to create a VI that opens an image from the hard disk 7 Click Finish to create the VI 3 Note If you have LabVIEW open you cannot create a VI for a different version of LabVIEW For example if you have LabVIEW 6 1 open and you select LabVIEW 7 1 in the LabVIEW VI Creation Wizard the wizard returns an error when you click Finish NI Vision Assistant Tutorial 3 12 ni com Creating a C Program Ch
25. apter 3 Using Particle Analysis to Analyze the Structure of a Metal Vision Assistant features a wizard that creates C code that implements the different steps of the script Sy Note You must have LabVIEW 6 1 or later and IMAQ Vision 7 1 installed to use the Vision Assistant C Code Creation Wizard Complete the following steps to create a C program 1 2 National Instruments Corporation Select Tools Create C Code Enter the name of the implementation file that will contain the image processing function that implements the Vision Assistant steps Select the Create Main Function option if you want the wizard to generate a main function to test the image processing function a Enter the name for the new C file in the Main File Name control b In the Image Source drop down menu select Image File as the source of the image that is used by the main function Browse to the folder to which you want to save the generated files Select the Add Files to LabWindows CVI Project option if you have LabWindows CVI installed and you want to use it to compile and test the C code Click OK to create the C program 3 13 NI Vision Assistant Tutorial Using Gauging for Part Inspection This chapter describes gauging and provides step by step directions for prototyping a part inspection application in Vision Assistant What Is Gauging Tutorial Components such as connectors switches and relays are small and manufact
26. arted 2 1 grayscale functions 1 6 image analysis functions 1 4 installing 1 1 launching 1 2 machine vision functions 1 7 opening images 2 1 particle analysis 3 9 scripts 1 9 system requirements 1 1 Visual Basic 3 9 National Instruments Corporation Index Ww Web resources A 1 Web support from National Instruments getting help for IMAQ Vision 1 9 windows Parameter 1 3 Processing 1 3 Reference 1 4 2 3 3 10 Script 1 3 2 5 Z Zoom In tool 4 7 NI Vision Assistant Tutorial
27. articles This option also removes particles that do not fit in this range 5 Click OK to add this step to the script The image now contains only circular particles as shown in Figure 3 5 BES File Edit Image Color Grayscale Binary Machine Vision View Tools Help 5 ee 2 22 amp sl EB T Ao E fel oag e fe ieiunare tro ai piae han el P 1 statistics associated with a region of S accorse DEI E SEINE 2 fata Diiia Ate he bihis contrast oh ol ol m Convolution Highlight Threshold 1 Fill holes 1 Remove border objects Particle Fiter 1 poa ase Mosk Bulls a mack fom an entre Figure 3 5 Isolating Circular Particles NI Vision Assistant Tutorial 3 8 ni com Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal Analyzing Circular Particles Now that you have isolated circular particles complete the following steps to find the area occupied by them 1 Select Particle Analysis from the Binary tab of the Processing Functions palette or select Binary Particle Analysis A results table displays all of the measurement results Vision Assistant assigns numerical labels to each particle The first row of the results table lists the numerical label associated with each particle Select Show Labels to view the labels Q Tip When you click a particle the measurement results for that particle are highlighted in blue When you click the results for a particle the particle is highlighted in
28. ary image which is an image composed of pixels with values of 0 and 1 This image is displayed using a binary palette which displays the pixel intensities of an image with unique colors All pixels with a value of 0 appear black and pixels set to 1 appear red The red pixels are now referred to as particles SENI Vision Assistant File Edt Image Color Grayscale Binary Machine Vision View Tools Help gt p 4 EEFE Metall ipg 8 bit 512x512 wm T fe s goag Mikabo Ta Lookup Table Improves conttast and Elas brightness by applying a lookup table to an image Fiters Prepares an image for processing so that you can extract only the information you need from the image J A Form Gray Morphology Modifies the shape of meea aE objects in an image TEL FFT Fiter Apples a frequency fiter to the Aala a e gt 218 ka image Threshold Selects ranges of pixel values wh akh in grayscale images Ofighal image Convolution Highlight Threshold 1 Operators Performs arithmetic and logical B gt operations on images J z KI Figure 3 3 Separating Particles from the Background with Thresholding 3 6 ni com Chapter 3 Modifying Particles with Morphological Functions Morphological functions affect the shape of particles on an individual basis Morphological operations prepare particles in the
29. at performs the prototype that you created in Vision Assistant 1 2 ni com Chapter 1 System Requirements and Installation B Note You must have LabVIEW 6 1 or later and IMAQ Vision 7 1 for LabVIEW or later installed to use the LabVIEW VI Creation Wizard For more information about LabVIEW VI creation refer to the Creating a LabVIEW VI section of Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal Using the C Code Creation Wizard you can generate a C function that performs the prototype that you created in Vision Assistant For more information about C Code creation refer to the Creating a C Program section of Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal 3 Note Ifyou have LabWindows CVI version 7 0 or later you can create a project for the generated C code You also can implement the algorithm defined by the Builder file into any development environment such as Microsoft Visual Basic using the IMAQ Vision machine vision and image processing libraries Features Vision Assistant offers the following features e Script window Records a series of image processing steps and the settings you use for each of those steps You can run scripts on single images or in a batch to analyze a collection of images You also can modify and save scripts Refer to Figure 2 2 Processing an Image for an example of the Script window e Image Browser Contains all of the images currently loaded in
30. ceptable range 362 to 368 pixels acceptable range 178 to 181 Bracket 1 363 27 179 56 Bracket 2 363 05 180 26 Bracket 3 363 27 180 13 Bracket 4 347 98 179 06 Bracket 5 337 45 178 56 Bracket 6 358 33 175 54 National Instruments Corporation 4 11 NI Vision Assistant Tutorial Technical Support and Professional Services Visit the following sections of the National Instruments Web site at ni com for technical support and professional services e Support Online technical support resources at ni com support include the following Self Help Resources For immediate answers and solutions visit the award winning National Instruments Web site for software drivers and updates a searchable KnowledgeBase product manuals step by step troubleshooting wizards thousands of example programs tutorials application notes instrument drivers and so on Free Technical Support All registered users receive free Basic Service which includes access to hundreds of Application Engineers worldwide in the NI Developer Exchange at ni com exchange National Instruments Application Engineers make sure every question receives an answer e Training and Certification Visit ni com training for self paced training eLearning virtual classrooms interactive CDs and Certification program information You also can register for instructor led hands on courses at locations around the world e System Integratio
31. cles with Morphological Functions ceeeeeeseeseeeee Isolating Circular Particles aiina e a R Analyzing Circular Particles 0 c cc ceseeesesscceecsseesseeeesecssssesseeeeneeas Testing the Particle Analysis Script sssssssssessssssssesssrsisissseseserresererees Saving the Particle Analysis Script cece eeseeseeeeecesceteteeeeeaes Estimating Processing Time cscs ssesessesseeseceesseeeceeeeaeeseesseeseeseeseeens Creating a LabVIEW V1 eeaeee re er Enea EE neri EEEa Ronatan Creating aC Programm oeeie aare Ea E RTE UOT a A KE E E E thus bs A A a A SS Loading Images into Vision Assistant eeeeseeseeeeeeeeeerereersrestsrrerssresrrersessese Finding Measurement Points Using Pattern Matching eee eee Finding Edges in the Image Taking the Measurements ce sseeeesssseeneeseeseeeseeseesecsceaecseeeeesesseeneeneesaees Analyzing the Resultsi ciitca sicily ence hea nein hae A R Appendix A Technical Support and Professional Services Glossary Index NI Vision Assistant Tutorial vi assas 4 1 ni com About This Manual Conventions The NI Vision Assistant Tutorial provides step by step instructions for prototyping a vision application with NI Vision Assistant This tutorial is designed for Windows users with varied levels of vision experience Q 3 bold italic monospace The following conventions are used in this manual The symbol leads you through nested
32. conds within which the trigger must occur e Polarity Determines if the acquisition is triggered on the rising edge or the falling edge 2 9 NI Vision Assistant Tutorial Chapter 2 Introduction to Image Processing with Vision Assistant 6 Click Next Next and Finish to complete the acquisition If you set the triggering action property to Disabled click Next to begin acquiring a sequence of images Images acquired are automatically sent to the Image Browser 7 Click Close to exit the Parameter window Process the image as you would any other image in Vision Assistant NI Vision Assistant Tutorial 2 10 ni com Using Particle Analysis to Analyze the Structure of a Metal This chapter describes particle analysis and provides step by step directions for prototyping a particle analysis application in Vision Assistant What Is Particle Analysis Particle analysis consists of a series of processing operations and analysis functions that produce some information about the particles in an image A particle is a contiguous region of nonzero pixels You can extract particles from a grayscale image by thresholding the image into background and foreground states Zero valued pixels are in the background state and all nonzero valued pixels are in the foreground In a binary image the background pixels are zero and every non zero pixel is part of a binary object You perform a particle analysis to detect connected regions or g
33. cript button 2 5 3 10 3 11 S Script window 1 3 scripting description 1 2 modifying scripts 3 11 opening scripts 2 5 Run Script button 2 5 3 10 3 11 saving scripts 2 5 3 11 Script window 1 3 2 5 testing scripts 3 9 scripts 1 9 gauging script saving 4 10 particle analysis script recording 3 1 saving 3 11 testing 3 9 thresholding script 2 5 Select All Files option 3 2 4 3 Send Data to Excel button 3 9 separating particles from background 3 5 sequence 2 6 sequence acquisition 2 9 Show Labels option 3 9 simple calibration 1 7 NI Vision Assistant Tutorial l 4 simulation module 2 7 snap 2 6 snapping one image single acquisition 2 8 software NI resources A 1 Solution Wizard 1 4 support technical A 1 system requirements 1 1 T taking measurements 4 7 technical support A 1 testing scripts 3 9 threshold 1 6 Threshold Parameter window 2 4 thresholding manual threshold 2 3 3 5 modifying threshold parameters 3 10 procedure 2 3 separating particles from background 3 5 thumbnail view Image Browser 2 2 training and certification NI resources A 1 troubleshooting NI resources A 1 tutorials gauging 4 1 particle analysis 3 1 U using the caliper function 4 7 V Vision Assistant acquiring images 2 6 binary functions 1 6 closing 2 6 color processing functions 1 5 environment 1 2 ni com exiting 1 2 features 1 3 getting help 1 8 getting st
34. ction process returns only the first and last edge whose contrast is greater than 40 5 Click and drag to draw a vertical line across the middle of the bracket to find the edges that you can use to calculate Width Center as shown in Figure 4 5 Vision Assistant labels the edges 1 and 2 Q Tip To draw a straight line press and hold the lt Shift gt key as you draw the line Figure 4 5 Finding the Edges for Bracket Distance Look at the line profile The sharp transitions in the line profile indicate edges Notice that the number of edges found is displayed under the line profile 6 Click OK to add this edge detection step to the script NI Vision Assistant Tutorial 4 6 ni com Chapter 4 Using Gauging for Part Inspection Taking the Measurements Now that you have found the bracket holes and the necessary edges you can calculate the center of the bracket width distance between the bracket holes and angle of the bracket arms with the Caliper function The Caliper function is a tool that uses points on the image to calculate measurements such as distances angles the center of a segment or the area depending on the number of points you have selected on the image These points are results of earlier processing steps such as edge detections and pattern matching Complete the following steps to make the measurements 1 Select Caliper in the Machine Vision tab or select Machine Vision Caliper Select Distance in the Geo
35. ction to Image Processing with Vision Assistant SNI Vision Assistant CE Image HowTo Contiots z A Ee fi Tode ihe ale Binar Jachine Vision View Tool Sk a gt m 22 2 eW gt o o o e gt a m b Ll mele Template Threshold Type Image Source z Auto Threshold Clustering Auto Threshold Entropy Auto Threshold Metric a Thweshold Values Min f 127 Max 3 255 51251211 132 2 4 2 cn 1 Threshold Parameter Window Figure 2 3 Thresholding an Image The Threshold Parameter window displays a histogram A histogram counts the total number of pixels at each grayscale value and graphs it From the graph you can tell if the image contains distinct regions of a certain grayscale value and you can select pixel regions of the image For example if the background of an image is black and you want to remove it you can select a range with values close to 255 white The Processing window displays a preview of the threshold operation using the current set of parameters The pixels depicted in red have intensities that fall inside the threshold range The threshold operator sets their values to 1 The pixels depicted in gray have values outside the threshold range The threshold operator sets their values to 0 8 To threshold this image set the Min value to 130 and Max value to 255 to select all of the objects G Tip You may n
36. d Image The thresholding step is recorded in the Script window The script records the processing operation and all of its parameters If you must run the same operation on other images you can save the script and use it again 10 Select File Save Script and name the script threshold scr National Instruments Corporation If you find another image that you must threshold similarly run this script on the image using the following steps a Load the image b Select File Open Script select threshold scr and click Open c Click the Run Once button in the script window Try experimenting with different options and images For example you can perform a particle analysis to find the area that each object in this image occupies If you need help with any specific image 2 5 NI Vision Assistant Tutorial Chapter 2 Introduction to Image Processing with Vision Assistant processing operation click the How To tab or the Controls tab in the Embedded Help window 11 Select File Exit to close Vision Assistant Acquiring Images in Vision Assistant Vision Assistant offers three types of image acquisitions snap grab and sequence A snap acquires and displays a single image A grab acquires and displays a continuous set of images which is useful for example when you need to focus the camera A sequence acquires images according to settings that you specify and sends the images to the Image Browser Using Vision Ass
37. d the rest of the pixels to the background In the resulting binary image objects are represented with a pixel intensity of 255 and the background is set to 0 Collection of tools that enable you to select regions of interest zoom in and out and change the image palette The grayscale intensity of a color pixel computed as the average of the maximum and minimum red green and blue values of that pixel Virtual Instrument 1 A combination of hardware and or software elements typically used with a PC that has the functionality of a classic stand alone instrument 2 A LabVIEW software module VI which consists of a front panel user interface and a block diagram program G 6 ni com Index Numerics 3D view 1 5 A acquiring images grab continuous image 2 9 opening the Interface window 2 6 sequence 2 9 snap single image 2 8 acquisition types grab 2 6 sequence 2 6 snap 2 6 Acquisition window opening 2 6 advanced edge tool 6 analyzing particles 3 9 Assistant 2 6 binary functions 1 6 binary processing and analysis functions circle detection 1 6 invert binary image 1 6 particle analysis 1 6 Browser See Image Browser C calibration from image 1 8 calibration functions calibration from image 1 7 grid calibration 1 7 image correction 1 7 simple calibration 1 7 caliper 1 7 4 7 4 10 National Instruments Corporation centroid 1 6 Choose Measurements button 3 9 circle detection
38. e line of code that may have input and or output parameters and returns a value when executed Measurement of an object or distances between objects An image with monochrome information G 2 ni com H histogram HSL hue image Image Browser image file image processing image source imaging IMAQ inspection intensity kernel National Instruments Corporation G 3 Glossary Indicates the quantitative distribution of the pixels of an image per gray level value Color encoding scheme using Hue Saturation and Luminance information where each image in the pixel is encoded using 32 bits eight bits for hue eight bits for saturation eight bits for luminance and eight unused bits Represents the dominant color of a pixel The hue function is a continuous function that covers all the possible colors generated using the R G and B primaries See also RGB A two dimensional light intensity function f x y where x and y denote spatial coordinates and the value f at any point x y is proportional to the brightness at that point An image that contains thumbnails of images to analyze or process in a vision application A file containing pixel data and additional information about the image Encompasses various processes and analysis functions that you can apply to an image Original input image Any process of acquiring and displaying images and analyzing image data Image Acquisition The proce
39. eatures on which you can base the measurements In this example you use pattern matching to find manufactured holes in a bracket These holes serve as measurement points from which you can determine if the bracket arch is the appropriate height and curvature 1 Select Pattern Matching in the Machine Vision tab of the Inspection steps or select Machine Vision Pattern Matching Click Create Template 3 With the Rectangle Tool click and drag to draw a square ROI around the left hole in the image as shown in Figure 4 2 The ROI becomes the template pattern Figure 4 2 Selecting a Template Pattern National Instruments Corporation 4 3 NI Vision Assistant Tutorial Chapter 4 Using Gauging for Part Inspection 10 11 12 NI Vision Assistant Tutorial Click OK to learn the selected area as the template pattern Learning the template takes a few seconds After Vision Assistant learns the template the Save dialog box opens Navigate to Program Files National Instruments Vision Assistant 7 1 Examples Bracket Save the template as template png The Pattern Matching Parameter window displays the template image and its path Click the Settings tab Set Number of Matches to Find to 1 Set the Minimum Score to 600 to ensure that Vision Assistant finds matches similar but not identical to the template Click Sub pixel Accuracy Make sure Search for Rotated Patterns is unselected to set the search mode to s
40. eed to manipulate the parameters several times to find the values that work best Rather than entering numbers in the Min and Max fields you can select the range using the pointers on the histogram Adjust the pointers until all of the objects you want to select are red The black pointer marks the minimum value and the white pointer marks the maximum value NI Vision Assistant Tutorial 2 4 ni com Chapter 2 Introduction to Image Processing with Vision Assistant 9 Click OK to apply the manual threshold to the image The image is converted to a binary image where all of the selected pixels in the threshold range are set to 1 red and all other pixels are set to 0 black Refer to Figure 2 4 to see what the image looks like after applying the threshold SINT Vision Assistant MEE Image When To File Edit Image Color Grayscale Binary Machine Vision View Tools Help Sk Ss ye 2 2 amp sl a E Metall eer wm gt fe 4 OG i in ett ate ard TT Line Profile Displays the grayscale FE distribution along a ine of pixels in an A Hes coer poets Er 3D View Displays the light intensity in a HE wl ij e s amp ea three dimensional coordinate system r aa Biishiness Aters the brightness contrast at Sm eee Original Image Threshold 1 frags ve seecedregen tetas all Figure 2 4 Thresholde
41. ent shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it EXCEPT AS SPECIFIED HEREIN NATIONAL INSTRUMENTS MAKES NO WARRANTIES EXPRESS OR IMPLIED AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE CUSTOMER S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA PROFITS USE OF PRODUCTS OR INCIDENTAL OR CONSEQUENTIAL DAMAGES EVEN IF ADVISED OF THE POSSIBILITY THEREOF This limitation of the liability of National Instruments will apply regardless of the form of action whether in contract or tort including negligence Any action against National Instruments must be brought within one year after the cause of action accrues National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control The warranty provided herein does not cover damages defects malfunctions or service failures caused by owner s failure to follow the National Instruments installation operation or maintenance instructions owner s modification of the product owner s abuse misuse or negligent acts and power failure or surges fire flood accident actions of third parties or other events outside reasonable control Copyright
42. ge from grayscale to binary Complete the following steps to select a range of brighter pixels for analysis 1 Select Threshold in the Grayscale tab of the Processing Functions palette or select Grayscale Threshold The Threshold Parameter window displays a histogram A histogram counts the total number of pixels in each grayscale value and graphs it From the graph you can tell if the image contains distinct regions of a certain grayscale value You also can select pixel regions of the image National Instruments Corporation 3 5 NI Vision Assistant Tutorial Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal 2 Select Manual Threshold from the Threshold list 3 Select a range of 130 to 255 Notice that the particles of interest circular and non circular are highlighted in red When you apply the threshold everything highlighted is set to 1 and all other pixels are set to 0 Tip Rather than entering numbers in the Min and Max fields you can select the range using the pointers on the histogram Adjust the pointers until all of the objects you want to select are red The black pointer marks the minimum value and the white pointer marks the maximum value NI Vision Assistant Tutorial 4 Click OK to apply the threshold and add this step to the script Figure 3 3 shows the thresholded image The pixels that you selected for processing appear red Unselected pixels appear black The image is now a bin
43. green in the processing view r 4 x To show only the area measurement click Select Measurements Click the None button for the pixel measurements to deselect all of the measurements The real world measurements are grayed out because the image is not calibrated Select pixels and real world for Area Click OK Click OK to record the particle analysis and add the step to the script You now have all of the information you need to analyze the structure of the metal Remember to include the analysis as part of the LabVIEW LabWindows CVI or Visual Basic solution You can also use Microsoft Excel to analyze the data Vision Assistant generates To send the data to Microsoft Excel click the Send Data to Excel button in the Particle Analysis results window Testing the Particle Analysis Script The script that you created as you processed this image is a custom algorithm To test this algorithm run it on another image in the collection using the following steps 1 2 National Instruments Corporation Click the Image Browser button in the Standard toolbar Double click the third image Meta13 jpg 3 9 NI Vision Assistant Tutorial Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal Q Tip Rather than returning to the Image Browser you can navigate through the images in the Image Browser from the Reference window Click the Next Image and Previous Image buttons until you see the image you want
44. hen To File Edit Image Color Grayscale Binary Machine Vision View Tools Help ZS pial P 2 2 E E w gt fel There is no available image to process Acquire Image Acquires an image from the BE selected camera and image acquisition board Acquire Image IEEE 1394 Acquires an image from the selected camera and image acquisition board Be Aque Image AT Acquires an image ar from the selected camera and image acquisition board F Simulate Acquisition Simulates the Shap 2cquisition of images by reading image from file Retum i ere rial 1 Make Image Active 3 Acquisition Functions 2 Store Acquired Image in Browser Button Figure 2 5 Acquiring Images in Vision Assistant iy Note You must have one of the following device and driver software combinations to acquire live images in Vision Assistant e National Instruments IMAQ device and NI IMAQ 3 0 or later e IEFE 1394 industrial camera and NI IMAQ for IEEE 1394 Cameras 1 5 or later ay Note If the computer does not have an IMAQ device you can simulate a live acquisition with the Simulate Acquisition function You can interact with the simulation module as you would with a live acquisition National Instruments Corporation 2 7 NI Vision Assistant Tutorial Chapter 2 Introduction to Image Processing with Vision Assistant Click Acquire Image The Parameter window displays the IMAQ devices and channels installed on the computer Figure 2 6 shows that the IMAQ P
45. hift invariant Use shift invariant matching when you do not expect the matches you locate to be rotated in their images If you expect the matches to be rotated use rotation invariant matching With the Rectangle Tool draw an ROI around the left side of the bracket as shown in Figure 4 3 Be sure that the region you draw is larger than the template image and big enough to encompass all possible locations of the template in the other images you analyze Drawing an ROI in which you expect to locate a template match is a significant step in pattern matching It reduces the risk of finding a mismatch It also allows you to specify the order in which you want to locate multiple instances of a template in an image and speeds up the matching process Figure 4 3 Selecting the First Search Area 4 4 ni com 13 14 15 16 17 18 19 20 21 National Instruments Corporation Chapter 4 Using Gauging for Part Inspection When you draw the ROI Vision Assistant automatically locates the template in the region and displays the score and location of the match Notice that the score for the match is 1000 The score for this match is perfect because you made the template from the same region of the image Click OK to save this step to the script Select Pattern Matching in the Machine Vision tab of the Inspection steps or select Machine Vision Pattern Matching Click Load from File and open the template you just saved
46. icles in binary images e Particle Filter Filters objects based on shape measurements e Invert Binary Image Reverses the dynamic of an image that contains two different grayscale populations e Shape Matching Finds image objects that are shaped like the object specified by the template e Particle Analysis Computes more than 80 measurements on objects in an image including the area and perimeter of the objects e Circle Detection Separates overlapping circular objects and classifies them according to their radii 1 6 ni com Chapter 1 System Requirements and Installation Machine Vision Functions Vision Assistant provides the following machine vision functions Edge Detection Finds edges along a line that you draw with the Line Tool Find Straight Edge Finds points along the edge of an object and then finds a line describing the edge Find Circular Edge Locates the intersection points between a set of search lines within a circular area or annulus and then finds the best fit circle Clamp Finds edges within a rectangular region of interest ROI drawn in the image and measures the distance between the first and last edge Pattern Matching Locates regions of a grayscale image that match a predetermined template Pattern Matching can find template matches regardless of poor lighting blur noise shifting of the template and rotation of the template Caliper Computes measurements such as d
47. ile Acquire Image Click Acquire Image in the Acquisition function list Select the appropriate device and channel Click the Acquire Continuous Images button to acquire and display images in continuous mode at the maximum rate Click the Acquire Continuous Images button again to stop the acquisition and display the last acquired image Tip You can acquire an ROI within the full sized image If you draw an ROI on an image while grabbing it the image reduces to the ROI You can refine the acquired area again by selecting another region of interest or you can return to the full sized image by clicking the image Gil 6 T 8 Click the Store Acquired Image in Browser button to send the image to the Image Browser Click Close to exit the Parameter window Process the image as you would any other image in Vision Assistant Acquiring a Sequence of Images National Instruments Corporation A e a a Click File Acquire Image Click Acquire Image in the Acquisition function list Select the appropriate device and channel Click the Sequence Acquisition button Set the properties on the Sequence Acquisition Wizard e Number of Frames Number of frames you want to acquire e Skip Count Number of frames you want to skip between acquisitions e Line Physical trigger line e Action Triggering action Valid values include Disabled Trigger start of acquisition and Trigger each image e Timeout Time in millise
48. imilar cases A line profile returns the grayscale values along a line that you draw with the Line Tool Complete the following steps to examine edges using a line profile 1 Click Line Profile in the Image tab of the Processing Functions palette or select Image Line Profile to open the Parameter window Notice that the Line Tool is automatically selected and active 2 Draw a short segment across a particle as shown in Figure 3 1 0 Tip ROIs are context sensitive and you can easily adjust their location in the image or the position of their center points You also can adjust the position of the ROI in the image by using the arrow keys on the keyboard SINT Vision Assistant Metall pg 8 bit 512x512 wT gt fe 512x512 1 1 0 0 23 00 Minimum Value Linear Maximum Value 200 00 Logarithmic Mean Value 112 59 Std Deviation 68 37 Number of Pixels 51 EA 1 Edges of Particles 3 Segment Drawn with Line Tool 2 Graph or Profile Showing Fluctuation in Pixel Values Figure 3 1 Using a Line Profile to Examine Edges National Instruments Corporation 3 3 NI Vision Assistant Tutorial Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal Click OK In Figure 3 1 the areas labeled 1 represent the edges of the particles Notice that the edges of both particles have a slope The more shallow the slo
49. ion Assistant you may need to consult other sources if you have questions The following sources can provide you with more specific information about IMAQ Vision IMAQ hardware and imaging Vision Assistant Embedded Help Window Vision Assistant displays context sensitive help in the Embedded Help window when you call any image processing function The Embedded Help window contains several tabs that describe when to use image processing functions how to perform an image processing function and descriptions of the controls that appear in the Parameter window for the function Vision Assistant Online Help Vision Assistant offers tooltips and online help that you can access in the following ways The Vision Assistant Help details each of the Vision Assistant functions and how to use them To open the help in Vision Assistant select Help Online Help Move the cursor over a button to see tooltips on buttons in the toolbar Script window Reference window or Image Browser Vision Assistant Documentation Vision Assistant offers the following documentation NI Vision Assistant Tutorial NI Vision Assistant Tutorial Step by step instructions for prototyping a vision application with Vision Assistant IMAQ Vision Concepts Manual Detailed information about the concepts and algorithms used by Vision Assistant Launch the IMAQ Vision Concepts Manual by selecting Start Programs National Instruments Vision Documentation IMAQ V
50. ision Concepts Manual 1 8 ni com Chapter 1 System Requirements and Installation National Instruments Web Site The National Instruments Web site provides information about IMAQ hardware and software at ni com imaq From the IMAQ site you can locate information about new IMAQ Vision features machine vision problems and solutions using Multimedia Extensions MMX technology on machine vision applications and selecting the appropriate IMAQ hardware cameras lenses and lighting equipment for the application The NI Developer Zone available at ni com zone is the essential resource for building measurement and automation systems The NI Developer Zone includes the latest example programs system configurators tutorials and technical news as well as a community of developers ready to share their own techniques Vision Assistant Scripts The Vision Assistant installation program installs several example scripts You can run these scripts to learn more about Vision Assistant scripting capabilities You also can customize these scripts for your applications By default the scripts are installed at C Program Files National Instruments Vision Assistant 7 1 Examples and at C Program Files National Instruments Vision Assistant 7 1 Solutions National Instruments Corporation 1 9 NI Vision Assistant Tutorial Introduction to Image Processing with Vision Assistant This chapter describes how you can use Vision As
51. ision Assistant Metall ipg 8 bit 512x512 1s gt ajes File Edit Image Color Grayscale Binary Machine Vision View Tools Help Zino pe APR ome nagg Histogram Counts the total number of pixels in each grayscale value and graphs it Line Profile Displays the grayscale distribution along a line of pixels in an Measure Calculates measurement statistics associated with a region of interest in the image 3D View Displays the light intensity in a three dimensional coordinate system Brightness Alters the brightness contra and gamma of an image Fc Image Mask Builds a mask from an enti 53 image or a selected region of interest l st ie Original Image zi 4 SI 1 Reference Window 2 Zoom Ratio 3 Image Size 4 Script Window 5 Processing Window Ts National Instruments Corporation Figure 2 2 Processing an Image Tip The Image tab of the Reference window displays the original version of the image as you manipulate it in the Processing window Click the Grayscale tab of the Processing Functions palette and click Threshold or select Grayscale Threshold The Threshold Parameter window appears in the lower left corner of the Vision Assistant window as shown in Figure 2 3 NI Vision Assistant Tutorial Chapter 2 Introdu
52. istances areas and angles based on results returned from other machine vision and image processing functions Barcode Reading Reads 1D and 2D barcodes Data Matrix and PDF417 OCR Performs optical character recognition OCR on a region of an image Classification Classifies samples in a region of the image and returns their label Vision Assistant Calibration Functions Vision Assistant provides the following calibration functions National Instruments Corporation Simple Calibration Sets a simple calibration for an image This function sets the horizontal and vertical scaling factor as well as the origin and orientation of the coordinate system for the image User Specified Points Calibration Uses a set of known mapping points in the image and the corresponding locations in the real world The calibration algorithm uses these known mappings to compute the pixel to real world mapping for the entire image Grid Calibration Learns a calibration based on the image of a grid template acquired with the imaging setup you are calibrating 1 7 NI Vision Assistant Tutorial Chapter 1 System Requirements and Installation Getting Help Calibration from Image Applies the calibration information saved in an image file to the current image Image Correction Transforms a distorted image acquired in a calibrated setup into an image where perspective errors and lens distortion are corrected As you work with Vis
53. istant you can acquire images with various National Instruments digital and analog IMAQ devices such as the PCI PXI 1428 PCI PXI 1409 PCI PXI 1411 and so on Vision Assistant provides specific support for several Sony JAI and IEEE 1394 cameras You configure IMAQ devices in National Instruments Measurement amp Automation Explorer MAX For information about setting up IMAQ devices and channels in MAX refer to the Measurement amp Automation Explorer Help for IMAQ If you do not have IMAQ devices and NI IMAQ 3 0 or later or NI IMAQ for IEEE 1394 Cameras 1 5 or later installed Vision Assistant allows you to simulate the acquisition process by displaying a sequence of images You can stop the sequence at any frame capture the image and send the image to the Image Browser for processing Opening the Acquisition Window Complete the following steps to acquire images 1 Click Start Programs National Instruments Vision Assistant 7 1 Click Acquire Image in the Welcome screen to view the Acquisition functions as shown in Figure 2 5 If you already have Vision Assistant running click the Acquire Image button in the toolbar Vision Assistant displays the Acquisition functions as shown in Figure 2 5 NI Vision Assistant Tutorial 2 6 ni com Chapter 2 Introduction to Image Processing with Vision Assistant SMI vision Assistant BEE Image w
54. metric Feature listbox In the image click points 1 and 2 in the image to find the first measurement Bracket Distance which measures the length between the manufactured holes in the bracket and determines if the bracket arch is the appropriate height 3 Note You can double click points in the Points listbox to select them instead of clicking the points in the image When you select a point Vision Assistant places a check mark next to it 9 Tip If you have trouble finding the points click the Zoom In tool in the Tools palette to magnify the image Magnification factors are displayed in the lower left corner of the Processing window 1 1 specifies 100 magnification default 2 1 specifies a slightly magnified view and 1 2 specifies a slightly demagnified view 4 Click Measure to compute the distance between the bracket holes and add the measurement to the results table as shown in Figure 4 6 National Instruments Corporation 4 7 NI Vision Assistant Tutorial Chapter 4 Using Gauging for Part Inspection 10 11 NI Vision Assistant Tutorial TES t 1 Patter Matching 1 Match E 5 4 2 Pattem Matching 2 Match 1 OFE tor 1 Script Untitled Script 2 O 4 Edge Detector 1 Edge 2 ESS SS SSS ST O 5 Caliper 1 1 j Figure 4 6 Using the Caliper Function to Find Bracket Distance Click OK to add this step to the script Select Caliper in the Machine Vision tab or select Machine Vision Caliper again
55. ms National Instruments Vision Assistant 7 1 Click Open Image on the Welcome Screen If you already have Vision Assistant running click the Open Image button in the toolbar Navigate to C Program Files National Instruments Vision Assistant 7 1 Examples Metal and enable the Select All Files checkbox Tip The Preview Image window displays all selected images in a sequence To view the images at a different rate adjust the slide to the right of the Preview Image window Click OK Vision Assistant loads the image files which represent microscopic views of pieces of metal into the Image Browser From this collection of images in the Image Browser you can select the image that you want to process Double click the first image Metal1 jpg to load the image into the Processing window Preparing an Image for Particle Analysis Before you can separate circular particles from non circular particles you must prepare the image To isolate particles of interest verify that individual particles are separated by a gap and that the borders of those particles are distinct NI Vision Assistant Tutorial 3 2 ni com Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal Examining the Image Examine the image in the Processing window The image is slightly blurred and the edges of particles are not distinct Although you can see these problems from just looking at the image you may need to use a line profile in s
56. n lf you have time constraints limited in house technical resources or other project challenges National Instruments Alliance Partner members can help To learn more call your local NI office or visit ni com alliance If you searched ni com and could not find the answers you need contact your local office or NI corporate headquarters Phone numbers for our worldwide offices are listed at the front of this manual You also can visit the Worldwide Offices section of ni com niglobal to access the branch office Web sites which provide up to date contact information support phone numbers email addresses and current events National Instruments Corporation A 1 NI Vision Assistant Tutorial Glossary Numbers 3D view Displays the light intensity of an image in a three dimensional coordinate system where the spatial coordinates of the image form two dimensions and the light intensity forms the third dimension area A rectangular portion of an acquisition window or frame that is controlled and defined by software binary image An image in which the objects usually have a pixel intensity of 1 or 255 and the background has a pixel intensity of 0 C caliper 1 A function in Vision Assistant that calculates distances angles circular fits and the center of mass based on positions given by edge detection particle analysis centroid and search functions 2 A measurement function that finds edge pairs along a specified path
57. n erosion followed by a dilation An opening removes small objects and smooths boundaries of objects in the image Allow masking combination and comparison of images You can use arithmetic and logic operators in IMAQ Vision G 4 ni com P palette particle particle analysis pattern matching picture element pixel PNG Q quantitative analysis R resolution RGB National Instruments Corporation Glossary The gradation of colors used to display an image on screen usually defined by a color lookup table A connected region or grouping of pixels in an image in which all pixels have the same intensity level A series of processing operations and analysis functions that produce some information about the particles in an image The technique used to locate quickly a grayscale template within a grayscale image An element of a digital image Also called pixel Picture element The smallest division that makes up the video scan line For display on a computer monitor a pixel s optimum dimension is square aspect ratio of 1 1 or the width equal to the height Portable Network Graphic Image file format for storing 8 bit 16 bit and color images with lossless compression extension PNG Obtaining various measurements of objects in an image The number of rows and columns of pixels An image composed of m rows and n columns has a resolution of m x n Color encoding scheme using red green and blue RG
58. on 4 1 finding edges 4 6 finding measurement points using pattern matching 4 3 introduction 4 1 loading images 4 3 making measurements 4 7 overview 4 1 NI Vision Assistant Tutorial l 2 getting help in Vision Assistant 1 8 getting started Vision Assistant 2 1 grab 2 6 grabbing images continuous acquisition 2 9 grayscale functions 1 6 grayscale image processing and analysis functions centroid 1 6 quantify 1 6 grayscale morphology 1 6 grid calibration 1 7 H help National Instruments Web site 1 9 technical support A 1 Heywood Circularity Factor particle filter 3 8 histogram 1 4 2 4 3 5 in Threshold Parameter window 2 4 image acquisition 2 6 See also acquiring images image analysis functions 1 4 Image Browser accessing from the toolbar 3 10 definition 1 3 full size view 2 2 important elements figure 2 1 thumbnail view 2 2 image correction 1 8 image processing thresholding images 2 4 images loading for gauging 4 3 IMAQ hardware 2 6 NI IMAQ 1 1 installing Vision Assistant 1 1 instrument drivers NI resources A 1 invert binary image 1 6 isolating circular particles 3 8 ni com K KnowledgeBase A 1 L LabVIEW 3 9 VI creation 1 4 LabWindows CVI 3 9 launching Vision Assistant 1 2 line profile 1 4 3 3 4 6 line tool 3 3 loading images 2 1 gauging 4 3 particle analysis 3 2 lookup tables 1 6 M machine vision functions 1 7 clamp 1 7
59. pe the greater variation you have in detecting the exact location of the edge As you change the threshold level in images with shallow sloped particle edges you might inadvertently change the shape or size of the particle In the Filtering the Image section of this chapter you use the Convolution Highlight Details filter under Filters in the Grayscale tab of the Processing Functions palette to define the edges of the particles and increase the slope The area labeled 2 in Figure 3 1 is a fluctuation in pixel values which might be caused by brighter and darker pixels in the center of the particles or it might also be edges of a hole in the particle Later you will threshold the image to make all of the pixels in the particles the same pixel value and then perform a morphological operation on the image to fill any holes left in the particles Filtering the Image Filters can smooth sharpen transform and remove noise from an image so that you can extract the information you need To sharpen edges including the edges of any holes inside a particle and create contrast between the particles and the background complete the following steps 1 Select Filters in the Grayscale tab of the Inspection steps or select Grayscale Filters Select Convolution Highlight Details from the Filters list This function detects sharp transitions and highlights edge pixels according to a kernel to make gaps more prominent A kernel is a structure that
60. represents a pixel and its relationship to its neighbors For more information about kernels refer to Chapter 5 Image Processing of the IMAQ Vision Concepts Manual Click OK to add this step to the script Examining the Results of the Filtering To confirm that the filter sharpened edges and separated particles perform another line profile using the following steps 1 NI Vision Assistant Tutorial Select Line Profile in the Image tab of the Processing Functions palette or select Image Line Profile 3 4 ni com Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal 2 Click and drag to draw a short segment across a particle to examine the line profile of the particle and its border as shown in Figure 3 2 The line profile indicates more defined edges 3 Click OK SENT Vision Assistant CER Metall jpg 8 bit 512512 wT gt fe m s wa i IARA AT S 512x5121 1 0 0 e 438 Mapping mode Minimum Value 11 0 Linear Maximum Value 235 00 Logarithmic Mean Value 155 50 Std Deviation 72 91 Number of Pixels 84 1 Segment Drawn with Line Tool Figure 3 2 Using a Line Profile to Examine Particle Edges Separating Particles from the Background with Thresholding Thresholding isolates pixels that interest you and sets the remaining pixels as background pixels Thresholding also converts the ima
61. roupings of pixels in an image and then make selected measurements of those regions Using particle analysis you can detect and analyze any two dimensional shape in an image With this information you can detect flaws on silicon wafers detect soldering defects on electronic boards or locate objects in motion control applications when there is significant variance in part shape or orientation Tutorial This tutorial demonstrates finding the area of circular particles in a metal As you perform this analysis Vision Assistant records all of the processing operations and parameters in a script You run the script on other images to test the particle analysis algorithm National Instruments Corporation 3 1 NI Vision Assistant Tutorial Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal To find the total area of circular particles you perform the following image processing steps Filter the image to sharpen edges and ease the separation of the particles from the background Threshold the image to isolate the appropriate particles Fill holes that appear in the particles after thresholding Remove all objects touching the border so that you remove partial particles Use a particle filter to find all circular particles and remove non circular particles Perform a particle analysis to find the total area occupied by circular particles Loading Images into Vision Assistant ag 1 Select Start Progra
62. s a column of pixels in the 3D view The pixel value corresponds to the altitude 1 4 ni com Chapter 1 System Requirements and Installation Image Mask Builds a mask from an entire image or region of interest Geometry Modifies the geometrical representation of an image Image Buffer Stores and retrieves images from buffers Get Image Opens a new image from a file Calibrate Image Calibrates an image to perform measurements in real world units Calibrate from Image Applies the calibration information saved in an image to another image Image Correction Transforms a distorted image acquired in a calibrated setup into an image where perspective errors and lens deformations are corrected Color Image Processing Functions Vision Assistant provides the following set of functions for processing and analyzing color images National Instruments Corporation Color Operators Applies an arithmetic operation between two images or between an image and a constant Extract Color Planes Extracts the Red Green or Blue RGB plane or the Hue Saturation or Luminance HSL plane of a color image Color Threshold Applies a threshold to the three planes of an RGB or HSL image Color Location Locates colors in an image Color Matching Compares the color content of one or multiple regions in an image to a reference color set Color Pattern Matching Searches for a color template in an image 1 5 NI Vision A
63. s the center of the bracket and becomes the vertex of Bracket Angle Bracket Angle measures the angle of the arms of the bracket and determines if the bracket arms are aligned properly Bracket Distance measures the length in pixels between two manufactured holes in the bracket Bracket Distance also determines if the bracket arch is the appropriate height and curvature As you perform this analysis Vision Assistant records all of the processing operations and parameters in a script that you can run on other bracket images to determine which are good and which are defective NI Vision Assistant Tutorial 4 2 ni com Chapter 4 Using Gauging for Part Inspection Loading Images into Vision Assistant Complete the following steps to load an image 1 Select Start Programs National Instruments Vision Assistant 7 1 2 Click Open Image in the Welcome screen or select File Open Image to load images 3 Navigate to C Program Files National Instruments Vision Assistant 7 1 Examples Bracket and select Select All Files Y Tip The Preview Image window displays all selected images in a sequence To view the images at a different rate adjust the slide to the right of the Preview Image window 4 Click OK to load the image files into Vision Assistant 5 Double click the first image Bracket1 jpg to load it into the Processing window Finding Measurement Points Using Pattern Matching Before you can compute measurements you must locate f
64. sistant to create and test image processing algorithms For detailed information about digital images refer to Chapter 1 Digital Images of the IMAQ Vision Concepts Manual Getting Started in Vision Assistant This section describes the software specific terminology that you need to complete the tutorials in this manual and understand the online help The best way to understand how Vision Assistant works and what you can accomplish with the software is to use it In this short example you load images into Vision Assistant and perform a threshold on them Thresholding isolates objects keeping those that interest you and removing those that do not Thresholding also converts the image from a grayscale image with pixel values ranging from 0 to 255 to a binary image with pixel values of 0 or 1 Complete the following steps to get started in Vision Assistant 1 Select Start Programs National Instruments Vision Assistant 7 1 2 To load images click Open Image in the Welcome screen 3 Navigate to C Program Files National Instruments Vision Assistant 7 1 Examples Metal and select Select All Files Vision Assistant previews the images in the Preview Image window and displays information about the file type and image depth 4 Click OK Vision Assistant loads the image files into the Image Browser as shown in Figure 2 1 The Image Browser provides information about the selected image such as image size location and type
65. ss by which parts are tested for simple defects such as missing parts or cracks on part surfaces The sum of the Red Green and Blue primary colors divided by three Red Green Blue 3 Structure that represents a pixel and its relationship to its neighbors The relationship is specified by weighted coefficients of each neighbor NI Vision Assistant Tutorial Glossary L LabVIEW line profile luma luminance M machine vision MMX neighbor NI IMAQ 0 opening operator S NI Vision Assistant Tutorial Laboratory Virtual Instrument Engineering Workbench Program development environment application based on the programming language G used commonly for test and measurement applications Represents the gray level distribution along a line of pixels in an image The brightness information in the video picture The luma signal amplitude varies in proportion to the brightness of the video signal and corresponds exactly to the monochrome picture See luma An automated application that performs a set of visual inspection tasks Multimedia Extensions Intel chip based technology that allows parallel operations on integers which results in accelerated processing of 8 bit images A pixel whose value affects the value of a nearby pixel when an image is processed The neighbors of a pixel are usually defined by a kernel or a structuring element Driver software for National Instruments IMAQ hardware A
66. ssistant Tutorial Chapter 1 System Requirements and Installation Grayscale Image Processing and Analysis Functions Vision Assistant provides the following functions for grayscale image processing and analysis e Lookup Table Applies predefined lookup table transformations to the image to modify the dynamic intensity of regions in the image with poor contrast e Filters Includes functions for smoothing edge detection and convolution e Gray Morphology Modifies the shape of objects in grayscale images using erosion dilation opening and closing functions e FFT Filters Applies a frequency filter to the image e Threshold lIsolates the pixels you specify and sets the remaining pixels as background pixels e Operators Performs basic arithmetic and logical operations between two images or between an image and a constant e Conversion Converts the current image to the specified image type e Quantify Measures the intensity statistics of one or multiple regions in an image e Centroid Computes the energy center of a grayscale image or an area of interest on a grayscale image Binary Processing and Analysis Functions NI Vision Assistant Tutorial Vision Assistant provides the following functions for binary processing and analysis e Basic Morphology Performs morphology transformations that modify the shape of objects in binary images e Adv Morphology Performs high level operations on part
67. to process and then click the Make Image Active button to move that image into the Processing window 3 Click the Run Once button Figure 3 6a shows the original image Meta13 jpg Figure 3 6b shows the image after the particle analysis processing Notice that two circular particles are removed from the image during processing because they are touching each other Adjust the thresholding step to separate particles 1 Overlapping Circular Particles Figure 3 6 Comparing the Original Image to the Processed Image 4 Click OK to close the Particle Analysis window Double click the Threshold step in the script window to open the threshold parameters Figure 3 7 shows Meta13 jpg at the thresholding step of the script NI Vision Assistant Tutorial 3 10 ni com Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal ISIN Vision Assistant AEE Image HowTo Contot oF PEAT G YSE BNE MEE VE ie Tode Hela zea a E PeR elm lojal olelole Metal3 jpg 8 bit 512x512 e els Template Threshold Type Image Source Manual Threshold Auto Threshold Clustering Auto Threshold Entropy Auto Threshold Metric a ThnesholdValues Min SJ 150 Mak 3f 255 512x512 1 1 25 187 Sam a s e 4B E at drj 2 so 75 100 125 150 175 200 225 25 oigama Convolution Highlight Threshold 1
68. ured in high quantity While human inspection of these components is tedious and time consuming Vision systems can quickly and consistently measure certain features on a component and generate a report with the results From the results you can determine if a part meets its specifications Gauging consists of making critical distance measurements such as lengths diameters angles and counts to determine if the product is manufactured correctly Gauging inspection is used often in mechanical assembly verification electronic packaging inspection container inspection glass vial inspection and electronic connector inspection In this tutorial you analyze images of pipe brackets to determine if the brackets meet their physical specifications A pipe bracket is a metal piece of hardware used to secure long slender parts such as a tube of bundled wires The goal is to measure angles and distances between features on the brackets and determine if those measurements fall within a tolerance range Figure 4 1 illustrates the measurements and the acceptable values for them National Instruments Corporation 4 1 NI Vision Assistant Tutorial Chapter 4 Using Gauging for Part Inspection Side View Bracket Distance 362 to 368 pixels Edge 1 ay 3 3 f 4 Bracket Angle 178 to 181 Degrees Edge 2 Width Center Top View Figure 4 1 Bracket Specifications Width Center i
69. window 15 Select File Save Script and save the script as bracket scr Analyzing the Results e NI Vision Assistant Tutorial Complete the following steps to use a script to analyze another similar image 1 Using the navigation buttons in the Reference Window select the next bracket image and click the Make Image Active button Click Run Once Double click the last step in the script which uses the function Table 4 1 shows the actual measurement results you might see for the bracket image You can use batch processing to analyze multiple images and save the resulting analysis information in a tab delimited text file Table 4 1 displays analysis information for multiple images including the acceptable ranges for the bracket measurements and the actual values you might see for the bracket image Notice that Bracket1 Bracket2 and Bracket3 4 10 ni com Chapter 4 Using Gauging for Part Inspection are the only ones that meet the specifications The bold values for the other brackets indicate which measurements caused them to fail Refer to the Vision Assistant Help for information about the Vision Assistant batch processing functionality 3 Note The results may vary slightly based on the template you chose for the pattern matching step and the position of the line you drew for the edge detection step Table 4 1 Bracket Measurement Results Bracket Bracket Distance Bracket Angle Number ac

Download Pdf Manuals

image

Related Search

Related Contents

Grilles de références du palier 2 pour l`évalluation et la  Origin Storage 512GB MLC SATA 2.5"  RoomCare R3 - Sealed Air  811296 DIGITAL ALARM CLOCK MIA AND ME USER MANUAL  DOSSIER DE 1ère INSCRIPTION 2013-2014  Untitled - Alltek Marine  

Copyright © All rights reserved.
Failed to retrieve file