Use a mix of laplacian and fdibm to calculate quality measurement

This commit is contained in:
Kristóf Tóth 2018-02-24 20:43:19 +01:00
parent 6f0fb68e2b
commit 461fd8e8f0

View File

@ -26,6 +26,11 @@ class imgrate:
image = cv2.imread(imgfile) image = cv2.imread(imgfile)
self.image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) self.image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
@property
@image_required
def quality(self):
return self.laplacian * self.fdibm
@property @property
@image_required @image_required
def laplacian(self): def laplacian(self):
@ -48,7 +53,7 @@ if __name__ == '__main__':
ap.add_argument('images', type=str, nargs='+', help='') ap.add_argument('images', type=str, nargs='+', help='')
args = ap.parse_args() 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) maximum = max(ratings, key=ratings.get)
for rating in ratings.keys(): for rating in ratings.keys():