How accurate is QR code scanning? - qr-code

I want to use QR code for a crucial part of my app. How accurate is QR code scanning?
I use iphone4 or equal quality scanner phone.

QRCode use the Reed–Solomon error correction algorithm with four error correction levels :
Level L (Low) 7% of codewords can be restored.
Level M (Medium) 15% of codewords can be restored.
Level Q (Quartile) 25% of codewords can be restored.
Level H (High) 30% of codewords can be restored.
A reading won't return you wrong values : if the QRcode can't be read it won't return anything, so it's quite "accurate".
See http://en.wikipedia.org/wiki/QR_code for more explainations.

Related

Reed Solomon error correction for QR-Code

As a QR-Code uses Reed-Solomon for error correction, am I right, that with certain levels of corruption, a QR-Code reader could theoretically return wrong results?
If yes, are there other levels of integrity checks (checksums etc.) that would prevent that?
You can do a web search for "QR Code ISO", to find a pdf version of the document. I found one here:
https://www.swisseduc.ch/informatik/theoretische_informatik/qr_codes/docs/qr_standard.pdf
There are multiple strengths of error correction in the standard, and to avoid mis-correction, in some cases, some of the "parity" bytes are only used for error detection, and not for error correction. This is shown in table 13 in the pdf file linked to above. The ones marked with a "b" are cases where some of the parity bytes are used only for error detection. For example, the very first entry in table 13 shows (26,19,2)b, which means 26 total bytes, 19 data bytes, and 2 byte correction, which means of the 26-19 = 7 parity bytes, 4 are used for correction (each corrected byte requires 2 parity bytes unless hardware can flag "erasures"), and 3 are used for detection only.
If the error correction calculates an invalid location (one that is "outside" the range of valid locations), that will be flagged as a detected error. If the number of unique calculated locations is less than than the number of assumed errors used to calculate those locations (duplicate or non-existing root) that will be flagged as a detected error. For higher levels of error correction, the odds of all the calculated locations being valid for bad data is so small that none of the parity bytes are used for error detection only. These cases don't have the "b" in their table 13 entries.
The choices made for the various levels of error correction result in a very small chance of a bad result, but it's always possible.
are there other levels of integrity checks (checksums etc.) that would prevent that?
A QR-Code reader could flags bytes where any of the bits were not clearly 0 or 1 (like a shade of grey on a black / white code) as potential "erasures", which would lower the odds of a bad result. I don't know if this is done.
When generating a QR-Code, a mask is chosen to even out the ratio of light and dark areas in a code, and after correction, if there is evidence that the wrong mask was chosen, that could be flagged as a detected error, but I'm not sure if the "best" mask is always chosen when a code is printed, so I don't know if a check for "best" mask is used.

how to calculate the loss event rate p in TFRC(tcp friendly rate control) when no packet loss?

When there is packet loss , I know the method to calculate the p (I read in the RFC document).
But when there is no packet loss , how to calculate it? The document show nothing about it.
If the loss event rate p is zero, the denominator of equation in tfrc is 0.
The equation is as follows:
enter image description here
and the document is rfc5348 : https://www.rfc-editor.org/rfc/rfc5348
I know nothing about TFRC so pure guesswork here.
I suppose available bandwidth calculation is based on loss event rate. If no packets were lost up to now you have zero info about available bandwidth. Usually in this case Congestion Avoidance algo increases bitrate until packet drops start to occur.
In other words, if no packet drops so far you can assume your available bandwidth is unlimited, and use max possible value of p's type. This exactly follows from the formula, as division by zero gives you infinity in math.

Is it possible to generate a QR Code without error correction?

Still include the mode indicator, string length, and data...I was hoping there was an option to just leave the remaining error correction bits as 0's?
I'm making the QR Code in assembly (MIPS) for a class project. Implementing the Reed Solomon Algorithm is becoming quite a bear.
The lowest level of error correction is 7% - see https://en.wikipedia.org/wiki/QR_code#Error_correction
Here's a sample code with "L" level correction. If you cover one or two blocks, the code is still readable. Much more than that and information cannot be recovered.
You could, theoretically, mask out the error corrective bits when you generate the QR code - but I'm not entirely sure why you would do so.

Embed Logo in QR Code

I am working on an Asp.Net application where I am generating QR Codes using https://qrcodenet.codeplex.com
Now, one of the requirements are to embed logo in these QR codes. Can anyone please suggest something?
If the output is in the file system, then it has to read from there and the logo has to be inserted manually in code. However note that embedding the logo reduces useful information in the QR code and mainly works because some error-correction in the reader is in effect; it is not something that is intended to be done.
Reading a PNG file to some suitable data structure is discussed in this question.
If you wish to COVER a QR Code with an image you can exploit its error correction mechanism. There are four levels:
Level L - 7% of codewords can be restored.
Level M - 15% of codewords can be restored.
Level Q - 25% of codewords can be restored.
Level H - 30% of codewords can be restored.
So e.g. if you generate a QR Code with error correction level M you can COVER up-to 15% of the QR Code.
Try not to cover the functional patterns (e.g. the markers).
A warning that is presented in the link you included:
If QrCode lose error correction, then it shouldn't exist. Simple as
that. Error correction protects QrCode to be able to read from bad
environment, or damaged code. While Artistic approach will destroy it.

Is it possible to decode incomplete QR Code?

I have an incomplete QRCode (about 30%). Is it possible to decode just the fragment of it? I would really like a code snippet - the language doesn't matter.
If you mean, can you decode the entire contents of a QR code even if part of the code is obscured or changed, then yes you can -- sometimes.
QR codes can be encoded with varying levels of redundancy, which are known as levels L, M, Q and H, and correspond to about 7%, 15%, 25% and 30% redundancy. This means you can lose up to that much of the barcode and still decode it. The more you lose, the harder it is to decode, but remains possible within those limits.
Note that certain regions of the QR code can't be lost. The finder patterns (squares at corners) must be findable; they can tolerate some distortion but there's no error correction to help that. Also, the regions around the finder patterns encode format and version. They have a different redundancy (2x encoding using BCH, not Reed-Solomon), but, if you lose too much of those tiny areas you'll not be able to decode, regardless of the main error correction.

Resources