Sorter: improved sort by blur, and sort by best faces

This commit is contained in:
Colombo 2020-06-23 21:02:38 +04:00
parent 669935c9e6
commit 29b1050637
2 changed files with 11 additions and 5 deletions

View file

@ -269,9 +269,10 @@ def get_block_contrast(block):
def estimate_sharpness(image):
height, width = image.shape[:2]
if image.ndim == 3:
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
if image.shape[2] > 1:
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
else:
image = image[...,0]
return compute(image)