Read/Verify Text Controls

NI Vision Builder

Identify Parts

Read/Verify Text Controls

Refer to the NI OCR Training Interface Help for information about the controls on the NI OCR Training Interface.

Main Tab

The following controls are available on the Main tab.

Control Name Description
Step Name Name to give the step.
Region of Interest The region of interest you want to use for the step.
Reposition Region of Interest When enabled, the step dynamically repositions the region of interest based on a coordinate system you built in a previous step.
Annulus Orientation Specifies which edge of an annulus region of interest to use as the baseline of the text to read/verify. The following options are available:
  • Baseline Inside—Specifies that the imaginary line on which the bottoms of the letters align is closer to the center of the annulus.
  • Baseline Outside—Specifies that the imaginary line on which the bottoms of the letters align is closer to the outside of the annulus.

Mode Tab

The following controls are available on the Mode tab.

Control Name Description
Character Set Path Path of the character set you want to use to recognize the characters. A character set file contains a unique representation for each trained character, as well as its corresponding value.
New/Edit Character Set File Creates a new character set file or edits an existing one.
Read Text Determines the characters in the image based on the specified character set and verifies each character against the corresponding reference character in the character set.
Verify Text Verifies each character against the corresponding reference character in the character set.
Text to Verify Source of the expected text. The value can either be a manually entered string, by selecting Constant, a string result from a previous measurement, or the value of a string variable.
Value If Read Text is selected, Value displays the text read by the OCR engine. If Verify Text is selected, Value specifies the value of the text to verify.

Threshold Tab

The following controls are available on the Threshold tab.

Control Name Description
Mode Specifies the type of threshold you want to perform. The following options are available:
  • Fixed Range—Determines the threshold value for the region of interest.
  • Uniform—Calculates a single threshold value for the region of interest.
  • Linear—Divides a region of interest into the number of blocks you specify, calculates a threshold value for the first and last blocks, and then linearly interpolates values for the blocks between the first and last blocks.
  • Nonlinear—Divides the region of interest into the number of blocks you specify and calculates a threshold value for each block.
Characters Specifies the relative intensity value of a character with respect to the background of the image. Use character color to specify whether the character set includes light characters on a dark background or dark characters on a light background.
# of Blocks Specifies the number of blocks that the region of interest is divided into when you use the Linear or Nonlinear Mode.
Range Min Minimum threshold value.
Range Max Maximum threshold value.
Ignore Objects Touching Region Borders When enabled, ignores objects that are touching the border of the region of interest.
Remove Small Objects (# of Erosions) Specifies the number of erosions you want OCR to perform to remove small objects from the region of interest.

Size Tab

The following controls are available on the Size tab.

Control Name Description
Autosplit Allows you to configure OCR to handle slanted characters.
Min Bounding Rect Width Minimum width limits, in pixels, for the character bounding rectangle.
Max Bounding Rect Width Maximum width limits, in pixels, for the character bounding rectangle.
Min Bounding Rect Height Minimum height limits, in pixels, for the character bounding rectangle.
Max Bounding Rect Height Maximum height limits, in pixels, for the character bounding rectangle.
Min Character Size Minimum size requirements, in pixels, for an object in a region to be considered a character that can be trained.
Max Character Size Maximum size requirements, in pixels, for an object in a region to be considered a character that can be trained.
Min Character Spacing Minimum amount of space, in pixels, that can be between characters. This value must not be less than Max Horizontal Element Spacing.
Max Horizontal Element Spacing 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 Character Spacing.
Max Vertical Element Spacing Maximum amount of space, in pixels, that can be between vertically adjacent elements.

Options Tab

The following controls are available on the Options tab.

Control Name Description
Read Strategy Specifies how selective the step is in determining if read characters match trained characters. The following options are available:
  • Conservative—Configures OCR to use extensive criteria to determine if read characters match trained characters.
  • Aggressive—Configures OCR to use fewer criteria to determine if read characters match trained characters. The Aggressive strategy processes images faster than the conservative strategy.
Read Resolution Level of character detail the step uses to determine if an object matches a trained character.
Acceptance Level Value to indicate how closely an object must match a trained character to be a recognized character. The valid range of values is 0 to 1000. A value of 1000 indicates a perfect match between an object and a trained character.
Substitution Character Specifies a character you want the step to use for objects that are not yet trained and recognized.
Aspect Ratio Dependent Configures OCR to read characters whose size is between a range.
Aspect Ratio Specifies how much larger or smaller, in percentages, the characters can be compared to the trained character. To maintain performance in the OCR process, limit the difference to ±50. Avoid creating character sets whose characters differ only in height and width. Consider separating the characters into different character sets, using valid characters to restrict trained characters, and enforcing the aspect ratio.
Use Text Pattern Specifies whether you want to define a pattern of characters that you expect read strings to follow.
Specify Text Pattern Launches the Pattern Setup dialog box in which you can specify a pattern that you expect the character string being read to follow. You can instruct the OCR engine that the first character expected is a letter, the second character a digit, and so on. Doing so increases the speed and accuracy of recognition.
Value Displays the text read by the OCR engine.

Limits Tab

The following controls are available on the Limits tab.

Control Name Description
Text Equals When enabled, the read text must equal this string in order for the step to pass.
Text Contains When enabled, the read text must contain this string in order for the step to pass. You can use the following wildcards:

Special Character Interpretation
. Matches any character.
? Matches zero or one instances of the expression proceeding ?.
[ ] Encloses alternates. For example, [abc] matches a, b, or c. The following characters have special significance when used within the brackets:
- (dash) Indicates a range when used between digits or letters (for example, [0-5], [a-g], or [L-Q])

The following characters have significance only when they are the first character within the brackets:
~ Excludes the set of characters, including non-displayable characters. [~0-9] matches any character other than 0 through 9.
^ Excludes the set with respect to all the displayable characters (and the space characters). [^0-9] gives the space characters and all displayable characters except 0 through 9.
Minimum Verification Score When enabled, the verification score for all characters must be equal to or greater than the specified score.
Minimum Classification Score When enabled, the classification score for all characters must be equal to or greater than the specified score.
Value Displays the text read by the OCR engine.