maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Brainstorm (https://talk.maemo.org/forumdisplay.php?f=47)
-   -   [Under consideration] OCR and BCR for N900 (https://talk.maemo.org/showthread.php?t=40377)

muki 2008-04-07 15:20

Re: GNU Ocr
 
Re barcodes: this may interest someone: http://en.barcodepedia.com/

I just had a quick try but flash can't see the camera on my N810

Benson 2008-04-07 15:41

Re: GNU Ocr
 
That's a well known limitation of Flash on the N8x0; this is the first time it's bothered me, though. Thanks for pointing out a flash webcam app I care about!

cashless 2008-04-07 16:00

Re: GNU Ocr
 
Wow!!!! This is HUGE for me. Time to start converting all the shoddily scanned e-books that i have.

mikevraziel 2008-04-07 19:49

Re: GNU Ocr
 
i am trying to add support for jpeg files. has anyone built djpeg tools ?

Bundyo 2008-04-07 20:13

Re: GNU Ocr
 
Say, can't we use the crap camera with this library to get some nifty bacode reader?

http://www.libdmtx.org/

Benson 2008-04-07 20:49

Re: GNU Ocr
 
I have tried netpbm from Debian lenny; seems to work (although it has libc version incompatibility).

lardman 2008-04-07 22:10

Re: GNU Ocr
 
The .m code is here: http://people.bath.ac.uk/enpsgp/bar_code_reader2.m

It's pretty rough and ready (read development code). It doesn't do any filtering, so the image needs to be pretty clean. Also note that the image should be reasonably upright (and has to be the right way up, otherwise the code will come out backward and it probably won't like it ;) )

It should be straight forward to turn into Python (which has the added advantage that the camera can be manipulated simply using it too), I've just been a bit busy lately. Do let me know how you get on.

Mike, I'll be interested to see what other options the OCR reader has to offer too when I have a bit of time.

Cheers,


Simon

Benson 2008-04-07 23:10

Re: GNU Ocr
 
Quote:

Originally Posted by lardman (Post 166524)
The .m code is here: http://people.bath.ac.uk/enpsgp/bar_code_reader2.m

It's pretty rough and ready (read development code). It doesn't do any filtering, so the image needs to be pretty clean. Also note that the image should be reasonably upright (and has to be the right way up, otherwise the code will come out backward and it probably won't like it ;) )

It should be straight forward to turn into Python (which has the added advantage that the camera can be manipulated simply using it too), I've just been a bit busy lately. Do let me know how you get on.

Mike, I'll be interested to see what other options the OCR reader has to offer too when I have a bit of time.

Cheers,


Simon

Well, cleaning up the image doesn't really belong in the bar-code scanning program, anyway (IMHO). We can use netpbm; something like what we want may be gotten with pamtilt & pnmrotate (to auto-straighten), maybe pnmnlfilt (to clean up noise), and pnmnorm & pamdepth (crank up the contrast and squash to one bpp).

Then you've got a pretty good image, but maybe you still don't trust just one row out of the middle, but would rather an average? OK, pamcut out an arbitrary chunk, say the center 1/2 vertically, or maybe try to guess heuristically. Then pamscale -nomix can be used to squash it down to a single row; it'll take the more common color for each column.

Now you've got a single row of pixels, ready to apply that algorithm as it stands. That's what I'm thinking, anyway; if that's too slow, then the slow parts of the image processing can be converted to dedicated C code.

But I think scripting it together should give decent performance. I'll play around with it some; it'll probably be a couple weeks before I can look into porting it, but I'll play with the pbm pipeline, and with your code in Octave.

Starcruiser1229 2008-04-08 03:26

Re: GNU Ocr
 
Another Avenue - ZXing Online Decoder - IF you have a good net connection, you can use zxing.org/w/decode.jspx and upload an image you snapped with the camera - it does not seem reliable, however, and I don't think it will be with the camera quality. The source code for this is available, however (I believe it is Java) on their website if you want to have a look.

I am not affiliated with this in any way - just found it while googling for barcode software.

For me, barcode software is cool but not really useful, but I will play with whatever you all come up with!

Patrick

geneven 2008-04-08 06:31

Re: GNU Ocr
 
Did you ever notice that the Gutenberg Project does NOT have a copy of Das Kapital?? Amazing but true, last I checked.


All times are GMT. The time now is 04:37.

vBulletin® Version 3.8.8