Scan QRcode with inverted colors using Vision API

Viewed 4022

After struggling a few hours on making my app detect this QRCode:original QRCode

I realized that the problem was the in the QRCode appearance. After inverting the colors, the detection was working perfectly.inverted QRCode.

Is there a way to make Vision API detect the first QRCode? I tried to enable all symbologies but it did not work. I guess it is possible because the app QR Code Reader detects it.

2 Answers

I think this is still an open issue, please see link for details. One workaround for this as stated by a developer:

Right, the barcode API generally doesn't support color-inverted codes. There's no parameter or option to control this at the moment. Though some APIs support them, I don't believe it's a common feature.

For a workaround, you could preprocess the colors in the bitmap before passing them to the barcode API (perhaps inverting colors on alternate frames).

Hope this helps.

Related