Skip to content

Comment on Tiny Code Reader: a $7 QR code sensorparent

Comments

Here's an example to start with: ImageMagick's -threshold or -adaptive-threshold (depending on the image's lighting) are what you want to look at, e.g. try something like

    magick input.jpg \
      -colorspace Gray \
      -adaptive-threshold 8x8+10% \
      candidate.png

And if you wanna go even lower, you'll "raw" read the image pixel by pixel to normalise colour to black/white and then read that matrix for the QR pattern.

And then, cause there are some inverted colour QRs, flip and scan again.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.