JP7057086B2 - Image processing equipment, image processing methods, and programs - Google Patents
Image processing equipment, image processing methods, and programs Download PDFInfo
- Publication number
- JP7057086B2 JP7057086B2 JP2017186335A JP2017186335A JP7057086B2 JP 7057086 B2 JP7057086 B2 JP 7057086B2 JP 2017186335 A JP2017186335 A JP 2017186335A JP 2017186335 A JP2017186335 A JP 2017186335A JP 7057086 B2 JP7057086 B2 JP 7057086B2
- Authority
- JP
- Japan
- Prior art keywords
- subject
- image data
- normal
- information
- normal information
- 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.)
- Active
Links
Images
Description
本発明は、画像処理装置、画像処理方法、及びプログラムに関する。 The present invention relates to an image processing apparatus, an image processing method, and a program.
人物を対象とした写真撮影において、顔の向きや構図、ライティング等は、被写体の印象を決める大きな要因の一つである。そのため、これらの撮影条件を写真撮影後に調整することで、被写体を補正することが行われている。例えば、特許文献1には、顔の立体形状を表す顔立体形状テンプレートより生成される顔モデルを用いて、被写体を補正する画像処理装置が開示されている。
Face orientation, composition, lighting, etc. are one of the major factors that determine the impression of a subject in photography of a person. Therefore, the subject is corrected by adjusting these shooting conditions after taking a picture. For example,
この特許文献1の画像処理装置では、画像データから検出した顔情報(即ち、顔位置情報、顔の大きさ情報、顔部品情報、及び顔方向情報)に基づいて、顔立体形状テンプレートを変形させて被写体の顔モデルを生成している。また、特許文献1の画像処理装置では、検出された顔部品情報や顔の大きさ情報等に基づいて顔の立体形状を推定し、複数の顔立体形状テンプレートから被写体に適した顔立体形状テンプレートを選択している。これにより、顔の個人差や顔の向き等による見た目の違いに応じて、顔立体形状テンプレートを選択することを可能としている。
In the image processing apparatus of
しかしながら、特許文献1の画像処理装置のように、少なくとも被写体距離を考慮することなく、顔立体形状テンプレートを選択する場合、被写体距離が変化すると、被写体の見た目とは異なる顔立体形状テンプレートが選択される可能性がある。そして、これにより、顔モデルも被写体と似つかないように生成され、結果、その顔モデルを用いて補正された被写体は不自然なものとして生成される。
However, when a face three-dimensional shape template is selected without considering at least the subject distance as in the image processing device of
本発明は、前記従来の問題に鑑みてなされたものであって、その目的は、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような画像を生成することである。 The present invention has been made in view of the above-mentioned conventional problems, and an object thereof is to generate an image as if it was taken under desired lighting conditions from a captured image even if the subject distance changes. Is.
上記目的を達成するために、本発明の画像処理装置は、被写体を含むシーンを撮像することにより得られる画像データを取得する画像取得手段と、前記シーンを撮像した撮像装置から前記被写体までの距離情報を取得する第一の取得手段と、前記被写体に関連する所定の特徴パターンに対応する法線情報を記憶する記憶手段と、前記距離情報と前記記憶手段が記憶する前記法線情報に基づき、前記画像データに対するライティング処理に適用する法線情報を生成する生成手段と、前記生成手段が生成した前記法線情報を用いて、前記画像データに対して、ライティング処理を実行するライティング処理手段とを備え、前記記憶手段は、所定の特徴パターンに対応する法線情報を前記撮像装置から前記被写体までの距離に応じて、複数、記憶し、前記生成手段は、前記記憶手段が記憶する複数の法線情報から前記距離情報に基づいて選択した法線情報を用いて、前記ライティング処理に適用する法線情報を生成する。 In order to achieve the above object, the image processing device of the present invention has an image acquisition means for acquiring image data obtained by capturing a scene including a subject, and a distance from the image pickup device that has captured the scene to the subject. Based on the first acquisition means for acquiring information, the storage means for storing normal information corresponding to a predetermined feature pattern related to the subject, and the distance information and the normal information stored in the storage means. A generation means for generating normal information applied to the lighting process for the image data, and a lighting processing means for executing the lighting process for the image data using the normal information generated by the generation means. The storage means stores a plurality of normal information corresponding to a predetermined feature pattern according to the distance from the image pickup device to the subject, and the generation means stores a plurality of methods stored by the storage means. Using the normal information selected from the line information based on the distance information, the normal information to be applied to the lighting process is generated .
本発明によれば、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような画像を生成することができる。 According to the present invention, even if the subject distance changes, it is possible to generate an image as if it was taken under desired lighting conditions from the captured image.
(撮像装置の外観)
図1は、実施形態に係る画像処理装置を備えた撮像装置の外観を示す図であり、図1(a)は撮像装置の前面、図1(b)は背面の外観を各々、示している。撮像装置101は、光学部102、撮像ボタン103、ストロボ104、距離画像取得部105、表示部106、及び操作ボタン107を備える。
(Appearance of image pickup device)
1A and 1B are views showing the appearance of an image pickup apparatus including the image processing apparatus according to the embodiment, FIG. 1A shows the appearance of the front surface of the image pickup apparatus, and FIG. 1B shows the appearance of the back surface. .. The
光学部102は、ズームレンズ、フォーカスレンズ、ブレ補正レンズ、絞り、及びシャッターによって構成される鏡筒であり、被写体の光情報を集光する。撮像ボタン103は、ユーザが撮像の開始を撮像装置101に指示するためのボタンである。ストロボ104は、ユーザの指示に従って、撮像の開始に合わせて発光させることが可能な照明である。
The
距離画像取得部105は、距離情報として、撮像指示に応じて撮像したシーンにおける被写体の距離画像データを取得する。ここで、距離画像データとは、画像の各画素の画素値として、その画素に対応する被写体距離を格納した画像データのことである。距離画像取得部105は、赤外光を発光する赤外発光部と、被写体に反射した赤外光を受光する受光部とを備える。距離画像取得部105は、赤外発光部において発光した赤外光が被写体に反射し、受光部が受光するまでの時間に基づいて、撮像装置から被写体までの距離値を算出する。そして、算出した距離値と受光部のセンサ画素数や画角等を含む距離撮像情報に基づいて、被写体の位置情報を算出し、距離画像データを生成する。なお、距離画像データの取得方法は、必ずしもこれに限られない。したがって、例えば、距離画像取得部105の代わりに光学部102と同様の光学系を設け、異なる2つの視点から撮像された画像データ間の視差に基づいて、三角測量を行うことにより距離画像データを取得することもできる。
The distance
表示部106は、撮像装置101にて処理された画像データや他の各種データを表示する、液晶ディスプレイ等の表示装置である。なお、図1に示すように、撮像装置101は光学ファインダを備えていないので、フレーミング操作(ピントや構図の確認)は表示部106を用いて行われる。即ち、撮像装置101に関して、表示部106においてライブビュー画像を確認しながら撮像が行われるので、フレーミングやフォーカシングの操作が行われるとき、表示部106は、電子ファインダとしても機能する。その他、表示部106では、カメラ設定メニュー等も表示する。
The
操作ボタン107は、撮像装置101の動作モードの切り換え操作や、撮像時の各種パラメータ等をユーザが撮像装置101に指示するためのボタンである。なお、撮像装置101は、動作モードの一つとして、撮像された画像における照明の当たり具合を撮像後に補正するライティング処理モードを備える。そのため、ユーザは、操作ボタン107又は撮像ボタン103を用いて、ライティング処理モードへの切り替え、ライティング処理に用いる仮想照明の照明パラメータの設定、さらに照明の当たり具合を調整(補正)する被写体の選択等を行うことができる。また、ユーザは補正された画像データを出力する際に、距離画像データを出力するか否か等の指示をすることもできる。その他、表示部106は、タッチスクリーン機能を備えていてもよく、その場合、タッチスクリーンを用いたユーザ指示を操作ボタン107の入力として扱うことも可能である。
The
(撮像装置の内部構成)
図2は、実施形態に係る画像処理装置を備えた撮像装置の内部構成を示すブロック図である。CPU201は、各構成の処理の全てに関わり、ROM(Read Only Memory)202や、RAM(Random Access Memory)203に格納された命令を順に読み込み、解釈することで処理を実行する。
(Internal configuration of image pickup device)
FIG. 2 is a block diagram showing an internal configuration of an image pickup apparatus including the image processing apparatus according to the embodiment. The
ROM202は、CPU201により実行されるプログラムを記憶する。なお、本実施形態において、ROM202は、複数の顔モデル法線情報及び領域別顔モデル法線情報を格納するものとする。顔モデル法線情報は、所定の形状の顔(顔モデル)に対応する、顔表面の法線ベクトルを画素値に格納した顔モデル法線画像データと、顔モデル法線画像データにおける目・鼻・口等の器官位置を示す顔モデル法線器官位置とを含む。また、領域別顔モデル法線情報は、顔輪郭・目・鼻・口等の領域に対応する法線ベクトルを画素値に格納した領域別顔モデル法線画像データと、領域別顔モデル法線画像データにおける器官位置を示す領域別顔モデル法線器官位置とを含む。RAM203は、CPU201により実行されるプログラムを記憶する。
The
光学系制御部204は、光学部102に対して、フォーカスを合わせる、シャッターを開く、絞りを調整する等のCPU201から指示された制御を行う制御回路である。また、光学系制御部204は、光学系の状態等に基づいて、フォーカスを合わせた被写体までの距離を取得し、RAM203等に記憶することができる。
The optical
制御部205は、撮像ボタン103や操作ボタン107からのユーザ指示を受け取り、撮像モード、ライティング処理モード等への切り換え、被写体領域の選択、照明パラメータの設定等の制御を行う制御回路である。カラー撮像素子部206は、光学部102にて集光された光情報を電流値に変換する撮像素子である。カラー撮像素子部206は、ベイヤ配列等の所定の配列を有するカラーフィルタを備え、光学部102において集光された光から被写体の色情報を取得する。
The
A/D変換部207は、カラー撮像素子部206において検知された被写体の色情報をデジタル信号値に変換し、RAW画像データとする処理回路である。なお、本実施形態では、同時刻に撮像した距離画像データとRAW画像データを取得できるものとする。画像処理部208は、A/D変換部207で取得されたRAW画像データに対して現像処理を行い、カラー画像データを生成する。また、画像処理部208は、カラー画像データや距離画像データを用いて、カラー画像データにライティング処理を施した補正画像データを生成する等の各種画像処理を実行する。なお、画像処理部208の内部構成及び機能は、後述の図3を用いて詳述する。
The A /
キャラクタージェネレーション部209は、文字やグラフィック等を生成する処理回路である。キャラクタージェネレーション部209により生成された文字やグラフィックは、表示部106において、画像データや補正画像データ等に重畳して表示される。エンコーダ部210は、画像処理部208において処理されたカラー画像データやライティング処理によって生成される補正画像データを含む各種画像データをJpeg等のファイルフォーマットに変換する。
The
メディアI/F211は、PC/メディア213(例えば、ハードディスク、メモリカード、CFカード、SDカード等)に、画像データを送受信するためのインタフェースである。メディアI/F211としては、例えば、USB(Universal Serial Bus)等が用いられる。システムバス212は、データを送受信するためのバスである。
The media I / F211 is an interface for transmitting / receiving image data to / from a PC / media 213 (for example, a hard disk, a memory card, a CF card, an SD card, etc.). As the media I / F211th, for example, USB (Universal Serial Bus) or the like is used. The
(画像処理部の内部構成)
図3は、実施形態に係る画像処理装置(画像処理部208)の機能構成を示すブロック図である。現像処理部301は、A/D変換部207から取得したRAW画像データに対して、ホワイトバランス処理、デモザイク処理、ノイズリダクション処理、色変換処理等を施し、カラー画像データを生成する。なお、撮像装置101は、現像処理部301において生成されたカラー画像データを表示部106に出力して表示することや、RAM203、PC/メディア213等の記憶装置に記憶することができる。
(Internal configuration of image processing unit)
FIG. 3 is a block diagram showing a functional configuration of the image processing apparatus (image processing unit 208) according to the embodiment. The
顔検出部302は、現像処理部301より取得したカラー画像データから被写体の顔情報を取得する。なお、被写体の顔情報には、カラー画像データにおいて被写体の顔が占める領域を示す顔領域と、顔に含まれる目や口等のカラー画像データにおける位置を示す器官位置とに関する情報が少なくとも含まれる。
The
顔モデル法線情報取得部303は、被写体までの距離情報に基づいて、複数の顔モデル法線情報から被写体に合う法線情報を選択する。本実施形態では、顔検出部302から取得した顔情報と距離画像取得部105から取得した距離画像データに基づいて、ROM202から顔モデル法線情報を選択する。
The face model normal
法線生成部304は、顔検出部302から顔情報、顔モデル法線情報取得部303から顔モデル法線情報、距離画像取得部105から距離画像データを各々、取得すると、それらの情報に基づいて、カラー画像データに対応する法線画像データを生成する。
When the normal
照明パラメータ設定部305は、制御部205から受け渡されるユーザ操作(指示)に基づいて、照明パラメータを設定する。なお、本実施形態における照明パラメータは、照明の位置、姿勢、強度、光源色等を含む。ライティング処理部306は、距離画像取得部105から距離画像データ、法線生成部304から法線画像データ、照明パラメータ設定部305から照明パラメータを各々、取得し、それらのデータに基づいて、カラー画像データにライティング処理を実行する。なお、撮像装置101では、ライティング処理により補正された補正画像データを、RAM203やPC/メディア213等の記憶装置に出力し、記憶することや、表示部106に出力して表示することができる。
The lighting
(画像処理部の処理フロー)
図4は、実施形態に係る画像処理装置(画像処理部208)における処理の手順を示すフローチャートである。図4のフローチャートに示す処理において、画像処理部208は、先ず、カラー画像データから取得した顔情報と距離画像データに基づいて、顔モデル法線情報を選択する。画像処理部208は、次に、顔情報、顔モデル法線情報、及び距離画像データに基づいて、カラー画像データに対応する法線画像データを生成する。画像処理部208は、さらに、ユーザにより設定された照明パラメータ、距離画像データ及び法線画像データに基づいて、カラー画像データに仮想照明を付加するライティング処理を実行し、補正画像データを生成する。
(Processing flow of image processing unit)
FIG. 4 is a flowchart showing a processing procedure in the image processing apparatus (image processing unit 208) according to the embodiment. In the process shown in the flowchart of FIG. 4, the
以下、画像処理部208の処理手順に関して、詳述する。現像処理部301は、A/D変換部207より取得したRAW画像データに基づいて、カラー画像データを生成する(S401)。カラー画像データは、例えば、図5(a)のように示され、また、カラー画像データ501の画素I(i,j)にはRGB値が画素値として格納されており、各々Ir(i、j)、Ig(i、j)、Ib(i、j)として示される。なお、カラー画像データの取得方法は、必ずしもこれに限られない。したがって、例えば、RAM203やPC/メディア213に記憶されているRAW画像データを取得し、現像処理部301により、その取得したRAW画像データからカラー画像データを生成することもできる。また、RAM203やPC/メディア213に記憶されているカラー画像データを直接、取得することもできる。
Hereinafter, the processing procedure of the
画像処理部208は、距離画像取得部105から距離画像データを取得する(S402)。距離画像データは、例えば、図5(b)のように示され、また、距離画像データ502の画素D(i,j)には、撮像装置から被写体までの距離値が格納されている。なお、距離画像データの取得方法は、必ずしもこれに限られない。したがって、例えば、RAM203やPC/メディア213に記憶されている距離画像データを直接、取得することもできる。
The
画像処理部208は、次に、RAM203からフラグSW1の状態を取得し、フラグSW1の状態に基づいて、ライティング処理を実行するか否かを判定する(S403)。画像処理部208は、フラグSW1がOFFの場合はライティング処理を実行しないと判定し(S403 No)、ステップS404に処理を移行する。また、フラグSW1がONの場合はラインティング処理を実行すると判定し(S403 Yes)、ステップS405に処理を移行する。
Next, the
ステップS403において、ライティング処理を実行しないと判定されると、画像処理部208は、RAM203からフラグSW2の状態を取得する。そして、画像処理部208は、フラグSW2がOFFの場合はカラー画像データのみを、フラグSW2がONの場合はカラー画像データと距離画像データをPC/メディア213に出力し、記憶する(S404)。或いは、画像処理部208は、カラー画像データを表示部106に出力し、表示させることで、ユーザが確認できるようにすることもできる。なお、画像処理部208は、ステップS404における処理を実行すると、図4に示す処理を終了する。
If it is determined in step S403 that the lighting process is not executed, the
また、ステップS403において、ライティング処理を実行すると判定されると、顔検出部302は、カラー画像データに基づいて、顔情報を検出(取得)する(S405)。ここで、顔情報に関して、図6を用いて説明する。図6に示されるように、顔情報には、顔領域601及び器官位置602が含まれる。顔領域は、画像データにおいて、顔が含まれる領域の画素の集合として示される。器官位置602は、顔領域内における目、鼻、口等に対応する座標として示される。
Further, when it is determined in step S403 that the lighting process is to be executed, the
顔領域、器官位置の検出方法については、既存のアルゴリズムを適用することができる。既存のアルゴリズムとしては、テンプレートマッチングを用いたアルゴリズムや、Haar-Like特徴量を用いたアルゴリズム等があり、本実施形態では、テンプレートマッチングを適用することで、顔領域・器官位置を検出する。 Existing algorithms can be applied to the method of detecting the facial region and organ position. As the existing algorithm, there are an algorithm using template matching, an algorithm using Haar-Like feature amount, and the like. In this embodiment, the face region / organ position is detected by applying template matching.
テンプレートマッチングを適用した検出では、先ず、カラー画像データに対して、閾値処理を実行することで、肌色の領域を顔候補領域として抽出する。次に、様々な大きさの顔画像のテンプレートを用いて、顔候補領域に対してマッチング処理を実行し、尤度を算出する。そして、その算出した尤度に基づいて、顔領域か否かの判定処理を実行し、顔領域を抽出する。器官位置についても、抽出された顔領域に対して、目、鼻、口の画像のテンプレートを用いて、同様にマッチング処理を実行し、尤度を算出する。そして、この尤度の大きさに基づいて、顔領域・器官位置の信頼度を算出する。以上の処理を実行することで、顔領域601、器官位置602を取得する。
In the detection to which the template matching is applied, first, the skin color region is extracted as the face candidate region by executing the threshold value processing on the color image data. Next, using face image templates of various sizes, matching processing is executed for the face candidate area, and the likelihood is calculated. Then, based on the calculated likelihood, a process of determining whether or not the face area is present is executed, and the face area is extracted. With regard to the organ positions, the matching process is similarly executed for the extracted face area using the eye, nose, and mouth image templates, and the likelihood is calculated. Then, the reliability of the facial region / organ position is calculated based on the magnitude of this likelihood. By executing the above processing, the
次に、顔モデル法線情報取得部303は、被写体距離に基づいて、顔モデル法線情報を取得する(S406)。なお、顔モデル法線情報取得部303における顔モデル法線情報を取得する処理に関しては、後述の図7等を用いて詳述する。
Next, the face model normal
法線生成部304は、ステップS402、S405、及びS406で各々、取得した、距離画像データ、顔情報、及び顔モデル法線情報に基づいて、ステップS401で生成されたカラー画像データに対応する法線画像データを生成する(S407)。なお、法線生成部304における法線画像データを生成する処理に関しては、後述の図9、図10等を用いて詳述する。
The
照明パラメータ設定部305は、制御部205から受け渡されるユーザ操作に基づいて、照明パラメータを設定(決定)する(S408)。ライティング処理部306は、距離画像データ、法線画像データ、及び照明パラメータに基づいて、カラー画像データに対して、カラー画像データに仮想照明(仮想的な光源)を付加する等のライティング処理を実行し、補正画像データを生成する(S409)。なお、ライティング処理部306におけるライティング処理に関しては、後述の図11等を用いて詳述する。
The lighting
ライティング処理部306は、制御部205から受け渡されるユーザ操作(即ち、ユーザからの指示)に基づいて、ライティング処理を終了するか否かを判定する(S410)。画像処理部208は、ライティング処理部306によりライティング処理を終了すると判定されると処理をステップS411に移行し、また、ライティング処理を終了しないと判定されると処理をステップS408に返し、再び照明パラメータを設定する。
The
処理がステップS411に移行されると、画像処理部208は、RAM203からフラグSW2の状態を取得し、ライティング処理部306は、その取得したフラグSW2の状態に基づいて、各種データを出力する。ライティング処理部306は、フラグSW2がOFFの場合はカラー画像データ及び補正画像データを、フラグSW2がONの場合はカラー画像データ、補正画像データ、及び距離画像データをPC/メディア213に出力し、記憶する。その後、画像処理部208は、図4に示す処理を終了する。
When the processing shifts to step S411, the
(顔モデル法線情報取得処理)
ここでは、ステップS406において、顔モデル法線情報取得部303により実行される顔モデル法線情報取得処理(即ち、距離画像データと顔情報に基づいて、顔モデル法線情報を取得する処理)について説明する。
(Face model normal information acquisition process)
Here, regarding the face model normal information acquisition process (that is, the process of acquiring the face model normal information based on the distance image data and the face information) executed by the face model normal
以下、顔モデル法線情報取得処理の手順に関して、図7を用いて詳述する。顔モデル法線情報取得部303は、先ず、顔検出部302より取得した顔情報と距離画像取得部105より取得した距離画像データに基づいて、被写体距離を算出する(S701)。なお、本実施形態では、顔領域(即ち、被写体の顔が占める領域)における距離値の平均を被写体距離とする。
Hereinafter, the procedure of the face model normal information acquisition process will be described in detail with reference to FIG. 7. The face model normal
顔モデル法線情報取得部303は、ステップS701で算出した被写体距離に基づいて、顔モデル法線情報を取得する(S702)。本実施形態では、図8に示す被写体距離に応じた複数の顔モデル法線情報から、ステップS701で算出した被写体距離に最も近い顔モデル法線情報を選択する。
The face model normal
図8は、被写体距離に応じた複数の顔モデル法線情報を例示したものである。図8において、顔モデル法線情報801、802、803は各々、0.5m、1.5m、5.0mの被写体距離に応じた顔モデル法線情報であり、これらの顔モデル法線情報はROM202に格納されている。
FIG. 8 illustrates a plurality of face model normal information according to the subject distance. In FIG. 8, the face model
顔モデル法線情報は、顔表面の法線ベクトル(即ち、被写体距離の位置から観察したときの顔表面の向き)を画素値に格納した顔モデル法線画像データと、顔モデル法線画像データにおける目・鼻・口等の器官位置を示す顔モデル法線器官位置とを含む。なお、顔モデル法線画像データにおける顔領域以外の領域における画素(即ち、背景画素)には、背景画素を示す画素値を格納するものとする。 The face model normal information includes face model normal image data in which the normal vector of the face surface (that is, the orientation of the face surface when observed from the position of the subject distance) is stored in pixel values, and face model normal image data. Includes the face model normal organ position indicating the position of organs such as eyes, nose, and mouth in. It should be noted that the pixel value indicating the background pixel is stored in the pixel (that is, the background pixel) in the region other than the face region in the face model normal image data.
図8に示されるように、正面顔の場合、被写体距離が短いほど目・口等の器官位置が中心から離れ(即ち、顔輪郭に近付き)、被写体距離が長くなるほど目・口等の器官位置が顔の中央に寄ったような見た目となる。このように、被写体距離によって、顔輪郭と目、鼻、口等のバランスは変化し、また、器官位置の変化は、被写体距離が短いほど、大きくなる。このため、顔モデル法線情報に関して、被写体距離が短いほど、短い距離間隔で顔モデル法線情報を保持しておくことが好ましい。 As shown in FIG. 8, in the case of a frontal face, the shorter the subject distance, the farther the organ positions such as eyes and mouth are from the center (that is, closer to the facial contour), and the longer the subject distance, the more the organ positions such as eyes and mouth. Looks like it's closer to the center of the face. In this way, the balance between the facial contour and the eyes, nose, mouth, etc. changes depending on the subject distance, and the change in the organ position increases as the subject distance becomes shorter. Therefore, regarding the face model normal information, it is preferable to retain the face model normal information at shorter distance intervals as the subject distance is shorter.
また、図8では、顔モデル法線情報が3つの場合を、その一例として説明したが、顔モデル法線情報の数は、これに限定されるものではない。したがって、例えば、ROM202等の容量に応じて、顔モデル法線情報の数を2つに設定しても、また4つ以上に設定してもよい。なお、顔モデル法線情報の数を多く設定すれば、撮影時の条件により適合した顔モデル法線情報を選択することができる。
Further, in FIG. 8, the case where the face model normal information is three is described as an example, but the number of face model normal information is not limited to this. Therefore, for example, the number of face model normal information may be set to two or four or more depending on the capacity of the
(法線画像データ生成処理)
ここでは、ステップS407において、法線生成部304により実行される法線画像データ生成処理(即ち、顔情報、顔モデル法線情報、及び距離画像データに基づいてカラー画像データに対応する法線画像データを生成する処理)について説明する。以下、法線画像データ生成処理の手順及び概要に関して、各々、図9及び図10を用いて詳述する。
(Normal image data generation processing)
Here, in step S407, the normal image data generation process executed by the normal generation unit 304 (that is, the normal image corresponding to the color image data based on the face information, the face model normal information, and the distance image data). The process of generating data) will be described. Hereinafter, the procedure and outline of the normal image data generation process will be described in detail with reference to FIGS. 9 and 10, respectively.
法線生成部304は、距離画像データに基づいて、被写体法線画像データを生成する(S901)。本実施形態の被写体法線画像データの生成に関して、法線生成部304は、先ず、距離画像データにおける画素の2次元的な座標値と、その画素の画素値から取得される距離値に基づいて、画素毎に3次元的な座標値を算出する。そして、法線生成部304は、次に、その算出した座標値に基づいて、各画素に対応する法線ベクトルを算出する。なお、着目画素に対応する法線ベクトルは、着目画素の近傍領域の3次元的な座標値から算出した勾配に基づいて、算出される。このようにして、法線生成部304は、被写体法線画像データ1001を生成する。
The
法線生成部304は、次に、顔情報と顔モデル法線情報に基づいて、顔法線画像データを生成する(S902)。本実施形態の顔法線画像データの生成に関して、法線生成部304は、顔情報に含まれる器官位置602と、顔モデル法線情報に含まれる顔モデル法線器官位置に基づいて、顔モデル法線画像データを変形することで、顔法線画像データ1002を生成する。なお、本実施形態では、アフィン変換を用いて、カラー画像データ501内の被写体の顔に合うように、顔モデル法線画像データを変形する。具体的には、器官位置602と顔モデル法線器官位置から最小二乗法を用いてアフィンパラメータを算出し、その算出したアフィンパラメータに基づいて顔モデル法線画像パラメータを変形することで、顔法線画像データ1002を生成する。なお、顔法線画像データにおいて顔以外の背景画素は、背景画素を示す画素値を格納するものとする。
Next, the
法線生成部304は、被写体法線画像データ1001と顔法線画像データ1002を生成すると、それらを統合し、さらに平滑化することで、法線画像データを生成する(S903)。具体的には、先ず、顔法線画像データ1002の顔領域以外の領域における画素(即ち、背景画素)は被写体法線画像データ1001の画素値、それ以外の画素は顔法線画像データ1002の画素値となるように、画像データを統合する。即ち、統合法線画像データ1003を生成する。法線生成部304は、次に、生成した統合法線画像データ1003に対して、平滑化処理を実行することで、法線画像データ1004を生成する。なお、本実施形態では、カラー画像データ501を参照画像として、統合法線画像データ1003に平滑化処理を適用するものとする。また、この場合、例えば、カラー画像データ501を参照画像とするジョイントバイラテラルフィルタを適用すればよい。
When the normal
以上のように処理することで、法線画像データを生成することができる。なお、法線画像データを生成する処理は、必ずしも上述の処理に限定されることはない。したがって、例えば、被写体法線画像データ1001の生成を行うことなく、顔法線画像データ1002のみから法線画像データを生成することもできる。また、この場合、被写体法線画像データ1001の代わりに、全画素に適当な法線ベクトルを格納した画像データを与えればよい。
By processing as described above, normal image data can be generated. The process of generating normal image data is not necessarily limited to the above-mentioned process. Therefore, for example, it is possible to generate the normal image data only from the face
(ライティング処理)
ここでは、ステップS409において、ライティング処理部306により実行されるライティング処理について説明する。ステップS409のライティング処理は、上述のように、距離画像データ及び法線画像データに基づき、さらにユーザにより設定された照明パラメータに応じて、カラー画像データに対して仮想照明を付加し、補正画像を生成する処理である。本実施形態において、ライティング処理により生成される補正画像I’は、例えば、下式(1)に従って生成される。
(Lighting process)
Here, the lighting process executed by the
式(1)において、I’r、I’g、I’bは補正画像データI’の画素値、Lrm、Lgm、Lbmはm番目の照明の色、kmはm番目の照明に対する補正度合いを表す。さらに、m番目の照明に対する補正度合いkmは、仮想照明の位置Q、強度(照明の明るさ)α、姿勢U及び画素(x、y)に対応する距離値、法線ベクトルNに基づいて決定され、例えば、下式(2)によって算出される。なお、仮想照明の色L、位置Q、強度α、及び姿勢Uは、ユーザにより設定される照明パラメータである。また、tは仮想照明による補正度合いを調整する補正係数であり、本実施形態では1に設定する。 In the formula (1), I'r, I'g, and I'b are the pixel values of the corrected image data I', Lrm, Lgm, and Lbm are the colors of the m-th illumination, and km is the correction degree for the m-th illumination. show. Further, the correction degree km for the m-th illumination is determined based on the position Q of the virtual illumination, the intensity (brightness of the illumination) α, the distance value corresponding to the posture U and the pixels (x, y), and the normal vector N. Then, for example, it is calculated by the following equation (2). The color L, the position Q, the intensity α, and the posture U of the virtual lighting are lighting parameters set by the user. Further, t is a correction coefficient for adjusting the degree of correction by virtual lighting, and is set to 1 in the present embodiment.
以下、式(2)について、図11を用いて説明を補足する。図11において、Qは、上述のように、仮想照明の位置を示しており、Pは画素(i、j)の三次元的な位置を示すものである。なお、Pは、距離画像データ502の画素値に基づいて取得された、撮像装置101から各画素までの距離値(即ち、各画素の距離値)、撮像装置101の画角、カラー画像データ501の画像サイズ等に基づいて、算出される。また、Wは、画素(i、j)の位置Pから仮想照明の位置Qまでの距離が大きくなるに従って、大きな値を返す関数である。即ち、関数Wにより、画素(i、j)が仮想照明に近いほど、明るくなるように補正される。
Hereinafter, the description of the formula (2) will be supplemented with reference to FIG. In FIG. 11, Q indicates the position of the virtual illumination as described above, and P indicates the three-dimensional position of the pixel (i, j). In addition, P is the distance value (that is, the distance value of each pixel) from the
式(2)において、Kは、ρが小さいほど、大きな値を返す関数であり、ρは、画素(i,j)の位置Pから仮想照明の位置Qに向かうベクトルV(i,j)と、照明の姿勢Uのなす角度で示される。また、N(i,j)は画素(i、j)に対応する法線ベクトルである。加えて、式(2)の分子においてベクトルV(i,j)と法線ベクトルNの内積を含むことから、画素P(i,j)から仮想照明に向かうベクトルVと法線ベクトルNとのなす角が小さい画素ほど明るくなるように補正される。このように補正することで、例えば、図12等に示されるように、カラー画像データ501を、仮想照明により被写体を照らしたかのような補正画像1201に補正することができる。即ち、上式に示すように、ライティング処理を実行することで(補正画像を生成することで)、照明の位置と被写体の形状に応じた明るさの補正が可能となる。
In the equation (2), K is a function that returns a larger value as ρ becomes smaller, and ρ is a vector V (i, j) from the position P of the pixel (i, j) toward the position Q of the virtual illumination. , Shown by the angle formed by the lighting posture U. Further, N (i, j) is a normal vector corresponding to the pixel (i, j). In addition, since the inner product of the vector V (i, j) and the normal vector N is included in the molecule of the equation (2), the vector V toward the virtual illumination from the pixel P (i, j) and the normal vector N The smaller the angle between the pixels, the brighter the pixel. By making such corrections, for example, as shown in FIG. 12, the
以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。具体的には、撮影画像上で大きさが同程度の被写体であっても、焦点距離の長いレンズを利用して長い被写体距離で撮影した場合と、焦点距離の短いレンズを利用して短い被写体距離で撮影した場合とで、ライティング処理により、異なる効果をもたらす。 As described above, in the present invention, even if the subject distance changes, another image as if it was taken under desired lighting conditions can be generated from the captured image. Specifically, even if the subject is about the same size on the captured image, the subject is shot at a long subject distance using a lens with a long focal length, and the subject is short using a lens with a short focal length. The lighting process produces different effects depending on whether the image was taken at a distance.
なお、本実施形態では、顔法線情報に関して、顔検出部302から取得した顔情報及び距離画像取得部105から取得した距離画像データに基づいて、ROM202から取得する仕様として説明したが、距離画像データの取得方法は必ずしもこれに限られない。したがって、例えば、ステップS701において、光学系制御部204が被写体にフォーカスを合わせたときに取得した被写体距離に基づいて、ステップS702において顔法線情報を選択することもできる。また、RAM203やPC/メディア213に記憶されているRAW画像データにタグ情報として被写体距離が含まれている場合は、ステップS701において、その被写体距離を取得して、ステップS702において顔法線情報を選択することもできる。
In the present embodiment, the face normal line information has been described as a specification acquired from the
(第2実施形態)
第1実施形態では、被写体距離に応じて、複数の顔モデル法線情報から被写体に適した顔モデル法線情報を選択したが、本実施形態(第2実施形態)では、被写体距離に応じて領域別顔モデル法線情報から顔モデル法線情報を生成する。これにより、様々な被写体距離に対応する顔モデル法線情報を取得することができる。
(Second Embodiment)
In the first embodiment, face model normal information suitable for the subject is selected from a plurality of face model normal information according to the subject distance, but in the present embodiment (second embodiment), the face model normal information is selected according to the subject distance. Generate face model normal information from area-specific face model normal information. This makes it possible to acquire face model normal information corresponding to various subject distances.
図14は、領域別顔モデル法線情報をその一例として示すものである。領域別顔モデル法線情報は、図14(a)に示す領域別顔モデル法線画像データ1401~1405と図14(b)に示す領域別顔モデル法線器官位置を含む。
FIG. 14 shows the face model normal information for each region as an example. The region-specific face model normal information includes the region-specific face model
図14(a)に示す領域別顔モデル法線画像データ1401~1405は、各々、顔概略形状、右目周辺領域、左目周辺領域、鼻周辺領域、口周辺領域における顔表面の法線ベクトルを、画素値に格納した画像データである。
The face model
また、図14(b)に示されるように、右目周辺領域、左目周辺領域、鼻周辺領域、口周辺領域に対応する領域別顔モデル法線画像データ1402~1405には、各々、器官の基準とする位置を示す器官基準位置が設定されている。即ち、領域別顔モデル法線器官位置は、顔概略形状に対応する領域別顔モデル法線画像データ1401における被写体距離に応じた器官の位置を示している。なお、図14に示す例では、0.5m、1.5m、5.0mの被写体距離に対応した領域別顔モデル法線器官位置を保持しているものとする(即ち、被写体距離毎に領域別顔モデル法線器官位置が格納される)。
Further, as shown in FIG. 14 (b), the face model
第2実施形態では、ステップS406の顔モデル法線情報の取得処理が第1実施形態と異なる。図13は、本発明の第2実施形態に係る画像処理装置(画像処理部208)における顔モデル法線情報の取得処理の手順を示すフローチャートである。 In the second embodiment, the acquisition process of the face model normal information in step S406 is different from that in the first embodiment. FIG. 13 is a flowchart showing a procedure for acquiring face model normal information in the image processing apparatus (image processing unit 208) according to the second embodiment of the present invention.
以下、顔モデル法線情報取得処理の手順に関して、図13を用いて詳述する。顔モデル法線情報取得部303は、第1実施形態のステップS701と同様に、顔検出部302より取得した顔情報と距離画像取得部105より取得した距離画像データに基づいて、被写体距離を算出する(S1301)。
Hereinafter, the procedure of the face model normal information acquisition process will be described in detail with reference to FIG. The face model normal
顔モデル法線情報取得部303は、被写体距離を算出すると、図14に示す領域別顔モデル法線器官位置に基づいて、ステップS1301で取得した被写体距離に対応する顔モデル器官位置を、所定の補間処理により算出する(S1302)。
When the face model normal
ここで、顔モデル器官位置の算出に関して、説明を補足する。取得した被写体距離をlとした場合、領域別顔モデル法線器官位置が設定された被写体距離のうち、取得した被写体距離であるlよりも小さく、またlに最も近い被写体距離lAに対応した領域別顔モデル法線器官位置の座標(xA、yA)を選択する。同様に、領域別顔モデル法線器官位置が設定された被写体距離のうち、取得した被写体距離であるlよりも大きく、またlに最も近い被写体距離lBに対応した領域別顔モデル法線器官位置の座標(xB、yB)を選択する。そして、この場合、顔モデル器官位置(x’、y’)は、下式(3)のように求めることができる。 Here, the explanation is supplemented with respect to the calculation of the facial model organ position. When the acquired subject distance is l, the region corresponding to the subject distance lA that is smaller than the acquired subject distance l and is the closest to l among the subject distances for which the face model normal organ positions for each region are set. Another face model Normal Select the coordinates of the organ position (xA, yA). Similarly, among the subject distances for which the region-specific face model normal organ positions are set, the region-specific face model normal organ positions corresponding to the subject distance lB that is larger than or closest to l, which is the acquired subject distance. Select the coordinates (xB, yB) of. Then, in this case, the face model organ position (x', y') can be obtained by the following equation (3).
なお、式(3)において、wはl、lA、lBから算出される重みであり、例えば、下式(4)のように求めることができる。 In the formula (3), w is a weight calculated from l, lA, and lB, and can be obtained as in the following formula (4), for example.
式(4)において、γは、重みwを調整するためのパラメータであり、領域別顔モデル法線器官位置が設定された被写体距離の間隔(例えば、0.1m、0.5m、1.0m 等)に応じて調整することができる。γに関して、領域別顔モデル法線器官位置が設定された被写体距離の間隔が、所定の値よりも短い間隔である場合には1に設定され、また、所定の値よりも長い間隔である場合には1より大きい値に設定される。このように設定することで、被写体距離が短いほど器官の移動量を大きく、被写体距離が長いほど器官の移動量を小さくすることができる。 In the formula (4), γ is a parameter for adjusting the weight w, and is an interval of the subject distance (for example, 0.1 m, 0.5 m, 1.0 m) in which the face model normal organ position for each region is set. Etc.) can be adjusted according to. Regarding γ, when the interval of the subject distance for which the face model normal organ position for each region is set is shorter than the predetermined value, it is set to 1, and when the interval is longer than the predetermined value. Is set to a value greater than 1. By setting in this way, the shorter the subject distance, the larger the movement amount of the organ, and the longer the subject distance, the smaller the movement amount of the organ.
顔モデル法線情報取得部303は、領域別顔モデル法線画像データと算出した顔モデル器官位置に基づいて、顔モデル法線画像データを生成する(S1303)。具体的には、顔概略形状に対応する領域別顔モデル法線画像データ1401に対して、顔モデル器官位置と器官基準位置が一致するように、その他の領域別顔モデル法線画像データ1402~1405を位置合わせする。そして、領域別顔モデル法線画像データ1401に対して、領域別顔モデル法線画像データ1402~1405の法線情報のある画素の画素値を上書きすることで、顔モデル法線画像データを生成する。図15に、図13に示す処理によって生成された顔モデル法線画像データ1501を、その一例として示す。
The face model normal
以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、領域別顔モデル法線情報として、被写体距離に関係なく、領域毎に1つの領域別顔モデル法線画像データを保持するものとして説明したが、異なる被写体距離に対応する領域別顔モデル法線画像データを各々、複数保持させてもよい。したがって、例えば、0.5m、1.5m、5.0mの被写体距離に対応する領域別顔モデル法線画像データを各々、保持し、ステップS1301で算出した被写体距離と最も近い被写体距離に対応する領域別顔モデル法線画像データを取得することもできる。また、領域(器官)毎に保持する、領域別顔モデル法線画像データの枚数を変更することもできる。例えば、顔概略形状や鼻周辺領域に対応する領域別顔モデル法線画像データは複数枚保持させ、右目周辺領域、左目周辺領域、口周辺領域に対応する領域別顔モデル法線画像データは一枚のみ保持させてもよい。 As described above, in the present invention, even if the subject distance changes, another image as if it was taken under desired lighting conditions can be generated from the captured image. In the present embodiment, as the area-specific face model normal information, one area-specific face model normal image data is held for each area regardless of the subject distance, but different subject distances are supported. A plurality of area-specific face model normal image data may be retained. Therefore, for example, the area-specific face model normal image data corresponding to the subject distances of 0.5 m, 1.5 m, and 5.0 m are retained, respectively, and correspond to the subject distance closest to the subject distance calculated in step S1301. It is also possible to acquire face model normal image data for each area. It is also possible to change the number of face model normal image data for each region held for each region (organ). For example, multiple face model normal image data for each region corresponding to the outline shape of the face and the region around the nose are retained, and the face model normal image data for each region corresponding to the region around the right eye, the region around the left eye, and the region around the mouth is one. Only the sheets may be held.
(第3実施形態)
第2実施形態では、領域別顔モデル法線情報に基づいて、顔モデル法線情報を生成したが、本実施形態(第3実施形態)では、被写体距離に応じて、領域別顔モデル法線情報を選択し、顔法線画像データを生成する。
(Third Embodiment)
In the second embodiment, the face model normal information is generated based on the area-specific face model normal information, but in the present embodiment (third embodiment), the area-specific face model normal is generated according to the subject distance. Select information and generate face normal image data.
第3実施形態では、第1実施形態との関係(比較)でステップS406が異なり、ステップS406の顔モデル法線情報の取得処理の代わりに、領域別顔モデル法線情報の取得処理を実行する。また、ステップS902の顔法線画像データ生成処理の処理内容が第1実施形態と異なる。以下、これらの処理(即ち、領域別顔モデル法線情報の取得処理及び顔法線画像データ生成処理)に関して、詳述する。 In the third embodiment, step S406 is different depending on the relationship (comparison) with the first embodiment, and instead of the face model normal information acquisition process in step S406, the area-specific face model normal information acquisition process is executed. .. Further, the processing content of the face normal image data generation processing in step S902 is different from that of the first embodiment. Hereinafter, these processes (that is, the process of acquiring the face model normal information for each region and the process of generating the face normal image data) will be described in detail.
(領域別顔モデル法線情報取得処理)
ここでは、顔モデル法線情報取得部303において実行される領域別顔モデル法線情報取得処理について説明する。本実施形態では、領域別顔モデル法線情報の取得処理に関して、距離画像データと顔情報に基づいて、領域別顔モデル法線情報を取得する。図16に、領域別顔モデル法線情報取得処理の手順を示す。
(Face model normal information acquisition process by area)
Here, the area-specific face model normal information acquisition process executed by the face model normal
顔モデル法線情報取得部303は、第1実施形態のステップS701と同様に、顔検出部302より取得した顔情報と距離画像取得部105より取得した距離画像データに基づいて、被写体距離を算出する(S1601)。
The face model normal
顔モデル法線情報取得部303は、取得した被写体距離に対応する領域別顔モデル法線情報を選択する(S1602)。なお、ステップS1602の処理では、取得した被写体距離に最も近い領域別顔モデル法線情報を選択する。例えば、図14に示す領域別顔モデル法線情報の場合には、領域別顔モデル法線画像データ1401~1405と、領域別顔モデル法線器官位置のうち、取得した被写体距離に最も近いものを取得する。
The face model normal
(顔法線画像データ生成処理)
ここでは、法線生成部304において実行される顔法線画像データ生成処理について説明する。本実施形態では、ステップS1602で取得した領域別顔モデル法線情報(即ち、領域別顔モデル法線画像データ1401~1405及び領域別顔モデル法線器官位置)に基づいて、顔法線画像データを生成する。図17に、顔法線画像データ生成処理の概要を示す。
(Face normal image data generation processing)
Here, the face normal image data generation process executed by the
先ず、法線生成部304は、アフィン変換を用いて、カラー画像データ501における被写体の顔に合うように領域別顔モデル法線画像データを変形する。顔概略形状に対応する領域別顔モデル法線画像データ1401のアフィンパラメータは、器官位置602とステップS1602で選択された領域別顔モデル法線器官位置に基づいて、最小二乗法を用いて算出される。
First, the
次に、その他の領域別顔モデル法線画像データ1402~1405のアフィンパラメータを、器官位置602と領域別顔モデル法線画像データ1402~1405に対応する器官基準位置が一致するように、平行移動成分を補正したものとして算出する。これにより、領域別顔モデル法線画像データ1402~1405を、カラー画像データ501の被写体の器官位置602に合わせて、変形することができる。
Next, the affine parameters of the other area-specific face model
そして、法線生成部304は、以上のように算出した変換パラメータを用いて領域別顔モデル法線画像データ1401~1405を変形し、領域別顔法線画像データ1701~1705を生成する。さらに、法線生成部304は、領域別顔法線画像データ1701~1705を統合することにより、顔法線画像データ1706を生成する。
Then, the
即ち、本実施形態では、顔概略形状以外の領域別顔法線画像データ1702~1705において法線情報を有する画素を、顔概略形状に対応する領域別顔法線画像データ1701に上書きすることで、顔法線画像データ1706を生成している。なお、領域別顔法線画像データ1702~1705の全てにおいて背景となる画素(即ち、その領域に関連する法線情報を有さない画素)は、顔概略形状に対応する領域別顔法線画像データ1701の画素値で顔法線画像データ1706が生成される。
That is, in the present embodiment, the pixels having the normal information in the area-specific face
以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、ステップS1602において、取得した被写体距離に最も近い領域別顔モデル法線器官位置を選択していたが、第2実施形態のステップS1302で上述したように、補間処理により領域別顔モデル法線器官位置を算出してもよい。 As described above, in the present invention, even if the subject distance changes, another image as if it was taken under desired lighting conditions can be generated from the captured image. In the present embodiment, the face model normal organ position for each region closest to the acquired subject distance was selected in step S1602, but as described above in step S1302 of the second embodiment, the region is processed by interpolation processing. Another face model normal The organ position may be calculated.
また、本実施形態では、領域別顔モデル法線情報として、領域毎に1つの領域別顔モデル法線画像データを保持するものとして説明したが、異なる被写体距離に対応する領域別顔モデル法線画像データを各々、複数保持させてもよい。したがって、例えば、0.5m、1.5m、5.0mの被写体距離に対応する領域別顔モデル法線画像データを各々、保持し、ステップS1601で算出した被写体距離と最も近い被写体距離に対応する領域別顔モデル法線画像データを取得することもできる。 Further, in the present embodiment, as the area-specific face model normal information, one area-specific face model normal image data is held for each area, but the area-specific face model normal corresponding to a different subject distance is described. A plurality of image data may be retained. Therefore, for example, the area-specific face model normal image data corresponding to the subject distances of 0.5 m, 1.5 m, and 5.0 m are retained, respectively, and correspond to the subject distance closest to the subject distance calculated in step S1601. It is also possible to acquire face model normal image data for each area.
加えて、領域(器官)毎に保持する、領域別顔モデル法線画像データの枚数を変更することもできる。例えば、顔概略形状や鼻周辺領域に対応する領域別顔モデル法線画像データは複数枚保持させ、右目周辺領域、左目周辺領域、口周辺領域に対応する領域別顔モデル法線画像データは一枚のみ保持させてもよい。 In addition, the number of face model normal image data for each region held for each region (organ) can be changed. For example, multiple face model normal image data for each region corresponding to the outline shape of the face and the region around the nose are retained, and the face model normal image data for each region corresponding to the region around the right eye, the region around the left eye, and the region around the mouth is one. Only the sheets may be held.
(第4実施形態)
第1実施形態から第3実施形態までは、主に処理対象を人物として説明したが、本実施形態では、人物(より詳細には、人物の顔)に加えて他の被写体も処理対象とする。これにより、様々な被写体に対して被写体距離に応じた法線情報を取得することができる。
(Fourth Embodiment)
From the first embodiment to the third embodiment, the processing target is mainly described as a person, but in the present embodiment, in addition to the person (more specifically, the face of the person), other subjects are also processed targets. .. This makes it possible to acquire normal information according to the subject distance for various subjects.
(画像処理部の内部構成)
図18は、本発明の実施形態(第4実施形態)に係る画像処理装置(画像処理部208)の機能構成を示すブロック図である。図18に示す画像処理部208の機能構成では、第1実施形態に係る画像処理装置(画像処理部208)との関係で、顔モデル法線情報取得部303の代わりに、被写体モデル法線情報取得部1801が実装される。加えて、法線生成部304の処理内容も異なる。
(Internal configuration of image processing unit)
FIG. 18 is a block diagram showing a functional configuration of an image processing apparatus (image processing unit 208) according to an embodiment (fourth embodiment) of the present invention. In the functional configuration of the
被写体モデル法線情報取得部1801は、被写体までの距離情報と被写体情報に基づいて、複数の被写体モデル法線情報から被写体に合う法線情報を選択する。本実施形態では、ユーザ操作により選択された被写体情報を制御部205から取得する。被写体情報は、カラー画像データに含まれる被写体の種類を表し、例えば、人物の他にも、犬、猫等から選択することができるものとする。また、この場合、人物以外の被写体である、犬、猫等のみを被写体の対象とすることもできる。
The subject model normal
(画像処理部の処理フロー)
図19は、本発明の実施形態に係る画像処理装置(画像処理部208)における処理の手順を示すフローチャートである。図19に示すフローチャートは、図4に示すフローチャートとの関係(比較)で、ステップS1905~ステップS1907の処理が異なる。
(Processing flow of image processing unit)
FIG. 19 is a flowchart showing a processing procedure in the image processing apparatus (image processing unit 208) according to the embodiment of the present invention. The flowchart shown in FIG. 19 differs from the processing of steps S1905 to S1907 in relation to (comparison) with the flowchart shown in FIG.
以下、ステップS1905~ステップS1907の各処理について、説明する。図19のステップS1903において、ライティング処理を実行すると判定されると、被写体モデル法線情報取得部1801は、制御部205からユーザ操作に基づいた被写体情報を取得する(S1905)。被写体モデル法線情報取得部1801は、被写体距離とステップS1905で取得した被写体情報に基づいて、複数の被写体モデル法線情報の中からカラー画像データ501の被写体に対応する被写体モデル法線情報を取得する(S1906)。なお、本実施形態では、被写体情報の種類と被写体距離に応じた法線画像データとテンプレート画像データを保持しているものとする。
Hereinafter, each process of steps S1905 to S1907 will be described. When it is determined in step S1903 of FIG. 19 that the lighting process is to be executed, the subject model normal
ここで、図20に、本実施形態における被写体モデル法線情報をその一例として示す。被写体モデル法線情報は、図20に示されるように、被写体モデル法線画像データと被写体モデルテンプレート画像データを含む。図20(a)に示す被写体モデル法線画像データ2001、2002、2003は各々、0.5m、1.5m、5.0mの被写体距離に応じた被写体モデル法線画像データである。
Here, FIG. 20 shows the subject model normal information in the present embodiment as an example. As shown in FIG. 20, the subject model normal information includes subject model normal image data and subject model template image data. The subject model
また、図20(b)に示す被写体モデルテンプレート画像データ2004、2005、2006は、被写体モデル法線画像データ2001、2002、2003をカラー画像データ501に位置合わせするために利用される。本実施形態では、被写体モデルテンプレート画像データ2004、2005、2006として、被写体モデル法線画像データ2001、2002、2003に対応する輪郭情報を、画像データとして保持しているものとする。
Further, the subject model
なお、図20では、被写体モデル法線情報として、人物の顔(特徴パターン)に対応する被写体モデル法線情報をその一例として説明したが、画像処理部208は、同様に、犬、猫等の様々な被写体モデル法線情報を被写体距離に応じて保持しているものとする。
In FIG. 20, as the subject model normal information, the subject model normal information corresponding to the face (characteristic pattern) of a person has been described as an example, but the
法線生成部304は、被写体モデル法線情報に基づいて、法線画像データを生成する(S1907)。法線画像データの生成において、法線生成部304は、先ず、被写体モデルテンプレート画像データを用いて、カラー画像データ501の被写体に対して、被写体モデル法線画像データを位置合わせするためのパラメータを算出する。本実施形態では、カラー画像データ501における被写体の輪郭情報を抽出し、被写体モデルテンプレート画像データとマッチングすることで、位置合わせパラメータを算出する。
The
法線生成部304は、次に、算出した位置合わせパラメータに基づいて、被写体モデル法線画像データをカラー画像データ501に合わせて変換する。そして、法線生成部304は、第一実施形態と同様にカラー画像データを参照画像とする平滑化処理を施すことで、法線画像データを生成する。
Next, the
以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、制御部205等から取得した撮影時のユーザ操作に基づいて被写体情報を取得したが(即ち、制御部205を被写体情報取得手段として機能させたが)、被写体情報の取得方法は、必ずしもこれに限定されない。したがって、例えば、カラー画像データ501のタグ情報として被写体情報をRAM203等に記憶しておき、その被写体情報をRAM203から取得することもできる。また、別途、被写体検出処理部を具備させ、顔、犬、猫等、複数種類の被写体を検出し、これに基づいて、被写体情報を取得することもできる。
As described above, in the present invention, even if the subject distance changes, another image as if it was taken under desired lighting conditions can be generated from the captured image. In this embodiment, the subject information is acquired based on the user operation at the time of shooting acquired from the
加えて、本実施形態では、被写体モデルテンプレート画像データとして輪郭情報を画像データとして保持させたが、被写体モデルのテクスチャや特徴点情報を保持させてもよい。なお、この場合、ステップS1907において、テクスチャや特徴点情報に基づいて、位置合わせパラメータを算出すればよい。 In addition, in the present embodiment, the contour information is retained as image data as the subject model template image data, but the texture and feature point information of the subject model may be retained. In this case, in step S1907, the alignment parameter may be calculated based on the texture and the feature point information.
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
その他、以上において、好ましい実施形態として、主に人物の顔等を例示し説明したが、被写体は、必ずしも人物の顔等に限定されない。したがって、例えば、所定の部分において法線にばらつきを有する物体であって、また、法線情報を格納する上でモデル化することが可能な物体であれば、その物体を本発明の被写体として適用することができる。 In addition, although the face of a person or the like has been mainly illustrated and described as a preferred embodiment in the above, the subject is not necessarily limited to the face of a person or the like. Therefore, for example, if an object has variations in normals in a predetermined portion and can be modeled for storing normal information, the object is applied as the subject of the present invention. can do.
105 距離画像取得部
208 画像処理部
301 現像処理部
303 顔モデル法線情報取得部
304 法線生成部
105 Distance
Claims (12)
前記シーンを撮像した撮像装置から前記被写体までの距離情報を取得する第一の取得手段と、
前記被写体に関連する所定の特徴パターンに対応する法線情報を記憶する記憶手段と、
前記距離情報と前記記憶手段が記憶する前記法線情報に基づき、前記画像データに対するライティング処理に適用する法線情報を生成する生成手段と、
前記生成手段が生成した前記法線情報を用いて、前記画像データに対して、ライティング処理を実行するライティング処理手段と
を備え、
前記記憶手段は、所定の特徴パターンに対応する法線情報を前記撮像装置から前記被写体までの距離に応じて、複数、記憶し、
前記生成手段は、前記記憶手段が記憶する複数の法線情報から前記距離情報に基づいて選択した法線情報を用いて、前記ライティング処理に適用する法線情報を生成することを特徴とする画像処理装置。 An image acquisition means for acquiring image data obtained by capturing a scene including a subject, and
The first acquisition means for acquiring the distance information from the image pickup device that captured the scene to the subject,
A storage means for storing normal information corresponding to a predetermined feature pattern related to the subject, and a storage means.
A generation means for generating normal information applied to a lighting process for the image data based on the distance information and the normal information stored in the storage means.
A lighting processing means for executing a lighting process on the image data by using the normal information generated by the generation means is provided .
The storage means stores a plurality of normal information corresponding to a predetermined feature pattern according to the distance from the image pickup apparatus to the subject.
The generating means is characterized in that the normal information applied to the lighting process is generated by using the normal information selected based on the distance information from the plurality of normal information stored by the storage means. Processing device.
前記生成手段は、前記被写体情報に基づいて、前記被写体の所定の特徴パターンに対応する法線情報を生成することを特徴とする請求項1から6のいずれか1項に記載の画像処理装置。 Further provided with a second acquisition means for acquiring subject information indicating the type of the subject,
The image processing apparatus according to any one of claims 1 to 6 , wherein the generation means generates normal information corresponding to a predetermined feature pattern of the subject based on the subject information.
画像取得手段により、前記被写体を含むシーンを撮像することにより得られる画像データを取得する画像取得ステップと、
第一の取得手段により、前記シーンを撮像した撮像装置から前記被写体までの距離情報を取得する第一の取得ステップと、
生成手段により、前記距離情報と前記記憶手段が記憶する前記法線情報に基づき、前記画像データに対するライティング処理に適用する法線情報を生成する生成ステップと、
ライティング処理手段により、前記生成ステップにおいて生成した前記法線情報を用いて、前記画像データに対して、ライティング処理を実行するライティング処理ステップと
を含み、
前記記憶手段は、所定の特徴パターンに対応する法線情報を前記撮像装置から前記被写体までの距離に応じて、複数、記憶し、
前記生成手段は、前記記憶手段が記憶する複数の法線情報から前記距離情報に基づいて選択した法線情報を用いて、前記ライティング処理に適用する法線情報を生成することを特徴とする画像処理方法。 An image processing method in an image processing apparatus provided with a storage means for storing normal information corresponding to a predetermined feature pattern related to a subject.
An image acquisition step of acquiring image data obtained by capturing a scene including the subject by an image acquisition means, and an image acquisition step.
The first acquisition step of acquiring the distance information from the image pickup device that captured the scene to the subject by the first acquisition means, and
A generation step of generating normal information to be applied to the lighting process for the image data based on the distance information and the normal information stored by the storage means by the generation means.
The lighting processing means includes a lighting processing step of executing a lighting processing on the image data by using the normal information generated in the generation step.
The storage means stores a plurality of normal information corresponding to a predetermined feature pattern according to the distance from the image pickup apparatus to the subject.
The generating means is characterized in that the normal information applied to the lighting process is generated by using the normal information selected based on the distance information from the plurality of normal information stored by the storage means. Processing method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017186335A JP7057086B2 (en) | 2017-09-27 | 2017-09-27 | Image processing equipment, image processing methods, and programs |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017186335A JP7057086B2 (en) | 2017-09-27 | 2017-09-27 | Image processing equipment, image processing methods, and programs |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019062436A JP2019062436A (en) | 2019-04-18 |
JP7057086B2 true JP7057086B2 (en) | 2022-04-19 |
Family
ID=66176860
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017186335A Active JP7057086B2 (en) | 2017-09-27 | 2017-09-27 | Image processing equipment, image processing methods, and programs |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7057086B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7301683B2 (en) * | 2019-09-11 | 2023-07-03 | キヤノン株式会社 | Image processing device, image processing method, and program |
CN112926479A (en) * | 2021-03-08 | 2021-06-08 | 新疆爱华盈通信息技术有限公司 | Cat face identification method and system, electronic device and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012014650A (en) | 2010-07-05 | 2012-01-19 | Panasonic Electric Works Co Ltd | Mental/physical condition control apparatus |
JP2016062225A (en) | 2014-09-17 | 2016-04-25 | 大日本印刷株式会社 | Image generation device, image detection system and image generation method |
JP2016208098A (en) | 2015-04-15 | 2016-12-08 | キヤノン株式会社 | Image processor, image processing method, and program |
-
2017
- 2017-09-27 JP JP2017186335A patent/JP7057086B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012014650A (en) | 2010-07-05 | 2012-01-19 | Panasonic Electric Works Co Ltd | Mental/physical condition control apparatus |
JP2016062225A (en) | 2014-09-17 | 2016-04-25 | 大日本印刷株式会社 | Image generation device, image detection system and image generation method |
JP2016208098A (en) | 2015-04-15 | 2016-12-08 | キヤノン株式会社 | Image processor, image processing method, and program |
Also Published As
Publication number | Publication date |
---|---|
JP2019062436A (en) | 2019-04-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6685827B2 (en) | Image processing apparatus, image processing method and program | |
US11948282B2 (en) | Image processing apparatus, image processing method, and storage medium for lighting processing on image using model data | |
JP6646936B2 (en) | Image processing apparatus, control method thereof, and program | |
JP6576083B2 (en) | Image processing apparatus, image processing method, and program | |
JP5024410B2 (en) | 3D modeling apparatus, 3D modeling method, and program | |
JP5110138B2 (en) | AR processing apparatus, AR processing method, and program | |
JP5725953B2 (en) | Imaging apparatus, control method therefor, and information processing apparatus | |
JP2016218905A (en) | Information processing device, information processing method and program | |
JP7123736B2 (en) | Image processing device, image processing method, and program | |
US9704255B2 (en) | Three-dimensional shape measurement device, three-dimensional shape measurement method, and three-dimensional shape measurement program | |
KR101510312B1 (en) | 3D face-modeling device, system and method using Multiple cameras | |
US11030799B2 (en) | Image processing apparatus, image processing method and storage medium. With estimation of parameter of real illumination based on normal information on pixel included in high luminance area | |
JP2020053774A (en) | Imaging apparatus and image recording method | |
JP6552266B2 (en) | Image processing apparatus, image processing method, and program | |
JP7301683B2 (en) | Image processing device, image processing method, and program | |
JP7057086B2 (en) | Image processing equipment, image processing methods, and programs | |
US20160044295A1 (en) | Three-dimensional shape measurement device, three-dimensional shape measurement method, and three-dimensional shape measurement program | |
JP6896811B2 (en) | Image processing equipment, image processing methods, and programs | |
WO2018180860A1 (en) | Image processing device, image processing method, and program | |
JP7321772B2 (en) | Image processing device, image processing method, and program | |
JP2010154323A (en) | Image processing apparatus, image extraction method, and, program | |
CN112529848B (en) | Panorama updating method and device, readable medium and equipment | |
JP2012248206A (en) | Ar processing apparatus, ar processing method and program | |
JP7439784B2 (en) | Image processing device and image processing method | |
JP2021145385A (en) | Image processing apparatus, image processing method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200928 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210729 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210810 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20211008 |
|
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: 20220308 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20220407 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 7057086 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |