In this article, I will share with you how to check image blur or not using the python script. some days ago i was working on one application and in that application i need built functionality bank cheque OCR. user upload the cheque image and system detect some needed text data from image.
In OCR functionality user upload image in application. but some time user uploaded image not with the good quality. so, i add check image blur or not functionality on uploaded image and this can be help me if uploaded image was blur then system rejected it and send some warning to user.
A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeletonization, displaying Matplotlib images, sorting contours, detecting edges, and much more easier with OpenCV and both Python 2.7 and Python 3.
pip install imutils
NumPy is the fundamental package for array computing with Python.
pip3 install numpy
Wrapper package for OpenCV python bindings.
pip install opencv-python
from imutils import paths
import 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 = "Not Blurry"
if fm < 100:
text = "Blurry"
print text
i hope this will be help a lot.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
Django 3 Multiple File-Image Upload with Angular 9
In the precedent tutorial we have optica...How to Install Django in Ubuntu 20.04 LTS
Django is a free and open-source high-le...Laravel 8 Eloquent whereNotBetween query example
Laravel eloquent method whereNotBetween...Laravel 8 Create Events in Fullcalendar using Ajax
In this article,I will show you how you...Javascript selector
With Javascript, you can change HTML ele...