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

  • Starfighter@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 day ago

    QR codes come with (differing levels of) error correction. You could decode it and take the amount of corrected errors as a score.

    I don’t know what unit/chunk of data the error correction works on but you could alternatively dive a bit into information theory and measure how close any of the chunks are to an uncorrectable error and use that as a score.

    One benefit of this approach would be that its a single scan and done vs searching n permutations of the same code.