How does an auto-focus work?

Sharp images at the touch of a button – even in industrial image processing

Whether in the camera of a smartphone, a microscope or an industrial vision system – auto-focus ensures that the image is automatically focused. But how exactly does this work? And which technologies are used in industrial image processing?

The picture shows a Smart Camera with integrated illumination from three perspectives.
Smart cameras with auto-focus ensure sharp images by automatically adjusting their focus to selected areas of the image, even at changing distances.

What does the auto-focus do?

An auto-focus system automatically adjusts the focus of an optics to the desired image area. The aim is to always produce a sharp, high-contrast image with different object distances or movements.

This is particularly important in industrial image processing, where different object sizes, changing working heights or dynamic production conditions often occur.
Instead of manually readjusting the optics, auto-focus systems perform this task fully automatically – quickly, precisely and reproducibly.

Principle of image-based contrast measurement

Most auto-focus systems, both in classic photography and in industrial cameras, are based on contrast measurement in the image. The system searches for the lens position at which the image contrast is at its maximum – i.e. where the edges in the image appear sharpest.

This process takes place in real time:

  1. The camera takes a picture.
  2. The internal algorithm measures the image contrast.
  3. The lens is moved step by step until the highest contrast is reached.

The system automatically finds the optimum focal plane – without external sensors or manual intervention.

Auto-focus in industrial image processing

Two auto-focus methods have become established in industrial practice:

  • Mechanical lens focusing
  • Liquid lens technology

Both approaches are image-based, but differ in terms of structure, response time, service life and precision.

Mechanical lens focusing

With mechanical focusing, the position of the lens is physically changed in order to adjust the focus. This is done using motors or actuators that move the lenses along the optical axis.

This method offers high precision and stability – ideal for applications where repetition accuracy and exact focus positions are crucial.

  • Stepper motor (STM)
    Stepper motors move lens elements in defined, uniform steps. This allows the focal plane to be set precisely and reproducibly.
    STMs are used in industrial vision systems when constant and repeatable focus settings are required – for example for measurement or inspection tasks with defined working distances.
  • Voice coil motor (VCM)
    VCMs work with electromagnetic force. When a current is applied, a coil moves in a magnetic field and displaces the lens.
    This technology is known from smartphone cameras, but is also used in industrial systems.
    Advantages: fast response times, long service life and reliability – even under harsh ambient conditions.
  • Ultrasonic motor (USM) / piezo drive
    USMs use ultrasonic vibrations generated by piezoelectric elements. The vibrations generate microscopic movements that move the lens precisely.
    This technology combines high speed, energy efficiency and smooth running – ideal for applications with fast focusing cycles or sensitive environments.

Liquid lens (LEM – Liquid Electromechanical Lens)

Liquid lens technology is a modern and wear-free principle. Here, no lens is moved mechanically – instead, a liquid inside the lens changes its surface curvature and thus the focal length.

This is achieved by applying an electrical voltage that changes the contact angle of the liquid to an elastic membrane. This physical phenomenon is known as electrowetting.

Advantages of liquid lens technology:

  • Extremely fast focusing (in milliseconds)
  • No moving mechanical parts → Long service life
  • Compact design → ideal for small sensors and cameras
  • High flexibility with changing working distances

Please note:

Liquid lenses require electronic control and temperature compensation to keep the focus position stable. In addition, a warm-up time of approx. 5 minutes may be required before full performance is achieved.

Conclusion

Auto-focus is a central element of modern image processing systems.
While mechanical lens focusing systems impress with their precision and stability, liquid lenses offer a fast, wear-free and compact solution for dynamic applications.

In combination with powerful Image Processing Software, both technologies enable flexible, automated and high-precision focusing – a decisive advantage for modern industrial vision systems such as the Smart Cameras and Vision Sensors from wenglor.

Author

Picture of Max Mustermann

Max Mustermann

Job title