百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

BlurDetection2

> 编程语言
开源

在 Python 中使用 OpenCV 进行模糊检测

387 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

在 Python 中使用 OpenCV 进行模糊检测

Blur Detection

Blur Detection works using the total variance of the laplacian of an image, this provides a quick and accurate method for scoring how blurry an image is.

This package only depends on numpy and opencv, to install them run,

bash
pip install -U -r requirements.txt

The repository has a script, process.py which lets us run on single images or directories of images. The blur detection method is highly dependent on the size of the image being processed. To get consistent scores we fix the image size to HD, to disable this use --variable-size. The script has options to,

bash
# run on a single image
python process.py -i input_image.png

# run on a directory of images
python process.py -i input_directory/ 

# or both! 
python process.py -i input_directory/ other_directory/ input_image.png

. In addition to logging whether an image is blurry or not, we can also,

bash
# save this information to json
python process.py -i input_directory/ -s results.json

# display blur-map image
python process.py -i input_directory/ -d

The saved json file has information on how blurry an image is, the higher the value, the less blurry the image.

json
{
    "images": ["/Users/demo_user/Pictures/Flat/"],
    "fix_size": true,
    "results": [
        {
            "blurry": false,
            "input_path": "/Users/demo_user/Pictures/Flat/IMG_1666.JPG",
            "score": 6984.8082115095549
        },
    ],
    "threshold": 100.0
}

This is based upon the blogpost Blur Detection With Opencv by Adrian Rosebrock.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonblurblur-detectionblur-detectorblurry

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言