Focus variation is a method used to sharpen images and to measure surface irregularities by means of optics with limited depth of field.
[1] The algorithm works as follows: Focus variation requires an optics with very little depth of field.
These objectives have a high numerical aperture which gives a small depth of field.
The use of this method is for optical surface metrology and coordinate-measuring machine.
This means measuring form, waviness and roughness on samples.