The invention relates to a method for automatically adjusting focus based on a
frequency domain comparison method. The method comprises the steps that a computer controls a mechanical telescoping lens
barrel and adjusts the position of either a
digital camera, or an imaging aspherical lens or a microobjective, on one hand the telescoping lens
barrel conducts telescoping movement, and on the other hand the camera conducts shooting, so that K picture data I0,..., Ii,..., Ik-1 is obtained, the telescoping position of the mechanical telescoping lens
barrel when focusing is needed is obtained through a series of calculation, and automatic focusing can be achieved by making the mechanical telescoping lens barrel
telescope to the telescoping position. Through comparison and analysis of
frequency domain components, harmful effects brought by picture
noise on
automatic focus adjusting precision can be avoided. The method for automatically adjusting focus based on the
frequency domain comparison method is more suitable for
automatic focus adjusting of transmission imaging, particularly on a noninvasive condition in which capillaries inside the
human skin have periodicity in shape and distribution, and have more obvious features in the frequency domain. By means of the method for automatically adjusting focus based on the frequency domain comparison method, the focus is more accurately automatically adjusted. In the aspect of operation of devices, the devices are simpler and thus easy to use practically.