Problem 2
We need a criterion not only to sort images in best focused order, but also criterion/treshold, when image is very defocused and non-informative.
In other words, if we would like to take k-best focused images, we should not take very defocused images. It is better to take only 3 focused images, instead of 6, where 3 are focused and others are defocused.