Image brightness adjustment method, device, electronic device and storage medium

By performing object recognition processing on the image, dividing it into foreground and background areas, and adjusting the brightness separately, the brightness distortion or overexposure caused by global brightness adjustment is solved, and the visual effect of the image is improved.

CN119784662APending Publication Date: 2025-04-08BEIJING IQIYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411872441.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, when processing an image containing a subject such as a person, the global brightness adjustment method may cause some parts of the image to be distorted or overexposed.

Method used

By performing object recognition processing on the image to be processed, the image is divided into the foreground pending area and the background pending area, and its brightness adjustment values ​​are determined separately to perform differentiated brightness adjustments.

Benefits of technology

Differentiated processing of brightness requirements in different areas of the image is achieved, which avoids brightness distortion or overexposed caused by global adjustments, and improves the visual effect of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784662A_ABST
    Figure CN119784662A_ABST
Patent Text Reader

Abstract

The present application provides an image brightness adjustment method, device, electronic device and storage medium, including: obtaining an image to be processed; performing target recognition processing on the image to be processed, dividing the image to be processed into a foreground area to be processed and a background area to be processed; respectively determining the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed, and adjusting the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment values ​​to obtain a foreground processed area and a background processed area; fusing the foreground processed area and the background processed area to obtain an output image. In this way, the brightness adjustment of the image to be processed takes into account the different brightness requirements of different areas in the image, and can avoid the shortcomings of global adjustment to improve the visual effect of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image brightness adjustment method, device, electronic device and storage medium. Background Art

[0002] In the field of image processing, the brightness of an image plays a vital role in visual effects. The brightness of an image refers to how bright the image is, that is, how bright or dim the color is. Due to shooting conditions and equipment limitations, in some cases, the image may have insufficient or excessive brightness, so the brightness of the image needs to be adjusted.

[0003] In the prior art, most brightness adjustment methods adopt global adjustment. However, when the image contains subjects such as people, the brightness requirements of the subject and the background are usually different. Therefore, global adjustment may cause brightness distortion or overexposure of certain parts of the image. Summary of the invention

[0004] To solve the above technical problems, the present application discloses an image brightness adjustment method, device, electronic device and storage medium, so as to at least solve the problem in the related art that the global brightness adjustment causes brightness distortion or overexposure of some parts in the image. The technical solution disclosed in the present application is as follows:

[0005] In a first aspect, the present application provides a method for adjusting image brightness, the method comprising:

[0006] Get the image to be processed;

[0007] Performing target recognition processing on the image to be processed, dividing the image to be processed into a foreground area to be processed and a background area to be processed;

[0008] Determine the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed respectively, and adjust the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment values ​​to obtain a foreground processed area and a background processed area;

[0009] The foreground processed area and the background processed area are fused to obtain an output image.

[0010] Optionally, the step of respectively determining brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed includes:

[0011] Determine a first brightness adjustment value corresponding to the foreground area to be processed;

[0012] Based on the first brightness adjustment value, a second brightness adjustment value corresponding to the background area to be processed is determined, and the second brightness adjustment value is smaller than the first brightness adjustment value.

[0013] Optionally, after obtaining the image to be processed, the method further includes:

[0014] Calculating the average brightness value of the image to be processed;

[0015] When the average brightness value meets a preset condition, the step of performing target recognition processing on the image to be processed is performed.

[0016] Optionally, when the preset condition is that the average brightness value is lower than a first threshold, adjusting the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment value to obtain a foreground processed area and a background processed area includes:

[0017] According to the corresponding brightness adjustment value, the brightness of the foreground area to be processed and the background area to be processed is enhanced to obtain a foreground processed area and a background processed area.

[0018] Optionally, when the preset condition is that the average brightness value is higher than a second threshold, adjusting the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment value to obtain a foreground processed area and a background processed area includes:

[0019] According to the corresponding brightness adjustment value, the brightness of the foreground area to be processed and the background area to be processed is reduced to obtain a foreground processed area and a background processed area.

[0020] Optionally, performing target recognition processing on the image to be processed to divide the image to be processed into a foreground area to be processed and a background area to be processed includes:

[0021] Performing target recognition processing on the image to be processed to recognize at least one human body in the image to be processed;

[0022] A human body integrity detection is performed on the human body, a target human body is determined based on the detection result, an area where the target human body is located is used as a foreground area to be processed, and other areas except the foreground area to be processed are used as background areas to be processed, and the image to be processed is segmented.

[0023] Optionally, fusing the foreground processed area and the background processed area to obtain an output image includes:

[0024] Performing color matching on the foreground processed area and the background processed area to obtain a foreground output area and a background output area;

[0025] The foreground output area and the background output area are fused to obtain an output image.

[0026] Optionally, performing color matching on the foreground processed area and the background processed area to obtain a foreground output area and a background output area includes:

[0027] Extracting color features of the foreground processed area and the background processed area respectively to obtain foreground features and background features;

[0028] determining a first color difference between the foreground feature and the background feature;

[0029] Based on the first color difference, color adjustment is performed on the foreground processed area and / or the background processed area to obtain a foreground output area and a background output area; the second color difference corresponding to the foreground output area and the background output area is less than the first color difference.

[0030] In a second aspect, an embodiment of the present invention provides an image brightness adjustment device, comprising:

[0031] An acquisition module, used for acquiring an image to be processed;

[0032] The recognition module is used to perform target recognition processing on the image to be processed, and divide the image to be processed into a foreground area to be processed and a background area to be processed;

[0033] An adjustment module, used to respectively determine the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed, and adjust the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment values ​​to obtain a foreground processed area and a background processed area;

[0034] The fusion module is used to fuse the foreground processed area and the background processed area to obtain an output image.

[0035] In a third aspect, an embodiment of the present invention provides an electronic device, including:

[0036] processor;

[0037] a memory for storing instructions executable by the processor;

[0038] The processor is configured to execute the instructions to implement any of the above-mentioned methods for adjusting image brightness.

[0039] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor of an image brightness adjustment electronic device, the image brightness adjustment electronic device can perform any of the above-mentioned image brightness adjustment methods.

[0040] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which implements any of the above-mentioned image brightness adjustment methods when executed by a processor.

[0041] Compared with the prior art, this application has the following advantages:

[0042] Acquire an image to be processed; perform target recognition processing on the image to be processed, and divide the image to be processed into a foreground area to be processed and a background area to be processed; respectively determine the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed, and adjust the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment values ​​to obtain a foreground processed area and a background processed area; fuse the foreground processed area and the background processed area to obtain an output image.

[0043] In this way, through target recognition processing of the image to be processed, the image to be processed is divided into a foreground area to be processed and a background area to be processed, so as to separate the target object and the background in the image to be processed. Then, according to the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed respectively, the brightness of the foreground area to be processed and the background area to be processed can be adjusted differently. Therefore, the brightness adjustment of the image to be processed takes into account the different brightness requirements of different areas in the image, and can avoid the shortcomings of global adjustment to enhance the visual effect of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flowchart of the steps of an image brightness adjustment method of the present application;

[0045] Figure 2 It is a logic schematic diagram of an image brightness adjustment method of the present application;

[0046] Figure 3 It is a structural block diagram of an image brightness adjustment device of the present application;

[0047] Figure 4 is a schematic diagram of an electronic device of the present application;

[0048] Figure 5 It is a block diagram of a device for adjusting image brightness of the present application. DETAILED DESCRIPTION

[0049] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0051] The present application can be applied to a server or a terminal, and the server can be a local server, other servers in the network, etc. The above-mentioned terminal can be a terminal device in various forms such as a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, etc., and the embodiments of the present application are not limited to this.

[0052] The above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.

[0053] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to realize data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.

[0054] In some embodiments, the above-mentioned server can also be implemented as a node in a blockchain system. Blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0055] In this step, you first need to obtain configuration information through a preset configuration page, where the configuration information is used to indicate the resources provided by the target platform, for example, it may include but is not limited to the resource type, acquisition rules and platform information of the target platform, such as IP (Internet Protocol) address, gateway, DNS (Domain Name Server), etc., without specific limitation.

[0056] Reference Figure 1 , shows a flowchart of a method for adjusting image brightness of the present application, which may specifically include the following steps:

[0057] In step S11, an image to be processed is obtained.

[0058] In the field of image processing, most brightness adjustment methods adopt global adjustment. However, when an image contains certain target objects as the subject, the brightness requirements of the subject and the background are usually different, resulting in brightness distortion or overexposure of some parts of the image after brightness adjustment.

[0059] Based on this, the present application proposes an image brightness adjustment method to solve the above problem.

[0060] In this step, it is first necessary to obtain the image to be processed, where the image to be processed is the image that needs to be adjusted in brightness. It can be obtained from the network or any local device, and different image formats can be used according to different application scenarios and requirements. After obtaining the image to be processed, some preprocessing steps can also be performed on the image to be processed in order to better adapt to subsequent processing requirements. This application does not limit this.

[0061] In step S12, target recognition processing is performed on the image to be processed, and the image to be processed is divided into a foreground area to be processed and a background area to be processed.

[0062] In this step, the image to be processed is segmented based on the target recognition processing technology. Among them, the target recognition processing is used to identify a specific foreground area to be processed from the image to be processed. The foreground area to be processed is usually the main body of the image to be processed. For example, the foreground area to be processed can be a face area, or it can be an area where animals, vehicles or other objects are located. The segmentation of the image to be processed can rely on U2-Net (U-square Net, U square network) open source solution, deep learning network, target detection framework, etc., without specific limitation.

[0063] Specifically, first, by analyzing the pixel information, color, texture, shape and other features of the image to be processed, target recognition is performed on the image to be processed, and at least one target object that matches the predefined target or category is identified. These target objects can be categories that have been learned by the pre-trained model, or they can be customized specific objects or patterns, without specific limitation.

[0064] After identifying the target objects, the areas where these target objects are located can be determined and used as foreground areas to be processed. In addition to the foreground areas to be processed, other areas in the image to be processed are regarded as background areas to be processed. The background areas to be processed may contain natural scenery, buildings or other objects that are not related to the target objects.

[0065] Furthermore, the image to be processed may be segmented to divide the image to be processed into a foreground area to be processed and a background area to be processed, so as to distinguish the boundary and relationship between the subject and the background of the image to be processed.

[0066] In one implementation, target recognition processing is performed on the image to be processed, and the image to be processed is divided into a foreground area to be processed and a background area to be processed, including:

[0067] Performing target recognition processing on the image to be processed, identifying at least one human body in the image to be processed;

[0068] Perform human body integrity detection on the human body, determine the target human body based on the detection results, take the area where the target human body is located as the foreground area to be processed, take the other areas except the foreground area to be processed as the background area to be processed, and segment the image to be processed.

[0069] That is to say, in this embodiment, the target object in the defined image to be processed is a human body. In this case, the detected human body can be further subjected to human body integrity detection. Human body integrity detection refers to analyzing and processing the human body image to determine whether the human body is missing, abnormal or damaged, so as to ensure that the detected human body is complete and not truncated or blocked.

[0070] Furthermore, based on the results of the human body integrity assessment, one or more of the most complete and most confident human bodies can be selected as target human bodies, thereby enabling accurate processing and analysis of the images to be processed, providing a solid foundation for subsequent image processing tasks.

[0071] In step S13, the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed are determined respectively, and the brightness of the foreground area to be processed and the background area to be processed are adjusted according to the corresponding brightness adjustment values ​​to obtain the foreground processed area and the background processed area.

[0072] In this step, it is necessary to first determine the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed, respectively. The brightness adjustment value refers to a numerical parameter used to change the brightness of the image. Then, based on the brightness adjustment values ​​corresponding to different areas, the brightness of the foreground area to be processed and the background area to be processed are adjusted differently to make the image brighter or darker, thereby achieving the purpose of improving the visual effect of the image.

[0073] The brightness adjustment of different areas can be determined based on the original brightness of the different areas, the overall brightness distribution of the image to be processed, and the visual effect expected by the user. For example, if an area is dark, it may be necessary to increase the brightness adjustment value based on the brightness of the original image to increase its brightness; conversely, if an area is too bright, it may be necessary to reduce the brightness adjustment value based on the brightness of the original image to reduce its brightness.

[0074] In this application, brightness adjustment can be achieved through a variety of methods, such as linear transformation, nonlinear transformation (such as logarithmic transformation, exponential transformation, etc.), histogram equalization, etc. The specific method used may depend on the specific image characteristics and the desired visual effect. For example, linear transformation is suitable for simple brightness adjustment tasks; histogram equalization can enhance the contrast of the image, but may cause some details to be lost.

[0075] In one implementation, respectively determining brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed includes:

[0076] Determine a first brightness adjustment value corresponding to the foreground area to be processed;

[0077] Based on the first brightness adjustment value, a second brightness adjustment value corresponding to the background to-be-processed area is determined, and the second brightness adjustment value is smaller than the first brightness adjustment value.

[0078] That is to say, it is first necessary to determine the first brightness adjustment value of the foreground area to be processed, wherein the first brightness adjustment value can be determined by analyzing the brightness of the original image of the foreground area to be processed and the overall brightness distribution of the image to be processed, so as to achieve automatic brightness optimization of the image to be processed, or, in some implementations, it can also be determined based on the user's expected visual effect, without specific limitation.

[0079] Then, the second brightness adjustment value of the background area to be processed can be determined based on the first brightness adjustment value of the foreground area to be processed. In the present application, the second brightness adjustment value is usually set to be smaller than the first brightness adjustment value to maintain the appropriate brightness of the background area to be processed and avoid it being too bright or dim to interfere with the visual effect of the foreground area to be processed.

[0080] For example, a smaller adjustment amplitude or adjustment value may be set, and after determining the first brightness adjustment value, the first brightness adjustment value may be reduced by the adjustment amplitude, or the adjustment value may be directly subtracted from the first brightness adjustment value to obtain the second brightness adjustment value.

[0081] In another implementation, the first brightness adjustment value and the second brightness adjustment value may both be pre-set fixed values, which is not specifically limited in the present application.

[0082] In one implementation, after obtaining the image to be processed, the method further includes:

[0083] Calculate the average brightness value of the image to be processed;

[0084] When the average brightness value meets the preset condition, the step of performing target recognition processing on the image to be processed is executed.

[0085] That is to say, before performing target recognition processing on the image to be processed, the average brightness value of the image to be processed may also be analyzed. The average brightness value is an important indicator that can reflect the overall brightness of the image to be processed.

[0086] Specifically, firstly, the average brightness value of the image to be processed is calculated. Usually, the brightness values ​​of all pixels in the image to be processed are added together and then divided by the total number of pixels. The obtained average value is the average brightness value of the image to be processed.

[0087] Furthermore, when the average brightness value meets the preset conditions, the target recognition processing step is performed to ensure that the image to be processed is an image that needs brightness adjustment, thereby avoiding waste of computing resources.

[0088] The preset condition may be a brightness range or threshold, that is, if the calculated average brightness value falls within this range, then it can be considered that the image to be processed needs brightness adjustment. When the average brightness value is within another range, it can be determined that the brightness of the image to be processed is appropriate and does not need brightness adjustment.

[0089] Correspondingly, in one implementation, when the preset condition is that the average brightness value is lower than the first threshold, the brightness of the foreground area to be processed and the background area to be processed are adjusted according to the corresponding brightness adjustment value to obtain the foreground processed area and the background processed area, including:

[0090] According to the corresponding brightness adjustment value, the brightness of the foreground area to be processed and the background area to be processed is enhanced to obtain the foreground processed area and the background processed area.

[0091] That is, if the average brightness value of the image to be processed is lower than the preset first threshold, it means that the brightness of the image to be processed is low and brightness enhancement processing is required. Therefore, after determining the brightness adjustment values ​​of different areas, the brightness of the foreground area to be processed and the background area to be processed can be enhanced.

[0092] For example, this can be achieved by adding the corresponding brightness adjustment value to the brightness value of each pixel. It should be noted that in order to avoid brightness value overflow (i.e. exceeding the maximum value of the pixel brightness value), the adjusted brightness value may need to be normalized.

[0093] After the brightness enhancement process, a foreground processed area and a background processed area can be obtained. The foreground processed area and the background processed area are improved in brightness and are more in line with the requirements of subsequent processing or display.

[0094] For example, in a video surveillance system, if the camera is not well lit and the captured image is too dark, this method can be used to increase the brightness of the image. A slight brightness adjustment can be made to the background area to ensure that the background brightness reaches an appropriate level without affecting the overall visual effect. A normal brightness adjustment can be made to the foreground area to keep the target object natural and clear.

[0095] In another implementation, when the preset condition is that the average brightness value is higher than the second threshold, the brightness of the foreground area to be processed and the background area to be processed are adjusted according to the corresponding brightness adjustment value to obtain the foreground processed area and the background processed area, including:

[0096] According to the corresponding brightness adjustment value, the brightness of the foreground area to be processed and the background area to be processed is reduced to obtain a foreground processed area and a background processed area.

[0097] Correspondingly, if the average brightness value is higher than the second threshold, it means that the brightness of the image to be processed is high, and brightness reduction processing is required. Therefore, after determining the brightness adjustment values ​​corresponding to different areas, the brightness of the foreground area to be processed and the background area to be processed can be reduced.

[0098] For example, this can be achieved by subtracting the brightness adjustment value from the brightness value of each pixel. It should be noted that in order to avoid the brightness value being too low (ie, lower than the minimum value of the pixel brightness value), the adjusted brightness value may need to be limited.

[0099] After the brightness reduction process, a foreground processed area and a background processed area are obtained, and the brightness of the foreground processed area and the background processed area is improved, which is more in line with the requirements of subsequent processing or display.

[0100] For example, in the field of photography, especially when shooting high-brightness objects (such as sunrises, snow scenes, or reflective objects), photographers often face the problem of too high brightness, which causes the foreground area of ​​the image to be processed to be overexposed, losing details and layers. By reducing the brightness of the image to be processed, the details of the overexposed foreground area can be restored while maintaining the overall balance and beauty of the image to be processed.

[0101] In step S14, the processed foreground area and the processed background area are fused to obtain an output image.

[0102] In this step, the foreground processed area and the background processed area that have undergone brightness adjustment are fused to generate an output image. Compared with the image to be processed, the output image has completed brightness adjustment and has higher image quality.

[0103] Among them, in the image fusion stage, a suitable fusion algorithm can be selected according to the actual application scenario or demand, including but not limited to linear fusion, weighted fusion, Laplace pyramid fusion, etc., without specific limitation.

[0104] In one implementation, fusing the processed foreground region and the processed background region to obtain an output image includes:

[0105] Performing color matching on the foreground processed area and the background processed area to obtain a foreground output area and a background output area;

[0106] The foreground output area and the background output area are fused to obtain the output image.

[0107] That is to say, after obtaining the foreground processed area and the background processed area, the colors in the foreground processed area and the background processed area can be analyzed, and the colors in the foreground processed area and the background processed area can be adjusted to make them more harmonious and unified, so as to achieve overall optimization of the foreground processed area and the background processed area after brightness adjustment.

[0108] For example, the color matching process may include: first, converting the foreground processed area and the background processed area from the original color space to a space that is more suitable for color matching, then analyzing the color histograms of the foreground processed area and the background processed area, and then, based on the analysis results of the color histogram, using a color mapping algorithm to adjust the colors of the foreground processed area and the background processed area to a more matching state, thereby obtaining a foreground output area and background output area with more coordinated colors. The two areas are closer in color, which provides a good foundation for the subsequent fusion steps.

[0109] In one implementation, color matching is performed on a foreground processed area and a background processed area to obtain a foreground output area and a background output area, including:

[0110] Extracting color features of the foreground processed area and the background processed area respectively to obtain foreground features and background features;

[0111] determining a first color difference between the foreground feature and the background feature;

[0112] Based on the first color difference, the color of the foreground processed area and / or the background processed area is adjusted to obtain a foreground output area and a background output area; the second color difference corresponding to the foreground output area and the background output area is smaller than the first color difference.

[0113] That is to say, in the process of color matching, it is first necessary to extract color features from the foreground processed area and the background processed area. Specifically, if the foreground processed area and the background processed area are data in the RGB (Red-Green-Blue) color space, then the foreground processed area and the background processed area can be first converted to a color space that is more suitable for color analysis and processing, such as the HSV (Hue-Saturation-Value) color space; then, the color features of the foreground processed area and the background processed area are extracted in the converted color space. The color features may include color histograms, color moments, mean and variance in the color space, etc.

[0114] After the color features are extracted, the first color difference between the foreground features and the background features can be calculated. The first color difference can be achieved by comparing the distance or similarity between the foreground features and the background features in the color space. The larger the first color difference, the more obvious the color difference between the foreground processed area and the background processed area; the smaller the first color difference, the closer the color between the foreground processed area and the background processed area.

[0115] Furthermore, according to the calculated first color difference, the color of the foreground processed area and / or the background processed area can be adjusted to reduce or eliminate the color difference between the foreground processed area and the background processed area, so that they are closer. The color adjustment method may include color conversion, color mapping, color interpolation, etc., which can be selected and applied according to the specific color difference and adjustment target, and is not specifically limited.

[0116] Specifically, only one of the foreground processed area and the background processed area can be adjusted to make the color of the adjusted area closer to the color of the unadjusted area, while retaining the color characteristics of the unadjusted area as much as possible; or, the colors of the foreground processed area and the background processed area can be adjusted at the same time, especially when the first color difference is large, the colors of the adjusted foreground processed area and the background processed area can be made more coordinated.

[0117] Through color adjustment, a foreground output area and a background output area can be obtained. The second color difference between the foreground output area and the background output area should be smaller than the first color difference before adjustment. Therefore, the output image obtained by the subsequent fusion of the foreground output area and the background output area will appear more natural without producing an abrupt visual effect.

[0118] like Figure 2 FIG. 1 is a logic diagram of an image brightness adjustment method provided in a specific implementation of the present application, wherein the method specifically includes the following steps:

[0119] Get the image to be processed;

[0120] Calculate the average brightness value of the image to be processed to determine the brightness level of the image to be processed;

[0121] If the average brightness value of the image to be processed is lower than a preset first threshold, the image to be processed needs to be brightness enhanced;

[0122] Use the face recognition module to segment the image to be processed, take the face area in the image to be processed as the foreground area to be processed, and take the other part of the image to be processed as the background area to be processed;

[0123] The foreground area to be processed is increased by a first brightness adjustment value, and the background area to be processed is increased by a second brightness adjustment value, to obtain a foreground processed area and a background processed area, respectively, wherein the second brightness adjustment value is less than the first brightness adjustment value, so as to ensure the naturalness and clarity of the human face, and at the same time, the brightness of the background area to be processed reaches an appropriate level without affecting the overall visual effect;

[0124] The processed foreground area and the processed background area are fused to generate an output image, completing the brightness adjustment process of the image to be processed.

[0125] As can be seen from the above, the technical solution provided by the embodiments of the present disclosure, through target recognition processing of the image to be processed, divides the image to be processed into a foreground area to be processed and a background area to be processed, so as to separate the target object and the background in the image to be processed. Then, the brightness of the foreground area to be processed and the background area to be processed can be adjusted differently according to the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed respectively. Therefore, the brightness adjustment of the image to be processed takes into account the different brightness requirements of different areas in the image, and can avoid the shortcomings of global adjustment to enhance the visual effect of the image.

[0126] Reference Figure 3 , shows a schematic diagram of the structure of an image brightness adjustment device of the present application, which may specifically include:

[0127] An acquisition module 201 is used to acquire an image to be processed;

[0128] The recognition module 202 is used to perform target recognition processing on the image to be processed, and divide the image to be processed into a foreground area to be processed and a background area to be processed;

[0129] An adjustment module 203 is used to determine brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed respectively, and adjust the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment values ​​to obtain a foreground processed area and a background processed area;

[0130] The fusion module 204 is used to fuse the foreground processed area and the background processed area to obtain an output image.

[0131] As can be seen from the above, the technical solution provided by the embodiments of the present disclosure, through target recognition processing of the image to be processed, divides the image to be processed into a foreground area to be processed and a background area to be processed, so as to separate the target object and the background in the image to be processed. Then, the brightness of the foreground area to be processed and the background area to be processed can be adjusted differently according to the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed respectively. Therefore, the brightness adjustment of the image to be processed takes into account the different brightness requirements of different areas in the image, and can avoid the shortcomings of global adjustment to enhance the visual effect of the image.

[0132] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0133] Figure 4 The invention is a block diagram of an electronic device for adjusting image brightness according to an exemplary embodiment, which includes a processor and a memory, wherein the memory is used to store computer programs; and the processor is used to execute the programs stored in the memory.

[0134] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0135] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0136] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to perform the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0137] In an exemplary embodiment, a computer program product is also provided. When the computer program product is executed on a computer, the computer implements the above-mentioned method for adjusting the brightness of a comment image.

[0138] As can be seen from the above, the technical solution provided by the embodiment of the embodiment of the present invention, through target recognition processing of the image to be processed, divides the image to be processed into a foreground area to be processed and a background area to be processed, so as to separate the target object and the background in the image to be processed. Then, the brightness of the foreground area to be processed and the background area to be processed can be adjusted differently according to the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed respectively. Therefore, the brightness adjustment of the image to be processed takes into account the different brightness requirements of different areas in the image, and can avoid the shortcomings of global adjustment to enhance the visual effect of the image.

[0139] Figure 5 is a block diagram of a device 800 for adjusting image brightness according to an exemplary embodiment.

[0140] For example, apparatus 800 may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0141] Reference Figure 5 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0142] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0143] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0144] The power supply component 807 provides power to the various components of the device 800. The power supply component 807 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0145] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the account. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the account. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data to be processed. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0146] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0147] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0148] The sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0149] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0150] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the methods described in the first and second aspects.

[0151] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to complete the above method. Optionally, for example, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0152] In an exemplary embodiment, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is enabled to execute the image brightness adjustment method described in any one of the above embodiments.

[0153] As can be seen from the above, the technical solution provided by the embodiment of the embodiment of the present invention, through target recognition processing of the image to be processed, divides the image to be processed into a foreground area to be processed and a background area to be processed, so as to separate the target object and the background in the image to be processed. Then, the brightness of the foreground area to be processed and the background area to be processed can be adjusted differently according to the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed respectively. Therefore, the brightness adjustment of the image to be processed takes into account the different brightness requirements of different areas in the image, and can avoid the shortcomings of global adjustment to enhance the visual effect of the image.

[0154] Those skilled in the art will readily appreciate other implementations of the embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The embodiments of the present invention are intended to cover any variations, uses, or adaptations of the embodiments of the present invention that follow the general principles of the embodiments of the present invention and include common knowledge or customary technical means in the art that are not disclosed in the embodiments of the present invention. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the embodiments of the present invention are indicated by the following claims.

[0155] It should be understood that the embodiments of the present invention are not limited to the precise structures described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present invention is limited only by the appended claims.

Claims

1. A method for adjusting image brightness, characterized in that: include: Get the image to be processed; Performing target recognition processing on the image to be processed, dividing the image to be processed into a foreground area to be processed and a background area to be processed; Determine the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed respectively, and adjust the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment values ​​to obtain a foreground processed area and a background processed area; The foreground processed area and the background processed area are fused to obtain an output image.

2. The method according to claim 1, characterized in that The step of respectively determining the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed includes: Determine a first brightness adjustment value corresponding to the foreground area to be processed; Based on the first brightness adjustment value, a second brightness adjustment value corresponding to the background area to be processed is determined, and the second brightness adjustment value is smaller than the first brightness adjustment value.

3. The method according to claim 1 or 2, characterized in that: After obtaining the image to be processed, the method further includes: Calculating the average brightness value of the image to be processed; When the average brightness value meets a preset condition, the step of performing target recognition processing on the image to be processed is performed.

4. The method according to claim 3, characterized in that When the preset condition is that the average brightness value is lower than a first threshold value, the brightness of the foreground area to be processed and the background area to be processed are adjusted according to the corresponding brightness adjustment value to obtain a foreground processed area and a background processed area, including: According to the corresponding brightness adjustment value, the brightness of the foreground area to be processed and the background area to be processed is enhanced to obtain a foreground processed area and a background processed area.

5. The method according to claim 3, characterized in that: When the preset condition is that the average brightness value is higher than a second threshold value, the brightness of the foreground area to be processed and the background area to be processed are adjusted according to the corresponding brightness adjustment value to obtain a foreground processed area and a background processed area, including: According to the corresponding brightness adjustment value, the brightness of the foreground area to be processed and the background area to be processed is reduced to obtain a foreground processed area and a background processed area.

6. The method according to claim 1, characterized in that The performing target recognition processing on the image to be processed and dividing the image to be processed into a foreground area to be processed and a background area to be processed includes: Performing target recognition processing on the image to be processed to recognize at least one human body in the image to be processed; A human body integrity detection is performed on the human body, a target human body is determined based on the detection result, an area where the target human body is located is used as a foreground area to be processed, and other areas except the foreground area to be processed are used as background areas to be processed, and the image to be processed is segmented.

7. The method according to claim 1, characterized in that The fusing the foreground processed area and the background processed area to obtain an output image includes: Performing color matching on the foreground processed area and the background processed area to obtain a foreground output area and a background output area; The foreground output area and the background output area are fused to obtain an output image.

8. The method according to claim 7, characterized in that The color matching of the foreground processed area and the background processed area to obtain the foreground output area and the background output area includes: respectively extracting the color features of the foreground processed area and the background processed area to obtain the foreground feature and the background feature; determining a first color difference between the foreground feature and the background feature; Based on the first color difference, color adjustment is performed on the foreground processed area and / or the background processed area to obtain a foreground output area and a background output area; the second color difference corresponding to the foreground output area and the background output area is less than the first color difference.

9. An image brightness adjustment device, characterized in that: include: An acquisition module, used for acquiring an image to be processed; The recognition module is used to perform target recognition processing on the image to be processed, and divide the image to be processed into a foreground area to be processed and a background area to be processed; An adjustment module, used to respectively determine the brightness adjustment values ​​corresponding to the foreground area to be processed and the background area to be processed, and adjust the brightness of the foreground area to be processed and the background area to be processed according to the corresponding brightness adjustment values ​​to obtain a foreground processed area and a background processed area; The fusion module is used to fuse the foreground processed area and the background processed area to obtain an output image.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the image brightness adjustment method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image brightness adjustment method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image brightness adjustment method according to any one of claims 1 to 8 is implemented.