--- license: cc-by-4.0 pretty_name: QR Scan Difficulty, synthetic codes tags: - qr-code - barcode - benchmark - synthetic configs: - config_name: tiers data_files: tiers/** - config_name: ladders data_files: ladders/** --- # QR Scan Difficulty: synthetic codes The QR codes made for the QR Scan Difficulty page, which measures how many QR codes the scanners in phones can read, on these simulated prints and on codes from four research datasets. Every image is a synthetic camera picture of a printed code, so its content and every condition that shaped it are known exactly. - **tiers**: 1,400 codes in three sets, clean (200), everyday (600) and tough (600), each with its difficulty on the page's scale and which of eight scanners read it at seven image sizes. - **ladders**: 13,520 codes for the page's "What makes a code hard to read": one code changed one step at a time, 17 factors, 80 codes per step, each with which scanners read it at 1280 px. ## How the images were made Each image is a 1920 × 1440 grayscale "camera capture": a QR code printed on paper and placed in a scene, with perspective, optional curvature, lighting, glare, blur, noise and JPEG compression. The content of every code is made up: an uppercase web-style address on a reserved domain (such as `HTTPS://Q.EXAMPLE.COM/…`), or plain letters and digits, filling about 90% of the code's capacity. Ladders start from one easy code that every scanner reads (version 3, 8 camera pixels per square, sharp, nearly head-on) and change a single factor. A seed is the same code in the same scene at every step, so a step changes only its factor. `version` keeps the printed size, so its squares shrink as the data grows; `version_big` takes the very same codes and scenes and prints them bigger, so every square keeps 6 camera pixels (up to version 21, the largest that fits a 1280 × 960 picture at every angle). ## Fields Both parts: `file_name`, `id`, `payload` (the code's exact content) and the generator's parameters: | Field | Meaning | |---|---| | `version`, `ec` | QR version (size of the grid) and error-correction level | | `ppm` | camera pixels per square of the code, stated at a 1280-pixel-wide image | | `quiet` | width of the blank margin, in squares | | `fill` | 1 for solid squares; less than 1 for round dots of that width | | `tilt`, `axis`, `psi` | tilt of the paper (degrees), the direction it tilts about, and its rotation in the picture | | `curve` | bend radius as a multiple of the code's width (null: flat) | | `ink`, `paper`, `inverted` | grey levels (0 to 255) of the ink and the paper; true for light-on-dark | | `gradient`, `shadow`, `glare` | strength of uneven light, of a shadow, and of a glare spot | | `blur`, `motion` | focus blur and shake, in pixels at a 1280-pixel-wide image | | `noise`, `jpeg` | sensor noise and JPEG quality | | `damage`, `corner` | smudges (share of the pattern) and how much of one corner square is covered (ladders) | **tiers** also have `set` (clean, everyday or tough), `difficulty` (the page's 0 to 100 scale, set only by which scanner-and-size pairs read the code; −6 means every pair read it, 106 that none did) and `reads`: for each image size (the long side shrunk to that many pixels, never enlarged), the scanners that returned the exact content. **ladders** also have `factor`, `step` (0 is the easy end), `seed`, `quad` (the code's four corners in the image) and `reads_1280`: the scanners that returned the exact content at 1280 px. ## Scanners A read counts only when a scanner returns the code's exact content, byte for byte. - `zxing-cpp`, zxing-cpp: The C++ ZXing port inside open-source Android scanners such as Binary Eye; version 3.1.1, library defaults, QR codes only. - `wechat`, WeChat: WeChat's open-sourced CNN scanner as shipped in OpenCV contrib 4.12, with its detector and super-resolution models. - `opencv`, OpenCV: OpenCV 4.12's classic QR detector, single-code detectAndDecode. - `opencv-aruco`, OpenCV ArUco: OpenCV 4.12's ArUco-based QR detector, single-code detectAndDecode. - `apple-vision`, Apple Vision: Apple's Vision barcode detector, our stand-in for the iPhone; measured on macOS 14.3, request revision 4, QR codes only. - `zxing-java`, ZXing (Java): ZXing 3.5.2, called the way Android's Settings app calls it to read Wi-Fi QR codes; also inside apps built on zxing-android-embedded. - `mlkit-gms`, ML Kit: Google's ML Kit barcode scanning as Google Play services delivers it (play-services-mlkit-barcode-scanning 18.3.1, Google Play services 26.41.31, barcode module 264131001), QR codes only, on Google's Android 14 emulator image (API 34, arm64), where Android's QR button is set to open Play services' ML Kit barcode scanner. - `hms-scankit`, Huawei Scan Kit: Huawei's scanning engine, built into HarmonyOS and shipped in HMS Core on Huawei phones: Scan Kit 2.15.0.301 (com.huawei.hms:scanplus, from Huawei's developer repository), whose three models are byte-identical to those in HMS Core 6.16.2.300. Each picture decoded in photo mode, QR codes only, on Google's Android 14 emulator image (API 34, arm64). Samsung's scanner, measured on a real phone on a sample of codes, is not included code by code. ## The page's other codes The page also measures four research datasets, published with their own terms: [BoofCV QR singles](https://huggingface.co/datasets/devmandan/boofcv-qr-singles), [QR-DN1.0](https://huggingface.co/datasets/devmandan/qr-dn1.0), [syn10k](https://huggingface.co/datasets/devmandan/syn10k-huawei-barcodes) and [Broken QR 104](https://huggingface.co/datasets/devmandan/broken-qr-codes-104). Independent work, not affiliated with or endorsed by Apple, Google, Huawei, Samsung or Tencent.