Brightness control method and device, electronic equipment and computer readable storage medium

By using information about the scene and face light state in the brightness control method to calculate the brightness offset, the problem of inaccurate brightness control in traditional methods is solved, and more accurate image brightness control is achieved.

CN119545187AActive Publication Date: 2025-02-28GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311118951.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-02-28
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

Traditional brightness control methods have the problem of inaccurate brightness control, which is difficult to meet the specific needs of users for image brightness.

Method used

The scene of the picture image is determined based on the brightness information of the picture image, and the light state of the face is determined based on the brightness information of the face area, and the brightness offset is calculated to finally determine the more accurate target brightness.

Benefits of technology

It improves the accuracy of brightness control, can better meet users' needs for image brightness, and reduces the perceived differences of faces under different light states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119545187A_ABST
    Figure CN119545187A_ABST
Patent Text Reader

Abstract

The invention relates to a brightness control method and device, electronic equipment, a storage medium and a computer program product. The method comprises the following steps: determining a scene of a picture image based on brightness information of the picture image; determining first brightness according to a scene of the picture image; determining a face light state based on the brightness information of the face area in the picture image and the brightness information of the picture image; determining a brightness offset according to the scene and the face light state; and determining target brightness based on the first brightness and the brightness offset. By adopting the method, the accuracy of brightness control can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of imaging technology, and in particular to a brightness control method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of imaging technology, shooting technology has emerged. During the shooting process, the brightness of the picture can be controlled by controlling the contrast, exposure and shooting mode of the picture, so that images that meet user needs can be captured.

[0003] However, conventional brightness control methods usually adjust the brightness to a preset brightness through automatic exposure, which results in inaccurate brightness control. Summary of the invention

[0004] Embodiments of the present application provide a brightness control method, device, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of brightness control.

[0005] In a first aspect, the present application provides a brightness control method. The method comprises:

[0006] Determining a scene of the picture image based on brightness information of the picture image;

[0007] Determining a first brightness according to the scene of the screen image;

[0008] Determining the light state of the face based on the brightness information of the face area in the picture image and the brightness information of the picture image;

[0009] Determining a brightness offset according to the scene and the light state of the face;

[0010] A target brightness is determined based on the first brightness and the brightness offset.

[0011] In a second aspect, the present application also provides a brightness control device. The device comprises:

[0012] A scene determination module, used to determine the scene of the picture image based on the brightness information of the picture image;

[0013] A first brightness determination module, used to determine a first brightness according to the scene of the screen image;

[0014] A face light state determination module, used to determine the face light state based on the brightness information of the face area in the screen image and the brightness information of the screen image;

[0015] An offset determination module, used to determine a brightness offset according to the scene and the light state of the face;

[0016] The target brightness determination module is used to determine the target brightness based on the first brightness and the brightness offset.

[0017] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0018] Determining a scene of the picture image based on brightness information of the picture image;

[0019] Determining a first brightness according to the scene of the screen image;

[0020] Determining the light state of the face based on the brightness information of the face area in the picture image and the brightness information of the picture image;

[0021] Determining a brightness offset according to the scene and the light state of the face;

[0022] A target brightness is determined based on the first brightness and the brightness offset.

[0023] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0024] Determining a scene of the picture image based on brightness information of the picture image;

[0025] Determining a first brightness according to the scene of the screen image;

[0026] Determining the light state of the face based on the brightness information of the face area in the picture image and the brightness information of the picture image;

[0027] Determining a brightness offset according to the scene and the light state of the face;

[0028] A target brightness is determined based on the first brightness and the brightness offset.

[0029] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0030] Determining a scene of the picture image based on brightness information of the picture image;

[0031] Determining a first brightness according to the scene of the screen image;

[0032] Determining the light state of the face based on the brightness information of the face area in the picture image and the brightness information of the picture image;

[0033] Determining a brightness offset according to the scene and the light state of the face;

[0034] A target brightness is determined based on the first brightness and the brightness offset.

[0035] The above-mentioned brightness control method, device, electronic device, computer-readable storage medium and computer program product determine the scene of the screen image based on the brightness information of the screen image, and determine the first brightness according to the scene of the screen image; determine the face light state based on the brightness information of the face area in the screen image and the brightness information of the screen image; then, according to the scene of the screen image and the face light state, that is, the difference between the face area and the entire screen image, the brightness offset can be accurately determined, so as to more accurately determine the target brightness based on the first brightness and the brightness offset. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 is a flow chart of a brightness control method in one embodiment;

[0038] Figure 2 is a brightness histogram of a face area in one embodiment;

[0039] Figure 3 is a brightness histogram of an environment in one embodiment;

[0040] Figure 4 is a brightness histogram of an environment-face area in one embodiment;

[0041] Figure 5 is a flow chart of a brightness control method in another embodiment;

[0042] Figure 6 is a structural block diagram of a brightness control device in one embodiment;

[0043] Figure 7 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0045] In one embodiment, Figure 1 As shown, a brightness control method is provided. This embodiment uses the method applied to an electronic device as an example for illustration. The electronic device can be a terminal or a server. It can be understood that the method can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, smart cars, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers.

[0046] In this embodiment, the brightness control method includes the following steps:

[0047] Step S102: determining the scene of the picture image based on the brightness information of the picture image.

[0048] The screen image is an image of a screen displayed on a screen of an electronic device. Optionally, the screen image may be an image of the entire screen displayed on the screen, i.e., a full screen image, or may be an image of a portion of the screen displayed on the screen. The brightness information of the screen image may include at least one of the brightness value of each pixel in the screen image, the average brightness value of the screen image, and pixel statistical parameters of each brightness range of the screen image, but is not limited thereto.

[0049] The scene of the picture image refers to the real scene that the picture image is in. Exemplarily, the scene of the picture image may include at least one of an indoor scene, an outdoor scene, a sunny scene, a cloudy scene, a cloudy scene, a night scene, a sunset scene, a front-lit scene, a back-lit scene, a high dynamic range scene, or a low dynamic range scene.

[0050] Optionally, the electronic device detects the brightness of the screen image to obtain brightness information of the screen image; and determines the scene of the screen image based on the brightness information of the screen image.

[0051] Optionally, the brightness information of the screen image includes the brightness value of each pixel in the screen image. The electronic device determines the average brightness value of the screen image based on the brightness value of each pixel in the screen image, and determines the scene of the screen image based on the average brightness value of the screen image.

[0052] Exemplarily, if the electronic device determines that the average brightness value of the screen image is high, it can be determined that the scene of the screen image is an outdoor scene.

[0053] Optionally, the brightness information of the electronic device includes pixel statistical parameters of each brightness range of the screen image. The electronic device determines the pixel distribution of each brightness range of the screen image based on the pixel statistical parameters of each brightness range of the screen image, and determines the scene of the screen image based on the pixel distribution of each brightness range.

[0054] Among them, the various brightness ranges of the screen image include the brightness range of the full black area, the brightness range of the dark area, the brightness range of the gray area, the brightness range of the bright area, the brightness range of the highlight area and the brightness range of the overexposed area; the average brightness of the brightness range of the full black area, the brightness range of the dark area, the brightness range of the gray area, the brightness range of the bright area, the brightness range of the highlight area and the brightness range of the overexposed area increases in sequence.

[0055] Exemplarily, if the electronic device determines that the pixel distribution of each brightness range of the screen image is that both the full black area brightness range and the overexposed area brightness range have a large proportion of brightness distribution, then it can be determined that the scene of the screen image is a high dynamic range scene.

[0056] Step S104: determining a first brightness according to the scene of the screen image.

[0057] The first brightness is the image brightness expected by the scene. The scene of the screen image represents the distribution of brightness information of the screen image and the exposure information of the camera.

[0058] Optionally, the electronic device determines a first brightness corresponding to the scene of the screen image from a preset correspondence between scenes and brightness.

[0059] The correspondence between the scene and the brightness includes at least two pairs of discrete data pairs, each pair of discrete data pairs includes a scene data and a corresponding brightness data. Optionally, the electronic device matches the scene data of the screen image with the preset correspondence between the scene and the brightness, determines the discrete data pair that matches the scene data of the screen image, and determines the first brightness based on the matched discrete data pair. The scene can be quantified into a numerical value.

[0060] If the scene data of the discrete data pair in the corresponding relationship is the same as the scene data of the screen image, the discrete data pair is matched with the scene data of the screen image, and the brightness data in the matched discrete data pair is used as the first brightness; if the scene data of the discrete data pair in the corresponding relationship is different from the scene data of the screen image, the distance between the scene data of the screen image and each discrete data pair is calculated, and the discrete data pair with the closest distance to the scene data of the screen image is used as the matched discrete data pair, and the brightness data in the matched discrete data pair is used as the first brightness.

[0061] Exemplarily, the electronic device pre-sets the brightness corresponding to the front-lit scene data to 160, the brightness corresponding to the side-lit scene data to 128, and the brightness corresponding to the back-lit scene data to 100. The scene of the screen image is quantized as scene data. The difference between the scene data and the nearest scene data can be calculated, and based on the difference and the brightness corresponding to the nearest scene data, the first brightness corresponding to the screen image is calculated.

[0062] It is understandable that for different scenes to which the screen image belongs, different ratios of the brightness of the face area and the brightness of the screen image can be configured. For example, if the scene to which the screen image belongs is front light, the brightness of the face area can be set close to the brightness of the screen image; for example, if the scene to which the screen image belongs is back light, the brightness of the face area cannot be set close to the brightness of the screen image.

[0063] Step S106, determining the light state of the face based on the brightness information of the face area in the screen image and the brightness information of the screen image.

[0064] The face light state refers to the state of the face light in the picture image. The face light state may include front light, back light, side light or shadow, etc. The picture image may include one or at least two face regions, and each face region may include one or at least two faces.

[0065] It can be understood that the electronic device can determine the brightness of the entire scene of the screen image based on the brightness information of the screen image, and can determine the brightness of the face area based on the brightness information of the face area in the screen image. Therefore, the electronic device can accurately determine the lighting state of the face based on the brightness of the entire scene of the screen image and the brightness of the face area.

[0066] Optionally, the electronic device may obtain brightness information of the face area for subsequent adjustment of a brightness curve of the face area.

[0067] Step S108, determining the brightness offset according to the scene of the screen image and the light state of the face.

[0068] The brightness offset refers to the brightness value offset from the first brightness.

[0069] Optionally, the electronic device searches for the brightness offset corresponding to the scene and face light state of the screen image from the preset correspondence between the scene and face light state and the brightness offset, wherein the scene and face light state are a pair of data.

[0070] Step S110: determining a target brightness based on the first brightness and the brightness offset.

[0071] The target brightness is the final brightness of the controlled image display.

[0072] Optionally, the electronic device adds the first brightness and the brightness offset to obtain the target brightness.

[0073] Optionally, after determining the target brightness based on the first brightness and the brightness offset, the method further includes: determining exposure information corresponding to the target brightness; and performing exposure according to the exposure information to generate a new screen image.

[0074] The exposure information includes at least one of exposure amount, exposure time, exposure gain, gamma brightness curve, aperture and sensitivity.

[0075] The electronic device determines the exposure information corresponding to the target brightness from the corresponding relationship between the brightness and the exposure information, controls the camera module to perform exposure according to the exposure information, generates a new picture image, and displays the new picture.

[0076] The brightness control method described above determines the scene of the screen image based on the brightness information of the screen image, and determines the first brightness according to the scene of the screen image; determines the light state of the face based on the brightness information of the face area in the screen image and the brightness information of the screen image; then, according to the scene of the screen image and the light state of the face, that is, the difference between the face area and the entire screen image, the brightness offset can be accurately determined, thereby more accurately determining the target brightness based on the first brightness and the brightness offset. The brightness control method described above can be used in various common modes such as taking photos and recording videos.

[0077] The brightness control method described above utilizes the brightness information of the screen image and the brightness information of the face area to obtain a more accurate screen brightness setting while maintaining the stability of the screen, and to ensure that the camera obtains the correct screen exposure information when shooting, while taking into account the brightness information of the local face and the overall screen. In addition, by determining the brightness offset based on the light state of the face, the difference in perception of the face under different light states can be avoided, such as avoiding the difference in brightness perception of the face in the shadow and in the sun, that is, the human eye will adapt to the brightness of the image, and predict the brightness of the face in the shadow, so the brightness of the face will not be too bright; predict the brightness of the face in low light, so the brightness of the face will not be too dark.

[0078] When the user is taking a photo, the camera module of the electronic device can more accurately control the exposure in automatic mode, reduce the complexity of user adjustments, and obtain the picture brightness that is more in line with the human eye through multi-dimensional judgment.

[0079] In one embodiment, the electronic device may further perform image signal processing on the face region in the new screen image to obtain a processed screen image, which may obtain a face region with higher picture quality.

[0080] For example, when the face is illuminated from the side, the brightness information of the brightness histogram of the face area is distributed with two peaks, so the electronic device adjusts the face brightness curve to be smoother to avoid the appearance of a yin-yang face with a very obvious contrast between light and dark.

[0081] For example, when a face is in direct light, the proportion of pixels in the middle brightness range of the brightness histogram of the face area is very high, so the electronic device pulls down the face brightness curve to improve the light-dark contrast of the face, thereby increasing the three-dimensional sense of the face.

[0082] In one embodiment, based on the brightness information of the face area in the screen image and the brightness information of the screen image, the face light state is determined, including: based on the average brightness of the face area in the screen image and the average brightness of the screen image, the face light state is determined.

[0083] Optionally, the electronic device determines a difference between an average brightness of a face area in a screen image and an average brightness of the screen image, and determines a light state of the face based on the difference.

[0084] Optionally, the electronic device calculates the ratio between the average brightness of the face area in the screen image and the average brightness of the screen image, where the ratio represents the difference between the average brightness of the face area in the screen image and the average brightness of the screen image; and determines the light state of the face based on the ratio.

[0085] For example, if the average brightness of the face area is lower and the average brightness of the picture image is higher, that is, the ratio between the average brightness of the face area and the average brightness of the picture image is smaller, it can be considered that the lighting state of the face is in backlight; if the average brightness of the face area is higher and the average brightness of the picture image is lower, that is, the ratio between the average brightness of the face area and the average brightness of the picture image is larger, it can be considered that the lighting state of the face is in front light.

[0086] In one embodiment, the facial light state is determined based on the brightness information of the facial area in the screen image and the brightness information of the screen image, including: determining the facial light state based on the average brightness of the facial area in the screen image, the average brightness of the screen image and the pixel statistical parameters in each brightness range in the facial area.

[0087] The pixel statistical parameter is a parameter obtained by statistically analyzing pixel data. The pixel statistical parameters in each brightness range in the face area may include the number of pixels in each brightness range, the ratio of the number of pixels in each brightness range to the total number of pixels in the face area, etc., but are not limited thereto.

[0088] Optionally, the electronic device determines the difference between the average brightness of the face area in the screen image and the average brightness of the screen image, and determines the light state of the face based on the difference and pixel statistical parameters within each brightness range in the face area.

[0089] Optionally, the electronic device calculates the ratio between the average brightness of the face area in the screen image and the average brightness of the screen image, and the ratio represents the difference between the average brightness of the face area in the screen image and the average brightness of the screen image; based on the ratio and the pixel statistical parameters in each brightness range in the face area, the light state of the face is determined.

[0090] For example, if the average brightness of the face area is lower and the average brightness of the screen image is higher, that is, the ratio between the average brightness of the face area and the average brightness of the screen image is smaller, and there is an overexposed area in the face area, that is, the number of pixels within the brightness range of the overexposed area in the face area is larger, then it can be considered that the light state of the face is backlit and part of the face area is in shadow.

[0091] Optionally, the method further includes: counting brightness information of each pixel in the face area of ​​the screen image; and determining pixel statistical parameters of the face area within each brightness range.

[0092] The brightness information of the pixel may be the pixel value of the pixel, and the pixel value is used to represent the brightness of the pixel. The brightness ranges of the face area include a full black area brightness range, a dark area brightness range, a gray area brightness range, a bright area brightness range, a highlight area brightness range, and an overexposed area brightness range; the average brightness of the full black area brightness range, the dark area brightness range, the gray area brightness range, the bright area brightness range, the highlight area brightness range, and the overexposed area brightness range increases in sequence.

[0093] Optionally, the electronic device divides the face area into at least two brightness ranges in terms of brightness. Exemplarily, the electronic device divides the face area into 0-12, 12-90, 90-204, 204-242, and 242-255 in the brightness range of pixels 0-255.

[0094] Optionally, the electronic device traverses each pixel in the face area, obtains brightness information of each pixel, and distributes the brightness information of each pixel to each brightness range to obtain pixel statistical parameters of the face area in each brightness range.

[0095] Optionally, the electronic device divides the brightness histogram of the face area to be generated into at least two brightness ranges in terms of brightness, allocates the brightness information of each pixel to each brightness range, and generates a brightness histogram of the face area, wherein the brightness histogram of the face area includes pixel statistical parameters of the face area in each brightness range. The histogram is used to count the brightness distribution of pixels.

[0096] The brightness histogram of the face area is used to count the brightness of each pixel in the face area and distribute it according to 0-255 to obtain the brightness distribution relationship of each pixel in the face area to estimate the light source of the current face.

[0097] The brightness histogram of the screen image is used to count the brightness of each pixel in the screen image, and statistically distribute it according to 0-255 to obtain the brightness distribution relationship of each pixel in the screen image to estimate the light source of the current human environment. For example, the brightness distribution of the brightness histogram of the front-lit scene is high in the middle and low on both sides; the brightness histogram of the backlit scene or the shadow scene has two peaks.

[0098] like Figure 2 Shown is a schematic diagram of a brightness histogram of a face region, wherein the abscissa of the brightness histogram is the brightness after normalizing the pixel value range 0-255, including 0-100, and the ordinate is the ratio of the number of pixels in the face region at the brightness value.

[0099] In this embodiment, the electronic device can accurately determine the light state of the face based on the average brightness of the face area in the screen image, the average brightness of the screen image, and the pixel statistical parameters in each brightness range in the face area, and thus can accurately determine the brightness offset and the target brightness, so as to subsequently control the screen to be displayed at the target brightness, thereby improving the picture quality of the face in the screen.

[0100] In one embodiment, determining the target brightness based on the first brightness and the brightness offset includes: determining an impact factor corresponding to the brightness offset; and determining the target brightness based on the first brightness, the brightness offset and the impact factor.

[0101] Among them, the influencing factor is a parameter that affects the magnitude of the brightness offset.

[0102] Optionally, the electronic device multiplies the brightness offset and the influence factor, and then adds the product obtained by the multiplication to the first brightness to obtain the target brightness.

[0103] Exemplarily, the electronic device calculates the target brightness using the following formula: EV=EV0+△EV*a; wherein EV is the target brightness, EV0 is the first brightness, △EV is the brightness offset, and a is the influencing factor.

[0104] Optionally, determining the influence factor corresponding to the brightness offset includes: determining the influence factor corresponding to the brightness offset based on at least one of the size of the face area in the picture image and the distance between the face area and the center of the picture; the influence factor is positively correlated with the size, and the influence factor is negatively correlated with the distance.

[0105] Among them, the size of the face area in the picture image can be divided into a large face or a small face, etc.; the distance between the face area and the center of the picture can be small or large. A smaller distance indicates that the face area is a face in the center position, and a larger distance indicates that the face area is a face in the edge position.

[0106] Optionally, the electronic device detects a face area in a screen image, obtains at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen, and determines an influencing factor corresponding to the brightness offset based on at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen.

[0107] Optionally, the electronic device pre-sets a correspondence between the impact factor and the size of the face area in the screen image, and the distance between the face area and the center of the screen, in which the impact factor and the size are positively correlated, and the impact factor and the distance are negatively correlated; if the electronic device detects the size of the face area in the screen image, the size is matched with the correspondence to determine the impact factor corresponding to the size; if the electronic device detects the distance between the face area and the center of the screen, the distance is matched with the correspondence to determine the impact factor corresponding to the distance; if the electronic device detects the size of the face area in the screen image and the distance between the face area and the center of the screen, the size and the distance are matched with the correspondence to determine the impact factor corresponding to the size and the distance.

[0108] Optionally, if the screen image includes at least two face areas, for each face area, a new brightness offset of the face area is determined based on the brightness offset and the influencing factor of the face area; and the target brightness is determined based on the first brightness and the new brightness offsets of at least two face areas.

[0109] Optionally, for each face area, the electronic device multiplies the brightness offset of the face area by the influence factor to obtain a new brightness offset of the face area; averages the new brightness offsets of at least two face areas to obtain a target offset; and adds the first brightness to the target offset to determine the target brightness.

[0110] Exemplarily, the screen image includes two face areas, the first face area is larger in size in the screen image, and the distance between the face area and the center of the screen is smaller, indicating that the face area is larger in size and is located within the center range of the screen image, then the influence factor of the face area is larger, the second face area is smaller in size in the screen image, and the distance between the face area and the center of the screen is larger, indicating that the face area is smaller and is located at the edge of the screen image, then the influence factor of the face area is smaller; for each face area, the electronic device multiplies the brightness offset of the face area by the influence factor to obtain a new brightness offset for each face area, and then averages the two new brightness offsets to obtain a target offset.

[0111] It is understandable that since the first face area is larger and located in the center of the screen image, the influence factor of this face area is larger, so the new brightness offset of this face area is also larger, and the average target offset is closer to the new brightness offset of the first face area, so that the target brightness is also more consistent with the first face area. The picture adjusted with the target brightness can more accurately display the facial picture quality of the first face area.

[0112] In this embodiment, the electronic device determines the influence factor corresponding to the brightness offset, so based on the first brightness, the brightness offset and the influence factor, the target brightness can be determined more accurately. Further, the electronic device determines the influence factor corresponding to the brightness offset based on at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen; the influence factor is positively correlated with the size, and negatively correlated with the distance, so the influence factor can be determined more accurately.

[0113] In one embodiment, the above-mentioned determination of the scene of the screen image based on the brightness information of the screen image includes: counting the brightness information of each pixel in the screen image; determining the statistical parameters of the pixels within each brightness range in the screen image; and determining the scene of the screen image based on the statistical parameters of the pixels within each brightness range in the screen image.

[0114] Among them, the pixel statistical parameters in each brightness range in the screen image may include the number of pixels in each brightness range, the ratio of the number of pixels in each brightness range to the total number of pixels in the screen image, etc., but are not limited thereto.

[0115] Optionally, the electronic device divides the screen image into at least two brightness ranges in terms of brightness. Exemplarily, the electronic device divides the screen image into 0-12, 12-90, 90-204, 204-242, and 242-255 in the brightness range of pixels 0-255.

[0116] Optionally, the brightness information of each pixel in the screen image is counted; and pixel statistical parameters of the screen image within each brightness range are determined.

[0117] Optionally, the electronic device traverses each pixel in the screen image, obtains the brightness information of each pixel, and distributes the brightness information of each pixel to each brightness range to obtain pixel statistical parameters of the screen image in each brightness range; the pixel statistical parameters of the screen image in each brightness range represent the distribution of ambient light. It is understandable that the division method of each brightness range in the screen image and each brightness range in the face area is the same.

[0118] Optionally, the electronic device divides the brightness histogram of the screen image to be generated into at least two brightness ranges in terms of brightness, allocates the brightness information of each pixel to each brightness range, and generates a brightness histogram of the screen image, wherein the brightness histogram of the screen image includes pixel statistical parameters of the screen image in each brightness range.

[0119] For example, if the pixel statistical parameters of the brightness range of the all-black area and the brightness range of the overexposed area in the screen image are both large, it can be considered that the scene of the screen image belongs to a high dynamic range scene. For example, if the brightness range of the bright area in the screen image has a large proportion and the proportion of other brightness ranges is low, it can be considered that the scene of the screen image belongs to a front-lit soft light scene (for example, shooting an indoor portrait); if the brightness range of the bright area and the brightness range of the highlight area in the screen image have a large proportion, it can be considered that the scene of the screen image belongs to a front-lit scene with a background light source (for example, shooting a person and a blue sky outdoors).

[0120] like Figure 3 The figure shows a schematic diagram of a brightness histogram of a screen image. The horizontal axis of the brightness histogram is the brightness after normalizing the pixel value range 0-255, including 0-100, and the vertical axis is the proportion of the number of pixels at the brightness value in the screen image. The brightness histogram of the screen image can represent the ambient brightness.

[0121] In this embodiment, the electronic device counts the brightness information of each pixel in the screen image and determines the pixel statistical parameters within each brightness range in the screen image. Then, based on the pixel statistical parameters within each brightness range in the screen image, the scene of the screen image can be accurately determined.

[0122] In one embodiment, the method further includes: the electronic device obtains a brightness histogram of the screen image and a brightness histogram of the face area; and compares the brightness histogram of the screen image and the brightness histogram of the face area to determine the light status of the scene and the face.

[0123] like Figure 2 , Figure 3 and Figure 4 As shown, Figure 2 is the brightness histogram of the face area, Figure 3 It is the brightness histogram of the screen image, which represents the ambient brightness, also known as the ambient histogram; electronic devices will Figure 2 and Figure 3 The images are superimposed to obtain a brightness histogram of the environment-face area, so as to more clearly compare the brightness histogram of the screen image with the brightness histogram of the face area.

[0124] In one embodiment, Figure 5 As shown, when the electronic device detects a face from a screen image, it counts the brightness information of the screen image and generates a brightness histogram of the screen image, wherein the brightness histogram of the screen image represents the brightness information of the screen image; based on the brightness histogram of the screen image, the scene of the screen image is identified; and according to the scene of the screen image, a first brightness is determined;

[0125] The brightness information of the face area is counted to generate a brightness histogram of the face area, the brightness histogram of the face area represents the brightness information of the face area, and the light state of the face is determined based on the brightness histogram of the face area and the brightness histogram of the screen image; the light state of the scene and the face is compared to generate a brightness offset;

[0126] Generate an impact factor based on face size and distance information; wherein the face size is the size of the face area in the screen image, and the distance information is the distance between the face area and the center of the screen;

[0127] Based on the first brightness, the brightness offset and the influencing factor, a final target brightness is output.

[0128] In one embodiment, a brightness control method is also provided, which is applied to an electronic device, and the brightness control method comprises the following steps:

[0129] Step A1, counting the brightness information of each pixel in the screen image.

[0130] Step A2, determining pixel statistical parameters within each brightness range in the screen image.

[0131] Step A3, determining the scene of the picture image based on the pixel statistical parameters within each brightness range in the picture image.

[0132] Step A4, determining a first brightness according to the scene of the screen image.

[0133] Step A5: Count the brightness information of each pixel in the face area of ​​the screen image.

[0134] Step A6, determining pixel statistical parameters of the face area in each brightness range.

[0135] Step A7, determining the light state of the face based on the average brightness of the face area in the screen image, the average brightness of the screen image, and the pixel statistical parameters in each brightness range in the face area.

[0136] Step A8, determining the brightness offset according to the scene of the screen image and the light state of the face.

[0137] Step A9, based on at least one of the size of the face area in the picture image and the distance between the face area and the center of the picture, determine the influence factor corresponding to the brightness offset; the influence factor is positively correlated with the size, and negatively correlated with the distance.

[0138] Step A10, determining the impact factor corresponding to the brightness offset.

[0139] Step A11, determining the target brightness based on the first brightness, the brightness offset and the influencing factor.

[0140] Step A12, determining exposure information corresponding to the target brightness.

[0141] Step A13, performing exposure according to the exposure information to generate a new screen image.

[0142] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0143] Based on the same inventive concept, the embodiment of the present application also provides a brightness control device for implementing the brightness control method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more brightness control device embodiments provided below can refer to the limitations of the brightness control method above, and will not be repeated here.

[0144] In one embodiment, Figure 6 As shown, a brightness control device is provided, including: a scene determination module 602, a first brightness determination module 604, a face light state determination module 606, an offset determination module 608 and a target brightness determination module 610, wherein:

[0145] The scene determination module 602 is used to determine the scene of the picture image based on the brightness information of the picture image.

[0146] The first brightness determination module 604 is used to determine the first brightness according to the scene of the screen image.

[0147] The face light state determination module 606 is used to determine the face light state based on the brightness information of the face area in the screen image and the brightness information of the screen image.

[0148] The offset determination module 608 is used to determine the brightness offset according to the scene of the screen image and the light state of the face.

[0149] The target brightness determination module 610 is used to determine the target brightness based on the first brightness and the brightness offset.

[0150] The above-mentioned brightness control device determines the scene of the screen image based on the brightness information of the screen image, and determines the first brightness according to the scene of the screen image; determines the light state of the face based on the brightness information of the face area in the screen image and the brightness information of the screen image; then, according to the scene of the screen image and the light state of the face, that is, the difference between the face area and the entire screen image, the brightness offset can be accurately determined, thereby more accurately determining the target brightness based on the first brightness and the brightness offset.

[0151] In one embodiment, the above-mentioned face light state determination module 606 is also used to determine the face light state based on the average brightness of the face area in the screen image, the average brightness of the screen image and the pixel statistical parameters in each brightness range in the face area.

[0152] In one embodiment, the above-mentioned device further includes a statistical module, which is used to count the brightness information of each pixel in the face area of ​​the screen image; and determine the pixel statistical parameters of the face area within each brightness range.

[0153] In one embodiment, the target brightness determination module 610 is further configured to determine an impact factor corresponding to the brightness offset; and determine the target brightness based on the first brightness, the brightness offset and the impact factor.

[0154] In one embodiment, the target brightness determination module 610 is also used to determine the impact factor corresponding to the brightness offset based on at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen; the impact factor is positively correlated with the size, and the impact factor is negatively correlated with the distance.

[0155] In one embodiment, the above-mentioned statistical module is also used to count the brightness information of each pixel in the screen image; determine the statistical parameters of the pixels within each brightness range in the screen image; the above-mentioned scene determination module 602 is also used to determine the scene of the screen image based on the statistical parameters of the pixels within each brightness range in the screen image.

[0156] In one embodiment, the above-mentioned device further includes an image generation module, which is used to determine exposure information corresponding to the target brightness; perform exposure according to the exposure information to generate a new screen image.

[0157] Each module in the brightness control device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0158] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a brightness control method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.

[0159] Those skilled in the art will understand that Figure 7The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0160] The embodiment of the present application further provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the brightness control method.

[0161] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the brightness control method.

[0162] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0163] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0164] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0165] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A brightness control method, characterized in that: include: Determining a scene of the picture image based on brightness information of the picture image; Determining a first brightness according to the scene of the screen image; Determining the light state of the face based on the brightness information of the face area in the picture image and the brightness information of the picture image; Determining a brightness offset according to the scene and the light state of the face; A target brightness is determined based on the first brightness and the brightness offset.

2. The method according to claim 1, characterized in that The determining of the light state of the face based on the brightness information of the face area in the screen image and the brightness information of the screen image includes: The light state of the face is determined based on the average brightness of the face area in the screen image, the average brightness of the screen image, and the pixel statistical parameters within each brightness range in the face area.

3. The method according to claim 2, characterized in that The method further comprises: Counting the brightness information of each pixel in the face area of ​​the picture image; Determine pixel statistical parameters of the face region in each brightness range.

4. The method according to claim 1, characterized in that: The determining of the target brightness based on the first brightness and the brightness offset includes: Determine the impact factor corresponding to the brightness offset; A target brightness is determined based on the first brightness, the brightness offset, and the influencing factor.

5. The method according to claim 4, characterized in that The determining the influencing factor corresponding to the brightness offset includes: Based on at least one of the size of the face area in the screen image and the distance between the face area and the center of the screen, determine the impact factor corresponding to the brightness offset; the impact factor is positively correlated with the size, and the impact factor is negatively correlated with the distance.

6. The method according to claim 1, characterized in that The step of determining the scene of the screen image based on the brightness information of the screen image comprises: Count the brightness information of each pixel in the screen image; Determining pixel statistical parameters within each brightness range in the picture image; The scene of the picture image is determined based on the statistical parameters of pixels within each brightness range in the picture image.

7. The method according to any one of claims 1 to 6, characterized in that: After determining the target brightness based on the first brightness and the brightness offset, the method further includes: Determining exposure information corresponding to the target brightness; Expose according to the exposure information to generate a new screen image.

8. A brightness control device, characterized in that: include: A scene determination module, used to determine the scene of the picture image based on the brightness information of the picture image; A first brightness determination module, used to determine a first brightness according to the scene of the screen image; A face light state determination module, used to determine the face light state based on the brightness information of the face area in the picture image and the brightness information of the picture image; An offset determination module, used to determine a brightness offset according to the scene and the light state of the face; The target brightness determination module is used to determine the target brightness based on the first brightness and the brightness offset.

9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the brightness control method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Automatic exposure adjusting method and system

    CN103826066A

  • Method for automatically adjusting AE target brightness

    CN112804461A

  • Brightness adjustment method and device, equipment and storage medium

    CN114268745A

  • Face brightness calculation method and device, medium and equipment

    CN115988310A

  • Method for automatically controlling exposure and device for automatically compensating exposure

    CN1984260A