JP4781299B2 - Image processing apparatus, image processing method, and imaging apparatus - Google Patents
Image processing apparatus, image processing method, and imaging apparatus Download PDFInfo
- Publication number
- JP4781299B2 JP4781299B2 JP2007050200A JP2007050200A JP4781299B2 JP 4781299 B2 JP4781299 B2 JP 4781299B2 JP 2007050200 A JP2007050200 A JP 2007050200A JP 2007050200 A JP2007050200 A JP 2007050200A JP 4781299 B2 JP4781299 B2 JP 4781299B2
- Authority
- JP
- Japan
- Prior art keywords
- red
- eye
- area
- region
- turned
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Stroboscope Apparatuses (AREA)
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
Description
本発明は画像処理装置及び画像処理方法に関し、フラッシュ撮影された撮像画像中に発生した赤目現象を検出するための画像処理装置及び画像処理方法に関する。また、本発明はさらに、このような画像処理装置を有する撮像装置に関する。 The present invention relates to an image processing apparatus and an image processing method, and more particularly to an image processing apparatus and an image processing method for detecting a red-eye phenomenon that occurs in a captured image taken with a flash. The present invention further relates to an imaging apparatus having such an image processing apparatus.
人物をフラッシュ撮影した場合、目が赤く撮影されてしまう赤目現象が撮像画像に発生することがある。この赤目現象は、暗所で開いている瞳孔に入射したフラッシュ光が網膜の血管を写し出してしまう現象である。 When a person is photographed with flash, a red-eye phenomenon in which the eyes are photographed in red may occur in the captured image. This red-eye phenomenon is a phenomenon in which flash light incident on a pupil that is open in a dark place projects the blood vessels of the retina.
本撮影前に一度フラッシュなどを点灯(プリ発光)させ、瞳孔を収縮させた後に本撮影を行うことにより赤目現象を抑制する赤目緩和機能を備えた撮像装置が知られている。 2. Description of the Related Art There is known an imaging apparatus having a red-eye alleviation function that suppresses a red-eye phenomenon by turning on a flash or the like (pre-light emission) once before main imaging and performing main imaging after constricting the pupil.
また、撮像画像から人物の目を検出し、赤目現象が発生していると判断される場合には画像処理によって自動または半自動で補正する赤目補正処理についても知られている。特許文献1には、肌色とみなされる領域を切り出すことでまず顔検出を行い、検出された顔領域内に対して赤目検出を行う方法が開示されている。また、特許文献2には、顔形状モデルと顔確率を比較するアルゴリズムと、パターンマッチングを併用して顔検出を行うカメラが開示されている。
Also known is a red-eye correction process in which a human eye is detected from a captured image and when it is determined that a red-eye phenomenon has occurred, correction is performed automatically or semi-automatically by image processing. Japanese Patent Application Laid-Open No. 2004-228561 discloses a method of first detecting a face by cutting out an area regarded as a skin color, and then detecting red eyes within the detected face area.
しかしながら、本撮影前に被写体に光を照射して瞳孔を小さくする前者の方法では、被写体がカメラを注視していない場合は赤目緩和効果が小さい。また、撮影後に画像処理を適用する方法では、撮像画像から顔検出ができなかった場合や、顔検出ができても赤目として認識できない場合等には、やはり赤目緩和効果が期待できない。 However, in the former method of reducing the pupil by irradiating the subject with light before the main photographing, the red-eye alleviating effect is small when the subject is not gazing at the camera. In addition, in the method of applying image processing after shooting, the red-eye alleviation effect cannot be expected when face detection cannot be performed from the captured image, or when face detection cannot be recognized as red-eye.
このように、いずれの方法にも長所と短所があるため、プリ発光のON/OFF、赤目補正処理のON/OFFを任意の組み合わせで選択可能なカメラが開発されている。 As described above, since each method has advantages and disadvantages, a camera that can select ON / OFF of pre-light emission and ON / OFF of red-eye correction processing in any combination has been developed.
しかしながら、組み合わせによっては期待した赤目緩和結果を得られないことがあった。例えば、プリ発光ONで撮影した画像に赤目現象が生じた場合と、プリ発光OFFで撮影した画像に赤目現象が発生した場合とでは、赤目補正処理の効果が異なりうる。 However, depending on the combination, the expected red-eye reduction result may not be obtained. For example, the effect of red-eye correction processing may differ between a case where a red-eye phenomenon occurs in an image shot with pre-flash ON and a case where a red-eye phenomenon occurs in an image shot with pre-flash OFF.
プリ発光ONで撮影した画像に生じる赤目領域は、プリ発光による瞳孔の収縮がいくらかでも生じれば、プリ発光OFFで撮影した画像に生じる赤目領域よりも小さく、かつ赤目領域の赤色の彩度が低くなる。そのため、プリ発光OFFで撮影した画像よりも赤目領域が認識しにくくなからである。 The red-eye area generated in the image shot with the pre-flash ON is smaller than the red-eye area generated in the image shot with the pre-flash OFF, and the red saturation of the red-eye area is smaller if any pupil contraction occurs due to the pre-flash. Lower. For this reason, the red-eye region is more difficult to recognize than an image captured with pre-flash OFF.
本発明はこのような従来技術の問題を解決するためになされたものである。本発明は、赤目緩和ランプの点灯時でも非点灯時でも、撮像画像から精度良く赤目領域を検出可能な画像処理装置及び画像処理方法を提供することを目的とする。 The present invention has been made to solve such problems of the prior art. An object of the present invention is to provide an image processing apparatus and an image processing method capable of accurately detecting a red-eye region from a captured image regardless of whether a red-eye reduction lamp is lit or not.
上述の目的は、撮像画像から赤目領域を検出する画像処理装置であって、撮像画像を取得する取得手段と、撮像画像の撮影前に、赤目現象を低減するための光源が点灯されたか、非点灯であったかを判別する判別手段と、撮像画像中の顔領域を検出する顔検出手段と、顔領域中から予め定めた条件を満たす領域を赤目領域として検出する赤目領域検出手段とを有し、赤目領域検出手段が、光源が点灯されたと判別手段により判別された場合には、非点灯であったと判別された場合よりも予め定めた条件を緩くして検出を行うことを特徴とする画像処理装置によって達成される。 The above-described object is an image processing apparatus that detects a red-eye region from a captured image, and an acquisition unit that acquires the captured image and a light source for reducing the red-eye phenomenon are turned on before or after the captured image is captured. A determination means for determining whether the light is on, a face detection means for detecting a face area in the captured image, and a red-eye area detection means for detecting an area satisfying a predetermined condition from the face area as a red-eye area, An image characterized in that when the red-eye area detection means determines that the light source is turned on, the detection means performs detection with a predetermined condition looser than when it is determined that the light source is not turned on. Achieved by processing equipment.
また、上述の目的は、本発明の画像処理装置と、赤目現象を低減するための光源及びフラッシュとして機能する少なくとも1つの光源とを有する撮像装置であって、画像処理装置が、少なくとも1つの光源を用いてフラッシュ撮影した撮像画像から赤目領域を検出することを特徴とする撮像装置によっても達成される。 Another object of the present invention is to provide an imaging apparatus having the image processing apparatus of the present invention and at least one light source that functions as a flash and a light source for reducing the red-eye phenomenon, and the image processing apparatus includes at least one light source. It is also achieved by an imaging apparatus characterized by detecting a red-eye area from a captured image taken with a flash.
また、上述の目的は、撮像画像から赤目領域を検出する画像処理方法であって、取得手段が、記憶装置から撮像画像を取得する取得工程と、撮像画像の撮影前に、赤目現象を低減するための光源が点灯されたか、非点灯であったかを判別手段が判別する判別工程と、顔検出手段が、撮像画像中の顔領域を検出する顔検出工程と、赤目領域検出手段が、顔領域中から予め定めた条件を満たす領域を赤目領域として検出する赤目領域検出工程とを有し、赤目領域検出工程において赤目領域検出手段は、光源が点灯されたと判別工程で判別された場合には、非点灯であったと判別された場合よりも予め定めた条件を緩くして検出を行うことを特徴とする画像処理方法によっても達成される。 In addition, the above-described object is an image processing method for detecting a red-eye region from a captured image, in which an acquisition unit acquires a captured image from a storage device, and reduces a red-eye phenomenon before capturing the captured image. or the light source has been lit for a determination step of whether an even non lighting discrimination means for discriminating, face detection means, a face detection step of detecting a face area in the captured image, the eye region detection unit, in the face area pressurized et predetermined condition is satisfied region and a red-eye region detection step of detecting a red-eye region, the red-eye region detection means in the red-eye region detection step, when the light source is determined by the determination step is lit It is also achieved by an image processing method characterized in that detection is performed with a predetermined condition relaxed compared to the case where it is determined that the light is not lit.
さらに、上述の目的は、本発明の画像処理方法の各工程をコンピュータに実行させるためのプログラム、又はこのプログラムを記録したコンピュータ読み取り可能な記録媒体によっても達成される。 Furthermore, the above-described object is achieved by a program for causing a computer to execute each step of the image processing method of the present invention, or a computer-readable recording medium on which the program is recorded.
このような構成により、本発明によれば、赤目緩和ランプの点灯時でも非点灯時でも、撮像画像から精度良く赤目領域を検出可能となる。 With such a configuration, according to the present invention, it is possible to detect the red-eye region from the captured image with high accuracy regardless of whether the red-eye reduction lamp is lit or not.
以下、添付図面を参照して、本発明の好適な実施形態について詳細に説明する。
図1は、本発明の実施形態に係る画像処理装置の一例としてのデジタルスチルカメラ(DSC)100の構成例を示す図である。
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.
FIG. 1 is a diagram illustrating a configuration example of a digital still camera (DSC) 100 as an example of an image processing apparatus according to an embodiment of the present invention.
10は撮影レンズ、12は絞り機能を備えるシャッター、14は光学像を電気信号に変換する、CCDやCMOSセンサ等の撮像素子、16は撮像素子14のアナログ信号出力をディジタル信号に変換するA/D変換器である。
10 is a photographing lens, 12 is a shutter having an aperture function, 14 is an image sensor such as a CCD or CMOS sensor that converts an optical image into an electrical signal, and 16 is an A / A that converts an analog signal output of the
タイミング発生部18は撮像素子14、A/D変換器16、D/A変換器26にクロック信号や制御信号を供給し、メモリ制御部22及びシステム制御部50により制御される。
The
画像処理部20は、A/D変換器16からのデータ或いはメモリ制御部22からのデータに対して所定の画素補間処理や色変換処理を行う。
The
また、画像処理部20においては、撮像した画像データを用いて所定の演算処理を行う。そして、得られた演算結果に基づいてシステム制御部50が露光制御部40、測距制御部42を制御し、TTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)、AE(自動露出)、EF(フラッシュプリ発光)機能を実現している。
Further, the
さらに、画像処理部20においては、撮像した画像データを用いて所定の演算処理を行い、得られた演算結果に基づいてTTL方式のAWB(オートホワイトバランス)処理も行っている。
Further, the
メモリ制御部22は、A/D変換器16、タイミング発生部18、画像処理部20、画像表示メモリ24、D/A変換器26、メモリ30、圧縮伸長部32を制御する。
The
A/D変換器16の出力データが画像処理部20、メモリ制御部22を介して、或いはA/D変換器16の出力データが直接メモリ制御部22を介して、画像表示メモリ24或いはメモリ30に書き込まれる。
The output data of the A /
画像表示メモリ24に書き込まれた表示用の画像データは、D/A変換器26を介してLCDや有機ELディスプレイ等の画像表示部28により表示される。撮像した画像データを画像表示部28で逐次表示すれば、電子ファインダー機能を実現することが可能である。
Display image data written in the
また、画像表示部28は、システム制御部50の指示により任意に表示をON/OFFすることが可能であり、表示をOFFにした場合にはDSC100の電力消費を大幅に低減することができる。
The
メモリ30は撮影した静止画像や動画像を格納する記憶装置であり、所定枚数の静止画像や所定時間の動画像を格納するのに十分な記憶容量を備えている。そのため、複数枚の静止画像を連続して撮影する連写撮影やパノラマ撮影の場合にも、高速かつ大量の画像書き込みをメモリ30に対して行うことが可能となる。
また、メモリ30はシステム制御部50の作業領域としても使用することが可能である。
The
The
圧縮伸長部32は、メモリ30に格納された撮像画像を読み込んで、適応離散コサイン変換(ADCT)、ウェーブレット変換等を用いた周知のデータ圧縮処理或いは伸長処理を行い、処理を終えたデータをメモリ30に書き込む。
露光制御部40は絞り機能を備えるシャッター12を制御するとともに、フラッシュ48と連携することによりフラッシュ調光機能も有する。
The compression /
The
測距制御部42は撮影レンズ10のフォーカシングを制御し、ズーム制御部44は撮影レンズ10のズーミングを制御する。バリア制御部46は撮影レンズ10の保護を行うためのレンズバリア102の動作を制御する。
The distance
フラッシュ48は撮影時の補助光源として機能し、調光機能も有する。また、AF補助光の投光機能も有する。
赤目緩和ランプ49は、フラッシュ48を用いる撮影(フラッシュ撮影)前に、約1秒間発光することによって、被写体である人の瞳孔を小さくするための光源である。上述したように、撮影直前に瞳孔を小さくすることによって、フラッシュ発光撮影時の赤目現象を低減することができる。
The
The red-eye reduction lamp 49 is a light source for reducing the pupil of a person who is a subject by emitting light for about 1 second before photographing using the flash 48 (flash photographing). As described above, by reducing the pupil immediately before shooting, the red-eye phenomenon at the time of flash shooting can be reduced.
なお、本実施形態においては、フラッシュ48と別の光源である赤目緩和ランプ49を設け、フラッシュ48は本撮影時のみ点灯するものとしたが、フラッシュ48を本撮影前にプリ発光させ、赤目緩和ランプ49として用いてもよい。つまり、本実施形態の撮像装置は、赤目緩和ランプ及びフラッシュとして機能する少なくとも1つの光源を備えていればよい。
In this embodiment, a red-eye mitigation lamp 49, which is a light source different from the
露光制御部40、測距制御部42はTTL方式を用いて制御されており、撮像した画像データを画像処理部20によって演算した演算結果に基づき、システム制御部50が露光制御部40、測距制御部42に対して制御を行う。
The
システム制御部50は例えばCPUであり、メモリ52に記憶されたプログラムを実行することによりDSC100全体を制御する。メモリ52はシステム制御部50の動作用の定数、変数、プログラム等を記憶する。
The
本実施形態において、システム制御部50は、メモリ30に書き込まれた画像データに対して顔検出処理を行ない、人物の顔領域を検出する顔検出部として機能する。もちろん、顔検出部を独立した構成として設けることも可能である。
In the present embodiment, the
表示部54は例えばLCDやLED、スピーカ等の出力装置の組み合わせにより構成され、システム制御部50でのプログラムの実行に応じて、文字、画像、音声等を用いて動作状態やメッセージ等を出力する。表示部54はDSC100の操作部70近辺の視認し易い位置に、単数或いは複数設置される。また、表示部54の一部は光学ファインダー104内に設置されている。
The
表示部54の表示内容としては、例えば、シングルショット/連写撮影表示、セルフタイマー表示、圧縮率表示、記録画素数表示、記録枚数表示、残撮影可能枚数表示、シャッタースピード表示、絞り値表示、露出補正表示がある。また、フラッシュ表示、赤目緩和表示、マクロ撮影表示、ブザー設定表示、時計用電池残量表示、電池残量表示、エラー表示、複数桁の数字による情報表示、記録媒体200及び210の着脱状態表示、通信I/F動作表示、日付け・時刻表示がある。さらに、外部コンピュータとの接続状態を示す表示、合焦表示、撮影準備完了表示、手振れ警告表示、フラッシュ充電表示、記録媒体書き込み動作表示、等がある。この一部は光学ファインダー104内に表示される。
The display content of the
さらに、表示部54の表示内容のうち、LED等により表示するものとしては、例えば以下のものがある。合焦表示、撮影準備完了表示、手振れ警告表示、手振れ警告表示、フラッシュ充電表示、フラッシュ充電完了表示、記録媒体書き込み動作表示、マクロ撮影設定通知表示、二次電池充電状態表示等。
Further, among the display contents of the
そして、表示部54の表示内容のうち、ランプ等により表示するものとしては、例えば、セルフタイマー通知ランプ、等がある。このセルフタイマー通知ランプは、AF補助光と共用して用いても良い。
不揮発性メモリ56は電気的に消去・記録可能なメモリであり、例えばEEPROM等が用いられる。
Of the display contents of the
The
モードスイッチ60、シャッタースイッチ62及び64、フラッシュ設定ボタン68及び操作部70は、システム制御部50に各種の動作指示を入力するための操作手段を構成する。これらは、ボタン、スイッチ、ダイアル、タッチパネル、視線検知によるポインティング、音声認識装置等の単数或いは複数の組み合わせで構成される。
The
ここで、これらの操作手段の具体的な説明を行う。
モードスイッチ60は、例えば、撮影モード、再生モード、動画撮影モード、静止画撮影モード等の各機能モードを切り替え設定するためのスイッチである。
Here, a specific description of these operating means will be given.
The
第1シャッタースイッチSW1(62)は、DSC100に設けられたシャッターボタン(図示せず)の操作途中(半押し)でONとなる。SW1 62のONにより、AF(オートフォーカス)処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理、EF(フラッシュプリ発光)処理等の動作が開始される。
The first shutter switch SW1 (62) is turned ON during the operation (half press) of a shutter button (not shown) provided in the
第2シャッタースイッチSW2(64)は、不図示のシャッターボタンの操作完了(全押し)でONとなる。SW2 64のONにより、一連の本撮影処理の開始が指示される。具体的には、撮像素子14から読み出した信号をA/D変換器16、メモリ制御部22を介してメモリ30に撮像画像データとして書き込む露光処理、画像処理部20やメモリ制御部22での演算を用いた現像処理が行われる。さらに、メモリ30から撮像画像データを読み出し、圧縮伸長部32で圧縮を行い、付加情報を加えるなどして所定形式の撮像画像データファイルに変換して、記録媒体200或いは210に書き込む記録処理が行われる。
The second shutter switch SW2 (64) is turned on when the operation of a shutter button (not shown) is completed (fully pressed). When
フラッシュ設定ボタン68は、フラッシュの動作モードを設定・変更するボタンである。本実施形態において設定可能なモードは、オート、常時発光、赤目緩和オート、常時発光(赤目緩和)がある。オートは、被写体の明るさに応じて自動的にフラッシュを発光して撮影するモードである。常時発光は、常にフラッシュを発光して撮影するモードである。赤目緩和オートは、被写体の明るさに応じて自動的にフラッシュを発光して撮影するとともに、フラッシュ発光の際には、常に赤目緩和ランプを発光するモードである。常時発光(赤目緩和)は、常に赤目緩和ランプとストロボを発光して撮影するモードである。
The
操作部70は各種ボタンやタッチパネル等からなり、後述する電源ON/OFFボタン201、セットボタン204、メニューボタン205、十字ボタン209、削除ボタン207、表示ON/OFFボタン208などが含まれる。
The
操作部70はこの他にも、以下の1つ以上を含みうる。マルチ画面再生改ページボタン、単写/連写/セルフタイマー切り替えボタン、メニュー移動+(プラス)ボタン、メニュー移動−(マイナス)ボタン。再生画像移動+(プラス)ボタン、再生画像移動−(マイナス)ボタン、撮影画質選択ボタン、露出補正ボタン、日付/時間設定ボタン、圧縮モードスイッチ等。
In addition to this, the
圧縮モードスイッチは、JPEG(Joint Photographic Expert Group)圧縮の圧縮率を選択するため、或いは撮像素子の信号をそのままディジタル化して記録媒体に記録するRAWモードを選択するためのスイッチである。 The compression mode switch is a switch for selecting a compression rate for JPEG (Joint Photographic Expert Group) compression, or for selecting a RAW mode in which a signal from an image sensor is directly digitized and recorded on a recording medium.
本実施形態において、JPEG圧縮のモードは、例えばノーマルモードとファインモードが用意されている。DSC100の利用者は、撮影した画像のデータサイズを重視する場合はノーマルモードを、撮影した画像の画質を重視する場合はファインモードを、それぞれ選択して撮影を行うことができる。
In the present embodiment, for example, a normal mode and a fine mode are prepared as JPEG compression modes. The user of the
JPEG圧縮のモードにおいては、圧縮伸長部32が、メモリ30に書き込まれた画像データを読み出し、設定された圧縮率に圧縮する。その後、圧縮伸長部32は、赤目緩和ランプの点灯、非点灯を表す情報などの付加情報を加え、撮像画像データファイルとして例えば記録媒体200に記録する。
In the JPEG compression mode, the compression /
RAWモードでは、撮像素子14の色フィルタの画素配列に応じて、ライン毎にそのまま画像データを読み出し、A/D変換器16、メモリ制御部22を介して、メモリ30に書き込まれた画像データを読み出し、記録媒体200に記録する。なお、RAWデータファイルには、表示用としてJPEG圧縮したデータ(付加情報含む)も記録されることがある。
In the RAW mode, the image data is read as it is for each line according to the pixel arrangement of the color filter of the
電源制御部80は、電池検出回路、DC−DCコンバータ、通電するブロックを切り替えるスイッチ回路等により構成される。電源制御部80は、電池の装着の有無、電池の種類、電池残量の検出を行い、検出結果及びシステム制御部50の指示に基づいてDC−DCコンバータを制御し、必要な電圧を必要な期間、記録媒体を含む各部へ供給する。
The
電源86はアルカリ電池やリチウム電池等の一次電池やNiCd電池やNiMH電池、Li電池等の二次電池、或いはACアダプター等からなり、コネクタ82及び84によってDSC100に取り付けられる。
The
メモリカードやハードディスク等の記録媒体200及び210は、半導体メモリや磁気ディスク等から構成される記録部202、212と、DSC100とのインターフェース204、214及びコネクタ206、216を有している。記録媒体200及び210は、媒体側のコネクタ206、216とDSC100側のコネクタ92、96とを介してDSC100に装着される。コネクタ92、96にはインターフェース90及び94が接続される。記録媒体200、210の装着有無は、記録媒体着脱検知部98によって検知される。
Recording
なお、本実施形態ではDSC100が記録媒体を取り付けるインターフェース及びコネクタを2系統持つものとして説明しているが、記録媒体を取り付けるインターフェース及びコネクタは、単数を含む任意の数備えることができる。また、系統毎に異なる規格のインターフェース及びコネクタを用いても良い。
インターフェース及びコネクタとしては、例えばPCMCIAカードやCF(コンパクトフラッシュ(登録商標))カード等の規格に準拠したものを用いることができる。
In the present embodiment, the
As the interface and connector, for example, a PCMCIA card, a CF (Compact Flash (registered trademark)) card, or the like conforming to a standard can be used.
さらに、インターフェース90及び94、そしてコネクタ92及び96を規格に準拠したものを用いて構成した場合、市販されている様々な通信カードを接続でき、他のコンピュータやプリンタ等の周辺機器と画像データや付属した管理情報を相互に転送できる。通信カードの例としては、LANカードやモデムカード、USBカード、IEEE1394カード、P1284カード、SCSIカード、PHS等の通信カード等を例示できる。
Further, when the
レンズバリア102は、DSC100の、レンズ10を含む撮像部を覆う事により、撮像部の汚れや破損を防止する。
光学ファインダー104は例えばTTLファインダーであり、プリズムやミラーを用いてレンズ10を通じた光束を結像する。光学ファインダー104を用いることで、画像表示部28による電子ファインダー機能を使用すること無しに撮影を行うことが可能である。また、上述したように、光学ファインダー104内には、表示部54の一部の機能、例えば、合焦表示、手振れ警告表示、フラッシュ充電表示、シャッタースピード表示、絞り値表示、露出補正表示などの情報表示がなされる。
The
The
通信部110は、RS232CやUSB、IEEE1394、P1284、SCSI、モデム、LAN、無線通信、等の各種通信処理を行う。
コネクタ(無線通信の場合はアンテナ)112は、通信部110を介してDSC100を他の機器と接続する。
The
A connector (antenna in the case of wireless communication) 112 connects the
図2は、本実施形態に係るDSC100の外観例を示す斜視図である。図2は、DSC100の背面側を斜め上方から見た状態を示している。図2において、図1に示した構成は同じ参照数字を付し、重複する説明は省略する。
FIG. 2 is a perspective view showing an example of the appearance of the
DSC100は、電源ON/OFFボタン201の押下により電源86から各部への電源供給が行われ、システム制御部50の制御に従って、その時点でモードスイッチ60によって設定されているモードに応じた起動処理が行なわれる。また、起動中に電源ON/OFFボタン201が押下されると、システム制御部50の制御に従って各種の終了処理を行なった後、電源86から各部への電源供給を停止する。
The
メニューボタン205は、撮影パラメータやカメラの設定を変更するためのメニュー画面の表示開始及び中止をユーザがDSC100に指示するためのボタンである。セットボタン204は、メニュー画面中で選択中の項目の決定、実行等をDSC100に指示するためのボタンである。削除ボタン207は、例えば表示中の画像の削除をDSC100に指示するためのボタンである。指定することができる。
The
表示ON/OFFボタン208は、画像表示部28の表示ON/OFF設定用スイッチである。光学ファインダー104を用いて撮影を行う際に、例えばTFT LCD等から成る画像表示部28の表示をOFFして電流供給を遮断することにより、省電力を図ることが可能となる。
A display ON /
十字ボタン209は、上下左右ボタンとして機能する。ユーザは、十字ボタン209を用い、メニュー画面などにおいて選択カーソルの移動を行ったり、再生モードにおいて画像表示部28に表示する画像を変更する指示を行ったりする。
The
次に、上述した構成を有するDSC100の動作について説明する。
図3は、本実施形態に係るDSC100における、赤目補正処理を適用するフラッシュ撮影動作を説明するフローチャートである。
Next, the operation of the
FIG. 3 is a flowchart for explaining the flash photographing operation to which the red-eye correction process is applied in the
図3の処理は、シャッタースイッチが全押しされ、SW2 64がONとなり、撮影指示が入力されるとシステム制御部50の制御に従って実施される。適切な合焦位置の検出や露出の決定はシャッタースイッチが半押しされ、SW1 62がONとなった時点で既に行われているものとする。
The processing in FIG. 3 is performed according to the control of the
S302において、システム制御部50は、本撮影前に赤目緩和ランプを点灯する設定となっているかどうかを、例えば不揮発性メモリ56を参照して確認する。ここで、赤目緩和ランプの点灯を行う設定となっている場合、システム制御部50は予め定めた点灯方法に従って赤目緩和ランプ49を点灯させる(S303)。赤目緩和ランプ49の点灯を行わない設定であれば、システム制御部50は、直接S304へ処理を進める。
In S <b> 302, the
S304において、システム制御部50は、露光制御部40によりフラッシュ48の点灯、絞り及びシャッターの制御を行わせて本撮影動作を実行する。
画像の撮影が開始されると、撮像素子14に結像された被写体光学像が画素単位のアナログ電気信号として読み出される。A/D変換器16はこのアナログ電気信号をデジタル化し、画像処理部20へ、又はメモリ制御部22へ出力する。
In step S <b> 304, the
When image capturing is started, the subject optical image formed on the
画像処理部20は、A/D変換器16からのデータ或いはメモリ制御部22からのデータに対して所定の撮影画像処理を実施する(S305)。詳細は省略するが、この撮影画像処理は、色補間処理やホワイトバランス処理などにより、カラーの撮像画像データを生成する処理である。生成した撮像画像データはメモリ30へ書き込まれる。
The
次に、システム制御部50は、メモリ30に書き込まれた撮像画像データを取得し、撮像画像中の顔領域を検出する顔検出処理を実施する(S306)。
ここでの顔検出は公知の顔検出技術を利用して実現できる。公知の顔検出技術としては、ニューラルネットワークなどを利用した学習に基づく手法、テンプレートマッチングを用いて目、鼻、口等の形状に特徴のある部位を画像から探し出し、類似度が高ければ顔とみなす手法などがある。また、他にも、肌の色や目の形といった画像特徴量を検出し、統計的解析を用いた手法等、多数提案されている。一般的にはこれらの手法を複数組み合わせ、顔検出の精度を向上させている。
Next, the
The face detection here can be realized by using a known face detection technique. As a known face detection technique, a method based on learning using a neural network or the like, template matching is used to search a part having a characteristic shape of eyes, nose, mouth, etc. from an image, and if the degree of similarity is high, it is regarded as a face There are methods. In addition, many other methods have been proposed, such as a method that detects image feature amounts such as skin color and eye shape and uses statistical analysis. In general, a plurality of these methods are combined to improve the accuracy of face detection.
ここでは、特開2001−309225号公報に示されているような、顔形状モデルを用いたパターンマッチングによって顔検出を行うものとする。また、パターンマッチング時のパターンとの一致度合いから、顔らしさを示す尺度である顔信頼度を求めることが可能である。本実施形態では、検出した顔領域について、1〜10までの10段階で信頼度を付与する。ここで、信頼度1はパターンマッチング時の一致度が高く、顔である可能性が高いものを示し、信頼度10はパターンマッチング時の一致度が低く、顔である可能性が低いものを示すものとする。また、同時顔として認識された領域の縦横の長い方の画素数を顔サイズとして求める。このように、本実施形態における顔検出処理により、顔領域と信頼度および顔サイズが求められる。
Here, it is assumed that face detection is performed by pattern matching using a face shape model as disclosed in Japanese Patent Laid-Open No. 2001-309225. Further, it is possible to obtain a face reliability that is a scale indicating the likelihood of a face from the degree of coincidence with the pattern at the time of pattern matching. In the present embodiment, the reliability is assigned to the detected face area in 10 stages from 1 to 10. Here,
そして、システム制御部50は、検出された顔領域(候補顔領域)毎に、求められた信頼度と顔サイズを、あらかじめ設定されている信頼度の閾値FR(例えば3とする)及び顔サイズの閾値FSと比較する。
Then, the
システム制御部50は、比較の結果、信頼度が閾値以下で、かつ顔サイズが閾値以上である候補顔領域を、顔領域として設定する。換言すれば、システム制御部50は、信頼度が閾値を超えるか、顔サイズが閾値未満の候補顔領域は、顔領域でないと認識する。
As a result of the comparison, the
次に、システム制御部50は、設定された顔領域を対象として、赤目検出処理を実施する(S307)。赤目検出処理により赤目領域が検出されると、システム制御部50は、赤目領域を対象に赤目補正処理を実施する(S308)。赤目補正処理の詳細については後述する。また、左右の目に対応する赤目領域(赤目ペア)が複数組検出された場合には、例えば優先順位の最も高い赤目領域の組に対して赤目補正処理を適用する。あるいは、優先順位の高い所定数の赤目ペアに補正処理を適用するようにしても良い。この所定数は、ユーザが任意に設定できる構成としても良い。
Next, the
赤目補正処理を実施すると、システム制御部50は、補正後の画像を画像表示部28に表示させる(S309)とともに、補正後の画像を画像ファイルの形式に変換し、記録媒体200に記録をさせる(S310)。ここで、画像ファイルの形式は例えばJEIDA-49-1998に規定されるようなExif形式であってよい。
When the red-eye correction process is performed, the
(赤目検出処理の詳細)
ここで、S307における赤目検出処理について、さらに説明する。
本実施形態における赤目検出処理は、赤目候補領域検出処理、引き続く赤目領域判別処理とからなる。
(Details of red-eye detection processing)
Here, the red-eye detection process in S307 will be further described.
The red-eye detection process in the present embodiment includes a red-eye candidate area detection process and a subsequent red-eye area determination process.
・赤目候補検出処理
まず、赤目候補領域検出処理について、図5のフローチャートを用いて説明する。
S502において、システム制御部50は、S306における顔検出処理により、最終的に設定された顔領域に含まれる、目と思われる領域(推測目領域)中の各画素について、色相と彩度とを調べる。
-Red-eye candidate detection process First, a red-eye candidate area detection process is demonstrated using the flowchart of FIG.
In S <b> 502, the
システム制御部50は、S502で算出した、推測目領域中の画素における彩度の最大値と最小値をS503及びS504で抽出する。そしてS505でシステム制御部50は、彩度の最大値と最小値から、以下の式によって彩度閾値Tsatを設定する。
Tsat1={(彩度の最大値)−(彩度の最小値)}×ParamSat+(彩度の最小値)
Tsat2=0.15
Tsat=max(Tsat1,Tsat2)
The
Tsat1 = {(maximum saturation) − (minimum saturation)} × ParamSat + (minimum saturation)
Tsat2 = 0.15
Tsat = max (Tsat1, Tsat2)
なお、システム制御部50は、撮像画像の撮影時に、赤目緩和ランプが点灯されたか、非点灯であったかを判別する。そして、この判別結果に応じて、
撮影時に赤目緩和ランプを点灯した際には
ParamSat=0.4
撮影時に赤目緩和ランプを点灯させなかった際には
ParamSat=0.7
をそれぞれ設定する。
The
When the red-eye reduction lamp lights up during shooting
ParamSat = 0.4
If you do not turn on the red-eye reduction lamp during shooting
ParamSat = 0.7
Set each.
なお、このParamSatの値は一例であるが、彩度の最大値と最小値が同じ条件の場合、赤目緩和ランプ照射時の彩度閾値Tsat1Onと赤目緩和ランプ非照射時の彩度閾値Tsat1Offの関係が
Tsat1On < Tsat1Off
となるようにParamSatの値を設定する。
This ParamSat value is an example, but when the maximum and minimum saturation values are the same, the relationship between the saturation threshold Tsat1On when the red-eye reduction lamp is irradiated and the saturation threshold Tsat1Off when the red-eye reduction lamp is not irradiated But
Tsat1On <Tsat1Off
Set the value of ParamSat so that
続いてS506でシステム制御部50は、顔領域中の全画素に対して色相と彩度を演算し、以下の条件を満たすか否かをチェックする。そして、S507でシステム制御部50は、条件を満たす画素を、赤目を構成する可能性のある画素(赤目候補画素)として抽出する。この検出条件は、以下に示す閾値との大小関係を満たすか否かである。
条件1:−30°<色相<13°
条件2:Tsat<彩度
である。
In step S506, the
Condition 1: −30 ° <Hue <13 °
Condition 2: Tsat <saturation.
次にS508でシステム制御部50は、S507で抽出した赤目候補画素の数を調べる。そして、システム制御部50は、赤目候補画素の抽出数が0の場合は、現在処理を行なっている顔領域を赤目対象領域から除外し、処理をS511へ進める。一方、赤目候補画素が存在する場合、システム制御部50はS510で、赤目候補画素の数を例えばメモリ52に記憶し、処理をS511に進める。
In step S508, the
S511でシステム制御部50は、全ての顔領域中の全ての推測目領域に対して赤目候補領域検出処理を行ったか否かを調べ、全ての領域に対する処理が終了していない場合にはS502に戻り次の推測目領域に対する処理を行なう。処理が終了している場合には当該処理を終了する。この時点で赤目候補領域が決定される。
In S511, the
・赤目領域判別処理
次に、赤目候補領域処理によって赤目候補領域に対し、赤目領域判別処理を行なう。
図6のフローチャートを用いて、赤目領域判別処理について説明する。
S602からS605の処理では、画素配列を個々の領域にクラスタリングして領域の形状・大きさの判断を行なう。
-Red-eye area determination processing Next, red-eye area determination processing is performed on the red-eye candidate area by red-eye candidate area processing.
The red-eye area determination process will be described with reference to the flowchart of FIG.
In the processing from S602 to S605, the pixel arrangement is clustered into individual regions to determine the shape and size of the regions.
まず、S602でシステム制御部50は、S507で抽出された赤目候補画素に対してラベリングを実施し、この赤目候補画素の集合を有効画素の塊として取り扱えるようにクラスタリングする。ラベリングは、同じ連結成分を構成する画素に同じ番号(ラベル)を、異なる連結成分を構成する画素に異なる番号を付与する処理であり、画像処理分野において周知である。ラベリング結果の例を図7に示す。図7において、1〜3の数字が振られた画素で囲まれる閉領域が赤目候補領域である。このように、赤目候補画素の一群が1つの赤目候補領域を形成するようにラベリングを行う。
First, in step S602, the
S603でシステム制御部50は、ラベリングされた赤目候補領域毎に予め定められた特性を演算する。この領域の特性の演算については後述する。そして、S604でシステム制御部50は、特性の演算結果に従って、当該赤目候補領域の評価値が所定の条件を満たしているか否かを調べる。
In S603, the
S605でシステム制御部50は、評価値が所定の条件を満たす赤目候補領域があるか否かを判断する。評価値が所定の条件を満たす赤目候補領域がない場合には処理を終了する。
In step S605, the
一方、S605で評価値が所定の条件を満たす赤目候補領域がある場合には、システム制御部50は、赤目候補領域の周辺の状況を調べて候補を限定する(絞り込む)。例えば、赤目領域の周辺には黒い画素が存在することが多いことを利用し、周辺に黒っぽい画素が多い赤目候補領域のみに絞り込むことができる。より具体的には、周辺画素のうち、肌の基準色よりも明度の低い画素について色差を積分し、画素数で割って低輝度部の平均色差を算出する。周囲に黒い画素が多い程、平均色差は大きくなるので、平均色差の値が閾値以上の赤目候補領域に絞り込みを行うことができる。
On the other hand, if there is a red-eye candidate region whose evaluation value satisfies the predetermined condition in S605, the
S607においてシステム制御部50は、この時点で残っている赤目候補領域が存在するか否かを調べる。赤目候補領域が存在しない場合には処理を終了する。
In step S607, the
一方、S607で赤目候補領域が存在した場合、システム制御部50は処理をS608に進め、評価値を元に赤目候補領域の優先順位付けを行なう。そして、S609においてシステム制御部50は、複数の赤目候補領域が存在するか否かを調べる。赤目候補領域が1つの場合には赤目検出処理を終了する。
On the other hand, if a red-eye candidate area exists in S607, the
S609で赤目領域候補が複数存在した場合、システム制御部50は更に候補の絞り込みを行なうため、S610で特徴領域の組み合わせを検出する。ここでは、複数の赤目候補領域から左右の赤目ペアとして妥当な領域の組み合わせを検出する。
When there are a plurality of red-eye area candidates in S609, the
本実施形態において、組み合わせの要素は、
(1)2領域間の色相の差、
(2)2領域間の彩度の差、
(3)2領域間の明度の差、
(4)2領域間の面積比、
(5)2領域間の距離(顔領域の大きさより算出した基準値を基に比較する)、
(6)2領域間の面積の平均値、及び
(7)2領域間の類似度、
等の1つ以上に基づいて、左右の赤目ペアとして妥当か否かを検出する。
In the present embodiment, the combination elements are:
(1) Hue difference between two regions,
(2) Saturation difference between the two regions,
(3) Lightness difference between the two areas,
(4) area ratio between two regions,
(5) Distance between two areas (comparison based on a reference value calculated from the size of the face area),
(6) the average value of the area between the two regions, and (7) the similarity between the two regions,
Based on one or more of these, it is detected whether it is appropriate as a left-right red-eye pair.
この処理は、特に3つ以上の赤目候補領域が存在する際に、任意の2つが赤目ペアを構成するか否かを判断する際に有効である。例えば、色相の差であれば、2つの候補領域に含まれる画素の色相平均値の差を求め、差が所定値以下であればペアとして適切な組み合わせであると判定することができる。 This process is particularly effective when it is determined whether any two of them constitute a red-eye pair when there are three or more red-eye candidate regions. For example, in the case of a difference in hue, a difference between average hue values of pixels included in two candidate areas is obtained, and if the difference is equal to or less than a predetermined value, it can be determined that the combination is appropriate as a pair.
また、大きさについては、例えば面積比があまりにも大きい場合には適切な組み合わせでないと判定することができる。本実施形態においては、
赤目領域の直径が6画素以下となるような低倍率での撮影時には誤差が大きくなるため、撮影倍率を考慮して
(大きい方の面積)/(小さい方の面積)<6
また、赤目領域の直径が12画素以下では
(大きい方の面積)/(小さい方の面積)<3
その他の場合には
(大きい方の面積)/(小さい方の面積)<1.5
であれば、適切な組み合わせと判定する。
As for the size, for example, when the area ratio is too large, it can be determined that the combination is not appropriate. In this embodiment,
Since the error increases when photographing at a low magnification such that the diameter of the red-eye area is 6 pixels or less, taking into consideration the photographing magnification (larger area) / (smaller area) <6
When the diameter of the red-eye region is 12 pixels or less, (larger area) / (smaller area) <3
In other cases (larger area) / (smaller area) <1.5
If so, it is determined as an appropriate combination.
また、距離については、システム制御部50が、赤目候補領域が検出された顔領域の大きさと、予め記憶してある人間の平均的な顔の大きさ及び目の間隔の関係から、顔領域に含まれるであろう目領域の間隔を推定する。そして、赤目候補領域の距離がこの推定間隔から所定範囲内に含まれれば、適切な赤目ペアの組み合わせであると判定することができる。なお、一般的に人の目の間隔(瞳の間隔)の平均値は、約65mmであり、個体差を考慮に入れても約50mm〜80mm程度と見込むことができる。さらに、赤目の大きさは4mm〜14mm程度であることより、2つの赤目候補領域の大きさとその距離の関係が
(領域間の距離/大きさ):最大値(80mm/4mm)=20
最小値(50mm/14mm)=3.5
の範囲内であれば適切な赤目ペアであると判定することができる。
Regarding the distance, the
Minimum value (50mm / 14mm) = 3.5
If it is within the range, it can be determined that the pair is an appropriate red-eye pair.
なお、赤目ペアの組み合わせを検出する際の評価条件には、上述した要素に加えて、水平方向に並んでいるかどうかを加えてもよい。この場合には、条件を満たす領域が複数検出された場合に、もっとも確率の高い候補を選択する。例えば、適切な赤目ペアであると評価された領域のうち、ペアとなる赤目候補領域の垂直方向の中心座標が近いものから、赤目ペアである確度が高いとして優先順位を設定する。 Note that, in addition to the above-described elements, whether or not they are arranged in the horizontal direction may be added to the evaluation conditions for detecting a combination of red-eye pairs. In this case, the candidate with the highest probability is selected when a plurality of regions satisfying the conditions are detected. For example, the priority order is set assuming that the probability of being a red-eye pair is high since the center coordinates in the vertical direction of the pair of red-eye candidate regions are close among the regions evaluated as appropriate red-eye pairs.
そして、S611でシステム制御部50は、適切な赤目ペア候補が検出されたか否かを調べる。検出されていない場合には赤目検出処理を終了する。
赤目ペア候補が検出された場合には、システム制御部50は処理をS612に進め、検出領域に対して例えば上述したように確度の高い候補から順に高い優先順位を付け、赤目検出処理を終了する。
In step S611, the
If a red-eye pair candidate is detected, the
(特性演算処理)
次に、上述したS603で赤目候補領域に対して行う特性の演算処理の詳細について説明する。
この処理では、以下に示す各評価値を、S602でクラスタリングされた各赤目候補領域に対して順次演算する。
(Characteristic calculation processing)
Next, details of the characteristic calculation processing performed on the red-eye candidate region in S603 described above will be described.
In this process, the following evaluation values are sequentially calculated for each red-eye candidate region clustered in S602.
(1)赤目候補領域の面積
クラスタリングされた赤目候補領域の面積(画素数)である。
面積閾値Tareaは赤目緩和ランプの点灯時と非点灯時では異なる値とする。
本実施形態において、システム制御部50は、撮像画像の撮影時に、赤目緩和ランプが点灯されたか、非点灯であったかを判別する。そして、この判別結果に応じて、赤目緩和ランプ点灯時の面積閾値TareaOnと非点灯時の面積閾値TareaOffを、
TareaOn =20
TareaOff =50
と設定する。
そして、赤目候補領域の面積が、閾値との予め定めた大小関係を満たすか否か、より具体的には閾値以上かどうかを評価する。
(1) Area of Red Eye Candidate Region This is the area (number of pixels) of the clustered red eye candidate region.
The area threshold value Tarea is different between when the red-eye reduction lamp is lit and when it is not lit.
In the present embodiment, the
TareaOn = 20
TareaOff = 50
And set.
Then, it is evaluated whether or not the area of the red-eye candidate region satisfies a predetermined magnitude relationship with the threshold, more specifically, whether or not it is equal to or greater than the threshold.
(2)赤目候補領域の内部中央に白領域が存在するか
撮影倍率が高い場合には、赤目領域内にキャッチライトによる明領域が含まれていることがある。したがって、白領域を含む赤目候領域は赤目領域である可能性が高いと評価することができる。
(2) Is there a white area in the center of the red-eye candidate area? If the shooting magnification is high, the red-eye area may include a bright area due to catchlight. Therefore, it can be evaluated that the red eye region including the white region is likely to be a red eye region.
白領域は輝度を基準にして判断することができる。また、白領域が赤目候補領域の中央部にあるか否かの評価値としては、両領域の重心位置の距離、赤目候補領域の平均的な半径の評価値及び赤目候補領域と白領域の大きさの関係に基づいて判定できる。 The white area can be determined based on the luminance. In addition, the evaluation value as to whether or not the white area is in the center of the red-eye candidate area includes the distance between the centroid positions of both areas, the average radius evaluation value of the red-eye candidate area, and the size of the red-eye candidate area and the white area. It can be determined based on the relationship.
具体的には、重心位置の距離が所定値以下であり、赤目候補領域の平均的な半径が予め定めた大きさ以上であり、
{(白領域の大きさ)/(赤領域の大きさ)} ≦ (閾値WR)
が、例えば閾値WR≒0.5を満たせば、赤目候補領域の中央に白領域が存在すると判定する。
Specifically, the distance of the center of gravity position is not more than a predetermined value, the average radius of the red-eye candidate region is not less than a predetermined size,
{(Size of white area) / (size of red area)} ≦ (threshold WR)
However, for example, if the threshold value WR≈0.5 is satisfied, it is determined that a white region exists in the center of the red-eye candidate region.
(3)赤目候補領域の形状
赤目領域は基本的には丸いはずだが以下の要因により、丸とは異なった形状を有するようになってくる。
・キャッチライトが赤目の円周部に発生
・画素の間引きで絵が荒くなり、円というより矩形に近づく
・肌の一部として結合してしまう。特に撮影倍率が低い場合など、色がなだらかにつながってしまう。
(3) Shape of the red eye candidate region The red eye region should basically be round, but has a shape different from the circle due to the following factors.
・ Catchlight is generated on the circumference of red eyes. ・ Pictures become rough due to thinning out of pixels, approaching a rectangle rather than a circle. Especially when the shooting magnification is low, the colors are connected smoothly.
こうした要因で、赤目であっても円にならない場合があり、完全な丸らしさを評価要因とするのは危険である。そこで、円らしさの評価式として
評価値C=(領域の周囲長)^2/(領域の面積)
を採用する。
Because of these factors, even red eyes may not be a circle, and it is dangerous to use perfect roundness as an evaluation factor. Therefore, as an evaluation formula for circularity, evaluation value C = (perimeter of region) ^ 2 / (area of region)
Is adopted.
赤目候補領域が真円であれば、評価値C=(2πγ)^2/πγ^2=4π となる。領域の形状が円から遠ざかる程、評価値Cの値は4πより大きくなっていく。
本実施形態では、評価値Cが50以下であれば円らしさの条件を満たすものと判定する。
If the red-eye candidate region is a perfect circle, the evaluation value C = (2πγ) ^ 2 / πγ ^ 2 = 4π. As the shape of the region is further away from the circle, the evaluation value C becomes larger than 4π.
In the present embodiment, if the evaluation value C is 50 or less, it is determined that the circularity condition is satisfied.
(4)実際の大きさ
大きさの評価などでは赤目候補領域の実際の大きさを、領域の画素長と画像サイズや撮影倍率から算出し、この大きさが赤目として妥当なものかどうかを評価する。
(4) Actual size In size evaluation, the actual size of the red-eye candidate area is calculated from the pixel length of the area, the image size, and the shooting magnification, and whether this size is appropriate for red-eye is evaluated. To do.
(5)その他
以上の他に、領域の周囲長、領域に外接する矩形、領域内の最大長、色相平均値、彩度平均値、輝度平均値をそれぞれ検出し、赤目候補領域として妥当な範囲内か否かを評価する。
(5) Other In addition to the above, the perimeter of the region, the rectangle circumscribing the region, the maximum length in the region, the hue average value, the saturation average value, and the luminance average value are detected, respectively, and a valid range as a red-eye candidate region Evaluate whether it is within or not.
S604においては、これら条件のうち、少なくとも1つ以上を満たす赤目候補領域を、所定の条件を満たす赤目候補領域とする。なお、満たすべき条件の数は2つ以上の任意の数とすることもできる。 In S604, a red-eye candidate region that satisfies at least one of these conditions is set as a red-eye candidate region that satisfies a predetermined condition. Note that the number of conditions to be satisfied can be any number of two or more.
(赤目補正処理)
次に、S308において、最終的に検出された赤目領域(赤目ペア)に対して適用する赤目補正処理の詳細を説明する。
(Red-eye correction processing)
Next, details of the red-eye correction process applied to the red-eye region (red-eye pair) finally detected in S308 will be described.
図8は、本実施形態における赤目補正処理の詳細を説明する図である。
赤目領域を補正する際には、赤目領域中の画素毎の補正レベルとして、彩度と明度の低減レベルを決定する。基本的には、図8に示すように、赤目領域800は元の値を100%とした時に、彩度をTS[%]、明度をTL[%](TS<100,TL<100)に低減する。そして、赤目領域の周辺画素ではぼかし効果を持たせて、自然な補正とするために、図のような傾斜を持たせて低減を行う。
FIG. 8 is a diagram for explaining the details of the red-eye correction process in the present embodiment.
When correcting the red-eye area, saturation and lightness reduction levels are determined as correction levels for each pixel in the red-eye area. Basically, as shown in FIG. 8, in the red-
図8において、Dは検出された赤目領域800の直径であり、赤目領域中の画素数に基づき算出した値である。これらのデータに基づき、赤目領域およびその周辺の明度と彩度の低減レベルデータを作成する。
In FIG. 8, D is the diameter of the detected red-
この低減レベルデータに基づいて、赤目領域中の画素及び赤目領域の周辺画素について、明度と彩度を画素毎に補正、より具体的には低減させることにより、赤目補正を適用する。
なお、本実施形態においては、赤目緩和ランプの点灯時と非点灯時で、異なる低減レベルデータを設定する。
Based on the reduction level data, red-eye correction is applied by correcting, more specifically, reducing the brightness and saturation for each pixel in the red-eye region and the surrounding pixels of the red-eye region.
In the present embodiment, different reduction level data is set depending on whether the red-eye mitigation lamp is lit or not.
具体的には、赤目緩和ランプ点灯時においては、彩度低減値TSを50[%]に、明度低減値TLを70[%]に設定する。また、赤目緩和ランプ非点灯時においては、彩度低減値TSを40[%]に、明度低減値TLを60[%]に設定する。 Specifically, when the red-eye reduction lamp is lit, the saturation reduction value TS is set to 50 [%], and the lightness reduction value TL is set to 70 [%]. When the red-eye reduction lamp is not lit, the saturation reduction value TS is set to 40 [%], and the lightness reduction value TL is set to 60 [%].
また、赤目領域の周辺と滑らかに接続するために、傾斜を持たせて彩度、明度を低下させる周辺領域は、彩度については赤目領域の外縁から赤目領域の平均直径Dの1/3の範囲、明度については同様に平均直径Dの1/5の範囲としている。 In addition, in order to connect smoothly to the periphery of the red-eye region, the peripheral region that reduces the saturation and lightness by giving an inclination is about 、 of the average diameter D of the red-eye region from the outer edge of the red-eye region. The range and brightness are similarly set to a range of 1/5 of the average diameter D.
以上説明したように、本実施形態によれば、撮影時に赤目緩和ランプを点灯した場合と点灯しない場合により、赤目領域を検出するための条件を異ならせることにより、赤目緩和ランプの点灯、非点灯によらず、精度良く赤目領域を検出することができる。
また、撮影時に赤目緩和ランプを点灯した場合と点灯しない場合により、赤目補正処理における画素の補正レベルを異ならせることにより、より適切な補正結果を得ることが可能となる。
As described above, according to the present embodiment, the red-eye mitigation lamp is turned on or off by changing the conditions for detecting the red-eye area depending on whether the red-eye mitigation lamp is lit or not. Regardless of this, the red-eye region can be detected with high accuracy.
Further, it is possible to obtain a more appropriate correction result by changing the correction level of the pixel in the red-eye correction process depending on whether the red-eye reduction lamp is lit or not when shooting.
(第1の実施形態の変形例)
なお、これまでは撮影時に赤目補正を行う場合について説明してきた。しかし、画像ファイルの付加情報として記録されている撮影条件に関する情報に含まれる、赤目緩和ランプの点灯、非点灯を示す情報を参照して赤目領域の検出を行うことにより、既に記録された画像についても同様の赤目補正を実施することが可能である。
(Modification of the first embodiment)
Heretofore, the case where red-eye correction is performed during shooting has been described. However, by detecting the red-eye area with reference to information indicating whether the red-eye mitigation lamp is turned on or off, which is included in the information related to the shooting conditions recorded as additional information of the image file, an already recorded image is obtained. The same red-eye correction can be performed.
図4は、既に記録済の撮像画像に対して赤目補正を行い、補正画像を保存する再生時赤目補正処理の動作を説明するフローチャートである。
例えばモードスイッチ60により再生モードに設定され、記録媒体200又は210に記録された画像を読み出して画像表示部28に再生している状態で、操作部70から再生時赤目補正の実行が指示されたとする。
FIG. 4 is a flowchart for explaining the operation of reproduction red-eye correction processing in which red-eye correction is performed on a captured image that has already been recorded and the corrected image is stored.
For example, it is assumed that the playback unit is instructed to perform red-eye correction during playback while the playback mode is set by the
画像表示部28に表示中の画像は、表示用の低解像度画像であることが多い。そのため、システム制御部50は、再生時赤目補正の指示が入力されると、表示中の画像に対応する高解像度の画像データを記録媒体200又は210から取得する(S402)。取得した画像データはメモリ30に一時記憶する。
The image being displayed on the
次に、システム制御部50は、メモリ30に記憶した画像データの付加情報から、撮影時に赤目緩和ランプが点灯されたか否かを示す赤目緩和ランプ情報を取得する。赤目緩和ランプ情報は、画像データファイルのヘッダ部分に記録されるExif情報の一部として記録されている。システム制御部50は、取得した赤目緩和ランプ情報に基づき、補正を行う画像が、赤目緩和ランプを点灯して撮影されたものか、赤目緩和ランプを点灯させずに撮影されたものかを判別する(S403)。
Next, the
その後、システム制御部50は、S306〜S309において、上述したように顔検出処理、赤目検出処理、赤目補正処理及び補正画像表示処理を行なう。補正画像を画像表示部28に表示する際、システム制御部50は、補正後の画像を保存するか否かをユーザに選択させるユーザインタフェース(UI)も合わせて表示する。
Thereafter, in S306 to S309, the
システム制御部50は、例えば、[保存する]又は[キャンセル]を操作部70により選択可能なUIを、補正後の画像に重畳表示する。ユーザは補正された画像を画像表示部28で確認し、望み通りの補正が行われていれば、[保存する]を選択する。[保存する]が選択された場合、システム制御部50は、補正後の画像データを画像ファイルの形式に変換し、元の画像ファイルとは別の新規ファイルとして記録媒体200又は210に記録し(S310)、処理を終了する。一方、[キャンセル]が選択された場合、システム制御部50は補正画像を記録せず破棄して処理を終了する。
For example, the
(他の実施形態)
本実施形態においては赤目緩和ランプの点灯、非点灯によって、赤目領域を検出するための条件パラメータのうち、彩度閾値と面積閾値を異ならせる例を説明した。しかし、本発明において赤目緩和ランプの点灯、非点灯によって変更可能な赤目領域検出用のパラメータはこれらに限定されない。実施形態に記載した他のパラメータを赤目緩和ランプの点灯、非点灯に応じて異ならせるようにしても良い。
(Other embodiments)
In the present embodiment, an example has been described in which the saturation threshold and the area threshold are made different from the condition parameters for detecting the red-eye region by turning on / off the red-eye mitigation lamp. However, in the present invention, the red-eye area detection parameters that can be changed by turning on / off the red-eye mitigation lamp are not limited to these. Other parameters described in the embodiment may be made different depending on whether the red-eye reduction lamp is turned on or off.
また、上述した顔検出処理、赤目検出処理、赤目補正処理は例示的なものであって、他の方法に基づく処理であっても、赤目緩和ランプの点灯時と非点灯時とで変化しうる条件に基づいて赤目検出や赤目補正を行う処理であれば、本発明を適用することができる。 Further, the face detection process, the red eye detection process, and the red eye correction process described above are exemplary, and even a process based on another method can change between when the red-eye reduction lamp is lit and when it is not lit. The present invention can be applied to any process that performs red-eye detection and red-eye correction based on conditions.
上述の実施形態は、システム或は装置のコンピュータ(或いはCPU、MPU等)によりソフトウェア的に実現することも可能である。
従って、上述の実施形態をコンピュータで実現するために、該コンピュータに供給されるコンピュータプログラム自体も本発明を実現するものである。つまり、上述の実施形態の機能を実現するためのコンピュータプログラム自体も本発明の一つである。
The above-described embodiment can also be realized in software by a computer of a system or apparatus (or CPU, MPU, etc.).
Therefore, the computer program itself supplied to the computer in order to implement the above-described embodiment by the computer also realizes the present invention. That is, the computer program itself for realizing the functions of the above-described embodiments is also one aspect of the present invention.
なお、上述の実施形態を実現するためのコンピュータプログラムは、コンピュータで読み取り可能であれば、どのような形態であってもよい。例えば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等で構成することができるが、これらに限るものではない。 The computer program for realizing the above-described embodiment may be in any form as long as it can be read by a computer. For example, it can be composed of object code, a program executed by an interpreter, script data supplied to the OS, but is not limited thereto.
上述の実施形態を実現するためのコンピュータプログラムは、コンピュータ読み取り可能な記録媒体又は有線/無線通信によりコンピュータに供給される。プログラムを供給するための記録媒体としては、例えば、フレキシブルディスク、ハードディスク、磁気テープ等の磁気記録媒体、MO、CD、DVD等の光/光磁気記録体、不揮発性の半導体メモリなどがある。 A computer program for realizing the above-described embodiment is supplied to a computer by a computer-readable recording medium or wired / wireless communication. Examples of the recording medium for supplying the program include a magnetic recording medium such as a flexible disk, a hard disk, and a magnetic tape, an optical / magnetomagnetic recording body such as an MO, CD, and DVD, and a nonvolatile semiconductor memory.
有線/無線通信を用いたコンピュータプログラムの供給方法としては、コンピュータネットワーク上のサーバを利用する方法がある。この場合、本発明を形成するコンピュータプログラムとなりうるデータファイル(プログラムファイル)をサーバに記憶しておく。プログラムファイルとしては、実行形式のものであっても、ソースコードであっても良い。 As a computer program supply method using wired / wireless communication, there is a method of using a server on a computer network. In this case, a data file (program file) that can be a computer program forming the present invention is stored in the server. The program file may be an executable format or a source code.
そして、このサーバにアクセスしたクライアントコンピュータに、プログラムファイルをダウンロードすることによって供給する。この場合、プログラムファイルを複数のセグメントファイルに分割し、セグメントファイルを異なるサーバに分散して配置することも可能である。
つまり、上述の実施形態を実現するためのプログラムファイルをクライアントコンピュータに提供するサーバ装置も本発明の一つである。
Then, the program file is supplied by downloading to a client computer that has accessed the server. In this case, the program file can be divided into a plurality of segment files, and the segment files can be distributed and arranged on different servers.
That is, a server apparatus that provides a client computer with a program file for realizing the above-described embodiment is also one aspect of the present invention.
また、上述の実施形態を実現するためのコンピュータプログラムを暗号化して格納した記憶媒体を配布し、所定の条件を満たしたユーザに、暗号化を解く鍵情報を供給し、ユーザの有するコンピュータへのインストールを許可してもよい。鍵情報は、例えばインターネットを介してホームページからダウンロードさせることによって供給することができる。 In addition, a storage medium in which the computer program for realizing the above-described embodiment is encrypted and distributed is distributed, and key information for decrypting is supplied to a user who satisfies a predetermined condition, and the user's computer Installation may be allowed. The key information can be supplied by being downloaded from a homepage via the Internet, for example.
また、上述の実施形態を実現するためのコンピュータプログラムは、すでにコンピュータ上で稼働するOSの機能を利用するものであってもよい。 Further, the computer program for realizing the above-described embodiment may use an OS function already running on the computer.
さらに、上述の実施形態を実現するためのコンピュータプログラムは、その一部をコンピュータに装着される拡張ボード等のファームウェアで構成してもよいし、拡張ボード等が備えるCPUで実行するようにしてもよい。 Further, a part of the computer program for realizing the above-described embodiment may be configured by firmware such as an expansion board attached to the computer, or may be executed by a CPU provided in the expansion board. Good.
Claims (10)
撮像画像を取得する取得手段と、
前記撮像画像の撮影前に、赤目現象を低減するための光源が点灯されたか、非点灯であったかを判別する判別手段と、
前記撮像画像中の顔領域を検出する顔検出手段と、
前記顔領域中から予め定めた条件を満たす領域を赤目領域として検出する赤目領域検出手段とを有し、
前記赤目領域検出手段が、前記光源が点灯されたと前記判別手段により判別された場合には、非点灯であったと判別された場合よりも前記予め定めた条件を緩くして前記検出を行うことを特徴とする画像処理装置。 An image processing device that detects a red-eye region from a captured image,
An acquisition means for acquiring a captured image;
A discriminating means for discriminating whether the light source for reducing the red-eye phenomenon is turned on or not turned on before taking the captured image;
Face detection means for detecting a face area in the captured image;
A red-eye area detecting means for detecting an area satisfying a predetermined condition from the face area as a red-eye area;
When the red-eye area detecting means determines that the light source is turned on by the determining means, the detection is performed with the predetermined condition being relaxed as compared to the case where it is determined that the light source is not turned on. An image processing apparatus.
前記赤目補正手段が、前記光源が点灯されたと前記判別手段により判別された場合に、非点灯であったと判別された場合よりも前記レベルを大きくすることを特徴とする請求項1乃至請求項4のいずれか1項に記載の画像処理装置。 Red eye correction means for performing correction processing to reduce the saturation of the pixels in the red eye area detected by the red eye area detection means to a predetermined level ;
2. The red-eye correction unit according to claim 1, wherein when the determination unit determines that the light source is turned on, the red-eye correction unit increases the level more than when it is determined that the light source is not turned on. Item 5. The image processing device according to any one of items 4 to 6.
前記赤目現象を低減するための光源及びフラッシュとして機能する少なくとも1つの光源とを有する撮像装置であって、
前記画像処理装置が、前記少なくとも1つの光源を用いてフラッシュ撮影した撮像画像から前記赤目領域を検出することを特徴とする撮像装置。 An image processing apparatus according to any one of 請 Motomeko 1 to claim 6,
An imaging device having a light source for reducing the red-eye phenomenon and at least one light source functioning as a flash ,
The imaging apparatus, wherein the image processing apparatus detects the red-eye region from a captured image captured by flash using the at least one light source.
取得手段が、記憶装置から撮像画像を取得する取得工程と、
前記撮像画像の撮影前に、赤目現象を低減するための光源が点灯されたか、非点灯であったかを判別手段が判別する判別工程と、
顔検出手段が、前記撮像画像中の顔領域を検出する顔検出工程と、
赤目領域検出手段が、前記顔領域中から予め定めた条件を満たす領域を赤目領域として検出する赤目領域検出工程とを有し、
前記赤目領域検出工程において前記赤目領域検出手段は、前記光源が点灯されたと前記判別工程で判別された場合には、非点灯であったと判別された場合よりも前記予め定めた条件を緩くして前記検出を行うことを特徴とする画像処理方法。 An image processing method for detecting a red-eye region from a captured image,
An acquisition step in which the acquisition means acquires a captured image from the storage device;
A determination step in which the determination unit determines whether the light source for reducing the red-eye phenomenon is turned on or not turned on before taking the captured image;
A face detection step in which a face detection means detects a face region in the captured image;
Eye region detection means, said face area in either et predetermined condition is satisfied region and a red-eye region detection step of detecting a red-eye region,
In the red-eye area detecting step , the red-eye area detecting means loosens the predetermined condition when it is determined that the light source is turned on in the determining step than when it is determined that the light source is not turned on. And performing the detection .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007050200A JP4781299B2 (en) | 2007-02-28 | 2007-02-28 | Image processing apparatus, image processing method, and imaging apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007050200A JP4781299B2 (en) | 2007-02-28 | 2007-02-28 | Image processing apparatus, image processing method, and imaging apparatus |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2008219154A JP2008219154A (en) | 2008-09-18 |
JP2008219154A5 JP2008219154A5 (en) | 2010-04-08 |
JP4781299B2 true JP4781299B2 (en) | 2011-09-28 |
Family
ID=39838724
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007050200A Expired - Fee Related JP4781299B2 (en) | 2007-02-28 | 2007-02-28 | Image processing apparatus, image processing method, and imaging apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4781299B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6156532B2 (en) * | 2016-02-29 | 2017-07-05 | 株式会社ニコン | Region extraction device, imaging device, and region extraction program |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3684017B2 (en) * | 1997-02-19 | 2005-08-17 | キヤノン株式会社 | Image processing apparatus and method |
US6940545B1 (en) * | 2000-02-28 | 2005-09-06 | Eastman Kodak Company | Face detecting camera and method |
JP2003179807A (en) * | 2001-12-13 | 2003-06-27 | Fuji Photo Film Co Ltd | Image pickup device |
-
2007
- 2007-02-28 JP JP2007050200A patent/JP4781299B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2008219154A (en) | 2008-09-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5089405B2 (en) | Image processing apparatus, image processing method, and imaging apparatus | |
JP4262082B2 (en) | Image processing apparatus, control method therefor, program, and storage medium | |
JP4254873B2 (en) | Image processing apparatus, image processing method, imaging apparatus, and computer program | |
JP4574459B2 (en) | Image capturing apparatus, control method therefor, program, and storage medium | |
JP4663700B2 (en) | Imaging apparatus and imaging method | |
US8610817B2 (en) | Image-capturing apparatus and control method therefor | |
JP2010141649A (en) | Image capturing apparatus and face detecting method and program | |
JP4906632B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP2005167697A (en) | Electronic camera having red-eye correction function | |
JP2020102059A (en) | Image processor | |
JP2009290782A (en) | Imaging device, method of controlling the same, and program | |
US8223253B2 (en) | Image pickup device and method of controlling same | |
JP2009038749A (en) | Image processor, control method of image processor, and program for implementing the same | |
JP4781299B2 (en) | Image processing apparatus, image processing method, and imaging apparatus | |
JP2009017135A (en) | Imaging device, imaging method, and program | |
JP4885079B2 (en) | Digital camera, photographing method and photographing program | |
JP5828722B2 (en) | Imaging apparatus, control method therefor, program, and storage medium | |
JP4773924B2 (en) | IMAGING DEVICE, ITS CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM | |
JP5137343B2 (en) | Imaging apparatus and imaging method | |
JP4902512B2 (en) | Imaging apparatus, control method thereof, and program | |
JP4909009B2 (en) | Imaging apparatus, image processing method, program, and storage medium | |
JP5022811B2 (en) | Image processing apparatus, image processing method, and imaging apparatus | |
JP5253184B2 (en) | Imaging apparatus, face detection method, and program | |
JP2008060844A (en) | Image processor and image processing method | |
JP2008109503A (en) | Imaging apparatus, control method thereof, program and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100218 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100218 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110616 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110704 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110705 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140715 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140715 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |