JP7057086B2 - Image processing equipment, image processing methods, and programs - Google Patents

Image processing equipment, image processing methods, and programs Download PDF

Info

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
Application number
JP2017186335A
Other languages
Japanese (ja)
Other versions
JP2019062436A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2017186335A priority Critical patent/JP7057086B2/en
Publication of JP2019062436A publication Critical patent/JP2019062436A/en
Application granted granted Critical
Publication of JP7057086B2 publication Critical patent/JP7057086B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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, Patent Document 1 discloses an image processing device that corrects a subject by using a face model generated from a face three-dimensional shape template representing a three-dimensional shape of a face.

この特許文献1の画像処理装置では、画像データから検出した顔情報(即ち、顔位置情報、顔の大きさ情報、顔部品情報、及び顔方向情報)に基づいて、顔立体形状テンプレートを変形させて被写体の顔モデルを生成している。また、特許文献1の画像処理装置では、検出された顔部品情報や顔の大きさ情報等に基づいて顔の立体形状を推定し、複数の顔立体形状テンプレートから被写体に適した顔立体形状テンプレートを選択している。これにより、顔の個人差や顔の向き等による見た目の違いに応じて、顔立体形状テンプレートを選択することを可能としている。 In the image processing apparatus of Patent Document 1, the face three-dimensional shape template is deformed based on the face information (that is, face position information, face size information, face component information, and face direction information) detected from the image data. To generate a face model of the subject. Further, the image processing apparatus of Patent Document 1 estimates the three-dimensional shape of the face based on the detected face component information, face size information, and the like, and from a plurality of face three-dimensional shape templates, a face three-dimensional shape template suitable for the subject. Is selected. This makes it possible to select a three-dimensional face shape template according to individual differences in the face and differences in appearance due to the orientation of the face and the like.

特開2014-49866号公報Japanese Unexamined Patent Publication No. 2014-49866

しかしながら、特許文献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 Patent Document 1, when the subject distance changes, a face three-dimensional shape template different from the appearance of the subject is selected. There is a possibility. As a result, the face model is also generated so as not to resemble the subject, and as a result, the subject corrected by using the face model is generated as unnatural.

本発明は、前記従来の問題に鑑みてなされたものであって、その目的は、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような画像を生成することである。 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.

画像処理装置を備えた撮像装置の外観を示す図である。It is a figure which shows the appearance of the image pickup apparatus provided with an image processing apparatus. 画像処理装置を備えた撮像装置の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of the image pickup apparatus provided with an image processing apparatus. 画像処理装置の機能構成を示すブロック図である。It is a block diagram which shows the functional structure of an image processing apparatus. 画像処理装置における処理の手順を示すフローチャートである。It is a flowchart which shows the processing procedure in an image processing apparatus. カラー画像データと距離画像データを示す図である。It is a figure which shows the color image data and the distance image data. 顔領域と器官位置を示す図である。It is a figure which shows the face area and the organ position. 顔モデル法線情報取得処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the face model normal information acquisition processing. 顔モデル法線情報を示す図である。It is a figure which shows the face model normal information. 法線画像データ生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the normal image data generation processing. 法線画像データ生成処理の概要を示す図である。It is a figure which shows the outline of the normal image data generation processing. ライティング処理の概要を示す図である。It is a figure which shows the outline of a lighting process. ライティング処理の結果を示す図である。It is a figure which shows the result of a lighting process. 顔モデル法線情報取得処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the face model normal information acquisition processing. 領域別顔モデル法線情報を示す図である。It is a figure which shows the face model normal information by area. 顔モデル法線情報を示す図である。It is a figure which shows the face model normal information. 領域別顔モデル法線情報取得処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the face model normal information acquisition processing by area. 顔法線画像データ生成処理の概要を示す図である。It is a figure which shows the outline of the face normal image data generation processing. 画像処理装置の機能構成を示すブロック図である。It is a block diagram which shows the functional structure of an image processing apparatus. 画像処理装置における処理の手順を示すフローチャートである。It is a flowchart which shows the processing procedure in an image processing apparatus. 被写体モデル法線情報を示す図である。It is a figure which shows the subject model normal information.

(撮像装置の外観)
図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 image pickup apparatus 101 includes an optical unit 102, an image pickup button 103, a strobe 104, a distance image acquisition unit 105, a display unit 106, and an operation button 107.

光学部102は、ズームレンズ、フォーカスレンズ、ブレ補正レンズ、絞り、及びシャッターによって構成される鏡筒であり、被写体の光情報を集光する。撮像ボタン103は、ユーザが撮像の開始を撮像装置101に指示するためのボタンである。ストロボ104は、ユーザの指示に従って、撮像の開始に合わせて発光させることが可能な照明である。 The optical unit 102 is a lens barrel composed of a zoom lens, a focus lens, a blur correction lens, an aperture, and a shutter, and collects light information of a subject. The image pickup button 103 is a button for the user to instruct the image pickup apparatus 101 to start imaging. The strobe 104 is an illumination capable of emitting light at the start of imaging according to a user's instruction.

距離画像取得部105は、距離情報として、撮像指示に応じて撮像したシーンにおける被写体の距離画像データを取得する。ここで、距離画像データとは、画像の各画素の画素値として、その画素に対応する被写体距離を格納した画像データのことである。距離画像取得部105は、赤外光を発光する赤外発光部と、被写体に反射した赤外光を受光する受光部とを備える。距離画像取得部105は、赤外発光部において発光した赤外光が被写体に反射し、受光部が受光するまでの時間に基づいて、撮像装置から被写体までの距離値を算出する。そして、算出した距離値と受光部のセンサ画素数や画角等を含む距離撮像情報に基づいて、被写体の位置情報を算出し、距離画像データを生成する。なお、距離画像データの取得方法は、必ずしもこれに限られない。したがって、例えば、距離画像取得部105の代わりに光学部102と同様の光学系を設け、異なる2つの視点から撮像された画像データ間の視差に基づいて、三角測量を行うことにより距離画像データを取得することもできる。 The distance image acquisition unit 105 acquires the distance image data of the subject in the scene captured in response to the imaging instruction as the distance information. Here, the distance image data is image data in which the subject distance corresponding to the pixel is stored as the pixel value of each pixel of the image. The distance image acquisition unit 105 includes an infrared light emitting unit that emits infrared light and a light receiving unit that receives infrared light reflected by the subject. The distance image acquisition unit 105 calculates the distance value from the image pickup apparatus to the subject based on the time until the infrared light emitted by the infrared light emitting unit is reflected by the subject and the light receiving unit receives the light. Then, the position information of the subject is calculated based on the calculated distance value and the distance imaging information including the number of sensor pixels of the light receiving unit, the angle of view, and the like, and the distance image data is generated. The method of acquiring the distance image data is not necessarily limited to this. Therefore, for example, instead of the distance image acquisition unit 105, an optical system similar to the optical unit 102 is provided, and the distance image data is obtained by performing triangulation based on the parallax between the image data captured from two different viewpoints. You can also get it.

表示部106は、撮像装置101にて処理された画像データや他の各種データを表示する、液晶ディスプレイ等の表示装置である。なお、図1に示すように、撮像装置101は光学ファインダを備えていないので、フレーミング操作(ピントや構図の確認)は表示部106を用いて行われる。即ち、撮像装置101に関して、表示部106においてライブビュー画像を確認しながら撮像が行われるので、フレーミングやフォーカシングの操作が行われるとき、表示部106は、電子ファインダとしても機能する。その他、表示部106では、カメラ設定メニュー等も表示する。 The display unit 106 is a display device such as a liquid crystal display that displays image data processed by the image pickup device 101 and various other data. As shown in FIG. 1, since the image pickup apparatus 101 does not have an optical finder, the framing operation (confirmation of focus and composition) is performed using the display unit 106. That is, since the image pickup device 101 is imaged while confirming the live view image on the display unit 106, the display unit 106 also functions as an electronic finder when the framing or focusing operation is performed. In addition, the display unit 106 also displays a camera setting menu and the like.

操作ボタン107は、撮像装置101の動作モードの切り換え操作や、撮像時の各種パラメータ等をユーザが撮像装置101に指示するためのボタンである。なお、撮像装置101は、動作モードの一つとして、撮像された画像における照明の当たり具合を撮像後に補正するライティング処理モードを備える。そのため、ユーザは、操作ボタン107又は撮像ボタン103を用いて、ライティング処理モードへの切り替え、ライティング処理に用いる仮想照明の照明パラメータの設定、さらに照明の当たり具合を調整(補正)する被写体の選択等を行うことができる。また、ユーザは補正された画像データを出力する際に、距離画像データを出力するか否か等の指示をすることもできる。その他、表示部106は、タッチスクリーン機能を備えていてもよく、その場合、タッチスクリーンを用いたユーザ指示を操作ボタン107の入力として扱うことも可能である。 The operation button 107 is a button for the user to instruct the image pickup device 101 of an operation for switching the operation mode of the image pickup device 101, various parameters at the time of image pickup, and the like. The image pickup apparatus 101 includes, as one of the operation modes, a lighting processing mode for correcting the lighting condition of the captured image after imaging. Therefore, the user uses the operation button 107 or the image pickup button 103 to switch to the lighting processing mode, set the lighting parameters of the virtual lighting used for the lighting processing, and select the subject for which the lighting condition is adjusted (corrected). It can be performed. Further, when outputting the corrected image data, the user can also instruct whether or not to output the distance image data. In addition, the display unit 106 may have a touch screen function, and in that case, a user instruction using the touch screen can be handled as an input of the operation button 107.

(撮像装置の内部構成)
図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 CPU 201 is involved in all the processes of each configuration, and executes the processes by sequentially reading and interpreting the instructions stored in the ROM (Read Only Memory) 202 and the RAM (Random Access Memory) 203.

ROM202は、CPU201により実行されるプログラムを記憶する。なお、本実施形態において、ROM202は、複数の顔モデル法線情報及び領域別顔モデル法線情報を格納するものとする。顔モデル法線情報は、所定の形状の顔(顔モデル)に対応する、顔表面の法線ベクトルを画素値に格納した顔モデル法線画像データと、顔モデル法線画像データにおける目・鼻・口等の器官位置を示す顔モデル法線器官位置とを含む。また、領域別顔モデル法線情報は、顔輪郭・目・鼻・口等の領域に対応する法線ベクトルを画素値に格納した領域別顔モデル法線画像データと、領域別顔モデル法線画像データにおける器官位置を示す領域別顔モデル法線器官位置とを含む。RAM203は、CPU201により実行されるプログラムを記憶する。 The ROM 202 stores a program executed by the CPU 201. In this embodiment, the ROM 202 stores a plurality of face model normal information and area-specific face model normal information. The face model normal information includes face model normal image data in which the normal vector of the face surface corresponding to a face (face model) having a predetermined shape is stored in pixel values, and eyes / nose in the face model normal image data. -Includes face model normal organ positions that indicate organ positions such as the mouth. The area-specific face model normal information includes area-specific face model normal image data in which normal vectors corresponding to areas such as face contour, eyes, nose, and mouth are stored in pixel values, and area-specific face model normals. Includes the area-specific face model normal organ position indicating the organ position in the image data. The RAM 203 stores a program executed by the CPU 201.

光学系制御部204は、光学部102に対して、フォーカスを合わせる、シャッターを開く、絞りを調整する等のCPU201から指示された制御を行う制御回路である。また、光学系制御部204は、光学系の状態等に基づいて、フォーカスを合わせた被写体までの距離を取得し、RAM203等に記憶することができる。 The optical system control unit 204 is a control circuit that controls the optical unit 102 instructed by the CPU 201, such as focusing, opening a shutter, and adjusting an aperture. Further, the optical system control unit 204 can acquire the distance to the focused subject and store it in the RAM 203 or the like based on the state of the optical system or the like.

制御部205は、撮像ボタン103や操作ボタン107からのユーザ指示を受け取り、撮像モード、ライティング処理モード等への切り換え、被写体領域の選択、照明パラメータの設定等の制御を行う制御回路である。カラー撮像素子部206は、光学部102にて集光された光情報を電流値に変換する撮像素子である。カラー撮像素子部206は、ベイヤ配列等の所定の配列を有するカラーフィルタを備え、光学部102において集光された光から被写体の色情報を取得する。 The control unit 205 is a control circuit that receives user instructions from the image pickup button 103 and the operation button 107, and controls switching to an image pickup mode, a lighting processing mode, and the like, selection of a subject area, setting of lighting parameters, and the like. The color image sensor unit 206 is an image sensor that converts the light information collected by the optical unit 102 into a current value. The color image sensor unit 206 includes a color filter having a predetermined arrangement such as a bayer arrangement, and acquires color information of a subject from the light focused by the optical unit 102.

A/D変換部207は、カラー撮像素子部206において検知された被写体の色情報をデジタル信号値に変換し、RAW画像データとする処理回路である。なお、本実施形態では、同時刻に撮像した距離画像データとRAW画像データを取得できるものとする。画像処理部208は、A/D変換部207で取得されたRAW画像データに対して現像処理を行い、カラー画像データを生成する。また、画像処理部208は、カラー画像データや距離画像データを用いて、カラー画像データにライティング処理を施した補正画像データを生成する等の各種画像処理を実行する。なお、画像処理部208の内部構成及び機能は、後述の図3を用いて詳述する。 The A / D conversion unit 207 is a processing circuit that converts the color information of the subject detected by the color image pickup element unit 206 into a digital signal value and converts it into RAW image data. In this embodiment, it is assumed that the distance image data and the RAW image data captured at the same time can be acquired. The image processing unit 208 performs development processing on the RAW image data acquired by the A / D conversion unit 207 to generate color image data. Further, the image processing unit 208 executes various image processing such as generating corrected image data obtained by applying lighting processing to the color image data using the color image data and the distance image data. The internal configuration and function of the image processing unit 208 will be described in detail with reference to FIG. 3 described later.

キャラクタージェネレーション部209は、文字やグラフィック等を生成する処理回路である。キャラクタージェネレーション部209により生成された文字やグラフィックは、表示部106において、画像データや補正画像データ等に重畳して表示される。エンコーダ部210は、画像処理部208において処理されたカラー画像データやライティング処理によって生成される補正画像データを含む各種画像データをJpeg等のファイルフォーマットに変換する。 The character generation unit 209 is a processing circuit that generates characters, graphics, and the like. The characters and graphics generated by the character generation unit 209 are superimposed and displayed on the image data, the corrected image data, and the like on the display unit 106. The encoder unit 210 converts various image data including the color image data processed by the image processing unit 208 and the corrected image data generated by the lighting processing into a file format such as JPEG.

メディア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 system bus 212 is a bus for transmitting and receiving data.

(画像処理部の内部構成)
図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 development processing unit 301 performs white balance processing, demosaic processing, noise reduction processing, color conversion processing, and the like on the RAW image data acquired from the A / D conversion unit 207 to generate color image data. The image pickup apparatus 101 can output the color image data generated by the development processing unit 301 to the display unit 106 for display, or can store the color image data in a storage device such as a RAM 203 or a PC / media 213.

顔検出部302は、現像処理部301より取得したカラー画像データから被写体の顔情報を取得する。なお、被写体の顔情報には、カラー画像データにおいて被写体の顔が占める領域を示す顔領域と、顔に含まれる目や口等のカラー画像データにおける位置を示す器官位置とに関する情報が少なくとも含まれる。 The face detection unit 302 acquires the face information of the subject from the color image data acquired from the development processing unit 301. The face information of the subject includes at least information on a face area indicating an area occupied by the face of the subject in the color image data and an organ position indicating a position in the color image data such as eyes and mouth included in the face. ..

顔モデル法線情報取得部303は、被写体までの距離情報に基づいて、複数の顔モデル法線情報から被写体に合う法線情報を選択する。本実施形態では、顔検出部302から取得した顔情報と距離画像取得部105から取得した距離画像データに基づいて、ROM202から顔モデル法線情報を選択する。 The face model normal information acquisition unit 303 selects normal information suitable for the subject from a plurality of face model normal information based on the distance information to the subject. In the present embodiment, the face model normal information is selected from the ROM 202 based on the face information acquired from the face detection unit 302 and the distance image data acquired from the distance image acquisition unit 105.

法線生成部304は、顔検出部302から顔情報、顔モデル法線情報取得部303から顔モデル法線情報、距離画像取得部105から距離画像データを各々、取得すると、それらの情報に基づいて、カラー画像データに対応する法線画像データを生成する。 When the normal line generation unit 304 acquires face information from the face detection unit 302, face model normal line information from the face model normal line information acquisition unit 303, and distance image data from the distance image acquisition unit 105, it is based on the information. Then, the normal image data corresponding to the color image data is generated.

照明パラメータ設定部305は、制御部205から受け渡されるユーザ操作(指示)に基づいて、照明パラメータを設定する。なお、本実施形態における照明パラメータは、照明の位置、姿勢、強度、光源色等を含む。ライティング処理部306は、距離画像取得部105から距離画像データ、法線生成部304から法線画像データ、照明パラメータ設定部305から照明パラメータを各々、取得し、それらのデータに基づいて、カラー画像データにライティング処理を実行する。なお、撮像装置101では、ライティング処理により補正された補正画像データを、RAM203やPC/メディア213等の記憶装置に出力し、記憶することや、表示部106に出力して表示することができる。 The lighting parameter setting unit 305 sets the lighting parameter based on the user operation (instruction) passed from the control unit 205. The lighting parameters in the present embodiment include the position, posture, intensity, light source color, and the like of the lighting. The lighting processing unit 306 acquires distance image data from the distance image acquisition unit 105, normal image data from the normal line generation unit 304, and lighting parameters from the lighting parameter setting unit 305, and a color image based on these data. Perform a writing process on the data. The image pickup device 101 can output and store the corrected image data corrected by the lighting process to a storage device such as a RAM 203 or a PC / media 213, or can output the corrected image data to a display unit 106 for display.

(画像処理部の処理フロー)
図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 image processing unit 208 first selects the face model normal information based on the face information and the distance image data acquired from the color image data. Next, the image processing unit 208 generates normal image data corresponding to the color image data based on the face information, the face model normal information, and the distance image data. The image processing unit 208 further executes a lighting process for adding virtual lighting to the color image data based on the lighting parameters, the distance image data, and the normal image data set by the user, and generates the corrected image data.

以下、画像処理部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 image processing unit 208 will be described in detail. The development processing unit 301 generates color image data based on the RAW image data acquired from the A / D conversion unit 207 (S401). The color image data is shown, for example, as shown in FIG. 5A, and RGB values are stored as pixel values in the pixels I (i, j) of the color image data 501, respectively, and Ir (i, i, j), Ig (i, j), Ib (i, j). The method for acquiring color image data is not necessarily limited to this. Therefore, for example, RAW image data stored in the RAM 203 or the PC / media 213 can be acquired, and the development processing unit 301 can generate color image data from the acquired RAW image data. It is also possible to directly acquire the color image data stored in the RAM 203 or the PC / media 213.

画像処理部208は、距離画像取得部105から距離画像データを取得する(S402)。距離画像データは、例えば、図5(b)のように示され、また、距離画像データ502の画素D(i,j)には、撮像装置から被写体までの距離値が格納されている。なお、距離画像データの取得方法は、必ずしもこれに限られない。したがって、例えば、RAM203やPC/メディア213に記憶されている距離画像データを直接、取得することもできる。 The image processing unit 208 acquires distance image data from the distance image acquisition unit 105 (S402). The distance image data is shown, for example, as shown in FIG. 5B, and the distance value from the image pickup apparatus to the subject is stored in the pixels D (i, j) of the distance image data 502. The method of acquiring the distance image data is not necessarily limited to this. Therefore, for example, the distance image data stored in the RAM 203 or the PC / media 213 can be directly acquired.

画像処理部208は、次に、RAM203からフラグSW1の状態を取得し、フラグSW1の状態に基づいて、ライティング処理を実行するか否かを判定する(S403)。画像処理部208は、フラグSW1がOFFの場合はライティング処理を実行しないと判定し(S403 No)、ステップS404に処理を移行する。また、フラグSW1がONの場合はラインティング処理を実行すると判定し(S403 Yes)、ステップS405に処理を移行する。 Next, the image processing unit 208 acquires the state of the flag SW1 from the RAM 203, and determines whether or not to execute the writing process based on the state of the flag SW1 (S403). The image processing unit 208 determines that the lighting process is not executed when the flag SW1 is OFF (S403 No), and shifts the process to step S404. Further, when the flag SW1 is ON, it is determined that the lining process is executed (S403 Yes), and the process shifts to step S405.

ステップ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 image processing unit 208 acquires the state of the flag SW2 from the RAM 203. Then, the image processing unit 208 outputs and stores only the color image data when the flag SW2 is OFF, and the color image data and the distance image data when the flag SW2 is ON to the PC / media 213 (S404). Alternatively, the image processing unit 208 can output the color image data to the display unit 106 and display it so that the user can confirm it. When the image processing unit 208 executes the process in step S404, the image processing unit 208 ends the process shown in FIG.

また、ステップ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 face detection unit 302 detects (acquires) face information based on the color image data (S405). Here, the face information will be described with reference to FIG. As shown in FIG. 6, the face information includes the face area 601 and the organ position 602. The face region is shown in the image data as a set of pixels in the region including the face. The organ position 602 is shown as coordinates corresponding to the eyes, nose, mouth, etc. in the facial region.

顔領域、器官位置の検出方法については、既存のアルゴリズムを適用することができる。既存のアルゴリズムとしては、テンプレートマッチングを用いたアルゴリズムや、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 face area 601 and the organ position 602 are acquired.

次に、顔モデル法線情報取得部303は、被写体距離に基づいて、顔モデル法線情報を取得する(S406)。なお、顔モデル法線情報取得部303における顔モデル法線情報を取得する処理に関しては、後述の図7等を用いて詳述する。 Next, the face model normal information acquisition unit 303 acquires face model normal information based on the subject distance (S406). The process of acquiring the face model normal information in the face model normal information acquisition unit 303 will be described in detail with reference to FIG. 7 and the like described later.

法線生成部304は、ステップS402、S405、及びS406で各々、取得した、距離画像データ、顔情報、及び顔モデル法線情報に基づいて、ステップS401で生成されたカラー画像データに対応する法線画像データを生成する(S407)。なお、法線生成部304における法線画像データを生成する処理に関しては、後述の図9、図10等を用いて詳述する。 The normal generation unit 304 corresponds to the color image data generated in step S401 based on the distance image data, face information, and face model normal information acquired in steps S402, S405, and S406, respectively. Generate line image data (S407). The process of generating normal image data in the normal generation unit 304 will be described in detail with reference to FIGS. 9, 10 and the like described later.

照明パラメータ設定部305は、制御部205から受け渡されるユーザ操作に基づいて、照明パラメータを設定(決定)する(S408)。ライティング処理部306は、距離画像データ、法線画像データ、及び照明パラメータに基づいて、カラー画像データに対して、カラー画像データに仮想照明(仮想的な光源)を付加する等のライティング処理を実行し、補正画像データを生成する(S409)。なお、ライティング処理部306におけるライティング処理に関しては、後述の図11等を用いて詳述する。 The lighting parameter setting unit 305 sets (determines) the lighting parameter based on the user operation passed from the control unit 205 (S408). The lighting processing unit 306 executes lighting processing such as adding virtual lighting (virtual light source) to the color image data for the color image data based on the distance image data, the normal image data, and the lighting parameters. Then, the corrected image data is generated (S409). The lighting process in the lighting process unit 306 will be described in detail with reference to FIG. 11 and the like described later.

ライティング処理部306は、制御部205から受け渡されるユーザ操作(即ち、ユーザからの指示)に基づいて、ライティング処理を終了するか否かを判定する(S410)。画像処理部208は、ライティング処理部306によりライティング処理を終了すると判定されると処理をステップS411に移行し、また、ライティング処理を終了しないと判定されると処理をステップS408に返し、再び照明パラメータを設定する。 The writing processing unit 306 determines whether or not to end the writing processing based on the user operation (that is, an instruction from the user) passed from the control unit 205 (S410). The image processing unit 208 shifts the processing to step S411 when it is determined by the lighting processing unit 306 to end the lighting processing, returns the processing to step S408 when it is determined not to end the lighting processing, and returns the lighting parameter again. To set.

処理がステップS411に移行されると、画像処理部208は、RAM203からフラグSW2の状態を取得し、ライティング処理部306は、その取得したフラグSW2の状態に基づいて、各種データを出力する。ライティング処理部306は、フラグSW2がOFFの場合はカラー画像データ及び補正画像データを、フラグSW2がONの場合はカラー画像データ、補正画像データ、及び距離画像データをPC/メディア213に出力し、記憶する。その後、画像処理部208は、図4に示す処理を終了する。 When the processing shifts to step S411, the image processing unit 208 acquires the state of the flag SW2 from the RAM 203, and the lighting processing unit 306 outputs various data based on the acquired state of the flag SW2. The lighting processing unit 306 outputs color image data and corrected image data when the flag SW2 is OFF, and outputs color image data, corrected image data, and distance image data when the flag SW2 is ON to the PC / media 213. Remember. After that, the image processing unit 208 ends the process shown in FIG.

(顔モデル法線情報取得処理)
ここでは、ステップ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 information acquisition unit 303 in step S406. explain.

以下、顔モデル法線情報取得処理の手順に関して、図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 information acquisition unit 303 first calculates the subject distance based on the face information acquired from the face detection unit 302 and the distance image data acquired from the distance image acquisition unit 105 (S701). In the present embodiment, the average of the distance values in the face area (that is, the area occupied by the face of the subject) is taken as the subject distance.

顔モデル法線情報取得部303は、ステップS701で算出した被写体距離に基づいて、顔モデル法線情報を取得する(S702)。本実施形態では、図8に示す被写体距離に応じた複数の顔モデル法線情報から、ステップS701で算出した被写体距離に最も近い顔モデル法線情報を選択する。 The face model normal information acquisition unit 303 acquires face model normal information based on the subject distance calculated in step S701 (S702). In the present embodiment, the face model normal information closest to the subject distance calculated in step S701 is selected from the plurality of face model normal information corresponding to the subject distance shown in FIG.

図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 normal information 801, 802, and 803 are face model normal information corresponding to the subject distances of 0.5 m, 1.5 m, and 5.0 m, respectively, and these face model normal information are It is stored in ROM 202.

顔モデル法線情報は、顔表面の法線ベクトル(即ち、被写体距離の位置から観察したときの顔表面の向き)を画素値に格納した顔モデル法線画像データと、顔モデル法線画像データにおける目・鼻・口等の器官位置を示す顔モデル法線器官位置とを含む。なお、顔モデル法線画像データにおける顔領域以外の領域における画素(即ち、背景画素)には、背景画素を示す画素値を格納するものとする。 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 ROM 202 or the like. If a large number of face model normal information is set, it is possible to select face model normal information that is more suitable for the conditions at the time of shooting.

(法線画像データ生成処理)
ここでは、ステップ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 normal generation unit 304 generates subject normal image data based on the distance image data (S901). Regarding the generation of the subject normal image data of the present embodiment, the normal generation unit 304 first obtains the two-dimensional coordinate values of the pixels in the distance image data and the distance values obtained from the pixel values of the pixels. , Calculate three-dimensional coordinate values for each pixel. Then, the normal generation unit 304 then calculates a normal vector corresponding to each pixel based on the calculated coordinate values. The normal vector corresponding to the pixel of interest is calculated based on the gradient calculated from the three-dimensional coordinate values of the region near the pixel of interest. In this way, the normal generation unit 304 generates the subject normal image data 1001.

法線生成部304は、次に、顔情報と顔モデル法線情報に基づいて、顔法線画像データを生成する(S902)。本実施形態の顔法線画像データの生成に関して、法線生成部304は、顔情報に含まれる器官位置602と、顔モデル法線情報に含まれる顔モデル法線器官位置に基づいて、顔モデル法線画像データを変形することで、顔法線画像データ1002を生成する。なお、本実施形態では、アフィン変換を用いて、カラー画像データ501内の被写体の顔に合うように、顔モデル法線画像データを変形する。具体的には、器官位置602と顔モデル法線器官位置から最小二乗法を用いてアフィンパラメータを算出し、その算出したアフィンパラメータに基づいて顔モデル法線画像パラメータを変形することで、顔法線画像データ1002を生成する。なお、顔法線画像データにおいて顔以外の背景画素は、背景画素を示す画素値を格納するものとする。 Next, the normal generation unit 304 generates face normal image data based on the face information and the face model normal information (S902). Regarding the generation of the face normal image data of the present embodiment, the normal generation unit 304 uses the face model based on the organ position 602 included in the face information and the face model normal organ position included in the face model normal information. By transforming the normal image data, the face normal image data 1002 is generated. In this embodiment, the affine transformation is used to transform the face model normal image data so as to match the face of the subject in the color image data 501. Specifically, the face method is performed by calculating the affine parameters from the organ position 602 and the face model normal organ position using the least squares method, and transforming the face model normal image parameters based on the calculated affine parameters. Generates line image data 1002. In the face normal image data, the background pixels other than the face store the pixel values indicating the background pixels.

法線生成部304は、被写体法線画像データ1001と顔法線画像データ1002を生成すると、それらを統合し、さらに平滑化することで、法線画像データを生成する(S903)。具体的には、先ず、顔法線画像データ1002の顔領域以外の領域における画素(即ち、背景画素)は被写体法線画像データ1001の画素値、それ以外の画素は顔法線画像データ1002の画素値となるように、画像データを統合する。即ち、統合法線画像データ1003を生成する。法線生成部304は、次に、生成した統合法線画像データ1003に対して、平滑化処理を実行することで、法線画像データ1004を生成する。なお、本実施形態では、カラー画像データ501を参照画像として、統合法線画像データ1003に平滑化処理を適用するものとする。また、この場合、例えば、カラー画像データ501を参照画像とするジョイントバイラテラルフィルタを適用すればよい。 When the normal line generation unit 304 generates the subject normal image data 1001 and the face normal image data 1002, the normal image data is generated by integrating them and further smoothing them (S903). Specifically, first, the pixels (that is, the background pixels) in the area other than the face area of the face normal line image data 1002 are the pixel values of the subject normal line image data 1001, and the other pixels are the pixel values of the face normal line image data 1002. Image data is integrated so that it becomes a pixel value. That is, the integrated normal image data 1003 is generated. Next, the normal generation unit 304 generates the normal image data 1004 by executing a smoothing process on the generated integrated normal image data 1003. In this embodiment, the color image data 501 is used as a reference image, and the smoothing process is applied to the integrated normal image data 1003. Further, in this case, for example, a joint bilateral filter using the color image data 501 as a reference image may be applied.

以上のように処理することで、法線画像データを生成することができる。なお、法線画像データを生成する処理は、必ずしも上述の処理に限定されることはない。したがって、例えば、被写体法線画像データ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 normal image data 1002 without generating the subject normal image data 1001. Further, in this case, instead of the subject normal image data 1001, image data in which an appropriate normal vector is stored may be given to all pixels.

(ライティング処理)
ここでは、ステップS409において、ライティング処理部306により実行されるライティング処理について説明する。ステップS409のライティング処理は、上述のように、距離画像データ及び法線画像データに基づき、さらにユーザにより設定された照明パラメータに応じて、カラー画像データに対して仮想照明を付加し、補正画像を生成する処理である。本実施形態において、ライティング処理により生成される補正画像I’は、例えば、下式(1)に従って生成される。
(Lighting process)
Here, the lighting process executed by the lighting processing unit 306 in step S409 will be described. As described above, the lighting process in step S409 adds virtual illumination to the color image data based on the distance image data and the normal image data, and further according to the illumination parameter set by the user, to obtain a corrected image. It is a process to generate. In the present embodiment, the corrected image I'generated by the lighting process is generated according to, for example, the following equation (1).

Figure 0007057086000001
Figure 0007057086000001

式(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.

Figure 0007057086000002
Figure 0007057086000002

以下、式(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 image pickup apparatus 101 to each pixel acquired based on the pixel value of the distance image data 502, the angle of view of the image pickup apparatus 101, and the color image data 501. It is calculated based on the image size of. Further, W is a function that returns a larger value as the distance from the position P of the pixel (i, j) to the position Q of the virtual illumination increases. That is, the function W corrects the pixels (i, j) so that they become brighter as they are closer to the virtual illumination.

式(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 color image data 501 can be corrected into a corrected image 1201 as if the subject was illuminated by virtual lighting. That is, as shown in the above equation, by executing the lighting process (by generating the corrected image), it is possible to correct the brightness according to the position of the illumination and the shape of the subject.

以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。具体的には、撮影画像上で大きさが同程度の被写体であっても、焦点距離の長いレンズを利用して長い被写体距離で撮影した場合と、焦点距離の短いレンズを利用して短い被写体距離で撮影した場合とで、ライティング処理により、異なる効果をもたらす。 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 ROM 202 based on the face information acquired from the face detection unit 302 and the distance image data acquired from the distance image acquisition unit 105. The data acquisition method is not necessarily limited to this. Therefore, for example, the face normal information can be selected in step S702 based on the subject distance acquired when the optical system control unit 204 focuses on the subject in step S701. If the RAW image data stored in the RAM 203 or the PC / media 213 includes the subject distance as tag information, the subject distance is acquired in step S701, and the face normal information is obtained in step S702. You can also choose.

(第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 normal image data 1401 to 1405 shown in FIG. 14 (a) and the region-specific face model normal organ positions shown in FIG. 14 (b).

図14(a)に示す領域別顔モデル法線画像データ1401~1405は、各々、顔概略形状、右目周辺領域、左目周辺領域、鼻周辺領域、口周辺領域における顔表面の法線ベクトルを、画素値に格納した画像データである。 The face model normal image data 1401 to 1405 for each region shown in FIG. 14 (a) have the normal shape of the face surface in the outline shape of the face, the region around the right eye, the region around the left eye, the region around the nose, and the region around the mouth, respectively. It is the image data stored in the pixel value.

また、図14(b)に示されるように、右目周辺領域、左目周辺領域、鼻周辺領域、口周辺領域に対応する領域別顔モデル法線画像データ1402~1405には、各々、器官の基準とする位置を示す器官基準位置が設定されている。即ち、領域別顔モデル法線器官位置は、顔概略形状に対応する領域別顔モデル法線画像データ1401における被写体距離に応じた器官の位置を示している。なお、図14に示す例では、0.5m、1.5m、5.0mの被写体距離に対応した領域別顔モデル法線器官位置を保持しているものとする(即ち、被写体距離毎に領域別顔モデル法線器官位置が格納される)。 Further, as shown in FIG. 14 (b), the face model normal image data 1402 to 1405 for each region corresponding to the right eye peripheral region, the left eye peripheral region, the nose peripheral region, and the mouth peripheral region are the reference of each organ. An organ reference position indicating the position to be used is set. That is, the region-specific face model normal organ position indicates the position of the organ corresponding to the subject distance in the region-specific face model normal image data 1401 corresponding to the approximate shape of the face. In the example shown in FIG. 14, it is assumed that the face model normal organ positions for each region corresponding to the subject distances of 0.5 m, 1.5 m, and 5.0 m are held (that is, the regions for each subject distance). Another face model normal organ position is stored).

第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 information acquisition unit 303 calculates the subject distance based on the face information acquired from the face detection unit 302 and the distance image data acquired from the distance image acquisition unit 105, as in step S701 of the first embodiment. (S1301).

顔モデル法線情報取得部303は、被写体距離を算出すると、図14に示す領域別顔モデル法線器官位置に基づいて、ステップS1301で取得した被写体距離に対応する顔モデル器官位置を、所定の補間処理により算出する(S1302)。 When the face model normal information acquisition unit 303 calculates the subject distance, the face model normal organ position corresponding to the subject distance acquired in step S1301 is determined based on the region-specific face model normal organ position shown in FIG. Calculated by interpolation processing (S1302).

ここで、顔モデル器官位置の算出に関して、説明を補足する。取得した被写体距離を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).

Figure 0007057086000003
Figure 0007057086000003

なお、式(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.

Figure 0007057086000004
Figure 0007057086000004

式(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 information acquisition unit 303 generates face model normal image data based on the area-specific face model normal image data and the calculated face model organ position (S1303). Specifically, for the face model normal image data 1401 for each region corresponding to the approximate shape of the face, the face model normal image data 1402 to other regions so that the face model organ position and the organ reference position match. Align 1405. Then, the face model normal image data is generated by overwriting the pixel values of the pixels having the normal information of the area-specific face model normal image data 1402 to 1405 with respect to the area-specific face model normal image data 1401. do. FIG. 15 shows, as an example, the face model normal image data 1501 generated by the process shown in FIG.

以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、領域別顔モデル法線情報として、被写体距離に関係なく、領域毎に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 information acquisition unit 303 will be described. In the present embodiment, regarding the acquisition process of the area-specific face model normal information, the area-specific face model normal information is acquired based on the distance image data and the face information. FIG. 16 shows a procedure for acquiring face model normal information for each region.

顔モデル法線情報取得部303は、第1実施形態のステップS701と同様に、顔検出部302より取得した顔情報と距離画像取得部105より取得した距離画像データに基づいて、被写体距離を算出する(S1601)。 The face model normal information acquisition unit 303 calculates the subject distance based on the face information acquired from the face detection unit 302 and the distance image data acquired from the distance image acquisition unit 105, as in step S701 of the first embodiment. (S1601).

顔モデル法線情報取得部303は、取得した被写体距離に対応する領域別顔モデル法線情報を選択する(S1602)。なお、ステップS1602の処理では、取得した被写体距離に最も近い領域別顔モデル法線情報を選択する。例えば、図14に示す領域別顔モデル法線情報の場合には、領域別顔モデル法線画像データ1401~1405と、領域別顔モデル法線器官位置のうち、取得した被写体距離に最も近いものを取得する。 The face model normal information acquisition unit 303 selects the area-specific face model normal information corresponding to the acquired subject distance (S1602). In the process of step S1602, the face model normal information for each region closest to the acquired subject distance is selected. For example, in the case of the area-specific face model normal information shown in FIG. 14, the area-specific face model normal image data 1401 to 1405 and the area-specific face model normal organ positions that are closest to the acquired subject distance. To get.

(顔法線画像データ生成処理)
ここでは、法線生成部304において実行される顔法線画像データ生成処理について説明する。本実施形態では、ステップS1602で取得した領域別顔モデル法線情報(即ち、領域別顔モデル法線画像データ1401~1405及び領域別顔モデル法線器官位置)に基づいて、顔法線画像データを生成する。図17に、顔法線画像データ生成処理の概要を示す。
(Face normal image data generation processing)
Here, the face normal image data generation process executed by the normal generation unit 304 will be described. In the present embodiment, the face normal image data is based on the region-specific face model normal information (that is, the region-specific face model normal image data 1401 to 1405 and the region-specific face model normal organ position) acquired in step S1602. To generate. FIG. 17 shows an outline of the face normal image data generation process.

先ず、法線生成部304は、アフィン変換を用いて、カラー画像データ501における被写体の顔に合うように領域別顔モデル法線画像データを変形する。顔概略形状に対応する領域別顔モデル法線画像データ1401のアフィンパラメータは、器官位置602とステップS1602で選択された領域別顔モデル法線器官位置に基づいて、最小二乗法を用いて算出される。 First, the normal generation unit 304 transforms the face model normal image data for each region so as to match the face of the subject in the color image data 501 by using the affine transformation. The affine parameters of the region-specific face model normal image data 1401 corresponding to the facial outline shape are calculated using the least squares method based on the organ position 602 and the region-specific face model normal organ position selected in step S1602. To.

次に、その他の領域別顔モデル法線画像データ1402~1405のアフィンパラメータを、器官位置602と領域別顔モデル法線画像データ1402~1405に対応する器官基準位置が一致するように、平行移動成分を補正したものとして算出する。これにより、領域別顔モデル法線画像データ1402~1405を、カラー画像データ501の被写体の器官位置602に合わせて、変形することができる。 Next, the affine parameters of the other area-specific face model normal image data 1402 to 1405 are translated so that the organ position 602 and the organ reference position corresponding to the area-specific face model normal image data 1402 to 1405 match. Calculated assuming that the components have been corrected. As a result, the area-specific face model normal image data 1402 to 1405 can be deformed according to the organ position 602 of the subject of the color image data 501.

そして、法線生成部304は、以上のように算出した変換パラメータを用いて領域別顔モデル法線画像データ1401~1405を変形し、領域別顔法線画像データ1701~1705を生成する。さらに、法線生成部304は、領域別顔法線画像データ1701~1705を統合することにより、顔法線画像データ1706を生成する。 Then, the normal generation unit 304 transforms the area-specific face model normal image data 1401 to 1405 using the conversion parameters calculated as described above, and generates the area-specific face normal image data 1701 to 1705. Further, the normal generation unit 304 generates the face normal image data 1706 by integrating the area-specific face normal image data 1701 to 1705.

即ち、本実施形態では、顔概略形状以外の領域別顔法線画像データ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 normal image data 1702 to 1705 other than the face outline shape are overwritten with the area-specific face normal image data 1701 corresponding to the face outline shape. , Face normal image data 1706 is generated. In all of the area-specific face normal image data 1702 to 1705, the background pixels (that is, the pixels having no normal information related to the area) are the area-specific face normal images corresponding to the outline shape of the face. Face normal image data 1706 is generated with the pixel value of the data 1701.

以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、ステップ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 image processing unit 208 shown in FIG. 18, in relation to the image processing device (image processing unit 208) according to the first embodiment, the subject model normal information is used instead of the face model normal information acquisition unit 303. The acquisition unit 1801 is mounted. In addition, the processing content of the normal generation unit 304 is also different.

被写体モデル法線情報取得部1801は、被写体までの距離情報と被写体情報に基づいて、複数の被写体モデル法線情報から被写体に合う法線情報を選択する。本実施形態では、ユーザ操作により選択された被写体情報を制御部205から取得する。被写体情報は、カラー画像データに含まれる被写体の種類を表し、例えば、人物の他にも、犬、猫等から選択することができるものとする。また、この場合、人物以外の被写体である、犬、猫等のみを被写体の対象とすることもできる。 The subject model normal information acquisition unit 1801 selects normal information suitable for the subject from a plurality of subject model normal information based on the distance information to the subject and the subject information. In the present embodiment, the subject information selected by the user operation is acquired from the control unit 205. The subject information represents the type of subject included in the color image data, and can be selected from, for example, a dog, a cat, or the like in addition to a person. Further, in this case, it is possible to target only a subject other than a person, such as a dog or a cat.

(画像処理部の処理フロー)
図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 information acquisition unit 1801 acquires subject information based on the user operation from the control unit 205 (S1905). The subject model normal information acquisition unit 1801 acquires the subject model normal information corresponding to the subject of the color image data 501 from a plurality of subject model normal information based on the subject distance and the subject information acquired in step S1905. (S1906). In this embodiment, it is assumed that the normal image data and the template image data according to the type of subject information and the subject distance are retained.

ここで、図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 normal image data 2001, 2002, and 2003 shown in FIG. 20A are subject model normal image data corresponding to the subject distances of 0.5 m, 1.5 m, and 5.0 m, respectively.

また、図20(b)に示す被写体モデルテンプレート画像データ2004、2005、2006は、被写体モデル法線画像データ2001、2002、2003をカラー画像データ501に位置合わせするために利用される。本実施形態では、被写体モデルテンプレート画像データ2004、2005、2006として、被写体モデル法線画像データ2001、2002、2003に対応する輪郭情報を、画像データとして保持しているものとする。 Further, the subject model template image data 2004, 2005, 2006 shown in FIG. 20B is used to align the subject model normal image data 2001, 2002, 2003 with the color image data 501. In the present embodiment, it is assumed that the subject model template image data 2004, 2005, 2006 holds the contour information corresponding to the subject model normal image data 2001, 2002, 2003 as the image data.

なお、図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 image processing unit 208 similarly describes a dog, a cat, or the like. It is assumed that various subject model normal information is retained according to the subject distance.

法線生成部304は、被写体モデル法線情報に基づいて、法線画像データを生成する(S1907)。法線画像データの生成において、法線生成部304は、先ず、被写体モデルテンプレート画像データを用いて、カラー画像データ501の被写体に対して、被写体モデル法線画像データを位置合わせするためのパラメータを算出する。本実施形態では、カラー画像データ501における被写体の輪郭情報を抽出し、被写体モデルテンプレート画像データとマッチングすることで、位置合わせパラメータを算出する。 The normal generation unit 304 generates normal image data based on the subject model normal information (S1907). In the generation of the normal image data, the normal generation unit 304 first uses the subject model template image data to set a parameter for aligning the subject model normal image data with respect to the subject of the color image data 501. calculate. In the present embodiment, the alignment parameter is calculated by extracting the contour information of the subject in the color image data 501 and matching it with the subject model template image data.

法線生成部304は、次に、算出した位置合わせパラメータに基づいて、被写体モデル法線画像データをカラー画像データ501に合わせて変換する。そして、法線生成部304は、第一実施形態と同様にカラー画像データを参照画像とする平滑化処理を施すことで、法線画像データを生成する。 Next, the normal generation unit 304 converts the subject model normal image data according to the color image data 501 based on the calculated alignment parameters. Then, the normal generation unit 304 generates the normal image data by performing a smoothing process using the color image data as a reference image as in the first embodiment.

以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、制御部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 control unit 205 or the like (that is, the control unit 205 is made to function as the subject information acquisition means), but the subject information is acquired. The method is not necessarily limited to this. Therefore, for example, the subject information can be stored in the RAM 203 or the like as the tag information of the color image data 501, and the subject information can be acquired from the RAM 203. Further, it is also possible to separately provide a subject detection processing unit to detect a plurality of types of subjects such as faces, dogs, cats, etc., and acquire subject information based on this.

加えて、本実施形態では、被写体モデルテンプレート画像データとして輪郭情報を画像データとして保持させたが、被写体モデルのテクスチャや特徴点情報を保持させてもよい。なお、この場合、ステップ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 image acquisition unit 208 Image processing unit 301 Development processing unit 303 Face model normal information acquisition unit 304 Normal generation unit

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.
前記生成手段は、前記距離情報に基づいて選択した法線情報を、前記距離情報に応じて変形することで、前記ライティング処理に適用する法線情報を生成することを特徴とする請求項に記載の画像処理装置。 The first aspect of the present invention is characterized in that the generation means generates normal information to be applied to the lighting process by transforming the normal information selected based on the distance information according to the distance information. The image processing device described. 前記記憶手段は、前記複数の法線情報を、前記撮像装置から前記被写体までの距離が短いほど、短い距離間隔で記憶することを特徴とする請求項又はに記載の画像処理装置。 The image processing device according to claim 1 or 2 , wherein the storage means stores the plurality of normal information at shorter distance intervals as the distance from the image pickup device to the subject is shorter. 前記記憶手段が記憶する法線情報は、前記被写体の所定の特徴パターンにおいて、所定の領域毎に設定される領域別の法線情報を含むことを特徴とする請求項1からのいずれか1項に記載の画像処理装置。 One of claims 1 to 3 , wherein the normal information stored by the storage means includes the normal information for each area set for each predetermined area in the predetermined feature pattern of the subject. The image processing apparatus described in the section. 前記生成手段は、前記距離情報に基づいて、前記領域別の法線情報を位置合わせすることで、前記ライティング処理に適用する法線情報を生成することを特徴とする請求項に記載の画像処理装置。 The image according to claim 4 , wherein the generation means generates normal information applied to the lighting process by aligning normal information for each area based on the distance information. Processing equipment. 前記生成手段は、前記距離情報に基づいて選択された前記領域別の法線情報を変形し、変形した前記領域別の法線情報を統合することで、前記ライティング処理に適用する法線情報を生成することを特徴とする請求項に記載の画像処理装置。 The generation means deforms the normal information for each region selected based on the distance information, and integrates the deformed normal information for each region, so that the normal information applied to the lighting process is applied. The image processing apparatus according to claim 4 , wherein the image processing apparatus is generated. 前記被写体の種類を示す被写体情報を取得する第二の取得手段をさらに備え、
前記生成手段は、前記被写体情報に基づいて、前記被写体の所定の特徴パターンに対応する法線情報を生成することを特徴とする請求項1からのいずれか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.
前記画像データから前記被写体を検出する検出手段をさらに備えることを特徴とする請求項に記載の画像処理装置。 The image processing apparatus according to claim 7 , further comprising a detection means for detecting the subject from the image data. 前記生成手段は、前記検出された被写体と、前記距離情報に基づいて選択された前記被写体の所定の特徴パターンに対応する法線情報とを位置合わせすることで、前記ライティング処理に適用する法線情報を生成することを特徴とする請求項に記載の画像処理装置。 The generation means aligns the detected subject with the normal information corresponding to a predetermined feature pattern of the subject selected based on the distance information, and thereby applies the normal to the lighting process. The image processing apparatus according to claim 8 , wherein information is generated. 前記被写体の所定の特徴パターンは、顔であることを特徴とする請求項1からのいずれか1項に記載の画像処理装置。 The image processing apparatus according to any one of claims 1 to 9 , wherein the predetermined feature pattern of the subject is a face. 被写体に関連する所定の特徴パターンに対応する法線情報を記憶する記憶手段を備えた画像処理装置における画像処理方法であって、
画像取得手段により、前記被写体を含むシーンを撮像することにより得られる画像データを取得する画像取得ステップと、
第一の取得手段により、前記シーンを撮像した撮像装置から前記被写体までの距離情報を取得する第一の取得ステップと、
生成手段により、前記距離情報と前記記憶手段が記憶する前記法線情報に基づき、前記画像データに対するライティング処理に適用する法線情報を生成する生成ステップと、
ライティング処理手段により、前記生成ステップにおいて生成した前記法線情報を用いて、前記画像データに対して、ライティング処理を実行するライティング処理ステップと
を含み、
前記記憶手段は、所定の特徴パターンに対応する法線情報を前記撮像装置から前記被写体までの距離に応じて、複数、記憶し、
前記生成手段は、前記記憶手段が記憶する複数の法線情報から前記距離情報に基づいて選択した法線情報を用いて、前記ライティング処理に適用する法線情報を生成することを特徴とする画像処理方法。
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.
コンピュータを、請求項1から1のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。 A program for making a computer function as each means of the image processing apparatus according to any one of claims 1 to 10.
JP2017186335A 2017-09-27 2017-09-27 Image processing equipment, image processing methods, and programs Active JP7057086B2 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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