NaturalHistoryMuseum / inselect

Cross-platform desktop app for the segmentation and annotation of images of museum objects
https://naturalhistorymuseum.github.io/inselect/
Other
124 stars 17 forks source link

Decode barcodes on cropped specimen images #88

Closed quicklizard99 closed 9 years ago

quicklizard99 commented 10 years ago

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 commented 10 years ago

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:

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 commented 10 years ago

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 commented 10 years ago

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 commented 9 years ago

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 commented 9 years ago

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

quicklizard99 commented 9 years ago

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

quicklizard99 commented 9 years ago

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

quicklizard99 commented 9 years ago

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

quicklizard99 commented 9 years ago

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

quicklizard99 commented 9 years ago

User interface for config will be handled by #156

quicklizard99 commented 9 years ago

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

quicklizard99 commented 9 years ago

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 commented 9 years ago

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