JP2019062436A - Image processing apparatus, image processing method, and program - Google Patents

Image processing apparatus, image processing method, and program Download PDF

Info

Publication number
JP2019062436A
JP2019062436A JP2017186335A JP2017186335A JP2019062436A JP 2019062436 A JP2019062436 A JP 2019062436A JP 2017186335 A JP2017186335 A JP 2017186335A JP 2017186335 A JP2017186335 A JP 2017186335A JP 2019062436 A JP2019062436 A JP 2019062436A
Authority
JP
Japan
Prior art keywords
image data
subject
information
normal
face
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2017186335A
Other languages
Japanese (ja)
Other versions
JP7057086B2 (en
Inventor
有一 中田
Yuichi Nakada
有一 中田
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

Abstract

To generate an image taken under a desired illumination condition from a captured image even if a subject distance changes.SOLUTION: An image processing apparatus includes image acquisition means 301 for acquiring image data obtained by imaging a scene including a subject, first acquisition means 105 for acquiring distance information from an imaging apparatus that captures the scene to the subject, storage means 202 for storing normal line information corresponding to a predetermined feature pattern associated with the subject, generation means 304 for generating normal line information to be applied to lighting processing corresponding to the image data on the basis of the distance information and the normal line information stored in the storage means, and lighting processing means 306 for executing the lighting processing for the image data using the normal line information generated by the generation means.SELECTED DRAWING: Figure 3

Description

本発明は、画像処理装置、画像処理方法、及びプログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program.

人物を対象とした写真撮影において、顔の向きや構図、ライティング等は、被写体の印象を決める大きな要因の一つである。そのため、これらの撮影条件を写真撮影後に調整することで、被写体を補正することが行われている。例えば、特許文献1には、顔の立体形状を表す顔立体形状テンプレートより生成される顔モデルを用いて、被写体を補正する画像処理装置が開示されている。   In photographing a subject, the orientation, composition, lighting, etc. of the face are one of the major factors that determine the impression of the subject. Therefore, the subject is corrected by adjusting these shooting conditions after taking a picture. For example, Patent Document 1 discloses an image processing apparatus that corrects an object using a face model generated from a face solid shape template representing a face solid shape.

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

特開2014−49866号公報JP, 2014-49866, A

しかしながら、特許文献1の画像処理装置のように、少なくとも被写体距離を考慮することなく、顔立体形状テンプレートを選択する場合、被写体距離が変化すると、被写体の見た目とは異なる顔立体形状テンプレートが選択される可能性がある。そして、これにより、顔モデルも被写体と似つかないように生成され、結果、その顔モデルを用いて補正された被写体は不自然なものとして生成される。   However, as in the image processing apparatus of Patent Document 1, when selecting the face solid shape template without considering at least the subject distance, when the subject distance changes, a face solid shape template different from the subject's appearance is selected. There is a possibility of As a result, the face model is also generated so as not to match the subject, and as a result, the subject corrected using the face model is generated as unnatural.

本発明は、前記従来の問題に鑑みてなされたものであって、その目的は、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような画像を生成することである。   The present invention has been made in view of the above-described conventional problems, and an object thereof is to generate an image as if taken under a desired illumination condition from a captured image even if the subject distance changes. It is.

上記目的を達成するために、本発明の画像処理装置は、被写体を含むシーンを撮像することにより得られる画像データを取得する画像取得手段と、前記シーンを撮像した撮像装置から前記被写体までの距離情報を取得する第一の取得手段と、前記被写体に関連する所定の特徴パターンに対応する法線情報を記憶する記憶手段と、前記距離情報と前記記憶手段が記憶する前記法線情報に基づき、前記画像データに対するライティング処理に適用する法線情報を生成する生成手段と、前記生成手段が生成した前記法線情報を用いて、前記画像データに対して、ライティング処理を実行するライティング処理手段とを備える。   In order to achieve the above object, an image processing apparatus according to the present invention includes an image acquisition unit for acquiring image data obtained by imaging a scene including a subject, and a distance from the imaging apparatus which captured the scene to the subject A first acquisition unit for acquiring information, a storage unit for storing normal line information corresponding to a predetermined feature pattern related to the subject, the distance information, and the normal line information stored by the storage unit; A generation unit configured to generate normal information to be applied to the lighting processing on the image data; and a lighting processing unit configured to execute the lighting processing on the image data using the normal information generated by the generation unit. Prepare.

本発明によれば、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような画像を生成することができる。   According to the present invention, even if the subject distance changes, it is possible to generate an image as if taken under a desired illumination condition from the captured image.

画像処理装置を備えた撮像装置の外観を示す図である。It is a figure showing the appearance of the imaging device provided with the image processing device. 画像処理装置を備えた撮像装置の内部構成を示すブロック図である。It is a block diagram showing an internal configuration of an imaging device provided with an image processing device. 画像処理装置の機能構成を示すブロック図である。It is a block diagram showing functional composition of an image processing device. 画像処理装置における処理の手順を示すフローチャートである。5 is a flowchart showing the procedure of processing in the image processing apparatus. カラー画像データと距離画像データを示す図である。It is a figure which shows color image data and distance image data. 顔領域と器官位置を示す図である。It is a figure which shows a face area | region and an organ position. 顔モデル法線情報取得処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of a face model normal line information acquisition process. 顔モデル法線情報を示す図である。It is a figure which shows face model normal information. 法線画像データ生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of normal image data generation processing. 法線画像データ生成処理の概要を示す図である。It is a figure which shows the outline | summary of normal image data generation processing. ライティング処理の概要を示す図である。It is a figure which shows the outline | summary 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 a face model normal line information acquisition process. 領域別顔モデル法線情報を示す図である。It is a figure which shows area classified face model normal line information. 顔モデル法線情報を示す図である。It is a figure which shows face model normal information. 領域別顔モデル法線情報取得処理の手順を示すフローチャートである。It is a flow chart which shows a procedure of field model face information normal information acquisition processing according to field. 顔法線画像データ生成処理の概要を示す図である。It is a figure which shows the outline | summary of a face normal line image data generation process. 画像処理装置の機能構成を示すブロック図である。It is a block diagram showing functional composition of an image processing device. 画像処理装置における処理の手順を示すフローチャートである。5 is a flowchart showing the procedure of processing in the image processing apparatus. 被写体モデル法線情報を示す図である。It is a figure showing subject model normal line information.

(撮像装置の外観)
図1は、実施形態に係る画像処理装置を備えた撮像装置の外観を示す図であり、図1(a)は撮像装置の前面、図1(b)は背面の外観を各々、示している。撮像装置101は、光学部102、撮像ボタン103、ストロボ104、距離画像取得部105、表示部106、及び操作ボタン107を備える。
(Appearance of the imaging device)
FIG. 1 is a view showing an appearance of an imaging apparatus provided with an image processing apparatus according to the embodiment, and FIG. 1A shows an appearance of a front surface of the imaging apparatus and FIG. . The imaging apparatus 101 includes an optical unit 102, an imaging button 103, a flash 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 configured of a zoom lens, a focus lens, a shake correction lens, an aperture, and a shutter, and collects light information of an object. The imaging button 103 is a button for the user to instruct the imaging apparatus 101 to start imaging. The strobe 104 is an illumination that can be emitted in response to the start of imaging according to a user's instruction.

距離画像取得部105は、距離情報として、撮像指示に応じて撮像したシーンにおける被写体の距離画像データを取得する。ここで、距離画像データとは、画像の各画素の画素値として、その画素に対応する被写体距離を格納した画像データのことである。距離画像取得部105は、赤外光を発光する赤外発光部と、被写体に反射した赤外光を受光する受光部とを備える。距離画像取得部105は、赤外発光部において発光した赤外光が被写体に反射し、受光部が受光するまでの時間に基づいて、撮像装置から被写体までの距離値を算出する。そして、算出した距離値と受光部のセンサ画素数や画角等を含む距離撮像情報に基づいて、被写体の位置情報を算出し、距離画像データを生成する。なお、距離画像データの取得方法は、必ずしもこれに限られない。したがって、例えば、距離画像取得部105の代わりに光学部102と同様の光学系を設け、異なる2つの視点から撮像された画像データ間の視差に基づいて、三角測量を行うことにより距離画像データを取得することもできる。   The distance image acquisition unit 105 acquires, as distance information, distance image data of an object in a scene captured according to an imaging instruction. 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 acquiring 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 imaging device to the subject based on the time until the infrared light emitted from the infrared light emitting unit is reflected on the subject and the light receiving unit receives the light. Then, based on the calculated distance value and distance imaging information including the number of sensor pixels of the light receiving unit, the angle of view, etc., the position information of the object is calculated, and distance image data is generated. In addition, the acquisition method of distance image data is not necessarily restricted to this. Therefore, for example, an optical system similar to the optical unit 102 is provided instead of the distance image acquisition unit 105, and triangulation is performed 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 imaging device 101 and other various data. Note that as shown in FIG. 1, since the imaging device 101 is not provided with an optical finder, a framing operation (confirmation of focus and composition) is performed using the display unit 106. That is, since the imaging is performed while confirming the live view image in the display unit 106 regarding the imaging device 101, the display unit 106 also functions as an electronic finder when the framing and focusing operations are 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 imaging device 101 to switch the operation mode of the imaging device 101, various parameters at the time of imaging, and the like. Note that the imaging apparatus 101 includes, as one of the operation modes, a lighting processing mode in which the degree of illumination of the captured image is corrected after imaging. Therefore, the user uses the operation button 107 or the imaging button 103 to switch to the lighting processing mode, sets the illumination parameters of the virtual illumination used for the lighting processing, and selects the subject whose illumination condition is adjusted (corrected), etc. 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. In that case, it is also possible to handle a user instruction using the touch screen as an input of the operation button 107.

(撮像装置の内部構成)
図2は、実施形態に係る画像処理装置を備えた撮像装置の内部構成を示すブロック図である。CPU201は、各構成の処理の全てに関わり、ROM(Read Only Memory)202や、RAM(Random Access Memory)203に格納された命令を順に読み込み、解釈することで処理を実行する。
(Internal configuration of imaging device)
FIG. 2 is a block diagram showing an internal configuration of an imaging apparatus provided with the image processing apparatus according to the embodiment. The CPU 201 relates to all the processing of each configuration, and executes processing by sequentially reading and interpreting instructions stored in a ROM (Read Only Memory) 202 and a RAM (Random Access Memory) 203.

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

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

制御部205は、撮像ボタン103や操作ボタン107からのユーザ指示を受け取り、撮像モード、ライティング処理モード等への切り換え、被写体領域の選択、照明パラメータの設定等の制御を行う制御回路である。カラー撮像素子部206は、光学部102にて集光された光情報を電流値に変換する撮像素子である。カラー撮像素子部206は、ベイヤ配列等の所定の配列を有するカラーフィルタを備え、光学部102において集光された光から被写体の色情報を取得する。   A control unit 205 is a control circuit that receives a user instruction from the imaging button 103 or the operation button 107, controls switching to an imaging mode, a lighting processing mode, etc., selects a subject region, sets illumination parameters, and the like. The color imaging element unit 206 is an imaging element that converts the light information collected by the optical unit 102 into a current value. The color imaging element unit 206 includes a color filter having a predetermined arrangement such as a Bayer arrangement, and acquires color information of an object from light collected 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 color information of the subject detected in the color imaging device unit 206 into digital signal values to obtain RAW image data. In the present embodiment, it is assumed that distance image data and 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, and generates color image data. Further, the image processing unit 208 performs various image processing such as generation of corrected image data obtained by performing lighting processing on color image data using color image data and distance image data. The internal configuration and functions 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 displayed on the display unit 106 so as to be superimposed on image data, corrected image data, and the like. The encoder unit 210 converts various image data including color image data processed by the image processing unit 208 and corrected image data generated by 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 / F 211 is an interface for transmitting and receiving image data to and from the PC / media 213 (for example, a hard disk, a memory card, a CF card, an SD card, etc.). As the media I / F 211, 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 the functional configuration of the image processing apparatus (image processing unit 208) according to the embodiment. The development processing unit 301 performs white balance processing, demosaicing processing, noise reduction processing, color conversion processing, and the like on the RAW image data acquired from the A / D conversion unit 207, and generates color image data. The imaging apparatus 101 can output 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 the RAM 203 or the PC / media 213.

顔検出部302は、現像処理部301より取得したカラー画像データから被写体の顔情報を取得する。なお、被写体の顔情報には、カラー画像データにおいて被写体の顔が占める領域を示す顔領域と、顔に含まれる目や口等のカラー画像データにおける位置を示す器官位置とに関する情報が少なくとも含まれる。   The face detection unit 302 acquires face information of a subject from 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 line information matching the subject from the plurality of pieces of face model normal line information based on the distance information to the subject. In the present embodiment, face model normal line 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から距離画像データを各々、取得すると、それらの情報に基づいて、カラー画像データに対応する法線画像データを生成する。   The normal generation unit 304 acquires face information from the face detection unit 302, face model normal information from the face model normal information acquisition unit 303, and distance image data from the distance image acquisition unit 105, respectively, based on the information. And generates normal image data corresponding to the color image data.

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

(画像処理部の処理フロー)
図4は、実施形態に係る画像処理装置(画像処理部208)における処理の手順を示すフローチャートである。図4のフローチャートに示す処理において、画像処理部208は、先ず、カラー画像データから取得した顔情報と距離画像データに基づいて、顔モデル法線情報を選択する。画像処理部208は、次に、顔情報、顔モデル法線情報、及び距離画像データに基づいて、カラー画像データに対応する法線画像データを生成する。画像処理部208は、さらに、ユーザにより設定された照明パラメータ、距離画像データ及び法線画像データに基づいて、カラー画像データに仮想照明を付加するライティング処理を実行し、補正画像データを生成する。
(Processing flow of image processing unit)
FIG. 4 is a flowchart showing the procedure of processing in the image processing apparatus (image processing unit 208) according to the embodiment. In the process illustrated in the flowchart of FIG. 4, the image processing unit 208 first selects face model normal line information based on face information and distance image data acquired from color image data. Next, the image processing unit 208 generates normal image data corresponding to 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 lighting processing for adding virtual illumination to color image data based on the illumination parameters, distance image data and normal image data set by the user, and generates 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に記憶されているカラー画像データを直接、取得することもできる。   The processing procedure of the image processing unit 208 will be described in detail below. 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 pixel I (i, j) of the color image data 501, and each of the Ir (i, j) j) shown as Ig (i, j), Ib (i, j). The method of acquiring color image data is not necessarily limited to this. Therefore, for example, RAW image data stored in the RAM 203 or PC / media 213 can be acquired, and the development processing unit 301 can generate color image data from the acquired RAW image data. Further, color image data stored in the RAM 203 or the PC / media 213 can also be obtained directly.

画像処理部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 pixel D (i, j) of the distance image data 502 stores the distance value from the imaging device to the subject. In addition, the acquisition method of distance image data is not necessarily restricted to this. Therefore, for example, the distance image data stored in the RAM 203 or the PC / media 213 can also be obtained directly.

画像処理部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 to execute the writing process based on the state of the flag SW1 (S403). When the flag SW1 is OFF, the image processing unit 208 determines that the writing process is not to be performed (S403 No), and the process proceeds to Step S404. Further, when the flag SW1 is ON, it is determined that the lining process is to be performed (S403: Yes), and the process proceeds 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 writing process is not to be performed, the image processing unit 208 acquires the state of the flag SW2 from the RAM 203. Then, the image processing unit 208 outputs only color image data when the flag SW2 is OFF, and outputs color image data and distance image data to the PC / media 213 when the flag SW2 is ON (S404). Alternatively, the image processing unit 208 can output color image data to the display unit 106 and can display the color image data so that the user can confirm. When the image processing unit 208 executes the processing in step S404, the processing illustrated in FIG. 4 ends.

また、ステップS403において、ライティング処理を実行すると判定されると、顔検出部302は、カラー画像データに基づいて、顔情報を検出(取得)する(S405)。ここで、顔情報に関して、図6を用いて説明する。図6に示されるように、顔情報には、顔領域601及び器官位置602が含まれる。顔領域は、画像データにおいて、顔が含まれる領域の画素の集合として示される。器官位置602は、顔領域内における目、鼻、口等に対応する座標として示される。   If it is determined in step S403 that the lighting process is to be performed, 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 a face area 601 and an organ position 602. The face area is indicated in the image data as a set of pixels of the area including the face. The organ position 602 is shown as coordinates corresponding to the eyes, nose, mouth, etc. in the face area.

顔領域、器官位置の検出方法については、既存のアルゴリズムを適用することができる。既存のアルゴリズムとしては、テンプレートマッチングを用いたアルゴリズムや、Haar−Like特徴量を用いたアルゴリズム等があり、本実施形態では、テンプレートマッチングを適用することで、顔領域・器官位置を検出する。   An existing algorithm can be applied to a method of detecting a face area and an organ position. The existing algorithms include an algorithm using template matching, an algorithm using Haar-Like feature quantities, and the like. In this embodiment, the face region / organ position is detected by applying template matching.

テンプレートマッチングを適用した検出では、先ず、カラー画像データに対して、閾値処理を実行することで、肌色の領域を顔候補領域として抽出する。次に、様々な大きさの顔画像のテンプレートを用いて、顔候補領域に対してマッチング処理を実行し、尤度を算出する。そして、その算出した尤度に基づいて、顔領域か否かの判定処理を実行し、顔領域を抽出する。器官位置についても、抽出された顔領域に対して、目、鼻、口の画像のテンプレートを用いて、同様にマッチング処理を実行し、尤度を算出する。そして、この尤度の大きさに基づいて、顔領域・器官位置の信頼度を算出する。以上の処理を実行することで、顔領域601、器官位置602を取得する。   In the detection to which template matching is applied, first, a skin color area is extracted as a face candidate area by performing threshold processing on color image data. Next, matching processing is performed on the face candidate area using templates of face images of various sizes to calculate likelihood. Then, based on the calculated likelihood, a process of determining whether or not it is a face area is executed to extract a face area. Also for the organ position, the matching process is similarly performed on the extracted face area using the template of the eye, nose, and mouth image, and the likelihood is calculated. Then, based on the magnitude of the likelihood, the reliability of the face area / organ position is calculated. The face area 601 and the organ position 602 are acquired by executing the above processing.

次に、顔モデル法線情報取得部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 face model normal information in the face model normal information acquisition unit 303 will be described in detail with reference to FIG.

法線生成部304は、ステップS402、S405、及びS406で各々、取得した、距離画像データ、顔情報、及び顔モデル法線情報に基づいて、ステップS401で生成されたカラー画像データに対応する法線画像データを生成する(S407)。なお、法線生成部304における法線画像データを生成する処理に関しては、後述の図9、図10等を用いて詳述する。   The normal line 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. Line image data is generated (S407). The process of generating the normal line image data in the normal line generation unit 304 will be described in detail with reference to FIGS. 9 and 10 described later.

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

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

処理がステップS411に移行されると、画像処理部208は、RAM203からフラグSW2の状態を取得し、ライティング処理部306は、その取得したフラグSW2の状態に基づいて、各種データを出力する。ライティング処理部306は、フラグSW2がOFFの場合はカラー画像データ及び補正画像データを、フラグSW2がONの場合はカラー画像データ、補正画像データ、及び距離画像データをPC/メディア213に出力し、記憶する。その後、画像処理部208は、図4に示す処理を終了する。   When the process proceeds 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 the color image data and the correction image data when the flag SW2 is OFF, and outputs the color image data, the correction image data, and the distance image data to the PC / media 213 when the flag SW2 is ON. Remember. Thereafter, the image processing unit 208 ends the processing illustrated in FIG.

(顔モデル法線情報取得処理)
ここでは、ステップS406において、顔モデル法線情報取得部303により実行される顔モデル法線情報取得処理(即ち、距離画像データと顔情報に基づいて、顔モデル法線情報を取得する処理)について説明する。
(Face model normal information acquisition processing)
Here, in step S406, the process of acquiring face model normal information (that is, the process of acquiring face model normal information based on distance image data and face information) executed by the face model normal information acquisition unit 303. 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. 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, face model normal information closest to the subject distance calculated in step S701 is selected from a 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 line information according to the subject distance. In FIG. 8, face model normal information 801, 802, 803 are face model normal information according to subject distances of 0.5 m, 1.5 m, and 5.0 m, respectively, and these face model normal information is It is stored in the ROM 202.

顔モデル法線情報は、顔表面の法線ベクトル(即ち、被写体距離の位置から観察したときの顔表面の向き)を画素値に格納した顔モデル法線画像データと、顔モデル法線画像データにおける目・鼻・口等の器官位置を示す顔モデル法線器官位置とを含む。なお、顔モデル法線画像データにおける顔領域以外の領域における画素(即ち、背景画素)には、背景画素を示す画素値を格納するものとする。   The face model normal information includes face model normal image data storing face vector normal vectors (that is, the direction of the face surface when observed from the position of the object distance) in pixel values, and face model normal image data A face model normal organ position indicating an organ position such as eyes, nose and mouth in Note that pixel values indicating background pixels are stored in pixels (that is, background pixels) in areas other than the face area in the face model normal image data.

図8に示されるように、正面顔の場合、被写体距離が短いほど目・口等の器官位置が中心から離れ(即ち、顔輪郭に近付き)、被写体距離が長くなるほど目・口等の器官位置が顔の中央に寄ったような見た目となる。このように、被写体距離によって、顔輪郭と目、鼻、口等のバランスは変化し、また、器官位置の変化は、被写体距離が短いほど、大きくなる。このため、顔モデル法線情報に関して、被写体距離が短いほど、短い距離間隔で顔モデル法線情報を保持しておくことが好ましい。   As shown in FIG. 8, in the case of a frontal face, organ positions such as eyes and mouth move away from the center as the subject distance decreases (that is, approach to the face contour) and organ positions such as eyes and mouth as the subject distance increases. Looks like it was in the middle of the face. As described above, the balance between the face contour and the eyes, nose, mouth, and the like changes according to the subject distance, and the change in organ position increases as the subject distance decreases. Therefore, with regard to face model normal information, it is preferable to hold face model normal information at short distance intervals as the subject distance is shorter.

また、図8では、顔モデル法線情報が3つの場合を、その一例として説明したが、顔モデル法線情報の数は、これに限定されるものではない。したがって、例えば、ROM202等の容量に応じて、顔モデル法線情報の数を2つに設定しても、また4つ以上に設定してもよい。なお、顔モデル法線情報の数を多く設定すれば、撮影時の条件により適合した顔モデル法線情報を選択することができる。   Further, in FIG. 8, the case where the face model normal line information is three has been described as an example, but the number of face model normal line information is not limited to this. Therefore, for example, depending on the capacity of the ROM 202 or the like, the number of pieces of face model normal line information may be set to two or four or more. If the number of pieces of face model normal information is set to a large number, it is possible to select face model normal information that conforms to the conditions at the time of shooting.

(法線画像データ生成処理)
ここでは、ステップS407において、法線生成部304により実行される法線画像データ生成処理(即ち、顔情報、顔モデル法線情報、及び距離画像データに基づいてカラー画像データに対応する法線画像データを生成する処理)について説明する。以下、法線画像データ生成処理の手順及び概要に関して、各々、図9及び図10を用いて詳述する。
(Normal image data generation process)
Here, normal image data generation processing performed by the normal generation unit 304 in step S407 (ie, a normal image corresponding to color image data based on face information, face model normal information, and distance image data A 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 generation of subject normal line image data according to the present embodiment, the normal line generation unit 304 first generates a two-dimensional coordinate value of a pixel in the distance image data and a distance value acquired from the pixel value of the pixel. , Three-dimensional coordinate values are calculated for each pixel. Then, the normal-line generating unit 304 next calculates a normal vector corresponding to each pixel based on the calculated coordinate value. Note that the normal vector corresponding to the pixel of interest is calculated based on the gradient calculated from the three-dimensional coordinate values of the vicinity region of the pixel of interest. Thus, the normal line generation unit 304 generates the subject normal line 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 generation of face normal image data according to the present embodiment, the normal generation unit 304 generates a 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. The face normal image data 1002 is generated by deforming the normal image data. In the present embodiment, affine transformation is used to deform face model normal image data so as to fit the face of the subject in the color image data 501. Specifically, an affine parameter is calculated from the organ position 602 and the face model normal organ position using the least squares method, and the face model normal image parameter is deformed based on the calculated affine parameter. Line image data 1002 is generated. In the face normal image data, background pixels other than the face store pixel values indicating the background pixels.

法線生成部304は、被写体法線画像データ1001と顔法線画像データ1002を生成すると、それらを統合し、さらに平滑化することで、法線画像データを生成する(S903)。具体的には、先ず、顔法線画像データ1002の顔領域以外の領域における画素(即ち、背景画素)は被写体法線画像データ1001の画素値、それ以外の画素は顔法線画像データ1002の画素値となるように、画像データを統合する。即ち、統合法線画像データ1003を生成する。法線生成部304は、次に、生成した統合法線画像データ1003に対して、平滑化処理を実行することで、法線画像データ1004を生成する。なお、本実施形態では、カラー画像データ501を参照画像として、統合法線画像データ1003に平滑化処理を適用するものとする。また、この場合、例えば、カラー画像データ501を参照画像とするジョイントバイラテラルフィルタを適用すればよい。   When the subject normal image data 1001 and the face normal image data 1002 are generated, the normal generation unit 304 integrates them and smoothes them to generate normal image data (S903). Specifically, first, the pixels in the area other than the face area of the face normal image data 1002 (that is, background pixels) are the pixel values of the subject normal image data 1001, and the other pixels are the face normal image data 1002. The image data is integrated so as to be a pixel value. That is, integrated normal image data 1003 is generated. Next, the normal line generation unit 304 generates normal line image data 1004 by performing smoothing processing on the generated integrated normal line image data 1003. In the present embodiment, smoothing processing is applied to the integrated normal image data 1003 using the color image data 501 as a reference image. 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. In addition, the process which produces | generates normal line image data is not necessarily limited to the above-mentioned process. Therefore, for example, normal image data can be generated only from the face normal image data 1002 without generating the object normal image data 1001. Further, in this case, instead of the object normal image data 1001, image data in which appropriate normal vectors are stored in all pixels may be provided.

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

式(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 equation (1), I'r, I'g, I'b are the pixel values of the corrected image data I ', Lrm, Lgm, Lbm are the colors of the m-th illumination, and km is the degree of correction for the m-th illumination Represent. Furthermore, the correction degree km for the mth illumination is determined based on the position Q of the virtual illumination, the intensity (brightness of illumination) α, the posture U, the distance value corresponding to the pixel (x, y), and the normal vector N For example, it is calculated by the following equation (2). The color L of the virtual illumination, the position Q, the intensity α, and the attitude U are illumination parameters set by the user. Further, t is a correction coefficient for adjusting the degree of correction by the virtual illumination, 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 equation (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). Note that P is the distance value from the imaging device 101 to each pixel (that is, the distance value of each pixel) acquired based on the pixel value of the distance image data 502, the angle of view of the imaging device 101, color image data 501 It is calculated based on the image size of 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 pixel (i, j) to be brighter as it is 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 equation (2), K is a function that returns a larger value as ρ is smaller, and ρ is a vector V (i, j) from the position P of the pixel (i, j) to the position Q of the virtual illumination , It is shown by the angle which the attitude | position U of illumination makes. 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 numerator of the equation (2), the vector V from the pixel P (i, j) toward the virtual illumination and the normal vector N It is corrected that the smaller the angle formed, the brighter the pixel. By performing this correction, for example, as shown in FIG. 12 and the like, the color image data 501 can be corrected to a corrected image 1201 as if the subject was illuminated by virtual illumination. That is, as shown in the above equation, by performing the lighting process (by generating a correction image), it is possible to correct the brightness according to the position of the illumination and the shape of the subject.

以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。具体的には、撮影画像上で大きさが同程度の被写体であっても、焦点距離の長いレンズを利用して長い被写体距離で撮影した場合と、焦点距離の短いレンズを利用して短い被写体距離で撮影した場合とで、ライティング処理により、異なる効果をもたらす。   As described above, according to the present invention, even if the subject distance changes, it is possible to generate another image as if taken under a desired illumination condition from the captured image. Specifically, even when the subject is of the same size on the photographed image, the subject is photographed at a long subject distance using a lens having a long focal length, and the subject is short using a lens having a short focal length The lighting process produces different effects depending on the distance taken.

なお、本実施形態では、顔法線情報に関して、顔検出部302から取得した顔情報及び距離画像取得部105から取得した距離画像データに基づいて、ROM202から取得する仕様として説明したが、距離画像データの取得方法は必ずしもこれに限られない。したがって、例えば、ステップS701において、光学系制御部204が被写体にフォーカスを合わせたときに取得した被写体距離に基づいて、ステップS702において顔法線情報を選択することもできる。また、RAM203やPC/メディア213に記憶されているRAW画像データにタグ情報として被写体距離が含まれている場合は、ステップS701において、その被写体距離を取得して、ステップS702において顔法線情報を選択することもできる。   In the present embodiment, the face normal information is described as a specification to be 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, face normal information can be selected in step S702 based on the subject distance acquired when the optical system control unit 204 brings the subject into focus 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 input in step S702. It can also be selected.

(第2実施形態)
第1実施形態では、被写体距離に応じて、複数の顔モデル法線情報から被写体に適した顔モデル法線情報を選択したが、本実施形態(第2実施形態)では、被写体距離に応じて領域別顔モデル法線情報から顔モデル法線情報を生成する。これにより、様々な被写体距離に対応する顔モデル法線情報を取得することができる。
Second Embodiment
In the first embodiment, the face model normal information suitable for the subject is selected from the plurality of face model normal information in accordance with the subject distance, but in the present embodiment (the second embodiment), in accordance with the subject distance. Face model normal information is generated from region-specific face model normal information. Thereby, face model normal line information corresponding to various subject distances can be acquired.

図14は、領域別顔モデル法線情報をその一例として示すものである。領域別顔モデル法線情報は、図14(a)に示す領域別顔モデル法線画像データ1401〜1405と図14(b)に示す領域別顔モデル法線器官位置を含む。   FIG. 14 shows region-specific face model normal line information as an example. The area-specific face model normal line information includes the area-specific face model normal image data 1401 to 1405 shown in FIG. 14A and the area-specific face model normal organ position shown in FIG.

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

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

第2実施形態では、ステップS406の顔モデル法線情報の取得処理が第1実施形態と異なる。図13は、本発明の第2実施形態に係る画像処理装置(画像処理部208)における顔モデル法線情報の取得処理の手順を示すフローチャートである。   In the second embodiment, the process of acquiring face model normal information in step S406 is different from that of the first embodiment. FIG. 13 is a flowchart showing a procedure of acquisition processing of 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 face model normal information acquisition processing 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 organ position corresponding to the subject distance acquired in step S1301 is determined based on the region model face model normal organ position shown in FIG. It is calculated by interpolation processing (S1302).

ここで、顔モデル器官位置の算出に関して、説明を補足する。取得した被写体距離をlとした場合、領域別顔モデル法線器官位置が設定された被写体距離のうち、取得した被写体距離であるlよりも小さく、またlに最も近い被写体距離lAに対応した領域別顔モデル法線器官位置の座標(xA、yA)を選択する。同様に、領域別顔モデル法線器官位置が設定された被写体距離のうち、取得した被写体距離であるlよりも大きく、またlに最も近い被写体距離lBに対応した領域別顔モデル法線器官位置の座標(xB、yB)を選択する。そして、この場合、顔モデル器官位置(x’、y’)は、下式(3)のように求めることができる。   Here, the description will be supplemented regarding the calculation of the face model organ position. Assuming that the acquired subject distance is l, an area corresponding to the subject distance lA which is smaller than l which is the acquired subject distance and is closest to l among the subject distances for which the region-specific face model normal organ position is set. The coordinates (xA, yA) of another face model normal organ position are selected. Similarly, an area-specific face model normal organ position corresponding to an object distance lB that is larger than the acquired object distance l and is closest to l among the object distances for which the area-specific face model normal organ position is set. Select the coordinates (xB, yB) of. And in this case, face model organ position (x ', y') can be calculated | required like the following Formula (3).

なお、式(3)において、wはl、lA、lBから算出される重みであり、例えば、下式(4)のように求めることができる。   In Equation (3), w is a weight calculated from l, 1A, and 1B, and can be obtained, for example, as the following Equation (4).

式(4)において、γは、重みwを調整するためのパラメータであり、領域別顔モデル法線器官位置が設定された被写体距離の間隔(例えば、0.1m、0.5m、1.0m 等)に応じて調整することができる。γに関して、領域別顔モデル法線器官位置が設定された被写体距離の間隔が、所定の値よりも短い間隔である場合には1に設定され、また、所定の値よりも長い間隔である場合には1より大きい値に設定される。このように設定することで、被写体距離が短いほど器官の移動量を大きく、被写体距離が長いほど器官の移動量を小さくすることができる。   In Equation (4), γ is a parameter for adjusting the weight w, and is an interval (for example, 0.1 m, 0.5 m, 1.0 m) of the subject distance in which the position of the region-specific face model normal organ is set. Etc.) can be adjusted. Regarding γ, the subject distance interval for which the region-specific face model normal organ position is set is set to 1 if the interval is shorter than a predetermined value, and if the interval is longer than the predetermined value Is set to a value greater than one. By setting in this way, it is possible to increase the movement amount of the organ as the subject distance is shorter and to decrease the movement amount of the organ as the subject distance is longer.

顔モデル法線情報取得部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 region-specific face model normal image data and the calculated face model organ position (S1303). Specifically, with respect to region-specific face model normal image data 1401 corresponding to the face outline shape, other region-specific face model normal image data 1402-1402 are matched so that the face model organ position and the organ reference position coincide. Align 1405. Then, the face model normal image data is generated by overwriting the pixel value of the pixel having normal information of the region-specific face model normal image data 1402 to 1405 with respect to the region-specific face model normal image data 1401. Do. FIG. 15 shows face model normal image data 1501 generated by the processing shown in FIG. 13 as an example thereof.

以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、領域別顔モデル法線情報として、被写体距離に関係なく、領域毎に1つの領域別顔モデル法線画像データを保持するものとして説明したが、異なる被写体距離に対応する領域別顔モデル法線画像データを各々、複数保持させてもよい。したがって、例えば、0.5m、1.5m、5.0mの被写体距離に対応する領域別顔モデル法線画像データを各々、保持し、ステップS1301で算出した被写体距離と最も近い被写体距離に対応する領域別顔モデル法線画像データを取得することもできる。また、領域(器官)毎に保持する、領域別顔モデル法線画像データの枚数を変更することもできる。例えば、顔概略形状や鼻周辺領域に対応する領域別顔モデル法線画像データは複数枚保持させ、右目周辺領域、左目周辺領域、口周辺領域に対応する領域別顔モデル法線画像データは一枚のみ保持させてもよい。   As described above, according to the present invention, even if the subject distance changes, it is possible to generate another image as if taken under a desired illumination condition from the captured image. In the present embodiment, although it has been described that one region-by-region face model normal image data is held for each region as region-by-region face model normal information, it corresponds to different object distances. A plurality of region-specific face model normal image data may be held. Therefore, for example, region-specific face model normal image data corresponding to object distances of 0.5 m, 1.5 m, and 5.0 m are held, and the object distance closest to the object distance calculated in step S1301 is stored. Area-specific face model normal image data can also be acquired. In addition, it is possible to change the number of face model normal image data classified by area, which is held for each area (organ). For example, a plurality of face model normal image data corresponding to the face outline shape and the nose peripheral area are held, and the face model normal image data corresponding to the right eye peripheral area, the left eye peripheral area and the mouth peripheral area is one. Only the sheet may be held.

(第3実施形態)
第2実施形態では、領域別顔モデル法線情報に基づいて、顔モデル法線情報を生成したが、本実施形態(第3実施形態)では、被写体距離に応じて、領域別顔モデル法線情報を選択し、顔法線画像データを生成する。
Third Embodiment
In the second embodiment, the face model normal information is generated based on the region-specific face model normal information. However, in the present embodiment (third embodiment), the region-specific face model normal is generated according to the subject distance. Information is selected to generate face normal image data.

第3実施形態では、第1実施形態との関係(比較)でステップS406が異なり、ステップS406の顔モデル法線情報の取得処理の代わりに、領域別顔モデル法線情報の取得処理を実行する。また、ステップS902の顔法線画像データ生成処理の処理内容が第1実施形態と異なる。以下、これらの処理(即ち、領域別顔モデル法線情報の取得処理及び顔法線画像データ生成処理)に関して、詳述する。   In the third embodiment, step S406 is different in the relationship (comparison) with the first embodiment, and instead of the processing for acquiring face model normal information in step S406, processing for acquiring area model face normal information is executed. . Further, the processing content of the face normal image data generation processing of step S902 is different from that of the first embodiment. Hereinafter, these processes (that is, the process of acquiring face model normal information by region and the process of generating face normal image data) will be described in detail.

(領域別顔モデル法線情報取得処理)
ここでは、顔モデル法線情報取得部303において実行される領域別顔モデル法線情報取得処理について説明する。本実施形態では、領域別顔モデル法線情報の取得処理に関して、距離画像データと顔情報に基づいて、領域別顔モデル法線情報を取得する。図16に、領域別顔モデル法線情報取得処理の手順を示す。
(Area-specific face model normal information acquisition processing)
Here, an area-specific face model normal information acquisition process executed by the face model normal information acquisition unit 303 will be described. In this embodiment, area-specific face model normal line information is acquired based on distance image data and face information in regard to the process of acquiring area-specific face model normal line information. FIG. 16 shows the procedure of region type face model normal information acquisition processing.

顔モデル法線情報取得部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 region model face normal information corresponding to the acquired subject distance (S1602). Note that, in the processing of step S1602, region-specific face model normal line information closest to the acquired subject distance is selected. For example, in the case of region-by-region face model normal information shown in FIG. 14, the region-by-region face model normal image data 1401 to 1405 and the region-by-region face model normal image position are the closest to the acquired subject distance To get

(顔法線画像データ生成処理)
ここでは、法線生成部304において実行される顔法線画像データ生成処理について説明する。本実施形態では、ステップS1602で取得した領域別顔モデル法線情報(即ち、領域別顔モデル法線画像データ1401〜1405及び領域別顔モデル法線器官位置)に基づいて、顔法線画像データを生成する。図17に、顔法線画像データ生成処理の概要を示す。
(Face normal image data generation process)
Here, the face normal image data generation process executed by the normal line generation unit 304 will be described. In the present embodiment, face normal image data is obtained 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. Generate FIG. 17 shows an outline of face normal image data generation processing.

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

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

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

即ち、本実施形態では、顔概略形状以外の領域別顔法線画像データ1702〜1705において法線情報を有する画素を、顔概略形状に対応する領域別顔法線画像データ1701に上書きすることで、顔法線画像データ1706を生成している。なお、領域別顔法線画像データ1702〜1705の全てにおいて背景となる画素(即ち、その領域に関連する法線情報を有さない画素)は、顔概略形状に対応する領域別顔法線画像データ1701の画素値で顔法線画像データ1706が生成される。   That is, in the present embodiment, the pixels having normal line information in the region-by-region face normal image data 1702 to 1705 other than the face general shape are overwritten on the region-by-region face normal image data 1701 corresponding to the face general shape. , Face normal image data 1706 is generated. Note that the pixels serving as the background in all of the region-by-region face normal image data 1702 to 1705 (that is, the pixels having no normal line information related to the region) are region-by-region face normal images corresponding to the face outline shape. Face normal image data 1706 is generated using the pixel values of the data 1701.

以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、ステップS1602において、取得した被写体距離に最も近い領域別顔モデル法線器官位置を選択していたが、第2実施形態のステップS1302で上述したように、補間処理により領域別顔モデル法線器官位置を算出してもよい。   As described above, according to the present invention, even if the subject distance changes, it is possible to generate another image as if taken under a desired illumination condition from the captured image. In the present embodiment, the region model normal model position closest to the acquired subject distance is selected in step S1602, but as described above in step S1302 in the second embodiment, the region is obtained by interpolation processing. Another face model normal organ position may be calculated.

また、本実施形態では、領域別顔モデル法線情報として、領域毎に1つの領域別顔モデル法線画像データを保持するものとして説明したが、異なる被写体距離に対応する領域別顔モデル法線画像データを各々、複数保持させてもよい。したがって、例えば、0.5m、1.5m、5.0mの被写体距離に対応する領域別顔モデル法線画像データを各々、保持し、ステップS1601で算出した被写体距離と最も近い被写体距離に対応する領域別顔モデル法線画像データを取得することもできる。   Further, in the present embodiment, it has been described that one region-by-region face model normal image data is held for each region as region-by-region face model normal information, but region-by-region face model normals corresponding to different subject distances A plurality of image data may be held. Therefore, for example, region-specific face model normal image data corresponding to subject distances of 0.5 m, 1.5 m, and 5.0 m are held, and the subject distance closest to the subject distance calculated in step S 1601 is corresponded. Area-specific face model normal image data can also be acquired.

加えて、領域(器官)毎に保持する、領域別顔モデル法線画像データの枚数を変更することもできる。例えば、顔概略形状や鼻周辺領域に対応する領域別顔モデル法線画像データは複数枚保持させ、右目周辺領域、左目周辺領域、口周辺領域に対応する領域別顔モデル法線画像データは一枚のみ保持させてもよい。   In addition, it is also possible to change the number of region-specific face model normal image data held for each region (organ). For example, a plurality of face model normal image data corresponding to the face outline shape and the nose peripheral area are held, and the face model normal image data corresponding to the right eye peripheral area, the left eye peripheral area and the mouth peripheral area is one. Only the sheet may be held.

(第4実施形態)
第1実施形態から第3実施形態までは、主に処理対象を人物として説明したが、本実施形態では、人物(より詳細には、人物の顔)に加えて他の被写体も処理対象とする。これにより、様々な被写体に対して被写体距離に応じた法線情報を取得することができる。
Fourth Embodiment
In the first to third embodiments, 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. . This makes it possible to acquire normal line 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 the image processing apparatus (image processing unit 208) according to the embodiment (the fourth embodiment) of the present invention. In the functional configuration of the image processing unit 208 shown in FIG. 18, subject model normal information instead of the face model normal information acquisition unit 303 in relation to the image processing apparatus (image processing unit 208) according to the first embodiment. An acquisition unit 1801 is implemented. In addition, the processing content of the normal generation unit 304 is also different.

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

(画像処理部の処理フロー)
図19は、本発明の実施形態に係る画像処理装置(画像処理部208)における処理の手順を示すフローチャートである。図19に示すフローチャートは、図4に示すフローチャートとの関係(比較)で、ステップS1905〜ステップS1907の処理が異なる。
(Processing flow of image processing unit)
FIG. 19 is a flowchart showing the procedure of processing 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 flowchart shown in FIG. 4 in the processes (steps S1905 to S1907).

以下、ステップS1905〜ステップS1907の各処理について、説明する。図19のステップS1903において、ライティング処理を実行すると判定されると、被写体モデル法線情報取得部1801は、制御部205からユーザ操作に基づいた被写体情報を取得する(S1905)。被写体モデル法線情報取得部1801は、被写体距離とステップS1905で取得した被写体情報に基づいて、複数の被写体モデル法線情報の中からカラー画像データ501の被写体に対応する被写体モデル法線情報を取得する(S1906)。なお、本実施形態では、被写体情報の種類と被写体距離に応じた法線画像データとテンプレート画像データを保持しているものとする。   Hereinafter, each process of step S1905 to step S1907 will be described. If it is determined in step S1903 in FIG. 19 that the lighting process is to be performed, the subject model normal information acquisition unit 1801 acquires subject information based on a user operation from the control unit 205 (S1905). The subject model normal information acquisition unit 1801 acquires subject model normal line information corresponding to the subject in the color image data 501 from among a plurality of subject model normal line information based on the subject distance and the subject information acquired in step S1905. (S1906). In the present embodiment, it is assumed that normal image data and template image data are held according to the type of subject information and subject distance.

ここで、図20に、本実施形態における被写体モデル法線情報をその一例として示す。被写体モデル法線情報は、図20に示されるように、被写体モデル法線画像データと被写体モデルテンプレート画像データを含む。図20(a)に示す被写体モデル法線画像データ2001、2002、2003は各々、0.5m、1.5m、5.0mの被写体距離に応じた被写体モデル法線画像データである。   Here, FIG. 20 shows subject model normal line information in this embodiment as an example. The subject model normal information includes subject model normal image data and subject model template image data, as shown in FIG. Subject model normal image data 2001, 2002, and 2003 shown in FIG. 20A are subject model normal image data according to 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, subject model template image data 2004, 2005, 2006 shown in FIG. 20B is used to align subject model normal image data 2001, 2002, 2003 with color image data 501. In the present embodiment, it is assumed that contour information corresponding to subject model normal image data 2001, 2002, 2003 is held as image data as subject model template image data 2004, 2005, 2006.

なお、図20では、被写体モデル法線情報として、人物の顔(特徴パターン)に対応する被写体モデル法線情報をその一例として説明したが、画像処理部208は、同様に、犬、猫等の様々な被写体モデル法線情報を被写体距離に応じて保持しているものとする。   In FIG. 20, subject model normal line information corresponding to a person's face (feature pattern) has been described as an example of the subject model normal line information. It is assumed that various subject model normal line information is held according to the subject distance.

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

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

以上のように、本発明では、被写体距離が変化しても、撮像画像から所望の照明条件下で撮影したかのような別の画像を生成することができる。なお、本実施形態では、制御部205等から取得した撮影時のユーザ操作に基づいて被写体情報を取得したが(即ち、制御部205を被写体情報取得手段として機能させたが)、被写体情報の取得方法は、必ずしもこれに限定されない。したがって、例えば、カラー画像データ501のタグ情報として被写体情報をRAM203等に記憶しておき、その被写体情報をRAM203から取得することもできる。また、別途、被写体検出処理部を具備させ、顔、犬、猫等、複数種類の被写体を検出し、これに基づいて、被写体情報を取得することもできる。   As described above, according to the present invention, even if the subject distance changes, it is possible to generate another image as if taken under a desired illumination condition from the captured image. In the present embodiment, 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, although the control unit 205 functions as a subject information acquisition unit), acquisition of subject information The method is not necessarily limited to this. Therefore, for example, subject information may be stored in the RAM 203 or the like as tag information of the color image data 501, and the subject information may be acquired from the RAM 203. Alternatively, a subject detection processing unit may be separately provided to detect a plurality of types of subjects such as a face, a dog, and a cat, and subject information may be acquired based on the detected subjects.

加えて、本実施形態では、被写体モデルテンプレート画像データとして輪郭情報を画像データとして保持させたが、被写体モデルのテクスチャや特徴点情報を保持させてもよい。なお、この場合、ステップS1907において、テクスチャや特徴点情報に基づいて、位置合わせパラメータを算出すればよい。   In addition, in the present embodiment, contour information is held as image data as subject model template image data, but textures and feature point information of the subject model may be held. In this case, in step S1907, alignment parameters may be calculated based on the texture and feature point information.

(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that implements one or more functions of the above-described embodiments to a system or apparatus via a network or storage medium, and one or more processors in a computer of the system or apparatus read and execute the program. Can also be realized. It can also be implemented by a circuit (eg, an ASIC) that implements one or more functions.

その他、以上において、好ましい実施形態として、主に人物の顔等を例示し説明したが、被写体は、必ずしも人物の顔等に限定されない。したがって、例えば、所定の部分において法線にばらつきを有する物体であって、また、法線情報を格納する上でモデル化することが可能な物体であれば、その物体を本発明の被写体として適用することができる。   Besides, in the above, as a preferred embodiment, mainly the face and the like of a person are illustrated and described, but the subject is not necessarily limited to the face and the like of a person. Therefore, for example, if it is an object having a variation in normal in a predetermined part, and the object can be modeled in 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 (13)

被写体を含むシーンを撮像することにより得られる画像データを取得する画像取得手段と、
前記シーンを撮像した撮像装置から前記被写体までの距離情報を取得する第一の取得手段と、
前記被写体に関連する所定の特徴パターンに対応する法線情報を記憶する記憶手段と、
前記距離情報と前記記憶手段が記憶する前記法線情報に基づき、前記画像データに対するライティング処理に適用する法線情報を生成する生成手段と、
前記生成手段が生成した前記法線情報を用いて、前記画像データに対して、ライティング処理を実行するライティング処理手段と
を備えることを特徴とする画像処理装置。
An image acquisition unit that acquires image data obtained by imaging a scene including a subject;
A first acquisition unit that acquires distance information from the imaging device that has captured the scene to the subject;
Storage means for storing normal line information corresponding to a predetermined feature pattern associated with the subject;
Generation means for generating normal line information to be applied to lighting processing on the image data based on the distance information and the normal line information stored in the storage means;
An image processing apparatus comprising: lighting processing means for performing a lighting process on the image data using the normal line information generated by the generation means.
前記記憶手段は、所定の特徴パターンに対応する法線情報を前記撮像装置から前記被写体までの距離に応じて、複数、記憶し、
前記生成手段は、前記距離情報に基づいて、前記記憶手段が記憶する複数の法線情報から法線情報を選択することを特徴とする請求項1に記載の画像処理装置。
The storage means stores a plurality of normal line information corresponding to a predetermined feature pattern in accordance with the distance from the imaging device to the subject,
The image processing apparatus according to claim 1, wherein the generation unit selects normal line information from a plurality of normal line information stored in the storage unit based on the distance information.
前記生成手段は、前記距離情報に基づいて選択した法線情報を、前記距離情報に応じて変形することで、前記ライティング処理に適用する法線情報を生成することを特徴とする請求項2に記載の画像処理装置。   3. The apparatus according to claim 2, wherein the generation means generates normal line information to be applied to the lighting process by deforming normal line information selected based on the distance information according to the distance information. Image processing apparatus as described. 前記記憶手段は、前記複数の法線情報を、前記撮像装置から前記被写体までの距離が短いほど、短い距離間隔で記憶することを特徴とする請求項2又は3に記載の画像処理装置。   4. The image processing apparatus according to claim 2, wherein the storage unit stores the plurality of pieces of normal line information at shorter distance intervals as the distance from the imaging device to the subject is shorter. 前記記憶手段が記憶する法線情報は、前記被写体の所定の特徴パターンにおいて、所定の領域毎に設定される領域別の法線情報を含むことを特徴とする請求項1から4のいずれか1項に記載の画像処理装置。   The normal line information stored in the storage means includes normal line information for each area set for each predetermined area in a predetermined feature pattern of the subject. An image processing apparatus according to claim 1. 前記生成手段は、前記距離情報に基づいて、前記領域別の法線情報を位置合わせすることで、前記ライティング処理に適用する法線情報を生成することを特徴とする請求項5に記載の画像処理装置。   6. The image according to claim 5, wherein the generation means generates normal line information to be applied to the lighting process by aligning the normal line information for each area based on the distance information. Processing unit. 前記生成手段は、前記距離情報に基づいて選択された前記領域別の法線情報を、前記距離情報に応じて変形し、さらに統合することで、前記ライティング処理に適用する法線情報を生成することを特徴とする請求項5に記載の画像処理装置。   The generation means generates normal information to be applied to the lighting process by transforming the normal information by region selected based on the distance information according to the distance information and further integrating the information. The image processing apparatus according to claim 5, wherein 前記被写体の種類を示す被写体情報を取得する第二の取得手段をさらに備え、
前記生成手段は、前記被写体情報に基づいて、前記被写体の所定の特徴パターンに対応する法線情報を生成することを特徴とする請求項1から7のいずれか1項に記載の画像処理装置。
It further comprises a second acquisition unit for acquiring subject information indicating the type of the subject,
The image processing apparatus according to any one of claims 1 to 7, wherein the generation unit generates normal line information corresponding to a predetermined feature pattern of the subject based on the subject information.
前記画像データから前記被写体を検出する検出手段をさらに備えることを特徴とする請求項8に記載の画像処理装置。   9. The image processing apparatus according to claim 8, further comprising detection means for detecting the subject from the image data. 前記生成手段は、前記検出された被写体と、前記距離情報に基づいて選択された前記被写体の所定の特徴パターンに対応する法線情報とを位置合わせすることで、前記ライティング処理に適用する法線情報を生成することを特徴とする請求項9に記載の画像処理装置。   The normal means applied to the lighting process by aligning the detected subject with normal information corresponding to a predetermined feature pattern of the subject selected based on the distance information. The image processing apparatus according to claim 9, generating information. 前記被写体の所定の特徴パターンは、顔であることを特徴とする請求項1から10のいずれか1項に記載の画像処理装置。   The image processing apparatus according to any one of claims 1 to 10, wherein the predetermined feature pattern of the subject is a face. 被写体に関連する所定の特徴パターンに対応する法線情報を記憶する記憶手段を備えた画像処理装置における画像処理方法であって、
画像取得手段により、前記被写体を含むシーンを撮像することにより得られる画像データを取得する画像取得ステップと、
第一の取得手段により、前記シーンを撮像した撮像装置から前記被写体までの距離情報を取得する第一の取得ステップと、
生成手段により、前記距離情報と前記記憶手段が記憶する前記法線情報に基づき、前記画像データに対するライティング処理に適用する法線情報を生成する生成ステップと、
ライティング処理手段により、前記生成ステップにおいて生成した前記法線情報を用いて、前記画像データに対して、ライティング処理を実行するライティング処理ステップと
を含むことを特徴とする画像処理方法。
An image processing method in an image processing apparatus, comprising storage means for storing normal line information corresponding to a predetermined feature pattern related to a subject,
An image acquisition step of acquiring image data obtained by imaging a scene including the subject by the image acquisition means;
A first acquisition step of acquiring distance information from the imaging device that has captured the scene to the subject by the first acquisition unit;
A generation step of generating normal information to be applied to lighting processing on the image data based on the distance information and the normal information stored by the storage unit;
And a lighting processing step of performing lighting processing on the image data using the normal line information generated in the generation step by a lighting processing means.
コンピュータを、請求項1から11のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   A program for causing a computer to function as each means of the image processing apparatus according to any one of claims 1 to 11.
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 true JP2019062436A (en) 2019-04-18
JP7057086B2 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021044710A (en) * 2019-09-11 2021-03-18 キヤノン株式会社 Image processing apparatus, 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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021044710A (en) * 2019-09-11 2021-03-18 キヤノン株式会社 Image processing apparatus, image processing method and program
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

Also Published As

Publication number Publication date
JP7057086B2 (en) 2022-04-19

Similar Documents

Publication Publication Date Title
JP6685827B2 (en) Image processing apparatus, image processing method and program
JP6646936B2 (en) Image processing apparatus, control method thereof, and program
JP5024410B2 (en) 3D modeling apparatus, 3D modeling method, and program
JP6576083B2 (en) Image processing apparatus, image processing method, and program
JP5110138B2 (en) AR processing apparatus, AR processing method, and program
CN107517346B (en) Photographing method and device based on structured light and mobile device
WO2020237565A1 (en) Target tracking method and device, movable platform and storage medium
KR101510312B1 (en) 3D face-modeling device, system and method using Multiple cameras
JP2018163648A (en) Image processor, method for image processing, and program
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
JP2006215743A (en) Image processing apparatus and image processing method
JPH09305796A (en) Image information processor
JP4871315B2 (en) Compound eye photographing apparatus, control method therefor, and program
JP6896811B2 (en) Image processing equipment, image processing methods, and programs
JP2009239391A (en) Compound eye photographing apparatus, control method therefor, and program
WO2018180860A1 (en) Image processing device, image processing method, and program
JP7321772B2 (en) Image processing device, image processing method, and program
JP7251631B2 (en) Template creation device, object recognition processing device, template creation method, object recognition processing method, and program
JP2010154323A (en) Image processing apparatus, image extraction method, and, program
JP2012248206A (en) Ar processing apparatus, ar processing method and program
JP2006331009A (en) Image processor and image processing method
CN112529848B (en) Panorama updating method and device, readable medium and equipment
JP7197211B2 (en) Three-dimensional graphics data creation method, program, and three-dimensional graphics data creation system

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