Nothing Special   »   [go: up one dir, main page]

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

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

Info

Publication number
JP2018092350A
JP2018092350A JP2016234832A JP2016234832A JP2018092350A JP 2018092350 A JP2018092350 A JP 2018092350A JP 2016234832 A JP2016234832 A JP 2016234832A JP 2016234832 A JP2016234832 A JP 2016234832A JP 2018092350 A JP2018092350 A JP 2018092350A
Authority
JP
Japan
Prior art keywords
correction target
area
image processing
color
target region
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.)
Pending
Application number
JP2016234832A
Other languages
Japanese (ja)
Other versions
JP2018092350A5 (en
Inventor
将浩 高山
Masahiro Takayama
将浩 高山
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 JP2016234832A priority Critical patent/JP2018092350A/en
Publication of JP2018092350A publication Critical patent/JP2018092350A/en
Publication of JP2018092350A5 publication Critical patent/JP2018092350A5/ja
Priority to JP2021081602A priority patent/JP7129520B2/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce erroneous correction on images, which is caused by color unevenness.SOLUTION: A electronic camera 100 evaluates luminance and color unevenness in an area of the face of a person appeared in a captured image, corrects a complementary color of skin color according to the evaluated luminance and color unevenness, and subtracts a value of the corrected complementary color of the skin color from a pixel value of a high luminance area.SELECTED DRAWING: Figure 1

Description

本発明は、画像処理装置、画像処理方法、およびプログラムに関し、特に、撮像手段で撮像された画像を補正するために用いて好適なものである。   The present invention relates to an image processing apparatus, an image processing method, and a program, and is particularly suitable for use in correcting an image captured by an imaging unit.

デジタルカメラなどの撮像装置は、カメラ内の絞りやシャッターを用いて露出制御を行った上で被写体を撮影する。しかし、撮像装置が露出制御を行って撮影したとしても、環境光源やストロボ光の影響により、撮像された画像において顔の領域にテカリが発生する場合がある。テカリとは、環境光やストロボ光が人物の肌の表面で反射することにより、画像における人物の肌の一部の領域が白くなることである。このように肌色に対して局所的な高輝度部が画像に存在することにより、人物の画像として好ましくない印象を、当該画像を見たユーザに与える虞がある。そこで、画像におけるテカリを低減する技術が要求されている。   An imaging device such as a digital camera takes a picture of an object after performing exposure control using an aperture and a shutter in the camera. However, even if the imaging device performs exposure control and shoots, there is a case where the face area in the captured image is lit due to the influence of the environmental light source or the strobe light. The shine means that a part of the human skin in the image becomes white due to reflection of ambient light or strobe light on the surface of the human skin. As described above, since the local high-luminance portion with respect to the skin color is present in the image, there is a possibility that an unpleasant impression as a human image is given to the user who viewed the image. Therefore, a technique for reducing the shine in the image is required.

このような要求に対して、顔の領域の肌色に対して局所的な高輝度部を除去する技術が提案されている。特許文献1には、撮像手段で撮像された画像から被写体の顔などの所定部位を検出して、当該所定部位に含まれる各画素の色情報と輝度情報とに基づいて、各画素の補正の割合を決定する技術が開示されている。   In response to such a demand, a technique for removing a local high-intensity part with respect to the skin color of the face region has been proposed. In Patent Document 1, a predetermined part such as a face of a subject is detected from an image captured by an imaging unit, and correction of each pixel is performed based on color information and luminance information of each pixel included in the predetermined part. Techniques for determining the ratio are disclosed.

特開2005−327009号公報JP-A-2005-327209

しかし、特許文献1に記載の技術では、テカリ部において肌色が正しく再現できない場合がある。例えば、環境光源が複数存在するシーンやストロボ光を発光するようなシーンでは、顔の領域に色むらが生じる場合がある。この場合、特許文献1に記載の技術では、テカリを低減するための補正をすることによって、色むらをより強調してしまうことがある。その結果、テカリを補正することによりユーザが意図しない不自然な画像となる虞がある。
本発明は、このような問題点に鑑みてなされたものであり、色むらによって生じる画像の誤補正を低減することを目的とする。
However, with the technique described in Patent Document 1, the skin color may not be correctly reproduced in the shining portion. For example, in a scene where there are a plurality of environmental light sources or a scene that emits strobe light, color unevenness may occur in the face area. In this case, with the technique described in Patent Document 1, color unevenness may be more emphasized by performing correction for reducing the shine. As a result, there is a possibility that an unnatural image unintended by the user may be obtained by correcting the shine.
The present invention has been made in view of such a problem, and an object thereof is to reduce erroneous correction of an image caused by color unevenness.

本発明の画像処理装置は、撮像手段で撮像された画像に含まれる人物の顔の領域のうち、輝度が閾値よりも高い領域を補正対象領域として、当該補正対象領域の画素値を補正する処理を含む画像処理を行う画像処理装置であって、前記顔の領域のうち少なくとも前記補正対象領域における色むらの度合いの評価値を取得する取得手段と、前記補正対象領域における色むらの度合いの評価値に基づいて、前記補正対象領域における画素値に対する補正量を決定する決定手段と、を有することを特徴とする。   The image processing apparatus according to the present invention corrects the pixel value of a correction target area, using a correction target area as a correction target area among areas of a human face included in an image captured by an imaging unit. An image processing apparatus that performs image processing including: an acquisition unit that acquires an evaluation value of the degree of color unevenness in at least the correction target region of the face region; and an evaluation of the degree of color unevenness in the correction target region And determining means for determining a correction amount for the pixel value in the correction target area based on the value.

本発明によれば、色むらによって生じる画像の誤補正を低減することができる。   According to the present invention, it is possible to reduce erroneous image correction caused by color unevenness.

電子カメラの構成の一例を示す図である。It is a figure which shows an example of a structure of an electronic camera. 画像処理部の構成を示す図である。It is a figure which shows the structure of an image process part. テカリ補正処理を説明する図である。It is a figure explaining a shine correction process. テカリ補正を行う際の電子カメラの動作を説明するフローチャートである。It is a flowchart explaining operation | movement of the electronic camera at the time of performing a shine correction. 顔検出部により検出される顔の領域を示す図である。It is a figure which shows the area | region of the face detected by the face detection part. テカリ補正処理の第1の例を説明するフローチャートである。It is a flowchart explaining the 1st example of a shine correction process. ストロボ照射量を説明する図である。It is a figure explaining strobe irradiation amount. テカリ補正により新たに発生する色むらを説明する図である。It is a figure explaining the color nonuniformity newly generated by the shine correction. テカリ補正量を算出する際のゲイン特性を示す図である。It is a figure which shows the gain characteristic at the time of calculating a shine correction amount. テカリ補正処理の第2の例を説明するフローチャートである。It is a flowchart explaining the 2nd example of a shine correction process.

以下に、図面に基づいて、実施形態を説明する。以下の各実施形態では、電子カメラに画像処理装置が搭載される場合を例に挙げて説明する。電子カメラは、例えば、デジタルスチルカメラ、デジタルムービーカメラ、工業用カメラ、車載用カメラ、または医療用カメラなどである。ただし、撮像手段で撮像された画像に対する画像処理を行う機能を有する装置であれば、以下の各実施形態で説明する画像処理装置が搭載される装置は、電子カメラに限定されない。例えば、携帯端末(携帯電話やタブレット端末など)またはパーソナルコンピュータなどの情報処理装置に、以下の各実施形態で説明する画像処理装置を搭載してもよい。   Embodiments will be described below based on the drawings. In each of the following embodiments, a case where an image processing apparatus is mounted on an electronic camera will be described as an example. The electronic camera is, for example, a digital still camera, a digital movie camera, an industrial camera, an in-vehicle camera, or a medical camera. However, as long as the apparatus has a function of performing image processing on an image captured by the imaging unit, an apparatus on which an image processing apparatus described in the following embodiments is mounted is not limited to an electronic camera. For example, an image processing apparatus described in each of the following embodiments may be mounted on an information processing apparatus such as a mobile terminal (such as a mobile phone or a tablet terminal) or a personal computer.

(第1の実施形態)
まず、第1の実施形態を説明する。
図1は、電子カメラ100の構成の一例を示すブロック図である。
レンズ群101は、フォーカスレンズを含むズームレンズである。シャッター102は、絞り機能を備える。シャッター102は、システム制御部50の制御に応じて撮像部103に含まれる撮像素子を露光する。撮像部103は、レンズ群101を通して得られる光学像を光電変換により電気信号に変換する。撮像部103は、CCD/CMOSイメージセンサ等の撮像素子を含む。A/D変換部104は、撮像部103から読み出されたアナログ信号をデジタル信号に変換して画像処理部105に画像データを出力する。
(First embodiment)
First, the first embodiment will be described.
FIG. 1 is a block diagram illustrating an example of the configuration of the electronic camera 100.
The lens group 101 is a zoom lens including a focus lens. The shutter 102 has an aperture function. The shutter 102 exposes the image sensor included in the imaging unit 103 in accordance with the control of the system control unit 50. The imaging unit 103 converts an optical image obtained through the lens group 101 into an electrical signal by photoelectric conversion. The imaging unit 103 includes an imaging element such as a CCD / CMOS image sensor. The A / D conversion unit 104 converts the analog signal read from the imaging unit 103 into a digital signal and outputs the image data to the image processing unit 105.

画像処理部105は、A/D変換部104から出力された画像データまたはメモリ制御部107から出力された画像データに対して、ホワイトバランス調整およびガンマ補正などの各種画像処理を行う。また、画像処理部105は、顔検出部113による顔の検出の結果や、撮像された画像データを用いて、所定の評価値の算出を行う。システム制御部50は、画像処理部105で得られた評価値に基づいて、露光制御および測距制御を行う。これにより、システム制御部50は、TTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動慮出)処理、およびAWB(オートホワイトバランス)処理などを行う。また、画像処理部105は、画像内の領域に発生したテカリを補正する。テカリを補正する方法の一例の詳細については後述する。   The image processing unit 105 performs various image processing such as white balance adjustment and gamma correction on the image data output from the A / D conversion unit 104 or the image data output from the memory control unit 107. Further, the image processing unit 105 calculates a predetermined evaluation value using the result of face detection by the face detection unit 113 and the captured image data. The system control unit 50 performs exposure control and distance measurement control based on the evaluation value obtained by the image processing unit 105. As a result, the system control unit 50 performs TTL (through the lens) AF (autofocus) processing, AE (automatic consideration) processing, AWB (auto white balance) processing, and the like. Further, the image processing unit 105 corrects the shine generated in the area in the image. Details of an example of a method for correcting the shine will be described later.

画像メモリ106は、画像処理部105が各種画像処理を行う際に一時的に画像データを記憶する。また、画像メモリ106は、記録媒体インターフェース(I/F)111を介して記録媒体112から読み込まれた画像データや、表示部109に表示するための画像データを記憶する。メモリ制御部107は、画像メモリ106の読み書きを制御する。D/A変換器108は、デジタル信号をアナログ信号に変換する。D/A変換器108は、例えば、画像メモリ106に格納されている画像表示用のデータをアナログ信号に変換して表示部109に出力する。   The image memory 106 temporarily stores image data when the image processing unit 105 performs various image processing. The image memory 106 stores image data read from the recording medium 112 via the recording medium interface (I / F) 111 and image data to be displayed on the display unit 109. A memory control unit 107 controls reading and writing of the image memory 106. The D / A converter 108 converts the digital signal into an analog signal. For example, the D / A converter 108 converts image display data stored in the image memory 106 into an analog signal and outputs the analog signal to the display unit 109.

表示部109は、LCD(Liquid Crystal Display)などの表示装置を有する。表示部109は、電子カメラ100で撮影された画像、記録媒体112から読み出された画像、ライブビュー画像などを表示する。また、表示部109は、電子カメラ100に対する操作をユーザが行うためのユーザインターフェースを表示する。コーデック部110は、画像データを圧縮符号化・復号化する。コーデック部110は、画像メモリ106に記録された画像データを例えばMPEGなどの規格に準拠した形式で符号化または復号化する。   The display unit 109 includes a display device such as an LCD (Liquid Crystal Display). The display unit 109 displays an image captured by the electronic camera 100, an image read from the recording medium 112, a live view image, and the like. The display unit 109 displays a user interface for the user to perform operations on the electronic camera 100. The codec unit 110 compresses and decodes image data. The codec unit 110 encodes or decodes the image data recorded in the image memory 106 in a format conforming to a standard such as MPEG.

記録媒体I/F111は、記録媒体112を、電子カメラ100と機械的および電気的に接続する。記録媒体112は、例えば、半導体メモリカードやカード型ハードディスクなどの着脱可能な記録媒体である。顔検出部113は、画像データを解析して画像内の顔が映っている領域を検出する。システム制御部50は、CPU(Central Processing Unit)またはMPU(Micro Processing Unit)を含む。システム制御部50は、不揮発性メモリ121に記憶されているプログラムをシステムメモリ122の作業領域に展開することにより実行して、電子カメラ100全体の各機能を制御する。   The recording medium I / F 111 mechanically and electrically connects the recording medium 112 to the electronic camera 100. The recording medium 112 is a detachable recording medium such as a semiconductor memory card or a card-type hard disk. The face detection unit 113 analyzes the image data and detects a region where a face in the image is shown. The system control unit 50 includes a CPU (Central Processing Unit) or an MPU (Micro Processing Unit). The system control unit 50 executes the program stored in the non-volatile memory 121 by developing it in the work area of the system memory 122 and controls each function of the entire electronic camera 100.

操作部120は、前述した表示部109で表示されるインターフェースとしてのタッチパネルと、ボタンおよびスイッチとを含む。操作部120は、操作部120に対するユーザによる操作の内容をシステム制御部50に通知する。不揮発性メモリ121は、補助記憶装置として、プログラムやパラメータなどを格納する不揮発性の半導体メモリを有する。具体的に不揮発性メモリ121は、例えば、EEPROMを有する。システムメモリ122は、主記憶装置であり、不揮発性メモリ121から読み出されたプログラムなどを展開する他、システム制御部50の動作用の定数、変数を記憶する。   The operation unit 120 includes a touch panel as an interface displayed on the display unit 109 described above, buttons, and switches. The operation unit 120 notifies the system control unit 50 of the content of the user operation on the operation unit 120. The non-volatile memory 121 includes a non-volatile semiconductor memory that stores programs, parameters, and the like as an auxiliary storage device. Specifically, the nonvolatile memory 121 includes, for example, an EEPROM. The system memory 122 is a main storage device, and develops a program read from the nonvolatile memory 121 and stores constants and variables for operation of the system control unit 50.

次に、図2を参照しながら、画像処理部105の構成の一例と画像処理部105の各部の処理の一例を説明する。
画像信号生成部201は、A/D変換部104から出力された画像データを入力する。本実施形態では、画像データは、ベイヤー配列で構成されたRGBの画像データであるものとする。画像信号生成部201は、ベイヤー配列で構成されたRGBの画像データに対して同時化処理を行って、1画素あたり複数の色を有する画像データR、G、Bを生成する。画像信号生成部201は、生成した画像データをホワイトバランス(WB)制御部202に出力する。
Next, an example of the configuration of the image processing unit 105 and an example of processing of each unit of the image processing unit 105 will be described with reference to FIG.
The image signal generation unit 201 receives the image data output from the A / D conversion unit 104. In the present embodiment, it is assumed that the image data is RGB image data configured in a Bayer array. The image signal generation unit 201 performs synchronization processing on RGB image data configured in a Bayer array, and generates image data R, G, and B having a plurality of colors per pixel. The image signal generation unit 201 outputs the generated image data to the white balance (WB) control unit 202.

WB制御部202は、画像信号生成部201により出力された画像データの情報に基づいてWB補正値を算出する。WB制御部202は、算出したWB補正値を用いて、画像データのホワイトバランスを補正する。
テカリ補正回路203は、WB制御部202によってホワイトバランスが補正された画像データを基にテカリ補正処理を実施する。図3は、テカリ補正処理の一例を説明する図である。テカリ補正回路203は、例えば、図3に示すように、画像の高輝度領域(テカリの補正対象領域)に対して肌色の補色を減算することで、肌色を再現する。テカリ補正回路203の詳細な構成の一例とテカリ補正値の算出方法の一例の詳細に関しては後述する。
The WB control unit 202 calculates a WB correction value based on the image data information output from the image signal generation unit 201. The WB control unit 202 corrects the white balance of the image data using the calculated WB correction value.
The shine correction circuit 203 performs the shine correction process based on the image data whose white balance has been corrected by the WB control unit 202. FIG. 3 is a diagram for explaining an example of the shine correction process. For example, as shown in FIG. 3, the shine correction circuit 203 reproduces the skin color by subtracting the complementary color of the skin color from the high luminance area (the area to be corrected for shine). Details of an example of a detailed configuration of the shine correction circuit 203 and an example of a method of calculating the shine correction value will be described later.

色変換マトリックス(MTX)回路204は、テカリ補正回路203により補正された画像データが最適な色で再現されるように、当該画像データに色ゲインを乗じ、当該画像データを2つの色差信号データR−Y、B−Yに変換する。
ローパスフィルタ(LPF)回路205は、色差信号データR−Y、B−Yの帯域を制限する。CSUP(Chroma Suppress)回路206は、LPF回路205で帯域制限された色差信号データの飽和部分の偽色信号を抑圧する。
The color conversion matrix (MTX) circuit 204 multiplies the image data by a color gain so that the image data corrected by the shine correction circuit 203 is reproduced with an optimum color, and the image data is converted into two color difference signal data R. Convert to -Y and BY.
A low-pass filter (LPF) circuit 205 limits the band of the color difference signal data RY and BY. A CSUP (Chroma Suppress) circuit 206 suppresses a false color signal in a saturated portion of the color difference signal data band-limited by the LPF circuit 205.

テカリ補正回路203により補正された画像データは輝度信号(Y)生成回路211にも供給される。輝度信号生成回路211は、テカリ補正回路203により補正された画像データから、輝度信号データYを生成する。エッジ強調回路212は、輝度信号生成回路211で生成された輝度信号データに対してエッジ強調処理を適用する。
CSUP回路206から出力される色差信号データR−Y、B−Yと、エッジ強調回路212から出力される輝度信号データYは、RGB変換回路207にてRGB信号データに変換される。
ガンマ(γ)補正回路208は、RGB信号データに対し、予め定められたガンマ特性に従ったガンマ補正(階調補正)を行う。ガンマ補正されたRGB信号データは、色輝度変換回路209によってYUV信号データに変換された後、JPEG圧縮回路210にて圧縮符号化され、画像メモリ106などに画像データファイルとして記録される。
The image data corrected by the shine correction circuit 203 is also supplied to the luminance signal (Y) generation circuit 211. The luminance signal generation circuit 211 generates luminance signal data Y from the image data corrected by the shine correction circuit 203. The edge enhancement circuit 212 applies edge enhancement processing to the luminance signal data generated by the luminance signal generation circuit 211.
The color difference signal data RY and BY output from the CSUP circuit 206 and the luminance signal data Y output from the edge enhancement circuit 212 are converted into RGB signal data by the RGB conversion circuit 207.
A gamma (γ) correction circuit 208 performs gamma correction (gradation correction) on the RGB signal data in accordance with a predetermined gamma characteristic. The RGB signal data subjected to gamma correction is converted into YUV signal data by the color luminance conversion circuit 209, and then compressed and encoded by the JPEG compression circuit 210, and recorded as an image data file in the image memory 106 or the like.

次に、テカリ補正回路203の構成の一例と動作の一例について説明する。
図4のフローチャートを参照しながら、テカリ補正を行う際の電子カメラ100の動作の一例について説明する。
まず、顔検出部113は、顔検出部113に入力された画像データから人物の顔の領域を検出し、画像内の人物の顔の領域を特定するための顔情報を取得する(S401)。続いて顔検出部113は、S401で検出した顔の領域の目、鼻、および口などの器官の領域を検出し、顔の領域内の器官の領域を示す器官情報を取得する(S402)。ここで、器官情報を取得する理由は、肌色領域とそれ以外の領域とを区別するためである。
Next, an example of the configuration and operation of the shine correction circuit 203 will be described.
An example of the operation of the electronic camera 100 when performing the shine correction will be described with reference to the flowchart of FIG.
First, the face detection unit 113 detects a human face region from the image data input to the face detection unit 113, and acquires face information for specifying the human face region in the image (S401). Subsequently, the face detection unit 113 detects organ regions such as eyes, nose, and mouth in the face region detected in S401, and acquires organ information indicating organ regions within the face region (S402). Here, the reason for acquiring the organ information is to distinguish the skin color area from the other areas.

図5は、顔検出部113により検出される顔の領域の一例を示す図である。顔検出部113は、例えば、領域501を人物の顔の領域として検出する。次に、顔検出部113は、顔の領域501に含まれる画像信号に基づいて、顔の領域501を複数のブロックに分割して、分割したブロック毎に評価値を取得する。本実施形態では、図5に示すブロック(顔の領域501を分割した矩形の1つ1つ)が分割領域の一例である。電子カメラ100は、この評価値を用いることにより、各ブロックがテカリの補正対象領域(高輝度領域)であるか否かを判断することができる。本実施形態では、顔検出部113は、S401で検出した顔の領域のうち、S402で検出した器官の領域を除く領域のブロックについて、ブロック積分値を当該ブロックの評価値として取得する。各ブロックのブロック積分値は、当該ブロック内の画素値(R、G、B)の積分値である。   FIG. 5 is a diagram illustrating an example of a face area detected by the face detection unit 113. For example, the face detection unit 113 detects the area 501 as a human face area. Next, the face detection unit 113 divides the face area 501 into a plurality of blocks based on the image signal included in the face area 501 and acquires an evaluation value for each of the divided blocks. In the present embodiment, the blocks shown in FIG. 5 (each of the rectangles obtained by dividing the face area 501) are examples of divided areas. By using this evaluation value, the electronic camera 100 can determine whether or not each block is a shine correction target region (high luminance region). In the present embodiment, the face detection unit 113 acquires a block integration value as an evaluation value of a block of a region other than the organ region detected in S402 among the face regions detected in S401. The block integration value of each block is an integration value of pixel values (R, G, B) in the block.

次に、テカリ補正回路203は、ブロック毎に取得した評価値に基づいて、テカリ補正処理を実施する(S404)。図6のフローチャートを参照しながら、テカリ補正処理の詳細の一例について説明する。
まず、テカリ補正回路203は、図4のS403で取得されたブロック積分値から、顔の領域のうち、目や口などの器官の領域を除いた領域の顔輝度情報をブロックごとに取得する(S601)。テカリ補正回路203は、ブロックのブロック積分値を当該ブロック内の画素の数で除算した値を、平均画素値AveR、AveG、AveBとして導出し、導出した平均画素値AveR、AveG、AveBから平均輝度値AveYを導出する。各ブロックの平均輝度値AveYが各ブロックの顔輝度情報になる。
Next, the shine correction circuit 203 performs a shine correction process based on the evaluation value acquired for each block (S404). With reference to the flowchart of FIG. 6, an example of details of the shine correction process will be described.
First, the shine correction circuit 203 acquires, for each block, face luminance information of an area excluding an area of an organ such as an eye or a mouth from the face integration value acquired in S403 of FIG. S601). The shine correction circuit 203 derives a value obtained by dividing the block integral value of the block by the number of pixels in the block as an average pixel value AveR, AveG, AveB, and average luminance from the derived average pixel values AveR, AveG, AveB The value AveY is derived. The average luminance value AveY of each block becomes the face luminance information of each block.

次に、テカリ補正回路203は、顔の領域のうち、目や口などの器官の領域を除いた領域の肌色平均値Skin_R、Skin_G、Skin_Bを取得する(S602)。続いてテカリ補正回路203は、本撮影時にストロボ光が発光したか否を判定する(S603)。本実施形態では、S602で取得される肌色平均値Skin_R、Skin_G、Skin_Bが、顔の領域における画素値の代表値の一例である。   Next, the shine correction circuit 203 acquires skin color average values Skin_R, Skin_G, and Skin_B of the facial region excluding the regions of organs such as eyes and mouth (S602). Subsequently, the shine correction circuit 203 determines whether or not strobe light is emitted during the main photographing (S603). In the present embodiment, the skin color average values Skin_R, Skin_G, and Skin_B acquired in S602 are examples of representative values of pixel values in the face area.

本撮影時にストロボ光が発光しなかった場合、テカリ補正回路203は、各ブロックの色評価値c[n]を取得する(S605)。色評価値c[n]は、テカリ補正回路203が各ブロックに色むらの有無があるか否かを判断するために使用される。色評価値c[n]は、例えば、各ブロックのGに対するR、Bの比率(R/G、B/G)、または、輝度Yで正規化したR−B値((R−B)/Y)およびMg(マゼンタ)−G値((R+B−G)/Y)である。ここで、R、B、G、Yは、それぞれ、前述したAveR、AveG、AveB、AveYである。   When the strobe light is not emitted during the main photographing, the shine correction circuit 203 acquires the color evaluation value c [n] of each block (S605). The color evaluation value c [n] is used by the shine correction circuit 203 to determine whether or not each block has color unevenness. The color evaluation value c [n] is, for example, the ratio of R and B to G of each block (R / G, B / G), or an RB value normalized by luminance Y ((RB) / Y) and Mg (magenta) -G value ((R + B-G) / Y). Here, R, B, G, and Y are AveR, AveG, AveB, and AveY, respectively, described above.

本撮影時にストロボ光が発光した場合、テカリ補正回路203は、各ブロックのストロボ照射量を取得する(S604)。ここで、図7を参照しながら、ストロボ照射量の一例について説明する。テカリ補正回路203は、図7に示すように非発光画像データ701から、n個の輝度ブロックa[n]を算出する。非発光画像データ701は、例えば、電子カメラ100が、ストロボ光を発光して行われる本撮影の前または後にストロボ光を発光せずに本撮影と同じ状態で被写体を撮影することにより得られる。また、テカリ補正回路203は、ストロボ発光画像データ702から、n個の輝度ブロックb[n]を取得する。ストロボ発光画像データ702は、本撮影時に得られた画像データである。ここで、図7では、説明の都合上、画像全体を複数のブロックに分割している。しかしながら、輝度ブロックは、前述した顔の領域を分割した複数のブロックと同じブロックでよく、輝度ブロックのそれぞれには、前述した平均輝度値AveYの情報が設定されていればよい(図5を参照)。このように輝度ブロックは、人物の顔の領域に対して設定されていればよい。テカリ補正回路203は、輝度ブロックa[n]およびb[n]を、例えばシステムメモリ122に一時的に格納する。   When the strobe light is emitted during the main photographing, the shine correction circuit 203 acquires the strobe irradiation amount of each block (S604). Here, an example of the strobe irradiation amount will be described with reference to FIG. The shine correction circuit 203 calculates n luminance blocks a [n] from the non-light emitting image data 701 as shown in FIG. The non-light-emitting image data 701 is obtained, for example, when the electronic camera 100 captures a subject in the same state as the main photographing without emitting the strobe light before or after the main photographing performed by emitting the strobe light. Further, the shine correction circuit 203 acquires n luminance blocks b [n] from the strobe light emission image data 702. The flash emission image data 702 is image data obtained at the time of actual photographing. Here, in FIG. 7, the entire image is divided into a plurality of blocks for convenience of explanation. However, the luminance block may be the same block as the plurality of blocks obtained by dividing the face area described above, and the information on the average luminance value AveY described above may be set in each of the luminance blocks (see FIG. 5). ). In this way, the luminance block only needs to be set for the human face area. The shine correction circuit 203 temporarily stores the luminance blocks a [n] and b [n], for example, in the system memory 122.

テカリ補正回路203は、ストロボ光の発光時と非発光時とで露出条件が異なる場合、露光条件を揃えた輝度ブロックを算出する。例えば、露出条件が、絞り、シャッタースピード、および感度であるとする。また、輝度ブロックa[n]の取得時の絞り、シャッタースピード、感度をそれぞれAv1、Tv1、Sv1とする。また、輝度ブロックb[n]の絞り、シャッタースピード、感度をそれぞれAv2、Tv2、Sv2とする。テカリ補正回路203は、これらの露出条件の差分である露出条件差分ΔEvを算出する。露出条件差分ΔEvは、例えば、ΔEv=2^{(Av1+Tv1−Sv1)−(Av2+Tv2−Sv2)}により算出される。そして、テカリ補正回路203は、輝度ブロックa[n]に露出条件差分ΔEvを乗算する。これにより、輝度ブロックa[n]、b[n]の露光条件が揃う。   When the exposure conditions are different between when the strobe light is emitted and when it is not emitted, the shine correction circuit 203 calculates a luminance block with the same exposure conditions. For example, it is assumed that the exposure conditions are aperture, shutter speed, and sensitivity. Also, let the aperture, shutter speed, and sensitivity when acquiring the luminance block a [n] be Av1, Tv1, and Sv1, respectively. Also, let the aperture, shutter speed, and sensitivity of the luminance block b [n] be Av2, Tv2, and Sv2, respectively. The shine correction circuit 203 calculates an exposure condition difference ΔEv that is a difference between these exposure conditions. The exposure condition difference ΔEv is calculated by, for example, ΔEv = 2 ^ {(Av1 + Tv1−Sv1) − (Av2 + Tv2−Sv2)}. Then, the shine correction circuit 203 multiplies the luminance block a [n] by the exposure condition difference ΔEv. Thereby, the exposure conditions of the luminance blocks a [n] and b [n] are aligned.

2つの輝度ブロックa[n]、b[n]の差分データ(=b[n]−a[n]またはb[n]−ΔEv×a[n])により、ストロボ光の発光時における顔の領域の反射光が表される。テカリ補正回路203は、輝度ブロックa[n]、b[n]の差分データを、顔の領域へのストロボ光の照射量とし、このストロボ光の照射量を評価値s[n]としてn個のブロックごとに取得する。この評価値s[n]も、色評価値c[n]と同様に、テカリ補正回路203が、各ブロックに色むらの有無があるか否かを判断するために使用される。ここでは、ストロボ光の発光時における顔の領域へのストロボ光の照射量を評価値として算出する場合を例に挙げて示す。しかしながら、テカリ補正回路203は、ストロボ光の非発光時(S605)のように色評価値を算出してもよい。   The difference data (= b [n] −a [n] or b [n] −ΔEv × a [n]) between the two luminance blocks a [n] and b [n] The reflected light of the area is represented. The shine correction circuit 203 uses the difference data of the luminance blocks a [n] and b [n] as the amount of stroboscopic light irradiation on the face area, and sets the amount of stroboscopic light irradiation as an evaluation value s [n]. Get for each block. Similarly to the color evaluation value c [n], the evaluation value s [n] is also used by the shine correction circuit 203 to determine whether or not each block has color unevenness. Here, a case where the amount of strobe light applied to the face area when the strobe light is emitted is calculated as an evaluation value will be described as an example. However, the shine correction circuit 203 may calculate the color evaluation value as in the case where the strobe light is not emitted (S605).

そして、S606において、テカリ補正回路203は、S604またはS605で取得した評価値s[n]、c[n]の均一度を算出する。つまり、テカリ補正回路203は、顔の領域に照射されている光源の照射むらの度合いを判断する。例えば、テカリ補正回路203は、評価値c[n]またはs[n]の分散値を算出し、分散値が大きければ大きいほど光源の照射むらがあると判断できる。本実施形態では、評価値c[n]またはs[n]の均一度(分散値)が色むらの度合いの評価値の一例である。   In S606, the shine correction circuit 203 calculates the uniformity of the evaluation values s [n] and c [n] acquired in S604 or S605. That is, the shine correction circuit 203 determines the degree of uneven illumination of the light source applied to the face area. For example, the shine correction circuit 203 calculates a dispersion value of the evaluation value c [n] or s [n], and can determine that there is uneven illumination of the light source as the dispersion value is larger. In the present embodiment, the uniformity (dispersion value) of the evaluation value c [n] or s [n] is an example of the evaluation value of the degree of color unevenness.

また、テカリ補正回路203は、ストロボの発光前後に撮影された非発光画像データ701に基づいて、ストロボ光が発光した場合の照射むらの有無を判断してもよい。例えば、テカリ補正回路203は、ストロボの発光前の非発光画像データ701において、顔の領域に陰影部(明暗部)があるか否か(例えば斜光状態か否か)を判断する。例えば、テカリ補正回路203は、値(平均輝度値AveY)が閾値ThA以下の輝度ブロックの数と、値が閾値ThB(>ThA)以上の輝度ブロックの数が、それぞれ所定の数以上である場合に、顔の領域に陰影部があると判断する。顔の領域に陰影部がある場合、顔の領域は、環境光が大きく照射されている部分と陰影部分とに分かれていることになる。従って、ストロボ光を発光したときにも顔の領域に照射むらが発生する。陰影部がある顔の領域にストロボ光を発光すると、顔の領域の暗部にはストロボ光が主に照射され、明部にはストロボ光と環境光とが混在した光が照射されるためである。ストロボ光を発光した場合、テカリ補正回路203は、ストロボ光の発光前後の非発光画像データ701から、顔の領域の陰影部を検知し、顔の領域の陰影部の陰影の度合いに基づいてストロボの発光時の照射むらの度合いを輝度ブロックごとに判断してもよい。テカリ補正回路203は、例えば、閾値ThA以下の輝度の範囲と、閾値ThB以上の輝度の範囲と、陰影の度合いとが相互に関連づけられたテーブルを予め記憶しておく。テカリ補正回路203は、閾値ThA以下の値を有する輝度ブロックの当該値の代表値(例えば平均値または中央値)と、閾値ThB以上の値を有する輝度ブロックの当該値の代表値(例えば平均値または中央値)とを算出する。テカリ補正回路203は、これらの代表値に対応する陰影の度合いをテーブルから抽出する。このようにして顔の領域における陰影の度合いを定めることができる。   Further, the shine correction circuit 203 may determine the presence or absence of uneven irradiation when the strobe light is emitted based on the non-light emission image data 701 taken before and after the strobe light emission. For example, the shine correction circuit 203 determines whether or not there is a shadow portion (bright / dark portion) in the face area in the non-light-emitting image data 701 before the strobe light emission (for example, whether or not it is in an oblique light state). For example, if the number of luminance blocks whose value (average luminance value AveY) is equal to or lower than the threshold value ThA and the number of luminance blocks whose value is equal to or higher than the threshold value ThB (> ThA) are each equal to or larger than a predetermined number, In addition, it is determined that there is a shadow portion in the face area. When there is a shadow portion in the face area, the face area is divided into a portion that is greatly irradiated with ambient light and a shadow portion. Therefore, even when the strobe light is emitted, uneven illumination occurs on the face area. This is because when the strobe light is emitted to the face area with the shadow part, the strobe light is mainly emitted to the dark part of the face area, and the light part is mixed with the strobe light and the ambient light. . When the strobe light is emitted, the shine correction circuit 203 detects a shadow portion of the face area from the non-light emitting image data 701 before and after the strobe light is emitted, and the strobe light is based on the degree of shadow of the shadow portion of the face area. The degree of irradiation unevenness at the time of light emission may be determined for each luminance block. For example, the shine correction circuit 203 stores in advance a table in which the luminance range equal to or lower than the threshold value ThA, the luminance range equal to or higher than the threshold value ThB, and the degree of shadow are associated with each other. The shine correction circuit 203 is a representative value (for example, average value or median value) of the luminance block having a value equal to or lower than the threshold value ThA, and a representative value (for example, average value) of the luminance block having a value equal to or higher than the threshold value ThB. Or median). The shine correction circuit 203 extracts the degree of shading corresponding to these representative values from the table. In this way, the degree of shadow in the face area can be determined.

テカリ補正回路203は、評価値s[n]、c[n]の均一度に基づいて、顔の領域に照射されている光源の照射むらを検知する。図8は、顔の領域のテカリを補正することにより新たな色むらが発生することを概念的に示す図である。光源Aと光源Bとによって顔に高輝度領域801が発生している場合、高輝度領域801に対して単純に肌色平均値の補色を減算すると、テカリを補正する前に存在する色むらに加えて、新たな色むら802が発生する。そこで、本実施形態では、テカリ補正回路203は、このような場合は高輝度領域801の補正量を制限することで、誤補正を低減する。   Based on the uniformity of the evaluation values s [n] and c [n], the shine correction circuit 203 detects irradiation unevenness of the light source applied to the face area. FIG. 8 is a diagram conceptually showing that new color unevenness occurs by correcting the shine of the face area. When the high brightness area 801 is generated on the face by the light source A and the light source B, if the complementary color of the skin color average value is simply subtracted from the high brightness area 801, in addition to the color unevenness existing before correcting the shine. As a result, new color unevenness 802 occurs. Therefore, in this embodiment, the shine correction circuit 203 reduces the erroneous correction by limiting the correction amount of the high luminance region 801 in such a case.

S607において、テカリ補正回路203は、S606で算出した評価値s[n]、c[n]の均一度と、S601で取得した顔輝度情報と、肌色平均値に基づく肌色の補色とに基づいてテカリ補正量を決定する。図9は、テカリ補正量を算出する際のゲイン特性の一例を示す図である。
図9(a)は、顔輝度情報に対する補正ゲイン(GainA)の一例を示す。前述したように本実施形態では、顔輝度情報は、各ブロックの平均輝度値AveYである。図9(a)に示す例では、顔輝度情報が閾値Th1_Y以上になると補正をかけることを示す。即ち、図9(a)に示す例では、テカリ補正回路203は、顔輝度情報が閾値Th1_Y以上である場合、高輝度であるほど大きな補正ゲインを設定する。また、テカリ補正回路203は、顔輝度情報が閾値Th2_Y以上になると最大の補正ゲインを設定する。
In S607, the shine correction circuit 203 is based on the uniformity of the evaluation values s [n] and c [n] calculated in S606, the face luminance information acquired in S601, and the skin color complementary color based on the skin color average value. Determine the amount of shine correction. FIG. 9 is a diagram illustrating an example of the gain characteristic when calculating the shine correction amount.
FIG. 9A shows an example of the correction gain (Gain A) for the face luminance information. As described above, in the present embodiment, the face luminance information is the average luminance value AveY of each block. The example illustrated in FIG. 9A indicates that correction is performed when the face luminance information is equal to or greater than the threshold Th1_Y. That is, in the example shown in FIG. 9A, the shine correction circuit 203 sets a larger correction gain as the luminance is higher when the face luminance information is equal to or greater than the threshold Th1_Y. Further, the shine correction circuit 203 sets the maximum correction gain when the face luminance information becomes equal to or greater than the threshold Th2_Y.

図9(b)は、評価値s[n]、c[n]の均一度に対する補正ゲイン(GainB)の一例を示す図である。前述したように本実施形態では、均一度は分散値である。図9(b)に示す例では、テカリ補正回路203は、評価値s[n]、c[n]の分散値が閾値Th1_Var以下の範囲では最大の補正ゲインを設定する。また、テカリ補正回路203は、評価値s[n]、c[n]の分散値が閾値Th1_Var〜Th2_Varの範囲では、分散値が大きくなるほど小さな補正ゲインを設定する。即ち、図9(b)に示す例では、テカリ補正回路203は、評価値s[n]、c[n]の分散値が大きければ大きいほど、顔の領域に照射されている光源の照射むらが顕著であると判断してゲインを低く設定する。また、テカリ補正回路203は、評価値s[n]、c[n]の分散値が閾値Th2_Var以上の範囲では、補正をかけない。   FIG. 9B is a diagram illustrating an example of a correction gain (GainB) with respect to the uniformity of the evaluation values s [n] and c [n]. As described above, in the present embodiment, the uniformity is a dispersion value. In the example shown in FIG. 9B, the shine correction circuit 203 sets the maximum correction gain in the range where the variance values of the evaluation values s [n] and c [n] are equal to or less than the threshold value Th1_Var. Further, the shine correction circuit 203 sets a smaller correction gain as the variance value increases in the range where the variance values of the evaluation values s [n] and c [n] are in the threshold values Th1_Var to Th2_Var. That is, in the example shown in FIG. 9B, the shine correction circuit 203 causes the unevenness of the illumination of the light source applied to the face region as the variance of the evaluation values s [n] and c [n] increases. Is set to be low. Further, the shine correction circuit 203 does not perform correction when the variance of the evaluation values s [n] and c [n] is greater than or equal to the threshold Th2_Var.

テカリ補正回路203は、以下の(1)式のように、最終的な補正ゲインαとしてGainAとGainBとを乗算した値を算出する。テカリ補正回路203は、補正ゲインαをブロックごとに算出する。本実施形態では、補正ゲインαがゲインの一例である。
α=GainA×GainB ・・・(1)
次に、テカリ補正回路203は、S602で取得した肌色平均値Skin_R、Skin_G、Skin_Bから肌色の補色Skin_R´、Skin_G´、Skin_B´)を算出する。そして、テカリ補正回路203は、肌色の補色と補正ゲインαとに基づいて、高輝度領域の各ブロックに対するテカリの補正量を算出する。具体的にテカリ補正回路203は、肌色の補色Skin_R´、Skin_G´、Skin_B´にゲインαを乗算して最終的な補正量を算出する(S607)。
The shine correction circuit 203 calculates a value obtained by multiplying Gain A and Gain B as the final correction gain α as shown in the following equation (1). The shine correction circuit 203 calculates a correction gain α for each block. In the present embodiment, the correction gain α is an example of the gain.
α = GainA × GainB (1)
Next, the shine correction circuit 203 calculates the skin color complementary colors Skin_R ′, Skin_G ′, and Skin_B ′) from the skin color average values Skin_R, Skin_G, and Skin_B acquired in S602. Then, the shine correction circuit 203 calculates the shine correction amount for each block in the high luminance area based on the complementary color of the skin color and the correction gain α. Specifically, the shine correction circuit 203 multiplies the skin color complementary colors Skin_R ′, Skin_G ′, and Skin_B ′ by the gain α to calculate a final correction amount (S607).

次に、テカリ補正回路203は、S607で算出した補正量を、ブロックに含まれる各画素の画素値R0、G0、B0から減算することで肌色を再現する(S608)。尚、高輝度領域以外の領域では、GainAが0(ゼロ)になり、ゲインαが0(ゼロ)になるので、画素値の補正は行われない。本実施形態では、例えば、(2)式〜(4)式の右辺第2項が、補正対象領域における画素値に対する補正量の一例である。
R1=R0−α×Skin_R´ ・・・(2)
G1=G0−α×Skin_G´ ・・・(3)
B1=B0−α×Skin_B´ ・・・(4)
Next, the shine correction circuit 203 reproduces the skin color by subtracting the correction amount calculated in S607 from the pixel values R0, G0, and B0 of each pixel included in the block (S608). Note that in a region other than the high luminance region, Gain A is 0 (zero) and the gain α is 0 (zero), so that the pixel value is not corrected. In the present embodiment, for example, the second term on the right side of the equations (2) to (4) is an example of the correction amount for the pixel value in the correction target region.
R1 = R0−α × Skin_R ′ (2)
G1 = G0−α × Skin_G ′ (3)
B1 = B0−α × Skin_B ′ (4)

以上のように本実施形態では、電子カメラ100は、撮影した画像に映る人物の顔の領域の輝度と色むらとを評価し、評価した輝度と色むらとに応じて、肌色の補色を補正し、補正した肌色の補色の値を高輝度領域の画素値から減算する。従って、環境光源により発生した色むらによって、テカリ補正が正しく動作しない場合を低減することができる。   As described above, in the present embodiment, the electronic camera 100 evaluates the luminance and color unevenness of the face area of the person shown in the captured image, and corrects the complementary color of the skin color according to the evaluated luminance and color unevenness. Then, the corrected complementary color value of the skin color is subtracted from the pixel value of the high luminance area. Accordingly, it is possible to reduce the case where the shine correction does not operate correctly due to the color unevenness generated by the environmental light source.

(第2の実施形態)
次に、第2の実施形態を説明する。
第1の実施形態では、人物の顔の領域に光源の照射むらがあると判断した場合に、肌色平均値から肌色の補色を算出し、当該肌色の補色に対する補正量を制限することで、テカリ補正による誤補正を低減する場合を例に挙げて説明した。これに対し、第2の実施形態では、人物の顔の領域に光源の照射むらがあると判断した場合、顔の高輝度領域および光源の照射むら領域を考慮して肌色の補色を算出する。このように本実施形態と第1の実施形態とでは、肌色の補色を算出する方法が主として異なる。従って、本実施形態の説明において、第1の実施形態と同一の部分については、図1〜図9に付した符号と同一の符号を付す等して詳細な説明を省略する。
(Second Embodiment)
Next, a second embodiment will be described.
In the first embodiment, when it is determined that there is uneven illumination of the light source in the face area of the person, the complementary color of the skin color is calculated from the average value of the skin color, and the correction amount for the complementary color of the skin color is limited. The case of reducing erroneous correction due to correction has been described as an example. In contrast, in the second embodiment, when it is determined that there is uneven illumination of the light source in the face area of the person, the complementary color of the skin color is calculated in consideration of the high brightness area of the face and the uneven illumination area of the light source. As described above, the present embodiment and the first embodiment mainly differ in the method of calculating the skin color complementary color. Therefore, in the description of the present embodiment, the same parts as those in the first embodiment are denoted by the same reference numerals as those in FIGS.

図10のフローチャートを参照しながら、テカリ補正処理の詳細の一例について説明する。
S1001〜S1006の処理は、第1の実施形態で説明した図6のS601〜S606と同じであるので、その詳細な説明は省略する。
S1007では、テカリ補正回路203は、S1006で算出した顔の領域の評価値s[n]、c[n]の均一度に基づいて、顔の領域に光源の照射むらがあるか否かを判定する。本実施形態では、第1の実施形態と同様に、テカリ補正回路203は、例えば、評価値c[n]またはs[n]の分散値を、評価値s[n]またはc[n]の均一度の一例として算出する。テカリ補正回路203は、例えば、評価値c[n]またはs[n]の分散値が閾値(例えば、図9(a)の閾値Th1_Y)より大きい場合に、顔の領域に光源の照射むらがあると判定し、そうでない場合に顔の領域に光源の照射むらがないと判定する。本実施形態では、評価値c[n]またはs[n]の均一度(分散値)が、色むらの度合いの評価値の一例である。
An example of details of the shine correction process will be described with reference to the flowchart of FIG.
Since the processing of S1001 to S1006 is the same as S601 to S606 of FIG. 6 described in the first embodiment, detailed description thereof is omitted.
In S1007, the shine correction circuit 203 determines whether or not there is uneven illumination of the light source in the face area based on the uniformity of the evaluation values s [n] and c [n] of the face area calculated in S1006. To do. In the present embodiment, as in the first embodiment, the shine correction circuit 203 converts, for example, the variance value of the evaluation value c [n] or s [n] into the evaluation value s [n] or c [n]. Calculated as an example of uniformity. For example, when the variance of the evaluation value c [n] or s [n] is larger than a threshold value (for example, the threshold value Th1_Y in FIG. 9A), the shine correction circuit 203 causes uneven illumination of the light source in the face area. If not, it is determined that there is no uneven illumination of the light source in the face area. In the present embodiment, the uniformity (dispersion value) of the evaluation value c [n] or s [n] is an example of the evaluation value of the degree of color unevenness.

S1007にて顔の領域に光源の照射むらがあると判定された場合、テカリ補正回路203は、高輝度領域の各ブロックの周辺の非高輝度領域の1つ以上のブロックの肌色の値を用いて、肌色評価値を導出する。このとき、テカリ補正回路203は、高輝度領域の周辺の非高輝度領域に色むら領域がある場合は、その色むら領域のブロックを除外して肌色評価値を導出する。テカリ補正回路203は、例えば、各ブロックの評価値s[n]、c[n]の分布(例えばヒストグラム)を導出し、この分布において、評価値s[n]、c[n]の代表値(例えば最頻値)から閾値以上離れているブロックを色むら領域とする。ここで、高輝度領域のブロックの周辺の非高輝度領域のブロックは、例えば、当該高輝度領域のブロックからの距離に応じて求められる。例えば、テカリ補正回路203は、非高輝度領域のブロックを高輝度領域のブロックからの距離が近いものから順に所定の数だけ抽出し、抽出した非高輝度領域のブロックを当該高輝度領域のブロックの周辺の非高輝度領域のブロックとする。   If it is determined in S1007 that the facial area has uneven illumination of the light source, the shine correction circuit 203 uses the skin color value of one or more blocks in the non-high brightness area around each block in the high brightness area. The skin color evaluation value is derived. At this time, if there is a color unevenness region in the non-high brightness region around the high brightness region, the shine correction circuit 203 derives a skin color evaluation value by excluding the block of the color unevenness region. The shine correction circuit 203 derives, for example, a distribution (for example, a histogram) of the evaluation values s [n] and c [n] of each block, and in this distribution, representative values of the evaluation values s [n] and c [n]. A block that is more than a threshold value away from (for example, the mode value) is defined as an uneven color region. Here, the non-high brightness area block around the high brightness area block is obtained, for example, according to the distance from the high brightness area block. For example, the shine correction circuit 203 extracts a predetermined number of blocks in the non-high brightness area in order from the shortest distance from the block in the high brightness area, and extracts the extracted non-high brightness area blocks in the block of the high brightness area. A block of a non-high brightness area around the.

そして、テカリ補正回路203は、高輝度領域の各ブロックの周辺の非高輝度領域の肌色評価値に基づいて、高輝度領域の各ブロックにおける肌色の補色を算出する(S1008)。本実施形態では、高輝度領域のブロックの周辺の非高輝度領域の1つ以上のブロックが、(顔の領域に光源の照射むらがある場合の)補正対象領域における画素値に対する補正量を導出するために用いる領域の一例である。   Then, the shine correction circuit 203 calculates a skin color complementary color in each block of the high luminance region based on the skin color evaluation value of the non-high luminance region around each block of the high luminance region (S1008). In this embodiment, one or more blocks in the non-high brightness area around the block in the high brightness area derive a correction amount for the pixel value in the correction target area (when there is uneven illumination of the light source in the face area). It is an example of the area | region used in order to do.

また、テカリ補正回路203は、前述の非発光画像データ701を用いて評価値s[n]の均一度を導出する場合、高輝度領域が陰影部かそれ以外の領域かを判断し、判断した領域に応じて肌色評価値を導出する。例えば、テカリ補正回路203は、本撮影の前に非発光画像データ701を取得し、非発光画像データ701において、顔の領域に陰影部があるか否かを判定する。この判定の結果、顔の領域に陰影部がある場合、テカリ補正回路203は、顔の領域を陰影部の領域とそれ以外の領域とに分割する。次に、テカリ補正回路203は、本撮影による画像データ(ストロボ発光画像データ702)を取得し、ストロボ発光画像データ702から高輝度領域の有無を判定する。高輝度領域が陰影部の領域にある場合、テカリ補正回路203は、陰影部に含まれるブロックのうち、高輝度領域のブロックの周辺の非高輝度領域の1つ以上のブロックにおける肌色の情報を用いて、当該高輝度領域のブロックにおける肌色評価値を算出する。   Further, when the shine correction circuit 203 derives the uniformity of the evaluation value s [n] using the non-light-emitting image data 701 described above, it is determined whether the high-luminance area is a shadow area or other area. A skin color evaluation value is derived according to the region. For example, the shine correction circuit 203 acquires the non-light emitting image data 701 before the main photographing, and determines whether or not there is a shadow portion in the face area in the non-light emitting image data 701. If the result of this determination is that there is a shadow in the face area, the shine correction circuit 203 divides the face area into a shadow area and other areas. Next, the shine correction circuit 203 acquires image data (strobe light emission image data 702) obtained by actual photographing, and determines the presence / absence of a high brightness area from the strobe light emission image data 702. When the high luminance area is in the shaded area, the shine correction circuit 203 obtains skin color information in one or more blocks in the non-high luminance area around the block in the high luminance area among the blocks included in the shadow area. The skin color evaluation value in the block of the high luminance area is calculated.

一方、高輝度領域が陰影部以外の領域にある場合、テカリ補正回路203は、以下のようにして高輝度領域の各ブロックにおける肌色評価値を算出する。即ち、テカリ補正回路203は、当該陰影部以外の領域に含まれるブロックのうち、高輝度領域のブロックの周辺の非高輝度領域の1つ以上のブロックにおける肌色の情報を用いて、当該高輝度領域のブロックにおける肌色評価値を算出する。このように本実施形態では、高輝度領域が、ストロボ光が支配的な領域(陰影部の領域)か、それ以外の領域かで、肌色評価値の取得領域を変更する。   On the other hand, when the high luminance region is in a region other than the shadow portion, the shine correction circuit 203 calculates the skin color evaluation value in each block of the high luminance region as follows. That is, the shine correction circuit 203 uses the skin color information in one or more blocks in the non-high brightness area around the block in the high brightness area among the blocks included in the area other than the shaded area, and uses the high brightness The skin color evaluation value in the block of the area is calculated. As described above, in the present embodiment, the skin color evaluation value acquisition area is changed depending on whether the high-luminance area is an area where the strobe light is dominant (a shaded area) or other areas.

高輝度領域のブロックにおける肌色評価値は、例えば、当該高輝度領域のブロックの周辺の非高輝度領域のブロックにおける肌色平均値である。高輝度領域のブロックの周辺の非高輝度領域のブロックの数が1つである場合には、当該非高輝度領域のブロックの肌色の値が、当該高輝度領域のブロックにおける肌色評価値になる。本実施形態では、高輝度領域のブロックの周辺の非高輝度領域のブロックにおける肌色平均値(または当該非高輝度領域のブロックの肌色の値)が、補正対象領域の周辺の領域における画素値の代表値の一例である。   The skin color evaluation value in the block of the high brightness area is, for example, the skin color average value in the block of the non-high brightness area around the block of the high brightness area. When the number of non-high brightness area blocks around the high brightness area block is one, the skin color value of the non-high brightness area block is the skin color evaluation value of the high brightness area block. . In the present embodiment, the skin color average value (or the skin color value of the non-high brightness area block) around the high brightness area block is the pixel value in the area around the correction target area. It is an example of a representative value.

一方、S1007にて顔の領域に光源の照射むらがないと判定された場合、テカリ補正回路203は、S1002で取得した肌色平均値をもとに各ブロックの肌色の補色を算出する(S1009)。本実施形態では、S1002で取得した肌色平均値が、顔の領域における画素値の代表値の一例である。また、本実施形態では、顔の領域のうち、目や口などの器官の領域を除いた領域の肌色平均値が算出される。従って、例えば、顔の領域のうち、目や口などの器官の領域を除いた領域が、(顔の領域に光源の照射むらがない場合の)補正対象領域における画素値に対する補正量を導出するために用いる領域の一例である。   On the other hand, if it is determined in S1007 that there is no uneven illumination of the light source in the face area, the shine correction circuit 203 calculates the complementary color of the skin color of each block based on the skin color average value acquired in S1002 (S1009). . In the present embodiment, the skin color average value acquired in S1002 is an example of a representative value of pixel values in the face area. Further, in the present embodiment, the skin color average value of the area excluding the areas of the organs such as the eyes and the mouth among the face areas is calculated. Accordingly, for example, a region excluding organ regions such as eyes and mouth among the facial regions derives a correction amount for the pixel value in the correction target region (in the case where there is no uneven illumination of the light source in the facial region). This is an example of a region used for the purpose.

次に、S1010において、テカリ補正回路203は、S1001で取得した顔輝度情報に基づいて補正ゲイン(GainA)を算出する(図9(a)を参照)。そして、テカリ補正回路203は、S1008またはS1009で算出した肌色の補色(Skin_R´、Skin_G´、Skin_B´)に、補正ゲイン(GainA)を乗算した値を算出する(S1010)。この値が、高輝度領域(テカリ補正の対象の領域)の各ブロックに対するテカリの補正量となる。
次に、S1011において、テカリ補正回路203は、S1010で算出した補正量を、高輝度領域(テカリの補正対象領域)の画素値から減算することで肌色を再現する。
以上のようにしても第1の実施形態で説明した効果と同様の効果を得ることができる。
Next, in S1010, the shine correction circuit 203 calculates a correction gain (Gain A) based on the face luminance information acquired in S1001 (see FIG. 9A). Then, the shine correction circuit 203 calculates a value obtained by multiplying the complementary color (Skin_R ′, Skin_G ′, Skin_B ′) of skin color calculated in S1008 or S1009 by a correction gain (GainA) (S1010). This value is the amount of shine correction for each block in the high luminance region (region for shine correction).
Next, in S1011, the shine correction circuit 203 reproduces the skin color by subtracting the correction amount calculated in S1010 from the pixel value of the high luminance region (the shine correction target region).
Even if it does as mentioned above, the effect similar to the effect demonstrated in 1st Embodiment can be acquired.

尚、前述した実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。   The above-described embodiments are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed in a limited manner. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.

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

100:電子カメラ、105:画像処理部、203:テカリ補正回路   100: electronic camera, 105: image processing unit, 203: shine correction circuit

Claims (15)

撮像手段で撮像された画像に含まれる人物の顔の領域のうち、輝度が閾値よりも高い領域を補正対象領域として、当該補正対象領域の画素値を補正する処理を含む画像処理を行う画像処理装置であって、
前記顔の領域のうち少なくとも前記補正対象領域における色むらの度合いの評価値を取得する取得手段と、
前記補正対象領域における色むらの度合いの評価値に基づいて、前記補正対象領域における画素値に対する補正量を決定する決定手段と、を有することを特徴とする画像処理装置。
Image processing for performing image processing including processing for correcting a pixel value of the correction target region, using a region whose luminance is higher than a threshold as a correction target region among human face regions included in the image captured by the imaging unit A device,
Obtaining means for obtaining an evaluation value of the degree of color unevenness in at least the correction target region of the face region;
An image processing apparatus comprising: a determination unit that determines a correction amount for a pixel value in the correction target region based on an evaluation value of a degree of color unevenness in the correction target region.
前記決定手段は、前記補正対象領域における色むらの度合いの評価値と、前記補正対象領域における輝度とに基づいて、前記補正対象領域における画素値に対する補正量を導出することを特徴とする請求項1に記載の画像処理装置。   The determination means derives a correction amount for a pixel value in the correction target region based on an evaluation value of a degree of color unevenness in the correction target region and a luminance in the correction target region. The image processing apparatus according to 1. 前記決定手段は、前記顔の領域における画素値の代表値に基づいて前記補正対象領域における肌色の補色を導出すると共に、前記補正対象領域における色むらの度合いの評価値と、前記補正対象領域における輝度とに基づいて、前記補正対象領域における肌色の補色を補正するためのゲインを導出し、前記補正対象領域における肌色の補色と、前記ゲインとに基づいて、前記補正対象領域における画素値に対する補正量を導出することを特徴とする請求項2に記載の画像処理装置。   The determination means derives a skin color complementary color in the correction target region based on a representative value of the pixel value in the face region, and evaluates the degree of color unevenness in the correction target region, and the correction target region Based on the luminance, a gain for correcting the complementary color of the skin color in the correction target region is derived, and the correction for the pixel value in the correction target region based on the complementary color of the skin color in the correction target region and the gain The image processing apparatus according to claim 2, wherein an amount is derived. 前記決定手段は、前記補正対象領域における色むらの度合いの評価値に応じて、前記顔の領域から、前記補正対象領域における画素値に対する補正量を導出するために用いる領域を決定し、当該決定した領域における画素値に基づいて、前記補正対象領域における画素値に対する補正量を導出することを特徴とする請求項1または2に記載の画像処理装置。   The determining unit determines an area to be used for deriving a correction amount for the pixel value in the correction target area from the face area in accordance with an evaluation value of the degree of color unevenness in the correction target area. The image processing apparatus according to claim 1, wherein a correction amount for a pixel value in the correction target area is derived based on a pixel value in the corrected area. 前記決定手段は、前記補正対象領域における画素値に対する補正量を導出するために用いる領域における肌色の代表値に基づいて、前記補正対象領域における肌色の補色を導出すると共に、前記補正対象領域における輝度に基づいて、前記補正対象領域における肌色の補色を補正するためのゲインを導出し、前記補正対象領域における肌色の補色と、前記ゲインとに基づいて、前記補正対象領域における画素値に対する補正量を導出することを特徴とする請求項4に記載の画像処理装置。   The determination means derives a complementary color of the skin color in the correction target region based on a representative value of the skin color in the region used for deriving a correction amount for the pixel value in the correction target region, and brightness in the correction target region Based on the above, a gain for correcting the complementary color of the skin color in the correction target region is derived, and based on the complementary color of the skin color in the correction target region and the gain, a correction amount for the pixel value in the correction target region is calculated. The image processing apparatus according to claim 4, wherein the image processing apparatus is derived. 前記決定手段は、前記補正対象領域における色むらの度合いの評価値に基づいて、前記顔の領域に光源の照射むらがあるか否かを判定し、
前記顔の領域に光源の照射むらがある場合の、前記補正対象領域における画素値に対する補正量を導出するために用いる領域は、当該補正対象領域の周辺の領域であり、
前記顔の領域に光源の照射むらがない場合の、前記補正対象領域における画素値に対する補正量を導出するために用いる領域は、前記顔の領域であることを特徴とする請求項5に記載の画像処理装置。
The determining means determines whether or not there is uneven illumination of a light source in the face area based on an evaluation value of the degree of uneven color in the correction target area,
When there is uneven illumination of the light source in the face area, the area used to derive the correction amount for the pixel value in the correction target area is an area around the correction target area,
6. The area used for deriving a correction amount for a pixel value in the correction target area when there is no uneven illumination of a light source in the face area is the face area. Image processing device.
前記画素値の代表値を導出する導出手段を更に有することを特徴とする請求項3〜6の何れか1項に記載の画像処理装置。   The image processing apparatus according to claim 3, further comprising a derivation unit that derives a representative value of the pixel value. 前記取得手段は、前記顔の領域を複数に分割した分割領域ごとに、前記顔の領域のうち少なくとも前記補正対象領域における色むらの度合いの評価値を取得し、
前記決定手段は、前記分割領域ごとに、前記補正対象領域における画素値に対する補正量を決定することを特徴とする請求項1〜7の何れか1項に記載の画像処理装置。
The acquisition means acquires an evaluation value of the degree of color unevenness in at least the correction target region of the face region for each divided region obtained by dividing the face region into a plurality of regions,
The image processing apparatus according to claim 1, wherein the determining unit determines a correction amount for a pixel value in the correction target region for each of the divided regions.
前記取得手段は、前記色むらの度合いの評価値として、前記顔の領域における色の均一度を取得することを特徴とする請求項1〜8の何れか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the obtaining unit obtains a color uniformity in the face area as an evaluation value of the degree of color unevenness. 前記取得手段は、前記画像に基づいて、前記色むらの度合いの評価値を導出することを特徴とする請求項1〜9の何れか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the acquisition unit derives an evaluation value of the degree of color unevenness based on the image. 前記取得手段は、ストロボ光を発光して前記撮像手段による撮像が行われた場合の前記色むらの度合いの評価値として、前記顔の領域における前記ストロボ光の照射量の均一度を取得することを特徴とする請求項1〜10の何れか1項に記載の画像処理装置。   The acquisition unit acquires the uniformity of the amount of stroboscopic light irradiation in the face area as an evaluation value of the degree of color unevenness when the stroboscopic light is emitted and the imaging unit performs imaging. The image processing apparatus according to claim 1, wherein: 前記取得手段は、ストロボ光を発光して前記撮像手段による撮像が行われた場合の前記色むらの度合いの評価値として、前記顔の領域における陰影の度合いを取得することを特徴とする請求項1〜11の何れか1項に記載の画像処理装置。   The acquisition unit is configured to acquire a degree of shading in the face area as an evaluation value of the degree of color unevenness when the strobe light is emitted and the imaging unit performs imaging. The image processing apparatus according to any one of 1 to 11. 前記取得手段は、前記ストロボ光を発光して前記撮像手段により撮像された前記画像と、前記ストロボ光を発光せずに前記撮像手段により撮像された画像とに基づいて、前記色むらの度合いの評価値を導出することを特徴とする請求項11または12に記載の画像処理装置。   The obtaining means emits the strobe light and captures the degree of color unevenness based on the image captured by the imaging means and the image captured by the image capturing means without emitting the strobe light. The image processing apparatus according to claim 11, wherein an evaluation value is derived. 撮像手段で撮像された画像に含まれる人物の顔の領域のうち、輝度が閾値よりも高い領域を補正対象領域として、当該補正対象領域の画素値を補正する処理を含む画像処理を行う画像処理方法であって、
前記顔の領域のうち少なくとも前記補正対象領域における色むらの度合いの評価値を取得する取得工程と、
前記補正対象領域における色むらの度合いの評価値に基づいて、前記補正対象領域における画素値に対する補正量を決定する決定工程と、を有することを特徴とする画像処理方法。
Image processing for performing image processing including processing for correcting a pixel value of the correction target region, using a region whose luminance is higher than a threshold as a correction target region among human face regions included in the image captured by the imaging unit A method,
An acquisition step of acquiring an evaluation value of the degree of color unevenness in at least the correction target region of the face region;
And a determination step of determining a correction amount for the pixel value in the correction target area based on an evaluation value of the degree of color unevenness in the correction target area.
請求項1〜13の何れか1項に記載の画像処理装置の各手段としてコンピュータを機能させることを特徴とするプログラム。   A program that causes a computer to function as each unit of the image processing apparatus according to claim 1.
JP2016234832A 2016-12-02 2016-12-02 Image processing apparatus, image processing method, and program Pending JP2018092350A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2016234832A JP2018092350A (en) 2016-12-02 2016-12-02 Image processing apparatus, image processing method, and program
JP2021081602A JP7129520B2 (en) 2016-12-02 2021-05-13 Image processing device, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016234832A JP2018092350A (en) 2016-12-02 2016-12-02 Image processing apparatus, image processing method, and program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2021081602A Division JP7129520B2 (en) 2016-12-02 2021-05-13 Image processing device, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2018092350A true JP2018092350A (en) 2018-06-14
JP2018092350A5 JP2018092350A5 (en) 2020-01-16

Family

ID=62564695

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2016234832A Pending JP2018092350A (en) 2016-12-02 2016-12-02 Image processing apparatus, image processing method, and program
JP2021081602A Active JP7129520B2 (en) 2016-12-02 2021-05-13 Image processing device, image processing method, and program

Family Applications After (1)

Application Number Title Priority Date Filing Date
JP2021081602A Active JP7129520B2 (en) 2016-12-02 2021-05-13 Image processing device, image processing method, and program

Country Status (1)

Country Link
JP (2) JP2018092350A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113221618A (en) * 2021-01-28 2021-08-06 深圳市雄帝科技股份有限公司 Method, system and storage medium for removing highlight of face image
JP2021128791A (en) * 2016-12-02 2021-09-02 キヤノン株式会社 Image processing apparatus, image processing method, and program
CN114902659A (en) * 2019-12-27 2022-08-12 株式会社索思未来 Image processing apparatus, image processing method, and program

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4983962B2 (en) 2009-07-23 2012-07-25 カシオ計算機株式会社 Image processing apparatus, image processing method, and image processing program
JP5743696B2 (en) 2011-05-06 2015-07-01 キヤノン株式会社 Image processing apparatus, image processing method, and program
JP2013161348A (en) 2012-02-07 2013-08-19 Nikon Corp Image correction device, method, program, and recording medium
JP2015094991A (en) 2013-11-08 2015-05-18 株式会社ニコン Image processing device, imaging device and image processing program
JP2018092350A (en) 2016-12-02 2018-06-14 キヤノン株式会社 Image processing apparatus, image processing method, and program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021128791A (en) * 2016-12-02 2021-09-02 キヤノン株式会社 Image processing apparatus, image processing method, and program
JP7129520B2 (en) 2016-12-02 2022-09-01 キヤノン株式会社 Image processing device, image processing method, and program
CN114902659A (en) * 2019-12-27 2022-08-12 株式会社索思未来 Image processing apparatus, image processing method, and program
CN114902659B (en) * 2019-12-27 2023-08-15 株式会社索思未来 Image processing apparatus and image processing method
CN113221618A (en) * 2021-01-28 2021-08-06 深圳市雄帝科技股份有限公司 Method, system and storage medium for removing highlight of face image
CN113221618B (en) * 2021-01-28 2023-10-17 深圳市雄帝科技股份有限公司 Face image highlight removing method, system and storage medium thereof

Also Published As

Publication number Publication date
JP2021128791A (en) 2021-09-02
JP7129520B2 (en) 2022-09-01

Similar Documents

Publication Publication Date Title
US10397486B2 (en) Image capture apparatus and method executed by image capture apparatus
US9681026B2 (en) System and method for lens shading compensation
US10861136B2 (en) Image processing apparatus, image processing method, and storage medium
RU2491760C2 (en) Image processing device, image processing method and programme
WO2019072190A1 (en) Image processing method, electronic apparatus, and computer readable storage medium
JP2006352795A (en) Imaging apparatus and image processing method
JP7129520B2 (en) Image processing device, image processing method, and program
JP6381404B2 (en) Image processing apparatus and method, and imaging apparatus
JP2012235377A (en) Image processing apparatus, image processing method, and program
JP6412386B2 (en) Image processing apparatus, control method therefor, program, and recording medium
US11889202B2 (en) Image processing apparatus, image processing method, and storage medium
JP6904788B2 (en) Image processing equipment, image processing methods, and programs
US10977777B2 (en) Image processing apparatus, method for controlling the same, and recording medium
JP2018107741A (en) Image processing system, image processing method, and program
JP2018093359A (en) Image processing apparatus, image processing method, and program
JP2017147535A (en) White balance adjustment device, white balance adjustment method, white balance adjustment program, and photographing device
US10021314B2 (en) Image processing apparatus, image capturing apparatus, method of controlling the same, and storage medium for changing shading using a virtual light source
JP6570311B2 (en) Image processing apparatus and image processing method
JP2015119436A (en) Imaging apparatus
JP2013132065A (en) Imaging apparatus and flash control method
JP2017151562A (en) Image processing device, imaging device, control method and program therefor
JP6849351B2 (en) Image processing equipment, image processing methods, and programs
JP6616674B2 (en) Image processing apparatus and method, and imaging apparatus
JP2019003694A (en) Image processing apparatus, control method of the same, and program
JP2021175036A (en) Image processing apparatus and method, program, and storage medium

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191129

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20191129

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200929

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20201119

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20210216