diff --git a/imgrate.py b/imgrate.py index 023ee61..070ba75 100755 --- a/imgrate.py +++ b/imgrate.py @@ -26,6 +26,11 @@ class imgrate: image = cv2.imread(imgfile) self.image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) + @property + @image_required + def quality(self): + return self.laplacian * self.fdibm + @property @image_required def laplacian(self): @@ -48,7 +53,7 @@ if __name__ == '__main__': ap.add_argument('images', type=str, nargs='+', help='') args = ap.parse_args() - ratings = {image: imgrate(image).laplacian for image in args.images} + ratings = {image: imgrate(image).quality for image in args.images} maximum = max(ratings, key=ratings.get) for rating in ratings.keys():