ref:https://pyimagesearch.com/2015/09/07/blur-detection-with-opencv/
论文 ref:https://www.cse.cuhk.edu.hk/leojia/all_final_papers/blur_detect_cvpr08.pdf
遇到模糊的图片,还要处理一下,把它挑出来,要么修复,要么弃用。否则影响后续效果。
根据模糊值排序即可,写在文件名中,自动排序,然后对模糊的去掉即可
import os.path
from imutils import paths
import argparse
import cv2
import shutil
def variance_of_laplacian(image):
# compute the Laplacian of the image and then return the focus
# measure, which is simply the variance of the Laplacian
return cv2.La