How to achieve enhanced autofocus performance? Sinoseen high-quality cameras
From barcode scanning to self-service terminal interfaces and sophisticated industrial robots, autofocus cameras have become an indispensable tool in a wide range of industries. The autofocus function allows for clear focus by adjusting the lens to improve the reliability and efficiency of visual data capture, and how to improve the performance of autofocus cameras has become the focus of the moment.
What is autofocus?
Autofocus is a camera feature that quickly adapts to changes in distance between the camera and the subject by dynamically changing the position of the lens to obtain the sharpest image possible. The autofocus system consists of a lens brake, an image signal processor (ISP), and the 3A function, which is a collective term for autofocus, auto exposure, and auto white balance, which work in tandem to ensure optimal image quality.We have seen the information about autofocus before, interested in the next article.
Challenges of the autofocus mechanism
Autofocus cameras are designed with a default focus range of typically 10 cm to infinity and average focus accuracy. It is still somewhat inadequate in some specific applications, for example:
- In situations where the object size is significantly smaller than the autofocus region of interest (ROI), the default autofocus accuracy may not be sufficient.
- Some applications that require a fixed working distance do not benefit from the full range focus feature. When objects cover most of the ROI, higher AF accuracy and faster stabilization times are required.
- The speed at which the autofocus system locks onto the correct focus point is important for the need for fast response times.
How can autofocus accuracy be improved?
The Image Signal Processor (ISP) plays a key role in the AF mechanism. And Sinoseen has a number of options for improving the focusing accuracy of AF cameras, which involve fine-tuning the ISP settings.
1. Using Two-Pass method in ISP
Traditional method: General Sinoseen AF cameras support single scanning for the full AF range (10cm to infinity) by default. This AF algorithm scans from infinity to the macro position, and can be customized with targeted settings in the ISP settings.The AF algorithm uses hill-climbing to find the sharpest image for each frame while moving the lens brake.The ISP calculates the average of the edges of each frame and obtains the relative sharpness for each lens position. Once the highest focus is achieved, the lens position stabilizes and the ISP returns to the AF Success state. This may lack precision.
Two-Pass Method: Using the two-pass method increases the number of scans performed by the ISP. An initial scan is performed to determine the optimal focus position and then a second detailed scan is performed around that position, significantly improving focus accuracy.
2. Narrowing the AF Scanning Range
In scenarios where the working distance is determined, such as barcode scanning or vending kiosks, the AF range can be narrowed to scan only this range, improving accuracy. For example, if an object is fixed within 1m to 1.5m, by default, the AF camera focuses between 100-120. However, it is possible to remap this range to 255 steps instead of the usual 0-255 steps via the ISP settings. to improve AF accuracy.
Generally, the scanning range is determined by the working distance, which is convenient for ISP to scan the same area with higher accuracy.
3. Increase the scanning slot value
The number of equidistant steps (slots) in the AF range is directly related to the focusing accuracy. Increasing the slot value allows for more detailed scanning of the focus range, resulting in finer adjustments and improved accuracy. This is particularly effective in the two-pass scanning method.
4. Improving AF stabilization time by increasing AF speed
The time it takes for the ISP to detect optimal sharpness while moving the lens position is called the search time. Modifying the ISP settings with a customized SInoseen camera module can effectively reduce the search time.
Ways to improve search time include:
- modifying the slot value
- modifying the actuator speed lookup table (LUT)
Modifying the Slot Value
The slot value determines the number of steps required for the lens to adjust focus and directly affects the speed and accuracy of autofocus. Increasing the slot value allows the lens to make fewer and larger adjustments, resulting in faster focus acquisition, but may reduce accuracy. Conversely, decreasing the slot value slows down autofocus, but can improve accuracy by making finer adjustments.
Modifying the Actuator Speed Look-Up Table (LUT)
The LUT acts as a bridge between the ISP and the lens actuator, translating focus commands into physical movement. By adjusting the LUT, the number of steps required to move the lens to the desired focus point can be reduced, thereby reducing stabilization time. However, tradeoffs with autofocus accuracy need to be considered.
5. ROI-Based Focusing for Increased Speed
Focusing on specific areas of the image rather than the entire frame can significantly speed up the autofocus process. By prioritizing the area of interest, the camera can quickly adjust for changes within that area, which is particularly useful in applications such as face detection.
Conclusion
From what we have learned in this article, it is clear that the most effective ways to improve autofocus stabilization times typically involve a combination of techniques, including slot adjustment, LUT modification, and ROI-based focusing. Continuously testing and refining these settings is important to achieve a balance between speed and accuracy for a given application.
Of course, if you have any questions about how to achieve enhanced autofocus performance, please feel free to contact us, as Sinoseen has more than a decade of experience in embedded vision applications and is confident that we will be able to provide you with a satisfactory answer.