WO2022174428A1 - 图像亮度调节方法、图像亮度调节装置、电子设备 - Google Patents

图像亮度调节方法、图像亮度调节装置、电子设备 Download PDF

Info

Publication number
WO2022174428A1
WO2022174428A1 PCT/CN2021/077107 CN2021077107W WO2022174428A1 WO 2022174428 A1 WO2022174428 A1 WO 2022174428A1 CN 2021077107 W CN2021077107 W CN 2021077107W WO 2022174428 A1 WO2022174428 A1 WO 2022174428A1
Authority
WO
WIPO (PCT)
Prior art keywords
brightness
image
target
processed
value
Prior art date
Application number
PCT/CN2021/077107
Other languages
English (en)
French (fr)
Inventor
朱磊
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2021/077107 priority Critical patent/WO2022174428A1/zh
Priority to CN202180075199.2A priority patent/CN116438594A/zh
Publication of WO2022174428A1 publication Critical patent/WO2022174428A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/02Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed

Definitions

  • the present application relates to the technical field of image processing, and in particular, to an image brightness adjustment method, an image brightness adjustment device, and electronic equipment.
  • the prior art uses exposure or brightening to process photos containing shadow areas.
  • areas other than shadow areas in the photo may have overexposure problems.
  • the photo contains multiple shaded areas, it is more difficult to deal with.
  • the embodiments of the present application provide an image brightness adjustment method, an image brightness adjustment device, and an electronic device, which can automatically adjust to improve the shadow area in the image or the image overexposure problem, and also avoid the image artifact problem.
  • a first aspect provides an image brightness adjustment method, comprising: acquiring an image to be processed; acquiring a target grayscale value of a target pixel in a plurality of pixels located in a highlighted area in the to-be-processed image; according to the target grayscale value and a preset threshold The brightness of the image to be processed is adjusted through the preset mapping relationship and the target grayscale value.
  • an apparatus for adjusting image brightness includes an acquisition module and a processing module.
  • the acquisition module is used for acquiring the image to be processed; and is also used for acquiring the target grayscale value of the target pixel in the plurality of pixels located in the highlighted area in the image to be processed.
  • the processing module is configured to adjust the brightness of the image to be processed according to the comparison result between the target grayscale value and the preset threshold value through the preset mapping relationship and the target grayscale value.
  • an electronic device comprising: one or more processors; a memory; and, one or more application programs, wherein the one or more application programs are stored in the memory and configured to Executed by the one or more processors, the one or more application programs are used to perform the method of the first aspect.
  • a computer-readable storage medium where program codes are stored in the computer-readable storage medium, and the program codes can be invoked by a processor to execute the method described in the first aspect.
  • the target pixel and the target grayscale value of the target pixel in the multiple pixels in the highlighted area may be determined first, and the target grayscale value and the predetermined grayscale value may be determined according to the target grayscale value.
  • the comparison result of the threshold is set, and the overall brightness of the image to be processed is adjusted through the preset mapping relationship and the target grayscale value.
  • the present application can adjust the brightness of the image to be processed by means of automatic adjustment, without requiring manual adjustment by the user; on the other hand, the present application detects the target grayscale value of the target pixel rather than the area where the skin is located. The detection accuracy is higher.
  • the present application adjusts the brightness of the entire to-be-processed image according to the comparison result between the target grayscale value and the preset threshold, instead of only adjusting the brightness of the area where the skin is located.
  • the brightness of the entire image to be processed is uniformly changed, and there is no problem of artifacts.
  • FIG. 1 is a schematic diagram of an unexposed image provided by the prior art
  • FIG. 2 is a schematic diagram of an exposed image provided by the prior art
  • FIG. 3 is a process diagram of exposing an image provided by the related art
  • FIG. 5 is a schematic flowchart of an image brightness adjustment method provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an exposed portrait image and a highlighted area thereof provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of an image brightness adjustment method provided by an embodiment of the present application.
  • FIG. 8 is a histogram of the gray scale and the number of pixels provided by an embodiment of the present application.
  • FIG. 9 is a broken line diagram of determining brightness adjustment parameters provided by an embodiment of the present application.
  • FIG. 10 is a block diagram of an apparatus for adjusting image brightness provided by an embodiment of the present application.
  • 11 is a block diagram of the relationship of each module in an electronic device provided by an embodiment of the present application.
  • FIG. 12 is a block diagram of a relationship between a computer-readable storage medium and an application program provided by an embodiment of the present application.
  • the inventor has proposed an image brightness adjustment method, an image brightness adjustment device, an electronic device, and a computer-readable storage medium after research, which can automatically adjust to improve the existence of shadows in images. Area or image overexposure issues while avoiding image artifacts.
  • an embodiment of the present application provides an image brightness adjustment method, which can be applied to an electronic device, and the method includes:
  • An already captured image may be acquired as an image to be processed, or a newly captured image may be acquired as an image to be processed.
  • the image to be processed is an image with content, and this application does not limit the content of the image to be processed.
  • the image to be processed may be a portrait, a landscape, or the like.
  • the image to be processed in the present application may be an original image without exposure processing; or, the image to be processed may also be an image in which the original image is subjected to exposure processing and no artifacts appear.
  • the processed image may be an exposed portrait image.
  • S120 Acquire a target grayscale value of a target pixel in a plurality of pixels located in the highlighted area in the image to be processed.
  • the target pixel in the multiple pixels in the highlighted area in the image to be processed may be determined first, and then the target grayscale value of the target pixel is obtained.
  • the present application may obtain the grayscale value of each pixel in the entire image to be processed in advance, and after determining the target pixel, extract the target grayscale value of the target pixel from the grayscale value of each pixel in the entire image to be processed .
  • the grayscale values of multiple pixels located in the highlighted area in the image to be processed can also be acquired in advance, and after the target pixel is determined, the target grayscale value of the target pixel is extracted from the grayscale values of the multiple pixels located in the highlighted area. value.
  • the target grayscale value of the target pixel may be obtained.
  • the target pixel means a part of the pixels located in the highlighted area in the image to be processed.
  • the number of target pixels is related to the method of determining the target pixel, and the number of target pixels can be one or multiple pixels.
  • the highlighted area of the image to be processed refers to: the overall brightness of a certain area in the image to be processed is higher than the brightness of pixels in other areas in the image to be processed.
  • the brightness of multiple pixels in the highlighted area may all be higher than the brightness of pixels in other areas; or, among the multiple pixels in the highlighted area, the brightness of most pixels is higher than that of pixels in other areas, and the brightness of the remaining pixels is lower than that of pixels in other areas. or equal to the brightness of pixels in other areas.
  • the highlighted area may be, for example, a face area of the exposed portrait image.
  • a preset threshold value and a preset mapping relationship can be preset, the target grayscale value and the preset threshold value are compared, and according to the comparison result, the brightness of the image to be processed is adjusted through the preset mapping relationship and the target grayscale value.
  • the present application does not limit specific preset thresholds and preset mapping relationships.
  • the preset threshold may be a numerical value or a numerical range.
  • the grayscale of the highlighted area is too large, that is, the brightness of the highlighted area is too bright, and the entire to-be-processed image can be reduced according to the preset mapping relationship and the target grayscale value. to reduce the brightness of highlighted areas.
  • the brightness of other areas is further dimmed, considering that other areas are dark areas compared to the highlighted areas, therefore, without affecting the display effect of other areas of the image to be processed, Prevents overexposure of highlighted areas.
  • the grayscale of the highlighted area is too small, that is, the brightness of the highlighted area is too dark. Brightness of highlighted areas. In this case, if the highlighted area includes a shadow area, the brightness of the shadow area can be increased by increasing the overall brightness of the image to be processed.
  • the target grayscale value of the face area and the preset threshold may be compared, and according to the two The brightness of the image to be processed is adjusted through the preset mapping relationship and the target grayscale value.
  • the image to be processed is an exposed portrait image and the highlighted area is the face area of the exposed portrait image, considering that the exposed portrait image has been exposed and the brightness of the portrait image is high enough, there may be problems caused by excessive brightness. Therefore, according to the comparison result between the target grayscale value and the preset threshold value, the brightness of the image to be processed can be reduced by the preset mapping relationship and the target grayscale value. Can.
  • An embodiment of the present application provides an image brightness adjustment method, which can first determine a target pixel in a plurality of pixels in a highlighted area and a target grayscale value of the target pixel, and according to the comparison result between the target grayscale value and a preset threshold, pre Set the mapping relationship and the target grayscale value to adjust the overall brightness of the image to be processed.
  • the target grayscale value is greater than the preset threshold, the overall brightness of the image to be processed can be reduced to avoid the problem of overexposure in the highlighted area; when the target grayscale value is less than the preset threshold, the Manipulates the overall brightness of the image to prevent under-brightness of highlighted areas, or to prevent very dark shadowed areas in highlights.
  • the present application can adjust the brightness of the image to be processed by means of automatic adjustment, without requiring manual adjustment by the user; on the other hand, the present application detects the target grayscale value of the target pixel rather than the area where the skin is located. The detection accuracy is higher. On this basis, the present application adjusts the brightness of the entire to-be-processed image according to the comparison result between the target grayscale value and the preset threshold, instead of only adjusting the brightness of the area where the skin is located. The brightness of the entire image to be processed is uniformly changed, and there is no problem of artifacts.
  • an embodiment of the present application provides an image brightness adjustment method, which can be applied to an electronic device, and the method includes:
  • step S110 is the same as that of step S110 in the foregoing embodiment, and is not repeated here.
  • the gray-scale values of multiple pixels located in the highlighted area in the image to be processed may be acquired in advance; alternatively, the gray-scale values of each pixel in the entire image to be processed may be acquired in advance, and after the highlighted area is determined, from the entire image to be processed
  • the gray-scale values of a plurality of pixels in the highlighted area are extracted from the gray-scale values of each pixel.
  • the brightness values of multiple pixels in the highlighted area can be detected first, and then the multiple pixels can be sorted according to the gamma (gamma) curve. Converts the luminance values to grayscale values.
  • the gamma curve in the embodiment of the present application may be, for example, a gamma 2.2 curve, and the gray scale is 0 ⁇ 255.
  • other gamma curves may also be used, as long as the target grayscale value and the luminance value correspond to the same gamma curve.
  • the face area when the image to be processed is an exposed portrait image, and the highlighted area is a face area of the exposed portrait image, the face area may be detected first, and then, multiple images located in the face area in the to-be-processed image are acquired. pixel grayscale value.
  • the Hist function can be used to establish a histogram of grayscale values and the number of pixels.
  • multiple peaks can be determined.
  • the grayscale values of multiple pixels in the highlighted area range from 245 to 255, wherein the number of pixels with a grayscale of 247 is more than the number of pixels with a grayscale of 246 and the grayscale of 248. Therefore, the grayscale 247 is one of the peaks. Similarly, grayscale 250 and grayscale 252 are also peaks.
  • the largest grayscale value may be selected from the multiple peaks as the target grayscale value, and the pixel in the highlighted area corresponding to the target grayscale value is the target pixel.
  • the three peaks are 247, 250, and 252, of which 252 is the largest. Therefore, 252 is the target grayscale value.
  • the preset mapping relationship can be L represents the target brightness, a represents the brightness adjustment parameter, Lw(x, y) represents the preset threshold, and the preset threshold includes the minimum brightness and the maximum brightness, Indicates the average brightness of the image to be processed.
  • the average brightness of the image to be processed may be acquired after the image to be processed is acquired.
  • Obtaining the average brightness of the image to be processed may include: obtaining the initial grayscale value of each pixel in the image to be processed; sequentially performing linear processing and spatialization processing on the initial grayscale value to obtain the initial brightness value of each pixel; Brightness value to get the average brightness of the image to be processed.
  • linear processing and spatialization processing are performed on the initial grayscale value, that is, the RGB color space is converted into an XYZ color space.
  • the brightness value corresponding to the target grayscale value may be obtained according to the gamma curve.
  • the target luminance L may be a numerical value or a numerical range.
  • a value in the range of values can be taken as The value of L(x, y) in the equation, so that the brightness adjustment parameter a on the right side of the equation takes a unique value.
  • the brightness value corresponding to the target grayscale value is compared with the maximum brightness n; when the brightness value is greater than or equal to the maximum brightness n, the brightness adjustment The parameter is the first adjustment parameter kl.
  • the image to be processed is an exposed portrait image
  • the highlighted area is the face area of the exposed portrait image
  • the exposed portrait image has undergone exposure processing and the brightness of the portrait image is high enough, there may be a reason
  • the problem of overexposure caused by too high brightness may not exist the problem of too low brightness. Therefore, according to the comparison result between the target grayscale value and the preset threshold, the preset mapping relationship and the target grayscale value can be used to reduce the size of the image to be processed. Brightness will do.
  • the brightness of the entire image to be processed may be adjusted according to the brightness adjustment parameter.
  • steps S140 and S150 are not executed. If the target grayscale value still does not meet the target brightness, steps S140 and S150 are performed in sequence.
  • the target brightness may be, for example, a brightness range, and the target grayscale value satisfies the target brightness, which means that the brightness corresponding to the target grayscale value is within the target brightness range.
  • step S131 and S132 because in steps S131 and S132, after the image to be processed is acquired, the initial grayscale value of the image to be processed is firstly subjected to linear processing and spatialization processing to obtain the average brightness in the preset mapping relationship in step S131, and the average brightness at this time is obtained.
  • Brightness is a parameter after XYZ spatialization.
  • step S132 before performing step S121 (S150) again, it is necessary to undergo linearization processing and curvilinear processing in sequence to convert the XYZ spatialized luminance parameters into RGB spatialized luminance parameters, and convert the RGB space into YUV space, And extract the brightness information Y, and then obtain the grayscale value of each pixel corresponding to the brightness information Y according to the gamma curve.
  • Steps S121, S122, S123, S131, and S132 are repeatedly performed until the target grayscale value satisfies the target brightness.
  • An embodiment of the present application provides an image brightness adjustment method, which can first determine a target pixel in a plurality of pixels in a highlighted area and a target grayscale value of the target pixel, and according to the comparison result between the target grayscale value and a preset threshold, pre Set the mapping relationship and the target grayscale value to adjust the overall brightness of the image to be processed.
  • the target grayscale value is greater than the preset threshold, the overall brightness of the image to be processed can be reduced to avoid the problem of overexposure in the highlighted area; when the target grayscale value is less than the preset threshold, the Manipulates the overall brightness of the image to prevent under-brightness of highlighted areas, or to prevent very dark shadowed areas in highlights.
  • the present application can adjust the brightness of the image to be processed by means of automatic adjustment, without requiring manual adjustment by the user; on the other hand, the present application detects the target grayscale value of the target pixel rather than the area where the skin is located. The detection accuracy is higher. On this basis, the present application adjusts the brightness of the entire to-be-processed image according to the comparison result between the target grayscale value and the preset threshold, instead of only adjusting the brightness of the area where the skin is located. The brightness of the entire image to be processed is uniformly changed, and there is no problem of artifacts.
  • this embodiment provides an image brightness adjustment apparatus 100 , including an acquisition module 101 and a processing module 102 .
  • the acquiring module 101 is used for acquiring the image to be processed.
  • the obtaining module 101 is further configured to obtain the target grayscale value of the target pixel in the multiple pixels located in the highlighted area in the image to be processed.
  • the processing module 102 is configured to adjust the brightness of the image to be processed according to the comparison result between the target grayscale value and the preset threshold value through the preset mapping relationship and the target grayscale value.
  • the obtaining module 101 is further configured to obtain the grayscale values of multiple pixels located in the highlighted area in the image to be processed; and is also configured to establish a histogram of the grayscale values and the number of pixels, and according to the histogram Select multiple peaks, and the peaks represent the number of pixels at the grayscale value, which is greater than the number of pixels at the previous grayscale value and the number of pixels at the next grayscale value; Among the gray-scale values, the largest gray-scale value is selected as the target gray-scale value.
  • the acquiring module 101 is further configured to acquire the grayscale values of each pixel in the image to be processed, and extract the grayscale values of a plurality of pixels located in the highlighted area from the grayscale values of each pixel.
  • the processing module 102 is further configured to obtain the brightness adjustment parameter according to the preset mapping relationship and the grayscale value; and is further configured to adjust the brightness of the image to be processed according to the brightness adjustment parameter.
  • the processing module 102 is further configured to obtain the luminance value corresponding to the target grayscale value according to the gamma curve.
  • the acquiring module 101 is further configured to acquire the average brightness of the image to be processed.
  • the processing module 102 is further configured to compare the brightness value corresponding to the target grayscale value with the maximum brightness when the average brightness and the target brightness are constant; and also configured to adjust the brightness parameter when the brightness value is greater than or equal to the maximum brightness. is the first adjustment parameter.
  • the processing module 102 is also used for comparing the brightness value corresponding to the target grayscale value with the minimum brightness when the average brightness and the target brightness are constant; and also used for when the brightness value is less than or equal to the minimum brightness, the brightness adjustment parameter is the second adjustment. parameter, the second adjustment parameter is greater than the first adjustment parameter.
  • the processing module 102 is also used to compare the brightness value corresponding to the target grayscale value with the minimum brightness and the maximum brightness when the average brightness and the target brightness are constant; also used for when the brightness value is greater than the maximum brightness and less than the minimum brightness, with the brightness value increases, the brightness adjustment parameter decreases linearly between the second adjustment parameter and the first adjustment parameter.
  • the obtaining module 101 is also used to obtain the initial grayscale value of each pixel in the image to be processed; it is also used to sequentially perform linear processing and spatialization processing on the initial grayscale value to obtain the initial brightness value of each pixel; to obtain the average brightness of the image to be processed.
  • the processing module 102 is further configured to perform linearization processing and curve processing on the adjusted image to be processed in sequence.
  • the processing module 102 is further configured to repeatedly acquire the target grayscale value of the target pixel in the plurality of pixels located in the highlighted area in the image to be processed, according to the comparison result between the target grayscale value and the preset threshold, through the preset mapping relationship and the target grayscale value. The step of adjusting the brightness of the image to be processed by the level value until the target grayscale value satisfies the target brightness.
  • the acquiring module 101 is configured to acquire the target grayscale value of a target pixel in a plurality of pixels located in the face area in the image to be processed; detect the face area; The grayscale values of multiple pixels located in the face area in the image to be processed; also used to establish a histogram of the grayscale values and the number of pixels, and select a plurality of peaks according to the histogram, and the peaks represent the grayscale values
  • the number of pixels is greater than the number of pixels in the previous grayscale value and the number of pixels in the next grayscale value; it is also used to select the largest grayscale value from the multiple grayscale values corresponding to multiple peaks as the target.
  • the processing module 102 is further configured to reduce the brightness of the image to be processed according to the comparison result between the target grayscale value and the preset threshold value through the preset mapping relationship and the target grayscale value.
  • the embodiment of the present application provides an image brightness adjustment apparatus 100 , the explanation and beneficial effects of which are the same as the explanations and beneficial effects of the aforementioned image brightness adjustment method, and are not repeated here.
  • the electronic device 200 of the present application may include: one or more processors 201 , a memory 202 , and one or more application programs 203 .
  • One or more application programs 203 are stored in the memory 202 and configured to be executed by the one or more processors 201, and the one or more application programs 203 are used to perform the method described in any of the foregoing embodiments.
  • the processor 201 may include one or more processing cores.
  • the processor 201 uses various interfaces and lines to connect various parts in the entire electronic device 200, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 202, and calling the data stored in the memory 202.
  • the processor 201 may adopt digital signal processing (Digital Signal Processing, referred to as DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, referred to as FPGA), Programmable Logic Array (Programmable Logic Array, referred to as PLA) in the of at least one hardware form.
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 201 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU for short), a graphics processor (Graphics Processing Unit, GPU for short), and a modem.
  • a central processing unit Central Processing Unit, CPU for short
  • a graphics processor Graphics Processing Unit, GPU for short
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used for rendering and drawing of the display content
  • the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 201, and is implemented by a communication chip alone.
  • the memory 202 may include a random access memory (Random Access Memory, RAM for short), or a read-only memory (Read-Only Memory, ROM for short). Memory 202 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 202 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like.
  • the storage data area may also store data created during use of the electronic device 200 (eg, phone book, audio and video data, chat record data) and the like.
  • An embodiment of the present application provides an electronic device 200 , and the explanations and beneficial effects of the electronic device 200 are the same as those of the foregoing embodiments, and are not repeated here.
  • FIG. 12 shows a structural block diagram of a computer-readable storage medium 300 provided by another embodiment of the present application.
  • the computer-readable storage medium 300 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
  • the computer-readable storage medium 300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 300 has storage space for the application program 203 that performs any of the method steps in the above-described methods. These applications 203 may be read from or written to one or more computer program products. Application 203 may be compressed, for example, in a suitable form.

Abstract

本申请实施例提供了一种图像亮度调节方法、图像亮度调节装置、电子设备,涉及图像处理技术领域,可以通过自动调节,改善图像中存在阴影区域或图像过曝光问题,同时还可避免图像出现伪影问题。一种图像亮度调节方法,包括:获取待处理图像;获取所述待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值;根据所述目标灰阶值与预设阈值的比较结果,通过预设映射关系以及所述目标灰阶值调节所述待处理图像的亮度。

Description

图像亮度调节方法、图像亮度调节装置、电子设备 技术领域
本申请涉及图像处理技术领域,尤其涉及一种图像亮度调节方法、图像亮度调节装置、电子设备。
背景技术
如图1所示,在暗环境下拍照时,拍摄出来的照片中常包括阴影区域,影响拍摄效果。
现有技术采用曝光或提亮的方式对包含阴影区域的照片进行处理,然而,如图2所示,仅通过简单曝光或提亮处理,照片中除阴影区域以外的区域可能出现过曝光问题,尤其是照片中包含多处阴影区域的情况,处理起来更加困难。
发明内容
本申请实施例提供了一种图像亮度调节方法、图像亮度调节装置、电子设备,可以通过自动调节,改善图像中存在阴影区域或图像过曝光问题,同时还可避免图像出现伪影问题。
第一方面,提供一种图像亮度调节方法,包括:获取待处理图像;获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值;根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像的亮度。
第二方面,提供一种图像亮度调节装置,图像亮度调节装置包括获取模块以及处理模块。获取模块,用于获取待处理图像;还用于获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值。处理模块,用于根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像的亮度。
第三方面,提供一种电子设备,包括:一个或多个处理器;存储器;以及,一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序用于执行第一方面所述的方法。
第四方面,提供一种计算机可读存储介质,计算机可读存储介质中存储有程序代码,所述程序代码可被处理器调用执行如第一方面所述的方法。
本申请实施例提供的图像亮度调节方法、图像亮度调节装置、电子设备中,可以先确定高亮区域的多个像素中的目标像素以及目标像素的目标灰阶值,根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像整体的亮度。当目标灰阶值大于预设阈值时,可以降低待处理图像整体的亮度,以避免高亮区域的亮度过亮,存在过曝光的问题;当目标灰阶值小于预设阈值时,可以提高待处理图像整体的亮度,以防止高亮区域的亮度过低,或者防止高亮区域存在亮度非常暗的阴影区域。在此基础上,一方面,本申请可以采用自动调节的方式调节待处理图像的亮度,无需用户手动调节;另一方面,本申请是通过检测目标像素的目标灰阶值而非皮肤所在区域,检测的精确度更高,在此基础上,本申请根据目标灰阶值与预设阈值的比较结果,对整个待处理图像的亮度进行调节,而非仅对皮肤所在区域的亮度进行调节,可以使得整个待处理图像的亮度均匀变化,不存在伪影问题。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。
图1为现有技术提供的未经曝光的图像的示意图;
图2为现有技术提供的曝光图像后的示意图;
图3为相关技术提供的对图像进行曝光的过程图;
图4为相关技术提供的曝光图像后的示意图;
图5为本申请实施例提供的图像亮度调节方法的流程示意图;
图6为本申请实施例提供的曝光人像图像及其高亮区域的示意图;
图7为本申请实施例提供的图像亮度调节方法的流程示意图;
图8为本申请实施例提供的灰阶与像素个数的直方图;
图9为本申请实施例提供的确定亮度调整参数的折线图;
图10为本申请实施例提供的图像亮度调节装置的框图;
图11为本申请实施例提供的电子设备中各个模块的关系框图;
图12为本申请实施例提供的计算机可读存储介质与应用程序的关系框图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。需要说明的是,在不冲突的情况下,本申请的实施例中的特征可以相互结合。
对于背景技术提出的技术问题,相关技术提出了两种解决方案:
一、如图3所示,在拍照时,用户手动调节曝光量,将拍摄的预览画面整体提亮,待确认预览画面为最优曝光量后拍摄照片。然而,该方式需要用户手动调节,经过反复尝试后,才能确定最优曝光量,不利于用户体验。
二、以拍摄人脸为例,只对照片中暴露在外的皮肤区域对应的像素进行局部曝光,以提亮皮肤所在区域。然而,可能存在部分皮肤未被检测到的问题,从而导致并非全部暴露在外的皮肤都被提亮,导致照片出现伪影(artifact)问题(图4)。
针对背景技术以及相关技术中提出的问题,发明人经研究后提出了一种图像亮度调节方法、图像亮度调节装置、电子设备、以及计算机可读存 储介质,可以通过自动调节,改善图像中存在阴影区域或图像过曝光问题,同时还可避免图像出现伪影问题。
如图5所示,本申请实施例提供了一种图像亮度调节方法,可应用于电子设备,该方法包括:
S110、获取待处理图像。
可以获取已拍摄的图像作为待处理图像,或者新拍摄图像作为待处理图像。
在一些实施例中,待处理图像为具有内容的图像,本申请不对待处理图像的内容进行限定。示例的,待处理图像可以是人像、风景等。
在一些实施例中,本申请的待处理图像可以是未经曝光处理的原始图像;或者,待处理图像也可以是对原始图像进行曝光处理、且未出现伪影现象的图像,进一步的,待处理图像可以是曝光人像图像。
S120、获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值。
可以先确定待处理图像中位于高亮区域的多个像素中的目标像素,之后,得到目标像素的目标灰阶值。
在一些实施例中,本申请可以预先获取整个待处理图像中各个像素的灰阶值,待确定目标像素后,从整个待处理图像中各个像素的灰阶值中提取目标像素的目标灰阶值。
或者,也可以预先获取待处理图像中位于高亮区域的多个像素的灰阶值,待确定目标像素后,从位于高亮区域的多个像素的灰阶值中提取目标像素的目标灰阶值。
或者,也可以确定目标像素后,获取目标像素的目标灰阶值。
在一些实施例中,目标像素意为指代待处理图像中位于高亮区域的多个像素中的部分像素,目标像素的个数与确定目标像素的方式有关,目标像素的个数可以是一个或多个像素。
在一些实施例中,待处理图像的高亮区域,顾名思义,是指:待处理图像中的某一区域的整体亮度,高于待处理图像中的其他区域的像素的亮度。
高亮区域的多个像素的亮度可以全部高于其他区域的像素的亮度;或者,高亮区域的多个像素中,多数像素的亮度高于其他区域的像素的亮度,其余像素的亮度低于或等于其他区域的像素的亮度。
在一些实施例中,如图6所示,在待处理图像为曝光人像图像的情况下,高亮区域例如可以是曝光人像图像的人脸区域。
S130、根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像的亮度。
可以预先设定预设阈值以及预设映射关系,比较目标灰阶值与预设阈值的大小,并根据比较结果,通过预设映射关系以及目标灰阶值调节待处理图像的亮度。
在一些实施例中,本申请不对具体的预设阈值以及预设映射关系进行限定。其中,预设阈值可以是一个数值,也可以是数值范围。
可以理解的是,当目标灰阶值大于预设阈值时,高亮区域的灰阶过大,即高亮区域的亮度过亮,可以根据预设映射关系以及目标灰阶值降低整个待处理图像的亮度,以降低高亮区域的亮度。在此情况下,虽然其他区域的亮度进一步变暗,但考虑到相较于高亮区域,其他区域本就是暗区,因此,可在不影响待处理图像的其他区域的显示效果的情况下,防止高亮区域过曝光。
当目标灰阶值小于预设阈值时,高亮区域的灰阶过小,即高亮区域的亮度过暗,可以根据预设映射关系以及目标灰阶值提高整个待处理图像的亮度,以提高高亮区域的亮度。在此情况下,若高亮区域包含阴影区域,则可以通过提高待处理图像的整体亮度,来提高阴影区域的亮度。
在一些实施例中,在待处理图像为曝光人像图像,高亮区域是曝光人像图像的人脸区域的情况下,可以比较人脸区域的目标灰阶值与预设阈值的大小,根据二者的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像的亮度。
可选的,在待处理图像为曝光人像图像,高亮区域是曝光人像图像的人脸区域的情况下,考虑到曝光人像图像已经经过曝光处理,人像图像的亮度足够高,可能存在因亮度过高而导致过曝光问题,可能不存在亮度过 低的问题,因此,可以根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值减小待处理图像的亮度即可。
本申请实施例提供一种图像亮度调节方法,可以先确定高亮区域的多个像素中的目标像素以及目标像素的目标灰阶值,根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像整体的亮度。当目标灰阶值大于预设阈值时,可以降低待处理图像整体的亮度,以避免高亮区域的亮度过亮,存在过曝光的问题;当目标灰阶值小于预设阈值时,可以提高待处理图像整体的亮度,以防止高亮区域的亮度过低,或者防止高亮区域存在亮度非常暗的阴影区域。在此基础上,一方面,本申请可以采用自动调节的方式调节待处理图像的亮度,无需用户手动调节;另一方面,本申请是通过检测目标像素的目标灰阶值而非皮肤所在区域,检测的精确度更高,在此基础上,本申请根据目标灰阶值与预设阈值的比较结果,对整个待处理图像的亮度进行调节,而非仅对皮肤所在区域的亮度进行调节,可以使得整个待处理图像的亮度均匀变化,不存在伪影问题。
如图7所示,本申请实施例提供了一种图像亮度调节方法,可应用于电子设备,该方法包括:
S110、获取待处理图像。
步骤S110的解释说明与前述实施例步骤S110的解释说明相同,在此不再赘述。
S121、获取待处理图像中位于高亮区域的多个像素的灰阶值。
可以预先获取待处理图像中位于高亮区域的多个像素的灰阶值;或者,可以预先获取整个待处理图像中各个像素的灰阶值,待确定高亮区域后,从整个待处理图像中各个像素的灰阶值中提取高亮区域的多个像素的灰阶值。
其中,以预先获取待处理图像中位于高亮区域的多个像素的灰阶值为例,可以先检测高亮区域的多个像素的亮度值,再根据伽马(gamma)曲线将多个像素的亮度值转换为灰阶值。本申请实施例的伽马(gamma)曲线例如可以是gamma2.2曲线,灰阶为0~255。当然,也可以是其他gamma曲线,只要目标灰阶值与亮度值对应于同一gamma曲线即可。
在一些实施例中,在待处理图像为曝光人像图像,高亮区域是曝光人像图像的人脸区域的情况下,可以先检测人脸区域,之后,获取待处理图像中位于人脸区域的多个像素的灰阶值。
S122、建立灰阶值与像素个数的直方图,并根据直方图选取多个峰值,峰值表征处于该灰阶值的像素个数,大于处于前一灰阶值的像素个数以及处于后一灰阶值的像素个数。
如图8所示,可以采用Hist函数建立灰阶值与像素个数的直方图,横坐标为从小到大的灰阶值,纵坐标是为某一灰阶值的像素的个数。在一个直方图中,可以确定多个峰值(图8中填充有阴影的矩形所在的灰阶)。
如图8所示,假设高亮区域的多个像素的灰阶值的范围为245~255,其中,灰阶为247的像素个数多于灰阶为246的像素个数以及灰阶为248的像素个数,因此,灰阶247为其中一个峰值。同理,灰阶250以及灰阶252也为峰值。
S123、从多个峰值对应的多个灰阶值中选取最大灰阶值作为目标灰阶值。
根据步骤S122确定了多个峰值,之后,可以从多个峰值中选取最大的灰阶值作为目标灰阶值,目标灰阶值对应的高亮区域中的像素为目标像素。
示例的,如图8所示,3个峰值分别为247、250、252,其中252最大,因此,252为目标灰阶值。
S131、根据预设映射关系以及灰阶值,得到亮度调整参数。
其中,预设映射关系可以为
Figure PCTCN2021077107-appb-000001
L表示目标亮度,a表示亮度调整参数,Lw(x,y)表示预设阈值,预设阈值包括最小亮度和最大亮度,
Figure PCTCN2021077107-appb-000002
表示待处理图像的平均亮度。
在一些实施例中,可以在获取待处理图像之后,获取待处理图像的平均亮度。获取待处理图像的平均亮度可以包括:获取待处理图像中各个像素的初始灰阶值;依次对初始灰阶值进行线性处理、空间化处理,得到各个像素的初始亮度值;根据各个像素的初始亮度值,得到待处理图像的平均亮度。其中,对初始灰阶值进行线性处理以及空间化化处理,即,将RGB颜色空间转换为XYZ颜色空间。
在一些实施例中,可以在得到目标灰阶值之后,根据预设映射关系以及灰阶值,得到亮度调整参数之前,根据伽马曲线,得到目标灰阶值对应的亮度值。
在一些实施例中,目标亮度L可以是一个数值,也可以是数值范围。当目标亮度L为数值范围时,可以根据取数值范围中的一个值作为
Figure PCTCN2021077107-appb-000003
中L(x,y)的值,以使得等式右边的亮度调整参数a取唯一的值。
在一些实施例中,如图9所示,当平均亮度以及所述目标亮度一定时,比较目标灰阶值对应的亮度值与最大亮度n;当亮度值大于或等于最大亮度n时,亮度调整参数为第一调节参数kl。
如图9所示,当平均亮度以及目标亮度一定时,比较目标灰阶值对应的亮度值与最小亮度m;当亮度值小于或等于最小亮度m时,亮度调整参数为第二调节参数kh,第二调节参数kh大于第一调节参数kl。
如图9所示,当平均亮度以及目标亮度一定时,比较目标灰阶值对应的亮度值与最小亮度m和最大亮度n;当亮度值大于最大亮度m、小于最小亮度n时,随着亮度值的增大,亮度调整参数在第二调节参数与第一调节参数之间线性减小。
在一些实施例中,在待处理图像为曝光人像图像,高亮区域是曝光人像图像的人脸区域的情况下,考虑到曝光人像图像已经经过曝光处理,人像图像的亮度足够高,可能存在因亮度过高而导致过曝光问题,可能不存在亮度过低的问题,因此,可以根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值减小待处理图像的亮度即可。
这样一来,无需比较目标灰阶值对应的亮度值与最小亮度m,以进一步调亮曝光人像图像。
S132、根据亮度调整参数调节待处理图像的亮度。
根据步骤S131确定出亮度调整参数后,可以根据亮度调整参数调节整个待处理图像的亮度。
若经过步骤S132调节后,待处理图像的目标灰阶值发生变化,若目标灰阶值满足目标亮度,则不再执行步骤S140以及S150。若目标灰阶值仍不 满足目标亮度,则依次执行步骤S140以及S150。
其中,目标亮度例如可以是一个亮度范围,目标灰阶值满足目标亮度,是指:目标灰阶值对应的亮度在目标亮度范围内。
S140、依次对调节后的待处理图像进行线性化处理、曲线化处理。
由于在步骤S131以及S132中,获取待处理图像后,先将待处理图像的初始灰阶值进行线性处理以及空间化处理,得到了步骤S131中预设映射关系中的平均亮度,此时的平均亮度是XYZ空间化后的参数。在步骤S132之后,再次执行步骤S121(S150)之前,需依次经过线性化处理以及曲线化处理,将XYZ空间化的亮度参数转换为RGB空间化的亮度参数,并将RGB空间转换为YUV空间,并提取亮度信息Y,之后,根据gamma曲线得到与亮度信息Y对应的各个像素的灰阶值。
S150、重复获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值,根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像的亮度的步骤,直至目标灰阶值满足目标亮度。
重复执行步骤S121、S122、S123、S131、S132,直至目标灰阶值满足目标亮度。
本申请实施例提供一种图像亮度调节方法,可以先确定高亮区域的多个像素中的目标像素以及目标像素的目标灰阶值,根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像整体的亮度。当目标灰阶值大于预设阈值时,可以降低待处理图像整体的亮度,以避免高亮区域的亮度过亮,存在过曝光的问题;当目标灰阶值小于预设阈值时,可以提高待处理图像整体的亮度,以防止高亮区域的亮度过低,或者防止高亮区域存在亮度非常暗的阴影区域。在此基础上,一方面,本申请可以采用自动调节的方式调节待处理图像的亮度,无需用户手动调节;另一方面,本申请是通过检测目标像素的目标灰阶值而非皮肤所在区域,检测的精确度更高,在此基础上,本申请根据目标灰阶值与预设阈值的比较结果,对整个待处理图像的亮度进行调节,而非仅对皮肤所在区域的亮度进行调节,可以使得整个待处理图像的亮度均匀变化,不存在伪影问题。
如图10所示,本实施例提供了一种图像亮度调节装置100,包括获取模块101以及处理模块102。
获取模块101,用于获取待处理图像。
获取模块101,还用于获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值。
处理模块102,用于根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节待处理图像的亮度。
在此基础上,获取模块101还用于获取所述待处理图像中位于高亮区域的多个像素的灰阶值;还用于建立灰阶值与像素个数的直方图,并根据直方图选取多个峰值,峰值表征处于该灰阶值的像素个数,大于处于前一灰阶值的像素个数以及处于后一灰阶值的像素个数;还用于从多个峰值对应的多个灰阶值中选取最大灰阶值作为目标灰阶值。
获取模块101还用于获取待处理图像中各个像素的灰阶值,从各个像素的灰阶值中提取位于高亮区域的多个像素的灰阶值。
处理模块102还用于根据预设映射关系以及灰阶值,得到亮度调整参数;还用于根据亮度调整参数调节待处理图像的亮度。
处理模块102还用于根据伽马曲线,得到所述目标灰阶值对应的亮度值。
获取模块101还用于获取所述待处理图像的平均亮度。
处理模块102还用于当平均亮度以及所述目标亮度一定时,比较所述目标灰阶值对应的亮度值与所述最大亮度;还用于当亮度值大于或等于最大亮度时,亮度调整参数为第一调节参数。
处理模块102还用于当平均亮度以及所述目标亮度一定时,比较目标灰阶值对应的亮度值与最小亮度;还用于当亮度值小于或等于最小亮度时,亮度调整参数为第二调节参数,第二调节参数大于第一调节参数。
处理模块102还用于当平均亮度以及目标亮度一定时,比较目标灰阶值对应的亮度值与最小亮度和最大亮度;还用于当亮度值大于最大亮度、小于最小亮度时,随着亮度值的增大,亮度调整参数在第二调节参数与第一调节参数之间线性减小。
获取模块101还用于获取待处理图像中各个像素的初始灰阶值;还用于依次对初始灰阶值进行线性处理、空间化处理,得到各个像素的初始亮度值;还用于根据各个像素的初始亮度值,得到待处理图像的平均亮度。
处理模块102还用于依次对调节后的所述待处理图像进行线性化处理、曲线化处理。
处理模块102还用于重复获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值,根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值调节所述待处理图像的亮度的步骤,直至目标灰阶值满足目标亮度。
在待处理图像为曝光人像图像的情况下,获取模块101用于获取待处理图像中位于人脸区域的多个像素中目标像素的目标灰阶值;检测所述人脸区域;还用于获取待处理图像中位于所述人脸区域的多个像素的灰阶值;还用于建立灰阶值与像素个数的直方图,并根据直方图选取多个峰值,峰值表征处于该灰阶值的像素个数,大于处于前一灰阶值的像素个数以及处于后一灰阶值的像素个数;还用于从多个峰值对应的多个灰阶值中选取最大灰阶值作为目标灰阶值;还用于获取待处理图像中各个像素的灰阶值;还用于从各个像素的灰阶值中提取位于人脸区域的多个像素的灰阶值。处理模块102还用于根据目标灰阶值与预设阈值的比较结果,通过预设映射关系以及目标灰阶值减小待处理图像的亮度。
本申请实施例提供一种图像亮度调节装置100,其解释说明以及有益效果与前述图像亮度调节方法的解释说明以及有益效果相同,在此不再赘述。
如图11所示,本申请另一实施例提供一种电子设备200,该电子设备200。本申请的电子设备200可以包括:一个或多个处理器201、存储器202、一个或多个应用程序203。其中一个或多个应用程序203被存储在存储器202中并被配置为由所述一个或多个处理器201执行,一个或多个应用程序203用于执行前述任一实施例所述的方法。
处理器201可以包括一个或者多个处理核。处理器201利用各种接口和线路连接整个电子设备200内的各个部分,通过运行或执行存储在存储器202内的指令、程序、代码集或指令集,以及调用存储在存储器202内 的数据,执行电子设备200的各种功能和处理数据。可选地,处理器201可以采用数字信号处理(Digital Signal Processing,简称DSP)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)、可编程逻辑阵列(Programmable Logic Array,简称PLA)中的至少一种硬件形式来实现。处理器201可集成中央处理器(Central Processing Unit,简称CPU)、图像处理器(Graphics Processing Unit,简称GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器201中,单独通过一块通信芯片进行实现。
存储器202可以包括随机存储器(Random Access Memory,简称RAM),也可以包括只读存储器(Read-Only Memory,简称ROM)。存储器202可用于存储指令、程序、代码、代码集或指令集。存储器202可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备200在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
本申请实施例提供一种电子设备200,电子设备200的解释说明以及有益效果与前述实施例的解释说明以及有益效果相同,在此不再赘述。
如图12所示,其示出了本申请另一实施例提供的一种计算机可读存储介质300的结构框图。该计算机可读存储介质300中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质300可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选的,计算机可读存储介质300包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。
计算机可读存储介质300具有执行上述方法中的任何方法步骤的应用程序203的存储空间。这些应用程序203可以从一个或者多个计算机程序 产品中读出或者写入到这一个或者多个计算机程序产品中。应用程序203可以例如以适当形式进行压缩。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种图像亮度调节方法,其特征在于,包括:
    获取待处理图像;
    获取所述待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值;
    根据所述目标灰阶值与预设阈值的比较结果,通过预设映射关系以及所述目标灰阶值调节所述待处理图像的亮度。
  2. 根据权利要求1所述的方法,其特征在于,所述获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值,包括:
    获取所述待处理图像中位于所述高亮区域的多个像素的灰阶值;
    建立灰阶值与像素个数的直方图,并根据所述直方图选取多个峰值,所述峰值表征处于该灰阶值的像素个数,大于处于前一灰阶值的像素个数以及处于后一灰阶值的像素个数;
    从多个所述峰值对应的多个灰阶值中选取最大灰阶值作为目标灰阶值。
  3. 根据权利要求2所述的方法,其特征在于,所述获取待处理图像中位于所述高亮区域的多个像素的灰阶值,包括:
    获取所述待处理图像中各个像素的灰阶值;
    从所述各个像素的灰阶值中提取位于所述高亮区域的多个像素的灰阶值。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述目标灰阶值与预设阈值的比较结果,通过预设映射关系以及所述目标灰阶值调节所述待处理图像的亮度,包括:
    根据所述预设映射关系以及所述灰阶值,得到亮度调整参数;
    根据所述亮度调整参数调节所述待处理图像的亮度。
  5. 根据权利要求4所述的方法,其特征在于,所述预设映射关系为
    Figure PCTCN2021077107-appb-100001
    L表示目标亮度,a表示亮度调整参数,Lw(x,y)表示预设阈值,所述预设阈值包括最小亮度和最大亮度,
    Figure PCTCN2021077107-appb-100002
    表示所述待处理图像的平均亮度;
    所述根据所述预设映射关系以及所述灰阶值,得到亮度调整参数之前,所述方法还包括:根据伽马曲线,得到所述目标灰阶值对应的亮度值。
  6. 根据权利要求5所述的方法,其特征在于,所述获取待处理图像之后,所述方法还包括:
    获取所述待处理图像的平均亮度。
  7. 根据权利要求5所述的方法,其特征在于,所述根据所述预设映射关系以及所述灰阶值,得到亮度调整参数,包括:
    当所述平均亮度以及所述目标亮度一定时,比较所述目标灰阶值对应的亮度值与所述最大亮度;
    当所述亮度值大于或等于所述最大亮度时,所述亮度调整参数为第一调节参数。
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述预设映射关系以及所述灰阶值,得到亮度调整参数,包括:
    当所述平均亮度以及所述目标亮度一定时,比较所述目标灰阶值对应的亮度值与所述最小亮度;
    当所述亮度值小于或等于所述最小亮度时,所述亮度调整参数为第二 调节参数,所述第二调节参数大于所述第一调节参数。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述预设映射关系以及所述灰阶值,得到亮度调整参数,包括:
    当所述平均亮度以及所述目标亮度一定时,比较所述目标灰阶值对应的亮度值与所述最小亮度和所述最大亮度;
    当所述亮度值大于所述最大亮度、小于所述最小亮度时,随着所述亮度值的增大,所述亮度调整参数在所述第二调节参数与所述第一调节参数之间线性减小。
  10. 根据权利要求6-9任一项所述的方法,其特征在于,所述获取所述待处理图像的平均亮度,包括:
    获取所述待处理图像中各个像素的初始灰阶值;
    依次对所述初始灰阶值进行线性处理、空间化处理,得到各个像素的初始亮度值;
    根据所述各个像素的初始亮度值,得到所述待处理图像的平均亮度。
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述亮度调整参数调节所述待处理图像的亮度后,所述方法还包括:
    依次对调节后的所述待处理图像进行线性化处理、曲线化处理。
  12. 根据权利要求11所述的方法,其特征在于,所述依次对调节后的所述待处理图像进行线性化处理、曲线化处理后,所述方法还包括:
    重复获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰 阶值,根据所述目标灰阶值与预设阈值的比较结果,通过预设映射关系以及所述目标灰阶值调节所述待处理图像的亮度的步骤,直至所述目标灰阶值满足所述目标亮度。
  13. 根据权利要求1所述的方法,其特征在于,所述待处理图像为曝光人像图像。
  14. 根据权利要求13所述的方法,其特征在于,所述获取所述待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值,包括:
    获取待处理图像中位于人脸区域的多个像素中目标像素的目标灰阶值。
  15. 根据权利要求14所述的方法,其特征在于,所述获取待处理图像中位于人脸区域的多个像素中目标像素的目标灰阶值,包括:
    检测所述人脸区域;
    获取所述待处理图像中位于所述人脸区域的多个像素的灰阶值;
    建立灰阶值与像素个数的直方图,并根据所述直方图选取多个峰值,所述峰值表征处于该灰阶值的像素个数,大于处于前一灰阶值的像素个数以及处于后一灰阶值的像素个数;
    从多个所述峰值对应的多个灰阶值中选取最大灰阶值作为目标灰阶值。
  16. 根据权利要求15所述的方法,其特征在于,所述获取所述待处理图像中位于所述人脸区域的多个像素的灰阶值,包括:
    获取所述待处理图像中各个像素的灰阶值;
    从所述各个像素的灰阶值中提取位于所述人脸区域的多个像素的灰阶值。
  17. 根据权利要求13-16任一项所述的方法,其特征在于,所述根据所述目标灰阶值与预设阈值的比较结果,通过预设映射关系以及所述目标灰阶值调节所述待处理图像的亮度,包括:
    所述根据所述目标灰阶值与预设阈值的比较结果,通过预设映射关系以及所述目标灰阶值减小所述待处理图像的亮度。
  18. 一种图像亮度调节装置,其特征在于,包括:
    获取模块,用于获取待处理图像;
    获取模块,还用于获取待处理图像中位于高亮区域的多个像素中目标像素的目标灰阶值;
    处理模块,用于根据所述目标灰阶值与预设阈值的比较结果,通过预设映射关系以及所述目标灰阶值调节所述待处理图像的亮度。
  19. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储器;以及,
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序用于执行权利要求1-17任一项所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-17任一项所述的方法。
PCT/CN2021/077107 2021-02-20 2021-02-20 图像亮度调节方法、图像亮度调节装置、电子设备 WO2022174428A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2021/077107 WO2022174428A1 (zh) 2021-02-20 2021-02-20 图像亮度调节方法、图像亮度调节装置、电子设备
CN202180075199.2A CN116438594A (zh) 2021-02-20 2021-02-20 图像亮度调节方法、图像亮度调节装置、电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/077107 WO2022174428A1 (zh) 2021-02-20 2021-02-20 图像亮度调节方法、图像亮度调节装置、电子设备

Publications (1)

Publication Number Publication Date
WO2022174428A1 true WO2022174428A1 (zh) 2022-08-25

Family

ID=82931967

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/077107 WO2022174428A1 (zh) 2021-02-20 2021-02-20 图像亮度调节方法、图像亮度调节装置、电子设备

Country Status (2)

Country Link
CN (1) CN116438594A (zh)
WO (1) WO2022174428A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117495751A (zh) * 2023-11-02 2024-02-02 凯多智能科技(上海)有限公司 一种图像亮度均衡处理方法、装置及电子设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160371821A1 (en) * 2014-03-28 2016-12-22 Fujifilm Corporation Image processing device, imaging device, image processing method, and program
CN107231505A (zh) * 2017-07-18 2017-10-03 北京小米移动软件有限公司 图像处理方法及装置
CN109686342A (zh) * 2018-12-25 2019-04-26 青岛海信电器股份有限公司 一种图像处理方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160371821A1 (en) * 2014-03-28 2016-12-22 Fujifilm Corporation Image processing device, imaging device, image processing method, and program
CN107231505A (zh) * 2017-07-18 2017-10-03 北京小米移动软件有限公司 图像处理方法及装置
CN109686342A (zh) * 2018-12-25 2019-04-26 青岛海信电器股份有限公司 一种图像处理方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117495751A (zh) * 2023-11-02 2024-02-02 凯多智能科技(上海)有限公司 一种图像亮度均衡处理方法、装置及电子设备
CN117495751B (zh) * 2023-11-02 2024-05-03 凯多智能科技(上海)有限公司 一种图像亮度均衡处理方法、装置及电子设备

Also Published As

Publication number Publication date
CN116438594A (zh) 2023-07-14

Similar Documents

Publication Publication Date Title
EP3614333B1 (en) Image processing method, storage medium, and electronic apparatus
Kim et al. Image contrast enhancement using entropy scaling in wavelet domain
US10074162B2 (en) Brightness control for spatially adaptive tone mapping of high dynamic range (HDR) images
US11138695B2 (en) Method and device for video processing, electronic device, and storage medium
EP1918872A2 (en) Image segmentation method and system
CN112819702B (zh) 图像增强方法、装置、电子设备及计算机可读存储介质
CN111163268B (zh) 一种图像处理方法、装置以及计算机存储介质
CN107346546B (zh) 一种图像处理方法及装置
US7613338B2 (en) Image processing method and apparatus, program, and storage medium
US8594446B2 (en) Method for enhancing a digitized document
CN109727216B (zh) 图像处理方法、装置、终端设备及存储介质
EP2059902A1 (en) Method and apparatus for image enhancement
US20040120599A1 (en) Detection and enhancement of backlit images
WO2022174428A1 (zh) 图像亮度调节方法、图像亮度调节装置、电子设备
US9374478B1 (en) Adaptive image sharpening
JP3673092B2 (ja) 画質調整装置及び画質調整方法、並びに画像調整用プログラムを記録した記録媒体
US20060056722A1 (en) Edge preserving method and apparatus for image processing
TW202004662A (zh) 影像強化方法及電腦系統
CN115660997B (zh) 一种图像数据处理方法、装置及电子设备
KR102462265B1 (ko) 지향성 스케일링 시스템들 및 방법들
JP2012531074A (ja) デジタル画像処理方法及び前記画像を明るくする装置
CN114418848B (zh) 视频处理方法、装置、存储介质及电子设备
WO2021217445A1 (zh) 图像处理方法、装置、系统和存储介质
JP2008243225A (ja) 画像処理装置、画像処理方法およびプログラムを記録したコンピュータ読み取り可能な記録媒体
CN109509161B (zh) 图像增强装置及图像增强方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21926146

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21926146

Country of ref document: EP

Kind code of ref document: A1