Thursday, February 28, 2013

Does your task need OCV or OCR?

If you looked at the Microscan video showcasing the latest release of their AutoVISION package, (“Looking for an easy-to-use smart camera?”) you might have spotted that it includes both Optical Character Verification (OCV) and Optical Character Recognition (OCR.)

I’ve noticed that some of our less experienced machine vision brethren see these two as interchangeable, when they are not, so I thought a short post on the difference might be useful. (If this is “old hat” to you, go find some amusing videos on YouTube and check back here in a day or two.)

Text is great for humans because we’re really good at pattern recognition. In fact it may be the only visual area in which we can beat machine vision. Nate Silver would argue that we’re too good at it. So when we see marks on a page we can quickly interpret them as characters. Software doesn’t know characters though; it just sees groups of pixels of different gray levels.

So vision software treats characters as shapes, or patterns, and OCV is a form of pattern matching task. The algorithm just needs to determine how closely the pattern in the ROI matches the pattern stored in memory.

Allowances can be made for scale and rotation, but in general, if the degree of match exceeds a threshold the system will say, “I was looking for shape T and the shape in the ROI passes the tests for T, therefore I have found T.” The character has been verified.

OCR is more complicated. In this task the software has to ask, “I have found a shape. Which of the shapes stored in memory does it match most closely?”

See how this is more complicated? There’s a whole lot more processing to be done, especially if size and rotation are variable too.

So when you need to recognize characters, try to configure the task as a verification – “I’m looking for T. How closely does this shape match?” – rather than “what is this shape?” OCV is always going to be easier/faster/more robust than OCR.

1 comment:

Vincent Hua said...

OCV doesn't necessary mean alphanumeric character only. It also can be use to detect company logo or shape.