def estimate_blur(image, threshold=100):
if image.ndim == 3:
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
blur_map = cv2.Laplacian(image, cv2.CV_64F)
score = numpy.var(blur_map)
return blur_map, score, bool(score < threshold)
评论列表
文章目录