0% found this document useful (0 votes)
10 views35 pages

Documentation

The document describes how to access and use the NI OCR Training Interface from the Start menu, NI Vision Assistant, or NI Vision Builder AI. It also provides a tutorial on training characters with OCR using specific image files, including steps to draw regions of interest, train characters, modify settings to correctly segment characters, and review character specifications.

Uploaded by

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

Documentation

The document describes how to access and use the NI OCR Training Interface from the Start menu, NI Vision Assistant, or NI Vision Builder AI. It also provides a tutorial on training characters with OCR using specific image files, including steps to draw regions of interest, train characters, modify settings to correctly segment characters, and review character specifications.

Uploaded by

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

Accessing the OCR Training Interface

You can access the NI OCR Training Interface from the Start menu if the
NI Vision Development Module is installed. You can also access the NI
OCR Training interface from within NI Vision Assistant or NI Vision
Builder for Automated Inspection (Vision Builder AI).
From the Start Menu
To launch the OCR Training Interface from the Start menu, select
Start»All Programs»National Instruments»Vision»OCR Training.
From Vision Assistant
The OCR Training Interface opens from Vision Assistant in a wizard to
guide you through the creation of a new template. Complete the following
steps to launch the OCR Training Interface wizard in Vision Assistant.
1. Acquire or open an image that contains the characters you want
to read. Refer to the NI Vision Assistant Help for information
about acquiring or opening images.
2. To access the OCR/OCV Setup panel, select
Identification»OCR/OCV, or click OCR/OCV on the
Identification tab of the Processing Functions palette.
3. Click New Character Set File on the Main tab of the OCR/OCV
Setup panel.
From Vision Builder AI
The OCR Training Interface opens from Vision Builder AI in a wizard to
guide you through the creation of a new template. Complete the following
steps to launch the OCR Training Interface wizard in Vision Builder AI.
1. Acquire, or simulate the acquisition of, an image that contains the
characters you want to read. Refer to the Vision Builder for
Automated Inspection: Configuration Help for information about
acquiring images or simulating acquisitions.
2. On the Identify Parts tab of the Inspection Steps palette, click
Read/Verify Text.
3. Select the Mode tab on the Read/Verify Text Setup panel, and
click New Character Set File.
OCR Training Interface Tutorial
This tutorial walks you through the steps for training characters with OCR
using a specific set of images. This tutorial illustrates the various steps
required to train varying representations of the same characters.
This tutorial includes the following sections:
Training Characters with OCR
Reviewing Character Specifications
Saving the Character Set File
Training Characters with OCR
Complete the following steps to train characters with OCR:
1. Launch the OCR Training Interface.
2. Select File»Open Images.
3. Complete one of the following sets of steps to open the tutorial
images:
NI Vision and Vision Assistant
a. Navigate to <Vision>\Images\OCR Tutorial, where
<Vision> is the location to which you installed the
NI Vision Development Module.
b. Select the following images:
Tip You can select multiple image files by
pressing the <Ctrl> key and clicking each
file. Enable the Select all files checkbox to
open all images in the directory you
specified.
NIOCRExample1.tif
NIOCRExample2.tif
NIOCRExample3.tif
NIOCRExample4.tif
NIOCRExample5.tif
c. Click Open.
Vision Builder AI
a. Navigate to <Vision Builder AI>\DemoImg\OCR,
where <Vision Builder AI> is the location to which
you installed Vision Builder AI.
b. Select the following images:
Tip You can select multiple image files by
pressing the <Ctrl> key and clicking each
file. Enable the Select all files checkbox to
open all images in the directory you
specified.
NIOCRExample1.tif
NIOCRExample2.tif
NIOCRExample3.tif
NIOCRExample4.tif
NIOCRExample5.tif
c. Click Open.
4. Use the navigation buttons to locate NIOCRExample1.tif.
5. Verify that the Rotated Rectangle Tool is selected on the
OCR Training Interface toolbar. On the image, draw a region of
interest (ROI) around the characters.
Tip When you draw the ROI, exclude the barcode, but
ensure that the region you draw is large enough to
encompass possible locations of characters in the other
images you analyze.

OCR segments objects in the ROI, displaying them in blue and


drawing character bounding rectangles around them, according
to the settings on each of the tabs at the bottom of the dialog box.
On the Train/Read tab, Text Read displays recognized
characters and the substitution character based on the character
set file you are using. If you have not opened a character set file
or trained any characters, Text Read displays the substitution
character for each of the segmented objects in the ROI. For
example, in the previous illustration, Text Read contains six
substitution characters. Any object that is surrounded by a
character bounding rectangle is a segmented object.
You can specify the substitution character in the Read Options
tab.
6. Enter BACE30 in Correct String, then click Train.
7. Use the navigation buttons to locate NIOCRExample2.tif file.
When analyzing this image, OCR uses the ROI you drew on the
NIOCRExample1.tif image. Because the barcode in the
NIOCRExample2.tif file is positioned differently, the ROI
encompasses part of it, and OCR segments portions of the
barcode.
8. Enable the Reject Particles Touching ROI checkbox on the
Threshold tab to configure OCR to segment the characters
correctly without segmenting any portion of the barcode.
9. Set the Remove Particles (Erosions) control to 1.
Setting this control to 1 performs one erosion on the image. An
erosion decreases the size of the objects in the image by
removing a layer of pixels along the boundary of the particle.
Performing an erosion helps to separate the characters in the
image from the background of the image.

10. Enter B8F1E9 in Correct String, then click Train.


11. Navigate to the NIOCRExample3.tif file.
When analyzing this image, OCR uses the ROI you drew on the
NIOCRExample1.tif file and the settings you modified to correctly
segment the characters in the NIOCRExample2.tif file.
12. Verify that the objects in the ROI are segmented correctly.

13. Enter B7ODF4 in Correct String, then click Train.


14. Navigate to the NIOCRExample4.tif file.
When analyzing this image, OCR uses the ROI you drew on the
NIOCRExample1.tif file and the settings you modified to correctly
segment the characters in the NIOCRExample3.tif file. Because
the character size and spacing in the NIOCRExample4.tif file are
different from the character size and spacing in the other three
files you have used to train characters, OCR incorrectly
segments the two instances of the letter A.
15. Use the Results tab to review character specifications for the two
instances of the letter A.
16. Select the Size & Spacing tab. Based on the character size
statistics you viewed in the Results tab, change Max for the
Bounding Rect Width. For example, in the following image, Max
is set to 50 for Bounding Rect Width.

17. Enter B85AA6 in Correct String, then click Train.


18. Navigate to the NIOCRExample5.tif file.
When analyzing this image, OCR uses the ROI you drew on the
NIOCRExample1.tif file and the settings you modified to correctly
segment the characters in the NIOCRExample4.tif file.
19. Verify that the objects are segmented correctly.

20. Enter B8CE72 in Correct String, then click Train.


Reviewing Character Specifications
Use the Results tab to view statistics about the characters OCR
segmented in the ROI.
The following list includes descriptions of each of the columns on the
Results tab.
Character—Lists the index of each of the characters in the
current ROI.
Class—Lists, by index, the character value for each of the
characters you trained in the current ROI.
Left and Top—List, by index, the x and y coordinates of the top
left corner of each of the character bounding rectangles in the
current ROI. The status bar in the image viewer displays the Left
and Top coordinates of the character bounding rectangles as you
move the mouse over the image.
Width and Height—List, by index, the width and height of each
of the characters you trained in the current ROI.
Size—Lists, by index, the size of the character in pixels.
Class. Score(classification score)—Lists, by index, a value that
indicates the degree to which the assigned character class
represents the object value better than other character classes in
the character set. The range of values is 0 to 1000.
Verif. Score (verification score)—Lists, by index, a value that
indicates how closely a character matched its reference character
in the character set. The range of values is 0 to 1000. A value of
1000 indicates a perfect match between an object and the
reference character.
Note You can set a reference character for each class.
When you set a reference character, OCR returns a
verification score that indicates how closely the character
matched the reference character for its class. Use the
verification score to perform optical character verification.
OCR returns a value of 0 for the verification score if you do
not set a reference for a class.
Saving the Character Set File
Now that you have trained several characters, you are ready to save the
character set file. Each character set file contains the current state of the
OCR parameters as well as the characters you have trained.
1. Use the navigation buttons to scroll through each of the images
you used in this tutorial. Review each image and the information
in Text Read to ensure the characters are trained correctly.
Perform this step to ensure that the parameters you have set in
OCR enable you to train an optimum number of characters.
Because you will use this character set file in a reading
procedure, you must ensure that it contains a broad spectrum of
characters and parameters that configure OCR to correctly
segment characters on a broad variety of images.
2. Use the Edit Character Set File tab to review and modify the
character set you trained.
3. Select File»Save Character Set File, enter NIOCRTutorial.abc in
File Name for the character set file, and click OK to save the
character set.
Note You can use the NIOCRTutorial.abc character set file
in the examples that are available with OCR.
Training Characters
Selecting an ROI Tool for OCR
Training Characters
Training Single Characters or Patterns
Training Incorrect Characters
Verifying the Quality of Characters
Modifying the Character Set File
Selecting an ROI Tool for OCR
In OCR applications, you want to focus on specific areas of the image.
You can define these specific areas with region of interest (ROI) tools.
The following tools are available depending on the orientation of the text
in the image:
Rotated Rectangle ROI tool—Use this tool to draw a rotatable
rectangle in the image. Click and drag to select a rectangular
region. Press the <Shift> key while you click and drag to contain
the region to a square, and then click the lines inside the rectangle
and drag to adjust the rotation angle.
Annulus ROI tool—Use this tool to draw an annulus in the image.
Click the center position and drag to the size you want. Adjust the
inner and outer radii, and adjust the start and end angles.
The Annulus Orientation control becomes available when you
select the Annulus ROI tool. Choose one of the following options.
Baseline Inside—Select this option when the imaginary
line on which the bottoms of the letters align is closer to
the center of the annulus.
Baseline Outside—Select this option when the imaginary
line on which the bottoms of the letters align is closer to
the outside of the annulus.
Training Characters
Use the Train/Read tab to open images and train characters, and save
the character values to a character set file.
Complete the following steps to train characters:
1. Access the OCR Training Interface.
2. Select File»Open Images, and select the image or images you
want to use for training. You can select multiple image files by
pressing the <Ctrl> key and clicking each file. You can also
enable the Select all files checkbox to open all images in the
directory you specified.
3. Click Open.
4. Use the navigation buttons to locate the image you want to use
for training.
5. On the image, draw an ROI around the characters you want to
train.
Tip You can modify the view of the image if necessary.
The OCR Training Interface segments objects in the ROI,
drawing character bounding rectangles around them according to
the settings on each of the tabs at the bottom of the training
interface. Any object that is surrounded by a character bounding
rectangle is a segmented object.
On the Train/Read tab, Text Read displays recognized
characters and the substitution character based on the character
set file you are using. If you have not opened a character set file,
Text Read displays the substitution character for each of the
segmented objects in the ROI. For example, if the ROI contains
three segmented objects, Text Read contains three substitution
characters.
You can specify the substitution character in the Read Options
tab.
6. Use the Threshold, Advanced Threshold, Size & Spacing, and
Read Options tabs to set up the parameters you want to use in
the training process. Adjust threshold methods and settings and
make changes in the other tabs to configure OCR to draw
character bounding rectangles around objects in the ROI
appropriately. OCR displays objects in blue.
7. Select the Train All Characters option.
8. In the Correct String textbox, enter the character values you
want to associate with each of the objects in the ROI you
specified. The number of character values you enter must match
the number of objects found in the ROI.
9. Click Train.
10. If Text Read displays incorrect characters, adjust the parameters
on the Threshold, Advanced Threshold, and Size & Spacing
tabs to improve the results.
11. Repeat steps 3 through 10 to train additional characters.
12. Select File»Save Character Set File, enter a name for the
character set file, and click Save.
13. Use the navigation buttons to view each image. Ensure that Text
Read displays the correct characters for each image. If Text
Read displays the substitution character or an incorrect
character, adjust the parameters on the Read Options tab and/or
train the incorrect characters, and then save the character set
file.
Training Single Characters or Patterns
Complete the following steps to train single characters or patterns:
1. Access the OCR Training Interface.
2. Select File»Open Images, and select the image or images you
want to use for training. You can select multiple image files by
pressing the <Ctrl> key and clicking each file. You can also
enable the Select all files checkbox to open all images in the
directory you specified.
3. Click Open.
4. Use the navigation buttons to locate the image you want to use
for training.
5. On the image, draw an ROI around the characters you want to
train.
OCR segments objects in the ROI, drawing character bounding
rectangles around them according to the settings on each of the
tabs at the bottom of the training interface. Text Read displays
recognized characters and the substitution character based on
the character set file you are using. If you have not opened a
character set file, Text Read displays the substitution character
for each of the segmented objects in the ROI. For example, if the
ROI contains three segmented objects, Text Read contains three
substitution characters. Any object that is surrounded by a
character bounding rectangle is a segmented object.
6. Use the Threshold, Advanced Threshold, Size & Spacing, and
Read Options tabs to set up the parameters you want to use in
the training process. Adjust threshold methods and settings and
make changes in the other tabs to configure OCR to draw
character bounding rectangles around objects in the ROI
appropriately. OCR displays objects in blue.
7. Click Train Single Character.
8. Select the Index of the character you want to train. OCR displays
the character bounding rectangle of the corresponding character
with a different color.
9. Enter the appropriate character value in Correct String.
10. Click Train.
Training Incorrect Characters
Use Train Incorrect Characters to train incorrect characters in a
segmented object, or to avoid training characters individually. Although
you must enter character values for all segmented objects in Correct
String, OCR trains only objects that do not have a match or have an
incorrect match in Text Read.
For example, if you analyze an image that contains the letters A, P, and R
and you train these letters, saving them to a character set file, you can
later use the character set file to train characters on another image. If the
second image contains the letters A, P, R, and O, OCR displays the
recognized characters, A, P, and R, and replaces O with the substitution
character in Text Read. You can use Train Incorrect Characters to train
O without selecting it individually.
You also train incorrect characters when OCR displays the wrong
character value for a segmented object. For example, if an ROI contains
the letters A, P, R, and O and Text Read includes the letter B instead of
P, you can use the Train Incorrect Characters option to correctly train
the letter P.
Complete the following steps to train incorrect characters:
1. Access the OCR Training Interface.
2. Select File»Open Images, and select the image or images you
want to use for training. You can select multiple image files by
pressing the <Ctrl> key and clicking each file. You can also
enable the Select all files checkbox to open all images in the
directory you specified.
3. Click Open.
4. Use the navigation buttons to locate the image you want to use
for training.
5. On the image, draw an ROI around the characters you want to
train.
OCR segments objects in the ROI, drawing character bounding
rectangles around them according to the settings on each of the
tabs at the bottom of the training interface. Text Read displays
recognized characters and the substitution character based on
the character set file you are using. If you have not opened a
character set file, Text Read displays the substitution character
for each of the segmented objects in the ROI. For example, if the
ROI contains three segmented objects, Text Read contains three
substitution characters. Any object that is surrounded by a
character bounding rectangle is a segmented object.
6. Use the Threshold, Advanced Threshold, Size & Spacing, and
Read Options tabs to set up the parameters you want to use in
the training process. Adjust threshold methods and settings and
make changes in the other tabs to configure OCR to draw
character bounding rectangles around objects in the ROI
appropriately. OCR displays objects in blue.
7. Click Train Incorrect Characters.
8. Enter the appropriate character values in Correct String,
including the previously trained and recognized characters, and
click Train.
Verifying the Quality of Characters
Complete the following steps to verify the quality of characters you have
trained.
1. Click the Edit Character Set File tab.
2. Click on the most representative character, known as the
reference character, for each class in the image window.
3. Enable the Reference Character checkbox.
Note The OCR Training Interface displays a warning if
you do not specify a reference character for all classes.

4. Select the Train/Read tab.


5. Select the Results tab.
6. On the image, draw an ROI around the characters.
The Verif. Score (verification score) on the Results tab indicates
how closely the character read matched the reference character
you specified for that class. The range of values is 0 to 1000. A
value of 1000 indicates a perfect match between an object and
the reference character.
Modifying the Character Set File
Use the Edit Character Set File tab to review and/or modify the contents
of a character set file.
Complete the following steps to review and/or modify a character set file:
1. Select File»Open Character Set File, select the character set
file you want to review and/or modify, and click Open.
2. Select the Edit Character Set File tab.
The browser displays the trained characters.
3. If you want to rename a character, select the character in the
browser and click Rename. Type the new character value in New
Class and click OK.
Tip If you rename a reference character, its reference
designation is removed. Reset the character as a
reference character after you rename it.
4. If you want to delete a character from the character set file, select
the character in the browser and click Delete or press the
<Delete> key.
5. If you want to set a character as a reference character to perform
optical character verification (OCV), select the character or
characters in the browser and enable the Reference Character
checkbox. An overlay indicates that the character is now a
reference character. A warning indicates if you have not selected
a reference character in all classes.
Note When you set a reference character, OCR returns a
verification score that indicates how closely the character
matched the reference character for its class. Select the
Train/Read tab, then select the Results tab to view the
verification score.
6. Select All Trained Characters to display the entire contents of
the character set file in the browser. To display characters of only
one class value, select Characters of Class and select the
character you want to view.
Samples displays the number of instances of the selected
character class in the character set file.
The Character Histogram graphically displays the number of
instances of each character value in the character set.
Configuring OCR Settings
Setting Up the Threshold
Setting Up the Advanced Threshold
Setting Up Character Size and Spacing Criteria
Setting Up Read Options for the Training Process
Reviewing Character Statistics
Setting Up the Threshold
Use the settings on the Threshold tab to determine how you want OCR
to calculate the threshold value it uses to segment objects on an image.
Complete the following steps to set up thresholding:
1. Select the Threshold tab, and select a threshold Mode:
Fixed Range—A method in which you manually
determine the threshold value for the entire ROI.
Uniform—A method in which OCR calculates a single
threshold value for the entire ROI.
Linear—A method in which OCR divides an ROI into the
number of blocks you specify, calculates a threshold
value for the first and last boxes, then linearly interpolates
values for the blocks in between.
Non Linear—A method in which OCR divides the ROI
into the number of blocks you specify, and calculates a
threshold value for each block. Specify the number of
blocks on the Advanced Threshold tab.
2. If you selected Fixed Range in Mode, use Min and Max, or the
slider at the bottom of the histogram, to set the threshold value.
3. If you selected Uniform, Linear, or Non Linear in Mode, select
Dark on Light in Characters if the image contains dark
characters on a light background. Select Light on Dark in
Characters if the image contains light characters on a dark
background.
4. Enable the Reject Particles Touching ROI checkbox to ignore
particles that are touching the border of the ROI you drew.
5. In Remove Particles (Erosions), select the number of erosions
you want OCR to perform to remove small particles from the ROI.
As you manipulate settings on the Threshold tab, OCR displays
segmented objects in blue.
Tip If the objects in the ROI are not segmented as you
expect them to be, experiment with settings on the
Threshold, Advanced Threshold, and Size & Spacing tabs
to improve the segmentation.
Setting Up the Advanced Threshold
Use the Advanced Threshold tab to set up additional options for the
Non-Linear threshold methods. If you selected Fixed Range in Mode on
the Threshold tab, the options on the Advanced Threshold tab are not
available.
Complete the following steps to set up additional options for thresholding:
1. Use Lower Value and Higher Value to determine the threshold
limit that OCR uses to calculate the threshold.
2. Enter the # of Blocks you want to use with the Linear and Non-
Linear threshold calculation methods.
3. If speed takes precedence in calculating the threshold, enable
Optimize for Speed to perform the thresholding calculation more
quickly, but less accurately. If accuracy takes precedence, disable
Optimize for Speed to perform the thresholding calculation more
slowly, but more accurately.
If you enable Optimize for Speed, you also can enable Bi
modal Calculation to enable OCR to calculate both the upper
and lower threshold levels for images that are dominated by two
pixel intensity levels. If you enable Bi modal Calculation, OCR
disregards the pixel intensity level setting you selected in
Characters on the Threshold tab.
Tip If the objects in the ROI are not segmented as you
expect them to be, experiment with settings on the
Threshold, Advanced Threshold, and Size & Spacing tabs
to improve the segmentation.
Setting Up Character Size and Spacing Criteria
Use the Size & Spacing tab to indicate the character size and spacing
values required for character recognition. OCR does not recognize any
characters in the ROI that do not meet the criteria you set here.
Modify the fields on the Size & Spacing tab to set up the character size
and spacing requirements.
AutoSplit—Allows you to configure OCR to handle slanted
characters.
Bounding Rect Width—Indicates the width limits, in pixels, for
the character bounding rectangle.
Bounding Rect Height—Indicates the height limits, in pixels, for
the character bounding rectangle.
Character Size—Indicates the size (area) requirements, in
pixels, for an object in an ROI to be considered a character that
can be trained.
Min Char Spacing—Indicates the minimum amount of space, in
pixels, that can be between characters in the ROI you specified.
This value must be greater than Max Element Spacing (x).
Max Element Spacing (x)—Indicates the maximum amount of
space, in pixels, that can be between horizontally adjacent
elements, such as in dot-matrix objects. This value must be less
than Min Char Spacing.
Max Element Spacing (y)—Indicates the maximum amount of
space, in pixels, that can be between vertically adjacent
elements.
Tip If the objects in the ROI are not segmented as you
expect them to be, experiment with settings on the
Threshold, Advanced Threshold, and Size & Spacing tabs
to improve the segmentation.
Setting Up Read Options for the Training
Process
Use the Read Options tab to determine how OCR processes the image
to detect characters.
Complete the following steps to configure the OCR reading process:
1. Select a Read Strategy.
Conservative—Configures OCR to use extensive criteria
to determine if read characters match trained characters.
Aggressive—Configures OCR to use few criteria to
determine if read characters match trained characters.
The Aggressive strategy processes images faster than the
Conservative strategy.
2. To configure OCR to consider character size during the read
process, select Aspect Ratio Dependent and select an Aspect
Ratio value to indicate the allowable difference, as a percentage,
between the training and reading character size and height/width
ratio. The minimum value is 100 percent, which indicates that the
read character must be the exact same size as the trained
character.
3. Select the Read Resolution to determine the level of character
detail you want OCR to use during the reading procedure.
4. Select an Acceptance Level value to indicate how closely an
object must match a trained character to be a recognized
character. The range of values is 0 to 1000.
5. Enter the Substitution Character you want OCR to use for
objects that are not yet trained and recognized.
Reviewing Character Statistics
Use the Results tab to view statistics about the characters OCR
segmented in the ROI.
The following list includes descriptions of each of the columns on the
Results tab.
Character—Lists the index of each of the characters in the
current ROI.
Class—Lists, by index, the character value for each of the
characters you trained in the current ROI.
Left and Top—List, by index, the x and y coordinates of the top
left corner of each of the character bounding rectangles in the
current ROI. The status bar in the image viewer displays the Left
and Top coordinates of the character bounding rectangles as you
move the mouse over the image.
Width and Height—List the width and height of each of the
characters you trained in the current ROI.
Size—Lists, by index, the size of the character in pixels.
Class. Score (classification score)—Lists, by index, a value that
indicates the degree to which the assigned character class
represents the object value better than other character classes in
the character set. The range of values is 0 to 1000.
Verif. Score (verification score)—Lists, by index, a value that
indicates how closely a character matched the reference
character from its assigned class. The range of values is 0 to
1000. A value of 1000 indicates a perfect match between an
object and the reference character.
Note You can set a character as reference for each class.
When you set a reference character, OCR returns a
verification score that indicates how closely the character
matched the reference character for its class. Use the
verification score to perform optical character verification.
OCR returns a value of 0 for the verification score if you do
not set a reference for a class.
Navigating Images
You can use the toolbar buttons to navigate the images you opened for
training. Refer to the following button descriptions for information about
how to view images.
First Image—Navigates to the first image in the list of images you
opened.
Previous Image—Navigates to the previous image.
Next Image—Navigates to the next image.
Last Image—Navigates to the last image in the list of images you
opened.
Developing OCR Applications
Use the following OCR examples to learn how to use the NI OCR
Training Interface to create OCR applications in LabVIEW,
LabWindows/CVI, or Microsoft Visual Basic:
LabVIEW OCR example
LabWindows™/CVI™ OCR example
Microsoft Visual Basic OCR example
Viewing Images
You can use the toolbar buttons to view images in greater or lesser detail.
Refer to the following button descriptions for information about how to
view images:
Zooms in on an image.
Zooms out on an image.
Displays an image at regular magnification.
OCR Example for LabVIEW
You can use the OCR example for LabVIEW to perform OCR on an
image using the character set file you created with the OCR Training
Interface Tutorial.
Complete the following steps to use the OCR example for LabVIEW:
1. Navigate to <LabVIEW>\examples\Vision\2.Functions\OCR\OCR
First Example.llb and open the OCR First Example VI, where
<LabVIEW> is the location to which you installed LabVIEW.
2. Run the VI.
3. Click Open Character Set File and open the NIOCRTutorial.abc
file you created upon completing the OCR Training Interface
Tutorial.
4. Click Open Image, select one of the NIOCRExample* image files,
and click Open.
5. Draw an ROI on the image and click Read.
Read String displays the recognized characters and the
substitution character.
Time (ms) displays the amount of time it took OCR to
read the image.
6. Click Return to exit the example.
OCR Example for LabWindows/CVI
You can use the OCR example for LabWindowsTM™/CVI™ to classify
samples using the file you created with the NI OCR Training Interface
Tutorial.
Opening the LabWindows/CVI OCR Example
The location of the example depends on the operating system and
version of LabWindows/CVI. To open the example, choose one of the
following paths:
For LabWindows/CVI 8.5, navigate to
<CVI>\Samples\Vision\2.Functions\OCR\OCR First Example.prj,
where <CVI Application> is the location to which you installed
LabWindows/CVI.
For LabWindows/CVI 8.5.1 on Windows Vista, navigate to
C:\Users\Public\Documents\National
Instruments\CVI\Samples\Vision\2.Functions\OCR\OCR First
Example.prj.
For LabWindows/CVI 8.5.1 on Windows XP/2000, navigate to
C:\Documents and Settings\All Users\Documents\National
Instruments\CVI\Samples\Vision\2.Functions\OCR\OCR First
Example.prj.
Using the LabWindows/CVI OCR Examples
1. Select Build»Configuration»Debug, and then Select
Run»Debug OCR First Example.exe to run the example.
2. Click Open Character Set File and open the NIOCRTutorial.abc
file you created upon completing the OCR Training Interface
Tutorial.
3. Click Open Image, select one of the NIOCRExample* image files,
and click Load.
4. Draw an ROI on the image and click Read.
Read String displays the recognized characters and the
substitution character.
Time (ms) displays the amount of time it took OCR to
read the image.
5. Click Quit to exit the example.
OCR Example for Microsoft Visual Basic
You can use the OCR example for Microsoft Visual Basic to perform OCR
on an image using the character set file you created with the OCR
Training Interface Tutorial.
Complete the following steps to use the OCR example for Microsoft
Visual Basic:
1. Open the example.
For Microsoft Visual Basic 6.0, navigate to
<Vision>\Examples\MSVB\2.Functions\OCR, where
<Vision> is the location to which you installed the NI
Vision Development Module, and open the OCR First
Example.vbp file.
For Microsoft Visual Basic .NET, navigate to
<Vision>\Examples\MSVB.NET\2.Functions\OCR, where
<Vision> is the location to which you installed the NI
Vision Development Module, and open the OCR First
Example.vbproj file.
2. Run the example.
3. Click Open Character Set File and open the NIOCRTutorial.abc
file you created upon completing the OCR Training Interface
Tutorial.
4. Click Open Image, select one of the NIOCRExample* image files,
and click Open.
5. Draw an ROI on the image.
Read String displays the recognized characters and the
substitution character.
Time (ms) displays the amount of time it took OCR to
read the image.
6. Click Quit to exit the example.

You might also like