Local visibility is used to identify areas of correct focusing in stac
ks of digital images of scenes illuminated with structured light with
progressive severe defocusing. Visibility is a maximum when focusing i
s correct. The method requires high spatial frequency for best perform
ance. So, the scene is projected with a set of high contrast fringes a
nd we use the spatial derivative of the images that compose the stack,
to Increase its relative content. An image with partially corrected d
efocusing can be constructed in this way. A formalism was developed fo
r evaluating the visibility behavior with sinusoidal input as a functi
on of the defocus distance. The visibility peak is the highest when th
e spatial derivative of the double defocused sinusoidal intensity is u
sed.