Closed enricomiletto closed 3 years ago
This video shows pretty nicely what I'm talking about
Seems like they're using different libraries for QR detection. Italian version; Dutch version;
Doesn't look like zxing has other options to make it faster.
Hey @Signoo, I see.
The swiss version seems to be using zxing too, but it doesn't have problems handling rotated qr codes.
So maybe they found a way to solve this problem while still using zxing.
@enricomiletto just looked a bit more into the code: The italian version uses a wrapper built around zxing: zxing-android-embedded which doesn't seem to be customizable. The swiss version uses zxing directly, it parses each camera frame, generates a PlanarYUVLuminanceSource which is then used by HybridBinarizer to generate the bitmap. Guess that's why the detection is faster.
It should be possible to implement the same in the italian version.
I just discovered that the app also reads other types of barcodes. If one scans the barcode on a book, for example, the app will read it and then of course show the "Certificazione non valida" message. This is because standard ZXing can read 17 different types of 1D and 2D barcodes.
This explains why the app often fails to read correctly real DCC QR codes; it's not that the app reads the QR code wrong (which is something very very unlikely to happen because of the error correction in QR codes) but it "finds" a pattern inside the QR code matrix which corresponds to some other barcode standard, and this of course leads to invalid data.
This is exactly the same behaviour that the Barcode Scanner app (based on ZXing) has as you can see from the screenshot below
To solve this issue, the app should exclusively look for QR codes (just like the Swiss version which also uses ZXing does) and this will solve the issue of real DCC QR codes leading to the "Certificazione non valida" message.
The cool/fun side effect of the fact that the app reads a variety of different barcode types is that you can convert a DCC into another barcode standard and still validate it, for example a Data Matrix (which is also supported by ZXing). :-P
@Signoo @enricomiletto thanks for reporting this issue and for videos. We're working to improve scanning experience (especially on removing scanning errors), some updates on this will come in the next version!
@astagi I tried the new update today, and the scanning definetly works much much better now. The app now reads QR-codes that are rotated more reliably and quicker (YAY! 👏)
That said:
Nonetheless, the last update was really a big improvement!
The latest update of the app (1.0.3) has fixxed all the major issues mentioned in this GitHub issue.
The only (minor) "problem" remaining is that the app only reads the QR code when it's fully inside of the inner/not greyed out square; just a small portion of the QR code that's outside the square suffices for the app not to read it Other apps (i've tested personally the swiss and the dutch one), while they still have a similar "square" to help the user better frame the code, still read codes if they're not inside of that square.
@enricomiletto thank you for this update and sorry for my late response, I'm currently on vacation! I'm very happy to hear this, I think we can close this issue and open an "enhancement" to improve QR code reading process, WDYT?
@astagi Yes I totally agree.
Describe the bug
When compared with the Swiss or the Dutch DCG verifier apps, VerificaC19 is error-prone and very slow in reading the QR codes when in nonoptimal circumstances.
When the QR code in frame is slightly rotated or not perfectly centred the app can take many seconds or even totally fail to read the QR code at all. And even when it does manage to read the QR code it often (in about 1 in 5 cases from my experience) fails to read it correctly and shows the "Certificazione non valida" message.
This is a problem because in some situations (for example at the entrance of big events) it can be difficult and time consuming to frame the code correctly or retry scanning the QR code after it was wrongfully read as invalid.
Expected behaviour
The QR code gets read and verified in 1 sec. or less and independently of how the QR code is rotated, just like it happens with Verifier apps of other countries.
Steps to reproduce the issue
Technical details