JP6937603B2 - Image processing equipment and its control methods, programs, and storage media - Google Patents
Image processing equipment and its control methods, programs, and storage media Download PDFInfo
- Publication number
- JP6937603B2 JP6937603B2 JP2017084760A JP2017084760A JP6937603B2 JP 6937603 B2 JP6937603 B2 JP 6937603B2 JP 2017084760 A JP2017084760 A JP 2017084760A JP 2017084760 A JP2017084760 A JP 2017084760A JP 6937603 B2 JP6937603 B2 JP 6937603B2
- Authority
- JP
- Japan
- Prior art keywords
- subject
- image
- reliability
- correction process
- 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.)
- Active
Links
Images
Landscapes
- Image Processing (AREA)
- Studio Devices (AREA)
Description
本発明は、画像中の被写体の明るさを補正する画像処理技術に関する。 The present invention relates to an image processing technique for correcting the brightness of a subject in an image.
従来、撮影画像中の被写体に対して、仮想的な光源からの光を照射して陰影を補正する、リライティング(Relighting)を行う技術が知られている。リライティング処理により、環境光源によって生じた被写体の陰影などを明るくした画像を得ることが可能となる。特許文献1では、撮影画像に疑似的なリライティング処理を行うこと、具体的には、顔領域全体の平均輝度よりも低い輝度領域を陰影領域として抽出し、抽出した陰影領域の明度を高くすることが記載されている。 Conventionally, there is known a technique of performing relighting by irradiating a subject in a captured image with light from a virtual light source to correct shadows. The rewriting process makes it possible to obtain an image in which the shadow of the subject caused by the environmental light source is brightened. In Patent Document 1, a pseudo rewriting process is performed on a captured image, specifically, a brightness region lower than the average brightness of the entire face region is extracted as a shadow region, and the brightness of the extracted shadow region is increased. Is described.
上記リライティング処理によって画像中の被写体の陰影を変更する場合には、リライティング処理対象の被写体領域を適切に決定する必要がある。被写体領域が適切でない場合、リライティング処理後の画像が不自然になってしまうことがある。 When the shadow of the subject in the image is changed by the rewriting process, it is necessary to appropriately determine the subject area to be rewritten. If the subject area is not appropriate, the relighted image may look unnatural.
上記特許文献1では、リライティング処理領域を画像中の顔領域の位置および大きさに基づいて決定しているが、顔領域が誤検出された場合、適切ではない領域に対してリライティング処理を実行しまう可能性がある。例えば、顔検出処理において、顔領域の周辺の背景に含まれる顔に類似した領域を顔であると誤検出した場合、顔ではない背景の一部の領域に対してリライティング処理を実行してしまう可能性がある。 In Patent Document 1, the rewriting processing area is determined based on the position and size of the face area in the image, but if the face area is erroneously detected, the rewriting processing is executed on the inappropriate area. there is a possibility. For example, in the face detection process, if an area similar to a face included in the background around the face area is erroneously detected as a face, the rewriting process is executed for a part of the background that is not the face. there is a possibility.
本発明は、上記課題に鑑みてなされ、その目的は、被写体の陰影などを補正する処理を行う領域の信頼度に基づき、適切に処理を行うことができる技術を実現することである。 The present invention has been made in view of the above problems, and an object of the present invention is to realize a technique capable of appropriately performing processing based on the reliability of a region for performing processing for correcting shadows and the like of a subject.
上記課題を解決し、目的を達成するために、本発明の画像処理装置は、仮想的な光源である仮想光源を設定し、前記仮想光源を用いて画像中の被写体の明るさを補正する補正処理を行う処理手段と、前記画像中の被写体の特定の部分領域情報を取得する取得手段と、前記画像における前記補正処理の対象となる被写体領域を決定する決定手段と、前記取得手段により得られた前記被写体の特定の部分領域情報と前記決定手段により決定された前記被写体領域との関係に基づく前記補正処理の信頼度に応じて前記処理手段による補正処理を制御する制御手段と、を有する。 In order to solve the above problems and achieve the object, the image processing apparatus of the present invention sets a virtual light source which is a virtual light source, and corrects the brightness of the subject in the image by using the virtual light source. and processing means for processing, acquisition means for acquiring a specific partial area information of the subject in the image, and determining means for determining a subject to the subject area of the correction process in the image obtained by the acquisition unit and and a control means for controlling the correction processing by said processing means in response to the correction processing of the reliability based on a relationship between the determined said object regions by a particular partial area information and said determining means of the subject.
本発明によれば、被写体の陰影などを補正する処理を行う領域の信頼度に基づき、適切に処理を行うことができる。 According to the present invention, the processing can be appropriately performed based on the reliability of the region for which the processing for correcting the shadow of the subject or the like is performed.
以下に、本発明を実施するための形態について詳細に説明する。尚、以下に説明する実施の形態は、本発明を実現するための一例であり、本発明が適用される装置の構成や各種条件によって適宜修正又は変更されるべきものであり、本発明は以下の実施の形態に限定されるものではない。また、後述する各実施形態の一部を適宜組み合わせて構成してもよい。 Hereinafter, embodiments for carrying out the present invention will be described in detail. The embodiments described below are examples for realizing the present invention, and should be appropriately modified or changed depending on the configuration of the apparatus to which the present invention is applied and various conditions. It is not limited to the embodiment of. In addition, a part of each embodiment described later may be appropriately combined and configured.
[実施形態1]以下、本実施形態の画像処理装置として、例えば、静止画や動画を撮影可能なデジタルカメラ等の撮像装置に適用した例について説明する。なお、本実施形態では、撮像装置100としてデジタルカメラを例示しているが、カメラ付き携帯電話やその一種であるスマートフォン、タブレット端末、カメラ付きのパーソナルコンピュータ(PC)等の情報処理装置であってもよい。
[Embodiment 1] Hereinafter, an example in which the image processing device of the present embodiment is applied to an image pickup device such as a digital camera capable of capturing a still image or a moving image will be described. In the present embodiment, a digital camera is illustrated as the
<装置構成>まず、図1を参照して、本実施形態の撮像装置の構成および機能について説明する。 <Device Configuration> First, the configuration and functions of the imaging device of the present embodiment will be described with reference to FIG.
本実施形態の撮像装置100は、ある光源環境で撮影された画像中の被写体に対して、仮想的な光源の光を照射することで陰影を補正(変更)するリライティング(Relighting)処理を行う機能を有する。
The
図1において、撮影レンズ101はズームレンズ、フォーカスレンズを含むレンズ群である。シャッター102は絞り機能を備える。撮像部103は光学像を電気信号に変換するCCDやCMOS素子等で構成される撮像素子である。A/D変換器104は、撮像部103から出力されるアナログ信号をデジタル信号に変換する。画像処理部105は、A/D変換器104から出力される画像データに対し、ホワイトバランス(WB)処理や、ガンマ処理、輪郭強調、色補正処理等の各種画像処理を行う。メモリ制御部107は、画像メモリ106を制御する。画像メモリ106は、A/D変換器104から出力される画像データや、表示部109に表示するための画像データを格納する。画像メモリ106は、所定枚数の静止画像や所定時間の動画および音声を格納するのに十分な記憶容量を備えている。また、画像メモリ106は画像表示用のメモリ(ビデオメモリ)を兼ねている。D/A変換器108は、画像メモリ106に格納されている画像表示用のデータをアナログ信号に変換して表示部109に供給する。表示部109は、LCDや有機EL等の表示器である。
In FIG. 1, the photographing
コーデック部110は、画像メモリ106に書き込まれた画像データをMPEGやH.264等の所定のビットレートおよびフォーマットで圧縮符号化して映像ファイルを生成し、記録媒体112に記録する。また、コーデック部110は、記録媒体112に記録されている映像ファイルを所定のビットレートおよびフォーマットで復号し、画像メモリ106に格納する。
The
記録媒体I/F111は、記録媒体112へのアクセスを制御するインターフェースである。記録媒体112は、撮影された画像データを記録するための内蔵および/または着脱可能なメモリカードやHDD(ハードディスクドライブ)等である。
The recording medium I / F 111 is an interface that controls access to the
顔検出部113は、撮影画像中の特定の被写体情報として人物の顔領域情報を検出する。リライティング処理部114は、撮影画像にリライティング処理を行う。
The
操作部115は、ユーザからの各種操作を受け付ける各種スイッチ、ボタン、タッチパネル等の操作部材であり、電源スイッチ、シャッターボタン、録画開始・終了ボタン等を含む。操作部115は、システム制御部120に各種の操作状態を通知する。
The
システム制御部120は、不揮発性メモリ116に格納されたプログラムを実行することで、後述するフローチャートの各処理を実現する。117はシステムメモリであり、RAMが用いられる。システムメモリ117には、システム制御部120の動作用の定数、変数、不揮発性メモリ116から読み出したプログラム等を展開する。また、システム制御部120は画像メモリ106、D/A変換器108、表示部109等を制御することにより表示制御も行う。
The
距離検出部118は、被写体までの距離を計測し、後述する距離算出部303において撮影画素の画素単位に対応する距離情報を2次元の距離マップとして算出する。
The
<撮影動作>次に、本実施形態の撮像装置100による撮影動作について説明する。
<Shooting operation> Next, a shooting operation by the
撮像部103は、撮影レンズ101およびシャッター102を介して入射した光を光電変換し、アナログ画像信号としてA/D変換器104へ出力する。A/D変換器104は撮像部103から出力されるアナログ画像信号をデジタル信号に変換し画像処理部105に出力する。
The
画像処理部105は、A/D変換器104からの画像データ、又は、メモリ制御部107からの画像データに対し、色変換処理、ガンマ処理、輪郭強調処理等を行う。また、画像処理部105では、顔検出部113により検出された顔領域情報や、撮像した画像データを用いて所定の評価値算出処理(不図示)を行い、得られた評価値に基づいてシステム制御部120が露光制御、測距制御を行う。これにより、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等の規格に基づき圧縮符号化する。システム制御部120は符号化した画像データを関連付けて、記録媒体I/F111を介して記録媒体112に格納する。
The
<画像処理部>次に、図2を参照して、本実施形態の画像処理部105の構成および機能について説明する。
<Image Processing Unit> Next, the configuration and function of the
図2において、画像処理部105は、同時化処理部200、WB増幅部201、輝度・色信号生成部202、輪郭強調処理部203、輝度ガンマ処理部204、色変換処理部205、色ガンマ処理部206、色差信号生成部207、陰影情報取得部208を含む。
In FIG. 2, the
次に、画像処理部105における処理を説明する。
Next, the processing in the
図1のA/D変換器104から画像処理部105に入力された画像信号は同時化処理部200に入力される。同時化処理部200は入力されたベイヤーRGBの画像データに対して、同時化処理を行い、色信号R,G,Bを生成する。WB増幅部201は、システム制御部120が算出するホワイトバランスゲイン値に基づき、RGBの色信号にゲインをかけ、ホワイトバランスを調整する。WB増幅部201から出力されるRGB信号は輝度・色信号生成部202に入力される。輝度・色信号生成部202はRGB信号から輝度信号Yを生成し、生成した輝度信号Yを輪郭強調処理部203、色信号RGBを色変換処理部205へ出力する。
The image signal input from the A /
輪郭強調処理部203は、輝度信号Yに対して輪郭強調処理を行い、輝度ガンマ処理部204へ出力する。輝度ガンマ処理部204は輝度信号Yに対してガンマ補正を行い、画像メモリ106に出力する。
The contour
色変換処理部205は、RGB信号に対するマトリクス演算などにより、所望のカラーバランスへ変換する。色ガンマ処理部206は、RGBの色信号にガンマ補正を行う。色差信号生成部207では、RGB信号から色差信号R−Y、B−Y信号を生成し、画像メモリ106に出力する。画像メモリ106に格納された輝度・色差信号(Y,R−Y,B−Y)は、コーデック部110によって圧縮符号化され、記録媒体112に記録される。
The color
また、色変換処理部205で処理されたRGB信号は陰影情報取得部208へ出力される。陰影情報取得部208は、撮影時の光源環境によって被写体に生じた陰影の状態を解析するための情報を取得する。例えば、被写体の平均輝度情報および顔領域の輝度ヒストグラム情報などを陰影情報として取得する。
Further, the RGB signal processed by the color
<リライティング処理部>次に、図3を参照して、本実施形態のリライティング処理部114の構成および機能について説明する。
<Rewriting Processing Unit> Next, the configuration and function of the
ユーザ操作によりリライティング処理が選択されている場合は、画像処理部105からリライティング処理部114に画像データを出力し、仮想光源によるリライティング処理を行う。
When the rewriting process is selected by the user operation, the image data is output from the
図3において、RGB信号変換部301は入力された輝度・色差信号(Y、B−Y、R−Y)をRGB信号に変換する。デガンマ処理部302は、RGB信号変換部301から出力されるRGB信号にデガンマ処理を行う。距離算出部303は、距離検出部118から出力される撮像装置と被写体との距離情報を取得する。法線算出部304は、距離算出部303で算出された被写体の距離情報から法線情報を算出する。仮想光源反射成分算出部305は、仮想光源を設定し、設定された仮想光源から照射された光が被写体に反射した成分を算出する。仮想光源付加処理部306は、デガンマ処理部302から出力されるRGB信号に、仮想光源付加処理部306で算出された仮想光源の光が被写体に反射した成分をリライティング効果として付加する。ガンマ処理部307は、仮想光源付加処理部306から出力されるRGB信号にガンマ特性をかける。輝度・色差信号変換部308は、ガンマ処理部307から出力されるRGB信号を輝度・色差信号(Y、B−Y、R−Y)に変換する。被写体領域決定部309は、距離算出部303から取得した距離マップと、顔検出部113から取得した顔領域情報とに基づいて撮影画像における被写体領域を決定する。リライティング信頼度算出部310は、顔検出部113により検出された顔領域情報と、被写体領域決定部309により得られた被写体領域情報との関係に基づいてリライティング処理の信頼度を算出する。
In FIG. 3, the RGB
次に、リライティング処理部114の動作について説明する。
Next, the operation of the
リライティング処理部114は、画像メモリ106に格納された輝度・色差信号(Y、B−Y、R−Y)を読み出し、RGB信号変換部301に入力する。RGB信号変換部301は、入力された輝度・色差信号(Y、B−Y、R−Y)をRGB信号に変換し、デガンマ処理部302へ出力する。
The rewriting
デガンマ処理部302は、画像処理部105のガンマ処理部204、206でかけられたガンマ特性と逆の特性の演算を行いリニアデータに変換する。デガンマ処理部302は、リニア変換後のRGB信号(Rt、Gt、Bt)を、仮想光源反射成分算出部305および仮想光源付加処理部306に出力する。
The
距離算出部303は、距離検出部118から取得した被写体距離情報から距離マップを算出する。被写体距離情報は、撮影画像の画素単位で得られる2次元の距離情報であり、距離マップは、撮影画像の各画素に対する距離情報をマップデータとしたものである。法線算出部304は、距離算出部303から距離マップを取得し、撮影画像の各画素に対応する法線情報をマップデータとした法線マップを算出する。距離マップから法線マップを生成する方法は、公知の技術を用いるものとするが、具体的な処理例について図4を用いて説明する。図4は撮影座標と被写体と仮想光源の位置関係を示している。例えば、図4に示すようにある被写体401に対して、撮影画像の水平方向の差分ΔHに対する距離(奥行き)Dの差分ΔDから勾配情報を算出し、勾配情報から法線Nを算出することが可能である。撮影画像の各画素に対して上記処理を行うことで、撮影画像の各画素に対応する法線情報Nを算出可能である。法線算出部304は、撮影画像の各画素に対応する法線情報を法線マップとして生成し、仮想光源反射成分算出部305に出力する。
The
被写体領域決定部309は、距離算出部303から取得した距離マップと顔検出部113から取得した顔領域情報とから撮影画像における被写体領域を決定する。具体的には、顔領域情報から顔領域内の距離値の平均値Defaveを算出し、平均値Defaveが含まれる任意の範囲、例えばDefave±10といった距離値を持つ領域を被写体領域として決定する。
The subject
リライティング信頼度算出部310は、被写体領域決定部309から取得した被写体領域情報と、顔検出部113から取得した顔領域情報との関係に基づいてリライティング処理の信頼度を算出する。リライティング信頼度とは、リライティング処理により意図通りに明るさが補正された画像が得られるか否かを数値化した指標である。リライティング処理により不自然な画像になる可能性がある場合や、絵柄が壊れてしまうといった可能性ある場合に、リライティング信頼度が低い値となる。
The rewriting
図5は顔検出部113により検出された顔領域情報と被写体領域決定部309により得られた被写体領域情報を例示している。図5において、(a)は撮影シーン、(b)、(c)、(d)は顔検出部113により検出された顔領域情報、(e)、(f)、(g)は被写体領域決定部309により得られた被写体領域情報をそれぞれ例示している。また、図5(b)は、顔検出部113において適切に顔領域が検出された場合の顔検出結果を示している。図5(c)と(d)は顔検出部113において顔領域を誤検出した場合の顔検出結果を示している。特に、図5(c)は顔領域外の背景の領域を顔であると誤検出した場合であり、図5(d)は実際の顔の面積と比較して小さい領域を顔であると誤検出した場合である。図5(e)は、被写体領域決定部309において適切に決定された被写体領域情報を示している。図5(f)と(g)は被写体領域決定部309において被写体領域を誤判定した場合の被写体領域情報を示している。特に、図5(f)は被写体領域外の部分も被写体領域であると誤判定した場合であり、図5(g)は被写体領域の一部を領域外であると誤判定した場合である。図5(c)、(d)、(f)、(g)のように誤判定した被写体領域情報を用いてリライティング処理を行うとリライティング処理後の画像が不自然になる可能性がある。このため、上記のように誤検出したケースでは、リライティング信頼度算出部310において算出されるリライティング信頼度が低い値となる。
FIG. 5 illustrates the face area information detected by the
仮想光源反射成分算出部305では、図4に示す仮想光源402と被写体401との距離K、法線情報N、仮想光源パラメータLに基づき、仮想光源402が被写体401に反射する成分を算出する。具体的には、仮想光源402と被写体401との距離Kの二乗に反比例し、法線ベクトルNと光源方向ベクトルLの内積に比例するように、撮影画像の各画素に対応する座標位置の反射成分を算出する。これについて、図4を用いて説明する。図4において、401が被写体、402は設定した仮想光源の位置を示している。撮像装置100で撮影された画像の水平画素位置H1(垂直画素位置は説明の簡略化のため省略)における反射成分は、撮影座標H1における法線N1と仮想光源の方向ベクトルL1の内積に比例し、仮想光源と被写体位置の距離K1に反比例する値となる。
The virtual light source reflection
上記の関係を数式で表現すると仮想光源による被写体反射成分(Ra、Ga、Ba)は下記式1となる。
(式1)
Ra=α×(−L・N)/K2×Rt
Ga=α×(−L・N)/K2×Gt
Ba=α×(−L・N)/K2×Bt
ここで、αは仮想光源の強さであり、リライティング処理のゲイン値、Lは仮想光源の3次元方向ベクトル、Nは被写体の3次元法線ベクトル、Kは仮想光源と被写体の距離である。また、Rt、Gt、Btはデガンマ処理部302から出力されるRGB信号である。
Expressing the above relationship with a mathematical formula, the subject reflection components (Ra, Ga, Ba) by the virtual light source are given by the following equation 1.
(Equation 1)
Ra = α × (−L ・ N) / K 2 × Rt
Ga = α × (−L ・ N) / K 2 × Gt
Ba = α × (−L ・ N) / K 2 × Bt
Here, α is the strength of the virtual light source, 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 RGB signals output from the
仮想光源反射成分算出部305は、リライティング信頼度算出部310で算出したリライティング信頼度が所定の閾値よりも高い場合には、上記式1で仮想光源による反射成分(Ra、Ga、Ba)を算出する。また、リライティング信頼度が所定の閾値よりも低い場合には、リライティング処理のゲイン値αや、仮想光源の3次元方向ベクトルL、3次元法線ベクトルNを制御して反射成分(Ra、Ga、Ba)を算出する。具体的な処理については図7のフローチャートを用いて後述する。
When the rewriting reliability calculated by the rewriting
上記のように算出した仮想光源による反射成分(Ra、Ga、Ba)は仮想光源付加処理部306へ出力される。仮想光源付加処理部306では、仮想光源による反射成分(Ra、Ga、Ba)を付加する下記式2の処理を行う。
(式2)
Rout=Rt+Ra
Gout=Gt+Ga
Bout=Bt+Ba
仮想光源付加処理部306から出力された画像信号(Rout、Gout、Bout)はガンマ処理部307に入力される。ガンマ処理部307では、入力されるRGB信号にガンマ補正を行う。輝度・色差信号変換部308では、RGB信号から輝度Y、色差信号R−Y、B−Y信号を生成する。
The reflection components (Ra, Ga, Ba) by the virtual light source calculated as described above are output to the virtual light source
(Equation 2)
Rout = Rt + Ra
Gout = Gt + Ga
Bout = Bt + Ba
The image signals (Rout, Gout, Bout) output from the virtual light source
以上がリライティング処理部114の動作である。図6はリライティング処理部114でリライティング処理した画像の一例を示している。図6(a)はリライティング処理前の撮影画像、図6(b)はリライティング処理後の撮影画像である。図6(a)で暗い被写体に対してリライティング処理を施すことで、図6(b)のように陰影が明るくなるように補正される。
The above is the operation of the
システム制御部120は、リライティング処理部114から出力される輝度・色差信号(Y、B−Y、R−Y)を、メモリ制御部107によって画像メモリ106に書き込む。その後、コーデック部110で圧縮符号化を行い、記録媒体I/F111を介して記録媒体112に記録する。
The
<リライティング処理>次に、図7を参照して、本実施形態のリライティング処理の制御手順について説明する。 <Rewriting Process> Next, the control procedure of the rewriting process of the present embodiment will be described with reference to FIG. 7.
なお、図7の処理は、不揮発性メモリ116に記録されたプログラムを、システムメモリ117に読み出してシステム制御部120が実行することにより実現する。後述する図9でも同様である。
The process of FIG. 7 is realized by reading the program recorded in the
本実施形態では、システム制御部120がリライティング処理部114を制御して、リライティング処理の信頼度を算出し、算出されたリライティング信頼度に基づきリライティング処理を行う。
In the present embodiment, the
S701では、システム制御部120は、上述した撮影動作を行い被写体を撮影する。
In S701, the
S702では、システム制御部120は、ユーザ操作により操作部115を介してリライティング処理モードが選択されているか判定することで、リライティング処理部114による処理を行うか否かを判定する。リライティング処理を行うと判定した場合はS703に進み、そうでない場合は本処理を終了する。
In S702, the
S703では、システム制御部120は、顔検出部113から被写体の顔領域情報を取得する。顔検出部113は、撮影画像中の被写体の顔のパーツである目、鼻、口などの器官の座標位置の情報を取得し、それら座標位置から顔領域を検出する。なお、顔検出部113は、顔のパーツである器官の位置から顔領域を検出する方法に限定されず、過去の顔領域の検出結果を学習して顔領域を検出するような他の方法を用いてもよい。
In S703, the
S704では、システム制御部120は、被写体領域決定部309から被写体領域情報を取得する。被写体領域決定部309は、上述したように顔検出部113から顔領域情報、距離算出部303から距離マップ情報を取得し、顔の距離値と同等の距離値を持つ領域を被写体領域として決定する。
In S704, the
S705では、システム制御部120は、リライティング信頼度算出部310においてリライティング信頼度を算出する。リライティング信頼度算出部310は、図5で説明したように顔検出部113による検出結果や被写体領域決定部309による判定結果が適切でない場合には、リライティング信頼度として低い値を算出する。ここで、リライティング信頼度の算出方法について図8を用いて説明する。
In S705, the
図8(a)は、被写体領域と顔領域の位置の一致度レベルとリライティング信頼度との関係を例示している。被写体領域内に顔領域が含まれていればリライティング信頼度は高くなり、反対に図5(c)に示したように被写体領域内に顔領域が含まれていなければリライティング信頼度は低くなる。被写体領域の位置と顔領域の位置が離れている程、一致度レベルは低くなりリライティング信頼度は低くなる。 FIG. 8A illustrates the relationship between the level of coincidence between the positions of the subject area and the face area and the rewriting reliability. If the face area is included in the subject area, the rewriting reliability is high, and conversely, as shown in FIG. 5C, if the face area is not included in the subject area, the rewriting reliability is low. The farther the position of the subject area and the position of the face area are, the lower the matching degree level and the lower the rewriting reliability.
図8(b)は、被写体領域に対して、顔領域の面積レベルとリライティング信頼度との関係を例示している。図5(d)に示したように被写体領域に対して、顔領域が小さすぎる(両者の差異が閾値未満の)場合または大きすぎる(両者の差異が閾値以上の)場合にリライティング信頼度を低くする。撮影シーンにより、顔をアップで撮影した場合と全身を撮影した場合で被写体領域の大きさは異なる。このため、被写体領域に対して顔領域がどの程度小さいと誤検出であるのかを判断するのは難しいが、被写体領域と比較してあまりに顔領域が小さい場合は誤検出である可能性が高いのでリライティング信頼度を低くするよう制御する。 FIG. 8B illustrates the relationship between the area level of the face region and the rewriting reliability with respect to the subject region. As shown in FIG. 5D, the rewriting reliability is low when the face area is too small (the difference between the two is less than the threshold value) or too large (the difference between the two is greater than or equal to the threshold value) with respect to the subject area. do. Depending on the shooting scene, the size of the subject area differs depending on whether the face is shot up or the whole body is shot. For this reason, it is difficult to determine how small the face area is with respect to the subject area for false detection, but if the face area is too small compared to the subject area, there is a high possibility of false detection. Control to reduce rewriting reliability.
図8(c)は、顔周辺領域への被写体領域のはみ出しレベルとリライティング信頼度との関係を例示している。図5(f)に示したように顔領域の周辺領域にまで被写体領域があった場合に、リライティングの信頼度を低くする。被写体領域は、顔も含まれているが首から下の胴体部分も含まれているので、被写体領域が顔領域をはみ出ていても問題はない。しかしながら、被写体領域が顔領域の上部、すなわち頭の上などにあった場合には、誤検出である可能性が高いとしてリライティング信頼度を低くする。 FIG. 8C illustrates the relationship between the protrusion level of the subject area to the peripheral area of the face and the rewriting reliability. As shown in FIG. 5 (f), when the subject area extends to the peripheral area of the face area, the reliability of rewriting is lowered. The subject area includes the face, but also includes the body portion below the neck, so there is no problem even if the subject area extends beyond the face area. However, if the subject area is above the face area, that is, above the head, the rewriting reliability is lowered because there is a high possibility of false detection.
図8(d)は、顔領域に対して、被写体領域の欠けているレベルとリライティング信頼度との関係を例示している。図5(g)で示したように顔領域の一部が欠けている被写体領域であった場合に、リライティングの信頼度を低くする。欠けている領域が大きいほどリライティングの信頼度を低く算出するよう制御する。 FIG. 8D illustrates the relationship between the missing level of the subject area and the rewriting reliability with respect to the face area. When the subject area lacks a part of the face area as shown in FIG. 5 (g), the reliability of rewriting is lowered. The larger the missing area, the lower the rewriting reliability is controlled to be calculated.
そして、リライティング信頼度算出部310は、図8(a)〜(d)に示した複数の要素から最終的なリライティング信頼度を算出する。例えば4つの要素に対しそれぞれリライティング信頼度を算出し、その平均値を最終的なリライティング信頼度を算出するか、もしくは個々の要素の重要度に応じて重みを持たせて、最終的なリライティング信頼度を算出する。
Then, the rewriting
図7に戻り、S706では、システム制御部120は、S705で算出したリライティング信頼度が所定の閾値Thより高いか否かを判定し、閾値以上であると判定した場合はS707に進み、閾値未満であると判定した場合はS708に進む。
Returning to FIG. 7, in S706, the
S707では、システム制御部120は、上述したリライティング処理を実行する。
In S707, the
S708では、システム制御部120は、リライティング処理のパラメータを通常の値から変更してリライティング処理を実行する。
In S708, the
具体的には、仮想光源による反射成分(Ra、Ga、Ba)は、前述した式1を用いて算出されるが、式中で用いているリライティング処理のゲイン値αや、仮想光源の3次元方向ベクトルL、3次元法線ベクトルNを制御する。例えば、リライティング信頼度が低い場合は、リライティング処理をすると不自然に処理結果となる可能性が高いため、リライティング処理のゲイン値αを小さく制御することが望ましい。よって、リライティング信頼度の低さに応じてリライティング処理のゲイン値αを通常よりも低く設定するよう制御する。例えばリライティング信頼度が最低値の0であれば、リライティング処理のゲイン値αをゼロとし、リライティング処理をしないよう制御する。 Specifically, the reflection components (Ra, Ga, Ba) by the virtual light source are calculated using the above-mentioned equation 1, but the gain value α of the rewriting process used in the equation and the three-dimensional effect of the virtual light source. The direction vector L and the three-dimensional normal vector N are controlled. For example, when the rewriting reliability is low, there is a high possibility that the processing result will be unnatural when the rewriting process is performed. Therefore, it is desirable to control the gain value α of the rewriting process to be small. Therefore, the gain value α of the rewriting process is controlled to be set lower than usual according to the low rewriting reliability. For example, if the rewriting reliability is 0, which is the lowest value, the gain value α of the rewriting process is set to zero, and control is performed so that the rewriting process is not performed.
また、リライティング信頼度が低くなった要因により、仮想光源による反射成分を制御することも可能である。例えば、リライティング信頼度が低い要因が被写体領域決定部309による被写体領域情報の誤判定であった場合には、被写体領域決定部309に距離情報を出力している距離算出部303が適切に算出していないことになる。この場合、距離算出部303からの距離情報に基づいて算出している法線算出部304の出力である3次元法線ベクトルNもまた正確でないと考えられるため、N=1として仮想光源による反射成分(Ra、Ga、Ba)を求める。
It is also possible to control the reflection component by the virtual light source due to the factor that the rewriting reliability is lowered. For example, when the cause of the low rewriting reliability is an erroneous determination of the subject area information by the subject
例えば、リライティング信頼度が低い要因が被写体領域決定部309の被写体領域情報の誤判定であって、その誤検出が図5(g)のように顔領域に対して被写体領域が欠けている場合には、その欠けている領域にリライティング処理をしなければ目立たない。このため、欠けている領域に仮想光源の光が照射しないよう仮想光源の3次元方向ベクトルLの照射範囲を制御して仮想光源による反射成分(Ra、Ga、Ba)を求める。
For example, when the factor of low rewriting reliability is an erroneous determination of the subject area information of the subject
以上、システム制御部120のリライティング処理部114の動作を説明した。
The operation of the
[実施形態2]次に、図9を参照して、実施形態2について説明する。 [Embodiment 2] Next, the second embodiment will be described with reference to FIG.
図9は、撮影画像中に複数の被写体が存在する場合のリライティング処理の制御手順を示している。 FIG. 9 shows a control procedure of the rewriting process when a plurality of subjects are present in the captured image.
なお、図9のS701〜S705は、被写体が単体の場合の図7の処理と同一であるため、説明を省略する。 Since S701 to S705 in FIG. 9 are the same as the processing in FIG. 7 when the subject is a single subject, the description thereof will be omitted.
S901では、システム制御部120は、主要被写体レベルを算出する。主要被写体とは、例えば、撮影画像中に占める面積が大きい人物、予め登録された顔の人物、撮像装置からの距離が近い人物であり、撮影画像中において主要被写体であるほどレベルが高くなる。
In S901, the
S902では、システム制御部120は、被写体ごとのリライティング信頼度および主要被写体レベルの算出が完了したか否かを判定する。そして、リライティング信頼度および主要被写体レベルの算出が完了していると判定した場合にはS903に進み、完了していない場合にはS702に戻り、S702〜S902までの処理を繰り返す。
In S902, the
S903では、システム制御部120は、全ての被写体のリライティング信頼度が所定の閾値Thより高いか否かを判定し、閾値以上であると判定した場合はS904に進み、閾値未満であると判定した場合はS905に進む。
In S903, the
S904では、システム制御部120は、通常のリライティング処理を実行する。
In S904, the
S905では、システム制御部120は、S901で算出した主要被写体レベルが高い被写体のリライティング信頼度が所定の閾値Thより高いか否かを判定する。そして、閾値以上であると判定した場合はS906に進み、閾値未満であると判定した場合はS907に進む。
In S905, the
S906では、システム制御部120は、主要被写体には通常のリライティングを実行し、主要被写体ではない非主要被写体についてはリライティング処理のパラメータを変更してリライティング処理を実行する。例えば、非主要被写体はリライティング信頼度が低いので通常のリライティング処理のゲイン値よりも低いゲイン値を用いてリライティング処理を実行する。
In S906, the
S907では、システム制御部120は、全ての被写体に対して通常のリライティング処理で用いるパラメータを変更してリライティング処理を実行する。例えば、全ての被写体に対し、通常のリライティング処理のゲイン値よりも低いゲイン値を用いてリライティング処理を実行する。また、図7で説明したようにリライティング信頼度が低かった要因によって、リライティングパラメータの仮想光源の3次元方向ベクトルL、3次元法線ベクトルNの値を制御してリライティング処理を実行する。
In S907, the
以上、撮影画像中に複数の被写体が存在する場合のリライティング処理の制御手順を説明した。 The control procedure of the rewriting process when a plurality of subjects are present in the captured image has been described above.
なお、上述した各実施形態では、リライティング信頼度算出部310においてリライティング信頼度を算出する際に、図8(a)〜(d)を用いて誤検出の要因となる4要素から最終的なリライティング信頼度を算出する例を説明したが、これに限らず、誤検出のパターンは4要素以上あっても構わない。
In each of the above-described embodiments, when the rewriting
また、上述した各実施形態では、リライティング信頼度算出部310において、図8で示したように、顔検出部113の顔領域情報と被写体領域決定部309の被写体領域情報との関係を分析してリライティング信頼度を算出する例を説明したが、これに限るものではない。例えば、顔検出部113において検出した顔領域情報の信頼度を算出し、被写体領域決定部309において被写体領域情報の信頼度を算出し、少なくとも一方の信頼度の情報を取得して、その情報を基にリライティング信頼度を算出する構成にしてもよい。
Further, in each of the above-described embodiments, as shown in FIG. 8, the rewriting
また、上述した各実施形態では、1画像に対し最終的なリライティング信頼度を1つ算出、もしくは1画像に含まれる複数の被写体に対して各々のリライティング信頼度を算出する場合について説明したが、これに限るものではない。例えば、画素単位でのリライティング信頼度を算出する構成にしてもよく、その場合は、例えば被写体領域と顔領域の位置がずれていた場合に被写体領域と顔領域の位置のずれ量が大きい画素ほど、リライティング信頼度を低くする。 Further, in each of the above-described embodiments, a case where one final rewriting reliability is calculated for one image or each rewriting reliability is calculated for a plurality of subjects included in one image has been described. It is not limited to this. For example, the rewriting reliability may be calculated for each pixel. In that case, for example, when the positions of the subject area and the face area are misaligned, the larger the amount of misalignment between the subject area and the face area, the larger the pixel. , Reduce rewriting reliability.
また、本実施形態では、リライティング処理により被写体の陰影(暗部)が明るくなるように補正する場合について述べたが、逆に暗くするリライティングを行ってもよい。その場合、リライティング処理のゲイン値αをマイナスにする。 Further, in the present embodiment, the case where the shadow (dark part) of the subject is corrected so as to be brightened by the rewriting process has been described, but conversely, the relighting may be performed to darken the subject. In that case, the gain value α of the rewriting process is set to minus.
また、図4で説明した仮想光源の位置とリライティング処理の対象領域の画素の距離Dの算出方法は、上述した方法に限定するものではなく、どのような算出方法をとってもよい。例えば、撮像装置および被写体の位置を3次元位置として取得し、3次元での距離で計算してもよい。 Further, the method of calculating the position of the virtual light source and the distance D of the pixels of the target area of the rewriting process described with reference to FIG. 4 is not limited to the above-mentioned method, and any calculation method may be used. For example, the positions of the image pickup apparatus and the subject may be acquired as three-dimensional positions and calculated by the distance in three dimensions.
また、各画素のRGB信号に対して仮想光源による反射成分を付加する場合に、仮想光源と被写体との距離の二乗に反比例する式を用いたが、これに限定するものではない。例えば、距離Dに反比例するものや、ガウス分布的に照射範囲が変化する式であってもよい。 Further, when adding a reflection component by a virtual light source to the RGB signal of each pixel, an equation that is inversely proportional to the square of the distance between the virtual light source and the subject is used, but the present invention is not limited to this. 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以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
[Other Embodiments]
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
100…撮像装置、103…撮像部、105…画像処理部、113…顔検出部、114…リライティング処理部、118…距離検出部、120…システム制御部、303…距離算出部、309…被写体領域決定部、310…リライティング信頼度算出部 100 ... Imaging device, 103 ... Imaging unit, 105 ... Image processing unit, 113 ... Face detection unit, 114 ... Rewriting processing unit, 118 ... Distance detection unit, 120 ... System control unit, 303 ... Distance calculation unit, 309 ... Subject area Decision unit, 310 ... Rewriting reliability calculation unit
Claims (17)
前記画像中の被写体の特定の部分領域情報を取得する取得手段と、
前記画像における前記補正処理の対象となる被写体領域を決定する決定手段と、
前記取得手段により得られた前記被写体の特定の部分領域情報と前記決定手段により決定された前記被写体領域との関係に基づく前記補正処理の信頼度に応じて前記処理手段による補正処理を制御する制御手段と、を有することを特徴とする画像処理装置。 A processing means for setting a virtual light source, which is a virtual light source, and performing correction processing for correcting the brightness of the subject in the image using the virtual light source.
An acquisition unit configured to acquire a certain partial area information of the subject in the image,
Determining means for determining a subject region to be the correction process in the image,
Control for controlling the correction processing by said processing means in accordance with the reliability of the correction process based on a relationship between the determined said object regions by a particular partial area information and said determining means of the subject obtained by the acquisition unit An image processing apparatus comprising: Means.
前記決定手段は、前記顔検出手段および前記距離検出手段による検出結果に基づいて前記補正処理の対象となる前記被写体領域を決定することを特徴とする請求項1に記載の画像処理装置。 Further comprising a face detecting unit that detects a human face region in the image, and a distance detecting means for detecting the distance information to the subject,
It said determining means, the image processing apparatus according to claim 1, wherein the determining the object region to be the correction process based on the detection result by the face detecting means and the distance detecting means.
前記決定手段は、前記被写体領域の信頼度を算出し、
前記制御手段は、前記顔領域の信頼度と前記被写体領域の信頼度の少なくともいずれかから前記補正処理の信頼度を求めることを特徴とする請求項3から6のいずれか1項に記載の画像処理装置。 The face detecting means calculates the reliability of the detected face region and calculates the reliability.
The determining means calculates a reliability of the subject region,
The image according to any one of claims 3 to 6, wherein the control means obtains the reliability of the correction process from at least one of the reliability of the face region and the reliability of the subject region. Processing equipment.
前記被写体のレベルと前記補正処理の信頼度とに基づいて前記処理手段による補正処理を制御することを特徴とする請求項10に記載の画像処理装置。 It said control means calculates a level of the object in the image,
The image processing apparatus according to claim 10, wherein the correction process by the processing means is controlled based on the level of the subject and the reliability of the correction process.
前記被写体のレベルが閾値より高い第1の被写体の前記補正処理の信頼度が前記所定の閾値以上の場合には、前記第1の被写体に前記処理手段による補正処理を実行し、前記第1の被写体ではない第2の被写体には前記処理手段による補正処理を変更して実行するように制御することを特徴とする請求項11に記載の画像処理装置。 When there is a subject whose reliability of the correction process is less than a predetermined threshold value, the control means determines the level of the subject.
When the reliability of the correction processing of the first subject whose level of the subject is higher than the threshold value is equal to or higher than the predetermined threshold value, the correction processing by the processing means is executed on the first subject, and the first subject is described. The image processing apparatus according to claim 11, wherein the second subject, which is not the subject, is controlled so that the correction process by the processing means is changed and executed.
前記処理手段は、前記撮影手段により生成された前記撮影画像を前記補正処理の対象とすることを特徴とする請求項1から13のいずれか1項に記載の画像処理装置。 It photographs the subject, further comprising an imaging means for generating the captured image,
The processing means, the image processing apparatus according to the captured image generated by the imaging means in any one of claims 1 to 13, characterized in that the object of the correction process.
取得手段が、前記画像中の被写体の特定の部分領域情報を取得するステップと、
決定手段が、前記画像における前記補正処理の対象となる被写体領域を決定するステップと、
制御手段が、前記被写体の特定の部分領域情報と前記被写体領域との関係に基づく前記補正処理の信頼度に応じて前記処理手段による補正処理を制御するステップと、を有することを特徴とする画像処理方法。 A step in which the processing means sets a virtual light source, which is a virtual light source, and performs correction processing for correcting the brightness of the subject in the image using the virtual light source.
Acquiring means, acquiring a specific partial region information of the subject in the image,
Determining means, determining the subject to the subject area of the correction process in the image,
An image characterized in that the control means includes a step of controlling the correction process by the processing means according to the reliability of the correction process based on the relationship between the specific partial area information of the subject and the subject area. Processing method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017084760A JP6937603B2 (en) | 2017-04-21 | 2017-04-21 | Image processing equipment and its control methods, programs, and storage media |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017084760A JP6937603B2 (en) | 2017-04-21 | 2017-04-21 | Image processing equipment and its control methods, programs, and storage media |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018182699A JP2018182699A (en) | 2018-11-15 |
JP6937603B2 true JP6937603B2 (en) | 2021-09-22 |
Family
ID=64277289
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017084760A Active JP6937603B2 (en) | 2017-04-21 | 2017-04-21 | Image processing equipment and its control methods, programs, and storage media |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6937603B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7356255B2 (en) * | 2019-04-24 | 2023-10-04 | キヤノン株式会社 | Image processing device and its processing method, imaging device, program, storage medium |
JP7398939B2 (en) * | 2019-12-03 | 2023-12-15 | キヤノン株式会社 | Image processing device and its control method, imaging device, program, and storage medium |
JP7455578B2 (en) | 2019-12-27 | 2024-03-26 | キヤノン株式会社 | Image processing device and image processing method |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7894673B2 (en) * | 2004-09-30 | 2011-02-22 | Fujifilm Corporation | Image processing apparatus and method, and image processing computer readable medium for processing based on subject type |
JP2014016792A (en) * | 2012-07-09 | 2014-01-30 | Sony Corp | Image processor and method, and program |
JP6576083B2 (en) * | 2015-04-15 | 2019-09-18 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
-
2017
- 2017-04-21 JP JP2017084760A patent/JP6937603B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018182699A (en) | 2018-11-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3609177A1 (en) | Control method, control apparatus, imaging device, and electronic device | |
JP6833415B2 (en) | Image processing equipment, image processing methods, and programs | |
US9813634B2 (en) | Image processing apparatus and method | |
JP7292905B2 (en) | Image processing device, image processing method, and imaging device | |
JP6937603B2 (en) | Image processing equipment and its control methods, programs, and storage media | |
JP2021128791A (en) | Image processing apparatus, image processing method, and program | |
JP7277158B2 (en) | Setting device and method, program, storage medium | |
US10863103B2 (en) | Setting apparatus, setting method, and storage medium | |
JP2018182700A (en) | Image processing apparatus, control method of the same, program, and storage medium | |
JP6921606B2 (en) | Image processing equipment, image processing methods and programs | |
JP2017138927A (en) | Image processing device, imaging apparatus, control method and program thereof | |
US10021314B2 (en) | Image processing apparatus, image capturing apparatus, method of controlling the same, and storage medium for changing shading using a virtual light source | |
CN112911161B (en) | Image processing apparatus, image processing method, image capturing apparatus, and storage medium | |
JP5451364B2 (en) | Subject tracking device and control method thereof | |
JP6541416B2 (en) | IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, PROGRAM, AND STORAGE MEDIUM | |
JP2018093359A (en) | Image processing apparatus, image processing method, and program | |
JP2020046475A (en) | Image processing device and control method therefor | |
JP7011694B2 (en) | Image processing equipment and its control method, program | |
JP7356255B2 (en) | Image processing device and its processing method, imaging device, program, storage medium | |
CN112672066B (en) | Image processing apparatus, image capturing apparatus, control method, and storage medium | |
JP7462464B2 (en) | Image processing device and method, program, and storage medium | |
JP6946055B2 (en) | Image processing equipment and image processing methods, programs | |
JP2021087125A (en) | Image processing device, control method thereof, and program | |
JP2017103685A (en) | Image processing device and method, and imaging device | |
JP2017151562A (en) | Image processing device, imaging device, control method and program therefor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200403 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20201222 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20210103 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210113 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210215 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210416 |
|
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: 20210802 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210831 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6937603 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |