CN105007425B - Contrast type focusing method and mobile terminal - Google Patents

Contrast type focusing method and mobile terminal Download PDF

Info

Publication number
CN105007425B
CN105007425B CN201510439724.0A CN201510439724A CN105007425B CN 105007425 B CN105007425 B CN 105007425B CN 201510439724 A CN201510439724 A CN 201510439724A CN 105007425 B CN105007425 B CN 105007425B
Authority
CN
China
Prior art keywords
phase difference
difference value
camera
image data
focusing
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201510439724.0A
Other languages
Chinese (zh)
Other versions
CN105007425A (en
Inventor
李小朋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510439724.0A priority Critical patent/CN105007425B/en
Publication of CN105007425A publication Critical patent/CN105007425A/en
Application granted granted Critical
Publication of CN105007425B publication Critical patent/CN105007425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Automatic Focus Adjustment (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the invention relates to the technical field of electronics, and discloses a contrast type focusing method and a mobile terminal. Wherein, the method comprises the following steps: when a focusing instruction for a target shooting object is received, the mobile terminal can acquire a phase difference value between two image data waveforms of the target shooting object, judge whether the phase difference value meets a starting condition of a contrast type focusing mode, if so, start the inverse difference type focusing mode, determine focusing data of a focusing position of the camera according to the phase difference value in the contrast type focusing mode, and finally control the lens of the camera to move to the focusing position according to the focusing data. According to the embodiment of the invention, when the contrast type focusing mode is started, the direction of the focusing position of the camera can be determined through the obtained phase difference value, and then the lens of the camera is directly controlled to move towards the direction, so that the focusing position can be quickly found, the focusing speed of contrast type focusing is improved, and the user experience is improved.

Description

一种反差式对焦方法及移动终端A contrast focusing method and mobile terminal

技术领域technical field

本发明涉及电子技术领域,具体涉及一种反差式对焦方法及移动终端。The invention relates to the field of electronic technology, in particular to a contrast focusing method and a mobile terminal.

背景技术Background technique

现在的移动终端如智能手机、平板电脑、笔记本电脑等在使用摄像头进行拍照之前,会进行对焦。现有技术中的对焦方式有相位对焦、反差式对焦以及激光对焦等。Current mobile terminals such as smartphones, tablet computers, notebook computers, etc. will focus before using the camera to take pictures. Focusing methods in the prior art include phase focusing, contrast focusing, and laser focusing.

现有的反差式对焦技术,移动终端是需要将摄像头的镜头按照预设轨迹移动才能查找到摄像头的最佳对焦位置。可见,这种对焦方式的对焦速度较慢。In the existing contrast focusing technology, the mobile terminal needs to move the lens of the camera according to a preset track to find the best focus position of the camera. It can be seen that the focusing speed of this focusing method is relatively slow.

发明内容Contents of the invention

本发明实施例公开了一种反差式对焦方法及移动终端,能够使摄像头镜头快速找到最佳对焦位置,从而提高了反差式对焦的对焦速度。The embodiment of the present invention discloses a contrast focusing method and a mobile terminal, which can quickly find the best focusing position for a camera lens, thereby improving the focusing speed of the contrast focusing.

本发明实施例公开了一种反差式对焦方法,包括:The embodiment of the present invention discloses a contrast focusing method, including:

当接收到针对目标拍摄物的对焦指令时,获取针对所述目标拍摄物的两个图像数据波形之间的相位差值;When receiving a focus instruction for a target object, acquiring a phase difference value between two image data waveforms for the target object;

判断所述相位差值是否满足反差式对焦模式的启动条件;judging whether the phase difference value satisfies the activation condition of the contrast focusing mode;

若是,则启动反差式对焦模式,并在所述反差式对焦模式下根据所述相位差值确定摄像头的对焦位置的对焦数据;If so, start the contrast focus mode, and determine the focus data of the focus position of the camera according to the phase difference value in the contrast focus mode;

根据所述对焦数据控制所述摄像头的镜头移动至所述对焦位置。controlling the lens of the camera to move to the focus position according to the focus data.

作为一种可行的实施方式,所述判断所述相位差值是否满足反差式对焦模式的启动条件,包括:As a feasible implementation manner, the judging whether the phase difference value satisfies the activation condition of the contrast focusing mode includes:

确定所述相位差值的绝对值;determining the absolute value of the phase difference;

判断所述绝对值是否小于预设阈值,若是,则确定所述相位差值满足反差式对焦模式的启动条件。It is judged whether the absolute value is smaller than a preset threshold, and if so, it is determined that the phase difference value satisfies the activation condition of the contrast focusing mode.

作为另一种可行的实施方式,所述对焦数据包括移动方向,所述在所述反差式对焦模式下根据所述相位差值确定摄像头对焦位置的对焦数据,包括:As another feasible implementation manner, the focus data includes a moving direction, and the focus data for determining the focus position of the camera according to the phase difference value in the contrast focus mode includes:

当所述相位差值大于预设相位差值时,确定第一方向为所述摄像头的对焦位置的移动方向,其中,所述第一方向为所述摄像头的镜头朝向所述目标拍摄物的方向;When the phase difference value is greater than the preset phase difference value, determine the first direction as the moving direction of the focus position of the camera, wherein the first direction is the direction in which the lens of the camera faces the target object ;

当所述相位差值小于所述预设相位差值时,确定第二方向为所述摄像头的对焦位置的移动方向,其中,所述第二方向为与所述第一方向相反的方向。When the phase difference value is smaller than the preset phase difference value, the second direction is determined as the moving direction of the focus position of the camera, wherein the second direction is a direction opposite to the first direction.

作为又一种可行的实施方式,所述获取针对所述目标拍摄物的两个图像数据波形之间的相位差值,包括:As yet another feasible implementation manner, the acquiring the phase difference value between two image data waveforms of the target object includes:

针对所述目标拍摄物,通过摄像头中图像传感器的左像素点获取第一图像的图像数据,并通过所述图像传感器的右像素点获取第二图像的图像数据;For the target subject, the image data of the first image is acquired through the left pixel of the image sensor in the camera, and the image data of the second image is acquired through the right pixel of the image sensor;

根据所述第一图像的图像数据生成第一图像数据波形,并根据所述第二图像的图像数据生成第二图像数据波形;generating a first image data waveform based on the image data of the first image, and generating a second image data waveform based on the image data of the second image;

计算所述第一图像数据波形与所述第二图像数据波形之间的相位差值。calculating a phase difference value between the waveform of the first image data and the waveform of the second image data.

作为又一种可行的实施方式,所述根据所述对焦数据控制所述摄像头的镜头移动至所述对焦位置之后,所述方法还包括:As yet another feasible implementation manner, after controlling the lens of the camera to move to the focus position according to the focus data, the method further includes:

接收目标穿戴设备发送的拍摄指令,所述拍摄指令是由所述目标穿戴设备检测到预设频率的振动信号时产生的;receiving a shooting instruction sent by the target wearable device, where the shooting instruction is generated when the target wearable device detects a vibration signal of a preset frequency;

响应所述拍摄指令,控制所述摄像头在所述对焦位置上对所述目标拍摄物进行拍摄。In response to the shooting instruction, the camera is controlled to shoot the target object at the focusing position.

相应的,本发明实施例公开了一种移动终端,包括:Correspondingly, the embodiment of the present invention discloses a mobile terminal, including:

获取单元,用于当接收到针对目标拍摄物的对焦指令时,获取针对所述目标拍摄物的两个图像数据波形之间的相位差值;An acquisition unit, configured to acquire a phase difference value between two image data waveforms of the target object when a focus instruction for the target object is received;

判断单元,用于判断所述相位差值是否满足反差式对焦模式的启动条件;A judging unit, configured to judge whether the phase difference value satisfies the activation condition of the contrast focusing mode;

确定单元,用于在所述判断单元判断出所述相位差值满足反差式对焦模式启动条件时,启动反差式对焦模式,并在所述反差式对焦模式下根据所述相位差值确定摄像头的对焦位置的对焦数据;A determining unit, configured to start the contrast focusing mode when the judging unit judges that the phase difference value satisfies the start condition of the contrast focusing mode, and determine the phase difference of the camera according to the phase difference value in the contrast focusing mode Focus data of the focus position;

控制单元,用于根据所述对焦数据控制所述摄像头的镜头移动至所述对焦位置。A control unit, configured to control the lens of the camera to move to the focus position according to the focus data.

作为一种可行的实施方式,所述判断单元包括确定子单元以及判断子单元,其中:As a feasible implementation manner, the judging unit includes a determining subunit and a judging subunit, wherein:

所述确定子单元,用于确定所述相位差值的绝对值;The determining subunit is configured to determine the absolute value of the phase difference;

所述判断子单元,用于判断所述绝对值是否小于预设阈值;The judging subunit is used to judge whether the absolute value is smaller than a preset threshold;

所述确定子单元,还用于在所述判断子单元判断出所述绝对值小于预设阈值时,确定所述相位差值满足反差式对焦模式的启动条件。The determining subunit is further configured to determine that the phase difference value satisfies the starting condition of the contrast focusing mode when the determining subunit determines that the absolute value is smaller than a preset threshold.

作为另一种可行的实施方式,所述对焦数据包括移动方向,所述确定单元在所述反差式对焦模式下根据所述相位差值确定摄像头对焦位置的对焦数据的具体方式为:As another feasible implementation manner, the focus data includes a moving direction, and the specific method for the determination unit to determine the focus data of the focus position of the camera according to the phase difference value in the contrast focus mode is as follows:

当所述相位差值大于预设相位差值时,确定第一方向为所述摄像头的对焦位置的移动方向,其中,所述第一方向为所述摄像头的镜头朝向所述目标拍摄物的方向;When the phase difference value is greater than the preset phase difference value, determine the first direction as the moving direction of the focus position of the camera, wherein the first direction is the direction in which the lens of the camera faces the target object ;

当所述相位差值小于所述预设相位差值时,确定第二方向为所述摄像头的对焦位置的移动方向,其中,所述第二方向为与所述第一方向相反的方向。When the phase difference value is smaller than the preset phase difference value, the second direction is determined as the moving direction of the focus position of the camera, wherein the second direction is a direction opposite to the first direction.

作为又一种可行的实施方式,所述获取单元包括获取子单元、生成子单元以及计算子单元,其中:As yet another feasible implementation manner, the acquisition unit includes an acquisition subunit, a generation subunit, and a calculation subunit, wherein:

所述获取子单元,用于针对所述目标拍摄物,通过摄像头中图像传感器的左像素点获取第一图像的图像数据,并通过所述图像传感器的右像素点获取第二图像的图像数据;The acquiring subunit is configured to acquire the image data of the first image through the left pixel of the image sensor in the camera, and acquire the image data of the second image through the right pixel of the image sensor for the target subject;

所述生成子单元,用于根据所述第一图像的图像数据生成第一图像数据波形,并根据所述第二图像的图像数据生成第二图像数据波形;The generating subunit is configured to generate a first image data waveform according to the image data of the first image, and generate a second image data waveform according to the image data of the second image;

所述计算子单元,用于计算所述第一图像数据波形与所述第二图像数据波形之间的相位差值。The calculation subunit is used to calculate the phase difference between the waveform of the first image data and the waveform of the second image data.

作为又一种可行的实施方式,所述移动终端还包括:As yet another feasible implementation manner, the mobile terminal further includes:

接收单元,用于接收目标穿戴设备发送的拍摄指令,所述拍摄指令是由所述目标穿戴设备检测到预设频率的振动信号时产生的;The receiving unit is configured to receive a shooting instruction sent by the target wearable device, the shooting instruction is generated when the target wearable device detects a vibration signal of a preset frequency;

所述控制单元,还用于响应所述拍摄指令,控制所述摄像头在所述对焦位置上对所述目标拍摄物进行拍摄。The control unit is further configured to, in response to the shooting instruction, control the camera to shoot the target object at the focusing position.

实施本发明实施例,具有如下有益效果:Implementing the embodiment of the present invention has the following beneficial effects:

本发明实施例中,当接收到针对目标拍摄物的对焦指令时,移动终端会获取针对该目标拍摄物的两个图像数据波形之间的相位差值,并判断该相位差值是否满足反差式对焦模式的启动条件,如果满足,就启动反差式对焦模式,并在反差式对焦模式下根据该相位差值确定摄像头的对焦位置的对焦数据,最终根据该对焦数据控制该摄像头的镜头移动至该对焦位置。通过本发明实施例,在启动反差式对焦模式时,可以通过获取的相位差值来确定摄像头的对焦位置的方向,然后直接控制该摄像头的镜头向该方向移动,从而能快速找到对焦位置,提高反差式对焦的对焦速度,提升用户体验。In the embodiment of the present invention, when receiving a focus command for a target object, the mobile terminal will obtain the phase difference between two image data waveforms for the target object, and determine whether the phase difference satisfies the contrast formula If the starting condition of the focus mode is satisfied, the contrast focus mode is started, and the focus data of the focus position of the camera is determined according to the phase difference value in the contrast focus mode, and finally the lens of the camera is controlled to move to the focus position according to the focus data. focus position. Through the embodiment of the present invention, when the contrast focus mode is started, the direction of the focus position of the camera can be determined by the obtained phase difference value, and then the lens of the camera is directly controlled to move in this direction, so that the focus position can be quickly found and the focus can be improved. The focusing speed of contrast focusing improves user experience.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1是本发明实施例公开的一种反差式对焦方法的流程示意图;FIG. 1 is a schematic flowchart of a contrast focusing method disclosed in an embodiment of the present invention;

图2是本发明实施例公开的另一种反差式对焦方法的流程示意图;FIG. 2 is a schematic flowchart of another contrast focusing method disclosed in an embodiment of the present invention;

图3是本发明实施例公开的一种移动终端的结构示意图;FIG. 3 is a schematic structural diagram of a mobile terminal disclosed in an embodiment of the present invention;

图4是本发明实施例公开的另一种移动终端的结构示意图。Fig. 4 is a schematic structural diagram of another mobile terminal disclosed by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

本发明实施例公开了一种反差式对焦方法及移动终端,能够使摄像头镜头快速找到最佳对焦位置,从而提高了反差式对焦的对焦速度。以下分别进行详细说明。The embodiment of the present invention discloses a contrast focusing method and a mobile terminal, which can quickly find the best focusing position for a camera lens, thereby improving the focusing speed of the contrast focusing. Each will be described in detail below.

请参阅图1,图1是本发明实施例公开的一种反差式对焦方法的流程示意图。其中,图1所示的方法可以应用于智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、个人数字助理(Personal DigitalAssistant,PDA)、媒体播放器、智能电视、智能手表、智能眼镜、智能手环等移动终端。如图1所示,该反差式对焦方法可以包括以下步骤:Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of a contrast focusing method disclosed in an embodiment of the present invention. Wherein, the method shown in Figure 1 can be applied to smart phones (such as Android mobile phones, iOS mobile phones, etc.), tablet computers, handheld computers, mobile Internet devices (Mobile Internet Devices, MID), personal digital assistants (Personal Digital Assistant, PDA), Mobile terminals such as media players, smart TVs, smart watches, smart glasses, and smart bracelets. As shown in Figure 1, the contrast focusing method may include the following steps:

S101、当接收到针对目标拍摄物的对焦指令时,移动终端获取针对该目标拍摄物的两个图像数据波形之间的相位差值。S101. When receiving a focus instruction for a target object, the mobile terminal acquires a phase difference value between two image data waveforms for the target object.

本发明实施例中,移动终端的摄像头包括有图像传感器,可以通过图像传感器来采集图像,该图像传感器可以为线性传感器。由于相位对焦的速度较快,因此,移动终端通常会采用相位对焦方式进行对焦。在相位对焦过程中,移动终端会通过图像传感器来获取两个图像,从而得到这两个图像的图像数据波形,并计算出这两个图像数据波形之间的相位差值,根据相位差值来进行相位对焦。In the embodiment of the present invention, the camera of the mobile terminal includes an image sensor, which can collect images through the image sensor, and the image sensor can be a linear sensor. Since the speed of the phase focusing is relatively fast, the mobile terminal usually adopts the phase focusing method for focusing. In the process of phase focusing, the mobile terminal will acquire two images through the image sensor to obtain the image data waveforms of the two images, and calculate the phase difference between the two image data waveforms, and calculate the phase difference according to the phase difference value. Perform phase focus.

因此,当用户在预览图像中点击或触摸目标拍摄物所在的区域之后,该移动终端就会接收到针对该目标拍摄物的对焦指令,首选相位对焦方式进行对焦。具体的,移动终端会通过图像传感器来获取针对该目标拍摄物的两个图像数据波形,并得到这两个图像数据波形之间的相位差值。Therefore, after the user clicks or touches the area where the target object is located in the preview image, the mobile terminal will receive a focus instruction for the target object, and the phase focus method is preferred for focusing. Specifically, the mobile terminal acquires two image data waveforms for the target subject through an image sensor, and obtains a phase difference between the two image data waveforms.

作为一种可行的实施方式,移动终端获取针对该目标拍摄物的两个图像数据波形之间的相位差值的具体方式可以包括以下步骤:As a feasible implementation manner, the specific manner in which the mobile terminal acquires the phase difference value between the two image data waveforms of the target object may include the following steps:

步骤11)针对该目标拍摄物,通过摄像头中图像传感器的左像素点获取第一图像的图像数据,并通过该图像传感器的右像素点获取第二图像的图像数据。Step 11) For the target subject, the image data of the first image is obtained through the left pixel of the image sensor in the camera, and the image data of the second image is obtained through the right pixel of the image sensor.

具体实现中,在相位对焦技术中,图像传感器的像素点包括左像素点和右像素点,在进行对焦时,首先会通过左右像素点分别获取预览画面的两个图像。In specific implementation, in the phase focusing technology, the pixels of the image sensor include left pixels and right pixels. When focusing, firstly, two images of the preview screen are respectively obtained through the left and right pixels.

因此,在接收到针对该目标拍摄物的对焦指令之后,该移动终端就会通过摄像头中图像传感器的左像素点获取针对该目标拍摄物的第一图像,从而得到第一图像的图像数据;并通过摄像头中图像传感器的右像素点或者针对该目标拍摄物的第二图像,从而得到第二图像的图像数据。其中,图像数据可以包括但不限于RGB值、灰阶值、灰度值等。Therefore, after receiving the focusing instruction for the target object, the mobile terminal will acquire the first image for the target object through the left pixel of the image sensor in the camera, thereby obtaining the image data of the first image; and The image data of the second image is obtained through the right pixel of the image sensor in the camera or the second image of the target object. Wherein, the image data may include but not limited to RGB values, grayscale values, grayscale values, etc.

步骤12)根据该第一图像的图像数据生成第一图像数据波形,并根据第二图像的图像数据生成第二图像数据波形。Step 12) Generate a waveform of first image data according to the image data of the first image, and generate a waveform of second image data according to the image data of the second image.

具体实现中,当移动终端获取到第一图像的图像数据之后,会将该第一图像的所有图像数据生成第一图像数据波形;而当移动终端获取到第二图像的图像数据之后,会将该第二图像的所有图像数据生成第二图像数据波形。In a specific implementation, after the mobile terminal acquires the image data of the first image, it will generate the first image data waveform for all the image data of the first image; and when the mobile terminal acquires the image data of the second image, it will generate All image data of the second image generates a second image data waveform.

举例来说,当移动终端通过左像素点获取到第一图像的RGB值之后,会根据该第一图像的所有RGB值生成第一图像数据波形;当移动终端通过右像素点获取到第二图像的RGB值之后,会根据该第二图像的所有RGB值生成第二图像数据波形。由于波形存在波峰以及波谷,因此,该移动终端可以通过波形的波峰或波谷之间的相位来计算出第一图像数据波形与第二图像数据波形之间的相位差值。For example, after the mobile terminal obtains the RGB value of the first image through the left pixel, it will generate the first image data waveform according to all the RGB values of the first image; when the mobile terminal obtains the second image through the right pixel After the RGB values of the second image, the second image data waveform will be generated according to all the RGB values of the second image. Since there are peaks and troughs in the waveform, the mobile terminal can calculate the phase difference between the waveform of the first image data and the waveform of the second image data through the phase between the peaks and troughs of the waveform.

步骤13)计算该第一图像数据波形与该第二图像数据波形之间的相位差值。Step 13) Calculate the phase difference between the waveform of the first image data and the waveform of the second image data.

具体实现中,当移动终端分别生成第一图像数据波形以及第二图像数据波形之后,该移动终端就会计算两个图像数据波形之间的相位差值。通常情况下,只有当两个图像数据波形之间的相位差之为零时,才表示获取的预览图像为最清晰的图像,而如果两个图像数据波形之间存在相位差时,就需要通过对焦的形式获取最清晰的预览图像。在相位对焦模式下,可以通过计算出的相位差值来确定摄像头的对焦位置,从而能够实现快速对焦。In a specific implementation, after the mobile terminal respectively generates the first image data waveform and the second image data waveform, the mobile terminal will calculate the phase difference between the two image data waveforms. Usually, only when the phase difference between the two image data waveforms is zero, it means that the acquired preview image is the clearest image, and if there is a phase difference between the two image data waveforms, it needs to pass Get the clearest preview image by focusing. In the phase focus mode, the focus position of the camera can be determined through the calculated phase difference value, so as to achieve fast focus.

进一步的,计算该第一图像数据波形与该第二图像数据波形之间的相位差值也可以理解为:通过线性传感器检测出第一图像与第二图像之间的距离,该距离也可以理解为两个图像数据波形之间的相位差。Further, calculating the phase difference between the first image data waveform and the second image data waveform can also be understood as: detecting the distance between the first image and the second image through a linear sensor, and the distance can also be understood as is the phase difference between two image data waveforms.

S102、该移动终端判断该相位差值是否满足反差式对焦模式的启动条件,若是,执行步骤S103;若否,结束本流程。S102. The mobile terminal judges whether the phase difference value satisfies the activation condition of the contrast focusing mode, if yes, execute step S103; if not, end the process.

本发明实施例中,移动终端在采用相位对焦技术时,由于相位对焦也是被动式对焦方式,是靠光线反射进镜头,然后传送到相应的部件上去进行识别,并确定对焦模块如何工作的。那么,当光线较弱或者光线不足时,对焦速度和性能会明显下降,还可能出现无法对焦的局面。In the embodiment of the present invention, when the mobile terminal adopts the phase focusing technology, since the phase focusing is also a passive focusing method, the light is reflected into the lens, and then transmitted to the corresponding components for identification and to determine how the focusing module works. Then, when the light is weak or the light is insufficient, the focusing speed and performance will be significantly reduced, and there may be a situation where focusing cannot be achieved.

也就是说,如果外界环境中光线较弱,移动终端获取到的相位差值的绝对值较小,可能会导致不能启动相位对焦模式,为了能够较快的实现对焦,该移动终端就会采用反差式对焦。That is to say, if the light in the external environment is weak, the absolute value of the phase difference value obtained by the mobile terminal is small, which may cause the inability to start the phase focus mode. In order to achieve focus quickly, the mobile terminal will use contrast mode focus.

因此,在移动终端获取到两个图像数据波形之间的相位差值之后,该移动终端就会判断该相位差值是否满足反差式对焦模式的启动条件,也可以理解为:该移动终端会判断该相位差值是否能触发相位对焦模式的启动条件。Therefore, after the mobile terminal obtains the phase difference value between two image data waveforms, the mobile terminal will judge whether the phase difference value satisfies the activation condition of the contrast focusing mode, which can also be understood as: the mobile terminal will judge Whether the phase difference value can trigger the activation condition of the phase focus mode.

进一步的,当移动终端判断出该相位差值满足反差式对焦模式的启动条件时,也就表明该相位差值不能触发相位对焦模式的启动,因此,该移动终端就会启动反差式对焦模式;而当移动终端判断出该相位差值不满足反差式对焦模式的启动条件时,也就表明该相位差值能触发相位对焦模式的启动,那么该移动终端就会继续采用相位对焦模式对该目标拍摄物进行对焦。Further, when the mobile terminal judges that the phase difference value satisfies the starting condition of the contrast focusing mode, it also indicates that the phase difference value cannot trigger the starting of the phase focusing mode, so the mobile terminal will start the contrast focusing mode; And when the mobile terminal judges that the phase difference value does not meet the activation conditions of the contrast focus mode, it also indicates that the phase difference value can trigger the phase focus mode activation, then the mobile terminal will continue to use the phase focus mode to focus on the target. Focus on the subject.

作为一种可行的实施方式,该移动终端判断该相位差值是否满足反差式对焦模式的启动条件的具体方式可以包括以下步骤:As a feasible implementation manner, the specific manner in which the mobile terminal judges whether the phase difference value satisfies the activation condition of the contrast focusing mode may include the following steps:

步骤21)确定该相位差值的绝对值。Step 21) Determine the absolute value of the phase difference.

具体实现中,两个图像数据波形之间的相位差值可能为正数,也可能为负数,相位差值的正负性可以分别表示移动终端的摄像头的镜头移动至对焦位置的正负方向。因此,在移动终端获取到针对目标拍摄物的两个图像数据波形之间的相位差值之后,该移动终端就会计算出该相位差值的绝对值。In a specific implementation, the phase difference between the two image data waveforms may be a positive number or a negative number, and the sign of the phase difference may indicate the positive and negative directions in which the lens of the camera of the mobile terminal moves to the focus position, respectively. Therefore, after the mobile terminal acquires the phase difference between the two image data waveforms of the target object, the mobile terminal will calculate the absolute value of the phase difference.

步骤22)判断该绝对值是否小于预设阈值。Step 22) Judging whether the absolute value is smaller than a preset threshold.

具体实现中,当确定出该相位差值的绝对值时,该移动终端就会通过该绝对值来判断是启动相位对焦模式,还是启动反差式对焦模式。通常情况下,启动相位对焦模式是需要相位差值的绝对值大于某个阈值才能触发的,如果小于该阈值,为了能够实现对焦,一般会启动反差式对焦模式。In a specific implementation, when the absolute value of the phase difference is determined, the mobile terminal will judge whether to start the phase focus mode or the contrast focus mode based on the absolute value. Normally, the phase difference focus mode is triggered only when the absolute value of the phase difference value is greater than a certain threshold. If it is less than the threshold value, in order to achieve focus, the contrast focus mode is generally activated.

也就是说,该预设阈值是反差式对焦模式与相位对焦模式之间的分界线。该预设阈值的大小可以视情况而定,即可以根据相位对焦模组的性能来确定,本发明实施例不做限定。因此,在确定出该相位差值的绝对值之后,该移动终端就会判断该绝对值是否小于预设阈值。如果小于,就确定该相位差值满足反差式对焦模式的启动条件;而如果大于,就表明该相位差值满足相位对焦模式的启动条件,因此,该移动终端就会启动相位对焦模式对该目标拍摄物进行对焦。That is to say, the preset threshold is the dividing line between the contrast focusing mode and the phase focusing mode. The size of the preset threshold can be determined according to the situation, that is, it can be determined according to the performance of the phase focusing module, which is not limited in the embodiment of the present invention. Therefore, after determining the absolute value of the phase difference, the mobile terminal will judge whether the absolute value is smaller than a preset threshold. If it is less than, it is determined that the phase difference value satisfies the starting condition of the contrast focus mode; Focus on the subject.

步骤23)在判断出该绝对值小于预设阈值时,确定该相位差值满足反差式对焦模式的启动条件。Step 23) When it is determined that the absolute value is smaller than the preset threshold, it is determined that the phase difference value satisfies the activation condition of the contrast focusing mode.

具体实现中,当移动终端判断出该绝对值小于预设阈值时,就表明该相位差值不能触发相位对焦模式,从而能够触发反差式对焦模式,因此,该移动终端就会确定该相位差值满足反差式对焦模式的启动条件。In the specific implementation, when the mobile terminal judges that the absolute value is less than the preset threshold value, it indicates that the phase difference value cannot trigger the phase focus mode, so that the contrast focus mode can be triggered, so the mobile terminal will determine the phase difference value Satisfy the activation condition of contrast focus mode.

举例来说,当获取到针对目标拍摄物的两个图像数据波形之间的相位差为-30度时,相位差值即为-30,该移动终端从而能够确定出该相位差值的绝对值为30。当预设阈值为20时,该移动终端就会判断出该绝对值大于预设阈值,从而确定出该相位差值不满足反差式对焦模式的启动条件;而如果该预设阈值为35时,那么该绝对值就小于预设阈值,因此,该移动终端就可以确定出该相位差值满足反差式对焦模式的启动条件。For example, when the acquired phase difference between the two image data waveforms of the target subject is -30 degrees, the phase difference value is -30, and the mobile terminal can determine the absolute value of the phase difference value for 30. When the preset threshold value is 20, the mobile terminal will determine that the absolute value is greater than the preset threshold value, thereby determining that the phase difference value does not meet the activation condition of the contrast focusing mode; and if the preset threshold value is 35, Then the absolute value is smaller than the preset threshold value, therefore, the mobile terminal can determine that the phase difference value satisfies the activation condition of the contrast focusing mode.

可选的,由于相位差值的绝对值较小时,其可靠性也较小,因此,在判断出该相位差值满足反差式对焦模式的启动条件之后,为了能够在反差式对焦模式下实现快速对焦,该相位差值的绝对值最好不要小于目标预设阈值,其中,该目标预设阈值要小于预设阈值。也就是说,为了能够根据相位差值准确的确定出在反差式对焦模式下对焦位置的对焦数据,该相位差值的绝对值最好是在目标预设阈值与预设阈值之间,如不大于25且不小于10。Optionally, since the absolute value of the phase difference value is small, its reliability is also low. Therefore, after it is judged that the phase difference value satisfies the activation condition of the contrast focus mode, in order to achieve fast For focusing, the absolute value of the phase difference value should preferably not be smaller than the target preset threshold, wherein the target preset threshold should be smaller than the preset threshold. That is to say, in order to accurately determine the focus data of the focus position in the contrast focus mode according to the phase difference value, the absolute value of the phase difference value is preferably between the target preset threshold and the preset threshold, if not Greater than 25 and not less than 10.

S103、该移动终端启动反差式对焦模式,并在该反差式对焦模式下根据该相位差值确定摄像头的对焦位置的对焦数据。S103. The mobile terminal starts a contrast focus mode, and determines focus data of a focus position of the camera according to the phase difference value in the contrast focus mode.

本发明实施例中,对焦数据可以包括摄像头的镜头移动至该摄像头对焦位置的移动方向,也可以包括移动的距离等,本发明实施例不做限定。In the embodiment of the present invention, the focus data may include the moving direction of the lens of the camera to the focus position of the camera, or the moving distance, etc., which are not limited in the embodiment of the present invention.

通常情况下,在启动反差式对焦模式之后,该移动终端会控制摄像头的镜头按照预设的轨迹移动,如先向前移动若没找到对焦位置,然后再向后移动,从而在预设的轨迹上查找到对焦位置。Usually, after starting the contrast focus mode, the mobile terminal will control the lens of the camera to move according to the preset trajectory, such as moving forward first if the focus position is not found, and then moving backward, so that the lens on the preset trajectory to find the focus position.

而本发明实施例中,在判断出该相位差值满足反差式对焦模式的启动条件之后,该移动终端就会启动反差式对焦,然后在反差式对焦模式下,根据该相位差值来确定摄像头的对焦位置的对焦数据。However, in the embodiment of the present invention, after judging that the phase difference value satisfies the starting conditions of the contrast focusing mode, the mobile terminal will start the contrast focusing mode, and then in the contrast focusing mode, according to the phase difference value, determine the camera The focus data of the focus position.

其中,由于相位差值存在正数和负数,如果相位差值为正数,说明某一图像数据波形在另一图像数据波形的正方向,而如果相位差值为负数,那么就说明某一图像数据波形在另一图像数据波形的负方向,因此,就可以根据该相位差值的正负性来确定该摄像头对焦位置的方向是向前还是向后。进一步的,该移动终端还可以通过相位差值确定出摄像头的镜头移动的大概距离,这样可以更加快速精准的找到对焦位置,从而实现反差式对焦。Among them, since the phase difference value has positive and negative numbers, if the phase difference value is positive, it means that a certain image data waveform is in the positive direction of another image data waveform, and if the phase difference value is negative, then it means that a certain image data waveform The data waveform is in the negative direction of another image data waveform, therefore, it can be determined whether the direction of the focus position of the camera is forward or backward according to the positive or negative of the phase difference value. Further, the mobile terminal can also determine the approximate moving distance of the lens of the camera through the phase difference value, so that the focusing position can be found more quickly and accurately, thereby achieving contrast focusing.

作为一种可行的实施方式,该移动终端在该反差式对焦模式下根据该相位差值确定摄像头的对焦位置的对焦数据的具体方式可以为:As a feasible implementation manner, the specific manner in which the mobile terminal determines the focus data of the focus position of the camera according to the phase difference value in the contrast focus mode may be as follows:

当该相位差值大于预设相位差值时,确定第一方向为该摄像头的对焦位置的移动方向,其中,该第一方向为该摄像头的镜头朝向该目标拍摄物的方向;When the phase difference value is greater than the preset phase difference value, determine the first direction as the moving direction of the focus position of the camera, wherein the first direction is the direction in which the lens of the camera faces the target object;

当该相位差值小于该预设相位差值时,确定第二方向为该摄像头的对焦位置的移动方向,其中,该第二方向为与该第一方向相反的方向。When the phase difference value is smaller than the preset phase difference value, the second direction is determined as the moving direction of the focusing position of the camera, wherein the second direction is a direction opposite to the first direction.

具体实现中,当该对焦数据包括摄像头的镜头至对焦位置的移动方向时,该预设相位差值为0,因此,该移动终端就可以通过判断该相位差值的正负性来确定其移动方向。In a specific implementation, when the focus data includes the moving direction of the lens of the camera to the focus position, the preset phase difference value is 0, so the mobile terminal can determine its movement by judging the positive or negative of the phase difference value. direction.

也就是说,当该相位差值大于0即为正数时,该移动终端就可以确定第一方向为该摄像头的对焦位置的移动方向。其中,第一方向表示的是该摄像头的镜头朝向该目标拍摄物的方向,即摄像头的镜头向外的方向。而当该相位差值小于0即为负数时,该移动终端就可以确定第二方向为该摄像头的对焦位置的移动方向。其中,该第二方向与第一方向相反,即该第二方向表示的是该摄像头的镜头背向该目标拍摄物的方向。That is to say, when the phase difference value is greater than 0 and is a positive number, the mobile terminal can determine that the first direction is the moving direction of the focus position of the camera. Wherein, the first direction indicates the direction in which the lens of the camera faces the target object, that is, the direction in which the lens of the camera faces outward. And when the phase difference value is less than 0 and is a negative number, the mobile terminal can determine that the second direction is the moving direction of the focus position of the camera. Wherein, the second direction is opposite to the first direction, that is, the second direction indicates a direction in which the lens of the camera faces away from the target object.

举例来说,假设移动终端获取的相位差值为-18,预设阈值为20,那么可以判断出该相位差值的绝对值18小于预设阈值20。因此,该移动终端就可以判断出该相位差值满足反差式对焦模式的启动条件,从而启动反差式对焦模式。由于该相位差值-18,为负数,那么该移动终端就可以确定出摄像头的对焦位置的移动方向为背向目标拍摄物的方向,即向后。而如果移动终端获取的相位差值为16,那么就可以确定摄像头的对焦位置的移动方向为朝向目标拍摄物的方向,即向前。For example, assuming that the phase difference obtained by the mobile terminal is -18 and the preset threshold is 20, it can be determined that the absolute value of the phase difference 18 is smaller than the preset threshold 20. Therefore, the mobile terminal can determine that the phase difference satisfies the activation condition of the contrast focusing mode, thereby activating the contrast focusing mode. Since the phase difference value -18 is a negative number, the mobile terminal can determine that the moving direction of the focusing position of the camera is the direction away from the target subject, that is, backward. And if the phase difference obtained by the mobile terminal is 16, then it can be determined that the moving direction of the focus position of the camera is the direction toward the target object, that is, forward.

S104、该移动终端根据该对焦数据控制该摄像头的镜头移动至该对焦位置,并结束本流程。S104. The mobile terminal controls the lens of the camera to move to the focus position according to the focus data, and ends this process.

本发明实施例中,当确定出摄像头的对焦数据之后,该移动终端就会根据该对焦数据控制该摄像头的镜头移动至该对焦位置。具体可以理解为:当对焦数据为移动方向时,在确定出摄像头的对焦位置的移动方向之后,该移动终端就会控制该摄像头的镜头朝该移动方向移动,从而能够快速找到对焦位置;进一步的,当对焦数据还包括移动距离时,该移动终端就可以确定出该摄像头的对焦位置的大致位置,即在确定出的移动方向上大概需要移动的距离,那么该移动终端就会控制该摄像头的镜头朝该位置移动,以快速找到对焦位置。In the embodiment of the present invention, after the focus data of the camera is determined, the mobile terminal controls the lens of the camera to move to the focus position according to the focus data. Specifically, it can be understood as: when the focusing data is the moving direction, after determining the moving direction of the focusing position of the camera, the mobile terminal will control the lens of the camera to move towards the moving direction, thereby being able to quickly find the focusing position; further , when the focus data also includes the moving distance, the mobile terminal can determine the approximate focus position of the camera, that is, the approximate moving distance in the determined moving direction, then the mobile terminal will control the camera’s The lens moves towards this position to quickly find the focus position.

举例来说,假设预设阈值为30,当用户需要对预览画面中的小猫对焦时,该用户会在屏幕上点击该小猫,然后移动终端会获取针对小猫的两个图像,并将这两个图像的RGB值生成两个图像数据波形,然后计算出这两个图像数据波形之间的相位差值为22。因此,该移动终端就可以判断出该相位差值满足反差式对焦模式的启动条件,从而可以启动反差式对焦模式,并由该相位差值确定出摄像头的对焦位置的移动方向为向前。因此,该移动终端就会控制该摄像头的镜头向前移动以快速找到对焦位置,从而能够快速完成对小猫的对焦。For example, assuming that the preset threshold is 30, when the user needs to focus on the kitten in the preview screen, the user will click the kitten on the screen, and then the mobile terminal will acquire two images of the kitten, and The RGB values of the two images generate two image data waveforms, and then the phase difference value between the two image data waveforms is calculated as 22. Therefore, the mobile terminal can determine that the phase difference value satisfies the activation condition of the contrast focusing mode, thereby enabling the contrast focusing mode, and determine that the moving direction of the focusing position of the camera is forward based on the phase difference value. Therefore, the mobile terminal will control the lens of the camera to move forward to quickly find the focus position, so that the focus on the kitten can be quickly completed.

可见,在图1所描述的方法中,当接收到针对目标拍摄物的对焦指令时,移动终端会获取针对该目标拍摄物的两个图像数据波形之间的相位差值,并判断该相位差值是否满足反差式对焦模式的启动条件,如果满足,就启动反差式对焦模式,并在反差式对焦模式下根据该相位差值确定摄像头的对焦位置的对焦数据,最终根据该对焦数据控制该摄像头的镜头移动至该对焦位置。通过本发明实施例,在启动反差式对焦模式时,可以通过获取的相位差值来确定摄像头的对焦位置的方向,然后直接控制该摄像头的镜头向该方向移动,从而能快速找到对焦位置,提高反差式对焦的对焦速度,提升用户体验。It can be seen that in the method described in FIG. 1 , when receiving a focus instruction for a target object, the mobile terminal will obtain the phase difference value between two image data waveforms for the target object, and determine the phase difference Whether the value satisfies the starting conditions of the contrast focus mode, if so, start the contrast focus mode, and determine the focus data of the focus position of the camera according to the phase difference value in the contrast focus mode, and finally control the camera according to the focus data The lens moves to that focus position. Through the embodiment of the present invention, when the contrast focus mode is started, the direction of the focus position of the camera can be determined by the obtained phase difference value, and then the lens of the camera is directly controlled to move in this direction, so that the focus position can be quickly found and the focus can be improved. The focusing speed of contrast focusing improves user experience.

请参阅图2,图2是本发明实施例公开的另一种反差式对焦方法的流程示意图。其中,图2所示的方法可以应用于智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备、个人数字助理、媒体播放器、智能电视、智能手表、智能眼镜、智能手环等移动终端。如图2所示,该反差式对焦方法可以包括以下步骤:Please refer to FIG. 2 . FIG. 2 is a schematic flowchart of another contrast focusing method disclosed in an embodiment of the present invention. Wherein, the method shown in Figure 2 can be applied to smart phones (such as Android phones, iOS phones, etc.), tablet computers, handheld computers and mobile Internet devices, personal digital assistants, media players, smart TVs, smart watches, smart glasses, Mobile terminals such as smart bracelets. As shown in Figure 2, the contrast focusing method may include the following steps:

S201、当接收到针对目标拍摄物的对焦指令时,移动终端获取针对该目标拍摄物的两个图像数据波形之间的相位差值。S201. When receiving a focus instruction for a target object, the mobile terminal acquires a phase difference value between two image data waveforms for the target object.

S202、该移动终端判断该相位差值是否满足反差式对焦模式启动条件,若是,执行步骤S203;若否,结束本流程。S202. The mobile terminal judges whether the phase difference value satisfies the activation condition of the contrast focusing mode, and if yes, executes step S203; if not, ends the process.

S203、该移动终端启动反差式对焦模式,并在该反差式对焦模式下根据该相位差值确定摄像头的对焦位置的对焦数据。S203. The mobile terminal starts a contrast focus mode, and determines focus data of a focus position of the camera according to the phase difference value in the contrast focus mode.

S204、该移动终端根据该对焦数据控制该摄像头的镜头移动至该对焦位置S204. The mobile terminal controls the lens of the camera to move to the focus position according to the focus data

S205、该移动终端接收目标穿戴设备发送的拍摄指令。S205. The mobile terminal receives the shooting instruction sent by the target wearable device.

本发明实施例中,当移动终端根据该对焦数据控制该摄像头的镜头移动至该对焦位置时,即可表示该移动终端完成了对该目标拍摄物的对焦。因此,用户可以触发针对目标拍摄物的拍摄指令。In the embodiment of the present invention, when the mobile terminal controls the lens of the camera to move to the focus position according to the focus data, it means that the mobile terminal has finished focusing on the target object. Therefore, the user can trigger a shooting instruction for the target object.

其中,该目标穿戴设备可以时智能手环、智能手表、智能眼镜等,本发明实施例不做限定。Wherein, the target wearable device may be a smart bracelet, a smart watch, smart glasses, etc., which is not limited in this embodiment of the present invention.

具体的,用户可以通过穿戴的目标穿戴设备向移动终端发送拍摄指令,其中,该拍摄指令可以是目标穿戴设备检测到预设频率的振动信号之后生成的。通过这种方式,用户可以对移动终端的进行远程操作,从而完成拍摄。Specifically, the user may send a shooting instruction to the mobile terminal through the target wearable device worn, wherein the shooting instruction may be generated after the target wearable device detects a vibration signal of a preset frequency. In this way, the user can remotely operate the mobile terminal to complete the shooting.

可选的,该拍摄指令还可以是用户通过敲击目标穿戴设备时生成的、或通过操作目标穿戴设备上的相机应用的快门键生成的拍摄指令,从而发送至移动终端。Optionally, the shooting instruction may also be a shooting instruction generated when the user taps the target wearable device, or by operating a shutter button of a camera application on the target wearable device, and then sent to the mobile terminal.

可选的,用户也可以直接点击或触摸该移动终端的快门键对该目标拍摄物进行拍摄。Optionally, the user can also directly click or touch the shutter button of the mobile terminal to shoot the target object.

举例来说,当移动终端完成对目标拍摄物的对焦操作之后,用户可以以一定的频率或者特定的方向晃动智能手环,然后到该智能手环检测到振动信号之后,就会生成拍摄指令,并将该拍摄指令发送给移动终端,移动终端从而接收到目标穿戴设备发送的拍摄指令。For example, after the mobile terminal completes the focusing operation on the target object, the user can shake the smart bracelet at a certain frequency or in a specific direction, and then after the smart bracelet detects a vibration signal, it will generate a shooting instruction. And send the shooting instruction to the mobile terminal, and the mobile terminal thus receives the shooting instruction sent by the target wearable device.

S206、该移动终端响应该拍摄指令,控制该摄像头在该对焦位置上对该目标拍摄物进行拍摄,并结束本流程。S206. In response to the shooting instruction, the mobile terminal controls the camera to shoot the target object at the focus position, and ends the process.

本发明实施例中,当移动终端接收到目标穿戴设备发送的拍摄指令时,该移动终端就会响应该拍摄指令,并控制该摄像头在其对焦位置上对该目标拍摄物进行拍摄。In the embodiment of the present invention, when the mobile terminal receives the shooting instruction sent by the target wearable device, the mobile terminal will respond to the shooting instruction and control the camera to shoot the target object at its focus position.

具体的,由于移动终端获取的两个图像数据波形之间的相位差值不满足相位对焦,该移动终端从而采用反差式对焦。因此,该移动终端就会根据该相位差值辅助反差式对焦,以快速将摄像头的镜头移动至对焦位置上。那么当移动终端接收到目标穿戴设备发送的拍摄指令时,该移动终端就会控制该摄像头的镜头在该对焦位置上对该目标拍摄物进行拍摄。Specifically, since the phase difference value between the two image data waveforms acquired by the mobile terminal does not satisfy phase focusing, the mobile terminal adopts contrast focusing. Therefore, the mobile terminal assists contrast focusing according to the phase difference value, so as to quickly move the lens of the camera to the focusing position. Then, when the mobile terminal receives the shooting instruction sent by the target wearable device, the mobile terminal will control the lens of the camera to shoot the target object at the focus position.

可见,在图2所描述的方法中,在移动终端完成对目标拍摄物的对焦操作之后,用户可以通过穿戴设备控制该移动终端对该目标拍摄物进行拍摄,从而能够更大视角的完成自拍、合影等操作。这种远距离操控移动终端的拍摄方式,更加能够受到消费者的青睐,从而提升用户体验。It can be seen that in the method described in FIG. 2, after the mobile terminal completes the focusing operation on the target object, the user can control the mobile terminal to take pictures of the target object through the wearable device, so as to complete Selfie, Group photo and other operations. This shooting method of remotely controlling the mobile terminal is more favored by consumers, thereby improving the user experience.

请参阅图3,图3是本发明实施例公开的一种移动终端的结构示意图。其中,图3所示的移动终端300可以包括但不限于智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备、个人数字助理、媒体播放器、智能电视、智能手表、智能眼镜、智能手环等。如图3所示,该移动终端300可以包括以下单元:Please refer to FIG. 3 . FIG. 3 is a schematic structural diagram of a mobile terminal disclosed in an embodiment of the present invention. Wherein, the mobile terminal 300 shown in Figure 3 may include but not limited to smart phones (such as Android phones, iOS phones, etc.), tablet computers, palmtop computers and mobile Internet devices, personal digital assistants, media players, smart TVs, smart watches , smart glasses, smart bracelets, etc. As shown in Figure 3, the mobile terminal 300 may include the following units:

获取单元301,用于当接收到针对目标拍摄物的对焦指令时,获取针对该目标拍摄物的两个图像数据波形之间的相位差值。The acquisition unit 301 is configured to acquire a phase difference value between two image data waveforms of the target object when a focus instruction for the target object is received.

本发明实施例中,移动终端300的摄像头包括有图像传感器,可以通过图像传感器来采集图像,该图像传感器可以为线性传感器。由于相位对焦的速度较快,因此,移动终端300通常会采用相位对焦方式进行对焦。在相位对焦过程中,移动终端300会通过图像传感器来获取两个图像,从而得到这两个图像的图像数据波形,并计算出这两个图像数据波形之间的相位差值,根据相位差值来进行相位对焦。In the embodiment of the present invention, the camera of the mobile terminal 300 includes an image sensor, and an image may be collected by the image sensor, and the image sensor may be a linear sensor. Since the speed of phase focusing is relatively fast, the mobile terminal 300 usually uses phase focusing to focus. During the phase focusing process, the mobile terminal 300 will acquire two images through the image sensor, thus obtain the image data waveforms of the two images, and calculate the phase difference value between the two image data waveforms, according to the phase difference value for phase focusing.

因此,当用户在预览图像中点击或触摸目标拍摄物所在的区域之后,该移动终端300就会接收到针对该目标拍摄物的对焦指令,首选相位对焦方式进行对焦。具体的,获取单元301会通过图像传感器来获取针对该目标拍摄物的两个图像数据波形,并得到这两个图像数据波形之间的相位差值。Therefore, after the user clicks or touches the area where the target object is located in the preview image, the mobile terminal 300 will receive a focusing instruction for the target object, and the phase focus method is preferred for focusing. Specifically, the acquiring unit 301 acquires two image data waveforms for the target subject through an image sensor, and obtains a phase difference value between the two image data waveforms.

判断单元302,用于判断上述获取单元301获取的相位差值是否满足反差式对焦模式的启动条件。The judging unit 302 is configured to judge whether the phase difference value acquired by the acquiring unit 301 satisfies the activation condition of the contrast focusing mode.

本发明实施例中,移动终端300在采用相位对焦技术时,由于相位对焦也是被动式对焦方式,是靠光线反射进镜头,然后传送到相应的部件上去进行识别,并确定对焦模块如何工作的。那么,当光线较弱或者光线不足时,对焦速度和性能会明显下降,还可能出现无法对焦的局面。In the embodiment of the present invention, when the mobile terminal 300 adopts the phase focusing technology, since the phase focusing is also a passive focusing method, the light is reflected into the lens, and then transmitted to the corresponding components for identification and to determine how the focusing module works. Then, when the light is weak or the light is insufficient, the focusing speed and performance will be significantly reduced, and there may be a situation where focusing cannot be achieved.

也就是说,如果外界环境中光线较弱,获取单元301获取到的相位差值的绝对值较小,可能会导致不能启动相位对焦模式,为了能够较快的实现对焦,该移动终端300就会采用反差式对焦。That is to say, if the light in the external environment is weak, the absolute value of the phase difference value acquired by the acquisition unit 301 is small, which may cause the phase focus mode to fail to start. In order to achieve focus quickly, the mobile terminal 300 will Contrast focus is used.

因此,在获取单元301获取到两个图像数据波形之间的相位差值之后,判断单元302就会判断该相位差值是否满足反差式对焦模式的启动条件,也可以理解为:判断单元302会判断该相位差值是否能触发相位对焦模式的启动条件。Therefore, after the acquiring unit 301 acquires the phase difference between the two image data waveforms, the judging unit 302 will judge whether the phase difference satisfies the activation condition of the contrast focusing mode, which can also be understood as: the judging unit 302 will It is judged whether the phase difference value can trigger the activation condition of the phase focus mode.

进一步的,当判断单元302判断出该相位差值满足反差式对焦模式的启动条件时,也就表明该相位差值不能触发相位对焦模式的启动,因此,该移动终端300就会启动反差式对焦模式;而当判断单元302判断出该相位差值不满足反差式对焦模式的启动条件时,也就表明该相位差值能触发相位对焦模式的启动,那么该移动终端300就会继续采用相位对焦模式对该目标拍摄物进行对焦。Further, when the judging unit 302 judges that the phase difference value satisfies the activation condition of the contrast focusing mode, it also indicates that the phase difference value cannot trigger the activation of the phase focusing mode, so the mobile terminal 300 will start the contrast focusing mode mode; and when the judging unit 302 judges that the phase difference value does not meet the activation conditions of the contrast focus mode, it means that the phase difference value can trigger the phase focus mode activation, then the mobile terminal 300 will continue to use the phase focus mode mode to focus on the target subject.

确定单元303,用于在上述判断单元302判断出该相位差值满足反差式对焦模式的启动条件时,启动反差式对焦模式,并在该反差式对焦模式下根据该相位差值确定摄像头的对焦位置的对焦数据。The determination unit 303 is configured to start the contrast focus mode when the judgment unit 302 judges that the phase difference value satisfies the start condition of the contrast focus mode, and determine the focus of the camera according to the phase difference value in the contrast focus mode The focus data for the position.

本发明实施例中,对焦数据可以包括摄像头的镜头移动至该摄像头对焦位置的移动方向,也可以包括移动的距离等,本发明实施例不做限定。In the embodiment of the present invention, the focus data may include the moving direction of the lens of the camera to the focus position of the camera, or the moving distance, etc., which are not limited in the embodiment of the present invention.

通常情况下,在启动反差式对焦模式之后,该移动终端300会控制摄像头的镜头按照预设的轨迹移动,如先向前移动若没找到对焦位置,然后再向后移动,从而在预设的轨迹上查找到对焦位置。Usually, after starting the contrast focus mode, the mobile terminal 300 will control the lens of the camera to move according to the preset trajectory, such as moving forward first if the focus position is not found, and then moving backward, so that the Find the focus position on the track.

而本发明实施例中,在判断单元302判断出该相位差值满足反差式对焦模式的启动条件之后,确定单元303就会启动反差式对焦,然后在反差式对焦模式下,根据该相位差值来确定摄像头的对焦位置的对焦数据。However, in the embodiment of the present invention, after the judging unit 302 judges that the phase difference value satisfies the activation condition of the contrast focusing mode, the determining unit 303 will start the contrast focusing mode, and then in the contrast focusing mode, according to the phase difference value To determine the focus data of the focus position of the camera.

其中,由于相位差值存在正数和负数,如果相位差值为正数,说明某一图像数据波形在另一图像数据波形的正方向,而如果相位差值为负数,那么就说明某一图像数据波形在另一图像数据波形的负方向,因此,就可以根据该相位差值的正负性来确定该摄像头对焦位置的方向是向前还是向后。进一步的,确定单元303还可以通过相位差值确定出摄像头的镜头移动的大概距离,这样可以更加快速精准的找到对焦位置,从而实现反差式对焦。Among them, since the phase difference value has positive and negative numbers, if the phase difference value is positive, it means that a certain image data waveform is in the positive direction of another image data waveform, and if the phase difference value is negative, then it means that a certain image data waveform The data waveform is in the negative direction of another image data waveform, therefore, it can be determined whether the direction of the focus position of the camera is forward or backward according to the positive or negative of the phase difference value. Further, the determination unit 303 can also determine the approximate distance of the lens movement of the camera through the phase difference value, so that the focusing position can be found more quickly and accurately, thereby realizing contrast focusing.

控制单元304,用于根据上述确定单元303确定的对焦数据控制该摄像头的镜头移动至该对焦位置。The control unit 304 is configured to control the lens of the camera to move to the focus position according to the focus data determined by the determination unit 303 .

本发明实施例中,当确定单元303确定出摄像头的对焦数据之后,控制单元304就会根据该对焦数据控制该摄像头的镜头移动至该对焦位置。具体可以理解为:当对焦数据为移动方向时,在确定单元303确定出摄像头的对焦位置的移动方向之后,控制单元304就会控制该摄像头的镜头朝该移动方向移动,从而能够快速找到对焦位置;进一步的,当对焦数据还包括移动距离时,确定单元303就可以确定出该摄像头的对焦位置的大致位置,即在确定出的移动方向上大概需要移动的距离,那么控制单元304就会控制该摄像头的镜头朝该位置移动,以快速找到对焦位置。In the embodiment of the present invention, after the determining unit 303 determines the focus data of the camera, the control unit 304 controls the lens of the camera to move to the focus position according to the focus data. Specifically, it can be understood as: when the focus data is the moving direction, after the determining unit 303 determines the moving direction of the focus position of the camera, the control unit 304 will control the lens of the camera to move towards the moving direction, so that the focus position can be quickly found ; Further, when the focus data also includes the moving distance, the determining unit 303 can determine the approximate position of the focus position of the camera, that is, the approximate moving distance in the determined moving direction, then the control unit 304 will control The camera's lens moves toward this position to quickly find focus.

举例来说,假设预设阈值为30,当用户需要对预览画面中的小猫对焦时,该用户会在屏幕上点击该小猫,然后获取单元301会获取针对小猫的两个图像,并将这两个图像的RGB值生成两个图像数据波形,然后计算出这两个图像数据波形之间的相位差值为22。因此,判断单元302就可以判断出该相位差值满足反差式对焦模式的启动条件,从而可以触发确定单元302启动反差式对焦模式,并由该相位差值确定出摄像头的对焦位置的移动方向为向前。因此,控制单元304就会控制该摄像头的镜头向前移动以快速找到对焦位置,从而能够快速完成对小猫的对焦。For example, assuming that the preset threshold is 30, when the user needs to focus on the kitten in the preview screen, the user will click the kitten on the screen, and then the obtaining unit 301 will obtain two images for the kitten, and The RGB values of the two images are used to generate two image data waveforms, and then the phase difference value between the two image data waveforms is calculated to be 22. Therefore, the judging unit 302 can judge that the phase difference value satisfies the starting condition of the contrast focusing mode, thereby triggering the determining unit 302 to start the contrast focusing mode, and determining the moving direction of the focus position of the camera from the phase difference value as forward. Therefore, the control unit 304 will control the lens of the camera to move forward to quickly find the focus position, so that the focus on the kitten can be completed quickly.

可见,在图3所描述的移动终端中,当接收到针对目标拍摄物的对焦指令时,移动终端会获取针对该目标拍摄物的两个图像数据波形之间的相位差值,并判断该相位差值是否满足反差式对焦模式的启动条件,如果满足,就启动反差式对焦模式,并在反差式对焦模式下根据该相位差值确定摄像头的对焦位置的对焦数据,最终根据该对焦数据控制该摄像头的镜头移动至该对焦位置。通过本发明实施例,在启动反差式对焦模式时,可以通过获取的相位差值来确定摄像头的对焦位置的方向,然后直接控制该摄像头的镜头向该方向移动,从而能快速找到对焦位置,提高反差式对焦的对焦速度,提升用户体验。It can be seen that in the mobile terminal described in FIG. 3 , when receiving a focus command for the target object, the mobile terminal will obtain the phase difference between the two image data waveforms for the target object, and judge the phase Whether the difference satisfies the starting conditions of the contrast focus mode, if so, start the contrast focus mode, and determine the focus data of the focus position of the camera according to the phase difference in the contrast focus mode, and finally control the focus position according to the focus data The lens of the camera moves to this focus position. Through the embodiment of the present invention, when the contrast focus mode is started, the direction of the focus position of the camera can be determined by the obtained phase difference value, and then the lens of the camera is directly controlled to move in this direction, so that the focus position can be quickly found and the focus can be improved. The focusing speed of contrast focusing improves user experience.

请参阅图4,图4是本发明实施例公开的另一种移动终端的结构示意图。其中,图4所示的移动终端300是在图3所示的移动终端300的基础上进行优化得到的。如图4所示,该移动终端300还可以包括以下单元:Please refer to FIG. 4 . FIG. 4 is a schematic structural diagram of another mobile terminal disclosed in an embodiment of the present invention. Wherein, the mobile terminal 300 shown in FIG. 4 is obtained by optimizing the mobile terminal 300 shown in FIG. 3 . As shown in Figure 4, the mobile terminal 300 may also include the following units:

接收单元305,用于在所述控制单元304根据对焦数据控制该摄像头的镜头移动至对焦位置之后,接收目标穿戴设备发送的拍摄指令。The receiving unit 305 is configured to receive the shooting instruction sent by the target wearable device after the control unit 304 controls the lens of the camera to move to the focusing position according to the focusing data.

本发明实施例中,当控制单元304根据该对焦数据控制该摄像头的镜头移动至该对焦位置时,即可表示该移动终端300完成了对该目标拍摄物的对焦。因此,用户可以触发针对目标拍摄物的拍摄指令。In the embodiment of the present invention, when the control unit 304 controls the lens of the camera to move to the focus position according to the focus data, it means that the mobile terminal 300 has finished focusing on the target object. Therefore, the user can trigger a shooting instruction for the target object.

其中,该目标穿戴设备可以时智能手环、智能手表、智能眼镜等,本发明实施例不做限定。Wherein, the target wearable device may be a smart bracelet, a smart watch, smart glasses, etc., which is not limited in this embodiment of the present invention.

具体的,用户可以通过穿戴的目标穿戴设备向移动终端300发送拍摄指令,其中,该拍摄指令可以是目标穿戴设备检测到预设频率的振动信号之后生成的。通过这种方式,用户可以对移动终端300的进行远程操作,从而完成拍摄。Specifically, the user may send a photographing instruction to the mobile terminal 300 through the target wearable device worn, wherein the photographing instruction may be generated after the target wearable device detects a vibration signal of a preset frequency. In this way, the user can remotely operate the mobile terminal 300 to complete shooting.

可选的,该拍摄指令还可以是用户通过敲击目标穿戴设备时生成的、或通过操作目标穿戴设备上的相机应用的快门键生成的拍摄指令,从而发送至移动终端300。Optionally, the shooting instruction may also be a shooting instruction generated when the user taps the target wearable device, or by operating a shutter button of a camera application on the target wearable device, and then sent to the mobile terminal 300 .

可选的,用户也可以直接点击或触摸该移动终端300的快门键对该目标拍摄物进行拍摄。Optionally, the user can also directly click or touch the shutter button of the mobile terminal 300 to shoot the target subject.

举例来说,当移动终端300完成对目标拍摄物的对焦操作之后,用户可以以一定的频率或者特定的方向晃动智能手环,然后到该智能手环检测到振动信号之后,就会生成拍摄指令,并将该拍摄指令发送给移动终端300,接收单元305从而接收到目标穿戴设备发送的拍摄指令。For example, after the mobile terminal 300 completes the focusing operation on the target object, the user can shake the smart bracelet at a certain frequency or in a specific direction, and then after the smart bracelet detects a vibration signal, a shooting instruction will be generated , and send the shooting instruction to the mobile terminal 300, so that the receiving unit 305 receives the shooting instruction sent by the target wearable device.

上述控制单元304,还用于在上述接收单元305接收到拍摄指令时,响应该拍摄指令,控制该摄像头在该对焦位置上对该目标拍摄物进行拍摄。The control unit 304 is further configured to, when the receiving unit 305 receives the shooting instruction, respond to the shooting instruction, and control the camera to shoot the target object at the focus position.

本发明实施例中,当接收单元305接收到目标穿戴设备发送的拍摄指令时,控制单元304就会响应该拍摄指令,并控制该摄像头在其对焦位置上对该目标拍摄物进行拍摄。In the embodiment of the present invention, when the receiving unit 305 receives the shooting instruction sent by the target wearable device, the control unit 304 will respond to the shooting instruction and control the camera to shoot the target object at its focus position.

具体的,由于获取单元301获取的两个图像数据波形之间的相位差值不满足相位对焦,该移动终端300从而采用反差式对焦。因此,该移动终端300就会根据该相位差值辅助反差式对焦,以快速将摄像头的镜头移动至对焦位置上。那么当接收单元305接收到目标穿戴设备发送的拍摄指令时,控制单元304就会控制该摄像头的镜头在该对焦位置上对该目标拍摄物进行拍摄。Specifically, since the phase difference value between the two image data waveforms acquired by the acquisition unit 301 does not satisfy the phase focus, the mobile terminal 300 adopts contrast focus. Therefore, the mobile terminal 300 assists contrast focusing according to the phase difference value, so as to quickly move the lens of the camera to the focusing position. Then, when the receiving unit 305 receives the shooting instruction sent by the target wearable device, the control unit 304 will control the lens of the camera to shoot the target object at the focus position.

本发明实施例中,上述获取单元301可以包括获取子单元3011、生成子单元3012以及计算子单元3013,其中:In the embodiment of the present invention, the acquisition unit 301 may include an acquisition subunit 3011, a generation subunit 3012, and a calculation subunit 3013, wherein:

上述获取子单元3011,用于针对该目标拍摄物,通过摄像头中图像传感器的左像素点获取第一图像的图像数据,并通过该图像传感器的右像素点获取第二图像的图像数据。The acquisition subunit 3011 is configured to acquire the image data of the first image through the left pixel of the image sensor in the camera, and acquire the image data of the second image through the right pixel of the image sensor for the target subject.

具体实现中,在相位对焦技术中,图像传感器的像素点包括左像素点和右像素点,在进行对焦时,首先会通过左右像素点分别获取预览画面的两个图像。In specific implementation, in the phase focusing technology, the pixels of the image sensor include left pixels and right pixels. When focusing, firstly, two images of the preview screen are respectively obtained through the left and right pixels.

因此,在接收到针对该目标拍摄物的对焦指令之后,获取子单元3011就会通过摄像头中图像传感器的左像素点获取针对该目标拍摄物的第一图像,从而得到第一图像的图像数据;并通过摄像头中图像传感器的右像素点或者针对该目标拍摄物的第二图像,从而得到第二图像的图像数据。其中,图像数据可以包括但不限于RGB值、灰阶值、灰度值等。Therefore, after receiving the focusing instruction for the target object, the acquiring subunit 3011 will acquire the first image for the target object through the left pixel of the image sensor in the camera, thereby obtaining the image data of the first image; And the image data of the second image is obtained through the right pixel of the image sensor in the camera or the second image of the target subject. Wherein, the image data may include but not limited to RGB values, grayscale values, grayscale values, etc.

上述生成子单元3012,用于根据该第一图像的图像数据生成第一图像数据波形,并根据第二图像的图像数据生成第二图像数据波形。The generating subunit 3012 is configured to generate the first image data waveform according to the image data of the first image, and generate the second image data waveform according to the image data of the second image.

具体实现中,当获取子单元3011获取到第一图像的图像数据之后,生成子单元3012会将该第一图像的所有图像数据生成第一图像数据波形;而当获取子单元3011获取到第二图像的图像数据之后,生成子单元3012会将该第二图像的所有图像数据生成第二图像数据波形。In specific implementation, after the acquisition subunit 3011 acquires the image data of the first image, the generation subunit 3012 will generate the first image data waveform for all the image data of the first image; and when the acquisition subunit 3011 acquires the second After the image data of the image, the generating subunit 3012 will generate the second image data waveform for all the image data of the second image.

举例来说,当获取子单元3011通过左像素点获取到第一图像的RGB值之后,生成子单元3012会根据该第一图像的所有RGB值生成第一图像数据波形;当获取子单元3011通过右像素点获取到第二图像的RGB值之后,生成子单元3012会根据该第二图像的所有RGB值生成第二图像数据波形。由于波形存在波峰以及波谷,因此,计算子单元3013可以通过波形的波峰或波谷之间的相位来计算出第一图像数据波形与第二图像数据波形之间的相位差值。For example, after the acquisition subunit 3011 acquires the RGB value of the first image through the left pixel, the generation subunit 3012 will generate the first image data waveform according to all the RGB values of the first image; when the acquisition subunit 3011 passes After the right pixel acquires the RGB values of the second image, the generating subunit 3012 generates the second image data waveform according to all the RGB values of the second image. Since there are peaks and troughs in the waveform, the calculating subunit 3013 can calculate the phase difference between the waveform of the first image data and the waveform of the second image data through the phase between the peaks or troughs of the waveform.

上述计算子单元3013,用于计算该第一图像数据波形与该第二图像数据波形之间的相位差值。The calculation subunit 3013 is used to calculate the phase difference between the waveform of the first image data and the waveform of the second image data.

具体实现中,当生成子单元3012分别生成第一图像数据波形以及第二图像数据波形之后,计算子单元3013就会计算两个图像数据波形之间的相位差值。通常情况下,只有当两个图像数据波形之间的相位差之为零时,才表示获取的预览图像为最清晰的图像,而如果两个图像数据波形之间存在相位差时,就需要通过对焦的形式获取最清晰的预览图像。在相位对焦模式下,可以通过计算出的相位差值来确定摄像头的对焦位置,从而能够实现快速对焦。In a specific implementation, after the generation subunit 3012 respectively generates the first image data waveform and the second image data waveform, the calculation subunit 3013 will calculate the phase difference between the two image data waveforms. Usually, only when the phase difference between the two image data waveforms is zero, it means that the acquired preview image is the clearest image, and if there is a phase difference between the two image data waveforms, it needs to pass Get the clearest preview image by focusing. In the phase focus mode, the focus position of the camera can be determined through the calculated phase difference value, so as to achieve fast focus.

进一步的,计算子单元3013计算该第一图像数据波形与该第二图像数据波形之间的相位差值也可以理解为:通过线性传感器检测出第一图像与第二图像之间的距离,该距离也可以理解为两个图像数据波形之间的相位差。Further, calculating the phase difference value between the first image data waveform and the second image data waveform by the calculation subunit 3013 can also be understood as: the distance between the first image and the second image is detected by a linear sensor, the Distance can also be understood as the phase difference between two image data waveforms.

本发明实施例中,上述判断单元302可以包括确定子单元3021以及判断子单元3022,其中:In the embodiment of the present invention, the above judgment unit 302 may include a determination subunit 3021 and a judgment subunit 3022, wherein:

上述确定子单元3021,用于确定上述获取单元301获取的相位差值的绝对值。The determination subunit 3021 is configured to determine the absolute value of the phase difference value acquired by the acquisition unit 301 .

具体实现中,两个图像数据波形之间的相位差值可能为正数,也可能为负数,相位差值的正负性可以分别表示移动终端的摄像头的镜头移动至对焦位置的正负方向。因此,在获取单元301获取到针对目标拍摄物的两个图像数据波形之间的相位差值之后,确定子单元3021就会计算出该相位差值的绝对值。In a specific implementation, the phase difference between the two image data waveforms may be a positive number or a negative number, and the sign of the phase difference may indicate the positive and negative directions in which the lens of the camera of the mobile terminal moves to the focus position, respectively. Therefore, after the acquisition unit 301 acquires the phase difference value between the two image data waveforms of the target subject, the determination subunit 3021 will calculate the absolute value of the phase difference value.

上述判断子单元3022,用于判断上述确定子单元3021确定的绝对值是否小于预设阈值。The judging subunit 3022 is configured to judge whether the absolute value determined by the determining subunit 3021 is smaller than a preset threshold.

具体实现中,当确定子单元3021确定出该相位差值的绝对值时,判断子单元3022就会通过该绝对值来判断是启动相位对焦模式,还是启动反差式对焦模式。通常情况下,启动相位对焦模式是需要相位差值的绝对值大于某个阈值才能触发的,如果小于该阈值,为了能够实现对焦,一般会启动反差式对焦模式。In a specific implementation, when the determining subunit 3021 determines the absolute value of the phase difference, the judging subunit 3022 will use the absolute value to judge whether to start the phase focus mode or the contrast focus mode. Normally, the phase difference focus mode is triggered only when the absolute value of the phase difference value is greater than a certain threshold. If it is less than the threshold value, in order to achieve focus, the contrast focus mode is generally activated.

也就是说,该预设阈值是反差式对焦模式与相位对焦模式之间的分界线。该预设阈值的大小可以视情况而定,即可以根据相位对焦模组的性能来确定,本发明实施例不做限定。因此,在确定子单元3021确定出该相位差值的绝对值之后,判断子单元3022就会判断该绝对值是否小于预设阈值。如果小于,确定子单元3021就确定该相位差值满足反差式对焦模式的启动条件;而如果大于,就表明该相位差值满足相位对焦模式的启动条件,因此,该移动终端300就会启动相位对焦模式对该目标拍摄物进行对焦。That is to say, the preset threshold is the dividing line between the contrast focusing mode and the phase focusing mode. The size of the preset threshold can be determined according to the situation, that is, it can be determined according to the performance of the phase focusing module, which is not limited in the embodiment of the present invention. Therefore, after the determining subunit 3021 determines the absolute value of the phase difference, the judging subunit 3022 judges whether the absolute value is smaller than a preset threshold. If it is less than, the determination subunit 3021 determines that the phase difference value meets the activation condition of the contrast focus mode; The focus mode focuses on the target subject.

上述确定子单元3021,还用于在上述判断子单元3022判断出该绝对值小于预设阈值时,确定该相位差值满足反差式对焦模式的启动条件。The determining subunit 3021 is further configured to determine that the phase difference value satisfies the activation condition of the contrast focusing mode when the determining subunit 3022 determines that the absolute value is smaller than a preset threshold.

具体实现中,当判断子单元3022判断出该绝对值小于预设阈值时,就表明该相位差值不能触发相位对焦模式,从而能够触发反差式对焦模式,因此,确定子单元3021就会确定该相位差值满足反差式对焦模式的启动条件。In specific implementation, when the judging subunit 3022 judges that the absolute value is less than the preset threshold value, it indicates that the phase difference value cannot trigger the phase focusing mode, and thus can trigger the contrast focusing mode. Therefore, the determining subunit 3021 will determine the The phase difference value satisfies the activation condition of the contrast focusing mode.

举例来说,当获取单元301获取到针对目标拍摄物的两个图像数据波形之间的相位差为-30度时,相位差值即为-30,从而能够确定出该相位差值的绝对值为30。当预设阈值为20时,判断子单元3022就会判断出该绝对值大于预设阈值,从而确定子单元3021确定出该相位差值不满足反差式对焦模式的启动条件;而如果该预设阈值为35时,那么该绝对值就小于预设阈值,因此,确定子单元3021就可以确定出该相位差值满足反差式对焦模式的启动条件。For example, when the acquisition unit 301 acquires that the phase difference between the two image data waveforms of the target subject is -30 degrees, the phase difference value is -30, so that the absolute value of the phase difference value can be determined for 30. When the preset threshold value is 20, the judging subunit 3022 will judge that the absolute value is greater than the preset threshold value, so the determining subunit 3021 determines that the phase difference value does not meet the activation condition of the contrast focusing mode; and if the preset When the threshold is 35, the absolute value is smaller than the preset threshold, so the determining subunit 3021 can determine that the phase difference meets the activation condition of the contrast focusing mode.

可选的,由于相位差值的绝对值较小时,其可靠性也较小,因此,在判断子单元3022判断出该相位差值满足反差式对焦模式的启动条件之后,为了能够在反差式对焦模式下实现快速对焦,该相位差值的绝对值最好不要小于目标预设阈值,其中,该目标预设阈值要小于预设阈值。也就是说,为了能够根据相位差值准确的确定出在反差式对焦模式下对焦位置的对焦数据,该相位差值的绝对值最好是在目标预设阈值与预设阈值之间,如不大于25且不小于10。Optionally, when the absolute value of the phase difference value is small, its reliability is also low. Therefore, after the judging subunit 3022 judges that the phase difference value satisfies the activation condition of the contrast focusing mode, in order to be able to In order to realize fast focusing under the mode, the absolute value of the phase difference value should preferably not be smaller than the target preset threshold value, wherein the target preset threshold value should be smaller than the preset threshold value. That is to say, in order to accurately determine the focus data of the focus position in the contrast focus mode according to the phase difference value, the absolute value of the phase difference value is preferably between the target preset threshold and the preset threshold, if not Greater than 25 and not less than 10.

本发明实施例中,当对焦数据包括移动方向时,上述确定单元303在该反差式对焦模式下根据该相位差值确定摄像头的对焦位置的对焦数据的具体方式可以为:In the embodiment of the present invention, when the focus data includes the moving direction, the specific method for the determination unit 303 to determine the focus data of the focus position of the camera according to the phase difference value in the contrast focus mode may be as follows:

当该相位差值大于预设相位差值时,确定第一方向为该摄像头的对焦位置的移动方向,其中,该第一方向为该摄像头的镜头朝向该目标拍摄物的方向;When the phase difference value is greater than the preset phase difference value, determine the first direction as the moving direction of the focus position of the camera, wherein the first direction is the direction in which the lens of the camera faces the target object;

当该相位差值小于该预设相位差值时,确定第二方向为该摄像头的对焦位置的移动方向,其中,该第二方向为与该第一方向相反的方向。When the phase difference value is smaller than the preset phase difference value, the second direction is determined as the moving direction of the focusing position of the camera, wherein the second direction is a direction opposite to the first direction.

具体实现中,当该对焦数据包括摄像头的镜头至对焦位置的移动方向时,该预设相位差值为0,因此,确定单元303就可以通过判断该相位差值的正负性来确定其移动方向。In a specific implementation, when the focus data includes the moving direction of the lens of the camera to the focus position, the preset phase difference value is 0. Therefore, the determination unit 303 can determine the movement of the phase difference value by judging whether it is positive or negative. direction.

也就是说,当该相位差值大于0即为正数时,确定单元303就可以确定第一方向为该摄像头的对焦位置的移动方向。其中,第一方向表示的是该摄像头的镜头朝向该目标拍摄物的方向,即摄像头的镜头向外的方向。而当该相位差值小于0即为负数时,确定单元303就可以确定第二方向为该摄像头的对焦位置的移动方向。其中,该第二方向与第一方向相反,即该第二方向表示的是该摄像头的镜头背向该目标拍摄物的方向。That is to say, when the phase difference value is greater than 0 and is a positive number, the determining unit 303 may determine that the first direction is the moving direction of the focus position of the camera. Wherein, the first direction indicates the direction in which the lens of the camera faces the target object, that is, the direction in which the lens of the camera faces outward. And when the phase difference value is less than 0 and is a negative number, the determining unit 303 can determine that the second direction is the moving direction of the focus position of the camera. Wherein, the second direction is opposite to the first direction, that is, the second direction indicates a direction in which the lens of the camera faces away from the target object.

举例来说,假设获取单元301获取的相位差值为-18,预设阈值为20,那么判断单元302可以判断出该相位差值的绝对值18小于预设阈值20。因此,判断单元302就可以判断出该相位差值满足反差式对焦模式的启动条件,从而启动反差式对焦模式。由于该相位差值-18,为负数,那么确定单元303就可以确定出摄像头的对焦位置的移动方向为背向目标拍摄物的方向,即向后。而如果获取单元301获取的相位差值为16,那么确定单元303就可以确定摄像头的对焦位置的移动方向为朝向目标拍摄物的方向,即向前。For example, assuming that the phase difference acquired by the acquiring unit 301 is -18 and the preset threshold is 20, then the judging unit 302 can judge that the absolute value of the phase difference 18 is smaller than the preset threshold 20. Therefore, the judging unit 302 can judge that the phase difference value satisfies the starting condition of the contrast focusing mode, thereby starting the contrast focusing mode. Since the phase difference value -18 is a negative number, the determination unit 303 can determine that the moving direction of the focus position of the camera is the direction away from the target object, that is, backward. And if the phase difference value acquired by the acquiring unit 301 is 16, then the determining unit 303 can determine that the moving direction of the focus position of the camera is the direction toward the target object, that is, forward.

可见,在图4所描述的移动终端中,在移动终端完成对目标拍摄物的对焦操作之后,用户可以通过穿戴设备控制该移动终端对该目标拍摄物进行拍摄,从而能够更大视角的完成自拍、合影等操作。这种远距离操控移动终端的拍摄方式,更加能够受到消费者的青睐,从而提升用户体验。It can be seen that in the mobile terminal described in FIG. 4 , after the mobile terminal completes the focusing operation on the target object, the user can control the mobile terminal to take pictures of the target object through the wearable device, so that self-portraits can be completed with a larger angle of view , group photo and other operations. This shooting method of remotely controlling the mobile terminal is more favored by consumers, thereby improving the user experience.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质包括只读存储器(Read-Only Memory,ROM)、随机存储器(Random Access Memory,RAM)、可编程只读存储器(Programmable Read-only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、一次可编程只读存储器(One-time Programmable Read-Only Memory,OTPROM)、电子抹除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(CompactDisc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器、或者能够用于携带或存储数据的计算机可读的任何其他介质。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes read-only Memory (Read-Only Memory, ROM), Random Access Memory (Random Access Memory, RAM), Programmable Read-Only Memory (Programmable Read-only Memory, PROM), Erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), One-time Programmable Read-Only Memory (OTPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CompactDisc Read -Only Memory, CD-ROM) or other optical disk storage, magnetic disk storage, tape storage, or any other computer-readable medium that can be used to carry or store data.

以上对本发明实施例公开的反差式对焦方法及移动终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The contrast focusing method disclosed in the embodiments of the present invention and the mobile terminal have been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The descriptions of the above embodiments are only used to help understand the present invention. method and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. Invention Limitations.

Claims (10)

1. a kind of contrast formula focusing method, which is characterized in that including:
When receiving the focusing instruction for target subject, two image data waves for the target subject are obtained Phase difference value between shape;The phase difference is obtained by the phase calculation between the wave crest and trough of described two image data waveforms It arrives;Described image data waveform is the waveform that the value of pixel in image data is formed;
Judge whether the phase difference value meets the entry condition of contrast formula focal modes;
If so, starting contrast formula focal modes, and determine to take the photograph according to the phase difference value under the contrast formula focal modes As the focus data of the focusing position of head;
The camera lens for controlling the camera according to the focus data is moved to the focusing position.
2. according to the method described in claim 1, it is characterized in that, described judge whether the phase difference value meets contrast formula pair The entry condition of burnt pattern, including:
Determine the absolute value of the phase difference value;
Judge whether the absolute value is less than predetermined threshold value, if so, determining that the phase difference value meets contrast formula focal modes Entry condition.
3. method according to claim 1 or 2, which is characterized in that the focus data includes moving direction, described in institute The focus data for determining camera focusing position under contrast formula focal modes according to the phase difference value is stated, including:
When the phase difference value is more than preset phase difference, the movement for the focusing position that first direction is the camera is determined Direction, wherein, the first direction for the camera camera lens towards the direction of the target subject;
When the phase difference value is less than the preset phase difference, the focusing position that second direction is the camera is determined Moving direction, wherein, the second direction is direction opposite to the first direction.
4. according to the method described in claim 1, it is characterized in that, two images obtained for the target subject Phase difference value between data waveform, including:
For the target subject, the picture number of the first image is obtained by the left pixel of imaging sensor in camera According to, and the right pixel for passing through described image sensor obtains the image data of the second image;
First image data waveform is generated, and according to the picture number of second image according to the image data of described first image According to the second image data waveform of generation;
Calculate the phase difference value between described first image data waveform and the second image data waveform.
5. according to the method described in claim 1, it is characterized in that, described control the camera according to the focus data Camera lens is moved to after the focusing position, and the method further includes:
Receive the shooting instruction that target wearable device is sent, the shooting instruction be detected by the target wearable device it is default It is generated during the vibration signal of frequency;
The shooting instruction is responded, the camera is controlled to be shot on the focusing position to the target subject.
6. a kind of mobile terminal, which is characterized in that including:
Acquiring unit, for when receiving the focusing instruction for target subject, obtaining for the target subject Phase difference value between two image data waveforms;The phase difference by described two image data waveforms wave crest and trough it Between phase calculation obtain;Described image data waveform is the waveform that the value of pixel in image data is formed;
Judging unit, for judging whether the phase difference value meets the entry condition of contrast formula focal modes;
Determination unit, for judging that the phase difference value meets contrast formula focal modes entry condition in the judging unit When, start contrast formula focal modes, and determine pair of camera according to the phase difference value under the contrast formula focal modes The focus data of burnt position;
Control unit, the camera lens for controlling the camera according to the focus data are moved to the focusing position.
7. mobile terminal according to claim 6, which is characterized in that the judging unit includes determination subelement and sentences Disconnected subelement, wherein:
The determination subelement, for determining the absolute value of the phase difference value;
The judgment sub-unit, for judging whether the absolute value is less than predetermined threshold value;
The determination subelement is additionally operable to, when the judgment sub-unit judges that the absolute value is less than predetermined threshold value, determine The phase difference value meets the entry condition of contrast formula focal modes.
8. the mobile terminal described according to claim 6 or 7, which is characterized in that the focus data includes moving direction, described Determination unit determines the focus data of camera focusing position under the contrast formula focal modes according to the phase difference value Concrete mode is:
When the phase difference value is more than preset phase difference, the movement for the focusing position that first direction is the camera is determined Direction, wherein, the first direction for the camera camera lens towards the direction of the target subject;
When the phase difference value is less than the preset phase difference, the focusing position that second direction is the camera is determined Moving direction, wherein, the second direction is direction opposite to the first direction.
9. mobile terminal according to claim 6, which is characterized in that the acquiring unit includes obtaining subelement, generation Subelement and computation subunit, wherein:
The acquisition subelement for being directed to the target subject, is obtained by the left pixel of imaging sensor in camera The image data of the first image is taken, and the right pixel for passing through described image sensor obtains the image data of the second image;
The generation subelement, for according to the image data of described first image generate the first image data waveform, and according to The image data of second image generates the second image data waveform;
The computation subunit, for calculating the phase between described first image data waveform and the second image data waveform Potential difference value.
10. mobile terminal according to claim 6, which is characterized in that the mobile terminal further includes:
Receiving unit, for receiving the shooting instruction of target wearable device transmission, the shooting instruction is dressed by the target Equipment detects what is generated during the vibration signal of predeterminated frequency;
Described control unit is additionally operable to respond the shooting instruction, controls the camera on the focusing position to described Target subject is shot.
CN201510439724.0A 2015-07-23 2015-07-23 Contrast type focusing method and mobile terminal Active CN105007425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510439724.0A CN105007425B (en) 2015-07-23 2015-07-23 Contrast type focusing method and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510439724.0A CN105007425B (en) 2015-07-23 2015-07-23 Contrast type focusing method and mobile terminal

Publications (2)

Publication Number Publication Date
CN105007425A CN105007425A (en) 2015-10-28
CN105007425B true CN105007425B (en) 2018-07-06

Family

ID=54379926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510439724.0A Active CN105007425B (en) 2015-07-23 2015-07-23 Contrast type focusing method and mobile terminal

Country Status (1)

Country Link
CN (1) CN105007425B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107026969A (en) * 2016-02-01 2017-08-08 中兴通讯股份有限公司 The determination method and device of phase difference
CN105763805B (en) * 2016-02-29 2019-03-08 Oppo广东移动通信有限公司 Control method, control device, and electronic device
CN105763801B (en) * 2016-02-29 2019-02-05 Oppo广东移动通信有限公司 Control method, control device and electronic device
CN105635591A (en) * 2016-03-11 2016-06-01 深圳还是威健康科技有限公司 Photographing control method based on wearable equipment and terminal
CN105872378A (en) * 2016-04-12 2016-08-17 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN105939455B (en) * 2016-06-13 2019-07-09 惠州Tcl移动通信有限公司 A kind of mobile terminal camera focusing process method and mobile terminal
CN106791373B (en) 2016-11-29 2020-03-13 Oppo广东移动通信有限公司 Focusing processing method and device and terminal equipment
CN106713750B (en) * 2016-12-19 2019-07-19 Oppo广东移动通信有限公司 Focusing control method and device, electronic device and terminal equipment
CN106657799A (en) * 2017-03-02 2017-05-10 苏州摩比力特电子科技有限公司 Bar code scanning device and method based on phase detection
CN107911618A (en) * 2017-12-27 2018-04-13 上海传英信息技术有限公司 Processing method, terminal and the terminal readable storage medium storing program for executing taken pictures
CN108683795A (en) * 2018-03-30 2018-10-19 中兴通讯股份有限公司 Mobile terminal and its control method and computer readable storage medium
CN112866551B (en) * 2019-11-12 2022-06-14 Oppo广东移动通信有限公司 Focusing method and device, electronic equipment and computer readable storage medium
CN113747070A (en) * 2021-09-10 2021-12-03 昆山丘钛微电子科技股份有限公司 Focusing method and device of camera module, terminal equipment and medium
CN114354630A (en) * 2022-01-07 2022-04-15 京东方科技集团股份有限公司 Image acquisition system and method and display panel processing equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102928197A (en) * 2011-08-08 2013-02-13 佳能株式会社 Focus detector, and lens apparatus and image pickup apparatus including the same

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5276371B2 (en) * 2008-07-09 2013-08-28 キヤノン株式会社 Imaging device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102928197A (en) * 2011-08-08 2013-02-13 佳能株式会社 Focus detector, and lens apparatus and image pickup apparatus including the same

Also Published As

Publication number Publication date
CN105007425A (en) 2015-10-28

Similar Documents

Publication Publication Date Title
CN105007425B (en) Contrast type focusing method and mobile terminal
CN107690649B (en) Digital photographing apparatus and method of operating the same
CN107770452B (en) Photographing method, terminal and related medium product
JP6293706B2 (en) Electronic device and method of operating electronic device
US9300858B2 (en) Control device and storage medium for controlling capture of images
US8718459B2 (en) Method and digital camera having improved autofocus
CN108270967B (en) Automatic focusing method and electronic device for executing the same
CN112840634B (en) Electronic device and method for obtaining image
CN108391051B (en) A focus exception processing method and mobile terminal
CN108600612B (en) Photographing method and mobile terminal
US9549126B2 (en) Digital photographing apparatus and control method thereof
CN103988227A (en) Method and apparatus for image capture target locking
EP3316568B1 (en) Digital photographing device and operation method therefor
EP3621292B1 (en) Electronic device for obtaining images by controlling frame rate for external moving object through point of interest, and operating method thereof
RU2664674C2 (en) Method and apparatus for creating a panorama
KR102150470B1 (en) Method for setting shooting condition and electronic device performing thereof
KR20110055243A (en) Digital recording device, its control method and recording medium storing program for executing same
CN107025666A (en) Single-camera-based depth detection method, device, and electronic device
CN112954212B (en) Video generation method, device and equipment
CN104601882A (en) A panoramic shooting method and terminal
JP2010074264A (en) Photographing apparatus and photographing system
JP2016057463A (en) Focus adjustment device and control method of the same
EP2753063A2 (en) Digital photographing apparatus and method of controlling the same
US20190094960A1 (en) Gaze detection, identification and control method
US10531005B2 (en) Display control apparatus, control method, and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.