Slashdot Mirror


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?"

29 of 95 comments (clear)

  1. Aspect Ratio and Even Lighting by mythosaz · · Score: 5, Insightful

    ...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.

    1. Re:Aspect Ratio and Even Lighting by TheWanderingHermit · · Score: 5, Informative

      That's about it. I used to transfer photos to video professionally. We had a nice rig with lighting and a video camera mounted on a stand. We had to do a lot of adjusting of focus because of different types of phots and other issues. More often that not it was not just put down and click, then move on to the next one. If you're dealing with letters, and you're not scanning, you'll have problems with some fonts and other oddities that make sure many shots won't turn out as perfect as you'd think.

      I have my own business. I keep all my bills, receipts of deductable expenses, home records, and so on. I keep personal records 7 years except in special cases. I just take the bill, when I get it (and most bills are e-mail now!) and put it in the envolope for the biller for that year. At the end of the year I spend less than 30 minutes writing up labels for the next year and when I get time, I burn the stuff that is past 7 years old. For "all those blls" I've never needed more than 4 filing drawers, which can be stacked as one cabinet that doesn't take up much space, or I use the two cabinets (2 drawers each) as legs for one of my desks.

      I thought about keeping things electronically, but then I realize I'd have to take time to scan them and file them and that would take a lot more time, over all, than just dropping them in folders. If you want, you can spend all that time scanning. I prefer not to, but then again, I have a life and would rather be cycling or rock climbing than scanning bills.

      This, to me, sounds like a geek gone wild, over thinking the solution and trying to come up with a hi-tech answer to a low-tech problem that really doesn't need an answer if one uses a little common sense and simple organization.

    2. Re:Aspect Ratio and Even Lighting by Null+Nihils · · Score: 2, Interesting

      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.

      Thats assuming you need a pristine, perfect photo of the item to be OCR'ed. I suspect this is not the case: chances are that as long as you are trying to digitize printed (not handwritten) documents, the OCR won't mind a little fisheye distortion and offish lighting (as long as you make sure there is enough contrast and no dark shadows.) It really depends on the flexibility of your OCR software; it might not work well with the imperfections resulting from using a digital camera.

      Best way would be to test out a few handfuls of documents, tweak your setup so you get the best resulting digital images, and then see how your OCR software handles things. I have used a digital camera to digitize things on paper when a scanner wasn't available, and sometimes got decent results for what I needed. Usually using the camera's flash is a mistake; instead, try setting up a flourescent tube so you get even ambient lighting. YMMV.

    3. Re:Aspect Ratio and Even Lighting by TheWanderingHermit · · Score: 4, Insightful

      Considering that, and I'm speaking not just as a former student, but as a former teacher, there is a delicate balance in all professors between ego and laziness, most of what is taught in college is in the text books. As for handouts, I found it pretty easy to file them as well. As for notes -- you mean someone who is scribbling notes in a hurry actually takes them in good enough handwriting that OCR would be able to read them without a lot of prompting? I should have mentioned that a lot of similar material like that is included in my 4 drawers. You have to think to file them in folders, and the same thought is needed to figure out which directory to put them in, but a lot more is needed to photograph papers so they are legible. If it's that important, a sheet-feed scanner would be more practical, but there's the difference between theory and practice: it's not as easy to batch convert as it sounds.

      I've also found that there is a lot more of value to learn from practical experience than from pedants.

      Unless one is a geek gone wild.

    4. Re:Aspect Ratio and Even Lighting by tdemark · · Score: 5, Interesting

      I thought about keeping things electronically, but then I realize I'd have to take time to scan them and file them and that would take a lot more time, over all, than just dropping them in folders.

      That's what I thought until I actually tried it.

      I have an Fujitsu ScanSnap document scanner which I use on all my documents. It scans both sides of a page at the same time, can hold 15 pages (I think) in its feeder tray, and takes 5 or 6 seconds to scan a page. Since it scans both sides of a page at the same time, this actually ends up being 5 or 6 seconds per two pages.

      It is small enough to sit on my desk and its "on" switch is the loading tray flap - flap closed is "off".

      When I want to scan something, I open the flap, load the tray with the document, and hit the "scan" button.

      It quickly scans all the pages and sends the scan to a program called Readiris Pro (v11) - this program will OCR the document and save it into my digital cabinet as a PDF "Image + Text". This is a really cool format because there are actually two "layers" to each page - the actual scan of the page (so it looks right) and then a text layer below that has all the OCR information. What this means is that, although you are looking at a raster image, you can search the PDF for specific information and copy and paste text right out of the document.

      Let me clarify that with an example:

      Let's say you have a PDF of a utility bill. The PDF you are looking at is a scan of the bill itself - not a text-based representation. However, you can grab the "text" cursor and copy your account number right from the image! Obviously, you are not copying from the image, but from the text layer that has all the OCR'd text positioned correctly on the page, but hidden from view.

      Since all the text has been OCR'd, the PDFs are now searchable. Since my digital cabinet is just a collection of folders based on category (Utility, Financial, etc), I use another program (DEVONthink Personal) to index it. Let's say I am talking with my insurance company and they have a question about a claim. I can type in the claim number into DEVONthink and, boom, all the documents which reference that claim will be displayed. Simply clicking on an entry in the result list will bring up the document itself and highlight where the claim number appears on the page. BTW, if a provider allows PDF downloads of actual bills, I can drop them directly into the digital cabinet and they will be indexed along with my other documents.

      Yes - this cost a little much to set up ($300 for the scanner (on sale), $90 total for DEVONthink and Readiris Pro), but I was able to sell the full copy of Adobe Acrobat that came with the scanner on eBay for $175, so the actual cost was closer to $225.

      It's probably not for everybody, but I am certainly happy with the process.

      - Tony

    5. Re:Aspect Ratio and Even Lighting by thatnerdguy · · Score: 2, Interesting

      How about just typing your notes up each day? That way you will be re-reading them, allowing them another chance to sink in, you'll be able to spot if there is anything in them that you don't understand and your notes will be searchable.

      --
      I saw the Sign, and it opened up my eyes
  2. Sheetfeeder by cerberusss · · Score: 2, Informative

    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?
    1. Re:Sheetfeeder by Dadoo · · Score: 3, Insightful

      What you want is a scanner with a sheet feeder and a GOOD one at that.

      Absolutely.

      I tried this, myself, a few years ago. I guarantee that, using a camera, you'll get through, maybe, 100 pages. I got a decent scanner (HP something or other) with a sheet feeder. It does about 12ppm and that turned out to be too slow. I got tired of it in a day or two.

      I tried a bunch of different solutions, but I finally had to take it all to work. We had a Fujitsu M4097D and an enormous Ricoh Copier/Scanner/Fax machine. Both did 60ppm, both sides (120 images a minute). I actually made some headway with that setup, but I still didn't finish.

      As far as OCR is concerned, don't bother. Even today, it's nowhere near accurate enough. In my experience, the best software out there get an average of one error per page on a really good scan. Trust me: it will take a lot more of your time than you think to fix that. Assuming you're doing mostly black and white text, G4 compression will compress a 300dpi, 8.5x11 image down to about 100k. At that rate, you can store close to 7000 pages on one CD.

      --
      Sit, Ubuntu, sit. Good dog.
  3. I tried this once by KNicolson · · Score: 3, Interesting

    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?

  4. Why bother with OCR? by Badfysh · · Score: 2, Insightful

    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.

  5. Or better yet... by svunt · · Score: 2, Funny

    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 :)

  6. scanners are FOR documents by Dun+Malg · · Score: 4, Insightful
    Digital Cameras vs Scanners for OCR?
    What, are you kidding? You can use a joystick in place of a mouse, but why? Cameras are for capturing a 2D image of a 3D scene. Like you noted, the optics are designed specifically for it. Scanners are for capturing a digital version of a 2D paper image. Musing over whether today's new, heavier wrenches might be stout enough to drive nails is silly, as what you really need is a hammer.

    Get a scanner
    --
    If a job's not worth doing, it's not worth doing right.
    1. Re:scanners are FOR documents by hords · · Score: 2, Insightful

      Besides that, scanners are usually cheaper than digital cameras anyway and can do much more than 300 DPI if you need it for another task. The scanner gets the lighting even and doesn't have to be focused. Maybe the reasoning is that it's faster to take a picture than to scan a document.

    2. Re:scanners are FOR documents by flewp · · Score: 2, Insightful

      Unless he has a proper lighting setup, it may actually take longer to clean up the photos of the documents than to simply scan them. Also, if the bills/reciepts/etc are of different sizes, he would have to zoom and fit it in frame, and crop the images among other considerations.

      --
      WWJD.... for a Klondike bar?
  7. reverse engineer this.. by RuBLed · · Score: 2, Interesting
  8. Not as easy as you think.. by sakusha · · Score: 5, Informative

    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

  9. Re:Cameras aren't all that easy to use by otherniceman · · Score: 3, Informative

    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.

  10. Re:I sort of tried this by flewp · · Score: 2, Interesting

    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?
  11. Re:I sort of tried this by flewp · · Score: 2, Interesting

    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?
  12. $100 8.5x11 scanner, and scan half-pages? by billstewart · · Score: 2, Insightful
    It sounds like you've got to handle each page by hand anyway -

    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
  13. To Clarify... by Aladrin · · Score: 4, Insightful

    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
    1. Re:To Clarify... by vanyel · · Score: 2, Insightful

      I was thinking about this recently, and what I want is:

      1. stick the paper in the slot, it feeds, scans and files in "New Docs"
      2. drag thumbnail to register entry in gnucash, it optionally (sometime in the distant future) ocrs it and tries to find the total and the vendor, as well as matching the last 4 to one of your cards to verify it's going into the right account, then gives you a chance to correct its mistakes. The scanned image is included in the financial db attached to the register entry.

      Unfortunately, few of the sheet feed scanners seem to get very good marks in reviews...

  14. Re:Bulk indexing by mlk · · Score: 2, Informative
    I work in the Media Monitoring industry. What we do is scan in newspapers (we have some 4000 publications), OCR them, throw 'em in a search engine and do some bloody complicated searches on that dataset before sending out hits.

    roughly OCR a document and store keywords or snippets of text in metadata or an index?

    Lots.
    You could be OK with GOCR and Apache Lucene if you do not require zoning (working out blocks of text and columns).

    OCR is not good enough

    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".

    What formats allow an easy mix of image and text data (without formatting)?

    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.
  15. Scanner fuss by omega9 · · Score: 2, Funny

    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.
  16. No scanning required by coinreturn · · Score: 2, Informative

    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.

  17. Re:Bulk indexing by mrchaotica · · Score: 2, Insightful

    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".

    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

  18. Re:you are making it too hard. by sakusha · · Score: 2, Insightful

    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.

  19. Real camera solution by nuggz · · Score: 2, Informative

    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.

  20. Re:Works for me by iamhassi · · Score: 2, Interesting

    "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