Why do QR Codes have the 3 boxes in the corners?

If you’ve ever looked at multiple QR codes, you may have noticed that 3 of the 4 corners of the codes have boxes in them. I assume this is to help the reader or camera figure out what is the correct positioning (since cameras can be sideways, upside-down, etc., relative to the code). However, wouldn’t only 1 of the corners being a box accomplish this?

One box gives you the orientation, but it doesn’t give you the scaling or the distortion caused by the image being tilted. With 3 points you can figure out the rotation, scaling, and tilt, basically everything you need so that you know how far to offset in both the X and Y directions to find the data.

The wiki article has a pretty good discussion of all the coolitude that’s in a QR code’s design.

This guy made a QR code with an entire game stuffed into it.

I really enjoyed that video
Brian

As did I, though it was only tangentially about QR codes.

(Next up: Make a binary QR code, where the encoded file is an image, containing another QR code. How many layers could you get?)

Per the wiki article, for arbitrary binary data the max capacity of a QR code (so-called version 40) is 2,953 8-bit bytes. Call it 3KB for round numbers.

The bare minimum bit count required to specify the smallest QR code (version 1) as an image is 441 bits. Sounds like you could get a couple layers of QR code images inside a QR code, provided you had a very efficient image file format. I’m not sure whether image compression would help much at the smaller / inner end, but might be useful at the outermost layer(s).