We present a new algorithm to determine, quickly and accurately,
the best-in-focus image of biological particles. The algorithm is
based on a one-dimensional Fourier transform and on the Pearson correlation
for automated microscopes along the Z axis. We captured a set
of several images at different Z distances from a biological sample. The
algorithm uses the Fourier transform to obtain and extract the image
frequency content of a vector pattern previously specified to be sought in
each captured image; comparing these frequency vectors with the frequency
vector of a reference image (usually the first image that we capture
or the most out-of-focus image), we find the best-in-focus image via
the Pearson correlation. Numerical experimental results show the algorithm
has a fast response for finding the best-in-focus image among the
captured images, compared with related autofocus techniques presented
in the past. The algorithm can be implemented in real-time systems
with fast response, accuracy, and robustness; it can be used to get
focused images in bright and dark fields; and it offers the prospect of
being extended to include fusion techniques to construct multifocus final
images