3
\$\begingroup\$

Given a chart I created myself, resembling e-sfr charts, a smartphone and a MTF plot, how could I discover the smallest resolvable detail, dimension wise ? The problem with smartphones is that we don't always have all of the technical hardware information.

To give more context, I'd like to create the smallest QR code that could be read by a smartphone camera when printed. Mine in the occurrence is the Xiaomi MI 9 SE, however, I'd like it to work with any.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ As most readers insist you attempt to fill a given square on the display, this is likely to come down to how close you need to be to fill the square… & whether it can focus at that distance. I've had to faff with far too many of these damn things & barcodes that if you print it small, I won't even bother. \$\endgroup\$
    – Tetsujin
    May 18, 2021 at 11:40
  • \$\begingroup\$ I agree with you, but is there a way then to know/compute exactly (or quite precisely) how small it can get such that the camera's reader can still focus "enough" to be read @Tetsujin \$\endgroup\$ May 18, 2021 at 11:43
  • \$\begingroup\$ There isn't really a "quite precisely" for something hand-held in uncertain light. Do your weekly shopping using your supermarket's own scanner app to see just how much of a PITA it is if one of the codes doesn't quite conform, or is so small you get your own hand & phone in the way of the light, so you end up doing gymnastics to light it… easier with a box of tissues than 15kg of potatoes, of course. \$\endgroup\$
    – Tetsujin
    May 18, 2021 at 11:46
  • \$\begingroup\$ Note that published MTF figures may often be intended more to sell devices than to give you a fully reliable figure. They won'y be made up (in most cases) BUT are liable to be best case or top quartile or .... and you'll need to err on the low side if you are aiming at limiting conditions and want all cameras of a given spec to work. \$\endgroup\$ May 22, 2021 at 7:59

1 Answer 1

3
\$\begingroup\$

Since most camera lens combinations have variable MTF across the field (that is, the system can usually resolve finer details in the center of the frame than on the edges and in the corners), there is no single "magic number", even for a specific camera/lens combo.

Then there's the variability introduced by low light/high ISO that reduces the amount of detail that the same system can resolve compared to when that system is used under more ideal conditions.

There's also the fact that most scans will not be made with the phone perfectly aligned with the QR code. So the minimum theoretically possible size under "perfect" conditions with the target framed perfectly level by the phone and perfectly perpendicular to the phone's sensor won't work if the phone is tilted and/or rotated several degrees with respect to the target QR code.

In the end you have to "aim low" if you want to create QR codes that can be compatible with a large majority of phones.

As for the QR codes themselves, the major variables are:

  • Scanning distance. A QR code on a billboard that will be scanned from 40-50 feet needs to be quite a bit larger than a QR code on a business card that will be scanned from about 12 inches.
  • The amount of data encoded. The more data you want to encode, the more discrete squares called data units arranged in rows and columns your QR code will need, and the larger it must be for each row and column to be the same size. A 25x25 QR code with 625 data units can be smaller than a 125x125 QR code with 2132 data units.
  • The design features of your QR code. If you want to make it something other than a plain B&W "bar code" looking QR code, you need to include plenty of error correction (which increases the total data needed to communicate the same amount of information). QR codes that have colors or are embedded in an image attract more scans than plain B&W QR codes do.
  • Printing considerations. Since printers often scale images, using vector graphics is usually best for QR codes. There also needs to be good contrast between the QR code and the background upon which it is printed.

There are a variety of resources on the net that address this. Here are four that are helpful:

QR Code Minimum Size: Calculate ideal size for your use case
What Size Should a QR Code Be in Relation to Scan Distance?
What is the ideal print size of a QR Code?
QR Code Minimum Size: How Small Can a QR Code Be?

\$\endgroup\$
12
  • \$\begingroup\$ On the topic of printer considerations: The specific issue with scaling raster QR codes is interpolation. It's fine to scale QR codes if the scaling is done using nearest neighbor. \$\endgroup\$
    – Brian
    May 19, 2021 at 22:07
  • \$\begingroup\$ @Brian That still depends on the ratio of the scaling. With vector graphics it a total non-issue. \$\endgroup\$
    – Michael C
    May 20, 2021 at 9:53
  • \$\begingroup\$ Thanks for the answer (and my first upvotes)! It makes me take into account all the parameters you explained for the future. Now theoretically, could we read from a MTF plot the minimum detail resolvable ? I understand MTF10 is usually considered the min. resolvable detail based on the Rayleigh criterion however this wouldn't tell me a "dimension measure" like mm or else (should this be a new question?) @MichaelC \$\endgroup\$ May 20, 2021 at 9:58
  • \$\begingroup\$ MTF ultimately tells you what is the smallest angular measurement your camera system (lens + camera + processing) can resolve. Converting that to a linear measurement requires you to define the distance between the camera and the target. For the same angular measurement, if a target is twice as far from the camera, the target would need to be printed twice as large in linear measurements versus a target you're scanning from half that distance. Because MTF varies across the field with most camera systems, approaching it via MTF to get an absolutely critical number is not very practical. \$\endgroup\$
    – Michael C
    May 20, 2021 at 10:08
  • \$\begingroup\$ You'd need to know the number of data points on the QR code's grid (i.e 25x25 or 125x125 changes the minimum size of the QR code by a factor of 5 for the same resolution limit). You'd need to know the camera's minimum focusing distance if you can assume the camera can get close enough to the QR code to scan it from that distance.. \$\endgroup\$
    – Michael C
    May 20, 2021 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.