JP2010245721A - Face image processing - Google Patents

Face image processing Download PDF

Info

Publication number
JP2010245721A
JP2010245721A JP2009090750A JP2009090750A JP2010245721A JP 2010245721 A JP2010245721 A JP 2010245721A JP 2009090750 A JP2009090750 A JP 2009090750A JP 2009090750 A JP2009090750 A JP 2009090750A JP 2010245721 A JP2010245721 A JP 2010245721A
Authority
JP
Japan
Prior art keywords
face
image
image processing
face orientation
orientation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009090750A
Other languages
Japanese (ja)
Inventor
Kenji Matsuzaka
健治 松坂
Masaya Usui
雅也 碓井
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2009090750A priority Critical patent/JP2010245721A/en
Publication of JP2010245721A publication Critical patent/JP2010245721A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To easily perform effective image processing not depending on face direction in a face image. <P>SOLUTION: An image processor has a face direction estimation part which estimates face direction in a face image, a face direction changing part which performs face direction changing processing so that the face direction estimated for the face image becomes close to a target face direction, an image processing part which performs image processing for the face image, the face direction of which is changed, and a face direction recovery part which performs face direction recovery processing to restore the face direction changed by the face direction changing processing for the face image after image processing. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、顔画像に対する画像処理を行う技術に関する。   The present invention relates to a technique for performing image processing on a face image.

顔画像に対して種々の画像処理(例えば瞳の大きさを拡大する画像処理)を行う技術が知られている(例えば特許文献1参照)。   A technique for performing various image processing (for example, image processing for enlarging the size of a pupil) on a face image is known (for example, see Patent Document 1).

特開2005−31990号公報JP 2005-31990 A

顔画像における顔向きは様々である。従来、顔画像における顔向きによっては、顔画像に対する画像処理の結果が不自然なものとなってしまうなど、画像処理を効果的に実行できない場合があった。   There are various face orientations in the face image. Conventionally, depending on the face orientation of a face image, there have been cases where image processing cannot be executed effectively, for example, the result of image processing on the face image becomes unnatural.

本発明は、上記の課題を解決するためになされたものであり、顔画像における顔向きによらず効果的な画像処理を容易に実現することを目的とする。   SUMMARY An advantage of some aspects of the invention is to easily realize effective image processing regardless of the face orientation in a face image.

上記課題の少なくとも一部を解決するために、本発明は、以下の形態または適用例として実現することが可能である。   In order to solve at least a part of the above problems, the present invention can be realized as the following forms or application examples.

[適用例1]顔画像に対して画像処理を行う画像処理装置であって、
前記顔画像における顔向きを推定する顔向き推定部と、
前記顔画像に対して、推定された顔向きが目標顔向きに近づくように顔向き変更処理を行う顔向き変更部と、
前記顔向き変更処理後の前記顔画像に対して前記画像処理を行う画像処理部と、
前記画像処理後の前記顔画像に対して、前記顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理を行う顔向き復元部と、を備える、画像処理装置。
Application Example 1 An image processing apparatus that performs image processing on a face image,
A face orientation estimating unit for estimating a face orientation in the face image;
A face orientation changing unit that performs a face orientation changing process so that the estimated face orientation approaches the target face orientation with respect to the face image;
An image processing unit that performs the image processing on the face image after the face orientation change processing;
An image processing apparatus comprising: a face orientation restoring unit that performs a face orientation restoring process for restoring the face orientation changed by the face orientation changing process to the face image after the image processing.

この画像処理装置では、顔画像における顔向きが推定され、顔画像に対して推定された顔向きが目標顔向きに近づくように顔向き変更処理が行われ、顔向き変更処理後の顔画像に対して画像処理が行われ、画像処理後の顔画像に対して顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理が行われるため、顔画像における顔向きがどのような顔向きであっても効果的な画像処理を実現することができると共に、画像処理の態様を顔向き毎に設定する必要がないため画像処理を容易に実現することができる。   In this image processing apparatus, the face orientation in the face image is estimated, face orientation change processing is performed so that the estimated face orientation with respect to the face image approaches the target face orientation, and the face image after the face orientation change processing is processed. The image processing is performed on the face image and the face image after the image processing is subjected to the face orientation restoration process for restoring the face orientation changed by the face orientation changing process. Effective image processing can be realized even in the orientation, and image processing can be easily realized because it is not necessary to set the image processing mode for each face orientation.

[適用例2]適用例1に記載の画像処理装置であって、
前記目標顔向きは、正面向きである、画像処理装置。
[Application Example 2] The image processing apparatus according to Application Example 1,
The image processing apparatus, wherein the target face orientation is a front orientation.

この画像処理装置では、顔画像における顔向きがどのような顔向きであっても、顔向きが正面向きに近づくように顔画像に対して顔向き変更処理が行われた後、画像処理が実行されるため、正面向きの顔画像に対して実行されることが想定された画像処理を任意の顔向きの顔画像に対して実行しても良好な結果を得ることができる。   In this image processing apparatus, no matter what face orientation the face image has, the image processing is executed after the face orientation changing process is performed on the face image so that the face orientation approaches the front orientation. Therefore, good results can be obtained even if image processing that is assumed to be performed on a face image facing the front is performed on a face image facing any face.

[適用例3]適用例1に記載の画像処理装置であって、
前記画像処理部は、複数種類の前記画像処理を実行可能であり、
前記画像処理装置は、さらに、
前記画像処理の種類と顔向きとの対応関係を記憶する記憶部を備え、
前記顔向き変更部は、前記対応関係において、前記画像処理部により実行される前記画像処理の種類に対応付けられた顔向きを、前記目標顔向きに設定する、画像処理装置。
[Application Example 3] The image processing apparatus according to Application Example 1,
The image processing unit can execute a plurality of types of the image processing,
The image processing apparatus further includes:
A storage unit that stores the correspondence between the type of image processing and the face orientation;
The face orientation changing unit is an image processing device that sets, in the correspondence relationship, a face orientation associated with a type of the image processing executed by the image processing unit as the target face orientation.

この画像処理装置では、画像処理の種類と顔向きとの対応関係が記憶され、対応関係において画像処理の種類に対応付けられた顔向きが目標顔向きに設定されるため、多様な種類の画像処理を効果的にかつ容易に実現することができる。   In this image processing apparatus, the correspondence relationship between the type of image processing and the face orientation is stored, and the face orientation associated with the type of image processing in the correspondence relationship is set as the target face orientation. The processing can be realized effectively and easily.

[適用例4]適用例1ないし適用例3のいずれかに記載の画像処理装置であって、
前記画像処理部は、推定された顔向きが前記目標顔向きから比較的離れた第1の範囲にある場合には、前記顔向き変更処理後の前記顔画像に対して前記画像処理を行い、推定された顔向きが前記第1の範囲と比較して前記目標顔向きに近い第2の範囲にある場合には、前記顔向き変更処理が行われる前の前記顔画像に対して前記画像処理を行う、画像処理装置。
[Application Example 4] The image processing apparatus according to any one of Application Examples 1 to 3,
The image processing unit performs the image processing on the face image after the face orientation change processing when the estimated face orientation is in a first range relatively far from the target face orientation, When the estimated face orientation is in the second range that is closer to the target face orientation compared to the first range, the image processing is performed on the face image before the face orientation change processing is performed. An image processing apparatus.

この画像処理装置では、推定された顔向きが目標顔向きから比較的離れた第1の範囲にある場合には顔向き変更処理後の顔画像に対して画像処理が行われる一方、推定された顔向きが第1の範囲と比較して目標顔向きに近い第2の範囲にある場合には顔向き変更処理が行われる前の顔画像に対して画像処理が行われるため、効率的な処理を実現することができる。   In this image processing apparatus, when the estimated face orientation is in the first range relatively far from the target face orientation, image processing is performed on the face image after the face orientation change process, while the estimated face orientation is estimated. When the face orientation is in the second range that is closer to the target face orientation compared to the first range, the image processing is performed on the face image before the face orientation change processing is performed, and thus efficient processing Can be realized.

[適用例5]適用例1ないし適用例4のいずれかに記載の画像処理装置であって、さらに、
顔の所定の特徴部位の位置により規定される顔形状を基準形状と顔向きを含む少なくとも1つの顔形状特徴量とにより表す形状モデルと、前記基準形状を有する顔画像の画素値により規定される顔テクスチャーを基準テクスチャーと少なくとも1つの顔テクスチャー特徴量とにより表すテクスチャーモデルと、を用いて、前記顔画像における前記特徴部位の位置を特定する特徴位置特定部を備え、
前記顔向き変更部は、前記形状モデルにおける顔向きを表す前記顔形状特徴量を変更することにより、前記顔向き変更処理を実行する、画像処理装置。
Application Example 5 The image processing apparatus according to any one of Application Examples 1 to 4, further comprising:
Defined by a shape model representing a face shape defined by the position of a predetermined feature part of the face by a reference shape and at least one face shape feature amount including a face orientation, and a pixel value of a face image having the reference shape Using a texture model that represents a face texture by a reference texture and at least one face texture feature amount, and a feature position specifying unit that specifies the position of the feature part in the face image,
The face direction changing unit is an image processing apparatus that executes the face direction changing process by changing the face shape feature amount representing a face direction in the shape model.

この画像処理装置では、形状モデルにおける顔向きを表す顔形状特徴量を変更することにより顔向き変更処理を実現することができる。   In this image processing apparatus, the face orientation changing process can be realized by changing the face shape feature amount representing the face orientation in the shape model.

[適用例6]適用例5に記載の画像処理装置であって、
前記特徴部位は、目の輪郭を含み、
前記画像処理は、前記顔画像において位置が特定された目の輪郭により規定される目領域を拡大する処理を含む、画像処理装置。
[Application Example 6] The image processing apparatus according to Application Example 5,
The characteristic part includes an eye outline,
The image processing apparatus includes a process of enlarging an eye region defined by an eye contour whose position is specified in the face image.

この画像処理装置では、目領域を拡大する画像処理を、顔画像における顔向きによらず効果的にかつ容易に実現することができる。   In this image processing apparatus, image processing for enlarging the eye area can be effectively and easily realized regardless of the face orientation in the face image.

[適用例7]適用例5に記載の画像処理装置であって、
前記特徴部位は、目の輪郭を含み、
前記画像処理は、前記顔画像において位置が特定された目の輪郭により規定される左右の目領域の大きさを互いに近づける処理を含む、画像処理装置。
[Application Example 7] The image processing apparatus according to Application Example 5,
The characteristic part includes an eye outline,
The image processing apparatus includes a process of bringing the sizes of the left and right eye regions defined by the contours of the eyes whose positions are specified in the face image closer to each other.

この画像処理装置では、左右の目領域の大きさを互いに近づける画像処理を、顔画像における顔向きによらず効果的にかつ容易に実現することができる。   In this image processing apparatus, image processing for making the sizes of the left and right eye regions close to each other can be effectively and easily realized regardless of the face orientation in the face image.

[適用例8]適用例5ないし適用例7のいずれかに記載の画像処理装置であって、
前記形状モデルと前記テクスチャーモデルとは、前記特徴部位の位置を示す特徴点の配置が既知である複数のサンプル顔画像を対象とした統計的分析に基づき設定され、
前記特徴位置特定部は、前記基準形状における前記特徴点の配置に基づき前記顔画像における前記特徴点の初期配置を決定し、前記顔画像と、前記基準形状と前記基準テクスチャーとにより規定される基準顔画像と、の比較結果に基づき前記特徴点の配置を更新することにより、前記顔画像における前記特徴部位の位置を特定する、画像処理装置。
Application Example 8 The image processing apparatus according to any one of Application Example 5 to Application Example 7,
The shape model and the texture model are set based on a statistical analysis for a plurality of sample face images whose arrangement of feature points indicating the positions of the feature parts is known,
The feature position specifying unit determines an initial arrangement of the feature points in the face image based on an arrangement of the feature points in the reference shape, and a reference defined by the face image, the reference shape, and the reference texture. An image processing apparatus that identifies the position of the feature portion in the face image by updating the arrangement of the feature points based on a comparison result with the face image.

この画像処理装置では、特徴位置特定部による顔画像における特徴部位の位置の特定を実現することができる。   In this image processing apparatus, the position of the characteristic part in the face image can be specified by the characteristic position specifying unit.

[適用例9]適用例8に記載の画像処理装置であって、
前記基準形状は、前記複数のサンプル顔画像における前記特徴部位の平均位置を表す平均形状であり、
前記基準テクスチャーは、前記平均形状に形状変換された前記複数のサンプル顔画像の前記特徴部位の位置における画素値の平均を表す平均テクスチャーである、画像処理装置。
[Application Example 9] The image processing apparatus according to Application Example 8,
The reference shape is an average shape representing an average position of the characteristic part in the plurality of sample face images,
The image processing apparatus, wherein the reference texture is an average texture that represents an average of pixel values at the positions of the characteristic portions of the plurality of sample face images that have been transformed into the average shape.

この画像処理装置では、特徴位置特定部による顔画像における特徴部位の位置の特定を精度良く実現することができる。   In this image processing apparatus, it is possible to accurately specify the position of the feature part in the face image by the feature position specifying unit.

[適用例10]顔画像に対して画像処理を行う画像処理方法であって、
(a)前記顔画像における顔向きを推定する工程と、
(b)前記顔画像に対して、推定された顔向きが目標顔向きに近づくように顔向き変更処理を行う工程と、
(c)前記顔向き変更処理後の前記顔画像に対して前記画像処理を行う工程と、
(d)前記画像処理後の前記顔画像に対して、前記顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理を行う工程と、を備える、画像処理方法。
Application Example 10 An image processing method for performing image processing on a face image,
(A) estimating a face orientation in the face image;
(B) performing a face orientation change process on the face image so that the estimated face orientation approaches the target face orientation;
(C) performing the image processing on the face image after the face orientation change processing;
(D) An image processing method comprising: performing a face orientation restoring process for restoring the face orientation changed by the face orientation changing process to the face image after the image processing.

[適用例11]顔画像に対して画像処理を行う画像処理のためのコンピュータープログラムであって、
前記顔画像における顔向きを推定する顔向き推定機能と、
前記顔画像に対して、推定された顔向きが目標顔向きに近づくように顔向き変更処理を行う顔向き変更機能と、
前記顔向き変更処理後の前記顔画像に対して前記画像処理を行う画像処理機能と、
前記画像処理後の前記顔画像に対して、前記顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理を行う顔向き復元機能と、を、コンピューターに実現させる、コンピュータープログラム。
Application Example 11 A computer program for image processing that performs image processing on a face image,
A face direction estimating function for estimating a face direction in the face image;
A face orientation change function for performing a face orientation change process so that the estimated face orientation approaches the target face orientation with respect to the face image;
An image processing function for performing the image processing on the face image after the face orientation change processing;
The computer program which makes a computer implement | achieve the face orientation restoration function which performs the face orientation restoration process which returns the face orientation changed by the said face orientation change process with respect to the said face image after the said image processing.

[適用例12]印刷装置であって、
顔画像における顔向きを推定する顔向き推定部と、
前記顔画像に対して、推定された顔向きが目標顔向きに近づくように顔向き変更処理を行う顔向き変更部と、
前記顔向き変更処理後の前記顔画像に対して画像処理を行う画像処理部と、
前記画像処理後の前記顔画像に対して、前記顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理を行う顔向き復元部と、
前記顔向き復元処理後の前記顔画像を印刷する印刷部と、を備える、印刷装置。
Application Example 12 A printing apparatus,
A face direction estimation unit for estimating a face direction in a face image;
A face orientation changing unit that performs a face orientation changing process so that the estimated face orientation approaches the target face orientation with respect to the face image;
An image processing unit that performs image processing on the face image after the face orientation change processing;
A face orientation restoring unit that performs a face orientation restoring process for restoring the face orientation changed by the face orientation changing process to the face image after the image processing;
And a printing unit that prints the face image after the face orientation restoring process.

なお、本発明は、種々の態様で実現することが可能であり、例えば、画像処理方法および装置、画像補正方法および装置、印刷方法および装置、これらの方法または装置の機能を実現するためのコンピュータープログラム、そのコンピュータープログラムを記録した記録媒体、そのコンピュータープログラムを含み搬送波内に具現化されたデータ信号、等の形態で実現することができる。   It should be noted that the present invention can be realized in various modes, for example, an image processing method and apparatus, an image correction method and apparatus, a printing method and apparatus, and a computer for realizing the functions of these methods or apparatuses. The present invention can be realized in the form of a program, a recording medium recording the computer program, a data signal including the computer program and embodied in a carrier wave, and the like.

本発明の実施例における画像処理装置としてのプリンター100の構成を概略的に示す説明図である。1 is an explanatory diagram schematically illustrating a configuration of a printer 100 as an image processing apparatus according to an embodiment of the present invention. 本実施例におけるAAM設定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the AAM setting process in a present Example. サンプル顔画像SIの一例を示す説明図である。It is explanatory drawing which shows an example of sample face image SI. サンプル顔画像SIにおける特徴点CPの設定方法の一例を示す説明図である。It is explanatory drawing which shows an example of the setting method of the feature point CP in the sample face image SI. サンプル顔画像SIに設定された特徴点CPの座標の一例を示す説明図である。It is explanatory drawing which shows an example of the coordinate of the feature point CP set to sample face image SI. 平均形状s0の一例を示す説明図である。Is an explanatory diagram showing an example of the average shape s 0. サンプル顔画像SIのワープWの方法の一例を示す説明図である。It is explanatory drawing which shows an example of the method of the warp W of sample face image SI. 平均顔画像A0(x)の一例を示す説明図である。It is explanatory drawing which shows an example of average face image A0 (x). 本実施例における顔特徴位置特定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the face characteristic position specific process in a present Example. 対象画像OIにおける顔領域FAの検出結果の一例を示す説明図である。It is explanatory drawing which shows an example of the detection result of the face area FA in the target image OI. 本実施例における特徴点CPの初期配置決定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the initial position determination processing of the feature point CP in a present Example. 対象画像OIにおける特徴点CPの仮配置の一例を示す説明図である。It is explanatory drawing which shows an example of temporary arrangement | positioning of the feature point CP in the target image OI. 平均形状画像I(W(x;p))の一例を示す説明図である。It is explanatory drawing which shows an example of the average shape image I (W (x; p)). 対象画像OIにおける特徴点CPの初期配置の一例を示す説明図である。It is explanatory drawing which shows an example of the initial arrangement | positioning of the feature point CP in the target image OI. 本実施例における特徴点CP配置更新処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the feature point CP arrangement | positioning update process in a present Example. 顔特徴位置特定処理の結果の一例を示す説明図である。It is explanatory drawing which shows an example of the result of a face feature position specific process. 本実施例における特定画像処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the specific image process in a present Example. 基準顔向き情報SDIの内容の一例を示す説明図である。It is explanatory drawing which shows an example of the content of the reference | standard face direction information SDI. 目領域の拡大方法を示す説明図である。It is explanatory drawing which shows the expansion method of an eye area | region.

次に、本発明の実施の形態を実施例に基づいて以下の順序で説明する。
A.実施例:
A−1.画像処理装置の構成:
A−2.AAM設定処理:
A−3.顔特徴位置特定処理:
A−4.特定画像処理:
B.変形例:
Next, embodiments of the present invention will be described in the following order based on examples.
A. Example:
A-1. Configuration of image processing device:
A-2. AAM setting process:
A-3. Facial feature location processing:
A-4. Specific image processing:
B. Variation:

A.実施例:
A−1.画像処理装置の構成:
図1は、本発明の実施例における画像処理装置としてのプリンター100の構成を概略的に示す説明図である。本実施例のプリンター100は、メモリーカードMC等から取得した画像データに基づき画像を印刷する、いわゆるダイレクトプリントに対応したインクジェット式カラープリンターである。プリンター100は、プリンター100の各部を制御するCPU110と、ROMやRAMによって構成された内部メモリー120と、ボタンやタッチパネルにより構成された操作部140と、液晶ディスプレイにより構成された表示部150と、プリンターエンジン160と、カードインターフェース(カードI/F)170と、を備えている。プリンター100は、さらに、他の機器(例えばデジタルスチルカメラやパーソナルコンピューター)とのデータ通信を行うためのインターフェースを備えているとしてもよい。プリンター100の各構成要素は、バスを介して互いに接続されている。
A. Example:
A-1. Configuration of image processing device:
FIG. 1 is an explanatory diagram schematically showing the configuration of a printer 100 as an image processing apparatus according to an embodiment of the present invention. The printer 100 of this embodiment is an ink jet color printer that supports so-called direct printing, in which an image is printed based on image data acquired from a memory card MC or the like. The printer 100 includes a CPU 110 that controls each unit of the printer 100, an internal memory 120 configured by a ROM and a RAM, an operation unit 140 configured by buttons and a touch panel, a display unit 150 configured by a liquid crystal display, and a printer. An engine 160 and a card interface (card I / F) 170 are provided. The printer 100 may further include an interface for performing data communication with other devices (for example, a digital still camera or a personal computer). Each component of the printer 100 is connected to each other via a bus.

プリンターエンジン160は、印刷データに基づき印刷を行う印刷機構である。カードインターフェース170は、カードスロット172に挿入されたメモリーカードMCとの間でデータのやり取りを行うためのインターフェースである。なお、本実施例では、メモリーカードMCに画像データを含む画像ファイルが格納されている。   The printer engine 160 is a printing mechanism that performs printing based on print data. The card interface 170 is an interface for exchanging data with the memory card MC inserted into the card slot 172. In this embodiment, an image file including image data is stored in the memory card MC.

内部メモリー120には、画像処理部200と、表示処理部310と、印刷処理部320と、が格納されている。画像処理部200は、所定のオペレーティングシステムの下で、顔特徴位置特定処理や特定画像処理を実行するためのコンピュータープログラムである。本実施例の顔特徴位置特定処理は、顔画像における所定の特徴部位(例えば目尻や鼻頭やフェイスライン)の位置を特定(検出)する処理である。本実施例の特定画像処理は、選択された種類の画像処理を顔画像に対して行う処理である。顔特徴位置特定処理および特定画像処理については、後に詳述する。   The internal memory 120 stores an image processing unit 200, a display processing unit 310, and a print processing unit 320. The image processing unit 200 is a computer program for executing face feature position specifying processing and specific image processing under a predetermined operating system. The face feature position specifying process of the present embodiment is a process of specifying (detecting) the position of a predetermined feature part (for example, the corner of the eye, the nose head, or the face line) in the face image. The specific image processing of the present embodiment is processing for performing the selected type of image processing on the face image. The face feature position specifying process and the specific image process will be described in detail later.

画像処理部200は、プログラムモジュールとして、顔特徴位置特定部210と、顔領域検出部230と、特定画像処理部240と、顔向き変更部250と、顔向き復元部260と、を含んでいる。顔特徴位置特定部210は、初期配置部211と、画像変換部212と、判定部213と、更新部214と、正規化部215と、を含んでいる。これら各部の機能については、後述の顔特徴位置特定処理および特定画像処理の説明において詳述する。   The image processing unit 200 includes a face feature position specifying unit 210, a face area detecting unit 230, a specific image processing unit 240, a face direction changing unit 250, and a face direction restoring unit 260 as program modules. . The face feature position specifying unit 210 includes an initial arrangement unit 211, an image conversion unit 212, a determination unit 213, an update unit 214, and a normalization unit 215. The functions of these units will be described in detail in the description of face feature position specifying processing and specific image processing described later.

表示処理部310は、表示部150を制御して、表示部150上に処理メニューやメッセージ、画像等を表示させるディスプレイドライバである。印刷処理部320は、画像データから印刷データを生成し、プリンターエンジン160を制御して、印刷データに基づく画像の印刷を実行するためのコンピュータープログラムである。CPU110は、内部メモリー120から、これらのプログラム(画像処理部200、表示処理部310、印刷処理部320)を読み出して実行することにより、これら各部の機能を実現する。   The display processing unit 310 is a display driver that controls the display unit 150 to display processing menus, messages, images, and the like on the display unit 150. The print processing unit 320 is a computer program for generating print data from image data, controlling the printer engine 160, and printing an image based on the print data. The CPU 110 reads out and executes these programs (the image processing unit 200, the display processing unit 310, and the print processing unit 320) from the internal memory 120, thereby realizing the functions of these units.

内部メモリー120には、また、AAM情報AMIと、基準顔向き情報SDIと、が格納されている。AAM情報AMIは、後述のAAM設定処理によって予め設定される情報であり、後述の顔特徴位置特定処理および特定画像処理において参照される。基準顔向き情報SDIは、複数の特定画像処理の種類のそれぞれについて基準顔向きを指定する情報であり、後述の特定画像処理において参照される。AAM情報AMIおよび基準顔向き情報SDIの内容については、後に詳述する。   The internal memory 120 also stores AAM information AMI and reference face orientation information SDI. The AAM information AMI is information set in advance by an AAM setting process described later, and is referred to in a face feature position specifying process and a specific image process described later. The reference face orientation information SDI is information for designating a reference face orientation for each of a plurality of types of specific image processing, and is referred to in specific image processing described later. The contents of the AAM information AMI and the reference face orientation information SDI will be described in detail later.

A−2.AAM設定処理:
図2は、本実施例におけるAAM設定処理の流れを示すフローチャートである。AAM設定処理は、AAM(アクティブアピアランスモデル(Active Appearance Model))と呼ばれる画像のモデル化に用いられる形状モデルおよびテクスチャーモデルを設定する処理である。
A-2. AAM setting process:
FIG. 2 is a flowchart showing the flow of AAM setting processing in this embodiment. The AAM setting process is a process for setting a shape model and a texture model used for modeling an image called AAM (Active Appearance Model).

ステップS110では、人物の顔を表す複数の画像がサンプル顔画像SIとして設定される。図3は、サンプル顔画像SIの一例を示す説明図である。図3に示すように、サンプル顔画像SIは、個性、人種・性別、表情(怒り、笑い、困り、驚き等)、向き(正面向き、上向き、下向き、右向き、左向き等)といった種々の属性に関して互いに相違する画像が含まれるように設定される。サンプル顔画像SIがそのように設定されれば、AAMによってあらゆる顔画像を精度良くモデル化することが可能となり、あらゆる顔画像を対象とした精度の良い顔特徴位置特定処理(後述)の実行が可能となる。なお、サンプル顔画像SIは、学習顔画像とも呼ばれる。   In step S110, a plurality of images representing a person's face are set as sample face images SI. FIG. 3 is an explanatory diagram showing an example of the sample face image SI. As shown in FIG. 3, the sample face image SI has various attributes such as personality, race / gender, facial expression (anger, laughter, embarrassment, surprise, etc.), and orientation (front, upward, downward, right, left, etc.). Are set to include different images. If the sample face image SI is set in such a manner, any face image can be accurately modeled by the AAM, and accurate face feature position specifying processing (described later) for any face image can be executed. It becomes possible. The sample face image SI is also called a learning face image.

ステップS120(図2)では、サンプル顔画像SIのそれぞれにおいて、特徴点CPが設定される。図4は、サンプル顔画像SIにおける特徴点CPの設定方法の一例を示す説明図である。特徴点CPは、顔画像における所定の特徴部位の位置を示す点である。本実施例では、所定の特徴部位として、人物の顔における眉毛上の所定位置(例えば端点や4分割点等、以下同じ)、目の輪郭上の所定位置、鼻筋および小鼻の輪郭上の所定位置、上下唇の輪郭上の所定位置、顔の輪郭(フェイスライン)上の所定位置といった68箇所の部位が設定されている。すなわち、本実施例では、人物の顔に共通して含まれる顔の器官(眉毛、目、鼻、口)および顔の輪郭における所定位置が、特徴部位として設定されている。図4に示すように、特徴点CPは、各サンプル顔画像SIにおいてオペレーターにより指定された68個の特徴部位を表す位置に設定(配置)される。このように設定された各特徴点CPは各特徴部位に対応しているため、顔画像における特徴点CPの配置は顔の形状を規定していると表現することができる。   In step S120 (FIG. 2), a feature point CP is set in each sample face image SI. FIG. 4 is an explanatory diagram showing an example of a method for setting the feature point CP in the sample face image SI. The feature point CP is a point indicating the position of a predetermined feature part in the face image. In this embodiment, as predetermined feature parts, a predetermined position on the eyebrows in a person's face (for example, an end point or a four-divided point, the same applies hereinafter), a predetermined position on the eye contour, and a predetermined position on the nose and nose contours 68 parts such as a predetermined position on the contour of the upper and lower lips and a predetermined position on the contour of the face (face line) are set. In other words, in the present embodiment, predetermined positions in facial organs (eyebrows, eyes, nose, mouth) and facial contours that are commonly included in a person's face are set as feature parts. As shown in FIG. 4, the feature points CP are set (arranged) at positions representing 68 feature parts designated by the operator in each sample face image SI. Since each feature point CP set in this way corresponds to each feature part, the arrangement of the feature points CP in the face image can be expressed as defining the shape of the face.

サンプル顔画像SIにおける特徴点CPの位置は、座標により特定される。図5は、サンプル顔画像SIに設定された特徴点CPの座標の一例を示す説明図である。図5において、SI(j)(j=1,2,3・・・)は各サンプル顔画像SIを示しており、CP(k)(k=0,1,・・・,67)は各特徴点CPを示している。また、CP(k)−Xは、特徴点CP(k)のX座標を示しており、CP(k)−Yは、特徴点CP(k)のY座標を示している。特徴点CPの座標としては、顔の大きさと顔の傾き(画像面内の傾き)と顔のX方向およびY方向の位置とのそれぞれについて正規化されたサンプル顔画像SIにおける所定の基準点(例えば画像の左下の点)を原点とした座標が用いられる。また、本実施例では、1つのサンプル顔画像SIに複数の人物の顔が含まれる場合が許容されており(例えばサンプル顔画像SI(2)には2人の顔が含まれている)、1つのサンプル顔画像SIにおける各人物は人物IDによって特定される。   The position of the feature point CP in the sample face image SI is specified by coordinates. FIG. 5 is an explanatory diagram showing an example of the coordinates of the feature point CP set in the sample face image SI. In FIG. 5, SI (j) (j = 1, 2, 3,...) Indicates each sample face image SI, and CP (k) (k = 0, 1,..., 67) indicates each. A feature point CP is shown. CP (k) -X represents the X coordinate of the feature point CP (k), and CP (k) -Y represents the Y coordinate of the feature point CP (k). The coordinates of the feature point CP include predetermined reference points in the sample face image SI normalized with respect to the size of the face, the inclination of the face (inclination in the image plane), and the position in the X and Y directions of the face. For example, coordinates with the origin at the lower left point of the image are used. In the present embodiment, a case where a plurality of human faces are included in one sample face image SI is allowed (for example, two faces are included in the sample face image SI (2)). Each person in one sample face image SI is specified by a person ID.

ステップS130(図2)では、AAMの形状モデルが設定される。具体的には、各サンプル顔画像SIにおける68個の特徴点CPの座標(X座標およびY座標)により構成される座標ベクトル(図5参照)に対する主成分分析が行われ、特徴点CPの位置により特定される顔の形状sが下記の式(1)によりモデル化される。なお、形状モデルは、特徴点CPの配置モデルとも呼ばれる。   In step S130 (FIG. 2), an AAM shape model is set. Specifically, a principal component analysis is performed on a coordinate vector (see FIG. 5) composed of the coordinates (X coordinate and Y coordinate) of 68 feature points CP in each sample face image SI, and the position of the feature point CP is determined. The face shape s specified by is modeled by the following equation (1). The shape model is also referred to as a feature point CP arrangement model.

Figure 2010245721
Figure 2010245721

上記式(1)において、s0は平均形状である。図6は、平均形状s0の一例を示す説明図である。図6(a)および(b)に示すように、平均形状s0は、サンプル顔画像SIの各特徴点CPについての平均位置(平均座標)により特定される平均的な顔の形状を表すモデルである。なお、本実施例では、平均形状s0において、外周に位置する特徴点CP(フェイスラインおよび眉毛、眉間に対応する特徴点CP、図4参照)を結ぶ直線により囲まれた領域(図6(b)においてハッチングを付して示す)を「平均形状領域BSA」と呼ぶ。平均形状s0においては、図6(a)に示すように、特徴点CPを頂点とする複数の三角形領域TAが、平均形状領域BSAをメッシュ状に分割するように設定されている。 In the above formula (1), s 0 is an average shape. FIG. 6 is an explanatory diagram showing an example of the average shape s 0 . As shown in FIGS. 6A and 6B, the average shape s 0 is a model representing the average face shape specified by the average position (average coordinate) for each feature point CP of the sample face image SI. It is. In the present embodiment, in the average shape s 0 , a region surrounded by a straight line connecting feature points CP (face lines, eyebrows, feature points CP corresponding to the eyebrows, see FIG. 4) located on the outer periphery (FIG. 6 ( b) is indicated by hatching) and is referred to as “average shape region BSA”. In the average shape s 0 , as shown in FIG. 6A, a plurality of triangular regions TA having the feature points CP as vertices are set so as to divide the average shape region BSA into a mesh shape.

形状モデルを表す上記式(1)において、siは形状ベクトルであり、piは形状ベクトルsiの重みを表す形状パラメーターである。形状ベクトルsiは、顔の形状sの特性を表すベクトルであり、具体的には、主成分分析により得られる第i主成分に対応する固有ベクトルである。すなわち、分散のより大きい主成分に対応する固有ベクトルから順に、累積寄与率に基づき設定された個数nの固有ベクトルが、形状ベクトルsiとして採用される。本実施例では、最も分散の大きい第1主成分に対応する第1形状ベクトルs1は顔の左右振りにほぼ相関するベクトルとなっており、2番目に分散の大きい第2主成分に対応する第2形状ベクトルs2は顔の上下振りにほぼ相関するベクトルとなっている。また、3番目に分散の大きい第3主成分に対応する第3形状ベクトルs3は顔の形状の縦横比にほぼ相関するベクトルとなっており、4番目に分散の大きい第4主成分に対応する第4形状ベクトルs4は口の開きの程度にほぼ相関するベクトルとなっている。 In the above equation (1) representing the shape model, s i is a shape vector, and p i is a shape parameter representing the weight of the shape vector s i . The shape vector s i is a vector representing the characteristics of the face shape s, and is specifically an eigenvector corresponding to the i-th principal component obtained by principal component analysis. That is, the number of eigenvectors set based on the cumulative contribution rate is adopted as the shape vector s i in order from the eigenvector corresponding to the principal component having a larger variance. In the present embodiment, the first shape vector s 1 corresponding to the first principal component having the largest variance is a vector that is substantially correlated with the left / right swing of the face, and corresponds to the second principal component having the second largest variance. The second shape vector s 2 is a vector that is substantially correlated with the vertical swing of the face. The third shape vector s 3 corresponding to the third principal component having the third largest variance is a vector that is substantially correlated with the aspect ratio of the face shape, and corresponds to the fourth principal component having the fourth largest variance. The fourth shape vector s 4 is a vector that is substantially correlated with the degree of mouth opening.

上記式(1)に示すように、本実施例における形状モデルでは、特徴点CPの配置を表す顔形状sが、平均形状s0とn個の形状ベクトルsiの線形結合との和としてモデル化される。形状モデルにおいて形状パラメーターpiを適切に設定することにより、あらゆる画像における顔の形状sを再現することが可能である。なお、形状モデル設定ステップ(図2のステップS130)において設定された平均形状s0および形状ベクトルsiは、AAM情報AMI(図1)として内部メモリー120に格納される。平均形状s0は、本発明における基準形状に相当し、形状ベクトルsiと形状パラメーターpiとの積は、本発明における形状特徴量に相当する。 As shown in the above equation (1), in the shape model in the present embodiment, the face shape s representing the arrangement of the feature points CP is modeled as the sum of the average shape s 0 and the linear combination of the n shape vectors s i. It becomes. By appropriately setting the shape parameter p i in the shape model, the face shape s in any image can be reproduced. The average shape s 0 and shape vector s i set in the shape model setting step (step S 130 in FIG. 2) are stored in the internal memory 120 as AAM information AMI (FIG. 1). The average shape s 0 corresponds to the reference shape in the present invention, and the product of the shape vector s i and the shape parameter p i corresponds to the shape feature amount in the present invention.

ステップS140(図2)では、AAMのテクスチャーモデルが設定される。具体的には、まず、各サンプル顔画像SIに対して、サンプル顔画像SIにおける特徴点CPの配置が平均形状s0における特徴点CPの配置と等しくなるように、画像変換(以下、「ワープW」とも呼ぶ)が行われる。 In step S140 (FIG. 2), an AAM texture model is set. Specifically, first, for each sample face image SI, image conversion (hereinafter referred to as “warp”) is performed so that the arrangement of the feature points CP in the sample face image SI is equal to the arrangement of the feature points CP in the average shape s 0 . W ”).

図7は、サンプル顔画像SIのワープWの方法の一例を示す説明図である。各サンプル顔画像SIにおいては、平均形状s0と同様に、外周に位置する特徴点CPにより囲まれた領域をメッシュ状に分割する複数の三角形領域TAが設定されている。ワープWは、複数の三角形領域TAのそれぞれについてのアフィン変換の集合である。すなわち、ワープWにおいては、サンプル顔画像SIにおけるある三角形領域TAの画像は、平均形状s0における対応する三角形領域TAの画像へとアフィン変換される。ワープWにより、特徴点CPの配置が平均形状s0における特徴点CPの配置と等しいサンプル顔画像SI(以下「サンプル顔画像SIw」と表す)が生成される。 FIG. 7 is an explanatory diagram illustrating an example of a warp W method for the sample face image SI. In each sample face image SI, similarly to the average shape s 0 , a plurality of triangular areas TA that divide the area surrounded by the feature points CP located on the outer periphery into mesh shapes are set. The warp W is a set of affine transformations for each of the plurality of triangular areas TA. That is, in the warp W, an image of a certain triangular area TA in the sample face image SI is affine transformed into an image of the corresponding triangular area TA in the average shape s 0 . The warp W generates a sample face image SI (hereinafter referred to as “sample face image SIw”) in which the arrangement of the feature points CP is equal to the arrangement of the feature points CP in the average shape s 0 .

なお、各サンプル顔画像SIwは、平均形状領域BSA(図7においてハッチングを付して示す)を内包する矩形枠を外周とし、平均形状領域BSA以外の領域(以下「マスク領域MA」とも呼ぶ)がマスクされた画像として生成される。平均形状領域BSAとマスク領域MAとを併せた画像領域を基準領域BAと呼ぶ。また、各サンプル顔画像SIwは、例えば56画素×56画素のサイズの画像として正規化される。   Each sample face image SIw has a rectangular frame containing an average shape region BSA (shown with hatching in FIG. 7) as an outer periphery, and a region other than the average shape region BSA (hereinafter also referred to as “mask region MA”). Is generated as a masked image. An image area in which the average shape area BSA and the mask area MA are combined is referred to as a reference area BA. Each sample face image SIw is normalized as an image having a size of 56 pixels × 56 pixels, for example.

次に、各サンプル顔画像SIwの画素群xのそれぞれにおける輝度値により構成される輝度値ベクトルに対する主成分分析が行われ、顔のテクスチャー(「見え」とも呼ぶ)A(x)が下記の式(2)によりモデル化される。なお、画素群xは、平均形状領域BSAに位置する画素の集合である。   Next, a principal component analysis is performed on a luminance value vector composed of luminance values in each pixel group x of each sample face image SIw, and a facial texture (also referred to as “appearance”) A (x) is expressed by the following equation: Modeled by (2). The pixel group x is a set of pixels located in the average shape area BSA.

Figure 2010245721
Figure 2010245721

上記式(2)において、A0(x)は平均顔画像である。図8は、平均顔画像A0(x)の一例を示す説明図である。平均顔画像A0(x)は、ワープWの後のサンプル顔画像SIw(図7参照)の平均の画像である。すなわち、平均顔画像A0(x)は、サンプル顔画像SIwの平均形状領域BSA内の画素群xのそれぞれについて画素値(輝度値)の平均をとることにより算出される画像である。従って、平均顔画像A0(x)は、平均的な顔の形状における平均的な顔のテクスチャー(見え)を表すモデルである。なお、平均顔画像A0(x)は、サンプル顔画像SIwと同様に、平均形状領域BSAとマスク領域MAとで構成される。また、平均顔画像A0(x)においても、平均形状領域BSAとマスク領域MAとを併せた画像領域を基準領域BAと呼ぶ。 In the above equation (2), A 0 (x) is an average face image. FIG. 8 is an explanatory diagram showing an example of the average face image A 0 (x). The average face image A 0 (x) is an average image of the sample face images SIw (see FIG. 7) after the warp W. That is, the average face image A 0 (x) is an image calculated by taking the average of pixel values (luminance values) for each of the pixel groups x in the average shape area BSA of the sample face image SIw. Therefore, the average face image A 0 (x) is a model representing the average face texture (appearance) in the average face shape. Note that the average face image A 0 (x) is composed of an average shape area BSA and a mask area MA, similarly to the sample face image SIw. Also in the average face image A 0 (x), an image area that is a combination of the average shape area BSA and the mask area MA is referred to as a reference area BA.

テクスチャーモデルを表す上記式(2)において、Ai(x)はテクスチャーベクトルであり、λiはテクスチャーベクトルAi(x)の重みを表すテクスチャーパラメーターである。テクスチャーベクトルAi(x)は、顔のテクスチャーA(x)の特性を表すベクトルであり、具体的には、主成分分析により得られる第i主成分に対応する固有ベクトルである。すなわち、分散のより大きい主成分に対応する固有ベクトルから順に、累積寄与率に基づき設定された個数mの固有ベクトルが、テクスチャーベクトルAi(x)として採用される。本実施例では、最も分散の大きい第1主成分に対応する第1テクスチャーベクトルA1(x)は、顔色の変化(性別の差とも捉えられる)にほぼ相関するベクトルとなっており、2番目に分散の大きい第2主成分に対応する第2テクスチャーベクトルA2(x)は、影成分の変化(光源位置の変化とも捉えられる)にほぼ相関するベクトルとなっている。 In the above equation (2) representing the texture model, A i (x) is a texture vector, and λ i is a texture parameter representing the weight of the texture vector A i (x). The texture vector A i (x) is a vector representing the characteristics of the facial texture A (x), and specifically, is an eigenvector corresponding to the i-th principal component obtained by principal component analysis. That is, the number m of eigenvectors set based on the cumulative contribution rate is adopted as the texture vector A i (x) in order from the eigenvector corresponding to the principal component having a larger variance. In the present embodiment, the first texture vector A 1 (x) corresponding to the first principal component having the largest variance is a vector that is substantially correlated with a change in face color (also considered as a gender difference). The second texture vector A 2 (x) corresponding to the second principal component having a large variance is a vector that is substantially correlated with a change in the shadow component (also considered as a change in the light source position).

上記式(2)に示すように、本実施例におけるテクスチャーモデルでは、顔の見えを表す顔のテクスチャーA(x)が、平均顔画像A0(x)とm個のテクスチャーベクトルAi(x)の線形結合との和としてモデル化される。テクスチャーモデルにおいてテクスチャーパラメーターλiを適切に設定することにより、あらゆる画像における顔のテクスチャーA(x)を再現することが可能である。なお、テクスチャーモデル設定ステップ(図2のステップS140)において設定された平均顔画像A0(x)およびテクスチャーベクトルAi(x)は、AAM情報AMI(図1)として内部メモリー120に格納される。平均顔画像A0(x)は、本発明における基準テクスチャーに相当し、テクスチャーベクトルAi(x)とテクスチャーパラメーターλiとの積は、本発明におけるテクスチャー特徴量に相当する。 As shown in the above equation (2), in the texture model in the present embodiment, the facial texture A (x) representing the appearance of the face is the average face image A 0 (x) and m texture vectors A i (x ) And the linear combination. By appropriately setting the texture parameter λ i in the texture model, it is possible to reproduce the facial texture A (x) in any image. Note that the average face image A 0 (x) and the texture vector A i (x) set in the texture model setting step (step S140 in FIG. 2) are stored in the internal memory 120 as AAM information AMI (FIG. 1). . The average face image A 0 (x) corresponds to the reference texture in the present invention, and the product of the texture vector A i (x) and the texture parameter λ i corresponds to the texture feature amount in the present invention.

以上説明したAAM設定処理(図2)により、顔の形状をモデル化する形状モデルと、顔のテクスチャーをモデル化するテクスチャーモデルが設定される。設定された形状モデルとテクスチャーモデルとを組み合わせることにより、すなわち合成されたテクスチャーA(x)に対して平均形状s0から形状sへの変換(図7に示したワープWの逆変換)を行うことにより、あらゆる顔画像の形状およびテクスチャーを再現することが可能である。 By the AAM setting process described above (FIG. 2), a shape model for modeling the face shape and a texture model for modeling the face texture are set. By combining the set shape model and the texture model, that is, the synthesized texture A (x) is converted from the average shape s 0 to the shape s (inverse conversion of the warp W shown in FIG. 7). Thus, it is possible to reproduce the shape and texture of any face image.

A−3.顔特徴位置特定処理:
図9は、本実施例における顔特徴位置特定処理の流れを示すフローチャートである。本実施例における顔特徴位置特定処理は、AAMを利用して対象画像における特徴点CPの配置を決定することにより、対象画像における顔の特徴部位の位置を特定する処理である。上述したように、本実施例では、AAM設定処理(図2)において、人物の顔の器官(眉毛、目、鼻、口)および顔の輪郭における計68箇所の所定位置が、特徴部位として設定されている(図4参照)。そのため、本実施例の顔特徴位置特定処理では、人物の顔の器官および顔の輪郭における所定位置を示す68個の特徴点CPの配置が決定される。
A-3. Facial feature location processing:
FIG. 9 is a flowchart showing the flow of the face feature position specifying process in the present embodiment. The face feature position specifying process in the present embodiment is a process for specifying the position of the feature part of the face in the target image by determining the arrangement of the feature points CP in the target image using AAM. As described above, in the present embodiment, in the AAM setting process (FIG. 2), a total of 68 predetermined positions in the human facial organs (eyebrows, eyes, nose, mouth) and facial contour are set as the characteristic parts. (See FIG. 4). Therefore, in the face feature position specifying process according to the present embodiment, the arrangement of 68 feature points CP indicating predetermined positions in the human face organ and face contour is determined.

なお、顔特徴位置特定処理によって対象画像における特徴点CPの配置が決定されると、対象画像における人物の顔の器官の形状・位置や顔の輪郭形状の特定が可能となる。従って、顔特徴位置特定処理の処理結果は、特定の表情(例えば笑顔や目を閉じた顔)の顔画像を検出するための表情判定や、特定の向き(例えば右向きや下向き)の顔画像を検出するための顔向き推定、顔の形状を変形する顔変形等に利用可能である。   When the arrangement of the feature points CP in the target image is determined by the face feature position specifying process, it is possible to specify the shape / position of the human face organ and the face contour shape in the target image. Therefore, the processing result of the facial feature position specifying process is a facial expression determination for detecting a facial image of a specific facial expression (for example, a face with a smile or eyes closed) or a facial image in a specific direction (for example, rightward or downward). It can be used for face orientation estimation for detection, face deformation for deforming the face shape, and the like.

ステップS210(図9)では、画像処理部200(図1)が、顔特徴位置特定処理の対象となる対象画像を表す画像データを取得する。本実施例のプリンター100では、カードスロット172にメモリーカードMCが挿入されると、メモリーカードMCに格納された画像ファイルのサムネイル画像が表示部150に表示される。ユーザーは、表示されたサムネイル画像を参照しつつ、操作部140を介して処理の対象となる1つまたは複数の画像を選択する。画像処理部200は、選択された1つまたは複数の画像に対応する画像データを含む画像ファイルをメモリーカードMCより取得して内部メモリー120の所定の領域に格納する。なお、取得された画像データを対象画像データと呼び、対象画像データの表す画像を対象画像OIと呼ぶものとする。   In step S210 (FIG. 9), the image processing unit 200 (FIG. 1) acquires image data representing a target image that is a target of the face feature position specifying process. In the printer 100 of the present embodiment, when the memory card MC is inserted into the card slot 172, thumbnail images of image files stored in the memory card MC are displayed on the display unit 150. The user selects one or a plurality of images to be processed via the operation unit 140 while referring to the displayed thumbnail images. The image processing unit 200 acquires an image file including image data corresponding to one or more selected images from the memory card MC and stores it in a predetermined area of the internal memory 120. Note that the acquired image data is referred to as target image data, and an image represented by the target image data is referred to as a target image OI.

ステップS220(図9)では、顔領域検出部230(図1)が、対象画像OIにおける顔の画像の少なくとも一部を含む画像領域を顔領域FAとして検出する。顔領域FAの検出は、公知の顔検出手法を用いて行うことができる。公知の顔検出手法としては、例えば、パターンマッチングによる手法や肌色領域抽出による手法、サンプル顔画像を用いた学習(例えばニューラルネットワークを用いた学習や、ブースティングを用いた学習、サポートベクターマシーンを用いた学習等)により設定される学習データを用いる手法等がある。   In step S220 (FIG. 9), the face area detection unit 230 (FIG. 1) detects an image area including at least a part of the face image in the target image OI as the face area FA. The detection of the face area FA can be performed using a known face detection method. Known face detection methods include, for example, pattern matching methods, skin color region extraction methods, learning using sample face images (for example, learning using neural networks, learning using boosting, and support vector machines). There is a method using learning data set by learning.

図10は、対象画像OIにおける顔領域FAの検出結果の一例を示す説明図である。図10には、対象画像OIにおいて検出された顔領域FAが示されている。本実施例では、おおよそ、顔の上下方向は額から顎まで、左右方向は両耳の外側まで含む矩形の領域が顔領域FAとして検出されるような顔検出手法が用いられている。   FIG. 10 is an explanatory diagram illustrating an example of the detection result of the face area FA in the target image OI. FIG. 10 shows the face area FA detected in the target image OI. In the present embodiment, a face detection method is used in which a rectangular area including the vertical direction of the face from the forehead to the chin and the horizontal direction from the outside of both ears is detected as the face area FA.

なお、図10に示した想定基準領域ABAは、平均顔画像A0(x)の全体領域である基準領域BA(図8参照)に対応すると想定される領域である。想定基準領域ABAは、検出された顔領域FAに基づき、大きさ・傾き・上下および左右方向の位置のそれぞれについて顔領域FAと所定の関係を有する領域に設定される。顔領域FAと想定基準領域ABAとの所定の関係は、顔領域FAに表された顔が平均的な顔である場合には想定基準領域ABAが基準領域BAに対応することとなるように、顔領域FAの検出に採用する顔検出手法の特性(どのような顔の範囲を顔領域FAとして検出するか)を考慮して予め設定される。 The assumed reference area ABA shown in FIG. 10 is an area assumed to correspond to the reference area BA (see FIG. 8), which is the entire area of the average face image A 0 (x). The assumed reference area ABA is set based on the detected face area FA as an area having a predetermined relationship with the face area FA with respect to each of size, inclination, vertical and horizontal positions. The predetermined relationship between the face area FA and the assumed reference area ABA is such that when the face represented in the face area FA is an average face, the assumed reference area ABA corresponds to the reference area BA. It is set in advance in consideration of the characteristics of the face detection method employed for detection of the face area FA (what face range is detected as the face area FA).

なお、ステップS220(図9)において対象画像OIから顔領域FAが検出されなかった場合には、対象画像OIに顔の画像が含まれていないとして顔特徴位置特定処理が終了されるか、あるいは顔領域FAの検出処理が再度実行される。   If the face area FA is not detected from the target image OI in step S220 (FIG. 9), the face feature position specifying process is terminated because the target image OI does not include a face image, or The face area FA detection process is executed again.

ステップS230(図9)では、顔特徴位置特定部210(図1)が、対象画像OIにおける特徴点CPの初期配置を決定する。図11は、本実施例における特徴点CPの初期配置決定処理の流れを示すフローチャートである。特徴点CP初期配置決定処理のステップS310では、初期配置部211(図1)が、グローバルパラメーターとしての大きさ、傾き、位置(上下方向の位置および左右方向の位置)の値を種々変更して、対象画像OI上に特徴点CPの仮配置を設定する。   In step S230 (FIG. 9), the face feature position specifying unit 210 (FIG. 1) determines the initial arrangement of the feature points CP in the target image OI. FIG. 11 is a flowchart showing the flow of the initial arrangement determining process of the feature point CP in the present embodiment. In step S310 of the feature point CP initial arrangement determination process, the initial arrangement unit 211 (FIG. 1) changes various values of size, inclination, and position (vertical position and horizontal position) as global parameters. Then, a temporary arrangement of the feature points CP is set on the target image OI.

図12は、対象画像OIにおける特徴点CPの仮配置の一例を示す説明図である。図12(a)および図12(b)には、対象画像OIにおける特徴点CPの仮配置をメッシュによって示している。すなわち、メッシュの各交点が特徴点CPである。初期配置部211は、図12(a)および図12(b)の中央に示すように、対象画像OIの想定基準領域ABA(図10参照)に平均顔画像A0(x)(図8参照)を重ねた場合における平均顔画像A0(x)の特徴点CPにより特定される仮配置(以下、「基準仮配置」とも呼ぶ)を設定する。 FIG. 12 is an explanatory diagram showing an example of the temporary arrangement of the feature points CP in the target image OI. 12A and 12B, the temporary arrangement of the feature points CP in the target image OI is shown by a mesh. That is, each intersection of the mesh is a feature point CP. As shown in the center of FIGS. 12A and 12B, the initial placement unit 211 has an average face image A 0 (x) (see FIG. 8) in the assumed reference area ABA (see FIG. 10) of the target image OI. ) Are set, a temporary arrangement specified by the feature point CP of the average face image A 0 (x) (hereinafter also referred to as “reference temporary arrangement”) is set.

初期配置部211は、また、基準仮配置に対して、グローバルパラメーターの値を種々変更した仮配置を設定する。グローバルパラメーター(大きさ、傾き、上下方向の位置および左右方向の位置)を変更することは、特徴点CPの仮配置を特定するメッシュに対して拡大・縮小、傾きの変更、並行移動を行うことに相当する。従って、初期配置部211は、図12(a)に示すように、基準仮配置のメッシュに対して所定倍率で拡大または縮小したメッシュにより特定される仮配置(基準仮配置の下および上に示す)や、所定角度だけ時計回りまたは半時計回りに傾きを変更したメッシュにより特定される仮配置(基準仮配置の右および左に示す)を設定する。また、初期配置部211は、基準仮配置のメッシュに対して拡大・縮小および傾きの変更を組み合わせた変換を行ったメッシュにより特定される仮配置(基準仮配置の左上、左下、右上、右下に示す)も設定する。   The initial arrangement unit 211 also sets temporary arrangements in which global parameter values are variously changed with respect to the reference temporary arrangement. Changing global parameters (size, inclination, vertical position and horizontal position) is to enlarge / reduce, change inclination, or move parallel to the mesh that specifies the temporary arrangement of feature points CP. It corresponds to. Accordingly, as shown in FIG. 12A, the initial placement unit 211 indicates a temporary placement (shown below and above the reference temporary placement) specified by a mesh enlarged or reduced at a predetermined magnification with respect to the mesh of the reference temporary placement. ) Or a temporary arrangement (shown on the right and left of the reference temporary arrangement) specified by a mesh whose inclination is changed clockwise or counterclockwise by a predetermined angle. In addition, the initial placement unit 211 specifies a temporary placement (upper left, lower left, upper right, lower right of the reference temporary placement) that is obtained by performing a transformation that combines enlargement / reduction and inclination change on the mesh of the reference temporary placement. Also set).

また、図12(b)に示すように、初期配置部211は、基準仮配置のメッシュを所定量だけ上または下に並行移動したメッシュにより特定される仮配置(基準仮配置の上および下に示す)や、左または右に並行移動したメッシュにより特定される仮配置(基準仮配置の左および右に示す)を設定する。また、初期配置部211は、基準仮配置のメッシュに対して、上下および左右の並行移動を組み合わせた変換を行ったメッシュにより特定される仮配置(基準仮配置の左上、左下、右上、右下に示す)も設定する。   Also, as shown in FIG. 12 (b), the initial placement unit 211 sets the temporary placement (above and below the reference temporary placement) specified by a mesh that has been moved upward or downward by a predetermined amount from the reference temporary placement mesh. Or a temporary arrangement (shown on the left and right of the reference temporary arrangement) specified by the mesh moved in parallel to the left or right. In addition, the initial placement unit 211 performs provisional placement (upper left, lower left, upper right, lower right of the reference temporary placement) that is specified by a mesh obtained by performing a combination of vertical and horizontal parallel movements on the mesh of the reference temporary placement. Also set).

さらに、初期配置部211は、図12(a)に示す基準仮配置以外の8つの仮配置のそれぞれにおけるメッシュに対して図12(b)に示す上下左右の並行移動が実行されたメッシュにより特定される仮配置も設定する。従って、本実施例では、基準仮配置と、基準仮配置におけるメッシュに対して4つのグローバルパラメーター(大きさ、傾き、上下方向の位置、左右方向の位置)のそれぞれについての3段階の値の組み合わせに対応する合計80種類(=3×3×3×3―1)の変換を行うことにより設定される80種類の仮配置と、の合計81種類の仮配置が設定される。   Further, the initial placement unit 211 is identified by a mesh in which the vertical movement shown in FIG. 12B is performed on each of the eight temporary placements other than the reference temporary placement shown in FIG. The temporary arrangement to be performed is also set. Therefore, in this embodiment, the combination of the three levels of the reference temporary arrangement and each of the four global parameters (size, inclination, vertical position, horizontal position) with respect to the mesh in the reference temporary arrangement. A total of 81 types of temporary arrangements are set, including 80 types of temporary arrangements set by performing a total of 80 types (= 3 × 3 × 3 × 3-1) of conversions corresponding to.

なお、本実施例において、基準仮配置における平均顔画像A0(x)と対象画像OIの想定基準領域ABAとの対応関係を「基準対応関係」と呼ぶものとする。仮配置の設定は、基準対応関係を基準として平均顔画像A0(x)と対象画像OIとの一方に対する上述の合計80種類の変換が行われた後の平均顔画像A0(x)と対象画像OIとの対応関係(以下、「変換対応関係」とも呼ぶ)が設定され、基準対応関係および変換対応関係における平均顔画像A0(x)の特徴点CPの配置を対象画像OIにおける特徴点CPの仮配置とすることにより実現されると表現できる。 In this embodiment, the correspondence between the average face image A 0 (x) in the reference temporary arrangement and the assumed reference area ABA of the target image OI is referred to as “reference correspondence”. Setting temporary arrangement includes a mean reference relationship as reference face image A 0 (x) average face image A 0 after a total of 80 kinds of the above conversion for one of the target image OI is performed and (x) A correspondence relationship with the target image OI (hereinafter also referred to as “conversion correspondence relationship”) is set, and the arrangement of the feature points CP of the average face image A 0 (x) in the reference correspondence relationship and the conversion correspondence relationship is a feature in the target image OI. It can be expressed as realized by provisional arrangement of points CP.

ステップS320(図11)では、画像変換部212(図1)が、設定された各仮配置に対応する平均形状画像I(W(x;p))を算出する。図13は、平均形状画像I(W(x;p))の一例を示す説明図である。平均形状画像I(W(x;p))は、平均形状s0を有する顔画像である。平均形状画像I(W(x;p))は、入力画像における特徴点CPの配置が平均形状s0における特徴点CPの配置と等しくなるような変換によって算出される。 In step S320 (FIG. 11), the image conversion unit 212 (FIG. 1) calculates an average shape image I (W (x; p)) corresponding to each set temporary arrangement. FIG. 13 is an explanatory diagram showing an example of the average shape image I (W (x; p)). The average shape image I (W (x; p)) is a face image having the average shape s 0 . The average shape image I (W (x; p)) is calculated by conversion such that the arrangement of the feature points CP in the input image is equal to the arrangement of the feature points CP in the average shape s 0 .

平均形状画像I(W(x;p))を算出するための変換は、サンプル顔画像SIw算出のための変換(図7参照)と同様に、三角形領域TA毎のアフィン変換の集合であるワープWにより行われる。具体的には、対象画像OIに配置された特徴点CP(図12参照)によって対象画像OIにおける平均形状領域BSA(外周に位置する特徴点CPにより囲まれた領域、図6参照)が特定され、平均形状領域BSAに対して三角形領域TA毎のアフィン変換が行われることにより、平均形状画像I(W(x;p))が算出される。本実施例では、平均形状画像I(W(x;p))は、平均顔画像A0(x)と同様に平均形状領域BSAおよびマスク領域MAにより構成され、平均顔画像A0(x)と同サイズの画像として算出される。図13には、図12(a)に示した9個の仮配置に対応する9個の平均形状画像I(W(x;p))の例を示している。 The transformation for calculating the average shape image I (W (x; p)) is a warp that is a set of affine transformations for each triangular area TA, similarly to the transformation for calculating the sample face image SIw (see FIG. 7). W. Specifically, the average shape region BSA (region surrounded by the feature points CP located on the outer periphery, see FIG. 6) in the target image OI is specified by the feature points CP (see FIG. 12) arranged in the target image OI. The average shape image I (W (x; p)) is calculated by performing affine transformation for each triangular area TA on the average shape area BSA. In this embodiment, the average shape image I (W (x; p) ) is composed of an average face image A 0 (x) and an average shape area BSA and a mask area MA, average face image A 0 (x) And is calculated as an image of the same size. FIG. 13 shows an example of nine average shape images I (W (x; p)) corresponding to the nine temporary arrangements shown in FIG.

なお、上述したように、画素群xは、平均形状s0における平均形状領域BSAに位置する画素の集合である。ワープW実行後の画像(平均形状s0を有する顔画像)における画素群xに対応するワープW実行前の画像(対象画像OIの平均形状領域BSA)における画素群をW(x;p)と表す。平均形状画像は、対象画像OIの平均形状領域BSAにおける画素群W(x;p)のそれぞれにおける輝度値により構成される画像であるため、I(W(x;p))と表される。 As described above, the pixel group x is a set of pixels located in the average shape region BSA in the average shape s 0 . The pixel group in the image (average shape area BSA of the target image OI) before execution of the warp W corresponding to the pixel group x in the image after execution of the warp W (face image having the average shape s 0 ) is expressed as W (x; p). To express. Since the average shape image is an image composed of luminance values in each of the pixel groups W (x; p) in the average shape region BSA of the target image OI, it is expressed as I (W (x; p)).

ステップS330(図11)では、初期配置部211(図1)が、各平均形状画像I(W(x;p))と平均顔画像A0(x)との差分画像Ieを算出する。特徴点CPの仮配置は81種類設定され、平均形状画像I(W(x;p))は81個設定されているため、初期配置部211は81個の差分画像Ieを算出することとなる。 In step S330 (FIG. 11), the initial arrangement unit 211 (FIG. 1) calculates a difference image Ie between each average shape image I (W (x; p)) and the average face image A 0 (x). Since 81 types of temporary arrangements of feature points CP are set and 81 average shape images I (W (x; p)) are set, the initial arrangement unit 211 calculates 81 difference images Ie. .

ステップS340(図11)では、初期配置部211(図1)が、各差分画像Ieのノルムを算出し、ノルムの値が最も小さい差分画像Ieに対応する仮配置(以下「ノルム最小仮配置」とも呼ぶ)を、対象画像OIにおける特徴点CPの初期配置として設定する。ノルム最小仮配置は、平均顔画像A0(x)との相違の程度が最も小さい(最も近い、最も似ている)平均形状画像I(W(x;p))に対応する仮配置である。なお、ノルム最小仮配置を選択することは、上述した基準対応関係および80種類の変換対応関係の中から、正規化処理後の平均形状画像I(W(x;p))と平均顔画像A0(x)との相違の程度が最も小さい対応関係を選択し、選択された対応関係における仮配置を選択することと同義である。特徴点CPの初期配置処理により、対象画像OIにおいて、特徴点CPの配置の全体的な大きさ、傾き、位置(上下方向の位置および左右方向の位置)を規定するグローバルパラメーターの概略値が設定されたこととなる。 In step S340 (FIG. 11), the initial placement unit 211 (FIG. 1) calculates the norm of each difference image Ie, and the provisional placement corresponding to the difference image Ie having the smallest norm value (hereinafter “norm minimum provisional placement”). Is also set as the initial arrangement of the feature points CP in the target image OI. The norm minimum provisional arrangement is a provisional arrangement corresponding to the average shape image I (W (x; p)) having the smallest degree of difference from the average face image A 0 (x) (closest, most similar). . Note that selecting the norm minimum provisional arrangement means that the average shape image I (W (x; p)) after normalization processing and the average face image A are selected from the above-described reference correspondence relationship and 80 types of conversion correspondence relationships. This is synonymous with selecting a correspondence relationship having the smallest difference from 0 (x) and selecting a provisional arrangement in the selected correspondence relationship. By the initial arrangement processing of the feature points CP, approximate values of global parameters that define the overall size, inclination, and position (vertical position and horizontal position) of the characteristic points CP are set in the target image OI. It will be done.

図14は、対象画像OIにおける特徴点CPの初期配置の一例を示す説明図である。図14では、対象画像OIにおいて決定された特徴点CPの初期配置をメッシュによって表現している。すなわち、メッシュの各交点が特徴点CPである。   FIG. 14 is an explanatory diagram showing an example of the initial arrangement of the feature points CP in the target image OI. In FIG. 14, the initial arrangement of the feature points CP determined in the target image OI is represented by a mesh. That is, each intersection of the mesh is a feature point CP.

特徴点CP初期配置決定処理(図9のステップS230)が完了すると、顔特徴位置特定部210(図1)は、対象画像OIにおける特徴点CPの配置更新を行う(ステップS240)。図15は、本実施例における特徴点CP配置更新処理の流れを示すフローチャートである。   When the feature point CP initial arrangement determination process (step S230 in FIG. 9) is completed, the face feature position specifying unit 210 (FIG. 1) updates the arrangement of the feature points CP in the target image OI (step S240). FIG. 15 is a flowchart showing the flow of the feature point CP arrangement update process in the present embodiment.

特徴点CP配置更新処理(図15)のステップS410では、画像変換部212(図1)が、対象画像OIから平均形状画像I(W(x;p))を算出する。平均形状画像I(W(x;p))は、平均形状s0を有する顔画像である。平均形状画像I(W(x;p))は、入力画像における特徴点CPの配置が平均形状s0における特徴点CPの配置(図6参照)と等しくなるような変換によって算出される。 In step S410 of the feature point CP arrangement update process (FIG. 15), the image conversion unit 212 (FIG. 1) calculates an average shape image I (W (x; p)) from the target image OI. The average shape image I (W (x; p)) is a face image having the average shape s 0 . The average shape image I (W (x; p)) is calculated by conversion such that the arrangement of the feature points CP in the input image is equal to the arrangement of the feature points CP in the average shape s 0 (see FIG. 6).

平均形状画像I(W(x;p))を算出するための変換は、サンプル顔画像SIw算出のための変換(図7参照)と同様に、三角形領域TA毎のアフィン変換の集合であるワープWにより行われる。具体的には、対象画像OIに配置された特徴点CP(図14参照)によって対象画像OIにおける平均形状領域BSA(外周に位置する特徴点CPにより囲まれた領域、図6参照)が特定され、平均形状領域BSAに対して三角形領域TA毎のアフィン変換が行われることにより、平均形状画像I(W(x;p))が算出される。本実施例では、平均形状画像I(W(x;p))は、平均顔画像A0(x)と同様に平均形状領域BSAおよびマスク領域MAにより構成され、平均顔画像A0(x)と同サイズの画像として算出される。 The transformation for calculating the average shape image I (W (x; p)) is a warp that is a set of affine transformations for each triangular area TA, similarly to the transformation for calculating the sample face image SIw (see FIG. 7). W. Specifically, the average shape region BSA (region surrounded by the feature points CP located on the outer periphery, see FIG. 6) in the target image OI is specified by the feature points CP (see FIG. 14) arranged in the target image OI. The average shape image I (W (x; p)) is calculated by performing affine transformation for each triangular area TA on the average shape area BSA. In this embodiment, the average shape image I (W (x; p) ) is composed of an average face image A 0 (x) and an average shape area BSA and a mask area MA, average face image A 0 (x) And is calculated as an image of the same size.

ステップS412(図15)では、正規化部215(図1)が、平均顔画像A0(x)の輝度値分布を表す指標値を参照して、平均形状画像I(W(x;p))を正規化する。本実施例では、平均顔画像A0(x)の平均形状領域BSA(図8参照)における輝度値分布を表す指標値としての平均値および分散値を示す情報が、AAM情報AMIに含まれている。正規化部215は、平均形状画像I(W(x;p))の平均形状領域BSAにおける輝度値の平均値および分散値を算出し、算出された平均値および分散値が平均顔画像A0(x)の輝度値の平均値および分散値に等しくなるように、平均形状画像I(W(x;p))の平均形状領域BSAに対する画像変換(正規化処理)を行う。 In step S412 (FIG. 15), the normalization unit 215 (FIG. 1) refers to the index value representing the luminance value distribution of the average face image A 0 (x), and calculates the average shape image I (W (x; p). ) Is normalized. In this embodiment, the AAM information AMI includes information indicating an average value and a variance value as index values representing the luminance value distribution in the average shape area BSA (see FIG. 8) of the average face image A 0 (x). Yes. The normalization unit 215 calculates the average value and the variance value of the luminance values in the average shape region BSA of the average shape image I (W (x; p)), and the calculated average value and variance value are the average face image A 0. Image conversion (normalization processing) is performed on the average shape area BSA of the average shape image I (W (x; p)) so as to be equal to the average value and the variance value of the luminance values of (x).

ステップS420(図15)では、顔特徴位置特定部210(図1)が、正規化処理後の平均形状画像I(W(x;p))と平均顔画像A0(x)との差分画像Ieを算出する。ステップS430では、判定部213(図1)が、差分画像Ieに基づき、特徴点CPの配置更新処理が収束したか否かを判定する。判定部213は、差分画像Ieのノルムを算出し、ノルムの値が予め設定された閾値より小さい場合には収束したと判定し、ノルムの値が閾値以上の場合には未だ収束していないと判定する。差分画像Ieのノルムは、平均形状画像I(W(x;p))と平均顔画像A0(x)との相違の程度を表す指標値である。 In step S420 (FIG. 15), the face feature position specifying unit 210 (FIG. 1) calculates a difference image between the average shape image I (W (x; p)) after normalization and the average face image A 0 (x). Ie is calculated. In step S430, the determination unit 213 (FIG. 1) determines whether or not the feature point CP arrangement update processing has converged based on the difference image Ie. The determination unit 213 calculates the norm of the difference image Ie, determines that it has converged when the norm value is smaller than a preset threshold value, and has not yet converged when the norm value is greater than or equal to the threshold value. judge. The norm of the difference image Ie is an index value that represents the degree of difference between the average shape image I (W (x; p)) and the average face image A 0 (x).

なお、ステップS430の収束判定において、判定部213は、算出された差分画像Ieのノルムの値が前回のステップS430において算出された値よりも小さい場合には収束したと判定し、前回値以上である場合には未だ収束していないと判定するものとしてもよい。あるいは、判定部213は、閾値による判定と前回値との比較による判定とを組み合わせて収束判定を行うものとしてもよい。例えば、判定部213は、算出されたノルムの値が、閾値より小さく、かつ、前回値より小さい場合にのみ収束したと判定し、それ以外の場合には未だ収束していないと判定するものとしてもよい。   In the convergence determination in step S430, the determination unit 213 determines that the convergence has occurred when the calculated norm value of the difference image Ie is smaller than the value calculated in the previous step S430, and is greater than or equal to the previous value. In some cases, it may be determined that it has not yet converged. Or the determination part 213 is good also as what performs determination of convergence combining the determination by a threshold value, and the determination by comparison with the last time value. For example, the determination unit 213 determines that the calculated norm value has converged only when the calculated norm value is smaller than the threshold and smaller than the previous value, and otherwise determines that it has not yet converged. Also good.

ステップS430の収束判定において未だ収束していないと判定された場合には、更新部214(図1)が、パラメーター更新量ΔPを算出する(ステップS440)。パラメーター更新量ΔPは、4個のグローバルパラメーター(全体としての大きさ、傾き、X方向位置、Y方向位置)およびn個の形状パラメーターpi(式(1)参照)の値の変更量を意味している。なお、特徴点CPの初期配置直後においては、グローバルパラメーターは、特徴点CP初期配置決定処理(図11)において決定された値が設定されている。また、このときの特徴点CPの初期配置と平均形状s0の特徴点CPの配置との相違は、全体としての大きさ、傾き、位置の相違に限られるため、形状モデルにおける形状パラメーターpiの値はすべてゼロである。 If it is determined in step S430 that the convergence has not yet been completed, the updating unit 214 (FIG. 1) calculates a parameter update amount ΔP (step S440). The parameter update amount ΔP means the amount of change in the values of the four global parameters (total size, inclination, X direction position, Y direction position) and n shape parameters p i (see equation (1)). is doing. Immediately after the initial arrangement of the feature point CP, the global parameter is set to the value determined in the feature point CP initial arrangement determination process (FIG. 11). In addition, since the difference between the initial arrangement of the feature points CP and the arrangement of the feature points CP of the average shape s 0 at this time is limited to the difference in overall size, inclination, and position, the shape parameter p i in the shape model. The values of are all zero.

パラメーター更新量ΔPは、下記の式(3)により算出される。すなわち、パラメーター更新量ΔPは、アップデートマトリックスRと差分画像Ieとの積である。   The parameter update amount ΔP is calculated by the following equation (3). That is, the parameter update amount ΔP is a product of the update matrix R and the difference image Ie.

Figure 2010245721
Figure 2010245721

式(3)におけるアップデートマトリックスRは、差分画像Ieに基づきパラメーター更新量ΔPを算出するために予め学習により設定されたM行N列のマトリックスであり、AAM情報AMI(図1)として内部メモリー120に格納されている。本実施例では、アップデートマトリックスRの行数Mは、グローバルパラメーターの数(4個)と形状パラメーターpiの数(n個)との和((4+n)個)に等しく、列数Nは、平均顔画像A0(x)(図8)の平均形状領域BSA内の画素数に等しい。アップデートマトリックスRは、下記の式(4)および(5)により算出される。 The update matrix R in the expression (3) is a matrix of M rows and N columns set in advance by learning in order to calculate the parameter update amount ΔP based on the difference image Ie, and the internal memory 120 as the AAM information AMI (FIG. 1). Stored in In this embodiment, the number M of rows of the update matrix R is equal to the sum ((4 + n)) of the number of global parameters (4) and the number of shape parameters p i (n), and the number of columns N is It is equal to the number of pixels in the average shape area BSA of the average face image A 0 (x) (FIG. 8). The update matrix R is calculated by the following formulas (4) and (5).

Figure 2010245721
Figure 2010245721
Figure 2010245721
Figure 2010245721

ステップS450(図15)では、更新部214(図1)が、算出されたパラメーター更新量ΔPに基づきパラメーター(4個のグローバルパラメーターおよびn個の形状パラメーターpi)を更新する。これにより、対象画像OIにおける特徴点CPの配置が更新される。ステップS450のパラメーター更新の後には、再度、特徴点CPの配置が更新された対象画像OIからの平均形状画像I(W(x;p))の算出(ステップS410)、差分画像Ieの算出(ステップS420)、差分画像Ieに基づく収束判定(ステップS430)が行われる。再度の収束判定においても収束していないと判定された場合には、さらに、差分画像Ieに基づくパラメーター更新量ΔPの算出(ステップS440)、パラメーター更新による特徴点CPの配置更新(ステップS450)が行われる。 In step S450 (FIG. 15), the updating unit 214 (FIG. 1) updates the parameters (four global parameters and n shape parameters p i ) based on the calculated parameter update amount ΔP. Thereby, the arrangement of the feature points CP in the target image OI is updated. After the parameter update in step S450, the average shape image I (W (x; p)) is calculated again from the target image OI whose arrangement of the feature points CP has been updated (step S410), and the difference image Ie is calculated ( In step S420), a convergence determination (step S430) based on the difference image Ie is performed. If it is determined that the convergence has not occurred in the convergence determination again, the parameter update amount ΔP based on the difference image Ie is calculated (step S440), and the feature point CP is updated by updating the parameters (step S450). Done.

図15のステップS410からS450までの処理が繰り返し実行されると、対象画像OIにおける各特徴部位に対応する特徴点CPの位置は実際の特徴部位の位置(正解位置)に全体として近づいていき、ある時点で収束判定(ステップS430)において収束したと判定される。収束判定において収束したと判定されると、顔特徴位置特定処理が完了する(ステップS460)。このとき設定されているグローバルパラメーターおよび形状パラメーターpiの値により特定される特徴点CPの配置が、最終的な対象画像OIにおける特徴点CPの配置として決定される。 When the processing from step S410 to step S450 in FIG. 15 is repeatedly executed, the position of the feature point CP corresponding to each feature part in the target image OI approaches the position of the actual feature part (correct position) as a whole, At a certain point in time, it is determined that convergence has occurred in the convergence determination (step S430). If it is determined in the convergence determination that convergence has been achieved, the face feature position specifying process is completed (step S460). The arrangement of the feature points CP specified by the global parameter and the shape parameter p i set at this time is determined as the arrangement of the feature points CP in the final target image OI.

図16は、顔特徴位置特定処理の結果の一例を示す説明図である。図16には、対象画像OIにおいて最終的に決定された特徴点CPの配置が示されている。特徴点CPの配置により、対象画像OIにおける特徴部位(人物の顔の器官(眉毛、目、鼻、口)および顔の輪郭における所定位置)の位置が特定され、対象画像OIにおける人物の顔の器官の形状・位置や顔の輪郭形状の特定が可能となる。   FIG. 16 is an explanatory diagram illustrating an example of a result of the face feature position specifying process. FIG. 16 shows the arrangement of the feature points CP finally determined in the target image OI. By the arrangement of the feature points CP, the positions of the characteristic portions (predetermined positions in the human face organs (eyebrows, eyes, nose, mouth) and face contour) in the target image OI are specified, and the face of the person in the target image OI is identified. It is possible to specify the shape / position of the organ and the contour shape of the face.

以上説明したように、本実施例の顔特徴位置特定処理(図9)では、対象画像OIにおける特徴点CPの初期配置が決定され、その後、対象画像OIから算出された平均形状画像I(W(x;p))と平均顔画像A0(x)との比較結果に基づき対象画像OIにおける特徴点CPの配置が更新される。すなわち、特徴点CPの初期配置決定処理(図11)において、特徴点CPの配置の全体的な大きさ、傾き、位置(上下方向の位置および左右方向の位置)を規定するグローバルパラメーターの概略値が決定され、その後の特徴点CP配置更新処理(図15)において、差分画像Ieに基づくパラメーター更新に伴い特徴点CPの配置が更新されて、対象画像OIにおける最終的な特徴点CPの配置が決定される。このように、本実施例では、まず初期配置決定処理において特徴点CPの配置全体の変動が大きい(分散が大きい)グローバルパラメーターの概略値を決定することにより、顔特徴位置特定処理の効率化・高速化および精度の向上(いわゆるローカルな最適解ではなくグローバルな最適解に基づく特徴点CPの配置の最終決定)を実現することができる。 As described above, in the facial feature position specifying process (FIG. 9) of the present embodiment, the initial arrangement of the feature points CP in the target image OI is determined, and then the average shape image I (W The arrangement of the feature points CP in the target image OI is updated based on the comparison result between (x; p)) and the average face image A 0 (x). That is, in the initial arrangement determination process of the feature point CP (FIG. 11), the global parameter approximate value that defines the overall size, inclination, and position (vertical position and horizontal position) of the characteristic point CP. In the subsequent feature point CP arrangement update process (FIG. 15), the arrangement of the feature points CP is updated in accordance with the parameter update based on the difference image Ie, and the final arrangement of the feature points CP in the target image OI is determined. It is determined. As described above, in this embodiment, first, by determining the approximate value of the global parameter in which the variation of the entire arrangement of the feature points CP is large (the variance is large) in the initial arrangement determination process, Speeding up and accuracy improvement (final determination of feature point CP arrangement based on a global optimal solution rather than a so-called local optimal solution) can be realized.

また、本実施例の特徴点CP配置更新処理(図15)では、対象画像OIから算出された平均形状画像I(W(x;p))と平均顔画像A0(x)との差分画像Ieの算出(図15のステップS420)の前に、平均形状画像I(W(x;p))の平均形状領域BSAと平均顔画像A0(x)の平均形状領域BSAとの間で輝度値の平均値および分散値が互いに等しくなるように、平均形状画像I(W(x;p))に対する画像変換(正規化処理)が行われる(ステップS412)。これにより、個々の対象画像OIの輝度値分布の特徴が差分画像Ieに与える影響が抑制され、差分画像Ieに基づく収束判定(ステップS430)の精度が向上し、ひいては顔特徴位置特定処理の精度が向上する。また、収束判定において、上述したように、絶対閾値を用いた判定によっても高精度な判定が可能となる。従って、例えば差分画像Ieのノルムの値について前回値と比較することにより収束判定を行う場合と比較して、処理の高速化を図ることができる。 Further, in the feature point CP arrangement update process (FIG. 15) of the present embodiment, a difference image between the average shape image I (W (x; p)) calculated from the target image OI and the average face image A 0 (x). Prior to the calculation of Ie (step S420 in FIG. 15), the luminance between the average shape area BSA of the average shape image I (W (x; p)) and the average shape area BSA of the average face image A 0 (x) Image conversion (normalization processing) is performed on the average shape image I (W (x; p)) so that the average value and the variance value of the values are equal to each other (step S412). As a result, the influence of the feature of the luminance value distribution of each target image OI on the difference image Ie is suppressed, the accuracy of convergence determination (step S430) based on the difference image Ie is improved, and consequently the accuracy of the face feature position specifying process Will improve. In the convergence determination, as described above, highly accurate determination can be performed by determination using an absolute threshold. Therefore, for example, the processing speed can be increased compared to the case where the convergence determination is made by comparing the norm value of the difference image Ie with the previous value.

A−4.特定画像処理:
図17は、本実施例における特定画像処理の流れを示すフローチャートである。本実施例における特定画像処理は、上述した顔特徴位置特定処理(図9)によって特徴点CPの配置が特定された対象画像OIに対して、ユーザーにより選択された種類の特定画像処理を行う処理である。
A-4. Specific image processing:
FIG. 17 is a flowchart showing the flow of specific image processing in the present embodiment. The specific image processing in the present embodiment is a process of performing the specific image processing of the type selected by the user on the target image OI in which the arrangement of the feature points CP is specified by the face feature position specifying process (FIG. 9) described above. It is.

ステップS610(図17)では、特定画像処理部240(図1)が、対象画像OIに対して実行すべき特定画像処理の種類を設定する。ステップS620では、特定画像処理部240が、基準顔向き情報SDIを参照して、設定された特定画像処理の種類に応じた目標顔向きを設定する。   In step S610 (FIG. 17), the specific image processing unit 240 (FIG. 1) sets the type of specific image processing to be performed on the target image OI. In step S620, the specific image processing unit 240 refers to the reference face direction information SDI and sets a target face direction corresponding to the set type of specific image processing.

図18は、基準顔向き情報SDIの内容の一例を示す説明図である。本実施例では、プリンター100の特定画像処理部240が実行可能な特定画像処理の種類が複数設定されている。具体的には、特定画像処理部240は、目拡大処理と、目バランス調整処理と、表情変更処理と、化粧シミュレーション処理と、整形シミュレーション処理と、を実行可能である。本実施例における目拡大処理は、対象画像OIにおける目の画像部分(目領域)を拡大する処理であり、具体的には、左右の目のそれぞれについて、目の輪郭を示す6つの特徴点CP(図4参照)を移動して、6つの特徴点CPにより区画される領域(目領域)が拡大するような画像変形を行う処理である。目拡大処理については、後に詳述する。目バランス調整処理は、対象画像OIにおける左右の目の画像部分(目領域)の大きさを互いに近づけるように調整(拡大または縮小)する処理であり、目拡大処理と同様に、目の輪郭を示す6つの特徴点CPを移動して目領域が拡大または縮小するような画像変形を行う処理である。表情変更処理は、対象画像OIにおける顔の表情を所定の表情(例えば笑顔)に変更する処理であり、例えば、口の輪郭を示す特徴点CPを移動して口角が上に上がるような画像変形を行う処理である。化粧シミュレーション処理は、対象画像OIにおける顔に所定の化粧(例えば口紅を塗ったり、頬紅をつけたりする化粧)を施した結果の予測画像を生成する処理であり、具体的には、化粧を施す部分に対応する画素の値を化粧の態様に応じた値に変更する処理である。整形シミュレーション処理は、対象画像OIにおける顔に所定の整形(例えば鼻筋を通したり、あごを細くしたりする整形)を施した結果の予測画像を生成する処理であり、例えば、鼻の輪郭を示す特徴点CPを移動して鼻筋が通るように画像変形を行ったり、あごのラインを示す特徴点CPを移動してあごが細くなるように(いわゆる小顔になるように)画像変形を行ったりする処理である。   FIG. 18 is an explanatory diagram showing an example of the content of the reference face orientation information SDI. In this embodiment, a plurality of specific image processing types that can be executed by the specific image processing unit 240 of the printer 100 are set. Specifically, the specific image processing unit 240 can execute an eye enlargement process, an eye balance adjustment process, a facial expression change process, a makeup simulation process, and a shaping simulation process. The eye enlargement process in the present embodiment is a process for enlarging the image portion (eye area) of the eye in the target image OI. Specifically, for each of the left and right eyes, six feature points CP indicating the eye contours This is a process of moving the image (see FIG. 4) and performing image deformation such that the area (eye area) defined by the six feature points CP is enlarged. The eye enlargement process will be described in detail later. The eye balance adjustment process is a process for adjusting (enlarging or reducing) the size of the left and right eye image portions (eye regions) in the target image OI so that the contours of the eyes are similar to the eye enlargement process. This is a process of performing image transformation such that the eye area is enlarged or reduced by moving the six feature points CP shown. The facial expression changing process is a process of changing the facial expression in the target image OI to a predetermined facial expression (for example, a smile). For example, the image transformation that moves the feature point CP indicating the outline of the mouth and raises the mouth corner is performed. It is a process to perform. The makeup simulation process is a process of generating a predicted image as a result of applying a predetermined makeup (for example, makeup that applies lipstick or blush) to the face in the target image OI. Is a process of changing the value of the pixel corresponding to 1 to a value according to the makeup mode. The shaping simulation process is a process of generating a predicted image as a result of performing a predetermined shaping (for example, shaping the nose muscles or making the chin narrower) on the face in the target image OI. Move the feature point CP to deform the image so that the nose passes, or move the feature point CP indicating the chin line to deform the image so that the chin becomes thin (so-called small face) It is processing to do.

本実施例では、複数の特定画像処理の種類のそれぞれについて、基準顔向きが設定されている。基準顔向きは、特定画像処理の種類のそれぞれについて効果的な画像処理を実現するために設定された基準となる顔向きである。例えば、図18に示すように、目拡大処理については、自然な画像処理結果が得られる目領域の拡大率や拡大の方向は顔の左右方向の傾きや上下方向の傾きに応じて異なると考えられる。そのため、本実施例では、目拡大処理の基準顔向きとして、左右方向の傾きや上下方向の傾きの無い「正面向き」が設定されている。同様に、目バランス調整処理や表情変更処理、口紅を塗る化粧シミュレーション処理についても、基準顔向きは「正面向き」と設定されている。   In the present embodiment, a reference face orientation is set for each of a plurality of specific image processing types. The reference face orientation is a reference face orientation set to realize effective image processing for each type of specific image processing. For example, as shown in FIG. 18, in the eye enlargement process, it is considered that the enlargement rate and the enlargement direction of the eye area from which a natural image processing result is obtained differ depending on the inclination of the face in the horizontal direction and the vertical direction. It is done. For this reason, in this embodiment, the “front direction” having no horizontal tilt or vertical tilt is set as the reference face direction for the eye enlargement process. Similarly, in the eye balance adjustment process, the expression change process, and the makeup simulation process for applying lipstick, the reference face direction is set to “front direction”.

また、図18に示すように、頬紅をつける化粧シミュレーション処理や顎を細くする整形シミュレーション処理については、化粧や整形をシミュレートする方法や程度を設定するのに適した顔向きと考えられる「左45度向き」または「右45度向き」の顔向きが、基準顔向きとして設定されている。また、鼻筋を通す整形シミュレーション処理については、整形をシミュレートする方法や程度を設定するのに適した顔向きと考えられる「左75度向き」または「右75度向き」の顔向きが、基準顔向きとして設定されている。   Further, as shown in FIG. 18, the makeup simulation process for applying blusher and the shaping simulation process for narrowing the chin are considered to be face orientations suitable for setting the method and degree of simulating makeup and shaping. The face orientation of “45 ° orientation” or “45 ° right” is set as the reference face orientation. In addition, for the shaping simulation process through the nose, the face orientation “75 degrees left” or “75 degrees right”, which is considered to be a suitable face orientation for setting the method and degree of shaping, It is set as the face orientation.

特定画像処理部240は、実行可能な特定画像処理の種類を示すメニュー画面を、表示処理部310により表示部150(図1)に表示させ、操作部140を介してユーザーにより選択された特定画像処理の種類を、対象画像OIに対して実行すべき特定画像処理の種類として設定する(図17のステップS610)。また、特定画像処理部240は、基準顔向き情報SDIにおいて、設定された特定画像処理種類に対応付けられた基準顔向きを、目標顔向きとして設定する(ステップS620)。以下では、主に、目拡大処理が実行すべき特定画像処理の種類として設定され、目拡大処理に対応付けられた基準顔向きである「正面向き」が目標顔向きとして設定された場合について説明を行う。   The specific image processing unit 240 causes the display processing unit 310 to display a menu screen indicating the type of executable specific image processing on the display unit 150 (FIG. 1), and the specific image selected by the user via the operation unit 140. The type of processing is set as the type of specific image processing to be performed on the target image OI (step S610 in FIG. 17). Further, the specific image processing unit 240 sets the reference face direction associated with the set specific image processing type as the target face direction in the reference face direction information SDI (step S620). In the following, a case will be mainly described where the specific image processing type to be executed by the eye enlargement process is set, and the “front direction” that is the reference face direction associated with the eye enlargement process is set as the target face direction. I do.

ステップS630(図17)では、特定画像処理部240(図1)が、対象画像OIにおける顔向きと目標顔向きとの近似判定を行う。近似判定は、後述の顔向き変更および顔向き復元処理(ステップS640およびS660)の実行要否を判断するために行われる。すなわち、本実施例では、顔向き変更・復元処理は、対象画像OIにおける顔向きが目標顔向きにある程度近いと判定された場合には実行されず、対象画像OIにおける顔向きが目標顔向きからある程度離れている(近くない)と判定された場合にのみ実行される。   In step S630 (FIG. 17), the specific image processing unit 240 (FIG. 1) performs an approximate determination between the face orientation and the target face orientation in the target image OI. The approximation determination is performed in order to determine whether or not to execute a face orientation change and face orientation restoration process (steps S640 and S660) described later. That is, in the present embodiment, the face orientation changing / restoring process is not executed when it is determined that the face orientation in the target image OI is close to the target face orientation to some extent, and the face orientation in the target image OI is determined from the target face orientation. It is executed only when it is determined that it is some distance away (not close).

具体的には、特定画像処理部240は、上述した顔特徴位置特定処理(図9)において特定された対象画像OIの形状s(上記式(1)参照)における形状パラメーターpiの内、顔の左右振りにほぼ相関する第1形状ベクトルs1の形状パラメーターpiの値と、顔の上下振りにほぼ相関する第2形状ベクトルs2の形状パラメーターp2の値と、に基づき、対象画像OIにおける顔向きを推定する。本実施例では、第1形状ベクトルs1の形状パラメーターpiの値と顔の左右振りの角度との対応関係と、第2形状ベクトルs2の形状パラメーターp2の値と顔の上下振りの角度との対応関係と、が予め設定されている。AAM設定処理(図2)において設定された平均顔画像A0(x)(図8)は正面向きの顔画像であるため、形状パラメーターpiおよび形状パラメーターp2の値がゼロである場合には、対象画像OIの顔向きは左右振りおよび上下振りの無い「正面向き」であると推定される。また、形状パラメーターpiの絶対値が大きいほど対象画像OIの顔の左右振りの角度が大きいと推定され、形状パラメーターp2の絶対値が大きいほど対象画像OIの顔の上下振りの角度が大きいと推定される。なお、このとき、特定画像処理部240は、本発明における顔向き推定部として機能する。 Specifically, the specific image processing unit 240 determines the face among the shape parameters p i in the shape s (see the above formula (1)) of the target image OI specified in the face feature position specifying process (FIG. 9) described above. The target image is based on the value of the shape parameter p i of the first shape vector s 1 that is substantially correlated with the horizontal swing of the face and the value of the shape parameter p 2 of the second shape vector s 2 that is substantially correlated with the vertical swing of the face. Estimate the face orientation in OI. In the present embodiment, the correspondence between the value of the shape parameter p i of the first shape vector s 1 and the angle of the left / right swing of the face, the value of the shape parameter p 2 of the second shape vector s 2 and the up / down swing of the face The correspondence with the angle is set in advance. Since the average face image A 0 (x) (FIG. 8) set in the AAM setting process (FIG. 2) is a front-facing face image, the values of the shape parameter p i and the shape parameter p 2 are zero. It is estimated that the face orientation of the target image OI is “front-facing” with no left-right swing and no up-down swing. Also, it is estimated that the larger the absolute value of the shape parameter p i is, the larger the angle of swinging the face of the target image OI is, and the larger the absolute value of the shape parameter p 2 is, the larger the angle of swinging the face of the target image OI is. It is estimated to be. At this time, the specific image processing unit 240 functions as a face orientation estimating unit in the present invention.

次に、特定画像処理部240は、左右上下のすべての方向について、目標顔向きに対する対象画像OIの顔向きの振りが5度以内の場合には、対象画像OIの顔向きは目標顔向きに近いと判定する。一方、特定画像処理部240は、左右上下の少なくとも1つの方向について、目標顔向きに対する対象画像OIの顔向きの振りが5度を超える場合には、対象画像OIの顔向きは目標顔向きから離れている(近くない)と判定する。   Next, the specific image processing unit 240 determines that the face orientation of the target image OI is the target face orientation when the swing of the face orientation of the target image OI with respect to the target face orientation is within 5 degrees in all the left, right, top, and bottom directions. Judge as close. On the other hand, the specific image processing unit 240 determines that the face orientation of the target image OI is determined from the target face orientation when the swing of the face orientation of the target image OI with respect to the target face orientation exceeds 5 degrees in at least one of the left, right, up and down directions. It is determined that they are separated (not near).

対象画像OIの顔向きが目標顔向きから離れていると判定された場合には(ステップS630:No)、顔向き変更部250(図1)が、対象画像OIにおける顔向きを目標顔向きに近づけるように顔向き変更処理を行う(ステップS640)。具体的には、顔向き変更部250は、対象画像OIの形状s(上記式(1)参照)における第1形状ベクトルs1の形状パラメーターpiの値と第2形状ベクトルs2の形状パラメーターp2の値とを、目標顔向きに対応する値に変更する。例えば、ステップS610で実行すべき特定画像処理の種類として目拡大処理が設定された場合には、目標顔向きが「正面向き」に設定されるため(図18参照)、形状パラメーターpiの値と第2形状ベクトルs2の形状パラメーターp2の値とが、共に「正面向き」に対応する値であるゼロに変更される。パラメーター値変更後の形状sにより、対象画像OIにおける顔向きが目標顔向きに変更された場合における、対象画像OIの各特徴点CPの座標が特定される。なお、本実施例における顔向き変更処理では、顔向きが変更された対象画像OI(テクスチャーを有する画像)が生成される訳ではなく、顔向きが変更された場合における対象画像OIの各特徴点CPの変更後の座標の特定が行われるのみである。 When it is determined that the face orientation of the target image OI is away from the target face orientation (step S630: No), the face orientation changing unit 250 (FIG. 1) sets the face orientation in the target image OI to the target face orientation. A face orientation changing process is performed so as to be close to each other (step S640). Specifically, the face orientation changing unit 250 determines the value of the shape parameter p i of the first shape vector s 1 and the shape parameter of the second shape vector s 2 in the shape s (see the above formula (1)) of the target image OI. and the value of p 2, changed to a value corresponding to the target face orientation. For example, when the eye enlargement process is set as the type of the specific image process to be executed in step S610, the target face direction is set to “front direction” (see FIG. 18), so the value of the shape parameter p i And the value of the shape parameter p 2 of the second shape vector s 2 are both changed to zero, which is a value corresponding to “front direction”. The coordinates of each feature point CP of the target image OI when the face direction in the target image OI is changed to the target face direction are specified by the shape s after the parameter value is changed. In the face orientation changing process in the present embodiment, the target image OI (image having a texture) whose face orientation is changed is not generated, but each feature point of the target image OI when the face orientation is changed. Only the coordinates after the CP change are specified.

ステップS650(図17)では、特定画像処理部240(図1)が、顔向き変更処理後の対象画像OIに対して特定画像処理を実行する。例えば、ステップS610で実行すべき特定画像処理の種類として目拡大処理が設定された場合には、目の輪郭に対応する特徴点CPの位置を変更することによる目領域の拡大が行われる。   In step S650 (FIG. 17), the specific image processing unit 240 (FIG. 1) performs specific image processing on the target image OI after the face orientation change processing. For example, when the eye enlargement process is set as the type of the specific image process to be executed in step S610, the eye area is enlarged by changing the position of the feature point CP corresponding to the outline of the eye.

図19は、目領域の拡大方法を示す説明図である。図19(a)ないし(c)のそれぞれには、左目および右目のそれぞれについて、目の輪郭を示す6つの特徴点CPと、6つの特徴点CPの中心点EC(EC(r)およびEC(l))と、を示している。本実施例における目拡大処理では、図19(a)に示すように、中心点ECから6つの特徴点CPのそれぞれへのベクトルを一定の拡大率で拡大した拡大ベクトルの先端の点を、変更特徴点CPcとして算出する。算出された6つの変更特徴点CPcにより区画される領域(破線で囲んで示す領域)が目拡大処理後の目領域となる。   FIG. 19 is an explanatory diagram showing a method of enlarging the eye area. In each of FIGS. 19A to 19C, for each of the left eye and the right eye, there are six feature points CP indicating the outline of the eye, and center points EC (EC (r) and EC (6) of the six feature points CP. l)). In the eye enlargement process in the present embodiment, as shown in FIG. 19A, the point at the tip of the enlarged vector obtained by enlarging the vector from the center point EC to each of the six feature points CP at a constant enlargement ratio is changed. Calculated as a feature point CPc. An area partitioned by the calculated six changed feature points CPc (an area surrounded by a broken line) is an eye area after the eye enlargement process.

なお、目拡大処理において、図19(b)に示すように、左目および右目のそれぞれについて、目頭に相当する特徴点CP(CP(i))の位置は変更せず、残りの5つの特徴点CPのみの位置を変更するものとしてもよい。また、図19(c)に示すように、左目および右目のそれぞれについて、目頭に相当する特徴点CP(CP(i))および目尻に相当する特徴点CP(CP(o))の位置は変更せず、残りの4つの特徴点CPのみの位置を変更するものとしてもよい。目拡大処理を図19(b)や図19(c)に示す態様によって実行することにより、例えば黒目の位置が変更されることによって処理結果が不自然なものとなることを抑制することができる。また、図19(a)ないし(c)のいずれの場合においても、中心点ECから6つの特徴点CPのそれぞれへのベクトルを、特徴点CP毎(すなわちベクトル毎)に個別に設定された拡大率で拡大した拡大ベクトルの先端の点を、変更特徴点CPcとして算出するものとしてもよい。そのようにすれば、より自然で好ましい目拡大処理を実現することができる。   In the eye enlargement process, as shown in FIG. 19B, the positions of the feature points CP (CP (i)) corresponding to the eyes are not changed for each of the left eye and the right eye, and the remaining five feature points. The position of only the CP may be changed. In addition, as shown in FIG. 19C, the positions of the feature point CP (CP (i)) corresponding to the top of the eye and the feature point CP (CP (o)) corresponding to the corner of the eye are changed for each of the left eye and the right eye. Instead, the positions of only the remaining four feature points CP may be changed. By executing the eye enlargement process according to the mode shown in FIGS. 19B and 19C, it is possible to suppress the processing result from becoming unnatural due to, for example, changing the position of the black eye. . Further, in any of the cases shown in FIGS. 19A to 19C, the vector from the center point EC to each of the six feature points CP is individually set for each feature point CP (that is, each vector). The point at the tip of the enlarged vector enlarged at a rate may be calculated as the changed feature point CPc. By doing so, a more natural and preferable eye enlargement process can be realized.

なお、ステップS650(図17)においては、実際に対象画像OIの目領域全体についての画素値を求める処理が実行されるわけではなく、変更特徴点CPcの座標算出と変更特徴点CPcの座標を反映した形状sの算出とが実行される。変更特徴点CPcの座標算出と変更特徴点CPcの座標を反映した形状sの算出とは、特定画像処理(の一部)である。   Note that in step S650 (FIG. 17), the process of actually obtaining the pixel values for the entire eye area of the target image OI is not executed, and the coordinate calculation of the changed feature point CPc and the coordinates of the changed feature point CPc are performed. The reflected shape s is calculated. The calculation of the coordinates of the changed feature point CPc and the calculation of the shape s reflecting the coordinates of the changed feature point CPc are (part of) specific image processing.

ステップS660(図17)では、顔向き復元部260(図1)が、対象画像OIにおける顔向き復元処理を行う。具体的には、顔向き復元部260は、変更特徴点CPcの座標を反映した対象画像OIの形状sにおける第1形状ベクトルs1の形状パラメーターpiの値と第2形状ベクトルs2の形状パラメーターp2の値とを、対象画像OIの元の顔向きに対応する値に復元する。パラメーター値復元後の形状sにより、対象画像OIの当初の顔向きにおける、変更特徴点CPcを含む各特徴点CPの座標が特定される。例えば、ステップS610で実行すべき特定画像処理の種類として目拡大処理が設定された場合には、顔向きが当初の顔向きであり、目に対応する特徴点CPの位置変更結果が反映された対象画像OIにおける各特徴点CPの座標が特定される。 In step S660 (FIG. 17), the face orientation restoring unit 260 (FIG. 1) performs a face orientation restoring process on the target image OI. Specifically, the face orientation restoring unit 260 reflects the value of the shape parameter p i of the first shape vector s 1 and the shape of the second shape vector s 2 in the shape s of the target image OI reflecting the coordinates of the changed feature point CPc. the value of the parameter p 2, to restore to a value corresponding to the original face direction of the target image OI. The coordinates of each feature point CP including the changed feature point CPc in the initial face direction of the target image OI is specified by the shape s after the parameter value restoration. For example, when eye enlargement processing is set as the type of specific image processing to be executed in step S610, the face orientation is the initial face orientation, and the result of changing the position of the feature point CP corresponding to the eyes is reflected. The coordinates of each feature point CP in the target image OI are specified.

一方、ステップS630(図17)において、対象画像OIの顔向きが目標顔向きに近いと判定された場合には(ステップS630:Yes)、顔向き変更処理(ステップS640)は実行されず、対象画像OIに対する特定画像処理(目の輪郭に対応する特徴点CPの位置の変更)が実行される(ステップS670)。ステップS670の処理内容は、ステップS650の処理内容と同じである。また、ステップS670の処理が完了すると、当然、顔向き復元処理(ステップS660)は実行されず、処理はステップS680に進む。   On the other hand, if it is determined in step S630 (FIG. 17) that the face orientation of the target image OI is close to the target face orientation (step S630: Yes), the face orientation changing process (step S640) is not executed and the target Specific image processing (change of the position of the feature point CP corresponding to the eye contour) for the image OI is executed (step S670). The processing content of step S670 is the same as the processing content of step S650. Further, when the process of step S670 is completed, naturally the face orientation restoring process (step S660) is not executed, and the process proceeds to step S680.

ステップS680(図17)では、特定画像処理部240(図1)が、画像処理後対象画像OIcを生成する。画像処理後対象画像OIcは、特定画像処理実行後の対象画像OIである。例えば、ステップS610で実行すべき特定画像処理の種類として目拡大処理が設定された場合には、ステップS670以前の処理によって、特定画像処理実行後の特徴点CP(変更特徴点CPcを含む)の位置が特定されている。従って、ステップS680では、元の対象画像OIにおいて、特定画像処理実行後の目に対応する特徴点CPの位置により規定される目領域(処理後目領域)が特定され、元の対象画像OIにおける目に対応する特徴点CPにより特定される目領域の画像(処理前目画像)が、処理後目領域に適合する画像に変換される。この変換は、三角形領域TA(図6参照)毎のアフィン変換により実行される。   In step S680 (FIG. 17), the specific image processing unit 240 (FIG. 1) generates a post-image processing target image OIc. The target image OIc after image processing is the target image OI after execution of specific image processing. For example, if eye enlargement processing is set as the type of specific image processing to be executed in step S610, the feature points CP (including changed feature points CPc) after execution of specific image processing are processed by the processing before step S670. The location is specified. Accordingly, in step S680, an eye region (post-processing eye region) defined by the position of the feature point CP corresponding to the eye after execution of the specific image processing is specified in the original target image OI, and the original target image OI The image of the eye area (pre-processing eye image) specified by the feature point CP corresponding to the eye is converted into an image that matches the post-processing eye area. This conversion is executed by affine transformation for each triangular area TA (see FIG. 6).

なお、画像処理後対象画像OIcの生成の際には、元の対象画像OIにおいて目領域を囲む三角形領域TAの画像を目領域が拡大される分だけ縮小するようなアフィン変換を行ってもよい。このようにすれば、目拡大処理において、目領域を囲む三角形領域TAの画像が、拡大した目領域の画像によって上書きされることがない。   Note that, when generating the post-image processing target image OIc, affine transformation may be performed so that the image of the triangular area TA surrounding the eye area in the original target image OI is reduced by the amount of enlargement of the eye area. . In this way, in the eye enlargement process, the image of the triangular area TA surrounding the eye area is not overwritten by the image of the enlarged eye area.

以上説明したように、本実施例の特定画像処理では、対象画像OIにおける顔向きが推定され、推定された顔向きが目標顔向きから離れている(近くない)と判定された場合には、顔向きを目標顔向きに近づけるような顔向き変更処理が行われた後の対象画像OIに対して特定画像処理(例えば目拡大処理に関する変更特徴点CPcの座標算出と変更特徴点CPcの座標を反映した形状sの算出)が実行され、その後、顔向きを元に戻す顔向き復元処理が実行される。目標顔向きは、特定画像処理の種類のそれぞれについて効果的な画像処理を実現するために設定された基準顔向きに基づき設定されるため、本実施例では、元の対象画像OIの顔向きがどのような顔向きであっても効果的な特定画像処理を実現することができる。例えば、正面向きの顔画像に対して実行されることが想定された画像処理を任意の顔向きの顔画像に対して実行しても良好な結果を得ることができる。また、本実施例では、好ましい特定画像処理結果を得るために、特定画像処理の態様(例えば図19に示した目領域の拡大方法や拡大程度)を顔向き毎に設定する必要はなく、1つの基準顔向きについてのみ設定すればよいため、効果的な特定画像処理を容易に実現することができる。   As described above, in the specific image processing of the present embodiment, the face orientation in the target image OI is estimated, and when it is determined that the estimated face orientation is away (not close) from the target face orientation, Specific image processing (for example, the coordinate calculation of the change feature point CPc and the coordinates of the change feature point CPc related to the eye enlargement processing are performed on the target image OI after the face orientation change processing is performed so that the face orientation approaches the target face orientation. The calculation of the reflected shape s) is executed, and then the face orientation restoring process for restoring the face orientation is executed. Since the target face orientation is set based on the reference face orientation set to realize effective image processing for each type of specific image processing, in this embodiment, the face orientation of the original target image OI is Effective specific image processing can be realized regardless of the face orientation. For example, good results can be obtained even if image processing that is supposed to be performed on a face image facing the front is performed on a face image facing any face. Further, in this embodiment, in order to obtain a preferable specific image processing result, it is not necessary to set the specific image processing mode (for example, the eye region enlargement method and enlargement degree shown in FIG. 19) for each face direction. Since only one reference face direction needs to be set, effective specific image processing can be easily realized.

また、本実施例では、特定画像処理の種類毎に基準顔向きが設定され、基準顔向きが目標顔向きに設定されるため、多様な種類の特定画像処理を効果的にかつ容易に実現することができる。また、本実施例では、推定された対象画像OIにおける顔向きが目標顔向きに近いと判定された場合には、顔向き変更処理および顔向き復元処理が実行されることなく、当初の対象画像OIに対して特定画像処理が実行されるため、効率的な処理を実現することができる。   In this embodiment, the reference face direction is set for each type of specific image processing, and the reference face direction is set to the target face direction. Therefore, various types of specific image processing can be effectively and easily realized. be able to. In the present embodiment, when it is determined that the face orientation in the estimated target image OI is close to the target face orientation, the face orientation changing process and the face orientation restoring process are not performed, and the original target image is executed. Since specific image processing is executed for OI, efficient processing can be realized.

B.変形例:
なお、この発明は上記の実施例や実施形態に限られるものではなく、その要旨を逸脱しない範囲において種々の態様において実施することが可能であり、例えば次のような変形も可能である。
B. Variation:
The present invention is not limited to the above-described examples and embodiments, and can be implemented in various modes without departing from the gist thereof. For example, the following modifications are possible.

B1.変形例1:
上記実施例では、推定された対象画像OIにおける顔向きと目標顔向きとの近似判定(図17のステップS630)において、対象画像OIにおける顔向きが目標顔向きから離れている(近くない)と判定された場合にのみ顔向き変更処理および顔向き復元処理が実行されるものとしているが、近似判定を省略し、すべての場合において顔向き変更処理および顔向き復元処理が実行されるものとしてもよい。
B1. Modification 1:
In the above embodiment, in the approximate determination of the face orientation and the target face orientation in the estimated target image OI (step S630 in FIG. 17), the face orientation in the target image OI is far from (not close to) the target face orientation. It is assumed that the face orientation changing process and the face orientation restoring process are executed only when determined, but the approximate judgment is omitted and the face orientation changing process and the face orientation restoring process are executed in all cases. Good.

また、上記実施例の近似判定における閾値はあくまで一例であり、閾値は任意に変更可能である。また、近似判定において、対象画像OIにおける顔向きが目標顔向きから相当程度離れている場合には、対象画像OIは設定された特定画像処理の種類の対象としては適切ではないとして、処理が中止されるとしてもよい。   Further, the threshold value in the approximation determination of the above embodiment is merely an example, and the threshold value can be arbitrarily changed. In the approximate determination, if the face orientation in the target image OI is considerably away from the target face orientation, the target image OI is not appropriate as the target of the set specific image processing type, and the process is stopped. It may be done.

また、上記実施例では、基準顔向き情報SDI(図18)において特定画像処理の種類に対応付けられた基準顔向きが目標顔向きに設定されるとしているが、特定画像処理の種類によらず、一律に所定の顔向き(例えば正面向き)が目標顔向きに設定されるとしてもよい。また、図18に示した基準顔向き情報SDIの内容はあくまで一例であり、特定画像処理の種類と基準顔向きとの対応関係は変更可能である。また、特定画像処理部240は、図18に示した特定画像処理の種類をすべて実行可能である必要はないし、図18に示した以外の特定画像処理の種類を実行可能であるとしてもよい。例えば、特定画像処理部240は、顔領域FA(図10参照)に基づき変形領域を設定し、変形領域を分割点を頂点とする複数の小領域に分割し、分割点を移動して小領域を変形することにより変形領域の画像変形(例えば小顔にする画像変形)を行う画像処理を実行可能であるとしてもよい。この場合にも、顔向きを推定し、顔向きを例えば正面向きに変更した後に画像処理を実行するものとすれば、画像変形を行う画像処理を効果的に実現することができる。   In the above-described embodiment, the reference face orientation associated with the type of specific image processing is set as the target face orientation in the reference face orientation information SDI (FIG. 18), but it does not depend on the type of specific image processing. The predetermined face direction (for example, the front direction) may be uniformly set as the target face direction. Further, the content of the reference face orientation information SDI shown in FIG. 18 is merely an example, and the correspondence between the type of specific image processing and the reference face orientation can be changed. Further, the specific image processing unit 240 need not be able to execute all the types of specific image processing shown in FIG. 18, and may be able to execute specific image processing types other than those shown in FIG. 18. For example, the specific image processing unit 240 sets a deformation area based on the face area FA (see FIG. 10), divides the deformation area into a plurality of small areas having the dividing point as a vertex, and moves the dividing point to move the small area. It may be possible to execute image processing for performing image deformation of the deformation area (for example, image deformation to make a small face) by deforming. Also in this case, if the face direction is estimated and the image process is executed after the face direction is changed to, for example, the front direction, the image process for performing the image deformation can be effectively realized.

また、上記実施例では、顔向き変更処理および顔向き復元処理を、対象画像OIの形状sにおける左右振りにほぼ相関する第1形状ベクトルs1の形状パラメーターpiの値と、上下振りにほぼ相関する第2形状ベクトルs2の形状パラメーターp2の値と、を変更することにより実行しているが、形状パラメーターpiの値と形状パラメーターp2の値とのいずれか一方のみを変更することにより実行するとしてもよい。すなわち、顔向き変更処理および顔向き復元処理を、左右方向および上下方向の一方のみに対して実行するとしてもよい。また、顔向き変更処理は、対象画像OIにおける顔向きを目標顔向きに近づけるように変更すればよく、必ずしも目標顔向きに一致させる必要はない。 In the above embodiment, the face orientation changing process and the face orientation restoration process, the value of the first shape vector s 1 of shape parameter p i to be approximately correlated with the left and right swing in shape s of the target image OI, substantially vertical appearance This is executed by changing the value of the shape parameter p 2 of the correlated second shape vector s 2 , but only one of the value of the shape parameter p i and the value of the shape parameter p 2 is changed. It may be executed depending on the situation. That is, the face orientation changing process and the face orientation restoring process may be executed only in one of the left and right directions and the up and down direction. Further, the face orientation changing process may be performed so that the face orientation in the target image OI approaches the target face orientation and does not necessarily match the target face orientation.

また、対象画像OIにおける顔向きの推定や、顔向き変更処理および顔向き復元処理は、必ずしもAAMの形状モデルを用いて実行する必要はなく、他の方法によって実行するものとしてもよい。   Further, the estimation of the face orientation, the face orientation changing process, and the face orientation restoring process in the target image OI are not necessarily performed using the AAM shape model, and may be performed by other methods.

また、図19に示した目拡大の方法はあくまで一例であり、他の方法によって目拡大処理を行うとしてもよい。また、特定画像処理の種類として目拡大や目バランス調整が設定された場合に、対象画像OIにおける目領域の大きさに基づき特定画像処理の内容を変更するものとしてもよい。例えば、特定画像処理の種類として目拡大が設定された場合に、対象画像OIの目領域の大きさが所定の閾値より大きい場合には、特定画像処理としての目拡大の実行を中止するとしてもよいし、目拡大の拡大率をより小さな値に調整するとしてもよい。また、特定画像処理の種類として目バランス調整が設定された場合に、対象画像OIの目領域の大きさが所定の閾値より小さい場合には、特定画像処理としての目バランス調整の実行を中止するとしてもよい。   The eye enlargement method shown in FIG. 19 is merely an example, and the eye enlargement process may be performed by another method. Further, when eye enlargement or eye balance adjustment is set as the type of specific image processing, the content of the specific image processing may be changed based on the size of the eye area in the target image OI. For example, when eye enlargement is set as the type of specific image processing, if the size of the eye area of the target image OI is larger than a predetermined threshold, execution of eye enlargement as specific image processing may be stopped. It is also possible to adjust the enlargement ratio of the eye enlargement to a smaller value. Further, when eye balance adjustment is set as the type of specific image processing, if the size of the eye area of the target image OI is smaller than a predetermined threshold, execution of eye balance adjustment as specific image processing is stopped. It is good.

B2.変形例2:
上記実施例では、AAMを利用して顔特徴位置特定処理(図9)が実行されるとしているが、顔特徴位置特定処理は必ずしもAAMを利用して実行される必要はなく、他の方法により実行されるとしてもよい。
B2. Modification 2:
In the above embodiment, the facial feature position specifying process (FIG. 9) is executed using AAM. However, the facial feature position specifying process is not necessarily executed using AAM. It may be executed.

また、特徴点CP配置更新処理(図15)において正規化処理(ステップS412)が実行されるとしているが、正規化処理は必ずしも実行される必要はない。   Further, although the normalization process (step S412) is executed in the feature point CP arrangement update process (FIG. 15), the normalization process is not necessarily executed.

B3.変形例3:
上記実施例では、特徴点CP初期配置決定処理(図9のステップS230)において、平均顔画像群のそれぞれと対象画像OIとの差分画像Ieや、平均顔画像A0(x)と複数の平均形状画像I(W(x;p))のそれぞれとの差分画像Ieが算出され、差分画像Ieに基づいて平特徴点CPの配置全体の変動が大きい(分散が大きい)グローバルパラメーターの概略値が決定されるものとしているが、対象画像OIにおける特徴点CPの初期配置の決定の際には、必ずしも差分画像Ieの算出やグローバルパラメーターの概略値の決定を行う必要はなく、予め定められた特徴点CPの配置(例えば上述の基準対応関係における配置)を初期配置として決定するものとしてもよい。
B3. Modification 3:
In the above embodiment, in the feature point CP initial arrangement determination process (step S230 in FIG. 9), the difference image Ie between each of the average face image groups and the target image OI, the average face image A 0 (x), and a plurality of averages A difference image Ie from each of the shape images I (W (x; p)) is calculated, and based on the difference image Ie, the overall value of the global parameter having a large variation (large variance) in the entire arrangement of the flat feature points CP is obtained. Although it is determined that the initial arrangement of the feature points CP in the target image OI is not necessarily calculated, it is not always necessary to calculate the difference image Ie or determine the global parameter approximate value. The arrangement of the points CP (for example, the arrangement in the above-described reference correspondence relationship) may be determined as the initial arrangement.

B4.変形例4:
上記実施例では、特徴点CP配置更新処理(図15)の収束判定(ステップS430)における判定指標値として、平均形状画像I(W(x;p))と平均顔画像A0(x)との差分画像Ieのノルムが用いられているが、判定指標値として、平均形状画像I(W(x;p))と平均顔画像A0(x)との相違の程度を表す他の指標値が用いられるとしてもよい。
B4. Modification 4:
In the above embodiment, the average shape image I (W (x; p)) and the average face image A 0 (x) are used as determination index values in the convergence determination (step S430) of the feature point CP arrangement update process (FIG. 15). The norm of the difference image Ie is used, but other index values representing the degree of difference between the average shape image I (W (x; p)) and the average face image A 0 (x) are used as determination index values. May be used.

B5.変形例5:
上記実施例の特徴点CP配置更新処理(図15)では、対象画像OIに基づき平均形状画像I(W(x;p))を算出することにより対象画像OIの特徴点CPの配置を平均顔画像A0(x)の特徴点CPの配置に整合させているが、平均顔画像A0(x)に対して画像変換を行うことにより両者の特徴点CPの配置を整合させるものとしてもよい。
B5. Modification 5:
In the feature point CP arrangement update process (FIG. 15) of the above embodiment, the average shape image I (W (x; p)) is calculated based on the target image OI, and the arrangement of the feature points CP of the target image OI is averaged. Although matched to the arrangement of the characteristic points CP of the image a 0 (x), may be configured to be aligned arrangement of the characteristic points CP of the two performs an image conversion for the average face image a 0 (x) .

B6.変形例6:
上記実施例では、顔領域FAの検出が行われ、顔領域FAに基づき想定基準領域ABAが設定されるとしているが、顔領域FAの検出は必ずしも実行される必要はない。例えば、ユーザーによる指定に従い直接、想定基準領域ABAが設定されるとしてもよい。
B6. Modification 6:
In the above embodiment, the face area FA is detected and the assumed reference area ABA is set based on the face area FA. However, the detection of the face area FA does not necessarily have to be executed. For example, the assumed reference area ABA may be set directly according to the designation by the user.

B7.変形例7:
上記実施例におけるサンプル顔画像SI(図3)はあくまで一例であり、サンプル顔画像SIとして採用する画像の数、種類は任意に設定可能である。また、上記各実施例において、特徴点CPの位置で示される顔の所定の特徴部位(図4参照)はあくまで一例であり、実施例において設定されている特徴部位の一部を省略したり、特徴部位として他の部位を採用したりしてもよい。
B7. Modification 7:
The sample face image SI (FIG. 3) in the above embodiment is merely an example, and the number and type of images employed as the sample face image SI can be arbitrarily set. In each of the above embodiments, the predetermined feature portion of the face indicated by the position of the feature point CP (see FIG. 4) is merely an example, and a part of the feature portion set in the embodiment may be omitted, Other parts may be adopted as the characteristic part.

また、上記実施例では、サンプル顔画像SIwの画素群xのそれぞれにおける輝度値により構成される輝度値ベクトルに対する主成分分析によってテクスチャーモデルが設定されているが、顔画像のテクスチャー(見え)を表す輝度値以外の指標値(例えばRGB値)に対する主成分分析によってテクスチャーモデルが設定されるものとしてもよい。   In the above embodiment, the texture model is set by the principal component analysis for the luminance value vector constituted by the luminance values in each of the pixel groups x of the sample face image SIw, but represents the texture (appearance) of the face image. A texture model may be set by principal component analysis for index values other than luminance values (for example, RGB values).

また、上記実施例において、平均顔画像A0(x)のサイズは種々のサイズであってよい。また、平均顔画像A0(x)は、マスク領域MA(図8)を含む必要はなく、平均形状領域BSAのみによって構成されるとしてもよい。また、平均顔画像A0(x)の代わりに、サンプル顔画像SIの統計的分析に基づき設定される他の基準顔画像が用いられるとしてもよい。 In the above embodiment, the average face image A 0 (x) may have various sizes. Further, the average face image A 0 (x) does not need to include the mask area MA (FIG. 8), and may be configured only by the average shape area BSA. Further, instead of the average face image A 0 (x), another reference face image set based on the statistical analysis of the sample face image SI may be used.

また、上記実施例では、AAMを用いた形状モデルおよびテクスチャーモデルの設定が行われているが、他のモデル化手法(例えばMorphable Modelと呼ばれる手法やActive Blobと呼ばれる手法)を用いて形状モデルおよびテクスチャーモデルの設定が行われるとしてもよい。   In the above embodiment, the shape model and the texture model are set using AAM. However, the shape model and the texture model using other modeling methods (for example, a method called Morphable Model or a method called Active Blob) are used. A texture model may be set.

また、上記実施例では、メモリーカードMCに格納された画像が対象画像OIに設定されているが、対象画像OIは例えばネットワークを介して取得された画像であってもよい。   In the above embodiment, the image stored in the memory card MC is set as the target image OI. However, the target image OI may be an image acquired via a network, for example.

また、上記実施例における画像処理装置としてのプリンター100の構成はあくまで一例であり、プリンター100の構成は種々変更可能である。また、上記実施例では、画像処理装置としてのプリンター100による画像処理を説明したが、処理の一部または全部がパーソナルコンピューターやデジタルスチルカメラ、デジタルビデオカメラ等の他の種類の画像処理装置により実行されるものとしてもよい。また、プリンター100はインクジェットプリンターに限らず、他の方式のプリンター、例えばレーザプリンターや昇華型プリンターであるとしてもよい。   Further, the configuration of the printer 100 as the image processing apparatus in the above embodiment is merely an example, and the configuration of the printer 100 can be variously changed. In the above embodiment, image processing by the printer 100 as the image processing apparatus has been described. However, part or all of the processing is executed by another type of image processing apparatus such as a personal computer, a digital still camera, or a digital video camera. It is good also as what is done. The printer 100 is not limited to an ink jet printer, and may be another type of printer such as a laser printer or a sublimation printer.

上記実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部をハードウェアに置き換えるようにしてもよい。   In the above embodiment, a part of the configuration realized by hardware may be replaced by software, and conversely, a part of the configuration realized by software may be replaced by hardware.

また、本発明の機能の一部または全部がソフトウェアで実現される場合には、そのソフトウェア(コンピュータープログラム)は、コンピューター読み取り可能な記録媒体に格納された形で提供することができる。この発明において、「コンピューター読み取り可能な記録媒体」とは、フレキシブルディスクやCD−ROMのような携帯型の記録媒体に限らず、各種のRAMやROM等のコンピューター内の内部記憶装置や、ハードディスク等のコンピューターに固定されている外部記憶装置も含んでいる。   In addition, when part or all of the functions of the present invention are realized by software, the software (computer program) can be provided in a form stored in a computer-readable recording medium. In the present invention, the “computer-readable recording medium” is not limited to a portable recording medium such as a flexible disk or a CD-ROM, but an internal storage device in a computer such as various RAMs and ROMs, a hard disk, etc. It also includes an external storage device fixed to the computer.

100…プリンター
110…CPU
120…内部メモリー
140…操作部
150…表示部
160…プリンターエンジン
170…カードインターフェース
172…カードスロット
200…画像処理部
210…顔特徴位置特定部
211…初期配置部
212…画像変換部
213…判定部
214…更新部
215…正規化部
230…顔領域検出部
240…特定画像処理部
250…顔向き変更部
260…顔向き復元部
310…表示処理部
320…印刷処理部
100 ... Printer 110 ... CPU
DESCRIPTION OF SYMBOLS 120 ... Internal memory 140 ... Operation part 150 ... Display part 160 ... Printer engine 170 ... Card interface 172 ... Card slot 200 ... Image processing part 210 ... Face feature position specification part 211 ... Initial arrangement part 212 ... Image conversion part 213 ... Determination part 214 ... Update unit 215 ... Normalization unit 230 ... Face region detection unit 240 ... Specific image processing unit 250 ... Face orientation change unit 260 ... Face orientation restoration unit 310 ... Display processing unit 320 ... Print processing unit

Claims (12)

顔画像に対して画像処理を行う画像処理装置であって、
前記顔画像における顔向きを推定する顔向き推定部と、
前記顔画像に対して、推定された顔向きが目標顔向きに近づくように顔向き変更処理を行う顔向き変更部と、
前記顔向き変更処理後の前記顔画像に対して前記画像処理を行う画像処理部と、
前記画像処理後の前記顔画像に対して、前記顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理を行う顔向き復元部と、を備える、画像処理装置。
An image processing apparatus that performs image processing on a face image,
A face orientation estimating unit for estimating a face orientation in the face image;
A face orientation changing unit that performs a face orientation changing process so that the estimated face orientation approaches the target face orientation with respect to the face image;
An image processing unit that performs the image processing on the face image after the face orientation change processing;
An image processing apparatus comprising: a face orientation restoring unit that performs a face orientation restoring process for restoring the face orientation changed by the face orientation changing process to the face image after the image processing.
請求項1に記載の画像処理装置であって、
前記目標顔向きは、正面向きである、画像処理装置。
The image processing apparatus according to claim 1,
The image processing apparatus, wherein the target face orientation is a front orientation.
請求項1に記載の画像処理装置であって、
前記画像処理部は、複数種類の前記画像処理を実行可能であり、
前記画像処理装置は、さらに、
前記画像処理の種類と顔向きとの対応関係を記憶する記憶部を備え、
前記顔向き変更部は、前記対応関係において、前記画像処理部により実行される前記画像処理の種類に対応付けられた顔向きを、前記目標顔向きに設定する、画像処理装置。
The image processing apparatus according to claim 1,
The image processing unit can execute a plurality of types of the image processing,
The image processing apparatus further includes:
A storage unit that stores the correspondence between the type of image processing and the face orientation;
The face orientation changing unit is an image processing device that sets, in the correspondence relationship, a face orientation associated with a type of the image processing executed by the image processing unit as the target face orientation.
請求項1ないし請求項3のいずれかに記載の画像処理装置であって、
前記画像処理部は、推定された顔向きが前記目標顔向きから比較的離れた第1の範囲にある場合には、前記顔向き変更処理後の前記顔画像に対して前記画像処理を行い、推定された顔向きが前記第1の範囲と比較して前記目標顔向きに近い第2の範囲にある場合には、前記顔向き変更処理が行われる前の前記顔画像に対して前記画像処理を行う、画像処理装置。
An image processing apparatus according to any one of claims 1 to 3,
The image processing unit performs the image processing on the face image after the face orientation change processing when the estimated face orientation is in a first range relatively far from the target face orientation, When the estimated face orientation is in the second range that is closer to the target face orientation compared to the first range, the image processing is performed on the face image before the face orientation change processing is performed. An image processing apparatus.
請求項1ないし請求項4のいずれかに記載の画像処理装置であって、さらに、
顔の所定の特徴部位の位置により規定される顔形状を基準形状と顔向きを含む少なくとも1つの顔形状特徴量とにより表す形状モデルと、前記基準形状を有する顔画像の画素値により規定される顔テクスチャーを基準テクスチャーと少なくとも1つの顔テクスチャー特徴量とにより表すテクスチャーモデルと、を用いて、前記顔画像における前記特徴部位の位置を特定する特徴位置特定部を備え、
前記顔向き変更部は、前記形状モデルにおける顔向きを表す前記顔形状特徴量を変更することにより、前記顔向き変更処理を実行する、画像処理装置。
The image processing apparatus according to any one of claims 1 to 4, further comprising:
Defined by a shape model representing a face shape defined by the position of a predetermined feature part of the face by a reference shape and at least one face shape feature amount including a face orientation, and a pixel value of a face image having the reference shape Using a texture model that represents a face texture by a reference texture and at least one face texture feature amount, and a feature position specifying unit that specifies the position of the feature part in the face image,
The face direction changing unit is an image processing apparatus that executes the face direction changing process by changing the face shape feature amount representing a face direction in the shape model.
請求項5に記載の画像処理装置であって、
前記特徴部位は、目の輪郭を含み、
前記画像処理は、前記顔画像において位置が特定された目の輪郭により規定される目領域を拡大する処理を含む、画像処理装置。
The image processing apparatus according to claim 5,
The characteristic part includes an eye outline,
The image processing apparatus includes a process of enlarging an eye region defined by an eye contour whose position is specified in the face image.
請求項5に記載の画像処理装置であって、
前記特徴部位は、目の輪郭を含み、
前記画像処理は、前記顔画像において位置が特定された目の輪郭により規定される左右の目領域の大きさを互いに近づける処理を含む、画像処理装置。
The image processing apparatus according to claim 5,
The characteristic part includes an eye outline,
The image processing apparatus includes a process of bringing the sizes of left and right eye regions defined by the contours of eyes whose positions are specified in the face image closer to each other.
請求項5ないし請求項7のいずれかに記載の画像処理装置であって、
前記形状モデルと前記テクスチャーモデルとは、前記特徴部位の位置を示す特徴点の配置が既知である複数のサンプル顔画像を対象とした統計的分析に基づき設定され、
前記特徴位置特定部は、前記基準形状における前記特徴点の配置に基づき前記顔画像における前記特徴点の初期配置を決定し、前記顔画像と、前記基準形状と前記基準テクスチャーとにより規定される基準顔画像と、の比較結果に基づき前記特徴点の配置を更新することにより、前記顔画像における前記特徴部位の位置を特定する、画像処理装置。
An image processing apparatus according to any one of claims 5 to 7,
The shape model and the texture model are set based on a statistical analysis for a plurality of sample face images whose arrangement of feature points indicating the positions of the feature parts is known,
The feature position specifying unit determines an initial arrangement of the feature points in the face image based on an arrangement of the feature points in the reference shape, and a reference defined by the face image, the reference shape, and the reference texture. An image processing apparatus that identifies the position of the feature portion in the face image by updating the arrangement of the feature points based on a comparison result with the face image.
請求項8に記載の画像処理装置であって、
前記基準形状は、前記複数のサンプル顔画像における前記特徴部位の平均位置を表す平均形状であり、
前記基準テクスチャーは、前記平均形状に形状変換された前記複数のサンプル顔画像の前記特徴部位の位置における画素値の平均を表す平均テクスチャーである、画像処理装置。
The image processing apparatus according to claim 8,
The reference shape is an average shape representing an average position of the characteristic part in the plurality of sample face images,
The image processing apparatus, wherein the reference texture is an average texture that represents an average of pixel values at the positions of the characteristic portions of the plurality of sample face images that have been transformed into the average shape.
顔画像に対して画像処理を行う画像処理方法であって、
(a)前記顔画像における顔向きを推定する工程と、
(b)前記顔画像に対して、推定された顔向きが目標顔向きに近づくように顔向き変更処理を行う工程と、
(c)前記顔向き変更処理後の前記顔画像に対して前記画像処理を行う工程と、
(d)前記画像処理後の前記顔画像に対して、前記顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理を行う工程と、を備える、画像処理方法。
An image processing method for performing image processing on a face image,
(A) estimating a face orientation in the face image;
(B) performing a face orientation change process on the face image so that the estimated face orientation approaches the target face orientation;
(C) performing the image processing on the face image after the face orientation change processing;
(D) An image processing method comprising: performing a face orientation restoring process for restoring the face orientation changed by the face orientation changing process to the face image after the image processing.
顔画像に対して画像処理を行う画像処理のためのコンピュータープログラムであって、
前記顔画像における顔向きを推定する顔向き推定機能と、
前記顔画像に対して、推定された顔向きが目標顔向きに近づくように顔向き変更処理を行う顔向き変更機能と、
前記顔向き変更処理後の前記顔画像に対して前記画像処理を行う画像処理機能と、
前記画像処理後の前記顔画像に対して、前記顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理を行う顔向き復元機能と、を、コンピューターに実現させる、コンピュータープログラム。
A computer program for image processing that performs image processing on a face image,
A face direction estimating function for estimating a face direction in the face image;
A face orientation change function for performing a face orientation change process so that the estimated face orientation approaches the target face orientation with respect to the face image;
An image processing function for performing the image processing on the face image after the face orientation change processing;
The computer program which makes a computer implement | achieve the face orientation restoration function which performs the face orientation restoration process which returns the face orientation changed by the said face orientation change process with respect to the said face image after the said image processing.
印刷装置であって、
顔画像における顔向きを推定する顔向き推定部と、
前記顔画像に対して、推定された顔向きが目標顔向きに近づくように顔向き変更処理を行う顔向き変更部と、
前記顔向き変更処理後の前記顔画像に対して画像処理を行う画像処理部と、
前記画像処理後の前記顔画像に対して、前記顔向き変更処理により変更された顔向きを元に戻す顔向き復元処理を行う顔向き復元部と、
前記顔向き復元処理後の前記顔画像を印刷する印刷部と、を備える、印刷装置。
A printing device,
A face direction estimation unit for estimating a face direction in a face image;
A face orientation changing unit that performs a face orientation changing process so that the estimated face orientation approaches the target face orientation with respect to the face image;
An image processing unit that performs image processing on the face image after the face orientation change processing;
A face orientation restoring unit that performs a face orientation restoring process for restoring the face orientation changed by the face orientation changing process to the face image after the image processing;
And a printing unit that prints the face image after the face orientation restoring process.
JP2009090750A 2009-04-03 2009-04-03 Face image processing Pending JP2010245721A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009090750A JP2010245721A (en) 2009-04-03 2009-04-03 Face image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009090750A JP2010245721A (en) 2009-04-03 2009-04-03 Face image processing

Publications (1)

Publication Number Publication Date
JP2010245721A true JP2010245721A (en) 2010-10-28

Family

ID=43098282

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009090750A Pending JP2010245721A (en) 2009-04-03 2009-04-03 Face image processing

Country Status (1)

Country Link
JP (1) JP2010245721A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2447122A2 (en) 2010-11-01 2012-05-02 Jatco Ltd Control apparatus for vehicle and control method therefor
JP2016055203A (en) * 2016-01-26 2016-04-21 パナソニックIpマネジメント株式会社 Makeup support device and makeup support method
US10740923B2 (en) 2016-12-13 2020-08-11 Fujitsu Limited Face direction estimation device and face direction estimation method for estimating the direction of a face represented on an image

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2447122A2 (en) 2010-11-01 2012-05-02 Jatco Ltd Control apparatus for vehicle and control method therefor
JP2016055203A (en) * 2016-01-26 2016-04-21 パナソニックIpマネジメント株式会社 Makeup support device and makeup support method
US10740923B2 (en) 2016-12-13 2020-08-11 Fujitsu Limited Face direction estimation device and face direction estimation method for estimating the direction of a face represented on an image

Similar Documents

Publication Publication Date Title
JP2010186288A (en) Image processing for changing predetermined texture characteristic amount of face image
JP2010182150A (en) Image processing apparatus for detecting coordinate position of characteristic part of face
JP2010186216A (en) Specifying position of characteristic portion of face image
US10467793B2 (en) Computer implemented method and device
JP2011060038A (en) Image processing apparatus
JP2011053942A (en) Apparatus, method and program for processing image
JP2010191592A (en) Image processing apparatus for detecting coordinate position of characteristic portion of face
JP2009237619A (en) Detection of face area and organ area in image
JP2010250420A (en) Image processing apparatus for detecting coordinate position of characteristic part of face
JP2010170184A (en) Specifying position of characteristic portion of face image
JP2010244321A (en) Image processing for setting face model showing face image
JP2010282339A (en) Image processor for correcting position of pupil in eye, image processing method, image processing program and printer
JP2010176314A (en) Image processor for detecting coordinate position of characteristic site of face
JP2010250419A (en) Image processing device for detecting eye condition
US8031915B2 (en) Image processing device and image processing method
JP2010271955A (en) Image processing apparatus, image processing method, image processing program, and printer
JP2010245721A (en) Face image processing
JP2000285222A (en) Eye makeup simultaion system
JP2010244251A (en) Image processor for detecting coordinate position for characteristic site of face
JP6547244B2 (en) Operation processing apparatus, operation processing method and program
JP2009253324A (en) Image processing unit, image processing method, and program
JP2012173812A (en) Face image processor
JP2010282340A (en) Image processor, image processing method, image processing program and printer for determining state of eye included in image
JP2010271956A (en) Image processing apparatus, image processing method, image processing program, and printer
JP2010244318A (en) Image processing for specifying position of characteristic part in face image