Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect if a picture is blurry with Javascript?

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?

like image 391
Matt Votsikas Avatar asked Oct 03 '22 07:10

Matt Votsikas


1 Answers

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.

like image 129
timotgl Avatar answered Oct 07 '22 18:10

timotgl