tcsenpai / qrare

33 stars 1 forks source link

consider different decoder #1

Closed legut2 closed 3 months ago

legut2 commented 3 months ago

Just a suggestion, use a different decoder instead of zxing. Use an ML approach such as opencv's wechat one:

https://learnopencv.com/wechat-qr-code-scanner-in-opencv/ https://docs.opencv.org/4.x/df/ddf/namespacecv_1_1wechat__qrcode.html

tcsenpai commented 3 months ago

Is there a specific reason behind the suggestion?

I realized that zxing often cannot extract data seemingly without reason; do you think the opencv approach would enhance this behavior?

legut2 commented 3 months ago

I'm not sure if it fixes that specific issue, it very well might, but it is my belief that the scanners within Android phones are worse than iPhones because they don't use an ML approach. This is based on firsthand observation of people attempting to scan QR codes but failing in-front of me with Android phones. When I looked into it I found out that the zxing library is used within Android phones.

More Info Android: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SettingsLib/src/com/android/settingslib/qrcode/QrCamera.java;l=470;bpv=1
iOS: https://developer.apple.com/documentation/vision

I'd be curious if my suggestion fixes the data extraction problem you're mentioning.

tcsenpai commented 3 months ago

I will create a branch to work on this, maybe an hybrid system that fall back to this approach or vice versa might be even more efficient in recognizing some of the qr codes

tcsenpai commented 3 months ago

Update: while not using ML (yet), I implemented qrtools as a fallback decoder and managed to pack 1000 chunks per qrcode with Low error correction without any problem. Thanks for the advice. I consider this closed as indeed I added a different encoder.