How To Check Image Blur Or Not Using Python

python get-pip.py
pip -V
pip install imutils
pip3 install numpy
pip install opencv-python
from imutils import pathsimport argparse
import cv2
import sys
def variance_of_laplacian(image):
return cv2.Laplacian(image, cv2.CV_64F).var()
#path of image URL
imagePath = sys.argv[1]
image = cv2.imread(imagePath)gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)fm = variance_of_laplacian(gray)text = "Image is not blurred..!"if fm < 100:
text = "Image is blurred..!"
print text
python blur_detection.py -i images -t 100

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Websolutionstuff

Websolutionstuff

I am Laravel and PHP Developer. I have also Good Knowledge of JavaScript, jQuery, Bootstrap and REST API.