JP2009104672A - Image processing for image deformation - Google Patents

Image processing for image deformation Download PDF

Info

Publication number
JP2009104672A
JP2009104672A JP2009032871A JP2009032871A JP2009104672A JP 2009104672 A JP2009104672 A JP 2009104672A JP 2009032871 A JP2009032871 A JP 2009032871A JP 2009032871 A JP2009032871 A JP 2009032871A JP 2009104672 A JP2009104672 A JP 2009104672A
Authority
JP
Japan
Prior art keywords
deformation
area
image
evaluation
face
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2009032871A
Other languages
Japanese (ja)
Other versions
JP2009104672A5 (en
JP4930525B2 (en
Inventor
Yasuhisa Hayaishi
育央 早石
Akio Yamazaki
明生 山▲崎▼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2009032871A priority Critical patent/JP4930525B2/en
Publication of JP2009104672A publication Critical patent/JP2009104672A/en
Publication of JP2009104672A5 publication Critical patent/JP2009104672A5/ja
Application granted granted Critical
Publication of JP4930525B2 publication Critical patent/JP4930525B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To easily and efficiently process an image for deformation according to various deformation modes. <P>SOLUTION: An image processor which deforms an image is provided with: a deformation area setting part which sets at least a part of an area on an object image as a deformation area; a deformation area division part which arranges a plurality of division points in the deformation area, and divides the deformation area into a plurality of small areas using a straight line connecting the division points; and a deformation processing part which deforms the image in the deformation area by moving a position of at least one division point and deforming the small areas. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像を変形するための画像処理技術に関する。   The present invention relates to an image processing technique for deforming 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 for deforming the shape of a face by enlarging or reducing the image at a specified magnification is disclosed.

特開2004−318204JP 2004-318204 A

上記従来の画像変形のための画像処理では、複数の小領域のそれぞれについて、それぞれの小領域毎に設定された倍率で画像の拡大または縮小が行われるため、処理が煩雑であった。また、上記従来の画像変形のための画像処理は、頬のラインを補正することに特化されており、他の多様な変形態様に対応するのが困難であった。   In the conventional image processing for image deformation, since the image is enlarged or reduced for each of the plurality of small regions at a magnification set for each small region, the processing is complicated. Further, the conventional image processing for image deformation is specialized in correcting cheek lines, and it is difficult to deal with various other deformation modes.

本発明は、上述した従来の課題を解決するためになされたものであり、多様な変形態様に対応した画像変形のための画像処理を、容易に、かつ効率的に実現することを可能とする技術を提供することを目的とする。   The present invention has been made to solve the above-described conventional problems, and enables image processing for image deformation corresponding to various deformation modes to be easily and efficiently realized. The purpose is to provide technology.

上記課題の少なくとも一部を解決するために、本発明の画像処理装置は、
画像の変形を行う画像処理装置であって、
対象画像上の少なくとも一部の領域を変形領域として設定する変形領域設定部と、
前記変形領域内に複数の分割点を配置し、前記分割点同士を結ぶ直線を用いて前記変形領域を複数の小領域に分割する変形領域分割部と、
少なくとも1つの前記分割点の位置を移動して前記小領域を変形することにより前記変形領域内の画像の変形を行う変形処理部と、を備える。
In order to solve at least a part of the above problems, an image processing apparatus according to the present invention provides:
An image processing apparatus that performs image deformation,
A deformation area setting unit that sets at least a part of the area on the target image as a deformation area;
A deformation area dividing unit that arranges a plurality of division points in the deformation area and divides the deformation area into a plurality of small areas using a straight line connecting the division points;
A deformation processing unit that deforms an image in the deformation area by moving the position of at least one of the division points to deform the small area.

この画像処理装置では、対象画像上に設定された変形領域内に複数の分割点が配置され、分割点同士を結ぶ直線を用いて変形領域が複数の小領域に分割される。また、分割点の位置が移動され、小領域が変形されることにより変形領域内の画像の変形処理が実行される。このように、この画像処理装置では、変形領域内に分割点を配置して、配置された分割点を移動するだけで画像変形を行うことができ、多様な変形態様に対応した画像変形の画像処理を、容易に、かつ効率的に実現することができる。   In this image processing apparatus, a plurality of division points are arranged in a deformation area set on the target image, and the deformation area is divided into a plurality of small areas using straight lines connecting the division points. Also, the position of the dividing point is moved, and the small area is deformed, whereby the deformation process of the image in the deformed area is executed. As described above, in this image processing apparatus, it is possible to perform image deformation by simply arranging the dividing points in the deformation area and moving the arranged dividing points, and image deformation images corresponding to various deformation modes. Processing can be realized easily and efficiently.

上記画像処理装置において、さらに、
複数の所定の変形タイプの内の1つを選択して前記変形領域内の画像の変形に適用する変形タイプとして設定する変形態様設定部を備え、
前記変形領域分割部は、前記設定された変形タイプに対応付けられた所定の配置パターンに従い前記複数の分割点を配置するとしてもよい。
In the above image processing apparatus,
A deformation mode setting unit configured to select one of a plurality of predetermined deformation types and set as a deformation type to be applied to the deformation of the image in the deformation area;
The deformation area dividing unit may arrange the plurality of division points according to a predetermined arrangement pattern associated with the set deformation type.

このようにすれば、例えば顔をシャープする変形タイプや目を大きくする変形タイプ等、それぞれの変形タイプに適した分割点の配置、すなわち変形領域の分割が行われるため、各変形タイプに対応した画像変形のための画像処理のさらなる容易化を実現することができる。   In this way, for example, the arrangement of division points suitable for each deformation type, such as the deformation type that sharpens the face and the deformation type that enlarges the eyes, that is, the division of the deformation area is performed. Further simplification of image processing for image deformation can be realized.

また、上記画像処理装置において、前記変形態様設定部は、複数の所定の変形度合いの内の1つを選択して前記変形領域内の画像の変形に適用する変形度合いとして設定し、
前記変形処理部は、前記設定された変形タイプと変形度合いとの組み合わせに対応付けられた所定の移動方向および移動量に従い前記分割点の位置を移動するとしてもよい。
In the image processing apparatus, the deformation mode setting unit selects one of a plurality of predetermined deformation degrees and sets it as a deformation degree to be applied to the deformation of the image in the deformation area.
The deformation processing unit may move the position of the division point according to a predetermined movement direction and movement amount associated with the combination of the set deformation type and the deformation degree.

このようにすれば、変形タイプと変形度合いとが設定されれば、それらの組み合わせに応じた画像変形が実行されるため、画像変形のための画像処理のさらなる容易化を実現することができる。   In this way, if the deformation type and the degree of deformation are set, image deformation according to the combination thereof is executed, so that it is possible to further facilitate image processing for image deformation.

また、上記画像処理装置において、前記変形態様設定部は、少なくとも1つの前記分割点について、前記分割点の移動方向および移動量に関するユーザ指定を取得する指定取得部を含み、
前記変形処理部は、前記取得されたユーザ指定に従い前記分割点の位置を移動するとしてもよい。
In the image processing apparatus, the deformation mode setting unit includes a designation obtaining unit that obtains user designation regarding a movement direction and a movement amount of the division point with respect to at least one division point,
The deformation processing unit may move the position of the division point according to the acquired user designation.

このようにすれば、よりユーザの希望に近い態様での画像変形のための画像処理を容易に実現することができる。   In this way, it is possible to easily realize image processing for image deformation in a manner closer to the user's desire.

また、上記画像処理装置において、前記変形領域設定部は、前記変形領域に顔の少なくとも一部の画像が含まれるように前記変形領域を設定するとしてもよい。   In the image processing apparatus, the deformation area setting unit may set the deformation area so that at least a part of an image of a face is included in the deformation area.

このようにすれば、顔の画像を対象として、多様な変形態様に対応した画像変形のための画像処理を、容易に、かつ効率的に実現することができる。   In this way, it is possible to easily and efficiently realize image processing for image deformation corresponding to various deformation modes for a face image.

また、上記画像処理装置において、前記変形領域分割部は、少なくとも1組の前記分割点が所定の基準線に対して互いに対称の位置に配置されるように、前記複数の分割点を配置し、
前記変形処理部は、前記少なくとも1組の分割点を、前記所定の基準線に対して互いに対称である位置関係を維持したまま移動するとしてもよい。
In the image processing apparatus, the deformation region dividing unit arranges the plurality of division points so that at least one set of the division points is arranged at positions symmetrical to each other with respect to a predetermined reference line,
The deformation processing unit may move the at least one set of division points while maintaining a positional relationship that is symmetrical with respect to the predetermined reference line.

このようにすれば、所定の基準線に対して左右対称な画像変形が行われることとなり、より自然で好ましい顔画像の画像変形のための画像処理を実現することができる。   In this way, image deformation that is bilaterally symmetric with respect to a predetermined reference line is performed, and image processing for image deformation of a more natural and preferable face image can be realized.

また、上記画像処理装置において、前記変形処理部は、少なくとも1つの前記小領域について、変形を行わないとしてもよい。   In the image processing apparatus, the deformation processing unit may not perform deformation on at least one of the small regions.

このようにすれば、顔の印象を大きく変更することなく所望の画像変形を行うことが可能となり、より自然で好ましい顔画像の画像変形のための画像処理を実現することができる。   In this way, it is possible to perform desired image deformation without greatly changing the impression of the face, and it is possible to realize image processing for more natural and preferable face image deformation.

また、上記画像処理装置において、前記変形処理部は、目の画像を含む前記小領域について、変形を行わないとしてもよい。   In the image processing apparatus, the deformation processing unit may not perform deformation on the small region including the eye image.

このようにすれば、目の画像を含む小領域については変形を行わないものとすることにより、より自然で好ましい顔画像の画像変形のための画像処理を実現することができる。   In this way, it is possible to realize image processing for image deformation of a more natural and preferable face image by not performing deformation on a small region including an eye image.

また、上記画像処理装置において、さらに、
前記対象画像上の顔の画像を表す顔領域を検出する顔領域検出部を備え、
前記変形領域設定部は、検出された前記顔領域に基づき前記変形領域を設定するとしてもよい。
In the above image processing apparatus,
A face area detecting unit for detecting a face area representing a face image on the target image;
The deformation area setting unit may set the deformation area based on the detected face area.

このようにすれば、対象画像から検出された顔領域に基づき設定された変形領域の画像変形について、多様な変形態様に対応した画像変形のための画像処理を、容易に、かつ効率的に実現することができる。   In this way, image processing for image deformation corresponding to various deformation modes can be realized easily and efficiently for image deformation of the deformation area set based on the face area detected from the target image. can do.

また、上記画像処理装置において、さらに、
前記変形領域内の画像の変形が行われた前記対象画像を印刷する印刷部を備えるとしてもよい。
In the above image processing apparatus,
A printing unit that prints the target image on which the deformation of the image in the deformation area is performed may be provided.

このようにすれば、多様な変形態様に対応した画像変形後の画像の印刷を、容易に、かつ効率的に実現することができる。   In this way, it is possible to easily and efficiently realize printing of the image after image deformation corresponding to various deformation modes.

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

本発明の第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 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 of the present 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. 顔領域FAの検出結果の一例を示す説明図である。It is explanatory drawing which shows an example of the detection result of face area FA. 本実施例における顔領域FAの高さ方向の位置調整処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the position adjustment process of the height direction of face area FA in a present Example. 特定領域SAの一例を示す説明図である。It is explanatory drawing which shows an example of specific area | region SA. 評価値の算出方法の一例を示す説明図である。It is explanatory drawing which shows an example of the calculation method of an evaluation value. 評価対象画素TPの選択方法の一例を示す説明図である。It is explanatory drawing which shows an example of the selection method of evaluation object pixel TP. 高さ基準点Rhの決定方法の一例を示す説明図である。It is explanatory drawing which shows an example of the determination method of height reference point Rh. 概略傾き角RIの算出方法の一例を示す説明図である。It is explanatory drawing which shows an example of the calculation method of rough inclination angle RI. 顔領域FAの高さ方向の位置調整方法の一例を示す説明図である。It is explanatory drawing which shows an example of the position adjustment method of the height direction of face area FA. 本実施例における顔領域FAの傾き調整処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the inclination adjustment process of the face area FA in a present Example. 顔領域FAの傾き調整のための評価値の算出方法の一例を示す説明図である。It is explanatory drawing which shows an example of the calculation method of the evaluation value for inclination adjustment of the face area FA. 各評価方向についての評価値の分散の算出結果の一例を示す説明図である。It is explanatory drawing which shows an example of the calculation result of the dispersion | distribution of the evaluation value about each evaluation direction. 顔領域FAの傾き調整方法の一例を示す説明図である。It is explanatory drawing which shows an example of the inclination adjustment method of face area FA. 変形領域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 by a deformation processing 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. 顔形状補正後の対象画像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 the correction image printing process in a present Example. 分割点移動テーブル420の内容の他の一例を示す説明図である。It is explanatory drawing which shows another example of the content of the dividing point movement table. 分割点Dの他の配置方法の一例を示す説明図である。It is explanatory drawing which shows an example of the other arrangement | positioning method of the dividing point. 分割点移動テーブル420の内容の他の一例を示す説明図である。It is explanatory drawing which shows another example of the content of the dividing point movement table. ユーザによる分割点Dの移動態様の指定のためのユーザインターフェースの一例を示す説明図である。It is explanatory drawing which shows an example of the user interface for the designation | designated of the movement aspect of the dividing point D by a user.

次に、本発明の実施の形態を実施例に基づいて以下の順序で説明する。
A.第1実施例:
A−1.画像処理装置の構成:
A−2.顔形状補正印刷処理:
A−3.第1実施例の変形例:
B.その他の変形例:
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. Modification of the first embodiment:
B. Other 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 another device (for example, a digital still camera). Each component of the printer 100 is connected to each other via a bus.

プリンタエンジン160は、印刷データに基づき印刷を行う印刷機構である。カードインターフェース170は、カードスロット172に挿入されたメモリカードMCとの間でデータのやり取りを行うためのインターフェースである。なお、本実施例では、メモリカードMCにRGBデータとしての画像データが格納されており、プリンタ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 the present embodiment, image data as RGB data is stored in the memory card MC, and the printer 100 acquires the image data 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 processing menus and messages 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と、を含んでいる。変形態様設定部210は、指定取得部212を含んでおり、顔領域調整部230は、特定領域設定部232と、評価部234と、決定部236と、を含んでいる。これらの各部の機能については、後述の顔形状補正印刷処理の説明において詳述する。   The face shape correction unit 200 includes, as program modules, a deformation mode setting unit 210, a face region detection unit 220, a face region adjustment unit 230, a deformation region setting unit 240, a deformation region dividing unit 250, and a deformation processing unit 260. And. The deformation mode setting unit 210 includes a designation acquisition unit 212, and the face area adjustment unit 230 includes a specific area setting unit 232, an evaluation unit 234, and a determination unit 236. The functions of these units will be described in detail in the description of the face shape correction printing process described later.

内部メモリ120には、また、分割点配置パターンテーブル410と分割点移動テーブル420とが格納されている。分割点配置パターンテーブル410および分割点移動テーブル420の内容についても、後述の顔形状補正印刷処理の説明において詳述する。   The internal memory 120 also stores a dividing point arrangement pattern table 410 and a dividing point movement table 420. The contents of the dividing point arrangement pattern table 410 and the dividing point movement table 420 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は、画像の一覧表示を含むユーザインターフェースの一例を示す説明図である。なお、本実施例では、画像の一覧表示は、メモリカードMCに格納された画像データ(画像ファイル)に含まれるサムネイル画像を用いて実現される。
A-2. Face shape correction printing process:
The printer 100 prints an image based on the image data 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 this embodiment, the list display of images is realized using thumbnail images included in image data (image files) stored in the memory card MC.

本実施例のプリンタ100は、図2に示すユーザインターフェースにおいて、ユーザにより、1つ(または複数)の画像が選択されると共に通常印刷ボタンが選択されると、選択された画像を通常通り印刷する通常印刷処理を実行する。他方、当該ユーザインターフェースにおいて、ユーザにより、1つ(または複数)の画像が選択されると共に顔形状補正印刷ボタンが選択されると、プリンタ100は、選択された画像について、画像中の顔の形状を補正して補正後の画像を印刷する顔形状補正印刷処理を実行する。   The printer 100 according to this embodiment prints the selected image as usual when one (or a plurality of) images are selected and a normal print button is selected by the user in the user interface shown in FIG. Normal print processing is executed. 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 is selected, the printer 100 determines the shape of the face in the image for the selected image. The face shape correction printing process is executed to correct the image and print the corrected image.

図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).

図4は、本実施例における顔形状補正処理の流れを示すフローチャートである。ステップS110では、顔形状補正部200(図1)が、顔形状補正処理の対象となる対象画像TIを設定する。顔形状補正部200は、図2に示したユーザインターフェースにおいてユーザにより選択された画像を対象画像TIとして設定する。設定された対象画像TIの画像データは、メモリカードMCからカードインターフェース170を介してプリンタ100に取得され、内部メモリ120の所定領域に格納される。   FIG. 4 is a flowchart showing the flow of face shape correction processing in this 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 correcting unit 200 sets an image selected by the user in the user interface shown in FIG. 2 as the target image TI. The set image data 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 the type of image deformation and the degree of image 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 selected and 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 strong (S), medium (M), and weak (W) are preset as options 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 degree of image deformation designated by the user as the degree of image deformation used for actual processing.

なお、本実施例では、後述するように、ユーザによる変形態様の詳細指定が可能となっている。図5に示すユーザインターフェースにおいて、ユーザにより、詳細指定を希望する旨のチェックボックスにチェックが入れられた場合には、後述するように、ユーザによる変形態様の詳細指定がなされる。   In this embodiment, as will be described later, the user can specify details of the deformation mode. In the user interface shown in FIG. 5, when a check box indicating that detailed designation is desired is checked by the user, detailed designation of the deformation mode is performed by the user, as will be described later.

以降では、画像変形のタイプとして顔の形状をシャープにするための変形タイプ「タイプA」が設定され、画像変形の度合いとして程度「中」の度合いが設定され、ユーザによる詳細指定の希望はなかったものとして説明を行う。   Thereafter, the deformation type “type A” for sharpening the face shape is set as the image deformation type, the degree of “medium” is set as the degree of image deformation, and there is no desire for detailed designation by the user. The explanation will be made assuming that

ステップS130(図4)では、顔領域検出部220(図1)が、対象画像TIにおける顔領域FAの検出を行う。ここで、顔領域FAとは、対象画像TI上の画像領域であって、少なくとも顔の一部の画像が含まれる領域を意味している。顔領域検出部220による顔領域FAの検出は、例えばテンプレートを利用したパターンマッチングによる方法(特開2004−318204参照)といった公知の顔検出方法を用いて実行される。   In step S130 (FIG. 4), the face area detection unit 220 (FIG. 1) detects the face area FA in the target image TI. Here, the face area FA is an image area on the target image TI and means an area including at least a partial image of the face. The detection of the face area FA by the face area detection unit 220 is executed using a known face detection method such as a pattern matching method using a template (see Japanese Patent Application Laid-Open No. 2004-318204).

図6は、顔領域FAの検出結果の一例を示す説明図である。図6に示すように、本実施例で用いた顔検出方法によると、対象画像TI上の目と鼻と口の画像を含む矩形の領域が顔領域FAとして検出される。なお、図6に示した基準線RLは、顔領域FAの高さ方向(上下方向)を定義すると共に、顔領域FAの幅方向(左右方向)の中心を示す線である。すなわち、基準線RLは、矩形の顔領域FAの重心を通り、顔領域FAの高さ方向(上下方向)に沿った境界線に平行な直線である。   FIG. 6 is an explanatory diagram showing an example of the detection result of the face area FA. As shown in FIG. 6, according to the face detection method used in the present embodiment, a rectangular area including the eye, nose, and mouth images on the target image TI is detected as the face area FA. Note that the reference line RL shown in FIG. 6 is a line that defines the height direction (vertical direction) of the face area FA and the center in the width direction (horizontal direction) of the face area FA. That is, the reference line RL is a straight line that passes through the center of gravity of the rectangular face area FA and is parallel to the boundary line along the height direction (vertical direction) of the face area FA.

なお、ステップS130の顔領域FAの検出において、顔領域FAが検出されなかった場合には、その旨が表示部150を通じてユーザに通知される。この場合には、顔形状補正を伴わない通常印刷が行われるとしてもよいし、他の顔検出方法を用いた顔領域FAの再度の検出処理が行われるとしてもよい。   If the face area FA is not detected in the detection of the face area FA in step S130, 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 face area FA detection processing using another face detection method may be performed again.

ここで、一般に、テンプレートを利用したパターンマッチングによる方法等の公知の顔検出方法は、顔全体や顔の部位(目や口等)について位置や傾き(角度)を詳細に検出するものではなく、対象画像TI中から顔の画像が概ね含まれると考えられる領域を顔領域FAとして設定するものである。他方、本実施例のプリンタ100は、後述するように、検出された顔領域FAに基づいて顔形状補正のための画像変形処理を施す領域(後述の変形領域TA)を設定する。顔の画像は、一般に、観察者の注目度が高いため、設定された変形領域TAと顔の画像との位置や角度の関係によっては、顔形状補正後の画像が不自然なものとなる可能性がある。そこで、本実施例では、より自然で好ましい顔形状補正が実現されるように、ステップS130で検出された顔領域FAについて、以下に説明する位置調整および傾き調整を行うものとしている。   Here, in general, a known face detection method such as a pattern matching method using a template does not detect in detail the position or inclination (angle) of the entire face or face part (eyes, mouth, etc.) An area that is considered to contain a face image from the target image TI is set as the face area FA. On the other hand, as will be described later, the printer 100 according to the present exemplary embodiment sets an area (deformation area TA described later) to be subjected to image deformation processing for face shape correction based on the detected face area FA. Since the face image generally has a high degree of attention by the observer, the image after the face shape correction may be unnatural depending on the position and angle relationship between the set deformation area TA and the face image. There is sex. Therefore, in this embodiment, the position adjustment and the inclination adjustment described below are performed on the face area FA detected in step S130 so that more natural and preferable face shape correction is realized.

ステップS140(図4)では、顔領域調整部230(図1)が、ステップS130で検出された顔領域FAの高さ方向の位置調整を行う。ここで、顔領域FAの高さ方向の位置調整とは、顔領域FAの基準線RL(図6参照)に沿った位置を調整して、対象画像TIにおける顔領域FAを再設定することを意味している。   In step S140 (FIG. 4), the face area adjustment unit 230 (FIG. 1) adjusts the position of the face area FA detected in step S130 in the height direction. Here, the position adjustment of the face area FA in the height direction means that the position along the reference line RL (see FIG. 6) of the face area FA is adjusted to reset the face area FA in the target image TI. I mean.

図7は、本実施例における顔領域FAの高さ方向の位置調整処理の流れを示すフローチャートである。ステップS141では、特定領域設定部232(図1)が、特定領域SAを設定する。ここで、特定領域SAとは、対象画像TI上の領域であって、顔領域FAの高さ方向の位置調整を実行する際に参照する所定の参照被写体の画像を含む領域である。本実施例では、参照被写体は「目」と設定され、特定領域SAは「目」の画像を含む領域として設定される。   FIG. 7 is a flowchart showing the flow of position adjustment processing in the height direction of the face area FA in the present embodiment. In step S141, the specific area setting unit 232 (FIG. 1) sets the specific area SA. Here, the specific area SA is an area on the target image TI and includes an image of a predetermined reference subject that is referred to when the position adjustment of the face area FA in the height direction is executed. In this embodiment, the reference subject is set to “eyes”, and the specific area SA is set as an area including an image of “eyes”.

図8は、特定領域SAの一例を示す説明図である。本実施例では、特定領域設定部232が、特定領域SAを顔領域FAとの関係に基づいて設定する。具体的には、顔領域FAの大きさを、基準線RLに直行する方向および基準線RLに平行な方向に、所定比率で縮小(または拡大)した大きさの領域であって、顔領域FAの位置と所定の位置関係を有する領域が、特定領域SAとして設定される。すなわち、本実施例では、顔領域検出部220により検出された顔領域FAとの関係に基づき特定領域SAを設定すれば、特定領域SAが両方の目の画像を含む領域となるように、上記所定比率や所定の位置関係が予め設定されている。なお、特定領域SAは、目の画像とまぎらわしい画像(例えば髪の毛の画像)がなるべく含まれないように、両目の画像を含む限りにおいて、なるべく小さい領域として設定されることが好ましい。   FIG. 8 is an explanatory diagram illustrating an example of the specific area SA. In this embodiment, the specific area setting unit 232 sets the specific area SA based on the relationship with the face area FA. Specifically, the face area FA has a size that is reduced (or enlarged) by a predetermined ratio in a direction perpendicular to the reference line RL and a direction parallel to the reference line RL. An area having a predetermined positional relationship with the position is set as the specific area SA. That is, in the present embodiment, when the specific area SA is set based on the relationship with the face area FA detected by the face area detection unit 220, the specific area SA is an area including both eye images. A predetermined ratio and a predetermined positional relationship are set in advance. The specific area SA is preferably set as small as possible as long as the images of both eyes are included so that an image that is confusing with the image of the eyes (for example, an image of the hair) is included as much as possible.

また、図8に示すように、特定領域SAは、基準線RLに対して対称な矩形形状の領域として設定される。特定領域SAは、基準線RLにより、向かって左側の領域(以下「左分割特定領域SA(l)」とも呼ぶ)と、向かって右側の領域(以下「右分割特定領域SA(r)」とも呼ぶ)とに分割される。特定領域SAは、左分割特定領域SA(l)と右分割特定領域SA(r)とのそれぞれに片目の画像が含まれるように設定される。   As shown in FIG. 8, the specific area SA is set as a rectangular area that is symmetrical with respect to the reference line RL. The specific area SA is defined as an area on the left side (hereinafter also referred to as “left divided specific area SA (l)”) and an area on the right side (hereinafter referred to as “right divided specific area SA (r)”) by the reference line RL. Called). The specific area SA is set so that the image of one eye is included in each of the left divided specific area SA (l) and the right divided specific area SA (r).

ステップS142(図7)では、評価部234(図1)が、特定領域SAにおける目の画像の位置を検出するための評価値を算出する。図9は、評価値の算出方法の一例を示す説明図である。本実施例では、RGB画像データとしての対象画像TIの各画素のR値(R成分値)が評価値の算出に用いられる。これは、肌の部分の画像と目の部分の画像とではR値の差が大きいため、R値を評価値の算出に用いることにより、目の画像の検出精度を向上させることができると考えられるからである。また、本実施例では、対象画像TIのデータがRGBデータとして取得されているため、R値を評価値の算出に用いることにより、評価値の算出の効率化を図ることができるからでもある。なお、図9に示すように、評価値の算出は、2つの分割特定領域(右分割特定領域SA(r)および左分割特定領域SA(l))のそれぞれについて個別に行われる。   In step S142 (FIG. 7), the evaluation unit 234 (FIG. 1) calculates an evaluation value for detecting the position of the eye image in the specific area SA. FIG. 9 is an explanatory diagram illustrating an example of an evaluation value calculation method. In this embodiment, the R value (R component value) of each pixel of the target image TI as RGB image data is used for calculation of the evaluation value. This is because the difference in the R value is large between the skin image and the eye image, and thus the detection accuracy of the eye image can be improved by using the R value for calculating the evaluation value. Because it is. In addition, in the present embodiment, since the data of the target image TI is acquired as RGB data, it is possible to increase the efficiency of calculation of the evaluation value by using the R value for calculation of the evaluation value. As shown in FIG. 9, the evaluation value is calculated individually for each of the two divided specific areas (the right divided specific area SA (r) and the left divided specific area SA (l)).

評価部234は、図9に示すように、分割特定領域(右分割特定領域SA(r)および左分割特定領域SA(l))内に、基準線RLと直行するn本の直線(以下「対象画素特定線PL1〜PLn」と呼ぶ)を設定する。対象画素特定線PL1〜PLnは、分割特定領域の高さ(基準線RLに沿った大きさ)を(n+1)等分する直線である。すなわち、対象画素特定線PL同士の間隔は、すべて等間隔sである。   As shown in FIG. 9, the evaluation unit 234 includes n straight lines (hereinafter referred to as “the right divided specific area SA (r) and the left divided specific area SA (l)) that are orthogonal to the reference line RL. Target pixel specifying lines PL1 to PLn ”). The target pixel specifying lines PL1 to PLn are straight lines that equally divide the height (the size along the reference line RL) of the divided specific region into (n + 1). That is, the intervals between the target pixel specifying lines PL are all equal intervals s.

評価部234は、対象画素特定線PL1〜PLnのそれぞれについて、対象画像TIを構成する画素の中から評価値の算出に用いる画素(以下「評価対象画素TP」と呼ぶ)を選択する。図10は、評価対象画素TPの選択方法の一例を示す説明図である。評価部234は、対象画像TIを構成する画素の内、対象画素特定線PLと重なる画素を評価対象画素TPとして選択する。図10(a)は、対象画素特定線PLが対象画像TIの画素の行方向(図10のX方向)と平行である場合を示している。この場合には、各対象画素特定線PLと重なる画素行上の画素(図10(a)において○印を付した画素)が、各対象画素特定線PLについての評価対象画素TPとして選択される。   For each of the target pixel specifying lines PL1 to PLn, the evaluation unit 234 selects a pixel (hereinafter referred to as “evaluation target pixel TP”) that is used to calculate an evaluation value from the pixels constituting the target image TI. FIG. 10 is an explanatory diagram illustrating an example of a method for selecting the evaluation target pixel TP. The evaluation unit 234 selects, as the evaluation target pixel TP, a pixel that overlaps the target pixel specifying line PL among the pixels constituting the target image TI. FIG. 10A shows a case where the target pixel specifying line PL is parallel to the row direction (X direction in FIG. 10) of the pixels of the target image TI. In this case, the pixel on the pixel row that overlaps with each target pixel specifying line PL (the pixel marked with a circle in FIG. 10A) is selected as the evaluation target pixel TP for each target pixel specifying line PL. .

一方、顔領域FAの検出方法や特定領域SAの設定方法によっては、図10(b)に示すように、対象画素特定線PLが対象画像TIの画素の行方向(X方向)と平行とはならない場合も生ずる。このような場合にも、原則として、各対象画素特定線PLと重なる画素が、各対象画素特定線PLについての評価対象画素TPとして選択される。ただし、例えば図10(b)における対象画素特定線PL1と画素PXaおよびPXbとの関係のように、ある対象画素特定線PLが、対象画像TIの画素マトリクスの同一列に位置する(すなわちY座標が同一の)2つの画素と重なる場合には、重なり部分の距離のより短い方の画素(例えば画素PXb)は評価対象画素TPから除外される。すなわち、各対象画素特定線PLについて、画素マトリクスの1つの列からは1つの画素のみが評価対象画素TPとして選択される。   On the other hand, depending on the detection method of the face area FA and the setting method of the specific area SA, as shown in FIG. 10B, the target pixel specific line PL is parallel to the row direction (X direction) of the pixels of the target image TI. There may be cases where this is not possible. Even in such a case, in principle, a pixel that overlaps each target pixel specifying line PL is selected as the evaluation target pixel TP for each target pixel specifying line PL. However, for example, as in the relationship between the target pixel specifying line PL1 and the pixels PXa and PXb in FIG. 10B, a certain target pixel specifying line PL is located in the same column of the pixel matrix of the target image TI (that is, the Y coordinate). In the case where two pixels overlap with each other, the pixel having the shorter overlap distance (for example, the pixel PXb) is excluded from the evaluation target pixel TP. That is, for each target pixel specifying line PL, only one pixel is selected as the evaluation target pixel TP from one column of the pixel matrix.

なお、対象画素特定線PLの傾きが、X方向に対して45度を超える場合には、上記説明において画素マトリクスの列と行との関係が逆転し、画素マトリクスの1つの行から1つの画素のみが評価対象画素TPとして選択されることとなる。また、対象画像TIと特定領域SAとの大きさの関係によっては、1つの画素が複数の対象画素特定線PLについての評価対象画素TPとして選択される場合もある。   When the inclination of the target pixel specifying line PL exceeds 45 degrees with respect to the X direction, the relationship between the column and the row of the pixel matrix is reversed in the above description, and one pixel from one row of the pixel matrix is reversed. Only the pixel to be evaluated TP is selected. Further, depending on the size relationship between the target image TI and the specific area SA, one pixel may be selected as the evaluation target pixel TP for a plurality of target pixel specific lines PL.

評価部234は、対象画素特定線PLのそれぞれについて、評価対象画素TPのR値の平均値を評価値として算出する。ただし、本実施例では、各対象画素特定線PLについて、選択された複数の評価対象画素TPの内、R値の大きい一部の画素を評価値の算出対象から除外するものとしている。具体的には、例えば、ある対象画素特定線PLについてk個の評価対象画素TPが選択された場合、評価対象画素TPが、R値の比較的大きい0.75k個の画素により構成される第1グループと、比較的R値の小さい0.25k個の画素により構成される第2グループとの2グループに分けられ、第2グループに属する画素のみが評価値としてのR値の平均値の算出対象となる。このように一部の評価対象画素TPを評価値の算出対象から除外する理由については後述する。   The evaluation unit 234 calculates an average value of R values of the evaluation target pixels TP as an evaluation value for each of the target pixel specifying lines PL. However, in this embodiment, for each target pixel specifying line PL, out of the plurality of selected evaluation target pixels TP, some pixels having a large R value are excluded from the evaluation value calculation target. Specifically, for example, when k evaluation target pixels TP are selected for a certain target pixel specifying line PL, the evaluation target pixel TP includes a 0.75k pixel having a relatively large R value. An average value of R values as an evaluation value is calculated only for pixels that are divided into two groups, one group and a second group composed of 0.25k pixels having a relatively small R value. It becomes a target. The reason why some of the evaluation target pixels TP are excluded from the evaluation value calculation target will be described later.

以上のように、本実施例では、評価部234により各対象画素特定線PLについての評価値が算出される。ここで、対象画素特定線PLは基準線RLに直行する直線であるため、評価値は、基準線RLに沿った複数の位置(評価位置)について算出されると表現することができる。また、評価値は、各評価位置について、基準線RLに直行する方向に沿った画素値の分布の特徴を表す値と表現することができる。   As described above, in this embodiment, the evaluation value for each target pixel specifying line PL is calculated by the evaluation unit 234. Here, since the target pixel specifying line PL is a straight line orthogonal to the reference line RL, the evaluation value can be expressed as being calculated for a plurality of positions (evaluation positions) along the reference line RL. In addition, the evaluation value can be expressed as a value representing the feature of the distribution of pixel values along the direction orthogonal to the reference line RL for each evaluation position.

ステップS143(図7)では、決定部236(図1)が、特定領域SAにおける目の位置を検出し、検出結果に基づき高さ基準点Rhを決定する。まず、決定部236は、図9の右側に示すように、各分割特定領域について、基準線RLに沿った評価値(R値の平均値)の分布を表す曲線を作成し、評価値が極小値をとる基準線RL方向に沿った位置を目の位置Ehとして検出する。なお、左分割特定領域SA(l)における目の位置EhをEh(l)と表し、右分割特定領域SA(r)における目の位置EhをEh(r)と表わす。   In step S143 (FIG. 7), the determination unit 236 (FIG. 1) detects the position of the eye in the specific area SA, and determines the height reference point Rh based on the detection result. First, as shown on the right side of FIG. 9, the determination unit 236 creates a curve representing the distribution of evaluation values (average value of R values) along the reference line RL for each divided specific region, and the evaluation value is minimal. A position along the direction of the reference line RL taking a value is detected as the eye position Eh. The eye position Eh in the left divided specific area SA (l) is represented as Eh (l), and the eye position Eh in the right divided specific area SA (r) is represented as Eh (r).

黄色人種の場合、分割特定領域中の肌の画像を表す部分はR値が大きい一方、目(より詳細には目の中央の黒目部分)の画像を表す部分はR値が小さいと考えられる。そのため、上述のように、評価値(R値の平均値)が極小値をとる基準線RLに沿った位置を目の位置Ehと判断することが可能となる。   In the case of the yellow race, the portion representing the skin image in the divided specific region has a large R value, while the portion representing the image of the eye (more specifically, the black eye portion at the center of the eye) has a small R value. . Therefore, as described above, the position along the reference line RL where the evaluation value (average value of R values) takes the minimum value can be determined as the eye position Eh.

なお、図9に示すように、分割特定領域には、目の画像以外にもR値の小さい他の画像(例えば、眉や髪の毛の画像)が含まれている場合もある。そのため、決定部236は、基準線RLに沿った評価値の分布を表す曲線が複数の極小値をとる場合には、極小値をとる位置の内、最も下側の位置を目の位置Ehと判断する。一般に、目の画像より上側には眉や髪の毛等のR値の小さい画像が位置することが多い一方、目の画像より下側にはR値の小さい画像が位置することが少ないと考えられることから、このような判断が可能となる。   As illustrated in FIG. 9, the divided specific region may include other images having a small R value (for example, images of eyebrows and hairs) in addition to the eye image. Therefore, when the curve representing the distribution of evaluation values along the reference line RL has a plurality of minimum values, the determination unit 236 selects the lowest position among the positions where the minimum values are taken as the eye position Eh. to decide. In general, an image with a small R value, such as eyebrows or hair, is often located above the eye image, while an image with a small R value is less likely to be located below the eye image. Therefore, such a determination becomes possible.

また、上記曲線が、目の画像の位置よりも下側(主に肌の画像に対応した位置)であっても、評価値が大きいながらも極小値をとる可能性があるため、極小値の内、所定の閾値より大きいものは無視するものとしてもよい。あるいは、単純に、各対象画素特定線PLについて算出された評価値の内の最小値に対応した対象画素特定線PLの位置を目の位置Ehとしてもよい。   Even if the curve is below the position of the eye image (mainly the position corresponding to the image of the skin), the evaluation value is large, but may have a minimum value. Of these, those larger than a predetermined threshold may be ignored. Alternatively, the position of the target pixel specifying line PL corresponding to the minimum value among the evaluation values calculated for each target pixel specifying line PL may be simply set as the eye position Eh.

なお、本実施例では、顔において周囲との色の差が比較的大きいと考えられる部位である目(目の中央の黒目部分)を顔領域FAの位置調整の参照被写体として用いている。しかし、評価値としてのR値の平均値は、対象画素特定線PL上の複数の評価対象画素TPを対象として算出されるため、例えば、黒目の周縁の白目部分の画像の影響により、黒目部分の検出の精度が低下する怖れがある。本実施例では、上述したように、参照被写体とは色の差が大きいと考えられる一部の評価対象画素TP(例えば上述した第1のグループに属する比較的R値の大きい画素)を評価値の算出対象から除外することにより、参照被写体の検出精度をより向上させている。   In the present embodiment, the eye (the black eye part at the center of the eye), which is considered to be a part where the color difference between the face and the surroundings is relatively large, is used as a reference subject for position adjustment of the face area FA. However, since the average value of the R values as the evaluation values is calculated for a plurality of evaluation target pixels TP on the target pixel specifying line PL, for example, due to the influence of the image of the white part of the periphery of the black eye, the black eye part There is a fear that the accuracy of detection will be reduced. In the present embodiment, as described above, some evaluation target pixels TP (for example, pixels having a relatively large R value belonging to the first group described above) that are considered to have a large color difference from the reference subject are evaluated values. Is excluded from the calculation target, the reference subject detection accuracy is further improved.

次に、決定部236は、検出された目の位置Ehに基づき高さ基準点Rhを決定する。図11は、高さ基準点Rhの決定方法の一例を示す説明図である。高さ基準点Rhは、顔領域FAの高さ方向の位置調整の際に、基準として用いられる点である。本実施例では、図11に示すように、左右2つの目の位置Eh(l)およびEh(r)の中間に位置する基準線RL上の点が高さ基準点Rhとして設定される。すなわち、左の目の位置Eh(l)を示す直線EhL(l)と基準線RLとの交点と、右の目の位置Eh(r)を示す直線EhL(r)と基準線RLとの交点と、の中点が、高さ基準点Rhとして設定される。   Next, the determination unit 236 determines the height reference point Rh based on the detected eye position Eh. FIG. 11 is an explanatory diagram illustrating an example of a method for determining the height reference point Rh. The height reference point Rh is a point used as a reference when adjusting the position of the face area FA in the height direction. In the present embodiment, as shown in FIG. 11, a point on the reference line RL located in the middle between the positions Eh (l) and Eh (r) of the two left and right eyes is set as the height reference point Rh. That is, the intersection of the straight line EhL (l) indicating the left eye position Eh (l) and the reference line RL, and the intersection of the straight line EhL (r) indicating the right eye position Eh (r) and the reference line RL. The midpoint is set as the height reference point Rh.

なお、本実施例では、決定部236が、検出された目の位置Ehに基づき、顔画像の概略の傾き角(以下「概略傾き角RI」と呼ぶ)を算出するものとしている。顔画像の概略傾き角RIは、対象画像TI中の顔の画像が、顔領域FAの基準線RLに対して概ねどれぐらい傾いているかを推定した角度である。図12は、概略傾き角RIの算出方法の一例を示す説明図である。図12に示すように、決定部236は、まず、左分割特定領域SA(l)の幅Ws(l)を半分に分割する直線と直線EhL(l)との交点IP(l)と、右分割特定領域SA(r)の幅Ws(r)を半分に分割する直線と直線EhL(r)との交点IP(r)とを決定する。そして、交点IP(l)と交点IP(r)とを結ぶ直線に直交する直線ILと、基準線RLとのなす角が、概略傾き角RIとして算出される。   In the present embodiment, the determination unit 236 calculates the approximate inclination angle of the face image (hereinafter referred to as “approximate inclination angle RI”) based on the detected eye position Eh. The approximate inclination angle RI of the face image is an angle obtained by estimating how much the face image in the target image TI is inclined with respect to the reference line RL of the face area FA. FIG. 12 is an explanatory diagram showing an example of a method for calculating the approximate inclination angle RI. As shown in FIG. 12, the determination unit 236 first determines the intersection IP (l) between the straight line EhL (l) and the straight line that divides the width Ws (l) of the left divided specific area SA (l) in half, and the right A straight line that divides the width Ws (r) of the divided specific area SA (r) in half and an intersection IP (r) of the straight line EhL (r) are determined. Then, an angle formed by the straight line IL orthogonal to the straight line connecting the intersection point IP (l) and the intersection point IP (r) and the reference line RL is calculated as the approximate inclination angle RI.

ステップS144(図7)では、顔領域調整部230(図1)が、顔領域FAの高さ方向の位置調整を行う。図13は、顔領域FAの高さ方向の位置調整方法の一例を示す説明図である。顔領域FAの高さ方向の位置調整は、高さ基準点Rhが、位置調整後の顔領域FAにおける所定の位置に位置することとなるように、顔領域FAを再設定することにより行う。具体的には、図13に示すように、高さ基準点Rhが、顔領域FAの高さHfを所定の比率r1対r2で分けるような位置に位置することとなるように、顔領域FAが基準線RLに沿って上下に位置調整される。図13の例では、破線で示した調整前の顔領域FAを上方向に移動することにより、実線で示した調整後の顔領域FAが再設定されている。   In step S144 (FIG. 7), the face area adjustment unit 230 (FIG. 1) adjusts the position of the face area FA in the height direction. FIG. 13 is an explanatory diagram showing an example of a method for adjusting the position of the face area FA in the height direction. The position adjustment of the face area FA in the height direction is performed by resetting the face area FA so that the height reference point Rh is positioned at a predetermined position in the face area FA after the position adjustment. Specifically, as shown in FIG. 13, the face area FA is such that the height reference point Rh is located at a position where the height Hf of the face area FA is divided by a predetermined ratio r1 to r2. Is vertically adjusted along the reference line RL. In the example of FIG. 13, the adjusted face area FA indicated by the solid line is reset by moving the face area FA before adjustment indicated by the broken line upward.

顔領域FAの位置調整の後、ステップS150(図4)では、顔領域調整部230(図1)が、顔領域FAの傾き調整(角度調整)を行う。ここで、顔領域FAの傾き調整とは、対象画像TIにおける顔領域FAの傾きを顔の画像の傾きに適合するように調整して、顔領域FAを再設定することを意味している。本実施例では、顔領域FAの傾き調整を実行する際に参照する所定の参照被写体は、「両目」と設定されている。本実施例における顔領域FAの傾き調整では、傾き調整の調整角度の選択肢を表す複数の評価方向が設定され、各評価方向に対応した評価特定領域ESAが両目の画像を含む領域として設定される。そして、各評価方向について評価特定領域ESAの画像の画素値に基づき評価値が算出され、評価値に基づき決定される傾き調整の調整角度を用いて顔領域FAの傾きが調整される。   After the position adjustment of the face area FA, in step S150 (FIG. 4), the face area adjustment unit 230 (FIG. 1) performs inclination adjustment (angle adjustment) of the face area FA. Here, the tilt adjustment of the face area FA means that the face area FA is adjusted by adjusting the tilt of the face area FA in the target image TI to match the tilt of the face image, and the face area FA is reset. In the present embodiment, the predetermined reference subject that is referred to when the inclination adjustment of the face area FA is executed is set to “both eyes”. In the inclination adjustment of the face area FA in the present embodiment, a plurality of evaluation directions representing adjustment angle adjustment options for inclination adjustment are set, and the evaluation specific area ESA corresponding to each evaluation direction is set as an area including the images of both eyes. . Then, an evaluation value is calculated based on the pixel value of the image in the evaluation specific area ESA for each evaluation direction, and the inclination of the face area FA is adjusted using the adjustment angle of the inclination adjustment determined based on the evaluation value.

図14は、本実施例における顔領域FAの傾き調整処理の流れを示すフローチャートである。また、図15は、顔領域FAの傾き調整のための評価値の算出方法の一例を示す説明図である。ステップS151(図14)では、特定領域設定部232(図1)が、初期評価特定領域ESA(0)を設定する。初期評価特定領域ESA(0)は、顔領域FAの位置調整後の基準線RL(図13参照)と平行な方向(以下「初期評価方向」とも呼ぶ)に対応付けられた評価特定領域ESAである。本実施例では、位置調整後の顔領域FAに対応した特定領域SA(図13参照)が、そのまま初期評価特定領域ESA(0)として設定される。なお、顔領域FAの傾き調整における評価特定領域ESAは、顔領域FAの位置調整時の特定領域SAとは異なり、左右2つの領域に分割されることはない。図15の最上段には、設定された初期評価特定領域ESA(0)が示されている。   FIG. 14 is a flowchart illustrating the flow of the inclination adjustment processing of the face area FA in the present embodiment. FIG. 15 is an explanatory diagram showing an example of an evaluation value calculation method for adjusting the inclination of the face area FA. In step S151 (FIG. 14), the specific area setting unit 232 (FIG. 1) sets the initial evaluation specific area ESA (0). The initial evaluation specific area ESA (0) is an evaluation specific area ESA associated with a direction (hereinafter also referred to as “initial evaluation direction”) parallel to the reference line RL (see FIG. 13) after the position adjustment of the face area FA. is there. In the present embodiment, the specific area SA (see FIG. 13) corresponding to the face area FA after position adjustment is set as the initial evaluation specific area ESA (0) as it is. Note that the evaluation specific area ESA in the adjustment of the inclination of the face area FA is not divided into two areas on the left and right, unlike the specific area SA in the position adjustment of the face area FA. The set initial evaluation specific area ESA (0) is shown in the uppermost part of FIG.

ステップS152(図14)では、特定領域設定部232(図1)が、複数の評価方向と各評価方向に対応した評価特定領域ESAとを設定する。複数の評価方向は、傾き調整の調整角度の選択肢を表す方向として設定される。本実施例では、基準線RLとのなす角が所定の範囲内である複数の評価方向線ELが設定され、評価方向線ELと平行な方向が評価方向として設定される。図15に示すように、基準線RLを初期評価特定領域ESA(0)の中心点(重心)CPを中心として反時計回りおよび時計回りに所定の角度α刻みで回転させることにより定まる直線が、複数の評価方向線ELとして設定される。なお、基準線RLとのなす角がφ度である評価方向線ELをEL(φ)と表す。   In step S152 (FIG. 14), the specific area setting unit 232 (FIG. 1) sets a plurality of evaluation directions and evaluation specific areas ESA corresponding to the respective evaluation directions. The plurality of evaluation directions are set as directions representing options of adjustment angles for tilt adjustment. In this embodiment, a plurality of evaluation direction lines EL whose angles with the reference line RL are within a predetermined range are set, and a direction parallel to the evaluation direction line EL is set as the evaluation direction. As shown in FIG. 15, a straight line determined by rotating the reference line RL counterclockwise and clockwise around the center point (center of gravity) CP of the initial evaluation specific area ESA (0) at a predetermined angle α, It is set as a plurality of evaluation direction lines EL. Note that the evaluation direction line EL whose angle with the reference line RL is φ degrees is represented as EL (φ).

本実施例では、上述した各評価方向線ELと基準線RLとのなす角についての所定の範囲は±20度と設定される。ここで本明細書では、基準線RLを時計回りに回転させたときの回転角は正の値で表され、基準線RLを反時計回りに回転させたときの回転角は負の値で表される。特定領域設定部232は、基準線RLを反時計回りおよび時計回りにα度、2α度・・・と20度を超えない範囲で回転角を増加させつつ回転させ、複数の評価方向線ELを設定する。図15には、基準線RLを−α度,−2α度,α度回転させることによりそれぞれ定まる評価方向線EL(EL(−α),EL(−2α),EL(α))が示されている。なお、基準線RLは、評価方向線EL(0)とも表現できる。   In the present embodiment, the predetermined range for the angle formed by each evaluation direction line EL and the reference line RL is set to ± 20 degrees. Here, in this specification, the rotation angle when the reference line RL is rotated clockwise is represented by a positive value, and the rotation angle when the reference line RL is rotated counterclockwise is represented by a negative value. Is done. The specific area setting unit 232 rotates the reference line RL counterclockwise and clockwise while increasing the rotation angle within a range not exceeding α degrees, 2α degrees,..., 20 degrees, and a plurality of evaluation direction lines EL. Set. FIG. 15 shows evaluation direction lines EL (EL (−α), EL (−2α), EL (α)) determined by rotating the reference line RL by −α degrees, −2α degrees, and α degrees, respectively. ing. The reference line RL can also be expressed as an evaluation direction line EL (0).

各評価方向を表す評価方向線ELに対応した評価特定領域ESAは、初期評価特定領域ESA(0)を、中心点CPを中心として、評価方向線ELの設定時の回転角と同じ角度で回転させた領域である。評価方向線EL(φ)に対応した評価特定領域ESAは、評価特定領域ESA(φ)と表される。図15には、評価方向線EL(−α),EL(−2α),EL(α)のそれぞれに対応した評価特定領域ESA(ESA(−α),ESA(−2α),ESA(α))が示されている。なお、初期評価特定領域ESA(0)も評価特定領域ESAの1つとして扱われるものとする。   The evaluation specific area ESA corresponding to the evaluation direction line EL representing each evaluation direction rotates the initial evaluation specific area ESA (0) around the center point CP at the same angle as the rotation angle when setting the evaluation direction line EL. This is the area that was The evaluation specific area ESA corresponding to the evaluation direction line EL (φ) is represented as the evaluation specific area ESA (φ). FIG. 15 shows evaluation specific areas ESA (ESA (−α), ESA (−2α), ESA (α) corresponding to the evaluation direction lines EL (−α), EL (−2α), and EL (α), respectively. )It is shown. Note that the initial evaluation specific area ESA (0) is also treated as one of the evaluation specific areas ESA.

ステップS153(図14)では、評価部234(図1)が、設定された複数の評価方向のそれぞれについて、評価特定領域ESAの画像の画素値に基づき評価値を算出する。本実施例では、顔領域FAの傾き調整における評価値として、上述した顔領域FAの位置調整における評価値と同様に、R値の平均値が用いられる。評価部234は、評価方向に沿った複数の評価位置についての評価値を算出する。   In step S153 (FIG. 14), the evaluation unit 234 (FIG. 1) calculates an evaluation value for each of the set plurality of evaluation directions based on the pixel value of the image in the evaluation specific area ESA. In the present embodiment, the average value of the R values is used as the evaluation value in the adjustment of the inclination of the face area FA, similarly to the evaluation value in the position adjustment of the face area FA described above. The evaluation unit 234 calculates evaluation values for a plurality of evaluation positions along the evaluation direction.

評価値の算出方法は、上述した顔領域FAの位置調整における評価値の算出方法と同様である。すなわち、評価部234は、図15に示すように、各評価特定領域ESA内に、評価方向線ELに直交する対象画素特定線PL1〜PLnを設定し、各対象画素特定線PL1〜PLnについて評価対象画素TPを選択し、選択された評価対象画素TPのR値の平均値を評価値として算出する。   The evaluation value calculation method is the same as the evaluation value calculation method in the position adjustment of the face area FA described above. That is, as shown in FIG. 15, the evaluation unit 234 sets target pixel specifying lines PL1 to PLn orthogonal to the evaluation direction line EL in each evaluation specifying area ESA, and evaluates each target pixel specifying line PL1 to PLn. The target pixel TP is selected, and an average value of R values of the selected evaluation target pixel TP is calculated as an evaluation value.

評価特定領域ESAにおける対象画素特定線PLの設定方法や評価対象画素TPの選択方法は、領域を左右に分割するか否かの違いはあるものの、図9および図10に示した顔領域FAの位置調整における方法と同様である。なお、顔領域FAの位置調整時と同様に、選択された評価対象画素TPの内の一部(例えばk個の評価対象画素TPの内のR値の比較的大きい0.75k個の画素)を評価値の算出対象から除外するとしてもよい。図15の右側には、各評価方向について、算出された評価値の評価方向線ELに沿った分布を示している。   The method for setting the target pixel specifying line PL and the method for selecting the evaluation target pixel TP in the evaluation specific area ESA are different depending on whether or not the area is divided into left and right, but the face area FA shown in FIGS. This is the same as the method for position adjustment. As in the position adjustment of the face area FA, a part of the selected evaluation target pixels TP (for example, 0.75k pixels having a relatively large R value among the k evaluation target pixels TP). May be excluded from the evaluation value calculation target. The right side of FIG. 15 shows the distribution of the calculated evaluation values along the evaluation direction line EL for each evaluation direction.

なお、対象画素特定線PLは評価方向線ELに直行する直線であるため、評価値は、評価方向線ELに沿った複数の位置(評価位置)について算出されると表現することができる。また、評価値は、各評価位置について、評価方向線ELに直行する方向に沿った画素値の分布の特徴を表す値と表現することができる。   In addition, since the target pixel specifying line PL is a straight line orthogonal to the evaluation direction line EL, it can be expressed that the evaluation value is calculated for a plurality of positions (evaluation positions) along the evaluation direction line EL. In addition, the evaluation value can be expressed as a value representing the feature of the distribution of pixel values along the direction orthogonal to the evaluation direction line EL for each evaluation position.

ステップS154(図14)では、決定部236(図1)が、顔領域FAの傾き調整に用いる調整角度を決定する。決定部236は、各評価方向について、ステップS153において算出された評価値の評価方向線ELに沿った分散を算出し、分散の値が最大となる評価方向を選択する。そして、選択された評価方向に対応した評価方向線ELと基準線RLとのなす角を、傾き調整に用いる調整角度として決定する。   In step S154 (FIG. 14), the determination unit 236 (FIG. 1) determines an adjustment angle used for adjusting the inclination of the face area FA. The determining unit 236 calculates the variance along the evaluation direction line EL of the evaluation value calculated in step S153 for each evaluation direction, and selects the evaluation direction that maximizes the variance value. Then, an angle formed by the evaluation direction line EL corresponding to the selected evaluation direction and the reference line RL is determined as an adjustment angle used for tilt adjustment.

図16は、各評価方向についての評価値の分散の算出結果の一例を示す説明図である。図16の例では、回転角が−α度である評価方向において、分散が最大値Vmaxをとる。従って、−α度、すなわち反時計回りにα度の回転角が、顔領域FAの傾き調整に用いる調整角度として決定される。   FIG. 16 is an explanatory diagram illustrating an example of a calculation result of variance of evaluation values for each evaluation direction. In the example of FIG. 16, the variance takes the maximum value Vmax in the evaluation direction where the rotation angle is −α degrees. Therefore, a rotation angle of −α degrees, that is, α degrees counterclockwise is determined as an adjustment angle used for adjusting the inclination of the face area FA.

評価値の分散の値が最大となるときの評価方向に対応した角度が傾き調整に用いる調整角度として決定される理由について説明する。図15の上から2段目に示すように、回転角が−α度であるときの評価特定領域ESA(−α)では、左右の目の中央部(黒目部分)の画像が、概ね対象画素特定線PLに平行な方向(すなわち評価方向線ELに直行する方向)に並ぶような配置となっている。また、このときには、左右の眉の画像も同様に、概ね評価方向線ELに直行する方向に並ぶような配置となる。従って、このときの評価方向線ELに対応した評価方向が、概ね顔の画像の傾きを表す方向であると考えられる。このときには、一般にR値が小さい目や眉の画像と一般にR値が大きい肌の部分の画像との位置関係が、対象画素特定線PLの方向に沿って両者が重なる部分の小さい位置関係となる。そのため、目や眉の画像の位置における評価値は比較的小さくなり、肌の部分の画像の位置における評価値は比較的大きくなる。従って、評価方向線ELに沿った評価値の分布は、図15に示すように、比較的ばらつきの大きい(振幅の大きい)分布となり、分散の値は大きくなる。   The reason why the angle corresponding to the evaluation direction when the variance of the evaluation values is maximized is determined as the adjustment angle used for the inclination adjustment will be described. As shown in the second row from the top in FIG. 15, in the evaluation specific area ESA (−α) when the rotation angle is −α degrees, the image of the central portion (black-eye portion) of the left and right eyes is substantially the target pixel. The arrangement is arranged in a direction parallel to the specific line PL (that is, a direction perpendicular to the evaluation direction line EL). At this time, the left and right eyebrow images are similarly arranged in a direction substantially perpendicular to the evaluation direction line EL. Therefore, the evaluation direction corresponding to the evaluation direction line EL at this time is considered to be a direction that generally represents the inclination of the face image. At this time, the positional relationship between the image of the eye or eyebrow generally having a small R value and the image of the skin portion generally having a large R value is a small positional relationship of the overlapping portion along the direction of the target pixel specifying line PL. . For this reason, the evaluation value at the position of the image of the eyes and eyebrows is relatively small, and the evaluation value at the position of the image of the skin portion is relatively large. Therefore, as shown in FIG. 15, the distribution of evaluation values along the evaluation direction line EL is a distribution with relatively large variation (amplitude is large), and the variance value is large.

一方、図15中の最上段および3段目、4段目に示すように、回転角が0度,−2α度,α度であるときの評価特定領域ESA(0),ESA(−2α),ESA(α)では、左右の目の中央部や左右の眉の画像が、評価方向線ELに直行する方向に並ばず、ずれた配置となっている。従って、このときの評価方向線ELに対応した評価方向は、顔の画像の傾きを表していはいない。このときには、目や眉の画像と肌の部分の画像との位置関係が、対象画素特定線PLの方向に沿って両者が重なる部分の大きい位置関係となる。そのため、評価方向線ELに沿った評価値の分布は、図15に示すように、比較的ばらつきの小さい(振幅の小さい)分布となり、分散の値は小さくなる。   On the other hand, as shown in the uppermost stage, the third stage, and the fourth stage in FIG. 15, the evaluation specific areas ESA (0), ESA (-2α) when the rotation angles are 0 degree, −2α degree, and α degree. , ESA (α), the center portions of the left and right eyes and the images of the left and right eyebrows are not aligned in a direction perpendicular to the evaluation direction line EL, but are shifted from each other. Therefore, the evaluation direction corresponding to the evaluation direction line EL at this time does not represent the inclination of the face image. At this time, the positional relationship between the image of the eyes and eyebrows and the image of the skin portion is a large positional relationship of the portion where both overlap along the direction of the target pixel specifying line PL. Therefore, the distribution of evaluation values along the evaluation direction line EL is a distribution with relatively small variation (small amplitude) as shown in FIG. 15, and the value of variance is small.

以上のように、評価方向が顔の画像の傾きの方向に近い場合には、評価方向線ELに沿った評価値の分散の値が大きくなり、評価方向が顔の画像の傾きの方向から遠い場合には、評価方向線ELに沿った評価値の分散の値が小さくなる。従って、評価値の分散の値が最大となるときの評価方向に対応した角度を傾き調整に用いる調整角度として決定すれば、顔領域FAの傾きが顔の画像の傾きに適合するような顔領域FAの傾き調整を実現することができる。   As described above, when the evaluation direction is close to the inclination direction of the face image, the evaluation value variance along the evaluation direction line EL is large, and the evaluation direction is far from the inclination direction of the face image. In this case, the variance of the evaluation values along the evaluation direction line EL becomes small. Therefore, if the angle corresponding to the evaluation direction when the variance of the evaluation values is maximized is determined as the adjustment angle used for the inclination adjustment, the face area in which the inclination of the face area FA matches the inclination of the face image. FA tilt adjustment can be realized.

なお本実施例では、評価値の分散の算出結果が、角度の範囲の臨界値、すなわち−20度または20度において最大値をとるような結果となった場合には、顔の傾きが正確に評価されていない可能性が高いと考えられるため、顔領域FAの傾き調整を行わないものとしている。   In this embodiment, when the calculation result of evaluation value variance is a critical value in the range of angles, that is, a result that takes a maximum value at −20 degrees or 20 degrees, the inclination of the face is accurate. Since it is considered that there is a high possibility that it has not been evaluated, the inclination adjustment of the face area FA is not performed.

また本実施例では、決定された調整角度が、上述した顔領域FAの位置調整の際に算出された概略傾き角RIと比較される。調整角度と概略傾き角RIとの差が所定の閾値より大きい場合には、顔領域FAの位置調整および傾き調整における評価や決定の際に何らかの誤りが発生したと考えられるため、顔領域FAの位置調整および傾き調整を行わないものとしている。   In the present embodiment, the determined adjustment angle is compared with the approximate inclination angle RI calculated at the time of adjusting the position of the face area FA described above. If the difference between the adjustment angle and the approximate inclination angle RI is larger than a predetermined threshold value, it is considered that some error has occurred during the evaluation and determination in the position adjustment and inclination adjustment of the face area FA. Position adjustment and tilt adjustment are not performed.

ステップS155(図14)では、顔領域調整部230(図1)が、顔領域FAの傾き調整を行う。図17は、顔領域FAの傾き調整方法の一例を示す説明図である。顔領域FAの傾き調整は、顔領域FAを、初期評価特定領域ESA(0)の中心点CPを中心に、ステップS154において決定された調整角度だけ回転させることにより行う。図17の例では、破線で示した調整前の顔領域FAを反時計回りにα度回転させることにより、実線で示した調整後の顔領域FAが設定される。   In step S155 (FIG. 14), the face area adjustment unit 230 (FIG. 1) adjusts the inclination of the face area FA. FIG. 17 is an explanatory diagram showing an example of a method for adjusting the inclination of the face area FA. The tilt adjustment of the face area FA is performed by rotating the face area FA about the center point CP of the initial evaluation specific area ESA (0) by the adjustment angle determined in step S154. In the example of FIG. 17, the adjusted face area FA indicated by the solid line is set by rotating the face area FA before adjustment indicated by the broken line by α degrees counterclockwise.

顔領域FAの傾き調整終了後のステップS160(図4)では、変形領域設定部240(図1)が、変形領域TAを設定する。変形領域TAは、対象画像TI上の領域であって顔形状補正のための画像変形処理の対象となる領域である。図18は、変形領域TAの設定方法の一例を示す説明図である。図18に示すように、本実施例では、変形領域TAは、顔領域FAを基準線RLと平行な方向(高さ方向)および基準線RLに直行する方向(幅方向)に伸張(または短縮)した領域として設定される。具体的には、顔領域FAの高さ方向の大きさをHf、幅方向の大きさをWfとすると、顔領域FAを、上方向にk1・Hf、下方向にk2・Hfだけ伸ばすと共に、左右にそれぞれk3・Wfだけ伸ばした領域が、変形領域TAとして設定される。なお、k1,k2,k3は、所定の係数である。   In step S160 (FIG. 4) after completion of the inclination adjustment of the face area FA, the deformation area setting unit 240 (FIG. 1) 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. 18 is an explanatory diagram illustrating an example of a method for setting the deformation area TA. As shown in FIG. 18, in this embodiment, the deformation area TA extends (or shortens) the face area FA in a direction (height direction) parallel to the reference line RL and a direction (width direction) perpendicular to the reference line RL. ). Specifically, assuming that the size in the height direction of the face area FA is Hf and the size in the width direction is Wf, the face area FA is extended by k1 · Hf in the upward direction and k2 · Hf in the downward direction, A region extended by k3 · Wf to the left and right is set as the deformation region TA. Note that k1, k2, and k3 are predetermined coefficients.

このように変形領域TAが設定されると、顔領域FAの高さ方向の輪郭線に平行な直線である基準線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 face area FA, becomes a straight line parallel to the contour line in the height direction of the deformation area TA. . The reference line RL is a straight line that divides the width of the deformation area TA in half.

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

ステップS170(図4)では、変形領域分割部250(図1)が、変形領域TAを複数の小領域に分割する。図19は、変形領域TAの小領域への分割方法の一例を示す説明図である。変形領域分割部250は、変形領域TAに複数の分割点Dを配置し、分割点Dを結ぶ直線を用いて変形領域TAを複数の小領域に分割する。   In step S170 (FIG. 4), the deformation area dividing unit 250 (FIG. 1) divides the deformation area TA into a plurality of small areas. FIG. 19 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)により、ステップS120(図4)において設定される変形タイプと対応付けて定義されている。変形領域分割部250は、分割点配置パターンテーブル410を参照し、ステップS120において設定された変形タイプと対応付けられた態様で分割点Dを配置する。本実施例では、上述したように、変形タイプとして顔をシャープにするための変形「タイプA」(図5参照)が設定されているため、この変形タイプに対応付けられた態様で分割点Dが配置される。   The arrangement mode of the dividing points D (the number and positions of the dividing points D) is defined in association with the deformation type set in step S120 (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.

図19に示すように、分割点Dは、水平分割線Lhと垂直分割線Lvとの交点と、水平分割線Lhおよび垂直分割線Lvと変形領域TAの外枠との交点とに配置される。ここで、水平分割線Lhおよび垂直分割線Lvは、変形領域TA内に分割点Dを配置するための基準となる線である。図19に示すように、顔をシャープにするための変形タイプに対応付けられた分割点Dの配置では、基準線RLと直行する2本の水平分割線Lhと、基準線RLに平行な4本の垂直分割線Lvとが設定される。2本の水平分割線Lhを、変形領域TAの下方から順に、Lh1,Lh2と呼ぶ。また、4本の垂直分割線Lvを、変形領域TAの左から順に、Lv1,Lv2,Lv3,Lv4と呼ぶ。   As shown in FIG. 19, the dividing points D are arranged at the intersections of the horizontal dividing line Lh and the vertical dividing line Lv and at the intersections of the horizontal dividing line Lh and the vertical dividing line Lv and the outer frame of the deformation area TA. . 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. 19, 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が配置される。図19に示すように、水平分割線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. 19, the division points D located on the horizontal division line Lhi (i = 1 or 2) are called 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.

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

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

変形処理のための各分割点Dの位置の移動態様(移動方向および移動距離)は、分割点移動テーブル420(図1)により、ステップS120(図4)において設定される変形タイプと変形の度合いとの組み合わせに対応付けて、予め定められている。変形処理部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 (FIG. 4) by the division point movement table 420 (FIG. 1). Are determined in advance in association with the combination. The deformation processing unit 260 refers to the dividing point moving table 420 and moves the position of the dividing 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. .

本実施例では、上述したように、変形タイプとして顔をシャープにするための変形「タイプ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.

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

図21では、移動前の分割点Dは白抜きの丸で、移動後の分割点Dや位置の移動の無い分割点Dは黒丸で示されている。また、移動後の分割点Dは分割点D'と呼ばれるものとする。例えば分割点D11の位置は、図21において右上方向に移動され、分割点D'11となる。   In FIG. 21, 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. The divided point D after the movement is called a divided point D ′. For example, the position of the dividing point D11 is moved in the upper right direction in FIG. 21 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の位置移動により新たに定義された小領域の画像となるように、画像の変形処理を行う。例えば、図21において、分割点D11,D21,D22,D12を頂点とする小領域(ハッチングを付して示す小領域)の画像は、分割点D'11,D'21,D22,D'12を頂点とする小領域の画像に変形される。   For each small area constituting the deformation area TA, the deformation processing unit 260 converts the small area image before the position movement of the dividing point D into an image of the small area newly defined by the position movement of the dividing point D. In this way, an image deformation process is performed. For example, in FIG. 21, an image of a small region (small region indicated by hatching) having apexes at the dividing points D11, D21, D22, D12 is divided points D′ 11, D′ 21, D22, D′ 12. Is transformed into an image of a small area with the vertex at.

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

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

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

Figure 2009104672
Figure 2009104672

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

変形前の三角形領域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は、図21に示した変形領域TAを構成する各小領域について、上述したように三角形領域を定義して変形処理を行い、変形領域TAにおける画像変形処理を行う。   Image deformation from the image of the triangular area stu to the image of the triangular area s't'u 'by calculating the pixel value for each pixel in the image of the triangular area s't'u' after the deformation as described above Processing can be performed. The deformation processing 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. 21, and performs an image deformation process in the deformation area TA.

ここで、本実施例の顔形状補正の態様についてより詳細に説明する。図24は、本実施例における顔形状補正の態様を示す説明図である。本実施例では、上述したように、変形タイプとして顔をシャープにするための変形「タイプA」(図5参照)が設定され、変形度合いとして程度「中」の度合いが設定されている。図24には、変形領域TAを構成する各小領域の変形態様のイメージを矢印により示している。   Here, the face shape correction mode of the present embodiment will be described in more detail. FIG. 24 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. 24, the image of the deformation | transformation aspect of each small area | region which comprises deformation | transformation area | region TA is shown with the arrow.

図24に示すように、本実施例の顔形状補正では、基準線RLと平行な方向(V方向)に関し、水平分割線Lh1上に配置された分割点D(D11,D21,D31,D41)の位置は上方に移動される一方、水平分割線Lh2上に配置された分割点D(D12,D22,D32,D42)の位置は移動されない(図20参照)。従って、水平分割線Lh1と水平分割線Lh2との間に位置する画像は、V方向に関して縮小される。上述したように、水平分割線Lh1は顎の画像より下方に配置され、水平分割線Lh2は目の画像のすぐ下付近に配置されるため、本実施例の顔形状補正では、顔の画像の内、顎から目の下にかけての部分の画像がV方向に縮小されることとなる。この結果、画像中の顎のラインは上方に移動する。   As shown in FIG. 24, 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. 20). 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)の位置は左方向に移動される(図20参照)。さらに、垂直分割線Lv2上に配置された2つの分割点Dの内、水平分割線Lh1上に配置された分割点D(D21)の位置は右方向に移動され、垂直分割線Lv3上に配置された2つの分割点Dの内、水平分割線Lh1上に配置された分割点D(D31)の位置は左方向に移動される(図20参照)。従って、垂直分割線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 divided point D (D41, D42) is moved to the left (see FIG. 20). 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. 20). 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”.

なお、図24に示す分割点D22,D32,D33,D23を頂点とする小領域(ハッチングを付した領域)は、上述した水平分割線Lh2や垂直分割線Lv2およびLv3の配置方法によると、両目の画像を含む領域となる。図20に示すように、分割点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. 24 are both eyes according to the arrangement method of the horizontal dividing lines Lh2 and the vertical dividing lines Lv2 and Lv3 described above. This area includes the image. As shown in FIG. 20, since the division 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.

ステップS190(図4)では、顔形状補正部200(図1)が、顔形状補正後の対象画像TIを表示部150に表示するよう表示処理部310に指示する。図25は、顔形状補正後の対象画像TIが表示された表示部150の状態の一例を示す説明図である。顔形状補正後の対象画像TIが表示された表示部150により、ユーザは、補正結果を確認することができる。ユーザが補正結果に満足せず「戻る」ボタンを選択した場合には、例えば表示部150に図5に示した変形タイプおよび変形度合いを選択する画面が表示され、ユーザによる変形タイプや変形度合いの再度の設定が実行される。ユーザが補正結果に満足し、「印刷」ボタンを選択した場合には、以下の補正画像印刷処理が開始される。   In step S190 (FIG. 4), the face shape correction unit 200 (FIG. 1) instructs the display processing unit 310 to display the target image TI after the face shape correction on the display unit 150. FIG. 25 is an explanatory diagram illustrating an example of a state of the display unit 150 on which the target image TI after 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. If the user is not satisfied with the correction result and selects the “Return” button, for example, the display unit 150 displays a screen for selecting the deformation type and the deformation degree shown in FIG. The setting is performed again. When the user is satisfied with the correction result and selects the “print” button, the following corrected image printing process is started.

ステップS200(図3)では、印刷処理部320(図1)が、プリンタエンジン160を制御して、顔形状補正処理後の対象画像TIの印刷を行う。図26は、本実施例における補正画像印刷処理の流れを示すフローチャートである。印刷処理部320は、顔形状補正処理後の対象画像TIの画像データの解像度を、プリンタエンジン160による印刷処理に適した解像度に変換し(ステップS210)、解像度変換後の画像データを、プリンタエンジン160における印刷に用いられる複数のインク色で階調表現されたインク色画像データに変換する(ステップS220)。なお、本実施例では、プリンタエンジン160における印刷に用いられる複数のインク色は、シアン(C)、マゼンタ(M)、イエロー(Y)、ブラック(K)の4色であるものとする。さらに、印刷処理部320は、インク色画像データにおける各インク色の階調値に基づいてハーフトーン処理を実行することによって、印刷画素毎のインクドットの形成状態を示すドットデータを生成し(ステップS230)、ドットデータを配列して印刷データを生成する(ステップS240)。印刷処理部320は、生成された印刷データをプリンタエンジン160に供給し、プリンタエンジン160に対象画像TIの印刷を行わせる(ステップS250)。これにより、顔形状補正後の対象画像TIの印刷が完了する。   In step S200 (FIG. 3), the print processing unit 320 (FIG. 1) controls the printer engine 160 to print the target image TI after the face shape correction process. FIG. 26 is a flowchart showing the flow of the corrected image printing process in the present embodiment. The print processing unit 320 converts the resolution of the image data of the target image TI after the face shape correction processing into a resolution suitable for the print processing by the printer engine 160 (step S210), and the image data after the resolution conversion is converted to the printer engine. In step S220, the image data is converted into ink color image data expressed in gradation with a plurality of ink colors used for printing in 160. In this embodiment, it is assumed that the plurality of ink colors used for printing in the printer engine 160 are four colors of cyan (C), magenta (M), yellow (Y), and black (K). Further, the print processing unit 320 generates dot data indicating the ink dot formation state for each print pixel by performing halftone processing based on the gradation value of each ink color in the ink color image data (step S230), print data is generated by arranging dot data (step S240). The print processing unit 320 supplies the generated print data to the printer engine 160, and causes the printer engine 160 to print the target image TI (step S250). Thereby, the printing of the target image TI after the face shape correction is completed.

A−3.第1実施例の変形例:
第1実施例では、変形タイプとして顔をシャープにするための変形「タイプA」(図5参照)が設定され、変形度合いとして程度「中」の度合いが設定された場合の顔形状補正処理について説明した。これらの設定が異なる場合には、異なる顔形状補正印刷処理が実行される。
A-3. Modification of the first embodiment:
In the first embodiment, the face shape correction process when 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. explained. If these settings are different, different face shape correction printing processes are executed.

上述したように、変形処理のための分割点Dの位置の移動態様(移動方向および移動距離)は、分割点移動テーブル420(図1)により、変形タイプと変形の度合いとの組み合わせに対応付けて定められている。従って、例えば、変形度合いとして程度「中」の代わりに程度「大」が設定された場合には、分割点移動テーブル420に定められた、程度「大」に対応付けられた移動態様で分割点Dが移動される。   As described above, the movement mode (movement direction and movement distance) of the position of the dividing point D for the deformation process is associated with the combination of the deformation type and the degree of deformation by the dividing point movement table 420 (FIG. 1). It is determined. Therefore, for example, when the degree “large” is set instead of the degree “medium” as the degree of deformation, the dividing point is set in the movement mode associated with the degree “large” defined in the dividing point movement table 420. D is moved.

図27は、分割点移動テーブル420の内容の他の一例を示す説明図である。図27には、顔をシャープにするための変形タイプと程度「大」の変形度合いとの組み合わせに対応付けられた分割点Dの位置の移動態様を示している。図27に示した移動態様は、図20に示した顔をシャープにするための変形タイプと程度「中」の変形度合いとの組み合わせに対応付けられたものと比較して、H方向およびV方向の移動距離の値が大きくなっている。従って、変形度合いとして程度「大」が設定された場合には、変形領域TAを構成する小領域の内、変形される小領域の変形量が大きくなり、結果として、対象画像TI中の顔の形状がよりシャープになる。   FIG. 27 is an explanatory diagram showing another example of the contents of the dividing point movement table 420. FIG. 27 shows a movement mode of the position of the division point D associated with the combination of the deformation type for sharpening the face and the degree of deformation of the degree “large”. The movement mode shown in FIG. 27 is in the H direction and the V direction as compared with those associated with the combination of the deformation type for sharpening the face shown in FIG. The value of the movement distance of is large. Therefore, when the degree “large” is set as the degree of deformation, the deformation amount of the small area to be deformed among the small areas constituting the deformation area TA increases, and as a result, the face of the target image TI The shape becomes sharper.

また、上述したように、変形領域TAにおける分割点Dの配置の態様(分割点Dの個数および位置)は、分割点配置パターンテーブル410(図1)により、設定される変形タイプと対応付けて定義されている。従って、例えば、変形タイプとして、顔をシャープにするための変形タイプの代わりに、目を大きくする変形「タイプB」(図5参照)が設定された場合には、目を大きくする変形タイプに対応付けられた態様で分割点Dが配置される。   Further, as described above, the arrangement mode of the dividing points D in the deformation area TA (the number and position of the dividing points D) is associated with the set deformation type by the dividing point arrangement pattern table 410 (FIG. 1). Is defined. Therefore, for example, when a deformation “type B” (see FIG. 5) that enlarges the eyes is set instead of the deformation type for sharpening the face, the deformation type that enlarges the eyes is selected. The division points D are arranged in a correlated manner.

図28は、分割点Dの他の配置方法の一例を示す説明図である。図28には、目を大きくする変形タイプに対応付けられた分割点Dの配置の態様を示している。図28に示した分割点Dの配置は、図19に示した顔をシャープにするための変形タイプに対応付けられたものと比較して、水平分割線Lh4上に位置する6つの分割点D(D04,D14,D24,D34,D44,D54)が付加された配置となっている。なお、水平分割線Lh4は、目の画像のすぐ上付近に配置されている。   FIG. 28 is an explanatory diagram illustrating an example of another arrangement method of the dividing points D. FIG. 28 shows an arrangement mode of the dividing points D associated with the deformation type that enlarges the eyes. The arrangement of the division points D shown in FIG. 28 is six division points D located on the horizontal division line Lh4 as compared to the arrangement shown in FIG. 19 associated with the deformation type for sharpening the face. (D04, D14, D24, D34, D44, D54) is added. The horizontal dividing line Lh4 is arranged in the vicinity immediately above the eye image.

図29は、分割点移動テーブル420の内容の他の一例を示す説明図である。図29には、目を大きくするための変形タイプと程度「中」の変形度合いとの組み合わせに対応付けられた分割点Dの位置の移動態様を示している。なお、図29には、水平分割線Lh2および水平分割線Lh4(図28)上の分割点Dのみに関する移動態様を抜き出して示している。図29に示した分割点D以外の分割点Dはいずれも移動しないものとする。   FIG. 29 is an explanatory diagram showing another example of the contents of the dividing point movement table 420. FIG. 29 shows a movement mode of the position of the dividing point D associated with the combination of the deformation type for enlarging the eyes and the degree of deformation of the degree “medium”. In FIG. 29, a movement mode relating to only the dividing point D on the horizontal dividing line Lh2 and the horizontal dividing line Lh4 (FIG. 28) is extracted and shown. Assume that none of the division points D other than the division point D shown in FIG. 29 moves.

図29に示した態様で分割点Dの移動が行われると、分割点D22,D32,D34,D24を頂点とする矩形の小領域(図28でハッチングを付して示す領域)の画像は、基準線RLと平行な方向に沿って拡大されることとなる。従って、対象画像TI中の目の形状が上下に大きくなる。   When the division point D is moved in the manner shown in FIG. 29, an image of a rectangular small region (region shown by hatching in FIG. 28) having the vertexes at the division points D22, D32, D34, and D24 is as follows. It is enlarged along the direction parallel to the reference line RL. Accordingly, the shape of the eyes in the target image TI increases vertically.

また、上述したように、本実施例では、図5に示すユーザインターフェースを通じて希望された場合には、ユーザによる変形態様の詳細指定が行われる。この場合には、設定された変形タイプに対応付けられたパターンに従った分割点Dの配置(図4のステップS170)の後に、ユーザによる分割点Dの移動態様の指定が行われる。   In addition, as described above, in the present embodiment, when desired through the user interface shown in FIG. 5, the detailed designation of the deformation mode is performed by the user. In this case, after the arrangement of the dividing points D according to the pattern associated with the set deformation type (step S170 in FIG. 4), the movement mode of the dividing points D is designated by the user.

図30は、ユーザによる分割点Dの移動態様の指定のためのユーザインターフェースの一例を示す説明図である。ユーザにより変形態様の詳細指定が希望された場合には、分割点Dの配置の完了後、プリンタ100の指定取得部212(図1)が、表示処理部310に、図30に示したユーザインターフェースを表示部150に表示させるよう指示する。図30に示したユーザインターフェースには、左側に対象画像TIの変形領域TA上の分割点Dの配置を示す画像が表示され、右側に分割点Dの移動態様を指定するインターフェースが配置されている。ユーザは、このユーザインターフェースを介して、各分割点DについてH方向およびV方向の移動量を任意に指定することができる。変形処理部260(図1)は、このユーザインターフェースを介して指定された移動態様で分割点Dを移動することにより、変形処理を行う。   FIG. 30 is an explanatory diagram showing an example of a user interface for designating the movement mode of the dividing point D by the user. When the user desires detailed designation of the deformation mode, after the arrangement of the dividing points D is completed, the designation acquisition unit 212 (FIG. 1) of the printer 100 displays the user interface shown in FIG. Is displayed on the display unit 150. In the user interface shown in FIG. 30, an image showing the arrangement of the dividing points D on the deformation area TA of the target image TI is displayed on the left side, and an interface for designating the movement mode of the dividing points D is arranged on the right side. . The user can arbitrarily specify the amount of movement in the H direction and the V direction for each dividing point D via this user interface. The deformation processing unit 260 (FIG. 1) performs the deformation process by moving the dividing point D in the movement mode designated via the user interface.

なお、図30に示したユーザインターフェースでは、初期状態において、設定された変形タイプ(例えば顔をシャープにするための変形タイプ)に応じて、各分割点DのH方向およびV方向のデフォルトの移動量が定められており、ユーザは所望の分割点Dについて移動量を修正するようになっている。このようにすれば、ユーザは、デフォルトの移動量を参照しつつ、移動量を微調整して指定することができ、所望の変形タイプの画像変形を微調整した画像変形処理を実現することができる。   In the user interface shown in FIG. 30, in the initial state, the default movement of each division point D in the H and V directions according to the set deformation type (for example, a deformation type for sharpening the face). The amount is determined, and the user corrects the movement amount for a desired division point D. In this way, the user can finely adjust and specify the movement amount while referring to the default movement amount, thereby realizing an image deformation process in which a desired deformation type image deformation is finely adjusted. it can.

以上説明したように、本実施例のプリンタ100による顔形状補正印刷処理では、対象画像TI上に設定された変形領域TA内に複数の分割点Dが配置され、分割点D同士を結ぶ直線(水平分割線Lhおよび垂直分割線Lv)を用いて変形領域TAが複数の小領域に分割される。また、分割点Dの位置が移動され、小領域が変形されることにより変形領域TA内の画像の変形処理が実行される。このように、本実施例のプリンタ100による顔形状補正印刷処理では、変形領域TA内に分割点Dを配置して、配置された分割点Dを移動するだけで画像変形を行うことができ、多様な変形態様に対応した画像変形を、容易に、かつ効率的に実現することができる。   As described above, in the face shape correction printing process by the printer 100 of the present embodiment, a plurality of division points D are arranged in the deformation area TA set on the target image TI, and a straight line ( The deformation area TA is divided into a plurality of small areas using the horizontal dividing line Lh and the vertical dividing line Lv). Further, the position of the dividing point D is moved and the small area is deformed, whereby the deformation process of the image in the deformation area TA is executed. As described above, in the face shape correction printing process by the printer 100 according to the present embodiment, the image can be deformed simply by arranging the dividing point D in the deformation area TA and moving the arranged dividing point D. Image deformation corresponding to various deformation modes can be easily and efficiently realized.

また、本実施例のプリンタ100による顔形状補正印刷処理では、複数の変形タイプの中から選択・設定された変形タイプに対応付けられた配置パターンに従って分割点Dが配置される。そのため、顔をシャープする変形タイプや目を大きくする変形タイプ等、それぞれの変形タイプに適した分割点Dの配置、すなわち変形領域TAの分割が行われ、各変形タイプの画像変形のさらなる容易化を実現することができる。   Further, in the face shape correction printing process by the printer 100 of the present embodiment, the division points D are arranged according to the arrangement pattern associated with the deformation type selected and set from a plurality of deformation types. Therefore, the arrangement of the dividing points D suitable for each deformation type, such as the deformation type that sharpens the face and the deformation type that enlarges the eyes, that is, the deformation area TA is divided, thereby further facilitating the image deformation of each deformation type. Can be realized.

また、本実施例のプリンタ100による顔形状補正印刷処理では、選択・設定された変形タイプと変形度合いとの組み合わせに対応付けられた移動態様(移動方向および移動量)で分割点Dが移動される。そのため、変形タイプと変形度合いとを設定すれば、それらの組み合わせに応じた画像変形が実行され、画像変形のさらなる容易化を実現することができる。   Further, in the face shape correction printing process by the printer 100 of the present embodiment, the dividing point D is moved in the movement mode (movement direction and movement amount) associated with the combination of the selected deformation type and deformation degree. The Therefore, if the deformation type and the degree of deformation are set, image deformation according to the combination thereof is executed, and further simplification of the image deformation can be realized.

また、本実施例のプリンタ100による顔形状補正印刷処理では、変形領域TAにおける分割点Dの配置は、基準線RLに対して対称の配置となっており、基準線RLに対して対称な位置関係にある2つの分割点Dの組み合わせのすべてが、分割点Dの移動後も、基準線RLに対して対称な位置関係を維持するように、分割点Dの移動態様が定められている。そのため、本実施例の顔形状補正印刷処理では、基準線RLに対して左右対称な画像変形が行われることとなり、より自然で好ましい顔画像の画像変形を実現することができる。   In the face shape correction printing process by the printer 100 according to the present embodiment, the arrangement of the dividing points D in the deformation area TA is symmetrical with respect to the reference line RL, and is symmetrical with respect to the reference line RL. The movement mode of the division point D is determined so that all the combinations of the two division points D in the relationship maintain a symmetrical positional relationship with respect to the reference line RL even after the movement of the division point D. Therefore, in the face shape correction printing process according to the present embodiment, image deformation that is bilaterally symmetric with respect to the reference line RL is performed, and more natural and preferable face image deformation can be realized.

また、本実施例のプリンタ100による顔形状補正印刷処理では、変形領域TAを構成する複数の小領域の内の一部の小領域について、変形を行わないようにすることが可能である。すなわち、図24に示すように、両目の画像を含む小領域については、変形が行われないように、分割点Dの配置および移動態様を設定することが可能である。このように、両目の画像を含む小領域については変形を行わないものとすることにより、より自然で好ましい顔画像の画像変形を実現することができる。   Further, in the face shape correction printing process by the printer 100 according to the present embodiment, it is possible to prevent deformation of some of the plurality of small areas constituting the deformation area TA. That is, as shown in FIG. 24, it is possible to set the arrangement and movement mode of the dividing points D so that the small region including the images of both eyes is not deformed. As described above, by performing no deformation on the small area including the images of both eyes, it is possible to realize a more natural and preferable image deformation of the face image.

また、本実施例のプリンタ100による顔形状補正印刷処理において、ユーザにより変形態様の詳細指定が希望された場合には、ユーザインターフェースを介した各分割点DについてのH方向およびV方向の移動量の指定が行われ、指定に従い分割点Dの位置が移動される。そのため、よりユーザの希望に近い態様での画像変形を容易に実現することができる。   Further, in the face shape correction printing process by the printer 100 of this embodiment, when the user desires to specify the details of the deformation mode, the movement amount in the H direction and the V direction for each division point D via the user interface. Is designated, and the position of the dividing point D is moved in accordance with the designation. Therefore, it is possible to easily realize image deformation in a mode closer to the user's desire.

また、本実施例のプリンタ100による顔形状補正印刷処理では、変形領域TAの設定(図4のステップS130)の前に、検出された顔領域FAの高さ方向に沿った位置調整が実行される(図4のステップS140)。そのため、対象画像TI中の顔の画像の位置に、より適合した顔領域FAを設定することができ、顔領域FAに基づき設定される変形領域TAにおける画像変形処理の結果を、より好ましいものとすることができる。   Further, in the face shape correction printing process by the printer 100 of the present embodiment, the position adjustment along the height direction of the detected face area FA is executed before the deformation area TA is set (step S130 in FIG. 4). (Step S140 in FIG. 4). Therefore, a more suitable face area FA can be set at the position of the face image in the target image TI, and the result of the image deformation process in the deformation area TA set based on the face area FA is more preferable. can do.

また、本実施例における顔領域FAの位置調整は、参照被写体としての目の画像の基準線RLに沿った位置を参照して実行される。本実施例では、目の画像を含む領域として設定された特定領域SAにおいて、基準線RLに沿った複数の評価位置について、基準線RLに直行する方向に沿った画素値の分布の特徴を表す評価値が算出されるため、算出された評価値に基づき目の画像の基準線RLに沿った位置を検出することができる。   Further, the position adjustment of the face area FA in the present embodiment is executed with reference to the position along the reference line RL of the eye image as the reference subject. In the present embodiment, in the specific area SA set as the area including the eye image, the distribution characteristics of the pixel values along the direction perpendicular to the reference line RL are expressed for a plurality of evaluation positions along the reference line RL. Since the evaluation value is calculated, the position along the reference line RL of the eye image can be detected based on the calculated evaluation value.

より具体的には、基準線RLに直行する複数の対象画素特定線PLについて評価対象画素TPを選択し、評価対象画素TPのR値の平均値を評価値として用いることで、目の画像の位置を検出することができる。   More specifically, the evaluation target pixel TP is selected for a plurality of target pixel specifying lines PL that are orthogonal to the reference line RL, and the average value of the R values of the evaluation target pixels TP is used as the evaluation value. The position can be detected.

また、目の画像の位置の検出は、それぞれに片目の画像が含まれるように設定された左分割特定領域SA(l)と右分割特定領域SA(r)とのそれぞれについて個別に行われる。そのため、目の画像の位置の検出を特定領域SA全体を対象として実行する場合と比較して、左右の目の基準線RLに沿った位置ずれの影響を排除することができ、検出精度を向上させることができる。   Further, the detection of the position of the eye image is performed individually for each of the left divided specific area SA (l) and the right divided specific area SA (r) set so as to include the image of the one eye. Therefore, compared with the case where the detection of the position of the eye image is performed for the entire specific area SA, the influence of the positional deviation along the left and right eye reference lines RL can be eliminated, and the detection accuracy is improved. Can be made.

また、目の画像の位置の検出のための評価値の算出の際には、各対象画素特定線PLについて、選択された複数の評価対象画素TPの内、R値の大きい一部の画素を評価値の算出対象から除外するものとしている。そのため、参照被写体としての目の画像とは色の差が大きいと考えられる一部の評価対象画素TPを評価値の算出対象から除外することにより、目の画像の位置検出精度をより向上させることができる。   Further, when calculating the evaluation value for detecting the position of the eye image, for each target pixel specifying line PL, among the selected plurality of evaluation target pixels TP, some pixels having a large R value are selected. Excluded from the evaluation value calculation target. Therefore, the position detection accuracy of the eye image can be further improved by excluding some evaluation target pixels TP that are considered to have a large color difference from the eye image as the reference subject from the evaluation value calculation target. Can do.

また、本実施例のプリンタ100による顔形状補正印刷処理では、変形領域TAの設定(図4のステップS130)の前に、顔領域FAの傾き調整が実行される(図4のステップS150)。そのため、対象画像TI中の顔の画像の傾きに、より適合した顔領域FAを設定することができ、顔領域FAに基づき設定される変形領域TAにおける画像変形処理の結果を、より好ましいものとすることができる。   Further, in the face shape correction printing process by the printer 100 of the present embodiment, the inclination adjustment of the face area FA is executed (step S150 in FIG. 4) before the deformation area TA is set (step S130 in FIG. 4). Therefore, a face area FA that is more suitable for the inclination of the face image in the target image TI can be set, and the result of the image deformation process in the deformation area TA set based on the face area FA is more preferable. can do.

また、本実施例における顔領域FAの傾き調整は、参照被写体としての両目の画像の傾きを参照して実行される。本実施例では、基準線RLを種々の角度で回転させた複数の評価方向線ELのそれぞれに対応付けて両目の画像を含む領域が評価特定領域ESAとして設定される。そして、各評価特定領域ESAにおいて、評価方向に沿った複数の評価位置について、評価方向に直行する方向に沿った画素値の分布の特徴を表す評価値が算出される。そのため、算出された評価値に基づき、両目の画像の傾きを検出することができる。   Further, the inclination adjustment of the face area FA in the present embodiment is executed with reference to the inclination of the image of both eyes as the reference subject. In the present embodiment, an area including the images of both eyes is set as the evaluation specific area ESA in association with each of the plurality of evaluation direction lines EL obtained by rotating the reference line RL at various angles. Then, in each evaluation specific area ESA, evaluation values representing the characteristics of the distribution of pixel values along the direction orthogonal to the evaluation direction are calculated for a plurality of evaluation positions along the evaluation direction. Therefore, it is possible to detect the inclination of the images of both eyes based on the calculated evaluation value.

より具体的には、各評価特定領域ESAについて、評価方向線ELに直行する複数の対象画素特定線PLについて評価対象画素TPを選択し、評価対象画素TPのR値の平均値を評価値として算出し、評価値の分散が最大となる評価方向を決定することで、両目の画像の傾きを検出することができる。   More specifically, for each evaluation specific area ESA, the evaluation target pixel TP is selected for a plurality of target pixel specific lines PL orthogonal to the evaluation direction line EL, and the average value of the R values of the evaluation target pixels TP is used as the evaluation value. By calculating and determining the evaluation direction that maximizes the variance of the evaluation values, it is possible to detect the inclination of the images of both eyes.

また、両目の画像の傾き検出のための評価値の算出の際には、各対象画素特定線PLについて、選択された複数の評価対象画素TPの内、R値の大きい一部の画素を評価値の算出対象から除外するものとしている。そのため、参照被写体としての両目の画像とは色の差が大きいと考えられる一部の評価対象画素TPを評価値の算出対象から除外することにより、両目の画像の傾き検出精度をより向上させることができる。   In calculating the evaluation value for detecting the inclination of the image of both eyes, for each target pixel specifying line PL, among the selected plurality of evaluation target pixels TP, some pixels having a large R value are evaluated. It shall be excluded from the calculation target of the value. Therefore, by excluding some evaluation target pixels TP, which are considered to have a large color difference from the images of both eyes as the reference subject, from the evaluation value calculation target, it is possible to further improve the inclination detection accuracy of the images of both eyes. Can do.

また、本実施例のプリンタ100による顔形状補正印刷処理では、変形領域TAを構成する複数の小領域を4つの三角形領域に分割し、三角形領域単位で画像の変形処理を行っている。このとき、変形前および変形後のそれぞれについて、小領域の4つの三角形への分割は、小領域の各頂点と重心CG(CG')とを結ぶ線分を用いて行っている。小領域の重心位置は、4つの頂点の座標から算出できる。そのため、はじめから変形領域TAを三角形の小領域に分割する場合と比較して、指定する座標の数を少なくすることができ、処理の高速化を図ることができる。また、小領域を三角形に分割せずに画像の変形を行う場合には、小領域の各頂点(分割点D)の移動方向および移動量によっては、小領域が180度を超える内角を有する形状となって変形処理に支障をきたす可能性がある。本実施例では、小領域を三角形に分割して変形処理を行っているため、このような不都合の発生を防止することができ、処理の円滑化・安定化を図ることができる。   In the face shape correction printing process by the printer 100 of this embodiment, a plurality of small areas constituting the deformation area TA are divided into four triangle areas, and the image deformation process is performed in units of triangle areas. At this time, for each of the pre-deformation and the post-deformation, the small area is divided into four triangles using a line segment connecting each vertex of the small area and the center of gravity CG (CG ′). The position of the center of gravity of the small area can be calculated from the coordinates of the four vertices. Therefore, compared with the case where the deformation area TA is divided into small triangular areas from the beginning, the number of designated coordinates can be reduced, and the processing speed can be increased. When the image is deformed without dividing the small area into triangles, depending on the moving direction and moving amount of each vertex (division point D) of the small area, the small area has an inner angle exceeding 180 degrees. This may interfere with the deformation process. In the present embodiment, since the deformation process is performed by dividing the small area into triangles, such inconvenience can be prevented and the process can be smoothed and stabilized.

B.その他の変形例:
なお、この発明は上記の実施例や実施形態に限られるものではなく、その要旨を逸脱しない範囲において種々の態様において実施することが可能であり、例えば次のような変形も可能である。
B. Other 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:
上記実施例では、顔領域FAの位置調整や傾き調整の際の評価値として、各対象画素特定線PLについてのR値の平均値を用いているが(図9および図15参照)、対象画素特定線PLの方向(すなわち基準線RLに直行する方向)に沿った画素値の分布を表す値であれば、他の値を評価値として採用することも可能である。例えば、輝度値やエッジ量の平均値を用いてもよい。参照被写体としての目の画像の部分は、輝度値やエッジ量が、周囲の肌の部分の画像とは大きく異なると考えられることから、こられの値を評価値として用いることも可能である。
B1. Other variations 1:
In the above embodiment, the average value of the R values for each target pixel specifying line PL is used as the evaluation value at the time of position adjustment and tilt adjustment of the face area FA (see FIGS. 9 and 15). Any other value can be adopted as the evaluation value as long as the value represents the distribution of pixel values along the direction of the specific line PL (that is, the direction perpendicular to the reference line RL). For example, an average value of luminance values and edge amounts may be used. Since the eye image portion serving as the reference subject is considered to have a luminance value and edge amount that are significantly different from those of the surrounding skin portion, these values can also be used as evaluation values.

また、これらの値について、評価値算出の対象となる画素の平均値ではなく、累計値や、閾値以下(または以上)の値を有する画素数などを用いてもよい。例えば、各対象画素特定線PLについてのR値の累計値や、R値が閾値以下の画素の画素数を評価値として用いてもよい。また、上記実施例では、各対象画素特定線PLについて評価対象画素TPの内の一部を評価値の算出に用いないものとしているが、すべての評価対象画素TPを用いて評価値を算出してもよい。   For these values, instead of the average value of the pixels for which the evaluation value is to be calculated, a cumulative value, the number of pixels having a value equal to or less than a threshold value (or more) may be used. For example, an accumulated value of R values for each target pixel specifying line PL or the number of pixels having an R value equal to or less than a threshold value may be used as the evaluation value. In the above embodiment, a part of the evaluation target pixel TP is not used for calculating the evaluation value for each target pixel specifying line PL, but the evaluation value is calculated using all the evaluation target pixels TP. May be.

また、上記実施例では、黄色人種を対象とすることを前提に、評価値としてR値の平均値を用いているが、他の人種(白色人種や黒色人種)を対象とする場合には、他の評価値(例えば輝度や明度、B値等)が用いられるとしてもよい。   Moreover, in the said Example, although the average value of R value is used as an evaluation value on the assumption that it targets a yellow race, it targets another race (white race or black race). In some cases, other evaluation values (for example, luminance, brightness, B value, etc.) may be used.

B2.その他の変形例2:
上記実施例では、顔領域FAの位置調整や傾き調整において、特定領域SAや評価特定領域ESAにn本の対象画素特定線PLを設定し、対象画素特定線PLの位置において評価値を算出している(図9および図15参照)。しかし、対象画素特定線PLの設定本数はn本に固定する必要はなく、対象画像TIに対する特定領域SAや評価特定領域ESAの大きさに従って可変に設定されるとしてもよい。例えば、対象画素特定線PLのピッチsを固定とし、特定領域SAや評価特定領域ESAの大きさに応じて対象画素特定線PLの本数を設定してもよい。
B2. Other variations 2:
In the above embodiment, in the position adjustment and the inclination adjustment of the face area FA, n target pixel specific lines PL are set in the specific area SA and the evaluation specific area ESA, and the evaluation value is calculated at the position of the target pixel specific line PL. (See FIG. 9 and FIG. 15). However, the number of target pixel specifying lines PL need not be fixed to n, and may be variably set according to the size of the specific area SA or the evaluation specific area ESA for the target image TI. For example, the pitch s of the target pixel specifying line PL may be fixed, and the number of target pixel specifying lines PL may be set according to the size of the specific area SA or the evaluation specific area ESA.

B3.その他の変形例3:
上記実施例では、顔領域FAの傾き調整において、基準線RLの方向を中心に時計回りおよび反時計回りに20度の範囲で評価方向を設定しているが(図15参照)、顔領域FAの位置調整の際に算出された概略傾き角RIの方向を中心に時計回りおよび反時計回りに20度の範囲で評価方向を設定するとしてもよい。
B3. Other modification 3:
In the above embodiment, in the adjustment of the inclination of the face area FA, the evaluation direction is set in the range of 20 degrees clockwise and counterclockwise around the direction of the reference line RL (see FIG. 15). The evaluation direction may be set in the range of 20 degrees clockwise and counterclockwise around the direction of the approximate inclination angle RI calculated during the position adjustment.

また上記実施例では、一定の角度αのピッチで評価方向が設定されるとしているが、複数の評価方向のピッチは一定である必要はない。例えば、基準線RLの方向に近い範囲では、ピッチを細かくして評価方向を設定し、基準線RLから遠い範囲では、ピッチを粗くして評価方向を設定するとしてもよい。   Moreover, in the said Example, although the evaluation direction is set with the pitch of the fixed angle (alpha), the pitch of several evaluation directions does not need to be constant. For example, in the range close to the direction of the reference line RL, the evaluation direction may be set by making the pitch fine, and in the range far from the reference line RL, the evaluation direction may be set by making the pitch coarse.

また上記実施例では、顔領域FAの傾き調整において、位置調整後の顔領域FAに対応した特定領域SAが初期評価特定領域ESA(0)として設定されるとしているが、初期評価特定領域ESA(0)は、特定領域SAと独立して設定されるとしてもよい。   In the above embodiment, the specific area SA corresponding to the face area FA after position adjustment is set as the initial evaluation specific area ESA (0) in the inclination adjustment of the face area FA. 0) may be set independently of the specific area SA.

B4.その他の変形例4:
上記実施例では、顔領域FAの傾き調整において、複数の評価方向が設定され、各評価方向を表す評価方向線ELに対応した評価特定領域ESAが設定される。この各評価特定領域ESAは、初期評価特定領域ESA(0)を、各評価方向線ELの基準線RLからの回転角と同じ角度で回転させた領域である(図15参照)。しかし、評価特定領域ESAは必ずしもこのような領域として設定される必要はない。例えば、各評価方向線ELに対応した評価特定領域ESAは、すべて初期評価特定領域ESA(0)と同じ領域として設定されてもよい。この場合にも、各評価方向線ELと直行する対象画素特定線PLについて同様に評価値としてのR値の平均値を算出すればよい。このようにした場合でも、評価値の分散が最大値をとる評価方向を選択すれば、画像の傾きに適合した顔領域FAの傾き調整を実現することができる。
B4. Other variations 4:
In the above embodiment, in the inclination adjustment of the face area FA, a plurality of evaluation directions are set, and the evaluation specific area ESA corresponding to the evaluation direction line EL representing each evaluation direction is set. Each evaluation specific area ESA is an area obtained by rotating the initial evaluation specific area ESA (0) at the same angle as the rotation angle of each evaluation direction line EL from the reference line RL (see FIG. 15). However, the evaluation specific area ESA is not necessarily set as such an area. For example, all the evaluation specific areas ESA corresponding to each evaluation direction line EL may be set as the same area as the initial evaluation specific area ESA (0). Also in this case, the average value of the R values as the evaluation values may be calculated in the same manner for the target pixel specifying line PL orthogonal to each evaluation direction line EL. Even in this case, if the evaluation direction in which the variance of the evaluation values takes the maximum value is selected, it is possible to realize the inclination adjustment of the face area FA that matches the inclination of the image.

B5.その他の変形例5:
上記実施例では、顔領域FAの位置調整や傾き調整において、参照被写体としての目の画像の位置や傾きが検出され、検出された位置や傾きを用いて顔領域FAの位置調整や傾き調整が実行される。しかし、他の画像、例えば鼻や口の画像が参照被写体として用いられるとしてもよい。
B5. Other modification 5:
In the above-described embodiment, the position and inclination of the eye image as the reference subject are detected in the position adjustment and inclination adjustment of the face area FA, and the position adjustment and inclination adjustment of the face area FA are performed using the detected position and inclination. Executed. However, other images, such as images of the nose or mouth, may be used as the reference subject.

また、本実施例における参照被写体の画像の位置や傾きの検出は、顔領域FAの位置調整や傾き調整を目的とする場合に限らず、広く、対象画像TI中の参照被写体の画像の位置や傾きを検出する場合に適用可能である。この場合に、参照被写体は、顔の部位に限られず、任意の被写体を参照被写体として採用可能である。   Further, the detection of the position and inclination of the image of the reference subject in the present embodiment is not limited to the purpose of adjusting the position and inclination of the face area FA, and widely, the position of the image of the reference subject in the target image TI, It can be applied when detecting an inclination. In this case, the reference subject is not limited to the facial part, and any subject can be adopted as the reference subject.

B6.その他の変形例6:
上記実施例では、変形領域TA(図18参照)は長方形形状の領域として設定されるとしているが、変形領域TAは他の形状、例えば楕円形状や菱形形状の領域として設定されるとしてもよい。
B6. Other modification 6:
In the above embodiment, the deformation area TA (see FIG. 18) is set as a rectangular area, but the deformation area TA may be set as another area, for example, an oval or rhombus area.

また、上記実施例における変形領域TAの小領域への分割方法(図19および図28参照)は、あくまで一例であり、他の分割方法を採用することも可能である。例えば、変形領域TAにおける分割点Dの配置は任意に変更可能である。また、小領域は、長方形形状ではなく、矩形形状や多角形形状であってもよい。また、変形領域TAにおける分割点Dの配置を、ユーザ指定に従い行うとしてもよい。   In addition, the method of dividing the deformation area TA into the small areas in the above-described embodiment (see FIGS. 19 and 28) is merely an example, and other division methods may be employed. For example, the arrangement of the dividing points D in the deformation area TA can be arbitrarily changed. Further, the small area may not be rectangular but may be rectangular or polygonal. Further, the arrangement of the dividing points D in the deformation area TA may be performed in accordance with user designation.

B7.その他の変形例7:
上記実施例において、変形領域TAの一部が対象画像TIからはみ出す場合もある。また、その場合に、一部の分割点Dが対象画像TI上に配置できない場合がある。一部の分割点Dが対象画像TI上に配置できない場合には、当該分割点Dの位置を定義するための水平分割線Lhおよび垂直分割線Lv(図19参照)を削除して、残りの水平分割線Lhおよび垂直分割線Lvにより定義される分割点Dのみを用いて変形領域TAの小領域への分割を実行するとしてもよい。あるいは、一部の分割点Dが対象画像TI上に配置できない場合には、顔形状補正を実行しないものとしてもよい。
B7. Other modification example 7:
In the embodiment described above, a part of the deformation area TA may protrude from the target image TI. In that case, some division points D may not be arranged on the target image TI. If some of the division points D cannot be arranged on the target image TI, the horizontal division line Lh and the vertical division line Lv (see FIG. 19) for defining the position of the division point D are deleted, and the remaining division points D The deformation area TA may be divided into small areas using only the dividing points D defined by the horizontal dividing line Lh and the vertical dividing line Lv. Alternatively, face shape correction may not be executed when some of the division points D cannot be arranged on the target image TI.

B8.その他の変形例8:
上記実施例において、顔形状補正印刷処理(図3)の内容はあくまで一例であり、各ステップの順番を変更したり、一部のステップの実行を省略したりしてもよい。例えば、顔形状補正(図3のステップS100)の前に、印刷処理の内の解像度変換や色変換(図26のステップS210やS220)が実行されるとしてもよい。
B8. Other modification 8:
In the above embodiment, the content of the face shape correction printing process (FIG. 3) is merely an example, and the order of each step may be changed, or the execution of some steps may be omitted. For example, resolution conversion and color conversion (steps S210 and S220 in FIG. 26) in the printing process may be performed before face shape correction (step S100 in FIG. 3).

また、顔領域FAの位置調整(図4のステップS140)と顔領域FAの傾き調整(図4のステップS150)との順番を逆にしてもよい。また、これらの処理の一方のみが実行され、他方の処理は省略されるとしてもよい。また、顔領域FAの検出(図4のステップS130)の直後に変形領域TAの設定(図4のステップS160)が実行され、設定された変形領域TAを対象に同様の位置調整や傾き調整が行われるとしてもよい。この場合にも、変形領域TAは少なくとも顔の一部の画像を含む領域であるため、顔の画像を含む領域の位置調整や傾き調整が行われるということができる。   Further, the order of the position adjustment of the face area FA (step S140 in FIG. 4) and the inclination adjustment of the face area FA (step S150 in FIG. 4) may be reversed. Further, only one of these processes may be executed and the other process may be omitted. Further, immediately after the detection of the face area FA (step S130 in FIG. 4), the deformation area TA is set (step S160 in FIG. 4), and the same position adjustment and inclination adjustment are performed for the set deformation area TA. It may be done. Also in this case, since the deformation area TA is an area including at least a partial image of the face, it can be said that position adjustment and inclination adjustment of the area including the face image are performed.

また上記実施例では、顔領域FAの検出(図4のステップS130)が実行されるが、顔領域FAの検出の代わりに、例えばユーザ指定を介した顔領域FAの情報の取得が行われるとしてもよい。   In the above embodiment, the detection of the face area FA (step S130 in FIG. 4) is executed. Instead of the detection of the face area FA, for example, the acquisition of the information of the face area FA is performed through user designation. Also good.

B9.その他の変形例9:
上記実施例では、画像処理装置としてのプリンタ100による顔形状補正印刷処理(図3)を説明したが、顔形状補正印刷処理は例えば、顔形状補正(図3のステップS100)がパーソナルコンピュータにより実行され、印刷処理(ステップS200)のみがプリンタにより実行されるとしてもよい。また、プリンタ100はインクジェットプリンタに限らず、他の方式のプリンタ、例えばレーザプリンタや昇華型プリンタであるとしてもよい。
B9. Other modification 9:
In the above embodiment, the face shape correction printing process (FIG. 3) by the printer 100 as the image processing apparatus has been described. For example, the face shape correction printing process is executed by the personal computer (step S100 in FIG. 3). Only the printing process (step S200) 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.

B10.その他の変形例10:
上記実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部をハードウェアに置き換えるようにしてもよい。
B10. Other modification 10:
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.

100...プリンタ
110...CPU
120...内部メモリ
140...操作部
150...表示部
160...プリンタエンジン
170...カードインターフェース
172...カードスロット
200...顔形状補正部
210...変形態様設定部
212...指定取得部
220...顔領域検出部
230...顔領域調整部
232...特定領域設定部
234...評価部
236...決定部
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 part 210 ... Deformation aspect Setting unit 212 ... Specification acquisition unit 220 ... Face region detection unit 230 ... Face region adjustment unit 232 ... Specific region setting unit 234 ... Evaluation unit 236 ... Determining unit 240 ... Deformation Area setting section 250 ... Deformation area dividing section 260 ... Deformation processing section 310 ... Display processing section 320 ... Print processing section 410 ... Dividing point arrangement pattern table 420 ... Dividing point movement table

Claims (12)

画像の変形を行う画像処理装置であって、
対象画像上の少なくとも一部の領域を変形領域として設定する変形領域設定部と、
前記変形領域内に複数の分割点を配置し、前記分割点同士を結ぶ直線を用いて前記変形領域を複数の小領域に分割する変形領域分割部と、
少なくとも1つの前記分割点の位置を移動して前記小領域を変形することにより前記変形領域内の画像の変形を行う変形処理部と、を備える、画像処理装置。
An image processing apparatus that performs image deformation,
A deformation area setting unit for setting at least a part of the area on the target image as a deformation area;
A deformation area dividing unit that arranges a plurality of division points in the deformation area and divides the deformation area into a plurality of small areas using a straight line connecting the division points;
An image processing apparatus comprising: a deformation processing unit configured to deform an image in the deformation area by moving the position of at least one of the division points to deform the small area.
請求項1記載の画像処理装置であって、さらに、
複数の所定の変形タイプの内の1つを選択して前記変形領域内の画像の変形に適用する変形タイプとして設定する変形態様設定部を備え、
前記変形領域分割部は、前記設定された変形タイプに対応付けられた所定の配置パターンに従い前記複数の分割点を配置する、画像処理装置。
The image processing apparatus according to claim 1, further comprising:
A deformation mode setting unit configured to select one of a plurality of predetermined deformation types and set as a deformation type to be applied to the deformation of the image in the deformation area;
The deformation area dividing unit arranges the plurality of dividing points according to a predetermined arrangement pattern associated with the set deformation type.
請求項2記載の画像処理装置であって、
前記変形態様設定部は、複数の所定の変形度合いの内の1つを選択して前記変形領域内の画像の変形に適用する変形度合いとして設定し、
前記変形処理部は、前記設定された変形タイプと変形度合いとの組み合わせに対応付けられた所定の移動方向および移動量に従い前記分割点の位置を移動する、画像処理装置。
The image processing apparatus according to claim 2,
The deformation mode setting unit selects one of a plurality of predetermined deformation degrees and sets it as a deformation degree to be applied to the deformation of the image in the deformation area,
The said deformation | transformation process part is an image processing apparatus which moves the position of the said division | segmentation point according to the predetermined | prescribed movement direction and movement amount matched with the combination of the set said deformation | transformation type and deformation | transformation degree.
請求項2記載の画像処理装置であって、
前記変形態様設定部は、少なくとも1つの前記分割点について、前記分割点の移動方向および移動量に関するユーザ指定を取得する指定取得部を含み、
前記変形処理部は、前記取得されたユーザ指定に従い前記分割点の位置を移動する、画像処理装置。
The image processing apparatus according to claim 2,
The deformation mode setting unit includes a designation obtaining unit that obtains user designation regarding a movement direction and a movement amount of the division point for at least one division point,
The deformation processing unit is an image processing device that moves the position of the division point according to the acquired user designation.
請求項1ないし請求項4のいずれかに記載の画像処理装置であって、
前記変形領域設定部は、前記変形領域に顔の少なくとも一部の画像が含まれるように前記変形領域を設定する、画像処理装置。
An image processing apparatus according to any one of claims 1 to 4,
The image processing apparatus, wherein the deformation area setting unit sets the deformation area so that at least a partial image of a face is included in the deformation area.
請求項5記載の画像処理装置であって、
前記変形領域分割部は、少なくとも1組の前記分割点が所定の基準線に対して互いに対称の位置に配置されるように、前記複数の分割点を配置し、
前記変形処理部は、前記少なくとも1組の分割点を、前記所定の基準線に対して互いに対称である位置関係を維持したまま移動する、画像処理装置。
The image processing apparatus according to claim 5, wherein
The deformation area dividing unit arranges the plurality of dividing points so that at least one set of the dividing points are arranged at positions symmetrical to each other with respect to a predetermined reference line,
The image processing apparatus, wherein the deformation processing unit moves the at least one set of division points while maintaining a positional relationship that is symmetrical with respect to the predetermined reference line.
請求項5記載の画像処理装置であって、
前記変形処理部は、少なくとも1つの前記小領域について、変形を行わない、画像処理装置。
The image processing apparatus according to claim 5, wherein
The image processing apparatus, wherein the deformation processing unit does not perform deformation on at least one of the small regions.
請求項7記載の画像処理装置であって、
前記変形処理部は、目の画像を含む前記小領域について、変形を行わない、画像処理装置。
The image processing apparatus according to claim 7,
The image processing apparatus, wherein the deformation processing unit does not perform deformation on the small region including an eye image.
請求項5記載の画像処理装置であって、さらに、
前記対象画像上の顔の画像を表す顔領域を検出する顔領域検出部を備え、
前記変形領域設定部は、検出された前記顔領域に基づき前記変形領域を設定する、画像処理装置。
The image processing apparatus according to claim 5, further comprising:
A face area detecting unit for detecting a face area representing a face image on the target image;
The deformation area setting unit is an image processing apparatus that sets the deformation area based on the detected face area.
請求項1ないし請求項9のいずれかに記載の画像処理装置であって、さらに、
前記変形領域内の画像の変形が行われた前記対象画像を印刷する印刷部を備える、画像処理装置。
The image processing apparatus according to claim 1, further comprising:
An image processing apparatus comprising: a printing unit that prints the target image on which the image in the deformation area has been deformed.
画像の変形を行う画像処理方法であって、
(a)対象画像上の少なくとも一部の領域を変形領域として設定する工程と、
(b)前記変形領域内に複数の分割点を配置し、前記分割点同士を結ぶ直線を用いて前記変形領域を複数の小領域に分割する工程と、
(c)少なくとも1つの前記分割点の位置を移動して前記小領域を変形することにより前記変形領域内の画像の変形を行う工程と、を備える、画像処理方法。
An image processing method for transforming an image,
(A) setting at least a partial area on the target image as a deformation area;
(B) arranging a plurality of division points in the deformation area, and dividing the deformation area into a plurality of small areas using a straight line connecting the division points;
And (c) deforming the image in the deformation area by moving the position of at least one of the division points to deform the small area.
画像の変形を行う画像処理のためのコンピュータプログラムであって、
対象画像上の少なくとも一部の領域を変形領域として設定する変形領域設定機能と、
前記変形領域内に複数の分割点を配置し、前記分割点同士を結ぶ直線を用いて前記変形領域を複数の小領域に分割する変形領域分割機能と、
少なくとも1つの前記分割点の位置を移動して前記小領域を変形することにより前記変形領域内の画像の変形を行う変形処理機能と、を、コンピュータに実現させる、コンピュータプログラム。
A computer program for image processing that performs image transformation,
A deformation area setting function for setting at least a part of the area on the target image as a deformation area;
A deformation area dividing function that arranges a plurality of dividing points in the deformation area and divides the deformation area into a plurality of small areas using a straight line connecting the dividing points;
A computer program that causes a computer to realize a deformation processing function of deforming an image in the deformation area by moving the position of at least one of the division points to deform the small area.
JP2009032871A 2009-02-16 2009-02-16 Image processing for image transformation Expired - Fee Related JP4930525B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009032871A JP4930525B2 (en) 2009-02-16 2009-02-16 Image processing for image transformation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009032871A JP4930525B2 (en) 2009-02-16 2009-02-16 Image processing for image transformation

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2007082325A Division JP4289415B2 (en) 2007-03-27 2007-03-27 Image processing for image transformation

Publications (3)

Publication Number Publication Date
JP2009104672A true JP2009104672A (en) 2009-05-14
JP2009104672A5 JP2009104672A5 (en) 2010-05-13
JP4930525B2 JP4930525B2 (en) 2012-05-16

Family

ID=40706206

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009032871A Expired - Fee Related JP4930525B2 (en) 2009-02-16 2009-02-16 Image processing for image transformation

Country Status (1)

Country Link
JP (1) JP4930525B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1145332A (en) * 1997-05-30 1999-02-16 Fuji Photo Film Co Ltd Device and method for deforming image
JP2004054759A (en) * 2002-07-23 2004-02-19 Mitsubishi Electric Corp Facial expression deforming device, method and program
JP2004318204A (en) * 2003-04-10 2004-11-11 Sony Corp Image processing device, image processing method, and photographing device
JP2006018467A (en) * 2004-06-30 2006-01-19 Canon Inc Image processing apparatus and image processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1145332A (en) * 1997-05-30 1999-02-16 Fuji Photo Film Co Ltd Device and method for deforming image
JP2004054759A (en) * 2002-07-23 2004-02-19 Mitsubishi Electric Corp Facial expression deforming device, method and program
JP2004318204A (en) * 2003-04-10 2004-11-11 Sony Corp Image processing device, image processing method, and photographing device
JP2006018467A (en) * 2004-06-30 2006-01-19 Canon Inc Image processing apparatus and image processing method

Also Published As

Publication number Publication date
JP4930525B2 (en) 2012-05-16

Similar Documents

Publication Publication Date Title
JP4289414B2 (en) Image processing for image transformation
JP4957463B2 (en) Image processing device
JP5076744B2 (en) Image processing device
JP4289415B2 (en) Image processing for image transformation
JP2009053914A (en) Image processor and image processing method
JP2009031870A (en) Image processing for estimation of photographic object distance
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
JP5338887B2 (en) Image processing device
JP4930298B2 (en) Specify image area
JP4853541B2 (en) Image processing apparatus and image processing method
JP4930525B2 (en) Image processing for image transformation
JP4862723B2 (en) Image processing for object position detection
JP4816540B2 (en) Image processing apparatus and image processing method
JP2008242802A (en) Image processing for detecting inclination of subject
JP5163801B2 (en) Apparatus, method, and computer program
JP4888188B2 (en) Image processing apparatus and image processing method
JP4957462B2 (en) Image processing device
JP4737324B2 (en) Image processing apparatus, image processing method, and computer program
JP2009110048A (en) Setting of face area
JP4946729B2 (en) Image processing device
JP2009055305A (en) Image processing adding information to image
JP2011141889A (en) Image processing apparatus and method
JP2009123101A (en) Estimation of face image direction

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100326

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100326

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110913

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110927

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111124

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: 20120117

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: 20120130

R150 Certificate of patent or registration of utility model

Ref document number: 4930525

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150224

Year of fee payment: 3

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees