RE: simple OCR in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, June 29, 2007 11:32 am, Jay Blanchard wrote:
> [snip]
> I am looking for a way to incorporate some simple OCR into a php
> script.
> The
> user will bulk scan a pile of invoices. I want the php script to look
> at
> each
> invoice and read a number off the invoice. The image will then be
> renamed,
> and be organized into a directory and the file name will be added to a
> database. (all of these steps are straight forward once the number is
> read.)
> I have no problem with a system that requires a special OCR font
> and/or
> some
> sort of registration mark to help locate the Invoice number. Can
> anybody
> tell
> me of any tools out there that can do this?
> [/snip]
>
> In short PHP cannot perform OCR functions. You could insert an OCR
> application into the process and have the OCR app pass PHP the
> information.

Really?

So that OCR routine I wrote to hack a CAPTCHA doesn't exist?

Weird.

:-)

If you really do want to write OCR in PHP, it's pretty trivial:

http://php.net/imagecolorat

You'll need to build up a "dictionary" of known characters and define
a "distance" function to decide when two characters "match" or not,
but it's not rocket science.

It doesn't even qualify as Artificial Intelligence anymore. :-)

But since you have standard un-obfuscated content, using exec() to run
a well-established OCR package might be easier.

Or not, as I could never get the dang things to work in the first
place, personally. :-v

YMMV
NAIAA

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux