JP4760433B2 - Image processing apparatus, image processing method, and program - Google Patents

Image processing apparatus, image processing method, and program Download PDF

Info

Publication number
JP4760433B2
JP4760433B2 JP2006039511A JP2006039511A JP4760433B2 JP 4760433 B2 JP4760433 B2 JP 4760433B2 JP 2006039511 A JP2006039511 A JP 2006039511A JP 2006039511 A JP2006039511 A JP 2006039511A JP 4760433 B2 JP4760433 B2 JP 4760433B2
Authority
JP
Japan
Prior art keywords
luminance signal
luminance
image
histogram
region
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
JP2006039511A
Other languages
Japanese (ja)
Other versions
JP2007221446A (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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2006039511A priority Critical patent/JP4760433B2/en
Publication of JP2007221446A publication Critical patent/JP2007221446A/en
Application granted granted Critical
Publication of JP4760433B2 publication Critical patent/JP4760433B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像処理装置および画像処理方法、並びにプログラムに関し、特に、画像の輝度信号のヒストグラムに基づいてコントラストを補正する場合に用いて好適な画像処理装置および画像処理方法、並びにプログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program, and more particularly, to an image processing apparatus, an image processing method, and a program that are suitable for use when correcting contrast based on a histogram of an image luminance signal.

画像のコントラストを補正する手法として、輝度信号のヒストグラムを用いるヒストグラム法が知られている(例えば、特許文献1参照)。   As a method for correcting the contrast of an image, a histogram method using a histogram of luminance signals is known (see, for example, Patent Document 1).

図1は、ヒストグラム法を適用して画像のコントラストを改善する従来のコントラスト補正装置の構成例を示している。   FIG. 1 shows an example of the configuration of a conventional contrast correction apparatus that improves the contrast of an image by applying a histogram method.

このコントラスト補正装置10は、画像の輝度信号Yiを入力として、補正(改善)後の輝度信号Yoを出力するものであり、ヒストグラムデータ取得部11、累積度数変換部12、正規化ゲイン演算部13、LUT輝度変換部14、およびタイミング制御部15から構成される。   The contrast correction apparatus 10 receives an image luminance signal Yi and outputs a corrected (improved) luminance signal Yo. A histogram data acquisition unit 11, a cumulative frequency conversion unit 12, and a normalized gain calculation unit 13. , LUT luminance conversion unit 14, and timing control unit 15.

コントラスト補正装置10において、前段から入力される輝度信号Yiは、ヒストグラムデータ取得部11、およびLUT輝度変換部14に入力される。   In the contrast correction apparatus 10, the luminance signal Yi input from the previous stage is input to the histogram data acquisition unit 11 and the LUT luminance conversion unit 14.

ヒストグラムデータ取得部11は、入力された画像1枚分(1フィールド分または1フレーム分)の輝度信号Yiのヒストグラムデータ、すなわち、各輝度の度数(画素の出現頻度)をカウントして累積度数変換部12に出力する。累積度数変換部12は、ヒストグラムデータ取得部11から入力されたヒストグラムデータを各輝度に対する累積度数、すなわち、輝度の最小値に対する度数から当該輝度に対応する度数までの加算値に変換して正規化ゲイン演算部13に出力する。   The histogram data acquisition unit 11 counts the histogram data of the luminance signal Yi for one input image (one field or one frame), that is, the frequency of each luminance (appearance frequency of pixels) to convert the cumulative frequency. To the unit 12. The cumulative frequency conversion unit 12 converts the histogram data input from the histogram data acquisition unit 11 into a cumulative frequency for each luminance, that is, an addition value from a frequency corresponding to the minimum luminance value to a frequency corresponding to the luminance, and normalizes it. Output to the gain calculator 13.

正規化ゲイン演算部13は、累積度数変換部12から入力された各輝度に対応する累積度数を、輝度の最大値(例えば、輝度が8ビットであるならば、255)で除算することにより正規化し、その結果得られる正規化ゲインカーブをLUT輝度変換部14に出力する。   The normalization gain calculation unit 13 performs normalization by dividing the cumulative frequency corresponding to each luminance input from the cumulative frequency conversion unit 12 by the maximum luminance value (for example, 255 if the luminance is 8 bits). The normalized gain curve obtained as a result is output to the LUT luminance conversion unit 14.

LUT輝度変換部14は、正規化ゲイン演算部13から入力された正規化ゲインカーブをルックアップテーブル(以下、LUTと称する)として保持し、コントラスト補正装置10の前段から入力された輝度信号Yiを、保持するLUTを用いて輝度信号Yoに変換し、後段に出力する。   The LUT luminance conversion unit 14 holds the normalized gain curve input from the normalized gain calculation unit 13 as a look-up table (hereinafter referred to as LUT), and the luminance signal Yi input from the previous stage of the contrast correction device 10. , The luminance signal Yo is converted using the held LUT and output to the subsequent stage.

タイミング制御部15は、ヒストグラムデータ取得部11乃至LUT輝度変換部14の動作タイミングを制御する。   The timing control unit 15 controls the operation timing of the histogram data acquisition unit 11 to the LUT luminance conversion unit 14.

このコントラスト補正装置10によれば、ヒストグラムデータ取得部11により、例えば、入力画像の画素が720(水平)×480(垂直)であり、その輝度が8ビットであって、図2に示すようなヒスグラムデータが取得された場合、累積度数変換部12により、図3に示すような累積度数に変換され、さらに、正規化ゲイン演算部13により、図4に示すような滑らかな右上がりの正規化ゲインカーブが得られる。この正規化ゲインカーブは、LUT輝度変換部14に保持され、入力輝度信号Yiを出力輝度信号Yoに変換する際に参照される。   According to the contrast correction apparatus 10, the histogram data acquisition unit 11 has, for example, a pixel of an input image of 720 (horizontal) × 480 (vertical), its luminance is 8 bits, and is as shown in FIG. When the histogram data is acquired, the cumulative frequency is converted into the cumulative frequency as shown in FIG. 3 by the cumulative frequency converter 12, and further, the normalized gain calculation unit 13 performs the smooth right upward normalization as shown in FIG. A gain curve is obtained. This normalized gain curve is held in the LUT luminance conversion unit 14 and is referred to when the input luminance signal Yi is converted into the output luminance signal Yo.

例えば、図2に示されたヒスグラムデータに対応する輝度信号Yiは、図5に示すヒストグラムの輝度信号Yoに変換される。図5に示されたように、出力輝度信号Yoはそのヒストグラムがダイナミックレンジの全域に亘って分布するので、画像のコントラストが改善される。   For example, the luminance signal Yi corresponding to the histogram data shown in FIG. 2 is converted into the luminance signal Yo of the histogram shown in FIG. As shown in FIG. 5, since the output luminance signal Yo has a histogram distributed over the entire dynamic range, the contrast of the image is improved.

特開2002−140701号公報JP 2002-140701 A

しかしながら、実際にコントラストを改善しようとする画像の輝度信号のヒストグラムは、図2のように滑らかな分布であることは少なく、より複雑な分布を示していることが多い。そのような場合、コントラスト補正装置10の正規化ゲイン演算部13によって得られる正規化ゲインカーブは滑らかな右上がりの曲線とならないので、補正後の画像が劣化し見難くなってしまうことがある。   However, the histogram of the luminance signal of an image that is actually intended to improve contrast is rarely a smooth distribution as shown in FIG. 2 and often shows a more complicated distribution. In such a case, the normalized gain curve obtained by the normalized gain calculation unit 13 of the contrast correction apparatus 10 does not become a smooth upward curve, so that the corrected image may be deteriorated and difficult to see.

例えば、入力される輝度信号Yiのヒストグラムが図6に示されるように複数のピークを有しているような場合、得られる正規化ゲインカーブは、図7に示すように曲線の傾きが急峻である部分L1,L2や傾きの変化が急激である部分L3が生じてしまう。 For example, when the histogram of the input luminance signal Yi has a plurality of peaks as shown in FIG. 6, the obtained normalized gain curve has a steep slope as shown in FIG. Some portions L 1 and L 2 and a portion L 3 where the change in inclination is abrupt occur.

この正規化ゲインカーブに基づいて輝度値を補正すると、傾きが急峻である部分L1,L2に基づく変換では、ゲインが大きくなるのでノイズ成分が強調されて画質が劣化してしまうことになる。また、傾きの変化が急激である部分L3に基づく変換では、当該L3をまたぐ輝度信号の波形に大きな歪を発生するため、階調が不足し(つぶれが生じ)画質が劣化してしまうことになる。 When the luminance value is corrected based on this normalized gain curve, the conversion based on the portions L 1 and L 2 having steep slopes increases the gain, so that the noise component is emphasized and the image quality deteriorates. . Further, in the conversion based on the portion L 3 where the change in inclination is abrupt, a large distortion is generated in the waveform of the luminance signal straddling the L 3 , so that the gradation is insufficient (crushing occurs) and the image quality deteriorates. It will be.

本発明はこのような状況に鑑みてなされたものであり、入力された画像の輝度の分布に拘わらず、コントラストを改善できるようにするものである。   The present invention has been made in view of such a situation, and makes it possible to improve the contrast regardless of the luminance distribution of the input image.

本発明の第1の側面である画像処理装置は、画像のコントラストを補正する画像処理装置において、1画像分の輝度信号のヒストグラムを取得する取得手段と、前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成する作成手段と、1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出する算出手段と、算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成する生成手段と、前記輝度信号を前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正する補正手段とを含む。 An image processing apparatus according to a first aspect of the present invention is an image processing apparatus that corrects contrast of an image, an acquisition unit that acquires a histogram of luminance signals for one image, and a dynamic range of luminance based on the histogram. A creation means for creating a region frequency distribution indicating the number of pixels belonging to each region by dividing into a predetermined number of regions, and an accumulation assuming a case where luminance signals for one image are evenly distributed in the dynamic range of luminance Calculating means for calculating a deviation at a boundary of the area between a straight line corresponding to the histogram and a curve obtained by combining the straight lines based on the area frequency distribution; and dividing the calculated deviation by the number of gradations of the luminance signal. the normalized using the deviation normalized to the coefficient, Awa set of odd function and even function the curve that combines the line based on the region frequency distribution In approximating the input luminance signal before contrast correction, and generation means for generating a gain function to output a luminance signal after contrast correction, the contrast of the image by correcting on the basis of the luminance signal to the gain function And a correcting means for correcting .

本発明の第1の側面である画像処理装置は、前記取得手段、前記作成手段、前記算出手段、および前記生成手段の処理に要する時間だけ、前記輝度信号を遅延して前記補正手段に供給する遅延手段をさらに含むことができる。   The image processing apparatus according to the first aspect of the present invention delays and supplies the luminance signal to the correction unit for a time required for processing by the acquisition unit, the generation unit, the calculation unit, and the generation unit. Delay means may further be included.

本発明の第1の側面である画像処理装置は、前記生成手段によって生成された前記ゲイン関数の時間方向の変動を緩和して前記補正手段に供給する緩和手段をさらに含むことができる。   The image processing apparatus according to the first aspect of the present invention may further include a mitigation unit that mitigates fluctuations in the time direction of the gain function generated by the generation unit and supplies the fluctuation to the correction unit.

本発明の第1の側面である画像処理方法は、画像のコントラストを補正する画像処理装置の画像処理方法において、1画像分の輝度信号のヒストグラムを取得し、前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成し、1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出し、算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成し、前記輝度信号を前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正するステップを含む。 An image processing method according to a first aspect of the present invention is an image processing method of an image processing apparatus that corrects contrast of an image, acquires a histogram of luminance signals for one image, and based on the histogram, a dynamic range of luminance. Is divided into a predetermined number of regions, a region frequency distribution indicating the number of pixels belonging to each region is created, and a cumulative histogram assuming the case where the luminance signal for one image is evenly distributed in the luminance dynamic range A deviation at a boundary of the region between a corresponding straight line and a curve obtained by combining the straight lines based on the region frequency distribution is calculated, and the calculated deviation is normalized by dividing by the number of gradations of the luminance signal. using phased the deviation coefficient was the curve that combines the line based on the region frequency distribution is approximated by a combination of an odd function and even function, Contra Input bets uncorrected luminance signal to generate a gain function to output a luminance signal after contrast correction, comprising the step of correcting the contrast of the image by correcting on the basis of the luminance signal to the gain function.

本発明の第1の側面であるプログラムは、画像のコントラストを補正するためのプログラムであって、1画像分の輝度信号のヒストグラムを取得し、前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成し、1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出し、算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成し、前記輝度信号を前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正するステップを含む処理をコンピュータに実行させる。 A program according to the first aspect of the present invention is a program for correcting the contrast of an image, obtains a histogram of luminance signals for one image, and sets a dynamic range of luminance to a predetermined number based on the histogram. A region frequency distribution indicating the number of pixels belonging to each region is created, and a straight line corresponding to a cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance, , Calculating a deviation at the boundary of the region with a curve obtained by combining straight lines based on the region frequency distribution , normalizing the deviation by dividing the calculated deviation by the number of gradations of the luminance signal, and normalizing the deviation the use in coefficient approximating the curve that combines the line based on the region frequency distribution with a combination of an odd function and even function, the contrast uncorrected Enter the degrees signal, executes a process including a step of correcting the contrast of the image to the computer by generating a gain function to output a luminance signal after contrast correction is corrected based on the luminance signal to the gain function Let

本発明の第1の側面においては、1画像分の輝度信号のヒストグラムに基づき、輝度のダイナミックレンジが所定の数の領域に分割され、各領域に属する画素数を示す領域度数分布が作成され、1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、領域度数分布に基づく直線を結合した曲線との、領域の境界における偏差が算出され、算出された偏差が輝度信号の階調数で除算されることにより正規化され、正規化された偏差を係数に用いる、領域度数分布に基づく直線を結合した前記曲線が奇関数および関数の組み合わせで近似されたコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数が生成されて、輝度信号をゲイン関数に基づいて補正されることにより画像のコントラストが補正されるIn the first aspect of the present invention, based on a histogram of luminance signals for one image, the luminance dynamic range is divided into a predetermined number of regions, and a region frequency distribution indicating the number of pixels belonging to each region is created. Calculates the deviation at the boundary of the region between the straight line corresponding to the cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance and the curve combining the straight line based on the region frequency distribution is, calculated deviation is normalized by being divided by the number of gradations of the luminance signal, using the normalized deviation coefficient, the curve odd function that combines the linear region based frequency distribution and even functions approximated by a combination of the input luminance signal before contrast correction, it is generated gain function to output a luminance signal after contrast correction, gain the luminance signal The contrast of the image is corrected by being corrected based on the number.

本発明の第2の側面である画像処理装置は、画像のコントラストを補正する画像処理装置において、1画像分の輝度信号のヒストグラムを取得する取得手段と、前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成する作成手段と、1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出する算出手段と、算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成する生成手段と、前記ヒストグラムに基づき、輝度の最小値に対応する度数からの累積度数が所定の値となる輝度を黒レベルに決定する決定手段と、前記黒レベルの輝度信号を所定のペデスタルレベルの輝度信号に変換するための黒レベル補償関数を生成し、生成した前記黒レベル補償関数に基づいて前記ゲイン関数を修正する修正手段と、前記輝度信号を前記修正手段によって修正された前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正する補正手段とを含む。 An image processing apparatus according to a second aspect of the present invention is an image processing apparatus that corrects contrast of an image, an acquisition unit that acquires a histogram of a luminance signal for one image, and a dynamic range of luminance based on the histogram. A creation means for creating a region frequency distribution indicating the number of pixels belonging to each region by dividing into a predetermined number of regions, and an accumulation assuming a case where luminance signals for one image are evenly distributed in the dynamic range of luminance Calculating means for calculating a deviation at a boundary of the area between a straight line corresponding to the histogram and a curve obtained by combining the straight lines based on the area frequency distribution; and dividing the calculated deviation by the number of gradations of the luminance signal. the normalized using the deviation normalized to the coefficient, Awa set of odd function and even function the curve that combines the line based on the region frequency distribution In approximating the input luminance signal before contrast correction, and generation means for generating a gain function to output a luminance signal after contrast correction, based on the histogram, the cumulative frequency from the frequency corresponding to the minimum value of the luminance A determination means for determining a luminance having a predetermined value as a black level, a black level compensation function for converting the luminance signal of the black level into a luminance signal of a predetermined pedestal level, and the generated black level compensation function Correction means for correcting the gain function based on the correction function, and correction means for correcting the contrast of the image by correcting the luminance signal based on the gain function corrected by the correction means.

本発明の第2の側面である画像処理装置は、前記取得手段の前段において前記輝度信号の高周波成分を除去する除去手段をさらに含むことができる。   The image processing apparatus according to the second aspect of the present invention may further include a removing unit that removes a high-frequency component of the luminance signal in a stage preceding the obtaining unit.

本発明の第2の側面である画像処理方法は、画像のコントラストを補正する画像処理装置の画像処理方法において、1画像分の輝度信号のヒストグラムを取得し、前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成し、1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出し、算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成し、前記ヒストグラムに基づき、輝度の最小値に対応する度数からの累積度数が所定の値となる輝度を黒レベルに決定し、前記黒レベルの輝度信号を所定のペデスタルレベルの輝度信号に変換するための黒レベル補償関数を生成し、生成した前記黒レベル補償関数に基づいて前記ゲイン関数を修正し、前記輝度信号を修正済みの前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正するステップを含む。 An image processing method according to a second aspect of the present invention is an image processing method of an image processing apparatus that corrects the contrast of an image, acquires a histogram of luminance signals for one image, and based on the histogram, a dynamic range of luminance. Is divided into a predetermined number of regions, a region frequency distribution indicating the number of pixels belonging to each region is created, and a cumulative histogram assuming the case where the luminance signal for one image is evenly distributed in the luminance dynamic range A deviation at a boundary of the region between a corresponding straight line and a curve obtained by combining the straight lines based on the region frequency distribution is calculated, and the calculated deviation is normalized by dividing by the number of gradations of the luminance signal. using phased the deviation coefficient was the curve that combines the line based on the region frequency distribution is approximated by a combination of an odd function and even function, Contra Input bets uncorrected luminance signal to generate a gain function to output a luminance signal after contrast correction, based on the histogram, the brightness cumulative frequency from the frequency corresponding to the minimum value of luminance becomes the predetermined value Determining a black level, generating a black level compensation function for converting the black level luminance signal into a predetermined pedestal level luminance signal, correcting the gain function based on the generated black level compensation function, Correcting the contrast of the image by correcting the luminance signal based on the corrected gain function.

本発明の第2の側面であるプログラムは、画像のコントラストを補正するためのプログラムであって、1画像分の輝度信号のヒストグラムを取得し、前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成し、1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出し、算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成し、前記ヒストグラムに基づき、輝度の最小値に対応する度数からの累積度数が所定の値となる輝度を黒レベルに決定し、前記黒レベルの輝度信号を所定のペデスタルレベルの輝度信号に変換するための黒レベル補償関数を生成し、生成した前記黒レベル補償関数に基づいて前記ゲイン関数を修正し、前記輝度信号を修正済みの前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正するステップを含む処理をコンピュータに実行させる。 A program according to a second aspect of the present invention is a program for correcting the contrast of an image, obtains a histogram of luminance signals for one image, and sets a dynamic range of luminance to a predetermined number based on the histogram. A region frequency distribution indicating the number of pixels belonging to each region is created, and a straight line corresponding to a cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance, , Calculating a deviation at the boundary of the region with a curve obtained by combining straight lines based on the region frequency distribution , normalizing the deviation by dividing the calculated deviation by the number of gradations of the luminance signal, and normalizing the deviation the use in coefficient approximating the curve that combines the line based on the region frequency distribution with a combination of an odd function and even function, the contrast uncorrected Enter the degrees signal to generate a gain function to output a luminance signal after contrast correction, determined on the basis of the histogram, the brightness cumulative frequency from the frequency corresponding to the minimum value of luminance becomes the predetermined value to the black level Generating a black level compensation function for converting the black level luminance signal into a predetermined pedestal level luminance signal, correcting the gain function based on the generated black level compensation function, A computer is caused to execute a process including a step of correcting the contrast of the image by performing correction based on the corrected gain function.

本発明の第2の側面においては、1画像分の輝度信号のヒストグラムに基づき、輝度のダイナミックレンジが所定の数の領域に分割され、各領域に属する画素数を示す領域度数分布が作成され、1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、領域度数分布に基づく直線を結合した曲線との領域の境界における偏差が算出され、算出された偏差が輝度信号の階調数で除算されることにより正規化され、正規化された偏差を係数に用いる、領域度数分布に基づく直線を結合した前記曲線が奇関数および関数の組み合わせで近似されたコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数が生成される。また、生成されたヒストグラムに基づき、輝度の最小値に対応する度数からの累積度数が所定の値となる輝度が黒レベルに決定され、黒レベルの輝度信号を所定のペデスタルレベルの輝度信号に変換するための黒レベル補償関数が生成され、生成された黒レベル補償関数に基づいて前記ゲイン関数が修正され、輝度信号が修正済みのゲイン関数に基づいて補正されることにより画像のコントラストが補正されるIn the second aspect of the present invention, based on the histogram of the luminance signal for one image, the luminance dynamic range is divided into a predetermined number of regions, and a region frequency distribution indicating the number of pixels belonging to each region is created, The deviation at the boundary of the region between the straight line corresponding to the cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance and the curve combining the straight line based on the region frequency distribution is calculated. , the calculated deviations are normalized by being divided by the number of gradations of the luminance signal, using the normalized deviation coefficient, the curve that combines the linear region based frequency distribution of odd function and even function A gain function approximated by the combination and having the luminance signal before contrast correction as input and the luminance signal after contrast correction as output is generated. Also, based on the generated histogram, the luminance at which the cumulative frequency from the frequency corresponding to the minimum luminance value becomes a predetermined value is determined as a black level, and the black level luminance signal is converted into a predetermined pedestal level luminance signal. A black level compensation function is generated, the gain function is corrected based on the generated black level compensation function, and the brightness signal is corrected based on the corrected gain function, thereby correcting the contrast of the image. The

本発明の一側面によれば、入力された画像の輝度の分布に拘わらず、コントラストを改善することが可能となる。   According to one aspect of the present invention, the contrast can be improved regardless of the luminance distribution of the input image.

以下、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。   Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings.

図8は、本発明の一実施の形態であるコントラスト補正装置の第1の構成例を示している。   FIG. 8 shows a first configuration example of a contrast correction apparatus according to an embodiment of the present invention.

このコントラスト補正装置20は、画像の輝度信号Yiを入力として、補正(改善)後の輝度信号Yoを出力するものであり、ヒストグラムデータ取得部21、3バンド累積度数変換部22、偏差算出部23、ゲイン関数生成部24、LUT輝度変換部25、およびタイミング制御部26から構成される。   This contrast correction device 20 receives the luminance signal Yi of the image and outputs a corrected (improved) luminance signal Yo, and includes a histogram data acquisition unit 21, a three-band cumulative frequency conversion unit 22, and a deviation calculation unit 23. , A gain function generation unit 24, an LUT luminance conversion unit 25, and a timing control unit 26.

コントラスト補正装置20において、前段から入力される輝度信号Yiは、ヒストグラムデータ取得部21、およびLUT輝度変換部25に入力される。   In the contrast correction device 20, the luminance signal Yi input from the previous stage is input to the histogram data acquisition unit 21 and the LUT luminance conversion unit 25.

ヒストグラムデータ取得部21は、入力された画像1枚分(1フィールド分または1フレーム分)の輝度信号Yiのヒストグラムデータ、すなわち、各輝度の度数(画素の出現頻度)をカウントして3バンド累積度数変換部22に出力する。   The histogram data acquisition unit 21 counts the histogram data of the luminance signal Yi for one input image (one field or one frame), that is, the frequency of each luminance (pixel appearance frequency), and accumulates three bands. Output to the frequency conversion unit 22.

図9は、ヒストグラムデータ取得部21の詳細な第1の構成例を示している。ヒストグラムデータ取得部21の第1の構成例は、タイミング制御部26からの制御に従い、輝度信号の有効区間には前段から入力される輝度信号Yiの値を読み出しアドレスとしてRAM32に出力し、輝度信号の無効区間(垂直ブランキング区間など)にはタイミング制御部26から供給される読み出しアドレスをRAM32に出力するスイッチ31、スイッチ31から入力される読み出しアドレスに保持している値を出力するRAM32、およびRAM32から出力された値に1を加算してRAM32に戻す加算部33から構成される。加算部33からRAM32に戻された値は、RAM32の出力前と同じアドレスに保持される。   FIG. 9 shows a detailed first configuration example of the histogram data acquisition unit 21. In the first configuration example of the histogram data acquisition unit 21, in accordance with control from the timing control unit 26, the value of the luminance signal Yi input from the previous stage is output to the RAM 32 as a read address during the effective period of the luminance signal, and the luminance signal is output. In the invalid period (such as vertical blanking period), the switch 31 that outputs the read address supplied from the timing control unit 26 to the RAM 32, the RAM 32 that outputs the value held in the read address input from the switch 31, and An adder 33 adds 1 to the value output from the RAM 32 and returns it to the RAM 32. The value returned from the adder 33 to the RAM 32 is held at the same address as before the output of the RAM 32.

なお、ヒストグラムデータ取得部21の第2の構成例については、図35を参照して後述する。   A second configuration example of the histogram data acquisition unit 21 will be described later with reference to FIG.

図8に戻る。3バンド累積度数変換部22は、ヒストグラムデータ取得部21から入力されるヒストグラムデータに基づき、輝度のダイナミックレンジを3つの領域A1,A2,A3に分割し、度数領域A1,A2,A3にそれぞれ属する輝度を有する画素数(以下、度数領域A1乃至A3の累積度数と称する)をカウントし、その結果(以下、3バンド累積ヒストグラムと称する)を偏差算出部23に出力する。   Returning to FIG. The 3-band cumulative frequency conversion unit 22 divides the dynamic range of luminance into three regions A1, A2, A3 based on the histogram data input from the histogram data acquisition unit 21, and belongs to the frequency regions A1, A2, A3, respectively. The number of pixels having luminance (hereinafter referred to as cumulative frequency in frequency areas A1 to A3) is counted, and the result (hereinafter referred to as 3-band cumulative histogram) is output to deviation calculating unit 23.

偏差算出部23は、3バンド累積度数変換部22から入力される3バンド累積ヒストグラムに基づき、例えば図10に示すように、原点(0,0)および(度数領域A3の最大輝度,累積度数最大値)の2点を結ぶ直線fと、原点(0,0)、(度数領域A1の最大輝度,度数領域A1の累積度数)、(度数領域A2の最大輝度,度数領域A1の累積度数+度数領域A2の累積度数)および(度数領域A3の最大輝度,度数領域A1の累積度数+度数領域A2の累積度数+度数領域A3の累積度数)の4点を結ぶ曲線gとを生成し、度数領域A1の最大輝度における直線fと曲線gの偏差a、度数領域A2の最大輝度における直線fと曲線gの偏差bを算出し、さらにa+bおよびa−bを算出して、これらをさらに累積度数の最大値で除算することにより正規化し、正規化されたa,b,a+bおよびa−bをゲイン関数生成部24に出力する。   Based on the three-band cumulative histogram input from the three-band cumulative frequency converter 22, the deviation calculating unit 23, for example, as shown in FIG. 10, the origin (0, 0) and (maximum luminance of cumulative frequency area A3, cumulative frequency maximum Value) and the origin (0, 0), (maximum brightness in frequency area A1, cumulative frequency in frequency area A1), (maximum brightness in frequency area A2, cumulative frequency in frequency area A1 + frequency) And a curve g connecting four points of (the cumulative frequency of the region A2) and (the maximum luminance of the frequency region A3, the cumulative frequency of the frequency region A1 + the cumulative frequency of the frequency region A2 + the cumulative frequency of the frequency region A3), The deviation a between the straight line f and the curve g at the maximum luminance of A1 and the deviation b between the straight line f and the curve g at the maximum luminance of the frequency area A2 are calculated, and a + b and a−b are further calculated. Divide by maximum value Normalized by Rukoto outputs normalized a, b, and a + b and a-b to the gain function generating unit 24.

ゲイン関数生成部24は、鋭角に曲がる曲線gを、偶関数と奇関数が組み合わされた傾きの滑らかなゲイン関数gc(x)に変換する。具体的には、偶関数にはCOS(x)を、奇関数にはsin(x)を用い、偏差算出部23から入力される正規化されたa,b,a+bおよびa−bに基づいて次式のようにゲイン関数gc(x)を生成する。
gc(x)=x+ks・(a-b)・sin(2π(x-xp)/(xw-xp))
+kc・(a+b)・(1-cos(2π(x-xp)/(xw-xp)))
xp≦x≦xw
gc(x)=x
0≦x<xp,xw<x≦xmax
The gain function generation unit 24 converts the curve g that bends at an acute angle into a gain function gc (x) having a smooth slope that is a combination of an even function and an odd function. Specifically, COS (x) is used as the even function, sin (x) is used as the odd function, and the normalized a, b, a + b and a−b input from the deviation calculating unit 23 are used. A gain function gc (x) is generated as in the following equation.
gc (x) = x + ks ・ (ab) ・ sin (2π (x-xp) / (xw-xp))
+ kc ・ (a + b) ・ (1-cos (2π (x-xp) / (xw-xp)))
xp ≦ x ≦ xw
gc (x) = x
0 ≦ x <xp, xw <x ≦ x max

ただし、xは入力輝度、ks,kcは任意の係数である。また、xmaxは輝度の最大値、xpは輝度のペデスタルレベル、xwは輝度の白ピークレベルであって、輝度が8ビットである場合、0≦x≦255であってxmax=255であり、このとき、ペデスタルレベルxp=16、白レベルxw=235とすることが一般的である。 Here, x is input luminance, and ks and kc are arbitrary coefficients. Also, x max is the maximum luminance value, xp is the luminance pedestal level, xw is the luminance white peak level, and when the luminance is 8 bits, 0 ≦ x ≦ 255 and x max = 255. In this case, the pedestal level xp = 16 and the white level xw = 235 are generally used.

なお、ゲイン関数生成部24において生成されるゲイン関数gc(x)は、偏差a,bの正負の符号に応じて4パターンの形状が生成される。すなわち、第1のパターンは、図11に示されたような-sin関数をベースとする形状である。第2のパターンは、例えば図12に示すヒストグラムに基づいて図13に示す3バンド累積ヒストグラムが生成され、これに基づいて生成される、図14に示すような+cos関数をベースとする形状である。第3のパターンは、例えば図15に示すヒストグラムに基づいて図16に示す3バンド累積ヒストグラムが生成され、これに基づいて生成される、図17に示すような-cos関数をベースとする形状である。第4のパターンは、例えば図18に示すヒストグラムに基づいて図19に示す3バンド累積ヒストグラムが生成され、これに基づいて生成される、図20に示すような+sin関数をベースとする形状である。   Note that the gain function gc (x) generated by the gain function generator 24 has four patterns of shapes according to the signs of the deviations a and b. That is, the first pattern has a shape based on the -sin function as shown in FIG. The second pattern is a shape based on the + cos function as shown in FIG. 14, for example, based on the histogram shown in FIG. 12 and generating the 3-band cumulative histogram shown in FIG. is there. The third pattern is, for example, a shape based on the -cos function as shown in FIG. 17, which is generated based on the 3-band cumulative histogram shown in FIG. 16 based on the histogram shown in FIG. is there. The fourth pattern is, for example, a shape based on the + sin function as shown in FIG. 20, which is generated based on the 3-band cumulative histogram shown in FIG. 19 based on the histogram shown in FIG. is there.

図8に戻る。ゲイン関数生成部24は、生成したゲイン関数gc(x)をLUT輝度変換部25に出力する。LUT輝度変換部25は、ゲイン関数生成部24から入力されるゲイン関数gc(x)をルックアップテーブル(以下、LUTと称する)として保持し、コントラスト補正装置20の前段から入力された輝度信号Yiを、保持するLUTを用いて輝度信号Yoに変換し、後段に出力する。タイミング制御部15は、ヒストグラムデータ取得部21乃至LUT輝度変換部25の動作タイミングを制御する。   Returning to FIG. The gain function generation unit 24 outputs the generated gain function gc (x) to the LUT luminance conversion unit 25. The LUT luminance conversion unit 25 holds the gain function gc (x) input from the gain function generation unit 24 as a lookup table (hereinafter referred to as LUT), and the luminance signal Yi input from the previous stage of the contrast correction device 20. Is converted into a luminance signal Yo using the holding LUT and output to the subsequent stage. The timing control unit 15 controls the operation timing of the histogram data acquisition unit 21 to the LUT luminance conversion unit 25.

図21は、LUT輝度変換部25の詳細な構成例を示している。LUT輝度変換部25は、スイッチ41およびLUT42から構成される。スイッチ41は、タイミング制御部26からの制御に従い、輝度信号の有効区間には前段から入力される輝度信号Yiの値を読み出しアドレスとしてLUT21に出力する。また、輝度信号の無効区間(垂直ブランキング区間など)にはタイミング制御部26から供給される書き込みアドレスをLUT42に出力する。LUT42は、例えばRAMによって構成され、スイッチ41を介して入力される書き込みアドレスに従ってゲイン関数生成部24から供給されるゲイン関数gc(x)に最大輝度を乗算した値をルックアップテーブルとして記憶し、スイッチ41から入力される読み出しアドレスに保持している値(すなわち、補正後の輝度信号Yo)を出力するLUT42から構成される。   FIG. 21 shows a detailed configuration example of the LUT luminance conversion unit 25. The LUT luminance conversion unit 25 includes a switch 41 and an LUT 42. In accordance with control from the timing control unit 26, the switch 41 outputs the value of the luminance signal Yi input from the previous stage to the LUT 21 as a read address during the effective period of the luminance signal. In addition, the write address supplied from the timing control unit 26 is output to the LUT 42 during the invalid period (such as the vertical blanking period) of the luminance signal. The LUT 42 is configured by, for example, a RAM, and stores a value obtained by multiplying the gain function gc (x) supplied from the gain function generation unit 24 by the maximum luminance in accordance with a write address input via the switch 41 as a lookup table. The LUT 42 is configured to output a value held at a read address input from the switch 41 (that is, a corrected luminance signal Yo).

次に、コントラスト補正装置20の動作(以下、コントラスト補正処理と称する)について、図22のフローチャートを参照して説明する。   Next, the operation of the contrast correction apparatus 20 (hereinafter referred to as contrast correction processing) will be described with reference to the flowchart of FIG.

コントラスト補正装置20に対して前段から画像の輝度信号Yiが入力されると、ステップS1において、ヒストグラムデータ取得部21は、入力された画像1枚分(1フィールド分または1フレーム分)の輝度信号Yiに対応するヒストグラムデータを生成して3バンド累積度数変換部22に出力する。ステップS2において、3バンド累積度数変換部22は、ヒストグラムデータ取得部21から入力されたヒストグラムデータに基づき、3バンド累積ヒストグラムを生成して偏差算出部23に出力する。   When the luminance signal Yi of the image is input from the previous stage to the contrast correction device 20, in step S1, the histogram data acquisition unit 21 outputs the luminance signal for one input image (for one field or one frame). Histogram data corresponding to Yi is generated and output to the 3-band cumulative frequency converter 22. In step S <b> 2, the 3-band cumulative frequency conversion unit 22 generates a 3-band cumulative histogram based on the histogram data input from the histogram data acquisition unit 21 and outputs the 3-band cumulative histogram to the deviation calculation unit 23.

ステップS3において、偏差算出部23は、3バンド累積度数変換部22から入力された3バンド累積ヒストグラムに基づき、正規化したa,b,a+bおよびa−bを算出してゲイン関数生成部24に出力する。ステップS4において、ゲイン関数生成部24は、偏差算出部23から入力された、正規化されているa,b,a+bおよびa−bに基づいてゲイン関数gc(x)を生成し、LUT輝度変換部25に出力する。   In step S <b> 3, the deviation calculation unit 23 calculates normalized a, b, a + b, and a−b based on the three-band cumulative histogram input from the three-band cumulative frequency conversion unit 22, and sends it to the gain function generation unit 24. Output. In step S4, the gain function generator 24 generates a gain function gc (x) based on the normalized a, b, a + b, and a−b input from the deviation calculator 23, and performs LUT luminance conversion. To the unit 25.

ステップS5において、LUT輝度変換部25は、ゲイン関数生成部24から入力されたゲイン関数gc(x)をルックアップテーブルとして保持する。ステップS6において、LUT輝度変換部25は、前段から入力された輝度信号Yiを、保持するLUTを用いて輝度信号Yoに変換し、後段に出力する。   In step S <b> 5, the LUT luminance conversion unit 25 holds the gain function gc (x) input from the gain function generation unit 24 as a lookup table. In step S6, the LUT luminance conversion unit 25 converts the luminance signal Yi input from the previous stage into a luminance signal Yo using the held LUT, and outputs it to the subsequent stage.

以上説明したコントラスト補正装置20のコントラスト補正処理によれば、例えば図6に示されたように、ヒストグラムに複数のピークが出現しているような場合であっても、図23に示す3バンド累積ヒストグラムが生成され、図24に示す滑らかな曲線からなる-sin関数の形状をしたゲイン関数gc(x)が生成され、生成されたゲイン関数gc(x)によって輝度が補正されるので、出力される輝度信号Yoは、ノイズ成分が強調されて画質が劣化してしまったり、階調が不足して画質が劣化してしまったりすることなく、適切にコントラストが改善されたものとなる。   According to the contrast correction processing of the contrast correction device 20 described above, even if a plurality of peaks appear in the histogram as shown in FIG. 6, for example, the three-band accumulation shown in FIG. A histogram is generated, a gain function gc (x) having the shape of a -sin function including a smooth curve shown in FIG. 24 is generated, and the luminance is corrected by the generated gain function gc (x), so that it is output. The luminance signal Yo that has the noise component is emphasized and the contrast is appropriately improved without deterioration of the image quality or deterioration of the image quality due to insufficient gradation.

なお、ステップS1乃至S5の処理は、1画像分の輝度信号Yiが入力される期間に実施されるので、LUT輝度変換部25において補正される輝度信号Yiとその際に用いられるLUTとは1画像分のずれが生ずることになるが、通常、前後する画像の輝度特性に大差はないので、この1画像分のずれは、補正後の画像が劣化してしまうなどの問題とはならない。   Note that the processing in steps S1 to S5 is performed during a period in which the luminance signal Yi for one image is input. Therefore, the luminance signal Yi corrected in the LUT luminance conversion unit 25 and the LUT used at that time are 1 Although there will be a shift of the image, normally there is no great difference in the luminance characteristics of the preceding and following images, so this shift of one image does not cause a problem such as deterioration of the corrected image.

以上で、コントラスト補正装置20によるコントラスト補正処理の説明を終了する。   Above, description of the contrast correction process by the contrast correction apparatus 20 is complete | finished.

次に、補正される輝度信号Yiとその際に用いられるLUTとの1画像分のずれが問題(例えば、シーンチェンジの場面など)にも対応可能なコントラスト補正装置の構成例(以下、第2の構成例と称する)について説明する。   Next, a configuration example of a contrast correction apparatus (hereinafter referred to as a second example) that can cope with a problem (for example, a scene change scene) of a deviation of one image between the luminance signal Yi to be corrected and the LUT used at that time. Will be described.

図25は、コントラスト補正装置の第2の構成例を示している。このコントラスト補正装置50は、図8に示された第1の構成例であるコントラスト補正装置20に対して、LUT輝度変換部25の前段に遅延部51を追加したものであり、その他の構成要素についてはコントラスト補正装置20と同様であって同一の符号を付与している。   FIG. 25 shows a second configuration example of the contrast correction apparatus. This contrast correction device 50 is obtained by adding a delay unit 51 to the preceding stage of the LUT luminance conversion unit 25 with respect to the contrast correction device 20 which is the first configuration example shown in FIG. Is the same as that of the contrast correction apparatus 20, and is given the same reference numerals.

遅延部51は、コントラスト補正装置50の前段から入力される輝度信号Yiを1画像周期だけ遅延してLUT輝度変換部25に出力する。したがって、コントラスト補正装置50のLUT輝度変換部25においては、補正される輝度信号Yiとその際に用いられるLUTとは1画像分のずれがないので、コントラスト補正装置50よりもより適切にコントラストを補正することが可能となる。   The delay unit 51 delays the luminance signal Yi input from the previous stage of the contrast correction device 50 by one image period and outputs the delayed signal to the LUT luminance conversion unit 25. Accordingly, in the LUT luminance conversion unit 25 of the contrast correction device 50, the luminance signal Yi to be corrected and the LUT used at that time are not shifted by one image. It becomes possible to correct.

次に、コントラスト補正装置20から順次出力される輝度信号Yoの前後する画像間の変化の緩和が十分ではない場合に対応するコントラスト補正装置の構成例(以下、第3の構成例と称する)について説明する。   Next, a configuration example (hereinafter referred to as a third configuration example) of the contrast correction device corresponding to a case where the change between the images before and after the luminance signal Yo sequentially output from the contrast correction device 20 is not sufficiently relaxed. explain.

図26は、コントラスト補正装置の第3の構成例を示している。このコントラスト補正装置60は、図8に示された第1の構成例であるコントラスト補正装置20に対して、ゲイン関数生成部24とLUT輝度変換部25の間にIIRフィルタ61を追加したものであり、その他の構成要素についてはコントラスト補正装置20と同様であって同一の符号を付与している。   FIG. 26 shows a third configuration example of the contrast correction apparatus. This contrast correction device 60 is obtained by adding an IIR filter 61 between the gain function generation unit 24 and the LUT luminance conversion unit 25 to the contrast correction device 20 which is the first configuration example shown in FIG. The other components are the same as those of the contrast correction apparatus 20, and are given the same reference numerals.

IIR(Infinite Impulse Response)フィルタ61は、ゲイン関数生成部24からのゲイン関数gc(x)を入力としてフィルタリング結果をLUT輝度変換部25に出力する。したがって、LUT輝度変換部25に供給されるゲイン関数gc(x)の時間軸方向の変動が抑止されるので、LUT輝度変換部25において、より安定した、すなわち変化が緩和な輝度変換が可能となる。   An IIR (Infinite Impulse Response) filter 61 receives the gain function gc (x) from the gain function generation unit 24 and outputs a filtering result to the LUT luminance conversion unit 25. Therefore, since the fluctuation in the time axis direction of the gain function gc (x) supplied to the LUT luminance conversion unit 25 is suppressed, the LUT luminance conversion unit 25 can perform luminance conversion that is more stable, that is, the change is moderate. Become.

なお、IIRフィルタ61に、前後する画像間のヒストグラムの差分に基づいてシーンチェンジを検出し、検出結果に従ってIIRフィルタの時定数の設定を変更することにより応答速度を改善する機能を設けるようにしてもよい。   The IIR filter 61 is provided with a function for detecting the scene change based on the difference between the histograms of the preceding and following images and changing the time constant setting of the IIR filter according to the detection result to improve the response speed. Also good.

また、コントラスト補正装置60にも、コントラスト補正装置50と同様に、遅延部51を追加するようにしてもよい。   Further, the delay unit 51 may be added to the contrast correction device 60 as well as the contrast correction device 50.

次に、ゲインコントロール特性によってコントラストを補正するだけでなく、輝度信号の黒レベルも補正することによって画素値を向上させるコントラスト補正装置の構成例(以下、第4の構成例と称する)について説明する。なお、黒レベルの補正とは、例えばテレビジョン放送信号では送信される黒レベルが撮影条件や記録機材等の違いにより変動しているが、この黒レベルを受信側(例えば、テレビジョン受像機など)の黒レベルであるペデスタルレベルと一致させることにより、画質を向上させることを意味する。   Next, a configuration example (hereinafter referred to as a fourth configuration example) of a contrast correction apparatus that improves the pixel value by correcting not only the contrast by the gain control characteristic but also the black level of the luminance signal will be described. . The black level correction means that, for example, in a television broadcast signal, the transmitted black level fluctuates due to differences in shooting conditions, recording equipment, etc., but this black level is received on the receiving side (for example, a television receiver). ) Means that the image quality is improved by matching the pedestal level which is the black level.

図27は、コントラスト補正装置の第4の構成例を示している。このコントラスト補正装置70は、図8に示された第1の構成例であるコントラスト補正装置20に対して、ローパスフィルタ71、黒レベル検出部72、黒レベル補償ゲイン計算部73、およびIIRフィルタ74を追加したものであり、その他の構成要素についてはコントラスト補正装置20と同様であって同一の符号を付与している。   FIG. 27 shows a fourth configuration example of the contrast correction apparatus. The contrast correction apparatus 70 is different from the contrast correction apparatus 20 of the first configuration example shown in FIG. 8 in that it includes a low-pass filter 71, a black level detection unit 72, a black level compensation gain calculation unit 73, and an IIR filter 74. The other components are the same as those of the contrast correction apparatus 20 and are given the same reference numerals.

ヒストグラムデータ取得部21の前段に設けられるローパスフィルタ71は、コントラスト補正装置70の前段からの輝度信号Yiを入力とし、その高周波成分を除去してヒストグラムデータ取得部21に出力する。ローパスフィルタ71によって高周波成分が除去されたことにより、輝度信号Yiの黒レベル付近の変動が抑止される。ローパスフィルタ71は、例えば次式に示されるような比較的簡易な構成のものでよい。
flpf(Z)=(1+2・Z-1+Z-2)/4
ただし、Z-1は1クロック周期分の遅延を表す。
The low-pass filter 71 provided in the previous stage of the histogram data acquisition unit 21 receives the luminance signal Yi from the previous stage of the contrast correction device 70, removes the high-frequency component, and outputs it to the histogram data acquisition unit 21. Since the high-frequency component is removed by the low-pass filter 71, fluctuations in the vicinity of the black level of the luminance signal Yi are suppressed. The low-pass filter 71 may have a relatively simple configuration as shown in the following equation, for example.
flpf (Z) = (1 + 2 · Z −1 + Z −2 ) / 4
However, Z −1 represents a delay of one clock cycle.

ヒストグラムデータ取得部21の後段に設けられる黒レベル検出部72は、ヒストグラムデータ取得部21からのヒストグラムデータを入力とし、輝度=0からの累積度数が所定の値(例えば、総画素数の3%の値)に達した輝度を黒レベルBLに決定し、黒レベルBLを黒レベル補償ゲイン計算部73に出力する。   The black level detection unit 72 provided at the subsequent stage of the histogram data acquisition unit 21 receives the histogram data from the histogram data acquisition unit 21, and the cumulative frequency from luminance = 0 is a predetermined value (for example, 3% of the total number of pixels). The black level BL is determined as the luminance that has reached the value of (5), and the black level BL is output to the black level compensation gain calculator 73.

ゲイン関数生成部24の後段に設けられる黒レベル補償ゲイン計算部73は、黒レベル検出部72から入力される黒レベルBLに対応する黒補償量kaを算出し、黒補償量kaに基づいてゲイン関数生成部24から入力されるゲイン関数gc(x)を修正し、その結果得られる修正済みのゲイン関数gct(x)をIIRフィルタ74に出力する。   A black level compensation gain calculation unit 73 provided at the subsequent stage of the gain function generation unit 24 calculates a black compensation amount ka corresponding to the black level BL input from the black level detection unit 72, and gain based on the black compensation amount ka. The gain function gc (x) input from the function generation unit 24 is corrected, and the corrected gain function gct (x) obtained as a result is output to the IIR filter 74.

IIRフィルタ74は、黒レベル補償ゲイン計算部73からのゲイン関数gct(x)を入力としてフィルタリング結果をLUT輝度変換部25に出力する。   The IIR filter 74 receives the gain function gct (x) from the black level compensation gain calculator 73 and outputs the filtering result to the LUT luminance converter 25.

次に、コントラスト補正装置70の動作(以下、コントラスト補正処理と称する)について、図28のフローチャートを参照し、図6に示されたヒストグラムの輝度信号Yiが入力される場合を例にして説明する。この黒レベル補正を含むコントラスト補正処理は、図6に示されたヒストグラムのように、輝度が小さい範囲での度数が少なく、いわゆる画像の黒浮きが生じているような場合に効果的である。   Next, the operation of the contrast correction apparatus 70 (hereinafter referred to as contrast correction processing) will be described with reference to the flowchart of FIG. 28, taking as an example the case where the luminance signal Yi of the histogram shown in FIG. 6 is input. . The contrast correction process including the black level correction is effective when the frequency in a low luminance range is small and so-called black floating of the image occurs as in the histogram shown in FIG.

コントラスト補正装置70に対して前段から画像の輝度信号Yiが入力されると、ステップS11において、ローパスフィルタ71は、輝度信号Yiのフィルタリングを行い、その結果得られる高周波成分が除去された輝度信号Yiをヒストグラムデータ取得部21に出力する。ステップ12において、ヒストグラムデータ取得部21は、入力された画像1枚分(1フィールド分または1フレーム分)の輝度信号Yiに対応するヒストグラムデータを生成して3バンド累積度数変換部22および黒レベル検出部72に出力する。   When the luminance signal Yi of the image is input from the previous stage to the contrast correction device 70, in step S11, the low-pass filter 71 performs the filtering of the luminance signal Yi, and the luminance signal Yi from which the high frequency component obtained as a result is removed. Is output to the histogram data acquisition unit 21. In step 12, the histogram data acquisition unit 21 generates histogram data corresponding to the luminance signal Yi for one input image (one field or one frame) to generate the 3-band cumulative frequency conversion unit 22 and the black level. Output to the detector 72.

ステップS13において、3バンド累積度数変換部22は、ヒストグラムデータ取得部21から入力されたヒストグラムデータに基づき、3バンド累積ヒストグラムを生成して偏差算出部23に出力する。いまの例の場合、図23に示された3バンド累積ヒストグラムが出力される。   In step S <b> 13, the 3-band cumulative frequency conversion unit 22 generates a 3-band cumulative histogram based on the histogram data input from the histogram data acquisition unit 21 and outputs the 3-band cumulative histogram to the deviation calculation unit 23. In the case of the present example, the 3-band cumulative histogram shown in FIG. 23 is output.

ステップS14において、偏差算出部23は、3バンド累積度数変換部22から入力された3バンド累積ヒストグラムに基づき、正規化したa,b,a+bおよびa−bを算出してゲイン関数生成部24に出力する。ステップS15において、ゲイン関数生成部24は、偏差算出部23から入力された、正規化されているa,b,a+bおよびa−bに基づいてゲイン関数gc(x)を生成し、LUT輝度変換部25に出力する。いまの例の場合、図24に示されたゲイン関数gc(x)が出力される。   In step S <b> 14, the deviation calculation unit 23 calculates normalized a, b, a + b, and a−b based on the three-band cumulative histogram input from the three-band cumulative frequency conversion unit 22, and sends it to the gain function generation unit 24. Output. In step S15, the gain function generator 24 generates a gain function gc (x) based on the normalized a, b, a + b, and a−b input from the deviation calculator 23, and performs LUT luminance conversion. To the unit 25. In this example, the gain function gc (x) shown in FIG. 24 is output.

ステップS16において、黒レベル検出部72は、ヒストグラムデータ取得部72から入力されたヒストグラムデータに基づき、輝度=0からの累積度数が所定の値(例えば、総画素数の3%の値)に達した輝度を黒レベルBLに決定し、黒レベルBLを黒レベル補償ゲイン計算部73に出力する。いまの例の場合、輝度=84が黒レベルBLに決定されたとする。   In step S <b> 16, the black level detection unit 72 has a cumulative frequency from luminance = 0 reaches a predetermined value (for example, a value of 3% of the total number of pixels) based on the histogram data input from the histogram data acquisition unit 72. The determined luminance is determined as the black level BL, and the black level BL is output to the black level compensation gain calculator 73. In the present example, it is assumed that luminance = 84 is determined as the black level BL.

なお、ステップS13乃至S15の処理とステップS16の処理とは、実際には平行して実行される。   Note that the processes in steps S13 to S15 and the process in step S16 are actually executed in parallel.

ステップS17において、黒レベル補償ゲイン計算部73は、図29に示す黒レベルBLにおけるゲイン関数gc(BL)×255と、ペデスタルレベルxpにおけるゲイン関数gc(xp)×255との差である黒伸長量ΔBを算出する。いまの例の場合、黒伸長量ΔBとして46が算出されたとする。   In step S17, the black level compensation gain calculation unit 73 performs black expansion which is the difference between the gain function gc (BL) × 255 at the black level BL shown in FIG. 29 and the gain function gc (xp) × 255 at the pedestal level xp. The amount ΔB is calculated. In this example, it is assumed that 46 is calculated as the black extension amount ΔB.

ステップS18において、黒レベル補償ゲイン計算部73は、図30に示すように、輝度のとり得る値の中間付近に折れ曲がり点CPを設定し、折れ曲がり点CP以上の範囲においては傾き1であり、折れ曲がり点CPにおいて滑らかにつながり、折れ曲がり点CP以下の範囲において輝度信号Yiの2次関数であり、黒レベルBLの輝度信号Yiをペデスタルレベルまで引き込むことができるゲインコントロール特性fauto(x)を算出する。
fauto(x)=x−ka・(x−CP)2 0≦x≦CP
fauto(x)=x CP≦x≦255
In step S18, as shown in FIG. 30, the black level compensation gain calculation unit 73 sets a bending point CP near the middle of the value that the luminance can take, has a slope of 1 in the range beyond the bending point CP, and is bent. A gain control characteristic fauto (x) is calculated which is smoothly connected at the point CP and is a quadratic function of the luminance signal Yi in the range below the bending point CP and can draw the luminance signal Yi of the black level BL to the pedestal level.
fauto (x) = x−ka ・ (x−CP) 2 0 ≦ x ≦ CP
fauto (x) = x CP ≦ x ≦ 255

さらに、上式に黒レベルBLにおける関係を代入して黒レベル補償量kaを算出する。
BL−ΔB=BL−ka・(BL−CP)2
ΔB=ka・(BL−CP)2
ka=ΔB/(BL−CP)2
いまの例の場合、黒レベル補償量ka=46/(84−CP)2が算出される。
Further, the black level compensation amount ka is calculated by substituting the relationship at the black level BL into the above equation.
BL−ΔB = BL−ka ・ (BL−CP) 2
ΔB = ka · (BL−CP) 2
ka = ΔB / (BL-CP) 2
In the present example, the black level compensation amount ka = 46 / (84−CP) 2 is calculated.

ステップS19において、黒レベル補償ゲイン計算部73は、黒レベル補償量kaに基づいて、折れ曲がり点CP以下のゲイン関数gc(x)を以下のように修正して、修正後のゲイン関数gct(x)を生成し、IIRフィルタ74を介してLUT輝度変換部25に出力する。
gct(x)=x−ka・(x−CP)2 0≦x<xp
gct(x)=x+ks・(a-b)・sin(2π(x-xp)/(xw-xp))
+kc・(a+b)・(1-cos(2π(x-xp)/(xw-xp)))
−ka・(x−CP)2 xp≦x≦CP
gct(x)=x+ks・(a-b)・sin(2π(x-xp)/(xw-xp))
+kc・(a+b)・(1-cos(2π(x-xp)/(xw-xp))) CP<x≦xw
gct(x)=x xw<x≦xmax
In step S19, the black level compensation gain calculation unit 73 corrects the gain function gc (x) below the bending point CP based on the black level compensation amount ka as follows, and the corrected gain function gct (x ) And output to the LUT luminance conversion unit 25 via the IIR filter 74.
gct (x) = x−ka · (x−CP) 2 0 ≦ x <xp
gct (x) = x + ks ・ (ab) ・ sin (2π (x-xp) / (xw-xp))
+ Kc ・ (a + b) ・ (1-cos (2π (x-xp) / (xw-xp)))
−ka ・ (x−CP) 2 xp ≦ x ≦ CP
gct (x) = x + ks ・ (ab) ・ sin (2π (x-xp) / (xw-xp))
+ Kc ・ (a + b) ・ (1-cos (2π (x-xp) / (xw-xp))) CP <x ≦ xw
gct (x) = x xw <x ≦ x max

いまの例の場合、修正後のゲイン関数gct(x)は図31に示すとおりとなる。すなわち、黒レベルBLの輝度信号Yiをペデスタルレベルまで引き込み、かつ、コントラスト改善の特性も有するものとなる。   In this example, the corrected gain function gct (x) is as shown in FIG. That is, the luminance signal Yi of the black level BL is drawn to the pedestal level and has contrast improvement characteristics.

ステップS20において、LUT輝度変換部25は、IIRフィルタ74を介して入力されたゲイン関数gct(x)をルックアップテーブルとして保持する。ステップS21において、LUT輝度変換部25は、前段から入力された輝度信号Yiを、保持するLUTを用いて輝度信号Yoに変換し、後段に出力する。   In step S20, the LUT luminance conversion unit 25 holds the gain function gct (x) input via the IIR filter 74 as a lookup table. In step S21, the LUT luminance conversion unit 25 converts the luminance signal Yi input from the previous stage into the luminance signal Yo using the held LUT, and outputs it to the subsequent stage.

以上説明したコントラスト補正装置70のコントラスト補正処理によれば、コントラスト改善と黒レベル補償による安定した黒レベルの再現が可能となる。特に、コントラスト補正装置70では、IIRフィルタ74によりコントラスト改善と黒レベル補償の変動の緩和に関する時定数を共通化することができるので、より安定した時間応答特性とすることができる。よって、コントラスト改善量の係数と黒レベル補償量をより大きく設定することでき、画質改善効果を従来もより引き出すことが可能となる。   According to the contrast correction processing of the contrast correction apparatus 70 described above, stable black level reproduction can be achieved by contrast improvement and black level compensation. In particular, in the contrast correction device 70, the IIR filter 74 can share the time constant related to the contrast improvement and the relaxation of the black level compensation fluctuation, so that a more stable time response characteristic can be obtained. Accordingly, the coefficient of contrast improvement amount and the black level compensation amount can be set larger, and the image quality improvement effect can be further extracted.

図32は、ゲイン関数gc(x)で変換した場合と、ゲイン関数gct(x)で変換した場合の変換後の輝度信号Yoのヒストグラムを示している。ゲイン関数gc(x)で変換した場合では、一見、輝度の全域に亘って度数が分布してようにではあるが、輝度が50以下の度数がほとんど存在せずに黒浮きの状態となる。これに対して、ゲイン関数gct(x)で変換した場合、輝度が50以下の範囲も含めて全域に度数が分布する。したがって、輝度のダイナミックレンジが十分に使用されてコントラスト改善が行われていることがわかる。   FIG. 32 shows histograms of the luminance signal Yo after conversion when converted with the gain function gc (x) and when converted with the gain function gct (x). In the case of conversion with the gain function gc (x), the frequency appears to be distributed over the entire luminance range, but there is almost no frequency with a luminance of 50 or less, and the state is floated black. On the other hand, when converted by the gain function gct (x), the frequencies are distributed over the entire region including the range where the luminance is 50 or less. Therefore, it can be seen that the luminance dynamic range is sufficiently used to improve the contrast.

以上で、コントラスト補正装置70によるコントラスト補正処理の説明を終了する。   Above, description of the contrast correction process by the contrast correction apparatus 70 is complete | finished.

ところで、例えば図33に示す画像のように一様な背景を有する画像の場合、そのヒストグラムは図34に示すように、背景に対応する輝度(150付近)の度数が被写体に対応する輝度信号の度数よりも突出して高くなることが多い。このようなヒストグラムに基づいてコントラスト補正が行われると、被写体のうち、背景の輝度と同じ輝度を有する部分のコントラストが不必要に補正されてしまい不自然で見苦しい画像となってしまう。 Incidentally, for example, in the case of an image having a uniform background such as the image shown in FIG. 33, the histogram shows the luminance signal corresponding to the subject with a frequency corresponding to the background (around 150) as shown in FIG. Often higher than the frequency. When contrast correction is performed based on such a histogram, the contrast of the portion of the subject having the same luminance as the background luminance is unnecessarily corrected, resulting in an unnatural and unsightly image.

このような背景の問題に対処するため、ヒストグラムデータ取得部21の第2の構成例を提案する。図35は、ヒストグラムデータ取得部21の第2の構成例を示している。このヒストグラムデータ取得部21の第2の構成例は、図9に示された当該第1の構成例に対し、背景判定部101、インバータ102、背景画像カウント部103、平均化部104、および加算部105を追加したものであり、その他の構成要素については当該第1の構成例と同様であって同一の符号を付与している。   In order to deal with such a background problem, a second configuration example of the histogram data acquisition unit 21 is proposed. FIG. 35 illustrates a second configuration example of the histogram data acquisition unit 21. The second configuration example of the histogram data acquisition unit 21 is different from the first configuration example shown in FIG. 9 in that the background determination unit 101, the inverter 102, the background image count unit 103, the averaging unit 104, and the addition The part 105 is added, and the other components are the same as those in the first configuration example, and are given the same reference numerals.

背景判定部101は、前段から入力される輝度信号Yiが背景の画素に対応するものであるか否かを判定し、背景の画素に対応するものであると判定した場合には1を、背景の画素に対応するものではないと判定した場合には0をインバータ102および背景画素カウント部103に出力する。   The background determination unit 101 determines whether or not the luminance signal Yi input from the previous stage corresponds to a background pixel. When it is determined that the luminance signal Yi corresponds to a background pixel, When it is determined that the pixel does not correspond to the pixel, 0 is output to the inverter 102 and the background pixel count unit 103.

図36は、背景判定部101の詳細な構成例を示している。背景判定部101は、ローパスフィルタ111、バンドパスフィルタ112、絶対値変換部113、ローパスフィルタ114、比較部115、連続性判定部116から構成される。   FIG. 36 shows a detailed configuration example of the background determination unit 101. The background determination unit 101 includes a low-pass filter 111, a band-pass filter 112, an absolute value conversion unit 113, a low-pass filter 114, a comparison unit 115, and a continuity determination unit 116.

ローパスフィルタ111は、前段から入力される輝度信号Yiの高周波成分を除去してバンドパスフィルタ112に出力する。バンドパスフィルタ112は、ローパスフィルタ111の出力のうち、所定の周波数帯域のみを絶対値変換部113に通過させる。   The low-pass filter 111 removes the high-frequency component of the luminance signal Yi input from the previous stage and outputs it to the band-pass filter 112. The band pass filter 112 passes only a predetermined frequency band in the output of the low pass filter 111 to the absolute value converter 113.

ローパスフィルタ111とバンドパスフィルタ112の周波数特性の2例を図37に示す。なお、同図の横軸は周波数を示し、縦軸はゲインを示している。またfsはサンプリング周波数であり、fs/2はfsでサンプリングされた信号の最大通過周波数である。同図に示すように、ローパスフィルタ111とバンドパスフィルタ112との総合特性は、信号通過帯域の低域側のバンドパスフィルタ112の通過帯域のうち、低域側を通し、高域側を減衰させるものとなる。これにより、輝度信号Yiの高域のノイズ成分が除去される。   Two examples of frequency characteristics of the low-pass filter 111 and the band-pass filter 112 are shown in FIG. In the figure, the horizontal axis indicates the frequency, and the vertical axis indicates the gain. Fs is a sampling frequency, and fs / 2 is a maximum passing frequency of a signal sampled by fs. As shown in the figure, the overall characteristic of the low-pass filter 111 and the band-pass filter 112 is that the low-pass side of the pass band of the low-pass band-pass filter 112 of the signal pass band passes through the high-pass side. To be Thereby, the high frequency noise component of the luminance signal Yi is removed.

このような総合特性は、特に、輝度入力信号Yiが、MPEG等の動画像圧縮技術を使用した信号であるような場合、1画像ごとに高域のノイズ成分量が変動していることがあるが、その変動周期で背景部分の判定度数が変動して、ゲイン特性が変動してしまうことを防止することができる。   Such a comprehensive characteristic is that, particularly when the luminance input signal Yi is a signal using a moving image compression technique such as MPEG, the amount of high frequency noise components may vary for each image. However, it is possible to prevent the gain characteristic from fluctuating due to fluctuation of the determination frequency of the background portion in the fluctuation cycle.

図36に戻る。絶対値変換部113は、バンドパスフィルタ112からの入力の絶対値をローパスフィルタ114に出力する。ローパスフィルタ114は、絶対値変換部113の絶対値変換によって発生する高次周波数を減衰させて平滑化し、比較部115に出力する。比較部115は、ローパスフィルタ114の出力と所定の判定レベルとを比較し、ローパスフィルタ部114の出力が所定の判定レベル以上である場合には1を、ローパスフィルタ部114の出力が所定の判定レベルより小さい場合には0を連続性判定部116に出力する。   Returning to FIG. The absolute value conversion unit 113 outputs the absolute value of the input from the band pass filter 112 to the low pass filter 114. The low-pass filter 114 attenuates and smoothes the higher-order frequency generated by the absolute value conversion of the absolute value conversion unit 113 and outputs it to the comparison unit 115. The comparison unit 115 compares the output of the low-pass filter 114 with a predetermined determination level. When the output of the low-pass filter unit 114 is equal to or higher than the predetermined determination level, 1 is output, and the output of the low-pass filter unit 114 is the predetermined determination level. If it is smaller than the level, 0 is output to the continuity determination unit 116.

連続性判定部116は、図38に示すように、1ビットの入力を1サンプルクロック分だけ遅延して出力する遅延部(D)121乃至124、およびNOR演算部125から構成され、比較部115の出力が5個連続して0である場合には背景であると判定して1を後段に出力し、その他の時には0を後段に出力する。なお、この遅延部の数を増やすことにより、より輝度の変化が平坦な部分を検出することができる。   As shown in FIG. 38, the continuity determination unit 116 includes delay units (D) 121 to 124 that output a 1-bit input delayed by one sample clock, and a NOR operation unit 125. The comparison unit 115 When the output of 5 is 0 continuously, it is determined as the background and 1 is output to the subsequent stage, and 0 is output to the subsequent stage at other times. It should be noted that by increasing the number of delay portions, it is possible to detect a portion with a more flat luminance change.

図35に戻る。インバータ102は、背景判定部101からの入力を反転して加算部33に出力する。したがって、背景の画素に対応するものではないときのみ、RAM32において保持される度数がインクリメントされることになる。背景画素カウント部103は、背景判定部101からの入力を順次加算し、1画像分の輝度信号Yiが入力された時点でその加算値(背景カウンタ値)を平均化部104に出力した後、背景カウンタ値を0にリセットする。   Returning to FIG. Inverter 102 inverts the input from background determination unit 101 and outputs the result to addition unit 33. Therefore, the frequency held in the RAM 32 is incremented only when the pixel does not correspond to the background pixel. The background pixel counting unit 103 sequentially adds the inputs from the background determination unit 101 and outputs the added value (background counter value) to the averaging unit 104 when the luminance signal Yi for one image is input. Reset the background counter value to zero.

平均化部104は、背景画素カウント部103から入力された背景カウンタ値を、輝度のダイナミックレンジの階調数(8ビットの場合、256)で除算し、その商を加算部105に出力する。この除算は、例えば、背景画素カウント部103の出力を、輝度のビット数だけ下位ビットから切り捨てることにより簡単に算出される。例えば輝度が8ビットである場合、背景画素カウント部103の出力の下位8ビットを切り捨てればよい。   The averaging unit 104 divides the background counter value input from the background pixel counting unit 103 by the number of gradations of the dynamic range of luminance (256 in the case of 8 bits), and outputs the quotient to the adding unit 105. This division is easily calculated by, for example, truncating the output of the background pixel count unit 103 from the lower bits by the number of bits of luminance. For example, when the luminance is 8 bits, the lower 8 bits of the output of the background pixel count unit 103 may be discarded.

加算部105は、1画像毎にRAM32から出力される背景以外の部分が反映された各輝度の度数に、平均化部104から入力される値を加算して後段に出力する。したがって、加算部105から後段に出力されるヒストグラムの総度数は1画像分の画素数と同数となる。   The adding unit 105 adds the value input from the averaging unit 104 to the frequency of each luminance reflecting the portion other than the background output from the RAM 32 for each image, and outputs the result to the subsequent stage. Therefore, the total frequency of the histogram output to the subsequent stage from the adding unit 105 is the same as the number of pixels for one image.

次に、ヒストグラムデータ取得部21の第2の構成例の動作(以下、背景を除去したヒストグラム生成処理と称する)について、図39のフローチャートを参照して説明する。   Next, the operation of the second configuration example of the histogram data acquisition unit 21 (hereinafter referred to as a histogram generation process with the background removed) will be described with reference to the flowchart of FIG.

ステップS31において、背景判定部101は、前段から順次入力される輝度信号Yiの1画素に注目し、ステップS32において、その画素が背景に属する画素であるか否かを判定する。   In step S31, the background determination unit 101 pays attention to one pixel of the luminance signal Yi sequentially input from the previous stage, and determines whether or not the pixel belongs to the background in step S32.

ステップS32において、背景に属する画素であると判定された場合、処理はステップS33に進められる。ステップS33において、背景判定部101は1をインバータ102および背景カウント部103に出力する。インバータ102に入力された1は、0に反転されて加算部33に供給される。背景画素カウント部103に入力された1は、それまで保持されている背景カウンタ値に加算される(すなわち、背景カウンタ値は1だけインクリメントされる)。したがって、当該画素の度数は、RAM32には反映されず、背景カウンタ値にのみ反映される。   If it is determined in step S32 that the pixel belongs to the background, the process proceeds to step S33. In step S <b> 33, the background determination unit 101 outputs 1 to the inverter 102 and the background count unit 103. The 1 input to the inverter 102 is inverted to 0 and supplied to the adder 33. 1 input to the background pixel count unit 103 is added to the background counter value held so far (that is, the background counter value is incremented by 1). Therefore, the frequency of the pixel is not reflected in the RAM 32 but only in the background counter value.

反対にステップS32において、背景に属する画素ではないと判定された場合、処理はステップS34に進められる。ステップS34において、背景判定部101は0をインバータ102および背景カウント部103に出力する。インバータ102に入力された0は、1に反転されて加算部33に供給される。背景画素カウント部103に入力された0は、それまで保持されている背景カウンタ値に加算される。したがって、当該画素の度数は、RAM32に反映され(すなわち、当該画素の輝度信号Yiに対応する度数が1だけインクリメントされ)、背景カウンタ値には実質的には反映されない。   Conversely, if it is determined in step S32 that the pixel does not belong to the background, the process proceeds to step S34. In step S <b> 34, the background determination unit 101 outputs 0 to the inverter 102 and the background count unit 103. The 0 input to the inverter 102 is inverted to 1 and supplied to the adder 33. The 0 input to the background pixel count unit 103 is added to the background counter value held so far. Therefore, the frequency of the pixel is reflected in the RAM 32 (that is, the frequency corresponding to the luminance signal Yi of the pixel is incremented by 1) and is not substantially reflected in the background counter value.

ステップS35において、背景判定部101は、前段から順次入力される輝度信号Yiの画素を1画像分注目したか否かを判定し、1画像分の画素を注目した判定するまで、処理はステップS31に戻り、それ以降の処理を繰り返す。そして、ステップS35において、1画像分の画素を注目した判定した場合、処理はステップS36に進められる。   In step S35, the background determination unit 101 determines whether or not attention is paid to one pixel of the luminance signal Yi sequentially input from the previous stage. Return to and repeat the subsequent processing. If it is determined in step S35 that attention is paid to pixels for one image, the process proceeds to step S36.

ステップS36において、背景画素カウント部103は、背景カウンタ値を平均化部104に出力する。平均化部104は、背景画素カウント部103から入力された背景カウンタ値を、輝度のダイナミックレンジの階調数で除算し、その商を加算部105に出力する。   In step S <b> 36, the background pixel count unit 103 outputs the background counter value to the averaging unit 104. The averaging unit 104 divides the background counter value input from the background pixel counting unit 103 by the number of gradations of the luminance dynamic range, and outputs the quotient to the adding unit 105.

ステップS37において、RAM32は、タイミング制御部26からスイッチ31を介して指定された読み出しアドレスに従い、それまで保持していた値を出力することにより、背景を除く1画像分の各輝度の度数を加算部105に出力する。加算部105は、1画像毎にRAM32から出力された背景以外の部分が反映された各輝度の度数に、平均化部104から入力された値を加算して後段に出力する。   In step S <b> 37, the RAM 32 outputs the value held so far in accordance with the read address designated from the timing control unit 26 via the switch 31, thereby adding the frequency of each luminance for one image excluding the background. Output to the unit 105. The adding unit 105 adds the value input from the averaging unit 104 to the frequency of each luminance reflecting the portion other than the background output from the RAM 32 for each image, and outputs the result to the subsequent stage.

加算部105から出力されるヒストグラムは、ヒストグラムデータ取得部21に入力される画像が例えば図33に示されたように一様な背景を有するものであっても、図40に示すように、背景に対応する輝度の度数が突出することなく、背景に対応する輝度の度数を輝度の全域に亘って均等に分散される。したがって、このヒストグラムに基づいてコントラスト補正を行えば、被写体のうち、背景の輝度と同じ輝度の部分のコントラストが不必要に補正されてしまい不自然で見苦しい画像となってしまうようなことを抑止することができる。   As shown in FIG. 40, the histogram output from the adding unit 105 has a uniform background as shown in FIG. 40 even if the image input to the histogram data acquiring unit 21 has a uniform background as shown in FIG. The luminance frequency corresponding to the background is evenly distributed over the entire luminance range without protruding the luminance frequency corresponding to. Therefore, if contrast correction is performed based on this histogram, it is possible to prevent an image from being unnatural and unsightly because the contrast of the portion of the subject having the same luminance as the background is unnecessarily corrected. be able to.

上述したように、背景を除去してヒストグラムを生成する方法は、自然画像だけでなく、コンピュータグラフィックやアニメーション画像などの平坦な部分が多い画像に対しても、平坦部分の度数を除去する効果がある。さらに、カラーバーなどのテスト信号などでも、同様に、平坦部分が多く存在し、従来例では不必要なゲイン特性を発生していたが、このような作られた信号にも、効果を発揮することができる。   As described above, the method of generating the histogram by removing the background has the effect of removing the frequency of the flat portion not only for a natural image but also for an image having many flat portions such as a computer graphic or an animation image. is there. Furthermore, test signals such as color bars also have a lot of flat parts in the same way, and unnecessary gain characteristics were generated in the conventional example, but they are also effective for such signals. be able to.

以上で、ヒストグラムデータ取得部21の第2の構成例による、背景を除去したヒストグラム生成処理の説明を終了する。   This is the end of the description of the histogram generation process in which the background is removed according to the second configuration example of the histogram data acquisition unit 21.

ところで、上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば図41に示すように構成された汎用のパーソナルコンピュータなどに、記録媒体からインストールされる。   By the way, the series of processes described above can be executed by hardware, but can also be executed by software. When a series of processing is executed by software, a program constituting the software may execute various functions by installing a computer incorporated in dedicated hardware or various programs. For example, it is installed from a recording medium in a general-purpose personal computer configured as shown in FIG.


このパーソナルコンピュータ200は、CPU(Central Processing Unit)201を内蔵している。CPU201にはバス204を介して、入出力インタフェース205が接続されている。バス204には、ROM(Read Only Memory)202およびRAM(Random Access Memory)203が接続されている。

The personal computer 200 incorporates a CPU (Central Processing Unit) 201. An input / output interface 205 is connected to the CPU 201 via the bus 204. A ROM (Read Only Memory) 202 and a RAM (Random Access Memory) 203 are connected to the bus 204.

入出力インタフェース205には、ユーザが操作コマンドを入力するキーボード、マウス等の入力デバイスよりなる入力部206、合処理対象の画像などを表示するCRT(Cathode Ray Tube)またはLCD(Liquid Crystal Display)等のディスプレイよりなる出力部207、プログラムや各種データを格納するハードディスクドライブなどよりなる記憶部208、およびモデム、LAN(Local Area Network)アダプタなどよりなり、インタネットに代表されるネットワークを介した通信処理を実行する通信部209が接続されている。また、磁気ディスク(フレキシブルディスクを含む)、光ディスク(CD-ROM(Compact Disc-Read Only Memory)、DVD(Digital Versatile Disc)を含む)、光磁気ディスク(MD(Mini Disc)を含む)、もしくは半導体メモリなどの記録媒体211に対してデータを読み書きするドライブ210が接続されている。   An input / output interface 205 includes a keyboard for inputting operation commands by a user, an input unit 206 including an input device such as a mouse, a CRT (Cathode Ray Tube) or an LCD (Liquid Crystal Display) for displaying an image to be processed, etc. Output unit 207 consisting of a display, a storage unit 208 consisting of a hard disk drive for storing programs and various data, a modem, a LAN (Local Area Network) adapter, etc., and communication processing via a network represented by the Internet. A communication unit 209 to be executed is connected. Also, a magnetic disk (including a flexible disk), an optical disk (including a CD-ROM (Compact Disc-Read Only Memory), a DVD (Digital Versatile Disc)), a magneto-optical disk (including an MD (Mini Disc)), or a semiconductor A drive 210 for reading / writing data from / to a recording medium 211 such as a memory is connected.

このパーソナルコンピュータ200に上述した一連の処理を実行させるプログラムは、記録媒体211に格納された状態でパーソナルコンピュータ200に供給され、ドライブ210によって読み出されて記憶部208に内蔵されるハードディスクドライブにインストールされている。記憶部208にインストールされているプログラムは、入力部206に入力されるユーザからのコマンドに対応するCPU201の指令によって、記憶部208からRAM203にロードされて実行される。   A program for causing the personal computer 200 to execute the above-described series of processing is supplied to the personal computer 200 while being stored in the recording medium 211, read by the drive 210, and installed in a hard disk drive built in the storage unit 208. Has been. The program installed in the storage unit 208 is loaded from the storage unit 208 to the RAM 203 and executed in response to a command from the CPU 201 corresponding to a command from the user input to the input unit 206.

なお、本明細書において、プログラムに基づいて実行されるステップは、記載された順序に従って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理をも含むものである。   In this specification, the steps executed based on the program are executed in parallel or individually even if they are not necessarily processed in time series, as well as processes executed in time series according to the described order. It also includes processing.

また、プログラムは、1台のコンピュータにより処理されるものであってもよいし、複数のコンピュータによって分散処理されるものであってもよい。さらに、プログラムは、遠方のコンピュータに転送されて実行されるものであってもよい。   The program may be processed by a single computer, or may be distributedly processed by a plurality of computers. Furthermore, the program may be transferred to a remote computer and executed.

また、本明細書において、システムとは、複数の装置により構成される装置全体を表すものである。   Further, in this specification, the system represents the entire apparatus constituted by a plurality of apparatuses.

なお、本発明の実施の形態は、上述した実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変更が可能である。   The embodiment of the present invention is not limited to the above-described embodiment, and various modifications can be made without departing from the gist of the present invention.

従来のコントラスト補正装置の構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the conventional contrast correction apparatus. 輝度のヒストグラムの一例を示す図である。It is a figure which shows an example of the histogram of a brightness | luminance. 図2のヒストグラムに対応する累積ヒストグラムを示す図である。FIG. 3 is a diagram illustrating a cumulative histogram corresponding to the histogram of FIG. 2. 図3の累積ヒストグラムに基づくゲインコントロール特性を示す図である。It is a figure which shows the gain control characteristic based on the accumulation histogram of FIG. 図2のヒストグラムに対応する補正後のヒストグラムを示す図である。It is a figure which shows the histogram after the correction | amendment corresponding to the histogram of FIG. 輝度のヒストグラムの一例を示す図である。It is a figure which shows an example of the histogram of a brightness | luminance. 図6のヒストグラムに対応するゲインコントロール特性を示す図である。It is a figure which shows the gain control characteristic corresponding to the histogram of FIG. 本発明を適用したコントラスト補正装置の第1の構成例を示すブロック図である。It is a block diagram which shows the 1st structural example of the contrast correction apparatus to which this invention is applied. 図8のヒストグラムデータ取得部の第1の構成例を示すブロック図である。It is a block diagram which shows the 1st structural example of the histogram data acquisition part of FIG. 3バンド累積ヒストグラムの一例を示す図である。It is a figure which shows an example of 3 band cumulative histogram. 図10の3バンド累積ヒストグラムに基づくゲイン関数を示す図である。It is a figure which shows the gain function based on the 3 band cumulative histogram of FIG. 輝度のヒストグラムの一例を示す図である。It is a figure which shows an example of the histogram of a brightness | luminance. 図12のヒストグラムに対応する3バンド累積ヒストグラムを示す図である。FIG. 13 is a diagram showing a 3-band cumulative histogram corresponding to the histogram of FIG. 12. 図13の3バンド累積ヒストグラムに基づくゲイン関数を示す図である。It is a figure which shows the gain function based on the 3 band cumulative histogram of FIG. 輝度のヒストグラムの一例を示す図である。It is a figure which shows an example of the histogram of a brightness | luminance. 図15のヒストグラムに対応する3バンド累積ヒストグラムを示す図である。FIG. 16 is a diagram showing a 3-band cumulative histogram corresponding to the histogram of FIG. 15. 図15の3バンド累積ヒストグラムに基づくゲイン関数を示す図である。It is a figure which shows the gain function based on the 3 band cumulative histogram of FIG. 輝度のヒストグラムの一例を示す図である。It is a figure which shows an example of the histogram of a brightness | luminance. 図18のヒストグラムに対応する3バンド累積ヒストグラムを示す図である。FIG. 19 is a diagram showing a 3-band cumulative histogram corresponding to the histogram of FIG. 18. 図19の3バンド累積ヒストグラムに基づくゲイン関数を示す図である。FIG. 20 is a diagram illustrating a gain function based on the 3-band cumulative histogram of FIG. 19. 図8のLUT輝度変換部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the LUT brightness | luminance conversion part of FIG. コントラスト補正装置の第1の構成例によるコントラスト補正処理を説明するフローチャートである。It is a flowchart explaining the contrast correction process by the 1st structural example of a contrast correction apparatus. 図6のヒストグラムに対応する3バンド累積ヒストグラムを示す図である。FIG. 7 is a diagram showing a 3-band cumulative histogram corresponding to the histogram of FIG. 6. 図23の3バンド累積ヒストグラムに対応するゲイン関数を示す図である。It is a figure which shows the gain function corresponding to the 3 band cumulative histogram of FIG. 本発明を適用したコントラスト補正装置の第2の構成例を示すブロック図である。It is a block diagram which shows the 2nd structural example of the contrast correction apparatus to which this invention is applied. 本発明を適用したコントラスト補正装置の第3の構成例を示すブロック図である。It is a block diagram which shows the 3rd structural example of the contrast correction apparatus to which this invention is applied. 本発明を適用したコントラスト補正装置の第4の構成例を示すブロック図である。It is a block diagram which shows the 4th structural example of the contrast correction apparatus to which this invention is applied. コントラスト補正装置の第4の構成例による動作を説明するフローチャートである。It is a flowchart explaining the operation | movement by the 4th structural example of a contrast correction apparatus. 黒レベル補償なしのゲイン関数の一例を示す図である。It is a figure which shows an example of the gain function without black level compensation. 係数kaの算出を説明するための図である。It is a figure for demonstrating calculation of the coefficient ka. 図29のゲイン関数に対応する、黒レベル補償有に補正したゲイン関数を示す図である。It is a figure which shows the gain function correct | amended with black level compensation corresponding to the gain function of FIG. コントラスト補正装置の第4の構成例による補正後のヒストグラムを示す図である。It is a figure which shows the histogram after correction | amendment by the 4th structural example of a contrast correction apparatus. 均一な背景を含む画像の一例を示す図である。It is a figure which shows an example of the image containing a uniform background. 図33の画像に対応する輝度のヒストグラムを示す図である。It is a figure which shows the histogram of the brightness | luminance corresponding to the image of FIG. ヒストグラムデータ取得部の第2の構成例を示すブロック図である。It is a block diagram which shows the 2nd structural example of a histogram data acquisition part. 図35の背景判定部の構成例を示すブロック図である。FIG. 36 is a block diagram illustrating a configuration example of a background determination unit in FIG. 35. 背景判定部を構成するローパスフィルタとバンドパスフィルタの特性を示す図である。It is a figure which shows the characteristic of the low pass filter and band pass filter which comprise a background determination part. 図36の連続性判定部の構成例を示すブロック図である。It is a block diagram which shows the structural example of the continuity determination part of FIG. ヒストグラムデータ取得部の第2の構成例の動作を説明するフローチャートである。It is a flowchart explaining operation | movement of the 2nd structural example of a histogram data acquisition part. ヒストグラムデータ取得部の第2の構成例から出力される、背景部分が除去されたヒストグラムを示す図である。It is a figure which shows the histogram from which the background part was output output from the 2nd structural example of a histogram data acquisition part. 汎用パーソナルコンピュータの構成例を示すブロック図である。It is a block diagram which shows the structural example of a general purpose personal computer.

符号の説明Explanation of symbols

20 コントラスト補正装置, 21 ヒストグラムデータ取得部, 22 3バンド累積度数変換部, 23 偏差算出部, 24 ゲイン関数生成部, 25 LUT輝度変換部, 51 遅延部 ,61 IIRフィルタ, 71 ローパスフィルタ, 72 黒レベル検出部, 73 黒レベル補償ゲイン計算部, 74 IIRフィルタ, 101 背景判定部, 102 インバータ, 103 背景画素カウント部, 104 平均化部, 105 加算部, 201 CPU, 211 記録媒体   20 contrast correction device, 21 histogram data acquisition unit, 22 3-band cumulative frequency conversion unit, 23 deviation calculation unit, 24 gain function generation unit, 25 LUT luminance conversion unit, 51 delay unit, 61 IIR filter, 71 low pass filter, 72 black Level detection unit, 73 black level compensation gain calculation unit, 74 IIR filter, 101 background determination unit, 102 inverter, 103 background pixel count unit, 104 averaging unit, 105 addition unit, 201 CPU, 211 recording medium

Claims (9)

画像のコントラストを補正する画像処理装置において、
1画像分の輝度信号のヒストグラムを取得する取得手段と、
前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成する作成手段と、
1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出する算出手段と、
算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成する生成手段と、
前記輝度信号を前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正する補正手段と
を含む画像処理装置。
In an image processing apparatus for correcting the contrast of an image,
Obtaining means for obtaining a histogram of luminance signals for one image;
Based on the histogram, creating means for dividing a dynamic range of luminance into a predetermined number of regions and creating a region frequency distribution indicating the number of pixels belonging to each region;
Deviation at the boundary of the region between the straight line corresponding to the cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance and the curve obtained by combining the straight line based on the region frequency distribution Calculating means for calculating
The calculated the difference was normalized by dividing by the number of gradations of the luminance signal, using said deviation normalized to the coefficient, the curve that combines the line based on the region the frequency distribution of the odd function and even function in combination Generating means for generating a gain function that receives the luminance signal before contrast correction and outputs the luminance signal after contrast correction , approximated by
An image processing apparatus comprising: correction means for correcting the contrast of the image by correcting the luminance signal based on the gain function.
前記取得手段、前記作成手段、前記算出手段、および前記生成手段の処理に要する時間だけ、前記輝度信号を遅延して前記補正手段に供給する遅延手段を
さらに含む請求項1に記載の画像処理装置。
The image processing apparatus according to claim 1, further comprising a delay unit that delays the luminance signal and supplies the luminance signal to the correction unit for a time required for processing of the acquisition unit, the generation unit, the calculation unit, and the generation unit. .
前記生成手段によって生成された前記ゲイン関数の時間方向の変動を緩和して前記補正手段に供給する緩和手段を
さらに含む請求項1に記載の画像処理装置。
The image processing apparatus according to claim 1, further comprising a relaxation unit that relaxes a time-direction variation of the gain function generated by the generation unit and supplies the gain function to the correction unit.
画像のコントラストを補正する画像処理装置の画像処理方法において、
1画像分の輝度信号のヒストグラムを取得し、
前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成し、
1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出し、
算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成し、
前記輝度信号を前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正する
ステップを含む画像処理方法。
In the image processing method of the image processing apparatus for correcting the contrast of the image,
Obtain a histogram of the luminance signal for one image,
Based on the histogram, the luminance dynamic range is divided into a predetermined number of regions, creating a region frequency distribution indicating the number of pixels belonging to each region,
Deviation at the boundary of the region between the straight line corresponding to the cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance and the curve obtained by combining the straight line based on the region frequency distribution To calculate
The calculated the difference was normalized by dividing by the number of gradations of the luminance signal, using said deviation normalized to the coefficient, the curve that combines the line based on the region the frequency distribution of the odd function and even function in combination Generate a gain function that receives the luminance signal before contrast correction and outputs the luminance signal after contrast correction , approximated by
An image processing method comprising: correcting the contrast of the image by correcting the luminance signal based on the gain function.
画像のコントラストを補正するためのプログラムであって、
1画像分の輝度信号のヒストグラムを取得し、
前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成し、
1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出し、
算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成し、
前記輝度信号を前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正する
ステップを含む処理をコンピュータに実行させるプログラム。
A program for correcting the contrast of an image,
Obtain a histogram of the luminance signal for one image,
Based on the histogram, the luminance dynamic range is divided into a predetermined number of regions, creating a region frequency distribution indicating the number of pixels belonging to each region,
Deviation at the boundary of the region between the straight line corresponding to the cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance and the curve obtained by combining the straight line based on the region frequency distribution To calculate
The calculated the difference was normalized by dividing by the number of gradations of the luminance signal, using said deviation normalized to the coefficient, the curve that combines the line based on the region the frequency distribution of the odd function and even function in combination Generate a gain function that receives the luminance signal before contrast correction and outputs the luminance signal after contrast correction , approximated by
A program that causes a computer to execute processing including a step of correcting the contrast of the image by correcting the luminance signal based on the gain function.
画像のコントラストを補正する画像処理装置において、
1画像分の輝度信号のヒストグラムを取得する取得手段と、
前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成する作成手段と、
1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出する算出手段と、
算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成する生成手段と、
前記ヒストグラムに基づき、輝度の最小値に対応する度数からの累積度数が所定の値となる輝度を黒レベルに決定する決定手段と、
前記黒レベルの輝度信号を所定のペデスタルレベルの輝度信号に変換するための黒レベル補償関数を生成し、生成した前記黒レベル補償関数に基づいて前記ゲイン関数を修正する修正手段と、
前記輝度信号を前記修正手段によって修正された前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正する補正手段と
を含む画像処理装置。
In an image processing apparatus for correcting the contrast of an image,
Obtaining means for obtaining a histogram of luminance signals for one image;
Based on the histogram, creating means for dividing a dynamic range of luminance into a predetermined number of regions and creating a region frequency distribution indicating the number of pixels belonging to each region;
Deviation at the boundary of the region between the straight line corresponding to the cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance and the curve obtained by combining the straight line based on the region frequency distribution Calculating means for calculating
The calculated the difference was normalized by dividing by the number of gradations of the luminance signal, using said deviation normalized to the coefficient, the curve that combines the line based on the region the frequency distribution of the odd function and even function in combination Generating means for generating a gain function that receives the luminance signal before contrast correction and outputs the luminance signal after contrast correction , approximated by
Determining means for determining, on the basis of the histogram, a luminance at which a cumulative frequency from a frequency corresponding to a minimum luminance value is a predetermined value, as a black level;
Correcting means for generating a black level compensation function for converting the black level luminance signal into a predetermined pedestal level luminance signal, and correcting the gain function based on the generated black level compensation function;
An image processing apparatus comprising: correction means for correcting the contrast of the image by correcting the luminance signal based on the gain function corrected by the correction means.
前記取得手段の前段において前記輝度信号の高周波成分を除去する除去手段を
さらに含む請求項6に記載の画像処理装置。
The image processing apparatus according to claim 6, further comprising a removing unit that removes a high-frequency component of the luminance signal before the obtaining unit.
画像のコントラストを補正する画像処理装置の画像処理方法において、
1画像分の輝度信号のヒストグラムを取得し、
前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成し、
1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出し、
算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成し、
前記ヒストグラムに基づき、輝度の最小値に対応する度数からの累積度数が所定の値となる輝度を黒レベルに決定し、
前記黒レベルの輝度信号を所定のペデスタルレベルの輝度信号に変換するための黒レベル補償関数を生成し、生成した前記黒レベル補償関数に基づいて前記ゲイン関数を修正し、
前記輝度信号を修正済みの前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正する
ステップを含む画像処理方法。
In the image processing method of the image processing apparatus for correcting the contrast of the image,
Obtain a histogram of the luminance signal for one image,
Based on the histogram, the luminance dynamic range is divided into a predetermined number of regions, creating a region frequency distribution indicating the number of pixels belonging to each region,
Deviation at the boundary of the region between the straight line corresponding to the cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance and the curve obtained by combining the straight line based on the region frequency distribution To calculate
The calculated the difference was normalized by dividing by the number of gradations of the luminance signal, using said deviation normalized to the coefficient, the curve that combines the line based on the region the frequency distribution of the odd function and even function in combination Generate a gain function that receives the luminance signal before contrast correction and outputs the luminance signal after contrast correction , approximated by
Based on the histogram, determine the luminance at which the cumulative frequency from the frequency corresponding to the minimum luminance value is a predetermined value as the black level,
Generating a black level compensation function for converting the black level luminance signal into a predetermined pedestal level luminance signal, and correcting the gain function based on the generated black level compensation function;
An image processing method comprising: correcting the contrast of the image by correcting the luminance signal based on the corrected gain function.
画像のコントラストを補正するためのプログラムであって、
1画像分の輝度信号のヒストグラムを取得し、
前記ヒストグラムに基づき、輝度のダイナミックレンジを所定の数の領域に分割し、各領域に属する画素数を示す領域度数分布を作成し、
1画像分の輝度信号が輝度のダイナミックレンジに均等に分布している場合を想定した累積ヒストグラムに対応する直線と、前記領域度数分布に基づく直線を結合した曲線との、前記領域の境界における偏差を算出し、
算出した前記偏差を前記輝度信号の階調数で除算することにより正規化し、正規化した前記偏差を係数に用いる、前記領域度数分布に基づく直線を結合した前記曲線を奇関数および関数の組み合わせで近似したコントラスト補正前の輝度信号を入力、コントラスト補正後の輝度信号を出力とするゲイン関数を生成し、
前記ヒストグラムに基づき、輝度の最小値に対応する度数からの累積度数が所定の値となる輝度を黒レベルに決定し、
前記黒レベルの輝度信号を所定のペデスタルレベルの輝度信号に変換するための黒レベル補償関数を生成し、生成した前記黒レベル補償関数に基づいて前記ゲイン関数を修正し、
前記輝度信号を修正済みの前記ゲイン関数に基づいて補正することにより前記画像のコントラストを補正する
ステップを含む処理をコンピュータに実行させるプログラム。
A program for correcting the contrast of an image,
Obtain a histogram of the luminance signal for one image,
Based on the histogram, the luminance dynamic range is divided into a predetermined number of regions, creating a region frequency distribution indicating the number of pixels belonging to each region,
Deviation at the boundary of the region between the straight line corresponding to the cumulative histogram assuming that the luminance signal for one image is evenly distributed in the dynamic range of luminance and the curve obtained by combining the straight line based on the region frequency distribution To calculate
The calculated the difference was normalized by dividing by the number of gradations of the luminance signal, using said deviation normalized to the coefficient, the curve that combines the line based on the region the frequency distribution of the odd function and even function in combination Generate a gain function that receives the luminance signal before contrast correction and outputs the luminance signal after contrast correction , approximated by
Based on the histogram, determine the luminance at which the cumulative frequency from the frequency corresponding to the minimum luminance value is a predetermined value as the black level,
Generating a black level compensation function for converting the black level luminance signal into a predetermined pedestal level luminance signal, and correcting the gain function based on the generated black level compensation function;
A program that causes a computer to execute processing including a step of correcting the contrast of the image by correcting the luminance signal based on the corrected gain function.
JP2006039511A 2006-02-16 2006-02-16 Image processing apparatus, image processing method, and program Expired - Fee Related JP4760433B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006039511A JP4760433B2 (en) 2006-02-16 2006-02-16 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006039511A JP4760433B2 (en) 2006-02-16 2006-02-16 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2007221446A JP2007221446A (en) 2007-08-30
JP4760433B2 true JP4760433B2 (en) 2011-08-31

Family

ID=38498214

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006039511A Expired - Fee Related JP4760433B2 (en) 2006-02-16 2006-02-16 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP4760433B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009058377A (en) * 2007-08-31 2009-03-19 Hitachi Kokusai Electric Inc Inspection apparatus
JP4700721B2 (en) * 2008-10-10 2011-06-15 株式会社沖データ Image processing device
JP2011228807A (en) * 2010-04-15 2011-11-10 Nikon Corp Image processing program, image processing apparatus, and image processing method
KR102169870B1 (en) 2013-12-23 2020-10-27 삼성디스플레이 주식회사 Image processing controller, display apparatus and driving method thereof
US10861137B2 (en) * 2017-09-15 2020-12-08 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003281527A (en) * 2002-02-26 2003-10-03 Sony Internatl Europ Gmbh Contrast enhancement method and contrast enhancement device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2964492B2 (en) * 1989-08-15 1999-10-18 ソニー株式会社 Image processing apparatus and image processing method
BE1007777A3 (en) * 1993-11-23 1995-10-17 Philips Electronics Nv Non-linear signal.

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003281527A (en) * 2002-02-26 2003-10-03 Sony Internatl Europ Gmbh Contrast enhancement method and contrast enhancement device

Also Published As

Publication number Publication date
JP2007221446A (en) 2007-08-30

Similar Documents

Publication Publication Date Title
RU2497301C2 (en) Device to improve images, method to improve images, software to improve images and device for signal processing
JP4556276B2 (en) Image processing circuit and image processing method
US5848181A (en) Image processing method, image processing apparatus, noise removing method, and noise removing apparatus
JP3003561B2 (en) Gradation conversion method and circuit, image display method and apparatus, and image signal conversion apparatus
US8654221B2 (en) Image processing device and method, and program
JP4214457B2 (en) Image processing apparatus and method, recording medium, and program
US20110150353A1 (en) Information processing apparatus, information processing method, and program
JP4760433B2 (en) Image processing apparatus, image processing method, and program
JP2007281767A (en) Apparatus, program and method for image processing
JP2008017458A (en) Image processor, image processing method, image processing program, and integrated circuit
JP5152203B2 (en) Image processing apparatus, image processing method, image processing program, and image correction apparatus
JP4760434B2 (en) Image processing apparatus, image processing method, and program
JP2002290773A (en) Image enhancing device and image enhancing program
US20070258653A1 (en) Unit for and Method of Image Conversion
JP3192407B2 (en) Image display method and apparatus
JP2008259097A (en) Video signal processing circuit and video display device
JP4632100B2 (en) Image processing apparatus, image processing method, recording medium, and program
JP5349204B2 (en) Image processing apparatus and method, and image display apparatus and method
US8665315B2 (en) Signal processing device, reproducing device, signal processing method and program
JP3803231B2 (en) Tone correction device
JP5396626B1 (en) Image enhancement device and image enhancement method
US8571352B2 (en) Difference image generation device, difference image generation method, and computer readable media
JPH11341307A (en) Image display method and device thereof
JP2004172815A (en) Video signal processing apparatus
JP4483407B2 (en) Video signal processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110222

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110411

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110510

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110523

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140617

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140617

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees