Method for auto focus error calibration implementation
By installing a camera and VCM motor on the top of the device, combined with laser/ultrasonic ranging and MATLAB fitting curves, the problems of slow speed and insufficient accuracy in autofocus technology are solved, achieving fast and accurate focus calibration, adapting to image differences of different devices, and improving the device's compactness and focusing accuracy.
Patent Information
- Application Number
- CN202210291995.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-23
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-03-23
AI Technical Summary
Existing autofocus technology suffers from problems such as slow speed, insufficient accuracy, and bulky equipment. In particular, in VCM autofocus modules, subjective judgment of lens focus sharpness and lens tolerances lead to unclear images.
By mounting a camera on top of the device, using a VCM motor and laser/ultrasonic ranging, and combining MATLAB fitting curves, the lens's focus steps are calibrated, achieving fast and accurate focus calibration.
It achieves fast and accurate focusing, reduces image blurring, is lightweight and portable, adapts to image differences of different devices, and improves focusing accuracy and speed.
Smart Images

Figure CN114727095B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autofocus technology, and more specifically to a method for autofocus error calibration. Background Technology
[0002] With the development of science and technology, people's demands for product experience are constantly increasing. Devices need to be fast and accurate within their operating range, requiring them to quickly and accurately obtain clear images. One method is lens depth-of-field stacking, which can increase the operating range, but the structure is large and the device is bulky, failing to meet the integration and miniaturization requirements of existing devices. Another method is using optical zoom lenses. While this method can produce clear images within the operating range, its relatively large size and slow focusing speed make it difficult to meet the requirements for fast focusing.
[0003] The VCM (Voice Coil Motor) autofocus process involves a motor driving the lens to obtain images at different back focus positions. When the lens is at a certain distance, these images at different back focus positions are transmitted to the Image Processor (ISP) for processing. The ISP then generates statistical information about the image and sends this information to an image algorithm library. An image comparison algorithm identifies the sharp image, and finally, the motor drives the lens to the position of the sharp image, indicating successful focusing. This method is relatively slow. It places higher demands on the operator's cooperation, ensuring that the person capturing the image remains stationary. If the person moves, the focus position will change, resulting in a blurry image. This undoubtedly places higher demands on the operator. Iris recognition, for example, requires autofocus algorithms to achieve fast and accurate focusing. Another VCM autofocus method uses distance measurement as an aid. The camera emits infrared light, ultrasonic waves, or lasers and receives the reflected light to calculate the object distance. Focusing is then achieved based on this distance. This method is slightly less accurate.
[0004] To address the technical problem of image blurring caused by subjective judgment of lens focus sharpness, lens tolerance, and test reading errors during equipment calibration of VCM autofocus modules, this invention provides an autofocus error calibration method. Summary of the Invention
[0005] The purpose of this invention is to provide an automatic focus error calibration method to solve the technical problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention specifically adopts the following technical solution:
[0007] The method for implementing autofocus error calibration includes the following steps:
[0008] S1. Install a camera on the top of the original equipment and develop a suitable standard test chart based on the camera module's pixels, field of view, and operating distance.
[0009] S2. Select a VCM motor with an appropriate stroke based on the original equipment usage distance;
[0010] S3. Within the test range, different object distances and the number of focusing steps required to obtain a clear image at those object distances;
[0011] S4. Perform curve fitting on the object distance and focus steps in S3 to obtain the original fitted curves for object distance and focus steps;
[0012] S5. Load the fitted curve obtained in S4 into the device to achieve VCM coarse focusing;
[0013] S6. Measure the distance L between the person and the lens using laser / ultrasound, and record the number of focusing steps corresponding to obtaining a clear image when the distance between the person and the lens is L as A1. Drive the VCM motor to the number of focusing steps A1 corresponding to the distance L.
[0014] S7. Set the distance between the device to be calibrated and the person to be L, and denote the number of focusing steps required to obtain a clear image when the distance between the person and the lens is L as A2.
[0015] S8. Calculate the difference a between the number of focusing steps A2 when the distance between the device to be calibrated and the person is L and the number of focusing steps A1 when the distance between the original device and the person is L;
[0016] S9. Shift the original fitting curve obtained in S4 by 'a' to obtain the fitting curve of the device to be calibrated, thereby achieving the calibration of the device to be calibrated.
[0017] Furthermore, the camera in S1 mainly consists of a sensor, a voice coil motor, and a lens.
[0018] Furthermore, the specific method for selecting a suitable VCM stroke in S2 is as follows: within the usage distance, the back focal length change of the selected lens should be less than or equal to the stroke of the VCM motor.
[0019] Furthermore, the tool used for curve fitting in S4 is MATLAB, specifically curve fitting in MATLAB.
[0020] The beneficial effects of this invention are as follows: This invention employs a VCM autofocus calibration scheme that enables accurate and rapid focusing. Calibration is performed directly on the device, compensating for the influence of factors such as distance measurement, subjective judgment of lens focus sharpness, and lens tolerances. Each device has a matching, highly accurate curve, allowing for fast and accurate focusing and obtaining clear images. This reduces or avoids difficulties and misidentifications in iris recognition, while also reducing device size, making it lightweight and portable. Attached Figure Description
[0021] Figure 1 This is a diagram showing the installation positions of the device and camera in this invention.
[0022] Figure 2 The focus curves for this invention are obtained by fitting test data using MATLAB.
[0023] Figure 3 The focus curve is adjusted for fitting curves of different devices in this invention;
[0024] Figure 4 This is a flowchart illustrating the calibration process for different devices according to the present invention;
[0025] Attached image labels: 01-Camera, 02-Device. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0027] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0028] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0029] In the description of the embodiments of the present invention, it should be noted that the terms "inner", "outer", "upper", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of the invention is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting the present invention.
[0030] Example 1
[0031] like Figure 1-4 As shown, the method for implementing autofocus error calibration includes the following steps:
[0032] S1. Install a camera on the top of the original equipment and develop a suitable standard test chart based on the camera module's pixels, field of view, and operating distance.
[0033] S2. Select a VCM motor with an appropriate stroke based on the original equipment usage distance, specifically by selecting based on the curve formed between the object distance and the number of steps;
[0034] S3. Within the test range, different object distances and the number of focusing steps required to obtain a clear image at those object distances;
[0035] S4. Perform curve fitting on the object distance and focus steps in S3 to obtain the original fitted curves for object distance and focus steps;
[0036] S5. Load the fitted curve obtained in S4 into the device to achieve VCM coarse focusing;
[0037] S6. Measure the distance L between the person and the lens using laser / ultrasound, and record the number of focusing steps corresponding to obtaining a clear image when the distance between the person and the lens is L as A1. Drive the VCM motor to the number of focusing steps A1 corresponding to the distance L.
[0038] S7. Set the distance between the device to be calibrated and the person to be L, and denote the number of focusing steps required to obtain a clear image when the distance between the person and the lens is L as A2.
[0039] S8. Calculate the difference a between the number of focusing steps A2 when the distance between the device to be calibrated and the person is L and the number of focusing steps A1 when the distance between the original device and the person is L;
[0040] S9. Shift the original fitting curve obtained in S4 by 'a' to obtain the fitting curve of the device to be calibrated, thereby achieving the calibration of the device to be calibrated.
[0041] Furthermore, the camera in S1 mainly consists of a sensor, a voice coil motor, and a lens.
[0042] Furthermore, the specific method for selecting a suitable VCM stroke in S2 is as follows: within the usage distance, the back focal length change of the selected lens should be less than or equal to the stroke of the VCM motor.
[0043] Furthermore, the tool used for curve fitting in S4 is MATLAB, specifically curve fitting in MATLAB.
[0044] The working process of this invention is mainly divided into two parts: First, coarse focusing of VCM is achieved, including fitting the object distance and focusing steps to obtain a fitting curve, and using the fitting curve to achieve coarse focusing of VCM; Second, the differences between images from different devices are addressed, including the original device distance L corresponding to the focusing steps A1, the device distance L to be calibrated corresponding to the focusing steps A2, and the difference between A2 and A1 is used to calibrate the fitting curve of the device to be calibrated, thereby achieving the calibration of differences between images from different devices.
[0045] Specifically, the following steps are taken: Based on the device's operating distance, lens focal length, and sensor pixel size parameters, the iris diameter value is calculated using the object-image relationship. The purpose of this calculation is to ensure that the iris diameter value meets the iris recognition standard and that sufficient iris information is available. The object-image relationship is: xx' = ff', where x is the object distance, x' is the image distance, f is the object focal length, and f' is the image focal length. A VCM camera module capable of acquiring clear iris images within the operating distance is selected. Within the operating distance range, the number of focusing steps corresponding to clear images at different object distances between the lens and the chart paper is tested. Sufficient sampling points are selected during the acquisition process to ensure the accuracy of the test curve. The test data is fitted using MATLAB to obtain the fitted curve. The driving algorithm encodes and loads the fitted curve into the device to achieve coarse focusing of the VCM. During use, the device uses high-precision laser / ultrasonic ranging to measure the distance between the person and the lens, and returns the measured distance. The distance drives the VCM motor to the corresponding number of focusing steps. Based on the product's accuracy requirements, a fine-tuning algorithm is applied at this distance. That is, after the algorithm's coarse focusing is completed, the number of focusing steps is changed to continue capturing images in the vicinity. The captured images go from blurry to clear and then back to blurry, until the clearest image is found, resulting in a clearer image. Due to module lens tolerances, subjective judgment of the focus point's sharpness, and test reading errors, there are differences in images from different devices. The device captures a clear image at a fixed distance L and records the number of focusing steps A2 at this distance. The original number of focusing steps at the original curve distance L is A1. The difference between the device's focusing steps A2 and the original focusing steps A1 is 'a'. The device's curve is shifted by 'a' from its original position, causing the focusing curve to shift up and down. This allows the device to focus quickly and clearly, resulting in a clear image. This method can eliminate the differences in focusing curves between devices, thus achieving the goal of fast and clear focusing.
[0046] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative and not exhaustive. All modifications within the scope of this invention or its equivalents are included in this invention.
Claims
1. A method for calibrating autofocus error, characterized in that, Includes the following steps: S1. Install a camera on the top of the original equipment and develop a suitable standard test chart based on the camera module's pixels, field of view, and operating distance. S2. Select a VCM motor with an appropriate stroke based on the original equipment usage distance; S3. Within the test range, different object distances and the number of focusing steps required to obtain a clear image at those object distances; S4. Perform curve fitting on the object distance and focus steps in S3 to obtain the original fitted curves for object distance and focus steps; S5. Load the fitted curve obtained in S4 into the device to achieve VCM coarse focusing; S6. Measure the distance L between the person and the lens using laser / ultrasound, and record the number of focusing steps corresponding to obtaining a clear image when the distance between the person and the lens is L as A1. Drive the VCM motor to the number of focusing steps A1 corresponding to the distance L. S7. Set the distance between the device to be calibrated and the person to be L, and denote the number of focusing steps required to obtain a clear image when the distance between the person and the lens is L as A2. S8. Calculate the difference a between the number of focusing steps A2 when the distance between the device to be calibrated and the person is L and the number of focusing steps A1 when the distance between the original device and the person is L; S9. Shift the original fitting curve obtained in S4 by 'a' to obtain the fitting curve of the device to be calibrated, thereby achieving the calibration of the device to be calibrated. The camera in S1 mainly consists of a sensor, a voice coil motor, and a lens; The specific method for selecting a suitable VCM stroke in S2 is as follows: within the usage distance, the back focal change of the selected lens should be less than or equal to the stroke of the VCM motor. The tool used for curve fitting in S4 is MATLAB, specifically curvefitting in MATLAB. The curve movement in S9 refers to the curve moving up and down.
Citation Information
Patent Citations
Focusing mehtod of image picking-up method
CN1831625A