HexSight 3.2 Basics User Guide Rev. A

HexSight 3.2 Basics User Guide Rev. A
Adept HexSight
Version 3.2
HexSight Basics
User Guide
0803-HS32MU01A
Rev. C
Copyright
Copyright 1999-2004 by Adept Technology Canada Co. All Rights Reserved. No part of
this publication may be reproduced or transmitted in any form without the written
permission of Adept Technology Canada Co.
Notice: Effects of Software License Agreement
The license agreement included in the HexSight software package specifies how you
may use the product. Any unauthorized duplication of HexSight, including this document,
is strictly prohibited and violates the Software License Agreement.
Notice
Adept Technology Canada Co. shall not be responsible for any errors that may appear in
this document and shall not be liable for any damages arising out of or related to this
document or the information contained in it, even if Adept Technology Canada Co. has
been advised of the possibility of such damages.
Trademark Information
HexSight is a trademark of Adept Technology Canada Co.
The following are trademarks or registered trademarks of the associated company:
ActiveX, COM, Developer Studio, DirectShow, MFC, Notepad, Visual Basic, Visual C++,
Windows Bitmap, Windows NT, XP and 2000, HTML Help: Microsoft Corporation
Acrobat Reader, PDF: Adobe Systems Incorporated
Apple Computer, Inc.: FireWire
DepictMaster4X1: Opteon Corporation
DT-3152, DT-3155, DT-3157: Data Translation, Inc.
IC-ASYNC, PC-DIG, PCVision, ITEX, IFC: Coreco Imaging, Inc.
Meteor-II/Digital, Meteor-II/Multi-Channel, Meteor-II/Standard, Orion, MIL-Lite: Matrox
Electronic Systems Ltd.
PX610A, PXC200: Imagenation Corporation
Pentium, MMX: Intel Corporation
VPP: MRT micro, Inc.
Corporate Information
Adept Technology Canada Co.
1020 Route de l'Eglise
Suite 200
Sainte-Foy QC G1V 3V9
Canada
Printed in Canada
Phone 418.657.500
Internet: http://www.adept.com
General information:
[email protected]
Technical support:
[email protected]
Table of Contents
Table of Contents
Table of Contents
i
Conventions Used in this Document
ix
Installing HexSight
1
Contents of your HexSight Kit
2
System Requirements
3
Hardware Requirements
3
Software Requirements
4
Installing HexSight Software
5
Before Installing HexSight
5
Installing HexSight
6
Uninstalling HexSight
6
Installing Frame Grabbers
8
Installing a Data Translation Frame Grabber
8
Getting Started
11
What is HexSight?
12
Basic HexSight Terminology
12
What is a HexSight Application?
15
Adding a Component to the Toolbox
20
Referencing a Control
21
Graphical Interface Elements
22
Command Buttons
23
Getting Help
24
Online Help
24
HexSight Technical Support
25
Project Examples Provided with HexSight
26
Demonstration Mode
30
Opening and Running in Demo Mode
30
Demo Mode Limitations
30
HexSight Basics User Guide
i
Table of Contents
Using the Demo Mode with the Tutorial
31
Visual Basic Tutorials
33
Tutorial 1: Locator
34
Introduction
34
Creating the Main Form
34
Adding an Acquisition Device Tool
38
Viewing Scenes and Images
41
Adding a Locator Tool
42
Tutorial 2: Display
57
Introduction
57
Adding the Display to the Interface
57
Tutorial 3: Caliper
61
Introduction
61
Modifying your Application Form
61
Placing the Caliper
61
Configuring the Caliper
64
Caliper Results
67
Adding Code for the Caliper
67
Adding a Second Caliper
69
Tutorial 4: Blob Analyzer
71
Introduction
71
Modifying your Application Form
71
Placing the Blob Analyzer
72
Configuring the Blob Analyzer
73
Blob Analyzer Results
75
Adding Code for the Blob Analyzer
76
Tutorial 5: Pattern Locator
79
Introduction
79
Modifying your Application Form
79
Placing the Pattern Locator
79
Placing the Pattern Rectangle
81
Configuring the Pattern Locator
82
Pattern Locator Results
83
HexSight Basics User Guide
ii
Table of Contents
Adding Code for the Pattern Locator
84
Tutorial 6: Edge Locator
86
Introduction
86
Modifying your Application Form
86
Placing the Edge Locator
86
Configuring the Edge Locator
88
Edge Locator Results
91
Placing the Second Edge Locator
92
Adding Code for the Edge Locator
93
Tutorial 7: Calibration
96
Introduction
96
Camera Calibration
96
Visual C++ Tutorials
99
Tutorial 1: Locator
100
Introduction
100
Creating the Project
100
Adding an Acquisition Device Tool
110
Viewing Scenes and Images
113
Adding a Locator Tool
114
Tutorial 2: Display
131
Introduction
131
Adding the Display to the Interface
131
Adding Code for the Display
132
Tutorial 3: Caliper
135
Introduction
135
Modifying your Application Dialog
135
Placing the Caliper
136
Configuring the Caliper
138
Caliper Results
140
Adding Code for the Caliper
141
Adding a Second Caliper
143
HexSight Basics User Guide
iii
Table of Contents
Tutorial 4: Blob Analyzer
144
Introduction
144
Modifying your Application Form
144
Placing the Blob Analyzer
145
Configuring the Blob Analyzer
146
Blob Analyzer Results
148
Adding Code for the Blob Analyzer
149
Tutorial 5: Pattern Locator
153
Introduction
153
Modifying your Application Form
153
Placing the Pattern Locator
154
Placing the Pattern Rectangle
156
Configuring the Pattern Locator
157
Pattern Locator Results
157
Adding Code for the Pattern Locator
158
Tutorial 6: Edge Locator
161
Introduction
161
Modifying your Application Form
161
Placing the Edge Locator
162
Configuring the Edge Locator
164
Edge Locator Results
166
Placing the Second Edge Locator
167
Adding Code for the Edge Locator
168
Tutorial 7: Calibration
171
Introduction
171
Camera Calibration
171
HexSight Basics User Guide
iv
Table of Contents
Using HexSight Displays
175
Introduction to HexSight Displays
176
Elements of HexSight Displays
178
Coordinate Systems
183
Right-Handed vs. Left-Handed Coordinate Systems
184
Relationship between Coordinate Systems
186
World Coordinate System
187
Image Coordinate System
188
Object Coordinate System
188
Tool Coordinate System
189
Unit and Angle Conversions
191
Application Control
193
Accessing the Application Control
194
Visual Basic
194
Visual C++
194
Using the Application Control
195
Process Manager
195
Explorer
202
Application Control Properties
208
General Application Control Properties
208
Process Manager Properties
209
Explorer Properties
210
Acquisition Device
213
Understanding Acquisition Device Concepts
214
Image Acquisition
214
Image Calibration
218
Acquisition Device Output
223
Using the Acquisition Device
224
General Panel
224
Configuration Panel
224
HexSight Basics User Guide
v
Table of Contents
Input Sub-Panel
228
Calibration Sub-Panel
289
Output Sub-Panel
311
Results Panel
312
Locator
313
Understanding Locator Concepts
314
Definitions
314
Input and Output
315
Models
315
Model Creation and Edition
319
Model Optimization
337
Search Process
341
Learn Process
342
Improving Search Performance
358
Locator Results
363
Troubleshooting
370
Using the Locator
371
General Panel
371
Contour Panel
374
Model Panel
380
Using the Model Editor
385
Using the Model Optimizer
398
Search Panel
403
Results Panel
409
Inspection Tools
415
List and Description of HexSight Tools
416
Inspection Tool Basics
419
Rectangle Characteristics
419
Sector Characteristics
422
Tool Positioning Modes
423
Sampling
433
HexSight Basics User Guide
vi
Table of Contents
Using Inspection Tools
436
Basic Method
436
General Panel
437
Location Panel
439
Transform Panel
442
Configuration Panel
444
Results Panel
444
Class Library
445
Relationship Between Database Objects
446
Visual Basic Example
447
Visual C++ Example
449
Index
451
HexSight Basics User Guide
vii
Conventions Used in this Docu-
Conventions Used in this
Document
Bold
User interface elements: E.g. command
buttons
Keywords such as tool names, process names
Keys and keyboard combinations
Capitalized Terms
Specific terms as they apply to HexSight
applications
E.g. “View” as opposed to the common use
sense of “view”
Italics
Typed user entries
Emphasis and special notes to the reader
Bold italics
Designates a specific Book, Chapter,
Section...
Courier typeface
Visual Basic code
Visual C++ code
Enumeration of coded properties & methods
One character
underline
Menu options, pull-down menus, menu paths
E.g. Format>Font means select Font from the
Format menu
HexSight Basics User Guide
ix
Installing HexSight
Installing HexSight
This chapter presents information required for installing HexSight.
Chapter Outline
Contents of your HexSight Kit
System Requirements
Hardware Requirements
Software Requirements
Installing HexSight Software
Before Installing HexSight
Installing HexSight
Uninstalling HexSight
Installing Frame Grabbers
Installing a Data Translation Frame Grabber
Installing an Imagenation Frame Grabber
Installing a Coreco Imaging Frame Grabber
Installing a Matrox Frame Grabber
Installing an MRT Frame Grabber
Installing an Opteon Controller Board
Installing a DirectShow Device
HexSight Basics User Guide
1
Installing HexSight
Contents of your HexSight Kit
Ensure that your HexSight kit is complete. It should contain the following
items:
1.
Installation CD
2.
One hardware key (dongle)
3.
The HexSight Basics User Guide, printed version
4.
One software license agreement
5.
Sample calibration targets
6.
Sample paper hook (used for Tutorial)
Note: The HexSight documentation set is comprised of the Reference
Manual and two User Guides: HexSight Basics and HexSight Tools.
These manuals are in PDF format and can be installed from the
HexSight installation CD. The manuals are also contained in the
online HexSight HTML Help. Online help is context sensitive from the
interface of the Visual Basic or C++ code editor.
HexSight Basics User Guide
2
Installing HexSight
System Requirements
To run HexSight on your computer, the following hardware and software
are required.
Hardware Requirements
Processor: Pentium II or higher
Hard Drive space: From 15 MB to 200 MB depending on selected
components
Memory (RAM): 128 MB
PCI frame grabber board. HexSight 3.2 supports the following frame
grabbers:
• Coreco Imaging IC-ASYNC
• Coreco Imaging PC-DIG
• Coreco Imaging PCVision
• Data Translation DT-3152
• Data Translation DT-3155
• Data Translation DT-3157
• Imagenation PX610A
• Imagenation PCX200
• Matrox Meteor-II/Standard
• Matrox Meteor-II/Multi-Channel
• Matrox Meteor-II/Digital
• Matrox Orion
• MRT micro VPP (PCMCIA)
• Opteon DepictMaster 4X1
HexSight Basics User Guide
3
Installing HexSight
Display: Minimum resolution: 1024 x 768 pixels. Colors: 65,536
CCD Camera: Refer to the frame grabber documentation.
Software Requirements
Operating system: Windows 2000, Windows XP or Windows NT 4.0 with
Service Pack 5.0 or later.
Visual Basic 6.0 or higher, or Visual C++ 6.0 or higher.
Adobe Acrobat Reader 3.01 or higher and Internet Explorer 4.01 or higher
are recommended to respectively access pdf format documentation and
online HexSight Help.
HexSight Basics User Guide
4
Installing HexSight
Installing HexSight Software
The following three sections describe pre-installation steps as well as the
Install/Uninstall procedures.
Before Installing HexSight
1.
2.
Ensure that your system meets the minimum system requirements as
specified in the previous section.
Install the frame grabbers you intend to use, as well as their respective
original driver. See the specific section at the end of this chapter for the
frame grabbers you intend to use: Installing a Data Translation
Frame Grabber, Installing an Imagenation Frame Grabber,
Installing a Coreco Imaging Frame Grabber, Installing a Matrox
Frame Grabber, Installing an MRT Frame Grabber, Installing an
Opteon Controller Board, Installing a DirectShow Device.
3.
Install the hardware key provided with HexSight in the parallel port of
your PC before installing HexSight. Without the hardware key, you will
operate in Demonstration Mode (see the Getting Started chapter of
this User Guide).
4.
Visual Basic 5.0 or higher or Visual C++ 5.0 or higher must be installed
on your PC before installing HexSight. Note that only Visual Basic 6.0
currently supports the online HexSight Help. If you use Visual Basic
5.0 or Visual C++, you will have to rely on HexSight printed
documentation, use Acrobat Reader to access the PDF documentation or
directly browse the HTML help file: HexSightHelp.chm.
5.
Ensure that you have Administrator privileges on your PC. You must
have permission to write to the necessary system registry sections.
6.
Close any other open applications.
HexSight Basics User Guide
5
Installing HexSight
Installing HexSight
1.
If you have an older version of HexSight installed on your system, you
must first uninstall this version before installing the new one. See the
Uninstalling HexSight section for more details.
2.
Insert the HexSight CD in the CD-ROM drive. Autorun begins the
installation process as soon as you insert the CD.
3.
4.
When the Welcome screen is displayed, choose Next.
You are requested to provide a destination folder. If you want to install
HexSight in the suggested folder, click Next. Otherwise, click Browse,
enter or select the correct installation folder, click OK then Next.
5.
The HexSight setup offers a choice of three setup types:
• Typical: Includes all HexSight components and files.
• Compact: Includes all HexSight components and files except
Tutorial and Examples.
• Custom: Lets you choose among all HexSight components.
6.
If you chose the Custom setup, you are prompted to select which
components will be installed.
7.
The program proceeds with the HexSight installation.
8.
The installation is now complete. Before using HexSight, you must
reboot your computer as suggested by the HexSight setup program.
To verify if HexSight was successfully installed on your computer, we
encourage you to open and try the first part of the Visual Basic Tutorial,
found in the Tutorial\VisualBasic\HookInpection\Part1 folder on the
selected installation path.
Uninstalling HexSight
1.
In the Control Panel of your computer, double-click Add/Remove
Programs. In the Install/Uninstall sub-panel, click HexSight in the list
of programs.
HexSight Basics User Guide
6
Installing HexSight
2.
Click Add/Remove.... Click Yes in the Confirm File Deletion prompt
that appears. Close the Add/Remove Programs Properties window by
clicking OK.
HexSight Basics User Guide
7
Installing HexSight
Installing Frame Grabbers
The following section provides installation information for frame grabbers
that are supported by HexSight. Note that you must first install the original
driver for the frame grabber then apply specific requirements, if any, as
described in the following sections. Once properly installed, supported
frame grabbers can be configured either programmatically or through the
HexSight user interface.
The Acquisition Device chapter in both the HexSight Basics User
Guide and Reference Manual provide information for configuring frame
grabber parameters.
Installing a Data Translation Frame Grabber
The interface DLLs needed to connect to the frame grabber driver are
installed with HexSight. No specific installation procedure is required.
Installing an Imagenation Frame Grabber
In order to connect to a Imagenation frame grabber driver, you will need to
copy the following interface DLL files from their installation directory (bin
subfolder of the installation path) to the Windows system path (the
$(windows)\system32 subdirectory).
• PX610A: WPX5_NT.DLL
• PCX200: FRAME_32.DLL, PXC_NT.DLL, PXC2_NT.DLL
Installing a Coreco Imaging Frame Grabber
To configure a Coreco Imaging frame grabber, HexSight uses configuration
files built with the appropriate Coreco Imaging configuration application.
These configuration applications include the device drivers for the frame
grabber:
• IC-ASYNC: ITEX Camera Configurator, provided with the ITEX
Library SDK (Version 4.1 or higher)
HexSight Basics User Guide
8
Installing HexSight
• PCVision: ITEX Camera Configurator, provided with the ITEX
Library SDK (Version 4.1 or higher)
• PC-DIG: IFC Camera Configurator, provided with the IFC Library
SDK (Version 5.0 or higher)
Itex and IFC software is not provided with the frame grabber and must be
purchased separately from Coreco Imaging. In accordance with the Coreco
Imaging license agreement, you can however redistribute the device
drivers and configuration files as long as you include a frame grabber with
your application, so only one copy of the software is required for the
development system.
Installing a Matrox Frame Grabber
To configure the frame grabber, HexSight uses configuration files built with
the Intellicam application provided with MIL-Lite (Version 6.1 or higher),
which also includes the device drivers for the frame grabber.
MIL-Lite is not provided with the frame grabber and must be purchased
separately from Matrox. In accordance with the Matrox license agreement,
you can however redistribute the device drivers and configuration files as
long as you include a frame grabber with your application, so only one copy
of MIL-Lite is required for the development system.
Installing an MRT Frame Grabber
To configure the frame grabber, HexSight needs configuration files built
manually or programmatically using the MRT Imaging Card SDK. No other
installation procedure is required.
Installing an Opteon Controller Board
The interface DLL to needed connect to the controller board driver is
installed with HexSight. No specific installation procedure is required.
HexSight Basics User Guide
9
Installing HexSight
Installing a DirectShow Device
Any IEEE 1394 camera with a DirectShow driver is supported. All
DirectShow standard parameters are accessible programmatically. No
specific installation procedure is required.
HexSight Basics User Guide
10
Getting Started
Getting Star ted
This chapter introduces basic concepts and procedures you will need to use
HexSight vision software.
Chapter Outline
What is HexSight?
Basic HexSight Terminology
What is a HexSight Application?
Adding a Component to the Toolbox
Referencing a Control
Graphical Interface Elements
Getting Help
Project Examples Provided with HexSight
Demonstration Mode
HexSight Basics User Guide
11
Getting Started
W hat is HexSight?
Traditional vision systems use grey-scale correlation to find and locate part
features made up of arrays of light and dark pixels. Typically, parts must be
presented to the camera within a small range of acceptable locations and
with minimal rotation or scale change. In addition, lighting uniformity and
camera position must be tightly controlled.
HexSight uses the geometry of parts to quickly locate them in a twodimensional field of view. HexSight algorithms find the contours of parts in
the image, and quickly identify each part's position and orientation. This
information can be sent to a robot or machine controller to guide part
handling. In addition, the vision system can automatically apply standard
inspection tools to the part in its “as found” location.
HexSight is a set of custom ActiveX controls that are used for the
development of machine vision applications. Machine vision applications
can be programmed quickly using the HexSight toolset within a Visual
Basic or Visual C++ development environment. In this chapter, Visual Basic
examples are used to present HexSight software.
Basic HexSight Terminology
Specific terms are used in the User Guide and the Reference Manual to
describe the functioning of HexSight ActiveX controls. The most important
terms, fundamental to HexSight applications, are defined below.
Configuration: A configuration is a set of HexSight tool instances
and the configured properties of each tool. Configuration files are
saved to the HexSight cfg format. In the Acquisition Device, a
Configuration is a set of parameters for a given input source.
Database: A collection of Views, which can contain any number of
database objects: Scenes, Images and Entities. The runtime
HexSight Basics User Guide
12
Getting Started
database acts as a database exchange container for the HexSight
processes.
Disambiguate: As applied to object location, disambiguation
means to resolve the ambiguity between many possible solutions
by using one or more distinguishing characteristics or features of
an object.
Entity: An object that is created and used by HexSight Finder
tools. Basic entities are Points, Lines and Arcs. These entities can
be saved to proprietary file formats and accessed through the Class
Library. See HexSight File Formats.
Image: A matrix of pixels, typically grey-scale, that represents an
object’s 2D appearance.
Input: Data used by the process algorithm to compute a result,
which can be an Image, a Scene, or a set of numeric values.
HexSight Basics User Guide
13
Getting Started
View provided by the
Acquisition Device
Model View
containing an Image and a Scene
Scenes
Entities
FIGURE 1
GUI Representation of a HexSight Runtime Database
Instance: A representation, such as a Model or a HexSight Process
type.
Instantiate: To actualize an abstract representation by defining a
particular configuration of the process, giving it a name, and
including it in the process list. For instance, a process can be
instantiated.
Model: A Model is a representation of an object, based on the
geometry of its contours. An object Model is the reference used to
identify and locate instances of objects of the same type.
Output: Data generated by the process algorithm, e.g. an Image,
a Scene, an Entity or a set of numeric values.
Properties: The characteristics of an object.
HexSight Basics User Guide
14
Getting Started
Scene: A vectorized description of an object’s contours, as
opposed to an Image, which is made up of pixels.
View: A collection of Scenes, Images and Entities. By analogy, one
could say that a View is a folder that can contain Scenes, Images or
Entities. Figure 1 displays an example of a HexSight Database. In
this specific example the Views are named Acquisition, Model,
Locator, Finder and Builder.
HexSight File Formats
The following file formats are used by HexSight:
• HexSight Views (.hvw) save all information in a View folder
including Images, Scenes and Entities.
• Bitmap Images (.bmp)
• HexSight Images (.hig)
• HexSight Scenes (.hsc)
• HexSight Points (.hpt)
• HexSight Lines(.hln)
• HexSight Arcs (.hac)
• HexSight Configuration(.cfg)
• HexSight Calibration (.cal) files contain calibration information.
• HexSight Database (.hdb)
• HexSight Frame Grabber (.fgp) files contain frame grabber
parameters.
What is a HexSight Application?
A HexSight application is composed of a sequence of processes, which can
also be visualized as modules, each having its own function or purpose.
Each of the processes exchange data through the runtime database. A
HexSight Basics User Guide
15
Getting Started
typical HexSight application contains at least the following two processes:
the Acquisition Device tool and the Locator tool.
These processes perform the following basic operations:
1.
2.
The Acquisition Device acquires an image of the work surface.
Acquired images can be calibrated within the Acquisition Device
interface.
The Locator tool generates a vectorized Contour Scene from the
Images provided by the Acquisition Device. The Locator finds and
locates, in the Contour Scene, all occurrences of objects of defined in
the Model database. Models are created and edited in the Locator
interface.
Inspection tools such as the Caliper can be added to these two basic
processes depending on the task to be performed.
A typical HexSight application is created by placing a HexSight Application
control on a blank Visual Basic form, as shown in Figure 2. The steps
required to complete such a task are:
1.
Click on the HexSight Application control icon in the Visual Basic toolbox
and use the mouse to place this control on a blank form. If the icon is
not available in the toolbox, see Adding a Component to the Toolbox
for more details.
2.
Drag a square with the mouse on the form and release the left mouse
button to place the HexSight Application Control.
3.
Right-click the HexSight Application Control in the form and select Edit
to display the Process Manager as shown in Figure 3. The Process
Manager is used to instantiate and configure the sequence of processes.
HexSight Basics User Guide
16
Getting Started
Application
Control icon
Right-click
drop-down menu
Click Edit to open
Application Control
properties window
FIGURE 2
Application Control Placed in a Visual Basic Form
The Process Manager interface contains two lists:
• Available Processes, which lists all HexSight process types and
• Instantiated Processes, which contains the names of the
processes used in the current application.
Processes
used by the
current
application
Available
HexSight
processes
FIGURE 3
Process Manager
HexSight Basics User Guide
17
Getting Started
Command buttons enable you to save the configuration of the current
application, modify the list of instantiated processes in the application, and
execute the instantiated processes.
The following list provides a short description of the available processes,
grouped by type.
Acquisition Tools
Acquisition Device: The Acquisition Device acquires grey-scale
Images from a frame grabber or from a database of images.
Locator Tools
Locator: The Locator tool generates vectorized Contour Scenes
from the acquired Images. It finds and locates instances of objects
for which models are present in the Model database. Models are
created using the integrated Editor and saved to HexSight database
files. The Locator provides the scale factor, orientation, and position
for each located instance.
Arc Finder: The Arc Finder finds and locates circular features on
objects and returns the coordinates of the center of the arc, the
start and end angles, and the radius.
Line Finder: The Line Finder finds and locates linear features on
objects and returns the line angle and point coordinates.
Point Finder: The Point Finder finds and locates point features on
objects and returns the angle as well as the coordinates of the
found point.
Builder: The Builder creates geometric entities such as points,
lines or arcs from user-defined parameters or by combining other
geometric entities.
HexSight Basics User Guide
18
Getting Started
Image Processing Tools
Image Processing Tool: The Image Processing Tool processes
grey-scale images by applying arithmetic, assignment, logical,
filtering, morphological or histogram operators. Users can define
custom filtering operators.
Image Sharpness Tool: The Image Sharpness Tool computes the
sharpness of preponderant edges in a user-defined region of
interest.
Image Histogram Tool: The Image Histogram tool computes
greylevel statistics within a user-defined region of interest.
Sampling Tool: The sampling tool is used to extract a section of a
grey-scale Image and output it as a separate Image. The sampling
tool can be configured to operate as model-based. It can be used
by a HexSight application to apply a custom grey-scale processing
on a region of interest on an object.
Inspection Tools
Edge Locator: The Edge Locator finds and locates an edge or a set
of edges that meet user-defined criteria.
Arc Edge Locator: The Edge Locator finds and locates an edge or
a set of edges in an arc- or circular-shaped area.
Caliper: The Caliper finds and locates one or more edge pairs and
measures distances between the two edges within each pair.
Arc Caliper: The Arc Caliper finds and locates one or more edge
pairs on an arc or circular shaped area and measures distances
between the two edges within each pair.
Pattern Locator: The Pattern Locator finds and locates instances
of a greyscale pattern occurring within an Image. Pattern images
are provided by the HexSight Locator control.
HexSight Basics User Guide
19
Getting Started
Blob Analyzer: The Blob Analyzer finds and locates blobs within a
defined area on an Image and returns various results for each blob.
Symbology Tools (optional)
Barcode Reader: The Barcode Reader reads and extracts
information from 1D symbologies commonly known as bar codes.
Data Matrix Reader: The Data Matrix Reader reads and extracts
information from 2D symbologies commonly known as data
matrixes.
OCR Fixed Font: The OCR Fixed Font tool recognizes and reads
fixed-font character strings.
Adding a Component to the Toolbox
To interactively modify the content of a HexSight application, you must
paste a HexSight Application control on a Visual Basic form. This way, you
can access the Process Manager and the Explorer interfaces either at
design time or in runtime.
You will find it useful to add at least one HexSight Display control to the
Visual Basic form. This will allow you to visualize results in runtime mode.
To add a control to the Visual Basic toolbox:
1.
2.
Select Project>Components the Visual Basic main menu. This will
open the Components selection window. See Figure 4.
Select all required controls from the list of available controls and click
OK.
Note: In a Visual Basic program a variable cannot be declared as a
given HexSight control type if it is declared as a component.
Nevertheless, any object created by pasting a control (selected as a
component) on a Visual Basic form can be accessed programmatically
using the name of the object.
The following HexSight control types should be used as components:
HexSight Basics User Guide
20
Getting Started
• Application control
• Display control
Components
selection
window
Toolbox
FIGURE 4
Addition of a Component to the Visual Basic Toolbox
Referencing a Control
To create HexSight objects programmatically, all HexSight control types
used in the user’s Visual Basic program must be referenced. This is
accomplished the following way:
1.
2.
Select Project>References from the Visual Basic main menu.
Select all the HexSight control types to be used in the program except
those used as components (see previous section) and click OK.
Note: A HexSight control cannot be declared as a component and as
a reference at the same time.
HexSight Basics User Guide
21
Getting Started
Graphical Interface Elements
Most of graphical interface elements that are often referred to in the User
Guide are illustrated in Figure 5.
Panel (tab-selected)
Frame
Spin-edit box
Slider
Text box
Selection icon
Selected View
Selected Image
Thumbnail
Command buttons
FIGURE 5
Illustration of Some Graphical Interface Elements
HexSight Basics User Guide
22
Getting Started
Command Buttons
All properties windows for HexSight processes contain the same set of
command buttons. The purpose of these buttons is described below:
• Apply: Registers changes made to the parameters.
• Reset: Resets the parameters to the configuration obtained
after the last Apply, OK or Execute.
• Default: Resets all parameters to their original configuration
when properties window was first opened.
• Execute: Saves the latest changes of parameters and executes
the process.
• OK: Saves the latest modifications made to the parameters of
the process and closes the process interface window.
• Cancel: Cancels all modifications made to the parameters of the
process since the last Apply, OK or Execute and closes the
properties window.
HexSight Basics User Guide
23
Getting Started
Getting Help
This section explains how to access the HexSight online help as well as
HexSight customer support service.
Online Help
The HexSight toolset is provided with online help. HexSight Help contains
both the Reference Manual and the User Guide.
There are four ways to access this system:
1.
2.
Click on a HexSight control icon, either in the Visual Basic toolbox or on
one of the forms of the application, then press F1.
Place the cursor of the Visual Basic Editor in the middle of a string that
corresponds to a HexSight control type, property, method or event, then
press F1. This second strategy will work if the icon of the control
appears on the toolbox or if the control is referenced. A short code
example, along with contained words that can be used to access
HexSight Help, is shown in Figure 6.
FIGURE 6
Sample Code
The following words, appearing in Figure 6, can be used to open the
HexSight Help window:
HSCaliper
HexSight Basics User Guide
24
Getting Started
ProcessManager
Process
Execute
Edge2Rotation
The words HSApplication1 and MyCaliper cannot be
employed to display the help window because they are names of
control instances as opposed to types. The corresponding types are
HSApplication and HSCaliper.
3.
From the Application Control interface, click the Help command button.
See the Process Manager section in the Application Control
Interface chapter.
4.
In any property window of a HexSight tool, place the cursor on an object
and press F1.
HexSight Technical Support
We provide technical support for our customers via our web page as well as
by telephone.
E-mail Queries:
Send your technical questions by e-mail, directly to our technical
support team at [email protected] Your e-mail queries will
be directed to the appropriately qualified personnel and promptly
answered.
Telephone
• You can contact the HexSight technical support between 9:00
A.M. and 5:00 P.M. EST at 418.657.5000
HexSight Basics User Guide
25
Getting Started
Project Examples Provided with
HexSight
The HexSight CD provides complete examples of machine vision
applications, which to show how to implement specific features such as
automated calibration and model teaching.
Board Location
This application identifies and locates a printed circuit board (PCB).
The application demonstrates how to create a model in which one
big feature is used to locate the object and a second smaller
feature is required to correctly identify the orientation of the
object. A Sampling tool samples the image from a model-based
region on the located boards. This sampled image is used as an
input to a second Locator tool which then checks for the presence
of a small label printed on the PCB.
Bracket Inspection
This application identifies, locates and inspects four different
models of flat brackets. The Blob Analyzer tool finds the center of
mass of each hole on the bracket. Parts are rejected if the position
of any of its holes are not within tolerance ranges.
Calibration Demo
This application shows how to use the
HSCalibrationXYScaleInterface,
HSCalibrationPerspectiveInterface, and
HSCalibrationDistortionInterface objects to implement
automated calibration programmatically, without showing the
interactive user interface.
HexSight Basics User Guide
26
Getting Started
Contour Detection
This application shows how to access the calibrated and
uncalibrated contour data extracted by the Locator from a greyscale image. The application also shows how to use properties of
the extracted contour data such as perimeter and area to manually
detect circular shapes in the image. This can be used, for example,
to detect dots during a custom calibration procedure using a nonstandard target.
Contour Draw Demo
This application shows how to manually draw the detected contours
(model and instance) into a standard Visual Basic or Visual C++
graphics object by directly accessing the contour data generated by
the Locator through the HsScene object.
Image Processing
This application shows how the Image Processing tool can be
used to apply operations such as noise filtering to a grey-scale
image before it is input to the Locator tool.
Locator Demo
This demo provides a ready-built application, useful for testing
HexSight with your own images. This demo also contains
configurations to illustrate Model Optimization and the Shading
consistency feature.
Finder Demo
This demo provides an example of the use of HexSight Finder
Tools: Arc Finder, Line Finder, Point Finder and Builder.
HexSight Basics User Guide
27
Getting Started
Model Demo
This application shows how to use the HSModelEditorInterface
object to implement automated model teaching programmatically,
without showing the interactive user interface.
Pad Inspection
This application identifies and locates brake pads on the work
surface and performs two measurements on each located pad. This
application provides an example of how the Caliper tool can be
used to perform linear measurements.
Part Sort
This application provides the type, position and orientation of parts
of different type, randomly placed on the work surface. Four
different types of flat brackets are used in this application. Multiple
parts can be identified and located at the same time. These parts
do not have to be of the same type. In addition to multi-model
capabilities, this application also illustrates how to configure the
Locator tool for robustness to occlusions.
Pulley Location
This application identifies and locates a pulley on the work surface.
The part has four rotational symmetries for which the Locator tool
provides the possible orientations. An Edge Locator tool is used to
locate the pulley’s keyway to identify the correct orientation. An
Arc Edge Locator is also used to measure the angular position of
the four spokes of the pulley, with respect to its keyway.
Regulator Inspection
This application sorts and inspects electronic parts. The Pattern
Locator tool is used to disambiguate the two models of T0220
regulators that are used. Distances between the legs of each
HexSight Basics User Guide
28
Getting Started
regulator are measured using the Edge Locator tool and part is
rejected if the distance between two legs is not within tolerance
ranges.
Synthetic Model
This application demonstrates the creation of a synthetic model
using drawing functionalities of the HSImage object. Synthetic
models can be useful when you are unable to build an adequate
model from available images; for example when the images are
very degraded because of noise, specular reflections or blurriness.
HexSight Basics User Guide
29
Getting Started
Demonstration Mode
The new HexSight Demonstration Mode is provided for the purpose of
evaluating our software. This mode is automatically enabled when you run
HexSight without the hardware protection key that is provided with the
purchase of a HexSight software package.
This demonstration mode has some features removed, yet will allow you to
evaluate the functionality and power of HexSight 3.2.
Opening and Running in Demo Mode
When you first open HexSight in demo mode, a pop-up window appears,
advising you that the hardware protection key was not found and that the
software will run in the demonstration mode.
The application then pauses for approximately 10 seconds. After this delay,
the application resumes once you click OK.
This reminder pop-up window will appear again at random intervals during
execution; simply click OK and continue your evaluation.
Demo Mode Limitations
In the Demo Mode, the application development capabilities of the
HexSight environment are deactivated.
• You can load and run and examples provided on the HexSight
CD.
• You cannot operate in design mode i.e. you cannot build an
application by selecting and instantiating tools.
• You cannot save a configuration file. You can however open an
existing application.
• Since you cannot run in design mode you cannot fully do the
tutorial. You can, and we suggest that you do, open the Tutorial
HexSight Basics User Guide
30
Getting Started
files provided on the HexSight CD, as explained in the following
section.
Using the Demo Mode with the Tutorial
Even though you cannot use the demo mode to build an application as
explained and illustrated through the VB and C++ tutorials, you can run
any of the applications provided on the HexSight CD, either in the
Examples or the Tutorial folders.
To best familiarize yourself with the functionalities of HexSight 3.2 we
recommend that you start out with the tutorial application, as follows:
• Open the final application provided for the tutorial either in
Visual Basic or Visual C++, respectively:
HexSight/Tutorial/VisualC++/HookInspection/Part6/
HookInspection.cpp
or
HexSight/ Tutorial/VisualBasic/HookInspection/Part6/
HookInspection.vbp
• Run the application then, in the Hook Inspection interface, click
the Inspect button to launch a first execution. See Figure 7.
HexSight Basics User Guide
31
Getting Started
FIGURE 7
Hook Inspection Interface
HexSight Basics User Guide
32
Visual Basic Tutorials
Visual Basic Tutorials
The tutorials in this chapter will guide you through the development of a
HexSight application in Visual Basic. As you follow the steps for each
tutorial you will build an object location application to which you will add
and configure a full range of inspection tools.
Note: This tutorial presumes you have a basic beginner’s knowledge
of Visual Basic.
Chapter Outline
Tutorial 1: Locator
Tutorial 2: Display
Tutorial 3: Caliper
Tutorial 4: Blob Analyzer
Tutorial 5: Pattern Locator
Tutorial 6: Edge Locator
Tutorial 7: Calibration
HexSight Basics User Guide
33
Visual Basic Tutorials
Tutorial 1: Locator
Introduction
This first tutorial shows you how to build a basic HexSight application that
will locate a model-defined object at whatever angle and displacement it
appears.
Creating the Main Form
In this section, you will create the Main Form of the application, add basic
lines of code to interact with the interface, and add a HexSight Application
Control, which you will edit to build the application.
Constructing the Main Form Interface
Here you will build the interface that will allow you to interact with
your application and visualize results.
1.
Start Visual Basic. Open a new Standard EXE project. Save form
as HookInspectionMainForm.frm, and project as
HookInspection.vbp in your working directory.
2.
Make the toolbox and the properties window visible, using the View
menu.
3.
Enable the Require Variable Declaration check box in the Editor
tab of the Tools>Options... window.
4.
Set the form name to HookInspectionMainForm and the form
caption to Hook Inspection. Set the BorderStyle property to
Fixed Single, the ClipControls property to False and the MinButton
property to True. Set the width to approximately 5150 and the
height to 4000.
5.
On the form, add a frame named InstanceFrame. Add 5 text
boxes respectively named TypeText, ScaleText, RotationText,
TranslationXText and TranslationYText. Also set the frame
caption, the text box dimensions and add labels. The text property
HexSight Basics User Guide
34
Visual Basic Tutorials
for the text boxes should be empty. Your form should look like the
form in Figure 8.
FIGURE 8
6.
Visual Basic Form with Object Pose Information
At the bottom of the form, add 3 command buttons named
InspectButton, ConfigureButton and QuitButton. Set the
caption of these buttons respectively to: Inspect, Configure and
Quit.
FIGURE 9
Visual Basic Form with Command Buttons
HexSight Basics User Guide
35
Visual Basic Tutorials
7.
Add a check box named ContinuousCheck, and set its caption to
Continuous Mode. Finally, add a text box named TimeText and
an appropriate label. Place everything to look like the form in
Figure 9. The interface is almost complete. Save your work.
Adding a HexSight Application Control
You will now add a new component to the Visual Basic toolbox: the
HexSight Application Control, which is the core of each HexSight
machine vision application.
1.
From the Visual Basic menu bar, select: Project>Components...
Scroll down to find HexSight Application Control. Enable its
check box and click OK. The HexSight Application Control appears
as a new lens shutter icon in the Visual Basic toolbox.
2.
Click the HexSight Application Control icon and drag a small
box on the form with your cursor. The default name of this control
is HSApplication1. In the Properties window change its name to
ApplicationControl. The interface of the project is now complete.
Save your work. You will configure the HexSight Application
Control in subsequent tutorials.
FIGURE 10
Visual Basic Form with a HexSight Application Control
HexSight Basics User Guide
36
Visual Basic Tutorials
Adding Basic Code to the Main Form
You need to add basic code to be able to interact with your
application. As you will add new features throughout the other
tutorial sections, you will also add lines to this code.
1.
Double-click Quit and add the line of code indicated in bold:
Private Sub QuitButton_Click()
End
End Sub
This will terminate the application when the Quit button is clicked.
2.
Double-click Configure and add the following line of code:
Private Sub ConfigureButton_Click()
ApplicationControl.ShowInterface False
End Sub
This will show the HexSight Application Control’s interface in a nonmodal window when the Configure button is clicked.
3.
From the Visual Basic menu bar, select Project>References... Scroll
down to find HexSight Process Manager Control, enable its
check box and click OK.
The HexSight Process Manager is now added to the project’s
references and can thus be accessed programmatically. Note that in
order to work properly, the Process Manager should only be set
through the Project>References... menu and not through the
Projects>Components... menu.
4.
Double-click Inspect and add the following lines of code:
Private Sub InspectButton_Click()
Dim lManager as HSProcessManager
InspectButton.Enabled = False
Set lManager = ApplicationControl.ProcessManager
HexSight Basics User Guide
37
Visual Basic Tutorials
Do
DoEvents
Loop While ContinuousCheck.Value = 1
InspectButton.Enabled = true
End Sub
This is the main loop of the inspection application. It loops until
Continuous Mode is unchecked in the interface.
5.
Add the following lines of code:
Private Sub Form_Load
End Sub
Private Sub Form_Unload(Cancel as Integer)
QuitButton_Click
End Sub
You will later place initialization code for the empty Form_Load Sub.
Clicking the Close button calls the Form_UnLoad Sub and ends the
application.
6.
You have completed the code needed to use your application. Run
and test the application. When you are sure that everything works
fine, save your work and go on to the next section.
Adding an Acquisition Device Tool
In this section, you will learn how to instantiate a process in the HexSight
Application Control. You will also learn how to configure an Acquisition
Device tool. This tool will acquire a grey-scale Image from an existing
database file to simulate real image acquisition.
Instantiating the Acquisition Device
In order to build a vision application, HexSight processes are
instantiated using the Application Control’s Process Manager.
HexSight Basics User Guide
38
Visual Basic Tutorials
1.
On the main form, right-click the HexSight Application Control.
Select Edit from the menu. The HexSight Application Control’s
interface is shown and the active tab is the Process Manager. In
the Available Processes list of the Process Manager, select
HSAcquisitionDevice and click Add Process. The Acquisition
Device Properties window appears.
At the end of this tutorial, the HexSight Application Control should
look like the illustration in Figure 11.
Selection
tabs
Instantiated
processes
Available
processes
Execute
Sequence
Command
Help
Command
FIGURE 11
HexSight Application Control — Process
Configuring the Acquisition Device
You will use an existing database of images to simulate a real
image acquisition. The database used for this tutorial is constituted
of images of the same objects, rotated at different angles.
1.
In the Acquisition Device General panel, enter Acquisition as the
Process Name (instead of HSAcquisitionDevice0).
2.
In the Configuration panel, select the Input tab. Select File
Emulation from the list.
HexSight Basics User Guide
39
Visual Basic Tutorials
3.
Click Load then load the following file:
InstallationPath\Tutorial\VisualBasic\HookInspection\Data\Hook.h
db.
4.
Disable all the images of the emulation database except the first
one: Image0. This ensures that this image will be used to create
the model later in this tutorial.
FIGURE 12
5.
Acquisition Device — Configuration
Leave the default settings for the Calibration and Output subpanels. Click OK to return to the Process Manager of the HexSight
Application Control.
HexSight Basics User Guide
40
Visual Basic Tutorials
To sequentially execute the processes instantiated in the Process
Manager, you can click Execute Sequence. For instance, if more
than one Image is enabled in the emulation list of the Acquisition
Device, clicking Execute Sequence in the Process Manager will
output a new Grey-Scale Image and execute the subsequent
processes in the list.
Viewing Scenes and Images
The Explorer panel of the HexSight Application Control shows a hierarchical
view of all Views, Scenes and Images held in the application’s runtime
database.
1.
Select the Explorer panel in the HexSight Application Control.
2.
Expand Database by clicking on the + symbol.
FIGURE 13
3.
HexSight Application Control — Explorer
Expand Acquisition and then Images. Click Grey-Scale Image; this
will display the Grey-Scale Image output by the acquisition process.
HexSight Basics User Guide
41
Visual Basic Tutorials
Adding a Locator Tool
The Locator locates model-defined objects within the input grey-scale
Image, using the geometry of their contours. The Locator interface
provides:
• A General panel for configuring the input and the outputs.
• A Contour panel for setting the region of interest in the image
and optionally customizing contour detection parameters.
• A Model panel for creating and editing models.
• A Search panel for configuring the search and setting constraints
on the rotation, the scale factor, the number of instances to find,
etc.
• A Results panel for viewing the results of the search.
Instantiating the Locator
Here you add a Locator process the same way you added the
Acquisition Device.
1.
In the HexSight Application Control Process Manager, select
HSLocator from the HexSight Locator Tools folder. Click Add
Process.
2.
In the properties window of the newly added Locator process,
select the General tab.
3.
Enter the name Locator instead of HSLocator1.
4.
In the Input section, click on the database selection icon then
select Acquisition->Grey-Scale Image.
HexSight Basics User Guide
42
Visual Basic Tutorials
Selection icon
FIGURE 14
5.
Database Selection Icon
In the Output frame leave the default names for Model View and
Instance Scene. Leave their corresponding check boxes enabled
to ensure that the Model View and Instance Scene are output to
the runtime database.
6.
Click Execute.
Contour Detection Parameters
1.
Select the Contour tab.
2.
Leave the default settings as is for the Search Area. In some
applications, it maybe possible to reduce the position and size of
the Search Area. To specify a Search Area other than the entire
image, you must disable the Entire Image check box. Leave
Entire Image enabled for this tutorial.
3.
Leave the default settings for Detection parameters. Setting the
Parameters Based on combo box to All Models will
automatically select the best contour detection parameters
HexSight Basics User Guide
43
Visual Basic Tutorials
according to the active models. Contour detection can be
customized by choosing Custom in the combo box. Automatic
selection of contour detection parameters usually works best and
customizing the values should only be necessary with very
degraded input images.
4.
Click Execute. Observe differences in the two coarseness levels of
contours by clicking the Detail, Level or Both tabs below the
display.
Creating a Model
In this section, you will learn how to create a Model of an object
using the Model Editor. A Model is a reference or “ideal”
representation of an object’s contours that will be used by the
Locator’s search process to recognize and locate instances of the
object. Models can be stored in database files for later use.
1.
Select the Model tab, then click Add in the Models frame. The
Create New Model prompt appears.
FIGURE 15
Create New Model Dialog
2.
Name the Model Hook.
3.
Click OK to open the Model Editor.
Using the Model Editor
The Model Editor is used to create new models and to modify
existing models. Once you have created a model of the hook for
this application, you will save it for later use with the rest of the
tutorial.
HexSight Basics User Guide
44
Visual Basic Tutorials
Creating the Source Contours and Selecting Model Features
The Locator uses two coarseness levels to recognize and locate the
object: the Outline Level and the Detail Level. The outline
coarseness level is used to rapidly identify potential instances of
the object. The Detail coarseness level is used to confirm that it is
the correct object and to refine its location within the image.
Source contours will be created at the selected Outline Level and
Detail Level. Features will be selected from these source contours
to create the Model.
When the Automatic Levels check box is enabled, the two contour
detection parameters (Outline Level and Detail Level) are
automatically optimized by analyzing the Model’s bounding area.
Automatic contour detection parameters should usually be used
when building a Model.
Contrast Threshold is used to set the sensitivity to contrast when
generating the source contours. Contrast Threshold can be set
manually, by selecting Fixed Value with the combo box, or
automatically by selecting Adaptive Low Sensitivity, Adaptive
Normal Sensitivity or Adaptive High Sensitivity.
Tracking Inertia is used to close small gaps that may appear in
the source contours. It defines the longest gap that can be closed
to connect two edge elements when building the source contours.
Once the source contours are detected, features must be selected
to build the Model. Features can be selected manually, by setting
the Feature Selection slider to none, or automatically by
selecting less, normal, more or all. Setting the slider to normal
will select the optimal amount of features at both the Outline and
Detail Levels. Increasing the setting will add more features, which
may slow the search process. Decreasing the setting may cause
recognition problems because the Model may lack essential
features.
HexSight Basics User Guide
45
Visual Basic Tutorials
In this tutorial, we will use the default contour detection and
feature selection parameters to build the model, as shown in Figure
16.
FIGURE 16
1.
Model Editor Interface
In the Contour Detection frame, leave the Automatic Levels
check box enabled, Tracking Inertia to 0 and Contrast
Threshold combo box to Adaptive Normal Sensitivity.
2.
In the Feature Selection frame, leave the slider in the default
normal position.
3.
In the display, drag and resize the green dotted rectangle (the
Model’s bounding box) to enclose the entire object.
4.
Click Build Model.
HexSight Basics User Guide
46
Visual Basic Tutorials
A Model is now created. Contour detection parameters have been
optimized and features were selected at both the Outline and Detail
levels. The Outline Level has been set to 8, while 1 was selected for
the Detail Level. To verify that no problem was encountered while
building a model, check the Messages text box.
You can view the Model using the display. By selecting the Outline
tab at the bottom of the display, you can view the Model at the
Outline Level. The selected features are shown as bold magenta
lines. Unused contours at the Outline Level are shown as thin blue
lines. The features at the Detail Level can be viewed by selecting
the Detail tab at the bottom of the display. The selected features
are shown as bold green lines. As with the Outline Level, unused
contours are shown as thin blue lines. To view the outline and
Detail Levels superimposed, click the Both tab at the bottom of the
display.
You can now use the Model to locate instances of the object. We will
however edit it to show how the Model Editor can be used to
customize a model for a specific application.
Removing Features from a Model
The application we are building in this tutorial will be used to
inspect features on the hook with respect to its outer contour. The
steps will be to locate the part using its outer contour and apply
tools to inspect the rounded rectangle, the hole and the label.
These features need to be inspected because they might be missing
on actual parts, be the wrong size, or mislocated with respect to
the outer contour. Since these features are unstable, they must be
removed from the model to get the best precision possible on the
location of the outer contour in the image.
The first step will be to remove unwanted features at the Outline
Level.
HexSight Basics User Guide
47
Visual Basic Tutorials
1.
Click the Outline tab at the bottom of the display. It will enable
you to edit the Model at the Outline Level. The grid in the Model
Contents frame displays the Features sub-panel for the Outline
level of the Model.
2.
Select the rounded rectangle feature by either clicking it in the
display or by selecting it in the Features grid.
3.
Click Delete to remove this feature from the Model.
The next step will be to remove unwanted features at the Detail
Level.
4.
Click the Detail tab at the bottom of the display. It will enable you
to edit the Model at the Detail Level.The grid in the Model
Contents frame displays the Features sub-panel for the Detail
level of the Model.
5.
Select all the features, except the outer contour, by clicking them
while holding the Ctrl key either in the display or in the Features
grid.
6.
Click Delete to remove these features from the Model.
The unstable features are now removed from the model. To view
the outline and Detail Levels superimposed, click the Both tab at
the bottom of the display. In this viewing mode, the model is not
editable.
Setting the Object Coordinate System for a Model
The part inspection process requires that the measurements of the
features be expressed with respect to the outer contour of the part.
To fix a reference frame to express these inspection results, we will
define an Object coordinate system for the part.
1.
Click the Outline or the Detail tab at the bottom of the display. It
will enable you to edit the Object coordinate system.
HexSight Basics User Guide
48
Visual Basic Tutorials
2.
Click the Coordinate System tab in the Model Contents frame
to activate the coordinate system panel.
3.
Use the mouse to position the coordinate system marker (yellow
axes) over the object, as shown in Figure 17. To rotate the object
coordinate system, click on the arrow of the X or the Y-axis and
drag with the mouse. To move the coordinate system, click the
intersection of the X- and Y-axes and drag with the mouse. You can
also drag the arrow of the axes to stretch them, which will have no
effect on the Object coordinate system itself, but can help you
align the marker over long features. Fine-tune the final position
with the text boxes in the Coordinate System panel.
Coordinate system marker
Coordinate System sub-panel
FIGURE 17
Adjusting the Position and Orientation of the Model
Coordinate System
Adding Reference Points to a Model
For some applications, it is sometimes useful to have the position of
specific points on the Model transposed in the World coordinate
system for each object instance located. To do so without having to
compute coordinate transforms manually, reference points can be
defined on a Model. In this application, we will add a reference
point above the circular hole.
1.
Click the Outline or the Detail tab at the bottom of the display. It
will enable you to edit the reference points.
HexSight Basics User Guide
49
Visual Basic Tutorials
2.
Click the Reference Points tab in the Model Contents frame to
activate the reference points panel.
3.
4.
Click Add to create a reference point in the display.
Click and drag the target marker to position the reference point
above the circular hole in the part. Zoom in for more precision.
Fine-tune the position using the text boxes in the Reference
Points panel.
Reference point marker
Reference Points panel
FIGURE 18
Adding a Reference Point with the Model Editor
This reference point will not be used to locate the part, only
contour features are used for locating objects. However, for each
instance of the object that will be located, the reference point’s
position will be returned with respect to the scale, rotation and
translation of this instance. You can add as many reference points
as you need on a Model.
Manually Adding Features to a Model
Sometimes, it may be useful to manually add a feature to a Model.
In Model Editor, you can select features from the unused contours
at the Outline Level as well as the Detail Level. To add a feature at
the Outline Level, follow the procedure below.
1.
Click the Outline tab at the bottom of the display. It will enable
you to edit the Model at the Outline Level.
HexSight Basics User Guide
50
Visual Basic Tutorials
2.
Click the Features tab in the Model Contents frame to activate
the features grid.
3.
Disable the Grey-Scale Image check box in the Show frame to
show only the contours. This will make the blue unused contours
more visible.
4.
In the display, click one of the unused contours, the rounded
rectangle for example. The contour turns light blue.
5.
Click a starting point on the contour. Hold the Ctrl key and click
another point on the contour. The selected feature appears in red.
6.
To invert your selection, hold the Shift key while clicking on the
contour. Click Add in the Model Contents frame. The new feature
appears in the features grid.
7.
Select the newly added feature in the grid and click Delete to
remove it from the Model.
8.
To add the entire rounded rectangle as a feature, double-click it in
the display so the whole contour is selected. Click Add to add this
feature to the model.
9.
Select the newly added feature in the grid and click Delete to
remove it from the Model, since it is considered unstable for this
application.
Analyzing a Model
When a Model has been edited manually, it is important to verify
that it will work correctly with the Locator. To do so, click Analyze
Model in the Model Contents frame. Any problem will be
displayed in the Messages frame.
Saving a Model Database
When a Model is completed, it must be saved in a model database,
otherwise it will be lost when you exit the application. To save the
Model, follow the procedure below.
HexSight Basics User Guide
51
Visual Basic Tutorials
1.
Click OK at the bottom right of the Model Editor. This will transfer
the newly created Model to the active model database of the
Locator.
2.
In the Locator’s properties window, select the Model tab.
3.
Click Save As... in the Database frame. Save your Model as
HookModel in your working directory. You will find it convenient to
store Models close to other HexSight files used in a same
application, such as image emulation files, the Process Manager
configuration file, etc.
4.
You can return edit your Model at any time by clicking Edit in the
Models frame.
Configuring Search Parameters
Search parameters are used to constraint the search and configure
object recognition and positioning algorithms.
1.
Select the Search tab.
2.
Leave the Nominal Scale check box enabled. Its value in the text
box should be 1.0.
3.
Leave the Nominal Rotation check box disabled, with a range
between -180.0 to 180.0.
4.
Leave all the other parameters to their default setting also.
Executing the Locator and Verifying the Results
Once the Model is created and the search is configured, the first
step is to verify that the Locator finds the object on the image that
was used to create the model.
1.
Select the Results tab.
2.
Click Execute at the bottom of the Locator’s properties window.
3.
Verify in the grid that the instance was located correctly.
HexSight Basics User Guide
52
Visual Basic Tutorials
4.
Click Show Results Viewer to view the located instance
superimposed on the Grey-Scale Image, as shown in Figure 19.
5.
Move the Locator properties window and the Results Viewer to a
corner of your screen.
FIGURE 19
Results Viewer and Results Panel of the Locator Tool
The next step is to verify that the object is located in all the images in the
emulation database.
1.
In the Process Manager, open the Acquisition Device properties window.
Select the Configuration panel, then click Enable All to enable all the
images in the emulation database. Click OK to close the Acquisition
Device’s properties window.
2.
Return to the Process Manager and click Execute Sequence.
HexSight Basics User Guide
53
Visual Basic Tutorials
3.
In the Results panel of the Locator properties window, check if the
instance was located correctly. Return to the Process Manager and
click Execute Sequence several times to apply the Locator to
each of the images.
4.
Close the Results Viewer window, return to the Locator Properties
window and click OK.
5.
Now is a good time to return to the Visual Basic form and save
your work. For exit the Process Manager, close his window. To
return to the application, you will have to right-click the HexSight
icon and select Edit (or Show Application Interface if the icon is
still selected).
Adding Code for the Locator
In this section, you will add code to output the properties of the
instance found by the Locator in your application interface.
1.
From the Visual Basic menu bar, select Project>References....
Scroll down to find HexSight Locator Control, enable its check box
and click OK. Double-click Inspect and add the lines of code
shown in bold:
Note: Existing code appears in normal typeface.
Dim lManager As HSProcessManager
Dim lLocator As HSLocator
Dim t0 As Single
Dim t1 As Single
...
Set lManager = ApplicationControl.ProcessManager
Set lLocator = lManager.Process(“Locator”)
HexSight Basics User Guide
54
Visual Basic Tutorials
This code creates a reference to the Locator process contained in
the HexSight Application Control. This reference will be used to
access the tool programmatically.
2.
In the existing “Do Loop” of the InspectButton_Click procedure,
add the lines of code shown in bold:
Do
t0 = Timer
lManager.Execute “Acquisition”, “Locator”
If lLocator.InstanceCount > 0 Then
TypeText.Text = lLocator.InstanceModelName(0)
ScaleText.Text = _
Format(lLocator.InstanceScaleFactor(0),“0.00”)
RotationText.Text = _
Format(lLocator.InstanceRotation(0),”0.00”)
TranslationXText.Text = _
Format(lLocator.InstanceTranslationX(0),”0.00”)
TranslationYText.Text = _
Format(lLocator.InstanceTranslationY(0),”0.00”)
Else
TypeText.Text = ““
ScaleText.Text = ““
RotationText.Text = ““
TranslationXText.Text = ““
TranslationYText.Text = ““
End If
t1 = Timer
TimeText.Text = Format(1000 * (t1 - t0), “0”)
DoEvents
Loop While ContinuousCheck.Value = 1
HexSight Basics User Guide
55
Visual Basic Tutorials
Each time the loop is executed, this code executes the Application
Control’s sequence of process from “Acquisition” to “Locator”. If no
parameter is specified to the Execute method of the Process
Manager, the whole sequence of processes will be executed, which
in this case will yield the same result. After HexSight processes are
executed, the pose (scale, rotation and translation) and type
(model name) of the located instance are displayed in the interface.
3.
At this moment, your application interface and code should look
like the example in
InstallationPath\Tutorial\VisualBasic\HookInspection\Part1. Save
your work and move on to the next step.
Testing the Application
You are ready to test your application.
1.
To start the running Mode, press the F5 key. Click Inspect a few
times.
The properties of the found instances displayed in the text boxes
should be updated every time you press Inspect.
2.
Enable the Continuous Mode check box and click Inspect. The
application should run in continuous mode. Exit the Continuous
Mode by disabling the check box. Exit the Run mode by closing the
window or by clicking Quit.
This concludes this tutorial. After debugging, save your work and move on
to the next tutorial where you will add a display to your application.
HexSight Basics User Guide
56
Visual Basic Tutorials
Tutorial 2: Display
Introduction
This second tutorial shows you how to add a Display to your application
interface. A Display allows you to view Images and Scenes processed by
the HexSight Application Control.
Adding the Display to the Interface
First, you will modify the interface of your application by adding the
Display.
1.
Start by extending the form. Set the width to approximately 10950 and
the height to approximately 6180. Reorganize the text boxes and
buttons to look like the form in Figure 20.
FIGURE 20
2.
Resized Visual Basic Form for Tutorial 2
From the Visual Basic menu bar, select: Projects>Components... Scroll
down to find HexSight Display Control, enable its check box and click
HexSight Basics User Guide
57
Visual Basic Tutorials
OK. The HexSight Display appears as a new icon in the Visual Basic
toolbox.
3.
Click the HexSight Display icon and drag a small box on the form. Set
the width to 5775 and height to 5655. The default name is HSDisplay1.
Rename it ApplicationDisplay. The interface of the project is now
complete and should look like the following form in Figure 21. Save your
work.
FIGURE 21
Visual Basic Form for Tutorial 2
Adding Code for the Display
The following lines of code are needed to update the Display output
every time the inspection loop is executed.
1.
From the Visual Basic menu bar, select Project>References....
Scroll down to find HexSight Acquisition Device Control, enable its
check box and click OK. Add the following lines of code (in bold)
inside the existing Form_Load procedure (in normal typeface):
Private Sub Form_Load
Dim lAcquisition As HSAcquisitionDevice
HexSight Basics User Guide
58
Visual Basic Tutorials
Set lAcquisition = ApplicationControl.ProcessManager._
Process(“Acquisition”)
ApplicationDisplay.ImageDatabase(0) = _
ApplicationControl.Database.Handle
If Not lAcquisition Is Nothing Then
ApplicationDisplay.ImageViewName(0) = _
lAcquisition.OutputView
ApplicationDisplay.ImageName(0) = _
lAcquisition.OutputGreyScaleImage
End If
ApplicationDisplay.Zoom = -1
End Sub
This initialization code configures the Display Control to display the
Grey-Scale Image provided by the Acquisition Device output. It
also sets the zoom to page mode, which automatically adjusts the
zoom factor to view the entire image.
2.
In the InspectButton_Click procedure, add the following lines of
code (in bold) between the existing lines (in normal typeface):
t0 = Timer
ApplicationDisplay.RemoveAllMarker
...
TimeText.Text = ...
ApplicationDisplay.Refresh
DoEvents ...
The RemoveAllMarker call removes all overlay graphic markers that
could have been added to the previous image. The refresh call
updates the display to show the new Grey-Scale Image.
HexSight Basics User Guide
59
Visual Basic Tutorials
3.
Save your work and test the application. Now along with the
properties of the found instance, you should see a grey-scale
Image of the object for the current instance.
HexSight Basics User Guide
60
Visual Basic Tutorials
Tutorial 3: Caliper
Introduction
In this tutorial, you will learn how to set up, configure and use a Caliper
tool to precisely measure the distance between parallel edges on an object.
Modifying your Application Form
First you need to add two edit boxes to your application for the interface to
display the measurement output by the Caliper.
1.
On your application form, add a frame labeled Inspection and add two
text boxes, the first text box labeled WidthText and the second
HeightText. Set up your form as illustrated in Figure 22.
FIGURE 22
Visual Basic Form for Tutorial 3
Placing the Caliper
Right-click the HexSight Application Control icon on the form and select
Edit from the context menu. Click Execute Sequence twice to locate the
HexSight Basics User Guide
61
Visual Basic Tutorials
object in the second image of the emulation database. Using the Process
Manager, add a HSCaliper process from the HexSight Inspection Tools
folder. Set the tool’s General panel as follows:
1.
2.
Enter WidthCaliper as the Process Name (instead of HSCaliper2).
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Enable the Apply Transform to a Model-defined Location check box.
4.
Select Hook from Model View as the Input Model Scene.
5.
Leave the Lock Location Transform on a Selected Instance check
box enabled.
6.
For the Input Instance Scene, select Instance Scene from Locator
View.
The above settings will make your application fully model-based
(automatic model-based mode). The Caliper tool is defined on the
model and will be automatically transposed to fit the located
instance, whatever its scale, rotation or displacement.
7.
Click Execute. Open the Location panel.
The Location display shows the Model View. The Caliper is applied
to an area on the object bounded by the Caliper’s Rectangle, which
appears in green. The Caliper will be used to measure the width of
the rectangle-shaped hole on the part.
8.
Place the Rectangle on the part as shown in Figure 23. Click the arrow of
the X-axis and drag it to adjust the rotation to 90 degrees (the Y-axis is
used to adjust the skew). Click the center of the Rectangle and drag it
into position. Use the corner and side handles to adjust the width and
HexSight Basics User Guide
62
Visual Basic Tutorials
height of the Rectangle. Fine-tune the position and the orientation with
the text boxes if needed. Once the Rectangle is placed, click Execute.
Note: The Caliper must always be as perpendicular as possible to the
edges to be measured. For the current example, the tool had to be
rotated to 90 degrees and the skew left to its default value of 0
degrees.
9.
Go to the Transform panel. The image shown is that of the current
instance of the object, as located in the second image of the emulation
database (if you have clicked Execute Sequence twice before creating
the Caliper tool as indicated previously). To see the tool applied to other
instances, leave the Caliper window open and click Execute Sequence
in the Process Manager. Yellow lines indicate where the Caliper has
detected potential edges. Edge selection criteria will be set up in the
next step. Open the Configuration panel and move on to the next step.
FIGURE 23
Adjusting the Size, Position and Orientation of the
Caliper Rectangle
HexSight Basics User Guide
63
Visual Basic Tutorials
Configuring the Caliper
The Caliper locates potential edge pairs. You will set up constraints that will
allow the Caliper to measure only valid edge pairs, that is, those that meet
the criteria you have determined.
The display in the Configuration panel represents the part of the Image
bounded by the Rectangle. The Caliper processes information within the
Image along pixel lines, called projection paths, parallel to the Rectangle’s
Y-axis. In the display you can observe the following:
• Dotted yellow line indicates potential edges.
• The blue curve shows a graphical representation of a projection
that averages each column of pixels in the Rectangle to create a
one-dimensional signal. Sharp changes on this curve indicate
potential edges.
• The green magnitude curve is the first derivative of the
projection curve. High and low peaks in this curve identify
potential edges.
• Horizontal red lines indicate the magnitude threshold for the
detection of potential edges.
HexSight Basics User Guide
64
Visual Basic Tutorials
FIGURE 24
Caliper Tool — Configuration Panel
In this example, only one measurement pair is needed so the default pair
named Pair0 will be used. The constraints used for both edges will be
polarity and position constraints. These constraints will be used to score
each edge.
Polarity indicates changes in light values, from left to right, within the
Rectangle.
Position constraints score each edge according to its position as defined
by the Position Constraint histogram. Magnitude constraints, not used in
this tutorial, score each edge according to its magnitude as defined by the
Magnitude Constraint histogram.
The Caliper attributes a score to each edge pair and to each individual
edge. Scores range from 0 to 1 with the minimum acceptable score being
HexSight Basics User Guide
65
Visual Basic Tutorials
determined by the Score Threshold, set by default at 0.250. Histogram
functions for each constraint determine how the Caliper scores edges.
1.
In the 1st Edge Score frame, select Polarity as Light to Dark and
enable the Position check box.
2.
In the 2nd Edge Score frame, select Polarity as Dark to Light and
enable the Position check box.
Next you must set up the Position constraint histogram for each
edge, in the bottom left window of the Configuration panel.
3.
4.
Use the combo box above the histogram window to select a constraint.
Use the mouse to drag the handles in the graphic histogram editor. Set
the 1st and the 2nd edge position constraints as illustrated in Figure 25.
All edges to the right of the white
dotted line receive a score of 1
All edges to the left of the white dotted
line receive a linear decreasing score,
from 1 to 0
Constraint selection
Combo box
FIGURE 25
5.
Adjusting Position Constraint Histograms
Click Execute. The yellow dotted lines become solid and are joined by a
solid horizontal line to indicate that the pair has been detected and
measured.
HexSight Basics User Guide
66
Visual Basic Tutorials
Caliper Results
You will now observe the Caliper’s results for various instances of the
object.
Access the Caliper Results panel to observe the following:
• Valid edges are displayed as parallel vertical yellow lines.
• The Caliper measure is displayed as a horizontal yellow line,
perpendicular to the edges.
• The Pair Count box indicates that the Caliper was configured to
measure one pair.
• The Coordinate System combo box indicates that the positions
are expressed with respect to the Tool coordinate system (the
origin centered on the tool’s Rectangle).
The table of results indicates:
• The Caliper measure, named Size, indicated in calibrated units.
• The score for the edge pair as well as for each edge.
Note: View the complete set of results using the scrollbar.
Now that the Caliper is properly configured to measure the rectangular
hole feature, you will want to test and observe the Caliper on other
instances of the Object by clicking Execute Sequence in the Process
Manager. Click OK and save your work before moving on to the next step.
Adding Code for the Caliper
You will finish up by adding code to your Visual Basic form that will display
the measurement of the Caliper in the interface. You will also add a line
marker on the display to show the measurement.
1.
From the Visual Basic menu bar, select Project>References.... Scroll
down to find HexSight Caliper Control, enable its check box and click
HexSight Basics User Guide
67
Visual Basic Tutorials
OK. Double-click Inspect. Add the lines of code indicated in bold
between the existing ones, shown in normal typeface:
Dim lLocator As HSLocator
Dim lWidthCaliper As HSCaliper
Dim lMarkerName As String
...
Set lLocator = lManager.Process(“Locator”)
Set lWidthCaliper = lManager.Process(“WidthCaliper”)
This will create a reference that will be used for programmatic
access to the WidthCaliper process instantiated in the HexSight
Application Control.
2.
Modify the existing line, shown in italic, for the one below it:
lManager.Execute “Acquisition”, “Locator”
lManager.Execute “Acquisition”, “WidthCaliper”
This will execute the entire sequence of processes.
3.
Now, to display the Caliper’s measurement in the text box and to draw
the marker on the application display, type the following lines of code
after the existing one in normal typeface:
TranslationYText.Text = Format(lLocator... ) ...
If lWidthCaliper.PairScore(0) > 0 Then
lWidthCaliper.CoordinateSystem = hsCoordinateSystemWorld
WidthText.Text = _
Format(lWidthCaliper.PairSize(0), “0.00”)
lMarkerName = “Width”
ApplicationDisplay.AddLineMarker lMarkerName, _
lWidthCaliper.Edge1PositionX(0), _
lWidthCaliper.Edge1PositionY(0), _
lWidthCaliper.Edge2PositionX(0), _
HexSight Basics User Guide
68
Visual Basic Tutorials
lWidthCaliper.Edge2PositionY(0), _
True
ApplicationDisplay.MarkerAnchorStyle(lMarkerName) = hsCross
ApplicationDisplay.LineMarkerConstraints (lMarkerName)=_
hsLineNoEdit
ApplicationDisplay.MarkerColor(lMarkerName) = hsRed
ApplicationDisplay.MarkerDisplayName(lMarkerName) = True
End If
If the first pair of the Caliper (Index = 0) is found (Score > 0.250),
its measurement is displayed in the WidthText text box. Using the
World coordinate system, the calibrated X-Y position of the first and
second edge of the pair is used to draw a non-editable line marker
on the application display.
4.
In case no instance is found, add the lines of code indicated in bold,
after the existing one, shown in normal typeface:
TranslationY_Text.Text = ““
WidthText.Text = ““
HeightText.Text = ““
5.
Save your work and test the application. You should see the
measurement in the RectangleWidth text box of your application. You
should also see the line marker you added on the Display highlighting
the measurement of WidthCaliper.
Adding a Second Caliper
By following the previous steps, try adding a Caliper for measuring the
height of the rectangular hole in the hook. Add the appropriate code to
display the result in the remaining text box (Rectangle Height) on your
application form. Also add the code to draw another line marker on the
Display.
HexSight Basics User Guide
69
Visual Basic Tutorials
Refer to the Application Example in the following folder:
InstallationPath\Tutorial\VisualBasic\HookInspection\Part3.
HexSight Basics User Guide
70
Visual Basic Tutorials
Tutorial 4: Blob Analyzer
Introduction
In this tutorial, you will learn how to set up, configure and use a Blob
Analyzer tool to find, label and analyze irregular shaped features on the
part.
Modifying your Application Form
First you need to add two text boxes to your application so you can observe
the measurement output by the Blob Analyzer.
1.
On your application form, add two text boxes. Name the first one
DiameterText and the second OffsetText and add appropriate labels. Set
up your form as illustrated in Figure 26.
FIGURE 26
Visual Basic Form for Tutorial 4
HexSight Basics User Guide
71
Visual Basic Tutorials
Placing the Blob Analyzer
Return to the Process Manager (right-click the HexSight Application Control
icon, select Edit). Click Execute Sequence twice to locate the object in
the second image of the emulation database. Using the Process Manager,
add a HSBlobAnalyzer process from the HexSight Inspection Tools
folder of the Process Manager. Set the tool’s General panel as follows:
1.
Enter HoleBlob as the Process Name (instead of HSBlobAnalyzer4).
2.
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Leave the Create Blob Image check box disabled.
4.
Enable the Apply Transform to a Model-defined Location check box.
5.
Select Hook from Model View as the Input Model Scene.
6.
Enable the Lock Location Transform on a Selected Instance check
box.
7.
Select Instance Scene from Locator View as the Input Instance
Scene.
The above settings will make your application fully model-based
(automatic model-based mode). The Blob Analyzer tool is defined
on the model and will be automatically transposed to fit the located
instance, whatever its scale, rotation or displacement.
8.
Click Execute. Open the Location panel.
The Location display shows the Model View. The Blob Analyzer will
be applied to an area on the object bounded by the Blob Analyzer’s
Rectangle, which appears in green. The Blob Analyzer will be used
to inspect the diameter and offset of the circular hole on the part.
9.
Place the Rectangle on the part as shown in the illustration. Click the
center of the Rectangle and drag it into position. Use the corner and side
handles to adjust the width and height of the Rectangle. Fine-tune the
HexSight Basics User Guide
72
Visual Basic Tutorials
position with the text boxes if needed. Once the Rectangle is placed,
click Execute.
10.
Go to the Transform panel. The image shown is that of the current
instance of the object as located in the second image of the emulation
database (if you clicked twice on Execute Sequence before creating
the Blob Analyzer tool). The red target marker indicates the center of
the blobs detected by the Blob Analyzer. Blob selection criteria will be
set up in the next step. Open the Configuration panel and move on to
the next step.
FIGURE 27
Adjusting the Size, Position and Orientation of
the Blob Analyzer Rectangle
Configuring the Blob Analyzer
You will set up constraints that will allow the Blob Analyzer to find only
valid blobs, that is, those that meet the criteria you have determined.
The display in the Configuration panel represents the part of the Image
bounded by the Rectangle. The Blob Analyzer processes information within
this Rectangle. In the display you can observe the following:
HexSight Basics User Guide
73
Visual Basic Tutorials
• The blob, as defined by the Image Segmentation Mode, is
represented in green.
• A blob marker appears in red in the center of each blob.
• When displaying the Pixel Weight Image, you can see the weight
value of each pixel as defined by the graphical function of the
Image Segmentation box. White pixels have a weight of 1 while
black pixels have a weight of 0. Pixels having a weight between 0
and 1 are displayed with a proportional greylevel.
1.
First, set the Blob Constraints: Minimum Area to 0 and Maximum
Area to 100, which corresponds to the area defined by the Rectangle.
FIGURE 28
Blob Analyzer — Configuration Panel
Now you must set the segmentation function using the graphical
editor in the Image Segmentation box. The graphic shows a
histogram of the distribution of pixels inside the Blob Analyzer’s
Rectangle. Black (0) is at the far left and white (255) at the far
right. In this example, there is a small peak in the black portion
HexSight Basics User Guide
74
Visual Basic Tutorials
(around 58) representing the blob, and a higher peak (around 186)
representing the part color. You want to include some pixels in the
transition, with a weight function proportional to the grey scale
value.
2.
Since we are looking for a dark blob on a white background, set the
Mode combo box to Dark.
3.
Use the mouse to drag the handles in the graphic function editor. Set
the Image Segmentation weight function as illustrated below.
Pixels of these values
receive a weight of 1
Pixels of these values
receive a weight of 0
Pixels of these values
receive a weight
between 0 and 1
FIGURE 29
4.
Image Segmentation Function Editor
Click Execute.
The segmented blob now corresponds to the hole in the part.
Blob Analyzer Results
You will now observe the Blob Analyzer’s results for various instances of the
object.
1.
In the Results tab, enable the Sort Results check box and select Area
with the Sort by combo box.
2.
Click Execute.
Use the Blob Analyzer Results panel to observe the following:
HexSight Basics User Guide
75
Visual Basic Tutorials
• The Blob Count box indicates that the Blob Analyzer has found
one blob.
• A grey-scale Image is displayed with a blob marker indicating the
center of each blob found for this instance of the object.
• The Coordinate System combo box selection indicates that the
positions are returned with respect to the Tool coordinate system
(the origin centered on the tool’s Rectangle).
• A list of the selected types of blob properties that are computed:
General, Perimeter, Intrinsic Inertia, etc.
The table of results shows:
• The position of the blob according to the selected coordinate
system
• The blob area indicated in calibrated units
• The properties computed for the blob. To view the complete set
of properties, use the grid’s tabs and scrollbar.
Now that the Blob Analyzer is properly configured to inspect the circular
hole feature, you will want to test and observe the Blob Analyzer on other
instances of the object by clicking Execute Sequence in the Process
Manager. Click OK and save your work before moving on to the final step.
Adding Code for the Blob Analyzer
You will finish up by adding code to your Visual Basic form that will display
the measurements of the Blob Analyzer in the interface. You will also add a
target marker on the display to show the position and diameter of the hole.
1.
From the Visual Basic menu bar, select Project>References.... Scroll
down to find HexSight Blob Analyzer Control, enable its check box and
click OK. Double-click Inspect. Add the following lines of code (in bold)
between the existing ones (in normal typeface):
Dim lWidthCaliper As HSCaliper
HexSight Basics User Guide
76
Visual Basic Tutorials
Dim lHeightCaliper As HSCaliper
Dim lHoleBlob As HSBlobAnalyzer
Dim lMarkerName As String
Dim lHoleDiameter As Single
Dim lHoleOffset As Single
...
Set lWidthCaliper = lManager.Process(“WidthCaliper”)
Set lHeightCaliper = lManager.Process(“HeightCaliper”)
Set lHoleBlob = lManager.Process(“HoleBlob”)
This will create a reference that will be used for programmatic
access to the hole blob process instantiated in the HexSight
Application Control.
2.
Modify the existing line, shown in italic, for the one below it:
lManager.Execute “Acquisition, “HeightCaliper”
lManager.Execute “Acquisition”, “HoleBlob”
This will execute the entire sequence of processes.
3.
Now to display the Blob Analyzer’s measurements in the text boxes and
to draw the marker on the application display, type the following lines of
code (in bold) after the existing ones (in normal typeface):
If lHeightCaliper.PairScore(0) > 0 Then
...
End If
If lHoleBlob.BlobCount > 0 Then
lHoleDiameter = Sqr(4 * lHoleBlob.BlobArea(0)/ 3.14159)
DiameterText.Text = Format(lHoleDiameter, “0.00”)
lHoleBlob.CoordinateSystem = hsCoordinateSystemObject
lHoleOffset = Sqr(lHoleBlob.BlobPositionX(0) ^ 2 + _
HexSight Basics User Guide
77
Visual Basic Tutorials
lHoleBlob.BlobPositionY(0) ^ 2)
OffsetText.Text = Format(lHoleOffset,”0.00”)
lHoleBlob.CoordinateSystem = hsCoordinateSystemWorld
lMarkerName = “Hole”
ApplicationDisplay.AddTargetMarker lMarkerName, _
lHoleBlob.BlobPositionX(0),_
lHoleBlob.BlobPositionY(0),_
lHoleDiameter / 2, True
ApplicationDisplay.TargetMarkerConstraints (lMarkerName) =
_
hsTargetNoEdit
ApplicationDisplay.MarkerColor(lMarkerName) = hsRed
End If
4.
In case no instance is found, add the lines of code indicated in bold after
the existing ones, shown in normal typeface:
HeightText.Text = ““
DiameterText.Text = ““
OffsetText.Text = ““
If the blob is found, the offset of the hole from the origin of the
Object coordinate system and the diameter of the hole are
computed and displayed in the OffsetText and DiameterText text
boxes. Using the World coordinate system, the calibrated X-Y
position of the blob is used to draw a non-editable target marker on
the application display.
5.
Save your work and test the application. You should see the computed
diameter and offset of the hole in the text boxes of your application. You
should also see the target marker you added on the Display, highlighting
the position and the diameter of the hole.
HexSight Basics User Guide
78
Visual Basic Tutorials
Tutorial 5: Patter n Locator
Introduction
In this tutorial, you will learn how to set up, configure and use a Pattern
Locator tool to find and locate instances of the “HS” printed on the part.
Modifying your Application Form
First you need to add one text box to your application so you can display
the result output by the Pattern Locator.
1.
On your application form, add one text box. Name it LabelText and add
an appropriate label. Set up your form as illustrated in Figure 30.
FIGURE 30
Visual Basic Form for Tutorial 5
Placing the Pattern Locator
Select the HexSight Application Control on the form. With the right-click
menu, select Edit. Click on Execute Sequence twice to locate the object
in the second image of the emulation database. Using the Process Manager,
HexSight Basics User Guide
79
Visual Basic Tutorials
add the HSPatternLocator process from the HexSight Inspection Tools
folder. Set the tool’s General panel as follows:
1.
Enter LabelLocator as the Process Name (instead of
HSPatternLocator5).
2.
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Enable the Apply Transform to a Model-defined Location check box.
4.
Select Hook from Model View as the Input Model Scene.
5.
Enable the Lock Location Transform on a Selected Instance check
box.
6.
Select Instance Scene from Locator View as the Input Instance
Scene.
The above settings will make your application fully model-based
(automatic model-based mode). The Pattern Locator tool is defined
on the model and will be automatically transposed to fit the located
instance, whatever its scale, rotation or displacement.
7.
Click Execute. Open the Location panel.
The Location display shows the Model View. The Pattern Locator will
be applied to an area on the object bounded by the tool’s
Rectangle. The Pattern Locator will be used to verify the presence
of the “HS” label printed on the part. The green solid rectangle
defines the search area.
8.
Place the Rectangle on the part as shown in the illustration. Click the
center of the Rectangle and drag it to the center of the “HS” label. Use
the corner and side handles to adjust the width and height of the search
rectangle to fit the label. Zoom in on the label and by clicking and
dragging the arrow on the tool’s X-axis, adjust the rotation to fit the
orientation of the label. Fine-tune the position with the text boxes if
needed. Once it is placed, click Execute.
HexSight Basics User Guide
80
Visual Basic Tutorials
FIGURE 31
9.
Adjusting the Size, Position and Orientation of the
Location Rectangle
Go to the Transform panel. The image shown is that of the current
instance of the object as located in the second image of the emulation
database (if you clicked twice on Execute Sequence before creating
the Pattern Locator tool). To see the tool applied to the other instances,
leave the Pattern Locator open and click Execute Sequence in the
Process Manager. The Pattern Locator will be configured to check for the
presence of the label in the next step. Open the Pattern panel and
move on to the next step.
Placing the Pattern Rectangle
You will set up the rectangle for defining the pattern that you want the
Pattern Locator find within the Image. In our case, the Pattern Locator will
be used to verify the presence of the "HS" label printed on the part. The
Pattern display shows the Model View and the green solid rectangle defines
the pattern.
1.
Place the Rectangle on the part as shown in the illustration. Click the
center of the Rectangle and drag it to the center of the “HS” label. Use
the corner and side handles to adjust the width and height of the
HexSight Basics User Guide
81
Visual Basic Tutorials
Pattern Rectangle to fit the label. Zoom in on the label and by clicking
and dragging the arrow on the tool’s X-axis, adjust the rotation to fit the
orientation of the label. Readjust the size of the green solid pattern
Rectangle to include only the "HS" characters in the pattern. Fine-tune
the position with the text boxes if needed. Once it is placed, click
Execute.
FIGURE 32
2.
Adjusting the Size, Position and Orientation of the
Pattern Rectangle
Open the Configuration panel and move on to the next step.
Configuring the Pattern Locator
You will set up the parameters of the tool in order to detect the grey-scale
pattern on the part. The Configuration tab contains the following:
Inside the Parameters frame, set the following parameters:
• Instance To Find determines the maximum number of pattern
instances to be found.
• Match Threshold determines the minimum strength score to
accept a valid match.
HexSight Basics User Guide
82
Visual Basic Tutorials
• When Automatic Coarseness Selection is enabled, the Pattern
Locator automatically determines the Search Coarseness and
Positioning Coarseness levels.
• Search Coarseness determines the level used to find the
hypothesis of instances.
• Positioning Coarseness determines the level used to refine the
position of instances found.
1.
Set the Instance To Find value to 1.
2.
Set the Match Threshold value to 0.500
3.
Leave the Automatic Coarseness Selection check box enabled.
4.
Click Execute.
Pattern Locator Results
You will now observe the Pattern Locator’s results for various instances of
the object.
Access the Pattern Locator Results panel to observe the following:
• Each valid pattern is displayed with a blue rectangle marker
indicating the position of the pattern detected in the Search
Rectangle.
• The left display shows the grey-scale Image of the Search
Rectangle.
• The right display shows the grey-scale Image of the reference
pattern.
The Coordinate system combo indicates that the positions are returned
with respect to the Tool coordinate system (the origin centered on the
Pattern Rectangle).
The table of results indicates:
• The strength of the match.
HexSight Basics User Guide
83
Visual Basic Tutorials
• The position of the pattern according to the selected coordinate
system.
• The rotation of the pattern in calibrated rotation units.
Note: View the complete set of results using the grid’s scrollbar.
Now that the Pattern Locator is configured properly to check the presence
of the “HS” label, you will want to test and observe the Pattern Locator on
other instances of the Object by clicking Execute Sequence in the Process
Manager. Click OK and save your work before moving on to the final step.
Adding Code for the Pattern Locator
You will finish up by adding code to your Visual Basic form that will display
the result of the pattern search in the interface. You will also add a point
marker on the display to show the position of the label located by the
Pattern Locator.
1.
From the Visual Basic menu bar, select Project>References.... Scroll
down to find HexSight Pattern Locator Control. Enable its check box and
click OK. Double-click Inspect. Add the following lines of code in bold
between the existing ones written in normal typeface:
Dim lHoleBlob As HSBlobAnalyzer
Dim lLabelLocator As HSPatternLocator
...
Set lHoleBlob = lManager.Process(“HoleBlob”)
Set lLabelLocator = lManager.Process(“LabelLocator”)
This will create a reference that will be used for programmatic
access to the LabelLocator process instantiated in the HexSight
Application Control.
2.
Modify the existing line, shown in italic, for the one below it:
lManager.Execute “Acquisition”, “HoleBlob”
lManager.Execute “Acquisition”, “LabelLocator”
HexSight Basics User Guide
84
Visual Basic Tutorials
This will execute the entire sequence of processes.
3.
Now to display the result of the search in the text box and to draw the
marker on the application display, type the following lines of code in
bold after the existing one in normal typeface:
If lHoleBlob.BlobCount > 0 Then
...
End If
If lLabelLocator.MatchCount > 0 Then
LabelText.Text = “Present”
lLabelLocator.CoordinateSystem = hsCoordinateSystemWorld
lMarkerName = “HSLabel”
ApplicationDisplay.AddPointMarker lMarkerName, _
lLabelLocator.MatchPositionX(0), _
lLabelLocator.MatchPositionY(0),True
ApplicationDisplay.MarkerDisplayName(lMarkerName) = True
ApplicationDisplay.MarkerColor(lMarkerName) = hsBlue
Else
LabelText.Text = “Absent”
End If
4.
In case no instance is found, add the line of code indicated in bold after
the existing one, shown in normal typeface:
OffsetText.Text = ““
LabelText.Text = ““
5.
Save your work and test the application. You should see the presence/
absence of the “HS” label in the text box of your application. You should
also see the point marker you added on the Display, highlighting the
position of the label.
HexSight Basics User Guide
85
Visual Basic Tutorials
Tutorial 6: Edge Locator
Introduction
In this tutorial, you will learn how to set up, configure and use two Edge
Locator tools to measure non-parallel edges on the part.
Modifying your Application Form
First you need to add one text box to your application so you can observe
the result output by the Edge Locator processes.
1.
On your application form, add one text box. Name it PartWidthText and
an appropriate label. Set up your form as illustrated in Figure 33.
FIGURE 33
Visual Basic Form for Tutorial 6
Placing the Edge Locator
Select the HexSight Application Control on the form. With the right-click
menu select Edit. Click Execute Sequence twice to locate the object in
the second Image of the emulation database. Using the Process Manager,
HexSight Basics User Guide
86
Visual Basic Tutorials
add the HSEdgeLocator process from the HexSight Inspection Tools
folder. Set the tool’s General panel as follows:
1.
Enter PartLeftEdge as the Process Name (instead of HSEdgeLocator6).
2.
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Enable the Apply Transform to a Model-defined Location check box.
4.
Select Hook from Model View as the Input Model Scene.
5.
Enable the Lock Location Transform on a Selected Instance check
box.
6.
Select Instance Scene from Locator View as the Input Instance
Scene.
The above settings will make your application fully model-based
(automatic model-based mode). The Edge Locator tool is defined
on the model and will be automatically transposed to fit the located
instance, whatever its scale, rotation or displacement.
7.
Click Execute. Open the Location panel.
The Location display shows the Model View. The Edge Locator will
be applied to an area on the object bounded by the tool’s
Rectangle, which appears in green. The Edge Locator will be used
to measure the position of the left edge of the part.
8.
Place the Rectangle on the part as shown in the illustration. Click the
arrow of the X-axis and drag it to adjust the rotation to 90 degrees (the
Y-axis is used to adjust the skew). Click the center of the Rectangle and
drag it into position. Use the corner and side handles to adjust the width
and height of the Rectangle. Fine-tune the position with the text boxes if
needed. Once it is placed, click Execute.
HexSight Basics User Guide
87
Visual Basic Tutorials
FIGURE 34
Adjusting the Size, Position and Orientation of
the Edge Locator Rectangle
Note: The Edge Locator must always be as perpendicular as possible
to the edges to be measured. For the current example, the tool had
to be rotated to 90. Here the skew was left at its default value of 0
degrees.
9.
Go to the Transform panel. The Image shown is that of the current
instance of the object, as located in the second Image of the emulation
database (if you clicked on Execute Sequence twice before creating
the Edge Locator tool as indicated previously). To see the tool applied to
other instances, leave the Edge Locator window open and click Execute
Sequence in the Process Manager. Yellow lines indicate where the Edge
Locator has detected potential edges. Edge selection criteria will be set
up in the next step. Open the Configuration panel and move on to the
next step.
Configuring the Edge Locator
The Edge Locator detects potential edges. You will set up constraints that
will allow the Edge Locator to locate only valid edges, that is, those that
meet the criteria you have determined.
HexSight Basics User Guide
88
Visual Basic Tutorials
The graphic display in the Configuration panel represents the image
information contained in the Edge Locator Rectangle:
• Yellow lines indicate detected edges.
• The blue curve shows a graphical representation of a projection
that averages each column of pixels in the Rectangle to create a
one-dimensional signal. Sharp changes on this curve indicate
potential edges.
• The green magnitude curve is the first derivative of the
projection curve. High and low peaks in this curve identify
potential edges.
• Horizontal red lines indicate the magnitude threshold for the
detection of potential edges.
HexSight Basics User Guide
89
Visual Basic Tutorials
FIGURE 35
Edge Locator— Configuration Panel
In this example, the constraints used to score edges will be polarity and
position constraints.
Polarity indicates changes in light values, from left to right, within the
Rectangle.
Position constraints score each edge according to its position as defined
by the Position constraint histogram. Magnitude constraints, not used in
this tutorial, score each edge according to its magnitude as defined by the
Magnitude Constraint histogram.
The Edge Locator attributes a score to each individual edge. Scores range
from 0 to 1 with the minimum acceptable score being determined by the
HexSight Basics User Guide
90
Visual Basic Tutorials
Score Threshold, set by default at 0.250. Histogram functions for each
constraint determine how the Edge Locator scores edges.
1.
In the Edge Score box, select Polarity as Dark to Light and enable
the Position check box.
Next you must set up the Position Constraint histogram for the
edge, in the bottom left window of the Configuration panel.
2.
Use the mouse to drag the handles in the histogram editor of the
selected constraint. Set the Edge Position Constraint histogram as
illustrated in Figure 36.
3.
Click Execute.
Edges in this region
receive an increasing
score, from 0 to 1
Edges in this region
receive a declining
score, from 1 to 0
Edges in this region
receive score of 1
FIGURE 36
Position Constraint Histogram
Edge Locator Results
You will now observe the Edge Locator’s results for various instances of the
object. Access the Edge Locator Results panel to observe the following:
• Valid edges are displayed as vertical yellow lines.
• The Edge Count box indicates that the Edge Locator has found an
edge.
• The Coordinate System combo box indicates that the positions
are expressed with respect to the Tool coordinate system (the
origin centered on the tool’s Rectangle).
The table of results indicates:
HexSight Basics User Guide
91
Visual Basic Tutorials
• The score of the found edges.
• The position of the edges, expressed with respect to the selected
coordinate system.
• The rotation of the edges.
• The scores of each individual constraint.
Note: View the complete set of results using the grid’s scrollbar.
Now that the Edge Locator is configured to locate the left edge of the part,
you will want to test and observe the Edge Locator on other instances of
the Object by clicking Execute Sequence in the Process Manager. Click
OK and save your work before moving on to the next step.
Placing the Second Edge Locator
Using the Process Manager, add a second HSEdgeLocator process. Set the
tool’s General panel as follow:
1.
Enter PartRightEdge as the Process Name (instead of
HSEdgeLocator7).
2.
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Enable the Apply Transform to a Model-defined Location check box.
4.
Select Hook from Model View as the Input Model Scene.
5.
Enable the Lock Location Transform on a Selected Instance check
box.
6.
Select Instance Scene from Locator View as the Input Instance
Scene.
7.
8.
Click Execute. Open the Location panel.
Place the Rectangle on the part as shown in the illustration. Click the
arrow of the X-axis and drag it to adjust the rotation to 90 degrees.
Click the center of the Rectangle and drag it into position. Since the
edge to be located is not orthogonal to the tool’s X-axis, adjust the skew
HexSight Basics User Guide
92
Visual Basic Tutorials
by clicking and dragging the arrow of the Y-axis to make it parallel to
the right edge of the part. Fine-tune the position with the text boxes if
needed. Once the Rectangle is placed, click Execute.
FIGURE 37
9.
Adjusting Rectangle for the Hook’s Right Edge
In the Edge Score box of the Configuration panel, select Polarity as
Light to Dark and enable the Position check box.
10.
Set up the Position Constraint using the histogram editor, just as that of
the PartLeftEdge Edge Locator.
11.
Save your work and move on to the final step.
Adding Code for the Edge Locator
You will finish up by adding code to your Visual Basic form that will display
the width of the part computed from the results of the two Edge Locator
tools. You will also add a line marker on the display to show the measure
on the part.
1.
From the Visual Basic menu bar, select Project>References.... Scroll
down to find HexSight Edge Locator Control, enable its check box and
click OK. Double-click Inspect. Add the lines of code, shown in bold,
between the existing ones, shown in normal typeface:
HexSight Basics User Guide
93
Visual Basic Tutorials
Dim lLabelLocator As HSPatternLocator
Dim lPartLeftEdge As HSEdgeLocator
Dim lPartRightEdge As HSEdgeLocator
...
Dim lHoleOffset As Single
Dim lPartWidth As Single
...
Set lLabelLocator = lManager.Process(“LabelLocator”)
Set lPartLeftEdge = lManager.Process(“PartLeftEdge”)
Set lPartRightEdge = lManager.Process(“PartRightEdge”)
This will create a reference that will be used for programmatic
access to the two Edge Locator processes instantiated in the
HexSight Application Control.
2.
Modify the existing line, shown in italic, for the one below it:
lManager.Execute “Acquisition”, “LabelLocator”
lManager.Execute “Acquisition”, “PartRightEdge”
This will execute the entire sequence of processes.
3.
Now to display the measurement in the text box and to draw the marker
on the application display, type the lines of code, shown in bold, after
the existing ones, shown in normal typeface:
If lLabelLocator.MatchCount > 0 Then
...
End If
If (lPartLeftEdge.EdgeCount > 0) And _
(lPartRightEdge.EdgeCount > 0) Then
lPartLeftEdge.CoordinateSystem = hsCoordinateSystemObject
lPartRightEdge.CoordinateSystem = hsCoordinateSystemObject
lPartWidth = lPartRightEdge.EdgePositionY(0) - _
HexSight Basics User Guide
94
Visual Basic Tutorials
lPartLeftEdge.EdgePositionY(0)
PartWidthText.Text = Format(lPartWidth, “0.00”)
lPartLeftEdge.CoordinateSystem = hsCoordinateSystemWorld
lPartRightEdge.CoordinateSystem = hsCoordinateSystemWorld
lMarkerName = “Part Width”
ApplicationDisplay.AddLineMarker lMarkerName, _
lPartLeftEdge.EdgePositionX(0), _
lPartLeftEdge.EdgePositionY(0),_
lPartRightEdge.EdgePositionX(0), _
lPartRightEdge.EdgePositionY(0), True
ApplicationDisplay.MarkerAnchorStyle(lMarkerName) = hsCross
ApplicationDisplay.LineMarkerConstraints(lMarkerName) = _
hsLineNoEdit
ApplicationDisplay.MarkerColor(lMarkerName) = hsGreen
ApplicationDisplay.MarkerDisplayName(lMarkerName) = True
End If
4.
In case no instance is found, add the following line of code after the
existing one in normal typeface:
LabelText.Text = ““
PartWidthText.Text = ““
5.
Save your work and test the application. You should see the part width
in the Part Width text box of your application. You should also see the
line marker you added on the Display highlighting the measurement.
HexSight Basics User Guide
95
Visual Basic Tutorials
Tutorial 7: Calibration
Introduction
In this tutorial, you will learn how to calibrate the system to perform
acquisitions of live images. Calibration is an important step that can correct
certain perspective and lens distortions. It also allows you to specify the
basic length units you will use throughout your entire application.
Camera Calibration
The calibration is performed in the Acquisition Device. In this example, the
calibration is performed with the largest calibration target provided with
your HexSight package (it possesses a dot pitch of 10 mm).
1.
Open the Acquisition Device Properties. Select the Configurations
panel. On the Input sub-panel, select Copy Configuration and then
select Paste Configuration.
2.
In the displayed window, enter Camera as the new configuration name.
3.
Select the newly created Camera configuration in the list and click Set
As Default.
4.
In the Input sub-panel, select Generic Frame grabber and click
Apply.
5.
Go to the Calibration sub-panel. Select Distortion Model. Click Show
Calibration Dialog. The Calibration - Distortion Model dialog is
displayed (see Figure 38).
HexSight Basics User Guide
96
Visual Basic Tutorials
FIGURE 38
6.
Distortion Model Calibration Dialog
Click Real-Time to display the image from the camera. Position the grid
of dots to cover the whole area. Set the focus and other settings of your
camera to obtain the best image possible. Then click Real-Time again
to stop real time acquisitions
7.
8.
Click Detect to detect the dots on the target.
The dot pitch is known to be 10.0 mm. Enter the dot pitch in the Dot
Pitch box.
9.
Zoom in at the lower left corner of the display. A green coordinate
system marker should be displayed in the bottom left, as in Figure 39.
HexSight Basics User Guide
97
Visual Basic Tutorials
Note that this coordinate system is displaceable programmatically or
with the mouse; leave it as is for this tutorial.
FIGURE 39
10.
11.
Zoom-in on the Coordinate Marker in
the Calibration Dialog
Click Solve. The statistics appear in the Results frame. Click OK.
The calibration procedure is completed. The computed calibration
parameters appear in the Parameters grid. Click Apply to apply the
calibration to the Camera configuration.
12.
13.
Click OK to close the Acquisition Device’s properties window.
You are now ready to run the application with live images using the
Paper Hook provided with your HexSight package.
HexSight Basics User Guide
98
Visual C++ Tutorials
Visual C++ Tutorials
The tutorials in this chapter will guide you through the development of a
HexSight application in Visual C++. As you follow the steps for each
tutorial you will build an object location application to which you will add
and configure a full range of inspection tools.
Note: This tutorial presumes you have a basic beginner’s knowledge
of Visual C++, MFC and COM. To compile the tutorials, the MFC
source code must be installed and the "VisualC++_Path/MFC/src"
directory must be added to the list of search paths used to find
Included files (select the menu Tools>Options >Directories to append
the list of search paths).
Chapter Outline
Tutorial 1: Locator
Tutorial 2: Display
Tutorial 3: Caliper
Tutorial 4: Blob Analyzer
Tutorial 5: Pattern Locator
Tutorial 6: Edge Locator
Tutorial 7: Calibration
HexSight Basics User Guide
99
Visual C++ Tutorials
Tutorial 1: Locator
Introduction
This first tutorial shows you how to build a basic HexSight application that
will locate a model-defined object at whatever angle and displacement it
appears.
Creating the Project
In this section, you will create the Project of the application, add basic lines
of code to interact with the interface, and add a HexSight Application
Control, which you will edit to build the application.
Constructing the Project
Here you will build the project that will allow you to specify which
type of program you want and which files to use to build it.
1.
Start Visual C++. Create a new MFC AppWizard (exe) project.
Name it HookInspection and specify a working folder in the
location field, then click OK.
2.
3.
In Step 1 of MFC AppWizard, select Dialog based.
In Step 2, disable the About box and specify Hook Inspection
for the title. Click Finish.
4.
Developer Studio shows you which options will be used to
generate the sketch of the project of your program. Click OK.
5.
The most important files generated by the wizard are
HookInspectionDlg.h and HookInspectionDlg.cpp.
You can already compile this basic project, but you must add some
lines of code and create the interface for your application to make
this a useful project.
HexSight Basics User Guide
100
Visual C++ Tutorials
Constructing the Program Interface
Here you will build the interface that will allow you to interact with
your application and visualize results.
1.
2.
Click on the ResourceView tab shown at the bottom left of the
Workspace window to open the dialog template of the project.
Select the dialog template and resize it to approximately 226 X 149.
Look in the status bar at the bottom of the screen; the size is shown at
right.
3.
On the dialog template, remove all existing dialog items and add a
Group Box. Add 5 edit boxes respectively named IDC_EDIT_TYPE,
IDC_EDIT_SCALE, IDC_EDIT_ROTATION,
IDC_EDIT_TRANSLATION_X and IDC_EDIT_TRANSLATION_Y.
Also set the Group Box caption, the edit box dimensions and add labels.
The text for the edit boxes should be empty. Your dialog template should
look like the dialog in Figure 40.
FIGURE 40
4.
Visual C++ Dialog with Object Pose
At the bottom of the dialog template, add 3 command buttons named
IDC_BUTTON_INSPECT, IDC_BUTTON_CONFIGURE and
IDC_BUTTON_QUIT. Set the caption of these buttons respectively to:
Inspect, Configure and Quit.
HexSight Basics User Guide
101
Visual C++ Tutorials
5.
Add a check box named IDC_CHECK_CONTINUOUS, and set its
caption to Continuous Mode. Finally, add an edit box named
IDC_EDIT_TIME and an appropriate label. Place everything to look like
the following illustration. The interface is almost complete. Save your
work.
FIGURE 41
Visual C++ Dialog with Command Buttons
Adding the Member Variables
To simplify the interaction with the interface, we will now add some
member variables with the help of MFC ClassWizard.
1.
Press CTRL+W; the MFC ClassWizard window will appear.
2.
Click on the Member Variables tab and select
CHookInspectionDlg in the Class Name combo box. You will see
something like the dialog in Figure 42.
HexSight Basics User Guide
102
Visual C++ Tutorials
FIGURE 42
3.
MFC ClassWizard Member Variables Editor
For each Control ID, you must add a member variable. To add a member
variable, double-click the Control ID and complete the form. Below you
can see the completed form for IDC_BUTTON_CONFIGURE.
FIGURE 43
4.
Adding a Member Variable with MFC
Add the other member variables according to the list in Table 1.
HexSight Basics User Guide
103
Visual C++ Tutorials
TABLE 1
Member Variables
Control ID
Type
Member
IDC_BUTTON_INSPECT
CButton
mInspectButton
IDC_BUTTON_QUIT
CButton
mQuitButton
IDC_CHECK_CONTINUOUS
CButton
mContinuousCheck
IDC_EDIT_ROTATION
CEdit
mRotationText
IDC_EDIT_SCALE
CEdit
mScaleText
IDC_EDIT_TIME
CEdit
mTimeText
IDC_EDIT_TRANSLATION_X
CEdit
mTranslationXText
IDC_EDIT_TRANSLATION_Y
CEdit
mTranslationYText
IDC_EDIT_TYPE
CEdit
mTypeText
Adding a HexSight Application Control
You will now add an ActiveX Control on the dialog template: the
HexSight Application Control, which is the core of each HexSight
machine vision application.
1.
Right-click in the dialog template. In the pop-up window, select
Insert ActiveX Control...
2.
Scroll down to find HSApplication Control. Select it and click OK.
The HexSight Application Control appears as a new icon in the
dialog template. Drag it to a more convenient place.
HexSight Basics User Guide
104
Visual C++ Tutorials
FIGURE 44
3.
Visual C++ Dialog with HexSight Application
Right-click the HexSight Application Control icon and select
Properties in the pop up window. Name it
IDC_CONTROL_APPLICATION.
4.
You must manually add a data member in the class.
IMPORTANT:
DO
USE THE C LASS W IZARD TO ADD
H EX S IGHT CONTROLS . T HE WRAPPERS
GENERATED BY THE CLASSWIZARD MAY CAUSE COMPATIBILITY
PROBLEMS WHEN USED FOR H EX S IGH T A CTIVE X C ONTROLS . YOU
MUST USE THE WRAPPERS DISTRIBUTED WITH H EX S IGHT . A LWAYS
USE THE FOLLOWING PROCEDURE WHEN YOU ADD A HEXSIGHT
CONTROL .
NOT
VARIABLES REPRESENTING
5.
Open the HookInspectionDlg.h file. Add the lines indicated in bold
after the existing lines, shown in normal typeface:
#if_MSC_VER>=1000
#pragma once
#endif//_MSC_VER_>=1000
#include "HSApplication.h"
[....]
//{{AFX_DATA(CHookInspectionDlg)
HexSight Basics User Guide
105
Visual C++ Tutorials
enum{IDD=IDD_HOOKINSPECTION_DIALOG};
HSApplication mApplicationControl;
6.
Open the HookInspectionDlg.cpp file and add the following line
(bold) in the DoDataExchange method:
//{{AFX_DATA_MAP(CHookInspectionDlg)
DDX_Control(pDX,IDC_CONTROL_APPLICATION, _
mApplicationControl);
7.
Select the FileView tab at the bottom of the screen.
8.
Right-click on HookInspection files node and select Add Files to
Project.
9.
Go to HexSight’s installation directory and open the Wrappers
directory. Make a note of the entire path for this directory since
you will need it later.
10.
Select the following files: HSApplication.h, HSApplication.cpp,
HSCalibration.h, HSCalibration.cpp, HSDatabase.h,
HSDatabase.cpp, HSErrorObject.h, HSErrorObject.cpp,
HSExplorer.h, HSExplorer.cpp, HSImage.h, HSImage.cpp,
HSLocator.h, HSLocator.cpp, HSModelEditorInterface.h,
HSModelEditorInterface.cpp, HSProcessManager.h,
HSProcessManager.cpp, HSScene.h, HSScene.cpp, HSView.h and
HSView.cpp. Click OK.
11.
Before compiling, add the Wrappers path in the list of directories
used for the search of included files. Use the Project/Setting...
Menu. Select the C/C++ tab, then indicate the Category
Preprocessor. Modify the combo box Setting For to All
Configurations. Add the Wrappers path (previously noted) in the
Additional include directories edit box. Click OK.
12.
Now you can compile your project without receiving error
messages.
HexSight Basics User Guide
106
Visual C++ Tutorials
Adding Basic Code to the Main Form
You need to add basic code to be able to interact with your
application. As you will add new features throughout the other
tutorial sections, you will also add lines to this code.
1.
Return to the Resource Editor and display the Dialog Box of your
application.
2.
3.
Double-click Quit.
A window will appear (if not, this is because the Double-click in
dialog editor edits code option is not selected in
Tools>Options>Compatibility tab); double-click the message
BN_CLICKED. Developer Studio will ask you to confirm the name
of the function to add. Accept the default name (OnButtonQuit).
4.
Click Edit Existing and add the following code in the function:
void CHookInspectionDlg::OnButtonQuit()
{
WaitForCompletion();
EndDialog( IDOK );
}
This will terminate the application when the Quit button is clicked.
5.
You must add the WaitForCompletion function in your project.
Click on the ClassView tab and right-click on the
CHookInspectionDlg class. Select the Add Member Function...
command. The function’s type is void and it is declared as
WaitForCompletion. Indicate that this function is private. Click
OK and add the following code in the function:
void CHookInspectionDlg::WaitForCompletion()
{
if ( mContinuousCheck.GetCheck() != 0 )
{
HexSight Basics User Guide
107
Visual C++ Tutorials
mContinuousCheck.SetCheck( 0 );
}
}
6.
Return to the Resource Editor, double-click Configure (follow the
same as steps for the Quit button) and add the following lines of
code:
void CHookInspectionDlg::OnButtonConfigure()
{
ColeVariant lVariant;
lVariant.vt = VT_ERROR;
mApplicationControl.ShowInterface(FALSE, lVariant);
}
This will show the HexSight Application Control’s interface in a nonmodal window when the Configure button is clicked.
7.
In the Resource Editor, double-click Inspect (follow the same as
steps for the Quit button) and add the following lines of code:
void CHookInspectionDlg::OnButtonInspect()
{
try
{
HSProcessManager lManager;
mInspectButton.EnableWindow( FALSE );
lManager = mApplicationControl.GetProcessManager();
// Inspection loop
do
{
HexSight Basics User Guide
108
Visual C++ Tutorials
DoEvents();
}
while( mContinuousCheck.GetCheck() == 1 );
mInspectButton.EnableWindow( TRUE );
}
catch( ... )
{
mInspectButton.EnableWindow( TRUE );
throw ;
}
}
This is the main loop of the inspection application. It loops until
Continuous Mode is disabled in the interface.
8.
In C++, there is no equivalent for the DoEvents function in Visual
Basic; you must create it. You must add these lines at the
beginning of the HookInspectionDlg.cpp file, just before the
declaration of the constructor of CHookInspectionDlg:
void DoEvents( void )
{
MSG lMessage;
while ( PeekMessage( &lMessage, NULL, 0, 0, PM_REMOVE ) !=
FALSE )
{
TranslateMessage( &lMessage );
DispatchMessage( &lMessage );
}
}
9.
Lastly, you must add the Message handlers to stop the Continuous
mode before exiting the program. Press CTRL+W; MFC
ClassWizard will appear. Click on the Message Maps tab. Select
HexSight Basics User Guide
109
Visual C++ Tutorials
CHookInspectionDlg in ClassName. Select CHookInspectionDlg in
Object IDs. In the list of messages, find and double-click
WM_CLOSE and WM_DESTROY. Add the following code in the
new functions:
void CHookInspectionDlg::OnClose()
{
WaitForCompletion();
CDialog::OnClose();
}
void CHookInspectionDlg::OnDestroy()
{
CDialog::OnDestroy();
WaitForCompletion();
}
10.
You have completed the code needed to use your application. Run
and test the application. When you are sure that everything works
fine, save your work and go on to the next section.
Adding an Acquisition Device Tool
In this section, you will learn how to instantiate a process in the HexSight
Application Control. You will also learn how to configure an Acquisition
Device tool. This tool will acquire a grey-scale Image from an existing
database file to simulate real image acquisition.
Instantiating the Acquisition Device
In order to build a vision application, HexSight processes are
instantiated using the Application Control’s Process Manager.
1.
On the dialog template, right-click the HexSight Application
Control. Select HSApplication Control Object>Edit from the
HexSight Basics User Guide
110
Visual C++ Tutorials
menu. The HexSight Application Control’s interface is shown and
the active tab is the Process Manager. In the Available Processes
list of the Process Manager, select HSAcquisitionDevice and click
Add Process. The Acquisition Device Properties window appears.
At the end of this tutorial, the HexSight Application Control should
look like the illustration in Figure 45.
Selection
tabs
Instantiated
processes
Available
processes
Execute
Sequence
Command
Help
Command
FIGURE 45
HexSight Application Control — Process Manager
Configuring the Acquisition Device
You will use an existing database of images to simulate a real
image acquisition. The database used for this tutorial is constituted
of images of the same objects, rotated at different angles.
1.
In the Acquisition Device General panel, enter Acquisition as the
Process Name (instead of HSAcquisitionDevice0).
2.
In the Configuration panel, select the Input tab. Select File
Emulation from the list.
3.
Click Load then load the following file:
InstallationPath\Tutorial\VisualC++\HookInspection\Data\Hook.hd
b.
HexSight Basics User Guide
111
Visual C++ Tutorials
4.
Disable all the images of the emulation database except the first
one: Image0. This ensures that this image will be used to create
the model later in this tutorial.
FIGURE 46
5.
Acquisition Device — Configuration Panel
Leave the default settings for the Calibration and Output subpanels. Click OK to return to the Process Manager of the HexSight
Application Control.
To sequentially execute the processes instantiated in the Process Manager,
you can click Execute Sequence. For instance, if more than one Image is
enabled in the Emulation list of the Acquisition Device, clicking Execute
HexSight Basics User Guide
112
Visual C++ Tutorials
Sequence in the Process Manager will output a new Grey-Scale Image and
execute the subsequent processes in the list.
Viewing Scenes and Images
The Explorer panel of the HexSight Application Control shows a
hierarchical view of all Views, Scenes and Images held in the application’s
runtime database.
1.
Select the Explorer panel in the HexSight Application Control.
2.
Expand the database by clicking on the + sign next to it.
3.
Expand Acquisition, then, Images. Click Grey-Scale Image. This will
display the Grey-Scale Image output by the acquisition process, as
illustrated in Figure 47.
FIGURE 47
HexSight Application Control — Explorer
HexSight Basics User Guide
113
Visual C++ Tutorials
Adding a Locator Tool
The Locator locates model-defined objects within the input grey-scale
Image, using the geometry of their contours. The Locator interface
provides:
• A General panel for configuring the input and the outputs.
• A Contour panel for setting the region of interest in the image
and optionally customizing contour detection parameters.
• A Model panel for creating and editing models.
• A Search panel for configuring the search and setting constraints
on the rotation, the scale factor, the number of instances to find,
etc.
• A Results panel for viewing the results of the search.
Instantiating the Locator
Here you add a Locator process the same way you added the
Acquisition Device.
1.
In the HexSight Application Control Process Manager, select
HSLocator from the HexSight Locator Tools folder. Click Add
Process.
2.
In the properties window of the newly added Locator process,
select the General tab.
3.
Enter the name Locator instead of HSLocator1.
4.
In the Input section, click on the database selection icon then
select Acquisition->Grey-Scale Image. See Figure 9.
HexSight Basics User Guide
114
Visual C++ Tutorials
Selection icon
FIGURE 48
5.
Database Selection Icon
In the Output frame leave the default names for Model View and
Instance Scene. Leave their corresponding check boxes enabled
to ensure that the Model View and Instance Scene are output to
the runtime database.
6.
Click Execute.
Contour Detection Parameters
1.
Select the Contour tab.
2.
Leave the default settings as is for the Search Area.
To accelerate the Locator process, it is possible to constrain the
search to a specific area of the input image, called the Search
Area. To specify a Search Area other than the entire image, disable
the Entire Image check box. This feature will not be used in this
tutorial.
3.
Leave the default settings for Detection parameters.
HexSight Basics User Guide
115
Visual C++ Tutorials
Setting the Parameters Based on combo box to All Models will
automatically select the best contour detection parameters
according to the active models. Contour detection can be
customized by choosing Custom in the combo box. Automatic
selection of contour detection parameters usually works best and
customizing the values should only be necessary with very
degraded input images.
4.
Click Execute. Observe differences in the two coarseness levels of
contours by clicking the Detail, Level or Both tabs below the
display.
Creating a Model
In this section, you will learn how to create a Model of an object
using the Model Editor. A Model is a reference or “ideal”
representation of an object’s contours that will be used by the
Locator’s search process to recognize and locate instances of the
object. Models can be stored in database files for later use.
1.
Select the Model tab, then click Add in the Models frame. The
Create New Model prompt appears.
FIGURE 49
Create New Model Dialog
2.
Name the Model Hook.
3.
Click OK to open the Model Editor.
Using the Model Editor
The Model Editor is used to create new models and to modify
existing models. Once you have created a model of the hook for
HexSight Basics User Guide
116
Visual C++ Tutorials
this application, you will save it for later use with the rest of the
tutorial.
Creating the Source Contours and Selecting Model Features
The Locator uses two coarseness levels to recognize and locate the
object: the Outline Level and the Detail Level. The outline
coarseness level is used to rapidly identify potential instances of
the object. The detail coarseness level is used to confirm that it is
the correct object and to refine its location within the image.
Source contours will be created at the selected Outline Level and
Detail Level. Features will be selected from these source contours
to create the Model.
When the Automatic Levels check box is enabled, the two contour
detection parameters (Outline Level and Detail Level) are
automatically optimized by analyzing the Model’s bounding area.
Automatic contour detection parameters should usually be used
when building a Model.
Contrast Threshold is used to set the sensitivity to contrast when
generating the source contours. Contrast Threshold can be
setting manually, by selected Fixed value with the combo box, or
automatically by selecting Adaptive Low Sensitivity, Adaptive
Normal Sensitivity or Adaptive High Sensitivity.
Tracking Inertia is used to close small gaps that may appear in
the source contours. It defines the longest gap that can be closed
to connect two edge elements when building the source contours.
Once the source contours are detected, features must be selected
to build the Model. Features can be selected manually, by setting
the Feature Selection slider to none, or automatically by
selecting less, normal, more or all. Setting the slider to normal
will select the optimal amount of features at both the Outline and
Detail Levels. Increasing the setting will add more features, which
HexSight Basics User Guide
117
Visual C++ Tutorials
may slow the search process. Decreasing the setting may cause
recognition problems because the Model may lack essential
features.
In this tutorial, we will use the default contour detection and
feature selection parameters to build the model, as shown in Figure
50.
1.
In the Contour Detection frame, leave the Automatic Levels
check box enabled, Tracking Inertia to 0 and Contrast
Threshold combo box to Adaptive Normal Sensitivity.
FIGURE 50
2.
Model Editor Interface
In the Feature Selection frame, leave the slider in the default
normal position.
HexSight Basics User Guide
118
Visual C++ Tutorials
3.
In the display, drag and resize the green dotted rectangle (the
Model’s bounding box) to enclose the entire object.
4.
Click Build Model.
A Model is now created. Contour detection parameters have been
optimized and features were selected at both the outline and Detail
Levels. The Outline Level has been set to 8, while 1 was selected
for the Detail Level. To verify that no problem was encountered
while building a model, check the Messages text box.
You can view the Model using the display. By selecting the Outline
tab at the bottom of the display, you can view the Model at the
Outline Level. The selected features are shown as bold magenta
lines. Unused contours at the Outline Level are shown as thin blue
lines. The features at the Detail Level can be viewed by selecting
the Detail tab at the bottom of the display. The selected features
are shown as bold green lines. As with the Outline Level, unused
contours are shown as thin blue lines. To view the outline and
Detail Levels superimposed, click the Both tab at the bottom of the
display.
The Model can now be used to locate instances of the object. We
will however edit it to show how the Model Editor can be used to
customize a model for a specific application.
Removing Features from a Model
The application we are building in this tutorial will be used to
inspect features on the hook with respect to its outer contour. The
steps will be to locate the part using its outer contour and apply
tools to inspect the rounded rectangle, the hole and the label.
These features need to be inspected because they might be missing
on actual parts, be the wrong size, or be mislocated with respect to
the outer contour. Since these features are unstable, they must be
HexSight Basics User Guide
119
Visual C++ Tutorials
removed from the model to get the best precision possible on the
location of the outer contour in the image.
The first step will be to remove unwanted features at the Outline
Level.
1.
Click the Outline tab at the bottom of the display. It will enable
you to edit the Model at the Outline Level. The grid in the Model
Contents frame displays the Features sub-panel for the Outline
level of the Model.
2.
Click the Features tab in the Model Contents frame to activate
the features grid.
3.
Select the rounded rectangle feature by either clicking it in the
display or by selecting it in the features grid.
4.
5.
Click Delete to remove this feature from the Model.
The next step will be to remove unwanted features at the Detail
Level.
6.
Click the Detail tab at the bottom of the display. It will enable you
to edit the Model at the Detail Level.The grid in the Model
Contents frame displays the Features sub-panel for the Detail
level of the Model.
7.
Select all the features, except the outer contour, by clicking them
while holding the Ctrl key either in the display or in the Features
grid.
8.
Click Delete to remove these features from the Model.
The unstable features are now removed from the model. To view
the outline and Detail Levels superimposed, click the Both tab at
the bottom of the display. In this viewing mode, the model is not
editable.
HexSight Basics User Guide
120
Visual C++ Tutorials
Setting the Object Coordinate System for a Model
The part inspection process requires that the measurements of the
features be expressed with respect to the outer contour of the part.
To fix a reference frame to express these inspection results, we will
define an Object coordinate system for the part.
1.
Click the Outline or the Detail tab at the bottom of the display. It
will enable you to edit the Object coordinate system.
2.
Click the Coordinate System tab in the Model Contents frame
to activate the coordinate system panel.
3.
Use the mouse to position the coordinate system marker (yellow
axes) over the object, as shown in Figure 51. To rotate the object
coordinate system, click on the arrow of the X or the Y-axis and
drag with the mouse. To move the coordinate system, click the
intersection of the X- and Y-axes and drag with the mouse. You can
also drag the arrow of the axes to stretch them, which will have no
effect on the Object coordinate system itself, but can help you
align the marker over long features. Fine-tune the final position
with the text boxes in the Coordinate System panel.
Coordinate system marker
Coordinate System panel
FIGURE 51
Adjusting the Position and Orientation of the Model Coordinate
System
HexSight Basics User Guide
121
Visual C++ Tutorials
Adding Reference Points to a Model
For some applications, it is sometimes useful to have the position of
specific points on the Model transposed in the World coordinate
system for each object instance located. To do so without having to
compute coordinate transforms manually, reference points can be
defined on a Model. In this application, we will add a reference
point above the circular hole.
1.
Click the Outline or the Detail tab at the bottom of the display. It
will enable you to edit the reference points.
2.
Click the Reference Points tab in the Model Contents frame to
activate the reference points panel.
3.
4.
Click Add to create a reference point in the display.
Click and drag the target marker to position the reference point
above the circular hole in the part. Zoom in for more precision.
Fine-tune the position using the text boxes in the Reference
Points panel.
Reference point marker
Reference Points sub-panel
FIGURE 52
Adding a Reference Point with the Model Editor
This reference point will not be used to locate the part, only
contour features are used for locating objects. However, for each
instance of the object that will be located, the reference point’s
position will be returned with respect to the scale, rotation and
HexSight Basics User Guide
122
Visual C++ Tutorials
translation of this instance. You can add as many reference points
as you need on a Model.
Manually Adding Features to a Model
In Model Editor, you can select features from the unused contours
at the Outline Level as well as the Detail Level. To add a feature at
the Outline Level, follow the procedure below.
1.
Click the Outline tab at the bottom of the display. It will enable
you to edit the Model at the Outline Level.
2.
Click the Features tab in the Model Contents frame to activate
the features grid.
3.
Disable the Grey-Scale Image check box in the Show frame to
show only the contours. This will make the blue unused contours
more visible.
4.
In the display, click one of the unused contours, the rounded
rectangle for example. The contour turns light blue.
5.
Click a starting point on the contour. Hold the Ctrl key and click
another point on the contour. The selected feature appears in red.
6.
To invert your selection, hold the Shift key while clicking on the
contour. Click Add in the Model Contents frame. The new feature
appears in the features grid.
7.
Select the newly added feature in the grid and click Delete to
remove it from the Model.
8.
To add the entire rounded rectangle as a feature, double-click it in
the display so the whole contour is selected. Click Add to add this
feature to the model.
9.
Select the newly added feature in the grid and click Delete to
remove it from the Model, since it is considered unstable for this
application.
HexSight Basics User Guide
123
Visual C++ Tutorials
Analyzing a Model
When a Model has been edited manually, it is important to verify
that it will work correctly with the Locator. To do so, click Analyze
Model in the Model Contents frame. Any problem will be
displayed in the Messages frame.
Saving a Model Database
When a Model is completed, it must be saved in a model database,
otherwise it will be lost when you exit the application. To save the
Model, follow the procedure below.
1.
Click OK at the bottom right of the Model Editor. This will transfer
the newly created Model to the active model database of the
Locator.
2.
3.
In the Locator’s properties window, select the Model tab.
Click Save As... in the Database frame. Save your Model as
HookModel in your working directory. You will find it convenient to
store Models close to other HexSight files used in a same
application, such as image emulation files, the Process Manager
configuration file, etc.
4.
You can return edit your Model at any time by clicking Edit in the
Models frame.
Configuring Search Parameters
Search parameters are used to constraint the search and configure
object recognition and positioning algorithms.
1.
Select the Search tab.
2.
Leave the Nominal Scale check box enabled. Its value in the text
box should be 1.0.
3.
Leave the Nominal Rotation check box disabled, with the range
between -180.0 to 180.0.
HexSight Basics User Guide
124
Visual C++ Tutorials
4.
Leave all the other parameters to their default setting also.
Executing the Locator and Verifying the Results
Once the Model is created and the search is configured, the first
step is to verify that the Locator finds the object on the image that
was used to create the model.
1.
Select the Results tab.
2.
Click Execute at the bottom of the Locator’s properties window.
3.
Verify in the grid that the instance was located correctly.
4.
Click Show Results Viewer to view the located instance
superimposed on the Grey-Scale Image, as shown in Figure 53.
5.
Move the Locator properties window and the Results Viewer to a
corner of your screen.
FIGURE 53
Results Viewer and Results Panel of the Locator Tool
HexSight Basics User Guide
125
Visual C++ Tutorials
The next step is to verify that the object is located in all the images in the
emulation database.
1.
In the Process Manager, open the Acquisition Device properties window.
Select the Configuration panel, then click Enable All to enable all the
images in the emulation database. Click OK to close the Acquisition
Device’s properties window.
2.
Return to the Process Manager and click Execute Sequence.
3.
In the Results panel of the Locator properties window, check if the
instance was located correctly. Return to the Process Manager and click
Execute Sequence several times to apply the Locator to each of the
images.
4.
Close the Results Viewer window, return to the Locator Properties
window and click OK.
5.
Now is a good time to return to the Visual C++ dialog and save your
work. Close the window to exit the Process Manager. To return to the
application, you will have to right-click the HexSight icon and select
HSApplication Control Object>Edit.
Adding Code for the Locator
In this section, you will add code to output the properties of the
instance found by the Locator in your application interface.
1.
Add this line following the include files already in
HookInspectionDlg.cpp:
#include "HSLocator.h"
2.
Locate the OnButtonInspect function and add the lines of code
shown here in bold:
Note: Existing code appears in normal typeface.
HSProcessManager lManager;
HSLocator
lLocator;
DWORD lStartTime;
HexSight Basics User Guide
126
Visual C++ Tutorials
DWORD lStopTime;
mInspectButton.EnableWindow( FALSE );
lManager = mApplicationControl.GetProcessManager();
lLocator = lManager.GetProcess( COleVariant( "Locator" ) );
This code creates a reference to the Locator process contained in
the HexSight Application Control. This reference will be used to
access the tool programmatically.
3.
In the existing “do” loop of the OnButtonInspect procedure, add
the following lines of code shown in bold:
do
{
lStartTime = GetTickCount();
// Execute processes in the process list
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant( "Locator" ) );
if ( lLocator.GetInstanceCount() > 0 )
{
CString lBuffer;
// An instance of the object is found
// Output the properties of the located instance in
// text boxes
mTypeText.SetWindowText(
lLocator.GetInstanceModelName(0) );
lBuffer.Format( "%.2f",
lLocator.GetInstanceScaleFactor(0) );
mScaleText.SetWindowText( lBuffer );
lBuffer.Format( "%.2f",
lLocator.GetInstanceRotation(0) );
mRotationText.SetWindowText( lBuffer );
HexSight Basics User Guide
127
Visual C++ Tutorials
lBuffer.Format( "%.2f",
lLocator.GetInstanceTranslationX(0) );
mTranslationXText.SetWindowText( lBuffer );
lBuffer.Format( "%.2f",
lLocator.GetInstanceTranslationY(0) );
mTranslationYText.SetWindowText( lBuffer );
}
else
{
// No object is found
mTypeText.SetWindowText( "" );
mScaleText.SetWindowText( "" );
mRotationText.SetWindowText( "" );
mTranslationXText.SetWindowText( "" );
mTranslationYText.SetWindowText( "" );
}
// Compute elapsed time
lStopTime = GetTickCount();
UpdateElapsedTime( lStartTime, lStopTime );
DoEvents();
}
while( mContinuousCheck.GetCheck() == 1 );
Each time the loop is executed, this code executes the Application
Control’s sequence of process from “Acquisition” to “Locator”. If no
parameter is specified to the Execute method of the Process
Manager, the whole sequence of processes will be executed, which
in this case will yield the same result. After HexSight processes are
executed, the pose (scale, rotation and translation) and type
(model name) of the located instance are displayed in the
interface.
HexSight Basics User Guide
128
Visual C++ Tutorials
4.
You must add a UpdateElapsedTime private member function declared
as follows:
void
CHookInspectionDlg::UpdateElapsedTime(
DWORD const pStart,
DWORD const pStop )
{
DWORD
lElapsed;
CString lBuffer;
if ( pStop < pStart )
{
lElapsed = (DWORD)(-1) - pStart + pStop + 1;
}
else
{
lElapsed = pStop - pStart;
}
lBuffer.Format( "%lu", lElapsed );
mTimeText.SetWindowText( lBuffer );
}
This function allows bypassing of the GetTickCount limit, which is
limited to 49.7 days. If you need to know the elapsed time in an
industrial application, you must use another solution beside
GetTickCount.
5.
At this moment, your application interface and code should look
almost exactly like the example in
InstallationPath\Tutorial\VisualC++\HookInspection\Part1. Save
your work and move on to the next step.
Testing the Application
You are ready to test your application.
HexSight Basics User Guide
129
Visual C++ Tutorials
1.
To start the running Mode, press the F5 key. Click Inspect a few
times.
The properties of the found instances displayed in the text boxes
should be updated every time you press Inspect.
2.
Enable the Continuous Mode check box and click Inspect. The
application should run in continuous mode. Exit the Continuous
Mode by disabling the check box. Exit the Run mode by closing the
window or by clicking Quit.
This concludes this tutorial. After debugging, save your work and move on
to the next tutorial where you will add a display to your application.
HexSight Basics User Guide
130
Visual C++ Tutorials
Tutorial 2: Display
Introduction
This second tutorial shows you how to add a Display to your application
interface. A Display allows you to view Images and Scenes processed by
the HexSight Application Control.
Adding the Display to the Interface
First, you will modify the interface of your application by adding the
Display.
1.
Start by extending the dialog template. Set the width to approximately
486 and the height to approximately 239. Reorganize the text boxes and
buttons to look like the dialog in Figure 54.
FIGURE 54
2.
Resized Visual C++ Dialog for Tutorial 2
Right-click the dialog and select Insert ActiveX Control... Scroll down
to find HSDisplay Control, select it and click OK. The HexSight Display
appears on the dialog.
HexSight Basics User Guide
131
Visual C++ Tutorials
3.
Set the width to 253 and height to 225. In its properties, change it ID to
IDC_CONTROL_DISPLAY.
FIGURE 55
4.
Visual C++ Dialog for Tutorial 2
Manually add a HSDisplay mApplicationDisplay Member Variable. Do
not use the ClassWizard. Follow the same procedure used in Tutorial 1
to manually add a data member for HSApplication Control (page 104).
5.
Finally add the HSDisplay.h and HSDisplay.cpp file to project,
provided with HexSight, from the Wrappers directory.
Adding Code for the Display
The following lines of code are needed to update the Display output
every time the inspection loop is executed.
1.
Add these lines following the include files already in
HookInspectionDlg.cpp:
#include "HSAcquisitionDevice.h"
#include "HSDatabase.h"
2.
Add these wrappers (.h and .cpp) in your project:
HSAcquisitionDevice
HexSight Basics User Guide
132
Visual C++ Tutorials
HSCalibrationDistortionInterface
HSCalibrationPerspectiveInterface
HSCalibrationXYScaleInterface
3.
Add the following lines of code (in bold) inside the existing
OnInitDialog function (in normal typeface):
SetIcon(m_hIcon, TRUE);
// Set big icon
SetIcon(m_hIcon, FALSE);
// Set small icon
HSAcquisitionDevice lAcquisition =
mApplicationControl.GetProcessManager().GetProcess(
COleVariant( "Acquisition" ) );
// Inits the Application Display
mApplicationDisplay.SetImageDatabase ( 0,
mApplicationControl.GetDatabase().GetHandle() );
if ( lAcquisition.IsValid() )
{
mApplicationDisplay.SetImageViewName( 0,
lAcquisition.GetOutputView( HEXSIGHT_NONE ) );
mApplicationDisplay.SetImageName( 0,
lAcquisition.GetOutputGreyScaleImage( HEXSIGHT_NONE )
);
}
mApplicationDisplay.SetZoom( -1 );
return TRUE;
// return TRUE unless you set the focus to
// a control
This initialization code configures the Display Control to display the
Grey-Scale Image provided by the Acquisition Device output. It
also sets the zoom to page mode, which automatically adjusts the
zoom factor to view the entire image. You must always verify the
validity of the ActiveX objects with IsValid(). If the object is not
valid, you will get random results if you try to use it. In this
HexSight Basics User Guide
133
Visual C++ Tutorials
tutorial, we have omitted the validation of controls in order to
simplify the code.
4.
In the OnButtonInspect function, add the following lines of code
(in bold) between the existing lines (in normal typeface):
lStartTime = GetTickCount();
mApplicationDisplay.RemoveAllMarker();
...
UpdateElapsedTime( lStartTime, lStopTime );
mApplicationDisplay.Refresh();
DoEvents();
...
The RemoveAllMarker call removes all overlay graphic markers
that could have been added to the previous image. The refresh call
updates the display to show the new Grey-Scale Image.
5.
Save your work and test the application. Now along with the
properties of the found instance, you should see a grey-scale
Image of the object for the current instance.
HexSight Basics User Guide
134
Visual C++ Tutorials
Tutorial 3: Caliper
Introduction
In this tutorial, you will learn how to set up, configure and use a Caliper
tool to precisely measure the distance between parallel edges on an object.
Modifying your Application Dialog
First you need to add two edit boxes to your application for the interface to
display the measurement output by the Caliper.
1.
On your application dialog, add two edit boxes. Name the first one
IDC_EDIT_WIDTH and the second IDC_EDIT_HEIGHT. Also add a
group box and proper labels for your text boxes. Set everything to
appear as illustrated in Figure 56.
FIGURE 56
2.
Visual C++ Dialog for Tutorial 3
Add a member variable for each new edit box. Name them mWidthText
and mHeightText. They must be of type CEdit.
HexSight Basics User Guide
135
Visual C++ Tutorials
Placing the Caliper
Right-click the HexSight Application Control icon on the dialog and select
HSApplication Control Object>Edit from the context menu. Click
Execute Sequence twice to locate the object in the second image of the
emulation database. Using the Process Manager, add a HSCaliper process
from the HexSight Inspection Tools folder. Set the tool’s General panel
as follow:
1.
2.
Enter WidthCaliper as the Process Name (instead of HSCaliper2).
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Enable the Apply Transform to a Model-defined Location check box.
4.
Select Hook from Model View as the Input Model Scene.
5.
Leave the Lock Location Transform on a Selected Instance check
box enabled.
6.
For the Input Instance Scene, select Instance Scene from Locator
View.
The above settings will make your application fully model-based
(automatic model based mode). The Caliper tool is defined on the
model and will be automatically transposed to fit the located
instance, whatever its scale, rotation or displacement.
7.
Click Execute. Open the Location panel.
The Location display shows the Model View. The Caliper is applied
to an area on the object bounded by the Caliper’s Rectangle, which
appears in green. The Caliper will be used to measure the width of
the rectangle-shaped hole on the part.
8.
Place the Rectangle on the part as shown in Figure 57. Click the arrow of
the X-axis and drag it to adjust the rotation to 90 degrees (the Y-axis is
used to adjust the skew). Click the center of the Rectangle and drag it
into position. Use the corner and side handles to adjust the width and
HexSight Basics User Guide
136
Visual C++ Tutorials
height of the Rectangle. Fine-tune the position and the orientation with
the text boxes if needed. Once the Rectangle is placed, click Execute.
Note: The Caliper must always be as perpendicular as possible to the
edges to be measured. For the current example, the tool had to be
rotated to 90 degrees and the skew was left at its default value of 0
degrees.
9.
Go to the Transform panel. The image shown is that of the current
instance of the object, as located in the second image of the emulation
database (if you clicked Execute Sequence twice before creating the
Caliper tool as indicated previously). To see the tool applied to other
instances, leave the Caliper window open and click Execute Sequence
in the Process Manager. Yellow lines indicate where the Caliper has
detected potential edges. Edge selection criteria will be set up in the
next step. Open the Configuration panel and move on to the next step.
FIGURE 57
Adjusting the Size, Position and Orientation of
the Caliper Rectangle
HexSight Basics User Guide
137
Visual C++ Tutorials
Configuring the Caliper
The Caliper locates potential edge pairs. You will set up constraints that will
allow the Caliper to measure only valid edge pairs, that is, those that meet
the criteria you have determined.
The display in the Configuration panel represents the part of the Image
bounded by the Rectangle. The Caliper processes information within the
Image along pixel lines, called projection paths, parallel to the Rectangle’s
Y-axis. In the display you can observe the following:
• Dotted yellow lines indicate potential edges.
• The blue curve shows a graphical representation of a projection
that averages each column of pixels in the Rectangle to create a
one-dimensional signal. Sharp changes on this curve indicate
potential edges.
• The green magnitude curve is the first derivative of the
projection curve. High and low peaks in this curve identify
potential edges.
• Horizontal red lines indicate the magnitude threshold for the
detection of potential edges.
In this example, only one measurement pair is needed so the default pair
named Pair0 will be used. The constraints used for both edges will be
polarity and position constraints. These constraints will be used to score
each edge.
Polarity indicates changes in light values, from left to right, within the
Rectangle.
Position constraints score each edge according to its position as defined
by the Position Constraint histogram. Magnitude constraints, not used in
this tutorial, score each edge according to its magnitude as defined by the
Magnitude Constraint histogram.
HexSight Basics User Guide
138
Visual C++ Tutorials
FIGURE 58
Caliper Tool — Configuration Panel
The Caliper attributes a score to each edge pair and to each individual
edge. Scores range from 0 to 1 with the minimum acceptable score being
determined by the Score Threshold, set by default at 0.250. Histogram
functions for each constraint determine how the Caliper scores edges.
1.
In the 1st Edge Score frame, select Polarity as Light to Dark and
enable the Position check box.
2.
In the 2nd Edge Score frame, select Polarity as Dark to Light and
enable the Position check box.
Next you must set up the Position constraint histogram for each
edge, in the bottom left window of the Configuration panel.
3.
Use the combo box above the histogram window to select a constraint.
HexSight Basics User Guide
139
Visual C++ Tutorials
4.
Use the mouse to drag the handles in the graphic function editor. Set
the 1st and the 2nd edge position constraint functions as illustrated in
Figure 59.
All edges to the right of the white
dotted line receive a score of 1
All edges to the left of the white dotted
line receive a linear decreasing score,
from 1 to 0
Constraint selection
Combo box
FIGURE 59
5.
Adjusting the Position Constraint Histograms
Click Execute. The yellow dotted lines become solid and are joined by a
solid horizontal line to indicate that the pair has been detected and
measured.
Caliper Results
You will now observe the Caliper’s results for various instances of the
object.
Access the Caliper Results panel to observe the following:
• Valid edges are displayed as parallel vertical yellow lines.
• The Caliper measure is displayed as a horizontal yellow line,
perpendicular to the edges.
• The Pair Count box indicates that the Caliper was configured to
measure one pair.
HexSight Basics User Guide
140
Visual C++ Tutorials
• The Coordinate System combo box indicates that the positions
are expressed with respect to the Tool coordinate system (the
origin centered on the tool’s Rectangle).
The table of results indicates:
• The Caliper measure, named Size, indicated in calibrated units.
• The score for the edge pair as well as for each edge.
Note: View the complete set of results using the scrollbar.
Now that the Caliper is properly configured to measure the rectangular
hole feature, you will want to test and observe the Caliper on other
instances of the Object by clicking Execute Sequence in the Process
Manager. Click OK and save your work before moving on to the next step.
Adding Code for the Caliper
You will finish up by adding code to your Visual C++ class that will display
the measurement of the Caliper in the interface. You will also add a line
marker on the display to show the measurement.
1.
Add the following lines after the include file of the
HookInspectionDlg.cpp file:
#include "HSCaliper.h"
2.
Add this wrapper (.h and .cpp) in your project:
HSCaliper
3.
Edit the OnButtonInspect function. Add the following lines of code,
shown in bold, between the existing ones, shown in normal typeface:
HSLocator lLocator;
HSCaliper lWidthCaliper;
CString
lMarkerName;
...
lLocator = lManager.GetProcess( COleVariant( "Locator" ) );
lWidthCaliper = lManager.GetProcess(
HexSight Basics User Guide
141
Visual C++ Tutorials
COleVariant ( "WidthCaliper") );
This will create a reference that will be used for programmatic
access to the WidthCaliper process instantiated in the HexSight
Application Control.
4.
Modify the existing line, shown in italic, for the one below it:
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant( "Locator" ) );
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant( "WidthCaliper")
);
This will execute the entire sequence of processes.
5.
Now, to display the Caliper’s measurement in the text box and to draw
the marker on the application display, type the following lines of code
after the existing one in normal typeface:
mTranslationYText.SetWindowText( lBuffer );
// Display width caliper properties and marker
if ( lWidthCaliper.GetPairScore( COleVariant(0L) ) > 0 )
{
lWidthCaliper.SetCoordinateSystem(
HSCaliper::hsCoordinateSystemWorld );
lBuffer.Format( "%.2f",
lWidthCaliper.GetPairSize( COleVariant(0L) ) );
mWidthText.SetWindowText( lBuffer );
lMarkerName = "Width";
mApplicationDisplay.AddLineMarker( lMarkerName,
lWidthCaliper.GetEdge1PositionX( COleVariant(0L) ),
lWidthCaliper.GetEdge1PositionY( COleVariant(0L) ),
lWidthCaliper.GetEdge2PositionX( COleVariant(0L) ),
lWidthCaliper.GetEdge2PositionY( COleVariant(0L) ),
TRUE );
HexSight Basics User Guide
142
Visual C++ Tutorials
mApplicationDisplay.SetMarkerAnchorStyle( lMarkerName,
HSDisplay::hsCross );
mApplicationDisplay.SetLineMarkerConstraints( lMarkerName,
HSDisplay::hsLineNoEdit );
mApplicationDisplay.SetMarkerColor( lMarkerName,
HSDisplay::hsRed );
mApplicationDisplay.SetMarkerDisplayName( lMarkerName,
TRUE );
}
If the first pair of the Caliper (Index = 0) is found (Score > 0.250),
its measurement is displayed in the WidthText edit box. Using the
World coordinate system, the calibrated X-Y position of the first and
second edge of the pair is used to draw a non-editable line marker
on the application display.
6.
In case no instance is found, add the line of code indicated in bold after
the existing one, shown in normal typeface:
mTranslationYText.SetWindowText( "" );
mWidthText.SetWindowText( "" );
mHeightText.SetWindowText( "" );
7.
Save your work and test the application. You should see the
measurement in the RectangleWidth edit box of your application. You
should also see the line marker you added on the Display highlighting
the measurement of WidthCaliper.
Adding a Second Caliper
By following the previous steps, try adding a Caliper that will measure the
height of the rectangular hole in the hook. Add the proper code to display
the result in the remaining edit box (Rectangle Height) on your application
form. Also add the code to draw another line marker on the Display.
Refer to the Application Example in the following folder:
InstallationPath\Tutorial\VisualC++\HookInspection\Part3.
HexSight Basics User Guide
143
Visual C++ Tutorials
Tutorial 4: Blob Analyzer
Introduction
In this tutorial, you will learn how to set up, configure and use a Blob
Analyzer tool to find, label and analyze irregular shaped features on the
part.
Modifying your Application Form
First you need to add two edit boxes to your application so you can observe
the measurement output by the Blob Analyzer.
1.
On your application dialog, add two edit boxes. Name the first one
IDC_EDIT_DIAMETER and the second IDC_EDIT_OFFSET. Add
proper labels for your edit boxes. Set everything to appear as illustrated
below.
FIGURE 60
2.
Visual C++ Dialog for Tutorial 4
Add a member variable for the new edit boxes. Name them
mDiameterText and mOffsetText. They must be of type CEdit.
HexSight Basics User Guide
144
Visual C++ Tutorials
Placing the Blob Analyzer
Return to the Process Manager (right-click the HexSight Application Control
icon, select HSApplication Control Object>Edit). Click Execute
Sequence twice to locate the object in the second image of the emulation
database. Using the Process Manager, add a HSBlobAnalyzer process
from the HexSight Inspection Tools folder of the Process Manager. Set
the tool’s General panel as follows:
1.
2.
Enter HoleBlob as the Process Name (instead of HSBlobAnalyzer4).
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Leave the Create Blob Image check box disabled.
4.
Enable the Apply Transform to a Model-defined Location check box.
5.
Select Hook from Model View as the Input Model Scene.
6.
Enable the Lock Location Transform on a Selected Instance check
box.
7.
Select Instance Scene from Locator View as the Input Instance
Scene.
The above settings will make your application fully model-based
(automatic model-based mode). The Blob Analyzer tool is defined
on the model and will be automatically transposed to fit the located
instance, whatever its scale, rotation or displacement.
8.
Click Execute. Open the Location panel.
The Location display shows the Model View. The Blob Analyzer will
be applied to an area on the object bounded by the Blob Analyzer’s
Rectangle, which appears in green. The Blob Analyzer will be used
to inspect the diameter and offset of the circular hole on the part.
9.
Place the Rectangle on the part as shown in the illustration. Click the
center of the Rectangle and drag it into position. Use the corner and side
handles to adjust the width and height of the Rectangle. Fine-tune the
HexSight Basics User Guide
145
Visual C++ Tutorials
position with the text boxes if needed. Once the Rectangle is placed,
click Execute.
10.
Go to the Transform panel. The image shown is that of the current
instance of the object as located in the second image of the emulation
database (if you clicked twice on Execute Sequence before creating
the Blob Analyzer tool). The red target marker indicates the center of
the blobs detected by the Blob Analyzer. Blob selection criteria will be
set up in the next step. Open the Configuration panel and move on to
the next step.
FIGURE 61
Adjusting the Size, Position and Orientation of the
Blob Analyzer Rectangle
Configuring the Blob Analyzer
You will set up constraints that will allow the Blob Analyzer to find only
valid blobs, that is, those that meet the criteria you have determined.
The display in the Configuration panel represents the part of the Image
bounded by the Rectangle. The Blob Analyzer processes information within
this Rectangle. In the display you can observe the following:
• The blob, as defined by the Image Segmentation Mode, is
represented in green.
• A blob marker appears in red in the center of each blob.
HexSight Basics User Guide
146
Visual C++ Tutorials
• When displaying the Pixel Weight Image, you can see the weight
value of each pixel as defined by the graphical function of the
Image Segmentation box. White pixels have a weight of 1 while
black pixels have a weight of 0. Pixels having a weight between 0
and 1 are displayed with a proportional greylevel.
1.
First, set the Blob Constraints: Minimum Area to 0 and Maximum
Area to 100, which corresponds to the area defined by the Rectangle.
FIGURE 62
Blob Analyzer — Configuration Panel
Now you must set the segmentation function using the graphical
editor in the Image Segmentation box. The graphic shows a
histogram of the distribution of pixels inside the Blob Analyzer’s
Rectangle. Black (0) is at the far left and white (255) at the far
right. In this example, there is a small peak in the black portion
(around 58) representing the blob, and a higher peak (around 186)
representing the part color. You want to include some pixels in the
HexSight Basics User Guide
147
Visual C++ Tutorials
transition, with a weight function proportional to the grey scale
value.
2.
Since we are looking for a dark blob on a white background, set the
Mode combo box to Dark.
3.
Use the mouse to drag the handles in the graphic function editor. Set
the Image Segmentation weight function as illustrated below.
Pixels of these values
receive a weight of 1
Pixels of these values
receive a weight of 0
Pixels of these values
receive a weight
between 0 and 1
FIGURE 63
4.
Image Segmentation Function Editor
Click Execute.
The segmented blob now corresponds to the hole in the part.
Blob Analyzer Results
You will now observe the Blob Analyzer’s results for various instances of the
object.
1.
In the Results tab, enable the Sort Results check box and select Area
with the Sort by combo box.
2.
Click Execute.
Use the Blob Analyzer Results panel to observe the following:
• The Blob Count box indicates that the Blob Analyzer has found
one blob.
HexSight Basics User Guide
148
Visual C++ Tutorials
• A grey-scale Image is displayed with a blob marker indicating the
center of each blob found for this instance of the object.
• The Coordinate System combo box selection indicates that the
positions are returned with respect to the Tool coordinate system
(the origin centered on the tool’s Rectangle).
• A list of the selected types of blob properties that are computed:
General, Perimeter, Intrinsic Inertia, etc.
The table of results shows:
• The position of the blob according to the selected coordinate
system
• The blob area indicated in calibrated units
• The properties computed for the blob. To view the complete set
of properties, use the grid’s tabs and scrollbar.
Now that the Blob Analyzer is configured properly to inspect the circular
hole feature, you will want to test and observe the Blob Analyzer on other
instances of the Object by clicking Execute Sequence in the Process
Manager. Click OK and save your work before moving on to the final step.
Adding Code for the Blob Analyzer
You will finish up by adding code to your Visual C++ class that will display
the measurements of the Blob Analyzer in the interface. You will also add a
target marker on the display to show the position and diameter of the hole.
1.
Add these include files following the others in the
HookInspectionDlg.cpp file:
#include "HSBlobAnalyzer.h"
#include <math.h>
2.
Add the following wrapper (.h and .cpp) in your project:
HSBlobAnalyzer
HexSight Basics User Guide
149
Visual C++ Tutorials
3.
Add the following lines of code (in bold) between the existing ones (in
normal typeface) in the OnButtonInspect function:
HSCaliper
lHeightCaliper;
HSCaliper
lWidthCaliper;
HSBlobAnalyzer
lHoleBlob;
CString
lMarkerName;
double
lHoleDiameter;
double
lHoleOffset;
...
lWidthCaliper = lManager.GetProcess( COleVariant(
"WidthCaliper" ) );
lHeightCaliper = lManager.GetProcess( COleVariant(
"HeightCaliper" ) );
lHoleBlob = lManager.GetProcess( COleVariant( "HoleBlob" ) );
This will create a reference that will be used for programmatic
access to the hole blob process instantiated in the HexSight
Application Control.
4.
Modify the existing line, shown in italic, for the one below it:
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant ( "HeightCaliper" ) );
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant( "HoleBlob" ) );
This will execute the entire sequence of processes.
5.
Now to display the Blob Analyzer’s measurements in the text boxes and
to draw the marker on the application display, type the following lines of
code (in bold) after the existing ones (in normal typeface):
if ( lHeightCaliper.GetPairScore( sVarZero ) > 0 )
{
...
HexSight Basics User Guide
150
Visual C++ Tutorials
}
// Display hole blob properties and marker
if ( lHoleBlob.GetBlobCount() > 0 )
{
lHoleDiameter = sqrt( 4 * lHoleBlob.GetBlobArea(0) /
3.14159 );
lBuffer.Format( "%.2f", lHoleDiameter );
mDiameterText.SetWindowText( lBuffer );
lHoleBlob.SetCoordinateSystem(
HSBlobAnalyzer::hsCoordinateSystemObject );
lHoleOffset = sqrt(
lHoleBlob.GetBlobPositionX(0) *
lHoleBlob.GetBlobPositionX(0) +
lHoleBlob.GetBlobPositionY(0) *
lHoleBlob.GetBlobPositionY(0) );
lBuffer.Format("%.2f", lHoleOffset);
mOffsetText.SetWindowText( lBuffer );
lHoleBlob.SetCoordinateSystem(
HSBlobAnalyzer::hsCoordinateSystemWorld );
lMarkerName = "Hole";
mApplicationDisplay.AddTargetMarker( lMarkerName,
lHoleBlob.GetBlobPositionX(0),
lHoleBlob.GetBlobPositionY(0),
(float)(lHoleDiameter / 2), TRUE );
mApplicationDisplay.SetTargetMarkerConstraints(
lMarkerName, HSDisplay::hsTargetNoEdit );
mApplicationDisplay.SetMarkerColor( lMarkerName,
HSDisplay::hsRed );
}
HexSight Basics User Guide
151
Visual C++ Tutorials
6.
In case no instance is found, add the lines of code indicated in bold after
the existing one, shown in normal typeface:
mHeightText.SetWindowText( "" );
mDiameterText.SetWindowText( "" );
mOffsetText.SetWindowText( "" );
If the blob is found, the offset of the hole from the origin of the
Object coordinate system and the diameter of the hole are
computed and displayed in the OffsetText and DiameterText text
boxes. Using the World coordinate system, the calibrated X-Y
position of the blob is used to draw a non-editable target marker
on the application display.
7.
Save your work and test the application. You should see the computed
diameter and offset of the hole in the text boxes of your application. You
should also see the target marker you added on the Display, highlighting
the position and the diameter of the hole.
HexSight Basics User Guide
152
Visual C++ Tutorials
Tutorial 5: Patter n Locator
Introduction
In this tutorial, you will learn how to set up, configure and use a Pattern
Locator tool to find and locate instances of the “HS” printed on the part.
Modifying your Application Form
First you need to add one edit box to your application so you can display
the result output by the Pattern Locator.
1.
On your application dialog, add one edit box. Name it
IDC_EDIT_LABEL. Add a proper label for your text box. Set everything
to appear as illustrated below.
FIGURE 64
2.
Visual C++ Dialog for Tutorial 5
Add a member variable named mLabelText of type CEdit.
HexSight Basics User Guide
153
Visual C++ Tutorials
Placing the Pattern Locator
Select the HexSight Application Control on the dialog. With the right-click
menu, select HSApplication Control Object>Edit. Click on Execute
Sequence twice to locate the object in the second Image of the emulation
database. Using the Process Manager, add the HSPatternLocator process
from the HexSight Inspection Tools folder. Set the tool’s General panel
as follows:
1.
Enter LabelLocator as the Process Name (instead of
HSPatternLocator5).
2.
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Enable the Apply Transform to a Model-defined Location check box.
4.
Select Hook from Model View as the Input Model Scene.
5.
Enable the Lock Location Transform on a Selected Instance check
box.
6.
Select Instance Scene from Locator View as the Input Instance
Scene.
The above settings will make your application fully model-based
(automatic model-based mode). The Pattern Locator tool is defined
on the model and will be automatically transposed to fit the located
instance, whatever its scale, rotation or displacement.
7.
Click Execute. Open the Location panel.
The Location display shows the Model View. The Pattern Locator will
be applied to an area on the object bounded by the tool’s
Rectangle. The Pattern Locator will be used to verify the presence
of the “HS” label printed on the part. The green dotted rectangle
defines the search area and the smaller green solid rectangle
defines the pattern.
HexSight Basics User Guide
154
Visual C++ Tutorials
8.
Place the Rectangle on the part as shown in the illustration. Click the
center of the Rectangle and drag it to the center of the “HS” label. Use
the corner and side handles to adjust the width and height of the Search
Rectangle to fit the label. Zoom in on the label and by clicking and
dragging the arrow on the tool’s X-axis, adjust the rotation to fit the
orientation of the label. Readjust the green dotted search Rectangle to
leave a small oversize around the pattern to provide for some
misalignment of the label on some parts. Fine-tune the position with the
text boxes if needed. Once it is placed, click Execute.
FIGURE 65
9.
Adjusting the Size, Position and Orientation of the
Location Rectangle
Go to the Transform panel. The Image shown is that of the current
instance of the object as located in the second Image of the emulation
database (if you clicked twice on Execute Sequence before creating
the Pattern Locator tool). To see the tool applied to the other instances,
leave the Pattern Locator open and click Execute Sequence in the
Process Manager. The Pattern Locator will be configured to check for the
presence of the label in the next step. Open the Pattern panel and
move on to the next step.
HexSight Basics User Guide
155
Visual C++ Tutorials
Placing the Pattern Rectangle
You will set up the rectangle for defining the pattern that you want the
Pattern Locator find within the Image. In our case, the Pattern Locator will
be used to verify the presence of the "HS" label printed on the part. The
Pattern display shows the Model View and the green solid rectangle defines
the pattern.
1.
Place the Rectangle on the part as shown in the illustration. Click the
center of the Rectangle and drag it to the center of the “HS” label. Use
the corner and side handles to adjust the width and height of the
Pattern Rectangle to fit the label. Zoom in on the label and by clicking
and dragging the arrow on the tool’s X-axis, adjust the rotation to fit the
orientation of the label. Readjust the size of the green solid pattern
Rectangle to include only the "HS" characters in the pattern. Fine-tune
the position with the text boxes if needed. Once it is placed, click
Execute.
FIGURE 66
2.
Adjusting the Size, Position and Orientation of the
Pattern Rectangle
Open Configuration panel and move on to the next step.
HexSight Basics User Guide
156
Visual C++ Tutorials
Configuring the Pattern Locator
You will set up the parameters of the tool in order to detect the grey-scale
pattern on the part. The Configuration tab contains the following:
Inside the Parameters frame, set the following parameters:
• Instance To Find determines the maximum number of pattern
instances to be found.
• Match Threshold determines the minimum strength score to
accept a valid match.
• When Automatic Coarseness Selection is enabled, the Pattern
Locator automatically determines the Search Coarseness and
Positioning Coarseness levels.
• Search Coarseness determines the level used to find the
hypothesis of instances.
• Positioning Coarseness determines the level used to refine the
position of instances found.
1.
Set the Instance To Find value to 1.
2.
Set the Match Threshold value to 0.500
3.
Leave the Automatic Coarseness Selection check box enabled.
4.
Click Execute.
Pattern Locator Results
You will now observe the Pattern Locator’s results for various instances of
the object.
Access the Pattern Locator Results panel to observe the following:
• Each valid pattern is displayed with a blue rectangle marker
indicating the position of the pattern detected in the Search
Rectangle.
HexSight Basics User Guide
157
Visual C++ Tutorials
• The left display shows the grey-scale Image of the Search
Rectangle.
• The right display shows the grey-scale Image of the reference
pattern.
The Coordinate system combo indicates that the positions are returned
with respect to the Tool coordinate system (the origin centered on the
Pattern Rectangle).
The table of results indicates:
• The strength of the match.
• The position of the pattern according to the selected coordinate
system.
• The rotation of the pattern in calibrated rotation units.
Note: View the complete set of results using the grid’s scrollbar.
Now that the Pattern Locator is configured properly to check the presence
of the “HS” label, you will want to test and observe the Pattern Locator on
other instances of the Object by clicking Execute Sequence in the Process
Manager. Click OK and save your work before moving on to the final step.
Adding Code for the Pattern Locator
You will finish up by adding code to your Visual C++ class that will display
the result of the pattern search in the interface. You will also add a point
marker on the display to show the position of the label located by the
Pattern Locator.
1.
Add the following include file after the others in the HookInspectDlg.cpp
file:
#include “HSPatternLocator.h”
2.
Add this wrapper (.h and .cpp) in your project:
HSPatternLocator
HexSight Basics User Guide
158
Visual C++ Tutorials
3.
Add the following lines of code, shown in bold, between the existing
ones, shown in normal typeface, in the OnButtonInspect function:
HSBlobAnalyzer lHoleBlob;
HSPatternLocator lLabelLocator;
...
lHoleBlob = lManager.GetProcess( COleVariant( "HoleBlob" ) );
lLabelLocator = lManager.GetProcess( COleVariant(
"LabelLocator" ) );
This will create a reference that will be used for programmatic
access to the LabelLocator process instantiated in the HexSight
Application Control.
4.
Modify the existing line, shown in italic, for the one below it:
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant( "HoleBlob" ) );
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant( "LabelLocator" ) );
This will execute the entire sequence of processes.
5.
Now to display the result of the search in the edit box and to draw the
marker on the application display, type the following lines of code,
shown in bold, after the existing ones, shown in normal typeface:
if ( lHoleBlob.GetBlobCount() > 0 )
{
...
}
// Display label locator properties and marker
if ( lLabelLocator.GetMatchCount() > 0 )
{
mLabelText.SetWindowText( "Present" );
HexSight Basics User Guide
159
Visual C++ Tutorials
lLabelLocator.SetCoordinateSystem(
HSPatternLocator::hsCoordinateSystemWorld );
lMarkerName = "HSLabel";
mApplicationDisplay.AddPointMarker( lMarkerName,
lLabelLocator.GetMatchPositionX(0),
lLabelLocator.GetMatchPositionY(0), TRUE );
mApplicationDisplay.SetMarkerDisplayName( lMarkerName, TRUE
);
mApplicationDisplay.SetMarkerColor( lMarkerName,
HSDisplay::hsBlue );
}
else
{
mLabelText.SetWindowText( "Absent" );
}
6.
In case no instance is found, add the line of code indicated in bold after
the existing one, shown in normal typeface:
mOffsetText.SetWindowText( "" );
mLabelText.SetWindowText( "" );
7.
Save your work and test the application. You should see the presence/
absence of the “HS” label in the text box of your application. You should
also see the point marker you added on the Display, highlighting the
position of the label.
HexSight Basics User Guide
160
Visual C++ Tutorials
Tutorial 6: Edge Locator
Introduction
In this tutorial, you will learn how to set up, configure and use two Edge
Locator tools to measure non-parallel edges on the part.
Modifying your Application Form
First you need to add one edit box to your application so you can observe
the result output by the Edge Locator processes.
1.
On your application dialog, add one edit box. Name it
IDC_EDIT_PART_WIDTH. Add a proper label for your edit box. Set
everything to appear as illustrated below.
FIGURE 67
2.
Visual C++ Dialog for Tutorial 6
Add a member variable named mPartWidthText of type CEdit for this
edit box.
HexSight Basics User Guide
161
Visual C++ Tutorials
Placing the Edge Locator
Select the HexSight Application Control on the dialog. With the right-click
menu select HSApplication Control Object>Edit. Click Execute
Sequence twice to locate the object in the second Image of the emulation
database. Using the Process Manager, add the HSEdgeLocator process
from the HexSight Inspection Tools folder. Set the tool’s General panel
as follows:
1.
2.
Enter PartLeftEdge as the Process Name (instead of HSEdgeLocator6).
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Enable the Apply Transform to a Model-defined Location check box.
4.
Select Hook from Model View as the Input Model Scene.
5.
Enable the Lock Location Transform on a Selected Instance check
box.
6.
Select Instance Scene from Locator View as the Input Instance
Scene.
The above settings will make your application fully model-based
(automatic model-based mode). The Edge Locator tool is defined
on the model and will be automatically transposed to fit the located
instance, whatever its scale, rotation or displacement.
7.
Click Execute. Open the Location panel.
The Location display shows the Model View. The Edge Locator will
be applied to an area on the object bounded by the tool’s
Rectangle, which appears in green. The Edge Locator will be used
to measure the position of the left edge of the part.
8.
Place the Rectangle on the part as shown in the illustration. Click the
arrow of the X-axis and drag it to adjust the rotation to 90 degrees (the
Y-axis is used to adjust the skew). Click the center of the Rectangle and
drag it into position. Use the corner and side handles to adjust the width
HexSight Basics User Guide
162
Visual C++ Tutorials
and height of the Rectangle. Fine-tune the position with the text boxes if
needed. Once it is placed, click Execute.
FIGURE 68
Adjusting the Size, Position and Orientation of the
Edge Locator Rectangle
Note: The Edge Locator must always be as perpendicular as possible
to the edges to be measured. For the current example, the tool had
to be rotated to 90 degrees and the skew left to its default value of 0
degree.
9.
Go to the Transform panel. The Image shown is that of the current
instance of the object, as located in the second Image of the emulation
database (if you have clicked on Execute Sequence twice before
creating the Edge Locator tool as indicated previously). To see the tool
applied to other instances, leave the Edge Locator window open and
click Execute Sequence in the Process Manager. Yellow lines indicate
where the Edge Locator has detected potential edges. Edge selection
criteria will be set up in the next step. Open the Configuration panel
and move on to the next step.
HexSight Basics User Guide
163
Visual C++ Tutorials
Configuring the Edge Locator
The Edge Locator detects potential edges. You will set up constraints that
will allow the Edge Locator to locate only valid edges, that is, those that
meet the criteria you have determined.
The graphic display in the Configuration panel represents the image
information contained in the Edge Locator Rectangle:
• Yellow lines indicate detected edges.
• The blue curve shows a graphical representation of a projection
that averages each column of pixels in the Rectangle to create a
one-dimensional signal. Sharp changes on this curve indicate
potential edges.
• The green magnitude curve is the first derivative of the
projection curve. High and low peaks in this curve identify
potential edges.
• Horizontal red lines indicate the magnitude threshold for the
detection of potential edges.
HexSight Basics User Guide
164
Visual C++ Tutorials
FIGURE 69
Edge Locator — Configuration Panel
In this example, the constraints used to score edges will be polarity and
position constraints.
Polarity indicates changes in light values, from left to right, within the
Rectangle.
Position constraints score each edge according to its position as defined
by the Position Constraint histogram. Magnitude constraints, not used in
this tutorial, score each edge according to its magnitude as defined by the
Magnitude Constraint histogram.
The Edge Locator attributes a score to each individual edge. Scores range
from 0 to 1 with the minimum acceptable score being determined by the
Score Threshold, set by default at 0.250. Histogram functions for each
constraint determine how the Edge Locator scores edges.
HexSight Basics User Guide
165
Visual C++ Tutorials
1.
In the Edge Score box, select Polarity as Dark to Light and enable
the Position check box.
Next you must set up the Position Constraint histogram for the
edge, in the bottom left window of the Configuration panel.
2.
Use the mouse to drag the handles in the histogram editor of the
selected constraint. Set the Edge Position Constraint histogram as
illustrated in Figure 70.
3.
Click Execute.
Edges in this region
receive an increasing
score, from 0 to 1
Edges in this region
receive a declining
score, from 1 to 0
Edges in this region
receive score of 1
FIGURE 70
Position Constraint Histogram
Edge Locator Results
You will now observe the Edge Locator’s results for various instances of the
object. Access the Edge Locator Results panel to observe the following:
• Valid edges are displayed as vertical yellow lines.
• The Edge Count box indicates that the Edge Locator has found
one edge.
• The Coordinate System combo box indicates that the positions
are expressed with respect to the Tool coordinate system (the
origin centered on the tool’s Rectangle).
The table of results indicates:
• The score of the found edges.
HexSight Basics User Guide
166
Visual C++ Tutorials
• The position of the edges, expressed with respect to the selected
coordinate system.
• The rotation of the edges.
• The scores of each individual constraint.
Note: View the complete set of results using the grid’s scrollbar.
Now that the Edge Locator is configured to locate the left edge of the part,
you will want to test and observe the Edge Locator on other instances of
the Object by clicking Execute Sequence in the Process Manager. Click
OK and save your work before moving on to the next step.
Placing the Second Edge Locator
Using the Process Manager, add a second HSEdgeLocator process. Set the
tool’s General panel as follow:
1.
Enter PartRightEdge as the Process Name (instead of
HSEdgeLocator7).
2.
Select Grey-Scale Image from Acquisition View as the Input GreyScale Image.
3.
Enable the Apply Transform to a Model-defined Location check box.
4.
Select Hook from Model View as the Input Model Scene.
5.
Enable the Lock Location Transform on a Selected Instance check
box.
6.
Select Instance Scene from Locator View as the Input Instance
Scene.
7.
8.
Click Execute. Open the Location panel.
Place the Rectangle on the part as shown in the illustration. Click the
arrow of the X-axis and drag it to adjust the rotation to 90 degrees.
Click the center of the Rectangle and drag it into position. Since the
edge to be located is not orthogonal to the tool’s X-axis, adjust the skew
by clicking and dragging the arrow of the Y-axis to make it parallel to
HexSight Basics User Guide
167
Visual C++ Tutorials
the right edge of the part. Fine-tune the position with the text boxes if
needed. Once the Rectangle is placed, click Execute.
FIGURE 71
9.
Adjusting Rectangle for the Hook’s Right Edge
In the Edge Score box of the Configuration panel, select Polarity as
Light to Dark and enable the Position check box.
10.
Set up the Position Constraint using the graphical histogram editor, just
as that of the PartLeftEdge Edge Locator.
11.
Save your work and move on to the final step.
Adding Code for the Edge Locator
You will finish up by adding code to your Visual C++ class that will display
the width of the part computed from the results of the two Edge Locator
tools. You will also add a line marker on the display to show the measure
on the part.
1.
Add this include file following the others in the HookInspectionDlg.cpp
file:
#include "HSEdgeLocator.h"
2.
Add this wrapper (.h and .cpp) in your project: HSEdgeLocator.
HexSight Basics User Guide
168
Visual C++ Tutorials
3.
In the OnButtonInspect function, add the lines of code indicated in
bold between the existing ones, shown in normal typeface:
HSPatternLocator lLabelLocator;
HSEdgeLocator
lPartLeftEdge;
HSEdgeLocator
lPartRightEdge;
...
double lHoleOffset;
double lPartWidth;
...
lLabelLocator = lManager.GetProcess( COleVariant(
"LabelLocator" ) );
lPartLeftEdge = lManager.GetProcess( COleVariant(
"PartLeftEdge" ) );
lPartRightEdge = lManager.GetProcess( COleVariant(
"PartRightEdge" ) );
This will create a reference that will be used for programmatic
access to the two Edge Locator processes instantiated in the
HexSight Application Control.
4.
Modify the existing line, shown in italic, for the one below it:
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant( "LabelLocator" ) );
lManager.Execute( COleVariant( "Acquisition" ),
COleVariant( "PartRightEdge" ) );
This will execute the entire sequence of processes.
5.
Now to display the measurement in the edit box and to draw the marker
on the application display, type the lines of code, shown in bold, after
the existing ones, shown in normal typeface:
if ( lLabelLocator.GetMatchCount() > 0 )
{
...
HexSight Basics User Guide
169
Visual C++ Tutorials
}
// Display part edge left and part edge right properties and
marker
if (
( lPartLeftEdge.GetEdgeCount() > 0 )
&& ( lPartRightEdge.GetEdgeCount() > 0 ) )
{
lPartLeftEdge.SetCoordinateSystem(
HSEdgeLocator::hsCoordinateSystemObject );
lPartRightEdge.SetCoordinateSystem(
HSEdgeLocator::hsCoordinateSystemObject );
lPartWidth = lPartRightEdge.GetEdgePositionY(0) lPartLeftEdge.GetEdgePositionY(0);
lBuffer.Format( "%.2f", lPartWidth );
mPartWidthText.SetWindowText( lBuffer );
lPartLeftEdge.SetCoordinateSystem(
HSEdgeLocator::hsCoordinateSystemWorld );
lPartRightEdge.SetCoordinateSystem(
HSEdgeLocator::hsCoordinateSystemWorld );
lMarkerName = "Part Width";
mApplicationDisplay.AddLineMarker( lMarkerName,
lPartLeftEdge.GetEdgePositionX( 0 ),
lPartLeftEdge.GetEdgePositionY( 0 ),
lPartRightEdge.GetEdgePositionX( 0 ),
lPartRightEdge.GetEdgePositionY( 0 ), TRUE );
mApplicationDisplay.SetMarkerAnchorStyle( lMarkerName,
HSDisplay::hsCross );
mApplicationDisplay.SetLineMarkerConstraints( lMarkerName,
HSDisplay::hsLineNoEdit );
mApplicationDisplay.SetMarkerColor( lMarkerName,
HSDisplay::hsGreen );
mApplicationDisplay.SetMarkerDisplayName( lMarkerName,
HexSight Basics User Guide
170
Visual C++ Tutorials
TRUE );
}
6.
In case no instance is found, add the line of code indicated in bold after
the existing one, shown in normal typeface:
mLabelText.SetWindowText( "" );
mPartWidthText.SetWindowText( "" );
7.
Save your work and test the application. You should see the part width
in the Part Width text box of your application. You should also see the
line marker you added on the Display highlighting the measurement.
Tutorial 7: Calibration
Introduction
In this tutorial, you will learn how to calibrate the system to perform
acquisitions of live images. Calibration is an important step that can correct
certain perspective and lens distortions. It also allows you to specify the
basic length units you will use throughout your entire application.
Camera Calibration
The calibration is performed in the Acquisition Device. In this example, the
calibration is performed with the largest calibration target provided with
your HexSight package (it possesses a dot pitch of 10 mm).
1.
Open the Acquisition Device Properties. Select the Configurations
panel. Select Copy Configuration and then select Paste
Configuration.
2.
In the displayed window, enter Camera as the new configuration name.
3.
Select the newly created Camera configuration in the list and click Set
As Default.
HexSight Basics User Guide
171
Visual C++ Tutorials
4.
In the Input sub-panel, select Generic Frame grabber and click
Apply.
5.
Go to the Calibration sub-panel. Select Distortion Model. Click Show
Calibration Dialog. The Calibration - Distortion Model dialog is
displayed (see Figure 72).
FIGURE 72
6.
Distortion Model Calibration Dialog
Click Real-Time to display the image from the camera. Position the grid
of dots to cover the whole area. Set the focus and other settings of your
camera to obtain the best image possible. Then click Real-Time again
to stop real time acquisitions.
7.
Click Detect to detect the dots on the target.
HexSight Basics User Guide
172
Visual C++ Tutorials
8.
The dot pitch is known to be 10.0 mm. Enter the dot pitch in the Dot
Pitch box.
9.
Zoom in at the lower left corner of the display. The green coordinate
system marker in the bottom left of the target displayed, as in Figure
73. Note that this coordinate system is displaceable programmatically or
with the mouse; leave it as is for this tutorial.
FIGURE 73
10.
11.
Zoom-in on the Coordinate Marker in
the Calibration Dialog
Click Solve. The statistics appear in the Results frame. Click OK.
The calibration procedure is completed. The computed calibration
parameters appear in the Parameters grid. Click Apply to apply the
calibration to the Camera configuration.
12.
13.
Click OK to close the Acquisition Device’s properties window.
You are now ready to run the application with live images using the
Paper Hook provided with your HexSight package.
HexSight Basics User Guide
173
Using HexSight Displays
Using HexSight Displays
This Chapter describes the use and the functionalities shared by HexSight
displays. Besides the HSDisplay Control, displays appear under different
forms throughout the HexSight interface.
Chapter Outline
Introduction to HexSight Displays
Elements of HexSight Displays
Toolbar
Rulers
Viewport
Status Bar
HexSight Basics User Guide
175
Using HexSight Displays
Introduction to HexSight Displays
This section explains the basic use of all display screens in HexSight
software. The examples are based on a display added to a project by
adding a HSDisplay control. Mastering the few basic controls for display
screen will enable you to work efficiently with this type of component.
Toolbar
Rulers
Viewport
Scroll Bars
Status Bar
FIGURE 74
Typical HexSight Display Screen
• The user-interface of all HexSight tools contain one or more
display screens which can serve to configure the tool or visualize
results.
• Display screens can be added to a Visual Basic form in order to
visualize different Images and/or Scenes generated by the
HexSight application. This can be accomplished by pasting a
Display control over a VB form. See the Getting Started
chapter and the Tutorials for more information on this topic.
HexSight Basics User Guide
176
Using HexSight Displays
• Figure 74 shows a typical HexSight display screen. The Elements
of HexSight Displays section presents the different elements
that constitute such a screen.
HexSight Basics User Guide
177
Using HexSight Displays
Elements of HexSight Displays
Toolbar
The display toolbar contains three distinct areas: The tool area, the
zoom area and the mode area.
Tool Area
This area is composed of three buttons as shown in the next figure.
Calibrate button
Crosshair cursor button
Property page button
FIGURE 75
Tool Area Components
The Property Page button displays the property page of the
display control.
• The parameters that appear in this property page can be
modified programmatically only if the display screen originates
from a Display control pasted on a Visual Basic form.
• In other words, you cannot programmatically modify the
properties of a display screen that is in the a HexSight interface.
The Calibrate button specifies if the Acquisition Device calibration
is applied on the image prior to displaying it in the viewport.
• For more information on the calibration process, consult the
Acquisition Device chapter.
HexSight Basics User Guide
178
Using HexSight Displays
6
Cross Hair Cursor
The Crosshair Cursor button displays the mouse pointer as a
crosshair cursor.
• This is practical for viewing a very precise location in the image.
Zoom area
The zoom area controls let you change the zoom factor of the
image in the display.
Zoom In
Zoom Back
Zoom Out
Zoom Select
FIGURE 77
Zoom Area Components
• The Zoom In the zoom factor is multiplies the zoom factor by 2,
therefore enlarging the displayed image twice, while the
viewport remains the same size.
• The Zoom Back button restores the view displayed prior to the
last zoom change.
• The Zoom Out button divides the zoom factor by two.
HexSight Basics User Guide
179
Using HexSight Displays
• Use the Zoom Select Combo Box button to select among eight
different zoom factor values to apply, including a special
selection that makes the Image and/or Scene fit the viewport
size.
Mode Area
The mode area buttons are used to specify the effect of a left
mouse button click when the mouse pointer is positioned over the
viewport.
Zoom Mode
Pan Mode
Select Mode
FIGURE 78
Mode Area Buttons
• If your mouse has a wheel, its action results in a zoom in or
zoom out no matter which mode is selected.
• The Zoom Mode changes the appearance of your cursor to a
magnifying glass. In this case, when the left mouse button is
clicked, the zoom factor is doubled. If the left mouse button is
clicked while the Ctrl key is down, the zoom factor is divided by
two.
• The Pan Mode changes the appearance of your cursor to a
hand. Use this mode to is used to shift the displayed Image to a
new location in the viewport.
• The Select Mode changes the appearance of your cursor to an
arrow. In this mode you can use the cursor to modify the
position as well as some of the parameters of different markers
that may be displayed in the viewport. You can also use it to
select scene objects, for example in the Model Editor interface. a
HexSight Basics User Guide
180
Using HexSight Displays
Rulers
The rulers show the dimensions of the displayed image and the unit
lengths of the Image or Scene.
FIGURE 79
Display Screen Ruler
Viewport
The viewport is the drawing zone of the display screen. This is
where the image is displayed. With the mouse pointer positioned
over the viewport, right-click to obtain the context menu illustrated
in Figure 80. The selections available in this menu perform exactly
the same operations as the buttons in the tool, zoom and mode
areas (see previous sections).
The contents of the context menu can differ in the displays
contained in the HexSight user-interface.
.
FIGURE 80
Viewport Context Menu
HexSight Basics User Guide
181
Using HexSight Displays
Status Bar
The status bar provides information on the X and Y position of the
mouse pointer in the image. It gives also information, such as the
greylevel value of the pixel on which the cursor is positioned.
FIGURE 81
Status Bar
HexSight Basics User Guide
182
Coordinate Systems
Coordinate Systems
Location and inspection tools can return results with respect to one of four
coordinate systems. This allows you to use the set of references best
adapted to the requirements of your applications, by selecting the
coordinate system in which results will be displayed and returned.
The four coordinate systems are the World coordinate system, the Image
coordinate system, the Object coordinate system, and the Tool coordinate
system.
This chapter describes the four coordinate systems and the advantages of
each for building applications.
Coordinate Systems Chapter Outline
Right-Handed vs. Left-Handed Coordinate Systems
Relationship between Coordinate Systems
World Coordinate System
Image Coordinate System
Object Coordinate System
Tool Coordinate System
Unit and Angle Conversions
HexSight Basics User Guide
183
Coordinate Systems
Right-Handed vs. Left-Handed
Coordinate Systems
Coordinate systems can be of two types: right-handed or left-handed.
Figure 82 illustrates the difference between both types.
HexSight supports both left- and right-handed coordinate systems, for both
the calibrated (World) coordinate system and the Image coordinate
system. The type of other HexSight coordinate systems, Object and Tool,
follow the type of their associated Image or World coordinate system.
The type of coordinate system selected for a calibrated image (World) does
not have to be the same as that of the acquired Image. i.e a right-handed
image can be calibrated into either a left-handed or a right-handed
coordinate system.
Origin
By default, the origin of a right-handed coordinate system is at
bottom-left of an image whereas the origin of a left-handed
coordinate system is at top-left.
Y
X
p1
p1
p2
p2
90°
90°
p3
p4
p3
X
Left-handed coordinate system
FIGURE 82
p4
Y
Right-handed coordinate system
Right-Handed vs. Left-Handed Coordinate Systems
HexSight Basics User Guide
184
Coordinate Systems
Rotation
Angles are measured from the X-axis towards the Y-axis. In a righthanded coordinate system, positive angles are counterclockwise; in
a left-handed coordinate system, positive angles are clockwise.
Note: Angles are expressed in a range of 180º to -180º. For
example, an angle of 210º, in HexSight tools, is expressed as an
angle of -150º.
HexSight Basics User Guide
185
Coordinate Systems
Relationship between Coordinate
Systems
The coordinate systems can be described as layered in physical space. The
World coordinate system (WCS) occupies the highest layer of level since it
physically contains the other coordinate systems. There can only be one
WCS, containing more than one instance of the other coordinate systems.
The relationship between the World coordinate and the Image coordinate
system (ICS) is defined by the calibration procedure. See the Acquisition
Device chapter.
• Though there is usually only one ICS, more than one instance of
an ICS can occur if two independent input devices, cameras on
different frame grabber channels for example, are used for an
application.
• The Object coordinate system (OCS) is unique for each Model
defined. The OCS is defined with respect to the WCS of the
Image from which the Model is built.
HexSight Basics User Guide
186
Coordinate Systems
YW
XT
YT
YO
(0,0)
Tool
coordinate system
(0,0)
YI
XO
Object coordinate system
XI
(0,0)
(0,0)
FIGURE 83
Image coordinate system
World coordinate system
XW
Relationship Between HexSight Coordinate Systems
World Coordinate System
The World coordinate system is especially useful for guidance applications.
In such a case, the origin can be defined with respect to the robot’s
reference coordinate system. This can also be useful for applications where
more than one camera is used: objects found by each camera are thus
located and defined within a same coordinate system.
• The World coordinate system is also described as the calibrated
coordinate system.
Characteristics
Type: Can be right- or left-handed. The type is set at calibration.
Units: User-selected calibrated units.
Boundaries: The defined workspace or workcell in which the vision
application is carried out. See Figure 82.
HexSight Basics User Guide
187
Coordinate Systems
Image Coordinate System
This coordinate system is useful for Image processing applications.
World
Image
YI
Image
boundary
Image
coordinate
system
(0,0)
FIGURE 84
XI
Image Coordinate System
Characteristics
Type: Can be right- or left-handed. The type is set at acquisition.
Units: Pixels.
Boundaries: The physical boundaries of the Image.
Object Coordinate System
The origin of the Object coordinate system is user-defined and is set up
within the Model Editor.
• In an application, all instances of the same type of object use the
same origin for defining any reference points that have been
created in the Model as well as the position of model-based
inspection tools. This is useful when you must determine a
feature’s location in relation to other features in the object, or in
relation to a reference point on the object.
HexSight Basics User Guide
188
Coordinate Systems
• This coordinate system is useful for quality control applications in
which features must be inspected at a specific point on the
object.
Model
YO
Object coordinate system
(0,0)
XO
FIGURE 85
Object Coordinate System
Characteristics
Type: Always the same type as the World coordinate system.
Origin: Variable, defined by the user within each Model.
Units: User-selected calibrated units.
Boundaries: The physical boundaries of the Image.
Tool Coordinate System
Inspection tools carry out their action within an area typically bounded by a
Rectangle or Sector region of interest. When the tool area is bounded by a
Rectangle, the origin of any Tool coordinate system is the center point of
the Rectangle. If the tool area is bounded by a Sector (arc tools) the origin
of the coordinate system is the origin of the Sector.
• The Tool coordinate system is useful for measuring a feature that
does not need to be defined or located with respect to a specific
HexSight Basics User Guide
189
Coordinate Systems
location on the object. For example, a single caliper measure
across two edges on an object.
Tool
YT
XT
YT
Rectangle on
an object
XT instance
origin of
Tool coordinate
system
(0,0)
Rectangle
Model Scene
origin of the
Object coordinate system
FIGURE 86
Tool Coordinate System
Characteristics
Type: In calibrated applications, always the same type as the
system. In uncalibrated applications, always the same type as the
Image coordinate system.
Origin: Fixed: at the center of an inspection tool’s Rectangle region
of interest or at the origin of its Sector region of interest.
Units: Calibrated units or pixels depending on the tool’s
configuration.
Boundaries: The physical boundaries of the Image.
HexSight Basics User Guide
190
Coordinate Systems
Unit and Angle Conversions
All HexSight tools let you select the unit system of your choice, in either
the Metric or British System.
The choices of units are:
TABLE 2
Available Units and Their Descriptions
Unit
Abbreviation
meter
m
centimeter
cm
millimeter
mm
micron
µm
yard
yd
foot
ft
inch
in
mil
mil
calibration units
see below
c.u.
Calibration Units
Calibration units are generic length units that can be used instead
of the predefined unit systems provided. A calibration unit has no
fixed dimension and is defined by the user when calibrating the
system.
These units can be used when no absolute measurements are
required, or when they are not possible. Calibration units are
dimensionless and the conversion factor is 1:1 for any other of the
length units provided.
Angles
Angles of skew and rotation can be specified in either degrees or
radians.
HexSight Basics User Guide
191
Application Control
Application Control
The Application control provides the platform in which a HexSight
application is built and configured. It manages the sequence of tools that
make up the application and provides a runtime database of Images and
Scenes.
Application Control Chapter Outline
Accessing the Application Control
Visual Basic
Visual C++
Using the Application Control
Process Manager
Explorer
Application Control Properties
General Application Control Properties
Process Manager Properties
Explorer Properties
HexSight Basics User Guide
193
Application Control
Accessing the Application Control
The Application control is basically an ActiveX control that can be used in
Visual Basic or Visual C++.
Visual Basic
Once you add the Application Control to a Visual Basic form:
• Right-click on the Application Control icon.
• Select Edit to open the HexSight Application Control interface
used to build an application.
• Select Properties to open the properties window (advanced
users).
Consult Tutorial 1 in the Visual Basic Tutorials chapter for more details
on adding a HexSight control to a Visual Basic form.
Visual C++
Once you have added the Application Control to a Visual C++ dialog:
• Right-click on the Application Control icon.
• Select Edit to open the Application Control interface used to
build an application.
• Select Properties to open the properties window (advanced
users).
Consult Tutorial 1 in the Visual C++ Tutorials chapter for more details
on adding a HexSight control to a C++ dialog.
HexSight Basics User Guide
194
Application Control
Using the Application Control
The Application Control provides two panels: the Process Manager and the
Explorer. This section will explain how to use the Application Control for
building a vision application.
Process Manager
The Process Manager manages the list of tools that you have instantiated
to build your application. This panel is constituted of four main sections: a
list of instantiated processes, a list of available processes, a set of
command buttons and the execution time text box.
FIGURE 87
Application Control Window
Instantiated Processes
The Instantiated Processes frame shows the sequence of tools
you have added or instantiated to build your vision application.
HexSight Basics User Guide
195
Application Control
This set of instantiated processes, including their properties, constitutes a
configuration. You can save a configuration for latter use in the same
application or in another vision application. Configurations are saved to the
HexSight cfg format.
Note: The order of instantiated processes is important. The execution
sequence is done in process order.
Name Text Box
This displays the current name of a selected tool in the list of
Instantiated Processes.
Use this text box to modify the name of the currently selected
tool.The tool’s name can also be modified within its properties
window.
Type Text Box
This displays the read only type name of a selected tool. For
example: if you renamed an instance of the Acquisition Device as
Acquisition, its Type name remains the same i.e.
HSAcquisitionDevice.
Command Buttons
The command buttons allow you to manage the list of instantiated
processes that constitute application. Instantiated processes (also
called a tools) application can be saved to a configuration file that
saves both the order of the tools and the configured properties of
each tool.
• Load: Loads an existing configuration (*.cfg) file that replaces
the current list of instantiated processes.
• Save: Saves the current list of tools along with their properties
to a configuration file (*.cfg).
HexSight Basics User Guide
196
Application Control
• Import: Imports all the processes from the selected
configuration file into the current list of instantiate processes.
• Export: Exports selected processes from the current list by
saving them to a new configuration file.
• Add Process: Adds a process selected from the Available
Processes list to Instantiated Processes list and opens the
properties window for the selected process.
• Duplicate Process: Replicates a process selected from the
Instantiated Processes list and appends it to the current list.
The new tool instance is configured identically, except for its
name.
• Remove Process: Removes a selected process from the
application’s list of Instantiated Processes.
• Edit Process: Opens the properties window for a process
selected from the Instantiated Processes list.
• Each click of the Up button moves a selected process up one
level higher in the Instantiated Processes list.
• Each click of the Down button moves a selected process down
one level lower in the Instantiated Processes list.
Execute Sequence
When you first open an application either in design mode or
runtime mode the runtime database of Images and Scenes is
empty. To create the runtime database you must first execute the
sequence of processes that make up the application.
When you click Execute Sequence, each tool executes its process
in the order that it appears in the list of instantiated processes.
HexSight Basics User Guide
197
Application Control
• Outputs by a tool are used as input for tools further down the
list. For example: images output by the HSAcquisitionDevice can
be used as input by the Locator.
• The list of processes has been executed when a new execution
time appears.
HexSight Online Help
The Help button opens HexSight online help, as illustrated in
Figure 88. HexSight help contains both the User Guide and
Reference Manual.
FIGURE 88
HexSight HTML Help Window
Execution Time Text Box
The read only Execution Time text box displays the time for the
last execution of instantiated processes.
Available Processes
Available HexSight processes, or tools, are presented as a list of
expandable folders regrouping tools by type. In many cases, more
than one instance of a type of tool can be added to an application.
As each new process is instantiated, or added to the application, its
HexSight Basics User Guide
198
Application Control
name appears in Instantiated Processes list. Below is a brief
description of each process, as they appear in the Process manager.
HexSight Acquisition Tools
• HSAcquisition Device acquires grey-scale Images from a
frame grabber, a DirecShow Device (IEEE 1394) or from a
database of Images. Acquired images can be calibrated within
the Acquisition Device interface.
HexSight Image Processing Tools
• HSImage Processing Tool: processes grey-scale images by
applying arithmetic, assignment, logical, filtering, morphological
or histogram operators. Users can also define and apply custom
filtering operators.
• HSSamplingTool: samples model-defined area of a grey-scale
Image and outputs the sample as a new grey-scale Image.
• Image Sharpness Tool: The Image Sharpness Tool computes
the sharpness of preponderant edges in a user-defined region of
interest.
• Image Histogram Tool: The Image Histogram tool computes
greylevel statistics within a user-defined region of interest.
HexSight Inspection Tools
• HSArcCaliper: measures distances between edges in arcshaped areas of an object. Users can select edge pairs of interest
by setting Caliper properties such as constraints, thresholds and
polarities.
• HSArcEdge Locator: finds and locates edges in arc-shaped
areas of an object, meeting user-defined criteria such as
strength and polarity. The Edge Locator also scores and sorts
located edges.
HexSight Basics User Guide
199
Application Control
• HSBlob Analyzer: finds, labels and analyzes irregular shaped
objects. This tool detects and quantifies blobs that meet userdefined criteria.
• HSCaliper: measures distances between edges. Users can
select edge pairs of interest by setting Caliper properties such as
constraints, thresholds and polarities.
• HSEdge Locator: finds and locates edges meeting user-defined
criteria such as strength and polarity. The Edge Locator also
scores and sorts located edges.
• HSPattern Locator: finds and locates instances of a pattern
occurring within an Image. Patterns are provided by the
HexSight Model control.
HexSight Locator Tools
• HSLocator: finds and locates objects based on the geometry of
their contours. Scale factor, orientation, and position are
provided for each located instance. Models used for object
location are created, edited and managed through the Locator
interface.
• HSPointFinder: The Point Finder finds and locates point
features on objects and returns the angle as well as the
coordinates of the found point.
• HSLineFinder: The Line Finder allows the user to access and
manipulate Line entities. Entities can be generated by a
HexSight Finder tool, the Builder tool or created
programmatically within the Class Library.
• HSArcFinder: The Arc Finder finds and locates circular features
on objects and returns the coordinates of the center of the arc,
the start and end angles, and the radius.
HexSight Basics User Guide
200
Application Control
• HSBuilder: The Builder creates geometric entities such as
points, lines or arcs from user-defined parameters or by
combining other geometric entities.
HexSight Image Processing Tools
• HSImage Processing: processes images by applying
arithmetic, assignment, logical, filtering, morphological or
histogram operators. Users can also define and apply custom
filtering operators.
• HSSamplingTool: outputs a grey-scale image sampled from a
region of interest defined on a larger image. Dimensional and
positional information is computed from the sampled image.
• HSImage Histogram Tool: computes greylevel statistics within
a user-defined region of interest.
• Image Sharpness Tool: computes the sharpness of
preponderant edges in a user-defined region of interest.
Symbology Tools
Symbology Tools are an optional set of tools.
HSBarcode Reader: reads and extracts information from bar code
symbology.
HSData Matrix Reader: reads and extracts information from Data
Matrix symbology.
HSOCR Fixed Font: recognizes alphanumerical fixed-font
character strings.
General Steps for Building an Application
1.
Instantiate process.
• If processes are not visible in the Available Processes list,
double-click on folder to expand.
HexSight Basics User Guide
201
Application Control
• Select a process from the list and click Add Process to add it to
the list of instantiated processes.
• The properties page for the tool added tool appears.
Note: The first process of any application must be a
HSAcquisitionDevice process.
2.
Configure process.
Set up and configure the tool. Consult Using sections in each
tool’s chapter for details on the setup and configuration of
individual tools. Return to the Process Manager after configuring
the tool.
3.
Execute sequence so that outputs are available for subsequent
processes.
• Click Execute Sequence in the Process Manager.
• Use the Explorer panel to visualize each tools output to the
runtime database.
Explorer
The Explorer panel contains two main sections: the Tree View and the
Information Area. Basically, the Explorer lets you view the information
contained in the application’s runtime database.
Most HexSight tools rely on the output provided by a tool further up in the
sequence of instantiated tools. The database can thus be used for
diagnostic purposes. You can rapidly identify missing outputs that might be
disabling the execution of some tools.
HexSight Basics User Guide
202
Application Control
Tree View:
displays contents
of the runtime database
FIGURE 89
Information Area:
provides information for
the selected Image or Scene
Application Control — Explorer Panel
Tree View
The tree view displays the contents of the application’s runtime
database as a hierarchical list of folders. These folders contain
Views, Scenes and Images generated by the processes in the
application.
• Click the +/- signs in the Explorer Database to expand/collapse
the list of contained folders.
Note: The tree view appears empty until you have executed at least
one process in the Process Manager’s list of Instantiated
Processes.
If you are in design mode, i.e. you accessed the application
control from the ActiveX control on the form (by Visual Basic or
Visual C++):
• Go to the Process Manager and click Execute Sequence.
HexSight Basics User Guide
203
Application Control
• Return to the Explorer to view the database.
Views
A View is a folder or collection of database objects that are output
by a HexSight process. These objects can be entities, images or
scenes as shown in Figure 90.
• Typically, you will name one View per process. Model Scenes and
Images are by default stored in a separate Model View.
• The name of the View is defined in the tool’s property page.
• As you add processes and execute the sequence, each new View,
with its associated objects, is displayed in the Explorer.
View Folder containing
Point, Line and Arc entities
View Folder containing
an Image and a Scene
FIGURE 90
Expanded Views in the Explorer
Images
An image is a matrix of grey-scale pixels that represents an
object’s 2D appearance. Images in the tree view, which have been
generated by HexSight, can be saved as bitmap (bmp) images.
Scenes
A Scene is a vectorized representation of the geometry in an
Image. More precisely, a Scene is a description of line vectors that
reproduce the geometric shapes of an object.
Entities
HexSight Basics User Guide
204
Application Control
Using the Tree View
Upon opening an application the Explorer is empty. A new database
is created when you execute an application for the first time. Figure
90 shows a database that has been created after the execution of
an application.
Managing Runtime Database Objects
The context menu for the Tree View provides you with the following
options for managing the runtime database, as illustrated in Figure
91.
Right-click on icons for context menu
FIGURE 91
Database Options
• Clear: Clears all objects in the current database.
• Load...: Allows you to load an existing database file to the
runtime database.
• Delete: Deletes the selected database object
• Save As...: Allows you to save the current database to file.
• Rename: Allows you to rename the selected database object.
• Insert: Allows you to add one or more objects from a selected
file.
HexSight Basics User Guide
205
Application Control
• New View: Lets you add a new View to the runtime database.
Opening and Displaying an Image, Scene or Entity
Scenes, Images and Entities can be displayed from the Explorer
database.
• Use + symbol to expand View, Image and/or Scene folders.
• Right-click an icon to open a context menu.
Right-click on icon to
obtain context menu
FIGURE 92
Displaying a Scene from the Explorer Database
• Select Show in New Window or Append To.
• If you select Append To you must specify an already opened
Image or Scene to be used as foreground. Figure 93 shows a
display window with the Contour Scene as foreground and the
Grey-Scale Image as background.
HexSight Basics User Guide
206
Application Control
Display toolbar
Display window containing:
- Image as background
- Scene as foreground (blue)
FIGURE 93
Display Scene and Image from the Explorer Database
Saving Database Objects
• On an icon in the tree view and select Save As... from the
context menu and specify the path for the new file in the Save
dialog box.
• Grey-scale images are, by default, saved to the HexSight Images
format (*.hig). You can also save grey-scale images to the
Windows Bitmap (*.bmp) format.
• Scenes are saved to the HexSight Scene format (*.hsc).
• Views are saved to the HexSight View format (*.hvw).
• Point Entities can be saved as HexSight Points format (*.hpt)
• Line Entities can be saved to the HexSight Lines format (*.hln)
• Arc Entities can be saved to the HexSight Arcs format (*.hac)
Information Area
The information area to the right of the tree view displays a
thumbnail representation of the selected Image or Scene and
information describing the selected item. See Figure 89.
HexSight Basics User Guide
207
Application Control
Application Control Proper ties
General Application Control Properties
To access the General Application Control you must select the properties
for the HexSight Application control, either in the Visual Basic or Visual
C++ window.
Use this window to set the Application Control properties and to access the
Process Manager and Explorer property pages.
FIGURE 94
Application Control Properties
• Process Name lets you customize the name property for the
Application Control.
• If Control Interface Visible is enabled, the Application Control
interface will be visible in your application interface. (VB or C++)
HexSight Basics User Guide
208
Application Control
Automation Properties
• Update Explorer On Database Change: When enabled, each
time the tree structure of the runtime database is changed, the
Tree View is refreshed.
• Update Display On Done: When enabled, display windows
opened with the Tree View are refreshed after each execution of
the application.
• Display Message On Error: When enabled, message errors are
displayed.
Process Manager Properties
Access Process Manager properties through the HSApplication Properties
window by clicking the Process Manager Properties. Use this window to
set the Process Manager properties.
FIGURE 95
Process Manager Properties
HexSight Basics User Guide
209
Application Control
Process Name
This lets you customize the Name property for the Process
Manager.
Process Manager Operating Modes
Use the radio buttons to enable one of two modes:
Running: When this mode is enabled, no edition or creation can be
carried out in the Process Manager.
Interactive: This mode lets you to control which edition functions
can be carried out in the Process Manager:
• Display Process Manager User: If disabled, all graphical user
elements are removed from the Process Manager window.
• Allow Process List Edition: If disabled, the list of Instantiated
Processes in the Process Manager cannot be edited.
• Allow Process Properties Edition: If disabled, the properties
pages of the tools instantiated in the Process Manager cannot be
opened for edition.
Explorer Properties
Access this properties window from the Application Control properties
window by clicking the Explorer Properties command button. Use this
window to customize the appearance and content of the Explorer Panel in
the Application Control Interface.
HexSight Basics User Guide
210
Application Control
FIGURE 96
Explorer Control Properties
General Options
• Explorer Enabled: If disabled, the Explorer will not appear in
the Application Control interface.
• Context Menu Enabled: If disabled, right-click option menus in
the Tree View are not available.
• Display Properties: Enables the display of the information
area.
• List Control Height: Sets the height of the information frame.
• Tree Control Width: Sets the width of the Tree View frame.
HexSight Basics User Guide
211
Acquisition Device
Acquisition Device
The Acquisition Device acquires grey-scale Images from a frame grabber or
from a database of Images. Integrated image calibration methods can
compensate for pixel aspect ratio, perspective and lens distortion.
Acquisition Device
Understanding Acquisition Device Concepts
Image Acquisition
Left-Handed vs Right-Handed Coordinate Systems
Image Calibration
Acquisition Device Output
Using the Acquisition Device
General Panel
Configuration Panel
Input Sub-Panel
Calibration Sub-Panel
Output Sub-Panel
Results Panel
HexSight Basics User Guide
213
Acquisition Device
Understanding Acquisition Device
Concepts
This section describes Acquisition Device concepts under three sections
that correspond to the main functions carried out by this tool:
• Image Acquisition
• Image Calibration
• Acquisition Device Output
Image Acquisition
The Acquisition Device provides three possible input sources for acquiring
images needed to run a HexSight application. These three sources are
described below.
File Emulation
The File Emulation mode simulates a live acquisition by using a
database of images, called an emulation database.
Emulation files are usually created for two reasons:
a) Storing images used to create object Models. Such images
should be taken in almost ideal lighting and pose conditions
to ensure creation of accurate, well-defined Models.
b) Creating a database to test and set up an application.
Environmental conditions should be the same as those
used for real time operation. This database should include
various poses and rotations for a given object.
Database Selection
The Database Selection mode uses an image already in the
runtime database as the input source for the Acquisition Device.
This mode is provided for advanced applications in which images
HexSight Basics User Guide
214
Acquisition Device
are provided by an external source, instead of a supported frame
grabber, for example. These images can then be calibrated through
the Acquisition Device and output to other HexSight tools.
Frame Grabbers
The Frame Grabber mode is the live acquisition mode that allows
input from one or more frame grabbers. The Generic Frame
Grabber setting uses the first frame grabber detected at runtime
by the Acquisition Device as the input source. The following frame
grabbers are currently supported.
• Data Translation DT-3152
• Data Translation DT-3155
• Data Translation DT-3157
• Imagenation PX610A
• Imagenation PXC200
• Coreco Imaging IC-ASYNC
• Coreco Imaging PC-DIG
• Coreco Imaging PCVision
• Matrox Meteor-II/Standard
• Matrox Meteor-II/Multi-Channel
• Matrox Meteor-II/Digital
• Matrox Orion
• MRT micro VPP
• Opteon DepictMaster 4x1
HexSight Basics User Guide
215
Acquisition Device
• DirectShow Device (FireWire, IEEE 1394)
Note: Additional frame grabbers may be added to this list. Contact
HexSight technical support for an updated list of supported frame
grabbers.
HexSight can HexSight can directly interface with the standard
device drivers for the supported frame grabbers. The Acquisition
Device interface provides access to configuration parameters for
the selected frame grabber. See the corresponding frame grabber
section in Using the Acquisition Device for details on configuring
the parameters.
Left-Handed vs Right-Handed Coordinate Systems
HexSight supports both left- and right-handed coordinate systems,
for both the calibrated (World) coordinate system and the Image
coordinate system. Other HexSight coordinate systems, Object and
Tool, are always right-handed.
• A left-handed (top-left origin) as well as a right-handed (bottomleft origin) image can be calibrated into either a left-handed or a
right-handed coordinate system.
• Since models are created on a calibrated image, the type of
coordinate system for a given model must be of the same type
as the calibrated (World) coordinate system in which instances of
the modeled object are being sought.
HexSight Basics User Guide
216
Acquisition Device
RIGHT-HANDED COORDINATE SYSTEMS
Y
positive angles
always counterclockwise
from X towards Y-axis
90°
Y
135°
X
X
LEFT-HANDED COORDINATE SYSTEMS
X
X
90°
positive angles
always clockwise
from X towards Y-axis
Y
FIGURE 97
135°
Y
Right-Handed vs. Left-Handed Coordinate Systems
Origin
By default, the origin of a right-handed coordinate system is at the
bottom-left of an image whereas the origin of a left-handed
coordinate system (top-left origin) as well as a right-handed
(bottom-left origin) image can be calibrated into either a lefthanded or a right-handed coordinate system.
Rotation
Angles are always measured from the X-axis toward the Y-axis in
either clockwise or counterclockwise direction, depending on the
type of coordinate system type.
HexSight Basics User Guide
217
Acquisition Device
• With a left-handed calibrated coordinate system, the HexSight
tools return positive angle values for clockwise rotations,
whereas with a right-handed coordinate system, HexSight tools
return positive angle values for counterclockwise rotations.
Image Coordinate System
The Image coordinate system type is selected at image acquisition.
Coordinates in this system are expressed in terms of pixels.
World Coordinate System
World coordinate system is also called the calibrated coordinate
system. Its type is set during the calibration process. Coordinates
in this system are expressed in terms of calibrated units.
Image Calibration
Calibration ensures the accuracy of a vision application. It permits
correction of image errors and complete application portability from site to
site. The following three types of image deformation must be corrected to
ensure the robustness of the object detection tools.
• Non-Square Pixels: Because pixels are not square (as in most
cameras), distortion occurs when any object is rotated in the
field of view. This distortion can generate a significant lack of
precision. By calibrating, you will provide rotational invariance
for non-square pixels. The following HexSight calibration
methods can be used to correct for this type of error: XY Scale,
Perspective, Distortion LUT, and Distortion Model.
• Perspective Distortion: Cameras are rarely perfectly
perpendicular with respect to the work surface. They may even
be purposely set at an angle. Non-orthogonality generates
perspective distortions. Perspective distortion can be corrected
HexSight Basics User Guide
218
Acquisition Device
with the following HexSight calibration methods: Perspective,
Distortion LUT, and Distortion Model.
• Camera Lens Distortion: Camera lenses induce some amount
of radial distortion. This distortion is generally stronger for
lenses having a short focal distance. Lens distortion can be
corrected by the following HexSight calibration methods:
Distortion LUT, and Distortion Model.
Calibration Parameters
Calibration parameters can be stored in files that can be loaded by
various applications sharing the same optical setup. Images in
emulation database files are stored with their original calibration.
The Acquisition Device can be set up to use this original calibration
when using file emulation as the input source.
Calibration Units
• The calibration can be configured to use physical units to express
positions
• The HexSight environment provides automatic conversion
between each of the supported unit systems.
• The generic length unit, Calibration Units, can be used to
calibrate the system when actual physical dimensions are not
required, or when the objects to inspect possess a strong 3D
aspect (measurements on sections located at relatively large Z
distance from the calibration plane might yield to inconsistent
values).
Calibrated Coordinate System
• The World coordinate system can be calibrated with either a
right- or left handed coordinate system, regardless of the
coordinate system type that has been set for the input image.
HexSight Basics User Guide
219
Acquisition Device
HexSight Calibration Methods
HexSight provides the following five calibration methods.
XY Scale Calibration
This calibration procedure is easy to set up since the calibration
target can be any object of known dimensions. Less precise than
perspective and distortion calibrations, XY Scale calibration is used
in cases where it is not physically possible to place a dot target. It
does not compensate for either lens distortion or perspective
distortion.
Camera’s optical axis must be
perpendicular to work surface
Work surface
Known height and width
measures on target object
FIGURE 98
XY Scale Calibration— Target and Camera Position
• The user must provide both a known height and width measure
for the object used as a target.
• In absence of a target, the XY Scale method can also be used to
manually enter the height and width of a pixel in calibrated
World values if they are already known.
• For this type of calibration, the camera’s optical axis must be
perfectly PERPENDICULAR to the work surface.
HexSight Basics User Guide
220
Acquisition Device
Perspective Calibration
As with XY Scale calibration, this type of calibration can be carried
out on a known object. This mode is less precise than a distortion
calibration. Therefore it is used in cases where it is not physically
possible to place a dot target. It is however more precise than an
XY Scale calibration since it compensates for perspective distortion.
It does not compensate for lens distortion.
Camera’s optical axis is not
required to be perpendicular
to the work surface
Work surface
Known points
on target object
FIGURE 99
Perspective Calibration — Target and Camera Position
• The target object must provide four non-colinear points, typically
corners.
• The user must know and provide the calibrated World
coordinates of the four points. These points can be automatically
detected in the Image with the integrated corner detector or
positioned manually by entering the appropriate position values.
Distortion LUT Calibration
This calibration method requires the use of a target constituted of a
grid of dots, referred to as a dot target. A lookup table is created
from all the dot positions on the target. The position of any given
point in the image is interpolated from the position of the four
closest target dots.
HexSight Basics User Guide
221
Acquisition Device
• This calibration mode is preferable to the Distortion Model mode
in cases where lens distortion is very strong.
• This calibration mode also requires a VERY precise, "perfect"
target.
FIGURE 100 Dot Targets Used for Distortion Calibration Methods
Note: See Using the Acquisition Device for more information on dot
targets.
Distortion Model Calibration
This is the preferred and recommended calibration mode. As with
Distortion LUT, the Distortion Model method requires the use of a
dot target. This calibration method uses a mathematical calculation
to apply a best fit approach for locating points in the current image.
• This method tolerates a slightly less precise target than the
Distortion LUT method since it averages out errors, and is
preferred in cases where lens distortion is not very strong.
Programmatic (Automatic) Calibration
HexSight provides a way to programmatically calibrate applications
by providing a custom set of calibration target points. With this
method, called Automatic Calibration, the application developer
must establish how the calibration data (coordinates of points on
HexSight Basics User Guide
222
Acquisition Device
the work surface) will be acquired and how they will be supplied to
the Acquisition Device process.
Acquisition Device Output
The grey-scale Image output by the Acquisition Device is typically used as
input by subsequent HexSight processes such as the Locator and
inspection tools.
HexSight Basics User Guide
223
Acquisition Device
Using the Acquisition Device
General Panel
The General panel of the Acquisition Device contains only the process
name. You can modify the name in this panel to replace the default name.
• Typically, the default Process Name appears as
HSAcquisitionDevice0.
• Rename the tool by typing in a new name, such as Acquisition.
IMPORTANT: A H EX S IGHT APPLICATION CAN CONTAIN ONLY A
SINGLE ACQUISITION DEVICE. IF YOU ACQUIRE IMAGES FROM
MUTIPLE SOURCES , CREATE A C ONFIGURATION FOR EACH SOURCE .
Configuration Panel
An Acquisition Device Configuration stores all the parameters set up within
the Configuration panel: acquisition, calibration and output.
IMPORTANT:
AN
ACQUISITION
D EVICE
C ONFIGURATION
IS
DIFFERENT FROM AN APPLICATION CONFIGURATION , WHICH CONTAINS
THE CONFIGURED TOOLS THAT CONSTITUTE A HEXSIGHT
APPLICATION .
A CQUISITION D EVICE C ONFIGURATIONS ARE SAVED AS
A CQUISITION D EVICE .
PART OF THE PROPERTIES OF THE
A default Configuration is attributed whenever you instantiate a new
Acquisition Device process. Typically each frame grabber or camera used in
an application will have its own configuration.
Using Multiple Configurations
There can be more than one active configuration; enabling multiple active
configurations permits a single Execute command to perform an acquisition
on each active configuration. Programmatically the ConfigurationEnabled
property sets the active Configurations. In the interface, you can activate a
configuration by enabling its corresponding check box.
HexSight Basics User Guide
224
Acquisition Device
Editing the List of Configurations
Set up additional Configurations and modify the list of Configurations using
the provided set of command buttons:
Add Configuration
Remove Configuration
Set as Default
Rename Configuration
Copy Configuration
Paste Configuration
The Default Configuration
When an Acquisition Device has multiple Configurations, the
execution is always carried out using the default Configuration.
• To set the default configuration, select an item in the list of
available Configurations and click Set As Default.
• For instance, an Acquisition Device can have one Configuration
named File Emulation, set up in the file emulation mode, and
another named Camera, set up to use a frame grabber.
a) To test the application with the stored images: Select the
File Emulation Configuration in the list and click Set As
Default. Click Execute Sequence in the Process Manager
to simulate the acquisition.
b) To use the frame grabber as the input source, set the
Camera configuration as the default and click Execute
Sequence in the Process Manager.
Using Multiple Configurations
You can set up more than one Configuration for a given Acquisition
Device. This can be used to configure multi-camera acquisitions or
HexSight Basics User Guide
225
Acquisition Device
to set up two or more sets or calibration parameters for a single
camera.
• For example, multiple Configurations can be used to calibrate a
mobile camera (on a robot arm for instance) that takes images
of the same object at different distances. You can then toggle
between the two or more configurations to activate the correct
calibration for a given position.
• Multiple Configurations can also be used in multiple camera
setups to specify channel from which the image is acquired.
Instead of programmatically changing the input channel after
each acquisition, you can set up two Configurations, one for each
channel, and toggle between the two. This is particularly useful
when the two cameras are calibrated differently (as it is usually
the case) with each Configuration holding the calibration of its
attributed camera.
Using Multiple Camera Configurations Programmatically
There are two ways of using the Acquisition Device
programmatically: sequential acquisitions and pipelined
acquisitions. In the sequential mode, an acquisition request is sent
to the frame grabber and the Acquisition Device waits until the
image is acquired before returning the control to the application.
The following example shows how to toggle between the two
Configurations in the sequential acquisition mode.
Dim Acquisition as HSAcquisitionDevice
Set Acquisition = _
ApplicationControl.ProcessManager.Process(“Acquisition”)
Do
Acquisition.ConfigurationDefault = “Camera0”
Acquisition.Execute
HexSight Basics User Guide
226
Acquisition Device
‘Process Camera0 image
...
Acquisition.ConfigurationDefault = “Camera1”
Acquisition.Execute
‘Process Camera1 image
Loop While Not ExitLoop
In the pipelined acquisition mode, an acquisition request is sent to
the frame grabber and the Acquisition Device returns the control to
the application immediately. When the application is ready to
process the image, it instructs the Acquisition Device to wait for the
completion of the request. The following example shows how to use
the pipelined acquisition mode with two Configurations.
Dim Acquisition as HSAcquisitionDevice
Set Acquisition = _
ApplicationControl.ProcessManager.Process(“Acquisition”)
‘Place a first request in the pipeline”
Acquisition.Start “Camera0”
Acquisition.Start “Camera1”
Do
‘Place a new request in the pipeline
Acquisition.Start “Camera0”
Acquisition.Start “Camera1”
‘Wait for Camera0 image
Acquisition.Wait
‘Process Camera0 image
...
‘Wait for Camera1 image
Acquisition.Wait
‘Process Camera1 image
HexSight Basics User Guide
227
Acquisition Device
...
Loop While Not ExitLoop
‘Flush the acquisition pipeline
Acquisition.Wait
Acquisition.Wait
The same pipelined acquisition mode can be used with a single
Configuration. This is useful for time-critical applications because a
new image can be acquired while another one is processed,
reducing the total cycle time.
Input Sub-Panel
Use this panel to select the input device (or mode) that will acquire the
images for your application and configure the parameters for the selected
device.
In running mode, you will typically use live images input by a camera
through a configured frame grabber. However, to set up and configure a
new HexSight application, you will most often rely on a database of images
to simulate real time acquisitions.
Live images are typically provided by a frame grabber. The Input
panel always offers the Generic Frame Grabber input mode.
Additional frame grabbers can be added and remove using the Add
Frame Grabber and Remove Frame Grabber buttons.
Database Selection
Database Selection lets you use an image already present in the
application database as the input source for the current
Configuration. Use the selection icon to select the Selection Grey
Scale Image and its View from the application’s current database.
HexSight Basics User Guide
228
Acquisition Device
File Emulation
File Emulation input uses a database of images, referred to here
as an emulation database file, to simulate real time image
acquisition. Image database files are particularly useful for:
creating models, setting up and testing a new application or
analyzing/verifying performance with Images from a real time
operation.
To familiarize yourself with the Acquisition Device without installing
a complete camera/frame grabber setup, use one of the image
databases provided with the Examples on your HexSight CD.
Using the File Emulation Database
An emulation database file is typically constituted by grabbing
images of the same objects with various poses or orientations in
the workspace. The emulation file illustrated in Figure 101 for
example, consists of a single object with various poses. Lighting
conditions have been set up to obtain well-contrasted and strongly
detailed images.
Enable/Disable check boxes allow you to select which images in
the database you want to use for the current application.
HexSight Basics User Guide
229
Acquisition Device
FIGURE 101 Emulation Database
Use the command buttons to add or remove images from the
emulation database:
• Delete Image removes the image currently selected in the
emulation database. This removes it from the runtime
• Import allows you to import selected images into the current
emulation database from Bitmap (*.bmp) files, HexSight Image
files (*.hig) or selected images from a HexSight Database file
(*.hdb). Note that large databases can be long to load and use a
significant amount of memory.
• Export allows you to export the currently selected image as an
8-bit grey-scale Bitmap image or as a HexSight Image (*.hig)
file.
• New clears the current database.
• Load... clears the existing database (*.hdb) for the current
Configuration and replaces it by the newly selected database file.
• Save As... allows you to save the current database to a
database (*.hdb) file.
HexSight Basics User Guide
230
Acquisition Device
Selecting Specific Images in the Database
To test your application with specific cases, you can enable or
disable images in the emulation database.
• To enable all the images in the database, click Enable All.
• To disable all the images in the database, click Disable All.
• To enable/disable specific images, click the specific images check
box in the Enabled column.
The check box in the Next column is exclusive and identifies which
image will be output the next time the Acquisition Device is
executed. For example, to test an application with only a specific
image in a given database:
• Click Disable All.
• Click the Enabled and Next check boxes for this image.
The thumbnail image provides a preview of the selected image.
Building an Emulation Database File
An emulation database file is generally constituted by grabbing
images of the same objects with various poses or orientations in
the workspace. The emulation file illustrated in Figure 101 for
example, consists of a single object with various poses. Lighting
conditions have been set up to obtain well-contrasted and strongly
detailed images.
• First select an existing Configuration in the Configuration list or
create a new one and select File Emulation as the input source
for this Configuration.
• From the list of input sources, select the required frame grabber
or use the Generic Frame Grabber interface (see sections on the
frame grabber input for more details).
HexSight Basics User Guide
231
Acquisition Device
• To view the live image output by the camera, click Show RealTime Display.
• Click Append to Emulation Database. In the Emulation Image
Name dialog, type the name for the new image. You can also
build an Emulation database by importing 8-bit grey-scale
images.
Generic Frame Grabber
When Generic Frame Grabber is selected, the Acquisition Device
uses the first detected frame grabber as the input source for the
selected Configuration. Since the Configuration parameters vary
widely from one frame grabber to another, this input source does
not provide any configurable parameters. Instead, the default
parameters for the type of frame grabber detected are applied and
the first channel is used as the input source.
• Although not very useful for advanced applications, the Generic
Frame Grabber interface can be used to build applications
compatible with various acquisition setups.
• The Generic Frame Grabber interface only works with the frame
grabber types supported by the Acquisition Device.
Adding a Detected Frame Grabber
To configure parameters for a frame grabber you must first add a
specific frame grabber as the input source for the selected
configuration.
• Use the Add Frame Grabber button to open the frame grabber
dialog shown in Figure 102. The Detected Frame Grabbers
frame lists the frame grabbers that are installed in the system.
• If one or more supported frame grabbers are installed in the
system, they will appear in the list of detected frame grabbers.
HexSight Basics User Guide
232
Acquisition Device
• To use one of the listed frame grabbers, select its name in the
Model list, then OK to quit the window. This will add the frame
grabber to the list of input devices available to each
Configuration of the Acquisition Device.
FIGURE 102 Frame Grabber Selection
Adding a Virtual Frame Grabber
A virtual frame grabber is one that is not physically installed on the
system but is added to the list of available input devices.
This virtual frame grabber is useful as a container in which you can
store the parameters for future use on a system where a grabber of
the same type (as that as of the virtual frame grabber) is installed.
When you run the application with an actually installed frame
grabber of this type, the parameters set for the virtual frame
grabber are applied and images can be acquired.
• Click Add Frame Grabber to open the frame grabber selection
window illustrated in Figure 102.
• Select <Unlisted> in the list of detected frame grabbers.
HexSight Basics User Guide
233
Acquisition Device
• From the Model combo box, select the detected frame grabber
type.
• Enter the ID used to identify the frame grabber; 0 is attributed to
the first frame grabber detected at boot time, 1 is attributed to
the second board of the same type, and so forth.
• Click OK to add this device to the list and return to the
Acquisition Device interface. Setup parameters for the selected
frame grabber now appear in the Input sub-panel.
Removing a Frame Grabber
Select a frame grabber from the list then click Remove Frame
Grabber.
Frame Grabber Command Buttons
The four following command buttons appear in the Input Sub-Panel
when you select a frame grabber as input source.
• Append Image to Emulation Database allows you to acquire
a new image and add it to the emulation database contained in
the currently selected Configuration. To browse this emulation
database, select File Emulation in the list of available input
devices without selecting another Configuration.
• Show Real-Time Display opens a display window showing live
images output by the camera. You can use this display to adjust
the optical setup for the application. You can change the zoom
factor of the display through the context menu (right-click on the
display).
• Load Parameters lets you load a previously saved frame
grabber configuration file (*.fgp) and apply it to the currently
selected frame grabber, either generic or specified.
• Save Parameters lets you save the current configurations for
the frame grabber for future use (*.fgp file type).
HexSight Basics User Guide
234
Acquisition Device
Coreco Imaging IC-ASYNC
The IC-ASYNC is a versatile progressive scan frame grabber. It
provides up to four (4) fully independent inputs. This board is
recommended for advanced applications requiring features such as
synchronized acquisitions, asynchronous resets, strobe lighting,
etc.
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing a Coreco
Imaging Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the IC-ASYNC are available in the
Parameters frame (Figure 103).
Note: If you are using more than one Coreco Imaging grabber, see
the Multiple Coreco Imaging Frame Grabbers Application section.
FIGURE 103 IC-ASYNC Setup
• The IC-ASYNC is configured through Configuration Files built
with the ITI Camera Configurator application provided with the
frame grabber. The Acquisition Device only supports the binary
cnf file format. By default, the configuration file parameter is
AUTO. The AUTO parameter is not a configuration file but rather
a keyword that instructs the IC-ASYNC to use its default
configuration. Unless a NTSC interlaced camera is used, this
default configuration will not usually work. If you type AUTO in
HexSight Basics User Guide
235
Acquisition Device
the Configuration File text box instead of a valid cnf file name,
you will restore the default configuration. AUTO is case sensitive
and must be in upper case.
• When you enter a file name in the Configuration File text box
or select a file using the Load button, the new frame grabber
configuration is not loaded immediately but rather at the first
execution of the Acquisition Device. The first acquisition can thus
take a few seconds to complete. Two Acquisition Device
Configurations cannot therefore be used in a pipeline if they use
different cnf files because the IC-ASYNC will pause for a few
seconds between each acquisition request.
• Grab specifies which channels should be acquired when the
Acquisition Device is executed with the selected configuration.
When multiple channels must be acquired simultaneously,
enable their respective Grab check boxes. See the following
section for more details on multi-channel acquisitions with the
IC-ASYNC.
• Output specifies which channel provides the grey-scale image
that is created in the runtime database when the Acquisition
Device is executed with the selected Configuration. Unlike Grab,
Output is an exclusive parameter, which means that the image
from only one channel can be output at a time. See Using the
IC-ASYNC in a Multi-Camera Application.
• Trigger is used to specify that before acquiring the
corresponding channel, the IC-ASYNC should wait for the trigger
event configured in the cnf file.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame grabber.
HexSight Basics User Guide
236
Acquisition Device
Using the IC-ASYNC in a Multi-Camera Application
For an IC-ASYNC multi-camera application in which acquisitions
must be simultaneous, you should preferably create an Acquisition
Device Configuration for each channel that must be grabbed. This
method is recommended rather than programmatically changing
the Output parameter with a single Acquisition Device
Configuration because a specific calibration can be set up for each
channel.
Creating an IC-ASYNC Two-Channel Application
To create a two-channel application, define two Acquisition Device
Configurations:
• Set the first one, “Channel0”, with Grab enabled for the two
channels and Output set for channel 0.
• Set the second Configuration, “Channel1”, with Grab disabled for
all channels and Output set for channel 1.
• When the Acquisition Device is executed with the first
Configuration, the two channels are grabbed and kept in
memory and the image from Channel 0 is output to the runtime
database.
• When the Acquisition Device is executed with the second
Configuration, no image is grabbed and the image from Channel
1 is output to the runtime database.
The following example shows how to use these two Configurations
programmatically in an acquisition pipeline.
Dim Acquisition as HSAcquisitionDevice
Set Acquisition = _
ApplicationControl.ProcessManager.Process(“Acquisition”)
‘Place a first request in the pipeline”
Acquisition.Start “Channel0”
HexSight Basics User Guide
237
Acquisition Device
Acquisition.Start “Channel1”
Do
‘Place a new request in the pipeline
Acquisition.Start “Channel0”
Acquisition.Start “Channel1”
‘Wait for Camera0 image
Acquisition.Wait
‘Process Camera0 image
...
‘Wait for Camera1 image
Acquisition.Wait
‘Process Camera1 image
...
Loop While Not ExitLoop
‘Flush the acquisition pipeline
Acquisition.Wait
Acquisition.Wait
Coreco Imaging PC-DIG
The PC-DIG is a progressive scan frame grabber. It provides inputs
for either a single RGB digital camera or up to four 8 bits
monochrome digital cameras. When connecting multiple 8 bits
cameras to the Meteor-II/Digital, the grabber must be configured
to generate the timing signals in order to ensure synchronization
between data channels.
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing a Coreco
Imaging Frame Grabber in the Installing HexSight chapter.
HexSight Basics User Guide
238
Acquisition Device
Most configurable parameters for the PC-DIG are available in the
Parameters frame (Figure 105).
Note: If you are using more than one Coreco Imaging grabber, see
the Multiple Coreco Imaging Frame Grabbers Application section.
• The PC-DIG is configured through Configuration Files built with
the ITI Camera Configurator application provided with the frame
grabber. The Acquisition Device only supports the binary cnf file
format. By default, no configuration file is specified; this
instructs the PC-DIG to use its default configuration. However,
the default configuration will not usually work.
FIGURE 104 PC-DIG Setup
• When you enter a file name manually in the Configuration File
text box or select a file using the Load button, the new
configuration is not loaded immediately. The frame grabber
configuration file is loaded and applied at the first execution of
the Acquisition Device. The first acquisition can thus take a few
seconds to complete. Two Acquisition Device Configurations
cannot therefore be used in a pipeline if they use different cnf
files because the PC-DIG will pause for a few seconds between
each acquisition request.
HexSight Basics User Guide
239
Acquisition Device
• Camera Port sets the input channel from which the image is
acquired. The PC-DIG implementation actually supports only one
(1) 8-bit channel.
• External Trigger is used to specify that before acquiring the
image, the PC-DIG should wait for the trigger event configured
in the cnf file.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame grabber.
Coreco Imaging PCVision
The PCVision is a progressive scan frame grabber that provides
inputs for four (4) cameras. Since it possesses only one acquisition
circuit, each of these four channels must be acquired sequentially.
The PCVision supports features such as asynchronous resets,
strobe lighting and gen-locking.
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing a Coreco
Imaging Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the PCVision are available in the
Parameters frame (Figure 105).
Note: If you are using more than one Coreco Imaging grabber, see
the Multiple Coreco Imaging Frame Grabbers Application section.
HexSight Basics User Guide
240
Acquisition Device
FIGURE 105 PCVision Setup
• The PCVision is configured through Configuration Files built
with the ITI Camera Configurator application provided with the
frame grabber. The Acquisition Device only supports the binary
cnf file format. By default, the configuration file parameter is
AUTO. The AUTO parameter is not a configuration file but rather
a keyword that instructs the PCVision to use its default
configuration. Unless a NTSC interlaced camera is used, this
default configuration will not usually work. If you type AUTO in
the Configuration File text box instead of a valid cnf file name,
you will restore the default configuration. AUTO is case sensitive
and must be in upper case.
• When you enter a file name manually in the Configuration File
text box or select a file using the Load button, the new
configuration is not loaded immediately. The frame grabber
configuration file is loaded and applied at the first execution of
the Acquisition Device. The first acquisition can thus take a few
seconds to complete. Two Acquisition Device Configurations
cannot therefore be used in a pipeline if they use different cnf
files because the PCVision will pause for a few seconds between
each acquisition request.
• Camera Port sets the input channel from which the image is
acquired. The PCVision supports four (4) input channels but has
HexSight Basics User Guide
241
Acquisition Device
only one video acquisition circuit. The channels cannot therefore
be acquired simultaneously.
• External Trigger is used to specify that before acquiring the
image, the PCVision should wait for the trigger event configured
in the cnf file.
• Timeout expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame grabber.
Multiple Coreco Imaging Frame Grabbers Application
If you are using more than one Coreco Imaging frame grabber, of
same or different types (one IC-ASYNC and one PCVision for
example) the following issues should be considered:
• You must include the parameters for all of the installed grabbers
in the cnf files used.
• To make sure the application does not pause when processing
acquisition requests for each grabber, you must use the same cnf
file for all of the Configurations used by the Acquisition Device in
an acquisition pipeline.
• In summary, you define a single cnf file that will include the
configuration of all the boards and cameras installed and use this
file in all of the Acquisition Device Configurations used to define
an acquisition pipeline. The Configurations that use this cnf file
can then be used to control the acquisition pipeline without a
pause between each request.
Data Translation DT-3152
The DT-3152 is a progressive scan frame grabber that provides
inputs for four (4) cameras. Since it possesses only one acquisition
HexSight Basics User Guide
242
Acquisition Device
circuit, each of these four channels must be acquired sequentially.
Furthermore, compatibility problems with some cameras prevent
using features such as asynchronous reset on external triggers and
synchronization between channels. When used with HexSight, the
DT-3152 is best suited as a single channel progressive scan frame
grabber.
Refer to the documentation provided with your frame grabber for
hardware and software installation. HexSight uses the standard
driver provided with the DT-3152, so no special installation
procedure is required. See Installing a Data Translation Frame
Grabber in the Installing HexSight chapter.
The configurable parameters for the DT-3152 are available in the
Parameters frame (Figure 106). The parameters are grouped into
3 tab-selected sub-panels: Acquisition, Clock and Field.
FIGURE 106 DT-3152 Acquisition Sub-Panel
Acquisition Sub-Panel
The Acquisition sub-panel (See Figure 106) configures the
acquisition request.
• Input Source sets the input channel from which the image is
acquired. Only one channel at a time can be acquired with the
DT-3152 when the Acquisition Device is executed.
HexSight Basics User Guide
243
Acquisition Device
• Sync Source sets the input channel that is used to synchronize
the frame grabber digitization circuit with the incoming image.
Usually Synchronization Source is the same as Input
Source. However, when external gen-locking is used to
synchronize cameras, Synchronization Source should always
be set to the same channel to avoid desynchronization when
changing the Input Source.
• Chrominance Filter should be enabled only if you are using a
color camera. Otherwise, leave this parameter disabled since it
has an undesirable smoothing effect on the grey-scale image.
• Interlaced specifies if the incoming video signal is composed of
two fields (interlaced) or a single field (non-interlaced).
Interlaced should be enabled when using a progressive scan
camera as the video source. It should be disabled otherwise.
• White Level, expressed in microvolts, sets the digitizer‘s white
level voltage reference. Use this parameter to adjust the frame
grabber‘s sensitivity with non-standard video signals.
• Black Level, expressed in microvolts, sets the digitizer‘s black
level voltage reference. Use this parameter to adjust the frame
grabber‘s sensitivity with non-standard video signals.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter is ensures that the
application does not freeze if, for example, a video source is not
connected to the frame grabber.
• Trigger sets whether image acquisition is continuous or
synchronized to an external signal event. Select None with the
combo box to enable continuous acquisitions. Select High to
Low or Low to High to respectively synchronize acquisitions
with high to low or low to high transitions of an external trigger
HexSight Basics User Guide
244
Acquisition Device
signal. Due to compatibility problems with most cameras, the
external trigger mode cannot be used to generate asynchronous
resets. Instead, following a trigger event, the grabber will
acquire the next image output by the camera.
Clock Sub-Panel
The Clock sub-panel (See Figure 107) configures the frame grabber
input clocking source and related parameters.
FIGURE 107 DT-3152 Clock Sub-Panel
• Source indicates whether the input clocking should be
generated by the frame grabber (Internal) or provided by an
outside source (External).
• Frequency, expressed in hertz, sets the internal input (pixel)
clock frequency.
• Polarity specifies the polarity of the external input clocking
source. If set to High To Low, synchronization is performed on
high to low transitions. If set to Low To High, synchronization is
performed on low to high transitions.
Field Sub-Panel
The Field sub-panel (See Figure 108) configures the spatial
resolution of input images.
HexSight Basics User Guide
245
Acquisition Device
FIGURE 108 DT-3152 Field Sub-Panel
• Pixels parameters are used to configure: the number of pixels
per line in the active video area (Total Per Line), the beginning
of the active video signal on the line, as a pixel value offset from
the beginning of the horizontal sync (Active First), and the total
number of pixels in a single horizontal line of video, where a
horizontal line is defined as the area between two consecutive
horizontal sync signals (Active Width).
• Lines parameters are used to configure: the total number of
lines in a single field of video, where a field is defined as the area
between two consecutive vertical sync signals (Total Per Field),
the beginning of the active video signal within the field, as a line
offset from the beginning of the vertical sync (Active First), and
the number of lines per field (or non-interlaced frame) in the
active video area (Active Height).
• Clamp parameters are used to configure the beginning of an
area where the frame grabber may clamp the video signal, as a
pixel value offset from the beginning of the horizontal sync
(Clamp Start), and the end of an area where the frame grabber
may clamp the video signal, as a pixel value offset from the
beginning of the horizontal sync (Clamp End).
Data Translation DT-3155
The DT-3155 is an RS-170 monochrome interlaced scan frame
grabber. It provides inputs for four (4) cameras. However, since it
HexSight Basics User Guide
246
Acquisition Device
possesses only one acquisition circuit, each of the four channels
must be acquired sequentially.
Refer to the documentation provided with your frame grabber for
hardware and software installation. HexSight uses the standard
driver provided with the DT-3155, so no special installation
procedure is required. See Installing a Data Translation Frame
Grabber in the Installing HexSight chapter.
The configurable parameters for the DT-3155 are available in the
Parameters frame (Figure 109).
FIGURE 109 DT-3155 Setup
• Input Source sets the input channel from which the image is
acquired. Only one channel at a time can be acquired with the
DT-3155 when the Acquisition Device is executed.
• Sync Source sets the input channel that is used to synchronize
the frame grabber digitization circuit with the incoming image.
Usually Synchronization Source is the same as Input
Source. However, when external gen-locking is used to
synchronize cameras, Synchronization Source should always
be set to the same channel to avoid desynchronization when
changing the Input Source.
HexSight Basics User Guide
247
Acquisition Device
• Enable Chrominance Filter when using a color camera.
Otherwise, leave this parameter disabled since it has an
undesirable smoothing effect on the grey-scale image.
• White Level, expressed in microvolts, sets the digitizer‘s white
level voltage reference. Use this parameter to adjust the frame
grabber‘s sensitivity with non-standard video signals.
• Black Level, expressed in microvolts, sets the digitizer‘s black
level voltage reference. Use this parameter to adjust the frame
grabber‘s sensitivity with non-standard video signals.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame grabber.
• Trigger sets whether the image acquisition is continuous or
synchronized to an external signal event. Select None with the
combo box to enable continuous acquisitions. Select High to
Low or Low to High to respectively synchronize acquisitions
with high to low or low to high transitions of an external trigger
signal. Following a trigger event, the grabber will acquire the
next image output by the camera.
Data Translation DT-3157
The DT-3157 is a digital frame grabber. It provides a single camera
input.
Refer to the documentation provided with your frame grabber for
hardware and software installation. HexSight uses the standard
driver provided with the DT-3157, so no special installation
procedure is required. See Installing a Data Translation Frame
Grabber in the Installing HexSight chapter.
HexSight Basics User Guide
248
Acquisition Device
The configurable parameters for the DT-3157 are available in the
Parameters frame (Figure 110). The parameters are grouped into
3 tab-selected sub-panels: Acquisition, Field and Digital I/O.
FIGURE 110 DT-3157 Acquisition Sub-Panel
Acquisition Sub-Panel
The Acquisition sub-panel (See Figure 110) configures the
acquisition request.
• Exposure parameters allow you to activate (Enable) and define
exposure of the camera. Duration, expressed in microseconds,
sets the desired duration of time of the pulse to generate.
Polarity sets the logic polarity of pulse which can be active High
or active Low.
• Clock parameters allow you to configure the frame grabber input
clocking source. Source indicates whether the input clocking
should be generated by the frame grabber (internal) or provided
by an outside source (external). Frequency, expressed in hertz,
sets the internal input (pixel) clock frequency. Polarity specifies
the polarity of the external input clocking source. If set to High
To Low, synchronization is performed on high to low transitions.
If set to Low To High, synchronization is performed on low to
high transitions.
HexSight Basics User Guide
249
Acquisition Device
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame grabber.
• Trigger sets whether image acquisition is continuous or
synchronized to an external signal event. Select None with the
combo box to enable continuous acquisitions. Select High to
Low or Low to High to respectively synchronize acquisitions
with high to low or low to high transitions of an external trigger
signal. Due to compatibility problems with most cameras, the
external trigger mode cannot be used to generate asynchronous
resets. Instead, following a trigger event, the grabber will
acquire the next image output by the camera.
Field Sub-Panel
The Field sub-panel (See Figure 111) configures the spatial
resolution of input images.
FIGURE 111 DT-3157 Field Sub-Panel
• Pixels parameters are used to configure the number of pixels
per line in the active video area (Total Per Line), the beginning
of the active video signal on the line, as a pixel value offset from
the beginning of the horizontal sync (Active First), and the total
number of pixels in a single horizontal line of video, where a
HexSight Basics User Guide
250
Acquisition Device
horizontal line is defined as the area between two consecutive
horizontal sync signals (Active Width).
• Lines parameters are used to configure the total number of lines
in a single field of video, where a field is defined as the area
between two consecutive vertical sync signals (Total Per Field),
the beginning of the active video signal within the field, as a line
offset from the beginning of the vertical sync (Active First), and
the number of lines per field (or non-interlaced frame) in the
active video area (Active Height).
Digital I/O Sub-Panel
The Digital I/O sub-panel (See Figure 112) configures the digital
input/output ports. A specific line can be set as an Input, as an
arbitrary Output, as a fixed output Set to 0 or as a fixed output
Set to 1.
FIGURE 112 DT-3157 Digital I/O Sub-Panel
Imagenation PX610A
The PX610A is an interlaced/progressive scan frame grabber that
provides inputs for four (4) cameras. Since it possesses only one
acquisition circuit, each of these four channels must be acquired
sequentially.
HexSight Basics User Guide
251
Acquisition Device
FIGURE 113 PX610A Setup
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing an
Imagenation Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the PX610A are available in the
Parameters frame (Figure 113). The parameters are grouped into
3 tab-selected sub-panels: Acquisition, Video and Outputs.
Acquisition Sub-Panel
The Acquisition sub-panel (See Figure 113) configures the
acquisition request. It selects from which camera the image is
acquired and how it is triggered.
• Camera Input sets the camera input from which the image is
acquired. The PX610A supports four (4) camera inputs but has
only one video acquisition circuit. The inputs cannot therefore be
acquired simultaneously.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame grabber.
HexSight Basics User Guide
252
Acquisition Device
• Trigger Type configures how the acquisition request is
triggered. Disabled does not synchronize the acquisition
request to a trigger event. It is processed immediately. Level High causes the Acquisition Device to wait for a high level signal
on the trigger input before processing the acquisition request.
Level - Low forces the Acquisition Device to wait for a low level
signal on the trigger input. Edge - Rising synchronizes the
acquisition request to a low-to-high transition on the trigger
input, while Edge - Falling synchronizes it to a high-to-low
transition.
• Trigger Delay sets a delay between the detection of a trigger
event and the initiation of the acquisition request. This delay is
expressed in number of video fields.
• When active, Debounce specifies that the trigger signal must
return to its inactive state (low for Edge - Rising or high for
Edge - Falling) for at least one video field before another
trigger can be detected. Debounce has no effect with Level High and Level - Low trigger types.
Video Sub-Panel
The Video sub-panel (Figure 114) configures the digitization circuit
for the incoming video signal on the selected camera input.
FIGURE 114 PX610A Video Sub-Panel
HexSight Basics User Guide
253
Acquisition Device
• Sync Mode specifies how the digitization circuit is synchronized
to the incoming video signal. In the Automatic mode, the
PX610A automatically detects the video format (NTSC/RS170 or
PAL/CCIR) and synchronizes its digitization circuit accordingly. In
the Internal mode, the board generates the video timing signals
and ignores synchronization information in the incoming video
signal. In the User mode, the board synchronizes horizontally
and vertically to the incoming video signal, but unlike the
Automatic mode, the field length can be modified for
compatibility with non-standard video sources. In the WEN
mode, the board synchronizes vertically to the WEN signal
received on the trigger input. Horizontal synchronization is
provided by the incoming video signal.
• With the PX610A, the horizontal period cannot be adjusted. With
the Automatic, User and WEN sync modes, the horizontal
period is determined by the incoming video signal. With the
Internal sync mode, the period is fixed to approximately 64us.
Horizontal Resolution sets the number of pixels that should be
digitized during each horizontal period. RS-170 sets the number
of pixels per video line to 640. CCIR sets the number of pixels
per video line to 768. RS-170 or CCIR horizontal resolutions
can be selected, regardless of the actual format of the incoming
video signal. For instance, if CCIR is selected while the actual
format of the video source is RS-170/NTSC, 768 pixels per video
line will be acquired instead of the standard 640. This setting will
therefore affect the aspect ratio of the pixels in the acquired
image. Horizontal Resolution can be set in any of the sync
modes (Automatic, Internal, User and WEN).
• Field Length sets the number of active lines in a single video
field. Field Length can be adjusted only when using the
Internal, User or WEN sync modes. With the Automatic sync
HexSight Basics User Guide
254
Acquisition Device
mode, it is automatically set to 243 if an RS-170/NTSC video
source is detected and to 288 for CCIR/PAL video sources.
• Blank Length sets the number of lines in the vertical blank
period of the video signal. Blank Length can be adjusted only
when using the Internal, User or WEN sync modes. With the
Automatic sync mode, it is automatically set to 19 if an RS170/NTSC video source is detected and to 24 for CCIR/PAL video
sources.
• Single Field specifies if the incoming video signal is composed
of two fields (interlaced) or a single field (non-interlaced).
Single Field should be enabled when using a progressive scan
camera as the video source. It should be disabled otherwise.
• Scale X sets the horizontal subsampling factor. A Scale X
setting of 1 will sample all the pixels in the incoming video line. A
value of 2 will sample 1 pixel for every 2 pixels in the video line,
and so forth.
• Scale Y sets the vertical subsampling factor. A Scale Y setting of
1 will sample all the lines in the incoming video signal. A value of
2 will sample 1 line for every 2 lines in the video signal, and so
forth.
• X0 is used for cropping the image. This parameter is applied
after the image is scaled by the values defined by Scale X and
Scale Y. X0 defines the first column that is digitized in the
subsampled video line. A X0 setting of 0 will start digitizing the
subsampled video line at its first pixel. A value of 1 will start
digitizing at its second subsampled pixel, and so forth.
• DX is used for cropping the image. This parameter is applied
after the image is scaled by the values defined by Scale X and
Scale Y. DX defines the number of columns that is digitized in
HexSight Basics User Guide
255
Acquisition Device
the subsampled video line. A DX setting of 320 will digitize 320
pixels per video line, starting at column X0.
• Y0 is used for cropping the image. This parameter is applied
after the image is scaled by the values defined by Scale X and
Scale Y. Y0 defines the first line that is digitized in the
subsampled video signal. A Y0 setting of 0 will start digitizing
the subsampled video signal at its first active line. A value of 1
will start digitizing at its second subsampled line, and so forth.
• DY is used for cropping the image. This parameter is applied
after the image is scaled by the values defined by Scale X and
Scale Y. DY defines the number of lines that is digitized in the
subsampled video signal. A DY setting of 240 will digitize 240
lines per image, starting at line Y0.
• Gain sets the gain of the video digitizing circuit. The range of
this parameter is 0.5 - 8.0 The default gain is 1.
• Offset sets the offset of the video digitizing circuit. The range of
this parameter is -128 to 127. The default offset is -8, which
tends to compensate for the video pedestal.
Typical PX610A Configurations
Examples of PX610A configurations for typical video sources are
shown in Table 3.
TABLE 3
Examples of PX610A Configurations with Typical Video Sources
Parameter
RS-170
Interlaced
RS-170 NonInterlaced
CCIR
Interlaced
CCIR NonInterlaced
Horizontal
Resolution
RS-170
RS-170
CCIR
CCIR
Field Length
243
486
288
576
Blank Length
19
39
24
49
Single Field
Disabled
Enabled
Disabled
Enabled
HexSight Basics User Guide
256
Acquisition Device
Parameter
RS-170
Interlaced
RS-170 NonInterlaced
CCIR
Interlaced
CCIR NonInterlaced
Scale X
1
1
1
1
Scale Y
1
1
1
1
X0
0
0
0
0
DX
640
640
768
768
Y0
4
4
0
0
DY
480
480
576
576
Outputs Sub-Panel
The Outputs sub-panel (Figure 115) configures the strobes and
video synchronization output signals.
FIGURE 115 PX610A Outputs Sub-Panel
• The Strobe Lines mode configures how the strobe sequence is
initiated. Disabled specifies that no strobe sequence is output.
Normal makes it possible to fire a strobe sequence
programmatically using the GrabberPx610aFireStrobe method.
Triggered will fire a complete strobe sequence each time a
trigger is detected.
• Strobe 0 Polarity specifies the polarity of the active phase of
the strobe 0 output. Active High will output a high TTL level
during the active phase of strobe 0. Active Low will output a
low TTL level.
HexSight Basics User Guide
257
Acquisition Device
• Strobe 1 Polarity specifies the polarity of the active phase of
the strobe 1 output. Active High will output a high TTL level
during the active phase of strobe 1. Active Low will output a
low TTL level.
• Gap specifies the gap between active phases of strobe 0 and
strobe 1 in the strobe sequence. This parameter is expressed in
number of video lines.
• Strobe 0 Period defines the duration of the active phase of
strobe 0. This parameter is expressed in number of video lines.
• Strobe 1 Period defines the duration of the active phase of
strobe 1. This parameter is expressed in number of video lines.
• When Sync Lines Enabled is set, both horizontal and vertical
synchronization signals are driven on the synchronization lines
outputs. Otherwise, these outputs are kept in a high impedance
state.
• Horizontal specifies the polarity of the active phase of the
horizontal synchronization signal. Active High will output a high
TTL level during the active phase of strobe 1. Active Low will
output a low TTL level.
• Vertical specifies the polarity of the active phase of the vertical
synchronization signal. Active High will output a high TTL level
during the active phase of strobe 1. Active Low will output a
low TTL level.
Imagenation PXC200
The PXC200 is an interlaced scan monochrome and composite color
frame grabber. It provides inputs for up to 4 cameras. However,
since it possesses only one acquisition circuit, each of the 4
channels must be acquired sequentially. HexSight currently
processes only grey-scale images. Consequently, only monochrome
acquisition modes are supported with the PXC200.
HexSight Basics User Guide
258
Acquisition Device
FIGURE 116 PXC200 Setup
PXC200 Setup
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing an
Imagenation Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the PXC200 are available in the
Parameters frame (Figure 116). The parameters are grouped into
5 tab-selected sub-panels: Acquisition, Video, Luma/Chroma,
Inputs and Outputs.
Acquisition Sub-Panel
The Acquisition sub-panel (See Figure 116) configures the
acquisition request. It selects the camera from which the image is
acquired and how the camera is triggered.
• Camera Input sets the camera input from which the image is
acquired. The PXC200 supports four (4) camera inputs but has
only one video acquisition circuit. Therefore the different inputs
cannot be acquired simultaneously.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
HexSight Basics User Guide
259
Acquisition Device
does not freeze if, for example, a video source is not connected
to the frame grabber.
• Trigger use configures how the acquisition request is triggered.
None does not synchronize the acquisition request to a trigger
event. Any will trigger the acquisition if any of the conditions
configured for Trigger 0, 1, 2 or 3 is met. All will trigger the
acquisition if the conditions configured for Trigger 0, 1, 2 and 3
are all met. See Trigger State for more details.
• The Trigger State is independently configured for Triggers 0, 1,
2 and 3. It sets the conditions that these triggers must meet in
order to perform the acquisition request. Depending on the
setting of Trigger Use, all or any of the four trigger conditions
have to be met. See Trigger Use for more details. A trigger
configured as Set will have to be set to be considered valid in
the global trigger condition. A trigger configured as Not Set will
have to be “not set” to be considered valid in the global trigger
condition.
A trigger configured as Ignore is ignored in the
global trigger condition. The conditions defining the set state for
each of the four triggers are configured with the Inputs subpanel.
Video Sub-Panel
The Video sub-panel (Figure 117) configures the digitization circuit
for the incoming video signal on the selected video input.
HexSight Basics User Guide
260
Acquisition Device
FIGURE 117 PXC200 Video Sub-Panel
• Video Type specifies the format of the incoming video signal.
Detect will automatically detect the format of the incoming
video signal. In this mode, switching between camera inputs
may cause a delay because of the time required to detect the
format. Specific video formats can also be configured. They are
summarized in the following table:
TABLE 4
Summary of Specific Video Formats
Name
Signal Standard
NTSC
NTSC standard (640x480)
NTSCJ
NTSC with no pedestal voltage (640x480)
PAL
PAL B, D, G, H or I standards (768x576)
PALM
PAL M standard (768x576)
PALN
PAL N standard (768x576)
SECAM
SECAM standard (768x576)
• Contrast sets the monochrome gain of the video digitizing
circuit. The range of this parameter is 0.0 - 2.0 The default
contrast is 1, which leaves the incoming video signal unchanged
before it is digitized.
• Brightness sets the monochrome offset of the video digitizing
circuit. The range of this parameter is -0.5 to 0.5. The default
brightness is 0, which leaves the incoming video signal
unchanged before it is digitized.
HexSight Basics User Guide
261
Acquisition Device
• Video Level sets the voltage difference between the bottom of
video synchronization pulses and bright white. The default video
level is 1.3 volts.
Luma/Chroma Sub-Panel
The Luma/Chroma sub-panel (Figure 118) configures filters and
processing that can be applied to the incoming video signal before
it is digitized.
FIGURE 118 PXC200 Luma/Chroma Sub-Panel
• Low-Pass Filter activates a low-pass filter that reduces highfrequency information in the video signal. Disabled disables the
low-pass filter. Auto selects the optimal filter based on the
resolution. The low-pass filter can also be selected manually by
specifying Filter_1, Filter_2 or Filter_3. Filter_3 has the
highest level of filtering. Using a low-pass filter can affect edge
positioning accuracy and should usually be disabled.
• Core Function forces all pixels with values below a specified
level to be digitized as black. Disabled disables the coring
function. Core_8, Core_16 and Core_32 will digitize as black
pixels with grey-level values below 8, 16 and 32 respectively.
Using a coring function can affect edge positioning accuracy and
should usually be disabled.
• Peak Filter activates a filter that amplifies high-frequency
information in the video signal. Disabled disables the peak filter.
HexSight Basics User Guide
262
Acquisition Device
The filter is selected manually by specifying Filter_0, Filter_1,
Filter_2 or Filter_3. Filter_0 has the highest gain. Using a
peak filter can sharpen edges in a blurry image but will affect
edge positioning accuracy. It should usually be disabled.
• Gamma Correction activates a filter for gamma correction. For
NTSC and PAL, gamma values of 2.2 and 2.8 are respectively
used. Enabling gamma correction can affect edge positioning
accuracy and should usually be disabled.
• Luma Comb Filter activates a comb filter to reduce artifacts in
the monochrome signal caused by crosstalk from the color
signal. Enabling the luma comb filter can affect edge positioning
accuracy and should usually be disabled, especially when using a
monochrome camera.
• When enabled, S-Video specifies that the incoming video signal
is an S-Video signal with separate color and monochrome
channels.
• Notch Filter activates a filter to remove the color burst signal
from the video signal before it is digitized. This prevents color
artifacts from appearing in the monochrome signal. Enabling the
color burst notch filter can affect edge positioning accuracy and
should usually be disabled, especially when using a monochrome
camera.
• AGC (Gain Control) activates automatic gain control for color
saturation to compensate for non-standard color signals. Since
HexSight only uses the monochrome signal from a color video
input, this parameter has no effect on the digitized image.
• When BW Detect is enabled, the color signal is set to zero when
the board detects a missing or a weak color burst signal. Since
HexSight only uses the monochrome signal from a color video
input, this parameter has no effect on the digitized image.
HexSight Basics User Guide
263
Acquisition Device
• Chroma Comb Filter activates a comb filter to reduce color
artifacts. Since HexSight only uses the monochrome signal from
a color video input, this parameter has no effect on the digitized
image.
Inputs Sub-Panel
The Inputs sub-panel (Figure 119) configures the trigger inputs (I/
O lines 0-3).
FIGURE 119 PXC200 Inputs Sub-Panel
• A specific Event parameter is defined for each of the four trigger
inputs. It specifies the event which causes the trigger to be set.
Level will set the trigger condition if a high TTL level is detected
on the input. Low to High will set the trigger condition if a lowto-high transition is detected on the input. High to Low will set
the trigger condition when a high-to-low transition is
encountered.
• A specific Debounce Long parameter is defined for each of the
four trigger inputs. When enabled, a delay of at least two vertical
blanks is required before another low to high or high to low
transition can be detected on the input. When Debounce Long
is disabled, the minimum delay is one vertical blank. Debounce
Long has no effect when the trigger Event for this input is
Level.
HexSight Basics User Guide
264
Acquisition Device
• A specific Debounce Both parameter is defined for each of the
four trigger inputs. When enabled, the delay is applied to both
the latched low-to-high or high-to-low transition and the
returning transition on the input. When Debounce Both is
disabled, only the latched low-to-high or high-to-low transition is
debounced, not the returning transition.
Outputs Sub-Panel
The Outputs sub-panel (Figure 120) configures the strobe output
signals (I/O lines 4-7).
FIGURE 120 PXC200 Outputs Sub-Panel
• A specific Strobe parameter is defined for each of the four
strobe outputs. Strobes sets the type of strobe that is
generated on each output line. Strobes configures how the
strobe signal is initiated. Disabled specifies that no strobe is
output. Sync Field 0 will generate a strobe pulse each time the
line specified by Start Line is encountered in the video field 0.
Sync Field 1 will generate a strobe pulse each time the line
specified by Start Line is encountered in the video field 1. Sync
Either will generate a strobe pulse each time the line specified
by Start Line is encountered in the video fields 0 and 1. Trigger
will generate a strobe pulse each time a trigger condition is
detected on the input line selected by the combo box Trigger.
HexSight Basics User Guide
265
Acquisition Device
• A specific Start Line parameter is defined for each of the four
strobe outputs. Start Line sets the line in the video field at
which to generate the strobe pulse. The valid range is 1 to 512.
• A specific Period parameter is defined for each of the four strobe
outputs. Period, expressed in milliseconds, sets the width of the
strobe pulse. The valid range is 64 microseconds to 4.2 seconds.
• A single Trigger parameter is defined for the four strobe
outputs. Trigger selects which of the four input lines (Line 0,
Line 1, Line 2 or Line 3) is the trigger source for output strobes
configured in the Trigger mode.
• A specific HEn (Holdoff Enable) parameter is defined for each of
the four strobe outputs. When HEn is checked, the holdoff
period configured with HStart and HWidth applies the
associated strobe output.
• A specific HStart (Holdoff Start) parameter is defined for video
fields 0 and 1. It sets the video line at which starts an holdoff
period where no strobe can be fired. Strobes occurring during
this period are delayed until the end of the holdoff period. The
strobe holdoff period is ignored when using Sync Field 0, Sync
Field 1 and Sync Either strobe modes.
• A specific HWidth (Holdoff Width) parameter is defined for video
fields 0 and 1. It sets the length, in number of video lines, of the
strobe holdoff period. Strobes occurring during this period are
delayed until the end of the holdoff period. The strobe holdoff
period is ignored when using Sync Field 0, Sync Field 1 and
Sync Either strobe modes.
• Gap, expressed in milliseconds, sets the time between the two
strobe pulses on line 7 when double pulse strobe output is
enabled. Double pulse strobe output on line 7 is enabled when
HexSight Basics User Guide
266
Acquisition Device
Gap is set to a value greater than or equal to 0. When set to a
negative value, double pulse strobe output on line 7 is disabled.
Matrox Meteor-II/Standard
The Meteor-II/Standard is a standard (interlaced scan)
monochrome and composite color frame grabber. It provides inputs
for up to 7 cameras. However, since it possesses only one
acquisition circuit, each of the 7 channels must be acquired
sequentially. HexSight currently processes only grey-scale images.
Consequently, only monochrome acquisition modes are supported
with the Meteor-II/Standard.
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing a Matrox
Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the Meteor-II/Standard are
available in the Parameters frame (Figure 121).
FIGURE 121 Meteor-II/Standard Setup
• The Meteor-II/Standard is configured through Configuration
Files built with the Matrox Intellicam application provided with
MIL or MIL-Lite software. The Acquisition Device directly
supports the dcf file format. By default, the configuration file
parameter is M_RS170. The M_RS170 parameter is not a
HexSight Basics User Guide
267
Acquisition Device
configuration file but rather a keyword that instructs the MeteorII/Standard to use its standard M_RS170 configuration. Other
standard Meteor-II/Standard configurations are available and
listed in Table 5.
TABLE 5
Standard Configurations for the Meteor-II/Standard
Keyword
Standard Configuration
M_DEFAULT
NTSC, 640x480, 3x8 bits, 12.5MHz, composite (Color)
M_RS170
RS-170, 640x480, 8 bits, 12.5MHz, analog
(Monochrome)
M_CCIR
CCIR, 768x576, 8bits, 14.8MHz, analog (Monochrome)
M_NTSC
NTSC, 640x480, 3x8 bits, 12.5MHz, composite (Color)
M_NTSC_YC
RS-170 Y/C (SVHS), 640x480, 3x8 bits, 12.5MHz (Color)
M_PAL
PAL I, 768x576, 3x8 bits, 14.8MHz, composite (Color)
M_PAL_YC
PAL Y/C, 768x576, 3x8 bits, 14.8MHz (Color)
• Entering any of the previous keywords in the Configuration File
text box instead of a valid dcf file name, activates the
corresponding standard Meteor-II/Standard configuration. In
this version of HexSight only monochrome standard
configurations for the Meteor-II/Standard are supported
(M_RS170 and M_CCIR). Standard configuration keywords are
case insensitive.
• When you enter a file name manually in the Configuration File
text box or select a file using the Load button, the new
configuration is not loaded immediately. The frame grabber
configuration file is loaded and applied at the first execution of
the Acquisition Device. The first acquisition can thus take a few
seconds to complete. Two Acquisition Device Configurations
cannot therefore be used in a pipeline if they use different dcf
files because the Meteor-II/Standard will pause for a few
seconds between each acquisition request.
HexSight Basics User Guide
268
Acquisition Device
• When using more than one Matrox frame grabber in the same
application, each board is configured through its own dcf file.
The frame grabbers can thus have different dcf files and still be
used in an acquisition pipeline, as long as all requests for each
board use the same dcf file.
• Channel sets the input channel from which the image is
acquired. The Meteor-II/Standard supports 7 input channels with
board revision 2.0 or higher and four (4) input channels
otherwise. It has only one video acquisition circuit. The channels
cannot therefore be acquired simultaneously.
• External Trigger is used to specify that before acquiring the
image, the Meteor-II/Standard should wait for the trigger event
configured in the dcf file. Default uses the external trigger
settings defined in the dcf file, Enable enables trigger detection
and Disable disables trigger detection.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame.
Matrox Meteor-II/Multi-Channel
The Meteor-II/Multi-Channel is an RGB progressive/interlaced scan
frame grabber that provides inputs for 2 RGB cameras. Since it
possesses only one acquisition circuit, each of the 2 RGB channels
must be acquired sequentially. HexSight is currently limited to
processing only grey-scale images. HexSight processes the images
acquired from the Meteor-II/Multi-Channel as three independent
grey-scale images. This frame grabber can also be used for
simultaneous synchronized multi-channel acquisitions for up to
three gen-locked monochrome cameras. The Meteor-II/Multi-
HexSight Basics User Guide
269
Acquisition Device
Channel supports features such as asynchronous resets, strobe
lighting, and gen-locking.
Meteor-II/Multi-Channel Setup
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing a Matrox
Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the Meteor-II/Multi-Channel are
available in the Parameters frame (Figure 122).
FIGURE 122 Meteor-II/Multi-Channel Setup
• The Meteor-II/Multi-Channel is configured through
Configuration Files built with the Matrox Intellicam application
provided with the MIL-Lite software. The Acquisition Device
directly supports the dcf file format. By default, the configuration
file parameter is M_RS170. The M_RS170 parameter is not a
configuration file but rather a keyword that instructs the MeteorII/Multi-Channel to use its standard M_RS170 configuration.
Other standard Meteor-II/Multi-Channel configurations are
available and listed Table 6.
TABLE 6
Standard Configurations for the Meteor-II/Multi-Channel
HexSight Basics User Guide
270
Acquisition Device
Keyword
Standard Configuration
M_DEFAULT
RS-170 RGB, 640x480, 3x8 bits, 12.5MHz (Color)
M_RS170
RS-170 using RGB module (Monochrome)
M_RS170_VIA_RGB
RS-170 using RGB module (Monochrome)
M_CCIR
CCIR using RGB module (Monochrome)
M_CCIR_VIA_RGB
CCIR using RGB module (Monochrome)
M_NTSC
RS-170 RGB, 640x480, 3x8 bits, 12.5MHz (Color)
M_NTSC_RGB
RS-170 RGB, 640x480, 3x8 bits, 12.5MHz (Color)
M_PAL
PAL I RGB, 768x576, 3x8 bits, 14.8MHz (Color)
M_PAL_RGB
PAL I RGB, 768x576, 3x8 bits, 14.8MHz (Color)
• Entering any of the previous keywords in the Configuration File
text box instead of a valid dcf file name, activates the
corresponding standard Meteor-II/Standard configuration. In
this version of HexSight only monochrome standard
configurations for the Meteor-II/Multi-Channel are supported
(M_RS170, M_RS170_VIA_RGB, M_CCIR and
M_CCIR_VIA_RGB). Standard configuration keywords are case
insensitive.
• When you enter a file name manually in the Configuration File
text box or select a file using the Load button, the new
configuration is not loaded immediately. The frame grabber
configuration file is loaded and applied at the first execution of
the Acquisition Device. The first acquisition can thus take a few
seconds to complete. Two Acquisition Device Configurations
cannot therefore be used in a pipeline if they use different dcf
files because the Meteor-II/Multi-Channel will pause for a few
seconds between each acquisition request.
• When using more than one Matrox frame grabber in the same
application, each board is configured through its own dcf file.
The frame grabbers can thus have different dcf files and still be
HexSight Basics User Guide
271
Acquisition Device
used in an acquisition pipeline, as long as all requests for each
board use the same dcf file.
• Channel sets the RGB channel from which the image is
acquired. The Meteor-II/Multi-Channel supports 2 RGB channels,
but has only one RGB acquisition circuit. The two channels
cannot therefore be acquired simultaneously.
• Input Source defines which of the inputs is acquired from the
selected RGB channel. Individual R, G and B inputs can be
acquired by selecting respectively 1 (R), 2 (G) or 3 (B). This
mode is useful for acquiring an image provided by a
monochrome camera plugged to one of the RGB inputs. The
three RGB inputs can also be acquired simultaneously by
selecting RGB. This is useful for simultaneous synchronized
acquisitions of gen-locked monochrome cameras (up to 3).
None can also be specified as the input source. In this case, no
actual acquisition will take place. See the Using the Meteor-II/
Multi-Channel in a Multi-Camera Application section for more
details.
• Output Source specifies which of the acquired RGB inputs
provides the grey-scale image that will is created in the runtime
database when the Acquisition Device is executed with the
selected Configuration. Only one of the R, G or B image can be
output at a time.
• When Input Source is set to an individual R, G or B input, the
corresponding image is automatically set in Output Source,
which means that when the Acquisition Device is executed, the
image from a single input is acquired and then output to the
runtime database.
• Sync Source sets the input that is used to synchronize the
frame grabber digitization circuit with the incoming image. Any
of the RGB inputs can be used as the synchronization source. An
HexSight Basics User Guide
272
Acquisition Device
additional SYNC input can also be used. Usually Sync Source
should be the same as Input Source. However, when external
gen-locking is used to synchronize cameras, Sync Source
should always be set to the same input to avoid
desynchronization when changing the Input Source.
• External Trigger is used to specify that before acquiring the
image, the Meteor-II/Multi-Channel should wait for the trigger
event configured in the dcf file. Default uses the external trigger
settings defined in the dcf file, Enable enables trigger detection
and Disable disables trigger detection.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame grabber.
Using the Meteor-II/Multi-Channel in a Multi-Camera
Application
When using the Meteor-II/Multi-Channel in a multi-camera
application where the acquisition must be simultaneous, it is
preferable to create a Configuration in the Acquisition Device for
each of the R, G and B input to grab. This method is recommended
instead of programmatically changing Output Source with a single
Acquisition Device Configuration because a specific calibration can
be set up for each input.
Creating a Three-Channel Application for the Meteor Multi-Channel
To create a three-channel application, define three Acquisition
Device Configurations:
• Set the first one, named “Input1”, with Input Source to RGB
and Output Source to 1 (R).
HexSight Basics User Guide
273
Acquisition Device
• Define a second Configuration,“Input2”, with Input Source set
to None and Output Source set to 2 (G).
• In a third similar Configuration named “Input3”, Output Source
should be set to 3 (B).
• When the Acquisition Device is executed with the first
Configuration, the three RGB inputs are grabbed and kept in
memory and the image from the R input is output to the runtime
database.
• When the Acquisition Device is executed with the second
Configuration, no image is grabbed and the image from the G
input is output to the runtime database.
• Similarly, when the Acquisition Device is executed with the third
Configuration, no image is grabbed and the image from the B
input is output to the runtime database.
The following example shows how to use these three Configurations
programmatically in an acquisition pipeline.
Dim Acquisition as HSAcquisitionDevice
Set Acquisition = _
ApplicationControl.ProcessManager.Process(“Acquisition”)
‘Place a first request in the pipeline”
Acquisition.Start “Input1”
Acquisition.Start “Input2”
Acquisition.Start “Input3”
Do
‘Place a new request in the pipeline
Acquisition.Start “Input1”
Acquisition.Start “Input2”
Acquisition.Start “Input3”
‘Wait for Input1 image
HexSight Basics User Guide
274
Acquisition Device
Acquisition.Wait
‘Process Input1 image
...
‘Wait for Input2 image
Acquisition.Wait
‘Process Input2 image
...
‘Wait for Input3 image
Acquisition.Wait
‘Process Input3 image
...
Loop While Not ExitLoop
‘Flush the acquisition pipeline
Acquisition.Wait
Acquisition.Wait
Acquisition.Wait
Matrox Meteor-II/Digital
The Meteor-II/Digital is a digital frame grabber. It provides inputs
for either a single RGB digital camera or up to four 8 bits
monochrome digital cameras. When connecting multiple 8 bits
cameras to the Meteor-II/Digital, the grabber must be configured
to generate the timing signals in order to ensure synchronization
between data channels.
Meteor-II/Digital Setup
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing a Matrox
Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the Meteor-II/Digital are available
in the Parameters frame (Figure 123).
HexSight Basics User Guide
275
Acquisition Device
FIGURE 123 Meteor-II/Digital Setup
• The Meteor-II/Digital is configured through Configuration Files
built with the Matrox Intellicam application provided with MIL or
MIL-Lite software. The Acquisition Device directly supports the
dcf file format. No default configuration is defined. You must
provide a valid dcf file, or else an error is fired and no internal
actions are taken.
• When you enter a file name manually in the Configuration File
text box or select a file using the Load button, the new
configuration is not loaded immediately. The frame grabber
configuration file is loaded and applied at the first execution of
the Acquisition Device. The first acquisition can thus take a few
seconds to complete. Two Acquisition Device Configurations
cannot therefore be used in a pipeline if they use different dcf
files because the Meteor-II/Digital will pause for a few seconds
between each acquisition request.
• When using more than one Matrox frame grabber in the same
application, each board is configured through its own dcf file.
The frame grabbers can thus have different dcf files and still be
used in an acquisition pipeline, as long as all requests for each
board use the same dcf file.
HexSight Basics User Guide
276
Acquisition Device
• Input Source defines which of the inputs is acquired from the
digital data input. Individual inputs can be acquired by selecting
respectively 0 (R), 1 (G), 2 (B) or 3. This mode is useful for
acquiring an image provided by a monochrome camera plugged
to one of the data inputs. The three RGB inputs can also be
acquired simultaneously by selecting RGB. This is useful for
simultaneous synchronized acquisitions with monochrome
cameras (up to 3). None can also be specified as the input
source. In this case, no actual acquisition will take place. See the
Using the Meteor-II/Digital in a Multi-Camera Application
section for more details.
• In the RGB mode, Output Source specifies which of the
acquired RGB inputs should provide the grey-scale image that is
created in the runtime database when the Acquisition Device is
executed with the selected Configuration. Only one of the R, G or
B images can be output at a time.
• When Input Source is set to an individual input, respectively 0
(R), 1 (G), 2 (B) or 3, the corresponding image is
automatically set in Output Source, which means that when the
Acquisition Device is executed, the image from a single input is
acquired and then output to the runtime database.
• External Trigger is used to specify that before acquiring the
image, the Meteor-II/Digital should wait for the trigger event
configured in the dcf file. Default uses the external trigger
settings defined in the dcf file, Enable enables trigger detection
and Disable disables trigger detection. Note that the Meteor-II/
Digital does not provide a configurable timeout. It is hard-coded
to 20 seconds. If no trigger event is received or no camera is
plugged to the Meteor-II/Digital, the application will freeze for
approximately 40 seconds between each acquisition request.
HexSight Basics User Guide
277
Acquisition Device
Using the Meteor-II/Digital in a Multi-Camera Application
When using the Meteor-II/Digital in a multi-camera application
where the acquisition must be simultaneous, it is preferable to
create a Configuration in the Acquisition Device for each of the R, G
and B inputs to grab. This method is recommended instead of
programmatically changing Output Source with a single
Acquisition Device Configuration because a specific calibration can
be set up for each input.
Creating a Meteor-II/Digital three-channel application
To create a three-channel application, define three Acquisition
Device Configurations:
• Set the first one, named “Input1”, with Input Source to RGB
and Output Source to 0 (R).
• Define a second Configuration,“Input2”, with Input Source set
to None and Output Source set to 1 (G).
• In a third similar Configuration named “Input3”, Output Source
should be set to 2 (B).
• When the Acquisition Device is executed with the first
Configuration, the three RGB inputs are grabbed and kept in
memory and the image from the R input is output to the runtime
database.
• When the Acquisition Device is executed with the second
Configuration, no image is grabbed and the image from the G
input is output to the runtime database.
• Similarly, when the Acquisition Device is executed with the third
Configuration, no image is grabbed and the image from the B
input is output to the runtime database.
The following example shows how to use these three Configurations
programmatically in an acquisition pipeline.
HexSight Basics User Guide
278
Acquisition Device
Dim Acquisition as HSAcquisitionDevice
Set Acquisition = _
ApplicationControl.ProcessManager.Process(“Acquisition”)
‘Place a first request in the pipeline”
Acquisition.Start “Input1”
Acquisition.Start “Input2”
Acquisition.Start “Input3”
Do
‘Place a new request in the pipeline
Acquisition.Start “Input1”
Acquisition.Start “Input2”
Acquisition.Start “Input3”
‘Wait for Input1 image
Acquisition.Wait
‘Process Input1 image
...
‘Wait for Input2 image
Acquisition.Wait
‘Process Input2 image
...
‘Wait for Input3 image
Acquisition.Wait
‘Process Input3 image
...
Loop While Not ExitLoop
‘Flush the acquisition pipeline
Acquisition.Wait
Acquisition.Wait
Acquisition.Wait
HexSight Basics User Guide
279
Acquisition Device
Matrox Orion
The Orion is a standard (interlaced scan) monochrome and
composite color frame grabber. It provides inputs for up to 8
cameras. However, since it possesses only one acquisition circuit,
each of the 8 channels must be acquired sequentially. HexSight
currently processes only grey-scale images. Consequently, only
monochrome acquisition modes are supported with the Orion.
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing a Matrox
Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the Orion are available in the
Parameters frame (Figure 124).
FIGURE 124 Orion Setup
• The Orion is configured through Configuration Files built with
the Matrox Intellicam application provided with MIL or MIL-Lite
software. The Acquisition Device directly supports the dcf file
format. By default, the configuration file parameter is
M_RS170. The M_RS170 parameter is not a configuration file
but rather a keyword that instructs the Orion to use its standard
M_RS170 configuration. Other standard Orion configurations are
available and listed Table 7.
HexSight Basics User Guide
280
Acquisition Device
TABLE 7
Standard Configurations for the Orion
Keyword
Standard Configuration
M_DEFAULT
NTSC, 640x480, 3x8 bits, 12.5MHz, composite (Color)
M_RS170
RS-170, 640x480, 8 bits, 12.5MHz, analog
(Monochrome)
M_CCIR
CCIR, 768x576, 8bits, 14.8MHz, analog (Monochrome)
M_NTSC
NTSC, 640x480, 3x8 bits, 12.5MHz, composite (Color)
M_NTSC_YC
RS-170 Y/C (SVHS), 640x480, 3x8 bits, 12.5MHz
(Color)
M_PAL
PAL I, 768x576, 3x8 bits, 14.8MHz, composite (Color)
M_PAL_YC
PAL Y/C, 768x576, 3x8 bits, 14.8MHz (Color)
• Entering any of the previous keywords in the Configuration File
text box instead of a valid dcf file name, activates the
corresponding standard Orion configuration. In this version of
HexSight only monochrome standard configurations for the
Orion are supported (M_RS170 and M_CCIR). Standard
configuration keywords are case insensitive.
• When you enter a file name manually in the Configuration File
text box or select a file using the Load button, the new
configuration is not loaded immediately. The frame grabber
configuration file is loaded and applied at the first execution of
the Acquisition Device. The first acquisition can thus take a few
seconds to complete. Two Acquisition Device Configurations
cannot therefore be used in a pipeline if they use different dcf
files because the Orion will pause for a few seconds between
each acquisition request.
• When using more than one Matrox frame grabber in the same
application, each board is configured through its own dcf file.
The frame grabbers can thus have different dcf files and still be
used in an acquisition pipeline, as long as all requests for each
board use the same dcf file.
HexSight Basics User Guide
281
Acquisition Device
• Channel sets the input channel from which the image is
acquired. The Orion supports 8 input channels. Since it has only
one video acquisition circuit, the channels cannot be acquired
simultaneously.
• External Trigger is used to specify that before acquiring the
image, the Orion should wait for the trigger event configured in
the dcf file. Default uses the external trigger settings defined in
the dcf file, Enable enables trigger detection and Disable
disables trigger detection.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame.
MRT micro VPP
The MRT micro VPP is a PCMCIA PC Card progressive/interlaced
scan frame grabber. Due to the bandwidth limitations of the
PCMCIA interface, this grabber is suitable only for demonstration
applications on laptop computers.
Refer to the documentation provided with your frame grabber for
hardware and software installation and see Installing an MRT
Frame Grabber in the Installing HexSight chapter.
The configurable parameters for the MRT micro VPP are available in
the Parameters frame (Figure 125).
HexSight Basics User Guide
282
Acquisition Device
FIGURE 125 MRT micro VPP Setup
• The MRT micro VPP is configured through Configuration Files
built created with standard text editor such as Notepad. The
Acquisition Device directly supports the ini file format. Refer to
the documentation provided with your frame grabber for more
information on MRT micro VPP configuration files.
• HexSight uses only the [Default] section of the ini file. If no
configuration file is specified, a default RS-170 / CCIR
configuration is used.
• When you enter a file name manually in the Configuration File
text box or select a file using the Load button, the new
configuration is not loaded immediately. The frame grabber
configuration file is loaded and applied at the first execution of
the Acquisition Device. This first acquisition can t take a few
seconds to complete. Therefore two Acquisition Device
Configurations cannot be used in a pipeline if they use different
ini files because the MRT micro VPP will pause for a few seconds
between each acquisition request.
• Channel sets the input channel from which the image is
acquired. The MRT micro VPP supports 2 input channels but has
only one video acquisition circuit. The channels cannot therefore
be acquired simultaneously.
HexSight Basics User Guide
283
Acquisition Device
Opteon DepictMaster 4x1
The Opteon DepictMaster 4x1 is an integrated imaging system that
combines frame grabber and video camera functionality. It consists
of a PCI controller board into which up to four Opteon camera units
can be plugged. HexSight only supports monochrome Opteon
cameras.
Controller Board Setup
Refer to the documentation provided with your controller board for
hardware and software installation. HexSight uses the standard
driver provided with the Opteon DepictMaster 4x1 so no special
installation procedure is required. See Installing an Opteon
Controller Board in the Installing HexSight chapter.
The configurable parameters for the Opteon DepictMaster 4x1 are
available in the Parameters frame (Figure 126).
FIGURE 126 Opteon DepictMaster 4x1 Setup
• Camera Port specifies from which camera port the grey-scale
image is acquired. For information on synchronized multichannel acquisitions, see the note in the Trigger Mode section.
• Exposure, expressed in microseconds, sets the exposure time
of primary acquisitions on the camera selected with Camera
Port.
HexSight Basics User Guide
284
Acquisition Device
• Camera Gain sets gain of the camera selected with Camera
Port. The range of values is 0 to 255. Refer to the Depict
Imaging System Programming Guide for more details.
• Camera Offset sets offset of the camera selected with Camera
Port. The range of values is 0 to 255. Refer to the Depict
Imaging System Programming Guide for more details.
• Trigger sets the trigger mode of the camera selected with
Camera Port. Immediate uses no trigger, the acquisition
request is processed immediately after all other pending
acquisition requests are completed. Timebase mode is similar
to Immediate except that the acquisition request will not be
processed until the minimum amount of time, set by Period, has
elapsed since the last acquisition request. External A will trigger
acquisition requests on events (defined by Edge) of the external
trigger input of the selected camera. Master will trigger
acquisition requests on events (defined by Edge) of the master
trigger input. Slave indicates that the acquisition request on the
selected camera will be triggered by the next non-slave
acquisition. See Synchronizing Multi-Camera Acquisitions for
more details.
• Period has two usages. In the Timebase trigger mode, it
specifies the minimum time period between two acquisition
requests. In External A and Master trigger modes, it specifies
the hold-off time between the trigger event and the start of the
acquisition.
• Edge sets the polarity of the event on the external trigger input
of the selected camera in the External A trigger mode. It sets
the polarity of the event on the master trigger input in the
Master trigger mode.
HexSight Basics User Guide
285
Acquisition Device
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a camera is not connected to the
controller board.
• Strobe sets the strobe logic for the camera selected with
Camera Port. Off disables the strobe of the selected camera.
PrimaryOnly sets the strobe of the selected camera so it is fired
at the start of each primary acquisition. The strobe signal stays
high for the duration of the exposure.
Synchronizing Multi-Camera Acquisitions
The Slave mode is useful for synchronizing multi-camera
acquisitions. Synchronized acquisitions are accomplished by placing
an acquisition request in the pipeline for the slave camera and
placing another acquisition request for the non-slave camera in the
pipeline. The two cameras will be acquired simultaneously. The first
Wait statement will retrieve the image acquired by the slave
camera and the second Wait statement will retrieve the image from
the non-slave camera.
For example to synchronize acquisitions on camera 1 to acquisitions
on camera 0, define two Acquisition Device Configurations:
• Set the first one, named “Camera1”, with Camera Port to 1 and
Trigger Mode to Slave.
• Define a second Configuration,“Camera0”, with Camera Port set
to 0 and Trigger Mode set to Immediate.
• When a Acquisition Device Start statement is issued with the first
Configuration, the acquisition request is left pending until a nonslave acquisition is requested. Note that if a Wait statement is
issued at this point, the request will time out and no image is
acquired.
HexSight Basics User Guide
286
Acquisition Device
• When a Acquisition Device Start statement is issued with the
second Configuration, acquisition of both cameras is triggered.
• The first Wait statement issued will output the grey-scale image
from camera 1 to the runtime database.
• The second Wait statement issued will output the grey-scale
image from camera 0 to the runtime database.
The following example shows how to use these two Configurations
programmatically in an acquisition pipeline.
Dim Acquisition as HSAcquisitionDevice
Set Acquisition = _
ApplicationControl.ProcessManager.Process(“Acquisition”)
‘Place a first request in the pipeline”
Acquisition.Start “Camera1”
Acquisition.Start “Camera0”
Do
‘Place a new request in the pipeline
Acquisition.Start “Camera1”
Acquisition.Start “Camera0”
‘Wait for Camera1 image
Acquisition.Wait
‘Process Camera1 image
...
‘Wait for Camera0 image
Acquisition.Wait
‘Process Camera0 image
...
Loop While Not ExitLoop
‘Flush the acquisition pipeline
Acquisition.Wait
HexSight Basics User Guide
287
Acquisition Device
Acquisition.Wait
DirectShow Device
The Generic DirectShow Device supports IEEE 1394 devices
(FireWire camera for example) that use DirectX. Windows XP or
Windows 2000 and DirectX 8.0 or later is required to use this type
of device. The user interface provides access to camera
parameters.
FIGURE 127 DirectShow Device Setup
• Input Source selects the device that is used for grabbing
images.
• Output Source specifies which of the acquired RGB inputs
should provide the grey-scale image that is created in the
runtime database when the Acquisition Device is executed with
the selected Configuration. Only one of the R, G or B images can
be output at a time.
• Timeout, expressed in milliseconds, sets the maximum
acceptable time between the initiation of the acquisition request
and its completion. This parameter ensures that the application
does not freeze if, for example, a video source is not connected
to the frame grabber.
HexSight Basics User Guide
288
Acquisition Device
• Use the combo box to select Stream Format or Video
Parameters; then use the browser button (...) to access to the
appropriate set of parameters.
Calibration Sub-Panel
Use this panel to select a calibration mode and access the selected
calibration method dialog. Note that to achieve subpixel accuracy, you
MUST calibrate your optical setup. This panel also allows you to save and
load calibration files.
FIGURE 128 Calibration Sub-Panel
Why is Calibration Necessary?
Calibration of the optical setup ensures accurate results, especially
for inspection and location applications that must be tolerant to
rotation. Due to the rectangular aspect ratio of image pixels,
possible misalignment of the camera with respect to the work
HexSight Basics User Guide
289
Acquisition Device
surface and lens distortion, deformation of parts that are rotated
and/or translated in the image can be substantial and exceed a few
pixels.
Using Calibration Files
Calibration files (*.cal) store the information from a calibration
setup. These files can be saved and loaded to share calibration
parameters between applications using the same optical setup.
• Use the Load Calibration button to load a HexSight calibration
file into the selected Acquisition Device Configuration.
• Use Save Calibration button to save calibration parameters to
be used with another application sharing the same optical setup.
Selecting a Calibration Method
Besides the four basic calibration methods: XY Scale,
Perspective, Distortion LUT and Distortion Model described in
detail further in this chapter the Calibration Panel also presents the
following three options:
• The Original Calibration mode is useful only when using File
Emulation as the input device for the selected Acquisition
Device Configuration. With this calibration mode the calibration
parameters stored with the emulation image are copied to the
Grey-Scale Image that is output to the runtime database.
• The mode named From Another Configuration allows you to
apply calibration parameters defined for another Acquisition
Device Configuration.
• Automatic Selection provides a display of calibration
parameters that have been defined programmatically. See the
Programmatic (Automatic) Calibration section.
HexSight Basics User Guide
290
Acquisition Device
XY Scale Calibration
XY Scale Calibration is a quick and handy calibration method but is
less precise than distortion type methods. You should use this
method when it is not possible to set up a target in the operating
environment.
• This method does not correct perspective or lens deformations.
To achieve proper precision, the camera must therefore be
aligned to ensure that its optical axis is perfectly perpendicular
with respect to the work surface.
• To use an object as a calibration target with this method, you
must provide one height and one width measure in calibrated
world units and use the calipers in the calibration dialog to
compute the corresponding height and width in the image.
Procedure for XY Scale Calibration
1.
In the Inputs sub-panel, select the input source that will provide
the target image. In the Calibration sub-panel and select the XY
Scale method.
2.
Click Show Calibration Dialog to open XY Scale Calibration
dialog. See Figure 129.
HexSight Basics User Guide
291
Acquisition Device
Manually entered
height and width
values
Test marker
positions in World
and Image
coordinates
FIGURE 129 XY Scale Calibration Dialog
3.
Select the World Coordinate System Type, either RightHanded or Left-Handed. This can be different from the selected
Image Coordinate System Type, set through the Input SubPanel.
4.
Click the Real-Time button to view and place the target in the
field of view. Make sure the image is well-contrasted and in focus.
5.
Select a detection mode: Caliper or Manual and follow the
corresponding setup:
HexSight Basics User Guide
292
Acquisition Device
Caliper Mode Setup
The Caliper mode provides measurement tools that are used to
determine the height and the width of the target object in the
image.
a) If necessary, drag the rectangles into position to measure
object features not centered in the image.
b) Adjust the caliper measurement tools (green rectangles) to
fit the object. The length of a caliper rectangle must exceed
the boundaries of the object by at least 10 pixels.
c) The thickness of the caliper rectangle adjusts the
projection length, that is the number of pixels that are
averaged to build the one-dimensional signal used to
detect edges.
d) The two outermost edges enclosed by the rectangle are
used to compute the measurement.
e) Click Detect to acquire a new image and carry out
automatic width and height measurements. Edges used to
compute the measurements appear as yellow lines.
Manual Mode Setup
When Image and World measures are already known by external
means you can use the Manual mode to set up the XY Scale
Calibration.
a) Enter the object’s width and the height in pixels in the
Image Width and Image Height text boxes. The position
provided for the points must be calculated with respect to
the selected World Coordinate System Type.
b) When you already know the average width and height of
the pixel when projected on the work. Enter 1 pixel for both
the Image Width and Height measures, select the
HexSight Basics User Guide
293
Acquisition Device
appropriate unit system and enter the actual width and
height in World units.
c) The manual mode can also be used to compensate only for
the pixel aspect ratio in applications where the actual
dimensions are not required. If the X/Y ratio is 1.1, enter 1
pixel for both the Image Width and Height measures.
Select calibration unit in the Units combo box, enter 1 as
the World Width and 0.909 as the World Height.
4.
Using the Units combo box, select the unit system into which you
want to calibrate the system.
5.
In the World Width and World Height text boxes, enter the
actual physical width and height corresponding to the caliper
measurements.
6.
Enter the number of images to use for the calibration in the
Average Measurements from text box. The calibration is carried
out on each image and the results are averaged to compute the
calibration parameters.
7.
Click Solve. The Results frame displays the average pixel width
and height computed from the calibration parameters.
8.
Use the World vs. Image controls to visually test the calibration.
a) To find World coordinates of a feature in the image: Drag
the TEST crosshair marker over the feature then click <- to
convert the Image position to a World position.
b) To find an Image position corresponding to a given World
position: Enter the World position in the X World and the Y
World text boxes then click the -> button. The TEST
crosshair moves to corresponding image location displayed
in the X Image and Y Image text boxes.
HexSight Basics User Guide
294
Acquisition Device
Perspective Calibration
Perspective calibration is a simple method that uses four points to
define the transform between Image and World coordinates. This
method is more precise than XY Scale and compensates for
perspective deformation but does not correct lens distortion. It is
therefore less precise than the available distortion calibration
methods.
• You should use this method when it is not possible to set up a
target in the operating environment.
• To use an object as a calibration target with this method, you
must provide the calibrated world coordinates of four (4) points
on the object and use the corner detection tools to detect the
position of these four points in the image. Optionally, you can
enter the image positions manually by dragging markers onto
the four points in the image.
Procedure for Perspective Calibration
1.
In the Inputs sub-panel, select the input source that will provide
the target image. In the Calibration sub-panel, select the
Perspective method.
2.
Click Show Calibration Dialog to open the Perspective
Calibration. See Figure 130.
3.
Select the World Coordinate System Type, either RightHanded or Left-Handed. This can be different from the selected
Image Coordinate System Type, set through the Input SubPanel.
4.
Click the Real-Time button to view and place the target in the
field of view. Make sure the image is well contrasted and in focus.
Deactivate the real time view by clicking the button again.
HexSight Basics User Guide
295
Acquisition Device
Manually entered
world coordinates
for corners P0 - P3
Test marker
positions in
World and Image
coordinates
FIGURE 130 Perspective Calibration Dialog
5.
Select the Detection Mode, either: Corner Detection or
Manual, and follow the corresponding setup:
Corner Detection Mode Setup
The Corner Detection mode provides corner detection tools that can
automatically locate corners on objects. These tools appear as four
(4) green rectangles in the display, as shown in Figure 130. Figure
131 illustrates the positioning of the corner detection rectangles.
a) Click Detect to acquire a new image and carry out
automatic detection of corners. The detected corners are
highlighted by light blue crosshairs. If no valid corner is
HexSight Basics User Guide
296
Acquisition Device
detected by a given corner detection tool, it will appear in
red instead of green.
b) If necessary, drag the corner detection tools to place their
approximate corner position area onto actual corners in the
image. You can also stretch the tool to match its linear
regression segments to actual straight edge segments in
the image. Click Detect again to acquire a new image and
detect the 4 corners of the target object.
c) The Lock on Corners check box locks the position of the
corners to the detected corners, which means that if you
click Detect, the detection tools will stick to the object if it
is moved.
Light blue crosshair
Area delimiting the approximate position
indicating the position
of the corner
of the detected corner
Straight edge
segments used for
the linear regression
used to interpolate
the corner
FIGURE 131 Corner Detection Mode
Manual Mode Setup
When the four points of known position on the object do not consist
of corners between straight segments you can manually place the
points in the image.
a) Drag the green crosshair markers onto points of known
position on the object.
HexSight Basics User Guide
297
Acquisition Device
b) Using the Image text boxes, you can refine the image
positions for the four points.
3.
Using the Units combo box, select the unit system into which you
want to calibrate the system.
4.
Enter the actual World coordinates of the four detected corners in
the World text boxes. The position provided for the points must be
calculated with respect to the selected World Coordinate System
Type.
5.
Enter the number of images to use for the calibration in the
Average Measurements from text box. The calibration is carried
out on each images and the results are averaged to compute the
calibration parameters.
6.
Click Solve. The Results frame will display the average pixel
width and height computed from the calibration parameters.
7.
Use the World vs Image controls to visually test the calibration:
a) To find World coordinates of a feature in the image: Drag
the yellow TEST crosshair marker over the feature then
click <- to convert the Image position to a World position.
b) To find an Image position corresponding to a given World
position: Enter the World position in the X World and the Y
World text boxes then click the -> button. The yellow
TEST crosshair moves to corresponding image location
displayed in the X Image and Y Image text boxes.
Distortion LUT
Distortion calibration methods are usually recommended over the
XY Scale or Perspective methods since they compensate for lens
distortion as well as perspective deformations.
• The Distortion LUT method requires a grid of dots target, from
which it builds a lookup table to convert between World and
Image positions.
HexSight Basics User Guide
298
Acquisition Device
• The position of a point is interpolated using the four closest dots.
This method is VERY sensitive to the accuracy of the calibration
target. It is recommended over the Distortion Model method only
for applications where lens distortion is very significant.
Distortion Model
As with Distortion LUT, the Distortion Model method compensates
for lens distortion as well as perspective deformations.
• This method requires a grid of dots target from which it builds a
non-linear model using a best-fit approach, taking into account
all of the target dots.
• Since it averages out errors, this method is less sensitive to the
accuracy of the target. It is usually more precise than the
Distortion LUT method with lens of 16 mm or greater focal
length.
• For typical applications, Distortion Model is therefore the
recommended calibration method.
Procedure for a Distortion Calibration
The following procedure for can be used for either a Distortion
Model or a Distortion LUT calibration.
1.
In the Inputs sub-panel, select the input source that will provide
the target image. In the Calibration sub-panel, select the
Distortion LUT or the Distortion Model method.
2.
Click Show Calibration Dialog to open the Distortion Calibration
dialog illustrated in Figure 132.
3.
The display in the dialog shows the following elements:
• Yellow crosshair markers indicate detected calibration dots.
These are the dots that are used for calibration calculations.
HexSight Basics User Guide
299
Acquisition Device
• Blue crosshair markers indicate detected validation dots.
These dots are not mandatory but are useful for error
calculations in the integrated validation procedure.
• Red crosshair markers indicate detected calibration dots that
were not used to calculate the calibration. This generally occurs
when using an invalid calibration target. Another cause may be
an incorrectly placed coordinate system marker.
• The X-Y axes marker indicates the origin of the coordinate
system. By default, this origin is centered on the calibration dot
closest to the bottom left corner for a right-handed coordinate
system and or on the dot closest to the top left corner for a lefthanded coordinate system.
4.
Select the World Coordinate System Type, either RightHanded or Left-Handed. This can be different from the selected
Image Coordinate System Type, set through the Input SubPanel.
5.
Click the Real-Time button to view and place the target in the
field of view. The dots should cover the entire image. Make sure
the image is well-contrasted and in focus. Deactivate the real time
view by clicking the button again.
HexSight Basics User Guide
300
Acquisition Device
FIGURE 132 Distortion Model Dialog
6.
All dots should be detected, except for those in rows and columns
that border the image. If target dots are not being properly
detected, you may need to adjust Detection parameters:
• Edge Sensitivity: Sets the sensitivity to contrasts for the dots
detection process. Increasing this parameter will help to detect
low contrast dots but may add unwanted noise that could cause
false detections. Decreasing this parameter may reduce noise,
but cause misses in the target. The default value should work
fine with well-contrasted calibration targets.
• Dot Conformity: When the dots are detected, an average form
factor is computed. The dot conformity parameter determines
HexSight Basics User Guide
301
Acquisition Device
how closely a given dot must match the average form factor to
be accepted as a valid dot. The default value should work in
most cases. However in cases where lens distortion is extreme
or the perspective deformation is substantial, this parameter
should be decreased to detect all the dots on the target.
• Minimum Dot Radius: Defines the minimum radius (in pixels)
required for a dot to be valid. Optimal dot radius is
approximately 10 pixels. Actual dot radius in the image should
be between 6 to 12 pixels.
• Maximum Dot Radius: Defines the maximum radius (in pixels)
required for a dot to be valid. Optimal dot radius is
approximately 10 pixels. Actual dot radius in the image should
be between 6 to 12 pixels.
7.
In the Detection frame, set the Dot Pitch, and the calibration
units used to express the dot pitch. Dot Pitch is the distance
between the centers of each calibration dot. The same dot pitch is
used for validation dots.
8.
To detect the target dots, click Detect. This will acquire a new
image and detect the dots using the configured detection
parameters.
If the detection parameters are not correctly adjusted there can be
misses in the lower left corner that will cause problems with the
placement of the World coordinate system axes such as shown in
Figure 133.
HexSight Basics User Guide
302
Acquisition Device
Dot pitch in the X-Axis is
Dot pitch in the Y-Axis
Validation dots are detected
incorrect
direction is incorrect
as calibration dots and the
coordinate system is rotated
45 degrees. Dot pitch in the X
and Y axes direction is
FIGURE 133 Dot Detection Problems
9.
incorrect
If necessary properly place the World coordinate system axes
marker. If the axes are wrongly placed because dots are missing,
modify the detection parameters and click Detect. Repeat until all
the dots are detected. Drag the origin of the World coordinate
system axes to a dot on the target. The actual World coordinates
for this dot are entered in the Axes Origin text boxes.
10.
Once the origin is set, drag the X and Y axes to the two orthogonal
dots next to the origin. This will set the orientation for the World
coordinate system.
11.
Click Detect again to detect the dots using the new coordinate
system. Dots crosshair markers should appear in yellow for
calibration dots and blue for validation dots.
12.
If some dots cannot be detected properly, display their contours by
selecting Dots in the Display frame and enabling the Contours
check box. Irregularities on the contour may show up, in which
case the Edge Sensitivity and Dot Conformity parameters can
be adjusted to accept the missing dot. For optimal results with the
Distortion LUT method, no dot should be missing, except on the
border of the image. The Distortion Model method is tolerant to a
few missing dots.
HexSight Basics User Guide
303
Acquisition Device
13.
Enter the number of images to use for the calibration in the
Average Dot Detection from text box. Dot detection and location
are carried out on the number of images specified in the text box and
results are averaged to compute the calibration parameters.
14.
Click Solve. Once the calibration is complete, the Results frame,
as illustrated in Figure 134, displays the error statistics.
FIGURE 134 Calibration Results after Solving the Calibration
15.
Use the World vs. Image controls to visually test the calibration.
16.
To find World coordinates of a position in the image: Drag the
TEST crosshair marker to a position in the image. Click <- to
convert the Image position to a World position.
17.
To find an Image position corresponding to a given World position:
Enter the World position in the X World and the Y World text
boxes then click the -> button. The TEST crosshair moves to
corresponding image location displayed in the X Image and Y
Image text boxes.
18.
Use Display options to view a graphical representation of either
Image or World errors.
HexSight Basics User Guide
304
Acquisition Device
Use display options to view
Image or World errors
Image errors
FIGURE 135 Viewing Image and/or Model Errors
Note: These error vectors are largely magnified to provide an
indication of the areas where the errors are more significant and
should not be used as an indication of the absolute error.
Dot Targets
The quality and precision of a grid of dots target have a direct
impact on the overall precision of the results of your application.
Dot targets are commercially available but you can also create your
own targets by following the guidelines provided below.
Description of Dot Target Elements
• A dot target is made up of a matrix of evenly spaced identical
calibration dots.
• A secondary matrix of validation dots can be added in offset to
calibration dots to validate the calibration process. Although they
are not absolutely required, these dots are useful for error
calculations.
HexSight Basics User Guide
305
Acquisition Device
• Dots in both matrices should be identical in size and have the
same pitch.
• Dot Pitch describes the distance between the centers of two
dots in the same matrix. Dot pitch must be the same in the X
and Y directions.
• The offset between the calibration dots matrix and the validation
dot matrix must be 1/2 dot pitch in the X and Y axes.
Calibration dots
(yellow markers)
dot
pitch
Validation dots
(blue markers)
1/2 dot
pitch
1/2 dot
pitch
dot
pitch
FIGURE 136 Dot Target Elements
Guidelines for Creating a Dot Target
• Dots should be circular; the recommended radius range is 6 to
12 pixels.
• Dot pitch must be the same in the X and Y axes.
• Dot pitch should be 4 times the dot radius.
• The target should cover the entire field of view.
• Dots should be well-contrasted.
• For best results, targets should be of high photo quality on a
stable medium, not printed.
HexSight Basics User Guide
306
Acquisition Device
• Validation dots are not required to measure calibration errors,
but are recommended for validating the LUT calibration.
• Validation dots should be offset by 1/2 the dot pitch in the X and
Y-axes.
Automatic Calibration
This calibration method provides a way of calibrating an application
entirely programmatically, without the use of the HexSight
calibration interface. This feature is especially useful for integrating
HexSight into another software that already has its own calibration
procedure.
• If you select Automatic Selection in the user interface you can
read but not set any of the calibration parameters.
• The number of calibration points that you provide determines the
actual calibration method that is applied: XY Scale, Perspective,
Distortion Model or Distortion LUT.
Procedure for an Automatic Calibration
You must programmatically select the Automatic Selection
calibration method and provide calibration data as pairs of
corresponding Image/World points. The Automatic Selection
method mode selects the type of calibration to apply according to
the number of calibration points that have been entered, as
described in Table 8.
TABLE 8
Use of Calibration Points by the Automatic Calibration Method
Number of pairs of points
Automatically selected calibration method
0 or 1
Invalid
2 or 3
Scale
4 to 8 included
Perspective
9 and more
Distortion Model
HexSight Basics User Guide
307
Acquisition Device
Setting up the Automatic Selection Calibration
1.
You must first programmatically select the calibration method
using the Acquisition Device control property CalibrationMethod
(SetCalibrationMethod in Visual C++).
2.
Next you must provide the calibration data through the indexed
CalibrationParameter property (SetCalibrationParameter in
Visual C++). The description of each index is provided in the
following table:
TABLE 9
Index of Automatic Calibration Parameter Properties
Index
Description
0
Number of pairs of calibration points used for the calibration
1
Reserved for future use
2
Reserved for future use
3
Reserved for future use
4
Reserved for future use
5
Reserved for future use
6
Width of the image in pixels
7
Height of the image in pixels
8
Read only: average width of an image pixel
9
Read only: average height of an image pixel
10
X coordinate of point 1 expressed with respect to the Image
coordinate system
11
Y coordinate of point 1 expressed with respect to the Image
coordinate system
12
X coordinate of point 1 expressed with respect to the World
coordinate system
13
Y coordinate of point 1 expressed with respect to the World
coordinate system
14
X coordinate of point 2 expressed with respect to the Image
coordinate system
15
Y coordinate of point 2 expressed with respect to the Image
coordinate system
16
X coordinate of point 2 expressed with respect to the World
coordinate system
HexSight Basics User Guide
308
Acquisition Device
Index
Description
17
Y coordinate of point 2 expressed with respect to the World
coordinate system
...
...
10+4(n-1)
X coordinate of point n expressed with respect to the Image
coordinate system
10+4(n-1)+1
Y coordinate of point n expressed with respect to the Image
coordinate system
10+4(n-1)+2
X coordinate of point n expressed with respect to the World
coordinate system
10+4(n-1)+3
Y coordinate of point n expressed with respect to the World
coordinate system
Performing the Calibration
3.
To perform the calibration, the Acquisition Device must be
executed once after the modification of the calibration parameters.
Subsequent executions of the Acquisition Device will not trigger a
calculation of the calibration unless the calibration parameters are
modified once more.
Validating the Calibration
4.
You can verify the calibration procedure through the
ValidateCalibration method of the Acquisition Device control.
ValidateCalibration returns True if the system was able to
calculate a calibration from the given points. Otherwise, the
method returns False.
Example of a Programmatic Calibration
Lets consider a case where four points are used for the calibration.
TABLE 10
Programmatic Calibration Example
Point
Image X
Image Y
World X
World Y
1
100.0
50.0
-1500.0
2300.0
2
500.0
50.0
1500.0
2300.0
HexSight Basics User Guide
309
Acquisition Device
Point
Image X
Image Y
World X
World Y
3
100.0
400.0
-1500.0
6100.0
4
500.0
400.0
1500.0
6100.0
The programming code for the automatic calibration would then be:
Dim lManager as HSProcessManager
Set lManager = HSApplication1.ProcessManager
Dim AcquDev as HSAcquisitionDevice
Set AcquDev = lManager.Process("Acquisition Device")
AcquDev.CalibrationMethod = hsAuto
’Number of pairs of calibration points
AcquDev.CalibrationParameter(0) = 4
’Calibration point 1
AcquDev.CalibrationParameter(10) = 100.0
AcquDev.CalibrationParameter(11) = 50.0
AcquDev.CalibrationParameter(12) = -1500.0
AcquDev.CalibrationParameter(13) = 2300.0
’Calibration point 2
AcquDev.CalibrationParameter(14) = 500.0
AcquDev.CalibrationParameter(15) = 50.0
AcquDev.CalibrationParameter(16) = 1500.0
AcquDev.CalibrationParameter(17) = 2300.0
’Calibration point 3
AcquDev.CalibrationParameter(18) = 100.0
AcquDev.CalibrationParameter(19) = 400.0
AcquDev.CalibrationParameter(20) = -1500.0
AcquDev.CalibrationParameter(21) = 6100.0
’Calibration Point 4
AcquDev.CalibrationParameter(22) = 500.0
HexSight Basics User Guide
310
Acquisition Device
AcquDev.CalibrationParameter(23) = 400.0
AcquDev.CalibrationParameter(24) = 1500.0
AcquDev.CalibrationParameter(25) = 6100.0
’Execute the process in order to perform the calibration
AcquDev.Execute
’Validation of the Calibration
Dim CalibrationOk as Boolean
CalibrationOk = AcquDev.ValidateCalibration
Note: The previous example is provided only to show the different
steps of an automatic calibration. In a real application, calibration
data would be acquired dynamically.
Output Sub-Panel
Use this panel to define the output for the selected Acquisition Device
Configuration.
View
View sets the name of the view to which the Grey-Scale Image
acquired by the Acquisition Device is stored in the runtime
database. The default value for the name of the output View is
Acquisition.
• Modifying this parameter can be useful in a multi-channel
acquisition application to prevent images from different channels
from overlapping each other in the runtime database.
• To store the Grey-Scale Image from each channel in its own
View in the runtime database, assign a different value to View
(such as Acquisition0, Acquisition1, etc.) for each Configuration
used by the Acquisition Device to acquire the images.
HexSight Basics User Guide
311
Acquisition Device
Grey-Scale Image
Grey-Scale Image sets the name of the grey-scale Image created
in the runtime database by the Acquisition Device. This Image is
stored in the View set by View. The default value for the name of
the output grey-scale image is Grey-Scale Image.
• Modifying this parameter can be useful in a multi-channel
acquisition application to prevent Images from different channels
from overlapping each other in the runtime database.
• To store the grey-scale image from each channel with a specific
name in the runtime database, assign a different value to GreyScale Image (such as Grey-Scale Image 0, Grey-Scale Image
1, etc.) for each Configuration used by the Acquisition Device to
acquire the images.
Results Panel
This panel shows the following read only results.
• Elapsed time: time required by the last execution of the
Acquisition Device.
• Configuration Name: name of the Configuration used for the
last execution of the Acquisition Device.
• Time Stamp: indicates the time at which the image was
acquired
• Error Code: error code encountered for the last execution of the
Acquisition device.
• Error Description: description of the last error encountered.
HexSight Basics User Guide
312
Locator
Locator
The Locator finds and locates objects based on the geometry of their
contours. Scale factor, orientation, and position are provided for each
located instance. Models are built using the integrated Model Editor.
Locator Chapter Outline
Understanding Locator Concepts
Definitions
Input and Output
Models
Model Creation and Edition
Model Optimization
Search Process
Learn Process
Improving Search Performance
Locator Results
Troubleshooting
Using the Locator
General Panel
Contour Panel
Model Panel
Using the Model Editor
Using the Model Optimizer
Search Panel
Results Panel
HexSight Basics User Guide
313
Locator
Understanding Locator Concepts
The Locator finds and locates instances of model-defined objects. Models,
which characterize object types, are created and edited through the
Locator’s Model Editor.
The Locator’s search process operates on two levels of coarseness. It
identifies object features at the coarsest level, namely the outline level,
while focusing the search and refining the position of the object at the
detail level.
This section explains the main concepts pertaining to the Locator process.
The order of the information is based on the Locator interface to make it
easier for the reader to run over Locator concepts.
Definitions
Model
A Model is a representation of an object, based on the geometry of
its contours. An object Model is the reference used to identify and
locate instances of objects of the same type.
Model View
The Model View is an output of the Locator to the runtime
database. It contains the grey-scale image used to build the Model
and the vectorized description of the Model, called the Model
Scene.
Contour Scene
A Contour Scene contains a vectorized description of contours
generated from an input grey-scale image.
HexSight Basics User Guide
314
Locator
Instance Scene
The Instance Scene contains the contour representation of actual
object instances that have been located within the current greyscale Image.
Input and Output
The Locator owes its robustness to the use of vectorized descriptions. It
searches for object instances on the geometric features calculated from the
initial grey-scale input image.
Input
The Locator input is a grey-scale image typically provided by
another HexSight process. To ensure the positional accuracy of the
Locator process, the input grey-scale Image should be calibrated
beforehand, through the Acquisition Device.
Output
The Locator outputs to the application’s runtime database are used
by subsequent model based tools in an application. Outputs consist
mostly of Scenes, which in HexSight, are vectorized
representations of the geometry in an Image. The Locator can also
output a Model View that contains both the grey-scale image upon
which the model was created as well as the Model Scene.
Since outputs to the runtime database increase the execution time, only
outputs required for subsequent processes should be enabled. Moreover, if
a display of Locator results is required, it is best to use the Results
Viewer.
Models
A Model is a representation of an object, based on the description of the
geometry of its contours. The basic considerations for creating Models that
HexSight Basics User Guide
315
Locator
will permit an accurate and efficient recognition of object instances can be
resumed as follows:
• The part used to build the Model should be as "perfect" as
possible, meaning it should define what the average shape of
that part is. This improves the robustness to normal variations in
a part’s shape.
• The image used to build the Model, as well as the runtime
images used to locate the part, should always be calibrated. This
improves recognition robustness and location accuracy,
especially when the parts to be located can be rotated or
significantly translated. Figure 137 illustrates the case of an
image in which the pixel ratio is not exactly 1:1, as is typically
the case. In the given example, if the image is not calibrated,
when a part is rotated to 90 degrees, it will be impossible to
locate the part to better than 1 pixel in accuracy.
HexSight Basics User Guide
316
Locator
UNCALIBRATED
Pixel aspect ratio: y/x =1.01
100 pixels
50
pixels
99
pixels
same part,
rotated 90°
50.5
pixels
CALIBRATED
Pixel size: x=2.00 mm. y =2.02 mm.
200 mm.
101
mm.
200
mm.
same part,
rotated 90°
101
mm.
FIGURE 137 Calibration Required for Accuracy in Results
• The Locator will be more robust if the Model is built using a clean
image, in which the geometry of the object is clearly visible. This
is especially important when the runtime images are very
cluttered and difficult.
• The features that constitute the Model should be stable in shape
and relative positioning with respect to each other in the runtime
images. Whenever possible, avoid using features created by
shadows or specular reflections.
IMPORTANT:
M ODELS
MUST
BE
CREATED
FROM
IMAGES
CALIBRATED IN THE SAME TYPE OF COORDINATE SYSETM AS THAT IN
WHICH THE INPUT IMAGE IS CALIBRATED. FOR EXAMPLE, IF THE
M ODEL IS CREATED FROM AN IMAGE CALIBRATED IN A RIGHT - HANDED
HexSight Basics User Guide
317
Locator
SYSTEM , THE
L OCATOR WILL NOT RECOGNIZE INSTANCES OF THE
SAME OBJECT IN AN IMAGE THAT HAS BEEN CALIBRATED IN A LEFT HANDED COORDINATE SYSTEM.
THIS WOULD REQUIRE A FLIP
L OCATOR.
TRANSFORM , WHICH IS NOT SUPPPORTED BY THE
Models Database
The Models database contains the Models used by a given instance
of the Locator tool. Such a database can contain any number of
Models, each of which is constituted of both a grey-scale Model
Image and Model Scenes (Outline and Detail) that describe the
contour geometry of an object.
• A Models database should contain Models that are similar in
nature, size and calibration, such as models for parts or objects
commonly used within the same application.
• A large number of Models can significantly affect the search
speed.
• Cropping Models reduces the size of the models database files
and the runtime memory usage can thus improve search time.
• Created Models, as well as modifications made to existing
Models, will exist only in memory and will be lost once the
application is closed, unless the changes are saved to the current
database, or to a new models database.
• Models in a database can be individually enabled or disabled as
needed for the current application.
• You can also import selected Models to the database from other
HexSight Model databases.
• Model database files are created and saved in the same format
as other HexSight database files (*.hdb).
HexSight Basics User Guide
318
Locator
Sharing the Models Database
Multiple instances of the Locator tool can share a same models
database in memory. This is useful for applications in which the
same models must be searched in different areas and/or with
different parameters.
• Instead of having each Locator keep its own copy of the models
database, handles can be used to share one Locator’s models
database with other Locators.
• The models database handle can also be used to directly display
the models contained in a Locator’s Model database in a Display
control.
Disabling Model Disambiguation
The Locator automatically applies disambiguation to resolve both
inter-model ambiguities (similar models) and intra-model
ambiguities (similar hypotheses of same object). Disambiguation
can be disabled when needed, typically in applications in which
there is a very large Models database.
• Disabling disambiguation will significantly reduce the time to
learn, or re-learn, the models.
• Disabling disambiguation removes the Locators capability to
discriminate between very similar models and between similar
hypotheses for a same object.
• Disabling disambiguation also removes the Locators capability to
discriminate between very similar hypotheses for a same object.
Model Creation and Edition
Models can be taught, built and edited through the Model Editor interface.
Models can also be created, though not edited, programmatically through
HexSight Basics User Guide
319
Locator
the HSModelEditor control, without having to show the interactive user
interface.
Note: The Model Demo, on the HexSight CD provides an example of
the use of the HSModelEditor object.
Teaching a Model
A Model is automatically taught by simply dragging the bounding
box of the Model Editor interface to the region of interest in the
grey-scale image, then using the Build command. The Locator
builds the Model, based on Contour Detection and Feature
Selection parameters.
Model building is a three-step process. First, contours are detected
in the grey-scale image. Then, from the detected contours,
appropriate features are selected, as illustrated in Figure 138.
Thirdly, if necessary, the Model can be manually edited to add or
remove features.
A: Source contours are detected
in input grey-scale image
source contours
B: Appropriate features are
selected to build the Model
Model
FIGURE 138 Model Building Process
HexSight Basics User Guide
320
Locator
Model Image Considerations
The choice and the quality of the grey-scale image used to build the
Model have an impact on the efficiency and robustness of the
location process. The following points should be considered in
selecting the Image on which to teach a Model.
• The image used to build the Model should be as ideal as possible.
• Make sure there are no shadows around the part in the image
used to build the Model. If a shadow is near the outline of the
part, it can distort its shape, which will reduce recognition
robustness and positioning accuracy.
• The background should be as uniform as possible. If the
background in the runtime images is textured, a uniform
background such as a sheet of paper should be placed on the
surface to eliminate the geometry of the background from the
image that is used to build a Model.
• For example, in the first case of a given object, as shown in
Figure 139, if a Model is built from contours of the part on a
textured background, two separate features will be created to
describe its geometry at the Outline Level. These features will be
partly constituted of geometric information that is part of the
background and will not be appropriate features for the Model
since they are not stable from one runtime image to another.
HexSight Basics User Guide
321
Locator
Grey-Scale Image
Contours
FIGURE 139 Broken Outlines Caused by Non-Uniform Background
• Although it is not mandatory, using long continuous features to
describe the geometry of a part at the Outline Level will usually
improve robustness.
• To improve the robustness of the Locator in the preceding
example (Figure 139) it would be preferable to build the Model
on a uniform background such as shown in Figure 140.
Grey-Scale Image
Contours
FIGURE 140 Complete Outline Obtained on a Uniform Background
• This unbroken representation of the part at the Outline Level will
significantly improve the robustness of the Locator. In runtime
images, the Locator will be able to extract a significant part of
the contour geometry even though the contour is broken into
smaller sections. See Figure 141.
HexSight Basics User Guide
322
Locator
Grey-Scale Image
Matched Model
Grey-Scale Image
Matched Model
FIGURE 141 Examples of Matched Models on Non-Uniform
Background in Runtime Images
Model Contour Detection
The Model Editor provides contour detection parameters that are
applied by the Locator to generate the contours used to build a
Model. This enables you to create Models having different contour
detection settings than the default values. The Locator
automatically sets optimized contour coarseness levels when
Automatic Levels is enabled. To manually configure contour
coarseness levels, you must disable the Automatic Levels mode.
Outline and Detail Level Values
• The Detail Level is used to refine the position and orientation of
the object instance. In Automatic Levels mode, the Locator sets
the value for the Detail Level based on the sharpness of the
HexSight Basics User Guide
323
Locator
contours. This ensures accuracy and stability of the object
position and orientation.
• To ensure positional accuracy: when you have sharp images, use
the lowest Detail Level that will provide stable contours. If
images are blurry, you may obtain better results by increasing
the Detail Level. Blurriness in images is in fact the only reason
for setting higher Detail Level values.
• To improve recognition robustness in multi-model applications,
the same Outline and Detail coarseness should be used for all
models.
• A higher coarseness setting at the Outline Level can improve
robustness to high frequency noise and to fine textures.
• With a higher coarseness setting at the Outline Level, the shape
of the Model is coarser. This can diminish the efficiency of object
recognition and result in missed instances, especially in cluttered
Scenes.
Contrast Threshold
• When it is difficult to obtain well-contrasted images for building
the Model, reducing the Contrast Threshold value, (or
selecting High Adaptive Sensitivity) can help detect weakcontrast contours. In this case, the amount of noisy contours in
the background will also increase.
• If there is too much noise in the image a lower sensitivity setting
(Adaptive Low Sensitivity or a higher Contrast Threshold
value) can help reduce the noise.
Tracking Inertia
• Increasing the Tracking Inertia can help close small gaps and
connect contours that would otherwise be broken into smaller
sections.
HexSight Basics User Guide
324
Locator
Feature Selection
A feature is a section of an object’s contour geometry. For any
given model, the arrangement of features, especially at the Detail
Level, should allow the Locator to reliably and accurately measure
the scale, rotation and translation of the object.
• Features are added automatically, when the Model is taught,
based on the setting of the Feature Selection parameter, which
ranges from none (no features added) to all (all contours
selected as features).
• The normal setting will select the most appropriate features
from the detected contours. This setting should be used with
simple to moderately complex patterns such as mechanical
parts.
• The all position will incur the selection of every contour feature
detected by the Locator, including small features and features
with lower contrasts. This setting should be used only with very
complex patterns such as those encountered in electronics and
semiconductor applications.
• The none position should be selected when you want to
manually select the features for the Model from the detected
contours. Note that you must use the Build Model command to
detect the contours.
• Once a Model has been taught, it can be edited to remove
features or add manually selected features.
Manual Model Editing
The capacity to manually add features to an automatically
generated Model is particularly useful when you know a specific
object feature to be particularly important, unstable or required for
unambiguous recognition.
HexSight Basics User Guide
325
Locator
• The principal consideration for selecting features to add to the
Model is identifying portions of an object’s contour that
characterize it and set it apart from other somewhat similar
objects or background while being stable with respect to lighting.
• More precisely, the user should favor features that are long and
rich in their variation of curvature. This allows for more robust
recognition and more precise positioning.
• Any number of features can be selected and added to a Model, at
either the Outline or the Detail Levels or both.
• The Outline Level should contain at least a minimum amount of
features that allow the Locator to reliably generate hypotheses.
• Non-distinctive and unstable features at the Outline Level can
negatively impact the ability of the Locator to recognize the
Model.
• The Detail Level should contain non-blurry and stable features
that can be used to accurately locate the part. Blurry and
unstable features at the Detail Level can negatively impact the
location and positioning accuracy.
Stable Model Features
A good Model contains features that are stable and discriminating.
A feature is said to be stable if it shows the following behavior
from one image to another:
• The geometry of its contour remains unchanged under normal
lighting variations.
• The geometry of its contour remains unchanged when the object
is moved and/or rotated in the image.
• The relative position of the feature with respect to the other
features of the Model remains constant (rigidity). For example,
on a part with a strong 3D aspect, features that are closer to the
HexSight Basics User Guide
326
Locator
camera will usually move with respect to more distant features.
When working with such parts, it is best to build the Model using
features that are at a similar distance to camera.
Unstable Model Features
• Features that are slightly unstable in position can be used in
models by deactivating their Location property. They will be
used to recognize the part but they will be ignored for refining its
location.
• Using unstable features caused by shadows or reflections in the
Model may reduce robustness and lower the Fit and Match
Quality of recognized instances.
Discriminating Model Features
A Model should be built with discriminating features. A feature is
discriminating if it allows the Locator to identify and locate the
part among other objects appearing in the runtime images.
• A good feature is relatively long.
• A good feature is rich in curvature variations. For more
robustness to occlusions, the curvature variations should be well
distributed along the feature.
• A good feature contains a discriminative geometry that does not
appear in other objects in the image.
• When possible, it is preferable to use features that individually
define a complete Scale/Rotation/Translation transform.
Examples of such features are shown in Figure 142.
HexSight Basics User Guide
327
Locator
Closed Features
Open Features
FIGURE 142 Features Rich in Curvature Variations
• Features that only define a partial Scale/Translation transform
(complete circles, circular arcs, lines) can also be used but the
arrangement of these features in the Model must define a
complete Scale/Rotation/Translation transform as shown in
Figure 143.
Model composed of an
arrangement of
linear segments
Model composed of an
arrangement of circles
Model composed of an
arrangement of
circular arcs
Model composed of a complex
geometry broken into small
segments by noise in the contours
FIGURE 143 Model Defined with an Arrangement of Partial Transform
Features
HexSight Basics User Guide
328
Locator
Symmetries
A good Model should not be symmetrical in rotation; otherwise the
orientation of a recognized instance of the part will be ambiguous.
As a general rule, include disambiguating features that break the
symmetry of the Model and allow the Locator to establish the
proper orientation of the object.
• A Model can be built using a single complete circle or an
arrangement of concentric circles (see Figure 144) but the
rotation will not be accurate nor repeatable.
FIGURE 144 Model Defined with an Arrangement of Concentric
• The term complete circle does not necessarily mean an actual
smooth circle. It means a circular shape for which the Locator is
not able to reliably compute a rotation. Sometimes a symmetric
shape can be considered as a circle at high coarseness levels, as
shown in Figure 145.
Coarseness level of 1
Coarseness level of 8
FIGURE 145 Effect of Coarseness on a Symmetrical Shape
• Although each feature may have rotational symmetries, the
arrangement of these features should not have symmetries, as
shown in the Bad Models example in Figure 146.
HexSight Basics User Guide
329
Locator
• Optionally, you can enable the Required property for one or
more disambiguating features, which ensures that the Locator
does not output an instance of the object if these features are
absent. Required features can be used at both the Outline and
Detail Levels.
• If the disambiguating features are always present but are
unstable in position, their Location property can be deactivated.
When the Location property is deactivated for a given feature,
the Locator only checks for its presence near its expected
location but does not use the feature to compute the pose of the
object. Non-location features can be used at both the Outline
and Detail Levels.
• For example, to properly recognize and locate the object
illustrated in Figure 146, the feature properties could be set as
shown in Figure 147. The small circle will be required to
recognize the part. The other features will not be individually
required to recognize the part, as long as the Minimum Model
Percentage and Minimum Required Features criteria are
met. If the small circle is slightly unstable in position, its
Location property can be set to false. Therefore, to compute the
pose of the part, the Locator will use all of the recognized
features except the small circle.
HexSight Basics User Guide
330
Locator
Grey-Scale Image
Model with 4 symmetries
at the Outline Level
Good Models without symmetries at the Detail Level
(Outline symmetries are resolved)
Bad Models with 4 and 8 symmetries at the Detail Level
(Outline symmetries are not resolved)
FIGURE 146 Good/Bad Model Examples built with Symmetrical Features
HexSight Basics User Guide
331
Locator
Locator
Output
Model
Small disambiguating:
feature:
Required = True
Location = False
Required feature
NOT FOUND:
No object
instance is output
Search
Other features:
Required = False
Location = True
Required feature
FOUND:
A valid object
instance is output
FIGURE 147 Effect of Assigning the Required Property to a Model Feature
Inter-Model Disambiguation
To ensure that the Locator will properly differentiate and recognize
similar objects in multi-model applications each model must
contain disambiguating features, which identify and distinguish the
model from other similar models.
• The Locator automatically uses disambiguating features to
distinguish between several similar Models. The example in
Figure 148 shows two “hook” objects that are identical except for
the size of the circular hole at each end, which in this example is
the only discriminating feature.
• If the disambiguating features are always present but are
unstable in position, their Location property can be deactivated.
When a feature deactivated for location, the Locator only checks
for its presence near its expected location but does not use the
feature to compute the pose of the object.
HexSight Basics User Guide
332
Locator
Model A:
Hook_Big_Hole
Model B:
Hook_Small_Hole
Disambiguating Feature
FIGURE 148 Using Discriminating Features to Distinguish
Between Similar Objects
• Optionally you can, set one or more disambiguating features as
Required. Figure 149 illustrates a case in which the
discriminating feature may sometimes be absent or undetected
because of an occlusion. This example assumes that there is
enough contour found for all three objects to be identified as the
Hook model type. Since the Locator cannot find the Required
feature on object C, this object instance not recognized. Note
that Required features can be used at both the Outline and
Detail Levels. In this example if the disambiguating features
were not set as required, instance C would have been recognized
as either Model A or Model B, depending on the Match and Fit
Quality of the instance.
HexSight Basics User Guide
333
Locator
Model A:
Model B:
Locator
Output
Grey-Scale
Image
Models
Required
Feature
B
B
Required
Feature
C
A
A
FIGURE 149 Using the Required Property in a Multi-Model Application
Object Coordinate System
The position and orientation of the Object coordinate system’s
origin is set by the user: the X-Y axes can be rotated and their
origin displaced anywhere within the bounds of the Model Image,
not necessarily on or within the object contour.
• At runtime, the position of each located instance will correspond
to the location of the Object coordinate system’s origin in the
search image, while the orientation will correspond to the
rotation of the Object coordinate system in the search image.
• The placement of the coordinate system on the Model has no
impact on the recognition and location process. It only defines
the origin of the part. It is typically placed at its center of mass
or aligned with important features on an object, such as
illustrated in Figure 150.
HexSight Basics User Guide
334
Locator
Y
X
X
Y
X
Y
Coordinate system positioned
at the center of the object
Y
X
Coordinate system aligned with
important object features
FIGURE 150 User-Determined Placement of the Object Coordinate
System According to Characteristics of the Object
Reference Points
A Reference Point identifies a point on an object that is of particular
interest for a vision application. For instance, it can indicate a
gripping point for a pick-and-place application. You can place any
number of Reference Points in a given Model.
• A Reference Point may or may not refer to a visible feature on an
object. It constitutes a specific X-Y coordinate, referenced with
respect to the Object coordinate system.
• The placement and number of Reference Points on a Model has
no impact on the recognition and location process. They are only
model-defined positions that are transposed with respect to
located instances of the Model.
Model Editor Messages
The Model Editor provides a brief report on model building as well
as troubleshooting information to help resolve model creation or
HexSight Basics User Guide
335
Locator
edition problems. Messages are generated when the Build Model
or Analyze Model command is applied. Table 11 presents the
possible diagnostic messages with their code numbers.
TABLE 11
Model Editor Messages
Message
number
Message
1059
At least one feature must be checked for Location in the Outline Model
1060
At least one feature must be checked for Location in the Detail Model.
4000
Model Edition OK.
4001
Unable to create Model, no contours in the Bounding Area.
4002
Invalid Model. No contours in the Bounding Area at the selected Outline
Level.
4003
Invalid Model. No contours in the Bounding Area at the selected Detail
Level.
4004
No features have been selected in the Outline Level. Select features
manually or increment the position of the Feature Selection slider.
4005
No features have been selected in the Detail Level. Select features
manually or increment the position of the Feature Selection slider.
4006
Contours seem blurry at the selected Detail Level.
4007
Detail Level was set to a level higher than 1. Location results may lack
accuracy.
4008
Due to blurriness, the Detail Level was increased for recognition
reliability.
4009
Although the contours seem blurry, the Detail Level cannot exceed the
Outline Level.
4010
Scale and Translation may be unstable or lack accuracy.
4011
Translation may be unstable or lack accuracy.
4012
Outline Model may contain symmetries. If the search is performed at the
Outline Level Only and a stable rotation angle is required, break the
symmetries by manually selecting features.
4013
Detail Level may contain symmetries. It might be possible to break the
symmetries by manually selecting features.
4014
The Detail Level removes the symmetries existing at the Outline Level.
4015
Stability of the Outline Level cannot be confirmed.
HexSight Basics User Guide
336
Locator
Message
number
Message
4016
Neither Outline nor Detail Levels have been validated. Manual settings
are recommended.
4017
A large number of features have been selected in the Outline Level.
Search performance might be affected.
4018
A large number of features have been selected in the Detail Level.
Search performance might be affected.
4019
To find this object, it might be necessary to adjust the Recognition slider
to Exhaustive.
Model Optimization
The purpose of the Model optimization is to build an improved model based
on multiple object instances. Typical situations for optimizing a model
include:
• Objects that vary in shape such that it is not possible to build a
satisfactory typical model from a single object instance.
• Cases when a single model contains unwanted features resulting
from noise or irregularities in the object and manual editing of
the model to remove these extra features is not practical such as
illustrated in Figure 151
Initial non-optimized model
Final optimized model
FIGURE 151 Model Optimization of a Noisy Object
Optimization Process
To build an optimized Model, you must provide an initial Model of
the object then execute the Locator process. While optimization is
HexSight Basics User Guide
337
Locator
enabled, each new instance of the object found by the Locator is
analyzed and compiled into the optimized model that is currently in
progress. Strong features, which are those that recur frequently in
the analyzed instances, are retained in the optimized model. Once
the model is considered satisfactory, the optimized model can be
saved.
Figure 152 illustrates an initial Model and the final optimized model
for a variable-shaped object. Note that the initial greylevel image is
retained in the Model; the image is not modified by the
optimization process.
Optimization Parameters
Optimization parameters are set for the Detail and Outline levels of
the Model. By default, the Outline level parameters are linked to
the Detail level parameters in which case the Link to Detail
property is enabled. This is the recommended setting. If necessary,
Link to Detail can be disabled to allow you to control the setting of
Outline level parameters.
Initial Model
(before optimization)
Optimized Model
FIGURE 152 Model Optimization on an Object of Variable-Shape
HexSight Basics User Guide
338
Locator
Percentage of Points to Analyze
The Percentage Of Points To Analyze is set from within the
Locator. This value sets the percentage of points on a model
contour that are actually used for the optimization process. For
example, when set to the default 50% value, one out of two points
are used. Increasing this value can increase the accuracy of the
optimized model but incurs a longer execution time.
Morph to Average Shape
Morphing allows the optimization process to add recurring features
to the optimized model even if these features were absent from the
initial model. These recurring features are appended to the model
only if their frequency of recurrence is equal to or above the
threshold set for Minimum Feature Recurrence. Figure 153
illustrates the effect of enabling or disabling morphing in a case
where strong features do not appear in the initial model.
When the Link to Detail property is enabled, enabling Morph To
Average Shape at the Detail level automatically enables morphing
at the Outline level.
HexSight Basics User Guide
339
Locator
Morph to Average Shape Disabled
Initial
Model
Subsequent instances used
or model optimization
Optimized
Model
Morph to Average Shape Enabled
Initial
Model
Subsequent instances used
for model optimization
Optimized
Model
FIGURE 153 Effect of Morphing to Average Shape on Model
Optimization
Minimum Feature Recurrence
Minimum Feature Recurrence sets the frequency of recurrence
that is required for a feature to be retained and used for the
optimization process. For example, at the default setting of 50, a
feature will be retained for the optimized model only if it occurs in
at least 50% of all analyzed instances.
When the Link to Detail property is enabled, the Outline level
recurrence is automatically set to 10% lower than the Detail level
feature recurrence.
HexSight Basics User Guide
340
Locator
Search Process
The Search process is the actual finding and locating of recognized object
instances. The Locator first detects contours in the input grey-scale image
and then searches these contours for instances of objects defined within
the Model database. The Locator generates hypotheses of potential
instances, based on the Outline Level contours. The Locator then, confirms
the hypotheses and refines the location of the instances based on Detail
Level contours. User-determined Search constraints and Recognition
parameters are used to restrict the search, for example to find objects
within a specific range of scale or orientation.
Search Area
The Search Area defines the region of interest that is processed
by the Locator. By default, the Search Area is the entire image but
it can be reduced and placed anywhere within the area of the input
image (see Figure 154).
Input Image
Input Image
boundary
Contours are
generated only
in Search Area
Contour Scene
Search Area
bounding box
FIGURE 154 Search Area
• A smaller area constrains the search process to a specific region
of interest and can reduce the execution time.
HexSight Basics User Guide
341
Locator
• Since the Locator can be configured to tolerate occlusions, it may
be possible, depending on the application’s requirements, to
locate objects that fall partially out of the bounds of the Search
Area.
Note: To improve recognition robustness, the Search should be
configured to use same Outline and Detail coarseness levels as those
used to create the Models that are used by the application. This is
done by setting the Parameters Based on property to All Models.
Learn Process
A Learn process is carried out the first time the Locator tool is executed. A
Learn is also carried out in the execution that follows a change to search
parameters. Exceptions to this are presented further in this section.
Note: Learn should not be confused with Teach, which is the term
applied to creating a new Model.
In the Learn process the Locator "learns" the currently activated models
with respect to the current Search parameters. The Locator integrates the
information gathered during the Learn into the search process. Subsequent
executions of the Locator are therefore significantly shorter than an initial
execution that includes a Learn. The Locator outputs separate execution
times for both the Learn and Search processes.
Exceptions to the Learn Process
Because a Learn can add a significant amount of time to an
execution, exceptions to the Learn have been built in for
applications that modify certain parameters during runtime. This is
especially helpful for multi-model applications that use a large
number of models.
Exceptions are provided for changes made to the following: the list
of enabled models, Scale and Rotation. Basically, in these cases,
HexSight Basics User Guide
342
Locator
the Locator does not need to re-learn the models if new parameters
are contained within the range of the initially learned parameters.
Changes to the List of Enabled Models
The Locator initially learns the only those models that are currently
enabled (activated) in the Models database.
• Changes to the list of enabled models will not incur a Learn when
you enable or disable models that were initially learned, i.e. that
were enabled when the Learn was carried out.
• A Learn will be executed however, if new models, that have not
been previously learned, are added or if any of the models are
edited.
Changes to the Scale Factor Range
After an initial learn phase, you can reduce the range of scale
factors without incurring a new learn as long as the scale factor
values remain within the maximum and minimum values of the
initially learned range.
• If you select a range of scale factors outside the learned range, a
new learn will occur at the next execution of the Locator and the
previously learned scale factors will be discarded.
Changes to the Range of Rotation
After an initial learn, you can reduce the range of rotation without
incurring a new learn as long as this range is contained within the
previously learned range.
• If you select a range of rotation outside the learned range, a new
learn will occur at the next execution of the Locator and the
previously information learned will be discarded.
• In the example in Figure 155, range B will be set without a
incurring learn. Because range C lies partially outside the
HexSight Basics User Guide
343
Locator
learned range A, the Locator will automatically learn the new
range C and discard the range A settings.
A
Learned range
of rotation 45 - 180
B
C
Range: 30 to 65
Range 60 to170
FIGURE 155 Learned Range of Rotation
Learn and Unlearn Commands
The Learn command initiates the Learn process only, without
executing the Locator. This Learn includes any modifications made
to parameters since the since the last execution. The purpose of is
to ensure that the next execution of the Locator will be shorter,
because the Learn has already been carried out.
The Unlearn command clears all information gathered by the last
Learn. The next execution of the Locator that follows the Unlearn
command, the Locator will re-learn all the active models. This
command is useful for freeing up memory.
Contour Detection
The Locator carries out contour detection by processing the input
grey-scale images to generate a vectorized description of the
HexSight Basics User Guide
344
Locator
image, called a Contour Scene. The Locator generates source
contours on two coarseness levels: Outline and Detail, within a
region of interest called the Search Area.
Contour Detection Parameters
Contour detection parameters modify the quality and quantity of
contours that are generated by the Locator from the input greyscale image. These parameters can be set either automatically,
from the application’s list of Models, or manually.
• Although each Model in the database has its own set of contour
detection parameters, to preserve performance at runtime,
contour detection is performed using only one set of parameters.
• In multi-model applications you can specify which Model’s
detection parameters the Locator should apply to contour
detection.
• You can also specify that contour detection parameters be
provided by the whole set of Models. In this case, the Locator
selects the most restrictive contour detection parameters among
all the models in the current models database: the lowest
Outline Level, the highest Detail Level, the highest sensitivity
Contrast Threshold and the lowest Tracking Inertia value.
• For the above reasons, to obtain higher performance, robustness
and accuracy, the Locator should preferably search for objects
that are similar in size and detail. A simultaneous search for very
different objects, such as a very small object with a large object,
can noticeably hinder the Locator’s performance.
Outline and Detail Levels
The Locator process generates two levels of contours. The coarser
Outline Level is used to generate hypotheses of potential instances.
HexSight Basics User Guide
345
Locator
The finer Detail Level is used to confirm the hypotheses and refine
the location of the instances.
• For each level, coarseness values range from 1 to 16. At level 8
for example, the resolution is 8 times lower than an image at full
resolution (level 1).
• The Detail Level, by definition has a coarseness value less than
or equal to that of the Outline Level. Similarly, the Outline Level
value is always greater than or equal to that of the Detail Level.
• To improve search speed, set the Outline Level to the highest
value at which contour geometry is still distinctive and stable.
• To obtain high-accuracy object location, it is preferable to use
images with sharp edges and set the lowest coarseness value for
the Detail Level.
• For images that are not in perfect focus, better results will be
obtained with a higher value for the Detail Level.
Contrast Threshold
The Contrast Threshold sets the level of sensitivity that is applied
to the detection of contours in the input image. The contrast
threshold can be either adaptive for fixed.
Adaptive thresholds are so named because the Locator internally
sets a sensitivity level based on image content. This provides
flexibility to variations in image lighting conditions and contrast
during the Search process. There are three possible Adaptive
thresholds: Normal (default) Low and High.
• Adaptive High Sensitivity provides a Contour Scene that
includes a great amount of low-contrast contours and noise.
• Adaptive Low Sensitivity setting provides a Contour Scene
that retains strongly defined contours and eliminates noise, at
the risk of losing significant contour segments.
HexSight Basics User Guide
346
Locator
• A Fixed Value threshold sets an absolute value for the
sensitivity to contrast. A typical situation for the use of a fixed
value is a setting in which there is little variance in lighting
conditions.
• The numerical fixed value corresponds to the minimum step in
greylevel values required to detect contours.
• A lower value adds more contours at the expense of adding more
noise, which may possibly generate false detections and/or slow
down the search process.
Tracking Inertia
Tracking Inertia allows the Locator to close small gaps between
contours for cases in which it is important to obtain complete
contour sections to describe the geometry of an object.
• Tracking Inertia corresponds to the maximum gap, in pixels, that
the Locator is allowed to close between two contour sections so
as to make a unique contour section.
• A value other than 0 may help in noisy scenes. Nevertheless, it
may lead to incorrect image interpretation and thus should be
modified cautiously.
Search Constraints
Search constraints provide restrictions for the Locator’s Search
process.
Scale Factor
The scale of objects to be located can be set at a fixed nominal
value, or as a range of scale values.
• The default setting for the scale factor is a nominal value of 1,
which applies to most situations.
HexSight Basics User Guide
347
Locator
• If a nominal value is used with objects that present a slight
variation in scale, the objects may possibly be recognized and
positioned with reduced quality because their true scale factor
will not be measured. In such a case it is preferable to configure
a narrow scale range, such as +/- 2%, instead of a nominal
value.
• Using a wide range in scale can significantly slow down the
search process. This range should be configured to include only
the scale factors that are actually expected for a given
application. The scale factor range is one of the parameters that
has the biggest impact on search speed.
Rotation
By default the Locator finds objects within a full range of rotation
values: between -180 and 180 degrees. Allowable rotation can be
restricted by either decreasing the range of rotation values or by
setting a fixed nominal value. The rotation range spans
counterclockwise from the specified minimum angle to the
maximum specified angle. Figure 156 illustrates impact of selecting
a minimum and maximum angle.
HexSight Basics User Guide
348
Locator
Rotation
Minimum: 45°
Maximum: 135°
135°
45°
Rotation
Minimum: 135° Maximum: 45°
135°
Valid range
of rotation
45°
Valid range
of rotation
FIGURE 156 Rotation Range — Minimum to Maximum Angle
• If a nominal value is used with objects that present a slight
variation in rotation, the objects may possibly be recognized and
positioned with reduced quality because their true rotation will
not be measured. In such a case it is preferable to configure a
narrow rotation range of +/- 1 degree instead of a nominal
value.
Number of Instances
The number of instances that can be recognized in an image is
theoretically limited only by physical factors such as the number of
objects that can be contained within an acquired image. However,
the Locator can be constrained to identify only a specific number of
instances.
• Instances to Find limits the total number of objects to be found
in the input image, NOT the total number of objects of each
type.
HexSight Basics User Guide
349
Locator
• If the number of objects present in the input image exceeds the
constraint, the Locator retains only the best quality object
instances, regardless of their type.
• Quality of instance is a combination of Fit Quality and Match
Quality (see Results, Quality).
Timeout
The timeout value sets a time limit indicator after which the Locator
terminates the processing of an image. If the Locator has not
finished processing an image within the allotted time, the Locator
returns all the instances it has located up to the timeout.
• This is particularly useful for time-critical applications in which
fast operation is more important than the occasional occurrence
of undetected object instances.
• This value is only indicative; the actual processing time may be
slightly greater.
Instance Ordering
The Instance Ordering parameter sets the order in which object
instances are output.
• At the default Evidence setting, the instances are ordered
according to their hypothesis strength.
• Instances can also be output in the order they appear in the
image, starting with the Leftmost, the Rightmost, the
Topmost or the Bottommost. This feature is particularly
interesting for pick-and-place applications in which parts that are
farther down a conveyor must be picked first.
• The Quality setting orders instances according to their Match
Quality. Instances having the same Match quality are then
ordered by their Fit Quality. This setting can significantly
increase the search time because the Locator cannot output
HexSight Basics User Guide
350
Locator
instance results until it has found and compared all instances to
determine their order. The time required to output the first
instance corresponds to the total time needed to search the
image and analyze all the potential instances. The time for
additional instances is zero since the search process is already
complete.
• Image Distance orders instances according to their proximity
to a user-defined point in the Image coordinate system. The X,Y
coordinates of the point are expressed in pixels.
• World Distance orders instances according to their proximity to
a user-defined point in the World coordinate system. The X,Y
coordinates of the point are expressed in the user-selected
length units.
• Shading Consistency orders instances according to their
shading consistency with respect to the Model, beginning with
the strongest. This mode is useful for BGA applications, where
the shading information, in addition to the normal contour
information, can assist in discriminating between very similar
hypotheses. See the example in Figure 157.
By shading
consistency:
Hypothesis A
rates higher than
hypothesis B
with reference
to the Model
A
Model
B
FIGURE 157 Instance Ordering - Shading Consistency
HexSight Basics User Guide
351
Locator
Contrast Polarity
Contrast Polarity defines the polarity change between an object
and its surrounding area. This polarity can be dark to light or dark
to light. The reference polarity for an object is defined by its Model.
• If Normal is selected, the Locator searches only for object
instances having the same object-to-background polarity as
Model. For example if the model is a dark object on a light
background.
Model Image defines the
"Normal" polarity
Normal Polarity
Reverse Polarity here is
caused by change in
background color
FIGURE 158 Contrast Polarity - Normal and Reverse
• Reverse restricts the Locator to search only for objects having a
object-to-background polarity that is inverse to that in the
Model. For example light objects on dark background for a Model
built from an object that is darker than its background (see
Figure 158).
• Normal & Reverse enables the Locator to search for both
cases. This will not take into account cases where polarity is
reversed at various locations along the Object’s edges. See
Figure
• When Don’t Care is selected, the Locator will be robust to
complete contrast reversal as well as to local contrast reversal of
HexSight Basics User Guide
352
Locator
sections of contour such as shown in the “checkerboard
background” example in Figure 158.
Contrast Polarity must be
set to Don’t Care for this
object to be detected
Changes in polarity
along the same edge
of an object
FIGURE 159 Contrast Polarity - Local Reversals in Polarity
Symmetric Instances
This option constrains the Locator to output not only the most
plausible position and orientation for an instance but also ALL
possible symmetric poses in the observed Scene. Symmetrical
objects can present a problem for location. Since their orientation
cannot be deduced from a given Scene, the Locate Symmetric
Instances setting enables the Locator to output all possible
locations of a single object.
• If this option is not enabled for symmetrical objects, then only
the estimated best-case instance of the object will appear in the
results.
Search Based on Outline Level Only
This constraint restricts the Search to using only the Outline Level
source contours and the Outline Model, to search, recognize and
position object instances. Detail Level contours are ignored
completely for recognition and pose refinement.
HexSight Basics User Guide
353
Locator
• The trade-off for enabling this parameter is reduction in
positional accuracy and increased possibility of detecting false
instances.
• An Outline-based search is useful for time-critical applications
that do not require a high positioning accuracy, or that need only
to check for presence/absence of objects.
• To be effective, this type of search requires clean runtime images
that provide high contrast contours with little or no noise or
clutter.
Recognition Parameters
The Locator searches the contours detected in the input image for
Model-defined contours. For a given application context, the user
can adjust the Locator’s recognition process using the following
parameters.
Recognition Effort
To improve flexibility, the Locator provides a parameter for
adjusting the recognition effort, which ranges from Quick to
Exhaustive.
• The default center position has been optimized to suit most
cases.
• A quicker setting will improve speed for easily recognizable
objects on clean backgrounds
• Contours in the image that fall within the conformity tolerance of
their associated model contours are considered matched and
increase the Match Quality of the instance.
• Hard to recognize models, consisting of arrangements of small
features or objects on cluttered or noisy backgrounds, such as
encountered in electronics and semiconductor applications,
sometimes require higher settings for the recognition effort.
HexSight Basics User Guide
354
Locator
Conformity Tolerance
Conformity Tolerance defines the maximum local deviation
between the expected model contours and the contours actually
detected in the input image, as illustrated in Figure 160. Based on
the imaging resolution during the Learn process, the Locator
estimates and sets a default contour conformity tolerance as well
as a valid range for conformity tolerance.
• The Conformity Tolerance value corresponds to the maximum
distance in calibrated units by which a matched contour can
deviate from either side of its expected position.
• The allowable Conformity Tolerance is set by the read only
Valid Conformity Tolerance Range. Values set outside this
range are automatically adjusted by the Locator to equal either
the minimum or maximum value of the range.
• Increasing the conformity tolerance can help increase the Match
Quality of objects having small imperfections on their contour.
Model
contour
Conformity tolerance
applied on both sides
of model contour
Actual contour detected
from the input image
with sections outside the
conformity tolerance zone
Portion of unmatched
contour falling
outside the
conformity tolerance
zone
FIGURE 160 Conformity Tolerance
HexSight Basics User Guide
355
Locator
Minimum Model Percentage
The Minimum Model Percentage is the minimum percentage of
model contours that need to be matched in the input image in order
to consider the instance as valid.
• Only those contours that can be found within the conformity
tolerance zone are considered. See the magnified representation
in Figure 162.
• Decreasing Minimum Model Percentage can help detect
objects which are either partially occluded (Figure 161) or
objects having significant defects in their contours (Figure 162).
Model
Example A:
Recognized Instance:
matched contours greater
than 60% of total Model
contours
Example B:
Unrecognized Instance:
matched contours lower
than 60% of total Model contours
Note:
In both cases
Minimum Model
Percentage = 60
FIGURE 161 Minimum Model Percentage — Example with
Occlusion of Object Contours
HexSight Basics User Guide
356
Locator
There are defects in the
contours of this object
Only contours within
Conformity Tolerance
are matched
Magnification
Matched contours greater
than 60% of total Model
contours
= VALID INSTANCE
Conformity Tolerance
Contour outside Conformity Tolerance
Contour within Conformity Tolerance
FIGURE 162 Minimum Model Percentage — Example with Defects in
Object Contours
Minimum Percentage of Required Features
Required features, as set through the Model Editor, are features
that need to be recognized for the Locator to accept a valid
instance of an object. Although typically, the presence of all such
features (100%) is required, the Minimum Percentage of
Required Features parameter lets you set a lower percentage of
required features.
• Note that this percentage is expressed in terms of the number of
required features in a model without considering the amount of
contour each required feature represents in the model. For
example, if the model contains 3 required features and
Minimum Percentage of Required Features is set to 50%,
an instance of the object will be considered valid as long as 2 out
of 3 Required features are recognized.
HexSight Basics User Guide
357
Locator
Positioning
At the end of the search process, the Locator uses the Detail Level
to refine and finalize the position of recognized object instances.
The Positioning parameter allows the flexibility to configure the
speed/ accuracy trade-off of the positioning process, through a
scale that ranges from Quick to Accurate.
• The Locator has been optimized to provide the best speed/
accuracy trade-off at the default mid-range setting.
• It is possible to sacrifice location accuracy for speed
improvement by setting the slider towards Quick, for presence/
absence detection applications for example.
• Conversely, a slight gain in accuracy can be obtained by setting
the slider towards the Accurate setting.
Improving Search Performance
A key factor in improving the performance of the Locator is to constrain the
search as much as possible.
Effect of Learn Process on Performance
• After models and/or search parameters have been changed, the
first execution of the Locator is always longer because the
models to be recognized have to be learned according to the
search parameters.
• Exceptions to this behavior exist for changes made to the Scale
range, the Rotation range or to the list of the list of enabled
Models. See the Exceptions to the Learn Process section in
this chapter.
HexSight Basics User Guide
358
Locator
Model Considerations Affecting Performance
• A large number of models can significantly affect the search
speed, especially when the Recognition effort is set towards
Exhaustive.
• When you build a model using automatic feature selection in the
Model Editor, always start by setting the Feature Selection
slider to Normal. This will usually provide the best robustness/
accuracy compromise.
• With complex patterns such as those encountered in electronics
and semiconductor applications, it is sometimes preferable to set
the Feature Selection slider to more or all to improve
robustness.
• The bounding area, in which model contours are detected, has
no effect on the search process. It only restricts contour
detection to the area of the image in which Model features will
be selected. However restricting the bounding area together with
the Crop function can reduce the size of models databases for
the application and thus reduce memory usage at runtime.
Search Constraints Affecting Performance
Scale
• Scale factor range has the biggest impact on the performance.
Restrict it to a nominal value or a short range when possible.
Bear in mind that when the scale factor is set to a nominal value,
the Locator does not compute the actual value of the parameter.
The nominal value is used as is by the Locator to position the
instance.
• In applications requiring multi-scale capabilities but where the
scale factors are few, fixed and known beforehand, it is usually
best to define specific models for each of the scale factors that
HexSight Basics User Guide
359
Locator
may be encountered and constrain the search to a nominal scale
factor of 1.
• In multi-scale applications, setting the Recognition slider towards
Quick can greatly improve search speed.
Rotation
• A smaller rotation range improves the performance of the
Locator: Use the minimum range required for the application.
Bear in mind that when rotation is set to a nominal value, the
Locator does not compute the actual value of the parameter. The
nominal value is used as is by the Locator to position the
instance
Contrast Polarity
• Select a specific polarity option when it is known. The default is
Normal polarity.
• The Don’t Care mode is necessary to detect objects when there
are local variations in contrast. It should only be used in such
cases since it can significantly increase location time.
• Similarly, select Normal and Reverse only if there will actually
occur instances of either polarity at runtime since this mode
incurs a longer execution time that Normal or Reverse polarity
options.
Instances to Find
• To reduce the search time, always set Instances to Find to the
maximum number of instances that you expect to find in the
image. An unconstrained number of instances can lead to a long
execution time since the Locator must thoroughly check for all
possible instances, especially in cluttered images.
HexSight Basics User Guide
360
Locator
Timeout
• Timeout can be activated in time-critical applications to abort
the search after a fixed amount of time. When a timeout
condition is reached, only the instances found up to the timeout
are output by the Locator.
Instance Ordering
• Enabling the Quality ordering mode may in significantly increase
the Search time when the image contains multiple instances of
the Model or when there can be confusion with background
features that are similar to the Model. In certain applications
however, the benefits of Quality ordering may often outweigh
this Search time drawback.
Search Based on Outline Only
• Enabling this parameter can significantly reduce the execution
time at the expense of a loss in positional accuracy.
• This mode is best used for well-contrasted images that provide
clear contours, with little noise.
• Because of the lack in positional accuracy, this mode it is suited
to time-critical applications where objects need only be coarsely
identified and located.
Symmetric Instances
• Enabling a search for symmetric instances may increase the
search time because the Locator will try to refine the hypotheses
for each object instance.
• If Locate All Symmetric Instances is disabled, the search
process will be limited to refining and outputting only the best
object hypothesis.
HexSight Basics User Guide
361
Locator
Recognition Parameters Affecting Performance
Recognition Effort
A more Exhaustive search setting is preferable in the case of:
• Models made up of small features at the Outline Level.
• Models made up of arrangements of features with few or no
curvature variations at the Outline Level.
• Cluttered images and degraded contours broken into small
segments.
A Quicker search setting is preferable in the case of:
• Models that are rich in curvature variations at the Outline Level.
• Multi-scale applications.
• Low-clutter images.
• Images containing unbroken contours
Conformity Tolerance
• If the features of the models to be recognized can be locally
distorted in the runtime images, increasing the Conformity
Tolerance can improve the robustness of the recognition
process. Note that a large Conformity Tolerance can also
trigger false recognitions and may slow the recognition process.
Minimum Model Percentage
• Increasing Minimum Model Percentage can accelerate the
recognition process but can also significantly reduce robustness
to occlusions. When significant occlusions are expected in the
runtime images, Minimum Model Percentage should be
decreased.
HexSight Basics User Guide
362
Locator
• When the recognition slider is set towards Exhaustive, low
Minimum Model Percentage values can significantly increase
the execution time.
• In multi-model applications, when the parts to be recognized are
very similar, increasing Minimum Model Percentage may help
avoid confusion between models.
Positioning Speed
• The Positioning slider has only a small impact on the overall
speed of the Locator.
• In applications where accuracy is not critical, setting the slider
towards Fast can provide an improvement in speed.
• Moving the slider towards Accurate increases the positional
accuracy of found instances.
Locator Results
Locator results provide information on instances found by the Locator. The
most frequently used results, described below, appear in the user
interface. Other results, such as the position of reference points, are
described in the Reference Manual.
Results Viewer
The Results Viewer displays located instances in one of two
modes: Matched Model or Transformed Model (see Figure 163).
These modes are useful when setting up an application.
Nevertheless, activating the Results Viewer imposes an overhead to
the Locator since it must generate the graphical scenes. Thus, once
an application is set up, it is preferable to deactivate it.
The graphic mode selected in the results viewer is independent of
the output selected in the Output frame of the General panel. The
General panel lets the user specify the mode that will be output by
HexSight Basics User Guide
363
Locator
the Locator and consequently, the type of graphical Scene that will
be made available to subsequent processes.
Matched Model Mode
This mode displays the located instances using only the sections of
Model contours that were matched to the actual contours detected
in the input image.
• The graphical results can be visualized at the Detail Level only,
unless the search has been configured to Search Based on
Outline Only.
Transformed Model Mode
This mode displays the located instances using the Model contours
transformed according to the pose computed by the Locator. These
contours should not be confused with the actual contours that were
detected in the input image.
• The graphical results can be visualized at the Detail Level only,
unless the search has been set as Based on Outline Level
Only.
Matched Model
Transformed Model
FIGURE 163 Locator Output Display Modes
HexSight Basics User Guide
364
Locator
Locator Results
The Locator outputs a set of results for every instance found in the
input image.
Instance Identification and Model Type
Each located instance is identified by an instance number and the
name of its Model type.
Location Properties
The location properties for located instances are: Scale, Rotation,
X-Position and Y-Position.
The position of a given object instance corresponds to the origin of
its Object coordinate system with respect to the World coordinate
system of the input image. Units for position results are expressed
in the user-selected unit system.
Rotation is defined by the counterclockwise angle between the
Object coordinate system of the instance and the World coordinate
system of the input image.
HexSight Basics User Guide
365
Locator
object instance 2
Rotation
(X2,Y2)
object instance 1
Object coordinate
system
Rotation
(X1,Y1)
World coordinate system
FIGURE 164 Location Properties
The following equation is used to transform the model contours of a
given instance into the World coordinate system of the input
image:
X World = SR θ X Object + T
Where:
S is the scale matrix of the instance
R the rotation matrix of the instance
T is the translation vector of the instance
Fit Quality
The Fit Quality score ranges from 0 to 1, with 1 being the best
quality. This value is the normalized average error between the
matched model contours and the actual contours detected in the
input image.
HexSight Basics User Guide
366
Locator
• A value of 1 means that the average error is 0. Conversely, a
value of 0 means that the average matched error is equal to
Conformity Tolerance.
Match Quality
Match Quality ranges from 0 to 1, with 1 being the best quality. A
value of 1 means that 100% of the model contours were
successfully matched to the actual contours detected in the input
image.
Symmetry of
The Symmetry of index value is the index number of the instance
of which the given instance is a symmetry of.
• For example, if a rectangular Model, named Rectangle is located
in the image, with Output all Symmetric Instances set to
true, the Symmetry of result of would be as illustrated in Figure
165.
Instance
Index
Model
Rotation
Symmetry
of
0
1
Rectangle
4°
0
Rectangle
-140°
0
This is the first instance of the symmetry group
This second instance is a symmetry of instance 0
FIGURE 165 The "Symmetry of" Index Value
Time
The Time result provides the time that was needed to recognize
and locate a given instance. The time needed to locate the first
HexSight Basics User Guide
367
Locator
instance is usually longer because it includes all of the low-level
image preprocessing.
Elapsed Time
The Locator process returns three elapsed time results: Learn,
Search and Total.
• The Learn time is the time required to learn or re-learn models
and parameters. There is a Learn process at the first execution
of the Locator after any addition or change to Models or after a
change to some Locator parameters.
• The Search time is the time required to locate all object
instances found by the Locator.
• The Total elapsed time is the total time needed to execute the
Locator. This time includes the overhead needed to create and
output the result structures. It does not include the time needed
to refresh the Results Viewer.
Search Result Messages
The Locator outputs diagnostic messages for the search process.
Table 12 presents the possible diagnostic messages, with their code
numbers.
TABLE 12
Locator Search Result Messages
Code
no.
Message
4500
Contour detection parameters are BASED ON ALL MODELS and Models
have different detection parameters. Some instances might not be
properly recognized.
4502
No hypotheses were generated.
4503
A large number of hypotheses were generated. This might incur a longer
execution time.
4504
No features were set for location in the "name" Outline Model. The
Locator will use all features for location.
HexSight Basics User Guide
368
Locator
Code
no.
Message
4507
At least one instance was rejected because of a missing Required
feature.
4508
At least one instance was rejected since it did not respect the Rotation
constraint.
4509
At least one instance was rejected since it did not respect the Scale
constraint.
4510
The Models were re-learned because of a change in parameters.
4511
Execution was interrupted since no Input Image was provided.
4512
Unsuccessful recognition. No Outline Models were provided.
4513
At least one instance was rejected because insufficient contours were
found.
4514
Execution timed out.
4515
No features were set for Location in the "name" Detail Model. The Locator
will use all features for Location.
4516
Unsuccessful recognition. No Detail Models were provided in a dual
search.
4517
At least one instance that was recognized at the Outline Level was
rejected at the Detail Level.
4518
No instance was found at the Outline Level. Verify Search parameters or
edit the Model.
4519
Output of Outline Contour Scene is enabled: processing will be slower.
4520
Output of Detail Contour Scene is enabled: processing will be slower.
4522
Output of graphic instances in Instance Scene is enabled: processing will
be slower.
4523
At least two Models are similar. Only one instance can be retained
4524
At least one Model is symmetric. Orientation may be unstable.
4525
Maximum Instance Count constraint is enabled. The Locator retained
only the best n1 instances of the generated hypotheses.
4526
Execution aborted.
4527
One of the models has a coordinate system type inconsistent with that of
the input image. The search process may not work properly.
4530
Model Optimizer is enabled, processing will be slower.
HexSight Basics User Guide
369
Locator
Troubleshooting
• The Results Viewer, along with Model Editor and runtime
Messages are useful tools for troubleshooting the Locator.
• Diagnostic messages are provided for Models, through the Model
Editor, and for the Search process.
• When no object instance is found, check whether or not the
object is recognized at the Outline Level. Do this by activating
the Based on Outline Level Only check box in the Search
panel and executing the Locator again.
• If no instances are found, display the Contour Scene to check if
the contours are properly detected.
• If the contours are not detected at the Outline Level, try setting
the Contrast Threshold to High Adaptive Threshold or to a
very low Fixed value. To do so, you must first set the
Parameters Based on combo box to Custom.
• If the contours are correct at the Outline Level but the instances
are not detected, try decreasing Minimum Model Percentage.
If the instances are still not detected, try increasing Conformity
Tolerance. The search constraints may also be too restrictive, try
relaxing the scale factor and rotation ranges.
• You can use the Matched Model mode to view the instances and
check which part of the model was matched to the detected
contours.
• If an instance is recognized at the Outline Level but not at the
Detail Level, try decreasing the Minimum Model Percentage.
HexSight Basics User Guide
370
Locator
Using the Locator
The Locator Tool setup is carried out on five tab-selected panels: General,
Contour, Model, Search and Results. The Input for the Locator is
provided by a grey-scale image, typically output by the Acquisition Device.
General Panel
Use this panel to set the names for the Views, Scenes and Images output
by the Locator and also to set the type of units the Locator tool will use to
return results.
Process name —
can also be modified
in Process Manager
Output options
Display modes for
the Instance Scene
Units selector for
Locator results
FIGURE 166 Locator — General Panel
HexSight Basics User Guide
371
Locator
Process Name
Process Name sets the name of the current instance of the tool in
your application.
• If you do not enter a Locator name, the Locator Manager will
assign a default name: HSLocator#, where # is replaced by its
rank number in the list of instantiated processes.
Input
The Locator input consists of grey-scale images typically provided
by the Acquisition Device. Make sure images have been calibrated
to ensure positional accuracy, especially with rotated objects.
Output
Use check boxes to enable or disable the output of the Images,
Scenes and Views to the application’s runtime database. Disabling
non-required Locator outputs typically reduces the Locator
execution time.
Model View
The Model View contains both a grey-scale Image and a Model
Scene for each Model activated in the models database.
• Model-based inspection tools and the sampling tool require the
Model View Output.
Contour Scene Outline
The Outline Contour Scene contains the vectorized description of
the contours generated by the Locator at the Outline Level.
• Since Contour Scene Outline is not required as input for any
other HexSight tool, you should typically disable this output to
obtain faster performance.
HexSight Basics User Guide
372
Locator
• Use this output only for displaying detected contours in the user
interface of your application.
Contour Scene Detail
The Detail Contour Scene contains the vectorized description of the
contours generated by the Locator in the Detail Level.
• Since Detail Scene Outline not required as input for any other
HexSight tool, you should typically disable this output to obtain
faster performance.
• Use this output only for displaying detected contours in the user
interface of your application.
Instance Scene
The Instance Scene contains the pose and type of model of all the
object instances found by the Locator within the current image. It
may optionally contain a graphic representation of the instance.
• Inspection tools and the sampling tool that are set as "modelbased automatic" require the Instance Scene output.
Output Objects in Instance Scene as
Use Output Objects in the Instance Scene as to select the
output display mode: No Graphics, Transformed Model or
Matched Model.
• Matched Model displays only the sections of the Model contours
that can be matched to the actual contours detected in the input
image.
• Transformed Model displays the complete Model transposed
according to the pose of the instance.
• The graphic output modes are provided for displaying located
instances in the user interface of your application. For faster
HexSight Basics User Guide
373
Locator
performance you should always set Output Objects in the
Instance Scene as to No Graphics.
• For troubleshooting the Locator when developing an application,
you should use the Results Viewer instead of using a graphic
output mode for the Instance Scene. See the Results Viewer
section for details on interpreting Locator outputs.
Units
Use this section to enable the units you want for the Locator
results.
• Select Length units from the combo box.
• Select Orientation angle units from the combo box.
• The new units are applied automatically.
Note: Changing units will reset all configuration changes you have
made since the last Apply.
Contour Panel
Use this panel to set contour detection parameters and define the Search
Area.
HexSight Basics User Guide
374
Locator
Search Area properties
Search Area bounding box
Search Area display
Contour detection
parameters
FIGURE 167 Locator — Contour Panel
Search Area
The Search Area is the region of interest within which the Locator
searches and locates object instances. Contours are therefore
generated only within the Search Area.
Setting the Search Area
The Search Area bounding box should cover the entire area in
which object instances can appear. By default, it is set to Entire
Image.
To change the size and position of the box:
• Disable the Entire Image check box.
• Move the bounding box by dragging it into place.
• Size the box by dragging its corner and side handles.
HexSight Basics User Guide
375
Locator
• You can also change height, width and position by entering
values in the corresponding boxes.
Search Area Properties
The size and position of the Search Area is defined by the
following properties.
• Bottom: The minimum Y value of the bounding box.
• Left: The minimum X value of the bounding box.
• Top: The maximum Y value of the bounding box.
• Right: The maximum X value of the bounding box.
Search Area Display
The Search Area display provides three tab-selected views, for
visualizing contours.
No contours are generated
outside the Search Area
Outline Level contours
generated by the Locator
Outline Level tab
selected
FIGURE 168 Contour Panel — Search Area Display
The Outline display represents contours generated at the Outline
Level as magenta lines. The Detail represents contours generated
HexSight Basics User Guide
376
Locator
at the Detail Level as green lines. The Both display shows the
superposed Outline and Detail Levels contours.
Show Options
The Show frame provides two display options: Grey-Scale Image,
which displays the current input image when enabled and Bars,
which displays rulers, scroll bars and the status bar when enabled.
Contour Detection Settings
The Detection box provides options and settings for contour
detection.
Parameters Based on
The Parameters Based on combo box sets one of three modes for
applying detection parameters.
• The Custom mode requires that you manually set all detection
parameters. The other two modes: All Models or a "specified"
Model, automatically apply a set of predetermined detection
parameters.
• Table 13 presents how detection parameters are set for each of
the three parameter-selection modes.
TABLE 13
Application of Contour Detection Parameters
HexSight Basics User Guide
377
Locator
Parameters
Based on:
Outline Level
Detail Level
Contrast
Threshold
Tracking Inertia
Custom
User-defined.
User-defined.
User-defined.
Lower than or
equal to Outline
Level
All Models
From the Model From Model
with the lowest with the highest
Outline Level
Detail Level
that is also
lower than or
equal to the
Outline Level.
From Model with
the highest
sensitivity
Contrast
Threshold mode.
From Model
that provides
the Outline
Level
Selected
Model
Outline Level of Detail Level of
the selected
the selected
Model.
Model.
Contrast
Threshold mode
of the selected
Model
Tracking Inertia
of the selected
Model
User-defined.
Outline Level
The Outline Level is used to rapidly identify potential instances of
the object. Its coarseness setting ranges from 1-16.
• Values can be set manually only if Parameters Based on is set
to Custom.
• The higher the setting, the coarser the contour resolution.
• The Outline Level value must be lower than, or equal to, the
Detail Level.
Detail Level
The Detail Level is used to confirm recognition and refine the
position of valid instances. Its coarseness setting ranges from 1-16.
• Values can be set manually only if Parameters Based on is set
to Custom.
• The higher the setting, the coarser the contour resolution.
• The Detail Level value cannot exceed the Outline Level.
HexSight Basics User Guide
378
Locator
Contrast Threshold
Contrast Threshold sets the sensitivity to the contrast when
detecting source contours in the input image. With Adaptive
settings, the Locator automatically sets the numerical value
according to the input image.
• Contrast Threshold can be set manually only if Parameters
Based on is set to Custom.
• The default Normal Adaptive Sensitivity is recommended for
most applications.
• Adaptive High Sensitivity accepts lower contrasts and
therefore results in a greater number of source contours.
Adaptive Low Sensitivity retains high-contrast contours and
removes lower contrast contours, such as those caused by noise
and shadows.
• Fixed Value requires that you manually set the Contrast
Threshold value, expressed in terms of a step in greylevel
values that ranges from 0 to 255. Higher values reduce
sensitivity to contrast, resulting in fewer, high-contrast contours.
Conversely lower values increase sensitivity and add a greater
amount of source contours.
Tracking Inertia
Tracking Inertia defines the longest gap (in pixels) that can be
closed to connect two contour segments when building the source
contours.
• Tracking Inertia can be set manually only if Parameters
Based on is set to Custom.
• The default value of 0 is usually recommended for typical
applications.
HexSight Basics User Guide
379
Locator
Model Panel
The Model sub-process creates a reference or “ideal” contour
representation of an object that will be used by the Locator process.
Models integrate image calibration parameters and can thus be stored for
later on other imaging setups.
You will use this panel to manage the models database and use the Model
Editor, accessed through the Edit command.
Currently loaded
Model file
Thumbnail display
of the selected
Model
Use check boxes
to select models
that will be
transferred to the
runtime database
FIGURE 169 Locator — Model Panel
Database
The Database frame contains the file name text box, showing
name of the currently loaded Model database, command buttons
for managing model databases: Import, New, Load and Save As
and the Use External Database option.
HexSight Basics User Guide
380
Locator
Database Command Buttons
• Use Import... to import selected files into the current Model
database through the Import Models dialog (Figure 170).
Formats that are supported for importing are hdb (HexSight
database), hig (HexSight image), bmp and dxf.
• Use New... to clear the current models database. This resets the
Model panel interface.
• Use Load... to load a Model database file. The newly loaded
Model file replaces the current Model database. Only hdb
(HexSight database) files can be loaded to this database.
• Use Save As... to save the current database to an hdb (HexSight
database) file. A models database can contain any number of
Models. Unsaved Model information will be lost once you close
the application.
Use check boxes
to select Models
you want to
import
Thumbnail
image of
highlighted
selection
FIGURE 170 Importing Models
HexSight Basics User Guide
381
Locator
• Enabling Use External Database allows the Locator to use a
models database provided by another instance of the Locator
tool in the current application.
Note: Model databases that are too large are long to load and use a
significant amount of memory.
Models
The Models frame displays the contents of the current models
database, a thumbnail view of the selected and commands for
editing the database.
• You can enable or disable individual Models in the database using
the associated check boxes.
Models Command Buttons
• Click Add to access the Model Editor in which you will create a
new Model. You must first provide a Model Name in the Create
New Model dialog that appears. To edit the name of a Model in
the list, double-click on its name in the list.
• Use Copy to create a new Model that is identical to the one
currently selected in the list of Models. You are prompted to
provide a name for the new Model.
• Delete removes the selected Model from the database. Once a
Model is deleted, saving the current Model database will override
the old database, thus permanently removing the deleted model.
• Edit opens the Model Editor dialog, with the Model selected in
the list of Models. Unsaved modifications are applied only to the
current Models database and lost once you close the application
unless you re-save the modified models file. See the Using the
Model Editor section for more details.
• Optimize opens the Model Optimizer dialog in which you can set
up and observe an ongoing Model optimization process. To
HexSight Basics User Guide
382
Locator
activate the Optimize command you must first check the
Enable check box, which launches an optimization of the Model
that is currently selected in the list of Models.
Model Optimizer
The optimization process builds a model from multiple instances of
an object. Optimization is typically used when objects to be
recognized have a variable shape, when it is impossible to build a
typical or satisfactory model from a single instance, or when a
single model may contain unwanted features resulting from noise
or irregularities in the object and manual editing of features is not
practical.
Model Optimizer Settings
• Checking the Enable box enables the launching of an
Optimization process.
•
Reset All restarts the optimization process and discards the
instances that have been appended so far to the process. This
resets to zero the counter to the right of the selected Model in
the Database frame.
• The Percentage of Points to Analyze slider sets the
percentage of points that are analyzed in each instance that is
used for optimization. At the default 50% position, one out of
two points are used. Increasing this value can increase the
accuracy of the optimized model but may incur a longer
optimization time.
Executing a Model Optimization
Model optimization must be launched from the Model Panel of the Locator.
1.
To start an optimization process you must select an initial model in
the Models database.
HexSight Basics User Guide
383
Locator
2.
To launch the optimization, check the Model Optimizer Enable
checkbox then click Apply.
3.
Click Optimize to open the Model Optimizer window in which you
can change parameters and observe the progression of the
optimization process. See the Using the Model Optimizer
section for more details.
4.
Execute the Locator on various instances. While the optimization
process is running, each instance found by the Locator is added to
the current optimization. In the Model panel, the number of
instances processed appears to the right of the corresponding
model. In the Model Optimizer window the number of instances
used by the process appears in the Instance Analyzed textbox.
5.
The optimization can be restarted from the initial model by clicking
Reset All from the Locator interface or Reset from the Optimizer
window.
6.
To stop the optimization process and use the optimized model,
click Apply from the Model Optimizer window.
Model Disambiguation
• By default, model disambiguation is always enabled. The default
enabled state is recommended in most cases.
• Disabling Model Disambiguation can significantly the Learn
time when this is an issue.
IMPORTANT: D ISABLING M ODEL D ISAMBIGUATION WILL IMPAIR
L OCATOR ‘ S ABILITY TO DISCRIMINATE BETWEEN VERY SIMILAR
MODELS OR BETWEEN VERY SIMILAR HYPOTHESES OF AN OBJECT .
THE
Learn and Unlearn Commands
• Executing the Learn command initiates a Learn process without
executing the Locator. The next execution of the Locator will be
shorter because no Learn process will be need to be carried out.
HexSight Basics User Guide
384
Locator
• Executing the Unlearn command clears all the learned
information in memory. The next execution of the Locator will be
longer because the Locator will have to re-learn all the enabled
models in the Models database.
Using the Model Editor
The Model Editor is used to define new Models and to modify existing ones.
Once you have created the Model for a type of object or part, you will save
it for later use with any HexSight application.
he typical order of steps that you will use to build the Model are as follows:
• Set a Bounding Area to define the area of the input image that
will be used to build the Model.
• Set contour detection parameters for the source contours that
will be generated from the input image.
• Set feature selection parameters for the automatic selection of
model features.
• Launch the Build the command to generate a Model.
• Edit automatically selected features if necessary.
• Set the orientation and World position of the Object coordinate
system.
HexSight Basics User Guide
385
Locator
FIGURE 171 Model Editor
Model Creation
The Model Creation frame provides Contour detection and Feature
selection parameters as well as the Build command. The Contour
Detection parameters are the same as those available in the
Contour panel.
Teaching and Building a Model
To teach the Model, simply place and size the Bounding Area
marker around the region of interest in the display and click Build
Model.
• The default Contour Detection settings are recommended.
HexSight Basics User Guide
386
Locator
• Use the Feature Selection slider to increase or decrease the
amount of features that are selected from the source contours
when you teach the Model.
• Unless you want to specify the coarseness for the Outline and
Detail Levels, leave the Automatic Levels check box enabled.
• If you want to manually select all the features for a Model, set
Feature Selection to none, teach the Model with the required
Contour Detection parameters to detect the source contours,
then manually add features. See Adding Features to the
Model.
Automatic Levels
When the Automatic Levels check box is enabled, the Locator
automatically optimizes the Outline Level and Detail Level
values.
• Automatic Levels is the recommended mode.
• To manually set Outline and Detail Levels parameters you must
disable the Automatic Level check box.
Outline Level
The Outline Level provides a coarser level of contours than the
Detail Level. The Locator uses Outline contours to rapidly identify
and roughly locate potential instances of the object.
• The higher the setting (maximum 16), the coarser the contour
resolution.
• The Outline Level value can only be higher than, or equal to the
Detail Level.
HexSight Basics User Guide
387
Locator
Detail Level
The Locator uses Detail Level contours to confirm the
identification of an object instance and refine its location within the
image.
• The lower the setting (minimum 1), the finer the contour
resolution.
• The Detail Level value is always lower than, or equal to the
Outline Level.
Contrast Threshold
Contrast Threshold sets the Locator’s sensitivity to contrast used
in generating contours. With Adaptive settings, the Locator
automatically sets the numerical value according to the input
image.
• The default Normal Adaptive Sensitivity is recommended for
most applications.
• Adaptive High Sensitivity accepts lower contrasts and
therefore results in a greater number of source contours.
Adaptive Low Sensitivity retains high-contrast contours and
removes lower contrast contours, such as those caused by noise
and shadows.
• Fixed Value requires that you manually set the Contrast
Threshold value, expressed in terms of a step in greylevel
values that ranges from 0 to 255. Higher values reduce
sensitivity to contrast, resulting in fewer, high-contrast contours.
Conversely lower values increase sensitivity and add a greater
amount of source contours.
• The Fixed mode is useful for controlled environment applications
in which only contours above a predefined threshold should be
processed.
HexSight Basics User Guide
388
Locator
Tracking Inertia
Setting the Tracking Inertia slider to 1 can close small gaps that
appear in the source contours.
Build Model
Build Model initiates the model creation process, which clears the
current Model, re-detects the source contours using the new
settings and selects features from the source contours according to
the setting of the Feature Selection slider.
• The Message frame displays messages pertaining to the model
creation process, including problems that the Locator
encountered in building the Model or potential problems it may
encounter with this Model in the search process.
• Build Model does not make any changes to reference points or
to the coordinate system.
Show Options
Options in the Show box modify the characteristics of the display
window but do not affect the optimization process.
Image
When Image is enabled, the Model Editor display shows the source
grey-scale image used to build the Model. When disabled, the
display shows only the source contours that were detected in the
Bounding Area.
• Three Image display modes are available: dim, normal and
bright. These modes only affect the appearance of the image in
the Model Editor. The actual greylevel values are not modified.
• Switching to a different display mode may help to better
visualize elements of the display such as the source contours or
the axes marker.
HexSight Basics User Guide
389
Locator
Bars
When Bars is enabled, the rulers, scroll bars and the information
bar of the Model Editor display are visible.
Bounding Area
The Bounding Area, represented in the display as a green
rectangle, defines the area of the current image that will be used to
create the Model.
• Adjust the size of Bounding Area in the display by dragging any
of the eight corner and side handles.
• You can also position and size the Bounding Area by selecting
or entering values in the Bottom, Top, Left and Right spin-edit
boxes.
Editing Models
The Locator creates features once you use the Build Model
command in the Model Editor. However you may need to edit the
Model to the needs of your application. For example, you may not
need the entire contour of a feature.
Adding Features to the Model
You can manually select and add features to a Model once it has
been built. Added features can be created at either the Detail Level
or the Outline Level.
Follow the steps below to add features to the model. Added
features appear in the Features sub-panel, at bottom left of the
Model Editor interface.
• You cannot edit an existing feature. You must first delete the
feature then create a new feature from the required portion of
contour.
HexSight Basics User Guide
390
Locator
• In the display, select the level in which you will create the
feature: Outline or Detail.
• If you want to manually select all your model features, set the
Feature Selection slider to none, then click Build Model.
• Select the feature either by clicking on its description in grid of
the Features tab, or by clicking on the feature in the display.
• To select the entire contour, double-click on the contour.
• To select only a section of a contour, left-click a starting point on
the contour. Hold the Ctrl key and click the end point of the
portion you want to select.
• To modify (add or subtract) from the selected contour section,
hold the Ctrl key while clicking elsewhere on the line segment.
• To invert the your selection, hold the Shift key while clicking on
the contour. This is useful for selecting the complementary
portion of a closed contour.
• Clicking Add adds the selected feature to the list of features in
the Features sub-panel (tab-selected).
Removing Features from the Model
Use the grid in the Features sub-panel to delete features from the
Model or work directly in the display.
• Select the feature you want to remove: the feature appears in
the display as a bold red contour.
• Click Delete to remove the feature.
Keyboard Combinations in the Model Editor Display
The following table describes keyboard combinations that can be
useful for selecting features, in the Model Editor Display.
TABLE 14
Model Editor Selection Keys
HexSight Basics User Guide
391
Locator
Key combinations
Effect on an existing feature
Effect on a contour (blue)
[Click]
Selects the feature.
Selects a segment on the
contour and highlights the entire
unbroken contour.
CTRL+[click]
Selects/Deselects the feature.
Allows selection of multiple
features.
Removes/adds segments to the
selected contour.
[Double-Click]
Selects the feature.
(same as [Click])
Selects the entire unbroken
contour or selects the contour
sections required to close an
unbroken contour that already
contains existing features.
SHIFT+[click]
Selects the feature.
(same as [Click])
Toggles the selected/nonselected portions of the contour.
[Drag]
Selects only the features
entirely contained in the
dragged area
No effect
CTRL+[Drag]
Adds the features entirely
contained in the dragged area
to the selection.
No effect
ALT+[Drag]
No effect.
Selects all contour sections
included in the dragged area.
CTRL+ALT+[Drag No effect.
]
Adds all contour sections
included in the dragged area to
the selected contours.
Feature Sub-Panel
The grid in Features sub-panel lists the features that constitute
the Model. The Required and Location properties can be enabled/
disabled independently for each feature in the grid.
HexSight Basics User Guide
392
Locator
Enables the Locator to
use the feature in
calculating the location
of an object
Makes the presence of a
feature required for the
Locator to find valid
instance of the object
FIGURE 172 Model Editor — Features Sub-Panel
Location
When Location is enabled for a feature, this feature is used by the
Locator to calculate the location of object instances. Features
enabled for Location should be stable. If Location is disabled, the
feature is used only for object recognition.
• For example, a tag or label that is glued to an object often varies
in position. Such a label is a good candidate for object
recognition but should not be used for determining the precise
location of an object.
Required Features
When the Required check box is enabled, the Locator will not
identify an object in which the Required feature has not been
found.
• A feature can be enabled as Required even if it is not used for
Location.
Choosing Features for the Model
The following considerations should be taken into account when
selecting features used to create the Model.
HexSight Basics User Guide
393
Locator
• Select features that are stable, that is features that remain fixed
or stable on all occurrences of the part or object you are
modeling.
• Select features that distinguish the part from the background
and from other similar parts or objects that will be processed
within the same application.
Reference Points Sub-Panel
Reference Points indicate the location of points of interest on an
object. Their arrangement remains rigid in the Object coordinate
system. Reference Points are not observable features and thus are
not used by the Locator for recognition. They are simply a set of
coordinates that are transformed according to the pose of
recognized instances of the model.
Adding Reference Points
Reference points appear as target-shaped markers. To add
reference point:
• Select the Reference Points tab (Figure 173) then click Add.
• The reference point appears as a red target marker in the
display. Drag the marker to the spot on the object you wish to
identify with a reference point.
• You can also enter and adjust the reference point position by
manually entering X-Y coordinates in the appropriate text boxes.
• To remove a reference point, select it and then click Delete.
HexSight Basics User Guide
394
Locator
Reference point
coordinates with
respect to the
Object coordinate
system
FIGURE 173 Model Editor — Reference Points Sub-Panel
Coordinate System Sub-Panel
The Coordinate System sub-panel (Figure 174) sets the origin
and the orientation of the Object coordinate system of the Model.
By default, its origin is set at the center of the image and its
orientation is set to zero degrees. To manually set or change the
Object coordinate system parameters:
• Displace the coordinate system origin by dragging its marker in
the display. Rotate the axes by dragging the X or Y extremity of
the marker.
• You can lengthen the axes of the marker to help you align the
coordinate system. Lengthening the axes marker has no impact
on the Object coordinate system.
• You can also manually enter the required coordinates and
orientation.
X and Y Position
These editable text boxes show the position of the Object
coordinate system’s origin within the World coordinate system.
HexSight Basics User Guide
395
Locator
Position and rotation
of Object coordinate
system with respect to
the World coordinate
system
FIGURE 174 Model Editor — Coordinate System Sub-Panel
Rotation
The editable rotation text box, indicated by an angle icon, shows
the orientation of the Object coordinate system with respect to the
World coordinate system of the image used to teach the model.
Center
With a feature selected in the Model Scene, Center sets the origin
of the Object coordinate system at the feature’s center of gravity.
Move Reference Points with Axes
If you have created reference points in your model, this option will
lock their position with respect to the coordinate system marker.
• Use this option if your reference points have been manually set
by their values, with respect to known coordinates on the object.
If you readjust the coordinate system origin, you will not have to
re-enter the new Reference Point positions.
Model Editor Command Buttons
• The Add button adds a selected feature or a reference point to
the Model.
• Delete removes the selected feature or reference point from the
Model.
HexSight Basics User Guide
396
Locator
• Locate repositions the display view so that the selected feature
or reference point appears at center of the Model display.
• Analyze Model analyzes a Model that you have manually edited
or created. A set of messages reports the results of this analysis
in the Messages frame.
• Crop Model reduces the Model to the area contained within the
Bounding Area. The cropped grey-scale image may slightly
exceed the limits of the bounding box. Cropping the Models
reduces the size of the Model database and can help reduce
runtime memory usage and database load/save time,
especially in multi-model applications.
Note: Once you have cropped the Model you cannot return to the original
grey-scale Image you used to build the Model.
• Revert undoes any modifications made since the last Apply or
OK.
• Apply registers changes made to the Model; the Model Editor
remains open.
• OK applies the latest modifications made to the Model and closes
the Model Editor.
Cancel closes the Model Editor window and cancels all
modifications made to the Model since the last Apply or OK.
Messages
The Message frame provides a brief report on Model building as
well as troubleshooting information to help resolve Model creation
or edition problems. The complete list of messages is provided in
Table 11 of the Understanding Locator Concepts section.
HexSight Basics User Guide
397
Locator
Using the Model Optimizer
Model Optimizer Window allows you to set parameters for the optimization
process and observe the progression of the Model that is being optimized.
To open the Model Optimizer window, illustrated in Figure 175, click the
Optimize command from the Model panel of the Locator interface.
FIGURE 175 Model Optimizer Window
Setting Model Optimization Parameters
Model optimization parameters can be set independently for both the Detail
and Outline level of the model.
Link to Detail
When Link to Detail is enabled, the tool automatically sets Outline
level settings relative to the Detail level settings.
HexSight Basics User Guide
398
Locator
• Link to Detail should typically be enabled.
• To manually set Outline level parameters you must disable Link
to Detail.
Morph to Average Shape
Morph to Average Shape enables the Optimization process to add
recurring features that were not present in the initial model.
• If you disable Morph to Average Shape, features that were not
present in the initial model will not be appended to the optimized
model even if they recur within the required Minimum Feature
Recurrence.
• When Link to Detail is enabled, the Morph to Average Shape
state set for the Detail setting will be the same at the Outline
Level.
Minimum Feature Recurrence
Minimum Feature Recurrence sets frequency of recurrence that
is required for a feature to be retained and used for the
optimization process. For example, at the default setting of 50, a
feature will be retained for the optimized model only if it occurs in
at least 50% of all analyzed instances.
• If Link to Detail is enabled, the Outline level feature recurrence
is equal to the Detail level value minus ten (Minimum Feature
Recurrence - 10).
Instances Analyzed
The number of instances used for the current optimization process
is displayed in the Instances Analyzed frame.
Use the Reset command at any time to restart the optimization
process from the initial model. The Instances Analyzed counter
will be reset to 0.
HexSight Basics User Guide
399
Locator
Show Options
Options in the Show box modify the characteristics of the display
window but do not affect the optimization process.
Image
When Image is enabled, the Model Optimizer display shows the
source grey-scale image used to build the Model. When disabled,
the display shows only the source contours that were detected in
the Bounding Area.
• Three Image display modes are available: dim, normal and
bright. These modes only affect the appearance of the image in
the Model Optimizer. The actual greylevel values are not
modified.
• Switching to a different display mode may help to better
visualize elements of the display such as the source contours or
the axes marker.
Bars
When Bars is enabled, the rulers, scroll bars and the information
bar of the Model Optimizer display are visible.
Current Instances
The Current Instance grid displays the Locator results for each
object instance found in the current image. When multiple
instances of the object are found in the same image, as illustrated
in Figure 176, all found instances are used and appended to the
optimized model.
HexSight Basics User Guide
400
Locator
FIGURE 176 Model Optimizer - Multiple Instances from Single Image
Model Optimizer Display
Use the lower tabs of the Model Optimizer to view the following:
Outline Model: Shows the Outline Level of the Model. This display
shows the changes made to the Outline model as new instances are
added to the optimization.
Initially, all contours are displayed in blue. After the first execution,
Outline level features are displayed in magenta and the deviation
between the current features and the initial features are displayed
in orange.
Detail Model: Shows the Detail Level of the Model. This display
shows the changes made to the Detail model as new instances are
added to the optimization. See Figure 177.
HexSight Basics User Guide
401
Locator
Initially, all contours are displayed in blue. After the first execution,
Detail level features are displayed in green and the deviation
between the current features and the initial features are displayed
in orange
Outline Instances: Shows the Outline level of the instances found
in the current input image.
Detail Instances: Shows the Detail level of the instances found in
the current input image.
FIGURE 177 Mode Optimizer Display — Detail of Model Progression
HexSight Basics User Guide
402
Locator
Search Panel
Use this panel to configure the Search Constraints and Recognition
parameters for the Locator.
Search constraints
Recognition effort
slider
Recognition
parameters
Positioning speed
slider
FIGURE 178 Locator — Search Panel
Search Constraints
Use Search Constraints to restrict the Locator’s search process,
for example to a specific range of poses or a to specific number of
instances.
Scale Factor
Scale constrains the range of scale factors the Locator will search
for.
• Enable Nominal to search for a specific scale factor. Note that
when a nominal value is used, the Locator does not compute the
actual scale of instances; instead the instances are positioned
using the Nominal scale value.
HexSight Basics User Guide
403
Locator
• Disable the Nominal check box to specify the range of scale the
Locator will search for. If you want to search for an instance at a
nominal scale factor but need to compute its actual scale, disable
the Nominal check box and enter a small range such as 0.99 to
1.01.
• A Nominal scale factor of 1 is set by default
Rotation
Rotation constrains the rotation range the Locator will search for.
• Enable Nominal to search for objects at a specific angle of
rotation. Note that when a nominal value is used, the Locator
does not compute the actual rotation of instances; instead the
instances are positioned using the Nominal rotation value.
• Disable the Nominal check box to specify the range of rotation
the Locator will search for. If you want to search for an instance
at a nominal rotation but need to compute its actual rotation,
disable the Nominal check box and enter a small range such as
89 to 91.
• The maximum rotation range of -180 to 180 is set by default.
Instances to Find
Instances to Find determines the maximum number of instances
that can be searched for, regardless of Model type.
• By default, the number of instances that can be found is
theoretically unlimited. To optimize search time you should set
this value to no more than the expected number of instances.
• When the actual number of instances exceeds the Instances to
Find value, the Locator stops once it attains the set value.
Timeout
Timeout sets a limit to the Locator’s search time.
HexSight Basics User Guide
404
Locator
• When the Timeout value is attained, the Locator outputs only
the instances found up to the moment of the Timeout.
Instance Ordering
Use the Instance Ordering combo box to select the order in which
object instances are output.
• The default Evidence mode outputs instance results in order of
their hypothesis strength.
• The Quality mode outputs results in order of their Match
Quality. Instances with the same Match Quality are further
ordered according to their Fit Quality.
• Image Distance orders instances according to their proximity
to a specified point (X,Y coordinates) in the Image coordinate
system.
• World Distance orders instances according to their proximity to
a specified point (X,Y coordinates) in the calibrated World
coordinate system.
• The other available ordering modes output instances according
to their position in the image: Topmost, Bottommost,
Leftmost or Rightmost.
• Shading Consistency orders instance according to their
consistency with the shading in the Model.
Locate All Symmetric Instances
If objects in your application are symmetrical or nearly symmetrical
in shape, the Locate All Symmetric Instances constraint enables
the Locator to provide results for all possible variations in position
based on the Scene observation (not the Model).
• Due to partial occlusion, an object may appear symmetrical
although it is not symmetrical in the Model.
HexSight Basics User Guide
405
Locator
• If this constraint is disabled, only the first best quality instance of
a symmetric object will be located.
Based on Outline Level Only
When Based on Outline Level Only is enabled the Locator
searches for object instance using only the Outline Model and
Outline Level contours.
• Based on Outline Level Only should be enabled only for
applications that do not require a high positioning accuracy.
Contrast Threshold
Contrast Polarity indicates the change in polarity between an
object and its background. The reference polarity is the polarity in
the model image.
• Select Normal to search for objects having the same contrast
polarity as the model and its background.
• Select Reverse if the polarity between object instances and the
background is the inverse of the polarities in the Model image.
For example dark object instances on a light background using a
model created from a light object on a dark background.
• Select Normal & Reverse when object instances can present
either contrast polarity and when there are no local reversals in
polarity along the contours of the object
• Select the Don’t Care mode only in cases where there are local
changes in polarity along an object contour. A typical example is
a case in which the background is unevenly colored: striped,
checkered, spotted for example.
HexSight Basics User Guide
406
Locator
Recognition
Use recognition parameters to configure the specific search process
requirements of the application. Examples of special application
requirements include:
• Tolerance to variations in objects contours
• Tolerance to occlusion where the Locator must be able to identify
objects that might possibly overlap.
• Very low contrasted and noisy images.
Recognition Effort Slider
The Recognition effort slider ranges between Quick and
Exhaustive, with the default center position providing an
optimized setting for most applications.
• When changing the recognition effort, test your application to
find the optimum speed at which the Locator will still find all
necessary objects within the image.
• If recognition effort is too low (Quick), the Locator may ignore
some instances.
• If recognition effort is too high (Exhaustive), your application
will run in less than optimal time.
• Recognition speed does not affect positioning accuracy.
Use Default Conformity Tolerance
Disabling Use Default Conformity Tolerance allows you to
manually modify the Conformity Tolerance value.
Valid Conformity Tolerance Range
Valid Conformity Tolerance Range defines the upper and lower
limits for the Conformity Tolerance. This range, which is based
HexSight Basics User Guide
407
Locator
on the calibration and resolution of the input Image, cannot be
edited.
• You can only set Conformity Tolerance to a value within this
range.
Conformity Tolerance
Conformity Tolerance defines the maximum allowable local
deviation of instance contours from the expected model contours.
Its value corresponds to the maximum distance in calibrated units
by which a matched contour can deviate from either side of its
expected position.
• To manually set Conformity Tolerance you must disable the
Use Default Conformity Tolerance check box.
• If you set a value lower than the minimum Valid Conformity
Tolerance Range, this value will be automatically reset to the
minimum valid value.
• If you set a value higher than the maximum Valid Conformity
Tolerance Range, this value will be automatically reset to the
maximum valid value.
Minimum Model Percentage
Minimum Model Percentage sets the minimum amount of
matched contour required for the Locator to accept a valid object
instance.
• Lowering this parameter can increase recognition of occluded
instances but can also lead to false recognitions.
• A higher value can help eliminate instances in which objects
overlap.
HexSight Basics User Guide
408
Locator
Minimum Percentage of Required Features
Minimum Percentage of Required Features determines what
proportion of features that are defined as Required must be found
for an object instance to be valid.
Positioning Speed Slider
The slider provided for adjusting the positioning accuracy ranges
from Fast to Accurate.
• The more accurate the positioning, the longer the execution time
will be.
• The default center position of the slider is the optimized and
recommended setting for typical applications.
Results Panel
The Results panel provides results for all the instances found by the
Locator, diagnostic messages and access to the graphical display
through the Results Viewer.
HexSight Basics User Guide
409
Locator
Results for
located instances
Display options
Click to open
Results Viewer
Diagnostic
messages for
the Search
process
FIGURE 179 Locator — Results Panel
Grid of Results
Results for each located instance are displayed in the grid. They
can be expressed in either the Tool, Image or World coordinate
system, according to the setting of the Coordinate System
parameter. Depending on the selected coordinate system, some
values will not be output because they are non valid or nonsignificant in the selected frame of reference.
The following results are provided.
• The first column indexes instances in the order in which they
were found by the Locator, based on the Instance Ordering
parameter.
• The Model name identifies the Model upon which the Locator
based the recognition of the object instance.
HexSight Basics User Guide
410
Locator
• Scale is the ratio of the observed object size to its corresponding
model size.
• The Rotation of the object instance is calculated
counterclockwise between the X-axis of the World coordinate
system to the X-axis of the Object coordinate system of the
instance.
• X and Y Position are the X and Y coordinates of the instance’s
Object coordinate system, within the selected Coordinate
System. Position results are expressed in the unit system
selected in the General Panel.
• Fit Quality score ranges from 0 to 1, with 1 being the best
quality. This value is the normalized average error between the
matched model contours and the actual contours detected in the
input image.
• Match Quality ranges from 0 to 1, with 1 being the best quality.
A value of 1 means that 100% of the model contours were
successfully matched to the actual contours detected in the input
image.
• Symmetry off is the index number of the instance of which the
given instance is a symmetry of.
• Time shows the time needed to recognize and locate the
instance. The time needed to locate the first instance is typically
higher because it includes all the preprocessing.
Dynamic Update
By default, Dynamic Update is disabled: all the located instances
are displayed simultaneously after the Search process is complete.
HexSight Basics User Guide
411
Locator
When Dynamic Update is enabled, located instances are displayed
at the moment they are found.
Note: Enabling this Dynamic Update increases the execution time
so it is recommended mostly for diagnostic or demonstration
purposes.
Coordinate System
The Locator returns results in the selected Coordinate System:
• World coordinate system: Results are output and displayed in
the selected units (General Panel) with respect to the World
coordinate system of the input image.
• Image coordinate system: Results are output and displayed in
pixels. No scale, rotation, quality, time or symmetry results are
calculated in this reference system. Position is expressed with
respect to the uncalibrated image, (0,0) being the bottom left
pixel.
• Tool coordinate system: This corresponds to the Locator’s
Search Area (region of interest). Results are returned in pixel
values. No scale, rotation, quality, time or symmetry results are
calculated in this reference system. Position is expressed with
respect to the Search Area, (0,0) being the center of the
bounding box.
Results Viewer
Use Show Results Viewer to display Locator results with the
following options:.
• Show Grey-Scale Image displays the current input Image.
• Show Contour Scene Outline displays the Outline Level
contours.
• Show Contour Scene Detail displays the Detail Level contours.
HexSight Basics User Guide
412
Locator
• Show Instance Scene as displays the instances found by the
Locator. The instance selected (highlighted) in the grid of results
appears in red, all other instances appear in blue.
• Select one of two modes for displaying found instances:
Transformed Model or Matched Model. This will not affect the
display mode you may have set for the Instance Scene (Locator
output).
• Transformed Model displays the complete Model transposed
according to the pose computed by the Locator. This lets you
visualize the position of instances even when the objects are
partially hidden from view or when some of their contours have
not been found.
• Matched Model displays only the sections of the Model contours
that can be matched to the actual contours detected in the input
image. This allows you to visualize which portions or sections of
the instance have not been detected.
• Show Reference Points displays reference point markers.
• Show Coordinate System displays the Object coordinate
system markers.
• Show Search Area displays the Search Area bounding box.
Elapsed Time
• Learn time is the time required for the Learn during the
execution of the Locator. The time is also displayed for a learn
initiated by the Learn command.
• Search time is the total time used by the search process.
• Total time is the total time elapsed for the execution of the
Locator process, including the overhead, such as refreshing the
grid of results.
HexSight Basics User Guide
413
Locator
Messages
The Message box displays messages that provide information on
the search process. The complete list of messages is provided in
the in Table 12 of the Understanding Locator Concepts section.
HexSight Basics User Guide
414
Inspection Tools
Inspection Tools
This chapter introduces the basic notions and procedures needed for
setting up and using HexSight inspection tools as well as other HexSight
tools that can be model-based.
Inspection Tools
List and Description of HexSight Tools
Inspection Tool Basics
Rectangle Characteristics
Sector Characteristics
Tool Positioning Modes
Using Inspection Tools
Basic Method
General Panel
Location Panel
Transform Panel
Configuration Panel
Results Panel
HexSight Basics User Guide
415
Inspection Tools
List and Description of HexSight
Tools
This section lists HexSight tools that are documented in greater detail in a
the HexSight Tools User Guide, which can be installed from the
HexSight installation CD. The content of the User Guides and the HexSight
Reference Manual is contained in the online HexSight HTML Help.
Finder Tools
Arc Finder: The Arc Finder finds and locates circular features on
objects and returns the coordinates of the center of the arc, the
start and end angles, and the radius.
Line Finder: The Line Finder finds and locates linear features on
objects and returns the line angle and point coordinates.
Point Finder: The Point Finder finds and locates point features on
objects and returns the angle as well as the coordinates of the
found point.
Builder: The Builder creates geometric entities such as points,
lines or arcs from user-defined parameters or by combining other
geometric entities.
Image Processing Tools
Image Processing Tool: The Image Processing Tool processes
grey-scale images by applying arithmetic, assignment, logical,
filtering, morphological or histogram operators. Users can define
custom filtering operators.
Note: This tool cannot be model-based. It is typically used to
preprocess images that will be used by other HexSight tools.
HexSight Basics User Guide
416
Inspection Tools
Image Sharpness Tool: The Image Sharpness Tool computes the
sharpness of preponderant edges in a user-defined region of
interest.
Image Histogram Tool: The Image Histogram tool computes
greylevel statistics within a user-defined region of interest.
Sampling Tool: The sampling tool is used to extract a section of a
grey-scale Image and output it as a separate Image. The sampling
tool can be configured to operate as model-based. It can be used
by a HexSight application to apply a custom grey-scale processing
on a region of interest on an object.
Inspection Tools
Edge Locator: The Edge Locator finds and locates an edge or a set
of edges that meet user-defined criteria.
Arc Edge Locator: The Edge Locator finds and locates an edge or
a set of edges in an arc- or circular-shaped area.
Caliper: The Caliper finds and locates one or more edge pairs and
measures distances between the two edges within each pair.
Arc Caliper: The Arc Caliper finds and locates one or more edge
pairs on an arc or circular shaped area and measures distances
between the two edges within each pair.
Pattern Locator: The Pattern Locator finds and locates instances
of a greyscale pattern occurring within an Image. Pattern images
are provided by the HexSight Locator control.
Blob Analyzer: The Blob Analyzer finds and locates blobs within a
defined area on an Image and returns various results for each blob.
Symbology Tools (optional)
Barcode Reader: The Barcode Reader reads and extracts
information from 1D symbologies commonly known as bar codes.
HexSight Basics User Guide
417
Inspection Tools
Data Matrix Reader: The Data Matrix Reader reads and extracts
information from 2D symbologies commonly known as data
matrixes.
OCR Fixed Font: The OCR Fixed Font tool recognizes and reads
fixed-font character strings.
HexSight Basics User Guide
418
Inspection Tools
Inspection Tool Basics
This section explains the basic terms and notions used in the Inspection
tools. Inspection tools use pixel greylevel values within bitmapped images
to process information.
Inspection tools are applied on a specific area of an Image corresponding
to a set of features to be analyzed. This area, or region of interest, within
which an inspection tool carries out its action, is usually bounded by a
user-defined affine rectangle, simply referred to as the Rectangle. In Arc
inspection tools the user-defined region of interest is a Sector instead of a
Rectangle. This chapter mostly covers Rectangle regions of interest but the
concepts usually apply to Sector regions of interest.
All Inspection tools can use a Model-based positioning mode that facilitates
the development and implementation of HexSight applications.
Rectangle Characteristics
The properties used to define the Rectangle region of interest, are its
position, height, width, rotation and skew.
Tool Coordinate System
The center of the Rectangle, defined as the intersection of
diagonals joining opposing corners, determines the origin of the
Tool coordinate system. The Tool coordinate system is displayed as
an X-Y axes marker in the HexSight interface. See the Coordinate
Systems chapter of this guide for more details.
Rectangle Position
The Rectangle’s position is specified as the X-Y coordinates of the
Tool coordinate system origin.
The coordinate system and unit system used to express the
Rectangle position depend on which tool positioning mode is
HexSight Basics User Guide
419
Inspection Tools
configured. See the Tool Positioning Modes section for more
details.
Y
Rectangle
Height
Tool coordinate system
X
Width
FIGURE 180 Inspection Tool Rectangle
Height and Width
The Rectangle’s height corresponds to the length of its Y-axis side.
The Rectangle’s width corresponds to the length of its X-axis side.
The coordinate system and unit system used to express the
Rectangle width and height depend on which tool positioning mode
is configured. See the Tool Positioning Modes section for more
details.
Rotation
Rotation is the angle between the Rectangle’s X-Axis and the X-Axis
of the coordinate system used for tool positioning. This coordinate
system depends on the positioning mode that is configured. See
the Tool Positioning Modes section for more details.
HexSight Basics User Guide
420
Inspection Tools
Y
XT
YT
Tool coordinate
system
Angle of Rotation
X
Positioning coordinate system
FIGURE 181 Rotation
Skew
Skewing can be used with some Inspection tools for matching the
inclination of features within an object. The angle of skew is
defined as the angle between the Y-axis of an orthogonal Tool
coordinate system and the Y-axis of the skewed Tool coordinate
system.
Y
Y’
Angle of skew
Tool coordinate system
X
FIGURE 182 Skew
HexSight Basics User Guide
421
Inspection Tools
Sector Characteristics
The properties used to define the Sector are its position, opening,
thickness, rotation and radius.
Y
Thickness
Bisector
Angle of opening
Annulus
Position (Origin)
Angle of rotation
Radius
X
Positioning coordinate system
FIGURE 183 Inspection Tool Sector
Tool Coordinate System
The origin of the Sector determines the origin of the Tool coordinate
system. This origin corresponds to the intersection of the two
bounding radii shown as dotted lines in the HexSight interface. The
Sector defines a polar coordinate system that can only be used to
measure angles and radii. While radii are expressed with respect to
the origin, angles are expressed with respect to the orientation of
the bisector. Thus, for a given Sector, the radius values range from:
(Radius - (Thickness/2)) to (Radius + (Thickness/2))
and angle values are defined between:
(- Opening/2) and (Opening/2).
Sector Position
The Sector’s position is specified as the X-Y coordinates of the Tool
coordinate system origin.
HexSight Basics User Guide
422
Inspection Tools
The coordinate system and unit system used to express the Sector
position depend on which tool positioning mode is configured. See
the Tool Positioning Modes section for more details.
Opening
The Sector’s opening is defined as the angle between its two
bounding radii.
Thickness
The Sector’s thickness corresponds to the radial distance between
its two bounding annuli.
The coordinate system and unit system used to express the Sector
thickness depend on which tool positioning mode is configured. See
the Tool Positioning Modes section for more details.
Rotation
Rotation is the angle between the Sector’s bisector and the X-Axis
of the coordinate system used for tool positioning. This coordinate
system depends on the positioning mode that is configured. See
the Tool Positioning Modes section for more details.
Radius
The Sector’s radius corresponds to the radius of its median
annulus.
The coordinate system and unit system used to express the Sector
radius depend on which tool positioning mode is configured. See
the Tool Positioning Modessection for more details.
Tool Positioning Modes
HexSight Inspection tools provide four positioning modes that can be
useful, depending on the application. These positioning modes are:
• Image-Based Uncalibrated Mode
HexSight Basics User Guide
423
Inspection Tools
• Image-Based Calibrated Mode
• Model-Based Manual Mode
• Model-Based Automatic Mode
The following sections describe the basic concepts of these modes, along
with the coordinate system and unit used to express tool positioning.
Image-Based Uncalibrated Mode
This is the most basic tool positioning mode. It is typically used to
take uncalibrated measures on specific parts of an image. When
this mode is used in an inspection application, it usually requires
the inspected object to be somewhat fixtured.
• Positioning coordinate system: In the Image-based
Uncalibrated mode, the tool is positioned with respect to the
Image coordinate system as shown in Figure 184.
Y
I
YT
XT
Tool
coordinate system
Image coordinate system
XI
FIGURE 184 Image-Based Uncalibrated Mode: Relationship
between Tool and Image Coordinate Systems
• Units used for positioning: Since the Image coordinate
system is used to position the tool, X and Y positions as well as
Rectangle width and height must be expressed in pixels.
Rotation and skew can be expressed either in degrees or in
HexSight Basics User Guide
424
Inspection Tools
radians depending on the units selected with the Orientation
Units combo box.
• Results: In this positioning mode, inspection results can only be
returned with respect to the Tool coordinate system and the
Image coordinate system. Dimensions and positions are always
expressed in pixels in the Image-based Uncalibrated mode.
Image-Based Calibrated Mode
This mode is similar to the uncalibrated positioning mode, except
that the World coordinate system is used to position the tool
instead of the Image coordinate system. This mode is typically
used to take calibrated measures on specific parts of an image. In
this positioning mode, the tool is fixed with respect to the World
coordinate system; part fixturing is therefore usually required.
• Positioning coordinate system: In the Image-based
Calibrated mode, the tool is positioned with respect to the World
coordinate system as shown in Figure 185.
Y
W
Y
I
YT
XT
Tool
coordinate system
Image coordinate system
XI
World coordinate system
X
W
FIGURE 185 Image-Based Calibrated Mode: Relationship
between Tool and World Coordinate Systems
• Units used for positioning: As its name implies, the Imagebased Calibrated mode uses calibrated units to express the
HexSight Basics User Guide
425
Inspection Tools
Rectangle’s X and Y positions, as well as its width and height.
The actual calibrated units used for these dimensions are set
with the Length Units combo box in the General panel. Rotation
and skew can be expressed either in degrees or in radians,
depending on the units selected with the Orientation Units
combo box.
• Results: In the Image-based Calibrated positioning mode,
inspection results can be returned in one of the following
coordinate system:
The Tool coordinate system
The World coordinate system
The Image coordinate system
Dimensions and positions are expressed in calibrated units in the
World and Image coordinate systems while pixels are used in the
Image coordinate system.
Model-Based Manual Mode
When building an inspection application where the parts to be
inspected are not fixtured, HexSight Inspection tools provide a
model-based mode in which the tool is positioned on a Model
Image. A transform can then be applied to the tool to fit detected
instances of the object in the Image. In the Model-based Manual
mode, the Scale, Rotation and Translation components of the
transform must be provided by the vision application using the
Inspection tool. In addition to a Grey-Scale Image, you must
provide a Model onto which the tool will be positioned.
• Positioning coordinate system: The Model-based mode is
designed for the inspection of randomly oriented parts. The
coordinate system used to position the tool is the Object
coordinate system defined in the Model, as shown in Figure 186.
HexSight Basics User Guide
426
Inspection Tools
Y
W
Y
I
Object
coordinate
system
Yo
Y
T
Xo
X
X
I
Image coordinate system
World coordinate system
T
Tool
coordinate
system
X
W
FIGURE 186 Model-Based Mode: Relationship between Tool and
Object Coordinate Systems
• Units used for positioning: Since reliable object location can
only be carried out with calibrated images, Model-based
positioning uses calibrated units to express the Rectangle’s X
and Y positions as well as its width and height. The actual
calibrated units used for these dimensions are set with the
Length Units combo box in the General panel. Rotation and skew
can be expressed either in degrees or radians, depending on the
units selected with the Orientation Units combo box.
Tool Transform Steps in Model-Based Positioning
With Model-based positioning, the Rectangle is placed with respect
to the Object coordinate system defined in the Model. To fit the
inspection tool to an instance of the object in the image, the
transform provides four (4) parameters: Scale, Rotation,
Translation X and Translation Y. The transform components are
applied in the following order:
1. Scale Factor
2. Rotation
3. Translation
HexSight Basics User Guide
427
Inspection Tools
The following figures illustrate how the transform components are
used to position the Rectangle on an object instance.
Tool Position Before a Transform
Figure 187 shows that the Tool coordinate system is positioned and
oriented with respect to the Object coordinate system.
Y
W
Object
coordinate
system
Yo
Y
T
X
Xo
T
Tool
coordinate
system
World coordinate system
X
W
FIGURE 187 Model Rectangle Positioning
Before the transform is applied, the Rectangle is positioned as if the
origin of the Object coordinate system was moved to the origin of
the World coordinate system, with a scale factor of 1 and no
rotation. See Figure 188.
HexSight Basics User Guide
428
Inspection Tools
Y
W
XT
Instance to be
inspected
YT
Yo
Xo
World coordinate system
X
W
FIGURE 188 Tool Positioning before Transform is Applied
First Transform Step
The Rectangle is scaled to match the scale factor of the instance to
be inspected. See Figure 189.
Y
W
YT
Instance to be
inspected
XT
Yo
Xo
World coordinate system
X
W
FIGURE 189 Tool Positioning after Scale is Applied
Second Transform Step
The Rectangle is rigidly attached to the Object coordinate system,
which is rotated to match the orientation of the instance to be
inspected. See Figure 190.
HexSight Basics User Guide
429
Inspection Tools
Y
W
XT
Instance to be
inspected
YT
Yo
Xo
World coordinate system
X
W
FIGURE 190 Tool Positioning after Rotation is Applied
Third And Last Transform Step
The Object coordinate system is translated to fit the instance to be
inspected. See Figure 191.
XT
Y
W
Y
T
Yo
World coordinate system
Xo
X
W
FIGURE 191 Tool Positioning after Translation is Applied
The transform concept can be very useful in inspection applications
where the objects are randomly placed. Instead of repositioning the
tool in the World coordinate system according to the pose of the
object by modifying the Rectangle properties, the pose information
HexSight Basics User Guide
430
Inspection Tools
can be input directly. This is particularly useful when the Rectangle
is offset with respect to the Object coordinate system origin, in
which case this offset must be taken into consideration when
applying a rotation to position the tool in the World coordinate
system. In the Model-based Manual mode, the components of the
transform must be provided by the application.
Results in Model-based Manual Mode
In the Model-based Manual positioning mode, inspection results can
be returned in one of the following coordinate systems:
The Tool coordinate system
The Object coordinate system
The World coordinate system
Image coordinate system
Position and dimensions in the Tool, Object and World coordinate
systems are expressed in calibrated units, while pixels are used in
the Image coordinate system.
• The Tool coordinate system is mostly useful for applications in
which the position of a feature must be compared to an expected
position. In such applications, you position the Rectangle in a
manner that the origin of the Object coordinate system coincides
with the expected position. Positions returned in the Tool
coordinate system then correspond directly to the offset from
the expected position.
• The Object coordinate system is typically used to measure the
position of features with respect to a specific point on an object.
In such applications, you define the Object coordinate system on
the Model to make its origin coincide with the point from which
positions have to be measured. Positions returned in the Object
HexSight Basics User Guide
431
Inspection Tools
coordinate system directly correspond to the required
measurements.
• The World coordinate system is used in applications where
the absolute position of features must be known. Positions
returned in the World coordinate system can be used to directly
control actuators.
• The Image coordinate system can directly return the position
of features in the grey-scale Image. It is mostly useful for image
processing applications.
Model-Based Automatic Mode
The Model-based Automatic positioning mode is conceptually the
same as the Manual mode. The only difference is transform
components are automatically applied from an object instance
located by the Locator instead of being provided manually. This
mode greatly reduces the amount of code needed to carry out the
inspection task
• In addition to a Grey-Scale Image and a Model, you must
provide an Instance Scene output by the Locator. The instance to
be inspected is selected using the Instance selection Index from
text box in the Transform panel. The transform components for
this instance are shown but are read only.
• This mode is ideal for applications that require inspection of
randomly oriented parts. A Model is used by the Locator to find
and locate instances. An inspection tool positioned on the same
Model can then be transposed automatically by specifying a
selection index in the Instance Scene created by the Locator.
Positioning Mode Summary
The following table summarizes the similarities and differences
between the different tool positioning modes.
HexSight Basics User Guide
432
Inspection Tools
TABLE 15
Positioning Modes Summary
Image-based
Model-based
Uncalibrate
d
Calibrated
Manual
Automatic
Disabled
Disabled
Enabled
Enabled
Lock Location Transform N/A
on a Selected Instance
N/A
Disabled
Enabled
Express Position, Size
Disabled
and Sampling Step using
Calibrated Units
Enabled
N/A
N/A
Positioning coordinate
system
Image
World
Object
Object
Units used for
positioning
pixels
Calibrated
Units
Calibrated
Units
Calibrated
Units
Units used to express
Results in the Image
coordinate system
pixels
pixels
pixels
pixels
Units used to express
Results in the World
coordinate system
N/A
Calibrated
Units
Calibrated
Units
Calibrated
Units
Units used to express
Results in the Object
coordinate system
N/A
N/A
Calibrated
Units
Calibrated
Units
Units used to express
Results in the Tool
coordinate system
pixels
Calibrated
Units
Calibrated
Units
Calibrated
Units
Input Grey-Scale Image
Required
Required
Required
Required
Apply transform to a
Model Defined Location
Input Model Scene
Not used
Not used
Required
Required
Input Instance Scene
Not used
Not used
Not used
Required
Sampling
Sampling refers to the procedure used by Inspection tools for gathering
values within the portion of a grey-scale Image bounded by the Rectangle.
Two sampling parameters, the sampling step and bilinear interpolation, can
be used to establish a proper tradeoff between speed and precision.
HexSight Basics User Guide
433
Inspection Tools
Bilinear Interpolation
The Rectangle’s axes are rarely aligned with the grid of pixels that
constitute the grey-scale Image, especially in Model-based modes.
Without interpolation, any given pixel within the Rectangle is
assigned the value of the Image pixel closest to the sampled pixel’s
center. This results in jaggedness and loss of precision. The bilinear
interpolation function smoothes out the jaggedness within the
sampled grey-scale image by attributing each pixel a value
interpolated from grey levels of neighboring pixels.
Detail from grey-scale Image with and without interpolation
Without bilinear interpolation
With bilinear interpolation
FIGURE 192 Bilinear Interpolation
When subpixel precision is required in an inspection application,
bilinear interpolation should always be enabled for the sampling
process. For applications where the speed requirements are more
critical than precision, non-interpolated sampling can be used.
Sampling Step
In the Rectangle-sampled Image, all pixels are the same size and
are square. The sampling step defines the height and width in
calibrated units of each of the Rectangle’s pixels.
• A default sampling step is computed by the inspection tool,
based on the average size, in calibrated units, of a pixel in the
Image. This default sampling step is usually recommended.
HexSight Basics User Guide
434
Inspection Tools
• For specific applications where a more appropriate tradeoff
between speed and precision must be established, the sampling
step can be modified by enabling the Custom check box in the
Location panel and by modifying the sampling step in the text
box.
• Increasing the sampling step value reduces the tool’s precision
and decreases the execution time.
• Reducing the sampling step can increase the tool’s precision but
can also increase the execution time. Undersampling can be
useful in applications where an approximate measure is
sufficient.
HexSight Basics User Guide
435
Inspection Tools
Using Inspection Tools
Inspection tools have a similar interface, or properties page, that is
composed of 5 tab-selected panels. For the initial setup and configuration
of an inspection tool, you will access these panels in order, from left to
right.
Panel tabs
Panel
Selection icon
Command bar
FIGURE 193 Inspection Tools — Panel Interface
The standard command buttons at the bottom of the panels are the same
as with other HexSight tools.
Basic Method
Preliminary Step: Execute the sequence of processes in the application’s
Process Manager so that all tools have generated the necessary Views and
Images in the runtime database.
HexSight Basics User Guide
436
Inspection Tools
1.
Instantiate and name the inspection tool in the same manner as all
other HexSight tools.
2.
Enter the Input and Output Views and Images.
3.
Enable the required positioning options.
4.
Place the tool’s Rectangle or Sector on the Image.
5.
Configure the tool’s settings.
6.
Execute the tool process
7.
Review the results then readjust settings as required.
General Panel
Inputs and outputs are set in the interface’s General panel. You will also
use this panel to configure a positioning mode.
Inputs
An Input Grey-Scale Image is always required. Depending on the
positioning mode, additional required inputs will include a Model
Scene and an Instance Scene. The selection icon lets you rapidly
select Input Views, Scenes and Images from a list of compatible
items in the runtime database.
Positioning Mode
Image-based or Model-based positioning is configured with the
Apply Transform to a Model Defined Location and Lock
Location Transform on a Selected Instance check boxes in the
General panel. Refer to the Tool positioning section for more details
on the usage of Image and Model-based positioning modes.
In the Image-based mode, only an Input Grey-Scale Image is
required. In the Model-based Manual mode, an Input Model Scene
is also required. To use the tool in the Model-based Automatic
HexSight Basics User Guide
437
Inspection Tools
mode, an Input Instance Scene must also be provided, in addition
to the Input Grey-Scale and Input Model Scene.
Process
description
Process name
Model-based
options
Model input
Units selection
FIGURE 194 Inspection Tools — General Panel
Inspection Tool Units
The Units frame is used to select the Calibrated units, used to
position the tool as well as to express the results computed by the
inspection tool in the Image-based Calibrated positioning mode and
in Model-based modes.
The Length combo box sets the units used to express dimensions
and positions. The Orientation combo box sets the units used to
express angles. Inspection tools incorporate unit conversion
capabilities, which means that results can be output using any of
HexSight Basics User Guide
438
Inspection Tools
the supported units, even though the Image is not calibrated with
the same units.
Note: When you modify the units with either the Length or the
Orientation combo boxes, changes are applied immediately. All
changes made to parameters since the last clicking of the Apply
button will be lost if one of the Units combo boxes is modified.
Location Panel
This panel presents a similar graphical interface for all Inspection tools. It
provides an Image display, called the Location Display, used for placing a
tool upon a specific area of the object. When the tool is Model-based, the
Location display shows the grey-scale Image of the Model, otherwise it
shows the Input grey-scale Image. Zoom features allow you to inspect the
Image in fine detail for an optimal placement of the tool.
Rectangle
properties
Rectangle
Display options
Display scroll bar
Sampling
parameters
Display status bar
Calibrated units
always enabled
for Model-based
tools
FIGURE 195 Inspection Tools — Location Panel
HexSight Basics User Guide
439
Inspection Tools
Location Display
Use the Location display to position a tool over the appropriate area
of an object. Right-click in the display for zoom options as needed,
or use the buttons in the tool bar. Refer to the Using HexSight
Displays section of this guide for more details on using the display.
X-Axis
World coordinate
system
Display Menu
(right-click)
Zoom Menu
Y-Axis
World coordinate
system
FIGURE 196 Inspection Tools — Location Display
The top and left sidebars show the X-Y coordinates. Coordinates are
always expressed in calibrated units in the Image-based Calibrated
and Model-based modes. In the Image-based Uncalibrated mode,
pixels units are used instead of calibrated units.
The status bar at the bottom of the display shows the X-Y
coordinates of the cursor at any given position, as well as
additional information such as pixel grey level values.
Location Display of a Model-Based Tool
• Shows the grey-scale Image of the Model.
• X-Y coordinates are those of the World coordinate system, in
calibrated units.
HexSight Basics User Guide
440
Inspection Tools
• Position, Rotation and Skew are defined with respect to the
Object coordinate system.
Location Display of an Image-Based Tool
• Shows the Input Grey-Scale Image.
• X-Y coordinates are those of the Image coordinate system or the
World coordinate system, depending on the setting of the
Calibrated Units check box.
• Position, Rotation and Skew are defined with respect to the
World or Image coordinate systems, depending on the setting of
the Calibrated Units check box.
Placing Rectangle within an Image
The Rectangle has eight side and corner handles that can be
dragged with the mouse. The Rectangle’s center point corresponds
to the origin of the Tool coordinate system. This point also
corresponds to the position of the Rectangle in the selected
positioning coordinate system.
The following guidelines will help you to properly place the
Rectangle used by HexSight Inspection tools.
• Adjust the position of the Rectangle by clicking and dragging
either its center point or its border. You can also set and refine
this position with the Position X and Position Y text boxes.
• Adjust the Width and Height of the Rectangle by clicking and
dragging one of the resize handles. You can also set dimensions
directly in the Width and Height text boxes. The Rectangle is
always resized with respect to its center point.
• Set the angle of rotation by clicking and dragging the X-Axis
arrow of the Tool coordinate system. You can also enter rotation
values directly in the Rotation text box.
HexSight Basics User Guide
441
Inspection Tools
• Set the angle of skew for the Rectangle by clicking and dragging
the Y-Axis arrow of the Tool coordinate system. You can also
enter rotation values directly in the Skew text box.
Bilinear Interpolation
Bilinear interpolation is enabled by default and is recommended for
applications requiring subpixel precision.
Sampling Step
The default sampling step is recommended for most applications.
The sampling step corresponds to the width and height of one pixel
in the sampled Rectangle, in calibrated units.
• To modify the default value, enable the Custom check box and
enter the new value in the text box.
• To restore the custom sampling step to its default value for the
current Image, click Set to Default.
• To return to the automatic sampling step computation mode,
disable the Custom check box.
• To return to the default value, click the Set to Default command
button.
Calibrated Units Check Box
Model-based tools always use calibrated units. Image-based tools,
by default, use pixels as the length unit. To express dimensions and
positions in calibrated units, for Image-based tools, you should
enable the Calibrated Units check box.
Transform Panel
This panel is only enabled when using Model-based positioning modes. It
contains transform components used to fit the inspection tool to object
instances. The display shows the Input Grey-Scale Image.
HexSight Basics User Guide
442
Inspection Tools
Location Panel
Model Image
Tool Rectangle
Transform Panel
Current instance
of an object
Instance Scene
with transposed
Rectangle
FIGURE 197 Location vs. Transform Display — Model-Based Tools
Figure 197 illustrates the difference between the displays in the Transform
panel and the Location panel.
In the Manual mode, you must enter the components of the transform
(Scale, Rotation and Translation) directly in the text boxes.
In the Automatic mode, the transform components in the text boxes are
read-only. Select the instance to be inspected with the Index text box in
the Instance frame.
The Type text box shows the name of the instance to which this instance
corresponds. Graphic markers are also overlaid to the Grey-Scale Image to
illustrate the Object coordinate system transposed to fit the instance
HexSight Basics User Guide
443
Inspection Tools
Configuration Panel
The Configuration panel is specific to each inspection tool. It is used to
configure the algorithm used for carrying out the inspection task.
Results Panel
The Results panel is specific to each Inspection tool. It shows the results of
the inspection that was carried out by the tool.
Results can be expressed with respect to the Tool coordinate system, the
Object coordinate system, the World coordinate system or the Image
coordinate system.
Units used to express calibrated results are set with the Units combo boxes
in the General panel.
HexSight Basics User Guide
444
Class Library
Class Librar y
The Class Library contains ActiveX controls that provide an external
access to an application’s runtime database (HSDatabase, HSView,
HSImage, HSScene, HSArc, HSLine and HSPoint), to error objects
(HSErrorObject) and to calibrations (HSCalibration)
The objects of the Class Library are intended to be used
programmatically. See the Reference Manual for more details on
the Class Library.
Class Library Chapter Outline
Relationship Between Database Objects
Visual Basic Example
Visual C++ Example
HexSight Basics User Guide
445
Class Library
Relationship Between Database
Objects
Seven Class Library objects constitute elements of a HexSight database.
This relationship is illustrated in Figure 198.
HSDATABASE
A collection of Views. Typically, an application uses a
single database, made up of multiple Views, each
containing a set of Images, Scenes and Entities. The
runtime database acts as a database exchange
HSVIEW
A collection of Database objects. A View can contain
any number and combination of the following HexSight
objects: Images, Scenes and Entities.
HSSCENE
HSIMAGE
A vectorized
A matrix of
HSARC
HSLINE
HSPOINT
description of
pixels, that
Objects
an object’s
represents an
generated by
contours.
object’s 2D
HexSight Finder
FIGURE 198 Relationship Between Database-Related Library Controls
HexSight Basics User Guide
446
Class Library
Visual Basic Example
This Visual Basic example shows how to create a new View in the
Database, add a new image in this View, copy the acquired Image in the
new image and then finally, modify the new Image, pixel by pixel.
Dim lManager As HSProcessManager
Dim lGSImage As HSImage
Dim lNewImage As HSImage
Dim lNewView As HSView
Dim lDatabase As HSDatabase
Set lManager = HSApplication1.ProcessManager
'Image acquisition is performed
lManager.Execute "Acquisition"
’lDatabase is used to access the
’Database of the HSApplication ’Control
Set lDatabase = HSApplication1.Database
’lGSImage is assigned to the HSImage "Grey-Scale Image" that
’is contained in the View "Acquisition"
Set lGSImage = lDatabase.Image("Acquisition", _
"Grey-Scale Image")
’A new View is added to the active Database
Set lNewView = lDatabase.AddView("New View")
’A new image is added to the View "New View"
Set lNewImage = lDatabase.AddImage( _
"New View", "New Image")
’The content of lGSImage is copied in lNewImage
lNewImage.Copy lGSImage.RawImagePointer, _
HexSight Basics User Guide
447
Class Library
lGSImage.Width, lGSImage.Height
’A process is applied to lNewImage
Dim x As Long
Dim y As Long
For y = 0 To lNewImage.Height
For x = 0 To lNewImage.Width
’All pixel values are decreased by 50
lNewImage.Pixel(x, y) = lNewImage.Pixel(x, y) - 50
Next x
Next y
HexSight Basics User Guide
448
Class Library
Visual C++ Example
The C++ example shows how to get access to an acquired Image and how
to directly process its pixel array.
HSProcessManager lManager =
mApplicationControl.GetProcessManager();
// Image acquisition is performed
lManager.Execute(COleVariant( "Acquisition" ),
COleVariant("Acquisition") );
HSDatabase lDBase = mApplicationControl.GetDatabase();
HSImage lGSImage = lDBase.GetImage("Acquisition",
"Grey-Scale Image");
// The image is accessed through a pointer to its pixel array
char *Ptr = (char *)(lGSImage.GetRawImagePointer());
int Width,Height;
Width = lGSImage.GetWidth();
Height = lGSImage.GetHeight();
// A process is applied to the pixel array int x,y;
for (y=0; y<Height; y++)
{
for(x=0; x<Width; x++)
{
int pos = Width*y + x ;
// All pixel values are decreased by 50
*(Ptr+pos) = *(Ptr+pos)-50;
}
}
HexSight Basics User Guide
449
Class Library
This example shows that any user-defined processing algorithm can be
easily applied to any Image in the runtime database.
HexSight Basics User Guide
450
Index
Index
Symbols
.bmp 230
.cal 290
.cfg 196
.dxf 381
.hac 207
.hdb 230
.hig 230
.hln 207
.hpt 207
.hsc 207
.hvw 207
A
Acquisition Device 213
Calibration sub-panel 289
Configuration panel 224
Contour detection 223
General panel 224
Grey-Scale Image 312
Image calibration 218
Image source 214
Input sub-panel 228
output 223, 311
Output sub-panel 311
Results panel 312
View 311
Visual Basic tutorial 38
Visual C++ tutorial 110, 111
Acquisition tab
DT-3152 243
DT-3157 249
PX610A 252
PXC200 259
Adaptive
Contrast Threshold 346
High Sensitivity 346
Low Sensitivity 346
Add Process 197
Adding
features to Model 390, 396
frame grabbers 232
new Models 382
HexSight Basics User Guide
reference point to Model 396
Reference points to Model 394
tools to an application 197, 202
virtual frame grabber 233
AGC gain control 263
Analyze Model 397
Application Control 193
accessing 194
available processes 198
commands 196
Explorer 202
general properties 208
Process Manager 195
Using 195
Applications
adding a HexSight Control 36, 104
building 201
constructing Main Form interface 34
constructing program interface 101
creating VB Form 34
creating VC++ project 100
Multi-model 319, 324, 332, 334, 342, 345,
363, 397
saving the configuration 196
Arc Finder 200
Area of interest 419
Automatic
Levels selection, Locator 323
Levels selection, Model 387
Automatic Calibration 222, 307
example 309
procedure 307
when to use 307
Automatic Levels 387
Automation properties 209
Axes marker, Model 395
B
Based on Outline Level Only 406
BGA applications 351
Bilinear interpolation
Inspection tools 442
Black Level, DT-3155 248
Blank Length, PX610A 255
Blob Analyzer
adding Visual Basic code 76
adding Visual C++ code 149
Visual Basic tutorial 71
451
Index
Visual C++ tutorial 144
bmp file format 207
bmp files
exporting to 230
importing 230
Bottommost order 405
Bounding Area, Model 390
Bright display mode 389, 400
Brightness
PXC200 261
Build Model 320, 389
Builder 201
Building a Model 386
BW Detect, PXC200 263
C
cal file format 290
Calibrated coordinate system 218, 219
Calibrated units
Inspection tools 442
Calibration
Automatic 222
Distortion LUT 221, 298
Distortion Model 222, 299
error 304
files 290
From Another Configuration 290
loading an existing calibration 290
Perspective 221, 295
portability 218
Programmatic 222
saving a calibration 290
selecting the right method 290, 291
setting dot detection 301
sub-panel 289
Visual Basic tutorial 96
Visual C++ tutorial 171
X-Y Scale 220, 291
Calibration methods 220
Calibration units 219
Caliper
adding Visual Basic code 67
adding Visual C++ code 141
Camera Gain, DepictMaster 4x1 285
Camera Input
PX610A 252
PXC200 259
Camera Offset, DepictMaster 4x1 285
HexSight Basics User Guide
Camera Port
DepictMaster 4x1 284
PC-DIG 240
PCVision 241
Camera position, calibration
Perspective 221
XY scale 220
CCD cameras, recommended 4
Center 396
Center, Model coordinate system 396
cfg file format 196
Changes to the List of Enabled Models 343
Changes to the Range of Rotation 343
Changes to the Scale Factor Range 343
Channel
Meteor-II/Standard 269
MRT micro VPP 283
Orion 282
Channel, Meteor-II/Multi-Channel 272
Choosing Features for the Model 393
Chroma Comb Filter, PXC200 264
Chrominance Filter, DT-3155 248
Circular Model 329
Class Library 445
Visual Basic example 447
Visual C++ example 449
Class Wizard, incompatibility 105
Clock tab, DT-3152 245
Clock, DT-3157 249
Coarseness
Detail Level 378
Outline Level 378
Command buttons, common HexSight 23
Configuration
Acquisition Device 224
definition 12
saving an application 196
Configuration file
export 197
import 197
load 196
save 196
Configuration Files
Meteor-II/Digital 276
Meteor-II/Multi-Channel 270
Meteor-II/Standard 267
MRT micro VPP 283
Orion 280
452
Index
PC-DIG properties 239
PCVision 241
Configuration Panel
Acquisition Device 224
Inspection tools 444
Conformity Tolerance 355, 362, 408
default 407
valid range 407
Contour Detection 344
based on Models 377
Contrast Threshold 346, 379
Detail Level 345, 378
Outline Level 345, 378
parameters 345
Parameters Based on 377
settings 377
Tracking Inertia 347, 379
Contour Panel 374
Contour Scene 314
Detail 373
Outline 372
Contrast Polarity 352, 360, 405, 406
Don’t Care 352, 360, 406
Normal 352, 360, 406
Normal and Reverse 352, 360
Reverse 352, 406
Contrast Threshold 324, 346, 379, 388
Contrast, PXC200 261
Control
adding, in Visual Basic 36
adding, in Visual C++ 104
referencing 21
Controller board, Opteon DepictMaster 284
Conversions, unit and angle 191
Coordinate System
Locator results 412
Coordinate System, Model 395
Coordinate systems 183
Image 188
Object 188
Tool 189, 419
World 187
Core Function, PXC200 262
Coreco Imaging
multiple frame grabbers 242
Coreco Imaging frame grabber
IC-ASYNC 235
PCVision 240
HexSight Basics User Guide
Coreco Imaging frame grabbers
how to install 8
IFC software 9
ITEX software 8
Cropping models 318, 359, 397
Current Instances 400
Custom setup of HexSight 6
D
Data Translation frame grabber
DT-3152 242
DT-3155 246
DT-3157 248
how to install 8
Database
building an emulation database 231
display objects 206
loading Model files 380
manage objects 205
Models 318
saving objects 207
selecting specific images in 231
Database Selection mode 214
Database, definition 12
Debounce
Both, PXC200 265
Long,PXC200 264
PX610A 253
Default configuration, Acquisition Device 225
Default Conformity Tolerance 407
Definitions 314
Deleting
feature from Model 48, 120
image from datbase 230
Model features 396
model from database 382
reference points 394
Demo Mode 5
how to use 30
limitations 30
using the tutorials in 31
Demonstration Mode 30
Demos
Arc Finder 27
Arc Finder and Edge Finder 28
Automated Model Teaching 28
Board Location 26
Bracket Inspection 26
Builder 27
453
Index
Calibration 26
Caliper 28
Contour Detection 27
Contour Drawing 27
Disambiguation of similar objects 28
Finder Tools 27
Image Processing 27
Line Finder 27
Locator 27
Model Optimization 27
Part Sorting 28
Pattern Locator 28
Point Finder 27
provided with HexSight 26
Pulley location and inspection 28
Regulator inspection 28
Shading Consistency 27
Synthetic Model, drawing 29
Disambiguating features 329
Disambiguation
definition 13
demo 28
disable/enable 319
inter-model 332
multi-model 332
Discriminating features 327
Display
scroll bars 390, 400
toolbar 178
using HexSight displays 175
Visual Basic tutorial 57
Visual C++ tutorial 131
Display control
adding Visual Basic code for 57
adding Visual C++ code for 132
DepictMaster 4x1 284
Multi-camera acquisitions 286
Slave mode 286
Display modes 373, 389, 400
Locator 373
Matched Model 364, 413
Transformed Model 365, 413
DepictMaster 4x1 properties
Camera Gain 285
Camera Offset 285
Camera Port 284
Edge 285
Exposure 284
Period 285
Strobe 286
Timeout 286
Trigger 285
Display properties, Explorer 211
Display screen
mode area 180
rulers of a 181
status bar 182
tool area 178
using 175
viewport 181
zoom area 179
Detail Contour Scene 373
Detail Level 378, 388
configuring 378, 388
Detected Frame Grabber 232
Digital I/O tab, DT-3157 251
Dim display mode,Normal display mode 389,
400
DirectShow device 216, 288
system requirements 288
DirectShow device properties
Input Source 288
Output Source 288
RGB inputs 288
Stream Format 289
Timeout 288
Video Parameters 289
DirectX 8.0 288
Disabling Model Disambiguation 319
HexSight Basics User Guide
Distortion Calibration
procedure 299
when to use 299
Distortion LUT Calibration 221, 298
when to use 222, 299
Distortion Model Calibration 222, 299
Don’t Care contrast polarity 352, 406
Dot detection parameters 301
Dot targets 305
description 305
guidelines for creating 306
DT-3152 properties
Black Level 244
Chrominance Filter 244
Clamp 246
Frequency 245
Input Source 243
Interlaced 244
Lines 246
454
Index
Pixels 246
Polarity 245
Source 245
Sync Source 244
Trigger 244
White Level 244
DT-3152 Setup 243
Acquisition tab 243
Clock tab 245
Field tab 245
DT-3155 properties
Black Level 248
Chrominance Filter 248
Input Source 247
Sync Source 247
Timeout 248
Trigger 248
White Level 248
DT-3157 properties
Clock 249
Exposure 249
Lines 251
Pixels 250
Timeout 250
Trigger 250
DT-3157 Setup 248
Acquisition parameters 249
Digital I/O tab 251
Field tab 250
Duplicate Process 197
dxf files 381
Dynamic Update 411
E
Edge Locator
Visual Basic code 93
Visual Basic tutorial 86
Visual C++ code 168
Visual C++ tutorial 161
Edit Process 197
Editing Models 325, 390
Elapsed Time 368, 413
Elapsed time
Locator 368, 413
electronics applications 325, 354, 359
Emulation database
building 231
input mode 214
selecting specific images in 231
HexSight Basics User Guide
Enabled models 382
Enabled models, learning 343
Entity
definition 13
file formats 15
Event, PXC200 264
Evidence order 405
Exceptions to Learn process 342
Execute Sequence in Application Control 197
Exhaustive recognition effort 407
Explorer
display images, scenes, entities 206
Display properties 211
general options 211
modifying the database 205
properties 210
saving database objects 207
Explorer interface 202
tree view 203
view the runtime database 203
Exporting a configuration 197
Exposure
DepictMaster 4x1 284
DT-3157 249
External Trigger 277
Meteor-II/Multi-Channel 273
Meteor-II/Standard 269
Orion 282
PC-DIG 240
PCVision 242
F
Feature extraction
conformity tolerance 355
positioning 358
Feature recurrence 338, 340
Feature selection 325
criteria 326
Model 325
Feature Sub-Panel 392
Features
adding manually 390
adding, in Model Editor 390
criteria for choosing 393
deleting from Model 391
Location 393
Required 393
Field Length, PX610A 254
455
Index
Field tab
DT-3152 245
DT-3157 250
File Emulation mode 229
File formats
bmp (Image),.bmp 207
cal (Calibration) 290
cfg (Configuration) 196
hac (Arc entity) 207
hln (Line entity) 207
hpt (Point entity) 207
hsc (Scene) 207
hvw (View) 207
file formats in HexSight 15
Files, Model database 318
FireWire camera 288
system requirements 288
FireWire camera,IEEE 1394 216
Fit Quality 366
Fixed Contrast Threshold 347
Frame grabber
configuration 216
DT-3152 242
DT-3155 246
DT-3157 248
Generic 232
how to install 8
how to remove 234
IC-ASYNC 235, 240
Meteor-II/Multi-Channel 269
Meteor-II/Standard 267
MRT micro VPP 282
Orion 280
PCVision 238, 240
PX610A 251
PXC200 258
specified 232
Frame Grabber mode, Acquisition Device 215
Frame grabbers, supported in HexSight 3
G
Gain Control, PXC200 263
Gain, PX610A 256
Gamma Correction, PXC200 263
Gap
PX610A 258
PXC200 266
General panel
Acquisition Device 224
HexSight Basics User Guide
Inspection tools 437
Locator 371
Generic frame grabber 232
Grab, IC-ASYNC 236
Graphical interface elements 22
Grey-Scale Image output 223, 312
Grid of dots 221
Grid of Results 410
H
hac file format 207
Hard drive, minimum requirements 3
Hardware requirements 3
hdb files
importing 230
Help, online 24, 198
HexSigh
file formats 15
HexSight
Acquisition tools 199
adding a component to the toolbox 20
command buttons 23
displays 175
Example applications 26
getting started 11
graphical interface elements 22
hardware requirements 3
Image processing tools 199
Inspection tools 199
installing 6
kit contents 2
Locator tools 200
online help 198
referencing a control 21
software requirements 4
system requirements 3
Technical support 25
terminology 12
tools 18
uninstalling 6
what is 12
HexSight Control
adding in Visual Basic 36
adding in Visual C++ 104
HexSight file formats 15
hig file format 207
hig files
exporting to 230
456
Index
importing 230
hln file format 207
Horizontal Polarity 258
hpt file format 207
hsc file format 207
HStart, PXC200 266
hvw file format 207
HWidth, PXC200 266
I
IC-ASYNC properties
Grab 236
Output 236
Timeout 236
Trigger 236
IC-ASYNC Setup 235
Configuration File 236
multi-camera application 237
Two-channel application example 237
IEEE 1394
system requirements 288
IFC software 9
Image
in runtime database 206
Image calibration 214, 218
errors 304
Image coordinate system 188, 218
Image display options
Model Editor 389
Model Optimizer 400
Image Distance order 405
Image processing tools 199
Image quality, Model 321
Image, definition 13, 204
Image-based calibrated positioning mode 425
Image-based uncalibrated positioning mode
424
Imagenation frame grabbers
how to install 8
PXC200 258
PXC610A 251
Images
grey-scale 223
saving, as Bitmap files 207
selecting in emulation database 231
Importing a configuration 197
Improving Search Performance 358
HexSight Basics User Guide
Input 315, 372
Inspection tools 437
Locator 372
Input for Locator tool 315
Input modes
database selection 214
file emulation 214, 229
frame grabber 215, 232
generic frame grabber 232
selection 228
Input Source
DirectShow device 288
DT-3155 247
Meteor-II/Digital 277
Meteor-II/Multi-Channel 272
Inputs tab
PXC200 264
Inspection tools 199, 415
basic concepts 419
basic setup of a tool 436
General panel interface 437
Location panel interface 439
shared characteristics 419
Transform panel interface 442
units 438
Installing a frame grabber
Coreco Imaging 8
Data Translation 8
Imagenation 8
Matrox 9
MRT 9
Opteon 9
Installing HexSight 1, 6
before installing 5
custom setup 6
Instance Analyzed, Optimizer 384
Instance Identification and Model Type 365
Instance Ordering 350, 361, 405
Instance Scene 315, 373
Instance, definition 14
Instances
identification 365
number of 349
Instances Analyzed 399
Instances to Find 360, 404
Instantiate, definition 14
Instantiated Processes 195
Intellicam
Meteor-II/Digital 276
457
Index
Model panel 380
Models 315
Models database 380
Output 315
Region of interest 341
results 363
Results panel 409
Results Viewer 363
Search area 341
Search constraints 347
Search panel 403
Visual Basic tutorial 34
Visual C++ tutorial 100
Meteor-II/Multi-Channel 270
Meteor-II/Standard 267
Orion 280
Inter-model disambiguation 319, 332
Intra-model disambiguation 319
Itex software 9
K
Keyboard Combinations, Model Editor display
391
L
Learn and Unlearn Commands 344
Learn command 344, 384
Learn Exceptions 342
Learn process 342, 358
Learn process, effect on performance 358
Learn time 413
Left-handed coordinate system 216
Leftmost order 405
Levels, Outline and Detail 323, 345
Line Finder 200
Link to Detail 338, 398
Loading a configuration 196
Locate All Symmetric Instances 405
Locate command 397
Locate Symmetric Instances 353
Location 393
Location display
Inspection tools 440
Model-based 440
of an Image-based
tool 441
Location feature 393
Location panel
Inspection tools 439
Location property, features 327, 330, 332
Location results, Locator tool 365
Locator 200, 313
adding Visual C++ code 126
Contour detection 344
Contour panel 374
Execution time 368
General panel 371
General properties 313
Input 315
Learn process 342
HexSight Basics User Guide
Locator results 363, 365, 410
Elapsed time 413
Fit Quality 411
Match Quality 411
messages 414
Model 410
Model type 410
Position 411
Rotation 411
Scale 411
selecting coordinate system 412
symmetric instances 411
Symmetry 411
X-Y position 411
Locator search
Based on outline level 353
contrast polarity 352
number of instances 349
rotation 348
scale factor 347
timeout 350
Lookup table 221, 298
Low-Pass Filter, PXC200 262
Luma Comb Filter, PXC200 263
Luma/Chrome tab 262
M
Main Form
adding basic code 107
adding basic code to 37
creating in Visual Basic 34
creating in Visual C++ 100
Manual Model editing 325
Match Quality 367
Matched
contours 354, 356
458
Index
Model 364, 373, 413
Matched Model mode 364
Matrox frame grabbers
how to install 9
Meteor-II/Digital 275
Meteor-II/Multi-Channel 269
Meteor-II/Standard 267
MIL-Lite software 9
multiple frame grabbers 276
Orion 280
Memory, required 3
Messages 397, 414
Model creation 335, 397
Model Editor 335, 397
Search analysis 368
Search process 414
Meteor-II/Digital properties
Input Source 277
Meteor-II/Digital Setup 275
Configuration files 276
Multi-camera application 278
three-channel application example 278
Meteor-II/Multi-Channel properties
Channel 272
External Trigger 273
Input Source 272
Output Source 272
Sync Source 272
Timeout 273
Meteor-II/Multi-Channel Setup
multi-camera application 273
Meteor-II/Multi-Channel setup 270
Configuration files 270
Intellicam 270
three-channel application example 273
Meteor-II/Standard properties
Channel 269
External Trigger 269
Timeout 269
Meteor-II/Standard setup
Configuration files 267
multiple frame grabbers 269
MIL/MIL-Lite software
Meteor-II/Digital 276
Meteor-II/Multi-Channel 270
Meteor-II/Standard 267
Orion 280
Minimum
Feature Recurrence 339, 340, 399
HexSight Basics User Guide
Minimum Feature Recurrence 339, 340, 399
Minimum Model Percentage 356, 362, 408
Minimum Percentage of Required Features 357,
409
Model 314
adding features to 390
adding reference points 394
automatic levels 387
building 320
choosing features for 393
contrast threshold 388
copying 382
creating 385
creating and editing 319
Database in Locator 380
definition 315
Detail Level 323
editing 319, 382
feature selection 325
importing 381
management 315
optimiz 383
Outline Level 323
reference points 335
removing features 391
type 365
View 314, 372
Model Considerations Affecting Performance
359
Model Contour Detection 323
Model contour detection
contrast threshold 388
detail level 388
outline level 387
tracking inertia 389
Model coordinate system 334
Center 396
rotation 396
X-Y position 395
Model Creation 386
Model Creation and Edition 319
Model database
importing a Model into 381
load 381
new 381
save 381
shared 319
Model Disambiguation 319, 383, 384
Model Editor 385
459
Index
adding features in 390
adding reference points in 394
Bounding Area 390
Coordinate System 395
display 401
display modes 389
display options 389
Features sub-panel 392
Messages 397
messages 397
removing features from 391
Visual Basic tutorial 44, 116
Model Editor commands 396
Model Editor Messages 335
Model features
deleting 396
discriminating 327
editing 325
stability 326
unstable 327
Model file 318
format 318
loading 380
Model Image Considerations 321
Model optimization
enabling 384
executing 383
feature recurrence 338
how it works 337
nosiy objects 337
parameters 338
purpose 337, 383
variable shapes 337
Model Optimizer 398
display modes 400
display options 400
enabling 384
Model Panel 380
Model View 314, 372
Model-based Automatic positioning 432
Model-based Manual positioning 426
Model-based tool
Location display 440
Transform display 443
Models 315, 382
new 382
teaching 320
Models Command Buttons 382
Models Database 318, 382
HexSight Basics User Guide
Models database 318
Models Database Sharing 319
Modes
emulation 214
operating, Process manager 210
positioning, in Inspection tools 437
positioning, Inspection tools 437
Morph to Average Shape 339, 399
effect of 340
Morphing 339
effect on optimization 340
illustration 340
Move Reference Points with Axes 396
MRT micro VPP
how to install 282
Setup 283
MRT micro VPP Setup
Configuration files 283
Multi-camera application
Meteor-II/Digital 278
Meteor-II/Multi-Channel 273
Multi-channel acquisition 311, 312
Multi-model applications 319, 324, 332, 334, 342,
345, 363, 397
Multiple
Acquisition Device Configurations 225
camera configurations 226
Coreco Imaging frame grabbers 235
Locators 319
Models in applications 319, 324, 332, 334,
342, 345, 363, 397
Multiple acquisitions 224
Multiple cameras
configuring 224
enabling 224
Multiple configurations, Acquisition Device 224
Multiple frame grabbers
configuring 224
enabling 224
Multi-scale applications 359, 362
N
Normal & Reverse contrast polarity 406
Normal and Reverse contrast polarity 352
Normal contrast polarity 352, 406
Notch Filter, PXC200 263
Number of Instances 349
Number of instances to find 349
460
Index
PXC200 265
O
Object coordinate system 188, 334
Object coordinate system, Model 395
Offset, PX610A 256
Online help 24
Operating modes, Process manager 210
Opteon frame grabbers
DepictMaster 4x1 controller board 284
Installing 9
Optimization
object of variable shape 337
parameters 338
process, how it works 337
removal of noise from model 337
variable-shaped objects 338
Optimize 384
Orion
Configuration files 280
Intellicam 280
MIL/ MIL-Lite software 280
Setup 247, 280
Orion properties
Channel 282
External Trigger 282
Timeout 282
Outline and Detail Level Values 323
Outline and Detail Levels 345
Outline Contour Scene 372
Outline Level 378, 387
coarseness 378
Outline vs. Detail Level 345
Output 315, 372
Output Image
Acquisition Device 223
Output Objects in Instance Scene as 373
Output of Locator tool 315
Output Source
Meteor-II/Multi-Channel 272
Output sub-panel 311
Output Symmetric Instances 405
Output, definition 14
Output, IC-ASYNC 236
Outputs
Acquisition Device 223
Locator 372
Outputs tab
PX610A 257
HexSight Basics User Guide
P
Parameters Based on 377, 378
Pattern Locator
Visual Basic tutorial 79
Visual C++ tutorial 153
PC-DIG properties
Camera Port 240
External Trigger 240
Timeout 240
PC-DIG Setup 238
Configuration files 239
PCVision properties
Camera Port 241
External Trigger 242
Timeout 242
PCVision Setup 240
Configuration File 241
Peak Filter, PXC200 262
Percentage of Points to Analyze 339
Period 266
DepictMaster 4x1 285
PXC200 266
Perspective Calibration 221, 295
corner detection mode 296
manual mode 297
procedure 295
when to use 295
Pick-and-place applications 350
pipelined acquisition 227
Point Finder 200
Polarity
DT-3157 frame grabber 249
Locator 360, 406
PX610A frame grabber 257
Strobe 257
Position
Rectangle 419
Tool region of interest 419
Positioning 358
Positioning modes 423
Image-based calibrated 425
Image-based uncalibrated 424
Inspection tools 437
Model-based Automatic 432
Model-based Manual 426
Positioning modes summary 433
461
Index
Positioning speed 358, 363, 409
Pre-installation of HexSight 5
Presence/absence applications 354, 358
Process manager 195
operating modes 210
properties 209
Process name
Locator 372
Processes, instantiated 195
Processor, required 3
Programmatic Calibration
code example 308
Programmatic calibration example 309
Project Examples
Arc Edge Locator 28
Arc Finder 27
Automated Model Teaching 28
Board Location 26
Bracket Inspection 26
Builder 27
Calibration Demo 26
Contour Detection Demo 27
Contour Drawing 27
Disambiguation of similar objects 28
Finder Tools 27
Image Processing 27
Line Finder 27
Locator 27
Model Optimization 27
Pad Inspection with Caliper 28
Part Sort 28
Pattern Locator 28
Point Finder 27
Pulley Location 28
Regulator Inspection 28
Shading Consistency 27
Synthetic Model 29
Project examples 26
Properties
automation 209
Explorer 210
Explorer display 211
general Application Control 208
Location 365
Process manager 209
PX610A properties
Blank Length 255
Camera Input 252
Debounce 253
HexSight Basics User Guide
DX 255
DY 256
Field Length 254
Gain 256
Gap 258
Offset 256
Scale X 255
Scale Y 255
Single Field 255
Strobe Lines 257
Strobe Period 258
Strobe Polarity 257
Sync Lines Enabled 258
Sync Mode 254
Timeout 252
Trigger Delay 253
Trigger Type 253
X0 255
Y0 256
PX610A Setup 252
Acquisition tab 252
Outputs tab 257
typical configurations 256
Video tab 253
PXC200
Inputs tab 264
PXC200 properties
Brightness 261
BW Detect 263
Camera Input 259
Chroma Comb Filter 264
Contrast 261
Core Function 262
Debounce Both 265
Debounce Long 264
Event 264
Gain Control 263
Gamma Correction 263
Gap 266
HEn 266
Holdoff Enable 266
Holdoff Start 266
Holdoff Width 266
Low-Pass Filter 262
Luma Comb Filter 263
Notch Filter 263
Peak Filter 262
Period 266
Start Line 266
Strobe 265
462
Index
Timeout 259
Trigger 266
Trigger State 260
Trigger use 260
Video Level 262
Video Type 261
PXC200 Setup 259
Acquisition tab 259
Luma/Chroma tab 262
Outputs tab 265
Video tab 260
Q
Quality order 405
Quick recognition effort 407
R
R,G,B images, DirectShow device 288
Recognition 407
conformity tolerance 407
effort 354
parameters 354, 407
positioning 409
speed 407
Recognition effort 354, 362
slider 407
Recognition parameters 354
effect on performance 362
Rectangle
characteristics 419
height 420
placing, within an Image 441
position 419
rotation 420
width 420
Recurring features 338
Reference Points 335
in Model 394
move with axes 396
Reference Points Sub-Panel 394
Region of interest 419
placing 441
Region of interest characteristics 419
Remove Process 197
Removing a Frame Grabber 234
Removing features from the Model 391
Required feature 393
Required property 330, 333
HexSight Basics User Guide
Requirements
hardware 3
Requirements, software 4
Reset All, Model Optimizer
resetting 383, 384
Results
Locator 363, 410
Results panel
Acquisition Device 312
Inspection tools 444
Locator 409
Results Viewer 363, 412
display modes 413
using 412
Reverse contrast polarity 352, 406
Right-handed coordinate system 216
Rightmost order 405
ROI 419
characteristics 419
placing, within an Image 441
position 419
rotation 420
size 420
Rotation 348, 360, 396, 404
Inspection tools 420
Locator 348, 404
Sector, arc-tools 423
Rulers, in displays 181
Running in Demo Mode 30
Runtime database
display images, scenes, entities 206
managing objects 205
saving objects 207
S
S_Video, PXC200 263
Sample applications 26
Sampling 433
Bilinear interpolation 434
Sampling Step 434
Sampling-step 434
Sampling-step settings
Inspection tools 442
Saving
application configuration 196
arc entities 207
images 207
line entities 207
463
Index
point entities 207
Scenes 207
Views 207
Scale factor 347, 403
constraints affecting performance 359
Scale X and Scale Y,PX610A 255
Scene
definition 15, 204
in runtime database 206
Scroll bars 390, 400
Search
Based on Outline Only 361
Search Area 341, 345, 375
Display 376
placing and sizing 375
properties 376
Search Area Display 376
Search Area Properties 376
Search constraints 347, 403
based on outline level only 406
contrast polarity 405, 406
Locator 347, 403
number of instances 404
polarity 406
rotation 404
scale 403
symmetric instances 405
timeout 404
Search Constraints Affecting Performance 359
Search panel 403
Search Process 341
Search Result Messages 368
Search speed 318, 348, 359, 360
Search time 413
Sector
characteristics 422
opening 423
position 422
radius 423
rotation 423
thickness 423
Semiconductor applications 325, 354, 359
Sensitivity
contrast thresholds 346
locator contrast threshold 324
Model contrast threshold 388
Sequential acquisition, multiple cameras 226
Setting the Search Area 375
HexSight Basics User Guide
Shading Consistency 405
demo 27
order 351
Show
Coordinate System 413
Grey-Scale Image 377
Real-Time Display 234
Results Viewer 412
Search Area 413
Show options
Model Editor display 389
Model Optimizer display 400
Single Field, PX610A 255
Skew 421
Software requirements 4
Speed/accuracy tradeoff 358
Stable features 326
effect on performance 346
Start Line, PXC200 266
Status bar 182
Stream Format, Direct Show device 289
Strobe
DepictMaster 4x1 286
PXC200 265
Strobe Lines mode, PX610A 257
Strobe periods, PX610A 258
Strong features, used for optimization 338
Symmetric instances 353, 361, 405
Symmetries 329
Symmetry
effect on performance 361
in Models 329
results 367
Symmetry of 367
Sync Mode, PX610A 254
Sync Source
DT-3155 247
Meteor-II/Multi-Channel 272
System requirements 3
T
Target position, calibration
Perspective 221
XY scale 220
Target, creating 306
Teaching a Model 320, 386
Technical support 25
e-mail 25
464
Index
e-mail queries 25
telephone access 25
Test applications
Visual Basic 56
Visual C++ 129
Three-channel application 273, 278
Time, Locator results 367
Time-critical applications 350, 354, 361
Timeout 244, 350, 361, 404
DepictMaster 4x1 286
DirectShow device 288
DT-3155 248
DT-3157 250
IC-ASYNC 236
Meteor-II/Multi-Channel 273
Meteor-II/Standard 269
Orion 282
PC-DIG 240
PCVision 242
PX610A 252
PXC200 259
Tool coordinate system 189
Inspection tools 419
Tool orientation 420
Tool positioning modes 423
Tool region of interest 419
rotation 420
Tool rotation 420
Toolbar, HexSight displays 178
Tools
Acquisition Device 199, 213
Image processing 199
Inspection 199, 415
Locator 200, 313
Tools, Display window 178
Topmost order 405
Tracking Inertia 324, 347, 379, 389
Transform panel
Inspection tools 442
Transformed Model 373, 413
Transformed Model Mode 364
Transformed Model mode 364
Trigger
DT-3152 244
DT-3155 248
DT-3157 250
IC-ASYNC 236
PXC200 266
HexSight Basics User Guide
Trigger Delay, PX610A 253
Trigger Mode
DepictMaster 4x1 285
External A 285
Master 285
Slave 285
Trigger State, PXC200 260
Trigger Type, PX610A 253
Trigger use, PXC200 260
Troubleshooting 370
Tutorial
Visual Basic 33
Visual C++ 99
Tutorial, Visual Basic
Acquisition Device 38
Application Control Interface 38
Blob Analyzer 71
Calibration 96
Caliper 61
Display 57
Edge Locator 86
Locator 34
Pattern Locator 79
testing the application 56
viewing Scenes and Images 41
Tutorial, Visual C++
Acquisition Device 110
Blob Analyzer 144
Calibration 171
Caliper 135
Display 131
Edge Locator 161
Locator 100
Pattern Locator 153
testing the application 129
viewing Scenes and Images 113
U
Uninstalling HexSight 6
Unit and angle conversions 191
Units 374
Inspection tools 438
Locator 374
Unlearn command 344, 384, 385
Unstable features, Model 327
Use Default Conformity Tolerance 407
Use External Database 382
465
Index
V
Valid Conformity Tolerance Range 407
Vertical Polarity 258
Video Level, PXC200 262
Video Parameters, DirectShow device 289
Video tab
PX610A 253
PXC200 260
Video Type, PXC200 261
View runtime database 205
View, definition 15, 204
Viewer
Locator results 363, 412
Viewport 181
Visual Basic
adding Application Control 194
adding code to Main Form 37
Class Library example 447
tutorials 33, 99
Visual C++
adding Application Control 194
adding code to Main Form 107
Class Library example 449
tutorials 99
W
White Level 248
DT-3152 244
DT-3155 248
World coordinate system 187, 218
World Distance order 405
World error 304
World vs. Image 294, 298
Wrappers
adding, HexSight 105
Class Wizard 105
X
X and Y Position, Model Editor 395
XY Scale Calibration 291
procedure 291
when to use 291
Z
Zoom area 179
HexSight Basics User Guide
466
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement