WO2022226917A1 - 图像处理方法及电子设备 - Google Patents
图像处理方法及电子设备 Download PDFInfo
- Publication number
- WO2022226917A1 WO2022226917A1 PCT/CN2021/091108 CN2021091108W WO2022226917A1 WO 2022226917 A1 WO2022226917 A1 WO 2022226917A1 CN 2021091108 W CN2021091108 W CN 2021091108W WO 2022226917 A1 WO2022226917 A1 WO 2022226917A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- mapping curve
- tone mapping
- grayscale
- image
- tone
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 37
- 238000013507 mapping Methods 0.000 claims abstract description 174
- 230000003044 adaptive effect Effects 0.000 claims description 35
- 230000001186 cumulative effect Effects 0.000 claims description 20
- 238000005315 distribution function Methods 0.000 claims description 17
- 230000006978 adaptation Effects 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 9
- 238000000034 method Methods 0.000 description 19
- 230000008569 process Effects 0.000 description 17
- 238000012937 correction Methods 0.000 description 5
- 230000000007 visual effect Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 241000023320 Luma <angiosperm> Species 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 238000003705 background correction Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
Definitions
- the present application relates to the technical field of image processing, and in particular, to an image processing method and electronic device.
- Embodiments of the present application provide an image processing method and an electronic device.
- the image processing method of the embodiment of the present application includes: acquiring a grayscale histogram of a reference image; determining a first tone mapping curve based on human vision according to the grayscale histogram; determining a second tone mapping curve according to the grayscale histogram curve; determining a target tone mapping curve according to the first tone mapping curve and the second tone mapping curve; processing the image to be processed according to the target tone mapping curve to obtain a high dynamic range image.
- the first tone mapping curve based on human vision is determined according to the grayscale histogram
- the second tone mapping curve is determined according to the grayscale histogram
- the first tone mapping curve and the second tone mapping curve are determined according to the grayscale histogram.
- the curve determines the target tone mapping curve. Therefore, using the target tone mapping curve to process the image to be processed can improve the brightness of the dark part of the image and avoid the loss of details in the highlight part based on human vision, thereby improving the dynamic range of the image to be processed. Dynamic range image.
- the electronic device of the embodiment of the present application includes a processor.
- the processor is used for: acquiring a grayscale histogram of the reference image; determining a first tone mapping curve based on human vision according to the grayscale histogram; determining a second tone mapping curve according to the grayscale histogram; The first tone mapping curve and the second tone mapping curve determine a target tone mapping curve; the image to be processed is processed according to the target tone mapping curve to obtain a high dynamic range image.
- the first tone mapping curve based on human vision is determined according to the grayscale histogram
- the second tone mapping curve is determined according to the grayscale histogram
- the first tone mapping curve and the second tone mapping curve are determined according to the grayscale histogram. Determine the target tone mapping curve. Therefore, using the target tone mapping curve to process the image to be processed can improve the brightness of the dark part of the image and avoid the loss of details in the highlight part based on human vision, thereby improving the dynamic range of the image to be processed to obtain high dynamic. range image.
- FIG. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application.
- FIG. 2 is a schematic diagram of an electronic device according to an embodiment of the present application.
- FIG. 3 is a schematic diagram of a scene of an image processing method according to an embodiment of the present application.
- FIG. 4 is a schematic flowchart of an image processing method according to an embodiment of the present application.
- FIG. 5 is a schematic flowchart of an image processing method according to an embodiment of the present application.
- FIG. 6 is a schematic flowchart of an image processing method according to an embodiment of the present application.
- FIG. 7 is a schematic flowchart of an image processing method according to an embodiment of the present application.
- first and second are only used for description purposes, and cannot be understood as indicating or implying relative importance or implying the number of indicated technical features. Thus, features defined as “first”, “second” may expressly or implicitly include one or more of said features.
- “plurality” means two or more, unless otherwise expressly and specifically defined.
- the present application provides an image processing method
- the image processing method includes:
- the image processing method in the embodiment of the present application can be implemented by the electronic device 100 in the embodiment of the present application.
- the electronic device 100 includes a processor 10, and the processor 10 is configured to obtain a grayscale histogram of the reference image, and to determine a first tone mapping curve based on human vision according to the grayscale histogram, and to determine a first tone mapping curve based on the grayscale
- the degree histogram determines a second tone-mapping curve, and is used to determine a target tone-mapping curve based on the first tone-mapping curve and the second tone-mapping curve, and is used to process the image to be processed according to the target tone-mapping curve to obtain a high dynamic range image .
- the first tone mapping curve based on human vision is determined according to the grayscale histogram
- the second tone mapping curve is determined according to the grayscale histogram
- the first tone mapping curve and The second tone mapping curve determines the target tone mapping curve. Therefore, using the target tone mapping curve to process the image to be processed can improve the brightness of the dark part of the image and avoid the loss of details in the highlight part based on human vision, thereby improving the dynamic image of the image to be processed. range for high dynamic range images.
- the electronic device 100 may include a smartphone, a camera, a tablet computer, a notebook computer, a smart home appliance, a game console, a smart wearable device, and the like.
- the reference image includes the image to be processed or a frame image preceding the image to be processed.
- the target tone mapping curve is determined from the image to be processed, and then the image to be processed is processed according to the target tone mapping curve to obtain a high dynamic range image.
- the high dynamic range image obtained in this way has a better visual effect.
- the target tone mapping curve is determined by the image of the previous frame of the image to be processed, and then the image to be processed is processed according to the target tone mapping curve to obtain a high dynamic range image, which can improve the The processing speed of the image reduces the delay, so that the high dynamic range image can be obtained faster.
- the grayscale histogram of the reference image can describe the distribution of grayscale in the reference image.
- the image to be processed may be a captured image acquired in real time, or an image retrieved from an image library.
- the first tone-mapping curve and the second tone-mapping curve may refer to curves capable of adjusting the relative lightness and darkness of an image.
- the first tone mapping curve is used to process the image to be processed, so that the brightness of the dark part of the image to be processed is slightly improved, and the highlight part of the image to be processed will not be overexposed. Further, the second tone mapping is used.
- the curve processes the to-be-processed image to enhance the brightness of the to-be-processed image as a whole to obtain a high dynamic range image, so that in a high dynamic range image, the brightness of the dark part of the image is improved and the details of the highlight part of the image are not lost.
- the target tone mapping curve is used to process the image to be processed, and the obtained high dynamic range image has better visual effects.
- the grayscale of each pixel in the image to be processed is sequentially input into the function to calculate the function value, and the obtained function is obtained. value as the grayscale of the corresponding pixel in the high dynamic range image.
- a tone mapping table is created according to the target tone mapping curve, and the tone mapping table includes the corresponding relationship between the grayscale before the mapping and the grayscale after the mapping, so as to obtain the to-be-processed
- the high dynamic range image corresponding to the image to be processed can be determined by looking up the tone mapping table.
- the image processing method further includes: using a first algorithm to process the reference image and the to-be-processed image, where the first algorithm includes bad pixel correction (Defect pixel correction, DPC), Black Level Correction (BLC), Lens Shading Correction (LSC), Noise Reduction (NR), Automatic White Balance (AWB), Bayer Demosaic , Color Correction Matrix (CCM), Gamma (Gamma) correction.
- Step 01 can be understood as Hist Bin.
- Step 03, Step 05 and Step 07 can be understood as GenLut.
- Step 09 can be understood as GTM.
- the image processing method further includes: using a second algorithm to process the high dynamic range image and output the processed image, where the second algorithm includes color space conversion (CSC), chroma processing (chroma Processing), luminance Processing (Luma Processing).
- step 01 includes:
- 011 Obtain the pixel ratio of each grayscale in the reference image as a grayscale histogram
- Step 03 includes:
- the image processing method in the above embodiment can be implemented by the electronic device 100 in the embodiment of the present application.
- the processor 10 is configured to obtain the pixel ratio of each grayscale in the reference image as a grayscale histogram, and to determine the mapped brightness according to the pixel ratio, and to determine the first tone mapping curve according to the mapped brightness.
- the first tone mapping curve based on human vision can be determined according to the pixel ratio of each grayscale in the reference image.
- the pixel ratio of the grayscale in the reference image that is, the ratio of the number of pixels with a certain grayscale in the reference image to the total number of pixels in the reference image.
- the grayscale histogram can be obtained by separately obtaining the ratio of the number of pixels with each grayscale in the reference image to the total number of pixels in the reference image.
- the mapping brightness that is, the output grayscale obtained after the grayscale of the input grayscale histogram is linearly transformed.
- the first tone-mapping curve may be a Reinhard-based tone-mapping curve.
- the first tone mapping curve is: Wherein, y 1 is the mapping value determined according to the first tone mapping curve, y' is the mapping brightness, ⁇ is a constant, and power( ⁇ , 2) is ⁇ 2 .
- the brightness of the dark part of the image to be processed can be slightly improved, and at the same time, the highlight part of the image to be processed will not be overexposed.
- ⁇ is used to control the highlight part in the image to be processed, and the value range of ⁇ can be [10, 128], for example, ⁇ can be between 10, 20, 40, 60, 80, 100, 128, or 10-128 other values.
- beta is 128. In this way, when the image to be processed belongs to a night scene, a better effect can be obtained by using the first tone mapping curve to process the image to be processed.
- step 031 includes:
- 0313 Determine the first adaptive parameter according to the maximum grayscale, the minimum grayscale and the average brightness in the reference image
- the image processing method in the above embodiment can be implemented by the electronic device 100 in the embodiment of the present application.
- the processor 10 is configured to determine the average brightness according to the pixel ratio, and to determine the first adaptive parameter according to the maximum grayscale, the minimum grayscale and the average brightness in the reference image, and to determine the first adaptive parameter according to the average brightness and the first The adaptive parameter determines the mapped brightness.
- the mapped luminance of the grayscale of the input grayscale histogram can be obtained relatively accurately.
- the average brightness can be understood as the ratio of the grayscale sum of all pixels in the reference image to the total number of pixels.
- the average brightness is: Among them, Yw is the average brightness, m is the number of pixels in the width direction of the reference image, n is the number of pixels in the height direction of the reference image, rk is each grayscale, k is the level of each grayscale, pdf( r k ) is the pixel ratio of the corresponding gray level. In this way, the average brightness of the reference image in the log domain can be determined.
- the value range of k is [1, 256]
- the value range of rk is [0, 255]
- n k is the number of pixels with grayscale r k in the reference image
- m is the number of pixels in the width direction of the reference image
- n is the number of pixels in the height direction of the reference image.
- the mapped luminance is: Among them, y ' is the mapped brightness, Yw is the average brightness, ⁇ is the first adaptive parameter, rk is each grayscale, and k is the level of each grayscale. In this way, the mapped brightness can be determined from the average brightness and the first adaptation parameter.
- step 01 includes:
- 013 Obtain the pixel ratio of each grayscale in the reference image as a grayscale histogram
- 015 Determine the cumulative distribution function of each gray level according to the pixel ratio, wherein the cumulative distribution function is obtained from the gray level of 0 to the cumulative summation of the pixel ratio corresponding to each gray level;
- Step 05 includes:
- the image processing method in the above embodiment can be implemented by the electronic device 100 in the embodiment of the present application.
- the processor 10 is used to obtain the pixel ratio of each grayscale in the reference image as a grayscale histogram, and to determine the cumulative distribution function of each grayscale according to the pixel ratio, wherein the cumulative distribution function is determined from the grayscale It is obtained by accumulating and summing the proportions of pixels corresponding to 0 to each grayscale, and is used to determine the second adaptive parameter according to the cumulative distribution function, and is used to determine the second tone mapping according to the first tone mapping curve and the second adaptive parameter. curve.
- the second tone mapping curve can be determined from the grayscale histogram.
- the value range of a is (0,1), for example, a may be 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 or other values between 0-1.
- a has a value of 0.5. In this way, the second adaptive parameter d has a better value.
- the second tone mapping curve is:
- y 2 is the second tone mapping curve
- y 1 is the mapping value determined according to the first tone mapping curve
- d is the second adaptive parameter.
- the second tone mapping curve y 2 can be understood as a tone mapping curve based on adaptive ⁇
- 1+d can be understood as ⁇ in the tone mapping curve based on adaptive ⁇ . Therefore, when 1+d is greater than 1, That is, if ⁇ is greater than 1, using the second tone mapping curve to process the image to be processed can improve the overall brightness of the image to be processed.
- step 07 includes:
- 071 Determine a target tone mapping curve according to the first weight, the second weight, the first tone mapping curve and the second tone mapping curve.
- the image processing method in the above embodiment can be implemented by the electronic device 100 in the embodiment of the present application.
- the processor 10 is configured to determine the target tone mapping curve according to the first weight, the second weight, the first tone mapping curve and the second tone mapping curve.
- the first tone-mapping curve and the second tone-mapping curve can be better fused to obtain the target tone-mapping curve.
- the first weight and the second weight may be constants.
- the first weight may be the weight of the first tone-mapping curve
- the second weight may be the weight of the second tone-mapping curve; or, the first weight may be the second
- the weight of the tone mapping curve, the second weight may be the weight of the first tone mapping curve, which is not limited herein.
- the obtained high dynamic range image has better visual effect.
- first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, features delimited with “first”, “second” may expressly or implicitly include at least one of said features. In the description of the present application, “plurality” means at least two, such as two, three, unless expressly and specifically defined otherwise.
- any description of a process or method in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a specified logical function or step of the process , and the scope of the preferred embodiments of the present application includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present application belong.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
Abstract
一种图像处理方法及电子设备(100)。图像处理方法包括:获取参考图像的灰度直方图;根据所述灰度直方图确定基于人眼视觉的第一色调映射曲线;根据所述灰度直方图确定第二色调映射曲线;根据所述第一色调映射曲线和所述第二色调映射曲线确定目标色调映射曲线;根据所述目标色调映射曲线对待处理图像进行处理以得到高动态范围图像。
Description
本申请涉及图像处理技术领域,特别涉及一种图像处理方法及电子设备。
在相关技术中,随着图像处理技术及计算机摄影学技术的不断发展,高动态范围成像需求日益增加。然而CCD/CMOS等传感器的动态范围有限,会使得高动态范围图像出现亮度溢出等问题。如何提高图像暗部的亮度并且避免高光部分的细节丢失,是本领域亟需解决的技术问题。
发明内容
本申请的实施方式提供一种图像处理方法及电子设备。
本申请实施方式的图像处理方法包括:获取参考图像的灰度直方图;根据所述灰度直方图确定基于人眼视觉的第一色调映射曲线;根据所述灰度直方图确定第二色调映射曲线;根据所述第一色调映射曲线和所述第二色调映射曲线确定目标色调映射曲线;根据所述目标色调映射曲线对待处理图像进行处理以得到高动态范围图像。
上述实施方式的图像处理方法中,根据灰度直方图确定基于人眼视觉的第一色调映射曲线,根据灰度直方图确定第二色调映射曲线,再根据第一色调映射曲线和第二色调映射曲线确定目标色调映射曲线,因此,利用目标色调映射曲线对待处理图像进行处理,能够基于人眼视觉来提高图像暗部的亮度并且避免高光部分的细节丢失,从而提高待处理图像的动态范围以得到高动态范围图像。
本申请实施方式的电子设备包括处理器。所述处理器用于:获取参考图像的灰度直方图;根据所述灰度直方图确定基于人眼视觉的第一色调映射曲线;根据所述灰度直方图确定第二色调映射曲线;根据所述第一色调映射曲线和所述第二色调映射曲线确定目标色调映射曲线;根据所述目标色调映射曲线对待处理图像进行处理以得到高动态范围图像。
上述实施方式的电子设备中,根据灰度直方图确定基于人眼视觉的第一色调映射曲线,根据灰度直方图确定第二色调映射曲线,再根据第一色调映射曲线和第二色调映射曲线确定目标色调映射曲线,因此,利用目标色调映射曲线对待处理图像进行处理,能够基于人眼视觉来提高图像暗部的亮度并且避免高光部分的细节丢失,从而提高待处理图像的动态范围以得到高动态范围图像。
本申请的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显, 或通过本申请的实践了解到。
本申请的上述和/或附加的方面和优点可以从结合下面附图对实施方式的描述中将变得明显和容易理解,其中:
图1是本申请实施方式的图像处理方法的流程示意图;
图2是本申请实施方式的电子设备的示意图;
图3是本申请实施方式的图像处理方法的场景示意图;
图4是本申请实施方式的图像处理方法的流程示意图;
图5是本申请实施方式的图像处理方法的流程示意图;
图6是本申请实施方式的图像处理方法的流程示意图;
图7是本申请实施方式的图像处理方法的流程示意图。
下面详细描述本申请的实施方式,实施方式的示例在附图中示出,其中,相同或类似的标号自始至终表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性的,仅用于解释本申请,而不能理解为对本申请的限制。
在本申请的实施方式的描述中,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个所述特征。在本申请的实施方式的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
请参阅图1和图2,本申请提供一种图像处理方法,图像处理方法包括:
01:获取参考图像的灰度直方图;
03:根据灰度直方图确定基于人眼视觉的第一色调映射曲线;
05:根据灰度直方图确定第二色调映射曲线;
07:根据第一色调映射曲线和第二色调映射曲线确定目标色调映射曲线;
09:根据目标色调映射曲线对待处理图像进行处理以得到高动态范围图像。
本申请实施方式的图像处理方法可由本申请实施方式中的电子设备100实现。具体地,电子设备100包括处理器10,处理器10用于获取参考图像的灰度直方图,及用于根据灰度直方图确定基于人眼视觉的第一色调映射曲线,及用于根据灰度直方图确定第二色调映射曲线,及用于根据第一色调映射曲线和第二色调映射曲线确定目标色调映射曲线,及用于根据目标色调映射曲线对待处理图像进行处理以得到高动态范围图像。
上述实施方式的图像处理方法及电子设备100中,根据灰度直方图确定基于人眼视觉的第一色调映射曲线,根据灰度直方图确定第二色调映射曲线,再根据第一色调映射曲线和第二色调映射曲线确定目标色调映射曲线,因此,利用目标色调映射曲线对待处理图像进行处理,能够基于人眼视觉来提高图像暗部的亮度并且避免高光部分的细节丢失,从而提高待处理图像的动态范围以得到高动态范围图像。
具体地,电子设备100可包括智能手机、相机、平板电脑、笔记本电脑、智能家电、游戏机、智能可穿戴设备等。在某些实施方式中,参考图像包括待处理图像或待处理图像的前一帧图像。当参考图像为待处理图像时,通过待处理图像确定目标色调映射曲线,进而根据目标色调映射曲线对待处理图像进行处理以得到高动态范围图像,这样得到的高动态范围图像的视觉效果更好。当参考图像为待处理图像的前一帧图像时,通过待处理图像的前一帧图像确定目标色调映射曲线,进而根据目标色调映射曲线对待处理图像进行处理以得到高动态范围图像,这样能够提高图像的处理速度,减少时延,从而更快地获得高动态范围图像。参考图像的灰度直方图能够描述参考图像中灰度的分布情况。
进一步地,待处理图像可以是实时获取到的拍摄的图像,也可以是从图像库中调取的图像。第一色调映射曲线和第二色调映射曲线可以是指能够调整图像的相对明暗程度的曲线。在某些实施方式中,通过采用第一色调映射曲线对待处理图像进行处理,使得待处理图像暗部的亮度得到小幅提升,同时待处理图像高光部分不至于过曝,进一步地,采用第二色调映射曲线对待处理图像进行处理,整体提升待处理图像的亮度,得到高动态范围图像,从而在高动态范围图像中,图像暗部的亮度得到提高并且图像高光部分的细节未丢失。在一个例子中,当待处理图像为夜晚场景时,采用目标色调映射曲线对待处理图像进行处理,得到的高动态范围图像具有较好的视觉效果。
需要指出的是,在某些实施方式中,在确定目标色调映射曲线之后,根据目标色调映射曲线对应的函数,将待处理图像中每个像素的灰度依次输入函数计算函数值,得到的函数值作为高动态范围图像中对应像素的灰度。在某些实施方式中,在确定目标色调映射曲线之后,根据目标色调映射曲线制作色调映射表,色调映射表中包括映射前的灰度与映射后的灰度的对应关系,从而在获得待处理图像之后,可通过查找色调映射表的方式,确定与待处理图像对应的高动态范围图像。
请参阅图3,在某些实施方式中,在步骤01之前,图像处理方法还包括:采用第一算法处理参考图像和待处理图像,第一算法包括坏点补偿(Defect pixel correction,DPC)、黑电平校正(Black Level Correction,BLC)、镜头阴影校正(lens shading correction、LSC)、降噪(noise reduction,NR)、自动白平衡(Automatic White Balance,AWB)、拜耳颜色插值(Bayer Demosaic)、颜色校正(Color Correction Matrix,CCM)、伽马(Gamma)校正。 步骤01可以理解为Hist Bin。步骤03、步骤05和步骤07可以理解为GenLut。步骤09可以理解为GTM。在步骤09之后,图像处理方法还包括:采用第二算法处理高动态范围图像并输出处理后的图像,第二算法包括色彩转换(color space convert,CSC)、色度处理(chroma Processing)、亮度处理(Luma Processing)。
请参阅图4,在某些实施方式中,步骤01包括:
011:获取参考图像中各个灰度的像素占比以作为灰度直方图;
步骤03包括:
031:根据像素占比确定映射亮度;
033:根据映射亮度确定第一色调映射曲线。
上述实施方式的图像处理方法可由本申请实施方式中的电子设备100实现。具体地,处理器10用于获取参考图像中各个灰度的像素占比以作为灰度直方图,及用于根据像素占比确定映射亮度,及用于根据映射亮度确定第一色调映射曲线。
如此,能够根据参考图像中各个灰度的像素占比确定基于人眼视觉的第一色调映射曲线。
具体地,参考图像中灰度的像素占比,即就是,参考图像中具有某一灰度的像素的个数与参考图像的总像素个数的比值。分别获取参考图像中具有各个灰度的像素的个数与参考图像的总像素个数的比值即可获得灰度直方图。映射亮度,即就是,输入灰度直方图的灰度经过线性变换后得到的输出灰度。第一色调映射曲线可为基于Reinhard的色调映射曲线。
如此,采用第一色调映射曲线对待处理图像进行处理,能够使得待处理图像暗部的亮度得到小幅提升,同时待处理图像高光部分不至于过曝。
具体地,β用于控制待处理图像中的高光部分,β的取值范围可为[10,128],例如,β可为10、20、40、60、80、100、128或者10-128之间的其它数值。在某些实施方式中,β为128。如此,当待处理图像属于夜晚场景时,采用第一色调映射曲线处理待处理图像可以获得较好的效果。
请参阅图5,在某些实施方式中,步骤031包括:
0311:根据像素占比确定平均亮度;
0313:根据参考图像中的最大灰度、最小灰度和平均亮度确定第一自适应参数;
0315:根据平均亮度和第一自适应参数确定映射亮度。
上述实施方式的图像处理方法可由本申请实施方式中的电子设备100实现。具体地,处理器10用于根据像素占比确定平均亮度,及用于根据参考图像中的最大灰度、最小灰度和平均亮度确定第一自适应参数,及用于根据平均亮度和第一自适应参数确定映射亮度。
如此,能够较为准确地获得输入灰度直方图的灰度的映射亮度。
具体地,在步骤0311中,平均亮度,可以理解为,参考图像中所有像素的灰度和与总像素的个数的比值。在某些实施方式中,平均亮度为:
其中,Y
w为平均亮度,m为参考图像宽度方向的像素个数,n为参考图像高度方向的像素个数,r
k为各个灰度,k为各个灰度所处的级数,pdf(r
k)为对应灰度的像素占比。如此,能够确定参考图像在log域的平均亮度。具体地,k的取值范围为[1,256],r
k的取值范围为[0,255],k和r
k均为整数,当k=1时,r
1=0;当k=2时,r
2=1;...;当k=256时,r
256=255。
其中,n
k为参考图像中具有灰度r
k的像素的个数,m为参考图像宽度方向的像素个数,n为参考图像高度方向的像素个数。
在步骤0313中,在某些实施方式中,第一自适应参数为:α=0.18×4
lum,lum为自适应因子,
其中,Y
w为平均亮度,r
k_max为最大灰度,r
k_min为最小灰度。如此,能够根据参考图像中的平均亮度、最大灰度和最小灰度确定第一自适应参数。
在步骤0315中,在某些实施方式中,映射亮度为:
其中,y′为映射亮度,Y
w为平均亮度,α为第一自适应参数,r
k为各个灰度,k为各个灰度所处的级数。如此,能够根据平均亮度和第一自适应参数确定映射亮度。
请参阅图6,在某些实施方式中,步骤01包括:
013:获取参考图像中各个灰度的像素占比以作为灰度直方图;
015:根据像素占比确定各个灰度的累积分布函数,其中,累积分布函数从灰度为0到各个灰度对应的像素占比累积求和获得;
步骤05包括:
051:根据累积分布函数确定第二自适应参数;
053:根据第一色调映射曲线和第二自适应参数确定第二色调映射曲线。
上述实施方式的图像处理方法可由本申请实施方式中的电子设备100实现。具体地,处理器10用于获取参考图像中各个灰度的像素占比以作为灰度直方图,及用于根据像素占比确定各个灰度的累积分布函数,其中,累积分布函数从灰度为0到各个灰度对应的像素占比累积求和获得,及用于根据累积分布函数确定第二自适应参数,及用于根据第一色调映射曲线和第二自适应参数确定第二色调映射曲线。
如此,能够根据灰度直方图确定第二色调映射曲线。
具体地,在步骤015中,在某些实施方式中,累积分布函数可由以下公式表示:
其中,r
k表示各个灰度,cdf(r
k)为对应灰度的累积分布函数,pdf(i)为对应灰度的像素占比,即cdf(0)=pdf(0),cdf(1)=pdf(0)+pdf(1),cdf(255)=pdf(0)+ pdf(1)+...+pdf(255)。
在步骤051中,在某些实施方式中,第二自适应参数为:d=(g-cdf(r
k+1))*a;-0.5<d<0.5,其中,
r
k为各个灰度,k为各个灰度所处的级数,cdf为累积分布函数,a为常数。如此,可以获得较为合理的第二自适应参数。具体地,a的取值范围为(0,1),例如,a可为0.1、0.2、0.3、0.4、0.5、0.6、0.7、0.8、0.9或者0-1之间的其它数值。在某些实施方式中,a的取值为0.5。如此,第二自适应参数d具有较好的取值。
在步骤053中,在某些实施方式中,第二色调映射曲线为:
其中,y
2为第二色调映射曲线,y
1为根据第一色调映射曲线确定的映射值,d为第二自适应参数。如此,采用第二色调映射曲线对待处理图像进行处理,能够整体提升待处理图像的亮度。具体地,第二色调映射曲线y
2可以理解为基于自适应γ的色调映射曲线,1+d可以理解为基于自适应γ的色调映射曲线中的γ,因此,当1+d大于1时,即就是,γ大于1,采用第二色调映射曲线处理待处理图像,可以提升待处理图像的整体亮度。
请参阅图7,在某些实施方式中,步骤07包括:
071:根据第一权重、第二权重、第一色调映射曲线和第二色调映射曲线确定目标色调映射曲线。
上述实施方式的图像处理方法可由本申请实施方式中的电子设备100实现。具体地,处理器10用于根据第一权重、第二权重、第一色调映射曲线和第二色调映射曲线确定目标色调映射曲线。
如此,可以较好地融合第一色调映射曲线和第二色调映射曲线并得到目标色调映射曲线。
具体地,第一权重和第二权重可为常数。在融合第一色调映射曲线和第二色调映射曲线时,第一权重可为第一色调映射曲线的权重,第二权重可为第二色调映射曲线的权重;或者,第一权重可为第二色调映射曲线的权重,第二权重可为第一色调映射曲线的权重,在此不作限定。
在某些实施方式中,目标色调映射曲线为:y=w
1*y
1+w
2*y
2,其中,w
1为第一权重,y
1为根据第一色调映射曲线确定的映射值,w
2为第二权重,y
2为第二色调映射曲线。
如此,利用目标色调映射曲线对待处理图像进行处理,能够获得图像暗部的亮度得到提高并且图像高光部分的细节未丢失的高动态范围图像。
具体地,在某些实施方式中,w
1=w
2=1,即y=y
1+y
2。如此,得到的高动态范围图像具有较好的视觉效果。
在本说明书的描述中,参考术语“一个实施方式”、“一些实施方式”、“示意性实施方式”、“示例”、“具体示例”或“一些示例”等的描述意指结合所述实施方式或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施方式或示例中。在本说明书中,对上述术 语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个所述特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个,除非另有明确具体的限定。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。
尽管上面已经示出和描述了本申请的实施方式,可以理解的是,上述实施方式是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施方式进行变化、修改、替换和变型。
Claims (26)
- 一种图像处理方法,其特征在于,所述图像处理方法包括:获取参考图像的灰度直方图;根据所述灰度直方图确定基于人眼视觉的第一色调映射曲线;根据所述灰度直方图确定第二色调映射曲线;根据所述第一色调映射曲线和所述第二色调映射曲线确定目标色调映射曲线;根据所述目标色调映射曲线对待处理图像进行处理以得到高动态范围图像。
- 根据权利要求1所述的图像处理方法,其特征在于,所述获取参考图像的灰度直方图,包括:获取所述参考图像中各个灰度的像素占比以作为所述灰度直方图;所述根据所述灰度直方图确定基于人眼视觉的第一色调映射曲线,包括:根据所述像素占比确定映射亮度;根据所述映射亮度确定所述第一色调映射曲线。
- 根据权利要求2所述的图像处理方法,其特征在于,所述根据所述像素占比确定映射亮度,包括:根据所述像素占比确定平均亮度;根据所述参考图像中的最大灰度、最小灰度和所述平均亮度确定第一自适应参数;根据所述平均亮度和所述第一自适应参数确定所述映射亮度。
- 根据权利要求1所述的图像处理方法,其特征在于,所述获取参考图像的灰度直方图,包括:获取所述参考图像中各个灰度的像素占比以作为所述灰度直方图;根据所述像素占比确定各个灰度的累积分布函数,其中,所述累积分布函数从灰度为0到各个灰度对应的所述像素占比累积求和获得;所述根据所述灰度直方图确定第二色调映射曲线,包括:根据所述累积分布函数确定第二自适应参数;根据所述第一色调映射曲线和所述第二自适应参数确定所述第二色调映射曲线。
- 根据权利要求1所述的图像处理方法,其特征在于,所述根据所述第一色调映射曲线和所述第二色调映射曲线确定目标色调映射曲线,包括:根据第一权重、第二权重、所述第一色调映射曲线和所述第二色调映射曲线确定所述目标色调映射曲线。
- 根据权利要求11所述的图像处理方法,其特征在于,所述目标色调映射曲线为:y=w 1*y 1+w 2*y 2,其中,w 1为所述第一权重,y 1为根据所述第一色调映射曲线确定的映射值,w 2为所述第二权重,y 2为所述第二色调映射曲线。
- 根据权利要求1-12任意一项所述的图像处理方法,其特征在于,所述参考图像包括所述待处理图像或所述待处理图像的前一帧图像。
- 一种电子设备,其特征在于,所述电子设备包括处理器,所述处理器用于:获取参考图像的灰度直方图;根据所述灰度直方图确定基于人眼视觉的第一色调映射曲线;根据所述灰度直方图确定第二色调映射曲线;根据所述第一色调映射曲线和所述第二色调映射曲线确定目标色调映射曲线;根据所述目标色调映射曲线对待处理图像进行处理以得到高动态范围图像。
- 根据权利要求14所述的电子设备,其特征在于,所述处理器用于:获取所述参考图像中各个灰度的像素占比以作为所述灰度直方图;所述根据所述灰度直方图确定基于人眼视觉的第一色调映射曲线,包括:根据所述像素占比确定映射亮度;根据所述映射亮度确定所述第一色调映射曲线。
- 根据权利要求15所述的电子设备,其特征在于,所述处理器用于:根据所述像素占比确定平均亮度;根据所述参考图像中的最大灰度、最小灰度和所述平均亮度确定第一自适应参数;根据所述平均亮度和所述第一自适应参数确定所述映射亮度。
- 根据权利要求14所述的电子设备,其特征在于,所述处理器用于:获取所述参考图像中各个灰度的像素占比以作为所述灰度直方图;根据所述像素占比确定各个灰度的累积分布函数,其中,所述累积分布函数从灰度为0到各个灰度对应的所述像素占比累积求和获得;所述根据所述灰度直方图确定第二色调映射曲线,包括:根据所述累积分布函数确定第二自适应参数;根据所述第一色调映射曲线和所述第二自适应参数确定所述第二色调映射曲线。
- 根据权利要求14所述的电子设备,其特征在于,所述处理器用于:根据第一权重、第二权重、所述第一色调映射曲线和所述第二色调映射曲线确定所述目标色调映射曲线。
- 根据权利要求24所述的电子设备,其特征在于,所述目标色调映射曲线为:y=w 1*y 1+w 2*y 2,其中,w 1为所述第一权重,y 1为根据所述第一色调映射曲线确定的映射值,w 2为所述第二权重,y 2为所述第二色调映射曲线。
- 根据权利要求14-25任意一项所述的电子设备,其特征在于,所述参考图像包括所 述待处理图像或所述待处理图像的前一帧图像。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2021/091108 WO2022226917A1 (zh) | 2021-04-29 | 2021-04-29 | 图像处理方法及电子设备 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2021/091108 WO2022226917A1 (zh) | 2021-04-29 | 2021-04-29 | 图像处理方法及电子设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022226917A1 true WO2022226917A1 (zh) | 2022-11-03 |
Family
ID=83846587
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/091108 WO2022226917A1 (zh) | 2021-04-29 | 2021-04-29 | 图像处理方法及电子设备 |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2022226917A1 (zh) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090295705A1 (en) * | 2008-05-29 | 2009-12-03 | Min Chen | LCD Backlight Dimming, LCD / Image Signal Compensation and method of controlling an LCD display |
CN108496356A (zh) * | 2015-06-02 | 2018-09-04 | 三星电子株式会社 | 用于色调映射的方法和设备 |
CN110602472A (zh) * | 2018-06-13 | 2019-12-20 | 上海富瀚微电子股份有限公司 | 一种基于直方图和引导滤波的局部色调映射方法及装置 |
US20200219238A1 (en) * | 2020-03-18 | 2020-07-09 | Intel Corporation | Brightness and contrast enhancement for video |
-
2021
- 2021-04-29 WO PCT/CN2021/091108 patent/WO2022226917A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090295705A1 (en) * | 2008-05-29 | 2009-12-03 | Min Chen | LCD Backlight Dimming, LCD / Image Signal Compensation and method of controlling an LCD display |
CN108496356A (zh) * | 2015-06-02 | 2018-09-04 | 三星电子株式会社 | 用于色调映射的方法和设备 |
CN110602472A (zh) * | 2018-06-13 | 2019-12-20 | 上海富瀚微电子股份有限公司 | 一种基于直方图和引导滤波的局部色调映射方法及装置 |
US20200219238A1 (en) * | 2020-03-18 | 2020-07-09 | Intel Corporation | Brightness and contrast enhancement for video |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9113114B2 (en) | Apparatus and method for automatically controlling image brightness in image photographing device | |
US8208039B2 (en) | Image processing apparatus and computer-readable medium | |
JP5677113B2 (ja) | 画像処理装置 | |
CN112565636B (zh) | 图像处理方法、装置、设备和存储介质 | |
US20060215908A1 (en) | Image pickup apparatus and image processing method | |
US8059187B2 (en) | Image capturing apparatus | |
JP6097588B2 (ja) | 画像処理装置及び画像処理方法 | |
JP6824817B2 (ja) | 画像処理装置および画像処理方法 | |
JP2014153959A (ja) | 画像処理装置及び画像処理方法、プログラム、記憶媒体 | |
CN111565261B (zh) | 图像处理方法、装置及电子设备 | |
JP2015154102A (ja) | 画像処理装置及び方法、画像処理プログラム、撮像装置 | |
KR101754425B1 (ko) | 이미지 촬영 장치의 밝기를 자동으로 조절하는 장치 및 방법 | |
JP5149055B2 (ja) | 撮像装置 | |
US7289666B2 (en) | Image processing utilizing local color correction and cumulative histograms | |
JP2009004966A (ja) | 撮像装置 | |
KR20120122574A (ko) | 디지털 카메라 장치에서 영상 처리 장치 및 방법 | |
JP5791274B2 (ja) | 画像処理装置、方法及びプログラム | |
WO2022226917A1 (zh) | 图像处理方法及电子设备 | |
JP2017135554A (ja) | 画像処理装置、画像処理方法、及びプログラム | |
JP2013179485A (ja) | 画像処理装置及びその制御方法 | |
US11678060B2 (en) | Apparatus, method for controlling apparatus, and storage medium | |
JP6397261B2 (ja) | 画像処理装置及び方法 | |
CN114125408A (zh) | 图像处理方法及装置、终端和可读存储介质 | |
KR101710629B1 (ko) | 촬상 장치 및 촬상 방법 | |
JP2012205031A (ja) | 画像信号処理装置 |
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: 21938396 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: 21938396 Country of ref document: EP Kind code of ref document: A1 |