JP4946729B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP4946729B2
JP4946729B2 JP2007219718A JP2007219718A JP4946729B2 JP 4946729 B2 JP4946729 B2 JP 4946729B2 JP 2007219718 A JP2007219718 A JP 2007219718A JP 2007219718 A JP2007219718 A JP 2007219718A JP 4946729 B2 JP4946729 B2 JP 4946729B2
Authority
JP
Japan
Prior art keywords
area
face
image
deformation
face area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2007219718A
Other languages
Japanese (ja)
Other versions
JP2009053915A5 (en
JP2009053915A (en
Inventor
育央 早石
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 JP2007219718A priority Critical patent/JP4946729B2/en
Publication of JP2009053915A publication Critical patent/JP2009053915A/en
Publication of JP2009053915A5 publication Critical patent/JP2009053915A5/ja
Application granted granted Critical
Publication of JP4946729B2 publication Critical patent/JP4946729B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、対象画像における顔の画像を含む領域を設定する画像処理技術に関する。   The present invention relates to an image processing technique for setting a region including a face image in a target image.

テンプレートを利用したパターンマッチング等の所定の方法により、対象画像における顔の画像を表す領域(以下「顔領域」とも呼ぶ)を検出する技術が知られている(例えば特許文献1)。   A technique for detecting an area representing a face image in a target image (hereinafter also referred to as “face area”) by a predetermined method such as pattern matching using a template is known (for example, Patent Document 1).

特開2006−279460JP 2006-279460 A

従来の顔領域の検出技術は、必ずしも精度良く顔領域を検出するものではなく、例えば、顔の画像のほんの一部のみが顔領域として検出される場合があった。特に、正面以外の向きの顔について、検出精度が低下する傾向にあった。   The conventional face area detection technique does not necessarily detect the face area with high accuracy. For example, only a part of the face image may be detected as the face area. In particular, detection accuracy tends to decrease for faces in directions other than the front.

本発明は、上記の課題を解決するためになされたものであり、精度の高い顔領域の設定を可能とする技術を提供することを目的とする。   The present invention has been made in order to solve the above-described problems, and an object of the present invention is to provide a technique capable of setting a highly accurate face area.

上記課題の少なくとも一部を解決するために、本発明は、以下の形態または適用例として実現することが可能である。   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]画像処理装置であって、
対象画像における顔の画像を含む領域である第1の顔領域を設定する第1の顔領域設定部と、
前記第1の顔領域内の画素の画素値に基づき、肌色値の範囲を設定する肌色値設定部と、
前記第1の顔領域の周辺の画素を含む領域において、前記肌色値の範囲に含まれる画素値を有する画素である肌色画素を検出する肌色画素検出部と、
前記肌色画素の検出結果に基づき、前記対象画像における顔の画像を含む領域であって検出された前記肌色画素の少なくとも一部を含む領域である第2の顔領域を設定する第2の顔領域設定部と、を備える、画像処理装置。
Application Example 1 An image processing apparatus,
A first face area setting unit for setting a first face area that is an area including a face image in the target image;
A skin color value setting unit that sets a range of skin color values based on pixel values of pixels in the first face area;
A skin color pixel detection unit that detects a skin color pixel that is a pixel having a pixel value included in the range of the skin color value in an area including pixels around the first face area;
Based on the detection result of the skin color pixel, a second face region that sets a second face region that is a region that includes a face image in the target image and that includes at least a part of the detected skin color pixel. An image processing apparatus comprising: a setting unit;

この画像処理装置では、第1の顔領域の周辺の画素を含む領域において肌色画素が検出され、検出された肌色画素の少なくとも一部を含む領域が第2の顔領域として設定される。そのため、顔の画像を包含する領域として第1の顔領域より精度の高い領域である第2の顔領域を設定することができる。また、この画像処理装置では、第1の顔領域内の画素の画素値に基づき肌色値の範囲が設定されるため、人物毎の肌の色の違いに関わらず第2の顔領域を設定することができる。   In this image processing apparatus, a skin color pixel is detected in an area including pixels around the first face area, and an area including at least a part of the detected skin color pixel is set as the second face area. Therefore, the second face area, which is an area with higher accuracy than the first face area, can be set as the area including the face image. Further, in this image processing apparatus, since the skin color value range is set based on the pixel values of the pixels in the first face area, the second face area is set regardless of the skin color difference for each person. be able to.

[適用例2]適用例1に記載の画像処理装置であって、さらに、
前記第1の顔領域と前記第2の顔領域とに基づいて、前記対象画像を対象とした所定の画像処理の実行の可否を判定する判定部を備える、画像処理装置。
Application Example 2 The image processing apparatus according to Application Example 1, further comprising:
An image processing apparatus comprising: a determination unit that determines whether or not to execute predetermined image processing on the target image based on the first face area and the second face area.

第1の顔領域と第2の顔領域との関係は、顔の画像の向きに応じて変化するものと考えられる。そのため、この画像処理装置では、顔の画像の向きに応じて対象画像を対象とした所定の画像処理の実行の可否を判定することができる。   It is considered that the relationship between the first face area and the second face area changes according to the orientation of the face image. Therefore, in this image processing apparatus, it is possible to determine whether or not to execute predetermined image processing on the target image according to the orientation of the face image.

[適用例3]適用例2に記載の画像処理装置であって、
前記判定部は、前記第1の顔領域と前記第2の顔領域との位置関係と、前記第1の顔領域と前記第2の顔領域との大きさに関する関係と、の少なくとも一方に基づいて、前記判定を行う、画像処理装置。
[Application Example 3] The image processing apparatus according to Application Example 2,
The determination unit is based on at least one of a positional relationship between the first face region and the second face region and a relationship regarding the size of the first face region and the second face region. An image processing apparatus that performs the determination.

この画像処理装置では、第1の顔領域と第2の顔領域との位置関係と、第1の顔領域と第2の顔領域との大きさに関する関係と、の少なくとも一方に基づいて、顔の画像の向きに関する判定を行うことができ、顔の画像の向きに応じて対象画像を対象とした所定の画像処理の実行の可否を判定することができる。   In this image processing apparatus, a face is determined based on at least one of a positional relationship between the first face region and the second face region and a relationship regarding the size of the first face region and the second face region. It is possible to determine whether or not to perform predetermined image processing on the target image according to the orientation of the face image.

[適用例4]適用例2または適用例3に記載の画像処理装置であって、
前記所定の画像処理は、前記第1の顔領域を含む領域内の画像の変形処理である、画像処理装置。
Application Example 4 The image processing apparatus according to Application Example 2 or Application Example 3,
The image processing apparatus, wherein the predetermined image processing is deformation processing of an image in an area including the first face area.

この画像処理装置では、顔の画像の向きによっては不自然な結果を招くと考えられる顔領域を含む領域内の画像の変形処理について、顔の画像の向きに応じて処理の実行の可否を判定することができ、不自然な結果を招く変形処理の実行を回避することができる。   In this image processing apparatus, it is determined whether or not processing can be performed according to the orientation of the face image with respect to the deformation processing of the image in the area including the face area that may cause an unnatural result depending on the orientation of the face image. It is possible to avoid the execution of deformation processing that causes unnatural results.

[適用例5]適用例2ないし適用例4のいずれかに記載の画像処理装置であって、さらに、
前記判定部が実行可と判定した場合に、前記所定の画像処理を実行する処理実行部を備える、画像処理装置。
Application Example 5 The image processing apparatus according to any one of Application Examples 2 to 4, further comprising:
An image processing apparatus comprising: a process execution unit that executes the predetermined image processing when the determination unit determines that execution is possible.

この画像処理装置では、判定部が実行可と判定した場合に、所定の画像処理を実行することができる。   In this image processing apparatus, when the determination unit determines that execution is possible, predetermined image processing can be executed.

[適用例6]適用例1に記載の画像処理装置であって、さらに、
前記第2の顔領域の画像を対象とした所定の画像処理を実行する処理実行部を備える、画像処理装置。
Application Example 6 The image processing apparatus according to Application Example 1, further including:
An image processing apparatus comprising: a process execution unit that executes predetermined image processing on an image of the second face area.

この画像処理装置では、顔の画像を包含する領域として第1の顔領域より精度の高い領域である第2の顔領域の画像を対象とした所定の画像処理を実行することができる。   In this image processing apparatus, it is possible to execute predetermined image processing on the image of the second face area, which is an area with higher accuracy than the first face area, as the area including the face image.

[適用例7]適用例1ないし適用例6のいずれかに記載の画像処理装置であって、
前記第1の顔領域設定部は、少なくとも顔の器官の画像の位置に基づいて前記第1の顔領域を設定する、画像処理装置。
[Application Example 7] The image processing apparatus according to any one of Application Example 1 to Application Example 6,
The image processing apparatus, wherein the first face area setting unit sets the first face area based on at least a position of an image of a facial organ.

この画像処理装置では、顔の器官の画像の位置に基づいて設定された第1の顔領域に基づき、顔の画像を包含する領域として第1の顔領域より精度の高い領域である第2の顔領域を設定することができる。   In this image processing apparatus, based on the first face area set based on the position of the image of the facial organ, the second area, which is a higher-accuracy area than the first face area, includes the face image. A face area can be set.

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

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

A.実施例:
A−1.画像処理装置の構成:
図1は、本発明の実施例における画像処理装置としてのプリンタ100の構成を概略的に示す説明図である。本実施例のプリンタ100は、メモリカードMC等から取得した画像データに基づき画像を印刷する、いわゆるダイレクトプリントに対応したカラーインクジェットプリンタである。プリンタ100は、プリンタ100の各部を制御するCPU110と、例えばROMやRAMによって構成された内部メモリ120と、ボタンやタッチパネルにより構成された操作部140と、液晶ディスプレイにより構成された表示部150と、プリンタエンジン160と、カードインターフェース(カードI/F)170と、を備えている。プリンタ100は、さらに、他の機器(例えばデジタルスチルカメラやパーソナルコンピュータ)とのデータ通信を行うためのインターフェースを備えているとしてもよい。プリンタ100の各構成要素は、バスを介して互いに接続されている。
A. Example:
A-1. Configuration of image processing device:
FIG. 1 is an explanatory diagram schematically showing the configuration of a printer 100 as an image processing apparatus according to an embodiment of the present invention. The printer 100 of this embodiment is 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にRGBデータとしての画像データを含む画像ファイルが格納されている。この画像ファイルは、例えばデジタルスチルカメラ等の撮像装置によりExif(Exchangeable Image File Format)規格に則って生成されたファイルであり、撮像により生成された画像データの他に、撮像時の絞り・シャッタースピード・レンズの焦点距離等の付加データを含んでいる。プリンタ100は、カードインターフェース170を介してメモリカード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 as RGB data is stored in the memory card MC. This image file is a file generated in accordance with the Exif (Exchangeable Image File Format) standard by an imaging device such as a digital still camera. For example, in addition to the image data generated by imaging, the aperture / shutter speed at the time of imaging Includes additional data such as lens focal length. The printer 100 acquires an image file stored in the memory card MC via the card interface 170.

内部メモリ120には、顔形状補正部200と、表示処理部310と、印刷処理部320とが格納されている。顔形状補正部200は、所定のオペレーティングシステムの下で、後述する顔形状補正処理を実行するためのコンピュータプログラムである。表示処理部310は、表示部150を制御して、表示部150上に処理メニューやメッセージ等を表示させるディスプレイドライバである。印刷処理部320は、画像データから印刷データを生成し、プリンタエンジン160を制御して、印刷データに基づく画像の印刷を実行するためのコンピュータプログラムである。CPU110は、内部メモリ120から、これらのプログラムを読み出して実行することにより、これら各部の機能を実現する。   The internal memory 120 stores a face shape correction unit 200, a display processing unit 310, and a print processing unit 320. The face shape correction unit 200 is a computer program for executing a face shape correction process described later under a predetermined operating system. The display processing unit 310 is a display driver that controls the display unit 150 to display a processing menu, a message, 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と、第1の顔領域設定部220と、第2の顔領域設定部230と、判定部238と、変形領域設定部240と、変形領域分割部250と、分割領域変形部260と、を含んでいる。また、第2の顔領域設定部230は、肌色値設定部232と、肌色画素検出部234と、を含んでいる。これらの各部の機能については、後述の顔形状補正印刷処理の説明において詳述する。なお、後述するように、変形領域設定部240と、変形領域分割部250と、分割領域変形部260と、により画像の変形が行われる。そのため、変形領域設定部240と変形領域分割部250と分割領域変形部260とは、併せて「変形処理実行部」とも呼ぶことができる。   The face shape correction unit 200 includes, as program modules, a deformation mode setting unit 210, a first face region setting unit 220, a second face region setting unit 230, a determination unit 238, a deformation region setting unit 240, A deformation area dividing unit 250 and a divided area deformation unit 260 are included. The second face area setting unit 230 includes a skin color value setting unit 232 and a skin color pixel detection unit 234. The functions of these units will be described in detail in the description of the face shape correction printing process described later. As will be described later, the deformation region setting unit 240, the deformation region dividing unit 250, and the divided region deforming unit 260 deform the image. Therefore, the deformation area setting unit 240, the deformation area dividing unit 250, and the divided area deformation unit 260 can be collectively referred to as a “deformation processing execution 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は、メモリカードMCに格納された画像ファイルに基づき、画像の印刷を行う。カードスロット172にメモリカードMCが挿入されると、表示処理部310により、メモリカードMCに格納された画像の一覧表示を含むユーザインターフェースが表示部150に表示される。図2は、画像の一覧表示を含むユーザインターフェースの一例を示す説明図である。図2に示すユーザインターフェースには、8つのサムネイル画像TN1〜TN8と、5つのボタンBN1〜BN5が表示されている。なお、本実施例では、画像の一覧表示は、メモリカードMCに格納された画像ファイルに含まれるサムネイル画像を用いて実現される。
A-2. Face shape correction printing process:
The printer 100 prints an image based on the image file stored in the memory card MC. When the memory card MC is inserted into the card slot 172, the display processing unit 310 displays a user interface including a list display of images stored in the memory card MC on the display unit 150. FIG. 2 is an explanatory diagram illustrating an example of a user interface including a list display of images. In the user interface shown in FIG. 2, eight thumbnail images TN1 to TN8 and five buttons BN1 to BN5 are displayed. In this embodiment, the list display of images is realized by using thumbnail images included in the image file stored in the memory card MC.

本実施例のプリンタ100は、図2に示すユーザインターフェースにおいて、ユーザにより、1つ(または複数)の画像が選択されると共に通常印刷ボタンBN3が選択されると、選択画像を通常通り印刷する通常印刷処理を実行する。他方、当該ユーザインターフェースにおいて、ユーザにより、1つ(または複数)の画像が選択されると共に顔形状補正印刷ボタンBN4が選択されると、プリンタ100は、選択画像について、選択画像中の顔の画像の形状を補正して補正後の画像を印刷する顔形状補正印刷処理を実行する。図2の例では、サムネイル画像TN1と顔形状補正印刷ボタンBN4とが選択されているため、プリンタ100は、サムネイル画像TN1に対応する画像について顔形状補正印刷処理を行う。   The printer 100 according to the present embodiment normally prints a selected image as usual when one (or a plurality) of images is selected and a normal print button BN3 is selected by the user in the user interface shown in FIG. Execute print processing. On the other hand, in the user interface, when one (or a plurality) of images is selected by the user and the face shape correction print button BN4 is selected, the printer 100 selects the face image in the selected image for the selected image. The face shape correction printing process for correcting the shape of the image and printing the corrected image is executed. In the example of FIG. 2, since the thumbnail image TN1 and the face shape correction print button BN4 are selected, the printer 100 performs a face shape correction print process on the image corresponding to the thumbnail image TN1.

図3は、本実施例のプリンタ100による顔形状補正印刷処理の流れを示すフローチャートである。ステップS100では、顔形状補正部200(図1)が、顔形状補正処理を実行する。本実施例の顔形状補正処理は、画像中の顔の少なくとも一部の形状(例えば顔の輪郭形状や目の形状)を補正する処理である。なお、目や眉、鼻や口などの顔の一部分は、一般に器官とも呼ばれる。   FIG. 3 is a flowchart illustrating a flow of face shape correction printing processing by the printer 100 according to the present exemplary embodiment. In step S100, the face shape correction unit 200 (FIG. 1) executes face shape correction processing. The face shape correction process according to the present embodiment is a process for correcting at least a part of a face in the image (for example, a face outline shape or an eye shape). Note that a part of the face such as eyes, eyebrows, nose and mouth is generally called an organ.

図4は、本実施例における顔形状補正処理(図3のステップS100)の流れを示すフローチャートである。ステップS110では、顔形状補正部200(図1)が、顔形状補正処理の対象となる対象画像TIを設定する。顔形状補正部200は、図2に示したユーザインターフェースにおいてユーザにより選択されたサムネイル画像TN1に対応する画像を対象画像TIとして設定する。設定された対象画像TIの画像ファイルは、メモリカードMCからカードインターフェース170を介してプリンタ100に取得され、内部メモリ120の所定領域に格納される。   FIG. 4 is a flowchart showing the flow of the face shape correction process (step S100 in FIG. 3) in the present embodiment. In step S110, the face shape correction unit 200 (FIG. 1) sets a target image TI that is a target of face shape correction processing. The face shape correction unit 200 sets an image corresponding to the thumbnail image TN1 selected by the user in the user interface shown in FIG. 2 as the target image TI. The set image file of the target image TI is acquired by the printer 100 from the memory card MC via the card interface 170 and stored in a predetermined area of the internal memory 120.

ステップS120(図4)では、変形態様設定部210(図1)が、顔形状補正のための画像変形の態様(変形のタイプおよび度合い)を設定する。変形態様設定部210は、画像変形のタイプおよび度合いを設定するためのユーザインターフェースを表示部150に表示するように表示処理部310に指示し、当該ユーザインターフェースを通じてユーザにより指定された画像変形のタイプおよび度合いを、処理に使用する画像変形タイプおよび度合いとして設定する。   In step S120 (FIG. 4), the deformation mode setting unit 210 (FIG. 1) sets an image deformation mode (type and degree of deformation) for face shape correction. The deformation mode setting unit 210 instructs the display processing unit 310 to display a user interface for setting the type and degree of image deformation on the display unit 150, and the image deformation type designated by the user through the user interface. And the degree are set as the image deformation type and degree used for processing.

図5は、画像変形のタイプおよび度合いを設定するためのユーザインターフェースの一例を示す説明図である。図5に示すように、このユーザインターフェースには、画像変形タイプを設定するためのインターフェースが含まれている。本実施例では、例えば、顔の形状をシャープにする変形タイプ「タイプA」や、目の形状を大きくする変形タイプ「タイプB」等が選択肢として予め設定されているものとする。ユーザは、このインターフェースを介して画像変形のタイプを指定する。変形態様設定部210は、ユーザにより指定された画像変形タイプを、実際の処理に使用する画像変形タイプとして設定する。   FIG. 5 is an explanatory diagram showing an example of a user interface for setting the type and degree of image deformation. As shown in FIG. 5, this user interface includes an interface for setting an image deformation type. In this embodiment, for example, a deformation type “type A” that sharpens the shape of the face, a deformation type “type B” that increases the shape of the eyes, and the like are set in advance as options. The user specifies the type of image deformation via this interface. The deformation mode setting unit 210 sets the image deformation type designated by the user as the image deformation type used for actual processing.

また、図5に示すユーザインターフェースには、画像変形の度合い(程度)を設定するためのインターフェースが含まれている。図5に示すように、本実施例では、画像変形の度合いとして、強(S)、中(M)、弱(W)の3段階の選択肢が予め設定されているものとする。ユーザは、このインターフェースを介して画像変形の度合いを指定する。変形態様設定部210は、指定された画像変形の度合いを、実際の処理に使用する画像変形の度合いとして設定する。   The user interface shown in FIG. 5 includes an interface for setting the degree (degree) of image deformation. As shown in FIG. 5, in this embodiment, it is assumed that three levels of options of strong (S), medium (M), and weak (W) are set in advance as the degree of image deformation. The user designates the degree of image deformation via this interface. The deformation mode setting unit 210 sets the designated degree of image deformation as the degree of image deformation used for actual processing.

以降では、画像変形のタイプとして顔の形状をシャープにするための変形タイプ「タイプA」が設定され、画像変形の度合い(変形量)として「中程度(M)」が選択されたものとして説明を行う。   In the following description, it is assumed that the deformation type “type A” for sharpening the face shape is set as the image deformation type, and “medium (M)” is selected as the image deformation degree (deformation amount). I do.

ステップS130(図4)では、第1の顔領域設定部220(図1)が、対象画像TIにおける第1の顔領域FA1の設定を行う。ここで、第1の顔領域FA1は、対象画像TIにおける画像領域であって、少なくとも顔の一部の画像を含む領域である。第1の顔領域設定部220は、対象画像TIを解析して顔の画像を含むと想定される領域を検出し、当該領域を第1の顔領域FA1として設定する。第1の顔領域設定部220による顔の画像を含むと想定される領域の検出は、例えばテンプレートを利用したパターンマッチングによる方法(特開2006−279460参照)といった公知の検出方法を用いて実行される。このようなテンプレートを利用したパターンマッチングによる方法は、一般に、顔の器官(目、眉、鼻、口等)の画像の位置に基づいて、対象画像TI中から顔の画像が概ね含まれると考えられる領域を検出するものである。   In step S130 (FIG. 4), the first face area setting unit 220 (FIG. 1) sets the first face area FA1 in the target image TI. Here, the first face area FA1 is an image area in the target image TI and includes at least a partial image of the face. The first face area setting unit 220 analyzes the target image TI, detects an area assumed to include a face image, and sets the area as the first face area FA1. The detection of an area assumed to include a face image by the first face area setting unit 220 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). The In general, such a pattern matching method using a template is considered to include a face image from the target image TI based on the position of an image of a facial organ (eyes, eyebrows, nose, mouth, etc.). The detected area is detected.

図6は、第1の顔領域FA1の設定結果の一例を示す説明図である。図6の例では、対象画像TIに人物P1と人物P2との2人の顔の画像が含まれている。そのため、ステップS130において、人物P1と人物P2とのそれぞれについて、第1の顔領域FA1が設定される。この第1の顔領域FA1は、図6に示すように、両目と鼻と口の画像を含む矩形の領域となっている。なお、第1の顔領域設定部220は、設定された第1の顔領域FA1を、例えば第1の顔領域FA1の4つの頂点の座標により特定する。   FIG. 6 is an explanatory diagram illustrating an example of a setting result of the first face area FA1. In the example of FIG. 6, the target image TI includes images of the faces of two people, a person P1 and a person P2. Therefore, in step S130, the first face area FA1 is set for each of the person P1 and the person P2. As shown in FIG. 6, the first face area FA1 is a rectangular area including images of both eyes, nose and mouth. Note that the first face area setting unit 220 specifies the set first face area FA1 by, for example, the coordinates of the four vertices of the first face area FA1.

なお、ステップS130において、顔の画像を含むと想定される領域が検出されなかった場合には、その旨が表示部150を通じてユーザに通知される。この場合には、顔形状補正を伴わない通常印刷が行われるとしてもよいし、他の検出方法を用いた再度の検出処理が行われるとしてもよい。   In step S130, if an area that is assumed to include a face image is not detected, the fact is notified to the user through the display unit 150. In this case, normal printing without face shape correction may be performed, or re-detection processing using another detection method may be performed.

ステップS140(図4)では、第2の顔領域設定部230(図1)が、対象画像TIにおける第2の顔領域FA2の設定を行う。第2の顔領域FA2は、第1の顔領域FA1と同様に、対象画像TIにおける画像領域であって、少なくとも顔の一部の画像を含む領域である。第2の顔領域FA2は、図4のステップS130で設定された第1の顔領域FA1毎に設定される。すなわち、本実施例では2つの第1の顔領域FA1が設定されているため(図6参照)、2つの第1の顔領域FA1に対応した2つの第2の顔領域FA2が設定される。   In step S140 (FIG. 4), the second face area setting unit 230 (FIG. 1) sets the second face area FA2 in the target image TI. Similar to the first face area FA1, the second face area FA2 is an image area in the target image TI and includes at least a partial image of the face. The second face area FA2 is set for each first face area FA1 set in step S130 of FIG. That is, in the present embodiment, since two first face areas FA1 are set (see FIG. 6), two second face areas FA2 corresponding to the two first face areas FA1 are set.

図7は、本実施例における第2の顔領域設定処理(図4のステップS140)の流れを示すフローチャートである。ステップS142では、肌色値設定部232(図1)が、肌色値の範囲を設定する。肌色値の範囲は、対象画像TIにおいて、肌を表すと想定される画素の画素値の範囲である。本実施例では、対象画像TIを表す画像データがRGBデータであるため、肌色値の範囲は、R値、G値、B値の組み合わせの範囲として設定される。また、肌色値の範囲の設定は、図4のステップS130で設定された第1の顔領域FA1毎に実行される。   FIG. 7 is a flowchart showing the flow of the second face area setting process (step S140 in FIG. 4) in the present embodiment. In step S142, the skin color value setting unit 232 (FIG. 1) sets a range of skin color values. The range of the skin color value is a range of pixel values of pixels that are assumed to represent skin in the target image TI. In this embodiment, since the image data representing the target image TI is RGB data, the skin color value range is set as a combination range of R value, G value, and B value. The setting of the skin color value range is executed for each first face area FA1 set in step S130 of FIG.

図8は、肌色値の範囲の設定方法を示す説明図である。ステップS130(図4)で第1の顔領域設定部220が設定した第1の顔領域FA1において頻度の高い画素値は、当該人物の肌の色であると考えられる。そのため肌色値設定部232は、図8に示すように、ステップS130で第1の顔領域設定部220が設定した第1の顔領域FA1に含まれる画素のR値、G値、B値毎のヒストグラムを作成し、当該ヒストグラムにおいて頻度が所定の閾値(図8のTfr、Tfg、Tfb)以上となる画素値の範囲を肌色値の範囲(図8のSr、Sg、Sb)として設定する。このようにして、対象画像TIに含まれる人物の画像毎に、肌色値の範囲が設定される。   FIG. 8 is an explanatory diagram showing a method for setting a range of skin color values. It is considered that the pixel value having high frequency in the first face area FA1 set by the first face area setting unit 220 in step S130 (FIG. 4) is the skin color of the person. Therefore, as shown in FIG. 8, the skin color value setting unit 232 sets the R value, G value, and B value of each pixel included in the first face area FA1 set by the first face area setting unit 220 in step S130. A histogram is created, and a pixel value range in which the frequency is equal to or higher than a predetermined threshold (Tfr, Tfg, Tfb in FIG. 8) is set as a skin color value range (Sr, Sg, Sb in FIG. 8). In this way, a range of skin color values is set for each person image included in the target image TI.

ステップS144(図7)では、第2の顔領域設定部230(図1)が、探索領域SAを設定する。図9は、探索領域SAの設定結果の一例を示す説明図である。本実施例では、探索領域SAは、第1の顔領域FA1と第1の顔領域FA1の周辺の領域とを含む領域として設定される。具体的には、第1の顔領域FA1を縦方向および横方向にそれぞれ例えば2倍の倍率で拡大した領域が、探索領域SAとして設定される。探索領域SAは、頭部のほぼ全体の画像が含まれる領域として設定されることが好ましく、探索領域SAがそのように設定されるように、上記倍率が予め設定される。   In step S144 (FIG. 7), the second face area setting unit 230 (FIG. 1) sets the search area SA. FIG. 9 is an explanatory diagram illustrating an example of a setting result of the search area SA. In the present embodiment, the search area SA is set as an area including the first face area FA1 and the area around the first face area FA1. Specifically, an area obtained by enlarging the first face area FA1 in the vertical direction and the horizontal direction at a magnification of, for example, 2 is set as the search area SA. The search area SA is preferably set as an area that includes an image of almost the entire head, and the magnification is set in advance so that the search area SA is set as such.

ステップS146(図7)では、肌色画素検出部234(図1)が、探索領域SAから肌色画素を検出する。肌色画素は、ステップS142で設定された肌色値の範囲に含まれる画素値(R値、G値、B値の組み合わせ)を有する画素である。肌色画素検出部234は、探索領域SAに含まれる画素の画素値を順次調べ、画素値が肌色値の範囲に含まれる画素を肌色画素として検出する。   In step S146 (FIG. 7), the flesh color pixel detection unit 234 (FIG. 1) detects flesh color pixels from the search area SA. The skin color pixel is a pixel having a pixel value (combination of R value, G value, and B value) included in the range of the skin color value set in step S142. The skin color pixel detection unit 234 sequentially examines the pixel values of the pixels included in the search area SA, and detects pixels whose pixel values are included in the skin color value range as skin color pixels.

ステップS148(図7)では、第2の顔領域設定部230(図1)が、第2の顔領域FA2を設定する。図10は、第2の顔領域FA2の設定結果の一例を示す説明図である。第2の顔領域設定部230は、ステップS146で検出された肌色画素のすべてを含むような矩形の領域を第2の顔領域FA2として設定する。なお、第2の顔領域FA2は、第1の顔領域FA1と同様に、人物の画像毎に設定される。   In step S148 (FIG. 7), the second face area setting unit 230 (FIG. 1) sets the second face area FA2. FIG. 10 is an explanatory diagram illustrating an example of a setting result of the second face area FA2. The second face area setting unit 230 sets a rectangular area that includes all the skin color pixels detected in step S146 as the second face area FA2. Note that the second face area FA2 is set for each person image in the same manner as the first face area FA1.

以上説明したように第2の顔領域FA2を設定すると、第2の顔領域FA2は、人物の頭部の肌色部分の画像をほぼ包含するような矩形の領域となる。そのため、本実施例では、顔全体の画像を包含する領域として、第1の顔領域FA1より精度の高い第2の顔領域FA2を設定することが可能となる。また、本実施例では、第1の顔領域FA1内の画素の画素値に基づき肌色値の範囲が設定され、当該肌色値の範囲に含まれる画素値を有する画素が肌色画素として検出される。そのため、人物の肌の色の相違に関わらず、精度の高い第2の顔領域FA2を設定することが可能となる。   As described above, when the second face area FA2 is set, the second face area FA2 is a rectangular area that substantially includes an image of the skin color portion of the person's head. Therefore, in this embodiment, it is possible to set the second face area FA2 with higher accuracy than the first face area FA1 as the area including the entire face image. In the present embodiment, a skin color value range is set based on the pixel values of the pixels in the first face area FA1, and pixels having pixel values included in the skin color value range are detected as skin color pixels. Therefore, it is possible to set the second face area FA2 with high accuracy regardless of the difference in the skin color of the person.

ここで、図10に示すように、ほぼ正面向きの人物(図10のP1)の顔の画像については、第2の顔領域FA2は、第1の顔領域FA1を上下左右にそれぞれほぼ均等に拡大した領域となる。一方、正面向きからの向きのずれ(以下「振り」とも呼ぶ)がある程度大きい人物(図10のP2)の顔の画像については、第2の顔領域FA2は、第1の顔領域FA1を上下左右にそれぞれほぼ均等に拡大した領域とはならず、第1の顔領域FA1を偏った方向に大きく拡大した領域となる。例えば図10に示す例の場合、人物P2の顔の画像は向かって右方向への振りが大きいため、第2の顔領域FA2は、人物P2の右横顔部分の画像を含むように、第1の顔領域FA1を向かって左方向に大きく拡大した領域となっている。   Here, as shown in FIG. 10, for the face image of a substantially front-facing person (P <b> 1 in FIG. 10), the second face area FA <b> 2 is approximately equal to the first face area FA <b> 1 vertically and horizontally. It becomes an enlarged area. On the other hand, for the face image of a person (P2 in FIG. 10) whose orientation deviation from the front direction (hereinafter also referred to as “swing”) is large to some extent, the second face area FA2 moves up and down the first face area FA1. It is not an area that is enlarged substantially equally to the left and right, but an area that is greatly enlarged in the direction in which the first face area FA1 is biased. For example, in the example shown in FIG. 10, since the face image of the person P2 has a large rightward swing, the second face area FA2 includes the first face profile image of the person P2. This is an area greatly enlarged in the left direction toward the face area FA1.

ステップS150(図4)では、判定部238(図1)が、顔形状補正のための変形処理(図4のステップS160)の実行可否を判定する。図11は、変形処理の実行可否の判定方法を示す説明図である。本実施例の変形処理は、後述するように、ほぼ正面向きの人物の顔の画像を対象とすることを前提としており、振りのある程度大きい人物の顔の画像に適用した場合には、処理後の画像が不自然なものとなるおそれがある。そのため、判定部238は、各人物の顔の画像について振りが大きいか否かを判定し、振りが大きい顔の画像については変形処理の実行は不可であると判定する。   In step S150 (FIG. 4), the determination unit 238 (FIG. 1) determines whether or not the deformation process for correcting the face shape (step S160 in FIG. 4) can be performed. FIG. 11 is an explanatory diagram illustrating a method for determining whether or not to execute the deformation process. As will be described later, the deformation process according to the present embodiment is premised on an image of a person's face almost facing the front, and when applied to an image of a person's face with a certain degree of swing, The image may become unnatural. Therefore, the determination unit 238 determines whether or not the swing is large for each person's face image, and determines that the deformation process cannot be executed for the face image with a large swing.

具体的には、判定部238は、第1の顔領域FA1の中心C1と第2の顔領域FA2との中心C2との間の距離Dcが所定の閾値Th以下の場合には振りが小さいと判定し、距離Dcが所定の閾値Thより大きい場合には振りが大きいと判定する。これは、振りが大きい顔の画像については、第2の顔領域FA2が、第1の顔領域FA1を偏った方向に大きく拡大した領域として設定されるからである。図11の例では、人物P1の顔の画像については、振りが小さいため変形処理実行可と判定され、人物P2の顔の画像については、振りが大きいため変形処理実行不可と判定されている。このようにすれば、不自然な結果を招く変形処理の実行が回避される。   Specifically, the determination unit 238 determines that the swing is small when the distance Dc between the center C1 of the first face area FA1 and the center C2 of the second face area FA2 is equal to or less than a predetermined threshold Th. If the distance Dc is greater than the predetermined threshold Th, it is determined that the swing is large. This is because, for an image of a face with a large swing, the second face area FA2 is set as an area that is greatly enlarged in the direction in which the first face area FA1 is biased. In the example of FIG. 11, the face image of the person P1 is determined to be deformable because the swing is small, and the face image of the person P2 is determined to be unexecutable because the swing is large. In this way, it is possible to avoid the execution of deformation processing that causes unnatural results.

ステップS160(図4)では、変形処理が実行される。ステップS160における変形処理は、ステップS150で変形処理実行可と判定された顔の画像のみを対象に実行される。変形処理の具体的方法については、後述の「A−3.変形処理」において詳述する。   In step S160 (FIG. 4), deformation processing is executed. The deformation process in step S160 is executed only for the face image that is determined to be deformable in step S150. A specific method of the deformation process will be described in detail later in “A-3. Deformation process”.

顔形状補正処理(図4)が終了すると、図3のフローチャートに戻り、顔形状補正部200(図1)が、顔形状補正後の対象画像TIを表示部150に表示するよう表示処理部310に指示する(ステップS200)。図12は、顔形状補正後の対象画像TIが表示された表示部150の状態の一例を示す説明図である。顔形状補正後の対象画像TIが表示された表示部150により、ユーザは、補正結果を確認することができる。ユーザが補正結果に満足せず「戻る」ボタンを選択すると、例えば表示部150に図5に示した変形タイプおよび変形度合いを選択する画面が表示され、ユーザによる変形タイプ・変形度合いの再度の設定が実行される。   When the face shape correction process (FIG. 4) ends, the process returns to the flowchart of FIG. 3, and the face shape correction unit 200 (FIG. 1) displays the target image TI after the face shape correction on the display unit 150. (Step S200). FIG. 12 is an explanatory diagram illustrating an example of a state of the display unit 150 on which the target image TI after the face shape correction is displayed. The display unit 150 displaying the target image TI after the face shape correction allows the user to check the correction result. When the user selects the “Return” button without being satisfied with the correction result, for example, a screen for selecting the deformation type and the deformation degree shown in FIG. 5 is displayed on the display unit 150, and the user again sets the deformation type and the deformation degree. Is executed.

ユーザが補正結果に満足し、「印刷」ボタンを選択すると、印刷処理部320(図1)が、プリンタエンジン160を制御して、顔形状補正処理後の対象画像TIの印刷を行う(図3のステップS300)。印刷処理部320は、顔形状補正処理後の対象画像TIの画像データに、解像度変換やハーフトーン処理などの処理を施して印刷データを生成する。生成された印刷データは、印刷処理部320からプリンタエンジン160に供給され、プリンタエンジン160は対象画像TIの印刷を実行する。これにより、顔形状補正後の対象画像TIの印刷が完了する。   When the user is satisfied with the correction result and selects the “print” button, the print processing unit 320 (FIG. 1) controls the printer engine 160 to print the target image TI after the face shape correction processing (FIG. 3). Step S300). The print processing unit 320 generates print data by performing processing such as resolution conversion and halftone processing on the image data of the target image TI after the face shape correction processing. 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. Thereby, the printing of the target image TI after the face shape correction is completed.

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

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

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

図14に示すように、変形領域TAは、高さ方向に関しては、概ね顎から額までの画像を含み、幅方向に関しては、左右の頬の画像を含むような領域として設定される。すなわち、本実施例では、変形領域TAが概ねそのような範囲の画像を含む領域となるように、第1の顔領域FA1の大きさとの関係に基づき、上述の係数k1,k2,k3が予め設定されている。   As shown in FIG. 14, 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 first face area FA1 so that the deformation area TA is an area that includes an image in such a range. Is set.

ステップS164では、変形領域分割部250(図1)が、変形領域TAを複数の小領域に分割する。図15は、変形領域TAの小領域への分割方法の一例を示す説明図である。変形領域分割部250は、変形領域TAに複数の分割点Dを配置し、分割点Dを結ぶ直線を用いて変形領域TAを複数の小領域に分割する。   In step S164, the deformation area dividing unit 250 (FIG. 1) divides the deformation area TA into a plurality of small areas. FIG. 15 is an explanatory diagram showing 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)により、図4のステップS120において設定される変形タイプと対応付けて定義されている。変形領域分割部250は、分割点配置パターンテーブル410を参照し、ステップS120において設定された変形タイプと対応付けられた態様で分割点Dを配置する。本実施例では、上述したように、変形タイプとして顔をシャープにするための変形「タイプA」(図5参照)が設定されているため、この変形タイプに対応付けられた態様で分割点Dが配置される。   The arrangement mode of the dividing points D (the number and position of the dividing points D) is defined in association with the deformation type set in step S120 of FIG. 4 by the dividing point arrangement pattern table 410 (FIG. 1). The deformation area dividing unit 250 refers to the dividing point arrangement pattern table 410 and arranges the dividing points D in a manner associated with the deformation type set in step S120. In the present embodiment, as described above, the deformation “type A” (see FIG. 5) for sharpening the face is set as the deformation type, and therefore the division point D is used in a manner associated with this deformation type. Is placed.

図15に示すように、分割点Dは、水平分割線Lhと垂直分割線Lvとの交点と、水平分割線Lhおよび垂直分割線Lvと変形領域TAの外枠との交点とに配置される。ここで、水平分割線Lhおよび垂直分割線Lvは、変形領域TA内に分割点Dを配置するための基準となる線である。図15に示すように、顔をシャープにするための変形タイプに対応付けられた分割点Dの配置では、基準線RLと直行する2本の水平分割線Lhと、基準線RLに平行な4本の垂直分割線Lvとが設定される。2本の水平分割線Lhを、変形領域TAの下方から順に、Lh1,Lh2と呼ぶ。また、4本の垂直分割線Lvを、変形領域TAの左から順に、Lv1,Lv2,Lv3,Lv4と呼ぶ。   As shown in FIG. 15, the dividing points D are arranged at the intersections of the horizontal dividing line Lh and the vertical dividing line Lv and the intersections of the horizontal dividing line Lh and the vertical dividing 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. 15, in the arrangement of the dividing points D associated with the deformation type for sharpening the face, two horizontal dividing lines Lh perpendicular to the reference line RL and 4 parallel to the reference line RL are used. A vertical division line Lv is set. The two horizontal dividing lines Lh are called Lh1 and Lh2 in order from the bottom of the deformation area TA. The four vertical dividing lines Lv are referred to as Lv1, Lv2, Lv3, and Lv4 in order from the left of the deformation area TA.

水平分割線Lh1は、変形領域TAにおいて、顎の画像より下方に配置され、水平分割線Lh2は、目の画像のすぐ下付近に配置される。また、垂直分割線Lv1およびLv4は、頬のラインの画像の外側に配置され、垂直分割線Lv2およびLv3は、目尻の画像の外側に配置される。なお、水平分割線Lhおよび垂直分割線Lvの配置は、水平分割線Lhおよび垂直分割線Lvと画像との位置関係が結果的に上述の位置関係となるように予め設定された変形領域TAの大きさとの対応関係に従い実行される。   The horizontal dividing line Lh1 is arranged 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が配置される。図15に示すように、水平分割線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. 15, 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.

なお、図15に示すように、本実施例における分割点Dの配置は、基準線RLに対して対称の配置となっている。   As shown in FIG. 15, 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を複数の小領域に分割する。本実施例では、図15に示すように、変形領域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 this embodiment, as shown in FIG. 15, 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

ステップS166(図13)では、分割領域変形部260(図1)が、対象画像TIの変形領域TAを対象とした画像の変形処理を行う。分割領域変形部260による変形処理は、ステップS164で変形領域TA内に配置された分割点Dの位置を移動して、小領域を変形することにより行われる。   In step S166 (FIG. 13), 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 S164 and deforming the small area.

変形処理のための各分割点Dの位置の移動態様(移動方向および移動距離)は、分割点移動テーブル420(図1)により、図4のステップS120において設定される変形タイプと変形の度合いとの組み合わせに対応付けて、予め定められている。分割領域変形部260は、分割点移動テーブル420を参照し、ステップS120において設定された変形タイプと変形の度合いとの組み合わせに対応付けられた移動方向および移動距離で、分割点Dの位置を移動する。   The movement mode (movement direction and movement distance) of the position of each division point D for the deformation process is determined by the division type and the degree of deformation set in step S120 of FIG. 4 by the division point movement table 420 (FIG. 1). It is determined in advance in association with these combinations. The divided region deformation unit 260 refers to the divided point movement table 420 and moves the position of the divided point D with the moving direction and moving distance associated with the combination of the deformation type and the degree of deformation set in step S120. To do.

本実施例では、上述したように、変形タイプとして顔をシャープにするための変形「タイプA」(図5参照)が設定され、変形度合いとして程度「中」の度合いが設定されているため、これらの変形タイプおよび変形度合いの組み合わせに対応付けられた移動方向および移動距離で、分割点Dの位置が移動されることとなる。   In this embodiment, as described above, the deformation “type A” (see FIG. 5) for sharpening the face is set as the deformation type, and the degree of “medium” is set as the deformation degree. The position of the dividing point D is moved with the movement direction and the movement distance associated with the combination of these deformation types and deformation degrees.

図16は、分割点移動テーブル420の内容の一例を示す説明図である。また図17は、分割点移動テーブル420に従った分割点Dの位置の移動の一例を示す説明図である。図16には、分割点移動テーブル420により定義された分割点Dの位置の移動態様の内、顔をシャープにするための変形タイプと程度「中」の変形度合いとの組み合わせに対応付けられた移動態様を示している。図16に示すように、分割点移動テーブル420には、各分割点Dについて、基準線RLと直行する方向(H方向)および基準線RLと平行な方向(V方向)に沿った移動量が示されている。なお、本実施例では、分割点移動テーブル420に示された移動量の単位は、対象画像TIの画素ピッチPPである。また、H方向については、向かって右側への移動量が正の値として表され、向かって左側への移動量が負の値として表され、V方向については、上方への移動量が正の値として表され、下方への移動量が負の値として表される。例えば、分割点D11は、H方向に沿って右側に画素ピッチPPの7倍の距離だけ移動され、V方向に沿って上方に画素ピッチPPの14倍の距離だけ移動される。また、例えば分割点D22は、H方向およびV方向共に移動量がゼロであるため、移動されない。   FIG. 16 is an explanatory diagram showing an example of the contents of the dividing point movement table 420. FIG. 17 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. In FIG. 16, the movement type of the position of the dividing point D defined by the dividing point movement table 420 is associated with a combination of a deformation type for sharpening the face and a degree of “medium” deformation. The movement mode is shown. As shown in FIG. 16, in the dividing point movement table 420, for each dividing point D, the amount of movement along the direction (H direction) perpendicular to the reference line RL and the 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(例えば図15に示す分割点D10等)の位置は移動されないものとしている。従って、図16に示した分割点移動テーブル420には、変形領域TAの外枠上に位置する分割点Dについての移動態様は定義されていない。   In the present embodiment, the division points D (for example, the division points D10 shown in FIG. 15) located on the outer frame of the deformation area TA so that the boundary between the inner and outer images of the deformation area TA does not become unnatural. The position is not moved. Accordingly, in the dividing point movement table 420 shown in FIG. 16, the movement mode for the dividing point D located on the outer frame of the deformation area TA is not defined.

図17では、移動前の分割点Dは白抜きの丸で、移動後の分割点Dや位置の移動の無い分割点Dは黒丸で示されている。また、移動後の分割点Dは分割点D’と呼ばれるものとする。例えば分割点D11の位置は、図17において右上方向に移動され、分割点D’11となる。   In FIG. 17, 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. 17 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の位置移動により新たに定義された小領域の画像となるように、画像の変形処理を行う。例えば、図17において、分割点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. 17, an image of a small region (small region indicated by hatching) having vertices at the division points D11, D21, D22, and D12 is divided into the division points D′ 11, D′ 21, D22, and D′ 12. Is transformed into an image of a small area with the vertex at.

図18は、分割領域変形部260による画像の変形処理方法の概念を示す説明図である。図18では、分割点Dを黒丸で示している。図18では、説明を簡略化するために、4つの小領域について、左側に分割点Dの位置移動前の状態を、右側に分割点Dの位置移動後の状態を、それぞれ示している。図18の例では、中央の分割点Daが分割点Da’の位置に移動され、その他の分割点Dの位置は移動されない。これにより、例えば、分割点Dの移動前の分割点Da,Db,Dc,Ddを頂点とする矩形の小領域(以下「変形前注目小領域BSA」とも呼ぶ)の画像は、分割点Da’,Db,Dc,Ddを頂点とする矩形の小領域(以下「変形後注目小領域ASA」とも呼ぶ)の画像に変形される。   FIG. 18 is an explanatory diagram showing the concept of the image deformation processing method by the divided region deformation unit 260. In FIG. 18, the division point D is indicated by a black circle. In FIG. 18, in order to simplify the description, for 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. 18, 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つの三角形領域に分割し、三角形領域単位で画像の変形処理を行っている。図18の例では、変形前注目小領域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. 18, 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.

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

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

次に、算出された係数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 0004946729
Figure 0004946729

変形前の三角形領域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は、図15に示した変形領域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 illustrated in FIG. 15 and performs an image deformation process in the deformation area TA.

ここで、本実施例の顔形状補正の態様についてより詳細に説明する。図20は、本実施例における顔形状補正の態様を示す説明図である。本実施例では、上述したように、変形タイプとして顔をシャープにするための変形「タイプA」(図5参照)が設定され、変形度合いとして程度「中」の度合いが設定されている。図20には、変形領域TAを構成する各小領域の変形態様のイメージを矢印により示している。   Here, the face shape correction mode of the present embodiment will be described in more detail. FIG. 20 is an explanatory diagram showing a form of face shape correction in the present embodiment. In this embodiment, as described above, the deformation “type A” (see FIG. 5) for sharpening the face is set as the deformation type, and the degree of “medium” is set as the deformation degree. In FIG. 20, the image of the deformation | transformation aspect of each small area | region which comprises deformation | transformation area | region TA is shown with the arrow.

図20に示すように、本実施例の顔形状補正では、基準線RLと平行な方向(V方向)に関し、水平分割線Lh1上に配置された分割点D(D11,D21,D31,D41)の位置は上方に移動される一方、水平分割線Lh2上に配置された分割点D(D12,D22,D32,D42)の位置は移動されない(図16参照)。従って、水平分割線Lh1と水平分割線Lh2との間に位置する画像は、V方向に関して縮小される。上述したように、水平分割線Lh1は顎の画像より下方に配置され、水平分割線Lh2は目の画像のすぐ下付近に配置されるため、本実施例の顔形状補正では、顔の画像の内、顎から目の下にかけての部分の画像がV方向に縮小されることとなる。この結果、画像中の顎のラインは上方に移動する。   As shown in FIG. 20, in the face shape correction of this embodiment, the dividing points D (D11, D21, D31, D41) arranged on the horizontal dividing line Lh1 with respect to the direction parallel to the reference line RL (V direction). 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. 16). 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)の位置は左方向に移動される(図16参照)。さらに、垂直分割線Lv2上に配置された2つの分割点Dの内、水平分割線Lh1上に配置された分割点D(D21)の位置は右方向に移動され、垂直分割線Lv3上に配置された2つの分割点Dの内、水平分割線Lh1上に配置された分割点D(D31)の位置は左方向に移動される(図16参照)。従って、垂直分割線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 division point D (D41, D42) is moved leftward (see FIG. 16). 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. 16). 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中の顔の形状がシャープになる。なお、顔の形状がシャープになるとは、いわゆる「小顔」になると表現することもできる。   When the deformation modes in the H direction and the V direction described above are combined, the face shape in the target image TI is sharpened by the face shape correction of this embodiment. Note that a sharp face shape can be expressed as a so-called “small face”.

なお、図20に示す分割点D22,D32,D33,D23を頂点とする小領域(ハッチングを付した領域)は、上述した水平分割線Lh2や垂直分割線Lv2およびLv3の配置方法によると、両目の画像を含む領域となる。図16に示すように、分割点D22およびD32はH方向にもV方向にも移動されないため、この両目の画像を含む小領域は変形されない。このように本実施例では、両目の画像を含む小領域については変形しないこととし、顔形状補正後の画像がより自然で好ましいものとなるようにしている。   Note that the small regions (hatched regions) having the vertexes at the dividing points D22, D32, D33, and D23 shown in FIG. This area includes the image. As shown in FIG. 16, since the dividing points D22 and D32 are not moved in the H direction or the V direction, the small area 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.変形例:
なお、この発明は上記の実施例や実施形態に限られるものではなく、その要旨を逸脱しない範囲において種々の態様において実施することが可能であり、例えば次のような変形も可能である。
B. 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.

B1.変形例1:
上記実施例における第1の顔領域FA1、探索領域SA、第2の顔領域FA2、変形領域TAの設定方法はあくまで一例であり、これらの領域を他の方法により設定することも可能である。例えば、第1の顔領域FA1は、必ずしも対象画像TIの画像解析による顔の画像を含むと思われる領域検出を介して設定される必要はなく、ユーザによる位置の指定に基づき第1の顔領域FA1が設定されるとしてもよい。
B1. Modification 1:
The setting method of the first face area FA1, the search area SA, the second face area FA2, and the deformation area TA in the above embodiment is merely an example, and these areas can be set by other methods. For example, the first face area FA1 does not necessarily need to be set through area detection that is supposed to include a face image by image analysis of the target image TI, and the first face area FA1 is based on the designation of the position by the user. FA1 may be set.

また、探索領域SAは、第1の顔領域FA1の周辺の画素を含む領域であればよく、第1の顔領域FA1自体を含む必要はない。この場合であっても、探索領域SAにおいて肌色画素を検出し、検出された肌色画素のすべてを包含する矩形領域を第2の顔領域FA2として設定すればよい。   Further, the search area SA may be an area including pixels around the first face area FA1, and need not include the first face area FA1 itself. Even in this case, the skin color pixels may be detected in the search area SA, and a rectangular area including all the detected skin color pixels may be set as the second face area FA2.

また、第2の顔領域FA2は、必ずしも、検出された肌色画素のすべてを包含する矩形領域である必要はなく、検出された肌色画素の一部を包含する矩形領域であってもよい。また、変形領域TAは第1の顔領域FA1の代わりに第2の顔領域FA2に基づき設定されるとしてもよい。   Further, the second face area FA2 does not necessarily have to be a rectangular area that includes all the detected skin color pixels, and may be a rectangular area that includes a part of the detected skin color pixels. The deformation area TA may be set based on the second face area FA2 instead of the first face area FA1.

また、第1の顔領域FA1、探索領域SA、第2の顔領域FA2、変形領域TAは矩形の領域である必要はなく、矩形以外の多角形形状や円形形状の領域であってもよい。   Further, the first face area FA1, the search area SA, the second face area FA2, and the deformation area TA do not have to be rectangular areas, and may be polygonal or circular areas other than rectangles.

B2.変形例2:
上記実施例では、第1の顔領域FA1と第2の顔領域FA2との位置関係に基づいて、変形処理の実行可否の判定が行われているが、第1の顔領域FA1と第2の顔領域FA2との大きさに関する関係に基づいて、変形処理の実行可否の判定が行われるとしてもよい。すなわち、図11に示すように、振りが大きい顔の画像については、第1の顔領域FA1に含まれない位置において多くの肌色画素が存在するものと考えられるため、振りが小さい顔の画像と比較して、第1の顔領域FA1の大きさに対する第2の顔領域FA2の大きさの比が大きいものと考えられる。そのため、第1の顔領域FA1の大きさに対する第2の顔領域FA2の大きさの比が所定の閾値より大きい場合には変形処理実行不可と判定するとしてもよい。あるいは、第1の顔領域FA1と第2の顔領域FA2との位置関係と第1の顔領域FA1と第2の顔領域FA2との大きさに関する関係との両者を組み合わせた条件に基づいて、変形処理の実行可否を判定するものとしてもよい。
B2. Modification 2:
In the above embodiment, whether or not the deformation process can be performed is determined based on the positional relationship between the first face area FA1 and the second face area FA2, but the first face area FA1 and the second face area FA2 Whether or not the deformation process can be executed may be determined based on the relationship with the size of the face area FA2. That is, as shown in FIG. 11, since an image of a face with a large swing is considered to have many skin color pixels at positions not included in the first face area FA1, In comparison, the ratio of the size of the second face area FA2 to the size of the first face area FA1 is considered to be large. Therefore, when the ratio of the size of the second face area FA2 to the size of the first face area FA1 is larger than a predetermined threshold, it may be determined that the deformation process cannot be performed. Alternatively, based on a condition that combines both the positional relationship between the first face area FA1 and the second face area FA2 and the relationship between the sizes of the first face area FA1 and the second face area FA2, It may be determined whether or not the deformation process can be executed.

また、上記実施例では、第1の顔領域FA1と第2の顔領域FA2との関係に基づいて変形処理の実行可否の判定を行っているが、第1の顔領域FA1と第2の顔領域FA2との関係に基づいて他の画像処理の実行可否の判定を行うことも可能である。他の画像処理としては、例えば、肌色補正や明るさ補正等が挙げられる。   In the above embodiment, whether or not the deformation process can be executed is determined based on the relationship between the first face area FA1 and the second face area FA2. However, the first face area FA1 and the second face area are determined. It is also possible to determine whether other image processing can be executed based on the relationship with the area FA2. Examples of other image processing include skin color correction and brightness correction.

B3.変形例3:
上記実施例では、変形処理実行可否の判定を行うために第2の顔領域FA2が設定されているが、第2の顔領域FA2は他の目的のために設定されるとしてもよい。例えば第2の顔領域FA2は、所定の画像処理を施す対象領域を決めるために設定されるとしてもよい。第2の顔領域FA2は、顔全体の画像を包含する領域として、第1の顔領域FA1より精度の高い領域である。従って、例えば第2の顔領域FA2を対象に肌色補正を行うことにより、第1の顔領域FA1を対象に肌色補正を行う場合と比較して、より好ましい肌色補正を実現することができる。このように、第2の顔領域FA2を設定することは、顔領域を再定義することであるとも言える。
B3. Modification 3:
In the above embodiment, the second face area FA2 is set to determine whether or not the deformation process can be performed. However, the second face area FA2 may be set for other purposes. For example, the second face area FA2 may be set to determine a target area to be subjected to predetermined image processing. The second face area FA2 is an area that includes the image of the entire face and is more accurate than the first face area FA1. Therefore, for example, by performing skin color correction on the second face area FA2, more preferable skin color correction can be realized as compared with the case of performing skin color correction on the first face area FA1. In this way, setting the second face area FA2 can be said to redefine the face area.

B4.変形例4:
上記実施例における変形処理の方法はあくまで一例であり、これらの処理を他の方法により実行することも可能である。
B4. Modification 4:
The method of the deformation process in the above embodiment is merely an example, and these processes can be executed by other methods.

B5.変形例5:
上記実施例では、画像処理装置としてのプリンタ100による顔形状補正印刷処理(図3)を説明したが、顔形状補正印刷処理は例えば、顔形状補正と補正画像の表示(ステップS100,S200)がパーソナルコンピュータにより実行され、印刷処理(ステップS300)のみがプリンタにより実行されるものとしてもよい。また、プリンタ100はインクジェットプリンタに限らず、他の方式のプリンタ、例えばレーザプリンタや昇華型プリンタであるとしてもよい。また、変形済画像データは、印刷に限らず、任意の用途に利用可能である。例えば、表示装置(例えば、プロジェクタ)による表示を採用してもよい。
B5. Modification 5:
Although the face shape correction printing process (FIG. 3) by the printer 100 as the image processing apparatus has been described in the above embodiment, the face shape correction printing process includes, for example, face shape correction and display of corrected images (steps S100 and S200). It may be executed by a personal computer, and only the printing process (step S300) may be executed by the printer. 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 deformed image data can be used not only for printing but also for any purpose. For example, display by a display device (for example, a projector) may be employed.

B6.変形例6:
上記実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部をハードウェアに置き換えるようにしてもよい。例えば、図1の変形領域分割部250と分割領域変形部260との全体の機能を、論理回路を有するハードウェア回路によって実現してもよい。
B6. Modification 6:
In the above embodiment, 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. For example, the entire functions of the modified region dividing unit 250 and the divided region modifying unit 260 of FIG. 1 may be realized by a hardware circuit having a logic circuit.

また、本発明の機能の一部または全部がソフトウェアで実現される場合には、そのソフトウェア(コンピュータプログラム)は、コンピュータ読み取り可能な記録媒体に格納された形で提供することができる。この発明において、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスクや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.

本発明の実施例における画像処理装置としてのプリンタ100の構成を概略的に示す説明図である。1 is an explanatory diagram schematically illustrating a configuration of a printer 100 as an image processing apparatus according to an embodiment of the present invention. 画像の一覧表示を含むユーザインターフェースの一例を示す説明図である。It is explanatory drawing which shows an example of the user interface containing the list display of an image. 本実施例のプリンタ100による顔形状補正印刷処理の流れを示すフローチャートである。4 is a flowchart illustrating a flow of face shape correction printing processing by the printer 100 according to the present exemplary embodiment. 本実施例における顔形状補正処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the face shape correction process in a present Example. 画像変形のタイプおよび度合いを設定するためのユーザインターフェースの一例を示す説明図である。It is explanatory drawing which shows an example of the user interface for setting the type and degree of image deformation. 第1の顔領域FA1の設定結果の一例を示す説明図である。It is explanatory drawing which shows an example of the setting result of 1st face area FA1. 本実施例における第2の顔領域設定処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the 2nd face area setting process in a present Example. 肌色値の範囲の設定方法を示す説明図である。It is explanatory drawing which shows the setting method of the range of a skin color value. 探索領域SAの設定結果の一例を示す説明図である。It is explanatory drawing which shows an example of the setting result of search area SA. 第2の顔領域FA2の設定結果の一例を示す説明図である。It is explanatory drawing which shows an example of the setting result of 2nd face area FA2. 変形処理の実行可否の判定方法を示す説明図である。It is explanatory drawing which shows the determination method of the feasibility of execution of a deformation | transformation process. 顔形状補正後の対象画像TIが表示された表示部150の状態の一例を示す説明図である。It is explanatory drawing which shows an example of the state of the display part 150 on which the target image TI after face shape correction | amendment was displayed. 変形処理の流れを示すフローチャートである。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 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.

符号の説明Explanation of symbols

100…プリンタ
110…CPU
120…内部メモリ
140…操作部
150…表示部
160…プリンタエンジン
170…カードインターフェース
172…カードスロット
200…顔形状補正部
210…変形態様設定部
220…第1の顔領域設定部
230…第2の顔領域設定部
232…肌色値設定部
234…肌色画素検出部
238…判定部
240…変形領域設定部
250…変形領域分割部
260…分割領域変形部
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 | amendment part 210 ... Deformation mode setting part 220 ... 1st face area setting part 230 ... 2nd Face area setting section 232 ... Skin color value setting section 234 ... Skin color pixel detection section 238 ... Determination section 240 ... Deformation area setting section 250 ... Deformation area division section 260 ... Divided area deformation section 310 ... Display processing section 320 ... Print processing section 410 ... Division point arrangement pattern table 420... Division point movement table

Claims (4)

画像処理装置であって、
対象画像における顔の画像を含む領域である第1の顔領域を設定する第1の顔領域設定部と、
前記第1の顔領域内の画素の画素値に基づき、肌色値の範囲を設定する肌色値設定部と、
前記第1の顔領域の周辺の画素を含む領域において、前記肌色値の範囲に含まれる画素値を有する画素である肌色画素を検出する肌色画素検出部と、
前記肌色画素の検出結果に基づき、前記対象画像における顔の画像を含む領域であって検出された前記肌色画素の少なくとも一部を含む領域である第2の顔領域を設定する第2の顔領域設定部と、を備える、画像処理装置。
An image processing apparatus,
A first face area setting unit for setting a first face area that is an area including a face image in the target image;
A skin color value setting unit that sets a range of skin color values based on pixel values of pixels in the first face area;
A skin color pixel detection unit that detects a skin color pixel that is a pixel having a pixel value included in the range of the skin color value in an area including pixels around the first face area;
Based on the detection result of the skin color pixel, a second face region that sets a second face region that is a region that includes a face image in the target image and that includes at least a part of the detected skin color pixel. An image processing apparatus comprising: a setting unit;
請求項1に記載の画像処理装置であって、さらに、
前記第1の顔領域と前記第2の顔領域とに基づいて、前記第1の顔領域に基づき設定された領域を対象とした所定の画像処理の実行の可否を判定する判定部を備え
前記判定部は、前記第1の顔領域と前記第2の顔領域との位置関係と、前記第1の顔領域と前記第2の顔領域との大きさに関する関係と、の少なくとも一方に基づいて、前記判定を行う、画像処理装置。
The image processing apparatus according to claim 1, further comprising:
A determination unit that determines whether or not to execute predetermined image processing on an area set based on the first face area based on the first face area and the second face area ;
The determination unit is based on at least one of a positional relationship between the first face region and the second face region and a relationship regarding the size of the first face region and the second face region. An image processing apparatus that performs the determination .
請求項2に記載の画像処理装置であって、
前記所定の画像処理は、前記第1の顔領域を含む領域内の画像の変形処理である、画像処理装置。
The image processing apparatus according to claim 2,
The image processing apparatus, wherein the predetermined image processing is deformation processing of an image in an area including the first face area.
請求項2または請求項3に記載の画像処理装置であって、さらに、
前記判定部が実行可と判定した場合に、前記所定の画像処理を実行する処理実行部を備える、画像処理装置。
The image processing apparatus according to claim 2 or 3, further comprising:
An image processing apparatus comprising: a process execution unit that executes the predetermined image processing when the determination unit determines that execution is possible.
JP2007219718A 2007-08-27 2007-08-27 Image processing device Expired - Fee Related JP4946729B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007219718A JP4946729B2 (en) 2007-08-27 2007-08-27 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007219718A JP4946729B2 (en) 2007-08-27 2007-08-27 Image processing device

Publications (3)

Publication Number Publication Date
JP2009053915A JP2009053915A (en) 2009-03-12
JP2009053915A5 JP2009053915A5 (en) 2010-09-24
JP4946729B2 true JP4946729B2 (en) 2012-06-06

Family

ID=40504950

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007219718A Expired - Fee Related JP4946729B2 (en) 2007-08-27 2007-08-27 Image processing device

Country Status (1)

Country Link
JP (1) JP4946729B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000339471A (en) * 1999-05-31 2000-12-08 Matsushita Electric Ind Co Ltd Method and device for extracting picture
JP4470434B2 (en) * 2003-10-06 2010-06-02 富士ゼロックス株式会社 Motion identification device and object posture identification device
JP2006350577A (en) * 2005-06-14 2006-12-28 Fuji Xerox Co Ltd Operation analyzing device

Also Published As

Publication number Publication date
JP2009053915A (en) 2009-03-12

Similar Documents

Publication Publication Date Title
JP5239625B2 (en) Image processing apparatus, image processing method, and image processing program
JP4957463B2 (en) Image processing device
JP4289414B2 (en) Image processing for image transformation
JP5071162B2 (en) Image processing apparatus, image processing method, and computer program for image processing
JP2009237619A (en) Detection of face area and organ area in image
US20090028390A1 (en) Image Processing for Estimating Subject Distance
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
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
JP4946729B2 (en) Image processing device
JP4853541B2 (en) Image processing apparatus and image processing method
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
JP4888188B2 (en) Image processing apparatus and image processing method
JP2009110048A (en) Setting of face area
JP4737324B2 (en) Image processing apparatus, image processing method, and computer program
JP4862723B2 (en) Image processing for object position detection
JP4930525B2 (en) Image processing for image transformation
JP2009123101A (en) Estimation of face image direction
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: 20100811

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100811

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110816

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111013

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120207

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120220

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150316

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees