We show an approach to the correction of defocusing in stacks of images of
3D scenes using the second order moment of the co-occurrence matrix, a conc
ept similar to that of the structure function used in scattering and Browni
an motion. The local value of these functions shows a clear maximum in the
regions of correct focus. The concepts are applied to simulations, to actua
l plane images and to 3D scenes.