Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Facing Problem in OCR

Solved!
Go to solution

hi everyone.

i want to read the characters from the paper. and i do not select the ROI. my numbers will be in one line but its position will be varied and this numbers are enclosed in the border. how can i detect the numbers?

0 Kudos
Message 1 of 9
(4,835 Views)

Can you attach some sample images?  Even one would make the problem much clearer.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 9
(4,829 Views)
0 Kudos
Message 3 of 9
(4,813 Views)

it should be like this but contains only five letter and its location will be varied in the paper.

0 Kudos
Message 4 of 9
(4,809 Views)

If all you are going to see is white paper with black characters, OCR should be pretty easy.  It will automatically locate the characters for you.

 

Where you start to have problems is if other black items are also in your ROI.  If you have other marks, or the paper doesn't extend to the edge of the image, you need to exclude those areas.

 

If it gets really difficult, you could do the preliminary location.  Threshold the image using a standard automatic threshold.  Use particle filters to eliminate anything significantly larger or smaller than a character.  Find the five particles that line up and generate a ROI that surrounds them.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 9
(4,793 Views)

thanxs for the reply

but i have the problem that the numbers are within the border and the colour of the numbers and the border is same

so without selecting the ROI ocr only gives the question mark, it does not recognizes the characters. and one thing  i would like to tell that the colour of the paper will be different from the white.

0 Kudos
Message 6 of 9
(4,773 Views)

That is why I asked for a sample image.  You didn't have any boxes around the characters in your sample image - that makes a big difference!!!

 

You will have to locate your box and draw the ROI just inside the box.  By thresholding and examining each particle, it should be pretty easy to locate the one that is the rectangle.  Its length and width should be within pretty small ranges.  Add and subtract a few pixels to account for the width of the line and use that for your ROI.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 9
(4,764 Views)

hi

thank you for your replies. 

 i have found one solution that is based on the pattern matching. With the help of patten matching i know the co-ordinates and i m giving this coordinates to the ROI. it works good when the font is same as the template image. but when the image is small the it is unable to indentify. is it possible to do scaling in the pattern matching.  

0 Kudos
Message 8 of 9
(4,732 Views)
Solution
Accepted by topic author ddsdds

Hello ddsdds,

 

You can definitely detect scaled templates in an image. If you are using Vision Assistant, I would recommend trying the Geometric Matching step in the Machine Vision tab. If you click on the Settings tab in Geometric Matching Setup, you will see four options for the types of matches that will be detected. Check the box next to the 'Scaled' option and set a range for the scale that you want - 100 being the same size as the template image. This would enable you to detect a scaled version of the template image.

 

In LabVIEW, you can set the scale settings in the IMAQ Setup Match Geometric Pattern VI using the 'Range Settings' input. You can set a range of scale values to identify matches in the image. You could, of course, just create a LabVIEW VI from a Vision Assistant script that does this instead.

 

I hope this helps.  

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 9 of 9
(4,686 Views)