Detect in-focus regions of an image
it is quite easy to measure the local max frequency in an image (at least as a low resolution mask, with some regularization).
Several papers of the MIT graphics group have been around detecting and processing from this kind of clue, with regular or coded aperture cameras.
e.g. Defocus Magnification and Image and Depth from a Conventional Camera with a Coded Aperture.