JP2010056726A - Image processor, image processing method and image processing program - Google Patents
Image processor, image processing method and image processing program Download PDFInfo
- Publication number
- JP2010056726A JP2010056726A JP2008217923A JP2008217923A JP2010056726A JP 2010056726 A JP2010056726 A JP 2010056726A JP 2008217923 A JP2008217923 A JP 2008217923A JP 2008217923 A JP2008217923 A JP 2008217923A JP 2010056726 A JP2010056726 A JP 2010056726A
- Authority
- JP
- Japan
- Prior art keywords
- image
- correction value
- region
- body shape
- target image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
- 238000003672 processing method Methods 0.000 title claims description 6
- 238000012937 correction Methods 0.000 claims abstract description 95
- 230000037237 body shape Effects 0.000 claims abstract description 64
- 238000012545 processing Methods 0.000 claims abstract description 63
- 210000000746 body region Anatomy 0.000 claims description 22
- 239000000284 extract Substances 0.000 claims description 6
- 238000000034 method Methods 0.000 description 67
- 230000008569 process Effects 0.000 description 59
- 230000007717 exclusion Effects 0.000 description 36
- 230000008447 perception Effects 0.000 description 35
- 238000001514 detection method Methods 0.000 description 18
- 238000003702 image correction Methods 0.000 description 15
- 238000004364 calculation method Methods 0.000 description 9
- 238000003384 imaging method Methods 0.000 description 6
- 230000008707 rearrangement Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000005484 gravity Effects 0.000 description 4
- 238000007639 printing Methods 0.000 description 4
- 230000006835 compression Effects 0.000 description 3
- 238000007906 compression Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 210000000056 organ Anatomy 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 210000000887 face Anatomy 0.000 description 2
- 230000001815 facial effect Effects 0.000 description 2
- 238000003825 pressing Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000009792 diffusion process Methods 0.000 description 1
- 238000010017 direct printing Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012706 support-vector machine Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
- Image Analysis (AREA)
Abstract
Description
本発明は、画像処理装置、画像処理方法および画像処理プログラムに関する。 The present invention relates to an image processing apparatus, an image processing method, and an image processing program.
デジタル画像を対象に、画像を変形するための画像処理技術が知られている(特許文献1参照。)。特許文献1には、顔の画像上の一部の領域(頬の画像を表す領域)を補正領域として設定し、補正領域を所定のパターンに従い複数の小領域に分割し、小領域毎に設定された倍率で画像を拡大または縮小することにより、顔の形状を変形する画像処理が開示されている。
しかしながら、上記のように補正領域を設定して画像を変形する画像処理では、補正領域の設定や小領域の拡大や縮小等、多くの演算処理量を要する処理が行われる。そのため、画像処理を行うための演算処理量が過大となる場合があった。この問題は、人物の顔を変形する場合に限らず、一般に、画像を変形する処理に共通する。また、このような画像変形を実行する前に、画像変形の実行の要否や変形の強さ(度合い)等の各種設定をユーザにさせることは、ユーザの手間を増大化させていた。 However, in image processing for deforming an image by setting a correction area as described above, processing that requires a large amount of calculation processing such as setting a correction area and enlarging or reducing a small area is performed. For this reason, the amount of calculation processing for performing image processing may be excessive. This problem is not limited to the case of deforming a person's face, and is generally common to the process of deforming an image. In addition, in order to allow the user to make various settings such as the necessity of execution of image deformation and the strength (degree) of deformation before executing such image deformation, the user's effort is increased.
本発明は上記課題に鑑みてなされたものであり、画像の変形に要する演算処理量を低減するとともに、ユーザに負担をかけることなく自動的に、理想的な変形処理が施された画像を得ることが可能な画像処理装置、画像処理方法および画像処理プログラムを提供することを目的とする。 The present invention has been made in view of the above problems, and reduces the amount of calculation processing required for image deformation and automatically obtains an image subjected to ideal deformation processing without imposing a burden on the user. An object is to provide an image processing apparatus, an image processing method, and an image processing program.
上記目的を達成するため、本発明の画像処理装置は、顔画像が含まれる対象画像において、当該顔画像を含む人物の体型に対応した体型領域を推定する体型推定部と、上記体型領域の縦横比を理想比に略一致させるための補正値を取得する補正値取得部と、上記補正値に応じて、少なくとも上記体型領域を含む上記対象画像の領域を、特定方向に変形させる画像変形部とを備える構成としてある。本発明によれば、少ない処理量で対象画像内の人物の体型を自動的に理想的な体型に変形させることができる。 In order to achieve the above object, an image processing apparatus of the present invention includes a body shape estimation unit that estimates a body shape region corresponding to a body shape of a person including a face image in a target image including a face image, and a vertical and horizontal direction of the body shape region. A correction value acquisition unit that acquires a correction value for making the ratio substantially coincide with the ideal ratio; and an image deformation unit that deforms at least the region of the target image including the body shape region in a specific direction according to the correction value. It is set as the structure provided with. According to the present invention, the figure of a person in a target image can be automatically transformed into an ideal figure with a small amount of processing.
上記体型推定部は、上記対象画像から上記人物の特徴部分の幅を抽出し、当該抽出した特徴部分の幅に基づいて上記体型領域を推定するとしてもよい。具体的には、上記体型推定部は、上記特徴部分として人物の頬または肩または腰の幅を抽出する。当該構成によれば、対象画像内の人物の体型に対応した領域を精度良く推定することができる。 The body type estimation unit may extract the width of the feature portion of the person from the target image and estimate the body region based on the width of the extracted feature portion. Specifically, the body type estimation unit extracts the width of a person's cheek or shoulder or waist as the characteristic portion. According to the said structure, the area | region corresponding to the body shape of the person in a target image can be estimated with a sufficient precision.
画像処理装置は、上記人物の年齢層および又は性別を推定する年齢性別推定部を備え、上記補正値取得部は、上記推定された年齢層および又は性別に応じて、上記取得した補正値を変更するとしてもよい。当該構成によれば、推定された年齢層や性別に応じて適切に変更された補正値によって人物の体型を変形することができる。ここで言う補正値の変更には、補正値が示す補正量をゼロにすることも含まれ、その場合には、実質的には画像変形部による変形は行なわれない。 The image processing apparatus includes an age-gender estimation unit that estimates an age group and / or sex of the person, and the correction value acquisition unit changes the acquired correction value according to the estimated age group and / or gender. You may do that. According to the said structure, a person's body shape can be deform | transformed with the correction value appropriately changed according to the estimated age group and sex. The change of the correction value referred to here includes setting the correction amount indicated by the correction value to zero. In this case, the image deforming unit is not substantially deformed.
上記補正値取得部は、上記体型領域の縦横比を、観察者の両目によって上記人物を直接に視認したときに知覚される当該人物の体型の縦横比に略一致させるための補正値を取得するとしてもよい。当該構成によれば、対象画像内の人物の体型を、人間の目で被写体(上記人物)を直に視認したときの印象と同等の印象を与える体型に変形させることができる。 The correction value acquisition unit acquires a correction value for making the aspect ratio of the body shape area substantially coincide with the aspect ratio of the body shape of the person perceived when the person is directly visually recognized by both eyes of the observer. It is good. According to this configuration, the body shape of the person in the target image can be transformed into a body shape that gives an impression equivalent to that obtained when the subject (the person) is directly viewed with human eyes.
上記対象画像における顔画像の向きと傾きと位置とが当該向きと傾きと位置とに対してそれぞれ設定された許容範囲内である場合に、上記体型領域の推定と補正値の取得と領域の変形とを実行するとしてもよい。当該構成によれば、顔画像の向きや、傾きや、位置が夫々の許容範囲内でないために画像変形の効果が適切に出にくい(あるいは、画像変形を行なうことで却って画像を破綻させてしまう)場合に、無駄に画像変形を実行してしまうことを防止できる。 When the orientation, inclination, and position of the face image in the target image are within the allowable ranges set for the orientation, inclination, and position, respectively, estimation of the body region, acquisition of correction values, and deformation of the region And may be executed. According to this configuration, since the orientation, inclination, and position of the face image are not within the respective allowable ranges, the effect of image deformation is difficult to be obtained properly (or the image is broken by performing image deformation on the contrary). ), It is possible to prevent unnecessary image deformation.
これまでは、本発明の技術的思想を画像処理装置として説明したが、上述した画像処理装置が備える各手段に対応した各工程を備えた画像処理方法の発明や、上述した画像処理装置が備える各手段に対応した各機能をコンピュータに実行させる画像処理プログラムの発明をも把握することができる。また、上記の画像処理装置、画像処理方法および画像処理プログラムは具体的には、パーソナルコンピュータやサーバ等のハードウェアによって実現されてもよいし、画像入力装置としてのデジタルスチルカメラやスキャナ、あるいは、画像出力装置としてのプリンタ(印刷装置)やプロジェクタやフォトヴューワ等、様々な製品によって実現することができる。 So far, the technical idea of the present invention has been described as an image processing apparatus. However, the invention of the image processing method including each process corresponding to each means included in the above-described image processing apparatus and the above-described image processing apparatus are included. The invention of an image processing program that causes a computer to execute each function corresponding to each means can also be grasped. Further, the image processing apparatus, the image processing method, and the image processing program may be specifically realized by hardware such as a personal computer or a server, or a digital still camera or scanner as an image input apparatus, or It can be realized by various products such as a printer (printing device) as an image output device, a projector, and a photo viewer.
1.画像処理装置の概略構成
図1は、本発明にかかる画像処理装置の一例としてのプリンタ100の構成を概略的に示す説明図である。プリンタ100は、メモリカードMC等の記録メディアから取得した画像データに基づき画像を印刷する、いわゆるダイレクトプリントに対応したカラーインクジェットプリンタである。プリンタ100は、内部メモリ120と、CPU110と、操作部140と、表示部150と、プリンタエンジン160と、カードインタフェース(カードI/F)170と、カードスロット172とを備えている。
1. FIG. 1 is an explanatory diagram schematically showing a configuration of a
内部メモリ120は、ROMやRAMによって構成されており、機能ブロックとして、画像補正処理部200と、表示処理部310と、印刷処理部320とを備えている。画像補正処理部200は、所定のオペレーティングシステムの下で、後述する画像補正処理を実行するためのコンピュータプログラムである。画像補正処理部200は、プログラムモジュールとして、顔領域検出部210と、除外判定部220と、体型推定部230と、補正値取得部240と、一方向変形部250と、年齢性別推定部260とを有している。一方向変形部250は、RAMに設けられた一時記憶領域であるバッファ領域と、対応画素数テーブル410とを用いることにより、画像補正処理の一種としての一方向変形処理を実行する。一方向変形部250は、特許請求の範囲における画像変形部に該当する。プリンタ100では、人物画像を含む画像に対して一方向変形処理を実行することにより、人物画像の体型を理想的な体型(理想的な縦横比)へと変形させることができる。これら各部の機能については後述する。
The
表示処理部310は、表示部150を制御して、表示部150上に処理メニューやメッセージや画像等を表示させるディスプレイドライバである。印刷処理部320は、画像データに対して所定の色変換処理やハーフトーン処理を施すことにより画素毎のインク量を規定した印刷データを生成し、プリンタエンジン160を制御して当該印刷データに基づいて画像の印刷を実行させるためのコンピュータプログラムである。印刷処理部320による色変換処理やハーフトーン処理の処理対象となる画像データには、例えば、画像補正処理部200によって画像補正処理が実行された後の画像を表す画像データが該当する。CPU110は、上述したこれらのプログラムを内部メモリ120から読み出して実行することにより、これら各部の機能をそれぞれ実現する。
The
操作部140は、ボタンやタッチパネルを備えておりユーザによる指示等の入力を受け付ける。表示部150は、例えば液晶ディスプレイによって構成されている。プリンタエンジン160は、印刷処理部320から送信される印刷データに基づき印刷を行う印刷機構である。カードI/F170は、カードスロット172に挿入されたメモリカードMCとの間でデータのやり取りを行うためのインタフェースである。プリンタ100は、カードI/F170以外にも、他の機器(例えばデジタルスチルカメラやパーソナルコンピュータ)とのデータ通信を行うためのインタフェースを備える構成とすることもできる。以上の各構成要素は、バスを介して互いに接続されている。
The
2.画像補正処理
図2は、プリンタ100によって実行される画像補正処理をフローチャートにより示している。ステップS(以下、ステップの表記を省略する。)100では、画像補正処理部200は、処理対象となる対象画像を設定(取得)する。例えば、カードスロット172にメモリカードMCが挿入されると、表示処理部310は、メモリカードMCに格納された画像の表示を含むユーザインタフェース(UI)を表示部150に表示させる。そして、画像補正処理部200は、当該UIからの入力に従って対象画像を設定する。
2. Image Correction Processing FIG. 2 is a flowchart showing image correction processing executed by the
図3は、S100の過程で表示部150に表示されるUIの一例を示している。例えば、UIは、画像表示欄IAと、2つの画像切替ボタンB1,B2と、印刷ボタンB3と、キャンセルボタンB4とを備えている。ユーザは、UIを見ながら画像切替ボタンB1,B2を操作して対象画像を選択し、印刷ボタンB3を押下することで対象画像を設定することができる。プリンタ100は、当該フローチャート終了後は、変形処理が実行された画像(あるいは当該フローチャートにおいて変形処理が実行されなかった場合には、変形処理が実行されなかった画像)を印刷する。つまり本実施形態では、ユーザが印刷ボタンB3を押すだけで、S200以下の処理が自動的に実行され、その後、印刷結果物が得られる。図3の例では、人物P1が写った画像TIが対象画像として選択されており、この状態でユーザが印刷ボタンB3を押下することで、画像補正処理部200は、画像TIを対象画像として設定する。なおUIにおいては、メモリカードMC内の複数の画像を一覧表示する構成とすることもできる。
FIG. 3 shows an example of a UI displayed on the
S200では、顔領域検出部210が、対象画像を表す画像データをメモリカードMCから内部メモリ120に読み出すとともに、対象画像における顔領域の検出を行う。顔領域とは、対象画像内の顔画像の少なくとも一部を含む領域であって、少なくとも所定の顔器官(目や鼻や口)を含むと想定される領域である。顔領域検出部210は、対象画像を表す画像データを解析して当該顔器官を含むと想定される矩形の領域を顔領域として検出する。顔領域の検出は、例えばテンプレートを利用したパターンマッチングによる方法(特開2006‐279460参照)といった公知の検出方法を用いて実行される。顔領域検出部210は、上記パターンマッチングにも、顔領域を検出可能な手法であればあらゆる手法を採用することができる。例えば、顔領域検出部210は、対象画像内に設定した矩形領域(検出対象領域)単位で、画像の各種情報(例えば、輝度情報やエッジ量やコントラスト等。)を入力し検出対象領域が顔領域に該当するか否かを示す情報を出力する、予め学習されたニューラルネットワークを用いることにより、顔領域の検出を行なっても良いし、サポートベクタマシンを利用して検出対象領域毎に顔領域であるか否かを判断してもよい。
In S200, the face
図4は、S200における顔領域の検出結果の一例を示す説明図である。図4の例では、対象画像TIに人物P1の画像が含まれているため、人物P1の顔画像に対応する顔領域Fdが検出されている。顔領域Fd1は両目と鼻と口の各画像をすべて含む矩形の領域である。顔領域検出部210は、顔領域Fdを、その領域の4つの頂点の座標により特定する。ただし、メモリカードMCに格納された対象画像を表す画像データに、既に対象画像内の顔領域Fdの検出結果(画像内の顔領域の位置を特定する情報)が付属情報として存在している場合もある。例えば、対象画像の撮影に用いられたデジタルスチルカメラの機能によって既に対象画像から顔領域Fdが検出され、その検出結果を示した情報が画像データとともにメモリカードMCに記録されている場合等である。このような場合には、顔領域検出部210は対象画像から顔領域Fdの検出を行なう必要はなく、上記付属情報に基づいて対象画像内の顔領域Fdを特定する。
FIG. 4 is an explanatory diagram showing an example of a face area detection result in S200. In the example of FIG. 4, since the image of the person P1 is included in the target image TI, the face area Fd corresponding to the face image of the person P1 is detected. The face area Fd1 is a rectangular area that includes all the images of both eyes, nose, and mouth. The face
S300では、年齢性別推定部260が、S200で検出または特定された顔領域内の画像を対象として顔(人物)の年齢層および性別を推定する。ここで言う年齢層とは、例えば、幼児、子供、青年、中年、中高年、老人等といったように分類される層である。年齢性別推定部260は、画像に基づく年齢層および性別の推定処理を公知の手法を用いて行なう。なおS300は、S200において顔領域の検出または特定に成功している場合にのみ実行される。
In S300, the age and
S400では、除外判定部220が、S100で設定された対象画像が一方向変形処理の対象から除外されるべき条件(除外条件)に該当するか否かを判定する。そして、対象画像が除外条件に該当しない場合にS500以下の処理に進み、一方、除外条件に該当する場合には、S500以下の処理を行なうことなく当該フローチャートを終了する。本実施形態では、除外判定部220は、顔領域がS200で検出されずかつ顔領域の検出結果を示した付属情報も有していない(人物を撮影したシーンではない)対象画像が、除外条件に該当すると判断する。つまり人物画像を含まない対象画像については一方向変形処理を行なわない。さらに除外判定部220は、対象画像内に顔領域が存在する場合であっても、顔領域が示す顔の向き、傾き、位置が、それぞれ顔の向き、傾き、位置について設定される許容範囲内であるか否か判定し、顔の向き、傾き、位置のいずれか一つでも許容範囲を超える場合には、除外条件に該当すると判断する。
In S400, the
顔の向きとは、正面向きの状態を基準とした顔の振りの向きであり、右向き、左向き、上向き、下向きがある。顔の向きは、例えば、顔領域内の右目、左目、口といった各顔器官の位置関係によって判断できる。例えば、除外判定部220は、テンプレートを利用したパターンマッチング等の公知の検出方法で、顔領域から、右目領域、左目領域、口領域を検出し、右目領域の重心から左目領域の重心までを結ぶ線分(参照幅距離)と、当該線分から口領域の重心までを結ぶ線分(参照高さ距離)を算出する。そして、参照幅距離に対する参照高さ距離の比率(参照高さ距離/参照幅距離)が所定のしきい値Th1を下回る場合には、顔領域が示す顔は上向きまたは下向きであると判定し、参照幅距離に対する参照高さ距離の比率が所定のしきい値Th2(Th2>Th1)を上回る場合には、顔が右向きまたは左向きであると判定する。このような上向き、下向き、右向き、左向きの顔は除外条件に該当する。言い換えれば、上記比率がしきい値Th1〜Th2の範囲に収まる場合には、除外判定部220は、顔領域が示す顔の向きは正面向きの範囲内(許容範囲内)であると判定する。
The face orientation is the direction of face swing based on the front-facing state, and includes rightward, leftward, upward, and downward. The orientation of the face can be determined, for example, based on the positional relationship of each facial organ such as the right eye, left eye, and mouth in the face area. For example, the
顔の傾きとは、対象画像の縦方向または横方向に対する顔の高さ方向の傾きである。本実施形態では、対象画像の長辺方向を対象画像の横方向とし、対象画像の短辺方向を対象画像の縦方向とする。除外判定部220は、顔の高さ方向を特定する。例えば、上記参照幅距離を示す線分に対して直交する線分が向く方向を、顔の高さ方向(顔の上下方向)であると特定する。そして、対象画像の縦方向に対して顔の高さ方向がなす角度が所定角度範囲内(例えば、20°以内)であるか、または対象画像の横方向に対して顔の高さ方向がなす角度が上記所定角度範囲内である場合に、顔の傾きは許容範囲内であると判定する。つまり除外判定部220は、顔の高さ方向が対象画像の縦方向・横方向のいずれに対しても上記所定角度よりも傾いている場合に、除外条件に該当すると判定する。
The face inclination is an inclination in the height direction of the face with respect to the vertical direction or the horizontal direction of the target image. In the present embodiment, the long side direction of the target image is the horizontal direction of the target image, and the short side direction of the target image is the vertical direction of the target image. The
画像補正処理部200は、顔の高さ方向と対象画像の縦方向・横方向との角度を検査した結果、対象画像の縦方向と横方向とのうち、顔の高さ方向との間になす角度が大きい方を、一方向変形処理のための変形方向として特定する。つまり、顔の高さ方向が縦方向を略向いている場合には横方向が変形方向となり、顔の高さ方向が略横方向を略向いている場合には縦方向が変形方向となる。以下において、単に「変形方向」と言った場合には、一方向変形処理のための変形方向を意味する。本実施形態では、図4に示したように、人物P1の顔の高さ方向は、対象画像の縦方向と略平行であるため、対象画像の横方向が変形方向となる。
As a result of inspecting the angle between the height direction of the face and the vertical and horizontal directions of the target image, the image
このように顔の向きや傾きが許容範囲を超える場合には、顔画像に一方向変形処理を適用しても良好な画像変形結果が得られ難いため、本実施形態では当該フローチャートを終了する。さらに除外判定部220は、対象画像内における人物の体の高さ方向を特定し、体の高さ方向と顔の高さ方向とが略一致しない場合も、除外条件に該当すると判定してもよい。除外判定部220は、顔領域を含む人物を、例えばパターンマッチングや輪郭抽出などによって対象画像から抽出し、抽出した人物の胴体の上下方向を体の高さ方向として検出する。そして、顔の高さ方向と体の高さ方向との間にある一定以上の角度が生じている場合には、除外条件に該当すると判定する。例えば、対象画像内の人物が、その顔は傾きが無いが体は横や斜め等を向いている姿勢の場合、人物画像に一方向変形処理を適用しても良好な画像変形結果が得られ難いため、当該フローチャートを終了する。
As described above, when the face orientation and inclination exceed the allowable range, it is difficult to obtain a good image deformation result even if the one-way deformation process is applied to the face image. Furthermore, the
また、除外判定部220は、変形方向が横方向である場合には、横方向における対象画像の両端の所定領域を除外領域として設定し、顔領域が除外領域内に含まれる場合に、顔領域の位置が許容範囲を超える(除外条件に該当)と判断する。一方、除外判定部220は、変形方向が縦方向である場合には、縦方向における対象画像の両端の所定領域を除外領域として設定し、顔領域が除外領域内に含まれる場合に、顔領域の位置が許容範囲を超える(除外条件に該当)と判断する。
Further, when the deformation direction is the horizontal direction, the
図5は、変形方向が横方向である場合に対象領域TI内に設定される除外領域A1,A2と、変形方向が縦方向である場合に対象領域内に設定される除外領域A3,A4とを例示している。一方向変形処理では、後述するように、基本的には対象画像の変形方向における略中央の領域を変形方向に圧縮し、変形方向における両端の領域を変形方向に拡大することが多い。よって、肝心の顔領域が対象画像の端に存在する場合には、当該顔領域を含む人物画像に対して適切な圧縮をかけることができず、逆に当該人物を拡大させる(太らせる)結果となる恐れもある。よって、対象画像内の顔の位置が許容範囲を超える(外れる)場合にも一方向変形処理を行なうことなく当該フローチャートを終了する。 FIG. 5 shows exclusion areas A1 and A2 set in the target area TI when the deformation direction is the horizontal direction, and exclusion areas A3 and A4 set in the target area when the deformation direction is the vertical direction. Is illustrated. In the unidirectional deformation processing, as will be described later, basically, a region at the substantially center in the deformation direction of the target image is often compressed in the deformation direction, and both end regions in the deformation direction are often expanded in the deformation direction. Therefore, when an important face area exists at the end of the target image, it is not possible to apply appropriate compression to the person image including the face area, and conversely, the person is enlarged (thickened). There is also a risk of becoming. Therefore, even when the position of the face in the target image exceeds the allowable range (out of the range), the flowchart ends without performing the unidirectional deformation process.
さらに、除外判定部220は、S300で対象画像内の顔について推定された年齢層および性別に基づいて、対象画像をS500以下の処理から除外するか否か判定してもよい。例えば、除外判定部220は、推定された性別が男性であったり、推定された年齢層が子供以下である場合には、対象画像は除外条件に該当すると判定する。男性や子供や幼児については、体型を細くする(スリム化する)ような本実施形態の変形処理を適用する必要性が低いと判定し、当該フローチャートを終了する。ただし、性別や年齢層によって完全に一方向変形処理の適用から外すのではなく、後述するように、性別や年齢層に応じて一方向変形処理の際の変形の度合い(補正値)を変更するとしてもよい。
Furthermore, the
S500では、体型推定部230は、S400で除外条件に該当しないと判定された対象画像において、顔領域を含む人物の体型に対応した体型領域を推定し設定する。体型領域の推定方法は種々考えられるが、一例として本実施形態では、顔や体における特徴部分の幅を抽出し、当該抽出した幅に応じた縦横比とした矩形領域を、体型領域として対象画像内に設定する。例えば、体型推定部230は、顔領域を含む画像領域において顔の輪郭を抽出し、当該輪郭の顔の高さ方向における長さと、当該輪郭の頬位置での顔の高さ方向に直交する方向(顔の幅方向あるいは顔の左右方向)における長さ(頬の幅)とを求める。 In S500, the body shape estimation unit 230 estimates and sets a body region corresponding to the body shape of the person including the face region in the target image determined not to satisfy the exclusion condition in S400. There are various body shape region estimation methods. As an example, in this embodiment, the width of a feature portion of a face or body is extracted, and a rectangular region having an aspect ratio corresponding to the extracted width is used as a body image as a target image. Set in. For example, the body shape estimation unit 230 extracts a face outline in an image area including the face area, and the length of the outline in the height direction of the face is orthogonal to the height direction of the face at the cheek position of the outline. The length (cheek width) in (the width direction of the face or the left and right direction of the face) is obtained.
図6は、顔領域Fdを含む画像領域から抽出した輪郭FLの、顔の高さ方向の長さLhと、輪郭FLの頬位置での顔の幅方向の長さLwとを例示している。輪郭FLは、例えば、顔領域Fdを含む画像領域において肌色画素を抽出するとともに当該抽出した肌色画素が形成する領域の境界を特定することにより抽出したり、顔領域Fdの周辺において顔の輪郭に対応するエッジを検出すること等により抽出できる。また、長さLwを特定するための、顔の高さ方向における頬位置は、上記のように検出された左・右目領域と口領域との位置関係と、予め定められた人間の顔における目と頬と口との位置関係に基づいて推測できる。体型推定部230は、長さLhと長さLwとの比に応じて、体型領域の基となる標準矩形の縦横比を変更する。 FIG. 6 illustrates the length Lh in the height direction of the face FL extracted from the image area including the face area Fd and the length Lw in the width direction of the face at the cheek position of the outline FL. . The contour FL is extracted by, for example, extracting a skin color pixel in an image region including the face region Fd and specifying a boundary of a region formed by the extracted skin color pixel, or creating a contour of the face around the face region Fd. It can be extracted by detecting the corresponding edge. The cheek position in the height direction of the face for specifying the length Lw is determined by the positional relationship between the left / right eye region and the mouth region detected as described above, and the eyes in the predetermined human face. And can be estimated based on the positional relationship between the cheek and mouth. The body shape estimation unit 230 changes the aspect ratio of the standard rectangle that is the basis of the body region according to the ratio of the length Lh to the length Lw.
標準矩形とは、標準的な人間の体型(例えば、中肉中背の体型)の縦横比に対応するものとして予め内部メモリ120に格納された矩形である。体型推定部230は、長さLhに対する長さLwの比(Lw/Lh)が大きい(所定の基準値と比べて大きい)ほど、つまり頬が太った顔であるほど、標準矩形の縦の長さに対する横の長さを増加させて標準矩形を変形させ、変形後の標準矩形の縦横比を体型領域の縦横比とする。また、体型推定部230は、上記比(Lw/Lh)が小さい(所定の基準比と比べて小さい)ほど、つまり頬が痩せた顔であるほど、標準矩形の縦の長さに対する横の長さを減少させて標準矩形を変形させ、変形後の標準矩形の縦横比を体型領域の縦横比とする。
The standard rectangle is a rectangle that is stored in advance in the
図7は、対象画像TI内に推定された体型領域BAを例示している。体型推定部230は、上記のように顔の頬の幅に応じて決定した縦横比の矩形を、予め定められた顔領域Fdとの位置関係および大きさの関係に基づいて対象画像TI内に設定することにより、体型領域BAの推定を完了する。顔領域Fdと体型領域BAとの位置関係とは、例えば、体型領域BAの縦方向(体型領域の長辺方向)と平行な当該体型領域BAの中心線上の位置であって、かつ当該中心線の上端から所定割合の位置に顔領域Fdの重心位置を置くといった規則である。顔領域Fdと体型領域BAとの大きさの関係とは、例えば、体型領域BAの縦方向の長さを、顔領域Fdの顔の高さ方向の長さの所定倍にするといった規則である。 FIG. 7 illustrates a body area BA estimated in the target image TI. The body shape estimation unit 230 sets the rectangle having the aspect ratio determined according to the width of the cheek of the face as described above in the target image TI based on the positional relationship and the size relationship with the predetermined face region Fd. By setting, the estimation of the body area BA is completed. The positional relationship between the face area Fd and the body area BA is, for example, a position on the center line of the body area BA parallel to the longitudinal direction of the body area BA (long side direction of the body area), and the center line The center of gravity of the face area Fd is placed at a predetermined ratio from the upper end of the face. The relationship between the size of the face area Fd and the body shape area BA is, for example, a rule that the length of the body shape area BA in the vertical direction is a predetermined multiple of the length of the face area Fd in the height direction of the face. .
体型推定部230は、人物の特徴部分として、頬以外にも、腰や肩の幅に応じて体型領域の矩形の縦横比を決定してもよい。この場合、体型推定部230は、対象画像内から顔領域を含む人物の肩幅(顔の幅方向と平行な方向における肩の幅)又は腰幅(顔の幅方向と平行な方向における腰の幅)を検出し、肩幅または腰幅が大きいほど(所定の基準幅と比べて大きいほど)、標準矩形の縦の長さに対する横の長さを増加させて標準矩形を変形させ、変形後の標準矩形の縦横比を体型領域の縦横比とする。また、肩幅または腰幅が小さいほど(所定の基準幅と比べて小さいほど)、標準矩形の縦の長さに対する横の長さを減少させて標準矩形を変形させ、変形後の標準矩形の縦横比を体型領域の縦横比とする。なお、肩や腰といった体の特徴部分の幅は、対象領域からパターンマッチングなどによって人物の体を抽出し当該抽出した体における所定の位置関係に基づいて特定してもよいし、特開2006‐252025号公報や特開2008‐33654号公報に記載された特徴量の推定方向を用いて特定してもよい。 The body shape estimation unit 230 may determine the aspect ratio of the rectangle of the body shape region in accordance with the width of the waist and shoulders as the character characteristic portion in addition to the cheeks. In this case, the body type estimation unit 230 determines the shoulder width (shoulder width in the direction parallel to the face width direction) or waist width (waist width in the direction parallel to the face width direction) of the person including the face region from the target image. ), The larger the shoulder width or waist width (larger than the predetermined reference width), the longer the standard rectangle is, the longer the horizontal length is, and the standard rectangle is deformed. The aspect ratio of the rectangle is the aspect ratio of the body area. Also, as the shoulder width or waist width is smaller (smaller than the predetermined reference width), the standard rectangle is deformed by reducing the horizontal length with respect to the vertical length of the standard rectangle, and the standard rectangle after being deformed The ratio is the aspect ratio of the body area. Note that the width of the body feature such as the shoulder and the waist may be specified based on a predetermined positional relationship in the extracted body extracted from the target region by pattern matching or the like. You may specify using the estimation direction of the feature-value described in 252025 gazette and JP, 2008-33654, A.
S600では、補正値取得部240は、S500で推定された体型領域の縦横比を理想比に略一致させるための補正値であって、S700の一方向変形処理に用いられる補正値を取得する。理想比とは、本実施形態において理想とする体型の縦横比を意味し、市場調査やユーザの嗜好に合わせて予め設定され内部メモリ120に格納された数値である。ここで、理想比(縦:横)をH1:W1、S500で推定された体型領域の縦の長さ(画素数)、横の長さ(画素数)をそれぞれHp、Wp(図7参照)、補正後の体型領域の理想的な横の長さをWiとした場合、Wiは以下の式(1)によって表される。
Wi=W1・Hp/H1 …(1)
In S600, the correction value acquisition unit 240 acquires a correction value used for the one-way deformation process in S700, which is a correction value for making the aspect ratio of the body region estimated in S500 substantially match the ideal ratio. The ideal ratio means an aspect ratio of an ideal figure in the present embodiment, and is a numerical value that is set in advance according to market research or user preference and stored in the
Wi = W1 · Hp / H1 (1)
また補正値Cは、以下の式(2)によって表される。
C={(Wi−Wp)/Wp}・k …(2)
kは、補正値Cを調整するための所定の係数であり、基本的には0<k<1である。係数kは、補正値Cが表す補正量(画像の変形量)が大きすぎて変形後の画像が破綻してしまう(画像が変わりすぎてユーザに違和感を与える)ことを防止するための数値である。ただし係数kは実質的に存在していなくてもよく、k=1であってもよい。補正値Cは、一方向変形処理において体型の略横方向に対して作用する補正値であり、補正値Cによって体型領域を補正(変形)することで、体型領域の縦横比を理想比に略一致させることができる。補正値Cが正の値(プラス)である場合には、プラスの変形(拡大)を意味し、補正値Cが負の値(マイナス)である場合には、マイナスの変形(圧縮)を意味する。なお、本実施形態における理想比は、標準的な人間の体型の縦横比よりも若干細身な(スリムな)体型の縦横比を想定しているため、補正値Cは負の値となる場合が多い。
The correction value C is expressed by the following equation (2).
C = {(Wi−Wp) / Wp} · k (2)
k is a predetermined coefficient for adjusting the correction value C, and is basically 0 <k <1. The coefficient k is a numerical value for preventing the correction amount (the amount of deformation of the image) represented by the correction value C from being too large and causing the image after the deformation to fail (the image changes too much to give the user a sense of incongruity). is there. However, the coefficient k may not exist substantially, and k = 1 may be sufficient. The correction value C is a correction value that acts on the approximately horizontal direction of the body shape in the unidirectional deformation process. By correcting (deforming) the body region by the correction value C, the aspect ratio of the body region is approximately the ideal ratio. Can be matched. When the correction value C is a positive value (plus), it means a positive deformation (enlargement), and when the correction value C is a negative value (minus), it means a negative deformation (compression). To do. Note that the ideal ratio in the present embodiment assumes an aspect ratio of a slim figure that is slightly narrower than the aspect ratio of a standard human figure, and therefore the correction value C may be a negative value. Many.
補正値取得部240は、係数kを、S300で推定された年齢層および性別に応じて変更してもよい。つまり、S300で推定された年齢層および性別の情報をS400における除外判定に用いるのではなく、S600の補正値取得の際に用いても良い。例えば、補正値取得部240は、推定された性別が男性であったり、推定された年齢層が子供以下である場合には、推定された性別が女性でありかつ推定された年齢層が青年以上である場合に用いる係数kよりも小さい(より0に近い)係数kを採用する。その結果、対象画像内の人物が男性であったり子供以下の年齢層である場合には、画像の変形量が抑制される。また、補正値取得部240は、上記WiとWpとの差がある程度小さい場合(Wi−Wpが、0±所定値の範囲に収まる場合)には、S600において補正値Cを算出しないとしてもよい。つまり、上記推定された体型領域の縦横比が理想比に近い場合には、あえて画像変形を行なう必要が無い。そのため、演算処理量低減の観点から、WiとWpとの差がある程度小さい場合には補正量Cを算出せず、補正量Cを算出しなかった場合にはS700に進むことなく当該フローチャートを終了させる。 The correction value acquisition unit 240 may change the coefficient k according to the age group and sex estimated in S300. That is, the age group and gender information estimated in S300 may be used when acquiring the correction value in S600, instead of being used in the exclusion determination in S400. For example, when the estimated gender is male or the estimated age group is a child or less, the correction value acquisition unit 240 is the estimated gender is female and the estimated age group is greater than or equal to the adolescent. The coefficient k that is smaller (closer to 0) than the coefficient k used in the case of As a result, when the person in the target image is a man or an age group below a child, the amount of deformation of the image is suppressed. Further, the correction value acquisition unit 240 may not calculate the correction value C in S600 when the difference between the Wi and Wp is small to some extent (when Wi−Wp falls within the range of 0 ± predetermined value). . That is, when the estimated aspect ratio of the body region is close to the ideal ratio, there is no need to perform image deformation. Therefore, from the viewpoint of reducing the amount of calculation processing, if the difference between Wi and Wp is small to some extent, the correction amount C is not calculated, and if the correction amount C is not calculated, the process ends without proceeding to S700. Let
人物の撮影の仕方によっては、上半身だけを撮影する場合等もあり、対象画像に人物の全身が写されているとは限らない。つまり、上記のように顔の頬の幅等に応じて決定した縦横比の矩形を顔領域Fdとの位置関係および大きさの関係に基づいて対象画像TIに設定することにより推定された体型領域の下端部分が、対象画像からはみ出る場合もある。この場合は、一度推定された体型領域のうち対象画像内に収まった分が体型領域として扱われる。しかし、このような対象画像内に収まった分の体型領域の縦横比と上記理想比とを単純に比較することはできない。そこで、体型推定部230は、上記のように一度推定された体型領域の一部が対象画像からはみ出る場合には、体型領域のうち何割が対象画像内に収まっているかを計算する。そして、補正値取得部240は、当該計算された対象画像内に収まっている体型領域の割合に応じて上記理想比に変更を施し、変更後の理想比と対象画像内に収まっている分の体型領域の縦横比とを用いて補正値Cを算出するとしてもよい。 Depending on how the person is photographed, only the upper body may be photographed, and the whole body of the person is not necessarily captured in the target image. That is, the body shape region estimated by setting the rectangle having the aspect ratio determined according to the width of the cheek of the face as described above to the target image TI based on the positional relationship and the size relationship with the face region Fd. In some cases, the lower end portion of the image protrudes from the target image. In this case, of the body area that has been estimated once, the amount of the body area that falls within the target image is treated as the body area. However, it is not possible to simply compare the aspect ratio of the body region that fits in the target image with the ideal ratio. Therefore, when a part of the body shape area once estimated as described above protrudes from the target image, the body shape estimation unit 230 calculates how many of the body shape areas are included in the target image. Then, the correction value acquisition unit 240 changes the ideal ratio in accordance with the ratio of the body area that is included in the calculated target image, and the amount that is within the changed ideal ratio and the target image. The correction value C may be calculated using the aspect ratio of the body region.
S700では、一方向変形部250は、対象画像について一方向変形処理を実行する。一方向変形部250は、一方向変形処理においては、S600で取得された補正値Cに応じて少なくとも体型領域を含む対象画像の領域を、変形方向に変形させる。この場合、一方向変形部250は、変形方向に直交する分割線によって対象画像を、補正値Cを適用する第一領域と、それ以外の第二領域とに分ける。
In S700, the
図8Aは、対象画像TIを第一領域ACと第二領域AEとに分けた様子を例示し、図8Bは、対象画像TIに対して一方向変形処理を施した後の画像(変形済画像TI’と呼ぶ。)を例示している。一方向変形部250は、変形方向における体型領域BAの幅に基づいて変形方向における第一領域ACの幅を決定し(例えば、少なくとも変形方向における体型領域BAの幅よりも大きい幅を、変形方向における第一領域ACの幅とする)、当該決定した幅を有する領域であって体型領域BAを含む(基本的には中央に含む)領域を、変形方向に直交する分割線によって特定し、当該特定した領域を第一領域ACとして設定する。従って、第一領域ACには体型領域BAの全体が含まれる。また、一方向変形部250は、対象領域TIにおける第一領域AC以外の領域(第一領域ACの両側の領域)を第二領域AEとして設定する。
FIG. 8A illustrates a state in which the target image TI is divided into a first area AC and a second area AE, and FIG. 8B illustrates an image (transformed image) after the unidirectional deformation process is performed on the target image TI. TI '). The
図9は、S700の一方向変形処理をフローチャートにより示し、図10は、変形方向が横方向である場合の、一方向変形処理を模式的に示している。図10Aは、一方向変形処理が施される前の対象画像における画素の配置を示し、図10Bは、対応画素数テーブル410の一例を示し、図10Cは、一方向変形処理が施された画像(変形済画像)の画素の配置を示している。S710では、一方向変形部250は、変形方向が対象画像の横方向と縦方向とのいずれであるかを判断する。変形方向が横方向である場合はS720に進み、変形方向が縦方向である場合はS750に進む。本実施形態では対象画像の横方向が変形方向であるため、S720に進む。S720では、一方向変形部250は、対象画像において第一領域と第二領域とを設定する。第一領域と第二領域との設定方法は既に述べたため、ここでは説明を省略する。
FIG. 9 is a flowchart illustrating the unidirectional deformation process in S700, and FIG. 10 schematically illustrates the unidirectional deformation process when the deformation direction is the horizontal direction. FIG. 10A shows an arrangement of pixels in the target image before the one-way deformation process is performed, FIG. 10B shows an example of the corresponding pixel number table 410, and FIG. 10C shows an image on which the one-way deformation process has been performed. The pixel arrangement of (deformed image) is shown. In S710, the
S730では、一方向変形部250は、対応画素数テーブル410を生成する。対応画素数テーブル410とは、対象画像の変形方向における各画素に対応する変形済画像の画素数を表すテーブルである。一方向変形部250は、第一領域および第二領域それぞれに対する補正値に基づいて、変形済画像の画素数(対応画素数)を決定する。そして、決定された対応画素数を対応画素数テーブル410に格納することにより、対応画素数テーブル410が生成される。一方向変形部250は、対応画素数テーブル410の生成にあたっては、補正値Cを第一領域に適用する倍率(変形倍率)に変換する。例えば、補正値Cが「−0.4」という数値である場合、これは元の大きさから当該元の大きさの「0.4」倍分を引くという意味であるため、「0.6」という数値(倍率)に変換する。逆に、補正値Cが「0.4」という数値である場合、これは元の大きさに当該元の大きさの「0.4」倍分を足すという意味であるため、「1.4」という数値(倍率)に変換する。ここでは、補正値Cは負の値であるとし、一方向変形部250は、第一領域に適用する倍率として「0.6」という値を得たものとする。
In S730, the
また、一方向変形部250は、第二領域に適用する倍率も設定する。例えば、プリンタ100は、第一領域に適用する倍率と第二領域に適用する倍率との対応関係を規定したテーブルを予め内部メモリ120等に有しておき、一方向変形部250は、当該テーブルと上記のように取得した第一領域に適用する倍率とを参照して、第二領域に適用する倍率を求めることができる。あるいは、一方向変形部250は、対象画像における第一・第二領域の大きさの比率および第一領域の倍率に応じて、対象画像のサイズと変形済画像のサイズとを略一致させるような、第二領域の倍率を求めてもよい。本実施形態では、一方向変形部250は、第二領域に適用する倍率として「1.2」という値を得たものとする。一方向変形部250は、例えば、上記のように得た倍率の小数部についてハーフトーン処理による二値化を行って0と1との配列パターンを決定し、配列パターンの0または1の値に倍率の整数部を加えることによって、対象画像の画素毎の対応画素数を決定することができる。一方向変形部250は、対応画素数テーブル410の生成に当っては、ハーフトーン処理としては、ディザや誤差拡散などの周知の方法を用いることができる。また、倍率の小数部ごとに予め格納された配列パターンを用いてもよい。
In addition, the
図10Aでは、説明をごく簡単にするために、画像の横方向にそれぞれ5画素からなる領域D,E,Fが存在し、領域Dおよび領域Fが第二領域であり、領域Eが第一領域である場合を想定して説明を行なう。ここでは、領域Dの倍率が1.2倍、領域Eの倍率が0.6倍、領域Fの倍率が1.2倍であるため、対応画素数テーブル(図10B)においては、領域Dの5画素Px1〜Px5のうち、4つの画素Px1,Px2,Px3,Px5については、対応画素数が1に設定され、残り1つの画素Px4については、対応画素数が2に設定されている。また、領域Eの5画素Px6〜Px10のうち、3つの画素Px6,Px8,Px10については、対応画素数が1に設定され、残り2つの画素Px7,Px9については、対応画素数が0に設定されている。また、領域Fの5画素Px11〜Px15のうち、4つの画素Px11,Px12,Px13,Px15については、対応画素数が1に設定され、残り1つの画素Px14については、対応画素数が2に設定されている。 In FIG. 10A, for the sake of simple explanation, there are areas D, E, and F each having 5 pixels in the horizontal direction of the image, the areas D and F are the second areas, and the area E is the first. The description will be made assuming a region. Here, the magnification of the region D is 1.2 times, the magnification of the region E is 0.6 times, and the magnification of the region F is 1.2 times. Therefore, in the corresponding pixel number table (FIG. 10B), Of the five pixels Px1 to Px5, four pixels Px1, Px2, Px3, and Px5 have the corresponding pixel number set to 1, and the remaining one pixel Px4 has the corresponding pixel number set to two. In addition, among the five pixels Px6 to Px10 in the region E, the corresponding number of pixels is set to 1 for the three pixels Px6, Px8, and Px10, and the corresponding number of pixels is set to 0 for the remaining two pixels Px7 and Px9. Has been. Of the five pixels Px11 to Px15 in the region F, the corresponding number of pixels is set to 1 for four pixels Px11, Px12, Px13, and Px15, and the corresponding number of pixels is set to 2 for the remaining one pixel Px14. Has been.
S740では、一方向変形部250は、対応画素数テーブル410を参照し、内部メモリ120内のバッファ領域を用いて対象画像の1ライン分の画素の再配置を行なう。ラインとは、一方向変形処理における処理単位であり、長さが対象画像の横方向における全画素数分で、幅が1画素分の画像領域をいう。図10の例では、図10Cに示すように、領域Dを構成する画素として、順次、対応画素数が1の画素Px1,Px2,Px3が1つずつ配置され、次に対応画素数が2の画素Px4が2つ配置され、次に対応画素数が1の画素Px5が1つ配置される。次いで、領域Eを構成する画素として、対応画素数が1の画素Px6,Px8,Px10が順に1つずつ配置され、次に、領域Fを構成する画素として、対応画素数が1の画素Px11,Px12,Px13が1つずつ配置され、対応画素数が2の画素Px14が2つ配置され、対応画素数が1の画素Px15が1つ配置される。このような1ライン分の画素の再配置を全ラインについて行なうことにより、対象画像の第二領域はそれぞれ1.2倍に拡大され、第一領域は0.6倍に圧縮される。
In S740, the
S750では、一方向変形処部250は、対象画像の全てのラインについて、画素の再配置が完了したか否かを判断する。全てのラインについて画素の再配置が完了している場合、一方向変形処理を終了し、その結果、図2のフローチャートが終了する。一方、画素の再配置が完了していない場合、処理はS740に戻され、全てのラインについて画素の再配置が完了するまで、S740,S750が繰り返し実行される。一方向変形部250は、S760においては、対象画像の縦方向と直交する分割線よって対象画像を第一領域と第二領域とに分け、S770では、S730と同様に第一領域、第二領域の各倍率を用いて対応画素数テーブル410を生成する。変形方向が縦方向の場合、対象画像の縦方向に並ぶ各画素(縦方向に並ぶ各ライン)についての対応画素数を規定した対応画素数テーブル410が生成される。対応画素数の決定方法はS730と同様であるので説明を省略する。
In S750, the unidirectional
S780において、一方向変形部250は、対応画素数テーブルを参照して、上記バッファ領域に設けられた変形済画像の格納領域に、対象画像のラインを配置する。変形方向が横方向である場合には、画素単位でその画素に対応する対応画素数(0や1や2等)に応じた再配置を行なうが、変形方向が縦方向である場合には、ライン単位で、そのラインに対応する対応画素数に応じた配置を行なう。具体的には、上記バッファ領域の変形済画像の格納領域に、バッファ領域に格納された対象画像の1ラインを、当該1ラインに対応する対応画素数分のラインとして追加する。S790では、一方向変形部250は、対象画像の全てのラインを対象としてS780の処理を完了したか否かを判断し、完了している場合は、一方向変形処理を終了し、その結果、図2のフローチャートが終了する。一方、完了していない場合は、処理はS780に戻され、対象画像の全てのラインを対象としてS780が行なわれるまで、S780,S790が繰り返し実行される。
In S780, the one-
S700の一方向変形処理により、体型領域を含む第一領域は、補正値Cに応じて変形方向に変形(圧縮)され、第二領域も変形方向に変形(第一領域が圧縮される場合には拡大)される。つまり図8Bに例示したように、第一領域ACは、第一領域AC’へと変形(圧縮)され、第二領域AEは第二領域AE’へと変形(拡大)され、変形済画像TI’中の人物P1の体型は、その縦横比が理想比にほぼ一致したものとなる(多くの場合、変形前の体型よりも変形後の方が全体的にスリムになる)。このように本実施形態によれば、ユーザが対象画像を指定するだけで、プリンタ100は、対象画像内の顔画像を含む人物の体型に対応した矩形(体型領域)を対象画像内に推定し、体型領域の縦横比を理想比に略一致させるための補正値を算出し、対象領域を変形方向において変形させる際に、体型領域を含む第一領域に対して、補正値に応じた変形を施す。そのため、ユーザは、人物画像が自動的に理想的な体型に補正された画像を得ることができる。また、実行される画像変形処理は、対象画像の一つの方向(変形方向)に沿った圧縮および拡大だけであるため、演算処理量が非常に少なく、プリンタ100の負担も少ない。
By the unidirectional deformation process in S700, the first region including the body region is deformed (compressed) in the deformation direction according to the correction value C, and the second region is also deformed in the deformation direction (when the first region is compressed). Is enlarged). That is, as illustrated in FIG. 8B, the first area AC is deformed (compressed) into the first area AC ′, the second area AE is deformed (enlarged) into the second area AE ′, and the deformed image TI. The figure of the middle person P1 has an aspect ratio that substantially matches the ideal ratio (in many cases, the figure after deformation is generally slimmer than the figure before transformation). As described above, according to the present embodiment, only by the user specifying the target image, the
3.他の実施例
上記では、S600で用いる理想比は、市場調査やユーザの嗜好に合った体型すなわちある程度ユーザの願望が介入した体型(例えば、スリムな体型)を表した比率であるとして説明を行なった。しかし理想比は上記のようなものに限られない。人は、ある被写体を直接見たときの印象とは異なる印象を、同じ被写体が撮影された画像から受けることがあり、特に被写体を画像として見たときの印象の方が、実物を見たときの印象よりも「太め」に見えることがある。そこで当該他の実施例(以下、当該実施例と呼ぶ)では「理想比」とは、人間が両目で被写体を直接視認したときに知覚する被写体の縦横比であるとする。当該実施例では、S600において、体型領域の縦横比を、人が被写体(人物)を直接視認したときに知覚する体型の縦横比に略一致させるための補正値C´を算出する場合について説明する。なおS600以外の内容は、基本的にこれまでに説明した通りである。
3. Other Embodiments In the above description, it is assumed that the ideal ratio used in S600 is a ratio that represents a body shape that suits market research and user preferences, that is, a body shape that the user's desire has intervened to some extent (for example, a slim body shape). It was. However, the ideal ratio is not limited to the above. A person may get an impression from an image of the same subject that is different from the impression of looking directly at the subject. Especially when the subject is viewed as an image, the impression is more real It may appear “thick” rather than the impression. Therefore, in the other embodiment (hereinafter referred to as the embodiment), the “ideal ratio” is assumed to be the aspect ratio of the subject perceived when a human directly visually recognizes the subject with both eyes. In this embodiment, a description will be given of a case where, in S600, the correction value C ′ for making the aspect ratio of the body shape area substantially coincide with the aspect ratio of the body shape perceived when a person directly views the subject (person) is described. . The contents other than S600 are basically the same as described above.
図11は、当該実施例において、補正値取得部240がS600において実行する処理をフローチャートにより示している。S610では、補正値取得部240は、被写体(人物P1)の撮影距離Sdおよび顔の幅Wfを取得する。撮影距離Sdとは、デジタルスチルカメラによる対象画像の撮影時における、当該デジタルスチルカメラ(詳細には、デジタルスチルカメラのレンズの主点)から人物P1までの距離を意味する。撮影距離Sdは、デジタルスチルカメラによって撮影の際に算出あるいは取得され、対象画像を表した画像データとともに、付属情報の一種としてデジタルスチルカメラ内のメモリカードMCに記録される。従って、プリンタ100側では、そのようなメモリカードMCがカードスロット172に挿入されている状況において、メモリカードMCに対象画像の画像データとともに記録されている付属情報の中から撮影距離Sdを取得することができる。また顔の幅Wfとは、人間の標準的な顔の幅(顔の現実の大きさ)を示した値(例えば200mm)であり、予め内部メモリ120等に格納されている。顔の幅Wfの値は、幼児、子供、青年以上というように各年齢層に応じて異なる値が格納されていてもよく、補正値取得部240は、S300で推定された年齢層に対応する顔の幅Wfを取得するとしてもよい。
FIG. 11 is a flowchart showing the process executed by the correction value acquisition unit 240 in S600 in the embodiment. In S610, the correction value acquisition unit 240 acquires the shooting distance Sd and the face width Wf of the subject (person P1). The shooting distance Sd means the distance from the digital still camera (specifically, the principal point of the lens of the digital still camera) to the person P1 when the target image is shot by the digital still camera. The shooting distance Sd is calculated or acquired at the time of shooting with a digital still camera, and is recorded on a memory card MC in the digital still camera as a kind of attached information together with image data representing the target image. Therefore, on the
S620では、補正値取得部240は、両眼距離DEを取得する。両眼距離DEとは、人間の標準的な両眼の間隔の値であり、例えば60mmといった数値である。両目距離DEも予め内部メモリ120に格納されている。両目距離DEも顔の幅Wfと同じように、各年齢層に応じて異なる値が格納されていてもよく、補正値取得部240は、S300で推定された年齢層に対応する両目距離DEを取得するとしてもよい。S630では、補正値取得部240は、S610で取得した情報(Sd,Wf)に基づいた幾何学的計算により、単眼を介して捉えられる対象画像中の人物の大きさ(単眼知覚サイズSMと呼ぶ)を算出する。単眼とはデジタルスチルカメラのレンズを意味する。S640では、補正値取得部240は、S610,S620で取得した情報(Sd,Wf,DE)に基づいた幾何学的計算により、人間の左右の眼によって知覚される対象画像中の人物の大きさ(両眼知覚サイズSBと呼ぶ)を算出する。
In S620, the correction value acquisition unit 240 acquires the binocular distance DE. The binocular distance DE is a standard human distance between both eyes, for example, a numerical value such as 60 mm. Both eyes distance DE is also stored in the
図12は、単眼としてのレンズ502と、人間の左右の眼(右眼RE、左眼LE)と、被写体OB(人物の顔)と、仮想的な結像面S1との位置関係を上面から2次元にて表している。図12の中心軸であるY軸上には、レンズ502(レンズ502の主点)と、被写体OBの中心点Cが位置する。レンズ502と中心点Cとの距離はSdである。当該実施例では計算を容易とするために、被写体OBは球体であるとしている。被写体OBの半径rは、Wf/2である。右眼REと左眼LEとは、両者の中間点がレンズ502の主点に一致し、かつ互いにDEだけ離れた状態でレンズ502の両側に位置する。右眼RE、レンズ502、左眼LEの並びは、X軸に平行である。結像面S1は、X軸に平行な面であって、右眼RE、レンズ502、左眼LEが並ぶ面(観察面S2)を挟んで被写体OBとは反対側に在る。観察面S2と結像面S1との距離d1は特に問われない。補正値取得部240は、単眼知覚サイズSMおよび両眼知覚サイズSBの算出に際し、距離d1として、任意の値(距離)を固定値として設定すればよい。
FIG. 12 illustrates the positional relationship among the
このような位置関係において、S630では、補正値取得部240は、レンズ502の位置において交差する被写体OBの2本の接線を引く。当該2本の接線と被写体ОBとの2つの接点AS,BSの間の範囲が、レンズ502を介して捉えられる被写体ОBの横幅となる。従って補正値取得部240は、当該2本の接線と結像面S1との2つの交点間のX軸方向の範囲の距離を、単眼知覚サイズSMとして算出する。S640では、補正値取得部240は、まず両眼知覚サイズSBを得るための前段階の処理として、右眼REの位置において交差する被写体OBの2本の接線と、左眼LEの位置において交差する被写体OBの2本の接線とをそれぞれ引く。右眼REの位置において交差する2本の接線と被写体OBとの2つの接点AR,BRの間の範囲が、右眼REによって知覚される被写体OBの横幅となる。そこで、補正値取得部240は、右眼REの位置において交差する2本の接線と結像面S1との2つの交点間のX軸方向の範囲の距離を、右眼知覚範囲SRとして算出する。同様に、左眼LEの位置において交差する2本の接線と被写体OBとの2つの接点AL,BLの間の範囲が、左眼LEによって知覚される被写体ОBの横幅となる。そこで、補正値取得部240は、左眼LEの位置において交差する2本の接線と結像面S1との2つの交点間のX軸方向の範囲の距離を、左眼知覚範囲SLとして算出する。
In such a positional relationship, in S630, the correction value acquisition unit 240 draws two tangent lines of the subject OB that intersects at the position of the
このように右眼RE、左眼LEによってそれぞれ知覚される被写体の範囲には、左右方向にずれが生じている。ここで、人間が両目で物を見るときには、右眼REで知覚される範囲の像と左眼LEで知覚される範囲の像とを重ね合わせたときに共通する範囲を、その物の大きさと認識すると推測される。そこで当該実施例では、上記算出した左眼知覚範囲SLと右眼知覚範囲SRとを重ね合わせたときに共通する範囲の長さを、両眼知覚サイズSBとする。当該重ね合わせの処理には、被写体ОB上の注視点PGの位置を利用する。注視点PGとは、人間が被写体ОBを見たときに最も注目していると推定される点であり、当該実施例では、右眼RE、左眼LEの両方から見える被写体ОB上の点であって、右眼REからの距離と左眼LEからの距離とが等しい点としている。補正値取得部240は、注視点PGおよび右眼REを通過する直線と結像面S1との交点位置を、注視点PGに対応する右眼知覚範囲SR上の点PGrとし、注視点PGおよび左眼LEを通過する直線と結像面S1との交点位置を、注視点PGに対応する左眼知覚範囲SL上の点PGlとする。そして、点PGrと点PGlとが一致するように、左眼知覚範囲SLと右眼知覚範囲SRとを重ね合わせる。 As described above, there is a shift in the left-right direction in the range of the subject perceived by the right eye RE and the left eye LE. Here, when a human sees an object with both eyes, a common range when the image of the range perceived by the right eye RE and the image of the range perceived by the left eye LE are superimposed is set as the size of the object. Presumed to recognize. Therefore, in this embodiment, the length of the common range when the calculated left-eye perception range SL and right-eye perception range SR are overlapped is set as the binocular perception size SB. In the superimposition process, the position of the gazing point PG on the subject OB is used. The gazing point PG is a point that is estimated to be most noticeable when a human views the subject OB. In this embodiment, the point of interest PG is a point on the subject OB that can be seen from both the right eye RE and the left eye LE. Thus, the distance from the right eye RE is equal to the distance from the left eye LE. The correction value acquisition unit 240 sets the intersection position between the image line S1 and the straight line passing through the gazing point PG and the right eye RE as a point PGr on the right eye perception range SR corresponding to the gazing point PG, An intersection position between the straight line passing through the left eye LE and the imaging plane S1 is set as a point PGl on the left eye perception range SL corresponding to the gazing point PG. Then, the left eye perception range SL and the right eye perception range SR are overlapped so that the point PGr and the point PGl coincide with each other.
図13では、点PGrと点PGlとが一致するように左眼知覚範囲SLと右眼知覚範囲SRとを重ね合わせた状態を示しており、このとき両範囲SL,SRに共通する範囲のX軸方向の距離を、補正値取得部240は、両眼知覚サイズSBと認定する。このように求められる両眼知覚サイズSBは、S630で求めた単眼知覚サイズSMより短い。従って、人は、レンズ502を介して撮像された被写体OBの画像を観察すると、被写体OBを直接観察したときと比較して横幅が広い(太った)印象を受けると言える。S650では、補正値取得部240は、単眼知覚サイズSMに対する両眼知覚サイズSBの比率(SB/SM)を算出し、当該比率(SB/SM)を補正値C´とする(C´=SB/SM)。このように当該実施例では、被写体OBの注視点PGを基準とした右眼知覚範囲SRと左眼知覚範囲SLとの重ね合わせによって得られる共通範囲の長さを両眼知覚サイズSBとしている。そのため、単眼知覚サイズSMに対する両眼知覚サイズSBの比率は、被写体距離Sdで単眼レンズで撮像された被写体OBの画像(人物を含む対象画像)を観察したときに人が知覚する被写体ОB(人物)の横方向の幅に対する、被写体距離Sdで人が被写体OB(人物)を直接観察したときに知覚する被写体ОB(人物)の横方向の比率を正確に表していると言える。
FIG. 13 shows a state in which the left-eye perception range SL and the right-eye perception range SR are overlapped so that the point PGr and the point PGl coincide with each other, and at this time, a range X common to both the ranges SL and SR is shown. The correction value acquisition unit 240 recognizes the axial distance as the binocular perception size SB. The binocular perception size SB obtained in this way is shorter than the monocular perception size SM obtained in S630. Accordingly, it can be said that when a person observes the image of the subject OB imaged through the
S600で補正値C´が算出された後、一方向変形部250が対象画像について一方向変形処理(S700)を実行する。このとき一方向変形部250は、体型領域を含む第一領域に対して補正値C´を適用した変形処理を行なう。つまり補正値C´は倍率そのものであるため、補正値C´を適用した変形処理が第一領域に対して行なわれることにより、第一領域は変形方向において補正値C´が表す倍率で圧縮される。一方向変形部250は、第二領域については所定の倍率によって拡大する。このように当該実施例によれば、S600で、単眼知覚サイズSMに対する両眼知覚サイズSBの比率(SB/SM)を補正値C´として求め、補正値C´によって対象画像における第一領域を変形方向に圧縮する。そのため、第一領域に含まれる人物画像の横幅も圧縮され、その結果、当該人物画像の縦横比は、ユーザが当該人物を直接に視認したときに知覚する体型の縦横比に略一致したものとなる。当該実施例では、ユーザが被写体を現実に見たときに受ける印象と同様の印象をユーザが画像を見たときにも与えることを目的としているため、上記推定された対象画像中の人物の年齢層や性別によって一方向変形処理を行なわないとすることはなく、また、単眼知覚サイズSMに対する両眼知覚サイズSBの比率として算出された補正値C´に対して、さらに年齢層や性別に応じた変更を加えることはしない。
After the correction value C ′ is calculated in S600, the
100…プリンタ、110…CPU、120…内部メモリ、140…操作部、150…表示部、160…プリンタエンジン、170…カードインタフェース、172…カードスロット、200…画像補正処理部、210…顔領域検出部、220…除外判定部、230…体型推定部、240…補正値取得部、250…一方向変形部、260…年齢性別推定部、310…表示処理部、320…印刷処理部、410…対応画素数テーブル
DESCRIPTION OF
Claims (8)
上記体型領域の縦横比を理想比に略一致させるための補正値を取得する補正値取得部と、
上記補正値に応じて、少なくとも上記体型領域を含む上記対象画像の領域を、特定方向に変形させる画像変形部とを備えることを特徴とする画像処理装置。 A body type estimation unit for estimating a body region corresponding to a body shape of a person including the face image in the target image including the face image;
A correction value acquisition unit for acquiring a correction value for making the aspect ratio of the body region substantially coincide with the ideal ratio;
An image processing apparatus comprising: an image deformation unit configured to deform at least a region of the target image including the body shape region in a specific direction according to the correction value.
上記体型領域の縦横比を理想比に略一致させるための補正値を取得する補正値取得工程と、
上記補正値に応じて、少なくとも上記体型領域を含む上記対象画像の領域を、特定方向に変形させる画像変形工程とを備えることを特徴とする画像処理方法。 A body shape estimation step for estimating a body shape region corresponding to the body shape of the person including the face image in the target image including the face image;
A correction value acquisition step for acquiring a correction value for making the aspect ratio of the body region substantially coincide with the ideal ratio;
An image processing method comprising: an image deformation step of deforming at least a region of the target image including the body shape region in a specific direction according to the correction value.
上記体型領域の縦横比を理想比に略一致させるための補正値を取得する補正値取得機能と、
上記補正値に応じて、少なくとも上記体型領域を含む上記対象画像の領域を、特定方向に変形させる画像変形機能とをコンピュータに実行させることを特徴とする画像処理プログラム。 A body shape estimation function for estimating a body shape region corresponding to a body shape of a person including the face image in a target image including a face image;
A correction value acquisition function for acquiring a correction value for making the aspect ratio of the body region substantially coincide with the ideal ratio;
An image processing program for causing a computer to execute an image deformation function for deforming a region of the target image including at least the body shape region in a specific direction according to the correction value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008217923A JP2010056726A (en) | 2008-08-27 | 2008-08-27 | Image processor, image processing method and image processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008217923A JP2010056726A (en) | 2008-08-27 | 2008-08-27 | Image processor, image processing method and image processing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010056726A true JP2010056726A (en) | 2010-03-11 |
Family
ID=42072209
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008217923A Withdrawn JP2010056726A (en) | 2008-08-27 | 2008-08-27 | Image processor, image processing method and image processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010056726A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014002445A (en) * | 2012-06-15 | 2014-01-09 | Furyu Kk | Image process device, method and program |
JP2015125519A (en) * | 2013-12-26 | 2015-07-06 | カシオ計算機株式会社 | Image processor, image processing method and program |
CN110766603A (en) * | 2018-07-25 | 2020-02-07 | 北京市商汤科技开发有限公司 | Image processing method and device and computer storage medium |
JP2021515313A (en) * | 2018-09-21 | 2021-06-17 | ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド | Image processing methods, devices and computer storage media |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11283040A (en) * | 1998-01-29 | 1999-10-15 | Mitsubishi Electric Corp | Operation controller and computer readable recording medium for recording operation analysis program |
JP2004318204A (en) * | 2003-04-10 | 2004-11-11 | Sony Corp | Image processing device, image processing method, and photographing device |
JP2006135533A (en) * | 2004-11-04 | 2006-05-25 | Funai Electric Co Ltd | Digital camera |
JP2007280291A (en) * | 2006-04-11 | 2007-10-25 | Nikon Corp | Electronic camera |
JP2008123086A (en) * | 2006-11-09 | 2008-05-29 | Matsushita Electric Ind Co Ltd | Image processor and image processing method |
-
2008
- 2008-08-27 JP JP2008217923A patent/JP2010056726A/en not_active Withdrawn
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11283040A (en) * | 1998-01-29 | 1999-10-15 | Mitsubishi Electric Corp | Operation controller and computer readable recording medium for recording operation analysis program |
JP2004318204A (en) * | 2003-04-10 | 2004-11-11 | Sony Corp | Image processing device, image processing method, and photographing device |
JP2006135533A (en) * | 2004-11-04 | 2006-05-25 | Funai Electric Co Ltd | Digital camera |
JP2007280291A (en) * | 2006-04-11 | 2007-10-25 | Nikon Corp | Electronic camera |
JP2008123086A (en) * | 2006-11-09 | 2008-05-29 | Matsushita Electric Ind Co Ltd | Image processor and image processing method |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014002445A (en) * | 2012-06-15 | 2014-01-09 | Furyu Kk | Image process device, method and program |
JP2015125519A (en) * | 2013-12-26 | 2015-07-06 | カシオ計算機株式会社 | Image processor, image processing method and program |
US9342738B2 (en) | 2013-12-26 | 2016-05-17 | Casio Computer Co., Ltd. | Image processing to improve physique of imaged subject |
CN110766603A (en) * | 2018-07-25 | 2020-02-07 | 北京市商汤科技开发有限公司 | Image processing method and device and computer storage medium |
CN110766603B (en) * | 2018-07-25 | 2024-04-12 | 北京市商汤科技开发有限公司 | Image processing method, device and computer storage medium |
JP2021515313A (en) * | 2018-09-21 | 2021-06-17 | ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド | Image processing methods, devices and computer storage media |
JP7090169B2 (en) | 2018-09-21 | 2022-06-23 | ベイジン センスタイム テクノロジー デベロップメント カンパニー, リミテッド | Image processing methods, equipment and computer storage media |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4973393B2 (en) | Image processing apparatus, image processing method, image processing program, and image processing system | |
JP6742405B2 (en) | Head-mounted display with facial expression detection function | |
JP5115398B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP5679978B2 (en) | Stereoscopic image alignment apparatus, stereoscopic image alignment method, and program thereof | |
US8355602B2 (en) | Image processing apparatus, image processing method and image processing program | |
TWI574224B (en) | An image processing apparatus, an image processing method, a video product processing apparatus, a recording medium, and an image display apparatus | |
EP2866201B1 (en) | Information processing apparatus and method for controlling the same | |
US9607439B2 (en) | Information processing apparatus and information processing method | |
US8249312B2 (en) | Image processing device and image processing method | |
WO2014064870A1 (en) | Image processing device and image processing method | |
WO2014041330A2 (en) | Inspection imaging system, and a medical imaging system, apparatus and method | |
JP2015106252A (en) | Face direction detection device and three-dimensional measurement device | |
JP2010056726A (en) | Image processor, image processing method and image processing program | |
JP2017194301A (en) | Face shape measuring device and method | |
JP5840022B2 (en) | Stereo image processing device, stereo image imaging device, stereo image display device | |
US20160019673A1 (en) | Fingerprint image conversion device, fingerprint image conversion system, fingerprint image conversion method, and fingerprint image conversion program | |
KR100930594B1 (en) | The system for capturing 2d facial image and extraction method of face feature points thereof | |
US9591284B2 (en) | Visually-assisted stereo acquisition from a single camera | |
JP2013219421A (en) | Image processing device and image processing method | |
CN113170075A (en) | Information processing apparatus, information processing method, and program | |
JP5958082B2 (en) | Image processing apparatus and image processing method | |
JP6858007B2 (en) | Image processing system, image processing method | |
JP2010170219A (en) | Apparatus, method and program for processing image, and printer | |
JP2019062436A (en) | Image processing apparatus, image processing method, and program | |
JP2013210778A (en) | Imaging apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110823 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120423 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120508 |
|
A761 | Written withdrawal of application |
Free format text: JAPANESE INTERMEDIATE CODE: A761 Effective date: 20120528 |