WO2015172340A1 - 数码影像的动态对比度调整方法和*** - Google Patents

数码影像的动态对比度调整方法和*** Download PDF

Info

Publication number
WO2015172340A1
WO2015172340A1 PCT/CN2014/077520 CN2014077520W WO2015172340A1 WO 2015172340 A1 WO2015172340 A1 WO 2015172340A1 CN 2014077520 W CN2014077520 W CN 2014077520W WO 2015172340 A1 WO2015172340 A1 WO 2015172340A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
cdf
contrast
function
unit
Prior art date
Application number
PCT/CN2014/077520
Other languages
English (en)
French (fr)
Inventor
曹子晟
梁泰文
王铭钰
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2014/077520 priority Critical patent/WO2015172340A1/zh
Publication of WO2015172340A1 publication Critical patent/WO2015172340A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement

Definitions

  • the present invention relates to the field of digital imaging, and in particular to a method and system for adjusting dynamic contrast of a digital image. Background technique
  • Contrast refers to the measurement of different brightness levels between the brightest white and the darkest black in the image. The larger the difference, the greater the contrast. Because the dynamic range of the actual scene is often
  • the sensor components used in traditional digital cameras generally only have a dynamic range of about 60dB, which makes the camera's metering system subject to high or low brightness, compressing other areas of quantization.
  • the number of gray levels causes the overall contrast to drop and the details to be lost.
  • the technical problem to be solved by the present invention is to provide a dynamic contrast adjustment method and system for digital images, which can effectively control and enhance contrast according to the histogram distribution of the current scene.
  • the present invention provides a dynamic contrast adjustment method for a digital image, which includes the following steps:
  • the calculating a pixel luminance value probability cumulative distribution function cdf of the image including: calculating a luminance histogram of the image, obtaining a probability density function pdf(.), and calculating a probability density function P df by using the following relation ( Index normalization:
  • p ⁇ df(Zi i )' ( vma P x d / ⁇ p(df(-)r ⁇ -m n ⁇ i P nr ⁇ p ri df(-) ⁇ ) a , a is an exponential factor;
  • the probability cumulative distribution function is calculated using the following relationship:
  • the method further includes the steps of: performing a flash avoidance process on the image.
  • the performing the shuffling process on the image includes:
  • the performing the shuffling process on the image includes:
  • the inter-frame smoothing method is adopted, and the following relation is used: Z ⁇ ccZi + CL - c fft) , and the image is evaded, wherein a is an inter-frame smoothing factor, and f is a gray-scale mapping function.
  • the present invention provides a dynamic contrast adjustment system for digital images, the system comprising:
  • a reading unit for reading an image in one image or video
  • the output pixel value of Ei, f (which is a linear function, 1 ⁇ 4 is the luminance value, is one of the three color channels of RGB.
  • the system further includes a probability density calculation unit and a normalization unit, wherein the probability density calculation unit is configured to calculate a luminance histogram of the image to obtain a probability density function pdf(.), the normalization
  • the unit uses the following relational expression to calculate the exponential normalization of the probability density function pdf(.):
  • the normalization unit normalizes the probability density function pdf(.) using the following relationship:
  • the probability cumulative distribution calculation unit calculates a probability cumulative distribution function using the following relationship:
  • system further comprises a parameter adjustment unit for adjusting the exponential factor a to control the intensity of the contrast enhancement.
  • the system further includes a spoofing processing unit, where the spoofing processing unit is used to avoid video playback and the problem of flickering of the screen caused by real-time adjustment.
  • DRAWINGS 1 is a schematic flow chart of a method for adjusting a dynamic contrast of a digital image according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram showing a comparison of effects before and after a method for adjusting a dynamic image of a digital image according to an embodiment of the present invention
  • Fig. 3 is a block diagram showing a dynamic contrast adjustment system for a digital image according to an embodiment of the present invention. detailed description
  • FIG. 1 is a schematic flowchart of a method for adjusting a dynamic contrast of a digital image according to an embodiment of the present invention.
  • the dynamic contrast adjustment method of the digital image includes the following steps:
  • the calculated luminance histogram that is, the probability density function pdf (refers to the number of occurrences of pixels corresponding to the gray level in I, forming a distribution of pixel values in I over the entire luminance dynamic range.
  • Xi represents an arbitrary gray level.
  • I ( x , y ) represents the luminance value of the pixel at coordinates (x, y).
  • l (x, y) Xi ⁇ .
  • the luminance dynamic range refers to a range in which all possible luminance values determined by the number of bits of the pixel value in I occur. If the pixel value is a k-bit number, the dynamic range is 0 to 2 k -l. In this embodiment, considering an 8-bit image, the dynamic range is 0 to 255.
  • the function pdf is used (the normalized distribution:
  • the probability cumulative distribution function is calculated by using the following relation:
  • step S103 can also be omitted, and the probability cumulative distribution function cdf ( directly calculated) is not limited to the embodiment.
  • the entire digital image that is, each pixel of the image I, is traversed.
  • the image is an RGB color image
  • the luminance value Y is obtained
  • the new color pixel value is calculated using the relation f c + Kdf ⁇ .
  • the relational value ⁇ ⁇ + ⁇ is used to calculate the grayscale map value as the new pixel value.
  • inter-frame smoothing method can also be adopted to avoid the problem of flickering of the picture caused by real-time adjustment. If the following relationship is used: Z ⁇ aZi + CL The image is shimmered, where a is the inter-frame smoothing factor and f is the gray-scale mapping function.
  • step S103 may be omitted; if the computing resources are sufficient, the embodiment employs step S103 to control the strength of the contrast enhancement. If the contrast enhancement is performed only for a single frame picture, step S106 is not necessary, and if the contrast is increased for the video, step S107 can effectively avoid the picture flicker. It is not limited to this embodiment.
  • FIG. 3 is a schematic structural diagram of a dynamic contrast adjustment system for a digital image according to an embodiment of the present invention.
  • the adjustment system 20 includes: a reading unit 21, a probability density calculation unit 22, a normalization unit 23, a probability cumulative distribution calculation unit 24, and a contrast adjustment unit 25.
  • the reading unit 21 is configured to read a certain frame in an image or video and record it as I.
  • the probability density calculation unit 22 is connected to the reading unit 21, and the probability density calculation unit 22 is configured to calculate a luminance histogram of I to obtain a probability density function pdf(-) o the normalization unit 23 and the The probability density calculation unit 22 is connected, and the normalization unit 23 is used to calculate the exponential normalization of the probability density function pdf (and the probability density function pdf (normalized distribution.
  • the probability cumulative distribution calculation unit 24 and The normalization unit 23 is connected, and the probability cumulative distribution calculation unit 24 is configured to calculate a probability cumulative distribution function cdf(-) o.
  • the contrast adjustment unit 25 is connected to the probability cumulative distribution function calculation unit 24, the contrast
  • the calculated luminance histogram that is, the probability density function pdf (refers to the number of occurrences of pixels corresponding to the gray level in I, forming the distribution of the pixel values in I over the entire luminance dynamic range.
  • Xi represents an arbitrary gray level.
  • I ( x , y ) represents the luminance value of the pixel at coordinates (x, y).
  • l (x, y) Xi ⁇ .
  • the luminance dynamic range refers to a range in which all possible luminance values determined by the number of bits of the pixel value in I appear. If the pixel value is a k-bit number, the dynamic range is 0 to 2 k -l. In this embodiment, considering an 8-bit image, the dynamic range is 0 to 255.
  • the normalization unit 23 normalizes the probability density function pdf(.) by using the following relationship:
  • the probability cumulative distribution calculation unit 24 calculates a probability cumulative distribution function using the following relation:
  • the contrast adjustment unit 25 adopts the following grayscale mapping function.
  • Zi is normalized to 0 to 1, considering an 8-bit map ⁇ , then 0 ⁇ i ⁇ 255, quantized to 8 bits by a 255 multiplication factor.
  • the dynamic contrast adjustment system 20 in order to control the intensity of the contrast enhancement, the dynamic contrast adjustment system 20 further includes a parameter adjustment unit 26.
  • the parameter adjustment unit 26 and the contrast adjustment unit 25 performs an index normalization on the probability density function pdf(.) to correct the function C df(.) for better parameter adjustment.
  • the dynamic contrast adjustment system 20 further includes a scavenging processing unit 27.
  • the scintillation processing unit 27 is also associated with the contrast adjustment unit 25.
  • z; aZ i + (l - a)f(Zi)
  • the image of Figure 4 is shuffled, where a is the inter-frame smoothing factor and f) is the gray-scale mapping function.
  • the rate density calculation unit 22 and the normalization unit 23 may be omitted, and the reading unit 21 is directly connected to the probability cumulative distribution calculation unit 24, and the probability cumulative distribution calculation is performed.
  • the unit 24 directly obtains the probability cumulative distribution function, and is not limited to the embodiment.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combined or can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the components displayed as the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Can be selected according to actual needs Some or all of the units are selected to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention or the part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. Introduction ⁇ .

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

本发明公开了一种数码影像的动态对比度调整方法,其包括如下步骤:读取一幅图像或视频中的一帧图像;计算所述图像的像素亮度值概率累积分布函数cdf(·);当图像为灰阶图像时采用关系式:(I)对当前灰阶图像的对比度进行调整;当图像为彩色图像时,采用关系式:(II)对当前彩色图像的对比度进行调整,其中,Z i=f(E i),Z i为像素点在曝光亮度E i的输出像素值,f(·)是映射函数,Y i是亮度值,C i是RGB三个彩色通道中的一个通道。本发明还公开了一种数码影像的动态对比度调整***。

Description

数码影像的动态对比度调整方法和***
技术领域
本发明涉及数码影像领域, 特別是涉及一种数码影像的动态对比度 调整方法和***。 背景技术
对比度指的是图像中最亮的白色与最暗的黑色之间的不同亮度层 级的测量, 差异范围越大对比度越大。 由于实际场景的动态范围常常在
100dB 以上, 而传统数码相机所采用的传感器元件 (CCD或者 CMOS) 一般只能有大约 60dB 的动态范围, 这就使得相机的测光***受到高亮 或者低亮区的影响,压缩其他区域的量化灰阶数, 导致整体对比度下降, 细节丟失。
现有的图像对比度的增强可利用显示器的 Gamma (灰度系数)参数 来调整, 通过改变灰度信号与亮度的关系来调整图像对比度。 但单一对 比度设定并无法适用于所有图像。 举例来说, 对于一张整体亮度偏高的 图像, 使用者可能选择亮度大的 Gamma参数或是改变对比度的设定使 图像对比度增强, 但是这样的设定用于亮度较低的图像时, 会使图像低 亮度的部分太暗, 而失去细节使图像品^变差。 发明内容
本发明解决的技术问题是提供一种数码影像的动态对比度调整方 法和***, 能够有效地根据当前场景的直方图分布, 自适应地控制, 增 强对比度。
为解决上述技术问题, 本发明提供了一种数码影像的动态对比度调 整方法, 其包括如下步骤:
读取一幅图像或视频中的一帧图像; 计算所述图像的像素亮度值的概率累积分布函数 cdf(-); 当图像为灰阶图像时采用关系式: f( = z 1+Zi-cdf(Zi)) 对当前灰阶图像 的对比度进行调整; 当图像为彩色图像时, 采用关系式: ) = 41+^°^ 对当前彩色图像的对比度进行调整, 其中, Zi = f(Ei), Zi为像素点在曝光亮 度 Ei的输出像素值, f( 是映射函数, ¼是亮度值, 是 RGB 三个彩色通 道中的一个通道。
其中, 所述计算所述图像的像素亮度值概率累积分布函数 cdf( 包括: 计算所述图像的亮度直方图, 得到概率密度函数 pdf(.), 采用如下关 系式计算对概率密度函数 Pdf( 作指数归一化:
p Γdf(Zi i)' = ( vma Pxd/{p(df(-)r}-mn{iPnr{pridf(-)})a, a是指数因子;
采用如下关系式将概率密度函数 pdf(.)归一化分布:
Ddfrz.y' = Pdf(zi)'
采用如下关系式计算概率累积分布函数:
Figure imgf000004_0001
其中, 进一步包括步骤:
调节指数因子 a来控制对比度提升的强度。
其中, 进一步包括步骤: 对图像进行避闪处理。
其中, 所述对图像进行避闪处理包括:
采用对 cdf(-)限幅, 口果 Zi — cdf(Zi) > Γ(Ζ;) ,则 Zi - cdf(Zi) = Τ(Ζ;); 口果 Zi— cdf(Zi) < - r(Zi),则 Zi - cdf(Zi) = -T(Zi) , 其中 T(Zi)是与 Zi有关的阈值函数。
其中, 所述对图像进行避闪处理包括:
采用帧间平滑的方式, 采用如下关系式: Z^ ccZi + CL - c fft) , 对图像 进行避闪处理, 其中 a为帧间平滑因子, f( 是灰阶映射函数。
为解决上述技术问题, 本发明提供一种数码影像的动态对比度调整 ***, 所述***包括:
一读取单元, 用于读取一幅图像或视频中的一帧图像;
一概率累积分布计算单元, 用于计算所述图像的像素亮度值概率累 积分布函数 cdf(-) ; 一对比度调整单元, 当图像为灰阶图像时, 所述对比度调整单元采 用关系式: fft) : ?^2'-1^^ 对当前灰阶图像的对比度进行调整; 当图像 为彩色图像时, 所述对比度调整单元采用关系式: f(Ci)
Figure imgf000005_0001
对 当前彩色图像的对比度进行调整, 其中, Zi = f(Ei), Zi为像素点在曝光亮度
Ei的输出像素值, f( 是线性函数, ¼是亮度值, 是 RGB 三个彩色通道 中的一个通道。
其中, 所述***进一步包括一概率密度计算单元和一归一化单元, 所述概率密度计算单元用于计算所述图像的亮度直方图, 得到概率密度 函数 pdf(.), 所述归一化单元采用如下关系式计算对概率密度函数 pdf(.)作 指数归一化:
p Γdf(Zi i )' = ( vma Pxd/{p(df;(-)}m-imn{iPn{pf( ridf(-)})a , a是指数因子;
所述归一化单元采用如下关系式将概率密度函数 pdf(.)归一化分布:
F ∑i pdf(Z "
所述概率累积分布计算单元采用如下关系式计算概率累积分布函数:
Figure imgf000005_0002
其中, 所述***进一步包括一参数调节单元, 用于调节指数因子 a 来控制对比度提升的强度。
其中, 所述***进一步包括一避闪处理单元, 所述避闪处理单元用 于避免视频播放, 实时调整带来的画面闪烁的问题。
其中, 所述避闪处理单元对 cdf(.)限幅对图 4象进行避闪处理, 当 Zi - cdf(Zi) > Γ(Ζ;)时, 则 Ζ; - cdf(Zi) = Τ(Ζ;); 当 Zi— cdf(Z;) < -Γ(Ζ;)时, 则 Ζ; - cdf(Z;) = -T(Zi) , 其中 T(Zi)是与 Zi有关的阈值函数。
其中, 所述避闪处理单元采用帧间平滑的方式, 采用如下关系式: z; = aZi + (l - a)f(Zi) , 对图像进行避闪处理, 其中 a为帧间平滑因子, f(ZD是 灰阶映射函数。
相对于现有技术, 通过上述数码影像的动态对比度调整方法和***, 可以有效地增强数码影像的动态对比度。 附图说明 图 1是本发明实施例的数码影像的动态对比度调整方法流程示意图; 图 2是本发明实施例的数码影像的动态对比度调整方法的前后的效 果比较示意图;
图 3是本发明实施例的数码影像的动态对比度调整***的模块示意 图。 具体实施方式
请参阅图 1, 本发明实施例提供的数码影像的动态对比度调整方法 的流程示意图。 如图 1所示, 所述数码影像的动态对比度调整方法包括 如下步骤:
S101 : 读取一幅图像或视频中的某一帧, 记为 I。
S102 : 计算 I的亮度直方图, 得到概率密度函数 pdf( 。
所述的计算亮度直方图, 也即概率密度函数 pdf( 是指计算 I 中对 应灰度级的像素出现的次数, 形成 I 中像素值在整个亮度动态范围内的 分布。其中直方图可以记为一个向量 H = [pi, p2, . . ., Pn]。该向量满足:
Figure imgf000006_0001
其中 Xi表示任意灰度级。 # { (x, y) | l (x, y) = xi} 表示 I 中亮度值等于 xi 的像素所组成的集合中元素的个数。 I (x, y)表示位于坐标 (x, y) 处像 素的亮度值。 将此集合记为 = { (x, y) | l (x, y) = Xi}。 所述亮度动态范围 是指由 I中像素值的比特位数确定的所有可能的亮度值出现的范围。若像 素值为一个 k比特数, 则动态范围为 0到 2k-l。 本实施例中, 考虑 8比特图 像, 则动态范围 0到 255。
对于灰度图, 只需对 I 的亮度通道计算直方图 11。 对于彩色图, 需 要分別对 RGB 三个通道计算出三个直方图 Hc, c = R, G, B。
S103 : 计算概率密度函数 pdf( 的指数归一化, 并将概率密度函数 pdf(.)归一化分布。
本实施例中, 采用如下关系式计算概率密度函数 pdf( 的指数归一 化: p Γdf(Zi i)' = ( vma Px{pdf(-)}-imn[iPn{p^df(-)} , a是指数因子, 其可以根据需求而任意设 本实施例中, 采用如下关系式将 函数 pdf( 归一化分布:
Figure imgf000007_0001
S104 : 计算概率累积分布函数 cdf(-)。
本实施例中, 采用如下关系式计算概率累积分布函数:
Figure imgf000007_0002
cdf(-)是概率累积分布函数, 即 Probability(Z < ZD ; Ζ; = f(E;), Zi为 4象素点在 曝光亮度 的输出像素值。
可以理解的是, 也可步骤 S103省略, 而直接计算概率累积分布函 数 cdf( , 并不限于本实施例。
S105 : 当图像为灰阶图像时采用以下灰阶映射函数 f( = z; (1+Zi-cdf(Zi)) 对当前灰阶图像的对比度进行调整; 当图像为彩色图像时, 采用以下函 数 f ) = c 1+Yi"cdf(Yi)) 对当前彩色图像的对比度进行调整。
其中, f(.)是映射函数, ¼是亮度值, 是 RGB 三个彩色通道中的一 个通道。 由于样本空间是图像本身, 灰阶映射函数 f i) : ? 2'-1^2'"本身 是自适应的。 可以看到, 当 4 = 1时, ζ; = ι, 而当 Zi = o时, z( = o。所以所述 灰阶映射函数 ^:?^2'-"^2'" 本身是有界且归一化的。 本实施例中, 均归一化到 0〜1, 考虑 8比特图像, 则 o≤i≤255, 用一个 255乘因子量 化到 8bit。
在 S105 中, 遍历整个数码影像, 即图像 I的每个像素。 当图像为 RGB彩色图像时, 则求取亮度值 Y, 再采用关系式 f c +Kdf^计算 新的彩色像素值。 当图像为灰阶图时, 采用关系式 ^ Ζ +ΖΊ^计算 灰阶映射值作为新像素值。
在本实施例中, 进一步包括如下两步骤:
S106 : 调节参数, 控制对比度提升的强度。 不失一般性,本实施例中,通过对概率密度函数 pdf(.)作指数归一化, 从而对函数 cdf(.)做修正, 做到更好的参数调节。 由关系式: cdf(Zi) ,和关系式:
Figure imgf000008_0001
P Γdf(Zi 1)' = ( vma Px{pdf(-)}-imniiPn{pdf((-J)} ' 可以看到, a越大则 cdf越趋于线性, 因此可以 调节指数因子 a来控制对比度提升的强度。
S107 : 对图像进行避闪处理。
考虑视频播放, 应避免实时调整带来的画面闪烁。 本实施例采用对 cdf(-)限幅的方法来避免实时调整带来的画面闪烁的问题。 即如果 Zi - cdf(Zi) > r(Zi),贝1 J Zi - cdf(Zi) = T(Z;) ; 口果 Zi - cdf(Z;) < — r(Zi),贝1 J Zi - cdf(Z;) = -T(Z;) , 其中 T ( 是与 Zi有关的阈值函数, 一种特例是 τ (z = τ0
可以理解的是, 也可以采用帧间平滑的方式来达到避免实时调整带 来的画面闪烁的问题。 如采用如下关系式: Z^ aZi + CL 对图像进 行避闪处理, 其中 a为帧间平滑因子, f( 是灰阶映射函数。
在其他实施例中, 如果计算资源较少, 则步骤 S 103可以省略; 如 果计算资源足够, 本实施例采用步骤 S103来控制对比度提升的强度。 如果仅对单帧图片进行对比度提升, 则步骤 S 106不是必须, 如果对视 频进行对比度提升, 则步骤 S107可以有效的避免画面闪烁。 并不限于 本实施例。
由图 2, 动态对比度调节前后效果对比图, 可以看出, 通过上述数 码影像的动态对比度调整方法, 可以有效地增强数码影像的动态对比度。
请参阅图 3, 图 3是本发明实施例的数码影像的动态对比度的调整 ***的结构示意图。 如图 3所示, 所述调整*** 20包括: 一读取单元 21、概率密度计算单元 22、 归一化单元 23、概率累积分布计算单元 24、 以及一对比度调整单元 25。 在本发明实施例中, 所述读取单元 21 用于读取一幅图像或视频中 的某一帧,记为 I。所述概率密度计算单元 22与所述读取单元 21连接, 所述概率密度计算单元 22用于计算 I的亮度直方图,得到概率密度函数 pdf(-) o 所述归一化单元 23 与所述概率密度计算单元 22连接, 所述归 一化单元 23用于计算概率密度函数 pdf( 的指数归一化, 并将概率密度 函数 pdf( 归一化分布。 所述概率累积分布计算单元 24与所述归一化单 元 23连接, 所述概率累积分布计算单元 24用于计算概率累积分布函数 cdf(-) o 所述对比度调整单元 25 与所述概率累积分布函数计算单元 24 连接, 所述对比度调整单元 25 用于对图像的对比度进行调整, 也即, 当图像为灰阶图像时, 所述对比度调整单元 25 采用以下灰阶映射函数 f(z = Zi (1+z'-cdf(Zi)) 对当前灰阶图像的对比度进行调整;当图像为彩色图像 时, 所述对比度调整单元 25采用以下关系式 (^:^+^ ^ 对当前彩 色图像的对比度进行调整。
在本发明实施例中, 所述的计算亮度直方图, 也即概率密度函数 pdf( 是指计算 I 中对应灰度级的像素出现的次数, 形成 I 中像素值在 整个亮度动态范围内的分布。 其中直方图可以记为一个向量 H = [pi ,
P2,
Figure imgf000009_0001
其中 Xi表示任意灰度级。 # { (x, y) | l (x, y) = xi} 表示 I 中亮度值等于 xi 的像素所组成的集合中元素的个数。 I (x, y)表示位于坐标 (x, y) 处像 素的亮度值。 将此集合记为 = { (x, y) | l (x, y) = Xi}。 所述亮度动态范围 是指由 I 中像素值的比特位数确定的所有可能的亮度值出现的范围。 若 像素值为一个 k比特数, 则动态范围为 0 到 2k-l。 本实施例中, 考虑 8比特 图像, 则动态范围 0到 255。
对于灰度图, 只需对 I 的亮度通道计算直方图 11。 对于彩色图, 需 要分別对 RGB 三个通道计算出三个直方图 Hc, c = R, G, B。
在本实施例中, 所述归一化单元 23 采用以下关系式采对计算概率 密度函数 pdf(, 指数归一化: p Γdf(Zi i)' = ( vma Px{pdf(-)}-mDiiPn{p^df(-S)} , a是指数因子, 其可以根据需求而任意设 置。
本实施例中, 所述归一化单元 23 采用如下关系式将概率密度函数 pdf(.)归一化分布:
Ddfrz.y' = Pdf(zi)'。
本实施例中, 所述概率累积分布计算单元 24 采用如下关系式计算 概率累积分布函数:
Figure imgf000010_0001
cdf(-)是概率函数, 即 Probability(Z < ZD ; Ζ; = f(E;), Zi为 4象素点在 Θ暴光亮度 Ei 的输出像素值。
本实施例中, 当图像为灰阶图像时, 所述对比度调整单元 25 采用 以下灰阶映射函数
Figure imgf000010_0002
对当前灰阶图像的对比度进行调整; 当图像为彩色图像时, 所述对比度调整单元 25 采用以下函数 f(CD = c 1+Y'-cdf(Yi)) 对当前彩色图像的对比度进行调整。
其中, f(.)是映射函数, ¼是亮度值, 是 RGB 三个彩色通道中的一 个通道。 由于样本空间是图像本身, 灰阶映射函数 f i) : ? 2'-1^2'"本身 是自适应的。 可以看到, 当 4 = 1时, Z; = l, 而当 Zi = 0时, z( = o。所以所述 灰阶映射函数 f(¾ = z 1+Zi"cdf(Zi)) 本身是有界且归一化的。
本实施例中, Zi均归一化到 0〜1, 考虑 8 比特图 ■, 则 0≤ i≤ 255, 用一个 255乘因子量化到 8bit。
本实施例中, 为了控制对比度提升的强度, 所述动态对比度的调整 *** 20进一步包括一参数调节单元 26。
所述参数调节单元 26与所述对比度调整单元 25。 所述动态对比度 的调整*** 20通过对概率密度函数 pdf(.)作指数归一化,从而对函数 Cdf(.) 做修正, 做到更好的参数调节。
由关系式: cdf(Zi) =∑!_0 pdf(Zi)",关系式: pdf(Zi)" = df(Zi)' ,和关系式:
J_i Pdf(Zi)'
Γ Pdf(Zi 1)' = ( Vma Px{p^df( }-mniiPn{pdf((-)} ' 可以看到, a越大则 cdf越趋于线性, 因此所述 参数调节单元 26通过调节指数因子 a来控制对比度提升的强度。 本实施例中, 为了避免视频播放, 实时调整带来的画面闪烁的问题, 所述动态对比度的调整*** 20进一步包括一避闪处理单元 27。 所述避 闪处理单元 27也与所述对比度调整单元 25。所述避闪处理单元 27采用 对 cdf(.)限幅的方法来避免实时调整带来的画面闪烁的问题。 即如果 - cdf(Zi) > r(Zi),贝1 J Zi - cdf(Zi) = Τ(Ζ;) ; 口果 Zi - cdf(Z;) < — r(Zi),贝1 - cdf(Z;) = -T(Z;) , 其中 T ( 是与 Zi有关的阈值函数, 一种特例是 τ (z = τ0
来达到避免实时调整带来的画面闪烁的问题。 如采用如下关系式: z; = aZi + (l - a)f(Zi) , 对图 4象进行避闪处理, 其中 a为帧间平滑因子, f )是灰阶 映射函数。 在其他实施例中, 所述率密度计算单元 22和所述归一化单元 23可 以省略, 而将所述读取单元 21直接与所述概率累积分布计算单元 24连 接, 所述概率累积分布计算单元 24直接得到概率累积分布函数, 并不 限于本实施例。
在本发明所提供的几个实施例中, 应该理解到, 所揭露的***, 装 置和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例 仅仅是示意性的, 例如, 所述模块或单元的划分, 仅仅为一种逻辑功能 划分, 实际实现时可以有另外的划分方式, 例如多个单元或组件可以结 合或者可以集成到另一个***, 或一些特征可以忽略, 或不执行。 另一 点, 所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过 一些接口, 装置或单元的间接耦合或通信连接, 可以是电性, 机械或其 它的形式。 的, 作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于 一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选 择其中的部分或者全部单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单 元中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集 成在一个单元中。 上述集成的单元既可以采用硬件的形式实现, 也可以 采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产 品销售或使用时, 可以存储在一个计算机可读取存储介^中。 基于这样 的理解, 本发明的技术方案本 ^上或者说对现有技术做出贡献的部分或 者该技术方案的全部或部分可以以软件产品的形式体现出来, 该计算机 软件产品存储在一个存储介 ^中, 包括若干指令用以使得一台计算机设 备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor) 执行本发明各个实施例所述方法的全部或部分步骤。 而前述的存储介^ 包括: U盘、 移动硬盘、 只读存储器 (ROM, Read-Only Memory) , 随 机存取存储器 (RAM, Random Access Memory) , 磁碟或者光盘等各种 可以存储程序代码的介^。
以上所述仅为本发明的实施例, 并非因此限制本发明的专利范围, 凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换, 或 直接或间接运用在其他相关的技术领域, 均同理包括在本发明的专利保 护范围内。

Claims

权 利 要 求 书
1 . 一种数码影像的动态对比度调整方法, 其包括如下步骤: 读取一幅图像或视频中的一帧图像;
计算所述图像的像素亮度值概率累积分布函数 cdf(-);
当图像为灰阶图像时采用关系式: f( = z; (1+Zi-cdf(Zi)) 对当前灰阶图像 的对比度进行调整; 当图像为彩色图像时, 采用关系式: (^二^+^ ^ 对当前彩色图像的对比度进行调整, 其中, Zi = f(Ei), Zi为像素点在曝光亮 度 Ei的输出像素值, f( 是映射函数, ¼是亮度值, 是 RGB 三个彩色通 道中的一个通道。
2. 根据权利要求 1所述的方法, 其特征在于, 所述计算所述图像的 像素亮度值概率累积分布函数 cdf( 包括:
计算所述图像的亮度直方图, 得到概率密度函数 pdf(.), 采用如下关 系式计算对概率密度函数 Pdf( 作指数归一化:
p Γdf(Zi i )' = ( vma Pxd/{p(df;(-)}m-imn{iPn{pf( ridf(-)})a , a是指数因子;
采用如下关系式将概率密度函数 pdf(.)归一化分布:
Ddf zV = pdf(Zi)'
采用如下关系式计算概率累积分布函数:
Figure imgf000013_0001
3. 根据权利要求 2所述的方法, 其特征在于, 进一步包括步骤: 调节指数因子 a来控制对比度提升的强度。
4. 根据权利要求 2所述的方法, 其特征在于, 进一步包括步骤: 对 图像进行避闪处理。
5. 根据权利要求 4所述的方法, 其特征在于, 所述对图像进行避闪 处理包括:
采用对 cdf(-)限幅, 口果 Zi — cdf(Zi) > Γ(Ζ;) ,则 Zi - cdf(Zi) = Τ(Ζ;); 口果 Zi— cdf(Zi) < - r(Zi),则 Zi - cdf(Zi) = -T(Zi) , 其中 T(Zi)是与 Zi有关的阈值函数。
6. 根据权利要求 4所述的方法, 其特征在于, 所述对图像进行避闪 处理包括:
采用帧间平滑的方式, 采用如下关系式: Z^ ccZi + CL - c fft) , 对图像 进行避闪处理, 其中 a为帧间平滑因子, f( 是灰阶映射函数。
7.—种数码影像的动态对比度调整***, 所述***包括:
一读取单元, 用于读取一幅图像或视频中的一帧图像;
一概率累积分布计算单元, 用于计算所述图像的像素亮度值概率累 积分布函数 cdf(-) ;
一对比度调整单元, 当图像为灰阶图像时, 所述对比度调整单元采 用关系式: fft) : ?^2'-1^^ 对当前灰阶图像的对比度进行调整; 当图像 为彩色图像时, 所述对比度调整单元采用关系式: f(Ci)
Figure imgf000014_0001
对 当前彩色图像的对比度进行调整, 其中, Zi = f(Ei), Zi为像素点在曝光亮度
Ei的输出像素值, f( 是线性函数, ¼是亮度值, 是 RGB 三个彩色通道 中的一个通道。
8. 根据权利要求 7所述的***, 其特征在于, 所述***进一步包括 一概率密度计算单元和一归一化单元, 所述概率密度计算单元用于计算 所述图像的亮度直方图, 得到概率密度函数 pdf(.), 所述归一化单元采用 如下关系式计算对概率密度函数 pdf(.)作指数归一化:
p Γdf(Zi i)' = ( vma Pxd/{p(df(-)r}-mn{iPnr{pridf(-)})a, a是指数因子;
所述归一化单元采用如下关系式将概率密度函数 pdf(.)归一化分布: Ddf zV = pdf(Zi)'
所述概率累积分布计算单元采用如下关系式计算概率累积分布函数:
Figure imgf000014_0002
9. 根据权利要求 8所述的***, 其特征在于, 所述***进一步包括 一参数调节单元, 用于调节指数因子 a来控制对比度提升的强度。
10. 根据权利要求 8所述的***, 其特征在于, 所述***进一步包 括一避闪处理单元, 所述避闪处理单元用于避免视频播放, 实时调整带 来的画面闪烁的问题。
11. 根据权利要求 10所述的方法, 其特征在于, 所述避闪处理单元 对 cdf(')限幅对图像进行避闪处理,当 Zi- cdf(Zi) > r(Zi)时,则 Zi- cdf(Zi) =Τ( ; 当 Zi— cdf(Zi) <— r(Zi)时, 则 Zi— cdf(Zi) = -T(Zi), 其中 Τ( 是与 Zi有关的阈值函 数。
12. 根据权利要求 10所述的方法, 其特征在于, 所述避闪处理单元 采用帧间平滑的方式, 采用如下关系式: Z^ccZi + CL-c fft), 对图像进行 避闪处理, 其中 a为帧间平滑因子, f( 是灰阶映射函数。
PCT/CN2014/077520 2014-05-14 2014-05-14 数码影像的动态对比度调整方法和*** WO2015172340A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/077520 WO2015172340A1 (zh) 2014-05-14 2014-05-14 数码影像的动态对比度调整方法和***

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/077520 WO2015172340A1 (zh) 2014-05-14 2014-05-14 数码影像的动态对比度调整方法和***

Publications (1)

Publication Number Publication Date
WO2015172340A1 true WO2015172340A1 (zh) 2015-11-19

Family

ID=54479161

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/077520 WO2015172340A1 (zh) 2014-05-14 2014-05-14 数码影像的动态对比度调整方法和***

Country Status (1)

Country Link
WO (1) WO2015172340A1 (zh)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1170175A (zh) * 1996-06-27 1998-01-14 三星电子株式会社 图像直方图均衡电路及方法
CN1750043A (zh) * 2005-08-22 2006-03-22 上海广电(集团)有限公司中央研究院 一种控制平均亮度的直方图均衡方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1170175A (zh) * 1996-06-27 1998-01-14 三星电子株式会社 图像直方图均衡电路及方法
CN1750043A (zh) * 2005-08-22 2006-03-22 上海广电(集团)有限公司中央研究院 一种控制平均亮度的直方图均衡方法

Similar Documents

Publication Publication Date Title
WO2019085705A1 (zh) 高动态范围图像曝光补偿值获取方法和装置
KR100990904B1 (ko) 다수 영상의 생성 및 합성을 통한 영상 보정 장치 및 그 방법
US8860816B2 (en) Scene enhancements in off-center peripheral regions for nonlinear lens geometries
CN101394485B (zh) 图像生成方法、装置及图像合成设备
EP2858033B1 (en) Method and device for correcting multi-exposure motion image
US9307162B2 (en) Local enhancement apparatus and method to generate high dynamic range images by blending brightness-preserved and brightness-adjusted blocks
WO2019011154A1 (zh) 白平衡处理方法和装置
WO2014044045A1 (zh) 图像处理方法及装置
WO2011127825A1 (zh) 图像对比度的处理方法及装置
WO2018228310A1 (zh) 图像处理方法、装置及终端
KR20130013288A (ko) 다중 노출 퓨전 기반에서 고스트 흐림을 제거한 hdr 영상 생성 장치 및 방법
JP2014168270A (ja) 画像選択および結合の方法およびデバイス
CN103716547A (zh) 一种智能模式的拍照方法
WO2021143300A1 (zh) 图像处理方法、装置、电子设备及存储介质
CN111885312B (zh) Hdr图像的成像方法、***、电子设备及存储介质
BR102015006040A2 (pt) método para o processamento de uma sequência de vídeo, correspondentes dispositivo, programa de computador e meio legível por computador não transitório
WO2020042074A1 (zh) 曝光调整方法和装置
WO2019011148A1 (zh) 白平衡处理方法和装置
WO2022087973A1 (zh) 图像处理方法及装置、计算机可读介质和电子设备
US11323632B2 (en) Electronic device and method for increasing exposure control performance of a camera by adjusting exposure parameter of the camera
CN103237168A (zh) 一种基于综合增益的高动态范围图像视频处理方法
WO2015188359A1 (zh) 一种图片处理方法、装置
US8995784B2 (en) Structure descriptors for image processing
JP5367455B2 (ja) 複数のカラーカメラ間の色調整装置および方法
WO2019019890A1 (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: 14891668

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: 14891668

Country of ref document: EP

Kind code of ref document: A1