Brightness adjustment method and device, electronic equipment, storage medium and program product

By detecting the brightness difference between video frames and adjusting the brightness of the image area, the problem of sudden background brightness changes in the backlight environment is solved, and the smooth transition and stability of brightness are achieved.

CN119094897APending Publication Date: 2024-12-06VIVO MOBILE COMM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411094092.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When shooting videos in a backlight environment, electronic devices can easily cause sudden changes in the brightness of the background image when adjusting the exposure amount to balance the foreground and background brightness.

Method used

By obtaining the brightness value of the video frame, detecting whether the brightness difference exceeds the threshold, determining the image area and adjusting its brightness to make it approach the brightness value of the previous frame, ensuring a smooth transition of brightness.

Benefits of technology

It effectively eliminates the phenomenon of mutation in the brightness of the background image shooting and improves the stability of the background brightness in the video.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094897A_ABST
    Figure CN119094897A_ABST
Patent Text Reader

Abstract

The invention discloses a brightness adjusting method and device, electronic equipment, a storage medium and a program product, and belongs to the technical field of electronics. The method comprises the following steps: acquiring a brightness value of a collected first video frame; under the condition that the difference value between the brightness value of the first video frame and the brightness value of the second video frame is greater than or equal to a first threshold value, determining a first image area in the first video frame, the first image area being an image area in which image contents in the first video frame and the second video frame are matched; adjusting the brightness of the first image area to a first brightness value, wherein the first brightness value is a brightness value matched with the brightness value of the second video frame; wherein the second video frame is a video frame collected before the first video frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of electronic technology, and specifically relates to a brightness adjustment method, device, electronic device, storage medium and program product. Background Art

[0002] At present, when shooting videos, electronic devices can perform different exposure processing for the foreground and background. Taking shooting videos in a backlit environment as an example, usually, in a backlit environment, due to changes in the shooting environment, the brightness of the background image in the shooting picture collected by the electronic device will change, and then the electronic device can adjust the exposure of the shooting picture to make the image brightness of the collected background image tend to be normal.

[0003] However, according to the above method, when the exposure of the shooting picture is increased, not only the image brightness of the shooting foreground in the shooting picture will be increased, but also the image brightness of the shooting background in the shooting picture will be increased, which will cause a sudden change in the brightness of the shooting background image. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a brightness adjustment method, device, electronic device, storage medium and program product, which can eliminate the phenomenon of sudden brightness changes in the brightness of the image of the captured background.

[0005] In a first aspect, an embodiment of the present application provides a brightness adjustment method, which includes: obtaining a brightness value of a captured first video frame; when the difference between the brightness value of the first video frame and the brightness value of the second video frame is greater than or equal to a first threshold, determining a first image area in the first video frame, the first image area being an image area whose image content matches that of the first video frame and the second video frame; adjusting the brightness of the first image area to a first brightness value, the first brightness value being a brightness value that matches the brightness value of the second video frame; wherein the second video frame is a video frame captured before the first video frame.

[0006] In a second aspect, an embodiment of the present application provides a brightness adjustment device, which includes: an acquisition module, a determination module and an adjustment module. The acquisition module is used to acquire the brightness value of the captured first video frame. The determination module is used to determine the first image area in the first video frame when the difference between the brightness value of the first video frame acquired by the acquisition module and the brightness value of the second video frame is greater than or equal to a first threshold value, and the first image area is an image area whose image content matches that of the first video frame and the second video frame. The adjustment module is used to adjust the brightness of the first image area determined by the determination module to a first brightness value, and the first brightness value is a brightness value that matches the brightness value of the second video frame; wherein the second video frame is a video frame captured before the first video frame.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0011] In an embodiment of the present application, the electronic device can obtain the brightness value of the first video frame collected; when the difference between the brightness value of the first video frame and the brightness value of the second video frame is greater than or equal to the first threshold, determine the first image area in the first video frame, the first image area is the image area whose image content matches that of the first video frame and the second video frame; adjust the brightness of the first image area to a first brightness value, the first brightness value is a brightness value that matches the brightness value of the second video frame; wherein the second video frame is a video frame collected before the first video frame. In this scheme, when it is detected that the brightness difference between the collected first video frame and the second video frame is greater than or equal to the first preset threshold, that is, when a sudden brightness change occurs between the first video frame and the second video frame, the present application adjusts the brightness value of the first image area in the first video frame to the first brightness value, so that the brightness of the first image area in the first video frame can approach the brightness of the second video frame, thereby ensuring that the brightness between the second video frame and the first image area in the first video frame can smoothly transition, so that the electronic device can eliminate the phenomenon of sudden brightness change in the image brightness of the shooting background. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is one of the flow charts of a brightness adjustment method provided in an embodiment of the present application;

[0013] Figure 2A It is one of the example images of a video frame provided in an embodiment of the present application;

[0014] Figure 2BThis is a second example of a video frame provided in an embodiment of the present application;

[0015] Figure 3 This is the second flowchart of a brightness adjustment method provided in an embodiment of the present application;

[0016] Figure 4 This is a third example of a video frame provided in an embodiment of the present application;

[0017] Figure 5 This is the third flowchart of a brightness adjustment method provided in an embodiment of the present application;

[0018] Figure 6 This is a fourth flow chart of a brightness adjustment method provided in an embodiment of the present application;

[0019] Fig. 7A This is one of the example diagrams of a shooting preview interface provided in an embodiment of the present application;

[0020] Figure 7B This is a second example diagram of a shooting preview interface provided in an embodiment of the present application;

[0021] Figure 8 This is the fifth flow chart of a brightness adjustment method provided in an embodiment of the present application;

[0022] Fig. 9 This is the sixth flowchart of a brightness adjustment method provided in an embodiment of the present application;

[0023] Fig.10 This is the seventh flow chart of a brightness adjustment method provided in an embodiment of the present application;

[0024] Fig.11 is a structural schematic diagram of a brightness adjustment device provided in an embodiment of the present application;

[0025] Fig.12 This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;

[0026] Fig.13 This is the second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0029] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0030] The professional terms provided in the embodiments of the present application are explained in detail below.

[0031] Foreground: The scenery in front of the subject is called the foreground, which is closest to the lens. For example, if the person is the subject, then the blurred ginkgo leaves in front of the person, close to the camera, belong to the foreground.

[0032] Shooting background: The scenery behind the main character is called shooting background, and the shooting background is the farthest from the lens. For example, if the person is the shooting subject, then the mountains and sea behind the person are the shooting background.

[0033] Tone processing: Tone is a term in photography, because photography, which uses the changes of light and shadow to form a picture, has a more musical visual change. For photographic works, "tone" is also called the keynote or tone of the photo; tone refers to the relationship between the light and dark levels, virtual and real contrast, and the hue and light and dark of the color. Through these relationships, the audience can feel the flow and change of light. The lines, shapes, colors and other elements in the photographic picture are reflected by the tone, such as lines are the boundaries of different tones on the picture.

[0034] The brightness adjustment method, device, electronic device, storage medium and program product provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0035] The brightness adjustment method, device, electronic device, storage medium and program product provided in the embodiments of the present application can be applied in video shooting scenarios.

[0036] With the development of electronic devices, more and more functions are included in the electronic devices. The electronic devices can perform different exposure processing for shooting foreground and shooting background, so as to obtain videos with different effects.

[0037] For example, in a backlit scene, when an electronic device is shooting a video, the background will reflect sunlight, so the brightness of the video frame that contains only the background will be higher. At this time, the electronic device can lower the exposure of the background image to obtain a video frame that contains the background with normal brightness. When the electronic device captures the foreground, the brightness of the video frame that contains the foreground will be darker because the electronic device will block sunlight. In order to ensure the imaging effect of the foreground, the electronic device can increase the exposure to increase the brightness of the video frame containing the portrait.

[0038] In one example, after capturing a picture that only contains the shooting background, if a shooting foreground enters the shooting picture, then when the exposure of the shooting picture is increased, not only the image brightness of the shooting foreground in the shooting picture will be increased, but the image brightness of the shooting background in the shooting picture will also be increased, which will cause a sudden change in the image brightness of the shooting background.

[0039] In another example, after capturing a picture containing a foreground, if the foreground leaves the picture, and the electronic device captures a picture containing only the background, the electronic device can lower the exposure of the picture, which will cause a sudden change in the brightness of the background image.

[0040] In the brightness adjustment method, device, electronic device and storage medium provided in the embodiments of the present application, when it is detected that the brightness difference between the captured first video frame and the second video frame is greater than or equal to the first preset threshold, that is, when a sudden brightness change occurs between the first video frame and the second video frame, the present application adjusts the brightness value of the first image area in the first video frame to the first brightness value, so that the brightness of the first image area in the first video frame can approach the brightness of the second video frame, thereby ensuring that the brightness between the second video frame and the first image area in the first video frame can smoothly transition, so that the electronic device can eliminate the phenomenon of sudden brightness change in the image brightness of the captured background.

[0041] The execution subject of the brightness adjustment method provided in the embodiment of the present application may be a brightness adjustment device, and the brightness adjustment device may be an electronic device, or a functional module in an electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.

[0042] The present application provides a brightness adjustment method. Figure 1 FIG. 1 is a flow chart of a brightness adjustment method provided by an embodiment of the present application. Figure 1 As shown, the brightness adjustment method provided in the embodiment of the present application may include the following steps 201 to 203.

[0043] Step 201: The electronic device obtains a brightness value of a captured first video frame.

[0044] Optionally, in an embodiment of the present application, the first video frame may include a shooting foreground and a shooting background; or, the first video frame may only include a shooting background.

[0045] Exemplarily, when the first video frame includes a shooting foreground and a shooting background, the brightness value of the first video frame is 60; when the first video frame includes only a shooting background, the brightness value of the first video frame is 50.

[0046] Optionally, in the embodiment of the present application, the foreground for shooting may be any of the following: a person, an animal, or an object, etc. The specific foreground may be determined according to actual usage, and the embodiment of the present application does not limit it.

[0047] Optionally, in the embodiment of the present application, the shooting background may be any one of the following: a building, a tree, or a mountain, etc. The specific background may be determined according to actual usage, and the embodiment of the present application does not limit the background.

[0048] Optionally, in an embodiment of the present application, the number of the first video frames may be one frame or multiple frames.

[0049] Optionally, in an embodiment of the present application, the first video frame may be a video frame in a video stored in the electronic device; or, the first video frame may be captured by a camera of the electronic device.

[0050] Step 202: The electronic device determines a first image area in the first video frame when a difference between a brightness value of the first video frame and a brightness value of the second video frame is greater than or equal to a first threshold.

[0051] In the embodiment of the present application, the first image area is an image area whose image contents match those in the first video frame and the second video frame.

[0052] In the embodiment of the present application, the second video frame is a video frame captured before the first video frame.

[0053] Optionally, in an embodiment of the present application, the first video frame is a video frame with a shooting foreground, and the second video frame is a video frame captured before the first video frame and with no shooting foreground; or, the first video frame is a video frame with no shooting foreground, and the second video frame is a video frame captured before the first video frame and with a shooting foreground.

[0054] In one example, taking the case where video frame 1 includes a shooting foreground and a shooting background, and video frame 2 does not include a shooting foreground, when the difference between the brightness value of video frame 1 and the brightness value of video frame 2 is greater than or equal to a first threshold, the electronic device can determine a first image area in video frame 1 and adjust the brightness of the first image area in video frame 1 to the first brightness value.

[0055] For example, Figure 2A As shown, the video frames 1, 10 captured by the electronic device include white clouds 11, the sun 12 and three trees 13 in the background. Figure 2B As shown, the video frame 1, 20 captured by the electronic device includes white clouds 21, the sun 22, three trees and a little girl 23.

[0056] In another example, taking the case where video frame 1 does not include a shooting foreground and a shooting background, and video frame 2 includes a shooting foreground, when the difference between the brightness value of video frame 1 and the brightness value of video frame 2 is greater than or equal to a first threshold, the electronic device can determine a first image area in video frame 1 and adjust the brightness of the first image area in video frame 1 to the first brightness value.

[0057] Optionally, in an embodiment of the present application, the image content of the first image area being the image content of the first video frame matching the image content of the second video frame can be understood as: part of the image content in the first video frame is the same as part of the image content in the second video frame; or, the similarity between the part of the image content in the first video frame and the part of the image content in the second video frame is greater than or equal to a second threshold.

[0058] It can be understood that the above “the difference between the brightness value of the first video frame and the brightness value of the second video frame is greater than or equal to the first threshold” is used to represent a sudden brightness change between the brightness of the first video frame and the brightness of the second video frame.

[0059] In one example, taking the case where the first video frame includes a shooting foreground and a shooting background and the second video frame does not include a shooting foreground, when the brightness difference between the brightness value of the first video frame and the brightness value of the second video frame is greater than or equal to a first threshold, the electronic device can determine that a brightness mutation occurs between the brightness of the shooting background in the first video frame and the brightness of the shooting background in the second video frame.

[0060] In another example, taking the case where the first video frame does not include the shooting background and the second video frame includes the shooting foreground and the shooting back, when the brightness difference between the brightness value of the first video frame and the brightness value of the second video frame is greater than or equal to 10, the electronic device can determine that a sudden brightness change occurs between the brightness of the first video frame and the brightness of the second video frame.

[0061] Optionally, in the embodiment of the present application, the first threshold may be preset by a user.

[0062] For example, the first threshold may be determined by a user through experimental data. Alternatively, the first threshold may be determined by a user observing a brightness change caused by a foreground image in a video entering or exiting a shooting screen.

[0063] Optionally, in an embodiment of the present application, after obtaining the brightness value of the first video frame and the brightness value of the second video frame, the electronic device may calculate the difference between the brightness values ​​of the first video frame and the second video frame to obtain the brightness difference between the first video frame and the second video frame.

[0064] Optionally, in the embodiment of the present application, combined with Figure 1 ,like Figure 3 As shown, the above step 202 can be specifically implemented through the following steps 202a to 202c.

[0065] Step 202a: The electronic device obtains image content in the first video frame and image content in the second video frame.

[0066] Optionally, in an embodiment of the present application, the electronic device may obtain image content in the first video frame and image content in the second video frame through a first algorithm.

[0067] Optionally, in an embodiment of the present application, the first algorithm may be any one of the following: an artificial intelligence (AI) algorithm or a neural network algorithm.

[0068] Exemplarily, the electronic device may input the first video frame and the second video frame into a neural network algorithm, respectively, to obtain the image content in the first video frame and the image content in the second video frame, respectively.

[0069] Step 202b: The electronic device determines that the image content of the first video frame and the image content of the second video frame, whose similarity is greater than or equal to the second threshold, is the first image content.

[0070] Optionally, in an embodiment of the present application, the electronic device may segment the first video frame to obtain M first image regions, and segment the second video frame to obtain M second image regions, wherein the M first image regions correspond one to one to the M second image regions; then, the electronic device may calculate the similarity between the image content in each first image region and the image content in the corresponding second image region, and take the image content in the M first image regions whose similarity is greater than a second threshold as the first image content, where M is a positive integer.

[0071] Optionally, in the embodiment of the present application, the second threshold may be preset by a user.

[0072] For example, the second threshold may be determined by the user through experimental data. Alternatively, the second threshold may be determined by the user observing the brightness change caused by the foreground of the video entering and exiting the shooting screen.

[0073] For example, the second threshold may be 95%, that is, the electronic device may use the image content with a similarity greater than or equal to 95% among the image contents of the M first image regions as the first image content.

[0074] Step 202c: The electronic device determines the image area corresponding to the first image content in the first video frame as the first image area.

[0075] For example, in conjunction with FIG. 2 , Figure 4 As shown, the electronic device can identify the image content in video frame 1 and the image content in video frame 2, so as to obtain the same image content in video frame 1 and video frame 2: white clouds, sun and trees. Then, the electronic device determines the first image area 30 in video frame 1 based on the same image content in video frame 1 and video frame 2: white clouds, sun and trees.

[0076] In the embodiment of the present application, the electronic device may determine the first image content as the image content whose similarity between the image content in the first video frame and the image content in the second video frame is greater than or equal to the second threshold, and determine the image area corresponding to the first image content as the first image area. In this way, the accuracy of the electronic device in determining the same image area in the first video frame and the second video frame is improved.

[0077] Step 203: The electronic device adjusts the brightness of the first image area to a first brightness value.

[0078] In the embodiment of the present application, the first brightness value is a brightness value that matches the brightness value of the second video frame.

[0079] It can be understood that the above-mentioned first brightness value is a brightness value that matches the brightness value of the second video frame, which can be: the first brightness value is the same as the brightness value of the second video frame; or, the brightness difference between the first brightness value and the brightness value of the second video frame is less than the first threshold.

[0080] Optionally, in the embodiment of the present application, if the electronic device is in the process of shooting, the electronic device may adjust the brightness of the first image area to a first brightness value through a tone processing module.

[0081] Optionally, in an embodiment of the present application, the first brightness value may be a brightness value of the second video frame, or the first brightness value is determined based on a brightness value of the first video frame and a target brightness difference value.

[0082] In the brightness adjustment method provided in the embodiment of the present application, the electronic device can obtain the brightness value of the first video frame collected; when the difference between the brightness value of the first video frame and the brightness value of the second video frame is greater than or equal to the first threshold, determine the first image area in the first video frame, the first image area is the image area whose image content matches that of the first video frame and the second video frame; adjust the brightness of the first image area to the first brightness value, the first brightness value is the brightness value that matches the brightness value of the second video frame; wherein the second video frame is the video frame collected before the first video frame. In this scheme, when it is detected that the brightness difference between the collected first video frame and the second video frame is greater than or equal to the first preset threshold, that is, when a sudden brightness change occurs between the first video frame and the second video frame, the present application uses the first brightness value to make the brightness of the first image area in the first video frame approach the brightness of the second video frame, thereby ensuring that the brightness between the second video frame and the first image area in the first video frame can be smoothly transitioned, so that the electronic device can eliminate the phenomenon of sudden brightness change in the image brightness of the shooting background.

[0083] Optionally, in an embodiment of the present application, the first video frame is captured by an electronic device.

[0084] For example, in combination Figure 1 ,like Figure 5 As shown, the above step 201 can be specifically implemented through the following step 201a, and the above step 203 can be specifically implemented through the following step 203c.

[0085] Step 201a: The electronic device obtains a brightness value of a first video frame through an exposure system in the electronic device.

[0086] In the embodiment of the present application, the electronic device can capture the first video frame through the image sensor, and obtain the brightness value of the captured first video frame through the exposure system.

[0087] Exemplarily, the electronic device can capture the original image corresponding to the first video frame, i.e., the RWA image, through an image sensor, and then input the original image into an exposure system, and adjust the exposure time and exposure gain of the original image through the exposure system so that the brightness of the original image after exposure processing can reach the set brightness value.

[0088] Optionally, in the embodiment of the present application, the above-mentioned image sensor can be any one of the following: a complementary metal oxide semiconductor (CMOS) image sensor or a charge coupled device (CCD) image sensor.

[0089] Optionally, in the embodiment of the present application, the above-mentioned exposure system can be any one of the following: a fully automatic exposure system, a manual exposure system or a semi-automatic exposure system.

[0090] Optionally, in an embodiment of the present application, the electronic device may determine different brightness values ​​according to image content in the first video frame.

[0091] In one example, when the electronic device detects that the image content in the first video frame does not include a shooting foreground, the electronic device can control the exposure system to adjust the exposure time and exposure gain so that the brightness value of the first video frame that does not include the shooting foreground reaches a set brightness value of 50, thereby obtaining the brightness value of 50 for the first video frame.

[0092] In another example, when the electronic device detects that the image content in the first video frame includes a shooting foreground and a shooting background, the electronic device can control the exposure system to adjust the exposure time and exposure gain so that the brightness value of the first video frame including the shooting foreground and the shooting background reaches a set brightness value of 60, thereby obtaining the brightness value of 60 of the first video frame.

[0093] Optionally, in an embodiment of the present application, the electronic device may detect whether the original image contains a photographed foreground through a first algorithm.

[0094] Exemplarily, the first algorithm may be an artificial intelligence (AI) algorithm or a network neural algorithm.

[0095] In an embodiment of the present application, the electronic device can obtain the brightness value of the first video frame during the shooting process, so that when it is detected that the brightness difference between the captured first video frame and the second video frame is greater than or equal to the first preset threshold, the electronic device can adjust the brightness of the first image area in the first video frame during the shooting process.

[0096] Step 203c: The electronic device adjusts the brightness of the first image area to a first brightness value through a tone system in the electronic device.

[0097] In the embodiment of the present application, the above-mentioned tone system may include the above-mentioned tone processing module.

[0098] In an embodiment of the present application, the electronic device can input the brightness value of the first video frame and the brightness value of the second video frame into the tone system, and then the tone system can determine a target brightness difference value. Then, the tone system can determine the first brightness value based on the brightness value of the first video frame and the target brightness difference value, and finally adjust the brightness of the first image area in the first video frame to the first brightness value.

[0099] Optionally, in an embodiment of the present application, the electronic device may adjust the brightness of the first image area in the first video frame in real time through the tone system; or, the electronic device may batch adjust the brightness of the first image area in the first video frame through the tone system.

[0100] Exemplarily, each time the electronic device acquires a first video frame, the electronic device may adjust the brightness of the first image area in the first video frame once through the tone system; or, after the electronic device captures the video, the electronic device may determine multiple first video frames from the video, and then batch adjust the brightness of the first image area in the first video frames through the tone system.

[0101] It should be noted that the specific implementation process can be found in the following embodiments, and will not be described again here to avoid repetition.

[0102] In an embodiment of the present application, during the process of shooting a video, the electronic device can adjust the brightness value of the first image area in the first video frame through the tone system, thereby ensuring that the video shot by the electronic device can eliminate the phenomenon of sudden brightness changes in the image brightness of the shooting background, thereby improving the stability of the image brightness of the shooting background in the video.

[0103] Optionally, in an embodiment of the present application, the first video frame is obtained from a first video in an electronic device; the first video includes a first video frame sequence; the first video frame sequence includes a first video frame; the video frames in the first video frame sequence are all video frames with a shooting foreground, and the second video frame is a video frame without a shooting foreground before the first video frame sequence; or, the video frames in the first video frame sequence are all video frames without a shooting foreground, and the second video frame is a video frame with a shooting scene before the first video frame sequence. Based on this, before the above step 203, the brightness adjustment method provided in the embodiment of the present application also includes the following steps 401 and 402, and the above step 203 can be specifically implemented by the following step 501.

[0104] Step 401: The electronic device obtains a first mask image of a foreground shot in each video frame in a first video frame sequence based on a second video frame.

[0105] In an embodiment of the present application, the electronic device can generate a first mask image of the foreground captured in each video frame in the first video frame sequence based on the image content in each video frame in the first video frame sequence and the image content in the second video frame.

[0106] It should be noted that the above mask is used for image operations that partially or completely hide part of an object or element. The first mask image is an image that hides the shooting background in a video frame.

[0107] Exemplarily, the electronic device may generate a first mask image of the foreground captured in each video frame in the first video frame sequence based on image content in which a similarity between image content in each video frame in the first video frame sequence and image content in the second video frame is greater than a second preset threshold.

[0108] Exemplarily, the electronic device may mark the image area corresponding to the image content in the image content of each video frame in the first video frame sequence whose similarity with the image content in the second video frame is greater than a second preset threshold as 1, and mark the image area corresponding to other image content of each video frame in the first video frame sequence as 0, so as to obtain a first mask image of the foreground captured in each video frame in the first video frame sequence.

[0109] Optionally, in an embodiment of the present application, the electronic device may segment and identify an image area corresponding to image content in which the similarity between image content in each video frame in the first video frame sequence and image content in the second video frame is greater than a second preset threshold to generate a first mask image.

[0110] Optionally, in an embodiment of the present application, after obtaining the first video, the electronic device may use the video frame of the foreground entering the shooting screen as the starting frame and the video frame of the foreground leaving the shooting screen as the ending frame to obtain a first video frame sequence.

[0111] For example, taking the first video containing 6 video frames as an example, if the first 3 video frames of the 6 video frames include the shooting foreground and the shooting background, the first video frame of the 6 video frames is used as the starting frame, and the third video frame of the 6 video frames is used as the ending frame to obtain a first video frame sequence.

[0112] Optionally, in an embodiment of the present application, after obtaining the first video, the electronic device can use the video frame in which the shooting background enters the shooting screen as the starting frame and the video frame before the shooting foreground enters the shooting screen as the ending frame to obtain a second video frame sequence.

[0113] Step 402: The electronic device determines a first image region of each video frame in the first video frame sequence based on a first mask image corresponding to each video frame in the first video frame sequence.

[0114] In an embodiment of the present application, the electronic device may determine the image area marked as 1 in the first mask image corresponding to each video frame in the first video frame sequence as the first image area of ​​each video frame in the first video frame sequence.

[0115] Step 501: The electronic device adjusts a first image area of ​​each video frame in a first video frame sequence to a first brightness value.

[0116] Optionally, in an embodiment of the present application, the electronic device may simultaneously adjust the first image area of ​​each video frame in the first video frame sequence to a first brightness value.

[0117] Optionally, in an embodiment of the present application, the electronic device may sequentially adjust the first image area of ​​each video frame in the first video frame sequence to a first brightness value.

[0118] In the embodiment of the present application, the electronic device can process the brightness of the first image area in batches, thereby improving the efficiency of the electronic device in adjusting the brightness of the first image area.

[0119] Optionally, in the embodiment of the present application, combined with Figure 1 ,like Figure 6 As shown, the above step 203 can be specifically implemented through the following steps 203a and 203b.

[0120] Step 203a: The electronic device determines a first brightness value based on the brightness value of the first video frame and the target brightness difference value.

[0121] In the embodiment of the present application, the target brightness difference value is used to represent the brightness difference between the first video frame and the second video frame.

[0122] In the embodiment of the present application, the electronic device can determine the first brightness value according to the product of the brightness value of the first video frame and the target brightness difference value.

[0123] Optionally, in the embodiment of the present application, the above-mentioned target brightness difference value includes: a first value or a second value.

[0124] Optionally, in an embodiment of the present application, the above target brightness difference value is preset.

[0125] Exemplarily, the first value is a ratio between a first preset brightness value and a second preset brightness value.

[0126] Exemplarily, the second value is a ratio between the second preset brightness value and the first preset brightness value.

[0127] Exemplarily, the first preset brightness value is: a preset brightness value set for the first video frame.

[0128] Exemplarily, the second preset brightness value is: a preset brightness value set for the second video frame.

[0129] For example, when shooting a video, the electronic device can perform different exposure processing for the shooting foreground and shooting background. For example, when the shooting picture collected by the electronic device only contains the shooting background, the exposure is adjusted so that the brightness of the video frame corresponding to the shooting picture is 50, that is, when the first video frame contains the shooting foreground, the brightness value of the first video frame is 50; when the shooting picture collected by the electronic device contains the shooting background and the shooting foreground, the exposure is adjusted so that the brightness of the video frame corresponding to the shooting picture is 60, that is, when the first video frame contains the shooting background and the shooting foreground, its brightness value is 60.

[0130] For example, assuming that the first preset brightness value is 60 and the second preset brightness value is 50, the first value is 1.2 and the second value is 0.83.

[0131] Optionally, in an embodiment of the present application, the target brightness difference value is calculated by the electronic device based on the brightness value of the first video frame and the brightness value of the second video frame.

[0132] Exemplarily, the first value is a ratio between a brightness value of the first video frame and a brightness value of the second video frame.

[0133] Exemplarily, the second value is a ratio between a brightness value of the second video frame and a brightness value of the first video frame.

[0134] Optionally, in an embodiment of the present application, when the brightness value of the first video frame is greater than the brightness value of the second video frame, the target brightness difference value is a first value.

[0135] Exemplarily, in the case where the brightness value of the first video frame is greater than the brightness value of the second video frame, the electronic device may use the first value to calculate the first brightness value.

[0136] For example, after obtaining the brightness value 60 corresponding to the first video frame and the brightness value 50 corresponding to the second video frame, the electronic device uses 1.2 to calculate the first brightness value.

[0137] Optionally, in an embodiment of the present application, when the brightness value of the first video frame is less than the brightness value of the second video frame, the target brightness difference value is a second value.

[0138] Exemplarily, when the brightness value of the first video frame is less than the brightness value of the second video frame, the electronic device may use the second value to calculate the first brightness value.

[0139] For example, after obtaining the brightness value 50 corresponding to the first video frame and the brightness value 60 corresponding to the second video frame, the electronic device uses 0.83 to calculate the first brightness value.

[0140] Optionally, in an embodiment of the present application, when the brightness value of the first video frame is greater than the brightness value of the second video frame, the electronic device may obtain the first brightness value based on the product of the brightness value of the first video frame and the first value.

[0141] Exemplarily, when the brightness value 60 of the first video frame is greater than the brightness value 50 of the second video frame, the electronic device may multiply the brightness value 60 of the first video frame by 0.83 to obtain a first brightness value of 49.8.

[0142] Optionally, in an embodiment of the present application, when the brightness value of the first video frame is less than the brightness value of the second video frame, the electronic device may obtain the first brightness value based on the product of the brightness value of the first video frame and the second value.

[0143] Exemplarily, when the brightness value 50 of the first video frame is less than the brightness value 60 of the second video frame, the electronic device may multiply the brightness value 50 of the first video frame by 1.2 to obtain the first brightness value 60.

[0144] Optionally, in an embodiment of the present application, when the first brightness value calculated by the electronic device is a floating point type, the electronic device may round up to obtain an integer. For example, assuming that the first brightness value calculated by the electronic device is 49.8, the electronic device rounds up 49.8 to obtain 50 as the final first brightness value.

[0145] Step 203b: The electronic device adjusts the brightness of the first image area to a first brightness value.

[0146] It should be noted that the specific adjustment process can be found in the above embodiment, and will not be described again here to avoid repetition.

[0147] Optionally, in the embodiment of the present application, the above-mentioned target brightness difference value includes: a first value or a second value.

[0148] Exemplarily, when the brightness value of the first video frame is greater than the brightness value of the second video frame, the target brightness difference value is a first value; or, when the brightness value of the first video frame is less than the brightness value of the second video frame, the target brightness difference value is a second value.

[0149] In the embodiment of the present application, the electronic device can determine different target brightness difference values ​​according to different conditions, thereby obtaining different first brightness values, thereby improving the flexibility of the electronic device in determining the first brightness value.

[0150] By way of example, the brightness adjustment method provided in the embodiment of the present application is specifically explained below through a specific example, which can be implemented through the following steps 20 to 22.

[0151] Step 20: Display the shooting preview interface.

[0152] In the present application embodiment, Fig. 7A As shown or Figure 7B As shown in the figure, in the photo preview interface, users can view the content of the picture in real time. The picture is either with a face or without a face. Brightness changes mainly occur in two situations. One is when someone enters the picture, the background brightness suddenly changes. The other is when there is someone in the picture and the person walks out of the picture, the background brightness suddenly changes.

[0153] It should be noted that the camera brightness-related processing modules on current electronic devices are generally divided into exposure systems and tone systems, such as Figure 8 As shown. According to the actual usage scenario, in the backlight scene, the brightness value is generally set to 50 in the unmanned scene, recorded as T=50; the brightness value is set to 60 in the manned scene, recorded as T=60. The exposure system receives the original image sent by the image sensor, that is, the raw image, and adjusts the exposure time and exposure gain to make the brightness of the raw image output by the image sensor reach the set brightness value. The tone module processes the image brightness to obtain the final image brightness effect, so the background will have a sudden brightness change.

[0154] Exemplarily, the exposure system is used to determine the brightness value of the video frame captured by the image sensor; the tone system is used to adjust the brightness value of the first image area of ​​the first video frame in the video frame captured by the image sensor.

[0155] Step 21, the electronic device detects that a person appears in the shooting picture at the beginning, and the person leaves the shooting picture in the next frame.

[0156] In the embodiment of the present application, at this time, the raw brightness of the portrait is T=60, and the raw brightness of the non-portrait is T=50. When the portrait leaves the screen, the raw brightness drops from 60 to 50. In order to achieve overall screen brightness stability, Fig. 9 As shown, the unmanned down-shading system requires that the brightness ratio of the first image area in the shooting picture without a person be adjusted to 120% of the unmanned image, maintaining the brightness consistency of the same area of ​​the picture in both, thereby achieving brightness stability of the picture content from having people to having no people.

[0157] Step 22: The electronic device detects that there is no one in the shooting picture at the beginning, and a person enters the shooting picture in the next frame.

[0158] At this time, the raw brightness of the non-human figure is T=50, and the raw brightness of the human figure is Thuman=60. When the human figure enters the picture, the raw brightness increases from 50 to 60. Fig.10 As shown in the figure, for the same area without a portrait and with a portrait, that is, the mask, the tone processing module adjusts the brightness to 83.33% of the portrait; and for the portrait part, the tone processing intensity is processed according to the portrait setting. By processing the mask and the portrait part separately, the brightness stability from the portrait to the portrait is achieved and the best portrait effect is maintained.

[0159] The above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0160] It should be noted that the brightness adjustment method provided in the embodiment of the present application can be performed by a brightness adjustment device, or an electronic device, or can also be a functional module or entity in an electronic device. In the embodiment of the present application, the brightness adjustment device provided in the embodiment of the present application is described by taking the brightness adjustment method performed by the brightness adjustment device as an example.

[0161] Fig.11 FIG. 1 shows a possible structural diagram of a brightness adjustment device involved in an embodiment of the present application. Fig.11 As shown, the brightness adjustment device 70 may include: an acquisition module 71 , a determination module 72 and an adjustment module 73 .

[0162] The acquisition module 71 is used to acquire the brightness value of the first video frame acquired. The determination module 72 is used to determine the first image area in the first video frame when the difference between the brightness value of the first video frame acquired by the acquisition module 71 and the brightness value of the second video frame is greater than or equal to the first threshold value. The first image area is an image area whose image content matches that of the first video frame and the second video frame. The adjustment module 73 is used to adjust the brightness of the first image area determined by the determination module 72 to a first brightness value, and the first brightness value is a brightness value that matches the brightness value of the second video frame; wherein the second video frame is a video frame acquired before the first video frame.

[0163] In a possible implementation, the determination module 72 is specifically used to determine the first brightness value based on the brightness value of the first video frame and the target brightness difference value, and the target brightness difference value is used to characterize the brightness difference between the first video frame and the second video frame. The adjustment module 73 is specifically used to adjust the brightness of the first image area to the first brightness value; wherein the target brightness ratio value includes: a first value or a second value; when the brightness value of the first video frame is greater than the brightness value of the second video frame, the target brightness difference value is the first value; or, when the brightness value of the first video frame is less than the brightness value of the second video frame, the target brightness difference value is the second value.

[0164] In one possible implementation, the first video frame is a video frame with a shooting foreground, and the second video frame is a video frame captured before the first video frame and without a shooting foreground; or, the first video frame is a video frame with no shooting foreground, and the second video frame is a video frame captured before the first video frame and with a shooting foreground.

[0165] In a possible implementation, the acquisition module 71 is specifically used to acquire the image content in the first video frame and the image content in the second video frame. The determination module 72 is specifically used to determine that the image content of the first video frame and the image content of the second video frame, whose similarity is greater than or equal to the second threshold, is the first image content; and determine the image area corresponding to the first image content in the first video frame as the first image area.

[0166] In a possible implementation, the first video frame is captured by an electronic device; the acquisition module 71 is specifically configured to acquire a brightness value of the first video frame through an exposure system in the electronic device; and the adjustment module 73 is specifically configured to adjust the brightness of the first image area to a first brightness value through a tone system in the electronic device.

[0167] In a possible implementation, the first video frame is obtained from a first video in an electronic device; the first video includes a first video frame sequence; the first video frame sequence includes a first video frame; the video frames in the first video frame sequence are all video frames with a shooting foreground, and the second video frame is a video frame with no shooting foreground before the first video frame sequence; or, the video frames in the first video frame sequence are all video frames with no shooting foreground, and the second video frame is a video frame with a shooting scene before the first video frame sequence. The acquisition module 71 is also used to obtain a first mask image of the shooting foreground in each video frame in the first video frame sequence based on the second video frame before the adjustment module 73 adjusts the brightness of the first image area to the first brightness value. The determination module 72 is also used to determine the first image area of ​​each video frame based on the first mask image corresponding to each video frame obtained by the acquisition module. The adjustment module 73 is specifically used to adjust the first image area of ​​each video frame to the first brightness value.

[0168] An embodiment of the present application provides a brightness adjustment device. When it is detected that the brightness difference between a captured first video frame and a second video frame is greater than or equal to a first preset threshold, that is, when a sudden brightness change occurs between the first video frame and the second video frame, the present application uses a first brightness value to make the brightness of a first image area in the first video frame approach the brightness of the second video frame, thereby ensuring that the brightness between the second video frame and the first image area in the first video frame can transition smoothly. In this way, the brightness adjustment device can eliminate the phenomenon of sudden brightness change in the image brightness of the captured background.

[0169] The brightness adjustment device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0170] The brightness adjustment device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0171] The brightness adjustment device provided in the embodiment of the present application can implement each process implemented in the above embodiment, and will not be described again here to avoid repetition.

[0172] Alternatively, if Fig.12 As shown, an embodiment of the present application further provides an electronic device 90, including a processor 91 and a memory 92, wherein the memory 92 stores programs or instructions that can be executed on the processor 91, and when the program or instructions are executed by the processor 91, the various steps of the above-mentioned brightness adjustment method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0173] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0174] Fig.13 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0175] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0176] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.13 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0177] Among them, the processor 110 is used to obtain the brightness value of the captured first video frame; when the difference between the brightness value of the first video frame and the brightness value of the second video frame is greater than or equal to the first threshold, determine the first image area in the first video frame, the first image area is an image area whose image content matches that of the first video frame and the second video frame; adjust the brightness of the first image area to a first brightness value, the first brightness value is a brightness value that matches the brightness value of the second video frame; wherein the second video frame is a video frame captured before the first video frame.

[0178] An embodiment of the present application provides an electronic device. When it is detected that the brightness difference between a captured first video frame and a second video frame is greater than or equal to a first preset threshold, that is, when a sudden brightness change occurs between the first video frame and the second video frame, the present application uses a first brightness value to make the brightness of a first image area in the first video frame approach the brightness of the second video frame, thereby ensuring that the brightness between the second video frame and the first image area in the first video frame can transition smoothly. In this way, the electronic device can eliminate the phenomenon of sudden brightness change in the image brightness of the captured background.

[0179] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to determine a first brightness value based on the brightness value of the first video frame and a target brightness difference value, wherein the target brightness difference value is used to characterize the brightness difference between the first video frame and the second video frame; adjust the brightness of the first image area to the first brightness value; wherein the target brightness ratio value includes: a first value or a second value; when the brightness value of the first video frame is greater than the brightness value of the second video frame, the target brightness difference value is the first value; or, when the brightness value of the first video frame is less than the brightness value of the second video frame, the target brightness difference value is the second value.

[0180] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to obtain image content in a first video frame and image content in a second video frame; determine that image content whose similarity between the image content of the first video frame and the image content of the second video frame is greater than or equal to a second threshold is the first image content; and determine the image area corresponding to the first image content in the first video frame as the first image area.

[0181] Optionally, in an embodiment of the present application, the first video frame is captured by an electronic device; the processor 110 is specifically used to obtain a brightness value of the first video frame through an exposure system in the electronic device; and adjust the brightness of the first image area to a first brightness value through a tone system in the electronic device.

[0182] Optionally, in an embodiment of the present application, the first video frame is obtained from a first video in an electronic device; the first video includes a first video frame sequence; the first video frame sequence includes a first video frame; the video frames in the first video frame sequence are all video frames with a shooting foreground, and the second video frame is a video frame without a shooting foreground before the first video frame sequence; or, the video frames in the first video frame sequence are all video frames without a shooting foreground, and the second video frame is a video frame with a shooting scene before the first video frame sequence; the processor 110 is also used to obtain a first mask image of the shooting foreground in each video frame in the first video frame sequence based on the second video frame before adjusting the brightness of the first image area to the first brightness value; and determine the first image area of ​​each video frame based on the first mask image corresponding to each video frame. The processor 110 is specifically used to adjust the first image area of ​​each video frame to the first brightness value.

[0183] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0184] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described again here.

[0185] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0186] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0187] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0188] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0189] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0190] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0191] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0192] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned brightness adjustment method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0193] It should be noted that, in this article, the term "comprises", "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0194] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0195] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A brightness adjustment method, characterized in that: The method comprises: Obtain the brightness value of the first video frame collected; When a difference between a brightness value of the first video frame and a brightness value of the second video frame is greater than or equal to a first threshold, determining a first image region in the first video frame, the first image region being an image region where image contents in the first video frame and the second video frame match; Adjusting the brightness of the first image area to a first brightness value, where the first brightness value is a brightness value that matches the brightness value of the second video frame; The second video frame is a video frame captured before the first video frame.

2. The method according to claim 1, characterized in that The step of adjusting the brightness of the first image area to a first brightness value includes: Determine the first brightness value based on the brightness value of the first video frame and a target brightness difference value, wherein the target brightness difference value is used to represent the brightness difference between the first video frame and the second video frame; adjusting the brightness of the first image area to the first brightness value; Wherein, the target brightness difference value includes: a first value or a second value; In the case where the brightness value of the first video frame is greater than the brightness value of the second video frame, the target brightness difference value is the first value; or, In a case where the brightness value of the first video frame is less than the brightness value of the second video frame, the target brightness difference value is the second value.

3. The method according to claim 1 or 2, characterized in that: The first video frame is a video frame with a shooting foreground, and the second video frame is a video frame captured before the first video frame and without a shooting foreground; or, The first video frame is a video frame without a shooting foreground, and the second video frame is a video frame captured before the first video frame and with a shooting foreground.

4. The method according to claim 1, characterized in that: The determining a first image area in the first video frame includes: Acquire image content in the first video frame and image content in the second video frame; Determine that image content whose similarity between the image content of the first video frame and the image content of the second video frame is greater than or equal to a second threshold is first image content; An image region corresponding to the first image content in the first video frame is determined as the first image region.

5. The method according to claim 1 or 2, characterized in that: The first video frame is captured by the electronic device; The step of obtaining the brightness value of the first video frame includes: Acquiring a brightness value of the first video frame through an exposure system in the electronic device; The step of adjusting the brightness of the first image area to a first brightness value includes: The brightness of the first image area is adjusted to the first brightness value through the tone system in the electronic device.

6. The method according to claim 1 or 2, characterized in that: The first video frame is obtained from a first video in the electronic device; The first video includes a first video frame sequence; the first video frame sequence includes the first video frame; The video frames in the first video frame sequence are all video frames with a shooting foreground, and the second video frame is a video frame before the first video frame sequence that does not have a shooting foreground; or, The video frames in the first video frame sequence are all video frames without a shooting foreground, and the second video frames are video frames with a shooting scene before the first video frame sequence; Before adjusting the brightness of the first image area to a first brightness value, the method further includes: Based on the second video frame, obtaining a first mask image of a foreground captured in each video frame in the first video frame sequence; Determine a first image region of each video frame based on a first mask image corresponding to each video frame; The step of adjusting the brightness of the first image area to a first brightness value includes: The brightness of the first image area of ​​each video frame in the first video sequence is adjusted to the first brightness value.

7. A brightness adjustment device, characterized in that: The device comprises: an acquisition module, a determination module and an adjustment module; The acquisition module is used to acquire the brightness value of the collected first video frame; The determining module is configured to determine a first image region in the first video frame when a difference between a brightness value of the first video frame acquired by the acquiring module and a brightness value of the second video frame is greater than or equal to a first threshold, the first image region being an image region where image contents in the first video frame and the second video frame match; The adjustment module is used to adjust the brightness of the first image area determined by the determination module to a first brightness value, where the first brightness value is a brightness value matching the brightness value of the second video frame; The second video frame is a video frame captured before the first video frame.

8. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the brightness adjustment method as claimed in any one of claims 1 to 6.

9. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the brightness adjustment method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product is stored in a storage medium, and the program product is executed by at least one processor to implement the brightness adjustment method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for restoring brightness change of video sequence and video processing equipment

    CN101651786A

  • Shooting method and equipment

    CN105635565A

  • Video Signal Control Apparatus and Video Signal Control Method

    US20090322796A1