Digital Cameras vs Scanners for OCR?
ttennebkram asks: "With 6 and 8 Megapixel cameras on the market, some now with Wifi built in, it might be more convenient to shoot pictures of your bills and papers with a camera than fussing with the scanner. By the numbers, it would seem feasible. 300dpi for an 8.5"x11" sheet of paper works out to about 8 megapixels; 300 dpi is usually what OCR vendors suggest. I imagine for high volume good results you'd want to maybe mount the camera on a tripod arm over your desk. Heck, I was thinking of a glass desk and maybe one camera below and one above, and maybe a foot pedal to trigger the cameras (and I suppose a flash and high F-stop would help as well). If I could quickly 'snap' all the junk paper I have and electronically file it, maybe OCR the images at night in batch while I'm asleep, and then maybe get rid of all that paper once and for all. Using a traditional cheap scanner just takes too long. So has anybody tried this? I realize that camera optics are different than scanner optics, so maybe it's not just a question of raw pixel counts. Any thoughts?"
...the aspect ratio and even lighting are your enemies. It's almost impossible to shoot a bill or a check stub dead on, at close rage, without fish-eye'ing, and without getting in your own shadow. Sure, you might have a little white linnen box that you use to take your eBay photos, but, seriously, this is a job for a scanner.
What you want is a scanner with a sheet feeder and a GOOD one at that. They're not that expensive anymore, since there are lots of cheap machines which have a feeder anyway due to them having a fax function. This alone will go faster than manually swapping the papers and shooting with a camera.
8 of 13 people found this answer helpful. Did you?
The problems I had were (a) getting the book flat, and (b) getting the lighting right. With flash, you end up with a ring of brightness and by OCR software got very confused, as the grey newsprint outside the flash's ring was being handled as black.
If I were a whizz with Photoshop/GIMP/etc, I suppose I could have done some sort of correction to the picture, but...
I've heard how Kinko's have book scanners that will copy and bind a book for you - perhaps they also have a scanning to CD/DVD service? Would that be cheaper for you?
If it's just for keeping a record of bills and other junk, why even bother with OCR? As long as you can read the results, just snap away.
I was conned by an old man in a cloak. It turns out those *were* the droids I was looking for.
C'mon, your work doesn't have a scanner/photocopier/printer with a feeder? I take my paperwork into the office once a quarter or so, feed the lot through the scanner in the print room, and email the output to myself at home. If you're one of the rare cases who'd feel bad about this, you could always offset the expense by not using their water cooler or coffee for a week :)
Get a scanner
If a job's not worth doing, it's not worth doing right.
http://www.sentex.net/~mwandel/tech/scanner.html :)
I have some experience doing what you're trying to do. I've even done this type of work in professional labs with serious pro equipment (it was my job). It's a huge pain in the butt.
I'm currently digitizing my collection of old tabloid punk magazines from the 1970s. I had to use a digital camera because flatbed scanners that do 11x17 or larger are extremely expensive, they're like $3000 or more. So I did some experiments with my consumer-grade 5 megapixel digital camera. The results were adequate, barely (and I have an art degree in Photography, this stuff is easy for me, YMMV). I've currently suspended my project until I can afford a higher rez digital camera, mostly because 5Mp is barely enough to capture the little 6 point type that is used in large sections of the magazines. But let me tell you more generally what I've learned.
First off, you'll need a copy stand. This is a fairly standard photo accessory, but a good copy stand is fairly expensive. You need something that is easily adjustable, so you can raise and lower the camera to get the document to fill the frame, without using too much zooming. The copy stand keeps the camera parallel to the target at all distances. It is important to have quick adjustability in height, rather than zooming. You'd be much better off using a "prime lens" rather than a zoom, as zooms tend to have barrel and keystone distortion.
Secondly, you need lights. If you only want to copy written documents (or B&W magazines like me) you can use cheap spotlights. If you want to do color, you need much better lighting, something with a fixed color temperature, or a flash system. Spotlights are really hot, and when I work in my small office, it gets intolerably hot when I spend about an hour photographing. For better, more repeatable results, you'd be better off getting a flash system. BUT...
Here is the sticking point. You need something to keep the documents flat. That means placing them under a sheet of glass. So you are going to get reflections from the lights, and flash is high intensity lighting which makes it even more difficult to control reflections. The usual method is to put polarizing filters over the lights and the lens, to cancel out the reflections. This is a rather complex method, and a LOW END professional copystand with polarized lighting will set you back about $2500.
OK, so what I did is I adapted my old disused photo enlarger. It was a huge monster for 4x5 negatives, I took off the enlarger head, and used a Bogen photo clamp with a ball-head joint attached to the motorized arm that goes up and down. It does a fairly good job as an improvised copy stand, but it is pretty cramped, the baseboard is only designed to make max 20x24 prints. Also it is a HUGE pain in the ass getting the camera leveled with the baseboard, I use a bubble level. Then I attached a cheap set of tungsten photofloods to the wings of the enlarger, so the light hits the baseboard at a 45 degree angle, to reduce glare. Note that it is best to point each light at the far side of the document, so the light paths cross each other. This gives the light a little distance to fan out and eliminate hot spots. I don't put my documents under glass, they're newspaper pages, so I flatten them for several weeks (!!!) under weights, then if there's a little curl, I use weights (like heavy metal rulers) at the edges, or hold the edges down with post-it notes. That eliminates the need for a glass plate to hold them down, and I don't have to deal with reflections. However, it takes a LOT of time and effort to get the documents positioned and flattened correctly, it is not a quick process.
I use a Canon camera, so I use the Canon Camera Remote to my laptop to preview and take the shot. Even with the lights and some fill flash, I can end up with exposures of 1 or 2 seconds, so I can use a narrow f-stop. This shouldn't be necessary for a flat object, which requires no depth of field, but I find that the lens is sharper stopped down. It takes quite a bit of fiddling to get the optimal
Google used dedicated book scanners called Planetary or Orbital Scanners, see http://www.dlsg.net/bookeye.htm and http://en.wikipedia.org/wiki/Planetary_scanner. They are a lot better that a digital camera on a tripod.
It sounds to me like he doesn't have the lighting under control at all.
Using a direct flash isn't exactly the best option. The ink, even though black, may pick up noticable, and troublesome highlights. Depending on the range, it may even lead to uneven lighting on the paper itself. (Having part of the paper brighter than the rest)
Ideally, perhaps you'd want to use softboxes or some other method for more diffuse lighting.
Disclaimer: I'm not really familiar with OCR software though, so I don't know how well it can compensate/overcome such lighting issues as I described.
WWJD.... for a Klondike bar?
Forgot to mention that I often sketch on paper, and then bring my sketches into the computer for digital painting, and when using a direct flash, I've often encountered the problem I've described. I currently don't have a scanner, so when I am in need of bringing a sketch into the computer, I'm using a Digital Rebel XT (350D, for those outside North America/the United States)
WWJD.... for a Klondike bar?
so get yourself an A-size scanner and just scan each page in two parts?
Or if there aren't too many grayscales that you'd trash,
just run it all through a photocopier to shrink to 8.5x11 and scan that?
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
So to clarify... You want to trade the hassle of:
1) lift a lid
2) stick a paper in a well-defined corner
3) press a button
for the hassle of:
1) align a camera on a tripod, including angle as well as position
2) align a paper with no guide
3) adjust the lighting so that you get an even tone
4) make sure you didn't accidentally move the camera, the tripod, or bump the desk
5) step on a foot pedal that you jury-rigged to make take a picture
OR
5) Push a button on a camera that you can't afford to move even a hair.
6) Use image software to continue adjusting the photo so that the OCR will read it properly
7) Hope you did everything right the first time.
I think I'd pick door number 1.
"If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
Lots.
You could be OK with GOCR and Apache Lucene if you do not require zoning (working out blocks of text and columns).
Oh it is. You will need to add "variants" to your searches. E.g. if you are looking for Microsoft you would search for "M[i1]cr[o0]s[o0]ft". Some search engines can do this for you, others can say "max of two errors".
XML (hehe). PDF can. Most systems would have the image as file somewhere on your file store, and the text in a database.
Wow, I should not post when knackered.
I was thinking of a glass desk and maybe one camera below and one above, and maybe a foot pedal to trigger the cameras
Boy, you're right! Who'd want to fuss with a scanner!?
I'm against picketing, but I don't know how to show it.
I find that most bill providers have an option to receive your bills electronically, keeping them either in their "safe" (ie, website) or to receive them in e-mail. This is true for credit cards, banks, major utilities; the main exception being the city-run water and trash company.
Once you've OCRd, is there any (preferably Free) software that can parse the text against a grammar and word list and hopefully fix some of these errors? Surely "if there's a digit in the middle of a word, it's probably really the letter with the similar shape," "if an unknown word is a character or two different from a known word, it's probably the known word," etc. aren't difficult heuristics, right?
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
Well, I'm trying to max quality with modest equipment, but the basics are always the same. You still need some sort of support like a camera stand, lighting, and something like glass to hold down the documents. Lighting and reflections will always be a problem. I've done this for real quickie jobs using camera on a tripod, and the results sucked. A flatbed scanner is still a much quicker, cheaper, and better way to do the job.
BTW, I have privately circulated a few of my PDFs amongst some online punk communities, and they went nuts over them. The old school punks love them for the nostalgia, but to the new punks who weren't even born in the 1970s it might as well be Elizabethan English, they don't get it at all. Ha! Some of these magazines are still around, and even have major online websites, but none of this old material is available through the official sites. It's a shame, since they presumably have high quality reproductions in their archives, I just have 30 year old mouldering newsprint. They could probably never re-release this material, it all depends on context, half the fun is the advertisements next to the articles, and they could probably never get all the rights and sort out all the royalties to reproduce all the trademarks in the ads. But I could probably get away with circulating my scans openly, I don't think a British court could touch me here in the US. And some of these magazines don't exist anymore and no company has any financial interests in the content, so there's nobody left to file a lawsuit.
1 Don't use a tripod, use a document photo stand.
Think of an overhead projector with the camera where the mirror is for vertical adjustment.
2 Have a guide for the paper, not that hard.
3 Lighting is an important one, but as long as it's even the type of light doesn't really matter if you set your white balance correctly.
4 If it is a rigid setup doesn't really matter
5 Use the camera control software on the computer, you don't need to really use a camera.
6 Save the file and run the OCR software.
I use a similar setup to take photos of test parts at work, works nicely.
"A lot of people seem to be critisizing the idea, but there are some uses for it."
I agree. I don't know about the OCR thing but I take a picture of everything. Every business card I get, every little receipt or scrap of paper. And why not? Just takes a second and it's done, I always have a digital copy to go back and read or print out if need be.
If I only had a scanner I'd never bother, in fact I had a scanner for years before I had a digital camera capable of doing this and I never bothered then. It's saved my ass sometimes too, especially when the paper is filed away somewhere and it's easier to find the photo on the computer.
my karma will be here long after I'm gone