To detect image blurriness, you can use the Laplacian Variance method. It’s a simple and effective way to measure the sharpness of an image. Here’s a Python example using OpenCV:
Python Code to Detect Image Blurriness
Explanation
-
Laplacian detects edges. A sharper image has more edges, leading to a higher variance.
-
If the variance is low, the image has fewer edges → it’s likely blurry.
-
You can tune the
thresholdbased on your image dataset (commonly between 50–150).
Let me know if you want a version using PIL, TensorFlow, or if you want to upload and check an image here.
Share this Page your favorite way: Click any app below to share.