0

我有一张图像,我对计算图像中存在的模糊感兴趣;为此,我在构建功能中使用了 openCV,称为cv2.Laplacian(image). 但我可以量化图像中存在的模糊量。无论如何,我们可以计算给定图像的模糊归一化值。

def blur(path):
    image = cv2.imread(path)
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    fm = cv2.Laplacian(gray, cv2.CV_64F).var()
    return fm
4

0 回答 0