JP2009151825A - Image processor and image processing method - Google Patents

Image processor and image processing method Download PDF

Info

Publication number
JP2009151825A
JP2009151825A JP2009089643A JP2009089643A JP2009151825A JP 2009151825 A JP2009151825 A JP 2009151825A JP 2009089643 A JP2009089643 A JP 2009089643A JP 2009089643 A JP2009089643 A JP 2009089643A JP 2009151825 A JP2009151825 A JP 2009151825A
Authority
JP
Japan
Prior art keywords
deformation
area
image
face
evaluation
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
JP2009089643A
Other languages
Japanese (ja)
Other versions
JP4853541B2 (en
JP2009151825A5 (en
Inventor
Akio Yamazaki
明生 山▲崎▼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2009089643A priority Critical patent/JP4853541B2/en
Publication of JP2009151825A publication Critical patent/JP2009151825A/en
Publication of JP2009151825A5 publication Critical patent/JP2009151825A5/ja
Application granted granted Critical
Publication of JP4853541B2 publication Critical patent/JP4853541B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a technology for acquiring a more preferable deformation processing result when regions of deformed objects are overlapped with each other. <P>SOLUTION: This image processor includes: a deformed region setting part for analyzing an object image TI and setting a plurality of deformed regions TA1, TA2 on the object image TI, and a deformation processing part for deforming images in the deformed regions TA1, TA2. The deformation processing part reduces the deformation amount of a partial region of part of each of the plurality of deformed regions TA1, TA2 including an overlapped portion of the plurality of deformed regions TA1, TA2 when the plurality of deformed regions TA1, TA2 are overlapped with each other. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、対象画像上の一部の領域を変形する画像処理技術に関する。   The present invention relates to an image processing technique for deforming a partial area on a target 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 above-described conventional image processing for image deformation, since the correction area where the image is deformed is set to an area representing the cheek image, these correction areas usually do not overlap. Therefore, no consideration is given to the case where the correction areas to be deformed overlap. This problem is common not only in image processing for correcting a face but also in general image processing for correcting a part of an image.

本発明は、上述した従来の課題を解決するためになされたものであり、変形対象の領域が重複した場合の変形処理結果をより好ましいものとする技術を提供することを目的とする。   The present invention has been made in order to solve the above-described conventional problems, and an object of the present invention is to provide a technique that makes the deformation processing result more preferable when the areas to be deformed overlap.

上記課題の少なくとも一部を解決するために、本発明の画像処理装置は、対象画像を解析して前記対象画像上に複数の変形領域を設定する変形領域設定部と、前記変形領域内の画像の変形を行う変形処理部と、を備え、前記変形処理部は、前記複数の変形領域が重複した場合に、前記複数の変形領域の重複部分を含む前記複数の変形領域のそれぞれの一部の部分領域の変形量を低減することを特徴とする。   In order to solve at least a part of the above problems, an image processing apparatus of the present invention analyzes a target image and sets a plurality of deformation regions on the target image, and an image in the deformation region. A deformation processing unit that performs the deformation of the plurality of deformation regions, and when the plurality of deformation regions overlap, the deformation processing unit includes a part of each of the plurality of deformation regions including an overlapping portion of the plurality of deformation regions. The amount of deformation of the partial region is reduced.

この構成によれば、重複部分を含む部分領域の変形量が低減されるので、複数の変形領域のそれぞれを変形する変形処理が重複部分に対して施されても、個々の変形処理の重複部分に対する影響が小さくなる。そのため、重複部分に変形処理を繰り返すことにより生じる画像の不自然な変形を抑制できるので、変形処理結果をより好ましいものとすることができる。   According to this configuration, since the amount of deformation of the partial area including the overlapping portion is reduced, even if the deformation processing for deforming each of the plurality of deformation regions is performed on the overlapping portion, the overlapping portion of the individual deformation processing The effect on is reduced. Therefore, since unnatural deformation of an image caused by repeating the deformation process on the overlapping portion can be suppressed, the deformation process result can be made more preferable.

前記変形処理部は、前記変形領域を複数に分割した小領域を変形することにより前記変形領域内の画像の変形を行い、前記部分領域は、前記複数の小領域のうちで前記重複部分に重なる全体または一部の領域であるものとしてもよい。   The deformation processing unit performs deformation of an image in the deformation area by deforming a small area obtained by dividing the deformation area into a plurality of areas, and the partial area overlaps the overlapping portion of the plurality of small areas. It is good also as what is the whole or one part area | region.

この構成によれば、小領域毎に変形量を設定することにより、重複部分に重なる小領域の変形量を低減することができる。そのため、部分領域の変形量の低減がより容易となる。   According to this configuration, by setting the deformation amount for each small region, the deformation amount of the small region overlapping the overlapping portion can be reduced. Therefore, the deformation amount of the partial area can be reduced more easily.

前記部分領域は、前記重複部分に重なる小領域をさらに分割した一部の領域を含むものとしてもよい。   The partial area may include a partial area obtained by further dividing a small area overlapping the overlapping part.

この構成によれば、重複部分に重なる小領域を分割することにより、部分領域をより小さくすることができる。そのため、変形領域のうちの変形量が低減される範囲をより小さくすることができる。   According to this configuration, the partial region can be made smaller by dividing the small region that overlaps the overlapping portion. Therefore, the range in which the deformation amount in the deformation region is reduced can be further reduced.

前記変形処理部は、前記部分領域の変形量をゼロに設定するものとしてもよい。   The deformation processing unit may set the deformation amount of the partial region to zero.

この構成によれば、部分領域の変形が行われないので、重複部分の画像は変形処理前の状態に維持される。そのため、変形処理を繰り返すことにより生じる画像の不自然な変形を抑制でき、変形処理結果をより好ましいものとすることができる。   According to this configuration, since the partial area is not deformed, the image of the overlapping portion is maintained in the state before the deformation process. Therefore, it is possible to suppress unnatural deformation of the image caused by repeating the deformation process, and to make the deformation process result more preferable.

前記対象画像は、人物の顔を含む画像であり、前記変形領域設定部は、前記人物の顔の複数の器官の画像を含む領域を前記変形領域として設定するものとしてもよい。   The target image may be an image including a person's face, and the deformation area setting unit may set an area including images of a plurality of organs of the person's face as the deformation area.

変形領域として人物の顔に含まれる複数の器官を含む場合、変形領域の重複が生じやすい。また、一般に、人物の顔は、画像の中での注目度が高い領域である。そのため、人物の顔を変形処理する場合には、より自然な変形結果とするのが望ましいので、優先順位に基づいて変形処理を行う効果がより大きくなる。   When a plurality of organs included in a person's face are included as the deformation area, the deformation areas tend to overlap. In general, the face of a person is a region having a high degree of attention in the image. For this reason, when a person's face is deformed, it is desirable to obtain a more natural deformation result, so that the effect of performing the deformation process based on the priority order is further increased.

[変形処理を行うための手段]
変形処理を行うために、前記画像処理装置は、画像の変形を行う画像処理装置であって、対象画像上の少なくとも一部の領域を変形領域として設定する変形領域設定部と、前記変形領域内に複数の分割点を配置し、前記分割点同士を結ぶ直線を用いて前記変形領域を複数の小領域に分割する変形領域分割部と、少なくとも1つの前記分割点の位置を移動して前記小領域を変形することにより前記変形領域内の画像の変形を行う変形処理部と、を備えるものとしてもよい。
[Means for performing deformation processing]
In order to perform deformation processing, the image processing device is an image processing device that performs image deformation, and includes a deformation area setting unit that sets at least a partial area on the target image as a deformation area; A plurality of dividing points are arranged in the area, and a deformation area dividing unit that divides the deformation area into a plurality of small areas using a straight line connecting the dividing points, and the position of at least one of the dividing points is moved to the small area. A deformation processing unit that deforms an image in the deformation area by deforming the 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つを選択して前記変形領域内の画像の変形に適用する変形タイプとして設定する変形態様設定部を備え、前記変形領域分割部は、前記設定された変形タイプに対応付けられた所定の配置パターンに従い前記複数の分割点を配置するとしてもよい。   The image processing apparatus further includes a deformation mode setting unit that selects one of a plurality of predetermined deformation types and sets it as a deformation type to be applied to the deformation of the image in the deformation area. The 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, and the deformation process The 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 a user designation regarding a movement direction and a movement amount of the division point for at least one of the division points, and the deformation processing unit includes: The position of the division point may be moved 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.

また、上記画像処理装置において、さらに、前記対象画像上の顔の画像を表す顔領域を検出する顔領域検出部を備え、前記変形領域設定部は、検出された前記顔領域に基づき前記変形領域を設定するとしてもよい。   The image processing apparatus further includes a face area detection unit that detects a face area representing a face image on the target image, and the deformation area setting unit is configured to detect the deformation area based on the detected face area. May be set.

このようにすれば、対象画像から検出された顔領域に基づき設定された変形領域の画像変形について、多様な変形態様に対応した画像変形のための画像処理を、容易に、かつ効率的に実現することができる。   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.

また、上記画像処理装置において、さらに、前記変形領域内の画像の変形が行われた前記対象画像を印刷する印刷部を備えるとしてもよい。このようにすれば、多様な変形態様に対応した画像変形後の画像の印刷を、容易に、かつ効率的に実現することができる。   The image processing apparatus may further include a printing unit that prints the target image on which the image in the deformation area has been deformed. 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 is an explanatory diagram schematically showing a configuration of a printer to which an image processing apparatus as an embodiment of the present invention is applied. 画像の一覧表示を含むユーザインタフェースの一例を示す説明図である。It is explanatory drawing which shows an example of the user interface containing the list display of an image. プリンタにおいて顔形状補正印刷を行う際に実行される顔形状補正印刷ルーチンを示すフローチャート。7 is a flowchart illustrating a face shape correction printing routine executed when face shape correction printing is performed in a printer. 第1実施例における顔形状補正処理ルーチンを示すフローチャート。The flowchart which shows the face shape correction process routine in 1st Example. 画像変形のタイプおよび度合いを設定するためのユーザインタフェースの一例を示す説明図。Explanatory drawing which shows an example of the user interface for setting the type and degree of image deformation. 顔領域の検出結果の一例を示す説明図。Explanatory drawing which shows an example of the detection result of a face area | region. 変形領域の設定結果を示す説明図。Explanatory drawing which shows the setting result of a deformation | transformation area | region. 2つの変形領域のそれぞれが小領域に分割された様子を示す説明図。Explanatory drawing which shows a mode that each of two deformation | transformation area | regions was divided | segmented into the small area | region. 2つの変形領域のそれぞれに属する小領域が変形される様子を示す説明図。Explanatory drawing which shows a mode that the small area | region which belongs to each of two deformation | transformation area | regions is deform | transformed. 第1実施例において変形処理が行われた結果を示す説明図。Explanatory drawing which shows the result by which the deformation | transformation process was performed in 1st Example. 非重複小領域と重複小領域の双方に変形処理を施す様子を示す説明図。Explanatory drawing which shows a mode that a deformation | transformation process is performed to both a non-overlapping small area | region and an overlapping small area | region. 比較例において重複する2つの変形領域のいずれにも変形処理を行った結果を示す説明図。Explanatory drawing which shows the result of performing a deformation | transformation process to any of the two deformation area | regions which overlap in a comparative example. 顔形状補正後の対象画像が表示された表示部の状態の一例を示す説明図。Explanatory drawing which shows an example of the state of the display part in which the target image after face shape correction | amendment was displayed. 第2実施例におけるプリンタの構成を概略的に示す説明図。Explanatory drawing which shows schematically the structure of the printer in 2nd Example. 第2実施例における顔形状補正処理ルーチンを示すフローチャート。The flowchart which shows the face shape correction process routine in 2nd Example. 分割形態を変更した場合における変形領域の分割結果を示す説明図。Explanatory drawing which shows the division | segmentation result of a deformation | transformation area | region at the time of changing a division | segmentation form. 第2実施例において2つの変形領域の小領域が変形される様子を示す説明図。Explanatory drawing which shows a mode that the small area | region of two deformation | transformation areas is deform | transformed in 2nd Example. 第2実施例において変形処理が行われた結果を示す説明図。Explanatory drawing which shows the result by which the deformation | transformation process was performed in 2nd Example. 顔領域FAの検出結果の別の一例を示す説明図。Explanatory drawing which shows another example of the detection result of face area FA. 変形領域の設定処理の流れを示すフローチャート。The flowchart which shows the flow of a setting process of a deformation | transformation area | region. 顔領域FAの高さ方向の位置調整処理の流れを示すフローチャート。The flowchart which shows the flow of the position adjustment process of the height direction of face area FA. 特定領域SAの一例を示す説明図。Explanatory drawing which shows an example of specific area | region SA. 評価値の算出方法の一例を示す説明図。Explanatory drawing which shows an example of the calculation method of an evaluation value. 評価対象画素TPの選択方法の一例を示す説明図。Explanatory drawing which shows an example of the selection method of evaluation object pixel TP. 高さ基準点Rhの決定方法の一例を示す説明図。Explanatory drawing which shows an example of the determination method of height reference point Rh. 概略傾き角RIの算出方法の一例を示す説明図。Explanatory drawing which shows an example of the calculation method of rough inclination angle RI. 顔領域FAの高さ方向の位置調整方法の一例を示す説明図。Explanatory drawing which shows an example of the position adjustment method of the height direction of face area FA. 顔領域FAの傾き調整処理の流れを示すフローチャート。The flowchart which shows the flow of the inclination adjustment process of face area FA. 顔領域FAの傾き調整のための評価値の算出方法の一例を示す説明図。Explanatory drawing which shows an example of the calculation method of the evaluation value for inclination adjustment of the face area FA. 各評価方向についての評価値の分散の算出結果の一例を示す説明図。Explanatory drawing which shows an example of the calculation result of the dispersion | distribution of the evaluation value about each evaluation direction. 顔領域FAの傾き調整方法の一例を示す説明図。Explanatory drawing which shows an example of the inclination adjustment method of face area FA. 変形領域TAの設定方法の一例を示す説明図。Explanatory drawing which shows an example of the setting method of deformation | transformation area | region TA. 変形領域TAの小領域への分割方法の一例を示す説明図。Explanatory drawing which shows an example of the division | segmentation method into the small area | region of the deformation | transformation area | region TA. 分割点移動テーブル420の内容の一例を示す説明図。Explanatory drawing which shows an example of the content of the dividing point movement table. 分割点移動テーブル420に従った分割点Dの位置の移動の一例を示す説明図。Explanatory drawing which shows an example of the movement of the position of the dividing point D according to the dividing point movement table 420. FIG. 分割領域変形部260による画像の変形処理方法の概念を示す説明図。FIG. 3 is an explanatory diagram showing a concept of an image deformation processing method by a divided region deformation unit 260. 三角形領域における画像の変形処理方法の概念を示す説明図。Explanatory drawing which shows the concept of the deformation | transformation processing method of the image in a triangular area | region. 顔形状補正の態様の一例を示す説明図。Explanatory drawing which shows an example of the aspect of face shape correction | amendment.

次に、本発明の実施の形態を実施例に基づいて以下の順序で説明する。
A.第1実施例:
B.第2実施例:
C.変形領域の設定:
D.分割点配置の態様:
E.小領域の変形:
F.変形例:
Next, embodiments of the present invention will be described in the following order based on examples.
A. First embodiment:
B. Second embodiment:
C. Deformation area settings:
D. Division point arrangement:
E. Small area transformation:
F. Variations:

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

プリンタエンジン160は、印刷データに基づき印刷を行う印刷機構である。カードインタフェース170は、カードスロット172に挿入されたメモリカードMCとの間でデータのやり取りを行うためのインタフェースである。なお、第1実施例では、メモリカード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 in the card slot 172. In the first 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と、重複小領域検出部270と、を含んでいる。変形態様設定部210は、指定取得部212を含んでいる。後述するように、変形領域分割部250と、分割領域変形部260と、重複小領域検出部270と、により画像の変形が行われる。そのため、変形領域分割部250と分割領域変形部260と重複小領域検出部270とは、併せて「変形処理部」とも呼ぶことができる。これらの各部の機能については、後述する。   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 divided region deformation unit. 260 and the overlapping small area detection unit 270. The deformation mode setting unit 210 includes a designation acquisition unit 212. As will be described later, the deformation region dividing unit 250, the divided region deforming unit 260, and the overlapping small region detecting unit 270 perform image deformation. Therefore, the deformation area dividing unit 250, the divided area deformation unit 260, and the overlapping small area detection unit 270 can be collectively referred to as a “deformation processing unit”. The functions of these units will be 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 be described in detail in the description of the face deformation process described later.

プリンタ100は、メモリカードMCに格納された画像データに基づき、画像の印刷を行う。カードスロット172にメモリカードMCが挿入されると、表示処理部310により、メモリカードMCに格納された画像の一覧表示を含むユーザインタフェースが表示部150に表示される。図2は、画像の一覧表示を含むユーザインタフェースの一例を示す説明図である。なお、第1実施例では、画像の一覧表示は、メモリカードMCに格納された画像データ(画像ファイル)に含まれるサムネイル画像を用いて実現される。図2に示すユーザインタフェースには、8つのサムネイル画像TN1〜TN6と、5つのボタンBN1〜BN5が表示されている。   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 the first embodiment, the list display of images is realized using thumbnail images included in image data (image files) stored in the memory card MC. In the user interface shown in FIG. 2, eight thumbnail images TN1 to TN6 and five buttons BN1 to BN5 are displayed.

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

図3は、プリンタ100において顔形状補正印刷を行う際に実行される顔形状補正印刷ルーチンを示すフローチャートである。ステップS100では、顔形状補正部200(図1)が、顔形状補正処理を実行する。顔形状補正処理は、画像中の顔の少なくとも一部の形状(例えば顔の輪郭形状や目の形状)を補正する処理である。なお、目や鼻などの顔の一部分は、一般に器官とも呼ばれる。   FIG. 3 is a flowchart illustrating a face shape correction printing routine executed when the printer 100 performs face shape correction printing. In step S100, the face shape correction unit 200 (FIG. 1) executes face shape correction processing. The face shape correction process 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). A part of the face such as eyes and nose is generally called an organ.

図4は、図3のステップS100において実行される顔形状補正処理ルーチンを示すフローチャートである。ステップS110では、顔形状補正部200(図1)が、顔形状補正処理の対象となる対象画像を設定する。顔形状補正部200は、図2に示したユーザインタフェースにおいてユーザにより選択されたサムネイル画像TN1に対応する画像を対象画像として設定する。設定された対象画像の画像データは、メモリカードMCからカードインタフェース170を介してプリンタ100に取得され、内部メモリ120の所定領域に格納される。なお、以下では、このようにメモリーカードMCから取得され、プリンタ100の内部メモリ120に格納された画像データを「元画像データ」とも呼ぶ。また、元画像データにより表される画像を「元画像」とも呼ぶ。   FIG. 4 is a flowchart showing the face shape correction processing routine executed in step S100 of FIG. In step S110, the face shape correction unit 200 (FIG. 1) sets a target image to be subjected to face shape correction processing. The face shape correction unit 200 sets an image corresponding to the thumbnail image TN1 selected by the user in the user interface shown in FIG. 2 as a target image. The set image data of the target image 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. Hereinafter, the image data acquired from the memory card MC and stored in the internal memory 120 of the printer 100 is also referred to as “original image data”. An image represented by the original image data is also referred to as “original image”.

なお、第1実施例では、対象画像は、図2に示したユーザインタフェースにおけるユーザの選択結果に応じて設定されているが、他の方法で対象画像を設定することも可能である。例えば、画像データに格納されているExif情報等の情報や、画像データのシーン判別結果などに基づいて、メモリカードMCに格納された複数の画像の中から顔を含む画像(顔画像)を抽出し、抽出された顔画像を対象画像に設定することも可能である。また、抽出された顔画像の一覧表示を含むユーザインタフェースにおいて、ユーザに単数または複数の顔画像を選択させ、その選択結果に応じて対象画像を設定するものとしてもよい。なお、複数の画像が対象画像として設定された場合、複数の画像に対して同時に顔形状の補正を施してもよく、複数の画像に優先順位を付け、その優先順位に従って複数の画像に顔形状の補正を施しても良い。   In the first embodiment, the target image is set according to the selection result of the user in the user interface shown in FIG. 2, but the target image can be set by other methods. For example, an image (face image) including a face is extracted from a plurality of images stored in the memory card MC based on information such as Exif information stored in the image data or a scene determination result of the image data. In addition, the extracted face image can be set as the target image. In addition, in a user interface including a list display of extracted face images, the user may select one or a plurality of face images and set the target image according to the selection result. When a plurality of images are set as target images, face shape correction may be performed on the plurality of images at the same time. Priorities are assigned to the plurality of images, and the face shapes are applied to the plurality of images according to the priorities. May be corrected.

ステップ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に示すように、このユーザインタフェースには、画像変形タイプを設定するためのインタフェースが含まれている。第1実施例では、例えば、顔の形状をシャープにする変形タイプ「タイプ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, the user interface includes an interface for setting an image deformation type. In the first 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に示すように、第1実施例では、画像変形の度合いとして、強(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 the first 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 through 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. A check box provided in the user interface is checked when the user desires detailed designation of the deformation mode.

以降では、画像変形のタイプとして顔の形状をシャープにするための変形タイプ「タイプ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)が、対象画像における顔領域の検出を行う。ここで、顔領域とは、対象画像上の画像領域であって、少なくとも顔の一部の画像が含まれる領域を意味している。顔領域検出部220による顔領域の検出は、例えばテンプレートを利用したパターンマッチングによる方法(特開2004−318204参照)といった公知の顔検出方法を用いて実行される。   In step S130 (FIG. 4), the face area detection unit 220 (FIG. 1) detects a face area in the target image. Here, the face area is an image area on the target image and means an area including at least a partial image of the face. The detection of the face area 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は、顔領域の検出結果の一例を示す説明図である。図6の例では、対象画像TIには2人の人物が含まれている。そのため、ステップS130における顔検出により、対象画像TIからは、2人の人物に対応して2つの顔領域FA1,FA2が検出される。これらの顔領域は、図6に示すように、それぞれの目と鼻と口の画像を含む矩形の領域となっている。   FIG. 6 is an explanatory diagram illustrating an example of a face area detection result. In the example of FIG. 6, the target image TI includes two persons. Therefore, two face areas FA1 and FA2 corresponding to two persons are detected from the target image TI by the face detection in step S130. As shown in FIG. 6, these face areas are rectangular areas including respective eyes, nose, and mouth images.

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

なお、ステップS130では、テンプレートを利用したパターンマッチングにより、対象画像から顔が検出される。このようなテンプレートを利用したパターンマッチングによる方法等の公知の顔検出方法は、一般に、顔全体や顔の部位(目や口等)について位置や傾き(角度)を詳細に検出するものではなく、対象画像中から顔の画像が概ね含まれると考えられる領域を顔領域として設定するものである。   In step S130, a face is detected from the target image by pattern matching using a template. Known face detection methods such as a pattern matching method using a template generally do not detect in detail the position and inclination (angle) of the entire face or part of the face (eyes, mouth, etc.) An area that is considered to include a face image from the target image is set as a face area.

ステップS500において、プリンタ100は、検出された顔領域に基づいて顔形状補正のための画像変形処理を施す領域(変形領域)を設定する。具体的には、自然で好ましい顔形状補正が実現されるように、ステップS130で検出された顔領域について位置調整および傾き調整を行うことにより、変形領域が設定される。このように変形領域を設定することにより、一般的に観察者の注目度が高い顔の画像が、設定された変形領域と顔の画像との位置や角度の関係によって不自然に変形されることが抑制される。なお、変形領域を設定する方法については、後述の変形領域の設定の説明において詳述する。   In step S500, the printer 100 sets an area (deformation area) to be subjected to image deformation processing for face shape correction based on the detected face area. Specifically, the deformation area is set by performing position adjustment and inclination adjustment on the face area detected in step S130 so that natural and preferable face shape correction is realized. By setting the deformation area in this way, a face image that generally has a high degree of attention of the observer is unnaturally deformed depending on the position and angle relationship between the set deformation area and the face image. Is suppressed. The method for setting the deformation area will be described in detail in the description of the deformation area setting described later.

図7は、ステップS500における変形領域の設定結果を示す説明図である。図7の破線は、ステップS130において対象画像TIから検出された2つの顔領域FA1,FA2を示している。図7の太線は、2つの顔領域FA1,FA2のそれぞれについて設定された変形領域を示している。図7に示すように、ステップS500では、これらの2つの顔領域FA1,FA2のそれぞれに対応した2つの変形領域TA1,TA2が設定される。   FIG. 7 is an explanatory diagram showing the setting result of the deformation area in step S500. The broken lines in FIG. 7 indicate the two face areas FA1 and FA2 detected from the target image TI in step S130. The thick lines in FIG. 7 indicate the deformation areas set for each of the two face areas FA1 and FA2. As shown in FIG. 7, in step S500, two deformation areas TA1, TA2 corresponding to each of these two face areas FA1, FA2 are set.

なお、第1実施例では、顔検出(図4のステップS130)前のステップS120において、変形態様を設定しているが、ステップS130あるいはステップS500の後、更にステップS120と同様の処理を行うことにより、変形態様を設定できるようにしても良い。このように、ステップS130の顔検出後に変形態様を設定可能とすることにより、ステップS120において設定された変形態様がユーザの好みに合わず、変形態様を再度設定する場合に、顔検出処理を省略することが可能となる。   In the first embodiment, the deformation mode is set in step S120 before face detection (step S130 in FIG. 4), but after step S130 or step S500, the same processing as step S120 is performed. Thus, the deformation mode may be set. In this way, by making it possible to set the deformation mode after the face detection in step S130, the face detection process is omitted when the deformation mode set in step S120 does not suit the user's preference and the deformation mode is set again. It becomes possible to do.

図4のステップS140では、設定された2つの変形領域TA1,TA2のそれぞれに対して分割点(後述する)が配置され、個々の変形領域TA1,TA2がそれぞれ15個の矩形の小領域に分割される。図8は、図4のステップS500において設定された2つの変形領域TA1,TA2のそれぞれが、小領域に分割された様子を示す説明図である。なお、分割点を配置することによる変形領域TA1,TA2の小領域への分割については、後述の分割点配置の態様の説明において詳述する。   In step S140 of FIG. 4, division points (described later) are arranged for each of the two set deformation areas TA1 and TA2, and each of the deformation areas TA1 and TA2 is divided into 15 rectangular small areas. Is done. FIG. 8 is an explanatory diagram showing a state in which each of the two deformation areas TA1, TA2 set in step S500 of FIG. 4 is divided into small areas. In addition, the division | segmentation into deformation | transformation area | region TA1, TA2 by arrange | positioning a dividing point to a small area | region is explained in full detail in description of the aspect of the dividing point arrangement | positioning mentioned later.

図8(a)は、図4のステップS500において設定された2つの変形領域TA1,TA2の配置を示している。図8(b)は、ステップS140において、2つの変形領域TA1,TA2のそれぞれが小領域に分割された様子を示している。図8(a)に示すように、ステップS500において設定された2つの変形領域TA1,TA2は、互いに重複した状態となっている。そのため、変形領域TA1の小領域のうち、右上から左下方向のハッチングを付した小領域は、変形領域TA2に重なっている。一方、変形領域TA2の左上から右下方向のハッチングを付した小領域は、変形領域TA1に重なっている。以下では、このように、ある変形領域に属する小領域であって、他の変形領域に重なる小領域を「重複小領域」とも呼ぶ。図8(b)から明らかなように、変形領域TA1,TA2のそれぞれの重複小領域は、変形領域TA1,TA2の重複部分を含んでいる。なお、重複小領域は、変形領域の一部の領域であるので、「部分領域」ともいうことができる。   FIG. 8A shows the arrangement of the two deformation areas TA1 and TA2 set in step S500 of FIG. FIG. 8B shows how each of the two deformation areas TA1 and TA2 is divided into small areas in step S140. As shown in FIG. 8A, the two deformation areas TA1 and TA2 set in step S500 are overlapped with each other. Therefore, among the small areas of the deformation area TA1, the small area hatched from the upper right to the lower left overlaps the deformation area TA2. On the other hand, the small area hatched from the upper left to the lower right of the deformation area TA2 overlaps the deformation area TA1. Hereinafter, a small region that belongs to a certain deformation region and overlaps another deformation region is also referred to as an “overlapping small region”. As is apparent from FIG. 8B, the overlapping small areas of the deformation areas TA1 and TA2 include overlapping portions of the deformation areas TA1 and TA2. Since the overlapping small area is a partial area of the deformation area, it can also be referred to as a “partial area”.

ステップS150において、重複小領域検出部270(図1)は、ステップS140において分割された個々の変形領域に属する小領域のうち、図8(b)のハッチングで示すように他の変形領域に重なっている小領域を検出する。個々の変形領域に属する小領域が、他の変形領域に重なっているか否かは、平面図形の重なりの有無を判断する種々のアルゴリズムを用いて判断することができる。例えば、小領域と他の変形領域の輪郭線同士が交差するか否かを調べることにより判断することができる。また、小領域内の点が他の変形領域に含まれるか否かを調べることにより判断することもできる。小領域と他の変形領域がいずれも凸多角形であれば、小領域の頂点が他の変形領域内に入るか否か、あるいは、他の変形領域の頂点が小領域内にはいるか否かを調べることにより判断することができる。   In step S150, the overlapping small area detection unit 270 (FIG. 1) overlaps with other deformation areas as shown by hatching in FIG. 8B among the small areas belonging to the individual deformation areas divided in step S140. Detect small area. Whether or not a small area belonging to each deformation area overlaps with another deformation area can be determined using various algorithms for determining whether or not there is an overlap of plane figures. For example, it can be determined by examining whether or not the contour lines of the small region and the other deformation region intersect. It can also be determined by examining whether or not a point in the small area is included in another deformation area. If the small area and the other deformation area are both convex polygons, whether the vertex of the small area falls within the other deformation area, or whether the vertex of the other deformation area is within the small area Can be determined by examining the above.

次いで、ステップS160において、分割領域変形部260(図1)は、変形領域TA1,TA2のそれぞれの小領域のうち、他方の変形領域に重なっていない小領域(非重複小領域)の変形処理を行う。非重複小領域の変形処理は、変形領域を小領域に分割する際に配置された分割点を移動させることにより行われる。なお、具体的な変形処理の内容は、後述の小領域の変形の説明において詳述する。   Next, in step S160, the divided region deformation unit 260 (FIG. 1) performs a deformation process on a small region (non-overlapping small region) that does not overlap the other deformation region among the small regions of the deformation regions TA1 and TA2. Do. The deformation process of the non-overlapping small area is performed by moving the dividing points arranged when the deformation area is divided into small areas. The specific content of the deformation process will be described in detail in the description of the deformation of the small area described later.

図8に示すように、複数の変形領域TA1,TA2がある場合には、個々の変形領域についての変形処理が元画像に対して施される。これらの複数の変形領域に対する変形処理は、個々の変形領域の変形処理を繰り返すことにより実行してもよく、複数の変形領域に対して同時に変形処理を実行するものとしてもよい。   As shown in FIG. 8, when there are a plurality of deformation areas TA1, TA2, deformation processing for each deformation area is performed on the original image. The deformation process for the plurality of deformation areas may be executed by repeating the deformation process for each of the deformation areas, or the deformation process may be simultaneously performed for the plurality of deformation areas.

図9は、ステップS160において、2つの変形領域TA1,TA2のそれぞれに属する小領域が変形される様子を示す説明図である。変形領域TA1内の黒丸DA11,DA12,DA21および白丸DA22,DA31,DA32,DA41,DA42は、変形領域TA1を小領域に分割する際に配置された分割点を示している。同様に、変形領域TA2内の黒丸DB41,DB42および白丸DB11,DB12,DB21,DB22,DB31,DB32は、変形領域TA2を小領域に分割する際に配置された分割点を示している。なお、図9においても、変形領域TA1,TA2内の重複小領域は、ハッチングを付して示している。   FIG. 9 is an explanatory diagram showing how the small areas belonging to each of the two deformation areas TA1 and TA2 are deformed in step S160. Black circles DA11, DA12, DA21 and white circles DA22, DA31, DA32, DA41, DA42 in the deformation area TA1 indicate division points arranged when the deformation area TA1 is divided into small areas. Similarly, black circles DB41 and DB42 and white circles DB11, DB12, DB21, DB22, DB31, and DB32 in the deformation area TA2 indicate division points arranged when the deformation area TA2 is divided into small areas. In FIG. 9, the overlapping small areas in the deformation areas TA1 and TA2 are shown with hatching.

図9の例では、変形領域TA1の重複小領域の頂点となる分割点は、白丸で示す5つの分割点DA22,DA31,DA32,DA41,DA42となっている。そのため、ステップS160における変形処理では、これらの分割点DA22,DA31,DA32,DA41,DA42の移動は行われない。一方、重複小領域の頂点となっていない黒丸で示す分割点DA11,DA12,DA21は、黒丸の位置から星印の位置に移動される。このように分割点DA11,DA12,DA21を移動することにより、点線で示す小領域は、実線で示すように変形される。   In the example of FIG. 9, the dividing points that are the vertices of the overlapping small area of the deformation area TA1 are five dividing points DA22, DA31, DA32, DA41, DA42 indicated by white circles. Therefore, in the deformation process in step S160, these division points DA22, DA31, DA32, DA41, DA42 are not moved. On the other hand, the dividing points DA11, DA12, DA21 indicated by black circles that are not the vertices of the overlapping small areas are moved from the positions of the black circles to the positions of the stars. By moving the dividing points DA11, DA12, DA21 in this way, the small area indicated by the dotted line is deformed as indicated by the solid line.

同様に、変形領域TA2の重複小領域の頂点となる分割点は、白丸で示す6つの分割点DB11,DB12,DB21,DB22,DB31,DB32となっている。そのため、ステップS160における変形処理では、これらの分割点DB11,DB12,DB21,DB22,DB31,DB32の移動は行われない。一方、重複小領域の頂点となっていない黒丸で示す分割点DB41,DB42は、黒丸の位置から星印の位置に移動される。このように分割点DB41,DB42を移動することにより、点線で示す小領域は、実線で示すように変形される。   Similarly, the division points that are the vertices of the overlapping small area of the deformation area TA2 are six division points DB11, DB12, DB21, DB22, DB31, and DB32 indicated by white circles. Therefore, in the deformation process in step S160, these division points DB11, DB12, DB21, DB22, DB31, and DB32 are not moved. On the other hand, the dividing points DB41 and DB42 indicated by the black circles that are not the vertices of the overlapping small areas are moved from the black circle positions to the star positions. By moving the dividing points DB41 and DB42 in this way, the small area indicated by the dotted line is deformed as indicated by the solid line.

図10は、第1実施例において変形処理が行われた結果を示す説明図である。図10(a)は、図4のステップS140〜S160による変形処理前の対象画像TIを示している。図10(b)は、変形処理後の対象画像TIを示している。上述のように、対象画像TI中の2人の人物の顔のそれぞれに設定された2つの変形領域TA1,TA2は重なり合っている。そのため、2つの変形領域TA1,TA2のそれぞれの非重複小領域のみが変形され、重複小領域は変形されない。そのため、図10(b)に示すように、変形領域TA1内の非重複小領域に含まれる左側の人物の顔が細くなる。また、変形領域TA2内の非重複小領域に含まれる右側の人物の顔の一部が変形され、顔の輪郭がやや細くなっている。一方、2つの変形領域TA1,TA2が重なっている部分は、重複小領域に含まれる。そのため、変形領域TA1,TA2の重複部分は、変形処理前(図10(a))と同じ状態となっている。   FIG. 10 is an explanatory diagram illustrating a result of the deformation process performed in the first embodiment. FIG. 10A shows the target image TI before the deformation processing in steps S140 to S160 in FIG. FIG. 10B shows the target image TI after the deformation process. As described above, the two deformation areas TA1 and TA2 set on the faces of two persons in the target image TI overlap each other. Therefore, only the non-overlapping small areas of the two deformation areas TA1 and TA2 are deformed, and the overlapping small areas are not deformed. Therefore, as shown in FIG. 10B, the face of the left person included in the non-overlapping small area in the deformation area TA1 becomes thin. Further, a part of the face of the right person included in the non-overlapping small area in the deformation area TA2 is deformed, and the outline of the face is slightly narrowed. On the other hand, a portion where the two deformation areas TA1 and TA2 overlap is included in the overlapping small area. Therefore, the overlapping portions of the deformation areas TA1 and TA2 are in the same state as before the deformation process (FIG. 10A).

図11は、比較例として、非重複小領域と重複小領域の双方に変形処理を施す様子を示す説明図である。非重複小領域と重複小領域のいずれにも変形処理を施す場合、変形領域TA1,TA2の分割点DA11〜DA42,DB11〜DB42は、全て移動の対象となる。そのため、これらの分割点DA11〜DA42,DB11〜DB42は、それぞれ星印で示す位置に移動される。なお、図11の例では、図5で示すように、画像変形のタイプとして、顔の形状をシャープにするための変形タイプ「タイプA」が設定されている。そのため、目の大きさを変形しないように変形処理が行われるので、4つの分割点DA22,DA32,DB22,DB32は、移動されない。   FIG. 11 is an explanatory diagram showing a state in which deformation processing is performed on both the non-overlapping small region and the overlapping small region as a comparative example. When the deformation process is performed on both the non-overlapping small area and the overlapping small area, the dividing points DA11 to DA42 and DB11 to DB42 of the deformation areas TA1 and TA2 are all objects to be moved. Therefore, these division points DA11 to DA42 and DB11 to DB42 are moved to positions indicated by asterisks, respectively. In the example of FIG. 11, as shown in FIG. 5, a deformation type “type A” for sharpening the shape of the face is set as the image deformation type. For this reason, since the deformation process is performed so as not to deform the size of the eyes, the four division points DA22, DA32, DB22, DB32 are not moved.

図12は、比較例において重複する2つの変形領域TA1,TA2のいずれにも変形処理を行った結果を示す説明図である。図12(a)は、変形処理が施される前の対象画像TI(元画像)を示している。図12(b)は、重複小領域に変形処理を施した比較例における変形処理結果を示している。図12(c)は、重複小領域に変形処理を施さない第1実施例の変形処理結果を示している。上述のように、変形領域内の変形処理後の画像は、元画像に変形処理が施された画像となっている。そのため、2つの変形領域TA1,TA2の重複した部分では、最初の変形結果に後からの変形処理結果が上書きされる。そのため、重複小領域にも変形処理を施す比較例では、図12(b)において太線で示すように、不連続な境界線BLが発生する。   FIG. 12 is an explanatory diagram illustrating a result of performing the deformation process on both of the two deformation areas TA1 and TA2 that overlap in the comparative example. FIG. 12A shows a target image TI (original image) before the deformation process is performed. FIG. 12B shows a deformation process result in the comparative example in which the deformation process is performed on the overlapping small area. FIG. 12C shows the result of the deformation process of the first embodiment in which the deformation process is not performed on the overlapping small area. As described above, the image after the deformation process in the deformation area is an image obtained by performing the deformation process on the original image. Therefore, in the overlapping part of the two deformation areas TA1 and TA2, the first deformation result is overwritten with the later deformation processing result. For this reason, in the comparative example in which the deformation process is performed also on the overlapping small areas, a discontinuous boundary line BL is generated as shown by a thick line in FIG.

一方、第1実施例によれば、重複小領域に変形処理を施さないことにより、図12(c)に示すように変形処理後の画像には不連続な境界は発生しない。このように、第1実施例では、変形処理後の画像に不連続な境界が発生して、変形処理後の画像が不自然な画像となることを抑制することができる。   On the other hand, according to the first embodiment, since the deformation process is not performed on the overlapping small regions, a discontinuous boundary does not occur in the image after the deformation process as shown in FIG. As described above, in the first embodiment, it is possible to suppress the occurrence of a discontinuous boundary in the image after the deformation process and the image after the deformation process from being an unnatural image.

図4のステップS160において、非重複小領域の変形処理が行われた後、制御は、図3の顔形状補正印刷ルーチンに戻される。   In step S160 of FIG. 4, after the non-overlapping small region deformation process is performed, control is returned to the face shape correction printing routine of FIG.

図4の顔形状補正処理ルーチンから制御が戻されると、図3のステップS200において、変形処理後の画像(補正画像)が表示される。具体的には、顔形状補正部200(図1)が、顔形状補正後の対象画像を表示部150に表示するよう表示処理部310に指示する。図13は、顔形状補正後の対象画像TIが表示された表示部150の状態の一例を示す説明図である。顔形状補正後の対象画像TIが表示された表示部150により、ユーザは、補正結果を確認することができる。ユーザが補正結果に満足せず「戻る」ボタンを選択した場合には、例えば表示部150に図5に示した変形タイプおよび変形度合いを選択する画面が表示され、ユーザによる変形タイプや変形度合いの再度の設定が実行される。ユーザが補正結果に満足し、「印刷」ボタンを選択した場合には、以下の補正画像印刷処理が開始される。なお、第1実施例では、表示部150には補正画像が表示されているが、表示部150に元画像と補正画像とを同時に表示することも可能である。   When the control returns from the face shape correction processing routine of FIG. 4, an image (corrected image) after the deformation processing is displayed in step S200 of FIG. Specifically, the face shape correction unit 200 (FIG. 1) instructs the display processing unit 310 to display the target image after the face shape correction on the display unit 150. FIG. 13 is an explanatory diagram illustrating an example of the state of the display unit 150 on which the target image TI after the face shape correction is displayed. The display unit 150 displaying the target image TI after the face shape correction allows the user to check the correction result. 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. In the first embodiment, the corrected image is displayed on the display unit 150. However, the original image and the corrected image can be displayed on the display unit 150 at the same time.

ステップS300では、印刷処理部320(図1)が、プリンタエンジン160を制御して、顔形状補正処理後の対象画像の印刷を行う。印刷処理部320は、顔形状補正処理後の対象画像の画像データに、解像度変換やハーフトーン処理などの処理を施して印刷データを生成する。生成された印刷データは、印刷処理部320からプリンタエンジン160に供給され、プリンタエンジン160は対象画像の印刷を実行する。これにより、顔形状補正後の対象画像の印刷が完了する。   In step S300, the print processing unit 320 (FIG. 1) controls the printer engine 160 to print the target image after the face shape correction process. The print processing unit 320 generates print data by performing processing such as resolution conversion and halftone processing on the image data of the target image after the face shape correction processing. The generated print data is supplied from the print processing unit 320 to the printer engine 160, and the printer engine 160 prints the target image. Thereby, the printing of the target image after the face shape correction is completed.

B.第2実施例:
図14は、第2実施例におけるプリンタ100aの構成を概略的に示す説明図である。第2実施例のプリンタ100aは、顔形状補正部200aが領域重複検出部280と、分割形態変更部290と、を含んでいる点で、図1に示す第1実施例のプリンタ100と異なっている。他の点は、第1実施例のプリンタ100と同様である。
B. Second embodiment:
FIG. 14 is an explanatory diagram schematically showing the configuration of the printer 100a in the second embodiment. The printer 100a of the second embodiment is different from the printer 100 of the first embodiment shown in FIG. 1 in that the face shape correction unit 200a includes an area overlap detection unit 280 and a division form change unit 290. Yes. Other points are the same as those of the printer 100 of the first embodiment.

図15は、第2実施例における顔形状補正処理ルーチンを示すフローチャートである。この顔形状補正処理ルーチンは、第1実施例の顔形状補正処理ルーチン(図4)と同様に、顔形状補正印刷ルーチン(図3)のステップS100において実行される。第2実施例の顔形状補正処理ルーチンは、2つのステップS132,S134がステップS140の前に付加されている点で、図4に示す第1実施例の顔形状補正処理ルーチンと異なっている。他の点は、第1実施例の顔形状補正印刷ルーチンと同じである。   FIG. 15 is a flowchart showing a face shape correction processing routine in the second embodiment. This face shape correction processing routine is executed in step S100 of the face shape correction printing routine (FIG. 3) in the same manner as the face shape correction processing routine (FIG. 4) of the first embodiment. The face shape correction processing routine of the second embodiment is different from the face shape correction processing routine of the first embodiment shown in FIG. 4 in that two steps S132 and S134 are added before step S140. The other points are the same as the face shape correction printing routine of the first embodiment.

ステップS132において、領域重複検出部280は、ステップS500において設定された変形領域の重複の有無を検出する。変形領域の重複の有無は、重複小領域(ステップS150)の検出と同様に、平面図形の重なりの有無を判断する種々のアルゴリズムを用いて判断することができる。検出の結果、変形領域が重複していると判断された場合には、制御はステップS134に移される。一方、変形領域が重複していないと判断された場合には、制御はステップS140に移される。   In step S132, the region overlap detection unit 280 detects the presence / absence of overlap of the deformation regions set in step S500. The presence / absence of overlapping deformation areas can be determined using various algorithms for determining the presence / absence of overlapping planar figures, as in the detection of overlapping small areas (step S150). As a result of the detection, if it is determined that the deformation areas overlap, the control is moved to step S134. On the other hand, if it is determined that the deformation areas do not overlap, control is transferred to step S140.

ステップS134において、分割形態変更部290は、変形領域の分割形態を変更する。具体的には、ステップS120(図15)において設定される変形タイプを変更することにより、ステップS140における変形領域の分割形態を変更する。なお、後述するように、変形領域の分割形態を規定する分割点の配置の態様は、変形タイプと対応づけられて、分割点配置パターンテーブル410(図14)に格納されている。そのため、分割形態変更部290は、変形タイプと分割点配置態様との対応関係の変更と、分割点配置態様の変更と、のいずれかを行って分割形態の変更を行うものとしてもよい。   In step S134, the division form changing unit 290 changes the division form of the deformation area. Specifically, by changing the deformation type set in step S120 (FIG. 15), the deformation area division form in step S140 is changed. As will be described later, the division point arrangement mode that defines the division form of the deformation area is stored in the division point arrangement pattern table 410 (FIG. 14) in association with the deformation type. Therefore, the division form changing unit 290 may change the division form by either changing the correspondence relationship between the deformation type and the division point arrangement mode or changing the division point arrangement mode.

図16は、分割形態を変更した場合における変形領域の分割結果を示す説明図である。図16(a)は、分割形態を変更しない場合の変形領域の分割結果を示しており、図16(b)は分割形態を変更した場合の変形領域の分割結果を示している。分割形態を変更することにより、2つの変形領域TA1,TA2のそれぞれは、図16(a)に示す分割形態を変更しない場合よりも多い18個の小領域に分割される。このように、分割形態を変更して小領域を増やすことにより、変形領域TA1,TA2に占める重複小領域(ハッチング部)の面積をより少なくすることができる。   FIG. 16 is an explanatory diagram illustrating a result of dividing the deformation area when the division form is changed. FIG. 16A shows the result of division of the deformation area when the division form is not changed, and FIG. 16B shows the result of division of the deformation area when the division form is changed. By changing the division form, each of the two deformation areas TA1 and TA2 is divided into 18 small areas, which are larger than when the division form shown in FIG. 16A is not changed. In this way, by changing the division form and increasing the small areas, the area of the overlapping small areas (hatched portions) in the deformation areas TA1 and TA2 can be further reduced.

図17は、第2実施例において2つの変形領域の小領域が変形される様子を示す説明図である。図17は、2つの変形領域TA1,TA2のそれぞれに、分割形態を変更することにより分割点DA51,DA52,DB51,DB52が付加されている点と、ハッチングを付して示す重複小領域が小さくなっている点と、重複小領域の縮小に伴って、移動の対象となっていなかった分割点DA22,DB31,DB32が、移動の対象となっている点で、図9と異なっている。他の点は、図9と同様である。図17に示すように、変形領域の分割形態を変更して変形領域中の小領域をより細分化することにより、変形されない重複小領域の変形領域に占める面積を縮小することができる。   FIG. 17 is an explanatory diagram showing how the small areas of the two deformation areas are deformed in the second embodiment. FIG. 17 shows that the division points DA51, DA52, DB51, and DB52 are added to the two deformation areas TA1 and TA2 by changing the division form, and the overlapping small areas indicated by hatching are small. This is different from FIG. 9 in that the division points DA22, DB31, and DB32 that are not the objects of movement due to the reduction of the overlapping small area are the objects of movement. The other points are the same as in FIG. As shown in FIG. 17, the area occupied in the deformation area of the overlapping small area that is not deformed can be reduced by changing the division form of the deformation area to further subdivide the small areas in the deformation area.

図18は、第2実施例において変形処理が行われた結果を示す説明図である。図18(a)は、図15のステップS140〜S160による変形処理前の対象画像TIを示している。図18(b)は、変形処理後の対象画像TIを示している。第2実施例においても非重複小領域のみが変形され、重複小領域は変形されない。そのため、変形領域TA1,TA2の重複部分は、変形処理前(図18(a))と同じ状態となり、重複小領域の変形を行うことにより生じる不連続な境界線BL(図12(b))の発生を抑制することができる。また、変形領域中の小領域をより細分化して変形領域中の重複小領域面積を縮小することにより、右側の人物の顔が細くなっている。   FIG. 18 is an explanatory diagram illustrating a result of the deformation process performed in the second embodiment. FIG. 18A shows the target image TI before the deformation processing in steps S140 to S160 in FIG. FIG. 18B shows the target image TI after the deformation process. Also in the second embodiment, only the non-overlapping small regions are deformed, and the overlapping small regions are not deformed. Therefore, the overlapping portions of the deformation areas TA1 and TA2 are in the same state as before the deformation process (FIG. 18A), and the discontinuous boundary line BL (FIG. 12B) generated by performing the deformation of the overlapping small area. Can be suppressed. Further, the face of the right person is narrowed by further subdividing the small area in the deformation area to reduce the overlapping small area area in the deformation area.

このように、第2実施例では、複数の変形領域が重複している場合には、小領域を細分化することにより変形領域中の重複小領域の面積が縮小される。そのため、変形領域内において変形される非重複領域の面積が広くなり、重複小領域を変形しないことの変形処理結果に対する影響をより小さくすることができる。このように、第2実施例は、変形処理結果に対する影響をより低減できる点で第1実施例よりも好ましい。一方、第1実施例は、処理がより容易となる点で第2実施例よりも好ましい。   Thus, in the second embodiment, when a plurality of deformation areas overlap, the area of the overlapping small areas in the deformation areas is reduced by subdividing the small areas. Therefore, the area of the non-overlapping region that is deformed in the deformation region is widened, and the influence on the deformation processing result of not deforming the overlapping small region can be further reduced. Thus, the second embodiment is preferable to the first embodiment in that the influence on the deformation processing result can be further reduced. On the other hand, the first embodiment is preferable to the second embodiment in that processing is easier.

なお、第2実施例では、分割態様を変更して小領域を細分化することにより、重複小領域は、分割態様を変更しなかった場合の重複小領域を分割したものとなっているが、一般に、重複小領域を分割することが可能であれば変形処理結果に対する影響をより小さくすることができる。例えば、重複小領域が検出された場合には、重複小領域を2以上の小領域に分割するものとしてもよい。また、変形領域の重複の有無に拘わらず、変形領域を十分細かい小領域に分割するものとしてもよい。ただし、変形処理の処理量を低減することができる点で、変形領域の重複が検出された場合には変形領域を細分化し、変形領域の重複が検出されない場合には変形領域を細分化しないのがより好ましい。   In the second embodiment, the sub-region is divided by subdividing the sub-region by changing the division mode. In general, if the overlapping small area can be divided, the influence on the deformation processing result can be further reduced. For example, when an overlapping small area is detected, the overlapping small area may be divided into two or more small areas. Further, the deformation area may be divided into sufficiently small small areas regardless of whether or not the deformation areas overlap. However, since the amount of deformation processing can be reduced, the deformation area is subdivided when the deformation area overlap is detected, and the deformation area is not subdivided when the deformation area overlap is not detected. Is more preferable.

C.変形領域の設定:
図19は、顔領域FAの検出結果の図6とは別の一例を示す説明図である。なお、以下の説明では、画像を選択するユーザインタフェースにおいて、1人の顔のみが含まれている画像TN2(図2)が選択されたものとしている。図19に示すように、図4のステップS130において、対象画像TIからは、1つの顔領域FAが検出される。なお、対象画像TIから複数の顔領域が検出された場合には、以下に説明する変形領域の設定処理は検出された個々の顔領域に対して行われる。図19に示した基準線RLは、顔領域FAの高さ方向(上下方向)を定義すると共に、顔領域FAの幅方向(左右方向)の中心を示す線である。すなわち、基準線RLは、矩形の顔領域FAの重心を通り、顔領域FAの高さ方向(上下方向)に沿った境界線に平行な直線である。
C. Deformation area settings:
FIG. 19 is an explanatory diagram showing another example of the detection result of the face area FA from FIG. In the following description, it is assumed that the image TN2 (FIG. 2) including only one face is selected in the user interface for selecting an image. As shown in FIG. 19, in step S130 of FIG. 4, one face area FA is detected from the target image TI. When a plurality of face areas are detected from the target image TI, the deformation area setting process described below is performed on each detected face area. A reference line RL shown in FIG. 19 is a line that defines the height direction (vertical direction) of the face area FA and indicates 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.

図20は、変形領域の設定処理の流れを示すフローチャートである。図20のフローチャートに示す処理は、図4のステップS500において実行される。ステップS510では、顔領域調整部230(図1)が、ステップS130(図4)で検出された顔領域FAの高さ方向の位置調整を行う。ここで、顔領域FAの高さ方向の位置調整とは、顔領域FAの基準線RL(図19参照)に沿った位置を調整して、対象画像TIにおける顔領域FAを再設定することを意味している。   FIG. 20 is a flowchart showing the flow of deformation area setting processing. The process shown in the flowchart of FIG. 20 is executed in step S500 of FIG. In step S510, the face area adjustment unit 230 (FIG. 1) adjusts the position of the face area FA detected in step S130 (FIG. 4) in the height direction. Here, the adjustment of the position of the face area FA in the height direction means that the position of the face area FA along the reference line RL (see FIG. 19) is adjusted to reset the face area FA in the target image TI. I mean.

図21は、顔領域FAの高さ方向の位置調整処理の流れを示すフローチャートである。ステップS511では、顔領域調整部230(図1)が、特定領域SAを設定する。ここで、特定領域SAとは、対象画像TI上の領域であって、顔領域FAの高さ方向の位置調整を実行する際に参照する所定の参照被写体の画像を含む領域である。参照被写体は、例えば「目」に設定することができ、その場合、特定領域SAは「目」の画像を含む領域として設定される。   FIG. 21 is a flowchart showing the flow of position adjustment processing in the height direction of the face area FA. In step S511, the face area adjustment unit 230 (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. The reference subject can be set to, for example, “eyes”. In this case, the specific area SA is set as an area including an image of “eyes”.

図22は、特定領域SAの一例を示す説明図である。顔領域調整部230は、特定領域SAを顔領域FAとの関係に基づいて設定する。具体的には、顔領域FAの大きさを、基準線RLに直交する方向および基準線RLに平行な方向に、所定比率で縮小(または拡大)した大きさの領域であって、顔領域FAの位置と所定の位置関係を有する領域が、特定領域SAとして設定される。すなわち、顔領域検出部220により検出された顔領域FAとの関係に基づき特定領域SAを設定すれば、特定領域SAが両方の目の画像を含む領域となるように、上記所定比率や所定の位置関係が予め設定されている。なお、特定領域SAは、目の画像とまぎらわしい画像(例えば髪の毛の画像)がなるべく含まれないように、両目の画像を含む限りにおいて、なるべく小さい領域として設定されることが好ましい。   FIG. 22 is an explanatory diagram illustrating an example of the specific area SA. The face area adjustment unit 230 sets the specific area SA based on the relationship with the face area FA. Specifically, the size of the face area FA is an area having a size reduced (or enlarged) at a predetermined ratio in a direction orthogonal 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, if the specific area SA is set based on the relationship with the face area FA detected by the face area detection unit 220, the predetermined ratio or the predetermined ratio is set so that the specific area SA is an area including both eye images. The positional relationship is preset. 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.

また、図22に示すように、特定領域SAは、基準線RLに対して対称な矩形形状の領域として設定される。特定領域SAは、基準線RLにより、向かって左側の領域(以下「左分割特定領域SA(l)」とも呼ぶ)と、向かって右側の領域(以下「右分割特定領域SA(r)」とも呼ぶ)とに分割される。特定領域SAは、左分割特定領域SA(l)と右分割特定領域SA(r)とのそれぞれに片目の画像が含まれるように設定される。   As shown in FIG. 22, 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).

ステップS512(図21)では、顔領域調整部230(図1)が、特定領域SAにおける目の画像の位置を検出するための評価値を算出する。図23は、評価値の算出方法の一例を示す説明図である。評価値の算出には、RGB画像データとしての対象画像TIの各画素のR値(R成分値)を用いるのが好ましい。これは、肌の部分の画像と目の部分の画像とではR値の差が大きいため、R値を評価値の算出に用いることにより、目の画像の検出精度を向上させることができると考えられるからである。また、対象画像TIのデータがRGBデータとして取得されているため、R値を評価値の算出に用いることにより、評価値の算出の効率化を図ることができるからでもある。なお、図23に示すように、評価値の算出は、2つの分割特定領域(右分割特定領域SA(r)および左分割特定領域SA(l))のそれぞれについて個別に行われる。   In step S512 (FIG. 21), the face area adjustment unit 230 (FIG. 1) calculates an evaluation value for detecting the position of the eye image in the specific area SA. FIG. 23 is an explanatory diagram illustrating an example of an evaluation value calculation method. For the calculation of the evaluation value, it is preferable to use the R value (R component value) of each pixel of the target image TI as RGB image data. 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, 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. 23, 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)).

顔領域調整部230は、図23に示すように、分割特定領域(右分割特定領域SA(r)および左分割特定領域SA(l))内に、基準線RLと直交するn本の直線(以下「対象画素特定線PL1〜PLn」と呼ぶ)を設定する。対象画素特定線PL1〜PLnは、分割特定領域の高さ(基準線RLに沿った大きさ)を(n+1)等分する直線である。すなわち、対象画素特定線PL同士の間隔は、すべて等間隔sである。   As shown in FIG. 23, the face area adjustment unit 230 includes n straight lines (right division specific area SA (r) and left division specific area SA (l)) orthogonal to the reference line RL ( (Hereinafter referred to as “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.

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

一方、顔領域FAの検出方法や特定領域SAの設定方法によっては、図24(b)に示すように、対象画素特定線PLが対象画像TIの画素の行方向(X方向)と平行とはならない場合も生ずる。このような場合にも、原則として、各対象画素特定線PLと重なる画素が、各対象画素特定線PLについての評価対象画素TPとして選択される。ただし、例えば図24(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. 24B, 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. 24B, 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.

顔領域調整部230は、対象画素特定線PLのそれぞれについて、評価対象画素TPのR値の平均値を評価値として算出する。ただし、各対象画素特定線PLについて、選択された複数の評価対象画素TPの内、R値の大きい一部の画素を評価値の算出対象から除外するものとしている。具体的には、例えば、ある対象画素特定線PLについてk個の評価対象画素TPが選択された場合、評価対象画素TPが、R値の比較的大きい0.75k個の画素により構成される第1グループと、比較的R値の小さい0.25k個の画素により構成される第2グループとの2グループに分けられ、第2グループに属する画素のみが評価値としてのR値の平均値の算出対象となる。このように一部の評価対象画素TPを評価値の算出対象から除外する理由については後述する。   The face area adjustment unit 230 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, for each target pixel specifying line PL, out of a 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.

以上のように、顔領域調整部230は、各対象画素特定線PLについての評価値を算出する。ここで、対象画素特定線PLは基準線RLに直交する直線であるため、評価値は、基準線RLに沿った複数の位置(評価位置)について算出されると表現することができる。また、評価値は、各評価位置について、基準線RLに直交する方向に沿った画素値の分布の特徴を表す値と表現することができる。   As described above, the face area adjustment unit 230 calculates an evaluation value for each target pixel specifying line PL. Here, since the target pixel specifying line PL is a straight line orthogonal to the reference line RL, it can be expressed that the evaluation value is 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.

ステップS513(図21)では、顔領域調整部230(図1)が、特定領域SAにおける目の位置を検出し、検出結果に基づき高さ基準点Rhを決定する。まず、顔領域調整部230は、図23の右側に示すように、各分割特定領域について、基準線RLに沿った評価値(R値の平均値)の分布を表す曲線を作成し、評価値が極小値をとる基準線RL方向に沿った位置を目の位置Ehとして検出する。なお、左分割特定領域SA(l)における目の位置EhをEh(l)と表し、右分割特定領域SA(r)における目の位置EhをEh(r)と表わす。   In step S513 (FIG. 21), the face area adjustment unit 230 (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. 23, the face area adjustment unit 230 creates a curve representing the distribution of evaluation values (average values of R values) along the reference line RL for each divided specific area, and the evaluation values A position along the reference line RL direction at which is a minimum 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と判断することが可能となる。但し、他の人種(白色人種や黒色人種)を対象とする場合には、他の評価値(例えば、輝度や明度やB値)が用いられる。   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. However, when other races (white race or black race) are targeted, other evaluation values (for example, luminance, brightness, B value) are used.

なお、図23に示すように、分割特定領域には、目の画像以外にもR値の小さい他の画像(例えば、眉や髪の毛の画像)が含まれている場合もある。そのため、顔領域調整部230は、基準線RLに沿った評価値の分布を表す曲線が複数の極小値をとる場合には、極小値をとる位置の内、最も下側の位置を目の位置Ehと判断する。一般に、目の画像より上側には眉や髪の毛等のR値の小さい画像が位置することが多い一方、目の画像より下側にはR値の小さい画像が位置することが少ないと考えられることから、このような判断が可能となる。   As shown in FIG. 23, 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 face area adjustment unit 230 determines the lowest position among the positions where the minimum values are taken as the eye position. Judge as Eh. 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値の大きい画素)を評価値の算出対象から除外することにより、参照被写体の検出精度をより向上させている。   Note that, as a minimum subject for position adjustment of the face area FA, an eye (a black eye portion at the center of the eye), which is a part of the face that is considered to have a relatively large color difference from the surroundings, is used. 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. Therefore, as described above, some evaluation target pixels TP that are considered to have a large color difference from the reference subject (for example, pixels having a relatively large R value belonging to the first group described above) are to be evaluated value calculation targets. Therefore, the reference subject detection accuracy is further improved.

次に、顔領域調整部230は、検出された目の位置Ehに基づき高さ基準点Rhを決定する。図25は、高さ基準点Rhの決定方法の一例を示す説明図である。高さ基準点Rhは、顔領域FAの高さ方向の位置調整の際に、基準として用いられる点である。高さ基準点Rhとしては、図25に示すように、左右2つの目の位置Eh(l)およびEh(r)の中間に位置する基準線RL上の点が設定される。すなわち、左の目の位置Eh(l)を示す直線EhL(l)と基準線RLとの交点と、右の目の位置Eh(r)を示す直線EhL(r)と基準線RLとの交点と、の中点が、高さ基準点Rhとして設定される。   Next, the face area adjustment unit 230 determines a height reference point Rh based on the detected eye position Eh. FIG. 25 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. As the height reference point Rh, as shown in FIG. 25, a point on the reference line RL located between the positions Eh (l) and Eh (r) of the two left and right eyes is set. 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.

なお、顔領域調整部230は、検出された目の位置Ehに基づき、顔画像の概略の傾き角(以下「概略傾き角RI」と呼ぶ)を算出する。顔画像の概略傾き角RIは、対象画像TI中の顔の画像が、顔領域FAの基準線RLに対して概ねどれぐらい傾いているかを推定した角度である。図26は、概略傾き角RIの算出方法の一例を示す説明図である。図26に示すように、顔領域調整部230は、まず、左分割特定領域SA(l)の幅Ws(l)を半分に分割する直線と直線EhL(l)との交点IP(l)と、右分割特定領域SA(r)の幅Ws(r)を半分に分割する直線と直線EhL(r)との交点IP(r)とを決定する。そして、交点IP(l)と交点IP(r)とを結ぶ直線に直交する直線ILと、基準線RLとのなす角が、概略傾き角RIとして算出される。   Note that the face area adjustment unit 230 calculates an 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. 26 is an explanatory diagram showing an example of a method for calculating the approximate inclination angle RI. As shown in FIG. 26, the face area adjustment unit 230 first sets an intersection IP (l) between a straight line and a straight line EhL (l) that divides the width Ws (l) of the left divided specific area SA (l) in half. Then, the straight line that divides the width Ws (r) of the right division specific area SA (r) in half and the 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.

ステップS514(図21)では、顔領域調整部230(図1)が、顔領域FAの高さ方向の位置調整を行う。図27は、顔領域FAの高さ方向の位置調整方法の一例を示す説明図である。顔領域FAの高さ方向の位置調整は、高さ基準点Rhが、位置調整後の顔領域FAにおける所定の位置に位置することとなるように、顔領域FAを再設定することにより行う。具体的には、図27に示すように、高さ基準点Rhが、顔領域FAの高さHfを所定の比率r1対r2で分けるような位置に位置することとなるように、顔領域FAが基準線RLに沿って上下に位置調整される。図27の例では、破線で示した調整前の顔領域FAを上方向に移動することにより、実線で示した調整後の顔領域FAが再設定されている。   In step S514 (FIG. 21), the face area adjustment unit 230 (FIG. 1) adjusts the position of the face area FA in the height direction. FIG. 27 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. 27, 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. 27, the face area FA after adjustment indicated by the solid line is reset by moving the face area FA before adjustment indicated by the broken line upward.

顔領域FAの位置調整の後、ステップS520(図20)では、顔領域調整部230(図1)が、顔領域FAの傾き調整(角度調整)を行う。ここで、顔領域FAの傾き調整とは、対象画像TIにおける顔領域FAの傾きを顔の画像の傾きに適合するように調整して、顔領域FAを再設定することを意味している。顔領域FAの傾き調整を実行する際に参照する所定の参照被写体は、例えば「両目」に設定される。顔領域FAの傾き調整では、傾き調整の調整角度の選択肢を表す複数の評価方向が設定され、各評価方向に対応した評価特定領域ESAが両目の画像を含む領域として設定される。そして、各評価方向について評価特定領域ESAの画像の画素値に基づき評価値が算出され、評価値に基づき決定される傾き調整の調整角度を用いて顔領域FAの傾きが調整される。   After the position adjustment of the face area FA, in step S520 (FIG. 20), 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. The predetermined reference subject to be referred to when the inclination adjustment of the face area FA is executed is set to “both eyes”, for example. In the inclination adjustment of the face area FA, a plurality of evaluation directions representing options of adjustment angles for inclination adjustment are set, and an evaluation specific area ESA corresponding to each evaluation direction is set as an area including 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.

図28は、顔領域FAの傾き調整処理の流れを示すフローチャートである。また、図29は、顔領域FAの傾き調整のための評価値の算出方法の一例を示す説明図である。ステップS521(図28)では、顔領域調整部230(図1)が、初期評価特定領域ESA(0)を設定する。初期評価特定領域ESA(0)は、顔領域FAの位置調整後の基準線RL(図27参照)と平行な方向(以下「初期評価方向」とも呼ぶ)に対応付けられた評価特定領域ESAである。位置調整後の顔領域FAに対応した特定領域SA(図27参照)は、そのまま初期評価特定領域ESA(0)として設定される。なお、顔領域FAの傾き調整における評価特定領域ESAは、顔領域FAの位置調整時の特定領域SAとは異なり、左右2つの領域に分割されることはない。図29の最上段には、設定された初期評価特定領域ESA(0)が示されている。   FIG. 28 is a flowchart showing the flow of the inclination adjustment process of the face area FA. FIG. 29 is an explanatory diagram showing an example of an evaluation value calculation method for adjusting the inclination of the face area FA. In step S521 (FIG. 28), the face area adjustment unit 230 (FIG. 1) sets an 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. 27) after the position adjustment of the face area FA. is there. The specific area SA (see FIG. 27) corresponding to the face area FA after the 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. 29 shows the set initial evaluation specific area ESA (0).

ステップS522(図28)では、顔領域調整部230(図1)が、複数の評価方向と各評価方向に対応した評価特定領域ESAとを設定する。複数の評価方向は、傾き調整の調整角度の選択肢を表す方向として設定される。具体的には、基準線RLとのなす角が所定の範囲内である複数の評価方向線ELが設定され、評価方向線ELと平行な方向が評価方向として設定される。図29に示すように、基準線RLを初期評価特定領域ESA(0)の中心点(重心)CPを中心として反時計回りおよび時計回りに所定の角度α刻みで回転させることにより定まる直線が、複数の評価方向線ELとして設定される。なお、基準線RLとのなす角がφ度である評価方向線ELをEL(φ)と表す。   In step S522 (FIG. 28), the face area adjustment unit 230 (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. Specifically, 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. 29, 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を反時計回りに回転させたときの回転角は負の値で表される。顔領域調整部230は、基準線RLを反時計回りおよび時計回りにα度、2α度・・・と20度を超えない範囲で回転角を増加させつつ回転させ、複数の評価方向線ELを設定する。図29には、基準線RLを−α度,−2α度,α度回転させることによりそれぞれ定まる評価方向線EL(EL(−α),EL(−2α),EL(α))が示されている。なお、基準線RLは、評価方向線EL(0)とも表現できる。   The predetermined range about the angle formed by each evaluation direction line EL and the reference line RL described above 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 face area adjustment unit 230 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. 29 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(φ)と表される。図29には、評価方向線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 (φ). In FIG. 29, 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.

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

評価値の算出方法は、上述した顔領域FAの位置調整における評価値の算出方法と同様である。すなわち、顔領域調整部230は、図29に示すように、各評価特定領域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. 29, the face area adjustment unit 230 sets target pixel specifying lines PL1 to PLn orthogonal to the evaluation direction line EL in each evaluation specifying area ESA, and sets the target pixel specifying lines PL1 to PLn. The evaluation target pixel TP is selected for and the average value of the R values of the selected evaluation target pixel TP is calculated as the evaluation value.

評価特定領域ESAにおける対象画素特定線PLの設定方法や評価対象画素TPの選択方法は、領域を左右に分割するか否かの違いはあるものの、図23および図24に示した顔領域FAの位置調整における方法と同様である。なお、顔領域FAの位置調整時と同様に、選択された評価対象画素TPの内の一部(例えばk個の評価対象画素TPの内のR値の比較的大きい0.75k個の画素)を評価値の算出対象から除外するとしてもよい。図29の右側には、各評価方向について、算出された評価値の評価方向線ELに沿った分布を示している。   The setting method of the target pixel specifying line PL and the selection method of the evaluation target pixel TP in the evaluation specific area ESA are different depending on whether the area is divided into right and left, 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. 29 shows the distribution of the calculated evaluation values along the evaluation direction line EL for each evaluation direction.

なお、対象画素特定線PLは評価方向線ELに直交する直線であるため、評価値は、評価方向線ELに沿った複数の位置(評価位置)について算出されると表現することができる。また、評価値は、各評価位置について、評価方向線ELに直交する方向に沿った画素値の分布の特徴を表す値と表現することができる。   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.

ステップS524(図28)では、顔領域調整部230(図1)が、顔領域FAの傾き調整に用いる調整角度を決定する。顔領域調整部230は、各評価方向について、ステップS523において算出された評価値の評価方向線ELに沿った分散を算出し、分散の値が最大となる評価方向を選択する。そして、選択された評価方向に対応した評価方向線ELと基準線RLとのなす角を、傾き調整に用いる調整角度として決定する。   In step S524 (FIG. 28), the face area adjustment unit 230 (FIG. 1) determines an adjustment angle used for adjusting the inclination of the face area FA. The face area adjustment unit 230 calculates the variance along the evaluation direction line EL of the evaluation value calculated in step S523 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.

図30は、各評価方向についての評価値の分散の算出結果の一例を示す説明図である。図30の例では、回転角が−α度である評価方向において、分散が最大値Vmaxをとる。従って、−α度、すなわち反時計回りにα度の回転角が、顔領域FAの傾き調整に用いる調整角度として決定される。   FIG. 30 is an explanatory diagram illustrating an example of a calculation result of evaluation value dispersion for each evaluation direction. In the example of FIG. 30, 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.

評価値の分散の値が最大となるときの評価方向に対応した角度が傾き調整に用いる調整角度として決定される理由について説明する。図29の上から2段目に示すように、回転角が−α度であるときの評価特定領域ESA(−α)では、左右の目の中央部(黒目部分)の画像が、概ね対象画素特定線PLに平行な方向(すなわち評価方向線ELに直交する方向)に並ぶような配置となっている。また、このときには、左右の眉の画像も同様に、概ね評価方向線ELに直交する方向に並ぶような配置となる。従って、このときの評価方向線ELに対応した評価方向が、概ね顔の画像の傾きを表す方向であると考えられる。このときには、一般にR値が小さい目や眉の画像と一般にR値が大きい肌の部分の画像との位置関係が、対象画素特定線PLの方向に沿って両者が重なる部分の小さい位置関係となる。そのため、目や眉の画像の位置における評価値は比較的小さくなり、肌の部分の画像の位置における評価値は比較的大きくなる。従って、評価方向線ELに沿った評価値の分布は、図29に示すように、比較的ばらつきの大きい(振幅の大きい)分布となり、分散の値は大きくなる。   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. 29, in the evaluation specific area ESA (−α) when the rotation angle is −α degrees, the image of the center 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 orthogonal to the evaluation direction line EL). At this time, the left and right eyebrows are similarly arranged in a direction substantially orthogonal 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. 29, 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.

一方、図29中の最上段および3段目、4段目に示すように、回転角が0度,−2α度,α度であるときの評価特定領域ESA(0),ESA(−2α),ESA(α)では、左右の目の中央部や左右の眉の画像が、評価方向線ELに直交する方向に並ばず、ずれた配置となっている。従って、このときの評価方向線ELに対応した評価方向は、顔の画像の傾きを表していはいない。このときには、目や眉の画像と肌の部分の画像との位置関係が、対象画素特定線PLの方向に沿って両者が重なる部分の大きい位置関係となる。そのため、評価方向線ELに沿った評価値の分布は、図29に示すように、比較的ばらつきの小さい(振幅の小さい)分布となり、分散の値は小さくなる。   On the other hand, as shown in the uppermost stage, the third stage, and the fourth stage in FIG. 29, 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 arranged in a direction perpendicular to the evaluation direction line EL, but are shifted. 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. 29, 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 addition, when the calculation result of the variance of the evaluation values is a critical value in the angle range, that is, the maximum value at −20 degrees or 20 degrees, the face inclination is not accurately evaluated. Since the possibility is high, the inclination of the face area FA is not adjusted.

また、決定された調整角度は、上述した顔領域FAの位置調整の際に算出された概略傾き角RIと比較される。調整角度と概略傾き角RIとの差が所定の閾値より大きい場合には、顔領域FAの位置調整および傾き調整における評価や決定の際に何らかの誤りが発生したと考えられるため、顔領域FAの位置調整および傾き調整は行われない。   Further, 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.

ステップS525(図28)では、顔領域調整部230(図1)が、顔領域FAの傾き調整を行う。図31は、顔領域FAの傾き調整方法の一例を示す説明図である。顔領域FAの傾き調整は、顔領域FAを、初期評価特定領域ESA(0)の中心点CPを中心に、ステップS524において決定された調整角度だけ回転させることにより行う。図31の例では、破線で示した調整前の顔領域FAを反時計回りにα度回転させることにより、実線で示した調整後の顔領域FAが設定される。   In step S525 (FIG. 28), the face area adjustment unit 230 (FIG. 1) adjusts the inclination of the face area FA. FIG. 31 is an explanatory diagram showing an example of a method for adjusting the inclination of the face area FA. The inclination 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 S524. In the example of FIG. 31, 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の傾き調整終了後のステップS530(図20)では、変形領域設定部240(図1)が、変形領域TAを設定する。変形領域TAは、対象画像TI上の領域であって顔形状補正のための画像変形処理の対象となる領域である。図32は、変形領域TAの設定方法の一例を示す説明図である。図32に示すように、変形領域TAは、顔領域FAを基準線RLと平行な方向(高さ方向)および基準線RLに直交する方向(幅方向)に伸張(または短縮)した領域として設定される。具体的には、顔領域FAの高さ方向の大きさをHf、幅方向の大きさをWfとすると、顔領域FAを、上方向にk1・Hf、下方向にk2・Hfだけ伸ばすと共に、左右にそれぞれk3・Wfだけ伸ばした領域が、変形領域TAとして設定される。なお、k1,k2,k3は、所定の係数である。   In step S530 (FIG. 20) 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. 32 is an explanatory diagram showing an example of a method for setting the deformation area TA. As shown in FIG. 32, the deformation area TA is set as an area in which the face area FA is expanded (or shortened) in a direction parallel to the reference line RL (height direction) and in a direction perpendicular to the reference line RL (width direction). Is done. 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.

図32に示すように、変形領域TAは、高さ方向に関しては、概ね顎から額までの画像を含み、幅方向に関しては、左右の頬の画像を含むような領域として設定される。すなわち、上述の係数k1,k2,k3は、変形領域TAが概ねそのような範囲の画像を含む領域となるように、顔領域FAの大きさとの関係に基づいて予め設定されている。   As shown in FIG. 32, 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, 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.

D.分割点配置の態様:
図33は、変形領域TAの小領域への分割方法の一例を示す説明図である。変形領域分割部250は、変形領域TAに複数の分割点Dを配置し、分割点Dを結ぶ直線を用いて変形領域TAを複数の小領域に分割する。
D. Division point arrangement:
FIG. 33 is an explanatory diagram showing an example of a method of dividing the deformation area TA into small areas. The deformation area dividing unit 250 arranges a plurality of division points D in the deformation area TA, and divides the deformation area TA into a plurality of small areas using a straight line connecting the division points D.

分割点Dの配置の態様(分割点Dの個数および位置)は、分割点配置パターンテーブル410(図1)により、ステップ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. As described above, when the deformation “type A” (see FIG. 5) for sharpening the face is set as the deformation type, the division point D is arranged in a manner associated with the deformation type. The

図33に示すように、分割点Dは、水平分割線Lhと垂直分割線Lvとの交点と、水平分割線Lhおよび垂直分割線Lvと変形領域TAの外枠との交点とに配置される。ここで、水平分割線Lhおよび垂直分割線Lvは、変形領域TA内に分割点Dを配置するための基準となる線である。図33に示すように、顔をシャープにするための変形タイプに対応付けられた分割点Dの配置では、基準線RLと直交する2本の水平分割線Lhと、基準線RLに平行な4本の垂直分割線Lvとが設定される。2本の水平分割線Lhを、変形領域TAの下方から順に、Lh1,Lh2と呼ぶ。また、4本の垂直分割線Lvを、変形領域TAの左から順に、Lv1,Lv2,Lv3,Lv4と呼ぶ。   As shown in FIG. 33, the dividing points D are arranged at the intersections of the horizontal dividing line Lh and the vertical dividing line Lv and the intersections of the horizontal dividing line Lh and the vertical dividing line Lv and the outer frame of the deformation area TA. . Here, the horizontal dividing line Lh and the vertical dividing line Lv are reference lines for arranging the dividing points D in the deformation area TA. As shown in FIG. 33, in the arrangement of the dividing points D associated with the deformation type for sharpening the face, two horizontal dividing lines Lh orthogonal 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が配置される。図33に示すように、水平分割線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. 33, division points D located on the horizontal division line Lhi (i = 1 or 2) are referred to as D0i, D1i, D2i, D3i, D4i, and D5i in order from the left. For example, the dividing points D located on the horizontal dividing line Lh1 are called D01, D11, D21, D31, D41, D51. Similarly, the dividing points D located on the vertical dividing line Lvj (j = 1, 2, 3, 4) are called Dj0, Dj1, Dj2, Dj3 in order from the bottom. For example, the division points D located on the vertical division line Lv1 are called D10, D11, D12, and D13.

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

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

なお、分割点Dの配置は、水平分割線Lhおよび垂直分割線Lvの本数および位置により定まるため、分割点配置パターンテーブル410は水平分割線Lhおよび垂直分割線Lvの本数および位置を定義していると言い換えることも可能である。   Since the arrangement of the dividing points D is determined by the numbers and positions of the horizontal dividing lines Lh and the vertical dividing lines Lv, the dividing point arrangement pattern table 410 defines the numbers and positions of the horizontal dividing lines Lh and the vertical dividing lines Lv. It can be paraphrased as being.

E.小領域の変形:
変形領域TA内に分割点Dを配置して変形領域TAを分割した個々の小領域は、分割領域変形部260(図1)が、変形領域TA内に配置された分割点Dの位置を移動することにより変形される。
E. Small area transformation:
For each small area obtained by dividing the deformation area TA by arranging the division point D in the deformation area TA, the division area deformation unit 260 (FIG. 1) moves the position of the division point D arranged in the deformation area TA. It is deformed by doing.

変形処理のための各分割点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 divided region deformation unit 260 refers to the divided point movement table 420 and moves the position of the divided point D with the moving direction and moving distance associated with the combination of the deformation type and the degree of deformation set in step S120. To do.

上述したように、変形タイプとして顔をシャープにするための変形「タイプA」(図5参照)が設定され、変形度合いとして程度「中」の度合いが設定されている場合には、これらの変形タイプおよび変形度合いの組み合わせに対応付けられた移動方向および移動距離で、分割点Dの位置が移動されることとなる。   As described above, 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, these deformations are performed. The position of the dividing point D is moved with the movement direction and the movement distance associated with the combination of the type and the degree of deformation.

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

図35では、移動前の分割点Dは白抜きの丸で、移動後の分割点Dや位置の移動の無い分割点Dは黒丸で示されている。また、移動後の分割点Dは分割点D'と呼ばれるものとする。例えば分割点D11の位置は、図35において右上方向に移動され、分割点D'11となる。   In FIG. 35, 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. 35 and becomes the dividing point D′ 11.

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

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

なお、上述のように小領域を変形対象から除外する場合には、その小領域の頂点に相当する分割点の移動距離がゼロに設定される。これにより、変形対象から除外された小領域は変形されない状態となる。例えば、図35においてハッチングを付した、分割点D11,D21,D22,D12を頂点とする小領域を変形対象から除外する場合、図34の分割点移動テーブル420のうち、分割点D11,D21,D22,D12のH方向及びV方向の移動量がゼロに設定される。   Note that when a small area is excluded from the deformation target as described above, the movement distance of the dividing point corresponding to the vertex of the small area is set to zero. As a result, the small area excluded from the deformation target is not deformed. For example, in the case where small areas having the vertices at the dividing points D11, D21, D22, and D12 that are hatched in FIG. 35 are excluded from the deformation target, the dividing points D11, D21, The movement amounts of D22 and D12 in the H direction and the V direction are set to zero.

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

画像の変形処理は、矩形の小領域を小領域の重心CGを用いて4つの三角形領域に分割し、三角形領域単位で行われる。図36の例では、変形前注目小領域BSAが、変形前注目小領域BSAの重心CGを頂点の1つとする4つの三角形領域に分割される。同様に、変形後注目小領域ASAが、変形後注目小領域ASAの重心CG'を頂点の1つとする4つの三角形領域に分割される。そして、分割点Daの移動前後のそれぞれの状態において対応する三角形領域毎に、画像の変形処理が行われる。例えば、変形前注目小領域BSA中の分割点Da,Ddおよび重心CGを頂点とする三角形領域の画像が、変形後注目小領域ASA中の分割点Da',Ddおよび重心CG'を頂点とする三角形領域の画像に変形される。   The image deformation process is performed in units of triangular areas by dividing a rectangular small area into four triangular areas using the center of gravity CG of the small area. In the example of FIG. 36, 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.

図37は、三角形領域における画像の変形処理方法の概念を示す説明図である。図37の例では、点s,t,uを頂点とする三角形領域stuの画像が、点s',t',u'を頂点とする三角形領域s't'u'の画像に変形される。画像の変形は、変形後の三角形領域s't'u'の画像中のある画素の位置が、変形前の三角形領域stuの画像中のどの位置に相当するかを算出し、算出された位置における変形前の画像(すなわち、元画像)における画素値を変形後の画像の画素値とすることにより行う。   FIG. 37 is an explanatory diagram showing the concept of an image deformation processing method in a triangular area. In the example of FIG. 37, the image of the triangular area stu having points s, t, and u as vertices is transformed into the image of a triangular area s′t′u ′ having vertices as points s ′, t ′, u ′. . 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 The pixel value in the image before deformation in (i.e., the original image) is used as the pixel value of the image after deformation.

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

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

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

ここで、変形タイプとして顔をシャープにするための変形「タイプA」(図5参照)が設定され、変形度合いとして程度「中」の度合いが設定された場合を例に取り、顔形状補正の態様についてより詳細に説明する。図38は、この場合における顔形状補正の態様を示す説明図である。図38には、変形領域TAを構成する各小領域の変形態様のイメージを矢印により示している。   Here, a case where 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 is taken as an example. An aspect is demonstrated in detail. FIG. 38 is an explanatory diagram showing a form of face shape correction in this case. In FIG. 38, the image of the deformation | transformation aspect of each small area | region which comprises deformation | transformation area | region TA is shown with the arrow.

図38の例に示す顔形状補正では、基準線RLと平行な方向(V方向)に関し、水平分割線Lh1上に配置された分割点D(D11,D21,D31,D41)の位置は上方に移動される一方、水平分割線Lh2上に配置された分割点D(D12,D22,D32,D42)の位置は移動されない(図34参照)。従って、水平分割線Lh1と水平分割線Lh2との間に位置する画像は、V方向に関して縮小される。上述したように、水平分割線Lh1は顎の画像より下方に配置され、水平分割線Lh2は目の画像のすぐ下付近に配置されるため、この顔形状補正では、顔の画像の内、顎から目の下にかけての部分の画像がV方向に縮小されることとなる。この結果、画像中の顎のラインは上方に移動する。   In the face shape correction shown in the example of FIG. 38, the position of the dividing point D (D11, D21, D31, D41) arranged on the horizontal dividing line Lh1 is upward in the direction (V direction) parallel to the reference line RL. On the other hand, the position of the dividing point D (D12, D22, D32, D42) arranged on the horizontal dividing line Lh2 is not moved (see FIG. 34). 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 disposed below the jaw image and the horizontal dividing line Lh2 is disposed near the lower part of the eye image, in this face shape correction, in the face image, the jaw The image of the part from the eye to the bottom 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)の位置は左方向に移動される(図34参照)。さらに、垂直分割線Lv2上に配置された2つの分割点Dの内、水平分割線Lh1上に配置された分割点D(D21)の位置は右方向に移動され、垂直分割線Lv3上に配置された2つの分割点Dの内、水平分割線Lh1上に配置された分割点D(D31)の位置は左方向に移動される(図34参照)。従って、垂直分割線Lv1より左側に位置する画像は、H方向に関して右側に拡大され、垂直分割線Lv4より右側に位置する画像は、左側に拡大される。また、垂直分割線Lv1と垂直分割線Lv2との間に位置する画像は、H方向に関して縮小または右側に移動され、垂直分割線Lv3と垂直分割線Lv4との間に位置する画像は、H方向に関して縮小または左側に移動される。さらに、垂直分割線Lv2と垂直分割線Lv3との間に位置する画像は、水平分割線Lh1の位置を中心にH方向に関して縮小される。   On the other hand, regarding the direction (H direction) orthogonal to the reference line RL, the position of the dividing point D (D11, D12) arranged on the vertical dividing line Lv1 is moved rightward and arranged on the vertical dividing line Lv4. The position of the dividing point D (D41, D42) is moved to the left (see FIG. 34). 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. 34). 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は、目尻の画像の外側に配置される。そのため、図38の例における顔形状補正では、顔の画像の内、両目尻より外側の部分の画像が全体的に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 in the example of FIG. 38, 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方向の変形態様を総合すると、図38の例に示した顔形状補正により、対象画像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 shown in the example of FIG. Note that a sharp face shape can be expressed as a so-called “small face”.

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

F.変形例:
なお、この発明は上記の実施例や実施形態に限られるものではなく、その要旨を逸脱しない範囲において種々の態様において実施することが可能であり、例えば次のような変形も可能である。
F. 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.

F1.変形例1:
上記各実施例では、変形処理後の画像が不自然な画像となることを抑制するため、複数の変形領域が重複した重複領域に重なる重複小領域の変形を行わないものとしているが、一般には、重複小領域の変形量を低減することができればよい。このようにしても、重複領域の外周における画像のずれが低減できるので、変形処理後の画像が不自然な画像となることを抑制することが可能となる。
F1. Modification 1:
In each of the above embodiments, in order to prevent the image after the deformation process from becoming an unnatural image, it is assumed that the deformation of the overlapping small area that overlaps the overlapping area where the plurality of deformation areas overlap is not performed. It suffices if the deformation amount of the overlapping small area can be reduced. Even in this case, the image shift at the outer periphery of the overlapping region can be reduced, so that the image after the deformation process can be prevented from being an unnatural image.

F2.変形例2:
上記各実施例では、変形領域を分割した小領域毎に変形するか否かを決定しているが、重複領域を含む変形領域の一部の変形量を低減するものとしても良い。例えば、変形領域の分割に使用される分割点のうち、重複領域に入る分割点の移動を抑制するものとしてもよい。この場合においても重複領域の変形量が低減されるので、重複領域の外周における画像のずれが低減でき、変形処理後の画像が不自然な画像となることを抑制することが可能となる。
F2. Modification 2:
In each of the above embodiments, whether or not to deform each small region obtained by dividing the deformation region is determined, but it is also possible to reduce the amount of deformation of a part of the deformation region including the overlapping region. For example, it is good also as what suppresses the movement of the dividing point which enters into an overlapping area among the dividing points used for a division | segmentation of a deformation | transformation area | region. Even in this case, since the deformation amount of the overlapping region is reduced, the image shift at the outer periphery of the overlapping region can be reduced, and the image after the deformation process can be prevented from being an unnatural image.

F3.変形例3:
上記各実施例では、本発明を、対象画像中の顔の形状を補正する変形処理に適用しているが、本発明は顔の変形処理の他、変形対象となる変形領域が重複しうる場合一般に適用することができる。
F3. Modification 3:
In each of the embodiments described above, the present invention is applied to the deformation process for correcting the shape of the face in the target image. However, the present invention can be applied to a case where the deformation area to be deformed can overlap in addition to the face deformation process. Generally applicable.

F4.変形例4:
上記各実施例では、変形領域を矩形の領域として設定しているが、変形領域の形状は、他の形状(例えば、楕円や菱形)であってもよい。
F4. Modification 4:
In each of the above embodiments, the deformation area is set as a rectangular area, but the shape of the deformation area may be another shape (for example, an ellipse or a rhombus).

F5.変形例5:
上記各実施例では、画像処理装置としてのプリンタ100による顔形状補正印刷処理(図3)を説明したが、顔形状補正印刷処理は例えば、顔形状補正と補正画像の表示(ステップS100,S200)がパーソナルコンピュータにより実行され、印刷処理(ステップS300)のみがプリンタにより実行されるものとしてもよい。また、プリンタ100はインクジェットプリンタに限らず、他の方式のプリンタ、例えばレーザプリンタや昇華型プリンタであるとしてもよい。
F5. Modification 5:
In each of the above-described embodiments, the face shape correction printing process (FIG. 3) by the printer 100 as the image processing apparatus has been described. May be executed by the personal computer, and only the printing process (step S300) may be executed by the printer. The printer 100 is not limited to an ink jet printer, and may be another type of printer, such as a laser printer or a sublimation printer.

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

100…プリンタ
110…CPU
120…内部メモリ
140…操作部
150…表示部
160…プリンタエンジン
170…カードインタフェース
172…カードスロット
200…顔形状補正部
210…変形態様設定部
212…指定取得部
220…顔領域検出部
230…顔領域調整部
240…変形領域設定部
250…変形領域分割部
260…分割領域変形部
270…重複小領域検出部
280…領域重複検出部
290…分割形態変更部
310…表示処理部
320…印刷処理部
410…分割点配置パターンテーブル
420…分割点移動テーブル
100 ... Printer 110 ... CPU
DESCRIPTION OF SYMBOLS 120 ... Internal memory 140 ... Operation part 150 ... Display part 160 ... Printer engine 170 ... Card interface 172 ... Card slot 200 ... Face shape correction part 210 ... Deformation mode setting part 212 ... Specification acquisition part 220 ... Face area detection part 230 ... Face Area adjustment unit 240 ... deformation area setting part 250 ... deformation area division part 260 ... divided area deformation part 270 ... overlapping small area detection part 280 ... area overlap detection part 290 ... division form change part 310 ... display processing part 320 ... print processing part 410: Division point arrangement pattern table 420 ... Division point movement table

Claims (6)

画像処理装置であって、
対象画像を解析して前記対象画像上に複数の変形領域を設定する変形領域設定部と、
前記変形領域内の画像の変形を行う変形処理部と、
を備え、
前記変形処理部は、前記複数の変形領域が重複した場合に、前記複数の変形領域の重複部分を含む前記複数の変形領域のそれぞれの一部の部分領域の変形量を低減する、
画像処理装置。
An image processing apparatus,
A deformation area setting unit that analyzes a target image and sets a plurality of deformation areas on the target image;
A deformation processing unit that performs deformation of an image in the deformation area;
With
The deformation processing unit reduces a deformation amount of a partial region of each of the plurality of deformation regions including an overlapping portion of the plurality of deformation regions when the plurality of deformation regions overlap;
Image processing device.
請求項1記載の画像処理装置であって、
前記変形処理部は、前記変形領域を複数に分割した小領域を変形することにより前記変形領域内の画像の変形を行い、
前記部分領域は、前記複数の小領域のうちで前記重複部分に重なる全体または一部の領域である、
画像処理装置。
The image processing apparatus according to claim 1,
The deformation processing unit performs deformation of the image in the deformation area by deforming a small area obtained by dividing the deformation area into a plurality of areas,
The partial area is the whole or a part of the plurality of small areas overlapping the overlapping part,
Image processing device.
請求項2記載の画像処理装置であって、
前記部分領域は、前記重複部分に重なる小領域をさらに分割した一部の領域を含む、画像処理装置。
The image processing apparatus according to claim 2,
The image processing apparatus, wherein the partial area includes a partial area obtained by further dividing a small area overlapping the overlapping part.
請求項1ないし3のいずれか記載の画像処理装置であって、
前記変形処理部は、前記部分領域の変形量をゼロに設定する、画像処理装置。
The image processing apparatus according to any one of claims 1 to 3,
The deformation processing unit is an image processing device that sets a deformation amount of the partial region to zero.
請求項1ないし4のいずれか記載の画像処理装置であって、
前記対象画像は、人物の顔を含む画像であり、
前記変形領域設定部は、前記人物の顔の複数の器官の画像を含む領域を前記変形領域として設定する、
画像処理装置。
The image processing apparatus according to any one of claims 1 to 4,
The target image is an image including a human face,
The deformation area setting unit sets an area including images of a plurality of organs of the person's face as the deformation area.
Image processing device.
画像処理方法であって、
(a)対象画像を解析して前記対象画像上に複数の変形領域を設定する工程と、
(b)前記変形領域内の画像の変形を行う工程と、
を備え、
前記工程(b)は、前記複数の変形領域が重複した場合に、前記複数の変形領域の重複部分を含む前記複数の変形領域のそれぞれの一部の部分領域の変形量を低減する工程を含む、
画像処理方法。
An image processing method comprising:
(A) analyzing a target image and setting a plurality of deformation regions on the target image;
(B) a step of deforming the image in the deformation region;
With
The step (b) includes a step of reducing a deformation amount of a partial region of each of the plurality of deformation regions including an overlapping portion of the plurality of deformation regions when the plurality of deformation regions overlap. ,
Image processing method.
JP2009089643A 2009-04-02 2009-04-02 Image processing apparatus and image processing method Active JP4853541B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009089643A JP4853541B2 (en) 2009-04-02 2009-04-02 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009089643A JP4853541B2 (en) 2009-04-02 2009-04-02 Image processing apparatus and image processing method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2007125648A Division JP4289420B2 (en) 2007-05-10 2007-05-10 Image processing apparatus and image processing method

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2011235531A Division JP5163801B2 (en) 2011-10-27 2011-10-27 Apparatus, method, and computer program

Publications (3)

Publication Number Publication Date
JP2009151825A true JP2009151825A (en) 2009-07-09
JP2009151825A5 JP2009151825A5 (en) 2010-06-24
JP4853541B2 JP4853541B2 (en) 2012-01-11

Family

ID=40920803

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009089643A Active JP4853541B2 (en) 2009-04-02 2009-04-02 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP4853541B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018193674A1 (en) * 2017-04-20 2018-10-25 シャープ株式会社 Image processing device, image-capturing device, image printing device, control method of image processing device, and image processing program
WO2018193677A1 (en) * 2017-04-21 2018-10-25 シャープ株式会社 Image processing device, image capturing device, image printing device, control method of image processing device, and image processing program

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003348334A (en) * 2002-05-28 2003-12-05 Fuji Photo Film Co Ltd Image composing method and program
JP2004318204A (en) * 2003-04-10 2004-11-11 Sony Corp Image processing device, image processing method, and photographing device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003348334A (en) * 2002-05-28 2003-12-05 Fuji Photo Film Co Ltd Image composing method and program
JP2004318204A (en) * 2003-04-10 2004-11-11 Sony Corp Image processing device, image processing method, and photographing device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018193674A1 (en) * 2017-04-20 2018-10-25 シャープ株式会社 Image processing device, image-capturing device, image printing device, control method of image processing device, and image processing program
WO2018193677A1 (en) * 2017-04-21 2018-10-25 シャープ株式会社 Image processing device, image capturing device, image printing device, control method of image processing device, and image processing program
US11069039B2 (en) 2017-04-21 2021-07-20 Sharp Kabushiki Kaisha Image processing apparatus, imaging apparatus, image printing apparatus, method for controlling image processing apparatus, and image processing program

Also Published As

Publication number Publication date
JP4853541B2 (en) 2012-01-11

Similar Documents

Publication Publication Date Title
JP4289414B2 (en) Image processing for image transformation
JP5076744B2 (en) Image processing device
JP4957463B2 (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
JP4289420B2 (en) Image processing apparatus and image processing method
JP4389954B2 (en) Image processing apparatus, image processing method, computer program, recording medium, and printer
JP4816538B2 (en) Image processing apparatus and image processing method
JP4853541B2 (en) Image processing apparatus and image processing method
JP5338887B2 (en) Image processing device
JP4930298B2 (en) Specify image area
JP5163801B2 (en) Apparatus, method, and computer program
JP4816540B2 (en) Image processing apparatus and image processing method
JP4930525B2 (en) Image processing for image transformation
JP4862723B2 (en) Image processing for object position detection
JP4888188B2 (en) Image processing apparatus and image processing method
JP4737324B2 (en) Image processing apparatus, image processing method, and computer program
JP4946729B2 (en) Image processing device
JP4957462B2 (en) Image processing device
JP2009223566A (en) Image processor, image processing method, and image processing program
JP2011141889A (en) Image processing apparatus and method
JP2009055305A (en) Image processing adding information to image
JP2008242802A (en) Image processing for detecting inclination of subject
JP2009110048A (en) Setting of face area

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100510

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100510

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110913

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

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

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

Free format text: PAYMENT UNTIL: 20141104

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4853541

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

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