A tiny Python script that detects whether an image is blurry using the classic Variance of Laplacian focus measure.
It prints the result and opens a window showing the image with an overlaid label and score.
- Converts the image to grayscale
- Computes
Laplacian(gray).var() - Compares against a threshold (currently
100.0inapp.py)
- Python 3
- OpenCV (
opencv-python) imutils(imported in the script)
python app.py --image path/to/image.jpg- Tune the blur threshold in
app.py:
threshold = 100.0app.py— main scriptavatar.png,avatar-blur.png— sample imagesresults/— output examples
No license specified.