Method implemented by computer to determine an optimal position of better focus of an eye in relation to an ophthalmic device, comprising the following steps: (a) receiving data (102) comprising an image of a surface of an eye, with the eye in a first position in relation to an ophthalmic device (11); (b) locate (103) an edge feature in the image; (c) perform a sharpness calculation (107) on the edge characteristic using a fast Fourier transform function (104) to calculate a sharpness value (109), the steps comprising filtering the image data (108) for retain a spectral content of low, medium and high frequency and combine information of different frequencies in the spectral content of low, medium and high frequency retained, so that it can be used to discriminate between large and small levels of blur (110), ( d) adjust the surface of the eye to a second position (112) in relation to the ophthalmic device based on the sharpness calculation (107) in the edge feature; and (e) repeat steps (a) - (d) until the sharpness value is maximized (111), the first position of stage (a) being the second position of stage (d) of each stage previous cycle and the second position of stage (d) being a new position, indicating that an optimal position of better focus of the eye has been achieved (111).Método implementado por ordenador para determinar una posición óptima de mejor enfoque de un ojo con relación a un dispositivo oftálmico, que comprende las etapas siguientes: (a) recibir datos (102) que comprenden una imagen de una superficie de un ojo, con el ojo en una primera posición con relación a un dispositivo oftálmico (11); (b) localizar (103) una característica de borde en la imagen; (c) realizar un cálculo de nitidez (107) en la característica de borde utilizando una función de transformada rápida de Fourier (104) para calcular un valor de nitidez (109), comprendiendo las etapas de filtrar los datos de imagen (108) para retener un contenido espectral de frecuencia baja, media