Optical Character Verification (OCV) in NI LabVIEW

Updated Jun 20, 2023

In NI Vision Development Module IMAQ OCR Verify Text VI is responsible for verification of the text in the image.  For each character, the VI checks for the existence of a reference character for the expected character class and compares the character from the image to the reference character.
This example demonstrates the utilization of the corresponding VI.

The instructions could be found also inside OCR Example Verification.vi.
1. Select the Path to the image file with the Text.
2. Select the path to the Character Set File.
3. Run the VI and select ROI with the text
4. Pay attention to the Character Reports: When you change the number of the element you can see corresponding Character Value. 
The Verification score is 0. The Verified LED indicator is showing FALSE. 
5. Change Character Index value until the Verified indicator is showing TRUE. After that you can see also the verification score. 

1. OCR Example Verification. This is about OCR IMAQ verify text.vi
It is used together with OCR IMAQ set reference character.vi. When you run the example, select ROI it is recognized by your program. However, in the Character reports cluster, there is a section Verification Scores which is 0 at the beginning. The VI that you have requested provides the same thing (OCR IMAQ verify text.vi) - verification scores. In order the verification scores to be non-zero and provide real numbers of comparison of OCR with the ".abc" file you need to change the value of Character Index (on the OCR IMAQ set reference character.vi). When you reach the correct number the verification score appears to be more than 900. Next, you can write a phrase or some letters in the "Expected string" on the (OCR IMAQ verify text.vi) and after that, you will see the verification scores of your searched text. 

2. OCR Example set valid.vi - This shows how the "OCR set Valid characters.vi" is functioning.
If you expect that in your ROI there will be for example 1 upper case and 1 lower case letter in the "Valid character" array first element you select Upper case, in the second element Lower case. So if in the ROI you have the configuration it will read only these two letters. The rest of the text in the ROI will be ignored. There are some possible variations. For example, if the second symbol is a number it will appear as a question sign.

VI Front Panel
OCR Example Verification vi.png