Rockwell Automation 5370-OCR2 User Manual

Allen-Bradley
Bulletin 5370 OCR2–PAKt
User
(Cat. No. 5370–OCR2)
Manual

Important User Information

Because of the variety of uses for the products described in this publication, those responsible for the application and use of this control equipment must satisfy themselves that all necessary steps have been taken to assure that each application and use meets all performance and safety requirements, including any applicable laws, regulations, codes and standards.
The illustrations, charts, sample programs and layout examples shown in this guide are intended solely for purposes of example. Since there are many variables and requirements associated with any particular installation, Allen-Bradley does not assume responsibility or liability (to include intellectual property liability) for actual use based upon the examples shown in this publication.
Allen-Bradley publication SGI-1.1, Safety Guidelines for the
Application, Installation, and Maintenance of Solid-State Control
(available from your local Allen-Bradley office), describes some important differences between solid-state equipment and electromechanical devices that should be taken into consideration when applying products such as those described in this publication.
Reproduction of the contents of this copyrighted publication, in whole or in part, without written permission of Allen-Bradley Company, Inc., is prohibited.
Throughout this manual we use notes to make you aware of safety considerations:
ATTENTION: Identifies information about practices or circumstances that can lead to personal injury or
!
Attention statements help you to:
death, property damage or economic loss.
identify a hazard
avoid the hazard
recognize the consequences
Important: Identifies information that is critical for successful
application and understanding of the product.

Table of Contents

OCR2-PAK User Manual
Using this Manual
Introduction to OCR2-P AK
Chapter 1
Chapter Objectives 1–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview of Manual 1–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR2 P AK Definition 1–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Intended Audience 1–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conventions 1–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terminology 1–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Related Publications 1–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 2
Chapter Objectives 2–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR2-P AK Description 2–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Font Training 2–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Multiple Strings 2–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Requirements 2–4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Orientation and Direction 2–4. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Height 2–4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character and String Spacing 2–5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Alignment 2–5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Gray Spaces 2–7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Rotation 2–7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character / Background Contrast 2–8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ambiguous Characters 2–8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Quality 2–8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Other Character Restrictions 2–9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR2-PAK Installation
Chapter 3
Chapter Objectives 3–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR2-P AK Installation 3–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing OCR2-P AK 3–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
i
Table of Contents
OCR2-PAK User Manual
OCR Tool Configuration
OCR Tool Configuration
Chapter 4
Chapter Objectives 4–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Procedure 4–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding an OCR Tool 4–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing an OCR Tool 4–4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR Tool Edit Panel 4–5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR Tool Edit Panel Components 4–5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR Tool Edit Panel Buttonss 4–8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Enter a Font Name 4–9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Position OCR Tool Window 4–10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Set Threshold / Filter 4–11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Set Character Size 4–12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Select Operating Mode 4–15. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 5
Chapter Objectives 5–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR Fonts 5–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction to Teaching Characters 5–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR Panels 5–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Edit Font Panel 5–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Define Character Panel 5–5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding Characters to Fonts 5–8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the Filter 5–11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Thinning 5–12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Taught Patterns Manually 5–14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Testing Fonts 5–15. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Correlation Threshold 5–17. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining Spacing 5–18. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Character Spacing 5–18. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Gray Spaces 5–19. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Font Optimization 5–22. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reducing Image Variations 5–22. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Handling Print Degradation 5–22. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Eliminating Confusion 5–25. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Working With Font Files 5–27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ii
Table of Contents
OCR2-PAK User Manual
Using Match Strings
Using Match Strings
Communications and Results Processing
Chapter 6
Chapter Objectives 6–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Match String Usage 6–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Length of Match Strings 6–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Leading & Trailing Spaces 6–2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Metacharacters 6–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Testing Match Strings 6–5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Match String Examples 6–6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 7
Chapter Objectives 7–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Inspection Displays 7–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
On-Line Adjustment 7–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 8
Chapter Objectives 8–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR Inspection Results 8–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communications Messages 8–3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing OCR Results from Math Tools 8–3. . . . . . . . . . . . . . . . . . . . . . . . . . .
OCR Tool Adjustment 8–4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sending Match Strings with Backslashes 8–5. . . . . . . . . . . . . . . . . . . . . . . . . . .
Transferring Font Files 8–5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Status and Warning Messages
Compensating for Lighting Variations
Glossary Index
Appendix A
Appendix B
Objectives B–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Image Processing B–1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Method 1 – Maximum Compensation B–1. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Method 2 – Brightness Compensation with Maximum Speed B–5. . . . . . . . . . .
iii
Chapter

Chapter Objectives

Overview of Manual

A–B
1
Using this Manual
Read this chapter to familiarize yourself with the rest of the manual. You will learn about:
Contents of this manual
OCR2-PAK definition
Intended audience
Conventions used
Terminology
Related publications.
The following table describes the contents of each chapter in this manual.
Manual Contents
Chapter
1 Overview of this Manual
2 Introduction to OCR2-PAK
3 OCR2-PAK Installation 4 OCR Tool Configuration Describes how to setup an OCR tool. 5 Creating Inspection Fonts
6 Using OCV
7 Inspections
8 Communications and I/O
Title Purpose
Introduces you to the OCR2-PAK software package and provides you with a list of related documents and conventions.
Describes key features, specifications, restrictions, and other application considerations.
Provides instructions for installing OCR2-PAK.
Describes how to train OCR2-PAK to recognize characters.
Describes how to configure and test match strings for OCV.
Describes how to perform Test and On-Line inspections.
Describes how to access OCR results and perform configuration functions through a CVIM2 communications port.
Glossary
Index
1–1
Chapter 1
Using this Manual

OCR2 PAK Definition

Intended Audience

Conventions

OCR2-PAK (Catalog No. 5370-OCR2) is an enhancement to the CVIM2 (Catalog No. 5370-CVIM2) inspection tools that provides Optical Character Recognition (OCR) and Optical Character Verification (OCV).
OCR2-PAK is installed in the CVIM2 using a memory card. With OCR2-PAK installed, OCR is listed as an additional selection in the CVIM2 Tool Types panel. All parameters for an OCR window are configured through popup menus using a light pen or mouse (trackball).
No special knowledge is required to use OCR2-PAK. However, you must understand how to configure and operate the CVIM2. Refer to the user manuals (see related publications, next page).
This manual uses the following conventions:
Mouse button refers to the left mouse button.
References to Mouse are synonymous with Light Pen in this manual.
If a menu command, button or check box is grayed out or shaded that
item is not available for use at that time.
Click means to position the cursor in the specified area and press / release
the mouse button without moving the mouse.
Choose means to perform a menu command or check a check box.
Select means to highlight a selection from a list or series.
Dragging or Drag (Mouse) is performed by pointing to an object,
pressing the mouse button and holding it down while moving the object.
Dragging or Drag (Light Pen) is performed by positioning the light pen
tip over an item on the screen and pressing the tip against the screen until a cross (+) symbol appears. Release the light pen tip from the screen, then drag the item across the screen. Press and release the tip against the screen when the item is at its final position.
Toolset refers to a set of one or more tool types that are assembled to
perform an inspection. The CVIM2 system can run one configuration (file) at one time, and that configuration file may contain up to six toolsets, each of which can contain one or more tools.
Tool refers to any of the tool types, such as “gage, window, and so on.
In this context, the OCR tool is just one of the tool types that a toolset may contain.
1–2
Chapter 1
Using this Manual

Terminology

Related Publications

This manual contains some terms that you may not be familiar with. Use the glossary at the back of this manual for assistance.
The following table lists related publications. We recommend that you read the CVIM2 Reference Manual (Catalog No. 5370-801) before using the OCR2 package.
Related Publications
Publication / Catalog
Number
5370-801 CVIM2 Reference Manual 5370-804 CVIM2 Communications Manual
Description
1–3
Chapter

Chapter Objectives

OCR2-PAK Description

A–B
Introduction to OCR2-PAK
This chapter describes:
OCR2-PAK
Font training
Verification
Recognition
Character requirements
Ambiguous characters
Overview
2
OCR2-PAK is an enhancement to the CVIM2 that provides Optical Character Recognition (OCR) and Optical Character Verification (OCV). After OCR2-PAK is installed, OCR is listed as an option in the Tool Types panel.
An OCR Tool can be used in two ways:
OCR mode reads characters within the tools processing window. It does
not use a match string to verify what text is present.
OCV mode reads characters within the tools processing window, and
compares the text read to a match string entered by the user.
Both OCR and OCV have standard and strict operating modes. These modes determine how the OCR2 package handles printed characters that correlate with two or more different taught characters.
2–1
Chapter 2
Introduction to OCR2-PAK
Tool Panels
New tool panels are created when OCR2-PAK is installed. There are three basic panels for OCR2-PAK:
Use the Edit OCR Tool Panel to configure an OCR Tool.
Use the Edit Font panel to add, remove, and test characters from a font list.
2–2
Use the Define Character panel to teach and test a single character.
Chapter 2
Introduction to OCR2-PAK

Font Training

Multiple Strings

Setup of the OCR Tool for inspections requires that you teach or train the CVIM2 to recognize your set of characters (font). This means that you can train the OCR2 package to recognize just about any character.
When you train the system, all of the taught letters, numbers and symbols are stored as a group called a font. Fonts can be copied, edited or deleted from a font listing.
An OCR Tool can inspect up to 4 strings of up to 20 characters each. Each string can have its own OCR or OCV operating parameters assigned.
OCR Tool Window
Net wt. 13oz 382g Expiration Date 3/94 Code 123456 Lot #3 Made in USA
String #1 OCV Inspection checks for presence of string.
String #2 OCR Inspection reads expiration date.
String #3 OCR Inspection reads code and lot number.
String #4 OCV Inspection checks for presence of string.
2–3
Chapter 2
Introduction to OCR2-PAK

Character Requirements

The following requirements must be met for character recognition.
Character Orientation and Direction
The OCR Tool inspects only horizontal strings. If your characters are rotated, you can use the Build Reference Tool as described in the CVIM2 Reference Manual to rotate the OCR Tool prior to inspection.
Vertical String Bottom-to-Top Orientation Tool must be Rotated -90_
Vertical String Top-to-Bottom Orientation Tool must be Rotated +90_
Non-Recognizable Orienta­tion As Single String
Horizontal String
Note: The Non-recognizable example above could be inspected using 3 strings in one OCR Tool.
Character Height
It is recommended that the height of the characters in the inspected image be at least 24 pixels. Although it is possible to read characters which are smaller, the reliability of the inspection may be reduced. For best reliability, the characters should be at least 32 pixels high. Characters may be as tall as desired.
The inspected characters must be approximately the same height from inspection to inspection, but the OCR Tool can be reconfigured to handle a change in character size. If text appears in more than one size on a single image, different OCR Tools, with different character sizes, must be used.
Thinning of the taught character may provide some tolerance to small changes in size. If all of the inspected characters are increased or decreased in size by the same amount, you can use the Rescale function to reconfigure the tool to the new character height. This eliminates the need to re-teach a font when the height of the inspected characters changes.
2–4
Chapter 2
Introduction to OCR2-PAK
Character and String Spacing
When characters are taught, you use a Character Spacing box to set the distance between the centers of characters, both horizontally and vertically. No spacing between characters is required, however, characters should not overlap.
A B C D
Character Spacing Box sets both average distance between strings and average distance between characters.
The size of spaces between characters is defined by the Space Dimension box. This is used to detect spaces between characters.
E F G H
A C D
Space Dimension box sets the size of a space between adjacent characters.
Character Alignment
Vertical Alignment Characters within a string are considered part of the same string if the vertical distance between adjacent correlation boxes is less than 1/2 the height of the Character Spacing Box. If the distance is greater than 1/2 the Character Spacing Box, the character is part of another string. For optimum reliability, all of the characters in the string should be aligned vertically so that at least 50% or more of the characters overlap.
Spacing is greater than 1/2 the height of the character size box. This is seen as 2 separate strings: ABC F / DE.
Character
Spacing Box
E F G H
2–5
Chapter 2
Introduction to OCR2-PAK
Character Separation Characters are considered separate characters if the distance between the
1
correlation boxes is equal to or greater than
/2 the width of the Character spacing box. If the distance between the correlation boxes of two characters is less than 1/2 the width of the character spacing box, the OCR Tool will treat the two characters as a single confusion character and in most cases the tool will fail.
Space is less than 1/2 Character Spacing Box. The C and 1 will not be seen as separate characters.
Character
Spacing Box
Spaces When the distance between two printed characters is greater than the Character Spacing plus 1/2 the Space Dimension, a space is inserted into the read string.
Space is greater than the Character Spacing plus 1/2 the Space Dimension. A space will be inserted.
Character
Spacing Box
When the distance between the first or last characters and the left or right window boundary respectively is greater than the Character Spacing plus 1/2 the Space Dimension, a space is inserted before or after the read string.
Tool Window
2–6
Spacing is greater than the Character Spacing plus 1/2 the Space Dimen­sion. A leading space will be inserted.
No space inserted.
Chapter 2
Ñ
ÑÑÑ
ÑÑÑ
ÑÑÑ
ÑÑÑ
ÑÑÑ
Ñ
Introduction to OCR2-PAK
Gray Spaces
If the Gray Space option of the OCR Tool is enabled, each region of the image where a space is detected will be examined to determine the percentage of white pixels in the region. If the percentage exceeds a user–defined value, the space is called a white space. Otherwise, it is called a gray space, which indicates that it contains printing which is not recognizable as a character.
If the space between the tool window and the character string is large enough, the OCR Tool will also check for gray spaces in the regions immediately to the left and right of a string of printed characters. This enables the system to detect extra printing before or after the inspected string.
Character Rotation
If you expect the characters to rotate from inspection to inspection, you can use reference tools to correct for character movement and rotation within the field of view.
Some rotation may be acceptable without using a reference tool, if the characters were taught using the Thinning option.
= Character
= Character
= Taught Pixel Pattern
= Taught Pixel Pattern
Original Taught Pattern Thinned Pattern
A rotated character with un-thinned pattern may not correlate.
A thinned pattern is more tolerant to character rotation.
2–7
Chapter 2
Introduction to OCR2-PAK

Character / Background Contrast

Ambiguous Characters

The contrast between the inspected characters and the surrounding background must be great enough so that, when configuring the OCR Tool, a threshold can be set to effectively distinguish the inspected characters from the background.
Good Contrast Poor Contrast
There are several valid characters that can confuse OCR systems. Some numbers can be misread as letters and some letters can be read as numbers. Misreads are more likely to occur when the print quality is poor. The most ambiguous number and letter pairs are:
Number Letter
0 1 2 5 8
O
I Z S B

Character Quality

To prevent confusion between these characters, we recommend that you:
If possible, dont use ambiguous characters in the same string.
Use a different font. Some fonts have very little differences between
characters. For example, in the Courier font the lowercase L (l) and the number (1) 1 are almost identical.
Train the character templates carefully to reduce confusion between
similar characters.
The quality or clarity of the inspected characters affects the success of the character recognition. Extra markings or breaks in characters can result in failed or incorrect recognition of a character. You must determine if the variation in characters is acceptable and adjust the taught font characters accordingly.
2–8
Chapter 2
Introduction to OCR2-PAK

Other Character Restrictions

The following are some additional OCR Tool restrictions. However, these restrictions are unlikely to be encountered in most applications.
There is a maximum of 4 ambiguous (confused) characters per character
location in a string.
Maximum number of spaces = 32. This includes leading, internal, and
trailing spaces for all strings in the inspection window. Additional spaces are ignored.
Maximum number of character strings in the tool window = 4.
2–9
Chapter

Chapter Objectives

OCR2-PAK Installation

A–B
3
OCR2-PAK Installation
This chapter describes:
Installing OCR2-PAK
Accessing the OCR Tool
OCR2-PAK is provided on a memory card. You can only install OCR2 software in a CVIM2 module having Rev. B01 firmware or later.
To install OCR2-PAK:
1. Remove power from the module by turning off the power to the Pyramid Integrator or Vision Platform chassis.
Power Switch
Power Switch (Location Depends Upon Version)
Archive Memory Slot
CVIM2 in Vision Platform
2. Insert the RAM card in the CVIM2 Archive Memory slot.
3. Apply power to the module by turning on the power switch.
4. The module will boot up and begin the package loading sequence.
CVIM2 in Pyramid Integrator Chassis
Archive Memory Slot
3–1
Chapter 3
OCR2-PAK Installation
5. While the package is being installed, you will see the following message:
Loading package MC:OCR2–B01
into
V1:OCR2–B01
6. When the Memory Active LED goes off and the screen displays the CVIM2 power up message, the downloading is complete. Verify that the power–up banner shows that OCR2–PAK has been installed.
On subsequent powerups, you are provided with the option to abort the running of all installed packages:
6 seconds to package run

Accessing OCR2-PAK

Abort Package Run
If you abort the running of installed packages, the module will function as if the packages were not installed.
Note: You only need to install the OCR2-PAK once. After installation, OCR2-PAK remains installed for all subsequent powerups.
After OCR2-PAK is installed, OCR is listed as an option on the Tool Types panel as shown below.
Select to Create an OCR Tool
3–2
Chapter

Chapter Objectives

Procedure

A–B
4
OCR Tool Configuration
This chapter describes how to:
Create an OCR Tool
Configure an OCR Tool
The steps for creating an OCR Tool are listed below. You must perform the steps in the same sequence. If you are using Optical Character Verification (OCV), refer also to Chapter 6.
1)Add an OCR Tool in the toolset.
2)Edit the OCR Tool configuration.
3) Enter a Font Name.
4)Position Tool Window.
5)Set Threshold/Filter.
6)Set Character Size.
7)Enter and Teach characters.
8)Test taught characters.
9)Select string modes.
10)Enter match strings for OCV mode.
11) Select OCV options if required.
Refer to this Chapter
Refer to Chapter 5
Refer to Chapter 6
4–1
Chapter 4
OCR T ool Configuration

Adding an OCR Tool

To create an OCR Tool, choose Tools from the menu on the Toolset image display panel. The following panel appears allowing you to add a new OCR Tool or copy an existing one:
The following are brief descriptions of the Toolset Edit panel. Refer to the CVIM2 Reference Manual (Catalog No. 5370-801) for detailed information on editing a toolset.
Num
The sequence number of an inspection tool. it indicates the order in which the CVIM2 system processes the tool number. The currently selected tool is marked by an arrow.
4–2
Name
The inspection tool name. All tools are provided a default tool number such as Tool 1. Clicking on the current name displays the keyboard for entering a new name.
Type
The inspection tool type such as OCR. Clicking the tool type box for a tool displays the edit panel for that tool.
Enabled
Indicates whether the tool is enabled, Yes or No. Yes is the default.
Ref
Use this field to select a reference tool for the purpose of providing shift and/or rotation compensation for the selected inspection tool.
S1
use this field to select the primary image source for a tool from a camera (such as C1) or from an image buffer (such as P1).
S2
Secondary image column is not applicable since OCR2 works with only one image source.
Dst
Indicates the destination of the image. P1 is the default for an OCR Tool indicating that the destination is a processed image.
Chapter 4
OCR T ool Configuration
There are two ways to add tools to the Toolset:
one way creates a new tool
the other copies an existing tool which is modified
To create a new tool:
1. Choose either Add " or Add # button on the Toolset panel to add a tool
above or below the currently selected [!] tool. The following panel appears with tool type selections.
2. From the list, select OCR. Click the Done button. An OCR Tool is added to the list in the Toolset panel.
3. To edit tools, refer to next section Editing OCR Tools.
To copy an existing tool:
1. Select the OCR Tool to be copied by clicking the number using the mouse. The selected tool is indicated by an arrow[!].
2. Choose the Copy button and then the Paste" or Paste# button to place the copy OCR Tool before or after the the marked [!] tool.
3. The copied OCR Tool has the same attributes as the original tool.
4. To edit tools, refer to next section Editing an OCR Tool.
4–3
Chapter 4
OCR T ool Configuration

Editing an OCR Tool

To edit a new or existing OCR Tool, click OCR in the Type column of the tool listed in the Toolset Edit panel.
Click here to edit a tool.
The following OCR Tool Edit panel is displayed showing the current configuration of the OCR Tool being edited.
4–4
Chapter 4
OCR T ool Configuration

OCR Tool Edit Panel

OCR Tool Edit Panel Components
The following describe the components of an OCR Tool Edit panel.
Font Name
Indicates the currently active font. No Font appears in the box until a font is taught and added. Clicking in the Font Name box displays the Font Selection panel which allows you to select previously taught fonts or create a new font.
Gray Spaces
A gray space is a space (leading, trailing , or between characters) that contains a percentage of black pixels exceeding a preset limit. A white space contains a lower percentage (usually 0%) of black pixels. The black pixel limit is set using the Define Spacing function (see page 5–20).
If you select Yes for the Gray Space option, the OCR Tool will distinguish between gray and white space. If you select No, all spaces are treated as white space.
Below are examples of using the Gray Spaces option:
ABC - 123
Use gray space to detect a hyphen since hyphens are very difficult to teach.
Match String
ABC 123 x
Use gray space to detect any marking that trails the match string.
4–5
Chapter 4
OCR T ool Configuration
OCV Options
The Alpha, Numeric and Symbols options allow you to check for characters not contained in a match string, when using OCV mode. Otherwise the tool will not search for characters which are not present in the match string, and any other characters may be read as spaces.
Enabling these options will generally increase the inspection time of the tool. With these options disabled, OCV is faster than OCR because it can verify a string by processing only the characters contained in the match string instead of processing all taught characters in the font. The Gray Space option is in most cases a faster method of detecting extra characters not present in the match string.
Clicking on a check box selects the item.
Alpha specifies alphabetical characters (A ! Z and a ! z)
Numeric specifies numeric characters (0 ! 9)
Symbols selects all characters other than alphabetical or numeric
characters
Align
The Align option can be enabled only when the first string Mode is OCV. When Align is selected, the tool ignores all strings before the first string is matched. For example, you may want to match a string of characters that will not always appear on the first line in your window. The Align option allows you to ignore the characters on lines above the line that contains the first match string:
ABCD EFGH IJKL MNO
Inspection Window
ABCD is ignored. Match strings are aligned with first match.
Note: Even with the Align option enabled, the number of lines of characters in the OCR Tool window is still limited to 4.
Mode
Specifies one of four operating modes: OCR, OCR Strict, OCV, or OCV Strict. A selection of Disabled indicates that the string is not inspected.
4–6
Refer to page 4–15 for a description of the operating modes.
Chapter 4
OCR T ool Configuration
Match String
In OCV mode, the recognized characters are compared to Match Strings, and the tool will fail if the strings do not match. If you select the match string box with OCV mode selected, a keyboard will be displayed, allowing you to enter a match string.
Metacharacters can be entered with the keyboard or by selecting the metacharacter buttons at the top of the keyboard. The metacharacter buttons include:
[A-Za-f] Any alpha [0-9] Any number ? 0 or 1 occurrences of the preceding character * 0 or more occurrences of the preceding character + 1 or more occurrences of the preceding character
| OR operation
Refer to Chapter 6 for a complete description of match strings and metacharacters.
Subset
Subset allows you to inspect a portion of a string starting from the left or right end. The following options are available:
All
In this mode, all characters recognized (up to a maximum of 20) are included in the read string.
Left
When Left is selected and more than Len characters are recognized in a single string, the read string will consist of the left-most Len characters recognized.
Right
When Right is selected and more than Len characters are recognized in a single string, the read string will consist of the right-most Len characters recognized.
Note: The maximum number of characters per line = 40. Any characters over 40 per line are ignored.
Len
Applies to the Left and Right subset options. When a subset of a string is selected you must enter the length of the subset.
4–7
Chapter 4
OCR T ool Configuration
OCR Tool Edit Panel Buttons
The following are brief descriptions of the buttons on the OCR Tool Edit panel. Each of these functions is described in detail in the applicable section.
P&P Window
Initiates the Pick and Place function, which can move and size the OCR Tools processing window.
Thresh/Filter
Displays the Threshold / Filter panel used to adjust the high/low threshold settings and the Morph 1 filter.
Char Size
Allows you to set the size of characters within the OCR window. The character size must be set after the threshold/filter is set and before characters are taught.
Edit Font
Displays the Edit Font panel that allows you to teach and test OCR characters.
Test Match
Allows you to enter a string to be tested against the current match strings. This is used to test the operation of match strings which contain metacharacters. Refer to Chapter 6.
Done
Exits to the Edit Toolset panel.
4–8
Chapter 4
OCR T ool Configuration

Enter a Font Name

A font is a collection of characters that have been taught and stored under a font name.
To add a new font:
1. Click the in the Font Name box on the OCR Tool Edit panel The Font Selection panel is displayed allowing you to add a font name.
OCR Tool Edit Panel
Click in Font Name box
Font Selection Panel
2. Click the Add button. The keyboard is displayed allowing you to add a font name.
3. Enter a font name. A font name can be up to fifteen (15) characters, and can consist of any alphanumeric character (A-Z, a-z, 0-9). Spaces are not allowed. Also enter 3 character device type if not EE:. These 3 characters are in addition to the 15 for Font Name.
4. When completed select the Done button. The entered name appears in the Font Name box. Any taught characters
will be saved under that Font Name. The font name appears as an option in the Font Selection panel.
To add or edit characters in a font, refer to Chapter 5.
To delete a font:
Use the Filer function listed under the File menu. Refer to page 5–27
4–9
Chapter 4
OCR T ool Configuration

Position OCR Tool Window

This window defines the inspection area of a character string (strings). Move and adjust the window by clicking the P & P Window button on the OCR Edit panel and referring to the the following:
Pick & Place Panel
To move the Pick & Place Window
Click and hold down the mouse button in the middle of the window. Move the mouse while holding down the mouse button and drag the window over the characters to be read.
To size the Pick & Place Window
Click the mouse button on the corner of the window and drag the mouse until the window encloses all the characters to be read. You can also size the window using the arrow keys on the Pick and Place panel. Position the window around the strings to be read, allowing sufficient extra room to accommodate the expected movement of the strings within the field of view. You may want to provide space before and after the strings for leading and trailing spaces. Refer to space descriptions on page 2–6.
4–10
Loading...
+ 66 hidden pages