0% found this document useful (0 votes)
36 views62 pages

VA Tutorial

VA_Tutorial
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views62 pages

VA Tutorial

VA_Tutorial
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

TM

NI Vision
NI Vision Assistant Tutorial

March 2018
372228P-01
Support

Worldwide Technical Support and Product Information


ni.com

Worldwide Offices
Visit ni.com/niglobal to access the branch office websites, which provide up-to-date
contact information, support phone numbers, email addresses, and current events.

National Instruments Corporate Headquarters


11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100

For further support information, refer to the NI Services appendix. To comment on NI


documentation, refer to the NI website at ni.com/info and enter the Info Code feedback.

© 1999–2018 National Instruments. All rights reserved.


Legal Information
Limited Warranty
This document is provided ‘as is’ and is subject to being changed, without notice, in future editions. For the latest version,
refer to ni.com/manuals. NI reviews this document carefully for technical accuracy; however, NI MAKES NO EXPRESS
OR IMPLIED WARRANTIES AS TO THE ACCURACY OF THE INFORMATION CONTAINED HEREIN AND
SHALL NOT BE LIABLE FOR ANY ERRORS.
NI warrants that its hardware products will be free of defects in materials and workmanship that cause the product to fail to
substantially conform to the applicable NI published specifications for one (1) year from the date of invoice.
For a period of ninety (90) days from the date of invoice, NI warrants that (i) its software products will perform substantially
in accordance with the applicable documentation provided with the software and (ii) the software media will be free from
defects in materials and workmanship.
If NI receives notice of a defect or non-conformance during the applicable warranty period, NI will, in its discretion: (i) repair
or replace the affected product, or (ii) refund the fees paid for the affected product. Repaired or replaced Hardware will be
warranted for the remainder of the original warranty period or ninety (90) days, whichever is longer. If NI elects to repair or
replace the product, NI may use new or refurbished parts or products that are equivalent to new in performance and reliability
and are at least functionally equivalent to the original part or product.
You must obtain an RMA number from NI before returning any product to NI. NI reserves the right to charge a fee for
examining and testing Hardware not covered by the Limited Warranty.
This Limited Warranty does not apply if the defect of the product resulted from improper or inadequate maintenance,
installation, repair, or calibration (performed by a party other than NI); unauthorized modification; improper environment;
use of an improper hardware or software key; improper use or operation outside of the specification for the product; improper
voltages; accident, abuse, or neglect; or a hazard such as lightning, flood, or other act of nature.
THE REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND THE CUSTOMER’S SOLE REMEDIES, AND SHALL
APPLY EVEN IF SUCH REMEDIES FAIL OF THEIR ESSENTIAL PURPOSE.
EXCEPT AS EXPRESSLY SET FORTH HEREIN, PRODUCTS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND AND NI DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, WITH RESPECT TO THE
PRODUCTS, INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, AND ANY WARRANTIES THAT MAY ARISE FROM
USAGE OF TRADE OR COURSE OF DEALING. NI DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
REPRESENTATIONS REGARDING THE USE OF OR THE RESULTS OF THE USE OF THE PRODUCTS IN TERMS
OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. NI DOES NOT WARRANT THAT THE
OPERATION OF THE PRODUCTS WILL BE UNINTERRUPTED OR ERROR FREE.
In the event that you and NI have a separate signed written agreement with warranty terms covering the products, then the
warranty terms in the separate agreement shall control.
Copyright
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.
National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected
by copyright and other intellectual property laws. Where NI software may be used to reproduce software or other materials
belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the
terms of any applicable license or other legal restriction.
End-User License Agreements and Third-Party Legal Notices
You can find end-user license agreements (EULAs) and third-party legal notices in the following locations:
• Notices are located in the <National Instruments>\_Legal Information and <National Instruments>
directories.
• EULAs are located in the <National Instruments>\Shared\MDF\Legal\license directory.
• Review <National Instruments>\_Legal Information.txt for information on including legal information in
installers built with NI products.
U.S. Government Restricted Rights
If you are an agency, department, or other entity of the United States Government (“Government”), the use, duplication,
reproduction, release, modification, disclosure or transfer of the technical data included in this manual is governed by the
Restricted Rights provisions under Federal Acquisition Regulation 52.227-14 for civilian agencies and Defense Federal
Acquisition Regulation Supplement Section 252.227-7014 and 252.227-7015 for military agencies.
Trademarks
Refer to the NI Trademarks and Logo Guidelines at ni.com/trademarks for more information on NI trademarks.
ARM, Keil, and µVision are trademarks or registered of ARM Ltd or its subsidiaries.
LEGO, the LEGO logo, WEDO, and MINDSTORMS are trademarks of the LEGO Group.
TETRIX by Pitsco is a trademark of Pitsco, Inc.
FIELDBUS FOUNDATION™ and FOUNDATION™ are trademarks of the Fieldbus Foundation.
EtherCAT® is a registered trademark of and licensed by Beckhoff Automation GmbH.
CANopen® is a registered Community Trademark of CAN in Automation e.V.
DeviceNet™ and EtherNet/IP™ are trademarks of ODVA.
Go!, SensorDAQ, and Vernier are registered trademarks of Vernier Software & Technology. Vernier Software & Technology
and vernier.com are trademarks or trade dress.
Xilinx is the registered trademark of Xilinx, Inc.
Taptite and Trilobular are registered trademarks of Research Engineering & Manufacturing Inc.
FireWire® is the registered trademark of Apple Inc.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Handle Graphics®, MATLAB®, Simulink®, Stateflow®, and xPC TargetBox® are registered trademarks, and
Simulink Coder™, TargetBox™, and Target Language Compiler™ are trademarks of The MathWorks, Inc.
Tektronix®, Tek, and Tektronix, Enabling Technology are registered trademarks of Tektronix, Inc.
The Bluetooth® word mark is a registered trademark owned by the Bluetooth SIG, Inc.
The ExpressCard™ word mark and logos are owned by PCMCIA and any use of such marks by National Instruments is under
license.
The mark LabWindows is used under a license from Microsoft Corporation. Windows is a registered trademark of Microsoft
Corporation in the United States and other countries.
Other 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 NI and have no
agency, partnership, or joint-venture relationship with NI.
Patents
For patents covering NI products/technology, refer to the appropriate location: Help»Patents in your software,
the patents.txt file on your media, or the National Instruments Patent Notice at ni.com/patents.
Export Compliance Information
Refer to the Export Compliance Information at ni.com/legal/export-compliance for the NI global trade compliance
policy and how to obtain relevant HTS codes, ECCNs, and other import/export data.
WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
YOU ARE ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY AND
RELIABILITY OF THE PRODUCTS WHENEVER THE PRODUCTS ARE INCORPORATED IN YOUR SYSTEM OR
APPLICATION, INCLUDING THE APPROPRIATE DESIGN, PROCESS, AND SAFETY LEVEL OF SUCH SYSTEM
OR APPLICATION.
PRODUCTS ARE NOT DESIGNED, MANUFACTURED, OR TESTED FOR USE IN LIFE OR SAFETY CRITICAL
SYSTEMS, HAZARDOUS ENVIRONMENTS OR ANY OTHER ENVIRONMENTS REQUIRING FAIL-SAFE
PERFORMANCE, INCLUDING IN THE OPERATION OF NUCLEAR FACILITIES; AIRCRAFT NAVIGATION; AIR
TRAFFIC CONTROL SYSTEMS; LIFE SAVING OR LIFE SUSTAINING SYSTEMS OR SUCH OTHER MEDICAL
DEVICES; OR ANY OTHER APPLICATION IN WHICH THE FAILURE OF THE PRODUCT OR SERVICE COULD
LEAD TO DEATH, PERSONAL INJURY, SEVERE PROPERTY DAMAGE OR ENVIRONMENTAL HARM
(COLLECTIVELY, “HIGH-RISK USES”). FURTHER, PRUDENT STEPS MUST BE TAKEN TO PROTECT AGAINST
FAILURES, INCLUDING PROVIDING BACK-UP AND SHUT-DOWN MECHANISMS. NI EXPRESSLY DISCLAIMS
ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS OF THE PRODUCTS OR SERVICES FOR HIGH-RISK
USES.
Contents
About This Manual
Related Documentation .................................................................................................... vii

Chapter 1
Vision Assistant Environment
Launching and Exiting Vision Assistant .......................................................................... 1-1
Vision Assistant Environment .......................................................................................... 1-1
Features..................................................................................................................... 1-2
Getting Help ..................................................................................................................... 1-2
Vision Assistant Context Help and Tooltips ............................................................ 1-3
National Instruments Web Site................................................................................. 1-3
Vision Assistant Scripts............................................................................................ 1-3

Chapter 2
Introduction to Image Processing with Vision Assistant
Getting Started in Vision Assistant .................................................................................. 2-1
Acquiring Images in Vision Assistant .............................................................................. 2-6
Opening the Acquisition Window ............................................................................ 2-7
Snapping an Image ................................................................................................... 2-8
Grabbing an Image ................................................................................................... 2-9
Acquiring a Sequence of Images .............................................................................. 2-10

Chapter 3
Using Particle Analysis to Analyze the Structure of a Metal
What Is Particle Analysis?................................................................................................ 3-1
Tutorial ............................................................................................................................. 3-1
Loading Images into Vision Assistant...................................................................... 3-2
Preparing an Image for Particle Analysis ................................................................. 3-2
Examining the Image........................................................................................ 3-3
Filtering the Image............................................................................................ 3-4
Examining the Results of the Filtering ............................................................. 3-5
Separating Particles from the Background with Thresholding................................. 3-6
Modifying Particles with Morphological Functions................................................. 3-7
Isolating Circular Particles ....................................................................................... 3-8
Analyzing Circular Particles..................................................................................... 3-9
Testing the Particle Analysis Script.......................................................................... 3-10
Saving the Particle Analysis Script .......................................................................... 3-12
Estimating Processing Time ..................................................................................... 3-12
Creating a LabVIEW VI........................................................................................... 3-12
Creating a C Program ............................................................................................... 3-13

© National Instruments | v
Contents

Chapter 4
Using Gauging for Part Inspection
What Is Gauging? ............................................................................................................. 4-1
Tutorial.............................................................................................................................. 4-1
Loading Images into Vision Assistant ...................................................................... 4-3
Finding Measurement Points Using Pattern Matching ............................................. 4-3
Finding Edges in the Image ...................................................................................... 4-6
Taking the Measurements ......................................................................................... 4-7
Analyzing the Results ....................................................................................................... 4-10

Chapter 5
Using a Coordinate System for Part Inspection
What Is a Coordinate System?.......................................................................................... 5-1
Tutorial.............................................................................................................................. 5-2
Loading Images into Vision Assistant ...................................................................... 5-2
Defining a Feature on which to Base a Coordinate System ..................................... 5-2
Defining a Coordinate System .................................................................................. 5-4
Checking for Presence .............................................................................................. 5-4
Testing the Dental Floss Script ................................................................................. 5-5
Saving the Dental Floss Script.................................................................................. 5-7
Analyzing the Results ....................................................................................................... 5-7

Appendix A
NI Services

Glossary

Index

vi | ni.com
About This Manual
The NI Vision Assistant Tutorial describes the Vision Assistant software interface and guides
you through creating example image processing and machine vision applications. This tutorial
is designed for Windows users with varied levels of vision experience.

Related Documentation
The following documents contain information that you may find helpful as you use this manual.
To access the NI Vision Assistant documentation, select Start»All Programs»National
Instruments»Vision Assistant.
• NI Vision Development Module Release Notes—Contains information about new
functionality, minimum system requirements, installation instructions, and descriptions of
the documentation for NI Vision Assistant.
• NI Vision Assistant Help—Contains descriptions of the Vision Assistant features and
functions and provides instructions for using them. To open the help file in Vision Assistant,
select Help»Online Help.
• NI Vision Concepts Manual—Describes the basic concepts of image analysis, image
processing, and machine vision. This document also contains in-depth discussions about
imaging functions for advanced users.

© National Instruments | vii


Vision Assistant Environment
1
This chapter introduces the NI Vision Assistant environment and describes resources you can
consult for more information about NI Vision software and NI image acquisition devices.

Launching and Exiting Vision Assistant


To launch Vision Assistant, select Start»All Programs»National Instruments Vision
Assistant.

To exit Vision Assistant, complete the following steps:


1. Close the Setup window.
2. Save the open script and images, if necessary.
3. Click File»Exit.

Vision Assistant Environment


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 script file, which contains 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 that performs the prototype that you created in
Vision Assistant.

Note You must have LabVIEW and the NI Vision Development Module installed
to use the Vision Assistant 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.

© National Instruments | 1-1


Chapter 1 Vision Assistant Environment

Note If you have LabWindows™/CVI™ , you can create a project for the generated
C code.

Features
Vision Assistant offers the following features:
• 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.
• Image Browser—Contains all of the images currently loaded in 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.
• Processing Window—Updates the image as you change parameters. Because this view
immediately reflects the changes you have made in the Setup 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.
• Processing Functions Window/Setup 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 Processing Functions
window has a Setup window in which you set the parameters for that function. Refer to
Figure 2-3, Thresholding an Image, to view an example of the Setup window for the
Threshold function.
• Reference Window—Displays the image source as you manipulate it in the Processing
window. 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-assurance tasks
that those industries perform. The wizard loads an NI 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.
• 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.

Getting Help
As you work with Vision Assistant, you may need to consult other sources if you have questions.
The following sources can provide you with more specific information about NI Vision software
and NI image acquisition devices.

1-2 | ni.com
NI Vision Assistant Tutorial

Vision Assistant Context Help and Tooltips


Vision Assistant displays context-sensitive help in the Context Help window when you call any
image processing function. The Context 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 Setup window for the function. Click the Context
Help button on the Vision Assistant toolbar to launch the Context Help window.

Vision Assistant also provides tooltips in the Vision Assistant interface. Tooltips briefly describe
buttons in the toolbar, Script window, Reference window, or Image Browser when you move the
cursor over the buttons.

National Instruments Web Site


The National Instruments Web site provides information about NI Vision hardware and software
at ni.com/vision.

From the NI Vision site, you can locate information about new NI Vision features, machine
vision problems and solutions, and selecting the appropriate NI Vision hardware, cameras,
lenses, and lighting equipment for applications.

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 to
C:\Users\Public\Documents\National Instruments\
Vision Assistant\Examples and at <Vision Assistant>\solutions, where
<Vision Assistant> is the location to which Vision Assistant is installed.

© National Instruments | 1-3


Introduction to Image
2
Processing with Vision
Assistant
This chapter describes how you can use Vision Assistant to create and test image processing
algorithms. For detailed information about digital images, refer to Chapter 1, Digital Images, of
the NI 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»All Programs»National Instruments Vision Assistant.
2. To load images, click Open Image in the Welcome screen.
3. Navigate to C:\Users\Public\Documents\National Instruments\
Vision Assistant\Examples\metal.
4. Enable the Select All Files checkbox. Vision Assistant previews the images in the Preview
Image window and displays information about the file type and image depth.
5. Click Open. Vision Assistant opens the first image in the Processing window.
6. Click Browse Images in the upper right corner of the Vision Assistant window.

© National Instruments | 2-1


Chapter 2 Introduction to Image Processing with Vision Assistant

Vision Assistant loads the image files you opened 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.
Figure 2-1. Image Browser

2 9

4 6 8
3 5 7

1 Image Browser 4 Thumbnail/Full-Size Toggle 7 Image Size


2 Image Location 5 Open Image 8 Image Type
3 Navigation Buttons 6 Close Selected Image(s) 9 File Format

You can view 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.
7. Click the Thumbnail/Full-Size View Toggle button to view the first image in full size.

2-2 | ni.com
NI Vision Assistant Tutorial

8. Click Process Images in the upper right corner of the Vision Assistant window to begin
processing images. Vision Assistant loads the image into the Processing window, as shown
in Figure 2-2.

Tip You can double-click an image in the Image Browser to being processing it in
the Processing window.

Figure 2-2. Processing an Image

1 Reference Window 3 Image Size 5 Processing Window


2 Zoom Ratio 4 Script Window

Tip The Reference window displays the original version of the image as you
manipulate it in the Processing window.

© National Instruments | 2-3


Chapter 2 Introduction to Image Processing with Vision Assistant

9. Click Threshold in the Grayscale tab of the Processing Functions, or select Grayscale»
Threshold. The Threshold Setup window opens in the lower left corner of the Vision
Assistant window, as shown in Figure 2-3.
Figure 2-3. Thresholding an Image

1 Threshold Setup Window

The Threshold Setup window displays a histogram. A histogram counts the total number of
pixels at each grayscale value and displays the data in a graph. From the graph, you can see
if the image contains distinct regions of certain grayscale intensities. Thresholding isolates
these regions from the rest of the image. For example, if the image contains bright objects
on a dark background, you can isolate the objects and remove the background by selecting
Bright Objects from the Look For drop-down list and setting a minimum threshold value
close to 255 (white).
The Processing window displays a preview of the default threshold operation, Manual
Threshold, 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.
10. To threshold this image, set the Minimum value to 130 to select all of the objects.

Tip You may need to manipulate the Minimum value several times to find the one
that works best. Rather than enter a number in the Minimum field, you can select the
value using the pointer on the histogram. Adjust the pointer until all of the objects
you want to select are red.

2-4 | ni.com
NI Vision Assistant Tutorial

11. Click the Main tab.


12. Enter Threshold Image in the Step Name control.
13. 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.
Figure 2-4. Thresholded 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.
14. Select File»Save Script As, and name the script threshold.vascr.
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.vascr, 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 processing operation, click the How To tab or the Controls tab in
the Context Help window.

© National Instruments | 2-5


Chapter 2 Introduction to Image Processing with 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 Assistant, you can acquire images with various National Instruments Smart
Cameras, digital and analog frame grabbers, DCAM-compliant IEEE 1394 cameras, and Gigabit
Ethernet (GigE) Vision cameras. For information about driver software, refer to the NI Vision
Acquisition Software Release Notes.

Configure your image acquisition devices in National Instruments Measurement & Automation
Explorer (MAX). For information about configuring image acquisition devices in MAX, refer
to the NI Vision Acquisition Software Release Notes.

If you do not have an image acquisition device and the corresponding driver software, you can
use the Simulate Acquisition step to simulate a live acquisition by displaying a sequence of
images. You can interact with the simulation module as you would with a live acquisition. For
example, you can stop the sequence at any frame, capture the image, and send the image to the
Image Browser for processing.

2-6 | ni.com
NI Vision Assistant Tutorial

Opening the Acquisition Window


Complete the following steps to acquire images.
1. Launch Vision Assistant if it is not already open.
2. 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 Acquire Images in the toolbar.
Vision Assistant displays the Acquisition functions, as shown in Figure 2-5.
Figure 2-5. Acquiring Images in Vision Assistant

1 Make Image Active 2 Acquisition Functions

© National Instruments | 2-7


Chapter 2 Introduction to Image Processing with Vision Assistant

3. Click Acquire Image (1394, GigE, or USB) Setup. The Setup window displays the
cameras connected to the computer. For example, Figure 2-6 shows a Basler camera
connected to the computer.

Note The hardware devices listed in the Setup window vary according to the
devices installed.

Figure 2-6. Acquire Image Setup Window

4. Click Close to close the Acquire Image Setup window.

Snapping an Image
Complete the following steps to acquire and display a single image.
1. Select File»Acquire Image.
2. Click Acquire Image in the Acquisition function list.
3. Select the appropriate device and channel or port.
4. Click the Acquire Single Image button to acquire a single image with the image
acquisition device and display it.

2-8 | ni.com
NI Vision Assistant Tutorial

5. Click the Store Acquired Image in Browser button to send the image to the Image
Browser.

6. Click Close to exit the Setup window.


7. Process the image as you would any other image in Vision Assistant. Refer to the other
chapters of this tutorial for examples of processing images in Vision Assistant.

Grabbing an Image
Complete the following steps to acquire and display a continuous set of images.
1. Select File»Acquire Image.
2. Click Acquire Image in the Acquisition function list.
3. Select the appropriate device and channel or port.
4. Click the Acquire Continuous Images button to acquire and display images in continuous
mode at the maximum rate.

5. Click the Acquire Continuous Images button again to stop the acquisition and display the
last acquired image.

Tip You can acquire a region of interest (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.

6. Click the Store Acquired Image in Browser button to send the image to the Image
Browser.

7. Click Close to exit the Setup window.


8. Process the image as you would any other image in Vision Assistant. Refer to the other
chapters of this tutorial for examples of processing images in Vision Assistant.

© National Instruments | 2-9


Chapter 2 Introduction to Image Processing with Vision Assistant

Acquiring a Sequence of Images


Complete the following steps to acquire a sequence of images and send the images to the Image
Browser.
1. Click File»Acquire Image.
2. Click Acquire Image in the Acquisition function list.
3. Select the appropriate device and channel or port.
4. Click the Sequence Acquisition button.

5. Set the properties on the Sequence Acquisition Wizard.


• Number of Frames—Number of frames you want to acquire.
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 Setup window.
8. Process the image as you would any other image in Vision Assistant. Refer to the other
chapters of this tutorial for examples of processing images in Vision Assistant.

2-10 | ni.com
Using Particle Analysis to
3
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.

Note You must have Microsoft Excel installed to complete some steps in this
tutorial.

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 groupings 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.

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.

© National Instruments | 3-1


Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal

• 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


1. If you already have Vision Assistant running, click the Open Image button in the toolbar,
and proceed to step 4. Otherwise, proceed to step 2.

2. Select Start»All Programs»National Instruments Vision Assistant.


3. Click Open Image on the Welcome Screen.
4. Navigate to C:\Users\Public\Documents\National Instruments\
Vision Assistant\Examples\metal.
5. 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.

6. Click Open. Vision Assistant loads the image files, which represent microscopic views of
pieces of metal. The first image, Metal1.jpg, loads in 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.

3-2 | ni.com
NI Vision Assistant Tutorial

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 similar 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. If the Script window already contains a script, click the New Script button to open a new
script. Otherwise, proceed to step 2.

2. Click Line Profile in the Image tab of the Processing Functions palette, or select
Image»Line Profile to open the Setup window. Notice that the Line Tool is automatically
selected in the toolbar and is active.
3. Draw a short segment across a particle, as shown in Figure 3-1.

Tip ROIs are context sensitive, and you can easily adjust their location in the image
or the position of their center points. You can also adjust the position of the ROI in
the image by using the arrow keys on the keyboard.

Figure 3-1. Using a Line Profile to Examine Edges

1 Edges of Particles 3 Segment Drawn with Line Tool


2 Graph or Profile Showing Fluctuation in Pixel Values

© National Instruments | 3-3


Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal

In Figure 3-1, the areas labeled 1 represent the edges of the particles. Notice that the edges
of the particles have a slope. The more shallow the slope, 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.
4. Click Cancel. You do not need to add the Line Profile step to the script because it was for
investigational purposes only.

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. Click Filters in the Grayscale tab of the Processing Functions palette, or select
Grayscale Filters.
2. Enter Highlight Details in the Step Name control.
3. 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 represents a pixel and its relationship to its neighbors. For more
information about kernels, refer to Chapter 5, Image Processing, of the NI Vision Concepts
Manual.
4. Click OK to add this step to the script.

3-4 | ni.com
NI Vision Assistant Tutorial

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. Click Line Profile in the Image tab of the Processing Functions palette, or select
Image Line Profile.
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 Cancel.
Figure 3-2. Using a Line Profile to Examine Particle Edges

1 Segment Drawn with Line Tool

© National Instruments | 3-5


Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal

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 image from grayscale to binary.

Complete the following steps to select a range of brighter pixels for analysis.
1. Click Threshold in the Grayscale tab of the Processing Functions palette, or select
Grayscale»Threshold.
The Threshold Setup 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.
2. To threshold this image, set the Minimum value to 130.
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 enter a number in the Minimum field, you can select the value
using the pointer on the histogram. Adjust the pointer until all of the objects you want
to select are red.

3. Click the Main tab.


4. Enter Threshold Image in the Step Name control.
5. 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 binary 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.

3-6 | ni.com
NI Vision Assistant Tutorial

Figure 3-3. Separating Particles from the Background with Thresholding

Modifying Particles with Morphological Functions


Morphological functions affect the shape of particles on an individual basis. Morphological
operations prepare particles in the image for quantitative analysis such as finding the area,
perimeter, or orientation.

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. Click Adv. Morphology in the Binary tab of the Processing Functions palette, or
select Binary»Adv. Morphology.
2. Enter Fill Holes in the Step Name control.
3. Select Fill holes from the list.
4. Click OK to add this step to the script.
5. Click Adv. Morphology in the Binary tab of the Processing Functions palette, or
select Binary»Adv. Morphology.
6. Enter Remove Border Objects in the Step Name control.

© National Instruments | 3-7


Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal

7. Select Remove border objects to remove any objects that touch the border of the image.
Refer to Figure 3-4 to see what the image looks like after applying morphological functions
to the image.
8. Click OK to add this step to the script.
Figure 3-4. Modifying Particles with Morphological Functions

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. Click Particle Filter in the Binary tab of the Processing Functions palette, or select
Binary»Particle Filter.
2. Enter Filter Round Particles in the Step Name control.
3. 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.
4. 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.
5. Select the Keep option to keep circular particles and remove particles that do not fit in the
range.

3-8 | ni.com
NI Vision Assistant Tutorial

6. Click OK to add this step to the script. The image now contains only circular particles, as
shown in Figure 3-5.
Figure 3-5. Isolating Circular Particles

Analyzing Circular Particles


Now that you have isolated circular particles, complete the following steps to find the area
occupied by them.
1. Click Particle Analysis on 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.
2. Enter Particle Analysis in the Step Name control.
3. Enable the Show Labels checkbox to view the labels.

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
surrounded by a green rectangle in the Processing window.

4. To show only the area measurement, click Select Measurements.


5. Click the Deselect All Pixel Measurements button to deselect all of the measurements.
The real-world measurements are grayed out because the image is not calibrated.

6. Select the pixels control beside the Area measurement.

© National Instruments | 3-9


Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal

7. Click OK to close the Select Measurements dialog box.


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.

8. Click OK to record the particle analysis and add the step to the script.

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. Click Browse Images.

2. Double-click the third image, Metal3.jpg.

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 to process and then click
the Make Image Active button to move that image into the Processing window.

3. Click the Run Once button.

3-10 | ni.com
NI Vision Assistant Tutorial

Figure 3-6a shows the original image, Metal3.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. You need to adjust the Threshold
step to separate the particles.
Figure 3-6. Comparing the Original Image to the Processed Image

a. b.

1 Overlapping Circular Particles

4. Click OK to close the Particle Analysis Setup window.


5. Double-click the Threshold step in the script window to open the Threshold Setup window.
Figure 3-7 shows Metal3.jpg at the thresholding step of the script.
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.

© National Instruments | 3-11


Chapter 3 Using Particle Analysis to Analyze the Structure of a Metal

8. Click Run Once to rerun the script. Notice that only the circular particles now appear in
the final processed image.

9. Click OK to close the Particle Analysis Setup window.

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 can also perform batch processing with this script.
1. Select File»Save Script As.
2. Save the script as particle analysis.vascr.

Refer to the NI Vision Assistant Help for more information about the Vision Assistant batch
processing functionality.

Estimating Processing Time


Vision Assistant can estimate the time, in milliseconds, that NI Vision takes to process the active
image with the open script. The Performance Meter gives both an estimate of the total time
NI Vision takes to process the image and an estimate of the time each function within the script
requires. Complete the following steps to estimate how many milliseconds NI Vision uses to
process Metal3.jpg with particle analysis.vascr.
1. Select Tools»Performance Meter. The Performance Meter estimates the total time
NI Vision takes to run the script.
2. Click Details to view an itemized list of the time NI Vision takes 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 VI that implements the different
steps of the script.

Note You must have LabVIEW and the NI Vision Development Module 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.

Note If several versions of LabVIEW and NI Vision are installed on the computer,
the wizard searches the machine and displays a list of the available LabVIEW and
NI Vision versions you can use to create the VI.

3-12 | ni.com
NI Vision Assistant Tutorial

2. Select the version of LabVIEW in which you want to create a VI.


3. Click the Browse button and select the location to which you want to save the VI.

4. Enter a File name, and click OK.


5. Click Next.
6. 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.

Note If you have LabVIEW open, you cannot create a VI for a different version
of LabVIEW.

Creating a C Program
Vision Assistant features a wizard that creates C code that implements the different steps of the
script.

Note You must have the NI Vision Development Module installed to use the Vision
Assistant C Code Creation Wizard.

Complete the following steps to create a C program.


1. In Vision Assistant, select Tools»Create C Code.
2. Enter the name of the implementation file that will contain the image processing function
that implements the Vision Assistant steps.
3. 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.
4. Browse to the folder to which you want to save the generated files.

Tip If you have LabWindows/CVI installed, and you want to use it to compile and
test the C code, select the Add Files to LabWindows/CVI Project option.

5. Click OK to create the C program.

© National Instruments | 3-13


Using Gauging for Part
4
Inspection
This chapter describes gauging and provides step-by-step directions for prototyping a part
inspection application in Vision Assistant.

What Is Gauging?
Components such as connectors, switches, and relays are small and manufactured 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.

Tutorial
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 | 4-1


Chapter 4 Using Gauging for Part Inspection

Figure 4-1. Bracket Specifications

Side View

Bracket Distance
362 to 368 pixels

Edge 1
3

5
1 2

Bracket Angle
178 to 181 Degrees Width Center
Edge 2

Top View

Width Center is 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.

4-2 | ni.com
NI Vision Assistant Tutorial

Loading Images into Vision Assistant


1. If Vision Assistant is already running, click the Open Image button in the toolbar, and go
to step 4. Otherwise, go to step 2.

2. Select Start»All Programs»National Instruments Vision Assistant.


3. Click Open Image on the Welcome Screen.
4. Navigate to C:\Users\Public\Documents\National Instruments\Vision
Assistant\Examples\bracket.
5. 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.

6. Click Open to load the image files into Vision Assistant. The first image, Bracket1.jpg,
loads in the Processing window.

Finding Measurement Points Using Pattern Matching


Before you can compute measurements, you must locate features 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. If the Script window already contains a script, click New Script to open a new script.

2. Select Pattern Matching in the Machine Vision Processing Functions tab, or select
Machine Vision»Pattern Matching. The NI Vision Template Editor opens.

© National Instruments | 4-3


Chapter 4 Using Gauging for Part Inspection

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

4. Click Next.
5. Click Finish. After Vision Assistant learns the template, the Save Template as dialog box
opens.
6. Navigate to C:\Users\Public\Documents\National Instruments\
Vision Assistant\Examples\bracket.
7. Save the template as template.png. The Pattern Matching Setup window displays the
template image and its path.
8. Click the Specifications tab.
9. Set Number of Matches to Find to 1.
10. Clear the Rotated checkbox to set the search mode to shift 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, select the Rotated checkbox.
11. Click the Options tab.
12. Set the Minimum Score to 600 to ensure that Vision Assistant finds matches similar,
but not identical, to the template.
13. 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 and improves by reducing the
search area. 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.

4-4 | ni.com
NI Vision Assistant Tutorial

Figure 4-3. Selecting the First Search Area

When you draw the ROI, Vision Assistant automatically locates the template in the region
and displays the score and location of the match.
14. Click OK to save this step to the script.
15. Select Pattern Matching in the Machine Vision tab of the Inspection steps, or
select Machine Vision»Pattern Matching.
16. Click Load from File and open the template you just saved.
17. Select the Options tab.
18. Set Number of Matches to Find to 1.
19. Set the Minimum Score to 600 to ensure that Vision Assistant finds matches that are
similar, but not identical, to the template.
20. 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.
21. Click OK to add this step to the script.

© National Instruments | 4-5


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 from the Edge Detector drop-down listbox. The
Advanced Edge Tool is effective on images with poor contrast between the background and
objects.
3. Select First & Last Edge from the Look For drop-down listbox so that Vision Assistant
finds and labels only the first and last edges along the line you draw.
4. Set the Min Edge Strength to 40. The detection 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.

Tip To draw a straight line, press and hold the <Shift> key as you draw the line.

Figure 4-5. Finding the Edges for Bracket Distance

Look at the edge strength profile. The sharp transitions in the line profile indicate edges.
Notice that the number of edges found is displayed under the edge strength profile.
6. Click OK to add this step to the script.

4-6 | ni.com
NI Vision Assistant Tutorial

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.
2. Select Mid Point in the Geometric Feature listbox.

3. Click points 3 and 4 in the image to obtain the Width Center measurement, which specifies
the center of the bracket width.
When you select a point in the image, Vision Assistant places a check mark next to the
corresponding point in the Caliper Setup window.

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.

Tip Instead of selecting points from the image, you can select points by
double-clicking their entries in the Available Points listbox.

4. Click Measure to compute the center of the bracket width and add the Mid Point
measurement to the results table, as shown in Figure 4-6.
5. Click OK to add this step to the script.

© National Instruments | 4-7


Chapter 4 Using Gauging for Part Inspection

Figure 4-6. Using the Caliper Function to Find Width Center

6. Select Caliper in the Machine Vision tab, or select Machine Vision»Caliper again. The
center of the bracket width appears as point 5.
7. Select Distance in the Geometric Feature listbox.

8. Click points 1 and 2 in the image to find the Bracket Distance, which measures the length
between the manufactured holes in the bracket and determines if the bracket arch is the
appropriate height.

4-8 | ni.com
NI Vision Assistant Tutorial

9. Click Measure to compute the distance between the bracket holes. The distance
measurement is added to the results table, as shown in Figure 4-7.
Figure 4-7. Using the Caliper Function to Find Bracket Distance

10. Select Angle Defined by 3 Points in the Geometric Feature listbox. Click points 1, 5, and
2, in this order, to find the next 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.

11. Click Measure to compute the angle of the bracket arms and add the measurement to the
results table.

© National Instruments | 4-9


Chapter 4 Using Gauging for Part Inspection

Figure 4-8 shows the image with Bracket Distance and Bracket Angle selected on the image and
displayed in the results table.
Figure 4-8. Using the Caliper Tool to Collect Measurements

12. Click OK to add these caliper measurements to the script and close the caliper window.
13. Select File»Save Script As, and save the script as bracket.vascr.

Analyzing the Results


Batch processing involves running a script on a collection of images. You can use batch
processing to analyze multiple images and save the resulting analysis information in a
tab-delimited text file. Complete the following steps to run bracket.scr on all the images in
the Image Browser.
1. Select Tools»Batch Processing.
2. Select the Image Source Browser to process all images in the Image Browser.
3. Select Caliper 2 from the Script Steps list. Caliper 2 is the step that returns Bracket
Distance and Bracket Angle.
4. Select the Save Results Analysis Mode. This enables the Save Options control.
5. Click Setup. A dialog box opens.
6. Select One file for all results to log the results for every image to the same file.

4-10 | ni.com
NI Vision Assistant Tutorial

7. Click the Folder Path button. Navigate to the directory in which you want to save the
results file, and click Current Folder.

8. Enter bracket_results.txt in the File Prefix control. Because you are logging all the
results to one file, the File Prefix is the name of the individual results file. If you were
logging the results for each image to a separate file, File Prefix would be the prefix
associated with the index for each results file.
9. Click OK.
10. Click Run to run the script on all the images in the Image Browser and log the results.
11. Click OK to close the Batch Processing finished notification.
12. Navigate to the directory path specified in step 7, and open bracket_results.txt.
13. Compare the Bracket Distance and Bracket Angle measurements in the results file to the
values in Table 4-1.
Table 4-1 shows the acceptable ranges for the bracket measurements and the actual values
you might see for each bracket image. Notice that Bracket1, Bracket2, and Bracket3
are the only ones that meet the specifications. The bold values for the other brackets
indicate which measurements caused them to fail.

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 Distance Bracket Angle


(acceptable range: (acceptable range:
Bracket Number 362 to 368 pixels) 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

Refer to the NI Vision Assistant Help for more information about the Vision Assistant batch
processing functionality.

© National Instruments | 4-11


Using a Coordinate System
5
for Part Inspection
This chapter describes how to set up a coordinate system and provides step-by-step directions
for prototyping an inspection that checks for the presence of a part in Vision Assistant.

What Is a Coordinate System?


In a typical machine vision inspection, you limit your inspection and processing to a region of
interest rather than the entire image. To limit the inspection area, the parts of the object you are
interested in must always appear inside the region of interest you define.

If the object under inspection is always at the same location and orientation in the images you
need to process, defining a region of interest is simple. However, the object under inspection
often appears shifted or rotated within the images you need to process. When this occurs, the
region of interest needs to shift and rotate with the parts of the object you are interested in.
In order for the region of interest to move in relation to the object, you need to define a
coordinate system relative to a feature in the image.

A coordinate system is specified by its origin and the angle its x-axis makes with the horizontal
axis of the image. Assign a coordinate system based on how you expect the object to move in
the image. If the object is going to only translate in the horizontal or vertical directions, you need
only to select a feature whose location can represent the origin of the coordinate system. The
angle is 0 by default. If the object is going to translate and rotate, you need to select features that
can represent the location of the origin and angle of the coordinate system.

© National Instruments | 5-1


Chapter 5 Using a Coordinate System for Part Inspection

Tutorial
In this tutorial, you analyze images of dental floss holders to determine if the holders contain
toothpaste and a wire.

Loading Images into Vision Assistant


1. If Vision Assistant is already running, click the Open Image button in the toolbar, and go
to step 4. Otherwise, go to step 2.

2. Select Start»All Programs»National Instruments Vision Assistant.


3. Click Open Image on the Welcome Screen.
4. Navigate to C:\Users\Public\Documents\National
Instruments\Vision Assistant\Examples\dental floss.
5. 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.

6. Click Open to load the image files into Vision Assistant.

Defining a Feature on which to Base a Coordinate


System
Complete the following instructions to configure a Pattern Matching step that locates a dental
floss feature on which you can base a coordinate system. You will choose a feature, the base of
the dental floss holder, that is always in the field of view of the camera despite the different
locations that the dental floss holders may appear in from image to image.
1. Select Pattern Matching in the Machine Vision tab of the Processing Functions, or select
Machine Vision»Pattern Matching.
2. The Select a Template Region dialog box opens.

5-2 | ni.com
NI Vision Assistant Tutorial

3. Draw a rectangle around the base of the dental floss, as shown in Figure 5-1. This region
becomes the pattern matching template.
Figure 5-1. Creating a Template Pattern

4. Click Next.
5. Click Finish. The Save Temple as dialog box opens.
6. Navigate to C:\Users\Public\Documents\National Instruments\Vision
Assistant\Examples\dental floss.
7. Save the template as template.png. The Pattern Matching Setup window displays the
template image and its path.
8. Click the Main tab.
9. Enter Find Dental Floss Base in the Step Name control.
10. Click the Specifications tab.
11. Set the Range 1 control to -180,180.
12. Click OK to save this step to the script.

© National Instruments | 5-3


Chapter 5 Using a Coordinate System for Part Inspection

Defining a Coordinate System


Complete the following instructions to configure a Set Coordinate System step based on the
Pattern Matching step you configured.
1. Select Set Coordinate System in the Image tab of the Processing Functions, or
select Image»Set Coordinate System.
2. Enter Define Coordinate System in the Step Name control.
3. Select Horizontal, Vertical, and Angular Motion from the Mode control. Because the
dental floss holders appear shifted and rotated from one image to another, the changes in
the region of interest need to be accounted for. This mode adjusts the region of interest
positions along the horizontal and vertical axes, and adjusts for rotational changes.

Notice the Origin and X-Axis Angle lists. Match 1, the match location of the previous Find
Dental Floss Base step, is the default origin of the coordinate system because it is the only
location point created by previous steps in the script.
4. Click OK to save this step to the script.

Checking for Presence


Complete the following instructions to configure a Quantify step to check the dental floss
holders for the presence of toothpaste and a wire.
1. Select Quantify in the Grayscale tab of the Processing Functions, or select
Grayscale»Quantify.
2. Enter Measure Area Intensity in the Step Name control.
3. Enable the Reposition Region of Interest checkbox.
Enabling this control allows you to link the regions of interest specified in this step to a
previously defined coordinate system so that Vision Assistant can adjust the location and
orientation of the region of interest from image to image relative to the specified coordinate
system.
The Reference Coordinate System list shows all the previously defined coordinate
systems. Set Coordinate System is the default reference coordinate system because it is
the only Set Coordinate System step in the current script.

Notice that the Quantify step supports a variety of different tools that enable you to draw
different shaped regions of interest, such as a point, line, broken line, freehand line, rectangle,
oval, polygon, and freehand region. These tools are available in the Vision Assistant toolbar.
4. Click the Polygon Tool in the Vision Assistant toolbar.

5-4 | ni.com
NI Vision Assistant Tutorial

5. Draw three regions of interest that enclose the wire and the two sections of toothpaste in the
dental floss holder, as shown in Figure 5-2. Click and drag repeatedly to select a polygon
region. Double-click to complete the polygon.
Figure 5-2. Defining Regions in which to Check for Presence

Testing the Dental Floss Script


The script that you created is a custom vision algorithm. You can verify the regions of interest
reposition correctly by testing the algorithm on another image. To test this algorithm, complete
the following steps:
1. In the Reference window, click the Next Image button to view the next image, Dental
Floss 01.jp2.

2. Click the Make Image Active button to move that image into the Processing window. The
dental floss base should be found in the new image and the regions of interest for the
toothpaste and wire should reposition correctly based on the coordinate system.

3. Repeat steps 1 and 2 to test the script on the other images.


4. Click OK to add the Quantify step to the script.

© National Instruments | 5-5


Chapter 5 Using a Coordinate System for Part Inspection

Verifying your algorithm on new images is an important step in creating a robust algorithm
because it helps you determine if your regions of interest are positioned correctly and helps you
determine acceptable values for the results in the Quantify step.

You may need to adjust some parameters for the algorithm to work properly on other dental floss
images. For example, if the base of the dental floss holder is not found in an image, the region
of interest will not reposition correctly. If that happens, open the Find Dental Floss Base
step and adjust the minimum score and, if necessary, adjust the search area.

To determine acceptable values, you can compare the Mean Value measurements in the
Quantify step results. The Mean Value displays the mean value of the pixel intensity in the
regions of interest you drew in the Quantify step.

Table 5-1 shows the acceptable values for the dental floss measurements and the actual values
you might see for each dental floss image. For Mean Value 1 and Mean Value 2, which are the
mean values for the toothpaste regions of interest, an acceptable value is 100 or greater. Mean
values less than 100 signify that the toothpaste is missing from the dental floss holder. Notice
that Dental Floss 2, Dental Floss 4, and Dental Floss 8 are missing toothpaste.

For Mean Value 3, which is the mean value for the wire region of interest, an acceptable value
is greater than 20, but less than 40. A mean value below 20 signifies that the wire is missing from
the dental floss holder. Notice that Dental Floss 6 and Dental Floss 8 are missing wires. A mean
value above 40 signifies a frayed wire. Dental Floss 7 has a frayed wire.

Note The results may vary slightly based on the position of the regions of interest
you drew for the Quantify step.

Table 5-1. Dental Floss Measurement Results

Mean Value 2
Mean Value 1 (Right Mean Value 3
Bracket Number (Left Toothpaste) Toothpaste) (Wire)

Acceptable Values Greater than 100 Greater than 100 Between 20-40

Dental Floss 0 153.87199 127.29397 29.25323

Dental Floss 1 168.29030 129.75693 29.48656

Dental Floss 2 30.87846 30.95160 28.50083

Dental Floss 3 151.90704 140.33263 29.88302

Dental Floss 4 157.62241 38.14659 27.56245

Dental Floss 5 147.63632 137.76910 28.95566

Dental Floss 6 110.40456 124.61018 3.40535

5-6 | ni.com
NI Vision Assistant Tutorial

Table 5-1. Dental Floss Measurement Results (Continued)

Mean Value 2
Mean Value 1 (Right Mean Value 3
Bracket Number (Left Toothpaste) Toothpaste) (Wire)

Dental Floss 7 182.45360 178.04030 60.25054

Dental Floss 8 32.93908 165.94063 3.39985

Dental Floss 9 151.82718 136.74701 30.63069

Saving the Dental Floss Script


Now that you have written an 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 As.
2. Save the script as Dental Floss.vascr.

Analyzing the Results


Batch processing involves running a script on a collection of images. You can use batch
processing to analyze multiple images and save the resulting analysis information in a
tab-delimited text file. Complete the following steps to run Dental Floss.scr on all the
images in the Image Browser.
1. Select Tools»Batch Processing.
2. Select the Image Source Browser to process all images in the Image Browser.
3. Select Measure Area Intensity from the Script Steps list. Measure Area Intensity is the
step that returns information about the dental floss holders.
4. Select the Save Results Analysis Mode. This enables the Save Options control.
5. Click Setup. A dialog box opens.
6. Select One file for all results to log the results for every image to the same file.
7. Click the Folder Path button. Navigate to the directory in which you want to save the
results file, and click Current Folder.

8. Enter dental_floss_results.txt in the File Prefix control. Because you are


logging all the results to one file, the File Prefix is the name of the results file. If you were
logging the results for each image to a separate file, File Prefix would be the prefix
associated with each results file.
9. Click OK.
10. Click Run to run the script on all the images in the Image Browser and log the results.

© National Instruments | 5-7


Chapter 5 Using a Coordinate System for Part Inspection

11. Click OK to close the Batch Processing finished notification.


12. Navigate to the directory path specified in step 7, and open
dental_floss_results.txt.
13. Compare the Mean Value measurements in the results file to the values in Table 5-1.

Refer to the NI Vision Assistant Help for more information about the Vision Assistant batch
processing functionality.

5-8 | ni.com
NI Services
A
NI provides global services and support as part of our commitment to your success. Take
advantage of product services in addition to training and certification programs that meet your
needs during each phase of the application life cycle; from planning and development through
deployment and ongoing maintenance.

To get started, register your product at ni.com/myproducts.

As a registered NI product user, you are entitled to the following benefits:


• Access to applicable product services.
• Easier product management with an online account.
• Receive critical part notifications, software updates, and service expirations.

Log in to your MyNI user profile to get personalized access to your services.

Services and Resources


• Maintenance and Hardware Services—NI helps you identify your systems’ accuracy and
reliability requirements and provides warranty, sparing, and calibration services to help you
maintain accuracy and minimize downtime over the life of your system. Visit ni.com/
services for more information.
– Warranty and Repair—All NI hardware features a one-year standard warranty that
is extendable up to five years. NI offers repair services performed in a timely manner
by highly trained factory technicians using only original parts at an NI service center.
– Calibration—Through regular calibration, you can quantify and improve the
measurement performance of an instrument. NI provides state-of-the-art calibration
services. If your product supports calibration, you can obtain the calibration certificate
for your product at ni.com/calibration.
• System Integration—If 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.

© National Instruments | A-1


Appendix A NI Services

• Training and Certification—The NI training and certification program is the most


effective way to increase application development proficiency and productivity. Visit
ni.com/training for more information.
– The Skills Guide assists you in identifying the proficiency requirements of your
current application and gives you options for obtaining those skills consistent with
your time and budget constraints and personal learning preferences. Visit ni.com/
skills-guide to see these custom paths.
– NI offers courses in several languages and formats including instructor-led classes at
facilities worldwide, courses on-site at your facility, and online courses to serve your
individual needs.
• Technical Support—Support at ni.com/support includes the following resources:
– Self-Help Technical Resources—Visit ni.com/support 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. Registered users also receive access to the NI Discussion Forums
at ni.com/forums. NI Applications Engineers make sure every question submitted
online receives an answer.
– Software Support Service Membership—The Standard Service Program (SSP) is a
renewable one-year subscription included with almost every NI software product,
including NI Developer Suite. This program entitles members to direct access to
NI Applications Engineers through phone and email for one-to-one technical support,
as well as exclusive access to online training modules at ni.com/
self-paced-training. NI also offers flexible extended contract options that
guarantee your SSP benefits are available without interruption for as long as you need
them. Visit ni.com/ssp for more information.
• Declaration of Conformity (DoC)—A DoC is our claim of compliance with the Council
of the European Communities using the manufacturer’s declaration of conformity. This
system affords the user protection for electromagnetic compatibility (EMC) and product
safety. You can obtain the DoC for your product by visiting ni.com/certification.

For information about other technical support options in your area, visit ni.com/services,
or contact your local office at ni.com/contact.

You also can visit the Worldwide Offices section of ni.com/niglobal to access the branch
office websites, which provide up-to-date contact information, support phone numbers, email
addresses, and current events.

A-2 | ni.com
Glossary
A
area A rectangular portion of an acquisition window or frame that is
controlled and defined by software.

B
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 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.

chroma The color information in a video signal.

contrast A constant multiplication factor applied to the luma and chroma


components of a color pixel in the color decoding process.

coordinate system A reference location (origin) and angle in an image that regions of
interest can relate to when positional and angular adjustments of the
region of interest are necessary. A coordinate system is depicted by
two lines representing the orientation and direction of its two axes.

D
definition The number of values a pixel can take on, which is the number of
colors or shades that you can see in the image.

digital image An image f (x, y) that has been converted into a discrete number of
pixels. Both spatial coordinates and brightness are specified.

driver Software that controls a specific hardware device, such as an


NI Vision or DAQ device.

© National Instruments | G-1


Glossary

E
edge Defined by a sharp change (transition) in the pixel intensities in an
image or along an array of pixels.

edge detection Any of several techniques to identify the edges of objects in an


image.

F
function A set of software instructions executed by a single line of code that
may have input and/or output parameters and returns a value when
executed.

G
gauging Measurement of an object or distances between objects.

grayscale image An image with monochrome information.

H
histogram Indicates the quantitative distribution of the pixels of an image per
gray-level value.

I
image 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.

Image Browser An image that contains thumbnails of images to analyze or process


in a vision application.

image file A file containing pixel data and additional information about the
image.

image processing Encompasses various processes and analysis functions that you can
apply to an image.

image source Original input image.

G-2 | ni.com
NI Vision Assistant Tutorial

imaging Any process of acquiring and displaying images and analyzing


image data.

inspection The process by which parts are tested for simple defects such as
missing parts or cracks on part surfaces.

intensity The sum of the Red, Green, and Blue primary colors divided by
three: (Red + Green + Blue)/3.

K
kernel Structure that represents a pixel and its relationship to its neighbors.
The relationship is specified by weighted coefficients of each
neighbor.

L
LabVIEW Laboratory Virtual Instrument Engineering Workbench—Program
development environment based on the G programming language.
LabVIEW is used commonly for test and measurement
applications.

line profile Represents the gray-level distribution along a line of pixels in an


image.

luma 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.

luminance See luma.

M
machine vision An automated application that performs a set of visual inspection
tasks.

N
neighbor 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.

© National Instruments | G-3


Glossary

NI-IMAQ The driver software for National Instruments image acquisition


devices.

NI-IMAQdx The National Instruments driver software for IEEE 1394 and
GigE Vision cameras.

P
palette The gradation of colors used to display an image on screen, usually
defined by a color lookup table.

particle A connected region or grouping of pixels in an image in which all


pixels have the same intensity level.

particle analysis A series of processing operations and analysis functions that


produce some information about the particles in an image.

pattern matching The technique used to locate quickly a grayscale template within a
grayscale image.

picture element An element of a digital image. Also called pixel.

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).

PNG Portable Network Graphic—Image file format for storing 8-bit,


16-bit, and color images with lossless compression (extension
PNG).

Q
quantitative analysis Obtaining various measurements of objects in an image.

R
resolution The number of rows and columns of pixels. An image composed of
m rows and n columns has a resolution of m × n.

G-4 | ni.com
NI Vision Assistant Tutorial

ROI Region of interest—(1) An area of the image that is graphically


selected from a window displaying the image. This area can be used
to focus further processing; (2) A hardware-programmable
rectangular portion of the acquisition window.

rotation-invariant A pattern matching technique in which the reference pattern can be


matching located at any orientation in the test image as well as rotated at any
degree.

S
shift-invariant A pattern matching technique in which the reference pattern can be
matching located anywhere in the test image but cannot be rotated or scaled.

T
template 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.

threshold Separates objects from the background by assigning all pixels with
intensities within a specified range to the object and 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.

Tools palette Collection of tools that enable you to select regions of interest,
zoom in and out, and change the image palette.

V
value The grayscale intensity of a color pixel computed as the average of
the maximum and minimum red, green, and blue values of that
pixel.

VI 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.

© National Instruments | G-5


Index
A E
acquiring images edge detector, 4-5
grab (continuous image), 2-9 edge strength profile, 4-6
sequence, 2-9 edges, finding in image, 4-5
snap (single image), 2-8 environment, Vision Assistant, 1-1
acquisition types examples (NI resources), 1-3
grab, 2-5 exiting, Vision Assistant, 1-1
sequence, 2-6
snap, 2-5 F
Acquisition window, opening, 2-6 features, 1-2
advanced edge tool, 4-5 fill holes, 3-6
analyzing particles, 3-8 filtering images, 3-4
finding edges, 4-5
B full-size view (Image Browser), 2-2
batch processing, 1-2, 3-11, 4-9, 5-7
Browser. See Image Browser G
builder file, 1-2 gauging
analyzing results, 4-9
C bracket specifications (figure), 4-2
C code creation, 1-2, 3-12 definition, 4-1
caliper, 4-6, 4-9 finding edges, 4-5
Choose Measurements button, 3-8 finding measurement points using
circular particles pattern matching, 4-3
analyzing, 3-8 introduction, 4-1
isolating, 3-7 loading images, 4-2
Context Help window, 1-3 making measurements, 4-6
continuous acquisition (grabbing images), 2-9 overview, 4-1
coordinate system getting help in Vision Assistant, 1-3
checking for presence, 5-4 getting started, Vision Assistant, 2-1
defining a coordinate system, 5-3 grab, 2-5
defining a feature, 5-2 grabbing images (continuous acquisition), 2-9
definition, 5-1
overview, 5-1 H
creating a LabVIEW VI, 1-2, 3-11 help
creating C code, 1-2, 3-12 Context Help window, 1-3
National Instruments Web site, 1-3
D tooltips, 1-3
documentation Heywood Circularity Factor particle filter,
related documentation, vii 3-7
histogram, 2-4, 3-5
in Threshold Setup window, 2-4

© National Instruments | I-1


Index

I P
image acquisition, 2-5 part inspection, 4-1
See also acquiring images particle, 3-1
image acquisition device, 1-1, 1-3, 2-6, 2-8 particle analysis
Image Browser analyzing circular particles, 3-8
accessing from the toolbar, 3-9 definition, 3-1
definition, 1-2 estimating processing time, 3-11
full-size view, 2-2 examining image, 3-2
important elements (figure), 2-1 filtering, 3-4
thumbnail view, 2-2 introduction, 3-1
image processing, thresholding images, 2-4 isolating circular particles, 3-7
image segmentation modifying particles with morphological
grayscale threshold, 2-3, 3-5 functions, 3-6
images, loading for gauging, 4-2 morphology, 3-6
installing, Vision Assistant, 1-1 opening images, 3-2
isolating circular particles, 3-7 overview, 3-1
particle filter, 3-7
L preparing images for processing, 3-2
LabVIEW, 3-8 saving the script, 3-11
VI creation, 1-2, 3-11 separating particles from background,
LabWindows/CVI, 3-8 3-5
C code creation, 1-2, 3-12 testing the script, 3-9
launching Vision Assistant, 1-1 thresholding, 3-5
line profile, 3-2 particle filter, 3-7
line tool, 3-2 particles, separating from background with
loading images, 2-1, 3-2, 4-2, 5-1 thresholding, 3-5
pattern matching for finding measurement
points, 4-3
M Performance Meter, 1-2, 3-11
magnifying an image, 4-7 Preview Image window, 3-2, 4-3
Measurement & Automation Explorer Processing Functions window, 1-2
(MAX), 2-6 Processing window, 1-2
measurements for gauging. See gauging
morphology, 3-6
R
Reference window
N definition, 1-2
National Instruments purpose, 2-3
Web site, 1-3 using to browse images, 3-9
related documentation, vii
O remove border objects, 3-6
opening images, 2-1, 3-2, 4-2 Run Script button, 2-5, 3-9, 3-10

S
script file, 1-1

I-2 | ni.com
NI Vision Assistant Tutorial

Script window, 1-2 U


scripting using the caliper function, 4-6
description, 1-1
modifying scripts, 3-10
opening scripts, 2-5
V
Run Script button, 2-5, 3-9, 3-10 VI creation, 1-2, 3-11
saving scripts, 2-5, 3-11 Vision Assistant
Script window, 1-2, 2-5 acquiring images, 2-5
testing scripts, 3-9 environment, 1-1
scripts, 1-3 exiting, 1-1
gauging script, saving, 4-9 features, 1-2
particle analysis script getting help, 1-3
recording, 3-1 getting started, 2-1
saving, 3-11 launching, 1-1
testing, 3-9 opening images, 2-1
thresholding script, 2-5 particle analysis, 3-8
Select All Files option, 3-2, 4-3 scripts, 1-3
Send Data to Excel button, 3-9 Visual Basic, 3-8
separating particles from background, 3-5
sequence, 2-6, 2-9 W
set coordinate system step, 5-3 Web support from National Instruments
Setup window, 1-2 getting help for NI Vision, 1-3
Show Labels option, 3-8 windows
simulation module, 2-6 Context Help, 1-3
snap, 2-5 Embedded Help, 1-2
snapping one image (single acquisition), 2-8 Processing, 1-2
Solution Wizard, 1-2 Processing Functions, 1-2
Reference, 1-2, 2-3, 3-9
T Script, 1-2, 2-5
taking measurements, 4-6 Setup, 1-2
testing scripts, 3-9, 5-5
Threshold Setup window, 2-4 Z
thresholding Zoom In tool, 4-7
definition, 2-1
manual threshold, 2-3, 3-5
modifying threshold parameters, 3-9
procedure, 2-3
separating particles from background,
3-5
thumbnail view (Image Browser), 2-2
tutorials
coordinate system, 5-1
gauging, 4-1
particle analysis, 3-1

© National Instruments | I-3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy