mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
5.06k stars 976 forks source link

[Feature Request] Support scanning in different data augmentation #372

Open mebjas opened 2 years ago

mebjas commented 2 years ago

The decoder in the library (based on zXing js) is mostly capable of reading the QR code or barcode in provided orientation. It also expects the codes to be in lower intensity shades (like black) and the foreground to be on higher intensity shades (like white).

In the past internal support was added in this library to support flipping. By default the Html5Qrcode class abstracts flipping the stream values. Which means every frame (within the fps range) is flipped and scanned. This can be disabled with a config called disableFlip.

Over time new cases have come up:

image

It looks like BarcodeDetector APIs and ZXing js can do some level of handling themselves. Goal of this FR is to evaluate the current support and see if the library can extend by augmenting the video stream to different orientations / flip and pass it on to the decoder. This is ofcourse subject to performance and would need to be done smartly based on fps request and single decode duration.

mebjas commented 2 years ago

Another relevant issue to test with the fixes - https://github.com/mebjas/html5-qrcode/issues/264