Automatic focusing method, device and computer storage medium based on liquid lens

By prestoring the voltage value of the focus on the atomized plate during the calibration phase and finding the clear voltage range based on the dichotomy method during the autofocusing process, the problem of automatic focus failure caused by interference from the atomized plate is solved, and the reliability of automatic focus is improved.

CN119767141APending Publication Date: 2025-04-04SUZHOU SHIYIN INTELLIGENT SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411919467.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The automatic focus method based on liquid lens in the prior art can easily lead to automatic focus failure under interference of the atomized plate, and cannot effectively handle interference items.

Method used

By prestoring the voltage value of the focus on the atomized plate during the calibration phase, during the automatic focusing process, the voltage range that makes the image clear is found based on the dichotomy method, and when the focus is successful, the voltage search range is adjusted to the far-field voltage search range to eliminate interference from the atomized plate.

Benefits of technology

It improves the reliability during automatic focus, effectively eliminates the interference of the atomized plate on the focus process, and ensures the success rate of automatic focus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119767141A_ABST
    Figure CN119767141A_ABST
Patent Text Reader

Abstract

The present invention provides an automatic focusing method and device based on a liquid lens and a computer storage medium. In the automatic focusing method, a voltage value focused on an atomizing plate is pre-stored in a calibration stage. During the automatic focusing process, an image is collected and the image clarity is calculated. Automatic focusing is performed according to the image clarity. Within a corresponding voltage search range, a voltage range that makes the image clear and a corresponding voltage range span are found based on a binary search method. When the voltage value when focusing is successful is equal to the voltage value focused on the atomizing plate, the voltage search range is adjusted to a far-field voltage search range, and automatic focusing is performed based on a binary search method, thereby eliminating interference caused by the atomizing plate on the focusing process and improving the reliability of automatic focusing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automatic focusing technology, and in particular to an automatic focusing method and device based on a liquid lens and a computer storage medium. Background Art

[0002] Liquid lens technology is currently used in many barcode reading devices. This technology adjusts the voltage applied to the liquid lens to cause the liquid lens to deform to varying degrees, changing the distance between the lens and the imaging surface, thereby obtaining a clear image and achieving automatic focusing.

[0003] At present, in the focusing process of the barcode reading device based on the liquid lens, it is necessary to automatically focus by finding the voltage at the best clarity, and determine whether the focus is successful by judging the clarity of the collected image. However, this focusing method cannot effectively deal with interference items. For example, in the application of wafer ID barcode reading equipment, it is necessary to set a fog plate in front of the liquid lens to reduce halo and stray light and improve the clarity of imaging. When the object to be measured is in the near field of view area, the image clarity of the object to be measured in the area near the fog plate is greater than the image clarity when focusing on the fog plate, and the automatic focusing can be successfully and correctly performed. However, when the object to be measured is in the far field of view area, due to the non-completely transparent imaging characteristics of the fog plate, the clarity of the image in the area near the fog plate is less than the clarity of the image of the fog plate, which will form an interference item. When the liquid lens automatically focuses, it may mistakenly focus on the fog plate, causing the failure of the automatic focusing process. Summary of the invention

[0004] One purpose of the present invention is to solve the problem of automatic focusing failure caused by interference from atomizing plates in the automatic focusing process in the prior art, and to propose an automatic focusing method based on a liquid lens to improve the reliability of automatic focusing.

[0005] The second purpose of the present invention is to solve the problem of failure of automatic focusing due to interference of atomizing plate in the automatic focusing process in the prior art, and to propose a code reading device.

[0006] The third object of the present invention is to solve the problem of failure of automatic focusing due to interference of atomizing plate in the automatic focusing process in the prior art, and to propose a computer-readable storage medium.

[0007] To achieve the above object, the present invention adopts the following technical solutions: According to a first aspect of the present invention, there is provided an automatic focusing method based on a liquid lens, the automatic focusing method based on a liquid lens comprising: Step S1: setting the focusing voltage range and the voltage search range; Step S2: updating the voltage value applied to the liquid lens; Step S3: collecting an image, calculating the image clarity, and automatically adjusting the focus according to the image clarity, and finding the voltage range that makes the image clear and the corresponding voltage range span based on the binary search method within the corresponding voltage search range; Step S4: determine whether the voltage range span found is smaller than the preset voltage span, if yes, execute step S5, if no, return to step S2; Step S5: Determine whether the current voltage value when focusing is successful is equal to the preset voltage value for focusing on the atomizer plate. If so, execute step S6; if not, execute step S7; Step S6: updating the voltage search range to the far-view voltage search range, and then returning to step S1; Step S7: The automatic focusing process ends.

[0008] Preferably, in step S1, the initial voltage search range is [0, 800V].

[0009] Preferably, in step S4, the preset voltage span is 10V.

[0010] Preferably, in step S5, the preset voltage value focused on the atomizer plate is obtained by the following method: in the calibration stage, automatic focusing is run to make the liquid lens focus on the atomizer plate. At this time, the voltage value applied to the liquid lens is the voltage value focused on the atomizer plate, and the voltage value is recorded and stored.

[0011] Preferably, step S5 comprises: Step S5-1: Determine whether the current stage is in the calibration stage, if so, execute step S5-2; if not, execute step S5-3; Step S5-2: storing the current voltage value as a preset voltage value focused on the atomizer plate, and then executing step S7; Step S5-3: Determine whether the current voltage value when focusing is successful is equal to the preset voltage value for focusing on the atomizer plate. If so, execute step S6; if not, execute step S7.

[0012] Preferably, the preset voltage value focused on the atomizer plate is 500V; the long-view voltage search range in step S6 is [0, 500V).

[0013] According to a second aspect of the present invention, there is provided a code reading device, comprising an image sensor, a liquid lens, an atomizing plate, a voltage driving module and a control module, wherein the image sensor, the liquid lens and the atomizing plate are sequentially arranged along an optical axis direction; the voltage driving module is electrically connected to the liquid lens, and the voltage driving module is used to apply a voltage to the liquid lens so that the liquid lens generates a corresponding deformation, thereby adjusting the focal length of the liquid lens; the control module is electrically connected to the image sensor and the voltage driving module respectively, and the control module is used to control the working states of the image sensor and the voltage driving module according to the automatic focusing method based on the liquid lens as described above.

[0014] According to a third aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the automatic focusing method based on a liquid lens as described above is implemented.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention pre-stores the voltage value focused on the atomizer plate during the calibration stage, and during the automatic focusing process, automatic focusing is performed according to the image clarity, and within the corresponding voltage search range, the voltage range that makes the image clear and the corresponding voltage range span are found based on the binary search method; when the voltage value when the focus is successful is equal to the voltage value focused on the atomizer plate, the voltage search range is adjusted to the far-field voltage search range, and then automatic focusing is performed based on the binary search method, thereby eliminating the interference of the atomizer plate on the focusing process and improving the reliability of automatic focusing. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 The figure is a flow chart of an automatic focusing method based on a liquid lens according to some embodiments of the present invention.

[0017] Figure 2 Flowcharts of automatic focusing methods based on liquid lenses according to other embodiments of the present invention.

[0018] Figure 3 Schematic diagram of the structure of a code reading device according to some embodiments of the present invention.

[0019] In the figure, 10 is an image sensor, 20 is a liquid lens, 30 is an atomizer plate, 40 is a voltage driving module, and 50 is a control module. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention. It can be understood that some technical means of the various embodiments described herein can be replaced or combined with each other without conflict.

[0021] In the description of the present invention, if there are terms such as "first", "second", etc., they are only used to distinguish the objects described, and do not have any order or technical meaning. Therefore, the objects defined as "first", "second", etc. may explicitly or implicitly include one or more of the objects. In addition, "one" or "a" and similar words do not indicate a quantity limitation, but indicate the existence of at least one, and "multiple" means not less than two.

[0022] In the description of the present specification, reference to "one embodiment" or "some embodiments" etc. means that one or more embodiments of the present invention include a specific feature, structure or characteristic described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0023] According to a first aspect of the present invention, an automatic focusing method based on a liquid lens is provided to solve the problem of automatic focusing failure caused by interference from atomizing plates in the automatic focusing process, thereby improving the reliability of automatic focusing.

[0024] Reference Figure 1 In some embodiments, the automatic focusing method based on the liquid lens includes: Step S1: Setting the focusing voltage range and the voltage search range.

[0025] Step S2: updating the voltage value applied to the liquid lens.

[0026] Step S3: Capture an image, calculate the image clarity, and automatically adjust the focus according to the image clarity, and within the corresponding voltage search range, find the voltage range that makes the image clear and the corresponding voltage range span based on the dichotomy method. The voltage range span is the maximum voltage value of the voltage range minus the minimum voltage value.

[0027] Step S4: Determine whether the voltage range span found is smaller than the preset voltage span, if so, execute step S5, if not, return to step S2.

[0028] Step S5: Determine whether the current voltage value when focusing is successful is equal to the preset voltage value for focusing on the atomizer plate. If so, execute step S6; if not, execute step S7.

[0029] Step S6: Update the voltage search range to the far-view voltage search range, and then return to step S1.

[0030] Step S7: The automatic focusing process ends.

[0031] In the automatic focusing method of the present invention, the voltage value focused on the atomizing plate is pre-stored in the calibration stage, and in the automatic focusing process, automatic focusing is performed according to the image clarity, and within the corresponding voltage search range, the voltage range that makes the image clear and the corresponding voltage range span are found based on the binary search method; when the voltage value when the focus is successful is equal to the voltage value focused on the atomizing plate, the voltage search range is adjusted to the far-field voltage search range, and then automatic focusing is performed based on the binary search method, thereby eliminating the interference of the atomizing plate on the focusing process and improving the reliability of automatic focusing.

[0032] It should be noted that, in step S1, the initial focus voltage range and the initial voltage search range can be reasonably set according to actual conditions. For example, in some embodiments, the initial voltage search range is set to [0, 800V].

[0033] In step S4, the preset voltage span can be reasonably set according to actual conditions. For example, in some embodiments, the preset voltage span is 10V.

[0034] In step S5, the preset voltage value focused on the atomizer plate can be obtained by the following method: in the calibration stage, run the automatic focus to make the liquid lens focus on the atomizer plate, obtain a clear image corresponding to the atomizer plate, and the voltage value applied to the liquid lens at this time is the voltage value focused on the atomizer plate, and record and store the voltage value. In some embodiments, the preset voltage value focused on the atomizer plate is 500V.

[0035] In step S6, the far-field voltage search range can be determined according to the preset voltage value focused on the atomizer plate. The preset voltage value focused on the atomizer plate is X, and the far-field voltage search range is [0, X]. In some embodiments, the initial voltage search range is set to [0, 800V], and the preset voltage value focused on the atomizer plate is 500V; then the far-field voltage search range in step S6 is [0, 500V). In this way, the interference caused by the atomizer plate to the focusing process can be eliminated, and the reliability of automatic focusing can be improved.

[0036] In some other embodiments, step S5 includes: Step S5-1: Determine whether the current stage is in the calibration stage. If so, execute step S5-2; if not, execute step S5-3.

[0037] Step S5-2: store the current voltage value as the preset voltage value focused on the atomizer plate, and then execute step S7.

[0038] Step S5-3: Determine whether the current voltage value when focusing is successful is equal to the preset voltage value for focusing on the atomizer plate. If so, execute step S6; if not, execute step S7.

[0039] Corresponding, refer to Figure 2 In some other embodiments, the automatic focusing method based on the liquid lens includes: Step S1: Setting the focusing voltage range and the voltage search range.

[0040] Step S2: updating the voltage value applied to the liquid lens.

[0041] Step S3: Capture an image, calculate the image clarity, and automatically adjust the focus according to the image clarity. In the corresponding voltage search range, find the voltage range that makes the image clear and the corresponding voltage range span based on the binary search method.

[0042] Step S4: Determine whether the voltage range span found is smaller than the preset voltage span, if so, execute step S5-1, if not, return to step S2.

[0043] Step S5: Step S5-1: Determine whether the current stage is in the calibration stage, if so, execute step S5-2; if not, execute step S5-3.

[0044] Step S5-2: store the current voltage value as the preset voltage value focused on the atomizer plate, and then execute step S7.

[0045] Step S5-3: Determine whether the current voltage value when focusing is successful is equal to the preset voltage value for focusing on the atomizer plate. If so, execute step S6; if not, execute step S7.

[0046] Step S6: Update the voltage search range to the far-view voltage search range, and then return to step S1.

[0047] Step S7: The automatic focusing process ends.

[0048] According to a second aspect of the present invention, there is provided a code reading device, referring to Figure 3The code reading device includes an image sensor 10, a liquid lens 20, an atomizing plate 30, a voltage driving module 40 and a control module 50. The image sensor 10, the liquid lens 20 and the atomizing plate 30 are arranged in sequence along the optical axis direction; the voltage driving module 40 is electrically connected to the liquid lens 20, and the voltage driving module 40 is used to apply a voltage to the liquid lens 20 so that the liquid lens 20 produces a corresponding deformation, thereby adjusting the focal length of the liquid lens 20; the control module 50 is electrically connected to the image sensor 10 and the voltage driving module 40 respectively, and the control module 50 is used to execute corresponding steps according to the automatic focusing method based on the liquid lens as described above, and control the working states of the image sensor 10 and the voltage driving module 40.

[0049] According to a third aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the automatic focusing method based on a liquid lens as described above is implemented.

[0050] In summary, the present invention provides an automatic focusing method based on a liquid lens, a code reading device and a computer-readable storage medium. In the calibration stage, the voltage value focused on the atomizing plate is pre-stored. In the automatic focusing process, automatic focusing is performed according to the image clarity. Within the corresponding voltage search range, the voltage range that makes the image clear and the corresponding voltage range span are found based on the binary search method. When the voltage value when the focus is successful is equal to the voltage value focused on the atomizing plate, the voltage search range is adjusted to the far-field voltage search range, and then automatic focusing is performed based on the binary search method, thereby eliminating the interference of the atomizing plate on the focusing process and improving the reliability of automatic focusing.

[0051] The present invention has been described by the above-mentioned relevant embodiments, however, the above-mentioned embodiments are only examples for implementing the present invention. It must be pointed out that the disclosed embodiments do not limit the scope of the present invention. On the contrary, changes and modifications made without departing from the spirit and scope of the present invention are all within the scope of patent protection of the present invention.

Claims

1. An automatic focusing method based on a liquid lens, characterized in that: The automatic focusing method based on liquid lens comprises: Step S1: setting the focusing voltage range and the voltage search range; Step S2: updating the voltage value applied to the liquid lens; Step S3: collecting an image, calculating the image clarity, and automatically adjusting the focus according to the image clarity, and finding the voltage range that makes the image clear and the corresponding voltage range span based on the binary search method within the corresponding voltage search range; Step S4: determine whether the voltage range span found is smaller than the preset voltage span, if yes, execute step S5, if no, return to step S2; Step S5: Determine whether the current voltage value when focusing is successful is equal to the preset voltage value for focusing on the atomizer plate. If so, execute step S6; if not, execute step S7; Step S6: updating the voltage search range to the far-view voltage search range, and then returning to step S1; Step S7: The automatic focusing process ends.

2. The automatic focusing method based on liquid lens according to claim 1, characterized in that: In step S1, the initial voltage search range is [0, 800V].

3. The automatic focusing method based on liquid lens according to claim 1, characterized in that: In step S4, the voltage span is preset to be 10V.

4. The automatic focusing method based on liquid lens according to claim 1, characterized in that: In step S5, the preset voltage value focused on the atomizer plate is obtained by the following method: in the calibration stage, automatic focusing is run to make the liquid lens focus on the atomizer plate. At this time, the voltage value applied to the liquid lens is the voltage value focused on the atomizer plate, and the voltage value is recorded and stored.

5. The automatic focusing method based on liquid lens according to claim 1, characterized in that: Step S5 includes: Step S5-1: Determine whether the current stage is in the calibration stage, if so, execute step S5-2; if not, execute step S5-3; Step S5-2: storing the current voltage value as the preset voltage value focused on the atomizer plate, and then executing step S7; Step S5-3: Determine whether the current voltage value when focusing is successful is equal to the preset voltage value for focusing on the atomizer plate. If so, execute step S6; if not, execute step S7.

6. The automatic focusing method based on liquid lens according to claim 1, characterized in that: The preset voltage value focused on the atomizer plate is 500V; the far-field voltage search range in step S6 is [0, 500V).

7. A code reading device, characterized in that: The code reading device comprises an image sensor, a liquid lens, an atomizing plate, a voltage driving module and a control module, wherein the image sensor, the liquid lens and the atomizing plate are sequentially arranged along the optical axis direction; the voltage driving module is electrically connected to the liquid lens, and the voltage driving module is used to apply a voltage to the liquid lens so that the liquid lens generates a corresponding deformation, thereby adjusting the focal length of the liquid lens; The control module is electrically connected to the image sensor and the voltage driving module respectively, and the control module is used to control the working states of the image sensor and the voltage driving module according to the automatic focusing method based on a liquid lens as described in any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automatic focusing method based on a liquid lens as described in any one of claims 1 to 6 is implemented.