JP2000102033A - Automatic gradation correction method - Google Patents

Automatic gradation correction method

Info

Publication number
JP2000102033A
JP2000102033A JP10264244A JP26424498A JP2000102033A JP 2000102033 A JP2000102033 A JP 2000102033A JP 10264244 A JP10264244 A JP 10264244A JP 26424498 A JP26424498 A JP 26424498A JP 2000102033 A JP2000102033 A JP 2000102033A
Authority
JP
Japan
Prior art keywords
gradation correction
gradation
data
storage unit
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP10264244A
Other languages
Japanese (ja)
Inventor
Asako Katou
麻子 加藤
Atsushi Moriwaki
淳 森脇
Kenji Tanaka
賢二 田中
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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan Ltd
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 Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP10264244A priority Critical patent/JP2000102033A/en
Publication of JP2000102033A publication Critical patent/JP2000102033A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Of Color Television Signals (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To easily perform the automatic gradation correction of color images without using a neural network. SOLUTION: A luminance histogram feature amount obtained by equally dividing an input luminance level axis into (n) (n) is an integer >=4) is fetched (step 101) and the various kinds of curve data are fetched (step 102). When the luminance histogram feature amount L is larger than a lower limit value, an under processing is performed (step 104). When it is L<=(lower limit value) and the luminance histogram feature amount H is larger than an upper limit value, an over processing is performed (step 106). When it is H<=(upper limit value), a linear processing is performed (step 107). When the under processing, the over processing or the linear processing is ended, gradation corrected curve data are obtained and stored in a gradation corrected curve data storage part 34 (step 108).

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は自動階調補正方法に
係り、特にディジタルカメラ、ビデオカメラ等の出力カ
ラー画像をプリンタで印字する際に、カラー画像の階調
を自動的に補正する自動階調補正方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an automatic gradation correcting method, and more particularly to an automatic gradation correcting method for automatically correcting the gradation of a color image when an output color image of a digital camera, a video camera or the like is printed by a printer. It relates to a key correction method.

【0002】[0002]

【従来の技術】図11はカラービデオプリンタを使用す
る印字システムの一例のブロック図を示す。同図におい
て、ディジタルカメラ11で撮像して得られたカラー画
像信号は、直接ビデオプリンタ16に供給されて印字さ
れる一方、パーソナルコンピュータ(以下、パソコンと
いう)14に取り込まれてディスプレイモニタの陰極線
管(CRT)19にて表示されると共に、パソコン14
内の中央処理装置(CPU)15で加工されてからビデ
オプリンタ16に供給されて印字される。
2. Description of the Related Art FIG. 11 is a block diagram showing an example of a printing system using a color video printer. In the figure, a color image signal obtained by imaging with a digital camera 11 is directly supplied to a video printer 16 and printed, while being taken in a personal computer (hereinafter, referred to as a personal computer) 14 and a cathode ray tube of a display monitor. (CRT) 19 and the personal computer 14
It is processed by a central processing unit (CPU) 15 and then supplied to a video printer 16 for printing.

【0003】また、ビデオカメラ12により撮像して得
られたカラー画像信号も、上記のディジタルカメラ11
からのカラー画像信号と同様に、直接ビデオプリンタ1
6に供給されて印字される一方、パソコン14に取り込
まれてディスプレイモニタのCRT19にて表示される
と共に、パソコン14内のCPU15で加工されてから
ビデオプリンタ16に供給されて印字される。更に、ビ
デオデッキ13により再生されたカラー画像信号は、ビ
デオプリンタ16に供給されて印字される。
A color image signal obtained by imaging with a video camera 12 is also used in the digital camera 11.
Video printer 1 as well as the color image signal from
While being supplied to the printer 6 and printed, it is taken into the personal computer 14 and displayed on the CRT 19 of the display monitor, processed by the CPU 15 in the personal computer 14 and then supplied to the video printer 16 for printing. Further, the color image signal reproduced by the video deck 13 is supplied to the video printer 16 and printed.

【0004】このように、ビデオプリンタ16は、ディ
ジタルカメラ11、ビデオカメラ12、ビデオデッキ1
3から直接に入力されるカラー画像信号を印字するか、
パソコン14内のCPU15で加工処理された、ディジ
タルカメラ11又はビデオカメラ12の出力カラー画像
信号を印字することができる。
As described above, the video printer 16 includes the digital camera 11, the video camera 12, and the VCR 1
3 to print the color image signal input directly from
The output color image signal of the digital camera 11 or the video camera 12 processed by the CPU 15 in the personal computer 14 can be printed.

【0005】ところで、通常、ディジタルカメラ11、
ビデオカメラ12で撮影する場合には、カメラ本体が露
出を最適化するような自動調整を行う。しかし、それら
により撮影した画像が、図11に示すような印字システ
ムにおいては必ずしも所望の階調を再現しているとは限
らない。特にビデオカメラ12にて掃影された状態では
動画なので気にならなかった明るさやコントラストも、
ビデオプリンタ16において静止画としてプリントする
と満足のゆく結果が得られない場合がよくある。
By the way, usually, the digital camera 11,
When shooting with the video camera 12, automatic adjustment is performed so that the camera body optimizes exposure. However, in a printing system such as that shown in FIG. 11, the image photographed by them does not always reproduce a desired gradation. In particular, the brightness and contrast that were not bothersome because the video was scanned by the video camera 12 were moving images.
Printing as a still image on the video printer 16 often does not provide satisfactory results.

【0006】そこで、ビデオプリンタ16にて所望の階
調を得るために、カラー画像の階調補正を施してから印
字することが従来より行われている。このカラー画像の
階調補正方法は、画像の輝度ヒストグラムを用いた階調
補正方法であり、この方法として一般的なものは、図1
2に示すような累積輝度分布を用いる方法である(「2
次元信号と画像処理」、平成8年12月25日発行、発
行者:社団法人計測自動制御学会)。
Therefore, in order to obtain a desired gradation in the video printer 16, it has been conventionally performed to perform gradation correction of a color image and then print. This gradation correction method for a color image is a gradation correction method using a luminance histogram of an image.
This method uses a cumulative luminance distribution as shown in FIG.
Dimensional Signals and Image Processing, "issued December 25, 1996, published by the Society of Instrument and Control Engineers.

【0007】図12(A)に示すように、与えられた画
像において、0からM−1の間の任意の濃度の値kに対
して、その値を持つ画素の総数をnkとするとき、 h(k)=nk k∈{0,1,2,...,M−1} と定義される関数h(k)がヒストグラムと呼ばれる。
与えられた画像全体の画素数をNとすると、
As shown in FIG. 12 (A), when a given image has an arbitrary density value k between 0 and M−1, the total number of pixels having that value is nk. , H (k) = n k k∈ {0, 1, 2,. . . , M−1} is called a histogram.
Assuming that the number of pixels of a given image is N,

【0008】[0008]

【数1】 である。(Equation 1) It is.

【0009】そしてヒストグラムが平坦に量子化された
画像が最も情報量が高いので、ヒストグラムが平坦でな
い情報の偏りがある画像を階調変換によりヒストグラム
を平坦化することにより、画像のコントラスト強調が可
能となる。このときの変換関数は強調前の図12(B)
に示すような累積輝度分布を求めることにより、容易に
求まる。すなわち、x(i,j)の画素値をKとすると
き、画素値Kまでの画像全体における画素の累積頻度を
H(K)とすると、
[0009] Since an image in which the histogram is flattened and quantized has the highest information amount, an image in which the histogram is not flat and in which there is a bias in information is flattened by gradation conversion to enhance the contrast of the image. Becomes The conversion function at this time is shown in FIG.
By obtaining a cumulative luminance distribution as shown in FIG. That is, when the pixel value of x (i, j) is K, and the cumulative frequency of pixels in the entire image up to the pixel value K is H (K),

【0010】[0010]

【数2】 で計算される。そして、x(i,j)の変換後の画素値
をy(i,j)とするとき、その値を y(i,j)=H(K)・(M−1)/N なる計算式で計算することにより、ヒストグラムの平坦
化ができる。
(Equation 2) Is calculated. When the pixel value after the conversion of x (i, j) is y (i, j), the value is calculated by the following formula: y (i, j) = H (K) · (M−1) / N By performing the above calculation, the histogram can be flattened.

【0011】上記の累積輝度分布を用いて階調補正する
従来の階調補正方法としてハードウェアにより実現した
ものが知られている(特開平7−250339号公
報)。この従来方法は、映像の輝度分布をもとに適応的
な階調補正テーブルを発生し、そのテーブルをもとに画
素単位で輝度信号の階調補正を行うと共に、Y/C比を
一定に保つため色信号についても階調補正を行うとき、
色補正データ算出時に色補正信号の演算レートを輝度補
正の半分とし、各画素の輝度レベルをもとに得られる階
調補正データに対し平均処理し、その平均値をC/Y倍
することにより、色階調補正への輝度信号に重畳された
ノイズの影響を低減しようとする構成である。
As a conventional gradation correction method for performing gradation correction using the above-mentioned accumulated luminance distribution, a method realized by hardware is known (Japanese Patent Application Laid-Open No. 7-250339). According to this conventional method, an adaptive gradation correction table is generated based on the luminance distribution of an image, the gradation correction of the luminance signal is performed in pixel units based on the table, and the Y / C ratio is kept constant. When performing tone correction on color signals to maintain
At the time of calculating the color correction data, the operation rate of the color correction signal is set to half of the luminance correction, the gradation correction data obtained based on the luminance level of each pixel is averaged, and the average value is multiplied by C / Y. In this configuration, the influence of noise superimposed on the luminance signal on the color gradation correction is reduced.

【0012】また、従来の階調補正方法として、ニュー
ラルネットワークを用いた階調補正方法も知られている
(田村彰浩他、「ニューロガンマ処理によるカメラのD
レンジ拡大」、テレビジョン学会技術報告、Vol.18,No.
72,pp13〜18、1994年11月29日発表)。これ
は、ニューラルネットワークの学習機能を用いたカメラ
の階調補正方法で、輝度ヒストグラムを低/中/高輝度
の3つの領域に分割して特徴量を算出してニューラルネ
ットワークにて階調補正曲線を決定している。従来の試
行錯誤等による方法では、最適な逆光判断のルール作成
は困難であるとしてニューラルネットワークを用いてい
る。
As a conventional gradation correction method, there is also known a gradation correction method using a neural network (see Akihiro Tamura et al., "Digitalization of Camera by Neuro-gamma Processing").
Range Expansion '', Technical Report of the Institute of Television Engineers of Japan, Vol. 18, No.
72, pp13-18, announced on November 29, 1994). This is a camera gradation correction method using a learning function of a neural network. The luminance histogram is divided into three regions of low / medium / high luminance to calculate a feature amount, and the gradation correction curve is calculated by the neural network. Is determined. Conventional methods based on trial and error use a neural network because it is difficult to create an optimal backlight determination rule.

【0013】[0013]

【発明が解決しようとする課題】しかるに、上記の特開
平7−250339号公報記載の従来の階調補正方法
は、階調補正方法として累積輝度分布を用いてハードウ
ェアにて実現しているため、画像に対する階調補正の変
更に柔軟に対応できず、また構成が高価である。このた
め、上記の従来の階調補正方法をソフトウェアにて処理
することが考えられるが、このままの方法ではソフトウ
ェアにて高速に処理する場合にはいくつかの問題が発生
する。
However, the conventional gradation correction method described in Japanese Patent Laid-Open No. 7-250339 is realized by hardware using a cumulative luminance distribution as the gradation correction method. However, it is not possible to flexibly cope with a change in gradation correction for an image, and the configuration is expensive. For this reason, it is conceivable that the above-described conventional tone correction method is processed by software. However, if the method is used as it is, high-speed processing by software causes some problems.

【0014】まず、累積輝度分布をそのまま用いる場
合、フィルタを通す等の処理をしないと滑らかな階調が
得られない。また、画像の中に肌色または空色部分が多
い画像であれば輝度以外の情報を用いて肌色、空色抽出
の処理をしなければ、そこに多くの階調が割り当てられ
るために肌の滑らかさがなくなる、空の雲ばかり強調さ
れるといった不自然な画像となることが多い。ソフトウ
ェアだけで高速に処理をするためには、処理をもっと単
純化する必要がある。
First, when the accumulated luminance distribution is used as it is, smooth gradation cannot be obtained unless processing such as passing through a filter is performed. Also, if the image has a lot of flesh or sky blue parts, if the process of flesh and sky color extraction is not performed using information other than luminance, many gradations will be assigned to it, and the smoothness of the skin will be poor. It often results in an unnatural image in which the sky disappears and only the clouds in the sky are emphasized. In order to perform high-speed processing using only software, it is necessary to further simplify the processing.

【0015】一方、ニューラルネットワークを用いた従
来の階調補正方法では、ニューラルネットワークは、研
究段階にある方式であり使いこなすまでには技術蓄積や
研究時間を多く必要とする。
On the other hand, in the conventional gradation correction method using a neural network, the neural network is a method in a research stage, and requires a lot of technology accumulation and research time before it can be fully used.

【0016】本発明は上記の点に鑑みなされたもので、
ニューラルネットワークを用いずにカラー画像の自動階
調補正を実現し得る自動階調補正方法を提供することを
目的とする。
The present invention has been made in view of the above points,
An object of the present invention is to provide an automatic gradation correction method capable of realizing automatic gradation correction of a color image without using a neural network.

【0017】[0017]

【課題を解決するための手段】本発明は上記の目的を達
成するため、第1乃至第6のステップにより階調補正し
ようとするカラー画像データの自動階調補正を行い、第
7のステップにより画像メモリに自動階調補正された画
像データを書き込むものである。ただし、第3、第4、
第5のステップはいずれか一のステップが実行される。
In order to achieve the above object, the present invention performs automatic gradation correction of color image data to be corrected in the first to sixth steps, and performs the seventh step in the seventh step. This is for writing image data that has been subjected to automatic gradation correction to an image memory. However, the third, fourth,
In the fifth step, any one of the steps is executed.

【0018】すなわち、まず、第1のステップでは、階
調補正しようとするカラー画像データから輝度ヒストグ
ラムを作成し、その輝度ヒストグラムから入力輝度レベ
ル軸をn等分(nは4以上の整数)したそれぞれの領域
の画素数の全画素に対する割合を示す第1の特徴量と、
n等分したそれぞれの領域の一定のリミッタ値を越える
画素数の全画素に対する割合を示す第2の特徴量と、輝
度ヒストグラムから入力輝度レベル軸を3等分したそれ
ぞれの領域の画素数の全画素に対する割合を示す第3の
特徴量とをそれぞれ算出して第1の格納部に格納する。
That is, first, in the first step, a luminance histogram is created from the color image data whose gradation is to be corrected, and the input luminance level axis is divided into n equal parts (n is an integer of 4 or more) from the luminance histogram. A first feature amount indicating a ratio of the number of pixels in each region to all pixels,
A second feature quantity indicating the ratio of the number of pixels exceeding a certain limiter value to all pixels in each area divided into n equal parts, and the total number of pixels in each area obtained by dividing the input luminance level axis into three parts from the luminance histogram A third feature amount indicating a ratio to a pixel is calculated and stored in the first storage unit.

【0019】続いて、第2のステップでは、第1の格納
部に格納されている第1乃至第3の特徴量を取り込み、
そのうち最も低輝度側領域の第3の特徴量が予め設定し
た下限値より大であり、かつ、最も高輝度側領域の第3
の特徴量が予め設定した上限値より小であるかどうか比
較判定する。第3のステップでは、第2のステップによ
り、最も低輝度側領域の第3の特徴量が予め設定した下
限値より大である判定結果が得られたときは露光アンダ
ーと判断して、第1の特徴量を用いてコントラストの傾
き情報を求め、その傾き情報からアンダー強度を求めた
後、そのアンダー強度に応じて、入力階調に対する出力
階調の各種の特性曲線を示す各種曲線データが予め格納
されている第2の格納部から入力階調に対して出力階調
を増加させる特性の曲線データを選択するアンダー処理
を行う。
Subsequently, in a second step, the first to third feature values stored in the first storage unit are fetched,
Among them, the third feature amount of the lowest luminance region is larger than the preset lower limit value, and the third feature value of the highest luminance region is
It is determined whether or not the feature value of is smaller than a preset upper limit value. In the third step, when the determination result that the third feature amount of the lowest luminance side area is larger than the preset lower limit value is obtained in the second step, it is determined that the exposure is under, and the first step is performed. After calculating the inclination information of the contrast using the characteristic amount of the above, and obtaining the under intensity from the inclination information, various curve data indicating various characteristic curves of the output gradation with respect to the input gradation are obtained in advance according to the under intensity. An under process is performed to select, from the stored second storage section, curve data having a characteristic of increasing the output gradation with respect to the input gradation.

【0020】第4のステップでは、第2のステップによ
り、最も高輝度側領域の第3の特徴量が予め設定した上
限値より大である判定結果が得られたときは露光オーバ
ーと判断して、第1の特徴量を用いてコントラストの傾
き情報を求め、その傾き情報からオーバー強度を求めた
後、そのオーバー強度に応じて、第2の格納部から入力
階調に対して出力階調を減少させる特性の曲線データを
選択するオーバー処理を行う。第5のステップでは、第
2のステップにより、最も低輝度側領域の第3の特徴量
が予め設定した下限値以下であり、かつ、最も高輝度側
領域の第3の特徴量が予め設定した上限値より小である
判定結果が得られたときは、第1の特徴量を用いてコン
トラストの傾き情報を求めると共に、第2の特徴量に応
じて強度を求めた後、その強度に応じて第2の格納部か
ら曲線データを選択するリニア処理を行う。
In the fourth step, it is determined that the exposure is over when the result of the determination in the second step is that the third characteristic amount in the highest luminance side area is larger than a preset upper limit value. After calculating the gradient information of the contrast by using the first feature amount and calculating the over-intensity from the tilt information, the output gray scale is compared with the input gray scale from the second storage unit according to the over-magnitude. An over process for selecting curve data having characteristics to be reduced is performed. In the fifth step, according to the second step, the third feature value of the lowest luminance region is equal to or less than a preset lower limit value, and the third feature value of the highest luminance region is set in advance. When a determination result that is smaller than the upper limit value is obtained, the gradient information of the contrast is obtained using the first feature amount, and the strength is obtained according to the second feature amount. A linear process for selecting curve data from the second storage unit is performed.

【0021】第6のステップは、第3、第4又は第5の
ステップで作成したコントラストの傾き情報と選択した
曲線データを合成して階調補正曲線データを生成して第
3の格納部に格納する。続いて、第7のステップでは、
階調補正しようとするカラー画像データが格納されてい
る画像メモリから読み出した当該階調補正しようとする
カラー画像データに、第3の格納部からの階調補正曲線
データを反映させて画像メモリに再び格納する。
The sixth step is to combine the gradient information of the contrast created in the third, fourth or fifth step with the selected curve data to generate gradation correction curve data, and store it in the third storage unit. Store. Then, in the seventh step,
The color correction curve data from the third storage unit is reflected in the color image data to be corrected read out from the image memory in which the color image data to be corrected is stored. Store again.

【0022】この発明では、入力カラー画像データの輝
度ヒストグラムをn等分に分割して、その曲線のおよそ
の形を知り、その形に応じてコントラストの傾き情報を
算出すると共に曲線データを最適なものに選択した後、
それらを合成して階調補正曲線データを生成する。
According to the present invention, the luminance histogram of the input color image data is divided into n equal parts, the approximate shape of the curve is known, the slope information of the contrast is calculated according to the shape, and the curve data is optimized. After choosing one,
These are combined to generate gradation correction curve data.

【0023】また、本発明は、第3の格納部の階調補正
曲線データと入力された階調補正しようとするカラー画
像データとを用いて、このカラー画像データの色差信号
がオーバーフローする画素数を検出する第8のステップ
と、第8のステップで検出したオーバーフロー画素数を
もとに、第3の格納部に格納されるコントラストの傾き
情報と選択した曲線データの少なくとも一方を修正して
合成する第9のステップとを更に含み、第9のステップ
で合成して得られた修正後の階調補正曲線データを第3
の格納部に再び格納することを特徴とする。
Further, according to the present invention, the number of pixels for which the color difference signal of the color image data overflows is determined by using the gradation correction curve data in the third storage unit and the input color image data to be corrected. And correcting at least one of the contrast gradient information stored in the third storage unit and the selected curve data based on the overflow pixel number detected in the eighth step. A corrected gradation correction curve data obtained by synthesizing in the ninth step.
Is stored again in the storage unit.

【0024】この発明では、輝度ヒストグラムだけの要
素から階調補正曲線を自動決定した後、それをカラー画
像に反映させた場合の色差信号がオーバーフローする率
をチェックして階調補正曲線の選択を修正する。
According to the present invention, after the gradation correction curve is automatically determined from only the element of the luminance histogram, the rate at which the color difference signal overflows when the gradation correction curve is reflected on the color image is checked to select the gradation correction curve. Fix it.

【0025】また、本発明は、階調補正しようとするカ
ラー画像データは、映像機器から出力された画像データ
であり、画像メモリはプリンタ内に設けられており、第
1乃至第9のステップはプリンタ内の中央処理装置又は
プリンタの外部にあるパーソナルコンピュータによるソ
フトウェア処理により実行され、画像メモリに格納され
ている自動階調補正された画像データをプリンタにより
印刷することを特徴とする。
Further, according to the present invention, the color image data to be subjected to gradation correction is image data output from a video device, the image memory is provided in the printer, and the first to ninth steps are performed. It is executed by software processing by a central processing unit in a printer or a personal computer outside the printer, and prints, by the printer, image data that has been subjected to automatic gradation correction and stored in an image memory.

【0026】[0026]

【発明の実施の形態】次に、本発明の実施の形態につい
て、図面と共に説明する。図1は本発明になる自動階調
補正方法の一実施の形態を実現する補正装置のブロック
図を示す。本発明方法は、図11に示したような印字シ
ステムにおいて、ビデオプリンタ16内部のCPU17
によって画像メモリ18にキャプチャされた画像を解析
して自動的に階調を補正する、あるいはパソコン14の
CPU15にてパソコン14にキャプチャされた画像を
解析して自動的に階調を補正するものであり、補正され
た画像をビデオプリンタ16で印刷させる。
Next, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram of a correction device for realizing an embodiment of the automatic gradation correction method according to the present invention. In the printing system as shown in FIG.
The CPU 15 of the personal computer 14 analyzes the image captured by the personal computer 14 and automatically corrects the gray scale by analyzing the image captured by the image memory 18. Yes, the corrected image is printed by the video printer 16.

【0027】図1の実施の形態において、画像メモリ2
1は、図11のビデオプリンタ16内の画像メモリ18
に相当するメモリで、図1の他のブロック22〜37は
ビデオプリンタ16内のCPU17のソフトウェアによ
り実現される機能ブロックを示す。図1において、ディ
ジタルカメラ、ビデオカメラ、パソコンあるいはビデオ
デッキなどの外部映像機器から入力されたカラー画像デ
ータが画像メモリ21に格納されている。処理速度を考
慮して画像サンプリング処理部22は、画像メモリ21
からg画素(g>0)おきの画像データをサンプリング
して画像サンプリングデータ格納部23に格納する。g
は、全体の画素数に応じて2や4といった値を決めれば
よい。
In the embodiment shown in FIG.
1 is an image memory 18 in the video printer 16 of FIG.
The other blocks 22 to 37 in FIG. 1 show functional blocks realized by software of the CPU 17 in the video printer 16. In FIG. 1, color image data input from an external video device such as a digital camera, a video camera, a personal computer, or a video deck is stored in an image memory 21. In consideration of the processing speed, the image sampling processing unit 22
, And image data of every g pixels (g> 0) is sampled and stored in the image sampling data storage unit 23. g
May be determined as a value such as 2 or 4 according to the total number of pixels.

【0028】輝度ヒストグラム作成部24は、画像サン
プリングデータ格納部23に格納されている画像データ
から輝度ヒストグラムを作成して、輝度ヒストグラム格
納部25に格納する。輝度ヒストグラム特徴量算出部2
6は、輝度ヒストグラム格納部25に格納されている輝
度ヒストグラムから輝度ヒストグラム特徴量を算出し
て、輝度ヒストグラム特徴量格納部27に格納する。格
納される上記の輝度ヒストグラム特徴量は3種類ある。
The luminance histogram creating section 24 creates a luminance histogram from the image data stored in the image sampling data storage section 23 and stores it in the luminance histogram storage section 25. Brightness histogram feature value calculation unit 2
6 calculates a brightness histogram feature from the brightness histogram stored in the brightness histogram storage 25 and stores the calculated feature in the brightness histogram feature storage 27. There are three types of the above-described luminance histogram feature amounts to be stored.

【0029】第1は輝度ヒストグラム格納部25のデー
タを入力輝度レベル軸にてn等分(ただし、n>3)し
て得た、全画素に対するそれぞれの領域の画素数の割合
を示す特徴量Sep[0]〜Sep[n−1]である。
第2は輝度ヒストグラム格納部25のデータを入力輝度
レベル軸にてn等分(ただし、n>3)して得た、一定
のリミット値を越える画素数分について全画素に対する
割合を示す特徴量LimitSep[0]〜LimitSep[n−1]
である。第3は輝度ヒストグラム格納部25のデータを
入力輝度レベル軸にて3等分して得た、全画素に対する
それぞれの領域の画素数の割合を示す特徴量L、M、H
である。
First, a feature quantity indicating the ratio of the number of pixels in each area to all pixels obtained by dividing data in the luminance histogram storage unit 25 into n equal parts (where n> 3) on the input luminance level axis. Sep [0] to Sep [n-1].
The second is a feature amount indicating the ratio of all pixels over the number of pixels exceeding a certain limit value obtained by dividing data in the luminance histogram storage unit 25 into n equal parts (where n> 3) on the input luminance level axis. LimitSep [0]-LimitSep [n-1]
It is. Third, feature amounts L, M, and H indicating the ratio of the number of pixels in each region to all pixels obtained by dividing the data of the brightness histogram storage unit 25 into three on the input brightness level axis.
It is.

【0030】露光オーバー、アンダー検出部28は、輝
度ヒストグラム特徴量格納部27に格納されている輝度
ヒストグラム特徴量を読み出し、それらの輝度ヒストグ
ラム特徴量から露光オーバー、アンダーを検出する。続
いて、コントラスト傾き決定部29は、輝度ヒストグラ
ム特徴量格納部27に格納されている輝度ヒストグラム
特徴量と、露光オーバー、アンダー検出部28による検
出結果とに基づいて、コントラストの傾き情報を決定す
る。
The overexposure / underexposure detection section 28 reads out the luminance histogram characteristic amounts stored in the luminance histogram characteristic amount storage section 27, and detects overexposure and underexposure from the luminance histogram characteristic amounts. Subsequently, the contrast inclination determining unit 29 determines contrast inclination information based on the luminance histogram characteristic amount stored in the luminance histogram characteristic amount storage unit 27 and the detection result by the over-exposure / under-detection unit 28. .

【0031】次に、コントラストデータ作成部30は、
コントラスト傾き決定部29で決定したコントラストの
傾きの情報をもとにコントラストデータを作成する。ま
た、オーバー、アンダー強度判断部31は、輝度ヒスト
グラム特徴量格納部27に格納されている輝度ヒストグ
ラム特徴量と、露光オーバー、アンダー検出部28の検
出結果と、コントラスト傾き決定部29により決定され
たコントラストの傾き情報とに基づいて、露光のオーバ
ー強度、アンダー強度(Level)を判断し、その強
度(Level)に応じて各種曲線データ格納部32に
格納されている各種曲線データの中から曲線データを1
つ選択する。
Next, the contrast data creating section 30
Contrast data is created based on the information on the contrast inclination determined by the contrast inclination determining unit 29. The over / under intensity determination unit 31 is determined by the luminance histogram feature stored in the luminance histogram feature storage 27, the detection result of the overexposure / under detection unit 28, and the contrast inclination determination unit 29. The over-intensity and under-intensity (Level) of the exposure are determined based on the contrast inclination information, and the curve data is selected from the various curve data stored in the various curve data storage unit 32 according to the intensity (Level). 1
Choose one.

【0032】コントラスト直線と曲線データ合成処理部
33は、コントラストデータ作成部30にて作成したコ
ントラスト直線データと、オーバー、アンダー強度判断
部31にて選択した曲線データを合成して階調補正曲線
データを生成し、それを階調補正曲線データ格納部34
に格納する。変数iが0から255まで変化するとし
て、コントラスト直線データをcont[i]、曲線デ
ータをcurve[i]とすると、合成結果autog
am[i]は、autogam[i]=curve[c
ont[i]]となる。
The contrast straight line / curve data synthesizing section 33 synthesizes the contrast straight line data created by the contrast data creating section 30 and the curve data selected by the over / under intensity judging section 31 to produce gradation correction curve data. And stores it in the gradation correction curve data storage unit 34
To be stored. Assuming that the variable i changes from 0 to 255, if the contrast straight line data is cont [i] and the curve data is curve [i], the synthesis result autog
am [i] is autogam [i] = curve [c
ont [i]].

【0033】色差信号オーバーフロー検出部35は、画
像サンプリングデータ格納部23に格納されているサン
プリングデータと、階調補正曲線データ格納部34に格
納されている階調補正曲線データとを用いて、色差信号
がオーバーフローする画素数(Count)を検出し
て、その検出結果を階調補正曲線修正部36に入力す
る。
The color difference signal overflow detection unit 35 uses the sampling data stored in the image sampling data storage unit 23 and the gradation correction curve data stored in the gradation correction curve data storage unit 34 to calculate the color difference. The number of pixels (Count) at which the signal overflows is detected, and the detection result is input to the gradation correction curve correction unit 36.

【0034】階調補正曲線修正部36は、色差信号オー
バーフロー検出部35から入力されたオーバーフロー画
素数と、各種曲線データ格納部32からの各種曲線デー
タと、階調補正曲線データ格納部34からの前記直線レ
ベルと曲線レベルとを受け、オーバーフロー画素数に応
じて露光オーバーの強度(Level)をどれだけ下げ
るか判断し、その判断結果に基づいて階調補正曲線デー
タ格納部34のデータを修正するように、コントラスト
データ作成部30に入力される傾きの情報を修正し、そ
れで修正できないときは更に補正曲線データを変更して
コントラスト直線と曲線データ合成処理部33に入力す
る。
The gradation correction curve correction unit 36 includes the number of overflow pixels input from the color difference signal overflow detection unit 35, various curve data from the various curve data storage unit 32, and the data from the gradation correction curve data storage unit 34. In response to the linear level and the curve level, it is determined how much the intensity of overexposure (Level) should be reduced according to the number of overflow pixels, and the data in the gradation correction curve data storage unit 34 is corrected based on the determination result. As described above, the inclination information input to the contrast data creation unit 30 is corrected, and if correction is not possible, the correction curve data is further changed and input to the contrast straight line and curve data synthesis processing unit 33.

【0035】画像処理部37は、階調補正曲線修正部3
6により補正された階調補正曲線データ格納部34内の
階調補正曲線データに基づいて、画像メモリ21からの
画像データを補正し、その補正後の画像データを画像メ
モリ21に再び格納する。この画像メモリ21に格納さ
れている自動階調補正された画像データは、読み出され
てプリンタにより印刷される。
The image processing section 37 includes a gradation correction curve correcting section 3
6, the image data from the image memory 21 is corrected based on the gradation correction curve data in the gradation correction curve data storage unit 34, and the corrected image data is stored in the image memory 21 again. The image data subjected to the automatic gradation correction stored in the image memory 21 is read out and printed by the printer.

【0036】次に、図1の実施の形態の要部の動作につ
いて、図2乃至図10を併せ参照して更に詳細に説明す
る。図2は図1のヒストグラム特徴量格納部27と各種
曲線データ格納部32の各格納データを入力として受
け、これらに基づいて階調補正曲線データを生成して階
調補正曲線データ格納部34に格納するまでを説明する
フローチャートであり、図3乃至図8は図2の各部の詳
細説明用フローチャートであり、図9は図1の階調補正
曲線データ格納部34の階調補正曲線データと、画像サ
ンプリングデータ格納部23からのデータを入力として
受け、色差信号オーバーフロー検出部35、階調補正曲
線修正部36を通って、修正後データを階調補正曲線デ
ータ格納部34に出力するまでのフローチャートであ
る。また、図10は階調補正曲線選択の概念図を示す。
Next, the operation of the main part of the embodiment of FIG. 1 will be described in more detail with reference to FIGS. FIG. 2 receives the respective stored data of the histogram feature amount storage unit 27 and the various curve data storage units 32 of FIG. 1 as input, generates gradation correction curve data based on these, and stores the data in the gradation correction curve data storage unit 34. 3 to 8 are flowcharts for detailed explanation of each unit in FIG. 2, and FIG. 9 is a flowchart showing the gradation correction curve data stored in the gradation correction curve data storage unit 34 in FIG. Flow chart from receiving data from the image sampling data storage unit 23 as input, passing through the color difference signal overflow detection unit 35 and the gradation correction curve correction unit 36, and outputting corrected data to the gradation correction curve data storage unit 34 It is. FIG. 10 is a conceptual diagram of selecting a gradation correction curve.

【0037】図1の輝度ヒストグラム特徴量算出部26
で輝度ヒストグラム特徴量を算出する際、入力輝度レベ
ル軸を8等分(n=8)した場合、輝度ヒストグラム特
徴量としてSep[0]〜[7],LimitSep
[0]〜[7]が準備される。Sep[]には、全画素
数に対するそれぞれの領域の画素数の割合が入ってい
る。また、LimitSep[]には一定のリミツタ値
を超える画素数分について全画素数に対する割合が入っ
ている。これにより、図10(A)に示すような輝度信
号の場合、同図(B)に示すような輝度ヒストグラムで
概略表すことができる。また、輝度ヒストグラム特徴量
L、M、Hは、この実施の形態では、L=Sep[0]
+Sep[1]+Sep[2],M=Sep〔3〕+S
ep[4],H=Sep[5]+Sep[6]+Sep
[7]であるものとする。
The luminance histogram feature quantity calculator 26 shown in FIG.
When calculating the luminance histogram feature amount by using, when the input luminance level axis is divided into eight equal parts (n = 8), Sep [0] to [7], LimitSep are used as the luminance histogram feature amount.
[0] to [7] are prepared. Sep [] contains the ratio of the number of pixels in each area to the total number of pixels. In addition, LimitSep [] contains the ratio of the number of pixels exceeding a certain limiter value to the total number of pixels. Thus, in the case of a luminance signal as shown in FIG. 10A, it can be roughly represented by a luminance histogram as shown in FIG. In this embodiment, the luminance histogram feature amounts L, M, and H are L = Sep [0].
+ Sep [1] + Sep [2], M = Sep [3] + S
ep [4], H = Sep [5] + Sep [6] + Sep
[7].

【0038】また、図1の各種曲線データ格納部32に
格納されている各種曲線データとして、*Up[1]〜
[5],*Down[1]〜[5]が準備される。*U
p[],*Down[]は図10(C)、(D)に示す
ようなY−Y’のルックアップテーブル(LUT)であ
る。*Up〔1]はリニアに近いLUTで、そこには0
から255の入力Yの値に対する出力Y’の値が格納さ
れていると考える。*Up[]の[]内の数字が増える
ほど、LUTの補正強度は大きくなる。同様に、*Do
wn[1]が最もリニアに近いLUTで、*Dow
n[]の[]内の数字が増えるほど、LUTの補正強度
は大きくなる。
The various curve data stored in the various curve data storage section 32 of FIG. 1 include * Up [1] to
[5], * Down [1] to [5] are prepared. * U
p [] and * Down [] are YY 'look-up tables (LUTs) as shown in FIGS. 10 (C) and 10 (D). * Up [1] is a linear LUT, where 0
It is assumed that the value of the output Y ′ corresponding to the value of the input Y from 255 to 255 is stored. * The correction strength of the LUT increases as the number in [] of Up [] increases. Similarly, * Do
wn [1] is the LUT closest to linear, * Dow
As the number in [] of n [] increases, the correction strength of the LUT increases.

【0039】さて、図1のオーバー、アンダー強度判断
部31は、輝度ヒストグラム特徴量格納部27から輝度
ヒストグラム特徴量を取り込み(図2のステップ10
1)、また各種曲線データ格納部32から各種曲線デー
タ*Up[1]〜[5],*Down[1]〜[5]を
取り込み(図2のステップ102)、まず輝度ヒストグ
ラム特徴量Lが予め設定した下限値(underLimit)より
大であるかどうか判定する(図2のステップ103)。
The over / under intensity judging section 31 in FIG. 1 fetches the luminance histogram feature from the luminance histogram feature storage 27 (step 10 in FIG. 2).
1) Also, various curve data * Up [1] to [5] and * Down [1] to [5] are fetched from the various curve data storage unit 32 (step 102 in FIG. 2). It is determined whether the value is larger than a preset lower limit (underLimit) (step 103 in FIG. 2).

【0040】輝度ヒストグラム特徴量Lは入力輝度レベ
ル軸を3等分したときの最も低輝度側の領域の特徴量で
あるので、L>(下限値)であれば、露光アンダーと判
断してアンダー処理を行い(図2のステップ104)、
L≦(下限値)であれば、輝度ヒストグラム特徴量Hが
予め設定した上限値(overLimit)より大であるかどう
か判定する(図2のステップ105)。輝度ヒストグラ
ム特徴量Hは入力輝度レベル軸を3等分したときの最も
高輝度側の領域の特徴量であるので、H>(上限値)で
あれば、露光オーバーと判断してオーバー処理を行い
(図2のステップ106)、H≦(上限値)であれば、
リニア(またはそれ以外)と判断してリニア処理を行う
(図2のステップ107)。
Since the luminance histogram feature L is a feature of the region on the lowest luminance side when the input luminance level axis is divided into three equal parts, if L> (lower limit), it is determined that exposure is under and under exposure is performed. The processing is performed (step 104 in FIG. 2),
If L ≦ (lower limit), it is determined whether or not the luminance histogram feature value H is larger than a preset upper limit (overLimit) (step 105 in FIG. 2). The luminance histogram feature H is a feature of the region on the highest luminance side when the input luminance level axis is divided into three equal parts. Therefore, if H> (upper limit), it is determined that overexposure has occurred and overprocessing is performed. (Step 106 in FIG. 2), if H ≦ (upper limit value),
It is determined that the processing is linear (or other), and linear processing is performed (step 107 in FIG. 2).

【0041】上記の上限値、下限値は、多くの画像にて
実験を行って値が決められている。例えば上限値=6
0、下限値=60とした場合、Lに60%より多くの画
素が偏っていた場合にはアンダー、Hに60%より多く
の画素が偏っていた場合にはオーバーと判断される。上
記のアンダー処理、オーバー処理又はリニア処理が終る
と、階調補正曲線データが得られ、階調補正曲線データ
格納部34に格納される(図2のステップ108)。
The upper and lower limits are determined by conducting experiments on many images. For example, upper limit = 6
When 0 and the lower limit = 60, it is determined that L is under if the pixels are more than 60% biased, and it is judged that the pixels are over when H is more than 60% biased. When the under processing, the over processing, or the linear processing is completed, tone correction curve data is obtained and stored in the tone correction curve data storage unit 34 (step 108 in FIG. 2).

【0042】上記のステップ104のアンダー処理は、
図3及び図4のフローチャートに従って、輝度ヒストグ
ラム特徴量をもとにコントラスト用の直線と補正曲線*
Up[]のレベルを決定し合成して階調補正曲線とす
る。基本的な方針は、ヒストグラムの平坦化である。こ
のヒストグラムの平坦化自体は公知である(長尾真、
「ディジタル画像処理」、近代科学社、p177-p181、197
8)。
The under processing in step 104 is as follows.
According to the flowcharts of FIGS. 3 and 4, a contrast straight line and a correction curve * based on the luminance histogram feature amount.
The level of Up [] is determined and combined to form a gradation correction curve. The basic strategy is to flatten the histogram. The flattening of the histogram itself is known (Shin Nagao,
"Digital Image Processing", Modern Science, p177-p181, 197
8).

【0043】まず、レベル(Level)の初期値を例
えば”5”に設定し(図3のステップ201)、変数s
umの初期値を”0”に設定し(図3のステップ20
2)、変数iを”7”に設定し(図3のステップ20
3)、変数sumに輝度ヒストグラム特徴量Sep
[i]を加算し(図3のステップ204)、その加算値
sumが0より大であるかどうか判定し(図3のステッ
プ205)、sum≦0であれば、iの値を6にして同
様の加算、判定処理を行う。そしてsum>0となるま
で、iの値を1ずつ減じながら上記の加算、判定処理を
繰り返す。
First, the initial value of the level (Level) is set to, for example, "5" (step 201 in FIG. 3), and the variable s
um is set to "0" (step 20 in FIG. 3).
2) The variable i is set to "7" (step 20 in FIG. 3).
3) The luminance histogram feature amount Sep is set in the variable sum.
[I] is added (step 204 in FIG. 3), and it is determined whether or not the added value sum is greater than 0 (step 205 in FIG. 3). If sum ≦ 0, the value of i is set to 6 Similar addition and determination processing is performed. The above addition and determination processing is repeated while the value of i is reduced by 1 until sum> 0.

【0044】sum>0となると、変数secthig
hの値を7−iとし、かつ、変数sectlowの値を
0とする(図3のステップ206)。すなわち、まず、
輝度の低い方に画素が偏っていることを考慮して、輝度
の最も高い輝度ヒストグラム特徴量Sep[7〕から画
素が0%の領域を探す。画素のない領域には階調を割り
当てないようにするために0%領域はYcon−Yco
n’のグラフにてYcon’を255に張り付ける。変
数secthighは255に張り付ける領域を示し、
変数sectlowは0に張り付ける領域を示す。
When sum> 0, the variable secthig
The value of h is set to 7-i, and the value of the variable sectlow is set to 0 (step 206 in FIG. 3). That is, first,
In consideration of the fact that the pixels are biased toward the lower luminance, an area where the pixels are 0% is searched from the luminance histogram feature amount Sep [7] having the highest luminance. The 0% area is set to Ycon-Yco in order not to assign a gradation to an area without pixels.
In the graph of n ', Ycon' is attached to 255. The variable second indicates the area to be attached to 255,
The variable “sectlow” indicates an area pasted to “0”.

【0045】もし、上から1区画だけ0%だったらsu
mはi=6の時に0より大きくなるので、変数sect
highは1(=7−6)区画となる。なお、ステップ
206でsectlow=0としているのはアンダーの
画像では下から数えて0%である確率は低く処理を単純
化するためである。ここまででコントラスト直線の傾き
が決まる。なお、ステップ205でsumと比較する値
は0以外でもよい。この値は経験により可変設定でき
る。コントラスト補正強度を強くしたい場合は、これを
大きく設定する。
If only 1% from the top is 0%, su
Since m becomes larger than 0 when i = 6, the variable sect
The high is 1 (= 7−6) section. It is to be noted that the reason why seclow = 0 is set in step 206 is that the probability of 0% counted from below in an under image is low and the process is simplified. The inclination of the contrast straight line is determined up to this point. The value to be compared with sum in step 205 may be other than 0. This value can be variably set by experience. If it is desired to increase the contrast correction strength, set this to a large value.

【0046】変数secthighは、コントラスト傾
き決定部29の結果情報であり、この値が大きければ入
力階調に対して出力階調を増加させる直線となり、アン
ダーの画像は改善される。次に、アンダーの強度を示す
変数Levelを、Level=Level−sect
highなる演算式に基づき、補正曲線のレベルからコ
ントラスト分を差し引いておく(図3のステップ20
7)。
The variable sechigh is the result information of the contrast gradient determining section 29. If this value is large, it becomes a straight line that increases the output gradation with respect to the input gradation, and the under image is improved. Next, a variable Level indicating the strength of the under is represented by Level = Level-sect.
The contrast is subtracted from the level of the correction curve based on the arithmetic expression “high” (step 20 in FIG. 3).
7).

【0047】次に補正強度を決定するため、累積輝度分
布を用いた方法を応用する。アンダー処理においては、
輝度の低い方に画素が偏っていると判断されているの
で、その領域のヒストグラム形状を判断の材料とする。
すなわち、まず、Sep〔0]>Sep[1]>Sep
[2]の条件を満足するか判定し(図3のステップ20
8)、この条件を満たさないときは弱のレベルと判断し
て、強度を示す変数LevelをLevel−2とする
(図3のステップ209)。Sep[0]>Sep
[1〕>Sep[2]であれば、次にSep[0]がS
ep[1]*1.5より大であるかどうか比較し(図3
のステップ210)、Sep[1]*1.5以下なら中
のレベルとして強度を示す変数LevelをLevel
−1とする(図3のステップ211)。
Next, a method using a cumulative luminance distribution is applied to determine the correction intensity. In under processing,
Since it is determined that the pixels are biased toward the lower luminance, the histogram shape of that region is used as a material for the determination.
That is, first, Sep [0]> Sep [1]> Sep
It is determined whether the condition [2] is satisfied (step 20 in FIG. 3).
8) If this condition is not satisfied, the level is determined to be a weak level, and the variable Level indicating the strength is set to Level-2 (step 209 in FIG. 3). Sep [0]> Sep
If [1]> Sep [2], then Sep [0] is S
Compare whether the value is greater than ep [1] * 1.5 (FIG. 3)
Step 210), if Sep [1] * 1.5 or less, set the variable Level indicating the intensity as a medium level to Level
-1 (step 211 in FIG. 3).

【0048】また、Sep[0]>Sep[1]>Se
p[2]で、かつ、Sep[0〕>Sep[1]*1.
5の場合、傾き最大と判断してアンダーの強度を示す変
数Levelはそのままとする。”1.5”という値は
経験により1以上の値に変更可能である。大きくした場
合には、弱い補正となり、中レベルと判断される割合が
多くなる。
Also, Sep [0]> Sep [1]> Se
p [2] and Sep [0]> Sep [1] * 1.
In the case of 5, it is determined that the inclination is the maximum, and the variable Level indicating the intensity of the under is left as it is. The value "1.5" can be changed to one or more values by experience. When the value is increased, the correction is weak, and the ratio of being judged as the medium level is increased.

【0049】続いて、さらに輝度の低い方に着目してリ
ミッタ値を超える画素の率が0%より大きい(すなわ
ち、LimitSep[0]>0)かどうか判定し(図
4のステップ212)、大きい場合ははそのままのレベ
ルに、そうでない場合にはLevelの値を1だけ小さ
くする(図4のステップ213)。
Next, paying attention to the lower luminance, it is determined whether or not the ratio of pixels exceeding the limiter value is larger than 0% (that is, LimitSep [0]> 0) (step 212 in FIG. 4). In this case, the level is kept as it is, otherwise, the value of Level is reduced by 1 (step 213 in FIG. 4).

【0050】以上のようにして、Level=5から減
算した結果、Levelが0以下になる場合がある。そ
もそもアンダーと判断された画像なので最終補正として
最低でもLevel=1となるように補正する。そこ
で、Levelが0より大であるかどうか判定し(図4
のステップ214)、0以下であればLevelの値を
1に補正する(図4のステップ215)。
As described above, as a result of subtraction from Level = 5, Level may become 0 or less. Since the image was originally determined to be under, it is corrected so that Level = 1 at least as the final correction. Therefore, it is determined whether Level is larger than 0 (see FIG. 4).
Step 214), if it is 0 or less, the value of Level is corrected to 1 (step 215 in FIG. 4).

【0051】続いて、コントラスト決定部29で決定し
た傾きの情報secthighとsectLowからコ
ントラストの傾きが決定するので、入力Ycon、出力
Ycon’のコントラストデータを求めて*Contに
Yconのj=0からj=255に対するYcon’の
値を格納する(図4のステップ216)。式は以下のよ
うな直線式である。nはヒストグラム分割数で、ここで
は”8”である。
Subsequently, since the contrast inclination is determined from the inclination information sechigh and sectLow determined by the contrast determination section 29, the contrast data of the input Ycon and the output Ycon 'is obtained, and * Cont is determined from j = 0 to j of Ycon. = 255 is stored (step 216 in FIG. 4). The equation is a linear equation as follows. n is the number of divided histograms, which is “8” here.

【0052】 x1=(256/n)*sectlow (ただしx1>255の時x1= 255とする) x2=256−(256/n)*secthigh (ただしx2>255 の時x2=255とする) Ycon’[j]=255*(j−x1)/(x2−x1) 続いて、Levelが決定しているので、各種曲線デー
タ格納部32に格納されている曲線データ*Up[1]
〜〔5]の中のLevelのもの*Up[Level]
を補正曲線データとして選択し、ステップ216で求め
て*Contに格納されているコントラスト直線データ
とを合成して階調補正曲線とする(図4のステップ21
7)。以上によりアンダー処理が終了する。
X1 = (256 / n) * sectlow (when x1> 255, x1 = 255) x2 = 256- (256 / n) * secthigh (when x2> 255, x2 = 255) Ycon '[J] = 255 * (j−x1) / (x2−x1) Subsequently, since the Level has been determined, the curve data * Up [1] stored in the various curve data storage units 32
~ [5] of Level * Up [Level]
Is selected as correction curve data, and is combined with the contrast straight line data obtained in step 216 and stored in * Cont to obtain a gradation correction curve (step 21 in FIG. 4).
7). Thus, the under process is completed.

【0053】次に、前記ステップ106のオーバー処理
について、図5及び図6のフローチャートと共に更に詳
細に説明する。オーバー処理の場合、輝度ヒストグラム
特徴量をもとにコントラスト用の直線と補正曲線*Do
wn[]のレベルを決定し合成して階調補正曲線とする
のが大きな流れである。
Next, the over process in step 106 will be described in more detail with reference to the flowcharts in FIGS. In the case of the over process, a contrast straight line and a correction curve * Do based on the luminance histogram feature amount
It is a large flow to determine and combine the levels of wn [] to form a gradation correction curve.

【0054】まず、レベル(Level)の初期値を例
えば”5”に設定し(図5のステップ301)、変数s
umの初期値を”0”に設定し(図5のステップ30
2)、変数iを”0”に設定し(図5のステップ30
3)、変数sumに輝度ヒストグラム特徴量Sep
[i]を加算し(図5のステップ304)、その加算値
sumが0より大であるかどうか判定し(図5のステッ
プ305)、sum≦0であれば、iの値を2にして同
様の加算、判定処理を行う。そしてsum>0となるま
で、iの値を1ずつ増しながら上記の加算、判定処理を
繰り返す。
First, the initial value of the level (Level) is set to, for example, “5” (step 301 in FIG. 5), and the variable s
The initial value of um is set to “0” (step 30 in FIG. 5).
2) The variable i is set to "0" (step 30 in FIG. 5).
3) The luminance histogram feature amount Sep is set in the variable sum.
[I] is added (step 304 in FIG. 5), and it is determined whether or not the added value sum is greater than 0 (step 305 in FIG. 5). If sum ≦ 0, the value of i is set to 2 Similar addition and determination processing is performed. The above addition and determination processing is repeated while incrementing the value of i by 1 until sum> 0.

【0055】sum>0となると、変数sectlow
の値をiとし、かつ、変数secthighの値を0と
する(図5のステップ306)。すなわち、まず、輝度
の高い方に画素が偏っていることを考慮して輝度の最も
低いSep[0]から画素が0%の領域を探す。画素の
ない領域には階調を割り当てないようにするために0%
領域はYcon−Ycon’のグラフにてYcon’を
0に張り付ける。
If sum> 0, the variable setlow
Is set to i, and the value of the variable second is set to 0 (step 306 in FIG. 5). That is, first, in consideration of the fact that the pixels are biased toward the higher luminance, an area where the pixels are 0% is searched from Sep [0] having the lowest luminance. 0% to avoid assigning gradations to areas without pixels
In the area, Ycon 'is pasted to 0 in the Ycon-Ycon' graph.

【0056】なお、ステップ306でsecthigh
=0としているのはオーバーの画像では上から数えて0
%である確率は低く処理を単純化するためである。ここ
まででコントラスト直線の傾きが決まる。また、ステッ
プ305でsumと比較する値は0以外でもよい。この
値は経験により可変設定できる。コントラスト補正強度
を強くしたい場合は、これを大きく設定する。変数se
ctlowは、コントラスト傾き決定部29の結果情報
であり、この値が大きければ入力階調に対して出力階調
を減少させる直線となり、オーバーの画像は改善され
る。
It should be noted that, in step 306, the second
= 0 is counted from the top in the over image and is 0
The probability of% is low to simplify the processing. The inclination of the contrast straight line is determined up to this point. The value to be compared with sum in step 305 may be other than 0. This value can be variably set by experience. If it is desired to increase the contrast correction strength, set this to a large value. Variable se
ctlow is the result information of the contrast gradient determination unit 29. If this value is large, it becomes a straight line that decreases the output gradation with respect to the input gradation, and the oversized image is improved.

【0057】次に、オーバーの強度を示す変数Leve
lを、Level=Level−sectlowなる演
算式に基づき、補正曲線のレベルからコントラスト分を
差し引いておく(図5のステップ307)。次に補正強
度を決定するため、累積輝度分布を用いた方法を応用す
る。オーバー処理においては、輝度の高い方に画素が偏
っていると判断されているので、その領域のヒストグラ
ム形状を判断の材料とする。すなわち、まず、Sep
〔7]>Sep[6]>Sep[5]の条件を満足する
か判定し(図5のステップ308)、この条件を満たさ
ないときは弱のレベルと判断して、強度を示す変数Le
velをLevel−2とする(図5のステップ30
9)。
Next, a variable Level indicating the overstrength is set.
1 is subtracted from the level of the correction curve by the amount of contrast based on an arithmetic expression of Level = Level-sectlow (step 307 in FIG. 5). Next, a method using a cumulative luminance distribution is applied to determine the correction intensity. In the over process, since it is determined that the pixels are biased toward the higher luminance, the histogram shape of the region is used as a material for the determination. That is, first, Sep
It is determined whether the condition [7]> Sep [6]> Sep [5] is satisfied (step 308 in FIG. 5). If the condition is not satisfied, it is determined that the level is weak, and the variable Le indicating the strength is determined.
The level is set to Level-2 (step 30 in FIG. 5).
9).

【0058】Sep[7]>Sep[6〕>Sep
[5]であれば、次にSep[7]がSep[6]*
1.5より大であるかどうか比較し(図5のステップ3
10)、Sep[6]*1.5以下なら中のレベルとし
て強度を示す変数LevelをLevel−1とする
(図5のステップ311)。また、Sep[7]>Se
p[6]>Sep[5]で、かつ、Sep[7〕>Se
p[6]*1.5の場合、傾き最大と判断してオーバー
の強度を示す変数Levelはそのままとする。”1.
5”という値は経験により1以上の値に変更可能であ
る。大きくした場合には、弱い補正となり、中レベルと
判断される割合が多くなる。
Sep [7]> Sep [6]> Sep
If [5], then Sep [7] is Sep [6] *
Compare whether it is greater than 1.5 (step 3 in FIG. 5).
10), if it is equal to or less than Sep [6] * 1.5, a variable Level indicating the intensity is set to Level-1 as a medium level (step 311 in FIG. 5). Also, Sep [7]> Se
p [6]> Sep [5], and Sep [7]> Se
In the case of p [6] * 1.5, it is determined that the inclination is the maximum, and the variable Level indicating the intensity of over is kept as it is. "1.
The value of 5 "can be changed to a value of 1 or more by experience. If the value is increased, the correction becomes weak, and the ratio of being judged as the medium level increases.

【0059】続いて、さらに輝度の高い方に着目してリ
ミッタ値を超える画素の率が0%より大きい(すなわ
ち、LimitSep[7]>0)かどうか判定し(図
6のステップ312)、大きい場合ははそのままのレベ
ルに、そうでない場合にはLevelの値を1だけ小さ
くする(図6のステップ313)。続いて、Level
が0より大であるかどうか判定し(図6のステップ31
4)、0以下であればLevelの値を1に補正する
(図6のステップ315)。
Next, paying attention to the higher luminance, it is determined whether or not the ratio of pixels exceeding the limiter value is larger than 0% (that is, LimitSep [7]> 0) (step 312 in FIG. 6). In this case, the level is kept as it is, otherwise, the value of Level is reduced by 1 (step 313 in FIG. 6). Next, Level
Is greater than 0 (step 31 in FIG. 6).
4) If the value is 0 or less, the value of Level is corrected to 1 (step 315 in FIG. 6).

【0060】続いて、コントラスト決定部29で決定し
た傾きの情報secthighとsectLowからコ
ントラストの傾きが決定するので、入力Ycon、出力
Ycon’のコントラストデータを求めて*Contに
Yconのj=0からj=255に対するYcon’の
値を格納する(図6のステップ316)。式は前記アン
ダー処理の場合と同じ直線式である。
Subsequently, since the contrast gradient is determined from the gradient information sechigh and sectLow determined by the contrast determining section 29, the contrast data of the input Ycon and the output Ycon 'is obtained, and * Cont is determined from j = 0 to j of Ycon. = 255 is stored (step 316 in FIG. 6). The equation is the same linear equation as in the case of the under processing.

【0061】続いて、Levelが決定しているので、
各種曲線データ格納部32に格納されている曲線データ
*Down[1]〜〔5]の中の*Down[Leve
l]を補正曲線データとして選択し、ステップ316で
求めて*Contに格納されているコントラスト直線デ
ータとを合成して階調補正曲線とする(図6のステップ
317)。以上によりオーバー処理が終了する。
Subsequently, since Level has been determined,
* Down [Left] among the curve data * Down [1] to [5] stored in the various curve data storage units 32
1] is selected as the correction curve data, and is combined with the contrast straight line data obtained in step 316 and stored in * Cont to obtain a gradation correction curve (step 317 in FIG. 6). Thus, the over process is completed.

【0062】次に、前記ステップ107のリニア処理に
ついて、図7及び図8のフローチャートと共に更に詳細
に説明する。リニア処理では、輝度ヒストグラム特徴量
をもとにコントラスト用の直線と補正曲線*Up[]ま
たは*Down[]のレベルを決定し合成して階調補正
曲線とするのが大きな流れである。
Next, the linear processing in step 107 will be described in more detail with reference to the flowcharts of FIGS. In the linear processing, it is a large flow to determine a level of a straight line for contrast and a correction curve * Up [] or * Down [] based on a luminance histogram feature amount and combine them to obtain a gradation correction curve.

【0063】まず、コントラストを決めるために上下0
%の領域を探す。すなわち、輝度ヒストグラム特徴量格
納部27のデータSep[7]からSep[0]の方向
へ加算して、7から何区間までが0以下かを調べて変数
secthighに格納する(図7のステップ401〜
405)。続いて、輝度ヒストグラム特徴量格納部27
のデータSep[0]からSep[7]の方向へ加算し
て、0から何区間までが0以下かを調べて変数sect
lowに格納する(図7のステップ406〜410)。
ただし、0以下は、経験により値を調節できる。コント
ラスト補正強度をを強くしたい場合は、これを大きく設
定する。
First, in order to determine the contrast, the upper and lower
Find the% area. That is, the data is added in the direction from Sep [7] to Sep [0] of the luminance histogram feature amount storage unit 27 to check which section from 7 to 0 or less and stores it in the variable sechigh (step 401 in FIG. 7). ~
405). Subsequently, the luminance histogram feature storage unit 27
Is added in the direction from Sep [0] to Sep [7], and it is checked how many sections from 0 to 0 or less.
It is stored in low (steps 406 to 410 in FIG. 7).
However, a value of 0 or less can be adjusted by experience. If it is desired to increase the contrast correction strength, set it higher.

【0064】次に、補正強度を決定するために輝度ヒス
トグラム特徴量格納部27のデータLimitSe
p[]の値を見る。LimitSep[0]>0、か
つ、LimitSep〔7]>0かどうか判定し(図8
のステップ411)、この条件を満足する場合は、逆光
と判断する。逆光と判断された場合には、処理を単純化
するために明るい部分がつぶれるのは無視してアンダー
と判断する。累積輝度分布で解析した場合にはこのよう
なヒストグラムの形の場合に変曲点のある曲線となる場
合が多いが、ここでは単純に*Up[]の曲線を選択す
るようにする。
Next, in order to determine the correction intensity, the data LimitSe in the luminance histogram feature storage 27 is stored.
Look at the value of p []. It is determined whether LimitSep [0]> 0 and LimitSep [7]> 0 (FIG. 8).
Step 411), if this condition is satisfied, it is determined that there is backlight. When it is determined that the subject is backlit, it is determined that the subject is under light, ignoring that a bright portion is crushed in order to simplify the processing. In the case of analyzing by the cumulative luminance distribution, a curve having an inflection point is often obtained in the case of such a histogram, but here, a curve of * Up [] is simply selected.

【0065】また、アンダーと判断された場合は、輝度
ヒストグラム特徴量格納部27のデータLimitSe
p〔0]だけ見て、小さい時はLevelを低く、大き
い時はLevelを高くする(図8のステップ41
2)。レベル割り当ては、多くの画像について調査して
調節すればよい。
If it is determined that the value is under, the data LimitSe in the luminance histogram feature quantity storage unit 27 is stored.
Looking only at p [0], when the value is small, the Level is low, and when the value is large, the Level is high (Step 41 in FIG. 8).
2). The level assignment may be adjusted by investigating many images.

【0066】続いて、secthigh,sectlo
wからコントラスト直線*Contの傾きを前記アンダ
ー処理と同様の式に基づいて算出し、コントラスト直線
*Contに格納し(図8のステップ413)、その後
コントラスト直線*Contと補正曲線*Up[Lev
el]を合成して階調補正曲線とする(図8のステップ
414)。
Subsequently, sechigh, sectro
From w, the gradient of the contrast line * Cont is calculated based on the same formula as the under processing, and stored in the contrast line * Cont (step 413 in FIG. 8). Thereafter, the contrast line * Cont and the correction curve * Up [Lev
el] to obtain a gradation correction curve (step 414 in FIG. 8).

【0067】一方、LimitSep[0]とLimi
tSep〔7]のうち、LimitSep[0]だけが
LimitSep[0]>0である場合は(図8のステ
ップ415、416)、アンダーと判断して、上記のス
テップ412〜414と同様の処理を行う(図8のステ
ップ417〜419)。また、LimitSep[0]
とLimitSep〔7]のうち、LimitSep
[7]だけがLimitSep[7]>0である場合は
(図8のステップ415、416)、オーバーと判断し
て輝度ヒストグラム特徴量格納部27のデータLimi
tSep〔7]だけ見て、小さい時はLevelを低く
し、大きい時はLevelを高くする(図8のステップ
420)。レベル割り当ては、多くの画像について調査
して調節すればよい。
On the other hand, LimitSep [0] and Limi
If only LimitSep [0] of tSep [7] satisfies LimitSep [0]> 0 (steps 415 and 416 in FIG. 8), it is determined to be under and the same processing as steps 412 to 414 described above is performed. (Steps 417 to 419 in FIG. 8). Also, LimitSep [0]
And LimitSep [7], LimitSep
If only [7] has LimitSep [7]> 0 (steps 415 and 416 in FIG. 8), it is determined to be over and the data Limi in the luminance histogram feature amount storage unit 27 is determined.
Looking only at tSep [7], the level is lowered when the level is small, and the level is raised when the level is large (step 420 in FIG. 8). The level assignment may be adjusted by investigating many images.

【0068】続いて、secthigh,sectlo
wからコントラスト直線*Contの傾きを前記アンダ
ー処理と同様の式に基づいて算出し、コントラスト直線
*Contに格納し(図8のステップ421)、その後
コントラスト直線*Contと補正曲線*Up[Lev
el]を合成して階調補正曲線とする(図8のステップ
422)。なお、LimitSep[0]もLimit
Sep[7]も0以下の場合には、完全にリニアと判断
してコントラスト直線*Contだけで補正曲線とする
(図8のステップ423)。
Subsequently, sechigh, sectro
From w, the gradient of the contrast line * Cont is calculated based on the same formula as the under process, and stored in the contrast line * Cont (step 421 in FIG. 8). Thereafter, the contrast line * Cont and the correction curve * Up [Lev
el] to obtain a gradation correction curve (step 422 in FIG. 8). Note that LimitSep [0] is also limited to LimitSep [0].
If Sep [7] is also equal to or less than 0, it is completely determined to be linear, and a correction curve is formed using only the contrast straight line * Cont (step 423 in FIG. 8).

【0069】以上のようにして階調補正曲線が決定した
後、画像サンプリングデータ(Y,U,V)をもとに階
調補正曲線を修正する。この階調補正曲線の修正動作に
ついて、図9のフローチャートと共に詳細に説明する。
画像は(Y,U,V)の3次元の信号からなる情報であ
り、輝度信号Yが階調補正の結果Y’/Y倍となった場
合、一般的に色差信号U、Vも同様にY’/Y倍する。
本実施の形態でもそのようにする。
After the gradation correction curve is determined as described above, the gradation correction curve is corrected based on the image sampling data (Y, U, V). The operation of correcting the gradation correction curve will be described in detail with reference to the flowchart of FIG.
An image is information composed of a three-dimensional signal of (Y, U, V). When the luminance signal Y becomes Y ′ / Y times as a result of gradation correction, the color difference signals U and V are generally the same. Multiply Y '/ Y times.
The same applies to the present embodiment.

【0070】階調補正曲線修正部36は、まず、階調補
正曲線データ格納部34から修正前の階調補正曲線
(Y,Y’)のデータを取り込んだ後(図9のステップ
501)、色差信号U、VをY’/Yした場合にいくつ
以上、以下でオーバーフローするかを予め算出しておく
(図9のステップ502)。色差信号U、Vは−128
から127の範囲で変化する。また、入力輝度信号Yに
対する制限値127*Y/Y’と−128*Y/Y’を
予め計算しておく。輝度信号Yは0から255の値であ
る。この準備をしておいて画像サンプリングデータ
(Y,U,V)をチェックする。
The gradation correction curve correction unit 36 first fetches the data of the gradation correction curve (Y, Y ′) before correction from the gradation correction curve data storage unit 34 (step 501 in FIG. 9). When the color difference signals U and V are Y '/ Y, the number of overflows is calculated in advance (step 502 in FIG. 9). The color difference signals U and V are -128
To 127. Also, limit values 127 * Y / Y 'and -128 * Y / Y' for input luminance signal Y are calculated in advance. The luminance signal Y has a value of 0 to 255. With this preparation, the image sampling data (Y, U, V) is checked.

【0071】図1の画像メモリ21のデータをそのまま
用いると処理が遅くなるのでサンプリングデータを用い
る。続いて、サンプリングデータ数は常に同じにしてお
いてU,Vのオーバーフローする画素数を、色差信号オ
ーバーフロー検出部35でカウントして変数Count
に格納する(図9のステップ503、504)。続い
て、上記の変数Countとしきい値UVLimitと
を比較し(図9のステップ505)、Count<UV
Limitならば階調補正曲線をそのまま用いる(図9
のステップ506)。そうでない場合にはCountの
値に応じてLevelを下げた後、*Up[Leve
l]と*Contを合成して改めて補正曲線とする(図
9のステップ507、508)。
If the data in the image memory 21 shown in FIG. 1 is used as it is, the processing becomes slow. Therefore, sampling data is used. Subsequently, while the number of sampling data is always the same, the number of pixels where U and V overflow is counted by the color difference signal overflow detection unit 35 and the variable Count is counted.
(Steps 503 and 504 in FIG. 9). Subsequently, the variable Count is compared with the threshold value UVLimit (step 505 in FIG. 9), and Count <UV
In the case of Limit, the gradation correction curve is used as it is (FIG. 9).
Step 506). Otherwise, after lowering the Level according to the value of Count, * Up [Level
l] and * Cont are combined to form a new correction curve (steps 507 and 508 in FIG. 9).

【0072】UVLimitは、経験により調節する。
UVLimitは0より大きな値である。大きくすれば
するほど色差信号のつぶれが大きくなる。小さければ色
差信号のつぶれは、少なくなる。Levelを下げる率
についても経験により調節する。
The UV Limit is adjusted by experience.
UVLimit is a value greater than 0. The larger the value, the greater the color difference signal collapse. The smaller the value, the less the color difference signal collapses. The rate at which the Level is lowered is also adjusted by experience.

【0073】例えばLevelを1レベル下げた時にC
ountの数が100から5に下がったり、1000が
50に下がった場合には1レベルで20分の1下がると
考えてレベルを下げる。UVLimitを6としたなら
ば始めのCountが100の時1レベル下げる。10
00の場合には2レベル下げるという処理になる。ま
た、画像サンプリングデータ格納部23の画素数が19
200画素であった場合、Count>1000のとき
は無条件にリニアにする。1000≧Count>10
0の間は0.25を乗ずる。Count≦100のとき
は0.03を乗ずる。一度乗ずる毎に1レベル下げる。
CountがUVLimitより小さくなるまで乗算と
レベル下げを行う。
For example, when Level is lowered by one level, C
When the number of “outs” drops from 100 to 5, or when “1000” drops to 50, the level is lowered by considering that one level is reduced by 1/20. If UVLimit is 6, the level is lowered by one when the initial Count is 100. 10
In the case of 00, the processing is to lower by two levels. The number of pixels in the image sampling data storage unit 23 is 19
In the case of 200 pixels, when Count> 1000, the pixel is unconditionally set to linear. 1000 ≧ Count> 10
Multiply by 0.25 during 0. When Count ≦ 100, multiply by 0.03. Lowers one level each time you ride.
Multiplication and level reduction are performed until Count becomes smaller than UVLimit.

【0074】階調補正曲線データ格納部34のデータを
修正する場合のレベルの下げ方は、前記Countの値
に応じてLevelを下げるが、その目的のLevel
の値になるように、まずコントラスト直線を決めるse
cthighが0になるまで下げ、それでも目的のLe
velの値にまで下がらないときには、各種曲線データ
格納部32から得られる各種曲線データのうち選択して
いた曲線データよりもレベルの低い曲線データを選択す
る。この曲線データとコントラストの直線データを合成
して補正曲線データを生成する。画像は(Y,U,V)
の3次元なのでY成分のみから決定した補正曲線は、こ
の処理で修正処理すればバランスの良い画像が得られ
る。
The method of lowering the level when correcting the data in the gradation correction curve data storage section 34 is to lower the Level according to the value of the Count.
First, determine the contrast line so that
Lower until cthight becomes 0, and still target Le
If the value does not decrease to the value of vel, the curve data having a lower level than the selected curve data is selected from the various curve data obtained from the various curve data storages 32. The curve data and the contrast straight line data are combined to generate correction curve data. The image is (Y, U, V)
Since the correction curve determined from only the Y component is corrected in this process, a well-balanced image can be obtained.

【0075】なお、本発明は上記の実施の形態に限定さ
れるものではなく、例えば入力輝度レベル軸を4以上の
n等分、補正レベルを1以上のm段階とすることかでき
る。また、上記の実施の形態では画像サンプリング処理
部22から画像処理部37までの、画像メモリ21以外
の図1のブロックの処理は、図11のビデオプリンタ1
6内のCPU17のソフトウェアで行うように説明した
が、パソコン14内のCPU15のソフトウェアで行う
ようにしてもよい。あるいは、図1の輝度ヒストグラム
特徴量算出部26、輝度ヒストグラム特徴量格納部2
7、露光オーバー、アンダー検出部28、コントラスト
傾き決定部29、コントラストデータ作成部30、オー
バー、アンダー強度判断部31、各種曲線データ格納部
32、コントラスト直線と曲線データ合成処理部33、
色差信号オーバーフロー検出部35及び階調補正曲線修
正部36の各処理をビデオプリンタ16内のCPU17
のソフトウェアで行い、それ以外のブロックをハードウ
ェアで構成するようにしてもよい。
The present invention is not limited to the above embodiment. For example, the input luminance level axis can be divided into n equal parts of 4 or more and the correction level can be set in m steps of 1 or more. In the above embodiment, the processing of the blocks in FIG. 1 other than the image memory 21 from the image sampling processing unit 22 to the image processing unit 37 is performed by the video printer 1 in FIG.
Although the description has been made with the software of the CPU 17 in the computer 6, the software may be performed with the software of the CPU 15 in the personal computer 14. Alternatively, the brightness histogram feature value calculation unit 26 and the brightness histogram feature value storage unit 2 in FIG.
7, over-exposure / under-detection unit 28, contrast inclination determination unit 29, contrast data creation unit 30, over / under intensity determination unit 31, various curve data storage units 32, contrast straight line and curve data synthesis processing unit 33,
The respective processes of the color difference signal overflow detection unit 35 and the gradation correction curve correction unit 36 are performed by the CPU 17 in the video printer 16.
And the other blocks may be configured by hardware.

【0076】[0076]

【発明の効果】以上説明したように、本発明によれば、
入力カラー画像データの輝度ヒストグラムをn等分に分
割して、その曲線のおよその形を知り、その形に応じて
コントラストの傾き情報を算出すると共に曲線データを
最適なものに選択した後、それらを合成して階調補正曲
線データをソフトウェア処理により生成するようにした
ため、累積輝度分布をそのまま用いた場合よりも、自然
な階調を得ることができ、また、判断時にニューラルネ
ットワークといった高度な技術を用いないため、複雑な
計算が不要であり、コストの削減と高速化を図ることが
できる。また、ソフトウェア処理であるので、画像デー
タの変更などに容易に対応することができる。
As described above, according to the present invention,
After dividing the luminance histogram of the input color image data into n equal parts, knowing the approximate shape of the curve, calculating the slope information of the contrast according to the shape, and selecting the curve data to be optimal, Is used to generate gradation correction curve data by software processing, so that a natural gradation can be obtained as compared with the case where the accumulated luminance distribution is used as it is. Is not used, complicated calculations are not required, and cost reduction and speeding up can be achieved. Further, since the processing is software processing, it is possible to easily cope with a change in image data.

【0077】また、本発明によれば、輝度ヒストグラム
だけの要素から階調補正曲線を自動決定した後、それを
カラー画像に反映させた場合の色差信号がオーバーフロ
ーする率をチェックして階調補正曲線の選択を修正する
ようにしたため、輝度ヒストグラムだけの要素から階調
補正曲線を自動決定した場合に発生することがある彩度
方向のつぶれもなく、良好な階調の画像をソフトウェア
処理で得ることができる。
Further, according to the present invention, after automatically determining a tone correction curve from only the elements of the luminance histogram, the rate of overflow of the color difference signal when the tone correction curve is reflected on a color image is checked. Since the selection of the curve is corrected, there is no collapse in the saturation direction that may occur when the gradation correction curve is automatically determined from only the elements of the luminance histogram, and a good gradation image is obtained by software processing. be able to.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明になる自動階調補正方法の一実施の形態
を実現する補正装置のブロック図である。
FIG. 1 is a block diagram of a correction apparatus for realizing an embodiment of an automatic gradation correction method according to the present invention.

【図2】本発明方法の一実施の形態の階調補正曲線決定
処理説明用フローチャートである。
FIG. 2 is a flowchart for explaining a gradation correction curve determination process according to an embodiment of the method of the present invention.

【図3】図2のアンダー処理の一例の説明用フローチャ
ート(その1)である。
FIG. 3 is a flowchart (part 1) for explaining an example of an under process in FIG. 2;

【図4】図2のアンダー処理の一例の説明用フローチャ
ート(その2)である。
FIG. 4 is a flowchart (part 2) for explaining an example of an under process in FIG. 2;

【図5】図2のオーバー処理の一例の説明用フローチャ
ート(その1)である。
FIG. 5 is a flowchart (part 1) for explaining an example of an over process in FIG. 2;

【図6】図2のオーバー処理の一例の説明用フローチャ
ート(その2)である。
FIG. 6 is a flowchart (part 2) for explaining an example of the over process in FIG. 2;

【図7】図2のリニア処理の一例の説明用フローチャー
ト(その1)である。
FIG. 7 is a flowchart (part 1) for explaining an example of the linear processing of FIG. 2;

【図8】図2のリニア処理の一例の説明用フローチャー
ト(その2)である。
FIG. 8 is a flowchart (part 2) for explaining an example of the linear processing of FIG. 2;

【図9】本発明の一実施の形態の階調補正曲線修正処理
説明用フローチャートである。
FIG. 9 is a flowchart illustrating a tone correction curve correction process according to an embodiment of the present invention.

【図10】本発明の輝度ヒストグラムのおよその形と階
調補正曲線選択の概念図である。
FIG. 10 is a conceptual diagram of an approximate shape of a luminance histogram and selection of a gradation correction curve according to the present invention.

【図11】カラービデオプリンタを使用する印字システ
ムの一例のブロック図である。
FIG. 11 is a block diagram illustrating an example of a printing system using a color video printer.

【図12】輝度ヒストグラムと累積輝度分布の説明図で
ある。
FIG. 12 is an explanatory diagram of a luminance histogram and a cumulative luminance distribution.

【符号の説明】[Explanation of symbols]

14 パーソナルコンピュータ(パソコン) 15、17 中央処理装置(CPU) 16 ビデオプリンタ 18、21 画像メモリ 22 画像サンプリング処理部 23 画像サンプリングデータ格納部 24 輝度ヒストグラム作成部 25 輝度ヒストグラム格納部 26 輝度ヒストグラム特徴量算出部 27 輝度ヒストグラム特徴量格納部 28 露光オーバー、アンダー検出部 29 コントラスト傾き決定部 30 コントラストデータ作成部 31 オーバー、アンダー強度判断部 32 各種曲線データ格納部 33 コントラスト直線と曲線データ合成処理部 34 階調補正曲線データ格納部 35 色差信号オーバーフロー検出部 36 階調補正曲線修正部 37 画像処理部 104 アンダー処理ステップ 106 オーバー処理ステップ 107 リニア処理ステップ Reference Signs List 14 personal computer (personal computer) 15, 17 central processing unit (CPU) 16 video printer 18, 21 image memory 22 image sampling processing unit 23 image sampling data storage unit 24 luminance histogram creation unit 25 luminance histogram storage unit 26 luminance histogram feature amount calculation Unit 27 luminance histogram feature amount storage unit 28 overexposure / under exposure detection unit 29 contrast inclination determination unit 30 contrast data creation unit 31 over / under intensity determination unit 32 various curve data storage units 33 contrast straight line and curve data synthesis processing unit 34 gradation Correction curve data storage unit 35 Color difference signal overflow detection unit 36 Tone correction curve correction unit 37 Image processing unit 104 Under processing step 106 Over processing step 107 Linear processing step

フロントページの続き (72)発明者 田中 賢二 神奈川県横浜市神奈川区守屋町3丁目12番 地 日本ビクター株式会社内 Fターム(参考) 5B057 CA01 CA16 CB01 CB16 CE11 CH11 DC23 5C055 BA03 BA06 BA08 CA07 EA02 EA04 FA22 HA17 HA31 5C066 AA01 AA05 AA13 CA17 EC05 EF00 GA02 GA05 KA12 KD02 KD04 KE07 5C077 LL01 LL19 MP01 NN02 PP10 PP47 PQ08 PQ19 PQ25 TT02Continuation of the front page (72) Inventor Kenji Tanaka 3-12 Moriyacho, Kanagawa-ku, Yokohama-shi, Kanagawa Japan F-term (reference) 5B057 CA01 CA16 CB01 CB16 CE11 CH11 DC23 5C055 BA03 BA06 BA08 CA07 EA02 EA04 FA22 HA17 HA31 5C066 AA01 AA05 AA13 CA17 EC05 EF00 GA02 GA05 KA12 KD02 KD04 KE07 5C077 LL01 LL19 MP01 NN02 PP10 PP47 PQ08 PQ19 PQ25 TT02

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 階調補正しようとするカラー画像データ
から輝度ヒストグラムを作成し、その輝度ヒストグラム
から入力輝度レベル軸をn等分(nは4以上の整数)し
たそれぞれの領域の画素数の全画素に対する割合を示す
第1の特徴量と、前記n等分したそれぞれの領域の一定
のリミッタ値を越える画素数の全画素に対する割合を示
す第2の特徴量と、前記輝度ヒストグラムから入力輝度
レベル軸を3等分したそれぞれの領域の画素数の全画素
に対する割合を示す第3の特徴量とをそれぞれ算出して
第1の格納部に格納する第1のステップと、 前記第1の格納部に格納されている第1乃至第3の特徴
量を取り込み、そのうち最も低輝度側領域の前記第3の
特徴量が予め設定した下限値より大であり、かつ、最も
高輝度側領域の前記第3の特徴量が予め設定した上限値
より小であるかどうか比較判定する第2のステップと、 前記第2のステップにより、最も低輝度側領域の前記第
3の特徴量が予め設定した下限値より大である判定結果
が得られたときは露光アンダーと判断して、前記第1の
特徴量を用いてコントラストの傾き情報を求め、その傾
き情報からアンダー強度を求めた後、そのアンダー強度
に応じて、入力階調に対する出力階調の各種の特性曲線
を示す各種曲線データが予め格納されている第2の格納
部から入力階調に対して出力階調を増加させる特性の曲
線データを選択するアンダー処理を行う第3のステップ
と、 前記第2のステップにより、最も高輝度側領域の前記第
3の特徴量が予め設定した上限値より大である判定結果
が得られたときは露光オーバーと判断して、前記第1の
特徴量を用いてコントラストの傾き情報を求め、その傾
き情報からオーバー強度を求めた後、そのオーバー強度
に応じて、前記第2の格納部から入力階調に対して出力
階調を減少させる特性の曲線データを選択するオーバー
処理を行う第4のステップと、 前記第2のステップにより、最も低輝度側領域の前記第
3の特徴量が予め設定した下限値以下であり、かつ、最
も高輝度側領域の前記第3の特徴量が予め設定した上限
値より小である判定結果が得られたときは、前記第1の
特徴量を用いてコントラストの傾き情報を求めると共
に、前記第2の特徴量に応じて強度を求めた後、その強
度に応じて前記第2の格納部から曲線データを選択する
リニア処理を行う第5のステップと、 前記第3、第4又は第5のステップで作成した前記コン
トラストの傾き情報と選択した曲線データを合成して階
調補正曲線データを生成して第3の格納部に格納する第
6のステップと、 前記階調補正しようとするカラー画像データが格納され
ている画像メモリから読み出した当該階調補正しようと
するカラー画像データに、前記第3の格納部からの前記
階調補正曲線データを反映させて前記画像メモリに再び
格納する第7のステップとを含むことを特徴とする自動
階調補正方法。
1. A luminance histogram is created from color image data to be subjected to gradation correction, and an input luminance level axis is divided into n equal parts (n is an integer of 4 or more) from the luminance histogram. A first feature value indicating a ratio to pixels, a second feature value indicating a ratio of the number of pixels exceeding a certain limiter value to all pixels in each of the n equally divided regions, and an input brightness level from the brightness histogram. A first step of calculating a third feature amount indicating a ratio of the number of pixels of each area divided into three equal parts to all pixels, and storing the calculated third feature amount in a first storage unit; The first to third feature values stored in the first and third feature values are taken in, and the third feature value in the lowest brightness region is larger than a preset lower limit value, and the third feature value in the highest brightness region is 3 features A second step of comparing and determining whether the amount is smaller than a preset upper limit value; and the second step, wherein the third feature value of the lowest luminance side region is larger than a preset lower limit value. When a certain determination result is obtained, it is determined that the exposure is underexposure, the inclination information of the contrast is obtained by using the first feature amount, and the under intensity is obtained from the inclination information. Under processing for selecting, from a second storage unit in which various curve data indicating various characteristic curves of an output gradation with respect to an input gradation are stored, in advance, a curve data having a characteristic of increasing the output gradation with respect to the input gradation. When the result of the determination that the third feature value of the highest luminance side region is larger than a preset upper limit value is obtained by the second step, it is determined that the exposure is over. hand Using the first feature amount, the gradient information of the contrast is obtained, the over-intensity is obtained from the inclination information, and the output gray-scale is compared with the input gray-scale from the second storage unit in accordance with the over-intensity. A fourth step of performing an over process of selecting curve data having a characteristic of reducing the characteristic, and the second step is such that the third feature value in the lowest luminance region is equal to or less than a preset lower limit value, and When a determination result is obtained in which the third feature amount of the highest luminance side region is smaller than a preset upper limit, contrast inclination information is obtained using the first feature amount, and A fifth step of performing a linear process of selecting curve data from the second storage unit according to the strength after obtaining the strength according to the second feature amount; and the third, fourth, or fifth step. Before created in step A sixth step of generating gradation correction curve data by combining the inclination information of the contrast and the selected curve data and storing the data in the third storage unit; and storing the color image data to be corrected for the gradation. A seventh step of reflecting the gradation correction curve data from the third storage unit on the color image data to be corrected for gradation read out from the image memory and storing the color image data again in the image memory. An automatic gradation correction method characterized by including:
【請求項2】 前記第3の格納部の階調補正曲線データ
と入力された前記階調補正しようとするカラー画像デー
タとを用いて、このカラー画像データの色差信号がオー
バーフローする画素数を検出する第8のステップと、 前記第8のステップで検出したオーバーフロー画素数を
もとに、前記第3の格納部に格納される前記コントラス
トの傾き情報と選択した曲線データの少なくとも一方を
修正して合成する第9のステップとを更に含み、前記第
9のステップで合成して得られた修正後の階調補正曲線
データを前記第3の格納部に再び格納することを特徴と
する請求項1記載の自動階調補正方法。
2. Using the gradation correction curve data in the third storage unit and the input color image data to be corrected, the number of pixels at which the color difference signal of the color image data overflows is detected. An eighth step of correcting at least one of the contrast inclination information and the selected curve data stored in the third storage unit based on the number of overflow pixels detected in the eighth step. A ninth step of combining, wherein the corrected gradation correction curve data obtained by combining in the ninth step is stored again in the third storage unit. Automatic gradation correction method described.
【請求項3】 前記階調補正しようとするカラー画像デ
ータは、映像機器から出力された画像データであり、前
記画像メモリはプリンタ内に設けられており、前記第1
乃至第9のステップは前記プリンタ内の中央処理装置又
は前記プリンタの外部にあるパーソナルコンピュータに
よるソフトウェア処理により実行され、前記画像メモリ
に格納されている自動階調補正された画像データを前記
プリンタにより印刷することを特徴とする請求項2記載
の自動階調補正方法。
3. The color image data to be corrected for gradation is image data output from a video device, the image memory is provided in a printer, and the first
The ninth to ninth steps are executed by software processing by a central processing unit in the printer or a personal computer external to the printer, and print the image data with the automatic gradation correction stored in the image memory by the printer. 3. The automatic gradation correction method according to claim 2, wherein
JP10264244A 1998-09-18 1998-09-18 Automatic gradation correction method Pending JP2000102033A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10264244A JP2000102033A (en) 1998-09-18 1998-09-18 Automatic gradation correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10264244A JP2000102033A (en) 1998-09-18 1998-09-18 Automatic gradation correction method

Publications (1)

Publication Number Publication Date
JP2000102033A true JP2000102033A (en) 2000-04-07

Family

ID=17400495

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10264244A Pending JP2000102033A (en) 1998-09-18 1998-09-18 Automatic gradation correction method

Country Status (1)

Country Link
JP (1) JP2000102033A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7142712B2 (en) 2001-06-14 2006-11-28 Matsushita Electric Industrial Co., Ltd Automatic tone correction apparatus, automatic tone correction method, and automatic tone correction program storage mediums
JP2009064459A (en) * 2008-10-24 2009-03-26 Konica Minolta Business Technologies Inc Program for correcting red eye in image, recording medium and pink eye correction method
WO2009093324A1 (en) * 2008-01-24 2009-07-30 Fujitsu Limited Image processing device, image processing method, image processing program, and image correction device
JP2010263423A (en) * 2009-05-07 2010-11-18 Canon Inc Method and device for processing image
JP2010273392A (en) * 2010-09-08 2010-12-02 Canon Inc Image processing method and image processing device
US7916942B1 (en) 2006-06-02 2011-03-29 Seiko Epson Corporation Image determining apparatus, image enhancement apparatus, backlight image enhancement apparatus, and backlight image enhancement method
US7916943B2 (en) 2006-06-02 2011-03-29 Seiko Epson Corporation Image determining apparatus, image determining method, image enhancement apparatus, and image enhancement method
US8014602B2 (en) 2006-03-29 2011-09-06 Seiko Epson Corporation Backlight image determining apparatus, backlight image determining method, backlight image correction apparatus, and backlight image correction method
JP2012238328A (en) * 2012-08-03 2012-12-06 Fujitsu Ltd Image processing device and image processing program
JP2017040520A (en) * 2015-08-19 2017-02-23 株式会社島津製作所 Analysis data display processing device and display processing program

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7142712B2 (en) 2001-06-14 2006-11-28 Matsushita Electric Industrial Co., Ltd Automatic tone correction apparatus, automatic tone correction method, and automatic tone correction program storage mediums
US8014602B2 (en) 2006-03-29 2011-09-06 Seiko Epson Corporation Backlight image determining apparatus, backlight image determining method, backlight image correction apparatus, and backlight image correction method
US7916942B1 (en) 2006-06-02 2011-03-29 Seiko Epson Corporation Image determining apparatus, image enhancement apparatus, backlight image enhancement apparatus, and backlight image enhancement method
US7916943B2 (en) 2006-06-02 2011-03-29 Seiko Epson Corporation Image determining apparatus, image determining method, image enhancement apparatus, and image enhancement method
US8300934B2 (en) 2008-01-24 2012-10-30 Fujitsu Limited Image processing device and image correction device
WO2009093324A1 (en) * 2008-01-24 2009-07-30 Fujitsu Limited Image processing device, image processing method, image processing program, and image correction device
JP5152203B2 (en) * 2008-01-24 2013-02-27 富士通株式会社 Image processing apparatus, image processing method, image processing program, and image correction apparatus
JP4640490B2 (en) * 2008-10-24 2011-03-02 コニカミノルタビジネステクノロジーズ株式会社 Program for correcting red eye in image, recording medium, and red eye correction method
JP2009064459A (en) * 2008-10-24 2009-03-26 Konica Minolta Business Technologies Inc Program for correcting red eye in image, recording medium and pink eye correction method
JP2010263423A (en) * 2009-05-07 2010-11-18 Canon Inc Method and device for processing image
JP2010273392A (en) * 2010-09-08 2010-12-02 Canon Inc Image processing method and image processing device
JP2012238328A (en) * 2012-08-03 2012-12-06 Fujitsu Ltd Image processing device and image processing program
JP2017040520A (en) * 2015-08-19 2017-02-23 株式会社島津製作所 Analysis data display processing device and display processing program

Similar Documents

Publication Publication Date Title
US7023580B2 (en) System and method for digital image tone mapping using an adaptive sigmoidal function based on perceptual preference guidelines
JP3130268B2 (en) Image improvement method and circuit using average-matching histogram equalization
US7646931B2 (en) Automatic analysis and adjustment of digital images with exposure problems
EP0747855B1 (en) Method and apparatus for enhancing a digital image
US7570390B2 (en) Image processing device and method
KR101225058B1 (en) Method and apparatus for controlling contrast
JP3130266B2 (en) Image improvement method and circuit using average separation histogram equalization
US6346994B1 (en) Image processing system and its smoothing method for correcting color fog and backlight of a digital image
JP4795473B2 (en) Image processing apparatus and control method thereof
US7409083B2 (en) Image processing method and apparatus
US20030174887A1 (en) Apparatus and method to enhance a contrast using histogram matching
JP6600216B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP2000188768A (en) Automatic gradation correction method
JP2000102033A (en) Automatic gradation correction method
JP2004007202A (en) Image processor
US7289666B2 (en) Image processing utilizing local color correction and cumulative histograms
JP5089797B2 (en) Image processing apparatus and control method thereof
JP2006005699A (en) Image processor, image processing program, electronic camera, and image processing method
KR100213039B1 (en) Method and apparatus of image enhancement using average-matching histogram equalization
Watanabe et al. Improvement of color quality with modified linear multiscale retinex
JP2002223355A (en) Image processor and recording medium with image processing program recorded thereon
KR100742333B1 (en) The apparatus which enhances the contrast of the image using adaptive coefficient interpolation and method thereof
JP2008048031A (en) Image processor and image processing method
KR100188679B1 (en) Image quality enhancement method based on the mean-separate histogram equalization having the brightness control function and circuit thereof
KR0176602B1 (en) Picture quality improving method &amp; circuit using mean-matching histogram equalization having brightness compensation function