Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode barcodes on cropped specimen images #88

Closed
quicklizard99 opened this issue Oct 14, 2014 · 13 comments
Closed

Decode barcodes on cropped specimen images #88

quicklizard99 opened this issue Oct 14, 2014 · 13 comments
Assignees

Comments

@quicklizard99
Copy link
Member

Metadata fields need to be populated from data decoded from barcodes on cropped specimens images. Decoding should be robost and require as little human intervention as possible.

@quicklizard99
Copy link
Member Author

Some good descriptions at Wikipedia and Inlite. Within the museum have least:

The ideal is we pass the cropped specimen image to a decoder, which returns the data encoded within (ideally also the types and locations) of all barcodes on the image.

OpenCV does not have barcode decoders. This has been slated for a while, e.g. for the 2014 GSoC with Claudia Rapuano as mentor. See also this discussion.

I have investigated the following open-source barcode decoders

zbar

libdmtx

zxing

OpenCV + decoder library

None of these three open-source decoders is capable of reliably locating and decoding barcodes within the example specimen images that I have.

I coded up this strategy:

  • Use OpenCV to identify areas of the image that might contain barcodes
  • Pass each candidate area through one or more of the open-source decoders

This method works very well for some images by not reliably across the example cropped specimen images that I have.

Next step

Look at commercial decoders.

@stefanv
Copy link
Contributor

stefanv commented Oct 15, 2014

Could you place a selection of images online for which this should work? It would help a lot in coding up some test solutions.

@quicklizard99
Copy link
Member Author

Thanks @stefanv. I will share a few hundred example images, along with some code and results, although probably not until the start of next week.

@quicklizard99
Copy link
Member Author

The open-source decoders are very slow and/or fail to find barcodes - commercial libraries give much better results. Inselect is currently hard-coded to use the Inlite ClearImage library. The library only runs on Windows - if you are using a Mac or Linux then we currently have no good solution. ClearImage supports a wide range of barcode types but Inselect is hard-coded to detect only Data Matrix. See also #130.

@quicklizard99
Copy link
Member Author

NaturalHistoryMuseum/gouda@f8f2294 adds supports for libdmtx - tested on Mac OS X only.

@quicklizard99
Copy link
Member Author

libdmtx via pydmtx also tested on Linux and 32-bit Windows. 64-bit windows build of libdmtx fails with core dump.

@quicklizard99
Copy link
Member Author

libdmtx via pydmtx working on Mac OS X, Linux and 32-bit and 64-bit Windows.

@quicklizard99
Copy link
Member Author

v0.1.8 (f8f0667) introduces support for the open-source libdmtx decoder on all platforms. See
NaturalHistoryMuseum/libdmtx and NaturalHistoryMuseum/dmtx-wrappers.

@quicklizard99
Copy link
Member Author

Adding support for the zbar open-source library would allow 1D barcodes and QR codes to be decoded. The last release (0.10) was on 2009-10-27. There has been no development since and not likely to be any more. zbar is available for all three major OSes but, frustratingly, there is no 64-bit build for Windows - a show stopper.

We would need to

  • add support for 64-bit Windows
  • add a user interface config box that allows the user to choose between
    • libdmtx
    • Inlite
    • zbar

@quicklizard99
Copy link
Member Author

User interface for config will be handled by #156

@quicklizard99
Copy link
Member Author

Support for QR requested by AMNH. Will require that Inselect supports zbar and/or exposes the relevant Inlite functionality.

quicklizard99 added a commit that referenced this issue May 28, 2015
quicklizard99 added a commit that referenced this issue May 28, 2015
quicklizard99 added a commit that referenced this issue May 28, 2015
@quicklizard99
Copy link
Member Author

Inselect now supports Inlite, zbar and libdmtx. The only gap is that zbar is not available on 64-bit Windows, for reasons given on 2015-04-20. Edit, Configure Read barcodes shows a box allowing the user to choose between the three decoders; options are disabled where a decoder is unavailable:

read_barcode_config

@quicklizard99
Copy link
Member Author

Our fork of ZBarWin64 adds support for zbar on 64-bit Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants