[go: up one dir, main page]

CN100388757C - Method for enhancing image contrast - Google Patents

Method for enhancing image contrast Download PDF

Info

Publication number
CN100388757C
CN100388757C CNB200610004232XA CN200610004232A CN100388757C CN 100388757 C CN100388757 C CN 100388757C CN B200610004232X A CNB200610004232X A CN B200610004232XA CN 200610004232 A CN200610004232 A CN 200610004232A CN 100388757 C CN100388757 C CN 100388757C
Authority
CN
China
Prior art keywords
gray value
transfer function
original
picture
value
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.)
Expired - Fee Related
Application number
CNB200610004232XA
Other languages
Chinese (zh)
Other versions
CN1809121A (en
Inventor
周明忠
谢曜任
黎焕欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
AUO Corp
Original Assignee
AU Optronics Corp
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 AU Optronics Corp filed Critical AU Optronics Corp
Priority to CNB200610004232XA priority Critical patent/CN100388757C/en
Publication of CN1809121A publication Critical patent/CN1809121A/en
Application granted granted Critical
Publication of CN100388757C publication Critical patent/CN100388757C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Picture Signal Circuits (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

一种影像处理方法是根据一画面中每个像素与其相邻像素彼此间的原始灰度值差,统计原始灰度值出现个数,并依据所统计出的灰度值出现个数以及前后两画面的对比变动幅度来决定此画面的对比加强程度。

Figure 200610004232

An image processing method is to count the number of original grayscale values according to the original grayscale value difference between each pixel and its adjacent pixels in a picture, and determine the contrast enhancement degree of the picture according to the counted number of grayscale values and the contrast change range of the previous and next pictures.

Figure 200610004232

Description

增强影像对比的方法 Methods of Enhancing Image Contrast

技术领域 technical field

本发明涉及一种影像处理的方法,且特别是有关于一种加强影像对比的方法。The invention relates to an image processing method, and in particular to a method for enhancing image contrast.

背景技术 Background technique

以往加强影像对比的方法仅是藉由统计画面中每个像素的灰度值出现个数,来决定加强此画面对比的程度。然而此种方法仅能在某种特定的情况下,提升画面中的影像对比。但在某些较最需要加强对比的情况下,例如观看DVD影片时,此种加强影像对比的方法会产生效果极差的影像。如图1所示,其为播放DVD影片时的画面示意图。DVD影片在播放时大多以16∶9的比例显示画面100,故在显示画面100(例如LCD屏幕)的上下两部份UP与DP均会显示黑画面。如此一来,以往加强影像对比的方法在对此画面100做对比加强时会因将UP与DP两部份的黑画面的灰度值统计进去,而造成对比加强后的画面100显得极不自然。此外,当前后两画面的灰度值统计曲线差异过大时,以往的加强影像对比的方法将造成影像画面闪烁的现象。In the past, the method of enhancing image contrast is only to determine the degree of enhancing the image contrast by counting the number of gray values of each pixel in the image. However, this method can only improve the image contrast in the frame under certain specific circumstances. However, in some situations where contrast enhancement is most needed, such as when watching DVD movies, this method of enhancing image contrast can produce extremely poor images. As shown in FIG. 1 , it is a schematic diagram of a screen when playing a DVD movie. When DVD movies are played, the display screen 100 is mostly displayed at a ratio of 16:9, so the upper and lower parts UP and DP of the display screen 100 (such as an LCD screen) will display black screens. In this way, the previous method of image contrast enhancement would count the gray values of the black images of the UP and DP parts when performing contrast enhancement on the image 100, resulting in an extremely unnatural appearance of the image 100 after contrast enhancement. . In addition, when the difference between the statistical curves of the gray values of the front and rear images is too large, the conventional method of enhancing image contrast will cause the phenomenon of image flickering.

因此,如何能在加强对比的同时亦维持影像自然特性以及避免影像画面闪烁的现象便是目前需要解决的课题。Therefore, how to enhance the contrast while maintaining the natural characteristics of the image and avoiding the flickering phenomenon of the image screen is an issue that needs to be solved at present.

发明内容 Contents of the invention

有鉴于此,本发明的目的是提供一种影像处理方法,其是在维持影像自然特性的条件下加强一影像的对比并维持影像画面的稳定。In view of this, the object of the present invention is to provide an image processing method, which enhances the contrast of an image and maintains the stability of the image frame under the condition of maintaining the natural characteristics of the image.

根据本发明的目的,提出一种影像处理方法。此影像至少由一第一画面f(N)所呈现。此第一画面f(N)是由多个像素所组成。每个像素分别对应至一原始灰度值,本发明的影像处理方法叙述如下。根据相邻两像素彼此间的原始灰度值的差异统计出原始灰度值出现个数,并以一第一转移函数F(X)表示。根据此第一转移函数F(X)计算出一伽码曲线,以及根据此伽码曲线选择性地调整这些原始灰度值为多笔调整后灰度值。其中上述统计这些原始灰度值出现个数的步骤还包括:当这些像素中的一第一像素的一第一原始灰度值与相邻的一第二像素的一第二原始灰度值差大于n时,n为0或正整数,第一原始灰度值与第二原始灰度值间的所有原始灰度值的统计个数或部份原始灰度值的统计个数均加1。According to the object of the present invention, an image processing method is proposed. The image is presented by at least a first frame f(N). The first frame f(N) is composed of a plurality of pixels. Each pixel corresponds to an original gray value, and the image processing method of the present invention is described as follows. According to the difference of the original gray value between two adjacent pixels, the number of the original gray value appears is counted, and expressed by a first transfer function F(X). A gamma curve is calculated according to the first transfer function F(X), and a plurality of adjusted gray values are selectively adjusted according to the gamma curve. The above-mentioned step of counting the number of occurrences of these original gray values also includes: when the difference between a first original gray value of a first pixel in these pixels and a second original gray value of an adjacent second pixel is When it is greater than n, n is 0 or a positive integer, and the statistical number of all original grayscale values or the statistical number of partial original grayscale values between the first original grayscale value and the second original grayscale value are increased by 1.

为使本发明的上述目的、特征、和优点能更明显易懂,下文特举一较佳实施例,并结合附图详细说明如下。In order to make the above-mentioned purpose, features, and advantages of the present invention more comprehensible, a preferred embodiment is specifically cited below, and is described in detail with reference to the accompanying drawings.

附图说明 Description of drawings

图1为播放DVD影片时的画面示意图。Figure 1 is a schematic diagram of the screen when playing a DVD movie.

图2为本发明较佳实施例的影像处理方法的流程图。FIG. 2 is a flowchart of an image processing method in a preferred embodiment of the present invention.

图3A为某一现行画面(unspecified current frame)的示意图。FIG. 3A is a schematic diagram of an unspecified current frame.

图3B为原始灰度值个数统计示意图。FIG. 3B is a schematic diagram of statistics of the number of original gray values.

图3C为原始灰度值个数统计示意图。FIG. 3C is a schematic diagram of the statistics of the number of original gray values.

图4A为计算伽码曲线的流程图。FIG. 4A is a flowchart of calculating a gamma curve.

图4B为计算伽码曲线的示意图。FIG. 4B is a schematic diagram of calculating a gamma curve.

图5为调整第三转移函数部份上下限值的示意图。FIG. 5 is a schematic diagram of adjusting the upper and lower limits of the third transfer function.

具体实施方式 Detailed ways

本发明提出一种影像处理方法,其是在维持影像自然特性的条件下加强一影像的对比并维持影像画面的稳定。本发明的影像处理方法根据每个像素与其相邻像素间的原始灰度值差,来统计这些原始灰度值出现个数,之后并依据所统计出的灰度值个数以及前后两画面的对比变动幅度来决定现行画面的对比加强程度。The invention proposes an image processing method, which enhances the contrast of an image and maintains the stability of the image frame under the condition of maintaining the natural characteristics of the image. The image processing method of the present invention counts the number of occurrences of these original gray values according to the original gray value difference between each pixel and its adjacent pixels, and then based on the counted number of gray values and The contrast change range is used to determine the degree of contrast enhancement of the current picture.

请参照图2,其为本发明较佳实施例的影像处理方法的流程图。一影像是由多张画面f(N)所呈现,N为正整数。每个画面f(N)是由多个像素所组成,例如由1028*768个像素所组成。每个像素均分别对应至一原始灰度值(graylevel)GL。本发明的影像处理方法包括下列步骤。于步骤200,根据每个像素与其相邻像素间的原始灰度值差,来统计这些原始灰度值出现个数并以第一转移函数Fi(X)表示,i为1至N间的正整数。于步骤202,根据第一转移函数Fi(X)计算出一伽码曲线(Gamma Curve)。之后于步骤204,根据此伽码曲线选择性地调整这些原始灰度值为多笔调整后灰度值。Please refer to FIG. 2 , which is a flowchart of an image processing method according to a preferred embodiment of the present invention. An image is presented by multiple frames f(N), where N is a positive integer. Each frame f(N) is composed of multiple pixels, for example, 1028*768 pixels. Each pixel is respectively corresponding to an original gray level (graylevel) GL. The image processing method of the present invention includes the following steps. In step 200, according to the original gray value difference between each pixel and its adjacent pixels, the number of occurrences of these original gray values is counted and represented by the first transfer function F i (X), where i is a value between 1 and N positive integer. In step 202, a gamma curve (Gamma Curve) is calculated according to the first transfer function F i (X). Then in step 204, the original grayscale values are selectively adjusted according to the gamma curve to a plurality of adjusted grayscale values.

进一步来说明步骤200的统计方法。请参照图3A,其为某一现行画面(unspecified current frame)的示意图。一第一画面f(1)为影像中的某一画面。第一画面f(1)中的每个空格代表一个像素P,而空格中所标示的数字代表每个像素P所对应到的原始灰度值GL。以第一画面f(1)中左上角3*3个像素P(1)~P(9)来说明统计此第一画面f(1)的原始灰度值出现个数的原则。此原则为:「当每个像素与相邻像素彼此间的原始灰度值差大于n时,n为0或正整数的一预定值,将每个像素所对应到的原始灰度值与相邻像素所对应到的原始灰度值间的所有原始灰度值的统计个数或部份原始灰度值的统计个数均加1。」以n为0及以第九像素P9为例说明,第九像素P9与第六像素P6及第8像素P8相邻。第九像素P9与第六像素P6彼此间的原始灰度值差为21灰度(95-74=21>0),故将原始灰度值74到95间的所有原始灰度值(74、75、76、...94、95)的统计个数均加1,如图3B所标示的实线箭头。图3B为原始灰度值个数统计示意图。而第九像素P9与第八像素P8彼此间的原始灰度值差为19灰度(93-74=19>0),故将原始灰度值74到93间的所有原始灰度值(74、75、...92、93)的统计个数再加1,如图3B所标示的虚线箭头。以此原则对像素P1~P9的每笔原始灰度值GL作统计将得到此第一画面f(1)的部份灰度值个数统计图,即如图3C所示,其为原始灰度值个数统计示意图。The statistical method of step 200 will be further described. Please refer to FIG. 3A, which is a schematic diagram of an unspecified current frame. A first frame f(1) is a certain frame in the video. Each space in the first frame f(1) represents a pixel P, and the number marked in the space represents the original gray value GL corresponding to each pixel P. Taking the 3*3 pixels P(1)-P(9) in the upper left corner of the first frame f(1) to illustrate the principle of counting the number of occurrences of the original gray value of the first frame f(1). This principle is: "When the original gray value difference between each pixel and adjacent pixels is greater than n, and n is a predetermined value of 0 or a positive integer, the original gray value corresponding to each pixel and the corresponding Add 1 to the statistical number of all original grayscale values or the statistical number of partial original grayscale values between the original grayscale values corresponding to adjacent pixels.” Take n as 0 and take the ninth pixel P9 as an example for illustration , the ninth pixel P9 is adjacent to the sixth pixel P6 and the eighth pixel P8. The original grayscale value difference between the ninth pixel P9 and the sixth pixel P6 is 21 grayscales (95−74=21>0), so all original grayscale values between 74 and 95 original grayscale values (74, 75, 76, . FIG. 3B is a schematic diagram of statistics of the number of original gray values. The original grayscale value difference between the ninth pixel P9 and the eighth pixel P8 is 19 grayscales (93-74=19>0), so all the original grayscale values between the original grayscale values 74 to 93 (74 , 75, ... 92, 93) plus 1, as indicated by the dotted arrow in Figure 3B. Using this principle to make statistics on each original gray value GL of the pixels P1-P9 will obtain a statistical map of the number of partial gray values of the first frame f(1), as shown in Figure 3C, which is the original gray value Schematic diagram of degree value statistics.

相较于以往的做法(即仅是统计画面中每个像素的原始灰度值出现个数),本发明的统计原则考虑到相邻像素彼此间的原始灰度值差异。如此,统计出来的第一转移函数Fi(X)考虑到画面中影像边缘的灰度值差异,使得依据此第一转移函数Fi(X)所求出的伽码曲线,其所修正的影像在对比的表现上更为自然。此外,上述n亦可为1或其它正整数,而统计方式亦可以是将每个像素所对应到的原始灰度值与相邻像素所对应到的原始灰度值间的部份原始灰度值的统计个数均加1。以第九像素P9与第八像素P8为例,可将原始灰度值74到95间的差值为2的部份原始灰度值的统计个数加1,例如74、76、78...92、94、95,以此规则,可选择原始灰度值差值为3、4或其它差值的部分原始灰度值为统计对象,本发明并不局限差值的值。Compared with the previous method (that is, only counting the number of occurrences of the original gray value of each pixel in the frame), the statistical principle of the present invention takes into account the difference in original gray value between adjacent pixels. In this way, the statistically calculated first transfer function F i (X) takes into account the difference in gray value at the edge of the image in the frame, so that the gamma curve obtained based on the first transfer function F i (X) is corrected. Images are more natural in terms of contrast. In addition, the above n can also be 1 or other positive integers, and the statistical method can also be the partial original gray value between the original gray value corresponding to each pixel and the original gray value corresponding to the adjacent pixel The statistical number of values is increased by 1. Taking the ninth pixel P9 and the eighth pixel P8 as an example, it is possible to add 1 to the statistical number of the partial original gray value whose difference between the original gray value 74 and 95 is 2, such as 74, 76, 78.. .92, 94, 95, according to this rule, can choose the original gray value difference of 3, 4 or other partial original gray value as statistical object, the present invention does not limit the value of difference.

接着说明计算出伽码曲线的方法。以上述统计方式对第一画面f(1)的所有像素的原始灰度值做统计以求出第一转移函数F1(X)后,于步骤202经由适当地计算求出一伽码曲线G(X)。请同时参照图4A与图4B。图4A为计算伽码曲线的流程图。图4B为计算伽码曲线的示意图。于步骤400,线性转换第一转移函数Fi(X)。为了限制第一转移函数Fi(X)输出值的范围,线性转换第一转移函数Fi(X),例如对第一转移函数F1(X)开根号。接着于步骤402,累加(accumulate)经线性转换后的第一转移函数Fi(X),以得到一第二转移函数F’i(X)。于步骤404,标准化(nomalize)第二转移函数F’i(X),以得到一第三转移函数F”i(X)。例如将第一画面f(1)的第二转移函数F’1(X)的统计个数标准化至最大灰度值(例如255灰度),以得到第三转移函数F”1(X)。接着于步骤406,将第三转移函数F”i(X)乘上K再加上一参数P(X)以得到一伽码曲线G(X)。其中如图4B所示此参数P(X)例如为斜率为1-K的曲线,K是介于0~1间的任意值,可预先选定。至此,将可计算出第一画面f(1)的伽码曲线G1(X)。计算出伽码曲线G1(X)后,便可依据伽码曲线G1(X)调整第一画面f(1)的原始灰度值GL。Next, the method of calculating the gamma curve will be described. After performing statistics on the original gray values of all pixels in the first frame f(1) in the above statistical manner to obtain the first transfer function F 1 (X), a gamma curve G is obtained through appropriate calculation in step 202 (X). Please refer to FIG. 4A and FIG. 4B at the same time. FIG. 4A is a flowchart of calculating a gamma curve. FIG. 4B is a schematic diagram of calculating a gamma curve. In step 400, the first transfer function F i (X) is linearly transformed. In order to limit the range of the output value of the first transfer function F i (X), the first transfer function F i (X) is linearly transformed, for example, the square root of the first transfer function F 1 (X) is taken. Next, in step 402, the linearly converted first transfer function F i (X) is accumulated (accumulate) to obtain a second transfer function F' i (X). In step 404, normalize (nomalize) the second transfer function F' i (X) to obtain a third transfer function F" i (X). For example, the second transfer function F' 1 of the first frame f(1) The statistical number of (X) is normalized to the maximum grayscale value (for example, 255 grayscales), so as to obtain the third transfer function F″ 1 (X). Then in step 406, the third transfer function F" i (X) is multiplied by K and a parameter P (X) is added to obtain a gamma curve G (X). Among them, as shown in Figure 4B, the parameter P (X ) is, for example, a curve with a slope of 1-K, and K is any value between 0 and 1, which can be pre-selected. So far, the gamma curve G 1 (X) of the first frame f(1) can be calculated After the gamma curve G 1 (X) is calculated, the original gray value GL of the first frame f(1) can be adjusted according to the gamma curve G 1 (X).

由于第一转移函数F1(X)考虑到画面中影像边缘的灰度值差异,因此当第一画面f(1)为16∶9的DVD影片时,依据此伽码曲线G1(X)调整后的第一画面f(1)将呈现出较佳的对比效果。Since the first transfer function F 1 (X) takes into account the difference in the gray value of the image edge in the frame, when the first frame f(1) is a 16:9 DVD movie, according to the gamma curve G 1 (X) The adjusted first frame f(1) will present a better contrast effect.

此外,为了维持画面的平稳性,即避免画面亮度的剧烈变动而造成影像不自然或影像闪烁的现象,可藉由限制上述各种转移函数F(X)的输出值以使得伽码曲线的变动率较为平稳。例如调整此第三转移函数F”i(X)的部份上下限值,以得到一第四转移函数F”’i(X)。如图5所示,其为调整第三转移函数部份上下限值的示意图。第三转移函数F”(X)例如乘上两转移函数J1(X)与J2(X)以得一第四转移函数F”’i(X)。当第三转移函数F”(X)大于转移函数J1(X)时,输出转移函数J1(X),而转移函数F”(X)小于转移函数J2(X)时,输出转移函数J2(X)。之后依据此第四转移函数F”’i(X)产生另一伽码曲线G’(X)。例如经由上述步骤406处理后为另一伽码曲线G’(X)。In addition, in order to maintain the stability of the picture, that is to avoid the phenomenon of unnatural image or image flicker caused by the sharp change of the picture brightness, the change of the gamma curve can be made by limiting the output value of the above-mentioned various transfer functions F(X). rate is relatively stable. For example, a part of the upper and lower limits of the third transfer function F" i (X) is adjusted to obtain a fourth transfer function F"' i (X). As shown in FIG. 5 , it is a schematic diagram of adjusting the upper and lower limits of the third transfer function. For example, the third transfer function F"(X) is multiplied by the two transfer functions J1(X) and J2(X) to obtain a fourth transfer function F"' i (X). When the third transfer function F”(X) is greater than the transfer function J1(X), the output transfer function J1(X), and when the transfer function F”(X) is smaller than the transfer function J2(X), the output transfer function J2(X ). Afterwards, another gamma curve G'(X) is generated according to the fourth transfer function F"' i (X). For example, another gamma curve G'(X) is obtained after being processed in step 406 above.

或者根据第二转移函数F’i(X)来判断是否要根据伽码曲线G(X)调整现行画面的原始灰度值GL。即第二转移函数F’1(X)的累加最大值大于一第一默认值W1时,根据伽码曲线G(X)调整现行画面的原始灰度值。例如当第一画面f(1)的第二转移函数F’1(X)小于此第一默认值W1时,即累加个数未大于此默认值W1,则定义此第一画面f(1)为平滑场景,否则为一般场景。于平滑场景下,不使用上述伽码曲线G1(X)调整此第一画面f(1)的原始灰度值GL以使影像画面保持稳定。而于一般场景下,则使用上述伽码曲线G1(X)调整此第一画面f(1)的原始灰度值GL。此外,也可藉由伽码曲线G1’(X)调整第一画面f(1)的原始灰度值GL以使影像画面保持稳定。Or judge whether to adjust the original gray value GL of the current picture according to the gamma curve G(X) according to the second transfer function F' i (X). That is, when the accumulated maximum value of the second transfer function F' 1 (X) is greater than a first default value W1, the original grayscale value of the current frame is adjusted according to the gamma curve G(X). For example, when the second transfer function F' 1 (X) of the first picture f(1) is smaller than the first default value W1, that is, the accumulated number is not greater than the default value W1, then the first picture f(1) is defined is a smooth scene, otherwise it is a general scene. In a smooth scene, the original gray value GL of the first frame f(1) is adjusted without using the gamma curve G 1 (X) to keep the image frame stable. In general scenarios, the original gray value GL of the first frame f(1) is adjusted using the gamma curve G 1 (X). In addition, the original gray value GL of the first frame f(1) can also be adjusted through the gamma curve G 1 ′(X) to keep the image frame stable.

或者,由于影像是由多个画面f(N)呈现,每个画面f(N)均会分别对应至一原始灰度值个数统计图,即第一转移函数Fi(X)。藉由比较前后两画面的两第一转移函数Fi(X),以判断是否要根据现行画面的伽码曲线G(X)或前一画面的伽码曲线G(X)来调整现行画面的原始灰度值GL。该比较的方式可为比较前后两画面的同一像素或同一像素区的灰度差是否在一预定容忍值之外或之内。以第一画面f(1)及第一画面f(1)之前一画面,一第二画面f(0),为例说明。第一画面f(1)对应至第一转移函数F1(X),而第二画面f(0)对应至另一第一转移函数F0(X)。首先,积分第一画面f(1)的第一转移函数F1(X),以得到一第一积分值E1。接着将第一画面f(1)的第一转移函数F1(X)减去第二画面f(0)的第一转移函数F0(X)后,取其绝对值并据以积分出一第二积分值E2。当第二积分值E2与第一积分值E1的比值大于一第二默认值时W2,则视现行的第一画面f(1)与第二画面f(0)具有显著的差异存在。具有显著的差异时,第一画面f(1)的原始灰度值GL根据第一转移函数F1(X)所产生的伽码曲线G1(X)做调整,否则第一画面f(1)的原始灰度值GL根据前一画面的第一转移函数F0(X)所产生的另一伽码曲线G0(X)做调整。Alternatively, since the image is presented by a plurality of frames f(N), each frame f(N) is respectively corresponding to a statistics map of the number of original gray values, that is, the first transfer function F i (X). By comparing the two first transfer functions F i (X) of the two frames before and after, it is judged whether to adjust the gamma curve G(X) of the current frame or the gamma curve G(X) of the previous frame to adjust the gamma curve of the current frame Raw gray value GL. The method of the comparison may be to compare whether the gray level difference of the same pixel or the same pixel area of the two frames before and after is outside or within a predetermined tolerance value. Take the first frame f(1) and the frame before the first frame f(1), a second frame f(0) as an example for illustration. The first frame f(1) corresponds to a first transfer function F 1 (X), and the second frame f(0) corresponds to another first transfer function F 0 (X). First, integrate the first transfer function F 1 (X) of the first frame f(1) to obtain a first integral value E1. Next, after subtracting the first transfer function F 1 (X) of the first frame f(1) from the first transfer function F 0 (X) of the second frame f(0), the absolute value is taken and integrated to obtain a The second integral value E2. When the ratio of the second integral value E2 to the first integral value E1 is greater than a second default value W2, it is considered that there is a significant difference between the current first frame f(1) and the second frame f(0). When there is a significant difference, the original gray value GL of the first frame f(1) is adjusted according to the gamma curve G 1 (X) generated by the first transfer function F 1 (X), otherwise the first frame f(1 ) is adjusted according to another gamma curve G 0 (X) generated by the first transfer function F 0 (X) of the previous frame.

综上所述,上述方法均是根据各种不同形式的转移函数Fi(X)来调整伽码曲线的变动率或选择前一画面的伽码曲线,以避免画面亮度的剧烈变动而造成影像不自然或影像闪烁的现象。To sum up, the above methods are all based on various forms of transfer functions F i (X) to adjust the rate of change of the gamma curve or to select the gamma curve of the previous frame, so as to avoid sharp changes in the brightness of the frame and cause image distortion. Unnatural or flickering images.

此外,上述第三种做法是比较前后两画面对应的第一转移函数Fi(X),以判断是否要根据现行画面的伽码曲线G(X)或前一画面的伽码曲线G(X)来调整现行画面的原始灰度值GL。还可藉由比较前后两画面的两第一像素转移函数Hi(X),以判断是否要根据现行画面的伽码曲线G(X)或前一画面的伽码曲线G(X)来调整现行画面的原始灰度值GL。第一像素转移函数Hi(X)用以表示一画面所统计出的原始灰度值个数,即以往统计画面中每个像素的原始灰度值出现个数。进一步来说,亦以第一画面f(1)及第二画面f(0)为例做说明。首先统计第一画面f(1)中每笔原始灰度值出现个数,并以一第一像素转移函数H1(X)表示;以及统计第二画面f(0)的每笔原始灰度值出现个数,并亦以另一第二像素转移函数HN-1(X)表示。接着,积分第一像素转移函数HN(X),为另一第一积分值E1’之后,将第一像素转移函数H1(X)与第二像素转移函数H0(X)相减后取绝对值并对其积分,以为一第二积分值E2’。当第二积分值E2’与第一积分值E1’的比值大于一第三默认值W2时,则视现行的第一画面f(1)与前一画面f(0)具有显著的差异存在。此时第一画面f(1)的原始灰度值GL根据第一转移函数FN(X)所产生的伽码曲线G(X)调整为调整后灰度值GL’,否则第一画面f(1)的原始灰度值GL根据前一画面的第一转移函数F0(X)所产生的另一伽码曲线G(X)调整为调整后灰度值GL’。因此,本发明亦可藉由以往的统计方式,即第一像素转移函数Hi(X),来判断要使用现行画面或前一画面的伽码曲线来调整现行画面的原始灰度值GL,以避免画面亮度的剧烈变动而造成影像不自然或影像闪烁的现象。In addition, the above-mentioned third method is to compare the first transfer function F i (X) corresponding to the two frames before and after, so as to judge whether to use the gamma curve G(X) of the current frame or the gamma curve G(X) of the previous frame ) to adjust the original gray value GL of the current picture. It is also possible to judge whether to adjust according to the gamma curve G(X) of the current picture or the gamma curve G(X) of the previous picture by comparing the two first pixel transfer functions H i (X) of the two pictures before and after The original gray value GL of the current picture. The first pixel transfer function H i (X) is used to represent the counted number of original grayscale values of a frame, that is, the number of occurrences of original grayscale values of each pixel in the previous counted frame. Further, the first frame f(1) and the second frame f(0) are also taken as examples for illustration. First count the number of occurrences of each original gray value in the first frame f(1), and express it with a first pixel transfer function H 1 (X); and count the number of each original gray value in the second frame f(0) The number of occurrences of the value is also represented by another second pixel transfer function H N-1 (X). Next, after integrating the first pixel transfer function H N (X) to obtain another first integral value E1', after subtracting the first pixel transfer function H 1 (X) from the second pixel transfer function H 0 (X) The absolute value is taken and integrated to obtain a second integral value E2'. When the ratio of the second integral value E2' to the first integral value E1' is greater than a third default value W2, it is considered that there is a significant difference between the current first frame f(1) and the previous frame f(0). At this time, the original gray value GL of the first frame f(1) is adjusted to the adjusted gray value GL' according to the gamma curve G(X) generated by the first transfer function F N (X), otherwise the first frame f The original gray value GL of (1) is adjusted to the adjusted gray value GL′ according to another gamma curve G(X) generated by the first transfer function F 0 (X) of the previous frame. Therefore, the present invention can also use the conventional statistical method, that is, the first pixel transfer function H i (X), to determine whether to use the gamma curve of the current frame or the previous frame to adjust the original gray value GL of the current frame, In order to avoid unnatural or flickering images caused by drastic changes in screen brightness.

除此之外,原始灰度值GL不论以上述何种伽码曲线,例如伽码曲线Gi(X)、G’i(X)、Gi-1(X)或G’i-1(X)做调整后,均有可能会造成某些像素的颜色产生色偏。例如原本呈现近似于红色的像素,其原始RGB灰度值GL为(255,12,12)。此像素经上述伽码曲线调整后,其RGB灰度值GL被调整成(255,30,30),因而改呈现粉红色。因此,需经由一个称为“色纯度权重机制”的调整,例如降低对比加强的比例,以使画面f(N)看起来更自然。换句话说,此机制用以确保:当像素中的RGB三种颜色中任何一种颜色接近饱和时,不会因为上述的影像处理方法造成色偏的现象。即避免像素的原始灰度GL(255,12,12)被调整成(255,30,30)的情况。此色纯度权重机制为GLnew=〔GL*max(RGB)+GL’*(B-max(RGB))〕/B。其中B为正整数,GL为原始灰度值,而GL’是例如经伽码曲线GN(X)、G’N(X)、GN-1(X)或G’N-1(X)调整后的调整后灰度值GL’,以及式中的max(RGB)为原始灰度值GL中取最大的灰度值。以原始灰度值GL为(255,12,12)、调整后灰度值GL’为(255,30,30)及B为256为例做说明,则Lnew={(255,12,12)X255+(255,30,30)X(256-255)}/256,即GLnew近似于(255,12,12)。如此,当原始灰度值GL(255,12,12)经过上述各种伽码曲线调整后,由原本的红色变成近似于粉红色(255,30,30)时,再经由此色纯度权重机调整为近似于原本的彩度表现,即新的调整整后的灰度值GLnew(255,12,12),使画面看起来更自然。In addition, no matter what kind of gamma curve the original gray value GL uses, such as gamma curve G i (X), G' i (X), G i-1 (X) or G' i-1 ( X) After adjustment, there may be a color shift in the color of some pixels. For example, the original RGB gray value GL of a pixel that is approximately red is (255, 12, 12). After the pixel is adjusted by the above-mentioned gamma curve, its RGB gray value GL is adjusted to (255, 30, 30), so it appears pink. Therefore, an adjustment called "color purity weighting mechanism" is required, such as reducing the ratio of contrast enhancement, so that the picture f(N) looks more natural. In other words, this mechanism is used to ensure that when any one of the three colors of RGB in a pixel is close to saturation, there will be no color cast caused by the above-mentioned image processing method. That is to avoid the situation that the original gray level GL (255, 12, 12) of the pixel is adjusted to (255, 30, 30). The color purity weighting mechanism is GL new = [GL*max(RGB)+GL'*(B-max(RGB))]/B. Where B is a positive integer, GL is the original gray value, and GL' is, for example, the gamma curve G N (X), G' N (X), G N-1 (X) or G' N-1 (X ) adjusted grayscale value GL' after adjustment, and max(RGB) in the formula is the maximum grayscale value among the original grayscale values GL. Taking the original gray value GL as (255, 12, 12), the adjusted gray value GL' as (255, 30, 30) and B as 256 as an example, then L new = {(255, 12, 12 )X255+(255, 30, 30)X(256-255)}/256, that is, GL new is approximately (255, 12, 12). In this way, when the original gray value GL (255, 12, 12) is adjusted by the above-mentioned various gamma curves, when the original red becomes close to pink (255, 30, 30), and then through this color purity weight The machine is adjusted to approximate the original chroma performance, that is, the new adjusted gray value GL new (255, 12, 12), which makes the picture look more natural.

某些像素经过上述“色纯度权重机制”调整后,其新的调整后的灰度值GLnew的对比其实还可以再调得更高一些。因此本发明还包括另一色纯度权重机制。此色纯度权重机制叙述如下:After some pixels are adjusted by the above-mentioned "color purity weighting mechanism", the contrast of the new adjusted gray value GL new can actually be adjusted higher. Therefore, the present invention also includes another color purity weighting mechanism. The color purity weight mechanism is described as follows:

GL’new=(PLC*GL’+PL*GL)/BGL' new =(P LC *GL'+P L *GL)/B

上述PL=n*max(RGB)+m*color_gap,m+n=1而PLC=B-PL,color_gap=max(RGB)-min(RGB)。其中B亦为正整数,而color_gap为原始灰度值GL中取最大的灰度值与原始灰度值GL中取最小的灰度值的差。此色纯度权重机制用以当某些像素的颜色接近白色时,即RGB三色的灰度值彼此均很接近,可藉此公式增强对比度。即藉由第二色纯度权重机制,可以于某些像素的RGB三色的灰度值彼此很接近且RGB三色的灰度值接近255时,亦调整RGB三色的灰度值以增强度对比度。换句话说,此“第二个色纯度权重机制在经”第一个色纯度权重机制”调整后,某些对比的比例可以调整更大的灰度值因为“第一个色纯度权重机制”调整而造成对比的比例下降时,重新将对比的比例再调高一点,以使影像的对比更明显。例如当GL(200,198,202),其接近白色。此GL(200,198,202)的对比比例经“第一个色纯度权重机制”调整后,假设为GLnew(211,210,213)。但是,GLnew(200,198,202)的对比比例可以再更高一点,即也就是说,对比加强。因此经由“第二个色纯度权重机制”调整其比例为更大,使影像的对比更为加强。The above P L =n*max(RGB)+m*color_gap, m+n=1 and P LC = BPL , color_gap=max(RGB)-min(RGB). Wherein B is also a positive integer, and color_gap is the difference between the largest gray value in the original gray value GL and the smallest gray value in the original gray value GL. This color purity weighting mechanism is used when the color of some pixels is close to white, that is, the gray values of the RGB three colors are very close to each other, and the contrast can be enhanced by this formula. That is, through the second color purity weighting mechanism, when the gray values of the RGB three colors of some pixels are very close to each other and the gray values of the RGB three colors are close to 255, the gray values of the RGB three colors can also be adjusted to enhance the intensity contrast. In other words, after the "second color purity weighting mechanism" is adjusted by the "first color purity weighting mechanism", the ratio of certain contrasts can be adjusted to a larger gray value because of the "first color purity weighting mechanism" When the adjustment causes the ratio of the contrast to decrease, re-adjust the ratio of the contrast to make the contrast of the image more obvious. For example, when GL (200, 198, 202), it is close to white. This GL (200, 198, 202 ) is adjusted by the "first color purity weighting mechanism", which is assumed to be GL new (211, 210, 213). However, the contrast ratio of GL new (200, 198, 202) can be a little higher, namely That is to say, the contrast is enhanced. Therefore, the ratio is adjusted to be larger through the "second color purity weighting mechanism", so that the contrast of the image is strengthened.

本发明上述实施例所披露的影像处理方法,其是在维持影像自然特性的条件下加强一影像的对比并维持影像画面的稳定。The image processing method disclosed in the above-mentioned embodiments of the present invention enhances the contrast of an image and maintains the stability of the image frame under the condition of maintaining the natural characteristics of the image.

综上所述,虽然本发明已以一较佳实施例披露如上,然其并非用以限定本发明,本领域的技术人员在不脱离本发明的精神和范围的前提下可作各种的更动与润饰,因此本发明的保护范围以本发明的权利要求为准。In summary, although the present invention has been disclosed as above with a preferred embodiment, it is not intended to limit the present invention, and those skilled in the art can make various modifications without departing from the spirit and scope of the present invention. Movement and retouching, so the protection scope of the present invention shall be determined by the claims of the present invention.

Claims (8)

1. image treatment method, this image is presented by one first picture f (N) at least, and this first picture f (N) is made up of a plurality of pixel, and each pixel corresponds to an original gray value respectively, and this image treatment method comprises:
Neighbor original gray value to each other according to each pixel and this pixel is poor, adds up the appearance number of these original gray value, and with one first transfer function F i(X) expression, i is the positive integer between 1 to N, and N is a positive integer, and X is 0 to 255 integer;
According to this first transfer function F i(X) calculate a gamma curve;
Optionally adjusting these original gray value according to this gamma curve is the whole back of many styles gray value;
Wherein, this image also comprises one second picture f (N-1), this second picture f (N-1) is in the preceding appearance of this first picture f (N), and these original gray value of described adjustment comprise for these steps of adjusting the back gray value: this first transfer function F of integration this first picture f (N) N(X), think a first integral value; The first transfer function F with this first picture f (N) N(X) deduct the first transfer function F of this second picture f (N-1) N-1(X) after, take absolute value and according to this integration go out a second integral value; And
When the ratio of this second integral value and this first integral value during greater than one second default value, these original gray value of this first picture f (N) are first transfer function F according to this first picture N(X) be adjusted into these and adjust the back gray value, otherwise these original gray value of this first picture f (N) are first transfer function F according to this second picture f (N-1) N-1(X) be adjusted into these and adjust the back gray value.
2. image treatment method as claimed in claim 1, wherein add up the step that number appears in these original gray value and also comprise:
When one second original gray value difference of one first original gray value of one first pixel in these pixels and adjacent one second pixel during greater than n, n is 0 or positive integer, the statistics number of all these original gray value between this first original gray value and this second original gray value or partly a statistics number average of these original gray value add 1.
3. image treatment method as claimed in claim 1, the step that wherein calculates this gamma curve also comprises:
This first transfer function of linear transformation F i(X);
This first transfer function F after linearity conversion adds up i(X), to obtain one second transfer function F ' i(X);
This second transfer function of standardization F ' i(X), to obtain one the 3rd transfer function F " i(X); And
With the 3rd transfer function F " i(X) be multiplied by K and add a parameter P (X) to obtain this gamma curve, this parameter P (X) is the transfer function of 1-K for slope, and K is between 0~1.
4. image treatment method as claimed in claim 1, the step that wherein calculates this gamma curve also comprises:
This first transfer function of linear transformation F i(X);
This first transfer function F after linearity conversion adds up i(X), to obtain one second transfer function F ' i(X);
This second transfer function of standardization F ' i(X), to obtain one the 3rd transfer function F " i(X);
Adjust the 3rd transfer function F " i(X) part upper lower limit value is to obtain one the 4th transfer function F " ' i(X); And
With the 4th transfer function F " ' i(X) be multiplied by K and add a parameter P (X) to obtain this gamma curve, this parameter P (X) is the transfer function of 1-K for slope, and K is between 0~1.
5. as claim 3 or 4 described image treatment methods, wherein adjust these original gray value and also comprise for these steps of adjusting the back gray value:
As this second transfer function F ' i(X) the maximum that adds up is during greater than one first default value, and these original gray value adjust according to this gamma curve.
6. image treatment method as claimed in claim 2, wherein, these original gray value correspond to an original red gray value, an original green gray value and an original blue gray value respectively, and this image treatment method also comprises:
According to this original red gray value, this original green gray value or this original blue gray value ratio corresponding to the standard maximum gradation value, adjusting this adjustment back gray value is that one first colorimetric purity weight mechanism is adjusted the back gray value.
7. image treatment method as claimed in claim 6, wherein, this image treatment method also comprises: after the step of adjusting this adjustment back gray value, also according to this original red gray value, this original green gray value and this original blue gray value proportionate relationship to each other, adjusting this first colorimetric purity weight mechanism adjustment back gray value is that one second colorimetric purity weight mechanism is adjusted the back gray value, and this second colorimetric purity weight mechanism is:
GL’ new=(P LC*GL’+P L*GL)/B,
Wherein, GL is an original gray value, GL ' NewBe that first colorimetric purity weight mechanism is adjusted the back gray value, B is a positive integer, P LC=B-P L, P L=n*max (RGB)+m*color_gap, max (RGB) get maximum gray value among the original gray value GL, min (RGB) gets minimum gray value, color_gap=max (RGB)-min (RGB), m+n=1 among the original gray value GL.
8. image treatment method, this image is presented by one first picture f (N) at least, and this first picture f (N) is made up of a plurality of pixel, and each pixel corresponds to an original gray value respectively, and this image treatment method comprises:
Neighbor original gray value to each other according to each pixel and this pixel is poor, adds up the appearance number of these original gray value, and with one first transfer function F i(X) expression, i is the positive integer between 1 to N, and N is a positive integer, and X is 0 to 255 integer;
According to this first transfer function F i(X) calculate a gamma curve;
Optionally adjusting these original gray value according to this gamma curve is the whole back of many styles gray value;
Wherein, this image also comprises one second picture f (N-1), and this second picture f (N-1) is in the preceding appearance of this first picture f (N), and these original gray value of described adjustment comprise for these steps of adjusting the back gray value:
Number appears in these original gray value of adding up this first picture f (N), with one first pixel transfer function H N(X) expression;
Number appears in these original gray value of adding up this second picture f (N-1), with one second pixel transfer function H N-1(X) expression;
This first pixel transfer function of integration H N(X), think a first integral value;
With this first pixel transfer function H N(X) with this second pixel transfer function H N-1(X) take absolute value after subtracting each other and, think a second integral value its integration; And
When the ratio of this second integral value and this first integral value during greater than one the 3rd default value, these original gray value of this first picture f (N) are this first transfer function F according to this first picture N(X) be adjusted into these and adjust the back gray value, otherwise these original gray value of this first picture f (N) are this first transfer function F according to this second picture f (N-1) N-1(X) be adjusted into these and adjust the back gray value.
CNB200610004232XA 2006-02-13 2006-02-13 Method for enhancing image contrast Expired - Fee Related CN100388757C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB200610004232XA CN100388757C (en) 2006-02-13 2006-02-13 Method for enhancing image contrast

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB200610004232XA CN100388757C (en) 2006-02-13 2006-02-13 Method for enhancing image contrast

Publications (2)

Publication Number Publication Date
CN1809121A CN1809121A (en) 2006-07-26
CN100388757C true CN100388757C (en) 2008-05-14

Family

ID=36840789

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB200610004232XA Expired - Fee Related CN100388757C (en) 2006-02-13 2006-02-13 Method for enhancing image contrast

Country Status (1)

Country Link
CN (1) CN100388757C (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102547117B (en) * 2011-12-22 2014-12-03 北京英泰智软件技术发展有限公司 Method for enhancing contrast ratio of camera

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05122521A (en) * 1991-10-29 1993-05-18 Toyobo Co Ltd Method and device for improving image picture quality
JPH07162714A (en) * 1993-12-02 1995-06-23 Matsushita Electric Ind Co Ltd Gamma correcting method and device therefor
US5481376A (en) * 1993-06-23 1996-01-02 Toyo Boseki Kabushiki Kaisha Method and apparatus for improving image quality
CN1658680A (en) * 2004-02-19 2005-08-24 佳能株式会社 Video signal correction method and video signal correction device
CN1664858A (en) * 2005-04-15 2005-09-07 友达光电股份有限公司 Image Contrast Enhancement Method
CN1684107A (en) * 2004-04-12 2005-10-19 光宝科技股份有限公司 How to adjust image contrast

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05122521A (en) * 1991-10-29 1993-05-18 Toyobo Co Ltd Method and device for improving image picture quality
US5481376A (en) * 1993-06-23 1996-01-02 Toyo Boseki Kabushiki Kaisha Method and apparatus for improving image quality
JPH07162714A (en) * 1993-12-02 1995-06-23 Matsushita Electric Ind Co Ltd Gamma correcting method and device therefor
CN1658680A (en) * 2004-02-19 2005-08-24 佳能株式会社 Video signal correction method and video signal correction device
CN1684107A (en) * 2004-04-12 2005-10-19 光宝科技股份有限公司 How to adjust image contrast
CN1664858A (en) * 2005-04-15 2005-09-07 友达光电股份有限公司 Image Contrast Enhancement Method

Also Published As

Publication number Publication date
CN1809121A (en) 2006-07-26

Similar Documents

Publication Publication Date Title
US10129511B2 (en) Image processing apparatus, image projection apparatus, and image processing method
JP4073477B2 (en) Image processing apparatus and image display apparatus
US7352410B2 (en) Method and system for automatic brightness and contrast adjustment of a video source
US7573533B2 (en) Method of generating transfer curves for adaptive contrast enhancement
US20090304274A1 (en) Image Processing Apparatus and Image Display Apparatus
CN100493142C (en) Image display device and image display method
TW200305331A (en) Contrast correcting circuit
US7646512B2 (en) Image processing apparatus and method of the same
CN102752604B (en) Image display method and intelligent device
US20140368527A1 (en) Video display device and television receiving device
JP2010276691A (en) Image processing apparatus and image processing method
CN103680371A (en) Display characteristic adjustment device and adjustment method of a display
JP4575963B2 (en) Image processing device
JP2004326082A5 (en)
US10249031B2 (en) Image processing apparatus, image processing method, program, and non-transitory computer-readable storage medium
CN104978945A (en) Image saturation enhancement method and apparatus
US7729022B2 (en) Method for processing image
TWI510092B (en) Electronic device and method for enhancing readability of an image thereof
JP2017098845A (en) Image processing apparatus, image processing method, and program
CN100388757C (en) Method for enhancing image contrast
JP2008258925A (en) Gamma correction circuit and method
CN101453661B (en) Image processing method
TWI383333B (en) Method and system for adjusting saturation of image
JP4470587B2 (en) Image display device
CN106657945B (en) A kind of gamma correction implementation method of non-linear piecewise

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080514

CF01 Termination of patent right due to non-payment of annual fee