JP2009223566A - Image processor, image processing method, and image processing program - Google Patents

Image processor, image processing method, and image processing program Download PDF

Info

Publication number
JP2009223566A
JP2009223566A JP2008066617A JP2008066617A JP2009223566A JP 2009223566 A JP2009223566 A JP 2009223566A JP 2008066617 A JP2008066617 A JP 2008066617A JP 2008066617 A JP2008066617 A JP 2008066617A JP 2009223566 A JP2009223566 A JP 2009223566A
Authority
JP
Japan
Prior art keywords
eye
correction amount
image
deformation
face
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2008066617A
Other languages
Japanese (ja)
Inventor
Akio Yamazaki
明生 山▲崎▼
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 JP2008066617A priority Critical patent/JP2009223566A/en
Publication of JP2009223566A publication Critical patent/JP2009223566A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that size imbalance between a right eye and a left eye in a face in an image gives poor impression of the image. <P>SOLUTION: This image processor is provided with: a detection part for detecting information showing the sizes of the right and left eyes in the face in an object image; a correction amount determination part for determining correction amounts corresponding to the size of at least one of the right and left eyes on the basis of the detected information; and a deformation part for deforming an image with respect to at least one of a region including the left eye and a region including the right eye on the basis of the determined correction amounts. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

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

デジタル画像を対象に、画像を変形するための画像処理技術が知られている(特許文献1参照。)。特許文献1には、顔の画像上の一部の領域(頬の画像を表す領域)を補正領域として設定し、補正領域を所定のパターンに従い複数の小領域に分割し、小領域毎に設定された倍率で画像を拡大または縮小することにより、顔の形状を変形する画像処理が開示されている。
特開2004‐318204号公報
An image processing technique for deforming an image for a digital image is known (see Patent Document 1). In Patent Document 1, a partial area (an area representing a cheek image) on a face image is set as a correction area, the correction area is divided into a plurality of small areas according to a predetermined pattern, and set for each small area. Image processing for deforming the shape of a face by enlarging or reducing the image at a specified magnification is disclosed.
JP 2004-318204 A

画像が顔を含む場合、顔内の目は特に画像の観察者の注意を引く部分である。ここで、人間の左右の目の大きさは互いに異なっている場合がある。また、人の表情を一瞬で捉えて生成された画像、例えばデジタルスチルカメラ等で撮影された顔を含む画像においては、このような左右の目の大きさの違いが顕著に表れることが多い。左右の目の大きさのバランスが悪い画像、例えば、片方の目が少し閉じてしまっている顔の写真等は、観察者の印象も悪く、モニタへの表示結果やプリンタによる印刷結果において望まれるものではなかった。なお、上記従来の画像変形のための画像処理は、頬のラインを補正することに特化されており、上述したような画像における左右の目の大きさのバランスの悪さを是正することはできなかった。   When the image includes a face, the eyes in the face are the part that particularly draws the attention of the observer of the image. Here, the size of the left and right eyes of a human may be different from each other. Further, in an image generated by capturing a human expression in an instant, for example, an image including a face photographed by a digital still camera or the like, such a difference in the size of the left and right eyes often appears remarkably. An image with a bad balance between the left and right eye sizes, for example, a photograph of a face with one eye slightly closed, has a poor impression on the viewer, and is desired for the display result on the monitor and the print result by the printer. It was not a thing. Note that the conventional image processing for image deformation is specialized in correcting cheek lines, and it is possible to correct the imbalance of the size of the left and right eyes in the image as described above. There wasn't.

本発明は上記課題に鑑みてなされたもので、画像内の顔の左右の目の大きさのバランスを補正することにより、良好な印象を観察者に与える画像を得ることが可能な画像処理装置、画像処理方法および画像処理プログラムを提供することを目的とする。   The present invention has been made in view of the above problems, and an image processing apparatus capable of obtaining an image that gives a good impression to an observer by correcting the balance of the size of the left and right eyes of a face in an image. An object of the present invention is to provide an image processing method and an image processing program.

上記目的を達成するため、本発明の画像処理装置は、対象画像における顔の左右の目の大きさを表す情報を検出する検出部と、上記検出された情報に基づいて、左右の少なくとも一方の目の大きさに対する補正量を決定する補正量決定部と、上記決定された補正量に基づいて、左目を含む領域と右目を含む領域との少なくとも一方の領域に対する画像の変形処理を行なう変形部とを備える構成としてある。本発明によれば、左目を含む領域と右目を含む領域との少なくとも一方の領域が上記補正量によって変形されるため、左右の目の大きさの違いが補正された良好な印象の顔画像が得られる。   In order to achieve the above object, an image processing apparatus according to the present invention includes a detection unit that detects information indicating the size of left and right eyes of a face in a target image, and at least one of left and right based on the detected information. A correction amount determination unit that determines a correction amount for the eye size, and a deformation unit that performs image deformation processing on at least one of the region including the left eye and the region including the right eye based on the determined correction amount It is set as the structure provided with. According to the present invention, since at least one of the region including the left eye and the region including the right eye is deformed by the correction amount, a face image with a good impression in which the difference in the size of the left and right eyes is corrected is obtained. can get.

上記補正量決定部は、上記左右の目のうち小さい方の目の大きさを拡大させる補正量を決定し、上記変形部は、上記拡大させる補正量に基づいて上記小さい方の目を含む領域を拡大する変形処理を行なうとしてもよい。当該構成によれば、小さい方の目が拡大されるため、左右の目が適切な大きさで表された良好な顔画像が得られる。   The correction amount determining unit determines a correction amount for enlarging the size of the smaller one of the left and right eyes, and the deforming unit is an area including the smaller eye based on the correction amount for enlarging. It is also possible to perform a deformation process for enlarging. According to this configuration, since the smaller eye is enlarged, a good face image in which the left and right eyes are represented in an appropriate size can be obtained.

上記補正量決定部は、上記拡大させる補正量として、上記左右の目のうち大きい方の目の大きさに対する上記小さい方の目の大きさの比率が高いほど上記小さい方の目の大きさを上記大きい方の目の大きさに近づかせる補正量を決定するとしてもよい。当該構成によれば、変形前の画像において左右の目に大きなサイズ差がある場合には、小さい方の目の大きさを、無理やり大きい方の目の大きさに近づけることはしない。そのため 小さい方の目に過剰な拡大を施し却って不自然な画像となる、という不都合を回避できる。   The correction amount determination unit increases the size of the smaller eye as the ratio of the size of the smaller eye to the size of the larger eye among the left and right eyes is higher as the correction amount to be enlarged. The amount of correction that approaches the size of the larger eye may be determined. According to this configuration, when there is a large size difference between the left and right eyes in the untransformed image, the size of the smaller eye is not forced to approach the size of the larger eye. Therefore, it is possible to avoid the inconvenience that excessive enlargement is applied to the smaller eye, resulting in an unnatural image.

上記補正量決定部は、上記左右の目の大きさの平均値を算出するとともに、上記小さい方の目の大きさを当該平均値まで略拡大させる補正量を決定するとしてもよい。当該構成によれば、小さい方の目に対し過剰にならない程度の適切な拡大を行なうことができる。
上記補正量決定部は、上記小さい方の目の大きさを大きい方の目の大きさまで略拡大させる補正量を決定するとしてもよい。当該構成によれば、変形後の画像において左右の目の大きさを略均等にすることができる。
The correction amount determination unit may calculate an average value of the size of the left and right eyes, and may determine a correction amount that substantially enlarges the size of the smaller eye to the average value. According to this configuration, it is possible to perform appropriate enlargement that is not excessive for the smaller eye.
The correction amount determination unit may determine a correction amount that substantially enlarges the size of the smaller eye to the size of the larger eye. According to this configuration, the size of the left and right eyes can be made substantially uniform in the transformed image.

左右の目の大きさの違いは、主に、目の高さ方向において表れる。そこで上記変形部は、変形処理の対象とした領域の画像を当該領域が含む目の略高さ方向に沿って変形するとしてもよい。当該構成によれば、左右の目の高さ方向の大きさの違いが補正された良好な顔画像を得ることができる。   The difference in the size of the left and right eyes mainly appears in the height direction of the eyes. Therefore, the deforming unit may deform the image of the region targeted for the deformation process along a substantially height direction of the eyes included in the region. According to this configuration, it is possible to obtain a good face image in which the difference in size in the height direction between the left and right eyes is corrected.

左右の目の大きさの違いは、多くの場合、目の上端(まぶたの下端)の位置の違いに起因する。そこで上記変形部は、変形処理の対象とした領域の画素のうち、当該領域を区画する線であって目の下方に位置する線よりも上記顔の上側に位置する画素を、上記補正量に基づいて移動させることにより変形処理を行なうとしてもよい。当該構成によれば、左右の目それぞれの下端の位置は変形の前後において略維持され、当該下端を基準とした左右の目の大きさのバランスが取れるように変形が行なわれる。そのため、極めて自然に左右の目の大きさの違いが補正された顔画像を得ることができる。   The difference in size between the left and right eyes is often caused by the difference in the position of the upper end of the eye (the lower end of the eyelid). Therefore, the deforming unit determines, based on the correction amount, a pixel that is located above the face from a line that divides the region and is located below the eye among pixels in the region that is the target of the deformation process. The deformation process may be performed by moving the According to this configuration, the positions of the lower ends of the left and right eyes are substantially maintained before and after the deformation, and the deformation is performed so that the size of the left and right eyes with respect to the lower end is balanced. Therefore, it is possible to obtain a face image in which the difference in size between the left and right eyes is corrected very naturally.

画像処理装置は、上記対象画像における顔の向きを推定する顔向き推定部を備えるとしてもよい。また、上記補正量決定部は、上記推定部により推定された顔の向きに応じて補正量を変更するとしてもよい。当該構成によれば、対象画像における顔の向きに応じて、左右の目を含む上記各領域に対する変形の程度を変えることができる。   The image processing apparatus may include a face direction estimation unit that estimates a face direction in the target image. The correction amount determination unit may change the correction amount according to the face orientation estimated by the estimation unit. According to this configuration, the degree of deformation of each region including the left and right eyes can be changed according to the orientation of the face in the target image.

本発明の技術的思想は、上述した画像処理装置の発明以外にも、上述した画像処理装置が備える各部が行なう各処理工程を備えた画像処理方法の発明や、上述した画像処理装置が備える各部に対応した機能をコンピュータに実行させる画像処理プログラムの発明として捉えることができる。また、上述した画像処理装置を兼ねる印刷装置の発明や、上述した画像処理装置を兼ねるデジタルスチルカメラの発明をも把握可能である。   In addition to the above-described image processing apparatus, the technical idea of the present invention is an image processing method invention including each processing step performed by each unit included in the above-described image processing apparatus, and each unit included in the above-described image processing apparatus. Can be understood as an invention of an image processing program for causing a computer to execute a function corresponding to the above. It is also possible to grasp the invention of the printing apparatus that also serves as the above-described image processing apparatus and the invention of the digital still camera that also serves as the above-described image processing apparatus.

下記の順序に従って本発明の実施例を説明する。
1.画像処理装置の概略構成:
2.左右の目のサイズ検出処理:
3.補正量の決定処理:
4.変形処理および印刷処理:
5.他の実施例:
Examples of the present invention will be described in the following order.
1. Schematic configuration of image processing apparatus:
2. Left and right eye size detection process:
3. Correction amount determination process:
4). Transform and print processing:
5. Other examples:

1.画像処理装置の概略構成:
図1は、本発明の画像処理装置の一例としてのプリンタ10の構成を、概略的に示している。プリンタ10は、記録メディア(例えば、メモリカードMC等)から取得した画像データに基づき画像を印刷する、いわゆるダイレクトプリントに対応したカラーインクジェットプリンタである。プリンタ10は、プリンタ10の各部を制御するCPU11と、例えばROMやRAMによって構成された内部メモリ12と、ボタンやタッチパネルにより構成された操作部14と、液晶ディスプレイにより構成された表示部15と、プリンタエンジン16と、カードインターフェース(カードI/F)17と、PCやサーバやデジタルスチルカメラ等の外部機器との情報のやり取りのためのI/F部13とを備えている。プリンタ10の各構成要素は、バスを介して互いに接続されている。
1. Schematic configuration of image processing apparatus:
FIG. 1 schematically shows a configuration of a printer 10 as an example of an image processing apparatus of the present invention. The printer 10 is a color inkjet printer that supports so-called direct printing, in which an image is printed based on image data acquired from a recording medium (for example, a memory card MC). The printer 10 includes a CPU 11 that controls each unit of the printer 10, an internal memory 12 configured by, for example, a ROM and a RAM, an operation unit 14 configured by buttons and a touch panel, a display unit 15 configured by a liquid crystal display, A printer engine 16, a card interface (card I / F) 17, and an I / F unit 13 for exchanging information with an external device such as a PC, a server, or a digital still camera are provided. Each component of the printer 10 is connected to each other via a bus.

プリンタエンジン16は、印刷データに基づき印刷を行う印刷機構である。カードI/F17は、カードスロット172に挿入されたメモリカードMCとの間でデータのやり取りを行うためのI/Fである。メモリカードMCには画像データが格納されており、プリンタ10は、カードI/F17を介してメモリカードMCに格納された画像データを取得することができる。画像データ提供のための記録メディアとしてはメモリカードMC以外にも種々の媒体を用いることができる。プリンタ10は、I/F部13を介してPCやサーバ等とケーブルで接続し、当該PCやサーバ等から印刷データを入力することもできる。   The printer engine 16 is a printing mechanism that performs printing based on print data. The card I / F 17 is an I / F for exchanging data with the memory card MC inserted into the card slot 172. Image data is stored in the memory card MC, and the printer 10 can acquire the image data stored in the memory card MC via the card I / F 17. In addition to the memory card MC, various media can be used as recording media for providing image data. The printer 10 can be connected to a PC, a server, or the like via the I / F unit 13 with a cable, and can input print data from the PC, the server, or the like.

内部メモリ12には、画像変形部20と、表示処理部31と、印刷処理部32とが格納されている。画像変形部20は、所定のオペレーティングシステムの下で、後述する画像変形処理等を実行するためのコンピュータプログラム(画像処理プログラム)である。表示処理部31は、表示部15を制御して、表示部15に処理メニューやメッセージを表示させるディスプレイドライバである。印刷処理部32は、画像データから印刷データを生成し、プリンタエンジン16を制御して、印刷データに基づく画像の印刷を実行するためのコンピュータプログラムである。CPU11は、内部メモリ12から、これらのプログラムを読み出して実行することにより、これら各部の機能を実現する。   The internal memory 12 stores an image transformation unit 20, a display processing unit 31, and a print processing unit 32. The image deformation unit 20 is a computer program (image processing program) for executing an image deformation process and the like described below under a predetermined operating system. The display processing unit 31 is a display driver that controls the display unit 15 to display a processing menu or a message on the display unit 15. The print processing unit 32 is a computer program for generating print data from image data, controlling the printer engine 16 and printing an image based on the print data. The CPU 11 implements the functions of these units by reading and executing these programs from the internal memory 12.

画像変形部20は、プログラムモジュールとして、顔領域検出部21と、顔器官検出部22と、補正量決定部23と、変形領域設定部24と、変形領域分割部25と、変形処理実行部26と、顔向き推定部27とを含んでいる。顔器官検出部22は、両目サイズ検出部221を含んでいる。これら各部の機能については後述する。さらに、内部メモリ12には、分割点配置パターンテーブル41や、顔テンプレート14bや、目テンプレート14c等の各種データが格納されている。プリンタ10は、印刷機能以外にも、コピー機能やスキャナ機能など多種の機能を備えたいわゆる複合機であってもよい。   The image deformation unit 20 includes a face region detection unit 21, a face organ detection unit 22, a correction amount determination unit 23, a deformation region setting unit 24, a deformation region division unit 25, and a deformation processing execution unit 26 as program modules. And a face orientation estimating unit 27. The facial organ detection unit 22 includes a binocular size detection unit 221. The functions of these units will be described later. Furthermore, the internal memory 12 stores various data such as the dividing point arrangement pattern table 41, the face template 14b, and the eye template 14c. The printer 10 may be a so-called multifunction machine having various functions such as a copy function and a scanner function in addition to the print function.

図2は、画像処理装置(プリンタ10)が実行する画像変形印刷処理の概略を、フローチャートにより示している。
ステップS(以下、ステップの表記は省略。)100では、画像変形部20は、画像処理の対象とする画像(対象画像)内の顔の左右の目の大きさを表す情報(左右の目のサイズ)を検出する。
S300では、画像変形部20は、上記検出された左右の目のサイズに基づいて、左右の目のうち少なくとも一方の目の大きさに対する補正量を決定する。
S500では、画像変形部20は、上記決定された補正量に基づいて、対象画像における左目を含む領域と右目を含む領域との少なくとも一方の領域に対する画像の変形処理を行なう。
FIG. 2 is a flowchart showing an outline of the image deformation printing process executed by the image processing apparatus (printer 10).
In step S (hereinafter, step notation is omitted) 100, the image transformation unit 20 includes information (left and right eyes) indicating the size of the left and right eyes of the face in the image (target image) to be subjected to image processing. Size).
In S300, the image deformation unit 20 determines a correction amount for the size of at least one of the left and right eyes based on the detected size of the left and right eyes.
In S500, the image deformation unit 20 performs image deformation processing on at least one of the region including the left eye and the region including the right eye in the target image based on the determined correction amount.

S700では、印刷処理部32は、変形処理後の対象画像を表す画像データに基づいて印刷データを生成し、生成した印刷データに基づいて印刷を実行する。ただし、プリンタ10は、S100の処理において、対象画像から顔領域の検出(後述する図3のS110)に失敗したり、顔領域の検出に成功しても左右の目の領域の検出(図3のS120)に失敗した場合には、左右の目のサイズの検出およびS300,S500を行なうことなく、対象画像を表す画像データに基づいてS700の処理を行なう。以下では、対象画像は、人顔を含みかつ人顔の左右の目が表れている画像であるとして、図2のフローチャートの詳細を説明する。   In S700, the print processing unit 32 generates print data based on the image data representing the target image after the deformation process, and executes printing based on the generated print data. However, in the process of S100, the printer 10 fails to detect the face area from the target image (S110 in FIG. 3 to be described later) or detects the left and right eye areas even if the face area is successfully detected (FIG. 3). If S120) fails, the process of S700 is performed based on the image data representing the target image without detecting the size of the left and right eyes and performing S300 and S500. In the following, the details of the flowchart of FIG. 2 will be described on the assumption that the target image is an image including a human face and left and right eyes of the human face appearing.

2.左右の目のサイズ検出処理:
図3は、S100の詳細をフローチャートにより示している。
S105では、顔領域検出部21が対象画像を表した画像データ14aをメモリカードMC等、所定の記録メディアから取得する。むろん、顔領域検出部21は、プリンタ10がハードディスクドライブ(HDD)を有していれば、当該HDDに保存されている画像データ14aを取得してもよいし、I/F部13を介してPCやサーバやデジタルスチルカメラ等から画像データ14aを取得してもよい。画像データ14aは、各画素が示す色がRGB各チャネルの階調値の組み合わせ(RGB色空間におけるベクトル)で表現されたビットマップデータである。後述する図面において、便宜的に2値の画像が示される場合があるが、実際には多階調のカラー画像データが処理の対象となる。画像データ14aは、記録メディア等に記録されている段階で圧縮されていてもよいし、他の色空間で各画素の色が表現されていてもよい。これらの場合、画像データ14aの展開や色空間の変換を実行して、顔領域検出部21がRGBビットマップデータの画像データ14aを取得する。ユーザが表示部15に表示されたユーザインターフェース(UI)画面を参照して操作部14を操作することにより、対象画像としての画像データ14aが指定される。
2. Left and right eye size detection process:
FIG. 3 is a flowchart showing details of S100.
In S105, the face area detection unit 21 acquires image data 14a representing the target image from a predetermined recording medium such as a memory card MC. Of course, if the printer 10 has a hard disk drive (HDD), the face area detection unit 21 may acquire the image data 14 a stored in the HDD or via the I / F unit 13. The image data 14a may be acquired from a PC, server, digital still camera, or the like. The image data 14a is bitmap data in which the color indicated by each pixel is expressed by a combination of gradation values of RGB channels (vector in the RGB color space). In the drawings to be described later, a binary image may be shown for the sake of convenience, but in reality, multi-tone color image data is the target of processing. The image data 14a may be compressed when recorded on a recording medium or the like, or the color of each pixel may be expressed in another color space. In these cases, the development of the image data 14a and the conversion of the color space are executed, and the face area detection unit 21 acquires the image data 14a of the RGB bitmap data. When the user operates the operation unit 14 with reference to a user interface (UI) screen displayed on the display unit 15, image data 14a as a target image is designated.

S110では、顔領域検出部21が画像データ14aに含まれる顔を検出する。顔領域検出部21は、複数のテンプレート(顔テンプレート14b)を利用したいわゆるパターンマッチングによって画像データ14aから顔領域を検出する。顔テンプレート14bとのパターンマッチングを行うにあたっては、画像データ14aにおいて矩形状の比較領域CAを設定し、比較領域CAの位置と大きさと回転角度を変えながら、比較領域CA内の画像と各顔テンプレート14bの画像との類似性を評価する。そして、類似性が一定の基準を満足する比較領域CAを顔領域と判定し、その比較領域CAの位置と大きさと回転角度を取得する。本実施形態において、比較領域CAは30度ずつ回転されるものとする。画像データ14aの全体に比較領域CAを移動させることにより、画像データ14a内に存在する単数または複数の顔についての領域の位置と大きさと回転角度を取得することができる。本実施形態では、単一の顔が検出されたものとして説明を続ける。   In S110, the face area detection unit 21 detects a face included in the image data 14a. The face area detection unit 21 detects a face area from the image data 14a by so-called pattern matching using a plurality of templates (face template 14b). In performing pattern matching with the face template 14b, a rectangular comparison area CA is set in the image data 14a, and the position of the comparison area CA, the size, and the rotation angle are changed, and the image and each face template in the comparison area CA are changed. The similarity with the image of 14b is evaluated. Then, the comparison area CA in which the similarity satisfies a certain criterion is determined as a face area, and the position, size, and rotation angle of the comparison area CA are acquired. In the present embodiment, the comparison area CA is rotated by 30 degrees. By moving the comparison area CA over the entire image data 14a, the position, size, and rotation angle of the area for one or more faces existing in the image data 14a can be acquired. In the present embodiment, the description will be continued assuming that a single face is detected.

図4は、上記S110において顔領域と判定された比較領域CAの矩形を示している。
S115では、顔領域検出部21は、顔領域と判定された比較領域CAの位置と大きさと回転角度に基づいて、当該比較領域CAに含まれる画像を画像データ14aから顔画像データFDとして抽出する。このとき、顔画像データFDの大きさが一定の大きさとなるように解像度変換を行なう。例えば、100×100画素の大きさとなるように、顔画像データFDの画素が内挿または間引きされる。また、画像データ14aにおける顔の回転角に対応して比較領域CAが回転されていた場合には、この回転を解消するように顔画像データFDを回転させる。ただし、比較領域CAの回転角は30度ずつであるため、顔画像データFDにおいて、±15度の範囲で顔の回転角が残存し得ることとなる。
FIG. 4 shows a rectangle of the comparison area CA determined as the face area in S110.
In S115, the face area detection unit 21 extracts an image included in the comparison area CA from the image data 14a as face image data FD based on the position, size, and rotation angle of the comparison area CA determined as the face area. . At this time, resolution conversion is performed so that the size of the face image data FD becomes a constant size. For example, the pixels of the face image data FD are interpolated or thinned out so as to have a size of 100 × 100 pixels. If the comparison area CA is rotated corresponding to the rotation angle of the face in the image data 14a, the face image data FD is rotated so as to eliminate this rotation. However, since the rotation angle of the comparison area CA is 30 degrees, the face rotation angle can remain in the range of ± 15 degrees in the face image data FD.

S120では、顔器官検出部22が顔器官としての左右の目を検出する。顔器官検出部22は、複数のテンプレート(目テンプレート14c)を利用したパターンマッチングによって顔画像データFDから右目領域および左目領域を検出する。顔器官検出部22も、目テンプレート14cとのパターンマッチングを行うにあたって、顔画像データFDにおいて矩形状の比較領域CAを設定し、比較領域CAの位置と大きさと回転角度を変えながら、比較領域CA内の画像と各目テンプレート14cの画像との類似性を評価する。そして、類似性が一定の基準を満足する2つの比較領域CAを、その位置に応じて右目領域、左目領域と判定する。本実施形態では様々な目が検出できるように、例えば一重まぶたの目や、二重まぶたの目や、半開き状態の目など、種々の目を含む画像が、各種目テンプレート14cとして用意されている。本明細書では、図を正面から見たときに右側に図示されている目が対象画像内の人物の左目であり、図を正面から見たときに左側に図示されている目が当該人物の右目である。なお、左右の目が検出できるように、目テンプレート14cには左目のものと右目のものが多数含まれている。   In S120, the facial organ detection unit 22 detects the left and right eyes as facial organs. The face organ detection unit 22 detects the right eye region and the left eye region from the face image data FD by pattern matching using a plurality of templates (eye templates 14c). The face organ detection unit 22 also sets a rectangular comparison area CA in the face image data FD when performing pattern matching with the eye template 14c, and changes the position, size, and rotation angle of the comparison area CA while changing the comparison area CA. The similarity between the image inside and the image of each eye template 14c is evaluated. Then, the two comparison areas CA whose similarity satisfies a certain criterion are determined as a right eye area and a left eye area according to their positions. In this embodiment, images including various eyes such as a single eyelid, a double eyelid, and a half-opened eye are prepared as various eye templates 14c so that various eyes can be detected. . In this specification, when the figure is viewed from the front, the eye shown on the right is the left eye of the person in the target image, and when the figure is viewed from the front, the eye shown on the left is the person's left eye. Right eye. Note that the eye template 14c includes a large number of left eye and right eye so that the left and right eyes can be detected.

図5は、左右の目がそれぞれ存在する比較領域CAが検出された顔画像データFDの様子を示している。同図において、左目を中央に含む矩形状の比較領域CA1および右目を中央に含む矩形状の比較領域CA2が検出されている。比較領域CA1は左目領域であり、比較領域CA2は右目領域である。比較領域CA1,CA2の大きさは、それぞれが含む目の大きさに応じて確定されている。右目領域および左目領域の検出が完了すると、S125において、両目サイズ検出部221の傾き補正部P2c1が、比較領域CA1,CA2の各重心の座標を算出し、当該重心同士を結んだ直線の水平線に対する傾きGRを算出する。上述したように顔領域検出の段階で30度単位の回転角補正がなされているため、ここでは基本的に±15度以内の角度に対応した傾きGRが算出される。   FIG. 5 shows a state of the face image data FD in which the comparison area CA where the left and right eyes are present is detected. In the figure, a rectangular comparison area CA1 including the left eye in the center and a rectangular comparison area CA2 including the right eye in the center are detected. The comparison area CA1 is a left eye area, and the comparison area CA2 is a right eye area. The sizes of the comparison areas CA1 and CA2 are determined according to the size of the eyes included in each. When the detection of the right eye region and the left eye region is completed, in S125, the inclination correction unit P2c1 of the both-eye size detection unit 221 calculates the coordinates of the centroids of the comparison regions CA1 and CA2, and with respect to the straight horizontal line connecting the centroids. The inclination GR is calculated. As described above, since the rotation angle correction is performed in units of 30 degrees at the face area detection stage, the inclination GR corresponding to an angle within ± 15 degrees is basically calculated here.

図6は、両目サイズ検出部221を中心とした顔器官検出部22のソフトウェア構成を示している。両目サイズ検出部221は、傾き補正部P2c1とサンプリング部P2c2とスカラー変換部P2c3と変換関数設定部P2c4とパラメータ探索部P2c5と評価値算出部P2c6とから構成されている。
S130においては、傾き補正部P2c1が顔画像データFDから比較領域CA1,CA2に属する画像をそれぞれ左目画像データLEと右目画像データREとして抽出する。このとき、左目画像データLEと右目画像データREに対してS125にて算出した傾きGRに応じた傾き補正を行う。
FIG. 6 shows a software configuration of the facial organ detection unit 22 with the binocular size detection unit 221 as the center. The both-eye size detection unit 221 includes an inclination correction unit P2c1, a sampling unit P2c2, a scalar conversion unit P2c3, a conversion function setting unit P2c4, a parameter search unit P2c5, and an evaluation value calculation unit P2c6.
In S130, the inclination correction unit P2c1 extracts images belonging to the comparison areas CA1 and CA2 from the face image data FD as the left eye image data LE and the right eye image data RE, respectively. At this time, inclination correction according to the inclination GR calculated in S125 is performed on the left eye image data LE and the right eye image data RE.

図7は、S130において傾き補正部P2c1が実行する傾き補正の様子を概念的に示している。同図において、矩形状の比較領域CA1の上辺と下辺を傾きGRに応じて傾斜させ、傾斜後の比較領域CA1(破線で図示)に属する画素を抽出する。比較領域CA1の上辺と下辺が傾きGRに応じて傾斜しているため、抽出された各画素列の位置がずれることとなる。そして、抽出した各画素列の上端・下端位置を揃えることにより、矩形状とし、左目画像データLEと右目画像データREを得る。これにより、左目画像データLEと右目画像データREに含まれる目の傾きを解消することができ、左目画像データLEと右目画像データREにおいて目をほぼ水平とすることができる。なお、本来の画像から画素の位置をずらしているため、輪郭の滑らかさが不正確になったり、目の形状がいびつとなることも考えられるが、±15度以内に対応する量の傾きを調整するに過ぎないため、問題とはならない。以上のようにして左目画像データLEと右目画像データREが得られると、左目画像データLEと右目画像データREをスカラー量Zの画像データに変換する処理をS135にて実行する。左目画像データLEと右目画像データREにおける鉛直方向の位置をyと表し、水平方向の位置をxと表すとともに、それぞれ左上隅をx=y=0とする。   FIG. 7 conceptually shows the state of inclination correction executed by the inclination correction unit P2c1 in S130. In the drawing, the upper side and the lower side of the rectangular comparison area CA1 are inclined according to the inclination GR, and pixels belonging to the comparison area CA1 (shown by a broken line) after the inclination are extracted. Since the upper side and the lower side of the comparison area CA1 are inclined according to the inclination GR, the positions of the extracted pixel columns are shifted. Then, by aligning the upper end / lower end positions of the extracted pixel columns, the left eye image data LE and the right eye image data RE are obtained. Thereby, the inclination of the eyes included in the left eye image data LE and the right eye image data RE can be eliminated, and the eyes can be made almost horizontal in the left eye image data LE and the right eye image data RE. In addition, since the pixel position is shifted from the original image, the smoothness of the contour may be inaccurate or the shape of the eye may be distorted, but the corresponding amount of inclination within ± 15 degrees It is not a problem because it is just an adjustment. When the left-eye image data LE and the right-eye image data RE are obtained as described above, a process of converting the left-eye image data LE and the right-eye image data RE into image data having a scalar quantity Z is executed in S135. The vertical position in the left eye image data LE and the right eye image data RE is represented by y, the horizontal position is represented by x, and the upper left corner is x = y = 0.

図8は、S135にて実行するスカラー変換処理の流れを示している。左目画像データLEと右目画像データREは各画素がRGB階調(RGBベクトル)を有する画像データであるが、スカラー変換処理では、左目画像データLEと右目画像データREを各画素がスカラー量Zの情報を有する画像データに変換する処理を実行する。まず、S210において、サンプリング部P2c2が顔画像データFDの一部の画素をサンプリングする。   FIG. 8 shows the flow of the scalar conversion process executed in S135. The left-eye image data LE and the right-eye image data RE are image data in which each pixel has RGB gradation (RGB vector). In the scalar conversion process, the left-eye image data LE and the right-eye image data RE each have a scalar amount Z. A process of converting into image data having information is executed. First, in S210, the sampling unit P2c2 samples some pixels of the face image data FD.

図9は、S210におけるサンプリングの様子を示している。顔画像データFDにおいて左右の目を含む比較領域CA1,CA2の左下隅と右下隅を結ぶ線分L1と、比較領域CA1,CA2の間において線分L1を2等分する鉛直方向の線分L2が示されている。線分L1,L2は所定の長さを有しており、線分L1,L2に対応する位置の画素を本実施形態のサンプリングの対象とする。線分L1,L2は、目の下の略一定の高さの位置と、左右の目の間の位置に対応している。このような位置からサンプリングすることにより、顔の輪郭外や目や眉毛や鼻の穴や口などの色の画素はサンプリングされなくなり、基本的に肌色の画素のみをサンプリングすることができる。また、線分L1,L2の双方からサンプリングを行うようにしているため、仮に線分L1,L2の一部に眼鏡のフレームや前髪などの肌色以外の画素が含まれたとしても、後述する統計指標への影響を抑えることができる。むろん、ある程度、肌色のみに絞り込むことができればよく、例えば頬や額等の他の領域からサンプリングを行うようにしてもよい。   FIG. 9 shows the state of sampling in S210. In the face image data FD, a line segment L1 connecting the lower left corner and the lower right corner of the comparison areas CA1 and CA2 including the left and right eyes, and a vertical line segment L2 that bisects the line segment L1 between the comparison areas CA1 and CA2. It is shown. The line segments L1 and L2 have a predetermined length, and pixels at positions corresponding to the line segments L1 and L2 are set as sampling targets in the present embodiment. The line segments L1 and L2 correspond to a position at a substantially constant height below the eyes and a position between the left and right eyes. By sampling from such a position, pixels of colors such as outside the outline of the face, eyes, eyebrows, nostrils and mouth are not sampled, and basically only the skin-colored pixels can be sampled. Further, since sampling is performed from both the line segments L1 and L2, even if pixels other than skin color such as a frame of eyeglasses or bangs are included in a part of the line segments L1 and L2, the statistics described later are used. The influence on the indicator can be suppressed. Of course, it is only necessary to narrow the skin color to some extent. For example, sampling may be performed from another region such as a cheek or forehead.

サンプリング部P2c2は、サンプリング対象の画素のRGB階調を取得し、RGB階調の平均μ(μR,μG,μB)と分散・共分散行列Sを統計指標として算出する。平均μは、RGB各チャネルごとに階調の相加平均を算出することによって得ることができる。また、分散・共分散行列Sは下記の(1)式によって定義される。


前記の(1)式において、SR,SG,SBはRGB各チャネルについての分散を示しており、SRG,SGB,SRBはR−G,G−B,R−B間の共分散を示している。
The sampling unit P2c2 acquires the RGB gradation of the pixel to be sampled, and calculates the average μ (μ R , μ G , μ B ) of the RGB gradation and the variance / covariance matrix S as statistical indexes. The average μ can be obtained by calculating an arithmetic average of gradations for each RGB channel. The variance / covariance matrix S is defined by the following equation (1).


In the above equation (1), S R , S G , and S B indicate dispersion for each RGB channel, and S RG , S GB , and S RB are between RG , GB , and RB . Covariance is shown.

図10は、S210におけるサンプリングによって得られる平均μ(μR,μG,μB)と分散SR,SG,SBをグラフによって示している。本実施形態において、サンプリングされた画素が示す色の3次元のRGB色空間における分布は正規分布N(μ,S)であると仮定しており、RGB階調分布がそれぞれ平均μ(μR,μG,μB)を中心とした正規分布NR(μR,SR),NG(μG,SG),NB(μB,SB)と仮定されている様子が図示されている。平均μ(μR,μG,μB)は、検出された顔において最も標準的な肌色を示し、分散SR,SG,SBは肌色を示す各チャネルの階調のばらつきの程度を示している。通常、分散SR,SG,SBはそれぞれ異なる大きさとなるが、平均μ(μR,μG,μB)に各分散SR,SG,SBの平方根(標準偏差)を加減算した値で囲まれた範囲の確率は68.2%となる。 FIG. 10 is a graph showing the average μ (μ R , μ G , μ B ) obtained by sampling in S210 and the variances S R , S G , S B. In the present embodiment, it is assumed that the distribution of the color indicated by the sampled pixel in the three-dimensional RGB color space is a normal distribution N (μ, S), and the RGB gradation distribution has an average μ (μ R , It is illustrated that normal distributions N RR , S R ), N GG , S G ), and N BB , S B ) centered on μ G , μ B ) are illustrated. ing. The average μ (μ R , μ G , μ B ) indicates the most standard skin color in the detected face, and the variances S R , S G , S B indicate the degree of gradation variation of each channel indicating the skin color. Show. Usually, the variances S R , S G , and S B have different sizes, but the mean μ (μ R , μ G , μ B ) is added to or subtracted from the square root (standard deviation) of each variance S R , S G , S B. The probability of the range surrounded by the values is 68.2%.

なお、本明細書において“肌色”とは、絶対的な色彩値が特定される特定色を意味するのではなく、平均μ(μR,μG,μB)の付近に分布する色を意味する。従って、処理対象の顔に応じて“肌色”が意味する絶対色が変動することとなる。平均μと分散行列Sが得られると、S220において、スカラー変換部P2c3は、各画素がRGB階調を有する左目画像データLEと右目画像データREを取得する。なお、以降の処理は左目画像データLEと右目画像データREのそれぞれについて行われるが、左目画像データLEに対する処理を例に挙げて説明する。 In this specification, “skin color” does not mean a specific color whose absolute color value is specified, but a color distributed in the vicinity of an average μ (μ R , μ G , μ B ). To do. Therefore, the absolute color meaning “skin color” varies depending on the face to be processed. When the average μ and the variance matrix S are obtained, in S220, the scalar conversion unit P2c3 acquires the left eye image data LE and the right eye image data RE in which each pixel has RGB gradation. The subsequent processing is performed for each of the left-eye image data LE and the right-eye image data RE. The processing for the left-eye image data LE will be described as an example.

S230において、スカラー変換部P2c3は、左目画像データLEから一つの画素を順次選択し、選択した画素のRGB階調(r,g,b)を下記の(2)式に代入することよってマハラノビス平方距離DM 2に変換する。

In S230, the scalar conversion unit P2c3 sequentially selects one pixel from the left-eye image data LE, and substitutes the RGB gradation (r, g, b) of the selected pixel into the following equation (2) to thereby calculate the Mahalanobis square. Convert to distance D M 2 .

前記の(2)式において、Δrは(r−μR)であり、Δgは(g−μG)であり、Δbは(b−μB)である。マハラノビス平方距離DM 2は、上述した肌色のサンプリングによって得られた標準的な肌色を示す平均μ(μR,μG,μB)と、選択した画素のRGB階調(r,g,b)とのRGB色空間における平方距離(RGB階調値のずれ量)に対応する指標値であり、その大きさはRGB色空間における色のずれ方向に依存しない。すなわち、マハラノビス平方距離DM 2が同じであれば、平均μ(μR,μG,μB)からの色ずれ方向が異なっていても、確率的には同程度の差を有していると考えることができ、以下においてRGB色空間における色ずれ方向を無視した処理を行うことができる。 In the above equation (2), Δr is (r−μ R ), Δg is (g−μ G ), and Δb is (b−μ B ). The Mahalanobis square distance D M 2 is the average μ (μ R , μ G , μ B ) indicating the standard skin color obtained by the above-described skin color sampling, and the RGB gradation (r, g, b) of the selected pixel. The index value corresponding to the square distance in the RGB color space (the shift amount of the RGB gradation values), and the magnitude thereof does not depend on the color shift direction in the RGB color space. That is, if the Mahalanobis square distance D M 2 is the same, even if the color shift directions from the average μ (μ R , μ G , μ B ) are different, there is a difference of the same degree in terms of probability. In the following, it is possible to perform processing ignoring the color misregistration direction in the RGB color space.

図11は、RGB色空間(RG平面)におけるマハラノビス平方距離DM 2の等値線を示している。同図において、横軸はR階調(r)を示し、縦軸はG階調(g)を示している。等値線は、RGB各チャネルの分散SR,SG,SBの相違に起因して、略楕円状となっている。平均μ(μR,μG)においてマハラノビス平方距離DM 2が0となり、RG平面において平均μ(μR,μG)から離れるほどマハラノビス平方距離DM 2が大きくなっている。そのため、左目画像データLEに含まれる肌色とは異なる白目や黒目の画素は、肌色の画素よりもマハラノビス平方距離DM 2が大きくなる。このように、画素の色を示すベクトルとしてのRGB階調(r,g,b)が、標準的な肌色とのRGB階調値のずれ量を示すスカラーとしてのマハラノビス平方距離DM 2に変換することができる。左目画像データLEのすべての画素についてマハラノビス平方距離DM 2への変換が完了すると、左目画像データLEはマハラノビス平方距離DM 2の画像データDM 2(x,y)に変換されたこととなる。 FIG. 11 shows isolines of Mahalanobis square distance D M 2 in the RGB color space (RG plane). In the figure, the horizontal axis indicates the R gradation (r), and the vertical axis indicates the G gradation (g). The isolines are substantially elliptical due to differences in the variances S R , S G , and S B of the RGB channels. Mean μ (μ R, μ G) Mahalanobis square distance D M 2 in the zero, the average in the RG plane μ (μ R, μ G) Mahalanobis square distance D M 2 as the distance from is large. For this reason, white-eye and black-eye pixels different from the skin color included in the left-eye image data LE have a larger Mahalanobis square distance D M 2 than the skin-colored pixels. As described above, the RGB gradation (r, g, b) as a vector indicating the pixel color is converted into the Mahalanobis square distance D M 2 as a scalar indicating the deviation amount of the RGB gradation value from the standard skin color. can do. When the conversion to the Mahalanobis square distance D M 2 is completed for all the pixels of the left eye image data LE, the left eye image data LE has been converted to the image data D M 2 (x, y) of the Mahalanobis square distance D M 2. Become.

S240において、スカラー変換部P2c3は、左目画像データLEの画素を順次選択し、選択した画素のマハラノビス平方距離DM 2を下記の(3)式で示す変換関数に代入することによりスカラー量Zに変換していく。


前記の(3)式においてα、uは前記変換関数の変換特性を決定付けるパラメータである。本実施形態では、α=1に固定し、uの初期値を3とする。
In S240, the scalar conversion unit P2c3 sequentially selects the pixels of the left-eye image data LE, and substitutes the Mahalanobis square distance D M 2 of the selected pixels into the conversion function represented by the following equation (3) to the scalar quantity Z. Convert.


In the above equation (3), α and u are parameters that determine the conversion characteristics of the conversion function. In the present embodiment, α = 1 is fixed, and the initial value of u is 3.

図12は、前記変換関数の変換特性を示している。同図において、横軸は変換前のマハラノビス平方距離DM 2を示し、縦軸は変換後のスカラー量Zを示している。また、ある左目画像データLEの変換前のマハラノビス平方距離DM 2の分布と、変換後のスカラー量Zの分布も示している。スカラー量Zは、マハラノビス平方距離DM 2が0のとき−1となり、マハラノビス平方距離DM 2がパラメータuのとき0となる非線形関数によって表される。ここで、横軸のマハラノビス平方距離DM 2において、パラメータu=3を中心とした領域を第2領域A2と表し、第2領域A2よりもマハラノビス平方距離DM 2の値が大きくなる領域を第1領域A1と表すものとする。この第2領域A2においては、変換関数の傾きが他の領域よりも急となっており、マハラノビス平方距離DM 2の単位変動に応じたスカラー量Zの変動量が他の領域よりも大きくなっている。第2領域A2よりもマハラノビス平方距離DM 2が大きくなる第1領域A1においては、変換後のスカラー量Zが次第に1に飽和していくような変換特性を有している。第2領域A2は、肌色に対応したマハラノビス平方距離DM 2の領域と、非肌色に対応したマハラノビス平方距離DM 2の領域との間に設定されるのが望ましい。この第2領域A2の位置は、パラメータuによって設定されるが、初期のパラメータu=3は以下の根拠に基づいて設定されている。 FIG. 12 shows the conversion characteristics of the conversion function. In the figure, the horizontal axis indicates the Mahalanobis square distance D M 2 before conversion, and the vertical axis indicates the scalar quantity Z after conversion. Further, the distribution of Mahalanobis square distance D M 2 before conversion of certain left-eye image data LE and the distribution of scalar quantity Z after conversion are also shown. Scalar quantity Z is -1 next time Mahalanobis square distance D M 2 is 0, the Mahalanobis square distance D M 2 represented by a nonlinear function becomes 0 when parameter u. Here, in the Mahalanobis square distance D M 2 on the horizontal axis, a region centered on the parameter u = 3 is represented as a second region A2, and a region in which the value of the Mahalanobis square distance D M 2 is larger than the second region A2 is represented. It shall represent with 1st area | region A1. In the second area A2, the slope of the conversion function is steeper than in the other areas, and the amount of variation of the scalar amount Z corresponding to the unit variation of the Mahalanobis square distance D M 2 is larger than in the other regions. ing. In the first region A1 where the Mahalanobis square distance D M 2 is larger than the second region A2, the scalar amount Z after conversion has a characteristics such as going to saturate gradually 1. The second region A2 includes the Mahalanobis square distance D M 2 in the region corresponding to the skin color, is preferably set between the non Mahalanobis squared distance flesh color corresponding to D M 2 area. The position of the second area A2 is set by the parameter u, but the initial parameter u = 3 is set based on the following grounds.

図13は、マハラノビス平方距離DM 2と確率分布の関係をグラフによって示している。同図において、横軸はマハラノビス平方距離DM 2を示している。一方、縦軸は、S210にてサンプリングした肌色の画素のRGB階調の平均μ(μR,μG,μB)と分散・共分散行列Sによって定義される正規分布N(μ,S)における確率分布(下側確率)を示している。同図に示すようにマハラノビス平方距離DM 2は、n次元カイ二乗分布に従う。本実施形態では、RGBの階調値で表されるカラー画像を処理の対象としており、3次元カイ二乗分布(実線で図示)によって各マハラノビス平方距離DM 2に対応する確率を推定することができる。マハラノビス平方距離DM 2=3のとき、下側確率が約60%となっている。すなわち、肌色を示す画素のうち約60%が、マハラノビス平方距離DM 2が3以下となるということが分かる。マハラノビス平方距離DM 2が3を超えてくると、その画素が肌色を示すことが疑わしくなっていくということが推測できる。すなわち、マハラノビス平方距離DM 2が3を超えてくる付近の領域が、肌色に対応したマハラノビス平方距離DM 2の領域と、非肌色に対応したマハラノビス平方距離DM 2の領域との間の領域であると推定できる。そのため、本実施形態では、パラメータuの初期値を3とし、マハラノビス平方距離DM 2が3となる付近の領域を第2領域A2と設定している。なお、モノクロ画像の場合には、マハラノビス平方距離DM 2が1次元カイ二乗分布(破線で図示)に従う。 FIG. 13 is a graph showing the relationship between the Mahalanobis square distance D M 2 and the probability distribution. In the figure, the horizontal axis indicates the Mahalanobis square distance D M 2 . On the other hand, the vertical axis represents the normal distribution N (μ, S) defined by the average μ (μ R , μ G , μ B ) of the RGB gradation of the skin color pixels sampled in S210 and the variance / covariance matrix S. The probability distribution (lower probability) is shown. As shown in the figure, the Mahalanobis square distance D M 2 follows an n-dimensional chi-square distribution. In the present embodiment, a color image represented by RGB gradation values is a processing target, and the probability corresponding to each Mahalanobis square distance D M 2 is estimated by a three-dimensional chi-square distribution (shown by a solid line). it can. When the Mahalanobis square distance D M 2 = 3, the lower probability is about 60%. That is, about 60% of the pixel indicating the flesh color, it can be seen that the Mahalanobis square distance D M 2 is 3 or less. If the Mahalanobis square distance D M 2 exceeds 3, it can be inferred that the pixel becomes suspicious to show skin color. That is, the Mahalanobis area nearby square distance D M 2 comes beyond 3, the Mahalanobis square distance D M 2 in the region corresponding to the skin color, Mahalanobis squared distance between the D M 2 in the region corresponding to the non-skin-color It can be estimated that this is a region. For this reason, in the present embodiment, the initial value of the parameter u is set to 3, and an area in the vicinity where the Mahalanobis square distance D M 2 is 3 is set as the second area A2. In the case of a monochrome image, the Mahalanobis square distance D M 2 follows a one-dimensional chi-square distribution (shown by a broken line).

図12において示した前記変換関数による変換前のマハラノビス平方距離DM 2の分布においては、マハラノビス平方距離DM 2=0を中心とした肌色の分布G1と左目画像データLEに含まれる白(白目)の分布G2と黒(黒目、眉等)の分布G3が存在する。これに対して変換後のスカラー量Zの分布においては、肌色の分布G1はスカラー量Z=−1を中心として分布し、左目画像データLEに含まれる白の分布G2と黒の分布G3は分布全体が1にほぼ飽和した値に変換されている。また、平均μ(μR,μG,μB)が示す標準的な肌色と比較して明るめの肌色や暗めの肌色は、パラメータuの初期値である3付近に位置しており、傾きが急な第2領域A2に存在することとなる。 In the distribution of the Mahalanobis square distance D M 2 before conversion by the conversion function shown in FIG. 12, the skin color distribution G1 centered on the Mahalanobis square distance D M 2 = 0 and the white (white eye) included in the left-eye image data LE. ) Distribution G2 and black (black eyes, eyebrows, etc.) distribution G3. On the other hand, in the distribution of the scalar quantity Z after conversion, the skin color distribution G1 is distributed around the scalar quantity Z = −1, and the white distribution G2 and the black distribution G3 included in the left-eye image data LE are distributions. The whole is converted to a value almost saturated to 1. In addition, the bright skin color and the dark skin color compared to the standard skin color indicated by the average μ (μ R , μ G , μ B ) are located near the initial value 3 of the parameter u, and the slope is It exists in the steep second area A2.

以上説明した変換関数によって、左目画像データLEのすべての画素のマハラノビス平方距離DM 2をスカラー量Zに変換することにより、左目画像データLEをスカラー量Zの画像データZ(x,y)に変換することができる。以下、スカラー量Zの画像データZ(x,y)に変換された左目画像データLE,右目画像データREをZマップとも表記するものとする。なお、Zマップはスカラー量マップに相当する。なお、マハラノビス平方距離DM 2も肌色らしさを示す指標として使用することが可能であるが、上述した変換関数による変換したスカラー量Zによれば、肌色らしいか否かをより明瞭に判別することができる。 By converting the Mahalanobis square distance D M 2 of all the pixels of the left eye image data LE into the scalar quantity Z by the conversion function described above, the left eye image data LE is converted into the image data Z (x, y) of the scalar quantity Z. Can be converted. Hereinafter, the left-eye image data LE and the right-eye image data RE converted into the image data Z (x, y) of the scalar quantity Z are also expressed as a Z map. The Z map corresponds to a scalar quantity map. The Mahalanobis square distance D M 2 can also be used as an indicator of skin color, but according to the scalar amount Z converted by the above-described conversion function, it is possible to more clearly determine whether or not it is likely to be skin color. Can do.

S250において、変換関数設定部P2c4は、スカラー量Zが所定の閾値Th1を超える画素を計数し、当該閾値Th1を超える画素の個数比率(面積比率)が所定の閾値Th2を超えているか否かを判定する。本実施形態では、閾値Th1=0.6とし、閾値Th2=33%とする。図12において、閾値Th1=0.6を破線で示しており、閾値Th1=0.6を超える画素は、飽和しているとみなし、肌色らしくない色であると判断する。また、白の分布G2と黒の分布G3も、閾値Th1=0.6を超える画素に該当することとなる。すなわち、閾値Th1による閾値判定によって左目画像データLEの各画素が肌色らしいか肌色らしくないかを判定することができる。閾値Th1を超える画素の比率が大きいほど、肌色らしくない画素の左目画像データLEにおける面積比率が大きくなるということが言える。   In S250, the conversion function setting unit P2c4 counts pixels in which the scalar amount Z exceeds the predetermined threshold Th1, and determines whether the number ratio (area ratio) of pixels exceeding the threshold Th1 exceeds the predetermined threshold Th2. judge. In this embodiment, the threshold value Th1 = 0.6 and the threshold value Th2 = 33%. In FIG. 12, the threshold value Th1 = 0.6 is indicated by a broken line, and a pixel exceeding the threshold value Th1 = 0.6 is regarded as saturated, and is determined not to be a skin color. Also, the white distribution G2 and the black distribution G3 correspond to pixels exceeding the threshold Th1 = 0.6. That is, it is possible to determine whether each pixel of the left eye image data LE is a skin color or not a skin color by threshold determination based on the threshold Th1. It can be said that the larger the ratio of the pixels exceeding the threshold Th1, the larger the area ratio in the left-eye image data LE of the pixels that do not look like skin color.

本実施形態では、左目画像データLEにおいて肌色らしくない画素が占める面積比率が閾値Th2=33%を超えることが妥当であると仮定し、肌色らしくない画素が占める面積比率が閾値Th2=33%以下である場合には、変換関数設定部P2c4がS260において上述した変換関数のパラメータuを変更する。パラメータuは、正規分布N(μ,S)を仮定した場合の推測値であるため、本実施形態のように実際の面積比率に基づく妥当性によって調整するのが望ましい。なお、本実施形態における閾値Th1,閾値Th2は一例であり、異なる値を採用してもよい。また、面積比率の妥当な範囲を閾値Th2だけでなく、上限値と下限値によって規定するようにしてもよい。   In this embodiment, it is assumed that it is appropriate that the area ratio occupied by pixels that do not appear to be skin-colored in the left-eye image data LE exceeds the threshold value Th2 = 33%, and the area ratio occupied by pixels that do not appear to be skin-colored is the threshold value Th2 = 33% or less If it is, the conversion function setting unit P2c4 changes the parameter u of the conversion function described above in S260. Since the parameter u is an estimated value when a normal distribution N (μ, S) is assumed, it is desirable to adjust the parameter u according to the validity based on the actual area ratio as in the present embodiment. Note that the threshold Th1 and the threshold Th2 in the present embodiment are examples, and different values may be adopted. Further, an appropriate range of the area ratio may be defined not only by the threshold value Th2 but also by an upper limit value and a lower limit value.

S260においては、パラメータuをもとの値の4倍に変更し、S240に戻る。そして、S250において、変更したパラメータuを前記の(3)式に適用し、再度、左目画像データLEのマハラノビス平方距離DM 2をスカラー量Zに変換して、再度、Zマップを得る。S250においては、同様にZマップにおいて肌色らしくない画素の面積比率の妥当性を判定し、妥当でなければ再度パラメータuを4倍する。以上の処理を繰り返して実行することにより、肌色らしくない画素の面積比率の妥当となるまで、変換関数を最適化してくことができる。 In S260, the parameter u is changed to four times the original value, and the process returns to S240. Then, in S250, to apply the changed parameter u in the equation (3), again, by converting the Mahalanobis square distance D M 2 of the left eye image data LE scalar quantity Z, again, to obtain a Z map. In S250, the validity of the area ratio of pixels that are not likely to be skin-colored in the Z map is similarly determined, and if not valid, the parameter u is again multiplied by four. By repeatedly executing the above processing, the conversion function can be optimized until the area ratio of pixels that do not look like a skin color is appropriate.

本実施形態では、パラメータuを順次大きくしていくため、変換関数による変換特性が図12において破線で示すように推移していく。すなわち、傾きが急となる第2領域A2をマハラノビス平方距離DM 2が大きくなる方向にシフトさせていくことができる。これにともなって、第1領域A1の幅が狭められることとなる。このようにすることにより、肌色のばらつきが異なる様々な顔についても、適切な変換関数を設定することができる。S250において、スカラー量Zが閾値Th1を超える画素の比率が所定の閾値Th2を超えていると判定した場合には、パラメータuの変更を行うことなくスカラー変換処理を終了させ、各画素のRGB階調がスカラー量Zの階調値に変換された左目画像データLE(Zマップ)をパラメータ探索部P2c5に出力する。なお、本実施形態では、パラメータuを変更するようにしたが、第1領域A1と第2領域A2の範囲を調整するためにパラメータαも変更してもよい。第1領域A1を広くするためにはパラメータαを大きくし、第2領域A2を広くするためにはパラメータαを小さくすればよい。むろん、パラメータuを大きめに設定し、徐々に小さく変更していってもよい。 In the present embodiment, since the parameter u is sequentially increased, the conversion characteristic by the conversion function changes as indicated by a broken line in FIG. That is, it is possible to gradually shifting the second region A2 where the slope is steeper in the Mahalanobis square distance D M 2 increases direction. Along with this, the width of the first region A1 is narrowed. In this way, an appropriate conversion function can be set for various faces with different skin color variations. In S250, if it is determined that the ratio of pixels in which the scalar quantity Z exceeds the threshold Th1 exceeds the predetermined threshold Th2, the scalar conversion process is terminated without changing the parameter u, and the RGB level of each pixel is determined. The left-eye image data LE (Z map) in which the tone is converted to the gradation value of the scalar quantity Z is output to the parameter search unit P2c5. In the present embodiment, the parameter u is changed. However, the parameter α may be changed in order to adjust the range of the first area A1 and the second area A2. In order to widen the first area A1, the parameter α should be increased, and in order to widen the second area A2, the parameter α should be decreased. Of course, the parameter u may be set larger and gradually changed to be smaller.

図14は、各画素がスカラー量Z(x,y)で表されるZマップの一例を示している。同図において、左目画像データLEの鉛直断面と水平断面におけるスカラー量Z(x,y)を示している。鉛直断面において、黒目に対応する部分はスカラー量Z(x,y)が1に近い値となっており、それ以外の肌色に対応する部分は−1〜0付近の間の値となっている。目の輪郭を構成する黒目と肌色との境界においては、鉛直方向の勾配が大きい値となっている。一方、水平断面において、黒目と白目に対応する部分はともにスカラー量Zが1に近い値となっており、それ以外の肌色に対応する部分は−1に近い値となっている。目の輪郭を構成する白目と肌色との境界における水平方向の勾配が大きい値となっているが、黒目と白目の境界においては勾配が極めて小さくなっている。以上においては、左目画像データLEをZマップに変換する処理を例に挙げて説明したが、同様の処理を右目画像データREについても実行し、右目画像データREもZマップに変換されている。   FIG. 14 shows an example of a Z map in which each pixel is represented by a scalar quantity Z (x, y). In the figure, the scalar quantity Z (x, y) in the vertical section and the horizontal section of the left-eye image data LE is shown. In the vertical section, the portion corresponding to the black eye has a scalar amount Z (x, y) close to 1, and the portion corresponding to the other skin color has a value between −1 and 0. . At the boundary between the black eye and the skin color constituting the outline of the eye, the vertical gradient is large. On the other hand, in the horizontal cross section, the portions corresponding to the black eyes and the white eyes both have a scalar amount Z close to 1, and the other portions corresponding to the skin color have values close to -1. The gradient in the horizontal direction at the boundary between the white eye and the skin color constituting the outline of the eye is a large value, but the gradient is extremely small at the boundary between the black eye and the white eye. In the above description, the processing for converting the left eye image data LE into the Z map has been described as an example. However, the same processing is executed for the right eye image data RE, and the right eye image data RE is also converted into the Z map.

S140において、パラメータ探索部P2c5は、左目画像データLEを変換したZマップを取得する。S145において、パラメータ探索部P2c5は、Zマップにおいて目の輪郭パラメータL,R,T,Bを初期設定する。
図15は、左目のZマップにおける輪郭パラメータL,R,T,Bを示している。輪郭パラメータL,R,T,Bは、左目の輪郭における目尻と目頭と上頂点と下頂点に対応しており、それぞれ水平方向と鉛直方向の座標によってL(xL,yL),R(xR,yR),T(xT,yT),B(xB,yB)と表される。輪郭パラメータL,R,T,Bの初期値が設定できると、左目を近似するための輪郭線O(第1近似曲線)を生成することができる(第1近似手段)。本実施形態において、輪郭線Oは、左上部分の曲線O1と、右上部分の曲線O2と、左下部分の曲線O3と、左下部分の曲線O4によって近似される。各曲線O1〜O4は下記の(4)式で表される。

In S140, the parameter search unit P2c5 acquires a Z map obtained by converting the left eye image data LE. In S145, the parameter search unit P2c5 initializes the eye contour parameters L, R, T, and B in the Z map.
FIG. 15 shows the contour parameters L, R, T, and B in the Z map of the left eye. The contour parameters L, R, T, and B correspond to the corner of the left eye, the top of the eye, the upper vertex, and the lower vertex, respectively, and L (x L , y L ), R ( x R , y R ), T (x T , y T ), and B (x B , y B ). When initial values of the contour parameters L, R, T, and B can be set, a contour line O (first approximate curve) for approximating the left eye can be generated (first approximation means). In the present embodiment, the contour line O is approximated by a curve O1 in the upper left portion, a curve O2 in the upper right portion, a curve O3 in the lower left portion, and a curve O4 in the lower left portion. Each curve O1-O4 is represented by the following formula (4).

前記の(4)式において、曲線O1は輪郭パラメータTの座標を頂点とし、輪郭パラメータLの座標を通過する上に凸の2次曲線で表される。a1,a2は正であり、a3,a4は負とする。曲線O2は輪郭パラメータTの座標を頂点とし、輪郭パラメータRの座標を通過する上に凸の2次曲線で表される。一方、曲線O3は輪郭パラメータBの座標を頂点とし、輪郭パラメータLの座標を通過する下に凸の2次曲線で表される。曲線O4は輪郭パラメータBの座標を頂点とし、輪郭パラメータRの座標を通過する下に凸の2次曲線で表される。輪郭パラメータL,R,T,Bの座標を定めると、曲線O1〜O4が一意に定まるため、輪郭パラメータL,R,T,Bの座標を初期設定することにより、輪郭線Oの位置および形状が初期設定されることとなる。なお、輪郭パラメータL,R,Tおよび輪郭パラメータL,R,Bのそれぞれ3点の組み合わせの位置関係に注目すると、輪郭パラメータL,Rの座標が水平方向の両外側に位置する終端点に相当し、輪郭パラメータT,Bの座標が共通の頂点に相当する。以上のような輪郭線Oを配置するために、輪郭パラメータL,R,T,Bの初期値は、少なくともxL<xT<xR,xL<xB<xR,yT<yL<yB,yT<yR<yBが満足されていればよい。本実施形態では、図15に図示するように左目画像データLEの中央鉛直線に対して左右対称、かつ、中央よりやや下の水平線に対して上下対称に設定する。また、目テンプレート14cにて規格化されている目の輪郭(破線で図示)よりもやや外側に輪郭パラメータL,R,T,Bの座標の初期値を設定する。 In the above equation (4), the curve O1 is represented by a convex quadratic curve that passes through the coordinates of the contour parameter L with the coordinates of the contour parameter T as the vertex. a 1 and a 2 are positive, and a 3 and a 4 are negative. The curve O2 is expressed by a quadratic curve that is convex upward and passes the coordinates of the contour parameter R with the coordinates of the contour parameter T as a vertex. On the other hand, the curve O3 is represented by a quadratic curve that is convex downward passing through the coordinates of the contour parameter L with the coordinates of the contour parameter B as the vertices. The curve O4 is represented by a quadratic curve that is convex downward with the coordinates of the contour parameter B as the vertex and passing through the coordinates of the contour parameter R. When the coordinates of the contour parameters L, R, T, and B are determined, the curves O1 to O4 are uniquely determined. Therefore, by initializing the coordinates of the contour parameters L, R, T, and B, the position and shape of the contour line O are determined. Will be initialized. Note that the coordinates of the contour parameters L, R, T and the contour parameters L, R, B, each of which is a combination of three points, correspond to the end points where the coordinates of the contour parameters L, R are located on both outer sides in the horizontal direction. The coordinates of the contour parameters T and B correspond to a common vertex. In order to arrange the contour line O as described above, the initial values of the contour parameters L, R, T, and B are at least x L <x T <x R , x L <x B <x R , y T <y It suffices if L <y B and y T <y R <y B are satisfied. In the present embodiment, as shown in FIG. 15, the left-eye image data LE is set to be symmetrical with respect to the central vertical line and symmetrical with respect to the horizontal line slightly below the center. In addition, initial values of the coordinates of the contour parameters L, R, T, and B are set slightly outside of the eye contour standardized by the eye template 14c (illustrated by a broken line).

以上のようにZマップにて輪郭パラメータL,R,T,Bの座標の初期値が設定されると、S150においてパラメータ探索部P2c5と評価値算出部P2c6が最適な輪郭パラメータL,R,T,Bの探索処理を行う。パラメータ探索部P2c5が輪郭パラメータL,R,T,Bを更新し、当該更新した輪郭パラメータL,R,T,Bを評価値算出部P2c6に出力すると、評価値算出部P2c6は下記の評価値Vを算出し、当該評価値Vをパラメータ探索部P2c5に返す。そして、パラメータ探索部P2c5は評価値Vを最大とする輪郭パラメータL,R,T,Bの座標を探索する。   As described above, when the initial values of the coordinates of the contour parameters L, R, T, and B are set in the Z map, the parameter search unit P2c5 and the evaluation value calculation unit P2c6 perform optimum contour parameters L, R, and T in S150. , B search processing is performed. When the parameter search unit P2c5 updates the contour parameters L, R, T, and B and outputs the updated contour parameters L, R, T, and B to the evaluation value calculation unit P2c6, the evaluation value calculation unit P2c6 V is calculated, and the evaluation value V is returned to the parameter search unit P2c5. Then, the parameter search unit P2c5 searches for the coordinates of the contour parameters L, R, T, and B that maximize the evaluation value V.

図16は、評価値Vの概念を模式的に説明している。図16において、輪郭線O上において長さdlを有する微小線要素と、当該微小線要素の法線単位ベクトルpが示されている。曲線O1〜O4が前記の(4)式によって特定できるため、任意の微小線要素についての法線単位ベクトルpを求めることができる。なお、法線単位ベクトルpは内側方向が正となるようにする。すなわち、曲線O1,O2上の微小線要素の法線単位ベクトルpのy成分は下方向を正とし、反対に曲線O3,O4上の微小線要素の法線単位ベクトルpのy成分は上方向を正とする。また、曲線O1,O3上の微小線要素の法線単位ベクトルpのx成分は右方向を正とし、反対に曲線O2,O4上の微小線要素の法線単位ベクトルpのx成分は左方向を正とする。勾配ベクトルgは下記の(5)式で表される。

FIG. 16 schematically illustrates the concept of the evaluation value V. In FIG. 16, a microline element having a length dl on the outline O and a normal unit vector p of the microline element are shown. Since the curves O1 to O4 can be specified by the above equation (4), the normal unit vector p for an arbitrary minute line element can be obtained. The normal unit vector p is set so that the inner direction is positive. That is, the y component of the normal unit vector p of the minute line element on the curves O1 and O2 is positive in the downward direction, and the y component of the normal unit vector p of the minute line element on the curves O3 and O4 is upward. Is positive. Further, the x component of the normal unit vector p of the minute line element on the curves O1 and O3 is positive in the right direction, and conversely, the x component of the normal unit vector p of the minute line element on the curves O2 and O4 is in the left direction. Is positive. The gradient vector g is expressed by the following equation (5).

前記の(5)式において、勾配ベクトルgは、水平方向の勾配と鉛直方向の勾配によって与えられ、肌色らしさを示すスカラー量Z(x,y)の変動が激しい領域ほど大きくなる。評価値算出部P2c6は、以上説明した法線単位ベクトルpと勾配ベクトルgを使用し、下記の(6)式によって輪郭線Oの輪郭への近似性を評価する評価値Vを算出する。

In the above equation (5), the gradient vector g is given by a horizontal gradient and a vertical gradient, and becomes larger in a region where the variation of the scalar quantity Z (x, y) indicating the skin color is more severe. The evaluation value calculation unit P2c6 uses the normal unit vector p and the gradient vector g described above, and calculates an evaluation value V for evaluating the closeness of the contour line O to the contour by the following equation (6).

前記の(6)式において、評価値Vは微小線要素に関する法線単位ベクトルpと勾配ベクトルgの内積(微少評価値)を輪郭線Oに沿って線積分(合計)することにより求められる。ただし、輪郭線Oの下側部分の曲線O3,O4に関する積分値に対して、輪郭線Oの上側部分の曲線O1,O2に関する積分値を2倍に重み付けしている。法線単位ベクトルpと勾配ベクトルgの内積は、法線単位ベクトルpと勾配ベクトルgが同じ方向であり、かつ、勾配ベクトルgが大きいほど大きい値となる。従って、輪郭線Oを構成する各微小線要素がスカラー量Z(x,y)の勾配方向に直交し、かつ、勾配が大きいほど評価値Vが大きい値となる。   In the above equation (6), the evaluation value V is obtained by performing line integration (total) along the contour O of the inner product (small evaluation value) of the normal unit vector p and the gradient vector g regarding the minute line element. However, the integral value relating to the curves O1 and O2 in the upper part of the contour O is weighted twice as much as the integral value relating to the curves O3 and O4 in the lower part of the contour O. The inner product of the normal unit vector p and the gradient vector g becomes larger as the normal unit vector p and the gradient vector g are in the same direction and the gradient vector g is larger. Accordingly, each microline element constituting the contour O is orthogonal to the gradient direction of the scalar quantity Z (x, y), and the evaluation value V increases as the gradient increases.

スカラー量Z(x,y)の勾配は、肌色らしさが変動する程度であると考えることができるため、評価値Vが大きいと、輪郭線Oが肌色らしさの変動が大きい領域を通過していると評価することができる。すなわち、評価値Vが大きいと、輪郭線Oが肌色らしさの変動が大きくなる目の輪郭を通過していると考えることができる。特に、スカラー量Z(x,y)は、肌色であることが疑わしい第2領域A2において変動が激しくなるように変換されているため、肌色でない目の輪郭付近では、勾配が極端に大きくなる。一方、図12で示したように白の分布G2と黒の分布G3は、双方とも1に近い値に飽和しており、白目と黒目の境界であってもスカラー量Z(x,y)の勾配は小さいものとなる。すなわち、マハラノビス平方距離DM 2において白の分布G2と黒の分布G3が異なる値を示していても、変換関数によってスカラー量Zに変換することにより、白の分布G2と黒の分布G3のマハラノビス平方距離DM 2の差を微少なものに変換することができ、これらの間でスカラー量Zの勾配を生じなくさせることができる。従って、白目と黒目の境界について評価値Vが大きくなることが防止でき、白目と黒目の境界と目の輪郭を明確に区別することができる。なお、概念的な理解を容易とするために、連続的な画像平面上において評価値Vや勾配ベクトルgや法線ベクトルnが算出されるように説明したが、現実には離散的な画像平面において等価な演算が行われることとなる。以下に説明する探索処理(探索手段、輪郭検出手段)においては、評価値Vを大きくさせる輪郭パラメータL,R,T,Bの座標を探索していく。 Since the gradient of the scalar quantity Z (x, y) can be considered to be a degree that the skin color-likeness fluctuates, when the evaluation value V is large, the contour line O passes through a region where the skin-color-likeness fluctuation is large. Can be evaluated. That is, when the evaluation value V is large, it can be considered that the contour line O passes through the contour of the eye where the variation in skin color is large. In particular, the scalar amount Z (x, y) is converted so as to fluctuate severely in the second region A2 suspected of being a skin color, so that the gradient becomes extremely large in the vicinity of the contour of the eye that is not a skin color. On the other hand, as shown in FIG. 12, the white distribution G2 and the black distribution G3 are both saturated to a value close to 1, and the scalar quantity Z (x, y) of the boundary between the white eye and the black eye is also obtained. The gradient will be small. That is, even if the white distribution G2 and the black distribution G3 show different values at the Mahalanobis square distance D M 2 , the Mahalanobis of the white distribution G2 and the black distribution G3 is converted by converting to a scalar quantity Z by a conversion function. The difference in the square distance D M 2 can be converted into a minute one, and the gradient of the scalar quantity Z can be prevented from occurring between them. Therefore, it is possible to prevent the evaluation value V from increasing at the boundary between the white eye and the black eye, and to clearly distinguish the boundary between the white eye and the black eye and the outline of the eye. In order to facilitate conceptual understanding, the evaluation value V, the gradient vector g, and the normal vector n have been described to be calculated on a continuous image plane. In this case, an equivalent operation is performed. In the search processing (search means, contour detection means) described below, the coordinates of contour parameters L, R, T, and B that increase the evaluation value V are searched.

図17は、探索処理における探索の手順を模式的に説明している。同図において、輪郭パラメータL,R,T,Bの移動パターンが示されており、当該移動パターンが第1〜4フェーズから構成されている。第1フェーズにおいては、現在の輪郭パラメータL,R,T,Bの座標(a)から対角4方向に2画素分ずれた4座標(b,c,d,e)に輪郭パラメータL,R,T,Bを移動させる。第2フェーズにおいては、現在の輪郭パラメータL,R,T,Bの座標(a)から鉛直水平方向に2画素分ずれた4座標(b,c,d,e)に輪郭パラメータL,R,T,Bを移動させる。第3フェーズにおいては、現在の輪郭パラメータL,R,T,Bの座標(a)から対角4方向に1画素分ずれた4座標(b,c,d,e)に輪郭パラメータL,R,T,Bを移動させる。第4フェーズにおいては、現在の輪郭パラメータL,R,T,Bの座標(a)から鉛直水平方向に1画素分ずれた4座標(b,c,d,e)に輪郭パラメータL,R,T,Bを移動させる。第4フェーズが完了した時点で探索処理を終了する。   FIG. 17 schematically illustrates a search procedure in the search process. In the figure, the movement patterns of the contour parameters L, R, T, and B are shown, and the movement pattern is composed of the first to fourth phases. In the first phase, the contour parameters L, R are changed to four coordinates (b, c, d, e) shifted by two pixels in the diagonal four directions from the coordinates (a) of the current contour parameters L, R, T, B. , T, B are moved. In the second phase, the contour parameters L, R, T, B are shifted from the coordinates (a) of the current contour parameters L, R, T, B by two pixels in the vertical and horizontal directions (b, c, d, e). Move T and B. In the third phase, the contour parameters L, R are changed to four coordinates (b, c, d, e) shifted by one pixel in the four diagonal directions from the coordinates (a) of the current contour parameters L, R, T, B. , T, B are moved. In the fourth phase, the contour parameters L, R, Move T and B. The search process is terminated when the fourth phase is completed.

図18は、各フェーズにおける詳細な探索手順を示している。まず直前のフェーズ(第1フェーズにおいては初期値)によって決定された現在の輪郭パラメータL,R,T,Bの座標(a)を中心として、図17に示す移動パターンにしたがって輪郭パラメータL,R,T,Bを移動させる。輪郭パラメータL,R,T,Bを同時に移動させるのではなく、L→R→T→Bの順で移動させる。まず現在の輪郭パラメータL,R,T,Bを評価値算出部P2c6に出力し、評価値Vaを算出する。次に輪郭パラメータR,T,Bを固定し、輪郭パラメータLを現在の座標(a)のまわりの4座標(b,c,d,e)に順次移動させる。このとき輪郭パラメータLが移動するごとに、輪郭パラメータL,R,T,Bを評価値算出部P2c6に出力し、評価値Va,Vb,Vc,Vd,Veを算出する。なお、4座標(b,c,d,e)への移動順序はどのようなものであってもよい。以上のようにして4座標(a,b,c,d,e)の輪郭パラメータLについての評価値Va,Vb,Vc,Vd,Veが得られると、評価値Va,Vb,Vc,Vd,Veに基づいて評価値Vを極大化させる輪郭パラメータLの座標(h)を予測する。 FIG. 18 shows a detailed search procedure in each phase. First, the contour parameters L, R are centered on the coordinates (a) of the current contour parameters L, R, T, B determined in the immediately preceding phase (initial values in the first phase) according to the movement pattern shown in FIG. , T, B are moved. The contour parameters L, R, T, and B are not moved simultaneously, but are moved in the order of L → R → T → B. First current contour parameter L, and outputs R, T, and B to the evaluation value calculation unit P2c6, calculates an evaluation value V a. Next, the contour parameters R, T, and B are fixed, and the contour parameter L is sequentially moved to four coordinates (b, c, d, e) around the current coordinate (a). At this time, every time the contour parameter L moves, the contour parameters L, R, T, and B are output to the evaluation value calculation unit P2c6, and the evaluation values V a , V b , V c , V d , and V e are calculated. The order of movement to the four coordinates (b, c, d, e) may be any. When the evaluation values V a , V b , V c , V d , and V e for the contour parameter L of the four coordinates (a, b, c, d, e) are obtained as described above, the evaluation values V a , Based on V b , V c , V d , and V e , the coordinate (h) of the contour parameter L that maximizes the evaluation value V is predicted.

まず、現在の輪郭パラメータLの座標(a)を通過する線分b−a−cに関する評価値Va,Vb,Vcを通る2次曲線を算出し、当該2次曲線を極大化させる座標を算出する。なお、当該2次曲線が上に凸であり、かつ、頂点が線分b−a−cの間にある場合のみ、前記2次曲線を極大化させる座標が算出できる。前記2次曲線を極大化させる座標(f)が算出できない場合には、端の評価値Vb,Vcのうち大きい方の座標(b)または座標(c)を座標(f)とする。そして、線分d−a−eに平行かつ座標(f)を通過する直線l1を生成する。次に、現在の輪郭パラメータLの座標(a)を通過し、線分b−a−cに直交する線分d−a−eに関する評価値Va,Vd,Veを通る2次曲線を算出し、当該2次曲線を極大化させる座標(g)を同様の手順で算出する。そして、線分b−a−cに平行かつ座標(g)を通過する直線l2を生成する。 First, a quadratic curve passing through the evaluation values V a , V b , and V c regarding the line segment b-ac passing through the coordinates (a) of the current contour parameter L is calculated, and the quadratic curve is maximized. Calculate the coordinates. It should be noted that coordinates that maximize the quadratic curve can be calculated only when the quadratic curve is convex upward and the vertex is between the line segments b-ac. When the coordinate (f) that maximizes the quadratic curve cannot be calculated, the larger coordinate (b) or coordinate (c) of the end evaluation values V b and V c is set as the coordinate (f). Then, a straight line l1 parallel to the line segment d-a-e and passing through the coordinate (f) is generated. Next, a quadratic curve that passes through the coordinates (a) of the current contour parameter L and passes through the evaluation values V a , V d , and V e regarding the line segment d-a-e orthogonal to the line segment b-a-c. And the coordinates (g) for maximizing the quadratic curve are calculated in the same procedure. Then, a straight line l2 parallel to the line segment b-a-c and passing through the coordinate (g) is generated.

以上のようにして直線l1,l2が生成できると、これらの交点の座標を輪郭パラメータLの座標(h)として算出する。この座標(h)が算出できると、輪郭パラメータLを座標(h)に移動させ、そのときの評価値Vhを算出する。以上のようにして、6個の評価値Va,Vb,Vc,Vd,Ve,Vhが算出できると、これらのうち最も大きいものに対応する座標を当該フェーズにおける最適な輪郭パラメータLの座標として決定する。輪郭パラメータLについて最適な座標が決定すると、次に輪郭パラメータRについて同様の処理を行って最適な座標を決定する。さらに、輪郭パラメータT,Bについて順に同様の処理を行って最適な座標を決定し、当該フェーズを終了させ、次のフェーズに移行する。第4フェーズが完了した段階で、最終的に輪郭パラメータL,R,T,Bを確定させる。 When the straight lines l1 and l2 can be generated as described above, the coordinates of these intersections are calculated as the coordinates (h) of the contour parameter L. When this coordinate (h) can be calculated, the contour parameter L is moved to the coordinate (h), and the evaluation value V h at that time is calculated. When the six evaluation values V a , V b , V c , V d , V e , and V h can be calculated as described above, the coordinate corresponding to the largest one of these is obtained as the optimum contour in the phase. Determined as the coordinates of the parameter L. When the optimum coordinates for the contour parameter L are determined, the same processing is performed for the contour parameter R to determine the optimum coordinates. Further, the same processing is sequentially performed on the contour parameters T and B to determine the optimum coordinates, the phase is terminated, and the process proceeds to the next phase. When the fourth phase is completed, the contour parameters L, R, T, and B are finally determined.

以上説明したように、探索の初期の第1,2フェーズにおいては広範囲に輪郭パラメータL,R,T,Bを移動させるため、輪郭パラメータL,R,T,Bの座標をおおまかに目尻、目頭、上頂点、下頂点に近づけさせることができる。さらに、探索の後期の第3,4フェーズにおいては狭い範囲で局所的に輪郭パラメータL,R,T,Bを移動させるため、より目尻、目頭、上頂点、下頂点に収束するように輪郭パラメータL,R,T,Bの座標を微調整することできる。なお、一定の評価値Vに到達した時点で探索を終了させ、そのときの輪郭パラメータL,R,T,Bを出力してもよい。   As described above, in the first and second phases of the initial search, the contour parameters L, R, T, and B are moved over a wide range. , Close to the top and bottom vertices. Further, in the third and fourth phases in the latter half of the search, the contour parameters L, R, T, and B are locally moved within a narrow range, so that the contour parameters are converged so as to converge to the corner of the eye, the top of the eye, the upper vertex, and the lower vertex The coordinates of L, R, T, and B can be finely adjusted. The search may be terminated when the constant evaluation value V is reached, and the contour parameters L, R, T, and B at that time may be output.

このように最終的に探索された左目についての輪郭パラメータL,R,T,Bを、内部メモリ12の所定領域に記憶し、引き続き右目の輪郭検出を実行する。
S155〜S165では、パラメータ探索部P2c5および評価値算出部P2c6が、右目画像データREを変換したZマップに基づいて、上記S140〜S150で説明した処理と同様に、右目の輪郭パラメータL,R,T,Bの探索を行い、最終的に探索された右目の輪郭パラメータL,R,T,Bを内部メモリ12の所定領域に記憶する。
The contour parameters L, R, T, and B for the left eye finally searched in this way are stored in a predetermined area of the internal memory 12, and the contour detection of the right eye is subsequently executed.
In S155 to S165, the parameter search unit P2c5 and the evaluation value calculation unit P2c6, based on the Z map obtained by converting the right eye image data RE, similarly to the processing described in S140 to S150, the right eye contour parameters L, R, The search for T and B is performed, and the finally searched right eye contour parameters L, R, T, and B are stored in a predetermined area of the internal memory 12.

S170では、両目サイズ検出部221は、内部メモリ12に記憶した左目の輪郭パラメータL,R,T,Bを用いて左目のサイズを検出するとともに、内部メモリ12に記憶した右目の輪郭パラメータL,R,T,Bを用いて右目のサイズを検出する。目のサイズといった場合、目の高さ(顔の高さ方向における目の長さ)や目の幅(顔の横方向における目の長さ)や目の面積等、種々の情報が考えられる。本実施形態では、目の高さを目のサイズとして検出する。これは、人顔における左右の目は、その幅は基本的に大きな差はないが、その高さは左右で違いが生じやすいからである。両目サイズ検出部221は、内部メモリ12に記憶した左目の輪郭パラメータL,R,T,BのZマップにおける各y座標値yL,yR,yT,yBのうちの最大値と最小値との差分(多くの場合、yTとyBとの差分)を算出し、当該算出した差分を左目のサイズLSとして取得する。同様に、両目サイズ検出部221は、内部メモリ12に記憶した右目の輪郭パラメータL,R,T,Bの各y座標値のうちの最大値と最小値との差分を算出し、当該算出した差分を右目のサイズRSとして取得する。 In S <b> 170, the both-eye size detection unit 221 detects the left-eye size using the left-eye contour parameters L, R, T, and B stored in the internal memory 12, and the right-eye contour parameter L, stored in the internal memory 12. The size of the right eye is detected using R, T, and B. In the case of the eye size, various information such as eye height (eye length in the face height direction), eye width (eye length in the lateral direction of the face), eye area, and the like can be considered. In this embodiment, the eye height is detected as the eye size. This is because the left and right eyes of a human face are basically not significantly different in width, but the height is likely to be different between left and right. The both-eye size detection unit 221 has a maximum value and a minimum value among the y-coordinate values y L , y R , y T , y B in the Z map of the left eye contour parameters L, R, T, B stored in the internal memory 12. The difference from the value (in many cases, the difference between y T and y B ) is calculated, and the calculated difference is acquired as the size LS of the left eye. Similarly, the both-eye size detection unit 221 calculates the difference between the maximum value and the minimum value among the y-coordinate values of the right-eye contour parameters L, R, T, and B stored in the internal memory 12 and calculates the difference. The difference is acquired as the right eye size RS.

ただし、両目サイズ検出部221は、上記輪郭パラメータを用いることなく、より簡易に左右の目の大きさを表す情報を取得するとしてもよい。上記S120において顔器官検出部22が検出した左目領域(比較領域CA1)および右目領域(比較領域CA2)は、上述したように、それぞれが内包する目の大きさに応じて領域の大きさが決定されている。そこで両目サイズ検出部221は、例えば、顔画像データFDにおける比較領域CA1の鉛直方向の長さ(画素数)を左目のサイズLSとして取得し、顔画像データFDにおける比較領域CA2の鉛直方向の長さ(画素数)を右目のサイズRSとして取得してもよい。比較領域CA1,CA2の辺の長さを目のサイズとして検出する場合には、上記S125〜S165(図3)の処理は不要である。このように本実施形態では、両目サイズ検出部221は、左右それぞれの目の大きさを直接的または間接的に表す情報を、左目のサイズLS、右目のサイズRSとして検出する。以下では、左目のサイズLS、右目のサイズRSを単にLS,RSと表記する。   However, the both-eye size detection unit 221 may acquire information representing the size of the left and right eyes more easily without using the contour parameter. As described above, the size of the region of the left eye region (comparison region CA1) and right eye region (comparison region CA2) detected by the facial organ detection unit 22 in S120 is determined according to the size of the eye contained therein. Has been. Therefore, the binocular size detection unit 221 acquires, for example, the vertical length (number of pixels) of the comparison area CA1 in the face image data FD as the left eye size LS, and the vertical length of the comparison area CA2 in the face image data FD. May be acquired as the size RS of the right eye. When detecting the lengths of the sides of the comparison areas CA1 and CA2 as the eye size, the processing of S125 to S165 (FIG. 3) is not necessary. As described above, in the present embodiment, the binocular size detection unit 221 detects information that directly or indirectly represents the size of the left and right eyes as the left eye size LS and the right eye size RS. Hereinafter, the size LS of the left eye and the size RS of the right eye are simply expressed as LS, RS.

3.補正量の決定処理:
LS,RSが検出されたら、次に、補正量決定部23がLS,RSに基づいて補正量を決定する。
図19は、補正量決定部23が実行するS300(図2)の詳細を、フローチャートにより示している。S305では、補正量決定部23は、LSとRSとの大小判定を行なうことにより、補正量を決定する対象の目を決定する。本実施形態では、左右の目のうちどちらのサイズが小さいか判定し、小さい方の目に対する補正量β(拡大率)を決定する。そして、後述するように、補正量βに基づいて小さい方の目の大きさを拡大するような画像変形(S500)を行なう。
3. Correction amount determination process:
If LS and RS are detected, then the correction amount determination unit 23 determines the correction amount based on LS and RS.
FIG. 19 is a flowchart illustrating details of S300 (FIG. 2) executed by the correction amount determination unit 23. In S305, the correction amount determination unit 23 determines the target eye for determining the correction amount by performing a size determination between LS and RS. In the present embodiment, it is determined which of the left and right eyes is smaller, and the correction amount β (enlargement ratio) for the smaller eye is determined. Then, as will be described later, image deformation (S500) is performed to enlarge the size of the smaller eye based on the correction amount β.

なお、大小判定においてRS=LSと判定された場合は、左右の目の大きさのバランスが取れている状況である。そのため、後述する補正量βの決定およびS500の処理を行なうことなく、プリンタ10は、対象画像を表す画像データ14aに基づいてS700の処理を行なう。以下では、RS<LSと判定された場合、すなわち右目のほうが左目よりも小さいと判定された場合を想定して説明を行なう。
S310では、補正量決定部23は、上記大小判定において補正量の決定対象とされた目(右目)に対する補正量を決定するための関数を生成する。まず、補正量決定部23は、補正量βの最小値と最大値を定める。ここでは、補正量βの最小値を1とし、補正量βの最大値をLS/RSとする。次に、補正量決定部23は、最小値=1、最大値=LS/RSを出力する関数を生成する。
If it is determined that RS = LS in the size determination, the size of the left and right eyes is balanced. Therefore, the printer 10 performs the process of S700 based on the image data 14a representing the target image without determining the correction amount β described later and the process of S500. The following description will be made assuming that it is determined that RS <LS, that is, a case where it is determined that the right eye is smaller than the left eye.
In S310, the correction amount determination unit 23 generates a function for determining the correction amount for the eye (right eye) that is the correction amount determination target in the above-described size determination. First, the correction amount determination unit 23 determines the minimum value and the maximum value of the correction amount β. Here, the minimum value of the correction amount β is 1, and the maximum value of the correction amount β is LS / RS. Next, the correction amount determination unit 23 generates a function that outputs minimum value = 1 and maximum value = LS / RS.

図20は、補正量決定部23が生成する関数F1の一例を示している。同図では、入力値(横軸)=RS/LS、出力値(縦軸)=補正量βとした、上に凸の2次曲線を示している。補正量決定部23は、かかる2次曲線を関数F1として生成する。関数F1は、入力値=0のとき最小値=1を出力し、入力値=1のとき最大値=LS/RSを出力する関数である。なお、関数F1の曲線形状自体は予め定められているものとし、関数F1の縦軸の目盛間隔が、補正量βの最大値に応じて変更される。
S315では、補正量決定部23は、上記生成した関数F1に対してRS/LSを入力することにより補正量βを決定する。このように決定した補正量βが、本実施形態において右目の大きさを拡大するための補正量となる。
FIG. 20 shows an example of the function F1 generated by the correction amount determination unit 23. In the figure, an upwardly convex quadratic curve is shown where the input value (horizontal axis) = RS / LS and the output value (vertical axis) = correction amount β. The correction amount determination unit 23 generates such a quadratic curve as the function F1. The function F1 is a function that outputs the minimum value = 1 when the input value = 0, and outputs the maximum value = LS / RS when the input value = 1. Note that the curve shape itself of the function F1 is predetermined, and the scale interval on the vertical axis of the function F1 is changed according to the maximum value of the correction amount β.
In S315, the correction amount determination unit 23 determines the correction amount β by inputting RS / LS to the generated function F1. The correction amount β thus determined is a correction amount for enlarging the size of the right eye in the present embodiment.

上記関数F1を用いることで、左右の目のうち大きい方の目の大きさに対する小さい方の目の大きさの比率が高いほど小さい方の目の大きさを大きい方の目の大きさに近づかせる補正量βを決定することができる。つまり、上記比率がある程度低い場合には、決定される補正量βも最大値(大きい方の目のサイズ/小さい方の目のサイズ)からある程度離れた値となるため、小さい目に対する過剰な変形(拡大)によって却って画像を破綻させてしまうことが防がれる。一方、上記比率がある程度高い場合には、決定される補正量βも最大値に近い値となり、変形後は両方の目の大きさが略同じとなる。元々両目の大きさの差が少ない場合には、小さい方の目を大きい方の目と同等な大きさまで拡大しても、画像の自然さは損なわれない。   By using the function F1, the smaller eye size is made closer to the larger eye size as the ratio of the smaller eye size to the larger eye size among the left and right eyes increases. The correction amount β to be determined can be determined. That is, when the ratio is low to some extent, the determined correction amount β is also a value that is somewhat away from the maximum value (larger eye size / smaller eye size), so excessive deformation of the small eye It is prevented that the image is broken by (enlargement). On the other hand, when the ratio is high to some extent, the determined correction amount β is also a value close to the maximum value, and the sizes of both eyes are substantially the same after deformation. If the difference in size between the two eyes is originally small, the naturalness of the image is not impaired even if the smaller eye is enlarged to the same size as the larger eye.

ただし、小さい方の目の大きさを拡大するための補正量βの決定方法は、上述した手法に限られない。例えば、補正量決定部23は、LS,RSの平均値Ave=(LS+RS)/2に基づいて、補正量βを決定してもよい。具体的には、後述する画像変形によって小さい方の目(右目)の大きさが平均値Aveにまで略拡大されるように、補正量決定部23は、補正量β=Ave/RSとする。補正量β=Ave/RSと決定すれば、変形後においても左右の目の大きさに差は残るものの、小さい方の目に対する過剰な変形(拡大)が防止され、観察者が違和感を生じない程度に両目の大きさのバランスを調整することができる。あるいは、より単純に、補正量決定部23は、後述する画像変形によって小さい方の目(右目)の大きさが大きい方の目(左目)の大きさまで略拡大されるように、補正量β=LS/RSとしてもよい。
なお、LS<RSであれば、上述した補正量βの決定の際におけるRSとLSとの関係が逆になることは言うまでもない。
However, the method of determining the correction amount β for enlarging the size of the smaller eye is not limited to the method described above. For example, the correction amount determination unit 23 may determine the correction amount β based on the average value Ave = (LS + RS) / 2 of LS and RS. Specifically, the correction amount determination unit 23 sets the correction amount β = Ave / RS so that the size of the smaller eye (right eye) is substantially enlarged to the average value Ave by image deformation described later. If the correction amount β = Ave / RS is determined, the difference between the left and right eye sizes remains even after deformation, but excessive deformation (enlargement) of the smaller eye is prevented, and the observer does not feel uncomfortable. The balance of the size of both eyes can be adjusted to the extent. Or, more simply, the correction amount determination unit 23 corrects the correction amount β = so that the size of the smaller eye (right eye) is enlarged to the size of the larger eye (left eye) by image deformation described later. It may be LS / RS.
Needless to say, if LS <RS, the relationship between RS and LS in determining the correction amount β described above is reversed.

4.変形処理および印刷処理:
補正量βが決定されたら、次に、変形領域設定部24、変形領域分割部25および変形処理実行部26が、補正量βに基づく画像の変形処理を行なう。変形領域設定部24、変形領域分割部25および変形処理実行部26をまとめて変形部と呼ぶこともできる。
図21は、変形部が実行するS500(図2)の詳細を、フローチャートにより示している。S505では、変形領域設定部24が変形領域TAを設定する。変形領域TAは、画像データ14a上の少なくとも顔の一部を含む領域であって画像変形の対象となり得る領域である。変形領域TAの設定は、例えば、S110(図3)で顔領域として検出された比較領域C(図4に示した比較領域CA)を基準にして行なうことができる。以下では、S110で顔領域として検出された比較領域Cを顔領域FAと呼ぶ。
4). Transform and print processing:
After the correction amount β is determined, the deformation area setting unit 24, the deformation area dividing unit 25, and the deformation process executing unit 26 perform an image deformation process based on the correction amount β. The deformation area setting unit 24, the deformation area dividing unit 25, and the deformation process execution unit 26 may be collectively referred to as a deformation unit.
FIG. 21 is a flowchart showing details of S500 (FIG. 2) executed by the deformation unit. In S505, the deformation area setting unit 24 sets the deformation area TA. The deformation area TA is an area that includes at least a part of the face on the image data 14a and can be an object of image deformation. The deformation area TA can be set based on, for example, the comparison area C (comparison area CA shown in FIG. 4) detected as a face area in S110 (FIG. 3). Hereinafter, the comparison area C detected as a face area in S110 is referred to as a face area FA.

図22は、顔領域FAおよび顔領域FAを基準に設定された変形領域TAの一例を示している。同図には、顔領域FAの基準線SLを示している。基準線SLは、顔領域FAの重心を通過する線であって、顔領域FAの顔の高さ方向を向く線である。なお、図22に示した顔領域FAは、図4に示した顔領域(比較領域C)と比較して、画像データ14a上における位置および角度が若干異なっている。これは、変形領域TAの設定前に、変形領域設定部24が、上記S110で検出された顔領域の矩形を、その上辺および下辺が顔の幅方向(例えば、両目の中心を結んだ線が向く方向)と略平行となるように回転させたり、顔内の主要器官が確実に矩形内に入るように基準線SLに沿って移動させたことによる。このような顔領域の角度や位置の調整は、行なってもよいし行なわなくてもよい。   FIG. 22 shows an example of the face area FA and the deformation area TA set based on the face area FA. In the figure, the reference line SL of the face area FA is shown. The reference line SL is a line that passes through the center of gravity of the face area FA and is a line that faces the height direction of the face of the face area FA. Note that the face area FA shown in FIG. 22 is slightly different in position and angle on the image data 14a compared to the face area (comparison area C) shown in FIG. This is because, before the deformation area TA is set, the deformation area setting unit 24 displays the rectangle of the face area detected in S110, and the upper and lower sides of the face area in the width direction of the face (for example, a line connecting the centers of both eyes). This is because the main organs in the face are moved along the reference line SL so as to surely enter the rectangle. Such adjustment of the angle and position of the face area may or may not be performed.

図22に示すように、変形領域TAは、顔領域FAを基準線SLと平行な方向および基準線SLに直行する方向に伸張(または短縮)した領域として設定される。具体的には、顔領域FAの高さ方向の大きさをHf、幅方向の大きさをWfiとすると、顔領域FAを、上方向にk1・Hf、下方向にk2・Hfだけ伸ばすと共に、左右にそれぞれk3・Wfiだけ伸ばした領域が、変形領域TAとして設定される。k1,k2,k3は、所定の係数である。図22に示すように、変形領域TAは、顔の高さ方向に関しては、概ね顎から額までの画像を含み、顔の幅方向に関しては、左右の頬の画像を含むような領域として設定される。本実施形態では、変形領域TAが概ね上述したような範囲の画像を含む領域となるように、顔領域FAの大きさとの関係に基づき、上述の係数k1,k2,k3が予め設定されている。
S510では、変形領域分割部25が、変形領域TAを複数の小領域に分割する。
As shown in FIG. 22, the deformation area TA is set as an area obtained by extending (or shortening) the face area FA in a direction parallel to the reference line SL and in a direction perpendicular to the reference line SL. Specifically, if the size in the height direction of the face area FA is Hf and the size in the width direction is Wfi, the face area FA is extended by k1 · Hf upward and by k2 · Hf downward, A region extended by k3 · Wfi to the left and right is set as the deformation region TA. k1, k2, and k3 are predetermined coefficients. As shown in FIG. 22, the deformation area TA is set as an area that generally includes an image from the chin to the forehead with respect to the height direction of the face and includes images of the left and right cheeks with respect to the width direction of the face. The In the present embodiment, the above-described coefficients k1, k2, and k3 are set in advance based on the relationship with the size of the face area FA so that the deformation area TA is an area that includes an image in the above-described range. .
In S510, the deformation area dividing unit 25 divides the deformation area TA into a plurality of small areas.

図23は、変形領域TAの小領域への分割方法の一例を示す説明図である。変形領域分割部25は、変形領域TAに複数の分割点Dを配置し、分割点Dを結ぶ直線を用いて変形領域TAを複数の小領域に分割する。分割点Dの配置の態様(分割点Dの個数および位置)は、分割点配置パターンテーブル41(図1)により定義されている。変形領域分割部25は、分割点配置パターンテーブル41を参照して分割点Dを配置する。図23に示すように、一例として、分割点Dは水平分割線Lhと垂直分割線Lvとの交点と、水平分割線Lhおよび垂直分割線Lvと変形領域TAの外枠との交点とに配置される。水平分割線Lhおよび垂直分割線Lvは、変形領域TA内に分割点Dを配置するための基準となる線である。図23に示した分割点Dの配置では、基準線SLと直行する2本の水平分割線Lhと、基準線SLに平行な4本の垂直分割線Lvとが設定される。2本の水平分割線Lhを、変形領域TAの下方から順に、Lh1,Lh2と呼ぶ。4本の垂直分割線Lvを、変形領域TAの左から順に、Lv1,Lv2,Lv3,Lv4と呼ぶ。   FIG. 23 is an explanatory diagram showing an example of a method of dividing the deformation area TA into small areas. The deformation area dividing unit 25 arranges a plurality of division points D in the deformation area TA, and divides the deformation area TA into a plurality of small areas using a straight line connecting the division points D. The manner of arrangement of the division points D (the number and position of the division points D) is defined by the division point arrangement pattern table 41 (FIG. 1). The deformation area dividing unit 25 arranges the dividing points D with reference to the dividing point arrangement pattern table 41. As shown in FIG. 23, as an example, the dividing points D are arranged at the intersections of the horizontal dividing line Lh and the vertical dividing line Lv and at the intersections of the horizontal dividing line Lh and the vertical dividing line Lv and the outer frame of the deformation area TA. Is done. The horizontal dividing line Lh and the vertical dividing line Lv are reference lines for arranging the dividing point D in the deformation area TA. In the arrangement of the dividing points D shown in FIG. 23, two horizontal dividing lines Lh perpendicular to the reference line SL and four vertical dividing lines Lv parallel to the reference line SL are set. The two horizontal dividing lines Lh are called Lh1 and Lh2 in order from the bottom of the deformation area TA. The four vertical dividing lines Lv are referred to as Lv1, Lv2, Lv3, and Lv4 in order from the left of the deformation area TA.

水平分割線Lh1は、変形領域TAにおいて、目の画像のすぐ下付に配置され、水平分割線Lh2は、目の画像のすぐ上付近に配置される。垂直分割線Lv1およびLv4は、左右の目尻の画像の外側に配置され、垂直分割線Lv2およびLv3は、左右の目頭の画像の内側に配置される。なお、水平分割線Lhおよび垂直分割線Lvの配置は、水平分割線Lhおよび垂直分割線Lvと画像との位置関係が結果的に上述の位置関係となるように予め設定された変形領域TAの大きさとの対応関係に従い実行される。   The horizontal dividing line Lh1 is arranged immediately below the eye image in the deformation area TA, and the horizontal dividing line Lh2 is arranged in the vicinity immediately above the eye image. The vertical dividing lines Lv1 and Lv4 are arranged outside the left and right eye corner images, and the vertical dividing lines Lv2 and Lv3 are arranged inside the left and right eye images. The horizontal dividing line Lh and the vertical dividing line Lv are arranged in the deformation area TA set in advance so that the positional relationship between the horizontal dividing line Lh and the vertical dividing line Lv and the image becomes the above-described positional relationship as a result. It is executed according to the correspondence with the size.

上述した水平分割線Lhと垂直分割線Lvとの配置に従い、水平分割線Lhと垂直分割線Lvとの交点と、水平分割線Lhおよび垂直分割線Lvと変形領域TAの外枠との交点とに、分割点Dが配置される。図23に示すように、水平分割線Lhi(i=1または2)上に位置する分割点Dを、左から順に、D0i,D1i,D2i,D3i,D4i,D5iと呼ぶ。例えば、水平分割線Lh1上に位置する分割点Dは、D01,D11,D21,D31,D41,D51と呼ばれる。同様に、垂直分割線Lvj(j=1,2,3,4のいずれか)上に位置する分割点Dを、下から順に、Dj0,Dj1,Dj2,Dj3と呼ぶ。例えば、垂直分割線Lv1上に位置する分割点Dは、D10,D11,D12,D13と呼ばれる。なお、図23に示すように、分割点Dの配置は、基準線SLに対して対称の配置となっている。   According to the arrangement of the horizontal dividing line Lh and the vertical dividing line Lv described above, the intersection of the horizontal dividing line Lh and the vertical dividing line Lv, and the intersection of the horizontal dividing line Lh and the vertical dividing line Lv and the outer frame of the deformation area TA In addition, the dividing point D is arranged. As shown in FIG. 23, division points D located on the horizontal division line Lhi (i = 1 or 2) are referred to as D0i, D1i, D2i, D3i, D4i, and D5i in order from the left. For example, the dividing points D located on the horizontal dividing line Lh1 are called D01, D11, D21, D31, D41, D51. Similarly, the dividing points D located on the vertical dividing line Lvj (j = 1, 2, 3, 4) are called Dj0, Dj1, Dj2, Dj3 in order from the bottom. For example, the division points D located on the vertical division line Lv1 are called D10, D11, D12, and D13. As shown in FIG. 23, the arrangement of the dividing points D is symmetrical with respect to the reference line SL.

変形領域分割部25は、配置された分割点Dを結ぶ直線(すなわち水平分割線Lhおよび垂直分割線Lv)により、変形領域TAを複数の小領域に分割する。分割点Dの配置は、水平分割線Lhおよび垂直分割線Lvの本数および位置により定まるため、分割点配置パターンテーブル41は水平分割線Lhおよび垂直分割線Lvの本数および位置を定義していると言い換えることも可能である。
S515では、変形処理実行部26が、変形領域TAを対象とした画像の変形処理を行う。変形処理実行部26による変形処理は、S510で変形領域TA内に配置された分割点Dの位置を移動して、小領域を変形することにより行われる。
The deformation area dividing unit 25 divides the deformation area TA into a plurality of small areas by a straight line connecting the arranged division points D (that is, the horizontal division line Lh and the vertical division line Lv). Since the arrangement of the dividing points D is determined by the numbers and positions of the horizontal dividing lines Lh and the vertical dividing lines Lv, the dividing point arrangement pattern table 41 defines the numbers and positions of the horizontal dividing lines Lh and the vertical dividing lines Lv. It is also possible to paraphrase.
In S515, the deformation process execution unit 26 performs an image deformation process on the deformation area TA. The deformation process by the deformation process execution unit 26 is performed by moving the position of the division point D arranged in the deformation area TA in S510 to deform the small area.

図24は、分割点Dの位置移動の一例を示す説明図である。変形処理実行部26は、補正量決定部23によって補正量βが決定された目(本実施形態においては右目)を囲む分割点Dを、上記決定された補正量βに基づいてV方向(基準線SLと平行な方向)に移動させる。なお図24の説明において用いる“V”は、画像データ14aにおける変形領域TAの方向を意味しており、上記評価値Vとは別の意味である。右目を囲む分割点Dは、D11,D12,D22,D21である。この分割点D11,D12,D22,D21を頂点とする小領域(ハッチングを付して示す小領域)は、特許請求の範囲に言う右目を含む領域の一例に該当する。なお、分割点D31,D32,D42,D41を頂点とする小領域は、特許請求の範囲に言う左目を含む領域の一例に該当する。   FIG. 24 is an explanatory diagram showing an example of the position movement of the dividing point D. The deformation processing execution unit 26 determines the dividing point D surrounding the eye (right eye in the present embodiment) for which the correction amount β is determined by the correction amount determination unit 23 in the V direction (reference) based on the determined correction amount β. In a direction parallel to the line SL). Note that “V” used in the description of FIG. 24 means the direction of the deformation area TA in the image data 14a, and is different from the evaluation value V. The division points D surrounding the right eye are D11, D12, D22, and D21. The small area (small area shown with hatching) having the vertexes at the division points D11, D12, D22, and D21 corresponds to an example of an area including the right eye in the claims. In addition, the small area | region which uses the division | segmentation points D31, D32, D42, and D41 as a vertex corresponds to an example of the area | region containing the left eye said to the claim.

変形処理実行部26は、分割点D11,D12,D22,D21を頂点とする小領域のV方向の距離(画素数)が例えばV1であるとすると、この小領域のV方向の距離がβ・V1に拡大されるように、分割点D11,D12,D22,D21の全てあるいは一部を移動させる。分割点D11,D12,D22,D21の全てを移動させる場合には、目よりも下側に位置する水平分割線Lh1上の分割点D11,D21をV方向のマイナス側(顔の下側)に移動させ、目よりも上側に位置する水平分割線Lh2上の分割点D12,D22をV方向のプラス側(顔の上側)に移動させる。ただし本実施形態では、変形処理実行部26は、図24に例示したように、水平分割線Lh1上に位置する分割点D11,D21は移動させず、水平分割線Lh2上に位置する分割点D12,D22をV方向のプラス側に移動させる。本実施形態では、H方向(基準線SLに直交する方向)への分割点Dの移動は行わない。   If the distance (number of pixels) in the V direction of the small area having the vertexes at the dividing points D11, D12, D22, and D21 is, for example, V1, the deformation processing execution unit 26 determines that the distance in the V direction of the small area is β · All or part of the dividing points D11, D12, D22, and D21 are moved so as to be enlarged to V1. When all of the dividing points D11, D12, D22, and D21 are moved, the dividing points D11 and D21 on the horizontal dividing line Lh1 positioned below the eyes are set to the minus side (below the face) in the V direction. The dividing points D12 and D22 on the horizontal dividing line Lh2 located above the eyes are moved to the plus side (upper face) in the V direction. However, in the present embodiment, as illustrated in FIG. 24, the transformation processing execution unit 26 does not move the dividing points D11 and D21 located on the horizontal dividing line Lh1, and the dividing point D12 located on the horizontal dividing line Lh2. , D22 is moved to the plus side in the V direction. In the present embodiment, the division point D is not moved in the H direction (direction orthogonal to the reference line SL).

変形処理実行部26は、変形領域TAの内外の画像間の境界が不自然とならないように、変形領域TAの外枠上に位置する分割点Dの位置は移動しない。図24では、移動前の分割点Dは白抜きの丸で、移動後の分割点Dや位置の移動の無い分割点Dは黒丸で示されている。移動後の各分割点Dについては、「’」を付して表現している。
変形処理実行部26は、変形領域TAを構成する小領域について、分割点Dの位置移動前の状態における小領域の画像が、分割点Dの位置移動により新たに定義された小領域の画像となるように、画像の変形処理を行う。具体的には、分割点D11,D12,D22,D21を頂点とする小領域の画像は、分割点D11,D’12,D’22,D21を頂点とする小領域の画像に変形(拡大)される。またこれに付随して、分割点D01,D02,D12,D11を頂点とする小領域の画像は、分割点D01,D02,D’12,D11を頂点とする小領域の画像に変形(拡大)され、分割点D21,D22,D32,D31を頂点とする小領域の画像は、分割点D21,D’22,D32,D31を頂点とする小領域の画像に変形(拡大)される。
The deformation processing execution unit 26 does not move the position of the dividing point D located on the outer frame of the deformation area TA so that the boundary between the inner and outer images of the deformation area TA does not become unnatural. In FIG. 24, the division point D before the movement is indicated by a white circle, and the division point D after the movement or the division point D without the movement of the position is indicated by a black circle. Each divided point D after the movement is represented with “′”.
For the small area constituting the deformation area TA, the deformation processing execution unit 26 is configured such that the image of the small area before the position movement of the dividing point D is the image of the small area newly defined by the position movement of the dividing point D. In this way, an image deformation process is performed. Specifically, the image of the small area having the vertices at the division points D11, D12, D22, and D21 is transformed (enlarged) into the image of the small area having the vertices at the division points D11, D′ 12, D′ 22, and D21. Is done. Along with this, the image of the small area having the vertexes at the dividing points D01, D02, D12, and D11 is transformed (enlarged) into the image of the small area having the vertexes at the dividing points D01, D02, D′ 12, and D11. Then, the image of the small area having the vertexes at the dividing points D21, D22, D32, and D31 is transformed (enlarged) into the image of the small area having the vertexes at the dividing points D21, D'22, D32, and D31.

図25は、変形処理実行部26による画像の変形処理方法の概念を示す説明図である。図25では、分割点Dを黒丸で示している。図25では、説明を簡略化するために、4つの小領域について、左側に分割点Dの位置移動前の状態を、右側に分割点Dの位置移動後の状態を、それぞれ示している。図25の例では、中央の分割点Daが分割点Da’の位置に移動され、その他の分割点Dの位置は移動されない。これにより、例えば、分割点Dの移動前の分割点Da,Db,Dc,Ddを頂点とする矩形の小領域(以下「変形前注目小領域BSA」とも呼ぶ)の画像は、分割点Da’,Db,Dc,Ddを頂点とする矩形の小領域(以下「変形後注目小領域ASA」とも呼ぶ)の画像に変形される。   FIG. 25 is an explanatory diagram showing the concept of the image deformation processing method by the deformation processing execution unit 26. In FIG. 25, the dividing point D is indicated by a black circle. In FIG. 25, for simplification of description, regarding the four small regions, the state before the position movement of the dividing point D is shown on the left side, and the state after the position moving of the dividing point D is shown on the right side. In the example of FIG. 25, the center dividing point Da is moved to the position of the dividing point Da ', and the positions of the other dividing points D are not moved. Thereby, for example, an image of a rectangular small area (hereinafter also referred to as “pre-deformation noticeable small area BSA”) having the vertices at the division points Da, Db, Dc, Dd before the movement of the division point D is obtained from the division point Da ′. , Db, Dc, and Dd are transformed into an image of a rectangular small area (hereinafter also referred to as “the noticed small area ASA after deformation”).

本実施形態では、矩形の小領域を小領域の重心CGを用いて4つの三角形領域に分割し、三角形領域単位で画像の変形処理を行っている。図25の例では、変形前注目小領域BSAが、変形前注目小領域BSAの重心CGを頂点の1つとする4つの三角形領域に分割される。同様に、変形後注目小領域ASAが、変形後注目小領域ASAの重心CG’を頂点の1つとする4つの三角形領域に分割される。そして、分割点Daの移動前後のそれぞれの状態において対応する三角形領域毎に、画像の変形処理が行われる。例えば、変形前注目小領域BSA中の分割点Da,Ddおよび重心CGを頂点とする三角形領域の画像が、変形後注目小領域ASA中の分割点Da’,Ddおよび重心CG’を頂点とする三角形領域の画像に変形される。   In the present embodiment, a rectangular small region is divided into four triangular regions using the center of gravity CG of the small region, and image deformation processing is performed in units of triangular regions. In the example of FIG. 25, the pre-deformation attention small area BSA is divided into four triangular areas having the centroid CG of the pre-deformation attention small area BSA as one vertex. Similarly, the post-deformation attention small area ASA is divided into four triangular areas having the centroid CG ′ of the post-deformation attention small area ASA as one vertex. Then, image deformation processing is performed for each corresponding triangular area in each state before and after the movement of the dividing point Da. For example, an image of a triangular area having vertices at the division points Da and Dd and the center of gravity CG in the attention small area BSA before deformation has a vertex at the division points Da ′ and Dd and the center of gravity CG ′ in the attention small area ASA after deformation. It is transformed into an image of a triangular area.

図26は、三角形領域における画像の変形処理方法の概念を示す説明図である。図26の例では、点s,t,uを頂点とする三角形領域stuの画像が、点s’,t’,u’を頂点とする三角形領域s’t’u’の画像に変形される。なお、図26の説明において用いる“s”や“u”は、本明細書において既出の同一の符号とは別の意味で用いている。画像の変形は、変形後の三角形領域s’t’u’の画像中のある画素の位置が、変形前の三角形領域stuの画像中のどの位置に相当するかを算出し、算出された位置における変形前の画像における画素値を変形後の画像の画素値とすることにより行う。例えば、図26において、変形後の三角形領域s’t’u’の画像中の注目画素p’の位置は、変形前の三角形領域stuの画像中の位置pに相当するものとする。位置pの算出は、以下のように行う。まず、注目画素p’の位置を、下記の式(7)のようにベクトルs’t’とベクトルs’u’との和で表現するための係数m1およびm2を算出する。   FIG. 26 is an explanatory diagram showing the concept of an image deformation processing method in a triangular area. In the example of FIG. 26, the image of the triangular area stu with the points s, t, u as vertices is transformed into the image of the triangular area s′t′u ′ with the points s ′, t ′, u ′ as vertices. . Note that “s” and “u” used in the description of FIG. 26 are used in a different meaning from the same reference numerals already described in this specification. For the deformation of the image, the position of a certain pixel in the image of the triangular area s't'u 'after the deformation corresponds to the position in the image of the triangular area stu before the deformation, and the calculated position This is performed by using the pixel value in the image before deformation in step S4 as the pixel value of the image after deformation. For example, in FIG. 26, the position of the pixel of interest p ′ in the image of the triangular area s′t′u ′ after deformation corresponds to the position p in the image of the triangular area stu before deformation. The position p is calculated as follows. First, coefficients m1 and m2 for expressing the position of the target pixel p ′ by the sum of the vector s′t ′ and the vector s′u ′ as shown in the following equation (7) are calculated.


次に、算出された係数m1およびm2を用いて、下記の式(8)により、変形前の三角形領域stuにおけるベクトルstとベクトルsuとの和を算出することにより、位置pが求まる。


変形前の三角形領域stuにおける位置pが、変形前の画像の画素中心位置に一致した場合には、当該画素の画素値が変形後の画像の画素値とされる。一方、変形前の三角形領域stuにおける位置pが、変形前の画像の画素中心位置からはずれた位置となった場合には、位置pの周囲の画素の画素値を用いたバイキュービック等の補間演算により、位置pにおける画素値を算出し、算出された画素値が変形後の画像の画素値とされる。
Next, by using the calculated coefficients m1 and m2, the position p is obtained by calculating the sum of the vector st and the vector su in the triangular area stu before deformation according to the following equation (8).


When the position p in the triangular area stu before deformation coincides with the pixel center position of the image before deformation, the pixel value of the pixel is set as the pixel value of the image after deformation. On the other hand, when the position p in the triangular area stu before deformation is shifted from the pixel center position of the image before deformation, an interpolation operation such as bicubic using the pixel values of the pixels around the position p. Thus, the pixel value at the position p is calculated, and the calculated pixel value is set as the pixel value of the image after deformation.

変形後の三角形領域s’t’u’の画像中の各画素について上述のように画素値を算出することにより、三角形領域stuの画像から三角形領域s’t’u’の画像への画像変形処理を行うことができる。変形処理実行部26は、図24に示した変形領域TAを構成する小領域について、上述したように三角形領域を定義して変形処理を行い、変形領域TAにおける画像変形処理を行う。   Image deformation from the image of the triangular area stu to the image of the triangular area s't'u 'by calculating the pixel value for each pixel in the image of the triangular area s't'u' after the deformation as described above Processing can be performed. The deformation process execution unit 26 performs a deformation process by defining a triangular area as described above for the small area constituting the deformation area TA illustrated in FIG. 24, and performs an image deformation process in the deformation area TA.

上述したように本実施形態では、変形処理実行部26は、水平分割線Lh1上に位置する分割点D11,D21は移動させず、水平分割線Lh2上に位置する分割点D12,D22を補正量βに応じてV方向のプラス側に移動させる。従って、水平分割線Lh1と水平分割線Lh2と垂直分割線Lv3に囲まれた画像、特に、水平分割線Lh1と水平分割線Lh2と垂直分割線Lv1と垂直分割線Lv2に囲まれた画像が、V方向に関して顔の上側に拡大される。この結果、左右の目のうち小さい方の目(右目)を含む領域が拡大され、当該拡大後においては左右の目の大きさの違いが少なくなる(あるいは、左右の目の大きさの違いが無くなる)。   As described above, in the present embodiment, the deformation processing execution unit 26 does not move the dividing points D11 and D21 positioned on the horizontal dividing line Lh1, but corrects the dividing points D12 and D22 positioned on the horizontal dividing line Lh2. Move to the plus side in the V direction according to β. Therefore, an image surrounded by the horizontal dividing line Lh1, the horizontal dividing line Lh2, and the vertical dividing line Lv3, particularly, an image surrounded by the horizontal dividing line Lh1, the horizontal dividing line Lh2, the vertical dividing line Lv1, and the vertical dividing line Lv2, Enlarged above the face in the V direction. As a result, the region including the smaller eye (right eye) of the left and right eyes is enlarged, and after the enlargement, the difference in the size of the left and right eyes is reduced (or the difference in the size of the left and right eyes is reduced). No longer).

ただし、変形処理実行部26が変形の対象とする領域は、必ずしも変形領域TA中に設定された分割点Dによって囲まれた領域である必要はない。例えば、変形処理実行部26は、S120(図3)で顔器官検出部22が検出した左目領域(比較領域CA1)と右目領域(比較領域CA2)とのうち、補正量決定部23によって補正量βが決定された目に対応する側の領域を変形対象としてもよい。この場合、変形処理実行部26は、変形対象とした領域(例えば、右目領域)の矩形内の画像を、補正量βに基づいて目の高さ方向に拡大させる(β倍する)変形を実行すればよい。   However, the region to be deformed by the deformation processing execution unit 26 does not necessarily need to be a region surrounded by the dividing points D set in the deformation region TA. For example, the deformation processing execution unit 26 uses the correction amount determination unit 23 to correct the correction amount among the left eye region (comparison region CA1) and right eye region (comparison region CA2) detected by the facial organ detection unit 22 in S120 (FIG. 3). A region on the side corresponding to the eye for which β is determined may be a deformation target. In this case, the deformation processing execution unit 26 performs deformation for enlarging (multiplying by β) the image in the rectangle of the region to be deformed (for example, the right eye region) in the eye height direction based on the correction amount β. do it.

S700(図2)では、印刷処理部32が、プリンタエンジン16を制御して、対象画像の印刷を行う。すなわち印刷処理部32は、変形処理後の画像データ14a(変形処理が実行されていない場合には、S105(図3)で取得された画像データ14a)に、解像度変換処理や色変換処理やハーフトーン処理など必要な各処理を施して印刷データを生成する。生成された印刷データは、印刷処理部32からプリンタエンジン16に供給され、プリンタエンジン16は印刷データに基づいた印刷を実行する。これにより、変形処理後の対象画像の印刷が完了する。   In S700 (FIG. 2), the print processing unit 32 controls the printer engine 16 to print the target image. That is, the print processing unit 32 adds the resolution conversion process, the color conversion process, and the half conversion to the image data 14a after the deformation process (the image data 14a acquired in S105 (FIG. 3 when the deformation process is not executed)). Print data is generated by performing necessary processes such as tone processing. The generated print data is supplied from the print processing unit 32 to the printer engine 16, and the printer engine 16 executes printing based on the print data. Thereby, the printing of the target image after the deformation process is completed.

このように本実施形態によれば、画像変形部20は、対象画像に含まれている顔の左右の目のサイズLS,RSを検出し、検出したLS,RSに基づいて、左右の目のうち小さい方の目を拡大するための補正量βを決定する。そして、決定した補正量βに基づき、対象画像における上記小さい方の目を含む領域を対象として、上記V方向すなわち顔の略高さ方向に沿って拡大させる変形処理を行なう。その結果、対象画像における顔の左右の目の大きさに違いがある場合であっても、かかる左右の目の大きさの違いが自動的に補正された、観察者に良好な印象を与える画像を得ることができる。   Thus, according to the present embodiment, the image deformation unit 20 detects the left and right eye sizes LS and RS of the face included in the target image, and based on the detected LS and RS, the left and right eyes A correction amount β for enlarging the smaller eye is determined. Then, based on the determined correction amount β, a deformation process for enlarging the region including the smaller eye in the target image along the V direction, that is, the approximate height direction of the face is performed. As a result, even if there is a difference in the size of the left and right eyes of the face in the target image, an image that gives a good impression to the observer, with the difference in the size of the left and right eyes automatically corrected Can be obtained.

人間の左右の目は、その幅は(顔の横方向における目の長さ)は基本的に大きな差は少ない一方、その高さ(顔の高さ方向における目の長さ)は、左右のまぶたの形状の違いや目をつむる動きの影響等で違いが生じやすい。そのため本実施形態では、上述したように、上記小さい方の目を含む領域を顔の略高さ方向(目の略高さ方向)に沿って拡大させることで、現実的に対象画像において生じる左右の目の大きさの違いを的確に補正する。さらに、左右の目の大きさの違いというものを詳細に検討すると、その違いの多くは、左右の目の上端(まぶたの下端)の位置の違いに起因し、一方、左右の目の下端の位置に大きな違いは無いと言える。そこで本実施形態では、上述したように、目の下側に位置する水平分割線Lh1上の分割点D11,D21は移動させず、目の上側に位置する水平分割線Lh2上の分割点D12,D22をV方向のプラス側に移動させることにより、結果的に、水平分割線Lh1よりも顔の上側に位置する各画素を顔の上側に向かって移動させている。従って、対象画像において他方の目と比べて小さく表されていた目が大きく見開かれたように補正され、かつ左右の目の下端位置は略維持されるため、違和感の無い補正後の顔画像が得られる。   The left and right eyes of humans have basically little difference in the width (the length of the eyes in the lateral direction of the face), while the height (the length of the eyes in the height direction of the face) is Differences are likely to occur due to differences in eyelid shape and eye movement. Therefore, in the present embodiment, as described above, the region including the smaller eye is enlarged along the approximate height direction of the face (the approximate height direction of the eyes), so that the left and right that are actually generated in the target image. Correct the difference in eye size. Furthermore, when examining the difference in the size of the left and right eyes, many of the differences are due to the difference in the position of the top of the left and right eyes (the bottom of the eyelid), while the position of the bottom of the left and right eyes. It can be said that there is no big difference. Therefore, in the present embodiment, as described above, the dividing points D11 and D21 on the horizontal dividing line Lh1 located below the eyes are not moved, and the dividing points D12 and D22 on the horizontal dividing line Lh2 located above the eyes are moved. As a result, the pixels located on the upper side of the face with respect to the horizontal dividing line Lh1 are moved toward the upper side of the face by moving to the plus side in the V direction. Therefore, the corrected face image is obtained without any sense of incongruity because the target image is corrected so that the eye represented smaller than the other eye is widened and the lower end positions of the left and right eyes are substantially maintained. It is done.

なお上記では、左右の目のうち小さい方の目を拡大するための補正量βに基づいて小さい方の目を拡大する場合について説明した。しかし本発明においては、大きい方の目を縮小するための補正量(縮小率)をLS,RSに基づいて決定し、決定した補正量に基づいて大きい方の目を縮小する変形を行なうことも可能である。あるいは、大きい方の目を縮小するための補正量および小さい方の目を拡大するための補正量をLS,RSに基づいて決定し、大きい方の目を縮小するための補正量に基づいて大きい方の目を縮小し、小さい方の目を拡大するための補正量に基づいて小さい方の目を拡大する変形を行なうことも可能である。   In the above description, the case where the smaller eye is enlarged based on the correction amount β for enlarging the smaller eye among the left and right eyes has been described. However, in the present invention, a correction amount (reduction rate) for reducing the larger eye is determined based on LS and RS, and the larger eye is reduced based on the determined correction amount. Is possible. Alternatively, a correction amount for reducing the larger eye and a correction amount for enlarging the smaller eye are determined based on LS and RS, and the correction amount for reducing the larger eye is large. It is also possible to perform a modification that enlarges the smaller eye based on the correction amount for reducing the smaller eye and enlarging the smaller eye.

5.他の実施例
画像変形部20は、顔向き推定部27(図1)を備えている。顔向き推定部27は、対象画像における顔の向き(正面向き、上向き、下向き、右向き、左向き等)を推定する機能である。対象画像の顔が上向きとは、顔が仰向けの傾向にある状態を意味し、下向きとは顔がうつ伏せの傾向にある状態を意味し、右向きとは対象画像の人物にとっての左の横顔が画像内で主に見えている状態を意味し、左向きとは対象画像の人物にとっての右の横顔が画像内で主に見えている状態を意味する。画像変形部20は、S100,S300(図2)を実行する過程で、顔向き推定部27に対象画像における顔の向きを推定させるとともに、推定された顔の向きの程度(顔の振りの程度)に応じて、上記補正量βを変更するとしてもよい。
5. Other Embodiments The image deformation unit 20 includes a face direction estimation unit 27 (FIG. 1). The face direction estimation unit 27 is a function that estimates the face direction (front direction, upward direction, downward direction, right direction, left direction, etc.) in the target image. The face of the target image is upward, meaning that the face tends to face up, the downward direction means that the face is prone, and the right direction is the left profile for the person in the target image. Means the state in which the right profile for the person of the target image is mainly visible in the image. In the process of executing S100 and S300 (FIG. 2), the image deforming unit 20 causes the face direction estimating unit 27 to estimate the face direction in the target image, and the estimated degree of the face direction (degree of face swing). ), The correction amount β may be changed.

図27は、S110(図3)において、画像データ14aから顔領域として検出された比較領域CAを例示している。また図27では、S120で顔器官検出部22によって検出された左目領域としての比較領域CA1と、右目領域としての比較領域CA2との各位置も例示している。なお図27では、画像データ14a内の顔自体の図示は省略している。さらに図27では、顔器官検出部22が検出した口の画像を含む矩形領域(口領域CA3)の位置も例示している。画像変形部20は、S120において、顔器官検出部22に、左右の目に加え口も検出させる。つまり顔器官検出部22は、顔領域としての比較領域CA内(顔画像データFD内)でさらに矩形状の比較領域CAを設定し、当該設定した比較領域CAの位置と大きさと回転角度を変えながら、当該設定した比較領域CA内の画像と各テンプレート(口テンプレート)の画像との類似性を評価するパターンマッチングを行なうことにより、口領域CA3を検出可能である。   FIG. 27 exemplifies the comparison area CA detected as a face area from the image data 14a in S110 (FIG. 3). FIG. 27 also illustrates the positions of the comparison area CA1 as the left eye area and the comparison area CA2 as the right eye area detected by the facial organ detection unit 22 in S120. In FIG. 27, illustration of the face itself in the image data 14a is omitted. Further, FIG. 27 also illustrates the position of a rectangular area (mouth area CA3) including the mouth image detected by the facial organ detection unit 22. In S120, the image transformation unit 20 causes the facial organ detection unit 22 to detect the mouth in addition to the left and right eyes. That is, the face organ detection unit 22 further sets a rectangular comparison area CA in the comparison area CA (face image data FD) as a face area, and changes the position, size, and rotation angle of the set comparison area CA. However, the mouth area CA3 can be detected by performing pattern matching for evaluating the similarity between the image in the set comparison area CA and the image of each template (mouth template).

比較領域CA1と、比較領域CA2と、口領域CA3とが検出されたら、顔向き推定部27が顔の向きの推定処理を実行する。推定処理を実行するタイミングは様々であるが、一例として、顔向き推定部27は、S120とS125の間のタイミングにおいて推定処理を行なう。なお、顔器官検出部22が左目領域と、右目領域と、口領域CA3とのいずれか一つでも検出できなかった場合には、顔向き推定部27は推定処理を行なわないとしてもよい。ここで、比較領域CA1の中心点Ce(l)と比較領域CA2の中心点Ce(r)とを結ぶ線分CLの長さを参照幅Wrと呼び、口領域CA3の中心点Cmと線分CLとの距離を参照高さHrと呼ぶ。図27から明らかなように、参照幅Wrは顔の画像の幅に相関のある指標であり、参照高さHrは顔の画像の高さに相関のある指標である。   When the comparison area CA1, the comparison area CA2, and the mouth area CA3 are detected, the face orientation estimation unit 27 executes a face orientation estimation process. Although the timing at which the estimation process is executed varies, as an example, the face direction estimation unit 27 performs the estimation process at a timing between S120 and S125. Note that if the face organ detection unit 22 cannot detect any one of the left eye region, the right eye region, and the mouth region CA3, the face direction estimation unit 27 may not perform the estimation process. Here, the length of the line segment CL connecting the center point Ce (l) of the comparison area CA1 and the center point Ce (r) of the comparison area CA2 is referred to as a reference width Wr, and the center point Cm and the line segment of the mouth area CA3. The distance from CL is called the reference height Hr. As is clear from FIG. 27, the reference width Wr is an index correlated with the width of the face image, and the reference height Hr is an index correlated with the height of the face image.

顔向き推定部27は、参照高さHrと参照幅Wrとを算出するとともに、参照高さHrと参照幅Wrとの比(Hr/Wr)を判定指標値DIとして算出し、判定指標値DIに基づき顔向き推定を行う。具体的には、顔向き推定部27は、判定指標値DIがしきい値DT1以上かつしきい値DT2未満である場合には、顔の画像の向きが正面向きであると推定する。しきい値DT1,DT2はいずれも正の値であり、DT1<DT2の関係を有する。顔向き推定部27は、判定指標値DIがしきい値DT1未満である場合には、顔の画像の向きが上向きまたは下向きであると推定する。顔向き推定部27は、判定指標値DIがしきい値DT2以上である場合には、顔の画像の向きが右向きまたは左向きであると推定する。   The face direction estimation unit 27 calculates the reference height Hr and the reference width Wr, calculates the ratio (Hr / Wr) between the reference height Hr and the reference width Wr as the determination index value DI, and determines the determination index value DI. Based on the above, the face orientation is estimated. Specifically, when the determination index value DI is equal to or greater than the threshold value DT1 and less than the threshold value DT2, the face direction estimation unit 27 estimates that the face image direction is the front direction. The threshold values DT1 and DT2 are both positive values and have a relationship of DT1 <DT2. When the determination index value DI is less than the threshold value DT1, the face orientation estimation unit 27 estimates that the orientation of the face image is upward or downward. When the determination index value DI is equal to or greater than the threshold value DT2, the face orientation estimation unit 27 estimates that the orientation of the face image is rightward or leftward.

顔の画像の向きが右向きまたは左向きである場合には、正面向きである場合と比較して、参照高さHrはほとんど変わらない一方、参照幅Wrは小さいと考えられる。従って、顔の画像の向きが右向きまたは左向きである場合には、正面向きである場合と比較して、判定指標値DI(=Hr/Wr)が大きくなる。反対に、顔の画像の向きが上向きまたは下向きである場合には、正面向きである場合と比較して、参照幅Wrはほとんど変わらない一方、参照高さHrは小さいと考えられる。従って、顔の画像の向きが上向きまたは下向きである場合には、正面向きである場合と比較して、判定指標値DI(=Hr/Wr)が小さくなる。しきい値DT1,DT2は、複数の顔のサンプル画像の判定指標値DIから統計的に定められる。予め定められたしきい値DT1,DT2は内部メモリ12内の所定の領域に格納されている。   When the orientation of the face image is rightward or leftward, the reference height Hr is hardly changed, but the reference width Wr is considered to be small compared to the case of facing the front. Therefore, the determination index value DI (= Hr / Wr) is greater when the orientation of the face image is rightward or leftward than when it is frontward. On the other hand, when the orientation of the face image is upward or downward, the reference width Wr is hardly changed, but the reference height Hr is considered to be small compared to the case of facing the front. Therefore, the determination index value DI (= Hr / Wr) is smaller when the orientation of the face image is upward or downward than when the face image is frontward. Threshold values DT1 and DT2 are statistically determined from determination index values DI of a plurality of face sample images. Predetermined threshold values DT 1 and DT 2 are stored in a predetermined area in the internal memory 12.

本実施形態においては、顔が右向きまたは左向きと推定された場合に、当該推定の結果を補正量βの決定に際して考慮する。そこで、顔向き推定部27は、顔の画像の向きが右向きまたは左向きであると推定したときに、上記算出した判定指標値DIを内部メモリ12に記録する。従って、内部メモリ12に記録される判定指標値DIは、少なくともしきい値DT2以上の値である。内部メモリ12に記録された判定指標値DIは、対象画像における顔の右向きまたは左向きの度合い(横向きの度合い)を示していると言える。補正量決定部23は、S300の実行過程において、内部メモリ12に判定指標値DIが記録されているか否か判断する。そして、内部メモリ12に判定指標値DIが記録されている場合には、S315(図19)で決定した補正量βを、判定指標値DIの大きさに応じて変更する。以下では、変更後の補正量を補正量β´と呼ぶ。   In the present embodiment, when the face is estimated to be rightward or leftward, the estimation result is taken into account when determining the correction amount β. Therefore, the face orientation estimating unit 27 records the calculated determination index value DI in the internal memory 12 when it is estimated that the orientation of the face image is rightward or leftward. Therefore, the determination index value DI recorded in the internal memory 12 is at least a value equal to or greater than the threshold value DT2. It can be said that the determination index value DI recorded in the internal memory 12 indicates the rightward or leftward degree (lateral degree) of the face in the target image. The correction amount determination unit 23 determines whether or not the determination index value DI is recorded in the internal memory 12 in the execution process of S300. When the determination index value DI is recorded in the internal memory 12, the correction amount β determined in S315 (FIG. 19) is changed according to the magnitude of the determination index value DI. Hereinafter, the corrected correction amount is referred to as a correction amount β ′.

図28は、補正量βを判定指標値DIに応じて変更するための関数F2を例示している。関数F2は、入力値(横軸)=判定指標値DI、出力値(縦軸)=補正量β´とした、下に凸の2次曲線である。関数F2は、入力値=DT2のとき最大値(補正量β)を出力し、入力値が大きくなるほど1に近い値を出力する。従って、判定指標値DIが大きい値であるほど(対象画像における顔の横向きの度合いが高いほど)、補正量βが1を下限として小さい値に変更される。補正量決定部23は、このように関数F2に基づいて出力した補正量β´を、変形部に受け渡す。変形部は、補正量β´に基づいて上述した画像変形を行なう(S500)。   FIG. 28 illustrates a function F2 for changing the correction amount β according to the determination index value DI. The function F2 is a downwardly convex quadratic curve with input value (horizontal axis) = determination index value DI and output value (vertical axis) = correction amount β ′. The function F2 outputs the maximum value (correction amount β) when the input value = DT2, and outputs a value closer to 1 as the input value increases. Accordingly, the larger the determination index value DI is (the higher the degree of lateral orientation of the face in the target image), the smaller the correction amount β is set to a smaller value with 1 being the lower limit. The correction amount determination unit 23 transfers the correction amount β ′ thus output based on the function F2 to the deformation unit. The deformation unit performs the above-described image deformation based on the correction amount β ′ (S500).

対象画像における顔が右向きまたは左向きであれば、奥側の目(対象画像の顔が右向きであれば当該顔の右目、対象画像の顔が左向きであれば当該顔の左目)は、手前側の目よりも小さく表示されていて当然である。このように、小さくて当然の奥側の目を上記のように決定した補正量βに基づいて拡大すると、過剰な変形となってしまい、却って画像が不自然となり得る。そこで本実施形態では、顔向き推定部27が顔の横向きの度合いが高いと推定した場合には、補正量決定部23は、小さい方の目を拡大するための補正量βを上記のように低減させる(補正量β´に変更する)ことで、画像の過剰な変形を防止している。補正量決定部23による変更後の補正量β´=1である場合には、実質的に画像変形は行なわれないため、この場合プリンタ10は、S500をスキップしてS700に進む。   If the face in the target image is facing right or left, the back eye (the right eye of the face if the face of the target image is facing right, the left eye of the face if the face of the target image is facing left) is It is natural that it is displayed smaller than the eyes. In this way, if the small and natural back-side eye is enlarged based on the correction amount β determined as described above, it becomes excessively deformed, and on the contrary, the image may become unnatural. Therefore, in the present embodiment, when the face direction estimation unit 27 estimates that the degree of the horizontal direction of the face is high, the correction amount determination unit 23 sets the correction amount β for enlarging the smaller eye as described above. By reducing (changing to the correction amount β ′), excessive deformation of the image is prevented. When the correction amount β ′ after the correction by the correction amount determination unit 23 is 1, the image is not substantially deformed. In this case, the printer 10 skips S500 and proceeds to S700.

また、顔向き推定部27による推定結果に基づく処理の一例として、画像変形部20は、顔向き推定部27が算出した判定指標値DIが一定値以上であれば、画像変形を行なわないとしてもよい。つまり、上記S120の次のステップで顔向き推定部27が算出した判定指標値DIが、しきい値DT2以上であったり、あるいは、しきい値DT2より大きい所定の値(しきい値DT3)以上であった場合には、画像変形部20は、拡大率(あるいは縮小率)としての補正量βは1に変更されるものとみなし、S125〜S170,S300,S500の処理を行なうことなくS700に進むとしてもよい。
本実施形態では、プリンタ10による処理を説明したが、上述した画像変形部20による処理(S100〜S500の処理)は、PCやデジタルスチルカメラなど、プリンタ以外の各種ハードウェアにおいても行なうことが可能である。
As an example of processing based on the estimation result by the face direction estimation unit 27, the image deformation unit 20 may not perform image deformation if the determination index value DI calculated by the face direction estimation unit 27 is equal to or greater than a certain value. Good. That is, the determination index value DI calculated by the face direction estimation unit 27 in the next step of S120 is equal to or greater than the threshold value DT2 or equal to or greater than a predetermined value (threshold value DT3) greater than the threshold value DT2. If it is, the image deformation unit 20 assumes that the correction amount β as the enlargement ratio (or reduction ratio) is changed to 1, and does not perform the processes of S125 to S170, S300, and S500, and proceeds to S700. You may go forward.
In the present embodiment, the processing by the printer 10 has been described. However, the above-described processing by the image deformation unit 20 (processing of S100 to S500) can be performed by various hardware other than the printer, such as a PC or a digital still camera. It is.

画像処理装置としてのプリンタの概略構成を示すブロック図である。1 is a block diagram illustrating a schematic configuration of a printer as an image processing apparatus. プリンタが実行する処理を示すフローチャートである。4 is a flowchart illustrating processing executed by a printer. 両目サイズ検出処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a both-eye size detection process. 顔検出の様子を示す図である。It is a figure which shows the mode of face detection. 顔器官検出後の顔画像データを示す図である。It is a figure which shows the face image data after a face organ detection. 両目サイズ検出部のソフトウェア構成を示すブロック図である。It is a block diagram which shows the software structure of a both-eye size detection part. 傾き補正の様子を示す図である。It is a figure which shows the mode of inclination correction. スカラー変換処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a scalar conversion process. サンプリングの様子を示す図である。It is a figure which shows the mode of sampling. サンプリングによって得られるヒストグラムである。It is a histogram obtained by sampling. マハラノビス平方距離の等値線を示すグラフである。It is a graph which shows the isoline of Mahalanobis square distance. 変換関数による変換特性を示すグラフである。It is a graph which shows the conversion characteristic by a conversion function. マハラノビス平方距離と確率分布の関係を示すグラフである。It is a graph which shows the relationship between Mahalanobis square distance and probability distribution. Zマップの一例を示す図である。It is a figure which shows an example of Z map. Zマップにおける輪郭パラメータを示す図である。It is a figure which shows the outline parameter in Z map. 評価値を説明する図である。It is a figure explaining an evaluation value. 探索処理における探索手順を示す模式図である。It is a schematic diagram which shows the search procedure in a search process. 探索処理の詳細手順を示す模式図である。It is a schematic diagram which shows the detailed procedure of a search process. 補正量決定処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of correction amount determination processing. 補正量決定のための関数の一例を示す図である。It is a figure which shows an example of the function for correction amount determination. 画像変形処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of an image deformation process. 画像データ上に設定した変形領域の一例を示す図である。It is a figure which shows an example of the deformation | transformation area | region set on image data. 変形領域を小領域に分割した様子の一例を示す図である。It is a figure which shows an example of a mode that the deformation | transformation area | region was divided | segmented into the small area | region. 分割点の位置移動の一例を示す図である。It is a figure which shows an example of the position movement of a dividing point. 画像の変形処理の概念を示す説明図である。It is explanatory drawing which shows the concept of the deformation | transformation process of an image. 三角形領域における画像の変形処理の概念を示す説明図である。It is explanatory drawing which shows the concept of the deformation | transformation process of the image in a triangular area | region. 左目領域や右目領域や口領域等を示す図である。It is a figure which shows a left eye area | region, a right eye area | region, a mouth area | region, etc. FIG. 補正量を判定指標値に応じて変更するための関数を示す図である。It is a figure which shows the function for changing correction amount according to a determination parameter | index value.

符号の説明Explanation of symbols

10…プリンタ、11…CPU、12…内部メモリ、14a…画像データ、14b…顔テンプレート、14c…目テンプレート、16…プリンタエンジン、17…カードI/F、20…画像変形部、21…顔領域検出部、22…顔器官検出部、23…補正量決定部、24…変形領域設定部、25…変形領域分割部、26…変形処理実行部、27…顔向き推定部、32…印刷処理部、41…分割点配置パターンテーブル、172…カードスロット、221…両目サイズ検出部、P2c1…傾き補正部、P2c2…サンプリング部、P2c3…スカラー変換部、P2c4…変換関数設定部、P2c5…パラメータ探索部、P2c6…評価値算出部 DESCRIPTION OF SYMBOLS 10 ... Printer, 11 ... CPU, 12 ... Internal memory, 14a ... Image data, 14b ... Face template, 14c ... Eye template, 16 ... Printer engine, 17 ... Card I / F, 20 ... Image deformation part, 21 ... Face area Detection unit, 22 ... Face organ detection unit, 23 ... Correction amount determination unit, 24 ... Deformation region setting unit, 25 ... Deformation region dividing unit, 26 ... Deformation processing execution unit, 27 ... Face orientation estimation unit, 32 ... Print processing unit , 41... Division point arrangement pattern table, 172... Card slot, 221..., Eye size detection unit, P2c1... Tilt correction unit, P2c2 ... sampling unit, P2c3 ... scalar conversion unit, P2c4 ... conversion function setting unit, P2c5 , P2c6 ... evaluation value calculation unit

Claims (10)

対象画像における顔の左右の目の大きさを表す情報を検出する検出部と、
上記検出された情報に基づいて、左右の少なくとも一方の目の大きさに対する補正量を決定する補正量決定部と、
上記決定された補正量に基づいて、左目を含む領域と右目を含む領域との少なくとも一方の領域に対する画像の変形処理を行なう変形部とを備えることを特徴とする画像処理装置。
A detection unit that detects information indicating the size of the left and right eyes of the face in the target image;
A correction amount determination unit that determines a correction amount for the size of at least one of the left and right eyes based on the detected information;
An image processing apparatus comprising: a deformation unit that performs image deformation processing on at least one of the region including the left eye and the region including the right eye based on the determined correction amount.
上記補正量決定部は、上記左右の目のうち小さい方の目の大きさを拡大させる補正量を決定し、上記変形部は、上記拡大させる補正量に基づいて上記小さい方の目を含む領域を拡大する変形処理を行なうことを特徴とする請求項1に記載の画像処理装置。   The correction amount determining unit determines a correction amount for enlarging the size of the smaller one of the left and right eyes, and the deforming unit is an area including the smaller eye based on the correction amount for enlarging. The image processing apparatus according to claim 1, wherein a deformation process for enlarging the image is performed. 上記補正量決定部は、上記拡大させる補正量として、上記左右の目のうち大きい方の目の大きさに対する上記小さい方の目の大きさの比率が高いほど上記小さい方の目の大きさを上記大きい方の目の大きさに近づかせる補正量を決定することを特徴とする請求項2に記載の画像処理装置。   The correction amount determination unit increases the size of the smaller eye as the ratio of the size of the smaller eye to the size of the larger eye among the left and right eyes is higher as the correction amount to be enlarged. The image processing apparatus according to claim 2, wherein a correction amount that approaches the size of the larger eye is determined. 上記補正量決定部は、上記左右の目の大きさの平均値を算出するとともに、上記小さい方の目の大きさを当該平均値まで略拡大させる補正量を決定することを特徴とする請求項2に記載の画像処理装置。   The correction amount determining unit calculates an average value of the sizes of the left and right eyes, and determines a correction amount that substantially enlarges the size of the smaller eye to the average value. 2. The image processing apparatus according to 2. 上記補正量決定部は、上記小さい方の目の大きさを大きい方の目の大きさまで略拡大させる補正量を決定することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the correction amount determination unit determines a correction amount that substantially enlarges the size of the smaller eye to the size of the larger eye. 上記変形部は、変形処理の対象とした領域の画像を当該領域が含む目の略高さ方向に沿って変形することを特徴とする請求項1〜請求項5のいずれかに記載の画像処理装置。   The image processing according to claim 1, wherein the deformation unit deforms an image of a region targeted for deformation processing along a substantially height direction of eyes included in the region. apparatus. 上記変形部は、変形処理の対象とした領域の画素のうち、当該領域を区画する線であって目の下方に位置する線よりも上記顔の上側に位置する画素を上記補正量に基づいて移動させることにより変形処理を行なうことを特徴とする請求項1〜請求項6のいずれかに記載の画像処理装置。   The deformation unit moves, based on the correction amount, a pixel that is located above the face from a line that divides the area and is located below the eye among pixels of the area that is the target of the deformation process. The image processing apparatus according to claim 1, wherein the deformation processing is performed. 上記対象画像における顔の向きを推定する顔向き推定部を備え、
上記補正量決定部は、上記推定部により推定された顔の向きに応じて補正量を変更することを特徴とする請求項1〜請求項7のいずれかに記載の画像処理装置。
A face orientation estimating unit for estimating the orientation of the face in the target image,
The image processing apparatus according to claim 1, wherein the correction amount determination unit changes the correction amount in accordance with the face direction estimated by the estimation unit.
対象画像における顔の左右の目の大きさを表す情報を検出する検出工程と、
上記検出された情報に基づいて、左右の少なくとも一方の目の大きさに対する補正量を決定する補正量決定工程と、
上記決定された補正量に基づいて、左目を含む領域と右目を含む領域との少なくとも一方の領域に対する画像の変形処理を行なう変形工程とを備えることを特徴とする画像処理方法。
A detection step of detecting information representing the size of the left and right eyes of the face in the target image;
A correction amount determining step for determining a correction amount for the size of at least one of the left and right eyes based on the detected information;
An image processing method comprising: a deformation step of performing an image deformation process on at least one of the region including the left eye and the region including the right eye based on the determined correction amount.
対象画像における顔の左右の目の大きさを表す情報を検出する検出機能と、
上記検出された情報に基づいて、左右の少なくとも一方の目の大きさに対する補正量を決定する補正量決定機能と、
上記決定された補正量に基づいて、左目を含む領域と右目を含む領域との少なくとも一方の領域に対する画像の変形処理を行なう変形機能とをコンピュータに実行させることを特徴とする画像処理プログラム。
A detection function for detecting information representing the size of the left and right eyes of the face in the target image;
A correction amount determination function for determining a correction amount for the size of at least one of the left and right eyes based on the detected information;
An image processing program for causing a computer to execute a deformation function for performing an image deformation process on at least one of an area including a left eye and an area including a right eye based on the determined correction amount.
JP2008066617A 2008-03-14 2008-03-14 Image processor, image processing method, and image processing program Withdrawn JP2009223566A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008066617A JP2009223566A (en) 2008-03-14 2008-03-14 Image processor, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008066617A JP2009223566A (en) 2008-03-14 2008-03-14 Image processor, image processing method, and image processing program

Publications (1)

Publication Number Publication Date
JP2009223566A true JP2009223566A (en) 2009-10-01

Family

ID=41240280

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008066617A Withdrawn JP2009223566A (en) 2008-03-14 2008-03-14 Image processor, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP2009223566A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289785A (en) * 2010-06-18 2011-12-21 卡西欧计算机株式会社 Image processing apparatus and image processing method
US11869213B2 (en) 2020-01-17 2024-01-09 Samsung Electronics Co., Ltd. Electronic device for analyzing skin image and method for controlling the same

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289785A (en) * 2010-06-18 2011-12-21 卡西欧计算机株式会社 Image processing apparatus and image processing method
JP2012003576A (en) * 2010-06-18 2012-01-05 Casio Comput Co Ltd Image processing device, image processing method and program
CN102289785B (en) * 2010-06-18 2013-05-15 卡西欧计算机株式会社 Image processing apparatus and image processing method
US8842932B2 (en) 2010-06-18 2014-09-23 Casio Computer Co., Ltd. Image processing apparatus, image processing method, and recording medium recording a program
US11869213B2 (en) 2020-01-17 2024-01-09 Samsung Electronics Co., Ltd. Electronic device for analyzing skin image and method for controlling the same

Similar Documents

Publication Publication Date Title
JP5239625B2 (en) Image processing apparatus, image processing method, and image processing program
US20090245655A1 (en) Detection of Face Area and Organ Area in Image
US20090028390A1 (en) Image Processing for Estimating Subject Distance
US20080240615A1 (en) Image processing for image deformation
JP2009053914A (en) Image processor and image processing method
JP4289415B2 (en) Image processing for image transformation
US8031915B2 (en) Image processing device and image processing method
JP5256974B2 (en) Image processing apparatus, image processing method, and program
JP4289420B2 (en) Image processing apparatus and image processing method
JP4816538B2 (en) Image processing apparatus and image processing method
JP2009223566A (en) Image processor, image processing method, and image processing program
JP2009231879A (en) Image processing unit and image processing method
JP5338887B2 (en) Image processing device
JP2009217799A (en) Contour detection method, contour detection device, and contour detection program
JP2009217798A (en) Contour detection method, contour detection device, and contour detection program
JP4853541B2 (en) Image processing apparatus and image processing method
JP2009237623A (en) Face state evaluation method, face state evaluation device and face state evaluation program
JP2009193357A (en) Contour detection method, contour detection device, and contour detection program
JP2009237624A (en) Expression evaluation method, print controller, expression evaluation device and expression evaluation program
JP4816540B2 (en) Image processing apparatus and image processing method
JP4737324B2 (en) Image processing apparatus, image processing method, and computer program
JP4888412B2 (en) Outline detection method, outline detection apparatus, and outline detection program
JP2009055305A (en) Image processing adding information to image
JP5163801B2 (en) Apparatus, method, and computer program
JP4930525B2 (en) Image processing for image transformation

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110218

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111027

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111108

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20111202