问题
I'm seeking a library, technique or advice on how to read an EAN-13 barcode from an image (including ISBN,and ISSN encodings). The image would come from a mobile phone or webcam, so resolution may be quite poor and not well aligned.
I'm specifically interested in something that could be used from ruby on rails, but answers for other languages are welcome. Open Source solutions preferred.
Leading solutions to date:
- ZBar (previously known as Zebra - h/t @bgbg, @Natim) - implemented in C with interfaces for Python, Perl, and C++
- ZXing (h/t @codr) - implemented in Java (J2SE and Android) with other modules/ports in varying states of development (JavaME, C#, C++, JRuby, RIM, iPhone/Objective C)
回答1:
This project might be what you're looking for: ZXing
回答2:
The zebra barcode reader (http://zebra.sourceforge.net/) is a small, layered bar code scanning and decoding library implemented in C (C++ wrappers are also provided). It supports many popular symbologies (types of barcodes), including EAN-13. However, I'm not aware about any Ruby bindings. The library is available under the GPL
回答3:
You might want to try this if it's to allow your site's visitors to scan stuff, I think it's embeddable in your own site, but I've never used it : http://en.barcodepedia.com/
回答4:
We use the Softek library.
Very pleased with the results.
来源:https://stackoverflow.com/questions/113571/how-to-read-a-barcode-from-an-image