Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

BlurDetection2

> 编程语言
Open source

Blur Detection with OpenCV in Python

387 stars0 likes1 views
WebsiteGitHub

About

Blur Detection with OpenCV in Python

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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonblurblur-detectionblur-detectorblurry

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

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