如何使用Javascript检测图片是否模糊? [英] How can I detect if a picture is blurry with Javascript?

查看:419
本文介绍了如何使用Javascript检测图片是否模糊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在javascript字符串中有一个jpeg数据网址。有没有办法可以检测到图片的模糊?这些图片来自正在浏览器中处理的视频。

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?

推荐答案

有几种模糊检测的方法,我实施了一次非常简单的方法并撰写了这篇关于它的博文: http://www.codeoclock.com/2015/06/05/blur -detection-javascript /

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/

代码可以在这里找到: https://github.com/timotgl/inspector-bokeh

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.

这篇关于如何使用Javascript检测图片是否模糊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆