JP2008199146A - Photographing apparatus, method and program - Google Patents

Photographing apparatus, method and program Download PDF

Info

Publication number
JP2008199146A
JP2008199146A JP2007030076A JP2007030076A JP2008199146A JP 2008199146 A JP2008199146 A JP 2008199146A JP 2007030076 A JP2007030076 A JP 2007030076A JP 2007030076 A JP2007030076 A JP 2007030076A JP 2008199146 A JP2008199146 A JP 2008199146A
Authority
JP
Japan
Prior art keywords
face
candidate
component
image
predetermined
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
JP2007030076A
Other languages
Japanese (ja)
Inventor
Katsutoshi Izawa
克俊 井澤
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.)
Fujifilm Corp
Original Assignee
Fujifilm Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujifilm Corp filed Critical Fujifilm Corp
Priority to JP2007030076A priority Critical patent/JP2008199146A/en
Publication of JP2008199146A publication Critical patent/JP2008199146A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To further improve the detection accuracy of a face from an image, in a photographing apparatus. <P>SOLUTION: In the photographing apparatus, an image pickup system 6 acquires an image by photographing, a face detection part 37 calculates the degree of matching between a detection frame and an image and detects the position of the detection frame of which the degree of matching is a prescribed threshold and more as a face candidate. A face component detection part 38 detects candidates of at least one face component included in the face candidate in each face component. A judgment part 39 judges whether each face candidate is a real face or not on the basis of the number and/or positions of face component candidates detected in each face component. A threshold setting part 42 sets a threshold to be compared with the matching degree at the time of face detection to a first value for prescribed photographing, and for the other photographing, sets the threshold to a second value larger than the first value. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、撮影により画像を取得するデジタルカメラ等の撮影装置および方法並びに撮影方法をコンピュータに実行させるためのプログラムに関するものである。   The present invention relates to a photographing apparatus and method such as a digital camera for obtaining an image by photographing, and a program for causing a computer to execute the photographing method.

デジタルカメラによる撮影において、撮影により取得した画像から例えば顔等の対象物を検出し、その対象物の検出結果に応じて画像に施す画像処理の条件を変更したり、撮影時における撮影条件を変更したりすることが行われている。また、とくに対象物を顔とした場合において、検出した顔の数をカウントしたり、検出した顔をトリミングして記録することも行われている。   In shooting with a digital camera, for example, an object such as a face is detected from an image acquired by shooting, and the conditions of image processing applied to the image are changed according to the detection result of the object, or the shooting conditions at the time of shooting are changed. It has been done. In particular, when the object is a face, the number of detected faces is counted, or the detected faces are trimmed and recorded.

このように画像から対象物を検出して種々の処理を行うためには、画像から正確に対象物を検出する必要がある。このため、対象物を正確に検出するための各種手法が提案されている。例えば、認証対象者の顔画像を撮影し、顔画像から認証対象者の顔の特徴量を抽出し、抽出した特徴量と基準の特徴量との類似度を計算し、この計算により得られる類似度をしきい値と比較して、認証対象者が本人であるか否かを認証する際に、認証対象者の利用頻度の高い時間帯か否かに応じてしきい値を変更することにより、認証対象者の利用頻度の高い時間帯における認証率を向上させる手法が提案されている(特許文献1参照)。   Thus, in order to detect an object from an image and perform various processes, it is necessary to accurately detect the object from the image. For this reason, various methods for accurately detecting an object have been proposed. For example, a face image of a person to be authenticated is photographed, a feature amount of the face of the authentication target person is extracted from the face image, a similarity between the extracted feature amount and a reference feature amount is calculated, and the similarity obtained by this calculation By comparing the threshold with the threshold value and authenticating whether or not the person to be authenticated is the principal, by changing the threshold according to whether or not the authentication person is frequently used There has been proposed a technique for improving the authentication rate in a time zone where the use frequency of the authentication target person is high (see Patent Document 1).

また、画像から顔候補を検出し、顔候補の色の分散値が小さい場合、肌色領域の占有率が大きい場合等の所定の条件を満たさない顔候補を非顔として、検出した顔候補から排除する手法も提案されている(特許文献2参照)。
特開2002−183734号公報 特開2005−78376号公報
In addition, face candidates are detected from the image, and face candidates that do not satisfy a predetermined condition, such as when the color dispersion value of the face candidates is small or when the occupation rate of the skin color area is large, are excluded from the detected face candidates. A technique to do this has also been proposed (see Patent Document 2).
JP 2002-183734 A JP-A-2005-78376

上記特許文献1,2に記載された手法により、顔の認証精度または顔の検出精度を向上することができるが、さらに精度を向上させることが望まれている。   Although the face authentication accuracy or the face detection accuracy can be improved by the methods described in Patent Documents 1 and 2, it is desired to further improve the accuracy.

本発明は上記事情に鑑みなされたものであり、画像からの顔の検出精度をより向上させることを目的とする。   The present invention has been made in view of the above circumstances, and an object thereof is to further improve the accuracy of detecting a face from an image.

本発明による撮影装置は、連続した撮影により画像を連続して取得する撮影手段と、
所定サイズの検出枠を前記画像上において移動させ、移動した位置毎に該検出枠内の前記画像から特徴量を算出し、該特徴量とあらかじめ定められた顔特徴量とのマッチング度を算出し、該マッチング度が所定のしきい値以上となったときに前記検出枠の位置の画像を顔候補として検出する顔検出手段と、
前記顔候補に含まれる少なくとも1つの顔構成部品の候補を該顔構成部品毎に検出する顔構成部品検出手段と、
前記顔構成部品毎に検出された前記顔構成部品候補の数および位置の少なくとも一方に基づいて、前記顔候補が真の顔であるか否かを判定する判定手段と、
所定の撮影の際に取得された所定撮影時画像から前記顔候補を検出するに際には、前記所定のしきい値を第1の値に設定し、該所定の撮影以降の撮影により取得された画像から前記顔候補を検出する際には、前記所定撮影時画像から検出された前記顔候補であって前記真の顔であると判定された顔候補のうち、前記マッチング度が最も低い顔候補を検出可能な第2の値を前記所定のしきい値に設定するしきい値設定手段とを備えたことを特徴とするものである。
An imaging apparatus according to the present invention includes imaging means for continuously acquiring images by continuous imaging,
A detection frame of a predetermined size is moved on the image, a feature amount is calculated from the image in the detection frame for each moved position, and a matching degree between the feature amount and a predetermined face feature amount is calculated. , A face detection unit that detects an image at the position of the detection frame as a face candidate when the matching degree is equal to or greater than a predetermined threshold;
Face component detection means for detecting at least one face component candidate included in the face candidate for each face component;
Determining means for determining whether or not the face candidate is a true face based on at least one of the number and position of the face component candidates detected for each face component;
When the face candidate is detected from a predetermined shooting image acquired at the time of predetermined shooting, the predetermined threshold is set to a first value and acquired by shooting after the predetermined shooting. When detecting the face candidate from the captured image, the face candidate having the lowest matching degree among the face candidates detected from the predetermined photographing image and determined to be the true face Threshold setting means for setting a second value capable of detecting a candidate to the predetermined threshold value is provided.

「顔構成部品」とは、顔に含まれる構成部品のことであり、具体的には両目の目頭、両目の目尻、左右の鼻の穴の脇、左右の口元および口の中央部分等を顔構成部品とすることができる。ここで、顔候補が真の顔である場合、顔構成部品候補は、顔構成部品がある位置に1つのみ検出されるわけではなく、顔構成部品の周囲にばらつく形で複数検出されることが多い。このため、本願発明においては、1つの顔構成部品について1以上の顔構成部品候補が検出されるものである。   “Face components” refers to components included in the face, specifically the eyes of the eyes, the corners of the eyes, the sides of the left and right nostrils, the left and right mouths, and the center of the mouth. It can be a component. Here, when the face candidate is a true face, only one face component candidate is detected at a position where the face component is located, and a plurality of face component candidates are detected in a manner that varies around the face component. There are many. For this reason, in the present invention, one or more face component candidate candidates are detected for one face component.

「マッチング度が最も低い顔候補を検出可能な第2のしきい値」としては、例えば、所定撮影時画像から検出した真の顔と判定された顔候補のうち、マッチング度が最も低い顔候補を検出した際のそのマッチング度よりも小さく、所定撮影時画像において真の顔であると判定されなかった顔候補のうち、マッチング度が比較的大きい顔候補についてのそのマッチング度よりも大きい値とすればよい。   As the “second threshold value that can detect the face candidate with the lowest matching degree”, for example, the face candidate with the lowest matching degree among the face candidates determined as the true face detected from the predetermined shooting image A value that is smaller than the matching degree at the time of detecting the image and that is greater than the matching degree for a face candidate having a relatively high matching degree among face candidates that are not determined to be true faces in the predetermined shooting image. do it.

なお、本発明による撮影装置においては、前記所定の撮影は、最初の撮影であってもよく、あらかじめ定められた間隔での撮影であってもよい。   In the photographing apparatus according to the present invention, the predetermined photographing may be initial photographing or photographing at a predetermined interval.

また、本発明による撮影装置においては、前記判定手段を、前記位置に基づいて前記顔候補が前記真の顔であるか否かを判定するに際し、前記顔候補の領域内における前記各顔構成部品候補の、対応する前記顔構成部品に対する位置的な尤度を算出し、該位置的な尤度に基づいて前記顔候補が前記真の顔であるか否かを判定する手段としてもよい。   Further, in the photographing apparatus according to the present invention, when the determination unit determines whether or not the face candidate is the true face based on the position, each face component in the face candidate region is determined. It is good also as a means which calculates the positional likelihood with respect to the said corresponding face component of a candidate, and determines whether the said face candidate is the said true face based on this positional likelihood.

また、本発明による撮影装置においては、前記判定手段を、前記位置に基づいて前記顔候補が前記真の顔であるか否かを判定するに際し、前記顔候補の領域内における前記各顔構成部品候補の、対応する前記顔構成部品以外の他の顔構成部品に対する位置関係の尤度を算出し、該位置関係の尤度に基づいて前記顔候補が前記真の顔であるか否かを判定する手段としてもよい。   Further, in the photographing apparatus according to the present invention, when the determination unit determines whether or not the face candidate is the true face based on the position, each face component in the face candidate region is determined. The likelihood of the positional relationship with respect to other face components other than the corresponding face component is calculated, and it is determined whether or not the face candidate is the true face based on the likelihood of the positional relationship. It is good also as a means to do.

また、本発明による撮影装置においては、前記判定手段を、前記位置に基づいて前記顔候補が前記真の顔であるか否かを判定するに際し、前記顔候補の領域内において前記各顔構成部品を正規化し、該正規化した前記各顔構成部品の位置に基づいて、前記顔候補が前記真の顔であるか否かを判定する手段としてもよい。   In the photographing apparatus according to the present invention, when the determination unit determines whether or not the face candidate is the true face based on the position, each face component in the face candidate region is determined. And a means for determining whether or not the face candidate is the true face based on the normalized position of each face component.

「顔候補を正規化する」とは、顔構成部品候補を顔候補の領域内における本来あるべき位置に位置せしめることである。具体的には顔候補の領域内の画像をアフィン変換して、各顔構成部品を拡大縮小、平行移動および回転することにより、各顔構成部品候補の位置を本来あるべき位置に位置せしめることができる。   “Normalize a face candidate” means to position a face component candidate at a position where it should be in a face candidate region. Specifically, by performing an affine transformation on the image in the face candidate region, each face component can be scaled, translated, and rotated, so that the position of each face component candidate can be positioned as it should be. it can.

本発明による撮影方法は、連続した撮影により画像を連続して取得し、
所定サイズの検出枠を前記画像上において移動させ、移動した位置毎に該検出枠内の前記画像から特徴量を算出し、該特徴量とあらかじめ定められた顔特徴量とのマッチング度を算出し、該マッチング度が所定のしきい値以上となったときに前記検出枠の位置の画像を顔候補として検出し、
前記顔候補に含まれる少なくとも1つの顔構成部品の候補を該顔構成部品毎に検出し、
前記顔構成部品毎に検出された前記顔構成部品候補の数および位置の少なくとも一方に基づいて、前記顔候補が真の顔であるか否かを判定するに際し、
所定の撮影の際に取得された所定撮影時画像から前記顔候補を検出するに際には、前記所定のしきい値を第1の値に設定し、該所定の撮影以降の撮影により取得された画像から前記顔候補を検出する際には、前記所定撮影時画像から検出された前記顔候補であって前記真の顔であると判定された顔候補のうち、前記マッチング度が最も低い顔候補を検出可能な第2の値を前記所定のしきい値に設定することを特徴とするものである。
The shooting method according to the present invention continuously acquires images by continuous shooting,
A detection frame of a predetermined size is moved on the image, a feature amount is calculated from the image in the detection frame for each moved position, and a matching degree between the feature amount and a predetermined face feature amount is calculated. , Detecting the image at the position of the detection frame as a face candidate when the matching degree is equal to or greater than a predetermined threshold value,
Detecting at least one face component candidate included in the face candidate for each face component;
In determining whether or not the face candidate is a true face based on at least one of the number and position of the face component candidates detected for each face component,
When the face candidate is detected from a predetermined shooting image acquired at the time of predetermined shooting, the predetermined threshold is set to a first value and acquired by shooting after the predetermined shooting. When detecting the face candidate from the captured image, the face candidate having the lowest matching degree among the face candidates detected from the predetermined photographing image and determined to be the true face A second value capable of detecting a candidate is set to the predetermined threshold value.

なお、本発明による撮影方法をコンピュータに実行させるためのプログラムとして提供してもよい。   In addition, you may provide as a program for making a computer perform the imaging | photography method by this invention.

本発明の撮影装置および方法によれば、所定の撮影の際に取得した所定撮影時画像から顔候補を検出する際には、マッチング度を比較する所定のしきい値が第1の値に設定される。また、所定の撮影以降の撮影により取得された画像から顔候補を検出する際には、所定撮影時画像から検出された顔候補であって真の顔であると判定された顔候補のうち、マッチング度が最も低い顔候補を検出可能な第2の値が所定のしきい値に設定される。このため、所定の撮影以降の撮影により取得された画像から検出される顔候補の数を少なくすることができる。   According to the photographing apparatus and method of the present invention, when a face candidate is detected from a predetermined photographing image acquired at a predetermined photographing, a predetermined threshold value for comparing the matching degree is set to the first value. Is done. In addition, when detecting a face candidate from an image acquired by shooting after a predetermined shooting, among the face candidates detected from the image at the time of the predetermined shooting and determined to be a true face, The second value that can detect the face candidate with the lowest matching degree is set to a predetermined threshold value. For this reason, it is possible to reduce the number of face candidates detected from images acquired by photographing after predetermined photographing.

ここで、顔には、目、鼻および口等の顔構成部品が含まれており、顔候補が真の顔である場合には、1つの顔構成部品について検出される顔構成部品候補が多くなる。また、顔候補が真の顔である場合には、顔構成部品候補は対応する顔構成部品の位置に存在することとなる。したがって、顔候補に含まれる顔構成部品毎の顔構成部品候補の数および位置の少なくとも一方に基づいて顔候補が真の顔であるか否かを判定することにより、顔候補から真の顔を精度良く検出することができる。   Here, the face includes face components such as eyes, nose and mouth, and when the face candidate is a true face, there are many face component candidates detected for one face component. Become. In addition, when the face candidate is a true face, the face component candidate exists at the position of the corresponding face component. Therefore, by determining whether or not the face candidate is a true face based on at least one of the number and position of face component candidates for each face component included in the face candidate, the true face is determined from the face candidate. It can be detected with high accuracy.

しかしながら、顔構成部品候補の数および/または位置に基づく真の顔であるか否かの判定は演算に長時間を要するものとなる。   However, it takes a long time to calculate whether or not the face is a true face based on the number and / or positions of the face component candidate candidates.

本発明においては、所定の撮影以降の撮影により取得された画像については、演算量が多い判定の処理を行う顔候補の数を少なくすることができるため、演算量を低減しつつも精度良く顔候補から真の顔を検出することができる。   In the present invention, since the number of face candidates subjected to a determination process with a large amount of calculation can be reduced for images obtained by shooting after a predetermined shooting, the face can be accurately obtained while reducing the amount of calculation. A true face can be detected from the candidates.

なお、各顔構成部品候補の位置が対応する顔構成部品の位置となるように各顔候補を正規化することにより、より精度良く顔候補から真の顔を検出することができる。   Note that by normalizing each face candidate so that the position of each face component candidate becomes the position of the corresponding face component, a true face can be detected from the face candidate with higher accuracy.

以下、図面を参照して本発明の実施形態について説明する。図1は本発明の第1の実施形態による撮影装置を適用したデジタルカメラの構成を示す概略ブロック図である。図1に示すように本実施形態によるデジタルカメラ1は、動作モードスイッチ、ズームレバー、上下左右ボタン、レリーズボタンおよび電源スイッチ等の操作系2と、操作系2の操作内容をCPU40に伝えるためのインターフェース部分である操作系制御部3とを有している。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a schematic block diagram showing the configuration of a digital camera to which the photographing apparatus according to the first embodiment of the present invention is applied. As shown in FIG. 1, the digital camera 1 according to the present embodiment is for operating system 2 such as an operation mode switch, zoom lever, up / down / left / right button, release button, and power switch, and for transmitting operation contents of the operating system 2 to the CPU 40. It has the operation system control part 3 which is an interface part.

撮像系6としては、撮影レンズ10を構成するフォーカスレンズ10aおよびズームレンズ10bを有している。各々のレンズは、モータとモータドライバとからなるフォーカスレンズ駆動部11およびズームレンズ駆動部12によって光軸方向に移動可能である。フォーカスレンズ駆動部11はAF処理部30から出力されるフォーカス駆動量データに基づいて、ズームレンズ駆動部12はズームレバーの操作量データに基づいて、各々のレンズの移動を制御する。   The imaging system 6 includes a focus lens 10a and a zoom lens 10b that constitute the photographing lens 10. Each lens can be moved in the optical axis direction by a focus lens driving unit 11 and a zoom lens driving unit 12 each including a motor and a motor driver. The focus lens drive unit 11 controls the movement of each lens based on the focus drive amount data output from the AF processing unit 30 and the zoom lens drive unit 12 based on the operation amount data of the zoom lever.

また、絞り14は、モータとモータドライバとからなる絞り駆動部15によって駆動される。この絞り駆動部15は、AE/AWB処理部31から出力される絞り値データに基づいて絞り径の調整を行う。   The diaphragm 14 is driven by a diaphragm driving unit 15 including a motor and a motor driver. The aperture drive unit 15 adjusts the aperture diameter based on aperture value data output from the AE / AWB processing unit 31.

シャッタ16は、メカニカルシャッタであり、モータとモータドライバとからなるシャッタ駆動部17によって駆動される。シャッタ駆動部17は、レリーズボタンの押下により発生する信号と、AE/AWB処理部31から出力されるシャッタスピードデータとに応じて、シャッタ16の開閉の制御を行う。   The shutter 16 is a mechanical shutter and is driven by a shutter drive unit 17 including a motor and a motor driver. The shutter driving unit 17 controls the opening and closing of the shutter 16 according to a signal generated by pressing the release button and the shutter speed data output from the AE / AWB processing unit 31.

光学系の後方には撮像素子であるCCD18を有している。CCD18は、多数の受光素子を2次元的に配列した光電面を有しており、光学系を通過した被写体光がこの光電面に結像し、光電変換される。光電面の前方には、各画素に光を集光するためのマイクロレンズアレイと、R,G,B各色のフィルタが規則的に配列されたカラーフィルタアレイとが配置されている。CCD18は、CCD制御部19から供給される垂直転送クロックおよび水平転送クロックに同期して、画素毎に蓄積された電荷を1ラインずつシリアルなアナログ撮影信号として出力する。各画素において電荷を蓄積する時間、すなわち、露光時間は、CCD制御部19から与えられる電子シャッタ駆動信号によって決定される。また、CCD18はCCD制御部19により、あらかじめ定められた大きさのアナログ撮像信号が得られるようにゲインが調整されている。   A CCD 18 which is an image pickup device is provided behind the optical system. The CCD 18 has a photocathode in which a large number of light receiving elements are two-dimensionally arranged, and subject light that has passed through the optical system forms an image on the photocathode and is photoelectrically converted. In front of the photocathode, a microlens array for condensing light on each pixel and a color filter array in which filters of R, G, and B colors are regularly arranged are arranged. The CCD 18 outputs the charges accumulated for each pixel as a serial analog photographing signal line by line in synchronization with the vertical transfer clock and the horizontal transfer clock supplied from the CCD controller 19. The time for accumulating charges in each pixel, that is, the exposure time, is determined by an electronic shutter drive signal given from the CCD controller 19. The gain of the CCD 18 is adjusted by the CCD control unit 19 so that an analog imaging signal having a predetermined size can be obtained.

なお、撮影レンズ10、絞り14、シャッタ16およびCCD18が撮像系6を構成する。   Note that the photographing lens 10, the diaphragm 14, the shutter 16, and the CCD 18 constitute the imaging system 6.

CCD18から取り込まれたアナログ撮影信号は、アナログ信号処理部20に入力される。アナログ信号処理部20は、アナログ信号のノイズを除去する相関2重サンプリング回路(CDS)と、アナログ信号のゲインを調節するオートゲインコントローラ(AGC)と、アナログ信号をデジタル信号に変換するA/Dコンバータ(ADC)とからなる。なお、アナログ信号処理部20が行う処理をアナログ信号処理とする。このデジタル信号に変換された画像データは、画素毎にR,G,Bの濃度値を持つCCD−RAWデータである。   The analog photographing signal captured from the CCD 18 is input to the analog signal processing unit 20. The analog signal processing unit 20 includes a correlated double sampling circuit (CDS) that removes noise from the analog signal, an auto gain controller (AGC) that adjusts the gain of the analog signal, and an A / D that converts the analog signal into a digital signal. It consists of a converter (ADC). Note that the processing performed by the analog signal processing unit 20 is referred to as analog signal processing. The image data converted into the digital signal is CCD-RAW data having R, G, and B density values for each pixel.

タイミングジェネレータ21は、タイミング信号を発生させるものであり、このタイミング信号をシャッタ駆動部17、CCD制御部19、およびアナログ信号処理部20に供給することにより、レリーズボタンの操作、シャッタ16の開閉、CCD18の電荷の取込み、およびアナログ信号処理部20の処理の同期をとっている。   The timing generator 21 generates a timing signal. By supplying this timing signal to the shutter drive unit 17, the CCD control unit 19, and the analog signal processing unit 20, the release button is operated, the shutter 16 is opened and closed, The capture of the charge of the CCD 18 and the processing of the analog signal processing unit 20 are synchronized.

フラッシュ制御部23は、撮影時にフラッシュ24を発光させる。   The flash control unit 23 causes the flash 24 to emit light during shooting.

画像入力コントローラ25は、アナログ信号処理部20から入力されたCCD−RAWデータをフレームメモリ26に書き込む。   The image input controller 25 writes the CCD-RAW data input from the analog signal processing unit 20 in the frame memory 26.

フレームメモリ26は、画像データに対して後述の各種画像処理(信号処理)を行う際に使用する作業用メモリであり、例えば、一定周期のバスクロック信号に同期してデータ転送を行うSDRAM(Synchronous Dynamic Random Access Memory)が使用される。   The frame memory 26 is a working memory used when various image processing (signal processing) described later is performed on the image data. For example, an SDRAM (Synchronous) that performs data transfer in synchronization with a bus clock signal having a fixed period. Dynamic Random Access Memory) is used.

表示制御部27は、フレームメモリ26に格納された画像データをスルー画像としてモニタ28に表示させたり、再生モード時に記録メディア35に保存されている画像データをモニタ28に表示させたりするためのものである。なお、スルー画像は、撮影モードが選択されている間、所定時間間隔でCCD18により連続して撮影される。   The display control unit 27 displays the image data stored in the frame memory 26 on the monitor 28 as a through image, or displays the image data stored in the recording medium 35 on the monitor 28 in the reproduction mode. It is. Note that through images are continuously photographed by the CCD 18 at predetermined time intervals while the photographing mode is selected.

AF処理部30およびAE/AWB処理部31は、プレ画像に基づいて撮影条件を決定する。このプレ画像とは、レリーズボタンが半押しされることによって発生する半押し信号を検出したCPU40がCCD18にプレ撮影を実行させた結果、フレームメモリ26に格納された画像データにより表される画像である。   The AF processing unit 30 and the AE / AWB processing unit 31 determine shooting conditions based on the pre-image. This pre-image is an image represented by image data stored in the frame memory 26 as a result of the CPU 40 having detected a half-press signal generated by half-pressing the release button causing the CCD 18 to perform pre-photographing. is there.

AF処理部30は、プレ画像に基づいて焦点位置を検出し、フォーカス駆動量データを出力する(AF処理)。焦点位置の検出方式としては、例えば、所望とする被写体にピントが合った状態では画像のコントラストが高くなるという特徴を利用して合焦位置を検出するパッシブ方式が考えられる。   The AF processing unit 30 detects a focal position based on the pre-image and outputs focus drive amount data (AF processing). As a focus position detection method, for example, a passive method that detects a focus position using a feature that the contrast of an image is high when a desired subject is in focus can be considered.

AE/AWB処理部31は、プレ画像に基づいて被写体輝度を測定し、測定した被写体輝度に基づいてISO感度、絞り値およびシャッタスピード等を決定し、ISO感度データ、絞り値データおよびシャッタスピードデータを露出設定値として決定するとともに(AE処理)、撮影時のホワイトバランスを自動調整する(AWB処理)。なお、露出およびホワイトバランスについては、撮影モードがマニュアルモードに設定されている場合には、デジタルカメラ1の撮影者がマニュアル操作により設定可能である。また、露出およびホワイトバランスが自動で設定された場合にも、撮影者が操作系2から指示を行うことにより、露出およびホワイトバランスをマニュアル調整することが可能である。   The AE / AWB processing unit 31 measures subject brightness based on the pre-image, determines ISO sensitivity, aperture value, shutter speed, and the like based on the measured subject brightness, and ISO sensitivity data, aperture value data, and shutter speed data. Is determined as an exposure setting value (AE process), and white balance at the time of shooting is automatically adjusted (AWB process). The exposure and white balance can be set manually by the photographer of the digital camera 1 when the shooting mode is set to the manual mode. Even when the exposure and white balance are set automatically, the photographer can manually adjust the exposure and white balance by giving an instruction from the operation system 2.

画像処理部32は、本画像の画像データに対して、階調補正、シャープネス補正、色補正等の画質補正処理、CCD−RAWデータを輝度信号であるYデータと、青色色差信号であるCbデータおよび赤色色差信号であるCrデータとからなるYCデータに変換するYC処理を行う。この本画像とは、レリーズボタンが全押しされることによって実行される本撮影によりCCD18から取り込まれ、アナログ信号処理部20、画像入力コントローラ25経由でフレームメモリ26に格納された画像データによる画像である。本画像の画素数の上限は、CCD18の画素数によって決定されるが、例えば、ファイン、ノーマル等の設定により、記録画素数を変更することができる。一方、スルー画像およびプレ画像の画像数は、本画像よりも少なく、例えば、本画像の1/16程度の画素数で取り込まれる。   The image processing unit 32 performs image quality correction processing such as gradation correction, sharpness correction, and color correction on the image data of the main image, CCD-RAW data as Y data that is a luminance signal, and Cb data that is a blue color difference signal. Then, YC processing for converting into YC data composed of Cr data which is a red color difference signal is performed. The main image is an image based on image data that is captured from the CCD 18 by main shooting performed when the release button is fully pressed and stored in the frame memory 26 via the analog signal processing unit 20 and the image input controller 25. is there. Although the upper limit of the number of pixels of the main image is determined by the number of pixels of the CCD 18, for example, the number of recording pixels can be changed by setting such as fine and normal. On the other hand, the number of images of the through image and the pre-image is smaller than that of the main image.

圧縮/伸長処理部33は、画像処理部32によって補正・変換処理が行われた本画像の画像データに対して、例えば、JPEG等の圧縮形式で圧縮処理を行い、画像ファイルを生成する。この画像ファイルには、Exifフォーマット等に基づいて、撮影日時等の付帯情報が格納されたタグが付加される。また、圧縮/伸長処理部33は、再生モードの場合には、記録メディア35から圧縮された画像ファイルを読み出し、伸長処理を行う。伸長後の画像データはモニタ28に出力され、画像データの画像が表示される。   The compression / decompression processing unit 33 performs a compression process in a compression format such as JPEG on the image data of the main image that has been corrected and converted by the image processing unit 32 to generate an image file. A tag storing incidental information such as shooting date and time is added to the image file based on the Exif format or the like. In the reproduction mode, the compression / decompression processing unit 33 reads a compressed image file from the recording medium 35 and performs decompression processing. The decompressed image data is output to the monitor 28, and an image of the image data is displayed.

メディア制御部34は、記録メディア35にアクセスして画像ファイルの書き込みと読み込みの制御を行う。   The media control unit 34 controls the writing and reading of the image file by accessing the recording medium 35.

内部メモリ36は、デジタルカメラ1において設定される各種定数、およびCPU40が実行するプログラム等を記憶する。   The internal memory 36 stores various constants set in the digital camera 1, programs executed by the CPU 40, and the like.

顔検出部37は、撮影により取得された画像に含まれるすべての顔候補を検出する。なお、画像は、スルー画像、プレ画像および本画像のいずれであってもよいが、本実施形態においてはスルー画像から顔候補を検出するものとする。ここで、顔を検出する手法としては、あるサイズを有する検出枠を画像上少しずつ移動させ、移動した位置毎に検出枠内の画像から特徴量を算出し、あらかじめ定められていた顔特徴量とのマッチング度を算出し、マッチング度がしきい値Th0以上となる検出枠の位置を顔候補として検出する手法を用いる。なお、検出枠の大きさを変更することにより異なる大きさの顔候補の検出が可能となる。また、しきい値Th0は後述するしきい値設定部42により設定される。   The face detection unit 37 detects all face candidates included in an image acquired by shooting. Note that the image may be any of a through image, a pre-image, and a main image, but in this embodiment, face candidates are detected from the through image. Here, as a method for detecting a face, a detection frame having a certain size is moved little by little on the image, a feature amount is calculated from an image in the detection frame for each moved position, and a predetermined face feature amount is obtained. Is used, and a detection frame position where the matching degree is equal to or greater than the threshold Th0 is detected as a face candidate. It should be noted that face candidates having different sizes can be detected by changing the size of the detection frame. The threshold value Th0 is set by a threshold value setting unit 42 described later.

そして顔検出部37により、図2に示すように画像G1から矩形の検出枠により囲まれる顔候補F1〜F5を検出することができる。なお、図2においては、検出されるのは顔の候補であるため、顔が存在しない部分においても検出枠により囲まれる領域が含まれている。   Then, the face detection unit 37 can detect the face candidates F1 to F5 surrounded by the rectangular detection frame from the image G1 as shown in FIG. In FIG. 2, since the face candidates are detected, an area surrounded by the detection frame is included even in a portion where no face exists.

顔構成部品検出部38は、顔候補に含まれる複数の顔構成部品についての候補である顔構成部品候補を検出する。本実施形態においては、両目の目尻K1,K2、両目の目頭K3,K4、左右の鼻の穴の脇K5,K6、左右の口元K7,K8および口の中央部分K9の9個の顔構成部品K1〜K9についての顔構成部品候補を検出するものとする。具体的には、矩形の各顔構成部品のパターンを、処理対象の顔候補の領域内の画像上を少しずつ移動させ、移動した位置毎にマッチング度を算出し、マッチング度があらかじめ定められたしきい値Th1以上となったパターンの位置の座標を顔構成部品候補として検出する。なお、座標は顔候補内の領域の左上隅を原点とした場合の顔候補内における座標である。   The face component detection unit 38 detects a face component candidate that is a candidate for a plurality of face components included in the face candidate. In the present embodiment, the nine facial components of the eye corners K1 and K2, the eyes of the eyes K3 and K4, the sides of the right and left nostrils K5 and K6, the left and right mouths K7 and K8, and the central part K9 of the mouth Assume that face component candidate candidates for K1 to K9 are detected. Specifically, the pattern of each rectangular face component is moved little by little on the image within the region of the face candidate to be processed, the matching degree is calculated for each moved position, and the matching degree is determined in advance. The coordinates of the position of the pattern that is equal to or greater than the threshold Th1 are detected as face component candidate. The coordinates are the coordinates in the face candidate when the upper left corner of the area in the face candidate is the origin.

ここで、顔候補が真の顔である場合、マッチング度がしきい値Th1以上となるパターンの位置を顔構成部品候補として検出すると、顔構成部品候補は対応する顔構成部品K1〜K9の位置において1つのみ検出されるものではなく、対応する顔構成部品K1〜K9の周囲に複数分布して検出されることが多い。このため、顔構成部品検出部38は、各顔構成部品毎に1以上の顔構成部品候補を検出する。   Here, when the face candidate is a true face, if a position of a pattern having a matching degree equal to or greater than the threshold Th1 is detected as a face component candidate, the face component candidates are positions of corresponding face components K1 to K9. Are often detected in a distributed manner around the corresponding face components K1 to K9. Therefore, the face component detection unit 38 detects one or more face component candidates for each face component.

ここで、顔候補に9つの顔構成部品K1〜K9のすべてが含まれている場合、図3(a)に示すように両目の目尻K1,K2、両目の目頭K3,K4、左右の鼻の穴の脇K5,K6、左右の口元K7,K8および口の中央部分K9の9個の顔構成部品のそれぞれに対応する顔構成部品候補が検出される。また、例えば左目の目頭について、図3(b)の×印で示すように複数の顔構成部品候補が検出される。   Here, when all nine face components K1 to K9 are included in the face candidate, as shown in FIG. 3A, the corners K1 and K2 of the eyes, the heads K3 and K4 of the eyes, and the right and left nose Face component candidate candidates corresponding to the nine face component parts of the hole sides K5 and K6, the left and right mouths K7 and K8, and the center part K9 of the mouth are detected. Further, for example, a plurality of face component candidate candidates are detected for the left eye as indicated by the crosses in FIG.

なお、マッチング度がしきい値Th1以上となる顔構成部品候補が検出されない場合には、対応する顔構成部品の候補は検出されなかったものとする。   When no face component candidate with a matching degree equal to or greater than the threshold Th1 is detected, it is assumed that no corresponding face component candidate has been detected.

判定部39は、顔検出部37が検出したすべての顔候補について、顔構成部品検出部38が検出した顔構成部品毎の顔構成部品候補の数に基づいて真の顔であるか否かを判定して、真の顔と判定された顔候補を真の顔として検出する。具体的には、すべての顔候補のうちの処理対象の顔候補について、上記9個の顔構成部品K1〜K9のそれぞれについての顔構成部品候補の総数N1〜N9を算出し、さらに総数N1〜N9の加算値であるNsumを算出する。そして加算値Nsumがしきい値Th2以上である場合に、処理対象の顔候補を真の顔であると判定し、その顔候補を真の顔として検出する。なお、加算値Nsumがしきい値Th2未満の場合は処理対象の顔候補を非顔と判定する。   The determination unit 39 determines whether or not all face candidates detected by the face detection unit 37 are true faces based on the number of face component parts candidates for each face component detected by the face component detection unit 38. A face candidate determined to be a true face is detected as a true face. Specifically, for the face candidates to be processed among all the face candidates, the total number N1 to N9 of face component candidates for each of the nine face component parts K1 to K9 is calculated. Nsum which is an addition value of N9 is calculated. When the addition value Nsum is equal to or greater than the threshold value Th2, the face candidate to be processed is determined to be a true face, and the face candidate is detected as a true face. When the addition value Nsum is less than the threshold value Th2, the face candidate to be processed is determined as a non-face.

なお、上記9個の顔構成部品K1〜K9のそれぞれについての顔構成部品候補の総数N1〜N9を9次元空間にプロットし、9次元空間においてしきい値を定める超平面または超曲面を設定し、プロットした総数N1〜N9がしきい値を定める超平面または超曲面のいずれの側にあるかに応じて、処理対象の顔候補が真の顔であるか否かを判定するようにしてもよい。ここで、簡単のために、判定に使用する顔構成部品を左右の口元K7,K8および口の中央部分K9のみとした場合、総数N7〜N9は3次元空間にプロットされる。図4は総数N7〜N9を3次元空間にプロットした状態を示す図である。まず、総数N7〜N9が図4(a)に示すようにプロットされたとすると、そのプロットの位置X1(N7,N8,N9)は、しきい値を設定する超平面A1よりも上側(すなわち値が大きい側)にある。したがって、図4(a)に示すようにプロットがなされた場合は、処理対象の顔候補を真の顔と判定する。   The total number N1 to N9 of face component candidates for each of the nine face component parts K1 to K9 is plotted in a 9-dimensional space, and a hyperplane or hypersurface that defines a threshold in the 9-dimensional space is set. Depending on whether the plotted total number N1 to N9 is on the side of the hyperplane or hypersurface that defines the threshold, it is determined whether the face candidate to be processed is a true face. Good. Here, for the sake of simplicity, when the face components used for the determination are only the left and right mouths K7 and K8 and the center part K9 of the mouth, the total number N7 to N9 is plotted in a three-dimensional space. FIG. 4 is a diagram showing a state in which the total number N7 to N9 is plotted in a three-dimensional space. First, if the total number N7 to N9 is plotted as shown in FIG. 4A, the position X1 (N7, N8, N9) of the plot is above the hyperplane A1 (that is, the value) On the larger side). Therefore, when a plot is made as shown in FIG. 4A, the face candidate to be processed is determined as a true face.

一方、総数N7〜N9が図4(b)に示すようにプロットされたとすると、そのプロットの位置X2(N7,N8,N9)は、しきい値を設定する超平面A1よりも下側(すなわち値が小さい側)にある。したがって、図4(b)に示すようにプロットがなされた場合は、処理対象の顔候補を真の顔でないと判定する。   On the other hand, if the total number N7 to N9 is plotted as shown in FIG. 4B, the position X2 (N7, N8, N9) of the plot is lower than the hyperplane A1 for setting the threshold (that is, The value is on the smaller side. Therefore, when a plot is made as shown in FIG. 4B, it is determined that the face candidate to be processed is not a true face.

なお、総数N1〜N9のそれぞれについてしきい値Th3を超えるか否かを判定し、しきい値Th3を超えた総数の数がさらにしきい値Th4を超えたときに、処理対象の顔候補を真の顔であると判定してもよい。   It is determined whether the total number N1 to N9 exceeds the threshold value Th3, and when the total number exceeding the threshold value Th3 further exceeds the threshold value Th4, the face candidates to be processed are determined. You may determine that it is a true face.

しきい値設定部42は、顔検出部37が顔候補を検出する際にマッチング度と比較するしきい値Th0を設定する。まず、1回目の撮影により取得された画像(スルー画像)から顔候補を検出する際には、より多くの顔候補が検出されるようにしきい値Th0を比較的低い値Z0に設定する。これにより、顔検出部37は、例えば図5(a)に示すように、画像G1から矩形の検出枠により囲まれる顔候補F1〜F10を検出することができる。なお、図5(a)においては、検出されるのは顔の候補であるため、顔が存在しない部分においても検出枠により囲まれる領域が含まれている。   The threshold setting unit 42 sets a threshold Th0 to be compared with the matching degree when the face detection unit 37 detects a face candidate. First, when detecting face candidates from an image (through image) acquired by the first shooting, the threshold value Th0 is set to a relatively low value Z0 so that more face candidates are detected. Thereby, the face detection part 37 can detect the face candidates F1-F10 enclosed by the rectangular detection frame from the image G1, for example, as shown to Fig.5 (a). In FIG. 5A, since face candidates are detected, a region surrounded by a detection frame is included even in a portion where no face exists.

一方、2回目以降の撮影により取得された画像から顔候補を検出する際には、1回目の撮影よりも検出される顔候補を少なくするために、しきい値Th0を値Z0よりも大きい値Z1に設定する。具体的には、1回目の撮影による取得した画像から検出した、真の顔と判定された顔候補のうち、マッチング度が最も低い顔候補を検出した際のそのマッチング度Z2よりも小さく、1回目の撮影により取得された画像から検出した、真の顔であると判定されなかった顔候補のうち、マッチング度が最も大きい顔候補についてのそのマッチング度Z3よりも大きい値Z1となるようにしきい値Th0を設定する。   On the other hand, when detecting face candidates from images acquired by the second and subsequent shootings, the threshold Th0 is set to a value larger than the value Z0 in order to reduce the number of face candidates detected compared to the first shooting. Set to Z1. Specifically, it is smaller than the matching degree Z2 when the face candidate with the lowest matching degree is detected from the face candidates determined as the true face detected from the image acquired by the first shooting. Among the face candidates that are detected from the image acquired by the second shooting and are not determined to be true faces, the threshold value is set to a value Z1 that is greater than the matching degree Z3 for the face candidate having the highest matching degree. Set the value Th0.

図6はしきい値Th0の設定を説明するための図である。図6において横軸は1回目の撮影により取得された画像から検出された顔候補F1〜F10を、縦軸はマッチング度を示す。図6に示すように顔候補F1〜F10のうち、真の顔と判定されたものは顔候補F1〜F3である。また、真の顔と判定された顔候補F1〜F3において、マッチング度が最も小さいのは顔候補F3であり、そのマッチング度はZ2である。一方、顔候補F4〜F10は非顔と判定され、非顔と判定された顔候補F4〜F10において、マッチング度が最も大きいのは顔候補F8であり、そのマッチング度はZ3である。   FIG. 6 is a diagram for explaining the setting of the threshold value Th0. In FIG. 6, the horizontal axis indicates the face candidates F1 to F10 detected from the image acquired by the first shooting, and the vertical axis indicates the matching degree. As shown in FIG. 6, among the face candidates F1 to F10, those determined as true faces are the face candidates F1 to F3. Of the face candidates F1 to F3 determined to be true faces, the face candidate F3 has the smallest matching degree, and the matching degree is Z2. On the other hand, the face candidates F4 to F10 are determined to be non-faces. Among the face candidates F4 to F10 determined to be non-faces, the face candidate F8 has the largest matching degree, and the matching degree is Z3.

したがって、しきい値設定部42は、顔検出部37が2回目以降の撮影により取得した画像から顔候補を検出する際には、顔候補F3のマッチング度Z2と顔候補F8のマッチング度Z3との中間の値Z1(例えばZ1=(Z2+Z3)/2)にしきい値Th0を設定する。このようにしきい値Th0を値Z1に設定することにより、1回目の撮影により取得された画像からは、顔候補F1〜F3のみが検出されることとなる。また、2回目以降の撮影により取得された画像からは、例えば図5(b)に示すように、図5(a)に示す顔候補F1〜F3に対応する顔候補F1′〜F3′が検出される。なお、顔候補F8に対応する顔候補F4′が検出される可能性もある。   Therefore, when the face detection unit 37 detects a face candidate from the images acquired by the second and subsequent photographing, the threshold setting unit 42 determines the matching degree Z2 of the face candidate F3 and the matching degree Z3 of the face candidate F8. The threshold value Th0 is set to an intermediate value Z1 (for example, Z1 = (Z2 + Z3) / 2). Thus, by setting the threshold value Th0 to the value Z1, only the face candidates F1 to F3 are detected from the image acquired by the first shooting. Further, as shown in FIG. 5B, for example, face candidates F1 ′ to F3 ′ corresponding to the face candidates F1 to F3 shown in FIG. 5A are detected from the images acquired by the second and subsequent shootings. Is done. Note that the face candidate F4 ′ corresponding to the face candidate F8 may be detected.

なお、上記では非顔と判定された顔候補F4〜F10において、マッチング度が最も大きい顔候補F8のマッチング度Z3を用いてしきい値Th0の値Z1を設定しているが、非顔と判定された顔候補F4〜F10において、マッチング度が2または3番目に大きい顔候補F9,F10のマッチング度と顔候補F3のマッチング度Z2との中間の値にしきい値Th0を設定するようにしてもよい。   Note that, in the face candidates F4 to F10 determined as non-faces in the above, the threshold value Th0 of the threshold value Th0 is set using the matching degree Z3 of the face candidate F8 having the highest matching degree. In the obtained face candidates F4 to F10, the threshold value Th0 may be set to an intermediate value between the matching degrees of the face candidates F9 and F10 having the second or third largest matching degree and the matching degree Z2 of the face candidate F3. Good.

また、スルー画像の撮影中は、被写体が変更される可能性が高く、その場合、検出されるべき顔候補が変化する。本実施形態においては、しきい値設定部42は、1回目の撮影から所定撮影間隔経過する毎にしきい値Th0を値Z0に設定し、その撮影の次の撮影により取得される画像からの顔候補の検出のためのしきい値Th0の値を新たに設定し直す。例えば、スルー画像を1秒間に30撮影する場合には、30回の撮影毎にしきい値Th0を値Z0に設定して、次回の以降の撮影により取得される画像から顔候補を検出する際のしきい値Th0の値を設定し直す。   In addition, during shooting a through image, there is a high possibility that the subject is changed, and in this case, the face candidates to be detected change. In the present embodiment, the threshold setting unit 42 sets the threshold Th0 to a value Z0 every time a predetermined shooting interval has elapsed since the first shooting, and a face from an image acquired by the next shooting after that shooting. A new threshold value Th0 for candidate detection is reset. For example, when 30 through images are taken per second, the threshold Th0 is set to the value Z0 every 30 shots, and face candidates are detected from images acquired by subsequent shootings. Reset the threshold Th0.

CPU40は、操作系2およびAF処理部30等の各種処理部からの信号に応じてデジタルカメラ1の本体各部を制御する。また、CPU40は、スルー画像の撮影中に、各スルー画像から真の顔を検出するように、顔検出部37、顔構成部品検出部38および判定部39を制御する。なお、判定部39が真の顔を検出すると、CPU40は、図7に示すように検出した真の顔を矩形の領域A1〜A3で囲んでスルー画像を表示するように表示制御部27に指示を行う。なお、矩形の領域は顔検出部37が検出した顔候補の検出枠に相当するものである。   The CPU 40 controls each part of the main body of the digital camera 1 in accordance with signals from various processing units such as the operation system 2 and the AF processing unit 30. Further, the CPU 40 controls the face detection unit 37, the face component detection unit 38, and the determination unit 39 so as to detect a true face from each through image during shooting of the through image. When the determination unit 39 detects a true face, the CPU 40 instructs the display control unit 27 to display a through image by surrounding the detected true face with rectangular areas A1 to A3 as shown in FIG. I do. The rectangular area corresponds to a detection frame for face candidates detected by the face detection unit 37.

データバス41は、各種処理部、フレームメモリ26およびCPU40等に接続されており、デジタル画像データおよび各種指示等のやり取りを行う。   The data bus 41 is connected to various processing units, the frame memory 26, the CPU 40, and the like, and exchanges digital image data and various instructions.

次いで、第1の実施形態において行われる処理について説明する。図8は第1の実施形態において行われる処理を示すフローチャートである。デジタルカメラ1の動作モードが撮影モードに設定されることによりCPU40が処理を開始し、スルー画像の撮影を行う(ステップST1)。そして、しきい値設定部42がしきい値設定処理を行う(ステップST2)。   Next, processing performed in the first embodiment will be described. FIG. 8 is a flowchart showing the processing performed in the first embodiment. When the operation mode of the digital camera 1 is set to the shooting mode, the CPU 40 starts processing and takes a through image (step ST1). Then, the threshold setting unit 42 performs threshold setting processing (step ST2).

図9はしきい値設定処理のフローチャートである。まず、スルー画像の撮影が1回目であるか否かを判定し(ステップST11)、ステップST11が肯定されるとしきい値Th0を値Z0に設定し(ステップST12)、処理を終了する。ステップST11が否定されるとスルー画像の撮影が、前回しきい値Th0を値Z0に設定してから所定撮影間隔経過してからの撮影であるか否かを判定し(ステップST13)、ステップST13が肯定されると、ステップST12に進んでしきい値Th0を値Z0に設定し、処理を終了する。   FIG. 9 is a flowchart of the threshold setting process. First, it is determined whether or not a through image is captured for the first time (step ST11). If step ST11 is affirmed, a threshold value Th0 is set to a value Z0 (step ST12), and the process ends. If step ST11 is negative, it is determined whether or not the through image has been shot after a predetermined shooting interval has elapsed since the previous threshold Th0 was set to the value Z0 (step ST13). Is affirmed, the process proceeds to step ST12, the threshold value Th0 is set to the value Z0, and the process ends.

一方、ステップST13が否定されると、しきい値Th0を値Z1に設定し(ステップST14)、処理を終了する。   On the other hand, if step ST13 is negative, the threshold Th0 is set to the value Z1 (step ST14), and the process ends.

図8に戻り、ステップST2に続いて顔検出部37がスルー画像に含まれるすべての顔候補を検出する(ステップST3)。次いで、顔構成部品検出部38が、i番目の顔候補を処理対象の顔候補として、処理対象の顔候補から顔構成部品毎の顔構成部品候補を検出する(ステップST4)。なお、iの初期値は1である。また、処理の順序は、例えばスルー画像上における向かって左側に存在する顔候補から右側に向かって順に行うようにすればよい。   Returning to FIG. 8, following step ST2, the face detection unit 37 detects all face candidates included in the through image (step ST3). Next, the face component detection unit 38 detects a face component candidate for each face component from the face candidates to be processed using the i-th face candidate as a process target face candidate (step ST4). The initial value of i is 1. Further, the processing order may be performed in order from the face candidate existing on the left side toward the right side on the through image, for example.

そして、判定部39が、顔構成部品検出部38が検出した顔構成部品毎の顔構成部品候補の総数の加算値Nsumがしきい値Th2以上であるか否かを判定し(ステップST5)、ステップST5が肯定されると、処理対象の顔候補を真の顔と判定して検出する(ステップST6)。一方、ステップST5が否定されると、処理対象の顔候補を非顔と判定する(ステップST7)。   Then, the determination unit 39 determines whether or not the addition value Nsum of the total number of face component candidates for each face component detected by the face component detection unit 38 is greater than or equal to a threshold Th2 (step ST5). If step ST5 is positive, the face candidate to be processed is determined as a true face and detected (step ST6). On the other hand, if step ST5 is negative, the face candidate to be processed is determined as a non-face (step ST7).

ステップST6,7に続いて、CPU40がすべての顔候補について判定部39が判定を終了したか否かを判定し(ステップST8)、ステップST8が否定されると、iに1を加算し(ステップST9)、ステップST4に戻る。ステップST8が肯定されると、真の顔を矩形領域で囲んだスルー画像をモニタ28に表示し(ステップST10)、ステップST1にリターンする。   Subsequent to steps ST6 and 7, the CPU 40 determines whether or not the determination unit 39 has completed the determination for all face candidates (step ST8). If step ST8 is negative, 1 is added to i (step ST8). ST9), the process returns to step ST4. If step ST8 is affirmed, a through image in which the true face is surrounded by a rectangular area is displayed on the monitor 28 (step ST10), and the process returns to step ST1.

このように、第1の実施形態においては、検出された顔構成部品候補の数に基づいて、顔候補から真の顔を検出するようにしたものである。ここで、顔には、目、鼻および口等の顔構成部品が含まれており、顔候補が真の顔である場合には、1つの顔構成部品について検出される顔構成部品候補が多くなる。したがって、顔候補に含まれる顔構成部品毎の顔構成部品候補の数に基づいて顔候補が真の顔であるか否かを判定することにより、顔候補から真の顔を精度良く検出することができる。   As described above, in the first embodiment, a true face is detected from face candidates based on the number of detected face component candidate candidates. Here, the face includes face components such as eyes, nose and mouth, and when the face candidate is a true face, there are many face component candidates detected for one face component. Become. Therefore, it is possible to accurately detect the true face from the face candidates by determining whether the face candidate is a true face based on the number of face component candidates for each face component included in the face candidate. Can do.

しかしながら、顔構成部品候補の数に基づく真の顔であるか否かの判定は演算に長時間を要するものとなる。第1の実施形態においては、1回目の撮影以降および所定撮影間隔経過する毎の撮影以降の撮影により取得された画像については、顔検出のためのしきい値Th0の値を大きくするようにしたため、検出される顔候補の数を少なくすることができる。したがって、演算量が多い判定の処理を行う顔候補の数を少なくすることができ、これにより、演算量を低減しつつも精度良く顔候補から真の顔を検出することができる。   However, it takes a long time to determine whether or not the face is a true face based on the number of face component candidates. In the first embodiment, the value of the threshold value Th0 for face detection is increased for images acquired by shooting after the first shooting and after shooting every time a predetermined shooting interval elapses. The number of detected face candidates can be reduced. Therefore, it is possible to reduce the number of face candidates that are subjected to a determination process with a large amount of calculation, and thereby it is possible to detect a true face with high accuracy while reducing the amount of calculation.

なお、上記第1の実施形態においては、両目の目尻K1,K2、両目の目頭K3,K4、左右の鼻の穴の脇K5,K6、左右の口元K7,K8および口の中央部分K9の9個の顔構成部品を検出しているが、これらをすべて検出する必要はなく、これらの顔構成部品のうちの1以上の顔構成部品の候補を検出するようにしてもよい。この場合、総数の加算値Nsumと比較するしきい値Th2は、検出する顔構成部品の数に応じて変更すればよい。なお、検出する顔構成部品が1つのみの場合は、両目の目尻および両目の目頭のうちのいずれか1つを検出することが好ましい。また、検出する顔構成部品は、両目の目尻、両目の目頭、左右の鼻の穴の脇、左右の口元および口の中央部分に限定されるものではなく、眉毛、両目の黒目部分等、顔を構成する部品であれば、任意の構成部品を用いることができる。   In the first embodiment, the corners K1 and K2 of the eyes, the eyes K3 and K4 of the eyes, the sides K5 and K6 of the right and left nostrils, the left and right mouths K7 and K8, and the center 9 of the mouth K9. Although individual face components are detected, it is not necessary to detect all of them, and one or more face component candidates of these face components may be detected. In this case, the threshold value Th2 to be compared with the total addition value Nsum may be changed according to the number of face components to be detected. When only one face component is detected, it is preferable to detect any one of the corners of both eyes and the eyes of both eyes. The face components to be detected are not limited to the corners of both eyes, the eyes of both eyes, the sides of the left and right nostrils, the left and right mouths, and the center of the mouth. Any components can be used as long as they are components.

次いで、本発明の第2の実施形態について説明する。なお、第2の実施形態においては、判定部39が行う処理が第1の実施形態と異なるのみであるため、構成についての詳細な説明はここでは省略する。   Next, a second embodiment of the present invention will be described. In the second embodiment, the process performed by the determination unit 39 is only different from that in the first embodiment, and a detailed description of the configuration is omitted here.

第2の実施形態においては、判定部(第1の実施形態と異なるため39Aとする)が、顔構成部品検出部38が検出した顔構成部品毎の顔構成部品候補の位置的な尤度を算出し、位置的な尤度に基づいて顔候補が真の顔であるか否かを判定する。ここで、位置的な尤度とは、顔候補の領域内において、検出された顔構成部品候補がどの程度対応する本来あるべき顔構成部品の位置に位置しているかを表す確率である。   In the second embodiment, the determination unit (39A because it is different from the first embodiment) determines the positional likelihood of the face component candidate for each face component detected by the face component detection unit 38. It is calculated, and it is determined whether the face candidate is a true face based on the positional likelihood. Here, the positional likelihood is a probability representing how much the detected face component candidate is located at the position of the corresponding face component that should be in the face candidate region.

ここで、本実施形態においては、9種類の顔構成部品について各顔構成部品の顔候補内における存在確率を表した確率分布があらかじめ求められている。   Here, in the present embodiment, probability distributions representing the existence probabilities in the face candidates of each face component for nine types of face components are obtained in advance.

図10は顔構成部品の存在確率を表す確率分布を示す図である。図10に示す確率分布は、顔候補を検出した検出枠をあらかじめ定められた一定のサイズに正規化した場合における、検出枠内での両目の目尻K1,K2、両目の目頭K3,K4、左右の鼻の穴の脇K5,K6、左右の口元K7,K8および口の中央部分K9の9個の顔構成部品の存在確率の確率分布を表すものである。なお、図10における丸印B1〜B9は、それぞれ顔候補の両目の目尻K1,K2、両目の目頭K3,K4、左右の鼻の穴の脇K5,K6、左右の口元K7,K8および口の中央部分K9の存在確率を表す確率分布であり、図10における紙面をXY平面とし、紙面に垂直な方向をZ方向とした場合、図11の確率分布のプロファイルに示すようにZ方向が各顔構成部品の存在確率を示すものとなる。したがって、図10における各丸印の中心に近いほど各顔構成部品の存在確率が高いものとなる。   FIG. 10 is a diagram showing a probability distribution representing the presence probability of a face component. The probability distribution shown in FIG. 10 shows that when the detection frame in which the face candidate is detected is normalized to a predetermined size, the eye corners K1 and K2, the eye heads K3 and K4 of the eyes in the detection frame, 9 represents the probability distribution of the existence probabilities of the nine face components of the nostril sides K5 and K6, the left and right mouths K7 and K8, and the central part K9 of the mouth. Note that the circles B1 to B9 in FIG. 10 are the eye corners K1 and K2 of the eyes of the face candidates, the eyes K3 and K4 of the eyes, the sides of the right and left nostrils K5 and K6, the left and right mouths K7 and K8, and the mouth. FIG. 10 is a probability distribution representing the existence probability of the central portion K9, and when the paper plane in FIG. 10 is the XY plane and the direction perpendicular to the paper plane is the Z direction, the Z direction indicates each face as shown in the probability distribution profile of FIG. It indicates the existence probability of the component. Therefore, the closer to the center of each circle in FIG. 10, the higher the probability of existence of each face component.

なお、確率分布は多数の顔のサンプル画像を用いてあらかじめ求めておけばよい。   The probability distribution may be obtained in advance using a large number of face sample images.

判定部39Aは、顔検出部37が検出した各顔候補を上記一定のサイズに正規化し、正規化した顔候補内の各顔構成部品毎の顔構成部品候補について、対応する顔構成部品の確率分布を参照して存在確率を位置的な尤度として算出する。具体的には、各顔構成部品候補について、対応する顔構成部品の存在確率を表す確率分布付近の位置を求め、その位置における存在確率を位置的な尤度として算出する。これにより、例えば左目目尻の候補1〜4が、図12に示す確率分布B1付近の位置C1〜C4にある場合には、図13に示すように、位置C1にある左目目尻候補1の尤度0%、位置C2にある左目目尻候補2の尤度2%、位置C3にある左目目尻候補3の尤度9%、位置C4にある左目目尻候補4の尤度17%というように、各顔構成部品候補の位置的な尤度が求められる。   The determination unit 39A normalizes each face candidate detected by the face detection unit 37 to the certain size, and the probability of the corresponding face component for each face component candidate for each face component in the normalized face candidate The existence probability is calculated as a positional likelihood with reference to the distribution. Specifically, for each face component candidate, a position in the vicinity of the probability distribution representing the existence probability of the corresponding face component is obtained, and the existence probability at that position is calculated as a positional likelihood. Thereby, for example, when the left eye corner candidates 1 to 4 are at positions C1 to C4 in the vicinity of the probability distribution B1 shown in FIG. 12, the likelihood of the left eye eye candidate 1 at the position C1 as shown in FIG. For each face, 0%, likelihood of left eye corner candidate 2 at position C2 is 2%, likelihood of left eye corner candidate 3 at position C3 is 9%, and likelihood of left eye corner candidate 4 at position C4 is 17%. The positional likelihood of the component candidate is determined.

さらに判定部39Aは、顔構成部品毎に顔構成部品候補の位置的な尤度の平均値を算出する。図14は2つの顔候補についての顔構成部品毎の顔構成部品候補の位置的な尤度の平均値を示す図である。そして、処理対象の顔候補について、位置的な尤度の平均値がしきい値Th5以上となる顔構成部品の数がしきい値Th6以上であるか否かを判定し、この判定が肯定された場合に処理対象の顔候補を真の顔であると判定して検出する。例えば、しきい値Th5として13%を、本実施形態においては9個の顔構成部品を用いているためしきい値Th6として5を用いるとすると、図14に示す顔候補1について、位置的な尤度の平均値がしきい値Th5以上となる顔構成部品は、左目目尻、左目目頭、右目目頭、左鼻脇、右鼻脇および右口元の6個となり、その数がしきい値Th6以上となるため、処理対象の顔候補1は真の顔と判定されて検出される。一方、顔候補2は尤度の平均値がしきい値Th5以上となる顔構成部品は0個であるため、顔候補2は真の顔とは判定されない。   Further, the determination unit 39A calculates an average value of the positional likelihood of the face component candidate for each face component. FIG. 14 is a diagram illustrating an average value of the positional likelihood of face component candidates for each face component for two face candidates. Then, for the face candidate to be processed, it is determined whether or not the number of face components whose average positional likelihood is equal to or greater than the threshold Th5 is equal to or greater than the threshold Th6, and this determination is affirmed. In such a case, the face candidate to be processed is determined to be a true face and detected. For example, if 13% is used as the threshold Th5 and 5 is used as the threshold Th6 since nine face components are used in the present embodiment, the position candidate 1 shown in FIG. There are six face components whose average likelihood value is equal to or greater than the threshold Th5, the left eye corner, the left eye head, the right eye head, the left nasal side, the right nose side, and the right mouth, and the number is greater than the threshold Th6. Therefore, the candidate face 1 to be processed is determined as a true face and detected. On the other hand, since face candidate 2 has 0 face components whose average likelihood is equal to or greater than threshold value Th5, face candidate 2 is not determined to be a true face.

次いで、第2の実施形態において行われる処理について説明する。図15は第2の実施形態において行われる処理を示すフローチャートである。デジタルカメラ1の動作モードが撮影モードに設定されることによりCPU40が処理を開始し、スルー画像の撮影を行う(ステップST21)。そして、しきい値設定部42がしきい値設定処理を行う(ステップST22)。続いて、顔検出部37がスルー画像に含まれるすべての顔候補を検出する(ステップST23)。次いで、顔構成部品検出部38が、i番目の顔候補を処理対象の顔候補として、処理対象の顔候補から顔構成部品毎の顔構成部品候補を検出する(ステップST24)。   Next, processing performed in the second embodiment will be described. FIG. 15 is a flowchart showing processing performed in the second embodiment. When the operation mode of the digital camera 1 is set to the shooting mode, the CPU 40 starts processing and takes a through image (step ST21). Then, the threshold setting unit 42 performs threshold setting processing (step ST22). Subsequently, the face detection unit 37 detects all face candidates included in the through image (step ST23). Next, the face component detection unit 38 detects a face component candidate for each face component from the face candidates to be processed using the i-th face candidate as a process target face candidate (step ST24).

そして、判定部39Aが、顔構成部品毎に顔構成部品候補の位置的な尤度を算出し(ステップST25)、位置的な尤度の平均値がしきい値Th5以上となる顔構成部品の数がしきい値Th6以上であるか否かを判定する(ステップST26)。ステップST26が肯定されると、処理対象の顔候補を真の顔と判定して検出する(ステップST27)。一方、ステップST26が否定されると、処理対象の顔候補を非顔と判定する(ステップST28)。   Then, the determination unit 39A calculates the positional likelihood of the facial component candidate for each facial component (step ST25), and determines the facial component of which the average positional likelihood is equal to or greater than the threshold Th5. It is determined whether or not the number is greater than or equal to threshold value Th6 (step ST26). If step ST26 is affirmed, the face candidate to be processed is determined as a true face and detected (step ST27). On the other hand, if step ST26 is negative, the candidate face to be processed is determined as a non-face (step ST28).

ステップST27,28に続いて、CPU40がすべての顔候補について判定部39Aが判定を終了したか否かを判定し(ステップST29)、ステップST29が否定されると、iに1を加算し(ステップST30)、ステップST24に戻る。ステップST29が肯定されると、真の顔を矩形領域で囲んだスルー画像をモニタ28に表示し(ステップST31)、ステップST21にリターンする。   Subsequent to steps ST27 and 28, the CPU 40 determines whether or not the determination unit 39A has finished the determination for all face candidates (step ST29). If step ST29 is negative, 1 is added to i (step ST29). ST30), the process returns to step ST24. If step ST29 is affirmed, a through image in which the true face is surrounded by a rectangular area is displayed on the monitor 28 (step ST31), and the process returns to step ST21.

このように、第2の実施形態においては、検出された顔構成部品候補の位置、とくに位置的な尤度に基づいて、各顔候補から真の顔を検出するようにしたものである。ここで、顔には、目、鼻および口等の顔構成部品が含まれており、顔候補が真の顔である場合には、顔構成部品候補は対応する顔構成部品の位置に存在することとなる。したがって、顔候補に含まれる顔構成部品候補の位置に基づいて顔候補が真の顔であるか否かを判定することにより、精度良く顔候補から真の顔を検出することができる。   As described above, in the second embodiment, a true face is detected from each face candidate based on the position of the detected face component candidate, particularly the positional likelihood. Here, the face includes face components such as eyes, nose and mouth, and when the face candidate is a true face, the face component candidate exists at the position of the corresponding face component. It will be. Therefore, the true face can be detected from the face candidate with high accuracy by determining whether or not the face candidate is a true face based on the position of the face component candidate included in the face candidate.

また、第1の実施形態と同様に、演算量が多い判定の処理を行う顔候補の数を少なくすることができるため、演算量を低減しつつも精度良く顔候補から真の顔を検出することができる。   Further, as in the first embodiment, since the number of face candidates to be subjected to determination processing with a large amount of calculation can be reduced, a true face is detected from the face candidates with high accuracy while reducing the amount of calculation. be able to.

なお、上記第2の実施形態においては、判定部39Aが顔構成部品毎の顔構成部品候補の位置的な尤度を算出し、これに基づいて顔候補が真の顔であるか否かを判定しているが、顔構成部品毎の顔構成部品候補の位置関係の尤度を算出し、位置関係の尤度に基づいて顔候補が真の顔であるか否かを判定してもよい。以下、これを第3の実施形態として説明する。   In the second embodiment, the determination unit 39A calculates the positional likelihood of the face component candidate for each face component, and based on this, determines whether the face candidate is a true face. Although it is determined, the likelihood of the positional relationship of the facial component candidate for each facial component may be calculated, and it may be determined whether the facial candidate is a true face based on the likelihood of the positional relationship. . Hereinafter, this will be described as a third embodiment.

第3の実施形態においては、判定部(第1の実施形態と異なるため39Bとする)は、顔構成部品検出部38が検出した顔構成部品毎の顔構成部品候補について、顔構成部品候補毎に他の顔構成部品の位置に対する存在確率を位置関係の尤度として算出し、算出した位置関係の尤度に基づいて顔候補が真の顔であるか否かを判定する。   In the third embodiment, the determination unit (39B because it is different from the first embodiment) sets the face component candidate for each face component detected by the face component detection unit 38 for each face component candidate. Then, the existence probability with respect to the position of another face component is calculated as the likelihood of the positional relationship, and it is determined whether or not the face candidate is a true face based on the calculated likelihood of the positional relationship.

図16は右目の目頭の、両目の目尻、左目の目頭、左右の鼻の穴の脇、左右の口元および口の中央部分の他の8個の顔構成部品に対する存在確率の確率分布を示す図である。なお、図16において確率分布B11〜B18は、それぞれ右目の目頭の、左目の目尻、右目の目尻、左目の目頭、左の鼻の穴の脇、右の鼻の穴の脇、左の口元、右の口元および口の中央部分に対する存在確率の確率分布を示す。   FIG. 16 is a diagram showing probability distributions of existence probabilities for the other eight face components of the right eye, the eyes of both eyes, the eyes of the left eye, the sides of the left and right nostrils, the left and right mouths, and the central part of the mouth. It is. In FIG. 16, probability distributions B11 to B18 are respectively the right eye corner, the left eye corner, the right eye corner, the left eye corner, the side of the left nostril, the side of the right nostril, the left mouth, The probability distribution of the probability of existence for the right mouth and the central part of the mouth is shown.

ここで、位置関係の尤度を算出する対象を右目目頭とした場合、第3の実施形態においては、判定部39Bは、顔検出部37が検出した各顔候補を第2の実施形態と同様に一定のサイズに正規化し、正規化した顔候補内において顔構成部品検出部38が検出した右目目頭候補毎に、確率分布B11〜B18を参照して存在確率を仮の位置関係の尤度として算出する。例えば、右目の目頭の、左目の目尻に対する仮の位置関係の尤度15%、右目の目尻に対する仮の位置関係の尤度12%、左目の目頭に対する仮の位置関係の尤度13%、左の鼻の穴の脇に対する仮の位置関係の尤度10%、右の鼻の穴の脇に対する仮の位置関係の尤度19%、左の口元に対する仮の位置関係の尤度13%、右の口元に対する仮の位置関係の尤度17%および口の中央部分に対する仮の位置関係の尤度15%というように仮の位置関係の尤度を算出する。   Here, when the target for calculating the likelihood of the positional relationship is the right eye, in the third embodiment, the determination unit 39B determines each face candidate detected by the face detection unit 37 as in the second embodiment. For each right eye-head candidate detected by the face component detection unit 38 in the normalized face candidate, the probability of existence is determined as the likelihood of the temporary positional relationship with reference to the probability distributions B11 to B18. calculate. For example, the likelihood of the temporary positional relationship of the right eye to the left eye corner is 15%, the likelihood of the temporary positional relationship to the right eye corner is 12%, the likelihood of the temporary positional relationship to the left eye corner is 13%, the left 10% likelihood of the temporary positional relationship to the side of the nostril, 19% likelihood of the temporary positional relationship to the side of the right nostril, 13% likelihood of the temporary positional relationship to the left mouth, right The likelihood of the temporary positional relationship is calculated such that the likelihood of the temporary positional relationship with respect to the mouth is 17% and the likelihood of the temporary positional relationship with respect to the central portion of the mouth is 15%.

そして判定部39Bは、算出した8個の仮の位置関係の尤度の平均値を算出し、さらにこの平均値のすべての顔構成部品候補についての平均値を、その顔構成部品候補の最終的な位置関係の尤度として算出する。   Then, the determination unit 39B calculates an average value of the likelihoods of the eight calculated temporary positional relationships, and further calculates an average value for all face component candidate candidates of this average value as a final value of the face component component candidate. It is calculated as the likelihood of a correct positional relationship.

なお、第3の実施形態においては、右目の目頭のみならず、左目の目尻、右目の目尻、左目の目頭、左の鼻の穴の脇、右の鼻の穴の脇、左の口元、右の口元および口の中央部分についても、それぞれ他の顔構成部品に対する存在確率の確率分布が求められており、判定部39Bは、9個すべての顔構成部品の顔構成部品候補について位置関係の尤度を算出する。そして、判定部39Bは顔構成部品毎に算出した9個の顔構成部品候補の位置関係の尤度がしきい値Th7以上となる顔構成部品の数がしきい値Th8以上であるか否かを判定し、この判定が肯定された場合に処理対象の顔候補を真の顔であると判定して検出する。   In the third embodiment, not only the right eye corner, the left eye corner, the right eye corner, the left eye corner, the side of the left nostril, the side of the right nostril, the left mouth, the right The probability distributions of the existence probabilities with respect to the other face components are also obtained for each of the mouth and the central portion of the mouth, and the determination unit 39B determines the likelihood of the positional relationship for the face component candidates of all nine face components. Calculate the degree. Then, the determination unit 39B determines whether or not the number of face component parts for which the likelihood of the positional relationship of the nine face component parts calculated for each face component part is equal to or greater than the threshold value Th7 is equal to or greater than the threshold value Th8. If this determination is affirmative, the processing target face candidate is determined to be a true face and detected.

次いで、第3の実施形態において行われる処理について説明する。図17は第3の実施形態において行われる処理を示すフローチャートである。デジタルカメラ1の動作モードが撮影モードに設定されることによりCPU40が処理を開始し、スルー画像の撮影を行う(ステップST41)。そして、しきい値設定部42がしきい値設定処理を行う(ステップST42)。続いて、顔検出部37がスルー画像に含まれるすべての顔候補を検出する(ステップST43)。次いで、顔構成部品検出部38が、i番目の顔候補を処理対象の顔候補として、処理対象の顔候補から顔構成部品毎の顔構成部品候補を検出する(ステップST44)。なお、iの初期値は1である。   Next, processing performed in the third embodiment will be described. FIG. 17 is a flowchart showing processing performed in the third embodiment. When the operation mode of the digital camera 1 is set to the shooting mode, the CPU 40 starts processing and takes a through image (step ST41). Then, the threshold setting unit 42 performs threshold setting processing (step ST42). Subsequently, the face detection unit 37 detects all face candidates included in the through image (step ST43). Next, the face component detection unit 38 detects a face component candidate for each face component from the face candidates to be processed, using the i-th face candidate as a face candidate to be processed (step ST44). The initial value of i is 1.

そして、判定部39Bが、顔構成部品毎に顔構成部品候補の位置関係の尤度を算出し(ステップST45)、位置関係の尤度がしきい値Th7以上となる顔構成部品の数がしきい値Th8以上であるか否かを判定する(ステップST46)。ステップST46が肯定されると、処理対象の顔候補を真の顔と判定して検出する(ステップST47)。一方、ステップST46が否定されると、処理対象の顔候補を非顔と判定する(ステップST48)。   Then, the determination unit 39B calculates the likelihood of the positional relationship between the facial component candidates for each facial component (step ST45), and determines the number of facial components whose positional relationship likelihood is equal to or greater than the threshold Th7. It is determined whether or not the threshold value is Th8 or more (step ST46). If step ST46 is affirmed, the face candidate to be processed is determined as a true face and detected (step ST47). On the other hand, if step ST46 is negative, the face candidate to be processed is determined as a non-face (step ST48).

ステップST47,48に続いて、CPU40がすべての顔候補について判定部39Bが判定を終了したか否かを判定し(ステップST49)、ステップST49が否定されると、iに1を加算し(ステップST50)、ステップST44に戻る。ステップST49が肯定されると、真の顔を矩形領域で囲んだスルー画像をモニタ28に表示し(ステップST51)、ステップST41にリターンする。   Subsequent to steps ST47 and 48, the CPU 40 determines whether or not the determination unit 39B has finished the determination for all face candidates (step ST49). If step ST49 is negative, 1 is added to i (step ST49). ST50), the process returns to step ST44. If step ST49 is affirmed, a through image in which the true face is surrounded by a rectangular area is displayed on the monitor 28 (step ST51), and the process returns to step ST41.

このように、第3の実施形態においては、検出された顔構成部品の位置、とくに位置関係の尤度に基づいて、各顔候補から真の顔を検出するようにしたものである。ここで、顔には、目、鼻および口等の顔構成部品が含まれており、顔候補が真の顔である場合には、顔構成部品候補は対応する顔構成部品の位置に存在することとなり、さらに顔構成部品間の位置関係は略決まっている。したがって、顔候補に含まれる顔構成部品候補の位置関係に基づいて顔候補が真の顔であるか否かを判定することにより、顔候補から真の顔を精度良く検出することができる。   As described above, in the third embodiment, a true face is detected from each face candidate based on the detected position of the face component, particularly the likelihood of the positional relationship. Here, the face includes face components such as eyes, nose and mouth, and when the face candidate is a true face, the face component candidate exists at the position of the corresponding face component. In addition, the positional relationship between the face components is substantially determined. Therefore, by determining whether or not the face candidate is a true face based on the positional relationship of the face component candidate included in the face candidate, the true face can be detected from the face candidate with high accuracy.

また、第1の実施形態と同様に、演算量が多い判定の処理を行う顔候補の数を少なくすることができるため、演算量を低減しつつも精度良く顔候補から真の顔を検出することができる。   Further, as in the first embodiment, since the number of face candidates to be subjected to determination processing with a large amount of calculation can be reduced, a true face is detected from the face candidates with high accuracy while reducing the amount of calculation. be able to.

なお、上記第3の実施形態においては、9種類の顔構成部品のすべての位置関係の尤度を算出し、位置関係の尤度がしきい値Th7以上となる顔構成部品がしきい値Th8以上であるか否かに基づいて顔候補が真の顔か否かを判定しているが、9種類の顔構成部品のすべてを用いる必要はなく、少なくとも1つの顔構成部品についての位置関係の尤度に基づいて顔候補が真の顔か否かを判定するようにしてもよい。   In the third embodiment, the likelihoods of all the positional relationships of the nine types of face components are calculated, and the facial components whose positional relationship likelihood is equal to or greater than the threshold value Th7 are threshold values Th8. Whether or not the face candidate is a true face is determined based on whether or not it is above, but it is not necessary to use all nine types of face components, and the positional relationship of at least one face component You may make it determine whether a face candidate is a true face based on likelihood.

また、上記第2および第3の実施形態においては、検出した顔候補の顔構成部品候補が、対応する各顔構成部品の確率分布上に位置していれば、精度よく位置的な尤度および位置関係の尤度を算出することができるが、図18に示すように顔候補の各顔構成部品候補の位置(図中×で示す)が本来あるべき顔構成部品の位置の確率分布とずれていると、尤度を精度よく算出することができず、その結果、顔候補が真の顔であるか否かを精度よく判定することができない。このため、検出した顔構成部品候補が確率分布内に位置するように、顔候補を正規化することが好ましい。以下、これを第4の実施形態として説明する。   In the second and third embodiments, if the face component candidate of the detected face candidate is located on the probability distribution of each corresponding face component, the positional likelihood and Although the likelihood of the positional relationship can be calculated, as shown in FIG. 18, the position of each face component candidate of the face candidate (indicated by x in the figure) is different from the probability distribution of the position of the face component that should be originally located. The likelihood cannot be calculated with high accuracy, and as a result, it cannot be accurately determined whether or not the face candidate is a true face. For this reason, it is preferable to normalize face candidates so that the detected face component candidate is located in the probability distribution. Hereinafter, this will be described as a fourth embodiment.

第4の実施形態において、顔候補を正規化するためには、顔候補内の顔構成部品候補のうちのいずれかの顔構成部品候補を対応する顔構成部品の確率分布の中心(すなわち最も確率が高い位置)と一致させるように、顔候補の画像をアフィン変換する。アフィン変換は、平面上の任意の3点を拡大縮小、平行移動および回転することにより任意の3点に移動させる変換であり、具体的には下記の式(1)により表される。   In the fourth embodiment, in order to normalize a face candidate, one of the face component candidates in the face candidate is set to the center of the probability distribution of the corresponding face component (that is, the most probable probability). Affine transformation is performed on the face candidate image so that the image matches the position of the face. The affine transformation is a transformation in which any three points on the plane are moved to any three points by enlarging / reducing, translating and rotating, and is specifically represented by the following formula (1).

x′=a1・x+b1・y+d1
y′=a2・x+b2・y+d2 (1)
式(1)より、アフィン変換の係数a1,a2,b1,b2,d1,d2を算出するためには、顔候補内および顔構成部品の確率分布内においてそれぞれ対応する3点の座標が必要となる。ここで、顔候補および顔構成部品の確率分布において、図18に示すように左下隅を原点とするXY座標系を考えると、顔構成部品候補P1〜P9が確率分布B1〜B9の中心に位置するようにアフィン変換の係数を設定する必要がある。第4の実施形態においては、顔構成部品毎に顔構成部品検出部38が検出した少なくとも1つの顔構成部品候補のうち、マッチング度が最も高い顔構成部品候補を顔構成部品候補を代表する顔構成部品候補P1〜P9として選択し、選択した9個の顔構成部品候補P1〜P9のうちマッチング度が大きい上位3個の顔構成部品候補を、対応する顔構成部品の確率分布の中心と一致させるようにアフィン変換の係数a1,a2,b1,b2,d1,d2を算出すればよい。
x ′ = a1 · x + b1 · y + d1
y ′ = a2 · x + b2 · y + d2 (1)
In order to calculate the coefficients a1, a2, b1, b2, d1, d2 of the affine transformation from the equation (1), the coordinates of three points corresponding to each other in the probability distribution of the face candidate and the face component are required. Become. Here, in the probability distribution of the face candidates and the face component parts, considering an XY coordinate system with the lower left corner as the origin as shown in FIG. 18, the face component candidate candidates P1 to P9 are positioned at the centers of the probability distributions B1 to B9. It is necessary to set the coefficient of affine transformation so that it does. In the fourth embodiment, the face component candidate with the highest matching degree among the at least one face component part detected by the face component detection unit 38 for each face component is the face representing the face component candidate. Select as the component candidate candidates P1 to P9, and match the top three face component candidates with the highest matching degree among the selected nine face component candidates P1 to P9 with the center of the probability distribution of the corresponding face component The affine transformation coefficients a1, a2, b1, b2, d1, and d2 may be calculated so that

例えば、図18に示す顔構成部品候補P1〜P9のマッチング度がP1>P2>P3>P4>P5…である場合には、顔構成部品候補P1,P2,P3を、対応する顔構成部品の確率分布B1,B2,B3の中心とそれぞれ一致させるようにアフィン変換の係数a1,a2,b1,b2,d1,d2を算出する。   For example, when the matching degrees of the face component candidate candidates P1 to P9 shown in FIG. 18 are P1> P2> P3> P4> P5..., The face component candidate candidates P1, P2, P3 are assigned to the corresponding face component parts. Affine transformation coefficients a1, a2, b1, b2, d1, d2 are calculated so as to coincide with the centers of the probability distributions B1, B2, B3, respectively.

なお、アフィン変換の係数を算出するためには3点の座標を用いるのみならず、4点以上の座標を用いてもよい。例えば、9個の顔構成部品候補P1〜P9のすべてを対応する顔構成部品の確率分布B1〜B9の中心と一致させるようにアフィン変換の係数を算出してもよい。この場合、変換後の9個の顔構成部品候補P1〜P9の座標と、確率分布B1〜B9の中心位置の座標との誤差が最小となるように、最小二乗法を用いてアフィン変換の係数を算出すればよい。   In order to calculate the coefficient of affine transformation, not only the coordinates of three points but also the coordinates of four or more points may be used. For example, the affine transformation coefficient may be calculated so that all nine face component candidate candidates P1 to P9 coincide with the centers of the corresponding face component probability distributions B1 to B9. In this case, the coefficient of the affine transformation using the least square method so that the error between the coordinates of the nine face component candidates P1 to P9 after the transformation and the coordinates of the center positions of the probability distributions B1 to B9 is minimized. May be calculated.

次いで、第4の実施形態において行われる処理について説明する。図19は第4の実施形態において行われる処理を示すフローチャートである。なお、ここでは、第4の実施形態を第2の実施形態に適用した場合の処理について説明するが、第3の実施形態に対しても同様に適用できるものである。   Next, processing performed in the fourth embodiment will be described. FIG. 19 is a flowchart showing processing performed in the fourth embodiment. In addition, although the process at the time of applying 4th Embodiment to 2nd Embodiment is demonstrated here, it can apply similarly also to 3rd Embodiment.

デジタルカメラ1の動作モードが撮影モードに設定されることによりCPU40が処理を開始し、スルー画像の撮影を行う(ステップST61)。そして、しきい値設定部42がしきい値設定処理を行う(ステップST62)。続いて、顔検出部37がスルー画像に含まれるすべての顔候補を検出する(ステップST63)。次いで、顔構成部品検出部38が、i番目の顔候補を処理対象の顔候補として、処理対象の顔候補から顔構成部品毎の顔構成部品候補を検出する(ステップST64)。なお、iの初期値は1である。   When the operation mode of the digital camera 1 is set to the shooting mode, the CPU 40 starts processing and takes a through image (step ST61). Then, the threshold setting unit 42 performs threshold setting processing (step ST62). Subsequently, the face detection unit 37 detects all face candidates included in the through image (step ST63). Next, the face component detection unit 38 detects the face component candidate for each face component from the face candidates to be processed, using the i-th face candidate as the face candidate to be processed (step ST64). The initial value of i is 1.

そして、判定部39Aが処理対象の顔候補を正規化し(ステップST65)、正規化の後、顔構成部品毎に顔構成部品候補の位置的な尤度を算出し(ステップST66)、位置的な尤度の平均値がしきい値Th5以上となる顔構成部品の数がしきい値Th6以上であるか否かを判定する(ステップST67)。ステップST67が肯定されると、処理対象の顔候補を真の顔と判定して検出する(ステップST68)。一方、ステップST68が否定されると、処理対象の顔候補を非顔と判定する(ステップST69)。   Then, the determination unit 39A normalizes the face candidate to be processed (step ST65), and after normalization, calculates the positional likelihood of the face component candidate for each face component (step ST66). It is determined whether or not the number of face components whose average likelihood value is equal to or greater than threshold value Th5 is equal to or greater than threshold value Th6 (step ST67). If step ST67 is positive, the face candidate to be processed is determined as a true face and detected (step ST68). On the other hand, if step ST68 is negative, the face candidate to be processed is determined as a non-face (step ST69).

ステップST68,69に続いて、CPU40がすべての顔候補について判定部39Aが判定を終了したか否かを判定し(ステップST70)、ステップST70が否定されると、iに1を加算し(ステップST71)、ステップST64に戻る。ステップST70が肯定されると、真の顔を矩形領域で囲んだスルー画像をモニタ28に表示し(ステップST72)、ステップST61にリターンする。   Subsequent to steps ST68 and 69, the CPU 40 determines whether or not the determination unit 39A has finished the determination for all face candidates (step ST70). If step ST70 is negative, 1 is added to i (step ST70). ST71), the process returns to step ST64. If step ST70 is affirmed, a through image in which the true face is surrounded by a rectangular area is displayed on the monitor 28 (step ST72), and the process returns to step ST61.

このように、第4の実施形態においては、顔候補の領域内において各顔構成部品候補の位置が対応する顔構成部品の位置に位置するように顔候補をアフィン変換して正規化するようにしたため、より精度良く顔候補から真の顔を検出することができる。   Thus, in the fourth embodiment, face candidates are affine transformed and normalized so that the position of each face component candidate is located at the position of the corresponding face component in the face candidate region. Therefore, the true face can be detected from the face candidates with higher accuracy.

また、第1の実施形態と同様に、演算量が多い判定の処理を行う顔候補の数を少なくすることができるため、演算量を低減しつつも精度良く顔候補から真の顔を検出することができる。   Further, as in the first embodiment, since the number of face candidates to be subjected to determination processing with a large amount of calculation can be reduced, a true face is detected from the face candidates with high accuracy while reducing the amount of calculation. be able to.

なお、上記第4の実施形態においては、顔候補毎にアフィン変換の係数を算出してアフィン変換を行っているが、すべての顔候補について、各顔構成部品について選択した顔構成部品候補の平均位置を算出し、算出した平均位置が確率分布の中心と一致するようにアフィン変換の係数を算出してもよい。この場合においても、9個の顔構成部品から選択した顔構成部品候補のうちの3つの顔構成部品候補からアフィン変換の係数を算出してもよく、4以上の顔構成部品候補からアフィン変換の係数を算出してもよい。   In the fourth embodiment, the affine transformation coefficient is calculated for each face candidate and the affine transformation is performed. For all face candidates, the average of the face component candidate selected for each face component is selected. The position may be calculated, and the affine transformation coefficient may be calculated so that the calculated average position matches the center of the probability distribution. Even in this case, the coefficient of affine transformation may be calculated from three face component candidates among the face component candidates selected from the nine face component parts, and the affine transformation coefficient may be calculated from four or more face component candidates. A coefficient may be calculated.

また、上記第4の実施形態においては、正規化前に顔構成部品毎の顔構成部品候補について仮の位置的な尤度または仮の位置関係の尤度を算出し、仮の位置的な尤度または仮の位置関係の尤度が最も高い上位所定数の顔構成部品候補が、対応する顔構成部品の位置(すなわち存在確率がピークとなる位置)と一致するように、顔候補に対してアフィン変換を施すことにより正規化を行うようにしてもよい。   Further, in the fourth embodiment, the temporary positional likelihood or the temporary positional relationship likelihood is calculated for the face component candidate for each face component before normalization, and the temporary positional likelihood is calculated. Face candidates so that the top predetermined number of face component candidates with the highest likelihood of degree or tentative positional relationship match the position of the corresponding face component (that is, the position at which the existence probability peaks). Normalization may be performed by performing affine transformation.

次いで、本発明の第5の実施形態について説明する。なお、第5の実施形態においては、判定部39が行う処理が第1の実施形態と異なるのみであるため、構成についての詳細な説明はここでは省略する。   Next, a fifth embodiment of the present invention will be described. In the fifth embodiment, the process performed by the determination unit 39 is only different from that in the first embodiment, and a detailed description of the configuration is omitted here.

第5の実施形態においては、判定部(第1の実施形態と異なるため39Cとする)が、顔構成部品検出部38が検出した顔構成部品毎の顔構成部品候補の数に基づいて、顔候補が真の顔、非顔および曖昧顔のいずれかであるかを判定することにより真の顔を検出する第1の判定処理を行い、第1の判定処理により曖昧顔と判定された顔候補について、第2、第3または第4の実施形態と同様に、顔構成部品候補の位置に基づいて顔候補が真の顔であるか否かを判定することにより真の顔を検出する第2の判定処理を行うようにした点が第1の実施形態と異なる。   In the fifth embodiment, the determination unit (39C because it is different from the first embodiment) determines the face based on the number of face component candidates for each face component detected by the face component detection unit 38. First determination processing for detecting a true face is performed by determining whether the candidate is a true face, a non-face, or an ambiguous face, and the face candidate determined as an ambiguous face by the first determination processing As in the second, third, or fourth embodiment, the second method of detecting the true face by determining whether the face candidate is a true face based on the position of the face component candidate. This is different from the first embodiment in that the determination process is performed.

第5の実施形態における判定部39Cは、第1の判定処理においては、第1の実施形態における判定部39と同様に9個の顔構成部品K1〜K9のそれぞれについての顔構成部品候補の総数N1〜N9を算出し、さらに総数N1〜N9の加算値であるNsumを算出する。そして加算値Nsumがしきい値Th9以上である場合に処理対象の顔候補を真の顔であると判定し、その顔候補を真の顔として検出する。また、加算値Nsumがしきい値Th10以上しきい値Th9未満である場合に処理対象の顔候補を曖昧顔と判定し、加算値Nsumがしきい値Th10未満である場合に処理対象の顔候補を非顔であると判定する。また、曖昧顔と判定された顔候補に対する上記第2、第3または第4の実施形態のいずれかの処理を第2の判定処理として行う。   In the first determination process, the determination unit 39C according to the fifth embodiment uses the total number of face component parts candidates for each of the nine face component parts K1 to K9 in the same manner as the determination unit 39 according to the first embodiment. N1 to N9 are calculated, and Nsum which is an added value of the total number N1 to N9 is calculated. When the addition value Nsum is equal to or greater than the threshold Th9, the face candidate to be processed is determined to be a true face, and the face candidate is detected as a true face. Further, when the addition value Nsum is greater than or equal to the threshold Th10 and less than the threshold Th9, the face candidate to be processed is determined to be an ambiguous face, and when the addition value Nsum is less than the threshold Th10, the face candidate to be processed. Is determined to be non-face. In addition, the process in the second, third, or fourth embodiment for the face candidate determined as an ambiguous face is performed as the second determination process.

次いで、第5の実施形態において行われる処理について説明する。図20は第5の実施形態において行われる処理を示すフローチャートである。デジタルカメラ1の動作モードが撮影モードに設定されることによりCPU40が処理を開始し、スルー画像の撮影を行う(ステップST81)。そして、しきい値設定部42がしきい値設定処理を行う(ステップST82)。続いて、顔検出部37がスルー画像に含まれるすべての顔候補を検出する(ステップST83)。次いで、顔構成部品検出部38が、i番目の顔候補を処理対象の顔候補として、処理対象の顔候補から顔構成部品毎の顔構成部品候補を検出する(ステップST84)。なお、iの初期値は1である。   Next, processing performed in the fifth embodiment will be described. FIG. 20 is a flowchart showing processing performed in the fifth embodiment. When the operation mode of the digital camera 1 is set to the shooting mode, the CPU 40 starts processing and takes a through image (step ST81). Then, the threshold setting unit 42 performs threshold setting processing (step ST82). Subsequently, the face detection unit 37 detects all face candidates included in the through image (step ST83). Next, the face component detection unit 38 detects the face component candidate for each face component from the face candidates to be processed, using the i-th face candidate as the face candidate to be processed (step ST84). The initial value of i is 1.

そして、判定部39Cが第1の判定処理を行う(ステップST85)。まず、顔構成部品検出部38が検出した顔構成部品毎の顔構成部品候補の総数の加算値Nsumがしきい値Th9以上であるか否かを判定し(ステップST86)、ステップST86が肯定されると、処理対象の顔候補を真の顔と判定して検出する(ステップST87)。一方、ステップST86が否定されると、加算値Nsumがしきい値Th10以上しきい値Th9未満であるか否かを判定し(ステップST88)、ステップST88が否定されると、処理対象の顔候補を非顔と判定する(ステップST89)。ステップST88が肯定されると、処理対象の顔候補が曖昧顔であるとして、第2の判定処理を行う(ステップST90)。   Then, the determination unit 39C performs a first determination process (step ST85). First, it is determined whether or not the addition value Nsum of the total number of face component candidates for each face component detected by the face component detection unit 38 is greater than or equal to the threshold Th9 (step ST86), and step ST86 is affirmed. Then, the face candidate to be processed is determined as a true face and detected (step ST87). On the other hand, if step ST86 is negative, it is determined whether or not the addition value Nsum is greater than or equal to threshold value Th10 and less than threshold value Th9 (step ST88). If step ST88 is negative, face candidate to be processed is determined. Is determined to be a non-face (step ST89). If step ST88 is affirmed, a second determination process is performed assuming that the face candidate to be processed is an ambiguous face (step ST90).

まず、第2の実施形態と同様に、判定部39Cが、顔構成部品毎に顔構成部品候補の位置的な尤度を算出し(ステップST91)、顔構成部品毎に尤度の平均値がしきい値Th5以上となる顔構成部品の数がしきい値Th6以上であるか否かを判定する(ステップST92)。なお、ステップST91の前に第4の実施形態と同様に処理対象の顔候補を正規化してもよい。また、ステップST91,92の処理を第3の実施形態のステップST45,46の処理と同様に位置関係の尤度を用いて行ってもよい。ステップST92が肯定されると、処理対象の顔候補を真の顔と判定して検出する(ステップST93)。一方、ステップST92が否定されると、処理対象の顔候補を非顔と判定する(ステップST94)。   First, as in the second embodiment, the determination unit 39C calculates the positional likelihood of the face component candidate for each face component (step ST91), and the average likelihood value for each face component is calculated. It is determined whether or not the number of face components that are equal to or greater than threshold Th5 is equal to or greater than threshold Th6 (step ST92). Note that the candidate face to be processed may be normalized before step ST91 as in the fourth embodiment. Moreover, you may perform the process of step ST91,92 using the likelihood of positional relationship similarly to the process of step ST45,46 of 3rd Embodiment. If step ST92 is affirmed, the face candidate to be processed is determined as a true face and detected (step ST93). On the other hand, if step ST92 is negative, the face candidate to be processed is determined as a non-face (step ST94).

ステップST87,89,93,94に続いて、CPU40がすべての顔候補について判定部39Cが判定を終了したか否かを判定し(ステップST95)、ステップST95が否定されると、iに1を加算し(ステップST96)、ステップST84に戻る。ステップST95が肯定されると、真の顔を矩形領域で囲んだスルー画像をモニタ28に表示し(ステップST97)、ステップST81にリターンする。   Subsequent to steps ST87, 89, 93, and 94, the CPU 40 determines whether or not the determination unit 39C has completed the determination for all face candidates (step ST95), and if step ST95 is negative, i is set to 1. Addition (step ST96) returns to step ST84. If step ST95 is affirmed, a through image in which the true face is surrounded by a rectangular area is displayed on the monitor 28 (step ST97), and the process returns to step ST81.

ここで、顔構成部品候補の数に基づいて顔候補が真の顔であるか否かを判定する場合と、顔構成部品候補の位置に基づいて顔候補が真の顔であるか否かを判定する場合とでは、前者の方が演算量が少ない。また、暗いシーンや逆光の撮影時においては顔候補が暗くなるため、その顔候補が真の顔であっても検出される顔構成部品候補の数が少なくなり、その結果、第1の実施形態の処理を行うのみでは、真の顔を非顔と判定してしまうおそれがある。このため、第5の実施形態のように、顔構成部品候補の数に基づいて曖昧顔と判定された顔候補についてのみ、顔構成部品候補の位置に基づいて顔候補が真の顔であるか否かを判定することにより、さらに演算量を低減でき、かつ精度良く顔候補から真の顔を検出することができる。   Here, when determining whether or not the face candidate is a true face based on the number of face component candidate, and whether or not the face candidate is a true face based on the position of the face component candidate. In the case of determination, the former has less calculation amount. In addition, since face candidates become dark at the time of shooting a dark scene or backlight, the number of detected face component candidates is reduced even if the face candidate is a true face. As a result, the first embodiment If only the process is performed, the true face may be determined as a non-face. Therefore, as in the fifth embodiment, for only face candidates determined to be ambiguous based on the number of face component candidates, whether the face candidate is a true face based on the position of the face component candidate By determining whether or not, the amount of calculation can be further reduced, and the true face can be detected from the face candidates with high accuracy.

なお、上記第5の実施形態においては、第1の判定処理として、上記9個の顔構成部品K1〜K9のそれぞれについての顔構成部品候補の総数N1〜N9を9次元空間にプロットし、9次元空間においてしきい値を定める超平面または超曲面を設定し、プロットした総数N1〜N9がしきい値を定める超平面または超曲面のいずれの側にあるかに応じて、顔候補が真の顔、曖昧顔および非顔のいずれであるかを判定するようにしてもよい。   In the fifth embodiment, as the first determination process, the total number N1 to N9 of face component parts candidates for each of the nine face component parts K1 to K9 is plotted in a 9-dimensional space. A hyperplane or hypersurface that defines a threshold value is set in a dimensional space, and the face candidate is true depending on which side of the hyperplane or hypersurface that defines the threshold value the total number N1 to N9 is plotted. You may make it determine whether it is a face, an ambiguous face, and a non-face.

また、上記第5の実施形態においては、第1の判定処理および第2の判定処理を同一の判定部39Cにおいて行っているが、第1および第2の判定処理をそれぞれ行う2つの判定部を設けるようにしてもよい。   Moreover, in the said 5th Embodiment, although the 1st determination process and the 2nd determination process are performed in the same determination part 39C, two determination parts which respectively perform a 1st and 2nd determination process are provided. You may make it provide.

以上、本発明の実施形態に係るデジタルカメラについて説明したが、コンピュータを、上記の顔検出部37、顔構成部品検出部38、判定部39,39A〜39Cおよびしきい値設定部42に対応する手段として機能させ、図8,9,15,17,19,20に示すような処理を行わせるプログラムも本発明の実施形態の1つである。また、そのようなプログラムを記録したコンピュータ読取り可能な記録媒体も、本発明の実施形態の1つである。   The digital camera according to the embodiment of the present invention has been described above. The computer corresponds to the face detection unit 37, the face component detection unit 38, the determination units 39, 39A to 39C, and the threshold setting unit 42 described above. A program that functions as a means and performs processing as shown in FIGS. 8, 9, 15, 17, 19, and 20 is also one embodiment of the present invention. A computer-readable recording medium in which such a program is recorded is also one embodiment of the present invention.

本発明の第1の実施形態による撮影装置を適用したデジタルカメラの構成を示す概略ブロック図1 is a schematic block diagram showing the configuration of a digital camera to which a photographing apparatus according to a first embodiment of the present invention is applied. 顔候補の検出を説明するための図Diagram for explaining detection of face candidates 顔構成部品候補の検出を説明するための図The figure for demonstrating the detection of a face component candidate 顔候補が真の顔であるか否かの判定を説明するための図The figure for demonstrating determination of whether a face candidate is a true face しきい値の設定を説明するための図(その1)Diagram for explaining setting of threshold (part 1) しきい値の設定を説明するための図(その2)Diagram for explaining setting of threshold (part 2) 真の顔が矩形で囲まれたスルー画像を示す図Diagram showing a through image with a true face surrounded by a rectangle 第1の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 1st Embodiment. しきい値設定処理のフローチャートThreshold setting process flowchart 顔構成部品の存在確率の確率分布を示す図Diagram showing probability distribution of face component existence probability 確率分布のプロファイルを示す図Diagram showing probability distribution profile 確率分布付近における顔構成部品候補の位置の例を示す図The figure which shows the example of the position of the face component candidate in the probability distribution vicinity 各顔構成部品候補について算出した位置的な尤度を示す図The figure which shows the positional likelihood calculated about each face component candidate 2つの顔候補についての顔構成部品毎の顔構成部品候補の位置的な尤度の平均値を示す図The figure which shows the average value of the positional likelihood of the face component candidate for every face component about two face candidates. 第2の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 2nd Embodiment. 右目の目頭の、両目の目尻、左目の目頭、左右の鼻の穴の脇、左右の口元および口の中央部分の他の8個の顔構成部品に対する存在確率の確率分布を示す図The figure which shows the probability distribution of the existence probability with respect to the other eight face components of the right eye's eyes, the eyes of both eyes, the eyes of the left eye, the sides of the right and left nostrils, the left and right mouths, and the central part of the mouth. 第3の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 3rd Embodiment 顔構成部品の位置のずれを説明するための図The figure for demonstrating the shift | offset | difference of the position of a face component 第4の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 4th Embodiment 第5の実施形態において行われる処理を示すフローチャートThe flowchart which shows the process performed in 5th Embodiment

符号の説明Explanation of symbols

1 デジタルカメラ
2 操作系
3 操作系制御部
6 撮像系
28 モニタ
35 記録メディア
37 顔検出部
38 顔構成部品検出部
39 判定部
40 CPU
42 しきい値設定部
DESCRIPTION OF SYMBOLS 1 Digital camera 2 Operation system 3 Operation system control part 6 Imaging system 28 Monitor 35 Recording medium 37 Face detection part 38 Face component detection part 39 Determination part 40 CPU
42 Threshold setting section

Claims (8)

連続した撮影により画像を連続して取得する撮影手段と、
所定サイズの検出枠を前記画像上において移動させ、移動した位置毎に該検出枠内の前記画像から特徴量を算出し、該特徴量とあらかじめ定められた顔特徴量とのマッチング度を算出し、該マッチング度が所定のしきい値以上となったときに前記検出枠の位置の画像を顔候補として検出する顔検出手段と、
前記顔候補に含まれる少なくとも1つの顔構成部品の候補を該顔構成部品毎に検出する顔構成部品検出手段と、
前記顔構成部品毎に検出された前記顔構成部品候補の数および位置の少なくとも一方に基づいて、前記顔候補が真の顔であるか否かを判定する判定手段と、
所定の撮影の際に取得された所定撮影時画像から前記顔候補を検出するに際には、前記所定のしきい値を第1の値に設定し、該所定の撮影以降の撮影により取得された画像から前記顔候補を検出する際には、前記所定撮影時画像から検出された前記顔候補であって前記真の顔であると判定された顔候補のうち、前記マッチング度が最も低い顔候補を検出可能な第2の値を前記所定のしきい値に設定するしきい値設定手段とを備えたことを特徴とする撮影装置。
Photographing means for continuously acquiring images by continuous photographing;
A detection frame of a predetermined size is moved on the image, a feature amount is calculated from the image in the detection frame for each moved position, and a matching degree between the feature amount and a predetermined face feature amount is calculated. , A face detection unit that detects an image at the position of the detection frame as a face candidate when the matching degree is equal to or greater than a predetermined threshold;
Face component detection means for detecting at least one face component candidate included in the face candidate for each face component;
Determining means for determining whether or not the face candidate is a true face based on at least one of the number and position of the face component candidates detected for each face component;
When the face candidate is detected from a predetermined shooting image acquired at the time of predetermined shooting, the predetermined threshold is set to a first value and acquired by shooting after the predetermined shooting. When detecting the face candidate from the captured image, the face candidate having the lowest matching degree among the face candidates detected from the predetermined photographing image and determined to be the true face An imaging apparatus, comprising: threshold value setting means for setting a second value capable of detecting a candidate to the predetermined threshold value.
前記所定の撮影は、最初の撮影であることを特徴とする請求項1記載の撮影装置。   The imaging apparatus according to claim 1, wherein the predetermined imaging is an initial imaging. 前記所定の撮影はあらかじめ定められた間隔での撮影であることを特徴とする請求項1または2記載の撮影装置。   The photographing apparatus according to claim 1, wherein the predetermined photographing is photographing at a predetermined interval. 前記判定手段は、前記位置に基づいて前記顔候補が前記真の顔であるか否かを判定するに際し、前記顔候補の領域内における前記各顔構成部品候補の、対応する前記顔構成部品に対する位置的な尤度を算出し、該位置的な尤度に基づいて前記顔候補が前記真の顔であるか否かを判定する手段であることを特徴とする請求項1から3のいずれか1項記載の撮影装置。   When determining whether the face candidate is the true face based on the position, the determining unit determines whether each face component candidate in the face candidate region corresponds to the corresponding face component. The position likelihood is calculated, and based on the position likelihood, it is means for determining whether or not the face candidate is the true face. The imaging device according to 1. 前記判定手段は、前記位置に基づいて前記顔候補が前記真の顔であるか否かを判定するに際し、前記顔候補の領域内における前記各顔構成部品候補の、対応する前記顔構成部品以外の他の顔構成部品に対する位置関係の尤度を算出し、該位置関係の尤度に基づいて前記顔候補が前記真の顔であるか否かを判定する手段であることを特徴とする請求項1から3のいずれか1項記載の撮影装置。   When determining whether the face candidate is the true face or not based on the position, the determining unit determines whether each face component candidate in the face candidate area is other than the corresponding face component. A means for calculating a likelihood of a positional relationship with respect to another facial component and determining whether or not the face candidate is the true face based on the likelihood of the positional relationship. Item 4. The photographing apparatus according to any one of Items 1 to 3. 前記判定手段は、前記位置に基づいて前記顔候補が前記真の顔であるか否かを判定するに際し、前記顔候補の領域内において前記各顔構成部品を正規化し、該正規化した前記各顔構成部品の位置に基づいて、前記顔候補が前記真の顔であるか否かを判定する手段であることを特徴とする請求項1から5のいずれか1項記載の撮影装置。   When determining whether the face candidate is the true face based on the position, the determination unit normalizes each face component in the area of the face candidate, and the normalized each 6. The photographing apparatus according to claim 1, wherein the photographing apparatus is means for determining whether or not the face candidate is the true face based on a position of a face component. 連続した撮影により画像を連続して取得し、
所定サイズの検出枠を前記画像上において移動させ、移動した位置毎に該検出枠内の前記画像から特徴量を算出し、該特徴量とあらかじめ定められた顔特徴量とのマッチング度を算出し、該マッチング度が所定のしきい値以上となったときに前記検出枠の位置の画像を顔候補として検出し、
前記顔候補に含まれる少なくとも1つの顔構成部品の候補を該顔構成部品毎に検出し、
前記顔構成部品毎に検出された前記顔構成部品候補の数および位置の少なくとも一方に基づいて、前記顔候補が真の顔であるか否かを判定するに際し、
所定の撮影の際に取得された所定撮影時画像から前記顔候補を検出するに際には、前記所定のしきい値を第1の値に設定し、該所定の撮影以降の撮影により取得された画像から前記顔候補を検出する際には、前記所定撮影時画像から検出された前記顔候補であって前記真の顔であると判定された顔候補のうち、前記マッチング度が最も低い顔候補を検出可能な第2の値を前記所定のしきい値に設定することを特徴とする撮影方法。
Acquire images continuously by continuous shooting,
A detection frame of a predetermined size is moved on the image, a feature amount is calculated from the image in the detection frame for each moved position, and a matching degree between the feature amount and a predetermined face feature amount is calculated. , Detecting the image at the position of the detection frame as a face candidate when the matching degree is equal to or greater than a predetermined threshold value,
Detecting at least one face component candidate included in the face candidate for each face component;
In determining whether or not the face candidate is a true face based on at least one of the number and position of the face component candidates detected for each face component,
When the face candidate is detected from a predetermined shooting image acquired at the time of predetermined shooting, the predetermined threshold is set to a first value and acquired by shooting after the predetermined shooting. When detecting the face candidate from the captured image, the face candidate having the lowest matching degree among the face candidates detected from the predetermined photographing image and determined to be the true face A shooting method, wherein a second value capable of detecting a candidate is set to the predetermined threshold value.
連続した撮影により画像を連続して取得する手順と、
所定サイズの検出枠を前記画像上において移動させ、移動した位置毎に該検出枠内の前記画像から特徴量を算出し、該特徴量とあらかじめ定められた顔特徴量とのマッチング度を算出し、該マッチング度が所定のしきい値以上となったときに前記検出枠の位置の画像を顔候補として検出する手順と、
前記顔候補に含まれる少なくとも1つの顔構成部品の候補を該顔構成部品毎に検出する手順と、
前記顔構成部品毎に検出された前記顔構成部品候補の数および位置の少なくとも一方に基づいて、前記顔候補が真の顔であるか否かを判定する手順と、
所定の撮影の際に取得された所定撮影時画像から前記顔候補を検出するに際には、前記所定のしきい値を第1の値に設定し、該所定の撮影以降の撮影により取得された画像から前記顔候補を検出する際には、前記所定撮影時画像から検出された前記顔候補であって前記真の顔であると判定された顔候補のうち、前記マッチング度が最も低い顔候補を検出可能な第2の値を前記所定のしきい値に設定する手順とを有することを特徴とする撮影方法をコンピュータに実行させるためのプログラム。
The procedure to acquire images continuously by continuous shooting,
A detection frame of a predetermined size is moved on the image, a feature amount is calculated from the image in the detection frame for each moved position, and a matching degree between the feature amount and a predetermined face feature amount is calculated. , A procedure for detecting an image at the position of the detection frame as a face candidate when the matching degree is equal to or greater than a predetermined threshold;
Detecting at least one face component candidate included in the face candidate for each face component;
Determining whether the face candidate is a true face based on at least one of the number and position of the face component candidates detected for each face component; and
When the face candidate is detected from a predetermined shooting image acquired at the time of predetermined shooting, the predetermined threshold is set to a first value and acquired by shooting after the predetermined shooting. When detecting the face candidate from the captured image, the face candidate having the lowest matching degree among the face candidates detected from the predetermined photographing image and determined to be the true face A program for causing a computer to execute an imaging method, comprising: setting a second value capable of detecting a candidate to the predetermined threshold value.
JP2007030076A 2007-02-09 2007-02-09 Photographing apparatus, method and program Withdrawn JP2008199146A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007030076A JP2008199146A (en) 2007-02-09 2007-02-09 Photographing apparatus, method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007030076A JP2008199146A (en) 2007-02-09 2007-02-09 Photographing apparatus, method and program

Publications (1)

Publication Number Publication Date
JP2008199146A true JP2008199146A (en) 2008-08-28

Family

ID=39757726

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007030076A Withdrawn JP2008199146A (en) 2007-02-09 2007-02-09 Photographing apparatus, method and program

Country Status (1)

Country Link
JP (1) JP2008199146A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102008053395A1 (en) * 2008-10-21 2010-04-29 Cognitec Systems Gmbh Method and device for photographic image capture of the visual field of a person
WO2023189195A1 (en) * 2022-03-30 2023-10-05 キヤノン株式会社 Image processing device, image processing method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102008053395A1 (en) * 2008-10-21 2010-04-29 Cognitec Systems Gmbh Method and device for photographic image capture of the visual field of a person
WO2023189195A1 (en) * 2022-03-30 2023-10-05 キヤノン株式会社 Image processing device, image processing method, and program

Similar Documents

Publication Publication Date Title
JP4884251B2 (en) Imaging apparatus, method, and program
US10733472B2 (en) Image capture device with contemporaneous image correction mechanism
US8593542B2 (en) Foreground/background separation using reference images
US8682097B2 (en) Digital image enhancement with reference images
US8330831B2 (en) Method of gathering visual meta data using a reference image
JP4819001B2 (en) Imaging apparatus and method, program, image processing apparatus and method, and program
US8861806B2 (en) Real-time face tracking with reference images
US8208690B2 (en) Image-processing device and image-processing method, image-pickup device, and computer program
US8879802B2 (en) Image processing apparatus and image processing method
US20110116720A1 (en) Method and apparatus for image processing
KR20100124738A (en) Automatic redeye detection
JP2011166442A (en) Imaging device
JP5247338B2 (en) Image processing apparatus and image processing method
JP2008199146A (en) Photographing apparatus, method and program
JP2008197763A (en) Photographing device, method, and program
JP5016999B2 (en) Imaging apparatus, imaging method, and program
Rahman et al. Real-time face-based auto-focus for digital still and cell-phone cameras
JP4799397B2 (en) Dictionary data creation device, predetermined area detection device, and photographing device

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: 20100511