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

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP5932392B2
JP5932392B2 JP2012042388A JP2012042388A JP5932392B2 JP 5932392 B2 JP5932392 B2 JP 5932392B2 JP 2012042388 A JP2012042388 A JP 2012042388A JP 2012042388 A JP2012042388 A JP 2012042388A JP 5932392 B2 JP5932392 B2 JP 5932392B2
Authority
JP
Japan
Prior art keywords
correction amount
correction
luminance
composite image
amount
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.)
Expired - Fee Related
Application number
JP2012042388A
Other languages
Japanese (ja)
Other versions
JP2013179485A5 (en
JP2013179485A (en
Inventor
潤二 多田
潤二 多田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2012042388A priority Critical patent/JP5932392B2/en
Publication of JP2013179485A publication Critical patent/JP2013179485A/en
Publication of JP2013179485A5 publication Critical patent/JP2013179485A5/en
Application granted granted Critical
Publication of JP5932392B2 publication Critical patent/JP5932392B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Processing (AREA)
  • Picture Signal Circuits (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

本発明は画像処理装置および画像処理方法に関し、特には合成画像の明るさを調整する技術に関する。 The present invention relates to an image processing apparatus and an image processing method, and more particularly to a technique for adjusting the brightness of a composite image.

撮像素子を用いた撮像装置において、同一シーンを異なる露出で撮影した複数の画像を合成することで、撮像素子のダイナミックレンジより広い輝度分布を有するシーンでも、白トビおよび黒つぶれを低減した画像を得ることができる。このような撮影方法をHDR(High Dynamic Range)撮影、得られる画像をHDR画像などと呼ぶ。   In an imaging device using an image sensor, by combining multiple images of the same scene taken at different exposures, an image with reduced white stripes and blackout can be obtained even in a scene having a luminance distribution wider than the dynamic range of the image sensor. Can be obtained. Such a photographing method is called HDR (High Dynamic Range) photographing, and an obtained image is called an HDR image.

また、画像の輝度ヒストグラムや、顔情報などの被写体情報を解析し、好ましい明るさやコントラストの画像となるように階調補正を行うことが知られている。   It is also known to analyze the luminance histogram of an image and subject information such as face information and perform tone correction so as to obtain an image with favorable brightness and contrast.

例えば、背景が主被写体より著しく明るい、いわゆる逆光シーンは、ダイナミックレンジが広いシーンの典型例である。逆光シーンでの撮影画像は陰になる主被写体の部分が暗くなり、背景については輝度値が飽和して階調性がなくなってしまう現象(白トビと呼ぶ)が発生しやすい。従って、HDR撮影や、撮影画像のうち主被写体部分の輝度を上げる階調補正が有効である。   For example, a so-called backlight scene in which the background is significantly brighter than the main subject is a typical example of a scene with a wide dynamic range. In a captured image in a backlight scene, a shadowed main subject portion is darkened, and a phenomenon in which the luminance value of the background is saturated and gradation is lost (referred to as white stripes) easily occurs. Therefore, HDR shooting and gradation correction for increasing the luminance of the main subject portion in the shot image are effective.

HDR撮影と階調補正とを組み合わせて、主被写体および背景を適切な明るさに補正する手法も提案されている(特許文献1)。
また、階調補正の方法としては、各入力輝度値を所定の出力輝度値に変換する補正テーブル(トーンカーブ)を用いる方法がよく知られている。しかし、黒つぶれや白トビを抑制するために、暗い領域の輝度を上昇させ、明るい領域の輝度を低下させるトーンカーブを用いた階調補正を行うと、画像のコントラストを低下させることになる。
There has also been proposed a technique for correcting the main subject and the background to appropriate brightness by combining HDR shooting and gradation correction (Patent Document 1).
As a gradation correction method, a method using a correction table (tone curve) for converting each input luminance value into a predetermined output luminance value is well known. However, if tone correction is performed using a tone curve that increases the luminance of a dark region and decreases the luminance of a bright region in order to suppress blackout and white highlight, the contrast of the image is decreased.

一方、画像の輝度成分の低周波成分信号を用いて階調補正することで、いわゆる覆い焼きのような効果を得る方法が提案されている(特許文献2)。この方法ではトーンカーブを用いる方法に比べ、画像のコントラストの低下を抑制しつつ階調補正することができる。   On the other hand, a method has been proposed in which a gradation correction is performed using a low-frequency component signal of a luminance component of an image to obtain an effect like so-called dodging (Patent Document 2). In this method, tone correction can be performed while suppressing a decrease in contrast of the image as compared with a method using a tone curve.

特許第3424576号公報Japanese Patent No. 3424576 特開2008−072604号公報JP 2008-072604 A

しかしながら、HDR撮影やトーンカーブによる階調補正によって画像のダイナミックレンジを拡張しても、ディスプレイやプリンタなどの出力機器のダイナミックレンジは固定である。そのため、結局は出力機器のダイナミックレンジに圧縮する必要があり、コントラストが低下した画像になりやすい。   However, even if the dynamic range of an image is expanded by HDR shooting or tone correction using a tone curve, the dynamic range of an output device such as a display or a printer is fixed. Therefore, after all, it is necessary to compress to the dynamic range of the output device, and the image tends to have a reduced contrast.

また、特許文献2に記載されるような、輝度低周波成分を用いた階調補正は、例えば明るい部分に適用すると、コントラストが強くなりすぎ、不自然な画像になることがあった。   In addition, gradation correction using a low-frequency luminance component as described in Patent Document 2, for example, may be applied to a bright part, resulting in an unnatural image due to excessive contrast.

本発明は、このような従来技術の課題に鑑みてなされたものである。本発明は、HDR画像に対し、コントラストの低下を抑制しつつ、階調補正後の画像が不自然になりにくい階調補正を行うことが可能な画像処理装置および画像処理方法を提供することを目的とする。 The present invention has been made in view of such a problem of the prior art. The present invention provides an image processing apparatus and an image processing method capable of performing gradation correction on an HDR image while suppressing a decrease in contrast and preventing an image after gradation correction from becoming unnatural. Objective.

上述の目的は、異なる複数の露出量によって撮影された複数の画像を取得する取得手段と、複数の画を、画像間の露出量差が大きいほどコントラストを低下させるガンマ変換処理を適用してから合成することで合成画像を生成する合成手段と、合成画像の輝度情報に基づいて、合成画像の階調補正の目標補正量を算出する目標補正量算出手段と、目標補正量を実現するための、合成画像の輝度低周波成分を用いた階調補正の第1の補正量と、トーンカーブを用いた階調補正の第2の補正量とを決定する補正量決定手段と、第1の補正量に基づいて、合成画像に対して階調補正処理を適用する第1の階調補正手段と、第2の補正量に基づいて、合成画像に対して階調補正処理を適用する第2の階調補正手段と、を有し、補正量決定手段は、第1の補正量を、画像間の露出量差が大きいほど大きくなるように決定したのち、合成画像の主被写体の輝度が高いほど小さくなるように補正することによって決定することを特徴とする画像処理装置によって達成される。 The foregoing objects, an acquisition unit configured to acquire a plurality of images captured by a plurality of different exposure amounts, a plurality of images, by applying a gamma conversion processing for reducing the contrast as the exposure amount difference between the images is greater synthesizing means for generating a composite image by synthesizing from, based on the luminance information of the combined image, the target correction amount calculating means for calculating a target correction amount of gradation correction for the combined image, in order to achieve the target correction amount A correction amount determination means for determining a first correction amount of gradation correction using a luminance low-frequency component of a composite image and a second correction amount of gradation correction using a tone curve; A first gradation correction unit that applies gradation correction processing to the composite image based on the correction amount, and a second that applies gradation correction processing to the composite image based on the second correction amount. Gradation correction means, and the correction amount determination means The correction amount, after determined to be larger as the exposure amount difference between images is large, the image processing apparatus characterized by determining by correcting such brightness of the main subject of the composite image is decreased with increasing Achieved by:

このような構成により、本発明によれば、HDR画像に対し、コントラストの低下を抑制しつつ、階調補正後の画像が不自然になりにくい階調補正を行うことが可能である。   With such a configuration, according to the present invention, it is possible to perform gradation correction on an HDR image while suppressing a decrease in contrast and preventing an image after gradation correction from becoming unnatural.

本発明の第1の実施形態に係わる画像処理装置の一例である撮像装置100の構成を示すブロック図1 is a block diagram illustrating a configuration of an imaging apparatus 100 that is an example of an image processing apparatus according to a first embodiment of the present invention. 図1の露出量算出部の処理を説明するためのフローチャートThe flowchart for demonstrating the process of the exposure amount calculation part of FIG. 図1の階調補正量演算部の処理を説明するためのフローチャートThe flowchart for demonstrating the process of the gradation correction amount calculating part of FIG. 本発明の実施形態における顔輝度取得領域の例を示す図The figure which shows the example of the face luminance acquisition area in embodiment of this invention 顔が検出された場合の、本発明の実施形態における補正量算出部における階調補正特性の作成動作の例を説明するための図The figure for demonstrating the example of the production | generation operation | movement of the gradation correction characteristic in the correction amount calculation part in embodiment of this invention when a face is detected 顔が検出されなかった場合の、本発明の実施形態における補正量算出部における階調補正特性の作成動作の例を説明するための図The figure for demonstrating the example of the production | generation operation | movement of the gradation correction characteristic in the correction amount calculation part in embodiment of this invention when a face is not detected 図1の階調補正量演算部における、補正量算出処理を説明するためのフローチャートThe flowchart for demonstrating the correction amount calculation process in the gradation correction amount calculating part of FIG. 本発明の実施形態における、輝度低周波成分を用いた補正の補正量の例および露出量差による補正量の違いの例を示す図The figure which shows the example of the correction amount of the correction | amendment using the luminance low frequency component in the embodiment of this invention, and the example of the difference in the correction amount by exposure amount difference 本発明の実施形態における、輝度低周波成分を用いた補正の強度と、顔の代表輝度値との関係の例を示す図The figure which shows the example of the relationship between the intensity | strength of the correction | amendment using a brightness | luminance low frequency component, and the representative brightness value of a face in embodiment of this invention. 図1の階調補正部の処理を説明するためのフローチャートThe flowchart for demonstrating the process of the gradation correction | amendment part of FIG. 本発明の第2の実施形態における、目標補正量の分配方法の例を示す図The figure which shows the example of the distribution method of the target correction amount in the 2nd Embodiment of this invention.

(第1の実施形態)
以下、本発明の例示的な実施形態について、添付図面に基づいて詳細に説明する。
図1は、本発明の第1の実施形態に係わる画像処理装置の一例である撮像装置100の構成を示すブロック図である。撮像装置100はデジタルカメラ、デジタルビデオカメラなど、被写体を撮影し画像データを得る装置を含む。なお、本発明においては所定の露出量差で撮影された複数の画像を取得できれば足り、撮影に係る構成は必須ではない。
(First embodiment)
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.
FIG. 1 is a block diagram showing a configuration of an imaging apparatus 100 that is an example of an image processing apparatus according to the first embodiment of the present invention. The imaging apparatus 100 includes an apparatus that captures a subject and obtains image data, such as a digital camera or a digital video camera. In the present invention, it is sufficient if a plurality of images photographed with a predetermined exposure amount difference can be acquired, and a configuration relating to photographing is not essential.

撮像装置100の動作は、制御部102が制御している。また、制御部102は、ユーザ指示などの外部操作がインタフェース(I/F)101から入力されると、入力に応じて撮像装置100の動作を制御する。   The operation of the imaging apparatus 100 is controlled by the control unit 102. In addition, when an external operation such as a user instruction is input from the interface (I / F) 101, the control unit 102 controls the operation of the imaging apparatus 100 according to the input.

不図示の撮像レンズを通過した被写体光学像は、測光センサ103上に結像する。測光センサ103は複数に分割された測光領域を有し、各測光領域の被写体輝度を測光する。測光センサ103は、画素数が少ないことを除き、表示や記録のための画像を撮影する撮像素子105(後述)と同じ構成を有する光電変換素子であってよい。この場合、各測光領域には複数の画素が含まれてよい。   A subject optical image that has passed through an imaging lens (not shown) is formed on the photometric sensor 103. The photometric sensor 103 has a photometric area divided into a plurality of parts, and measures the subject brightness of each photometric area. The photometric sensor 103 may be a photoelectric conversion element having the same configuration as an imaging element 105 (described later) that captures an image for display or recording, except that the number of pixels is small. In this case, each photometric area may include a plurality of pixels.

露出量算出部104は、測光センサ103が測光した各測光領域の被写体輝度から、ハイダイナミックレンジ(HDR)撮影で用いる複数の露出量を決定する。本実施形態では、露出量の異なる撮影を3回行って得られる3枚の撮影画像を合成して1枚のHDR画像を生成するものとする。そして、露出量は、まず1つの露出量を決定し、この露出量に対して被写体をより明るく撮影する露出量と、被写体をより暗く撮影する露出量を決定する。最初に決定する露出量を、便宜上、基準露出量または中間露出量と呼ぶ。また、中間露出量に対して被写体をより明るく撮影する露出量を露出量(+)、中間露出量に対して被写体をより暗く撮影する露出量を露出量(−)と呼ぶ。   The exposure amount calculation unit 104 determines a plurality of exposure amounts to be used in high dynamic range (HDR) shooting from the subject luminance of each photometric area measured by the photometric sensor 103. In the present embodiment, one HDR image is generated by synthesizing three photographed images obtained by performing photographing with different exposure amounts three times. As for the exposure amount, first, one exposure amount is determined, and an exposure amount for photographing the subject brighter than this exposure amount and an exposure amount for photographing the subject darker are determined. For the sake of convenience, the exposure amount determined first is referred to as a reference exposure amount or an intermediate exposure amount. Also, the exposure amount for photographing the subject brighter than the intermediate exposure amount is called exposure amount (+), and the exposure amount for photographing the subject darker than the intermediate exposure amount is called exposure amount (−).

露出量算出部104の動作を、図2のフローチャートを用いて説明する。
S201で露出量算出部104は、中間露出量を算出する。具体的には、露出量算出部104は、測光センサ103から取得した各測光領域の被写体輝度(Bv値)に基づいて、測光値のヒストグラムを生成する。そして、露出量算出部104は、ヒストグラムを用いて、適正な露出量を算出して、中間露出量(Ev値)とする。中間露出量はユーザがインタフェース101を通じて指定してもよいが、ここでは、測光値に基づいて公知の露出量算出方法(中央部重点測光、スポット測光、多分割測光など)により適切な露出量を算出し、中間露出量とする。
The operation of the exposure amount calculation unit 104 will be described with reference to the flowchart of FIG.
In S201, the exposure amount calculation unit 104 calculates an intermediate exposure amount. Specifically, the exposure amount calculation unit 104 generates a photometric value histogram based on the subject luminance (Bv value) of each photometric area acquired from the photometric sensor 103. Then, the exposure amount calculation unit 104 calculates an appropriate exposure amount using a histogram and sets it as an intermediate exposure amount (Ev value). The intermediate exposure amount may be specified by the user through the interface 101, but here, an appropriate exposure amount is determined by a known exposure amount calculation method (center-weighted metering, spot metering, multi-segment metering, etc.) based on the metering value. Calculate and use as intermediate exposure.

式(1)に、被写体輝度(Bv値)と露出量(Ev値)と入射光を撮像素子で蓄積する露光時間(Tv値)と入射光がレンズを通過する量(Av値)と撮像素子から得られる信号のゲイン量(Sv値)の関係を示す。
Ev = Sv + Bv = Tv + Av (1)
In Expression (1), subject brightness (Bv value), exposure amount (Ev value), exposure time (Tv value) in which incident light is accumulated in the image sensor, amount of incident light passing through the lens (Av value), and image sensor The relationship of the gain amount (Sv value) of the signal obtained from (1) is shown.
Ev = Sv + Bv = Tv + Av (1)

なお、ここでの加算は被写体輝度、露出量、露光時間、ゲイン量をAPEX(Additive System of Photographic Exposure)値に換算して行うものである。APEX値の詳細については、例えば「ディジタルスチルカメラ用画像ファイルフォーマット規格(Exif) Version 2.1」の「付録C APEXについて」を参照されたい。近年、Sv値が5(=ISO100)の場合のEv値(=Ev100)を被写体輝度として簡易的に扱うことが多いため、本実施形態でもEv100を用いて被写体輝度を表すものとする。 Note that the addition here is performed by converting subject brightness, exposure amount, exposure time, and gain amount into APEX (Additive System of Photographic Exposure) values. For details of the APEX value, refer to, for example, “Appendix C APEX” of “Image File Format Standard (Exif) Version 2.1 for Digital Still Camera”. In recent years, the Ev value (= Ev 100 ) in the case where the Sv value is 5 (= ISO 100 ) is often simply handled as the subject brightness. Therefore, Ev 100 is also used in this embodiment to represent the subject brightness.

S202で露出量算出部104は、被写体の輝度レンジを算出する。露出量算出部104は、例えば、測光値のヒストグラムの最大(最明)測光値と最小(最暗)測光値の差分を、被写体の輝度レンジとして算出することができる。ただし、点光源など、孤立した輝度値の影響を考慮する場合は、最大(最明)測光値から順に複数の測光値を平均した値と、最小(最暗)測光値から順に複数の測光値を平均した値との差分を輝度レンジとして算出してもよい。   In S202, the exposure amount calculation unit 104 calculates the luminance range of the subject. The exposure amount calculation unit 104 can calculate, for example, the difference between the maximum (brightest) photometric value and the minimum (darkest) photometric value in the histogram of photometric values as the luminance range of the subject. However, when considering the influence of isolated brightness values such as point light sources, the average of multiple photometric values in order from the maximum (lightest) photometric value and the multiple photometric values in sequence from the minimum (darkest) photometric value The difference from the averaged value may be calculated as the luminance range.

S203で露出量算出部104は、算出した輝度レンジを用いて、中間露出量と露出量(+)との差、および、中間露出量と露出量(−)との差の少なくとも一方を露出量差として決定する。   In S203, the exposure amount calculation unit 104 uses the calculated luminance range to calculate at least one of the difference between the intermediate exposure amount and the exposure amount (+) and the difference between the intermediate exposure amount and the exposure amount (−). Determine as the difference.

露出量差は、輝度レンジが大きくなるほど大きくなるように決定することができる。例えば、予め用意した、輝度レンジと露出量差とを関連付けたテーブルを用いて決定することができる。また、テーブルを用いる代わりに、同様の特性を有する、輝度レンジを引数とする関数を予め定義しておき、輝度レンジに応じて露出量差を算出してもよい。   The exposure amount difference can be determined so as to increase as the luminance range increases. For example, it can be determined using a table that is prepared in advance and associates a luminance range with an exposure amount difference. Further, instead of using a table, a function having the same characteristics and having a luminance range as an argument may be defined in advance, and the exposure amount difference may be calculated according to the luminance range.

輝度レンジと露出量差との関係は1通りに限定されない。例えば、撮像素子のダイナミックレンジ不足による白とびや黒つぶれの解消を目的として、より大きな露出量差を算出するような関係としたり、画像のコントラスト維持を目的として、より小さな露出量差を算出するような関係としてもよい。また、露出量差をユーザがインタフェース101から指定してもよい。なお、露出量差は、露出量(+)と露出量(−)とで異なっていてもよい。
このようにして、中間露出量と、露出量(+)および露出量(−)との露出量差が決定される。
The relationship between the brightness range and the exposure amount difference is not limited to one. For example, in order to eliminate overexposure and underexposure due to insufficient dynamic range of the image sensor, a larger exposure amount difference is calculated, or a smaller exposure amount difference is calculated for the purpose of maintaining image contrast. It is good also as such a relationship. Further, the exposure amount difference may be designated by the user from the interface 101. Note that the exposure amount difference may be different between the exposure amount (+) and the exposure amount (−).
In this way, the exposure amount difference between the intermediate exposure amount and the exposure amount (+) and the exposure amount (−) is determined.

なお、ここで説明したHDR撮影用の露出条件の設定は、インタフェース101に含まれるシャッターボタンの半押しのような、撮影準備指示に応答して行われる。そして、シャッターボタンが半押し状態から全押し状態になって撮影開始指示が与えられると、設定された複数の露出量による各撮影条件によって、複数回(ここでは3回)の撮影が行われる。ここで、便宜的に、中間露出量で撮影された画像を適正画像、露出量(+)で撮影された画像をオーバー画像、露出量(−)で撮影された画像をアンダー画像と呼ぶこととする。   Note that the setting of the exposure conditions for HDR shooting described here is performed in response to a shooting preparation instruction such as half-pressing the shutter button included in the interface 101. When the shutter button is changed from the half-pressed state to the fully-pressed state and a shooting start instruction is given, shooting is performed a plurality of times (here, three times) according to each shooting condition with a plurality of set exposure amounts. Here, for convenience, an image shot with an intermediate exposure amount is called an appropriate image, an image shot with an exposure amount (+) is called an over image, and an image shot with an exposure amount (−) is called an under image. To do.

なお、露出条件の設定は必須ではなく、所定の露出量差で撮影された複数の画像を取得し、画像から露出量差を検出してもよい。露出量差は例えば画像の付属データ(Exifデータのような付随情報)記録された撮影条件に基づいて検出することができる。また、合成に係る画像は基本的に同一シーンを撮影した画像であるから、画像の輝度を比較することによっても露出量差を検出することができる。   The setting of the exposure condition is not essential, and a plurality of images taken with a predetermined exposure amount difference may be acquired and the exposure amount difference may be detected from the images. The difference in exposure amount can be detected based on, for example, the photographing condition recorded in the attached data of the image (accompanying information such as Exif data). Further, since the image related to the composition is basically an image of the same scene, the exposure amount difference can also be detected by comparing the luminance of the images.

図1を再度参照する。各撮影において、不図示の撮像レンズを通過した被写体光学像によって撮像素子105が露光され、撮像素子105の各画素で、受光量に応じた電荷に変換される。撮像素子105は例えばR(赤)、G(緑)、B(青)の領域が配列されたカラーフィルタを備える。各色領域はそれぞれの色の波長帯域周辺の分光感度を持ち、各領域に対応して設けられた画素(光電変換素子)は、各カラーフィルタを通過した帯域の光をそれぞれ光電変換する。   Please refer to FIG. 1 again. In each photographing, the image sensor 105 is exposed by an object optical image that has passed through an imaging lens (not shown), and is converted into a charge corresponding to the amount of light received by each pixel of the image sensor 105. For example, the image sensor 105 includes a color filter in which R (red), G (green), and B (blue) regions are arranged. Each color region has spectral sensitivity around the wavelength band of each color, and a pixel (photoelectric conversion element) provided corresponding to each region photoelectrically converts light in the band that has passed through each color filter.

各光電変換素子により変換された電荷は、撮像素子105から電気信号としてA/D変換部106に出力され、A/D変換処理によりデジタル信号(画像データ)に変換される。A/D変換部106から出力されたデジタル信号は、現像処理部107に送られる。   The electric charge converted by each photoelectric conversion element is output as an electric signal from the imaging element 105 to the A / D conversion unit 106 and converted into a digital signal (image data) by A / D conversion processing. The digital signal output from the A / D conversion unit 106 is sent to the development processing unit 107.

現像処理部107では、各露出量の画像の現像処理を行い、HDR画像に適した中間画像を生成する。ここでは公知のホワイトバランス処理、ノイズリダクション処理、ガンマ変換処理などを行う。これらの処理は公知の方法で良いが、ガンマ変換処理は露出量に応じた形状のガンマ曲線を用いて行う(例えば、露出量に応じたガンマ変換テーブルを用意しておく)。これはHDR撮影によって、暗部と明部の階調性を良好にするためである。具体的には、オーバー画像に適用するガンマ曲線は暗部がより明るくなるような形状とし、アンダー画像に適用するガンマ曲線は明部の白トビを抑えるような形状とする。また、アンダー画像およびオーバー画像の露出量差が大きいほど、ダイナミックレンジを拡張する効果を出すために、暗部を明るく、明部を暗くする。すなわち、ガンマ曲線は、合成する複数の画像の露出量差が大きいほど、コントラストを小さくする形状とする。   The development processing unit 107 performs development processing for each exposure amount image, and generates an intermediate image suitable for the HDR image. Here, known white balance processing, noise reduction processing, gamma conversion processing, and the like are performed. These processes may be performed by known methods, but the gamma conversion process is performed using a gamma curve having a shape corresponding to the exposure amount (for example, a gamma conversion table corresponding to the exposure amount is prepared). This is to improve the gradation of the dark part and the bright part by HDR imaging. Specifically, the gamma curve applied to the over image has a shape that makes the dark portion brighter, and the gamma curve applied to the under image has a shape that suppresses white highlight in the bright portion. Further, in order to produce an effect of extending the dynamic range as the exposure amount difference between the under image and the over image increases, the dark part is brightened and the bright part is darkened. That is, the gamma curve has a shape in which the contrast is reduced as the exposure amount difference between a plurality of images to be combined is increased.

画像合成部108では、複数回の撮影で生成された複数の中間画像を合成してHDR画像を生成する。画像合成部108は例えば、適正画像の明るい領域にはアンダー画像が、適正画像の暗い領域にはオーバー画像が用いられるように、アンダー画像とオーバー画像とを適正画像へ合成して、HDR画像を生成する。   The image synthesizing unit 108 synthesizes a plurality of intermediate images generated by a plurality of shootings to generate an HDR image. For example, the image combining unit 108 combines the under image and the over image into the appropriate image so that the under image is used for the bright area of the appropriate image and the over image is used for the dark area of the appropriate image, and the HDR image is generated. Generate.

階調補正量演算部109は、合成画像に対して階調補正を行う。階調補正量演算部109は、輝度低周波成分検出部110、ヒストグラム検出部111、顔検出部112、補正量算出部113、階調補正部114から構成される。   The gradation correction amount calculation unit 109 performs gradation correction on the composite image. The gradation correction amount calculation unit 109 includes a luminance low frequency component detection unit 110, a histogram detection unit 111, a face detection unit 112, a correction amount calculation unit 113, and a gradation correction unit 114.

階調補正量演算部109で行う階調補正処理について、図3のフローチャートを用いて説明する。
S301では、輝度低周波成分検出部110が、合成画像の画素値から輝度成分を抽出し、ローパスフィルタ処理を行う。本実施形態ではフィルタサイズの異なる3つの空間ローパスフィルタを用いて3つの低周波成分画像を生成する。ここで、元画像と、低周波成分画像の大きさは一致しなくてもよい。例えば、輝度成分を抽出する際に、入力画像データに対して縮小処理を施しても良い。縮小処理は公知の任意の方法で良いが、例えば間引き処理、最近傍法、平均値法などで容易に実現できる。
The tone correction processing performed by the tone correction amount calculation unit 109 will be described with reference to the flowchart of FIG.
In S301, the luminance low-frequency component detection unit 110 extracts a luminance component from the pixel value of the composite image and performs low-pass filter processing. In the present embodiment, three low-frequency component images are generated using three spatial low-pass filters having different filter sizes. Here, the sizes of the original image and the low-frequency component image do not have to match. For example, when extracting the luminance component, the input image data may be reduced. The reduction process may be any known method, but can be easily realized by, for example, a thinning process, a nearest neighbor method, an average value method, or the like.

S302では、顔検出部112が顔検出前処理を行う。これは画像データに対して縮小処理、ガンマ処理等を施して、顔を容易に検出しやすいようにする処理である。
S303で顔検出部112は、前処理した画像データに対し、公知の方法を用いて顔検出処理を実行する。顔検出処理により、顔と思われる領域(顔領域)と、検出の信頼度とが得られる。
In S302, the face detection unit 112 performs face detection preprocessing. This is a process that makes it easy to detect a face by performing reduction processing, gamma processing, or the like on the image data.
In S303, the face detection unit 112 performs face detection processing on the preprocessed image data using a known method. By the face detection process, an area that is considered to be a face (face area) and detection reliability are obtained.

S304で顔検出部112は、S303の顔検出処理により検出された顔領域のうち、信頼度があらかじめ設定した評価閾値より高い顔領域がある場合に、顔が検出されたと判定する。顔が検出されたと判定された場合にはS305に、顔が検出されなかったと判定された場合にはS307に移行する。   In S304, the face detection unit 112 determines that a face has been detected when there is a face area whose reliability is higher than a preset evaluation threshold among the face areas detected by the face detection process in S303. If it is determined that a face has been detected, the process proceeds to S305. If it is determined that no face has been detected, the process proceeds to S307.

S305で顔検出部112は、信頼度が評価閾値より高い顔領域の一部の領域を、顔輝度取得領域として算出する。たとえば、顔検出部112は、図4に示すように、画像データ401から検出された顔領域402の中の両眼の下の領域403,405及び、その中間の領域404の3箇所に位置する同じ大きさの正方形の領域を、顔輝度取得領域として算出する。個々の領域の大きさは、顔領域の大きさによって決定する。顔輝度取得領域は、顔の明るい部分の輝度を取得するための領域であり、その数や位置などに関して特に制限はない。   In step S <b> 305, the face detection unit 112 calculates a part of the face area whose reliability is higher than the evaluation threshold as a face luminance acquisition area. For example, as shown in FIG. 4, the face detection unit 112 is located at three locations in the face area 402 detected from the image data 401, the areas 403 and 405 below both eyes and the intermediate area 404. A square area having the same size is calculated as the face luminance acquisition area. The size of each area is determined by the size of the face area. The face luminance acquisition area is an area for acquiring the luminance of the bright part of the face, and there is no particular limitation on the number and position thereof.

S306で顔検出部112は、検出された顔の代表輝度値を算出する。ここでは信頼度が評価閾値より高い顔領域の各々について、顔輝度取得領域403〜405の平均輝度値を合成画像から算出し、最大値を代表輝度値とする。ここで、輝度の最大値を用いるのは、輝度低周波成分やトーンカーブを用いた補正が過補正となることの防止を重視しているためである。   In step S306, the face detection unit 112 calculates a representative luminance value of the detected face. Here, for each face area whose reliability is higher than the evaluation threshold, the average brightness value of the face brightness acquisition areas 403 to 405 is calculated from the synthesized image, and the maximum value is set as the representative brightness value. Here, the reason why the maximum value of luminance is used is that importance is attached to prevention of overcorrection of correction using a low-frequency luminance component or a tone curve.

S304で顔領域が検出されなかったと顔検出部112に判定された場合、S307でヒストグラム検出部111が画像の輝度ヒストグラムを生成する。合成画像の全画素の輝度ヒストグラムを生成することが望ましいが、処理時間やメモリ量の節約のために、間引き処理やローパスフィルタ処理等によって縮小した合成画像についてヒストグラムを生成してもよい。なお、画像の端の部分は、一般に重要でないことが多く、また撮像レンズによっては周辺光量の低下の影響を受ける部分であるため、周縁部の画素を除いてヒストグラムを作成してもよい。   If the face detection unit 112 determines that no face area has been detected in S304, the histogram detection unit 111 generates a luminance histogram of the image in S307. Although it is desirable to generate a luminance histogram of all pixels of the composite image, a histogram may be generated for the composite image reduced by thinning processing, low-pass filter processing, or the like in order to save processing time and memory capacity. It should be noted that the edge portion of the image is generally not important in many cases, and depending on the imaging lens, it is a portion that is affected by a decrease in the amount of peripheral light. Therefore, a histogram may be created excluding the peripheral pixels.

S308では、ヒストグラム検出部111がヒストグラム特徴量を検出する。ヒストグラム特徴量は例えば、ヒストグラムで暗部側から累積度数が10%である画素が属するレベル(SD)等であってよい。   In S308, the histogram detection unit 111 detects a histogram feature amount. The histogram feature amount may be, for example, a level (SD) to which a pixel having a cumulative frequency of 10% from the dark side in the histogram belongs.

S309で、目標補正量算出手段としての補正量算出部113は、合成画像の輝度情報に基づいて、目標補正量を算出する。補正量算出部113は、顔が検出されたと判定されている場合、顔の代表輝度値に対する目標輝度を求め、目標輝度と、合成画像の画素の最大輝度の最小輝度とからスプライン補間などにより、各入力輝度に対する目標出力輝度を算出する。入力輝度と目標出力輝度の差が目標補正量であり、各入力輝度に対する目標出力輝度により形成されるトーンカーブが階調補正特性を表す。階調補正特性は、例えば、入力輝度と目標出力輝度との対応を示すルックアップテーブルによって表現することができる。   In step S309, the correction amount calculation unit 113 serving as a target correction amount calculation unit calculates a target correction amount based on the luminance information of the composite image. When it is determined that a face has been detected, the correction amount calculation unit 113 obtains a target luminance with respect to the representative luminance value of the face, and performs spline interpolation or the like from the target luminance and the minimum luminance of the maximum luminance of the pixels of the composite image. A target output luminance for each input luminance is calculated. The difference between the input luminance and the target output luminance is the target correction amount, and a tone curve formed by the target output luminance with respect to each input luminance represents the gradation correction characteristic. The gradation correction characteristic can be expressed by, for example, a look-up table indicating the correspondence between input luminance and target output luminance.

図5を参照して補正量算出部113の階調補正特性の作成動作の例を説明する。図5(a)は、顔の代表輝度値と、3つの入力輝度値(64LSB,128LSB,224LSB)に対する目標輝度との関係の例を示す。なお、LSBは分解能を意味し、本実施形態では輝度値のフルスケール(最小値〜最大値)を8ビットの分解能(0〜255LSB)で表すものとする。   An example of the gradation correction characteristic creation operation of the correction amount calculation unit 113 will be described with reference to FIG. FIG. 5A shows an example of the relationship between the representative luminance value of the face and the target luminance with respect to the three input luminance values (64LSB, 128LSB, and 224LSB). Note that LSB means resolution, and in the present embodiment, the full scale (minimum value to maximum value) of the luminance value is represented by 8-bit resolution (0 to 255 LSB).

図5(a)において、「64LSBの点」に対応する横方向の線は、入力輝度が64LSBの画素の目標出力輝度と、顔の代表輝度値との関係を示している。例えば、撮影された画像から検出された顔の代表輝度値が255LSB〜180LSBの範囲であれば、その画像のうち64LSBの輝度を有する画素の目標出力輝度は64LSB(すなわち、変化無し)である。また、顔の代表輝度値が45LSB〜0LSBの範囲の画像においては、64LSBの輝度を有する画素の目標出力輝度は128LSBである。そして、顔の代表輝度値が180〜45の範囲では、64LSBの輝度を有する画素の目標出力輝度は64LSBから128LSBの間で線形に変化する。   In FIG. 5A, the horizontal line corresponding to “64 LSB point” indicates the relationship between the target output luminance of the pixel having the input luminance of 64 LSB and the representative luminance value of the face. For example, if the representative luminance value of the face detected from the captured image is in the range of 255 LSB to 180 LSB, the target output luminance of a pixel having a luminance of 64 LSB in the image is 64 LSB (that is, no change). In addition, in an image whose face representative luminance value is in the range of 45 LSB to 0 LSB, the target output luminance of a pixel having a luminance of 64 LSB is 128 LSB. When the face representative luminance value is in the range of 180 to 45, the target output luminance of a pixel having a luminance of 64 LSB changes linearly between 64 LSB and 128 LSB.

顔の代表輝度値が110LSBである場合、64LSB、128LSBおよび224LSBの輝度を有する画素の目標出力輝度はそれぞれ図5(a)から97LSB,159LSBおよび228LSBである。従って、顔の代表輝度値が110LSBの画像に対する階調補正特性は、この3点の入出力関係を表す3点と輝度の最低値(0LSB)および最高値(255LSB)に対応する点とをスプライン補間することにより、図5(b)の様に得られる。なお、図5(a)に示す、顔の代表輝度値に応じた代表的な輝度値の入出力関係を示す補正テーブルは、「弱め」、「標準」、「強め」など、設定可能な度合いごとに、予め補正量算出部113に用意しておくことができる。   When the representative brightness value of the face is 110LSB, the target output brightness of the pixels having the brightness of 64LSB, 128LSB and 224LSB are 97LSB, 159LSB and 228LSB from FIG. 5 (a), respectively. Therefore, the gradation correction characteristic for an image having a face representative luminance value of 110 LSB is a spline of three points representing the input / output relationship of the three points and the point corresponding to the lowest value (0LSB) and the highest value (255LSB). By interpolating, it is obtained as shown in FIG. The correction table showing the input / output relationship of representative luminance values according to the representative luminance value of the face shown in FIG. 5A is a settable degree such as “weak”, “standard”, “strong”, etc. Each of them can be prepared in advance in the correction amount calculation unit 113.

また、顔が検出されなかった画像に対する階調補正特性の作成方法について図6を用いて説明する。図6は、図5(a)の階調補正特性における入力値を、顔の代表輝度から、ヒストグラムで暗部側から累積度数が10%である画素が属するレベル(SD)の検出値に置き換えたものである。この階調補正特性を用い、顔が検出できたと判定した場合と同様に補正量を算出することができる。なお、この補正テーブルも、「弱め」、「標準」、「強め」など、設定可能な度合いごとに、予め補正量算出部113に用意しておくことができる。   A method for creating gradation correction characteristics for an image in which no face has been detected will be described with reference to FIG. In FIG. 6, the input value in the gradation correction characteristic of FIG. 5A is replaced with the detected value of the level (SD) to which the pixel having a cumulative frequency of 10% from the dark side in the histogram from the representative luminance of the face. Is. Using this gradation correction characteristic, the correction amount can be calculated in the same manner as when it is determined that the face has been detected. This correction table can also be prepared in advance in the correction amount calculation unit 113 for each settable degree, such as “weak”, “standard”, and “strong”.

HDR撮影では、通常撮影の場合と比較して、逆光シーンであっても被写体が明るめに撮影される。ため、図5および図6に示した補正テーブルは、HDR撮影用とそれ以外の通常撮影用とで特性を異ならせ、HDR撮影用の補正テーブルでは補正を弱めるようにしてもよい。   In HDR shooting, the subject is shot brighter even in a backlight scene as compared to normal shooting. Therefore, the correction tables shown in FIG. 5 and FIG. 6 may have different characteristics for HDR shooting and other normal shooting, and the correction may be weakened in the HDR shooting correction table.

図3に戻ってS310で補正量算出部113は、輝度低周波成分を用いた補正及び、トーンカーブを用いた補正のそれぞれについて補正量を算出し、算出した補正量を階調補正部114に出力する。   Returning to FIG. 3, in step S <b> 310, the correction amount calculation unit 113 calculates a correction amount for each of the correction using the low-frequency luminance component and the correction using the tone curve, and sends the calculated correction amount to the gradation correction unit 114. Output.

図7に示すフローチャートを用いて、S310における補正量算出処理について説明する。
S701で、補正量決定手段としての補正量算出部113は、露出量(+)と中間露出量との露出量差および、露出量(−)と中間露出量との露出量差に応じて、第1の補正量としての輝度低周波成分を用いた補正の補正量を決定する。これは図8に示すように輝度低周波成分を用いた補正の補正量をテーブル等によってあらかじめ用意しておけばよい。図8では、中間露出量に対する露出量(+)と露出量(−)の露出量差が等しいものとし、±1段、±2段、±3段の3通りの補正特性曲線を示している。輝度低周波成分を用いた補正は、露出量差が大きいほど補正量が大きくなる特性としている。これは、上述したように、合成する複数の画像の露出量差が大きいほど、コントラストを低下させるようなガンマ変換処理を行っているからである。輝度低周波成分を用いた補正の補正量を便宜上、補正量(A)とする。
The correction amount calculation process in S310 will be described using the flowchart shown in FIG.
In step S <b> 701, the correction amount calculation unit 113 serving as a correction amount determination unit determines the exposure amount difference between the exposure amount (+) and the intermediate exposure amount and the exposure amount difference between the exposure amount (−) and the intermediate exposure amount. A correction amount for correction using the luminance low frequency component as the first correction amount is determined. As shown in FIG. 8, a correction amount for correction using a low-frequency luminance component may be prepared in advance using a table or the like. In FIG. 8, the exposure amount difference between the exposure amount (+) and the exposure amount (−) with respect to the intermediate exposure amount is assumed to be equal, and three correction characteristic curves of ± 1 step, ± 2 steps, and ± 3 steps are shown. . The correction using the low-frequency luminance component has a characteristic that the correction amount increases as the exposure amount difference increases. This is because, as described above, the gamma conversion process is performed such that the contrast decreases as the exposure amount difference between the plurality of images to be combined increases. For the sake of convenience, the correction amount using the luminance low frequency component is set as a correction amount (A).

S702で補正量算出部113は、顔検出部112によって顔が検出されたと判定されているかどうか判別する。顔が検出されたと判定されている場合にはS703に、顔が検出されなかったと判定されている場合にはS704に移行する。   In step S <b> 702, the correction amount calculation unit 113 determines whether the face detection unit 112 determines that a face has been detected. If it is determined that a face has been detected, the process proceeds to S703. If it is determined that no face has been detected, the process proceeds to S704.

S703で補正量算出部113は、補正量(A)を、顔の代表輝度値に応じて補正する。具体的には、補正量算出部113は、例えば図9に示すような、顔の代表輝度値と輝度低周波成分を用いた補正の強度との予め定めた関係に基づいて、補正係数を求め、補正量(A)を補正する。基本的には、顔の代表輝度が高いほど、輝度低周波成分を用いた補正の強度を低下させる。これは、順光シーンに含まれるような明るい顔は、もともとコントラストが小さいため、明るい顔に対して輝度低周波成分を用いた補正によってコントラストをつけると不自然な画像になるためである。   In step S <b> 703, the correction amount calculation unit 113 corrects the correction amount (A) according to the representative luminance value of the face. Specifically, the correction amount calculation unit 113 obtains a correction coefficient based on a predetermined relationship between the representative luminance value of the face and the intensity of correction using the luminance low frequency component, for example, as shown in FIG. The correction amount (A) is corrected. Basically, the higher the representative luminance of the face is, the lower the intensity of correction using the luminance low frequency component is. This is because a bright face included in a follow light scene originally has a low contrast, and therefore, if a contrast is applied to a bright face by correction using a low-frequency luminance component, an unnatural image is obtained.

S704で、補正量決定手段としての補正量算出部113は、第2の補正量としての、トーンカーブを用いた補正の補正量(補正量(B)とする)を決定する。ここで補正量算出部113は、目標補正量と、顔の代表輝度値に応じて補正した補正量(A)との差分を、補正量(B)として求める。これにより、目標補正量を補正量(A)および補正量(B)とで実現できる。   In step S <b> 704, the correction amount calculation unit 113 serving as a correction amount determination unit determines a correction amount (referred to as a correction amount (B)) using the tone curve as the second correction amount. Here, the correction amount calculation unit 113 calculates a difference between the target correction amount and the correction amount (A) corrected according to the representative luminance value of the face as the correction amount (B). Thereby, the target correction amount can be realized by the correction amount (A) and the correction amount (B).

図1の階調補正部114では、合成画像に対し、輝度低周波成分を用いた補正(補正量A))およびトーンカーブを用いた補正(補正量(B))を適用して階調補正処理を行う。   The gradation correction unit 114 in FIG. 1 applies gradation correction (correction amount A) using a low-frequency luminance component and correction (correction amount (B)) using a tone curve to the composite image. Process.

階調補正処理について、図10のフローチャートを用いて説明する。
S1001で第1の階調補正手段としての階調補正部114は、合成画像に対し、輝度低周波成分を用いた輝度補正処理を行う。この輝度補正処理は、例えば特許文献2に記載された方法で行ってよい。すなわち、スケール変換した輝度成分の分布を対数変換し、異なる尺度(異なる解像度)での平均値を求め、もとの輝度成分の対数変換との差分を出力し、逆変換(exp演算)により元の輝度単位に戻す処理を行う。ここで、画像に応じて補正の度合いを調節するために、スケール変換した輝度成分の対数変換出力に度合いを調節する係数を乗ずる。以上説明した処理に基づく補正後の輝度成分は以下に示す式(2)のようになる。

Figure 0005932392
但し、Y’(x,y)は座標値が(x,y)の補正後の輝度成分、Fn(x,y)は座標(x,y)におけるガウシアン関数、nは尺度を表すパラメータである。また、γ0およびγ1は、補正の度合いを調節する係数である。また、*は積和演算、Avgは平均値演算を表す。 The gradation correction process will be described with reference to the flowchart of FIG.
In step S <b> 1001, the gradation correction unit 114 serving as a first gradation correction unit performs luminance correction processing using a luminance low-frequency component on the composite image. This brightness correction processing may be performed by the method described in Patent Document 2, for example. That is, logarithmic transformation of the scaled luminance component distribution is performed, an average value at a different scale (different resolution) is obtained, a difference from the logarithmic transformation of the original luminance component is output, and the original is obtained by inverse transformation (exp calculation). The process of returning to the luminance unit is performed. Here, in order to adjust the degree of correction according to the image, the logarithm conversion output of the scaled luminance component is multiplied by a coefficient for adjusting the degree. The luminance component after correction based on the processing described above is expressed by the following equation (2).
Figure 0005932392
However, Y ′ (x, y) is a corrected luminance component with coordinate value (x, y), Fn (x, y) is a Gaussian function at coordinates (x, y), and n is a parameter representing a scale. . Γ0 and γ1 are coefficients for adjusting the degree of correction. * Represents a product-sum operation, and Avg represents an average value operation.

この輝度変換をハードウェア処理で実行する場合には、例えば、平均値演算回路、ルックアップテーブルを作成する回路、テーブル記憶部、テーブル参照回路(ガンマ変換の部分)、除算回路によって構成できる。なお、平均値演算回路は低周波輝度信号を抽出する部分に設けてもよい。   When this luminance conversion is executed by hardware processing, it can be constituted by, for example, an average value calculation circuit, a circuit for creating a lookup table, a table storage unit, a table reference circuit (gamma conversion part), and a division circuit. Note that the average value calculation circuit may be provided in a portion for extracting the low-frequency luminance signal.

S1002で階調補正部114は、輝度低周波成分を用いた輝度補正処理に伴う色調整処理(第1の色調整処理)を行う。第1の色調整処理では、輝度補正処理前後の画像の色ができるだけ変化しないように、色成分を輝度補正量にしたがって修正する。例えば、色成分X(x,y)、Z(x,y)にそれぞれ輝度成分の変更前後の比Y’(x,y)/Y(x,y)を乗算する。Y(x,y)のみY’(x,y)に変更し、色成分X(x,y)、Z(x,y)に対しては処理を行わないことによる処理の簡略化を行ってもよい。   In step S <b> 1002, the gradation correction unit 114 performs color adjustment processing (first color adjustment processing) associated with the luminance correction processing using the luminance low-frequency component. In the first color adjustment process, the color components are corrected according to the luminance correction amount so that the colors of the images before and after the luminance correction process are not changed as much as possible. For example, the color components X (x, y) and Z (x, y) are multiplied by the ratio Y ′ (x, y) / Y (x, y) before and after the change of the luminance component, respectively. Only Y (x, y) is changed to Y ′ (x, y), and the processing is simplified by not performing processing on the color components X (x, y) and Z (x, y). Also good.

S1003で第2の階調補正手段としての階調補正部114は、トーンカーブを用いた輝度補正処理を行う。階調補正部114は、各入力輝度に対する出力輝度データの関係を示すルックアップテーブルを用いて補正することができる。   In step S1003, the gradation correction unit 114 as the second gradation correction unit performs luminance correction processing using a tone curve. The gradation correction unit 114 can perform correction using a look-up table indicating the relationship of output luminance data with respect to each input luminance.

S1004で階調補正部114は、トーンカーブを用いた輝度補正処理に伴う色調整処理(第2の色調整処理)を行う。第2の色調整処理は、S1002で行う第1の色調整処理と同様であってよい。また、第1の色調整処理を行わずに、輝度低周波成分を用いた輝度補正処理及びトーンカーブを用いた補正処理による輝度値の変更に応じた第2の色調整処理だけを行ってもよい。   In step S1004, the gradation correction unit 114 performs color adjustment processing (second color adjustment processing) associated with the luminance correction processing using the tone curve. The second color adjustment process may be the same as the first color adjustment process performed in S1002. Further, without performing the first color adjustment process, only the second color adjustment process corresponding to the change of the luminance value by the luminance correction process using the luminance low frequency component and the correction process using the tone curve may be performed. Good.

図1の画像データ出力部115では、階調補正部114によって輝度補正処理された合成画像を、予め定められた画像ファイルの形式にして出力する。例えば、ファイル形式をJPEGファイルに変換する場合には、画像データをYCrCb形式に3次元マトリックス変換して付属データを添付することでJPEGファイル形式に変換する。画像データ出力部115は、画像ファイルをメモリカードのような記録媒体に記録したり、外部装置に出力したりすることができる。   The image data output unit 115 in FIG. 1 outputs the composite image that has been subjected to the luminance correction processing by the gradation correction unit 114 in the form of a predetermined image file. For example, when the file format is converted to a JPEG file, the image data is converted into a JPEG file format by three-dimensional matrix conversion into YCrCb format and attached data. The image data output unit 115 can record the image file on a recording medium such as a memory card or output it to an external device.

以上説明したように、本実施形態によれば、HDR画像に対して輝度低周波成分を用いた補正とトーンカーブを用いた補正の両方を適用する。そして、合成する画像の露出量差、顔のような主被写体の情報、及び撮影画像のヒストグラムの情報を考慮して、個々の補正における補正量を算出する。そのため、トーンカーブを用いた補正によるコントラストの低下と、輝度低周波成分を用いた補正による不自然な補正結果とを抑制した、明るさ及びコントラストの良好なHDR画像を得ることができる。   As described above, according to the present embodiment, both the correction using the luminance low frequency component and the correction using the tone curve are applied to the HDR image. Then, the correction amount for each correction is calculated in consideration of the exposure amount difference of the images to be combined, information on the main subject such as the face, and information on the histogram of the captured image. Therefore, it is possible to obtain an HDR image with good brightness and contrast that suppresses a decrease in contrast due to correction using a tone curve and an unnatural correction result due to correction using a luminance low-frequency component.

(第2の実施形態)
第1の実施形態では、合成する画像の露出量差に応じて輝度低周波成分を用いた補正の補正量(A)を決定した。これに対し本実施形態では、HDR画像に対する階調補正量を、輝度低周波成分を用いた補正による補正量(A)とトーンカーブを用いた補正の補正量(B)とに分配する。
(Second Embodiment)
In the first embodiment, the correction amount (A) for correction using the low-frequency luminance component is determined according to the exposure amount difference of the images to be combined. On the other hand, in the present embodiment, the gradation correction amount for the HDR image is distributed to the correction amount (A) by the correction using the luminance low frequency component and the correction amount (B) of the correction using the tone curve.

図11は、本実施形態における階調補正量の分配例を模式的に示す図である。図11の横軸は、顔検出部112で算出された顔の代表輝度値であり、縦軸は、補正量算出部113で算出された目標の階調補正量を100%とした際の補正量(A)の比率である。100%から補正量(A)の比率を差し引いた結果が、補正量(B)の比率となる。   FIG. 11 is a diagram schematically illustrating an example of distribution of gradation correction amounts in the present embodiment. The horizontal axis of FIG. 11 is the representative luminance value of the face calculated by the face detection unit 112, and the vertical axis is the correction when the target gradation correction amount calculated by the correction amount calculation unit 113 is 100%. It is the ratio of the quantity (A). The result of subtracting the correction amount (A) ratio from 100% is the correction amount (B) ratio.

予め、露出量差ごとに、顔の代表輝度値と、補正量(A)および補正量(B)の比率(目標の階調補正量に対する補正量(A)または補正量(B)の比率でもよい)の関係を示すテーブルを用意しておき、この比率に従って目標の階調補正量を分配する。図11は一例として、露出量差が±1段、±2段、±3段の場合の分配例を示している。   For each exposure amount difference, the representative luminance value of the face and the ratio of the correction amount (A) and the correction amount (B) (the ratio of the correction amount (A) or the correction amount (B) to the target gradation correction amount) A table indicating the relationship of (good) is prepared, and the target gradation correction amount is distributed according to this ratio. FIG. 11 shows an example of distribution when the exposure amount difference is ± 1, ± 2, and ± 3.

図11から分かるように、HDR撮影時(合成する画像)の露出量差が大きいほど、輝度低周波成分を用いた補正による補正量の比率を大きくする。また、顔の代表輝度値が大きいほど、輝度低周波成分を用いた補正による補正量の比率を小さくする。これにより、複数の画像の露出量差が大きいほどガンマ変換によってコントラストが小さくなっていることと、明るい顔に対してコントラストをつけ過ぎると不自然な画像になることとのバランスをとっている。   As can be seen from FIG. 11, as the exposure amount difference during HDR shooting (image to be combined) is larger, the ratio of the correction amount by the correction using the luminance low frequency component is increased. Further, the larger the representative luminance value of the face, the smaller the ratio of the correction amount by the correction using the luminance low frequency component. This balances the fact that the greater the difference in the exposure amount of a plurality of images, the lower the contrast due to gamma conversion, and that the image becomes unnatural if the contrast is too high for a bright face.

また、顔が検出されていないと判定されている場合は、図11において顔の代表輝度値が十分暗い場合と同じ比率を用いることができる。
階調補正部114は、このようにして決定された補正量で、輝度低周波成分を用いた補正およびトーンカーブを用いた補正を合成画像に適用する。
If it is determined that no face is detected, the same ratio as in the case where the representative luminance value of the face is sufficiently dark in FIG. 11 can be used.
The tone correction unit 114 applies the correction using the luminance low frequency component and the correction using the tone curve to the composite image with the correction amount determined in this way.

本実施形態では、目標の階調補正量を、主被写体(たとえば顔)の輝度に応じた比率により、輝度低周波成分を用いた補正とトーンカーブを用いた補正とで分配する。これにより、階調補正による明るさ及びコントラストへの影響を考慮した適切な階調補正を行うことができる。   In the present embodiment, the target gradation correction amount is distributed by correction using the low-frequency luminance component and correction using the tone curve at a ratio according to the luminance of the main subject (for example, the face). Thereby, appropriate gradation correction can be performed in consideration of the influence on the brightness and contrast by gradation correction.

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

Claims (9)

異なる複数の露出量によって撮影された複数の画像を取得する取得手段と、
前記複数の画を、画像間の露出量差が大きいほどコントラストを低下させるガンマ変換処理を適用してから合成することで合成画像を生成する合成手段と、
前記合成画像の輝度情報に基づいて、前記合成画像の階調補正の目標補正量を算出する目標補正量算出手段と、
前記目標補正量を実現するための、前記合成画像の輝度低周波成分を用いた階調補正の第1の補正量と、トーンカーブを用いた階調補正の第2の補正量とを決定する補正量決定手段と、
前記第1の補正量に基づいて、前記合成画像に対して階調補正処理を適用する第1の階調補正手段と、
前記第2の補正量に基づいて、前記合成画像に対して階調補正処理を適用する第2の階調補正手段と、を有し、
前記補正量決定手段は、前記第1の補正量を、前記画像間の露出量差が大きいほど大きくなるように決定したのち、前記合成画像の主被写体の輝度が高いほど小さくなるように補正することによって決定することを特徴とする画像処理装置。
Obtaining means for obtaining a plurality of images taken with different exposure amounts;
It said plurality of images, a synthesizing means for generating a composite image by synthesizing after applying gamma conversion processing for reducing the contrast as the exposure amount difference between images is large,
Target correction amount calculating means for calculating a target correction amount for gradation correction of the composite image based on luminance information of the composite image;
A first correction amount for gradation correction using a low-frequency luminance component of the composite image and a second correction amount for gradation correction using a tone curve for realizing the target correction amount are determined. Correction amount determining means;
First gradation correction means for applying gradation correction processing to the composite image based on the first correction amount;
Second gradation correction means for applying gradation correction processing to the composite image based on the second correction amount;
The correction amount determining means, said first correction amount, after determined to be larger as the exposure amount difference between the images is large is corrected so that the luminance of the main object of the synthesized image becomes smaller the higher An image processing apparatus that is determined by
前記取得手段は、ユーザが決定した露出量差で撮影された複数の画像を取得することを特徴とする請求項1に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the acquisition unit acquires a plurality of images taken with an exposure amount difference determined by a user. 被写体の輝度レンジが大きいほど大きい露出量差を決定する決定手段と、  Determining means for determining a larger exposure amount difference as the luminance range of the subject is larger;
前記決定手段が決定した露出量差で撮影された複数の画像を取得する取得手段と、  Acquisition means for acquiring a plurality of images taken with the exposure amount difference determined by the determination means;
前記複数の画像に基づいて合成画像を生成する合成手段と、  Combining means for generating a combined image based on the plurality of images;
前記合成画像の輝度情報に基づいて、前記合成画像の階調補正の目標補正量を算出する目標補正量算出手段と、  Target correction amount calculating means for calculating a target correction amount for gradation correction of the composite image based on luminance information of the composite image;
前記目標補正量を実現するための、前記合成画像の輝度低周波成分を用いた階調補正の第1の補正量と、トーンカーブを用いた階調補正の第2の補正量とを決定する補正量決定手段と、  A first correction amount for gradation correction using a low-frequency luminance component of the composite image and a second correction amount for gradation correction using a tone curve for realizing the target correction amount are determined. Correction amount determining means;
前記第1の補正量に基づいて、前記合成画像に対して階調補正処理を適用する第1の階調補正手段と、  First gradation correction means for applying gradation correction processing to the composite image based on the first correction amount;
前記第2の補正量に基づいて、前記合成画像に対して階調補正処理を適用する第2の階調補正手段と、を有し、  Second gradation correction means for applying gradation correction processing to the composite image based on the second correction amount;
前記補正量決定手段は、前記第1の補正量を、前記合成画像の主被写体の輝度が高いほど小さくなるように決定することを特徴とする画像処理装置。  The image processing apparatus according to claim 1, wherein the correction amount determination unit determines the first correction amount so that the first correction amount decreases as the luminance of the main subject of the composite image increases.
前記合成手段は、露出量に応じたガンマ変換処理を適用した前記複数の画像を合成し、前記合成画像を生成することを特徴とする請求項に記載の画像処理装置。 It said synthesizing means synthesizes the plurality of images to which the gamma conversion processing in accordance with the exposure amount, the image processing apparatus according to Motomeko 3 you and generating the composite image. 前記合成手段は、前記複数の画像の露出量差が大きいほどコントラストを低下させるガンマ変換処理を適用し、
前記補正量決定手段は、前記第1の補正量を、前記複数の画像の露出量差が大きいほど、大きくなるように決定したのち、前記主被写体の輝度に応じて補正することを特徴とする請求項に記載の画像処理装置。
The synthesizing unit applies a gamma conversion process that lowers the contrast as the exposure difference between the plurality of images increases.
The correction amount determination means determines the first correction amount so as to increase as the exposure difference between the plurality of images increases, and then corrects the first correction amount according to the luminance of the main subject. The image processing apparatus according to claim 4 .
前記補正量決定手段は、前記第2の補正量を、前記目標補正量と前記第1の補正量の差分として決定することを特徴とする請求項1乃至請求項5のいずれか1項に記載の画像処理装置。 The correction amount determining means, wherein the second correction amount, to any one of claims 1 to 5, characterized in that to determine the difference between the target correction amount and the first correction amount Image processing apparatus. 前記目標補正量算出手段は、前記合成画像の輝度ヒストグラムまたは前記主被写体の輝度に基づいて前記目標補正量を算出することを特徴とする請求項1乃至請求項のいずれか1項に記載の画像処理装置。 The target correction amount calculating means, according to any one of claims 1 to 6, characterized in that to calculate the target correction amount based on the luminance of the luminance histogram or the main object of the synthesized image Image processing device. 異なる複数の露出量によって撮影された複数の画像を取得する取得ステップと、
前記複数の画を、画像間の露出量差が大きいほどコントラストを低下させるガンマ変換処理を適用してから合成することで合成画像を生成する合成ステップと、
前記合成画像の輝度情報に基づいて、前記合成画像の階調補正の目標補正量を算出する目標補正量算出ステップと、
前記目標補正量を実現するための、前記合成画像の輝度低周波成分を用いた階調補正の第1の補正量と、トーンカーブを用いた階調補正の第2の補正量とを決定する補正量決定ステップと、
前記第1の補正量に基づいて、前記合成画像に対して階調補正処理を適用する第1の階調補正ステップと、
前記第2の補正量に基づいて、前記合成画像に対してトーンカーブを用いた階調補正処理を適用する第2の階調補正ステップと、を有し、
前記補正量決定ステップでは、前記第1の補正量を、前記画像間の露出量差が大きいほど大きくなるように決定したのち、前記合成画像の主被写体の輝度が高いほど小さくなるように補正することによって決定することを特徴とする画像処理方法。
An acquisition step of acquiring a plurality of images taken with a plurality of different exposure amounts;
It said plurality of images, a synthesizing step of generating a synthesized image by synthesizing after applying gamma conversion processing for reducing the contrast as the exposure amount difference between images is large,
A target correction amount calculating step of calculating a target correction amount of gradation correction of the composite image based on luminance information of the composite image;
A first correction amount for gradation correction using a low-frequency luminance component of the composite image and a second correction amount for gradation correction using a tone curve for realizing the target correction amount are determined. A correction amount determining step;
A first gradation correction step of applying a gradation correction process to the composite image based on the first correction amount;
A second gradation correction step of applying a gradation correction process using a tone curve to the composite image based on the second correction amount;
In the correction amount determination step, the first correction amount is determined so as to increase as the exposure amount difference between the images increases, and then corrected so as to decrease as the luminance of the main subject of the composite image increases. An image processing method characterized in that it is determined by
被写体の輝度レンジが大きいほど大きい露出量差を決定する決定ステップと、  A determination step for determining a larger exposure amount difference as the luminance range of the subject is larger;
前記決定ステップで決定された露出量差で撮影された複数の画像を取得する取得ステップと、  An acquisition step of acquiring a plurality of images taken with the exposure amount difference determined in the determination step;
前記複数の画像に基づいて合成画像を生成する合成ステップと、  Generating a composite image based on the plurality of images;
前記合成画像の輝度情報に基づいて、前記合成画像の階調補正の目標補正量を算出する目標補正量算出ステップと、  A target correction amount calculating step of calculating a target correction amount of gradation correction of the composite image based on luminance information of the composite image;
前記目標補正量を実現するための、前記合成画像の輝度低周波成分を用いた階調補正の第1の補正量と、トーンカーブを用いた階調補正の第2の補正量とを決定する補正量決定ステップと、  A first correction amount for gradation correction using a low-frequency luminance component of the composite image and a second correction amount for gradation correction using a tone curve for realizing the target correction amount are determined. A correction amount determining step;
前記第1の補正量に基づいて、前記合成画像に対して階調補正処理を適用する第1の階調補正ステップと、  A first gradation correction step of applying a gradation correction process to the composite image based on the first correction amount;
前記第2の補正量に基づいて、前記合成画像に対してトーンカーブを用いた階調補正処理を適用する第2の階調補正ステップと、を有し、  A second gradation correction step of applying a gradation correction process using a tone curve to the composite image based on the second correction amount;
前記補正量決定ステップでは、前記第1の補正量を、前記合成画像の主被写体の輝度が高いほど小さくなるように決定することを特徴とする画像処理方法。  In the correction amount determination step, the first correction amount is determined so as to decrease as the luminance of the main subject of the composite image increases.
JP2012042388A 2012-02-28 2012-02-28 Image processing apparatus and image processing method Expired - Fee Related JP5932392B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012042388A JP5932392B2 (en) 2012-02-28 2012-02-28 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012042388A JP5932392B2 (en) 2012-02-28 2012-02-28 Image processing apparatus and image processing method

Publications (3)

Publication Number Publication Date
JP2013179485A JP2013179485A (en) 2013-09-09
JP2013179485A5 JP2013179485A5 (en) 2015-04-16
JP5932392B2 true JP5932392B2 (en) 2016-06-08

Family

ID=49270753

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012042388A Expired - Fee Related JP5932392B2 (en) 2012-02-28 2012-02-28 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP5932392B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3975106A4 (en) * 2019-07-11 2022-08-17 Huawei Technologies Co., Ltd. Image processing method and apparatus

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6314446B2 (en) * 2013-11-28 2018-04-25 セイコーエプソン株式会社 Printing control apparatus, printing apparatus, and printing control program
WO2015081562A1 (en) * 2013-12-06 2015-06-11 华为终端有限公司 Terminal, image processing method, and image acquisition method
JP7105737B2 (en) * 2018-06-29 2022-07-25 キヤノン株式会社 Image processing device, image processing method, and program

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4163353B2 (en) * 1998-12-03 2008-10-08 オリンパス株式会社 Image processing device
JP3948229B2 (en) * 2001-08-01 2007-07-25 ソニー株式会社 Image capturing apparatus and method
JP3644421B2 (en) * 2001-09-03 2005-04-27 株式会社豊田中央研究所 Image conversion method and image conversion apparatus
JP2005039457A (en) * 2003-07-18 2005-02-10 Canon Inc Image processing apparatus and method
JP5100565B2 (en) * 2008-08-05 2012-12-19 キヤノン株式会社 Image processing apparatus and image processing method
JP4678060B2 (en) * 2009-03-25 2011-04-27 株式会社ニコン Imaging apparatus and image processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3975106A4 (en) * 2019-07-11 2022-08-17 Huawei Technologies Co., Ltd. Image processing method and apparatus

Also Published As

Publication number Publication date
JP2013179485A (en) 2013-09-09

Similar Documents

Publication Publication Date Title
US8385680B2 (en) Image processing apparatus and image processing method
KR100990904B1 (en) The apparatus for enhancing image by generating and blending multiple image and method therefor
JP4218723B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP5713752B2 (en) Image processing apparatus and control method thereof
US8368779B2 (en) Image processing apparatus for performing gradation correction on subject image
JP4803284B2 (en) Image processing apparatus and image processing program
JP5719418B2 (en) High dynamic range image exposure time control method
JP6218389B2 (en) Image processing apparatus and image processing method
JP6097588B2 (en) Image processing apparatus and image processing method
TWI697867B (en) Metering compensation method and related monitoring camera apparatus
JP2008104009A (en) Imaging apparatus and method
JP4639037B2 (en) Image processing method and apparatus
JP2011003048A (en) Image processing apparatus and image processing program
JP2014153959A (en) Image processing device, image processing method, program, and storage medium
JP5782311B2 (en) Imaging apparatus and control method thereof
JP2015144475A (en) Imaging apparatus, control method of the same, program and storage medium
JP5932392B2 (en) Image processing apparatus and image processing method
US11159740B2 (en) Image capturing device and control method thereof and medium
JP6611543B2 (en) Image processing apparatus, image processing method, and program
JP2011100204A (en) Image processor, image processing method, image processing program, imaging apparatus, and electronic device
JP5713643B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
JP5591026B2 (en) Imaging apparatus and control method thereof
JP6080531B2 (en) Image processing apparatus, image processing method, program, and storage medium
US8982244B2 (en) Image capturing apparatus for luminance correction, a control method therefor, and a recording medium
JP6652301B2 (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150302

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150302

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160125

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160315

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20160404

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160428

R151 Written notification of patent or utility model registration

Ref document number: 5932392

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees