JP3577154B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP3577154B2
JP3577154B2 JP1673096A JP1673096A JP3577154B2 JP 3577154 B2 JP3577154 B2 JP 3577154B2 JP 1673096 A JP1673096 A JP 1673096A JP 1673096 A JP1673096 A JP 1673096A JP 3577154 B2 JP3577154 B2 JP 3577154B2
Authority
JP
Japan
Prior art keywords
image
hair
face
information
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP1673096A
Other languages
Japanese (ja)
Other versions
JPH08329278A (en
Inventor
敏彦 宗續
雅通 中川
義恭 角
文雄 前原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP1673096A priority Critical patent/JP3577154B2/en
Publication of JPH08329278A publication Critical patent/JPH08329278A/en
Application granted granted Critical
Publication of JP3577154B2 publication Critical patent/JP3577154B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、人物のコンピュータグラフィックスにおいて、髪型を実用時間で自動的に違和感なく他のものに取り替えて表示することができる画像処理装置に関するものである。
【0002】
【従来の技術】
従来、ある人物の画像に別の頭髪を割り付ける画像処理において、その人物の画像から頭髪が除去された画像をその画像処理の前処理として生成する場合、髪を括るなどして撮影して得られた髪が顔にかかっていない画像を取り込むか、或いはその人物の画像の頭髪の領域を手作業によって除去するかによって、その頭髪が除去された画像が得られていた。
【0003】
そして、その得られた頭髪が除去された画像に別の頭髪を割り付ける場合、手作業により頭髪が除去された画像に別の頭髪をペーストすることにより行われていた。
【0004】
【発明が解決しようとする課題】
しかしながら、このような従来の方法では、髪を括って撮影しても髪が完全に除去されず残ってしまう場合があり、そのため別の頭髪を割り付ける画像処理により得られた画像に元の頭髪が残ってしまうという課題があった。
【0005】
また、手作業で頭髪を除去する場合、かなりの時間を費やさなければならないという課題があった。
【0006】
更に、頭髪が除去された画像に別の頭髪をペーストするだけの従来の画像処理により得られた画像にはかなりの違和感があった。
【0007】
本発明は、顔の正面画像から頭髪を除去し、その頭髪を除去した部分の頭の形を推定し、その推定した頭の範囲内をその顔の肌の色で塗りつぶす処理を行う画像処理装置を提供することを目的とする。
【0008】
また、本発明は、顔の正面画像に適合するように別の頭髪を調整し、更にその頭輪郭内の色情報を用いることにより、違和感の少ない画像処理を行う画像処理装置を提供することを目的とする。
【0009】
【課題を解決するための手段】
この課題を解決するため、本発明は、人の画像の全部又は一部における各画素値と、その画像における人の構造情報とに基づいて、その画像における所定部分の領域を選定する領域選定部と、前記構造情報と、前記画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部とを備え、前記領域選定部は、前記構造情報における頭輪郭、目及び眉に基づいて、頭髪及び/又はその頭髪による影を前記領域に選定することを特徴とする画像処理装置である。
また、本発明は、人の顔画像の全部又は一部における各画素値と、その顔画像における人の構造情報とに基づいて、その顔画像における所定部分の領域を選定する領域選定部と、前記構造情報と、前記顔画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部と、前記顔画像における少なくとも1つの画素の色情報に基づいて、前記領域内の各画素値に所定の不規則なゆらぎ成分を付加するゆらぎ生成部とを備えたことを特徴とする画像処理装置である。
また、本発明は、人の顔画像の全部又は一部における各画素値と、その顔画像における人の構造情報とに基づいて、その顔画像における所定部分の領域を選定する領域選定部と、前記構造情報と、前記顔画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部とを備え、前記領域選定部は、前記顔画像における頭髪及び影部分を前記領域に選定することを特徴とする画像処理装置である。
また、本発明は、人の画像の全部又は一部における各画素値と、その画像における人の構造情報とに基づいて、その画像における所定部分の領域を選定する領域選定部と、前記構造情報と、前記領域選定部により選定された前記領域の外周近傍の前記画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部とを備えたことを特徴とする画像処理装置である。
【0019】
また、本発明は、人の像における造情報、別像である参照画像における造情報に基づいて、前記別人の画像の所定部分が、前記人の画像に適合するように、前記参照画像所定の変換を適用する画像調整部と、記所定の変換が適用された参照画像における所定部分を前記人の画像に割り付ける合成処理部とを備えたことを特徴とする画像処理装置である。
【0029】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照しながら説明する。
【0030】
図1は、本発明の第1の実施の形態に係る画像処理装置のブロック図である。図1において、本実施の形態における画像処理装置は、髪領域選定部11と除去領域変更部12とにより構成される。髪領域選定部11は、首から上の正面画像である正面顔画像13(図3参照)とその正面顔画像13に対する顔から上の各部の構造情報を表す顔表面モデル14(図4参照)とを用いて、正面顔画像13における頭髪とその頭髪による影(図3では示されていない。)との領域を除去領域15とし、その除去領域15を送出するものである。但し、図4に示す顔表面モデル14では、耳は除去されている。
【0031】
除去領域変更部12は、顔表面モデル14の情報を考慮して、正面顔画像13における顔の画素値に基づいて、正面顔画像13における除去領域15の全部又は一部の画素値の各々を変更し、髪除去画像16を生成するものである。なお、除去領域変更部12は、除去領域15の一部の画素値の各々を変更した場合、正面顔画像13における顔の画素値とは別の値を用いて、除去領域15の残部の画素値の各々を変更する。
【0032】
図2は、正面顔画像13を取り込む顔画像取り込み装置の例を示す図である。正面顔画像13は、図2に示す顔画像取り込み装置によって取り込まれたディジタル画像である。図2において、21は撮影用のビデオカメラである。22はビデオカメラ21の画像をディジタルに変換するためのA/D変換器である。23はビデオカメラ21を固定する器具である。24はビデオカメラ21により撮影される対象人物を表す。
【0033】
ビデオカメラ21は、器具23によって水平に固定される。A/D変換器22は、ビデオカメラ21で撮影されたアナログ画像をディジタル画像に変換し、正面顔画像13を生成する。正面顔画像13は、256×256画素の大きさであり、1画素につきRGB各8ビット深さのカラー画像である。また、正面顔画像13の背景色は単色である。
【0034】
図3は、図2に示す顔画像取り込み装置により取り込まれた正面顔画像13の一例を示す図である。図3における正面顔画像13は、首から上全部が写った顔が正面を向いている。その顔は、無表情で眼鏡と口鬚がなく、その頭の中心線はほぼ垂直である。また、前髪は額の全部を覆っていない。この正面顔画像13にはxy座標が導入される。
【0035】
図4は、顔表面モデル14の一例を示すワイヤーフレームモデルの図である。そのワイヤーフレームの各頂点は、顔の輪郭、目、鼻、口、眉を代表する特徴点と、それらの特徴点の間に配置される、顔の三次元構造を考慮して得られた点からなる。図4における特徴点とは円印の入った頂点をいう。
【0036】
各頂点は、その頂点の画像上のx座標とy座標のデータを有する。また、各頂点には所定の番号付けがなされ、画像上の頂点の位置は、その番号により特定される。顔表面モデル14は、これら頂点とその連結情報によって構成される。
【0037】
この顔表面モデル14は、図3における正面顔画像13における顔を認識することにより生成される。即ち、正面顔画像13における顔を認識し、その認識した顔に合わせて、予め用意された標準のワイヤーフレームモデルの各頂点を移動させることにより生成される。
【0038】
したがって、顔表面モデル14は、人によりそのフレームの形状は異なるものとなるが、トポロジー的には同じものである。顔表面モデル14を生成する処理には、特開平5−197793号公報、特開平4−199474号公報などにおける従来の手法を用いることができる。
【0039】
特開平5−197793号公報、特開平4−199474号公報の処理は以下の通りである。まず、入力の正面顔画像から、テンプレートマッチングによって虹彩の認識を行い、それをもとに目の領域をテンプレートマッチングによって認識する。次に、認識された虹彩の位置を基準に、鼻、口、眉、頬の輪郭、頭頂点それぞれの探索範囲を設定する。それぞれの探索範囲の中で、テンプレートマッチングにより鼻、口、眉、頬の輪郭、頭頂点を認識する。このようにして認識された目、鼻、口、眉、頬の輪郭、頭頂点の各領域には、決まった特徴点が得られる。そして、あらかじめ用意した標準の顔のワイヤーフレームモデルの目、鼻、口、眉、頬の輪郭、頭頂点それぞれの特徴点が、認識の結果得られたそれぞれの特徴点と一致するように、標準のワイヤーフレームモデルの変形を行い、入力顔画像の顔の表面構造を表すワイヤーフレームモデルが得られる。本実施の形態では、このようにして生成されたワイヤーフレームモデルを、入力顔画像の顔表面モデルとして用いる。
【0040】
次に、本実施の形態の動作について説明する。
【0041】
髪領域選定部11は、正面顔画像13と顔表面モデル14とを入力し、正面顔画像13における頭髪とその頭髪による影との領域を除去領域15として出力する。
【0042】
除去領域変更部12は、正面顔画像13と顔表面モデル14と除去領域15とを入力する。除去領域変更部12は、顔表面モデル14の最外周の輪郭(以後、頭輪郭という。)内にあり、且つ除去領域15内にある正面顔画像13の画素値を変更する。その画素値の変更には、除去領域15の外周近傍にある少なくとも1つの画素値が用いられる。除去領域変更部12は、その画素値の変更の対象となる画素の各々について、その画素の位置に応じて、その除去領域15の外周近傍にある少なくとも1つの画素値に所定の変換を適用し、その位置における画素の値をその変換により生成された値に変更する。
【0043】
なお、画素値が変更された画素の全ての領域が、除去領域15の一部であった場合、除去領域変更部12は、その除去領域15の残部を正面顔画像13の頭輪郭内の画素値とは別の値に変更する。これより、髪除去画像16が生成される。
【0044】
なお、本実施の形態では、髪領域選定部11は、除去領域15を出力するとしたが、その除去領域15における画素値の各々を所定の値に変更し、除去領域15を出力するとしてもよい。この場合、除去領域変更部12は、顔表面モデル14の情報を考慮して、正面顔画像13における頭輪郭内にあって、除去領域15の外周近傍にある少なくとも1つの画素値に基づいて、除去領域15の全部又は一部を変更し、髪除去画像16を生成する。
【0045】
以下、本実施の形態における髪領域選定部11と除去領域変更部12の動作について更に詳しく説明する。髪領域選定部11は、色情報から得られる各画素の明度により、頭髪とその頭髪による影との領域を推定する構成のものを用いる。また、髪領域選定部11と除去領域変更部12は、ともにRGBのカラー情報ではなく、それを色相、明度、彩度に変換し、0から255の整数値に正規化した情報を用いる。
【0046】
まず、髪領域選定部11の具体的な動作について説明する。肌と髪の分離は色相によっても行えると考えられる。しかし、ビデオカメラ21により撮影され、A/D変換器22により変換されて生成された正面顔画像13には、色相にノイズがのっているために、正しく肌と髪の分離ができない。また、色相では、頭髪による影と肌とをほとんど分離することができない。除去領域変更部12は、頭髪による影が残っていると、除去領域15の画素値の各々を変更したとき、その変更後の色が暗いものとなって、良い結果が得られない場合がある。
【0047】
そこで、本実施の形態では、色相ではなく明度を用いることによって、頭髪とその頭髪による影との領域を除去領域15とする。即ち、明度が小さい部分を頭髪又はその頭髪による影とする。
【0048】
まず、顔表面モデル14の頭輪郭の内部に対応する正面顔画像13の画素の各々のうち、明度Lが(数1)を満たす画素の明度の平均値Laと最大値Lmを求める。(数1)の条件は明らかに暗い部分の影響を排除するもので、θl0はしきい値である。一例としてθl0=65とする。
【0049】
【数1】

Figure 0003577154
【0050】
LaとLmを用いて、(数2)によりしきい値θl1を求める。
【0051】
【数2】
Figure 0003577154
【0052】
(数2)のα、βはある実数である。一例としてα=1.3、β=0.8とする。また、関数min(a,b)は、aとbのうち大きくない方の値をとる関数である。(数2)で求めたθl1をしきい値として、頭髪又はその頭髪による影の部分を推定する。すなわち、頭輪郭の中にあって、明度Lが(数3)を満たす画素の集合を除去領域15とする。
【0053】
【数3】
Figure 0003577154
【0054】
最後に、眉、目、鼻、口は除去してはならない領域であるから、これらが除去領域15に含まれていれば、それらを除去領域15から取り除く。
【0055】
次に、除去領域変更部12の具体的な動作について説明する。除去領域変更部12の画素値変更の処理は、頭輪郭内の領域に対して、水平走査線毎に下から上へ順に行う。すなわち、直線y=y0で頭輪郭内の領域を切った切口の線分をF=[xs, xe]とすると、この線分Fに対して画素値変更の処理を行う。線分Fの処理が終れば、直線y=y0−1で頭輪郭内の領域を切った切口の線分F1=[xs1, xe1]に対して画素値変更の処理を行う。
【0056】
図5は、除去領域変更部12による画素値変更の動作を説明するための図である。図5において、下側の点線で囲まれた領域51には、目、鼻、口が含まれている。除去領域変更部12は、除去領域15がこの領域51内の画素を含んでいる場合、その除去領域15からその領域51内の画素を取り除く。
【0057】
また、上側の点線で囲まれた領域52内の水平方向の中点の集合である線分53上に位置する画素が、除去領域15に含まれる場合、除去領域変更部12は、その画素の各々に対して、その色相を目の間の適当な画素の色相とし、その明度をLaとし、その彩度を頭輪郭の中にあって明度Lが(数1)を満たす画素の彩度の平均値Saとして、その画素の各々を除去領域15から取り除く。
【0058】
除去領域変更部12は、y=y0における線分F上の画素のうちで、除去領域15に含まれる連続した画素の集合を求め、その集合毎に、x座標の小さい方から順に画素値の変更を行う。そのある1つの集合の両端点のx座標をそれぞれx0、x1とする。
【0059】
この場合、x0=xsかつx1=xeであれば、特別な画素値の変更処理を必要とする。これは、線分F全体の画素値の変更が必要であり、その画素値の変更にその線分F内の画素値を全く用いることができないことを意味する。
【0060】
このように、x0=xsかつx1=xeとなるのは眉より上の領域だけであるから、この場合、y=y0+1で頭輪郭内の領域を切った切口の線分F’=[xs’, xe’]から変更用の画素値を得る。即ち、F、F’の中点をそれぞれxc、xc’とし、線分F上の任意の点Pのx座標をXとすると、(数4)によって線分F’上の点P’(X’, y0+1)を求める。
【0061】
【数4】
Figure 0003577154
【0062】
この点P’の画素の色を点Pの画素の色とする。ただし、点P’が眉領域内の点の場合は、点Pの画素値を変更せずに残しておき、線分F全体に対して、この変更処理を行った後、線形補間によって補間する。
【0063】
一方、x0≠xs又はx1≠xeの場合の処理について説明する。この場合、除去領域変更部12は、画素値の変更に用いる色相を頭輪郭領域の一部から複数個取り出し、それを順次用いる。一例として、眉間から5×5のブロックを取り出して、それを順次マッピングしていく処理がある。また、点(x0, y0)の画素に当てはめる明度をL0、彩度をS0、点(x1, y0)の画素に当てはめる明度をL1、彩度をS1とする。その集合内の点P(X, y0)の画素にマッピングされる明度L、彩度Sを(数5)により求める。
【0064】
【数5】
Figure 0003577154
【0065】
(数5)のfは0≦f≦1の値をとる関数である。
【0066】
本実施の形態では、x0≠xsかつx1≠xe,x0=xsの場合,x1=xeの三つの場合に分けて、L0、S0、L1、S1、fを以下のように決めた。
【0067】
x0≠xsかつx1≠xeの場合、L0とS0は点(x0−1, y0)の画素の値とし、L1とS1は点(x1+1, y0)の画素の値とする。そして、点(x0−1, y0)の画素と点(x1+1, y0)の画素との間にある各画素値を、これらの2つの点の画素値を用いて変更する。即ち、補間は線形補間とする。従って、fは(数6)となる。
【0068】
【数6】
Figure 0003577154
【0069】
x0=xsの場合、L0とS0はy=y0+1における頭輪郭線上の点の画素の値とする。但し、そこが除去領域15内に含まれる場合は、頭輪郭線近傍の肌の明度、彩度の平均値とする。L1とS1は点(x1+1,y0)の画素の値とする。fは(数7)により算出された値を用いる。
【0070】
【数7】
Figure 0003577154
【0071】
図6(a)にこのfの特性図を示す。(数7)においてθxはある実数であり、一例としてθx=0.4とする。
【0072】
x1=xeの場合、L1とS1はy=y0+1における頭輪郭線上の点の画素の値とする。但し、そこが除去領域15に含まれる場合は、頭輪郭線近傍の肌の明度、彩度の平均値とする。L0とS0は点(x0−1,y0)の画素の値とする。fは(数8)により算出された値を用いる。
【0073】
【数8】
Figure 0003577154
【0074】
図6(b)にこのfの特性図を示す。またθxは(数7)における値と同じものである。
【0075】
最後に、画素値を変更した領域とその近傍の明度、彩度の平滑化を行う。平滑化の例として、図7に示す3×3マスクを用いて行うものがある。すなわち、点P(x, y)の画素の明度、彩度をそれぞれL(x, y)、S(x, y)とすると、平滑化を行ったあとの点Pの明度L’(x, y)、S’(x, y)は(数9)により与えられる。
【0076】
【数9】
Figure 0003577154
【0077】
DSPを有するメディア処理ボート搭載の32ビットパーソナルコンピュータを使用した場合、以上の処理を行うのに約3秒を要した。
【0078】
なお、本実施の形態では、ビデオカメラ21によって撮影し、A/D変換器22によって変換した、256×256画素の大きさのディジタル画像に対する処理を行ったが、他の大きさのディジタル画像や、スキャナなどによって入力されたディジタル画像に対しても同様の効果が得られる。また、顔情報モデル14の構成も、図4に示すものに限らず、目、鼻、口、眉、頭輪郭が分かるものであれば同様の効果が得られる。
本実施の形態における画像処理装置について以上に説明したように、前記画像は、前記人の顔画像であり、前記領域選定部は、前記顔画像における人の所定の領域を選定する領域選定部であり、前記領域変更部は、前記構造情報と、前記顔画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部であるとしてもよい。
また、前記領域選定部は、前記顔画像における頭髪及び/又は影部分を前記領域に選定するとしてもよい。
また、前記領域変更部は、更に前記領域における各画素値を、前記構造情報における頭輪郭の内部に対応する前記顔画像の画素値以外の値に変更するとしてもよい。
また、前記領域変更部は、前記領域の一部における各画素値を変更した場合、更にその領域の残部における各画素値を、前記構造情報における頭輪郭の内部に対応する前記顔画像の画素値以外の値に変更するとしてもよい。
さらに、前記領域選定部は、前記構造情報における頭輪郭、目及び眉に基づいて、頭髪及び/又はその頭髪による影とを前記領域に選定するとしてもよい。
また更に、前記領域選定部は、前記顔画像における各画素の明度に基づいて、頭髪及び/又は影部分を前記領域に選定するとしてもよい。
また更に、前記領域選定部は、前記顔画像における各画素の明度と彩度に基づいて、頭髪と影部分とを前記領域に選定するとしてもよい。
【0079】
(実施の形態2)
以下、本発明の第2の実施の形態における画像処理装置について説明する。本実施の形態は、第1の実施の形態に対して髪領域選定部11の動作だけが異なる。その部分について説明する。
【0080】
図8は、本実施の形態における髪領域選定部11の処理の手順を示すフローチャートである。このフローチャートの各ステップの動作について説明する。
【0081】
ステップ81:髪領域選定部11は、正面顔画像13の任意の点の明度をL、しきい値をθl0とし、(数1)を満たす画素の集合を除去領域15とする。一例として、θl0=65とする。
【0082】
ステップ82:髪領域選定部11は、顔表面モデル14から得られる眉の位置より上の頭輪郭内にあって、除去領域15内に含まれていない画素のうち、その色相Hが(数10)の条件を満たす画素の明度の平均値Laと最大値Lmを求める。
【0083】
【数10】
Figure 0003577154
【0084】
(数10)の条件は、肌以外の画素とノイズののった画素の影響を排除するためのもので、θh0、θh1はしきい値ある。一例として、θh0=1、θh1=30とする。
【0085】
ステップ83:髪領域選定部11は、(数2)によって明度のしきい値θl1を求める。α、βはある実数であり、一例として、α=1.15、β=0.8とする。
【0086】
ステップ84:髪領域選定部11は、顔表面モデル14から得られる目の位置より上の頭輪郭内にあって、明度Lが(数3)を満たす画素を、除去領域15に含める。
【0087】
ステップ85:髪領域選定部11は、頭輪郭内にあって、除去領域15に含まれない画素を4連結で領域分割し、その構成画素数がθnより小さい領域を、孤立点として除去領域15に含める。θnはしきい値であり、一例としてθn=10とする。
【0088】
ステップ86:髪領域選定部11は、最後に目、鼻、口、眉は除去してはならない領域であるから、除去領域15からそれらの領域に含まれる画素を取り除く。
【0089】
(実施の形態3)
以下、本発明の第3の実施の形態における画像処理装置について説明する。本実施の形態の構成、正面顔画像13と顔表面モデル14は、第1の実施の形態と同様である。本実施の形態は、第1の実施の形態に対して、髪領域選定部11と除去領域変更部12の動作が異なる。以下その部分を説明する。
【0090】
まず髪領域選定部11の動作について説明する。本実施の形態では、明度と彩度を用いることによって、頭髪とその頭髪による影との領域を除去領域15とする。すなわち、明度が小さい部分、またはある程度明度は大きいが彩度が小さい部分を、頭髪又はその頭髪の影とする。
【0091】
まず、髪領域選定部11は、顔表面モデル14から得られる頭輪郭内の目より下の領域で、明度Lが(数11)を満たし、かつ色相Hが(数12)を満たす画素の、明度の平均値La及び最大値Lmと、彩度の平均値Sa及び最大値Smを求める。
【0092】
【数11】
Figure 0003577154
【0093】
【数12】
Figure 0003577154
【0094】
(数11)の条件は、明らかに暗い部分の影響を排除するものであり、θl0はしきい値である。また、(数12)の条件は、肌以外の画素とノイズののった画素の影響を排除するためのもので、θh0とθh1はしきい値ある。一例として、θl0=65、θh0=1、θh1=30とする。目より下の領域の平均値と最大値をとるのは、額のほとんどが髪に覆われている場合でも処理できるようにするためである。 髪領域選定部11は、La、LmおよびSaを用いて、(数13)によりしきい値θl1、θsを求める。
【0095】
【数13】
Figure 0003577154
【0096】
(数13)のα、β、γはある実数である。一例としてα=1.15、β=0.8、γ=0.8とする。また、min(a,b)はaとbのうち大きくない方の値をとる関数である。
【0097】
髪領域選定部11は、(数13)で求めたθl1、θsを用いて、 頭髪とその頭髪による影との領域を除去領域15とする。
【0098】
髪領域選定部11は、まず、目と眉の間以外の部分では、明度L、彩度Sが(数14)または(数15)を満たす画素の集合を除去領域15とする。
【0099】
【数14】
Figure 0003577154
【0100】
【数15】
Figure 0003577154
【0101】
(数15)のaはある実数であり、一例としてa=1.1とする。
【0102】
次に、髪領域選定部11は、目と眉の間の部分では(数16)を満たす画素の集合を、除去領域15に含める。
【0103】
【数16】
Figure 0003577154
【0104】
(数16)のbはある実数であり、一例としてb=0.85とする。これは、目と眉の間の部分は、額などと比べて若干暗いものであることを考慮したものである。
【0105】
さらに、髪領域選定部11は、頭輪郭内にあって、除去領域15に含まれない画素を、4連結で領域分割する。そして、その構成画素数がθnより小さい領域を、孤立点として、除去領域15に含める。θnはしきい値であり、一例としてθn=10とする。
【0106】
最後に、髪領域選定部11は、目、鼻、口、眉は除去してはならない領域であるから、これらの領域内の画素が除去領域15に含まれていれば、除去領域15から取り除く。
【0107】
次に除去領域変更部12の動作について説明する。
【0108】
除去領域変更部12は、頭輪郭内の各画素に対して、下から上へ順に、水平走査線毎に各画素の変更処理を行う。すなわち、直線y=y0で頭輪郭内の領域を切った切口の線分をF=[xs, xe]とすると、この線分Fに対して各画素値の変更処理を行う。線分Fの処理が終れば、直線y=y0−1で顔領域を切った切口の線分F1=[xs1, xe1]に対して、各画素値の変更処理を行う。
【0109】
図9は、本実施の形態における除去領域変更部12の動作を説明するための図である。図9において、除去領域変更部12は、目、鼻、口を含む点線で囲まれた領域91の領域内の画素が除去領域15に含まれている場合は、その画素を除去領域15から除く。
【0110】
除去領域変更部12は、頭輪郭内の目より上の領域において、除去領域15が占める割合がθrより大きい場合は、額がほとんど髪に覆われているとして、画素値の変更の前に特別な前処理を行う。ここでθrはしきい値であり、一例としてθr=0.9とする。
【0111】
図9において、領域92は、頭輪郭内における眉を含む水平走査線とその上下近傍の水平走査線によって構成される領域である。除去領域変更部12は、その前処理として、その領域92内のすべての線分Fの中点に対して、その中点が除去領域15に含まれているか否かを確認する。除去領域変更部12は、その中点が除去領域15に含まれていれば、その中点にある画素の色相を目の間の適当な点にある画素の色相の値に変更し、またその明度をLa、その彩度をSaに変更して、除去領域15から取り除く。
【0112】
除去領域変更部12は、y=y0における線分Fに対して、除去領域15に含まれる連続した画素の集合を求め、その画素の集合毎に、x座標の小さな順から画素値の変更処理を行う。
【0113】
あるひとつの画素の集合の両端点のx座標を、それぞれx0、x1とする。
【0114】
ここでx0=xsかつx1=xeの場合は特別な処理を要する。これは線分Fの画素値をすべて変更する場合であり、その線分F内の画素値を全く用いることができない。x0=xsかつx1=xeとなるのは、目より上の領域だけであるから、除去領域変更部12は、その線分F内の画素値の変更に、y=y0+1で頭輪郭を切った切口である線分F’=[xs’, xe’]における画素値を用いる。
【0115】
すなわち、除去領域変更部12は、F、F’の中点をそれぞれxc、xc’とし、線分F上の任意の点Pのx座標をXとすると、(数17)によって線分F’上の点P’(X’,y0+1)を求める。
【0116】
【数17】
Figure 0003577154
【0117】
除去領域変更部12は、この点P’の画素の色を点Pの画素の色とする。ただし、点P’が目の領域又は眉領域内の点の場合は、点Pを変更せずに残しておく。そして、線分F全体に対してこの変更処理を行った後、その残した部分を線形補間によって画素値の変更を行う。
【0118】
次に、x0≠xsまたはx1≠xeの場合の処理について説明する。画素値の変更に用いる色相は、頭輪郭内の一部から複数個の画素を取り出し、それを順次用いる。一例として、眉間から5×5の画素ブロックを取り出して、それを順次マッピングすることとする。また、変更後のある画素の明度をL、彩度をSとすると、Sは(数18)により与えられる。
【0119】
【数18】
Figure 0003577154
【0120】
これは、彩度を髪のかかっていない肌の明度と彩度の比率から求めるもので、影などによる影響をなくす効果がある。
【0121】
以下、変更後の各画素の明度Lを求める方法について説明する。点(x0, y0)の画素に当てはめる明度をL0、点(x1, y0)の画素に当てはめる明度をL1とする。その画素集合内の点P(X, y0)の画素に割り付けられる明度Lを(数19)により求める。
【0122】
【数19】
Figure 0003577154
【0123】
(数19)のfは、0≦f≦1の値をとる関数である。そして、Lは、L0、L1、fが第1の実施の形態と同様のものとして算出される。
【0124】
最後に、変更された画素の領域及びその近傍における画素の各々に対する明度と彩度の平滑化は、第1の実施の形態と同様の方法により行われる。
【0125】
(実施の形態4)
以下、本発明の第4の実施の形態における画像処理装置について説明する。本実施の形態は、除去領域変更部12がゆらぎ生成部を具備したもので、第3の実施の形態に対しては除去領域変更部12の動作だけが異なる。
【0126】
除去領域変更部12の動作について説明する。
【0127】
ゆらぎ生成部は、ランダムに発生する数値や、マッピングする画素の位置によって確率的に発生させる数値を用いて、色相、明度、彩度にゆらぎを与えるものである。人の肌の色相、明度、彩度の分布は、もともと平滑なものではなく、ある程度不規則なものであるから、ランダムに発生する数値を用いてゆらぎを与えることにより、よりリアルな結果が得られる。また、位置によって確率的に発生させる数値を用いることにより、しわやしみなどをつけることができる。
【0128】
ゆらぎ生成部の動作について説明する。関数Rは、ある範囲の間の整数値を不規則に発生するものである。一例として、−5以上5以下の整数値を不規則に発生する関数を用いる。また、関数F(x, y)は、マッピングする画素P(x, y)の頭輪郭内の位置から、確率的に数値を発生させるものである。関数Fが発生させる数値の範囲とその確率は、つけるしわやしみによって一意に定まるものである。まず、画素Pにマッピングされる画素値の色相H、明度L、彩度Sを第3の実施の形態と同様に求める。ここから、関数Rと関数Fを用いて、(数20)のようにL’、S’を求める。
【0129】
【数20】
Figure 0003577154
【0130】
ゆらぎ生成部は、このL’とS’を用いて画素Pにマッピングし、除去領域15の変更を行う。
【0131】
なお、本実施の形態では、ランダムな数値を発生させる関数Rを用いたが、肌の色相、明度、彩度の統計的分布が得られれば、それにしたがって数値を発生させて、ゆらぎを与えてもよい。
本実施の形態における画像処理装置について以上に説明したように、前記顔画像における少なくとも1つの画素の色情報に基づいて、前記領域内の各画素値に所定の不規則なゆらぎ成分を付加するゆらぎ生成部を更に備えるとしてもよい。
【0132】
(実施の形態5)
図10は、本発明の第5の実施の形態における画像処理装置のブロック図である。本実施の形態は、図1の実施の形態に対して、顔表面モデル生成部101を具備した点が異なる。顔表面モデル生成部101は、正面顔画像13を用いて、その正面顔画像13の顔の構造情報である顔表面モデル14を生成する。顔表面モデル生成部101における顔表面モデル14の生成については、特開平5−197793号公報、特開平4−199474号公報などの従来の方法を用いる。
本実施の形態における画像処理装置について以上に説明したように、前記顔画像に基づいて、前記構造情報からなる顔表面モデルを生成する顔表面モデル生成部を更に備えるとしてもよい。
【0133】
(実施の形態6)
図11は、本発明の第6の実施の形態における画像処理装置のブロック図である。図11において、頭髪画像調整部111は、顔表面モデル114と顔情報モデル116とに基づいて、頭髪画像115における頭髪が正面顔画像113における顔に適合するように、頭髪画像115とその頭髪画像115に対応する各画素の属性である髪情報117とに所定の変換を適用するものである。顔表面モデル114は、正面顔画像113の顔の構造情報を表す。顔情報モデル116は、頭髪画像115の顔の構造情報を表す。
【0134】
頭髪合成処理部112は、頭髪画像調整部111により変換された髪情報117に従って、頭髪画像調整部111により変換された頭髪画像118における頭髪を正面顔画像113に割り付けるものである。頭髪画像118は、頭髪画像調整部111により変換された頭髪画像115である。顔情報モデル119は、頭髪画像調整部111により変換された顔情報モデル116である。髪情報1110は、頭髪画像調整部111により変換された髪情報117である。頭髪合成画像1111は、正面顔画像113に頭髪画像118の頭髪が割り付けられた画像を表す。
【0135】
正面顔画像113と顔表面モデル114は、第1の実施の形態と同様のものである。頭髪画像115は、正面を向いた顔を撮影したディジタル画像であり、大きさが256×256画素であり、1画素につきRGB各8ビット深さのカラー画像である。頭髪画像115の顔は正面を向いており、その頭の中心線はほぼ垂直である。顔情報モデル116は、顔表面モデル114と同様の構成である。髪情報117は、頭髪画像115を正面顔画像113に割り付ける時、その割付方法を指定する属性を与えるものである。髪情報117は、頭髪画像115と同じ大きさで、1要素が8ビットのビット幅を持つ二次元配列であり、その属性は、髪情報117の各要素に格納されている(図12参照)。図12に示すように、この配列の1要素が頭髪画像115の1画素に対応する。すなわち、髪情報117の配列をA(x, y)とすると、A(x0, y0)が頭髪画像115の点(x0, y0)の画素の属性となる。以下の表1に本実施の形態で用いる属性とその意味を示す。
【0136】
【表1】
Figure 0003577154
【0137】
表1と図12において、121は属性1の領域を表し、122は属性2の領域を表し、123は属性3の領域を表す。
【0138】
次に、本実施の形態の動作について説明する。
【0139】
頭髪画像調整部111は、頭髪画像115の頭髪がマッピングする正面顔画像113の顔に適合するように、頭髪画像115の調整を行う。本実施の形態では、頭髪画像115の調整の一例として、その頭髪画像115における頭輪郭の水平、垂直両方向の大きさと位置を、それぞれ正面顔画像113における頭輪郭の水平、垂直両方向の大きさと位置に一致させる方法を用いる。
【0140】
図13は、頭髪画像調整部111の構成図である。大きさ調整手段131は、頭髪画像115の顔の大きさを、正面顔画像113の顔の大きさと一致するように、頭髪画像115と顔情報モデル116と髪情報117を変換する。頭髪画像133は、大きさ調整手段131により変換された頭髪画像115を表す。顔情報モデル134は、大きさ調整手段131により変換された顔情報モデル116を表す。髪情報135は、大きさ調整手段131により変換された髪情報117を表す。
【0141】
位置調整手段132は、頭髪画像133における頭輪郭の位置と、正面顔画像113における頭輪郭の位置とが一致するように、頭髪画像133と顔情報モデル134と髪情報135を変換する。
【0142】
次に、大きさ調整手段131の処理について具体的に説明する。大きさ調整手段131は、顔表面モデル114から、図14に示すような頭輪郭の大きさdvとdhとを求める。dvは頭輪郭の垂直方向(y軸方向)の最大の高さであり、dhは頭輪郭を目と鼻の頭の中間の点を通る水平線で切った切口の線分の長さである。この線分の長さを頭輪郭の水平方向(x軸方向)の大きさとする。
【0143】
これと同様にして、大きさ調整手段131は、顔情報モデル116から、頭髪画像115における頭輪郭の垂直方向の大きさdv’と水平方向の大きさdh’とを求める。
【0144】
大きさ調整手段131は、それらの大きさの調整を、水平方向と垂直方向、それぞれ独立の倍率でスケーリングすることによって行う。水平方向の倍率をSh、垂直方向の倍率をSvとすると、Sh、Svは(数21)により与えられる。
【0145】
【数21】
Figure 0003577154
【0146】
大きさ調整手段131は、(数21)により算出されたShとSvによって、頭髪画像115を、x軸方向にShでスケーリングし、y軸方向にSvでスケーリングして、頭髪画像133を得る。
【0147】
髪情報117は、頭髪画像115の大きさ合わせと同様の処理によって、髪情報135に変換される。
【0148】
スケーリングの方法としては、最近隣接法などがある。また、大きさ調整手段131は、顔情報モデル116が各特徴点毎にx座標とy座標を持っているため、そのx座標をSh倍、y座標をSv倍することによって大きさの調整を行う。すなわち、顔情報モデル116の任意の頂点P(x, y)は、(数22)によって顔情報モデル134の頂点P’(x’, y’)に変換される。
【0149】
【数22】
Figure 0003577154
【0150】
次に、位置調整手段132の動作について説明する。位置調整は、水平方向と垂直方向の各々に対して、独立の変位量の平行移動となる。水平方向の変位をΔh、垂直方向の変位をΔvとする。ΔhとΔvは、それぞれ以下のように求める。
【0151】
図15は、位置調整手段132の動作を説明するための図である。図15における顔は、正面顔画像113の顔である。点Pnは、鼻の頭の位置で頭輪郭を水平方向に切った切口の線分の中点を表す。点Peは、頭輪郭を水平方向に切った切口の線分のうち、目領域の最上位点にある線分の中点を表す。点Pmは、点Pnと点Peを結ぶ線分の中点を表す。
【0152】
これと同様にして、位置調整手段132は、頭髪画像133に対しても、中点Pn’、中点Pe’、中点Pm’を求める。点Pn’は、鼻の頭の位置で頭輪郭を水平方向に切った切口の線分の中点である。中点Pe’は、頭輪郭を水平方向に切った切口の線分のうち、目領域の最上位点にある線分の中点である。中点Pm’は、点Pn’と点Pe’を結ぶ線分の中点である。
【0153】
そこで、これらの中点をそれぞれPm(xf, yf)、Pm’(xh, yh)とすると、ΔhとΔvは、それぞれ(数23)により与えられる。
【0154】
【数23】
Figure 0003577154
【0155】
頭髪画像133上の任意の点P(x, y)は、(数24)によって、点P’(X, Y)に変換され、頭髪画像118が生成される。
【0156】
【数24】
Figure 0003577154
【0157】
同様に、髪情報135の任意の要素A(x, y)は、A’(X, Y)に変換され、髪情報1110が生成される。また、顔情報モデル134上の任意の頂点Pf(x, y)もPf’(X, Y)に変換され、顔情報モデル119が生成される。
【0158】
なお、顔情報モデル116や顔情報モデル134に対する処理は、顔情報モデル116におけるすべての頂点に対して行っても良いが、例えば特徴点のような、この後の処理に用いる頂点のみに対して行ってもよい。
【0159】
次に頭髪合成処理部112の動作について説明する。頭髪合成処理部112も、第1の実施の形態と同様に、RGBの色情報ではなく、画素値を色相、明度、彩度に変換し、0から255の整数値に正規化したものを用いる。
【0160】
図16は、頭髪合成処理部112の構成図である。図16において、161は合成情報生成部である。162は、髪情報167の属性に従って、正面顔画像113の色相と頭髪画像118の色相とを用いて、色相を生成する色相合成部である。163は、髪情報167の属性に従って、正面顔画像113の明度と頭髪画像118の明度とを用いて、明度を生成する明度合成部である。164は、髪情報167の属性に従って、正面顔画像113の彩度と頭髪画像118の彩度とを用いて、彩度を生成する彩度合成部である。165は、色相合成部162により生成された色相と、明度合成部163により生成された明度と、彩度合成部164により生成された彩度を入力し、これらから色を求めて、正面顔画像113にマッピングし、頭髪合成画像1111を生成するマッピング処理部である。166は、合成情報生成部161によって生成された合成情報である。167は、合成情報生成部161によって修正された髪情報である。
【0161】
合成情報生成部161は、正面顔画像113と頭髪画像118の色情報から、色相合成部162、明度合成部163、彩度合成部164が生成処理する時に用いる合成情報166を生成する。これと同時に、合成情報生成部161は、マッピング先の正面顔画像113の画素の色情報を調べ、髪情報1110を修正して髪情報167を出力する。本実施の形態においては、合成情報166の一例として明度の平均値を用いる。また髪情報1110の修正は、一例として、正面顔画像113の明度の小さい画素に対するマッピングを属性2のマッピングに変更することとした。
【0162】
まず、合成情報生成部161の動作について説明する。合成情報生成部161は、頭髪画像118の頭輪郭内で眉より上の領域の画素のうち、髪情報1110によって与えられる属性が3のものの明度の平均値Lhaを求める。また、合成情報生成部161は、正面顔画像113における頭輪郭内の眉より上の部分の点P(x, y)の明度Lが数(25)を満たす画素を調べる。
【0163】
【数25】
Figure 0003577154
【0164】
(数25)のθlはしきい値であり、その一例としてθl=95とする。この画素は暗い画素で、髪である可能性が高い。そのため、(数25)を満たす画素が頭髪合成画像1111に残らないようにするため、合成情報生成部161は、髪情報1110のA(x, y)を属性2とし、髪情報167を作成する。さらに、合成情報生成部161は、(数25)を満たさない画素の明度の平均値Lfaを求める。
【0165】
色相合成部162、明度合成部163及び彩度合成部164の各々で行われる処理は、髪情報167の画素の属性によって決定される。属性3の画素は、頭髪ではないためマッピングは行われない。属性1の画素は、前髪、生え際、前髪による影の部分の画素であるから、その画素値と、正面顔画像113上のマッピング先の画素値とを合成した値をマッピングする。属性2の画素は、その画素値を正面顔画像113上にそのままマッピングする。
【0166】
色相合成部162の動作について説明する。頭髪画像118の任意の画素Ph(x, y)の色相をHh、髪情報167から得られる画素Phの属性をA(x, y)、画素Phがマッピングされる正面顔画像113の画素Pf(x, y)の色相をHfとすると、色相合成部162は、A(x, y)にしたがって、HfとHhとを用いて(数26)によりHを生成する。
【0167】
【数26】
Figure 0003577154
【0168】
色相合成部162は、属性1の場合、Hf及びHhの中間値をとる。ただし、色相は図17に示すような角度で表されるため、HfとHhは、(数27)により補正されたものが用いられる。
【0169】
【数27】
Figure 0003577154
【0170】
また、Hは、(数28)により補正されたものが用いられる。
【0171】
【数28】
Figure 0003577154
【0172】
明度合成部163の動作について説明する。上記の画素Ph(x, y)の明度をLh、Pf(x, y)の明度をLfとする。明度合成部163は、合成情報166から得られる明度の平均値LfaとLhaを用いて、(数29)によりLhとLfからLを合成する。
【0173】
【数29】
Figure 0003577154
【0174】
明度合成部163は、属性1の場合の合成を平均値との差を用いて行う。
【0175】
彩度合成部164の動作について説明する。上記の画素Ph(x, y)の彩度をSh、Pf(x, y)の彩度をSfとする。SfとShは、(数30)によりSに合成される。
【0176】
【数30】
Figure 0003577154
【0177】
マッピング処理部165は、上記のようにして合成したH,L、SをRGBの色に変換し、正面顔画像113の画素Pfにその色をマッピングする。
【0178】
DSPを持ったメディア処理ボード搭載の32ビットパーソナルコンピュータにより、上記の処理を行った場合の処理時間は約5秒であった。
【0179】
なお、本実施の形態では、正面顔画像113と頭髪画像115は、ともに256×256の大きさのディジタル画像であるとしたが、他の大きさのものでもよい。
【0180】
また、本実施の形態では、顔情報モデルとして顔表面モデルと同じ構成のものを用いたが、目、鼻、眉、頭輪郭が得られるものであれば、他の構造をしたものでもよい。
【0181】
更に、本実施の形態では、マッピング時の合成に、色相と彩度は同じ関数を用いたが、それぞれ独立の関数を用いても良い。
【0182】
また、合成情報としては、他に正面顔画像の色相、彩度の平均値も加え、色相合成部、彩度合成部において、属性1の場合の合成結果にその平均値を用いても良い。
本実施の形態における画像処理装置について以上に説明したように、前記人の画像は、その人の顔画像であり、前記構造情報は、前記人の顔の表面に対する構造情報であり、前記参照画像は、頭髪を有する前記別人の顔の画像である頭髪画像であり、前記別人の構造情報は、前記頭髪画像における前記別人の顔の表面に対する構造情報を示すものであり、前記所定部分は、頭髪又はその頭髪による影である頭髪部分であり、前記属性情報は、前記頭髪画像における各画素の属性をその画素に対応させて保持している髪情報であり、前記画像調整部は、前記髪情報と前記頭髪画像とに前記所定の変換を適用する頭髪画像調整部であり、前記合成処理部は、前記所定の変換が適用された髪情報に従って、前記所定の変換が適用された頭髪画像における頭髪部分を前記顔画像に割り付ける頭髪合成処理部であるとしてもよい。
また、前記画像調整部は、前記人の構造情報における目、鼻、口及び眉の全部又は一部と頭輪郭との情報と、前記別人の構造情報における目、鼻、口及び眉の全部又は一部と頭輪郭との情報とを利用して、前記参照画像と前記参照画像の属性情報とに前記所定の変換を適用するとしてもよい。
また、前記合成処理部は、前記参照画像の属性情報の各画素の属性に従って、その属性の画素に対応する前記参照画像の画素値を用いて、又は前記属性の画素に対応する、前記参照画像の画素値と前記人の顔画像の画素値とを用いて、前記人の顔画像に割り付ける前記頭髪部分の各画素値を生成する生成部と、その生成部により生成された参照画像の所定部分の各画素値を前記人の顔画像に割り付けるマッピング処理部とを備えたとしてもよい。
また、前記画像処理装置は、前記マッピング処理部により参照画像の所定部分が割り付けられた人の顔画像を修正する合成画像修正部を更に備えたとしてもよい。
また更に、前記生成部は、前記属性に従って、その属性の画素に対応する、前記参照画像の画素値又は前記参照画像の画素値及び前記人の顔画像の画素値を用いて、色相を生成する色相合成部と、前記属性に従って、その属性の画素に対応する、前記参照画像の画素値又は前記参照画像の画素値及び前記人の顔画像の画素値を用いて、明度を生成する明度合成部と、前記属性に従って、その属性の画素に対応する、前記参照画像の画素値又は前記参照画像の画素値及び前記人の顔画像の画素値を用いて、彩度を生成する彩度合成部との少なくとも1つを備えたとしてもよい。
【0183】
(実施の形態7)
以下、図18を参照しながら、本発明の第7の実施の形態における画像処理装置について説明する。図18において、181はマッピング結果の画像に、顔領域と髪領域の間にすき間があった場合、そこを補間して修正を施す合成画像修正部を表す。182はこの画像処理装置の出力である頭髪合成画像を表す。髪領域選定部11、除去領域変更部12の処理は、第1の実施の形態または第2の実施の形態または第3の実施の形態または第4の実施の形態記載のものと同様である。また、頭髪画像調整部111の処理は、第6の実施の形態記載のものと同様である。
【0184】
頭髪合成処理部112の動作は、第6の実施の形態記載のものと合成情報生成部の処理が異なる部分があり、以下それを説明する。本実施の形態の画像処理装置では、頭髪合成処理部112において、髪除去画像16に頭髪画像118をマッピングする。髪除去画像16は頭髪およびその頭髪による影の部分を除去したものであるから、髪情報1110の修正の必要はない。よって、本実施の形態では、合成情報生成部161においてこの処理を行わない。また、除去領域15を入力することにより、(数25)のしきい値処理を行わず、除去領域15に含まれない画素の明度の平均値Lfaを求める。
【0185】
合成画像修正部181は、マッピング結果の画像を水平走査線毎に調べ、顔領域と髪領域の間にすき間がある場合、その補間を行う。ただし、この髪領域の端点にマッピングされた頭髪画像118の画素が、頭髪画像118における顔の輪郭上の点、または輪郭内部の点と隣接していない場合は、補間を行わない。頭髪画像118における顔の輪郭は、顔情報モデル119より得られる。補間処理は、補間位置が鼻と口の中間位置より上の場合は最近の顔領域の画素の色で、下の場合は最近の髪領域の画素の色で行う。また、額の上部に髪領域とのすき間ができている場合は、この領域を額の肌の色で補間する。すき間を補間した後、頭髪や影領域と顔領域の継目で平滑化を行う。平滑化の方法は第1の実施の形態などに記載したものと同様である。
【0186】
(実施の形態8)
以下、本発明の第8の実施の形態について説明する。本実施の形態は、入力の正面顔画像から第1の実施の形態または第2の実施の形態または第3の実施の形態または第4の実施の形態記載の画像処理装置によって頭髪とその頭髪による影との領域を除去し、除去した領域を変更した髪除去画像に、あらかじめ用意した頭髪を合成するものである。また、頭髪画像調整部は、顔表面モデルと顔情報モデルより得られる目、鼻、口、眉の位置および頭輪郭との距離、頭輪郭の位置および大きさのすべてまたは一部によって動作し、頭髪合成処理部は、髪除去画像と頭髪画像の合成に用いる情報を生成する合成情報生成部と、髪情報から得られる画素の属性によって指定された方法でテクスチャ情報を合成するテクスチャ情報合成部と、前記テクスチャ情報合成部によって合成された画素値を髪除去画像にマッピングするマッピング処理部と、マッピング後の結果画像に修正を加える合成画像修正部から構成されるものである。さらに、テクスチャ情報合成部は、色相合成部と明度合成部と彩度合成部から構成されるものである。
【0187】
図19は、本実施の形態における画像処理装置のブロック図である。図19において、191は頭髪画像調整部を表し、192は頭髪合成処理部を表し、193は頭髪画像を表し、194は頭髪画像193の顔の構造情報を表す顔情報モデルを表し、195は頭髪画像193の各画素の属性を表す髪情報を表し、196は頭髪画像193が頭髪画像調整部191によって変換された結果の頭髪画像を表し、197は顔情報モデル194が頭髪画像調整部191によって変換された結果の顔情報モデルを表し、198は髪情報195が頭髪画像調整部191によって変換された結果の髪情報を表し、199は髪除去画像16に頭髪画像196の頭髪を合成した結果の頭髪合成画像を表す。
【0188】
入力の正面顔画像13は、第1の実施の形態などと同様に、図2に示すような顔画像取り込み装置によって取り込まれた、大きさ256×256画素で、1画素につきRGB各8ビット深さのカラーのディジタル画像を用いる。顔は正面を向いたもので、頭の中心線はほぼ垂直である。顔表面モデル14も第1の実施の形態などと同様のものである。頭髪画像193は正面を向いた顔を撮影したディジタル画像で、大きさ256×256画素、1画素につきRGB各8ビット深さのカラー画像である。頭髪画像193における顔は正面を向いており、その頭の中心線はほぼ垂直である。顔情報モデル194は顔表面モデル14と同様の構成である。
【0189】
髪情報195は、頭髪画像193の各画素を髪除去画像16と合成する時、合成された画像をより自然なものとするために、その合成方法を指定する属性を与えるものである。髪情報195は頭髪画像193と同じ大きさで、1要素が8ビットのビット幅を持つ二次元配列である。図20に示すように、この配列の1要素が頭髪画像193の1画素に対応する。すなわち、髪情報195の配列をA(x, y)とすると、A(x0, y0)が頭髪画像193の点(x0, y0)の画素の属性となる。
【0190】
次の表2に本実施の形態で用いる属性とその意味を示す。
【0191】
【表2】
Figure 0003577154
【0192】
この表2は、頭髪による影をつけたり、細かな前髪を自然に重ねたりして、合成された画像をよりリアルなものにするために設定されたものである。
【0193】
表2と図20において、201は属性1の領域を表し、202は属性2の領域を表し、203は属性3の領域を表し、204は属性4の領域を表す。
【0194】
頭髪画像調整部191は、頭髪画像193の頭髪がマッピングする髪除去画像16の顔に適合するように、頭髪画像193の調整を行う。本実施の形態では、頭髪画像193の調整の一例として、頭髪画像193における頭輪郭の水平、垂直両方向の大きさと位置を、それぞれ髪除去画像16における頭輪郭の水平、垂直両方向の大きさと位置に一致させる。
【0195】
以下、このような調整を行う頭髪画像調整部191の動作を、図21を参照しながら説明する。図21において、211は頭髪画像193の顔の大きさが髪除去画像16の顔の大きさと一致するように、頭髪画像193と顔情報モデル194と髪情報195を変換する大きさ調整手段を表し、213は大きさ調整手段211によって変換された頭髪画像を表し、214は大きさ調整手段211によって変換された顔情報モデルを表し、215は大きさ調整手段211によって変換された髪情報を表し、212は頭髪画像213の顔の頭髪画像213の中の位置と、髪除去画像16の顔の髪除去画像16の中の位置とが一致するように、頭髪画像213と顔情報モデル214と髪情報215を変換する位置調整手段を表す。
【0196】
大きさ調整手段211の動作について説明する。まず、顔表面モデル14から図22に示すような頭輪郭の大きさdv1、dv2、dhが得られる。dv1は鼻の頭の位置で頭輪郭を水平に切った線分と頭輪郭の最上点の垂直方向(y軸方向)の距離であり、dv2は鼻の頭の位置で頭輪郭を水平に切った線分と頭輪郭の最下点の垂直方向の距離である。dhは頭輪郭を鼻の頭の点を通る水平線で切った切口の線分の長さであり、これを頭輪郭の水平方向(x軸方向)の大きさとする。
【0197】
同様に、顔情報モデル194から、頭髪画像193の顔の頭輪郭の垂直方向の大きさdv1’、dv2’と、水平方向の大きさdh’が得られる。その大きさの調整については、頭髪画像193と髪情報の各々を水平方向と垂直方向に、それぞれ独立の倍率でスケーリングすることによって行う。更に、垂直方向のスケーリングについては、鼻の頭の位置から上と下をそれぞれ独立の倍率でスケーリングする。水平方向の倍率をSh、垂直方向の倍率を鼻の頭より上をSv1、下をSv2とすると、それぞれの倍率は、(数31)により算出される。
【0198】
【数31】
Figure 0003577154
【0199】
大きさ調整手段211は、頭髪画像193をx軸方向にShでスケーリングし、y軸方向にSv1とSv2でスケーリングすることによって頭髪画像213を生成する。この頭髪画像193の大きさ合わせと同様の処理により、髪情報195は髪情報215に変換される。スケーリングの方法には、最近隣接法などの従来の方法を用いることができる。
【0200】
また顔情報モデル194は、各特徴点毎に対応するx座標とy座標を持っているため、(数32)によって顔情報モデル214に変換される。
【0201】
【数32】
Figure 0003577154
【0202】
ここで、鼻の頭の位置のy座標をynとする。
【0203】
次に位置調整手段212の動作について説明する。位置調整は、水平方向と垂直方向の各々に対して、独立の変位量の平行移動となる。水平方向の変位をΔh、垂直方向の変位をΔvとする。Δh、Δvは以下のように求める。
【0204】
図23は、位置調整手段212の動作を説明するための図である。図23における顔は、髪除去画像16の顔である。点Pnは鼻の頭の位置で頭輪郭を水平方向に切った切口の線分の中点を表し、点Peは目領域の最上位点で頭輪郭を水平方向に切った切口の線分の中点を表し、点Pmは点Pnと点Peを結ぶ線分の中点を表す。位置調整手段212は、頭髪画像213に対しても同様に、鼻の頭の位置で頭輪郭を水平方向に切った切口の線分の中点Pn’、目領域の最上位点で頭輪郭を水平方向に切った切口の線分の中点Pe’、点Pn’と点Pe’を結ぶ線分の中点Pm’を求める。 そこで、これらの中点をそれぞれPm(xf, yf)、Pm’(xh, yh)とすると、ΔhとΔvは、それぞれ(数33)により求められる。
【0205】
【数33】
Figure 0003577154
【0206】
頭髪画像213上の任意の点P(x, y)は、(数34)によって点P’(X, Y)に変換され頭髪画像196が生成される。
【0207】
【数34】
Figure 0003577154
【0208】
同様に、髪情報215の任意の要素A(x, y)は、A’(X, Y)に変換され髪情報198が生成される。また顔情報モデル214上の任意の頂点Pf(x, y)もPf’(X, Y)に変換され、顔情報モデル197が生成される。
【0209】
なお、顔情報モデル194や顔情報モデル214に対する処理は、顔情報モデル194におけるすべての頂点に対して行っても良いが、例えば特徴点のような、この後の処理に用いる頂点のみに対して行ってもよい。
【0210】
次に頭髪合成処理部192の動作について説明する。頭髪合成処理部192における処理でも、第1の実施の形態などと同様にRGBの色情報ではなく、画素値を色相、明度、彩度に変換し、0から255の整数値に正規化したものを用いる。
【0211】
図24は、頭髪合成処理部192の構成図である。図24において、241は合成情報生成部である。242は、髪情報198の属性に従って、髪除去画像16の色相と頭髪画像196の色相とを用いて、色相を生成する色相合成部である。243は、髪情報198の属性に従って、髪除去画像16の明度と頭髪画像196の明度とを用いて、明度を生成する明度合成部である。244は、髪情報198の属性に従って、髪除去画像16の彩度と頭髪画像196の彩度とを用いて、彩度を生成する彩度合成部である。245は、色相合成部242により生成された色相と、明度合成部243により生成された明度と、彩度合成部244により生成された彩度とを入力し、それらからRGBの色に変換し、髪除去画像16にマッピングして頭髪合成画像199を生成するマッピング処理部である。246は合成情報生成部241によって生成された合成情報である。247は、マッピング結果の画像において、顔領域と頭髪領域との間にすき間があった場合、そこを補間して修正を施す合成画像修正部である。合成情報生成部241は、髪除去画像16と頭髪画像196の色情報から、色相合成部242、明度合成部243、彩度合成部244が合成処理する時に用いる合成情報246を生成し出力する。本実施の形態では、合成情報246の一例として明度と彩度の平均値を用いる。
【0212】
まず、合成情報生成部241の動作について説明する。合成情報生成部241は、頭髪画像196における頭輪郭内で目より下の領域の画素のうち、髪情報198によって与えられる属性が3または4のものの明度の平均値Lhaと彩度の平均値Shaを求める。また、合成情報生成部241は、第3の実施の形態における明度の平均値Laと彩度の平均値Saを合成情報246として取得する。
【0213】
色相合成部242、明度合成部243又は彩度合成部244で行われる処理は、髪情報198の属性により決定される。属性4の画素は頭髪ではないため、マッピングは行われない。属性1の画素は、前髪や生え際の画素であるから、その画素値と、髪除去画像16上のマッピング先の画素値とを合成した値をマッピングする。属性2の画素は、その画素値を髪除去画像16上にそのままマッピングする。属性3の画素は、頭髪による影であるから、マッピング先の画素の明度と彩度を若干落すことによって処理される。
【0214】
色相合成部242の動作について説明する。頭髪画像196の任意の画素Ph(x, y)の色相をHh、髪情報198から得られる画素Phの属性をA(x, y)、画素Phがマッピングされる髪除去画像16の画素Pf(x, y)の色相をHfとすると、色相合成部242は、A(x, y)にしたがって、HfとHhとを用いて(数35)によりHを生成する。
【0215】
【数35】
Figure 0003577154
【0216】
(数35)の関数mod(a,b)は整数aを整数bで割った剰余を返すもので、属性1の場合では、合成画像の色相は交互に頭髪画像196、髪除去画像16の色相をとることとなる。
【0217】
明度合成部243の動作について説明する。上記の画素Ph(x, y)の明度をLh、Pf(x, y)の明度をLfとする。明度合成部243は、合成情報246から得られる明度の平均値La、Lhaを用いて、(数36)によりLhとLfからLを合成する。
【0218】
【数36】
Figure 0003577154
【0219】
明度合成部243は、属性1の場合の合成を平均値の差を用いて行う。また、明度合成部243は、属性3においては肌の明度を下げる。ここで、σはある実数であり、一例としてLa/Lhとした。また、関数min(a,b)は、実数a,bのうち大きくない方の値をとるものである。
【0220】
彩度合成部244の動作について説明する。上記の画素Ph(x, y)の彩度をSh、Pf(x, y)の彩度をSfとする。彩度合成部244は、合成情報246から得られる彩度の平均値Sa、Shaを用いて、(数37)によりSfとShからSを合成する。
【0221】
【数37】
Figure 0003577154
【0222】
(数37)において、a、b、c、dは、a+b=1、c+d=1を満たすある実数であり、一例としてa=0.3、b=0.7、c=0.4、d=0.6とした。
【0223】
マッピング処理部245は、上記のようにして合成したH,L,SをRGBの色に変換し、髪除去画像16の画素Pfにその色をマッピングする。
【0224】
合成画像修正部247は、マッピング結果の画像を水平走査線毎に調べ、髪領域とその髪領域を含まない顔領域との間にすき間がある場合、その補間を行う。ただし、この髪領域の端点にマッピングされた頭髪画像196の画素が、頭髪画像196における頭輪郭上の点、または頭輪郭内部の点と隣接していない場合は、補間を行わない。
【0225】
頭髪画像196における頭輪郭は、顔情報モデル197より得られる。補間処理は、補間位置が鼻と口の中間位置より上の場合は最近の顔領域の画素の色で、下の場合は最近の髪領域の画素の色で行う。また、額の上部に髪領域とのすき間ができている場合は、この領域を額の肌の色で補間する。すき間を補間した後、頭髪や影領域と顔領域の継目にスムージングをかける。スムージングの方法は第1の実施の形態などに記載したものと同様である。
【0226】
DSPを持ったメディア処理ボード搭載の32ビットパーソナルコンピュータにより、上記の処理を行った場合の処理時間は約8秒であった。
【0227】
なお、本実施の形態では、正面顔画像13と頭髪画像193は、ともに256×256の大きさのディジタル画像であるとしたが、他の大きさのものであるとしてもよい。
【0228】
また、本実施の形態では、顔情報モデルとして顔表面モデルと同じ構成のものを用いたが、目、鼻、眉、頭輪郭が得られるものであれば、他の構造のものを用いてもよい。
【0229】
また、合成情報としては、他に正面顔画像の色相の平均値も加え、色相合成部において属性1の場合の合成結果にその平均値を用いても良い。
【0230】
また、本実施の形態では、明度合成部243は、属性1の場合の合成を平均値の差を用いて行うとしたが、属性1と属性3の合成を平均値の比率によって明度値を求め、マッピングを行うとしてもよい。すなわち、(数36)の代わりに(数38)を用いても良い。
【0231】
【数38】
Figure 0003577154
【0232】
なお、本実施の形態における画像処理装置については、以上に説明したように、人の画像の全部又は一部における各画素値と、その画像における人の構造情報とに基づいて、その画像における所定部分の領域を選定する領域選定部と、前記構造情報と、前記画像における少なくとも1つの画素値とに基づいて、前記所定部分の領域の全部又は一部における画素値の各々を変更する領域変更部と、前記構造情報と、別人の画像である参照画像におけるその別人の構造情報とに基づいて、前記別人の所定部分が前記画像に適合するように、その人の画素に対応させて保持している属性情報に基づいて、前記参照画像における各画素の属性とその参照画像とに所定の変換を適用する画像調整部と、その所定の変換が適用された属性情報に従って、前記所定の変換が適用された参照画像における所定部分を前記画像に割り付ける合成処理部とを備えたことを特徴とする。
また、顔の画像である顔画像の全部または一部における各画素値と、その顔画像における顔の表面に対する構造情報を示す顔表面モデルとに基づいて、その顔画像における頭髪又は頭髪及びその頭髪による影を除去領域に選定する髪領域選定部と、前記顔表面モデルにおける構造情報と、前記顔画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記除去領域の全部又は一部における各画素値を変更する除去領域変更部と、前記顔表面モデルと、頭髪を有する別の顔の画像である頭髪画像におけるその別の顔の表面に対する構造情報を示す顔情報モデルとに基づいて、前記別人の頭髪又はその頭髪及びその頭髪による影である頭髪部分が、前記顔画像に適合するように、前記頭髪画像の画素の各々に対する属性をその画素に対応させて保持している髪情報とその頭髪画像とに所定の変換を適用する頭髪画像調整部と、前記所定の変換が適用された髪情報に従って、前記所定の変換が適用された頭髪画像における頭髪部分を前記顔画像に割り付ける頭髪合成処理部とを備えたことを特徴とする。
(実施の形態9)
以下、図25を参照しながら本発明の第9実施の形態における画像処理装置について説明する。本実施の形態は、顔表面モデル生成部101によって生成された顔表面モデル14を、髪領域選定部11、除去領域変更部12、頭髪画像調整部191、頭髪画像合成部192の入力としたこと以外は、第7の実施の形態または第8の実施の形態記載のものと同様のものである。
本実施の形態における画像処理装置について以上に説明したように、前記人の顔画像に基づいて、前記構造情報からなる顔表面モデルを生成する顔表面モデル生成部を更に備えるとしてもよい。
【0233】
(実施の形態10)
図26は、本発明の第10の実施の形態のブロック図である。本実施の形態は、第8の実施の形態の画像処理装置と画像表示装置から構成される顔画像表示装置に関するものである。図26において、261は頭髪画像データベースを表し、262は頭髪画像選択装置を表し、263は画像表示装置を表す。頭髪画像データベース261は、合成する頭髪画像、顔情報モデル、髪情報を多数保持しており、頭髪画像選択装置262は、頭髪画像データベース261から、ある頭髪画像、顔情報モデル、髪情報を選択して出力する。画像表示装置263は正面顔画像13、髪除去画像16、頭髪合成画像199や頭髪画像データベース262から得られる頭髪画像を複数同時に表示する。顔表面モデル14と顔情報モデル194は同様の構成をしていることから、頭髪画像を入力の正面顔画像13とすることもできる。
【0234】
本実施の形態の顔画像表示装置によって、複数の顔画像を同時に表示し、その頭髪を交換して表示することが可能である。これにより、対象人物の髪形を、別のある人物の髪形を選んで変更し、表示させることが可能となる。また、複数の頭髪画像を表示し、その頭髪を交換することも可能である。このような顔画像表示装置によって、取り替える髪形を、髪形だけが写った画像から選ぶよりも、ある人物の髪形として選ぶ方がよりイメージが描きやすいといった効果がある。
【0235】
上述した実施の形態は、頭髪合成に関するものであるが、同様の方式により鬚、耳、首、装飾品、衣服といったものを顔画像に合成することにも応用できる。以下、それぞれについて説明する。
【0236】
鬚を合成する処理について説明する。この場合、髪情報における属性1又は2を頭髪画像における鬚の領域とする。図27において、dmは水平方向の口の幅を表す。またdnは、口の領域の最上位点を通る水平方向の直線と、鼻の頭を通る水平方向の直線との間の距離である。この距離を口と鼻の距離とする。頭髪画像におけるdmとdnがそれぞれ正面顔画像におけるdmとdnに一致するように、大きさの調整を行う。すなわち、水平方向のスケーリングの倍率Shは、正面顔画像における水平方向の口の幅dmと、頭髪画像における水平方向の口の幅dm’によって、(数39)のように決まる。
【0237】
【数39】
Figure 0003577154
【0238】
また、垂直方向のスケーリングの倍率Svは、正面顔画像における口と鼻の距離dnと、頭髪画像における口と鼻の距離dn’によって(数39)のように決まる。このShとSvを用いて、頭髪画像を水平方向に倍率Shで、垂直方向に倍率Svでスケーリングして、大きさの調整を行う。
【0239】
次に、鬚を合成する場合の位置の調整について説明する。図28において、Pnは、鼻の頭を通る水平方向の直線により頭輪郭を切った切口の線分の中点である。また、Pmは、口の領域の最上位点を通る水平方向の直線により頭輪郭を切った切り口の線分の中点である。Pcは、PnとPmとを結んだ線分の中点であり、位置の調整の基準点となる。位置の調整のために、正面顔画像における基準点Pcと、頭髪画像における基準点Pc’とが、同一画面において同じ位置となるように頭髪画像の平行移動が行われる。これらの基準点をそれぞれPc(xf,yf)とPc’(xh,yh)であるとすれば、水平方向の移動量であるΔhと垂直方向の移動量であるΔvは、それぞれ(数23)により与えられる。このΔhとΔvを(数24)に代入して得られるXとYを頭髪画像の位置とすることにより、位置の調整が行われる。頭髪合成処理部では、上記頭髪を合成する場合と同様の処理を行う。
【0240】
次に、耳を合成する処理について説明する。まず、表2に示した属性の他に耳に対する属性5を追加する。髪情報は、頭髪画像における耳の領域を属性5に設定する。大きさの調整と位置の調整は、上記頭髪を合成する場合と同様の方法で行う。頭髪合成処理部は、上記頭髪合成の場合の(数35)を(数40)に、(数36)を(数41)に、(数37)を(数42)にそれぞれ置き換えて処理する。
【0241】
【数40】
Figure 0003577154
【0242】
【数41】
Figure 0003577154
【0243】
【数42】
Figure 0003577154
【0244】
ここで、(数40)のH0は顔領域の適当な位置における画素の色相である。ここでは、眉間の画素を用いるとする。
【0245】
装飾品を合成する処理を説明する。この場合、頭髪画像の装飾品の領域の属性を2として髪情報を構成する。(数21)の倍率Shを用いて、頭髪画像を(数43)にしたがってスケーリングすることにより、大きさの調整を行う。
【0246】
【数43】
Figure 0003577154
【0247】
倍率には、Sh以外に、(数21)のSv又は(数31)のSv1若しくはSv2を用いてもよい。
【0248】
頭髪合成処理部は、上記頭髪の合成の場合と同様の処理を行う。
【0249】
次に、首と衣服の合成について説明する。但し、衣服は首に付随したものとして処理する。この場合、髪情報における属性5を頭髪画像における首の肌が見えている領域とする。また、属性2を衣服の部分の領域とする。大きさの調整と位置の調整は、上記頭髪を合成する場合と同様の処理を行う。頭髪合成処理部は、耳を合成する場合と同様の処理を行う。
本実施の形態における画像処理装置について以上に説明したように、前記合成処理部により参照画像の所定部分が割り付けられた顔画像を複数表示する画像表示部を更に備えるとしてもよい。
【0250】
【発明の効果】
以上のように、本発明によれば、自動的に、違和感の少ない頭髪合成画像を生成することができる。
【0251】
また、本発明によれば、DSPを持ったメディア処理ボード搭載の32ビットパーソナルコンピュータを用いれば、撮影から頭髪合成終了までを実用時間の十数秒で処理することができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態における画像処理装置のブロック図である。
【図2】正面顔画像13を取り込む顔画像取り込み装置の一例を示す図である。
【図3】図2に示す顔画像取り込み装置により取り込まれた正面顔画像13の一例を示す図である。
【図4】顔表面モデル14の一例を示すワイヤーフレームモデルの図である。
【図5】除去領域変更部12による画素値変更の動作を説明するための図である。
【図6】(a)は(数7)におけるfの特性図であり、(b)は(数8)におけるfの特性図である。
【図7】平滑化に用いるマスクの構成図である。
【図8】第2の実施の形態における髪領域選定部11の処理の手順を示すフローチャートである。
【図9】第3の実施の形態における除去領域変更部12の動作を説明するための図である。
【図10】本発明の第5の実施の形態における画像処理装置のブロック図である。
【図11】本発明の第6の実施の形態における画像処理装置のブロック図である。
【図12】第6の実施の形態における頭髪画像と髪情報との対応図である。
【図13】頭髪画像調整部111の構成図である。
【図14】第6の実施の形態における大きさ調整手段の動作の説明図である。
【図15】位置調整手段132の動作を説明するための図である。
【図16】頭髪合成処理部112の構成図である。
【図17】色相の説明図である。
【図18】本発明の第7の実施の形態における画像処理装置のブロック図である。
【図19】第8の実施の形態における画像処理装置のブロック図である。
【図20】第8の実施の形態における頭髪画像と髪情報との対応図である。
【図21】頭髪画像調整部191の構成図である。
【図22】第8の実施の形態における大きさ調整手段の動作の説明図である。
【図23】第8の実施の形態における位置調整手段の動作の説明図である。
【図24】頭髪合成処理部192の構成図である。
【図25】本発明の第9実施の形態における画像処理装置のブロック図である。
【図26】本発明の第10の実施の形態のブロック図である。
【図27】鬚を合成する場合における大きさ調整手段の動作の説明図である。
【図28】鬚を合成する場合における位置調整手段の動作の説明図である。
【符号の説明】
11…髪領域選定部
12…除去領域変更部
13…正面顔画像
14…顔表面モデル
15…除去領域
16…髪除去画像
101…顔表面モデル生成部
111…頭髪画像調整部
112…頭髪合成処理部
131…大きさ調整手段
132…位置調整手段
161…合成情報手段
162…色相合成部
163…明度合成部
164…彩度合成部
165…マッピング処理部
181…合成画像修正部
191…頭髪画像調整部
192…頭髪合成処理部
211…大きさ調整手段
212…位置調整手段
241…合成情報生成部
242…色相合成部
243…明度合成部
244…彩度合成部
245…マッピング処理部
247…合成画像修正部
262…頭髪画像選択装置
263…画像表示装置[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing apparatus capable of automatically replacing a hairstyle with another one in a practical time without any discomfort in computer graphics of a person and displaying the same.
[0002]
[Prior art]
Conventionally, in an image processing for assigning another hair to an image of a certain person, when an image in which the hair is removed from the image of the person is generated as a pre-process of the image processing, the image is obtained by photographing by tying the hair. An image in which the hair has been removed has been obtained by capturing an image in which the hair does not cover the face, or by manually removing the hair region of the image of the person.
[0003]
When another hair is assigned to the obtained image from which the hair has been removed, another hair is manually pasted to the image from which the hair has been removed.
[0004]
[Problems to be solved by the invention]
However, in such a conventional method, even when the hair is tied and photographed, the hair may not be completely removed and may remain, so that the original hair is added to the image obtained by the image processing for allocating another hair. There was a problem that it would remain.
[0005]
In addition, there is a problem that when removing hair by hand, a considerable amount of time must be spent.
[0006]
Furthermore, the image obtained by the conventional image processing of simply pasting another hair to the image from which the hair has been removed has a considerable sense of incongruity.
[0007]
The present invention provides an image processing apparatus that removes hair from a frontal image of a face, estimates the shape of the head of the part from which the hair has been removed, and fills the estimated area of the head with the skin color of the face. The purpose is to provide.
[0008]
Further, the present invention provides an image processing apparatus that performs image processing with less discomfort by adjusting another hair so as to conform to the front image of the face, and further using color information in the head contour. Aim.
[0009]
[Means for Solving the Problems]
To solve this problem, the present inventionfaceEach pixel value in all or part of the image and itsfaceBased on the human structural information in the imagefaceAn area selection unit for selecting an area of a predetermined portion in an image, the structure information,faceAn area changing unit that changes each pixel value in all or a part of the area based on color information obtained from at least one pixel value in the image.The area selecting unit selects a hair and / or a shadow of the hair in the area based on a head contour, eyes, and eyebrows in the structure information.An image processing apparatus characterized in that:
In addition, the present invention, an area selection unit that selects a predetermined area of the face image based on each pixel value in all or a part of the face image of the person and the structural information of the person in the face image, An area changing unit that changes each pixel value in all or a part of the area based on the structure information and color information obtained from at least one pixel value in the face image; An image processing apparatus comprising: a fluctuation generating unit that adds a predetermined irregular fluctuation component to each pixel value in the area based on color information of a pixel.
In addition, the present invention, an area selection unit that selects a predetermined area of the face image based on each pixel value in all or a part of the face image of the person and the structural information of the person in the face image, An area changing unit that changes each pixel value in all or a part of the area based on the structure information and color information obtained from at least one pixel value in the face image, wherein the area selecting unit includes: An image processing apparatus for selecting a hair and a shadow portion in the face image as the region.
Further, the present invention provides an area selecting unit for selecting an area of a predetermined portion in an image of a person based on each pixel value in all or a part of the image of the person and structural information of the person in the image, And an area change that changes each pixel value in all or a part of the area based on color information obtained from at least one pixel value in the image near the outer periphery of the area selected by the area selecting unit. And an image processing apparatus.
[0019]
Also,The present inventionPictureIn the statueStructureConstruction informationWhen, AnotherManofPictureIn the reference imageStructureConstruction informationWhenBased on said anotherImages of peopleIs a predetermined portion ofperson'sSaid reference image to fit the imageToAn image adjustment unit that applies a predetermined conversion;PreviousThe predetermined portion of the reference image to which the predetermined conversion has been applied is described above.person'sAn image processing apparatus comprising: a synthesis processing unit for allocating to an image.
[0029]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0030]
FIG. 1 is a block diagram of the image processing apparatus according to the first embodiment of the present invention. 1, the image processing apparatus according to the present embodiment includes a hair region selecting unit 11 and a removal region changing unit 12. The hair region selecting unit 11 includes a front face image 13 (see FIG. 3), which is a front image above the neck, and a face surface model 14 (see FIG. 4) representing structural information of each part above the face with respect to the front face image 13. The region of the head hair and the shadow of the hair (not shown in FIG. 3) in the front face image 13 is used as the removal region 15 and the removal region 15 is transmitted. However, in the face surface model 14 shown in FIG. 4, the ears have been removed.
[0031]
The removal area change unit 12 considers the information of the face surface model 14 and, based on the pixel values of the face in the front face image 13, removes all or some of the pixel values of the removal area 15 in the front face image 13. That is, the hair removal image 16 is generated. Note that, when changing each pixel value of a part of the removal area 15, the removal area changing unit 12 uses a different value from the pixel value of the face in the front face image 13 to change the remaining pixels of the removal area 15. Change each of the values.
[0032]
FIG. 2 is a diagram illustrating an example of a face image capturing device that captures the front face image 13. The front face image 13 is a digital image captured by the face image capturing device shown in FIG. In FIG. 2, reference numeral 21 denotes a video camera for photographing. Reference numeral 22 denotes an A / D converter for converting an image of the video camera 21 into a digital signal. Reference numeral 23 denotes a device for fixing the video camera 21. Reference numeral 24 denotes a target person photographed by the video camera 21.
[0033]
The video camera 21 is fixed horizontally by a device 23. The A / D converter 22 converts an analog image captured by the video camera 21 into a digital image, and generates the front face image 13. The front face image 13 has a size of 256 × 256 pixels, and is a color image having a depth of 8 bits for each of RGB for each pixel. The background color of the front face image 13 is a single color.
[0034]
FIG. 3 is a diagram illustrating an example of the front face image 13 captured by the face image capturing device illustrated in FIG. In the frontal face image 13 in FIG. 3, the face in which the entire upper part is taken from the neck faces front. His face is expressionless, without glasses and beards, and his head centerline is almost vertical. Also, the bangs do not cover the entire forehead. The xy coordinates are introduced into the front face image 13.
[0035]
FIG. 4 is a diagram of a wire frame model showing an example of the face surface model 14. Each vertex of the wireframe is a feature point that represents the contour of the face, eyes, nose, mouth, and eyebrows, and points obtained by considering the three-dimensional structure of the face that is placed between those feature points. Consists of The feature points in FIG. 4 are vertices with circles.
[0036]
Each vertex has x-coordinate and y-coordinate data on the image of the vertex. Each vertex is given a predetermined number, and the position of the vertex on the image is specified by the number. The face surface model 14 is composed of these vertices and their connection information.
[0037]
The face surface model 14 is generated by recognizing the face in the front face image 13 in FIG. That is, it is generated by recognizing a face in the front face image 13 and moving each vertex of a standard wire frame model prepared in advance in accordance with the recognized face.
[0038]
Therefore, the shape of the frame of the face surface model 14 varies from person to person, but is topologically the same. For the processing of generating the face surface model 14, a conventional method described in JP-A-5-197793 and JP-A-4-199474 can be used.
[0039]
The processing of JP-A-5-197793 and JP-A-4-199474 is as follows. First, the iris is recognized from the input frontal face image by template matching, and based on the recognition, the eye region is recognized by template matching. Next, based on the recognized position of the iris, a search range is set for each of the contours of the nose, mouth, eyebrows, cheeks, and head vertex. In each search range, the contours of the nose, mouth, eyebrows, cheeks, and the top of the head are recognized by template matching. A fixed feature point is obtained in each of the regions of the eyes, nose, mouth, eyebrows, cheek outline, and head vertex recognized in this manner. Then, the feature points of the eyes, nose, mouth, eyebrows, cheek contours, and head vertices of the wireframe model of the standard face prepared in advance are matched with the feature points obtained as a result of recognition. Is performed to obtain a wireframe model representing the surface structure of the face of the input face image. In the present embodiment, the wire frame model generated in this manner is used as a face surface model of the input face image.
[0040]
Next, the operation of the present embodiment will be described.
[0041]
The hair area selection unit 11 receives the front face image 13 and the face surface model 14 and outputs the area of the head hair and the shadow of the head hair in the front face image 13 as the removal area 15.
[0042]
The removal area changing unit 12 inputs the front face image 13, the face surface model 14, and the removal area 15. The removal area change unit 12 changes the pixel value of the front face image 13 that is within the outermost contour of the face surface model 14 (hereinafter, referred to as a head contour) and that is within the removal area 15. To change the pixel value, at least one pixel value near the outer periphery of the removal area 15 is used. The removal area changing unit 12 applies a predetermined conversion to at least one pixel value near the outer periphery of the removal area 15 for each pixel whose pixel value is to be changed, according to the position of the pixel. , Change the value of the pixel at that position to the value generated by the conversion.
[0043]
If all the areas of the pixels whose pixel values have been changed are part of the removal area 15, the removal area change unit 12 replaces the remaining area of the removal area 15 with the pixels within the head contour of the front face image 13. Change it to a different value. Thus, the hair removal image 16 is generated.
[0044]
Note that, in the present embodiment, the hair region selecting unit 11 outputs the removal region 15, but each of the pixel values in the removal region 15 may be changed to a predetermined value, and the removal region 15 may be output. . In this case, the removal area changing unit 12 considers the information of the face surface model 14 and, based on at least one pixel value in the head contour of the front face image 13 and near the outer periphery of the removal area 15, The hair removal image 16 is generated by changing all or a part of the removal area 15.
[0045]
Hereinafter, the operations of the hair region selecting unit 11 and the removal region changing unit 12 in the present embodiment will be described in more detail. The hair area selecting unit 11 has a configuration that estimates the area of the hair and the shadow of the hair based on the brightness of each pixel obtained from the color information. In addition, the hair region selecting unit 11 and the removal region changing unit 12 use information that is not RGB color information but is converted into hue, lightness, and saturation, and is normalized to an integer value from 0 to 255.
[0046]
First, a specific operation of the hair region selecting unit 11 will be described. It is considered that skin and hair can be separated also by hue. However, the frontal face image 13 captured by the video camera 21 and converted by the A / D converter 22 has noise in the hue, so that the skin and hair cannot be correctly separated. Further, in the hue, the shadow of the hair and the skin can hardly be separated. If the shadow of the hair remains, the removal area changing unit 12 may change the pixel value of the removal area 15 to a dark color after the change, and may not obtain a good result. .
[0047]
Therefore, in the present embodiment, the area of the hair and the shadow of the hair is used as the removal area 15 by using the lightness instead of the hue. That is, a portion having a small brightness is defined as the hair or a shadow of the hair.
[0048]
First, among the pixels of the front face image 13 corresponding to the inside of the head contour of the face surface model 14, the average value La and the maximum value Lm of the brightness of the pixels whose brightness L satisfies (Equation 1) are obtained. The condition of (Equation 1) clearly eliminates the influence of the dark portion, and θ10 is a threshold value. As an example, it is assumed that θ10 = 65.
[0049]
(Equation 1)
Figure 0003577154
[0050]
Using La and Lm, a threshold value θ11 is obtained by (Equation 2).
[0051]
(Equation 2)
Figure 0003577154
[0052]
Α and β in (Equation 2) are certain real numbers. As an example, α = 1.3 and β = 0.8. The function min (a, b) is a function that takes the smaller value of a and b. The head hair or a shadow part of the head hair is estimated using θ11 obtained by (Equation 2) as a threshold value. That is, a set of pixels in the head contour whose lightness L satisfies (Equation 3) is set as the removal area 15.
[0053]
(Equation 3)
Figure 0003577154
[0054]
Lastly, since the eyebrows, eyes, nose, and mouth are areas that should not be removed, if they are included in the removal area 15, they are removed from the removal area 15.
[0055]
Next, a specific operation of the removal area changing unit 12 will be described. The pixel value changing process of the removal area changing unit 12 is performed in order from the bottom to the top for each horizontal scanning line for the area within the head contour. That is, assuming that a line segment of a cut line obtained by cutting a region within the head contour with a straight line y = y0 is F = [xs, xe], a process of changing a pixel value is performed on the line segment F. When the processing of the line segment F is completed, the pixel value change processing is performed on the line segment F1 = [xs1, xe1] of the cut line obtained by cutting the area within the head contour with the straight line y = y0-1.
[0056]
FIG. 5 is a diagram for explaining an operation of changing a pixel value by the removal area changing unit 12. In FIG. 5, an eye 51, a nose, and a mouth are included in an area 51 surrounded by a lower dotted line. When the removal area 15 includes the pixels in the area 51, the removal area changing unit 12 removes the pixels in the area 51 from the removal area 15.
[0057]
When a pixel located on a line segment 53 that is a set of middle points in the horizontal direction in a region 52 surrounded by an upper dotted line is included in the removal region 15, the removal region changing unit 12 For each, the hue is the hue of an appropriate pixel between the eyes, the lightness is La, and the saturation is the saturation of the pixel in the head contour and the lightness L of which satisfies (Equation 1). Each of the pixels is removed from the removal area 15 as the average value Sa.
[0058]
The removal area changing unit 12 obtains a set of continuous pixels included in the removal area 15 among the pixels on the line segment F at y = y0, and for each of the sets, the pixel value of the x coordinate is sequentially reduced in ascending order. Make changes. The x-coordinates of both end points of the one set are x0 and x1, respectively.
[0059]
In this case, if x0 = xs and x1 = xe, a special pixel value change process is required. This means that the pixel value of the entire line segment F needs to be changed, and the pixel value in the line segment F cannot be used for changing the pixel value at all.
[0060]
As described above, since x0 = xs and x1 = xe are only in the region above the eyebrows, in this case, the line segment F '= [xs' of the cut in which the region within the head contour is cut at y = y0 + 1 , Xe ′]]. That is, assuming that the middle points of F and F 'are xc and xc', respectively, and that the x coordinate of an arbitrary point P on the line segment F is X, the point P '(X ', Y0 + 1).
[0061]
(Equation 4)
Figure 0003577154
[0062]
The color of the pixel at point P ′ is set as the color of the pixel at point P. However, when the point P ′ is a point in the eyebrow area, the pixel value of the point P is left unchanged, and after performing this change processing on the entire line segment F, interpolation is performed by linear interpolation. .
[0063]
On the other hand, processing in the case of x0 ≠ xs or x1 ≠ xe will be described. In this case, the removal area changing unit 12 extracts a plurality of hues to be used for changing the pixel value from a part of the head contour area, and sequentially uses them. As an example, there is a process of extracting 5 × 5 blocks from the space between the eyebrows and sequentially mapping them. Further, the lightness applied to the pixel at the point (x0, y0) is L0, the saturation is S0, the lightness applied to the pixel at the point (x1, y0) is L1, and the saturation is S1. The lightness L and the saturation S mapped to the pixel at the point P (X, y0) in the set are obtained by (Equation 5).
[0064]
(Equation 5)
Figure 0003577154
[0065]
F in (Equation 5) is a function that takes a value of 0 ≦ f ≦ 1.
[0066]
In this embodiment, L0, S0, L1, S1, and f are determined as follows in three cases where x0 ≠ xs and x1 ≠ xe, x0 = xs, and x1 = xe.
[0067]
If x0 ≠ xs and x1 ≠ xe, L0 and S0 are the values of the pixel at point (x0-1, y0), and L1 and S1 are the values of the pixel at point (x1 + 1, y0). Then, each pixel value between the pixel at the point (x0-1, y0) and the pixel at the point (x1 + 1, y0) is changed using the pixel values at these two points. That is, the interpolation is linear interpolation. Therefore, f becomes (Equation 6).
[0068]
(Equation 6)
Figure 0003577154
[0069]
If x0 = xs, L0 and S0 are the values of the pixel at the point on the head contour at y = y0 + 1. However, if it is included in the removal area 15, the average value of the brightness and the saturation of the skin near the head contour is used. L1 and S1 are the values of the pixel at the point (x1 + 1, y0). f uses a value calculated by (Equation 7).
[0070]
(Equation 7)
Figure 0003577154
[0071]
FIG. 6A shows a characteristic diagram of f. In Expression 7, θx is a certain real number, and as an example, θx = 0.4.
[0072]
When x1 = xe, L1 and S1 are the values of the pixel at the point on the head contour at y = y0 + 1. However, when that area is included in the removal area 15, the average value of the brightness and the saturation of the skin near the head contour is used. L0 and S0 are pixel values at the point (x0-1, y0). f uses a value calculated by (Equation 8).
[0073]
(Equation 8)
Figure 0003577154
[0074]
FIG. 6B shows a characteristic diagram of f. Θx is the same as the value in (Equation 7).
[0075]
Finally, the brightness and the saturation of the area where the pixel value is changed and its vicinity are smoothed. As an example of the smoothing, there is a method using a 3 × 3 mask shown in FIG. That is, assuming that the brightness and saturation of the pixel at point P (x, y) are L (x, y) and S (x, y), respectively, the brightness L '(x, y) of point P after smoothing is performed. y), S ′ (x, y) are given by (Equation 9).
[0076]
(Equation 9)
Figure 0003577154
[0077]
When a 32-bit personal computer equipped with a media processing boat having a DSP was used, it took about 3 seconds to perform the above processing.
[0078]
In the present embodiment, processing is performed on a digital image having a size of 256 × 256 pixels, which is photographed by the video camera 21 and converted by the A / D converter 22. The same effect can be obtained for a digital image input by a scanner or the like. Further, the configuration of the face information model 14 is not limited to the configuration shown in FIG. 4, and similar effects can be obtained as long as the eyes, nose, mouth, eyebrows, and head contour can be understood.
As described above for the image processing apparatus according to the present embodiment, the image is the face image of the person, and the area selection unit is an area selection unit that selects a predetermined area of the person in the face image. The area change unit includes an area change unit that changes each pixel value in all or a part of the area based on the structure information and color information obtained from at least one pixel value in the face image. There may be.
The area selecting unit may select a hair and / or a shadow part in the face image as the area.
Further, the area change unit may further change each pixel value in the area to a value other than the pixel value of the face image corresponding to the inside of the head contour in the structure information.
Further, when the area changing unit changes each pixel value in a part of the area, the area changing unit further converts each pixel value in the rest of the area into a pixel value of the face image corresponding to the inside of a head contour in the structure information. It may be changed to a value other than.
Further, the region selecting unit may select a hair and / or a shadow of the hair in the region based on a head contour, eyes, and eyebrows in the structure information.
Furthermore, the area selection unit may select a hair and / or a shadow part as the area based on the brightness of each pixel in the face image.
Furthermore, the area selection unit may select a hair and a shadow part as the area based on the brightness and the saturation of each pixel in the face image.
[0079]
(Embodiment 2)
Hereinafter, an image processing apparatus according to the second embodiment of the present invention will be described. This embodiment differs from the first embodiment only in the operation of the hair region selecting unit 11. The part will be described.
[0080]
FIG. 8 is a flowchart showing a procedure of the process of the hair region selecting unit 11 in the present embodiment. The operation of each step in this flowchart will be described.
[0081]
Step 81: The hair region selecting unit 11 sets the brightness of an arbitrary point of the front face image 13 to L, sets the threshold to θ10, and sets a set of pixels satisfying (Equation 1) to the removal region 15. As an example, it is assumed that θ10 = 65.
[0082]
Step 82: The hair region selecting section 11 sets the hue H of the pixel within the head contour above the position of the eyebrows obtained from the face surface model 14 and not included in the removal region 15 to (Equation 10). The average value La and the maximum value Lm of the brightness of the pixels satisfying the condition of ()) are obtained.
[0083]
(Equation 10)
Figure 0003577154
[0084]
The condition of (Equation 10) is to eliminate the influence of pixels other than skin and pixels with noise, and θh0 and θh1 are threshold values. As an example, it is assumed that θh0 = 1 and θh1 = 30.
[0085]
Step 83: The hair region selecting section 11 obtains the lightness threshold value θ11 from (Equation 2). α and β are certain real numbers. For example, α = 1.15 and β = 0.8.
[0086]
Step 84: The hair region selecting section 11 includes, in the removal region 15, a pixel which is within the head contour above the position of the eye obtained from the face surface model 14 and whose lightness L satisfies (Equation 3).
[0087]
Step 85: The hair region selecting unit 11 divides the pixels within the head contour that are not included in the removal region 15 into four regions by connecting them, and sets the region whose number of constituent pixels is smaller than θn as an isolated point as the isolated region 15. Include in. θn is a threshold value, for example, θn = 10.
[0088]
Step 86: The hair region selecting section 11 finally removes the pixels included in the removal region 15 from the removal region 15 because the eyes, nose, mouth, and eyebrows are regions that should not be removed.
[0089]
(Embodiment 3)
Hereinafter, an image processing apparatus according to the third embodiment of the present invention will be described. The configuration of the present embodiment, the front face image 13 and the face surface model 14 are the same as those of the first embodiment. This embodiment is different from the first embodiment in the operations of the hair region selecting unit 11 and the removal region changing unit 12. Hereinafter, that portion will be described.
[0090]
First, the operation of the hair region selecting unit 11 will be described. In the present embodiment, the area of the hair and the shadow of the hair is used as the removal area 15 by using the brightness and the saturation. That is, a portion having a small brightness or a portion having a relatively high brightness but a low saturation is defined as the hair or the shadow of the hair.
[0091]
First, the hair region selecting unit 11 determines, for a region below the eyes in the head contour obtained from the face surface model 14, a pixel whose lightness L satisfies (Equation 11) and whose hue H satisfies (Equation 12). The average value La and the maximum value Lm of the lightness and the average value Sa and the maximum value Sm of the saturation are obtained.
[0092]
(Equation 11)
Figure 0003577154
[0093]
(Equation 12)
Figure 0003577154
[0094]
The condition of (Equation 11) is to eliminate the influence of a clearly dark portion, and θ10 is a threshold value. The condition of (Equation 12) is for eliminating the influence of pixels other than the skin and pixels with noise, and θh0 and θh1 are threshold values. As an example, it is assumed that θ10 = 65, θh0 = 1, and θh1 = 30. The reason for taking the average value and the maximum value in the area below the eyes is to enable processing even when most of the forehead is covered with hair. The hair region selecting unit 11 uses La, Lm, and Sa to determine the threshold values θ11 and θs according to (Equation 13).
[0095]
(Equation 13)
Figure 0003577154
[0096]
Α, β, and γ in (Equation 13) are certain real numbers. As an example, it is assumed that α = 1.15, β = 0.8, and γ = 0.8. Further, min (a, b) is a function that takes a smaller value of a and b.
[0097]
The hair region selecting unit 11 uses the θ11 and θs obtained by (Equation 13) to set the region of the hair and the shadow of the hair as the removal region 15.
[0098]
First, the hair region selecting unit 11 sets a set of pixels whose brightness L and saturation S satisfy (Equation 14) or (Equation 15) in a portion other than between the eyes and eyebrows as the removal region 15.
[0099]
[Equation 14]
Figure 0003577154
[0100]
(Equation 15)
Figure 0003577154
[0101]
A in (Equation 15) is a certain real number, and as an example, a = 1.1.
[0102]
Next, the hair region selecting unit 11 includes, in the removal region 15, a set of pixels that satisfies (Equation 16) in the portion between the eyes and eyebrows.
[0103]
(Equation 16)
Figure 0003577154
[0104]
B in (Equation 16) is a certain real number, and it is assumed that b = 0.85 as an example. This takes into account that the portion between the eyes and eyebrows is slightly darker than the forehead or the like.
[0105]
Further, the hair region selecting unit 11 divides pixels that are within the head outline and are not included in the removal region 15 by four-connection. Then, an area in which the number of constituent pixels is smaller than θn is included in the removal area 15 as an isolated point. θn is a threshold value, for example, θn = 10.
[0106]
Finally, the hair region selecting unit 11 removes the eyes, nose, mouth, and eyebrows from the removal region 15 if the pixels in these regions are included in the removal region 15 because they are regions that must not be removed. .
[0107]
Next, the operation of the removal area changing unit 12 will be described.
[0108]
The removal area changing unit 12 performs a changing process for each pixel in the head contour in order from the bottom to the top for each horizontal scanning line. That is, assuming that a line segment of a cut line obtained by cutting a region in the head contour with a straight line y = y0 is F = [xs, xe], a process of changing each pixel value is performed on the line segment F. When the processing of the line segment F is completed, a process of changing each pixel value is performed on the line segment F1 = [xs1, xe1] of the cut face obtained by cutting the face area with the straight line y = y0-1.
[0109]
FIG. 9 is a diagram for explaining the operation of the removal area changing unit 12 in the present embodiment. In FIG. 9, when a pixel in a region 91 surrounded by a dotted line including eyes, a nose, and a mouth is included in the removal region 15, the removal region changing unit 12 removes the pixel from the removal region 15. .
[0110]
The removal area changing unit 12 determines that the forehead is almost covered with the hair when the removal area 15 occupies more than θr in the area above the eyes in the head contour, and specially changes the pixel value before changing the pixel value. Perform preprocessing. Here, θr is a threshold value, and as an example, θr = 0.9.
[0111]
In FIG. 9, an area 92 is an area configured by a horizontal scanning line including an eyebrow in the head contour and horizontal scanning lines near the upper and lower sides thereof. As the preprocessing, the removal area changing unit 12 confirms whether or not the middle point is included in the removal area 15 with respect to the middle points of all the line segments F in the area 92. If the middle point is included in the removed area 15, the removal area changing unit 12 changes the hue of the pixel at the middle point to the value of the hue of the pixel at an appropriate point between the eyes. The lightness is changed to La and the saturation is changed to Sa, and the lightness is removed from the removal area 15.
[0112]
The removal area changing unit 12 obtains a set of continuous pixels included in the removal area 15 for the line segment F at y = y0, and for each set of pixels, changes pixel values in ascending order of x-coordinate. I do.
[0113]
The x-coordinates of both end points of a certain set of pixels are x0 and x1, respectively.
[0114]
Here, when x0 = xs and x1 = xe, special processing is required. This is a case where all the pixel values of the line segment F are changed, and the pixel values in the line segment F cannot be used at all. Since x0 = xs and x1 = xe are only in the area above the eyes, the removal area changing unit 12 cuts the head contour at y = y0 + 1 to change the pixel value in the line segment F. The pixel value in the line segment F ′ = [xs ′, xe ′] which is the cut is used.
[0115]
That is, the removal area changing unit 12 sets the middle point of F and F ′ to xc and xc ′, respectively, and sets the x coordinate of an arbitrary point P on the line segment F to X. An upper point P ′ (X ′, y0 + 1) is obtained.
[0116]
[Equation 17]
Figure 0003577154
[0117]
The removal area changing unit 12 sets the color of the pixel at the point P ′ as the color of the pixel at the point P. However, when the point P 'is a point in the eye area or the eyebrow area, the point P is left unchanged. Then, after this change process is performed on the entire line segment F, the pixel value of the remaining portion is changed by linear interpolation.
[0118]
Next, processing in the case of x0 ≠ xs or x1 ≠ xe will be described. As the hue used for changing the pixel value, a plurality of pixels are extracted from a part of the head contour and used sequentially. As an example, a 5 × 5 pixel block is extracted from the space between the eyebrows, and is sequentially mapped. If the brightness of a certain pixel after the change is L and the saturation is S, S is given by (Equation 18).
[0119]
(Equation 18)
Figure 0003577154
[0120]
In this method, the saturation is obtained from the ratio between the lightness and the saturation of the skin without hair, and has an effect of eliminating the influence of a shadow or the like.
[0121]
Hereinafter, a method of obtaining the lightness L of each pixel after the change will be described. The lightness applied to the pixel at point (x0, y0) is L0, and the lightness applied to the pixel at point (x1, y0) is L1. The lightness L assigned to the pixel at the point P (X, y0) in the pixel set is obtained by (Equation 19).
[0122]
[Equation 19]
Figure 0003577154
[0123]
F in (Equation 19) is a function taking a value of 0 ≦ f ≦ 1. Then, L is calculated as L0, L1, and f are the same as those in the first embodiment.
[0124]
Finally, the brightness and the saturation of each of the pixels in the area of the changed pixel and the pixels in the vicinity thereof are smoothed by the same method as in the first embodiment.
[0125]
(Embodiment 4)
Hereinafter, an image processing apparatus according to the fourth embodiment of the present invention will be described. In the present embodiment, the removal area changing unit 12 includes a fluctuation generating unit, and only the operation of the removal area changing unit 12 is different from the third embodiment.
[0126]
The operation of the removal area changing unit 12 will be described.
[0127]
The fluctuation generator gives fluctuation to hue, lightness, and saturation using a numerical value generated randomly or a numerical value generated stochastically depending on the position of a pixel to be mapped. The distribution of hue, lightness, and saturation of human skin is not smooth from the beginning, but is irregular to some extent.By giving fluctuations using randomly generated numerical values, more realistic results can be obtained. Can be Also, wrinkles and spots can be formed by using a numerical value that is generated stochastically depending on the position.
[0128]
The operation of the fluctuation generator will be described. The function R generates an integer value in a certain range irregularly. As an example, a function that generates an integer value from −5 to 5 irregularly is used. The function F (x, y) is a function for stochastically generating a numerical value from the position in the head contour of the pixel P (x, y) to be mapped. The range of numerical values generated by the function F and the probability thereof are uniquely determined by wrinkling and wrinkling. First, the hue H, lightness L, and saturation S of the pixel value mapped to the pixel P are obtained in the same manner as in the third embodiment. From this, L ′ and S ′ are obtained as shown in (Equation 20) using the functions R and F.
[0129]
(Equation 20)
Figure 0003577154
[0130]
The fluctuation generating unit maps the pixel P using the L ′ and S ′, and changes the removal area 15.
[0131]
In the present embodiment, the function R for generating a random numerical value is used. However, if the statistical distribution of the skin hue, lightness, and saturation is obtained, the numerical value is generated according to the statistical distribution, and the fluctuation is given. Is also good.
As described above with respect to the image processing apparatus according to the present embodiment, a fluctuation that adds a predetermined irregular fluctuation component to each pixel value in the area based on the color information of at least one pixel in the face image A generation unit may be further provided.
[0132]
(Embodiment 5)
FIG. 10 is a block diagram of an image processing device according to the fifth embodiment of the present invention. This embodiment is different from the embodiment of FIG. 1 in that a face surface model generation unit 101 is provided. Using the front face image 13, the face surface model generation unit 101 generates a face surface model 14 that is face structure information of the front face image 13. For the generation of the face surface model 14 in the face surface model generation unit 101, a conventional method such as Japanese Patent Application Laid-Open Nos. 5-197793 and 4-199474 is used.
As described above for the image processing apparatus according to the present embodiment, the image processing apparatus may further include a face surface model generation unit that generates a face surface model including the structural information based on the face image.
[0133]
(Embodiment 6)
FIG. 11 is a block diagram of an image processing device according to the sixth embodiment of the present invention. In FIG. 11, the hair image adjustment unit 111 controls the hair image 115 and the hair image based on the face surface model 114 and the face information model 116 so that the hair in the hair image 115 matches the face in the front face image 113. A predetermined conversion is applied to the hair information 117 which is the attribute of each pixel corresponding to 115. The face surface model 114 represents face structure information of the front face image 113. The face information model 116 represents the structure information of the face of the hair image 115.
[0134]
The hair synthesis processing unit 112 allocates the hair in the hair image 118 converted by the hair image adjustment unit 111 to the front face image 113 according to the hair information 117 converted by the hair image adjustment unit 111. The head image 118 is the head image 115 converted by the head image adjustment unit 111. The face information model 119 is the face information model 116 converted by the hair image adjustment unit 111. The hair information 1110 is the hair information 117 converted by the hair image adjustment unit 111. The hair composite image 1111 represents an image in which the hair of the hair image 118 is allocated to the front face image 113.
[0135]
The front face image 113 and the face surface model 114 are the same as those in the first embodiment. The head image 115 is a digital image obtained by photographing a face facing forward, has a size of 256 × 256 pixels, and is a color image having a depth of 8 bits for each of RGB for each pixel. The face of the hair image 115 is facing front, and the center line of the head is almost vertical. The face information model 116 has the same configuration as the face surface model 114. The hair information 117 gives an attribute for designating an allocation method when the hair image 115 is allocated to the front face image 113. The hair information 117 is the same size as the head hair image 115, and is a two-dimensional array in which one element has a bit width of 8 bits, and the attribute is stored in each element of the hair information 117 (see FIG. 12). . As shown in FIG. 12, one element of this array corresponds to one pixel of the hair image 115. That is, if the arrangement of the hair information 117 is A (x, y), A (x0, y0) becomes the attribute of the pixel at the point (x0, y0) of the head hair image 115. Table 1 below shows the attributes used in the present embodiment and their meanings.
[0136]
[Table 1]
Figure 0003577154
[0137]
In Table 1 and FIG. 12, reference numeral 121 denotes an attribute 1 area, 122 denotes an attribute 2 area, and 123 denotes an attribute 3 area.
[0138]
Next, the operation of the present embodiment will be described.
[0139]
The hair image adjustment unit 111 adjusts the hair image 115 so as to match the face of the front face image 113 to which the hair of the hair image 115 is mapped. In the present embodiment, as an example of the adjustment of the hair image 115, the size and position of the head contour in the head image 115 in both the horizontal and vertical directions are respectively set in the front face image 113. Is used.
[0140]
FIG. 13 is a configuration diagram of the hair image adjustment unit 111. The size adjusting unit 131 converts the hair image 115, the face information model 116, and the hair information 117 so that the size of the face of the hair image 115 matches the size of the face of the front face image 113. The head image 133 represents the head image 115 converted by the size adjustment unit 131. The face information model 134 represents the face information model 116 converted by the size adjustment unit 131. The hair information 135 represents the hair information 117 converted by the size adjusting unit 131.
[0141]
The position adjusting means 132 converts the hair image 133, the face information model 134, and the hair information 135 so that the position of the head outline in the hair image 133 matches the position of the head outline in the front face image 113.
[0142]
Next, the processing of the size adjusting means 131 will be specifically described. The size adjusting means 131 obtains the head contour sizes dv and dh as shown in FIG. dv is the maximum height of the head contour in the vertical direction (y-axis direction), and dh is the length of a line segment of the cut line obtained by cutting the head contour by a horizontal line passing through a point between the eyes and the head of the nose. The length of this line segment is defined as the size of the head contour in the horizontal direction (x-axis direction).
[0143]
Similarly, the size adjusting means 131 obtains the vertical size dv 'and the horizontal size dh' of the head contour in the hair image 115 from the face information model 116.
[0144]
The size adjusting means 131 adjusts the sizes by scaling the horizontal and vertical directions at independent magnifications. Assuming that the horizontal magnification is Sh and the vertical magnification is Sv, Sh and Sv are given by (Equation 21).
[0145]
(Equation 21)
Figure 0003577154
[0146]
The size adjusting means 131 obtains the hair image 133 by scaling the hair image 115 by Sh in the x-axis direction and by Sv in the y-axis direction based on Sh and Sv calculated by (Equation 21).
[0147]
The hair information 117 is converted into hair information 135 by the same processing as the size adjustment of the head image 115.
[0148]
As a scaling method, there is a nearest neighbor method or the like. In addition, since the face information model 116 has an x coordinate and a y coordinate for each feature point, the size adjusting means 131 adjusts the size by multiplying the x coordinate by Sh and the y coordinate by Sv. Do. That is, an arbitrary vertex P (x, y) of the face information model 116 is converted into a vertex P '(x', y ') of the face information model 134 by (Equation 22).
[0149]
(Equation 22)
Figure 0003577154
[0150]
Next, the operation of the position adjusting means 132 will be described. The position adjustment is a parallel movement with an independent displacement amount in each of the horizontal direction and the vertical direction. The displacement in the horizontal direction is Δh, and the displacement in the vertical direction is Δv. Δh and Δv are obtained as follows.
[0151]
FIG. 15 is a diagram for explaining the operation of the position adjustment unit 132. The face in FIG. 15 is the face of the front face image 113. Point Pn represents the midpoint of the line segment of the cut in which the head contour is cut in the horizontal direction at the position of the head of the nose. The point Pe represents the middle point of the line segment at the highest point of the eye area among the line segments of the cut line obtained by cutting the head contour in the horizontal direction. Point Pm represents the midpoint of a line segment connecting point Pn and point Pe.
[0152]
In the same manner, the position adjusting unit 132 obtains the midpoint Pn ', the midpoint Pe', and the midpoint Pm 'for the hair image 133 as well. The point Pn 'is the midpoint of the line segment of the cut in which the head contour is cut in the horizontal direction at the position of the head of the nose. The midpoint Pe 'is the midpoint of the line segment at the highest point of the eye area among the line segments of the cut line obtained by cutting the head contour in the horizontal direction. The middle point Pm 'is a middle point of a line connecting the points Pn' and Pe '.
[0153]
Therefore, if these midpoints are respectively Pm (xf, yf) and Pm '(xh, yh), Δh and Δv are respectively given by (Equation 23).
[0154]
(Equation 23)
Figure 0003577154
[0155]
An arbitrary point P (x, y) on the hair image 133 is converted into a point P '(X, Y) by (Equation 24), and the hair image 118 is generated.
[0156]
[Equation 24]
Figure 0003577154
[0157]
Similarly, an arbitrary element A (x, y) of the hair information 135 is converted into A '(X, Y), and hair information 1110 is generated. Further, an arbitrary vertex Pf (x, y) on the face information model 134 is also converted to Pf '(X, Y), and a face information model 119 is generated.
[0158]
Note that the processing for the face information model 116 and the face information model 134 may be performed for all vertices in the face information model 116, but only for vertices such as feature points used in subsequent processing. May go.
[0159]
Next, the operation of the hair synthesis processing unit 112 will be described. Similarly to the first embodiment, the hair synthesis processing unit 112 converts pixel values into hue, lightness, and saturation, instead of RGB color information, and normalizes the pixel values to integer values from 0 to 255. .
[0160]
FIG. 16 is a configuration diagram of the hair synthesis processing unit 112. In FIG. 16, reference numeral 161 denotes a combined information generation unit. A hue synthesis unit 162 generates a hue using the hue of the front face image 113 and the hue of the hair image 118 according to the attribute of the hair information 167. Reference numeral 163 denotes a lightness synthesis unit that generates lightness using the lightness of the front face image 113 and the lightness of the hair image 118 according to the attribute of the hair information 167. Reference numeral 164 denotes a saturation synthesis unit that generates saturation using the saturation of the front face image 113 and the saturation of the hair image 118 according to the attribute of the hair information 167. The input unit 165 inputs the hue generated by the hue synthesis unit 162, the brightness generated by the lightness synthesis unit 163, and the saturation generated by the saturation synthesis unit 164. 113 is a mapping processing unit that generates a synthesized hair image 1111. Reference numeral 166 denotes synthesis information generated by the synthesis information generation unit 161. 167 is hair information corrected by the synthetic information generation unit 161.
[0161]
The synthesis information generation unit 161 generates synthesis information 166 to be used when the hue synthesis unit 162, the lightness synthesis unit 163, and the saturation synthesis unit 164 perform generation processing from the color information of the front face image 113 and the hair image 118. At the same time, the synthesis information generation unit 161 checks the color information of the pixels of the front face image 113 of the mapping destination, corrects the hair information 1110, and outputs the hair information 167. In the present embodiment, an average value of lightness is used as an example of the composite information 166. In addition, the hair information 1110 is modified, for example, by changing the mapping of the front face image 113 for the pixels with low brightness to the attribute 2 mapping.
[0162]
First, the operation of the synthesis information generation unit 161 will be described. The synthesis information generation unit 161 obtains an average value Lha of lightness of pixels having an attribute given by the hair information 1110 among pixels in a region above the eyebrows in the head contour of the hair image 118. In addition, the synthesis information generation unit 161 examines a pixel whose brightness L of the point P (x, y) above the eyebrow within the head contour in the front face image 113 satisfies Expression (25).
[0163]
(Equation 25)
Figure 0003577154
[0164]
Θl in (Equation 25) is a threshold, and θl = 95 as an example. This pixel is a dark pixel and is likely to be hair. Therefore, in order to prevent a pixel satisfying (Equation 25) from remaining in the head hair synthesized image 1111, the synthesis information generation unit 161 sets A (x, y) of the hair information 1110 to attribute 2 and generates hair information 167. . Further, the synthesis information generation unit 161 obtains an average value Lfa of brightness of pixels that do not satisfy (Equation 25).
[0165]
The processing performed by each of the hue synthesis unit 162, the lightness synthesis unit 163, and the saturation synthesis unit 164 is determined by the attribute of the pixel of the hair information 167. The pixel of attribute 3 is not mapped because it is not the hair. Since the pixel of the attribute 1 is a pixel in a shadow part of the bangs, hairline, and bangs, a value obtained by combining the pixel value and the pixel value of the mapping destination on the front face image 113 is mapped. For the pixel of attribute 2, the pixel value is directly mapped on the front face image 113.
[0166]
The operation of the hue composition unit 162 will be described. The hue of an arbitrary pixel Ph (x, y) of the hair image 118 is Hh, the attribute of the pixel Ph obtained from the hair information 167 is A (x, y), and the pixel Pf ( Assuming that the hue of (x, y) is Hf, the hue synthesizing unit 162 generates H from (Equation 26) using Hf and Hh according to A (x, y).
[0167]
(Equation 26)
Figure 0003577154
[0168]
In the case of the attribute 1, the hue composition unit 162 takes an intermediate value between Hf and Hh. However, since the hue is represented by an angle as shown in FIG. 17, Hf and Hh used are corrected by (Equation 27).
[0169]
[Equation 27]
Figure 0003577154
[0170]
Also, H corrected by (Equation 28) is used.
[0171]
[Equation 28]
Figure 0003577154
[0172]
The operation of the brightness synthesizing unit 163 will be described. The brightness of the pixel Ph (x, y) is Lh, and the brightness of Pf (x, y) is Lf. Using the average brightness values Lfa and Lha obtained from the synthesis information 166, the lightness synthesis unit 163 synthesizes L from Lh and Lf according to (Equation 29).
[0173]
(Equation 29)
Figure 0003577154
[0174]
The brightness synthesis unit 163 performs synthesis in the case of the attribute 1 using the difference from the average value.
[0175]
The operation of the saturation synthesis unit 164 will be described. The saturation of the pixel Ph (x, y) is assumed to be Sh, and the saturation of Pf (x, y) is assumed to be Sf. Sf and Sh are combined with S by (Equation 30).
[0176]
[Equation 30]
Figure 0003577154
[0177]
The mapping processing unit 165 converts the H, L, and S synthesized as described above into RGB colors, and maps the colors to the pixels Pf of the front face image 113.
[0178]
The processing time when the above processing was performed by a 32-bit personal computer equipped with a media processing board having a DSP was about 5 seconds.
[0179]
In the present embodiment, the front face image 113 and the hair image 115 are both digital images having a size of 256 × 256, but may be other sizes.
[0180]
Further, in the present embodiment, a face information model having the same configuration as the face surface model is used, but any other structure may be used as long as eyes, nose, eyebrows, and head contour can be obtained.
[0181]
Further, in the present embodiment, the same function is used for the hue and the saturation for the synthesis at the time of mapping, but independent functions may be used.
[0182]
In addition, as the synthesis information, the average value of the hue and the saturation of the frontal face image may be added, and the average value may be used in the synthesis result in the case of the attribute 1 in the hue synthesis unit and the saturation synthesis unit.
As described above with respect to the image processing apparatus according to the present embodiment, the image of the person is a face image of the person, the structure information is structure information for the surface of the face of the person, and the reference image Is a hair image that is an image of the face of the different person having hair, the structure information of the different person indicates structure information for the surface of the different person's face in the hair image, and the predetermined portion is a hair Or the hair part which is a shadow of the hair, wherein the attribute information is hair information that holds the attribute of each pixel in the hair image in association with the pixel, and the image adjustment unit includes the hair information A hair image adjustment unit that applies the predetermined conversion to the hair image and the hair image, wherein the synthesis processing unit applies the predetermined conversion to the hair image to which the predetermined conversion has been applied according to the hair information to which the predetermined conversion has been applied. May be a hair portion is hair synthesis processing unit allocated to the face image that.
Further, the image adjustment unit may include information on all or a part of the eyes, nose, mouth, and eyebrows and the head contour in the structure information of the person, and all or part of the eyes, nose, mouth, and eyebrows in the structure information of the different person. The predetermined conversion may be applied to the reference image and the attribute information of the reference image using information on a part and a head contour.
In addition, the synthesis processing unit uses the pixel value of the reference image corresponding to the pixel of the attribute according to the attribute of each pixel of the attribute information of the reference image, or the reference image corresponding to the pixel of the attribute A generation unit that generates each pixel value of the hair portion to be allocated to the human face image using the pixel value of the human face image and a predetermined value of the reference image generated by the generation unit. And a mapping processing unit that allocates each pixel value of the above to the face image of the person.
Further, the image processing apparatus may further include a composite image correction unit that corrects a human face image to which a predetermined portion of the reference image is allocated by the mapping processing unit.
Still further, the generating unit generates a hue according to the attribute, using a pixel value of the reference image or a pixel value of the reference image and a pixel value of the human face image corresponding to a pixel having the attribute. A hue synthesis unit, and a brightness synthesis unit that generates brightness using a pixel value of the reference image or a pixel value of the reference image and a pixel value of the human face image corresponding to a pixel having the attribute according to the attribute. And, according to the attribute, corresponding to the pixel of the attribute, using a pixel value of the reference image or a pixel value of the reference image and a pixel value of the human face image, a saturation synthesis unit that generates saturation May be provided.
[0183]
(Embodiment 7)
Hereinafter, an image processing apparatus according to the seventh embodiment of the present invention will be described with reference to FIG. In FIG. 18, reference numeral 181 denotes a composite image correction unit that performs interpolation and correction when there is a gap between the face area and the hair area in the mapping result image. Reference numeral 182 indicates a hair composite image output from the image processing apparatus. The processing of the hair region selecting unit 11 and the removal region changing unit 12 is the same as that described in the first embodiment, the second embodiment, the third embodiment, or the fourth embodiment. The processing of the hair image adjustment unit 111 is the same as that described in the sixth embodiment.
[0184]
The operation of the hair synthesis processing unit 112 is different from that described in the sixth embodiment in that the processing performed by the synthesis information generation unit is different, and this will be described below. In the image processing apparatus according to the present embodiment, the hair synthesis processing unit 112 maps the hair image 118 to the hair removal image 16. Since the hair removal image 16 is obtained by removing the head hair and the shadow part of the hair, there is no need to modify the hair information 1110. Therefore, in the present embodiment, this processing is not performed in the synthesis information generation unit 161. By inputting the removal area 15, the threshold value processing of (Equation 25) is not performed, and the average brightness Lfa of the pixels not included in the removal area 15 is obtained.
[0185]
The composite image correction unit 181 examines the image of the mapping result for each horizontal scanning line, and if there is a gap between the face area and the hair area, performs the interpolation. However, when the pixel of the hair image 118 mapped to the end point of the hair region is not adjacent to a point on the contour of the face in the hair image 118 or a point inside the contour, the interpolation is not performed. The outline of the face in the hair image 118 is obtained from the face information model 119. The interpolation processing is performed with the color of the pixel of the latest face area when the interpolation position is above the middle position between the nose and the mouth, and with the color of the pixel of the latest hair area when the interpolation position is below. If there is a gap with the hair area above the forehead, this area is interpolated with the forehead skin color. After interpolating the gap, smoothing is performed at the joint between the hair or shadow area and the face area. The method of smoothing is the same as that described in the first embodiment.
[0186]
(Embodiment 8)
Hereinafter, an eighth embodiment of the present invention will be described. In the present embodiment, the hair and its hair are converted from the input frontal face image by the image processing apparatus described in the first embodiment, the second embodiment, the third embodiment, or the fourth embodiment. A hair removal image in which a shadow region is removed and a hair removal image in which the removed region is changed is synthesized with a prepared hair. In addition, the hair image adjustment unit operates based on all or a part of the distance between the eye surface, the nose, the mouth, the position of the eyebrows and the head contour obtained from the face surface model and the face information model, and the position and size of the head contour, A hair synthesis processing unit, a synthesis information generation unit that generates information used for synthesizing the hair removal image and the hair image, and a texture information synthesis unit that synthesizes texture information by a method specified by an attribute of a pixel obtained from the hair information. A mapping processing unit that maps the pixel values synthesized by the texture information synthesizing unit to the hair removal image, and a synthesized image correcting unit that corrects the mapped image. Further, the texture information synthesizing unit includes a hue synthesizing unit, a lightness synthesizing unit, and a saturation synthesizing unit.
[0187]
FIG. 19 is a block diagram of the image processing device according to the present embodiment. 19, reference numeral 191 denotes a hair image adjustment unit, 192 denotes a hair synthesis processing unit, 193 denotes a hair image, 194 denotes a face information model that represents structural information of the face of the hair image 193, and 195 denotes a hair. 196 represents hair information representing the attribute of each pixel of the image 193, 196 represents a hair image obtained by converting the hair image 193 by the hair image adjustment unit 191, 197 is converted from the face information model 194 by the hair image adjustment unit 191 198 represents the hair information resulting from the conversion of the hair information 195 by the hair image adjustment unit 191, and 199 represents the hair resulting from combining the hair of the hair image 196 with the hair removal image 16. Represents a composite image.
[0188]
The input frontal face image 13 has a size of 256 × 256 pixels captured by a face image capturing device as shown in FIG. 2 and has an RGB depth of 8 bits per pixel, as in the first embodiment. Color digital image. The face is facing front and the centerline of the head is almost vertical. The face surface model 14 is the same as in the first embodiment. The head image 193 is a digital image obtained by photographing a face facing forward and is a color image having a size of 256 × 256 pixels, and each pixel has a depth of 8 bits for RGB. The face in the hair image 193 faces front, and the center line of the head is almost vertical. The face information model 194 has the same configuration as the face surface model 14.
[0189]
The hair information 195 gives an attribute for designating a synthesis method when each pixel of the head hair image 193 is synthesized with the hair removal image 16 in order to make the synthesized image more natural. The hair information 195 is the same size as the hair image 193, and is a two-dimensional array in which one element has a bit width of 8 bits. As shown in FIG. 20, one element of this array corresponds to one pixel of the hair image 193. That is, if the array of the hair information 195 is A (x, y), A (x0, y0) is the attribute of the pixel at the point (x0, y0) of the hair image 193.
[0190]
Table 2 below shows the attributes used in the present embodiment and their meanings.
[0191]
[Table 2]
Figure 0003577154
[0192]
Table 2 is set in order to make the synthesized image more realistic by adding a shadow by the head hair and naturally overlapping fine bangs.
[0193]
In Table 2 and FIG. 20, 201 indicates an attribute 1 area, 202 indicates an attribute 2 area, 203 indicates an attribute 3 area, and 204 indicates an attribute 4 area.
[0194]
The hair image adjustment unit 191 adjusts the hair image 193 so that the hair of the hair image 193 matches the face of the hair removal image 16 to be mapped. In the present embodiment, as an example of the adjustment of the hair image 193, the size and position of the head contour in the hair image 193 in both the horizontal and vertical directions are respectively set to the size and position of the head contour in the hair removal image 16 in both the horizontal and vertical directions. Match.
[0195]
Hereinafter, the operation of the hair image adjusting unit 191 for performing such adjustment will be described with reference to FIG. In FIG. 21, reference numeral 211 denotes a size adjusting unit that converts the hair image 193, the face information model 194, and the hair information 195 so that the size of the face of the hair image 193 matches the size of the face of the hair removal image 16. , 213 represents a hair image converted by the size adjusting unit 211, 214 represents a face information model converted by the size adjusting unit 211, 215 represents hair information converted by the size adjusting unit 211, Reference numeral 212 denotes the hair image 213, the face information model 214, and the hair information so that the position of the hair image 213 in the face hair image 213 matches the position of the hair removal image 16 in the face hair removal image 16. 215 represents a position adjusting means for converting 215.
[0196]
The operation of the size adjusting means 211 will be described. First, the head contour sizes dv1, dv2, and dh as shown in FIG. 22 are obtained from the face surface model 14. dv1 is the distance in the vertical direction (y-axis direction) between the line segment that cuts the head contour horizontally at the position of the nose head and the top point of the head contour, and dv2 is the distance that the head contour is cut horizontally at the position of the nose head. This is the vertical distance between the line segment and the lowest point of the head contour. dh is the length of a cut line obtained by cutting the head outline by a horizontal line passing through the point of the head of the nose, and this is defined as the size of the head outline in the horizontal direction (x-axis direction).
[0197]
Similarly, from the face information model 194, the vertical sizes dv1 'and dv2' and the horizontal size dh 'of the head contour of the face of the hair image 193 are obtained. The adjustment of the size is performed by scaling each of the hair image 193 and the hair information in the horizontal direction and the vertical direction at independent magnifications. Further, for vertical scaling, scaling is performed at independent magnifications above and below the position of the head of the nose. Assuming that the horizontal magnification is Sh, the vertical magnification is Sv1 above the nose head, and Sv2 below, the respective magnifications are calculated by (Equation 31).
[0198]
[Equation 31]
Figure 0003577154
[0199]
The size adjustment unit 211 generates the hair image 213 by scaling the hair image 193 in the x-axis direction with Sh and scaling it in the y-axis direction with Sv1 and Sv2. The hair information 195 is converted into hair information 215 by the same processing as the size adjustment of the hair image 193. As a scaling method, a conventional method such as a nearest neighbor method can be used.
[0200]
Further, since the face information model 194 has an x coordinate and a y coordinate corresponding to each feature point, the face information model 194 is converted into the face information model 214 by (Equation 32).
[0201]
(Equation 32)
Figure 0003577154
[0202]
Here, the y coordinate of the position of the head of the nose is yn.
[0203]
Next, the operation of the position adjusting means 212 will be described. The position adjustment is a parallel movement with an independent displacement amount in each of the horizontal direction and the vertical direction. The displacement in the horizontal direction is Δh, and the displacement in the vertical direction is Δv. Δh and Δv are obtained as follows.
[0204]
FIG. 23 is a diagram for explaining the operation of the position adjustment unit 212. The face in FIG. 23 is the face of the hair removal image 16. Point Pn represents the midpoint of the line segment of the cut where the head contour is cut horizontally at the position of the head of the nose, and point Pe is the line segment of the cut line where the head contour is cut horizontally at the highest point of the eye area. The point Pm represents the midpoint of the line segment connecting the points Pn and Pe. The position adjusting means 212 similarly applies the head contour to the midpoint Pn 'of the cut line obtained by cutting the head contour horizontally at the position of the nose head and the top point of the eye area for the hair image 213. The midpoint Pe ′ of the line segment of the cut in the horizontal direction and the midpoint Pm ′ of the line segment connecting the points Pn ′ and Pe ′ are obtained. Therefore, assuming that these midpoints are Pm (xf, yf) and Pm '(xh, yh), respectively, Δh and Δv are obtained by (Equation 33).
[0205]
[Equation 33]
Figure 0003577154
[0206]
An arbitrary point P (x, y) on the hair image 213 is converted into a point P '(X, Y) by (Equation 34), and a hair image 196 is generated.
[0207]
[Equation 34]
Figure 0003577154
[0208]
Similarly, an arbitrary element A (x, y) of the hair information 215 is converted into A '(X, Y) to generate hair information 198. Also, an arbitrary vertex Pf (x, y) on the face information model 214 is converted into Pf '(X, Y), and a face information model 197 is generated.
[0209]
Note that the processing for the face information model 194 and the face information model 214 may be performed on all vertices in the face information model 194. May go.
[0210]
Next, the operation of the hair synthesis processing unit 192 will be described. Also in the processing in the hair synthesis processing unit 192, pixel values are converted into hue, lightness, and saturation, instead of RGB color information, as in the first embodiment, and are normalized to integer values from 0 to 255. Is used.
[0211]
FIG. 24 is a configuration diagram of the hair synthesis processing unit 192. In FIG. 24, reference numeral 241 denotes a combined information generation unit. Reference numeral 242 denotes a hue synthesis unit that generates a hue using the hue of the hair removal image 16 and the hue of the hair image 196 according to the attribute of the hair information 198. Reference numeral 243 denotes a lightness synthesis unit that generates lightness using the lightness of the hair removal image 16 and the lightness of the hair image 196 according to the attribute of the hair information 198. Reference numeral 244 denotes a saturation synthesis unit that generates saturation using the saturation of the hair-removed image 16 and the saturation of the hair image 196 according to the attribute of the hair information 198. H.245 inputs the hue generated by the hue synthesis unit 242, the lightness generated by the lightness synthesis unit 243, and the saturation generated by the saturation synthesis unit 244, and converts them into RGB colors. A mapping processing unit that generates a synthesized hair image 199 by mapping to the hair removal image 16. Reference numeral 246 denotes synthesis information generated by the synthesis information generation unit 241. Reference numeral 247 denotes a composite image correction unit that performs interpolation and correction when there is a gap between the face area and the hair area in the mapping result image. The synthesis information generation unit 241 generates and outputs synthesis information 246 used when the hue synthesis unit 242, the lightness synthesis unit 243, and the saturation synthesis unit 244 perform synthesis processing from the color information of the hair removal image 16 and the hair image 196. In the present embodiment, an average value of brightness and saturation is used as an example of the synthesis information 246.
[0212]
First, the operation of the synthesis information generation unit 241 will be described. The synthesis information generation unit 241 generates an average value Lha of brightness and an average value Sha of saturation of pixels in the area below the eyes within the head contour in the hair image 196 and having attributes 3 or 4 given by the hair information 198. Ask for. Further, the synthesis information generation unit 241 acquires the average value La of lightness and the average value Sa of saturation in the third embodiment as synthesis information 246.
[0213]
The processing performed by the hue synthesis unit 242, the lightness synthesis unit 243, or the saturation synthesis unit 244 is determined by the attribute of the hair information 198. Since the pixel of the attribute 4 is not the hair, no mapping is performed. Since the pixel of the attribute 1 is a pixel of a bangs or a hairline, a value obtained by combining the pixel value and the pixel value of the mapping destination on the hair removal image 16 is mapped. For the pixel of the attribute 2, the pixel value is directly mapped on the hair removal image 16. Since the pixel of attribute 3 is a shadow caused by the hair, it is processed by slightly lowering the brightness and saturation of the pixel at the mapping destination.
[0214]
The operation of the hue combining unit 242 will be described. The hue of an arbitrary pixel Ph (x, y) of the hair image 196 is Hh, the attribute of the pixel Ph obtained from the hair information 198 is A (x, y), and the pixel Pf ( Assuming that the hue of (x, y) is Hf, the hue synthesizing unit 242 generates H from (Equation 35) using Hf and Hh according to A (x, y).
[0215]
(Equation 35)
Figure 0003577154
[0216]
The function mod (a, b) in (Equation 35) returns the remainder obtained by dividing the integer a by the integer b. In the case of the attribute 1, the hue of the composite image is alternately the hue of the hair image 196 and the hue of the hair removal image 16 Will be taken.
[0217]
The operation of the brightness synthesizing unit 243 will be described. The brightness of the pixel Ph (x, y) is Lh, and the brightness of Pf (x, y) is Lf. The lightness synthesizing unit 243 synthesizes L from Lh and Lf according to (Equation 36) using the average values La and Lha of the lightness obtained from the synthesis information 246.
[0218]
[Equation 36]
Figure 0003577154
[0219]
The brightness combining unit 243 performs combining in the case of the attribute 1 using the difference between the average values. Further, the lightness synthesizing unit 243 lowers the lightness of the skin in the attribute 3. Here, σ is a certain real number, and is set to La / Lh as an example. Also, the function min (a, b) takes the smaller value of the real numbers a and b.
[0220]
The operation of the saturation synthesis unit 244 will be described. The saturation of the pixel Ph (x, y) is assumed to be Sh, and the saturation of Pf (x, y) is assumed to be Sf. The saturation synthesis unit 244 synthesizes S from Sf and Sh using (Equation 37) using the average values of saturation Sa and Sha obtained from the synthesis information 246.
[0221]
(37)
Figure 0003577154
[0222]
In (Equation 37), a, b, c, and d are certain real numbers satisfying a + b = 1 and c + d = 1. For example, a = 0.3, b = 0.7, c = 0.4, d = 0.6.
[0223]
The mapping processing unit 245 converts the H, L, and S synthesized as described above into RGB colors, and maps the colors to the pixels Pf of the hair removal image 16.
[0224]
The synthetic image correcting unit 247 examines the image of the mapping result for each horizontal scanning line, and if there is a gap between the hair region and the face region not including the hair region, performs interpolation for the gap. However, if the pixel of the hair image 196 mapped to the end point of the hair area is not adjacent to a point on the head contour or a point inside the head contour in the hair image 196, no interpolation is performed.
[0225]
The head contour in the hair image 196 is obtained from the face information model 197. The interpolation processing is performed with the color of the pixel of the latest face area when the interpolation position is above the middle position between the nose and the mouth, and with the color of the pixel of the latest hair area when the interpolation position is below. If there is a gap with the hair area above the forehead, this area is interpolated with the forehead skin color. After interpolating the gap, smoothing is applied to the joint between the hair and the shadow area and the face area. The smoothing method is the same as that described in the first embodiment.
[0226]
The processing time when the above processing was performed by a 32-bit personal computer equipped with a media processing board having a DSP was about 8 seconds.
[0227]
In the present embodiment, the front face image 13 and the hair image 193 are both digital images having a size of 256 × 256, but may be other sizes.
[0228]
Further, in the present embodiment, a face information model having the same configuration as the face surface model is used. However, as long as the eye, nose, eyebrows, and head contour can be obtained, a face information model having another structure may be used. Good.
[0229]
Further, as the synthesis information, an average value of the hues of the frontal face image may be added, and the average value may be used as the synthesis result in the case of the attribute 1 in the hue synthesis unit.
[0230]
Further, in the present embodiment, the brightness synthesis unit 243 performs the synthesis in the case of the attribute 1 using the difference between the average values. However, the synthesis of the attribute 1 and the attribute 3 calculates the brightness value by the ratio of the average values. , Mapping may be performed. That is, (Expression 38) may be used instead of (Expression 36).
[0231]
[Equation 38]
Figure 0003577154
[0232]
As described above, in the image processing apparatus according to the present embodiment, the predetermined value in the image based on the pixel values in all or a part of the image of the person and the structural information of the person in the image is used. A region selecting unit that selects a region of a portion; a region changing unit that changes each of pixel values in all or a part of the region of the predetermined portion based on the structure information and at least one pixel value in the image. And, based on the structure information and the structure information of the other person in the reference image, which is another person's image, so that the predetermined portion of the other person fits the image, and holds it in correspondence with the pixel of that person. An image adjustment unit that applies a predetermined conversion to the attribute of each pixel in the reference image and the reference image based on the attribute information that is present; Characterized by comprising a composition processing unit allocating a predetermined portion in the image in the reference image in which a predetermined conversion has been applied.
Further, based on each pixel value in all or a part of the face image which is a face image and a face surface model indicating structural information on the surface of the face in the face image, the hair in the face image or the hair and the hair. A hair region selecting unit that selects a shadow due to a hair region, a structure information in the face surface model, and color information obtained from at least one pixel value in the face image, all or a part of the removal region. , A removal area changing unit that changes each pixel value, a face surface model, and a face information model that shows structural information on the surface of another face in a hair image that is an image of another face having hair. The attribute of each of the pixels of the hair image is assigned to the image so that the other person's hair or the hair and the hair part which is a shadow of the hair match the face image. A hair image adjustment unit that applies a predetermined conversion to the hair information and the hair image held in association with the hair information, and a hair image to which the predetermined conversion is applied in accordance with the hair information to which the predetermined conversion is applied And a hair synthesis processing unit for allocating a hair portion to the face image.
(Embodiment 9)
Hereinafter, an image processing apparatus according to a ninth embodiment of the present invention will be described with reference to FIG. In the present embodiment, the face surface model 14 generated by the face surface model generation unit 101 is used as an input to the hair region selection unit 11, the removal region change unit 12, the hair image adjustment unit 191, and the hair image synthesis unit 192. Except for this, the configuration is the same as that described in the seventh embodiment or the eighth embodiment.
As described above for the image processing apparatus according to the present embodiment, the image processing apparatus may further include a face surface model generation unit that generates a face surface model including the structural information based on the human face image.
[0233]
(Embodiment 10)
FIG. 26 is a block diagram of a tenth embodiment of the present invention. The present embodiment relates to a face image display device including the image processing device and the image display device according to the eighth embodiment. In FIG. 26, reference numeral 261 denotes a hair image database, 262 denotes a hair image selection device, and 263 denotes an image display device. The hair image database 261 holds a large number of hair images, face information models, and hair information to be synthesized. The hair image selection device 262 selects a certain hair image, face information model, and hair information from the hair image database 261. Output. The image display device 263 simultaneously displays a plurality of head images obtained from the front face image 13, the hair removal image 16, the synthesized hair image 199, and the hair image database 262. Since the face surface model 14 and the face information model 194 have the same configuration, the head image can be used as the input front face image 13.
[0234]
With the face image display device of the present embodiment, it is possible to simultaneously display a plurality of face images and replace the hair to display. As a result, the hairstyle of the target person can be changed by selecting another person's hairstyle and displayed. It is also possible to display a plurality of hair images and replace the hair. With such a face image display device, there is an effect that it is easier to draw an image when a hairstyle to be replaced is selected as a hairstyle of a certain person than from an image in which only the hairstyle is shown.
[0235]
Although the above-described embodiment relates to hair synthesis, it can be applied to synthesis of a beard, ears, neck, ornaments, clothes, and the like into a face image by a similar method. Hereinafter, each will be described.
[0236]
Processing for synthesizing a beard will be described. In this case, attribute 1 or 2 in the hair information is defined as a beard region in the hair image. In FIG. 27, dm represents the width of the mouth in the horizontal direction. Dn is the distance between the horizontal straight line passing through the highest point of the mouth area and the horizontal straight line passing through the nose head. This distance is defined as the distance between the mouth and the nose. The size is adjusted so that dm and dn in the hair image match dm and dn in the frontal face image, respectively. That is, the scaling factor Sh of the horizontal scaling is determined as shown in (Expression 39) by the horizontal mouth width dm in the frontal face image and the horizontal mouth width dm ′ in the hair image.
[0237]
[Equation 39]
Figure 0003577154
[0238]
The scaling factor Sv in the vertical direction is determined by the distance dn between the mouth and the nose in the frontal face image and the distance dn ′ between the mouth and the nose in the hair image, as shown in Expression 39. By using the Sh and Sv, the hair image is scaled in the horizontal direction with the magnification Sh and in the vertical direction with the magnification Sv to adjust the size.
[0239]
Next, the adjustment of the position when combining the beards will be described. In FIG. 28, Pn is the midpoint of a line segment of an incision whose head contour is cut by a horizontal straight line passing through the head of the nose. Pm is the midpoint of the line segment of the cut edge whose head contour is cut by a horizontal straight line passing through the highest point of the mouth area. Pc is the midpoint of the line connecting Pn and Pm, and serves as a reference point for position adjustment. In order to adjust the position, the hair image is translated so that the reference point Pc in the front face image and the reference point Pc 'in the hair image are at the same position on the same screen. Assuming that these reference points are Pc (xf, yf) and Pc ′ (xh, yh), respectively, Δh which is a horizontal movement amount and Δv which is a vertical movement amount are respectively given by (Expression 23). Given by X and Y obtained by substituting Δh and Δv into (Equation 24) are used as the position of the hair image to adjust the position. The hair synthesis processing unit performs the same processing as in the case of synthesizing the hair.
[0240]
Next, a process of synthesizing the ear will be described. First, an attribute 5 for the ear is added in addition to the attributes shown in Table 2. In the hair information, an ear area in the hair image is set as the attribute 5. The adjustment of the size and the adjustment of the position are performed in the same manner as in the case of synthesizing the hair. In the case of the above hair synthesis, the hair synthesis processing unit performs processing by replacing (Formula 35) with (Formula 40), (Formula 36) with (Formula 41), and (Formula 37) with (Formula 42).
[0241]
(Equation 40)
Figure 0003577154
[0242]
(Equation 41)
Figure 0003577154
[0243]
(Equation 42)
Figure 0003577154
[0244]
Here, H0 in (Equation 40) is the hue of the pixel at an appropriate position in the face area. Here, it is assumed that pixels between the eyebrows are used.
[0245]
The process of synthesizing a decorative item will be described. In this case, the hair information is configured by setting the attribute of the area of the ornament of the hair image to 2. The scale is adjusted by scaling the hair image according to (Equation 43) using the magnification Sh of (Equation 21).
[0246]
[Equation 43]
Figure 0003577154
[0247]
As the magnification, other than Sh, Sv of (Equation 21) or Sv1 or Sv2 of (Equation 31) may be used.
[0248]
The hair synthesis processing unit performs the same processing as in the case of the hair synthesis described above.
[0249]
Next, the composition of the neck and the clothes will be described. However, clothing will be treated as if it were attached to the neck. In this case, attribute 5 in the hair information is an area where the skin of the neck in the hair image is visible. Attribute 2 is the area of the clothing part. The adjustment of the size and the adjustment of the position are performed in the same manner as in the case of synthesizing the hair. The hair synthesis processing unit performs the same processing as when synthesizing the ears.
As described above with respect to the image processing apparatus according to the present embodiment, the image processing apparatus may further include an image display unit that displays a plurality of face images to which predetermined portions of the reference image are allocated by the synthesis processing unit.
[0250]
【The invention's effect】
As described above, according to the present invention, it is possible to automatically generate a synthetic hair image with less discomfort.
[0251]
Further, according to the present invention, the use of a 32-bit personal computer equipped with a media processing board having a DSP enables processing from photographing to completion of hair synthesis in ten seconds or more, which is a practical time.
[Brief description of the drawings]
FIG. 1 is a block diagram of an image processing apparatus according to a first embodiment of the present invention.
FIG. 2 is a diagram illustrating an example of a face image capturing device that captures a front face image 13;
FIG. 3 is a diagram illustrating an example of a frontal face image 13 captured by the face image capturing device illustrated in FIG. 2;
FIG. 4 is a diagram of a wire frame model showing an example of a face surface model 14;
FIG. 5 is a diagram for explaining an operation of changing a pixel value by a removal area changing unit 12;
6A is a characteristic diagram of f in (Equation 7), and FIG. 6B is a characteristic diagram of f in (Equation 8).
FIG. 7 is a configuration diagram of a mask used for smoothing.
FIG. 8 is a flowchart illustrating a procedure of a process of a hair region selecting unit 11 according to the second embodiment.
FIG. 9 is a diagram for explaining an operation of a removal area changing unit 12 according to the third embodiment.
FIG. 10 is a block diagram of an image processing device according to a fifth embodiment of the present invention.
FIG. 11 is a block diagram of an image processing device according to a sixth embodiment of the present invention.
FIG. 12 is a diagram illustrating a correspondence between a hair image and hair information according to the sixth embodiment.
13 is a configuration diagram of a hair image adjustment unit 111. FIG.
FIG. 14 is an explanatory diagram of an operation of a size adjusting unit according to the sixth embodiment.
FIG. 15 is a diagram for explaining the operation of the position adjusting means 132.
16 is a configuration diagram of a hair synthesis processing unit 112. FIG.
FIG. 17 is an explanatory diagram of a hue.
FIG. 18 is a block diagram of an image processing device according to a seventh embodiment of the present invention.
FIG. 19 is a block diagram of an image processing device according to an eighth embodiment.
FIG. 20 is a diagram illustrating a correspondence between a hair image and hair information according to the eighth embodiment.
FIG. 21 is a configuration diagram of a hair image adjustment unit 191.
FIG. 22 is an explanatory diagram of the operation of the size adjusting means according to the eighth embodiment.
FIG. 23 is an explanatory diagram of the operation of the position adjusting means according to the eighth embodiment.
24 is a configuration diagram of a hair synthesis processing unit 192. FIG.
FIG. 25 is a block diagram of an image processing device according to a ninth embodiment of the present invention.
FIG. 26 is a block diagram of a tenth embodiment of the present invention.
FIG. 27 is an explanatory diagram of the operation of the size adjusting means when synthesizing a beard;
FIG. 28 is an explanatory diagram of the operation of the position adjusting means when synthesizing a beard.
[Explanation of symbols]
11 ... hair area selection part
12: Removal area change unit
13. Front face image
14 ... Face surface model
15 ... removal area
16 ... Hair removal image
101: face surface model generation unit
111: Hair image adjustment unit
112: Hair synthesis processing unit
131 ... size adjustment means
132 position adjusting means
161... Synthetic information means
162: Hue synthesis unit
163: Lightness synthesis unit
164: Saturation synthesis unit
165: Mapping processing unit
181: Composite image correction unit
191 ... hair image adjustment unit
192: Hair synthesis processing unit
211: Size adjustment means
212 ... Position adjusting means
241 ... Synthesis information generation unit
242: Hue synthesis unit
243: Lightness synthesis unit
244 ... Saturation synthesis unit
245 ... Mapping processing unit
247: Composite image correction unit
262: Hair image selection device
263 image display device

Claims (26)

人の画像の全部又は一部における各画素値と、その画像における人の構造情報とに基づいて、その画像における所定部分の領域を選定する領域選定部と、
前記構造情報と、前記画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部とを備え、
前記領域選定部は、前記構造情報における頭輪郭、目及び眉に基づいて、頭髪及び/又はその頭髪による影を前記領域に選定することを特徴とする画像処理装置。
And each pixel value in whole or part of the human face image, based on the structural information of the person in the face image, a region selection unit for selecting a region of a predetermined portion in the face image,
And the structural information, based on the color information obtained from at least one pixel value in the face image, Bei example a region changing part for changing each pixel value in whole or part of the region,
The image processing apparatus according to claim 1, wherein the area selecting unit selects hair and / or a shadow of the hair in the area based on a head contour, eyes, and eyebrows in the structure information .
人の顔画像の全部又は一部における各画素値と、その顔画像における人の構造情報とに基づいて、その顔画像における所定部分の領域を選定する領域選定部と、An area selection unit that selects an area of a predetermined portion in the face image based on each pixel value in all or a part of the face image of the person and structural information of the person in the face image;
前記構造情報と、前記顔画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部と、  An area changing unit that changes each pixel value in all or a part of the area based on the structure information and color information obtained from at least one pixel value in the face image;
前記顔画像における少なくとも1つの画素の色情報に基づいて、前記領域内の各画素値に所定の不規則なゆらぎ成分を付加するゆらぎ生成部とを備えたことを特徴とする画像処理装置。  An image processing apparatus comprising: a fluctuation generating unit that adds a predetermined irregular fluctuation component to each pixel value in the area based on color information of at least one pixel in the face image.
人の顔画像の全部又は一部における各画素値と、その顔画像における人の構造情報とに基づいて、その顔画像における所定部分の領域を選定する領域選定部と、An area selection unit that selects an area of a predetermined portion in the face image based on each pixel value in all or a part of the face image of the person and structural information of the person in the face image;
前記構造情報と、前記顔画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部とを備え、  An area changing unit that changes each pixel value in all or a part of the area based on the structure information and color information obtained from at least one pixel value in the face image,
前記領域選定部は、前記顔画像における頭髪及び影部分を前記領域に選定することを特徴とする画像処理装置。  The image processing apparatus, wherein the region selecting unit selects a hair and a shadow portion in the face image as the region.
人の画像の全部又は一部における各画素値と、その画像における人の構造情報とに基づいて、その画像における所定部分の領域を選定する領域選定部と、An area selection unit that selects an area of a predetermined portion in the image based on each pixel value in all or a part of the image of the person and the structural information of the person in the image;
前記構造情報と、前記領域選定部により選定された前記領域の外周近傍の前記画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記領域の全部又は一部における各画素値を変更する領域変更部と  Changing each pixel value in all or a part of the region based on the structure information and color information obtained from at least one pixel value in the image near the outer periphery of the region selected by the region selection unit Area change part to do
を備えたことを特徴とする画像処理装置。An image processing apparatus comprising:
前記構造情報は、人の顔の表面に対する情報である顔表面モデルの情報である請求項記載の画像処理装置。The image processing apparatus according to claim 3 , wherein the structural information is information on a face surface model that is information on a human face surface. 前記領域選定部は、前記顔画像における各画素の明度に基づいて、頭髪及び影部分を前記領域に選定することを特徴とする請求項記載の画像処理装置。The image processing apparatus according to claim 3 , wherein the region selecting unit selects a hair and a shadow portion as the region based on the brightness of each pixel in the face image. 前記領域選定部は、前記顔画像における各画素の明度と彩度に基づいて、頭髪と影部分とを前記領域に選定することを特徴とする請求項記載の画像処理装置。The image processing apparatus according to claim 3 , wherein the region selecting unit selects a hair and a shadow portion as the region based on brightness and saturation of each pixel in the face image. 前記画像処理装置は、前記顔画像に基づいて、前記構造情報からなる顔表面モデルを生成する顔表面モデル生成部を更に備えたことを特徴とする請求項記載の画像処理装置。The image processing apparatus according to claim 3 , wherein the image processing apparatus further includes a face surface model generation unit that generates a face surface model including the structure information based on the face image. 前記構造情報は、人の顔の表面に対する情報である顔表面モデルの情報である請求項記載の画像処理装置。The image processing apparatus according to claim 4 , wherein the structural information is information on a face surface model that is information on a human face surface. 前記領域選定部は、前記顔画像における各画素の明度に基づいて、頭髪及び影部分を前記領域に選定することを特徴とする請求項記載の画像処理装置。The image processing apparatus according to claim 4 , wherein the region selecting unit selects a hair and a shadow portion as the region based on the brightness of each pixel in the face image. 前記領域選定部は、前記顔画像における各画素の明度と彩度に基づいて、頭髪と影部分とを前記領域に選定することを特徴とする請求項記載の画像処理装置。The image processing apparatus according to claim 4 , wherein the region selection unit selects a hair and a shadow portion as the region based on brightness and saturation of each pixel in the face image. 前記画像処理装置は、前記顔画像に基づいて、前記構造情報からなる顔表面モデルを生成する顔表面モデル生成部を更に備えたことを特徴とする請求項記載の画像処理装置。The image processing apparatus according to claim 4 , wherein the image processing apparatus further includes a face surface model generation unit configured to generate a face surface model including the structural information based on the face image. 人の画像における構造情報と、別人の画像である参照画像における構造情報とに基づいて、前記別人の画像の所定部分が、前記人の画像に適合するように、前記参照画像に所定の変換を適用する画像調整部と、
前記所定の変換が適用された参照画像における所定部分を前記人の画像に割り付ける合成処理部と
を備えたことを特徴とする画像処理装置。
Based on the structural information in the image of the person and the structural information in the reference image that is an image of another person, a predetermined conversion of the reference image is performed so that a predetermined portion of the image of the other person matches the image of the person. An image adjustment unit to be applied;
An image processing apparatus, comprising: a synthesis processing unit that allocates a predetermined portion of the reference image to which the predetermined conversion has been applied to the image of the person.
前記合成処理部は、前記参照画像における画素の属性情報を用いて、前記参照画像における所定部分を前記人の画像に割り付けることを特徴とする請求項13記載の画像処理装置。14. The image processing apparatus according to claim 13, wherein the combining processing unit assigns a predetermined portion in the reference image to the image of the person using attribute information of pixels in the reference image. 前記画像調整部は、前記参照画像における画素の属性情報に所定の変換を適用するとともに、
前記合成処理部は、その所定の変換が適用された属性情報に従って、前記参照画像における所定部分を前記人の画像に割り付けることを特徴とする請求項14記載の画像処理装置。
The image adjustment unit, while applying a predetermined conversion to the attribute information of the pixel in the reference image,
15. The image processing apparatus according to claim 14, wherein the composition processing unit allocates a predetermined portion in the reference image to the image of the person according to the attribute information to which the predetermined conversion has been applied.
前記参照画像は、別人の頭髪、髭、耳、首、装飾品、衣類の少なくとも1つである請求項13から15のいずれかに記載の画像処理装置。The image processing apparatus according to claim 13, wherein the reference image is at least one of a hair, a beard, an ear, a neck, an ornament, and clothing of another person. 前記人の画像は、その人の顔画像であり、
前記構造情報は、前記人の顔の表面に対する構造情報であり、
前記参照画像は、頭髪を有する前記別人の顔の画像である頭髪画像であり、
前記別人の構造情報は、前記頭髪画像における前記別人の顔の表面に対する構造情報を示すものであり、
前記所定部分は、頭髪又はその頭髪による影である頭髪部分であり、
前記属性情報は、前記頭髪画像における各画素の属性をその画素に対応させて保持している髪情報であり、
前記画像調整部は、前記髪情報と前記頭髪画像とに前記所定の変換を適用する頭髪画像調整部であり、
前記合成処理部は、前記所定の変換が適用された髪情報に従って、前記所定の変換が適用された頭髪画像における頭髪部分を前記顔画像に割り付ける頭髪合成処理部であることを特徴とする請求項13から16のいずれかに記載の画像処理装置。
The image of the person is a face image of the person,
The structural information is structural information for a surface of the human face,
The reference image is a hair image which is an image of the face of the different person having hair,
The other person's structure information indicates structure information for the surface of the other person's face in the hair image,
The predetermined portion is a hair portion which is a hair or a shadow of the hair,
The attribute information is hair information that holds an attribute of each pixel in the hair image in association with the pixel,
The image adjustment unit is a hair image adjustment unit that applies the predetermined conversion to the hair information and the hair image,
The hair synthesis processing section, wherein the synthesis processing section is a hair synthesis processing section that allocates a hair portion in the hair image to which the predetermined conversion has been applied to the face image according to the hair information to which the predetermined conversion has been applied. 17. The image processing device according to any one of 13 to 16.
前記画像調整部は、前記人の構造情報における目、鼻、口及び眉の全部又は一部と頭輪郭との情報と、前記別人の構造情報における目、鼻、口及び眉の全部又は一部と頭輪郭との情報とを利用して、前記参照画像と前記参照画像の属性情報とに前記所定の変換を適用することを特徴とする請求項13から17のいずれかに記載の画像処理装置。The image adjustment unit includes information on all or a part of the eyes, nose, mouth, and eyebrows and the head contour in the structural information of the person, and all or a part of the eyes, nose, mouth, and eyebrows in the structural information of the different person. The image processing apparatus according to any one of claims 13 to 17, wherein the predetermined conversion is applied to the reference image and attribute information of the reference image using information on a head contour. . 前記合成処理部は、
前記参照画像の属性情報の各画素の属性に従って、その属性の画素に対応する前記参照画像の画素値を用いて、又は前記属性の画素に対応する、前記参照画像の画素値と前記人の顔画像の画素値とを用いて、前記人の顔画像に割り付ける前記頭髪部分の各画素値を生成する生成部と、
その生成部により生成された参照画像の所定部分の各画素値を前記人の顔画像に割り付けるマッピング処理部と
を備えたことを特徴とする請求項17又は18に記載の画像処理装置。
The synthesis processing unit includes:
According to the attribute of each pixel of the attribute information of the reference image, using the pixel value of the reference image corresponding to the pixel of the attribute, or corresponding to the pixel of the attribute, the pixel value of the reference image and the face of the person Using a pixel value of the image, a generating unit that generates each pixel value of the hair portion to be allocated to the human face image,
19. The image processing apparatus according to claim 17, further comprising: a mapping processing unit that assigns each pixel value of a predetermined portion of the reference image generated by the generation unit to the human face image.
前記画像処理装置は、前記マッピング処理部により参照画像の所定部分が割り付けられた人の顔画像を修正する合成画像修正部を更に備えたことを特徴とする請求項19記載の画像処理装置。20. The image processing apparatus according to claim 19, wherein the image processing apparatus further includes a composite image correction unit that corrects a human face image to which a predetermined part of a reference image is allocated by the mapping processing unit. 前記生成部は、
前記属性に従って、その属性の画素に対応する、前記参照画像の画素値又は前記参照画像の画素値及び前記人の顔画像の画素値を用いて、色相を生成する色相合成部と、
前記属性に従って、その属性の画素に対応する、前記参照画像の画素値又は前記参照画像の画素値及び前記人の顔画像の画素値を用いて、明度を生成する明度合成部と、
前記属性に従って、その属性の画素に対応する、前記参照画像の画素値又は前記参照画像の画素値及び前記人の顔画像の画素値を用いて、彩度を生成する彩度合成部との少なくとも1つを備えたことを特徴とする請求項19記載の画像処理装置。
The generation unit includes:
According to the attribute, corresponding to the pixel of the attribute, using the pixel value of the reference image or the pixel value of the reference image and the pixel value of the human face image, a hue synthesis unit that generates a hue,
According to the attribute, corresponding to the pixel of the attribute, using a pixel value of the reference image or a pixel value of the reference image and a pixel value of the human face image, a brightness synthesis unit that generates brightness,
According to the attribute, at least a saturation synthesis unit that generates saturation using the pixel value of the reference image or the pixel value of the reference image and the pixel value of the human face image corresponding to the pixel of the attribute. 20. The image processing apparatus according to claim 19, comprising one.
前記画像処理装置は、前記人の顔画像に基づいて、前記構造情報からなる顔表面モデルを生成する顔表面モデル生成部を更に備えたことを特徴とする請求項17から20のいずれかに記載の画像処理装置。21. The image processing apparatus according to claim 17, further comprising a face surface model generation unit configured to generate a face surface model including the structure information based on the human face image. Image processing device. 人の画像の全部又は一部における各画素値と、その画像における人の構造情報とに基づいて、その画像における所定部分の領域を選定する領域選定部と、
前記構造情報と、前記画像における少なくとも1つの画素値とに基づいて、前記所定部分の領域の全部又は一部における画素値の各々を変更する領域変更部と、
前記構造情報と、別人の画像である参照画像におけるその別人の構造情報とに基づいて、前記別人の所定部分が前記画像に適合するように、その人の画素に対応させて保持している属性情報に基づいて、前記参照画像における各画素の属性とその参照画像とに所定の変換を適用する画像調整部と、
その所定の変換が適用された属性情報に従って、前記所定の変換が適用された参照画像における所定部分を前記画像に割り付ける合成処理部と
を備えたことを特徴とする画像処理装置。
An area selection unit that selects an area of a predetermined portion in the image based on each pixel value in all or a part of the image of the person and the structural information of the person in the image;
An area changing unit that changes each of the pixel values in all or a part of the area of the predetermined part based on the structure information and at least one pixel value in the image;
The attribute held in association with the pixel of the other person based on the structure information and the structure information of the different person in the reference image that is another person's image so that the predetermined part of the different person fits the image. Based on the information, an image adjustment unit that applies a predetermined conversion to the attribute of each pixel in the reference image and the reference image,
An image processing apparatus, comprising: a synthesis processing unit that allocates a predetermined portion of a reference image to which the predetermined conversion has been applied to the image according to the attribute information to which the predetermined conversion has been applied.
顔の画像である顔画像の全部又は一部における各画素値と、その顔画像における顔の表面に対する構造情報を示す顔表面モデルとに基づいて、その顔画像における頭髪又は頭髪及びその頭髪による影を除去領域に選定する髪領域選定部と、
前記顔表面モデルにおける構造情報と、前記顔画像における少なくとも1つの画素値から得られる色情報とに基づいて、前記除去領域の全部又は一部における各画素値を変更する除去領域変更部と、
前記顔表面モデルと、頭髪を有する別の顔の画像である頭髪画像におけるその別の顔の表面に対する構造情報を示す顔情報モデルとに基づいて、前記別人の頭髪又はその頭髪及びその頭髪による影である頭髪部分が、前記顔画像に適合するように、前記頭髪画像の画素の各々に対する属性をその画素に対応させて保持している髪情報とその頭髪画像とに所定の変換を適用する頭髪画像調整部と、
前記所定の変換が適用された髪情報に従って、前記所定の変換が適用された頭髪画像における頭髪部分を前記顔画像に割り付ける頭髪合成処理部と
を備えたことを特徴とする画像処理装置。
Based on each pixel value in all or a part of the face image, which is a face image, and a face surface model showing structural information on the surface of the face in the face image, the hair in the face image or the hair and the shadow of the hair. A hair region selection unit for selecting a hair removal region;
A removal area changing unit that changes each pixel value in all or a part of the removal area based on structure information in the face surface model and color information obtained from at least one pixel value in the face image;
Based on the face surface model and a face information model indicating structural information on the surface of another face in a hair image that is an image of another face having hair, the hair of the different person or the hair and the shadow by the hair A hair part which applies a predetermined transformation to hair information and an attribute of the hair image which hold an attribute for each pixel of the hair image corresponding to the pixel so that the hair part conforms to the face image. An image adjustment unit,
An image processing apparatus, comprising: a hair synthesis processing unit that allocates a hair portion in a hair image to which the predetermined conversion has been applied to the face image according to the hair information to which the predetermined conversion has been applied.
前記画像処理装置は、前記合成処理部により参照画像の所定部分が割り付けられた顔画像を複数表示する画像表示部を更に備えたことを特徴とする請求項13から23のいずれかに記載の画像処理装置。The image according to any one of claims 13 to 23, wherein the image processing device further includes an image display unit that displays a plurality of face images to which a predetermined portion of a reference image is allocated by the combining processing unit. Processing equipment. 人の画像の全部又は一部における各画素値と、その画像における人の構造情報とに基づいて、その画像における所定部分の領域を選定する領域選定部と、
前記構造情報と、前記画像における少なくとも1つの画素値とに基づいて、前記所定部分の領域の全部又は一部における画素値の各々を変更する領域変更部と、
前記構造情報と、別人の画像である参照画像におけるその別人の構造情報に基づいて、前記別人の所定部分が前記人の画像に適合するように、前記参照画像に所定の変換を行う画像調整部と、
前記所定の変換が行われた参照画像における所定部分を前記人の画像に割り付ける合成処理部と
を備えたことを特徴とする画像処理装置。
An area selection unit that selects an area of a predetermined portion in the image based on each pixel value in all or a part of the image of the person and the structural information of the person in the image;
An area changing unit that changes each of the pixel values in all or a part of the area of the predetermined part based on the structure information and at least one pixel value in the image;
An image adjustment unit that performs a predetermined conversion on the reference image based on the structural information and the structural information of the different person in the reference image that is another person's image so that the predetermined part of the different person matches the image of the different person. When,
An image processing apparatus, comprising: a synthesis processing unit that allocates a predetermined portion of the reference image that has undergone the predetermined conversion to the human image.
JP1673096A 1995-02-02 1996-02-01 Image processing device Expired - Fee Related JP3577154B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1673096A JP3577154B2 (en) 1995-02-02 1996-02-01 Image processing device

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP1614395 1995-02-02
JP7337195 1995-03-30
JP7-73371 1995-03-30
JP7-16143 1995-03-30
JP1673096A JP3577154B2 (en) 1995-02-02 1996-02-01 Image processing device

Publications (2)

Publication Number Publication Date
JPH08329278A JPH08329278A (en) 1996-12-13
JP3577154B2 true JP3577154B2 (en) 2004-10-13

Family

ID=27281264

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1673096A Expired - Fee Related JP3577154B2 (en) 1995-02-02 1996-02-01 Image processing device

Country Status (1)

Country Link
JP (1) JP3577154B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100747561B1 (en) * 2001-04-06 2007-08-08 엘지전자 주식회사 Apparatus for offering additional service in digital TV
JP4449723B2 (en) 2004-12-08 2010-04-14 ソニー株式会社 Image processing apparatus, image processing method, and program
JP5290585B2 (en) * 2008-01-17 2013-09-18 株式会社 資生堂 Skin color evaluation method, skin color evaluation device, skin color evaluation program, and recording medium on which the program is recorded
JP2009211148A (en) * 2008-02-29 2009-09-17 Secom Co Ltd Face image processor
JP6467994B2 (en) * 2015-02-27 2019-02-13 富士通株式会社 Image processing program, image processing apparatus, and image processing method
JP6458569B2 (en) 2015-03-12 2019-01-30 オムロン株式会社 Image processing apparatus and image processing method
CN111597928A (en) * 2020-04-29 2020-08-28 深圳市商汤智能传感科技有限公司 Three-dimensional model processing method and device, electronic device and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04143869A (en) * 1990-10-04 1992-05-18 Fuji Photo Film Co Ltd Picture processing method
JPH04256185A (en) * 1991-02-08 1992-09-10 Nippon Telegr & Teleph Corp <Ntt> Method for collecting sample picture of picture recognition system
JP2940226B2 (en) * 1991-06-20 1999-08-25 三菱電機株式会社 Image synthesis device
JPH06342460A (en) * 1991-06-27 1994-12-13 Shoichi Asai Preparing method for portrait
JPH05153581A (en) * 1991-12-02 1993-06-18 Seiko Epson Corp Face picture coding system
JPH0652289A (en) * 1992-07-28 1994-02-25 Matsushita Electric Ind Co Ltd Picture processor

Also Published As

Publication number Publication date
JPH08329278A (en) 1996-12-13

Similar Documents

Publication Publication Date Title
EP0725364B1 (en) Image processing apparatus
US11423556B2 (en) Methods and systems to modify two dimensional facial images in a video to generate, in real-time, facial images that appear three dimensional
JP3799633B2 (en) Face image processing method and face image processing apparatus
JP5463866B2 (en) Image processing apparatus, image processing method, and program
EP0883090B1 (en) Method for generating photo-realistic animated characters
KR101190686B1 (en) Image processing apparatus, image processing method, and computer readable recording medium
KR100327541B1 (en) 3D facial modeling system and modeling method
JP3639476B2 (en) Image processing apparatus, image processing method, and recording medium recording image processing program
WO2005073909A1 (en) Makeup simulation program, makeup simulation device, and makeup simulation method
JP2010507854A (en) Method and apparatus for virtual simulation of video image sequence
CN106652037B (en) Face mapping processing method and device
JP3577154B2 (en) Image processing device
JP3444148B2 (en) Eyebrow drawing method
KR20010084996A (en) Method for generating 3 dimension avatar using one face image and vending machine with the same
JP2000155836A (en) Portrait picture formation system and its method
WO2009036554A1 (en) Emulating cosmetic facial treatments with digital images
JP3951061B2 (en) Face image processing method and face image processing apparatus
JP2003030684A (en) Face three-dimensional computer graphic generation method and device, face three-dimensional computer graphic generation program and storage medium storing face three-dimensional computer graphic generation program
JP2004054759A (en) Facial expression deforming device, method and program
JP3915844B2 (en) Face image processing method and face image processing apparatus
JPH04199474A (en) Face picture synthetic device
KR20010102873A (en) Method and system for generating an avatar of real-picture using finite image templates
JP2001209814A (en) Image processor
JP3876922B2 (en) Face image processing method and face image processing apparatus
JPH10222649A (en) Device for composite picture

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040309

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040419

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040709

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20070716

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20080716

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090716

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090716

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100716

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110716

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110716

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120716

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120716

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130716

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees