The MIL StringReader Interactive Utility allows you to create or
edit an existing context to modify advanced settings and
constraints. The utility provides a way to modify settings and
preview your results in a streamlined process. Once you are
satisfied with the results, you can import the context into Matrox
Design Assistant.
The following procedure provides a basic methodology for
creating and testing a context:
-
Create or open a new context.
-
Add a
font to the context.
-
Add a
string model to the context.
-
Optionally, define
a search region.
-
Set
the number of strings to read.
-
Preprocess
and read.
-
View the
results.
-
Optionally, use
String Expert to diagnose results.

Create or open
a new context
If you want to import an already existing context, click on the
Import
button.
If you are creating a new context, it is recommended that you
use the .msr file suggested by Matrox Design Assistant. The context
that is created is empty and you will need to add string model(s)
and at least one font to it. To do so, perform the following:
-
Click on the Create button to start
opening the MIL String Reader Interactive Utility. Matrox Design
Assistant will create a blank context file and automatically import
it the first time it is saved.
-
Click on Copy
Path to Clipboard and then click on OK.
-
Once the MIL String Reader Interactive Utility is opened, import
the blank context by opening the
Open dialog and pasting the path you copied in step 2.
Once you are done modifying the context file, saving will
automatically import it into Matrox Design Assistant.

Add a font
To add a font, click on Font Add from the
Fonts tab. You
can add a system font or a user-defined font from an image.
-
To define a font from an image, select UserDefined as the Mode and
open an image which has the characters you are required to define.
Draw a bounding box around the characters. In the Fonts tab, specify the
characters which you are defining and click on Add.
-
To separate characters that are located on different lines, use
a space.
-
The image you open must be 1-band, 8-bit unsigned.
-
To add a system font, select SystemFont as the Mode. To
constrain the list of characters in the font, you can specify them
or put a filter on the characters by choosing the appropriate one
from the dropdown list.

Add a string
model
To add a string model, click on String Add from the
String Models
tab to add a new string model to the context. You can specify
properties such as the string and character score, minimum and
maximum scale factor for the characters and put a constraint on the
list of characters that can appear at each position.
-
The Score tab
allows you to specify the acceptance and certainty score for a
string or character. The higher the score, the better the
candidate. If a string's score is higher than the specified
acceptance threshold, then it is accepted by the read operation. If
it is higher than the certainty score, then the read operation will
stop searching for a better candidate. This will result in less
image analysis and can speed up the read operation. For more
information on scores, see the StringReader step scores section
earlier in this chapter.
-
The String
and Characters
tab allow you to specify the minimum and maximum scale factor and
aspect ratio.
-
The Constraints tab allows you
to create rules to place constraints on the characters. To create a
rule, set the type of character, the font and a list of valid
characters that can appear for that position.
These settings can also be modified from Matrox Design
Assistant.

Define a search
region
You can optionally specify a search region to limit the area the
utility will search for strings. To do so, perform the
following:
-
Open your image by using the File Open menu item.
-
Define the region by using your mouse to enclose the area of
interest.
The whole image will be used if you do not define a search
region.

Set the
number of strings to read
Set the total number of strings that can be read with the
context by specifying the String Number property in
the General tab.
By default, one string will be read. If you set the property to
All, all strings
will be read. Note that this setting can increase the read time. It
is recommended you set String Number to a specific
number whenever possible.

Preprocess and
read
Before you can read a string from the target image, you must
preprocess it. Preprocessing essentially makes the context ready
for the read operation. If you make any changes to the context, one
of its fonts, or string models, you will need to preprocess the
context again. To preprocess a context, click on the Preprocess button in the
String Reader
Context tab.
When you save the String Reader context, the preprocessing
changes are not saved. Upon restoration, you must preprocess the
context again.
Once the context has been preprocessed, the read operation can
be performed by clicking on the Read button.

Viewing results
After a read operation has been performed, you can view the
results from the Results
pane. If any strings were found, the target image is overlayed with
a bounding box around the string.
Once you are satisfied with the results, you can import the
context into Matrox Design Assistant.

Using String
Expert
String Expert allows you to diagnose your results and view a
report on why a string was not read. The following shows the basic
methodology of using String Expert.
-
Draw a bounding box around the string you want to read.
-
From the String
Expert tab, specify the Target String you expect the
StringReader
step to read.
-
Enable Report
Errors and Report Warnings.
-
Click on Start
Expert to start the process.
For each string model you have defined, String Expert will give
you a report on the settings that are preventing the StringReader step from
reading the string.