this post was submitted on 10 May 2026
14 points (88.9% liked)

Programming

26913 readers
355 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

I am writing something that needs to verify the practical readability of qr codes which has been painted over.

First thing that comes to mind is to apply Gaussian blur on the image and check if it is readable. Then I could get a "readability score" by doing binary search between blur strengths range [0, n].

I also may do the same with noise, not sure if I should.

Would appreciate if somebody with more knowledge of QR codes help me

you are viewing a single comment's thread
view the rest of the comments
[–] kevincox@lemmy.ml 2 points 3 days ago* (last edited 3 days ago)

I doubt Gaussian blur is an accurate model of real-world situations.

At the end of the day if you are worried about the codes being painted over print a few out and paint over them. Then scan with a variety of scanners.

If I had to come up with some more digital tests I would guess that a few of these are more representative of real-world situations:

  1. Lower contrast. For example lighten or darken the whole code. This would simulate things like scanning in low light or with glare.
  2. Block out sections of the code. This will test error correction levels and simulate partial damage or pockets of extreme glare.
  3. Skew the code in various ways. This simulates the perspective shift of people scanning the code from an angle.

Ideally combine them in a bunch of scenarios then try to scan with a variety of scanner implementations.