initial commit

This commit is contained in:
Kjistóf 2018-01-01 16:33:10 +01:00
commit 9c3b03c845

18
imgrate.py Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env python3
import cv2
from argparse import ArgumentParser
def laplacian_variance(image):
grayscale = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
return cv2.Laplacian(grayscale, cv2.CV_64F).var()
if __name__ == '__main__':
ap = ArgumentParser()
ap.add_argument('images', type=str, nargs='+', help='')
args = ap.parse_args()
image = cv2.imread(args.images[0])
print(laplacian_variance(image))