[go: up one dir, main page]

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

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

Info

Publication number
JP2018151766A
JP2018151766A JP2017046346A JP2017046346A JP2018151766A JP 2018151766 A JP2018151766 A JP 2018151766A JP 2017046346 A JP2017046346 A JP 2017046346A JP 2017046346 A JP2017046346 A JP 2017046346A JP 2018151766 A JP2018151766 A JP 2018151766A
Authority
JP
Japan
Prior art keywords
color
saturation level
image
signal
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.)
Pending
Application number
JP2017046346A
Other languages
Japanese (ja)
Inventor
淳 ▲高▼木
淳 ▲高▼木
Atsushi Takagi
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 JP2017046346A priority Critical patent/JP2018151766A/en
Publication of JP2018151766A publication Critical patent/JP2018151766A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To achieve such a natural correction that color drift is not brought about.SOLUTION: A face detection unit (113) detects a face image from a captured image or the like as an image region of a prescribed subject. An image processing unit (105) detects regions having high brightness from the face image being the image region of the subject and further determines saturation levels of the regions with high brightness on the basis of values of a plurality of color signals in the regions having high brightness and performs a correction corresponding to the saturation levels, on regions having high brightness in which at least one of the plurality of color signals is saturated.SELECTED DRAWING: Figure 1

Description

本発明は、撮像等された画像を処理する画像処理装置、画像処理方法、プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program for processing captured images.

従来、デジタルカメラ等の撮像装置においては、被写体等からの入射光の光量を、カメラ内の絞りの調整やシャッター速度の調整等により制御することで、適正な露出の撮影画像を取得する。しかし、例えば人物が撮影された画像において、最適な露出制御を行い撮影したとしても、環境光源やストロボ光の影響等により、顔領域にテカリが発生してしまう場合がある。テカリとは、環境光源やストロボ光が被写体人物の肌の表面で反射し、撮像装置が取り込んだ入力信号値が飽和して色情報が失われ、肌の一部が白く撮像されてしまう(白く飛んでしまう)現象である。肌色の領域の中にテカリが生じて局所的に高輝度になった部分が存在すると、人物画像として好ましくない印象を与えてしまう。このため、入力信号値が飽和している飽和領域(テカリが生じている領域)がある画像に対して、その飽和を補正してテカリを軽減するような補正技術が要求されている。   2. Description of the Related Art Conventionally, in an imaging apparatus such as a digital camera, a photographed image with an appropriate exposure is acquired by controlling the amount of incident light from a subject or the like by adjusting an aperture in the camera or adjusting a shutter speed. However, even if, for example, an image of a person photographed with optimal exposure control is taken, there is a case where shininess occurs in the face area due to the influence of an environmental light source or strobe light. With shine, the environment light source or strobe light is reflected on the skin surface of the subject person, the input signal value captured by the imaging device is saturated, color information is lost, and part of the skin is imaged white (whitening (Flying) phenomenon. If there is a part in which the shine is generated in the skin color region and the brightness is locally high, an unpleasant impression is given as a human image. For this reason, there is a demand for a correction technique that reduces saturation by correcting the saturation of an image having a saturated region (region where shine occurs) where the input signal value is saturated.

このような要求に対して、入力された画像信号を、輝度信号と色度信号に分離し、輝度信号を増減させることで、色バランスを崩さずに画像の明暗を調整する技術が提案されている。例えば、特許文献1には、表示デバイスの視覚特性に対し入力画像から算出した色飽和信号に対する制限値を適用して、各色信号を補正する際のゲイン量を決定し、そのゲイン量を基に各色信号を補正することで、テカリを軽減する技術が開示されている。   In response to such demands, a technique has been proposed in which an input image signal is separated into a luminance signal and a chromaticity signal, and the luminance signal is increased or decreased to adjust the contrast of the image without losing the color balance. Yes. For example, in Patent Document 1, a limit value for a color saturation signal calculated from an input image is applied to visual characteristics of a display device, a gain amount for correcting each color signal is determined, and the gain amount is based on the gain amount. A technique for reducing shine by correcting each color signal is disclosed.

特開2007−312349号公報JP 2007-31349 A

ここで、一般的なデジタルカメラでは、CCDやCMOSイメージセンサ等の撮像素子から、例えばR(赤),G(緑),B(青)の各色信号がアナログ信号の状態で出力される。この場合、飽和領域(テカリ領域)の状態としては、R信号とG信号とB信号の全ての色信号が飽和してしまう全飽和状態と、一部の色信号のみが飽和してしまう部分飽和状態とが考えられる。一例として、飽和領域の状態が、例えばR信号とB信号とが飽和した部分飽和状態である場合、飽和領域の色は明るい黄色になってしまい、本来の色からずれた不自然な状態(いわゆる色曲がりが生じた状態)になる。このように飽和領域が部分飽和状態になっている場合、前述した特許文献1に記載の技術のように入力輝度信号によって色補正処理を行うだけでは、色ずれは補正されず、色曲がりが残った不自然な画像となる。   Here, in a general digital camera, for example, R (red), G (green), and B (blue) color signals are output in an analog signal state from an image sensor such as a CCD or a CMOS image sensor. In this case, as the state of the saturation region (the shining region), the full saturation state in which all color signals of the R signal, the G signal, and the B signal are saturated, and the partial saturation in which only some of the color signals are saturated. State. As an example, when the state of the saturation region is a partial saturation state in which, for example, the R signal and the B signal are saturated, the color of the saturation region becomes bright yellow, which is an unnatural state (so-called shift from the original color) Color bending occurs). When the saturation region is in a partially saturated state in this way, color misregistration is not corrected and color distortion remains only by performing color correction processing using the input luminance signal as in the technique described in Patent Document 1 described above. The image becomes unnatural.

そこで本発明は、色ずれを生じさせない自然な補正を実現可能にすることを目的とする。   Accordingly, an object of the present invention is to enable natural correction without causing color misregistration.

本発明は、入力された画像から所定の被写体の画像領域を検出する検出手段と、前記被写体の画像領域から高輝度領域を抽出する抽出手段と、前記高輝度領域の色を決める複数の色信号の値を基に、前記高輝度領域の飽和レベルを決定する決定手段と、前記複数の色信号の少なくとも一つの色信号が飽和した前記高輝度領域に対し、前記決定された飽和レベルに応じた補正を行う補正手段と、を有することを特徴とする。   The present invention provides a detection means for detecting an image area of a predetermined subject from an input image, an extraction means for extracting a high brightness area from the image area of the subject, and a plurality of color signals for determining the color of the high brightness area And determining means for determining a saturation level of the high luminance region based on the value of the high luminance region corresponding to the determined saturation level for the high luminance region in which at least one color signal of the plurality of color signals is saturated. Correction means for performing correction.

本発明によれば、色ずれが生じない、自然な補正を実現可能となる。   According to the present invention, it is possible to realize natural correction without causing color misregistration.

本実施形態のデジタルカメラの概略構成例を示す図である。It is a figure which shows the schematic structural example of the digital camera of this embodiment. 画像処理部の詳細な構成例を示す図である。It is a figure which shows the detailed structural example of an image process part. 顔領域を検出してテカリ補正を行うまでの処理のフローチャートである。It is a flowchart of a process until it detects a face area | region and performs shine correction. 検出される顔領域の説明に用いる図である。It is a figure used for description of the detected face area. テカリ補正処理のフローチャートである。It is a flowchart of a shine correction process. テカリ領域の飽和レベルの説明に用いる図である。It is a figure used for description of the saturation level of a shine area. R,G,Bの各色の入力に対する出力信号を示す図である。It is a figure which shows the output signal with respect to the input of each color of R, G, B. テカリ補正前後のR,G,Bの各色の入出力信号を示す図である。It is a figure which shows the input / output signal of each color of R, G, B before and after a shine correction. テカリ補正前後のR,G,Bの各色信号値の対応関係を示す図である。It is a figure which shows the correspondence of each color signal value of R, G, B before and after a shine correction.

以下に、本発明の好ましい実施形態について、添付の図面に基づいて詳細に説明する。
本発明の画像処理装置は、デジタルスチルカメラやデジタルビデオカメラ、デジタルカメラ機能を備えたスマートフォンやタブレット端末、パーソナルコンピュータ等の各種情報端末、工業用カメラ、車載カメラ、医療用カメラなどの各種カメラに適用可能である。本実施形態では、本発明の画像処理装置をデジタルスチルカメラ(以下、単にデジタルカメラと呼ぶ。)に適用した例を挙げて説明する。
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The image processing apparatus of the present invention is applied to various cameras such as digital still cameras, digital video cameras, smartphones and tablet terminals having digital camera functions, various information terminals such as personal computers, industrial cameras, in-vehicle cameras, and medical cameras. Applicable. In the present embodiment, an example in which the image processing apparatus of the present invention is applied to a digital still camera (hereinafter simply referred to as a digital camera) will be described.

図1は、本実施形態のデジタルカメラ100の構成例を示すブロック図である。
レンズ群101は、フォーカスレンズを含むズームレンズである。シャッター102は、絞り機能を備え、システム制御部50による制御の下、撮像部103が備えている撮像素子への入射光量と露光時間を調整する。撮像部103は、レンズ群101を介して撮像素子の撮像面上に形成された光学像を光電変換により電気信号に変換してアナログ画像信号を出力する。撮像部103の撮像素子は、CCDイメージセンサ又はCMOSイメージセンサである。撮像素子の撮像面の前には、三原色のR(赤),G(緑),B(青)の各色成分に対応したカラーフィルタがいわゆるベイヤー配列と呼ばれる配列で画素毎に設けられている。このため、撮像部103からは、ベイヤー配列に対応したR,G,Bの各画素の色信号からなるアナログ画像信号が出力される。A/D変換部104は、撮像部103から出力されたアナログ画像信号をデジタル画像データに変換し、その画像データを画像処理部105に出力する。
FIG. 1 is a block diagram illustrating a configuration example of a digital camera 100 according to the present embodiment.
The lens group 101 is a zoom lens including a focus lens. The shutter 102 has a diaphragm function, and adjusts the amount of light incident on the image sensor provided in the imaging unit 103 and the exposure time under the control of the system control unit 50. The imaging unit 103 converts an optical image formed on the imaging surface of the imaging element via the lens group 101 into an electrical signal by photoelectric conversion, and outputs an analog image signal. The imaging device of the imaging unit 103 is a CCD image sensor or a CMOS image sensor. In front of the imaging surface of the imaging device, color filters corresponding to the respective color components of the three primary colors R (red), G (green), and B (blue) are provided for each pixel in an arrangement called a Bayer arrangement. For this reason, the imaging unit 103 outputs an analog image signal composed of color signals of R, G, and B pixels corresponding to the Bayer array. The A / D conversion unit 104 converts the analog image signal output from the imaging unit 103 into digital image data, and outputs the image data to the image processing unit 105.

画像処理部105は、撮像部103により撮像されてA/D変換部104から出力された画像データ、又はメモリ制御部107がメモリ106から読み出した画像データに対して、ホワイトバランス調整、γ(ガンマ)補正などの各種画像処理を行う。また、画像処理部105は、顔検出部113による顔検出結果や撮像した画像データを用いて所定の評価値算出処理を行う。ここでの所定の評価値算出処理により得られる算出値は、露光制御、測距制御に用いられる評価値として、システム制御部50に送られる。この場合、システム制御部50は、その評価値に基づいて露光制御、測距制御を行い、これによりTTL(スルー・ザ・レンズ)方式のAF(オートフォーカス)処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理などが行われる。また、画像処理部105は、撮像された画像の中に、色信号値が飽和して色情報が失われたテカリ領域が存在する場合、そのテカリ領域に対するテカリ補正処理をも行う。画像処理部105にて行われるテカリ補正処理の詳細については後述する。   The image processing unit 105 performs white balance adjustment, γ (gamma) on the image data captured by the imaging unit 103 and output from the A / D conversion unit 104 or the image data read from the memory 106 by the memory control unit 107. ) Perform various image processing such as correction. Further, the image processing unit 105 performs a predetermined evaluation value calculation process using the face detection result by the face detection unit 113 and the captured image data. The calculated value obtained by the predetermined evaluation value calculation process here is sent to the system control unit 50 as an evaluation value used for exposure control and distance measurement control. In this case, the system control unit 50 performs exposure control and distance measurement control based on the evaluation value, thereby TTL (through-the-lens) AF (autofocus) processing, AE (automatic exposure) processing, AWB (auto white balance) processing or the like is performed. Further, when there is a shine area in which the color signal value is saturated and the color information is lost in the captured image, the image processing unit 105 also performs a shine correction process on the shine area. Details of the shine correction processing performed by the image processing unit 105 will be described later.

コーデック部110は、画像データを圧縮符号化・復号化する。コーデック部110は、メモリ106に記録された画像データを例えばMPEGなどの規格に準拠した形式で符号化または復号化する。   The codec unit 110 compresses and decodes image data. The codec unit 110 encodes or decodes the image data recorded in the memory 106 in a format compliant with a standard such as MPEG.

顔検出部113は、撮像部103にて撮像されてA/D変換部104から出力された画像データ、又はメモリ制御部107がメモリ106から読み出した画像データに対し、所定の画像解析処理を行うことで、画像内から人の顔が映っている領域を検出する。顔検出部113により検出された顔検出結果のデータは、メモリ制御部107を介して、メモリ106に一時的に記憶され、また必要に応じてメモリ106から読み出されて画像処理部105に送られる。   The face detection unit 113 performs predetermined image analysis processing on image data captured by the imaging unit 103 and output from the A / D conversion unit 104 or image data read out from the memory 106 by the memory control unit 107. Thus, an area where a human face is reflected is detected from the image. The data of the face detection result detected by the face detection unit 113 is temporarily stored in the memory 106 via the memory control unit 107, and read out from the memory 106 as necessary and sent to the image processing unit 105. It is done.

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

表示部109は、LCD(液晶ディスプレイ)等の表示装置を有し、撮影された画像、記録媒体112から読み出された画像、いわゆるライブビュー表示の際に撮像部103にて撮像されているライブビュー画像等を表示する。また、表示部109には、デジタルカメラ100をユーザが操作等する際のユーザインターフェース画像も表示される。操作部120は、上述したユーザインターフェース画像を表示するタッチパネル、ボタンやスイッチを含み、ユーザによる操作を検知し、その検知した操作情報をシステム制御部50に通知する。   The display unit 109 has a display device such as an LCD (Liquid Crystal Display), and the captured image, the image read from the recording medium 112, live captured by the imaging unit 103 during the so-called live view display. View images etc. The display unit 109 also displays a user interface image when the user operates the digital camera 100. The operation unit 120 includes a touch panel that displays the above-described user interface image, buttons, and switches, detects an operation by the user, and notifies the system control unit 50 of the detected operation information.

システム制御部50は、CPU又はMPUを含み、不揮発性メモリ121に記憶されているプログラムをシステムメモリ122の作業領域に展開することにより実行して、本実施形態のデジタルカメラ100全体の各機能を制御する。不揮発性メモリ121は、補助記憶装置として、プログラムやパラメータなどを格納するEEPROMなどの不揮発性の半導体メモリを含む。システムメモリ122は、主記憶装置として、不揮発性メモリ121から読み出したプログラム等を展開する他、システム制御部50の動作用の定数、変数を記憶する。記録媒体I/F111は、例えば半導体メモリカードやカード型ハードディスク等の着脱可能な記録媒体112を、デジタルカメラ100と機械的及び電気的に接続する。   The system control unit 50 includes a CPU or MPU and executes a program stored in the non-volatile memory 121 by expanding it in the work area of the system memory 122, thereby performing each function of the entire digital camera 100 of the present embodiment. Control. The nonvolatile memory 121 includes a nonvolatile semiconductor memory such as an EEPROM that stores programs, parameters, and the like as an auxiliary storage device. The system memory 122 develops a program read from the nonvolatile memory 121 as a main storage device, and stores constants and variables for operation of the system control unit 50. The recording medium I / F 111 mechanically and electrically connects a detachable recording medium 112 such as a semiconductor memory card or a card type hard disk to the digital camera 100.

以下、画像処理部105の詳細な構成と、画像処理部105にて行われる画像処理の詳細について図2を参照しながら説明する。
画像処理部105の画像信号生成部201は、撮像部103にて撮像されてA/D変換部104から出力された画像データが入力される。この画像データは、前述したようにベイヤー配列で構成されたR,G,Bの各色の信号からなる。画像信号生成部201は、ベイヤー配列に対応したR,G,Bの各色の画像データに対して同時化処理を行って、1画素あたりR,G,Bの各色を含む画像データを生成する。画像信号生成部201は、同時化処理で生成した画像データをホワイトバランス制御部202(以下、WB制御部202とする。)に出力する。
Hereinafter, a detailed configuration of the image processing unit 105 and details of the image processing performed by the image processing unit 105 will be described with reference to FIG.
The image signal generation unit 201 of the image processing unit 105 receives image data captured by the imaging unit 103 and output from the A / D conversion unit 104. This image data is made up of R, G, and B color signals configured in a Bayer array as described above. The image signal generation unit 201 performs synchronization processing on the image data of each color of R, G, and B corresponding to the Bayer array, and generates image data including each color of R, G, and B per pixel. The image signal generation unit 201 outputs the image data generated by the synchronization processing to the white balance control unit 202 (hereinafter referred to as the WB control unit 202).

WB制御部202は、画像信号生成部201により出力された画像データを基にホワイトバランス補正値(以下、WB補正値とする。)を算出する。そして、WB制御部202は、算出したWB補正値を用いて、画像データのホワイトバランスを補正する。   The WB control unit 202 calculates a white balance correction value (hereinafter referred to as a WB correction value) based on the image data 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.

テカリ補正回路203は、WB制御部202によってホワイトバランス補正された画像データを基にテカリ補正処理を行う。このテカリ補正回路203のテカリ補正処理の詳細については後述する。テカリ補正回路203によるテカリ補正後の画像データは、色変換マトリックス回路204とY生成回路211に送られる。   The shine correction circuit 203 performs the shine correction process based on the image data that has been white balance corrected by the WB control unit 202. Details of the shine correction processing of the shine correction circuit 203 will be described later. The image data that has been corrected by the shine correction circuit 203 is sent to the color conversion matrix circuit 204 and the Y generation circuit 211.

色変換マトリックス回路204(以下、色変換MTX回路204とする。)は、テカリ補正回路203によるテカリ補正後の画像データが最適な色で再現されるように色ゲインを乗じた後、二つの色差データR−Y,B−Yに変換する。色変換MTX回路204から出力された二つの色差データR−Y,B−Yは、ローパスフィルタ(LPF)回路205(以下、LPF回路205とする。)に送られる。LPF回路205は、色差データR−Y、B−Yの帯域を制限し、その帯域制限後の色差データR−Y,B−YをCSUP回路206に出力する。CSUP(Chroma Supress)回路206は、LPF回路205で帯域制限された色差データR−Y,B−Yの飽和部分の偽色信号を抑圧する処理を行う。このCSUP回路206による偽色信号抑圧後の色差データR−Y、B−YはRGB変換回路207に出力される。   A color conversion matrix circuit 204 (hereinafter referred to as a color conversion MTX circuit 204) multiplies the color gain so that the image data after the shine correction by the shine correction circuit 203 is reproduced with an optimum color, and then the two color differences. Data is converted into RY and BY. The two color difference data RY and BY output from the color conversion MTX circuit 204 are sent to a low-pass filter (LPF) circuit 205 (hereinafter referred to as an LPF circuit 205). The LPF circuit 205 limits the band of the color difference data RY and BY, and outputs the color difference data RY and BY after the band limitation to the CSUP circuit 206. A CSUP (Chroma Suppress) circuit 206 performs a process of suppressing a false color signal in a saturated portion of the color difference data RY and BY that is band-limited by the LPF circuit 205. The color difference data RY and BY after the false color signal suppression by the CSUP circuit 206 is output to the RGB conversion circuit 207.

Y生成回路211は、テカリ補正回路203によるテカリ補正後の画像データから輝度データYを生成する。Y生成回路211にて生成された輝度データYはエッジ強調回路212に送られる。エッジ強調回路212は、輝度データYに対してエッジ強調処理を行い、その処理後の輝度データYをRGB変換回路207に出力する。   The Y generation circuit 211 generates luminance data Y from the image data after the shine correction by the shine correction circuit 203. The luminance data Y generated by the Y generation circuit 211 is sent to the edge enhancement circuit 212. The edge enhancement circuit 212 performs edge enhancement processing on the luminance data Y, and outputs the luminance data Y after the processing to the RGB conversion circuit 207.

RGB変換回路207は、CSUP回路206から出力された色差データR−Y,B−Yと、エッジ強調回路212から出力される輝度データYとから、RGBデータを生成するRGB変換処理を行う。RGB変換回路207から出力されたRGBデータは、γ補正回路208に送られる。γ補正回路208は、RGBデータに対し、予め定められたγ特性に従った階調補正処理(γ補正処理)を行う。γ補正回路208によりγ補正処理されたRGBデータは、色輝度変換回路209によってYUVデータに変換された後、JPEG圧縮回路210にて圧縮符号化される。この圧縮符号化された画像データは、その後、図1の記録媒体112に画像データファイルとして記録される。   The RGB conversion circuit 207 performs RGB conversion processing for generating RGB data from the color difference data RY and BY output from the CSUP circuit 206 and the luminance data Y output from the edge enhancement circuit 212. The RGB data output from the RGB conversion circuit 207 is sent to the γ correction circuit 208. The γ correction circuit 208 performs gradation correction processing (γ correction processing) on the RGB data according to a predetermined γ characteristic. The RGB data subjected to the γ correction processing by the γ correction circuit 208 is converted into YUV data by the color luminance conversion circuit 209 and then compressed and encoded by the JPEG compression circuit 210. The compressed and encoded image data is then recorded as an image data file on the recording medium 112 in FIG.

以下、本実施形態のデジタルカメラ100において行われるテカリ補正の詳細について説明する。図3は、デジタルカメラ100において、撮像部103の撮像画像又はメモリ106に記憶されている画像から所定の被写体の画像領域を検出し、その画像領域からテカリ領域を抽出してテカリ補正処理を行うまでの処理の流れを示すフローチャートである。図3のフローチャートでは、ステップS301〜ステップS304をそれぞれS301〜S304と略記する。また図3のフローチャートの処理は、ハードウェア構成により実行されてもよいし、CPU等がプログラムを実行することにより実現されてもよい。これらのことは後述する他のフローチャートにおいても同様とする。   Hereinafter, details of the shine correction performed in the digital camera 100 of the present embodiment will be described. FIG. 3 shows that the digital camera 100 detects an image area of a predetermined subject from a captured image of the imaging unit 103 or an image stored in the memory 106, extracts a shine area from the image area, and performs a shine correction process. It is a flowchart which shows the flow of a process until. In the flowchart of FIG. 3, steps S301 to S304 are abbreviated as S301 to S304, respectively. 3 may be executed by a hardware configuration, or may be realized by a CPU or the like executing a program. The same applies to other flowcharts described later.

本実施形態では、所定の被写体の画像領域として顔画像を取得し、その顔画像の中からテカリ領域を抽出し、そのテカリ領域に対してテカリ補正を行う例を挙げて説明する。
このため、本実施形態のデジタルカメラ100では、先ずS301の処理として、顔検出部113が、撮像部103の撮像画像又はメモリ106に記憶されている画像から、人物の顔画像の領域(以下、顔領域とする。)を検出する。
In the present embodiment, an example will be described in which a face image is acquired as an image area of a predetermined subject, a shine area is extracted from the face image, and shine correction is performed on the shine area.
For this reason, in the digital camera 100 of the present embodiment, as the process of S301, the face detection unit 113 first detects the area of the person's face image (hereinafter referred to as the person's face image from the image stored in the image capturing unit 103 or the memory 106). A face area).

次に、S302において、顔検出部113は、S301で検出した顔領域から、目や口、眉などの顔の器官の領域(以下、器官領域とする。)を検出する。ここで、器官領域を検出する理由は、顔領域の中で肌色領域とそれ以外の色の領域とを分けるためであり、目、口などの器官領域は一般に肌色でないため、これら器官領域を検出することで顔領域の中の肌色領域を特定可能となる。   Next, in S302, the face detection unit 113 detects facial organ regions (hereinafter referred to as organ regions) such as eyes, mouths, and eyebrows from the face regions detected in S301. Here, the reason for detecting the organ area is to separate the skin color area from the other color areas in the face area, and the organ areas such as eyes and mouth are generally not skin color, so these organ areas are detected. By doing so, it becomes possible to specify the skin color area in the face area.

次のS303において、顔検出部113は、顔領域から器官領域を除いた領域、つまり顔の肌色領域を特定し、さらに、その肌色領域内のテカリ領域の検出及びそのテカリ領域に対するテカリ補正処理に用いる評価値を取得する。図4は、顔検出部113が検出した顔領域401の一例を示した図である。顔検出部113は、S303において、図4に示すように人物の顔領域401を複数のブロックに分割して、ブロック毎に画素値の積分値を求める。また、顔検出部113は、顔領域401の各ブロックから、S302で検出した目や口などの器官領域の各ブロック、つまり肌色でない領域の各ブロックを除外することにより、肌色領域の各ブロックを特定する。そして、顔検出部113は、その肌色領域の各ブロックの積分値を評価値として取得する。このように、S303では、顔領域401の中で目や口などの肌色でない領域を除いた、肌色領域の各ブロックの評価値が取得される。S303で取得された肌色領域のブロック毎の評価値は、例えば、メモリ106に一時的に記憶された後、システム制御部50による制御の下でメモリ制御部107により読み出され、画像処理部105のテカリ補正回路203に送られる。   In next step S303, the face detection unit 113 specifies an area obtained by removing the organ area from the face area, that is, a skin color area of the face, and further detects a shine area in the skin color area and performs a shine correction process on the shine area. Get evaluation value to use. FIG. 4 is a diagram illustrating an example of the face area 401 detected by the face detection unit 113. In S303, the face detection unit 113 divides the human face area 401 into a plurality of blocks as shown in FIG. 4, and obtains an integrated pixel value for each block. Further, the face detection unit 113 removes each block of the skin color area by excluding each block of the organ area such as the eyes and mouth detected in S302, that is, each block of the non-skin color area, from each block of the face area 401. Identify. Then, the face detection unit 113 acquires the integrated value of each block in the skin color area as an evaluation value. As described above, in S303, the evaluation value of each block of the skin color area is obtained by excluding the non-skin color areas such as eyes and mouth in the face area 401. The evaluation value for each block of the flesh color area acquired in S303 is temporarily stored in the memory 106, for example, and then read out by the memory control unit 107 under the control of the system control unit 50, and the image processing unit 105 is read out. To the shine correction circuit 203.

次に、テカリ補正回路203は、S304の処理として、S303で取得された肌色領域の各ブロック積分値(評価値)を基に顔領域401の肌色領域からテカリ領域を抽出し、さらに、そのテカリ領域の飽和状態を表す飽和レベルを画素毎に判定する。そして、テカリ補正回路203は、テカリ領域に対し、飽和レベルに応じたテカリ補正処理を行う。以下、図5以降の各図を参照して、本実施形態における飽和レベルに応じたテカリ補正処理の詳細を説明する。   Next, as the process of S304, the shine correction circuit 203 extracts a shine area from the skin color area of the face area 401 based on each block integration value (evaluation value) of the skin color area acquired in S303. A saturation level representing the saturation state of the region is determined for each pixel. Then, the shine correction circuit 203 performs a shine correction process corresponding to the saturation level on the shine area. Hereinafter, with reference to each figure after FIG. 5, the detail of the shine correction process according to the saturation level in this embodiment is demonstrated.

図5は、テカリ補正回路203にて行われるテカリ補正処理の流れを示すフローチャートである。
テカリ補正回路203は、S501において、S303で取得された肌色領域のブロック積分値を基に、顔領域401の輝度情報(顔輝度情報とする。)を算出する。すなわち、テカリ補正回路203は、S501において、顔領域401から目や口などの器官領域が除外された肌色領域の輝度情報を、顔輝度情報として取得する。
FIG. 5 is a flowchart showing the flow of the shine correction process performed by the shine correction circuit 203.
In S501, the shine correction circuit 203 calculates luminance information (referred to as face luminance information) of the face area 401 based on the block integration value of the skin color area acquired in S303. That is, the shine correction circuit 203 acquires the luminance information of the skin color area in which organ areas such as eyes and mouth are excluded from the face area 401 as the face luminance information in S501.

また、テカリ補正回路203は、S502において、S303で取得された肌色領域のブロック積分値を基に、肌色領域の色の平均値を算出する。すなわち、テカリ補正回路203は、S502において、顔領域401から器官領域が除外された肌色領域の色の平均値(以下、肌色平均値とする。)を算出する。   Further, in S502, the shine correction circuit 203 calculates the average value of the color of the skin color area based on the block integration value of the skin color area acquired in S303. In other words, the shine correction circuit 203 calculates the average value of the skin color area in which the organ area is excluded from the face area 401 (hereinafter referred to as the skin color average value) in S502.

次に、テカリ補正回路203は、S503において、S303で取得された肌色領域のブロック積分値を基に、ブロック毎の輝度情報を取得する。さらに、テカリ補正回路203は、次のS504において、予め決めた所定の輝度閾値以上となっている高輝度のブロックがあるか否かを判定する。すなわち、テカリ補正回路203は、S503及びS504において、顔領域401から器官領域を除外した肌色領域の中に、輝度が所定の輝度閾値以上となっている高輝度の一つ以上のブロックからなる高輝度領域があるか否かを判定する。そして、テカリ補正回路203は、S504において高輝度領域が無いと判定(No)した場合には、図5のフローチャートに示すテカリ補正処理を終了する。一方、テカリ補正回路203は、S504において高輝度領域があると判定(Yes)した場合には、その高輝度領域をテカリ領域として抽出し、S505に処理を進める。   Next, the shine correction circuit 203 acquires luminance information for each block based on the block integration value of the skin color area acquired in S303 in S503. Further, in the next step S504, the shine correction circuit 203 determines whether there is a high-luminance block that is equal to or higher than a predetermined luminance threshold value. In other words, in S503 and S504, the shine correction circuit 203 is a high color composed of one or more blocks of high luminance whose luminance is equal to or higher than a predetermined luminance threshold in the skin color region excluding the organ region from the face region 401. It is determined whether there is a luminance region. Then, if it is determined in S504 that there is no high brightness area (No), the shine correction circuit 203 ends the shine correction process shown in the flowchart of FIG. On the other hand, if it is determined in S504 that there is a high-luminance area (Yes), the shine correction circuit 203 extracts the high-luminance area as a shine area, and the process proceeds to S505.

S505に進むと、テカリ補正回路203は、S504で抽出した高輝度領域(テカリ領域)について、画素毎にR,G,Bの各色信号の飽和状態を判定して、R,G,Bの各色信号の飽和状態を表す飽和レベルを決定する。なお、本実施形態では画素毎に飽和レベルを決定する例を挙げているが、ブロック毎に飽和レベルを決定してもよいし、高輝度領域毎に飽和レベルを決定してもよい。本実施形態の場合、テカリ補正回路203は、R,G,Bの各色信号の飽和状態を表す飽和レベルとして、R,G,Bの全ての色信号が所定の閾値以上で飽和している全飽和レベルLCと、一部の色信号が閾値以上で飽和している部分飽和レベルとに分ける。さらに、テカリ補正回路203は、部分飽和レベルを、Rの色信号が閾値以上でG,Bの色信号が閾値未満となる第1部分飽和レベルL1と、RとGの色信号が閾値以上でBの色信号が閾値未満となる第2部分飽和レベルL2とに分ける。なお、飽和レベルは各色で異なっていてもよく、飽和レベルを決める際の所定の閾値は色毎に異なっていてもよい。   In step S505, the shine correction circuit 203 determines the saturation state of the R, G, and B color signals for each pixel in the high luminance area (shine area) extracted in S504, and determines each color of R, G, and B. Determine a saturation level representing the saturation of the signal. In this embodiment, the saturation level is determined for each pixel. However, the saturation level may be determined for each block, or the saturation level may be determined for each high luminance region. In the present embodiment, the shine correction circuit 203 is a saturation level that represents the saturation state of the R, G, and B color signals, and all the R, G, and B color signals are saturated at a predetermined threshold value or more. It is divided into a saturation level LC and a partial saturation level in which some color signals are saturated at a threshold value or more. Further, the shine correction circuit 203 sets the partial saturation level to the first partial saturation level L1 in which the R color signal is equal to or greater than the threshold and the G and B color signals are less than the threshold, and the R and G color signals are equal to or greater than the threshold. This is divided into the second partial saturation level L2 at which the B color signal is less than the threshold. Note that the saturation level may be different for each color, and the predetermined threshold value for determining the saturation level may be different for each color.

そして、S505において、テカリ補正回路203は、高輝度領域の画素毎に全飽和レベルLCであるか否かを判定する。テカリ補正回路203は、S505において、全飽和レベルLCであると判定(Yes)した場合には、S506に処理を進める。S506に進むと、テカリ補正回路203は、S505で全飽和レベルLCと判定された画素に対し、S502で顔領域401の肌色領域から算出された肌色平均値の補色を減算するような減算処理によるテカリ補正処理を行う。このS506の後、テカリ補正回路203は、図5のフローチャートに示すテカリ補正処理を終了する。   In step S505, the shine correction circuit 203 determines whether or not the saturation level LC is reached for each pixel in the high luminance area. If it is determined in S505 that the saturation level LC is the full saturation level LC (Yes), the shine correction circuit 203 advances the process to S506. In step S506, the shine correction circuit 203 performs subtraction processing such as subtracting the complementary color of the flesh color average value calculated from the flesh color area of the face area 401 in S502 from the pixels determined to be the full saturation level LC in S505. Perform shine correction processing. After S506, the shine correction circuit 203 ends the shine correction process shown in the flowchart of FIG.

一方、S505において、テカリ補正回路203は、全飽和レベルLCでないと判定(No)、つまり第1部分飽和レベルL1又は第2部分飽和レベルL2であると判定した場合には、S507に処理を進める。S507に進むと、テカリ補正回路203は、その画素に対しR,G,Bの色信号のゲインを下げるゲインダウン処理を行うことによるテカリ補正処理を行う。このS507の後、テカリ補正回路203は、図5のフローチャートに示すテカリ補正処理を終了する。   On the other hand, if the shine correction circuit 203 determines in S505 that it is not the full saturation level LC (No), that is, if it is determined that it is the first partial saturation level L1 or the second partial saturation level L2, the process proceeds to S507. . In step S507, the shine correction circuit 203 performs a shine correction process by performing a gain reduction process for reducing the gains of the R, G, and B color signals for the pixel. After this S507, the shine correction circuit 203 ends the shine correction process shown in the flowchart of FIG.

前述のように、本実施形態では、高輝度領域の画素が全飽和レベルLCである場合には肌色平均値の補色を減算するテカリ補正処理を行い、一方、第1部分飽和レベルL1又は第2部分飽和レベルL2である場合にはゲインダウン処理によるテカリ補正処理を行う。以下、このように、飽和レベルに応じてテカリ補正処理を切り替える理由と効果について、図6以降の各図を用いて説明する。   As described above, in the present embodiment, when the pixels in the high luminance region are at the full saturation level LC, the shine correction process for subtracting the complementary color of the skin color average value is performed, while the first partial saturation level L1 or the second In the case of the partial saturation level L2, the shine correction process by the gain reduction process is performed. Hereinafter, the reason and effect of switching the shine correction process according to the saturation level will be described with reference to FIGS.

図6は、R,G,Bの全ての色信号が飽和している全飽和レベルLCの各画素からなる高輝度領域と、R,G,Bの一部の色信号が飽和している第1,第2部分飽和レベルL1,L2の各画素からなる高輝度領域とが存在している顔画像の例を示した図である。全飽和レベルLCの高輝度領域の場合、画素のR,G,Bの全ての色信号が飽和しているため色情報が失われ、本来は肌色である領域が白く飛んだ状態になっている。一方、第1,第2部分飽和レベルL1,L2の高輝度領域の場合、画素のR,G,Bの一部の色信号が飽和しているため、色ずれ(いわゆる色曲がり)が生じた状態になっている。例えば、RとGの二つの色信号が飽和した第2部分飽和レベルL2の高輝度領域の場合、肌色であるはずの領域が明るい黄色になる。このような色曲がりは、撮像部103の撮像素子の露光時にRとBの画素のアナログ信号が飽和したことで、その後、R,G,Bの各色信号を合わせた画素の色がずれてしまうことで生ずる。   FIG. 6 shows a high luminance region composed of pixels of all saturation levels LC in which all color signals of R, G, and B are saturated, and part of color signals of R, G, and B are saturated. It is the figure which showed the example of the face image in which the high-intensity area | region which consists of each pixel of 1 and 2nd partial saturation levels L1 and L2 exists. In the case of the high luminance region of the full saturation level LC, the color information is lost because all the R, G, and B color signals of the pixel are saturated, and the originally skin-colored region is in a state where it is white. . On the other hand, in the case of the high luminance regions of the first and second partial saturation levels L1 and L2, a color shift (so-called color curve) occurs because some color signals of R, G, and B of the pixel are saturated. It is in a state. For example, in the case of the high luminance region of the second partial saturation level L2 in which the two color signals R and G are saturated, the region that should be the skin color is bright yellow. Such color bending is caused by saturation of the analog signals of the R and B pixels at the time of exposure of the image sensor of the imaging unit 103, and thereafter, the color of the pixel combining the R, G, and B color signals is shifted. It happens.

図7は、撮像部103の撮像素子において、顔のような肌色の被写体からの入射光のR,G,Bの各色成分の入力(入射光の強さ)に対し、撮像素子から出力されるR,G,Bの1画素分の色信号(出力信号)との関係を示す図である。図7に示すように、肌色の被写体からの入射光が強くなっていくと、それに伴いR,G,Bの各色の出力信号の値もそれぞれ大きくなっていく。肌色の被写体からの入射光の強さが閾値未満である場合、R,G,Bの各色の出力信号はそれぞれ飽和していない非飽和レベルLNであるため、入射光が強くなるにつれてR,G,Bの各色の出力信号も徐々に値が大きくなる。これに対し、肌色の被写体からの入射光の強さが或る閾値になると、R,G,Bの各色の出力信号はそれ以上値が大きくならない飽和状態となる。例えば、出力信号値を0〜255で表し、閾値を250とした場合、入射光が徐々に強くなり、R,G,Bの各色の出力信号値が徐々に大きくなって閾値の250になると、その色の出力信号は飽和する。ここで、被写体が人の顔である場合の入射光、つまり肌色の入射光のR,G,Bの色成分の量は、一般にR>G>Bの関係を有している。このため、入射光が徐々に強くなっていくと、図7に示すように、先ずRの出力信号が飽和(第1部分飽和レベルL1)し、次に、Bの出力信号が飽和(第2部分飽和レベルL2)し、最後にBの出力信号が飽和(全飽和レベルLC)する。   FIG. 7 shows an output from the image sensor in response to input (intensity of incident light) of R, G, and B color components of incident light from a skin-colored subject such as a face in the image sensor of the imaging unit 103. It is a figure which shows the relationship with the color signal (output signal) for 1 pixel of R, G, B. As shown in FIG. 7, as the incident light from the skin-colored object becomes stronger, the value of the output signal of each color of R, G, B increases accordingly. When the intensity of the incident light from the skin-colored subject is less than the threshold value, the output signals of R, G, and B are at non-saturated non-saturation levels LN. , B output signals gradually increase in value. On the other hand, when the intensity of the incident light from the skin-colored subject reaches a certain threshold value, the output signals of the R, G, and B colors are saturated so that the values do not increase any more. For example, when the output signal value is represented by 0 to 255 and the threshold value is 250, the incident light gradually increases, and when the output signal value of each color of R, G, and B gradually increases to the threshold value of 250, The output signal for that color is saturated. Here, when the subject is a human face, the amounts of R, G, and B color components of the incident light, that is, skin-colored incident light, generally have a relationship of R> G> B. Therefore, as the incident light gradually increases, as shown in FIG. 7, the output signal of R is first saturated (first partial saturation level L1), and then the output signal of B is saturated (second Finally, the output signal of B is saturated (total saturation level LC).

図8は、テカリ補正回路203への入力信号とテカリ補正回路203にてテカリ補正処理された後の出力信号との関係を示した図である。テカリ補正回路203への入力信号は、図7で説明した撮像素子の出力信号に相当する。つまりテカリ補正回路203への入力信号は、第1部分飽和レベルL1ではRの信号が飽和し、第2部分飽和レベルではRとGの信号が飽和し、全飽和レベルLCではR,G,Bの信号が飽和した信号となる。また、非飽和レベルLNではR,G,Bの各信号が飽和していない入力信号となる。このように、テカリ補正回路203への入力信号は、非飽和レベルLNから第1部分飽和レベルL1に切り替わる境界M1でRの信号が飽和する。また、テカリ補正回路203への入力信号は、第1部分飽和レベルL1から第2部分飽和レベルL2に切り替わる境界M2でGの信号が飽和し、さらに第2部分飽和レベルL2から全飽和レベルLCに切り替わる境界M3でBの信号が飽和する。そして、本実施形態のテカリ補正回路203は、前述したように、高輝度領域の画素が、全飽和レベルLCである場合には肌色平均値の補色を減算する処理を行い、第1部分飽和レベルL1又は第2部分飽和レベルL2である場合にはゲインダウン処理を行う。   FIG. 8 is a diagram illustrating a relationship between an input signal to the shine correction circuit 203 and an output signal after the shine correction process is performed by the shine correction circuit 203. The input signal to the shine correction circuit 203 corresponds to the output signal of the image sensor described in FIG. That is, the input signal to the shine correction circuit 203 is such that the R signal is saturated at the first partial saturation level L1, the R and G signals are saturated at the second partial saturation level, and R, G, B at the full saturation level LC. The signal becomes a saturated signal. Further, at the non-saturation level LN, the R, G, and B signals are input signals that are not saturated. As described above, the input signal to the shine correction circuit 203 is saturated with the R signal at the boundary M1 where the non-saturation level LN switches to the first partial saturation level L1. Also, the input signal to the shine correction circuit 203 is saturated at the boundary M2 where the first partial saturation level L1 is switched to the second partial saturation level L2, and further from the second partial saturation level L2 to the full saturation level LC. The B signal saturates at the switching boundary M3. Then, as described above, the shine correction circuit 203 according to the present embodiment performs a process of subtracting the complementary color of the skin color average value when the pixels in the high luminance region are at the full saturation level LC, and the first partial saturation level. In the case of L1 or the second partial saturation level L2, gain reduction processing is performed.

ここで、R,G,Bの各色の信号の飽和レベルが切り替わる境界では、急激に色が変化することで擬似輪郭や色段差が生ずることがある。特に、非飽和レベルLNから第1部分飽和レベルL1に切り替わる境界M1では色が急激に変化して、擬似輪郭や色段差が目立ち易くなる。このため、本実施形態のテカリ補正回路203は、飽和レベルが切り替わる各境界における色変化を少なくするために、以下のような所定の信号値範囲の設定、線形補間による出力信号値の補正、及び補正目標値の設定を行う。   Here, at the boundary where the saturation level of the signals of the respective colors R, G, and B is switched, a pseudo contour or a color step may be generated due to a sudden color change. In particular, at the boundary M1 where the non-saturation level LN is switched to the first partial saturation level L1, the color changes abruptly, and the pseudo contour and the color step are easily noticeable. For this reason, the shine correction circuit 203 according to the present embodiment sets the following predetermined signal value range, corrects the output signal value by linear interpolation, and reduces the color change at each boundary where the saturation level is switched. Set the correction target value.

テカリ補正回路203は、非飽和レベルLNから第1部分飽和レベルL1に切り替わる境界M1付近に、その境界M1を含む所定の信号値範囲E1を設定する。そして、テカリ補正回路203は、入力された信号値が信号値範囲E1内である場合には、その入力信号値に対する出力信号値を、所定の信号値範囲E1の両端部V1,V2に対応した二つの信号値V1R,V2Rの間を線形補間した直線上の信号値として算出する。所定の信号値範囲E1の一方の端部V1は、境界M1から信号値が小さくなる方向で境界M1から所定の幅だけ離れた箇所の信号値として設定される。所定の信号値範囲E1の他方の端部V2は、境界M1から信号値が大きくなる方向で、且つ、第1部分飽和レベルL1から第2部分飽和レベルL2に切り替わる境界M2に至るまでの間の箇所の信号値として設定される。   The shine correction circuit 203 sets a predetermined signal value range E1 including the boundary M1 in the vicinity of the boundary M1 where the non-saturation level LN switches to the first partial saturation level L1. Then, when the input signal value is within the signal value range E1, the shine correction circuit 203 corresponds the output signal value corresponding to the input signal value to both ends V1 and V2 of the predetermined signal value range E1. A signal value on a straight line obtained by linear interpolation between the two signal values V1R and V2R is calculated. One end V1 of the predetermined signal value range E1 is set as a signal value at a location away from the boundary M1 by a predetermined width in a direction in which the signal value decreases from the boundary M1. The other end V2 of the predetermined signal value range E1 is in a direction in which the signal value increases from the boundary M1 and reaches the boundary M2 where the first partial saturation level L1 switches to the second partial saturation level L2. It is set as the signal value of the location.

このため、例えば境界M1で飽和レベルが切り替わるRの信号の場合、Rの入力信号値に対応した出力信号値は、所定の信号値範囲E1の両端部V1,V2に対応した二つの信号値V1R,V2Rの間を線形補間した直線上の信号値として算出される。すなわち、所定の信号値範囲E1内でのRの出力信号は、二つの信号値V1R,V2R間を結ぶ直線で表される信号となり、境界M1で出力信号が急激に折れ曲がるように変化することは無くなる。境界M1では飽和レベルが切り替わらないGとBについても同様に、G,Bの入力信号値にそれぞれ対応した出力信号値は、所定の信号値範囲E1の両端部V1,V2の二つの信号値の間を線形補間した直線上の信号値として算出される。なお、これらG,Bの出力信号は、元々境界M1で飽和レベルが切り替わる信号ではないため、信号値範囲E1内で入出力の関係は略々変化しない。これらにより、所定の信号値範囲E1内では、R,G,Bの各色の信号は共に信号が急激に変化せず、したがって急激に色が変化して擬似輪郭や色段差が生ずるようなことは無くなる。   For this reason, for example, in the case of an R signal whose saturation level is switched at the boundary M1, the output signal value corresponding to the R input signal value is two signal values V1R corresponding to both ends V1 and V2 of the predetermined signal value range E1. , V2R is calculated as a signal value on a straight line obtained by linear interpolation. That is, the R output signal within the predetermined signal value range E1 becomes a signal represented by a straight line connecting the two signal values V1R and V2R, and the output signal changes so as to be bent sharply at the boundary M1. Disappear. Similarly, for G and B where the saturation level does not switch at the boundary M1, the output signal values corresponding to the input signal values of G and B are the two signal values at both ends V1 and V2 of the predetermined signal value range E1. It is calculated as a signal value on a straight line obtained by linear interpolation between them. Note that these G and B output signals are not originally signals whose saturation level switches at the boundary M1, and therefore the input / output relationship does not substantially change within the signal value range E1. As a result, within the predetermined signal value range E1, the signals of the R, G, and B colors do not change abruptly, and therefore the color changes abruptly and pseudo contours or color steps are generated. Disappear.

また、テカリ補正回路203は、第1部分飽和レベルL1から第2部分飽和レベルL2に切り替わる境界M2、及び、第2部分飽和レベルL2から全飽和レベルLCに切り替わる境界M3に対しては、それら境界M2,M3を含む所定の信号値範囲E2を設定する。そして、テカリ補正回路203は、入力された信号値が信号値範囲E2内である場合には、その入力信号値に対する出力信号値を、信号値範囲E2の両端部V2,V3の間を線形補間した直線上の信号として算出する。ここで、信号値範囲E2の一方の端部V2は、前述の信号値範囲E2の端部V2に対応した値となされる。これに対し、信号値範囲E2の他方の端部V3は、境界M3から信号値が大きくなる方向で、顔領域401の肌色領域の肌色平均値のR,G,Bの各色の値に基づいて設定される。本実施形態の場合、テカリ補正回路203は、顔領域401の肌色領域の肌色平均値のR,G,Bの各色の値を基に、補正目標値V3R,V3G,V3Bを設定し、それら補正目標値V3R,V3G,V3Bに対応して、信号値範囲E2の端部V3を設定する。   Further, the shine correction circuit 203 applies to the boundary M2 that switches from the first partial saturation level L1 to the second partial saturation level L2 and the boundary M3 that switches from the second partial saturation level L2 to the full saturation level LC. A predetermined signal value range E2 including M2 and M3 is set. Then, when the input signal value is within the signal value range E2, the shine correction circuit 203 linearly interpolates the output signal value corresponding to the input signal value between both ends V2 and V3 of the signal value range E2. It is calculated as a signal on the straight line. Here, one end V2 of the signal value range E2 is a value corresponding to the end V2 of the signal value range E2. On the other hand, the other end V3 of the signal value range E2 is based on the values of the R, G, and B skin color average values of the skin color area of the face area 401 in the direction in which the signal value increases from the boundary M3. Is set. In the case of the present embodiment, the shine correction circuit 203 sets correction target values V3R, V3G, and V3B based on the skin color average values R, G, and B of the skin color area of the face area 401, and corrects them. Corresponding to the target values V3R, V3G, and V3B, the end V3 of the signal value range E2 is set.

これにより、Rの入力信号値に対応した出力信号値は、所定の信号値範囲E2の両端部V2,V3の二つの信号値V2R,V3Rの間を線形補間した直線上の信号値として算出される。同様に、Gの出力信号値は信号値範囲E2の信号値V2G,V3Gの間を線形補間した直線上の信号値として算出され、Bの出力信号値は信号値範囲E2の信号値V2B,V3Bの間を線形補間した直線上の信号値として算出される。このため、所定の信号値範囲E2内では、R,G,Bの各色の信号は共に信号が急激に変化せず、したがって急激に色が変化して擬似輪郭や色段差が生ずるようなことは無くなる。   Thereby, the output signal value corresponding to the input signal value of R is calculated as a signal value on a straight line obtained by linear interpolation between the two signal values V2R and V3R at both ends V2 and V3 of the predetermined signal value range E2. The Similarly, the output signal value of G is calculated as a signal value on a straight line obtained by linear interpolation between the signal values V2G and V3G of the signal value range E2, and the output signal value of B is the signal values V2B and V3B of the signal value range E2. As a signal value on a straight line obtained by linear interpolation. For this reason, within the predetermined signal value range E2, the signals of the R, G, and B colors do not change abruptly, and therefore the color changes abruptly, resulting in a pseudo contour or a color step. Disappear.

図9(a)〜図9(c)は、R,G,Bの各色において、テカリ補正回路203に入力される入力信号(テカリ補正前の入力信号)と、テカリ補正回路203によるテカリ補正後の出力信号の対応関係を説明する図である。図9(a)は全飽和レベルの場合、図9(b)は第2部分飽和レベルの場合、図9(c)は第1部分飽和レベルの場合を示している。また、図9(a)〜図9(c)のR,G,Bの各色の信号の縦方向の長さは信号値の大きさを表している。また、図9(a)〜図9(c)の各閾値は、テカリ補正前の入力信号に対するテカリ補正後の出力信号の上限値を示している。   9A to 9C show the input signals (input signals before the shine correction) input to the shine correction circuit 203 and the shine correction by the shine correction circuit 203 for each of R, G, and B colors. It is a figure explaining the correspondence of the output signal of. FIG. 9A shows the case of the total saturation level, FIG. 9B shows the case of the second partial saturation level, and FIG. 9C shows the case of the first partial saturation level. Also, the lengths in the vertical direction of the signals of R, G, and B in FIGS. 9A to 9C represent the magnitudes of the signal values. Further, each threshold value in FIGS. 9A to 9C indicates an upper limit value of the output signal after the shine correction with respect to the input signal before the shine correction.

図9(a)に示した全飽和レベルの場合、R,G,Bの各色の入力信号は全て飽和していて各色間で差が無くなっており、色情報が失われている。本実施形態のテカリ補正処理では、全飽和レベルの場合、前述したように、肌色領域の肌色平均値の補色を減算する処理によるテカリ補正処理が行われる。また、出力信号は閾値が上限値となされる。このため、全飽和レベルの場合、R,G,Bの各色の入力信号のうち、Rの出力信号は閾値を上限値とした信号に補正され、GとBの出力信号はそれぞれ肌色平均値の補色が減算された信号に補正される。これにより、テカリ補正後のR,G,Bの出力信号による画像は肌色が回復した画像となる。   In the case of the full saturation level shown in FIG. 9A, the input signals of each color of R, G, B are all saturated, there is no difference between the colors, and the color information is lost. In the shine correction process of the present embodiment, in the case of the full saturation level, as described above, the shine correction process by the process of subtracting the complementary color of the skin color average value of the skin color region is performed. Further, the threshold value of the output signal is an upper limit value. For this reason, in the case of the full saturation level, among the input signals of R, G, and B colors, the R output signal is corrected to a signal having a threshold value as an upper limit value, and the G and B output signals are respectively skin tone average values. The signal is corrected to a signal obtained by subtracting the complementary color. As a result, the image by the R, G, B output signals after the shine correction is an image in which the skin color is recovered.

図9(b)に示した第2部分飽和レベルの場合、RとGの入力信号が飽和しており、Bの入力信号は飽和していない。本実施形態のテカリ補正処理では、第2部分飽和レベルの場合、Rの出力信号はゲインダウン処理により閾値を上限値とした信号に補正され、また、GとBの出力信号もゲインダウン処理により補正される。これにより、テカリ補正後のR,G,Bの出力信号による画像は、色ズレ(色曲がり)が生じない自然な肌色の画像となる。   In the case of the second partial saturation level shown in FIG. 9B, the R and G input signals are saturated, and the B input signal is not saturated. In the shine correction process of the present embodiment, in the case of the second partial saturation level, the R output signal is corrected to a signal having the threshold value as the upper limit value by the gain reduction process, and the G and B output signals are also corrected by the gain reduction process. It is corrected. As a result, the image based on the R, G, and B output signals after the shine correction is a natural skin color image in which no color misregistration (color distortion) occurs.

図9(c)に示した第1部分飽和レベルの場合、Rの入力信号が飽和しており、GとBの入力信号は飽和していない。本実施形態のテカリ補正処理では、第1部分飽和レベルの場合、Rの出力信号はゲインダウン処理により閾値を上限値とした信号に補正され、また、GとBの出力信号もゲインダウン処理により補正される。これにより、テカリ補正後のR,G,Bの出力信号による画像は、色ズレ(色曲がり)が生じない自然な肌色の画像となる。   In the case of the first partial saturation level shown in FIG. 9C, the R input signal is saturated and the G and B input signals are not saturated. In the shine correction process of the present embodiment, in the case of the first partial saturation level, the R output signal is corrected to a signal having a threshold value as an upper limit value by the gain reduction process, and the G and B output signals are also corrected by the gain reduction process. It is corrected. As a result, the image based on the R, G, and B output signals after the shine correction is a natural skin color image in which no color misregistration (color distortion) occurs.

<その他の実施形態>
以上、本発明の好ましい実施形態について説明したが、本発明はこれらの実施形態に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。
前述の実施形態では、顔画像の肌色領域についてテカリ補正処理を行う例を挙げたが、本発明は顔画像の肌色領域のテカリ補正処理には限定されない。一例として、自動車の車体等の高輝度領域に対するテカリ補正等にも適用可能であり、この場合、画像内の車体色の領域から高輝度領域を検出して、その高輝度領域の色信号から評価値を求め、その評価値を基にテカリ補正を行う。
また、前述の実施形態では、R>G>Bの関係を有する肌色を例に挙げたため、部分飽和レベルは、Rの信号が飽和でG,Bの信号が非飽和の場合に第1部分飽和レベルL1、RとGの信号が飽和でBの信号が非飽和の場合に第2部分飽和レベルL2となる。これに対し、肌色以外の色、例えばB>G>Rの関係を有する色の場合、部分飽和レベルは、Bの信号が飽和でG,Rの信号が非飽和の場合に第1部分飽和レベルL1、BとGの信号が飽和でRの信号が非飽和の場合に第2部分飽和レベルL2となる。すなわち、第1部分飽和レベルL1は、R,G,Bの三つの色信号のうち一つの色信号が所定の閾値以上で飽和している場合の飽和レベルであり、第2部分飽和レベルL2は三つの色信号のうち二つの色信号が閾値以上で飽和している場合の飽和レベルである。
<Other embodiments>
As mentioned above, although preferable embodiment of this invention was described, this invention is not limited to these embodiment, A various deformation | transformation and change are possible within the range of the summary.
In the above-described embodiment, an example in which the shine correction process is performed on the skin color area of the face image has been described. However, the present invention is not limited to the shine correction process on the skin color area of the face image. As an example, it can also be applied to shine correction for a high brightness area such as the body of an automobile. In this case, the high brightness area is detected from the body color area in the image and evaluated from the color signal of the high brightness area. The value is obtained, and the shine correction is performed based on the evaluation value.
In the above-described embodiment, the skin color having the relationship of R>G> B is taken as an example. Therefore, the partial saturation level is the first partial saturation when the R signal is saturated and the G and B signals are not saturated. The second partial saturation level L2 is reached when the level L1, R and G signals are saturated and the B signal is not saturated. On the other hand, in the case of a color other than skin color, for example, a color having a relationship of B>G> R, the partial saturation level is the first partial saturation level when the B signal is saturated and the G and R signals are not saturated. When the L1, B, and G signals are saturated and the R signal is not saturated, the second partial saturation level L2 is reached. That is, the first partial saturation level L1 is a saturation level when one of the three color signals R, G, and B is saturated at a predetermined threshold value or more, and the second partial saturation level L2 is This is the saturation level when two of the three color signals are saturated above the threshold.

本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。   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 the 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.

上述の実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。即ち、本発明は、その技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。   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 as being limited thereto. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.

50:システム制御部、100:デジタルカメラ、103:撮像部、105:画像処理部、106:メモリ、107:メモリ制御部、113:顔検出部、121:不揮発性メモリ、203:テカリ補正回路   50: System control unit, 100: Digital camera, 103: Image capturing unit, 105: Image processing unit, 106: Memory, 107: Memory control unit, 113: Face detection unit, 121: Non-volatile memory, 203: Deflate correction circuit

Claims (12)

入力された画像から所定の被写体の画像領域を検出する検出手段と、
前記被写体の画像領域から高輝度領域を抽出する抽出手段と、
前記高輝度領域の色を決める複数の色信号の値を基に、前記高輝度領域の飽和レベルを決定する決定手段と、
前記複数の色信号の少なくとも一つの色信号が飽和した前記高輝度領域に対し、前記決定された飽和レベルに応じた補正を行う補正手段と、
を有することを特徴とする画像処理装置。
Detecting means for detecting an image area of a predetermined subject from the input image;
Extracting means for extracting a high brightness area from the image area of the subject;
Determining means for determining a saturation level of the high luminance region based on values of a plurality of color signals determining the color of the high luminance region;
Correction means for performing correction in accordance with the determined saturation level for the high-luminance region in which at least one color signal of the plurality of color signals is saturated;
An image processing apparatus comprising:
前記決定手段は、前記高輝度領域の前記複数の色信号の各値が所定の閾値以上か否かの判定に基づき、前記高輝度領域の前記飽和レベルを決定することを特徴とする請求項1に記載の画像処理装置。   The determination means determines the saturation level of the high luminance region based on a determination as to whether or not each value of the plurality of color signals in the high luminance region is equal to or greater than a predetermined threshold value. An image processing apparatus according to 1. 前記色を決める前記複数の色信号は三原色の三つの色信号であり、
前記決定手段は、前記高輝度領域の飽和レベルを、
前記高輝度領域の前記三つの色信号の全てが前記所定の閾値以上となる全飽和レベルと、
前記高輝度領域の前記三つの色信号のうち一つの色信号が前記所定の閾値以上となる第1の部分飽和レベルと、
前記高輝度領域の前記三つの色信号のうち二つの色信号が前記所定の閾値以上となる第2の部分飽和レベルと、
前記高輝度領域の前記三つの色信号の全てが前記所定の閾値未満となる非飽和レベルとの何れかに決定することを特徴とする請求項2に記載の画像処理装置。
The plurality of color signals for determining the color are three color signals of three primary colors,
The determining means determines a saturation level of the high luminance region,
A total saturation level at which all of the three color signals in the high luminance region are equal to or higher than the predetermined threshold;
A first partial saturation level at which one of the three color signals in the high-luminance region is equal to or higher than the predetermined threshold;
A second partial saturation level at which two color signals out of the three color signals in the high luminance region are equal to or higher than the predetermined threshold;
The image processing apparatus according to claim 2, wherein all of the three color signals in the high luminance region are determined to be any one of the non-saturation levels that are less than the predetermined threshold.
前記補正手段は、
前記高輝度領域が前記第1の部分飽和レベル又は前記第2の部分飽和レベルである場合には、前記高輝度領域の各色信号のゲインダウンによる前記補正を行い、
前記高輝度領域が前記全飽和レベルである場合には、前記所定の被写体の画像領域の各色信号を基に算出した色平均値の補色を、前記高輝度領域の各色信号から減算する前記補正を行うことを特徴とする請求項3に記載の画像処理装置。
The correction means includes
When the high luminance region is the first partial saturation level or the second partial saturation level, the correction is performed by reducing the gain of each color signal in the high luminance region,
When the high brightness area is at the total saturation level, the correction for subtracting the complementary color of the color average value calculated based on each color signal of the image area of the predetermined subject from each color signal of the high brightness area. The image processing apparatus according to claim 3, wherein the image processing apparatus performs the processing.
前記補正手段は、
前記高輝度領域の前記飽和レベルが切り替わる境界に対して所定の信号値範囲を設定し、
入力された色信号の値が前記信号値範囲の内である場合には、前記入力された色信号に対応した出力信号値を、前記信号値範囲の両端部の信号値の間を線形補間した直線上の信号値として算出することを特徴とする請求項3又は4に記載の画像処理装置。
The correction means includes
A predetermined signal value range is set with respect to a boundary at which the saturation level of the high luminance region is switched;
When the value of the input color signal is within the signal value range, the output signal value corresponding to the input color signal is linearly interpolated between the signal values at both ends of the signal value range. The image processing apparatus according to claim 3, wherein the image processing apparatus calculates the signal value on a straight line.
前記補正手段は、
前記非飽和レベルから前記第1の部分飽和レベルに切り替わる第1の境界に対しては、前記第1の境界を含む第1の信号値範囲を設定して前記線形補間に基づく出力信号値の算出を行い、
前記第1の部分飽和レベルから第2の部分飽和レベルに切り替わる第2の境界と前記第2の部分飽和レベルから前記全飽和レベルに切り替わる第3の境界に対しては、前記第2の境界と第3の境界を含む第2の信号値範囲を設定して前記線形補間に基づく出力信号値の算出を行うことを特徴とする請求項5に記載の画像処理装置。
The correction means includes
For a first boundary where the non-saturation level switches to the first partial saturation level, a first signal value range including the first boundary is set, and an output signal value is calculated based on the linear interpolation. And
For the second boundary that switches from the first partial saturation level to the second partial saturation level and the third boundary that switches from the second partial saturation level to the full saturation level, the second boundary The image processing apparatus according to claim 5, wherein an output signal value is calculated based on the linear interpolation by setting a second signal value range including a third boundary.
前記補正手段は、前記第2の信号値範囲のうち前記全飽和レベルに対応した端部の信号値を、前記所定の被写体の画像領域の各色信号を基に算出した色平均値に応じた値とすることを特徴とする請求項6に記載の画像処理装置。   The correction means is a value corresponding to a color average value calculated based on each color signal of the image area of the predetermined subject, with the signal value at the end corresponding to the total saturation level in the second signal value range. The image processing apparatus according to claim 6. 前記抽出手段は、前記被写体の画像領域を複数のブロックに分けて、各ブロックの画素値の積分値を算出し、各ブロックの積分値から輝度情報を算出して、前記各ブロックの輝度情報を基に前記高輝度領域を抽出することを特徴とする請求項1から7の何れか1項に記載の画像処理装置。   The extraction unit divides the image area of the subject into a plurality of blocks, calculates an integrated value of pixel values of each block, calculates luminance information from the integrated value of each block, and calculates luminance information of each block. The image processing apparatus according to claim 1, wherein the high luminance region is extracted based on the image. 前記検出手段は、前記所定の被写体の画像領域として人の顔の画像領域を検出することを特徴とする請求項1から8の何れか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the detection unit detects an image area of a human face as the image area of the predetermined subject. 前記検出手段は、前記顔の画像領域から、顔の器官領域を除いた画像領域を検出することを特徴とする請求項9に記載の画像処理装置。   The image processing apparatus according to claim 9, wherein the detection unit detects an image area obtained by removing a facial organ area from the face image area. 入力された画像から所定の被写体の画像領域を検出する検出工程と、
前記被写体の画像領域から高輝度領域を抽出する抽出工程と、
前記高輝度領域の色を決める複数の色信号の値を基に、前記高輝度領域の飽和レベルを決定する決定工程と、
前記複数の色信号の少なくとも一つの色信号が飽和した前記高輝度領域に対し、前記決定された飽和レベルに応じた補正を行う補正工程と、
を有することを特徴とする画像処理装置の画像処理方法。
A detection step of detecting an image area of a predetermined subject from the input image;
An extraction step of extracting a high brightness area from the image area of the subject;
A determination step of determining a saturation level of the high luminance region based on a plurality of color signal values determining the color of the high luminance region;
A correction step of performing correction according to the determined saturation level for the high luminance region in which at least one color signal of the plurality of color signals is saturated;
An image processing method for an image processing apparatus, comprising:
コンピュータを、請求項1から10の何れか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claim 1 to 10.
JP2017046346A 2017-03-10 2017-03-10 Image processing apparatus, image processing method, and program Pending JP2018151766A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017046346A JP2018151766A (en) 2017-03-10 2017-03-10 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017046346A JP2018151766A (en) 2017-03-10 2017-03-10 Image processing apparatus, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2018151766A true JP2018151766A (en) 2018-09-27

Family

ID=63681718

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017046346A Pending JP2018151766A (en) 2017-03-10 2017-03-10 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2018151766A (en)

Similar Documents

Publication Publication Date Title
US10397486B2 (en) Image capture apparatus and method executed by image capture apparatus
TWI416940B (en) Image processing device and image processing program
CN102387373B (en) Image processing apparatus and image processing method
JP6833415B2 (en) Image processing equipment, image processing methods, and programs
JP6904788B2 (en) Image processing equipment, image processing methods, and programs
US8890973B2 (en) Image processing apparatus, image processing method, and storage medium
CN103581638A (en) Image processing apparatus and image processing method
US12412249B2 (en) Image processing apparatus, image processing method, and image capture apparatus
JP2008288706A (en) Imaging device, image processing device, image file, and gradation correcting method
JP5589660B2 (en) Image processing apparatus, imaging apparatus, and image processing program
US11069031B2 (en) Image processing apparatus, control method for image processing apparatus, image pickup apparatus, and non-transitory computer-readable storage medium to control reflected color components of input image
US10977777B2 (en) Image processing apparatus, method for controlling the same, and recording medium
JP4595569B2 (en) Imaging device
JP2020005084A (en) Image processing apparatus, image processing method, and program
US20210329156A1 (en) Image processing apparatus, image processing method, and storage medium
US20230156309A1 (en) Image processing apparatus, image processing method, and image capturing apparatus
JP5743456B2 (en) Image processing apparatus, image processing method, and imaging apparatus
CN116266877A (en) Image processing device and method, imaging device, and computer-readable medium
JP2020036162A (en) Image processing device, imaging device, image processing method, and program
JP2023090628A (en) Image processing device, image processing method, and imaging device
JP5693647B2 (en) Image processing method, image processing apparatus, and imaging apparatus
JP2018151766A (en) Image processing apparatus, image processing method, and program
JP2015119436A (en) Imaging device
JP6624895B2 (en) Image processing apparatus, imaging apparatus, control method, and program
JP5264695B2 (en) Image processing method, image processing apparatus, and imaging apparatus