uEye Camera Manual Version 4.92
This tab sets the focus for uEye cameras with active focus (AF).
![]() |
The control of the single autofocus is only possible in the live image and not in snapshot mode. The autofocus control is contrast-based. All image settings that minimize contrast therefore have a negative effect on the autofocus control. |
When the "Focus" tab is open, an AOI is displayed in the live image of the uEye Cockpit which defines the autofocus measure window.
•Autofocus control can only be used in DIB mode.
•You can move, enlarge or reduce this measure window with the mouse.
•If you change the AOI, the measure window is reset to its default settings. Therefore, first set an AOI and then move the measure window.
•If you select an AOI for the camera image that is smaller than the smallest possible measure window, the measure window cannot be displayed.
•If you mirror the image, the measure window is not mirrored and remains in its previous position.

Fig. 142: uEye Properties - Focus
Depending on the lens, the following setting can be controlled via the slider:
Focus
•Focus setting
oValue = 0: Lens is unfocused.
oSmall values: Lens focuses to infinity.
oLarge values: Lens focuses on near range.
•Autofocus
Enables/disables automatic focus.
•Run once
The control is automatically stopped as soon as a maximum sharpness value has been found or if no sharpness value has been found after a certain number of iterations.
•Show measured values
Opens a separate window in which the pairs of focus/sharpness measured values are displayed. For the calculation of the sharpness values, only image data within the measure window is used.

Fig. 143: Measured values for autofocus
Advanced settings (Autofocus)
•Sharpness calculation
Select the algorithm for the sharpness calculation.
oTenengrad
Sobel factors in x- and y-direction and summation of the euclidean distances.
oMean Score
Summation of the difference between two mean values from two pixel values each in x- and y-direction.
oHistogram Variance
Standard deviation of the gray values in the histogram of the mean value.
•Peak search algorithm
Select the algorithm for the maximum value search.
oGolden Ratio Search
Within the preset interval range, the focus function repeatedly divides into new intervals using the Golden Ratio. The interval range is decreased with each new calculation. This process is continued until the interval range is less than or equal to the set hysteresis.
oHill Climbing Search
Within the preset interval range, the focus function scans the register values for a maximum with medium step width until two falling sharpness values occur at the last two steps. Based on these values and the step width, the interval range and step width are reduced and the scan is repeated within this interval. This process is continued until the interval range is less than or equal to the set hysteresis.
oGlobal Search
Within the preset interval range, the focus function completely scans with medium step width and the maximum that occurred is memorized. Based on the maximum, the interval range and the step width, the interval range and the step width are reduced and the scan is repeated within this interval. This process is continued until the interval range is less than or equal to the set hysteresis.
oFull Scan
Within the preset interval range, the focus function scans with a constant step width for an optimal result (step width: hysteresis).
Focus search range
The focus search range affects whether and where a maximum value is found.
•Limit min.
Sets the minimum limit of the focus search range for the peak search algorithm.
•Limit max.
Sets the maximum limit of the focus search range for the peak search algorithm.
•Hysteresis
Defines the size of the interval range after which the peak search algorithm terminates the search.
Suggestion for improvement? Send us your short
Feedback on this chapter.
Thank you very much!
For technical questions please contact your local distributor or use the support form on our website.