JP6946055B2 - Image processing equipment and image processing methods, programs - Google Patents
Image processing equipment and image processing methods, programs Download PDFInfo
- Publication number
- JP6946055B2 JP6946055B2 JP2017104218A JP2017104218A JP6946055B2 JP 6946055 B2 JP6946055 B2 JP 6946055B2 JP 2017104218 A JP2017104218 A JP 2017104218A JP 2017104218 A JP2017104218 A JP 2017104218A JP 6946055 B2 JP6946055 B2 JP 6946055B2
- Authority
- JP
- Japan
- Prior art keywords
- virtual light
- light source
- image processing
- image
- shooting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Image Processing (AREA)
- Studio Devices (AREA)
Description
本発明は、動画を構成する複数のフレーム画像に対して仮想光源によるリライティング効果を付与する画像処理に関する。 The present invention relates to image processing for imparting a rewriting effect by a virtual light source to a plurality of frame images constituting a moving image.
従来から、撮影画像に撮影時に存在しなかった仮想的な光源(以下、仮想光源と称する)を設定し、画像内の被写体に対して仮想光源から光が照射されたような効果を付与する画像処理が知られている。このような画像処理はリライティング処理と称され、撮影時の環境光で生じた影などの暗部領域を明るくするなどすることが可能である。 An image in which a virtual light source (hereinafter referred to as a virtual light source) that did not exist at the time of shooting is set in the shot image to give the subject in the image the effect of being irradiated with light from the virtual light source. The processing is known. Such image processing is called rewriting processing, and it is possible to brighten dark areas such as shadows generated by ambient light at the time of shooting.
下記特許文献1は、画像中の顔領域情報を作成し、顔領域情報の結果に応じて、領域毎にリライティングなどの特殊処理をする方法を開示している。より具体的には、顔の有無および顔の位置といった顔領域情報とシーン判別手段によるシーン判別結果に応じて、顔領域でのリライティング処理を行う。 The following Patent Document 1 discloses a method of creating face area information in an image and performing special processing such as rewriting for each area according to the result of the face area information. More specifically, the rewriting process in the face area is performed according to the face area information such as the presence / absence of the face and the position of the face and the scene discrimination result by the scene discrimination means.
画像にリライティング処理を行って陰影を補正する場合、仮想光源の位置、強度、角度といったリライティング処理に用いるパラメータを適切に決定することが必要である。 When the image is rewritten to correct the shadow, it is necessary to appropriately determine the parameters used for the rewriting process such as the position, intensity, and angle of the virtual light source.
この点に関し、特許文献1は、顔の有無および顔の位置といった顔領域情報と更にシーン判別手段による夕景、夜景、青空といったシーン判別結果に応じてリライティング処理をする対象領域やリライティング強度を決定している。 In this regard, Patent Document 1 determines the target area and rewriting intensity to be rewritten according to the face area information such as the presence / absence of a face and the position of the face, and the scene discrimination results such as evening scene, night view, and blue sky by the scene discrimination means. ing.
しかしながら、特許文献1は静止画を対象としたものであり、動画については仮想光源をどのように設定するか考慮していない。例えば、歩いていたり走っていたりといった動きのある被写体をフレーム画像ごとに最適な仮想光源のパラメータでリライティング処理してしまうと、パラメータがフレーム単位で切り替えられ、リライティング処理後の動画像が見づらいという課題がある。 However, Patent Document 1 is intended for still images, and does not consider how to set a virtual light source for moving images. For example, if a moving subject such as walking or running is rewritten with the optimum virtual light source parameters for each frame image, the parameters are switched on a frame-by-frame basis, making it difficult to see the moving image after the rewriting process. There is.
そこで、本発明は、動画に対して仮想光源によるリライティング効果を適切に付与する画像処理を提供する。 Therefore, the present invention provides image processing that appropriately imparts a rewriting effect by a virtual light source to a moving image.
本発明の1実施態様は、動画を構成する複数のフレーム画像に対して仮想光源によるリライティング効果を付与する画像処理を行う画像処理装置であって、動画撮影時の撮影画角の変動に関する撮影情報を取得する取得手段と、前記複数のフレーム画像に、仮想光源からの仮想光を照射した効果であるリライティング効果を付与する画像処理を行う処理手段と、前記処理手段による画像処理に用いるパラメータを設定する設定手段と、前記撮影画角の変動が前記動画を撮影する撮影装置のズーム動作によって生じるものである場合、前記仮想光源の位置を変えないモードと、前記仮想光源の位置を被写体に対して相対的に遠くするモードとを選択可能とする選択手段とを有し、前記設定手段は、前記複数のフレーム画像のうちで撮影画角の変動が生じた期間のフレーム画像に対して、前記選択手段により選択されたモードに基づき前記パラメータを設定することを特徴とする。 One embodiment of the present invention is an image processing device that performs image processing for imparting a rewriting effect by a virtual light source to a plurality of frame images constituting a moving image, and is shooting information relating to fluctuations in a shooting image angle during movie shooting. The acquisition means for acquiring the image, the processing means for performing image processing for imparting a rewriting effect which is the effect of irradiating the plurality of frame images with virtual light from the virtual light source, and the parameters used for the image processing by the processing means are set. When the setting means for setting and the fluctuation of the shooting image angle are caused by the zoom operation of the shooting device for shooting the moving image, the mode in which the position of the virtual light source is not changed and the position of the virtual light source are set with respect to the subject. The setting means has a selection means that makes it possible to select a mode that is relatively far away, and the setting means selects the frame image during a period in which the shooting angle of the image fluctuates among the plurality of frame images. It is characterized in that the parameter is set based on the mode selected by the means.
本発明によれば、動画に対して適切なリライティング処理を行うことが可能となる。 According to the present invention, it is possible to perform an appropriate rewriting process on a moving image.
以下、本発明の実施形態について図面を用いて詳細に説明する。なお、本発明を動画撮影が可能なデジタルカメラに適用した実施形態を用いて説明するが、本発明はデジタルカメラに限らず、他の画像処理装置に適用することができる。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Although the present invention will be described with reference to an embodiment in which the present invention is applied to a digital camera capable of photographing a moving image, the present invention is not limited to the digital camera and can be applied to other image processing devices.
(第1の実施形態)
図1〜7を参照して、本発明の実施形態を説明する。
(First Embodiment)
Embodiments of the present invention will be described with reference to FIGS. 1 to 7.
図1は、本発明の実施形態によるデジタルカメラの構成例を示すブロック図である。 FIG. 1 is a block diagram showing a configuration example of a digital camera according to an embodiment of the present invention.
図1において、100はデジタルカメラ全体、101はズームレンズ、フォーカスレンズを含むレンズ群、102は絞り機能を備えるシャッター、103は光学像を電気信号に変換するCCDやCMOS素子等で構成される撮像部、104は、アナログ信号をデジタル信号に変換するA/D変換器、105はA/D変換器104から出力される画像データに対し、ホワイトバランス処理や、γ処理、輪郭強調、色補正処理などの各種画像処理を行う画像処理部である。
In FIG. 1, 100 is an entire digital camera, 101 is a lens group including a zoom lens and a focus lens, 102 is a shutter having an aperture function, and 103 is an image pickup composed of a CCD or CMOS element that converts an optical image into an electric signal.
106は画像メモリ、107は画像メモリ106を制御するメモリ制御部、108は入力デジタル信号をアナログ信号に変換するD/A変換器、109はLCD等の表示部、110は画像データを圧縮符号化・復号化するコーデック部である。
106 is an image memory, 107 is a memory control unit that controls the
111は記録媒体112とのインタフェースI/F、112はメモリカードやハードディスク等の記録媒体、113は、撮影画像中から被写体の顔を検出する顔検出部、114は、撮影画像にリライティング処理を行うリライティング処理部、50はデジタルカメラ100のシステム全体を制御するシステム制御部である。
111 is an interface I / F with the
また、121は、プログラムやパラメータなどを格納するEEPROMなどの不揮発性メモリであり、122はシステム制御部50の動作用の定数、変数、不揮発性メモリ121から読みだしたプログラム等を展開するシステムメモリである。123は被写体との距離を測定し、撮影画素の画素単位に対応する距離情報を2次元の距離マップ画像として出力する測距センサである。
Further, 121 is a non-volatile memory such as EEPROM for storing programs and parameters, and 122 is a system memory for developing constants and variables for operation of the
次に、上記のように構成されたデジタルカメラ100の撮影時の基本動作について説明する。撮像部103は、レンズ101及びシャッター102を介して入射した光を光電変換し、入力画像信号としてA/D変換器104へ出力する。A/D変換器104は撮像部103から出力されるアナログ画像信号をデジタル画像信号に変換し画像処理部105に出力する。
Next, the basic operation at the time of shooting of the
画像処理部105は、A/D変換器104からの画像データ、又は、メモリ制御部107からの画像データに対し、ホワイトバランスなどの色変換処理、γ処理、輪郭強調処理などを行う。また、画像処理部105では、顔検出部113で取得した顔検出結果や、撮像した画像データを用いて所定の評価値算出処理(図示しない)を行い、得られた評価値結果に基づいてシステム制御部50が露光制御、測距制御を行う。これにより、TTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理などを行う。
The
画像処理部105から出力された画像データは、メモリ制御部107を介して画像メモリ106に書き込まれる。画像メモリ106は、撮像部103から出力された画像データや、表示部109に表示するための画像データを格納する。
The image data output from the
また、D/A変換器108は、画像メモリ106に格納されている画像表示用のデータをアナログ信号に変換して表示部109に供給する。表示部109は、LCD等の表示器上に、D/A変換器108からのアナログ信号に応じた表示を行う。
Further, the D /
コーデック部110は、画像メモリ106に記録された画像データをMPEGなどの規格に基づきそれぞれ圧縮符号化する。システム制御部50は符号化した画像データを関連付けて、記録インタフェース111を介して記録媒体112に格納する。
The
上記の基本動作以外に、システム制御部50は、前述した不揮発性メモリ121に記録されたプログラムを実行することで、後述する本実施形態の各処理を実現する。ここでいうプログラムとは、本実施形態にて後述する各種フローチャートを実行するためのプログラムのことである。この際、システム制御部50の動作用の定数、変数、不揮発性メモリ121から読み出したプログラム等をシステムメモリ122に展開する。
In addition to the above basic operations, the
次に、画像処理部105の詳細な構成について図2を用いて説明する。図2は画像処理部105の構成を示すブロック図である。
Next, the detailed configuration of the
図2において、200は同時化処理部、201はWB増幅部、202は輝度・色信号生成部、203は輪郭強調処理部、204は輝度ガンマ処理部、205は色変換処理部、206は色γ処理部、207は色差信号生成部、208は陰影情報取得部である。 In FIG. 2, 200 is a simultaneous processing unit, 201 is a WB amplification unit, 202 is a brightness / color signal generation unit, 203 is a contour enhancement processing unit, 204 is a brightness gamma processing unit, 205 is a color conversion processing unit, and 206 is a color. The γ processing unit, 207 is a color difference signal generation unit, and 208 is a shadow information acquisition unit.
次に、画像処理部105における処理について説明する。図1のA/D変換部104から入力された画像信号が画像処理部105に入力される。
Next, the processing in the
画像処理部105に入力された画像信号は同時化処理部200に入力される。同時化処理部200は入力されたベイヤーRGBの画像データに対して、同時化処理を行い、色信号R,G,Bを生成する。
The image signal input to the
WB増幅部201は、システム制御部50が算出するホワイトバランスゲイン値に基づき、RGBの色信号にゲインをかけ、ホワイトバランスを調整する。WB増幅部201が出力したRGB信号は輝度・色信号生成部202に入力される。輝度・色信号生成部202は、RGB信号から輝度信号Yを生成し、生成した輝度信号Yを輪郭強調処理部203、色信号RGBを色変換処理部205へ出力する。
The
輪郭強調処理部203では、輝度信号に対して輪郭強調処理を行い、輝度ガンマ処理部204へ出力する。輝度ガンマ処理部204では輝度信号Yに対してガンマ補正を行い、輝度信号Yを画像メモリ106に出力する。
The contour
色変換処理部205は、RGB信号に対するマトリクス演算などにより、所望のカラーバランス(色空間)に変換する。色ガンマ処理部206では、RGBの色信号にガンマ補正を行う。色差信号生成部207では、RGB信号から色差信号R−Y信号、B−Y信号を生成する。
The color
画像メモリ106に出力された画像信号(輝度信号Y,色差信号(R−Y信号,B−Y信号))は、コーデック部110によって圧縮符号化し、記録媒体112に記録する。
The image signals (luminance signal Y, color difference signal (RY signal, BY signal)) output to the
また、色変換処理部205の出力するRGB信号を陰影情報取得部208にも入力する。陰影情報取得部208は、撮影時の環境光源によって被写体に生じた陰影の状態を解析するための情報(陰影情報)を取得する。例えば、被写体の平均輝度情報や顔領域の輝度ヒストグラム情報などを陰影情報として取得してもよい。
Further, the RGB signal output by the color
次に、リライティング処理部114の詳細な構成および動作について、図3を用いて説明する。
Next, the detailed configuration and operation of the
例えばユーザ操作により、リライティング処理が選択されている場合は、画像処理部105から出力した画像信号をリライティング処理部114に入力し、仮想光源によるリライティング処理を行う。
For example, when the rewriting process is selected by the user operation, the image signal output from the
図3は、リライティング処理部114の構成を示すブロック図である。
FIG. 3 is a block diagram showing the configuration of the
図3において、301は入力された画像信号(輝度信号Y,色差信号(R−Y信号,B−Y信号))をRGB信号に変換するRGB信号変換部、302はデガンマ処理を行うデガンマ処理部である。 In FIG. 3, 301 is an RGB signal conversion unit that converts an input image signal (luminance signal Y, color difference signal (RY signal, BY signal)) into an RGB signal, and 302 is a degamma processing unit that performs degamma processing. Is.
また、303は測距センサ123から出力される撮像装置と被写体との距離情報を取得する距離算出部、304は被写体の法線を算出する法線算出部、305は仮想光源が被写体に反射した成分を算出する仮想光源反射成分算出部、306は仮想光源によるリライティング効果を付加する仮想光源付加処理部である。
Further, 303 is a distance calculation unit that acquires distance information between the image pickup device and the subject output from the
また、307はRGB信号にガンマ特性をかけるガンマ処理部、308はRGB信号を輝度信号(Y)・色差信号(B−Y信号、R−Y信号)に変換する輝度・色差信号変換部である。 Further, 307 is a gamma processing unit that applies gamma characteristics to an RGB signal, and 308 is a luminance / color difference signal conversion unit that converts an RGB signal into a luminance signal (Y) / color difference signal (BY signal, RY signal). ..
上述した構成のリライティング処理部114の動作について説明する。
The operation of the
リライティング処理部114は、画像メモリ106に記録された輝度・色差信号(Y、B−Y、R−Y)を読み出し、入力とする。RGB信号変換部301は、入力された輝度・色差信号(Y、B−Y、R−Y)をRGB信号に変換し、デガンマ処理部302へ出力する。
The rewriting
デガンマ処理部302は、画像処理部105のガンマ処理部で掛けられたガンマ特性と逆の特性の演算を行いリニアデータに変換する。デガンマ処理部302は、リニア変換後のRGB信号(Rt、Gt、Bt)を、仮想光源反射成分算出部305および仮想光源付加処理部306に出力する。
The
一方、距離算出部303は、測距センサ123から取得した被写体距離情報(被写体距離値)を用いて距離マップを生成する。ここで被写体距離情報とは、撮影画像の画素単位で得られる2次元の距離情報(距離値)のことである。また距離マップとは、たとえば被写体距離値を画素単位で階調などを用いて示した画像である。
On the other hand, the
法線算出部304は、距離算出部303が生成した距離マップから法線マップを算出する。距離マップから法線マップを生成する方法に関して公知の技術を用いることが可能であるが、本実施形態における具体的な処理例について図4を用いて説明する。
The
図4はカメラ撮影座標と、被写体の関係を示す図である。例えば、図4に示すようにある被写体401に対して、撮影画像の水平方向の差分ΔHに対する距離(奥行き)Dの差分ΔDから勾配情報を算出し、勾配情報から法線Nを算出することが可能である。撮影した各画素に対して上記の処理を行うことで、撮影画像の各画素に対応する法線情報Nを算出可能である。法線算出部304は、撮影画像の各画素に対応する法線情報を法線マップとして仮想光源反射成分算出部305に出力する。
FIG. 4 is a diagram showing the relationship between the camera shooting coordinates and the subject. For example, for a subject 401 as shown in FIG. 4, the gradient information can be calculated from the difference ΔD of the distance (depth) D with respect to the horizontal difference ΔH of the captured image, and the normal N can be calculated from the gradient information. It is possible. By performing the above processing on each of the captured pixels, the normal information N corresponding to each pixel of the captured image can be calculated. The
仮想光源反射成分算出部305では、光源と被写体の距離K、法線情報N、仮想光源パラメータLに基づき、設定した仮想光源から照射される光が被写体にて反射する成分を算出する。具体的には、光源と被写体との距離Kの二乗に反比例し、被写体法線ベクトルNと光源方向ベクトルLの内積に比例するように、撮影画像に対応する座標位置の反射成分を算出する。
The virtual light source reflection
これについて、図4を用いて説明する。図4において、401が被写体、402は設定した仮想光源の位置を示している。カメラ100で撮影された撮影画像の水平画素位置H1(垂直画素位置は説明の簡略化のため省略)における反射成分は、カメラ座標H1における法線N1と仮想光源の方向ベクトルL1の内積に比例し、仮想光源と被写体位置の距離K1に反比例する値となる。
This will be described with reference to FIG. In FIG. 4, 401 indicates the subject and 402 indicates the position of the set virtual light source. The reflection component at the horizontal pixel position H1 (the vertical pixel position is omitted for simplification of explanation) of the captured image taken by the
この関係を数式で表現すると、仮想光源による被写体反射成分(Ra、Ga、Ba)は下記の数式(1)の通りとなる。
Ra=α×(−L・N)/K2×Rt
Ga=α×(−L・N)/K2×Gt (1)
Ba=α×(−L・N)/K2×Bt
Expressing this relationship with a mathematical formula, the subject reflection components (Ra, Ga, Ba) by the virtual light source are as shown in the following mathematical formula (1).
Ra = α × (−L ・ N) / K 2 × Rt
Ga = α × (−L ・ N) / K 2 × Gt (1)
Ba = α × (−L ・ N) / K 2 × Bt
ここで、αは仮想光源から照射される光の強さであり、リライティング補正量のゲイン値である。Lは仮想光源の3次元方向ベクトル、Nは被写体の3次元法線ベクトル、Kは仮想光源と被写体の距離である。また、Rt、Gt、Btはデガンマ処理部302から出力された撮影RGBデータである。
Here, α is the intensity of the light emitted from the virtual light source, and is the gain value of the rewriting correction amount. L is the three-dimensional direction vector of the virtual light source, N is the three-dimensional normal vector of the subject, and K is the distance between the virtual light source and the subject. Further, Rt, Gt, and Bt are photographed RGB data output from the
上記の数式により算出された仮想光源による反射成分(Ra、Ga、Ba)は仮想光源付加処理部306へ出力される。仮想光源付加処理部306は、仮想光源成分(Ra、Ga、Ba)を付加するように、下記の数式(2)に従う処理を行う。
Rout=Rt+Ra
Gout=Gt+Ga (2)
Bout=Bt+Ba
The reflection components (Ra, Ga, Ba) by the virtual light source calculated by the above formula are output to the virtual light source
Rout = Rt + Ra
Gout = Gt + Ga (2)
Bout = Bt + Ba
仮想光源付加処理部306から出力された画像信号(Rout、Gout、Bout)はガンマ処理部307に入力される。ガンマ処理部307では、RGBの入力信号にガンマ補正を行う。輝度・色差信号変換部308では、RGB信号から輝度信号Y、色差信号R−Y、B−Y信号を生成する。
The image signals (Rout, Gout, Bout) output from the virtual light source
以上が、リライティング処理部114の動作である。リライティング処理部114によるリライティング処理の実施例を図5に示す。図5(a)がリライティング処理前の撮影画像であり、図5(b)がリライティング処理後の撮影画像の例である。図5(a)で暗かった中央の人物被写体に仮想光源の光をあててリライティング処理をすることで図5(b)のように明るく補正される。
The above is the operation of the
システム制御部50は、リライティング補正部114が出力した輝度信号と色差信号を、メモリ制御部107の制御によって、画像メモリ106に蓄積したのち、コーデック部110で圧縮符号化を行う。また、I/F111を介して、画像信号を記録媒体112に記録する。
The
図6は、システム制御部50の動作を示したフローチャートである。以下、図6のフローチャートに従って、システム制御部50が取得した動画撮影時の撮影画角の変動に関するカメラ情報に基づいて、リライティング処理部114の仮想光源のパラメータを決定する動作について説明する。
FIG. 6 is a flowchart showing the operation of the
ここでカメラ情報とは、撮影時の撮影画角の変動に関する撮影情報であり、例えば、カメラのレンズのズーム動作の有無、パンニング動作の有無などである。 Here, the camera information is shooting information related to fluctuations in the shooting angle of view at the time of shooting, and is, for example, the presence / absence of a zoom operation of the lens of the camera, the presence / absence of a panning operation, and the like.
図6にリライティング処理部114の仮想光源のパラメータを決定するシステム制御部50のフローチャートを示す。
FIG. 6 shows a flowchart of the
ステップS601では、操作部120を介してユーザからの操作によってリライティング処理が選択されているか判定する。即ち、リライティング処理部114による処理を行うか否かを判定する。リライティング処理を行う場合はステップ602に進む。
In step S601, it is determined whether the rewriting process is selected by the operation from the user via the
ステップS602では、被写体を動画撮影する。 In step S602, a moving image of the subject is taken.
ステップS603では、レンズ群101、シャッター102、撮像部103の設定値からカメラ本体から被写体までの距離、レンズのズーム動作の有無、パンニング動作の有無等のカメラ情報を、フレーム毎に取得する。なお、以下の説明において1フレームで取得された画像をフレーム画像と称し、動画は複数のフレーム画像で構成される。
In step S603, camera information such as the distance from the camera body to the subject, the presence / absence of the zoom operation of the lens, and the presence / absence of the panning operation is acquired from the set values of the
ステップS604では、ステップS603において取得したカメラ情報と仮想光源のパラメータ設定表に基づき、仮想光源のパラメータを決定する。具体的には、図7(a)に示すような各フレームにおけるカメラ情報と、図7(b)に示すズーム動作時の仮想光源設定表に基づいて決定する。 In step S604, the parameters of the virtual light source are determined based on the camera information acquired in step S603 and the parameter setting table of the virtual light source. Specifically, the determination is made based on the camera information in each frame as shown in FIG. 7A and the virtual light source setting table at the time of zoom operation shown in FIG. 7B.
図7(a)において、701はフレーム番号(フレームNo.)、702はカメラ情報を示す。図7(b)において、703はカメラ情報、704はモード、705は仮想光源の設定を示す。ここでモードとは、カメラ情報(ズーム動作、パンニング動作)ごとにあらかじめ設定された仮想光源の設定方法を示すコードである。カメラ情報の種類とモードに応じて、仮想光源の設定方法が一意に決定される。なお、モードは操作部120を用いて複数のモードから選択可能にしてもよい。
In FIG. 7A, 701 indicates a frame number (frame No.) and 702 indicates camera information. In FIG. 7B, 703 indicates camera information, 704 indicates a mode, and 705 indicates a virtual light source setting. Here, the mode is a code indicating a setting method of a virtual light source preset for each camera information (zoom operation, panning operation). The setting method of the virtual light source is uniquely determined according to the type and mode of camera information. The mode may be selectable from a plurality of modes using the
例えば、フレーム番号が0から3の期間において、図7(a)によりカメラ情報としてズームイン動作中という情報を取得する。次に、図7(b)により、ズームイン動作中であって、モード0が設定されていれば、この期間においては、当該期間の前のフレームで設定された仮想光源の位置から変えないように制御する。
For example, in the period when the frame number is 0 to 3, the information that the zoom-in operation is in progress is acquired as the camera information according to FIG. 7A. Next, according to FIG. 7B, if the zoom-in operation is in progress and
なお、モード1が設定されている場合は、当該期間の前のフレームで設定された仮想光源の位置から、被写体に対して相対的に遠くなる位置に再度設定し、その期間では設定された位置から変えないように制御する。何れのモードであっても、ズーム動作中は仮想光源の位置を固定する。カメラの画角が被写体をズームアップして撮影していた場合は、仮想光源の位置を僅かにずらしただけでも反射光の変化が大きいからである。 If mode 1 is set, it is set again to a position relatively far from the subject from the position of the virtual light source set in the frame before the period, and the position set during that period. Control so that it does not change from. In either mode, the position of the virtual light source is fixed during the zoom operation. This is because when the angle of view of the camera zooms in on the subject and the subject is photographed, the reflected light changes significantly even if the position of the virtual light source is slightly shifted.
より具体的には、フレーム番号が1の時に、顔検出部113で取得した主被写体の顔位置が(x1,y1)であるとすると、仮想光源による被写体反射成分(Ra(x1,y1)、Ga(x1,y1)、Ba(x1,y1))は、次式(3)で表わされる。
Ra(x1,y1)
=α×(−L(x1,y1)・N(x1,y1))/K(x1,y1)2×Rt
Ga(x1,y1)
=α×(−L(x1,y1)・N(x1,y1))/K(x1,y1)2×Gt (3)
Ba(x1,y1)
=α×(−L(x1,y1)・N(x1,y1))/K(x1,y1)2×Bt
More specifically, assuming that the face position of the main subject acquired by the
Ra (x 1 , y 1 )
= Α × (−L (x 1 , y 1 ) ・ N (x 1 , y 1 )) / K (x 1 , y 1 ) 2 × Rt
Ga (x 1 , y 1 )
= Α × (−L (x 1 , y 1 ) ・ N (x 1 , y 1 )) / K (x 1 , y 1 ) 2 × Gt (3)
Ba (x 1 , y 1 )
= Α × (−L (x 1 , y 1 ) ・ N (x 1 , y 1 )) / K (x 1 , y 1 ) 2 × Bt
L(x1,y1)は、仮想光源の3次元方向ベクトル、N(x1,y1)は、(x1,y1)の位置にいる被写体の3次元法線ベクトル、K(x1,y1)は仮想光源と(x1,y1)の位置にいる被写体との距離を示す。仮想光源からの光が被写体にあたるとは、(Ra(x1,y1)、Ga(x1,y1)、Ba(x1,y1))が正の値となることを示す。 L (x 1 , y 1 ) is the 3D direction vector of the virtual light source, N (x 1 , y 1 ) is the 3D normal vector of the subject at the position (x 1 , y 1 ), and K (x). 1 , y 1 ) indicates the distance between the virtual light source and the subject at the position (x 1 , y 1). The fact that the light from the virtual light source hits the subject means that (Ra (x 1 , y 1 ), Ga (x 1 , y 1 ), Ba (x 1 , y 1 )) have positive values.
図7(a)においてフレーム番号0〜3の期間はズームイン動作中であり、図7(b)によりズームイン動作中であり、モードが0の時は仮想光源の位置を変えない、すなわちフレーム番号0〜3の期間では被写体との距離K(x0,y0)をデフォルトのまま変えないように制御する。また、モードが1の時は仮想光源の位置をデフォルトの位置よりも遠くにして、その期間では変更しないように制御する、すなわち、被写体との距離K(x0,y0)をデフォルトの値よりも大きい値に設定するよう制御する。
In FIG. 7A, the period of
以上の処理によって、制御部50はズーム動作の有無といったカメラ情報に基づいて、リライティング処理部114の仮想光源のパラメータを決定する。
Through the above processing, the
なお、図7(b)の仮想光源設定表において、モードが0、1の2つある場合について説明したが、カメラ情報を基に仮想光源の位置、発光角度(照射角度)、発光強度、光源の種類(色温度)などのパラメータを制御するものであれば、これに限定するものではない。少なくとも1つのパラメータを設定するものであればよい。なお、カメラ情報の種類や仮想光源の設定をより詳細に設定して3つ以上のモードを用意しても良い。
In the virtual light source setting table of FIG. 7B, the case where there are two
また、ズーム動作とは別にパンニング動作にあわせて仮想光源の設定を行ってもよい。パンニング動作の検出方法としては、例えば対象画像を任意の領域に分け、各領域内の動きベクトルの時間的変化を検出し、同じ方向の動きベクトルが所定数以上ある場合に、パンニング動作がなされていると判断する。または、カメラに搭載されたセンサから出力された動き情報を用いてもよい。 Further, the virtual light source may be set according to the panning operation separately from the zoom operation. As a method of detecting the panning motion, for example, the target image is divided into arbitrary regions, the temporal change of the motion vector in each region is detected, and the panning motion is performed when there are a predetermined number or more of motion vectors in the same direction. Judge that there is. Alternatively, the motion information output from the sensor mounted on the camera may be used.
パンニング動作時の仮想光源設定の例を図7(c)に示す。 An example of setting the virtual light source during the panning operation is shown in FIG. 7 (c).
図7(c)において、706はカメラ情報、707はモード、708は仮想光源設定を示す。パンニング動作中且つモードが0の場合は仮想光源の位置を変えないよう制御し、パンニング動作中且つモードが1の場合は仮想光源の位置はパンニングの速度と連動するように制御し、パンニング動作中且つモードが2の場合は仮想光源の位置は変えずに仮想光源の角度をパンニングと連動するよう制御する例である。 In FIG. 7C, 706 indicates camera information, 707 indicates mode, and 708 indicates virtual light source setting. When the panning operation is in progress and the mode is 0, the position of the virtual light source is controlled so as not to be changed, and when the panning operation is in progress and the mode is 1, the position of the virtual light source is controlled to be linked with the panning speed, and the panning operation is in progress. Moreover, when the mode is 2, it is an example of controlling the angle of the virtual light source so as to be linked with panning without changing the position of the virtual light source.
パンニング動作と仮想光源の位置や角度の変更を連動する方法としては、例えば対象画像を任意の領域に分け、各領域内の動きベクトルの時間的変化によりパンニングの速度を算出し、算出したパンニング速度と同一の速度で仮想光源の位置を変更する。もしくは算出したパンニング速度に任意の係数を乗算した速度に合わせて、仮想光源の位置を変更するといった方法がある。 As a method of linking the panning operation with the change of the position and angle of the virtual light source, for example, the target image is divided into arbitrary regions, the panning speed is calculated by the temporal change of the motion vector in each region, and the calculated panning speed is calculated. Change the position of the virtual light source at the same speed as. Alternatively, there is a method of changing the position of the virtual light source according to the calculated panning speed multiplied by an arbitrary coefficient.
また、本実施形態では、リライティング処理によって画像内の被写体領域を明るく補正する場合について述べたが、逆に暗くなるようにリライティング処理を行ってもよい。その場合、仮想光源のゲイン値αをマイナスに設定すればよい。 Further, in the present embodiment, the case where the subject area in the image is corrected to be bright by the rewriting process has been described, but conversely, the rewriting process may be performed so as to be dark. In that case, the gain value α of the virtual light source may be set to minus.
さらに、仮想光源の位置と処理対象画素の距離Dの算出方法は、上述した算出方法に限定するものではなく、他の算出方法を用いてもよい。例えば、カメラ位置および被写体位置を3次元位置として取得し、3次元での距離で計算してもよい。 Further, the method of calculating the position of the virtual light source and the distance D of the pixel to be processed is not limited to the above-mentioned calculation method, and other calculation methods may be used. For example, the camera position and the subject position may be acquired as three-dimensional positions and calculated by the distance in three dimensions.
また、仮想光源を付加する場合に、距離の二乗に反比例する式で計算したが、仮想光源の付加量をこの方式で算出するものに限定するものではない。例えば、距離Dに反比例するものや、ガウス分布的に照射範囲が変化する式であってもよい。 Further, when a virtual light source is added, the calculation is performed by an equation that is inversely proportional to the square of the distance, but the addition amount of the virtual light source is not limited to the one calculated by this method. For example, it may be an equation that is inversely proportional to the distance D or an equation in which the irradiation range changes in a Gaussian distribution.
さらに、本実施形態では、フレームごとにカメラ情報を取得して仮想光源のパラメータの設定をフレーム単位で処理する例について説明したがこれに限るものではない。1フレーム単位ではなく数フレーム単位でカメラ情報を取得して制御する構成にしても良い。 Further, in the present embodiment, an example in which camera information is acquired for each frame and the parameter setting of the virtual light source is processed for each frame has been described, but the present invention is not limited to this. The camera information may be acquired and controlled not in units of one frame but in units of several frames.
また、本実施形態では、撮像装置としてデジタルカメラが被写体情報を基に仮想光源のパラメータを決定しリライティング処理する例について説明したがこれに限るものではない。例えば、パーソナルコンピューター等において、デジタルカメラで撮影した画像データを取り込み、取り込んだ画像データの被写体情報を解析することで、仮想光源のパラメータを決定してパーソナルコンピューターにおいてリライティング処理を行う構成であっても良い。 Further, in the present embodiment, an example in which a digital camera as an imaging device determines parameters of a virtual light source based on subject information and performs rewriting processing has been described, but the present invention is not limited to this. For example, in a personal computer or the like, even if the personal computer has a configuration in which the parameters of the virtual light source are determined by capturing the image data taken by the digital camera and analyzing the subject information of the captured image data, the personal computer performs the rewriting process. good.
また、パーソナルコンピューター等において、リライティング処理機能を有するデジタルカメラで撮影したリライティング処理前の画像データと、デジタルカメラにおいて取得した被写体情報、仮想光源のパラメータ情報とを取り込み、デジタルカメラでのリライティング処理ではユーザの意図通りにリライティング出来ていないシーンに限り、再度仮想光源のパラメータを編集しリライティング処理をし直すといった構成としても良い。 In addition, in a personal computer or the like, the image data before the rewriting process taken by a digital camera having a rewriting process function, the subject information acquired by the digital camera, and the parameter information of the virtual light source are taken in, and the user in the rewriting process by the digital camera. Only in the scene where the rewriting is not performed as intended, the parameters of the virtual light source may be edited again and the rewriting process may be performed again.
50 システム制御部
100 デジタルカメラ
105 画像処理部
114 リライティング処理部
120 操作部
50
Claims (8)
動画撮影時の撮影画角の変動に関する撮影情報を取得する取得手段と、
前記複数のフレーム画像に、仮想光源からの仮想光を照射した効果であるリライティング効果を付与する画像処理を行う処理手段と、
前記処理手段による画像処理に用いるパラメータを設定する設定手段と、
前記撮影画角の変動が前記動画を撮影する撮影装置のズーム動作によって生じるものである場合、前記仮想光源の位置を変えないモードと、前記仮想光源の位置を被写体に対して相対的に遠くするモードとを選択可能とする選択手段とを有し、
前記設定手段は、前記複数のフレーム画像のうちで撮影画角の変動が生じた期間のフレーム画像に対して、前記選択手段により選択されたモードに基づき前記パラメータを設定することを特徴とする画像処理装置。 An image processing device that performs image processing that imparts a rewriting effect by a virtual light source to a plurality of frame images that make up a moving image.
An acquisition method for acquiring shooting information regarding fluctuations in the shooting angle of view during movie shooting, and
A processing means for performing image processing for imparting a rewriting effect, which is an effect of irradiating the plurality of frame images with virtual light from a virtual light source,
Setting means for setting parameters used for image processing by the processing means, and
When the fluctuation of the shooting angle of view is caused by the zoom operation of the shooting device that shoots the moving image, the mode in which the position of the virtual light source is not changed and the position of the virtual light source are set relatively far from the subject. It has a selection means that makes it possible to select a mode.
The setting means sets the parameters of the frame image during the period in which the shooting angle of view fluctuates among the plurality of frame images based on the mode selected by the selection means. Processing equipment.
動画撮影時の撮影画角の変動に関する撮影情報を取得する取得手段と、
前記複数のフレーム画像に、仮想光源からの仮想光を照射した効果であるリライティング効果を付与する画像処理を行う処理手段と、
前記処理手段による画像処理に用いるパラメータを設定する設定手段と、
前記撮影画角の変動が前記動画を撮影する撮影装置のパンニング動作によって生じるものである場合、前記仮想光源の位置を変えないモードと、前記仮想光源の位置をパンニング動作に連動して変更するモードとを選択可能とする選択手段とを有し、
前記設定手段は、前記複数のフレーム画像のうちで撮影画角の変動が生じた期間のフレーム画像に対して、前記選択手段により選択されたモードに基づき前記パラメータを設定することを特徴とする画像処理装置。 An image processing device that performs image processing that imparts a rewriting effect by a virtual light source to a plurality of frame images that make up a moving image.
An acquisition method for acquiring shooting information regarding fluctuations in the shooting angle of view during movie shooting, and
A processing means for performing image processing for imparting a rewriting effect, which is an effect of irradiating the plurality of frame images with virtual light from a virtual light source,
Setting means for setting parameters used for image processing by the processing means, and
When the fluctuation of the shooting angle of view is caused by the panning operation of the shooting device that shoots the moving image, a mode in which the position of the virtual light source is not changed and a mode in which the position of the virtual light source is changed in conjunction with the panning operation. Has a selection means that makes it possible to select and
The setting means sets the parameters of the frame image during the period in which the shooting angle of view fluctuates among the plurality of frame images based on the mode selected by the selection means. Processing equipment.
動画撮影時の撮影画角の変動に関する撮影情報を取得する取得手段と、
前記複数のフレーム画像に、仮想光源からの仮想光を照射した効果であるリライティング効果を付与する画像処理を行う処理手段と、
前記処理手段による画像処理に用いるパラメータを設定する設定手段と、
前記撮影画角の変動が前記動画を撮影する撮影装置のパンニング動作によって生じるものである場合、前記仮想光源の位置をパンニング動作に連動して変更するモードと、前記仮想光源の位置を変更せずに発光角度をパンニング動作に連動して変更するモードとを選択可能とする選択手段とを有し、
前記設定手段は、前記複数のフレーム画像のうちで撮影画角の変動が生じた期間のフレーム画像に対して、前記選択手段により選択されたモードに基づき前記パラメータを設定することを特徴とする画像処理装置。 An image processing device that performs image processing that imparts a rewriting effect by a virtual light source to a plurality of frame images that make up a moving image.
An acquisition method for acquiring shooting information regarding fluctuations in the shooting angle of view during movie shooting, and
A processing means for performing image processing for imparting a rewriting effect, which is an effect of irradiating the plurality of frame images with virtual light from a virtual light source,
Setting means for setting parameters used for image processing by the processing means, and
When the fluctuation of the shooting angle is caused by the panning operation of the shooting device that shoots the moving image, the mode in which the position of the virtual light source is changed in conjunction with the panning operation and the position of the virtual light source are not changed. It also has a selection means that makes it possible to select a mode that changes the light emission angle in conjunction with the panning operation.
The setting means sets the parameters of the frame image during the period in which the shooting angle of view fluctuates among the plurality of frame images based on the mode selected by the selection means. Processing equipment.
動画撮影時の撮影画角の変動に関する撮影情報を取得する取得工程と、The acquisition process for acquiring shooting information related to fluctuations in the shooting angle of view during movie shooting, and
前記複数のフレーム画像に、仮想光源からの仮想光を照射した効果であるリライティング効果を付与する画像処理を行う処理工程と、A processing step of performing image processing for imparting a rewriting effect, which is an effect of irradiating the plurality of frame images with virtual light from a virtual light source, and
前記処理工程で画像処理に用いるパラメータを設定する設定工程と、A setting process for setting parameters used for image processing in the processing process, and a setting process for setting parameters.
前記撮影画角の変動が前記動画を撮影する撮影装置のズーム動作によって生じるものである場合、前記仮想光源の位置を変えないモードと、前記仮想光源の位置を被写体に対して相対的に遠くするモードとを選択可能とする選択工程とを有し、When the fluctuation of the shooting angle of view is caused by the zoom operation of the shooting device that shoots the moving image, the mode in which the position of the virtual light source is not changed and the position of the virtual light source are set relatively far from the subject. It has a selection process that makes it possible to select a mode.
前記設定工程では、前記複数のフレーム画像のうちで撮影画角の変動が生じた期間のフレーム画像に対して、前記選択工程で選択されたモードに基づき前記パラメータを設定することを特徴とする画像処理装置の制御方法。The setting step is an image characterized in that the parameters are set based on the mode selected in the selection step for the frame image during the period in which the shooting angle of view fluctuates among the plurality of frame images. How to control the processing device.
動画撮影時の撮影画角の変動に関する撮影情報を取得する取得工程と、The acquisition process for acquiring shooting information related to fluctuations in the shooting angle of view during movie shooting, and
前記複数のフレーム画像に、仮想光源からの仮想光を照射した効果であるリライティング効果を付与する画像処理を行う処理工程と、A processing step of performing image processing for imparting a rewriting effect, which is an effect of irradiating the plurality of frame images with virtual light from a virtual light source, and
前記処理工程で画像処理に用いるパラメータを設定する設定工程と、A setting process for setting parameters used for image processing in the processing process, and a setting process for setting parameters.
前記撮影画角の変動が前記動画を撮影する撮影装置のパンニング動作によって生じるものである場合、前記仮想光源の位置を変えないモードと、前記仮想光源の位置をパンニング動作に連動して変更するモードとを選択可能とする選択工程とを有し、When the fluctuation of the shooting angle of view is caused by the panning operation of the shooting device that shoots the moving image, a mode in which the position of the virtual light source is not changed and a mode in which the position of the virtual light source is changed in conjunction with the panning operation. Has a selection process that makes it possible to select
前記設定工程では、前記複数のフレーム画像のうちで撮影画角の変動が生じた期間のフレーム画像に対して、前記選択工程で選択されたモードに基づき前記パラメータを設定することを特徴とする画像処理装置の制御方法。The setting step is an image characterized in that the parameters are set based on the mode selected in the selection step for the frame image during the period in which the shooting angle of view fluctuates among the plurality of frame images. How to control the processing device.
動画撮影時の撮影画角の変動に関する撮影情報を取得する取得工程と、The acquisition process for acquiring shooting information related to fluctuations in the shooting angle of view during movie shooting, and
前記複数のフレーム画像に、仮想光源からの仮想光を照射した効果であるリライティング効果を付与する画像処理を行う処理工程と、A processing step of performing image processing for imparting a rewriting effect, which is an effect of irradiating the plurality of frame images with virtual light from a virtual light source, and
前記処理工程で画像処理に用いるパラメータを設定する設定工程と、A setting process for setting parameters used for image processing in the processing process, and a setting process for setting parameters.
前記撮影画角の変動が前記動画を撮影する撮影装置のパンニング動作によって生じるものである場合、前記仮想光源の位置をパンニング動作に連動して変更するモードと、前記仮想光源の位置を変更せずに発光角度をパンニング動作に連動して変更するモードとを選択可能とする選択工程とを有し、When the fluctuation of the shooting angle is caused by the panning operation of the shooting device that shoots the moving image, the mode in which the position of the virtual light source is changed in conjunction with the panning operation and the position of the virtual light source are not changed. It has a selection process that makes it possible to select a mode that changes the light emission angle in conjunction with the panning operation.
前記設定工程では、前記複数のフレーム画像のうちで撮影画角の変動が生じた期間のフレーム画像に対して、前記選択工程で選択されたモードに基づき前記パラメータを設定することを特徴とする画像処理装置の制御方法。The setting step is an image characterized in that the parameters are set based on the mode selected in the selection step for the frame image during the period in which the shooting angle of view fluctuates among the plurality of frame images. How to control the processing device.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017104218A JP6946055B2 (en) | 2017-05-26 | 2017-05-26 | Image processing equipment and image processing methods, programs |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017104218A JP6946055B2 (en) | 2017-05-26 | 2017-05-26 | Image processing equipment and image processing methods, programs |
Publications (3)
| Publication Number | Publication Date |
|---|---|
| JP2018201089A JP2018201089A (en) | 2018-12-20 |
| JP2018201089A5 JP2018201089A5 (en) | 2020-07-02 |
| JP6946055B2 true JP6946055B2 (en) | 2021-10-06 |
Family
ID=64668382
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2017104218A Active JP6946055B2 (en) | 2017-05-26 | 2017-05-26 | Image processing equipment and image processing methods, programs |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6946055B2 (en) |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3230481B2 (en) * | 1998-03-13 | 2001-11-19 | 株式会社朋栄 | Television image synthesis method |
-
2017
- 2017-05-26 JP JP2017104218A patent/JP6946055B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2018201089A (en) | 2018-12-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6445844B2 (en) | Imaging device and method performed in imaging device | |
| JP5108093B2 (en) | Imaging apparatus and imaging method | |
| JP6381404B2 (en) | Image processing apparatus and method, and imaging apparatus | |
| JP5743696B2 (en) | Image processing apparatus, image processing method, and program | |
| CN108337447A (en) | High dynamic range image exposure compensation value acquisition method, device, equipment and medium | |
| JP5713885B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
| JP6833415B2 (en) | Image processing equipment, image processing methods, and programs | |
| US9961319B2 (en) | Image processing apparatus and control method thereof | |
| US9892497B2 (en) | Image processing apparatus, imaging apparatus, and image processing method | |
| JP2017138927A (en) | Image processing device, imaging apparatus, control method and program thereof | |
| JP2020102666A (en) | Image processing device, imaging device, image processing method, and program | |
| CN110324529B (en) | Image processing apparatus and control method thereof | |
| US10863103B2 (en) | Setting apparatus, setting method, and storage medium | |
| JP2021064884A (en) | Image processing apparatus, imaging apparatus, control method, program, and imaging system | |
| JP6937603B2 (en) | Image processing equipment and its control methods, programs, and storage media | |
| CN113542543B (en) | Image processing device, image processing method and storage medium | |
| JP2018050149A (en) | Image processing apparatus | |
| KR101630307B1 (en) | A digital photographing apparatus, a method for controlling the same, and a computer-readable storage medium | |
| JP6921606B2 (en) | Image processing equipment, image processing methods and programs | |
| JP2010183460A (en) | Image capturing apparatus and method of controlling the same | |
| JP2018182700A (en) | IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, PROGRAM, AND STORAGE MEDIUM | |
| JP6946055B2 (en) | Image processing equipment and image processing methods, programs | |
| JP2018098582A (en) | Image processing apparatus and method, and imaging apparatus | |
| JP5615012B2 (en) | White balance stable adjustment device and control method thereof, program for white balance stable adjustment | |
| JP2020024581A (en) | Image processing apparatus, image processing method, and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200522 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200522 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210420 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210525 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210721 |
|
| 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: 20210817 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210915 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 6946055 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |