KR20130002698A - A method of enhancing contrast using bezier curve - Google Patents

A method of enhancing contrast using bezier curve Download PDF

Info

Publication number
KR20130002698A
KR20130002698A KR1020110063818A KR20110063818A KR20130002698A KR 20130002698 A KR20130002698 A KR 20130002698A KR 1020110063818 A KR1020110063818 A KR 1020110063818A KR 20110063818 A KR20110063818 A KR 20110063818A KR 20130002698 A KR20130002698 A KR 20130002698A
Authority
KR
South Korea
Prior art keywords
image
pixel count
luminance
contrast
control point
Prior art date
Application number
KR1020110063818A
Other languages
Korean (ko)
Other versions
KR101814806B1 (en
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 KR1020110063818A priority Critical patent/KR101814806B1/en
Publication of KR20130002698A publication Critical patent/KR20130002698A/en
Application granted granted Critical
Publication of KR101814806B1 publication Critical patent/KR101814806B1/en

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

PURPOSE: A contrast improving method which uses a Bezier curve is provided to improve the quality of an image by supplying contrast. CONSTITUTION: An RGB value of an image is converted to a YCbCr(S12). An image type is determined based on a pixel count by section(S14). A moving direction of control points is determined(S15). The moving direction of the control points is calculated based on histogram distribution of a luminance value(S16). A three-dimensional Bezier curve is generated(S17). The contrast of an image is improved by using a reference curve or the generated bezier(S18). [Reference numerals] (AA) Start; (BB) End; (S11) Reading an image; (S12) Converting an RGB value into a YCbCr; (S13) Calculating a pixel count for low luminance, medium luminance, and high luminance sections; (S14) Determining an image type based on a pixel count value for each section; (S15) Determining a moving direction of control points based on the image type; (S16) Calculating a moving distance of the control points based on histogram distribution of a luminance value; (S17) Forming a 3D Bezier curve based on the moved control point; (S18) Improving contrast

Description

베지어 곡선을 이용한 콘트라스트 개선 방법{A METHOD OF ENHANCING CONTRAST USING BEZIER CURVE}A contrast method using Bezier curves {A METHOD OF ENHANCING CONTRAST USING BEZIER CURVE}

본 발명은 이미지의 콘트라스트 개선 방법에 관한 것이다. 보다 구체적으로, 본 발명은 촬영되거나 또는 저장 매체로 읽어들인 이미지로부터 히스토그램 분포를 산출하고, 상기 이미지를 콘트라스트 상태에 따라 종류 별로 구분하고, 상기 종류별로 3차원 베지어 곡선의 제어점 이동 방향을 결정하고, 상기 히스토그램 분포에 존재하는 휘도값의 개수를 기반으로 3차원 베지어 곡선의 제어점 이동 거리를 계산한다. 결정된 제어점 이동 방향과 제어점 이동 거리를 기반으로 3차원 베지어 곡선의 제어점 2개를 이동시키고, 이동된 제어점 2개와 고정되어 있는 제어점 2개를 사용하여 베지어 곡선을 생성한다. 그리고 나서, 생성된 베지어 곡선을 적용하여 이미지 개선을 수행한다. The present invention relates to a method for improving contrast of an image. More specifically, the present invention calculates the histogram distribution from the image taken or read into the storage medium, classifies the image by type according to the contrast state, determines the direction of movement of the control point of the three-dimensional Bezier curve by the type The control point moving distance of the 3D Bezier curve is calculated based on the number of luminance values present in the histogram distribution. The two control points of the three-dimensional Bezier curve are moved based on the determined control point movement direction and the control point movement distance, and a Bezier curve is generated using the two moved control points and two fixed control points. Then, the generated Bezier curves are applied to perform image enhancement.

콘트라스트는 인간의 시각적 인지에 있어서 이미지의 품질에 상당한 영향을 갖는다. 이미지 콘트라스트 개선은 기본적으로 인간의 눈을 위한 이미지 정보의 상호번역성 또는 인식성을 개선하고, 다른 자동화된 이미지 처리 기술을 위한 "더 나은" 입력을 제공하는 것이다. 이미지 개선의 주된 목적은 이미지의 속성을 변경하여 주어진 작업 및 특정 관찰자에게 더 적절하게 만드는 것이다. 이러한 처리 과정에서, 이미지의 하나 이상의 속성이 변경된다.Contrast has a significant impact on the quality of an image in human visual perception. Image contrast improvement is basically to improve the intertranslation or recognition of image information for the human eye, and to provide "better" input for other automated image processing techniques. The main purpose of image enhancement is to change the attributes of the image to make it more appropriate for a given task and a particular observer. In this process, one or more attributes of the image are changed.

통상적으로, 이미지의 콘트라스트는 주어진 이미지에서 가용한 휘도 강도의 범위로 정의된다. 수학적으로, 이미지 콘트라스트는 다음 (식 1)과 같이 표현될 수 있다.Typically, the contrast of an image is defined as the range of luminance intensities available in a given image. Mathematically, the image contrast can be expressed as follows.

콘트라스트 = (Lmax - Lmin) / (Lmax + Lmin) ... (식 1)Contrast = (Lmax-Lmin) / (Lmax + Lmin) ... (Equation 1)

여기서, Lmax 및 Lmin은 각각 주어진 이미지의 최대 휘도값 및 최소 휘도값이다. Where Lmax and Lmin are the maximum and minimum luminance values of a given image, respectively.

콘트라스트 개선은 강도를 정량화하는데 사용되는 비트수에 의해 제공되는 최대 범위의 강도를 사용함으로써, 이미지 피쳐를 보다 명확하게 만드는 프로세스이다. Contrast improvement is a process that makes the image feature clearer by using the maximum range of intensities provided by the number of bits used to quantify the intensities.

이러한 콘트라스트 개선 방법 중에서도, 사람의 육안에 보다 최적화될 수 있도록 콘트라스트를 개선하는 방법이 요구된다.Among these contrast improvement methods, a method of improving the contrast is required so that the human eye can be more optimized.

본 발명은 이미지의 타입에 따라, 콘트라스트를 적응적으로 개선하는 공간 영역에서의 콘트라스트 개선 방법을 제공하는 것을 목적으로 한다.It is an object of the present invention to provide a method for improving contrast in a spatial region that adaptively improves contrast, depending on the type of image.

본 발명의 일 실시예에 따라, 베지어 곡선을 이용한 콘트라스트 개선 방법이 제공된다. 상기 방법은, 이미지를 읽어들이는 단계; 상기 이미지의 휘도값 분포를 산출하는 단계; 상기 휘도값의 저휘도, 중휘도, 고휘도 구간별 픽셀 카운트를 산출하는 단계; 상기 구간별 픽셀 카운트를 기반으로 상기 이미지의 타입을 결정하는 단계; 상기 이미지의 타입을 기반으로 제어점 이동 방향을 결정하는 단계; 상기 이미지의 휘도값 분포를 기반으로 상기 제어점의 이동 거리를 계산하는 단계; 상기 제어점 이동 방향과 상기 제어점 이동 거리를 기반으로 제어점을 이동하고 이동된 제어점을 기반으로 3차원 베지어 곡선을 생성하는 단계; 및 상기 생성된 3차원 베지어 곡선을 사용하여 콘트라스트 개선을 수행하는 단계를 포함한다.According to one embodiment of the present invention, a method for improving contrast using Bezier curves is provided. The method comprises: reading an image; Calculating a luminance value distribution of the image; Calculating pixel counts for each of the low, medium, and high luminance sections of the luminance value; Determining a type of the image based on the pixel count for each section; Determining a control point movement direction based on the type of the image; Calculating a moving distance of the control point based on a distribution of luminance values of the image; Moving a control point based on the control point moving direction and the control point moving distance and generating a 3D Bezier curve based on the moved control point; And performing a contrast improvement using the generated three-dimensional Bezier curve.

본 발명에 따르면, 적은 계산량으로 사람의 육안에 보다 최적화될 수 있도록 콘트라스트를 개선할 수 있다.According to the present invention, the contrast can be improved so that the human eye can be more optimized with a small amount of calculation.

도 1은 이미지의 휘도값 히스토그램 분포에 따른 이미지의 타입들을 나타낸다.
도 2는 본 발명의 일 실시예에 따른 이미지의 히스토그램 분포를 나타낸다.
도 3은 본 발명의 일 실시예에 따라 3차원 베지어 곡선의 제어점을 설정하는 방법을 나타낸다.
도 4는 본 발명의 일 실시예에 따라, 이미지 타입 별로 제어점을 이동하는 방법을 나타낸다.
도 5는 본 발명의 일 실시예에 따라, 휘도값 분포에 존재하는 휘도값의 개수 N을 설명하기 위한 도면이다.
도 6은 본 발명의 일 실시예에 따라, 계산된 이동 거리만큼 제어점을 이동하는 방법을 나타낸다.
도 7은 본 발명의 일 실시예에 따라, 최종적으로 얻어진 베지어 곡선을 이용한 참조 곡선이다.
도 8은 본 발명의 일 실시예에 따른, 적응적 콘트라스트 개선 방법을 나타내는 순서도이다.
1 illustrates types of an image according to a histogram distribution of luminance values of an image.
2 illustrates a histogram distribution of an image according to an embodiment of the present invention.
3 illustrates a method of setting a control point of a three-dimensional Bezier curve according to an embodiment of the present invention.
4 illustrates a method of moving a control point for each image type according to an embodiment of the present invention.
FIG. 5 is a diagram for describing the number N of luminance values present in a luminance value distribution according to one embodiment of the present invention.
6 illustrates a method of moving a control point by a calculated movement distance according to an embodiment of the present invention.
7 is a reference curve using the finally obtained Bezier curve according to an embodiment of the present invention.
8 is a flowchart illustrating an adaptive contrast improvement method according to an embodiment of the present invention.

이하 도면을 참조하여, 본 발명의 실시예들을 보다 상세히 설명한다.With reference to the drawings, embodiments of the present invention will be described in more detail.

도 1은 이미지의 휘도값 히스토그램 분포에 따른 이미지의 타입들을 나타낸다. 도 1에 도시된 바와 같이, (a)는 어두운 이미지이고, (b)는 밝은 이미지이고, (c)는 백라이트가 있는 이미지이고, (d)는 로우 콘트라스트 이미지이고, (e)는 하이 콘트라스트 이미지로 분류할 수 있다.1 illustrates types of an image according to a histogram distribution of luminance values of an image. As shown in FIG. 1, (a) is a dark image, (b) is a bright image, (c) is a backlit image, (d) is a low contrast image, and (e) is a high contrast image Can be classified as

이미지의 히스토그램 분포를 도 2와 같이 3개의 영역, 즉 저휘도(L), 중휘도(M), 및 고휘도(H) 영역으로 구분할 수 있다. 바람직하게는, 저휘도 구간, 중휘도 구간, 고휘도 구간의 구간 길이는 거의 동일하게 설정한다. 즉, 저휘도 구간, 중휘도 구간, 고휘도 구간에 포함되는 휘도값은 총 256개의 이산 휘도값 중 85개, 85개, 86개일 수 있다. As shown in FIG. 2, the histogram distribution of the image may be divided into three regions, that is, low luminance (L), medium luminance (M), and high luminance (H) region. Preferably, the section lengths of the low luminance section, the medium luminance section, and the high luminance section are set to be substantially the same. That is, the luminance values included in the low luminance section, the middle luminance section, and the high luminance section may be 85, 85, or 86 of 256 discrete luminance values.

한편, 베지어 곡선은 컴퓨터 그래픽 및 그 관련 분야에서 자주 사용되는 매개 곡선이다. 베지어 곡선은 부드러운 곡선을 모델링하기 위해 컴퓨터 그래픽 분야에서 널리 사용된다. 본 발명에서는 콘트라스트 개선을 위해 3차원 베지어 곡선을 사용한다. Bezier curves, on the other hand, are intermediate curves that are frequently used in computer graphics and related fields. Bezier curves are widely used in the field of computer graphics to model smooth curves. In the present invention, a three-dimensional Bezier curve is used to improve contrast.

3차원 베지어 곡선은 아래 식에 의해 정의될 수 있다. The three-dimensional Bezier curve can be defined by the following equation.

Figure pat00001
Figure pat00001

... (식 2)... (Equation 2)

여기서, P0, P1, P2, P3는 3차원 베지어 곡선의 제어점이다.Here, P0, P1, P2, and P3 are control points of the three-dimensional Bezier curve.

3차원 베지어 곡선은 장면 또는 이미지 컨텐츠를 기반으로 동적으로 서로 다른 시나리오에 대한 콘트라스트 개선 문제를 모델링하는데 사용될 수 있다. 제어점의 위치를 변경함으로써 콘트라스트 개선을 위해 필요한 모든 필요한 곡선 형태를 얻을 수 있다. 제어점 P0, P1, P2, P3의 위치에 따라, 생성되는 베지어 곡선의 형태가 달라진다.Three-dimensional Bezier curves can be used to model contrast improvement problems for dynamically different scenarios based on scene or image content. By changing the position of the control points, all necessary curve shapes are obtained to improve contrast. Depending on the positions of the control points P0, P1, P2, and P3, the shape of the Bezier curve to be generated varies.

이하에서는, 본 발명의 일 실시예에 따라, 콘트라스트 개선에 사용할 곡선을 얻기 위해 제어점의 위치를 어떻게 설정하는지에 대해 설명한다. 도 3은 본 발명의 일 실시예에 따라 3차원 베지어 곡선의 제어점을 설정하는 방법을 나타낸다. Hereinafter, according to an embodiment of the present invention, how to set the position of the control point to obtain a curve to be used for contrast improvement. 3 illustrates a method of setting a control point of a three-dimensional Bezier curve according to an embodiment of the present invention.

먼저, 4개의 제어점 P0, P1, P2, P3 중 제어점 P0와 P3는 서로 마주보는 대각선의 방향에 고정된다. 즉, 도 3에서 P0는 (0,0)에, P3는 (1,1)에 고정된다. P1 및 P2는 각각 P0 및 P3와 같은 위치에 있으며, 휘도값 히스토그램 분포의 3개의 영역, 즉, 저휘도, 중휘도, 고휘도 구간의 픽셀 카운트에 따라 결정되는 거리 만큼 P0, P3로부터 멀어지는 방향으로 이동한다. P1,P2가 P0,P3로부터 멀어지는 방향은 이미지의 타입에 따라 달라질 수 있다. First, among the four control points P0, P1, P2, and P3, the control points P0 and P3 are fixed in diagonal directions facing each other. That is, in FIG. 3, P0 is fixed to (0,0) and P3 is fixed to (1,1). P1 and P2 are located at the same position as P0 and P3, respectively, and move in a direction away from P0 and P3 by a distance determined by three regions of the luminance value histogram distribution, that is, the pixel count of the low luminance, medium luminance, and high luminance interval. do. The direction in which P1 and P2 move away from P0 and P3 may vary depending on the type of image.

이미지의 타입은 도 1에 도시된 5가지로 분류될 수 있으며, 어느 타입에 속하는지는 휘도값 히스토그램의 각 구간에 속하는 픽셀 카운트에 따라 결정된다. The type of the image may be classified into five types as shown in FIG. 1, and which type belongs to which is determined according to the pixel count belonging to each section of the luminance value histogram.

N(L)을 저휘도 구간에 속하는 픽셀 카운트, N(M)을 중휘도 구간에 속하는 픽셀 카운트, N(H)를 고휘도 구간에 속하는 픽셀 카운트라 하면 아래와 같이 결정할 수 있다. If N (L) is a pixel count belonging to a low luminance section, N (M) is a pixel count belonging to a medium luminance section, and N (H) is a pixel count belonging to a high luminance section, it can be determined as follows.

If ( N(L) > N(M) )&&((N(L) > N(H)) ) then 어두운 이미지;If (N (L)> N (M)) && ((N (L)> N (H))) then dark image;

Else If ( N(H) > N(M) )&&((N(H) > N(L)) ) then 밝은 이미지;Else If (N (H)> N (M)) && ((N (H)> N (L))) then bright image;

Else If ( N(L) > N(M) )&&((N(H) > N(M)) ) then 역광 이미지;Else If (N (L)> N (M)) && ((N (H)> N (M))) then backlight image;

Else If ( N(M) > N(L) )&&((N(M) > N(H)) ) then 로우 콘트라스트 이미지;Else If (N (M)> N (L)) && ((N (M)> N (H))) then low contrast image;

Else 하이 콘트라스트 이미지.
Else high contrast image.

바람직하게는, 이미지를 하이 콘트라스트 이미지를 제외한 나머지 타입으로 분류할 때는, N(L), N(M), N(H)의 크기가 많이, 예컨대 이미지의 총 픽셀수의 10% 이상 차이는 경우로 한정한다. N(L), N(M), N(H)의 값에 차이가 존재해서, 산술적으로는 하이 콘트라스트 이외의 다른 타입으로 결정할 수 있으나, 그 차이가 크지 않은 경우에는 모두 하이 콘트라스트 이미지로 분류하는 것이 바람직하기 때문이다. 예컨대, 이미지의 총 픽셀 수가 1780개인 경우에, N(L)=600, N(M)= 590, N(H)=590라면, 위 분류에서는 어두운 이미지로 분류가 되지만, 이것은 구간별 픽셀 카운트 차가 크지 않기 때문에, 그냥 하이 콘트라스트 이미지로 분류할 수 있다. 구간별 픽셀 카운트 차가 총 픽셀수 1780*10% = 178개 이상 차이날 때, 하이 콘트라스트 이미지를 제외한 나머지 타입으로 분류할 수 있다. 위 10% 기준은 각 구간별 픽셀 카운트 차가 큰지를 판단하기 위한 기준으로서, 실시예에 따라 20%, 30% 등으로 그 값이 달라질 수 있다.
Preferably, when classifying an image into a type other than a high contrast image, there are many sizes of N (L), N (M), and N (H), such as a difference of more than 10% of the total number of pixels of the image. It is limited to. Since there is a difference in the values of N (L), N (M), and N (H), it is arithmetically determined to be of a type other than high contrast, but when the difference is not large, all are classified as high contrast images. This is because it is preferable. For example, if the total number of pixels in the image is 1780, if N (L) = 600, N (M) = 590, N (H) = 590, the classification above is classified as a dark image, but this is because Because it's not large, you can just classify it as a high contrast image. When the pixel count difference per section differs by 1780 * 10% = 178 or more, the total number of pixels may be classified into types other than high contrast images. The above 10% criterion is a criterion for determining whether the pixel count difference in each section is large. The value may be changed to 20% or 30% according to an embodiment.

도 4를 참조하면, 이미지가 (a) 어두운 이미지로 분류되면, P2는 고정되어 P3와 동일한 위치에 있고, P1이 위로 이동한다. 그 결과 P0,P1,P2,P3에 의해 베지어 곡선이 생성될 수 있다. Referring to FIG. 4, when the image is classified as (a) a dark image, P2 is fixed and is at the same position as P3, and P1 moves upward. As a result, a Bezier curve can be generated by P0, P1, P2, and P3.

이미지가 (b) 밝은 이미지로 분류되면, P1은 고정되어 P0와 동일한 위치에 있고, P2가 아래방향으로 이동한다. If the image is (b) classified as a bright image, P1 is fixed and at the same position as P0, and P2 moves downward.

이미지가 (c) 역광 이미지로 분류되면, P1은 위로, P2는 아래로 이동한다.If the image is classified as (c) a backlit image, then P1 moves up and P2 moves down.

이미지가 (d) 로우 콘트라스트 이미지로 분류되면, P1은 우측으로, P2은 좌측으로 이동한다. If the image is classified as (d) a low contrast image, then P1 moves to the right and P2 moves to the left.

이미지가 (e) 하이 콘트라스트 이미지로 분류되면 제어점들은 이동하지 않고, 직선 형태의 베지어 곡선이 생성된다. 직선 형태의 베지어 곡선을 사용하여 콘트라스트 개선을 수행하면 입력값과 개선된 값이 동일하게 되어 실질적으로 이미지에 변화가 없게 된다.
If the image is classified as (e) a high contrast image, the control points do not move and a straight Bezier curve is created. Contrast enhancement using a straight Bezier curve ensures that the input and improved values are the same, resulting in virtually no change in the image.

P1과 P2가 이동하는 거리는 (식 3)의 톤 콘트라스트 비(tonal contrast ratio)에 따라 결정된다.The distance that P1 and P2 travel is determined by the tone contrast ratio of (Equation 3).

톤 콘트라스트 비(TC) = TC = N / (Lmax - Lmin +1) ... (식 3)Tone Contrast Ratio (TC) = TC = N / (Lmax-Lmin +1) ... (Equation 3)

N은 휘도값 분포에 존재하는 휘도값의 개수이고, Lmax는 상기 휘도값 분포의 최대 휘도값이고, Lmin는 상기 휘도값 분포의 최소 휘도값이다. N is the number of luminance values present in the luminance value distribution, Lmax is the maximum luminance value of the luminance value distribution, and Lmin is the minimum luminance value of the luminance value distribution.

도 5를 참조하여 휘도값 분포에 존재하는 휘도값의 개수 N을 설명한다. 도 5와 같은 히스토그램 분포가 산출되었다고 가정하면, 0~255까지 모든 휘도값에 픽셀 카운트가 존재하는 것이 아니라, 특정 휘도값들에만 픽셀 카운트가 존재할 수 있다. 도 5에서는 9개의 휘도값에 픽셀 카운트가 집중되어 있다. 이 경우 N=9가 된다. 특정 이미지에 대해 N은 1~256의 범위에 있을 수 있다.
The number N of luminance values present in the luminance value distribution will be described with reference to FIG. 5. Assuming that the histogram distribution as shown in FIG. 5 is calculated, the pixel count may not exist in all luminance values from 0 to 255, but the pixel count may exist only in specific luminance values. In FIG. 5, pixel counts are concentrated in nine luminance values. In this case, N = 9. N may range from 1 to 256 for a particular image.

제어점 P1, P2의 이동 거리(D)는 (식 4)에 의해 결정된다. The moving distance D of the control points P1 and P2 is determined by (Expression 4).

D = (2^N-1)*TC ... (식 4)
D = (2 ^ N-1) * TC ... (Equation 4)

예를 들어, 어떤 이미지의 히스토그램 분포로부터, 이미지의 타입이 역광 이미지로 결정되었고, N=9이고, Lmax=240, Lmin = 5라면 톤 콘트라스트 비(TC)는 다음과 같다.For example, from the histogram distribution of an image, if the type of image is determined to be a backlight image, and N = 9, Lmax = 240, Lmin = 5, the tone contrast ratio TC is as follows.

TC = 9 / (240-5+1) = 0.038135TC = 9 / (240-5 + 1) = 0.038135

이미지 타입이 역광 이미지이므로, P1은 위로, P2는 아래로 이동할 것이고, 이동 거리는 다음과 같이 결정된다.Since the image type is a backlight image, P1 will move up, P2 will move down, and the moving distance is determined as follows.

D = (2^9-1)*0.038135 = 9.72457D = (2 ^ 9-1) * 0.038135 = 9.72457

따라서, P1과 P2는 각각 9.72457 유닛 만큼, 즉 9.72457 휘도값 만큼 이동하게 된다. 이 때, 계산량을 줄이기 위해, P1과 P2의 이동량을 반올림하여 정수값으로 결정할 수 있다. 예컨대, 9.72457을 반올림한 10 유닛 만큼 이동시킬 수 있다. Thus, P1 and P2 are each shifted by 9.72457 units, i.e. by 9.72457 luminance values. At this time, in order to reduce the amount of calculation, it is possible to round the movement amount of P1 and P2 to determine the integer value. For example, you can move 9.72457 rounded by 10 units.

도 6을 참조하면, P1와 P2가 각각 위와 아래로 10 유닛 만큼 이동하는 경우가 도시되어 있다. 도 6에서는 x축과 y축을 [0,255]로 스케일링하여 표시하였다. x축, y축이 [0,1]로 스케일링되어 있는 경우는 계산된 이동 거리를 256으로 나눈 거리 만큼 이동시킬 수 있을 것이다.Referring to FIG. 6, a case in which P1 and P2 move up and down by 10 units, respectively. In FIG. 6, the x-axis and the y-axis are scaled to [0,255]. If the x-axis and the y-axis are scaled to [0,1], the calculated moving distance may be moved by the distance divided by 256.

이와 같은 과정을 거쳐 얻어진 제어점 4개로 3차원 베지어 곡선을 생성하면 도 7과 같이 된다. x축은 입력 휘도값이고, y축은 출력 휘도값이다. 주어진 이미지를 도 7과 같은 참조 곡선을 사용하여 새로운 휘도값으로 맵핑함으로써 콘트라스트를 개선할 수 있다. A three-dimensional Bezier curve is generated from four control points obtained through the above process, as shown in FIG. 7. The x axis is the input luminance value and the y axis is the output luminance value. Contrast can be improved by mapping a given image to a new luminance value using a reference curve as shown in FIG. 7.

도 8은 본 발명의 일 실시예에 따른, 적응적 콘트라스트 개선 방법을 나타내는 순서도이다.8 is a flowchart illustrating an adaptive contrast improvement method according to an embodiment of the present invention.

단계(S11)에서, 이미지를 읽어들인다. 이미지는 디지털 카메라로 촬영할 수도 있고, 저장 매체에 저장된 이미지 데이터를 읽어들일 수도 있다.In step S11, an image is read. The image may be photographed by a digital camera, or image data stored in a storage medium may be read.

단계(S12)에서, 읽어들인 이미지의 RGB 값을 YCbCr로 변환하고, 픽셀별로 휘도 성분인 Y값을 추출한다.In step S12, the RGB value of the read image is converted into YCbCr, and the Y value which is the luminance component for each pixel is extracted.

단계(S13)에서, 추출된 픽셀별 Y을 기반으로 저휘도, 중휘도, 고휘도 구간별 픽셀 카운트를 산출한다.In operation S13, the pixel counts of the low luminance, the medium luminance, and the high luminance interval are calculated based on the extracted Y for each pixel.

단계(S14)에서, 구간별 픽셀 카운트를 기반으로 이미지 타입을 결정한다. 이미지 타입은 전술한 바와 같이 도 4의 5가지 타입 중 하나일 수 있다.In step S14, the image type is determined based on the pixel count for each section. The image type may be one of the five types of FIG. 4 as described above.

단계(S15)에서, 결정된 이미지 타입을 기반으로 제어점의 이동 방향을 결정한다. 전술한 바와 같이, P0, P3은 (0,0)과 (1,1)에 고정되고, P1,P2는 각각 위, 아래, 오른쪽 또는 왼쪽으로 이동된다. In step S15, the moving direction of the control point is determined based on the determined image type. As described above, P0 and P3 are fixed to (0,0) and (1,1), and P1 and P2 are moved up, down, right or left, respectively.

단계(S16)에서, 휘도값의 히스토그램 분포를 기반으로 제어점 P1,P2의 이동 거리를 계산한다. 이 때, 전술한 바와 같이, 휘도값의 히스토그램 분포에서 0~255의 휘도값 중 픽셀 카운트가 존재하는 휘도값들의 수(N)을 추출하여 전술한 바와 같은 방식으로 이동 거리를 계산할 수 있다. In step S16, the moving distances of the control points P1 and P2 are calculated based on the histogram distribution of the luminance values. In this case, as described above, the moving distance may be calculated in the same manner as described above by extracting the number N of luminance values having a pixel count among the luminance values of 0 to 255 in the histogram distribution of the luminance values.

단계(S17)에서, 이동된 제어점 P1,P2와 고정된 제어점 P0,P3를 기반으로 3차원 베지어 곡선을 생성한다.In step S17, a three-dimensional Bezier curve is generated based on the moved control points P1 and P2 and the fixed control points P0 and P3.

단계(S18)에서 생성된 베지어 곡선 또는 0~255로 스케일링한 참조 곡선을 사용하여 콘트라스트 개선을 수행한다.Contrast improvement is performed using the Bezier curve generated in step S18 or a reference curve scaled from 0 to 255.

Claims (5)

베지어 곡선을 이용한 콘트라스트 개선 방법에 있어서,
이미지를 읽어들이는 단계;
상기 이미지의 휘도값 분포를 산출하는 단계;
상기 휘도값의 저휘도, 중휘도, 고휘도 구간별 픽셀 카운트를 산출하는 단계;
상기 구간별 픽셀 카운트를 기반으로 상기 이미지의 타입을 결정하는 단계;
상기 이미지의 타입을 기반으로 제어점 이동 방향을 결정하는 단계;
상기 이미지의 휘도값 분포를 기반으로 상기 제어점의 이동 거리를 계산하는 단계;
상기 제어점 이동 방향과 상기 제어점 이동 거리를 기반으로 제어점을 이동하고 이동된 제어점을 기반으로 3차원 베지어 곡선을 생성하는 단계; 및
상기 생성된 3차원 베지어 곡선을 사용하여 콘트라스트 개선을 수행하는 단계를 포함하는 콘트라스트 개선 방법.
In the contrast improvement method using a Bezier curve,
Reading an image;
Calculating a luminance value distribution of the image;
Calculating pixel counts for each of the low, medium, and high luminance sections of the luminance value;
Determining a type of the image based on the pixel count for each section;
Determining a control point movement direction based on the type of the image;
Calculating a moving distance of the control point based on a distribution of luminance values of the image;
Moving a control point based on the control point moving direction and the control point moving distance and generating a 3D Bezier curve based on the moved control point; And
And using the generated three-dimensional Bezier curve to perform contrast enhancement.
제1항에 있어서,
상기 이미지 타입은 어두운 이미지, 밝은 이미지, 역광 이미지, 로우 콘트라스트 이미지 또는 하이 콘트라스트 이미지 중 하나인 콘트라스트 개선 방법.
The method of claim 1,
And the image type is one of a dark image, a bright image, a backlight image, a low contrast image, or a high contrast image.
제1항에 있어서,
상기 구간별 픽셀 카운트를 기반으로 상기 이미지의 타입을 결정하는 단계는,
상기 저휘도 구간의 픽셀 카운트가 상기 중휘도 구간의 픽셀 카운트보다 크고, 상기 저휘도 구간의 픽셀 카운트가 상기 고휘도 구간의 픽셀 카운트보다 크면 어두운 이미지로 결정하고,
상기 고휘도 구간의 픽셀 카운트가 상기 중휘도 구간의 픽셀 카운트보다 크고, 상기 고휘도 구간의 픽셀 카운트보다 크면 밝은 이미지로 결정하고,
상기 저휘도 구간의 픽셀 카운트가 상기 중휘도 구간의 픽셀 카운트보다 크고, 상기 고휘도 구간의 픽셀 카운트가 상기 중휘도 구간의 픽셀 카운트보다 크면 역광 이미지로 결정하고,
상기 중휘도 구간의 픽셀 카운트가 상기 저휘도 구간의 픽셀 카운트보다 크고, 상기 중휘도 구간의 픽셀 카운트가 상기 고휘도 구간의 픽셀 카운트보다 크면 로우 콘트라스트 이미지로 결정하고,
그 외 다른 경우는 하이 콘트라스트 이미지로 결정하는 단계를 포함하는 콘트라스트 개선 방법.
The method of claim 1,
Determining the type of the image based on the pixel count for each section,
If the pixel count of the low luminance period is greater than the pixel count of the medium luminance period, and the pixel count of the low luminance period is greater than the pixel count of the high luminance period, a dark image is determined.
If the pixel count of the high brightness period is greater than the pixel count of the medium brightness period and greater than the pixel count of the high brightness period, a bright image is determined.
If the pixel count of the low brightness period is greater than the pixel count of the medium brightness period and the pixel count of the high brightness period is greater than the pixel count of the medium brightness period, the backlight image is determined.
If the pixel count of the medium brightness section is greater than the pixel count of the low brightness section, and the pixel count of the medium brightness section is greater than the pixel count of the high brightness section, the low contrast image is determined.
Otherwise including the step of determining a high contrast image.
제1항에 있어서,
상기 휘도값 분포를 기반으로 제어점의 이동 거리를 계산하는 단계는,
상기 휘도값 분포에 존재하는 휘도값의 개수(N)를 추출하는 단계;
상기 휘도값의 개수를 기반으로 톤 콘트라스트 비(TC)를 계산하는 단계;
상기 톤 콘트라스트 비(TC)를 기반으로 이동 거리를 계산하는 단계를 포함하고,
상기 톤 콘트라스트 비(TC)는,
TC = N / (Lmax - Lmin +1)로 결정되고,
상기 이동 거리(D)는,
D = (2^N-1)*TC로 결정되고,
상기 Lmax는 상기 휘도값 분포의 최대 휘도값이고, Lmin는 상기 휘도값 분포의 최소 휘도값인 콘트라스트 개선 방법.
The method of claim 1,
Calculating a moving distance of the control point based on the luminance value distribution,
Extracting the number N of luminance values present in the luminance value distribution;
Calculating a tone contrast ratio (TC) based on the number of luminance values;
Calculating a moving distance based on the tone contrast ratio (TC),
The tone contrast ratio (TC) is,
TC = N / (Lmax-Lmin + 1) is determined,
The moving distance (D),
Determined by D = (2 ^ N-1) * TC,
Wherein Lmax is the maximum luminance value of the luminance value distribution, and Lmin is the minimum luminance value of the luminance value distribution.
제4항에 있어서,
상기 제어점은 상기 계산된 이동 거리(D)를 반올림한 정수만큼 이동되는 콘트라스트 개선 방법.
5. The method of claim 4,
And the control point is moved by an integer rounded off the calculated movement distance (D).
KR1020110063818A 2011-06-29 2011-06-29 A method of enhancing contrast using bezier curve KR101814806B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020110063818A KR101814806B1 (en) 2011-06-29 2011-06-29 A method of enhancing contrast using bezier curve

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020110063818A KR101814806B1 (en) 2011-06-29 2011-06-29 A method of enhancing contrast using bezier curve

Publications (2)

Publication Number Publication Date
KR20130002698A true KR20130002698A (en) 2013-01-08
KR101814806B1 KR101814806B1 (en) 2018-01-04

Family

ID=47835251

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020110063818A KR101814806B1 (en) 2011-06-29 2011-06-29 A method of enhancing contrast using bezier curve

Country Status (1)

Country Link
KR (1) KR101814806B1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001134754A (en) * 1999-11-05 2001-05-18 Canon Inc Device and method for processing image
JP3823864B2 (en) 2002-04-05 2006-09-20 ノーリツ鋼機株式会社 Image processing apparatus, image processing method, program, and recording medium
JP4167097B2 (en) 2003-03-17 2008-10-15 株式会社沖データ Image processing method and image processing apparatus

Also Published As

Publication number Publication date
KR101814806B1 (en) 2018-01-04

Similar Documents

Publication Publication Date Title
KR101329140B1 (en) System and method for enhancing saturation of rgbw image signal
WO2017121018A1 (en) Method and apparatus for processing two-dimensional code image, and terminal and storage medium
CN101118721B (en) Method, medium, and system compensating shadow areas
US8798361B2 (en) Mapping colors of an image
JP5859749B2 (en) Contrast improvement method using Bezier curve
CN107257452B (en) A kind of image processing method, device and calculate equipment
JP5121294B2 (en) Image processing method, image processing apparatus, program, recording medium, and integrated circuit
EP2339533B1 (en) Saliency based video contrast enhancement method
JPWO2014064916A1 (en) Image processing apparatus and image processing method
KR20210006276A (en) Image processing method for flicker mitigation
JP2015057698A (en) Color video processing system and method, and corresponding computer program
EP3398042A1 (en) Background removal
WO2014119060A1 (en) Image processing device, image processing method, program, and recording medium
KR101715489B1 (en) Image generating device and image generating method
JP2012104098A (en) Contrast enhancement method using hyperbolic tangent curve
CN115471413A (en) Image processing method and device, computer readable storage medium and electronic device
CN107358592B (en) Iterative global adaptive image enhancement method
CN102930289A (en) Method for generating mosaic picture
KR101814806B1 (en) A method of enhancing contrast using bezier curve
CN103685972A (en) Image optimizing method and system employing same
US10475164B2 (en) Artifact detection in a contrast enhanced output image
KR102303666B1 (en) Method of image processing, image processor performing the method and display device having the image processor
CN113689333A (en) Image enhancement method and device
CN110009082B (en) Three-dimensional code optimization method, medium, computer device and apparatus
CN107452039B (en) Method and device for compressing RGB color space

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant