Building a Basic Application with DT Vision Foundry

Similar documents
SMART Recorder. Record. Pause. Stop

XnView 1.9. a ZOOMERS guide. Introduction...2 Browser Mode... 5 Image View Mode...15 Printing Image Editing...28 Configuration...

The Basics of PowerPoint

INFORMATION TECHNOLOGY

MetaMorph Standard Operation Protocol Basic Application

1. Open PowerPoint and you will see the introductory screen that contains different themes and templates. From the selection displayed, choose Slice.

Setup Examples. RTPView Project Program

XnView Image Viewer. a ZOOMERS guide

Microsoft PowerPoint The Microsoft PowerPoint 2000 Screen. Leander ISD Technology Services CMB Title.

PowerPoint Basics (Office 2000 PC Version)

HYPERSTUDIO TOOLS. THE GRAPHIC TOOL Use this tool to select graphics to edit. SPRAY PAINT CAN Scatter lots of tiny dots with this tool.

Introduction to MS Word XP 2002: An Overview

INTRODUCTION TO COMPUTER CONCEPTS CSIT 100 LAB: MICROSOFT POWERPOINT (Part 2)

v Annotation Tools GMS 10.4 Tutorial Use scale bars, North arrows, floating images, text boxes, lines, arrows, circles/ovals, and rectangles.

Thermacam Reporter 2000 Professional Template Building Tutorial

Lesson 1 New Presentation

2. Write Your Test Questions & Create Interactions Page 12

Image Rights Options: Using Bands, Brands and Watermarks

Drawing Tools. Drawing a Rectangle

Introduction to Microsoft PowerPoint 2010

HOW TO. In this section, you will find. miscellaneous handouts that explain. HOW TO do various things.

Click the buttons in the interactive below to become familiar with the drawing tool's commands.

ANALYSIS SOFTWARE. CAmReport

Recipes4Success. Draw and Animate a Rocket Ship. Frames 5 - Drawing Tools

Insight: Measurement Tool. User Guide

Introduction to Microsoft Word

Adobe Illustrator. Quick Start Guide

CLEAR TOOL... 7 BASIC NAVIGATION... 7 PAGE SORTER... 7

Integrating Educational Technology into Teaching (4 th Edition) Microsoft PowerPoint Tutorial for Chapter 9 TIE-into Practice Exercises

Basic Electrodes. CimatronE 8.5 Tutorial

Word 2003: Flowcharts Learning guide

Make Your Pictures Come to Life with Photo Story 3

ADOBE TRAINING CS6 PHOTOSHOP BASICS: EDITING PHOTOS & WORKING WITH TEXT - 1

How to...create a Video VBOX Gauge in Inkscape. So you want to create your own gauge? How about a transparent background for those text elements?

Image Rights Options: Using Banding, Branding, and

Microsoft PowerPoint 2013 Beginning

Quick Guide for Photoshop CC Basics April 2016 Training:

Objectives This tutorial demonstrates how to use feature objects points, arcs and polygons to make grid independent conceptual models.

PowerPoint 2003 Intermediate PowerPoint: Tips and Tricks

SNOWFLAKES PHOTO BORDER - PHOTOSHOP CS6 / CC

Create engaging demonstrations, simulations and evaluations with Adobe Captivate. Creating from a PowerPoint. Importing a presentation

Vision Pointer Tools

Candy is Dandy Project (Project #12)

DT Vision Foundry. Now With FDA 21 CFR Part 11 Support, New Color Split Tool, and Many Enhancements!

Using Inspiration 7 I. How Inspiration Looks SYMBOL PALETTE

Copyright Notice. Trademarks

Tutorials. Lesson 3 Work with Text

Vizit Pro User Manual

Unit 21 - Creating a Navigation Bar in Macromedia Fireworks

PowerPoint 2016 Building a Presentation

Flash Image Enhancer Manual DMXzone.com Flash Image Enhancer Manual

Word 2007: Flowcharts Learning guide

GO! Finder V1.4. User Manual

CS Multimedia and Communications REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB! Lab 02: Introduction to Photoshop Part 1

Ink2Go Help. Toolbar functions

Expression Design Lab Exercises

Paint Tutorial (Project #14a)

Using PowerPoint to Create an Interactive Multimedia Portfolio Ben Johnson

A+ Suite Software. User Manual

Flip-Q. Version 2.4. Overview

Scan November 30, 2011

SBCUSD IT Training Program. PowerPoint Introduction

JASCO CANVAS PROGRAM OPERATION MANUAL

PowerPoint X. 1. The Project Gallery window with the PowerPoint presentation icon already selected. 2. Click on OK.

Generating Vectors Overview

CENTAUR S REAL-TIME GRAPHIC INTERFACE V4.0 OPERATOR S MANUAL

Step 2: After opening the file, you should see following window. Select all the code, right click and then copy the code

Center for Faculty Development and Support Creating Powerful and Accessible Presentation

Resizing and Renaming Images For Submitting By Jerry Koons

CPM-200 User Guide For Lighthouse for MAX

Creating a Text Frame. Create a Table and Type Text. Pointer Tool Text Tool Table Tool Word Art Tool

The American University in Cairo. Academic Computing Services. Word prepared by. Soumaia Ahmed Al Ayyat

GIMP TEXT EFFECTS. Text Effects: Outline Completed Project

Secure MaxMarkup

Create a unit using United Streaming and PowerPoint. Materials: Microsoft PowerPoint, Internet access, United Streaming account

Think of layers as a stack of transparencies. Layers can be changed independently of other layers by clicking on its name in the layers palette.

Lesson 2. Using the Macro Recorder

Session 7 MS Word. Graphics. Inserting Clipart, and Graphics Modify graphics Position graphics

How To Capture Screen Shots

Exploring Microsoft Office Word 2007

Part 1: Basics. Page Sorter:

Adding Text and Images. IMCOM Enterprise Web CMS Tutorial 1 Version 2

WORD XP/2002 USER GUIDE. Task- Formatting a Document in Word 2002

Beginning Tutorial the Lego

Creating Accessible Documents in Adobe Acrobat Pro 9

Table of Contents. Contents

Q u i c k S ta r t G u i d e

Windows Movie Maker Live

FrontPage 2000 Tutorial -- Advanced

Charting Progress with a Spreadsheet

Acrobat X Professional

USING DATA DRIVEN PAGES

Bombardier Business Aircraft Customer Services. Technical Publications. SmartPubs Viewer 3.0 User Guide. Updated January 2013 [2013]

TABLE OF CONTENTS TABLE OF CONTENTS... 1 INTRODUCTION... 2 USING WORD S MENUS... 3 USING WORD S TOOLBARS... 5 TASK PANE... 9

Edupen Pro User Manual

Microsoft PowerPoint Tutorial

POWERPOINT Add the Pizzazz to Your Presentation

PowerPoint Tips and Tricks

PowerPoint Launching PowerPointX

button in the lower-left corner of the panel if you have further questions throughout this tutorial.

Transcription:

Goal Building a Basic Application with DT Vision Foundry This tutorial demonstrates how to develop an inspection application with DT Vision Foundry machine vision software from Data Translation. You will write a program (script) using the easy-to-use point & click/drag-and-drop interface of the Point & Click Script tool. No programming experience is required. Requirements DT Vision Foundry software, Ver. 3.0 or higher Computer with Windows 2000 (with Service Pack 1) or Windows XP Camera, lights, cable, and frame grabber board If you don t want to set up a camera, you can use previously captured images instead. Note that this tutorial uses previously captured images, all of which are included in the DT Vision Foundry package. Creating the Application This application inspects 3.5 disks moving down an assembly line to ensure that both the write-protect tab and the shutter are closed. 1

Note: If you don t want to finish the tutorial in one sitting, you can save your script at any time by clicking File Save Script or File Save As Script in the Point & Click Script tool. Browse to the directory in which you want to store the script, then enter a name with the extension.pcs. When you are ready to continue, click File Open Script in the Point & Click Script tool, browse to the script you saved, then click Open. Open the Feature Image Use the File Manager tool to open the feature image. The feature image contains a perfect representation of the part you want to search for in the inspection process. 1. If it is not already open, open the Point & Click Script tool by either selecting Point & Click Script from the Tools menu or clicking the icon in the Miscellaneous toolbar. 2. Open the File Manager tool by either selecting File Manager from the Tools menu or clicking the icon in the Input-Output toolbar. 3. Select File File Open. 4. In the Open dialog box, browse to the feature image reffloppy.bmp, then click Open. Note that the image reffloppy.bmp is located in C:\Program Files\Data Translation\DT Vision Foundry\Scripts\Statistics\Floppy, by default. 5. Click Add to Script (Open) to add this operation to your point & click script. The File Manager tool appears as follows. 2

The Point & Click Script tool appears as follows. 6. Close the File Manager tool. 3

Create the Feature ROI The feature ROI (region of interest) is an area within the feature image that contains the part you are searching for. 1. In the main DT Vision Foundry application, ensure that the Rectangle button is selected in the ROI type toolbar, then select the Draw button in the ROI mode toolbar. 2. Using the mouse, draw a rectangle ROI around the high-density disk hole in the lower-left corner of the image. This is the feature ROI. The feature ROI is the part that you want to search for in each of the disks coming down the assembly line. Feature ROI 4

Create a Training Image The training image consists of the pixels within the feature ROI. 1. Open the Search tool by either selecting Search from the Tools menu or clicking the icon in the Machine Vision toolbar. 2. Click Train to open the Search Training dialog box. 3. Activate the feature image reffloppy:0 by clicking in the viewport with the left mouse button, then click Feature - Input Image in the Search Training dialog box to specify reffloppy:0 as the feature image. 4. From the Feature - ROI drop-down list, select the feature ROI. The feature ROI is called Rect.n, where n is the number assigned to the ROI by DT Vision Foundry. If more than one rectangle ROI is listed and you re not sure which is the feature ROI, select one of the rectangle ROIs. The corresponding ROI is activated (red) in the feature image. The training image is displayed in the training image window, as follows. 5

Training image window Note that a freehand ROI is drawn around the high-density disk hole in the training image. The Search tool automatically creates a freehand ROI around one of the objects in the training image. If this object represents the feature that you want to search for, you can use the feature to perform a faster search. You will not use this feature for this tutorial. 5. Click OK to close the Search Training dialog box. 6

Open an Inspection Image and Create the Inspection ROI The inspection images are the images you are testing. The inspection ROI is an area within an inspection image that contains the feature ROI that you are searching for. Note: You will typically use the Picture tool or AVI Player tool to capture your inspection images in real-time. 1. Leaving the Search tool open, open the AVI Player tool by either selecting AVI Player from the Tools menu or clicking the icon in the Input-Output toolbar. 2. Click Browse. 3. In the Load AVI File dialog box, browse to floppy.avi, the file that contains the inspection images, then click Open. Note that the file floppy.avi is located in C:\Program Files\Data Translation\DT Vision Foundry\Scripts\Statistics\Floppy, by default. 4. In the AVI Player tool, enter floppy in the Image Name text box and check Loop at end of sequence. The AVI Player tool appears as follows. 7

5. Click Import. The first frame of the file is displayed in a new viewport. 6. Click Add to Script to record the action in the point & click script. 8

7. Close the AVI Player tool. 8. In the image floppy, use the mouse to draw a rectangle ROI around the high-density disk hole. This is the inspection ROI. Make sure that the inspection ROI is large enough so that wherever the disk appears in the inspection image, the feature ROI will be within the inspection ROI. To resize or move the ROI, if necessary, select the Off button in the ROI mode toolbar, then hold down the <Shift> key while using the left mouse button to drag the sides of the ROI or drag the ROI to a new location. Inspection ROI 9

Perform the Search Operation Use the Search tool to find the feature ROI within the inspection ROI. 1. Activate the inspection image floppy by clicking in the viewport with the left mouse button, then click Image Configuration - Inspection in the Search tool dialog box to specify floppy:0 as the inspection image. 2. From the ROI Configuration - Inspection drop-down list, select the inspection ROI. The inspection ROI is called Rect.n, where n is the number assigned to the ROI by DT Vision Foundry. If more than one rectangle ROI is listed and you re not sure which is the inspection ROI, select one of the rectangle ROIs. The corresponding ROI is activated (red) in the inspection image. 3. Select Search Settings from the Settings menu to open the Search Settings dialog box. 4. From the ROI Generation drop-down list, select Point ROI - Center of feature. This indicates that you want the Search tool to place a point ROI in the center of the found feature. This ROI is the reference point you will use when searching for the shutter and write-protect tab. Leave the remaining settings at their default values. 5. Click Apply, then click OK to close the Search Settings dialog box. 6. Click Search to perform the search. The search results are displayed in the Match Results list. 10

The point ROI SRCH_M0 appears in the inspection image floppy, as follows. 11

Reference point (SRCH_M0) Create a Catalog The catalog contains a training image and other settings, such as the search type and the score threshold (the lowest match score that you want the tool to consider a valid match). 1. In the Search tool dialog box, select File Save Catalog to open a Save As dialog box. 2. Enter My_catalog.src in the File name text box, then click Save. Note that a catalog named fp_srch.src is provided by default. 12

3. Click Add to Script to add the Search tool script item to the point & click script. The Point & Click Script tool appears as follows. 4. Close the Search tool. Separate the Opening of the Feature Image from the Rest of the Point & Click Script Since you only have to open the feature image once, you can use a While loop script item to separate the opening of the feature image from the rest of the script. 1. In the Point & Click Script tool, click the While loop icon. 2. Since you don t want to leave the loop, set the While loop to always be true by entering the statement WHILE PC_ScriptFailed = PC_ScriptFailed, as follows. 3. Click OK to close the While dialog box. 13

4. Use the right mouse button to drag the AVI Tool script item under the While statement, then use the left mouse button to move the Search Tool script item under the AVI Tool script item. This creates a branch in the point & click script. Search for the Write-Protect Tab Since the write-protect tab will not always be in the same location in the inspection image, you can use the ROI Manager tool to establish a relationship between the write-protect tab and the reference point SRCH_M0. 1. In the inspection image floppy, draw a rectangle ROI around the write-protect tab. Make sure that none of the white background is included in the ROI. To resize or move the ROI, if necessary, select the Off button in the ROI mode toolbar, then hold down the <Shift> key while using the left mouse button to drag the sides of the ROI or drag the ROI to a new location. 14

Write-protect tab ROI 2. Open the ROI Manager tool by either selecting ROI Manager from the Tools menu or clicking the icon in the Gauging toolbar. 3. Click the Position tab. 4. From the ROI Name drop-down list, select the write-protect tab ROI. The write-protect tab ROI is called Rect.n, where n is the number assigned to the ROI by DT Vision Foundry. If more than one rectangle ROI is listed and you re not sure which is the inspection ROI, select one of the rectangle ROIs. The corresponding ROI is activated (red) in the inspection image. 5. From the Reference Point X Coordinate drop-down list, select SRCH_M0_X. This is the variable that contains the x-coordinate of the reference point. The x-coordinate value is displayed in the text box. 15

6. From the Reference Point Y Coordinate drop-down list, select SRCH_M0_Y. This is the variable that contains the y-coordinate of the reference point. The y-coordinate value is displayed in the text box. The ROI Manager tool appears as follows. 7. Click Initialize to establish the relationship between the write-protect tab ROI and the reference point (SRCH_M0). 8. Click Add to Script. The Point & Click Script should appear as follows. If necessary, use the left mouse button to drag the Position script item under the Search Tool script item. 16

9. Close the ROI Manager tool. If you run the script now, the write-protect tab ROI will be drawn around the write-protect tab in each of the inspection images. Determine Whether the Write-Protect Tab is Open If the write-protect tab is open, you will see white in the background; if the write-protect tab is closed, you won t see white in the background. You can use the H_Max variable in the Histogram tool to calculate the maximum grayscale level in the write-protect tab ROI. If H_Max >= 200, the write-protect tab is open. Note that using 200 instead of 255 (pure white) ensures that if the lighting conditions are imperfect, an open write-protect tab will still be detected. 1. Ensure that the write-protect tab ROI is activated in the inspection image floppy. To activate the ROI, either click on it with the right mouse button or click in the inspection image and then press the <Tab> key until the ROI is activated (red). 2. Open the Histogram tool by either selecting Histogram from the Tools menu or clicking the icon in the Image Analysis toolbar. 3. Select Point & Click Script Options. 4. In the Histogram Script Options dialog box, select the Calculate Histogram Stats checkbox, then click OK. 17

5. Click Add Histogram. 6. Click Add to Script. The Point & Click Script tool should appear as follows. If necessary, use the left mouse button to drag the Histogram script item under the Position script item. 7. Close the Histogram tool. Warn the Operator if the Write-Protect Tab is Open If the write-protect tab is open, you can warn the operator of the equipment by displaying the text WRITE BLOCK on the display screen. 1. In the Point & Click Script tool, click the If-Then icon. 2. In the If Then dialog box, enter the statement IF THEN H_Max >= 200.000000. 18

3. Click OK to close the If Then dialog box. The Point & Click Script tool should appear as follows. If necessary, use the left mouse button to drag the IF Then script item under the Histogram script item. 4. Open the Text tool by either selecting Text from the Tools menu or clicking the icon in the Miscellaneous toolbar. 5. For the Draw Location, select In Image. 6. In the display window, enter WRITE BLOCK. 7. Click Select Font, select Arial, Bold, and 22 points in the Font dialog box, then click OK. 8. Select Black for the text color. 19

9. Select Transparent for the background color. The Text tool appears as follows. 10. Click Add Text. Position the mouse cursor on the location in the inspection image where you want the text to appear (for example, the upper right corner). Click the left mouse button. The text is added to the image within an ROI. 11. In the Text tool, click Add to Script. 12. Use the right mouse button to branch the Text tool script item under the If-Then statement. The Point & Click Script tool should appear as follows. 20

13. Close the Text tool. Search for the Shutter Since the shutter will not always be in the same location in the inspection image, you can use the ROI Manager tool to establish a relationship between the left-hand edge of the shutter and the reference point SRCH_M0 and between the right-hand edge of the disk and the reference point SRCH_M0. 1. In the main DT Vision Foundry application, select the Line button in the ROI type toolbar, then select the Draw button in the ROI mode toolbar. 2. In the inspection image floppy, use the mouse to draw two line ROIs, one through the left-hand edge of the shutter and one through the right-hand edge of the disk. 21

Shutter line ROI Disk line ROI 3. Open the ROI Manager tool, then click the Position tab. 4. From the ROI Name drop-down list, select the ROI through the left-hand edge of the shutter. The shutter line ROI is called Line.n, where n is the number assigned to the ROI by DT Vision Foundry. If more than one line ROI is listed and you re not sure which is the shutter line ROI, select one of the line ROIs. The corresponding ROI is activated (red) in the inspection image. 5. From the Reference Point X Coordinate drop-down list, select SRCH_M0_X. From the Reference Point Y Coordinate drop-down list, select SRCH_M0_Y. 6. Click Initialize to establish the relationship between the line ROI and the reference point. 7. Click Add to Script. 22

8. From the ROI Name drop-down list, select the ROI through the right-hand edge of the disk. The disk line ROI is called Line.n, where n is the number assigned to the ROI by DT Vision Foundry. If more than one line ROI is listed and you re not sure which is the disk line ROI, select one of the line ROIs. The corresponding ROI is activated (red) in the inspection image. 9. From the Reference Point X Coordinate drop-down list, select SRCH_M0_X. From the Reference Point Y Coordinate drop-down list, select SRCH_M0_Y. 10. Click Initialize to establish the relationship between the line ROI and the reference point. 11. Click Add to Script. The Point & Click Script should appear as follows. If necessary, use the left mouse button to drag the Position script items under the IF Then script item. 12. Close the ROI Manager tool. If you run the script now, the line ROIs will be drawn in each of the inspection images. 23

Determine Whether the Shutter is Open You can use the Edge Finder tool to find the left-hand edge of the shutter and the right-hand edge of the disk. Then, you can use the GAU_GaugeResult variable in the Gauge tool to measure the minimum distance between the edges. If the minimum distance is less than the appropriate distance, the shutter is open. 1. Open the Edge Finder tool by either selecting Edge Finder from the Tools menu or clicking the icon in the Gauging toolbar. 2. Click in the viewport on the inspection image floppy. 3. In the Edge Finder tool, click Input Image to load floppy:0 as the input image. 4. Select the Activate threshold controls checkbox and then adjust the Maximum and Minimum slider controls until the transition from black (magenta) to white occurs on the outside edge of the disk. 5. Activate the shutter line ROI by clicking on it with the right mouse button, then click Find Edge to extract the edge and generate a freehand line ROI. The freehand line ROI is named EF.Line.n, where n is the number assigned to the ROI by DT Vision Foundry. 6. Click Add to Script. 7. Activate the disk line ROI by clicking on it with the right mouse button, then click Find Edge to extract the edge and generate a freehand line ROI. The freehand line ROI is named EF.Line.n, where n is the number assigned to the ROI by DT Vision Foundry. 8. Click Add to Script. The Point & Click Script tool should appear as follows. If necessary, use the left mouse button to drag the Edge Finder script items under the Position script item. 24

The inspection image appears as follows. Freehand line ROI Freehand line ROI 25

9. Close the Edge Finder tool. 10. Open the Gauge tool by either selecting Gauge from the Tools menu or clicking the icon in the Gauging toolbar. 11. Under Number of ROIs to Use, click 2 to specify that you want to use two ROIs in your measurement operation. 12. From the ROI 1 drop-down list, select one of the freehand line ROIs generated by the Edge Finder tool. From the ROI 2 drop-down list, select the other freehand line ROI generated by the Edge Finder tool. The freehand line ROIs are called EF.Line.n, where n is the number assigned to the ROI by DT Vision Foundry. 13. Under Measurement Settings, select Min distance from the Type drop-down list. 14. Select Point & Click Script Options. 15. In the Gauge Script Options dialog box, select the Calculate Script Variable checkbox, then click OK. 16. Click Compute. The Gauge tool appears as follows. Note that the minimum distance (290 pixels) is displayed in the Results field. 26

17. Click Add to Script. 18. Close the Gauge tool. The Point & Click Script should appear as follows. If necessary, use the left mouse button to drag the Gauge script item under the Edge Finder script item. 27

Warn Operator if Shutter is Open If the shutter is open, you can warn the operator of the equipment by displaying the text SHUTTER OPEN on the display screen. 1. In the Point & Click Script tool, click the If-Then icon. 2. In the If Then dialog box, enter the statement IF THEN GAU_GaugeResult < 290. 28

If the GAU_GaugeResult variable does not appear in the IF THEN variable drop-down list, click the Step button until you have stepped past the Gauge script item. The variable should then appear. 3. Click OK to close the If Then dialog box. The Point & Click Script tool should appear as follows. If necessary, use the left mouse button to drag the IF Then script item under the Gauge script item. 4. Open the Text tool. 5. For the Draw Location, select In Image. 6. In the display window, enter SHUTTER OPEN. 7. Click Select Font, select Arial, Bold, and 22 points for the font options, then click OK. 8. Select Black for the text color. 9. Select Transparent for the background color. 29

10. Click Add Text. Position the mouse cursor on the location in the inspection image where you want the text to appear (for example, the upper left corner). Click the left mouse button. The text is added to the image within an ROI. 11. In the Text tool, click Add to Script. 12. Use the right mouse button to branch the Text tool script item under the If-Then statement. The Point & Click Script tool should appear as follows. 13. Close the Text tool. Run the Point & Click Script Now you are ready to run the point & click script. 1. Close the viewport containing the inspection image (floppy). 2. Because you want to see the text WRITE BLOCK when the write-protect tab is open, click the first Text script item in the point & click script to highlight it, then click Show Output. 30

3. Because you want to see the text SHUTTER OPEN when the shutter is open, click the second Text script item in the point & click script to highlight it, then click Show Output. 4. Click Run. 5. At any point, click Stop to stop the running of the script. 6. To slow down the running of the script, close the viewport containing the inspection image and click the first script item. Continue to click Step and observe how the script progresses. In the following inspection image, the write-protect tab is open. 31

32 In the following inspection image, the shutter is open.

In the following inspection image, both the write-protect tab and the shutter are closed. 33

34