CN106331517A - Method and electronic device for controlling brightness of soft light lamp - Google Patents

Method and electronic device for controlling brightness of soft light lamp Download PDF

Info

Publication number
CN106331517A
CN106331517A CN201610851235.0A CN201610851235A CN106331517A CN 106331517 A CN106331517 A CN 106331517A CN 201610851235 A CN201610851235 A CN 201610851235A CN 106331517 A CN106331517 A CN 106331517A
Authority
CN
China
Prior art keywords
brightness
soft light
control parameter
image
brightness control
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.)
Pending
Application number
CN201610851235.0A
Other languages
Chinese (zh)
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201610851235.0A priority Critical patent/CN106331517A/en
Publication of CN106331517A publication Critical patent/CN106331517A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/74Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

本发明提供一种柔光灯亮度控制方法和电子设备,该方法包括:确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;根据亮度控制参数与柔光灯亮度之间的对应关系确定所述检测值对应的目标亮度;控制所述柔光灯以所述目标亮度发光。根据用户在图像中所占的比例调整柔光灯的亮度,可以减少柔光灯对用户的眼睛的刺激。

The present invention provides a soft light brightness control method and electronic equipment. The method includes: determining the detection value of a brightness control parameter, and the brightness control parameter is the currently photographed user in the image captured by the shooting module. Determine the target brightness corresponding to the detection value according to the corresponding relationship between the brightness control parameter and the brightness of the soft light; control the soft light to emit light at the target brightness. Adjusting the brightness of the soft light according to the proportion of the user in the image can reduce the stimulation of the soft light to the user's eyes.

Description

一种柔光灯亮度控制方法及电子设备Method and electronic device for controlling brightness of soft light lamp

技术领域technical field

本发明涉及通信领域,尤其涉及一种柔光灯亮度控制方法及电子设备。The invention relates to the communication field, in particular to a method for controlling the brightness of a soft light lamp and electronic equipment.

背景技术Background technique

用电子设备进行自拍越来越流行,为了达到更好的自拍效果,也为了能在夜晚进行自拍,电子设备中配置有柔光灯。在进行自拍时,由于自拍时,电子设备与用户眼睛的距离较小,柔光灯发出的光线会对人眼产生强烈的刺激作用,而且离柔光灯越近,柔光灯发出的光线对人眼的刺激作用越强,对人眼造成了伤害。因此现有技术存在柔光灯发出的光线会对人眼造成伤害的问题。上述情况同样存在于使用电子设备的后置摄像头进行拍摄的场景。Taking selfies with electronic devices is becoming more and more popular. In order to achieve better selfie effects and to take selfies at night, electronic devices are equipped with soft lights. When taking a selfie, since the distance between the electronic device and the user's eyes is small, the light from the soft light will strongly stimulate the human eye, and the closer you are to the soft light, the more intense the light from the soft light will be on the human eye. The stronger the stimulating effect on the human eye, the more harmful it is to the human eye. Therefore, there is a problem in the prior art that the light emitted by the soft light lamp can cause damage to human eyes. The above situation also exists in the scene where the rear camera of the electronic device is used for shooting.

发明内容Contents of the invention

本发明实施例提供一种柔光灯亮度控制方法及电子设备,以解决现有技术存在的柔光灯发出的光线会对人眼造成伤害的问题。Embodiments of the present invention provide a method for controlling the brightness of a soft light and an electronic device to solve the problem in the prior art that the light emitted by the soft light can cause damage to human eyes.

第一方面,本发明实施例提供了一种柔光灯亮度控制方法,包括:In the first aspect, an embodiment of the present invention provides a method for controlling the brightness of a soft light, including:

确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;Determine the detection value of the brightness control parameter, the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module;

根据亮度控制参数与柔光灯亮度之间的对应关系确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离;Determine the target brightness corresponding to the detected value according to the corresponding relationship between the brightness control parameter and the brightness of the soft light lamp. In the corresponding relationship, when the distance corresponding to the first brightness control parameter is smaller than the distance corresponding to the second brightness control parameter, the The brightness of the first soft light corresponding to the first brightness control parameter is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the correspondence relationship, the third soft light corresponding to the third brightness control parameter When the brightness of the lamp is less than the brightness of the fourth soft light corresponding to the fourth brightness control parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter;

控制所述柔光灯以所述目标亮度发光。and controlling the soft light to emit light at the target brightness.

第二方面,本发明实施例还提供一种电子设备,包括:In the second aspect, the embodiment of the present invention also provides an electronic device, including:

第一确定模块,用于确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;The first determination module is used to determine the detection value of the brightness control parameter, the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module;

第二确定模块,用于根据亮度控制参数与柔光灯亮度之间的对应关系,确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离;The second determining module is configured to determine the target brightness corresponding to the detection value according to the correspondence between the brightness control parameter and the brightness of the soft light, and in the correspondence, the distance corresponding to the first brightness control parameter is smaller than the second brightness When controlling the distance corresponding to the parameter, the brightness of the first soft light corresponding to the first brightness control parameter is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the corresponding relationship, the third brightness When the brightness of the third soft light corresponding to the control parameter is smaller than the brightness of the fourth soft light corresponding to the fourth brightness control parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter;

控制模块,用于控制所述柔光灯以所述目标亮度发光。A control module, configured to control the soft light to emit light at the target brightness.

本发明实施例中,确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;根据亮度控制参数与柔光灯亮度之间的对应关系,确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离;控制所述柔光灯以所述目标亮度发光。这样用户在使用柔光灯自拍时,电子设备可以根据当前拍摄用户与电子设备之间的距离或者当前拍摄用户在图像中所占的比例调整柔光灯的亮度,因此当用户离电子设备比较近时,可以减少柔光灯发出的光线对用户的眼睛的刺激。In the embodiment of the present invention, the detection value of the brightness control parameter is determined, and the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module; according to the brightness control parameter and soft light The corresponding relationship between the brightness of the lamps determines the target brightness corresponding to the detection value. In the corresponding relationship, when the distance corresponding to the first brightness control parameter is smaller than the distance corresponding to the second brightness control parameter, the first brightness control parameter The brightness of the corresponding first soft light is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the correspondence relationship, the brightness of the third soft light corresponding to the third brightness control parameter is smaller than the fourth brightness When controlling the brightness of the fourth soft light corresponding to the parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter; and the soft light is controlled to emit light at the target brightness. In this way, when the user uses the soft light to take a selfie, the electronic device can adjust the brightness of the soft light according to the distance between the current shooting user and the electronic device or the proportion of the current shooting user in the image, so when the user is relatively close to the electronic device , it can reduce the stimulation of the light emitted by the soft light to the user's eyes.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments of the present invention. Obviously, the accompanying 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 any creative effort.

图1是本发明第一实施例提供的一种柔光灯亮度控制方法的流程图;Fig. 1 is a flowchart of a soft light brightness control method provided by the first embodiment of the present invention;

图2是本发明第二实施例提供的另一种柔光灯亮度控制方法的流程图;Fig. 2 is a flow chart of another soft light brightness control method provided by the second embodiment of the present invention;

图3是本发明第三实施例提供的另一种柔光灯亮度控制方法的流程图;Fig. 3 is a flow chart of another soft light brightness control method provided by the third embodiment of the present invention;

图4是本发明第四实施例提供的一种电子设备的结构图;Fig. 4 is a structural diagram of an electronic device provided by a fourth embodiment of the present invention;

图5是本发明第五实施例提供的另一种电子设备的结构图。Fig. 5 is a structural diagram of another electronic device provided by the fifth embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。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 some of the embodiments of the present invention, but not all of them. 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.

第一实施例first embodiment

步骤101、确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例。Step 101. Determine the detection value of a brightness control parameter, where the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module.

在步骤101中,确定亮度控制参数的检测值,即确定当前拍摄用户在图像中所占的比例。首先,用户开启摄像头,此时图像中会出现当前拍摄用户,然后获取当前拍摄用户在图像中所占的区域,即目标区域。最后计算这个目标区域在图像中所占的比例,即:In step 101, the detection value of the brightness control parameter is determined, that is, the proportion of the currently captured user in the image is determined. First, the user turns on the camera, and the current shooting user appears in the image, and then the area occupied by the current shooting user in the image is obtained, that is, the target area. Finally, calculate the proportion of the target area in the image, namely:

所述确定亮度控制参数的检测值具体为:The detection value of the determined brightness control parameter is specifically:

获取所述拍摄模组拍摄到的图像;Obtain the image captured by the shooting module;

对所述图像进行人物识别,确定所述图像中人物所在的目标区域;Performing person recognition on the image, and determining a target area where the person in the image is located;

计算所述目标区域在所述图像中所占的比例。Calculate the proportion of the target area in the image.

在获取当前拍摄用户在图像中所占的区域时,分为两种情况,一种是只有一个当前拍摄用户,另一种是有多个当前拍摄用户。When obtaining the area occupied by the current shooting user in the image, there are two situations, one is that there is only one current shooting user, and the other is that there are multiple current shooting users.

上述步骤101中,当只有一个当前拍摄用户时,就根据该唯一用户确定在图像中所占的区域,作为亮度控制参数的检测值。In the above step 101, when there is only one current shooting user, the area occupied by the unique user in the image is determined as the detection value of the brightness control parameter.

但是,不管是使用前置摄像头自拍,还是使用后置摄像头进行拍摄,拍摄到的图像中都可能存在多个人物(即存在多个当前拍摄用户),而本发明具体实施例的方案是为了减弱柔光灯发出的光线对用户眼睛的刺激,而柔光灯发出的光线对与电子设备距离最近的用户的眼睛刺激最大,因此,本发明具体实施例中,当存在多个当前拍摄用户时,要以离电子设备最近的当前拍摄用户为准,即:However, regardless of whether the front camera is used to take a selfie or the rear camera is used to shoot, there may be multiple people in the captured image (that is, there are multiple current shooting users), and the scheme of the specific embodiment of the present invention is to weaken the The light emitted by the soft light stimulates the eyes of the user, and the light emitted by the soft light stimulates the eyes of the user closest to the electronic device the most. Therefore, in a specific embodiment of the present invention, when there are multiple current shooting users, The current shooting user closest to the electronic device shall prevail, namely:

所述对所述图像进行人物识别,确定所述图像中人物所在的目标区域具体为:The step of performing person recognition on the image and determining the target area where the person in the image is located is specifically:

对所述图像进行人物识别;performing person recognition on the image;

判断所述图像中是否存在多个人物;judging whether there are multiple characters in the image;

在所述图像中存在多个人物时,确定距离所述电子设备最近的人物在所述图像中的区域为所述目标区域,否则确定唯一的人物在所述图像中的区域为所述目标区域。When there are multiple persons in the image, determine that the area of the person closest to the electronic device in the image is the target area, otherwise determine the area of the only person in the image as the target area .

步骤102、根据亮度控制参数与柔光灯亮度之间的对应关系确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离。Step 102: Determine the target brightness corresponding to the detection value according to the correspondence between the brightness control parameter and the brightness of the soft light. In the correspondence, the distance corresponding to the first brightness control parameter is smaller than the distance corresponding to the second brightness control parameter , the brightness of the first soft light corresponding to the first brightness control parameter is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the correspondence relationship, the brightness of the first soft light corresponding to the third brightness control parameter When the brightness of the third soft light is smaller than the brightness of the fourth soft light corresponding to the fourth brightness control parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter.

在步骤102中,根据亮度控制参数与柔光灯亮度之间的对应关系来确定目标亮度,而本发明实施例的目的在于减弱柔光灯发出的光线对用户眼睛的刺激,而距离越近则刺激越大,因此,本发明具体实施例中亮度控制参数与柔光灯亮度之间的对应关系具有如下的两个特征:In step 102, the target brightness is determined according to the corresponding relationship between the brightness control parameters and the brightness of the soft light, and the purpose of this embodiment of the present invention is to reduce the stimulation of the light emitted by the soft light to the user's eyes, and the closer the distance is, the The greater the stimulus, therefore, the corresponding relationship between the brightness control parameters and the brightness of the soft light in the specific embodiment of the present invention has the following two characteristics:

1、对应于较小的距离的亮度控制参数对应的柔光灯亮度不大于对应于较大的距离的亮度控制参数对应的柔光灯亮度;也就是说,不会出现柔光灯亮度随着距离的变小而变大的情况。1. The brightness of the soft light corresponding to the brightness control parameter corresponding to a smaller distance is not greater than the brightness of the soft light corresponding to the brightness control parameter corresponding to a larger distance; The situation where the distance becomes smaller and larger.

2、至少存在对应于较小的距离的亮度控制参数对应的柔光灯亮度小于对应于较大的距离的亮度控制参数对应的柔光灯亮度,也就说,至少存在柔光灯亮度随着距离的变小而变小的情况。2. At least the brightness of the soft light corresponding to the brightness control parameter corresponding to a smaller distance is smaller than the brightness of the soft light corresponding to the brightness control parameter corresponding to a larger distance. The situation where the distance becomes smaller and smaller.

满足上述两个特征的对应关系可以是如下两种方式:The corresponding relationship that satisfies the above two characteristics can be in the following two ways:

1、连续对应关系:所述对应关系中,比例越大,对应的柔光灯亮度越小。1. Continuous correspondence: in the correspondence, the larger the ratio, the smaller the brightness of the corresponding soft light.

即,柔光灯亮度是比例的连续减函数,柔光灯亮度随着比例的变大而变小,呈连续变化。That is, the brightness of the soft light is a continuously decreasing function of the ratio, and the brightness of the soft light becomes smaller as the ratio increases, showing a continuous change.

2、离散对应关系:所述比例在取值范围内分为多个连续的区间,每一个区间对应于一个柔光灯亮度,相邻的区间中,比例较大的区间对应的柔光灯亮度小于比例较小的区间对应的柔光灯亮度。2. Discrete correspondence: the ratio is divided into multiple continuous intervals within the value range, each interval corresponds to the brightness of a soft light, and among adjacent intervals, the interval with a larger ratio corresponds to the brightness of the soft light The brightness of the soft light corresponding to the range with a smaller ratio.

也就是说,柔光灯亮度是比例的阶跃函数,是一种离散对应关系。In other words, the brightness of the soft light is a step function of the ratio, which is a discrete correspondence.

用户在自拍时,会存在一个柔光灯可以开到最大亮度且不会对人眼造成刺激的最小距离,上述的第一种形式的对应关系中,当电子设备与当前拍摄用户之间的距离小于该最小距离时,柔光灯亮度小于最大亮度,且随着距离的变小而越来越小。而上述的第二种形式的对应关系中,当电子设备与当前拍摄用户之间的距离小于该最小距离时,柔光灯亮度均小于最大亮度,只不过柔光灯的亮度变化是离散的,随着距离的变小,柔光灯亮度变化趋势同样是变小的。When the user is taking a selfie, there will be a minimum distance at which the soft light can be turned on to the maximum brightness without irritating the human eyes. In the first form of correspondence above, when the distance between the electronic device and the current shooting user When the distance is smaller than the minimum distance, the brightness of the soft light is lower than the maximum brightness, and becomes smaller and smaller as the distance becomes smaller. In the above-mentioned second form of corresponding relationship, when the distance between the electronic device and the current shooting user is less than the minimum distance, the brightness of the soft light is less than the maximum brightness, but the brightness change of the soft light is discrete, As the distance becomes smaller, the change trend of the brightness of the soft light also becomes smaller.

当电子设备与当前拍摄用户之间的距离大于或等于该最小距离时,本发明具体实施例中,为保证柔光灯的效果,可以将柔光灯设置为最大亮度。When the distance between the electronic device and the current shooting user is greater than or equal to the minimum distance, in the specific embodiment of the present invention, in order to ensure the effect of the soft light, the soft light can be set to the maximum brightness.

本发明具体实施例中,需要利用和所述电子设备与当前拍摄用户之间的距离相关的亮度控制参数来确定目标亮度,而亮度控制参数可以是如下的和电子设备与当前拍摄用户之间的距离相关的参数,如:In a specific embodiment of the present invention, it is necessary to use brightness control parameters related to the distance between the electronic device and the current shooting user to determine the target brightness, and the brightness control parameters can be as follows and the distance between the electronic device and the current shooting user Distance-related parameters, such as:

电子设备与当前拍摄用户之间的距离本身;以及The distance itself between the electronic device and the current user; and

拍摄到的图像中当前拍摄用户在所述图像中所占的比例。In the captured image, the proportion of the currently captured user in the image.

当电子设备与人越近,则人物图像在整个图像中占用的区域越大,因此可以使用所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例来描述所述电子设备与当前拍摄用户之间的距离。When the electronic device is closer to the person, the image of the person occupies a larger area in the entire image, so the proportion of the current shooting user in the image captured by the shooting module can be used to describe the The distance between the electronic device and the current capture user.

以下结合对应关系的两种表现形式分别说明如下。The following two forms of representation of the combined correspondence relationship are respectively described as follows.

当对应关系为连续对应关系,且亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例时,本发明具体实施例中,可以使用如下的函数来记录上述的连续对应关系:When the corresponding relationship is a continuous corresponding relationship, and the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module, in specific embodiments of the present invention, the following function can be used to Record the above consecutive correspondences:

V=t*Vmax*(1-Sren/S)V=t*V max *(1-Sren/S)

其中,t为调整参数,Vmax为柔光灯的最大亮度,Sren/S为当前拍摄用户在图像中所占的比例。比例可以是当前拍摄用户在图像中所占的面积与图像总面积的比值,也可以是当前拍摄用户在图像中所占用的像素值与图像所占用的像素值的比值,V为柔光灯的当前亮度。Among them, t is the adjustment parameter, Vmax is the maximum brightness of the soft light, and Sren/S is the proportion of the current shooting user in the image. The ratio can be the ratio of the area occupied by the current shooting user in the image to the total area of the image, or the ratio of the pixel value occupied by the current shooting user in the image to the pixel value occupied by the image, V is the soft light Current brightness.

因此,Sren可以为当前拍摄用户在图像中所占的面积,也可以是当前拍摄用户在图像中所占用的像素值;S可以为整张图像的面积,也可以是整张图像所占用的像素值。Therefore, Sren can be the area occupied by the current shooting user in the image, or the pixel value occupied by the current shooting user in the image; S can be the area of the entire image, or the pixels occupied by the entire image value.

在电子设备中,调整参数t可以进行调节,如果想要使柔光灯的亮度变化的快一些,可以将调整参数t调的大一些,如果想要柔光灯的亮度变化的慢一些,可以将调整参数t调的小一些,用户可以根据自身需要将调整参数t设置为一个合适的值。当将调整参数t设置为一个用户认为合适的值后,在下一次调整之前,调整参数t就不会改变了,一直维持用户之前设置的那个值。Vmax为柔光灯的最大亮度,这个柔光灯最大亮度是固定不变的。Sren/S为当前拍摄用户在图像中所占的比例,这个比例和当前拍摄用户到电子设备的距离之间有对应关系,当前拍摄用户与电子设备之间的距离越近,这个比例越大,当前拍摄用户与电子设备之间的距离越远,这个比例越小。In electronic equipment, the adjustment parameter t can be adjusted. If you want to make the brightness of the soft light change faster, you can adjust the parameter t larger. If you want the brightness of the soft light to change slowly, you can Adjust the adjustment parameter t to a smaller value, and the user can set the adjustment parameter t to an appropriate value according to their own needs. After the adjustment parameter t is set to a value that the user thinks is appropriate, the adjustment parameter t will not change until the next adjustment, and the value set by the user before has been maintained. Vmax is the maximum brightness of the soft light, and the maximum brightness of the soft light is fixed. Sren/S is the proportion of the current shooting user in the image. This ratio has a corresponding relationship with the distance from the current shooting user to the electronic device. The closer the distance between the current shooting user and the electronic device, the larger the ratio. The farther the distance between the current shooting user and the electronic device is, the smaller this ratio is.

此时,调整参数t、柔光灯最大亮度Vmax在设置好后都是维持不变的,因此柔光灯当前亮度V与当前拍摄用户在图像中所占的比例是成反比的,比例越大,说明当前拍摄用户与电子设备的距离越近,因此柔光灯的亮度要调的小一些,比例越小,说明当前拍摄用户与电子设备的距离越远,此时柔光灯的亮度要调的大一些。At this time, the adjustment parameter t and the maximum brightness Vmax of the soft light remain unchanged after setting, so the current brightness V of the soft light is inversely proportional to the proportion of the current shooting user in the image, the larger the ratio , indicating that the distance between the current shooting user and the electronic device is closer, so the brightness of the soft light should be adjusted smaller, and the smaller the ratio, it means that the distance between the current shooting user and the electronic device is farther. bigger ones.

应当理解的是,上述的V与Sren/S之间是一种函数关系示意,本发明具体实施例并不限定V与Sren/S之间的具体函数关系,只要使得V能够随Sren/S的增长而减小即可。It should be understood that the above-mentioned relationship between V and Sren/S is a functional relationship, and the specific embodiment of the present invention does not limit the specific functional relationship between V and Sren/S, as long as V can vary with Sren/S increase and decrease.

需要说明的是,以上述方式调整柔光灯亮度时,随着当前拍摄用户在图像中所占的比例的变化,相应的柔光灯的亮度也要实时变化,由于柔光灯的亮度是由电压来控制的,不同的亮度会需要不同的电压。此时要求电子设备中的线路能实时控制电压的变化,来支持实时变化的柔光灯亮度,这种情况也是比较复杂的。It should be noted that when the brightness of the soft light is adjusted in the above way, as the proportion of the current shooting user in the image changes, the brightness of the corresponding soft light will also change in real time, because the brightness of the soft light is determined by It is controlled by voltage, and different brightness will require different voltages. At this time, it is required that the circuit in the electronic device can control the voltage change in real time to support the real-time change in the brightness of the soft light. This situation is also relatively complicated.

当对应关系为离散对应关系,且亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例时,本发明具体实施例中,可以使用如下的函数来记录上述的离散对应关系:When the corresponding relationship is a discrete corresponding relationship, and the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module, in specific embodiments of the present invention, the following function can be used to Record the above discrete correspondences:

V=0.1*Vmax 0.9≤比例<1.0V=0.1*Vmax 0.9≤ratio<1.0

V=0.2*Vmax 0.7≤比例<0.9V=0.2*Vmax 0.7≤ratio<0.9

V=0.3*Vmax 0.5≤比例<0.7V=0.3*Vmax 0.5≤ratio<0.7

V=0.6*Vmax 0.2≤比例<0.5V=0.6*Vmax 0.2≤ratio<0.5

V=1.0*Vmax比例<0.2V=1.0*Vmax ratio<0.2

在本实施例中,将当前拍摄用户在图像中所占的比例共划分了5个区间,各个区间是连续的。区间0.9-1.0对应的柔光灯亮度为0.1*Vmax,区间0.7-0.9对应的柔光灯亮度为0.2*Vmax,区间0.5-0.7对应的柔光灯亮度为0.3*Vmax,区间0.2-0.5对应的柔光灯亮度为0.6*Vmax,比例小于0.2的区间对应的柔光灯亮度为1.0*Vmax,由此可见,随着当前拍摄用户在图像中所占的比例越来越大,也即随着当前拍摄用户与电子设备之间的距离越来越近,柔光灯的亮度越来越暗,这样当用户离电子设备比较近时,柔光灯的亮度也会比较暗,就可以减少柔光灯发出的光线对用户的眼睛的刺激。In this embodiment, the proportion of the currently shooting user in the image is divided into 5 intervals, and each interval is continuous. The brightness of the soft light corresponding to the interval 0.9-1.0 is 0.1*Vmax, the brightness of the soft light corresponding to the interval 0.7-0.9 is 0.2*Vmax, the brightness of the soft light corresponding to the interval 0.5-0.7 is 0.3*Vmax, and the interval 0.2-0.5 corresponds to The brightness of the soft light is 0.6*Vmax, and the brightness of the soft light corresponding to the interval with a ratio less than 0.2 is 1.0*Vmax. It can be seen that as the proportion of current shooting users in the image increases, that is, with the As the distance between the current shooting user and the electronic device is getting closer, the brightness of the soft light is getting darker and darker. In this way, when the user is closer to the electronic device, the brightness of the soft light will also be darker, which can reduce the softness. The light emitted by the lamp is irritating to the user's eyes.

在这种方式中,在对应的比例区间上只需要设置一个相应的柔光灯亮度。在本实施例中,将当前拍摄用户在图像中所占的比例共划分为5个区间,相应的就共有5个柔光灯亮度,因此也只需设置5个对应的电压。这种调节柔光灯亮度的方式相比于利用连续对应关系调节柔光灯亮度的方式会更简单一些。In this way, only one corresponding soft light brightness needs to be set in the corresponding scale range. In this embodiment, the proportion of the currently shooting user in the image is divided into 5 intervals, correspondingly, there are 5 soft light brightnesses in total, so only 5 corresponding voltages need to be set. This method of adjusting the brightness of the soft light is simpler than the method of adjusting the brightness of the soft light using continuous correspondence.

将当前拍摄用户在图像中所占的比例划分为不同的区间,在每一个区间上都对应有一个柔光灯亮度,当用户在图像中所占的比例在某一个区间内变动时,相应的柔光灯亮度是不会改变的,一直维持与那个区间相对应的亮度。这种方式在实现过程中柔光灯亮度不需要随着比例的变化而频繁的变化,避免了过多的计算过程。Divide the proportion of the current shooting user in the image into different intervals, and each interval corresponds to a soft light brightness. When the proportion of the user in the image changes within a certain interval, the corresponding The brightness of the soft light will not change, and it will always maintain the brightness corresponding to that range. In the implementation process of this method, the brightness of the soft light does not need to change frequently with the change of the ratio, which avoids excessive calculation process.

应当理解的是,上述的V与Sren/S之间是一种函数关系示意,本发明具体实施例并不限定V与Sren/S之间的具体函数关系,即并不限定Sren/S的分区数量,也不限定相邻区间对应的V的变化率,只要使得V能够随Sren/S的增长而减小即可。It should be understood that the above-mentioned relationship between V and Sren/S is a functional relationship, and the specific embodiment of the present invention does not limit the specific functional relationship between V and Sren/S, that is, does not limit the partition of Sren/S The number does not limit the rate of change of V corresponding to adjacent intervals, as long as V can be reduced with the increase of Sren/S.

当对应关系为连续对应关系,且亮度控制参数为距离传感器检测到的电子设备与当前拍摄用户之间的距离时,本发明具体实施例中,可以使用如下的函数来记录上述的连续对应关系:When the corresponding relationship is a continuous corresponding relationship, and the brightness control parameter is the distance between the electronic device detected by the distance sensor and the current shooting user, in specific embodiments of the present invention, the following function can be used to record the above continuous corresponding relationship:

V=t*Vmax*l/LV=t*Vmax*l/L

其中,t为调整参数,Vmax为柔光灯的最大亮度,l为距离传感器检测到的当前拍摄用户与电子设备之间的距离,L为用户的手臂长,V为柔光灯的当前亮度。Among them, t is an adjustment parameter, Vmax is the maximum brightness of the soft light, l is the distance between the current shooting user and the electronic device detected by the distance sensor, L is the user's arm length, and V is the current brightness of the soft light.

在电子设备中,调整参数t可以进行调节,如果想要使柔光灯的亮度变化的快一些,可以将调整参数t调的大一些,如果想要柔光灯的亮度变化的慢一些,可以将调整参数t调的小一些,用户可以根据自身需要将调整参数t设置为一个合适的值。In electronic equipment, the adjustment parameter t can be adjusted. If you want to make the brightness of the soft light change faster, you can adjust the parameter t larger. If you want the brightness of the soft light to change slowly, you can Adjust the adjustment parameter t to a smaller value, and the user can set the adjustment parameter t to an appropriate value according to their own needs.

当将调整参数t设置为一个用户认为合适的值后,在下一次调整之前,调整参数t就不会改变了,一直维持用户之前设置的那个值。Vmax为柔光灯的最大亮度,这个柔光灯最大亮度是固定不变的。L为用户的手臂长,一般来说用户自拍时用户离电子设备的最大距离为用户的手臂长,此处的L也是可以进行设置的,当将L设置为一个值后,在下一次设置之前,L会一直维持用户之前设置的那个值。After the adjustment parameter t is set to a value that the user thinks is appropriate, the adjustment parameter t will not change until the next adjustment, and the value set by the user before has been maintained. Vmax is the maximum brightness of the soft light, and the maximum brightness of the soft light is fixed. L is the length of the user's arm. Generally speaking, when the user takes a selfie, the maximum distance between the user and the electronic device is the user's arm length. Here, L can also be set. After setting L to a value, before the next setting, L will always maintain the value set by the user before.

此时,调整参数t、柔光灯最大亮度Vmax和L在设置好后都是维持不变的,因此柔光灯当前亮度V和当前拍摄用户与电子设备之间的距离l是成正比的,当前拍摄用户与电子设备之间的距离越小,柔光灯的亮度就会调整的越暗,当前拍摄用户与电子设备之间的距离越大,柔光灯的亮度就会调整的越亮。At this time, the adjustment parameter t, the maximum brightness Vmax and L of the soft light remain unchanged after setting, so the current brightness V of the soft light is proportional to the distance l between the current shooting user and the electronic device, The smaller the distance between the current shooting user and the electronic device, the darker the brightness of the soft light will be adjusted, and the larger the distance between the current shooting user and the electronic device, the brighter the brightness of the soft light will be adjusted.

应当理解的是,上述的l与V之间是一种函数关系示意,本发明具体实施例并不限定l与V之间的具体函数关系,只要使得V能够随l的增长而增长即可。It should be understood that the above-mentioned relationship between l and V is a functional relationship, and the specific embodiment of the present invention does not limit the specific functional relationship between l and V, as long as V can increase with the increase of l.

需要说明的是,以上述方式调整柔光灯亮度时,随着当前拍摄用户与电子设备之间的距离的变化,相应的柔光灯的亮度也要实时变化,由于柔光灯的亮度是由电压来控制的,不同的亮度会需要不同的电压。此时要求电子设备中的线路能实时控制电压的变化,来支持实时变化的柔光灯亮度,这种情况是比较复杂的。It should be noted that when the brightness of the soft light is adjusted in the above manner, as the distance between the current shooting user and the electronic device changes, the brightness of the corresponding soft light will also change in real time, because the brightness of the soft light is determined by It is controlled by voltage, and different brightness will require different voltages. At this time, it is required that the circuit in the electronic device can control the voltage change in real time to support the real-time change in the brightness of the soft light. This situation is relatively complicated.

当对应关系为离散对应关系,且亮度控制参数为距离传感器检测到的电子设备与当前拍摄用户之间的距离时,本发明具体实施例中,可以使用如下的函数来记录上述的离散对应关系:When the corresponding relationship is a discrete corresponding relationship, and the brightness control parameter is the distance between the electronic device detected by the distance sensor and the current shooting user, in specific embodiments of the present invention, the following function may be used to record the above discrete corresponding relationship:

V=1.0*Vmax 0.9L≤l<1.0LV=1.0*Vmax 0.9L≤l<1.0L

V=0.6*Vmax 0.7L≤l<0.9LV=0.6*Vmax 0.7L≤l<0.9L

V=0.3*Vmax 0.5L≤l<0.7LV=0.3*Vmax 0.5L≤l<0.7L

V=0.2*Vmax 0.2L≤l<0.5LV=0.2*Vmax 0.2L≤l<0.5L

V=0.1*Vmax l<0.2LV=0.1*Vmax l<0.2L

在本实施例中,将距离传感器检测到的电子设备与当前拍摄用户之间的距离共划分为5个区间,各个区间是连续的。区间0.9L-1.0L对应的柔光灯亮度为1.0*Vmax,区间0.7L-0.9L对应的柔光灯亮度为0.6*Vmax,区间0.5L-0.7L对应的柔光灯亮度为0.3*Vmax,区间0.2L-0.5L对应的柔光灯亮度为0.2*Vmax,小于0.2L的区间对应的柔光灯亮度为0.1*Vmax,由此可见,随着当前拍摄用户与电子设备之间的距离越来越小,柔光灯的亮度也越来越暗,这样当用户离电子设备比较近时,柔光灯的亮度也会比较暗,就可以减少柔光灯发出的光线对用户的眼睛的刺激。In this embodiment, the distance between the electronic device detected by the distance sensor and the current shooting user is divided into 5 intervals, and each interval is continuous. The brightness of the soft light corresponding to the interval 0.9L-1.0L is 1.0*Vmax, the brightness of the soft light corresponding to the interval 0.7L-0.9L is 0.6*Vmax, and the brightness of the soft light corresponding to the interval 0.5L-0.7L is 0.3*Vmax , the brightness of the soft light corresponding to the interval 0.2L-0.5L is 0.2*Vmax, and the brightness of the soft light corresponding to the interval smaller than 0.2L is 0.1*Vmax. It can be seen that as the distance between the current shooting user and the electronic device The brightness of the soft light is getting smaller and smaller, so when the user is closer to the electronic device, the brightness of the soft light will be darker, which can reduce the light from the soft light to the user's eyes. Stimulate.

在这种方式中,在对应的距离区间上只需要设置一个相应的柔光灯亮度。在本实施例中,将当前拍摄用户与电子设备之间的距离共划分为5个区间,相应的就共有5个柔光灯亮度,因此也只需设置5个对应的电压。这种调节柔光灯亮度的方式相比于利用连续对应关系调节柔光灯亮度的方式会更简单一些。In this way, only one corresponding brightness of the soft light needs to be set in the corresponding distance interval. In this embodiment, the current distance between the shooting user and the electronic device is divided into 5 intervals, correspondingly, there are 5 soft light brightness levels, so only 5 corresponding voltages need to be set. This method of adjusting the brightness of the soft light is simpler than the method of adjusting the brightness of the soft light using continuous correspondence.

将当前拍摄用户与电子设备之间的距离划分为不同的区间,在每一个区间上都对应有一个柔光灯亮度,当用户与电子设备之间的距离在某一个区间内变动时,相应的柔光灯亮度是不会改变的,一直维持与那个区间相对应的亮度。这种方式在实现过程中柔光灯亮度不需要随着距离的变化而频繁的变化,避免了过多的计算过程。Divide the distance between the current shooting user and the electronic device into different intervals, and each interval corresponds to a soft light brightness. When the distance between the user and the electronic device changes within a certain interval, the corresponding The brightness of the soft light will not change, and it will always maintain the brightness corresponding to that range. In this way, the brightness of the soft light does not need to change frequently as the distance changes during the implementation process, which avoids excessive calculation processes.

应当理解的是,上述的l与V之间是一种函数关系示意,本发明具体实施例并不限定l与V之间的具体函数关系,即并不限定l的分区数量,也不限定相邻区间对应的V的变化率,只要使得V能够随l的增长而增长即可。It should be understood that the above-mentioned relationship between l and V is indicative of a functional relationship. The specific embodiment of the present invention does not limit the specific functional relationship between l and V, that is, the number of partitions of l is not limited, and the relative The rate of change of V corresponding to the adjacent interval, as long as V can grow with the growth of l.

步骤103、控制所述柔光灯以所述目标亮度发光。Step 103, controlling the soft light to emit light at the target brightness.

在步骤103中,确定了当前拍摄用户与电子设备之间的距离后,或者确定了当前拍摄用户在图像中所占的比例后,就可以依据与柔光灯亮度之间的对应关系确定柔光灯的当前亮度,控制柔光灯以确定下来的亮度发光,此时用户就可以拍摄了。In step 103, after determining the distance between the current shooting user and the electronic device, or determining the proportion of the current shooting user in the image, the soft light can be determined according to the corresponding relationship with the brightness of the soft light The current brightness of the light, control the soft light to emit light at the determined brightness, and the user can shoot at this time.

需要说明的是,无论是使用前置摄像头进行自拍,还是使用后置摄像头进行拍摄,都会存在随着当前拍摄用户与电子设备的距离越来越小,柔光灯亮度也越来越暗的情况。当拍摄模组为后置摄像头时,由于此时用户离后置摄像头的距离会比较远,此时柔光灯发出的光线对用户的眼睛基本不会造成刺激。但是在使用前置摄像头进行自拍时,电子设备与当前拍摄用户的距离比较近,柔光灯发出的光线容易对用户的眼睛造成刺激,因此本发明实施例中柔光灯亮度控制方法较好应用于使用前置摄像头进行自拍的情况。It should be noted that whether the front camera is used to take selfies or the rear camera is used to take pictures, as the distance between the current shooting user and the electronic device becomes smaller and smaller, the brightness of the soft light will also become darker. . When the shooting module is a rear camera, since the user is far away from the rear camera at this time, the light emitted by the soft light will basically not cause irritation to the user's eyes. However, when using the front camera to take a selfie, the distance between the electronic device and the current shooting user is relatively short, and the light emitted by the soft light is likely to cause irritation to the user's eyes, so the method for controlling the brightness of the soft light in the embodiment of the present invention is better applied For selfies with the front camera.

在以上的实施例中分别使用实际的距离和用户在图像中所占的比例这两个参数来表征电子设备与当前拍摄用户之间的距离,但也可以使用其他参数来描述,简单说明如下:In the above embodiments, two parameters, the actual distance and the proportion of the user in the image, are used to represent the distance between the electronic device and the current shooting user, but other parameters can also be used to describe the distance, and the brief description is as follows:

如电子设备上设置光发射器和光接收器,光发射器发出的光在照射到人脸之后会反射,反射回来的光被光接收器接收,当电子设备与当前拍摄用户之间的距离越大时,光在空气中运动的距离越远,受到的损耗越大。反之,受到的损耗越小。For example, a light emitter and a light receiver are installed on an electronic device. The light emitted by the light emitter will be reflected after hitting the face, and the reflected light will be received by the light receiver. When the distance between the electronic device and the current shooting user is greater, , the farther the light travels in the air, the greater the loss. On the contrary, the loss suffered is smaller.

因此,可以以光接收器接收到的光功率来描述电子设备与当前拍摄用户之间的距离,光功率越大,表明电子设备与当前拍摄用户的距离越近,对应的柔光灯亮度越小。Therefore, the optical power received by the optical receiver can be used to describe the distance between the electronic device and the current shooting user. The greater the optical power, the closer the distance between the electronic device and the current shooting user, and the smaller the brightness of the corresponding soft light .

本发明实施例中,上述电子设备可以是任何具备拍摄模组和柔光灯的电子设备,例如:手机、平板电脑(Tablet Personal Computer)、膝上型电脑(Laptop Computer)、个人数字助理(personal digital assistant,简称PDA)、移动上网装置(Mobile InternetDevice,MID)或可穿戴式设备(Wearable Device)等。In the embodiment of the present invention, the above-mentioned electronic device can be any electronic device equipped with a camera module and a soft light, such as a mobile phone, a tablet computer (Tablet Personal Computer), a laptop computer (Laptop Computer), a personal digital assistant (personal digital assistant) digital assistant (PDA for short), mobile Internet device (Mobile Internet Device, MID) or wearable device (Wearable Device), etc.

本发明实施例的柔光灯亮度控制方法,确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;根据亮度控制参数与柔光灯亮度之间的对应关系确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离;控制所述柔光灯以所述目标亮度发光。通过上述步骤,电子设备可以根据当前拍摄用户与电子设备之间的距离或者当前拍摄用户在图像中所占的比例调整柔光灯的亮度。因此当用户离电子设备比较近时,可以减少柔光灯发出的光线对用户的眼睛的刺激。The brightness control method of the soft light in the embodiment of the present invention determines the detection value of the brightness control parameter, and the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module; according to The corresponding relationship between the brightness control parameter and the brightness of the soft light determines the target brightness corresponding to the detection value. In the corresponding relationship, when the distance corresponding to the first brightness control parameter is smaller than the distance corresponding to the second brightness control parameter, the The brightness of the first soft light corresponding to the first brightness control parameter is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the corresponding relationship, the third soft light corresponding to the third brightness control parameter When the brightness is less than the brightness of the fourth soft light corresponding to the fourth brightness control parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter; glow. Through the above steps, the electronic device can adjust the brightness of the soft light according to the distance between the current shooting user and the electronic device or the proportion of the current shooting user in the image. Therefore, when the user is relatively close to the electronic device, the stimulation of the light emitted by the soft light to the user's eyes can be reduced.

第二实施例second embodiment

参见图2,图2是本发明实施例提供的另一种柔光灯亮度控制方法的流程图,如图2所示,包括以下步骤:Referring to Fig. 2, Fig. 2 is a flow chart of another soft light brightness control method provided by an embodiment of the present invention, as shown in Fig. 2, including the following steps:

步骤201、识别目标人脸。Step 201, identifying a target face.

在步骤201中,对人脸进行识别,当图像中只存在一张人脸时,就对该张人脸进行识别,当图像中存在多张人脸时,就对在图像中所占比例最大的人脸进行识别。In step 201, the face is recognized. When there is only one face in the image, the face is recognized. When there are multiple faces in the image, the face with the largest proportion in the image is identified. face recognition.

步骤202、获取目标人脸在图像中所占的比例。Step 202, acquiring the proportion of the target face in the image.

在步骤202中,获取目标人脸在图像中所占的比例,可以是获取目标人脸在图像中的面积与整张图像的面积的比值,也可以是获取目标人脸在图像中所占用的像素值与整张图像所占用的像素值的比值。In step 202, obtaining the proportion of the target face in the image can be the ratio of the area of the target face in the image to the area of the entire image, or the ratio of the area occupied by the target face in the image. The ratio of the pixel value to the pixel value occupied by the entire image.

步骤203、根据获取的目标人脸在图像中所占的比例调整柔光灯的亮度。Step 203, adjusting the brightness of the soft light according to the acquired proportion of the target face in the image.

在步骤203中,根据获取的目标人脸在图像中所占的比例调整柔光灯的亮度,可以有两种方式。第一种是利用连续对应关系确定柔光灯的亮度,此种方式在第一实施例中已经作出解释,在此不再赘述。第二种是利用离散对应关系确定柔光灯的亮度,将目标人脸在图像中所占的比例划分为几个连续的区间,每一个区间都对应一个柔光灯亮度,对应于较大比例的区间对应的柔光灯亮度小于对应于较小比例的区间对应的柔光灯亮度。判断目标人脸在图像中所占的比例落在哪一个区间内,再将柔光灯的亮度调整为对应的亮度。第二种方式也已经在第一实施例中作出解释,在此不再赘述。In step 203, the brightness of the soft light is adjusted according to the acquired proportion of the target face in the image, and there are two ways. The first method is to determine the brightness of the soft light by using the continuous corresponding relationship. This method has been explained in the first embodiment and will not be repeated here. The second is to use discrete correspondence to determine the brightness of the soft light, and divide the proportion of the target face in the image into several continuous intervals, each interval corresponds to a soft light brightness, corresponding to a larger proportion The brightness of the soft light corresponding to the interval of is smaller than the brightness of the soft light corresponding to the interval corresponding to a smaller ratio. Determine which range the proportion of the target face in the image falls in, and then adjust the brightness of the soft light to the corresponding brightness. The second manner has also been explained in the first embodiment, and will not be repeated here.

步骤204、将柔光灯的亮度调整为根据目标人脸在图像中所占的比例所确定的亮度。Step 204, adjusting the brightness of the soft light to the brightness determined according to the proportion of the target face in the image.

在步骤204中,将柔光灯的亮度调整为根据目标人脸在图像中所占的比例所确定的亮度,用户就可以进行拍摄了,此时当用户离电子设备比较近时,可以减少柔光灯发出的光线对用户的眼睛的刺激。In step 204, the brightness of the soft light is adjusted to the brightness determined according to the proportion of the target face in the image, and the user can start shooting. At this time, when the user is relatively close to the electronic device, the soft light can be reduced. The light emitted by the lamp is irritating to the user's eyes.

本实施例,是本发明的一个举例说明的实例,通过上述步骤,电子设备可以根据当前拍摄用户在图像中所占的比例调整柔光灯的亮度。因此当用户离电子设备比较近时,可以减少柔光灯发出的光线对用户的眼睛的刺激。This embodiment is an illustrative example of the present invention. Through the above steps, the electronic device can adjust the brightness of the soft light according to the proportion of the currently captured user in the image. Therefore, when the user is relatively close to the electronic device, the stimulation of the light emitted by the soft light to the user's eyes can be reduced.

第三实施例third embodiment

参见图3,图3是本发明实施例提供的另一种柔光灯亮度控制方法的流程图,如图3所示,包括以下步骤:Referring to Fig. 3, Fig. 3 is a flow chart of another soft light brightness control method provided by an embodiment of the present invention, as shown in Fig. 3, including the following steps:

步骤301、获取目标人脸与电子设备之间的距离。Step 301. Obtain the distance between the target face and the electronic device.

在步骤301中,当图像中只存在一张人脸时,就获取该张人脸与电子设备之间的距离,当图像中存在多张人脸时,就获取离电子设备最近的人脸与电子设备之间的距离。In step 301, when there is only one human face in the image, the distance between the human face and the electronic device is obtained; when there are multiple human faces in the image, the distance between the closest human face and the electronic device is obtained. Distance between electronic devices.

步骤302、利用获取的距离确定柔光灯的亮度。Step 302, using the acquired distance to determine the brightness of the soft light.

在步骤302中,可以利用两种方式确定柔光灯的亮度。第一种是利用连续对应关系确定柔光灯的亮度,此种方式在第一实施例中已经作出解释,在此不再赘述。第二种是利用离散对应关系确定柔光灯的亮度,将当前拍摄用户与电子设备之间的距离划分为几个连续的区间,每一个区间都对应一个柔光灯亮度,对应于较小的距离的区间对应的柔光灯亮度小于对应于较大的距离的区间对应的柔光灯亮度。判断获取的当前拍摄用户与电子设备之间的距离落在哪一个区间内,再将柔光灯的亮度调整为对应的亮度。第二种方式也已经在第一实施例中作出解释,在此不再赘述。In step 302, the brightness of the soft light can be determined in two ways. The first method is to determine the brightness of the soft light by using the continuous corresponding relationship. This method has been explained in the first embodiment and will not be repeated here. The second is to use discrete correspondence to determine the brightness of the soft light, and divide the distance between the current shooting user and the electronic device into several continuous intervals, each interval corresponds to a brightness of the soft light, corresponding to a smaller The brightness of the soft light corresponding to the interval of the distance is smaller than the brightness of the soft light corresponding to the interval corresponding to a larger distance. It is judged which interval the acquired distance between the current shooting user and the electronic device falls in, and then the brightness of the soft light is adjusted to the corresponding brightness. The second manner has also been explained in the first embodiment, and will not be repeated here.

步骤303、将柔光灯的亮度调整为根据获取的距离所确定的亮度。Step 303, adjusting the brightness of the soft light to the brightness determined according to the acquired distance.

在步骤303中,将柔光灯的亮度调整为根据获取的距离所确定的亮度,用户就可以进行拍摄了,此时当用户离电子设备比较近时,可以减少柔光灯发出的光线对用户的眼睛的刺激。In step 303, the brightness of the soft light is adjusted to the brightness determined according to the obtained distance, and the user can start shooting. At this time, when the user is relatively close to the electronic device, the light emitted by the soft light can reduce the impact on the user. eye irritation.

本实施例,是本发明的一个举例说明的实例,通过上述步骤,电子设备可以根据当前拍摄用户与电子设备之间的距离调整柔光灯的亮度。因此当用户离电子设备比较近时,可以减少柔光灯发出的光线对用户的眼睛的刺激。This embodiment is an illustrative example of the present invention. Through the above steps, the electronic device can adjust the brightness of the soft light according to the distance between the current shooting user and the electronic device. Therefore, when the user is relatively close to the electronic device, the stimulation of the light emitted by the soft light to the user's eyes can be reduced.

第四实施例Fourth embodiment

参见图4,图4是本发明实施提供的一种电子设备的结构图,如图4所示,电子设备400包括第一确定模块401、第二确定模块402和控制模块403,其中:Referring to FIG. 4, FIG. 4 is a structural diagram of an electronic device provided by the implementation of the present invention. As shown in FIG. 4, the electronic device 400 includes a first determination module 401, a second determination module 402, and a control module 403, wherein:

第一确定模块401,用于确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;The first determining module 401 is configured to determine the detection value of a brightness control parameter, where the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module;

第二确定模块402,用于根据亮度控制参数与柔光灯亮度之间的对应关系确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离;The second determination module 402 is configured to determine the target brightness corresponding to the detection value according to the correspondence between the brightness control parameter and the brightness of the soft light, in the correspondence, the distance corresponding to the first brightness control parameter is smaller than the second brightness When controlling the distance corresponding to the parameter, the brightness of the first soft light corresponding to the first brightness control parameter is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the corresponding relationship, the third brightness When the brightness of the third soft light corresponding to the control parameter is smaller than the brightness of the fourth soft light corresponding to the fourth brightness control parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter;

控制模块403,用于控制所述柔光灯以所述目标亮度发光。The control module 403 is configured to control the soft light to emit light at the target brightness.

可选的,所述对应关系中,比例越大,对应的柔光灯亮度越小。Optionally, in the corresponding relationship, the larger the ratio, the smaller the brightness of the corresponding soft light.

可选的,所述比例在取值范围内分为多个连续的区间,每一个区间对应于一个柔光灯亮度,相邻的区间中,比例较大的区间对应的柔光灯亮度小于比例较小的区间对应的柔光灯亮度。Optionally, the ratio is divided into multiple continuous intervals within the value range, each interval corresponds to the brightness of a soft light, and among adjacent intervals, the brightness of the soft light corresponding to the interval with a larger ratio is smaller than the ratio The smaller range corresponds to the brightness of the soft light.

可选的,所述拍摄模组为所述电子设备的前置摄像头。Optionally, the camera module is a front camera of the electronic device.

可选的,第一确定模块401包括:Optionally, the first determining module 401 includes:

获取模块4011,用于获取所述拍摄模组拍摄到的图像;An acquisition module 4011, configured to acquire images captured by the photographing module;

第三确定模块4012,用于对所述图像进行人物识别,确定所述图像中人物所在的目标区域;The third determining module 4012 is configured to perform person recognition on the image, and determine the target area where the person in the image is located;

计算模块4013,用于计算所述目标区域在所述图像中所占的比例。Calculation module 4013, configured to calculate the proportion of the target area in the image.

可选的,第三确定模块4012包括:Optionally, the third determining module 4012 includes:

识别模块40121,用于对所述图像进行人物识别;A recognition module 40121, configured to perform character recognition on the image;

判断模块40122,用于判断所述图像中是否存在多个人物;Judging module 40122, configured to judge whether there are multiple characters in the image;

第四确定模块40123,用于在所述图像中存在多个人物时,确定距离所述电子设备最近的人物在所述图像中的区域为所述目标区域,否则确定唯一的人物在所述图像中的区域为所述目标区域。The fourth determination module 40123 is configured to determine that the area of the person closest to the electronic device in the image is the target area when there are multiple persons in the image, otherwise determine that the only person in the image is The area in is the target area.

检测值电子设备400能够实现各个方法实施例中电子设备实现的各个过程,为避免重复,这里不再赘述。且电子设备400可以根据当前拍摄用户与电子设备之间的距离或者当前拍摄用户在图像中所占的比例调整柔光灯的亮度。因此当用户离电子设备比较近时,可以减少柔光灯发出的光线对用户的眼睛的刺激。The detection value electronic device 400 can implement each process implemented by the electronic device in each method embodiment, and to avoid repetition, details are not repeated here. And the electronic device 400 can adjust the brightness of the soft light according to the distance between the current shooting user and the electronic device or the proportion of the current shooting user in the image. Therefore, when the user is relatively close to the electronic device, the stimulation of the light emitted by the soft light to the user's eyes can be reduced.

第五实施例fifth embodiment

参见图5,图5是本发明实施提供的电子设备的结构图,如图5所示,电子设备500包括:至少一个处理器501、存储器502、至少一个网络接口504和用户接口503。电子设备500中的各个组件通过总线系统505耦合在一起。可理解,总线系统505用于实现这些组件之间的连接通信。总线系统505除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图5中将各种总线都标为总线系统505。Referring to FIG. 5, FIG. 5 is a structural diagram of an electronic device provided by the implementation of the present invention. As shown in FIG. Various components in the electronic device 500 are coupled together through the bus system 505 . It can be understood that the bus system 505 is used to realize connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for clarity of illustration, the various buses are labeled as bus system 505 in FIG. 5 .

其中,用户接口503可以包括显示器、键盘或者点击设备(例如,鼠标,轨迹球(track ball)、触感板或者触摸屏等。Wherein, the user interface 503 may include a display, a keyboard or a pointing device (for example, a mouse, a track ball (track ball), a touch panel or a touch screen, and the like.

可以理解,本发明实施例中的存储器502可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data RateSDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(DirectRambus RAM,DRRAM)。本文描述的系统和方法的存储器502旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory 502 in the embodiment of the present invention may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash. The volatile memory can be Random Access Memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data RateSDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synchlink DRAM, SLDRAM) and Direct memory bus random access memory (DirectRambus RAM, DRRAM). Memory 502 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

在一些实施方式中,存储器502存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:操作系统5021和应用程序5022。In some implementations, the memory 502 stores the following elements, executable modules or data structures, or their subsets, or their extended sets: an operating system 5021 and an application program 5022 .

其中,操作系统5021,包含各种系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务。应用程序5022,包含各种应用程序,例如媒体播放器(Media Player)、浏览器(Browser)等,用于实现各种应用业务。实现本发明实施例方法的程序可以包含在应用程序5022中。Among them, the operating system 5021 includes various system programs, such as framework layer, core library layer, driver layer, etc., for realizing various basic services and processing tasks based on hardware. The application program 5022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., and is used to implement various application services. The program for realizing the method of the embodiment of the present invention may be included in the application program 5022 .

在本发明实施例中,通过调用存储器502存储的程序或指令,具体的,可以是应用程序5022中存储的程序或指令,处理器501用于:In the embodiment of the present invention, by calling the program or instruction stored in the memory 502, specifically, the program or instruction stored in the application program 5022, the processor 501 is used to:

确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;Determine the detection value of the brightness control parameter, the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module;

根据亮度控制参数与柔光灯亮度之间的对应关系确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离;Determine the target brightness corresponding to the detected value according to the corresponding relationship between the brightness control parameter and the brightness of the soft light lamp. In the corresponding relationship, when the distance corresponding to the first brightness control parameter is smaller than the distance corresponding to the second brightness control parameter, the The brightness of the first soft light corresponding to the first brightness control parameter is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the correspondence relationship, the third soft light corresponding to the third brightness control parameter When the brightness of the lamp is lower than the brightness of the fourth soft light corresponding to the fourth brightness control parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter;

控制所述柔光灯以所述目标亮度发光。and controlling the soft light to emit light at the target brightness.

上述本发明实施例揭示的方法可以应用于处理器501中,或者由处理器501实现。处理器501可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器501中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器501可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(FieldProgrammable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器502,处理器501读取存储器502中的信息,结合其硬件完成上述方法的步骤。The methods disclosed in the foregoing embodiments of the present invention may be applied to the processor 501 or implemented by the processor 501 . The processor 501 may be an integrated circuit chip and has signal processing capability. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 501 or instructions in the form of software. The above-mentioned processor 501 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Program logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps and logic block diagrams disclosed in the embodiments of the present invention may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the like. The steps of the methods disclosed in the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502, and completes the steps of the above method in combination with its hardware.

可以理解的是,本文描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(ApplicationSpecific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable LogicDevice,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。It should be understood that the embodiments described herein may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing device (DSP Device, DSPD), programmable logic Device (Programmable LogicDevice, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing the functions described in this application or a combination thereof.

对于软件实现,可通过执行本文所述功能的模块(例如过程、函数等)来实现本文所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。For a software implementation, the techniques described herein can be implemented through modules (eg, procedures, functions, and so on) that perform the functions described herein. Software codes can be stored in memory and executed by a processor. Memory can be implemented within the processor or external to the processor.

可选的,处理器501执行所述对应关系中,比例越大,对应的柔光灯亮度越小。Optionally, the processor 501 executes the correspondence relationship, the larger the ratio, the smaller the brightness of the corresponding soft light.

可选的,处理器501执行所述比例在取值范围内分为多个连续的区间,每一个区间对应于一个柔光灯亮度,相邻的区间中,比例较大的区间对应的柔光灯亮度小于比例较小的区间对应的柔光灯亮度。Optionally, the processor 501 executes that the ratio is divided into multiple continuous intervals within the value range, each interval corresponds to the brightness of a soft light, and among adjacent intervals, the interval with a larger ratio corresponds to the soft light The brightness of the light is smaller than the brightness of the soft light corresponding to the interval with a smaller ratio.

可选的,处理器501执行所述拍摄模组为所述电子设备的前置摄像头。Optionally, the processor 501 executes the camera module as a front camera of the electronic device.

可选的,处理器501执行所述确定亮度控制参数的检测值具体为:Optionally, the execution by the processor 501 of determining the detection value of the brightness control parameter is specifically:

获取所述拍摄模组拍摄到的图像;Obtain the image captured by the shooting module;

对所述图像进行人物识别,确定所述图像中人物所在的目标区域;Performing person recognition on the image, and determining a target area where the person in the image is located;

计算所述目标区域在所述图像中所占的比例。Calculate the proportion of the target area in the image.

可选的,处理器501执行所述对所述图像进行人物识别,确定所述图像中人物所在的目标区域具体为:Optionally, the processor 501 executes the performing the character recognition on the image, and determining the target area where the character in the image is located is specifically:

对所述图像进行人物识别;performing person recognition on the image;

判断所述图像中是否存在多个人物;judging whether there are multiple characters in the image;

在所述图像中存在多个人物时,确定距离所述电子设备最近的人物在所述图像中的区域为所述目标区域,否则确定唯一的人物在所述图像中的区域为所述目标区域。When there are multiple persons in the image, determine that the area of the person closest to the electronic device in the image is the target area, otherwise determine the area of the only person in the image as the target area .

检测值电子设备500能够实现前述实施例中电子设备实现的各个过程,为避免重复,这里不再赘述。且电子设备500可以根据当前拍摄用户与电子设备之间的距离或者当前拍摄用户在图像中所占的比例调整柔光灯的亮度。因此当用户离电子设备比较近时,可以减少柔光灯发出的光线对用户的眼睛的刺激。The detected value electronic device 500 can implement various processes implemented by the electronic device in the foregoing embodiments, and to avoid repetition, details are not described here. And the electronic device 500 can adjust the brightness of the soft light according to the distance between the current shooting user and the electronic device or the proportion of the current shooting user in the image. Therefore, when the user is relatively close to the electronic device, the stimulation of the light emitted by the soft light to the user's eyes can be reduced.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (10)

1.一种柔光灯亮度控制方法,用于一具备拍摄模组和柔光灯的电子设备,其特征在于,所述柔光灯亮度控制方法包括:1. A soft light brightness control method for an electronic device with a shooting module and a soft light, characterized in that the soft light brightness control method comprises: 确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;Determine the detection value of the brightness control parameter, the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module; 根据亮度控制参数与柔光灯亮度之间的对应关系确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离;Determine the target brightness corresponding to the detected value according to the corresponding relationship between the brightness control parameter and the brightness of the soft light lamp. In the corresponding relationship, when the distance corresponding to the first brightness control parameter is smaller than the distance corresponding to the second brightness control parameter, the The brightness of the first soft light corresponding to the first brightness control parameter is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the correspondence relationship, the third soft light corresponding to the third brightness control parameter When the brightness of the lamp is less than the brightness of the fourth soft light corresponding to the fourth brightness control parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter; 控制所述柔光灯以所述目标亮度发光。and controlling the soft light to emit light at the target brightness. 2.根据权利要求1所述的柔光灯亮度控制方法,其特征在于,所述对应关系中,比例越大,对应的柔光灯亮度越小。2 . The method for controlling the brightness of the soft light according to claim 1 , wherein, in the corresponding relationship, the larger the ratio, the smaller the brightness of the corresponding soft light. 3.根据权利要求1所述的柔光灯亮度控制方法,其特征在于,所述比例在取值范围内分为多个连续的区间,每一个区间对应于一个柔光灯亮度,相邻的区间中,比例较大的区间对应的柔光灯亮度小于比例较小的区间对应的柔光灯亮度。3. The soft light brightness control method according to claim 1, wherein the ratio is divided into a plurality of continuous intervals within the value range, each interval corresponds to a soft light brightness, and adjacent Among the intervals, the brightness of the soft light corresponding to the interval with a larger ratio is smaller than the brightness of the soft light corresponding to the interval with a smaller ratio. 4.根据权利要求1、2或3所述的柔光灯亮度控制方法,其特征在于,所述确定亮度控制参数的检测值具体为:4. The method for controlling the brightness of a soft light according to claim 1, 2 or 3, wherein the detection value of the determined brightness control parameter is specifically: 获取所述拍摄模组拍摄到的图像;Obtain the image captured by the shooting module; 对所述图像进行人物识别,确定所述图像中人物所在的目标区域;Performing person recognition on the image, and determining a target area where the person in the image is located; 计算所述目标区域在所述图像中所占的比例。Calculate the proportion of the target area in the image. 5.根据权利要求4所述的柔光灯亮度控制方法,其特征在于,所述对所述图像进行人物识别,确定所述图像中人物所在的目标区域具体为:5. The method for controlling the brightness of a soft light lamp according to claim 4, wherein the identifying the person in the image and determining the target area where the person in the image is located is specifically: 对所述图像进行人物识别;performing person recognition on the image; 判断所述图像中是否存在多个人物;judging whether there are multiple characters in the image; 在所述图像中存在多个人物时,确定距离所述电子设备最近的人物在所述图像中的区域为所述目标区域,否则确定唯一的人物在所述图像中的区域为所述目标区域。When there are multiple persons in the image, determine that the area of the person closest to the electronic device in the image is the target area, otherwise determine the area of the only person in the image as the target area . 6.一种电子设备,其特征在于,包括:6. An electronic device, characterized in that it comprises: 第一确定模块,用于确定亮度控制参数的检测值,所述亮度控制参数为所述拍摄模组拍摄到的图像中当前拍摄用户在所述图像中所占的比例;The first determination module is used to determine the detection value of the brightness control parameter, the brightness control parameter is the proportion of the current shooting user in the image captured by the shooting module; 第二确定模块,用于根据亮度控制参数与柔光灯亮度之间的对应关系,确定所述检测值对应的目标亮度,所述对应关系中,第一亮度控制参数对应的距离小于第二亮度控制参数对应的距离时,所述第一亮度控制参数对应的第一柔光灯亮度不大于所述第二亮度控制参数对应的第二柔光灯亮度,且所述对应关系中,第三亮度控制参数对应的第三柔光灯亮度小于第四亮度控制参数对应的第四柔光灯亮度时,所述第三亮度控制参数对应的距离小于所述第四亮度控制参数对应的距离;The second determining module is configured to determine the target brightness corresponding to the detection value according to the correspondence between the brightness control parameter and the brightness of the soft light, and in the correspondence, the distance corresponding to the first brightness control parameter is smaller than the second brightness When controlling the distance corresponding to the parameter, the brightness of the first soft light corresponding to the first brightness control parameter is not greater than the brightness of the second soft light corresponding to the second brightness control parameter, and in the corresponding relationship, the third brightness When the brightness of the third soft light corresponding to the control parameter is smaller than the brightness of the fourth soft light corresponding to the fourth brightness control parameter, the distance corresponding to the third brightness control parameter is smaller than the distance corresponding to the fourth brightness control parameter; 控制模块,用于控制所述柔光灯以所述目标亮度发光。A control module, configured to control the soft light to emit light at the target brightness. 7.根据权利要求6所述的电子设备,其特征在于,所述对应关系中,比例越大,对应的柔光灯亮度越小。7 . The electronic device according to claim 6 , wherein, in the corresponding relationship, the larger the ratio, the smaller the brightness of the corresponding soft light. 8.根据权利要求6所述的电子设备,其特征在于,所述比例在取值范围内分为多个连续的区间,每一个区间对应于一个柔光灯亮度,相邻的区间中,比例较大的区间对应的柔光灯亮度小于比例较小的区间对应的柔光灯亮度。8. The electronic device according to claim 6, wherein the ratio is divided into a plurality of continuous intervals within the value range, each interval corresponds to the brightness of a soft light, and in adjacent intervals, the ratio The brightness of the soft light corresponding to a larger interval is smaller than the brightness of the soft light corresponding to a smaller interval. 9.根据权利要求6、7、或8所述的电子设备,其特征在于,所述第一确定模块包括:9. The electronic device according to claim 6, 7, or 8, wherein the first determining module comprises: 获取模块,用于获取所述拍摄模组拍摄到的图像;An acquisition module, configured to acquire images captured by the photographing module; 第三确定模块,用于对所述图像进行人物识别,确定所述图像中人物所在的目标区域;The third determining module is configured to perform person recognition on the image, and determine the target area where the person in the image is located; 计算模块,用于计算所述目标区域在所述图像中所占的比例。A calculation module, configured to calculate the proportion of the target area in the image. 10.根据权利要求9所述的电子设备,其特征在于,所述第三确定模块包括:10. The electronic device according to claim 9, wherein the third determining module comprises: 识别模块,用于对所述图像进行人物识别;A recognition module, configured to perform character recognition on the image; 判断模块,用于判断所述图像中是否存在多个人物;A judging module, configured to judge whether there are multiple characters in the image; 第四确定模块,用于在所述图像中存在多个人物时,确定距离所述电子设备最近的人物在所述图像中的区域为所述目标区域,否则确定唯一的人物在所述图像中的区域为所述目标区域。A fourth determining module, configured to determine that the area of the person closest to the electronic device in the image is the target area when there are multiple persons in the image, otherwise determine that the only person is in the image The area of is the target area.
CN201610851235.0A 2016-09-26 2016-09-26 Method and electronic device for controlling brightness of soft light lamp Pending CN106331517A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610851235.0A CN106331517A (en) 2016-09-26 2016-09-26 Method and electronic device for controlling brightness of soft light lamp

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610851235.0A CN106331517A (en) 2016-09-26 2016-09-26 Method and electronic device for controlling brightness of soft light lamp

Publications (1)

Publication Number Publication Date
CN106331517A true CN106331517A (en) 2017-01-11

Family

ID=57820006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610851235.0A Pending CN106331517A (en) 2016-09-26 2016-09-26 Method and electronic device for controlling brightness of soft light lamp

Country Status (1)

Country Link
CN (1) CN106331517A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107071295A (en) * 2017-05-12 2017-08-18 北京小米移动软件有限公司 Adjusting method, device and the computer-readable storage medium of soft light
CN108038444A (en) * 2017-12-11 2018-05-15 北京小米移动软件有限公司 Image-recognizing method and device
CN106713715B (en) * 2017-01-26 2018-09-04 维沃移动通信有限公司 A kind of photographic method and mobile terminal
CN108769509A (en) * 2018-04-28 2018-11-06 Oppo广东移动通信有限公司 Method, device, electronic device and storage medium for controlling camera
CN109066288A (en) * 2018-05-30 2018-12-21 Oppo广东移动通信有限公司 Laser projector control system, terminal, and laser projector control method
WO2020073572A1 (en) * 2018-10-09 2020-04-16 Oppo广东移动通信有限公司 Control method, control device, depth camera, and electronic device
CN112911771A (en) * 2021-02-06 2021-06-04 北京优彩科技有限公司 Ultraviolet light supplement lamp brightness control method and mobile phone
CN112969029A (en) * 2021-02-02 2021-06-15 展讯通信(上海)有限公司 Light source brightness control method and device, storage medium and 3D (three-dimensional) structured light module
CN113395457A (en) * 2020-03-11 2021-09-14 浙江宇视科技有限公司 Parameter adjusting method, device and equipment of image collector and storage medium
US11183811B2 (en) 2018-05-30 2021-11-23 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Control system and method for laser projector, and terminal
US11335028B2 (en) 2018-02-27 2022-05-17 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Control method based on facial image, related control device, terminal and computer device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663885A (en) * 2012-03-23 2012-09-12 中兴通讯股份有限公司 A method, a system, and related equipment for operating display equipment
CN103914143A (en) * 2013-01-07 2014-07-09 义明科技股份有限公司 Control method of electronic device
CN103928025A (en) * 2014-04-08 2014-07-16 华为技术有限公司 Method and mobile terminal for voice recognition
CN104618661A (en) * 2015-03-05 2015-05-13 广东欧珀移动通信有限公司 Method and device for controlling light supplement of a camera
CN104754220A (en) * 2015-03-10 2015-07-01 深圳市金立通信设备有限公司 Shooting method
US20160088228A1 (en) * 2014-09-23 2016-03-24 Hon Hai Precision Industry Co., Ltd. Photograph method and photograph device
CN105744175A (en) * 2016-02-15 2016-07-06 广东欧珀移动通信有限公司 Screen light fill method and device and mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663885A (en) * 2012-03-23 2012-09-12 中兴通讯股份有限公司 A method, a system, and related equipment for operating display equipment
CN103914143A (en) * 2013-01-07 2014-07-09 义明科技股份有限公司 Control method of electronic device
CN103928025A (en) * 2014-04-08 2014-07-16 华为技术有限公司 Method and mobile terminal for voice recognition
US20160088228A1 (en) * 2014-09-23 2016-03-24 Hon Hai Precision Industry Co., Ltd. Photograph method and photograph device
CN104618661A (en) * 2015-03-05 2015-05-13 广东欧珀移动通信有限公司 Method and device for controlling light supplement of a camera
CN104754220A (en) * 2015-03-10 2015-07-01 深圳市金立通信设备有限公司 Shooting method
CN105744175A (en) * 2016-02-15 2016-07-06 广东欧珀移动通信有限公司 Screen light fill method and device and mobile terminal

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713715B (en) * 2017-01-26 2018-09-04 维沃移动通信有限公司 A kind of photographic method and mobile terminal
CN107071295A (en) * 2017-05-12 2017-08-18 北京小米移动软件有限公司 Adjusting method, device and the computer-readable storage medium of soft light
CN108038444A (en) * 2017-12-11 2018-05-15 北京小米移动软件有限公司 Image-recognizing method and device
US11328168B2 (en) 2017-12-11 2022-05-10 Beijing Xiaomi Mobile Software Co., Ltd. Image recognition method and apparatus
US11335028B2 (en) 2018-02-27 2022-05-17 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Control method based on facial image, related control device, terminal and computer device
CN110324521B (en) * 2018-04-28 2021-03-26 Oppo广东移动通信有限公司 Method, device, electronic device and storage medium for controlling camera
CN108769509A (en) * 2018-04-28 2018-11-06 Oppo广东移动通信有限公司 Method, device, electronic device and storage medium for controlling camera
CN110324521A (en) * 2018-04-28 2019-10-11 Oppo广东移动通信有限公司 Method and device for controlling camera, electronic equipment and storage medium
CN109066288A (en) * 2018-05-30 2018-12-21 Oppo广东移动通信有限公司 Laser projector control system, terminal, and laser projector control method
US11183811B2 (en) 2018-05-30 2021-11-23 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Control system and method for laser projector, and terminal
US10880539B2 (en) 2018-10-09 2020-12-29 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method for controlling structured light projector, depth camera and electronic device
WO2020073572A1 (en) * 2018-10-09 2020-04-16 Oppo广东移动通信有限公司 Control method, control device, depth camera, and electronic device
CN113395457A (en) * 2020-03-11 2021-09-14 浙江宇视科技有限公司 Parameter adjusting method, device and equipment of image collector and storage medium
CN113395457B (en) * 2020-03-11 2023-03-24 浙江宇视科技有限公司 Parameter adjusting method, device and equipment of image collector and storage medium
CN112969029A (en) * 2021-02-02 2021-06-15 展讯通信(上海)有限公司 Light source brightness control method and device, storage medium and 3D (three-dimensional) structured light module
CN112911771A (en) * 2021-02-06 2021-06-04 北京优彩科技有限公司 Ultraviolet light supplement lamp brightness control method and mobile phone

Similar Documents

Publication Publication Date Title
CN106331517A (en) Method and electronic device for controlling brightness of soft light lamp
CN104270565B (en) Image capturing method, device and equipment
CN104853111B (en) A kind of image pickup method and terminal
CN108769509A (en) Method, device, electronic device and storage medium for controlling camera
CN106060417B (en) A kind of flash lamp control method and terminal
CN104869320A (en) Electronic device and control method of the same
CN109167922B (en) Image processing method and device and electronic equipment
CN111601373B (en) Backlight brightness control method, device, mobile terminal and storage medium
CN109788174B (en) Light supplementing method and terminal
CN106210330A (en) A kind of image processing method and terminal
CN106484354B (en) Display brightness adjusting method and mobile terminal
CN106357986A (en) Soft-light lamp brightness control method and electronic equipment
CN110659617A (en) Living body detection method, living body detection device, computer equipment and storage medium
CN111240612A (en) Method and terminal for adjusting screen resolution
CN114596620B (en) Light supplement control method, device and equipment for face recognition equipment and storage medium
CN104460995B (en) A kind of display processing method, display processing unit and terminal
CN104808764A (en) Control method and control device of working modes, electronic apparatus
US11933599B2 (en) Electronic device and method for controlling same
CN107205126B (en) Control method and processing device
CN106648374A (en) Mobile terminal screen brightness adjustment method and mobile terminal
TW201533704A (en) Image processing method and image processing device
CN106227425A (en) control method and control device
CN105931614A (en) Control method, control device and electronic device
CN107592457A (en) A kind of U.S. face method and mobile terminal
CN115691387A (en) Method for adjusting refresh frequency of display screen and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170111

RJ01 Rejection of invention patent application after publication