JP2006018739A - Object detection means, device, and method - Google Patents

Object detection means, device, and method Download PDF

Info

Publication number
JP2006018739A
JP2006018739A JP2004198001A JP2004198001A JP2006018739A JP 2006018739 A JP2006018739 A JP 2006018739A JP 2004198001 A JP2004198001 A JP 2004198001A JP 2004198001 A JP2004198001 A JP 2004198001A JP 2006018739 A JP2006018739 A JP 2006018739A
Authority
JP
Japan
Prior art keywords
image
correction
unit
histogram
lookup table
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.)
Withdrawn
Application number
JP2004198001A
Other languages
Japanese (ja)
Inventor
Takahiro Matsuura
貴洋 松浦
Osamu Yamada
修 山田
Takeshi Makita
剛 蒔田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2004198001A priority Critical patent/JP2006018739A/en
Publication of JP2006018739A publication Critical patent/JP2006018739A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Image Input (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that the color balance of a photographed image collapses according to photographic conditions or the status of a scene when photographing. <P>SOLUTION: This object detecting means is provided with an analyzing means for analyzing an input image, a setting means for setting a correction parameter according to the analysis result, an image correcting means for correcting the input image by using the set parameter and a detection means for detecting a preset object by using the corrected image. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、ある対象物を検出する手段、装置及び方法に関する。   The present invention relates to a means, an apparatus and a method for detecting an object.

写真画像中の人物の顔などを検出する対象検出処理では、従来、適正状態で撮影されていることを前提に処理が行われている。そして、その中の輝度情報や色情報、エッジ情報などを参考にして検出処理が行われている。
特開平10−232930号公報
In the object detection process for detecting a human face or the like in a photographic image, the process is conventionally performed on the assumption that the image is captured in an appropriate state. Then, detection processing is performed with reference to luminance information, color information, edge information, and the like therein.
Japanese Patent Laid-Open No. 10-232930

しかしながら、例えば室内の蛍光灯下で撮影された写真や、屋外の日陰で撮影された写真など、撮影条件や撮影時のシーンの状態により、撮影された画像の色バランスが崩れていたり、特に夜景の写真などは画像中にダークノイズを含んでしまうため、画像の状態によって検出率が著しく低下してしまうという問題があった。   However, the color balance of the captured image may be disturbed depending on the shooting conditions and the state of the scene at the time of shooting, such as a photo taken under an indoor fluorescent light or a photo taken outdoors in the shade. However, since the photo includes dark noise in the image, there is a problem that the detection rate is remarkably lowered depending on the state of the image.

本発明においては、前記問題点を解決するために、入力画像の解析を行なう解析手段と、前記解析結果に応じて補正パラメータを設定する設定手段と、前記設定された補正パラメータを用いて前記入力画像を補正する画像補正手段と、前記補正した画像を用いてあらかじめ設定された対象物を検出する検出手段とを有することを特徴とする対象物検出手段を提供することを目的とする。   In the present invention, in order to solve the problem, an analysis unit that analyzes an input image, a setting unit that sets a correction parameter according to the analysis result, and the input using the set correction parameter It is an object of the present invention to provide an object detection means comprising image correction means for correcting an image and detection means for detecting a preset object using the corrected image.

また前記あらかじめ設定した対象物は、人物の顔であることを特徴とする。   The preset object is a human face.

本発明によれば、撮影条件や撮影時のシーンの状態により、撮影された画像の色バランスが崩れている画像については適正な色バランスに補正し、画像中のダークノイズを低減した後に検出を行なうため、常に良好な検出率で人物の顔の検出を行なうことができる。   According to the present invention, for an image in which the color balance of the photographed image is lost depending on the photographing condition and the state of the scene at the time of photographing, the image is corrected to an appropriate color balance, and detection is performed after reducing dark noise in the image. Therefore, it is possible to always detect a human face with a good detection rate.

図1に本願実施形態にかかる画像処理装置の主要部分の構成を示す。   FIG. 1 shows a configuration of a main part of an image processing apparatus according to an embodiment of the present application.

図1に示される画像処理装置は、画像入力部(2)、画像出力部(3)、ヒストグラム作成部(4)、ヒストグラム保持部(5)、ルックアップテーブル作成部(6)、ルックアップテーブル保持部(7)、画像補正部(8)、画像バッファ(9)、コピー用画像バッファ(10)、フィルタ処理部(11)、顔検出処理部(12)、撮影情報保持部(13)から構成される。   An image processing apparatus shown in FIG. 1 includes an image input unit (2), an image output unit (3), a histogram creation unit (4), a histogram holding unit (5), a lookup table creation unit (6), and a lookup table. From the holding unit (7), the image correction unit (8), the image buffer (9), the image buffer for copying (10), the filter processing unit (11), the face detection processing unit (12), and the photographing information holding unit (13) Composed.

画像入力部(2)は、入力画像(1)からデータを読み込んで、画像バッファ(9)に書き込む。   The image input unit (2) reads data from the input image (1) and writes it into the image buffer (9).

画像出力部(3)は、画像バッファ(9)に格納されているデータを出力画像(14)に書き込む。   The image output unit (3) writes the data stored in the image buffer (9) to the output image (14).

ヒストグラム作成部(4)は、画像バッファ(9)に格納されている画像データをもとに、ヒストグラムを作成し、結果をヒストグラム保持部(5)に格納する。   The histogram creation unit (4) creates a histogram based on the image data stored in the image buffer (9), and stores the result in the histogram holding unit (5).

ヒストグラム保持部(5)は、画像データ全体のヒストグラム、及びマスク領域のヒストグラムを保持している。   The histogram holding unit (5) holds a histogram of the entire image data and a histogram of the mask area.

ルックアップテーブル作成部(6)は、ヒストグラム保持部(5)に格納されているヒストグラムをもとに、補正に必要なパラメータを算出し、ルックアップテーブルを作成する。さらに、あらかじめルックアップテーブル保持部(7)に保持されている階調特性及び色再現性補正用ルックアップテーブルと合成し、合成したルックアップテーブルをルックアップテーブル保持部(7)に格納する。   The lookup table creation unit (6) calculates parameters necessary for correction based on the histogram stored in the histogram holding unit (5), and creates a lookup table. Further, it is combined with the look-up table for correction of gradation characteristics and color reproducibility held in advance in the look-up table holding unit (7), and the combined look-up table is stored in the look-up table holding unit (7).

ルックアップテーブル保持部(7)は、ルックアップテーブル作成部(6)において作成したルックアップテーブルと、階調特性及び色再現性補正ルックアップテーブルを保持する。   The look-up table holding unit (7) holds the look-up table created by the look-up table creating unit (6) and the gradation characteristic and color reproducibility correction look-up table.

画像補正部(8)は、ルックアップテーブル保持部(7)に格納されているルックアップテーブルをもとに、画像バッファ(9)に格納されている画像を補正、結果をコピー用画像バッファ(10)に格納する。   The image correction unit (8) corrects the image stored in the image buffer (9) based on the lookup table stored in the lookup table holding unit (7), and the result is copied to the image buffer for copying ( 10).

画像バッファ(9)及びコピー用画像バッファ(10)は、画像データを保持している。   The image buffer (9) and the copy image buffer (10) hold image data.

フィルタ処理部(11)は、拡大/縮小処理やハイライト部のエッジ強調を行なう。   The filter processing unit (11) performs enlargement / reduction processing and edge enhancement of the highlight portion.

顔検出処理部(12)は、画像バッファ(9)に格納されている画像データを元に、人間の顔が存在するかどうかを検出する。そして、存在する場合は、マスクデータを作成する。   The face detection processing unit (12) detects whether a human face exists based on the image data stored in the image buffer (9). If it exists, mask data is created.

撮影情報保持部(13)は、撮影時のカメラの向き、フラッシュ使用情報、ピント距離、ピント位置(2次元)などを保持している。   The shooting information holding unit (13) holds the camera orientation, flash use information, focus distance, focus position (two-dimensional), and the like at the time of shooting.

画像処理装置は、例えばパソコンなどに図1の各部の処理または制御を実現するためのプログラムを供給することにより実現することができる。その場合は、パソコンのCPUがプログラムの内容に基づき各処理または制御を実施することになる。   The image processing apparatus can be realized by supplying a program for realizing processing or control of each unit in FIG. In that case, the CPU of the personal computer performs each process or control based on the contents of the program.

以下、発明の実施の形態を具体例を用いて詳細に説明する。   Hereinafter, embodiments of the invention will be described in detail using specific examples.

<本実施形態の処理の流れ>
図2に本実施形態における処理の流れを示す。
<Processing flow of this embodiment>
FIG. 2 shows the flow of processing in this embodiment.

ステップS1において、画像入力部(2)において入力画像(1)の撮影情報及び画像データを読み込み、画像バッファ(9)に展開する。画像入力部(2)の動作の詳細を図3に示し後述する。   In step S1, the image input unit (2) reads the shooting information and image data of the input image (1) and develops them in the image buffer (9). Details of the operation of the image input unit (2) are shown in FIG.

ステップS2において、ヒストグラム作成部(4)、ルックアップテーブル作成部(6)、画像補正部(8)において、画像を補正する。動作の詳細を図4に示し後述する。   In step S2, the image is corrected in the histogram creation unit (4), the lookup table creation unit (6), and the image correction unit (8). Details of the operation are shown in FIG.

ステップS3において、顔検出処理部(12)において、顔検出処理を行なう。顔検出処理部(12)の動作の詳細を図13に示し後述する。   In step S3, the face detection processing unit (12) performs face detection processing. Details of the operation of the face detection processing section (12) are shown in FIG.

ステップS4において、顔検出処理の結果顔が存在したかどうかを判定する。少なくとも1つの顔が存在した場合、ステップS5に進む。顔が1つも存在しなかった場合、ステップS6に進む。   In step S4, it is determined whether a face exists as a result of the face detection process. If at least one face exists, the process proceeds to step S5. If no face exists, the process proceeds to step S6.

ステップS5において、ヒストグラム作成部(4)、ルックアップテーブル作成部(6)、画像補正部(8)において、マスクデータを用いて画像を補正する。動作の詳細を図14に示し後述する。   In step S5, the histogram creation unit (4), the lookup table creation unit (6), and the image correction unit (8) correct the image using the mask data. Details of the operation are shown in FIG. 14 and will be described later.

ステップS6において、フィルタ処理部(11)において、フィルタ処理を行なう。フィルタ処理部の動作の詳細を図18に示し後述する。   In step S6, the filter processing unit (11) performs filter processing. Details of the operation of the filter processing unit are shown in FIG.

ステップS7において、画像出力部(3)において、画像バッファ(9)に格納されている画像データ及び撮影情報を出力画像(14)に出力する。   In step S7, the image output unit (3) outputs the image data and shooting information stored in the image buffer (9) to the output image (14).

〈入力画像(1)に格納されている撮影情報及び画像データ〉
図20に入力画像(1)に格納されている撮影情報及び画像データを示す。撮影情報は撮影情報保持部(13)に、画像データは画像バッファ(9)に格納される。画像バッファ(9)はこれ以外にマスクデータを格納している。
<Shooting Information and Image Data Stored in Input Image (1)>
FIG. 20 shows shooting information and image data stored in the input image (1). The shooting information is stored in the shooting information holding unit (13), and the image data is stored in the image buffer (9). In addition to this, the image buffer (9) stores mask data.

撮影情報には、撮影時のカメラの向き(図23(a)を正位置とし、(a)〜(d)の4通りある)、フラッシュ使用情報、ピント距離、ピント位置、入力機器IDなどが格納されている。   The shooting information includes the orientation of the camera at the time of shooting (FIG. 23 (a) is the normal position, and there are four types (a) to (d)), flash use information, focus distance, focus position, input device ID, and the like. Stored.

<画像の展開方法>
画像入力部(2)における動作の詳細を図3に示す。これは、図2のステップS1を詳細に示すものである。
<Image expansion method>
Details of the operation in the image input unit (2) are shown in FIG. This shows step S1 in FIG. 2 in detail.

ステップS11において、入力画像(1)から撮影情報を入力し、撮影情報保持部(13)に格納する。   In step S11, shooting information is input from the input image (1) and stored in the shooting information holding unit (13).

ステップS12において、撮影情報保持部(13)に格納されている撮影時のカメラの向きを判定し、判定結果に従って入力画像(1)から得た画像データを画像バッファ(9)に展開する。   In step S12, the camera orientation at the time of shooting stored in the shooting information holding unit (13) is determined, and the image data obtained from the input image (1) is developed in the image buffer (9) according to the determination result.

展開は、カメラの位置が図23(a)の時はそのまま展開。図23(b)の時は、左に90°、図23(c)の時は、右に90°、図23(d)の時は180°それぞれ回転して、画像バッファ内では(a)の時と上下方向が一致するように展開する。このように展開することで、後の顔検出処理の時には、撮影時のカメラの向きに関係なく常に人が正位置を向いていることとして処理することができる。   When the camera is in the position shown in FIG. In FIG. 23B, the image is rotated 90 ° to the left, 90 ° to the right in FIG. 23C, and 180 ° in FIG. 23D. Expand so that the vertical direction coincides with the time of. By developing in this way, at the time of the subsequent face detection process, it can be processed that the person is always facing the normal position regardless of the orientation of the camera at the time of shooting.

また展開の際には、デジタルカメラ特有のダークノイズを低減する処理も行なう。この処理には、例えば輝度の低い部分で微妙に輝度が振れている部分を滑らかにするなどの処理が考えられる。   At the time of development, processing for reducing dark noise peculiar to a digital camera is also performed. As this process, for example, a process of smoothing a part where the luminance is slightly varied in a low luminance part can be considered.

<画像補正処理>
図4に画像補正処理の流れを示す。
<Image correction processing>
FIG. 4 shows the flow of image correction processing.

ステップS21において、ヒストグラム作成部(4)で、画像バッファ(9)に格納されている画像データをもとにヒストグラムを作成し、結果をヒストグラム保持部(5)に格納する。ヒストグラム作成部(4)の動作の詳細は図5を用いて後述する。   In step S21, the histogram creation unit (4) creates a histogram based on the image data stored in the image buffer (9), and stores the result in the histogram holding unit (5). Details of the operation of the histogram creation unit (4) will be described later with reference to FIG.

ステップS22において、ルックアップテーブル作成部(6)で、ルックアップテーブルを作成する。ルックアップテーブル作成部(6)の動作の詳細は図7を用いて後述する。   In step S22, the lookup table creation unit (6) creates a lookup table. Details of the operation of the lookup table creation unit (6) will be described later with reference to FIG.

ステップS23において、画像補正部(8)で、画像を補正する。画像補正部(8)の動作の詳細は図12を用いて後述する。   In step S23, the image correction unit (8) corrects the image. Details of the operation of the image correction unit (8) will be described later with reference to FIG.

<ヒストグラム作成部(4)での動作>
ヒストグラム作成部(4)での動作を図5に示す。これは、図4のステップS21を詳細に示したものである。
<Operation in Histogram Creation Unit (4)>
The operation in the histogram creation unit (4) is shown in FIG. This shows step S21 in FIG. 4 in detail.

ステップS31において、画像バッファ(9)から画像データを1画素分ずつ取り出す。画像データはRGB各色の輝度(R、C、B)が格納されている。   In step S31, image data is extracted from the image buffer (9) one pixel at a time. The image data stores the luminance (R, C, B) of each RGB color.

ステップS32において、画像データのRGB値から以下の式に従って当該画素の輝度Lを求める。
L=(3*R+6*G+1*B)/10
ステップS33において、ヒストグラム保持部に格納されているヒストグラムを更新する。ヒストグラム保持部には、上記計算した輝度LのヒストグラムHistL、及びRGB各色の累積輝度値を当該画素の輝度L別に格納するHistR、HistG、HistBを保持している。初期状態はすべて0である。ヒストグラムの更新は下記の式に従う。
HistR[L]=HistR[L]+R
HistG[L]=HistG[L]+G
HistB[L]=HistB[L]+B
HistL[L]=HistL[L]+1
ステップS34において、全画素終了したかどうかを調べる。終了していれば、終了。いなければ、ステップS31に進む。
In step S32, the luminance L of the pixel is obtained from the RGB values of the image data according to the following formula.
L = (3 * R + 6 * G + 1 * B) / 10
In step S33, the histogram stored in the histogram holding unit is updated. The histogram holding unit holds the histogram HistL of the calculated luminance L and HistR, HistG, and HistB that store the accumulated luminance value of each color of RGB for each luminance L of the pixel. The initial state is all zero. The histogram is updated according to the following formula.
HistR [L] = HistR [L] + R
HistG [L] = HistG [L] + G
HistB [L] = HistB [L] + B
HistL [L] = HistL [L] +1
In step S34, it is checked whether all pixels have been completed. If finished, exit. If not, the process proceeds to step S31.

作成したヒストグラムHistLの例を図6に示す。   An example of the created histogram HistL is shown in FIG.

<階調再現及び色再現性補正用ルックアップテーブルの作成方法>
階調再現及び色再現性補正用ルックアップテーブルとは、好ましい色再現に注目し、デジタルカメラなどの入力機器から入力した画像をプリンタなどの出力機器で出力した時の印刷物の階調再現及び色再現を、銀塩ポジフィルムなどの出力目標物で実現している階調再現及び色再現に近付くような画像に補正するためのルックアップテーブルである。階調再現及び色再現性補正用ルックアップテーブルを作成する方法を、図21を用いて詳細に説明する。
<Method for creating lookup table for tone reproduction and color reproducibility correction>
The look-up table for gradation reproduction and color reproducibility correction refers to the preferred color reproduction, and gradation reproduction and color of printed matter when an image input from an input device such as a digital camera is output by an output device such as a printer. It is a look-up table for correcting reproduction to an image that approaches gradation reproduction and color reproduction realized by an output target such as a silver salt positive film. A method of creating a lookup table for tone reproduction and color reproducibility correction will be described in detail with reference to FIG.

ステップS121において、図9に示す出力目標物プロファイル(パッチ番号とXYZ測色値の関係)と図11に示す出力機器プロファイル(XYZ測色値とRGB輝度の関係)を合成する。合成方法は、出力目標物プロファイルのXYZ値(各パッチごとに値がある)のY値と同じY値をもつパッチを出力機器プロファイルから探し出す。そして、出力機器プロファイルから探し出したパッチのXYZ値に対応するRGB値と、元の出力目標物プロファイルのパッチ番号との対応をとり、合成する。合成されたテーブルは、パッチ番号と出力機器の輝度(RGB値)との関係になる。   In step S121, the output target profile shown in FIG. 9 (the relationship between the patch number and the XYZ colorimetric values) and the output device profile shown in FIG. 11 (the relationship between the XYZ colorimetric values and RGB luminance) are synthesized. The synthesizing method searches the output device profile for a patch having the same Y value as the Y value of the XYZ value (there is a value for each patch) of the output target profile. Then, the RGB values corresponding to the XYZ values of the patches found from the output device profile and the patch numbers of the original output target profile are taken and combined. The synthesized table has a relationship between the patch number and the luminance (RGB value) of the output device.

ステップS122において、ステップS121において合成したテーブルと、図10に示す入力機器プロファイルを合成する。入力機器プロファイルはパッチ番号と入力機器の輝度(RGB値)の関係になっているので、合成方法は、同じパッチ番号に対応する入力機器の輝度(RGB値)と出力機器の輝度(RGB値)との関係を収集することになる。作成したテーブルは、ルックアップテーブル保持部(7)に格納し、画像を補正する際に使用する。実際の使用例は後述する。   In step S122, the table synthesized in step S121 and the input device profile shown in FIG. 10 are synthesized. Since the input device profile has a relationship between the patch number and the luminance (RGB value) of the input device, the composition method is the luminance of the input device (RGB value) and the luminance of the output device (RGB value) corresponding to the same patch number. Will collect the relationship. The created table is stored in the look-up table holding unit (7) and used when correcting an image. An actual use example will be described later.

<階調特性及び色再現性補正用ルックアップテーブルの例>
図22に示すルックアップテーブルは、以上の方法により作成した階調特性及び色再現性補正用ルックアップテーブル、LUTRDD、LUTGDD、LUTBDDである。なお、テーブル内にデータが格納されていない各点間は、直線で補間し変換データを作成する。両端の点では、それぞれ(255,255)、(0,0)と直線で補間する。本実施形態では補間処理として直線補間を用いているが、例えばスプライン曲線やベジェ曲線を用いた非線形補間処理を用いても構わない。
<Example of lookup table for correcting gradation characteristics and color reproducibility>
The look-up table shown in FIG. 22 is a look-up table for correcting gradation characteristics and color reproducibility, LUTRDD, LUTGDD, and LUTBDD created by the above method. It should be noted that conversion data is created by interpolating with straight lines between points where no data is stored in the table. At both end points, interpolation is performed with straight lines (255, 255) and (0, 0), respectively. In this embodiment, linear interpolation is used as the interpolation processing. However, for example, non-linear interpolation processing using a spline curve or a Bezier curve may be used.

<ルックアップテーブル作成部(6)での動作>
ルックアップテーブル作成部(6)での動作を図7に示す。これは、図4のステップS22を詳細に示したものである。
<Operation in Lookup Table Creation Unit (6)>
The operation in the lookup table creation unit (6) is shown in FIG. This shows step S22 of FIG. 4 in detail.

ステップS41において、ヒストグラム保持部(5)に格納されているヒストグラムHistLから、画像の最大輝度を求める。図6に示したヒストグラムにおいては、最大輝度は252になる。   In step S41, the maximum luminance of the image is obtained from the histogram HistL stored in the histogram holding unit (5). In the histogram shown in FIG.

ステップS42において、S41で求めた最大輝度と、255から所定量(図6においては、(所定量)=10である)を引き算していって、最大輝度の方が大きくなった時の輝度(LH′、つまりこの例の場合では、255、245、235、…を値を下げていって、その都度最大輝度と比較する。図6においては、LH′=245になる)を求め、所定の割合の画素(図6においては、総画素数の1%)を含む領域を求める。その領域の最小輝度をハイライトポイント(LH、図6においては、LH=234)とする。そして、以下の式に従って領域内(輝度がLH以上LH′以下の領域)のRGBの平均輝度(RH、GH、BH)を算出する。   In step S42, a predetermined amount (in FIG. 6, (predetermined amount) = 10) is subtracted from the maximum luminance obtained in S41, and the luminance when the maximum luminance becomes larger (in FIG. LH ′, that is, in this example, 255, 245, 235,..., Are lowered and compared with the maximum luminance each time (in FIG. 6, LH ′ = 245). A region including a percentage of pixels (1% of the total number of pixels in FIG. 6) is obtained. The minimum luminance of the area is a highlight point (LH, LH = 234 in FIG. 6). Then, RGB average luminance (RH, GH, BH) in the region (region where the luminance is not less than LH and not more than LH ′) is calculated according to the following formula.

Figure 2006018739
ステップS43において、ヒストグラム保持部(5)に格納されているヒストグラムHistLから、画像の最小輝度を求める。図4に示したヒストグラムにおいては、最小輝度は6になる。
Figure 2006018739
In step S43, the minimum luminance of the image is obtained from the histogram HistL stored in the histogram holding unit (5). In the histogram shown in FIG.

ステップS44において、S43で求めた最小輝度と、0から所定量(図6においては、(所定量)=10である)を足し算していって、最小輝度の方が小さくなった時の輝度(LS′、図6においては、LS′=10)を求め、所定の割合の画素(図6においては、総画素数の1%)を含む領域を求める。その領域の最大輝度をシャドウポイント(LS、図6においては、LS=22)とする。そして、以下の式に従って領域内(輝度はLS′以上LS以下の領域)のRGBの平均輝度(RS、GS、BS)を算出する。   In step S44, the minimum luminance obtained in S43 and a predetermined amount from 0 ((predetermined amount) = 10 in FIG. 6) are added, and the luminance when the minimum luminance becomes smaller (in FIG. LS ′, LS ′ = 10 in FIG. 6 is obtained, and a region including a predetermined ratio of pixels (1% of the total number of pixels in FIG. 6) is obtained. The maximum luminance of the area is a shadow point (LS, LS = 22 in FIG. 6). Then, the average luminance (RS, GS, BS) of RGB in the region (region where the luminance is LS ′ or more and LS or less) is calculated according to the following formula.

Figure 2006018739
ステップS45において、求めたRH、GH、BH、RS、GS、BSからRGBそれぞれのルックアップテーブルLUTR、LUTG、LUTBを作成する。作成したルックアップテーブルの例を図8(a)に示し、詳細を後述する。
Figure 2006018739
In step S45, RGB lookup tables LUTR, LUTG, and LUTB are created from the obtained RH, GH, BH, RS, GS, and BS. An example of the created lookup table is shown in FIG. 8A and will be described in detail later.

ステップS46において、ヒストグラム保持部(5)に格納されているヒストグラムHistLから、画像の平均輝度を求める。そして、求めた平均輝度の値によって、露出補正用ルックアップテーブルLUTLを作成する。作成したルックアップテーブルの例を図8(b)に示し、詳細を後述する。   In step S46, the average luminance of the image is obtained from the histogram HistL stored in the histogram holding unit (5). Then, an exposure correction lookup table LUTL is created based on the obtained average luminance value. An example of the created lookup table is shown in FIG. 8B and will be described in detail later.

ステップS47において、ステップS45で作成したルックアップテーブルLUTR、LUTG、LUTB、ステップS46で作成したルックアップテーブルLUTL、及びルックアップテーブル保持部(7)にあらかじめ格納されている階調特性及び色再現性補正用ルックアップテーブルLUTRDD、LUTGDD、LUTBDDを下記の式に従って合成する。合成したルックアップテーブルLUTR2、LUTG2、LUTB2をルックアップテーブル保持部(7)に格納する。
LUTR2[i]=LUTRDD[LUTL[LUTR[i]]]
LUTG2[i]=LUTGDD[LUTL[LUTG[i]]]
LUTB2[i]=LUTBDD[LUTL[LUTB[i]]]
ただし、上記の式においてiは、0以上最大輝度以下の値である。
In step S47, the gradation characteristics and color reproducibility stored in advance in the lookup tables LUTR, LUTG, and LUTB created in step S45, the lookup table LUTL created in step S46, and the lookup table holding unit (7). The correction look-up tables LUTRDD, LUTGDD, and LUTBDD are synthesized according to the following formula. The synthesized lookup tables LUTR2, LUTG2, and LUTB2 are stored in the lookup table holding unit (7).
LUTR2 [i] = LUTRDD [LUTL [LUTR [i]]]
LUTG2 [i] = LUTGDD [LUTL [LUTG [i]]]
LUTB2 [i] = LUTBDD [LUTL [LUTB [i]]]
In the above formula, i is a value not less than 0 and not more than the maximum luminance.

<作成したルックアップテーブルの例>
作成したルックアップテーブルLUTR、LUTG、LUTB、LUTLの例を図8に示す。図8(a)に示すルックアップテーブルLUTR、LUTG、LUTBは、コントラスト、及び色かぶりの補正を行なうためのものである。ここでは、G、B、Rの順にハイライトのガンマを立たせている。このように、Rに対してB及びGを強めることで、例えばシアンかぶりしている画像のかぶりを補正することができる。同時に、コントラストの補正もできる。
<Example of created lookup table>
An example of the created lookup tables LUTR, LUTG, LUTB, and LUTL is shown in FIG. Look-up tables LUTR, LUTG, and LUTB shown in FIG. 8A are for correcting contrast and color cast. Here, the highlight gamma is set in the order of G, B, and R. In this way, by strengthening B and G with respect to R, it is possible to correct, for example, the fogging of a cyan fogging image. At the same time, the contrast can be corrected.

一方、図8(b)に示すルックアップテーブルLUTLは露出補正用のルックアップテーブルで、画像の平均輝度により、平均輝度が低い時は露出アンダーの可能性があるので、全体を明るくするようなテーブルを作成し、平均輝度が低い時は露出オーバーの可能性があるので、全体を暗くするようなルックアップテーブルを作成する。   On the other hand, the look-up table LUTL shown in FIG. 8B is a look-up table for exposure correction. Depending on the average brightness of the image, there is a possibility of underexposure when the average brightness is low. Create a table, and when the average brightness is low, there is a possibility of overexposure, so create a lookup table that darkens the whole.

<画像補正部(8)での動作>
図12に画像補正部(8)での動作を示す。これは、図4のステップS23、及び図14のステップS73を詳細に示したものである。
<Operation in Image Correction Unit (8)>
FIG. 12 shows the operation of the image correction unit (8). This shows details of step S23 in FIG. 4 and step S73 in FIG.

ステップS51において、画像バッファ(9)に格納されている画像データを1画素分取り出す。画像データはRGB各色の輝度(R、G、B)が格納されている。   In step S51, one pixel of image data stored in the image buffer (9) is extracted. The image data stores the luminance (R, G, B) of each color of RGB.

ステップS52において、ステップS46またはステップS98において合成したルックアップテーブルLUTR2、LUTG2、LUTB2に基づいて、画像バッファ(9)から取り出した画像データを補正する。結果はコピー用画像バッファ(10)に格納する。
R=LUTR2[R]
G=LUTG2[G]
B=LUTB2[B]
ステップS53において、全画素終了したかどうかを調べる。全画素終了していれば終了。終了していなければ、ステップS51に進む。
In step S52, the image data extracted from the image buffer (9) is corrected based on the lookup tables LUTR2, LUTG2, and LUTB2 synthesized in step S46 or step S98. The result is stored in the copy image buffer (10).
R = LUTR2 [R]
G = LUTG2 [G]
B = LUTB2 [B]
In step S53, it is checked whether or not all pixels have been completed. End if all pixels are finished. If not completed, the process proceeds to step S51.

本実施形態では、ルックアップテーブルの作成処理及び画像補正処理の高速化をはかるために各成分毎にルックアップテーブルを用意している。   In the present embodiment, a lookup table is prepared for each component in order to increase the speed of the lookup table creation process and the image correction process.

<顔検出処理部(12)の動作>
図13及び図24に顔検出処理部(12)の動作を示す。これは、図2のステップS3を詳細に示したものである。
<Operation of Face Detection Processing Unit (12)>
13 and 24 show the operation of the face detection processing unit (12). This shows step S3 in FIG. 2 in detail.

ステップS61において、コピー用画像バッファ(10)に格納されている画像データ(つまり、ステップS2で補正された画像データ)を元に、局所的に輝度が低い領域をマークしていく。   In step S61, an area having a low luminance is marked locally based on the image data stored in the copy image buffer (10) (that is, the image data corrected in step S2).

ステップS62において、ステップS61でマークされた領域を2つずつ組にして、領域の大きさの均等性、輝度の差、水平に対する角度などから、組にした2つが目かどうかを判定する(図24(a))。   In step S62, two regions marked in step S61 are grouped, and it is determined whether the two groups are eyes from the uniformity of the size of the regions, the difference in luminance, the angle with respect to the horizontal, etc. (FIG. 24 (a)).

ステップS63において、目と判定された組について、その2つを中心にした矩形領域を設定する。そして、その領域の境界付近のエッジ、及び領域内の色情報を判定する。エッジは、顔の輪郭があるかどうかを判定する。また、色情報は矩形領域内のRGB値の平均値が、あらかじめ設定した肌色領域内に入っているかどうかを判定する。そして、顔領域を確定する。顔領域は前記矩形領域で与えられる(図24(b)(c))。   In step S63, for the group determined to be an eye, a rectangular area centering on the two is set. Then, the edge near the boundary of the region and the color information in the region are determined. The edge determines whether there is a face outline. Further, the color information determines whether or not the average value of the RGB values in the rectangular area is within a preset skin color area. Then, the face area is determined. The face area is given by the rectangular area (FIGS. 24B and 24C).

ステップS64において、確定した顔の領域をマスクするようなマスクデータを作成し、作成したマスクデータを画像バッファ(9)に格納する。   In step S64, mask data for masking the determined face area is created, and the created mask data is stored in the image buffer (9).

<マスクデータを用いた場合の画像補正処理>
図14に本実施形態におけるマスクデータを用いた場合の画像補正処理の流れを示す。
<Image correction processing using mask data>
FIG. 14 shows the flow of image correction processing when mask data in this embodiment is used.

ステップS71において、ヒストグラム作成部(4)で、画像バッファ(9)(ステップS2で補正される前の画像データ)に格納されている画像データをもとにヒストグラムを作成し、結果をヒストグラム保持部(5)に格納する。ヒストグラム作成部(4)の動作の詳細は図15を用いて後述する。   In step S71, the histogram creation unit (4) creates a histogram based on the image data stored in the image buffer (9) (image data before being corrected in step S2), and the result is stored in the histogram holding unit. Store in (5). Details of the operation of the histogram creation unit (4) will be described later with reference to FIG.

ステップS72において、ルックアップテーブル作成部(6)で、ルックアップテーブルを作成する。ルックアップテーブル作成部(6)の動作の詳細は図16を用いて後述する。   In step S72, the lookup table creation unit (6) creates a lookup table. Details of the operation of the lookup table creation unit (6) will be described later with reference to FIG.

ステップS73において、画像補正部(8)で、画像を補正する。画像補正部(8)の動作の詳細は図12で示したものと同一である。   In step S73, the image correction unit (8) corrects the image. The details of the operation of the image correction unit (8) are the same as those shown in FIG.

<マスクデータを用いた場合のヒストグラム作成処理>
ヒストグラム作成部(4)での動作を図15に示す。これは、図14のステップS71を詳細に示したものである。
<Histogram creation process using mask data>
The operation in the histogram creation unit (4) is shown in FIG. This shows step S71 of FIG. 14 in detail.

ステップS81において、画像バッファ(9)から画像データとマスクデータを1画素分ずつ取り出す。画像データはRGB各色の輝度(R、G、B)、マスクデータはマスクの有無が格納されている。   In step S81, image data and mask data are extracted from the image buffer (9) one pixel at a time. The image data stores the luminance (R, G, B) of each RGB color, and the mask data stores the presence or absence of a mask.

ステップS82において、画像データのRGB値から以下の式に従って当該画素の輝度Lを求める。
L=(3*R+6*G+1*B)/10
ステップS33において、ヒストグラム保持部に格納されているヒストグラムを更新する。ヒストグラム保持部には、上記計算した輝度LのヒストグラムHistL、及びRGB各色の累積輝度値を当該画素の輝度L別に格納する。HistR、HistG、HistB、さらにマスクデータによってマスクされている領域の輝度LのヒストグラムHistLMskを保持している。初期状態はすべて0である。ヒストグラムの更新は下記の式に従う。
HistR[L]=HistR[L]+R
HistG[L]=HistG[L]+G
HistB[L]=HistB[L]+B
HistL[L]=HistL[L]+1
ステップS84において、マスクデータから当該画素がマスクされているかどうかを調べる。マスクされていたら、ステップS85に進み、マスクされていなかったら、ステップS86に進む。
In step S82, the luminance L of the pixel is obtained from the RGB values of the image data according to the following formula.
L = (3 * R + 6 * G + 1 * B) / 10
In step S33, the histogram stored in the histogram holding unit is updated. The histogram holding unit stores the histogram HistL of the calculated luminance L and the accumulated luminance value of each color of RGB for each luminance L of the pixel. HistR, HistG, HistB, and a histogram HistLMsk of the luminance L of the area masked by the mask data are held. The initial state is all zero. The histogram is updated according to the following formula.
HistR [L] = HistR [L] + R
HistG [L] = HistG [L] + G
HistB [L] = HistB [L] + B
HistL [L] = HistL [L] +1
In step S84, it is checked whether or not the pixel is masked from the mask data. If masked, the process proceeds to step S85, and if not masked, the process proceeds to step S86.

ステップS85において、ヒストグラム保持部に格納されているマスク領域のヒストグラムを更新する。
HistLMsk[L]=HistLMsk[L]+1
ステップS86において、全画素終了したかどうかを調べる。終了していれば、終了。いなければ、ステップS81に進む。
In step S85, the histogram of the mask area stored in the histogram holding unit is updated.
HistLMsk [L] = HistLMsk [L] +1
In step S86, it is checked whether or not all pixels have been completed. If finished, exit. If not, the process proceeds to step S81.

作成したヒストグラムHistLの例は図6に示したものと同一である。   An example of the created histogram HistL is the same as that shown in FIG.

<マスクデータを使用した場合のルックアップテーブル作成部(6)での動作>
マスクデータを使用した場合のルックアップテーブル作成部(6)での動作を図16に示す。これは、図14のステップS72を詳細に示したものである。
<Operation in lookup table creation unit (6) when mask data is used>
FIG. 16 shows the operation of the lookup table creation unit (6) when mask data is used. This shows step S72 in FIG. 14 in detail.

ステップS91において、ヒストグラム保持部(5)に格納されているヒストグラムHistLから、画像の最大輝度を求める。図6に示したヒストグラムにおいては、最大輝度は252になる。   In step S91, the maximum luminance of the image is obtained from the histogram HistL stored in the histogram holding unit (5). In the histogram shown in FIG.

ステップS92において、S91で求めた最大輝度と、255から所定量(図6においては、(所定量)=10である)を引き算していって、最大輝度の方が大きくなった時の輝度(LH′、つまりこの例の場合では、255、245、235、…を値を下げていって、その都度最大輝度と比較する。図6においては、LH′=245になる)を求め、所定の割合の画素(図6においては、総画素数の1%)を含む領域を求める。その領域の最小輝度をハイライトポイント(LH、図6においては、LH=234)とする。   In step S92, the maximum brightness obtained in S91 and a predetermined amount (in FIG. 6, (predetermined amount) = 10) is subtracted from 255, and the brightness when the maximum brightness is larger (in FIG. LH ′, that is, in this example, 255, 245, 235,..., Are lowered and compared with the maximum luminance each time (in FIG. 6, LH ′ = 245). A region including a percentage of pixels (1% of the total number of pixels in FIG. 6) is obtained. The minimum luminance of the area is a highlight point (LH, LH = 234 in FIG. 6).

ステップS93において、ヒストグラム保持部(5)に格納されているヒストグラムHistLから、画像の最小輝度を求める。図6に示したヒストグラムにおいては、最小輝度は6になる。   In step S93, the minimum luminance of the image is obtained from the histogram HistL stored in the histogram holding unit (5). In the histogram shown in FIG.

ステップS94において、S93で求めた最小輝度と、0から所定量(図6においては、(所定量)=10である)を足し算していって、最小輝度の方が小さくなった時の輝度(LS′、図6においては、LS′=10)を求め、所定の割合の画素(図6においては、総画素数の1%)を含む領域を求める。その領域の最大輝度をシャドウポイント(LS、図6においては、LS=22)とする。   In step S94, the minimum luminance obtained in S93 is added to a predetermined amount from 0 ((predetermined amount) = 10 in FIG. 6), and the luminance (when the minimum luminance becomes smaller) ( LS ′, LS ′ = 10 in FIG. 6 is obtained, and a region including a predetermined ratio of pixels (1% of the total number of pixels in FIG. 6) is obtained. The maximum luminance of the area is a shadow point (LS, LS = 22 in FIG. 6).

ステップS95において、輝度がLS以上LH以下の範囲の画素で、以下の式を満たす画素のRGBそれぞれの輝度の平均値(RG、GG、BG)を求める。
Max(R、G、B)−Min(R、G、B)=<Thr
ただし、Max(R、G、B)はRGB値の中の最大値、Min(R、G、B)はRGB値の中の最小値、Thrはある閾値。
In step S95, the average values (RG, GG, BG) of the respective RGB colors of the pixels satisfying the following expression are obtained for the pixels having the luminance in the range from LS to LH.
Max (R, G, B) −Min (R, G, B) = <Thr
However, Max (R, G, B) is the maximum value among RGB values, Min (R, G, B) is the minimum value among RGB values, and Thr is a certain threshold value.

ステップS96において、求めたLS、LH、RG、GG、BBからルックアップテーブルLUTR、LUTG、LUTBを作成する。作成したルックアップテーブルの例を図17(a)に示し、詳細を後述する。そして、結果をルックアップテーブル保持部(7)に格納する。また、LH及びLSをもとに、HistL補正用のルックアップテーブルLUTTmpを作成する。   In step S96, lookup tables LUTR, LUTG, and LUTB are created from the obtained LS, LH, RG, GG, and BB. An example of the created lookup table is shown in FIG. 17A and will be described in detail later. Then, the result is stored in the lookup table holding unit (7). Also, a lookup table LUTTmp for HistL correction is created based on LH and LS.

ステップS97において、LUTTmpを用いてHistLMskを補正する。これは、あとで露出補正量を算出する際に使用する。   In step S97, HistLMsk is corrected using LUTTmp. This is used later when calculating the exposure correction amount.

ステップS98において、補正を行った後のHistLMskからマスク領域の平均輝度を求め、所定の方法に従って露出補正用ルックアップテーブルLUTLMskを作成する。そして、結果をルックアップテーブル保持部(7)に格納する。LUTLMskの例を図10(b)に示し、詳細を後述する。   In step S98, the average luminance of the mask area is obtained from the corrected HistLMsk, and an exposure correction lookup table LUTLMsk is created according to a predetermined method. Then, the result is stored in the lookup table holding unit (7). An example of LUTLMsk is shown in FIG. 10B and will be described in detail later.

ステップS99において、ステップS96で作成したルックアップテーブルLUTR、LUTG、LUTB、LUTLMskと、及びルックアップテーブル保持部(7)にあらかじめ格納されている階調特性及び色再現性補正用ルックアップテーブルLUTRDD、LUTGDD、LUTBDDを下記の式に従って合成する。合成したルックアップテーブルLUTR2、LUTG2、LUTB2をルックアップテーブル保持部(7)に格納する。
LUTR2[i]=LUTRDD[LUTLMsk[LUTR[i]]]
LUTG2[i]=LUTGDD[LUTLMsk[LUTG[i]]]
LUTB2[i]=LUTBDD[LUTLMsk[LUTB[i]]]
ただし、上記の式においてiは、0以上最大輝度以下の値である。
In step S99, the lookup tables LUTRDD, LUTG, LUTB, and LUTLMsk created in step S96, and the gradation characteristics and color reproducibility correction lookup table LUTRDD stored in advance in the lookup table holding unit (7), LUTGDD and LUTBDD are synthesized according to the following formula. The synthesized lookup tables LUTR2, LUTG2, and LUTB2 are stored in the lookup table holding unit (7).
LUTR2 [i] = LUTRDD [LUTLMsk [LUTR [i]]]
LUTG2 [i] = LUTGDD [LUTLMsk [LUTG [i]]]
LUTB2 [i] = LUTBDD [LUTLMsk [LUTB [i]]]
In the above formula, i is a value not less than 0 and not more than the maximum luminance.

<作成したルックアップテーブルの例>
作成したルックアップテーブルの例を図17に示す。図17(a)に示すルックアップテーブルLUTR、LUTG、LUTBは、コントラスト、及び色かぶりの補正を行なうためのものである。ここでは、G、B、Rの順に中間調のガンマを立たせている。このように、Rに対してG及びBを強めることで、例えばシアンっぽく色かぶりしている画像の色かぶりを補正することができる。同時に、コントラストの補正もできる。
<Example of created lookup table>
An example of the created lookup table is shown in FIG. The lookup tables LUTR, LUTG, and LUTB shown in FIG. 17A are for correcting contrast and color cast. Here, halftone gamma is set in the order of G, B, and R. In this way, by strengthening G and B with respect to R, it is possible to correct the color cast of an image that is, for example, cyan. At the same time, the contrast can be corrected.

一方、図17(b)に示すルックアップテーブルは、マスク領域の露出を最適に補正するためのルックアップテーブルLUTLMskである。ここで、例えば人物の領域をマスク領域に設定し、LUTLMskを人物の露出が最適に補正できるように設定することもできる。   On the other hand, the lookup table shown in FIG. 17B is a lookup table LUTLMsk for optimally correcting the exposure of the mask area. Here, for example, a person area may be set as a mask area, and LUTLMsk may be set so that the exposure of the person can be optimally corrected.

<フィルタ処理部(11)の動作>
図18にフィルタ処理部(11)の動作の流れを示す。これは、図2のステップS6を詳細に示すものである。
<Operation of Filter Processing Unit (11)>
FIG. 18 shows a flow of the operation of the filter processing unit (11). This shows step S6 in FIG. 2 in detail.

ステップS101において、画像の拡大/縮小処理を行なう。処理には、バイキュービックやバイリニアなどの方法を用いる。   In step S101, image enlargement / reduction processing is performed. For processing, a method such as bicubic or bilinear is used.

ステップS102において、エッジ強調処理を行なう。エッジ強調処理の動作の詳細を図19に示し後述する。   In step S102, edge enhancement processing is performed. Details of the edge enhancement processing are shown in FIG. 19 and will be described later.

<エッジ強調処理>
図19にエッジ強調処理の動作の流れを示す。これは、図18のステップS102を詳細に示したものである。
<Edge enhancement processing>
FIG. 19 shows an operation flow of edge enhancement processing. This shows step S102 in FIG. 18 in detail.

まず、ステップS111において、コピー用画像バッファ(10)から1画素分のRGB輝度データを読み出す。   First, in step S111, RGB luminance data for one pixel is read from the copy image buffer (10).

ステップS112において、読み出したRGB輝度データと閾値をRGBそれぞれについて比較する。その結果、RGB輝度データがすべて閾値よりも小さいか、画像の端の画素だった場合には、ステップS114に進む。それ以外の時には、ステップS113に進む。   In step S112, the read RGB luminance data and the threshold are compared for each of RGB. As a result, if the RGB luminance data are all smaller than the threshold value or are pixels at the end of the image, the process proceeds to step S114. In other cases, the process proceeds to step S113.

ステップS113において、閾値以上の値を有する色成分データについて、3×3のエッジ強調フィルタを用いてフィルタ処理を行なう。なお、閾値以下の色成分データに対してはフィルタ処理を行わない。   In step S113, the color component data having a value equal to or greater than the threshold value is subjected to filter processing using a 3 × 3 edge enhancement filter. Note that filter processing is not performed on color component data that is equal to or less than the threshold value.

ステップS114において、処理されたRGB輝度データを画像バッファ(9)に書き込む。エッジ強調処理をしなかった場合はステップS111で読み込まれたRGB輝度データがそのまま画像バッファ(9)に書き込まれる。   In step S114, the processed RGB luminance data is written into the image buffer (9). When the edge enhancement processing is not performed, the RGB luminance data read in step S111 is written as it is in the image buffer (9).

ステップS115において、全画素終了したかどうかを判定する。全画素終了していなければ、ステップS111に進む。   In step S115, it is determined whether all pixels have been completed. If all the pixels have not been completed, the process proceeds to step S111.

なお、ステップS112で用いる閾値は各色成分に対して同一の閾値を用いても構わないし、各色成分に対して独立に閾値を設定しても構わない。   Note that the threshold value used in step S112 may be the same threshold value for each color component, or may be set independently for each color component.

(第2の実施形態)
前記発明の実施の形態においては、ルックアップテーブル作成の際に、補正後のハイライトポイント及びシャドウポイント(図8(a)のHP及びSP)は常にある定数を使用していたが、撮影情報保持部(13)に格納されている情報を使用して、補正後のハイライトポイント及びシャドウポイントを可変にすることもできる。以下に実施の形態を詳細に述べる。
(Second Embodiment)
In the embodiment of the present invention, when creating the lookup table, the corrected highlight point and shadow point (HP and SP in FIG. 8A) always use certain constants. Using the information stored in the holding unit (13), the corrected highlight point and shadow point can be made variable. The embodiment will be described in detail below.

図25に発明の第2の実施形態における画像補正装置の主要部分の構成を示す。   FIG. 25 shows the configuration of the main part of the image correction apparatus according to the second embodiment of the invention.

図25に示される画像処理装置は、画像入力部(2)、画像出力部(3)、ヒストグラム作成部(4)、ヒストグラム保持部(5)、ルックアップテーブル作成部(6)、ルックアップテーブル保持部(7)、画像補正部(8)、画像バッファ(9)、コピー用画像バッファ(10)、フィルタ処理部(11)、顔検出処理部(12)、撮影情報保持部(13)、補正情報保持部(15)から構成される。   The image processing apparatus shown in FIG. 25 includes an image input unit (2), an image output unit (3), a histogram creation unit (4), a histogram holding unit (5), a lookup table creation unit (6), and a lookup table. Holding unit (7), image correcting unit (8), image buffer (9), image buffer for copying (10), filter processing unit (11), face detection processing unit (12), photographing information holding unit (13), It is comprised from a correction information holding part (15).

このうち、ルックアップテーブル作成部(6)、補正情報保持部(15)以外は前記実施形態において説明したものと同じ動作を行なうので、説明は省略する。   Among them, the operations other than the look-up table creation unit (6) and the correction information holding unit (15) perform the same operations as those described in the above embodiment, and thus the description thereof is omitted.

<第2の実施形態におけるルックアップテーブル作成方法>
図26に補正情報保持部(15)において保持している情報を示す。
<Lookup Table Creation Method in Second Embodiment>
FIG. 26 shows information held in the correction information holding unit (15).

図26においては、フラッシュ使用の有無、ピント距離の範囲を組み合わせて、それぞれの組み合わせに応じて補正後のハイライトポイント及びシャドウポイントを保持している。例えばフラッシュを使用して、ピント距離が短い時は、ハイライトが飛んでいる可能性が強いので、HPの値を低くしてコントラストをあまり強調しないようにしたり、フラッシュ未使用で、ピント距離が長い時は風景写真の可能性が強いので、SPの値を低く、HPの値を高くしてコントラストを強調したりすることが可能になる。このHP及びSPは、ルックアップテーブル作成部(6)において、ルックアップテーブル作成の際(ステップS45及びステップS96)に、補正情報保持部(15)から読み込むことによって使用する。   In FIG. 26, the presence / absence of flash use and the range of the focus distance are combined, and the corrected highlight point and shadow point are held according to each combination. For example, when using a flash and the focus distance is short, there is a strong possibility that the highlight is flying, so lower the HP value so that the contrast is not emphasized too much, or the focus distance is not used when the flash is not used. Since the possibility of a landscape photograph is strong when it is long, it is possible to enhance the contrast by lowering the SP value and increasing the HP value. The HP and SP are used by being read from the correction information holding unit (15) when the lookup table creation unit (6) creates the lookup table (steps S45 and S96).

(他の実施の形態)
<輝度の考え方>
前記実施例においては、輝度データは0から255のデジタル値で実施しているが、これ以外、例えばデータの最大値は255に限定されるものではなく、さらに輝度のみならず網点濃度などでもよいことは言うまでもない。
(Other embodiments)
<Luminance concept>
In the above embodiment, the luminance data is implemented with digital values from 0 to 255. However, other than this, for example, the maximum value of the data is not limited to 255, and not only the luminance but also halftone dot density, etc. Needless to say, it is good.

<輝度値の計算方法>
ステップS32及びステップS82において、輝度値をR:G:B=3:6:1の重みで加重平均して計算しているが、これに限らないことは言うまでもなく、例えばこれ以外の重みで計算してもいいし、RGBの最大値と最小値の平均値で求めてもよい。
<Calculation method of luminance value>
In step S32 and step S82, the luminance value is calculated by weighted averaging with a weight of R: G: B = 3: 6: 1, but needless to say, the calculation is performed with other weights, for example. Alternatively, the average value of the maximum value and the minimum value of RGB may be obtained.

<顔検出結果の示し方>
前記実施例においては、顔検出の結果を矩形で示したが、矩形に限らないことは言うまでもなく、例えば輪郭部分を抽出したものを結果としてもよい。
<How to show face detection results>
In the above-described embodiment, the face detection result is indicated by a rectangle. However, it is needless to say that the face detection result is not limited to a rectangle.

<撮影時のカメラの向きと、画像バッファに格納する画像データ>
図23において、撮影時のカメラの向きと、画像バッファに格納する画像データについて、4つの場合について記述しているが、この4種類とは限らないことはいうまでもなく、例えば45°傾けて撮影された場合には、逆方向に45°傾けて画像バッファに格納するようにしてもよい。
<Camera orientation during shooting and image data stored in image buffer>
In FIG. 23, four cases are described with respect to the direction of the camera at the time of shooting and the image data stored in the image buffer. However, it is needless to say that the four types are not necessarily limited to, for example, tilted by 45 °. When the image is taken, the image may be stored in the image buffer by being inclined 45 ° in the reverse direction.

<撮影情報の利用方法>
前記実施例においては、撮影情報としてはカメラの位置のみしか使用していないが、図20に示すように、カメラのIDを使用して、図9に示す出力目標物プロファイルを切り替えるようにしてもよい。また、ピントの合った位置を使用することで、露出補正用ルックアップテーブルLUTL作成の際に、ピントの合った位置を中心に作成するようにしてもよい。
<How to use shooting information>
In the above embodiment, only the position of the camera is used as the shooting information. However, as shown in FIG. 20, the output target profile shown in FIG. 9 is switched using the camera ID. Good. In addition, by using the in-focus position, the exposure correction lookup table LUTL may be created around the in-focus position.

<補正情報保持部(15)において保持している情報について>
前記第2の実施例においては、補正情報保持部(15)において、補正後のハイライトポイント(HP)及びシャドウポイント(SP)を保持していたが、HP、SPだけに限らないことは言うまでもない。例えば、露出補正の方法も保持するようにして、フラッシュ未使用、ピント距離が長い時は、露出アンダーの可能性が強いので、露出補正を通常よりも明るめに設定するようにしてもよい。
<About information held in the correction information holding unit (15)>
In the second embodiment, the correction information holding unit (15) holds the corrected highlight point (HP) and shadow point (SP), but it goes without saying that it is not limited to HP and SP. Yes. For example, the exposure correction method is also maintained, and when the flash is not used and the focus distance is long, there is a strong possibility of underexposure. Therefore, the exposure correction may be set brighter than usual.

<その他>
本発明は複数の機器(例えばホストコンピュータ、インタフェース機器、リーダ、プリンタ等)から構成されるシステムに適用しても一つの機器(例えば複写機、ファクシミリ装置)からなる装置に適用してもよい。
<Others>
The present invention may be applied to a system composed of a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.) or an apparatus composed of a single device (for example, a copying machine, a facsimile machine).

また前述した実施形態の機能を実現する様に各種のデバイスを動作させる様に該各種デバイスと接続された装置あるいはシステム内のコンピュータに、前記実施形態機能を実現するためのソフトウェアのプログラムコードを供給し、そのシステムあるいは装置のコンピュータ(CPUあるいはMPU)を格納されたプログラムに従って前記各種デバイスを動作させることによって実施したものも本発明の範疇に含まれる。   In addition, program code of software for realizing the functions of the embodiment is supplied to an apparatus or a computer in the system connected to the various devices so as to operate the various devices so as to realize the functions of the above-described embodiments. However, the present invention also includes those implemented by operating the various devices according to a program stored in a computer (CPU or MPU) of the system or apparatus.

またこの場合、前記ソフトウェアのプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコード自体、及びそのプログラムコードをコンピュータに供給するための手段、例えばかかるプログラムコードを格納した記憶媒体は本発明を構成する。   In this case, the program code of the software itself realizes the functions of the above-described embodiments, and the program code itself and means for supplying the program code to the computer, for example, a memory storing the program code The medium constitutes the present invention.

かかるプログラムコードを格納する記憶媒体としては例えばフロッピー(登録商標)ディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、磁気テープ、不揮発性のメモリカード、ROM等を用いることができる。   As a storage medium for storing the program code, for example, a floppy (registered trademark) disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.

またコンピュータが供給されたプログラムコードを実行することにより、前述の実施形態の機能が実現されるだけではなく、そのプログラムコードがコンピュータにおいて稼働しているOS(オペレーティングシステム)、あるいは他のアプリケーションソフト等と共同して前述の実施形態の機能が実現される場合にもかかるプログラムコードは本発明の実施形態に含まれることは言うまでもない。   Further, by executing the program code supplied by the computer, not only the functions of the above-described embodiments are realized, but also the OS (operating system) in which the program code is running on the computer, or other application software, etc. It goes without saying that the program code is also included in the embodiment of the present invention even when the functions of the above-described embodiment are realized in cooperation with the embodiment.

さらに、供給されたプログラムコードが、コンピュータの機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに格納された後そのプログラムコードの指示に基づいてその機能拡張ボードや機能格納ユニットに備わるCPU等が実際の処理の一部または全部を行ない、その処理によって前述した実施形態の機能が実現される場合も本発明に含まれることは言うまでもない。   Further, after the supplied program code is stored in the memory provided in the function expansion board of the computer or the function expansion unit connected to the computer, the CPU provided in the function expansion board or function storage unit based on the instruction of the program code Needless to say, the present invention includes a case where the functions of the above-described embodiment are realized by performing part or all of the actual processing.

本願実施形態の画像処理装置の構成を示す図。The figure which shows the structure of the image processing apparatus of this-application embodiment. 本願実施形態での処理の流れを示す図。The figure which shows the flow of a process in this embodiment. 画像入力部(2)での動作を示す図。The figure which shows the operation | movement in an image input part (2). 画像補正の流れを示す図。The figure which shows the flow of image correction. ヒストグラム作成部(4)での動作を示す図。The figure which shows the operation | movement in a histogram preparation part (4). ヒストグラムの例を示す図。The figure which shows the example of a histogram. ルックアップテーブル作成部(6)での動作を示す図。The figure which shows operation | movement in a look-up table preparation part (6). ルックアップテーブル保持部(7)で保持されているルックアップテーブルの例を示す図。The figure which shows the example of the lookup table currently hold | maintained by the lookup table holding | maintenance part (7). 出力目標物プロファイルの例。Example output target profile. 入力機器プロファイルの例。An example of an input device profile. 出力機器プロファイルの例。An example of an output device profile. 画像補正部(8)での動作を示す図。The figure which shows operation | movement in an image correction part (8). 顔検出処理部(12)での動作を示す図。The figure which shows operation | movement in a face detection process part (12). マスクデータを使用する場合の、画像補正処理の流れを示す図。The figure which shows the flow of an image correction process in the case of using mask data. マスクデータを使用する場合の、ヒストグラム処理部(4)での動作を示す図。The figure which shows the operation | movement in a histogram process part (4) in the case of using mask data. マスクデータを使用する場合の、ルックアップテーブル作成部(6)での動作を示す図。The figure which shows operation | movement in the lookup table preparation part (6) in the case of using mask data. マスクデータを使用する場合の、ルックアップテーブル保持部(7)で保持されているルックアップテーブルの例を示す図。The figure which shows the example of the lookup table hold | maintained by the lookup table holding | maintenance part (7) in the case of using mask data. フィルタ処理部(11)での動作を示す図。The figure which shows the operation | movement in a filter process part (11). エッジ強調処理の流れを示す図。The figure which shows the flow of an edge emphasis process. 画像バッファ(9)で格納されている撮影情報及び画像データの例を示す図。The figure which shows the example of the imaging | photography information and image data which are stored in the image buffer (9). 階調再現及び色再現性補正用ルックアップテーブルの合成方法を示す図。The figure which shows the synthetic | combination method of the look-up table for gradation reproduction and color reproducibility correction | amendment. 合成された階調再現及び色再現性補正用ルックアップテーブル例を示す図。The figure which shows the example of the look-up table for the synthesized gradation reproduction and color reproducibility correction | amendment. デジタルカメラの撮影時の向きと、画像バッファ(9)への展開方法の関係を示す図。The figure which shows the relationship between the direction at the time of imaging | photography of a digital camera, and the expansion | deployment method to an image buffer (9). 顔検出の流れを示す図。The figure which shows the flow of face detection. 本願第2の実施形態の画像処理装置の構成を示す図。The figure which shows the structure of the image processing apparatus of 2nd Embodiment of this application. 補正情報保持部(15)において保持している情報を示す図。The figure which shows the information hold | maintained in a correction information holding part (15).

符号の説明Explanation of symbols

1 入力画像
2 画像入力部
3 画像出力部
4 ヒストグラム作成部
5 ヒストグラム保持部
6 ルックアップテーブル作成部
7 ルックアップテーブル保持部
8 画像補正部
9 画像バッファ
10 コピー用画像バッファ
11 フィルタ処理部
12 顔検出処理部
13 撮影情報保持部
14 出力画像
15 補正情報保持部
DESCRIPTION OF SYMBOLS 1 Input image 2 Image input part 3 Image output part 4 Histogram creation part 5 Histogram holding part 6 Lookup table creation part 7 Lookup table holding part 8 Image correction part 9 Image buffer 10 Copy image buffer 11 Filter processing part 12 Face detection Processing unit 13 Shooting information holding unit 14 Output image 15 Correction information holding unit

Claims (8)

入力画像の解析を行なう解析手段と、前記解析結果に応じて補正パラメータを設定する設定手段と、前記設定された補正パラメータを用いて前記入力画像を補正する画像補正手段と、前記補正した画像を用いてあらかじめ設定された対象物を検出する検出手段とを有することを特徴とする対象物検出手段。   Analysis means for analyzing an input image, setting means for setting a correction parameter according to the analysis result, image correction means for correcting the input image using the set correction parameter, and the corrected image Object detection means comprising: detection means for detecting an object set in advance using the object detection means. 前記解析手段は、入力画像のヒストグラムを作成することを特徴とし、
前記設定手段は、前記作成されたヒストグラムから画像のハイライト、シャドウ、露出状態を算出し、算出結果及び前記検出結果に基づいて補正用ルックアップテーブルを作成することを特徴とし、
前記画像補正手段は前記作成された補正用ルックアップテーブルを用いて前記入力画像を補正することを特徴とする請求項1に記載の対象物検出手段。
The analysis means creates a histogram of the input image,
The setting means calculates the highlight, shadow, exposure state of the image from the created histogram, and creates a correction lookup table based on the calculation result and the detection result,
The object detection unit according to claim 1, wherein the image correction unit corrects the input image using the created correction lookup table.
前記検出手段は、前記あらかじめ設定した対象の位置と大きさを検出し、検出された前記あらかじめ設定した対象の部分をマスクするマスク画像を作成することを特徴とする請求項1に記載の画像補正手段。   2. The image correction according to claim 1, wherein the detection unit detects a position and a size of the preset target, and creates a mask image that masks the detected preset target portion. 3. means. 前記マスクは、矩形形状であることを特徴とする請求項3に記載の画像補正手段。   The image correction means according to claim 3, wherein the mask has a rectangular shape. 前記あらかじめ設定した対象物は、人物の顔であることを特徴とする請求項4に記載の画像補正手段。   The image correction means according to claim 4, wherein the preset object is a human face. 前記マスクは、人物の顔の形状であることを特徴とする請求項5に記載の画像補正手段。   The image correction means according to claim 5, wherein the mask has a shape of a human face. 入力画像の解析を行なう解析部と、前記解析結果に応じて補正パラメータを設定する設定部と、前記設定された補正パラメータを用いて前記入力画像を補正する画像補正部と、前記補正した画像を用いてあらかじめ設定された対象物を検出する検出部とを有することを特徴とする対象物検出装置。   An analysis unit that analyzes an input image, a setting unit that sets a correction parameter according to the analysis result, an image correction unit that corrects the input image using the set correction parameter, and the corrected image An object detection apparatus comprising: a detection unit that detects an object set in advance by using the detection unit. 入力画像の解析を行なう解析方法と、前記解析結果に応じて補正パラメータを設定する設定方法と、前記設定された補正パラメータを用いて前記入力画像を補正する画像補正方法と、前記補正した画像を用いてあらかじめ設定された対象物を検出する検出方法とを有することを特徴とする対象物検出方法。   An analysis method for analyzing an input image, a setting method for setting a correction parameter according to the analysis result, an image correction method for correcting the input image using the set correction parameter, and the corrected image And a detection method for detecting an object set in advance using the target detection method.
JP2004198001A 2004-07-05 2004-07-05 Object detection means, device, and method Withdrawn JP2006018739A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004198001A JP2006018739A (en) 2004-07-05 2004-07-05 Object detection means, device, and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004198001A JP2006018739A (en) 2004-07-05 2004-07-05 Object detection means, device, and method

Publications (1)

Publication Number Publication Date
JP2006018739A true JP2006018739A (en) 2006-01-19

Family

ID=35792935

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004198001A Withdrawn JP2006018739A (en) 2004-07-05 2004-07-05 Object detection means, device, and method

Country Status (1)

Country Link
JP (1) JP2006018739A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7940964B2 (en) 2006-01-23 2011-05-10 Seiko Epson Corporation Method and image processor for processing image data to adjust for brightness in face, and method and apparatus for printing with adjusted image data
US8447132B1 (en) 2009-12-09 2013-05-21 CSR Technology, Inc. Dynamic range correction based on image content

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7940964B2 (en) 2006-01-23 2011-05-10 Seiko Epson Corporation Method and image processor for processing image data to adjust for brightness in face, and method and apparatus for printing with adjusted image data
US8447132B1 (en) 2009-12-09 2013-05-21 CSR Technology, Inc. Dynamic range correction based on image content

Similar Documents

Publication Publication Date Title
US7580566B2 (en) Image processing device, image processing method, storage medium, and program
JP5089405B2 (en) Image processing apparatus, image processing method, and imaging apparatus
WO2018176925A1 (en) Hdr image generation method and apparatus
US8265429B2 (en) Image processing apparatus and methods for laying out images
US8687884B2 (en) Image processing apparatus and method
JP2001313844A (en) Method and device for executing local color correction
CN113592739B (en) Lens shading correction method, device and storage medium
JPH09233423A (en) Image data converting method for digital printer
JP4176369B2 (en) Compensating digital images for optical falloff while minimizing changes in light balance
JP2006343863A (en) Image processor and image processing method
JP2009065350A (en) Image processor, image processing method, and storage medium
JP2009021771A (en) Video adjustment method
JP4979090B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP2009145991A (en) Image processor, image processing method, program, and storage medium
JP2006018740A (en) Image processing means, device, and method
JPH08110603A (en) Color adjusting method and device
JP2006018739A (en) Object detection means, device, and method
JP2004157641A (en) Image processing method, image processing apparatus, image processing program and recording medium with image processing program recorded thereon
JP2000224418A (en) Mask for changing lightness profile of photo copying
JP2009070099A (en) Image-processing device, image-processing method, program and recording medium
JP2006018738A (en) Object detection means, device and method
JP4333016B2 (en) Image forming apparatus, image data processing method, and recording medium recording image data processing program
JP2010033527A (en) Method, program, and apparatus for processing photographic image
JPH11317873A (en) Image correction device and storage medium
JP4507078B2 (en) Automatic face image correction method and apparatus

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20071002