CN110717862B - Contrast enhancement method based on dynamic range compression and electronic device thereof - Google Patents
Contrast enhancement method based on dynamic range compression and electronic device thereof Download PDFInfo
- Publication number
- CN110717862B CN110717862B CN201810758240.6A CN201810758240A CN110717862B CN 110717862 B CN110717862 B CN 110717862B CN 201810758240 A CN201810758240 A CN 201810758240A CN 110717862 B CN110717862 B CN 110717862B
- Authority
- CN
- China
- Prior art keywords
- value
- brightness value
- input
- luminance value
- luminance
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000006835 compression Effects 0.000 title claims abstract description 17
- 238000007906 compression Methods 0.000 title claims abstract description 17
- 238000013507 mapping Methods 0.000 claims abstract description 20
- 238000009825 accumulation Methods 0.000 claims description 12
- 238000001914 filtration Methods 0.000 claims description 8
- 238000009499 grossing Methods 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 abstract description 10
- 235000019557 luminance Nutrition 0.000 description 210
- 238000010586 diagram Methods 0.000 description 8
- 238000012935 Averaging Methods 0.000 description 4
- 230000001186 cumulative effect Effects 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/92—Dynamic range modification of images or parts thereof based on global image properties
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Facsimile Image Signal Circuits (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本发明提供一种对比增强方法及其电子装置,特别涉及一种基于动态范围压缩的对比增强方法及其电子装置。The present invention provides a contrast enhancement method and an electronic device thereof, in particular to a contrast enhancement method based on dynamic range compression and an electronic device thereof.
背景技术Background technique
高动态范围(如32位元)影像能够捕捉如真实场景一般的影像,因为它能够大量保留真实场景中的亮度、对比度、影像细节等等信息。而一般显示器能够显示的动态范围例如是0~255(即8位元)。为了让一般显示器可以呈现高动态范围影像,高动态范围影像会通过一种压缩方式并搭配合适的影像对比增强,以贴近人类视觉的感受。High dynamic range (eg 32-bit) images can capture images that look like real scenes, because they retain a lot of the brightness, contrast, image details, and so on of the real scene. The dynamic range that a general display can display is, for example, 0 to 255 (ie, 8 bits). In order to allow general monitors to present high dynamic range images, high dynamic range images are enhanced by a compression method and appropriate image contrast to be close to the perception of human vision.
影像对比增强主要可以分为全域性(global)对比增强及区域性(local)对比增强。全域性对比增强(如伽马(Gamma)校正或直方图均衡化)是估算一条具有动态范围压缩的全域性曲线,并对影像进行映射。虽然全域性对比增强可以对影像快速进行处理,但此类方法会对过亮像素过度压缩或对过暗像素过度放大,这样的缺点往往会损失结果影像的对比度。区域性对比增强(如适应性直方图均衡化、曝光与遮光技术(Dodging-and-Burning))是根据每个像素及其邻近像素的关系来产生非线性曲线条,以调整每个像素。虽然区域性对比增强可以产生较佳的影像对比度,但此类方法的计算复杂度非常高。Image contrast enhancement can be divided into global (global) contrast enhancement and regional (local) contrast enhancement. Global contrast enhancement (such as gamma correction or histogram equalization) is to estimate a global curve with dynamic range compression and map the image. Although global contrast enhancement can process images quickly, such methods can over-compress too bright pixels or over-amplify too dark pixels, which often loses the contrast of the resulting image. Regional contrast enhancement (such as adaptive histogram equalization, exposure and shading techniques (Dodging-and-Burning)) is based on the relationship between each pixel and its neighbors to generate a nonlinear curve to adjust each pixel. Although regional contrast enhancement can produce better image contrast, the computational complexity of such methods is very high.
因此,若可以结合上述全域性对比增强与区域性对比增强的优点,将可以降低计算复杂度且产生较佳的影像对比度。Therefore, if the advantages of the above-mentioned global contrast enhancement and regional contrast enhancement can be combined, the computational complexity can be reduced and better image contrast can be generated.
发明内容SUMMARY OF THE INVENTION
本发明提供了一种基于动态范围压缩的对比增强方法及其电子装置,其通过一输入影像中每个像素位置的输入亮度值的出现次数来决定合适的有效动态范围,并据此估算全域映射曲线(Global Mapping Curve),接着再根据输入影像中每个像素位置的区域特性来调整输入亮度值映射的输出亮度值,以适应性地提高输入影像的对比度。据此,本发明的对比增强方法及其电子装置可以降低计算复杂度且产生较佳的影像对比度。The present invention provides a contrast enhancement method based on dynamic range compression and an electronic device thereof, which determine an appropriate effective dynamic range by the number of occurrences of the input luminance value of each pixel position in an input image, and estimate the global map accordingly. Curve (Global Mapping Curve), and then adjust the output brightness value of the input brightness value mapping according to the regional characteristics of each pixel position in the input image, so as to adaptively improve the contrast of the input image. Accordingly, the contrast enhancement method and the electronic device thereof of the present invention can reduce computational complexity and generate better image contrast.
本发明实施例提供一种基于动态范围压缩的对比增强方法,适用于一电子装置,且用以调整一输入影像中的每一个像素位置的一输入亮度,以增强输入影像的对比度。对比增强方法包括如下步骤:(A)接收输入影像中的每一个输入亮度;(B)将每一个输入亮度值的一出现次数对应到一直方图上的多个亮度值,将这些出现次数进行平滑滤波,且根据平滑化的这些出现次数决定一有效动态范围;(C)按序累加有效动态范围中平滑化的每一个出现次数,以产生一累加曲线,其中累加曲线代表这些亮度值与累加后的这些出现次数的关系;(D)将累加后的这些出现次数正规化至有效动态范围以产生一输出亮度值,且这些亮度值与每一个亮度值对应的输出亮度值形成一全域映射曲线;(E)于全域映射曲线中,按序根据每一个像素位置的输入亮度值获取对应的输出亮度值;以及(F)于每一个像素位置中,根据对应的输出亮度值与邻近的这些输出亮度值之间的一亮度关系调整对应的输出亮度值,以产生一最后亮度值。Embodiments of the present invention provide a contrast enhancement method based on dynamic range compression, which is suitable for an electronic device and used to adjust an input brightness of each pixel position in an input image to enhance the contrast of the input image. The contrast enhancement method includes the following steps: (A) receiving each input brightness in the input image; (B) corresponding an occurrence number of each input brightness value to a plurality of brightness values on the histogram, and performing these occurrence times to Smooth filtering, and determine an effective dynamic range according to the occurrences of smoothing; (C) sequentially accumulating each occurrence of smoothing in the effective dynamic range to generate an accumulation curve, wherein the accumulation curve represents the brightness values and the accumulation (D) normalize the accumulated occurrence times to the effective dynamic range to generate an output luminance value, and these luminance values and the output luminance value corresponding to each luminance value form a global mapping curve (E) in the global mapping curve, obtain the corresponding output luminance value according to the input luminance value of each pixel position in sequence; and (F) in each pixel position, according to the corresponding output luminance value and adjacent these outputs A brightness relationship between the brightness values adjusts the corresponding output brightness value to generate a final brightness value.
本发明实施例提供一种基于动态范围压缩的电子装置,用以调整一输入影像中的每一个像素位置的一输入亮度,以增强该输入影像的对比度。电子装置包括一影像获取装置与影像处理器。影像获取装置接收输入影像,并按序获取输入影像中的每一个输入亮度。影像处理器电连接影像获取装置,且用以执行下列步骤:(A)接收输入影像中的每一个输入亮度值;(B)将每一个输入亮度的一出现次数对应到一直方图上的多个亮度值,将这些出现次数进行平滑滤波,且根据平滑化的这些出现次数决定一有效动态范围;(C)按序累加有效动态范围中平滑化的每一个出现次数,以产生一累加曲线,其中累加曲线代表这些亮度值与累加后的这些出现次数的关系;(D)将累加后的这些出现次数正规化至有效动态范围以产生一输出亮度值,且这些亮度值与每一个亮度值对应的输出亮度值形成一全域映射曲线;(E)于全域映射曲线中,按序根据每一个像素位置的输入亮度值获取对应的输出亮度值;以及(F)于每一个像素位置中,根据对应的输出亮度值与邻近的这些输出亮度值之间的一亮度关系调整对应的输出亮度值,以产生一最后亮度值。Embodiments of the present invention provide an electronic device based on dynamic range compression for adjusting an input brightness of each pixel position in an input image to enhance the contrast of the input image. The electronic device includes an image acquisition device and an image processor. The image acquisition device receives the input image, and sequentially acquires each input brightness in the input image. The image processor is electrically connected to the image acquisition device, and is used for performing the following steps: (A) receiving each input luminance value in the input image; (B) corresponding to a number of occurrences of each input luminance to multiple values on the histogram A luminance value is obtained, these occurrences are smoothed and filtered, and an effective dynamic range is determined according to the smoothed occurrences; (C) each smoothed occurrence in the effective dynamic range is sequentially accumulated to generate an accumulation curve, The accumulation curve represents the relationship between these brightness values and the accumulated occurrences; (D) normalize the accumulated occurrences to an effective dynamic range to generate an output brightness value, and these brightness values correspond to each brightness value (E) in the global mapping curve, obtain the corresponding output luminance value according to the input luminance value of each pixel position in sequence; and (F) in each pixel position, according to the corresponding A brightness relationship between the output brightness value of and the adjacent output brightness values adjusts the corresponding output brightness value to generate a final brightness value.
为使能更进一步了解本发明的特征及技术内容,请参阅以下有关本发明的详细说明与附图,但是这些说明与附图仅是用来说明本发明,而非对本发明的权利要求作任何的限制。In order to further understand the features and technical content of the present invention, please refer to the following detailed descriptions and drawings related to the present invention, but these descriptions and drawings are only used to illustrate the present invention, rather than make any claims of the present invention. limits.
附图说明Description of drawings
图1是本发明一实施例的基于动态范围压缩的电子装置的示意图。FIG. 1 is a schematic diagram of an electronic device based on dynamic range compression according to an embodiment of the present invention.
图2是本发明一实施例的基于动态范围压缩的对比增强方法的流程图。FIG. 2 is a flowchart of a contrast enhancement method based on dynamic range compression according to an embodiment of the present invention.
图2A是图2的步骤S230的细节流程图。FIG. 2A is a detailed flowchart of step S230 of FIG. 2 .
图2B是图2的步骤S270的细节流程图。FIG. 2B is a detailed flowchart of step S270 of FIG. 2 .
图3是本发明一实施例的输入影像的直方图。FIG. 3 is a histogram of an input image according to an embodiment of the present invention.
图4是图3的平滑化的直方图。FIG. 4 is a smoothed histogram of FIG. 3 .
图5是本发明一实施例的累加曲线的示意图。FIG. 5 is a schematic diagram of an accumulation curve according to an embodiment of the present invention.
图6是本发明一实施例的全域映射曲线的示意图。FIG. 6 is a schematic diagram of a global mapping curve according to an embodiment of the present invention.
图7是本发明一实施例的目前像素位置的输出亮度值与邻近的输出亮度值的示意图。FIG. 7 is a schematic diagram of an output luminance value of a current pixel position and an adjacent output luminance value according to an embodiment of the present invention.
图8是本发明一实施例的调整目前像素位置的输出亮度值的示意图。FIG. 8 is a schematic diagram of adjusting the output luminance value of the current pixel position according to an embodiment of the present invention.
图9是本发明另一实施例的调整目前像素位置的输出亮度值的示意图。FIG. 9 is a schematic diagram of adjusting the output luminance value of the current pixel position according to another embodiment of the present invention.
图10是本发明另一实施例的调整目前像素位置的输出亮度值的示意图。FIG. 10 is a schematic diagram of adjusting the output luminance value of the current pixel position according to another embodiment of the present invention.
符号说明Symbol Description
100:电子装置100: Electronics
110:影像获取装置110: Image acquisition device
120:影像处理器120: Image processor
Fr、Fr1:输入影像Fr, Fr1: Input image
P0-Pn:输入亮度值P0-Pn: Input brightness value
P0’-Pn’:最后亮度值P0'-Pn': last brightness value
S210、S220、S230、S240、S250、S260、S270:步骤S210, S220, S230, S240, S250, S260, S270: Steps
S231、S233、S235、S237、S238、S239:步骤S231, S233, S235, S237, S238, S239: Steps
S271、S273:步骤S271, S273: Steps
L0:第一个亮度值L0: The first luminance value
L1:第一有效亮度值L1: The first effective luminance value
L2:第二有效亮度值L2: Second effective luminance value
DR1:第一范围DR1: first range
DR2:第二范围DR2: Second range
Deff:有效动态范围Deff: effective dynamic range
Cuv:累加曲线Cuv: cumulative curve
F1、F2、F3:像素组F1, F2, F3: Pixel groups
P22、P47、P102:像素位置P22, P47, P102: Pixel position
具体实施方式Detailed ways
在下文中,将通过附图说明本发明的各种例示实施例来详细描述本发明。然而,本发明概念可能以许多不同形式来实现,且不应解释为限于本文中所阐述的例示性实施例。此外,附图中相同参考数字可用以表示类似的元件。Hereinafter, the present invention will be described in detail by illustrating various exemplary embodiments of the invention by means of the accompanying drawings. However, the inventive concepts may be embodied in many different forms and should not be construed as limited to the exemplary embodiments set forth herein. Furthermore, the same reference numbers may be used in the figures to refer to similar elements.
首先,请参考图1,其显示本发明一实施例的基于动态范围压缩的电子装置的示意图。如图1所示,电子装置100为用来调整一输入影像Fr中的每一个像素位置的输入亮度值P0-Pn,以增强输入影像Fr的对比度,并输出调整后的最后亮度值P0’-Pn’。在本实施例中,电子装置100可为智能手机、录影机、平板电脑、笔记本电脑或其他需要执行影像对比增强的装置,本发明对此不作限制。First, please refer to FIG. 1 , which shows a schematic diagram of an electronic device based on dynamic range compression according to an embodiment of the present invention. As shown in FIG. 1 , the
电子装置100包括一影像获取装置110与一影像处理器120。如图1所示,影像获取装置110接收输入影像Fr,并按序获取输入影像Fr中的每一个输入亮度值P0-Pn。更进一步来说,影像获取装置110为获取连续影像,且输入影像Fr为连续影像中的其中一张。而输入影像Fr中的每一个像素位置分别具有输入亮度值P0-Pn。The
影像处理器120电连接影像获取装置110,且用以执行下列步骤,以调整输入影像Fr中的每一个像素位置的输入亮度值P0-Pn,进而增强输入影像Fr的对比度。The
请同时参考图1至图2。图2显示本发明一实施例的基于动态范围压缩的对比增强方法的流程图。首先,影像处理器120接收输入影像Fr中每个像素位置的输入亮度值P0-Pn,以进一步分析输入影像Fr中每一个输入亮度值P0-Pn的特征(步骤S210)。Please also refer to Figure 1 to Figure 2. FIG. 2 shows a flowchart of a contrast enhancement method based on dynamic range compression according to an embodiment of the present invention. First, the
接着,影像处理器120将每一个输入亮度值P0-Pn的一出现次数对应到一直方图上的多个亮度值(步骤S220)。如图3所示,直方图Histogram的亮度值的动态范围为9位元(bit,比特),即亮度值0-511。因此,影像处理器120将输入影像Fr中的每个输入亮度值P0-Pn的出现次数H(n)统计到直方图Histogram的亮度值上。在本实施例中,亮度值0的出现次数为10次(以H(0)=10表示)。而在其他亮度值1-511中,H(1)=15;H(2)=12;H(3)=8;H(4)=15;H(5)-H(10)=10;H(11)-H(248)=0;H(249)=10;H(250)=10;H(251)=5;H(252)=0;H(253)=1;H(254)=0;H(255)=1;H(256)=1;H(257)=0;H(258)=1;H(259)=1;以及H(260)-H(511)=0。而直方图Histogram的亮度值的动态范围亦可依照实际状况来做设计,本发明对此不作限制。Next, the
在取得直方图Histogram后,影像处理器120将这些出现次数进行平滑滤波,且根据平滑化的这些出现次数来决定一有效动态范围(步骤S230)。值得注意的是,若有效动态范围取得太小,会使得输入影像Fr较亮的地方在输出结果图上呈现过曝;反之,若有效动态范围取得太大,会使得输入影像Fr较暗的地方在输出结果图上呈现过暗。因此,适当的有效动态范围会得到较佳的输出结果图。After obtaining the histogram, the
更进一步来说,请同时参考图2A,影像处理器120将在直方图Histogram中,由最后一个亮度值往前搜索第一个有出现次数的亮度值作为一第一有效亮度值,并将第一个亮度值至第一有效亮度值作为一第一范围(步骤S231)。以图3为例,影像处理器120由最后一个亮度值511往前搜索第一个有出现次数的亮度值259,并将亮度值259作为第一有效亮度值L1。影像处理器120接着将第一个亮度值L0至第一有效亮度值L1作为一第一范围DR1。Further, referring to FIG. 2A at the same time, the
再来,于第一范围中,影像处理器120将对应的这些出现次数进行平滑滤波,以产生一平滑化的直方图(步骤S233)。在本实施例中,如图3所示,影像处理器120利用线性滤波器(linear filter)来对第一范围DR1中的这些出现次数H(0)-H(259)进行平滑滤波以产生平滑化的出现次数H’(n),且亦可利用其他方式来对这些出现次数H(0)-H(259)进行滤波以产生图4所示的平滑化的直方图Histogram1,本发明对此不作限制。Next, in the first range, the
请同时参考图4,承接上述例子,影像处理器120将根据亮度值的顺序来平均相邻的出现次数。因此,平滑化的出现次数H’(0)=(10+15)/2=13且H’(1)=(10+15+12)/3=12。而其他平滑化的出现次数H’(2)-H’(510)的计算方式大致上与H’(1)的计算方式相同,H’(511)的计算方式大致上与H’(0)的计算方式相同,且计算结果如图4所示,故在此不再赘述。当然,目前亮度值前后N个(N为正整数)亮度值亦可视为目前亮度值相邻的出现次数,本发明对此不作限制。Please also refer to FIG. 4 , following the above example, the
由图3的直方图Histogram与图4的平滑化的直方图Histogram1可知,影像处理器120可通过平滑滤波方式来消除杂讯所造成的统计量,即直方图Histogram的亮度值253、255、256、258与259映射的出现次数H(253)、H(255)、H(256)、H(258)与H(259)是杂讯。It can be seen from the histogram Histogram in FIG. 3 and the smoothed histogram Histogram1 in FIG. 4 that the
接着,在步骤S233后,影像处理器120将于平滑化的直方图中,由第一有效亮度值往前搜索第一个有出现次数的亮度值作为一第二有效亮度值,并将第一个亮度值至第二有效亮度值作为一第二范围(步骤S235)。承接上述例子并请参考图4,影像处理器120于平滑化的直方图Histogram1中,由第一有效亮度值L1往前搜索第一个有出现次数的亮度值252作为第二有效亮度值L2。影像处理器120接着将第一个亮度值L0至第二有效亮度值L2作为第二范围DR2。Next, after step S233, the
在步骤S235后,影像处理器120将在第二范围DR2中进一步判断第二有效亮度值L2是否小于等于一预设亮度值(步骤S237)。若第二有效亮度值L2小于等于预设亮度值,表示预设亮度值可以涵盖第二范围DR2中所有的亮度值。此时,影像处理器120将第一个亮度值L0至预设亮度值作为有效动态范围(步骤S238)。After step S235, the
反之,若第二有效亮度值L2大于预设亮度值,表示预设亮度不足以涵盖第二范围DR2中所有的亮度值。此时,影像处理器120将第一个亮度值L0至第二有效亮度值作为有效动态范围(步骤S239)。值得注意的是,预设亮度值可依照第二范围DR2的分辨率、输入亮度值P0-Pn的分辨率或其他关联于平滑化的直方图Histogram1的亮度值来设定,本发明对此不作限制。Conversely, if the second effective luminance value L2 is greater than the preset luminance value, it means that the preset luminance is insufficient to cover all the luminance values in the second range DR2. At this time, the
在本实施例中,预设亮度值设定为255。因此,承接上述例子,影像处理器120将在第二范围DR2中判断出第二有效亮度值L2小于等于255。此时,影像处理器120将第一个亮度值L0至预设亮度值(即255)作为有效动态范围Deff。借此因此,影像处理器120可通过步骤S231至S239界定适当的有效动态范围,以进行后续处理。In this embodiment, the preset brightness value is set to 255. Therefore, following the above example, the
再请回到图2,在决定有效动态范围(即步骤S230)后,影像处理器120将按序累加有效动态范围中平滑化的每一个出现次数,以产生一累加曲线。而累加曲线将代表这些亮度值与累加后的这些出现次数的关系(步骤S240)。承接上述例子,影像处理器120将按序累加如图4所示的有效动态范围Deff中,每一个亮度值0-255对应的平滑化的出现次数H’(0)-H’(255),以产生累加后的出现次数Had(n)。因此,累加后的出现次数Had(0)=13,Had(1)=13+12=25,Had(2)=13+12+12=37。而其他累加后的出现次数Had(3)-Had(255)的计算方式大致上与Had(1)的计算方式相同,且计算结果如图5的累加曲线Cuv所示,故在此不再赘述。Returning to FIG. 2 again, after determining the effective dynamic range (ie, step S230 ), the
在步骤S240后,影像处理器120将累加后的这些出现次数正规化至有效动态范围以产生一输出亮度值,且这些亮度值与每一个亮度值对应的输出亮度值形成一全域映射曲线(步骤S250)。更进一步来说,影像处理器120将按序计算累加后的出现次数Had(n)与有效动态范围中的全部出现次数的比例关系,且分别将每一个比例关系乘上有效动态范围中的一最高亮度值,以产生输出亮度值Iout(n)。After step S240, the
以图5的累加后的出现次数Had(0)=13为例作说明,有效动态范围Deff中的全部出现次数为147,且有效动态范围Deff中的最高亮度值为255。故累加后的出现次数Had(0)与全部出现次数的比例关系为(13/147)。输出亮度值Iout(0)为比例关系乘上最高亮度值=(13/147)*255=23。再以图5的累加后的出现次数Had(1)=25为例作说明,有效动态范围Deff中的全部出现次数为147,且有效动态范围Deff中的最高亮度值为255。故累加后的出现次数Had(1)与全部出现次数的比例关系为(25/147)。输出亮度值Iout(1)为比例关系乘上最高亮度值=(25/147)*255=43。Taking the accumulated number of occurrences Had(0)=13 in FIG. 5 as an example, the total number of occurrences in the effective dynamic range Deff is 147, and the highest luminance value in the effective dynamic range Deff is 255. Therefore, the proportional relationship between the accumulated number of occurrences Had(0) and the total number of occurrences is (13/147). The output luminance value Iout(0) is the proportional relationship multiplied by the highest luminance value=(13/147)*255=23. Taking the accumulated number of occurrences Had(1)=25 in FIG. 5 as an example, the total number of occurrences in the effective dynamic range Deff is 147, and the highest luminance value in the effective dynamic range Deff is 255. Therefore, the proportional relationship between the accumulated number of occurrences Had(1) and the total number of occurrences is (25/147). The output luminance value Iout(1) is the proportional relationship multiplied by the highest luminance value=(25/147)*255=43.
而其他输出亮度值Iout(2)-Iout(255)的计算方式大致上与Iout(1)的计算方式相同,且计算结果如图6的累加曲线Cuv所示,故在此不再赘述。据此,这些亮度值0-255与每一个亮度值0-255对应的输出亮度值Iout(0)-Iout(255)将形成全域映射曲线Cgb。The calculation method of other output luminance values Iout(2)-Iout(255) is roughly the same as that of Iout(1), and the calculation result is shown in the cumulative curve Cuv of FIG. Accordingly, these luminance values 0-255 and the output luminance values Iout(0)-Iout(255) corresponding to each luminance value 0-255 will form the global mapping curve Cgb.
在取得全域映射曲线后,接着,影像处理器120将按序根据每一个像素位置的输入亮度值获取对应的输出亮度值(步骤S260)。举例来说,请同时参考图6至图7,输入影像Fr1具有10*15个像素位置P0-P149,且每一个像素位置P0-P149具有一输入亮度值,如像素位置P22的输入亮度值为3,像素位置P47的输入亮度值为250,以及像素位置P102的输入亮度值为4。After obtaining the global mapping curve, the
因此,影像处理器120将像素位置P22的输入亮度值3对应到全域映射曲线Cgb中的亮度值3,且获取亮度值3对应的输出亮度值Iout(3)=85。影像处理器120将像素位置P47的输入亮度值250对应到全域映射曲线Cgb中的亮度值250,且获取亮度值250对应的输出亮度值Iout(250)=243。影像处理器120将像素位置P102的输入亮度值4对应到全域映射曲线Cgb中的亮度值4,且获取亮度值4对应的输出亮度值Iout(4)=104。而其他像素位置的输入亮度值同样以此方式找到对应的输出亮度值,故在此不再赘述。Therefore, the
在步骤260后,影像处理器120将在每一个像素位置中,根据对应的输入亮度值与多个邻近输入亮度值之间的一亮度关系来调整对应的输出亮度值,以产生一最后亮度值(步骤S270)。更进一步来说,由于输入亮度值是由入射光(举例输入亮度值的低频部分)与反射光(举例输入亮度值的高频部分)合成,且在本实施例为输入亮度值=入射光*反射光。若影像处理器120可将低频部分移除,将可以针对高频部分来进行加强。After
因此,请同时参考图2B,影像处理器120将根据对应的输入亮度值与邻近输入亮度值计算至少一高频像素比例,并将至少一高频像素比例作为亮度关系(步骤S271)。而至少一高频像素比例是关联于对应的像素位置的输入亮度值与至少一低频像素值。Therefore, please refer to FIG. 2B at the same time, the
在本实施例中,由于影响入射光的因素很多,故影像处理器120利用至少一个低频率波器来模拟影不同的入射光。因此,影像处理器120将根据对应的输入亮度值与邻近输入亮度值来计算至少一低频像素值,并计算对应的输入亮度值与至少一低频像素值的比例关系,以产生至少一高频像素比例。In this embodiment, since there are many factors affecting the incident light, the
以图7的输入影像Fr1的像素位置P22以及影像处理器120通过具有3*3遮罩与5*5遮罩的平均滤波器计算两个低频像素值来作说明。像素位置P22的输入亮度值及其邻近输入亮度值组成像素组F1且表示于图8。影像处理器120将通过具有5*5遮罩的平均滤波器计算一低频像素值(即(1+2+3+4+5+1+2+3+4+5+1+2+3+4+5+1+2+3+4+5+1+2+3+4+5)/25=3)。接着,影像处理器120将计算对应的输入亮度值与低频像素值的比例关系以产生一高频像素比例(即3/3=1)。For illustration, the pixel position P22 of the input image Fr1 in FIG. 7 and the
类似地,影像处理器120将通过具有3*3遮罩的平均滤波器计算另一低频像素值(即(2+3+4+2+3+4+2+3+4)/9=3)。接着,影像处理器120将计算对应的输入亮度值与另一低频像素值的比例关系以产生另一高频像素比例(即3/3=1)。影像处理器120接着将上述两个高频像素比例相乘(即1*1=1)来作为亮度关系。Similarly, the
在取得亮度关系(即步骤S271)后,影像处理器120将根据亮度关系调整对应的输出亮度值,以产生最后亮度值(步骤S273)。在本实施例中,最后亮度值=亮度关系*输出亮度值=1*3=3,以表示影像处理器120根据亮度关系(=1)调整对应的输出亮度值(=3)以产生最后亮度值(=3)。而当最后亮度值大于有效动态范围中的一最高亮度值(本实施例为255)时,影像处理器120将最高亮度值作为最后亮度值。当然影像处理器120亦可以其他计算方式与亮度关系来调整对应的输出亮度值以产生最后亮度值,本发明对此不作限制。After obtaining the luminance relationship (ie, step S271 ), the
由上述可知,像素组F1中像素位置P22的输入亮度值与这些邻近输入亮度值差距很小(即平均分布)。因此,影像处理器120不需要调整输出亮度值,使得像素位置P22的最后亮度值等于输出亮度值。It can be seen from the above that the difference between the input luminance values of the pixel position P22 in the pixel group F1 and these adjacent input luminance values is very small (ie, evenly distributed). Therefore, the
再以图7的输入影像Fr1的像素位置P47以及影像处理器120通过具有3*3遮罩与5*5遮罩的平均滤波器计算两个低频像素值来作说明。像素位置P47的输入亮度值及其邻近输入亮度值组成像素组F2且表示于图9。其中一个低频像素值=(6+6+7+8+8+6+6+250+7+8+6+6+250+10+7+9+9+250+10+10+9+9+10+10+10)/25=37.08,且对应的高频像素比例=250/37.08=6.74。另一个低频像素值=(6+250+7+6+250+10+9+250+10)/9=88.67,且对应的高频像素比例=250/88.67=2.82。而亮度关系=6.74*2.82=19。最后亮度值=亮度关系*输出亮度值=19*250=4752。而最后亮度值大于有效动态范围Deff中的一最高亮度值255,故影像处理器120将最高亮度值255作为最后亮度值。Next, the pixel position P47 of the input image Fr1 in FIG. 7 and the
由上述可知,像素组F2中像素位置P47的输入亮度值与这些邻近输入亮度值差距很大,且像素位置P47的输入亮度值高于这些邻近输入亮度值。因此,影像处理器120将调亮输出亮度值,使得像素位置P47的最后亮度值与邻近输入亮度值差距更大,以更提高像素位置P47的对比度。It can be seen from the above that the input luminance value of the pixel position P47 in the pixel group F2 is very different from these adjacent input luminance values, and the input luminance value of the pixel position P47 is higher than these adjacent input luminance values. Therefore, the
再以图7的输入影像Fr1的像素位置P102以及影像处理器120通过具有3*3遮罩与5*5遮罩的平均滤波器计算两个低频像素值来作说明。像素位置P102的输入亮度值及其邻近输入亮度值组成像素组F3且表示于图10。其中一个低频像素值=(249+249+249+249+249+249+249+249+249+249+1+4+4+4+1+250+250+250+250+250+251+251+251+253+255)/25=200.6,且对应的高频像素比例=4/200.6=0.02。另一个低频像素值=(249+249+249+4+4+4+250+250+250)/9=167.7,且对应的高频像素比例=4/167.7=0.02。而亮度关系=0.02*0.02=0。最后亮度值=亮度关系*输出亮度值=0*4=0。Next, the pixel position P102 of the input image Fr1 in FIG. 7 and the
由上述可知,像素组F3中像素位置P102的输入亮度值与这些邻近输入亮度值差距很大,且像素位置P102的输入亮度值低于这些邻近输入亮度值。因此,影像处理器120将调暗输出亮度值,使得像素位置P102的最后亮度值与邻近输入亮度值差距更大,以更提高像素位置P102的对比度。It can be seen from the above that the input luminance value of the pixel position P102 in the pixel group F3 is very different from these adjacent input luminance values, and the input luminance value of the pixel position P102 is lower than these adjacent input luminance values. Therefore, the
因此,由上述输入影像Fr1的像素组F1至F3可知,当像素组中的输入亮度值差距很小(如像素组F1)时,代表目前像素位置(如像素位置P22)不是输入影像Fr1中的边缘部分,影像处理器120不会调整目前像素位置的输出亮度值,或根据差距的数值些微调整目前像素位置的输出亮度值。Therefore, from the pixel groups F1 to F3 of the above input image Fr1, it can be known that when the difference between the input luminance values in the pixel group is small (such as the pixel group F1), it means that the current pixel position (such as the pixel position P22) is not in the input image Fr1. In the edge portion, the
而当像素组中的输入亮度值差距很大(如像素组F2与F3)时,代表目前像素位置(如像素位置P47与102)是输入影像Fr1中的边缘部分,影像处理器120将会根据差距的数值、目前输入亮度与邻近输入亮度值的数值大小来调整目前像素位置的输出亮度值。如上述像素位置P47的输入亮度值与邻近输入亮度值差距很大,且像素位置P47的输入亮度值高于这些邻近输入亮度。又例如上述像素位置P102的输入亮度值与邻近输入亮度值差距很大,且像素位置P102的输入亮度值低于这些邻近输入亮度。When the difference between the input luminance values in the pixel group is very large (such as the pixel groups F2 and F3), it means that the current pixel position (such as the pixel positions P47 and 102) is the edge part of the input image Fr1, and the
因此,影像处理器120可以根据目前像素位置的输入亮度值及其邻近输入亮度值之间的亮度关系来适应性地调整目前像素位置的输出亮度值,以据此产生最后亮度值。Therefore, the
综上所述,本发明实施例所提供的一种基于动态范围压缩的对比增强方法及其电子装置,其通过一输入影像中每个像素位置的输入亮度值的出现次数来决定合适的有效动态范围,并据此估算全域映射曲线(Global Mapping Curve),接着再根据输入影像中每个像素位置的区域特性来调整输入亮度值映射的输出亮度值,以适应性地提高输入影像的对比度。据此,本发明的对比增强方法及其电子装置可以降低计算复杂度且产生较佳的影像对比度。To sum up, the embodiments of the present invention provide a contrast enhancement method based on dynamic range compression and an electronic device thereof, which determine an appropriate effective dynamic range by the number of occurrences of the input luminance value of each pixel position in an input image. Then, according to the regional characteristics of each pixel position in the input image, the output luminance value of the input luminance value mapping is adjusted to adaptively improve the contrast of the input image. Accordingly, the contrast enhancement method and the electronic device thereof of the present invention can reduce computational complexity and generate better image contrast.
以上所述仅为本发明的实施例,其并非用以局限本发明的权利要求。The above descriptions are merely embodiments of the present invention, and are not intended to limit the claims of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810758240.6A CN110717862B (en) | 2018-07-11 | 2018-07-11 | Contrast enhancement method based on dynamic range compression and electronic device thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810758240.6A CN110717862B (en) | 2018-07-11 | 2018-07-11 | Contrast enhancement method based on dynamic range compression and electronic device thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110717862A CN110717862A (en) | 2020-01-21 |
CN110717862B true CN110717862B (en) | 2022-07-19 |
Family
ID=69209008
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810758240.6A Active CN110717862B (en) | 2018-07-11 | 2018-07-11 | Contrast enhancement method based on dynamic range compression and electronic device thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110717862B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101766032A (en) * | 2007-09-14 | 2010-06-30 | 株式会社理光 | Image forming apparatus and image forming method |
CN102257531A (en) * | 2008-12-19 | 2011-11-23 | 高通股份有限公司 | High dynamic range image combining |
CN104408752A (en) * | 2014-12-11 | 2015-03-11 | 西安电子科技大学 | High dynamic range image compression method based on mixed tone mapping algorithm |
CN107240092A (en) * | 2017-05-05 | 2017-10-10 | 浙江大华技术股份有限公司 | A kind of image blur detection method and device |
CN107305685A (en) * | 2016-04-20 | 2017-10-31 | 瑞昱半导体股份有限公司 | Image contrast enhancement method and apparatus |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7738698B2 (en) * | 2006-01-26 | 2010-06-15 | Vestel Elektronik Sanayi Ve Ticaret A.S. | Method and apparatus for adjusting the contrast of an image |
-
2018
- 2018-07-11 CN CN201810758240.6A patent/CN110717862B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101766032A (en) * | 2007-09-14 | 2010-06-30 | 株式会社理光 | Image forming apparatus and image forming method |
CN102257531A (en) * | 2008-12-19 | 2011-11-23 | 高通股份有限公司 | High dynamic range image combining |
CN104408752A (en) * | 2014-12-11 | 2015-03-11 | 西安电子科技大学 | High dynamic range image compression method based on mixed tone mapping algorithm |
CN107305685A (en) * | 2016-04-20 | 2017-10-31 | 瑞昱半导体股份有限公司 | Image contrast enhancement method and apparatus |
CN107240092A (en) * | 2017-05-05 | 2017-10-10 | 浙江大华技术股份有限公司 | A kind of image blur detection method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110717862A (en) | 2020-01-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107680056B (en) | Image processing method and device | |
US9230304B2 (en) | Apparatus and method for enhancing image using color channel | |
US20140254928A1 (en) | Method and image processing device for image dynamic range compression with local contrast enhancement | |
JP6097588B2 (en) | Image processing apparatus and image processing method | |
US9396526B2 (en) | Method for improving image quality | |
CN104240194A (en) | Low-light-level image enhancement algorithm based on parabolic function | |
CN103218778A (en) | Image and video processing method and device | |
KR101499461B1 (en) | Histogram equalization apparatus using histogram compression | |
CN107993189B (en) | Image tone dynamic adjustment method and device based on local blocking | |
CN105825489B (en) | The infrared image enhancing method being combined with linear stretch is translated based on gray scale | |
KR101113483B1 (en) | Apparatus for enhancing visibility of color image | |
CN107918928B (en) | A color restoration method | |
US20170094242A1 (en) | Image processing apparatus, image processing method, and storage medium | |
JP5648849B2 (en) | Image processing apparatus and image processing method | |
WO2016051716A1 (en) | Image processing method, image processing device, and recording medium for storing image processing program | |
US20130287299A1 (en) | Image processing apparatus | |
CN110766622A (en) | Underwater image enhancement method based on brightness discrimination and Gamma smoothing | |
KR101516632B1 (en) | Bipartite histogram equalization apparatus maintain the rate of mean brightness of video using visual threshold | |
US10922796B2 (en) | Method of presenting wide dynamic range images and a system employing same | |
US20120106842A1 (en) | Method for image enhancement based on histogram modification and specification | |
CN110717862B (en) | Contrast enhancement method based on dynamic range compression and electronic device thereof | |
CN108305234A (en) | A kind of Double-histogram equalization methods based on optimal model | |
CN107451971A (en) | The blind convolved image restoring method of low-light (level) of priori is combined based on dark and Gauss | |
Jang et al. | Adaptive contrast enhancement using edge-based lighting condition estimation | |
US9210335B2 (en) | Method for generating HDR images using modified weight |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |