The invention discloses an automatic focusing method and device. The automatic focusing method comprises the following steps that illumination light emitted by a
light source is reflected to
pilot light in a sample; the
pilot light is divided into first and second
pilot light by semi-reflection semi-transmission, the reflected first
pilot light is obtained behind a reflection light focusing position, and the reflected second
pilot light is obtained in front of a
transmitted light focusing position; a driving
signal S is obtained by calculation; the defocusing quantity of the sample is calculated according to the driving
signal S; and an object lens is driven to focus according to the defocusing quantity. The
pilot light reflected by the sample is divided into two paths of pilot light, thetwo paths of pilot light are obtained in different positions, two signals are obtained after
processing, the defocusing quantity of the sample is obtained by calculating a difference of the two signals, and the object lens is driven to implement accurate focusing after that the defocusing quantity is known. The focusing method and device simplify design of the
optical path,
signal calculating is simpler, the defocusing quantity can be calculated rapidly and accurately, and the object lens can be focused automatically, rapidly and accurately.