07-16-2015 01:35 AM
Hi everybody
I am reading letters and numbers by using OCR. I attached sample picture (Figure1). because my pictures are an edge detection output, they have noise in their background.
Because my ocr recognition is unsuccessful(Figure 3), I want to clear their background ( become Figure 1 to Figure 2 ).
I guess my solution is use filter.
please help me.
Thank you
07-16-2015 09:50 AM - edited 07-16-2015 10:01 AM
Are you using Vision Builder for Automated Inspection, or just the Vision Module VIs alone? If you can get access to VBAI, it's a great way to try out different filters to see what works. Using the native VIs takes a while to make adjustments, but VBAI lays it all out and makes it easy to manipulate.
You probably don't need a filter since your image is already cropped to the size of your numbers. Having only the number in the image makes it way easier. I used to have to deal with a whole bunch of other shapes in the image that it would be try to recognize as numbers and that was a headache.
Try toying with the inputs to your OCR VIs for character size limitations. That helps the algorithm split off the blobs in to their separate numbers and would definitely split up your "69" blob and get rid of that little mini-character blob.
You can mess with these properties using the OCR Property VI if you need to do it with the native VIs.
Set the valid characters so it's not looking for letters when all you care about is numbers.
The filter it runs is a threshold filter and has some smarts behind it. Set the type of filter using the Threshold Data VI. You probably want Uniform (1) mode.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-21-2015 05:32 AM
Dear james
Thank you very much for your reply.
Best regards
Tandis
07-21-2015 08:52 AM
Did my advice help you get the OCR to work?
If it worked, please mark as solution so that others who need help with a similar OCR problem will be able to find this thread and see the solution.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-25-2015 11:43 AM
Can u tell me which type of filter u have used?
07-27-2015 03:35 AM
I've used four of IMAQ Morphology VI (POpen - PClose - POpen - PClose) and I got the result shown in Figure 1. I guess if I tried to get a better result. but I have a problem. IMAQ OCR Read Text 4 VI is in its input images (Grayscale (U8) - RGB (U32) - HSL (U32)). my output before IMAQ OCR is Grayscale (U16) and I get an error (Invalid image type). when I change the type of image of the Grayscale (U16) to Grayscale (U8), I'd lost image data!
I guess as James said, the OCR Property VI and the Threshold Data VI can help me a lot to do. but before that I have to solve this error.