A device and method for capturing images of a specific part of an anatomical structure using a series of images, wherein an image is taken of the anatomical structure and is compared to a database of information is order to determine and optimize the imaging conditions used for taken subsequent images of the specific part. Thus, it becomes possible without using a half mirror to make the light via the optical system to be examined be received at a detector via the wavefront division optical element, or the light via the optical system to be examined be received at the detector without the wavefront division optical element. Triangular faces on the surface mesh that intersect the partition plane are identified. Further, the number of multiple discharges is not restricted. While receiving the user input, the following actions are performed one or more times: pixels are coherently classified in the raster of pixels as being foreground or background based on the sample of pixels; and a rendering of the image is updated on a display to depict classified foreground pixels and background pixels as the sample is being defined.