Ask HN: What is the most effective way to unblur a QR code?
I encountered a video with a QR code blurred out with the caption “blurred to prevent intruders” [1]. Since I had watched a Veritasium's video [2] I had some idea about its working. So with an ethical hacker spirit, I tried to recover the QR. First step failed, where I checked HuggingFace for any QR unblurring models because that is what roughly most AI ImageGen models inherently do - keep unblurring until the desired result, but found no models, though I found some relevant research papers [3].
In the end, I manually identified the QR module size (81×81) and hoped for high error correction (H) so that 30% incorrect QR will still be valid. Since the blur varied across regions, I processed it in two parts: Adobe Photoshop's Smart Sharpen worked well on the outer section, while a PS script added black pixels to the inner region and applied gaussian blur until the final image had a similarity. Eventually, ZXing library returned a decoded result [5] and I assume that the URL is valid but the session has expired so the URL is harmless.
[1]: https://files.horizon.pics/29f1785d-11a5-414b-96df-acc627b9e867?a=1672&mime1=video&mime2=mp4
[2]: https://www.youtube.com/watch?v=w5ebcowAJD8
[3]: https://dl.acm.org/doi/10.1145/2802083.2808390#tab-citations
[4]: https://files.horizon.pics/a5297fa9-dd1a-470f-bb8f-8038d2694867?a=1672&mime1=video&mime2=mp4
[5]: https://enormicom-chat.once.com/session/transfers/eyJfcmFpbHMiOnsibWVzc2FnZSI6Ik1RPT0iLCJleHAiOiIyMDIzLTEyLTIxVDAwOjA4OjMzLjc2N1oiLCJwdXIiOiJ1c2VyL3RyYW5zZmVyIn19--7e7c2a242b835fff8df00467ca14fba85c7c8139e6adad052287ce13d9c5f659
It looks like Gaussian blur. Probably "deconvolution" can fix it. Random link from Google: https://www.ianmorison.com/deconvolution-sharpening/
Thanks
> It looks like Gaussian blur. Probably "deconvolution" can fix it. Random link from Google: https://www.ianmorison.com/deconvolution-sharpening/
After a quick search, the Smart Sharpen I used along with setting the remove dropdown to Gaussian Blur, does indeed deconvolution sharpening.
Will try the same in Lightroom & CameraRAW which the author suggests may have better results. [1]
[1]: https://gregbenzphotography.com/photography-tips/what-is-dec...