Deep Learning OCR

Deep Learning OCR

The Deep Learning OCR tool reads text from images using Deep Learning Optical Character Recognition.
This tool locates and recognizes characters. Without additional training, it is suitable for reading characters:
  • Horizontally-oriented,
  • Height between 85% and 115% of Char Height (in pixels)
  • Contain latin letters (upper- or lower-case), digits or one of: !#$%&()*+,-./:;<=>?@[]^_`{|}~"'\€£¥.
The Deep Learning OCR ROI may be used to limit the analyzed area, which, in most cases, leads to improved performance. Moreover, it may be used to adjust to text which is not horizontally oriented.
The Average Character Height should be set to the average height of characters (specifically, capital letters) in the analyzed area. For example, if an image contains two kinds of characters: one is 24 pixels high and the second is 40 pixels high, the Average Character Height should be set to 32, irrespective of the number of characters of each kind.
In the case of fonts with exceptionally narrow or wide symbols, Character Width Scale may be used to reshape them to a more "typical" aspect ratio. The analyzed area will be scaled by Character Width Scale on the horizontal axis. It may improve the quality of results. Furthermore, it may help read a text with tight spaces between subsequent characters.
To limit the set of recognized characters, Character Range may be used. This string must be formatted according to the following rules:
  • Allowed characters must be separated with commas,
  • for ease of use, a continuous range of letters or digits may be written as starting_character-ending_character, e.g. A-Z or 1-6,
  • comma and backslash have to be prepended with a backslash.
For example, Character Range equal to A-F,g-o,0-9,X,Y,Z,-,\\,\, will result in recognizing only ABCDEFXYZghijklmno0123456789-\, characters.
The Minimum Confidence parameter may be used to change the minimum score of a character. By default, this threshold is set to 80%.
The Contrast Threshold and Text Color parameters set a desired contrast interval of a character, which may be used to reduce the number of false positives:
  • Text Color: Bright; only characters with contrast greater than Contrast Threshold are returned.
  • Text Color: Dark, only characters with contrast lower than -Contrast Threshold are returned.
  • Text Color: Any, only characters with contrast lower than -Contrast Threshold or greater than Contrast Threshold is returned.
which is darker than its background, has a negative contrast. The opposite situation results in positive contrast.
Deep Learning OCR Settings
Setting
Description
Minimum Confidence
Sets a minimum required score for a character to include in the algorithm or output.
Tweaking this value downwards can help include decodes of slightly lesser confidence to ultimately get the desired output.  For example, the above example is too strict, and ultimately does not decode various characters.   As you will see below, lowering this value from 99 to 98 yields a better result.
Average Character Height
Use the slider to select a value close to the average pixel height of text that is trying to be decoded. Performance improves the closer this value is to the average character height (in pixels).
  • Minimum Value: 8
  • Default Value: 25
  • Maximum Value: 200
Text Color
Set a required polarity for a character to be returned.
  • Minimum Value: -100
  • Default Value: 0
  • Maximum Value: 100
Default Value: Any
Contrast Threshold
Sets a threshold for a contrast of found characters.
Default value: 0.0f
Character Width Scale Percentage
Scales image width by the given factor (%).
  • Minimum Value: 10%
  • Default Value: 100%
  • Maximum Value: 1000%
Character Range
Limits the set of wanted characters.
Default value: \"A-Z,a-z,0-9,\\\\\\\\,/,-\
String Match
Defines a string that must be contained within decoded OCR output for the tool to pass (for example, substring)
Enable the Regex checkbox to use regex expressions for more complex string match logic. Regex is a public protocol that uses text strings to create patterns that help match, locate, and manage text. 
Timeout
Sets a period of time after which the tool fails.
Invert
Flips the end results of this tool.
To use Deep Learning Based OCR with RegEx, enable the RegEx checkbox and provide an expression for the OCR tool to locate. The example below searches for the expression  ^22\d{3}.