Code Monkey home page Code Monkey logo

Comments (6)

markusfisch avatar markusfisch commented on August 17, 2024

Good question. All the samples are failing for me too. My first guess is there's something wrong with ZXing because Binary Eye just gives an image to ZXing. On the other hand, ZXing has tests for MaxiCode 🤔

from binaryeye.

markusfisch avatar markusfisch commented on August 17, 2024

Well, finally found out that ZXing (in version 3.3.3, the last version we can use for Android apps that should run below Android 7.0 Nougat, see here) can only read MaxiCodes if it's in PURE_BARCODE mode.

PURE_BARCODE means the barcode is expected to be unrotated and not skewed in the input image. Of course, this isn't usually true for a camera frame.

From MaxiCodeReader.java:

  @Override
  public Result decode(BinaryBitmap image, Map<DecodeHintType,?> hints)
      throws NotFoundException, ChecksumException, FormatException {
    DecoderResult decoderResult;
    if (hints != null && hints.containsKey(DecodeHintType.PURE_BARCODE)) {
      BitMatrix bits = extractPureBits(image.getBlackMatrix());
      decoderResult = decoder.decode(bits, hints);
    } else {
      throw NotFoundException.getNotFoundInstance();
    }
    ....

Unfortunately, the docs are silent on this 😞

Now, I've did a couple of tests and indeed could read a couple of MaxiCodes when PURE_BARCODE is set. Of course, setting PURE_BARCODE makes reading other barcodes much worse (like QR Codes and DataMatrix and probably others as well) 😬

So the only solution I see would be to have a special MaxiCode Reader "mode", which would be rather ugly, of course.

Alternatively, it would also be possible to scan every other frame with PURE_BARCODE set but that also would make performance for all other codes a bit worse 🤔

from binaryeye.

ravilov avatar ravilov commented on August 17, 2024

Thank you for the reply. At least now we know what's going on! I agree having an option to switch "modes" sounds ugly. What do you think about doing a second pass on the same image data with the said PURE_BARCODE option set in case the first (normal) pass finds nothing? Or would that slow down the scanning too much?

from binaryeye.

markusfisch avatar markusfisch commented on August 17, 2024

Unfortunately, yes, doing an extra pass would slow down scanning. Especially on low end devices. So I rather wouldn't do it by default.

from binaryeye.

ravilov avatar ravilov commented on August 17, 2024

Not by default, but I feel here's where a checkbox setting would come in handy. Switch between faster but less broad and slower but with more codes supported.

from binaryeye.

aleksandrs-ledovskis avatar aleksandrs-ledovskis commented on August 17, 2024

Could the PURE_BARCODE be auto-enabled when "Restrict format" is set to MAXICODE?

from binaryeye.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.