LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read a string using NI Vision assistant ?

C an anyone help me in reading a string using vision assistant ?

 

Individually i have trained each and every character in the character set file.

But when i am selecting whole image , the OCR read block is unable to recognise the string .

 

it is detecting each individual character when the same ROI used during the raining is used now

Can anyone clarify ?

Thanks and Regards
Gaurav Pal
0 Kudos
Message 1 of 4
(4,189 Views)

Find the attached file for better understanding of the problem

Thanks and Regards
Gaurav Pal
0 Kudos
Message 2 of 4
(4,186 Views)

Hi,

First thing, OCR is designed to recognize characters from one horizontal column. If there are more than one lines of text in your ROI, they won't be read by OCR. If you have a decent idea of the vertical position of your text rows, you can define more than one OCRs with different ROIs, in series to read from different lines.

Secondly, the blue shaded area in your second screenshot represents the pixels which OCR is trying to recognize as characters. It seems like you have set the control 'characters' in the threshold tab to dark on light whereas your text is light on dark background. So with the control 'mode' set to 'uniform', set the 'characters' control to 'light on dark'. I personally prefer to use 'fixed range' as the mode and to adjust the threshold slider until OCR can distinguish well between the characters. For this particular image, suitable minimum threshold is around 140 and maximum is same as default(255). You can also adjust the values in 'size' tab to make the identification boxes fit more closely around the individual characters and get more reliable readings.

 

Good luck!

Message 3 of 4
(4,169 Views)

I recently did some Optical Character Recognition (OCR) within the Vision Assistant to read characters in an online Flash game.

 

  1. Load up the Vision Assistant
  2. Open a Test Image
  3. Go to Processing Functions: Identification
  4. Select OCR/OCV
  5. Click New Character Set File. This is where we'll tell our computer what our characters are going to look like.
  6. Draw a square around a single letter of the text you want to read. I don't have a lot of experience with OCR, but what I found was that it was best to try and keep the squares you draw around these different characters as an even shape.
  7. On the right hand side, under Train/Read, you'll see that it says Text Read:?. This is because we haven't defined what any characters look like. In the Correct String box, type in the corresponding letter of the character you've highlighted.
  8. Select Train Single Character and then hit Train.
  9. Do this for the rest of your characters. You'll see how they appear by clicking on the Edit Character Set File tab.

 

Once you've saved your Character Set File, you can use it in OCR by specficying set Regions of Interest (ROIs) to analyze. In terms of programming, you can implement multiple discrete ROIs where you expect characters to be positioned and use OCR on these individual elements.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 4 of 4
(4,167 Views)