IMAQ Vision also provides some tools for the machine recognition of characters, similar to the digital instrument example; in the basic version of the IMAQ Vision toolkit, only the functions for bar code reading are implemented. The reading of text characters , or optical character recognition (OCR), can only be implemented by addition of the IMAQ Vision OCR toolkit.
Text Reading (OCR)
OCR is a method that converts images containing text areas into computer editable text files. The IMAQ Vision OCR toolkit can read text in capital and printed letters . An additional group of functions can be used to "unwrap" characters that are not located in a straight line, for example, the number on a compact disc (see Figure 5.63), before the OCR process begins.
Figure 5.63. Characters to "Unwrap" on a Compact Disc
Bar Code Reading
As mentioned before, bar code reading is included in the basic IMAQ Vision functions. An example including some bar code images is part of the IMAQ Vision Examples set and is easy to modify for our purposes.
In the examples section on the attached CD-ROM, I provide four special images in two different bar code languages:
Figure 5.64. Bar Code Reading Example (Code 39 Setting)
Figure 5.65. Bar Code Reading Example (EAN 13 Setting)
The function that performs the bar code reading is IMAQ Read Barcode . In general, the program works with the following bar code languages:
To calculate the ISBN bar code of books, skip the last number of the ISBN; for example, the ISBN 0-12-206092-X is turned into the number 012206092. After that, add 978 to the beginning. These two steps lead to the 12-digit number 978012206092 (compare with Figure 5.65).
The procedure of the VI is very similar to that of the LCD example: just draw an ROI in the first image (as long and as narrow as possible) and the program is ready to convert bar codes according to the type setting control.
Image Focus Quality