--- title: QR Scan Difficulty Check emoji: 📷 colorFrom: gray colorTo: red sdk: docker app_port: 7860 pinned: false disable_embedding: true license: other short_description: Where your QR code falls among thousands of measured codes --- # How hard is your QR code to scan? All 6,499 codes [QR Scan Difficulty](https://huggingface.co/spaces/devmandan/qr-scan-difficulty) measured at seven sizes, on one scale from easy to hard, shaded by how many of eight scanners read each one at 1280 pixels. Add pictures of your own codes and each one appears as a numbered line where it falls. Move the slider to see a measured code from any spot, with what the eight scanners did on codes there. ## How a picture is placed Each picture is read the way every measured code was: turned gray and shrunk, never enlarged, to seven sizes from 1920 down to 224 pixels on its long side, and read at each size by the five of the eight scanners that run on a Linux server, with the measurement's versions and settings: | Scanner | What runs here | |---|---| | Android Settings' scanner | [ZXing](https://github.com/zxing/zxing/releases/tag/zxing-3.5.2) 3.5.2, called as Android's Settings app calls it (QR only, inverted retry) | | WeChat's scanner | [WeChatQRCode](https://docs.opencv.org/4.12.0/d5/d04/classcv_1_1wechat__qrcode_1_1WeChatQRCode.html), OpenCV contrib 4.12.0.88, with its detector and super-resolution models (the app's own build may differ) | | zxing-cpp | [zxing-cpp](https://github.com/zxing-cpp/zxing-cpp/releases/tag/v3.1.1) 3.1.1, library defaults, QR only | | OpenCV, newer | [QRCodeDetectorAruco](https://docs.opencv.org/4.12.0/d3/db0/classcv_1_1QRCodeDetectorAruco.html), OpenCV 4.12, single-code `detectAndDecode` | | OpenCV, original | [QRCodeDetector](https://docs.opencv.org/4.12.0/de/dc3/classcv_1_1QRCodeDetector.html), OpenCV 4.12, single-code `detectAndDecode` | Transparent parts count as white, as on a printed page. A scanner reads a picture when it returns the content that more of the five return than any other, even if only one returns any (the measurement scored each code against its true content instead); a picture with several codes is placed by that one. A decode that runs past 20 seconds counts as a miss, as in the measurement, and a picture's reading stops after 40 seconds, so that each request ends within a minute; reads not done by then count as misses, and the page says so. Read again on this Space's Linux server, 416 of the measured codes gave the measured result in all but 7 of their 14,560 reads: on this processor WeChat's scanner and OpenCV's newer detector come out differently on a few borderline pictures. The other three scanners, Apple's, Google's and Huawei's (Scan Kit), can't run here: Apple's runs only on Apple devices, and Google's and Huawei's, as measured, need Android. So a picture is placed from its 35 reads (five scanners at seven sizes) on the scale all eight set, which stays as measured: the five scanners' reader curves from the measurement's two-parameter item-response fit are held fixed, and the picture's difficulty is the most likely one given its reads. On the measured codes, codes that at least two of the five read at 1280 pixels land within about 4 points of where all eight put them, 9 times in 10, on a 0 to 100 scale where clean prints sit near 19 and tough prints near 56. Where only one reads it at 1280 pixels, or none does but some do at another size, only about half land that close, and the page draws the line dashed, as it does for a reading cut short by the time limit. A picture none of the five read at any size goes to the pile on the right, where its place is least sure. Of the measured codes like that, most are distorted research images; the phones' own scanners still read about 1 in 6 of them (280 of 1,754, at some size), and 33 of the 59 photos and prints among them (BoofCV's photos, Broken QR 104's codes from the web, and the simulated everyday and tough prints). The page shows how many of the five read a picture at 1280 pixels, and, for its place on the scale, how much of the curve there is codes all eight read at 1280 pixels. The curve is an illustrative mix of the sets, not a count of them: half everyday prints, a fifth each clean and tough prints, a tenth the research sets. The page never claims what a phone would do with your picture. ## Privacy A picture is written to a temporary file, read, and deleted as soon as the reading ends. Nothing is stored, and this server keeps no access log. The decoded content is sent back to your browser only, so you can see which code was read. Hugging Face, which hosts the Space, has its own [privacy policy](https://huggingface.co/privacy). ## Limits Up to 25 MB and 50 megapixels a picture, and 40 at a time; the page sends them one by one, and each must arrive within a minute. JPEG, PNG and WebP are read as sent. Other formats your browser can open (such as GIF, AVIF, or HEIC in Safari) are converted by your browser first, as it shows them: transparent parts on white, at most 16 megapixels, as PNG, or as a high-quality JPEG when the PNG would be over 25 MB. SVG files are not read. The server reads two pictures at once and keeps up to 16 more waiting; one that would wait longer than 10 seconds is turned away with a request to try again in a minute. On Hugging Face's free hardware the Space sleeps when nobody has used it for a while, and the first visit after that wakes it up. ## Credits - Scanners: ZXing (Apache-2.0), zxing-cpp (Apache-2.0), OpenCV and opencv_contrib (Apache-2.0), WeChat's QR models (© THL A29 Limited, a Tencent company; Apache-2.0) from WeChatCV's [opencv_3rdparty](https://github.com/WeChatCV/opencv_3rdparty/tree/3487ef7cde71d93c6a01bb0b84aa0f22c6128f6b), fetched at build time with their licence and checked against pinned SHA-256 sums. - Server: Starlette and Uvicorn (BSD-3-Clause), NumPy (BSD-3-Clause); Java: OpenJDK 17 (GPL-2.0 with the Classpath Exception). Libraries bundled in these packages keep their own licences. - Codes on the curve: made for the measurement ([QR Scan Difficulty: synthetic codes](https://huggingface.co/datasets/devmandan/qr-scan-difficulty), CC BY 4.0), and from research datasets, each under its own terms: [BoofCV QR singles](https://huggingface.co/datasets/devmandan/boofcv-qr-singles) (Peter Abeles' BoofCV QR Code Performance Benchmark photos, published openly without an explicit licence grant), [QR-DN1.0](https://huggingface.co/datasets/devmandan/qr-dn1.0) (CC BY 4.0, Mendeley Data, doi:10.17632/t2bdr663ms.2), [syn10k](https://huggingface.co/datasets/devmandan/syn10k-huawei-barcodes) (Bodnár, Grósz and Tóth; CC BY 4.0) and [Broken QR 104](https://huggingface.co/datasets/devmandan/broken-qr-codes-104) (annotations CC BY 4.0). Pictures are cropped and resized from their datasets; to have one removed, open a discussion on its dataset page. ## Disclosures Independent work, not affiliated with or endorsed by Apple, Google, Huawei, Tencent or DENSO WAVE, nor by the open-source projects and dataset authors credited above. QR Code is a registered trademark of DENSO WAVE INCORPORATED. Apple and iPhone are trademarks of Apple Inc.; Android and Google Play of Google LLC; Huawei of Huawei Technologies Co., Ltd.; WeChat of Tencent. Other names are trademarks of their owners.