Fig. 4.
The golden section search algorithm for automatic focus tuning. and are the two initial boundaries of the search region. Two extra intensities () at the golden ratio distance from the initial boundaries are then calculated based on the intensities at the two boundaries. The search region is narrowed down by comparing and . The boundaries of the search region are updated according to the values at and . The values of and are then the replaced by the values of and accordingly. This process is repeated until the difference between and is smaller than a pre-defined threshold.