blur detection using opencv
You can use the following variance of Laplacian responses:

cv2.Laplacian(gray_image, cv2.CV_64F).var()


More details at https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/