Friday, September 13, 2013

QR codes: More clever than they seem (promise)

QR Codes have been popping up everywhere lately. They're on flyers, posters, company advertisements, business cards, my sidebar...


banana QR code
...bananas...
cookie QR code
...cookies...

memorial QR code for dead people
...dead people...
volleyball butt QR code
...butts....

everywhere. (For the curious, those were all from wtfqrcodes.com). It turns out the Internet has a lot of hate for QR codes.

QR code flow chart
Not pictured: any love for QR codes

And I get that. It's often way easier to make a link to a website than to create a multi-step process symbolized by what looks like a bar code that's been accidentally run through the wash. According to this poll [warning: PDF] 79% of people have never heard of a QR code (though 81% has seen one before) and 57% of people who have scanned one didn't actually do anything with the information they got from scanning.

So if QR codes are so terrible, why am I making a point to tell you about them?

Because they're really really cool. Not "cool" like "hip," like marketing people want them to be, but "cool" like "wait that weird blob does what?"  Ever wonder why people can cover up half of their QR code with a logo without affecting its ability to take you to the right place?


Octocat QR code customized logo
This should break it, right?

It turns out that QR codes have built-in error correcting mechanisms to help deal with unexpected dirt (or Octocats) that may distort your code. The codes use the Reed-Solomon error correction algorithm, which uses polynomial algebra and compares t checkpoints in the code (therefore being able to correct up to t / 2 mis-read symbols). I won't go in-depth about the actual algorithm; polynomial algebra isn't usually how I like to spend my Friday mornings. For the interested, this site gives a very detailed explanation of how the algorithm is applied. For the slightly less interested, it's the same sort of code (cyclic) as the CRC-32 algorithm that checks Ethernet correctness. Now you have something to talk about at parties.

Not all QR codes are created equal (or equally repairable). There are four different levels of QR error correction, each of which is able to repair a different amount of damage done to the code:
  • Level L: corrects up to 7% damage
  • Level M: corrects up to 15% damage
  • Level Q: corrects up to 25% damage
  • Level H: corrects up to 30% damage

The level is indicated on the QR code itself by the blocks immediately to the right of the bottom left alignment square.

QR code error correction module and levels
You never would have thought to look, would you?

Pop quiz: based on this information, what error correction level was that Octocat code? I'll wait. Level H, you say? You're so clever. Good for you. So that's why the logo didn't ruin it -- that QR code has the highest possible level of error correction [sources 1 and 2]. The main downside to QR codes of level Q or H is their complexity; a small print size or long distance (think business card or billboard) will make your code very hard to read. As such, levels L and M are usually sufficient, unless you plan on keeping your QR code on a surface that might get dirty or change shape


volleyball butt QR code
like a butt


2 comments:

  1. Katharine,

    I thoroughly enjoyed the humor that you had scattered throughout this post. Paired with the generous amount of informative pictures I think this post is very successful in terms of catching attention, which is important for a subject as complicated and borderline-boring as QR code dissection. The pop quiz at the very end was also very helpful, as it somewhat forced me to go back to your blog and read certain parts. My understanding of QR codes only went as far as knowing them as "barcodes on steroids" and your blog has definitely helped me understand them more thoroughly.

    ReplyDelete
  2. Katharine,

    You know how they say, "Never judge a book by it's cover"? Well, I definitely would do so with you! Your blog posts are hilarious. You sound really awesome and I adore your blog! You preach the truth about everything in your posts and it's a really nice change from the usual, "You should do this because it's a new technological advancement as well as something our professor said to blog about!" I really enjoyed the picture of the girl with a QR plastered on her rear. Halloween is coming up too.. Thank you for the humorous read.

    ReplyDelete