I've been working on a focusing system, it rewards a high signal for large amounts of detail - so the better the focus the more detail will appear and so the higher the grading.
The green graph is the percentage (0 to 100%) grading overlaying on the image - the upper and lower bounds are shown as darker green colour.
As a focusing tool this works nicely - the image is through rain soak glass (we are in the middle of rain/winds that have a UK national alert!). However form inside.. here's the flowers from the bottom of the garden: