JP2009123101A - Estimation of face image direction - Google Patents

Estimation of face image direction Download PDF

Info

Publication number
JP2009123101A
JP2009123101A JP2007298400A JP2007298400A JP2009123101A JP 2009123101 A JP2009123101 A JP 2009123101A JP 2007298400 A JP2007298400 A JP 2007298400A JP 2007298400 A JP2007298400 A JP 2007298400A JP 2009123101 A JP2009123101 A JP 2009123101A
Authority
JP
Japan
Prior art keywords
image
face
area
image processing
organ
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
JP2007298400A
Other languages
Japanese (ja)
Other versions
JP2009123101A5 (en
Inventor
Masaya Usui
雅也 碓井
Kenji Matsuzaka
健治 松坂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2007298400A priority Critical patent/JP2009123101A/en
Publication of JP2009123101A publication Critical patent/JP2009123101A/en
Publication of JP2009123101A5 publication Critical patent/JP2009123101A5/ja
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To estimate the direction of a face image in an object image. <P>SOLUTION: An image processor is provided with: an organ area detection part for detecting an area including an image of facial organ in the object image as an organ area; and a face direction estimation part for estimating the direction of the face image in the object image on the basis of the detected organ area. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像における顔の画像の向きを推定する技術に関する。   The present invention relates to a technique for estimating the orientation of a face image in an image.

デジタル画像を対象に、画像を変形するための画像処理技術が知られている(例えば特許文献1)。特許文献1には、顔の画像上の一部の領域(頬の画像を表す領域)を補正領域として設定し、補正領域を所定のパターンに従い複数の小領域に分割し、小領域毎に設定された倍率で画像を拡大または縮小することにより、顔の画像の形状を変形する画像処理が開示されている。   An image processing technique for deforming an image for a digital image is known (for example, 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 is disclosed in which the shape of the face image is deformed by enlarging or reducing the image at the specified magnification.

特開2004−318204JP 2004-318204 A

上記従来の顔の画像の形状を変形する画像処理は、正面向きの顔の画像を対象とすることを想定しているため、顔の画像の向きが正面向きではなく左右振りや上下振りであった場合には、処理後の画像が不自然なものとなるおそれがある。従って、対象画像における顔の画像の向きを推定することは有用である。   Since the above conventional image processing for deforming the shape of the face image assumes that the face image is a front-facing image, the face image orientation is not a front-facing orientation but a horizontal or vertical swing. In such a case, the processed image may become unnatural. Therefore, it is useful to estimate the orientation of the face image in the target image.

なお、本明細書では、被写体の人物の顔が上を向いている画像の向きを「上振り」と呼び、被写体の人物の顔が下を向いている画像の向きを「下振り」と呼ぶ。また、被写体の人物の顔が画像の観察者側から見て右を向いている(すなわち人物が実際には左を向いている)画像の向きを「右振り」と呼び、被写体の人物の顔が画像の観察者側から見て左を向いている(すなわち人物が実際には右を向いている)画像の向きを「左振り」と呼ぶ。画像の向きが上振りまたは下振りであることを「上下振り」とも呼び、右振りまたは左振りであることを「左右振り」とも呼ぶ。   In this specification, the direction of an image in which the face of the subject person faces upward is referred to as “upward swing”, and the direction of the image in which the face of the subject person faces downward is referred to as “downward swing”. . The direction of the image of the subject person facing to the right when viewed from the viewer side of the image (that is, the person is actually facing the left side) is called “right swing”. Refers to the direction of the image facing the left as viewed from the viewer side of the image (that is, the person is actually facing the right). That the image orientation is up or down is also referred to as “up and down”, and that the right or left is referred to as “left or right”.

その他、例えば、対象画像における顔の画像を含む領域を設定する場合にも、対象画像における顔の画像の向きを推定することは有用である。   In addition, for example, when setting a region including a face image in the target image, it is useful to estimate the orientation of the face image in the target image.

本発明は、上記の課題を解決するためになされたものであり、対象画像における顔の画像の向きを推定することを可能とする技術を提供することを目的とする。   SUMMARY An advantage of some aspects of the invention is that it provides a technique capable of estimating the orientation of a face image in a target image.

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

[適用例1]画像処理装置であって、
対象画像における顔の器官の画像を含む領域を器官領域として検出する器官領域検出部と、
検出された前記器官領域に基づき、前記対象画像における顔の画像の向きを推定する顔向き推定部と、を備える、画像処理装置。
Application Example 1 An image processing apparatus,
An organ region detection unit that detects a region including an image of a facial organ in the target image as an organ region;
An image processing apparatus comprising: a face orientation estimating unit that estimates the orientation of a face image in the target image based on the detected organ region.

この画像処理装置では、対象画像における顔の器官の画像を含む領域を器官領域として検出し、検出された器官領域に基づき対象画像における顔の画像の向きを推定することができる。   In this image processing apparatus, a region including a facial organ image in the target image can be detected as an organ region, and the orientation of the facial image in the target image can be estimated based on the detected organ region.

[適用例2]適用例1に記載の画像処理装置であって、
前記器官領域検出部は、複数の前記器官領域を検出し、
前記顔向き推定部は、検出された前記器官領域間の位置と大きさとの少なくとも一方に関する関係に基づき、前記対象画像における顔の画像の向きを推定する、画像処理装置。
[Application Example 2] The image processing apparatus according to Application Example 1,
The organ region detector detects a plurality of the organ regions,
The face orientation estimating unit estimates an orientation of a face image in the target image based on a relationship related to at least one of a position and a size between the detected organ regions.

複数の器官領域間の位置関係や大きさの関係は、顔の画像の向きに応じて変化すると考えられるため、この画像処理装置では、複数の器官領域間の位置と大きさとの少なくとも一方に関する関係に基づき、対象画像における顔の画像の向きを推定することができる。   Since the positional relationship and the size relationship between the plurality of organ regions are considered to change according to the orientation of the face image, this image processing apparatus uses a relationship related to at least one of the position and size between the plurality of organ regions. Based on the above, the orientation of the face image in the target image can be estimated.

[適用例3]適用例1または適用例2に記載の画像処理装置であって、
前記顔向き推定部は、検出された前記器官領域に基づき、顔の画像の幅に相関のある指標としての参照幅と顔の画像の高さに相関のある指標としての参照高さとを算出し、前記参照幅と前記参照高さとの比に基づき、前記対象画像における顔の画像の向きを推定する、画像処理装置。
[Application Example 3] The image processing apparatus according to Application Example 1 or Application Example 2,
The face orientation estimation unit calculates a reference width as an index correlated with the width of the face image and a reference height as an index correlated with the height of the face image based on the detected organ region. An image processing device that estimates a face image orientation in the target image based on a ratio between the reference width and the reference height.

顔の画像の幅に相関のある参照幅と顔の画像の高さに相関のある参照高さとの比は、顔の画像の向きに応じて変化すると考えられるため、この画像処理装置では、参照幅と参照高さとの比に基づき、対象画像における顔の画像の向きを推定することができる。   The ratio between the reference width correlated to the face image width and the reference height correlated to the face image height is considered to change according to the orientation of the face image. Based on the ratio between the width and the reference height, the orientation of the face image in the target image can be estimated.

[適用例4]適用例3に記載の画像処理装置であって、
前記顔向き推定部は、前記参照幅と前記参照高さとの比に基づき、前記対象画像における顔の画像の正面向きからの振りの程度を推定する、画像処理装置。
[Application Example 4] The image processing apparatus according to Application Example 3,
The face direction estimation unit is an image processing device that estimates a degree of a swing of a face image from a front direction in the target image based on a ratio between the reference width and the reference height.

参照幅と参照高さとの比は、顔の画像の正面向きからの振りの程度に応じて変化すると考えられるため、この画像処理装置では、参照幅と参照高さとの比に基づき、対象画像における顔の画像の正面向きからの振りの程度を推定することができる。   Since the ratio between the reference width and the reference height is considered to change according to the degree of swing from the front of the face image, this image processing apparatus uses the ratio between the reference width and the reference height in the target image. The degree of the swing of the face image from the front direction can be estimated.

[適用例5]適用例3または適用例4に記載の画像処理装置であって、
前記器官領域検出部は、少なくとも、前記顔の器官としての右目の画像を含む右目領域と、前記顔の器官としての左目の画像を含む左目領域と、前記顔の器官としての口の画像を含む口領域と、を、前記器官領域として検出する、画像処理装置。
[Application Example 5] The image processing apparatus according to Application Example 3 or Application Example 4,
The organ region detection unit includes at least a right eye region including an image of the right eye as the facial organ, a left eye region including an image of the left eye as the facial organ, and an image of the mouth as the facial organ. An image processing apparatus for detecting a mouth region as the organ region.

この画像処理装置では、右目領域と左目領域と口領域とに基づき、対象画像における顔の画像の向きを推定することができる。   In this image processing apparatus, the orientation of the face image in the target image can be estimated based on the right eye region, the left eye region, and the mouth region.

[適用例6]適用例5に記載の画像処理装置であって、
前記顔向き推定部は、前記右目領域と前記左目領域とに基づき前記参照幅を算出し、前記右目領域と前記左目領域との少なくとも一方と前記口領域とに基づき前記参照高さを算出する、画像処理装置。
[Application Example 6] The image processing apparatus according to Application Example 5,
The face direction estimating unit calculates the reference width based on the right eye region and the left eye region, and calculates the reference height based on at least one of the right eye region and the left eye region and the mouth region; Image processing device.

この画像処理装置では、右目領域と左目領域とに基づき参照幅を算出することができ、右目領域と左目領域との少なくとも一方と口領域とに基づき参照高さを算出することができる。   In this image processing apparatus, the reference width can be calculated based on the right eye region and the left eye region, and the reference height can be calculated based on at least one of the right eye region and the left eye region and the mouth region.

[適用例7]適用例1ないし適用例6のいずれかに記載の画像処理装置であって、さらに、
前記対象画像における顔の画像を含む領域を検出顔領域として検出する顔領域検出部を備え、
前記顔向き推定部は、検出された前記器官領域と前記検出顔領域とに基づき、前記対象画像における顔の画像の向きを推定する、画像処理装置。
Application Example 7 The image processing apparatus according to any one of Application Examples 1 to 6, further comprising:
A face area detection unit that detects an area including a face image in the target image as a detection face area;
The face orientation estimation unit is an image processing device that estimates the orientation of a face image in the target image based on the detected organ region and the detected face region.

器官領域と検出顔領域との関係は、顔の画像の向きに応じて変化すると考えられるため、この画像処理装置では、器官領域と検出顔領域とに基づき、対象画像における顔の画像の向きを推定することができる。   Since the relationship between the organ area and the detected face area is considered to change according to the orientation of the face image, this image processing apparatus determines the orientation of the face image in the target image based on the organ area and the detected face area. Can be estimated.

[適用例8]適用例1ないし適用例7のいずれかに記載の画像処理装置であって、さらに、
前記対象画像における顔の画像を含む所定の領域を対象に、所定の画像処理を行う画像処理部と、
推定された前記対象画像における顔の画像の向きに基づき、前記画像処理の実行可否を判定する処理可否判定部と、を備える、画像処理装置。
Application Example 8 The image processing apparatus according to any one of Application Examples 1 to 7, further comprising:
An image processing unit that performs predetermined image processing on a predetermined region including a face image in the target image;
An image processing apparatus comprising: a process availability determination unit that determines whether the image processing can be performed based on the estimated orientation of the face image in the target image.

この画像処理装置では、推定された対象画像における顔の画像の向きに基づき、画像処理の実行可否を判定することができるため、例えば、顔の画像の向きによっては結果が不自然なものとなる画像処理について、結果が不自然となる画像処理の実行を回避することができる。   In this image processing apparatus, whether or not image processing can be executed can be determined based on the estimated orientation of the face image in the target image. For example, the result is unnatural depending on the orientation of the face image. Regarding image processing, it is possible to avoid execution of image processing that results in unnatural results.

[適用例9]適用例8に記載の画像処理装置であって、
前記所定の画像処理は、画像の変形処理を含み、
前記処理可否判定部は、推定された前記対象画像における顔の画像の向きが正面向きでない場合には、前記画像処理の実行は不可であると判定する、画像処理装置。
[Application Example 9] The image processing apparatus according to Application Example 8,
The predetermined image processing includes image deformation processing,
The processing availability determination unit determines that the execution of the image processing is impossible when the orientation of the face image in the estimated target image is not front-facing.

この画像処理装置では、顔の画像の向きが正面向きでない場合には、画像の変形処理の実行を回避することができる。   In this image processing apparatus, when the orientation of the face image is not front-facing, it is possible to avoid execution of the image deformation process.

[適用例10]適用例1ないし適用例7のいずれかに記載の画像処理装置であって、さらに、
検出された前記器官領域に基づき、推定された前記対象画像における顔の画像の向きに応じた所定の方法で、前記対象画像における顔の画像を含む顔領域を設定する顔領域設定部を備える、画像処理装置。
Application Example 10 The image processing apparatus according to any one of Application Examples 1 to 7, further comprising:
A face area setting unit configured to set a face area including a face image in the target image by a predetermined method according to the estimated orientation of the face image in the target image based on the detected organ area; Image processing device.

この画像処理装置では、推定された顔の画像の向きに応じた所定の方法で、対象画像における顔の画像を含む顔領域を設定することができるため、顔領域の設定精度の向上を図ることができる。   In this image processing apparatus, the face area including the face image in the target image can be set by a predetermined method according to the estimated face image orientation, so that the setting accuracy of the face area is improved. Can do.

[適用例11]適用例10に記載の画像処理装置であって、
前記顔領域設定部は、推定された前記対象画像における顔の画像の向きに応じて予め定められた前記器官領域との間の関係に基づき、前記顔領域の大きさと位置と傾きとの少なくとも1つを特定し、前記特定された大きさと位置と傾きとの少なくとも1つを有する領域を、前記顔領域として設定する、画像処理装置。
[Application Example 11] The image processing apparatus according to Application Example 10,
The face area setting unit is configured to determine at least one of the size, position, and inclination of the face area based on a relationship with the organ area determined in advance according to the orientation of the face image in the estimated target image. An image processing apparatus that identifies one area and sets an area having at least one of the identified size, position, and inclination as the face area.

この画像処理装置では、推定された顔の画像の向きに応じて予め定められた器官領域との間の関係に基づき、顔領域の大きさと位置と傾きとの少なくとも1つを特定できるため、顔領域の設定精度の向上を図ることができる。   In this image processing apparatus, since at least one of the size, position, and inclination of the face area can be specified based on the relationship with the organ area determined in advance according to the estimated orientation of the face image, The area setting accuracy can be improved.

[適用例12]適用例11に記載の画像処理装置であって、さらに、
前記対象画像における顔の画像を含む領域を検出顔領域として検出する顔領域検出部を備え、
前記顔領域設定部は、前記検出顔領域の大きさと位置と傾きとの少なくとも1つを前記特定された大きさと位置と傾きとの少なくとも1つに一致させた領域を、前記顔領域として設定する、画像処理装置。
[Application Example 12] The image processing apparatus according to Application Example 11, further comprising:
A face area detection unit that detects an area including a face image in the target image as a detection face area;
The face area setting unit sets, as the face area, an area in which at least one of the size, position, and inclination of the detected face area is matched with at least one of the specified size, position, and inclination. , Image processing device.

この画像処理装置では、検出顔領域に基づき顔領域を設定することができ、顔領域の設定精度の向上を図ることができる。   In this image processing apparatus, the face area can be set based on the detected face area, and the setting accuracy of the face area can be improved.

[適用例13]適用例3ないし適用例6のいずれかに記載の画像処理装置であって、さらに、
検出された前記器官領域に基づき、推定された前記対象画像における顔の画像の向きに応じた所定の方法で、前記対象画像における顔の画像を含む顔領域を設定する顔領域設定部を備え、
前記顔領域設定部は、前記参照幅と前記参照高さとに基づき、前記顔領域の大きさを特定する、画像処理装置。
[Application Example 13] The image processing apparatus according to any one of Application Examples 3 to 6, further comprising:
A face area setting unit configured to set a face area including a face image in the target image in a predetermined method according to the estimated orientation of the face image in the target image based on the detected organ area;
The face area setting unit is an image processing apparatus that specifies a size of the face area based on the reference width and the reference height.

この画像処理装置では、参照幅と参照高さとに基づき顔領域の大きさを特定することができ、顔領域の設定精度の向上を図ることができる。   In this image processing apparatus, the size of the face area can be specified based on the reference width and the reference height, and the setting accuracy of the face area can be improved.

[適用例14]適用例13に記載の画像処理装置であって、
前記顔領域設定部は、前記参照幅に所定の係数を乗じて前記顔領域の幅を特定し、
推定された前記対象画像における顔の画像の向きが右振りまたは左振りである場合に用いられる前記所定の係数の値は、正面向きである場合に用いられる前記所定の係数の値と比較して、大きい、画像処理装置。
[Application Example 14] The image processing apparatus according to Application Example 13,
The face area setting unit specifies a width of the face area by multiplying the reference width by a predetermined coefficient,
The value of the predetermined coefficient used when the estimated orientation of the face image in the target image is right-handed or left-handed is compared with the value of the predetermined coefficient used when the face-oriented. Large, image processing device.

この画像処理装置では、顔の画像の向きに応じて参照幅に乗ずる所定の係数の値を変化させることにより、顔領域の設定精度の向上を図ることができる。   In this image processing apparatus, it is possible to improve the setting accuracy of the face area by changing the value of a predetermined coefficient that is multiplied by the reference width according to the orientation of the face image.

[適用例15]適用例13に記載の画像処理装置であって、
前記顔領域設定部は、前記参照高さに所定の係数を乗じて前記顔領域の高さを特定し、
推定された前記対象画像における顔の画像の向きが上振りまたは下振りである場合に用いられる前記所定の係数の値は、正面向きである場合に用いられる前記所定の係数の値と比較して、大きい、画像処理装置。
[Application Example 15] The image processing apparatus according to Application Example 13,
The face area setting unit specifies the height of the face area by multiplying the reference height by a predetermined coefficient,
The value of the predetermined coefficient used when the estimated orientation of the face image in the target image is up or down is compared with the value of the predetermined coefficient used when the face is facing forward. Large, image processing device.

この画像処理装置では、顔の画像の向きに応じて参照高さに乗ずる所定の係数の値を変化させることにより、顔領域の設定精度の向上を図ることができる。   In this image processing apparatus, the setting accuracy of the face area can be improved by changing the value of a predetermined coefficient multiplied by the reference height according to the orientation of the face image.

[適用例16]適用例10ないし適用例15のいずれかに記載の画像処理装置であって、さらに、
設定された前記顔領域に基づき処理対象領域を設定し、前記処理対象領域を対象に所定の画像処理を行う画像処理部を備える、画像処理装置。
[Application Example 16] The image processing apparatus according to any one of Application Example 10 to Application Example 15,
An image processing apparatus comprising: an image processing unit that sets a processing target area based on the set face area and performs predetermined image processing on the processing target area.

この画像処理装置では、精度良く設定された顔領域に基づき所定の画像処理の処理対象領域を設定することができるため、より好ましい画像処理を実現することができる。   In this image processing apparatus, a processing target area for predetermined image processing can be set based on the face area set with high accuracy, and thus more preferable image processing can be realized.

[適用例17]適用例1ないし適用例16のいずれかに記載の画像処理装置であって、
前記器官領域検出部は、検出された前記器官領域について、顔の器官の画像を含む領域であることの確からしさを表す信頼度指標を設定する信頼度設定部を含み、
前記顔向き推定部は、検出された前記器官領域の内、前記信頼度指標の値が所定の閾値より大きい前記器官領域のみに基づき、前記対象画像における顔の画像の向きを推定する、画像処理装置。
Application Example 17 The image processing apparatus according to any one of Application Example 1 to Application Example 16,
The organ area detection unit includes a reliability setting unit that sets a reliability index that represents the probability that the detected organ area is an area including an image of a facial organ,
The face orientation estimating unit estimates an orientation of a face image in the target image based only on the organ area in which the value of the reliability index is greater than a predetermined threshold among the detected organ areas. apparatus.

この画像処理装置では、対象画像における顔の画像の向きの推定精度の向上を図ることができる。   In this image processing apparatus, it is possible to improve the estimation accuracy of the orientation of the face image in the target image.

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

次に、本発明の実施の形態を実施例に基づいて以下の順序で説明する。
A.第1実施例:
A−1.画像処理装置の構成:
A−2.顔形状補正印刷処理:
A−3.変形処理:
B.第2実施例:
C.変形例:
Next, embodiments of the present invention will be described in the following order based on examples.
A. First embodiment:
A-1. Configuration of image processing device:
A-2. Face shape correction printing process:
A-3. Transformation process:
B. Second embodiment:
C. Variations:

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

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

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

顔形状補正印刷部200は、プログラムモジュールとして、顔領域検出部210と、器官領域検出部220と、顔向き推定部230と、変形領域設定部240と、変形領域分割部250と、分割領域変形部260と、処理可否判定部270とを含んでいる。また、器官領域検出部220は、信頼度設定部222を含んでいる。これらの各部の機能については、後述の顔形状補正印刷処理の説明において詳述する。なお、後述するように、変形領域分割部250と分割領域変形部260とにより画像を変形する画像処理が行われる。そのため、変形領域分割部250と分割領域変形部260とは、併せて「画像処理部」とも呼ぶことができる。   The face shape correction printing unit 200 includes, as program modules, a face region detection unit 210, an organ region detection unit 220, a face orientation estimation unit 230, a deformation region setting unit 240, a deformation region dividing unit 250, and a divided region deformation. Part 260 and a process availability determination part 270. In addition, the organ region detection unit 220 includes a reliability setting unit 222. The functions of these units will be described in detail in the description of the face shape correction printing process described later. Note that, as will be described later, image processing for deforming an image is performed by the deformed region dividing unit 250 and the divided region deforming unit 260. Therefore, the deformed area dividing unit 250 and the divided area deforming unit 260 can be collectively referred to as an “image processing unit”.

内部メモリ120には、また、分割点配置パターンテーブル410と分割点移動テーブル420とが格納されている。これらの内容についても、後述の顔形状補正印刷処理の説明において詳述する。   The internal memory 120 also stores a dividing point arrangement pattern table 410 and a dividing point movement table 420. These contents will also be described in detail in the description of the face shape correction printing process described later.

A−2.顔形状補正印刷処理:
プリンタ100は、対象画像の顔形状補正と顔形状補正後の対象画像の印刷とを行う顔形状補正印刷処理を実行することができる。顔形状補正は、対象画像中の顔の少なくとも一部の形状(例えば顔の輪郭形状)を補正する処理である。本実施例では、顔の形状をスリムにするための顔形状補正が行われるものとしており、顔形状補正印刷処理により、顔の形状がスリムに補正された対象画像の印刷が実現可能である。カードスロット172(図1)にメモリカードMCが挿入され、ユーザによる操作部140を介した所定の操作が行われると、顔形状補正印刷処理が開始される。
A-2. Face shape correction printing process:
The printer 100 can execute a face shape correction printing process for correcting the face shape of the target image and printing the target image after the face shape correction. The face shape correction is a process for correcting at least a part of the face in the target image (for example, the contour shape of the face). In this embodiment, it is assumed that face shape correction for slimming the face shape is performed, and printing of a target image whose face shape is corrected to slim can be realized by the face shape correction printing process. When the memory card MC is inserted into the card slot 172 (FIG. 1) and a predetermined operation is performed by the user via the operation unit 140, the face shape correction printing process is started.

図2は、顔形状補正印刷処理の流れを示すフローチャートである。ステップS100では、顔形状補正印刷部200(図1)が、処理の対象となる対象画像TIを設定する。顔形状補正印刷部200は、対象画像TIの設定のための所定のユーザインターフェースを表示部150に表示するよう表示処理部310に指示する。図3は、対象画像TIの設定のためのユーザインターフェースの一例を示す説明図である。図3に示したユーザインターフェースの画像表示欄IAには、メモリカードMCに格納された画像データに基づき、画像が表示される。メモリカードMCに複数の画像が格納されている場合には、ユーザによる操作部140を介した操作に応じて、画像表示欄IAに表示される画像が順次切り替えられる。なお、対象画像TIの設定のためのユーザインターフェースに、メモリカードMCに格納された複数の画像データに基づき、複数の画像が一覧表示されるとしてもよい。顔形状補正印刷部200は、対象画像TIの設定のためのユーザインターフェースにおいてユーザにより選択された画像を対象画像TIとして設定する。   FIG. 2 is a flowchart showing the flow of the face shape correction printing process. In step S100, the face shape correction printing unit 200 (FIG. 1) sets a target image TI to be processed. The face shape correction printing unit 200 instructs the display processing unit 310 to display a predetermined user interface for setting the target image TI on the display unit 150. FIG. 3 is an explanatory diagram illustrating an example of a user interface for setting the target image TI. In the image display field IA of the user interface shown in FIG. 3, an image is displayed based on the image data stored in the memory card MC. When a plurality of images are stored in the memory card MC, the images displayed in the image display field IA are sequentially switched according to the operation through the operation unit 140 by the user. Note that a plurality of images may be displayed in a list on the user interface for setting the target image TI based on the plurality of image data stored in the memory card MC. The face shape correction printing unit 200 sets an image selected by the user on the user interface for setting the target image TI as the target image TI.

ステップS200(図2)では、顔領域検出部210(図1)が、対象画像TIにおける顔領域FAの検出を行う。ここで、顔領域FAは、対象画像TIにおける画像領域であって、少なくとも顔の一部の画像を含む領域である。顔領域検出部210は、対象画像TIを解析して顔の画像を含むと想定される矩形の領域を顔領域FAとして検出する。顔領域検出部210による顔領域FAの検出は、例えばテンプレートを利用したパターンマッチングによる方法(特開2006−279460参照)といった公知の検出方法を用いて実行される。本明細書では、ステップS200で検出された顔領域FAを「検出顔領域FAd」とも呼ぶ。   In step S200 (FIG. 2), the face area detection unit 210 (FIG. 1) detects the face area FA in the target image TI. Here, the face area FA is an image area in the target image TI and includes at least a partial image of the face. The face area detection unit 210 analyzes the target image TI and detects a rectangular area assumed to include a face image as the face area FA. The detection of the face area FA by the face area detection unit 210 is performed using a known detection method such as a pattern matching method using a template (see Japanese Patent Application Laid-Open No. 2006-279460). In this specification, the face area FA detected in step S200 is also referred to as “detected face area FAd”.

図4は、検出顔領域FAdの検出結果の一例を示す説明図である。図4の例では、対象画像TIに人物P1と人物P2との2人の顔の画像が含まれているため、人物P1の顔の画像を含む領域と人物P2の顔の画像を含む領域との2つの検出顔領域FAdが検出される。本実施例では、図4に示すように、検出顔領域FAdは、両目と鼻と口の画像を含む矩形の領域となっている。顔領域検出部210は、検出顔領域FAdを、例えば検出顔領域FAdの4つの頂点の座標により特定する。   FIG. 4 is an explanatory diagram illustrating an example of a detection result of the detected face area FAd. In the example of FIG. 4, since the target image TI includes two face images of the person P1 and the person P2, an area including the face image of the person P1 and an area including the face image of the person P2 The two detected face areas FAd are detected. In the present embodiment, as shown in FIG. 4, the detected face area FAd is a rectangular area including images of both eyes, nose and mouth. The face area detection unit 210 identifies the detected face area FAd by, for example, the coordinates of the four vertices of the detected face area FAd.

ステップS200(図2)において、検出顔領域FAdの検出に成功しなかった場合には(ステップS300:No)、その旨が表示部150を通じてユーザに通知される。この場合には、ユーザに他の画像を対象画像TIとして選択させるために、対象画像TIの選択のためのユーザインターフェース(図3)が表示部150に再度表示され、対象画像TIの再設定(ステップS100)が行われる。なお、検出顔領域FAdの検出に成功しなかった場合には、図2のステップS400からS700までの処理がスキップされ、ステップS800の対象画像TIの印刷が行われるとしてもよい。   In step S200 (FIG. 2), when the detection of the detected face area FAd is not successful (step S300: No), the fact is notified to the user through the display unit 150. In this case, in order to allow the user to select another image as the target image TI, the user interface (FIG. 3) for selecting the target image TI is displayed again on the display unit 150, and the target image TI is reset ( Step S100) is performed. Note that if the detection of the detected face area FAd is not successful, the processing from step S400 to S700 in FIG. 2 may be skipped and the target image TI in step S800 may be printed.

一方、ステップS200(図2)において、検出顔領域FAdの検出に成功した場合には(ステップS300:Yes)、次に、器官領域検出部220(図1)が、対象画像TIにおける器官領域の検出を行う。ここで、器官領域は、対象画像TIにおける画像領域であって、少なくとも顔の器官の一部の画像を含む領域である。本実施例では、顔の器官として、被写体の人物の右目と左目と口とが設定されており、器官領域として、右目の画像を含む右目領域EA(r)と、左目の画像を含む左目領域EA(l)と、口の画像を含む口領域MAとの検出が行われる。器官領域検出220は、対象画像TI中の検出顔領域FAdを解析して、右目、左目、口の画像を含むと想定される3つの矩形領域を、それぞれ右目領域EA(r)、左目領域EA(l)、口領域MAとして検出する。器官領域検出部220による器官領域の検出は、顔領域の検出と同様に、例えばテンプレートを利用したパターンマッチングによる方法といった公知の検出方法を用いて実行される。   On the other hand, when the detection of the detected face area FAd has succeeded in step S200 (FIG. 2) (step S300: Yes), the organ area detection unit 220 (FIG. 1) then displays the organ area in the target image TI. Perform detection. Here, the organ region is an image region in the target image TI and includes at least a partial image of the facial organ. In this embodiment, the right eye, the left eye, and the mouth of the subject person are set as the facial organs, and the right eye area EA (r) including the right eye image and the left eye area including the left eye image as the organ areas. Detection of EA (l) and the mouth area MA including the mouth image is performed. The organ area detection 220 analyzes the detected face area FAd in the target image TI, and converts the three rectangular areas assumed to include the right eye, left eye, and mouth images into the right eye area EA (r) and the left eye area EA, respectively. (L) Detect as mouth area MA. The detection of the organ region by the organ region detection unit 220 is executed using a known detection method such as a pattern matching method using a template, as in the detection of the face region.

図5は、器官領域の検出結果の一例を示す説明図である。図5に示すように、人物P1および人物P2のそれぞれに対応した検出顔領域FAdにおいて、右目領域EA(r)と左目領域EA(l)と口領域MAとが検出される。本実施例では、図5に示すように、右目領域EA(r)は、人物の右目の画像を包含する矩形の領域となっている。同様に、左目領域EA(l)は、人物の左目の画像を包含する矩形の領域となっており、口領域MAは、人物の口の画像を包含する矩形の領域となっている。器官領域検出部220は、検出された器官領域を、例えば各器官領域の4つの頂点の座標により特定する。   FIG. 5 is an explanatory diagram showing an example of the detection result of the organ region. As shown in FIG. 5, in the detected face area FAd corresponding to each of the person P1 and the person P2, the right eye area EA (r), the left eye area EA (l), and the mouth area MA are detected. In the present embodiment, as shown in FIG. 5, the right eye area EA (r) is a rectangular area that includes an image of the right eye of a person. Similarly, the left eye area EA (l) is a rectangular area that includes the image of the person's left eye, and the mouth area MA is a rectangular area that includes the image of the person's mouth. The organ region detection unit 220 identifies the detected organ region by, for example, the coordinates of four vertices of each organ region.

なお、本実施例では、信頼度設定部222(図1)が、検出された各器官領域について信頼度指標を設定する。信頼度指標は、検出された器官領域が、真に顔の器官の画像を含む領域であることの確からしさを表す指標である。本実施例では、信頼度指標として、テンプレートを変更しつつ複数回のパターンマッチングを行った際におけるマッチ回数を用いている。   In this embodiment, the reliability setting unit 222 (FIG. 1) sets a reliability index for each detected organ region. The reliability index is an index representing the probability that the detected organ region is a region that truly includes an image of a facial organ. In the present embodiment, the number of matches when pattern matching is performed a plurality of times while changing the template is used as the reliability index.

ステップS400(図2)において、器官領域の検出に成功した場合には(ステップS500:Yes)、処理はステップS600に進む。ここで、本実施例では、器官領域の検出に成功した場合とは、右目領域EA(r)と左目領域EA(l)と口領域MAとの3つの器官領域がすべて検出され、かつ、すべての器官領域について信頼度指標の表す確からしさが所定の閾値より大きい場合を意味する。3つの器官領域の内のいずれか1つでも検出されなかった場合や、3つの器官領域の内のいずれか1つの信頼度指標の表す確からしさが所定の閾値より小さい場合には、器官領域の検出に成功しなかったこととなる。   In step S400 (FIG. 2), when the detection of the organ region is successful (step S500: Yes), the process proceeds to step S600. Here, in this embodiment, when the detection of the organ region is successful, all three organ regions of the right eye region EA (r), the left eye region EA (l), and the mouth region MA are detected, and all This means that the probability represented by the reliability index is larger than a predetermined threshold for the organ region. If any one of the three organ regions is not detected, or if the probability represented by any one of the three organ regions is less than a predetermined threshold, This means that the detection was not successful.

ステップS600(図2)では、顔向き推定部230(図1)が、顔向き推定を行う。顔向き推定は、対象画像TIに含まれる顔の画像の向きを推定する処理である。図6は、顔向き推定の方法を示す説明図である。図6において、右目領域EA(r)の中心点Ce(r)と左目領域EA(l)の中心点Ce(l)とを結ぶ線分CLの長さを参照幅Wrと呼び、口領域MAの中心点Cmと線分CLとの距離を参照高さHrと呼ぶものとする。図6から明らかなように、参照幅Wrは顔の画像の幅に相関のある指標であり、参照高さHrは顔の画像の高さに相関のある指標である。   In step S600 (FIG. 2), the face direction estimation unit 230 (FIG. 1) performs face direction estimation. The face orientation estimation is processing for estimating the orientation of the face image included in the target image TI. FIG. 6 is an explanatory diagram showing a method of face orientation estimation. In FIG. 6, the length of the line segment CL connecting the center point Ce (r) of the right eye area EA (r) and the center point Ce (l) of the left eye area EA (l) is referred to as a reference width Wr, and the mouth area MA The distance between the center point Cm and the line segment CL is referred to as a reference height Hr. As is apparent from FIG. 6, 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.

顔向き推定部230は、参照高さHrと参照幅Wrとを算出すると共に参照高さHrと参照幅Wrとの比(Hr/Wr)を判定指標DIとして算出し、判定指標DIに基づき顔向き推定を行う。すなわち、図6に示すように、判定指標DIの値が閾値T1以上で閾値T2未満である場合には、顔の画像の向きが正面向きであると推定される。また、判定指標DIの値が閾値T1未満である場合には、顔の画像の向きが上振りまたは下振りであると推定され、判定指標DIの値が閾値T2以上である場合には、顔の画像の向きが右振りまたは左振りであると推定される。ここで、本明細書では、被写体の人物の顔が上を向いている画像の向きを「上振り」と呼び、被写体の人物の顔が下を向いている画像の向きを「下振り」と呼ぶ。また、被写体の人物の顔が画像の観察者側から見て右を向いている(すなわち人物が実際には左を向いている)画像の向きを「右振り」と呼び、被写体の人物の顔が画像の観察者側から見て左を向いている(すなわち人物が実際には右を向いている)画像の向きを「左振り」と呼ぶ。画像の向きが上振りまたは下振りであることを「上下振り」とも呼び、右振りまたは左振りであることを「左右振り」とも呼ぶ。   The face orientation estimation unit 230 calculates a reference height Hr and a reference width Wr, calculates a ratio (Hr / Wr) between the reference height Hr and the reference width Wr as a determination index DI, and based on the determination index DI Estimate the direction. That is, as shown in FIG. 6, when the value of the determination index DI is not less than the threshold value T1 and less than the threshold value T2, it is estimated that the orientation of the face image is the front direction. Further, when the value of the determination index DI is less than the threshold T1, it is estimated that the orientation of the face image is upward or downward, and when the value of the determination index DI is equal to or greater than the threshold T2, the face It is estimated that the orientation of the image is right-handed or left-handed. Here, in this specification, the direction of an image in which the face of the subject person faces upward is called “upward”, and the direction of the image in which the face of the subject person faces downward is called “downward”. Call. The direction of the image of the subject person facing to the right when viewed from the viewer side of the image (that is, the person is actually facing the left side) is called “right swing”. Refers to the direction of the image facing the left as viewed from the viewer side of the image (that is, the person is actually facing the right). That the image orientation is up or down is also referred to as “up and down”, and that the right or left is referred to as “left or right”.

顔の画像の向きが右振りまたは左振りである場合には、正面向きである場合と比較して、参照高さHrはほとんど変わらない一方、参照幅Wrは小さいものと考えられる。従って、顔の画像の向きが右振りまたは左振りである場合には、正面向きである場合と比較して、判定指標DI(=Hr/Wr)の値が大きくなる。反対に、顔の画像の向きが上振りまたは下振りである場合には、正面向きである場合と比較して、参照幅Wrはほとんど変わらない一方、参照高さHrは小さいものと考えられる。従って、顔の画像の向きが上振りまたは下振りである場合には、正面向きである場合と比較して、判定指標DI(=Hr/Wr)の値が小さくなる。   When the orientation of the face image is right-handed or left-handed, the reference height Hr is hardly changed, but the reference width Wr is considered to be small compared to the case of face-to-face. Therefore, when the orientation of the face image is right-handed or left-handed, the value of the determination index DI (= Hr / Wr) is larger than when the face image is faced. On the contrary, when the orientation of the face image is upside down or downside, 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 value of the determination index DI (= Hr / Wr) is smaller when the orientation of the face image is upside down or downside than when it is faced up.

閾値T1および閾値T2は、所定数の顔のサンプル画像の判定指標DI(参照幅Wrと参照高さHrとの比)から統計的に定められる。予め定められた閾値T1および閾値T2は内部メモリ120内の所定の領域に格納されており、顔向き推定部230は、対象画像TIの判定指標DIと閾値T1および閾値T2とを用いて、顔向き推定を行う。   The threshold T1 and the threshold T2 are statistically determined from the determination index DI (ratio between the reference width Wr and the reference height Hr) of a predetermined number of face sample images. The predetermined threshold T1 and threshold T2 are stored in a predetermined area in the internal memory 120, and the face direction estimation unit 230 uses the determination index DI of the target image TI, the threshold T1, and the threshold T2 to Estimate the direction.

なお、図6から明らかなように、判定指標DIは、顔の画像の向きの正面向きからの振りの程度を表す指標であると言える。例えば、右振りまたは左振りと推定された2つの顔画像の内、判定指標DIの値がより大きい一方の顔画像は、他の一方の顔画像と比較して、正面向きからの振りの程度がより大きいと推定することができる。また、閾値T1および閾値T2を決定することは、顔の画像の向きが厳密な正面向き(顔と撮像装置とが正対している状態)からどの程度振りのある顔の画像までを「正面向き」であるとして推定するかを設定することに相当する。   As can be seen from FIG. 6, the determination index DI can be said to be an index representing the degree of swing from the front direction of the face image. For example, of two face images estimated to be right-handed or left-handed, one face image having a larger value of the determination index DI is compared with the other face image and the degree of swing from the front direction Can be estimated to be larger. In addition, the threshold value T1 and the threshold value T2 are determined from the front direction in which the face image is strictly oriented (a state in which the face and the imaging device are facing each other) to the degree of the swinging face image. Is equivalent to setting whether or not to estimate.

図7は、顔向き推定において正面向きと推定された結果の一例を示す説明図である。図7に示すように、判定指標DIの値が閾値T1以上で閾値T2未満である場合には、顔の画像の向きが正面向きであると推定される。   FIG. 7 is an explanatory diagram illustrating an example of a result of estimation of the front direction in the face direction estimation. As shown in FIG. 7, when the value of the determination index DI is equal to or greater than the threshold value T1 and less than the threshold value T2, the orientation of the face image is estimated to be the front direction.

図8は、顔向き推定において右振りまたは左振りと推定された結果の一例を示す説明図である。図8に示すように、判定指標DIの値が閾値T2以上である場合には、顔の画像の向きが右振りまたは左振りであると推定される。なお、顔向き推定において、右振りまたは左振りであることが推定されるだけでなく、右振りか左振りかが特定されるとしてもよい。このような特定は、例えば、右目領域EA(r)の幅We(r)と左目領域EA(l)の幅We(l)とを比較することにより実現可能である。すなわち、右目領域EA(r)の幅We(r)の方が大きければ右振りであると推定され、左目領域EA(l)の幅We(l)の方が大きければ左振りであると推定される。   FIG. 8 is an explanatory diagram illustrating an example of a result estimated to be right swing or left swing in face orientation estimation. As shown in FIG. 8, when the value of the determination index DI is equal to or greater than the threshold T2, it is estimated that the orientation of the face image is right-handed or left-handed. In the face orientation estimation, it is possible to specify not only the right swing or the left swing but also the right swing or the left swing. Such specification can be realized, for example, by comparing the width We (r) of the right eye area EA (r) and the width We (l) of the left eye area EA (l). That is, if the width We (r) of the right eye area EA (r) is larger, it is estimated that the camera is swung right, and if the width We (l) of the left eye area EA (l) is larger, it is estimated that the camera is swung left. Is done.

図9は、顔向き推定において上振りまたは下振りと推定された結果の一例を示す説明図である。図9(a)および図9(b)に示すように、判定指標DIの値が閾値T1未満である場合には、顔の画像の向きが上振りまたは下振りであると推定される。なお、顔向き推定において、上振りまたは下振りであることが推定されるだけでなく、上振りか下振りかが特定されるとしてもよい。このような特定は、例えば、いずれか一方の目領域EAの幅Weに対する口領域MAの幅Wmの比を算出し、その値が所定の閾値より大きければ上振りとし、所定の閾値より小さければ下振りとすることにより、実現可能である。あるいは、検出顔領域FAdの高さHfに対する検出顔領域FAdの下辺から口領域MAの中心点Cmまでの距離Hmcの比を算出し、その値が所定の閾値より大きければ上振りとし、所定の閾値より小さければ下振りとすることによっても、実現可能である。   FIG. 9 is an explanatory diagram illustrating an example of a result of estimation of upward swing or downward swing in face orientation estimation. As shown in FIGS. 9A and 9B, when the value of the determination index DI is less than the threshold T1, it is estimated that the orientation of the face image is upward or downward. In the face direction estimation, it is possible not only to estimate that the face is up or down, but also to specify whether it is up or down. Such specification is performed by, for example, calculating the ratio of the width Wm of the mouth area MA to the width We of any one of the eye areas EA, and if the value is larger than a predetermined threshold, the ratio is raised. It is possible to realize by swinging down. Alternatively, the ratio of the distance Hmc from the lower side of the detected face area FAd to the center point Cm of the mouth area MA with respect to the height Hf of the detected face area FAd is calculated. If it is smaller than the threshold, it can also be realized by making a downward swing.

ステップS400(図2)において、器官領域の検出に成功しなかった場合には(ステップS500:No)、上述した検出顔領域FAdの検出に成功しなかった場合と同様に、その旨が表示部150を通じてユーザに通知される。この場合には、ユーザに他の画像を対象画像TIとして選択させるために、対象画像TIの選択のためのユーザインターフェース(図3)が表示部150に再度表示され、対象画像TIの再設定(ステップS100)が行われる。なお、器官領域の検出に成功しなかった場合には、図2のステップS600からS700までの処理がスキップされ、ステップS800の対象画像TIの印刷が行われるとしてもよい。   In step S400 (FIG. 2), when the detection of the organ area is not successful (step S500: No), the fact that the detection of the detection face area FAd is not successful is indicated by the display unit. The user is notified through 150. In this case, in order to allow the user to select another image as the target image TI, the user interface (FIG. 3) for selecting the target image TI is displayed again on the display unit 150, and the target image TI is reset ( Step S100) is performed. If the detection of the organ region is not successful, the processing from step S600 to step S700 in FIG. 2 may be skipped and the target image TI in step S800 may be printed.

ステップS620(図2)では、処理可否判定部270(図1)が、後述の変形処理(図2のステップS700)の実行の可否を判定する。具体的には、処理可否判定部270は、顔向き推定(図2のステップS600)において正面向きと推定された顔の画像が少なくとも1つあるか否かを判定する。正面向きと推定された顔の画像が少なくとも1つある場合には、変形処理実行可と判定され、正面向きと推定された顔の画像が1つも無い場合には、変形処理実行不可と判定される。   In step S620 (FIG. 2), the process availability determination unit 270 (FIG. 1) determines whether or not a deformation process (step S700 in FIG. 2) described later can be executed. Specifically, the processability determination unit 270 determines whether or not there is at least one face image that is estimated to be the front direction in the face direction estimation (step S600 in FIG. 2). If there is at least one face image estimated to be in the front direction, it is determined that the deformation process can be performed. If no face image is estimated to be in the front direction, it is determined that the deformation process cannot be performed. The

後述するように、本実施例の変形処理(図2のステップS700)は、顔の画像を幅方向に縮小して顔の形状をスリムにする処理である。そのため、正面向きではない顔の画像に対してこのような変形処理が実行されると、処理後の顔の画像が不自然なものとなるおそれがある。従って、本実施例では、正面向きと推定された顔の画像が1つも無い場合には、変形処理実行不可と判定される。なお、変形処理実行可と判定された場合にも、対象画像TIに含まれる顔の画像の内、正面向きと推定された顔の画像のみが変形処理の対象となり、正面向きではないと推定された顔の画像は変形処理の対象外となる。   As will be described later, the deformation process (step S700 in FIG. 2) of the present embodiment is a process for reducing the face image in the width direction and slimming the face shape. Therefore, when such a deformation process is performed on a face image that is not front-facing, the processed face image may become unnatural. Therefore, in this embodiment, when there is no face image estimated to be in front, it is determined that the deformation process cannot be executed. Even when it is determined that the deformation process can be performed, only the face image that is estimated to be front-facing among the face images included in the target image TI is subjected to the deformation process, and is not estimated to be front-facing. The face image is not subject to deformation processing.

ステップS700(図2)では、変形処理が行われる。変形処理は、検出顔領域FAdに基づき変形領域を設定し、変形領域内の画像を変形する処理である。変形処理の詳細については、後述の「A−3.変形処理」において説明する。図10は、変形処理後の対象画像TIの一例を示す説明図である。図10の例では、人物P1の顔の画像は、顔向き推定において正面向きと推定されたために変形処理の対象となり、変形処理前と比較して顔の形状がスリムに補正されている。一方、人物P2の顔の画像は、顔向き推定において正面向きではないと推定されたために変形処理の対象とはなっておらず、変形処理前と変わっていない。   In step S700 (FIG. 2), deformation processing is performed. The deformation process is a process of setting a deformation area based on the detected face area FAd and deforming an image in the deformation area. Details of the deformation process will be described later in “A-3. Deformation process”. FIG. 10 is an explanatory diagram illustrating an example of the target image TI after the deformation process. In the example of FIG. 10, the face image of the person P1 is subject to the deformation process because it is estimated to be the front direction in the face direction estimation, and the face shape is corrected more slimly than before the deformation process. On the other hand, the face image of the person P2 is not subject to the deformation process because it is estimated that the face direction is not the front direction in the face direction estimation, and is not different from that before the deformation process.

ステップS800(図2)では、顔形状補正印刷部200(図1)が、変形処理が行われた場合には変形処理後の対象画像TI(図10参照)の印刷を、変形処理が行われなかった場合には当初の対象画像TIの印刷を、印刷処理部320に指示する。印刷処理部320は、プリンタエンジン160を制御して、対象画像TIの印刷を行う。印刷処理部320は、対象画像TIの画像データに、解像度変換やハーフトーン処理などの処理を施して印刷データを生成する。生成された印刷データは、印刷処理部320からプリンタエンジン160に供給され、プリンタエンジン160は対象画像TIの印刷を実行する。なお、対象画像TIの印刷の前に、変形処理後の対象画像TIの表示部150における表示が行われるとしてもよい。これにより、ユーザは変形処理結果を確認することができる。   In step S800 (FIG. 2), the face shape correction printing unit 200 (FIG. 1) prints the target image TI (see FIG. 10) after the deformation process when the deformation process is performed. If not, the print processing unit 320 is instructed to print the original target image TI. The print processing unit 320 controls the printer engine 160 to print the target image TI. The print processing unit 320 performs processing such as resolution conversion and halftone processing on the image data of the target image TI to generate print data. The generated print data is supplied from the print processing unit 320 to the printer engine 160, and the printer engine 160 executes printing of the target image TI. Note that the display of the target image TI after the deformation process may be performed on the display unit 150 before the target image TI is printed. Thereby, the user can confirm the deformation process result.

以上説明したように、本実施例のプリンタ100は、器官領域を検出すると共に、検出された器官領域に基づき、対象画像TIにおける顔の画像の向きを推定することができる。具体的には、プリンタ100は、右目領域EA(r)と左目領域EA(l)と口領域MAとを器官領域として検出し、参照幅Wrと参照高さHrとの比(判定指標DI)に基づき、対象画像TIにおける顔の画像の向きを推定する。また、本実施例のプリンタ100は、判定指標DIに基づき、対象画像TIにおける顔の画像の正面向きからの振りの程度を推定することもできる。   As described above, the printer 100 according to the present embodiment can detect an organ region and estimate the orientation of the face image in the target image TI based on the detected organ region. Specifically, the printer 100 detects the right eye area EA (r), the left eye area EA (l), and the mouth area MA as organ areas, and the ratio of the reference width Wr to the reference height Hr (determination index DI). Based on the above, the orientation of the face image in the target image TI is estimated. In addition, the printer 100 according to the present exemplary embodiment can estimate the degree of the swing of the face image in the target image TI from the front direction based on the determination index DI.

また、本実施例のプリンタ100は、対象画像TIにおける顔の画像の向きを推定することができるため、正面向きではない顔の画像を変形処理(図2のステップS700)の対象から除外することにより、変形処理によって画像が不自然に補正されることを防止できる。   Further, since the printer 100 of the present embodiment can estimate the orientation of the face image in the target image TI, the face image that is not front-facing is excluded from the target of the deformation process (step S700 in FIG. 2). Thus, it is possible to prevent the image from being unnaturally corrected by the deformation process.

また、本実施例のプリンタ100では、器官領域のそれぞれについて信頼度指標が設定され、信頼度指標の値が所定の閾値より大きい器官領域のみに基づき対象画像TIにおける顔の画像の向きが推定されるため、推定精度の低下を抑制することができる。   In the printer 100 of this embodiment, a reliability index is set for each organ region, and the orientation of the face image in the target image TI is estimated based only on the organ region whose reliability index value is larger than a predetermined threshold. Therefore, a decrease in estimation accuracy can be suppressed.

A−3.変形処理:
図11は、変形処理(図2のステップS700)の流れを示すフローチャートである。ステップS710では、変形領域設定部240が変形領域TAを設定する。変形領域TAは、対象画像TI上の領域であって顔形状補正のための変形処理の対象となる領域である。図12は、変形領域TAの設定方法の一例を示す説明図である。図12には、検出顔領域FAdが示されている(図4参照)。図12に示した基準線RLは、検出顔領域FAdの高さ方向(上下方向)を定義すると共に、検出顔領域FAdの幅方向(左右方向)の中心を示す線である。すなわち、基準線RLは、矩形の検出顔領域FAdの重心を通り、検出顔領域FAdの高さ方向(上下方向)に沿った境界線に平行な直線である。
A-3. Transformation process:
FIG. 11 is a flowchart showing the flow of the deformation process (step S700 in FIG. 2). In step S710, the deformation area setting unit 240 sets the deformation area TA. The deformation area TA is an area on the target image TI that is a target of deformation processing for face shape correction. FIG. 12 is an explanatory diagram showing an example of a method for setting the deformation area TA. FIG. 12 shows a detected face area FAd (see FIG. 4). A reference line RL shown in FIG. 12 is a line that defines the height direction (vertical direction) of the detected face area FAd and indicates the center in the width direction (left and right direction) of the detected face area FAd. That is, the reference line RL is a straight line that passes through the center of gravity of the rectangular detection face area FAd and is parallel to the boundary line along the height direction (vertical direction) of the detection face area FAd.

図12に示すように、本実施例では、変形領域TAは、検出顔領域FAdを基準線RLと平行な方向(高さ方向)および基準線RLに直行する方向(幅方向)に伸張(または短縮)した領域として設定される。具体的には、検出顔領域FAdの高さ方向の大きさをHf、幅方向の大きさをWfとすると、検出顔領域FAdを、上方向にk1・Hf、下方向にk2・Hfだけ伸ばすと共に、左右にそれぞれk3・Wfだけ伸ばした領域が、変形領域TAとして設定される。なお、k1,k2,k3は、所定の係数である。   As shown in FIG. 12, in this embodiment, the deformation area TA extends (or extends in the direction (width direction) parallel to the reference line RL and the direction (width direction) perpendicular to the reference line RL. It is set as a shortened area. Specifically, when the height direction of the detected face area FAd is Hf and the width direction is Wf, the detected face area FAd is extended by k1 · Hf upward and by k2 · Hf downward. At the same time, a region extended to the left and right by k3 · Wf is set as the deformation region TA. Note that k1, k2, and k3 are predetermined coefficients.

このように変形領域TAが設定されると、検出顔領域FAdの高さ方向の輪郭線に平行な直線である基準線RLは、変形領域TAの高さ方向の輪郭線にも平行な直線となる。また、基準線RLは、変形領域TAの幅を半分に分割する直線となる。   When the deformation area TA is set in this way, the reference line RL, which is a straight line parallel to the contour line in the height direction of the detection face area FAd, is a straight line parallel to the contour line in the height direction of the deformation area TA. Become. The reference line RL is a straight line that divides the width of the deformation area TA in half.

図12に示すように、変形領域TAは、高さ方向に関しては、概ね顎から額までの画像を含み、幅方向に関しては、左右の頬の画像を含むような領域として設定される。すなわち、本実施例では、変形領域TAが概ねそのような範囲の画像を含む領域となるように、検出顔領域FAdの大きさとの関係に基づき、上述の係数k1,k2,k3が予め設定されている。   As shown in FIG. 12, the deformation area TA is set as an area that generally includes an image from the jaw to the forehead in the height direction and includes images of the left and right cheeks in the width direction. That is, 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 detected face area FAd so that the deformation area TA is an area that includes an image in such a range. ing.

ステップS720(図11)では、変形領域分割部250(図1)が、変形領域TAを複数の小領域に分割する。図13は、変形領域TAの小領域への分割方法の一例を示す説明図である。変形領域分割部250は、変形領域TAに複数の分割点Dを配置し、分割点Dを結ぶ直線を用いて変形領域TAを複数の小領域に分割する。   In step S720 (FIG. 11), the deformation area dividing unit 250 (FIG. 1) divides the deformation area TA into a plurality of small areas. FIG. 13 is an explanatory diagram illustrating an example of a method of dividing the deformation area TA into small areas. The deformation area dividing unit 250 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.

分割点Dの配置の態様(分割点Dの個数および位置)は、分割点配置パターンテーブル410(図1)により定義されている。変形領域分割部250は、分割点配置パターンテーブル410を参照して分割点Dを配置する。なお、本実施例では、顔の形状をスリムにするための顔形状補正が行われるものとしており、そのような顔形状補正に対応した態様で分割点Dの配置が行われる。   The arrangement mode of the dividing points D (the number and positions of the dividing points D) is defined by the dividing point arrangement pattern table 410 (FIG. 1). The deformation area dividing unit 250 arranges the dividing points D with reference to the dividing point arrangement pattern table 410. In this embodiment, face shape correction for slimming the face shape is performed, and the division points D are arranged in a manner corresponding to such face shape correction.

図13に示すように、分割点Dは、水平分割線Lhと垂直分割線Lvとの交点と、水平分割線Lhおよび垂直分割線Lvと変形領域TAの外枠との交点とに配置される。ここで、水平分割線Lhおよび垂直分割線Lvは、変形領域TA内に分割点Dを配置するための基準となる線である。図13に示すように、本実施例における分割点Dの配置では、基準線RLと直行する2本の水平分割線Lhと、基準線RLに平行な4本の垂直分割線Lvとが設定される。2本の水平分割線Lhを、変形領域TAの下方から順に、Lh1,Lh2と呼ぶ。また、4本の垂直分割線Lvを、変形領域TAの左から順に、Lv1,Lv2,Lv3,Lv4と呼ぶ。   As shown in FIG. 13, the division points D are arranged at the intersections of the horizontal division line Lh and the vertical division line Lv and at the intersections of the horizontal division line Lh and the vertical division line Lv and the outer frame of the deformation area TA. . Here, the horizontal dividing line Lh and the vertical dividing line Lv are reference lines for arranging the dividing points D in the deformation area TA. As shown in FIG. 13, in the arrangement of the dividing points D in this embodiment, two horizontal dividing lines Lh perpendicular to the reference line RL and four vertical dividing lines Lv parallel to the reference line RL are set. The 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 below the chin image in the deformation area TA, and the horizontal dividing line Lh2 is arranged near the eye image. The vertical dividing lines Lv1 and Lv4 are arranged outside the cheek line image, and the vertical dividing lines Lv2 and Lv3 are arranged outside the eye corner image. 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が配置される。図13に示すように、水平分割線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と呼ばれる。   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. 13, the 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.

なお、図13に示すように、本実施例における分割点Dの配置は、基準線RLに対して対称の配置となっている。   As shown in FIG. 13, the arrangement of the dividing points D in the present embodiment is symmetrical with respect to the reference line RL.

変形領域分割部250は、配置された分割点Dを結ぶ直線(すなわち水平分割線Lhおよび垂直分割線Lv)により、変形領域TAを複数の小領域に分割する。本実施例では、図13に示すように、変形領域TAが15個の矩形の小領域に分割される。   The deformation area dividing unit 250 divides the deformation area TA into a plurality of small areas by a straight line connecting the arranged dividing points D (that is, the horizontal dividing line Lh and the vertical dividing line Lv). In the present embodiment, as shown in FIG. 13, the deformation area TA is divided into 15 rectangular small areas.

なお本実施例では、分割点Dの配置は、水平分割線Lhおよび垂直分割線Lvの本数および位置により定まるため、分割点配置パターンテーブル410は水平分割線Lhおよび垂直分割線Lvの本数および位置を定義していると言い換えることも可能である。   In the present embodiment, 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 410 has the numbers and positions of the horizontal dividing lines Lh and the vertical dividing lines Lv. In other words, it is possible to define that

ステップS730(図11)では、分割領域変形部260(図1)が、対象画像TIの変形領域TAを対象とした画像の変形処理を行う。分割領域変形部260による変形処理は、ステップS720で変形領域TA内に配置された分割点Dの位置を移動して、小領域を変形することにより行われる。   In step S730 (FIG. 11), the divided region deformation unit 260 (FIG. 1) performs an image deformation process on the deformation region TA of the target image TI. The deformation process by the divided area deforming unit 260 is performed by moving the position of the dividing point D arranged in the deformed area TA in step S720 to deform the small area.

変形処理のための各分割点Dの位置の移動態様(移動方向および移動距離)は、分割点移動テーブル420(図1)により予め定められている。分割領域変形部260は、分割点移動テーブル420を参照して、分割点Dの位置を移動する。なお、本実施例では、顔の形状をスリムにするための顔形状補正が行われるものとしており、そのような顔形状補正に対応した態様で分割点Dの位置の移動が行われる。   The movement mode (movement direction and movement distance) of each division point D for the deformation process is determined in advance by the division point movement table 420 (FIG. 1). The divided area deforming unit 260 moves the position of the divided point D with reference to the divided point movement table 420. In this embodiment, face shape correction for slimming the face shape is performed, and the position of the dividing point D is moved in a manner corresponding to such face shape correction.

図14は、分割点移動テーブル420の内容の一例を示す説明図である。また図15は、分割点移動テーブル420に従った分割点Dの位置の移動の一例を示す説明図である。図14には、分割点移動テーブル420により定義された、顔の形状をスリムにするための顔形状補正に対応付けられた分割点Dの位置の移動態様を示している。図14に示すように、分割点移動テーブル420には、各分割点Dについて、基準線RLと直行する方向(H方向)および基準線RLと平行な方向(V方向)に沿った移動量が示されている。なお、本実施例では、分割点移動テーブル420に示された移動量の単位は、対象画像TIの画素ピッチPPである。また、H方向については、向かって右側への移動量が正の値として表され、向かって左側への移動量が負の値として表され、V方向については、上方への移動量が正の値として表され、下方への移動量が負の値として表される。例えば、分割点D11は、H方向に沿って右側に画素ピッチPPの7倍の距離だけ移動され、V方向に沿って上方に画素ピッチPPの14倍の距離だけ移動される。また、例えば分割点D22は、H方向およびV方向共に移動量がゼロであるため、移動されない。   FIG. 14 is an explanatory diagram showing an example of the contents of the dividing point movement table 420. FIG. 15 is an explanatory diagram showing an example of movement of the position of the dividing point D according to the dividing point movement table 420. FIG. 14 shows a movement mode of the position of the division point D that is defined by the division point movement table 420 and associated with face shape correction for slimming the face shape. As shown in FIG. 14, in the dividing point movement table 420, for each dividing point D, there is a moving amount along a direction (H direction) perpendicular to the reference line RL and a direction parallel to the reference line RL (V direction). It is shown. In this embodiment, the unit of movement amount shown in the dividing point movement table 420 is the pixel pitch PP of the target image TI. For the H direction, the amount of movement to the right side is represented as a positive value, the amount of movement to the left side is represented as a negative value, and for the V direction, the amount of movement upward is positive. It is expressed as a value, and the downward movement amount is expressed as a negative value. For example, the dividing point D11 is moved to the right along the H direction by a distance that is seven times the pixel pitch PP, and is moved upward along the V direction by a distance that is 14 times the pixel pitch PP. For example, the division point D22 is not moved because the movement amount is zero in both the H direction and the V direction.

なお、本実施例では、変形領域TAの内外の画像間の境界が不自然とならないように、変形領域TAの外枠上に位置する分割点D(例えば図13に示す分割点D10等)の位置は移動されないものとしている。従って、図14に示した分割点移動テーブル420には、変形領域TAの外枠上に位置する分割点Dについての移動態様は定義されていない。   In this embodiment, the division points D (for example, the division points D10 shown in FIG. 13) located on the outer frame of the deformation area TA are set so that the boundary between the inner and outer images of the deformation area TA does not become unnatural. The position is not moved. Therefore, in the dividing point movement table 420 shown in FIG. 14, the movement mode for the dividing point D located on the outer frame of the deformation area TA is not defined.

図15では、移動前の分割点Dは白抜きの丸で、移動後の分割点Dや位置の移動の無い分割点Dは黒丸で示されている。また、移動後の分割点Dは分割点D’と呼ばれるものとする。例えば分割点D11の位置は、図15において右上方向に移動され、分割点D’11となる。   In FIG. 15, 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. Further, the divided point D after the movement is referred to as a divided point D ′. For example, the position of the dividing point D11 is moved in the upper right direction in FIG. 15, and becomes the dividing point D′ 11.

なお、本実施例では、基準線RLに対して対称な位置関係にある2つの分割点Dの組み合わせ(例えば分割点D11とD41との組み合わせ)のすべてが、分割点Dの移動後も、基準線RLに対して対称な位置関係を維持するように、移動態様が定められている。   In the present embodiment, all combinations of two division points D (for example, combinations of division points D11 and D41) that are in a symmetric positional relationship with respect to the reference line RL are the same after the movement of the division point D. The movement mode is determined so as to maintain a symmetrical positional relationship with respect to the line RL.

分割領域変形部260は、変形領域TAを構成する各小領域について、分割点Dの位置移動前の状態における小領域の画像が、分割点Dの位置移動により新たに定義された小領域の画像となるように、画像の変形処理を行う。例えば、図15において、分割点D11,D21,D22,D12を頂点とする小領域(ハッチングを付して示す小領域)の画像は、分割点D’11,D’21,D22,D’12を頂点とする小領域の画像に変形される。   For each small area constituting the deformation area TA, the divided area deforming unit 260 is an image of a small area newly defined by moving the position of the dividing point D. The image is deformed so that For example, in FIG. 15, an image of a small region (small region indicated by hatching) having vertices at division points D11, D21, D22, and D12 is divided into points D′ 11, D′ 21, D22, and D′ 12. Is transformed into an image of a small area with the vertex at.

図16は、分割領域変形部260による画像の変形処理方法の概念を示す説明図である。図16では、分割点Dを黒丸で示している。図16では、説明を簡略化するために、4つの小領域について、左側に分割点Dの位置移動前の状態を、右側に分割点Dの位置移動後の状態を、それぞれ示している。図16の例では、中央の分割点Daが分割点Da’の位置に移動され、その他の分割点Dの位置は移動されない。これにより、例えば、分割点Dの移動前の分割点Da,Db,Dc,Ddを頂点とする矩形の小領域(以下「変形前注目小領域BSA」とも呼ぶ)の画像は、分割点Da’,Db,Dc,Ddを頂点とする矩形の小領域(以下「変形後注目小領域ASA」とも呼ぶ)の画像に変形される。   FIG. 16 is an explanatory diagram illustrating the concept of the image deformation processing method performed by the divided region deformation unit 260. In FIG. 16, the dividing point D is indicated by a black circle. In FIG. 16, 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 movement of the dividing point D is shown on the right side. In the example of FIG. 16, the central division point Da is moved to the position of the division point Da ′, and the positions of the other division 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つの三角形領域に分割し、三角形領域単位で画像の変形処理を行っている。図16の例では、変形前注目小領域BSAが、変形前注目小領域BSAの重心CGを頂点の1つとする4つの三角形領域に分割される。同様に、変形後注目小領域ASAが、変形後注目小領域ASAの重心CG’を頂点の1つとする4つの三角形領域に分割される。そして、分割点Daの移動前後のそれぞれの状態において対応する三角形領域毎に、画像の変形処理が行われる。例えば、変形前注目小領域BSA中の分割点Da,Ddおよび重心CGを頂点とする三角形領域の画像が、変形後注目小領域ASA中の分割点Da’,Ddおよび重心CG’を頂点とする三角形領域の画像に変形される。   In this 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. 16, 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.

図17は、三角形領域における画像の変形処理方法の概念を示す説明図である。図17の例では、点s,t,uを頂点とする三角形領域stuの画像が、点s’,t’,u’を頂点とする三角形領域s’t’u’の画像に変形される。画像の変形は、変形後の三角形領域s’t’u’の画像中のある画素の位置が、変形前の三角形領域stuの画像中のどの位置に相当するかを算出し、算出された位置における変形前の画像における画素値を変形後の画像の画素値とすることにより行う。   FIG. 17 is an explanatory diagram showing the concept of an image deformation processing method in a triangular area. In the example of FIG. 17, 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. . 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.

例えば、図17において、変形後の三角形領域s’t’u’の画像中の注目画素p’の位置は、変形前の三角形領域stuの画像中の位置pに相当するものとする。位置pの算出は、以下のように行う。まず、注目画素p’の位置を、下記の式(1)のようにベクトルs’t’とベクトルs’u’との和で表現するための係数m1およびm2を算出する。   For example, in FIG. 17, 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 (1) are calculated.

Figure 2009123101
Figure 2009123101

次に、算出された係数m1およびm2を用いて、下記の式(2)により、変形前の三角形領域stuにおけるベクトルstとベクトルsuとの和を算出することにより、位置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 by the following equation (2).

Figure 2009123101
Figure 2009123101

変形前の三角形領域stuにおける位置pが、変形前の画像の画素中心位置に一致した場合には、当該画素の画素値が変形後の画像の画素値とされる。一方、変形前の三角形領域stuにおける位置pが、変形前の画像の画素中心位置からはずれた位置となった場合には、位置pの周囲の画素の画素値を用いたバイキュービック等の補間演算により、位置pにおける画素値を算出し、算出された画素値が変形後の画像の画素値とされる。   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’の画像への画像変形処理を行うことができる。分割領域変形部260は、図13に示した変形領域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 divided area deformation unit 260 performs a deformation process by defining a triangular area as described above for each small area constituting the deformation area TA shown in FIG. 13 and performs an image deformation process in the deformation area TA.

ここで、本実施例の顔形状補正の態様についてより詳細に説明する。図18は、本実施例における顔形状補正の態様を示す説明図である。本実施例では、上述したように、顔の形状をスリムにする顔形状補正が行われる。図18には、変形領域TAを構成する各小領域の変形態様のイメージを矢印により示している。   Here, the face shape correction mode of the present embodiment will be described in more detail. FIG. 18 is an explanatory diagram showing a form of face shape correction in the present embodiment. In this embodiment, as described above, face shape correction is performed to make the face shape slim. In FIG. 18, the image of the deformation | transformation aspect of each small area | region which comprises deformation | transformation area | region TA is shown with the arrow.

図18に示すように、本実施例の顔形状補正では、基準線RLと平行な方向(V方向)に関し、水平分割線Lh1上に配置された分割点D(D11,D21,D31,D41)の位置は上方に移動される一方、水平分割線Lh2上に配置された分割点D(D12,D22,D32,D42)の位置は移動されない(図14参照)。従って、水平分割線Lh1と水平分割線Lh2との間に位置する画像は、V方向に関して縮小される。上述したように、水平分割線Lh1は顎の画像より下方に配置され、水平分割線Lh2は目の画像のすぐ下付近に配置されるため、本実施例の顔形状補正では、顔の画像の内、顎から目の下にかけての部分の画像がV方向に縮小されることとなる。この結果、画像中の顎のラインは上方に移動する。   As shown in FIG. 18, in the face shape correction of the present embodiment, the dividing points D (D11, D21, D31, D41) arranged on the horizontal dividing line Lh1 with respect to the direction (V direction) parallel to the reference line RL. Is moved upward, while the positions of the dividing points D (D12, D22, D32, D42) arranged on the horizontal dividing line Lh2 are not moved (see FIG. 14). Therefore, the image located between the horizontal dividing line Lh1 and the horizontal dividing line Lh2 is reduced in the V direction. As described above, since the horizontal dividing line Lh1 is arranged below the chin image and the horizontal dividing line Lh2 is arranged in the vicinity immediately below the eye image, in the face shape correction of this embodiment, the face image is corrected. The image of the part from the inner jaw to the lower part of the eye is reduced in the V direction. As a result, the jaw line in the image moves upward.

他方、基準線RLと直行する方向(H方向)に関しては、垂直分割線Lv1上に配置された分割点D(D11,D12)の位置は右方向に移動され、垂直分割線Lv4上に配置された分割点D(D41,D42)の位置は左方向に移動される(図14参照)。さらに、垂直分割線Lv2上に配置された2つの分割点Dの内、水平分割線Lh1上に配置された分割点D(D21)の位置は右方向に移動され、垂直分割線Lv3上に配置された2つの分割点Dの内、水平分割線Lh1上に配置された分割点D(D31)の位置は左方向に移動される(図14参照)。従って、垂直分割線Lv1より左側に位置する画像は、H方向に関して右側に拡大され、垂直分割線Lv4より右側に位置する画像は、左側に拡大される。また、垂直分割線Lv1と垂直分割線Lv2との間に位置する画像は、H方向に関して縮小または右側に移動され、垂直分割線Lv3と垂直分割線Lv4との間に位置する画像は、H方向に関して縮小または左側に移動される。さらに、垂直分割線Lv2と垂直分割線Lv3との間に位置する画像は、水平分割線Lh1の位置を中心にH方向に関して縮小される。   On the other hand, in the direction (H direction) perpendicular to the reference line RL, the position of the dividing point D (D11, D12) arranged on the vertical dividing line Lv1 is moved rightward and arranged on the vertical dividing line Lv4. The position of the dividing point D (D41, D42) is moved to the left (see FIG. 14). Further, of the two division points D arranged on the vertical division line Lv2, the position of the division point D (D21) arranged on the horizontal division line Lh1 is moved rightward and arranged on the vertical division line Lv3. Of the two divided points D, the position of the divided point D (D31) arranged on the horizontal dividing line Lh1 is moved to the left (see FIG. 14). Therefore, the image located on the left side of the vertical dividing line Lv1 is enlarged on the right side in the H direction, and the image located on the right side of the vertical dividing line Lv4 is enlarged on the left side. An image located between the vertical dividing line Lv1 and the vertical dividing line Lv2 is reduced or moved to the right in the H direction, and an image located between the vertical dividing line Lv3 and the vertical dividing line Lv4 is moved in the H direction. Is reduced or moved to the left. Further, the image located between the vertical division line Lv2 and the vertical division line Lv3 is reduced in the H direction with the position of the horizontal division line Lh1 as the center.

上述したように、垂直分割線Lv1およびLv4は、頬のラインの画像の外側に配置され、垂直分割線Lv2およびLv3は、目尻の画像の外側に配置される。そのため、本実施例の顔形状補正では、顔の画像の内、両目尻より外側の部分の画像が全体的にH方向に縮小される。特に顎付近において縮小率が高くなる。この結果、画像中の顔の形状は、全体的に幅方向に細くなる。   As described above, the vertical division lines Lv1 and Lv4 are arranged outside the cheek line image, and the vertical division lines Lv2 and Lv3 are arranged outside the corner image. Therefore, in the face shape correction according to the present embodiment, the image of the portion outside the both corners of the face image is reduced in the H direction as a whole. In particular, the reduction rate is high near the jaw. As a result, the shape of the face in the image becomes thinner in the width direction as a whole.

上述したH方向およびV方向の変形態様を総合すると、本実施例の顔形状補正により、対象画像TI中の顔の形状がスリムになる。なお、顔の形状がスリムになるとは、いわゆる「小顔」になると表現することもできる。   If the deformation | transformation aspect of the H direction mentioned above and the V direction are put together, the shape of the face in the target image TI will become slim by the face shape correction | amendment of a present Example. Note that the slim shape of the face can also be expressed as a so-called “small face”.

なお、図18に示す分割点D22,D32,D33,D23を頂点とする小領域(ハッチングを付した領域)は、上述した水平分割線Lh2や垂直分割線Lv2およびLv3の配置方法によると、両目の画像を含む領域となる。図14に示すように、分割点D22およびD32はH方向にもV方向にも移動されないため、この両目の画像を含む小領域は変形されない。このように本実施例では、両目の画像を含む小領域については変形しないこととし、顔形状補正後の画像がより自然で好ましいものとなるようにしている。   Note that the small areas (hatched areas) having the divide points D22, D32, D33, and D23 shown in FIG. 18 as vertices are determined according to the arrangement method of the horizontal division lines Lh2 and the vertical division lines Lv2 and Lv3. This area includes the image. As shown in FIG. 14, since the dividing points D22 and D32 are not moved in the H direction or the V direction, the small region including the images of both eyes is not deformed. As described above, in this embodiment, the small area including the images of both eyes is not deformed, and the image after the face shape correction is made more natural and preferable.

B.第2実施例:
図19は、本発明の第2実施例における画像処理装置としてのプリンタ100aの構成を概略的に示す説明図である。第2実施例のプリンタ100aは、内部メモリ120に格納されたプログラムやデータが、図1に示した第1実施例のプリンタ100とは異なっている。すなわち、第2実施例のプリンタ100aの内部メモリ120には、顔形状補正印刷部200(図1)の代わりに顔補正印刷部202が格納されており、また、分割点配置パターンテーブル410や分割点移動テーブル420(図1参照)は格納されていない。第2実施例のプリンタ100aのその他の構成は、第1実施例のプリンタ100と同様である。
B. Second embodiment:
FIG. 19 is an explanatory diagram schematically showing the configuration of a printer 100a as an image processing apparatus according to the second embodiment of the present invention. The printer 100a of the second embodiment is different from the printer 100 of the first embodiment shown in FIG. 1 in the programs and data stored in the internal memory 120. That is, the internal memory 120 of the printer 100a according to the second embodiment stores the face correction printing unit 202 instead of the face shape correction printing unit 200 (FIG. 1), and also includes the division point arrangement pattern table 410 and the division point arrangement pattern table 410. The point movement table 420 (see FIG. 1) is not stored. Other configurations of the printer 100a of the second embodiment are the same as those of the printer 100 of the first embodiment.

顔補正印刷部202は、所定のオペレーティングシステムの下で、後述する顔補正印刷処理を実行するためのコンピュータプログラムである。顔補正印刷部202は、プログラムモジュールとして、顔領域検出部210と、器官領域検出部220と、顔向き推定部230と、顔領域設定部280と、補正処理部290とを含んでいる。顔領域検出部210と器官領域検出部220と顔向き推定部230の機能については、第1実施例と同様である。顔領域設定部280および補正処理部290については、後述の顔補正印刷処理の説明において詳述する。   The face correction printing unit 202 is a computer program for executing a face correction printing process described later under a predetermined operating system. The face correction printing unit 202 includes a face region detection unit 210, an organ region detection unit 220, a face orientation estimation unit 230, a face region setting unit 280, and a correction processing unit 290 as program modules. The functions of the face area detection unit 210, the organ area detection unit 220, and the face direction estimation unit 230 are the same as those in the first embodiment. The face area setting unit 280 and the correction processing unit 290 will be described in detail in the description of the face correction printing process described later.

第2実施例のプリンタ100aは、対象画像の顔補正と顔補正後の対象画像の印刷とを行う顔補正印刷処理を実行することができる。本実施例の顔補正は、顔の肌部分の画像の色を好ましい色に変更する肌色補正である。カードスロット172にメモリカードMCが挿入され、ユーザによる操作部140を介した所定の操作が行われると、顔補正印刷処理が開始される。   The printer 100a according to the second embodiment can execute face correction printing processing for performing face correction of the target image and printing of the target image after face correction. The face correction of this embodiment is a skin color correction that changes the color of the image of the skin portion of the face to a preferable color. When the memory card MC is inserted into the card slot 172 and a predetermined operation is performed by the user via the operation unit 140, the face correction printing process is started.

図20は、顔補正印刷処理の流れを示すフローチャートである。ステップS100からステップS600までの処理内容は、第1実施例における顔形状補正印刷処理(図2)のステップS100からステップS600までの処理内容と同じである。なお、第2実施例における顔向き推定(図20のステップS600)では、顔の画像の向きが、正面向きと上振りと下振りと右振りと左振りとのいずれか1つであると推定される。   FIG. 20 is a flowchart showing the flow of the face correction printing process. The processing contents from step S100 to step S600 are the same as the processing contents from step S100 to step S600 of the face shape correction printing process (FIG. 2) in the first embodiment. In the face orientation estimation (step S600 in FIG. 20) in the second embodiment, it is estimated that the orientation of the face image is any one of the front orientation, the upward swing, the downward swing, the right swing, and the left swing. Is done.

ステップS660(図20)では、顔領域設定部280(図19)が、対象画像TIにおける顔の画像を含む顔領域FAの設定を行う。本明細書では、ステップS660で設定される顔領域FAを「決定顔領域FAs」とも呼ぶ。顔領域設定部280は、検出された器官領域に基づき、ステップS600(図20)で推定された顔の画像の向きに応じた方法で、決定顔領域FAsを設定する。ステップS200(図20)の検出顔領域FAdの検出では、パターンマッチングにおいて、検出顔領域FAdの候補となる領域をその傾きや大きさや位置をずらしながら順次設定する際に、単位ずらし量(ずらし量のピッチ)を比較的大きな値に限定することによって処理の高速化を図っており、検出顔領域FAdと実際の顔の画像との間にずれが生ずる場合がある。さらに、顔の画像が正面向きではない場合には、検出顔領域FAdと実際の顔の画像との間に、顔の画像が正面向きではないことに起因するずれが生ずる場合がある。このようなずれを補正するため、本実施例では、決定顔領域FAsの設定が行われる。   In step S660 (FIG. 20), the face area setting unit 280 (FIG. 19) sets the face area FA including the face image in the target image TI. In this specification, the face area FA set in step S660 is also referred to as “determined face area FAs”. The face area setting unit 280 sets the determined face area FAs based on the detected organ area by a method corresponding to the orientation of the face image estimated in step S600 (FIG. 20). In the detection of the detected face area FAd in step S200 (FIG. 20), the unit shift amount (shift amount) is set in the pattern matching when the candidate areas of the detected face area FAd are sequentially set while shifting the inclination, size, and position. ) Is limited to a relatively large value, the processing speed is increased, and there may be a deviation between the detected face area FAd and the actual face image. Further, when the face image is not front-facing, there may be a difference between the detected face area FAd and the actual face image due to the fact that the face image is not front-facing. In order to correct such a shift, in the present embodiment, the determined face area FAs is set.

図21は、推定された顔の画像の向きが正面向きである場合の決定顔領域FAsの設定方法を示す説明図である。図21に示すように、矩形の決定顔領域FAsの大きさ(幅および高さ)は、参照幅Wrおよび参照高さHrに基づき決定される。すなわち、決定顔領域FAsの幅は、参照幅Wrに所定の係数c1を乗じた値とされ、決定顔領域FAsの高さは、参照高さHrに所定の係数c2を乗じた値とされる。また、決定顔領域FAsの位置は、右目領域EA(r)の中心点Ce(r)と左目領域EA(l)の中心点Ce(l)とを結ぶ線分CLの中点BPに基づき決定される。すなわち、決定顔領域FAsの位置は、決定顔領域FAsを幅方向に沿って所定の比R1対R2で分割する直線と決定顔領域FAsを高さ方向に沿って所定の比R3対R4で分割する直線との交点RPが、線分CLの中点BPに重なるような位置とされる。なお、本実施例では、所定の比R1対R2は、1対1である。また、決定顔領域FAsの傾きは、検出顔領域FAdと同じ傾きであるとされる。   FIG. 21 is an explanatory diagram illustrating a method of setting the determined face area FAs when the estimated face image orientation is the front orientation. As shown in FIG. 21, the size (width and height) of the rectangular determined face area FAs is determined based on the reference width Wr and the reference height Hr. That is, the width of the determined face area FAs is a value obtained by multiplying the reference width Wr by a predetermined coefficient c1, and the height of the determined face area FAs is a value obtained by multiplying the reference height Hr by a predetermined coefficient c2. . The position of the determined face area FAs is determined based on the midpoint BP of the line segment CL connecting the center point Ce (r) of the right eye area EA (r) and the center point Ce (l) of the left eye area EA (l). Is done. That is, the position of the determined face area FAs is divided into a straight line that divides the determined face area FAs along the width direction at a predetermined ratio R1 to R2 and a determined face area FAs along the height direction at a predetermined ratio R3 to R4. The intersection point RP with the straight line to be overlapped with the midpoint BP of the line segment CL. In the present embodiment, the predetermined ratio R1 to R2 is 1: 1. The inclination of the determined face area FAs is the same as that of the detected face area FAd.

以上のようにして決定された大きさ、位置、傾きを有する領域が、決定顔領域FAsとして設定される。推定された顔の画像の向きが正面向きである場合には、決定顔領域FAsは、検出顔領域FAdと比較して、実際の顔の画像との間のずれが抑制された領域となる。   An area having the size, position, and inclination determined as described above is set as the determined face area FAs. When the estimated orientation of the face image is front-facing, the determined face area FAs is an area in which a deviation from the actual face image is suppressed as compared to the detected face area FAd.

図22は、推定された顔の画像の向きが右振りである場合の決定顔領域FAsの設定方法を示す説明図である。図22に示すように、矩形の決定顔領域FAsの大きさ(幅および高さ)は、参照幅Wrおよび参照高さHrに基づき決定される。すなわち、決定顔領域FAsの高さは、図21に示した正面向きの場合と同様に、参照高さHrに所定の係数c2を乗じた値とされる。また、決定顔領域FAsの幅は、参照幅Wrに所定の係数c1を乗じ、さらに係数αを乗じた値とされる。ここで、係数αは、左目領域EA(l)の幅We(l)に対する右目領域EA(r)の幅We(r)の比である。一般に、顔の画像の向きが右振りの場合には、右目領域EA(r)の幅We(r)は、左目領域EA(l)の幅We(l)より大きいため、係数αは1より大きな値となる。従って、右振りの場合において決定顔領域FAsの幅の算出のために参照幅Wrに乗じられる係数(α・c1)は、正面向きの場合(図21参照)において参照幅Wrに乗じられる係数(c1)と比較して、より大きい。これにより、正面向きの顔の画像と比較して参照幅Wrが小さくなる傾向にある右振りの顔の画像において、適切な幅の領域を決定顔領域FAsとして設定することが可能となる。   FIG. 22 is an explanatory diagram illustrating a method of setting the determined face area FAs when the estimated orientation of the face image is right-handed. As shown in FIG. 22, the size (width and height) of the rectangular determined face area FAs is determined based on the reference width Wr and the reference height Hr. That is, the height of the determined face area FAs is set to a value obtained by multiplying the reference height Hr by a predetermined coefficient c2 as in the case of the front orientation shown in FIG. The width of the determined face area FAs is a value obtained by multiplying the reference width Wr by a predetermined coefficient c1 and further by a coefficient α. Here, the coefficient α is a ratio of the width We (r) of the right eye area EA (r) to the width We (l) of the left eye area EA (l). In general, when the orientation of the face image is to the right, the width We (r) of the right eye area EA (r) is larger than the width We (l) of the left eye area EA (l). Large value. Accordingly, the coefficient (α · c1) multiplied by the reference width Wr for calculating the width of the determined face area FAs in the case of turning right is a coefficient (α · c1) multiplied by the reference width Wr in the case of facing front (see FIG. 21). Greater than c1). Accordingly, it is possible to set an area having an appropriate width as the determined face area FAs in the right-faced face image in which the reference width Wr tends to be smaller than the face image facing the front.

また、決定顔領域FAsの位置は、中心点Ce(r)とCe(l)とを結ぶ線分CLの中点BPに基づき決定される。すなわち、決定顔領域FAsの位置は、決定顔領域FAsを幅方向に沿って所定の比R5対R6で分割する直線と決定顔領域FAsを高さ方向に沿って所定の比R3対R4で分割する直線との交点RPが、線分CLの中点BPに重なるような位置とされる。ここで、所定の比R5対R6は、右目領域EA(r)の幅We(r)対、左目領域EA(l)の幅We(l)と同じとされる。一般に、顔の画像の向きが右振りの場合には、右目領域EA(r)の幅We(r)は、左目領域EA(l)の幅We(l)より大きいため、R5の値はR6の値より大きくなる。従って、右振りの場合には、決定顔領域FAsの幅方向に沿った中心位置は、中点BPの位置よりも向かって左側にずれることとなる。これにより、正面向きの顔の画像と比較して人物の顔の右側面の部分を表す領域が大きくなる傾向にある右振りの顔の画像において、適切な位置に決定顔領域FAsを設定することが可能となる。   Further, the position of the determined face area FAs is determined based on the midpoint BP of the line segment CL that connects the center points Ce (r) and Ce (l). That is, the position of the determined face area FAs is divided into a straight line that divides the determined face area FAs along the width direction at a predetermined ratio R5 to R6 and a determined face area FAs along the height direction at a predetermined ratio R3 to R4. The intersection point RP with the straight line to be overlapped with the midpoint BP of the line segment CL. Here, the predetermined ratio R5 to R6 is the same as the width We (r) of the right eye area EA (r) and the width We (l) of the left eye area EA (l). In general, when the orientation of the face image is right-handed, the width We (r) of the right eye area EA (r) is larger than the width We (l) of the left eye area EA (l). Larger than the value of. Therefore, in the case of turning right, the center position along the width direction of the determined face area FAs is shifted to the left side with respect to the position of the midpoint BP. Thus, the determined face area FAs is set at an appropriate position in the right-faced face image in which the area representing the right side portion of the person's face tends to be larger than the face-oriented face image. Is possible.

決定顔領域FAsの傾きは、検出顔領域FAdと同じ傾きであるとされる。以上のようにして決定された大きさ、位置、傾きを有する領域が、決定顔領域FAsとして設定される。推定された顔の画像の向きが右振りである場合には、決定顔領域FAsは、検出顔領域FAdと比較して、実際の顔の画像との間のずれが抑制されると共に、顔の画像が正面向きではないことに起因するずれも抑制された領域となる。なお、推定された顔の画像の向きが左振りである場合の決定顔領域FAsの設定方法は、左右が逆になるものの、顔の画像の向きが右振りである場合の設定方法と同様である。   The inclination of the determined face area FAs is the same as that of the detected face area FAd. An area having the size, position, and inclination determined as described above is set as the determined face area FAs. When the estimated orientation of the face image is right-handed, the determined face area FAs is less misaligned with the actual face image than the detected face area FAd. This is a region in which the shift due to the image not being front-facing is also suppressed. Note that the method of setting the determined face area FAs when the estimated face image orientation is left-handed is the same as the setting method when the face image orientation is right-handed although the left and right are reversed. is there.

図23は、推定された顔の画像の向きが上振りである場合の決定顔領域FAsの設定方法を示す説明図である。図23に示すように、矩形の決定顔領域FAsの大きさ(幅および高さ)は、参照幅Wrおよび参照高さHrに基づき決定される。すなわち、決定顔領域FAsの幅は、図21に示した正面向きの場合と同様に、参照幅Wrに所定の係数c1を乗じた値とされる。また、決定顔領域FAsの高さは、参照高さHrに所定の係数c2を乗じ、さらに係数βを乗じた値とされる。ここで、係数βは、判定指標DI(参照幅Wrに対する参照高さHrの比)に対する標準判定指標DIsの比である。標準判定指標DIsは、標準的な正面向きの顔の画像の判定指標DIの値として予め設定された値である。一般に、顔の画像の向きが上振りの場合には、正面向きの場合と比較して、判定指標DIの値は小さいため、係数βは1より大きな値となる。従って、上振りの場合において決定顔領域FAsの高さの算出のために参照高さHrに乗じられる係数(β・c2)は、正面向きの場合(図21参照)において参照高さHrに乗じられる係数(c2)と比較して、より大きい。これにより、正面向きの顔の画像と比較して参照高さHrが小さくなる傾向にある上振りの顔の画像において、適切な高さの領域を決定顔領域FAsとして設定することが可能となる。   FIG. 23 is an explanatory diagram showing a method for setting the determined face area FAs when the estimated orientation of the face image is upward. As shown in FIG. 23, the size (width and height) of the rectangular determined face area FAs is determined based on the reference width Wr and the reference height Hr. That is, the width of the determined face area FAs is set to a value obtained by multiplying the reference width Wr by the predetermined coefficient c1 as in the case of the front direction shown in FIG. The height of the determined face area FAs is a value obtained by multiplying the reference height Hr by a predetermined coefficient c2 and further by a coefficient β. Here, the coefficient β is a ratio of the standard determination index DIs to the determination index DI (ratio of the reference height Hr to the reference width Wr). The standard determination index DIs is a value set in advance as the value of the determination index DI of a standard front-facing face image. Generally, when the orientation of the face image is upward, the value of the determination index DI is smaller than in the case of facing the front, so the coefficient β is a value greater than 1. Therefore, the coefficient (β · c2) to be multiplied by the reference height Hr for calculating the height of the determined face area FAs in the case of the upward swing is multiplied by the reference height Hr in the case of facing the front (see FIG. 21). Greater than the coefficient (c2) obtained. Accordingly, it is possible to set an area having an appropriate height as the determined face area FAs in the upward face image in which the reference height Hr tends to be smaller than the face image facing the front. .

また、決定顔領域FAsの位置は、中心点Ce(r)とCe(l)とを結ぶ線分CLの中点BPに基づき決定される。すなわち、決定顔領域FAsの位置は、決定顔領域FAsを幅方向に沿って所定の比R1対R2で分割する直線と決定顔領域FAsを高さ方向に沿って所定の比R7対R8で分割する直線との交点RPが、線分CLの中点BPに重なるような位置とされる。なお、本実施例では、所定の比R1対R2は、1対1である。   Further, the position of the determined face area FAs is determined based on the midpoint BP of the line segment CL that connects the center points Ce (r) and Ce (l). That is, the position of the determined face area FAs is divided into a straight line that divides the determined face area FAs along the width direction at a predetermined ratio R1 to R2 and a determined face area FAs along the height direction at a predetermined ratio R7 to R8. The intersection point RP with the straight line to be overlapped with the midpoint BP of the line segment CL. In the present embodiment, the predetermined ratio R1 to R2 is 1: 1.

決定顔領域FAsの傾きは、検出顔領域FAdと同じ傾きであるとされる。以上のようにして決定された大きさ、位置、傾きを有する領域が、決定顔領域FAsとして設定される。推定された顔の画像の向きが上振りである場合にも、決定顔領域FAsは、検出顔領域FAdと比較して、実際の顔の画像との間のずれが抑制されると共に、顔の画像が正面向きではないことに起因するずれも抑制された領域となる。   The inclination of the determined face area FAs is the same as that of the detected face area FAd. An area having the size, position, and inclination determined as described above is set as the determined face area FAs. Even when the estimated orientation of the face image is upward, the determined face area FAs is suppressed from being shifted from the actual face image as compared to the detected face area FAd. This is a region in which the shift due to the image not being front-facing is also suppressed.

図24は、推定された顔の画像の向きが下振りである場合の決定顔領域FAsの設定方法を示す説明図である。図24に示すように、矩形の決定顔領域FAsの大きさ(幅および高さ)は、参照幅Wrおよび参照高さHrに基づき決定される。すなわち、決定顔領域FAsの幅は、図21に示した正面向きの場合と同様に、参照幅Wrに所定の係数c1を乗じた値とされる。また、決定顔領域FAsの高さは、図23に示した上振りの場合と同様に、参照高さHrに所定の係数c2を乗じ、さらに係数βを乗じた値とされる。顔の画像の向きが下振りの場合にも、上振りの場合と同様に、正面向きの場合と比較して、判定指標DIの値は小さいため、係数βは1より大きな値となる。そのため、決定顔領域FAsの高さの算出のために参照高さHrに乗じられる係数(β・c2)は、正面向きの場合(図21参照)において参照高さHrに乗じられる係数(c2)と比較して、より大きい。これにより、正面向きの顔の画像と比較して参照高さHrが小さくなる傾向にある下振りの顔の画像において、適切な高さの領域を決定顔領域FAsとして設定することが可能となる。   FIG. 24 is an explanatory diagram illustrating a method of setting the determined face area FAs when the estimated face image orientation is downward. As shown in FIG. 24, the size (width and height) of the rectangular determined face area FAs is determined based on the reference width Wr and the reference height Hr. That is, the width of the determined face area FAs is set to a value obtained by multiplying the reference width Wr by the predetermined coefficient c1 as in the case of the front direction shown in FIG. Further, the height of the determined face area FAs is set to a value obtained by multiplying the reference height Hr by a predetermined coefficient c2 and further multiplying by the coefficient β, as in the case of the upward swing shown in FIG. When the face image is in the downward direction, the coefficient β is larger than 1 because the value of the determination index DI is smaller than in the case of the upward direction, as in the case of the upward direction. Therefore, the coefficient (β · c2) to be multiplied by the reference height Hr for calculating the height of the determined face area FAs is the coefficient (c2) to be multiplied by the reference height Hr when facing the front (see FIG. 21). Larger than Accordingly, it is possible to set an area having an appropriate height as the determined face area FAs in the downward face image in which the reference height Hr tends to be smaller than the face image facing the front. .

また、決定顔領域FAsの位置は、中心点Ce(r)とCe(l)とを結ぶ線分CLの中点BPに基づき決定される。すなわち、決定顔領域FAsの位置は、決定顔領域FAsを幅方向に沿って所定の比R1対R2で分割する直線と決定顔領域FAsを高さ方向に沿って所定の比R9対R10で分割する直線との交点RPが、線分CLの中点BPに重なるような位置とされる。なお、本実施例では、所定の比R1対R2は、1対1である。   Further, the position of the determined face area FAs is determined based on the midpoint BP of the line segment CL that connects the center points Ce (r) and Ce (l). That is, the position of the determined face area FAs is divided into a straight line that divides the determined face area FAs in the width direction at a predetermined ratio R1 to R2, and the determined face area FAs is divided in a predetermined ratio R9 to R10 along the height direction. The intersection point RP with the straight line to be overlapped with the midpoint BP of the line segment CL. In the present embodiment, the predetermined ratio R1 to R2 is 1: 1.

決定顔領域FAsの傾きは、検出顔領域FAdと同じ傾きであるとされる。以上のようにして決定された大きさ、位置、傾きを有する領域が、決定顔領域FAsとして設定される。推定された顔の画像の向きが下振りである場合にも、決定顔領域FAsは、検出顔領域FAdと比較して、実際の顔の画像との間のずれが抑制されると共に、顔の画像が正面向きではないことに起因するずれも抑制された領域となる。   The inclination of the determined face area FAs is the same as that of the detected face area FAd. An area having the size, position, and inclination determined as described above is set as the determined face area FAs. Even when the estimated orientation of the face image is downward, the determined face area FAs is less misaligned with the actual face image as compared to the detected face area FAd. This is a region in which the shift due to the image not being front-facing is also suppressed.

ステップS680(図20)では、補正処理部290(図1)が、ステップS660で設定された決定顔領域FAsに基づき補正領域を設定し、補正領域を対象として顔補正を実行する。上述したように、本実施例の顔補正は、顔の肌部分の画像の色を好ましい色に変更する肌色補正である。   In step S680 (FIG. 20), the correction processing unit 290 (FIG. 1) sets a correction area based on the determined face area FAs set in step S660, and performs face correction on the correction area. As described above, the face correction of this embodiment is a skin color correction that changes the color of the image of the skin part of the face to a preferable color.

設定される補正領域は、決定顔領域FAsそのものであってもよいし、決定顔領域FAsを所定の倍率で拡大または縮小した領域であってもよい。決定顔領域FAsは、検出顔領域FAdと比較して、実際の顔の画像との間のずれが抑制された領域となっているため、決定顔領域FAsに基づき設定される補正領域についても、実際の顔の画像との間のずれを抑制可能である。また、顔補正は、例えば、補正領域から肌色の画素を抽出し、抽出された画素の色を調整することにより実行される。   The correction area to be set may be the determined face area FAs itself, or may be an area obtained by enlarging or reducing the determined face area FAs at a predetermined magnification. Since the determined face area FAs is an area in which the deviation from the actual face image is suppressed compared to the detected face area FAd, the correction area set based on the determined face area FAs Deviation from the actual face image can be suppressed. The face correction is executed by, for example, extracting a skin color pixel from the correction area and adjusting the color of the extracted pixel.

ステップS800(図20)では、第1実施例と同様に、顔補正印刷部202が、補正後の対象画像TIの印刷を印刷処理部320に指示し、印刷処理部320は、プリンタエンジン160を制御して、対象画像TIの印刷を行う。   In step S800 (FIG. 20), as in the first embodiment, the face correction printing unit 202 instructs the print processing unit 320 to print the corrected target image TI, and the print processing unit 320 causes the printer engine 160 to operate. The target image TI is printed under control.

以上説明したように、第2実施例のプリンタ100aは、器官領域を検出すると共に、検出された器官領域に基づき、推定された顔の画像の向きに応じた方法で、対象画像TIにおける顔の画像を含む決定顔領域FAsを設定することができる。そのため、第2実施例のプリンタ100aは、決定顔領域FAsを、実際の顔の画像との間のずれが抑制された領域として設定することができる。また、第2実施例のプリンタ100aは、決定顔領域FAsに基づき補正領域を設定し、設定された補正領域を対象として顔補正を実行するため、より適正な領域を対象として顔補正処理を実行することができ、補正後の画像を好ましい画像とすることができる。   As described above, the printer 100a according to the second embodiment detects the organ area and uses the method according to the estimated orientation of the face image based on the detected organ area to detect the face area in the target image TI. A decision face area FAs including an image can be set. Therefore, the printer 100a according to the second embodiment can set the determined face area FAs as an area in which a deviation from an actual face image is suppressed. Further, the printer 100a according to the second embodiment sets a correction area based on the determined face area FAs, and performs face correction on the set correction area, so that the face correction process is executed on a more appropriate area. Therefore, the corrected image can be a preferable image.

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

C1.変形例1:
上記各実施例における顔向き推定(図2および図20のステップS600)の方法は、あくまで一例であり、他の方法により顔向き推定が行われるとしてもよい。例えば、単純に右目領域EA(r)および左目領域EA(l)の幅Weを比較して、右目領域EA(r)の幅Weの方が所定割合以上で大きい場合には右振りであると、左目領域EA(l)の幅Weの方が所定割合以上で大きい場合には左振りであると、それ以外の場合には正面向きであると、推定されるとしてもよい。
C1. Modification 1:
The method of face orientation estimation (step S600 in FIGS. 2 and 20) in each of the above embodiments is merely an example, and face orientation estimation may be performed by other methods. For example, when the width We of the right eye area EA (r) and the left eye area EA (l) is simply compared, and the width We of the right eye area EA (r) is greater than a predetermined ratio, the right-hand area is The left-eye area EA (l) may be estimated to be left-handed when the width We is greater than a predetermined ratio, and to be front-facing in other cases.

あるいは、単純に口領域MAの幅Wmと目領域EAの幅Weとを比較して、口領域MAの幅Wmの方が所定割合以上で大きい場合には上振りであると、目領域EAの幅Weの方が所定割合以上で大きい場合には下振りであると、それ以外の場合には正面向きであると、推定されるとしてもよい。   Alternatively, the width Wm of the mouth area MA and the width We of the eye area EA are simply compared. If the width Wm of the mouth area MA is larger than a predetermined ratio, If the width We is larger than a predetermined ratio, it may be estimated that the swing is downward, and that the width We is facing the front in other cases.

また、検出顔領域FAdと器官領域との関係に基づいて顔向き推定が行われるとしてもよい。例えば、検出顔領域FAdにおける目領域EAの位置に基づき、右振りまたは左振りであると推定されるとしてもよいし、検出顔領域FAdにおける口領域MAの位置に基づき、上振りまたは下振りであると推定されるとしてもよい。   Further, the face orientation may be estimated based on the relationship between the detected face area FAd and the organ area. For example, based on the position of the eye area EA in the detected face area FAd, it may be estimated that the camera is swung to the right or left, or based on the position of the mouth area MA in the detected face area FAd, It may be estimated that there is.

また、上記各実施例における顔向き推定では、推定される顔の画像の向きの種類として、正面向き、左右振り、上下振りの3種類、あるいは、正面向き、右振り、左振り、上振り、下振りの5種類が採用されているが、顔の画像の向きの種類として、正面向きか正面以外向きかの2種類が採用されるとしてもよい。また、顔の画像の向きの種類として、正面向き、弱い右振り、中程度の右振り、強い右振り、弱い左振り、中程度の左振り、強い左振り・・・のように、より細分化された顔の画像の向きの種類が採用されるとしてもよい。   Further, in the face orientation estimation in each of the above embodiments, the types of orientation of the estimated face image are three types of front orientation, left / right swing, and up / down swing, or front orientation, right swing, left swing, up swing, Five types of downward swing are employed, but two types of orientation of the face image may be employed, that is, the front direction or the direction other than the front direction. Also, the types of face image orientation are more subdivided, such as front, weak right, medium right, strong right, weak left, medium left, strong left, and so on. The type of orientation of the converted face image may be employed.

C2.変形例2:
上記各実施例では、顔の器官として、右目と左目と口とが設定されており、器官領域として、右目領域EA(r)と左目領域EA(l)と口領域MAとの検出が行われるが、顔の器官として顔のどの器官を設定するかは変更可能である。例えば、顔の器官として、右目と左目のみが設定され、器官領域として、右目領域EA(r)と左目領域EA(l)との検出が行われるとしてもよい。また、顔の器官として、口のみが設定され、器官領域として、口領域MAの検出が行われるとしてもよい。また、顔の器官として、右目と左目と口とに加えて、または右目と左目と口との少なくとも1つの代わりに、顔のその他の器官(例えば鼻や眉)が設定され、器官領域としてこのような器官の画像を含む領域が検出されるとしてもよい。
C2. Modification 2:
In each of the above embodiments, the right eye, the left eye, and the mouth are set as the facial organs, and the right eye area EA (r), the left eye area EA (l), and the mouth area MA are detected as the organ areas. However, it is possible to change which organ of the face is set as the facial organ. For example, only the right eye and the left eye may be set as facial organs, and the right eye area EA (r) and the left eye area EA (l) may be detected as organ areas. Alternatively, only the mouth may be set as the facial organ, and the mouth area MA may be detected as the organ area. In addition to the right eye, the left eye, and the mouth, or in place of at least one of the right eye, the left eye, and the mouth, other organs of the face (for example, the nose and eyebrows) are set as the organs of the face. A region including an image of such an organ may be detected.

C3.変形例3:
上記第1実施例では、推定された顔の画像の向きが変形処理実行可否の判定(図2のステップS620)に用いられているが、顔の画像の向きは他の画像処理(例えば正面向きの顔の画像を対象とした他の画像処理)の実行可否の判定にも利用可能である。
C3. Modification 3:
In the first embodiment, the estimated orientation of the face image is used for determining whether or not the deformation process can be performed (step S620 in FIG. 2). It is also possible to determine whether or not to execute other image processing on the face image of (2).

また、上記第1実施例における変形処理実行可否の判定に用いられる条件はあくまで一例であり、他の条件が用いられるとしてもよい。例えば、推定された顔の画像の向きが正面向きである場合に加え、上下振りである場合にも、変形処理実行可と判定されるとしてもよい。本実施例の変形処理は、特に左右振りの画像を対象とした場合に結果が不自然なものとなると考えられるため、このように判定が行われてもよい。   In addition, the condition used for determining whether or not the deformation process can be performed in the first embodiment is merely an example, and other conditions may be used. For example, in addition to the case where the estimated orientation of the face image is the front direction, it may be determined that the deformation process can be executed even when the face is swung up and down. Since the deformation process according to the present embodiment is considered to have an unnatural result, particularly when a left-right image is targeted, the determination may be performed in this way.

また、本発明は、変形処理とは異なる所定の画像処理の実行可否判定に適用可能であり、当該画像処理の特性に応じて、画像処理実行可否判定に用いる条件は適宜設定される。すなわち、画像処理の特性によっては、推定された顔の画像の向きが正面向きである場合には処理実行不可であると判定されるような判定条件が採用される場合もある。あるいは、推定された顔の画像の向きが左右振りである場合にのみ処理実行可であると判定され、その他の場合には処理実行不可であると判定されるような判定条件が採用される場合もある。   Further, the present invention can be applied to the determination of whether or not to execute predetermined image processing different from the deformation processing, and the conditions used for the determination of whether or not to execute image processing are appropriately set according to the characteristics of the image processing. In other words, depending on the characteristics of the image processing, a determination condition may be adopted in which it is determined that the process cannot be executed when the estimated face image orientation is the front direction. Alternatively, a determination condition is adopted in which it is determined that the process can be executed only when the estimated orientation of the face image is left and right, and in other cases, the process is determined not to be executable. There is also.

C4.変形例4:
上記第2実施例における決定顔領域FAsの傾き、大きさ、位置の特定方法は、あくまで一例であり、決定顔領域FAsの傾き、大きさ、位置を他の方法を用いて特定してもよい。例えば、上記第2実施例では、顔の画像の向きがいずれの場合にも、決定顔領域FAsの傾きを検出顔領域FAdの傾きと同じであるとして特定しているが、決定顔領域FAsの傾きをいずれかの器官領域の傾きと同じであるとして特定するとしてもよい。
C4. Modification 4:
The method for specifying the inclination, size, and position of the determined face area FAs in the second embodiment is merely an example, and the inclination, size, and position of the determined face area FAs may be specified using other methods. . For example, in the second embodiment, the inclination of the determined face area FAs is specified to be the same as the inclination of the detected face area FAd regardless of the orientation of the face image. The inclination may be specified as being the same as the inclination of any organ region.

また、上記第2実施例では、決定顔領域FAsの設定の際に、器官領域に基づき特定された大きさと位置とを有する領域を決定顔領域FAsとして設定しているが、器官領域に基づき決定顔領域FAsの大きさと位置とのいずれか1つのみが特定されるとしてもよい。この場合には、特定されなかった決定顔領域FAsの大きさ、位置については、検出顔領域FAdの大きさ、位置が採用されるとしてもよいし、所定の値が採用されるとしてもよい。   In the second embodiment, when the determined face area FAs is set, an area having the size and position specified based on the organ area is set as the determined face area FAs. However, the determined face area FAs is determined based on the organ area. Only one of the size and position of the face area FAs may be specified. In this case, as the size and position of the determined face area FAs that has not been specified, the size and position of the detected face area FAd may be employed, or a predetermined value may be employed.

また、上記第2実施例では、推定された顔の画像の向きに応じた方法で、決定顔領域FAsが設定されるとしているが、例えば、正面向きと推定された場合には、検出顔領域FAdそのものが決定顔領域FAsとして設定されるとしてもよい。   In the second embodiment, the determined face area FAs is set by a method according to the estimated orientation of the face image. For example, when it is estimated that the front face is detected, the detected face area is detected. The FAd itself may be set as the determined face area FAs.

C5.変形例5:
上記各実施例において推定された顔の画像の向きは、他の用途にも利用可能である。例えば、推定された顔の画像の向きが、画像データを含む画像ファイルの付属情報として画像データと関連づけられるとしてもよい。このようにすれば、例えば、推定された顔の画像の向きを、画像の検索に利用することができる。
C5. Modification 5:
The orientation of the face image estimated in each of the embodiments can be used for other purposes. For example, the estimated orientation of the face image may be associated with the image data as the attached information of the image file including the image data. In this way, for example, the estimated orientation of the face image can be used for image search.

C6.変形例6:
上記各実施例では、検出顔領域FAdを対象として器官検出が行われているが、必ずしも器官検出を行う範囲が検出顔領域FAdに限られる必要はなく、例えば、対象画像TI全体を対象として器官検出が行われるとしてもよい。ただし、検出顔領域FAdを対象として器官検出を行えば、処理の高速化を図ることができる。
C6. Modification 6:
In each of the embodiments described above, organ detection is performed on the detected face area FAd. However, the range in which the organ detection is performed is not necessarily limited to the detected face area FAd. For example, the organ is detected on the entire target image TI. Detection may be performed. However, if organ detection is performed on the detected face area FAd, the processing speed can be increased.

また、上記各実施例では、顔領域FA(検出顔領域FAd)の検出が行われているが、必ずしも顔領域FAの検出が行われる必要はない。顔領域FAの検出が行われない場合であっても、対象画像TIの所定の範囲(例えば全体)を対象として器官領域の検出を行い、検出された器官領域に基づき、顔の画像の向きの推定や決定顔領域FAsの設定を実行可能である。   In each of the above embodiments, the face area FA (detected face area FAd) is detected, but the face area FA need not necessarily be detected. Even when the face area FA is not detected, the organ area is detected for a predetermined range (for example, the whole) of the target image TI, and the orientation of the face image is determined based on the detected organ area. It is possible to perform estimation and setting of the determined face area FAs.

C7.変形例7:
上記各実施例では、検出された各器官領域について設定される信頼度指標としてマッチ回数が用いられているが、信頼度指標として他の指標(例えばテンプレートとのマッチ率)が用いられるとしてもよい。また、器官領域の検出の際に、必ずしも信頼度指標が設定される必要はない。器官領域について信頼度指標が設定されない場合には、器官領域の検出に成功したか否かを判定する際に、信頼度指標は用いられない。ただし、器官領域について信頼度指標が設定され、信頼度指標の値が所定の閾値より大きい器官領域のみに基づき決定顔領域FAsが設定されるとした場合には、顔の画像の向きの推定精度や決定顔領域FAsの設定精度の低下を抑制することができる。
C7. Modification 7:
In each of the above embodiments, the number of matches is used as a reliability index set for each detected organ region, but another index (for example, a match rate with a template) may be used as the reliability index. . Further, it is not always necessary to set the reliability index when detecting the organ region. When the reliability index is not set for the organ area, the reliability index is not used when determining whether or not the detection of the organ area is successful. However, when the reliability index is set for the organ area and the determined face area FAs is set based only on the organ area whose reliability index value is larger than a predetermined threshold, the estimation accuracy of the orientation of the face image And a decrease in the setting accuracy of the determined face area FAs can be suppressed.

C8.変形例8:
上記各実施例では、器官領域の検出に成功したと判定される条件として、右目領域EA(r)と左目領域EA(l)と口領域MAとの3つの器官領域がすべて検出されることが課せられているが、必ずしもこのような条件が課せられる必要はない。少なくとも顔の画像の向きの推定や決定顔領域FAsの設定に必要な器官領域が検出されれば、器官領域の検出に成功したと判定されるとしてもよい。
C8. Modification 8:
In each of the embodiments described above, as a condition for determining that the detection of the organ area has succeeded, all three organ areas of the right eye area EA (r), the left eye area EA (l), and the mouth area MA are detected. Although it is imposed, such a condition does not necessarily have to be imposed. It may be determined that the detection of the organ area is successful if at least an organ area necessary for estimating the orientation of the face image and setting the determined face area FAs is detected.

また、上記各実施例では、器官領域の検出に成功したと判定される条件として、すべての器官領域について信頼度指標の表す確からしさが所定の閾値より大きいことが課せられているが、必ずしもこのような条件が課せられる必要はない。信頼度指標が閾値より小さい器官領域があった場合であっても器官領域の検出に成功したと判定し、信頼度指標が閾値より大きい器官領域のみを用いて決定顔領域FAsを設定するとしてもよい。   Further, in each of the above embodiments, as a condition for determining that the detection of the organ region is successful, it is required that the probability represented by the reliability index is larger than a predetermined threshold for all the organ regions. There is no need to impose such conditions. Even if there is an organ region whose reliability index is smaller than the threshold value, it is determined that the detection of the organ region is successful, and the determined face region FAs is set using only the organ region whose reliability index is larger than the threshold value. Good.

C9.変形例9:
上記各実施例では、顔領域FAおよび器官領域は矩形の領域であるが、顔領域FAおよび器官領域は矩形以外の形状の領域であってもよい。
C9. Modification 9:
In each of the above embodiments, the face area FA and the organ area are rectangular areas, but the face area FA and the organ area may be areas having a shape other than a rectangle.

C10.変形例10:
上記各実施例では、画像処理装置としてのプリンタ100による顔形状補正印刷処理(図2)や顔補正印刷処理(図20)を説明したが、処理の一部(例えば図2のステップS100からS700まで)がパーソナルコンピュータにより実行されるものとしてもよい。また、プリンタ100はインクジェットプリンタに限らず、他の方式のプリンタ、例えばレーザプリンタや昇華型プリンタであるとしてもよい。また、本発明は、顔の画像の向きの推定のための画像処理一般に適用可能であり、例えば、パーソナルコンピュータによる顔の画像の向きの推定のみが行われる処理にも適用可能である。
C10. Modification 10:
In each of the embodiments described above, the face shape correction printing process (FIG. 2) and the face correction printing process (FIG. 20) by the printer 100 as the image processing apparatus have been described, but a part of the processing (for example, steps S100 to S700 in FIG. 2). May be executed by a personal computer. The printer 100 is not limited to an ink jet printer, and may be another type of printer, such as a laser printer or a sublimation printer. The present invention is generally applicable to image processing for estimating the orientation of a face image. For example, the present invention can also be applied to processing in which only the orientation of a face image is estimated by a personal computer.

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

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

本発明の第1実施例における画像処理装置としてのプリンタ100の構成を概略的に示す説明図である。1 is an explanatory diagram schematically showing the configuration of a printer 100 as an image processing apparatus in a first embodiment of the present invention. FIG. 顔形状補正印刷処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a face shape correction | amendment printing process. 対象画像TIの設定のためのユーザインターフェースの一例を示す説明図である。It is explanatory drawing which shows an example of the user interface for the setting of the target image TI. 検出顔領域FAdの検出結果の一例を示す説明図である。It is explanatory drawing which shows an example of the detection result of detection face area | region FAd. 器官領域の検出結果の一例を示す説明図である。It is explanatory drawing which shows an example of the detection result of an organ area | region. 顔向き推定の方法を示す説明図である。It is explanatory drawing which shows the method of face direction estimation. 顔向き推定において正面向きと推定された結果の一例を示す説明図である。It is explanatory drawing which shows an example of the result estimated as the front direction in face direction estimation. 顔向き推定において右振りまたは左振りと推定された結果の一例を示す説明図である。It is explanatory drawing which shows an example of the result estimated to be right swing or left swing in face direction estimation. 顔向き推定において上振りまたは下振りと推定された結果の一例を示す説明図である。It is explanatory drawing which shows an example of the result estimated to be a swing or a downward swing in face direction estimation. 変形処理後の対象画像TIの一例を示す説明図である。It is explanatory drawing which shows an example of the target image TI after a deformation | transformation process. 変形処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a deformation | transformation process. 変形領域TAの設定方法の一例を示す説明図である。It is explanatory drawing which shows an example of the setting method of deformation | transformation area | region TA. 変形領域TAの小領域への分割方法の一例を示す説明図である。It is explanatory drawing which shows an example of the division | segmentation method to the small area | region of deformation | transformation area | region TA. 分割点移動テーブル420の内容の一例を示す説明図である。It is explanatory drawing which shows an example of the content of the dividing point movement table. 分割点移動テーブル420に従った分割点Dの位置の移動の一例を示す説明図である。It is explanatory drawing which shows an example of the movement of the position of the dividing point D according to the dividing point movement table. 分割領域変形部260による画像の変形処理方法の概念を示す説明図である。6 is an explanatory diagram showing a concept of an image deformation processing method performed by a divided region deformation unit 260. FIG. 三角形領域における画像の変形処理方法の概念を示す説明図である。It is explanatory drawing which shows the concept of the deformation | transformation processing method of the image in a triangular area | region. 本実施例における顔形状補正の態様を示す説明図である。It is explanatory drawing which shows the aspect of the face shape correction | amendment in a present Example. 本発明の第2実施例における画像処理装置としてのプリンタ100aの構成を概略的に示す説明図である。It is explanatory drawing which shows roughly the structure of the printer 100a as an image processing apparatus in 2nd Example of this invention. 顔補正印刷処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a face correction printing process. 推定された顔の画像の向きが正面向きである場合の決定顔領域FAsの設定方法を示す説明図である。It is explanatory drawing which shows the setting method of the determination face area | region FAs in case the direction of the estimated face image is a front direction. 推定された顔の画像の向きが右振りである場合の決定顔領域FAsの設定方法を示す説明図である。It is explanatory drawing which shows the setting method of the determination face area | region FAs when the direction of the estimated face image is right-handed. 推定された顔の画像の向きが上振りである場合の決定顔領域FAsの設定方法を示す説明図である。It is explanatory drawing which shows the setting method of the determination face area | region FAs when the direction of the estimated face image is upward. 推定された顔の画像の向きが下振りである場合の決定顔領域FAsの設定方法を示す説明図である。It is explanatory drawing which shows the setting method of the determination face area | region FAs when the direction of the estimated face image is downward.

符号の説明Explanation of symbols

100…プリンタ
110…CPU
120…内部メモリ
140…操作部
150…表示部
160…プリンタエンジン
170…カードインターフェース
172…カードスロット
200…顔形状補正印刷部
202…顔補正印刷部
210…顔領域検出部
220…器官領域検出部
222…信頼度設定部
230…顔向き推定部
240…変形領域設定部
250…変形領域分割部
260…分割領域変形部
270…処理可否判定部
280…顔領域設定部
290…補正処理部
310…表示処理部
320…印刷処理部
410…分割点配置パターンテーブル
420…分割点移動テーブル
100 ... Printer 110 ... CPU
DESCRIPTION OF SYMBOLS 120 ... Internal memory 140 ... Operation part 150 ... Display part 160 ... Printer engine 170 ... Card interface 172 ... Card slot 200 ... Face shape correction printing part 202 ... Face correction printing part 210 ... Face area detection part 220 ... Organ area detection part 222 ... reliability setting section 230 ... face orientation estimation section 240 ... deformation area setting section 250 ... deformation area division section 260 ... divided area deformation section 270 ... processability determination section 280 ... face area setting section 290 ... correction processing section 310 ... display processing Section 320 ... Print processing section 410 ... Division point arrangement pattern table 420 ... Division point movement table

Claims (19)

画像処理装置であって、
対象画像における顔の器官の画像を含む領域を器官領域として検出する器官領域検出部と、
検出された前記器官領域に基づき、前記対象画像における顔の画像の向きを推定する顔向き推定部と、を備える、画像処理装置。
An image processing apparatus,
An organ region detection unit that detects a region including an image of a facial organ in the target image as an organ region;
An image processing apparatus comprising: a face orientation estimating unit that estimates the orientation of a face image in the target image based on the detected organ region.
請求項1に記載の画像処理装置であって、
前記器官領域検出部は、複数の前記器官領域を検出し、
前記顔向き推定部は、検出された前記器官領域間の位置と大きさとの少なくとも一方に関する関係に基づき、前記対象画像における顔の画像の向きを推定する、画像処理装置。
The image processing apparatus according to claim 1,
The organ region detector detects a plurality of the organ regions,
The face orientation estimating unit estimates an orientation of a face image in the target image based on a relationship related to at least one of a position and a size between the detected organ regions.
請求項1または請求項2に記載の画像処理装置であって、
前記顔向き推定部は、検出された前記器官領域に基づき、顔の画像の幅に相関のある指標としての参照幅と顔の画像の高さに相関のある指標としての参照高さとを算出し、前記参照幅と前記参照高さとの比に基づき、前記対象画像における顔の画像の向きを推定する、画像処理装置。
The image processing apparatus according to claim 1 or 2,
The face orientation estimation unit calculates a reference width as an index correlated with the width of the face image and a reference height as an index correlated with the height of the face image based on the detected organ region. An image processing device that estimates a face image orientation in the target image based on a ratio between the reference width and the reference height.
請求項3に記載の画像処理装置であって、
前記顔向き推定部は、前記参照幅と前記参照高さとの比に基づき、前記対象画像における顔の画像の正面向きからの振りの程度を推定する、画像処理装置。
The image processing apparatus according to claim 3,
The face direction estimation unit is an image processing device that estimates a degree of a swing of a face image from a front direction in the target image based on a ratio between the reference width and the reference height.
請求項3または請求項4に記載の画像処理装置であって、
前記器官領域検出部は、少なくとも、前記顔の器官としての右目の画像を含む右目領域と、前記顔の器官としての左目の画像を含む左目領域と、前記顔の器官としての口の画像を含む口領域と、を、前記器官領域として検出する、画像処理装置。
The image processing apparatus according to claim 3 or 4, wherein:
The organ region detection unit includes at least a right eye region including an image of the right eye as the facial organ, a left eye region including an image of the left eye as the facial organ, and an image of the mouth as the facial organ. An image processing apparatus for detecting a mouth region as the organ region.
請求項5に記載の画像処理装置であって、
前記顔向き推定部は、前記右目領域と前記左目領域とに基づき前記参照幅を算出し、前記右目領域と前記左目領域との少なくとも一方と前記口領域とに基づき前記参照高さを算出する、画像処理装置。
The image processing apparatus according to claim 5,
The face direction estimating unit calculates the reference width based on the right eye region and the left eye region, and calculates the reference height based on at least one of the right eye region and the left eye region and the mouth region; Image processing device.
請求項1ないし請求項6のいずれかに記載の画像処理装置であって、さらに、
前記対象画像における顔の画像を含む領域を検出顔領域として検出する顔領域検出部を備え、
前記顔向き推定部は、検出された前記器官領域と前記検出顔領域とに基づき、前記対象画像における顔の画像の向きを推定する、画像処理装置。
The image processing apparatus according to any one of claims 1 to 6, further comprising:
A face area detection unit that detects an area including a face image in the target image as a detection face area;
The face orientation estimation unit is an image processing device that estimates the orientation of a face image in the target image based on the detected organ region and the detected face region.
請求項1ないし請求項7のいずれかに記載の画像処理装置であって、さらに、
前記対象画像における顔の画像を含む所定の領域を対象に、所定の画像処理を行う画像処理部と、
推定された前記対象画像における顔の画像の向きに基づき、前記画像処理の実行可否を判定する処理可否判定部と、を備える、画像処理装置。
The image processing apparatus according to claim 1, further comprising:
An image processing unit that performs predetermined image processing on a predetermined region including a face image in the target image;
An image processing apparatus comprising: a process availability determination unit that determines whether the image processing can be performed based on the estimated orientation of the face image in the target image.
請求項8に記載の画像処理装置であって、
前記所定の画像処理は、画像の変形処理を含み、
前記処理可否判定部は、推定された前記対象画像における顔の画像の向きが正面向きでない場合には、前記画像処理の実行は不可であると判定する、画像処理装置。
The image processing apparatus according to claim 8,
The predetermined image processing includes image deformation processing,
The processing availability determination unit determines that the execution of the image processing is impossible when the orientation of the face image in the estimated target image is not front-facing.
請求項1ないし請求項7のいずれかに記載の画像処理装置であって、さらに、
検出された前記器官領域に基づき、推定された前記対象画像における顔の画像の向きに応じた所定の方法で、前記対象画像における顔の画像を含む顔領域を設定する顔領域設定部を備える、画像処理装置。
The image processing apparatus according to claim 1, further comprising:
A face area setting unit configured to set a face area including a face image in the target image by a predetermined method according to the estimated orientation of the face image in the target image based on the detected organ area; Image processing device.
請求項10に記載の画像処理装置であって、
前記顔領域設定部は、推定された前記対象画像における顔の画像の向きに応じて予め定められた前記器官領域との間の関係に基づき、前記顔領域の大きさと位置と傾きとの少なくとも1つを特定し、前記特定された大きさと位置と傾きとの少なくとも1つを有する領域を、前記顔領域として設定する、画像処理装置。
The image processing apparatus according to claim 10,
The face area setting unit is configured to determine at least one of the size, position, and inclination of the face area based on a relationship with the organ area determined in advance according to the orientation of the face image in the estimated target image. An image processing apparatus that identifies one area and sets an area having at least one of the identified size, position, and inclination as the face area.
請求項11に記載の画像処理装置であって、さらに、
前記対象画像における顔の画像を含む領域を検出顔領域として検出する顔領域検出部を備え、
前記顔領域設定部は、前記検出顔領域の大きさと位置と傾きとの少なくとも1つを前記特定された大きさと位置と傾きとの少なくとも1つに一致させた領域を、前記顔領域として設定する、画像処理装置。
The image processing apparatus according to claim 11, further comprising:
A face area detection unit that detects an area including a face image in the target image as a detection face area;
The face area setting unit sets, as the face area, an area in which at least one of the size, position, and inclination of the detected face area is matched with at least one of the specified size, position, and inclination. , Image processing device.
請求項3ないし請求項6のいずれかに記載の画像処理装置であって、さらに、
検出された前記器官領域に基づき、推定された前記対象画像における顔の画像の向きに応じた所定の方法で、前記対象画像における顔の画像を含む顔領域を設定する顔領域設定部を備え、
前記顔領域設定部は、前記参照幅と前記参照高さとに基づき、前記顔領域の大きさを特定する、画像処理装置。
The image processing apparatus according to claim 3, further comprising:
A face area setting unit configured to set a face area including a face image in the target image in a predetermined method according to the estimated orientation of the face image in the target image based on the detected organ area;
The face area setting unit is an image processing apparatus that specifies a size of the face area based on the reference width and the reference height.
請求項13に記載の画像処理装置であって、
前記顔領域設定部は、前記参照幅に所定の係数を乗じて前記顔領域の幅を特定し、
推定された前記対象画像における顔の画像の向きが右振りまたは左振りである場合に用いられる前記所定の係数の値は、正面向きである場合に用いられる前記所定の係数の値と比較して、大きい、画像処理装置。
The image processing apparatus according to claim 13,
The face area setting unit specifies a width of the face area by multiplying the reference width by a predetermined coefficient,
The value of the predetermined coefficient used when the estimated orientation of the face image in the target image is right-handed or left-handed is compared with the value of the predetermined coefficient used when the face-oriented. Large, image processing device.
請求項13に記載の画像処理装置であって、
前記顔領域設定部は、前記参照高さに所定の係数を乗じて前記顔領域の高さを特定し、
推定された前記対象画像における顔の画像の向きが上振りまたは下振りである場合に用いられる前記所定の係数の値は、正面向きである場合に用いられる前記所定の係数の値と比較して、大きい、画像処理装置。
The image processing apparatus according to claim 13,
The face area setting unit specifies the height of the face area by multiplying the reference height by a predetermined coefficient,
The value of the predetermined coefficient used when the estimated orientation of the face image in the target image is up or down is compared with the value of the predetermined coefficient used when the face is facing forward. Large, image processing device.
請求項10ないし請求項15のいずれかに記載の画像処理装置であって、さらに、
設定された前記顔領域に基づき処理対象領域を設定し、前記処理対象領域を対象に所定の画像処理を行う画像処理部を備える、画像処理装置。
The image processing apparatus according to any one of claims 10 to 15, further comprising:
An image processing apparatus comprising: an image processing unit that sets a processing target area based on the set face area and performs predetermined image processing on the processing target area.
請求項1ないし請求項16のいずれかに記載の画像処理装置であって、
前記器官領域検出部は、検出された前記器官領域について、顔の器官の画像を含む領域であることの確からしさを表す信頼度指標を設定する信頼度設定部を含み、
前記顔向き推定部は、検出された前記器官領域の内、前記信頼度指標の値が所定の閾値より大きい前記器官領域のみに基づき、前記対象画像における顔の画像の向きを推定する、画像処理装置。
The image processing apparatus according to any one of claims 1 to 16,
The organ area detection unit includes a reliability setting unit that sets a reliability index that represents the probability that the detected organ area is an area including an image of a facial organ,
The face orientation estimating unit estimates an orientation of a face image in the target image based only on the organ area in which the value of the reliability index is greater than a predetermined threshold among the detected organ areas. apparatus.
画像処理方法であって、
(a)対象画像における顔の器官の画像を含む領域を器官領域として検出する工程と、
(b)検出された前記器官領域に基づき、前記対象画像における顔の画像の向きを推定する工程と、を備える、画像処理方法。
An image processing method comprising:
(A) detecting a region including an image of a facial organ in the target image as an organ region;
And (b) estimating a face image orientation in the target image based on the detected organ region.
画像処理のためのコンピュータプログラムであって、
対象画像における顔の器官の画像を含む領域を器官領域として検出する器官領域検出機能と、
検出された前記器官領域に基づき、前記対象画像における顔の画像の向きを推定する顔向き推定機能と、を、コンピュータに実現させる、コンピュータプログラム。
A computer program for image processing,
An organ region detection function for detecting a region including an image of a facial organ in the target image as an organ region;
A computer program that causes a computer to realize a face orientation estimation function that estimates the orientation of a face image in the target image based on the detected organ region.
JP2007298400A 2007-11-16 2007-11-16 Estimation of face image direction Withdrawn JP2009123101A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007298400A JP2009123101A (en) 2007-11-16 2007-11-16 Estimation of face image direction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007298400A JP2009123101A (en) 2007-11-16 2007-11-16 Estimation of face image direction

Publications (2)

Publication Number Publication Date
JP2009123101A true JP2009123101A (en) 2009-06-04
JP2009123101A5 JP2009123101A5 (en) 2010-12-09

Family

ID=40815159

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007298400A Withdrawn JP2009123101A (en) 2007-11-16 2007-11-16 Estimation of face image direction

Country Status (1)

Country Link
JP (1) JP2009123101A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005141318A (en) * 2003-11-04 2005-06-02 Omron Corp Outline determination device and outline display device
JP2005339288A (en) * 2004-05-27 2005-12-08 Toshiba Corp Image processor and its method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005141318A (en) * 2003-11-04 2005-06-02 Omron Corp Outline determination device and outline display device
JP2005339288A (en) * 2004-05-27 2005-12-08 Toshiba Corp Image processor and its method

Similar Documents

Publication Publication Date Title
JP5239625B2 (en) Image processing apparatus, image processing method, and image processing program
JP5071162B2 (en) Image processing apparatus, image processing method, and computer program for image processing
JP4289414B2 (en) Image processing for image transformation
US20090028390A1 (en) Image Processing for Estimating Subject Distance
JP2009060299A (en) Image processing device, image processing method, and image processing program
JP2009053914A (en) Image processor and image processing method
JP4289415B2 (en) Image processing for image transformation
JP4389954B2 (en) Image processing apparatus, image processing method, computer program, recording medium, and printer
JP2010086379A (en) Image processor, image processing method, and program
JP4289420B2 (en) Image processing apparatus and image processing method
JP4816538B2 (en) Image processing apparatus and image processing method
JP4930298B2 (en) Specify image area
JP5338887B2 (en) Image processing device
JP4853541B2 (en) Image processing apparatus and image processing method
JP2009123101A (en) Estimation of face image direction
JP4946729B2 (en) Image processing device
JP2009110048A (en) Setting of face area
JP4816540B2 (en) Image processing apparatus and image processing method
JP2009055305A (en) Image processing adding information to image
JP2009217506A (en) Image processor and image processing method
JP2009223566A (en) Image processor, image processing method, and image processing program
JP4862723B2 (en) Image processing for object position detection
JP4930525B2 (en) Image processing for image transformation
JP4737324B2 (en) Image processing apparatus, image processing method, and computer program
JP5163801B2 (en) Apparatus, method, and computer program

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20101025

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101025

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110929

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111004

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120228

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20120330