Vision-based measurement techniques have become very important in the biomedical field, especially for macro applications such as fingerprints detection, retinal measurements and melanomas analysis. These applications usually require fast and accurate focusing systems to rapidly acquire the optimal image for the successive elaborations. Applications in macro regions also need a stable focus to systems that suffer from low frequency vibrations due to the natural oscillations of the human body.
Liquid lens objectives have become popular in the last years thanks to their small dimensions (apertures goes from 3 mm to 10 mm), low power consumption (less than 0.1 mW) and fast response time (about 15 ms) [1]. These characteristics make the liquid lens objectives suitable for autofocusing systems, which require high velocity, good accuracy and good stability. The high-speed control of liquid lens objectives requires smart algorithms for the autofocusing procedure, especially in macro regions.
We developed a new system for biomedical macro applications. It uses a liquid lens objective, which implements a voltage control of the focal length, and an autofocus algorithm. The algorithm finds the best focus position using a two-stage search: a coarse searching and a fine searching. This approach combines high accuracy and high speed of convergence.
![](https://mmtlab.unibs.it/wp-content/uploads/2016/08/Figure1-1024x736.png)
The control variable of the algorithm is the clearness of the acquired image. Various indexes of clearness have been studied to implement the algorithm. Among these, two indexes have been selected, based on the absolute and on the squared values of the image derivatives respectively [2].
The black curve in figure 2 is the image clearness within the focal length range. The blue and the green areas represent the range in which the algorithm performs a coarse search and a fine search respectively. The red dots correspond to the values of clearness at different focal lengths, at each iteration of the algorithm. As a first step, a coarse search of the best focus position is carried out by varying the focal length from point (1) to subsequent points, until the green region is reached: in the figure, this process is performed in two steps, from point (1) to point (3). Then, the fine search is carried out: here, small increments of the focal length are considered, and the corresponding values of clearness are computed. A suitable threshold based algorithm is used to evaluate both the sign and the entity of the corresponding variations, and to choose the correct convergence direction. In the figure, this process is schematically represented by the path from point (3) to point (5), which corresponds to the best focus position.
![](https://mmtlab.unibs.it/wp-content/uploads/2016/08/Figure2-1024x728.png)
The algorithm shows good performances in terms of speed of execution and accuracy and exhibits good results in real macro applications such as fingerprints, retinal and melanomas analysis. The algorithm has a good focus stability also with hand-held systems.
Related Publications
Pasinetti, S.; Bodini, I.; Sansoni, G.; Docchio, F.; Tinelli, M.; Lancini, M. “A fast autofocus setup using a liquid lens objective for in-focus imaging in the macro range“, AIP Conference Proceedings, Vol. 1740. 2016
Pasinetti, S.; Bodini, I.; Lancini, M.; Docchio, F.; Sansoni, G. “A Depth From Defocus Measurement System Using a Liquid Lens Objective for Extended Depth Range“, IEEE Transactions on Instrumentation and Measurement, Vol. 66, no. 3, pp. 441-450. 2017
Pasinetti, S.; Bodini, I.; Lancini, M.; Docchio, F.; Sansoni, G. “Experimental characterization of an autofocus algorithm based on liquid lens objective for in-focus imaging in the macro range“, 2017 7th IEEE International Workshop on Advances in Sensors and Interfaces (IWASI), pp. 195-200. 2017
Pasinetti, S.; Bodini, I.; Lancini, M.; Docchio, F.; Sansoni, G. “Automatic selection of focal lengths in a Depth From Defocus measurement system based on liquid lenses“, Optics and Lasers in Engineering, Vol. 96, pp. 68-74. 2017