Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

In LabView OCR is there a way force a "number only" answer

I have an OCR application and certain characters will always be numbers and certain characters will always be letters.  I have tried using the "valid Characters" parameter in LabVIEW and it doesn't seemtomake any difference.  I am sure I am doing something wrong.  If anyone has any suggestions,pleaseHELP!

 

JJ

0 Kudos
Message 1 of 6
(5,152 Views)

Hi JJ

 

When using OCR always be sure to have a tight ROI focused just over the region where you will be identifying the numbers or the letters. In this manner you could use one ROI for the numbers and another for the letters.


Thank You
Eric Reid
National Instruments
Motion R&D
0 Kudos
Message 2 of 6
(5,136 Views)

Thanks for the response.  But my problem is that the product moves by more than the width of the Lot Code so it's difficult to make the ROI small.  I have attached an image from the application for you to look at.

 

Thanks again!!

 

JJ

0 Kudos
Message 3 of 6
(5,129 Views)

Hi JJ

 

 Valid characters identifies the manner in which the OCR looks for character strings to read. For example say we choose to identify number, our OCR will only look for strings starting with numbers. If you are placing an OCR surrounding the entire line of several of the barcodes its possible that this may be causing the misnomer.


Thank You
Eric Reid
National Instruments
Motion R&D
0 Kudos
Message 4 of 6
(5,096 Views)

In Vision Assistant, you can set up a pattern for the OCR to use.  In the Read Options tab, there is a button "Specify Text Pattern".  You can make the first character Alpha, the second character Numeric, third character Alphanumeric, etc.  You can pretty much set up any pattern you need.

 

I am sure there is an equivalent input in LabVIEW, but I don't know what it is offhand.  If you can't find it, you could specify a pattern in Vision Assistant then create a LabVIEW vi, which would show you how to do the same thing in LabVIEW.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 6
(5,048 Views)

I know this is 5 years old, but in cae somebody else is looking:

 

Use the IMAQ_OCR_Set_Valid_Characters.vi to set the types of characters for which you want the OCR to search. The input is in a form of an array (each recognized OCR character corresponds to an index in the array). These are the options:

 

Any Character (0)

Any ASCII character

User-defined Characters (1)

Uses characters you specify in the User-defined characters string.

Alphabets (2)

A-Z

a-z

Alphanumeric (3)

A-Z

a-z

0-9

Uppercase Letters (4)

A-Z

Lowercase Letters (5)

a-z

Decimal Digits (6)

0-9

Hexadecimal Digits (7)

0-9

A-F

Pattern (8)

Any Pattern

Force Space (9)

Ignores the read character and forces a space at the corresponding position

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 6
(3,587 Views)