JP6701299B2 - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP6701299B2
JP6701299B2 JP2018197834A JP2018197834A JP6701299B2 JP 6701299 B2 JP6701299 B2 JP 6701299B2 JP 2018197834 A JP2018197834 A JP 2018197834A JP 2018197834 A JP2018197834 A JP 2018197834A JP 6701299 B2 JP6701299 B2 JP 6701299B2
Authority
JP
Japan
Prior art keywords
area
color
virtual light
image
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018197834A
Other languages
Japanese (ja)
Other versions
JP2019024256A (en
Inventor
光太郎 北島
光太郎 北島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2018197834A priority Critical patent/JP6701299B2/en
Publication of JP2019024256A publication Critical patent/JP2019024256A/en
Application granted granted Critical
Publication of JP6701299B2 publication Critical patent/JP6701299B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Exposure Control For Cameras (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Description

本発明は、画像処理装置および画像処理方法に関し、特には画像の明るさを補正する技術に関する。   The present invention relates to an image processing device and an image processing method, and particularly to a technique for correcting the brightness of an image.

従来、画像中の被写体に対して、仮想的な光源からの光を照射することで、明るさを補正する技術(リライティング)が知られている(特許文献1)。これにより、環境光によって生じた影などの暗部領域を明るくすることができ、例えば黒つぶれした部分に存在する被写体が判別できるように画像を補正することが可能となる。   BACKGROUND ART Conventionally, there is known a technique (rewriting) for correcting brightness by irradiating a subject in an image with light from a virtual light source (Patent Document 1). As a result, it is possible to lighten a dark area such as a shadow generated by ambient light, and for example, it is possible to correct an image so that a subject existing in a blackened area can be identified.

例えば顔領域に対してリライティングを行う場合、顔領域全体の平均輝度よりも低い輝度領域を影領域として抽出し、影領域の明度を上げることで、他の領域の明るさに影響を与えずに顔領域の影を抑制することができる。   For example, when performing relighting on a face area, a brightness area that is lower than the average brightness of the entire face area is extracted as a shadow area, and the brightness of the shadow area is increased so that the brightness of other areas is not affected. The shadow of the face area can be suppressed.

特開2010−135996号公報JP, 2010-135996, A

特許文献1の方法では、影領域の明度を、ゲインアップにより上昇させている。しかしながら、ゲインアップを用いた場合、信号成分だけでなくノイズ成分も増幅され、補正後の領域のS/Nが低下する。特許文献1では、このS/Nの低下を抑制するため、ノイズ除去フィルタを適用しているが、ノイズ除去処理は平滑化処理であるため、画像のディティールが低下する可能性がある。   In the method of Patent Document 1, the brightness of the shadow area is increased by increasing the gain. However, when the gain-up is used, not only the signal component but also the noise component is amplified, and the S/N of the corrected area is reduced. In Patent Document 1, a noise removal filter is applied in order to suppress this decrease in S/N. However, since the noise removal process is a smoothing process, the detail of the image may be reduced.

本発明はこのような従来技術の課題に鑑みてなされたものであり、ノイズ増幅および被写体のディティール低下を抑制しながら、画素の明るさを補正可能な画像処理装置および画像処理方法を提供することを目的とする。   The present invention has been made in view of the problems of the related art as described above, and provides an image processing apparatus and an image processing method capable of correcting the brightness of pixels while suppressing noise amplification and reduction in detail of an object. With the goal.

上述の目的は、対象画像の第1のエリアに仮想光を照射した効果を付与することで、第1のエリアの輝度を補正する補正手段と、補正手段が第1のエリアの輝度を補正する際に参照する第2のエリアを対象画像内で決定する決定手段と、を有し、補正手段は、第1のエリアの輝度を補正する際に、第2のエリアの色情報に基づく補正信号を用いて第1のエリアの色信号を補正することで、第1のエリアの色情報が第2のエリアの色情報に近付くよう補正することを特徴とする画像処理装置によって達成される。 The above-described object is to correct the brightness of the first area by applying the effect of irradiating the first area of the target image with virtual light, and the correction means corrects the brightness of the first area. Determining means for determining in the target image a second area to be referred to at the time, and the correcting means, when correcting the luminance of the first area, uses a correction signal based on the color information of the second area. Is used to correct the color signal of the first area so that the color information of the first area approaches the color information of the second area.

このような構成により本発明によれば、ノイズ増幅および被写体のディティール低下を抑制しながら、画素の明るさを補正可能な画像処理装置および画像処理方法を提供することができる。   According to the present invention having such a configuration, it is possible to provide an image processing apparatus and an image processing method capable of correcting the brightness of pixels while suppressing noise amplification and reduction in detail of an object.

本発明におけるデジタルカメラの構成を示すブロック図である。It is a block diagram which shows the structure of the digital camera in this invention. 本発明における画像処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the image processing part in this invention. 本発明の第1の実施形態における環境光反射特性抽出部の処理を示すフローチャートを示す図である。It is a figure which shows the flowchart which shows the process of the ambient light reflection characteristic extraction part in the 1st Embodiment of this invention. 本発明の実施形態における被写体例を示す図である。It is a figure which shows the to-be-photographed object example in embodiment of this invention. 本発明の第1の実施形態における、仮想光源付加の処理を示すフローチャートである。It is a flowchart which shows the process of virtual light source addition in the 1st Embodiment of this invention. 本発明の第1の実施形態におけるリライティング処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the relighting process part in the 1st Embodiment of this invention. 本発明における被写体と仮想光源の関係を示す図である。It is a figure which shows the relationship between the to-be-photographed object and virtual light source in this invention. 本発明の第2の実施形態における、仮想光源付加の処理を示すフローチャートである。It is a flowchart which shows the process of virtual light source addition in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるリライティング処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the relighting process part in the 2nd Embodiment of this invention.

以下、本発明の例示的な実施形態を、添付の図面に基づいて詳細に説明する。なお、以下に説明する実施形態では、本発明に係る画像処理装置をデジタルカメラに適用した例について説明する。なお、デジタルカメラは光電変換素子を用いた撮影機能を有する電子機器を意味し、携帯電話機、ゲーム機、パーソナルコンピュータ等、カメラを有するまたは使用可能な任意の電子機器が含まれる。また、本発明に撮影機能は必須でなく、本発明に係る画像処理装置は、画像処理が可能な任意の電子機器に対して適用可能である。   Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the embodiments described below, an example in which the image processing device according to the present invention is applied to a digital camera will be described. Note that a digital camera means an electronic device having a photographing function using a photoelectric conversion element, and includes any electronic device having a camera or usable, such as a mobile phone, a game machine, or a personal computer. Further, the photographing function is not essential to the present invention, and the image processing apparatus according to the present invention can be applied to any electronic device capable of image processing.

●(第1の実施形態)
図1は、本発明の第1の実施形態に係るデジタルカメラ100の構成例を示すブロック図である。
図1において、レンズ群101は、フォーカスレンズを含むズームレンズである。絞り機能を備えるシャッター102が、レンズ群101と撮像部103との間に設けられている。撮像部103は、レンズ群101によって撮像面に形成される光学像を画素単位の電気信号に変換するCCD/CMOSイメージセンサを代表とする撮像素子を有する。A/D変換器104は、撮像部103が出力するアナログ信号をデジタル信号(画像データ)に変換する。
● (First embodiment)
FIG. 1 is a block diagram showing a configuration example of a digital camera 100 according to the first embodiment of the present invention.
In FIG. 1, a lens group 101 is a zoom lens including a focus lens. A shutter 102 having a diaphragm function is provided between the lens group 101 and the image pickup unit 103. The image pickup unit 103 has an image pickup device represented by a CCD/CMOS image sensor that converts an optical image formed on the image pickup surface by the lens group 101 into an electric signal in units of pixels. The A/D converter 104 converts the analog signal output by the image capturing unit 103 into a digital signal (image data).

画像処理部105は、A/D変換器104から出力される画像データに対し、色補間(デモザイク)、ホワイトバランス調整、γ補正、輪郭強調、ノイズリダクション、色補正などの各種画像処理を行う。画像メモリ106は画像データを一時的に記憶する。メモリ制御部107は、画像メモリ106の読み書きを制御する。D/A変換器108は、画像データをアナログ信号に変換する。表示部109はLCDや有機ELディスプレイ等の表示装置を有し、各種GUIやライブビュー画像、記録媒体112から読み出して再生した画像などを表示する。コーデック部110は、画像メモリ106に記憶されている画像データを記録媒体に記録するために予め定められた方法で符号化したり、画像ファイルに含まれる符号化画像データを例えば表示のために復号したりする。   The image processing unit 105 performs various image processing such as color interpolation (demosaic), white balance adjustment, γ correction, contour enhancement, noise reduction, and color correction on the image data output from the A/D converter 104. The image memory 106 temporarily stores image data. The memory control unit 107 controls reading and writing of the image memory 106. The D/A converter 108 converts the image data into an analog signal. The display unit 109 has a display device such as an LCD or an organic EL display, and displays various GUIs, live view images, images read from the recording medium 112 and reproduced, and the like. The codec unit 110 encodes the image data stored in the image memory 106 by a predetermined method for recording on a recording medium, or decodes the encoded image data included in the image file for display, for example. Or

インタフェース(I/F)111は、例えば半導体メモリカードやカード型ハードディスクなどの着脱可能な記録媒体112を、デジタルカメラ100と機械的および電気的に接続する。システム制御部50は例えばCPUやMPUなどのプログラマブルなプロセッサであってよい。システム制御部50は、例えば不揮発性メモリ121や内蔵する不揮発性メモリに記録されたプログラムを実行して必要なブロックや回路を制御することにより、デジタルカメラ100の機能を実現する。リライティング処理部114は、撮影画像にリライティング処理を行う。   The interface (I/F) 111 mechanically and electrically connects a removable recording medium 112 such as a semiconductor memory card or a card-type hard disk to the digital camera 100. The system controller 50 may be a programmable processor such as a CPU or MPU. The system control unit 50 realizes the function of the digital camera 100 by executing a program recorded in, for example, the nonvolatile memory 121 or a built-in nonvolatile memory to control necessary blocks and circuits. The relighting processing unit 114 performs relighting processing on the captured image.

操作部120は、ユーザがデジタルカメラ100に各種の指示を入力するためのボタンやスイッチなどをまとめて記載したものである。   The operation unit 120 is a collective description of buttons and switches for the user to input various instructions to the digital camera 100.

不揮発性メモリ121は電気的に消去・記録可能な、例えばEEPROM等であってよい。不揮発性メモリ121は、各種の設定値、GUIデータをはじめ、システム制御部50がMPUやCPUである場合には、システム制御部50が実行するためのプログラムが記録される。
システムメモリ122は、システム制御部50の動作用の定数、変数、不揮発性メモリ121から読みだしたプログラム等を展開するために用いる。
The non-volatile memory 121 may be an electrically erasable/recordable EEPROM, for example. The nonvolatile memory 121 stores various setting values, GUI data, and a program to be executed by the system control unit 50 when the system control unit 50 is an MPU or a CPU.
The system memory 122 is used to expand constants and variables for the operation of the system control unit 50, programs read from the nonvolatile memory 121, and the like.

次に、デジタルカメラ100における撮影時の動作について説明する。
例えば撮像部103は、シャッター102が開いている際にレンズ群101が撮像面に形成する被写体像を撮像素子によって光電変換し、アナログ画像信号としてA/D変換器104へ出力する。A/D変換器104は撮像部103から出力されるアナログ画像信号をデジタル画像信号(画像データ)に変換し画像処理部105に出力する。
Next, the operation of the digital camera 100 during shooting will be described.
For example, the image capturing unit 103 photoelectrically converts a subject image formed on the image capturing surface by the lens group 101 when the shutter 102 is open, and outputs the subject image to the A/D converter 104 as an analog image signal. The A/D converter 104 converts the analog image signal output from the imaging unit 103 into a digital image signal (image data) and outputs the digital image signal to the image processing unit 105.

画像処理部105は、A/D変換器104からの画像データ、又は、メモリ制御部107からの画像データに対し、色補間(デモザイク)、γ補正、輪郭強調、ノイズリダクション、色補正などの各種画像処理を行う。   The image processing unit 105 performs various types of color interpolation (demosaic), γ correction, edge enhancement, noise reduction, color correction, etc. on the image data from the A/D converter 104 or the image data from the memory control unit 107. Perform image processing.

また、画像処理部105では、撮影で得られた画像データを用いて輝度やコントラストなどに関する所定の演算処理を行い、得られた演算結果に基づいてシステム制御部50が測距制御、露光制御を行う。このように、本実施形態のデジタルカメラ100では、TTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動露出)処理を行う。画像処理部105ではさらに、撮影で得られた画像データを用いたオートホワイトバランス(AWB)調整も行う。   Further, in the image processing unit 105, a predetermined calculation process regarding brightness, contrast, etc. is performed using the image data obtained by photographing, and the system control unit 50 performs distance measurement control and exposure control based on the obtained calculation result. To do. As described above, the digital camera 100 according to the present embodiment performs AF (auto focus) processing and AE (auto exposure) processing of the TTL (through-the-lens) method. The image processing unit 105 also performs automatic white balance (AWB) adjustment using image data obtained by shooting.

画像処理部105から出力された画像データは、メモリ制御部107を介して画像メモリ106に書き込まれる。画像メモリ106は、撮像部103から出力された画像データや、表示部109に表示するための画像データを格納する。   The image data output from the image processing unit 105 is written in the image memory 106 via the memory control unit 107. The image memory 106 stores the image data output from the imaging unit 103 and the image data to be displayed on the display unit 109.

また、D/A変換器108は、画像メモリ106に格納されている画像表示用のデータをアナログ信号に変換して表示部109に供給する。表示部109は、LCD等の表示装置に、D/A変換器108からのアナログ信号に応じた表示を行う。   Further, the D/A converter 108 converts the image display data stored in the image memory 106 into an analog signal and supplies the analog signal to the display unit 109. The display unit 109 displays on a display device such as an LCD according to the analog signal from the D/A converter 108.

コーデック部110は、画像メモリ106に記録された画像データをJPEGやMPEGなどの規格に基づき符号化する。システム制御部50は符号化した画像データに対して予め定められたヘッダなどを付与して画像ファイルを形成し、インタフェース111を介して記録媒体112に記録する。   The codec section 110 encodes the image data recorded in the image memory 106 based on a standard such as JPEG or MPEG. The system control unit 50 adds a predetermined header or the like to the encoded image data to form an image file, and records the image file on the recording medium 112 via the interface 111.

なお、現在のデジタルカメラでは、撮影スタンバイ状態においては動画撮影を行い、撮影された動画を表示部109に表示し続けることにより表示部109を電子ビューファインダ(EVF)として機能させるのが一般的である。この場合、シャッター102は開いた状態とし、撮像部103のいわゆる電子シャッターを用いて例えば30フレーム/秒の撮影を行う。   In a current digital camera, it is general that a moving image is shot in a shooting standby state, and the shot moving image is continuously displayed on the display unit 109 so that the display unit 109 functions as an electronic viewfinder (EVF). is there. In this case, the shutter 102 is opened, and the so-called electronic shutter of the image capturing unit 103 is used to capture images at, for example, 30 frames/sec.

そして、操作部120に含まれるシャッターボタンが半押しされると上述のAF,AE制御が行われ、全押しされると本撮影により記録用の静止画撮影が実行され、記録媒体112に記録される。また、動画撮影ボタンなどにより動画撮影が指示された場合は、記録媒体112への動画記録を開始する。   Then, when the shutter button included in the operation unit 120 is half-pressed, the above-described AF and AE control is performed, and when the shutter button included in the operation unit 120 is fully pressed, the still image shooting for recording is executed by the main shooting and is recorded in the recording medium 112. It Further, when the moving image shooting is instructed by the moving image shooting button or the like, the moving image recording on the recording medium 112 is started.

図2は画像処理部105の機能構成例を示すブロック図である。
図1のA/D変換器104から出力された画像データは、輝度・色信号生成部200に入力される。画像データは、撮像素子に設けられたカラーフィルタを構成する色成分の1つに対応した値を有する。一般的に用いられるベイヤー配列の原色カラーフィルタが用いられる場合、画像データは、R画素,G画素,B画素のデータから構成される。
FIG. 2 is a block diagram showing a functional configuration example of the image processing unit 105.
The image data output from the A/D converter 104 in FIG. 1 is input to the luminance/color signal generation unit 200. The image data has a value corresponding to one of the color components forming the color filter provided in the image sensor. When a generally used primary color filter of Bayer array is used, the image data is composed of R pixel data, G pixel data, and B pixel data.

輝度・色信号生成部200はこのような画像データに対してデモザイク処理を行い、各画素について色信号R,G,Bを生成し、さらに色信号から輝度信号Yを生成する。輝度・色信号生成部200は、生成した色信号R,G,Bをホワイトバランス(WB)増幅部203へ、輝度信号Yを輪郭強調処理部201へ出力する。   The luminance/color signal generation unit 200 performs demosaic processing on such image data, generates color signals R, G, B for each pixel, and further generates a luminance signal Y from the color signals. The luminance/color signal generation unit 200 outputs the generated color signals R, G, and B to the white balance (WB) amplification unit 203 and the luminance signal Y to the contour enhancement processing unit 201.

輪郭強調処理部201では、輝度信号Yに対して輪郭強調処理を行い、輝度ガンマ処理部202へ出力する。輝度ガンマ処理部202では輝度信号Yに対してガンマ補正を行い、補正後の輝度信号Yを画像メモリ106に出力する。   The contour enhancement processing unit 201 performs contour enhancement processing on the luminance signal Y and outputs it to the luminance gamma processing unit 202. The luminance gamma processing unit 202 performs gamma correction on the luminance signal Y and outputs the corrected luminance signal Y to the image memory 106.

WB増幅部203は、後述する処理によりシステム制御部50が算出するホワイトバランスゲイン値に基づき、色信号R,G,Bにゲインを適用し、ホワイトバランスを調整する。色変換処理部204は、色信号R,G,Bに対するマトリクス演算などにより、所望のカラーバランスへ変換する。色ガンマ処理部205では、色信号R,G,Bにガンマ補正を行う。色差信号生成部206では、色信号R,G,Bから色差信号R−Y、B−Yを生成し、画像メモリ106に出力する。   The WB amplification unit 203 applies a gain to the color signals R, G, B based on the white balance gain value calculated by the system control unit 50 by the process described below, and adjusts the white balance. The color conversion processing unit 204 converts the color signals R, G, B into a desired color balance by a matrix operation or the like. The color gamma processing unit 205 performs gamma correction on the color signals R, G, B. The color difference signal generation unit 206 generates color difference signals RY and BY from the color signals R, G, and B and outputs them to the image memory 106.

画像メモリ106に出力された輝度信号Yと色差信号R−Y,B−Yが、コーデック部110によって符号化され、最終的に記録媒体112に記録される。   The luminance signal Y and the color difference signals RY and BY output to the image memory 106 are encoded by the codec unit 110 and finally recorded on the recording medium 112.

また、色変換処理部204の出力する色信号R,G,Bは光源特性抽出部207へも入力する。光源特性抽出部207は、環境光源下での被写体の反射特性情報を、光源特性情報として抽出し、システムメモリ122に記録する。   The color signals R, G, B output from the color conversion processing unit 204 are also input to the light source characteristic extraction unit 207. The light source characteristic extraction unit 207 extracts the reflection characteristic information of the subject under the environment light source as the light source characteristic information and records it in the system memory 122.

光源特性抽出部207の動作について図3のフローチャートを用いて説明する。光源特性の抽出は画素ごとに実行する。
S301で光源特性抽出部207は、処理対象画素の色信号R,G,Bから輝度(L)信号、色相(H)信号、彩度(S)信号を生成する。
The operation of the light source characteristic extraction unit 207 will be described with reference to the flowchart of FIG. The extraction of the light source characteristic is executed for each pixel.
In S301, the light source characteristic extraction unit 207 generates a luminance (L) signal, a hue (H) signal, and a saturation (S) signal from the color signals R, G, and B of the processing target pixel.

S302で光源特性抽出部207は、処理対象画素が予め定めた特徴領域、例えば、顔検出部113で検出した顔領域(図4(a)の401)に含まれているか判定し、含まれていない場合は処理を終了し、含まれている場合は、処理をS303に進める。   In S302, the light source characteristic extraction unit 207 determines whether the processing target pixel is included in a predetermined characteristic region, for example, the face region detected by the face detection unit 113 (401 in FIG. 4A), and the pixel is included. If not included, the process ends, and if included, the process proceeds to S303.

S303で光源特性抽出部207は、処理対象画素の色が特定色に該当するか否かを判定する。ここでは、予め定めた特徴領域が顔領域であるため、予め定めた肌色の範囲を規定する色空間の範囲に含まれるかどうかを判定する。図4(b)に、CrCb(あるいはUV)色空間で規定された肌色領域410の例を示す。なお、S303における判定に際しては、HS座標系を用いてもよいし、図4(b)に示すように、色信号R,G,Bから変換可能な他の色空間座標系を用いてもよい。   In S303, the light source characteristic extraction unit 207 determines whether or not the color of the pixel to be processed corresponds to the specific color. Here, since the predetermined characteristic region is the face region, it is determined whether or not it is included in the range of the color space that defines the predetermined skin color range. FIG. 4B shows an example of the skin color region 410 defined in the CrCb (or UV) color space. Note that in the determination in S303, the HS coordinate system may be used, or another color space coordinate system that can be converted from the color signals R, G, B as shown in FIG. 4B. ..

S303で処理対象画素の色が色空間の所定の範囲に含まれると判定された場合、光源特性抽出部207は処理をS304に進め、含まれないと判定された場合は、対象画素についての処理を終了する。光源特性抽出部207は、図4(a)の画像例では肌色領域410に含まれる画素403、404が処理された場合にはS304に処理を進め、肌色領域410に含まれない画素402が処理された場合には処理を終了する。   When it is determined in S303 that the color of the processing target pixel is included in the predetermined range of the color space, the light source characteristic extraction unit 207 advances the processing to S304, and when it is determined that the color is not included, the processing of the target pixel is performed. To finish. In the image example of FIG. 4A, the light source characteristic extraction unit 207 advances the processing to S304 when the pixels 403 and 404 included in the skin color area 410 are processed, and processes the pixels 402 not included in the skin color area 410. If so, the process ends.

S304で光源特性抽出部207は、処理対象画素の輝度信号値が予め定めた高輝度値に該当するかどうかを、輝度信号値が所定値以上かどうかによって判定する。S304は、環境光が強く当っている被写体領域を抽出する処理である。光源特性抽出部207は、図4(a)の画像例では、高輝度画素である画素403が処理対象の場合は処理をS305に進め、影になっているなどの影響で輝度が低い画素404が処理対象の場合は、処理を終了する。   In S304, the light source characteristic extraction unit 207 determines whether or not the brightness signal value of the pixel to be processed corresponds to a predetermined high brightness value, based on whether the brightness signal value is equal to or more than a predetermined value. S304 is a process of extracting a subject region that is strongly exposed to ambient light. In the image example of FIG. 4A, when the pixel 403 that is a high-luminance pixel is the processing target, the light source characteristic extraction unit 207 advances the processing to step S<b>305, and the pixel 404 with low luminance due to the effect of being shaded or the like. If is a processing target, the processing ends.

S305で光源特性抽出部207は、S302〜S304の条件を全て満たした処理対象画素の色信号R,G,Bを色成分ごとに積分する。積分結果を(Rt、Gt、Bt)とする。
S306で光源特性抽出部207は、積分した画素の数をカウント(+1)する。カウント数をNとする。
In S305, the light source characteristic extraction unit 207 integrates, for each color component, the color signals R, G, and B of the processing target pixel that satisfies all the conditions of S302 to S304. The integration result is (Rt, Gt, Bt).
In S306, the light source characteristic extraction unit 207 counts (+1) the number of integrated pixels. Let N be the number of counts.

以上が、光源特性抽出部207の処理である。この処理により、被写体の特定部位に含まれ、かつ特定の色を有し、環境光が当たり高輝度になっている図4(a)403のような画素領域の情報を抽出することができる。   The above is the processing of the light source characteristic extraction unit 207. By this processing, it is possible to extract the information of the pixel area as shown in FIG. 4A 403 which is included in a specific part of the subject, has a specific color, and is exposed to ambient light and has high brightness.

なお、ここでは例えば撮影画像の全体もしくは予め定めた一部に含まれる画素を順次処理対象とする場合について説明した。しかし、例えば顔領域のような特定の被写体領域に含まれる画素を処理対象として光源特性抽出処理を行ってもよい。この場合、S302の判定は不要となる。   Note that, here, a case has been described in which, for example, pixels included in the entire captured image or a predetermined part thereof are sequentially processed. However, the light source characteristic extraction process may be performed with pixels included in a specific subject region such as a face region as a processing target. In this case, the determination in S302 is unnecessary.

次に、画像処理部105から出力された画像に対するリライティング処理について説明する。本実施形態において、リライティング処理は、システム制御部50が算出する制御パラメータを用いてリライティング処理部114が実行する。従って、まず、リライティング処理に用いる制御パラメータの算出および設定処理について図5(a)のフローチャートを用いて説明する。   Next, the relighting process for the image output from the image processing unit 105 will be described. In the present embodiment, the relighting processing is executed by the relighting processing unit 114 using the control parameter calculated by the system control unit 50. Therefore, first, the calculation and setting process of the control parameter used in the relighting process will be described with reference to the flowchart of FIG.

S501でシステム制御部50は、操作部120を通じてユーザからリライティング処理の指示を受け付ける。具体的にはシステム制御部50は、図示しないメニューからリライティング処理の実行を選択する、操作部120に対するユーザ操作を受け付ける。またシステム制御部50は、リライティング処理の実行指示とともに、例えばメニュー画面で指定されたリライティング処理のパラメータも受け付ける。   In step S501, the system control unit 50 receives a relighting processing instruction from the user through the operation unit 120. Specifically, the system control unit 50 accepts a user operation on the operation unit 120 that selects execution of relighting processing from a menu (not shown). Further, the system control unit 50 accepts, for example, a relighting process parameter specified on the menu screen together with the relighting process execution instruction.

リライティングのパラメータとしては本実施形態では説明の簡略化のため、仮想光源の位置および、光源の強度(α)をユーザが入力するものとする(予め設定された選択肢から選択する方法でもよい)。仮想光源が被写体面を垂直に照射しているものとすると、仮想光源の位置が決まれば、仮想光源の光が最も強く当る位置(中心照射位置)も決まる。   In the present embodiment, the position of the virtual light source and the intensity (α) of the light source are input by the user as parameters for relighting in the present embodiment (a method of selecting from preset options may be used). Assuming that the virtual light source illuminates the subject surface vertically, if the position of the virtual light source is determined, the position where the light of the virtual light source strikes most (center irradiation position) is also determined.

仮想光源の位置と、中心照射位置の例を図7(a)に模式的に示す。図7(a)は、仮想光源701が照射範囲703と、中心照射位置702とを有する状態を示している。仮想光源は照射範囲703に対してのみ影響を与えるものとする。   An example of the position of the virtual light source and the center irradiation position is schematically shown in FIG. FIG. 7A shows a state in which the virtual light source 701 has an irradiation range 703 and a central irradiation position 702. The virtual light source only affects the irradiation range 703.

図5(a)に戻り、S502でシステム制御部50は、特定色のハイライト反射特性(Rs,Gs,Bs)を算出する。特定色のハイライト反射特性とは、撮影時の環境光の反射光のうち、被写体の特定色の部分に反射したハイライト部分(高輝度部分)のRGB平均値である。本実施形態では、光源特性抽出部207により、被写体の領域のうち、肌色を有しかつ高輝度である画素の積分値(Rt,Gt,Bt)を求めている。これは、低輝度部においては物体色を反映する拡散反射成分が支配的であるのに対し、ハイライト(高輝度)部分は拡散反射成分と環境光源色を反映する鏡面反射成分の両方を含んでいることによる。   Returning to FIG. 5A, in S502, the system control unit 50 calculates the highlight reflection characteristics (Rs, Gs, Bs) of the specific color. The highlight reflection characteristic of a specific color is an RGB average value of a highlight portion (high-luminance portion) of a reflected light of ambient light at the time of shooting, which is reflected by a specific color portion of a subject. In the present embodiment, the light source characteristic extraction unit 207 obtains an integral value (Rt, Gt, Bt) of a pixel having a flesh color and high brightness in the subject area. This is because the diffuse reflection component that reflects the object color is dominant in the low luminance part, while the highlight (high luminance) part includes both the diffuse reflection component and the specular reflection component that reflects the environment light source color. It depends on going out.

システム制御部50は、光源特性抽出部207が算出した積分値(Rt,Gt,Bt)をS306で算出したカウント数Nで除算し、肌色領域に環境光が強く当っているハイライト部分の色(Rs,Gs,Bs)を肌色のハイライト反射特性として算出する。   The system control unit 50 divides the integrated value (Rt, Gt, Bt) calculated by the light source characteristic extraction unit 207 by the count number N calculated in S306, and the color of the highlight part where the ambient light strongly hits the skin color area. (Rs, Gs, Bs) is calculated as the flesh color highlight reflection characteristic.

S503でシステム制御部50は、照射する仮想光源の色を、撮影時の環境光の色を換算して表すためのゲイン(係数)として生成し、リライティング処理部114へ設定する。仮想光源の色ゲイン(Rv−Gain、Bv−Gain)は、ユーザによって任意に設定され、仮想光源と環境光源とが同じ色の場合、
Rv−Gain=1
Bv−Gain=1
となる。
In step S<b>503, the system control unit 50 generates the color of the virtual light source to be emitted as a gain (coefficient) for converting and expressing the color of the ambient light at the time of shooting, and sets it in the relighting processing unit 114. The color gain (Rv-Gain, Bv-Gain) of the virtual light source is arbitrarily set by the user, and when the virtual light source and the environmental light source have the same color,
Rv-Gain=1
Bv-Gain=1
Becomes

S504でシステム制御部50は、リライティング処理部114にリライティング処理の実行を指示する。   In step S504, the system control unit 50 instructs the relighting processing unit 114 to execute the relighting process.

次にリライティング処理部114の構成および動作の例について説明する。
図6はリライティング処理部114の構成を示すブロック図である。
図6において、RGB信号変換部601は画像メモリ106から入力される輝度および色差信号(Y,B−Y,R−Y)を、色信号(R,G,B)に変換する。デガンマ処理部602はデガンマ処理(輝度ガンマ処理部202および色ガンマ処理部205の逆処理)を行う。
Next, an example of the configuration and operation of the relighting processing unit 114 will be described.
FIG. 6 is a block diagram showing the configuration of the relighting processing unit 114.
In FIG. 6, an RGB signal conversion unit 601 converts the luminance and color difference signals (Y, BY, RY) input from the image memory 106 into color signals (R, G, B). The degamma processing unit 602 performs degamma processing (reverse processing of the luminance gamma processing unit 202 and the color gamma processing unit 205).

仮想光源処理部603は仮想光源によるライティング効果を画像に付加する。平滑化処理部604はデガンマ処理部602の出力する色信号(R,G,B)を平滑化して仮想光源処理部603に出力する。色相彩度変換部605はデガンマ処理部602の出力するRGB信号を色相および彩度信号(H,S)に変換する。
ガンマ処理部606は仮想光源処理部603の出力する色信号(R,G,B)にガンマ補正を行う。輝度色差信号生成部607は、ガンマ補正後の色信号(R,G,B)を輝度および色差信号(Y,B−Y,R−Y)に変換し、画像メモリ106に出力する。
The virtual light source processing unit 603 adds the lighting effect of the virtual light source to the image. The smoothing processing unit 604 smoothes the color signals (R, G, B) output from the degamma processing unit 602 and outputs the smoothed color signals to the virtual light source processing unit 603. The hue/saturation conversion unit 605 converts the RGB signal output from the degamma processing unit 602 into a hue and saturation signal (H, S).
The gamma processing unit 606 performs gamma correction on the color signals (R, G, B) output by the virtual light source processing unit 603. The luminance color difference signal generation unit 607 converts the gamma-corrected color signals (R, G, B) into luminance and color difference signals (Y, BY, RY) and outputs them to the image memory 106.

次にリライティング処理部114の動作について説明する。
リライティング処理部114は、画像メモリ106に記録された輝度・色差信号(Y,B−Y,R−Y)を読み出し、入力とする。RGB信号変換部601は、入力された輝度・色差信号(Y,B−Y,R−Y)をRGB信号に変換し、デガンマ処理部602へ出力する。
Next, the operation of the relighting processing unit 114 will be described.
The relighting processing unit 114 reads out and inputs the luminance/color difference signals (Y, BY, RY) recorded in the image memory 106. The RGB signal conversion unit 601 converts the input luminance/color difference signals (Y, BY, RY) into RGB signals and outputs them to the degamma processing unit 602.

デガンマ処理部602は、画像処理部105のガンマ処理部で掛けられたガンマ特性と逆の特性の演算を行いリニアデータに変換する。リニア変換後のRGB信号は、仮想光源処理部603、平滑化処理部604、色相彩度変換部605へ出力する。なお、デガンマ処理部602をRGB信号変換部601の前段に配置してデガンマ処理を行ってもよい。例えば、Y信号に対しては輝度ガンマ処理部202と逆の処理を適用し、色差信号R−Y,B−YについてはRGB信号に戻してから色ガンマ処理部205と逆の処理を適用し、色差信号R−Y,B−Yに再変換してからRGB信号変換部601に入力する。   The degamma processing unit 602 performs a calculation of a characteristic opposite to the gamma characteristic multiplied by the gamma processing unit of the image processing unit 105 and converts it into linear data. The RGB signal after the linear conversion is output to the virtual light source processing unit 603, the smoothing processing unit 604, and the hue/saturation conversion unit 605. In addition, the degamma processing unit 602 may be arranged in front of the RGB signal conversion unit 601 to perform the degamma processing. For example, the reverse processing of the luminance gamma processing unit 202 is applied to the Y signal, and the reverse processing of the color gamma processing unit 205 is applied to the color difference signals RY and BY after returning to the RGB signals. , And the color difference signals R-Y and B-Y are converted again, and then input to the RGB signal conversion unit 601.

平滑化処理部604では、処理対象の画素のデガンマ処理後のRGB形式の色信号(Rt,Gt,Bt)の色成分ごとに、周辺画素の色信号値との平均値で置き換える。例えば、処理対象画素を中心とした3×3画素の領域に含まれる9画素の平均値を色成分ごとに算出し、平滑後の対象画素の色成分値とする。なお、この方法は平滑化の一例であり、他の任意の方法を用いることができる。平滑化処理部604は平滑化した色信号(Ra,Ga,Ba)を仮想光源処理部603へ出力する。平滑化処理で得られる色信号(Ra,Ga,Ba)は、処理対象画素の近傍における環境光の反射特性を表す。   The smoothing processing unit 604 replaces each color component of the RGB format color signal (Rt, Gt, Bt) after the degamma processing of the pixel to be processed with the average value of the color signal values of the peripheral pixels. For example, an average value of 9 pixels included in an area of 3×3 pixels centered on the processing target pixel is calculated for each color component, and is set as a color component value of the target pixel after smoothing. Note that this method is an example of smoothing, and any other method can be used. The smoothing processing unit 604 outputs the smoothed color signals (Ra, Ga, Ba) to the virtual light source processing unit 603. The color signals (Ra, Ga, Ba) obtained by the smoothing process represent the reflection characteristics of ambient light in the vicinity of the pixel to be processed.

色相彩度変換部605は、入力されたデガンマ処理後のRGB形式の色信号(Rt,Gt,Bt)を色相(H)および彩度(S)に変換し、変換後の色相(H)および彩度(S)信号を仮想光源処理部603に出力する。   The hue/saturation conversion unit 605 converts the input RGB color signal (Rt, Gt, Bt) after degamma processing into a hue (H) and a saturation (S), and converts the converted hue (H) and The saturation (S) signal is output to the virtual light source processing unit 603.

図5(b)のフローチャートを用いて、仮想光源処理部603が実施する仮想光源処理の詳細について説明する。仮想光源処理は、仮想光源によるリライティング効果を入力画像に付加する処理である。
仮想光源処理部603は、入力された画像に含まれる画素単位で図5(b)に示す仮想光源処理を実行する。
The details of the virtual light source processing performed by the virtual light source processing unit 603 will be described with reference to the flowchart of FIG. The virtual light source process is a process of adding the relighting effect by the virtual light source to the input image.
The virtual light source processing unit 603 executes the virtual light source processing shown in FIG. 5B for each pixel included in the input image.

S510で仮想光源処理部603は、処理対象の画素が仮想光源の照射範囲内に位置するかどうかを判定する。図7(a)に示した例では、仮想光源処理部603は、処理対象画素が、中心照射位置702の仮想光源701の照射範囲703の中に位置するかどうかを判定する。この判定は例えば、中心照射位置702と仮想光源701の位置をパラメータとした、予め定めた関数を用いて画像上の照射範囲703を求め、処理対象画素の画像座標と比較することにより実行することができる。なお、仮想光源701の位置は固定であっても可変であってもよいし、仮想光源の種類などに応じて異なる関数を用いてもよい。また、光束の拡がり方などをユーザが可変できるようにしてもよい。   In step S510, the virtual light source processing unit 603 determines whether the pixel to be processed is located within the irradiation range of the virtual light source. In the example illustrated in FIG. 7A, the virtual light source processing unit 603 determines whether the processing target pixel is located within the irradiation range 703 of the virtual light source 701 at the central irradiation position 702. This determination is performed, for example, by obtaining the irradiation range 703 on the image using a predetermined function with the position of the central irradiation position 702 and the position of the virtual light source 701 as parameters, and comparing it with the image coordinates of the processing target pixel. You can The position of the virtual light source 701 may be fixed or variable, or a different function may be used depending on the type of virtual light source. Further, the user may be allowed to change the spreading method of the luminous flux.

仮想光源処理部603は、処理対象画素が仮想光源の照射範囲内に位置すると判定された場合に処理をS511へ進め、処理対象画素が仮想光源の照射範囲内に位置しないと判定された場合はリライティング効果を付加せずに処理を終了する。   The virtual light source processing unit 603 advances the process to S511 when it is determined that the processing target pixel is located within the irradiation range of the virtual light source, and when it is determined that the processing target pixel is not located within the irradiation range of the virtual light source. The process ends without adding the relighting effect.

S511で仮想光源処理部603は、処理対象の画素の色が、特定色に該当するかどうかを判定する。ここでは、特定色が人間の肌色であり、仮想光源処理部603は、予め記憶してある、肌色に対応する色空間上の領域に、処理対象画素の色が含まれるかどうかを判定するものとする。判定は特定色を規定する色空間座標系に画素値を変換して行うことができる。   In step S511, the virtual light source processing unit 603 determines whether the color of the pixel to be processed corresponds to the specific color. Here, the specific color is the human skin color, and the virtual light source processing unit 603 determines whether or not the region of the color space corresponding to the skin color, which is stored in advance, includes the color of the pixel to be processed. And The determination can be performed by converting the pixel value into a color space coordinate system that defines a specific color.

上述したように、本実施形態では図4(b)に示したCrCb(あるいはUV)色空間で肌色領域410を規定しているが、他の色空間座標系で規定してもよい。ここでは色相彩度変換部605で生成した同位相の色相信号(H)および彩度信号(S)を用いて判定を行うため、仮想光源処理部603は、処理対象画素の色相および彩度信号が肌色領域に含まれるか否かを判定するものとする。処理対象画素の色が肌色領域に含まれる(特定色に該当する)と判定される場合、仮想光源処理部603は処理をS512に進め、肌色領域に含まれないと判定される場合は処理をS513に進める。   As described above, in the present embodiment, the skin color area 410 is defined in the CrCb (or UV) color space shown in FIG. 4B, but it may be defined in another color space coordinate system. Here, since the determination is performed using the hue signal (H) and the saturation signal (S) of the same phase generated by the hue/saturation conversion unit 605, the virtual light source processing unit 603 uses the hue and saturation signal of the processing target pixel. Whether or not is included in the skin color area is determined. If it is determined that the color of the pixel to be processed is included in the flesh color area (corresponding to the specific color), the virtual light source processing unit 603 advances the process to S512, and if it is determined that the color is not included in the flesh color area, the process is performed. Proceed to S513.

S512、S513で仮想光源処理部603は、処理対象画素が仮想光源の光(仮想光)を反射した色(Rv,Gv,Bv)を決定する。この反射色はデジタルカメラ100のセンサ分光特性および画像処理の特性も反映している。   In S512 and S513, the virtual light source processing unit 603 determines the color (Rv, Gv, Bv) in which the pixel to be processed reflects the light of the virtual light source (virtual light). This reflected color also reflects the sensor spectral characteristics of the digital camera 100 and the characteristics of image processing.

S512で仮想光源処理部603は、仮想光の特定色(肌色)被写体に反射した仮想光反射色(Rv,Gv,Bv)を算出する。仮想光反射色(Rv,Gv,Bv)は、S512で算出した肌色ハイライト反射特性(Rs,Gs,Bs)に、S502で設定した仮想光源色ゲイン(Rv−Gain,Bv−Gain)を以下の様に乗じることで算出できる。
Rv = Rv−Gain * Rs
Gv = Gs
Bv = Bv−Gain * Bs
In step S512, the virtual light source processing unit 603 calculates the virtual light reflection color (Rv, Gv, Bv) reflected by the specific color (skin color) subject of virtual light. For the virtual light reflection color (Rv, Gv, Bv), the virtual light source color gain (Rv-Gain, Bv-Gain) set in S502 is calculated as follows for the skin color highlight reflection characteristic (Rs, Gs, Bs) calculated in S512. It can be calculated by multiplying like.
Rv=Rv-Gain*Rs
Gv = Gs
Bv=Bv-Gain*Bs

一方、S513で仮想光源処理部603は、仮想光が特定色でない被写体に反射した仮想光反射色(Rv,Gv,Bv)を算出する。仮想光反射色(Rv,Gv,Bv)は、平滑化処理部604(図6)で算出した色信号(Ra,Ga,Ba)に、S502で設定した仮想光源色ゲイン(Rv−Gain,Bv−Gain)を以下の様に乗じることで算出できる。
Rv = Rv−Gain * Ra
Gv = Ga
Bv = Bv−Gain * Ba
On the other hand, in step S513, the virtual light source processing unit 603 calculates the virtual light reflection color (Rv, Gv, Bv) in which the virtual light is reflected by the subject that is not the specific color. The virtual light reflection color (Rv, Gv, Bv) is obtained by adding the virtual light source color gain (Rv-Gain, Bv) set in S502 to the color signal (Ra, Ga, Ba) calculated by the smoothing processing unit 604 (FIG. 6). -Gain) can be calculated by multiplying as follows.
Rv=Rv-Gain*Ra
Gv = Ga
Bv=Bv-Gain*Ba

S514で仮想光源処理部603は、処理対象画素と仮想光源との距離Dを算出する。本実施形態では、図7(b)に示すように、仮想光源701の中心照射位置702と、処理対象画素704との距離を距離Dとして算出し、例えば画素ピッチを単位とした値であってよい。   In step S514, the virtual light source processing unit 603 calculates the distance D between the pixel to be processed and the virtual light source. In the present embodiment, as shown in FIG. 7B, the distance between the central irradiation position 702 of the virtual light source 701 and the processing target pixel 704 is calculated as the distance D, which is a value in units of pixel pitch, for example. Good.

S515で仮想光源処理部603は、処理対象画素に、リライティング効果を付加する。具体的には、S512またはS513で算出した仮想光反射色(Rv,Gv,Bv)を、仮想光源照射ゲイン(α)とS514で算出した距離Dとに基づく重みで、処理対象画素(Rt,Gt,Bt)に加算する。   In step S515, the virtual light source processing unit 603 adds the relighting effect to the processing target pixel. Specifically, the virtual light reflection color (Rv, Gv, Bv) calculated in S512 or S513 is weighted based on the virtual light source irradiation gain (α) and the distance D calculated in S514, and the processing target pixel (Rt, Gt, Bt).

本実施形態において、仮想光源によって照射された処理対象画素(Rout,Gout,Bout)の各成分は、以下の式によって算出するものとする。
Rout = Rt + α ×(1/D^2)× Rv
Gout = Gt + α ×(1/D^2)× Gv
Bout = Bt + α ×(1/D^2)× Bv
ただし、仮想光源照射ゲイン0<α<1である。
以上の処理を各画素について実施することで、リライティング効果を付加することができる。
In the present embodiment, each component of the processing target pixel (Rout, Gout, Bout) illuminated by the virtual light source is calculated by the following formula.
Rout=Rt+α×(1/D^2)×Rv
Gout = Gt + α x (1/D^2) x Gv
Bout=Bt+α×(1/D^2)×Bv
However, the virtual light source irradiation gain is 0<α<1.
The relighting effect can be added by performing the above processing for each pixel.

図6に戻り、仮想光源処理部603から出力された処理対象画素(Rout,Gout,Bout)はガンマ処理部606に入力される。ガンマ処理部606では処理対象画素(Rout,Gout,Bout)にガンマ補正を適用し、補正後の値を有する画素(R’out,G’out,B’out)を出力する。輝度色差信号生成部607では、処理対象画素(R’out,G’out,B’out)から輝度信号(Y)および色差信号(R−Y,B−Y)を生成して出力する。   Returning to FIG. 6, the processing target pixels (Rout, Gout, Bout) output from the virtual light source processing unit 603 are input to the gamma processing unit 606. The gamma processing unit 606 applies gamma correction to the processing target pixel (Rout, Gout, Bout) and outputs the pixel (R'out, G'out, B'out) having the corrected value. The luminance color difference signal generation unit 607 generates and outputs a luminance signal (Y) and a color difference signal (RY, BY) from the processing target pixel (R'out, G'out, B'out).

システム制御部50は、リライティング処理部114が出力した輝度および色差信号を、メモリ制御部107の制御によって画像メモリ106に蓄積したのち、コーデック部110を用いて圧縮符号化する。そして、システム制御部50は、圧縮符号化した画像データを所定のファイル形式に変換した後、I/F111を介して記録媒体112に記録する。   The system control unit 50 accumulates the luminance and color difference signals output by the relighting processing unit 114 in the image memory 106 under the control of the memory control unit 107, and then compresses and encodes them using the codec unit 110. Then, the system control unit 50 converts the compression-encoded image data into a predetermined file format, and then records the image data on the recording medium 112 via the I/F 111.

以上で説明したように、本実施形態では、処理対象画素と画像空間または色空間において近傍に存在する複数の画素を平滑化処理することにより、実際の環境光の反射特性(反射色)を推定する。そして、推定された環境光の反射特性(反射色)に基づき、仮想光の反射色(Rv,Gv,Bv)を推定する。そして、推定した仮想光の反射色(Rv,Gv,Bv)を明るさの補正値として処理対象画素(Rt,Gt,Bt)に加算することで、リライティング効果を付加する。そのため、処理対象画素(Rt,Gt,Bt)の値にゲインを適用して増幅する場合と比較して、ノイズ成分の増加を抑制しつつリライティング効果を付加することが可能となる。   As described above, in the present embodiment, the actual reflection characteristic (reflection color) of ambient light is estimated by performing the smoothing process on the processing target pixel and a plurality of pixels existing in the vicinity in the image space or the color space. To do. Then, the reflection color (Rv, Gv, Bv) of the virtual light is estimated based on the estimated reflection characteristic (reflection color) of the ambient light. Then, the estimated reflection color (Rv, Gv, Bv) of the virtual light is added to the processing target pixel (Rt, Gt, Bt) as a correction value of brightness to add the relighting effect. Therefore, it is possible to add the relighting effect while suppressing the increase of the noise component, as compared with the case where the gain is applied to the value of the processing target pixel (Rt, Gt, Bt) to amplify the value.

また、リライティング効果によって色相が変化することが特に好ましくない色の領域については、その色のハイライト部分の反射特性(Rs,Gs,Bs)に基づいて加算を行う。そのため、仮想光源を環境光源と同じ色とした場合には環境光が追加で照射された効果が得られ、リライティングした領域の色相が変化することを抑制できる。   In addition, for a color region in which it is not particularly preferable that the hue changes due to the relighting effect, addition is performed based on the reflection characteristics (Rs, Gs, Bs) of the highlight portion of the color. Therefore, when the virtual light source has the same color as the ambient light source, the effect of additionally illuminating the ambient light can be obtained, and the hue of the relighted area can be prevented from changing.

通常、影のような暗部は、撮像素子の暗部特性からハイライト領域と異なる色相になってしまうことがある。このような暗部を明るくするためにリライティング効果を付加する場合、暗部の画素値に正のゲインを適用して単純に増幅すると、リライティング効果で明るくなった部分と、元々明るい部分とで、本来は同じ色であるべきところで色相のずれが生じてしまう。しかし、本実施形態では、ある色の画素を明るくする場合、同じ色のハイライト部分から得た反射特性を用いて画素値を加算することで、色相を保ちながら明るくすることができる。   Usually, a dark part such as a shadow may have a hue different from that of the highlight region due to the dark part characteristic of the image sensor. When adding a relighting effect to brighten such a dark part, applying a positive gain to the pixel value of the dark part and simply amplifying it makes the originally bright part and the bright part due to the relighting effect originally A hue shift occurs when the colors should be the same. However, in the present embodiment, when a pixel of a certain color is made brighter, it is possible to make it brighter while maintaining the hue by adding pixel values by using the reflection characteristics obtained from the highlight portion of the same color.

なお、本実施形態では、肌色のハイライト部分を抽出し、抽出した肌色から仮想光源の反射色を予測したが、抽出する領域を肌色部分に限定するものではない。環境光の当たり方が異なる領域から、仮想光の反射を予測する構成であればどのような領域を利用してもよい。例えば、肌色以外の色を条件に追加してもよい。肌色に加えて、髪の毛の黒領域などを加える構成であってもよい。   In this embodiment, the highlight part of the skin color is extracted and the reflection color of the virtual light source is predicted from the extracted skin color, but the extracted area is not limited to the skin color part. Any area may be used as long as it is configured to predict the reflection of virtual light from the area where the ambient light hits differently. For example, a color other than the skin color may be added as a condition. In addition to the skin color, a black area of hair may be added.

また、本実施形態では、発明の理解を容易にするため、肌色が特徴色である場合を例示したが、被写体の任意の特徴色を用いることができる。特徴色は被写体に占める割合が多い色であってもよいし、被写体の種類に応じた色であってもよい。また、ユーザが特徴色を指定する構成であってもよい。任意の特徴色について環境光の反射特性を求めることができる。さらに、特徴色は1つに限らず、複数の特徴色の各々について環境光の反射特性を求め、上述した処理を行ってもよい。   Further, in the present embodiment, in order to facilitate understanding of the invention, the case where the flesh color is the characteristic color is illustrated, but an arbitrary characteristic color of the subject can be used. The characteristic color may be a color that occupies a large proportion in the subject, or may be a color according to the type of subject. Alternatively, the user may specify the characteristic color. The reflection characteristic of ambient light can be obtained for any characteristic color. Furthermore, the number of characteristic colors is not limited to one, and the reflection characteristics of ambient light may be obtained for each of a plurality of characteristic colors and the above-described processing may be performed.

また、同色のハイライト部分から推定された仮想光の反射色は、リライティング処理を適用する処理対象画素と関連のある領域で推定されたものである方が精度がよい。そのため、例えば処理対象画素が肌色であれば、近傍もしくは処理対象画素が属する肌色領域内のハイライト部分や、同じ被写体の領域に含まれる同色のハイライト部分から推定された値を用いるように構成することができる。そのため、画像中に特定色の領域が複数独立して存在する場合には、領域ごとのハイライト部分から仮想光の反射色を予測して保持し、処理対象画素の座標に応じて使用する仮想光の反射色を選択するように構成してもよい。この場合、最も近くで算出された値を用いるようにしたり、同一被写体領域内で算出された値を用いるようにしたりすることができる。   Further, the reflected color of virtual light estimated from the highlight portion of the same color is more accurate when estimated in a region related to the processing target pixel to which the relighting process is applied. Therefore, for example, if the pixel to be processed is a skin color, a value estimated from a highlight part in the skin color region to which the pixel to be processed belongs or a highlight part of the same color included in the region of the same subject is used. can do. Therefore, when a plurality of regions of a specific color exist independently in the image, the reflected color of the virtual light is predicted and held from the highlight portion of each region, and the virtual color is used according to the coordinates of the pixel to be processed. It may be configured to select the reflection color of light. In this case, the value calculated closest can be used, or the value calculated in the same subject region can be used.

なお、ここでは画素を明るくするリライティング効果を想定しているため、仮想光源照射ゲインαを正の値としたが、暗くするリライティング効果を付加してもよい。この場合、光源特性抽出部207において、強く反射している部分ではなく、暗部から反射特性を抽出するとともに、仮想光源照射ゲインαを負の値とする。   Since the relighting effect of brightening the pixel is assumed here, the virtual light source irradiation gain α is set to a positive value, but a relighting effect of darkening the pixel may be added. In this case, the light source characteristic extraction unit 207 extracts the reflection characteristic from the dark portion instead of the strongly reflecting portion, and sets the virtual light source irradiation gain α to a negative value.

また、本実施形態では、説明および理解を容易にするため、中心照射位置を中心とした円形領域に含まれる全ての画素が仮想光源の影響を受けるものとして説明したが、特定の条件を満たす画素だけが仮想光源の影響を受けるようにしてもよい。例えば、顔検出部113で人物の顔領域を抽出し、照射範囲703のうち顔領域だけが仮想光源の影響を受けるようにしてもよい。もしくは、デジタルカメラ100で測定したデフォーカス量など被写体の距離情報を用い、照射範囲703のうち予め定めた距離以内に存在する被写体に対応する画素だけが仮想光源の影響を受けるようにしてもよい。   Further, in the present embodiment, in order to facilitate the description and understanding, it has been described that all pixels included in the circular region centered on the central irradiation position are affected by the virtual light source, but pixels satisfying a specific condition Only the virtual light source may be affected. For example, the face detection unit 113 may extract the face area of the person, and only the face area in the irradiation range 703 may be affected by the virtual light source. Alternatively, using the distance information of the subject such as the defocus amount measured by the digital camera 100, only the pixels corresponding to the subject existing within the predetermined distance within the irradiation range 703 may be influenced by the virtual light source. ..

また、加算値の重み付けに用いられる距離Dは本実施形態で説明した照射中心位置から加算対象画素への画像上の距離に限定されず、他の任意の距離であってよい。例えば、デジタルカメラおよび被写体の3次元位置を取得し、両者の3次元距離を用いて算出してもよい。   The distance D used for weighting the added value is not limited to the distance on the image from the irradiation center position to the addition target pixel described in the present embodiment, and may be any other distance. For example, the three-dimensional positions of the digital camera and the subject may be acquired and the three-dimensional distance between the two may be used for calculation.

また、距離Dの2乗に反比例する重みで仮想光源による効果を付加する例を説明したが、距離Dと重みとの関係はこれに限定されない。例えば、距離Dに反比例したり、ガウス分布的に重みが変化するようにしてもよい。   Further, although the example in which the effect of the virtual light source is added by the weight inversely proportional to the square of the distance D has been described, the relationship between the distance D and the weight is not limited to this. For example, the weight may be inversely proportional to the distance D, or the weight may change in a Gaussian distribution.

●(第2の実施形態)
次に、本発明の第2の実施形態について説明する。第1の実施形態では、仮想光の反射色を1枚の撮影画像から推定していたが、第2の実施形態では、複数の撮影画像から推定することを特徴とする。従って、以下では、第1の実施形態と異なる、リライティング処理部114の内部構成ならびにシステム制御部50の動作についてのみ説明する。
● (Second embodiment)
Next, a second embodiment of the present invention will be described. In the first embodiment, the reflection color of virtual light is estimated from one captured image, but in the second embodiment, it is estimated from a plurality of captured images. Therefore, only the internal configuration of the relighting processing unit 114 and the operation of the system control unit 50, which are different from those of the first embodiment, will be described below.

図8(a)は、本実施形態におけるシステム制御部50の、撮影時の動作を示したフローチャートである。図8(a)において、S801でシステム制御部50は撮影モードを判定する。ユーザによる操作部120による操作によって、リライティングを前提とする撮影モードか、通常の撮影モードかを切り替えることが可能であるものとする。システム制御部50は、リライティングを前提とする撮影モードが設定されていればS802へ、他の撮影モード(ここでは通常モードとする)の場合はS806へ、それぞれ処理を進める。S806でシステム制御部50は通常モードに従った1枚の撮影を行って処理を終了する。   FIG. 8A is a flowchart showing the operation of the system control unit 50 in the present embodiment at the time of shooting. In FIG. 8A, the system control unit 50 determines the shooting mode in S801. It is assumed that the user can operate the operation unit 120 to switch between a shooting mode that requires relighting and a normal shooting mode. The system control unit 50 advances the processing to S802 if a shooting mode premised on relighting is set, and to S806 if another shooting mode (normal mode here) is set. In step S806, the system control unit 50 shoots one image according to the normal mode and ends the process.

S802でシステム制御部50は、まずオーバー露出の画像を撮影する。例えば、図4(a)の画素404のように被写体の影の部分が適正露出になる程度の高露出の条件で撮影する。従って、より明るい領域403は飽和(白とび)する可能性がある。   In step S802, the system control unit 50 first captures an overexposed image. For example, the image is captured under a high exposure condition such that the shadow portion of the subject has a proper exposure like the pixel 404 in FIG. Therefore, the brighter region 403 may be saturated (whiteout).

S803でシステム制御部50は、撮影したオーバー露出画像を、画像メモリ106に記録する。
S804でシステム制御部50は、適正露出で撮影する。ここでの適正露出とは、主となる被写体(例えば、図4(a)なら被写体の顔の明るい領域403)が適正な明るさになる露出である。なお、S802〜S804の処理は、適正露出の撮影から行ってもよい。また、HDR合成画像を生成する際に通常考慮されるように、被写体が移動したり被写体の明るさが大きく変化しないよう、2回の撮影は連写のように短期間で行う。
In step S<b>803, the system control unit 50 records the captured overexposure image in the image memory 106.
In step S804, the system control unit 50 shoots with proper exposure. The proper exposure here is an exposure in which the main subject (for example, the bright area 403 of the subject's face in FIG. 4A) has appropriate brightness. Note that the processing of S802 to S804 may be performed after photographing with proper exposure. Also, as is usually taken into consideration when generating an HDR composite image, two shots are performed in a short period such as continuous shooting so that the subject does not move or the brightness of the subject does not change significantly.

S805でシステム制御部50は、露出の異なる2枚の撮影画像を順次画像処理部105に供給し、いわゆるHDR合成画像を生成させる。この合成画像は環境光の反射特性を表す情報に相当する。画像処理部105の機能構成および基本的な処理動作は第1の実施形態と同様であるため、重複する説明は省略し、本実施形態に特徴的な光源特性抽出部207の処理動作について重点的に説明する。   In step S805, the system control unit 50 sequentially supplies the two captured images with different exposures to the image processing unit 105 to generate a so-called HDR composite image. This composite image corresponds to information indicating the reflection characteristic of ambient light. Since the functional configuration and the basic processing operation of the image processing unit 105 are the same as those in the first embodiment, redundant description will be omitted, and the processing operation of the light source characteristic extraction unit 207 that is characteristic of this embodiment will be focused. Explained.

例えばシステム制御部50は、2枚目の撮影画像をシステムメモリ122に記録せずに画像処理部105に供給し、次いでシステムメモリ122に記録した1枚目の撮影画像を画像処理部105に供給する。リライティングモードにおいて光源特性抽出部207は、供給される複数の画像を合成して1枚の合成画像を生成する。   For example, the system control unit 50 supplies the second captured image to the image processing unit 105 without recording it in the system memory 122, and then supplies the first captured image recorded in the system memory 122 to the image processing unit 105. To do. In the relighting mode, the light source characteristic extraction unit 207 combines a plurality of supplied images to generate one combined image.

具体的には、光源特性抽出部207は、適正露出で撮影した画像のうち、図4(a)の画素404が存在する領域のように暗い部分については、オーバー露出で撮影した画像の画素に置き換えて1枚の合成画像を生成する。この時、置き換えに用いる画素の露出がオーバーであれば、適正露出相当の明るさに変換してから用いる。このようにして得られる合成画像は、影による暗部が少ない画像となる。画像処理部105は、合成画像を画像メモリ106に記録する。   Specifically, the light source characteristic extraction unit 207 determines that a dark portion such as a region where the pixel 404 in FIG. It replaces and produces|generates one synthetic image. At this time, if the pixel used for the replacement is overexposed, it is used after being converted to the brightness corresponding to the proper exposure. The composite image obtained in this way is an image with few dark areas due to shadows. The image processing unit 105 records the composite image in the image memory 106.

なお、S802〜S804においてオーバー露出の程度を変えた複数枚の撮影を行い、合成画像の生成時には複数のオーバー露出画像のうち、適切な露出の画素を用いるようにしてもよい。   It should be noted that, in S802 to S804, a plurality of images with different degrees of overexposure may be taken, and an appropriately exposed pixel of the plurality of overexposure images may be used when generating the composite image.

次に、本実施形態におけるリライティング処理部114’の構成および動作について説明する。図9に本実施形態におけるリライティング処理部114’の機能構成例を示す。第1の実施形態と同様の機能ブロックには図6と同じ参照数字を付し、説明は省略する。図5(a)を用いて説明した制御パラメータの算出および設定処理に続いてリライティング処理部114’が行う動作について説明する。   Next, the configuration and operation of the relighting processing unit 114' in this embodiment will be described. FIG. 9 shows a functional configuration example of the relighting processing unit 114' in this embodiment. The same functional blocks as those in the first embodiment are designated by the same reference numerals as those in FIG. 6, and description thereof will be omitted. The operation performed by the relighting processing unit 114' following the control parameter calculation and setting processing described with reference to FIG. 5A will be described.

リライティング処理部114’には、適正露出で撮影した画像がRGB信号変換部601に、光源特性抽出部207で生成した合成画像が平滑化処理部902にそれぞれ入力される。なお、平滑化処理部902は、仮想光源処理部901がデガンマ処理部602から受け取って処理する処理対象画素と同じ画像座標の画素について平滑処理を行い、平滑化処理後の画素信号(Rc,Gc,Bc)を仮想光源処理部901に出力する。平滑化処理の内容は第1の実施形態と同じであってよい。   An image captured with proper exposure is input to the RGB signal conversion unit 601 and a combined image generated by the light source characteristic extraction unit 207 is input to the relighting processing unit 114 ′ and the smoothing processing unit 902, respectively. The smoothing processing unit 902 performs the smoothing process on the pixel having the same image coordinates as the processing target pixel which the virtual light source processing unit 901 receives from the degamma processing unit 602 and processes the pixel signal (Rc, Gc) after the smoothing process. , Bc) is output to the virtual light source processing unit 901. The contents of the smoothing process may be the same as in the first embodiment.

仮想光源処理部901は、デガンマ処理部602から入力される、適正露出で撮影した撮影画像信号に対して、リライティング効果を付加する。仮想光源処理部901の動作を、図8(b)に示すフローチャートを用いて説明する。   The virtual light source processing unit 901 adds a relighting effect to the captured image signal captured by the degamma processing unit 602 and captured with proper exposure. The operation of the virtual light source processing unit 901 will be described with reference to the flowchart shown in FIG.

S810で仮想光源処理部901は、第1の実施形態におけるS510の処理と同様にして、処理対象の画素が仮想光源の照射範囲内に位置するかどうかを判定する。そして、仮想光源処理部901は、処理対象画素が仮想光源の照射範囲内に位置すると判定された場合に処理をS811へ進め、処理対象画素が仮想光源の照射範囲内に位置しないと判定された場合はリライティング効果を付加せずに処理を終了する。   In S810, the virtual light source processing unit 901 determines whether the pixel to be processed is located within the irradiation range of the virtual light source, as in the process of S510 in the first embodiment. Then, the virtual light source processing unit 901 advances the process to S811 when it is determined that the processing target pixel is located within the irradiation range of the virtual light source, and determines that the processing target pixel is not located within the irradiation range of the virtual light source. In this case, the process ends without adding the relighting effect.

S811で仮想光源処理部901は、仮想光反射色(Rv,Gv,Bv)を算出する。仮想光反射色(Rv,Gv,Bv)は、平滑化処理部902で合成画像から算出した色信号(Rc,Gc,Bc)に、S502で設定した仮想光源色ゲイン(Rv−Gain,Bv−Gain)を以下の様に乗じることで算出できる。
Rv = Rv−Gain * Rc
Gv = Gc
Bv = Bv−Gain * Bc
In step S811, the virtual light source processing unit 901 calculates the virtual light reflection color (Rv, Gv, Bv). The virtual light reflection color (Rv, Gv, Bv) is obtained by adding the virtual light source color gain (Rv-Gain, Bv-) set in S502 to the color signal (Rc, Gc, Bc) calculated from the composite image by the smoothing processing unit 902. It can be calculated by multiplying Gain) as follows.
Rv=Rv-Gain*Rc
Gv = Gc
Bv=Bv-Gain*Bc

S812で仮想光源処理部901は、仮想光源と処理対象画素との距離Dを算出する。第1の実施形態におけるS514の処理と同様であってよい。   In step S812, the virtual light source processing unit 901 calculates the distance D between the virtual light source and the pixel to be processed. The process may be the same as the process of S514 in the first embodiment.

S813で仮想光源処理部901は、処理対象画素に、リライティング効果を付加する。具体的には、S811で算出した仮想光反射色(Rv,Gv,Bv)を、仮想光源照射ゲイン(α)とS812で算出した距離Dとに基づく重みで、処理対象画素(Rt,Gt,Bt)に加算する。   In step S813, the virtual light source processing unit 901 adds the relighting effect to the processing target pixel. Specifically, the virtual light reflection color (Rv, Gv, Bv) calculated in S811 is weighted based on the virtual light source irradiation gain (α) and the distance D calculated in S812, and the processing target pixel (Rt, Gt, Bt).

本実施形態においても、仮想光源によって照射された処理対象画素(Rout,Gout,Bout)の各成分は、以下の式によって算出するものとする。
Rout = Rt + α ×(1/D^2)× Rv
Gout = Gt + α ×(1/D^2)× Gv
Bout = Bt + α ×(1/D^2)× Bv
ただし、仮想光源照射ゲイン0<α<1である。
以上の処理を各画素について実施することで、リライティング効果を付加することができる。
Also in the present embodiment, each component of the processing target pixel (Rout, Gout, Bout) illuminated by the virtual light source is calculated by the following formula.
Rout=Rt+α×(1/D^2)×Rv
Gout = Gt + α x (1/D^2) x Gv
Bout=Bt+α×(1/D^2)×Bv
However, the virtual light source irradiation gain is 0<α<1.
The relighting effect can be added by performing the above processing for each pixel.

仮想光源処理部901でリライティング効果を付加した画素信号に対して、ガンマ処理部606でガンマ処理を施し、輝度色差信号生成部607で輝度・色差信号に変換して出力する。   The virtual light source processing unit 901 applies the gamma processing to the pixel signal to which the relighting effect has been added, the gamma processing unit 606 performs the gamma processing, and the luminance/color difference signal generation unit 607 converts and outputs the luminance/color difference signal.

以上説明したとおり、本実施形態では適正露出画像の暗部の画素をオーバー露出画像の画素を用いて合成した画像を用いて、仮想光の反射色(Rv,Gv,Bv)を算出する構成とした。そのため、適正露出画像において暗部の画素にリライティング効果を付加する場合、同色のハイライト部分から推定した仮想光の反射色を用いなくても、リライティング効果付加後の色が元から明るい部分の色とずれることを抑制できる。   As described above, in the present embodiment, the reflection color (Rv, Gv, Bv) of the virtual light is calculated using the image in which the pixels of the dark part of the proper exposure image are combined using the pixels of the overexposure image. .. Therefore, when adding a relighting effect to dark pixels in a properly exposed image, the color after adding the relighting effect is the same as the color of the bright part from the original even if the reflected color of virtual light estimated from the highlight part of the same color is not used. The shift can be suppressed.

また、第1の実施形態と同様、ノイズを増加させることなくリライティング効果を付加することが可能である。   Further, as in the first embodiment, it is possible to add a relighting effect without increasing noise.

なお、本実施形態では、リライティングを前提とする撮影モードが設定されている場合にのみオーバー露出での撮影を行うものとして説明したが、撮影モードによらず適正露出とオーバー露出の画像を撮影して、記録媒体に記録するように構成してもよい。   It should be noted that, in the present embodiment, it has been described that the overexposure shooting is performed only when the shooting mode premised on the relighting is set, but the images of the proper exposure and the overexposure are shot regardless of the shooting mode. Then, the data may be recorded on a recording medium.

なお、リライティング処理の対象となる画像について、露出オーバーで撮影した画像があるか探索し、ある場合は第2の実施形態の方法を用い、ない場合には第1の実施形態の方法を実行するといったように構成してもよい。この場合、例えばリライティング処理部114をソフトウェア的に実現する場合や、動的に再構成可能なプログラマブルロジックアレイを用いて実現することで、両方の方法を動的に実施することが可能である。もちろん、リライティング処理部114,114’を独立して設けてもよい。   It should be noted that the image to be subjected to the relighting process is searched for an image taken by overexposure, and if there is, the method of the second embodiment is used, and if not, the method of the first embodiment is executed. It may be configured as follows. In this case, for example, when the relighting processing unit 114 is realized by software or by using a dynamically reconfigurable programmable logic array, both methods can be dynamically executed. Of course, the relighting processing units 114 and 114' may be provided independently.

(その他の実施形態)
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
(Other embodiments)
The present invention is also realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or device via a network or various storage media, and the computer (or CPU, MPU, etc.) of the system or device reads the program. This is the process to be executed.

50…システム制御部,101…光学系,102…シャッター,103…撮像部,104…A/D変換器,105…画像処理部,106…画像メモリ,107…メモリ制御部,109…表示部,110…コーデック部,111…記録I/F,112…記録媒体,113…顔検出部,114…リライティング処理部,120…操作部,121…不揮発性メモリ,122…システムメモリ   50... System control section, 101... Optical system, 102... Shutter, 103... Imaging section, 104... A/D converter, 105... Image processing section, 106... Image memory, 107... Memory control section, 109... Display section, 110... Codec unit, 111... Recording I/F, 112... Recording medium, 113... Face detection unit, 114... Relighting processing unit, 120... Operation unit, 121... Nonvolatile memory, 122... System memory

Claims (17)

対象画像の第1のエリアに仮想光を照射した効果を付与することで、前記第1のエリアの輝度を補正する補正手段と、
前記補正手段が前記第1のエリアの輝度を補正する際に参照する第2のエリアを前記対象画像内で決定する決定手段と、を有し、
前記補正手段は、前記第1のエリアの輝度を補正する際に、前記第2のエリアの色情報に基づく補正信号を用いて前記第1のエリアの色信号を補正することで、前記第1のエリアの色情報が前記第2のエリアの色情報に近付くよう補正することを特徴とする画像処理装置。
Correction means for correcting the luminance of the first area by applying the effect of irradiating the first area of the target image with virtual light ;
Determining means for determining a second area in the target image to be referred to when the correcting means corrects the luminance of the first area;
The correction means corrects the color signal of the first area by using a correction signal based on the color information of the second area when correcting the luminance of the first area, and The image processing device is characterized in that the color information of the area is corrected so as to approach the color information of the second area.
前記補正手段は、前記仮想光を照射した効果として前記補正信号を加算することにより、前記第1のエリアの輝度を補正することを特徴とする請求項1に記載の画像処理装置。 It said correcting means, by adding the correction signal as an effect of radiating the virtual light, the image processing apparatus according to claim 1, characterized in that for correcting the luminance of the first area. 前記仮想光の強度を設定する設定手段をさらに有することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, further comprising setting means for setting the intensity of the virtual light. 前記設定手段は、ユーザ操作に基づき前記仮想光の強度を設定することを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the setting unit sets the intensity of the virtual light based on a user operation. 前記仮想光の光源の位置を設定する設定手段をさらに有することを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, further comprising setting means for setting the position of the light source of the virtual light. 前記設定手段は、ユーザ操作に基づき前記仮想光の光源の位置を設定することを特徴とする請求項5に記載の画像処理装置。   The image processing apparatus according to claim 5, wherein the setting unit sets the position of the light source of the virtual light based on a user operation. 前記対象画像における前記仮想光の照射位置を特定する特定手段をさらに有することを特徴とする請求項2から6のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 2, further comprising a specifying unit that specifies an irradiation position of the virtual light in the target image. 前記特定手段は前記仮想光の中心照射位置を特定し、
前記補正手段は、前記第1のエリアと前記中心照射位置に基づき、前記補正信号を算出することを特徴とする請求項7に記載の画像処理装置。
The specifying means specifies a central irradiation position of the virtual light,
The image processing apparatus according to claim 7, wherein the correction unit calculates the correction signal based on the first area and the center irradiation position.
前記対象画像における前記仮想光の照射範囲を特定する特定手段をさらに有することを特徴とする請求項2から6のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 2, further comprising a specifying unit that specifies an irradiation range of the virtual light in the target image. 前記補正手段は、前記仮想光の照射範囲に含まれないエリアは前記補正の対象としないことを特徴とする請求項9に記載の画像処理装置。   The image processing apparatus according to claim 9, wherein the correction unit does not set an area that is not included in the irradiation range of the virtual light as the correction target. 前記補正信号は、前記対象画像の画素単位で算出されることを特徴とする請求項1から10のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the correction signal is calculated for each pixel of the target image. 前記第1のエリア及び第2のエリアは、特定の色と判定された領域であることを特徴とする請求項1から11のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the first area and the second area are areas determined to have a specific color. 前記第2のエリアは、前記特定の色と判定され、かつ所定値以上の輝度を有するエリアであることを特徴とする請求項12に記載の画像処理装置。   The image processing apparatus according to claim 12, wherein the second area is an area that has been determined to have the specific color and has a brightness equal to or higher than a predetermined value. 前記特定の色は肌色であることを特徴とする請求項12または請求項13に記載の画像処理装置。   The image processing apparatus according to claim 12, wherein the specific color is a skin color. 前記第2のエリアは、顔領域と判定された領域に含まれることを特徴とする請求項1から11のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the second area is included in an area determined to be a face area. 対象画像の第1のエリアに仮想光を照射した効果を付与することで、前記第1のエリアの輝度を補正する補正工程と、
前記補正工程において前記第1のエリアの輝度を補正する際に参照する第2のエリアを前記対象画像内で決定する決定工程と、を有し、
前記補正工程では、前記第1のエリアの輝度を補正する際に、前記第2のエリアの色情報に基づく補正信号を用いて前記第1のエリアの色信号を補正することで、前記第1のエリアの色情報が前記第2のエリアの色情報に近付くように補正することを特徴とする画像処理方法。
A correction step of correcting the brightness of the first area by applying the effect of irradiating the first area of the target image with virtual light ;
A determining step of determining, in the target image, a second area to be referred to when correcting the brightness of the first area in the correcting step,
In the correction step, when correcting the luminance of the first area, the color signal of the first area is corrected using a correction signal based on the color information of the second area, thereby The image processing method, wherein the color information of the area is corrected so as to approach the color information of the second area.
コンピュータを、請求項1から15のいずれか1項に記載の画像処理装置が有する各手段として機能させるためのプログラム。   A program for causing a computer to function as each unit included in the image processing apparatus according to claim 1.
JP2018197834A 2018-10-19 2018-10-19 Image processing apparatus and image processing method Active JP6701299B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018197834A JP6701299B2 (en) 2018-10-19 2018-10-19 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018197834A JP6701299B2 (en) 2018-10-19 2018-10-19 Image processing apparatus and image processing method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2014125755A Division JP6423625B2 (en) 2014-06-18 2014-06-18 Image processing apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2019024256A JP2019024256A (en) 2019-02-14
JP6701299B2 true JP6701299B2 (en) 2020-05-27

Family

ID=65368687

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018197834A Active JP6701299B2 (en) 2018-10-19 2018-10-19 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP6701299B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004021388A (en) * 2002-06-13 2004-01-22 Nippon Hoso Kyokai <Nhk> Image processor and photographing system equipped therewith
JP2007148567A (en) * 2005-11-24 2007-06-14 Canon Inc Image processing method and image processing device
KR20100047521A (en) * 2008-10-29 2010-05-10 삼성전자주식회사 Method for displaying image by virtual lighting and mobile terminal using the same
US8855371B2 (en) * 2010-06-30 2014-10-07 Nec Corporation Color image processing method, color image processing device, and color image processing program
JP6423625B2 (en) * 2014-06-18 2018-11-14 キヤノン株式会社 Image processing apparatus and image processing method

Also Published As

Publication number Publication date
JP2019024256A (en) 2019-02-14

Similar Documents

Publication Publication Date Title
US10574961B2 (en) Image processing apparatus and image processing method thereof
JP6445844B2 (en) Imaging device and method performed in imaging device
US10861136B2 (en) Image processing apparatus, image processing method, and storage medium
JP6521776B2 (en) Image processing apparatus, image processing method
JP2012119858A (en) Imaging device, imaging method, and program
US9961319B2 (en) Image processing apparatus and control method thereof
US7486884B2 (en) Imaging device and imaging method
JP2009017229A (en) Imaging device and imaging control method
JP6025472B2 (en) Image processing apparatus and image processing method
US20200304723A1 (en) Image processing device, imaging apparatus, image processing method, and program
JP5225137B2 (en) Imaging apparatus, image processing method, and program
JP2015005927A (en) Image processing apparatus and control method of the same
JP6148497B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP5956844B2 (en) Image processing apparatus and control method thereof
JP5414216B2 (en) Imaging apparatus, control method thereof, and program
CN116266877A (en) Image processing apparatus and method, image capturing apparatus, and computer readable medium
JP6808482B2 (en) Image processing equipment, image processing methods, and programs
JP6701299B2 (en) Image processing apparatus and image processing method
JP6570311B2 (en) Image processing apparatus and image processing method
JP6541416B2 (en) IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, PROGRAM, AND STORAGE MEDIUM
JP4789776B2 (en) Imaging apparatus and imaging method
JP6616674B2 (en) Image processing apparatus and method, and imaging apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20181019

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190708

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190830

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191025

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: 20200403

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200501

R151 Written notification of patent or utility model registration

Ref document number: 6701299

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151