commit 9c3b03c8457d6eff75a90a49638b23887edcdb57 Author: Kjistóf Date: Mon Jan 1 16:33:10 2018 +0100 initial commit diff --git a/imgrate.py b/imgrate.py new file mode 100755 index 0000000..ba68dd5 --- /dev/null +++ b/imgrate.py @@ -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)) \ No newline at end of file