Run npm run benchmark to get success rate using the receipt-scanner-testdata repository. You can use npm test watch to keep tests running, and npm run cover for coverage. Tesseract -all-languages: For node-tesseract module (OCR) Tests Homebrew/science/vips: For sharp module (image preprocessing) Opencv3: For node-opencv (image preprocessing) Graphicsmagick: For gm module (image preprocessing) Imagemagick: For gm module (image preprocessing) Poppler: For pdftotext module and pdfimages binary (PDF processing) Amounts formatting is guessed from the number of amounts found with comma or with dots for decimal separation. Receipt scanner takes an ambiguous approach to date and amounts. It'll return the same results as when you use parse(callback). If you've already extracted the text, and just want to parse it for the relevant information you can use parseText. Update ticker with current percent amount TickerĪ ticker callback can be added with the ticker method. Parser: What parser to run, earliest or first Amount parser config options The amount parser will find the total first, and if nothing is found, then find the biggest amount. You can use, and chain, specific image preprocessors by using the imagePreprocessor method like so: var gm = require('gm') įunction customPreprocessor(file_or_stream, outfile, cb) ])ĭate parser will by default find the earliest date, but as shown in the example you can also find the first. These dependencies are only necessary if you're going to use sharp, imagemagick or graphicsmagick image preprocessor. f, -format format to return, json (default) or text Receipt-scanner path/to/image.png Command Line Interface $ receipt-scanner -help $ ln -s /usr/local/Cellar/opencv3/3.1.0_4/share/OpenCV/3rdparty/lib/libippicv.a /usr/local/lib/ (to fix opencv 3 installation issues on 10.11)
#Recipe ocr scanner install
$ brew install webp opencv3 brew link -force opencv3 $ brew install poppler tesseract -all-languages
#Recipe ocr scanner pdf
Receipt scanner extracts information from your PDF or image receipts.Įxample import scanner from 'receipt-scanner'