*
LL LL
Copyright, Trademarks, Patents
Copyright, Trademarks, Patents
The software described in this document is furnished under license, and may be used or copied The software described in this document is furnished under license, and may be used or copied only in accordance with the terms of such license and with the inclusion of the copyright notice only in accordance with the terms of such license and with the inclusion of the copyright notice shown on this page. Neither the software, this document, nor any copies thereof may be shown on this page. Neither the software, this document, nor any copies thereof may be provided to or otherwise made available to anyone other than the licensee. Title to and provided to or otherwise made available to anyone other than the licensee. Title to and ownership of this software remains with Cognex Corporation or its licensor. Cognex ownership of this software remains with Cognex Corporation or its licensor. Cognex
Corporation assumes no responsibility for the use or reliability of its software on equipment that Corporation assumes no responsibility for the use or reliability of its software on equipment that is not supplied by Cognex Corporation. Cognex Corporation makes no warranties, either
is not supplied by Cognex Corporation. Cognex Corporation makes no warranties, either express or implied, regarding the described software, its merchantability, or its fitness for any express or implied, regarding the described software, its merchantability, or its fitness for any particular purpose.
particular purpose.
The information in this document is subject to change without notice and should not be The information in this document is subject to change without notice and should not be
construed as a commitment by Cognex Corporation. Cognex Corporation is not responsible for construed as a commitment by Cognex Corporation. Cognex Corporation is not responsible for any errors that may be present in either this document or the associated software.
any errors that may be present in either this document or the associated software. Copyright © 2000-2001 Cognex Corporation.
Copyright © 2000-2001 Cognex Corporation. All Rights Reserved.
All Rights Reserved.
This document may not be copied in whole or in part, nor transferred to any other media or This document may not be copied in whole or in part, nor transferred to any other media or language, without the written permission of Cognex Corporation.
language, without the written permission of Cognex Corporation.
Cognex P/N 590-6368 Cognex P/N 590-6368 March 2001 March 2001
In-Sight
In-Sight Patents pendingPatents pending Hardware Hardware 4,972,359; 5,526,050; 5,657,403; 5,793,8994,972,359; 5,526,050; 5,657,403; 5,793,899 Vision Tools Vision Tools 5,495,537; 5,548,326; 5,583,954; 5,602,937;5,495,537; 5,548,326; 5,583,954; 5,602,937; 5,640,200; 5,717,785; 5,742,037; 5,751,853; 5,640,200; 5,717,785; 5,742,037; 5,751,853; 5,768,443; 5,796,868; 5,818,443; 5,825,483; 5,768,443; 5,796,868; 5,818,443; 5,825,483; 5,825,913; 5,845,007; 5,859,466; 5,872,870; 5,825,913; 5,845,007; 5,859,466; 5,872,870; 5,909,504 5,909,504
The following are registered trademarks of Cognex Corporation: The following are registered trademarks of Cognex Corporation:
Cognex Cognex
Cognex, Vision for Industry Cognex, Vision for Industry
The following are trademarks of Cognex Corporation: The following are trademarks of Cognex Corporation:
The Cognex logo The Cognex logo In-Sight
In-Sight
Other product and company names mentioned herein are the trademarks, or registered Other product and company names mentioned herein are the trademarks, or registered trademarks, of their respective owners.
LY
CE Compliance Statement
CE Declaration of Conformity
Manufacturer Cognex Corporation One Vision Drive Natick, MA 01760 USA
Declares this CE-marked product
Product Number In-Sight 3000
Complies With 73/23/EEC Low Voltage Directive
89/336/EEC Electromagnetic Compatibility Directive Compliance Standards EN 60950:1992
Electrical Safety
A1:1993, A2:1993, A3:1995 EN 55022
RF Emissions
Information Technology EN 50082-1
EMC Immunity Standard European Representative Cognex France
Immeuble le Patio 104 avenue Albert 1er 92563 Rueil Malmaison France
Introduction... xi
Who Should Read This Book? ...xi
How to Use This Book ...xi
For More Information...xii
Part 1: Using the Interface... 1
Chapter 1: Acquiring a Working Image... 2
Acquiring a Working Image ... 2
Step 1 — Start In-Sight ... 2
Step 2 — Adjust the Camera ... 3
Chapter 2: Moving Around the Interface... 6
What is the Spreadsheet? ... 6
Navigating the In-Sight Interface ... 6
Main Menus... 8
Using the Control Pad ... 10
Using the Keyboard... 12
Using the Mouse ... 13
Using Interactive Graphics ... 13
Chapter 3: Saving & Loading Jobs... 15
What is a Job?... 15
Lesson: Saving a Job... 15
Lesson: Loading a Job ... 16
Chapter 4: Entering Formulas... 17
What is a Formula? ... 17
Cell References... 17
The Formula Editor... 18
Cell Section Mode ... 20
Lesson: Entering Simple Formulas ... 21
Lesson: Entering Formulas with Cell References... 21
Lesson: Entering Simple Functions ... 23
Lesson: Editing Formulas... 24
Chapter 5: Working With Blocks... 25
What is a Block?... 25
YL
Chapter 6: Using Property Sheets ... 30
What is a Property Sheet? ... 30
What is a Structure?... 31
Lesson: Opening A Property Sheet ... 31
Lesson: Changing Parameter Values ... 31
Lesson: Using Interactive Graphics ... 32
Lesson: Inserting Cell References in Values ... 34
Lesson: Inserting Formulas in Values... 34
Part 2: Vision Processing ... 37
Chapter 7: Acquiring Images ... 38
How Does the Spreadsheet Update?... 38
Lesson: Acquiring From Manual Triggers... 38
Lesson: Acquiring from External Triggers... 39
Chapter 8: Finding Features... 41
Why Do I Need to Find Features?... 41
Finding Connected Regions ... 42
Lesson: Finding Connected Regions Using ExtractBlobs ... 42
Lesson: Finding Connected Regions Using FindBlobs... 45
Lesson: Finding Connected Regions Using SortBlobs ... 47
Finding Edges... 49
Lesson: Finding Edges Using FindLine ... 50
Lesson: Finding Edges Using FindSegment... 53
Lesson: Finding Edges Using FindMultiLine... 54
Lesson: Finding Edges Using FindCurve ... 56
Lesson: Finding Edges Using FindCircle ... 59
Finding Patterns ... 62
Lesson: Finding Patterns Using FindPatterns ... 62
Chapter 9: Using Features to Find Objects ... 66
Why Combine Features?... 66
Lesson: Using PointToLine ... 67
Lesson: Using LineToLine ... 70
Lesson: Using PointToPointAngle ... 73
Lesson: Creating a Fixture... 75
Chapter 10: Making Measurements... 79
What is a Measurement? ... 79
Lesson: Counting Pixels ... 79
Lesson: Counting Features... 84
Converting Measurements into Decision Points ... 88
Comparison... 89
Logical ... 89
Conditionals ... 89
Decision Point Formula Examples ... 89
Chapter 12: Communicating Results ... 91
Using Discrete Output ... 91
Lesson: Configuring Discrete Output Options... 92
Lesson: Writing Discrete Outputs ... 93
Using Serial Output ... 95
Lesson: Configuring Serial Output Options... 95
Lesson: Writing Serial Outputs ... 96
Chapter 13: Making a Run-time Interface... 98
What is a Custom View? ... 98
Lesson: Understanding Graphics Functions ... 99
Lesson: Defining a Custom View ... 102
Chapter 14: Configuring for Startup... 105
Lesson: Selecting the Startup Job... 105
Appendix A: The Profiler ... 106
Appendix B: Remote Job Selection... 107
Lesson: Initiating a Job Load... 107
Lesson: Responding to a Job Load... 108
YLLL
List of Figures
Figure 1-1. System Menu... 3
Figure 1-2. Unfocused Image in Live Mode... 4
Figure 1-3. Focused Image Beneath the Transparent Spreadsheet Overlay... 5
Figure 2-1. Enter, Edit, and System Menus... 8
Figure 2-2. In-Sight Interface Control Pad ... 10
Figure 3-1. Save & Load Dialog... 15
Figure 3-2. Save Job Dialog ... 16
Figure 4-1. Formula Editor ... 18
Figure 4-2. Cell Selection Mode... 20
Figure 4-3. Simple Arithmetic Formula in the Formula Editor ... 21
Figure 4-4. Formula with Cell Reference in Formula Editor... 22
Figure 4-5. Cell Reference Formula in Spreadsheet ... 22
Figure 4-6. Simple Function in Formula Editor ... 23
Figure 5-1. Edit Menu... 26
Figure 5-2. Hiding Rows... 28
Figure 6-1. Typical Property Sheet ... 30
Figure 6-2. Typical Structure... 31
Figure 6-3. Options within the Enter Menu ... 32
Figure 6-4. Defining a Move Region ... 33
Figure 6-5. Inserting Formulas in Values ... 35
Figure 7-1. Triggering Options within the AcquireImage Property Sheet ... 39
Figure 8-1. Different Types of Features... 41
Figure 8-2. ExtractBlobs Property Sheet ... 43
Figure 8-3. Defining a Region ... 44
Figure 8-4. ExtractBlobs Function Inserted in Spreadsheet ... 45
Figure 8-5. FindBlobs Property Sheet... 46
Figure 8-6. FindBlobs Function Inserted in Spreadsheet ... 47
Figure 8-7. SortBlobs Property Sheet ... 48
Figure 8-8. SortBlobs Function Inserted in Spreadsheet... 49
Figure 8-9. FindLine Property Sheet... 50
Figure 8-13. FindSegment Function Inserted in Spreadsheet... 54
Figure 8-14. FindMultiLine Property Sheet ... 55
Figure 8-15. FindMultiLine Function Inserted in Spreadsheet ... 56
Figure 8-16. Defining a FindCurve Region ... 57
Figure 8-17. FindCurve Function Inserted in Spreadsheet... 58
Figure 8-18. FindCircle Property Sheet ... 59
Figure 8-19. Defining a FindCircle Region... 60
Figure 8-20. FindCurve Function Inserted in Spreadsheet... 61
Figure 8-21. FindPatterns Property Sheet ... 62
Figure 8-22. Defining a Model Region ... 63
Figure 8-23. Defining a Find Region ... 64
Figure 8-24. FindPatterns Function Inserted in Spreadsheet ... 65
Figure 9-1. PointToLine Function... 67
Figure 9-2. PointToLine Property Sheet ... 68
Figure 9-3. PointToLine Function Inserted in Spreadsheet ... 69
Figure 9-4. LineToLine Function ... 70
Figure 9-5. LineToLine Property Sheet... 71
Figure 9-6. LineToLine Function Inserted in Spreadsheet... 72
Figure 9-7. PointToPointAngle Function ... 73
Figure 9-8. PointToPointAngle Property Sheet... 74
Figure 9-9. PointToPointAngle Function Inserted in Spreadsheet... 75
Figure 9-10. Fixture in the Spreadsheet ... 76
Figure 9-11. PlotCross Property Sheet ... 77
Figure 9-12. PlotCross Function Inserted in Spreadsheet... 78
Figure 10-1. ExtractHistogram Property Sheet ... 80
Figure 10-2. Defining an ExtractHistogram Region ... 81
Figure 10-3. ExtractHistogram Function Inserted in Spreadsheet... 82
Figure 10-4. FindMultiLine Function ... 85
Figure 10-5. PairEdges Property Sheet ... 86
[
Figure 12-1. Discrete Output Dialog ... 92
Figure 12-2. Output Details Dialog... 93
Figure 12-3. WriteDiscrete Property Sheet... 94
Figure 12-4. Serial Port 1 Dialog... 95
Figure 12-5. WriteSerial Property Sheet ... 97
Figure 13-1. Custom View... 98
Figure 13-2. Graphics Control Functions ... 100
Figure 13-3. Graphics Display Functions... 101
Figure 13-4. Configuring a Custom View in the Spreadsheet... 102
Figure 13-5. Custom View Dialog ... 103
Figure 13-6. Custom View of the Spreadsheet... 104
Figure 14-1. Startup Dialog... 105
Figure A-1. In-Sight Profiler ... 106
Figure B-1. Discrete Input Dialog... 107
Figure C-2. Discrete Output Dialog... 108
Figure C-3. Discrete Output Details Dialog... 109
Figure C-1. Image1A.bmp... 110 Figure C-2. Image1B.bmp... 111 Figure C-3. Image1C.bmp ... 111 Figure C-4. Image2A.bmp... 112 Figure C-5. Image2B.bmp... 112
List of Tables
Table 2-1. In-Sight Interface Navigation Configurations ... 7Table 2-2. Basic Keyboard Navigation Keystrokes... 12
Table 2-3. Basic Mouse Navigation Actions ... 13
Welcome to In-Sight™, a compact, stand-alone machine vision sensor for automated inspection and process control. In-Sight’s innovative, built-in spreadsheet interface greatly simplifies the task of developing, operating, and maintaining vision applications.
Who Should Read This Book?
You should readGetting Started with In-Sight to quickly learn the most important features of In-Sight’s spreadsheet-based user interface. It is written primarily for engineers and
programmers who are configuring In-Sight systems, though novice users will also find it helpful.
Getting Started with In-Sight does not assume an in-depth knowledge of machine vision, but by reading it you will become familiar enough with In-Sight to start creating your own machine vision applications.
This book is not a comprehensive reference to every detail of the interface; nor is it a generalized tutorial on machine vision. Its goal is to make you comfortable enough with the In-Sight interface to explore it on your own, and to prepare you for understanding its more advanced features.
How to Use This Book
Getting Started with In-Sight consists primarily of a series of lessons designed to introduce you to the fundamentals of the In-Sight spreadsheet interface. Some lessons depend on concepts introduced in previous lessons, so it is generally best to read them in order, particularly if you are new to machine vision.
To assist you in following along with the lessons, bitmap images of the part used for this book’s lessons are included on the CD-ROM that came with your In-Sight (Image1A.bmp,
Image1B.bmp, Image1C.bmp, Image2A.bmp, and Image2B.bmp). Alternatively, you can setup the In-Sight camera to acquire images directly from the images inAppendix C: Sample Images .
NOTE: The screen captures shown and the features described in this book are current as of version 2.00 of the In-Sight firmware. Visit the In-Sight Online Support Center at www.cognex.com/inSight to download updated documentation, if available.
[LL
For More Information
Other resources available to help you learn about the In-Sight vision sensor and its spreadsheet interface include:
• The following documents describe how to connect the vision processor, digital camera, control pad, and other components. They also contain specifications, mechanical drawings, and other hardware details:
Installing the In-Sight 1000
Cognex P/N 590-6346 (English) Cognex 590-6346F (French) Cognex 590-6346J (Japanese)
Installing the In-Sight 3000
Cognex P/N 590-6348 (English) Cognex 590-6348F (French) Cognex 590-6348J (Japanese)).
• In-Sight Guide and Reference , an HTML Help file provided on the In-Sight CD-ROM. • In-Sight computer-based tutorials , which are included on CD-ROM with In-Sight Starter
Accessories Kits.
• The In-Sight Online Support Center at
The chapters in this part of the book introduce the basic components of the spreadsheet
interface. You will learn how to acquire an image from the In-Sight camera and how to navigate the interface.
2
Chapter 1: Acquiring a Working Image
In this chapter, you will see how to start In-Sight and capture a working image to use in learning the In-Sight graphic user interface.
Acquiring a Working Image
Before you can learn how to use the In-Sight interface, you will need to capture a working image. The following describes this procedure.
Step 1 — Start In-Sight
To start the In-Sight system:1. Ensure that the hardware is connected properly as described in your In-Sight installation manual.
2. For the In-Sight 3000, switch on the VGA monitor, then apply power to the In-Sight processor.
3. Ensure that the In-Sight spreadsheet overlay is visible on the VGA monitor. If not, refer to your In-Sight installation manual.
Step 2 — Adjust the Camera
The first time you use the system, you will need to adjust the camera’s focus and aperture to produce a clear image on your monitor.
NOTE: For specific information on navigating within the In-Sight interface, refer to
Navigating the Interface in theIn-Sight Guide & Reference contained on your In-Sight CD-ROM.
To adjust the camera:
1. Open the System menu (see Figure 1-1).
Getting Started with In-Sight
4
2. Select Live from the System menu to put the system into live video mode. This will temporarily remove the semitransparent spreadsheet overlay (see Figure 1-2).
Figure 1-2. Unfocused Image in Live Mode
3. Adjust the camera’s position, focus ring, and lens aperture until you get a clear image on the monitor.
4. Press any key or button to return to the spreadsheet (see Figure 1-3).
Figure 1-3. Focused Image Beneath the Transparent Spreadsheet Overlay
You now have a working image to use as you learn about the In-Sight spreadsheet interface in the following chapters.
6
Chapter 2: Moving Around the Interface
In this chapter, you’ll learn the basics of navigating in the In-Sight interface using the control pad, a keyboard, or a mouse.What is the Spreadsheet
?
The In-Sight graphical user interface (GUI) consists of a semitransparent spreadsheet superimposed on a 640x480-pixel video image.
The spreadsheet is a table of cells arranged in 400 rows (0 to 399) and 26 columns (labeled A through Z). Individual cells are referred to by column letter and row number: for example, cell C4 is at the intersection of column C and row 4. In most respects, the In-Sight spreadsheet works much like other spreadsheets you may be familiar with.
You will use the spreadsheet to configure vision applications by inserting expressions called
formulas into its cells (Formulas are discussed in Chapter 4: Entering Formulas ). Since the spreadsheet is semitransparent, the image will always be in view.
You configure the spreadsheet one cell at a time. When a cell is highlighted, its formula is displayed in the Formula Bar at the top-left corner of the spreadsheet. If you attempt to move off the edge of the screen, the spreadsheet will automatically scroll to keep the selected cell in view.
Navigating the In-Sight Interface
The In-Sight user interface may be configured using the In-Sight control pad, a keyboard and mouse connected to a Windows ® PC, or any combination of the three input devices. Which
Table 2-1 lists the methods by which each type of In-Sight Interface can be navigated: Table 2-1. In-Sight Interface Navigation Configurations
Input Device In-Sight 1000 In-Sight 3000 In-Sight PC Host
Local No Yes Yes1
Control Pad
Network Yes1 Yes2 Yes2
Local No No Yes
Keyboard
Network Yes3 Yes3 Yes
Local No No Yes
Mouse
Network Yes1 Yes3 Yes
1
PC must have a standard, 15-pin game port and joystick driver installed or an available USB port for a third-party control pad.
2
From any In-Sight 3000 on the network.
3
From any In-Sight PC Host on the network.
The specific actions necessary for navigating the In-Sight interface are context-sensitive, and vary according to the input device that is used.
Getting Started with In-Sight
8
Main Menus
The In-Sight interface has three main menus, as shown in Figure 2-1: System, Enter, and Edit.
Figure 2-1. Enter, Edit, and System Menus
• TheSystem menu contains selections for acquiring live images, saving and loading files, configuring network and serial communications, discrete I/O, user names and logon permissions, and more. The Settings menu is accessed from the System Menu. • TheEnter menu is used throughout the interface to enter formulas and values into
spreadsheet cells and parameters in property sheets.
• TheEdit menu provides block-editing operations for spreadsheet cells, disables selected cells to prevent them from updating, and configures the Custom View of the spreadsheet. The edit menu is also used to access the property sheets for Graphics Controls functions after they have been inserted into the spreadsheet.
NOTE: Selections on the menus are context-sensitive. Unavailable selections are grayed out.
To open the menus from anywhere in the main spreadsheet:
• The System menu
Control Pad Keyboard Mouse
Press the button. Press
orZ
+
s
Right-click with mouse pointerover any cell not highlighted.• The Enter menu
Control Pad Keyboard Mouse
Press and hold the button. Not directly accessible using
the keyboard. Left-click and hold on any cell.
• The Edit menu
Control Pad Keyboard Mouse
Press the button. Press
orZ
+
e
Right-click with mouse pointer over highlighted cell.Getting Started with In-Sight
10
Using the Control Pad
Unlike a traditional vision system that requires programming from a PC and a keyboard, In-Sight can be configured using only a simple, 10-button control pad (see Figure 2-2).
NOTE: For a comprehensive list of control pad actions by context within the interface, refer to Navigating the Interface in the In-Sight Guide & Reference contained on your In-Sight CD-ROM.
Direction Buttons
Action Buttons
Shortcut Buttons
Figure 2-2. In-Sight Interface Control Pad Direction Buttons
The four Direction Buttons are used in many common operations, including interface navigation, manipulating graphic regions of interest, incrementing/decrementing numeric values, and selecting ranges of cells. The exact behavior of the direction buttons is context-sensitive.
The up direction button moves the on-screen highlight up, decreases the size of a graphic region, and increments numeric values. In the spreadsheet, pressing ZKLOH
holding the button selects an entire column of cells.
The down direction button moves the highlight down, increases the size of a graphic region, and decrements numeric values.
The left direction button moves the highlight left, decreases the width of a graphic region, rotates a graphic region counter-clockwise, curves a graphic region up, and selects a digit to increment in a numeric value.
The right direction button moves the highlight right, increases the width of a graphic region, rotates a graphic region clockwise, curves a graphic region down, and selects a digit to increment in a numeric value. In the spreadsheet, pressing ZKLOHKROGLQJWKH
Action Buttons
The four Action Buttons are used to open menus, enter formula and values, and manipulate interactive graphics.
In the spreadsheet, the up action button opens the System menu. In all other contexts throughout the interface, the button cancels changes and escapes to the previous menu or dialog. It works much like pressing the ESC key on a computer keyboard. The down action button selects the highlighted item and performs an action. The button also opens the Enter menu, but only if it is pressed and held. Otherwise, if pressed and immediately released the button automatically selects the highlighted item, or accepts any changes you have just made. Its function is similar to pressing ENTER on a computer keyboard.
The left action button accesses various editing shortcuts, including backspace in the formula editor, and zeroing numbers when in numeric edit mode. However, the most common use of the left action button is to access Interactive Graphics mode.
The right action button opens the Edit menu in the spreadsheet and in property sheets, and maximizes numbers when in numeric edit mode.
Shortcut Buttons
The two buttons in the center of the control pad perform two shortcuts:
A The left-center button labeled "A" manually triggers an image acquisition and updates the spreadsheet.
B The right-center button labeled "B" switches between the default view and the Custom View of the current spreadsheet job.
Getting Started with In-Sight
12
Using the Keyboard
Table 2-2 shows you the basic keyboard keystrokes needed to navigate within In-Sight. NOTE: For a comprehensive list of keyboard actions by context within the interface,
refer to Navigating the Interface in the In-Sight Guide & Reference contained on your In-Sight CD-ROM.
Table 2-2. Basic Keyboard Navigation Keystrokes
Keystrokes Action
vcxz
Navigate the spreadsheet, menus, and dialogs. Adjust interactivegraphics.|
andvcxz
Selects spreadsheet rows, columns, and cell ranges for block editing operations.
@
Opens the Enter menu, selects highlighted items, and accepts changes.
Opens the System menu."
Switches into Interactive Graphics mode.
Opens the Edit menu.%
Manually triggers an image acquire and spreadsheet update.^
Switches between the default and the Custom View of the spreadsheet. Any alphanumericUsing the Mouse
Table 2-3 shows you the basic mouse actions needed to navigate within In-Sight.
NOTE: For a comprehensive list of mouse actions by context within the interface, refer toNavigating the Interface in the In-Sight Guide & Reference contained on your In-Sight CD-ROM
Table 2-3. Basic Mouse Navigation Actions
MouseAction Action
Left-click Selects/opens items throughout the entire interface. Also accepts changes madeto values.
Left-click and hold Opens the Enter menu in the spreadsheet and in property sheets, and adjusts interactive graphics.
Right-click
In the spreadsheet, opens the Edit menu and the System menu, depending on whether the right-click action occurs on a selected cell, or outside the selection. Opens the Edit menu in property sheets. Cycles between interactive graphics modes.
Right-click and drag Selects spreadsheet rows, columns, and cell ranges for block editing operations.
Using Interactive Graphics
The parameters for many Vision Processing, and other In-Sight functions, can be configured by adjusting an overlay graphic on top of the image. For example, an interactive graphic can be used to easily set the size, position, and rotation for a region of interest, or for training a model region. Interactive graphics can be accessed from any cell in the spreadsheet (while in
standard or Custom View as permitted by the user’s Access level), or from any parameter value in a property sheet.
As shown in Table 2-4, the actions necessary for using interactive graphics depends on which input device you are using.
Table 2-4. Accessing Interactive Graphics
Control Pad Keyboard Mouse
Press . Or, press and hold to open the Enter menu, then
choose Graphics.
"
Left-click and hold to open the Enter menu, then choose Graphics.
When you access an interactive graphic, the semitransparent spreadsheet or property sheet overlay will disappear, and the graphic will be displayed on top of the image. If the highlighted cell or value has an associated graphic, the graphic will appear in red on the image beneath the
Getting Started with In-Sight
14
There are 5 types of interactive graphics: regions, circles, crosses, points, and lines. The type of graphic displayed depends on the type of input required by the cell or value.
NOTE: For a comprehensive list of interactive graphic actions for each input device, refer to theIn-Sight Guide & Reference contained on your In-Sight CD-ROM.
In this chapter, you will learn how to save and load In-Sight Jobs.
What is a Job?
AJob file (*.JOB) is an In-Sight spreadsheet containing formulas and text which performs a specific set of machine vision tasks. Job file storage is limited to the amount of available flash memory on the In-Sight 1000 and In-Sight 3000 sensor. File storage is virtually unlimited on an In-Sight PC Host. The name of the job currently loaded is displayed in the lower-left corner of the Save & Load dialog. If the current job has not been saved, it will be "Unnamed."
NOTE: All work entered in the spreadsheet remains in memory as long as the processor has power or the In-Sight PC Host is open. However, if the processor loses
power or you close the In-Sight PC Host, you will lose all unsav ed data. Therefore, make sure you save your jobs.
Lesson: Saving a Job
To save a job:1. From the spreadsheet, open the System menu.
2. Select Save & Load to open the Save & Load dialog (see Figure 3-1).
Getting Started with In-Sight
16
3. Highlight < New >, then select Save to open a Text Entry dialog (see Figure 3-2).
Figure 3-2. Save Job Dialog 4. Enter a name for the job using the onscreen keypad.
TIP: If you make a mistake entering your job name, backspace over the last character entered. If you need to start over, Select Cancel.
5. Select the Save button to accept your changes and return to the Save & Load dialog. 6. In the Save & Load dialog, select Close to accept your changes and return to the
spreadsheet.
Lesson: Loading a Job
Loading a job retrieves it from memory or disk storage (In-Sight PC Host). The steps for loading a job are similar to the steps for saving a job:
1. From the spreadsheet, open the System menu. 2. Select Save & Load to open the Save & Load dialog.
3. Select the job that you want to load, then select theLoad button.
In this chapter, you will learn how to enter formulas into In-Sight spreadsheet cells. In this chapter, you will learn how to enter formulas into In-Sight spreadsheet cells.
What is a Formula?
What is a Formula?
A
Aformula formula is a mathematical expression consisting of values and references to values,is a mathematical expression consisting of values and references to values, connected by mathematical operators, and resulting in a new value or set of values. In-Sight connected by mathematical operators, and resulting in a new value or set of values. In-Sight considers everything you enter into a cell
considers everything you enter into a cell — —whether a single constant or a complex vision-whether a single constant or a complex vision-processing function
processing function — —to be a formula. All formulas contained in an In-Sight job spreadsheet areto be a formula. All formulas contained in an In-Sight job spreadsheet are constructed using the
constructed using theformula editor formula editor (see below).(see below). Formulas can return three types of results:
Formulas can return three types of results: Values
Values Numbers, such as 1.00 orNumbers, such as 1.00 or – – 1.00.1.00. Strings
Strings Alphanumeric characters, such asAlphanumeric characters, such as““PASSPASS””oror““FAIL.FAIL.””
Structures
Structures A vision-processing function (structures are discussedA vision-processing function (structures are discussedChapter 6: Chapter 6: Using Using Property Sheets
Property Sheets ).).
Cell References
Cell References
Formulas can refer to other cells in the spreadsheet by using
Formulas can refer to other cells in the spreadsheet by usingabsolute absolute andandrelative relative cellcell references.
references.
Relative
Relative cell references point to cells relative to the position of the formula. When copied orcell references point to cells relative to the position of the formula. When copied or moved to a new location in the spreadsheet, these references automatically adjust to maintain moved to a new location in the spreadsheet, these references automatically adjust to maintain the same position relative to the formula, as in the following examples:
the same position relative to the formula, as in the following examples: A5=A3+A4
A5=A3+A4 If this formula is copied to cell B5, it becomes B5=B3+B4.If this formula is copied to cell B5, it becomes B5=B3+B4. A5=A3+A4
A5=A3+A4 If this formula is copied to cell A6, it becomes A6=A4+A5.If this formula is copied to cell A6, it becomes A6=A4+A5.
Absolute
Absolute cell references point tocell references point tofixed fixed locations in the spreadsheet, regardless of the formulalocations in the spreadsheet, regardless of the formula’’ss location. They do not change when the formula is copied or moved. Absolute cell references location. They do not change when the formula is copied or moved. Absolute cell references are designated by a dollar sign ($) preceding the cell
are designated by a dollar sign ($) preceding the cell’’s row or column label. By placing thes row or column label. By placing the dollar sign appropriately, you can refer to a fixed row, column, or cell, as in the following dollar sign appropriately, you can refer to a fixed row, column, or cell, as in the following examples:
examples:
A5=$A$3+$A$4
A5=$A$3+$A$4 If this formula is copied to cell B5, it becomes B5=$A$3+$A$4.If this formula is copied to cell B5, it becomes B5=$A$3+$A$4. A5=A$3+A$4
Getting Started with In-Sight Getting Started with In-Sight
18 18
The Formula Editor
The Formula Editor
As shown in Figure 4-1, In-Sight includes a
As shown in Figure 4-1, In-Sight includes a formula editor formula editor that is used to enter formulas intothat is used to enter formulas into the spreadsheet. As mentioned earlier, all formulas contained in an In-Sight job spreadsheet the spreadsheet. As mentioned earlier, all formulas contained in an In-Sight job spreadsheet are constructed using the formula editor.
are constructed using the formula editor. NOTE
NOTE:: The formulThe formula editor is accesa editor is accessed from the Entesed from the Enter menu.r menu.
Formula Bar Formula Bar Onscreen Keypad Onscreen Keypad Function Categories Function Categories
Functions & Function Functions & Function Subcategories Subcategories Context-Sensitive Help Context-Sensitive Help
Figure 4-1. Formula Editor Figure 4-1. Formula Editor The formula editor is divided into four main sections:
The formula editor is divided into four main sections: •
• Formula BarFormula Bar: The formula bar appears at the top of the formula editor dialog and shows: The formula bar appears at the top of the formula editor dialog and shows the formula that is being edited. The formula editor automatically checks the formula for the formula that is being edited. The formula editor automatically checks the formula for correct syntax. If a formula is not valid, the invalid syntax will be highlighted in red; the correct syntax. If a formula is not valid, the invalid syntax will be highlighted in red; the formula will not be accepted until the syntax error is corrected. A colored cursor indicates formula will not be accepted until the syntax error is corrected. A colored cursor indicates the current insertion point in the formula, where changes will be made.
•
• Onscreen KeypadOnscreen Keypad: The onscreen keypad occupies the left side of the formula editor: The onscreen keypad occupies the left side of the formula editor dialog. In addition to the keys for inserting numeric characters and mathematical operators dialog. In addition to the keys for inserting numeric characters and mathematical operators into formulas, the onscreen keypad provides keys for inserting cell references and text into into formulas, the onscreen keypad provides keys for inserting cell references and text into a formula, as follows:
a formula, as follows:
Inserts an Absolute cell reference symbol into the formula. Complete the cell Inserts an Absolute cell reference symbol into the formula. Complete the cell reference by manually inserting an alpha character for the Column, and a numeric reference by manually inserting an alpha character for the Column, and a numeric character for the Row, after the
character for the Row, after the’’$$’’character (for example, $A1).character (for example, $A1).
Activates Cell Selection mode, for choosing an Absolute cell reference to insert into Activates Cell Selection mode, for choosing an Absolute cell reference to insert into the formula.
the formula.
Activates Cell Selection mode, for choosing a Relative cell reference to insert into Activates Cell Selection mode, for choosing a Relative cell reference to insert into the formula.
the formula.
Opens the Text Entry dialog for inserting strings of alphanumeric characters and Opens the Text Entry dialog for inserting strings of alphanumeric characters and Symbols into the formula.
Symbols into the formula. •
• Function ListFunction List: A list of tool categories and subcategories occupies the center and right: A list of tool categories and subcategories occupies the center and right sections of the formula editor. As a tool category is highlighted in the center, a list of that sections of the formula editor. As a tool category is highlighted in the center, a list of that category
category’’s functions appears in the right section, organized within subcategories. Thes functions appears in the right section, organized within subcategories. The current category and function selections are indicated by a
current category and function selections are indicated by a V\PEROV\PERO
•
• Context Sensitive HelpContext Sensitive Help: The bottom part of the formula editor dialog contains context-: The bottom part of the formula editor dialog contains context-sensitive help text for quick reference.
Getting Started with In-Sight
20
Cell Section Mode
The most convenient method for inserting absolute and relative cell references into formulas is to use the In-SightCell Selection mode . In cell selection mode, cell references are entered by highlighting and selecting the cells to reference directly in the spreadsheet; the references do not have to be typed in manually.
While in cell selection mode, the display temporarily switches from the property sheet or dialog into a unique view of the In-Sight spreadsheet. In this view, the spreadsheet is opaque (the image is not visible beneath the spreadsheet), and a dashed line surrounds the first cell that is highlighted, as shown in Figure 4-2:
Figure 4-2. Cell Selection Mode
When cells have been highlighted and selected, the display switches back to the property sheet or dialog from which cell selection mode was initiated, and the references for those cells are inserted.
In Figure 4-2, references for cells C7 and D7 will be inserted into the formula contained in cell A11. If more cells were selected than can be used as references at the insertion point of the formula, then only the first cell of the selection, cell C7, will be inserted and the reference to cell D7 will be discarded.
Lesson: Entering Simple Formulas
Lesson: Entering Simple Formulas
This procedure describes the general procedure for entering simple formulas that do not This procedure describes the general procedure for entering simple formulas that do not contain cell references.
contain cell references.
To enter a simple formula into the spreadsheet: To enter a simple formula into the spreadsheet:
1.
1. Highlight an Highlight an empty cell empty cell where ywhere you want ou want to insert to insert the formula.the formula. 2.
2. Open Open thethe formula editorformula editor.. 3.
3. You can You can enter numbers and enter numbers and basic arithmetic operators basic arithmetic operators (+, -, /, (+, -, /, *) with the *) with the onscreenonscreen keypad or with the keyboard, if using the In-Sight PC Host, to create a simple formula. keypad or with the keyboard, if using the In-Sight PC Host, to create a simple formula. Figure 4-3 shows an example of a simple arithmetic formula in the formula editor. Figure 4-3 shows an example of a simple arithmetic formula in the formula editor.
Figure 4-3. Simple Arithmetic Formula in the
Figure 4-3. Simple Arithmetic Formula in the Formula EditorFormula Editor 4.
4. Once yOnce you ou have have entered entered a a formula, selectformula, select OKOK to insert the formula into the spreadsheet.to insert the formula into the spreadsheet.
Lesson: Entering Formulas with Cell References
Lesson: Entering Formulas with Cell References
This lesson shows how cell references are included in formulas. This lesson shows how cell references are included in formulas. To enter a formula that includes cell references:To enter a formula that includes cell references: 1.
1. Highlight an Highlight an empty cell empty cell where ywhere you want ou want to insert to insert the formula.the formula. 2.
2. Open Open thethe formula editorformula editor.. 3. Select
3. Select Absolute Cell ReferenceAbsolute Cell Reference oror Relative Cell ReferenceRelative Cell Reference from the onscreen keypad.from the onscreen keypad. 4.
4. Highlight a Highlight a cell containing a cell containing a formula and formula and select that select that cell to insert cell to insert the cell the cell reference intoreference into the formula.
the formula. 5.
Getting Started with In-Sight Getting Started with In-Sight
22 22
6.
6. Repeat step Repeat step 3, but 3, but select a dselect a different cell reference ifferent cell reference to insert to insert in the in the formula.formula.
Figure 4-4. Formula with Cell Reference
Figure 4-4. Formula with Cell Reference in Formula Editorin Formula Editor 7. Select
7. Select OKOK to insert the formula into the spreadsheet (see Figure 4-5).to insert the formula into the spreadsheet (see Figure 4-5).
Figure 4-5. Cell Reference Formula in Spreadsheet Figure 4-5. Cell Reference Formula in Spreadsheet
Lesson: Entering Simple Functions
Lesson: Entering Simple Functions
In-Sight includes many standard math, statistic, and trigonometric functions. This lesson In-Sight includes many standard math, statistic, and trigonometric functions. This lesson describes the general procedure for entering these functions into a formula.
describes the general procedure for entering these functions into a formula. To enter a simple function:
To enter a simple function: 1.
1. Highlight an Highlight an empty cell empty cell where ywhere you want ou want to insert to insert the formula.the formula. 2.
2. Open Open thethe formula editorformula editor.. 3.
3. Select Select thethe MathematicsMathematics function category.function category. 4.
4. Select Select thethe TrigonometryTrigonometry subcategory and expand that function list.subcategory and expand that function list. 5.
5. Select the Select the function you function you want to want to insert into insert into the Formula the Formula Bar.Bar. 6. Select
6. Select Absolute Cell ReferenceAbsolute Cell Reference oror Relative Cell ReferenceRelative Cell Reference from the onscreen keypad.from the onscreen keypad. 7.
7. Highlight a Highlight a cell containing data cell containing data and select and select that cell that cell to insert to insert a cell a cell reference into reference into thethe formula (see Figure 4-6).
formula (see Figure 4-6).
Figure 4-6. Simple Function in Formula Editor Figure 4-6. Simple Function in Formula Editor 8.
8. Select Select thethe button in the formula editor to complete the formula.button in the formula editor to complete the formula. 9. Select
Getting Started with In-Sight
24
Lesson: Editing Formulas
After you’ve entered a formula into a spreadsheet cell, you can return to it and edit it as needed.
To edit a formula string:
1. Highlight the cell containing the formula you want to edit, and open theformula editor. 2. Move to the Formula Bar on the top of the formula editor. A text cursor will show the
editing position on the Formula Bar.
3. With the text cursor, you are able to move right and left within the formula string as well as backspace over existing alphanumeric characters and functions.
In this chapter, you will learn how to manipulate blocks of cells in a spreadsheet.
What is a Block?
A Block is a contiguous, rectangular group of cells in a spreadsheet. You can cut, copy, paste, clear, hide, insert, and remove blocks using functions in the Edit menu.
Lesson: Marking a Block
Before you can copy, cut, hide, or perform other operations on a block of cells, you need to mark the block.
To mark a block of cells:
Control Pad Keyboard Mouse
1. Press and hold the button.
2. Press down ( DQGULJKW
( GLUHFWLRQEXWWRQV
Press
|
+
v
to mark cells in rows.Press
|
+
x
to mark cells in columns.1. Right-click and hold on any highlighted cell.
Getting Started with In-Sight
26
Lesson: Editing Blocks
This lesson describes each of the block-editing functions accessible from the Edit menu, as shown in Figure 5-1.
NOTE: The procedures in this section can be applied to a single cell as well as to blocks of cells.
Figure 5-1. Edit Menu Copy
Copies a block of cells and stores its formulas in the system’s internal clipboard, leaving the original formulas in place in the spreadsheet.
To copy a block of cells:
1. Mark the block you want to copy, as described in the previous lesson. 2. Select Copy from the Edit menu.
Cut
Cuts a block of cells and stores its formulas in the system’s internal clipboard, removing the formulas from the spreadsheet.
To cut a block of cells:
1. Mark the block you want to cut, as described in the previous lesson. 2. Select Cut from the Edit menu.
Paste
Pastes previously copied formulas contained in the system’s internal clipboard back to the spreadsheet.
To paste a block of cells:
1. Highlight the upper-left cell of the block’s new location. 2. Select Paste from the Edit menu.
Clear
Clearing cells permanently deletes their contents. Cleared cells cannot be pasted back into the spreadsheet.
To clear a block of cells:
1. Mark the block of cells you want to clear. 2. Select Clear from the Edit menu.
Hide/Unhide Rows & Columns
Hiding rows and columns in the spreadsheet removes them from view. Their data remains in the spreadsheet, however, and becomes visible again when you unhide them.
NOTE: You cannot select rows and columns at the same time. To select columns of cells:
Control Pad Keyboard Mouse
Press and hold button.
• Press up ( GLUHFWLRQ
button to mark current column.
• Press right ( GLUHFWLRQ
button to mark additional columns.
• Press
|
+
c
to markcurrent column.
• Press
x
to mark adjacentcolumns to the right.
• Left-click on a column label
at the top of the spreadsheet.
• Right-click and hold while
dragging right or left to mark additional columns.
To select a rows of cells:
Control Pad Keyboard Mouse
Press and hold button.
• Press up ( GLUHFWLRQ
button to mark current column.
• Press right ( GLUHFWLRQ
button to mark additional columns.
• Press
|
+
z
to markcurrent column.
• Press
v
to mark adjacentcolumns to the right.
• Left-click on a row label to
the left of the spreadsheet.
• Right-click and hold while
dragging up or down to mark additional rows.
Getting Started with In-Sight
28
To hide rows or columns of cells:
1. Select the rows or columns you want to hide, as described above.
2. Select Hide Rows or Hide Cols from the Edit menu, as shown in Figure 5-2.
Figure 5-2. Hiding Rows To unhide rows and columns:
1. Mark, as described above, the rows or columns that fall on both sides of the hidden rows or columns.
2. Select Unhide Rows or Unhide Cols from the Edit menu.
NOTE: You can find hidden rows and columns by looking for gaps in the row and
column label sequence. For example, if column A appears next to column D, then columns B and C are hidden.
Inserting and Removing Rows
You can also insert rows into, or delete rows from, the spreadsheet. To insert rows:
1. Mark a block that includes the number of rows that you want to insert. The new rows will be inserted immediately above the block you mark.
2. Select Insert Rows from the Edit menu. To remove rows:
1. Mark a block that includes the rows you want to delete. 2. Select Remove Rows from the Edit menu.
30
Chapter 6: Using Property Sheets
In this chapter, you will learn how to use functions by configuring arguments in property sheets.
What is a Property Sheet?
Aproperty sheet is a table that allows you to easily configure parameters for a particular In-Sight function. Whenever a function returns astructure (see next section) or has a large number of input parameters, the In-Sight user interface provides a property sheet to simplify the task of configuring the function. Figure 6-1 shows an example of a typical property sheet.
Figure 6-1. Typical Property Sheet
NOTE: This property sheet contains a Vision Processing function called
ExtractHistogram, which is discussed in Chapter 10: Making Measurements . For now, ExtractHistogram provides a convenient example of a property sheet. When opened, the property sheet temporarily replaces the spreadsheet with a table that lists the defaultparameters andvalues . Each row of a property sheet consists of a parameter name and a value, or a group of expanded/collapsed parameters and values. Although values are usually numbers, references to cells in the spreadsheet, or text strings, they may also be represented by checkboxes or drop-down lists.
What is a Structure?
In-Sight functions that return structures differ from conventional spreadsheet functions. Instead of returning a single value or text string to a cell, most functions that return structures
automatically insert an array of additional functions and values into adjacent cells. Figure 6-2 shows an example of a typical structure.
Function
Structure Name Array of
Functions/Values
Figure 6-2. Typical Structure
NOTE: Structure functions cannot be combined in a single formula with conventional values and operators. When a structure function is inserted in a cell, it must be the only entity in that cell. The In-Sight formula editor enforces this restriction by activating and deactivating selections as necessary.
Lesson: Opening A Property Sheet
To see an example of a property sheet:1. Highlight an empty cell in the spreadsheet and open the formula editor. 2. Select the Vision Processing category.
3. Select the Histogram subcategory
4. Select ExtractHistogram. The ExtractHistogram property sheet will open. 5. Select OK. A structure called Hist will appear in the spreadsheet.
Lesson: Changing Parameter Values
Property sheets are initially configured with the default parameter values for the selected function. You can edit these values as necessary to configure the property sheet for your application.
To change the values in a property sheet:
1. Highlight the cell in the spreadsheet containing the Hist structure created in the last lesson, and open its property sheet.
Getting Started with In-Sight
32
3. Open the Enter menu (see Figure 6-3), which includes the following items:
Number: Inserts a constant value into an edit box, check box, list box, or Interactive Graphic.
Relative: Switches to Cell Selection mode for selecting a cell from the spreadsheet to use as a relative reference.
Absolute: Switches to Cell Selection mode for selecting a cell from the spreadsheet to use as an absolute reference.
Formula: Activates the formula editor.
Graphics: Switches to Interactive Graphics mode for changing the size and position of the interactive graphic, if available.
Figure 6-3. Options within the Enter Menu 4. Select a menu option (i.e., Number).
5. Change the value as needed.
6. Select OK to accept your changes, or select Cancel to leave the property sheet unchanged.
Lesson: Using Interactive Graphics
Some property sheet values are contained in an expandable parameter group. These
parameter groups are common in structure functions that include a graphical representation, such as an imageregion .
A region consists of a set of image coordinates that define a contiguous section of the image for processing. Since adjusting region coordinates one value at a time would be tedious, property
sheets allow you to adjust most image-related parameter groups as a single Interactive Graphic.
NOTE: For a comprehensive list of interactive graphic actions for each input device, refer to theIn-Sight Guide & Reference contained on your In-Sight CD-ROM. To use an Interactive Graphic:
1. Highlight the cell in the spreadsheet containing the Hist structure, which was created earlier.
2. Open the ExtractHistogram property sheet.
3. Expand the Region group. Highlight the X parameter value and switch to Interactive Graphics mode (see Figure 6-4).
Figure 6-4. Defining a Move Region
4. Accept or cancel changes that were made to the interactive graphic. This will return you to the ExtractHistogram property sheet.
5. Select OK to accept your changes, or select Cancel to leave the property sheet unchanged.
Getting Started with In-Sight
34
Lesson: Inserting Cell References in Values
Function parameters can include references to other cells in the spreadsheet. To insert a cell reference as a function parameter:
1. Highlight a cell in the property sheet where you want to insert a cell reference. 2. Open the Enter menu.
3. Select Relative or Absolute to Cell Selection mode.
4. Select the cell you want to refer to, then accept your selection.
TIP: You can replace multiple function arguments with cell references by marking a block of cells in the spreadsheet while in Cell Selection mode.
Lesson: Inserting Formulas in Values
Spreadsheet formulas that compute a single value can also be used as parameter values in a property sheet.
To use the formula editor to insert a formula:
1. Highlight a row in the property sheet where you want to insert a formula.
2. Open the Enter menu, and select Formula to open the formula editor, as shown in Figure 6-5.
NOTE: You can also activate the formula editor by opening the Edit menu, then selecting Formula. This method is useful for overriding property sheet check boxes, list boxes, and other embedded controls.
3. Use the formula editor to insert your formula directly into the parameter value, as shown in Figure 6-5.
Figure 6-5. Inserting Formulas in Values
4. Select OK to accept your changes, or select Cancel to leave the property sheet unchanged.
In the previous chapters you learned how to navigate the In-Sight interface. In the following chapters, you will learn the basic techniques for configuring a vision application in the spreadsheet.
38
Chapter 7: Acquiring Images
In this chapter, you’ll learn how to acquire images, set image acquisition parameters, and trigger processing.
How Does the Spreadsheet Update?
Cell dependencies drive spreadsheet updates. For example, in the formula A1 = B1 + C1, cell A1 is said to be dependent on cells B1 and C1. In this case, A1 automatically updates
whenever B1 or C1 changes.
In-Sight dedicates cell A0 to the AcquireImage function. When AcquireImage receives a trigger from any source, it takes a digital image from the camera and assigns it to cell A0. And because the results of a visual inspection are always dependent on the input image in A0, the spreadsheet updates, orruns , whenever the input image changes.
Lesson: Acquiring From Manual Triggers
Manually triggered image acquisition is useful during development and testing. In-Sight has two manual modes for acquiring images:Live andSingle acquire.
Live Mode
Live video mode acquires and displays images in rapid succession while the spreadsheet overlay is temporarily disabled. This is useful when making camera adjustments.
To initiate Live video mode: 1. Open the System menu.
2. Select Live to enter Live mode.
3. Press any button to exit live mode and return to the spreadsheet.
NOTE: Any spreadsheet function that depends on the acquired image updates automatically when Live mode terminates.
Single Acquire Mode
To manually acquire one image at a time:
Control Pad Keyboard Mouse
Press A button once to
trigger single acquisition. Press
%
to trigger single acquisition.Not available.
NOTE: Disabling the Manual trigger checkbox in the AcquireImage Property sheet also disables the single acquisition trigger from the control pad.
Lesson: Acquiring from External Triggers
For In-Sight to run a machine vision application automatically, the system must have automatically triggered image acquisitions. This trigger is typically supplied by an external signal.
To select an acquisition trigger source: 1. Highlight cell A0 in the spreadsheet. 2. Open the AcquireImage property sheet.
3. Highlight the value for the Trigger parameter, and open the drop-down list of trigger sources (see Figure 7-1).
Figure 7-1. Triggering Options within the AcquireImage Property Sheet
Camera Acquires an image upon receiving a pulse to the trigger input located directly on the camera.
Continuous Acquires images as fast as the camera will allow.
External Acquires images on either a native-mode serial command or on the rising edge applied to a discrete input bit configured as an Acquisition Trigger (In-Sight 3000 only ).
Manual Acquires images when pressing the A button on the control pad (In-Sight 3000 only ), or
%
on the keyboard (In-Sight PC Host only ).Getting Started with In-Sight
40
Acquisition Parameters
Other parameter values in the AcquireImage function also control important image acquisition parameters. These parameters include:
Exposure Image exposure time can be set in milliseconds. A smaller number reduces the blurring of an object in motion. A larger numbers allows more light on the imaging sensor.
Light Power Light power parameters can be set to control the current on up to four independent LED light sources (In-Sight 3000 only ).
Gain/Offset Analog gain and offset parameters can be set to adjust the voltage of the analog video signal before it is converted a digital signal.
To adjust any of these parameters go to cell A0 and open the AcquireImage property sheet. Changes will take effect when you accept your changes.
In this chapter, you will learn several techniques for locating individual object features in the field of view.
Why Do I Need to Find Features?
An object can be represented by the location of its coordinates in the image: row, column, and theta (angle of rotation). But objects are also composed of a variety of individual features. For example, an object can include simple features such as holes, curved edges, and straight edges, or more complex features such as irregular shapes or grayscale patterns, as shown in Figure 8-1.
Curved Edge
Hole
Straight Edge
Irregular Shape
Figure 8-1. Different Types of Features
While In-Sight can find and report the position of an object in its entirety, you will generally want to identify and find the object’s most important features first; finding individual features is
sometimes easier than finding the object itself.
This approach not only allows you to extract data about individual features, but also enables you to efficiently combine those features to locate the object or to evaluate its quality relative to a known specification.
Getting Started with In-Sight
42
This chapter discusses In-Sight’s primary tools for finding these types of features:
• Connected regions (Blobs)
• Edges
• Patterns
Subsequent chapters describe basic techniques for combining features to find objects, make measurements, and create decision points based on those measurements.
Finding Connected Regions
Many object features can be distinguished from their backgrounds according to how bright or dark they appear in the image. These bright or dark features, commonly known as “Blobs,”can be described by a set of statistical characteristics.
In-Sight provides several functions for extracting and identifying Blob features in an image: ExtractBlobs Extracts Blobs from an image.
FindBlobs Compares extracted Blobs to a reference Blob.
SortBlobs Sorts extracted Blobs by coordinates.
Lesson: Finding Connected Regions Using ExtractBlobs
To insert an ExtractBlobs function into the spreadsheet:1. In column A, select a cell in an empty row that also has an empty row immediately above. 2. Open the formula editor.
3. Under Vision Processing, select ExtractBlobs from the Blob subcategory to open the ExtractBlobs property sheet (see Figure 8-2).
Getting Started with In-Sight
44
4. Expand the Region group. Highlight the X parameter value and switch to Interactive Graphics mode (see Figure 8-3).
Figure 8-3. Defining a Region
5. Position the region so that it completely encloses the Blobs you want to locate, then accept your changes.
6. Complete the remainder of the property sheet. 7. Select OK to accept your changes.
The ExtractBlobs function inserts a Blobs structure in the spreadsheet (see Figure 8-4), along with the Vision Data Access function GetNFound:
GetNFound Returns the number of Blobs found.
Figure 8-4. ExtractBlobs Function Inserted in Spreadsheet
NOTE: You can configure ExtractBlobs to return more detailed data about each of the Blobs it extracts by entering a value for Number to Sort in the property sheet.
Lesson: Finding Connected Regions Using FindBlobs
To insert a FindBlobs function into the spreadsheet:
1. In the spreadsheet, verify that a Blobs structure containing the ExtractBlobs function is present.
2. In column A, select a cell in an empty row that also has one empty row immediately above and below for each Blob you expect to report. For example, if you expect five Blobs, you would insert FindBlobs into a cell with one empty row immediately above and five empty rows immediately below.
3. Open the formula editor.
4. Under Vision Processing, select FindBlobs from the Blob subcategory to open the FindBlobs property sheet.
Getting Started with In-Sight
46
5. Highlight the Blobs parameter value, and switch to Cell Selection mode. Select the cell containing the Blobs structure (see Figure 8-5).
Figure 8-5. FindBlobs Property Sheet
NOTE: The cell you select in the spreadsheet will provide the source Blob data for the FindBlobs function.
6. Complete the property sheet by specifying the number of Blobs to find. 7. Select OK to accept your changes.
The FindBlobs function inserts a Blobs structure in the spreadsheet (see Figure 8-6), plus several Vision Data Access functions that return data describing each Blob found. The most significant of these functions are these:
GetRow Returns the row centroid (Row).
GetCol Returns the column centroid (Col).
GetAngle Returns the Blob angle (Angle).
GetScore Returns the magnitude of the match (Score).
NOTE: Our objective in this lesson is simply to find Blob objects. We are not concerned about Blob Color, Area, Elongation, Perimeter, or Spread at this point.
Figure 8-6. FindBlobs Function Inserted in Spreadsheet
Lesson: Finding Connected Regions Using SortBlobs
To insert a SortBlobs function into the spreadsheet:
1. In column A, select a cell in an empty row that also has one empty row immediately above and below for each Blob you expect to report. For example, if you expect five Blobs, you would insert FindBlobs into a cell with one empty row immediately above and five empty rows immediately below.
2. Open the formula editor.
3. Under Vision Processing, select SortBlobs from the Blob subcategory to open the SortBlobs property sheet.
Getting Started with In-Sight
48
5. Select the Blobs structure cell containing the ExtractBlobs function (see Figure 8-7).
Figure 8-7. SortBlobs Property Sheet
6. Complete the remainder of the property sheet by specifying how many Blobs to report, and the sorting method.
8. The SortBlobs function inserts a Blobs structure in the spreadsheet (see Figure 8-8), plus several Vision Data Access functions that return data describing the sorted Blobs:
GetRow Returns the row centroid (Row).
GetCol Returns the column centroid (Col).
GetAngle Returns the Blob angle (Angle).
GetScore Returns the magnitude of the match (Score).
Figure 8-8. SortBlobs Function Inserted in Spreadsheet
Finding Edges
Edges are places in the image where the brightness changes abruptly from dark-to-light or light-to-dark. Edges found by In-Sight are referred to as“line segments,”and can be straight or curved, or can form a complete circle.
The In-Sight interface provides a variety of functions for locating straight and curved edges:
FindLine Finds a single straight line segment.
FindSegment Finds a pair of straight line segments. FindMultiLine Finds multiple straight line segments.
Getting Started with In-Sight
50
Lesson: Finding Edges Using FindLine
To insert a FindLine function into the spreadsheet:1. In column A, select a cell in an empty row that also has an empty row immediately above. 2. Open the formula editor.
3. Under Vision Processing, select FindLine from the Edge subcategory to open the FindLine property sheet (see Figure 8-9).
Figure 8-9. FindLine Property Sheet
4. Expand the Region group. Highlight the X parameter value and switch to Interactive Graphics mode.
5. Position the region so that the Y axis is perpendicular to the edge to be located, then accept your changes. An example is shown in Figure 8-10.
Figure 8-10. Defining a FindLine Region
NOTE: The FindLine region box has two direction arrows, one initially pointing down and the other pointing right. The arrow pointing down is on the X axis, and the arrow pointing right is on the Y axis. Scanning for straight edges o ccurs in the direction indicated by the arrow on the region’s Y axis.
6. Adjust the remaining parameters as necessary.
NOTE: When parameters in the FindLine property sheet refer to black-to-white or white-to-black polarity, they are referring to brightness transitions occurring in the scan direction.
Getting Started with In-Sight
52
The FindLine function inserts an Edges structure in the spreadsheet (see Figure 8-11), along with several Vision Data Access functions that return data about the edge segment found:
GetRow Returns the starting and ending row coordinates (Row0 and Row1).
GetCol Returns the starting and ending column coordinates (Col0 and Col1).
GetScore Returns the magnitude of the edge peak (Score).
NOTE: The reported score is positive when the FindLine region is oriented to scan from dark to bright features, and negative when scanning from bright to dark features.
Lesson: Finding Edges Using FindSegment
The FindSegment function is similar to FindLine, but instead of finding and reporting a single straight edge, FindSegment locates a pair of edges and computes the distance between them. You configure the FindSegment function in the same way as the FindLine function. Figure 8-12 gives an example of the FindSegment property sheet.
Getting Started with In-Sight
54
The FindSegment function inserts an Edges structure in the spreadsheet (see Figure 8-13), along with two additional Vision Data Access functions:
PairDistance Returns the distance between the two edge segments (Distance). GetScore Returns the average magnitude of the two edge peaks (Score).
Figure 8-13. FindSegment Function Inserted in Spreadsheet
Lesson: Finding Edges Using FindMultiLine
The FindMultiLine function is also similar to FindLine, but instead locates multiple straight edges. Edges found by FindMultiLine can be sorted into edge pairs, and their statistics computed. The lessons that follow discuss functions you can use to pair edges and compute edge pair statistics.