JP2011053942A - Apparatus, method and program for processing image - Google Patents

Apparatus, method and program for processing image Download PDF

Info

Publication number
JP2011053942A
JP2011053942A JP2009202717A JP2009202717A JP2011053942A JP 2011053942 A JP2011053942 A JP 2011053942A JP 2009202717 A JP2009202717 A JP 2009202717A JP 2009202717 A JP2009202717 A JP 2009202717A JP 2011053942 A JP2011053942 A JP 2011053942A
Authority
JP
Japan
Prior art keywords
image
face
deformation
point
area
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
JP2009202717A
Other languages
Japanese (ja)
Inventor
Masaya Usui
雅也 碓井
Kenji Matsuzaka
健治 松坂
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 JP2009202717A priority Critical patent/JP2011053942A/en
Publication of JP2011053942A publication Critical patent/JP2011053942A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing apparatus that performs transformation processing after accurately understanding a difference of characteristics such as a shape of each face. <P>SOLUTION: The image processing apparatus includes: a detecting part that detects a contour point corresponding to the contour of a face included in a focused image; a region setting part that sets a region including at least a part of the face as a target region of the transformation processing based on a position of the detected contour point; and a transformation processing part that performs transformation of the image within the set target region. Further, the image processing apparatus performs detection of the contour point, setting of the target region and transformation of the image per frame image configuring a moving image as the focused image. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、画像処理装置、画像処理方法および画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and an image processing program.

顔画像を変形する技術として、対象画像から顔の少なくとも一部を含む矩形領域(顔領域)を検出し、顔領域に基づいて変形領域を設定し、変形領域内を分割して生成した各小領域を変形することにより変形領域内の画像の変形を行なう画像処理装置が知られている(特許文献1参照。)。   As a technique for deforming a face image, each small image generated by detecting a rectangular area (face area) including at least a part of a face from a target image, setting a deformation area based on the face area, and dividing the deformation area. There is known an image processing apparatus that deforms an image in a deformed area by deforming the area (see Patent Document 1).

特開2009‐104672号公報JP 2009-104672 A

上記文献においては、矩形として検出される顔領域の位置および大きさに基づいて変形領域を設定することにより、画像内の顔毎の変形(小顔化など)を行なっていた。
ここで、人顔は、面長の顔や丸顔など様々な形状をしており、更に性別、年齢などによっても違いがある。そのため、顔毎に自然かつ効果的な或いはユーザーが望む態様での画像変形結果を得るには、顔毎の形状等の違いをより正確に捉えた上で変形処理を行なうことが望ましい。
In the above-mentioned document, deformation (for example, a small face) is performed for each face in the image by setting the deformation area based on the position and size of the face area detected as a rectangle.
Here, the human face has various shapes such as a face-length face and a round face, and further varies depending on gender, age, and the like. Therefore, in order to obtain a natural and effective image deformation result for each face or in a manner desired by the user, it is desirable to perform the deformation process after more accurately grasping the difference in shape and the like for each face.

また、左右上下にいくらか振れている顔画像(顔の向きが正面向きではない顔画像)についても、自然かつ効果的な或いはユーザーが望む態様での変形結果を得ることが望まれている。さらに、動画内では顔の向きや大きさ等は随時変化し得るものである。動画においては、顔の変形結果の質が動画を構成するコマ(フレーム画像)毎に大きく異なってしまうと、コマ間の繋がりを欠いてしまい、ユーザーの視聴に堪えられないものとなってしまう。   In addition, it is desired to obtain a natural and effective deformation result in a manner desired by the user with respect to a face image (a face image in which the face direction is not front-facing) that is somewhat swung left and right and up and down. Furthermore, the orientation and size of the face can change at any time in the moving image. In a moving image, if the quality of the face deformation results greatly differs for each frame (frame image) constituting the moving image, the connection between the frames is lost, and the user cannot endure viewing.

本発明は上記課題の少なくとも一つを解決するためになされたものであり、画像における顔毎の特徴に応じて、顔毎に自然かつ効果的な或いはユーザーが望む態様での変形を行なうことができる画像処理装置、画像処理方法および画像処理プログラムを提供することを目的とする。   The present invention has been made in order to solve at least one of the above-described problems. According to the characteristics of each face in the image, the face can be naturally and effectively deformed in a manner desired by the user. An object is to provide an image processing apparatus, an image processing method, and an image processing program.

本発明の態様の一つは、画像処理装置であって、注目画像に含まれる顔の輪郭に対応する輪郭点を検出する検出部と、上記検出された輪郭点の位置に基づいて、上記顔の少なくとも一部を含む領域を変形処理の対象領域として設定する領域設定部と、上記設定された対象領域内の画像の変形を行う変形処理部とを備える。
本発明によれば、変形処理の対象となる画像領域は、顔の細かな形状(輪郭)を正確に反映した領域となるため、その顔にとって最適な(自然かつ効果的な)変形結果を得ることができる。
One aspect of the present invention is an image processing apparatus, wherein a detection unit that detects a contour point corresponding to a contour of a face included in an image of interest, and the face based on the position of the detected contour point A region setting unit that sets a region including at least a part of the target region as a target region of the deformation process, and a deformation processing unit that deforms the image in the set target region.
According to the present invention, since the image area to be deformed is an area that accurately reflects the fine shape (contour) of the face, an optimal (natural and effective) deformation result for the face is obtained. be able to.

画像処理装置は、上記注目画像としての動画を構成するフレーム画像毎に、上記輪郭点の検出と対象領域の設定と画像の変形とを行なうとしてもよい。当該構成によれば、動画再生の際に、フレーム画像毎に顔の正確な形状に基づいた変形が行なわれるため、ユーザーは適切に変形された顔を含む動画を快適に視聴できる。   The image processing apparatus may perform the detection of the contour point, the setting of the target region, and the deformation of the image for each frame image constituting the moving image as the attention image. According to this configuration, when the moving image is reproduced, the deformation based on the accurate shape of the face is performed for each frame image, so that the user can comfortably view the moving image including the appropriately deformed face.

上記検出部は、複数の特徴量に基づいて顔の輪郭を複数の特徴点の位置によって表現する形状モデルにおける特徴点の位置が、顔の輪郭に近づくように、当該特徴量を変更し、当該変更により補正された特徴点の位置を上記輪郭点の位置として検出するとしてもよい。当該構成によれば、各特徴量を変更することにより特徴点の位置を高い精度で顔の輪郭に一致にさせることができるため、上記輪郭点の位置を容易かつ正確に検出できる。   The detection unit changes the feature amount so that the position of the feature point in the shape model expressing the contour of the face by the position of the plurality of feature points based on the plurality of feature amounts approaches the contour of the face, The position of the feature point corrected by the change may be detected as the position of the contour point. According to this configuration, by changing each feature amount, the position of the feature point can be made to coincide with the contour of the face with high accuracy. Therefore, the position of the contour point can be detected easily and accurately.

上記検出部は、顔の向きの変化に対応する特徴量を変更することにより、向きが変更された顔の輪郭を表現する位置に特徴点を設定するとともに、上記領域設定部は、当該特徴点の設定に追従して上記対象領域の設定を行なうとしてもよい。当該構成によれば、例えば、注目画像から正面向きの顔の輪郭点が検出された場合、当該正面向きの顔の向きを変化させたときの顔についての変形結果を得ることができる。   The detection unit sets a feature point at a position expressing the contour of the face whose orientation has been changed by changing a feature amount corresponding to a change in the orientation of the face, and the region setting unit includes the feature point The target area may be set following the above setting. According to this configuration, for example, when a face-facing face contour point is detected from the image of interest, it is possible to obtain a deformation result for the face when the face-facing direction is changed.

上記変形処理部は、上記顔の向きの変化の程度に応じて、画像の変形量を異ならせるとしてもよい。当該構成によれば、顔の向きの変化の程度に応じた最適な変形結果を得ることができる。
上記変形処理部は、上記顔の向きが変化する方向に略直交する方向にのみ変形させる所定箇所の画像に対する変形量は、上記顔の向きの変化の程度にかかわらず一定とする。当該構成によれば、例えば、正面を向く顔を左右に回転させたときの顔についての変形結果において、顎の先端部位に対する上下方向の変形量は、正面を向く顔であった場合の変形量と同じであるため、ユーザーは違和感の無い変形結果(例えば、動画)を見ることができる。
The deformation processing unit may vary the amount of image deformation according to the degree of change in the face orientation. According to the said structure, the optimal deformation | transformation result according to the grade of the change of the direction of a face can be obtained.
The deformation processing unit sets a deformation amount for an image at a predetermined location to be deformed only in a direction substantially orthogonal to the direction in which the face orientation changes, regardless of the degree of change in the face orientation. According to the configuration, for example, in the deformation result for the face when the face facing the front is rotated left and right, the amount of deformation in the vertical direction with respect to the tip portion of the jaw is the amount of deformation when the face is facing the front Therefore, the user can see a transformation result (for example, a moving image) without a sense of incongruity.

上記領域設定部は、上記検出された輪郭点に囲まれた領域内に基準点を設定し、当該基準点と各輪郭点とを結ぶ各線分を各輪郭点よりも外側へ所定距離延長した位置に各外枠点を設定し、当該各外枠点によって囲まれた領域を上記対象領域としてもよい。当該構成によれば、検出された輪郭を一回り大きくした範囲が対象領域となるため、その顔の形状にとって最適な変形結果を得ることができる。   The area setting unit sets a reference point in an area surrounded by the detected contour point, and a position obtained by extending each line segment connecting the reference point and each contour point by a predetermined distance outward from each contour point. Each outer frame point may be set to the target region, and a region surrounded by each outer frame point may be set as the target region. According to this configuration, the range obtained by enlarging the detected contour once becomes the target region, so that an optimal deformation result can be obtained for the face shape.

画像処理装置は、上記顔の属性を判定する属性判定部を備え、上記変形処理部は、上記判定された顔の属性に応じて異なる変形を行なうとしてもよい。当該構成によれば、注目画像に含まれる顔の属性(例えば、性別や年齢など)に応じて変形量を最適化した変形処理を行なうことができるため、より一層、自然且つ効果的な顔画像の変形結果が得られる。   The image processing apparatus may include an attribute determining unit that determines the face attribute, and the deformation processing unit may perform different deformations according to the determined face attribute. According to this configuration, it is possible to perform the deformation process with the deformation amount optimized according to the facial attributes (for example, gender, age, etc.) included in the image of interest, and thus a more natural and effective face image. The deformation result is obtained.

画像処理装置は、個人の顔別の変形態様を外部からの入力に従って登録する登録部と、上記注目画像に含まれる顔の個人識別を行なう識別部とを備え、上記変形処理部は、上記識別部によって識別された顔に対応する変形態様が上記登録部によって登録されている場合には、当該識別された顔を含んで設定されている対象領域の画像に、当該識別された顔に対応する変形態様による変形を施すとしてもよい。当該構成によれば、変形処理のタイプ(例えば、小顔化、シャープ化、有名人化など)や変形量などを含む変形態様を、個人の顔毎に好みの内容で登録しておくことができる。その結果、個人の顔の輪郭の違いに基づいた変形であって更にユーザーが好む態様による変形結果を、顔毎に得ることができる。   The image processing apparatus includes a registration unit that registers a deformation mode for each individual face according to an input from the outside, and an identification unit that performs personal identification of a face included in the target image, and the deformation processing unit includes the identification unit When the deformation mode corresponding to the face identified by the unit is registered by the registration unit, the image of the target area set including the identified face corresponds to the identified face. You may perform the deformation | transformation by a deformation | transformation aspect. According to this configuration, it is possible to register the deformation mode including the type of deformation processing (for example, small face, sharpening, celebrity, etc.), the amount of deformation, and the like for each individual face with favorite contents. . As a result, it is possible to obtain, for each face, a deformation result based on a difference in the contour of the individual face and further in a manner preferred by the user.

本発明の技術的思想は、画像処理装置以外によっても実現可能である。例えば、画像処理装置の各部が実行する処理工程を有する画像処理方法の発明や、画像処理装置の各部が実行する機能をコンピューターに実行させるコンピューター読取可能な画像処理プログラムの発明をも把握可能である。   The technical idea of the present invention can be realized by means other than an image processing apparatus. For example, it is possible to grasp an invention of an image processing method having a processing step executed by each part of an image processing apparatus and an invention of a computer-readable image processing program for causing a computer to execute a function executed by each part of the image processing apparatus. .

画像処理装置としてのプリンターの構成を概略的に示す説明図である。FIG. 2 is an explanatory diagram schematically illustrating a configuration of a printer as an image processing apparatus. AAM設定処理を示すフローチャートである。It is a flowchart which shows an AAM setting process. サンプル画像SIの一例を示す説明図である。It is explanatory drawing which shows an example of sample image SI. サンプル画像SIにおける特徴点CPの設定方法の一例を示す説明図である。It is explanatory drawing which shows an example of the setting method of the feature point CP in the sample image SI. サンプル画像SIに設定された特徴点CPの座標の一例を示す説明図である。It is explanatory drawing which shows an example of the coordinate of the feature point CP set to sample image SI. 平均形状sの一例を示す説明図である。Is an explanatory diagram showing an example of the average shape s 0. 形状ベクトルsおよび形状パラメーターpと顔の形状sとの関係を例示した説明図である。It is explanatory drawing which illustrated the relationship between shape vector s i and shape parameter pi, and face shape s. サンプル画像SIのワープWの方法の一例を示す説明図である。It is explanatory drawing which shows an example of the method of the warp W of the sample image SI. 平均顔画像A(x)の一例を示す説明図である。It is explanatory drawing which shows an example of average face image A0 (x). 画像変形処理を示すフローチャートである。It is a flowchart which shows an image deformation process. 注目画像OIにおける顔領域FAの検出結果の一例を示す説明図である。It is explanatory drawing which shows an example of the detection result of the face area FA in the attention image OI. 特徴点CPの初期位置設定処理(Init処理)を示すフローチャートである。It is a flowchart which shows the initial position setting process (Init process) of the feature point CP. グローバルパラメーターの値を変更することによる特徴点CPの仮設定位置の一例を示す説明図である。It is explanatory drawing which shows an example of the temporary setting position of the feature point CP by changing the value of a global parameter. 平均形状画像I(W(x;p))の一例を示す説明図である。It is explanatory drawing which shows an example of the average shape image I (W (x; p)). 特徴点CP設定位置補正処理(Fit処理)を示すフローチャートである。It is a flowchart which shows the feature point CP setting position correction process (Fit process). 輪郭点検出処理の結果の一例を示す説明図である。It is explanatory drawing which shows an example of the result of a contour point detection process. 変形領域CAの設定処理を示すフローチャートである。It is a flowchart which shows the setting process of deformation | transformation area | region CA. 輪郭点OPの周囲に設定された変形領域CAの一例を示す図である。It is a figure which shows an example of the deformation | transformation area | region CA set around the outline point OP. 変形領域CA内の画像に対する変形処理を示すフローチャートである。It is a flowchart which shows the deformation | transformation process with respect to the image in deformation | transformation area | region CA. 特徴点CPの中から選択された選択特徴点SCP等の一例を示す図である。It is a figure which shows an example of the selection feature point SCP etc. which were selected from the feature points CP. 特徴点移動テーブルの一例を示す図である。It is a figure which shows an example of the feature point movement table. 変形領域CA内の画像が変形される様子の一例を示す図である。It is a figure which shows an example of a mode that the image in deformation | transformation area | region CA is deform | transformed. 横顔変形処理を示すフローチャートである。It is a flowchart which shows a profile transformation process. 顔の形状sの向きの変更に応じた移動量の補正を説明する図である。It is a figure explaining correction of the amount of movement according to change of direction of face shape s. 動画変形処理を示すフローチャートである。It is a flowchart which shows a moving image deformation | transformation process. テクスチャー検出処理を示すフローチャートである。It is a flowchart which shows a texture detection process. 年齢層判定処理を示すフローチャートである。It is a flowchart which shows an age group determination process.

以下、本発明の実施例を図面を参照しながら説明する。
1.第1実施例
1‐1.画像処理装置の構成
図1は、本実施形態にかかる画像処理装置としてのプリンター100の構成を概略的に示す説明図である。またプリンター100は、本発明の画像処理方法を実行する装置である。プリンター100は、メモリーカードMC等から取得した画像データに基づき画像を印刷する、いわゆるダイレクトプリントに対応したインクジェット式カラープリンターである。プリンター100は、プリンター100の各部を制御するCPU110と、ROMやRAMによって構成された内部メモリー120と、ボタンやタッチパネルにより構成された操作部140と、液晶ディスプレイにより構成された表示部150と、印刷機構160と、カードインターフェイス(カードI/F)170と、を備えている。プリンター100は、さらに、他の機器(例えばデジタルスチルカメラやコンピューター300)とのデータ通信を行うためのインターフェイス(I/F)180を備える。プリンター100の各構成要素は、バスを介して双方向通信可能に接続されている。
Embodiments of the present invention will be described below with reference to the drawings.
1. 1. First embodiment 1-1. Configuration of Image Processing Device FIG. 1 is an explanatory diagram schematically showing a configuration of a printer 100 as an image processing device according to the present embodiment. The printer 100 is a device that executes the image processing method of the present invention. The printer 100 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 printing. A mechanism 160 and a card interface (card I / F) 170 are provided. The printer 100 further includes an interface (I / F) 180 for performing data communication with other devices (for example, a digital still camera and the computer 300). Each component of the printer 100 is connected via a bus so that bidirectional communication is possible.

印刷機構160は、印刷データに基づき印刷を行う。カードインターフェイス170は、カードスロット172に挿入されたメモリーカードMCとの間でデータのやり取りを行うためのインターフェイスである。なお、本実施例では、メモリーカードMCに画像データを含む画像ファイルが格納されている。   The printing mechanism 160 performs printing based on the 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は、コンピュータープログラムであり、所定のオペレーティングシステムの下で、CPU110により実行されることで画像変形処理を実現する。画像変形処理では、まず、注目画像に含まれる顔画像における所定の特徴部位(例えば、目尻や鼻頭やフェイスライン)の座標位置を検出し、当該検出結果の一部を顔の輪郭に対応する輪郭点として取得する。そして、取得された輪郭点に基づいて定義した領域の画像を対象として変形処理を行なう。画像変形処理については後に詳述する。表示処理部310、および、印刷処理部320についてもCPU110により実行されることでぞれぞれの機能を実現する。   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 and is executed by the CPU 110 under a predetermined operating system to realize image deformation processing. In the image transformation process, first, the coordinate position of a predetermined feature part (for example, the corner of the eye, the nose head, or the face line) in the face image included in the target image is detected, and a part of the detection result corresponds to the contour corresponding to the face contour. Get as a point. Then, deformation processing is performed on the image of the area defined based on the acquired contour point. The image deformation process will be described in detail later. The display processing unit 310 and the print processing unit 320 are also executed by the CPU 110 to realize the respective functions.

画像処理部200は、画像変形処理を実現するためのプログラムモジュールとして、顔領域検出部210と、輪郭点検出部220と、領域設定部230と、変形処理部240と、属性判定部250と、登録部260と、識別部270と、を含んでいる。これら各部の機能についても後述する。   The image processing unit 200 includes a face area detection unit 210, a contour point detection unit 220, an area setting unit 230, a deformation processing unit 240, an attribute determination unit 250, as program modules for realizing image deformation processing. A registration unit 260 and an identification unit 270 are included. The functions of these units will also be 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 printing mechanism 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が格納されている。AAM情報AMIは、後述のAAM設定処理によって予め設定される情報であり、顔の特徴部位の位置検出(輪郭点検出処理とも言う)において参照される。AAM情報AMIの内容については、後述のAAM設定処理の説明において詳述する。また、内部メモリー120には、特徴点移動テーブル420も格納されている。特徴点移動テーブル420は、上記変形処理の際に参照される(後述)。   The internal memory 120 stores AAM information AMI. The AAM information AMI is information set in advance by an AAM setting process, which will be described later, and is referred to in the position detection of a facial feature part (also referred to as a contour point detection process). The contents of the AAM information AMI will be described in detail in the description of AAM setting processing described later. The internal memory 120 also stores a feature point movement table 420. The feature point movement table 420 is referred to during the deformation process (described later).

1‐2.AAM設定処理
図2は、本実施例におけるAAM設定処理の流れを示すフローチャートである。AAM設定処理は、AAM(アクティブアピアランスモデル(Active Appearance Model))と呼ばれる画像のモデル化に用いられる形状モデルおよびテクスチャーモデルを設定する処理である。本実施例において、AAM設定処理は、ユーザーがAAM設定用に用意されたコンピューター300を操作することにより行なわれる。コンピューター300は、CPUとRAMとROMとHDDとディスプレイと入力装置等を有しており、これらがバスによって接続されている。CPUはHDDに記録されたプログラムを読み出し、該プログラムに従った演算処理を実行することにより、コンピューター300が後述するAAM設定処理を実行する。
1-2. AAM Setting Processing 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). In this embodiment, the AAM setting process is performed when the user operates the computer 300 prepared for AAM setting. The computer 300 includes a CPU, a RAM, a ROM, an HDD, a display, an input device, and the like, which are connected by a bus. The CPU reads the program recorded in the HDD and executes arithmetic processing according to the program, whereby the computer 300 executes AAM setting processing described later.

はじめに、ユーザーは、人物の顔を含んだ複数の画像をサンプル画像SIとしてコンピューター300のメモリー(HDD)上に用意する(ステップS110)。
図3は、サンプル画像SIの一例を示す説明図である。図3に示すように、サンプル画像SIは、個性、人種・性別、表情(怒り、笑い、困り、驚き等)、向き(正面向き、上向き、下向き、右向き、左向き等)といった種々の属性に関して互いに相違する顔画像が含まれるように用意される。サンプル画像SIがそのように用意されれば、AAMによってあらゆる顔画像を精度良くモデル化することが可能となり、あらゆる顔画像を対象とした精度の良い輪郭点検出処理(後述)の実行が可能となる。なお、サンプル画像SIは、学習用画像とも呼ばれる。
First, the user prepares a plurality of images including a human face on the memory (HDD) of the computer 300 as sample images SI (step S110).
FIG. 3 is an explanatory diagram showing an example of the sample image SI. As shown in FIG. 3, the sample image SI is related to various attributes such as personality, race / gender, facial expression (anger, laughter, trouble, surprise, etc.), and orientation (front, upward, downward, right, left, etc.). It is prepared to include different face images. If the sample image SI is prepared in such a manner, it is possible to accurately model all face images by AAM, and it is possible to perform accurate contour point detection processing (described later) for all face images. Become. The sample image SI is also called a learning image.

次に、ユーザーの所定の操作によって、コンピューター300は、それぞれのサンプル画像SIに含まれる顔画像に、特徴点CPを設定する(ステップS120)。
図4は、サンプル画像SIにおける特徴点CPの設定方法の一例を示す説明図である。特徴点CPは、顔画像における所定の特徴部位の位置を示す点である。本実施例では、所定の特徴部位として、人物の顔における眉毛上の所定位置(例えば端点や4分割点等、以下同じ)、目の輪郭上の所定位置、鼻筋および小鼻の輪郭上の所定位置、上下唇の輪郭上の所定位置、顎や頬やこめかみの輪郭(フェイスライン)上の所定位置、といった68箇所の部位が設定されている。すなわち、本実施例では、人物の顔に共通して含まれる顔の器官(眉毛、目、鼻、口)およびフェイスラインにおける所定位置を、特徴部位として設定する。図4に示すように、特徴点CPは、コンピューター300がディスプレイに表示したサンプル画像SIにおいてユーザーの操作により画面上で指定された68個の特徴部位を表す位置に設定(配置)される。このように設定された各特徴点CPは各特徴部位に対応しているため、顔画像における特徴点CPの配置は顔の形状を特定していると表現することができる。サンプル画像SIにおける特徴点CPの位置は、座標により特定される。
Next, the computer 300 sets a feature point CP to the face image included in each sample image SI by a predetermined operation of the user (step S120).
FIG. 4 is an explanatory diagram showing an example of a method for setting the feature point CP in the sample 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 positions such as a predetermined position on the contour of the upper and lower lips and a predetermined position on the contour (face line) of the chin, cheeks and temples are set. In other words, in the present embodiment, the facial organs (eyebrows, eyes, nose, mouth) and a predetermined position in the face line that are commonly included in the face of a person are set as the characteristic parts. As shown in FIG. 4, the feature points CP are set (arranged) at positions representing 68 feature parts designated on the screen by a user operation in the sample image SI displayed on the display by the computer 300. 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 specifying the shape of the face. The position of the feature point CP in the sample image SI is specified by coordinates.

図5は、サンプル画像SIに設定された特徴点CPの座標の一例を示す説明図である。図5において、SI(j)(j=1,2,3・・・)は各サンプル画像SIを示しており、CP(k)(k=0,1,・・・,67)は、対応するサンプル画像SIにおける人物の各特徴点CPを示している。つまり特徴点CPには0〜67までの番号kが付されており、一つ一つの番号はそれぞれに決められた特徴部位に対応している。また、CP(k)‐Xは、特徴点CP(k)のX座標を示しており、CP(k)‐Yは、特徴点CP(k)のY座標を示している。特徴点CPの座標としては、顔の大きさと顔の傾き(画像面内の傾き)と顔のX方向およびY方向の位置とのそれぞれについて正規化されたサンプル画像SIにおける所定の基準点(例えば画像の左下の点)を原点とした座標が用いられる。また、本実施例では、1つのサンプル画像SIに複数の人物の顔画像が含まれる場合が許容されており(例えばサンプル画像SI(2)には2人の顔画像が含まれている)、1つのサンプル画像SIにおける各人物は人物IDによって特定される。   FIG. 5 is an explanatory diagram showing an example of the coordinates of the feature point CP set in the sample image SI. In FIG. 5, SI (j) (j = 1, 2, 3,...) Indicates each sample image SI, and CP (k) (k = 0, 1,..., 67) corresponds to Each feature point CP of the person in the sample image SI to be displayed is shown. That is, the feature points CP are assigned numbers k from 0 to 67, and each number corresponds to a feature portion determined for each. 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 (for example, in the sample image SI normalized with respect to the size of the face, the inclination of the face (inclination in the image plane), and the position of the face in the X direction and the Y direction) The coordinates with the origin at the lower left point of the image are used. Further, in the present embodiment, a case where a plurality of human face images are included in one sample image SI is allowed (for example, two sample face images are included in the sample image SI (2)). Each person in one sample image SI is specified by a person ID.

つづいて、コンピューター300は、AAMの形状モデルの設定をおこなう(ステップS130)。具体的には、各サンプル画像SIにおける68個の特徴点CPの座標(X座標およびY座標)により構成される座標ベクトル(図5参照)に対する主成分分析をおこない、特徴点CPの位置により特定される顔の形状sを下記の式(1)によりモデル化する。なお、式(1)で表した形状モデルは、特徴点CPの配置モデルとも呼ぶ。   Subsequently, the computer 300 sets an AAM shape model (step S130). 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 image SI, and specified by the position of the feature point CP. The face shape s to be formed is modeled by the following equation (1). Note that the shape model represented by Expression (1) is also referred to as a feature point CP arrangement model.

上記式(1)において、sは平均形状である。
図6は、平均形状sの一例を示す説明図である。図6(a)および(b)に示すように、平均形状sは、サンプル画像SIの各特徴点CPについての平均位置(平均座標)により特定される平均的な顔の形状を表すモデルである。なお、本実施例では、平均形状sにおいて、外周に位置する特徴点CP(フェイスラインおよび眉毛に対応する特徴点CP、図4参照)を結ぶ直線により囲まれた領域(図6(b)においてハッチングを付して示す)を「平均形状領域BSA」と呼ぶ。平均形状sにおいては、図6(a)に示すように、特徴点CPを頂点とする複数の三角形領域TAが、平均形状領域BSAをメッシュ状に分割するように設定される。
In the above formula (1), s 0 is an average shape.
Figure 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 image SI. is there. In the present embodiment, in the average shape s 0 , a region surrounded by a straight line connecting feature points CP (feature points CP corresponding to face lines and eyebrows, see FIG. 4) located on the outer periphery (FIG. 6B). Are shown 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)において、sは形状ベクトルであり、pは形状ベクトルsの重みを表す形状パラメーターである。形状ベクトルsは、顔の形状sの特性を表すベクトルであり、主成分分析により得られる第i主成分に対応する固有ベクトルである。上記式(1)に示すように、本実施例における形状モデルでは、特徴点CPの配置を表す顔形状sが、平均形状sとn個の形状ベクトルsの線形結合との和としてモデル化される。形状モデルにおいて形状パラメーターpを適切に設定することにより、あらゆる画像における顔の形状sを再現することが可能である。 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 an eigenvector corresponding to the i-th principal component obtained by principal component analysis. 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 a model 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, it is possible to reproduce the face shape s in any image.

図7は、形状ベクトルsおよび形状パラメーターpと、顔の形状sとの関係を例示した説明図である。図7(a)に示すように、顔の形状sを特定するために、寄与率のより大きい主成分に対応する固有ベクトルから順に、累積寄与率に基づき設定された個数n(図7ではn=4)の固有ベクトルが、形状ベクトルsとして採用される。形状ベクトルsのそれぞれは、図7(a)の矢印に示すように、各特徴点CPの移動方向・移動量と対応している。本実施例では、最も寄与率の大きい第1主成分に対応する第1形状ベクトルsは顔の左右振りにほぼ相関するベクトルとなっており、形状パラメーターpを大小させることにより、図7(b)に示すように、顔の形状sの横方向の顔向きが変化する。2番目に寄与率の大きい第2主成分に対応する第2形状ベクトルsは顔の上下振りにほぼ相関するベクトルとなっており、形状パラメーターpを大小させることにより、図7(c)に示すように、顔の形状sの縦方向の顔向きが変化する。また、3番目に寄与率の大きい第3主成分に対応する第3形状ベクトルsは顔の形状の縦横比にほぼ相関するベクトルとなっており、4番目に寄与率の大きい第4主成分に対応する第4形状ベクトルsは口の開きの程度にほぼ相関するベクトルとなっている。 FIG. 7 is an explanatory diagram illustrating the relationship between the shape vector s i, the shape parameter pi, and the face shape s. As shown in FIG. 7A, in order to specify the face shape s, the number n set based on the cumulative contribution rate in order from the eigenvector corresponding to the principal component having the larger contribution rate (in FIG. 7, n = The eigenvector of 4) is adopted as the shape vector s i . Each of the shape vectors s i corresponds to the movement direction / movement amount of each feature point CP, as indicated by the arrows in FIG. In the present embodiment, the first shape vector s 1 corresponding to the first principal component having the largest contribution rate is a vector that is substantially correlated with the left / right swing of the face, and by increasing or decreasing the shape parameter p 1 , FIG. As shown in (b), the horizontal face direction of the face shape s changes. The second shape vector s 2 corresponding to the second principal component having the second largest contribution ratio is a vector that is substantially correlated with the vertical swing of the face, and FIG. 7C is obtained by increasing or decreasing the shape parameter p 2 . As shown in FIG. 4, the vertical face direction of the face shape s changes. The third shape vector s 3 corresponding to the third principal component having the third largest contribution ratio is a vector that is substantially correlated with the aspect ratio of the face shape, and the fourth principal component having the fourth largest contribution ratio. The fourth shape vector s 4 corresponding to is a vector that is substantially correlated with the degree of mouth opening.

このように、形状パラメーターの値は、顔の表情や、顔向きや、形状など顔画像の特徴を表す。形状パラメーターは、特徴部位の座標が既知の顔画像を含む複数のサンプル画像に基づいて算出された特徴量である。また形状モデルは、複数の特徴量に基づいて、顔の輪郭を複数の特徴点CP(フェイスラインおよび眉毛に対応する特徴点CP)の位置によって表現するモデルとも言える。なお、コンピューター300は、形状モデル設定ステップ(ステップS130)において設定した平均形状sおよび形状ベクトルsを、プリンター100に送信する。プリンター100は、送信されたこれらの平均形状sおよび形状ベクトルsの情報を、AAM情報AMI(図1)として内部メモリー120に格納する。 As described above, the value of the shape parameter represents the feature of the face image such as facial expression, face orientation, and shape. The shape parameter is a feature amount calculated based on a plurality of sample images including a face image whose coordinates of the feature part are known. The shape model can also be said to be a model that expresses the contour of a face by the positions of a plurality of feature points CP (feature points CP corresponding to face lines and eyebrows) based on a plurality of feature amounts. The computer 300 transmits the average shape s 0 and the shape vector s i set in the shape model setting step (step S 130) to the printer 100. The printer 100 stores the transmitted information on the average shape s 0 and the shape vector s i in the internal memory 120 as AAM information AMI (FIG. 1).

つづいて、コンピューター300は、AAMのテクスチャーモデルの設定をおこなう(ステップS140)。具体的には、まず、各サンプル画像SIに対して、サンプル画像SIにおける特徴点CPの設定位置が平均形状sにおける特徴点CPの設定位置と等しくなるように、画像変換(以下、「ワープW」とも呼ぶ)を行う。 Subsequently, the computer 300 sets an AAM texture model (step S140). Specifically, first, for each sample image SI, image conversion (hereinafter referred to as “warp”) is performed so that the setting position of the feature point CP in the sample image SI becomes equal to the setting position of the feature point CP in the average shape s 0 . W ”).

図8は、サンプル画像SIのワープWの方法の一例を示す説明図である。各サンプル画像SIにおいては、平均形状sと同様に、外周に位置する特徴点CPにより囲まれた領域をメッシュ状に分割する複数の三角形領域TAが設定される。ワープWは、複数の三角形領域TAのそれぞれについてのアフィン変換の集合である。すなわち、ワープWにおいては、サンプル画像SIにおけるある三角形領域TAの画像は、平均形状sにおける対応する三角形領域TAの画像へとアフィン変換される。ワープWにより、特徴点CPの設定位置が平均形状sにおける特徴点CPの設定位置と等しいサンプル画像SI(以下「サンプル画像SIw」と表す)が生成される。 FIG. 8 is an explanatory diagram showing an example of a method of warping W of the sample image SI. In each sample 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, the image of triangle areas TA in a sample image SI is affine transformed into an image of corresponding triangle areas TA of the average shape s 0. The warp W generates a sample image SI (hereinafter referred to as “sample image SIw”) in which the set position of the feature point CP is equal to the set position of the feature point CP in the average shape s 0 .

なお、各サンプル画像SIwは、平均形状領域BSA(図8においてハッチングを付して示す)を内包する矩形枠を外周とし、平均形状領域BSA以外の領域(以下「マスク領域MA」とも呼ぶ)がマスクされた画像として生成される。平均形状領域BSAとマスク領域MAとを併せた画像領域を基準領域BAと呼ぶ。また、各サンプル画像SIwは、例えば、縦横56画素×56画素のサイズの画像として正規化される。   Each sample image SIw has a rectangular frame containing an average shape area BSA (shown with hatching in FIG. 8) as an outer periphery, and an area other than the average shape area BSA (hereinafter also referred to as “mask area MA”). 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 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 image SIw, and a facial texture (also referred to as “appearance”) A (x) is expressed by the following formula ( 2). The pixel group x is a set of pixels located in the average shape area BSA.

上記式(2)において、A(x)は平均顔画像である。
図9は、平均顔画像A(x)の一例を示す説明図である。平均顔画像A(x)は、ワープWの後のサンプル画像SIw(図8参照)の平均の顔が表された画像である。すなわち、平均顔画像A(x)は、サンプル画像SIwの平均形状領域BSA内の画素群xの画素値(輝度値)の平均をとることにより算出される画像である。従って、平均顔画像A(x)は、平均的な顔の形状における平均的な顔のテクスチャー(見え)を表すモデルである。なお、平均顔画像A(x)は、サンプル画像SIwと同様に、平均形状領域BSAとマスク領域MAとで構成され、例えば、縦横56画素×56画素のサイズの画像として算出される。
In the above formula (2), A 0 (x) is an average face image.
FIG. 9 is an explanatory diagram illustrating an example of the average face image A 0 (x). The average face image A 0 (x) is an image representing the average face of the sample image SIw (see FIG. 8) after the warp W. That is, the average face image A 0 (x) is an image calculated by taking the average of the pixel values (luminance values) of the pixel group x in the average shape area BSA of the sample 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 the average shape area BSA and the mask area MA, similarly to the sample image SIw, and is calculated as an image having a size of 56 pixels × 56 pixels, for example.

テクスチャーモデルを表す上記式(2)において、A(x)はテクスチャーベクトルであり、λはテクスチャーベクトルA(x)の重みを表すテクスチャーパラメーターである。テクスチャーベクトルA(x)は、顔のテクスチャーA(x)の特性を表すベクトルであり、具体的には、主成分分析により得られる第i主成分に対応する固有ベクトルである。すなわち、寄与率のより大きい主成分に対応する固有ベクトルから順に、累積寄与率に基づき設定された個数mの固有ベクトルが、テクスチャーベクトルA(x)として採用される。本実施例では、最も寄与率の大きい第1主成分に対応する第1テクスチャーベクトルA(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 is specifically 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 the larger contribution rate. In the present embodiment, the first texture vector A 1 (x) corresponding to the first principal component having the largest contribution rate is a vector that is substantially correlated with a change in face color (also regarded as a gender difference).

上記式(2)に示すように、本実施例におけるテクスチャーモデルでは、顔の見えを表す顔のテクスチャーA(x)が、平均顔画像A(x)とm個のテクスチャーベクトルA(x)の線形結合との和としてモデル化される。テクスチャーモデルにおいてテクスチャーパラメーターλを適切に設定することにより、あらゆる画像における顔のテクスチャーA(x)を再現することが可能である。
なお、コンピューター300は、テクスチャーモデル設定ステップ(ステップS140)において設定した平均顔画像A(x)およびテクスチャーベクトルA(x)を、プリンター100に送信する。プリンター100は、送信されたこれらの平均顔画像A(x)およびテクスチャーベクトルA(x)の情報を、AAM情報AMI(図1)として内部メモリー120に格納する。
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.
The computer 300 transmits the average face image A 0 (x) and the texture vector A i (x) set in the texture model setting step (step S140) to the printer 100. The printer 100 stores the transmitted information of the average face image A 0 (x) and the texture vector A i (x) in the internal memory 120 as AAM information AMI (FIG. 1).

以上説明したAAM設定処理(図2)により、顔の形状をモデル化する形状モデルと、顔のテクスチャーをモデル化するテクスチャーモデルが設定される。設定された形状モデルとテクスチャーモデルとを組み合わせることにより、すなわち合成されたテクスチャーA(x)に対して平均形状sから形状sへの変換(図8に示したワープ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. 8). Thus, it is possible to reproduce the shape and texture of any face image.

1‐3.画像変形処理
図10は、本実施例における画像変形処理を示すフローチャートである。画像変形処理は、概略的には、注目画像に含まれる顔の輪郭に対応する輪郭点を検出する処理(ステップS240)と、検出された輪郭点の位置に基づいて上記顔の少なくとも一部を含む領域を変形処理の対象領域として設定する処理(ステップS250)と、当該設定された領域内の画像の変形を行う処理(ステップS260)とを含む。
1-3. Image Deformation Processing FIG. 10 is a flowchart showing image deformation processing in the present embodiment. In general, the image transformation process includes a process of detecting a contour point corresponding to the contour of the face included in the target image (step S240), and at least a part of the face based on the position of the detected contour point. The process includes a process of setting the area to be included as a target area for the deformation process (step S250) and a process of deforming the image in the set area (step S260).

はじめに、画像処理部200(図1)は、画像変形処理の対象となる注目画像を表す画像データを取得する(ステップS210)。本実施例のプリンター100では、カードスロット172にメモリーカードMCが挿入されると、メモリーカードMCに格納された画像ファイルのサムネイル画像が表示部150に表示される。処理の対象となる1つまたは複数の画像は、操作部140を介してユーザーにより選択される。画像処理部200は、選択された1つまたは複数の画像に対応する画像データを含む画像ファイルをメモリーカードMCより取得して内部メモリー120の所定の領域に格納する。なお、取得された画像データを注目画像データと呼び、注目画像データの表す画像を注目画像OIと呼ぶ。   First, the image processing unit 200 (FIG. 1) acquires image data representing a target image that is a target of image deformation processing (step S210). 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. One or more images to be processed are selected by the user via the operation unit 140. 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. The acquired image data is called attention image data, and the image represented by the attention image data is called attention image OI.

次に、画像処理部200は、変形処理のタイプや変形度合い等(変形態様)を設定する(ステップS220)。この場合、画像処理部200は、変形態様を設定するためのユーザーインターフェイスを表示部150に表示するように表示処理部310に指示し、当該ユーザーインターフェイスを通じてユーザーにより指定された変形処理のタイプや変形度合いを選択し、処理に用いる変形処理のタイプや変形度合いとして設定する。当該ユーザーインターフェイスを介して設定され得る変形処理のタイプとしては、例えば、顔の形状を全体的に小さくする「小顔化」、顔の形状を細く(シャープに)する「シャープ化」、顔を特定の俳優や歌手等の有名人に似せるように変形する「有名人化」等がある。また、ユーザーは、当該ユーザーインターフェイスを介して変形処理の変形度合い(変形量)を、例えば、「強」、「中」、「弱」の3段階の中から選択して指示することができる。   Next, the image processing unit 200 sets the type of deformation process, the degree of deformation, etc. (deformation mode) (step S220). In this case, the image processing unit 200 instructs the display processing unit 310 to display the user interface for setting the deformation mode on the display unit 150, and the type and deformation of the deformation process designated by the user through the user interface. The degree is selected and set as the type of deformation process and the degree of deformation used for the process. The types of deformation processing that can be set via the user interface include, for example, “small face” for reducing the face shape as a whole, “sharpening” for reducing the face shape (sharpening), There are "celebrityization" that transforms to resemble a celebrity such as a specific actor or singer. In addition, the user can select and instruct the degree of deformation (deformation amount) of the deformation process from, for example, three levels of “strong”, “medium”, and “weak” via the user interface.

顔領域検出部210(図1)は、注目画像OIに含まれる顔画像の少なくとも一部を含む画像領域を顔領域FAとして検出する(ステップS230)。顔領域FAの検出は、公知の顔検出手法を用いて行うことができる。公知の顔検出手法としては、例えば、パターンマッチングによる手法や肌色領域抽出による手法、サンプル画像を用いた学習(例えばニューラルネットワークを用いた学習や、ブースティングを用いた学習、サポートベクターマシーンを用いた学習等)により設定される学習データを用いる手法等がある。   The face area detection unit 210 (FIG. 1) detects an image area including at least a part of the face image included in the target image OI as the face area FA (step S230). 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 images (for example, learning using neural networks, learning using boosting, and support vector machines). For example, a method using learning data set by learning).

図11は、注目画像OIにおける顔領域FAの検出結果の一例を示す説明図である。図11には、注目画像OIにおいて検出された顔領域FAが示されている。本実施例では、おおよそ、顔の上下方向は額から顎まで、左右方向は両耳の外側まで含む矩形の領域が顔領域FAとして検出されるような顔検出手法が用いられている。   FIG. 11 is an explanatory diagram illustrating an example of a detection result of the face area FA in the target image OI. FIG. 11 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.

輪郭点検出部220(図1)は、注目画像OIに含まれる顔の輪郭点検出処理を行なう(ステップS240)。この輪郭点検出処理は、大きく分けて、第一段階としての特徴点CPの初期位置設定処理(Init処理と呼ぶ)と、第二段階としての特徴点CPの設定位置補正処理(Fit処理と呼ぶ)とによって構成される。
図12は、本実施例におけるInit処理を示すフローチャートである。Init処理では、まず、輪郭点検出部220は、顔領域FAに対する顔画像の大きさ、傾き、上下方向の位置および左右方向の位置を表すグローバルパラメーターの値を種々変更して、特徴点CP(番号k=0〜67までの68個の特徴点CP)を注目画像OI上の仮設定位置に設定する(ステップS310)。
The contour point detection unit 220 (FIG. 1) performs processing for detecting the contour point of the face included in the target image OI (step S240). This contour point detection process is broadly divided into an initial position setting process (referred to as Init process) of the feature point CP as the first stage and a set position correction process (referred to as Fit process) of the feature point CP as the second stage. ).
FIG. 12 is a flowchart showing Init processing in the present embodiment. In the Init processing, first, the contour point detection unit 220 changes various values of global parameters representing the size, inclination, vertical position, and horizontal position of the face image with respect to the face area FA to obtain the feature point CP ( 68 feature points CP (number k = 0 to 67) are set as temporary setting positions on the target image OI (step S310).

図13は、グローバルパラメーターの値を変更することによる特徴点CPの仮設定位置の一例を示す説明図である。図13(a)および図13(b)には、注目画像OIにおける特徴点CPおよび特徴点CPをつないで形成されるメッシュを示している。特徴点CPをつないで形成されるメッシュは、上述したように特徴点CPを頂点とする複数の三角形領域TAの集合である(図6(a)等参照)。輪郭点検出部220は、図13(a)および図13(b)の中央に示すように、平均形状sにおける特徴点CPの配置と等しい特徴点CPの配置を持ったメッシュであって、最も平均的なグローバルパラメーターの組み合わせに応じて顔領域FAに対する大きさ、傾き、位置を調整したメッシュを設定する。例えば、顔領域FAに対する大きさを表す3段階(大きい、標準、小さい)のグローバルパラメーターと、顔領域FAに対する上下方向の位置を表す3段階(上、中央、下)のグローバルパラメーターと、顔領域FAに対する左右方向の位置を表す3段階(左、中央、右)のグローバルパラメーターと、顔領域FAに対する傾きを表す3段階(反時計回り(−)に15度、0度、時計回り(+)に15度)のグローバルパラメーターとが存在するとする。この場合、最も平均的なグローバルパラメーターの組み合わせとは、顔領域FAに対する大きさは「標準」、顔領域FAに対する上下方向の位置および左右方向の位置はそれぞれ「中央」、かつ顔領域FAに対する傾きは「0度」を示すグローバルパラメーターの組み合わせを言う。本実施例では、図13(a)および図13(b)の中央に示すようなメッシュを構成する特徴点CPの設定位置(仮設定位置)を、「基準仮設定位置」とも呼ぶ。 FIG. 13 is an explanatory diagram showing an example of a temporary setting position of the feature point CP by changing the value of the global parameter. FIGS. 13A and 13B show a mesh formed by connecting feature points CP and feature points CP in the target image OI. The mesh formed by connecting the feature points CP is a set of a plurality of triangular areas TA having the feature points CP as vertices as described above (see FIG. 6A, etc.). Contour point detecting section 220, as shown in the middle shown in FIG. 13 (a) and 13 (b), a mesh having a configuration and placement equal characteristic point CP of the characteristic points CP of the average shape s 0, A mesh whose size, inclination, and position are adjusted with respect to the face area FA is set according to the combination of the most average global parameters. For example, three levels (large, standard, and small) of global parameters representing the size of the face area FA, three levels (upper, middle, and lower) of global parameters representing the vertical position of the face area FA, and the face area Three levels (left, center, right) of global parameters representing the left-right position relative to the FA, and three levels (15 degrees, 0 degrees, and clockwise (+) counterclockwise (-)) representing the inclination relative to the face area FA. 15 degrees) global parameter exists. In this case, the average global parameter combination is “standard” for the face area FA, “vertical” and “left” for the face area FA, and “tilt” for the face area FA. Refers to a combination of global parameters indicating “0 degrees”. In the present embodiment, the setting position (temporary setting position) of the feature point CP constituting the mesh as shown in the center of FIGS. 13A and 13B is also referred to as “reference temporary setting position”.

輪郭点検出部220は、また、基準仮設定位置に対して、グローバルパラメーターの値を種々変更させた複数の仮設定位置を設定する。グローバルパラメーター(大きさ、傾き、上下方向の位置および左右方向の位置)を変更することは、注目画像OIにおいて特徴点CPにより形成されるメッシュが拡大・縮小、傾きを変更、並行移動することに相当する。従って、輪郭点検出部220は、図13(a)に示すように、基準仮設定位置のメッシュを所定倍率で拡大または縮小したメッシュを形成するような仮設定位置(基準仮設定位置の図の下および上に示す)や、所定角度だけ時計回りまたは半時計回りに傾きを変更したメッシュを形成するような仮設定位置(基準仮設定位置の図の右および左に示す)を設定する。また、輪郭点検出部220は、基準仮設定位置のメッシュに対して、拡大・縮小および傾きの変更を組み合わせた変換を行ったメッシュを形成するような仮設定位置(基準仮設定位置の図の左上、左下、右上、右下に示す)も設定する。   The contour point detection unit 220 also sets a plurality of temporary setting positions obtained by changing various global parameter values with respect to the reference temporary setting position. Changing the global parameters (size, inclination, vertical position and horizontal position) means that the mesh formed by the feature point CP in the target image OI is enlarged / reduced, the inclination is changed, and the parallel movement is performed. Equivalent to. Therefore, as shown in FIG. 13A, the contour point detection unit 220 forms a temporary setting position (a reference temporary setting position in the drawing) that forms a mesh obtained by enlarging or reducing the mesh at the reference temporary setting position at a predetermined magnification. A temporary setting position (shown on the right and left in the drawing of the reference temporary setting position) that forms a mesh whose inclination is changed clockwise or counterclockwise by a predetermined angle. Further, the contour point detection unit 220 forms a temporary setting position (a reference temporary setting position in the figure of the reference temporary setting position) that forms a mesh obtained by performing a combination of enlargement / reduction and inclination change on the mesh at the reference temporary setting position. Also set (upper left, lower left, upper right, lower right).

また、図13(b)に示すように、輪郭点検出部220は、基準仮設定位置のメッシュを所定量だけ上または下に並行移動したメッシュを形成するような仮設定位置(基準仮設定位置の図の上および下に示す)や、左または右に並行移動したメッシュを形成するような仮設定位置(基準仮設定位置の図の左および右に示す)を設定する。また、輪郭点検出部220は、基準仮設定位置のメッシュに対して、上下および左右の並行移動を組み合わせた変換を行ったメッシュを形成するような仮設定位置(基準仮設定位置の図の左上、左下、右上、右下に示す)も設定する。   Also, as shown in FIG. 13B, the contour point detection unit 220 forms a temporary setting position (reference temporary setting position) that forms a mesh that has been translated upward or downward by a predetermined amount from the mesh at the reference temporary setting position. And a temporary setting position (shown on the left and right of the reference temporary setting position diagram) that forms a mesh moved in parallel to the left or right. Further, the contour point detection unit 220 forms a temporary setting position (upper left of the figure of the reference temporary setting position) that forms a mesh obtained by performing a combination of vertical and horizontal parallel movements on the mesh of the reference temporary setting position. , Lower left, upper right, and lower right).

輪郭点検出部220は、図13(a)に示す基準仮設定位置以外の8つの仮設定位置のそれぞれにおけるメッシュに対して図13(b)に示す上下左右の並行移動が実行される仮設定位置も設定する。従って、本実施例では、上述したように夫々に3段階の値を持つ4つのグローバルパラメーター(大きさ、傾き、上下方向の位置、左右方向の位置)を組み合わせたことにより設定される80通り(=3×3×3×3−1)の仮設定位置と基準仮設定位置との、合計81通りの仮設定位置が設定される。   The contour point detection unit 220 performs temporary setting in which vertical and horizontal parallel movements illustrated in FIG. 13B are performed on the mesh at each of the eight temporary setting positions other than the reference temporary setting positions illustrated in FIG. Also set the position. Therefore, in the present embodiment, as described above, there are 80 patterns set by combining four global parameters (size, inclination, vertical position, horizontal position) each having three levels of values ( = 3 × 3 × 3 × 3-1) temporary setting positions and reference temporary setting positions, a total of 81 temporary setting positions are set.

輪郭点検出部220は、設定された各仮設定位置に対応する平均形状画像I(W(x;p))を生成する(ステップS320)。
図14は、平均形状画像I(W(x;p))の一例を示す説明図である。平均形状画像I(W(x;p))は、注目画像OIにおける特徴点CPの配置が平均形状sにおける特徴点CPの配置と等しくなるような変換によって算出される。
The contour point detection unit 220 generates an average shape image I (W (x; p)) corresponding to each set temporary setting position (step S320).
FIG. 14 is an explanatory diagram showing an example of the average shape image I (W (x; p)). The average shape image I (W (x; p) ) , the arrangement of the characteristic points CP in the target image OI is calculated by equal such conversion and disposition of the characteristic points CP of the average shape s 0.

平均形状画像I(W(x;p))を算出するための変換は、サンプル画像SIw算出のための変換(図8参照)と同様に、三角形領域TA毎のアフィン変換の集合であるワープWにより行われる。具体的には、注目画像OIに仮設定された特徴点CP(図13参照)によって変換対象領域(メッシュの外周に位置する特徴点CPにより囲まれた領域)が特定され、この変換対象領域に対して三角形領域TA毎のアフィン変換が行われることにより、平均形状画像I(W(x;p))が算出される。本実施例では、平均形状画像I(W(x;p))は、平均顔画像A(x)と同様に平均形状領域BSAおよびマスク領域MAにより構成され、平均顔画像A(x)と同一サイズ(例えば、縦横56画素×56画素)の画像として算出される。 The transformation for calculating the average shape image I (W (x; p)) is a warp W that is a set of affine transformations for each triangular area TA, similarly to the transformation for calculating the sample image SIw (see FIG. 8). Is done. Specifically, a conversion target region (region surrounded by the feature point CP located on the outer periphery of the mesh) is specified by the feature point CP (see FIG. 13) temporarily set in the target image OI, and the conversion target region is On the other hand, an average shape image I (W (x; p)) is calculated by performing affine transformation for each triangular area TA. 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) Is calculated as an image of the same size (for example, 56 pixels × 56 pixels).

なお上述したように、画素群xは、平均形状sにおける平均形状領域BSAに位置する画素の集合である。本実施例では、平均形状画像は、形状パラメーターpによるワープW(x;p)によって生成された画像(画素群)Iという意味で、平均形状画像I(W(x;p))と表現している。図14には、図13(a)に示した9個の仮設定位置に対応する9個の平均形状画像I(W(x;p))を示している。 Incidentally, as described above, the pixel group x, is a set of pixels located in the average shape area BSA of the average shape s 0. In this embodiment, the average shape image is expressed as an average shape image I (W (x; p)) in the sense of an image (pixel group) I generated by the warp W (x; p) with the shape parameter p. ing. FIG. 14 shows nine average shape images I (W (x; p)) corresponding to the nine temporarily set positions shown in FIG.

輪郭点検出部220は、各仮設定位置に対応する平均形状画像I(W(x;p))と平均顔画像A(x)との差分画像Ieを算出する(ステップS330)。特徴点CPの仮設定位置は81種類設定されているため、輪郭点検出部220は、81個の差分画像Ieを算出する。 The contour point detection unit 220 calculates a difference image Ie between the average shape image I (W (x; p)) corresponding to each temporarily set position and the average face image A 0 (x) (step S330). Since 81 types of temporarily set positions of the feature points CP are set, the contour point detection unit 220 calculates 81 difference images Ie.

輪郭点検出部220は、各差分画像Ieの画素値からノルム(ユークリッド距離)を算出し、ノルムの値が最も小さい差分画像Ieに対応する仮設置位置(以下「ノルム最小仮設定位置」とも呼ぶ)を、注目画像OIにおける特徴点CPの初期位置として設定する(ステップS340)。ノルムを算出するための差分画像Ieの画素値は輝度値であってもよいしRGB値であってもよい。以上により、Init処理が完了する。Init処理後、輪郭点検出部220はFit処理を実行する。Fit処理では、輪郭点検出部220は、Init処理で初期位置として設定された特徴点CPの設定位置の補正を行う。   The contour point detection unit 220 calculates a norm (Euclidean distance) from the pixel value of each difference image Ie, and is also referred to as a temporary installation position corresponding to the difference image Ie having the smallest norm value (hereinafter also referred to as “norm minimum temporary setting position”). ) Is set as the initial position of the feature point CP in the target image OI (step S340). The pixel value of the difference image Ie for calculating the norm may be a luminance value or an RGB value. Thus, the Init process is completed. After the Init process, the contour point detection unit 220 executes a Fit process. In the Fit process, the contour point detection unit 220 corrects the set position of the feature point CP set as the initial position in the Init process.

図15は、Fit処理を示すフローチャートである。
輪郭点検出部220は、注目画像OIに設定されている特徴点CPに基づいて平均形状画像I(W(x;p))を算出する(ステップS410)。平均形状画像I(W(x;p))の算出方法は、Init処理におけるステップS320と同様である。
FIG. 15 is a flowchart showing the Fit process.
The contour point detection unit 220 calculates the average shape image I (W (x; p)) based on the feature point CP set in the target image OI (step S410). The calculation method of the average shape image I (W (x; p)) is the same as that in step S320 in the Init process.

輪郭点検出部220は、ステップS410で生成された平均形状画像I(W(x;p))と平均顔画像A(x)との差分画像Ieを算出する(ステップS420)。輪郭点検出部220は、ステップS420で算出された差分画像Ieに基づき、Fit処理が収束したか否かを判定する(ステップS430)。輪郭点検出部220は、差分画像Ieのノルムを算出し、ノルムの値が予め設定されたしきい値より小さい場合には収束したと判定し、ノルムの値がしきい値以上の場合には未だ収束していないと判定する。なお、輪郭点検出部220は、算出された差分画像Ieのノルムの値が前回のステップS430において算出されたノルムの値よりも小さい場合には収束したと判定し、前回値以上である場合には未だ収束していないと判定してもよい。あるいは、輪郭点検出部220は、しきい値による判定と前回値との比較による判定とを組み合わせて収束判定を行うとしてもよい。例えば、輪郭点検出部220は、算出されたノルムの値が、しきい値より小さく、かつ、前回値より小さい場合にのみ収束したと判定し、それ以外の場合には未だ収束していないと判定するとしてもよい。 The contour point detection unit 220 calculates a difference image Ie between the average shape image I (W (x; p)) generated in step S410 and the average face image A 0 (x) (step S420). The contour point detection unit 220 determines whether the Fit process has converged based on the difference image Ie calculated in Step S420 (Step S430). The contour point detection unit 220 calculates the norm of the difference image Ie, determines that the norm value is converged when the norm value is smaller than a preset threshold value, and determines that the norm value is equal to or greater than the threshold value. Judge that it has not converged yet. Note that the contour point detection unit 220 determines that the calculated norm value of the difference image Ie has converged when the norm value is smaller than the norm value calculated in the previous step S430, and if it is equal to or greater than the previous value. May be determined as not yet converged. Alternatively, the contour point detection unit 220 may perform the convergence determination by combining the determination based on the threshold value and the determination based on the comparison with the previous value. For example, the contour point detection unit 220 determines that the calculated norm value has converged only when it is smaller than the threshold value and smaller than the previous value, and otherwise has not yet converged. It may be determined.

ステップS430の収束判定において未だ収束していないと判定した場合、輪郭点検出部220はパラメーター更新量ΔPを算出する(ステップS440)。パラメーター更新量ΔPは、4個のグローバルパラメーター(全体としての大きさ、傾き、X方向位置、Y方向位置)、および、特徴量であるn個の形状パラメーターp(i=1〜nの整数。)の値の変更量を意味している。なお、特徴点CPを初期位置に設定した直後においては、グローバルパラメーターは、Init処理(図12)において決定された値が設定されている。また、このときの特徴点CPの初期位置と平均形状sの特徴点CPの設定位置との相違は、全体としての大きさ、傾き、位置の相違に限られるため、形状モデルにおける形状パラメーターpの値はすべてゼロである。 If it is determined in step S430 that the convergence has not yet been completed, the contour point detector 220 calculates the parameter update amount ΔP (step S440). The parameter update amount ΔP includes four global parameters (total size, inclination, X direction position, Y direction position), and n shape parameters p i (i = 1 to n) that are feature amounts. .) Means the change amount of the value. Note that immediately after the feature point CP is set to the initial position, the value determined in the Init process (FIG. 12) is set as the global parameter. Further, difference between the initial position of the characteristic point CP and sets the position of the characteristic points CP of the average shape s 0 in this case, the overall size, the tilt, because it is limited to the difference in position, shape parameters in the shape model p The values of i 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.

式(3)におけるアップデートマトリックスRは、差分画像Ieに基づきパラメーター更新量ΔPを算出するために予め学習により設定されたM行N列のマトリックスであり、AAM情報AMI(図1)として内部メモリー120に格納されている。本実施例では、アップデートマトリックスRの行数Mは、グローバルパラメーターの数(4個)と、形状パラメーターpの数(n個)との和((4+n)個)に等しく、列数Nは、平均顔画像A(x)の平均形状領域BSA内の画素数(56画素×56画素−マスク領域MAの画素数)に等しい。アップデートマトリックス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 of rows M of the update matrix R includes a number of global parameters (4), equal to the sum of the number of shape parameters p i (n-number) ((4 + n) pieces), the number of columns N is , Equal to the number of pixels in the average shape area BSA of the average face image A 0 (x) (56 pixels × 56 pixels−the number of pixels in the mask area MA). The update matrix R is calculated by the following formulas (4) and (5).

式(4)および(5)における関数Wは、ワープW(x;p)を指し、変数Pは、形状パラメーターpを指し、Tは転置行列を意味する。 Function W in the formula (4) and (5), the warp W; refers to (x p), the variable P refers to the shape parameter p i, T denotes a transposed matrix.

輪郭点検出部220は、算出したパラメーター更新量ΔPに基づきパラメーター(4個のグローバルパラメーターおよびn個の形状パラメーター)を更新する(ステップS450)。これにより、注目画像OIにおける特徴点CPの設定位置が補正(更新)される。輪郭点検出部220は、差分画像Ieのノルムが小さくなるように特徴点CPの設定位置を補正する。すなわち、上記n個の形状パラメーターをパラメーター更新量ΔPで更新することで、形状モデルの上記式(1)に従って新たな形状sが生成されるため、輪郭点検出部220は、当該生成された形状sにおける特徴点CPを注目画像OIに設定する。このとき、輪郭点検出部220は、当該生成された形状sの大きさ、傾き、位置を、上記パラメーター更新量ΔPで更新した4個のグローバルパラメーターに応じて調整した上で、特徴点CPを注目画像OIに設定する。このようにパラメーターの更新に応じて注目画像OIに設定された特徴点CPの位置が、補正後の特徴点CPの設定位置である。   The contour point detection unit 220 updates parameters (four global parameters and n shape parameters) based on the calculated parameter update amount ΔP (step S450). Thereby, the setting position of the feature point CP in the target image OI is corrected (updated). The contour point detection unit 220 corrects the setting position of the feature point CP so that the norm of the difference image Ie becomes small. That is, by updating the n shape parameters with the parameter update amount ΔP, a new shape s is generated according to the equation (1) of the shape model. The feature point CP at s is set as the target image OI. At this time, the contour point detection unit 220 adjusts the size, inclination, and position of the generated shape s according to the four global parameters updated with the parameter update amount ΔP, and then sets the feature point CP. Set to attention image OI. Thus, the position of the feature point CP set in the attention image OI in accordance with the parameter update is the set position of the corrected feature point CP.

パラメーターの更新の後には、再度、特徴点CPの設置位置が補正された注目画像OIからの平均形状画像I(W(x;p))の算出(ステップS410)、差分画像Ieの算出(ステップS420)、差分画像Ieに基づく収束判定(ステップS430)が行われる。再度の収束判定においても収束していないと判定された場合には、さらに、差分画像Ieに基づくパラメーター更新量ΔPの算出(ステップS440)、パラメーターの更新による特徴点CPの設定位置補正(ステップS450)が行われる。   After the parameter update, the average shape image I (W (x; p)) is calculated again from the target image OI in which the installation position of the feature point CP is corrected (step S410), and the difference image Ie is calculated (step S420), a convergence determination based on the difference image Ie (step S430) is performed. If it is determined that the convergence has not been made in the convergence determination again, the parameter update amount ΔP based on the difference image Ie is calculated (step S440), and the setting position correction of the feature point CP by the parameter update (step S450). ) Is performed.

図15のステップS410からS450までの処理が繰り返し実行されると、注目画像OIにおける各特徴部位に対応する特徴点CPの位置は実際の特徴部位の位置に全体として近づいていき、ある時点で収束判定(ステップS430)において収束したと判定される。収束判定において収束したと判定されると、輪郭点検出処理が完了する(ステップS460)。このとき設定されているグローバルパラメーターおよび形状パラメーターの値により特定される特徴点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 as a whole, and converges at a certain time. In the determination (step S430), it is determined that convergence has occurred. When it is determined in the convergence determination that the convergence has been completed, the contour point detection process is completed (step S460). The setting position of the feature point CP specified by the values of the global parameter and the shape parameter set at this time is specified as the setting position of the feature point CP in the final target image OI.

図16は、輪郭点検出処理の結果の一例を示す説明図である。図16には、注目画像OIにおいて最終的に特定された特徴点CP(番号k=0〜67までの68個の特徴点CP)の設定位置が示されている。特徴点CPの設定位置により、注目画像OIに含まれる顔の特徴部位(人物の顔の器官(眉毛、目、鼻、口)およびフェイスラインにおける所定位置)の座標位置が特定される。そのため、輪郭点検出部220は、収束判定(ステップS430)において収束したと判定した時に、特徴点CPの設定位置のうち、外周に位置する特徴点CP(フェイスラインおよび眉毛に対応する特徴点CP)の設定位置を、注目画像OIにおける顔の輪郭点OPの座標位置として取得し、輪郭点検出処理を完了させる。   FIG. 16 is an explanatory diagram illustrating an example of a result of the contour point detection process. FIG. 16 shows setting positions of feature points CP (68 feature points CP from number k = 0 to 67) finally specified in the target image OI. Based on the set position of the feature point CP, the coordinate position of the facial feature part (predetermined position in the human face organs (eyebrows, eyes, nose, mouth) and face line) included in the target image OI is specified. Therefore, when the contour point detection unit 220 determines that the convergence has been made in the convergence determination (step S430), the feature point CP (the feature point CP corresponding to the face line and the eyebrows) located on the outer periphery among the set positions of the feature points CP. ) Is acquired as the coordinate position of the contour point OP of the face in the target image OI, and the contour point detection process is completed.

領域設定部230(図1)は、上記ステップS240で検出された輪郭点OPの位置に基づいて、当該輪郭点OPで囲まれた領域よりも広い領域であって顔の少なくとも一部を含む領域を、変形処理の対象領域として設定する(ステップS250)。以下では、ステップS250で設定する対象領域を、変形領域CAと呼ぶ。   Based on the position of the contour point OP detected in step S240, the region setting unit 230 (FIG. 1) is a region that is wider than the region surrounded by the contour point OP and includes at least a part of the face. Is set as a target area for deformation processing (step S250). Hereinafter, the target area set in step S250 is referred to as a deformation area CA.

図17は、ステップS250の処理の詳細を示したフローチャートである。
図18は、当該ステップS250の処理によって注目画像OIに設定される変形領域CAを例示している。まず、領域設定部230は、注目画像OIにおいて、輪郭点OPに囲まれた領域内に基準点SPを設定する(ステップS510)。基準点SPとは、輪郭点OPに囲まれた領域のほぼ中心に相当する点である。本実施例では、顔領域FAの重心を基準点SPとして設定する。ただし領域設定部230は、注目画像OIにおいて設定された特徴点CPのうち、例えば、鼻の所定位置に該当する特徴点CPの位置を、基準点SPとしてもよい。
FIG. 17 is a flowchart showing details of the process in step S250.
FIG. 18 exemplifies the deformation area CA set in the attention image OI by the process of step S250. First, the region setting unit 230 sets a reference point SP in a region surrounded by the contour point OP in the target image OI (step S510). The reference point SP is a point corresponding to approximately the center of the region surrounded by the contour point OP. In this embodiment, the center of gravity of the face area FA is set as the reference point SP. However, the region setting unit 230 may use, for example, the position of the feature point CP corresponding to a predetermined position of the nose among the feature points CP set in the attention image OI as the reference point SP.

次に、領域設定部230は、基準点SPと各輪郭点OPとを結ぶ各線分Lを生成するとともに、各線分Lを、各輪郭点OPから外側へ所定距離だけ延長する(ステップS520)。ここで言う所定距離とは、例えば、顔領域FAのサイズの10%程度の長さを言う。顔領域FAのサイズとは、例えば、顔領域FAの縦幅と横幅との平均値である。なお、顔領域FAの縦幅とは、顔の高さ方向(上下方向)における顔領域FAの幅であり、顔領域FAの横幅とは、顔の横方向(左右方向)における顔領域FAの幅である。
領域設定部230は、上記ステップS520で延長した各線分Lの端部(基準点SPではない端部)に、外枠点PPを設定する(ステップS530)。つまり、上記延長した各線分Lの端部を各外枠点PPとする。
Next, the region setting unit 230 generates each line segment L connecting the reference point SP and each contour point OP, and extends each line segment L outward from each contour point OP by a predetermined distance (step S520). The predetermined distance here refers to a length of about 10% of the size of the face area FA, for example. The size of the face area FA is, for example, an average value of the vertical width and the horizontal width of the face area FA. The vertical width of the face area FA is the width of the face area FA in the face height direction (vertical direction), and the horizontal width of the face area FA is the width of the face area FA in the horizontal direction (left and right direction) of the face. Width.
The region setting unit 230 sets the outer frame point PP at the end of each line segment L extended at step S520 (the end that is not the reference point SP) (step S530). That is, the end of each extended line segment L is defined as each outer frame point PP.

ただし、各輪郭点OPに対応する各外枠点PPの設定方法は、上述した手法に限られない。つまり、各外枠点PPは、各輪郭点OPとの所定の位置関係に基づいて各輪郭点OPの外側に設定される点である。
領域設定部230は、隣接する外枠点PP同士を線分で結ぶことにより、外枠点PPで囲まれた領域を設定し、かかる領域を変形領域CAとする(ステップS540)。
However, the method of setting each outer frame point PP corresponding to each contour point OP is not limited to the method described above. That is, each outer frame point PP is a point set outside each contour point OP based on a predetermined positional relationship with each contour point OP.
The area setting unit 230 sets an area surrounded by the outer frame points PP by connecting adjacent outer frame points PP with a line segment, and sets the area as a deformation area CA (step S540).

図18では、黒丸で表した各輪郭点OPの外側に、白丸で各外枠点PPを示している。このように外枠点PPで囲まれた変形領域CAの形状は、輪郭点OPで囲まれた領域の形状に沿った形状となっている。つまり変形領域CAは、注目画像OIに含まれている顔の形状を詳細に反映した形となっている。   In FIG. 18, each outer frame point PP is indicated by a white circle outside each contour point OP indicated by a black circle. Thus, the shape of the deformation area CA surrounded by the outer frame point PP is a shape along the shape of the area surrounded by the contour point OP. That is, the deformation area CA has a shape that reflects in detail the shape of the face included in the target image OI.

変形処理部240(図1)は、変形領域CA内の少なくとも一部の画像の変形を行なう(ステップS260)。
図19は、ステップS260の処理の詳細を示したフローチャートである。まず、変形処理部240は、変形領域CA内の画像に対する変形処理の際に移動対象とする特徴点CPを、上記輪郭点検出処理で注目画像OIにおいて設定位置が最終的に特定された特徴点CP(輪郭点OPを含む特徴点CP)の中から、上記ステップS220(図10)で設定された変形処理のタイプに応じて選択する(ステップS610)。
The deformation processing unit 240 (FIG. 1) deforms at least a part of the image in the deformation area CA (step S260).
FIG. 19 is a flowchart showing details of the process in step S260. First, the deformation processing unit 240 sets the feature point CP that is a movement target in the deformation process for the image in the deformation area CA to the feature point whose setting position is finally identified in the target image OI by the contour point detection process. The CP (feature point CP including the contour point OP) is selected according to the type of deformation processing set in step S220 (FIG. 10) (step S610).

上述したように、変形処理のタイプは、「小顔化」、「シャープ化」、「有名人化」等の中からユーザーが入力操作により任意に設定可能であり、変形処理のタイプと移動対象として選択すべき特徴点CPとの対応関係は、予め決められているものとする。例えば、「小顔化」が設定されている場合には、変形処理部240は、「小顔化」のために移動対象とする特徴点CPを選択する。変形処理部240は、「小顔化」のための移動対象の特徴点CPとして、例えば、顎から頬にかけてのフェイスラインに対応する所定の番号にかかる複数の特徴点CP(輪郭点OP)を選択する。以下では、ステップS610において選択した特徴点CPを、選択特徴点SCPと呼ぶ。ステップS610においては外枠点PPは選択されない。   As described above, the type of deformation processing can be arbitrarily set by the user through an input operation from among “small face”, “sharpening”, “celebrity”, etc. Assume that the correspondence with the feature point CP to be selected is determined in advance. For example, when “small face” is set, the deformation processing unit 240 selects a feature point CP to be moved for “small face”. For example, the deformation processing unit 240 uses a plurality of feature points CP (contour points OP) corresponding to a predetermined number corresponding to the face line from the jaw to the cheek as the feature points CP to be moved for “small face”. select. Hereinafter, the feature point CP selected in step S610 is referred to as a selected feature point SCP. In step S610, the outer frame point PP is not selected.

なお、図20に示すように、「小顔化」のための選択特徴点SCPを、便宜上、SCP0〜SCP10と表現する。図20(後述の図22も同様)では、特徴点CP(輪郭点OPを含む特徴点CP)を黒丸で表し、上記外枠点PPを図18と同様に白丸で表している。   As shown in FIG. 20, the selection feature points SCP for “small face” are expressed as SCP0 to SCP10 for convenience. In FIG. 20 (the same applies to FIG. 22 described later), the feature points CP (feature points CP including the contour points OP) are represented by black circles, and the outer frame points PP are represented by white circles as in FIG.

次に、変形処理部240は、内部メモリー120に格納された特徴点移動テーブル420に規定された移動量(あるいは、計算により設定された移動量)に従い、選択特徴点SCPの位置を移動して小領域(三角形領域)を変形することにより、変形領域CAを変形させる(ステップS620)。ここで言う三角形領域とは、変形領域CAを構成する複数の三角形領域であって、外枠点PPまたは特徴点CPを頂点として分割される三角形領域を意味している。特徴点移動テーブル420は、上述した変形処理のタイプ別、かつ、変形度合い(上述の例では、「強」、「中」、「弱」)別に予め用意されている。従って、当該S620では、変形処理部420は、上記ステップS220で設定された変形処理のタイプおよび変形度合いに対応する特徴点移動テーブル420を用いる。なお上記移動量は、画像の変形量とも呼べる。   Next, the deformation processing unit 240 moves the position of the selected feature point SCP according to the movement amount (or movement amount set by calculation) defined in the feature point movement table 420 stored in the internal memory 120. The deformation area CA is deformed by deforming the small area (triangle area) (step S620). The triangle area referred to here is a plurality of triangle areas constituting the deformation area CA, and means a triangle area divided with the outer frame point PP or the feature point CP as vertices. The feature point movement table 420 is prepared in advance for each type of deformation processing described above and for each degree of deformation (in the above example, “strong”, “medium”, “weak”). Therefore, in S620, the deformation processing unit 420 uses the feature point moving table 420 corresponding to the type and degree of deformation set in Step S220. The movement amount can also be called an image deformation amount.

図21は、特徴点移動テーブル420(変形処理のタイプが「小顔化」かつ、変形度合いが「中」、に対応する特徴点移動テーブル420)の一例を示している。特徴点移動テーブル420では、その変形処理のタイプに対応する選択特徴点SCP毎に、基準線RLと直交する方向(H方向と呼ぶ。)に沿った移動量及び基準線RLと平行な方向(V方向と呼ぶ。)に沿った移動量を定義している。基準線RLとは、顔領域FAの重心を通り、顔領域FAの高さ方向に沿った辺に平行な直線である(図18参照)。従って、H方向は顔の横方向に略相等し、V方向は顔の上下方向に略相等する。この移動量は、例えば、注目画像OIの画素ピッチを単位として表されたり、所定のサイズを100としたときの比率などで表される。当該所定のサイズとは、例えば、H方向に対する所定のサイズであれば、顔領域FAの横幅や、輪郭点OPによって囲まれた領域の横幅などが該当し、V方向に対する所定のサイズであれば、顔領域FAの縦幅や、輪郭点OPによって囲まれた領域の縦幅などが該当する。   FIG. 21 shows an example of the feature point movement table 420 (the feature point movement table 420 corresponding to the deformation processing type “small face” and the deformation degree “medium”). In the feature point movement table 420, for each selected feature point SCP corresponding to the type of deformation processing, a movement amount along a direction orthogonal to the reference line RL (referred to as the H direction) and a direction parallel to the reference line RL ( The amount of movement along the V direction is defined. The reference line RL is a straight line that passes through the center of gravity of the face area FA and is parallel to the side along the height direction of the face area FA (see FIG. 18). Accordingly, the H direction is substantially equivalent to the lateral direction of the face, and the V direction is substantially equivalent to the vertical direction of the face. This amount of movement is represented by, for example, the pixel pitch of the target image OI as a unit, or a ratio when the predetermined size is 100. For example, if the predetermined size is a predetermined size in the H direction, the horizontal width of the face area FA, the horizontal width of the area surrounded by the contour point OP, and the like are applicable. This corresponds to the vertical width of the face area FA, the vertical width of the area surrounded by the contour point OP, and the like.

また、H方向については、注目画像OIに向かって右側への移動量が正の値として表され、向かって左側への移動量が負の値として表され、V方向については、注目画像OIに向かって上方への移動量が正の値として表され、下方への移動量が負の値として表される。このような移動量は、特徴点移動テーブル420が対応している変形度合いのレベルに応じて、異なる値に設定されている。   For the H direction, the amount of movement to the right side toward the target image OI is expressed as a positive value, and the amount of movement to the left side toward the target image OI is expressed as a negative value. The upward movement amount is expressed as a positive value, and the downward movement amount is expressed as a negative value. Such a movement amount is set to a different value according to the level of the degree of deformation supported by the feature point movement table 420.

なお、変形処理のタイプとして「有名人化」が設定されている場合には、変形処理部240は、単純に特徴点移動テーブル420を参照するのではなく、選択特徴点SCP毎の移動量を計算により設定して使用する。例えば、変形処理部240は、内部メモリー120に予め格納された、「有名人化」の目的となる有名人の顔における特徴部位(眉毛、目、鼻、口およびフェイスラインにおける所定位置)の位置を表す特徴点からなるモデル(有名人顔モデル)を読み出す。そして、上記輪郭点OPに囲まれた領域の画像と、有名人顔モデルの画像とのスケールを一致させた上で、「有名人化」のための選択特徴点SCPと、当該選択特徴点SCPに対応する有名人顔モデル内の特徴点との位置の差異を算出する。そして、変形処理部240は、このように算出した差異を無くすようなH方向およびV方向への移動量を、各選択特徴点SCPに対して設定する。ただし、当該差異を完全に打ち消すような移動量を設定すると、変形後の画像が不自然なものとなってしまうこともある。そのため、変形処理部240は、当該差異の何割かを打ち消すためのH方向およびV方向への移動量を選択特徴点SCPに設定する。当該差異の何割を打ち消すかは、上記ステップS220で設定された変形度合いのレベルに応じて異ならせる。   If “famous” is set as the type of deformation process, the deformation processing unit 240 does not simply refer to the feature point movement table 420 but calculates the movement amount for each selected feature point SCP. Set by using. For example, the deformation processing unit 240 represents the position of a characteristic part (predetermined position in eyebrows, eyes, nose, mouth, and face line) on the face of a celebrity that is stored in the internal memory 120 in advance and is the object of “celebrity”. A model (famous face model) consisting of feature points is read out. Then, after matching the scale of the image of the region surrounded by the contour point OP and the image of the celebrity face model, the selected feature point SCP for “celebrity” and the selected feature point SCP are supported. The position difference with the feature point in the celebrity face model is calculated. Then, the deformation processing unit 240 sets the movement amount in the H direction and the V direction so as to eliminate the difference thus calculated for each selected feature point SCP. However, if the amount of movement is set so as to completely cancel out the difference, the deformed image may become unnatural. Therefore, the deformation processing unit 240 sets the movement amount in the H direction and the V direction for canceling out some of the difference as the selected feature point SCP. What percentage of the difference is canceled is made different according to the level of the degree of deformation set in step S220.

図22は、特徴点移動テーブル420に従った選択特徴点SCPの位置の移動の一例を示す説明図である。図22の例では、変形領域CA内において、上記選択特徴点SCP0〜SCP10の位置を移動させて変形する際の具体的な変形態様(小顔化)を示している。変形処理部240は、変形領域CAを構成する各三角形領域について、選択特徴点SCPの位置移動前の状態における領域の画像が選択特徴点CPの位置移動により新たに定義された領域の画像となるように、画像の変形処理を行う。図22では、理解容易のために、上段(変形前の図)において、各選択特徴点SCPの移動方向を矢印で例示しており、下段(変形後の図)において、選択特徴点SCPの移動に伴って変形した各三角形領域にハッチングを付している。つまり、3つの頂点の中に1つでも選択特徴点SCPを含んでいる三角形領域は全て変形の対象となる。三角形領域毎の画像の変形処理は、上述したようにアフィン変換によって実現してもよいし、特開2009‐104672号公報に記載された方法によって行ってもよい。   FIG. 22 is an explanatory diagram showing an example of the movement of the position of the selected feature point SCP according to the feature point movement table 420. The example of FIG. 22 shows a specific deformation mode (small face) when the position of the selected feature points SCP0 to SCP10 is moved and deformed in the deformation area CA. In each triangular area constituting the deformation area CA, the deformation processing unit 240 converts the image of the area in the state before the position of the selected feature point SCP is moved into an image of an area newly defined by the position movement of the selected feature point CP. As described above, an image deformation process is performed. In FIG. 22, for easy understanding, the movement direction of each selected feature point SCP is illustrated by an arrow in the upper stage (the figure before the deformation), and the movement of the selected feature point SCP is illustrated in the lower stage (the figure after the deformation). Each triangular area deformed along with is hatched. That is, all the triangular regions including the selected feature point SCP among the three vertices are to be deformed. The image deformation process for each triangular area may be realized by affine transformation as described above, or may be performed by the method described in Japanese Patent Application Laid-Open No. 2009-104672.

図22に示すように、ステップS620における選択特徴点SCPの移動の結果、V方向に関しては、選択特徴点SCP0〜SCP10のうち、左右の頬の最も高い位置に対応する選択特徴点SCP0,SCP10を除く選択特徴点SCP1〜SCP9の位置が上方に移動される。また、H方向に関しては、顎の先端に対応する選択特徴点SCP5を除いて、向かって左側の選択特徴点SCP0〜SCP4の位置が右方向に移動され、向かって右側の選択特徴点SCP6〜SCP10の位置が左方向に移動される。そのため、注目画像OIにおける顔画像は、フェイスライン内側の顎や頬を含む領域が全体的に顔の略中心方向に向かって縮小するように変形され、フェイスライン外側の領域(特に、首の領域)が全体的に顔の略中心方向に向かって延びるように変形される。この結果、小顔化が実現される。本実施例では、変形領域CAの内外の画像間の境界が不自然とならないように、変形領域CAの外枠上に位置する外枠点PPの位置は移動されないものとしている。   As shown in FIG. 22, as a result of the movement of the selected feature point SCP in step S620, the selected feature points SCP0 and SCP10 corresponding to the highest position of the left and right cheeks among the selected feature points SCP0 to SCP10 with respect to the V direction. The positions of the selected feature points SCP1 to SCP9 are moved upward. Regarding the H direction, except for the selection feature point SCP5 corresponding to the tip of the jaw, the positions of the selection feature points SCP0 to SCP4 on the left side are moved rightward, and the selection feature points SCP6 to SCP10 on the right side are moved. Is moved to the left. Therefore, the face image in the attention image OI is deformed so that the region including the jaw and cheeks inside the face line is reduced toward the substantially central direction of the face, and the region outside the face line (particularly, the neck region). ) Is extended so as to extend generally toward the center of the face. As a result, a small face is realized. In the present embodiment, the position of the outer frame point PP located on the outer frame of the deformation area CA is not moved so that the boundary between the images inside and outside the deformation area CA does not become unnatural.

このように本実施例によれば、画像処理装置は、注目画像OIに含まれる顔画像の特徴部位の座標位置に対応する特徴点CPを検出することにより、顔の輪郭に対応する輪郭点OPを取得し、輪郭点OPの位置に基づいて輪郭点OPに囲まれた領域の外側に外枠点PPを設定し、外枠点PPで囲まれた領域を変形領域CAとして設定する。そして、変形領域CA内の特徴点CPのうち所定の特徴点(選択特徴点SCP)を移動させて変形領域CA内の小領域単位での変形を行なうことにより、例えば「小顔化」等の目的に応じた画像変形を実現する。つまり、上記のように設定される変形領域CAは、顔の具体的な輪郭(形状)を正確に反映した形状である。そのため、変形領域CA内の画像を変形処理の対象とすることで、そのとき処理対象としている顔にとって極めて自然な、かつ目的としている画像変形の効果が確実に表れた、画像変形結果を得ることができる。   As described above, according to the present embodiment, the image processing apparatus detects the feature point CP corresponding to the coordinate position of the feature part of the face image included in the target image OI, and thereby the contour point OP corresponding to the face contour. , And the outer frame point PP is set outside the region surrounded by the contour point OP based on the position of the contour point OP, and the region surrounded by the outer frame point PP is set as the deformation region CA. Then, by moving a predetermined feature point (selected feature point SCP) among the feature points CP in the deformation area CA and performing deformation in units of small areas in the deformation area CA, for example, “small face” or the like Realize image transformation according to purpose. That is, the deformation area CA set as described above is a shape that accurately reflects the specific contour (shape) of the face. Therefore, by using the image in the deformation area CA as an object of the deformation process, an image deformation result that is extremely natural for the face to be processed at that time and surely exhibits the intended image deformation effect is obtained. Can do.

また、本実施例によれば、上記のように顔の輪郭を正確に反映した変形領域CAの画像を対象として「小顔化」や「有名人化」等、ユーザーが任意に設定したタイプの変形処理がユーザーの好みの変形度合いで実行されるため、違和感の無い、ユーザーが望む最適な画像変形結果が得られる。   In addition, according to the present embodiment, the type of deformation arbitrarily set by the user, such as “small face” or “famous person”, for the image of the deformation area CA that accurately reflects the outline of the face as described above. Since the process is executed with the degree of deformation desired by the user, an optimal image deformation result desired by the user without a sense of incongruity can be obtained.

本発明は第1実施例に限られるものではなく、その要旨を逸脱しない範囲において種々の態様において実施することが可能であり、以下のような各実施例も可能である。むろん、第1実施例や各実施例を適宜組み合わた構成も、本発明の範囲となる。以下において特に言及しない部分については、第1実施例で説明した内容が適用されるものとする。   The present invention is not limited to the first embodiment, and can be carried out in various modes without departing from the gist thereof, and the following embodiments are also possible. Of course, the configuration of the first embodiment and each embodiment as appropriate is also within the scope of the present invention. The contents described in the first embodiment are applied to parts not specifically mentioned below.

2.第2実施例
本発明においては、ある方向を向いた顔画像を元に、別の方向を向いた顔画像であって変形処理が施された顔画像を生成することができる。例えば、ステップS240(図10)が終了した時点で、注目画像OIから、正面を向いた顔の形状を表す特徴点CP(輪郭点OPを含む。)の設定位置が検出されたとする。画像処理部200は、顔が正面向きであるか否かは、Fit処理が完了した時点での形状パラメーター(特に、形状パラメーターpおよび形状パラメーターp)の値を評価する(例えば、所定のしきい値と比較する)ことにより判定できる。また、領域設定部230により、当該正面を向いた顔についての輪郭点OPの位置に基づいて、外枠点PPも設定されたものとする。このような状況において、本実施例では、正面向きの顔画像について設定された特徴点CPおよび外枠点PPに基づいて、横方向(左右方向)にある程度振りのある顔画像であって変形処理がなされた顔画像を生成する処理(横顔変形処理と呼ぶ。)について説明する。
2. Second Embodiment In the present invention, based on a face image directed in a certain direction, a face image directed in another direction and subjected to deformation processing can be generated. For example, it is assumed that the set position of the feature point CP (including the contour point OP) representing the shape of the face facing the front is detected from the target image OI when step S240 (FIG. 10) is completed. The image processing unit 200 evaluates the values of the shape parameters (particularly, the shape parameter p 1 and the shape parameter p 2 ) at the time when the Fit processing is completed (for example, a predetermined value). (Compared with a threshold value). Further, it is assumed that the outer frame point PP is also set by the region setting unit 230 based on the position of the contour point OP for the face facing the front. In such a situation, in this embodiment, the face image has a certain degree of swing in the horizontal direction (left and right direction) based on the feature point CP and the outer frame point PP set for the front-facing face image. A process for generating a face image that has been subjected to (referred to as a side face deformation process) will be described.

横顔変形処理を説明する前提として、本実施例においては、基本的に各特徴点CPは3次元の位置情報を有するものとする。上記第1実施例では、特徴点CPはX方向の座標とY方向の座標で表される2次元(平面)情報であったが、本実施例では、特徴点CPは、さらにZ方向の座標を持つ3次元(立体)情報である。つまり前提としての、AAM設定処理においては、位置がX,Y,Z座標で表される68個の特徴点CPを有するサンプル画像SIを複数用意し、各サンプル画像SIにおける特徴点CP(X座標、Y座標およびZ座標)により構成される座標ベクトルに対する主成分分析を行なうことにより、顔の形状sをモデル化しておく(3次元形状モデルを生成しておく)。このような3次元形状モデルを用いる場合であっても、注目画像OIに対して上記Init処理とFit処理とを行うことにより、注目画像OIに含まれた顔の各特徴部位に対応した各特徴点CP(X,Y,Z座標)からなる形状s(立体形状)を設定することができる。なお、この場合、平均形状sの特徴点CPや平均顔画像A(x)も3次元の位置情報を有するものとする。そして、このように設定した形状sについて、顔の向きの変化に対応する形状パラメーターを変更することにより、正面向きの状態から振りのある状態へと変形させることができる。 As a premise for explaining the side face deformation process, in the present embodiment, each feature point CP basically has three-dimensional position information. In the first embodiment, the feature point CP is two-dimensional (planar) information represented by the coordinates in the X direction and the coordinates in the Y direction. However, in the present embodiment, the feature point CP is further coordinated in the Z direction. Is three-dimensional (solid) information. In other words, in the AAM setting process as a premise, a plurality of sample images SI having 68 feature points CP whose positions are represented by X, Y, and Z coordinates are prepared, and feature points CP (X coordinates) in each sample image SI are prepared. , Y coordinate and Z coordinate), a face shape s is modeled (a three-dimensional shape model is generated). Even when such a three-dimensional shape model is used, each feature corresponding to each feature part of the face included in the target image OI is obtained by performing the above Init processing and Fit processing on the target image OI. A shape s (three-dimensional shape) composed of points CP (X, Y, Z coordinates) can be set. In this case, it is assumed that the feature point CP and the average face image A 0 (x) of the average shape s 0 also have three-dimensional position information. Then, the shape s set in this way can be transformed from a front-facing state to a swinging state by changing the shape parameter corresponding to the change in the face direction.

上記のように特徴点CPを3次元情報とした場合、輪郭点OPの位置に基づいて設定される外枠点PPも、X,Y,Z座標を有する3次元情報とする。領域設定部230は、3次元空間上で、例えば鼻の所定位置に対応する特徴点CP付近に基準点SPを設定し、基準点SPと各輪郭点OPとを結ぶ各線分Lを、各輪郭点OPから外側へ所定距離だけ延長した位置に、各輪郭点OPに対応する外枠点PPを設定する。   As described above, when the feature point CP is three-dimensional information, the outer frame point PP set based on the position of the contour point OP is also three-dimensional information having X, Y, and Z coordinates. The region setting unit 230 sets a reference point SP in the vicinity of a feature point CP corresponding to a predetermined position of the nose, for example, in a three-dimensional space, and sets each line segment L connecting the reference point SP and each contour point OP to each contour. Outer frame points PP corresponding to the contour points OP are set at positions extending outward from the point OP by a predetermined distance.

図23は、横顔変形処理を示したフローチャートである。輪郭点検出部220は、顔の向きの変化に対応する形状パラメーター(顔の形状sの左右方向への向き(振り)の程度を変化させる上記形状パラメーターp)を所定量変更することにより、顔の形状sを、正面向きの状態から振りのある状態(例えば、左振りの状態。図7(b)参照。)へと変化させる(ステップS710)。つまり、立体形状(ワイヤーフレーム)としての形状sが顔の左方向に回転する。この結果、向きがある程度左向き(注目画像OIに正対した向きから見て左向き画像)となった顔の輪郭や器官の位置を表現する特徴点CPが設定される。 FIG. 23 is a flowchart showing the profile modification process. The contour point detection unit 220 changes the shape parameter corresponding to the change in the orientation of the face (the shape parameter p 1 that changes the degree of the orientation (swing) of the face shape s in the left-right direction) by a predetermined amount, The face shape s is changed from a front-facing state to a swinging state (for example, a left-handed state (see FIG. 7B)) (step S710). That is, the shape s as a three-dimensional shape (wire frame) rotates in the left direction of the face. As a result, a feature point CP is set that represents the face contour or organ position whose orientation is leftward to some extent (leftward image when viewed from the direction facing the target image OI).

領域設定部230は、当該顔向きの変化に応じた特徴点CPの位置の変更に追従して、外枠点PPの位置を変更し、変形領域CAを設定し直す(ステップS720)。つまり、正面向きの顔の形状sを表現していた特徴点CPのうちの輪郭点OPの位置に基づいて設定されていた外枠点PPの位置を、対応する輪郭点OPとの相対的な位置関係を維持しつつ、上記形状パラメーターpの変更による形状sの振り量(左方向への回転量)に応じて変更する。この結果、左振りの顔の形状sを表す特徴点CPの周囲を取り囲む外枠点PPによって、当該左振りの顔の形状sに対応した変形領域CAが新たに設定される。なお、当該ステップS720の処理は、顔の形状sの向きの変化(ステップS710)とほぼ同時に実行される。 The area setting unit 230 changes the position of the outer frame point PP following the change in the position of the feature point CP according to the change in the face orientation, and resets the deformation area CA (step S720). That is, the position of the outer frame point PP set based on the position of the contour point OP among the feature points CP representing the face shape s facing the front is relative to the corresponding contour point OP. while maintaining the positional relationship is changed in accordance with the oscillation amount of shape s by changing the shape parameter p 1 (rotation amount in the left direction). As a result, a deformed area CA corresponding to the left-handed face shape s is newly set by the outer frame point PP surrounding the feature point CP representing the left-handed face shape s. Note that the processing in step S720 is executed almost simultaneously with the change in the orientation of the face shape s (step S710).

変形処理部240は、上記ステップS610と同様に、変形処理の際の移動対象とする特徴点CP(選択特徴点SCP)を選択する(ステップS730)。
次に、変形処理部240は、特徴点移動テーブル420に規定された選択特徴点SCP毎の移動量および上記ステップS710における形状パラメーターの変更量に基づいて、選択特徴点SCP毎の移動量を算出する(ステップS740)。具体的には、変形処理部240は、上記ステップS710において上述したように顔の左右方向への向きの程度を変化させる形状パラメーターpが変更されている場合には、この形状パラメーターpの変更量に応じて、特徴点移動テーブル420に規定された選択特徴点SCP毎の移動量のうちH方向への移動量を補正する。
Similarly to step S610, the deformation processing unit 240 selects a feature point CP (selected feature point SCP) to be moved in the deformation process (step S730).
Next, the deformation processing unit 240 calculates the movement amount for each selected feature point SCP based on the movement amount for each selected feature point SCP defined in the feature point movement table 420 and the amount of change in the shape parameter in step S710. (Step S740). Specifically, when the shape parameter p 1 for changing the degree of the left-right direction of the face is changed as described above in step S710, the deformation processing unit 240 changes the shape parameter p 1 . The movement amount in the H direction is corrected among the movement amounts for each selected feature point SCP defined in the feature point movement table 420 according to the change amount.

図24は、形状パラメーターpの変更量に応じて、選択特徴点SCPのH方向への移動量を算出する様子を説明する図である。図24では、上記ステップS710において形状パラメーターpを変更したことにより、形状sが正面向きの状態から顔の横方向へ回転した(ある程度左振りとなった)状況の一部を、顔の真上から見た状態を示している。図24においては、形状sに含まれるある特徴点CPと、これに隣接する特徴点CPと、特徴点CPに対応する外枠点PPとが、角度θだけ回転した様子を示している。角度θは、上記ステップS710における形状パラメーターpの変更量に応じて、一義的に定まる3次元空間上での回転量である。ここでは、回転後の各点CP,CP,PPについてそれぞれ「´」を付して表している。なお、特徴点CPは、輪郭点OPであり、かつ選択特徴点SCPでもある。 Figure 24 is in accordance with the change amount of the shape parameter p 1, is a diagram for explaining a manner of calculating the amount of movement in the H direction of the selected feature point SCP. In Figure 24, by changing the shape parameter p 1 in the step S710, a part of the shape s is rotated from the state of the frontal lateral face (it became somewhat leftward swing) conditions, true face Shown from the top. FIG. 24 shows a state in which a feature point CP 1 included in the shape s, a feature point CP 2 adjacent thereto, and an outer frame point PP 1 corresponding to the feature point CP 2 are rotated by an angle θ. ing. The angle theta, in accordance with the change amount of the shape parameter p 1 in step S710, a rotation amount on the three-dimensional space is uniquely determined. Here, each point CP 1 , CP 2 , PP 1 after rotation is indicated by “′”. The feature point CP 2 is a contour point OP, and is also selected feature point SCP.

本実施例では、内部メモリー120に予め格納されている特徴点移動テーブル420は、変形処理の対象となる顔が正面を向いている(左右にも上下にも振れていない)ことを前提として各選択特徴点SCPに対するH方向およびV方向の移動量を規定している。そこで、選択特徴点SCPに対して特徴点移動テーブル420に規定されているH方向の移動量をhとした場合、形状パラメーターpの変更によって形状sが正面向きの状態から顔の横方向へ角度θだけ回転したときの、選択特徴点SCPに対するH方向の移動量h´は、下記式(6)によって算出される。
In this embodiment, the feature point movement table 420 stored in advance in the internal memory 120 is based on the assumption that the face to be deformed is facing the front (does not swing left and right or up and down). The amount of movement in the H direction and the V direction with respect to the selected feature point SCP is defined. Therefore, the movement amount in the H direction as defined in the feature point moving table 420 for the selected feature points SCP if you is h, from the change of the shape parameter p 1 shape s is frontal state lateral face The amount of movement h ′ in the H direction with respect to the selected feature point SCP when rotated by the angle θ is calculated by the following equation (6).

なお、変形処理部240は、上記ステップS710において顔の上下方向への向きの程度を変化させる形状パラメーターpが変更されている場合には、この形状パラメーターpの変更量に応じて、特徴点移動テーブル420に規定された選択特徴点SCP毎の移動量のうちV方向への移動量を補正する。つまり、特徴点移動テーブル420に規定されているV方向の移動量をvとした場合、形状パラメーターpの変更によって形状sが正面向きの状態から顔の上下方向へ角度θだけ回転したとき(上振りまたは下振りの状態となったとき。図7(c)参照。)の、選択特徴点SCPに対するV方向の移動量v´は、下記式(7)によって算出される。
If the shape parameter p 2 that changes the degree of the face's vertical direction is changed in step S 710, the deformation processing unit 240 is characterized according to the change amount of the shape parameter p 2. Of the movement amounts for each selected feature point SCP defined in the point movement table 420, the movement amount in the V direction is corrected. That is, when the movement amount in the V direction defined in the feature point moving table 420 is v, the shape s is rotated from the front-facing state by the angle θ in the vertical direction of the face by changing the shape parameter p 2 ( The amount of movement v ′ in the V direction with respect to the selected feature point SCP as shown in FIG. 7C is calculated by the following equation (7).

このように本実施例では、変形処理部240は、上記顔の向きの変化の程度に応じて、画像の変形量を異ならせている。変形処理部240は、上記のように算出した移動量(H方向及び又はV方向の移動量)に従い、上記ステップS710で向きが変更された後の形状sにおける選択特徴点SCPの位置をH方向及び又はV方向に移動させて三角形領域を変形する(ステップS750)。つまり、選択特徴点SCPをいずれかの頂点に含む各三角形領域について、上記ステップS710での向きの変更前の状態における領域の画像が、当該向きの変更および上記算出された移動量による選択特徴点SCPの移動により新たに定義された領域の画像となるように、変形処理を行う。この結果、正面向きの顔画像から、別の方向を向いた顔画像(例えば、左振りの顔)であって、その顔の振りの程度に応じた変形量によって適切に変形処理が施された(例えば「小顔化」が施された)顔画像が得られる。   As described above, in the present embodiment, the deformation processing unit 240 varies the amount of image deformation according to the degree of change in the face orientation. In accordance with the movement amount (movement amount in the H direction and / or the V direction) calculated as described above, the deformation processing unit 240 determines the position of the selected feature point SCP in the shape s after the direction is changed in step S710 in the H direction. Then, the triangular area is deformed by moving in the V direction (step S750). That is, for each triangular region including the selected feature point SCP at any vertex, the image of the region in the state before the change of direction in step S710 is selected feature point based on the change in direction and the calculated amount of movement. Deformation processing is performed so that an image of a newly defined area is obtained by moving the SCP. As a result, the face image is a face image (for example, a left-handed face) facing in a different direction from the front-facing face image, and appropriately deformed according to the amount of deformation according to the degree of the face swing. A face image (for example, “small face reduction”) is obtained.

上記説明で明らかなように、本実施例では、形状sに顔の横方向への振りを加えた上で変形処理を行うときには、選択特徴点SCPのH方向の移動量を補正し、形状sに顔の上下方向への振りを加えた上で変形処理を行うときには、選択特徴点SCPのV方向の移動量を補正する。これは言い換えれば、元々V方向への移動量のみが規定されている選択特徴点SCP(例えば、顎の先端に対応する選択特徴点SCP5。図22参照。)に関しては、形状sに顔の横方向への振りだけを加えた上で変形処理を行うときには移動量(変形量)は一定である。同様に、H方向への移動量のみが規定されている選択特徴点SCPに関しては、形状sに顔の上下方向への振りだけを加えた上で変形処理を行うときには移動量(変形量)は一定である。つまり変形処理部240は、形状パラメーターの変更により顔の向きが変化する方向に略直交する方向にのみ変形させる箇所(選択特徴点SCP)の画像に対する変形量は、顔の向きの変化の程度にかかわらず一定としている。   As is apparent from the above description, in the present embodiment, when the deformation process is performed after the shape s is shaken in the horizontal direction, the amount of movement of the selected feature point SCP in the H direction is corrected, and the shape s When the deformation process is performed after adding the vertical swing of the face, the amount of movement of the selected feature point SCP in the V direction is corrected. In other words, with respect to the selected feature point SCP (for example, the selected feature point SCP5 corresponding to the tip of the chin, see FIG. 22) for which only the movement amount in the V direction is originally defined, the shape s has the side of the face. When the deformation process is performed after adding only the swing in the direction, the movement amount (deformation amount) is constant. Similarly, for the selected feature point SCP in which only the amount of movement in the H direction is defined, the amount of movement (deformation amount) is as follows when the deformation process is performed after adding the shape s to the face in the vertical direction only. It is constant. That is, the deformation processing unit 240 changes the deformation amount of the portion (selected feature point SCP) to be deformed only in the direction substantially orthogonal to the direction in which the face direction is changed by changing the shape parameter to the extent of the change in the face direction. Regardless, it is constant.

ここで、注目画像OIは静止画に限定されず動画であってもよい。例えば、上述した横顔変形処理のように、向き等が変化する顔の変化に追従して変形領域CAを設定して変形を施す処理を、動画を対象として行ってもよい。   Here, the attention image OI is not limited to a still image, and may be a moving image. For example, like the above-described profile modification process, a process of setting a modification area CA and performing a modification following a change in the face whose orientation or the like changes may be performed on a moving image.

図25は、動画内の顔画像に対して変形を施す処理(動画変形処理)をフローチャートにより示している。当該フローチャートの処理を実行する画像処理装置は、プリンター100であってもよいが、ここではコンピューター300であるとする。そして、コンピューター300は、上記画像処理部200と同等の機能を実行可能なコンピュータープログラム(便宜上、画像処理部200と呼ぶ。)を有しており、当該コンピュータープログラム(画像処理部200)に従って、動画変形処理を実行する。本実施例における動画変形処理とは、概略的には、注目画像OIとしての動画を構成するフレーム画像毎に、顔の輪郭点OP(特徴点CP)の検出と変形領域CAの設定と画像の変形と、を行なう処理である。   FIG. 25 is a flowchart showing processing (moving image deformation processing) for deforming a face image in a moving image. The image processing apparatus that executes the processing of the flowchart may be the printer 100, but is assumed to be the computer 300 here. The computer 300 has a computer program (referred to as an image processing unit 200 for convenience) that can execute the same function as the image processing unit 200, and a moving image is generated according to the computer program (the image processing unit 200). Perform deformation processing. The moving image deformation processing in the present embodiment is roughly the detection of the face contour point OP (feature point CP), the setting of the deformation area CA, and the image of each frame image constituting the moving image as the attention image OI. This is a process for performing deformation.

まず、画像処理部200は、動画変形処理の対象となる注目画像OIとしての動画を表す動画ファイルを、コンピューター300のHDD等から取得し(ステップS810)、上記ステップS220(図10)と同様に 変形処理のタイプや変形度合い等を設定する(ステップS820)。   First, the image processing unit 200 acquires a moving image file representing a moving image as the target image OI to be subjected to moving image deformation processing from the HDD or the like of the computer 300 (step S810), and similarly to step S220 (FIG. 10). The type of deformation process, the degree of deformation, etc. are set (step S820).

次に、画像処理部200は、動画ファイルを構成する1フレーム目の画像の再生処理を行う(ステップS830)。1フレーム目の画像の再生処理においては、画像処理部200は、まず、1フレーム目の画像に含まれる顔画像の少なくとも一部を含む画像領域を顔領域FAとして検出する。次に、画像処理部200は、顔領域FAの位置に基づいて上記Init処理を実行し、Init処理の結果設定された特徴点CPの初期位置に基づいて、変形領域CAを設定する(初期位置として設定された特徴点CPのうちの輪郭点OP(外周に位置する特徴点CP)の位置に基づいて外枠点PPを設定し、外枠点PPに囲まれた領域を変形領域CAとして設定する)。そして、画像処理部200は、上述したように選択特徴点SCPを特徴点移動テーブル420に規定された移動量に従って移動させることにより、変形領域CA内の画像(三角形領域ごとの画像)を変形させる。そして、このように変形処理が施された画像領域を含む1フレーム目の画像を、コンピューター300のディスプレイ等に表示させる。この結果、例えば、変形処理のタイプとして「小顔化」が設定されていた場合には、小顔化された顔画像を含む画面(1フレーム目)が、ディスプレイ上に表示される。   Next, the image processing unit 200 performs reproduction processing of the first frame image constituting the moving image file (step S830). In the reproduction process of the first frame image, the image processing unit 200 first detects an image area including at least a part of the face image included in the first frame image as the face area FA. Next, the image processing unit 200 executes the Init process based on the position of the face area FA, and sets the deformation area CA based on the initial position of the feature point CP set as a result of the Init process (initial position). The outer frame point PP is set based on the position of the contour point OP (characteristic point CP located on the outer periphery) of the characteristic points CP set as, and the region surrounded by the outer frame point PP is set as the deformation region CA. To do). Then, as described above, the image processing unit 200 moves the selected feature point SCP according to the movement amount defined in the feature point movement table 420, thereby deforming the image in the deformation area CA (image for each triangular area). . Then, the first frame image including the image area subjected to the deformation process is displayed on the display of the computer 300 or the like. As a result, for example, when “small face” is set as the type of deformation processing, a screen (first frame) including a face image with a small face is displayed on the display.

次に、画像処理部200は、動画ファイルを構成する1+kフレーム目の画像を対象とした再生処理を行う(ステップS840)。kは1以上の整数であり、画像処理部200は、ステップS830の直後のステップS840においてはk=1に設定し、以降、ステップS840を繰り返すたびにkの値を1ずつインクリメントする。1+kフレーム目(2フレーム目以降)の画像の再生処理においては、画像処理部200は、まず、1+k−1フレーム目の画像の再生処理において設定された特徴点CPの位置に基づいて、1+kフレーム目の画像上でFit処理を実行することにより、特徴点CPの設定位置を補正する。つまり、2フレーム目の画像の再生処理であれば、1フレーム目の再生処理時のInit処理によって初期位置として設定された特徴点CPに基づいて、2フレーム目の画像から平均形状画像I(W(x;p))を生成し、上述したように差分画像Ieに応じたパラメーター更新量ΔPにより特徴点CPの設定位置を補正する。3フレーム目以降の画像の再生処理であれば、直前のフレームの再生処理時のFit処理によって補正された特徴点CPに基づいて、現在のフレーム画像から平均形状画像I(W(x;p))を生成し、上述したように差分画像Ieに応じたパラメーター更新量ΔPにより特徴点CPの設定位置をさらに補正する。   Next, the image processing unit 200 performs a reproduction process for the image of the 1 + k frame constituting the moving image file (step S840). k is an integer equal to or greater than 1, and the image processing unit 200 sets k = 1 in step S840 immediately after step S830, and thereafter increments the value of k by 1 each time step S840 is repeated. In the reproduction process of the image of the 1 + k frame (second and subsequent frames), the image processing unit 200 first determines the 1 + k frame based on the position of the feature point CP set in the reproduction process of the 1 + k−1 frame image. By performing the Fit process on the eye image, the setting position of the feature point CP is corrected. That is, in the case of the second frame image reproduction process, the average shape image I (W (W) is calculated from the second frame image based on the feature point CP set as the initial position by the Init process at the time of the first frame reproduction process. (X; p)) is generated, and the setting position of the feature point CP is corrected by the parameter update amount ΔP corresponding to the difference image Ie as described above. In the case of the reproduction processing of the third and subsequent frames, the average shape image I (W (x; p)) is calculated from the current frame image based on the feature point CP corrected by the Fit processing at the time of the reproduction processing of the immediately preceding frame. ) And the setting position of the feature point CP is further corrected by the parameter update amount ΔP corresponding to the difference image Ie as described above.

なお、一回のステップS840において行うFit処理では、パラメーター更新量ΔPによる特徴点CPの設定位置の補正を、一回だけ行うとしてもよい。画像処理部200は、Fit処理の結果補正された特徴点CPの設定位置に基づいて、変形領域CAを設定(特徴点CPのうちの輪郭点OP(外周に位置する特徴点CP)の位置に基づいて外枠点PPを設定し、外枠点PPに囲まれた領域を変形領域CAとして設定)した上で、上述したように選択特徴点SCPを特徴点移動テーブル420に規定された移動量に従って移動させることにより、変形領域CA内の画像(三角形領域ごとの画像)を変形させる。そして、このように変形処理が施された画像領域を含む1+kフレーム目の画像を、コンピューター300のディスプレイ等に表示させる。   In the Fit process performed in one step S840, the setting position of the feature point CP by the parameter update amount ΔP may be corrected only once. The image processing unit 200 sets the deformation area CA based on the setting position of the feature point CP corrected as a result of the Fit processing (at the position of the contour point OP (the feature point CP located on the outer periphery) of the feature points CP). Based on this, the outer frame point PP is set and the area surrounded by the outer frame point PP is set as the deformation area CA), and the selected feature point SCP is moved by the movement amount defined in the feature point moving table 420 as described above. The image in the deformation area CA (image for each triangular area) is deformed by moving according to the above. Then, the image of the (1 + k) th frame including the image area subjected to the deformation process is displayed on the display of the computer 300 or the like.

ただし、当該ステップS840では、画像処理部200は、特徴点移動テーブル420に規定された移動量をそのまま選択特徴点SCPの移動に適用するのではなく補正してもよい。つまり、Fit処理においてパラメーター更新量ΔPによって更新した後の形状パラメーターp,pに基づいて、Fit処理後の顔の向きを特定し、当該特定した顔の向きに応じて、上記横顔変形処理で説明したように、特徴点移動テーブル420に規定されたH方向及び又はV方向の移動量を補正し、補正後の移動量に従って選択特徴点SCPを移動させる。 However, in step S840, the image processing unit 200 may correct the movement amount defined in the feature point movement table 420 without applying it to the movement of the selected feature point SCP as it is. That is, the face direction after the Fit process is specified based on the shape parameters p 1 and p 2 after being updated with the parameter update amount ΔP in the Fit process, and the side face deformation process is performed according to the specified face direction. As described above, the movement amount in the H direction and / or the V direction defined in the feature point movement table 420 is corrected, and the selected feature point SCP is moved according to the corrected movement amount.

ステップS850では、画像処理部200は、動画ファイルを構成する最終のフレーム画像についてステップS840の処理を実行したか否か判定し、実行済みと判定した場合には、動画変形処理を終了する。一方、最終のフレーム画像についてステップS840の処理を未実行であると判定した場合には、ステップS840に戻り、次のフレーム画像を対象としてステップS840を実行する。   In step S850, the image processing unit 200 determines whether or not the process of step S840 has been executed for the final frame image constituting the moving image file. If it is determined that the processing has been executed, the moving image transformation process ends. On the other hand, if it is determined that the process of step S840 has not been executed for the final frame image, the process returns to step S840, and step S840 is executed for the next frame image.

このように動画変形処理によれば、動画を構成するフレーム画像毎に、動画内の顔画像について、輪郭点OPの検出、変形領域CAの設定および変形処理を施し、変形処理した顔画像を含む各フレーム画像を表示する。そのため、極めて自然に「小顔化」等の変形処理が施された顔が複数のフレーム画像に亘って滑らかに動く画像をユーザーに提供することができる。また、フレーム画像毎に繰り返し実行される上記ステップS840においては、直前のフレーム画像でInit処理またはFit処理によって設定された特徴点CPの位置に基づいてFit処理を行う。そのため、各Fit処理では、フレーム画像間で随時変化する顔の特徴部位の位置に対して、特徴点CP(輪郭点OP)の位置を精度良く追従させることができる。従って、フレーム画像毎の変形処理の結果は、各フレーム画像が含む顔の形状や位置や大きさを正確に反映した最適な結果となる。   As described above, according to the moving image deformation process, for each frame image constituting the moving image, the face image in the moving image is subjected to the detection of the contour point OP, the setting of the deformation area CA, and the deformation process, thereby including the deformed face image. Each frame image is displayed. Therefore, it is possible to provide the user with an image in which a face that has undergone a deformation process such as “small face” moves smoothly over a plurality of frame images. In step S840 that is repeatedly executed for each frame image, the Fit process is performed based on the position of the feature point CP set by the Init process or the Fit process in the immediately preceding frame image. Therefore, in each Fit process, the position of the feature point CP (contour point OP) can be accurately followed with respect to the position of the facial feature part that changes as needed between frame images. Therefore, the result of the deformation process for each frame image is an optimum result that accurately reflects the shape, position, and size of the face included in each frame image.

3.第3実施例
上記では、画像処理装置は、ユーザーが設定した変形処理のタイプや変形度合い等(変形態様)に応じた変形処理を実行するとしたが、かかる構成に代えて或いは加えて、変形処理の対象となる顔の属性に応じた変形処理を行うようにしてもよい。顔の属性とは、例えば、性別や年齢層などである。画像処理部200は、性別に応じた変形処理を行なう場合、属性判定部250(図1)によって、テクスチャー検出処理を実行する。テクスチャー検出処理は、上記輪郭点検出処理(図10のステップS240)の後に行う。
3. Third Embodiment In the above description, the image processing apparatus executes the deformation process according to the type of deformation process set by the user, the degree of deformation, etc. (deformation mode), but instead of or in addition to such a configuration, the deformation process Deformation processing may be performed in accordance with the face attribute that is the target of. The face attributes are, for example, sex and age group. When the image processing unit 200 performs a deformation process according to gender, the attribute determination unit 250 (FIG. 1) performs a texture detection process. The texture detection process is performed after the contour point detection process (step S240 in FIG. 10).

図26は、テクスチャー検出処理を示すフローチャートである。属性判定部250(図1)は、輪郭点検出処理が完了した時点で注目画像OIに設定されている特徴点CPに基づいて、注目画像OIから平均形状画像I(W(x;p))を算出する(ステップS910)。   FIG. 26 is a flowchart showing the texture detection process. The attribute determination unit 250 (FIG. 1) calculates the average shape image I (W (x; p)) from the attention image OI based on the feature point CP set in the attention image OI when the contour point detection processing is completed. Is calculated (step S910).

さらに、属性判定部250は、平均形状画像I(W(x;p))に基づく平均テクスチャー画像J(Q(x;λ))を算出する(ステップS915)。平均テクスチャー画像J(Q(x;λ))は、以下の式(8)によって算出される。

式(8)は、式(2)における顔のテクスチャーA(x)に平均形状画像I(W(x;p))を代入したものであり、テクスチャーパラメーターλが適切に設定されれば、J(Q(x;λ))が平均顔画像A(x)と等しくなる。なお、初めてステップS915において平均テクスチャー画像J(Q(x;λ))を算出する場合、属性判定部250は、適当なテクスチャーパラメーターλ(例えば、デフォルト値として予め決められたテクスチャーパラメーターλ)を用いて算出する。本実施例では、平均テクスチャー画像は、テクスチャーパラメーターλの変更による上記式(8)の変換Q(x;λ)によって生成された画像(画素群)Jという意味で、平均テクスチャー画像J(Q(x;λ))と表現している。
Further, the attribute determination unit 250 calculates an average texture image J (Q (x; λ)) based on the average shape image I (W (x; p)) (step S915). The average texture image J (Q (x; λ)) is calculated by the following equation (8).

Equation (8) is obtained by substituting the average shape image I (W (x; p)) for the facial texture A (x) in Equation (2), and if the texture parameter λ i is appropriately set, J (Q (x; λ)) is equal to the average face image A 0 (x). When the average texture image J (Q (x; λ)) is calculated for the first time in step S915, the attribute determination unit 250 determines an appropriate texture parameter λ i (for example, a texture parameter λ i predetermined as a default value). Calculate using. In this embodiment, the average texture image means an image (pixel group) J generated by the transformation Q (x; λ) of the above equation (8) by changing the texture parameter λ, and means the average texture image J (Q ( x; λ)).

属性判定部250は、平均テクスチャー画像J(Q(x;λ))と平均顔画像A(x)との差分画像Ieを算出する(ステップS920)。属性判定部250は、差分画像Ieに基づき、テクスチャー検出処理が収束したか否かを判定する(ステップS930)。属性判定部250は、差分画像Ieのノルムを算出し、ノルムの値が予め設定されたしきい値より小さい場合には収束したと判定し、ノルムの値がしきい値以上の場合には未だ収束していないと判定する。なお、属性判定部250は、算出された差分画像Ieのノルムの値が前回のステップS930において算出された値よりも小さい場合には収束したと判定し、前回値以上である場合には未だ収束していないと判定するものとしてもよい。ここにおける収束の判定は、上述したFit処理における収束判定と同様の手法により行うことができる。 The attribute determination unit 250 calculates a difference image Ie between the average texture image J (Q (x; λ)) and the average face image A 0 (x) (step S920). The attribute determination unit 250 determines whether the texture detection process has converged based on the difference image Ie (step S930). The attribute determination unit 250 calculates the norm of the difference image Ie, determines that the norm value has converged if the value is smaller than a preset threshold value, and still determines that the norm value is equal to or greater than the threshold value. Judge that it has not converged. The attribute determining unit 250 determines that the calculated norm value of the difference image Ie has converged when it is smaller than the value calculated in the previous step S930, and still converges when it is equal to or greater than the previous value. It is good also as what determines with not doing. The convergence determination here can be performed by the same method as the convergence determination in the Fit process described above.

ステップS930の収束判定において未だ収束していないと判定された場合には、属性判定部250は、パラメーター更新量ΔΛを算出する(ステップS940)。パラメーター更新量ΔΛは、特徴量であるm個のテクスチャーパラメーターλ(i=1〜mの整数。)の値の変更量を意味している。パラメーター更新量ΔΛは、下記の式(9)により算出される。すなわち、パラメーター更新量ΔΛは、アップデートマトリックスUと差分画像Ieとの積である。 If it is determined in step S930 that the convergence is not yet completed, the attribute determination unit 250 calculates the parameter update amount ΔΛ (step S940). The parameter update amount ΔΛ means a change amount of the value of m texture parameters λ i (i = 1 to m), which is a feature amount. The parameter update amount ΔΛ is calculated by the following equation (9). That is, the parameter update amount ΔΛ is a product of the update matrix U and the difference image Ie.

式(9)におけるアップデートマトリックスUは、差分画像Ieに基づきパラメーター更新量ΔΛを算出するために予め学習により設定されたM行N列のマトリックスであり、AAM情報AMI(図1)として内部メモリー120に格納されている。本実施例では、アップデートマトリックスUの行数Mは、テクスチャーパラメーターλの数(m個)に等しく、列数Nは、平均形状領域BSA内の画素数(56画素×56画素−マスク領域MAの画素数)に等しい。アップデートマトリックスUは、下記の式(10),(11)により算出される。
式(10)および(11)における関数Qは、上記式(8)による変換を指し、変数Λは、テクスチャーパラメーターλを指し、Tは転置行列を意味する。
The update matrix U in Expression (9) is a matrix of M rows and N columns set in advance by learning to calculate the parameter update amount ΔΛ based on the difference image Ie, and the internal memory 120 as AAM information AMI (FIG. 1). Stored in In this embodiment, the number M of rows in the update matrix U is equal to the number (m) of texture parameters λ i , and the number N of columns is the number of pixels in the average shape area BSA (56 pixels × 56 pixels−mask area MA). The number of pixels). The update matrix U is calculated by the following formulas (10) and (11).
The function Q in the equations (10) and (11) indicates the transformation according to the above equation (8), the variable Λ indicates the texture parameter λ i , and T indicates a transposed matrix.

属性判定部250は、算出したパラメーター更新量ΔΛに基づきテクスチャーパラメーターλを更新する(ステップS950)。これにより、顔のテクスチャーA(x)が補正される。すなわち、属性判定部250は、差分画像Ieのノルムが小さくなるように補正する。パラメーターの更新の後には、再度、補正されたテクスチャーパラメーターλに基づいて平均テクスチャー画像J(Q(x;λ))の算出(ステップS915)、差分画像Ieの算出(ステップS920)、差分画像Ieに基づく収束判定(ステップS930)が行われる。再度の収束判定においても収束していないと判定された場合には、さらに、差分画像Ieに基づくパラメーター更新量ΔΛの算出(ステップS940)、パラメーターの更新によるテクスチャーの補正(ステップS950)が行われる。 The attribute determination unit 250 updates the texture parameter λ i based on the calculated parameter update amount ΔΛ (step S950). Thereby, the facial texture A (x) is corrected. That is, the attribute determination unit 250 corrects the difference image Ie so that the norm of the difference image Ie becomes small. After the parameter update, the average texture image J (Q (x; λ)) is calculated again based on the corrected texture parameter λ i (step S915), the difference image Ie is calculated (step S920), and the difference image. A convergence determination (step S930) based on Ie is performed. If it is determined that the convergence has not occurred in the convergence determination again, the parameter update amount ΔΛ based on the difference image Ie is calculated (step S940), and the texture is corrected by updating the parameter (step S950). .

図26のステップS910からS950までの処理が繰り返し実行されると、上記式(2)で計算される顔のテクスチャーA(x)の各画素の輝度値(色彩値)が、実際の顔画像の輝度値に全体として近づいていき、ある時点で収束判定(ステップS930)において収束したと判定される。収束判定において収束したと判定されると、テクスチャー検出処理が完了する(ステップS960)。このとき設定されているテクスチャーパラメーターλの値は、対応するテクスチャーベクトルA(x)が表す顔の特性に関して、注目画像OIにおける実際の顔の見えと平均顔画像A(x)見えとがどれぐらい異なっているかを示している。従って、このとき設定されているテクスチャーパラメーターλの値により特定される顔のテクスチャーA(x)が最終的な顔の見えとして特定される。 When the processing from step S910 to step S950 in FIG. 26 is repeatedly executed, the luminance value (color value) of each pixel of the facial texture A (x) calculated by the above equation (2) becomes the actual facial image. The brightness value approaches as a whole, and it is determined at a certain point in time that the convergence is determined in the convergence determination (step S930). If it is determined in the convergence determination that the image has converged, the texture detection process is completed (step S960). The value of the texture parameter λ i set at this time is the appearance of the actual face and the average face image A 0 (x) appearance in the target image OI with respect to the face characteristics represented by the corresponding texture vector A i (x). Shows how different the are. Therefore, the facial texture A (x) specified by the value of the texture parameter λ i set at this time is specified as the final facial appearance.

属性判定部250は、テクスチャー検出処理が完了した時点で設定されているm個のテクスチャーパラメーターλのうち、性別の差に相関する第1テクスチャーベクトルA(x)のテクスチャーパラメーターλを読み出す。そして、当該テクスチャーパラメーターλを所定のしきい値と比較して評価することにより、テクスチャーパラメーターλが示す性別が男性と女性とのどちらであるかを判定(推定)する。ただし、属性判定部250による顔の性別の判定は、テクスチャーパラメーターによる判定に限られず、注目画像OIに含まれている顔の性別を判定可能な手法であれば、公知の手法を含めてあらゆる手法を採用可能である。 The attribute determination unit 250 reads the texture parameter λ 1 of the first texture vector A 1 (x) that correlates with the gender difference among the m texture parameters λ i set when the texture detection process is completed. . Then, the texture parameter λ 1 is evaluated by comparing with a predetermined threshold value to determine (estimate) whether the gender indicated by the texture parameter λ 1 is male or female. However, the determination of the face gender by the attribute determination unit 250 is not limited to the determination by the texture parameter, and any method including known methods can be used as long as it can determine the gender of the face included in the target image OI. Can be adopted.

変形処理部240は、変形領域CA内の画像の変形処理(図10のステップS260)に際して、上記のように属性判定部250によって判定された顔の属性(性別)に応じて異なる変形を行なう。例えば、内部メモリー120には、男性の顔に対して適用して好適な移動量を規定した特徴点移動テーブル420と、女性の顔に対して適用して好適な移動量を規定した特徴点移動テーブル420とがそれぞれ予め格納されている。そして、変形処理部240は、上記判定された顔の性別に応じて特徴点移動テーブル420を選択し、当該選択した特徴点移動テーブル420に規定されている移動量に従って選択特徴点SCPを移動させることにより、性別に応じた最適な変形処理を行う。或いは、上記第1実施例のように、変形処理のタイプ別かつ変形度合い別に、特徴点移動テーブル420を予め用意する場合、より詳細に、変形処理のタイプ別かつ変形度合い別かつ男女別に、特徴点移動テーブル420を内部メモリー120に用意しておく。そして、変形処理部240は、ユーザーによって設定されている変形処理のタイプ、変形度合い、および上記判定された顔の性別に応じて、特徴点移動テーブル420を選択し、当該選択した特徴点移動テーブル420に規定されている移動量に従って選択特徴点SCPを移動させることにより、変形処理のタイプ、変形度合いおよび性別に応じた最適な変形処理を行うとしてもよい。   The deformation processing unit 240 performs different deformations according to the face attribute (gender) determined by the attribute determination unit 250 as described above during the deformation processing of the image in the deformation area CA (step S260 in FIG. 10). For example, in the internal memory 120, a feature point movement table 420 that defines a movement amount suitable for a male face and a feature point movement that defines a movement amount suitable for a female face. Each table 420 is stored in advance. Then, the deformation processing unit 240 selects the feature point movement table 420 according to the determined gender of the face, and moves the selected feature point SCP according to the movement amount defined in the selected feature point movement table 420. As a result, optimal deformation processing according to gender is performed. Alternatively, when the feature point moving table 420 is prepared in advance for each type of deformation process and for each degree of deformation as in the first embodiment, more specifically, for each type of deformation process, for each degree of deformation, and for each gender, A point movement table 420 is prepared in the internal memory 120. Then, the deformation processing unit 240 selects the feature point moving table 420 according to the type of deformation processing set by the user, the degree of deformation, and the determined gender of the face, and the selected feature point moving table. By moving the selected feature point SCP according to the movement amount defined in 420, an optimal deformation process according to the type, degree of deformation, and gender of the deformation process may be performed.

画像処理部200は、年齢層に応じた変形処理を行なう場合、輪郭点検出処理が完了した時点で設定されている形状パラメーターpの値を総合的に評価することにより、顔の年齢層を判定する処理(年齢層判定処理)を実行する。年齢層判定処理は、上記輪郭点検出処理(図10のステップS240)の後に行う。 The image processing unit 200 when performing the transformation process in accordance with the age, by comprehensively evaluating the value of shape parameter p i that is set when the contour point detection process is completed, the age of the face A determination process (age group determination process) is executed. The age group determination process is performed after the contour point detection process (step S240 in FIG. 10).

図27は、年齢層判定処理を示すフローチャートである。属性判定部250は、判定対象の年齢層を選択する(ステップS1010)。本実施例では、数種類の年齢層(例えば、幼児、少年、成人、老人などの各年齢層)を判定対象とし、幼児→少年→成人→老人…の順で判定対象を選択する。属性判定部250は、n個の形状パラメーターpの中から、その年齢層らしさを示す判定値Eを算出するために使用するg個の形状パラメーター(形状パラメーターqと表す。i=1〜gの整数。)を選択する(ステップS1020)。属性判定部250は、形状パラメーターqを下記式(12)に代入することにより、判定値Eを算出する(ステップS1030)。
FIG. 27 is a flowchart showing age group determination processing. The attribute determination unit 250 selects an age group to be determined (step S1010). In this embodiment, several age groups (for example, each age group such as infants, boys, adults, and elderly people) are set as determination targets, and the determination targets are selected in the order of infant → boy → adult → elderly person. Attribute determining unit 250, from among the n shape parameter p i, .i =. 1 to be expressed as g-number of shape parameters (shape parameter q i to be used for calculating the judgment value E indicating the age ness an integer of g.) is selected (step S1020). The attribute determination unit 250 calculates a determination value E by substituting the shape parameter q i into the following equation (12) (step S1030).

式(12)において、αは各形状パラメーターqについて設定された重み係数を示し、knは正規化のための係数を示している。すなわち、判定値Eは、形状パラメーターqを重み係数αに基づく重みによって線形結合した値である。なお、年齢層毎に、n個の形状パラメーターpの中から選択されるg個の形状パラメーターqは異ならせ、形状パラメーターqに対する重み係数αも各年齢層に対応して用意されているとしてもよい。判定値Eを算出すると、属性判定部250はすべての年齢層の選択を完了したか否かを判定し(ステップS1040)、完了していない場合にはステップS1010に戻り次の年齢層を選択する。これにより、数種類の各年齢層についてそれぞれ判定値Eを順に算出していくことができる。各年齢層について判定値Eが算出できると、属性判定部250は年齢層の判定を行う。具体的には、属性判定部250は、最も判定値Eの大きい年齢層を、注目画像OIに含まれている顔の年齢層であると判定(推定)する(ステップS1050)。ただし、属性判定部250による顔の年齢層の判定は、上述した手法に限られず、注目画像OIに含まれている顔の年齢層を判定可能な手法であれば、公知の手法を含めてあらゆる手法を採用可能である。 In Expression (12), α i represents a weighting coefficient set for each shape parameter q i , and kn represents a coefficient for normalization. That is, the determination value E is a value obtained by linearly combining the shape parameter q i with a weight based on the weight coefficient α i . Incidentally, for each age group, g pieces of shape parameter q i chosen from among n shape parameters p i are varied, the weighting factor alpha i for shape parameter q i are also prepared corresponding to each age It may be. When the determination value E is calculated, the attribute determination unit 250 determines whether or not all age groups have been selected (step S1040). If not, the process returns to step S1010 to select the next age group. . Thereby, the judgment value E can be calculated in order for each of several types of age groups. When the determination value E can be calculated for each age group, the attribute determination unit 250 determines the age group. Specifically, the attribute determination unit 250 determines (estimates) the age group having the largest determination value E as the age group of the face included in the target image OI (step S1050). However, the determination of the face age group by the attribute determination unit 250 is not limited to the above-described method, and any method including a known method can be used as long as it can determine the age group of the face included in the target image OI. Techniques can be adopted.

変形処理部240は、変形領域CA内の画像の変形処理(図10のステップS260)に際して、上記のように属性判定部250によって判定された顔の年齢層に応じて異なる変形を行なう。例えば、内部メモリー120には、各年齢層の顔に対して適用して好適な移動量を規定した各特徴点移動テーブル420が予め格納されている。変形処理部240は、上記判定された顔の年齢層に応じて特徴点移動テーブル420を選択し、当該選択した特徴点移動テーブル420に規定されている移動量に従って選択特徴点SCPを移動させることにより、年齢層に応じた最適な変形処理を行う。或いは、上記第1実施例のように、変形処理のタイプ別かつ変形度合い別に、特徴点移動テーブル420を予め用意する場合、より詳細に、変形処理のタイプ別かつ変形度合い別かつ年齢層別に、特徴点移動テーブル420を内部メモリー120に用意しておく。そして、変形処理部240は、ユーザーによって設定されている変形処理のタイプ、変形度合い、および上記判定された顔の年齢層に応じて、特徴点移動テーブル420を選択し、当該選択した特徴点移動テーブル420に規定されている移動量に従って選択特徴点SCPを移動させることにより、変形処理のタイプ、変形度合いおよび年齢層に応じた最適な変形処理を行うとしてもよい。むろん、変形処理部240は、性別および年齢層の両方の違いに応じて、異なる変形処理を行うとしてもよい。   The deformation processing unit 240 performs different deformations according to the age group of the face determined by the attribute determination unit 250 as described above during the deformation processing of the image in the deformation area CA (step S260 in FIG. 10). For example, the internal memory 120 stores in advance each feature point movement table 420 that defines a suitable movement amount to be applied to the faces of each age group. The deformation processing unit 240 selects the feature point movement table 420 according to the determined age group of the face, and moves the selected feature point SCP according to the movement amount defined in the selected feature point movement table 420. Thus, an optimal deformation process according to the age group is performed. Alternatively, when the feature point movement table 420 is prepared in advance for each type of deformation process and for each degree of deformation as in the first embodiment, more specifically, for each type of deformation process, for each degree of deformation, and for each age group, A feature point moving table 420 is prepared in the internal memory 120. Then, the deformation processing unit 240 selects the feature point moving table 420 according to the type of deformation processing set by the user, the degree of deformation, and the determined age group of the face, and moves the selected feature point. By moving the selected feature point SCP according to the movement amount defined in the table 420, an optimal deformation process according to the type of deformation process, the degree of deformation, and the age group may be performed. Of course, the deformation processing unit 240 may perform different deformation processes according to differences in both sexes and age groups.

4.第4実施例
ユーザーが望む変形結果をより精度良く得るために、個人の顔別の変形態様を予め画像処理装置(プリンター100)に登録する構成が考えられる。この場合、登録部260(図1)は、異なる個人(人物A,B,C…)毎の顔の特徴を表した情報(顔特徴情報)を、ユーザーによる操作部140の操作入力に応じて、或いは、外部のコンピューター300等から入力し、内部メモリー120に登録しておく。あるいは、画像処理部200は、個人毎の顔写真に基づいて、上記のように形状パラメーターやテクスチャーパラメーターを取得する処理を予め行なっておき、個人毎に取得した形状パラメーターやテクスチャーパラメーターを、顔特徴情報として登録部260に登録させる。また、登録部260は、上記個人(人物A,B,C…)毎の変形態様を、ユーザーによる操作部140の入力操作等に応じて設定し、当該設定した内容を内部メモリー120に登録しておく。ユーザーは、変形処理のタイプ、変形度合いはもちろん、変形処理の際に移動対象とすべき選択特徴点SCPの位置や数、さらには、選択特徴点SCP毎の移動量(移動後の位置)などの詳細な変形態様を、個人の顔毎に登録することができる。
4). Fourth Embodiment In order to obtain a deformation result desired by a user with higher accuracy, a configuration in which a deformation mode for each individual face is registered in the image processing apparatus (printer 100) in advance can be considered. In this case, the registration unit 260 (FIG. 1) displays information (face feature information) representing facial features for different individuals (persons A, B, C...) According to the operation input of the operation unit 140 by the user. Alternatively, it is input from an external computer 300 or the like and registered in the internal memory 120. Alternatively, the image processing unit 200 performs processing for acquiring the shape parameter and the texture parameter in advance as described above based on the face photograph for each individual, and uses the shape parameter and the texture parameter acquired for each individual as facial features. The information is registered in the registration unit 260 as information. Further, the registration unit 260 sets the deformation mode for each individual (person A, B, C...) According to the input operation of the operation unit 140 by the user, and registers the set content in the internal memory 120. Keep it. In addition to the type of deformation process and the degree of deformation, the user can select the position and number of selected feature points SCP to be moved during the deformation process, and the amount of movement (position after movement) for each selected feature point SCP. The detailed deformation mode can be registered for each individual face.

このような登録がなされていることを前提として、画像変形処理(図10)を行なう場合、識別部270(図1)は、注目画像OIに含まれている顔の個人識別を行う。本実施例においては、上記ステップS220の処理(図10)は不要である。個人識別を行うタイミングは様々であるが、例えば、識別部270は、輪郭点検出処理(図10のステップS240)の後に個人識別を行う。個人識別は、注目画像OIに含まれている顔の特徴を表す所定の情報と、上記登録部260によって内部メモリー120に登録済みの個人毎の顔特徴情報とを比較することにより、注目画像OIに含まれている顔が誰であるか(人物A,B,C…の誰であるか)を特定する処理であり、公知の個人識別のための手法を採用すればよい。上記顔特徴情報および、顔の特徴を表す所定の情報とは、例えば、上記形状パラメーターやテクスチャーパラメーターなどであってもよいし、それら以外の所定の情報であってもよい。   On the premise that such registration has been made, when performing the image deformation process (FIG. 10), the identification unit 270 (FIG. 1) performs personal identification of the face included in the target image OI. In the present embodiment, the process of step S220 (FIG. 10) is not necessary. For example, the identification unit 270 performs personal identification after the contour point detection process (step S240 in FIG. 10). The personal identification is performed by comparing predetermined information representing the facial features included in the attention image OI with the facial feature information for each individual registered in the internal memory 120 by the registration unit 260. Is a process for identifying who is the face included in the person (who is the person A, B, C...), And a known method for personal identification may be employed. The face feature information and the predetermined information representing the facial features may be, for example, the shape parameter or the texture parameter, or may be predetermined information other than those.

このように識別部270によって、注目画像OI内の顔の個人が識別された場合(例えば、注目画像OI内の顔が人物Aであると特定された場合)、変形処理部240は、当該識別された顔(人物A)に対応して設定されている変形領域CA内の画像に、当該識別された顔(人物A)に対応して内部メモリー120に登録されている変形態様による変形処理を施す。この結果、注目画像OI内の人物Aの顔は、ユーザーが人物Aのために予め登録した変形態様による変形処理が施された結果となる。なお、本実施例においては、注目画像OIに顔が含まれている場合であっても、識別部270による個人識別が成功しなかった顔(人物A,B,C…の誰であるかが特定されなかった顔)については、その変形領域CAの変形処理は実行しないものとする。つまり、予め顔特徴情報および変形態様を登録しておいた人物についてのみ、変形処理が行われる構成としてもよい。   As described above, when the identification unit 270 identifies the individual of the face in the attention image OI (for example, when the face in the attention image OI is specified as the person A), the deformation processing unit 240 performs the identification processing. The deformation process according to the deformation mode registered in the internal memory 120 corresponding to the identified face (person A) is applied to the image in the deformation area CA set corresponding to the face (person A). Apply. As a result, the face of the person A in the attention image OI is the result of being subjected to deformation processing according to a deformation mode registered in advance for the person A by the user. In the present embodiment, even if the attention image OI includes a face, the face (persons A, B, C...) Whose personal identification by the identification unit 270 has not been successful. For the face not specified, the deformation process of the deformation area CA is not executed. In other words, the deformation process may be performed only for a person who has registered facial feature information and a deformation mode in advance.

5.変形例
上述した特徴点CPの初期位置設定処理(Init処理)や設定位置補正処理(Fit処理)では、注目画像OIに基づき平均形状画像I(W(x;p))を算出することにより、注目画像OIの特徴点CPの設定位置を平均顔画像A(x)の特徴点CPの設定位置に整合させている。しかし逆に、平均顔画像A(x)に対して画像変換を行うことにより、注目画像OIの特徴点CPと平均顔画像A(x)の特徴点CPとの配置を整合させるとしてもよい。
5. In the above-described initial position setting process (Init process) and set position correction process (Fit process) of the feature point CP, by calculating the average shape image I (W (x; p)) based on the target image OI, The setting position of the feature point CP of the target image OI is matched with the setting position of the feature point CP of the average face image A 0 (x). However Conversely, by performing the image conversion for the average face image A 0 (x), as to match the arrangement of the characteristic points CP of the average and the characteristic point CP in the target image OI face image A 0 (x) Good.

また、Init処理において、4つのグローバルパラメーター(大きさ、傾き、上下方向の位置、左右方向の位置)のそれぞれについての3段階の値の組み合わせに対応する仮設定位置が予め設定されているが、仮設定位置の設定に用いるパラメーターの種類および数やパラメーター値の段階数は変更可能である。
また上記では、サンプル画像SIwの画素群xのそれぞれにおける輝度値により構成される輝度値ベクトルに対する主成分分析によってテクスチャーモデルが設定されているが、顔画像のテクスチャー(見え)を表す輝度値以外の指標値(例えばRGB値)に対する主成分分析によってテクスチャーモデルが設定されるものとしてもよい。
In the Init processing, a temporary setting position corresponding to a combination of three levels of values for each of the four global parameters (size, inclination, vertical position, horizontal position) is set in advance. The type and number of parameters used for setting the temporary setting position and the number of parameter values can be changed.
Further, in the above, the texture model is set by principal component analysis on the luminance value vector formed by the luminance values in each of the pixel groups x of the sample image SIw, but other than the luminance values representing the texture (appearance) of the face image. A texture model may be set by principal component analysis with respect to an index value (for example, RGB value).

また、平均顔画像A(x)のサイズは56画素×56画素に限られず他のサイズであってもよい。また、平均顔画像A(x)は、マスク領域MA(図8)を含む必要はなく、平均形状領域BSAのみによって構成されるとしてもよい。また、平均顔画像A(x)の代わりに、サンプル画像SIの統計的分析に基づき設定される他の基準顔画像が用いられるとしてもよい。
また上記では、AAMを用いた形状モデルおよびテクスチャーモデルの設定が行われているが、他のモデル化手法(例えばMorphable Modelと呼ばれる手法やActive Blobと呼ばれる手法)を用いて形状モデルおよびテクスチャーモデルの設定が行われるとしてもよい。
The size of the average face image A 0 (x) is not limited to 56 pixels × 56 pixels, and may be other sizes. Further, the average face image A 0 (x) does not need to include the mask area MA (FIG. 8), and may include only 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 image SI may be used.
In the above, the shape model and the texture model are set using AAM. However, the shape model and the texture model can be set using another modeling method (for example, a method called Morphable Model or a method called Active Blob). Setting may be performed.

また上記では、メモリーカードMCに格納された画像が注目画像OIに設定されているが、注目画像OIは例えばネットワークを介して取得された画像であってもよい。
また上記では、主に画像処理装置としてのプリンター100による画像処理を説明したが、処理の一部または全部がコンピューター300やデジタルスチルカメラ、デジタルビデオカメラ等の他の種類の画像処理装置により実行されるものとしてもよい。また、プリンター100はインクジェットプリンターに限らず、他の方式のプリンター、例えばレーザプリンターや昇華型プリンターであるとしてもよい。
In the above description, the image stored in the memory card MC is set as the attention image OI. However, the attention image OI may be an image acquired via a network, for example.
In the above description, image processing by the printer 100 as an image processing apparatus has been mainly described. However, part or all of the processing is executed by another type of image processing apparatus such as a computer 300, a digital still camera, or a digital video camera. It is good also as a thing. 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.

100…プリンター、110…CPU、120…内部メモリー、140…操作部、150…表示部、160…印刷機構、170…カードインターフェイス、172…カードスロット、200…画像処理部、210…顔領域検出部、220…輪郭点検出部、230…領域設定部、240…変形処理部、250…属性判定部、260…登録部、270…識別部、300…コンピューター、310…表示処理部、320…印刷処理部、420…特徴点移動テーブル DESCRIPTION OF SYMBOLS 100 ... Printer, 110 ... CPU, 120 ... Internal memory, 140 ... Operation part, 150 ... Display part, 160 ... Printing mechanism, 170 ... Card interface, 172 ... Card slot, 200 ... Image processing part, 210 ... Face area detection part , 220 ... contour point detection unit, 230 ... area setting unit, 240 ... deformation processing unit, 250 ... attribute determination unit, 260 ... registration unit, 270 ... identification unit, 300 ... computer, 310 ... display processing unit, 320 ... print processing Part, 420... Feature point moving table

Claims (11)

注目画像に含まれる顔の輪郭に対応する輪郭点を検出する検出部と、
上記検出された輪郭点の位置に基づいて、上記顔の少なくとも一部を含む領域を変形処理の対象領域として設定する領域設定部と、
上記設定された対象領域内の画像の変形を行う変形処理部とを備えることを特徴とする画像処理装置。
A detection unit for detecting a contour point corresponding to the contour of the face included in the image of interest;
An area setting unit that sets an area including at least a part of the face as a target area for deformation processing based on the position of the detected contour point;
An image processing apparatus comprising: a deformation processing unit configured to deform an image in the set target area.
上記注目画像としての動画を構成するフレーム画像毎に、上記輪郭点の検出と対象領域の設定と画像の変形とを行なうことを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the contour point is detected, the target area is set, and the image is deformed for each frame image constituting the moving image as the attention image. 上記検出部は、複数の特徴量に基づいて顔の輪郭を複数の特徴点の位置によって表現する形状モデルにおける特徴点の位置が、顔の輪郭に近づくように、当該特徴量を変更し、当該変更により補正された特徴点の位置を上記輪郭点の位置として検出することを特徴とする請求項1または請求項2に記載の画像処理装置。   The detection unit changes the feature amount so that the position of the feature point in the shape model expressing the contour of the face by the position of the plurality of feature points based on the plurality of feature amounts approaches the contour of the face, The image processing apparatus according to claim 1, wherein the position of the feature point corrected by the change is detected as the position of the contour point. 上記検出部は、顔の向きの変化に対応する特徴量を変更することにより、向きが変更された顔の輪郭を表現する位置に特徴点を設定するとともに、上記領域設定部は、当該特徴点の設定に追従して上記対象領域の設定を行なうことを特徴とする請求項3に記載の画像処理装置。   The detection unit sets a feature point at a position expressing the contour of the face whose orientation has been changed by changing a feature amount corresponding to a change in the orientation of the face, and the region setting unit includes the feature point The image processing apparatus according to claim 3, wherein the target area is set in accordance with the setting. 上記変形処理部は、上記顔の向きの変化の程度に応じて、画像の変形量を異ならせることを特徴とする請求項4に記載の画像処理装置。   The image processing apparatus according to claim 4, wherein the deformation processing unit changes an image deformation amount according to a degree of change in the face orientation. 上記変形処理部は、上記顔の向きが変化する方向に略直交する方向にのみ変形させる所定箇所の画像に対する変形量は、上記顔の向きの変化の程度にかかわらず一定とすることを特徴とする請求項5に記載の画像処理装置。   The deformation processing unit is characterized in that a deformation amount with respect to an image of a predetermined portion that is deformed only in a direction substantially orthogonal to a direction in which the face direction changes is constant regardless of the degree of change in the face direction. The image processing apparatus according to claim 5. 上記領域設定部は、上記検出された輪郭点に囲まれた領域内に基準点を設定し、当該基準点と各輪郭点とを結ぶ各線分を各輪郭点よりも外側へ所定距離延長した位置に各外枠点を設定し、当該各外枠点によって囲まれた領域を上記対象領域とすることを特徴とする請求項1〜請求項6のいずれかに記載の画像処理装置。   The area setting unit sets a reference point in an area surrounded by the detected contour point, and a position obtained by extending each line segment connecting the reference point and each contour point by a predetermined distance outward from each contour point. The image processing apparatus according to claim 1, wherein each outer frame point is set to a target region, and an area surrounded by the outer frame points is set as the target region. 上記顔の属性を判定する属性判定部を備え、
上記変形処理部は、上記判定された顔の属性に応じて異なる変形を行なうことを特徴とする請求項1〜請求項7のいずれかに記載の画像処理装置。
An attribute determination unit for determining the attribute of the face;
The image processing apparatus according to claim 1, wherein the deformation processing unit performs different deformation according to the determined face attribute.
個人の顔別の変形態様を外部からの入力に従って登録する登録部と、
上記注目画像に含まれる顔の個人識別を行なう識別部とを備え、
上記変形処理部は、上記識別部によって識別された顔に対応する変形態様が上記登録部によって登録されている場合には、当該識別された顔を含んで設定されている対象領域の画像に、当該識別された顔に対応する変形態様による変形を施すことを特徴とする請求項1〜請求項8のいずれかに記載の画像処理装置。
A registration unit for registering individual face-specific deformation modes according to external input;
An identification unit for performing personal identification of a face included in the attention image,
When the deformation mode corresponding to the face identified by the identification unit is registered by the registration unit, the deformation processing unit, in the image of the target area set including the identified face, The image processing apparatus according to claim 1, wherein the image processing apparatus performs deformation according to a deformation mode corresponding to the identified face.
注目画像に含まれる顔の輪郭に対応する輪郭点を検出する検出工程と、
上記検出された輪郭点の位置に基づいて、上記顔の少なくとも一部を含む領域を変形処理の対象領域として設定する領域設定工程と、
上記設定された対象領域内の画像の変形を行う変形処理工程とを備えることを特徴とする画像処理方法。
A detection step of detecting a contour point corresponding to the contour of the face included in the image of interest;
An area setting step for setting an area including at least a part of the face as a target area for deformation processing based on the position of the detected contour point;
An image processing method comprising: a deformation process step of deforming an image in the set target area.
注目画像に含まれる顔の輪郭に対応する輪郭点を検出する検出機能と、
上記検出された輪郭点の位置に基づいて、上記顔の少なくとも一部を含む領域を変形処理の対象領域として設定する領域設定機能と、
上記設定された対象領域内の画像の変形を行う変形処理機能とをコンピューターに実行させることを特徴とする画像処理プログラム。
A detection function for detecting contour points corresponding to the contour of the face included in the image of interest;
An area setting function for setting an area including at least a part of the face as a target area for deformation processing based on the position of the detected contour point;
An image processing program for causing a computer to execute a deformation processing function for performing deformation of an image in the set target area.
JP2009202717A 2009-09-02 2009-09-02 Apparatus, method and program for processing image Pending JP2011053942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009202717A JP2011053942A (en) 2009-09-02 2009-09-02 Apparatus, method and program for processing image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009202717A JP2011053942A (en) 2009-09-02 2009-09-02 Apparatus, method and program for processing image

Publications (1)

Publication Number Publication Date
JP2011053942A true JP2011053942A (en) 2011-03-17

Family

ID=43942872

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009202717A Pending JP2011053942A (en) 2009-09-02 2009-09-02 Apparatus, method and program for processing image

Country Status (1)

Country Link
JP (1) JP2011053942A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016012253A (en) * 2014-06-30 2016-01-21 カシオ計算機株式会社 Motion processing device, motion processing method, and program
JP2017073108A (en) * 2015-10-07 2017-04-13 国立大学法人大阪大学 Image processing device, image processing method, and image processing program
JP2018536221A (en) * 2016-04-27 2018-12-06 テンセント・テクノロジー・(シェンジェン)・カンパニー・リミテッド Image distortion processing method and apparatus, and computer storage medium
JP2020519990A (en) * 2017-04-28 2020-07-02 ホアウェイ・テクノロジーズ・カンパニー・リミテッド Real-time comment display method and electronic device
JP2020119499A (en) * 2019-01-25 2020-08-06 北京百度網訊科技有限公司 Image deformation method, image deformation device, electronic apparatus, and computer readable storage media
JP2021508882A (en) * 2018-02-07 2021-03-11 ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド Transformation special effects program file package generation and transformation special effects generation method and equipment
JP2021517999A (en) * 2019-03-06 2021-07-29 ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド Image processing method and equipment
JP2021529605A (en) * 2018-10-30 2021-11-04 ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド Image processing methods and devices, computer devices and computer storage media
JP7428208B2 (en) 2018-06-15 2024-02-06 カシオ計算機株式会社 Image processing device, image processing method, and image processing program

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016012253A (en) * 2014-06-30 2016-01-21 カシオ計算機株式会社 Motion processing device, motion processing method, and program
JP2017073108A (en) * 2015-10-07 2017-04-13 国立大学法人大阪大学 Image processing device, image processing method, and image processing program
JP2018536221A (en) * 2016-04-27 2018-12-06 テンセント・テクノロジー・(シェンジェン)・カンパニー・リミテッド Image distortion processing method and apparatus, and computer storage medium
US10691927B2 (en) 2016-04-27 2020-06-23 Tencent Technology (Shenzhen) Company Limited Image deformation processing method and apparatus, and computer storage medium
JP2020519990A (en) * 2017-04-28 2020-07-02 ホアウェイ・テクノロジーズ・カンパニー・リミテッド Real-time comment display method and electronic device
JP2021508882A (en) * 2018-02-07 2021-03-11 ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド Transformation special effects program file package generation and transformation special effects generation method and equipment
US11270408B2 (en) 2018-02-07 2022-03-08 Beijing Sensetime Technology Development Co., Ltd. Method and apparatus for generating special deformation effect program file package, and method and apparatus for generating special deformation effects
JP7066855B2 (en) 2018-02-07 2022-05-13 ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド Transformation special effects program file package generation and transformation special effects generation method and equipment
JP7428208B2 (en) 2018-06-15 2024-02-06 カシオ計算機株式会社 Image processing device, image processing method, and image processing program
JP2021529605A (en) * 2018-10-30 2021-11-04 ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド Image processing methods and devices, computer devices and computer storage media
JP2020119499A (en) * 2019-01-25 2020-08-06 北京百度網訊科技有限公司 Image deformation method, image deformation device, electronic apparatus, and computer readable storage media
US11263723B2 (en) 2019-01-25 2022-03-01 Beijing Baidu Netcom Science Technology Co., Ltd. Image warping method and device
JP2021517999A (en) * 2019-03-06 2021-07-29 ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド Image processing method and equipment
US11244449B2 (en) 2019-03-06 2022-02-08 Beijing Sensetime Technology Development Co., Ltd. Image processing methods and apparatuses
JP7160925B2 (en) 2019-03-06 2022-10-25 ベイジン・センスタイム・テクノロジー・デベロップメント・カンパニー・リミテッド Image processing method and apparatus

Similar Documents

Publication Publication Date Title
JP2011053942A (en) Apparatus, method and program for processing image
JP2010186288A (en) Image processing for changing predetermined texture characteristic amount of face image
JP2011060038A (en) Image processing apparatus
JP2010182150A (en) Image processing apparatus for detecting coordinate position of characteristic part of face
US8355602B2 (en) Image processing apparatus, image processing method and image processing program
US8290278B2 (en) Specifying position of characteristic portion of face image
JP2009237619A (en) Detection of face area and organ area in image
JP2018538593A (en) Head mounted display with facial expression detection function
JP2010191592A (en) Image processing apparatus for detecting coordinate position of characteristic portion of face
JP2010055257A (en) Image processing device, image processing method, and image processing program
JP2010250420A (en) Image processing apparatus for detecting coordinate position of characteristic part of face
US20090028390A1 (en) Image Processing for Estimating Subject Distance
JP2009053914A (en) Image processor and image processing method
JP2010282339A (en) Image processor for correcting position of pupil in eye, image processing method, image processing program and printer
JP2010250419A (en) Image processing device for detecting eye condition
JP2010244321A (en) Image processing for setting face model showing face image
JP2010170184A (en) Specifying position of characteristic portion of face image
JP2010176314A (en) Image processor for detecting coordinate position of characteristic site of face
US8031915B2 (en) Image processing device and image processing method
JP4957607B2 (en) Detection of facial regions in images
JP2010271955A (en) Image processing apparatus, image processing method, image processing program, and printer
JP2010244251A (en) Image processor for detecting coordinate position for characteristic site of face
JP2010245721A (en) Face image processing
JP2009033249A (en) Image processing device, image processing method, and computer program
JP2016012248A (en) Motion processing device, motion processing method, and program