5

I have a jpeg data url in a javascript string. Is there a way I can detect the "blurriness" of the picture? The pictures come from a video that is being processed in-browser.

I understand that it isn't simple, and there is no definitive standard of blurriness, yet is there a way to measure blurriness?

1 Answers1

4

There are several approaches to blur detection, I implemented a really simple one once and wrote this blog post about it: http://www.codeoclock.com/2015/06/05/blur-detection-javascript/

Code can be found here: https://github.com/timotgl/inspector-bokeh

The algorithm isn't very refined, but I was able to detect images with a lot of blur somewhat reliably.

timotgl
  • 1,961
  • 8
  • 16
  • A simple test with this blurry image https://www.facebook.com/postcardnow/photos/a.115486162502141.1073741828.110080529709371/130127087704715/ shows a Blur score of 0.36. Your library may have to be improved! – Tim Long Nov 10 '17 at 11:26
  • 2
    @TimLong Yes it's experimental. Feel free to tune the algorithm and contribute on GitHub. I'm not actively maintaining the project. – timotgl Dec 08 '17 at 12:08