WO2017157154A1 - 自动聚焦方法及装置 - Google Patents

自动聚焦方法及装置 Download PDF

Info

Publication number
WO2017157154A1
WO2017157154A1 PCT/CN2017/074742 CN2017074742W WO2017157154A1 WO 2017157154 A1 WO2017157154 A1 WO 2017157154A1 CN 2017074742 W CN2017074742 W CN 2017074742W WO 2017157154 A1 WO2017157154 A1 WO 2017157154A1
Authority
WO
WIPO (PCT)
Prior art keywords
lens
sharpness
image sensor
motor
move
Prior art date
Application number
PCT/CN2017/074742
Other languages
English (en)
French (fr)
Inventor
童超
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017157154A1 publication Critical patent/WO2017157154A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B13/00Viewfinders; Focusing aids for cameras; Means for focusing for cameras; Autofocus systems for cameras
    • G03B13/32Means for focusing
    • G03B13/34Power focusing
    • G03B13/36Autofocus systems
    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B7/00Mountings, adjusting means, or light-tight connections, for optical elements
    • G02B7/28Systems for automatic generation of focusing signals
    • G02B7/282Autofocusing of zoom lenses

Definitions

  • This document relates to, but is not limited to, the field of computer technology, and relates to an autofocus method and apparatus.
  • the control lens is mainly used to push the focus lens group to move back and forth, and then the real-time extraction of each frame image generated on the sensor is performed in real time to find the position with the highest definition and lock the motor.
  • the camera needs to be repeatedly scanned (such as a mountain climbing algorithm) to find the position with the highest resolution, resulting in long focusing time, low stability, and poor visual effects.
  • the embodiment of the invention provides an automatic focusing method and device, which solves the problems of long focusing time, stability and visual effect of the camera in the related art.
  • An embodiment of the present invention provides an auto focus method, where the method includes:
  • Step 1 the lens motor is controlled to move the lens into the middle of the optical path, and the resolution Va of the current frame picture of the image sensor is calculated;
  • Step 2 controlling the lens motor to move the lens out of the optical path, and calculating the sharpness Vb of the current frame picture of the image sensor;
  • Step 3 calculating an absolute value of the difference between the definition Va and the definition Vb, determining whether the absolute value is less than or equal to a predetermined threshold, and if the absolute value is less than or equal to the predetermined threshold, determining that the focus is completed, if the absolute value is greater than a predetermined value
  • the threshold value controls the direction in which the focus motor drives the lens group to move according to the difference between the sharpness Va and the sharpness Vb, and step 1 is performed.
  • An embodiment of the present invention further provides an autofocus device, the device comprising:
  • Lens group focus motor, lens, lens motor, image sensor, lens control module, and Lens group control module;
  • the lens group is coupled to the focus motor; the lens is coupled to the lens motor;
  • the lens group is configured to focus light of an external object onto the image sensor
  • the focus motor is configured to drive the lens group to move back and forth under the control of the lens group control module
  • the lens is configured to change a position at which the light is focused
  • the lens motor is configured to drive the lens into or out of the optical path under the control of the lens control module;
  • the image sensor is configured to convert the received optical signal into a digital image signal and display the same;
  • the lens control module is configured to control the lens motor to move the lens into an intermediate position of the optical path, and calculate the sharpness Va of the current frame picture; further configured to control the lens motor to move the lens out of the optical path, and calculate the sharpness Vb of the current frame picture;
  • the lens group control module is configured to calculate an absolute value of a difference between the sharpness Va and the sharpness Vb, determine whether the absolute value is less than or equal to a predetermined threshold, and determine that the focus is completed if the absolute value is less than or equal to a predetermined threshold; If the absolute value is greater than the predetermined threshold, the direction in which the focus motor drives the movement of the lens group is controlled according to the magnitude of the difference between the sharpness Va and the sharpness Vb, and the lens control module is called.
  • the current focus direction can be accurately calculated, thereby improving the speed and accuracy of the focus.
  • the embodiment of the invention further provides a computer readable storage medium, wherein the computer readable storage medium stores computer executable instructions, and the computer executable instructions are implemented to implement an auto focus method.
  • FIG. 1 is a schematic structural diagram of an apparatus for autofocusing according to Embodiment 1 of the present invention.
  • FIG. 2 is a schematic view showing a state in which a lens is moved in according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic view showing a lens removal state according to Embodiment 1 of the present invention.
  • Fig. 5 is a schematic view showing a sharpness curve according to a second embodiment of the present invention.
  • an embodiment of the present invention provides an automatic focusing method and apparatus, and two groups are generated on the image sensor by periodically changing the optical focus position. Alternating pictures; two sets of focus sharpness data are extracted from the two sets of pictures to calculate the focus direction of the motor, and then gradually push the main lens to the clearest position for fast and accurate focusing.
  • FIG. 1 is a schematic structural diagram of an autofocus device according to an embodiment of the present invention. As shown in FIG. 1, an autofocus device package according to an embodiment of the present invention is shown. Included: lens group 1, focus motor 2, lens 3, lens motor 4, image sensor 5, lens control module 6 and lens group control module 7;
  • the lens group is connected to the focus motor 2; the lens 3 is connected to the lens motor 4;
  • the lens group 1 is arranged to focus the light of the external object onto the image sensor 5;
  • the focusing motor 2 is arranged to drive the lens group to move back and forth under the control of the lens group control module;
  • the lens 3 is arranged to change the position at which the light is focused
  • the lens motor 4 is arranged to drive the lens into or out of the optical path under the control of the lens control module 6;
  • the image sensor 5 is configured to convert the received optical signal into a digital image signal and display it;
  • the lens control module 6 is arranged to control the lens motor 4 to move the lens 3 into the intermediate position of the optical path, and calculate the sharpness Va of the current frame picture; and also to control the lens motor 4 to move the lens 3 out.
  • the lens group control module 7 is configured to calculate an absolute value of the difference between the sharpness Va and the sharpness Vb, determine whether the absolute value is less than or equal to a predetermined threshold, and if the absolute value is less than or equal to the predetermined threshold, determine that the focus is completed; When the absolute value is greater than the predetermined threshold, the direction in which the focus motor 2 drives the lens group 1 is controlled according to the difference between the sharpness Va and the sharpness Vb, and the lens control module is called.
  • the lens control module 6 moves the lens into the middle position of the optical path by calculating the definition Va of the current frame picture by:
  • the lens motor 4 is controlled to move the lens 3 into the intermediate position of the optical path; at the end of the frame synchronization signal of the image sensor, the definition Va of the current frame picture of the image sensor 5 is calculated.
  • the lens control module 6 moves the lens out of the optical path and calculates the definition Vb of the current frame picture of the image sensor when the next frame synchronization signal of the image sensor 5 starts.
  • the lens motor moves the lens out of the optical path; at the end of the next frame synchronization signal of the image sensor, the resolution Vb of the current frame picture of the image sensor 5 at this time is calculated.
  • the lens group control module 7 is specifically used to:
  • the lens group control module 7 controls the direction in which the focus motor drives the lens group according to the difference between the sharpness Va and the sharpness Vb by subtracting the sharpness Va from the sharpness Va.
  • the difference of the definition Vb is greater than a predetermined threshold, the focus motor 2 is controlled to drive the lens group 1 to move forward;
  • the focus motor 2 is controlled to move the lens group 1 backward.
  • the apparatus further includes: a threshold determining module configured to determine a predetermined threshold according to the experimental data.
  • a threshold determining module configured to determine a predetermined threshold according to the experimental data.
  • the auto focus in this example may include a lens set, a focus motor, a lens, a lens motor, an image sensor, and an image processing and control module.
  • the lens group 1 may be a module consisting of one or more optical lenses that can be moved back and forth by the focus motor 2 to provide a clear image on the image sensor 5 when moved to a suitable position.
  • the image sensor 5 can be a photoelectric conversion module that is fixed in the system to convert an optical image of the surface into a digital image signal.
  • the lens 3 may be a lens having a certain refractive index, which is periodically moved into or out of the optical path by the lens motor 4 to change the focal length of the lens group 1; when the lens 3 is moved into the optical path, the image sensor 5 generates One image; when the lens 3 is moved out of the optical path, the image sensor 5 generates another image.
  • the image processing and control module (corresponding to the lens control module 6 and the lens group control module 7 described above) respectively calculate the sharpness of the two images, and by comparing the magnitudes of the two sharpness values, the next step of the lens group 1 can be obtained. Forward direction. That is, the image processing and motor control module is arranged to acquire an image of the image sensor 5, then calculate a sharpness parameter of the image; and control the moving direction of the focus motor 2 and the lens motor 4.
  • the optical focal length is periodically changed by the auxiliary lens, and two images with different degrees of focus are generated on the sensor, and then the values of the sharpness of the two sets of images are extracted to accurately calculate The current focus direction is raised to increase the speed and accuracy of the focus.
  • FIG. 4 is a flowchart of an autofocus method according to an embodiment of the present invention. As shown in FIG.
  • Step 401 controlling the lens motor to move the lens into the middle position of the optical path, and calculating the sharpness Va of the current frame picture of the image sensor;
  • Step 402 controlling the lens motor to move the lens out of the optical path, and calculating the sharpness Vb of the current frame picture of the image sensor; in step 403, calculating the absolute value of the difference between the definition Va and the definition Vb, and determining whether the absolute value is less than or equal to a predetermined threshold, If the absolute value is less than or equal to the predetermined threshold, determining that the focus is complete, that is, until Va, Vb is approached, the clearest position is found, and the focus process is exited; if the absolute value is greater than the predetermined threshold, then The difference between the sharpness Va and the sharpness Vb controls the direction in which the focus motor drives the lens group to move, and step 401 is performed.
  • step 401 may include: controlling a lens motor to move the lens into an intermediate position of the optical path when the frame synchronization signal of the image sensor starts; and calculating a current frame image of the image sensor at the end of the frame synchronization signal of the image sensor Sharpness Va.
  • the trigger time for controlling the lens motor to move the lens into the middle position of the optical path may be adjusted according to a specific system time limit. For example, when the frame synchronization signal of the image sensor starts, the lens motor is controlled to move the lens into the optical path. The intermediate position; or may control the lens motor to move the lens into the middle of the optical path before the frame synchronization signal of the image sensor starts; or may control the lens motor to move the lens into the optical path after the frame synchronization signal of the image sensor starts The middle position.
  • the resolution Va of the current frame picture of the image sensor may be calculated.
  • step 402 may include: controlling a lens motor to move the lens out of the optical path when the next frame synchronization signal of the image sensor starts; and calculating a current frame image of the image sensor at the end of the next frame synchronization signal of the image sensor Sharpness Vb.
  • the trigger time for controlling the lens motor to move the lens into and out of the optical path may be adjusted according to a specific system time limit.
  • the lens motor may be controlled to move the lens out of the optical path when the next frame synchronization signal of the image sensor starts; or Can synchronize the next frame in the image sensor Before the start of the number, the lens motor is controlled to move the lens out of the optical path; or after the start of the next frame sync signal of the image sensor, the lens motor is controlled to move the lens out of the optical path.
  • the definition Vb of the current frame picture of the image sensor may be calculated.
  • controlling the lens motor to move the lens out of the optical path in step 403, and calculating the sharpness Vb of the current frame picture of the image sensor may include: when the difference between the definition Va minus the definition Vb is greater than a predetermined threshold The control focus motor drives the lens group to move forward; when the difference between the definition Vb minus the definition Va is greater than a predetermined threshold, the focus motor is controlled to drive the lens group to move backward.
  • the predetermined threshold may also be set according to an empirical value.
  • FIG. 5 is a schematic diagram of a sharpness curve according to an embodiment of the present invention.
  • P denotes focus
  • V denotes sharpness
  • curve 51 denotes a relationship between focus and sharpness when the lens is moved in
  • curve 51 denotes a focus when the lens is moved out.
  • the relationship of sharpness can be determined based on experimental data as shown in FIG.
  • the predetermined threshold may be determined according to the focus corresponding to the highest value of the curve 51 and the curve 52.
  • Step 1 Wait for the frame sync signal of the image sensor to start
  • Step 2 moving the lens motor to move the lens into the optical path
  • Step 3 waiting for the end of the frame synchronization signal of the image sensor, extracting the sharpness value Va of the picture from the image processing module;
  • Step 4 waiting for the second frame synchronization signal of the image sensor to start;
  • Step 5 moving the lens motor to move the lens out of the optical path
  • Step 6 waiting for the second frame synchronization signal of the image sensor to end, extracting the sharpness value Vb of the picture from the image processing module;
  • Step 9 If the difference between Va and Vb deserves an absolute value less than or equal to a predetermined threshold, that is, Va is close to Vb, it indicates that the focusing process is completed.
  • modules in the client in the embodiment can be adaptively changed and placed in one or more clients different from the embodiment.
  • the modules in the embodiments can be combined into one module, and further they can be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the present description including accompanying claims, abstracts, and All of the features disclosed in the drawings, as well as any of the methods or units disclosed herein, are combined.
  • Each feature disclosed in this specification may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present application can be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components loaded with the ordered web address in accordance with an embodiment of the present invention.
  • the application can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • Such a program implementing the present application may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • the embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores computer executable instructions, and the computer executable instructions are implemented to implement automatic aggregation. Focus method.
  • each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function.
  • the above technical solution can accurately calculate the current focus direction, thereby improving the speed and accuracy of the focus.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Optics & Photonics (AREA)
  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)

Abstract

一种自动聚焦方法,包括:步骤1,控制透镜电机(4)将透镜(3)移入到光路的中间位置,计算图像传感器(5)当前帧画面的清晰度Va;步骤2,控制透镜电机(4)将透镜(3)移出光路,计算图像传感器(5)当前帧画面的清晰度Vb;步骤3,计算清晰度Va和Vb之差的绝对值,判断绝对值是否小于或等于预定阈值,如果绝对值小于或等于预定阈值,则确定聚焦完成,如果绝对值大于预定阈值,则根据清晰度Va和Vb的差的大小,控制聚焦电机(2)带动镜片组(1)移动的方向,并执行步骤1。还公开了一种自动聚焦装置。这种自动聚焦方法能够准确计算出当前的聚焦方向,从而提高聚焦的速度和准确度。

Description

自动聚焦方法及装置 技术领域
本文涉及但不限于计算机技术领域,涉及一种自动聚焦方法及装置。
背景技术
目前一般摄像机设备在进行聚焦时,主要是通过控制电机来推动聚焦镜片组的前后移动,然后对传感器上生成的每一帧图像进行清晰度实时提取,寻找清晰度最高的位置并锁定电机。在实际系统中,受噪声和场景的影响,摄像头需要经过多次反复扫描(如爬山算法)才能找到清晰度最高的位置,导致聚焦时间长、稳定性低、以及视觉效果差等缺点。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例提供一种自动聚焦方法及装置,解决了相关技术中摄像机聚焦时间长、稳定性以及视觉效果的问题。
本发明实施例提供一种自动聚焦方法,所述方法包括:
步骤1,控制透镜电机将透镜移入到光路的中间位置,并计算图像传感器当前帧画面的清晰度Va;
步骤2,控制所述透镜电机将所述透镜移出光路,并计算图像传感器当前帧画面的清晰度Vb;
步骤3,计算清晰度Va和清晰度Vb之差的绝对值,判断绝对值是否小于或等于预定阈值,如果所述绝对值小于或等于预定阈值,则确定聚焦完成,如果所述绝对值大于预定阈值,则根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机带动镜片组移动的方向,并执行步骤1。
本发明实施例还提供了一种自动聚焦装置,所述装置包括:
镜片组、聚焦电机、透镜、透镜电机、图像传感器、透镜控制模块以及 镜片组控制模块;
其中,所述镜片组与所述聚焦电机连接;所述透镜与所述透镜电机连接;
所述镜片组设置为将外界物体的光线聚焦到图像传感器上;
所述聚焦电机设置为在镜片组控制模块的控制下带动所述镜片组前后移动;
所述透镜设置为改变光线聚焦的位置;
所述透镜电机设置为在透镜控制模块的控制下带动所述透镜移入或移出光路;
所述图像传感器设置为将接收到的光学信号转化为数字图像信号并进行显示;
所述透镜控制模块设置为控制透镜电机将透镜移入到光路的中间位置,并计算当前帧画面的清晰度Va;还设置为控制透镜电机将透镜移出光路,并计算当前帧画面的清晰度Vb;
所述镜片组控制模块设置为计算清晰度Va和清晰度Vb之差的绝对值,判断所述绝对值是否小于或等于预定阈值,如果所述绝对值小于或等于预定阈值,则确定聚焦完成;如果所述绝对值大于预定阈值,则根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机带动镜片组移动的方向,并调用所述透镜控制模块。
本发明实施例的有益效果如下:
通过辅助镜片周期性改变光学焦距,在传感器上生成两幅聚焦程度不同的画面,再通过提取两组画面的清晰度的数值,可以准确计算出当前的聚焦方向,从而提高聚焦的速度和准确度。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机可执行指令,所述计算机可执行指令被执行时实现自动聚焦方法。
在阅读并理解了附图和详细描述后,可以明白其它方面。
附图说明
通过阅读下文可选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出可选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1是本发明实施例一的自动聚焦方法装置的结构示意图;
图2是本发明实施例一的透镜移入状态的示意图;
图3是本发明实施例一的透镜移出状态的示意图;
图4是本发明实施例二的自动聚焦方法的流程图;
图5是本发明实施例二的清晰度曲线的示意图。
具体实施方式
下面将参照附图描述本申请的示例性实施例。虽然附图中显示了本申请的示例性实施例,然而应当理解,可以以各种形式实现本申请而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本申请,并且能够将本申请的范围完整的传达给本领域的技术人员。
为了解决相关技术中摄像机聚焦时间长、稳定性低、以及视觉效果差的问题,本发明实施例提供了一种自动聚焦方法及装置,通过周期性改变光学聚焦位置,在图像传感器上产生两组交替的画面;分别从两组画面中提取出两组聚焦清晰度数据,用来计算电机的聚焦方向,然后逐步推动主镜头前进到最清晰的位置,来实现快速准确地聚焦。以下结合附图以及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不限定本申请。
实施例一
本发明实施例提供一种自动聚焦方法装置,图1是本发明实施例的自动聚焦装置的结构示意图,如图1所示,根据本发明实施例的自动聚焦装置包 括:镜片组1、聚焦电机2、透镜3、透镜电机4、图像传感器5、透镜控制模块6以及镜片组控制模块7;
其中,所述镜片组与1所述聚焦电机2连接;所述透镜3与所述透镜电机4连接;
镜片组1设置为将外界物体的光线聚焦到图像传感器5上;
聚焦电机2设置为在镜片组控制模块的控制下带动镜片组前后移动;
透镜3设置为改变光线聚焦的位置;
透镜电机4设置为在透镜控制模块6的控制下带动透镜移入或移出光路;
图像传感器5设置为将接收到的光学信号转化为数字图像信号并进行显示;
如图2和图3所示,透镜控制模块6设置为控制透镜电机4将透镜3移入到光路的中间位置,并计算当前帧画面的清晰度Va;还设置为控制透镜电机4将透镜3移出光路,并计算当前帧画面的清晰度Vb;
镜片组控制模块7设置为计算清晰度Va和清晰度Vb之差的绝对值,判断绝对值是否小于或等于预定阈值,如果所述绝对值小于或等于预定阈值,则确定聚焦完成;如果所述绝对值大于预定阈值,则根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机2带动镜片组1移动的方向,并调用所述透镜控制模块。
可选地,在本实施例中,透镜控制模块6通过如下方式实现将透镜移入到光路的中间位置,并计算当前帧画面的清晰度Va:
在图像传感器5的帧同步信号开始时,控制透镜电机4将透镜3移入到光路的中间位置;在图像传感器的帧同步信号结束时,计算图像传感器5当前帧画面的清晰度Va。
可选地,在本实施例中,透镜控制模块6通过如下方式实现将所述透镜移出光路,并计算图像传感器当前帧画面的清晰度Vb在图像传感器5的下一帧同步信号开始时,控制透镜电机将透镜移出光路;在图像传感器的下一帧同步信号结束时,计算此时图像传感器5当前帧画面的清晰度Vb。
镜片组控制模块7具体用于:
可选地,在本实施例中,所述镜片组控制模块7通过如下方式实现根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机带动镜片组移动的方向:在清晰度Va减去清晰度Vb的差值大于预定阈值时,则控制聚焦电机2带动镜片组1向前移动;
在清晰度Vb减去清晰度Va的差值大于预定阈值时,则控制聚焦电机2带动镜片组1向后移动。
可选地,上述装置还包括:阈值确定模块,设置为根据实验数据确定预定阈值。
以下通过示例对本发明实施例的技术方案做进一步的说明。
本示例中的自动聚焦可以包括镜片组、聚焦电机、透镜、透镜电机、图像传感器以及图像处理和控制模块。
在本示例中,镜片组1可以是由一片或者多片光学镜片组成的模块,在聚焦电机2的带动下可以前后移动,当移动到合适的位置时,能够在图像传感器5上清晰的图像。图像传感器5可以是一个光电转换模块,固定在系统中,可以将表面的光学图像转换成数字图像信号。透镜3可以是具有一定折射率的透镜,在透镜电机4的带动下,周期性的移入光路中或移出光路,从而改变镜片组1的焦距;当将透镜3移入光路中时,图像传感器5生成一幅图像;当将透镜3移出光路时,图像传感器5生成另一幅图像。图像处理和控制模块(对应于上述透镜控制模块6以及镜片组控制模块7)分别计算出两幅图像的清晰度,通过比较这两个清晰度值的大小,可以得出镜片组1下一步的前进方向。也就是说,图像处理和电机控制模块设置为采集图像传感器5的图像,然后计算图像的清晰度参数;以及控制聚焦电机2和透镜电机4的移动方向。
综上所述,借助于本发明实施例的技术方案,通过辅助镜片周期性改变光学焦距,在传感器上生成两幅聚焦程度不同的画面,再通过提取两组画面的清晰度的数值,准确计算出当前的聚焦方向,从而提高聚焦的速度和准确度。
实施例二
本发明实施例提供了一种自动聚焦方法,图4是本发明实施例的自动聚焦方法的流程图,如图4所示,本发明实施例的自动聚焦方法包括:
步骤401,控制透镜电机将透镜移入到光路的中间位置,并计算图像传感器当前帧画面的清晰度Va;
步骤402,控制透镜电机将透镜移出光路,并计算图像传感器当前帧画面的清晰度Vb;步骤403,计算清晰度Va和清晰度Vb之差的绝对值,判断绝对值是否小于或等于预定阈值,如果所述绝对值小于或等于预定阈值,则确定聚焦完成,也就是说,直到Va,Vb接近时,就找到了最清晰位置,并退出聚焦过程;如果所述绝对值大于预定阈值,则根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机带动镜片组移动的方向,并执行步骤401。
可选地,步骤401可以包括:在图像传感器的帧同步信号开始时,控制透镜电机将透镜移入到光路的中间位置;在图像传感器的帧同步信号结束时,计算此时图像传感器当前帧画面的清晰度Va。
需要说明的是,控制透镜电机将透镜移入到光路的中间位置的触发时间可以根据具体的系统时限相应调整,例如,可以是在图像传感器的帧同步信号开始时,控制透镜电机将透镜移入到光路的中间位置;或者可以是在图像传感器的帧同步信号开始前,控制透镜电机将透镜移入到光路的中间位置;还可以是在图像传感器的帧同步信号开始后,控制透镜电机将透镜移入到光路的中间位置。
此外,需要说明的是,在其他实施例中,还可以是在图像传感器的帧同步信号结束后,计算此时图像传感器当前帧画面的清晰度Va。
可选地,步骤402可以包括:在图像传感器的下一帧同步信号开始时,控制透镜电机将透镜移出光路;在图像传感器的下一帧同步信号结束时,计算此时图像传感器当前帧画面的清晰度Vb。
需要说明的是,控制透镜电机将透镜移入出光路的触发时间可以根据具体的系统时限相应调整,例如,可以是在图像传感器的下一帧同步信号开始时,控制透镜电机将透镜移出光路;或者可以在图像传感器的下一帧同步信 号开始前,控制透镜电机将透镜移出光路;还可以是在图像传感器的下一帧同步信号开始后,控制透镜电机将透镜移出光路。
此外,需要说明的是,在其他实施例中,还可以是在图像传感器的下一帧同步信号结束后,计算此时图像传感器当前帧画面的清晰度Vb。
可选地,在步骤403中控制所述透镜电机将所述透镜移出光路,并计算图像传感器当前帧画面的清晰度Vb可以包括:在清晰度Va减去清晰度Vb的差值大于预定阈值时,控制聚焦电机带动镜片组向前移动;在清晰度Vb减去清晰度Va的差值大于预定阈值时,控制聚焦电机带动镜片组向后移动。
可选地,在本实施例中,该预定阈值也可以根据经验值进行设置。
图5为本发明实施例的清晰度曲线的示意图,如图5所示,P表示聚焦,V表示清晰度,曲线51表示透镜移入时焦点与清晰度的关系,曲线51表示透镜移出时焦点与清晰度的关系,可以根据如图5所示的实验数据,确定预定阈值。例如在本发明实施例中,可以根据曲线51和曲线52清晰度最高值所对应的焦点,确定预定阈值。
下面通过示例对本发明实施例的上述自动聚焦方法进行详细说明。
步骤1,等待图像传感器的帧同步信号开始;
步骤2,移动透镜电机,,使透镜移入光路中;
步骤3,等待图像传感器的帧同步信号结束,从图像处理模块提取画面的清晰度数值Va;
步骤4,等待图像传感器的第二帧同步信号开始;
步骤5,移动透镜电机,使透镜移出光路;
步骤6,等待图像传感器的第二帧同步信号结束,从图像处理模块提取画面的清晰度数值Vb;
步骤7,比较Va和Vb,如果Va减去Vb的差值大于预定阀值(例如Va=1000,Vb=900),则控制镜头电机带动镜片组向前移动,然后执行步骤1;
步骤8,比较Va和Vb,如果Vb减去Va的差值大于预定阀值(例如 Va=800,Vb=900),则控制镜头电机带动镜片组向后移动,然后执行步骤1;
步骤9,如果Va与Vb的差值得绝对值小于或等于预定阈值,也就是Va接近Vb,则表示聚焦过程完成。
综上所述,通过辅助镜片周期性改变光学焦距,在传感器上生成两幅聚焦程度不同的画面,再通过提取两组画面的清晰度的数值,可以准确计算出当前的聚焦方向,从而提高聚焦的速度和准确度。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本申请也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本申请的内容,并且上面对特定语言所做的描述是为了披露本申请的可选实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本申请的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,在上面对本发明的示例性实施例的描述中,本申请的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本申请要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本申请的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的客户端中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个客户端中。可以把实施例中的模块组合成一个模块,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和 附图)中公开的所有特征以及如此公开的任何方法或者客户端的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本申请的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本申请的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的加载有排序网址的客户端中的一些或者全部部件的一些或者全部功能。本申请还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本申请的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
应该注意的是上述实施例对本申请进行说明而不是对本申请进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本申请可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机可执行指令,所述计算机可执行指令被执行时实现自动聚 焦方法。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。
工业实用性
上述技术方案可以准确计算出当前的聚焦方向,从而提高聚焦的速度和准确度。

Claims (10)

  1. 一种自动聚焦方法,所述方法包括:
    步骤1,控制透镜电机将透镜移入到光路的中间位置,并计算图像传感器当前帧画面的清晰度Va;
    步骤2,控制所述透镜电机将所述透镜移出光路,并计算图像传感器当前帧画面的清晰度Vb;
    步骤3,计算清晰度Va和清晰度Vb之差的绝对值,判断所述绝对值是否小于或等于预定阈值,如果所述绝对值小于或等于预定阈值,则确定聚焦完成;如果所述绝对值大于预定阈值,则根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机带动镜片组移动的方向,并执行步骤1。
  2. 如权利要求1所述的方法,其中,所述控制透镜电机将透镜移入到光路的中间位置,并计算图像传感器当前帧画面的清晰度Va包括:
    在图像传感器的帧同步信号开始时,控制所述透镜电机将透镜移入到光路的中间位置;在图像传感器的帧同步信号结束时,计算图像传感器当前帧画面的清晰度Va。
  3. 如权利要求2所述的方法,其中,所述控制所述透镜电机将所述透镜移出光路,并计算图像传感器当前帧画面的清晰度Vb包括:
    在图像传感器的下一帧同步信号开始时,控制所述透镜电机将透镜移出光路;在图像传感器的下一帧同步信号结束时,计算图像传感器当前帧画面的清晰度Vb。
  4. 如权利要求1所述的方法,其中,所述根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机带动镜片组移动的方向包括:
    在清晰度Va减去清晰度Vb的差值大于所述预定阈值时,控制所述聚焦电机带动镜片组向前移动;
    在清晰度Vb减去清晰度Va的差值大于所述预定阈值时,控制所述聚焦电机带动镜片组向后移动。
  5. 如权利要求1所述的方法,所述方法还包括:根据实验数据确定所述 预定阈值。
  6. 一种自动聚焦装置,所述装置包括:镜片组、聚焦电机、透镜、透镜电机、图像传感器、透镜控制模块以及镜片组控制模块;
    其中,所述镜片组与所述聚焦电机连接;所述透镜与所述透镜电机连接;
    所述镜片组设置为将外界物体的光线聚焦到图像传感器上;
    所述聚焦电机设置为在镜片组控制模块的控制下带动所述镜片组前后移动;
    所述透镜设置为改变光线聚焦的位置;
    所述透镜电机设置为在透镜控制模块的控制下带动所述透镜移入或移出光路;
    所述图像传感器设置为将接收到的光学信号转化为数字图像信号并进行显示;
    所述透镜控制模块设置为控制透镜电机将透镜移入到光路的中间位置,并计算当前帧画面的清晰度Va;还设置为控制透镜电机将透镜移出光路,并计算当前帧画面的清晰度Vb;
    所述镜片组控制模块设置为计算清晰度Va和清晰度Vb之差的绝对值,判断所述绝对值是否小于或等于预定阈值,如果所述绝对值小于或等于预定阈值,则确定聚焦完成;如果所述绝对值大于预定阈值,则根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机带动镜片组移动的方向,并调用所述透镜控制模块。
  7. 如权利要求6所述的装置,其中,所述透镜控制模块通过如下方式实现将透镜移入到光路的中间位置,并计算当前帧画面的清晰度Va:
    在图像传感器的帧同步信号开始时,控制所述透镜电机将透镜移入到光路的中间位置;在图像传感器的帧同步信号结束时,计算图像传感器当前帧画面的清晰度Va。
  8. 如权利要求7所述的装置,其中,所述透镜控制模块通过如下方式实现将所述透镜移出光路,并计算图像传感器当前帧画面的清晰度Vb:
    在图像传感器的下一帧同步信号开始时,控制所述透镜电机将透镜移出光路;在图像传感器的下一帧同步信号结束时,计算图像传感器当前帧画面的清晰度Vb。
  9. 如权利要求6所述的装置,其中,所述镜片组控制模块通过如下方式实现根据清晰度Va和清晰度Vb的差的大小,控制聚焦电机带动镜片组移动的方向:
    在清晰度Va减去清晰度Vb的差值大于所述预定阈值时,则控制所述聚焦电机带动镜片组向前移动;
    在清晰度Vb减去清晰度Va的差值大于所述预定阈值时,则控制所述聚焦电机带动镜片组向后移动。
  10. 如权利要求6所述的装置,所述装置还包括:
    阈值确定模块,设置为根据实验数据确定所述预定阈值。
PCT/CN2017/074742 2016-03-16 2017-02-24 自动聚焦方法及装置 WO2017157154A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610154752.2A CN107203083A (zh) 2016-03-16 2016-03-16 自动聚焦方法及装置
CN201610154752.2 2016-03-16

Publications (1)

Publication Number Publication Date
WO2017157154A1 true WO2017157154A1 (zh) 2017-09-21

Family

ID=59850240

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/074742 WO2017157154A1 (zh) 2016-03-16 2017-02-24 自动聚焦方法及装置

Country Status (2)

Country Link
CN (1) CN107203083A (zh)
WO (1) WO2017157154A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110753182A (zh) * 2019-09-30 2020-02-04 华为技术有限公司 成像设备的调节方法和设备
EP3889661A1 (en) * 2020-03-31 2021-10-06 Infiray Technologies Co., Ltd. Focusing method and apparatus, electronic device and storage medium
CN117191805A (zh) * 2023-10-26 2023-12-08 中导光电设备股份有限公司 一种aoi检测头自动调焦方法和系统

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110794549B (zh) * 2019-11-11 2022-02-11 湖南伊鸿健康科技有限公司 自动聚焦方法、血细胞分析仪及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009042621A (ja) * 2007-08-10 2009-02-26 Ricoh Co Ltd 撮像装置および撮像方法
CN102253569A (zh) * 2011-01-17 2011-11-23 深圳市保千里电子有限公司 一种摄像机聚焦的方法及装置
CN202602794U (zh) * 2012-05-17 2012-12-12 杭州本立道科技有限公司 自动聚焦的一体化摄像机装置
CN104270556A (zh) * 2014-10-08 2015-01-07 信利光电股份有限公司 摄像模组
CN104270557A (zh) * 2014-10-08 2015-01-07 信利光电股份有限公司 摄像模组

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009042621A (ja) * 2007-08-10 2009-02-26 Ricoh Co Ltd 撮像装置および撮像方法
CN102253569A (zh) * 2011-01-17 2011-11-23 深圳市保千里电子有限公司 一种摄像机聚焦的方法及装置
CN202602794U (zh) * 2012-05-17 2012-12-12 杭州本立道科技有限公司 自动聚焦的一体化摄像机装置
CN104270556A (zh) * 2014-10-08 2015-01-07 信利光电股份有限公司 摄像模组
CN104270557A (zh) * 2014-10-08 2015-01-07 信利光电股份有限公司 摄像模组

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110753182A (zh) * 2019-09-30 2020-02-04 华为技术有限公司 成像设备的调节方法和设备
CN110753182B (zh) * 2019-09-30 2021-02-09 华为技术有限公司 成像设备的调节方法和设备
EP3889661A1 (en) * 2020-03-31 2021-10-06 Infiray Technologies Co., Ltd. Focusing method and apparatus, electronic device and storage medium
CN117191805A (zh) * 2023-10-26 2023-12-08 中导光电设备股份有限公司 一种aoi检测头自动调焦方法和系统
CN117191805B (zh) * 2023-10-26 2024-04-26 中导光电设备股份有限公司 一种aoi检测头自动调焦方法和系统

Also Published As

Publication number Publication date
CN107203083A (zh) 2017-09-26

Similar Documents

Publication Publication Date Title
US9986148B2 (en) Image capturing terminal and image capturing method
WO2017157154A1 (zh) 自动聚焦方法及装置
WO2018228479A1 (zh) 自动对焦方法、装置、存储介质及电子设备
WO2015180509A1 (zh) 一种图像获取终端和图像获取方法
WO2017107842A1 (zh) 变焦跟踪曲线的校正方法和装置
US20130250162A1 (en) Automatic focusing apparatus and lens apparatus including the automatic focusing apparatus
TWI668993B (zh) 控制方法、控制裝置及電子裝置
CN104469169A (zh) 相位测距摄像模组及其自动对焦方法
WO2017107770A1 (zh) 变倍跟踪曲线的校正方法和装置
US20150249783A1 (en) Information processing method and electronic device
CN112333379A (zh) 图像对焦方法、装置及图像采集设备
JP2017187693A5 (zh)
JP2010107866A (ja) デジタルカメラ及び光学機器
RU2389050C1 (ru) Способ автоматической фокусировки
JPH05232367A (ja) フォーカス調整装置
CN113938599A (zh) 一种电动镜头聚焦方法、装置、电子设备和存储介质
JP6808340B2 (ja) レンズ制御装置、制御方法
JP6241791B2 (ja) オートフォーカス装置及び撮像装置
JP6486098B2 (ja) 撮像装置及びその制御方法
JP2015154409A5 (zh)
JP7379039B2 (ja) レンズ装置、撮像装置、レンズ装置の制御方法、およびプログラム
JP2007328360A (ja) 自動焦点カメラ及び撮影方法
JP6874251B2 (ja) 装置、撮像装置、移動体、方法、及びプログラム
JP2014215476A5 (zh)
JP6602089B2 (ja) 画像処理装置及びその制御方法

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17765696

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17765696

Country of ref document: EP

Kind code of ref document: A1