JP2000188768A - Automatic gradation correction method - Google Patents

Automatic gradation correction method

Info

Publication number
JP2000188768A
JP2000188768A JP10364778A JP36477898A JP2000188768A JP 2000188768 A JP2000188768 A JP 2000188768A JP 10364778 A JP10364778 A JP 10364778A JP 36477898 A JP36477898 A JP 36477898A JP 2000188768 A JP2000188768 A JP 2000188768A
Authority
JP
Japan
Prior art keywords
value
area
luminance
pixels
determined
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
JP10364778A
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 JP10364778A priority Critical patent/JP2000188768A/en
Publication of JP2000188768A publication Critical patent/JP2000188768A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To realize an automatic gradation correction method that can conduct automatic gradation correction taking the skin color into account. SOLUTION: Underexposure pre-processing, overexposure pre-processing or linear pre-processing is conducted on the basis of a feature quantity of a luminance histogram and various curve data (steps 103-107). Except the case of overexposure, it is discriminated that a strong rear light is present and a rear light flag is set to '1' when a 2nd feature quantity is positive both in regions where an input luminance level is the highest and lowest (steps 108-114). After face part recognition processing to recognize the face area of an input picture, a gradation curve correction level is corrected (steps 110, 116). In the gradation curve correction level correction processing, the correction is made around a level obtained through skin color recognition in the case of rear light.

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]

【従来の技術】図18はカラービデオプリンタを使用す
る印字システムの一例のブロック図を示す。同図におい
て、ディジタルカメラ11で撮像して得られたカラー画
像信号は、直接ビデオプリンタ16に供給されて印字さ
れる一方、パーソナルコンピュータ(以下、パソコンと
いう)14に取り込まれてディスプレイモニタの陰極線
管(CRT)19にて表示されると共に、パソコン14
内の中央処理装置(CPU)15で加工されてからビデ
オプリンタ16に供給されて印字される。
2. Description of the Related Art FIG. 18 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で撮影する場合には、カメラ本体が露
出を最適化するような自動調整を行う。しかし、それら
により撮影した画像が、図18に示すような印字システ
ムにおいては必ずしも所望の階調を再現しているとは限
らない。特にビデオカメラ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, an image photographed by them does not always reproduce a desired gradation in a printing system as shown in FIG. 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にて所望の階
調を得るために、カラー画像の階調補正を施してから印
字することが従来より行われている。このカラー画像の
階調補正では、ビデオプリンタ16内部のCPU17に
よって画像メモリ18に取り込まれた画像データを解析
して自動的に階調を補正してから印刷する、あるいはパ
ソコン14のCPU15にてパソコン14に取り込まれ
た画像データを解析して自動的に階調を補正してから印
刷するといった処理が行われる。
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. In the gradation correction of the color image, the CPU 17 in the video printer 16 analyzes the image data taken in the image memory 18 and automatically corrects the gradation before printing, or the CPU 15 of the personal computer 14 Processing is performed such as analyzing the image data taken in by 14 and automatically correcting the gradation before printing.

【0007】[0007]

【発明が解決しようとする課題】しかるに、従来の自動
階調補正方法では、例えば、本出願人が先に特願平10
−264244号にて提案したように、輝度ヒストグラ
ムの特徴量を把握して階調補正をしているが、特に肌色
を意識した補正を行っていない。また、従来方法では、
全画面の階調のバランスが良好になるように補正してい
るので、画面の大部分が空で弱い逆光の場合、逆光の判
断ができず人物の顔が少し暗くなっていてもあまり補正
されておらず、更に、強い逆光の場合は、逆光と判断で
きていても顔がどの程度の輝度であるかはわからないの
で、十分な階調補正ができないという問題がある。
However, in the conventional automatic gradation correction method, for example, the applicant of the present invention disclosed in Japanese Patent Application No.
As proposed in -264244, gradation correction is performed by grasping the feature amount of the luminance histogram, but correction is not particularly performed in consideration of skin color. In the conventional method,
Correction is made so that the gradation balance of the entire screen is good, so if the screen is largely empty and weak backlight, it will not be possible to judge the backlight, and even if the person's face is slightly dark, it will be corrected too much In addition, in the case of strong backlight, there is a problem that sufficient gradation correction cannot be performed because it is not known how bright the face is, even if the face is determined to be backlight.

【0008】本発明は上記の点に鑑みなされたもので、
肌色を考慮した自動階調補正を行い得る自動階調補正方
法を提供することを目的とする。
[0008] 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 performing automatic gradation correction in consideration of skin color.

【0009】また、本発明の他の目的は、逆光に強く顔
の輝度レベルが良好な自動階調補正を行い得る自動階調
補正方法を提供することにある。
It is another object of the present invention to provide an automatic gradation correction method capable of performing automatic gradation correction that is resistant to backlight and has a good face luminance level.

【0010】[0010]

【課題を解決するための手段】本発明は上記の目的を達
成するため、階調補正しようとするカラー画像データか
ら輝度ヒストグラムを作成し、その輝度ヒストグラムか
ら入力輝度レベル軸をa等分(aは4以上の整数)した
それぞれの領域の画素数の全画素に対する割合を示す第
1の特徴量と、a等分したそれぞれの領域の一定のリミ
ッタ値を越える画素数の全画素に対する割合を示す第2
の特徴量と、輝度ヒストグラムから入力輝度レベル軸を
3等分したそれぞれの領域の画素数の全画素に対する割
合を示す第3の特徴量とをそれぞれ算出して第1の格納
部に格納する第1のステップと、第1の格納部に格納さ
れている第1乃至第3の特徴量を取り込み、そのうち最
も低輝度側領域の第3の特徴量が予め設定した下限値よ
り大であり、かつ、最も高輝度側領域の第3の特徴量が
予め設定した上限値より小であるかどうか比較判定する
第2のステップと、第2のステップにより、最も低輝度
側領域の第3の特徴量が予め設定した下限値より大であ
る判定結果が得られたときは露光アンダーと判断して、
第1の特徴量を用いてコントラストの傾き情報を求め、
その傾き情報からアンダー強度を求めるアンダー前処理
を行う第3のステップと、第2のステップにより、最も
高輝度側領域の第3の特徴量が予め設定した上限値より
大である判定結果が得られたときは露光オーバーと判断
して、第1の特徴量を用いてコントラストの傾き情報を
求め、その傾き情報からオーバー強度を求めるオーバー
前処理を行う第4のステップと、第2のステップによ
り、最も低輝度側領域の第3の特徴量が予め設定した下
限値以下であり、かつ、最も高輝度側領域の第3の特徴
量が予め設定した上限値より小である判定結果が得られ
たときは、第1の特徴量を用いてコントラストの傾き情
報を求めると共に、第2の特徴量に応じて強度を求める
リニア前処理を行う第5のステップと、更に第6乃至第
11のステップとからなることを特徴とする。
According to the present invention, in order to achieve the above object, a luminance histogram is created from color image data whose gradation is to be corrected, and an input luminance level axis is equally divided into (a) from the luminance histogram. Is an integer equal to or greater than 4) indicating the first characteristic amount indicating the ratio of the number of pixels in each region to all pixels, and the ratio of the number of pixels exceeding a certain limiter value in each region equally divided by a to all pixels. Second
And the third feature value indicating the ratio of the number of pixels in each area obtained by equally dividing the input brightness level axis to all the pixels from the brightness histogram, and calculating the third feature value, and storing the third feature value in the first storage unit. Step 1 and the first to third feature values stored in the first storage unit are fetched, and the third feature value of the lowest luminance area is larger than a preset lower limit value, and A second step of comparing whether the third feature value of the highest brightness region is smaller than a preset upper limit value, and a third feature value of the lowest brightness region by the second step. When a determination result is obtained that is larger than the lower limit set in advance, it is determined that the exposure is under,
Using the first feature amount, the slope information of the contrast is obtained,
The third step of performing under-preprocessing for obtaining under-intensity from the inclination information and the second step provide a determination result in which the third feature amount of the highest luminance side area is larger than a preset upper limit value. When it is determined that the exposure is over, the fourth step of performing the pre-over process for obtaining the inclination information of the contrast using the first feature amount and obtaining the over intensity from the inclination information, and the second step It is possible to obtain a determination result in which the third characteristic amount of the lowest luminance region is equal to or less than a preset lower limit value and the third characteristic amount of the highest luminance region is smaller than the preset upper limit value. A fifth step of obtaining contrast gradient information using the first feature amount and performing a linear pre-process of obtaining an intensity according to the second feature amount, and further, the sixth to eleventh steps. And Characterized in that it comprises.

【0011】上記の第6のステップは、第2のステップ
により露光オーバー以外と判断されたときは、第2の特
徴量が入力輝度レベルの最も高い領域と最も低い領域で
共に正の値であるときに強い逆光と判断して逆光フラグ
を所定値にセットする。上記の第7のステップは、入力
されたカラー画像データが明度、色相、彩度が肌色であ
る領域に含まれるか否か判定すると共に、逆光フラグが
所定値であるときは所定値でないときに比べて、肌色で
ある領域の輝度レベルを下げて判定する。上記の第8の
ステップは、第7のステップにより検出された肌色の画
素について、各連結領域の面積を求め、それらの連結領
域のうち最大面積から面積の広い順に全部でn個(nは
予め定めた2以上の整数)の連結領域を、認識対象のエ
リアとして抽出し、そのn個のエリアのそれぞれについ
て、当エリアを内部に含む所定形状の枠に当てはめ、か
つ、その枠の上部に髪の毛エリアを加えた枠を想定し、
n個の各枠全体のそれぞれについて、肌色総画素数を示
す第4の特徴量と、枠の画面縦方向の情報を示す第5の
特徴量と、枠の画面横方向の情報を示す第6の特徴量と
を求めた後、第4乃至第6の特徴量を分析し、顔を示す
エリアである確率が最も高い1つのエリアを顔エリアと
して決定する。
In the sixth step, when it is determined that the exposure is not over in the second step, the second feature amount is a positive value in both the highest input luminance level area and the lowest input luminance level area. Sometimes it is determined that the backlight is strong, and the backlight flag is set to a predetermined value. The seventh step is to determine whether or not the input color image data is included in a region where the brightness, hue, and saturation are skin colors, and to determine whether the backlight flag is a predetermined value when the backlight flag is a predetermined value. In comparison, the determination is made by lowering the brightness level of the skin color area. In the eighth step, the area of each connected region is determined for the flesh-colored pixel detected in the seventh step, and a total of n (n is a predetermined number) of the connected regions in order from the largest area to the largest area. A connected area of (defined integer of 2 or more) is extracted as an area to be recognized, and each of the n areas is applied to a frame of a predetermined shape including the area therein, and the hair is placed at the top of the frame. Assuming a frame with an area,
For each of the n frames as a whole, a fourth feature value indicating the total number of skin color pixels, a fifth feature value indicating information of the frame in the vertical direction of the screen, and a sixth feature value indicating information of the frame in the horizontal direction of the screen. Then, the fourth to sixth feature values are analyzed, and one area having the highest probability of being a face area is determined as a face area.

【0012】上記の第9のステップは、第8のステップ
で決定された顔エリアの平均輝度を求め、その平均輝度
を予め設定した目標の輝度範囲に入るかどうか比較し、
その比較結果に基づき、第3、第4又は第5のステップ
で作成したコントラストの傾き情報と強度情報とを、平
均輝度が目標の輝度範囲に入るように予測した値に修正
する。上記の第10のステップは、第9のステップで修
正された強度に応じて、入力階調に対する出力階調の各
種の特性曲線を示す各種曲線データが予め格納されてい
る第2の格納部から曲線データを選択し、その選択した
曲線データと第9のステップで修正されたコントラスト
の傾き情報とを合成して階調補正曲線データを生成して
第3の格納部に格納する。上記の第11のステップは、
階調補正しようとするカラー画像データが格納されてい
る画像メモリから読み出した当階調補正しようとするカ
ラー画像データに、第3の格納部からの階調補正曲線デ
ータを反映させて画像メモリに再び格納する。
In the ninth step, an average luminance of the face area determined in the eighth step is obtained, and the average luminance is compared with a predetermined target luminance range.
Based on the comparison result, the contrast inclination information and the intensity information created in the third, fourth, or fifth step are corrected to values predicted so that the average luminance falls within the target luminance range. In the tenth step, according to the intensity corrected in the ninth step, various curve data indicating various characteristic curves of the output gradation with respect to the input gradation are stored in the second storage unit. Curve data is selected, and the selected curve data is combined with the contrast gradient information corrected in the ninth step to generate gradation correction curve data, and stored in the third storage unit. The eleventh step above is
In the image memory, the gradation correction curve data from the third storage unit is reflected on the color image data to be corrected, read from the image memory in which the color image data to be corrected is stored. Store again.

【0013】この発明では、入力カラー画像データの輝
度ヒストグラムをa等分に分割して、その曲線のおよそ
の形を知り、その形に応じてコントラストの傾き情報を
算出すると共に、階調補正曲線を肌色を考慮した修正を
行うことで曲線データを最適なものに選択した後、それ
らを合成して階調補正曲線データをソフトウェア処理に
より生成することができる。また、本発明によれば、通
常時と強い逆光時の両方で肌色を考慮した階調補正曲線
の修正をすることができる。
According to the present invention, the luminance histogram of the input color image data is divided into equal parts a, the approximate shape of the curve is known, the slope information of the contrast is calculated according to the shape, and the gradation correction curve is calculated. Is corrected in consideration of the skin color to select the optimal curve data, and then synthesizes them to generate gradation correction curve data by software processing. Further, according to the present invention, it is possible to correct the gradation correction curve in consideration of the skin color in both the normal state and the strong backlight.

【0014】また、本発明において、上記の第8のステ
ップは、逆光フラグが所定値であるときは、顔を示すエ
リアである確率が最も高い1つのエリアの確率値が予め
定めた第1の下限値以上であるときに、1つのエリアを
顔エリアと判定し、逆光フラグが所定値でないときは、
顔を示すエリアである確率が最も高い1つのエリアの肌
色の総画素数が予め定めた経験値以上で、かつ、1つの
エリアの確率値が第1の下限値よりも大なる予め設定し
た第2の下限値以上であるときのみ、1つのエリアを顔
エリアと判定することを特徴とする。
Further, in the present invention, when the backlight flag is a predetermined value, the probability value of one area having the highest probability of being an area showing a face is determined by a first predetermined value. When the area is equal to or larger than the lower limit, one area is determined to be a face area, and when the backlight flag is not a predetermined value,
A preset second count in which the total number of skin color pixels in one area having the highest probability of being a face area is equal to or greater than a predetermined empirical value, and the probability value in one area is greater than a first lower limit. One area is determined to be a face area only when the value is equal to or more than the lower limit of 2.

【0015】この発明では、逆光フラグが所定値である
強い逆光の場合は、肌色認識により得たレベル中心の補
正とすることができる。すなわち、強い逆光の場合、従
来方式ではレベルを決定するための情報量が十分でなか
ったために肌色を考慮した補正となっていなかったが、
本発明では肌色認識により得たレベル中心の補正とする
ことができる。
According to the present invention, when the backlight flag is a strong backlight having a predetermined value, the level center obtained by skin color recognition can be corrected. In other words, in the case of strong backlight, the conventional method does not have a sufficient amount of information for determining the level, so that the correction is not performed in consideration of the skin color.
In the present invention, it is possible to perform correction of the level center obtained by skin color recognition.

【0016】また、本発明では、通常は従来の解析方法
で得たレベルでも全画面を見た場合には比較的良好な結
果が得られていたが、もう少し肌色の輝度を考慮した補
正とするために、従来の解析方法で得たレベルと肌色認
識により得たレベルの中間をとることを特徴とする。
In the present invention, a relatively good result is normally obtained when the entire screen is viewed even at the level obtained by the conventional analysis method. However, the correction is performed in consideration of the luminance of the skin color. For this reason, the present invention is characterized in that a level between the level obtained by the conventional analysis method and the level obtained by skin color recognition is taken.

【0017】[0017]

【発明の実施の形態】次に、本発明の実施の形態につい
て、図面と共に説明する。図1は本発明になる自動階調
補正方法の要部の一実施の形態のフローチャート、図2
は本発明になる自動階調補正方法を実現する補正装置の
一実施の形態のブロック図を示す。本発明方法は、図1
8に示したような印字システムにおいて、ビデオプリン
タ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 flowchart of one embodiment of a main part of an automatic gradation correction method according to the present invention.
FIG. 1 shows a block diagram of an embodiment of a correction device for realizing an automatic gradation correction method according to the present invention. The method of the present invention is shown in FIG.
In the printing system as shown in FIG. 8, the CPU 17 inside the video printer 16 analyzes the image data taken into the image memory 18 and automatically recognizes the flesh color. And automatically recognizes skin color by analyzing the image data obtained.Based on color recognition, image data that has been subjected to gradation correction so that the color reproduction of a person's face is good even in the case of backlight. The image is printed by the video printer 16.

【0018】この実施の形態の自動階調補正処理では、
従来の自動階調補正に肌色認識を加えると共に、その肌
色認識処理をできるだけ短い処理とするために、原画は
補正前状態で例え暗いままでも肌色が認識できるように
する。また、通常時と強い逆光時の両方で肌色を意識し
た補正が必要であるが、通常は全体のバランスを中心と
した従来の補正方法を生かすように工夫する必要があ
り、強い逆光の場合には肌色を中心とした補正方法とす
るものである。
In the automatic gradation correction processing of this embodiment,
In order to add skin color recognition to the conventional automatic gradation correction and to make the skin color recognition processing as short as possible, the original image is made to be able to recognize the skin color even in a dark state even before being corrected. In addition, it is necessary to correct the skin color in both normal and strong backlight, but usually it is necessary to devise to make use of the conventional correction method focusing on the overall balance, and in the case of strong backlight, Is a correction method centering on skin color.

【0019】この実施の形態について、まず、図2のブ
ロック図と対応させて説明する。図2において、ディジ
タルカメラ、ビデオカメラ、パソコンあるいはビデオデ
ッキなどの外部映像機器から入力された、例えばYUV
の3次元色空間のカラー画像信号が画像メモリ21に格
納されている。処理速度を考慮して画像サンプリング処
理部22は、画像メモリ21からg画素(g>0)おき
の画像データをサンプリングして画像サンプリングデー
タ格納部23に格納する。gは、全体の画素数に応じて
2や4といった値を決めればよい。画像サンプリングデ
ータ格納部23は、図18の画像メモリ18に相当し、
また、画像サンプリングデータ格納部23と画像メモリ
21を除いた図2の各ブロックの処理がCPU17のソ
フトウェアにより実現される。
This embodiment will be described first with reference to the block diagram of FIG. In FIG. 2, for example, a YUV input from an external video device such as a digital camera, a video camera, a personal computer, or a VCR.
Are stored in the image memory 21. In consideration of the processing speed, the image sampling processing unit 22 samples image data every g pixels (g> 0) from the image memory 21 and stores the sampled image data in the image sampling data storage unit 23. g may be a value such as 2 or 4 depending on the total number of pixels. The image sampling data storage unit 23 corresponds to the image memory 18 in FIG.
2 except for the image sampling data storage unit 23 and the image memory 21 is realized by software of the CPU 17.

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

【0021】第1は輝度ヒストグラム格納部25のデー
タを入力輝度レベル軸にてa等分(ただし、a>3)し
て得た、全画素に対するそれぞれの領域の画素数の割合
を示す特徴量Sep[0]〜Sep[a−1]である。
第2は輝度ヒストグラム格納部25のデータを入力輝度
レベル軸にてa等分(ただし、a>3)して得た、一定
のリミット値を越える画素数分について全画素に対する
割合を示す特徴量LimitSep[0]〜Limit
Sep[a−1]である。第3は輝度ヒストグラム格納
部25のデータを入力輝度レベル軸にて3等分して得
た、全画素に対するそれぞれの領域の画素数の割合を示
す特徴量L、M、Hである。
First, a feature quantity indicating the ratio of the number of pixels in each region to all pixels obtained by equally dividing the data of the brightness histogram storage unit 25 by a on the input brightness level axis (where a> 3). Sep [0] to Sep [a-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 equally dividing the data of the brightness histogram storage unit 25 by a on the input brightness level axis (where a> 3). LimitSep [0]-Limit
Sep [a-1]. Thirdly, 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.

【0022】露光オーバー、アンダー検出部31は、輝
度ヒストグラム特徴量格納部27に格納されている輝度
ヒストグラム特徴量を読み出し、それらの輝度ヒストグ
ラム特徴量から露光オーバー、アンダーを検出する。続
いて、コントラスト傾き決定部32は、輝度ヒストグラ
ム特徴量格納部27に格納されている輝度ヒストグラム
特徴量と、露光オーバー、アンダー検出部31による検
出結果とに基づいて、コントラストの傾き情報を決定す
る。コントラストデータ作成部35は、コントラスト傾
き決定部32で決定したコントラストの傾きの情報をも
とにコントラストデータを作成する。
The overexposure / underexposure detection section 31 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 gradient determination unit 32 determines contrast gradient information based on the luminance histogram feature stored in the luminance histogram feature storage 27 and the detection result of the over-exposure / under-detection unit 31. . The contrast data creating unit 35 creates contrast data based on the information on the contrast inclination determined by the contrast inclination determining unit 32.

【0023】オーバー、アンダー強度判断部33は、輝
度ヒストグラム特徴量格納部27に格納されている輝度
ヒストグラム特徴量と、露光オーバー、アンダー検出部
31の検出結果と、コントラスト傾き決定部29により
決定されたコントラストの傾き情報とに基づいて、図1
のステップ103〜107の処理を行って、露光のオー
バー強度、アンダー強度(Level)を判断し、その
強度(Level)に応じて各種曲線データ格納部32
に格納されている各種曲線データの中から曲線データを
1つ選択する。
The over / under intensity judging section 33 is determined by the luminance histogram feature stored in the luminance histogram feature storing section 27, the detection result of the over-exposure / under-detection section 31, and the contrast inclination determining section 29. FIG. 1
Are performed, the over-intensity and the under-intensity (Level) of the exposure are determined, and various curve data storage units 32 are determined in accordance with the intensities (Level).
Is selected from among various types of curve data stored in.

【0024】強い逆光検出部28は、輝度ヒストグラム
特徴量格納部27からLimitSep[0]、[a−
1]の情報を受け、また露光オーバー、アンダー検出部
31からオーバー、アンダー、リニアの情報を受け、図
1のステップ108〜114の判断処理をして、逆光フ
ラグrefFlagを0か1に決める。
The strong backlight detection unit 28 stores LimitSep [0], [a−
1] and the information of over, under, and linear from the over- and under-exposure detection unit 31, and performs the judgment processing of steps 108 to 114 in FIG. 1 to determine the backlight flag refFlag to be 0 or 1.

【0025】顔部分認識処理部29は、上記の逆光フラ
グrefFlagを受け、また画像サンプリングデータ
格納部23から3次元ディジタルカラー画像データを受
け、図1のステップ115の後述の顔部分認識処理を行
う。階調補正曲線修正部30は、顔エリアの輝度平均値
情報と逆光フラグrefFlagとコントラスト傾き、
レベル強度を受け、図1のステップ116の後述の階調
補正曲線レベル修正処理を実行する。そしてオーバー、
アンダー強度判断部33、コントラスト傾き決定部32
の情報を修正する。
The face part recognition processing section 29 receives the above-mentioned backlight flag refFlag, receives three-dimensional digital color image data from the image sampling data storage section 23, and performs face part recognition processing described later in step 115 of FIG. . The gradation correction curve correction unit 30 calculates the luminance average value information of the face area, the backlight flag refFlag, the contrast inclination,
Upon receiving the level intensity, a gradation correction curve level correction process described later in step 116 of FIG. 1 is executed. And over,
Under-intensity determination unit 33, contrast gradient determination unit 32
Modify the information in

【0026】コントラスト直線と曲線データ合成処理部
36は、図1のステップ117で示すように、コントラ
ストデータ作成部30にて作成したコントラスト直線デ
ータと、オーバー、アンダー強度判断部31にて選択し
た曲線データを合成して階調補正曲線データ(図1では
118)を生成し、それを階調補正曲線データ格納部3
7に格納する。変数iが0から255まで変化するとし
て、コントラスト直線データをcont[i]、曲線デ
ータをcurve[i]とすると、合成結果autog
am[i]は、autogam[i]=curve[c
ont[i]]となる。
As shown in step 117 of FIG. 1, the contrast straight line / curve data synthesizing section 36 compares the contrast straight line data created by the contrast data creating section 30 with the curve selected by the over / under intensity judging section 31. The data is combined to generate gradation correction curve data (118 in FIG. 1), which is stored in the gradation correction curve data storage unit 3.
7 is 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]].

【0027】色差信号オーバーフロー検出部38は、画
像サンプリングデータ格納部23に格納されているサン
プリングデータと、階調補正曲線データ格納部37に格
納されている階調補正曲線データとを用いて、色差信号
がオーバーフローする画素数(Count)を検出し
て、その検出結果を階調補正曲線修正部39に入力す
る。
The color difference signal overflow detecting section 38 uses the sampling data stored in the image sampling data storage section 23 and the gradation correction curve data stored in the gradation correction curve data storage section 37 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 39.

【0028】階調補正曲線修正部39は、色差信号オー
バーフロー検出部38から入力されたオーバーフロー画
素数と、各種曲線データ格納部34からの各種曲線デー
タと、階調補正曲線データ格納部37からの前記直線レ
ベルと曲線レベルとを受け、オーバーフロー画素数に応
じて露光オーバーの強度(Level)をどれだけ下げ
るか判断し、その判断結果に基づいて階調補正曲線デー
タ格納部37のデータを修正するように、コントラスト
データ作成部35に入力される傾きの情報を修正し、そ
れで修正できないときは更に補正曲線データを変更して
コントラスト直線と曲線データ合成処理部36に入力す
る。
The tone correction curve correction section 39 includes an overflow pixel number input from the color difference signal overflow detection section 38, various curve data from the various curve data storage section 34, and a tone correction curve data storage section 37. 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 37 is corrected based on the determination result. As described above, the inclination information input to the contrast data creation unit 35 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 36.

【0029】画像処理部40は、階調補正曲線修正部3
9により補正された階調補正曲線データ格納部37内の
階調補正曲線データに基づいて、画像メモリ21からの
画像データを補正し、その補正後の画像データを画像メ
モリ21に再び格納する。この画像メモリ21に格納さ
れている自動階調補正された画像データは、読み出され
てプリンタにより印刷される。
The image processing section 40 includes a gradation correction curve correcting section 3
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 37 corrected by step 9, 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.

【0030】次に、この実施の形態の要部の動作につい
て、フローチャートを参照して更に詳細に説明する。輝
度ヒストグラム特徴量算出部26で輝度ヒストグラム特
徴量を算出する際、入力輝度レベル軸を8等分(a=
8)した場合、輝度ヒストグラム特徴量としてSep
[0]〜[7],LimitSep[0]〜[7]が準
備される。Sep[]には、全画素数に対するそれぞれ
の領域の画素数の割合が入っている。また、Limit
Sep[]には一定のリミッタ値を超える画素数分につ
いて全画素数に対する割合が入っている。また、輝度ヒ
ストグラム特徴量L、M、Hは、この実施の形態では、
L=Sep[0]+Sep[1]+Sep[2],M=
Sep〔3〕+Sep[4],H=Sep[5]+Se
p[6]+Sep[7]であるものとする。
Next, the operation of the main part of this embodiment will be described in more detail with reference to flowcharts. When calculating the brightness histogram feature value in the brightness histogram feature value calculation unit 26, the input brightness level axis is divided into eight equal parts (a =
8) When the luminance histogram feature amount is set to Sep.
[0] to [7] and LimitSep [0] to [7] are prepared. Sep [] contains the ratio of the number of pixels in each area to the total number of pixels. Also, Limit
Sep [] contains the ratio of the number of pixels exceeding a certain limiter value to the total number of pixels. In this embodiment, the luminance histogram feature amounts L, M, and H are:
L = Sep [0] + Sep [1] + Sep [2], M =
Sep [3] + Sep [4], H = Sep [5] + Se
It is assumed that p [6] + Sep [7].

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

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

【0033】輝度ヒストグラム特徴量Lは入力輝度レベ
ル軸を3等分したときの最も低輝度側の領域の特徴量で
あるので、L>(下限値)であれば、露光アンダーと判
断してアンダー前処理を行い(図1のステップ10
4)、L≦(下限値)であれば、輝度ヒストグラム特徴
量Hが予め設定した上限値(overLimit)より
大であるかどうか判定する(図1のステップ105)。
輝度ヒストグラム特徴量Hは入力輝度レベル軸を3等分
したときの最も高輝度側の領域の特徴量であるので、H
>(上限値)であれば、露光オーバーと判断してオーバ
ー前処理を行い(図1のステップ106)、H≦(上限
値)であれば、リニア(またはそれ以外)と判断してリ
ニア前処理を行う(図1のステップ107)。
Since the luminance histogram characteristic amount L is a characteristic amount of the region on the lowest luminance side when the input luminance level axis is divided into three equal parts, if L> (lower limit value), it is determined that the exposure is underexposure and underexposure occurs. Perform pre-processing (Step 10 in FIG. 1)
4) 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. 1).
Since 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, H
If> (upper limit), it is determined that the exposure is over and pre-over processing is performed (step 106 in FIG. 1). Processing is performed (step 107 in FIG. 1).

【0034】上記の上限値、下限値は、多くの画像にて
実験を行って値が決められている。例えば上限値=6
0、下限値=60とした場合、Lに60%より多くの画
素が偏っていた場合にはアンダー、Hに60%より多く
の画素が偏っていた場合にはオーバーと判断される。
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.

【0035】上記のステップ104のアンダー前処理
は、図3及び図4のフローチャートに従って、輝度ヒス
トグラム特徴量をもとにコントラスト用の直線と補正曲
線*Up[]のレベルを決定し合成して階調補正曲線と
する。基本的な方針は、ヒストグラムの平坦化である。
このヒストグラムの平坦化自体は公知である(長尾真、
「ディジタル画像処理」、近代科学社、p177−p1
81、1978)。
In the under pre-processing of step 104, the levels of the contrast straight line and the correction curve * Up [] are determined and combined based on the luminance histogram feature quantity in accordance with the flowcharts of FIGS. Tone 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-p1
81, 1978).

【0036】まず、レベル(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 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.

【0037】sum>0となると、変数secthig
hの値を7−iとし、かつ、変数sectlowの値を
0とする(図3のステップ206)。すなわち、まず、
輝度の低い方に画素が偏っていることを考慮して、輝度
の最も高い輝度ヒストグラム特徴量Sep[7〕から画
素が0%の領域を探す。画素のない領域には階調を割り
当てないようにするために0%領域はYcon−Yco
n’のグラフにてYcon’を255に張り付ける。変
数secthighは255に張り付ける領域を示し、
変数sectlowは0に張り付ける領域を示す。
If 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”.

【0038】もし、上から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.

【0039】変数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).

【0040】次に補正強度を決定するため、累積輝度分
布を用いた方法を応用する。アンダー前処理において
は、輝度の低い方に画素が偏っていると判断されている
ので、その領域のヒストグラム形状を判断の材料とす
る。すなわち、まず、Sep〔0]>Sep[1]>S
ep[2]の条件を満足するか判定し(図3のステップ
208)、この条件を満たさないときは弱のレベルと判
断して、強度を示す変数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 the accumulated luminance distribution is applied to determine the correction intensity. In the under pre-processing, since it is determined that the pixels are biased toward the lower luminance, the histogram shape of the region is used as a material for the determination. That is, first, Sep [0]> Sep [1]> S
It is determined whether the condition of ep [2] is satisfied (step 208 in FIG. 3). If the condition is not satisfied, it is determined that the level is weak, and the variable Level indicating the strength is set to Level-2 (FIG. 3). Step 209). 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).

【0041】また、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.

【0042】続いて、さらに輝度の低い方に着目してリ
ミッタ値を超える画素の率が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).

【0043】以上のようにして、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).

【0044】続いて、コントラスト決定部29で決定し
た傾きの情報secthighとsectLowからコ
ントラストの傾きが決定するので、入力Ycon、出力
Ycon’のコントラストデータを求めて*Contに
Yconのj=0からj=255に対するYcon’の
値を格納する(図4のステップ216)。式は以下のよ
うな直線式である。aはヒストグラム分割数で、ここで
は”8”である。
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 216 in FIG. 4). The equation is a linear equation as follows. a is the number of histogram divisions, which is “8” here.

【0045】x1=(256/a)*sectlow (ただしx1>255の時x1=255とする) x2=256−(256/a)*secthigh (ただしx2>255の時x2=255とする) Ycon’[j]=255*(j−x1)/(x2−x
1) 以上によりアンダー前処理が終了する。
X1 = (256 / a) * sectlow (provided that x1 = 255 when x1> 255) x2 = 256- (256 / a) * secthigh (provided that x2 = 255 when x2> 255) Ycon '[J] = 255 * (j-x1) / (x2-x
1) Thus, the under pre-processing is completed.

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

【0047】まず、レベル(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.

【0048】sum>0となると、変数sectlow
の値をiとし、かつ、変数secthighの値を0と
する(図5のステップ306)。すなわち、まず、輝度
の高い方に画素が偏っていることを考慮して輝度の最も
低いSep[0]から画素が0%の領域を探す。画素の
ない領域には階調を割り当てないようにするために0%
領域はYcon−Ycon’のグラフにてYcon’を
0に張り付ける。
When 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.

【0049】なお、ステップ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.

【0050】次に、オーバーの強度を示す変数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 pre-over processing, since it is determined that the pixels are biased toward the higher luminance, the histogram shape of the area 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).

【0051】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.

【0052】続いて、さらに輝度の高い方に着目してリ
ミッタ値を超える画素の率が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).

【0053】続いて、コントラスト決定部29で決定し
た傾きの情報secthighとsectLowからコ
ントラストの傾きが決定するので、入力Ycon、出力
Ycon’のコントラストデータを求めて*Contに
Yconのj=0からj=255に対するYcon’の
値を格納する(図6のステップ316)。式は前記アン
ダー前処理の場合と同じ直線式である。以上によりオー
バー前処理が終了する。
Subsequently, since the contrast inclination is determined from the inclination information sechigh and sectLow determined by the contrast determination unit 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 under pre-processing. With this, the pre-over process ends.

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

【0055】まず、コントラストを決めるために上下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 0
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.

【0056】次に、補正強度を決定するために輝度ヒス
トグラム特徴量格納部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.

【0057】また、アンダーと判断された場合は、輝度
ヒストグラム特徴量格納部27のデータLimitSe
p〔0]だけ見て、小さい時はLevelを低く、大き
い時はLevelを高くする(図8のステップ41
2)。レベル割り当ては、多くの画像について調査して
調節すればよい。続いて、secthigh,sect
lowからコントラスト直線*Contの傾きを前記ア
ンダー処理と同様の式に基づいて算出し、コントラスト
直線*Contに格納する(図8のステップ413)。
If it is determined that the value is under, the data LimitSe in the luminance histogram feature 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. Next, second, second
The gradient of the contrast straight line * Cont is calculated from the low based on the same formula as the under process, and stored in the contrast straight line * Cont (step 413 in FIG. 8).

【0058】一方、LimitSep[0]とLimi
tSep〔7]のうち、LimitSep[0]だけが
LimitSep[0]>0である場合は(図8のステ
ップ415、416)、アンダーと判断して、上記のス
テップ412〜413と同様の処理を行う(図8のステ
ップ417〜418)。また、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 413 described above is performed. (Steps 417 to 418 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.

【0059】続いて、secthigh,sectlo
wからコントラスト直線*Contの傾きを前記アンダ
ー処理と同様の式に基づいて算出し、コントラスト直線
*Contに格納する(図8のステップ421)。以上
により図1のステップ107のリニア前処理が終了す
る。
Subsequently, sechigh, sectro
The gradient of the contrast straight line * Cont is calculated from w based on the same formula as the under process, and stored in the contrast straight line * Cont (step 421 in FIG. 8). Thus, the linear pre-processing at step 107 in FIG. 1 is completed.

【0060】上記のアンダー前処理、オーバー前処理あ
るいはリニア前処理が行われているときに、強い逆光検
出部28は、露光オーバー、アンダー検出部31からオ
ーバー、アンダー、リニアのうちアンダー情報が入力さ
れたときは、輝度ヒストグラム特徴量格納部27から入
力されたLimitSep[0]とLimitSep
[7]の両方が共に正であるか否か判定し(図1のステ
ップ108)、共に正であれば強い逆光と判断して逆光
フラグrefFlagを”1”とし(図1のステップ1
09)、そうでなければ逆光フラグrefFlagを”
0”とする(図1のステップ110)。
When the above-described under pre-processing, over pre-processing or linear pre-processing is being performed, the strong backlight detection section 28 receives under-exposure information among over, under, and linear from the over-exposure and under-detection section 31. When this is done, LimitSep [0] and LimitSep input from the luminance histogram feature amount storage unit 27
It is determined whether both [7] are positive (step 108 in FIG. 1). If both are positive, it is determined that the backlight is strong and the backlight flag refFlag is set to “1” (step 1 in FIG. 1).
09) Otherwise, the backlight flag refFlag is set to "
0 "(step 110 in FIG. 1).

【0061】また、強い逆光検出部28は、露光オーバ
ー、アンダー検出部31からオーバー情報が入力された
ときは、逆光フラグrefFlagを”0”とし(図1
のステップ111)、露光オーバー、アンダー検出部3
1からリニア情報が入力されたときは、輝度ヒストグラ
ム特徴量格納部27から入力されたLimitSep
[0]とLimitSep[7]の両方が共に正である
か否か判定し(図1のステップ112)、共に正であれ
ば強い逆光と判断して逆光フラグrefFlagを”
1”とし(図1のステップ113)、そうでなければ逆
光フラグrefFlagを”0”とする(図1のステッ
プ114)。つまり、この逆光フラグrefFlag
が”1”となった部分は、背景の輝度に比べて、入力画
像中の人物の顔の輝度が通常より暗い場合を指す。
The strong backlight detection unit 28 sets the backlight flag refFlag to “0” when over-information is input from the over-exposure / under-detection unit 31 (FIG. 1).
Step 111), overexposure and underexposure detector 3
When the linear information is input from No. 1, the LimitSep input from the luminance histogram feature amount storage 27 is used.
It is determined whether both [0] and LimitSep [7] are positive (step 112 in FIG. 1). If both are positive, it is determined that the backlight is strong and the backlight flag refFlag is set to “
1 (step 113 in FIG. 1), otherwise the backlight flag refFlag is set to "0" (step 114 in FIG. 1), that is, the backlight flag refFlag.
Is "1" when the luminance of the face of the person in the input image is lower than normal compared to the luminance of the background.

【0062】次に、顔部分認識処理部29において強い
逆光検出部28からの上記の逆光フラグrefFlag
と画像サンプリングデータ格納部23からのディジタル
画像データとに基づき、顔部分認識処理が行われる(図
1のステップ115)。このステップ115の顔部分認
識処理について、図9乃至図13のフローチャートと図
14及び図15と共に更に詳細に説明する。
Next, in the face portion recognition processing section 29, the above-mentioned backlight flag refFlag from the strong backlight detection section 28 is output.
Based on the digital image data from the image sampling data storage unit 23, a face portion recognition process is performed (step 115 in FIG. 1). The face portion recognition processing in step 115 will be described in more detail with reference to the flowcharts of FIGS. 9 to 13 and FIGS. 14 and 15.

【0063】図9に示すように、顔部分認識処理部29
は、まず画像サンプリングデータ格納部23に格納され
ているYUV色空間における3次元ディジタル画像デー
タ(YUV画像データ)を読み出した後(ステップ50
1)、その画像データが肌色領域であることを示す、Y
UV3次元色空間座標においてYi1〜Yi2、Ui1
〜Ui2、Vi1〜Vi2(ただし、i=1、
2、...、m)の座標のm個の直方体領域を、ref
Flag=1のときは低い領域に設定し、refFla
g=0のときはYi1〜Yi2を標準の領域に設定する
(図9のステップ502)。
As shown in FIG. 9, the face part recognition processing unit 29
First reads three-dimensional digital image data (YUV image data) in the YUV color space stored in the image sampling data storage unit 23 (step 50).
1), indicating that the image data is a skin color area, Y
Yi1 to Yi2, Ui1 in UV three-dimensional color space coordinates
~ Ui2, Vi1 ~ Vi2 (where i = 1,
2,. . . , M) are represented by ref
When Flag = 1, it is set to a low area, and refFlag is set.
When g = 0, Yi1 and Yi2 are set as standard regions (step 502 in FIG. 9).

【0064】上記の直方体領域はいずれも肌色領域であ
ると予め決定されている領域であり、例えばm=3の場
合、図14に示す如くYUVの3次元空間座標に3つの
直方体として表される。同図において、i=1のときは
直方体41の領域であり、i=2のときは直方体42の
領域であり、i=3のときは直方体43の領域である。
ここで、上記の3つの直方体41〜43はY軸方向上3
段に積み重なっており、Y12=Y21、Y22=Y3
1である。
Each of the above rectangular parallelepiped regions is a region which is determined in advance to be a skin color region. For example, when m = 3, the rectangular parallelepiped regions are represented as three rectangular parallelepipeds in the YUV three-dimensional space coordinates as shown in FIG. . In the figure, when i = 1, it is the area of the rectangular parallelepiped 41, when i = 2, it is the area of the rectangular parallelepiped 42, and when i = 3, it is the area of the rectangular parallelepiped 43.
Here, the above three rectangular parallelepipeds 41 to 43 are three in the Y-axis direction.
Y12 = Y21, Y22 = Y3
It is one.

【0065】次に、YUV画像データ1画面分の全画素
について肌色検出を実行する(ステップ503)。すな
わち、ある画素YUVが、以下の条件式のm個の直方体
の領域にあてはまるかどうか判定する(ステップ50
4)。
Next, skin color detection is executed for all pixels of one screen of YUV image data (step 503). That is, it is determined whether or not a pixel YUV satisfies the m rectangular parallelepiped regions in the following conditional expression (step 50).
4).

【0066】Yi1≦Y≦Yi2、かつ、Ui1≦U≦
Ui2、かつ、Vi1≦V≦Vi2 (ただし、i=1、2、...、m) 上記の条件式はいずれも肌色領域であると予め決定され
ている領域であり、上記の条件式で表される直方体の領
域に存在する画素YUVは肌色領域であると見なし、画
像サンプリングデータ格納部(画像メモリ)23上の対
応する画素に”1”をセットする(ステップ505)。
なお、上記の条件式には、Y11からYm2にて全て
の階調をみたさなくてもよい、mは2以上でいくつの
範囲でもよい、YだけについてはY12=Y21、Y
22=Y31というように連続した領域である、という
条件も含まれている。また、U、Vについては限定はな
い。
Yi1 ≦ Y ≦ Yi2 and Ui1 ≦ U ≦
Ui2 and Vi1 ≦ V ≦ Vi2 (where i = 1, 2,..., M) Each of the above conditional expressions is a region which is determined in advance to be a flesh color region. The pixel YUV existing in the represented rectangular parallelepiped area is regarded as a flesh color area, and “1” is set to the corresponding pixel on the image sampling data storage (image memory) 23 (step 505).
Note that in the above conditional expression, it is not necessary to see all the gradations from Y11 to Ym2, m may be 2 or more and in any range, and only for Y, Y12 = Y21, Y
A condition that the region is a continuous region such as 22 = Y31 is also included. There is no limitation on U and V.

【0067】一方、上記のm個の直方体の領域のいずれ
にも当てはまらない画素YUVは、肌色領域でないと見
なし、画像サンプリングデータ格納部(画像メモリ)2
3上の対応する画素に”0”をセットする(ステップ5
06)。このようにして、ソフトウェア処理により入力
画像の一画面における肌色領域を検出する。
On the other hand, the pixel YUV that does not correspond to any of the m rectangular parallelepiped regions is regarded as not a flesh color region, and the image sampling data storage (image memory) 2
3 is set to "0" for the corresponding pixel (step 5).
06). In this way, the flesh color area on one screen of the input image is detected by the software processing.

【0068】その後、顔部分認識処理部29は、肌色と
認識した画素について連結領域の面積(画素数)を求
め、それらの連結領域のうち最大面積から面積の広い順
に全部でn個(nは予め定めた2以上の整数)の連結領
域を、認識対象のエリアとして抽出し、続いて入力され
たカラー画像データから明度、色相、彩度が髪色である
画素とそうでない画素に分ける。
Thereafter, the face portion recognition processing section 29 calculates the area (the number of pixels) of the connected area for the pixel recognized as the flesh color, and among the connected areas, a total of n pieces (n: A connected region of (a predetermined integer of 2 or more) is extracted as an area to be recognized, and subsequently, pixels having lightness, hue, and saturation of hair color and pixels not having such color are divided from the input color image data.

【0069】更に引き続いて、顔部分認識処理部29
は、上記のn個のエリアのそれぞれについて、当該エリ
アを内部に含む所定形状の枠に当てはめる。例えば、1
つのエリアの左端、右端、上端、下端の位置がわかった
ら、例えば図15(A)、(B)に示すようにエリアが
内部に含まれるように大きな1つの枠にあてはめる。な
お、図15(A)、(B)中、丸Iは一つの肌エリアの
連結領域を示しているが、連結領域の形状はこれに限定
されるものではないことは勿論である。
Subsequently, the face part recognition processing unit 29
Is applied to a frame of a predetermined shape including the area inside each of the n areas. For example, 1
When the positions of the left end, right end, upper end, and lower end of one area are known, for example, as shown in FIGS. 15A and 15B, it is fitted to one large frame so that the area is included inside. In FIGS. 15A and 15B, a circle I indicates a connected area of one skin area, but the shape of the connected area is not limited to this.

【0070】そして、上記の連結領域Iの左端、右端、
上端、下端を一つの枠に当てはめ、その枠を図15
(A)のように縦3分割し、更にその上にIIで示すよう
に、3分割領域の1領域分を加えて縦の長さとする。つ
まり、(肌ラベルの上端と下端の長さ)×4/3の長さ
が全体の長さとなる。加えた1領域分IIは髪の毛エリ
アを想定している。この髪の毛エリアの下側の肌エリア
が顔エリアである。また、上記の枠を図15(B)に示
すように横4分割する。横は肌ラベルの右端から左端ま
での長さを4等分する。
Then, the left end, right end,
The upper and lower edges are fitted to one frame, and that frame is
As shown in (A), the image is vertically divided into three parts, and as shown by II, one of the three divided areas is added to obtain a vertical length. That is, the length of (the length of the upper end and the lower end of the skin label) × 4/3 is the entire length. The added one area II assumes a hair area. The skin area below the hair area is the face area. The above frame is divided into four horizontal parts as shown in FIG. On the side, the length from the right end to the left end of the skin label is divided into four equal parts.

【0071】次に、顔部分認識処理部29は上記の枠に
基づいて、3つの特徴量を求める。第1の特徴量は総画
素数であり、第2の特徴量は、画面縦方向の枠の長さと
左肩のy座標と、縦方向を4または8分割した分割枠の
内部について分割枠内の画素数に対する髪の画素数の
割合、分割枠内の画素数に対する肌色の画素数の割
合、分割枠内に存在する肌色の輝度平均値からなる縦
方向の情報であり、第3の特徴量は画面横方向の枠の長
さと、左肩のx座標と、横方向を4または8分割した分
割枠の内部について分割枠内の画素数に対する髪の画
素数の割合、分割枠内の画素数に対する肌の画素数の
割合、分割枠内に存在する肌色の輝度平均値からなる
横方向の情報である。
Next, the face part recognition processing section 29 obtains three feature values based on the above-mentioned frame. The first feature value is the total number of pixels, and the second feature value is the length of the frame in the vertical direction of the screen, the y coordinate of the left shoulder, and the inside of the divided frame obtained by dividing the vertical direction into four or eight. The vertical characteristic information is composed of the ratio of the number of hair pixels to the number of pixels, the ratio of the number of skin color pixels to the number of pixels in the divided frame, and the average luminance value of the flesh color present in the divided frame. The length of the frame in the horizontal direction of the screen, the x coordinate of the left shoulder, the ratio of the number of hair pixels to the number of pixels in the divided frame inside the divided frame divided into four or eight in the horizontal direction, and the skin to the number of pixels in the divided frame Is information in the horizontal direction, which is composed of the ratio of the number of pixels and the average luminance value of the flesh color present in the divided frame.

【0072】次に、顔部分認識処理部29は、図10乃
至図13のフローチャートに従って、特徴量を分析して
顔エリアを決定する。すなわち、顔部分認識処理部29
は、前記n個のエリアに対応するn個のラベル番号を読
み出し(図10のステップ601)、更にn個のエリア
の特徴量を読み出し(図10のステップ602)、これ
らに基づいて、n個のエリアのそれぞれについてステッ
プ603〜653の処理を繰り返す(図10のステップ
603)。但し、分割枠数は4とする。
Next, the face portion recognition processing section 29 analyzes the feature values and determines the face area according to the flowcharts of FIGS. That is, the face part recognition processing unit 29
Reads out n label numbers corresponding to the n areas (step 601 in FIG. 10), reads out feature amounts of the n areas (step 602 in FIG. 10), and based on these, n The processing of steps 603 to 653 is repeated for each of the areas (step 603 in FIG. 10). However, the number of divided frames is four.

【0073】まず、変数pに0を代入し(図10のステ
ップ604)、上記の特徴量中の第1の特徴量である肌
色総画素数maxCn[i]を小なる経験値maxC1
より小であるかどうか判定し(図10のステップ60
5)、小であれば変数pに0を加算し(図10のステッ
プ606)、maxC1以上であれば大なる経験値ma
xC2より小であるかどうか判定し(図10のステップ
607)、小であれば変数pに1を加算し(図10のス
テップ608)、maxC2以上であれば変数pに2を
加算する(図10のステップ609)。
First, 0 is substituted for a variable p (step 604 in FIG. 10), and the first skin color total number of pixels maxCn [i], which is the first characteristic amount, is reduced to a smaller empirical value maxC1.
It is determined whether it is smaller (step 60 in FIG. 10).
5) If it is small, add 0 to the variable p (step 606 in FIG. 10), and if it is equal to or greater than maxC1, a large experience value ma
It is determined whether it is smaller than xC2 (step 607 in FIG. 10). If it is smaller, 1 is added to the variable p (step 608 in FIG. 10). If it is not smaller than maxC2, 2 is added to the variable p (FIG. 10 Step 609).

【0074】すなわち、エリア内の肌色総画素数は、
高、中、低に分け、大きいほどポイントを高く設定す
る。なお、変数pに0を加算して更新すること(実質的
に何も加算しないこと)を低レベルのポイント加算、p
に1を加算して更新することを中レベルのポイント加
算、pに2を加算して更新することを高レベルのポイン
ト加算ともいう。
That is, the total number of skin color pixels in the area is
It is divided into high, medium and low, and the larger the point, the higher the point. It should be noted that adding 0 to the variable p and updating (substantially nothing is added) is a low-level point addition, p
Updating by adding 1 to p is also referred to as medium-level point addition, and updating by adding 2 to p is also referred to as high-level point addition.

【0075】続いて、上記の特徴量中の第2の特徴量で
ある縦方向の情報中の長さhlengthと、第3の特
徴量である横方向の情報中の長さwlengthとから
縦横比の判断を行うため、縦の長さhlengthが、
横の長さwlengthに大なる経験値hWlper1
倍(hwlper1は1.0以上)した値以上であるか
どうか判定し(図10のステップ610)、以上であれ
ば変数pを2だけ加算し(図10のステップ611)、
未満であれば横の長さwlengthに小なる経験値h
wlper2倍(hwlper2 は1.0以上)した
値以上であるかどうか判定し(図10のステップ61
2)、以上であれば変数pを1だけ加算し(図10のス
テップ613)、未満であれば変数pの加算はしない
(図10のステップ614)。経験値hwlper1と
hwlper2を1.0以上としたのは、髪を含めて横
の方が長い顔は少ないという性質からその場合は低とな
るようにするためである。
Subsequently, an aspect ratio is obtained from the length hlength in the vertical information, which is the second characteristic amount, and the length wlength in the horizontal information, which is the third characteristic amount, in the above characteristic amounts. Is determined, the vertical length hlength is
Experience value hWper1 which is large in horizontal length wlength
It is determined whether or not the value is twice or more (hwlper1 is 1.0 or more) (step 610 in FIG. 10), and if it is, the variable p is added by 2 (step 611 in FIG. 10).
If less than, the experience value h that is smaller than the horizontal length wlength
It is determined whether or not the value is equal to or greater than wlper2 times (hwlper2 is 1.0 or more) (step 61 in FIG. 10).
2) If this is the case, the variable p is added by 1 (step 613 in FIG. 10), and if it is less, the variable p is not added (step 614 in FIG. 10). The reason why the empirical values hwlper1 and hwlper2 are set to 1.0 or more is to lower the value in that case because of the fact that there are few faces that are longer on the side including the hair.

【0076】続いて、第2の特徴量中の左肩のy座標h
startと第3の特徴量中の左肩のx座標wstar
tを見て、被写体は通常中心に撮影される性質から、中
心に近いほど高、端に近いほど低に分ける(図11のス
テップ615〜619)。すなわち、wstart>l
im0xs又はhstart>lim0ys又はxen
d<lim0xe又はyend<lim0yeかどうか
判定し(図11のステップ615)、これらの不等式の
いずれかを満足するときは中心より大きく離れていると
判断して変数pの加算は行わない(図11のステップ6
16)。ここで、lim0xs、lim0ys、lim
0xe及びlim0yeは経験値である。
Subsequently, the y coordinate h of the left shoulder in the second feature value
start and x coordinate wstar of the left shoulder in the third feature value
At t, the subject is normally divided into a higher position closer to the center and a lower position closer to the end from the nature of being normally photographed at the center (steps 615 to 619 in FIG. 11). That is, wstart> l
im0xs or hstart> lim0ys or xen
It is determined whether d <lim0xe or yend <lim0ye (step 615 in FIG. 11). If any of these inequalities is satisfied, it is determined that the distance is farther from the center, and the variable p is not added (FIG. 11). Step 6 of
16). Where lim0xs, lim0ys, lim
0xe and lim0ye are empirical values.

【0077】ステップ615の不等式をすべて満足しな
いときは、更にwstart>lim1xs又はhst
art>lim1ys又はxend<lim1xe又は
yend<lim1yeかどうか判定し(図11のステ
ップ617)、これらの不等式のいずれかを満足すると
きは中心より比較的離れていると判断して変数pに1だ
け加算し(図11のステップ618)、これらの不等式
のすべてを満足しないときは、中心に近いと判断して変
数pを2だけインクリメントする(図11のステップ6
19)。ここで、lim1xs、lim1ys、lim
1xe及びlim1yeは経験値である。また、xen
d=xstart+wlength、yend=yst
art+hlengthである。
If all of the inequalities in step 615 are not satisfied, wstart> lim1xs or hst
It is determined whether art> lim1ys or xend <lim1xe or yend <lim1ye (step 617 in FIG. 11). If any of these inequalities is satisfied, it is determined that the distance is relatively far from the center, and only 1 is set for the variable p. When all of these inequalities are not satisfied (step 618 in FIG. 11), it is determined that the distance is close to the center, and the variable p is incremented by 2 (step 6 in FIG. 11).
19). Where lim1xs, lim1ys, lim
1xe and lim1ye are empirical values. Also, xen
d = xstart + length, yend = yst
art + hlength.

【0078】次に、第2の特徴量の縦方向の情報のうち
分割枠内の画素数に対する髪の画素数の割合のうち、図
15(A)に示した髪に相当する分割領域IIの配列hh
airC[3]が0かどうか判定し(図11のステップ
620)、0であれば変数pの値をそのままとし(図1
1のステップ621)、0でなければ経験値hhair
C1より小であるかどうか判定し(図11のステップ6
22)、小であれば変数pを1加算して更新し(図11
のステップ623)、hhairC1以上であれば変数
pを2加算して更新する(図11のステップ624)。
このように、髪にあたる画素が少ないほどポイント(変
数pの値)が低くされる。
Next, of the ratio of the number of hair pixels to the number of pixels in the divided frame in the vertical information of the second feature amount, the ratio of the divided region II corresponding to the hair shown in FIG. Array hh
It is determined whether or not airC [3] is 0 (step 620 in FIG. 11). If it is 0, the value of the variable p is left as it is (FIG. 1).
Step 621 of 1; if not 0, experience value hhair
It is determined whether it is smaller than C1 (step 6 in FIG. 11).
22), if small, add 1 to variable p and update (FIG. 11)
Step 623), if the value is equal to or greater than hairC1, the variable p is incremented by 2 and updated (step 624 in FIG. 11).
In this way, the point (the value of the variable p) decreases as the number of pixels corresponding to the hair decreases.

【0079】続いて、第2の特徴量の縦方向の情報のう
ち分割枠内の画素数に対する肌の画素数の割合に関し、
図15(A)に示した下の3つの分割枠(ブロック)の
肌の画素数hfaceC[0]〜hfaceC[2]の
うち、1ブロックでも全く肌の画素がない場合は変数p
の値を低くし、また3ブロックhfaceC[0]〜h
faceC[2]の各画素数すべてが同じ値ならば丸み
がないと判断して変数pの値を低くし、更に4つのブロ
ックのうち最も上のブロックの肌の画素数hfaceC
[3]が他の3つのブロックの肌の画素数よりも多い場
合は、最も上のブロックは髪のはずであるから変数pの
値を低くする(図11のステップ625、626)。
Next, regarding the ratio of the number of skin pixels to the number of pixels in the division frame in the vertical information of the second feature amount,
If the number of skin pixels hfaceC [0] to hfaceC [2] in the lower three divided frames (blocks) shown in FIG.
And the three blocks hfaceC [0] to hfaceC [0] to h
If all the numbers of pixels in faceC [2] are the same value, it is determined that there is no roundness, the value of the variable p is reduced, and the number of skin pixels hfaceC of the uppermost block of the four blocks is further reduced.
If [3] is larger than the number of skin pixels in the other three blocks, the value of the variable p is reduced because the top block should be hair (steps 625 and 626 in FIG. 11).

【0080】上記のいずれでもなく、下の3ブロックの
肌の画素数hfaceC[0]〜hfaceC[2]の
うち、最も下のブロックの肌の画素数hfaceC
[0]が最大のときは、顔である確率が低いと判断して
変数pの値を中、すなわち1加算更新する(図11のス
テップ627、628)。上記のいずれの条件を満足し
ないときは、顔である確率が高いと判断して変数pの値
を大、すなわち2加算更新する(図11のステップ62
9)。
None of the above, the number of skin pixels hfaceC of the lowest block among the number of skin pixels hfaceC [0] to hfaceC [2] of the lower three blocks
When [0] is the maximum, it is determined that the probability of a face is low, and the value of the variable p is updated to medium, that is, 1 is added (steps 627 and 628 in FIG. 11). If any of the above conditions is not satisfied, it is determined that the probability that the face is a face is high, and the value of the variable p is increased, that is, 2 is added and updated (step 62 in FIG. 11).
9).

【0081】続いて、第2の特徴量の縦方向の情報のう
ち分割枠内の画素数に対する肌色の輝度平均値のうち、
図15(A)に示した下の3ブロックの輝度平均値hf
aceY[0]〜hfaceY[3]で判断し、これら
のブロックの輝度平均値hfaceY[0]〜hfac
eY[3]の一つでも0であれば変数pの値の更新はせ
ず、また肌には様々の輝度が存在するという性質から輝
度の最大値と最小値の差が経験値hfaceY1より小
さいときも変数pの値をそのままとし、更に顔の輝度で
影となる一番下のブロックの輝度平均値hfaceY
[0]が一番高い確率は低いのでその場合も変数pの値
の更新はしない(図12のステップ630、631)。
ステップ330の条件を満足しないときは、顔である確
率が高いと判断して変数pの値を大、すなわち2加算更
新する(図12のステップ632)。
Subsequently, in the vertical information of the second feature amount, of the skin color luminance average values with respect to the number of pixels in the divided frame,
The average luminance value hf of the lower three blocks shown in FIG.
Judgment is made based on aceY [0] to hfaceY [3], and the luminance average values hfaceY [0] to hfac of these blocks are determined.
If at least one of eY [3] is 0, the value of the variable p is not updated, and the difference between the maximum value and the minimum value of the luminance is smaller than the empirical value hfaceY1 due to the nature of various luminances on the skin. Also at this time, the value of the variable p is kept as it is, and the average luminance value hfaceY
Since [0] has the lowest probability, the value of the variable p is not updated in this case as well (steps 630 and 631 in FIG. 12).
When the condition of step 330 is not satisfied, it is determined that the probability of the face is high, and the value of the variable p is increased, that is, 2 is added and updated (step 632 in FIG. 12).

【0082】次に、第3の特徴量の横方向の情報のう
ち、図15(B)に示した4つの分割枠(ブロック)の
髪の画素数のwhairC[0]〜whairC[3]
のうち、2ブロック以上0であるかどうか判定し(図1
2のステップ633)、2ブロック以上0であれば変数
pの値をそのままとし(図12のステップ634)、0
でなければwhairC[0]〜whairC[3]の
うち、1ブロックの画素数だけが0であれば、変数pを
1加算して更新し(図12のステップ636)、すべて
のブロックの髪の画素数が0でなければ変数pを2加算
して更新する(図12のステップ637)。このよう
に、髪にあたる画素が少ないほどポイント(変数pの
値)が低くされる。
Next, of the horizontal information of the third feature, whairC [0] to whairC [3] of the number of hair pixels of the four divided frames (blocks) shown in FIG.
Of two or more blocks are determined to be 0 (FIG. 1
(Step 633 of FIG. 12) If the value is 0 for two blocks or more, the value of the variable p is left as it is (Step 634 of FIG. 12).
If not, if only the number of pixels in one block is 0 among wairC [0] to wairC [3], the variable p is incremented by 1 and updated (step 636 in FIG. 12), and the hairs of all the blocks are updated. If the number of pixels is not 0, the variable p is updated by adding 2 (step 637 in FIG. 12). In this way, the point (the value of the variable p) decreases as the number of pixels corresponding to the hair decreases.

【0083】次に、第3の特徴量の横方向の情報のう
ち、図15(B)に示した4つの分割枠(ブロック)そ
れぞれの肌の画素数wfaceC[0]〜wfaceC
[3]のいずれかが0であれば、変数pの値をそのまま
とし(ポイントを低くし)、またそれらの画素数がすべ
て同一であれば丸みがないと判断して、変数pの値をそ
のままとし(ポイントを低くし)、更に、右端又は左端
の肌の画素数wfaceC[0]、wfaceC[3]
のいずれかが最大で、かつ、最大値と最小値の差が所定
の経験値wfaceC1以上であるときも、丸みがない
と判断して変数pの値をそのままとする(図12のステ
ップ638、639)。
Next, of the horizontal information of the third feature value, the number of skin pixels wfaceC [0] to wfaceC in each of the four divided frames (blocks) shown in FIG.
If any of [3] is 0, the value of the variable p is left as it is (point is lowered), and if all the pixels are the same, it is determined that there is no rounding, and the value of the variable p is changed. Leave as it is (decrease the point), and further, the number of pixels wfaceC [0] and wfaceC [3] of the skin at the right end or the left end
Is larger than the maximum value and the difference between the maximum value and the minimum value is equal to or more than the predetermined empirical value wfaceC1, it is determined that there is no roundness, and the value of the variable p is left as it is (step 638 in FIG. 12). 639).

【0084】また、横分割したときの4つの分割枠(ブ
ロック)のうち、左端のブロックの肌の画素数wfac
eC[0]と右端のブロックの肌の画素数wfaceC
[3]のいずれか最大値を示し、かつ、最大値と最小値
の差が所定の経験値wfaceC1未満であれば、変数
pの値に1加算し、ポイントを中とする(図12のステ
ップ640、641)。ステップ340の条件を満たさ
ないときは、顔エリアである確率が高いと判断して変数
pの値に2加算し、ポイントを高くする(図12のステ
ップ642)。
Also, of the four divided frames (blocks) obtained by horizontal division, the number of skin pixels wfac of the leftmost block is shown.
eC [0] and the number of skin pixels wfaceC in the rightmost block
If any of [3] indicates the maximum value and the difference between the maximum value and the minimum value is less than the predetermined experience value wfaceC1, 1 is added to the value of the variable p and the point is set to the middle (step in FIG. 12). 640, 641). If the condition of step 340 is not satisfied, it is determined that the probability of the face area is high, and 2 is added to the value of the variable p to increase the point (step 642 in FIG. 12).

【0085】次に、第3の特徴量の横方向の情報のう
ち、図15(B)に示した4つの分割枠(ブロック)そ
れぞれの肌色の輝度平均値wfaceY[0]〜wfa
ceY[3]のうち、いずれか一のブロックの肌色の輝
度平均値が0である場合、あるいはそれらの最大値と最
小値との差が予め定めた経験値wfaceY1以下であ
る場合は、丸みがないと判断して変数pの値をそのまま
とし、ポイントを低くする(図12のステップ643、
644)。肌には様々の輝度(所定値以上の輝度差)が
存在することを考慮したものである。
Next, of the horizontal information of the third feature value, the average luminance values wfaceY [0] to wfa of the skin colors of the four divided frames (blocks) shown in FIG.
If the average luminance value of the skin color of any one block of ceY [3] is 0, or if the difference between the maximum value and the minimum value is less than or equal to a predetermined empirical value wfaceY1, the roundness is reduced. It is determined that there is no variable, the value of the variable p is left as it is, and the point is lowered (step 643 in FIG. 12,
644). Consideration is given to the fact that various luminances (luminance differences equal to or more than a predetermined value) exist on the skin.

【0086】ステップ343の条件が満足されないとき
は、左端の肌の輝度平均値wfaceY[0]と右端の
肌の輝度平均値wfaceY[3]のいずれかが最大で
あるかどうか判定し(図12のステップ645)、この
条件を満たすときは変数pに1加算してポイントを中と
し(図12のステップ646)、この条件を満たさない
ときは顔エリアの確率が高いと判断して変数pに2加算
してポイントを高くする(図12のステップ647)。
If the condition of step 343 is not satisfied, it is determined whether any of the average brightness wfaceY [0] of the leftmost skin and the average brightness wfaceY [3] of the rightmost skin is the maximum (FIG. 12). Step 645), if this condition is satisfied, 1 is added to the variable p to set the point to medium (step 646 in FIG. 12). If this condition is not satisfied, it is determined that the probability of the face area is high, and The point is increased by adding 2 (step 647 in FIG. 12).

【0087】続いて、変数pの値をその時点のラベル番
号iの総ポイント数point[i]に代入する(図1
3のステップ648)。抽出されたエリア数nが”5”
であり、ラベル番号が0〜4であるときは、上記のステ
ップ604〜647の処理が5回繰り返され、総ポイン
ト数point[0]〜point[4]が得られる。
Subsequently, the value of the variable p is substituted into the total point number point [i] of the label number i at that time (FIG. 1).
3 step 648). The number n of extracted areas is “5”
If the label number is 0 to 4, the above steps 604 to 647 are repeated five times to obtain the total point number point [0] to point [4].

【0088】続いて、これらの総ポイント数point
[0]〜point[4]の中の最大値を顔エリアと判
断してレジスタmaxcountに格納し、かつ、顔エ
リアと判断したエリアに対応するラベル番号をレジスタ
maxnumに格納する(図13のステップ649)。
次に、逆光フラグrefFlagの値が”1”かどうか
判定し(図13のステップ650)、”1”であるとき
は顔エリアと判断したエリアの総ポイント数maxco
untが所定の下限値refplimよりも小さいかど
うか判定し(図13のステップ651)、小さいときは
顔エリアが見付からなかったと判断する(図13のステ
ップ652)。
Subsequently, the total point number point
The maximum value among [0] to point [4] is determined as the face area and stored in the register maxcount, and the label number corresponding to the area determined as the face area is stored in the register maxnum (step in FIG. 13). 649).
Next, it is determined whether or not the value of the backlight flag refFlag is “1” (step 650 in FIG. 13). If it is “1”, the total number of points maxco of the area determined to be the face area is determined.
It is determined whether or not unt is smaller than a predetermined lower limit value refprim (step 651 in FIG. 13). If it is smaller, it is determined that the face area has not been found (step 652 in FIG. 13).

【0089】ステップ650で逆光フラグrefFla
gの値が”0”と判定されたときは、顔エリアと判断し
た一エリアにおける肌色の総画素数maxCn[max
num]が予め定めた経験値maxCn1未満であるか
どうか判定し(図13のステップ653)、maxCn
1以上のときは、顔エリアと判断したエリアの総ポイン
ト数maxcountが予め設定した下限値poimt
lim未満であるかどうか判定する(図13のステップ
654)。
In step 650, the backlight flag refFla
When the value of g is determined to be “0”, the total number of skin color pixels maxCn [max] in one area determined to be a face area
num] is smaller than a predetermined experience value maxCn1 (step 653 in FIG. 13).
When it is 1 or more, the total point number maxcount of the area determined as the face area is set to the preset lower limit value poimt
It is determined whether it is less than lim (step 654 in FIG. 13).

【0090】肌色の総画素数maxCn[maxnu
m]が経験値maxCn1未満である場合、あるいは、
顔エリアと判断したエリアの総ポイント数maxcou
ntが下限値poimtlim未満である場合は、顔エ
リアが存在しないと判断する(図13のステップ65
2)。誤認識を減らすためである。
The total number of skin color pixels maxCn [maxnu
m] is less than the experience value maxCn1, or
The total number of points maxcou in the area determined to be the face area
If nt is less than the lower limit poimtlim, it is determined that no face area exists (step 65 in FIG. 13).
2). This is to reduce false recognition.

【0091】maxCn[maxnum]≧maxCn
1で、かつ、maxcount≧poimtlimの場
合や、refFlag=1で、かつ、maxcount
≧refplimのときには、レジスタmaxnumに
格納したラベル番号に対応したエリアを顔エリアと確定
する(図13のステップ655)。また、ステップ65
1でmaxcount≧refplimと判定されたと
きも、レジスタmaxnumに格納したラベル番号に対
応したエリアを顔エリアと確定する(図13のステップ
655)。前記の下限値refplimは経験値で、p
ointlimよりも小さな値に設定しておくことによ
り、refFlag=0の場合の判断よりも弱い規制と
なって、顔エリアが暗くても肌色の認識率が高くなる。
MaxCn [maxnum] ≧ maxCn
1 and maxcount ≧ poimtlim, or refFlag = 1 and maxcount
If ≧ refprim, the area corresponding to the label number stored in the register maxnum is determined as the face area (step 655 in FIG. 13). Step 65
Also when it is determined that maxcount ≧ refprimm in 1, the area corresponding to the label number stored in the register maxnum is determined as the face area (step 655 in FIG. 13). The lower limit refprim is an empirical value, p
By setting the value to be smaller than the point limit, the regulation is weaker than the determination when refFlag = 0, and the skin color recognition rate is increased even when the face area is dark.

【0092】以上の図9〜図15と共に説明した顔部分
認識処理が終ると、続いて、階調補正曲線修正部30に
より階調補正曲線レベル修正処理が行われる(図1のス
テップ116)。この階調補正曲線レベル修正処理につ
いて、図16のフローチャートと共に更に詳細に説明す
る。まず、先に決定している顔エリアの平均輝度Yav
eを取り込み(図16のステップ701)、続いて前処
理で得た変数sectlow、secthighの各値
と、UP又はDOWNのレベルを取り込み(図16のス
テップ702)、eectlowとDOWNのレベルは
マイナスの値とし、secthighとUPのレベルを
プラスの値として、これらを合成した値を前処理の総合
レベルとしてレジスタcurlevに格納する(図16
のステップ703)。
When the face part recognition process described above with reference to FIGS. 9 to 15 is completed, the tone correction curve correction unit 30 performs a tone correction curve level correction process (step 116 in FIG. 1). This gradation correction curve level correction processing will be described in more detail with reference to the flowchart of FIG. First, the average luminance Yav of the previously determined face area
e (step 701 in FIG. 16), and subsequently the values of the variables seclow and sechigh obtained in the pre-processing and the level of UP or DOWN (step 702 in FIG. 16). As a value, the levels of sechigh and UP are set as positive values, and a value obtained by combining these is stored in the register curlev as a total level of preprocessing (FIG.
Step 703).

【0093】続いて、顔エリアの平均輝度Yaveを、
予め設定した目標輝度Ytag1とYtag2とそれぞ
れ大小比較する(図16のステップ704、705)。
Ytag2<YaveあるいはYave<Ytag1の
ときは、YaveがYtag1〜Ytag2の範囲内に
入るレベルlevを予測する(図16のステップ70
6)。例えば、前記ステップ104、106又は107
で作成したコントラスト傾きや曲線レベルをいくつにす
れば、顔エリアの平均輝度Yaveが目標輝度Ytag
1〜Ytag2の範囲内に入るかを予測する。
Subsequently, the average luminance Yave of the face area is calculated as follows:
The target luminances Ytag1 and Ytag2 set in advance are compared with each other in magnitude (steps 704 and 705 in FIG. 16).
When Ytag2 <Yave or Yave <Ytag1, the level lev at which Yave falls within the range of Ytag1 to Ytag2 is predicted (step 70 in FIG. 16).
6). For example, the steps 104, 106 or 107
What is the contrast gradient or curve level created in the above, the average luminance Yave of the face area can be reduced to the target luminance Ytag.
It is predicted whether it falls within the range of 1 to Ytag2.

【0094】通常は、Ytag1〜Ytag2の範囲内
に入るレベルと、前記ステップ104、106又は10
7で作成するコントラスト傾きや曲線レベルの中間レベ
ルと予測する。強い逆光の場合は、Ytag1〜Yta
g2の範囲内に入るレベルそのものと予測する。1レベ
ル上がると輝度がどの位アップするかを経験で求めてお
くことで、およその予測ができる。
Normally, the level falling within the range of Ytag1 to Ytag2 and the level of step 104, 106 or 10
It is predicted that the contrast gradient and the curve level are intermediate levels created in step 7. In the case of strong backlight, Ytag1 to Ytag
It is predicted that the level itself falls within the range of g2. It is possible to roughly estimate the amount by increasing the luminance by one level by experience.

【0095】続いて、本出願人が先に提案した前記自動
階調補正方法と同様にして求めた総合レベルcurle
vと肌色を中心として求めた総合レベルlevを比較す
るために、それらの差分値を変数paraに代入する
(図16のステップ708)。次に、refFlagの
値が”0”かどうか判定し(図16のステップ70
9)、refFlag=0のときは通常時なのでpar
a<0のときはプラス1、para>0のときはマイナ
ス1というように、1レベル分だけおさえた後(図16
のステップ710)、前処理で得たsectlow、s
ecthigh、UP又はDOWNのLevelを、総
合的に変数paraの分だけ修正する(図16のステッ
プ711)。このようにすることで、完全に肌色中心の
レベルではなく、従来方法との中間くらいの補正曲線が
得られる。
Subsequently, the integrated level curle obtained in the same manner as the above-mentioned automatic gradation correction method proposed by the present applicant.
In order to compare v with the total level lev obtained centering on the flesh color, those difference values are substituted into a variable para (step 708 in FIG. 16). Next, it is determined whether the value of refFlag is “0” (step 70 in FIG. 16).
9) When refFlag = 0, it is normal time and par
After holding down by one level, such as plus 1 when a <0 and minus 1 when para> 0 (FIG. 16)
Step 710), seclow, s obtained in the preprocessing
The level of the value of "high", "UP" or "DOWN" is comprehensively corrected by the variable "para" (step 711 in FIG. 16). In this way, a correction curve that is not completely at the level of the skin color center but is about the middle of the conventional method can be obtained.

【0096】また、ステップ709でrefFlag=
1と判定されたときは、強い逆光であるので、完全に肌
色中心のレベルとなるように、sectlow、sec
thigh、UP又はDOWNのLevelを、総合的
に変数paraの値をそのまま用いて修正する(図16
のステップ711)。para=0のときは修正はしな
い。なお、Ytag2≧Yave≧Ytag1のとき
は、修正の必要がないので、変数paraの値は0とさ
れ(図16のステップ707)、このときはlevel
の修正は行わない。階調補正曲線修正部30は、このよ
うにして得られたsectlow、secthigh、
UP又はDOWNのLevelを出力する(図16のス
テップ712)。
In step 709, refFlag =
When it is determined to be 1, it is a strong backlight, so that seclow, sec.
The level of “high”, “UP” or “DOWN” is comprehensively corrected using the value of the variable “para” as it is (FIG. 16).
Step 711). No correction is made when para = 0. Note that when Ytag2 ≧ Yave ≧ Ytag1, there is no need for correction, so the value of the variable para is set to 0 (step 707 in FIG. 16), and in this case, level
Is not modified. The tone correction curve correction unit 30 outputs the thus obtained seclow, sechigh,
The UP or DOWN level is output (step 712 in FIG. 16).

【0097】このようにして修正された階調補正曲線の
Levelに基づいて、オーバー、アンダー強度判断部
33により、各種曲線データ格納部32に格納されてい
る曲線データ*Up[1]〜〔5]の中のLevelの
もの*Up[Level]が補正曲線データとして選択
され、その補正曲線データと、前記*Contに格納さ
れているコントラスト直線データとが、コントラスト直
線と曲線データ合成処理部26で合成されて階調補正曲
線として階調補正曲線データ格納部37に格納される
(図1のステップ117)。
Based on the Level of the gradation correction curve thus corrected, the over / under intensity judging section 33 uses the curve data * Up [1] to [5] stored in the various curve data storage sections 32. * Up [Level] of Level in [] is selected as the correction curve data, and the correction curve data and the contrast straight line data stored in the * Cont are converted by the contrast straight line and curve data synthesis processing unit 26. The images are combined and stored as a gradation correction curve in the gradation correction curve data storage unit 37 (step 117 in FIG. 1).

【0098】以上のようにして階調補正曲線が決定した
後、階調補正曲線修正部39は、画像サンプリングデー
タ(Y,U,V)をもとに階調補正曲線を修正する。こ
の階調補正曲線の修正動作について、図17のフローチ
ャートと共に詳細に説明する。画像は(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 correction section 39 corrects the gradation correction curve 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.

【0099】階調補正曲線修正部39は、まず、階調補
正曲線データ格納部37から階調補正曲線(Y,Y’)
のデータを取り込んだ後(図17のステップ801)、
色差信号U、VをY’/Yした場合にいくつ以上、以下
でオーバーフローするかを予め算出しておく(図17の
ステップ802)。色差信号U、Vは−128から12
7の範囲で変化する。また、入力輝度信号Yに対する制
限値127*Y/Y’と−128*Y/Y’を予め計算
しておく。輝度信号Yは0から255の値である。この
準備をしておいて画像サンプリングデータ(Y,U,
V)をチェックする。
The tone correction curve correcting section 39 first stores the tone correction curve (Y, Y ') from the tone correction curve data storage section 37.
(Step 801 in FIG. 17)
If the color difference signals U and V are Y '/ Y, the number of overflows and the number of overflows are calculated in advance (step 802 in FIG. 17). The color difference signals U and V are from -128 to 12
7 range. 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,
Check V).

【0100】続いて、サンプリングデータ数は常に同じ
にしておいてU,Vのオーバーフローする画素数を、色
差信号オーバーフロー検出部38でカウントして変数C
ountに格納する(図17のステップ803、80
4)。続いて、上記の変数Countとしきい値UVL
imitとを比較し(図17のステップ805)、Co
unt<UVLimitならば階調補正曲線をそのまま
用いる(図17のステップ806)。そうでない場合に
はCountの値に応じてLevelを下げた後、*U
p[Level]と*Contを合成して改めて補正曲
線とする(図17のステップ807、808)。
Subsequently, the number of pixels in which U and V overflow is counted by the color difference signal overflow detection unit 38 while the number of sampling data is always the same, and a variable C is obtained.
(steps 803 and 80 in FIG. 17).
4). Subsequently, the above-mentioned variable Count and threshold value UVL
compare with the limit (Step 805 in FIG. 17).
If unt <UVLimit, the tone correction curve is used as it is (step 806 in FIG. 17). Otherwise, after lowering the Level according to the value of Count, * U
p [Level] and * Cont are combined to form a new correction curve (steps 807 and 808 in FIG. 17).

【0101】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.

【0102】例えば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.

【0103】階調補正曲線データ格納部37のデータを
修正する場合のレベルの下げ方は、前記Countの値
に応じてLevelを下げるが、その目的のLevel
の値になるように、まずコントラスト直線を決めるse
cthighが0になるまで下げ、それでも目的のLe
velの値にまで下がらないときには、各種曲線データ
格納部32から得られる各種曲線データのうち選択して
いた曲線データよりもレベルの低い曲線データを選択す
る。この曲線データとコントラストの直線データを合成
して補正曲線データを生成する。
When the data in the gradation correction curve data storage unit 37 is corrected, the level is lowered in accordance with 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.

【0104】生成された補正曲線データ、すなわち修正
後階調補正曲線809は、画像メモリ21からの画像デ
ータを補正し、その補正後の画像データが画像メモリ2
1に再び格納される。この画像は(Y,U,V)の3次
元なのでY成分のみから決定した補正曲線は、この処理
で修正処理すればバランスの良い画像が得られる。
The generated correction curve data, that is, the corrected gradation correction curve 809 corrects the image data from the image memory 21, and the corrected image data is stored in the image memory 2.
1 is stored again. Since this image is three-dimensional (Y, U, V), a correction curve determined from only the Y component can be corrected to obtain a well-balanced image.

【0105】なお、本発明は上記の実施の形態に限定さ
れるものではなく、例えば入力輝度レベル軸を4以上の
n等分、補正レベルを1以上のm段階とすることができ
る。また、上記の実施の形態では画像サンプリング処理
部22から画像処理部40までのブロックの処理は、図
18のビデオプリンタ16内のCPU17のソフトウェ
アで行うように説明したが、パソコン14内のCPU1
5のソフトウェアで行うようにしてもよい。あるいは、
図2の輝度ヒストグラム特徴量算出部26、輝度ヒスト
グラム特徴量格納部27、強い逆光検出部28、顔部分
認識処理部29、階調補正曲線修正部30、露光オーバ
ー、アンダー検出部31、コントラスト傾き決定部3
2、コントラストデータ作成部35、オーバー、アンダ
ー強度判断部33、各種曲線データ格納部34、コント
ラスト直線と曲線データ合成処理部36、色差信号オー
バーフロー検出部38及び階調補正曲線修正部39の各
処理をビデオプリンタ16内のCPU17のソフトウェ
アで行い、それ以外のブロックをハードウェアで構成す
るようにしてもよい。
The present invention is not limited to the above embodiment. For example, the input brightness 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 from the image sampling processing unit 22 to the image processing unit 40 has been described as being performed by the software of the CPU 17 in the video printer 16 in FIG.
5 may be performed. Or,
The brightness histogram feature value calculation unit 26, the brightness histogram feature value storage unit 27, the strong backlight detection unit 28, the face part recognition processing unit 29, the gradation correction curve correction unit 30, the overexposure and underdetection unit 31, the contrast gradient in FIG. Decision part 3
2. Each processing of the contrast data creation unit 35, the over / under intensity determination unit 33, various curve data storage units 34, the contrast straight line and curve data synthesis processing unit 36, the color difference signal overflow detection unit 38, and the gradation correction curve correction unit 39 May be performed by software of the CPU 17 in the video printer 16, and the other blocks may be configured by hardware.

【0106】[0106]

【発明の効果】以上説明したように、本発明によれば、
入力カラー画像データの輝度ヒストグラムをa等分に分
割して、その曲線のおよその形を知り、その形に応じて
コントラストの傾き情報を算出すると共に、階調補正曲
線を肌色を考慮した修正を行うことで曲線データを最適
なものに選択した後、それらを合成して階調補正曲線デ
ータをソフトウェア処理により生成するようにしたた
め、累積輝度分布をそのまま用いた場合よりも、自然で
しかも肌色の認識率の向上した階調を得ることができ
る。
As described above, according to the present invention,
Divide the luminance histogram of the input color image data into equal parts a, know the approximate shape of the curve, calculate the slope information of the contrast according to the shape, and modify the gradation correction curve in consideration of the skin color. After selecting the optimal curve data by performing this, they are combined to generate gradation correction curve data by software processing, so that it is more natural and flesh color than when using the accumulated luminance distribution as it is. A gradation with an improved recognition rate can be obtained.

【0107】また、本発明によれば、通常時と強い逆光
時の両方で肌色を考慮した階調補正曲線の修正をするよ
うにしたため、通常の判断では厳しい判断で顔が存在し
ないと判断される暗い所でも顔を認識させることがで
き、また、強い逆光の場合は肌色認識により得たレベル
中心の補正としたため、従来の自動階調補正よりも逆光
に強く顔の輝度レベルが良好な自動階調補正ができる。
Further, according to the present invention, the tone correction curve is corrected in consideration of the skin color in both the normal state and the strong backlight, so that the face is not determined to be a strict decision in the normal decision. Faces can be recognized even in dark places, and in the case of strong backlighting, the correction is performed at the level center obtained by skin color recognition. Tone correction can be performed.

【0108】更に、本発明によれば、判断時にニューラ
ルネットワークといった高度な技術を用いないため、複
雑な計算が不要であり、コストの削減と高速化を図るこ
とができる。また、ソフトウェア処理であるので、画像
データの変更などに容易に対応することができる。
Further, according to the present invention, since a sophisticated technique such as a neural network is not used at the time of judgment, a complicated calculation is not required, and the cost can be reduced and the speed can be increased. Further, since the processing is software processing, it is possible to easily cope with a change in image data.

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

【図1】本発明方法の一実施の形態の要部のフローチャ
ートである。
FIG. 1 is a flowchart of a main part of an embodiment of the method of the present invention.

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

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

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

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

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

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

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

【図9】図1中の顔部分認識処理のうち肌色画素認識処
理の詳細を示すフローチャートである。
FIG. 9 is a flowchart showing details of a skin color pixel recognition process in the face portion recognition process in FIG. 1;

【図10】図1中の顔部分認識処理のうち特徴量分析処
理の詳細を示すフローチャート(その1)である。
FIG. 10 is a flowchart (part 1) showing details of a feature value analysis process in the face portion recognition process in FIG. 1;

【図11】図1中の顔部分認識処理のうち特徴量分析処
理の詳細を示すフローチャート(その2)である。
FIG. 11 is a flowchart (part 2) showing details of a feature value analysis process in the face portion recognition process in FIG. 1;

【図12】図1中の顔部分認識処理のうち特徴量分析処
理の詳細を示すフローチャート(その3)である。
FIG. 12 is a flowchart (part 3) showing details of a feature amount analysis process in the face portion recognition process in FIG. 1;

【図13】図1中の顔部分認識処理のうち特徴量分析処
理の詳細を示すフローチャート(その4)である。
FIG. 13 is a flowchart (part 4) showing details of a feature value analysis process in the face portion recognition process in FIG. 1;

【図14】図1中の顔部分認識処理における直方体領域
の一例の説明図である。
14 is an explanatory diagram of an example of a rectangular parallelepiped region in the face portion recognition processing in FIG.

【図15】図1中の顔部分認識処理における縦分割、横
分割の様子の説明図である。
FIG. 15 is an explanatory diagram of a vertical division and a horizontal division in the face part recognition processing in FIG. 1;

【図16】図1中の階調補正曲線レベル修正処理の詳細
を示すフローチャートである。
FIG. 16 is a flowchart illustrating details of a tone correction curve level correction process in FIG. 1;

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

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

【符号の説明】 14 パーソナルコンピュータ(パソコン) 15、17 中央処理装置(CPU) 16 ビデオプリンタ 18、21 画像メモリ 22 画像サンプリング処理部 23 画像サンプリングデータ格納部 24 輝度ヒストグラム作成部 25 輝度ヒストグラム格納部 26 輝度ヒストグラム特徴量算出部 27 輝度ヒストグラム特徴量格納部 28 強い逆光検出部 29 顔部分認識処理部 30 階調補正曲線修正部 31 露光オーバー、アンダー検出部 32 コントラスト傾き決定部 33 オーバー、アンダー強度判断部 34 各種曲線データ格納部 35 コントラストデータ作成部 36 コントラスト直線と曲線データ合成処理部 37 階調補正曲線データ格納部 38 色差信号オーバーフロー検出部 39 階調補正曲線修正部 40 画像処理部 104 アンダー前処理ステップ 106 オーバー前処理ステップ 107 リニア前処理ステップ 115 顔部分認識処理ステップ 116 階調補正曲線レベル修正処理ステップ[Description of Signs] 14 Personal Computer (PC) 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 Brightness histogram feature value calculation unit 27 Brightness histogram feature value storage unit 28 Strong backlight detection unit 29 Face part recognition processing unit 30 Tone correction curve correction unit 31 Overexposure / under detection unit 32 Contrast inclination determination unit 33 Over / under intensity judgment unit 34 Various Curve Data Storage Unit 35 Contrast Data Creation Unit 36 Contrast Straight Line and Curve Data Synthesis Unit 37 Tone Correction Curve Data Storage Unit 38 Color Difference Signal Overflow Detection Unit 39 Tone Correction Curve Correction Unit 40 Image Processing Unit 104 under preprocessing step 106 over preprocessing step 107 linear preprocessing step 115 face part recognition processing step 116 gradation correction curve level correction processing step

───────────────────────────────────────────────────── フロントページの続き (72)発明者 田中 賢二 神奈川県横浜市神奈川区守屋町3丁目12番 地 日本ビクター株式会社内 Fターム(参考) 5C055 AA14 BA03 BA06 BA08 CA07 EA02 EA04 HA19 HA37 5C066 AA01 AA05 BA13 CA08 CA17 EA11 EB02 EC06 EF02 GA02 GA05 HA04 JA01 KD04 KE07 KP05 5C077 LL19 MP08 NN03 PP15 PP28 PP31 PP37 PP46 PP52 PP53 PP61 PP68 PQ19 PQ22 PQ23 TT09  ────────────────────────────────────────────────── ─── Continued on the front page (72) Inventor Kenji Tanaka 3-12 Moriyacho, Kanagawa-ku, Yokohama-shi, Kanagawa Japan F-term (reference) 5C055 AA14 BA03 BA06 BA08 CA07 EA02 EA04 HA19 HA37 5C066 AA01 AA05 BA13 CA08 CA17 EA11 EB02 EC06 EF02 GA02 GA05 HA04 JA01 KD04 KE07 KP05 5C077 LL19 MP08 NN03 PP15 PP28 PP31 PP37 PP46 PP52 PP53 PP61 PP68 PQ19 PQ22 PQ23 TT09

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 階調補正しようとするカラー画像データ
から輝度ヒストグラムを作成し、その輝度ヒストグラム
から入力輝度レベル軸をa等分(aは4以上の整数)し
たそれぞれの領域の画素数の全画素に対する割合を示す
第1の特徴量と、前記a等分したそれぞれの領域の一定
のリミッタ値を越える画素数の全画素に対する割合を示
す第2の特徴量と、前記輝度ヒストグラムから入力輝度
レベル軸を3等分したそれぞれの領域の画素数の全画素
に対する割合を示す第3の特徴量とをそれぞれ算出して
第1の格納部に格納する第1のステップと、 前記第1の格納部に格納されている第1乃至第3の特徴
量を取り込み、そのうち最も低輝度側領域の前記第3の
特徴量が予め設定した下限値より大であり、かつ、最も
高輝度側領域の前記第3の特徴量が予め設定した上限値
より小であるかどうか比較判定する第2のステップと、 前記第2のステップにより、最も低輝度側領域の前記第
3の特徴量が予め設定した下限値より大である判定結果
が得られたときは露光アンダーと判断して、前記第1の
特徴量を用いてコントラストの傾き情報を求め、その傾
き情報からアンダー強度を求めるアンダー前処理を行う
第3のステップと、 前記第2のステップにより、最も高輝度側領域の前記第
3の特徴量が予め設定した上限値より大である判定結果
が得られたときは露光オーバーと判断して、前記第1の
特徴量を用いてコントラストの傾き情報を求め、その傾
き情報からオーバー強度を求めるオーバー前処理を行う
第4のステップと、 前記第2のステップにより、最も低輝度側領域の前記第
3の特徴量が予め設定した下限値以下であり、かつ、最
も高輝度側領域の前記第3の特徴量が予め設定した上限
値より小である判定結果が得られたときは、前記第1の
特徴量を用いてコントラストの傾き情報を求めると共
に、前記第2の特徴量に応じて強度を求めるリニア前処
理を行う第5のステップと、 前記第2のステップにより露光オーバー以外と判断され
たときは、前記第2の特徴量が入力輝度レベルの最も高
い領域と最も低い領域で共に正の値であるときに強い逆
光と判断して逆光フラグを所定値にセットする第6のス
テップと、 入力されたカラー画像データが明度、色相、彩度が肌色
である領域に含まれるか否か判定すると共に、前記逆光
フラグが所定値であるときは該所定値でないときに比べ
て、前記肌色である領域の輝度レベルを下げて判定する
第7のステップと、 前記第7のステップにより検出された肌色の画素につい
て、各連結領域の面積を求め、それらの連結領域のうち
最大面積から面積の広い順に全部でn個(nは予め定め
た2以上の整数)の連結領域を、認識対象のエリアとし
て抽出し、そのn個のエリアのそれぞれについて、当該
エリアを内部に含む所定形状の枠に当てはめ、かつ、そ
の枠の上部に髪の毛エリアを加えた枠を想定し、n個の
各枠全体のそれぞれについて、肌色総画素数を示す第4
の特徴量と、前記枠の画面縦方向の情報を示す第5の特
徴量と、前記枠の画面横方向の情報を示す第6の特徴量
とを求めた後、前記第4乃至第6の特徴量を分析し、顔
を示すエリアである確率が最も高い1つのエリアを顔エ
リアとして決定する第8のステップと、 前記第8のステップで決定された前記顔エリアの平均輝
度を求め、その平均輝度を予め設定した目標の輝度範囲
に入るかどうか比較し、その比較結果に基づき、前記第
3、第4又は第5のステップで作成した前記コントラス
トの傾き情報と強度情報とを、前記平均輝度が前記目標
の輝度範囲に入るように予測した値に修正する第9のス
テップと、 前記第9のステップで修正された強度に応じて、入力階
調に対する出力階調の各種の特性曲線を示す各種曲線デ
ータが予め格納されている第2の格納部から曲線データ
を選択し、その選択した曲線データと前記第9のステッ
プで修正された前記コントラストの傾き情報とを合成し
て階調補正曲線データを生成して第3の格納部に格納す
る第10のステップと、 前記階調補正しようとするカラー画像データが格納され
ている画像メモリから読み出した当該階調補正しようと
するカラー画像データに、前記第3の格納部からの前記
階調補正曲線データを反映させて前記画像メモリに再び
格納する第11のステップとを含むことを特徴とする自
動階調補正方法。
1. A luminance histogram is created from color image data whose gradation is to be corrected, and the input luminance level axis is equally divided by a (a 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 a equally divided areas, 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 using the first feature amount, and an under preprocessing for obtaining the under intensity from the inclination information is performed. In the second step, when a determination result that the third feature amount of the highest luminance side region is larger than a preset upper limit value is obtained, it is determined that overexposure is performed, and the first feature is determined. A fourth step of performing pre-over processing for obtaining over-intensity from the slope information by obtaining the slope information of the contrast by using the amount, and the third feature of the lowest luminance area by the second step. When the determination result that the amount of collection is equal to or less than a preset lower limit value and the third feature amount of the highest luminance side area is smaller than the preset upper limit value is obtained, the first feature is obtained. A fifth step of performing linear pre-processing for obtaining the intensity of the contrast in accordance with the second characteristic amount while obtaining the inclination information of the contrast using the amount, and when it is determined that the exposure is not over in the second step A sixth step of determining that the backlight is strong backlight and setting a backlight flag to a predetermined value when the second feature value is a positive value in both the highest region and the lowest region of the input luminance level; It is determined whether or not the color image data is included in a region where the brightness, hue, and saturation are skin colors, and when the backlight flag is a predetermined value, the region that is the skin color is smaller than when the backlight flag is not the predetermined value. Brightness level And determining the area of each connected region with respect to the flesh-colored pixel detected in the seventh step, and among the connected regions, a total of n (from the largest area to the largest area) (n is a predetermined integer of 2 or more) is extracted as an area to be recognized, and each of the n areas is applied to a frame of a predetermined shape including the area therein, and Assuming a frame in which a hair area is added to the upper part, a fourth number indicating the total number of skin color pixels for each of the n frames.
, A fifth feature value indicating information of the frame in the vertical direction of the screen, and a sixth feature value indicating information of the frame in the horizontal direction of the screen. Eighth step of analyzing a feature amount and determining one area having the highest probability of being a face area as a face area; and calculating an average luminance of the face area determined in the eighth step. A comparison is made as to whether or not the average luminance falls within a preset target luminance range. Based on the comparison result, the contrast inclination information and the intensity information created in the third, fourth, or fifth step are compared with the average luminance. A ninth step of correcting the luminance to a value predicted so that the luminance falls within the target luminance range, and various characteristic curves of the output gradation with respect to the input gradation according to the intensity corrected in the ninth step. The various curve data shown are stored in advance. Curve data is selected from the second storage unit, and the selected curve data is combined with the gradient information of the contrast corrected in the ninth step to generate gradation correction curve data. A tenth step of storing the color image data to be corrected in the storage unit; and reading the color image data to be corrected from the image memory in which the color image data to be corrected is stored from the third storage unit. An eleventh step of reflecting the gradation correction curve data and storing the data again in the image memory.
【請求項2】 前記第7のステップは、入力されたYU
Vの3次元色空間におけるカラー画像データのうち、Y
軸、U軸及びV軸の3次元座標空間において予め設定し
た肌色領域を示し、かつ、隣接する直方体領域の輝度境
界値は同一値であるm個(mは2以上の整数)の直方体
領域内に含まれる画素を、前記明度、色相、彩度が肌色
である画素として求めることを特徴とする請求項1記載
の自動階調補正方法。
2. The method according to claim 1, wherein the seventh step comprises:
V of the color image data in the three-dimensional color space of Y
In a m-shaped (m is an integer of 2 or more) rectangular parallelepiped area, which indicates a preset skin color area in the three-dimensional coordinate space of the axes, U-axis, and V-axis and has the same luminance boundary value between adjacent rectangular parallelepiped areas 2. The automatic gradation correction method according to claim 1, wherein the pixels included in the image data are obtained as pixels whose brightness, hue, and saturation are skin colors.
【請求項3】 前記第8のステップは、前記逆光フラグ
が前記所定値であるときは、前記顔を示すエリアである
確率が最も高い1つのエリアの確率値が予め定めた第1
の下限値以上であるときに、該1つのエリアを顔エリア
と判定し、前記逆光フラグが前記所定値でないときは、
前記顔を示すエリアである確率が最も高い1つのエリア
の肌色の総画素数が予め定めた経験値以上で、かつ、該
1つのエリアの確率値が前記第1の下限値よりも大なる
予め設定した第2の下限値以上であるときのみ、該1つ
のエリアを顔エリアと判定することを特徴とする請求項
1記載の自動階調補正方法。
3. The eighth step, wherein when the backlight flag is the predetermined value, the probability value of one area having the highest probability of being an area indicating the face is determined by a first predetermined value.
When the area is equal to or more than the lower limit value, the one area is determined to be a face area, and when the backlight flag is not the predetermined value,
The total number of skin color pixels in one area having the highest probability of being the area indicating the face is equal to or greater than a predetermined empirical value, and the probability value of the one area is larger than the first lower limit. 2. The automatic gradation correction method according to claim 1, wherein the one area is determined as a face area only when the area is equal to or more than a set second lower limit.
JP10364778A 1998-12-22 1998-12-22 Automatic gradation correction method Pending JP2000188768A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10364778A JP2000188768A (en) 1998-12-22 1998-12-22 Automatic gradation correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10364778A JP2000188768A (en) 1998-12-22 1998-12-22 Automatic gradation correction method

Publications (1)

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

Family

ID=18482645

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10364778A Pending JP2000188768A (en) 1998-12-22 1998-12-22 Automatic gradation correction method

Country Status (1)

Country Link
JP (1) JP2000188768A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1441497A2 (en) * 2003-01-17 2004-07-28 Omron Corporation Image pickup device, image pickup device program and image pick up method
JP2004246456A (en) * 2003-02-12 2004-09-02 Omron Corp Apparatus and method for image editing
JP2005148915A (en) * 2003-11-12 2005-06-09 Noritsu Koki Co Ltd Proper face discrimination method and apparatus for implementing the method
JP2006031682A (en) * 2004-06-17 2006-02-02 Fuji Photo Film Co Ltd Lookup table creation device, method and program
JP2006217277A (en) * 2005-02-03 2006-08-17 Nikon Corp Imaging device
KR100690295B1 (en) 2005-09-20 2007-03-09 삼성전자주식회사 Method of face image normalization and face recognition system for a mobile terminal
CN1332557C (en) * 2004-03-15 2007-08-15 致伸科技股份有限公司 Method of exposure correction for digital image
CN100375507C (en) * 2004-09-14 2008-03-12 奥林巴斯株式会社 Image processing apparatus, image recording apparatus, and image processing method
US7565073B2 (en) 2005-05-16 2009-07-21 Fujifilm Corporation Photography apparatus, photography method, and photography program for obtaining an image of a subject
US7720279B2 (en) 2004-03-10 2010-05-18 Seiko Epson Corporation Specifying flesh area on image
US8285041B2 (en) 2004-09-14 2012-10-09 Olympus Corporation Image processing apparatus, image recording apparatus, and image processing method
JP2012213224A (en) * 2005-02-14 2012-11-01 Fujifilm Corp Luminance conversion curve creation device and method, and luminance conversion curve creation program
US8390693B2 (en) 2008-08-01 2013-03-05 Sanyo Electric Co., Ltd. Image processing apparatus
CN117061879A (en) * 2023-09-27 2023-11-14 武汉华工激光工程有限责任公司 Automatic light quantity correction method and system and electronic equipment

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1441497A2 (en) * 2003-01-17 2004-07-28 Omron Corporation Image pickup device, image pickup device program and image pick up method
JP2004246456A (en) * 2003-02-12 2004-09-02 Omron Corp Apparatus and method for image editing
JP2005148915A (en) * 2003-11-12 2005-06-09 Noritsu Koki Co Ltd Proper face discrimination method and apparatus for implementing the method
US7720279B2 (en) 2004-03-10 2010-05-18 Seiko Epson Corporation Specifying flesh area on image
CN1332557C (en) * 2004-03-15 2007-08-15 致伸科技股份有限公司 Method of exposure correction for digital image
JP2006031682A (en) * 2004-06-17 2006-02-02 Fuji Photo Film Co Ltd Lookup table creation device, method and program
JP4708866B2 (en) * 2004-06-17 2011-06-22 富士フイルム株式会社 Lookup table creation device and method, and lookup table creation program
US8285041B2 (en) 2004-09-14 2012-10-09 Olympus Corporation Image processing apparatus, image recording apparatus, and image processing method
CN100375507C (en) * 2004-09-14 2008-03-12 奥林巴斯株式会社 Image processing apparatus, image recording apparatus, and image processing method
JP2006217277A (en) * 2005-02-03 2006-08-17 Nikon Corp Imaging device
JP4595569B2 (en) * 2005-02-03 2010-12-08 株式会社ニコン Imaging device
JP2012213224A (en) * 2005-02-14 2012-11-01 Fujifilm Corp Luminance conversion curve creation device and method, and luminance conversion curve creation program
US7565073B2 (en) 2005-05-16 2009-07-21 Fujifilm Corporation Photography apparatus, photography method, and photography program for obtaining an image of a subject
KR100690295B1 (en) 2005-09-20 2007-03-09 삼성전자주식회사 Method of face image normalization and face recognition system for a mobile terminal
US8390693B2 (en) 2008-08-01 2013-03-05 Sanyo Electric Co., Ltd. Image processing apparatus
CN117061879A (en) * 2023-09-27 2023-11-14 武汉华工激光工程有限责任公司 Automatic light quantity correction method and system and electronic equipment
CN117061879B (en) * 2023-09-27 2023-12-19 武汉华工激光工程有限责任公司 Automatic light quantity correction method and system and electronic equipment

Similar Documents

Publication Publication Date Title
EP0747855B1 (en) Method and apparatus for enhancing a digital image
US7023580B2 (en) System and method for digital image tone mapping using an adaptive sigmoidal function based on perceptual preference guidelines
US8035871B2 (en) Determining target luminance value of an image using predicted noise amount
US7406193B2 (en) Image processing method and image processing apparatus for making luminance correction
US7068328B1 (en) Method, apparatus and recording medium for image processing
JP5205968B2 (en) Gradation correction method, gradation correction apparatus, gradation correction program, and image device
US7421120B2 (en) Apparatus correcting image by luminance histogram
EP0723364B1 (en) Real-time image enhancement techniques
US7245764B2 (en) Image processing method and image processing apparatus utilizing luminance histograms, and projector
US7409083B2 (en) Image processing method and apparatus
US20040190789A1 (en) Automatic analysis and adjustment of digital images with exposure problems
US20080240605A1 (en) Image Processing Apparatus, Image Processing Method, and Image Processing Program
US20070041636A1 (en) Apparatus and method for image contrast enhancement using RGB value
JP2000188768A (en) Automatic gradation correction method
JP2005353069A (en) Chroma-adaptive image improvement device and method
JPWO2006106754A1 (en) Image processing method, display image processing method, image processing apparatus, image processing program, and integrated circuit including the image processing apparatus
US7522314B2 (en) Image sharpening
JP4595569B2 (en) Imaging device
US7593590B2 (en) Image status estimating method, image correcting method, image correction apparatus, and storage medium
JP2004007202A (en) Image processor
JP2000102033A (en) Automatic gradation correction method
JP4013699B2 (en) Image processing apparatus and image processing method
US5774578A (en) Apparatus for and method of utilizing density histograms for correcting objective images
JP2000099717A (en) Picture quality adjusting device, its method and recording medium recorded with image adjusting program
JP2000032287A (en) Image processor and image processing method