1. A device for optically examining an object, comprising: a lens; an object stage configured to receive the object; an image-recording apparatus configured to record a plurality of images of the object in a plurality of planes; a piezo-controlled apparatus configured to adjust a distance between the lens and the object prior to the recording of each of the images; and an image-generating apparatus configured to generate a multifocus image from the plurality of images by: separating sharp image areas from unsharp image areas so as to provide a respective partial set of areas from each of the plurality of images, wherein the areas have a high sharpness of detail; determining a respective result image from each respective partial set of areas; and then combining the result images so as to form the multifocus image.