A system and method for determining an optimal position of an eye relative toan ophthalmic device are disclosed. One embodiment of the method includesreceiving data comprising an image of a surface of an eye with the eye at afirst position relative to an ophthalmic device. An edge feature in the imageis located, and a sharpness calculation on the edge feature is performed usinga predetermined algorithm to yield a sharpness value. The eye surface is thenadjusted to a second position relative to the ophthalmic device, and theprevious steps are repeated until the sharpness value is maximized, which isan indication that an optimal eye position has been achieved. An embodiment ofthe system includes a processor and a software package executable by theprocessor, the software package adapted to perform the calculations as above.Means are also provided for adjusting the eye surface to a second positionrelative to the ophthalmic device.