WO2016161734A1 - Autofocusing method and device - Google Patents

Autofocusing method and device Download PDF

Info

Publication number
WO2016161734A1
WO2016161734A1 PCT/CN2015/086686 CN2015086686W WO2016161734A1 WO 2016161734 A1 WO2016161734 A1 WO 2016161734A1 CN 2015086686 W CN2015086686 W CN 2015086686W WO 2016161734 A1 WO2016161734 A1 WO 2016161734A1
Authority
WO
WIPO (PCT)
Prior art keywords
focus
contrast value
position corresponding
grayscale
threshold
Prior art date
Application number
PCT/CN2015/086686
Other languages
French (fr)
Chinese (zh)
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 WO2016161734A1 publication Critical patent/WO2016161734A1/en

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

Definitions

  • the present invention relates to the field of digital image processing technologies, and in particular, to a method and apparatus for autofocus.
  • the focal length (f), object distance (u) and image distance (v) of the lens need to meet:
  • the sharpness and detail of the image are rich, and in the spatial domain, the grayscale contrast value of the adjacent pixel points is the largest.
  • the grayscale contrast value of the image in the in-focus state is maximized by extracting the contour of the focus window of the image and the grayscale contrast value of the edge. Therefore, the lens is moved by the motor to change the image distance, and the grayscale contrast value of the acquired image is calculated in real time, and the position where the grayscale contrast value is the largest is the focus position.
  • the gray contrast curve has three characteristics, 1) unimodality, that is, only one gray contrast maximum; 2) Monotonicity, that is, on both sides of the grayscale contrast maximum, the grayscale contrast curve monotonically decreases or decreases; 3) polarity, it can be judged whether the current focus position is before or after the focus.
  • the lens moves from the starting position to the ending position, and the entire stroke is completed according to a fixed speed, a fixed step size, and a fixed step number, since the object distance and the image distance of the lens are not linear, as shown in the figure. 2 is shown.
  • This method has the following drawbacks: if the step size is small, the number of steps increases, causing the focusing time to be too long, and if the step size is large, the focus is inaccurate and unstable.
  • the embodiment of the invention provides a method and a device for autofocusing, which solves the problem that the image quality is poor due to the fixed speed and step size of the motor cannot be accurately focused in the related art.
  • a method for autofocusing comprising: acquiring a blur diameter value of an image sensor of a terminal, an aperture value of a lens, and a motion parameter of the motor; according to the blur diameter value, The aperture value of the lens and the motion parameter of the motor calculate a range of object distances of the steps of the motor; in the stepping step, the step of the object distance range in the range of the object distance of other steps is removed; The grayscale contrast value of the corresponding position of each step is determined; a step position is determined as the focus of the focus from the step remaining after the culling according to the gradation contrast value.
  • N A is the number of the farthest step determined in the first focus step
  • B n is the second focus step.
  • determining a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the first focusing step as the first threshold, and the second focusing step
  • the grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the three consecutive steps is determined as a second threshold, and the grayscale contrast value of the focus is greater than the second threshold, the second threshold And greater than the first threshold; acquiring a grayscale contrast value of the current focus window, if the current grayscale contrast value is greater than the second threshold, less than the grayscale contrast value of the focus, performing the step of selecting the third focus step; if the current gray If the degree contrast value is greater than the first threshold, less than the second threshold, the step of selecting the second focus step is performed; if the current gray level contrast value is less than the first threshold, the step of selecting the first focus step is performed.
  • the speed of movement of the motor is greater according to a distance between two adjacent focal points Small control.
  • An apparatus for autofocusing comprising: a parameter acquisition module, configured to acquire a blur diameter value of an image sensor in the terminal, an aperture value of the lens, and a motion parameter of the motor; and a distance range calculation module configured to be based on the blur diameter value,
  • the aperture value of the lens and the motion parameter of the motor calculate a range of object distances of the various steps of the motor;
  • the step culling module is configured to remove the object distance range in the step by other distances in the stepping distance Stepping;
  • a grayscale contrast obtaining module configured to obtain a grayscale contrast value of a corresponding position of each step remaining after the culling;
  • the focus determining module is set to a step that is left after the culling according to the grayscale contrast value Determines the position of a step as the focus of focus.
  • any position corresponding to the two steps with a large grayscale contrast value is used as the focus of focus; otherwise, the position corresponding to the step with the largest grayscale contrast value is selected as the focus of focus;
  • X i is the remaining step In,
  • a n is the first focus step, and i and n are positive integers.
  • the focus determining module further includes: a second focus step selection sub-module, configured to select an inflection point after the gray-scale contrast value of the position corresponding to three consecutive steps in the first focus step
  • the second focus determination sub-module setting In order to control the movement of the motor to push the focus window to focus on the position corresponding to the second focus step from far to near, when the gray contrast value of the position corresponding to three consecutive steps in the second focus step has an inflection point
  • the position is the focus of focus; N A is the number of the farthest step determined in the first focus step, and B n is the second focus step.
  • the three focus steps are separately focused, and when the gray contrast value of the position corresponding to the three consecutive steps in the third focus step has an inflection point, the gray contrast value of the position corresponding to the three consecutive steps is selected to be the largest.
  • the corresponding position of the step is used as the focus of focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of focus; C n is the third focus step, and N B is the second focus step Determine the number of the most recent step.
  • the method further includes: a threshold determining module, configured to determine a grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the position corresponding to three consecutive steps in the first focusing step as the first a threshold value, where a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the second focus step is determined as a second threshold, and the grayscale contrast value of the focus is greater than a second threshold, the second threshold is greater than the first threshold; the processing module is configured to obtain a grayscale contrast value of the current focus window, and if the current grayscale contrast value is greater than the second threshold, less than the grayscale contrast value of the focus, Sending a trigger start command to the third focus step selection submodule; if the current gray scale contrast value is greater than the first threshold and less than the second threshold, sending a trigger start command to the second focus step selection submodule; Such as If the current grayscale contrast value is less than the first threshold, a triggering start command
  • Embodiments of the present invention provide a method and apparatus for autofocusing, which are obtained by acquiring a blur diameter value of an image sensor of a terminal, an aperture value of a lens, and a motion parameter of a motor, and calculating a range of object distances of each step of the motor, and rejecting a step of the object distance in the range of the object distance of the other steps, and then obtaining the gray contrast value of the corresponding position of each step remaining after the culling; the remaining steps after the gradation according to the gradation value Into the middle to determine a step position as the focus of focus.
  • the scheme eliminates the steps in the object distance range of other steps, so that the newly obtained stepping object distance range does not overlap, the number of motor movements is reduced, and the moving step of the motor is also performed.
  • the change has been made to achieve fast autofocus without affecting its image quality and improving the user experience.
  • Figure 1 is a two-dimensional map of gray scale contrast and image distance in the terminal
  • Figure 2 is a graph of image distance and object distance
  • FIG. 3 is a flowchart of a method for autofocus according to Embodiment 1 of the present invention.
  • FIG. 5 is a graph of image distance and gray scale contrast according to Embodiment 1 of the present invention.
  • FIG. 6 is a schematic structural diagram of an apparatus for autofocus according to Embodiment 2 of the present invention.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • FIG. 3 a flowchart of a method for autofocus according to Embodiment 1 of the present invention is shown in FIG. 3 .
  • S301 Acquire a blur diameter value of an image sensor of the terminal, an aperture value of the lens, and a motion parameter of the motor;
  • the terminal in the embodiment of the present invention includes: a mobile phone, a tablet, a palmtop computer, a camera, a camera, etc.;
  • the motion parameters of the motor include: the motor stroke and the oscillation frequency and the oscillation time when the motor drives the lens to move; in this embodiment, by reading The parameters written in the terminal memory are taken to obtain the blur diameter value of the image sensor, the aperture value of the lens, the motor stroke, and the oscillation frequency and the oscillation time when the motor drives the lens movement; the oscillation frequency and the oscillation time for the motor motion can also be Measured by a special measuring instrument;
  • S302 Calculate a range of object distances of each step of the motor according to the fuzzy diameter value, the aperture value of the lens, and the motion parameter of the motor;
  • the length and speed of each step of the motor are set according to the blur diameter value, the aperture value of the lens, and the motion parameter of the motor; the length of the motor stroke and the stepping speed
  • S is the motor stroke and u is the length of the step
  • different motors are matched with different lenses, the motor oscillation frequency and the oscillation time are different
  • v i the motion speed
  • t f is the oscillation time
  • f′ is the oscillation frequency
  • the object distance range corresponding to each step includes: Near Focus Limit: And Far Focus Limit:
  • H is the hyperfocal distance
  • A is the lens aperture value
  • d is the image sensor blur diameter
  • the corresponding u N and u F after each step movement of the motor are calculated by the above method
  • the object distance ranges of adjacent steps can be obtained by comparing the values of u N and u F in adjacent steps, and selecting a step that can cover other focus objects, that is, The object distance range is eliminated in steps of other object distances, so that in the remaining steps, the distances of adjacent steps are no longer the same, so that the distance of each step of the motor is no longer the same, but It is also possible to cover the range of object distances that it can cover, and in this step, the extra steps are eliminated; for example, in this embodiment, it is assumed that the new moving step of the motor is X i , where X i is After the culling, the step remaining, i is a positive integer, that is, the motor will move according to the position corresponding to the new step X i , and the number of steps for completing the formation of the entire motor will be reduced;
  • the grayscale contrast value corresponding to each step corresponding position is obtained, usually by controlling the motor to move to the stepping Corresponding position, and focusing on the position, thereby obtaining a grayscale contrast value of the pixel in the focus window;
  • S305 determining, according to the grayscale contrast value, a step position from the step remaining after the culling as a focus of focusing;
  • the gradation contrast values corresponding to the respective steps are obtained, and the maximum gradation contrast value is selected among the obtained gradation contrast values.
  • the position of the corresponding step is used as the focus of the focus, or the position where the gradation contrast value is selected to be in the range of the image in which the high-definition imaging is satisfied is determined as the focus of the focus.
  • the repeated stepping reduces the number of movements of the motor, and the quality of the imaging is not degraded, and the possibility of fast focusing can be achieved, thereby improving the user experience.
  • Any position is the focus of focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of focus; X i is the remaining step, A n is the first focus step, i, n are A positive integer; in this embodiment, by selecting a step that satisfies the above formula as the first focus step, and focusing only on the selected first focus step, calculating the corresponding step from near to far The grayscale contrast value of the position, after the inflection point occurs in the grayscale contrast value of the position corresponding to three consecutive steps in the first focus step, the focus processing of the other first focus step positions is not required, only in the The position corresponding to three consecutive steps Any position corresponding between two steps with a large gray-scale contrast value as a focus of focus; any position includes a position corresponding to any step between two steps with a large gray-scale contrast value, Or the position corresponding to the remaining step after any culling between the two steps with a large grayscale contrast value; selecting any of the positions as the focus of the focus can not only achieve
  • the position is respectively focused, that is, during the current focusing process, after the focus of the first focus step is stopped, that is, when the gradation contrast value in the first focus step has an inflection point; when the second focus step is in progress If an inflection point occurs in the gray contrast value of the position corresponding to the three consecutive steps, any position corresponding to the
  • any position corresponding to the two steps with a large grayscale contrast value is used as the focus of the focus; likewise, any position includes any step between the two steps with a large grayscale contrast value.
  • Position, or the position corresponding to the remaining step after any culling between the two steps with a large grayscale contrast value; selecting any of the positions as the focus of the focus more selectively achieves the accuracy of the focus may.
  • the corresponding position of the step is used as the focus of focus; C n is the third focus step, and N B is the number of the nearest step determined in the second focus step; through the above three steps, from near to far, from far Control the motor to move to the near and then from near to far, and separately focus to obtain the gray contrast value of each step position, and finally obtain the most accurate step position of the gray contrast value in the terminal. , Compared with the gradation current contrast value acquired by the gradation contrast value, how to obtain a controlled movement of the motor current so that the quality of the resulting photographs captured best.
  • the method for focusing on a target that needs to be photographed currently includes: first, determining a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the first focus step as the first a threshold value, determining a grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the three consecutive steps in the second focus step as a second threshold, and three consecutive steps in the third step
  • the grayscale contrast value of the corresponding position appears as the grayscale contrast value of the focus of the inflection point, the grayscale contrast value of the focus is greater than the second threshold, and the second threshold is greater than the first threshold; acquiring the current focus The grayscale contrast value of the window, if the current grayscale contrast value is greater than the second threshold and less than the grayscale contrast value of the focus, the step of selecting the third focus step is performed, thereby obtaining an accurate focus of the current target; if current The grayscale contrast value is greater than the first threshold, and less than the second threshold, the step of
  • the step of the second focus step in order to focus the accuracy, it is necessary to continue the step of performing the third one-step step, so that the determined focus focus will be more accurate; if the current gray scale contrast value is less than the first threshold, Then, the step of selecting the first focus step is performed, and the situation is similar to the above case, and will not be described here.
  • the speed of the motor movement is controlled according to the distance between two adjacent steps.
  • the speed of the motor also changes during the above-described determination of the grayscale contrast value of each focus step.
  • the scanning speed is x 1
  • the scanning speed is x 2
  • the scanning speed is x 3
  • FIG. 4 a detailed flowchart of a method for automatic multiple focus according to Embodiment 1 of the present invention is shown in FIG. 4 .
  • Figure 5
  • S401 reading a blur diameter of an image sensor written in a memory of the terminal, an aperture of the lens, a motor stroke, and an oscillation frequency and an oscillation time when the motor drives the lens to move;
  • S402 calculating a corresponding object distance range after each step movement of the motor according to the blur diameter, the aperture of the lens, the motor stroke, and the oscillation frequency and the oscillation time when the motor drives the lens to move;
  • the embodiment realizes the possibility of continuous focusing, and can realize focusing relatively quickly and accurately, not only improving the imaging quality, but also saving the focusing time and improving the user experience.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • FIG. 6 is a schematic structural diagram of an apparatus for autofocus according to Embodiment 2 of the present invention.
  • the autofocus apparatus 60 includes: a parameter acquisition module 601, an object distance range calculation module 602, and a step rejection module. 603, a grayscale contrast acquisition module 604 and a focus determination module 605;
  • the parameter acquisition module 601 is configured to acquire a blur diameter value of the image sensor in the terminal, an aperture value of the lens, and a motion parameter of the motor;
  • the object distance range calculation module 602 is configured to be based on the blur The diameter value, the aperture value of the lens, and the motion parameter of the motor calculate the object distance range of each step of the motor;
  • the step culling module 603 is configured to remove the step of the object distance range within the step distance of the other step in the stepping
  • Grayscale contrast acquisition module 604 is set to obtain each of the remaining after culling The grayscale contrast value of the corresponding position of the step;
  • the focus determining module 605 is configured to determine a position of the step as
  • Any position corresponding to the two large steps is used as the focus of focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of focus; X i is the remaining step, A n is the first A focus step, i, n is a positive integer.
  • the gray contrast value of the position corresponding to three consecutive steps in the second focus step has an inflection point, three consecutive steps are selected.
  • N A is The number of the farthest step determined in the first focus step
  • B n is the second focus step
  • the position corresponding to the step with the largest gray contrast value in the position corresponding to the three consecutive steps is selected as the focus of the focus. ; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of focus; C n is the third focus step, and N B is the number of the nearest step determined in the second focus step;
  • the autofocus device 60 further includes: a threshold determining module configured to determine a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the first focusing step as the first threshold a grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the position of the three consecutive steps in the second focus step is determined as a second threshold, and the grayscale contrast value of the focus is greater than the second threshold, The second threshold is greater than the first threshold; the processing module is configured to obtain the grayscale contrast value of the current focus window, and if the current grayscale contrast value is greater than the second threshold and less than the focus grayscale contrast value, the third focus step is selected.
  • a threshold determining module configured to determine a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the first focusing step as the first threshold a grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the position of the three consecutive
  • the submodule sends a trigger start command; if the current grayscale contrast value is greater than the first threshold and less than the second threshold, sending a trigger start command to the second focus step selection submodule; if the current grayscale contrast value is less than the first threshold , the trigger start command is sent to the first focus step selection sub-module.
  • Embodiments of the present invention provide a method and apparatus for autofocusing, which eliminates steps of a stepped object distance range within a range of other stepped object distances, and then obtains the remaining steps after the rejection.
  • the grayscale contrast value of the corresponding position; the position of one step is determined as the focus of the focus from the step remaining after the culling according to the gradation contrast value.
  • the scheme eliminates the step in the object distance range of other steps, so that the newly obtained stepping object distance ranges do not coincide, reducing the number of motor movements and the stepping distance of the motor movement. It has also been changed to achieve fast autofocus without affecting its image quality and improving the user experience.
  • the newly obtained stepped object distance ranges do not coincide, reducing motor movement.
  • the number of times, and the moving step size of the motor have also been changed, thereby achieving fast autofocus without affecting the image quality and improving the user experience.

Landscapes

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

Abstract

An autofocusing method and device. The autofocusing method comprises: acquiring a blurring diameter value of an image sensor of a terminal, an aperture value of a lens and a motion parameter of a motor (S401); calculating object distance ranges of various steps of the motor according to the blurring diameter value, the aperture value of the lens and the motion parameter of the motor (S402); eliminating a step of which the object distance range is within object distance ranges of other steps from the steps (S403); acquiring grey contrast values of locations corresponding to the remaining steps after the elimination (S407); and determining, according to the grey contrast values, the location of a step as a focused focus point from the remaining steps after the elimination (S406). The invention solves the problem in the relevant art that the imaging quality is poor caused by an inaccurate focusing due to a fixed speed and step of a motor, and realizes a rapid autofocusing without affecting the imaging quality, thereby improving the user experience.

Description

一种自动对焦的方法及装置Method and device for autofocus 技术领域Technical field
本发明涉及数字图像处理技术领域,尤其涉及一种自动对焦的方法及装置。The present invention relates to the field of digital image processing technologies, and in particular, to a method and apparatus for autofocus.
背景技术Background technique
近几年,随着技术的进步和发展,拍照电子设备(终端)已经成为人们生活不可或缺的部分,特别是智能手机平板电脑等,改变了人们的生活方式。其中,终端自动对焦的方法及装置是决定终端成像质量的最重要因素之一。In recent years, with the advancement and development of technology, camera electronic devices (terminals) have become an indispensable part of people's lives, especially smartphone tablet computers, which have changed people's lifestyles. Among them, the method and device for terminal autofocus is one of the most important factors determining the image quality of the terminal.
根据光学原理,要拍摄到清晰的图像,镜头的焦距(f)、物距(u)及像距(v)需要满足:
Figure PCTCN2015086686-appb-000001
,当图像清晰时,图像的锐度和细节丰富,在空间域表现为相邻的像素点的灰度对比度值最大。根据这个原理,通过提取图像的对焦窗的轮廓和边缘的灰度对比度值,对焦状态下的图像的灰度对比度值最大。因此通过马达带动镜头移动,改变像距,同时实时计算获取图像的灰度对比度值,灰度对比度值最大的位置即为焦点位置。
According to the optical principle, to capture a clear image, the focal length (f), object distance (u) and image distance (v) of the lens need to meet:
Figure PCTCN2015086686-appb-000001
When the image is clear, the sharpness and detail of the image are rich, and in the spatial domain, the grayscale contrast value of the adjacent pixel points is the largest. According to this principle, the grayscale contrast value of the image in the in-focus state is maximized by extracting the contour of the focus window of the image and the grayscale contrast value of the edge. Therefore, the lens is moved by the motor to change the image distance, and the grayscale contrast value of the acquired image is calculated in real time, and the position where the grayscale contrast value is the largest is the focus position.
如图1所示,为相关技术中灰度对比度与像距的二维图,由图1可以得到,灰度对比度曲线有三个特性,1)单峰性,就是只有一个灰度对比度最大值;2)单调性,就是在灰度对比度最大值两侧,灰度对比度曲线单调递减或者递减;3)极性,可以判断当前对焦位置是在焦前还是焦后。As shown in FIG. 1 , a two-dimensional map of gray contrast and image distance in the related art can be obtained from FIG. 1 , and the gray contrast curve has three characteristics, 1) unimodality, that is, only one gray contrast maximum; 2) Monotonicity, that is, on both sides of the grayscale contrast maximum, the grayscale contrast curve monotonically decreases or decreases; 3) polarity, it can be judged whether the current focus position is before or after the focus.
在相关技术中,要实现对焦,镜头从起始位置开始移动到结束位置,整个行程按照固定速度、固定步长和固定步数完成,由于镜头的物距和像距并不是线性关系,如图2所示。这种方法存在以下缺陷:如果步长小则步数增加导致对焦时间太长,如果步长大,则导致对焦不准确和不稳定。 In the related art, to achieve focusing, the lens moves from the starting position to the ending position, and the entire stroke is completed according to a fixed speed, a fixed step size, and a fixed step number, since the object distance and the image distance of the lens are not linear, as shown in the figure. 2 is shown. This method has the following drawbacks: if the step size is small, the number of steps increases, causing the focusing time to be too long, and if the step size is large, the focus is inaccurate and unstable.
发明内容Summary of the invention
本发明实施例提供了一种自动对焦的方法及装置,解决了相关技术中由于马达的速度、步长等的固定不能准确对焦,导致成像质量差的问题。The embodiment of the invention provides a method and a device for autofocusing, which solves the problem that the image quality is poor due to the fixed speed and step size of the motor cannot be accurately focused in the related art.
为了解决上述问题,本发明实施例采用以下技术方案:一种自动对焦的方法,包括:获取终端的图像传感器的模糊直径值、镜头的光圈值以及马达的运动参数;根据所述模糊直径值、镜头的光圈值以及马达的运动参数计算所述马达各个步进的物距范围;在所述步进中剔除掉其物距范围在其他步进的物距范围内的步进;获取剔除后剩下的各个步进的对应位置的灰度对比度值;根据所述灰度对比度值从剔除后剩下的步进中确定出一个步进的位置作为对焦的焦点。In order to solve the above problem, the embodiment of the present invention adopts the following technical solution: a method for autofocusing, comprising: acquiring a blur diameter value of an image sensor of a terminal, an aperture value of a lens, and a motion parameter of the motor; according to the blur diameter value, The aperture value of the lens and the motion parameter of the motor calculate a range of object distances of the steps of the motor; in the stepping step, the step of the object distance range in the range of the object distance of other steps is removed; The grayscale contrast value of the corresponding position of each step is determined; a step position is determined as the focus of the focus from the step remaining after the culling according to the gradation contrast value.
可选地,根据所述灰度对比度值从剩下的步进中确定出一个步进的位置作为对焦的焦点包括:选择满足以下公式:
Figure PCTCN2015086686-appb-000002
当n2>i时,An=Xi,的剔除后剩下的步进作为第一对焦步进;通过控制马达运动推动对焦窗口从近到远对所述第一对焦步进对应的位置分别对焦,当所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Xi为剩下的步进,An为第一对焦步进,i、n为正整数。
Optionally, determining a position of the step from the remaining steps according to the grayscale contrast value as a focus of focus includes: selecting to satisfy the following formula:
Figure PCTCN2015086686-appb-000002
When n 2 >i, A n =X i , the remaining step after culling is used as the first focus step; by controlling the motor motion to push the focus window from near to far to the position corresponding to the first focus step Focusing separately, when an inflection point occurs in the gradation contrast value of the position corresponding to three consecutive steps in the first focus step, selecting two of the positions corresponding to the consecutive three steps are larger Any position corresponding to the step is used as the focus of the focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of the focus; X i is the remaining step, and A n is the first focus step , i, n are positive integers.
可选地,当所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点还包括:选择满足以下公式:Bn=X(NA-3n),当3n≤NA时,Bn=X1,的剔除后剩下的步进作为第二对焦步进;通过控制马达运动推动对焦窗口从远到近对所述第二对焦步进对应的位置分别对焦,当 所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;NA为所述第一对焦步进中确定出的最远的步进的编号,Bn为第二对焦步进。Optionally, when the gray contrast value of the position corresponding to the three consecutive steps in the first focus step has an inflection point, the method further includes: selecting to satisfy the following formula: B n =X (NA-3n) , when 3n≤N A , B n = X 1 , the remaining step after culling as the second focus step; by controlling the motor motion to push the focus window from far to near to focus on the position corresponding to the second focus step, when An inflection point occurs in a grayscale contrast value of a position corresponding to three consecutive steps in the second focus step, and then a step in which the gray contrast value is larger in the position corresponding to the three consecutive steps is selected. Corresponding any position as the focus of focus; otherwise, the position corresponding to the step with the largest grayscale contrast value is selected as the focus of focus; N A is the number of the farthest step determined in the first focus step , B n is the second focus step.
可选地,当所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后还包括:选择满足:Cn=X(NB+n),的剔除后剩下的步进作为第三对焦步进;通过马达运动推动对焦窗口从近到远对所述第三对焦步进分别对焦,当所述第三对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值最大的步进对应的位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Cn为第三对焦步进,NB为所述第二对焦步进中确定的最近的步进的编号。Optionally, after the inflection point occurs in the grayscale contrast value of the position corresponding to the three consecutive steps in the second focus step, the method further includes: selecting to satisfy: C n =X (NB+n) , after the culling is left Stepping as a third focusing step; pushing the focusing window by motor motion to focus on the third focusing step from near to far, respectively, when the third focusing step is grayed out corresponding to three consecutive steps If an inflection point occurs in the degree contrast value, the position corresponding to the step with the largest gray contrast value in the position corresponding to the three consecutive steps is selected as the focus of the focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the position Focus of focus; C n is a third focus step, and N B is the number of the most recent step determined in the second focus step.
可选地,将所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第一阈值,将所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第二阈值,所述焦点的灰度对比度值大于第二阈值,所述第二阈值大于第一阈值;获取当前对焦窗口的灰度对比度值,如果当前的灰度对比度值大于第二阈值,小于焦点的灰度对比度值,则执行选择第三对焦步进的步骤;如果当前的灰度对比度值大于第一阈值,小于第二阈值,则执行选择第二对焦步进的步骤;如果当前的灰度对比度值小于第一阈值,则执行选择第一对焦步进的步骤。Optionally, determining a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the first focusing step as the first threshold, and the second focusing step The grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the three consecutive steps is determined as a second threshold, and the grayscale contrast value of the focus is greater than the second threshold, the second threshold And greater than the first threshold; acquiring a grayscale contrast value of the current focus window, if the current grayscale contrast value is greater than the second threshold, less than the grayscale contrast value of the focus, performing the step of selecting the third focus step; if the current gray If the degree contrast value is greater than the first threshold, less than the second threshold, the step of selecting the second focus step is performed; if the current gray level contrast value is less than the first threshold, the step of selecting the first focus step is performed.
可选地,所述马达运动的速度大小是根据相邻两个焦点之间的距离大 小进行控制的。Optionally, the speed of movement of the motor is greater according to a distance between two adjacent focal points Small control.
一种自动对焦的装置,包括:参数获取模块,设置为获取终端内图像传感器的模糊直径值、镜头的光圈值以及马达的运动参数;物距范围计算模块,设置为根据所述模糊直径值、镜头的光圈值以及马达的运动参数计算所述马达各个步进的物距范围;步进剔除模块,设置为在所述步进中剔除掉其物距范围在其他步进的物距范围内的步进;灰度对比度获取模块,设置为获取剔除后剩下的各个步进的对应位置的灰度对比度值;焦点确定模块,设置为根据所述灰度对比度值从剔除后剩下的步进中确定出一个步进的位置作为对焦的焦点。An apparatus for autofocusing, comprising: a parameter acquisition module, configured to acquire a blur diameter value of an image sensor in the terminal, an aperture value of the lens, and a motion parameter of the motor; and a distance range calculation module configured to be based on the blur diameter value, The aperture value of the lens and the motion parameter of the motor calculate a range of object distances of the various steps of the motor; the step culling module is configured to remove the object distance range in the step by other distances in the stepping distance Stepping; a grayscale contrast obtaining module, configured to obtain a grayscale contrast value of a corresponding position of each step remaining after the culling; the focus determining module is set to a step that is left after the culling according to the grayscale contrast value Determines the position of a step as the focus of focus.
可选地,所述焦点确定模块包括:第一对焦步进选择子模块,设置为选择满足以下公式:
Figure PCTCN2015086686-appb-000003
,当n2>i时,An=Xi,的剔除后剩下的步进作为第一对焦步进;第一焦点确定子模块,设置为通过控制马达运动推动对焦窗口从近到远对所述第一对焦步进对应的位置分别对焦,当所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Xi为剩下的步进,An为第一对焦步进,i、n为正整数。
Optionally, the focus determining module comprises: a first focus step selection sub-module, configured to select the following formula:
Figure PCTCN2015086686-appb-000003
When n 2 >i, A n =X i , the remaining step after culling is used as the first focus step; the first focus determination sub-module is set to push the focus window from near to far by controlling motor motion The positions corresponding to the first focus step are respectively focused, and when an inflection point occurs in the gray contrast value of the position corresponding to three consecutive steps in the first focus step, the position corresponding to the three consecutive steps is selected. Any position corresponding to the two steps with a large grayscale contrast value is used as the focus of focus; otherwise, the position corresponding to the step with the largest grayscale contrast value is selected as the focus of focus; X i is the remaining step In, A n is the first focus step, and i and n are positive integers.
可选地,所述焦点确定模块还包括:第二对焦步进选择子模块,设置为当所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,选择满足以下公式:Bn=X(NA-3n),当3n≤NA时,Bn=X1,的剔除后剩下的步进作为第二对焦步进;第二焦点确定子模块,设置为通过控制马达运动推动对焦窗口从远到近对所述第二对焦步进 对应的位置分别对焦,当所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;NA为所述第一对焦步进中确定出的最远的步进的编号,Bn为第二对焦步进。Optionally, the focus determining module further includes: a second focus step selection sub-module, configured to select an inflection point after the gray-scale contrast value of the position corresponding to three consecutive steps in the first focus step The following formula is satisfied: B n =X (NA-3n) , when 3n≤N A , B n =X 1 , the remaining step after culling is used as the second focus step; the second focus determination sub-module, setting In order to control the movement of the motor to push the focus window to focus on the position corresponding to the second focus step from far to near, when the gray contrast value of the position corresponding to three consecutive steps in the second focus step has an inflection point And selecting any position corresponding to the two steps with the larger gray contrast value in the position corresponding to the three consecutive steps as the focus of the focus; otherwise, selecting the step corresponding to the maximum gray contrast value The position is the focus of focus; N A is the number of the farthest step determined in the first focus step, and B n is the second focus step.
可选地,所述焦点确定模块还包括:第三对焦步进选择子模块,设置为当所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,选择满足:Cn=X(NB+n),的剔除后剩下的步进作为第三对焦步进;第三焦点确定子模块,设置为通过马达运动推动对焦窗口从近到远对所述第三对焦步进分别对焦,当所述第三对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值最大的步进对应的位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Cn为第三对焦步进,NB为所述第二对焦步进中确定的最近的步进的编号。Optionally, the focus determining module further includes: a third focus step selection sub-module, configured to select an inflection point after the gray-scale contrast value of the position corresponding to three consecutive steps in the second focus step Satisfying: C n =X (NB+n) , the remaining step after culling is used as the third focus step; the third focus determining sub-module is set to push the focus window from near to far by the motor motion to the first The three focus steps are separately focused, and when the gray contrast value of the position corresponding to the three consecutive steps in the third focus step has an inflection point, the gray contrast value of the position corresponding to the three consecutive steps is selected to be the largest. The corresponding position of the step is used as the focus of focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of focus; C n is the third focus step, and N B is the second focus step Determine the number of the most recent step.
可选地,还包括:阈值确定模块,设置为将所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第一阈值,将所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第二阈值,所述焦点的灰度对比度值大于第二阈值,所述第二阈值大于第一阈值;处理模块,设置为获取当前对焦窗口的灰度对比度值,如果当前的灰度对比度值大于第二阈值,小于焦点的灰度对比度值,则向所述第三对焦步进选择子模块发送触发启动指令;如果当前的灰度对比度值大于第一阈值,小于第二阈值,则向所述第二对焦步进选择子模块发送触发启动指令;如 果当前的灰度对比度值小于第一阈值,则向所述第一对焦步进选择子模块发送触发启动指令。Optionally, the method further includes: a threshold determining module, configured to determine a grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the position corresponding to three consecutive steps in the first focusing step as the first a threshold value, where a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the second focus step is determined as a second threshold, and the grayscale contrast value of the focus is greater than a second threshold, the second threshold is greater than the first threshold; the processing module is configured to obtain a grayscale contrast value of the current focus window, and if the current grayscale contrast value is greater than the second threshold, less than the grayscale contrast value of the focus, Sending a trigger start command to the third focus step selection submodule; if the current gray scale contrast value is greater than the first threshold and less than the second threshold, sending a trigger start command to the second focus step selection submodule; Such as If the current grayscale contrast value is less than the first threshold, a triggering start command is sent to the first focus step selection submodule.
本发明实施例的有益效果:Advantageous effects of embodiments of the present invention:
本发明实施例提供了一种自动对焦的方法及装置,通过获取终端的图像传感器的模糊直径值、镜头的光圈值以及马达的运动参数来计算马达的各个步进的物距范围,并剔除掉其物距范围在其他步进的物距范围内的步进,再获取剔除后剩下的各个步进的对应位置的灰度对比度值;根据所述灰度对比度值从剔除后剩下的步进中确定出一个步进的位置作为对焦的焦点。本方案通过将在其他步进的物距范围内的步进进行剔除,使得新得到的步进的物距范围之间不会重合,减少了马达移动的次数,且马达的移动步长也进行了改变,从而实现了快速自动对焦,也不会影响其成像质量,提升了用户体验。Embodiments of the present invention provide a method and apparatus for autofocusing, which are obtained by acquiring a blur diameter value of an image sensor of a terminal, an aperture value of a lens, and a motion parameter of a motor, and calculating a range of object distances of each step of the motor, and rejecting a step of the object distance in the range of the object distance of the other steps, and then obtaining the gray contrast value of the corresponding position of each step remaining after the culling; the remaining steps after the gradation according to the gradation value Into the middle to determine a step position as the focus of focus. The scheme eliminates the steps in the object distance range of other steps, so that the newly obtained stepping object distance range does not overlap, the number of motor movements is reduced, and the moving step of the motor is also performed. The change has been made to achieve fast autofocus without affecting its image quality and improving the user experience.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1为终端中灰度对比度与像距的二维图;Figure 1 is a two-dimensional map of gray scale contrast and image distance in the terminal;
图2为像距与物距的曲线图;Figure 2 is a graph of image distance and object distance;
图3为本发明实施例一提供的自动对焦的方法流程图;3 is a flowchart of a method for autofocus according to Embodiment 1 of the present invention;
图4为本发明实施例一提供的自动多次对焦的方法的详细流程图;4 is a detailed flowchart of a method for automatic multiple focus according to Embodiment 1 of the present invention;
图5为本发明实施例一提供的像距与灰度对比度的曲线图;FIG. 5 is a graph of image distance and gray scale contrast according to Embodiment 1 of the present invention; FIG.
图6为本发明实施例二提供的自动对焦的装置的结构示意图。FIG. 6 is a schematic structural diagram of an apparatus for autofocus according to Embodiment 2 of the present invention.
具体实施方式 detailed description
下面通过具体实施方式结合附图对本发明作进一步详细说明。The present invention will be further described in detail below with reference to the accompanying drawings.
实施例一:Embodiment 1:
如图3所示,为本发明实施例一提供的自动对焦的方法流程图,请参见图3,As shown in FIG. 3 , a flowchart of a method for autofocus according to Embodiment 1 of the present invention is shown in FIG. 3 .
S301:获取终端的图像传感器的模糊直径值、镜头的光圈值以及马达的运动参数;S301: Acquire a blur diameter value of an image sensor of the terminal, an aperture value of the lens, and a motion parameter of the motor;
在本发明实施例的终端包括:手机、平板、掌上电脑、照相机、摄影机等;马达的运动参数包括:马达行程及马达带动镜头运动时的震荡频率和震荡时间;在本实施例中,通过读取写入在终端存储器中的参数来获取图像传感器的模糊直径值、镜头的光圈值、马达行程及马达带动镜头运动时的震荡频率和震荡时间;对于马达运动时的震荡频率和震荡时间也可以通过专门的测量仪来进行测量得到;The terminal in the embodiment of the present invention includes: a mobile phone, a tablet, a palmtop computer, a camera, a camera, etc.; the motion parameters of the motor include: the motor stroke and the oscillation frequency and the oscillation time when the motor drives the lens to move; in this embodiment, by reading The parameters written in the terminal memory are taken to obtain the blur diameter value of the image sensor, the aperture value of the lens, the motor stroke, and the oscillation frequency and the oscillation time when the motor drives the lens movement; the oscillation frequency and the oscillation time for the motor motion can also be Measured by a special measuring instrument;
S302:根据模糊直径值、镜头的光圈值以及马达的运动参数计算马达各个步进的物距范围;S302: Calculate a range of object distances of each step of the motor according to the fuzzy diameter value, the aperture value of the lens, and the motion parameter of the motor;
需要说明的是,在终端的图像传感器中,都是根据模糊直径值、镜头的光圈值以及马达的运动参数来设置马达的每步步进的长度和速度的;马达行程与步进的长度的关系为:
Figure PCTCN2015086686-appb-000004
其中S为马达行程,u为步进的长度;不同的马达配合不同镜头,马达震荡频率和震荡时间是不同的;马达的运动速度和震荡时间的关系为vi=f'.F(tf),vi为运动速度,tf为震荡时间,f'为震荡频率;对于马达中每移动一步,其各个步进对应的物距范围包括:近端物距极限(Near Focus Limit):
Figure PCTCN2015086686-appb-000005
和远端物距极限(Far Focus Limit):
Figure PCTCN2015086686-appb-000006
其中H为超焦距,
Figure PCTCN2015086686-appb-000007
A为镜头光圈值,d为图像传感器模糊直径;通过以上方式计算出马达每一步进移动后相对应的uN和uF
It should be noted that, in the image sensor of the terminal, the length and speed of each step of the motor are set according to the blur diameter value, the aperture value of the lens, and the motion parameter of the motor; the length of the motor stroke and the stepping speed The relationship is:
Figure PCTCN2015086686-appb-000004
Where S is the motor stroke and u is the length of the step; different motors are matched with different lenses, the motor oscillation frequency and the oscillation time are different; the relationship between the motor speed and the oscillation time is v i =f'.F(t f ), v i is the motion speed, t f is the oscillation time, and f′ is the oscillation frequency; for each step of moving in the motor, the object distance range corresponding to each step includes: Near Focus Limit:
Figure PCTCN2015086686-appb-000005
And Far Focus Limit:
Figure PCTCN2015086686-appb-000006
Where H is the hyperfocal distance,
Figure PCTCN2015086686-appb-000007
A is the lens aperture value, and d is the image sensor blur diameter; the corresponding u N and u F after each step movement of the motor are calculated by the above method;
S303:在步进中剔除掉其物距范围在其他步进的物距范围内的步进;S303: Stepping out the step of the object distance range in the stepping distance of the other step in the stepping;
可选地,可以通过相邻步进的物距范围两两比较方式得到:比较相邻步进中uN和uF的值,选择出可以覆盖其他对焦物距的步进,也即,将其物距范围在其他物距范围内的步进进行剔除,使得在剩下的步进中,相邻步进的距离不再相同,从而使得马达的每步移动的距离不再相同,但其同样能够覆盖其本身可以覆盖的物距范围,及在本步骤中,是将多余的步进进行剔除;如,在本实施例中,假设马达新的移动步进为Xi,其中Xi为剔除后剩下的步进,i为正整数,即马达将根据新的步进Xi对应的位置进行移动,则其完成整个马达的形成所移动的步数将得到减小;Alternatively, it can be obtained by comparing the object distance ranges of adjacent steps by comparing the values of u N and u F in adjacent steps, and selecting a step that can cover other focus objects, that is, The object distance range is eliminated in steps of other object distances, so that in the remaining steps, the distances of adjacent steps are no longer the same, so that the distance of each step of the motor is no longer the same, but It is also possible to cover the range of object distances that it can cover, and in this step, the extra steps are eliminated; for example, in this embodiment, it is assumed that the new moving step of the motor is X i , where X i is After the culling, the step remaining, i is a positive integer, that is, the motor will move according to the position corresponding to the new step X i , and the number of steps for completing the formation of the entire motor will be reduced;
S304:获取剔除后剩下的各个步进的对应位置的灰度对比度值;S304: Obtain a grayscale contrast value of a corresponding position of each step remaining after the culling;
马达每移动一个步进,在该步进对应的位置中,都存在一个相应的灰度对比度值;对于每个步进对应位置的灰度对比度值得获取,通常是通过控制马达移动到该步进的对应位置,并对该位置进行对焦,从而得到该对焦视窗内像素点的灰度对比度值;Each time the motor moves one step, there is a corresponding grayscale contrast value in the corresponding position of the step; the grayscale contrast value corresponding to each step corresponding position is obtained, usually by controlling the motor to move to the stepping Corresponding position, and focusing on the position, thereby obtaining a grayscale contrast value of the pixel in the focus window;
S305:根据灰度对比度值从剔除后剩下的步进中确定出一个步进的位置作为对焦的焦点;S305: determining, according to the grayscale contrast value, a step position from the step remaining after the culling as a focus of focusing;
在本实施例中,通过控制马达对各个剔除后剩下的步进的对应位置进行对焦,得到各个步进对应的灰度对比度值,在得到的灰度对比度值中选择灰度对比度最大的值对应的步进的位置作为对焦的焦点,或者,选择灰度对比度值属于满足高清晰度的成像的范围内的灰度对比度值得步进的位置作为对焦的焦点。在本实施例中,通过剔除掉与其他步进的物距范围 重复的步进,减小了马达的移动次数,而其成像的质量没有下降,且能够达到快速对焦的可能,提高了用户的使用体验。In this embodiment, by controlling the motor to focus on the corresponding positions of the steps remaining after each culling, the gradation contrast values corresponding to the respective steps are obtained, and the maximum gradation contrast value is selected among the obtained gradation contrast values. The position of the corresponding step is used as the focus of the focus, or the position where the gradation contrast value is selected to be in the range of the image in which the high-definition imaging is satisfied is determined as the focus of the focus. In this embodiment, by removing the range of object distances from other steps The repeated stepping reduces the number of movements of the motor, and the quality of the imaging is not degraded, and the possibility of fast focusing can be achieved, thereby improving the user experience.
优选地,步骤S104根据灰度对比度值从剩下的步进中确定出一个步进的位置作为对焦的焦点包括:选择满足以下公式:
Figure PCTCN2015086686-appb-000008
,当n2>i时,An=Xi,的剔除后剩下的步进作为第一对焦步进;通过控制马达运动推动对焦窗口从近到远对第一对焦步进对应的位置分别对焦,当第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Xi为剩下的步进,An为第一对焦步进,i、n为正整数;在本实施例中,通过将满足上述公式的步进选择出来作为第一对焦步进,且只对所选择的第一对焦步进进行对焦,从近到远计算相应的步进的位置的灰度对比度值,当第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,则不需要对其他第一对焦步进的位置进行对焦处理,只需在连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;任一位置包括灰度对比度值较大的两个步进之间的任一步进对应的位置,或者灰度对比度值较大的两个步进之间的任一剔除后剩下的步进对应的位置;选择该任一位置作为对焦的焦点不仅能实现对焦准确,成像清晰的目的,而且,在进行对焦的过程中,只需连续三个步进对应的位置的灰度对比度值出现拐点后就不需要再继续对焦,从而更加快速地找到焦点,实现对焦的可能。
Preferably, step S104 determines a position of the step from the remaining steps according to the grayscale contrast value as the focus of the focus includes: selecting to satisfy the following formula:
Figure PCTCN2015086686-appb-000008
When n 2 >i, A n =X i , the remaining step after culling is used as the first focus step; by controlling the motor motion, pushing the focus window from near to far to the position corresponding to the first focus step respectively Focusing, when an inflection point occurs in the grayscale contrast value of the position corresponding to three consecutive steps in the first focusing step, the corresponding two steps of the grayscale contrast value corresponding to the position corresponding to three consecutive steps are selected. Any position is the focus of focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of focus; X i is the remaining step, A n is the first focus step, i, n are A positive integer; in this embodiment, by selecting a step that satisfies the above formula as the first focus step, and focusing only on the selected first focus step, calculating the corresponding step from near to far The grayscale contrast value of the position, after the inflection point occurs in the grayscale contrast value of the position corresponding to three consecutive steps in the first focus step, the focus processing of the other first focus step positions is not required, only in the The position corresponding to three consecutive steps Any position corresponding between two steps with a large gray-scale contrast value as a focus of focus; any position includes a position corresponding to any step between two steps with a large gray-scale contrast value, Or the position corresponding to the remaining step after any culling between the two steps with a large grayscale contrast value; selecting any of the positions as the focus of the focus can not only achieve accurate focus, but also clear imaging, and In the process of focusing, it is only necessary to continue the focus after the inflection point of the gray contrast value of the corresponding position of three consecutive steps, so that the focus can be found more quickly and the focus can be achieved.
在本实施例中,由于第一焦点得到的两个步进之间的位置较大,通过选择得到的对焦的焦点相对误差也会较大,为了更加精确地得到其对焦焦 点的位置,从而需要缩小其选择的范围,其缩小选择范围的步骤包括:当第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,选择满足以下公式:Bn=X(NA-3n),当3n≤NA时,Bn=X1,的剔除后剩下的步进作为第二对焦步进;通过控制马达运动推动对焦窗口从远到近对第二对焦步进对应的位置分别对焦,即在本次对焦过程中,是在对第一对焦步进的对焦停止后,也即在第一对焦步进中的灰度对比度值出现拐点时;当第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;NA为第一对焦步进中确定出的最远的步进的编号,Bn为第二对焦步进;在本实施例中,通过将满足上述公式的步进选择出来作为第二对焦步进,且只对所选择的第二对焦步进对焦,从远到近计算相应的步进的位置的灰度对比度值,当第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,则不需要对其他第二对焦步进的位置进行对焦处理,只需在连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;同样地,任一位置包括灰度对比度值较大的两个步进之间的任一步进对应的位置,或者灰度对比度值较大的两个步进之间的任一剔除后剩下的步进对应的位置;选择该任一位置作为对焦的焦点更加可选地实现对焦的准确性的可能。In this embodiment, since the position between the two steps obtained by the first focus is large, the relative error of the focus of the focus obtained by the selection is also large, in order to obtain the position of the focus focus more accurately, thereby requiring The range of the selection is reduced, and the step of narrowing the selection range includes: when an inflection point occurs in the gray contrast value of the position corresponding to three consecutive steps in the first focus step, the following formula is satisfied: B n =X (NA- 3n) , when 3n ≤ N A , B n = X 1 , the remaining step after culling as the second focus step; by controlling the motor motion to push the focus window from far to near corresponding to the second focus step The position is respectively focused, that is, during the current focusing process, after the focus of the first focus step is stopped, that is, when the gradation contrast value in the first focus step has an inflection point; when the second focus step is in progress If an inflection point occurs in the gray contrast value of the position corresponding to the three consecutive steps, any position corresponding to the two steps with the larger gray contrast value in the position corresponding to the three consecutive steps is selected as the focus of the focus; Otherwise, choose The position corresponding to the step with the largest gray scale contrast value is taken as the focus of the focus; N A is the number of the farthest step determined in the first focus step, and B n is the second focus step; in this embodiment In the middle, by selecting the step that satisfies the above formula as the second focus step, and focusing only on the selected second focus step, calculating the gray contrast value of the corresponding step position from far to near, when After the inflection point occurs in the gray contrast value of the position corresponding to the three consecutive steps in the second focus step, the position of the other second focus step is not required to be focused, and only needs to be in the position corresponding to three consecutive steps. Any position corresponding to the two steps with a large grayscale contrast value is used as the focus of the focus; likewise, any position includes any step between the two steps with a large grayscale contrast value. Position, or the position corresponding to the remaining step after any culling between the two steps with a large grayscale contrast value; selecting any of the positions as the focus of the focus more selectively achieves the accuracy of the focus may.
可选地,为了使得确定的对焦的焦点的位置的范围更加准确,当第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后还包括:选择满足:Cn=X(NB+n),的剔除后剩下的步进作为第三对焦步进;通过马达运动推动对焦窗口从近到远对第三对焦步进分别对焦,当第三对焦 步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值最大的步进对应的位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Cn为第三对焦步进,NB为第二对焦步进中确定的最近的步进的编号;通过上述三个步骤分别从近到远、从远到近、再从近到远地进行控制马达进行运动,并分别对焦得到各个步进的位置的灰度对比度值,最终得到本终端中,灰度对比度值最准确地步进位置,这样,通过将该灰度对比度值与当前获取的灰度对比度值进行比较,得到应该如何控制马达的运动使得当前的拍摄所得到的照片的质量最佳。Optionally, in order to make the range of the determined focus of the focus more accurate, after the inflection point occurs in the gray contrast value of the position corresponding to the three consecutive steps in the second focus step, the selection further includes: C n = X (NB+n) , the remaining step after culling is used as the third focus step; the focus window is pushed by the motor motion to focus on the third focus step from near to far, and the third focus step is three consecutively If the grayscale contrast value of the corresponding position of the step has an inflection point, the position corresponding to the step with the largest gray contrast value among the positions corresponding to the three consecutive steps is selected as the focus of the focus; otherwise, the grayscale contrast value is selected to be the largest. The corresponding position of the step is used as the focus of focus; C n is the third focus step, and N B is the number of the nearest step determined in the second focus step; through the above three steps, from near to far, from far Control the motor to move to the near and then from near to far, and separately focus to obtain the gray contrast value of each step position, and finally obtain the most accurate step position of the gray contrast value in the terminal. , Compared with the gradation current contrast value acquired by the gradation contrast value, how to obtain a controlled movement of the motor current so that the quality of the resulting photographs captured best.
可选地对当前需要拍摄的目标进行对焦的方法包括:首先将第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第一阈值,将第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第二阈值,将第三步进中连续三个步进对应的位置的灰度对比度值出现拐点的位置的灰度对比度值最大的作为焦点的灰度对比度值,焦点的灰度对比度值大于第二阈值,第二阈值大于第一阈值;获取当前对焦窗口的灰度对比度值,如果当前的灰度对比度值大于第二阈值,小于焦点的灰度对比度值,则执行选择第三对焦步进的步骤,从而得到拍摄当前目标的准确对焦;如果当前的灰度对比度值大于第一阈值,小于第二阈值,则执行选择第二对焦步进的步骤,同样地,在执行完对第二对焦步进的步骤后,为了对焦的准确性,需要继续执行第三独角步进的步骤,这样所确定的对焦焦点将更加准确;如果当前的灰度对比度值小于第一阈值,则执行选择第一对焦步进的步骤,这样情况与上述情况类似,在此不再累述。Optionally, the method for focusing on a target that needs to be photographed currently includes: first, determining a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the first focus step as the first a threshold value, determining a grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the three consecutive steps in the second focus step as a second threshold, and three consecutive steps in the third step The grayscale contrast value of the corresponding position appears as the grayscale contrast value of the focus of the inflection point, the grayscale contrast value of the focus is greater than the second threshold, and the second threshold is greater than the first threshold; acquiring the current focus The grayscale contrast value of the window, if the current grayscale contrast value is greater than the second threshold and less than the grayscale contrast value of the focus, the step of selecting the third focus step is performed, thereby obtaining an accurate focus of the current target; if current The grayscale contrast value is greater than the first threshold, and less than the second threshold, the step of selecting the second focus step is performed, and similarly, the execution is performed. After the step of the second focus step, in order to focus the accuracy, it is necessary to continue the step of performing the third one-step step, so that the determined focus focus will be more accurate; if the current gray scale contrast value is less than the first threshold, Then, the step of selecting the first focus step is performed, and the situation is similar to the above case, and will not be described here.
需要说明的是,在终端中,马达运动的速度大小是根据相邻两个步进 之间的距离大小进行控制的。为了减少惯性和马达自身震荡引起的干扰,在上述确定各个对焦步进的灰度对比度值得过程中马达的速度也是变化的。例如,对于第一对焦步进的位置灰度对比度值的确定,其扫描的速度为x1,对于第二对焦步进的位置灰度对比度值的确定,其扫描的速度为x2,对于第三对焦步进的位置灰度对比度值的确定,其扫描的速度为x3;其中存在以下条件:x1=x2k1=x3k2,0<k2<k1<1。It should be noted that in the terminal, the speed of the motor movement is controlled according to the distance between two adjacent steps. In order to reduce the interference caused by the inertia and the motor's own oscillation, the speed of the motor also changes during the above-described determination of the grayscale contrast value of each focus step. For example, for the determination of the position gradation contrast value of the first focus step, the scanning speed is x 1 , and for the determination of the position gradation contrast value of the second focus step, the scanning speed is x 2 , for the first The determination of the position gray scale contrast value of the three focus step is that the scanning speed is x 3 ; wherein the following condition exists: x 1 = x 2 k 1 = x 3 k 2 , 0 < k 2 < k 1 < 1.
例如,以下详细介绍具体实施例对本方案中自动完成多次对焦的方法进行说明,如图4所示,为本发明实施例一提供的自动多次对焦的方法的详细流程图,请参见图4及图5,For example, the following describes in detail a specific embodiment to describe a method for automatically performing multiple times of focusing in the present solution. As shown in FIG. 4 , a detailed flowchart of a method for automatic multiple focus according to Embodiment 1 of the present invention is shown in FIG. 4 . And Figure 5,
S401:读取写入在终端的存储器中的图像传感器的模糊直径、镜头的光圈、马达行程及马达带动镜头运动时的震荡频率和震荡时间;S401: reading a blur diameter of an image sensor written in a memory of the terminal, an aperture of the lens, a motor stroke, and an oscillation frequency and an oscillation time when the motor drives the lens to move;
S402:根据模糊直径、镜头的光圈、马达行程及马达带动镜头运动时的震荡频率和震荡时间计算出马达的每一步进移动后相对应物距范围;S402: calculating a corresponding object distance range after each step movement of the motor according to the blur diameter, the aperture of the lens, the motor stroke, and the oscillation frequency and the oscillation time when the motor drives the lens to move;
S403:比较相邻步进的位置的物距范围,将其物距范围在包含在其他步进的物距范围的步进进行剔除,得到剔除后剩下的步进,该步进对应的位置设置为XiS403: Comparing the object distance range of the position of the adjacent step, and removing the object distance range from the step included in the object distance range of the other step, and obtaining the step remaining after the culling, the corresponding position of the step Set to X i ;
S404:选择满足以下公式:
Figure PCTCN2015086686-appb-000009
,当n2>i时,An=Xi,的剔除后剩下的步进作为第一对焦步进;并从近到远对第一对焦步进对应的位置分别对焦,当第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的位置确定为焦点范围,并选择其中一个较大的步进对应位置的灰度对比度值为第一阈值Y1;
S404: Select to satisfy the following formula:
Figure PCTCN2015086686-appb-000009
When n 2 >i, A n =X i , the remaining step after culling is taken as the first focus step; and the focus corresponding to the first focus step is respectively focused from near to far, when the first focus is When the gray contrast value of the position corresponding to three consecutive steps in the step has an inflection point, the position corresponding to the two steps with the larger gray contrast value in the position corresponding to the three consecutive steps is determined as the focus range. And selecting one of the larger step corresponding positions of the gray scale contrast value as the first threshold Y1;
S405:选择满足以下公式:Bn=X(NA-3n),当3n≤NA时, Bn=X1,的剔除后剩下的步进作为第二对焦步进,并从远到近对第二对焦步进对应的位置分别对焦,当第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的位置作为焦点范围,并选择其中一个较大的步进对应位置的灰度对比度值为第二阈值Y2;S405: The selection satisfies the following formula: B n =X (NA-3n) , when 3n≤N A , B n =X 1 , the remaining step after the culling is taken as the second focus step, and from far to near Selecting the position corresponding to the second focus step respectively, and when the inflection point occurs in the gray contrast value of the position corresponding to the three consecutive steps in the second focus step, selecting the gray contrast value in the position corresponding to the three consecutive steps The corresponding position between the two larger steps is taken as the focus range, and the gray contrast value of one of the larger step corresponding positions is selected as the second threshold Y2;
S406:选择满足以下公式:Cn=X(NB+n),的剔除后剩下的步进作为第三对焦步进,并从近到远对第三对焦步进对应的位置分别对焦,当第三对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值最大的步进对应的位置作为对焦的焦点,将该焦点对应的灰度对比度值为Yf,完成对焦;S406: Selecting the following formula: C n =X (NB+n) , the remaining step after the culling is used as the third focus step, and respectively focusing on the position corresponding to the third focus step from near to far, when In the third focus step, the inflection point appears in the gray contrast value of the position corresponding to the three consecutive steps, and the position corresponding to the step with the largest gray contrast value in the position corresponding to the three consecutive steps is selected as the focus of the focus, and The grayscale contrast value corresponding to the focus is Yf, and the focus is completed;
S407:t ms后,获取当前对焦窗口的灰度对比度值Y;S407: After t ms, obtaining the gray contrast value Y of the current focus window;
S408:判断是否满足Y2<Y1<Yf,若是,则转S206;若否,则转S209;S408: determining whether Y2 < Y1 < Yf is satisfied, if yes, then go to S206; if not, then go to S209;
S409:判断是否满足Y1<Y1<Y2,若是,则转S205;若否,则转S204。S409: It is judged whether Y1<Y1<Y2 is satisfied, and if yes, the process goes to S205; if not, the process goes to S204.
本实施例实现了连续对焦的可能,且能够比较快速准确地实现对焦,不仅成像质量得到提高,且节省了对焦时间,提高了用户体验。The embodiment realizes the possibility of continuous focusing, and can realize focusing relatively quickly and accurately, not only improving the imaging quality, but also saving the focusing time and improving the user experience.
实施例二:Embodiment 2:
如图6所示,为本发明实施例二提供的自动对焦的装置的结构示意图,请参见图6,自动对焦的装置60包括:参数获取模块601、物距范围计算模块602、步进剔除模块603、灰度对比度获取模块604和焦点确定模块605;参数获取模块601设置为获取终端内图像传感器的模糊直径值、镜头的光圈值以及马达的运动参数;物距范围计算模块602设置为根据模糊直径值、镜头的光圈值以及马达的运动参数计算马达各个步进的物距范围;步进剔除模块603设置为在步进中剔除掉其物距范围在其他步进的物距范围内的步进;灰度对比度获取模块604设置为获取剔除后剩下的各个 步进的对应位置的灰度对比度值;焦点确定模块605设置为根据灰度对比度值从剔除后剩下的步进中确定出一个步进的位置作为对焦的焦点。在本实施例中,通过剔除掉与其他步进的物距范围重复的步进,减小了马达的移动次数,而其成像的质量没有下降,且能够达到快速对焦的可能,提高了用户的使用体验。FIG. 6 is a schematic structural diagram of an apparatus for autofocus according to Embodiment 2 of the present invention. Referring to FIG. 6, the autofocus apparatus 60 includes: a parameter acquisition module 601, an object distance range calculation module 602, and a step rejection module. 603, a grayscale contrast acquisition module 604 and a focus determination module 605; the parameter acquisition module 601 is configured to acquire a blur diameter value of the image sensor in the terminal, an aperture value of the lens, and a motion parameter of the motor; the object distance range calculation module 602 is configured to be based on the blur The diameter value, the aperture value of the lens, and the motion parameter of the motor calculate the object distance range of each step of the motor; the step culling module 603 is configured to remove the step of the object distance range within the step distance of the other step in the stepping Grayscale contrast acquisition module 604 is set to obtain each of the remaining after culling The grayscale contrast value of the corresponding position of the step; the focus determining module 605 is configured to determine a position of the step as the focus of the focus from the step remaining after the culling according to the gradation contrast value. In this embodiment, by eliminating the step repeated with the other stepped object distance range, the number of movements of the motor is reduced, and the quality of the imaging is not degraded, and the possibility of fast focusing can be achieved, and the user's Use experience.
在实施例中,焦点确定模块605包括:第一对焦步进选择子模块,设置为选择满足以下公式:
Figure PCTCN2015086686-appb-000010
,当n2>i时,An=Xi,的剔除后剩下的步进作为第一对焦步进;第一焦点确定子模块,设置为通过控制马达运动推动对焦窗口从近到远对第一对焦步进对应的位置分别对焦,当第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Xi为剩下的步进,An为第一对焦步进,i、n为正整数。
In an embodiment, the focus determination module 605 includes a first focus step selection sub-module configured to select the following formula:
Figure PCTCN2015086686-appb-000010
When n 2 >i, A n =X i , the remaining step after culling is used as the first focus step; the first focus determination sub-module is set to push the focus window from near to far by controlling motor motion The positions corresponding to the first focus step are respectively focused. When the gray contrast value of the position corresponding to three consecutive steps in the first focus step has an inflection point, the gray contrast value in the position corresponding to the three consecutive steps is selected. Any position corresponding to the two large steps is used as the focus of focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of focus; X i is the remaining step, A n is the first A focus step, i, n is a positive integer.
可选地,焦点确定模块605还包括:第二对焦步进选择子模块,设置为当第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,选择满足以下公式:Bn=X(NA-3n),当3n≤NA时,Bn=X1,的剔除后剩下的步进作为第二对焦步进;第二焦点确定子模块,设置为通过控制马达运动推动对焦窗口从远到近对第二对焦步进对应的位置分别对焦,当第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;NA为第一对焦步进中确定出的最远的步进的 编号,Bn为第二对焦步进;Optionally, the focus determining module 605 further includes: a second focus step selection sub-module, configured to meet the following formula after the inflection point occurs in the gray-scale contrast value of the position corresponding to three consecutive steps in the first focus step; :B n =X (NA-3n) , when 3n≤N A , B n =X 1 , the remaining step after culling is used as the second focus step; the second focus determination sub-module is set to pass the control The motor motion pushes the focus window to focus on the position corresponding to the second focus step from far to near. When the gray contrast value of the position corresponding to three consecutive steps in the second focus step has an inflection point, three consecutive steps are selected. Enter any position corresponding to the two steps with a large grayscale contrast value in the corresponding position as the focus of focus; otherwise, select the position corresponding to the step with the largest grayscale contrast value as the focus of focus; N A is The number of the farthest step determined in the first focus step, B n is the second focus step;
优选地,焦点确定模块605还包括:第三对焦步进选择子模块,设置为当第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,选择满足:Cn=X(NB+n),的剔除后剩下的步进作为第三对焦步进;第三焦点确定子模块,设置为通过马达运动推动对焦窗口从近到远对第三对焦步进分别对焦,当第三对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择连续三个步进对应的位置中灰度对比度值最大的步进对应的位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Cn为第三对焦步进,NB为第二对焦步进中确定的最近的步进的编号;Preferably, the focus determining module 605 further includes: a third focus step selection sub-module configured to: when the inflection point of the gray-scale contrast value of the position corresponding to three consecutive steps in the second focus step occurs, the selection is satisfied: C n =X (NB+n) , the remaining step after culling is used as the third focus step; the third focus determination sub-module is set to push the focus window by motor motion to focus on the third focus step from near to far respectively. When an inflection point occurs in the gray contrast value of the position corresponding to three consecutive steps in the third focus step, the position corresponding to the step with the largest gray contrast value in the position corresponding to the three consecutive steps is selected as the focus of the focus. ; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of focus; C n is the third focus step, and N B is the number of the nearest step determined in the second focus step;
自动对焦的装置60还包括:阈值确定模块,设置为将第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第一阈值,将第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第二阈值,焦点的灰度对比度值大于第二阈值,第二阈值大于第一阈值;处理模块,设置为获取当前对焦窗口的灰度对比度值,如果当前的灰度对比度值大于第二阈值,小于焦点的灰度对比度值,则向第三对焦步进选择子模块发送触发启动指令;如果当前的灰度对比度值大于第一阈值,小于第二阈值,则向第二对焦步进选择子模块发送触发启动指令;如果当前的灰度对比度值小于第一阈值,则向第一对焦步进选择子模块发送触发启动指令。The autofocus device 60 further includes: a threshold determining module configured to determine a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the first focusing step as the first threshold a grayscale contrast value of one of the inflection points of the grayscale contrast value corresponding to the position of the three consecutive steps in the second focus step is determined as a second threshold, and the grayscale contrast value of the focus is greater than the second threshold, The second threshold is greater than the first threshold; the processing module is configured to obtain the grayscale contrast value of the current focus window, and if the current grayscale contrast value is greater than the second threshold and less than the focus grayscale contrast value, the third focus step is selected. The submodule sends a trigger start command; if the current grayscale contrast value is greater than the first threshold and less than the second threshold, sending a trigger start command to the second focus step selection submodule; if the current grayscale contrast value is less than the first threshold , the trigger start command is sent to the first focus step selection sub-module.
本发明实施例提供了一种自动对焦的方法及装置,通过将步进的物距范围在其他步进的物距范围内的步进剔除,再获取剔除后剩下的各个步进 的对应位置的灰度对比度值;根据灰度对比度值从剔除后剩下的步进中确定出一个步进的位置作为对焦的焦点。本方案通过将在其他步进的物距范围内的步进进行剔除,使得新得到的步进的物距范围之间不会重合,减少了马达移动的次数,且马达的移动的步进距离也进行了改变,从而实现了快速自动对焦,也不会影响其成像质量,提升了用户体验。Embodiments of the present invention provide a method and apparatus for autofocusing, which eliminates steps of a stepped object distance range within a range of other stepped object distances, and then obtains the remaining steps after the rejection. The grayscale contrast value of the corresponding position; the position of one step is determined as the focus of the focus from the step remaining after the culling according to the gradation contrast value. The scheme eliminates the step in the object distance range of other steps, so that the newly obtained stepping object distance ranges do not coincide, reducing the number of motor movements and the stepping distance of the motor movement. It has also been changed to achieve fast autofocus without affecting its image quality and improving the user experience.
以上内容是结合具体的实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。The above is a further detailed description of the present invention in connection with the specific embodiments, and the specific embodiments of the present invention are not limited to the description. It will be apparent to those skilled in the art that the present invention may be made without departing from the spirit and scope of the invention.
工业实用性Industrial applicability
如上所述,通过上述实施例及优选实施方式,通过将在其他步进的物距范围内的步进进行剔除,使得新得到的步进的物距范围之间不会重合,减少了马达移动的次数,且马达的移动步长也进行了改变,从而实现了快速自动对焦,也不会影响其成像质量,提升了用户体验。 As described above, by the above-described embodiments and preferred embodiments, by stepping out the steps in the range of the other stepped objects, the newly obtained stepped object distance ranges do not coincide, reducing motor movement. The number of times, and the moving step size of the motor have also been changed, thereby achieving fast autofocus without affecting the image quality and improving the user experience.

Claims (11)

  1. 一种自动对焦的方法,包括以下步骤:A method of autofocus, comprising the following steps:
    获取终端的图像传感器的模糊直径值、镜头的光圈值以及马达的运动参数;Obtaining a fuzzy diameter value of the image sensor of the terminal, an aperture value of the lens, and a motion parameter of the motor;
    根据所述模糊直径值、镜头的光圈值以及马达的运动参数计算所述马达各个步进的物距范围;Calculating an object distance range of each step of the motor according to the blur diameter value, the aperture value of the lens, and the motion parameter of the motor;
    在所述步进中剔除掉其物距范围在其他步进的物距范围内的步进;Stepping out the range of object distances within the range of object distances of other steps in the stepping;
    获取剔除后剩下的各个步进的对应位置的灰度对比度值;Obtaining a grayscale contrast value of a corresponding position of each step remaining after the culling;
    根据所述灰度对比度值从剔除后剩下的步进中确定出一个步进的位置作为对焦的焦点。A position of one step is determined as a focus of focus from the step of remaining after the culling according to the gradation contrast value.
  2. 如权利要求1所述的自动对焦的方法,其中,根据所述灰度对比度值从剩下的步进中确定出一个步进的位置作为对焦的焦点包括:选择满足以下公式:
    Figure PCTCN2015086686-appb-100001
    当n2>i时,An=Xi,的剔除后剩下的步进作为第一对焦步进;通过控制马达运动推动对焦窗口从近到远对所述第一对焦步进对应的位置分别对焦,当所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Xi为剩下的步进,An为第一对焦步进,i、n为正整数。
    The method of autofocusing according to claim 1, wherein determining a position of one step from the remaining steps based on the gradation contrast value as a focus of focus comprises: selecting to satisfy the following formula:
    Figure PCTCN2015086686-appb-100001
    When n 2 >i, A n =X i , the remaining step after culling is used as the first focus step; by controlling the motor motion to push the focus window from near to far to the position corresponding to the first focus step Focusing separately, when an inflection point occurs in the gradation contrast value of the position corresponding to three consecutive steps in the first focus step, selecting two of the positions corresponding to the consecutive three steps are larger Any position corresponding to the step is used as the focus of the focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of the focus; X i is the remaining step, and A n is the first focus step , i, n are positive integers.
  3. 如权利要求2所述的自动对焦的方法,其中,当所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点还包括:选择满足以下公式:
    Figure PCTCN2015086686-appb-100002
    当3n≤NA时,Bn=X1,的剔除后剩下的步进作为第二对焦步进;通过控制马达运动推动对焦窗口从远到近对所述第二对焦步进对应的位置分别对焦,当所述第二对焦步进中连续三 个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;NA为所述第一对焦步进中确定出的最远的步进的编号,Bn为第二对焦步进。
    The method of autofocusing according to claim 2, wherein the inflection point of the grayscale contrast value of the position corresponding to three consecutive steps in the first focus step further comprises: selecting to satisfy the following formula:
    Figure PCTCN2015086686-appb-100002
    When 3n ≤ N A , B n = X 1 , the remaining step after culling is used as the second focus step; by controlling the motor motion to push the focus window from far to near to the position corresponding to the second focus step Focusing separately, when an inflection point occurs in the gradation contrast value of the position corresponding to three consecutive steps in the second focus step, selecting two of the positions corresponding to the consecutive three steps are larger Any position corresponding to the step is the focus of the focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of the focus; N A is the farthest determined in the first focus step The number of the step, B n is the second focus step.
  4. 如权利要求3所述的自动对焦的方法,其中,当所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后还包括:选择满足:
    Figure PCTCN2015086686-appb-100003
    的剔除后剩下的步进作为第三对焦步进;通过马达运动推动对焦窗口从近到远对所述第三对焦步进分别对焦,当所述第三对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值最大的步进对应的位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Cn为第三对焦步进,NB为所述第二对焦步进中确定的最近的步进的编号。
    The method of autofocusing according to claim 3, wherein after the inflection point occurs in the grayscale contrast value of the position corresponding to the three consecutive steps in the second focus step, the method further comprises: selecting to satisfy:
    Figure PCTCN2015086686-appb-100003
    The remaining step after the culling is used as the third focus step; the focus window is pushed by the motor motion to focus on the third focus step from near to far, and three consecutive steps in the third focus step If an inflection point occurs in the grayscale contrast value of the corresponding position, the position corresponding to the step with the largest gray contrast value among the positions corresponding to the three consecutive steps is selected as the focus of the focus; otherwise, the step with the largest grayscale contrast value is selected. The corresponding position is taken as the focus of focus; C n is the third focus step, and N B is the number of the most recent step determined in the second focus step.
  5. 如权利要求4所述的自动对焦的方法,其中,将所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第一阈值,将所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第二阈值,所述焦点的灰度对比度值大于第二阈值,所述第二阈值大于第一阈值;获取当前对焦窗口的灰度对比度值,如果当前的灰度对比度值大于第二阈值,小于焦点的灰度对比度值,则执行选择第三对焦步进的步骤;如果当前的灰度对比度值大于第一阈值,小于第二阈值,则执行选择第二对焦步进的步骤;如果当前的灰度对比度值小于第一阈值,则执行 选择第一对焦步进的步骤。The method of autofocusing according to claim 4, wherein the gradation contrast value of one of the inflection points of the gradation contrast value of the position corresponding to three consecutive steps in the first focus step is determined as the first a threshold value, wherein a grayscale contrast value of one of the inflection points of the grayscale contrast value of the position corresponding to three consecutive steps in the second focus step is determined as a second threshold, and the grayscale contrast value of the focus The second threshold is greater than the first threshold; the second threshold is greater than the first threshold; the grayscale contrast value of the current focus window is obtained, and if the current grayscale contrast value is greater than the second threshold and less than the grayscale contrast value of the focus, the third selection is performed. a step of focusing stepping; if the current grayscale contrast value is greater than the first threshold, less than the second threshold, performing the step of selecting the second focus step; if the current grayscale contrast value is less than the first threshold, performing The step of selecting the first focus step.
  6. 如权利要求2-5任一项所述的自动对焦的方法,其中,所述马达运动的速度大小是根据相邻两个步进之间的距离大小进行控制的。A method of autofocusing according to any one of claims 2 to 5, wherein the magnitude of the speed of movement of the motor is controlled according to the distance between adjacent two steps.
  7. 一种自动对焦的装置,包括:An autofocus device comprising:
    参数获取模块,设置为获取终端内图像传感器的模糊直径值、镜头的光圈值以及马达的运动参数;a parameter acquisition module, configured to acquire a fuzzy diameter value of the image sensor in the terminal, an aperture value of the lens, and a motion parameter of the motor;
    物距范围计算模块,设置为根据所述模糊直径值、镜头的光圈值以及马达的运动参数计算所述马达各个步进的物距范围;a object distance range calculation module, configured to calculate a range of object distances of the motor steps according to the blur diameter value, the aperture value of the lens, and the motion parameter of the motor;
    步进剔除模块,设置为在所述步进中剔除掉其物距范围在其他步进的物距范围内的步进;a step culling module configured to remove a step in the step of the object distance range within the other step of the object distance;
    灰度对比度获取模块,设置为获取剔除后剩下的各个步进的对应位置的灰度对比度值;a grayscale contrast obtaining module configured to obtain a grayscale contrast value of a corresponding position of each step remaining after the culling;
    焦点确定模块,设置为根据所述灰度对比度值从剔除后剩下的步进中确定出一个步进的位置作为对焦的焦点。The focus determination module is configured to determine a position of the step as the focus of the focus from the step of the grayscale contrast value remaining after the culling.
  8. 如权利要求7所述的自动对焦的装置,其中,所述焦点确定模块包括:第一对焦步进选择子模块,设置为选择满足以下公式:
    Figure PCTCN2015086686-appb-100004
    当n2>i时,An=Xi,的剔除后剩下的步进作为第一对焦步进;第一焦点确定子模块,设置为通过控制马达运动推动对焦窗口从近到远对所述第一对焦步进对应的位置分别对焦,当所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Xi为剩下的步进,An为第一对焦步进,i、n为正整数。
    The autofocus apparatus of claim 7, wherein the focus determination module comprises: a first focus step selection sub-module configured to select the following formula:
    Figure PCTCN2015086686-appb-100004
    When n 2 >i, A n =X i , the remaining step after culling is used as the first focus step; the first focus determination sub-module is set to push the focus window from near to far by controlling motor motion Positions corresponding to the first focus step are respectively focused, and when an inflection point occurs in the gray contrast value of the position corresponding to three consecutive steps in the first focus step, the position corresponding to the three consecutive steps is selected. Any position corresponding to the two steps with a large grayscale contrast value is used as the focus of the focus; otherwise, the position corresponding to the step with the largest grayscale contrast value is selected as the focus of the focus; X i is the remaining step , A n is the first focus step, and i and n are positive integers.
  9. 如权利要求8所述的自动对焦的装置,其中,所述焦点确定模块还包括:第二对焦步进选择子模块,设置为当所述第一对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,选择满足以下公式:
    Figure PCTCN2015086686-appb-100005
    当3n≤NA时,Bn=X1,的剔除后剩下的步进作为第二对焦步进;第二焦点确定子模块,设置为通过控制马达运动推动对焦窗口从远到近对所述第二对焦步进对应的位置分别对焦,当所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值较大的两个步进之间对应的任一位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;NA为所述第一对焦步进中确定出的最远的步进的编号,Bn为第二对焦步进。
    The apparatus according to claim 8, wherein the focus determining module further comprises: a second focus step selection sub-module configured to be a position corresponding to three consecutive steps in the first focus step After the inflection point appears for the grayscale contrast value, the selection satisfies the following formula:
    Figure PCTCN2015086686-appb-100005
    When 3n≤N A , B n =X 1 , the remaining step after culling is used as the second focus step; the second focus determination sub-module is set to push the focus window from far to near by controlling the motor motion Positions corresponding to the second focus step are respectively focused, and when an inflection point occurs in the gray contrast value of the position corresponding to three consecutive steps in the second focus step, the position corresponding to the three consecutive steps is selected Any position corresponding to the two steps with a large gray contrast value is used as the focus of the focus; otherwise, the position corresponding to the step with the largest gray contrast value is selected as the focus of the focus; N A is the first focus The number of the farthest step determined in the step, B n is the second focus step.
  10. 如权利要求9所述的自动对焦的装置,其中,所述焦点确定模块还包括:第三对焦步进选择子模块,设置为当所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点后,选择满足:
    Figure PCTCN2015086686-appb-100006
    的剔除后剩下的步进作为第三对焦步进;第三焦点确定子模块,设置为通过马达运动推动对焦窗口从近到远对所述第三对焦步进分别对焦,当所述第三对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点,则选择所述连续三个步进对应的位置中灰度对比度值最大的步进对应的位置作为对焦的焦点;否则,选择灰度对比度值最大的步进对应的位置作为对焦的焦点;Cn为第三对焦步进,NB为所述第二对焦步进中确定的最近的步进的编号。
    The apparatus of claim 9, wherein the focus determining module further comprises: a third focus step selection sub-module configured to be a position corresponding to three consecutive steps in the second focus step After the inflection point occurs for the grayscale contrast value, the selection is satisfied:
    Figure PCTCN2015086686-appb-100006
    The remaining step after the culling is used as the third focus step; the third focus determining sub-module is configured to respectively push the focus window by the motor motion to focus on the third focus step from near to far, when the third If an inflection point occurs in the gray contrast value of the position corresponding to three consecutive steps in the focusing step, the position corresponding to the step with the largest gray contrast value in the position corresponding to the three consecutive steps is selected as the focus of the focus; otherwise The position corresponding to the step with the largest gray scale contrast value is selected as the focus of focus; C n is the third focus step, and N B is the number of the most recent step determined in the second focus step.
  11. 如权利要求10所述的自动对焦的装置,其中,还包括:阈值确定模块,设置为将所述第一对焦步进中连续三个步进对应的位置的灰度 对比度值出现拐点的其中一个位置的灰度对比度值确定为第一阈值,将所述第二对焦步进中连续三个步进对应的位置的灰度对比度值出现拐点的其中一个位置的灰度对比度值确定为第二阈值,所述焦点的灰度对比度值大于第二阈值,所述第二阈值大于第一阈值;处理模块,设置为获取当前对焦窗口的灰度对比度值,如果当前的灰度对比度值大于第二阈值,小于焦点的灰度对比度值,则向所述第三对焦步进选择子模块发送触发启动指令;如果当前的灰度对比度值大于第一阈值,小于第二阈值,则向所述第二对焦步进选择子模块发送触发启动指令;如果当前的灰度对比度值小于第一阈值,则向所述第一对焦步进选择子模块发送触发启动指令。 The apparatus of claim 10, further comprising: a threshold determination module configured to grayscale the position corresponding to three consecutive steps in the first focus step The grayscale contrast value of one of the inflection points of the contrast value is determined as a first threshold, and the grayscale contrast value of the position corresponding to three consecutive steps in the second focus step is grayscale of one of the inflection points The contrast value is determined to be a second threshold, the grayscale contrast value of the focus is greater than a second threshold, the second threshold is greater than the first threshold; and the processing module is configured to obtain a grayscale contrast value of the current focus window, if the current gray If the degree of contrast is greater than the second threshold, less than the grayscale contrast value of the focus, the triggering start command is sent to the third focus step selection submodule; if the current grayscale contrast value is greater than the first threshold, less than the second threshold, And sending a trigger start instruction to the second focus step selection submodule; if the current gray scale contrast value is less than the first threshold, sending a trigger start instruction to the first focus step selection submodule.
PCT/CN2015/086686 2015-04-07 2015-08-11 Autofocusing method and device WO2016161734A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510160558.0 2015-04-07
CN201510160558.0A CN106154688B (en) 2015-04-07 2015-04-07 Automatic focusing method and device

Publications (1)

Publication Number Publication Date
WO2016161734A1 true WO2016161734A1 (en) 2016-10-13

Family

ID=57071784

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/086686 WO2016161734A1 (en) 2015-04-07 2015-08-11 Autofocusing method and device

Country Status (2)

Country Link
CN (1) CN106154688B (en)
WO (1) WO2016161734A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109307970A (en) * 2018-11-22 2019-02-05 成都市鹰诺实业有限公司 A kind of automatic focusing method of camera

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234876B (en) * 2018-01-22 2020-10-16 努比亚技术有限公司 Tracking focusing method, terminal and computer readable storage medium
CN109087354A (en) * 2018-08-29 2018-12-25 浙江霖研精密科技有限公司 A kind of position algorithm of the best object distance of automatic search and image distance
WO2021102959A1 (en) * 2019-11-29 2021-06-03 深圳市大疆创新科技有限公司 Focus adjustment method, camera module, and computer readable storage medium
CN111654637B (en) * 2020-07-14 2021-10-22 RealMe重庆移动通信有限公司 Focusing method, focusing device and terminal equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002122776A (en) * 2000-10-17 2002-04-26 Sharp Corp Autofocus controller, digital still camera and digital video camera equipped with the same, autofocus control method and recording medium having autofocus control program recorded thereon
JP2003315665A (en) * 2002-04-23 2003-11-06 Nikon Gijutsu Kobo:Kk Camera
CN1461968A (en) * 2002-05-31 2003-12-17 金宝电子工业股份有限公司 Automatic focusing method cooperated with depth of field
CN1667481A (en) * 2004-03-08 2005-09-14 普立尔科技股份有限公司 Quick focusing method for digital camera
CN1900807A (en) * 2005-07-19 2007-01-24 阿尔卑斯电气株式会社 Optical device
CN101071251A (en) * 2006-05-11 2007-11-14 致伸科技股份有限公司 Method for estimating automatic focusing least effective sampling points

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3902492B2 (en) * 2002-03-13 2007-04-04 株式会社リコー Imaging device
JP2007148249A (en) * 2005-11-30 2007-06-14 Canon Inc Automatic focusing device
CN100407038C (en) * 2005-12-19 2008-07-30 佛山普立华科技有限公司 Automatic focusing method for digit imaging system
CN101995640A (en) * 2010-09-30 2011-03-30 镇江中信科技开发有限公司 Coarse adjustment and fine adjustment combined rapid interpolation focus exploration algorithm
US9030595B2 (en) * 2010-10-14 2015-05-12 Lensvector Inc. In-flight auto focus method and system for tunable liquid crystal optical element
US9160917B2 (en) * 2013-07-09 2015-10-13 Htc Corporation Handheld electronic apparatus and image capturing apparatus and focusing method thereof
JP5868109B2 (en) * 2011-10-12 2016-02-24 キヤノン株式会社 Optical apparatus, lens barrel, and automatic focusing method
CN103513395B (en) * 2012-06-15 2018-05-04 中兴通讯股份有限公司 A kind of passive auto-focusing method and device
CN103728813B (en) * 2012-10-15 2016-10-26 浙江大华技术股份有限公司 A kind of method of synchronizing focus during zoom
CN104103063A (en) * 2013-04-10 2014-10-15 江南大学 No-reference noise image quality evaluation method based on automatic focusing principle
CN104459940B (en) * 2013-09-25 2017-07-14 北京环境特性研究所 A kind of quick self-adapted auto focusing method
CN103945126B (en) * 2014-04-21 2015-03-04 中国人民解放军国防科学技术大学 Automatic focusing and locating method
CN104038666B (en) * 2014-04-22 2017-10-27 深圳英飞拓科技股份有限公司 A kind of video shelter detection method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002122776A (en) * 2000-10-17 2002-04-26 Sharp Corp Autofocus controller, digital still camera and digital video camera equipped with the same, autofocus control method and recording medium having autofocus control program recorded thereon
JP2003315665A (en) * 2002-04-23 2003-11-06 Nikon Gijutsu Kobo:Kk Camera
CN1461968A (en) * 2002-05-31 2003-12-17 金宝电子工业股份有限公司 Automatic focusing method cooperated with depth of field
CN1667481A (en) * 2004-03-08 2005-09-14 普立尔科技股份有限公司 Quick focusing method for digital camera
CN1900807A (en) * 2005-07-19 2007-01-24 阿尔卑斯电气株式会社 Optical device
CN101071251A (en) * 2006-05-11 2007-11-14 致伸科技股份有限公司 Method for estimating automatic focusing least effective sampling points

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109307970A (en) * 2018-11-22 2019-02-05 成都市鹰诺实业有限公司 A kind of automatic focusing method of camera

Also Published As

Publication number Publication date
CN106154688A (en) 2016-11-23
CN106154688B (en) 2021-04-16

Similar Documents

Publication Publication Date Title
US9998650B2 (en) Image processing apparatus and image pickup apparatus for adding blur in an image according to depth map
CN107395993B (en) Full-automatic focusing method and system
WO2016161734A1 (en) Autofocusing method and device
CN108259753B (en) Camera automatic focusing method and device based on defocus estimation and improved hill climbing method
WO2019105214A1 (en) Image blurring method and apparatus, mobile terminal and storage medium
WO2017167116A1 (en) Automatic-focus method and automatic-focus device
CN107465877B (en) Track focusing method and device and related media production
CN106031148B (en) Imaging device, method of auto-focusing in an imaging device and corresponding computer program
TWI471677B (en) Auto focus method and auto focus apparatus
CN107800951B (en) Electronic device and lens switching method thereof
WO2010028224A1 (en) Apparatus, method, and manufacture for iterative auto-focus using depth-from-defocus
CN105629628A (en) Automatic focusing method and device
WO2018228466A1 (en) Focus region display method and apparatus, and terminal device
CN107534723B (en) Automatic focusing method, device and equipment
TW201541141A (en) Auto-focus system for multiple lens and method thereof
CA2832074A1 (en) Multi-resolution depth-from-defocus-based autofocus
CN112333379A (en) Image focusing method and device and image acquisition equipment
US9300861B2 (en) Video recording apparatus and focusing method for the same
EP3218756B1 (en) Direction aware autofocus
TW201541143A (en) Auto-focus system for multiple lens and method thereof
JP6312410B2 (en) Alignment apparatus, microscope system, alignment method, and alignment program
CN116182786B (en) Monocular vision ranging method, camera and medium
JP5454392B2 (en) Ranging device and imaging device
JP2010066728A (en) Imaging apparatus, and control method for imaging apparatus
JP2017146559A (en) Imaging apparatus, control method therefor, program and storage medium

Legal Events

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

Ref document number: 15888288

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15888288

Country of ref document: EP

Kind code of ref document: A1