Image Manipulation (Cleaning QR Codes)
Anyone have any bright ideas on how to clean up this image? In particular I need to straighten the jagged edges and restore as much detail as I can. I'm currently using image manipulation.
Also taking suggestions for other discords to visit about this.

22 Replies
my initial idea might be to create some kind of grid over the qr code and taking the pixel (or the average of some range of pixels) at the center of each cell in the grid
I don't want to implement my own algorithm for this, because I know it exists somewhere in ImageMagick
For instance, this is getting some okay results:

But still has work to do.
I mean... I hate to be obvious, but is is a QR code.
And the first is perfectly readable.
So read it and re generate it. :)
It is not readable by zxing at least.
my google phone gets it
So does mine, how can I use their models in C#?
Probably would need to figure out what they're doing and just yank it. Lets see.
Also tried OpenCV, but no dice.
But yeah whatever accuracy is in phone scanners works
So they have this MLKit page about barcode models.
Looks to be some sort of replacement for their mobile vision API.
So maybe it's what they use now.
Also the Google code scanner API apparently.
Mhm. Proprietary shit, and off-prem.
Maaaybe.
Oh. Also, xzing works for me.
https://zxing-js.github.io/library/examples/qr-camera/ I justpointed my web cam at my discord and it got it
Might have something to do with it being further away
I can try to reduce the scale it's reading
I had to put the camera a bit close to the screen.
regardless I don't have that kind of input, just dealing with raw image data
Generally, my view, and this is kind of theoritical, is that the optimal algo for cleaning up the image is going to be one specifically tailored to the exact type of image and expectation.
And that's going to be a QR reader.
I'm totes fine with trying other readers, but their number is few.
I tried both zbar and opencv, both didn't work.
If there's line detection you can apply to redraw and stuff, it'll be already built into the QR code libraries.
Some of them - zxing for instance fails most of these QR codes unless I apply a slight blur
Interesting.
Might be built around expectations of a camera being involved.
I think the problem space changes when all you have is raw images as opposed to some sort of webcam