JP2013176119A - Imaging apparatus and image processing method - Google Patents

Imaging apparatus and image processing method Download PDF

Info

Publication number
JP2013176119A
JP2013176119A JP2013084336A JP2013084336A JP2013176119A JP 2013176119 A JP2013176119 A JP 2013176119A JP 2013084336 A JP2013084336 A JP 2013084336A JP 2013084336 A JP2013084336 A JP 2013084336A JP 2013176119 A JP2013176119 A JP 2013176119A
Authority
JP
Japan
Prior art keywords
correction
luminance
image
amount
image data
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.)
Granted
Application number
JP2013084336A
Other languages
Japanese (ja)
Other versions
JP5460909B2 (en
Inventor
Satoshi Kubota
聡 窪田
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 JP2013084336A priority Critical patent/JP5460909B2/en
Publication of JP2013176119A publication Critical patent/JP2013176119A/en
Application granted granted Critical
Publication of JP5460909B2 publication Critical patent/JP5460909B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To perform a gradation correction suitable for a taken image in accordance with luminance distribution in the taken image.SOLUTION: An imaging apparatus comprises: first determination means which determines first correction data for performing, on image data obtained by imaging, gradation correction to change the luminance range of an input luminance corresponding to that of an output luminance; second determination means which determines second correction data for performing, on the image data obtained by imaging, gradation correction corresponding to the height of a luminance frequency; and control means which restricts execution of gradation correction using one of the first correction data and the second correction data, on image data to undergo gradation correction using the other.

Description

本発明は、画像の階調補正の技術に関する。   The present invention relates to an image gradation correction technique.

従来、好ましい明るさ、コントラストの画像を得るために、取得した画像の輝度ヒストグラムや被写体情報を解析して、階調補正を行う方式が知られている。   Conventionally, in order to obtain an image with preferable brightness and contrast, a method of performing gradation correction by analyzing a luminance histogram and subject information of an acquired image is known.

特に、主被写体の明るさが背景の明るさに比べて著しく暗いような、いわゆる逆光シーンでは、撮影した画像の主被写体部分が暗くなってしまうため、階調補正が有効である。また、背景の明るさが著しく明るくなるいわゆる「飛び」に関しては、以下の方法がある。まず、撮像素子を露光する段階で、飛びを抑えるように適正露出よりも暗めの露出で撮像しておく。そして、得られた画像データの輝度値を所定の出力輝度値に変換する補正テーブル(トーンカーブ)を用いて、暗めに撮影された領域の輝度値は適正レベルに、既に明るく撮影された領域の輝度値に関してはそのままのレベルになるように階調補正する。これは、撮像素子のダイナミックレンジを擬似的に拡大するのに効果のある方法として知られている。(例えば、特許文献1参照。)   In particular, in a so-called backlight scene where the brightness of the main subject is significantly darker than the brightness of the background, tone correction is effective because the main subject portion of the captured image becomes dark. There are the following methods for so-called “flying” in which the brightness of the background becomes extremely bright. First, at the stage of exposing the image sensor, an image is captured with an exposure that is darker than the appropriate exposure so as to suppress jumping. Then, by using a correction table (tone curve) for converting the luminance value of the obtained image data into a predetermined output luminance value, the luminance value of the darkly photographed area is set to an appropriate level, and the brightness of the area already brightly photographed is set. The gradation correction is performed so that the luminance value is kept as it is. This is known as an effective method for pseudo-expanding the dynamic range of the image sensor. (For example, refer to Patent Document 1.)

また、画像の輝度成分の低周波成分信号を用いて階調補正することで、いわゆる覆い焼きのような効果を得る方法が提案されている。この方法では、画像のコントラストを維持したまま、暗く撮影されてしまった被写体を明るくするような階調補正を行うことができる。(例えば、特許文献2参照。)   In addition, a method has been proposed in which gradation correction is performed using a low-frequency component signal of a luminance component of an image, thereby obtaining an effect like so-called dodging. With this method, it is possible to perform gradation correction that brightens a subject that has been shot dark while maintaining the contrast of the image. (For example, see Patent Document 2.)

一方、白い壁や雪景色などのように画面内に白い部分があっても、自動露出制御では所定の輝度レベルになるように露出決定するため、本来白いものが灰色に近い色で撮影されてしまう場合がある。このようなシーンに対して、高輝度成分が少ないか存在しない場合に、高輝度な入力輝度に割り当てる出力輝度領域を狭くし、不要な領域への階調割当を無くすように階調補正を行うことで、白いものを白く撮るような効果を得ることも知られている。   On the other hand, even if there is a white part in the screen, such as a white wall or snow scene, the automatic exposure control determines the exposure so that it reaches the specified brightness level. May end up. For such scenes, if there are few or no high-luminance components, the output luminance area assigned to the high-luminance input luminance is narrowed, and gradation correction is performed so that gradation assignment to unnecessary areas is eliminated. Thus, it is also known to obtain an effect of taking a white object white.

特開2007−124604号公報JP 2007-124604 A 特開2008−072604号公報JP 2008-072604 A

しかしながら、特許文献1のように、トーンカーブを用いて画像の暗い部分を明るく補正し、もともと明るい部分は補正を抑えるような階調補正を行うと、主被写体と背景の中間の輝度帯域においてコントラストが失われ、のっぺりとした画像になることがあった。   However, as in Patent Document 1, when tone correction is performed so that a dark portion of an image is brightly corrected using a tone curve and correction is originally performed to suppress correction of a bright portion, contrast in a luminance band intermediate between the main subject and the background. May be lost, resulting in a crisp image.

また、特許文献2のように、画像の輝度成分の低周波成分信号を用いて階調補正を行うと、シーンによってはコントラストがありすぎるために不自然な画像になることがあった。   Further, as described in Patent Document 2, when tone correction is performed using a low-frequency component signal of a luminance component of an image, an image may be unnatural because there is too much contrast depending on the scene.

本発明は上記問題点を鑑みてなされたものであり、撮像した画像の輝度分布に応じて、画質劣化を起こすことなく、その画像に適した階調補正を行うことを目的とする。   The present invention has been made in view of the above problems, and an object of the present invention is to perform tone correction suitable for an image without causing deterioration in image quality according to the luminance distribution of the captured image.

上記目的を達成するために、本発明の撮像装置は、撮像して得られた画像データに対し、出力輝度の輝度範囲に対応する入力輝度の輝度範囲を変更する階調補正を実施するための第1の補正データを決定する第1の決定手段と、撮像して得られた画像データに対し、輝度周波数の高さに応じた階調補正を実施するための第2の補正データを決定する第2の決定手段と、前記第1及び第2の補正データの一方を用いた階調補正が実施される画像データに対し、前記第1及び第2の補正データの他方を用いた階調補正の実施を制限する制御手段と、を有する。 In order to achieve the above object, an image pickup apparatus according to the present invention performs tone correction for changing a luminance range of input luminance corresponding to a luminance range of output luminance with respect to image data obtained by imaging. First determination means for determining first correction data, and second correction data for performing gradation correction corresponding to the height of the luminance frequency for the image data obtained by imaging. Tone correction using the other of the first and second correction data for the image data subjected to the tone correction using the second determining means and one of the first and second correction data And control means for restricting the implementation.

本発明によれば、撮像した画像の輝度分布に応じて、その画像に適した階調補正を行うことができる。   According to the present invention, gradation correction suitable for an image can be performed according to the luminance distribution of the captured image.

本発明の実施の形態における撮像装置の構成を示すブロック図である。It is a block diagram which shows the structure of the imaging device in embodiment of this invention. 本発明の実施の形態における階調補正方法の流れを示すフローチャートである。It is a flowchart which shows the flow of the gradation correction method in embodiment of this invention. 本発明の実施の形態におけるD+量の仮決定処理を示すフローチャートである。It is a flowchart which shows the temporary determination process of D + amount in embodiment of this invention. 本発明の実施の形態における絞り、シャッタ、ゲイン、D+量の決定処理を示すフローチャートである。It is a flowchart which shows the determination process of the aperture_diaphragm | restriction, a shutter, a gain, and D + amount in embodiment of this invention. 本発明の実施の形態におけるD−量の決定処理を示すフローチャートである。It is a flowchart which shows the determination process of D-amount in embodiment of this invention. 本発明の実施の形態における暗部補正量の決定処理を示すフローチャートである。It is a flowchart which shows the determination process of the dark part correction amount in embodiment of this invention. 本発明の実施の形態における画像処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the image processing in embodiment of this invention. 本発明の実施の形態におけるD−補正の概要を説明するための図である。It is a figure for demonstrating the outline | summary of D-correction in embodiment of this invention. 本発明の実施の形態における暗部補正の概要を説明するための図である。It is a figure for demonstrating the outline | summary of the dark part correction | amendment in embodiment of this invention. 本発明の実施の形態における暗部補正のための解像度変換の様子を示す図である。It is a figure which shows the mode of the resolution conversion for dark part correction | amendment in embodiment of this invention. 本発明の実施の形態における暗部補正に用いられるトーンカーブの一例を示す図である。It is a figure which shows an example of the tone curve used for dark part correction | amendment in embodiment of this invention. 本発明の実施の形態におけるD+補正で用いるトーンカーブの一例を示す図である。It is a figure which shows an example of the tone curve used by D + correction | amendment in embodiment of this invention. 本発明の実施の形態におけるD+量算出にかかるSW1ON前後の処理のタイミングを示すタイミング図である。It is a timing diagram which shows the timing of the process before and after SW1ON concerning D + amount calculation in embodiment of this invention. 本発明の実施の形態における階調補正処理のSW2ON後のタイミング図である。It is a timing diagram after SW2 ON of the gradation correction processing in the embodiment of the present invention.

以下、添付図面を参照して本発明を実施するための最良の形態を詳細に説明する。ただし、本形態において例示される構成部品の寸法、材質、形状、それらの相対配置などは、本発明が適用される装置の構成や各種条件により適宜変更されるべきものであり、本発明がそれらの例示に限定されるものではない。   The best mode for carrying out the present invention will be described below in detail with reference to the accompanying drawings. However, the dimensions, materials, shapes, relative arrangements, and the like of the components exemplified in this embodiment should be changed as appropriate according to the configuration of the apparatus to which the present invention is applied and various conditions. However, the present invention is not limited to these examples.

以下、添付図面を参照して本発明を実施するための形態を詳細に説明する。   DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the accompanying drawings.

●撮像装置の構成
図1は、本発明の実施の形態における撮像装置100の構成を示すブロック図である。
Configuration of Imaging Device FIG. 1 is a block diagram showing the configuration of the imaging device 100 in the embodiment of the present invention.

図1において、60は撮像装置100全体の動作を制御するシステム制御部である。   In FIG. 1, reference numeral 60 denotes a system control unit that controls the operation of the entire imaging apparatus 100.

10は撮影レンズであり、外光を集光する。図ではレンズは1枚として表しているが、通常、複数枚のレンズから構成されている。撮影レンズ10は、レンズ駆動回路42により、例えば、光軸に沿って前後に動かすことで、焦点を調節するためのフォーカスレンズ及び画角を調節するズームレンズを含む。更に、ブレ量検知回路44で測定したカメラのブレ量を基にして、手ブレ補正回路40によりレンズを動かして手ブレをキャンセルする方向に光軸を変化させることで光学的な手ブレ補正を行うブレ補正レンズなどを含む。また、撮影レンズ10を含む鏡筒部を繰り出し及び繰り込みさせる方式とし、カメラ未使用時の本体体積を小さくして携帯性を向上することが可能である。   Reference numeral 10 denotes a photographing lens that collects external light. Although the lens is shown as one in the figure, it is usually composed of a plurality of lenses. The photographing lens 10 includes, for example, a focus lens for adjusting the focus and a zoom lens for adjusting the angle of view by moving the lens driving circuit 42 back and forth along the optical axis. Further, based on the camera shake amount measured by the camera shake detection circuit 44, the camera shake correction circuit 40 moves the lens to change the optical axis in the direction of canceling camera shake, thereby performing optical camera shake correction. Including an image stabilization lens to perform. Moreover, it is possible to improve the portability by adopting a system in which the lens barrel portion including the photographing lens 10 is extended and retracted, and the main body volume is reduced when the camera is not used.

なお、ブレ量検知回路44はジャイロセンサを含み、図1ではレンズを駆動することで手ブレ補正を実現しているが、後述する撮像素子16を駆動することで同様に手ブレを補正することも可能である。   Note that the shake amount detection circuit 44 includes a gyro sensor, and in FIG. 1, camera shake correction is realized by driving a lens. However, camera shake correction is similarly performed by driving an image sensor 16 described later. Is also possible.

12はメカニカルシャッタ(以下、単に「シャッタ」と呼ぶ。)である。システム制御部60は、メカニカルシャッタ制御情報をシャッタ駆動回路28に伝達することで、シャッタ12を制御することが可能である。静止画撮影時の露光時間は、シャッタ12の開閉時間により決定されるが、システム制御部60がこの開閉時間を判断し、シャッタ駆動回路28に指示を出す。   Reference numeral 12 denotes a mechanical shutter (hereinafter simply referred to as “shutter”). The system control unit 60 can control the shutter 12 by transmitting mechanical shutter control information to the shutter drive circuit 28. The exposure time during still image shooting is determined by the opening / closing time of the shutter 12, and the system control unit 60 determines this opening / closing time and issues an instruction to the shutter drive circuit 28.

14は撮影レンズ10を通過した光の光量を調節する絞りである。絞り14としては、例えば、複数枚の羽から構成された虹彩絞りや、あらかじめ、板を様々な径で穴を打ち抜いた丸絞りがある。システム制御部60は、絞り制御情報を絞り駆動回路26に伝達することで、絞り14を制御することが可能である。システム制御部60は絞り14と絞り駆動回路26を用い、被写体輝度が高い場合は絞りを絞って光量を落とすように制御し、被写体輝度が低い場合は絞りを開いて光をより多く取り込むように制御することができる。   Reference numeral 14 denotes an aperture for adjusting the amount of light passing through the photographing lens 10. Examples of the diaphragm 14 include an iris diaphragm composed of a plurality of wings and a round diaphragm in which holes are punched out in advance with various diameters. The system control unit 60 can control the diaphragm 14 by transmitting the diaphragm control information to the diaphragm driving circuit 26. The system control unit 60 uses the diaphragm 14 and the diaphragm driving circuit 26 to control the diaphragm so as to reduce the amount of light when the subject brightness is high, and to open the diaphragm and capture more light when the subject brightness is low. Can be controlled.

16はCCDやCMOSセンサ等の撮像素子であり、撮影レンズ10、シャッタ12、絞り14を介して入射した被写体の光学像を電気信号(画像信号)に変換して出力する。システム制御部60は、撮像素子制御信号をTG(Timing Generator)24に伝達することで、撮像素子16を制御することができる。   Reference numeral 16 denotes an image sensor such as a CCD or CMOS sensor, which converts an optical image of a subject incident through the taking lens 10, the shutter 12, and the aperture 14 into an electrical signal (image signal) and outputs it. The system control unit 60 can control the image sensor 16 by transmitting an image sensor control signal to a TG (Timing Generator) 24.

TG24は、システム制御部60から受信した制御情報をもとに撮像素子16を駆動する。撮像素子16は各画素における電荷の蓄積と、蓄積した電荷の読み出し動作を周期的に行っており、この動作はTG24からの駆動信号を基準にして行われる。撮像素子16に蓄積された電荷の内、特定のラインや特定の領域のみから電荷を読み出してくることが可能である。これは、TG24から出力される読み出し制御パルスにより読み出し方を変更することで実現することができる。システム制御部60は状況に応じて最適な読み出し方式を決定し、TG24に指示する。例えば、静止画撮影時は高解像度が要求されるため撮像素子16の全データを読み出し、電子ファインダー時や動画撮影時は30fpsや60fpsなどの高いフレームレートが要求されるため特定のラインだけ間引いて読み出す、といった使い分けを行う。またTG24を介して、撮像素子16の露光時間を制御することが可能である。任意のタイミングで、撮像素子16がチャージした電荷をクリアするように、TG24から撮像素子16へ駆動信号を出すことでこれを可能としている。   The TG 24 drives the image sensor 16 based on the control information received from the system control unit 60. The image pickup device 16 periodically performs charge accumulation in each pixel and readout operation of the accumulated charge, and this operation is performed with reference to a drive signal from the TG 24. It is possible to read out charges from only a specific line or a specific area among the charges accumulated in the image sensor 16. This can be realized by changing the reading method by the read control pulse output from the TG 24. The system control unit 60 determines an optimum reading method according to the situation and instructs the TG 24. For example, since high resolution is required during still image shooting, all data of the image sensor 16 is read out, and when a high frame rate such as 30 fps or 60 fps is required during electronic viewfinder or movie shooting, only specific lines are thinned out. It is used properly such as reading. Also, the exposure time of the image sensor 16 can be controlled via the TG 24. This is made possible by outputting a drive signal from the TG 24 to the image sensor 16 so as to clear the charge charged by the image sensor 16 at an arbitrary timing.

18は、撮像素子16から出力された電気信号(画像信号)に対して、相関二重サンプリング方式により画像データのノイズ成分を除去する、CDS(Correlated Double Sampler)回路である。20は、画像データのレベルを減衰/増幅するPGA(Programmable Gain Amplifier)回路であって、増幅量は、後述するシステム制御部60により制御される。通常、適正なレベルの画像データを得るために、絞り14で撮像素子16への入射光量を、また、シャッタ12により露光時間を適切に設定することで、撮像素子16の露出を適正にする。これに加えて、PGA回路20で画像データ信号を減衰/増幅することで、擬似的に画像データの露出を変える役割を担うことができる。これは、絞りやシャッタ速度と並ぶ撮影時の露出条件の一つとして、感度という概念でユーザーに機能提供することが可能である。   Reference numeral 18 denotes a CDS (Correlated Double Sampler) circuit that removes noise components of image data from the electrical signal (image signal) output from the image sensor 16 by a correlated double sampling method. Reference numeral 20 denotes a PGA (Programmable Gain Amplifier) circuit that attenuates / amplifies the level of the image data, and the amount of amplification is controlled by a system control unit 60 described later. Usually, in order to obtain image data of an appropriate level, the amount of light incident on the image sensor 16 is appropriately set by the aperture 14 and the exposure time is appropriately set by the shutter 12 so that the exposure of the image sensor 16 is appropriate. In addition, by attenuating / amplifying the image data signal by the PGA circuit 20, it is possible to play a role of changing the exposure of the image data in a pseudo manner. This is a function of providing the user with a concept of sensitivity as one of the exposure conditions at the time of photographing along with the aperture and shutter speed.

PGA回路20により処理された画像データは、A/D(Analog/Digital)回路22にてアナログ信号からデジタル信号へ変換される。デバイスにより、デジタル信号のビット幅は10ビット、12ビット、14ビットなどがある。後段の画像処理回路50は、複数種類のビット幅に対応可能である。図1では、CDS回路18、PGA回路20、A/D回路22をそれぞれ別の構成として表しているが、一つのICパッケージにこれらの回路の機能を搭載したものを採用することも可能である。   The image data processed by the PGA circuit 20 is converted from an analog signal to a digital signal by an A / D (Analog / Digital) circuit 22. Depending on the device, the bit width of the digital signal may be 10 bits, 12 bits, 14 bits, or the like. The subsequent image processing circuit 50 can cope with a plurality of types of bit widths. In FIG. 1, the CDS circuit 18, the PGA circuit 20, and the A / D circuit 22 are shown as different configurations, but it is also possible to adopt a circuit in which the functions of these circuits are mounted in one IC package. .

A/D回路22から出力されたデジタル化された画像データは画像処理回路50へ入力される。画像処理回路50は複数のブロックから構成され、さまざまな機能を実現している。   The digitized image data output from the A / D circuit 22 is input to the image processing circuit 50. The image processing circuit 50 includes a plurality of blocks and realizes various functions.

例えば、撮像素子16はカラーフィルタを通して画素毎に特定の色成分の光を抽出して、抽出した光を光電変換するのが一般的である。A/D回路22から出力される画像信号は撮像素子16の画素及びカラーフィルタ配置に対応したデータ形式になっており、輝度成分のみを評価して露出制御を行う自動露出制御(AE:AutoExposureControl)で使用するには適さない。そこで、画像処理回路50は、画像信号から色情報を排除し、輝度情報のみを抜き出す機能を備えている。   For example, the image sensor 16 generally extracts light of a specific color component for each pixel through a color filter, and photoelectrically converts the extracted light. The image signal output from the A / D circuit 22 has a data format corresponding to the pixel of the image sensor 16 and the color filter arrangement, and automatic exposure control (AE: AutoExposureControl) that performs exposure control by evaluating only the luminance component. Not suitable for use with. Therefore, the image processing circuit 50 has a function of removing color information from the image signal and extracting only luminance information.

さらに、画像処理回路50は、撮像素子16から読み出された画像信号の周波数成分のみを抜き出す機能を備え、自動ピント合わせ制御(AF:AutoFocus)時に使用することができる。撮像素子16から読み出された画像信号のどの領域の周波数成分を抽出するか、または、領域内を分割設定できる機能を備えている。このAF処理時には、撮像素子16の駆動を焦点調節に適した駆動にすることが可能である。撮像素子16を使用したテレビAFの場合、撮像素子16から画像信号を読み出す度にフォーカスレンズを新たなピント位置に駆動するため、撮像素子16のフレームレートが高いほうが、フォーカスレンズを素早く多くのピント位置に動かすことができる。このため、AF時のみ速いフレームレートになるように撮像素子16を駆動することができる。逆にフレームレートを遅くし、撮像素子16からより多くの画素データを読み出すようにすることで、画像処理回路50で周波数解析可能なデータが増え、より正確な焦点調節制御が可能になるという面もある。このような撮像素子16の使い方は、カメラの撮影モードや、被写体の明るさに応じて適応的に決めることが可能である。   Furthermore, the image processing circuit 50 has a function of extracting only the frequency component of the image signal read from the image sensor 16, and can be used during automatic focusing control (AF: AutoFocus). A function is provided in which the frequency component of which area of the image signal read from the image sensor 16 is extracted or the area can be divided and set. At the time of this AF processing, it is possible to drive the image sensor 16 to be suitable for focus adjustment. In the case of television AF using the image sensor 16, the focus lens is driven to a new focus position each time an image signal is read from the image sensor 16, so that the higher the frame rate of the image sensor 16, the more quickly the focus lens is focused. Can be moved to a position. For this reason, the image sensor 16 can be driven so as to have a fast frame rate only during AF. Conversely, by reducing the frame rate and reading more pixel data from the image sensor 16, the amount of data that can be analyzed by the image processing circuit 50 increases, enabling more accurate focus adjustment control. There is also. Such use of the image sensor 16 can be determined adaptively according to the shooting mode of the camera and the brightness of the subject.

さらに、画像処理回路50は、A/D回路22によりデジタル化された画像データのレベルの増減、画像の色効果などを操作する機能を備え、撮影画像の画質を調節するという役割も担っている。画像データのレベルに関しては、画像全体に一律の増幅率でレベルを増減させる機能や、元の信号レベルの大小に応じて信号レベルを変換するトーンカーブ(ガンマ)機能がある。他に、画面内の領域毎の周波数成分に応じた増幅率でレベルを増減させる機能など、様々なレベル調節をすることができる。   Further, the image processing circuit 50 has a function of adjusting the level of the image data digitized by the A / D circuit 22 and operating the color effect of the image, and also plays a role of adjusting the image quality of the photographed image. . Regarding the level of image data, there are a function for increasing and decreasing the level with a uniform amplification factor for the entire image and a tone curve (gamma) function for converting the signal level according to the magnitude of the original signal level. In addition, various level adjustments such as a function of increasing / decreasing the level with an amplification factor corresponding to a frequency component for each region in the screen can be performed.

A/D回路22によりデジタル化された画像データは画像処理回路50へ入力すると同時に、一時記憶メモリ30に記憶することができる。一時記憶メモリ30に一旦記憶した画像データは再度読み出すことができ、システム制御部60から画像データを参照したり、読み出した画像データを画像処理回路50に入力することが可能である。さらに、画像処理回路50で画像処理した画像データを一時記憶メモリ30に書き戻したり、システム制御部60から任意のデータを書き込むことも可能である。   The image data digitized by the A / D circuit 22 can be input to the image processing circuit 50 and simultaneously stored in the temporary storage memory 30. The image data once stored in the temporary storage memory 30 can be read again, the image data can be referred to from the system control unit 60, and the read image data can be input to the image processing circuit 50. Furthermore, the image data processed by the image processing circuit 50 can be written back to the temporary storage memory 30 or arbitrary data can be written from the system control unit 60.

画像処理回路50で適切に処理された画像データを、画像認識回路38に入力することができる。画像認識回路38は、入力された画像の明るさ状況、合焦状況、色状況の認識に加え、人物の顔認識とその表情、文字がある場合はその文字情報を認識することができる。また、画像認識回路38には複数の画像を入力することができ、例えば2つの画像を入力し、その2つの画像の特徴を比較することで、同一の画像かどうかを判定することができる。画像認識回路38での画像認識処理に加え、システム制御部60でも画像認識処理を行うことができる。システム制御部60はCPU上で予め符号化されたプログラムを実行することができるが、一時記憶メモリ30に記憶された画像データを読み出し、その画像データを解析してシーンの状況を認識することができる。   Image data appropriately processed by the image processing circuit 50 can be input to the image recognition circuit 38. The image recognition circuit 38 can recognize the character information of a person's face, its facial expression, and characters in addition to recognizing the brightness, focus, and color of the input image. In addition, a plurality of images can be input to the image recognition circuit 38. For example, it is possible to determine whether the images are the same by inputting two images and comparing the characteristics of the two images. In addition to the image recognition process in the image recognition circuit 38, the system control unit 60 can also perform the image recognition process. The system control unit 60 can execute a pre-encoded program on the CPU, but can read the image data stored in the temporary storage memory 30 and analyze the image data to recognize the situation of the scene. it can.

70は操作部であり、電源ON/OFFスイッチ102、シャッタスイッチ104、モード切替スイッチ110、パラメータ選択スイッチ群151等を含む。シャッタスイッチ104は、浅く押下する場合(SW1)と深く押下する場合(SW2)の2段階の押下操作により、撮影の準備及び開始を指示する。自動露出制御や自動焦点調節制御を行う撮像装置の場合、シャッタスイッチ104を浅く押す(SW1ON)ことで撮影準備として自動露出制御と自動焦点調節制御を行い、深く押す(SW2ON)ことで静止画撮影や画像認識の指示を行う操作が実現可能である。モード切替スイッチ110は、静止画撮影モード、動画撮影モード、再生モードなどのカメラ動作モードを切り替えることができる。ここでは、数モードを切り替え可能な部材として表現するが、撮影する特定のシーンに最適化した、風景撮影モードや人物撮影モードなどの多くの静止画モードを備えることも可能である。また、パラメータ選択スイッチ群151a〜151eにより、測距領域や測光モードをはじめとする撮影時の撮影条件の選択や、撮影画像再生時のページ送り、カメラの動作設定全般などをユーザーが選択することができる。さらに前述の電子ファインダーのOn/Offを選択することもできる。また、画像表示装置108は画像を表示すると共に、タッチパネルとして入力装置となる構成とすることもできる。   An operation unit 70 includes a power ON / OFF switch 102, a shutter switch 104, a mode change switch 110, a parameter selection switch group 151, and the like. The shutter switch 104 instructs the preparation and start of shooting by a two-step pressing operation when pressed lightly (SW1) and when pressed deeply (SW2). In the case of an imaging device that performs automatic exposure control and automatic focus adjustment control, pressing the shutter switch 104 shallowly (SW1 ON) performs automatic exposure control and automatic focus adjustment control as preparation for shooting, and pressing it deeply (SW2 ON) still image shooting And an operation for instructing image recognition can be realized. The mode switch 110 can switch camera operation modes such as a still image shooting mode, a moving image shooting mode, and a playback mode. Here, although expressed as a member capable of switching several modes, it is possible to provide many still image modes such as a landscape shooting mode and a person shooting mode optimized for a specific scene to be shot. In addition, the user can select the shooting conditions such as the distance measurement area and the photometry mode, the selection of shooting conditions at the time of shooting, the page feed when playing back the shot image, and the general operation settings of the camera by the parameter selection switches 151a to 151e Can do. Furthermore, On / Off of the above-described electronic viewfinder can be selected. Further, the image display device 108 can display an image and can be configured as an input device as a touch panel.

108はLCDなどにより構成される画像表示装置である。画像表示装置108に画像を出力する場合、画像処理回路50で画像処理を行った画像データをVRAM34上に展開しておき、それをデジタル/アナログ(D/A)回路36にてアナログデータに変換してから表示する。また、電子ファインダ機能は、撮像素子16から読み出される連続した画像を、順次、画像表示装置108に表示更新していくことで実現することができる。VRAM34上に画像データを展開する際、1つの画像データを画像表示装置108に最も大きくなるように、または複数の画像をマルチ画面表示するように、など、様々な表示形態に対応するようにVRAM34上に展開することができる。   Reference numeral 108 denotes an image display device constituted by an LCD or the like. When outputting an image to the image display device 108, the image data subjected to the image processing by the image processing circuit 50 is developed on the VRAM 34 and converted into analog data by the digital / analog (D / A) circuit 36. Then display. In addition, the electronic viewfinder function can be realized by sequentially updating and displaying the continuous images read from the image sensor 16 on the image display device 108. When the image data is expanded on the VRAM 34, the VRAM 34 is adapted to correspond to various display forms such that one image data is maximized on the image display device 108, or a plurality of images are displayed on a multi-screen. Can be deployed on top.

また、画像表示装置108には、画像だけでなく任意の情報を単独、もしくは画像と共に表示することが可能である。カメラの状態表示や、ユーザーが選択あるいはカメラが決定したシャッタ速度や絞り値、感度情報などの文字情報や、画像処理回路50で測定した輝度分布のようなヒストグラムや、顔認識結果、シーン認識結果等も表示可能である。情報の表示位置、表示色も任意に選択可能である。これら様々な情報を表示することで、ユーザーインタフェースとすることが可能となる。また、画像表示装置108には、画像記憶媒体82に記憶されている画像データを表示することも可能である。画像データが圧縮されている場合、圧縮伸張回路32にて伸張し、VRAM34にデータを展開する。この展開したデータをD/A回路36にてアナログデータに変換して出力する。   Further, the image display device 108 can display not only an image but also arbitrary information alone or together with the image. Display of camera status, character information such as shutter speed, aperture value, sensitivity information selected by the user or determined by the camera, histogram such as brightness distribution measured by the image processing circuit 50, face recognition result, scene recognition result Etc. can also be displayed. The display position and display color of information can be arbitrarily selected. By displaying these various types of information, a user interface can be provided. The image display device 108 can also display image data stored in the image storage medium 82. When the image data is compressed, the image data is decompressed by the compression / decompression circuit 32 and the data is expanded in the VRAM 34. The expanded data is converted into analog data by the D / A circuit 36 and output.

なお、従来からの光学ファインダを併設する構成とすることも可能である。その場合、電子ファインダ機能をOFFにし、光学ファインダを使用することで、電力消耗を減らすことが可能である。   It is also possible to adopt a configuration in which a conventional optical finder is also provided. In that case, it is possible to reduce power consumption by turning off the electronic finder function and using the optical finder.

画像記憶媒体82は不揮発性のものであり、画像記憶媒体インタフェース80を介して、主に撮影した画像データを記憶することが可能である。画像データの記憶に関しては、例えば、フォルダ階層を持たせたり、撮影した順にフォルダやファイル名が昇順に命名されるようにすることができる。各画像データには、絞り値やシャッタ速度、ISO感度などの撮影情報や、撮影した時刻などを付加することができ、それらを画像データと共に記憶することが可能となっている。さらに、記憶した画像データの読み出しはもちろん、画像の複製、移動、消去も可能である。   The image storage medium 82 is non-volatile, and can mainly store captured image data via the image storage medium interface 80. Regarding the storage of image data, for example, a folder hierarchy can be provided, or folders and file names can be named in ascending order in the order of shooting. Shooting information such as aperture value, shutter speed, ISO sensitivity, shooting time, and the like can be added to each image data, and these can be stored together with the image data. Furthermore, the stored image data can be read out, and the image can be copied, moved, and deleted.

また、86は、プリンタやPC、表示装置等の外部装置であって、外部機器インタフェース84を介して接続される。   Reference numeral 86 denotes an external device such as a printer, a PC, or a display device, which is connected via an external device interface 84.

次に、上記構成を有する撮像装置100において実行される、本実施の形態における階調補正方法について説明する。本実施の形態では、以下に示す3種類の階調補正方法を用いる場合について説明する。   Next, the gradation correction method in the present embodiment, which is executed in the imaging apparatus 100 having the above configuration, will be described. In this embodiment, a case where the following three types of gradation correction methods are used will be described.

(1)第1の階調補正方法
本実施の形態では、第1の階調補正方法として、低輝度の被写体と高輝度の被写体とが混在しているシーンにおいて、高輝度側の白飛び(飽和)を抑制する階調補正方法とする。以後、この第1の階調補正方法をD+補正と呼ぶ。
(1) First Tone Correction Method In this embodiment, as a first tone correction method, in a scene where a low-brightness subject and a high-brightness subject are mixed, A gradation correction method that suppresses saturation). Hereinafter, this first gradation correction method is referred to as D + correction.

より具体的に説明すると、通常、撮影前に、撮影条件として絞り値、シャッタ速度、ゲイン量等を決定するが、この時、画面の輝度情報や人物の顔の有無に応じて適切な露出で撮影しようとする。しかしながら、撮像素子のダイナミックレンジはさほど広くは無く、どのように絞り、シャッタ、ゲインを設定しても、太陽を背にして立つ人物を撮影する時のような逆光シーンでは、人物が暗すぎる、あるいは背景が明るすぎる、といったことが起こる。このような、背景が明るすぎる現象を軽減するのがD+補正である。   More specifically, normally, the aperture value, shutter speed, gain amount, etc. are determined as shooting conditions before shooting. At this time, the appropriate exposure is determined according to the brightness information of the screen and the presence or absence of a human face. Try to shoot. However, the dynamic range of the image sensor is not so wide, no matter how the aperture, shutter, and gain are set, in a backlit scene such as when shooting a person standing against the sun, the person is too dark. Or the background is too bright. It is D + correction that reduces the phenomenon that the background is too bright.

D+補正では、先ず、高輝度部分の白飛びが発生しないように露出アンダーとなる露出値を設定して撮影を行い、得られた画像データの低輝度部分の輝度を持ち上げるように設定されたガンマカーブ(トーンカーブ)を用いて、補正を行う。   In D + correction, first, shooting is performed by setting an exposure value that is underexposed so as not to cause whiteout in a high-luminance portion, and a gamma that is set to raise the luminance of the low-luminance portion of the obtained image data. Correction is performed using a curve (tone curve).

(2)第2の階調補正方法
本実施の形態では、第2の階調補正方法として、撮影した画像の高輝度領域の輝度データの状況に応じて不要な階調割当を行わない階調補正方法とする。以後、この第2の階調補正方法をD−補正と呼ぶ。図8(a)はD−補正が有効なシーンのヒストグラムの一例を示す図である。画面内に、暗い輝度から明るい輝度まで均等に輝度分布がある場合には、図8(a)のようなヒストグラムにならない。図8(a)では高輝度側には輝度が分布しておらず、画面内の輝度差がさほど激しくないシーンであると判断できる。
(2) Second Gradation Correction Method In the present embodiment, as the second gradation correction method, a gradation in which unnecessary gradation assignment is not performed according to the state of luminance data in the high-luminance area of the captured image. The correction method is used. Hereinafter, this second gradation correction method is referred to as D-correction. FIG. 8A is a diagram illustrating an example of a histogram of a scene in which D-correction is effective. When there is a uniform luminance distribution from dark to bright in the screen, the histogram shown in FIG. In FIG. 8A, it can be determined that the scene has no brightness distribution on the high brightness side and the brightness difference in the screen is not so severe.

輝度分布が広範囲に亘っている場合には、どの入力輝度に対しても出力輝度が割り当たるように、図8(b)に示す通常ガンマカーブ302のようなガンマカーブを設定する。しかし、図8(a)のヒストグラムのように高輝度領域に分布が無い場合、その入力輝度に対して出力輝度を割り当てても有効な階調表現にはならない。従って、ヒストグラムの分布が存在する最大輝度値である輝度値312を入力輝度の上限とし、その輝度値312を画像データが取り得る最大輝度値に割り当てる、図8(b)に示すD−ガンマカーブ320のようなガンマカーブを設定する。D−ガンマカーブ320は入力輝度324までの入力輝度に対して有効に出力輝度を割り当て、入力輝度324を超えた輝度に対しては割当を行わない。なお、図8(b)では輝度分布領域とD−ガンマカーブ320の入力輝度の割り当て範囲が完全に一致している場合を示している。しかしながら、予め用意した複数のD−ガンマカーブのいずれかを選択する方式とする場合、入力輝度分布とD−ガンマカーブの入力輝度の割り当て範囲が完全には一致しない場合もある。   When the luminance distribution covers a wide range, a gamma curve such as a normal gamma curve 302 shown in FIG. 8B is set so that the output luminance is assigned to any input luminance. However, when there is no distribution in the high luminance region as in the histogram of FIG. 8A, even if the output luminance is assigned to the input luminance, it is not effective gradation expression. Accordingly, the D-gamma curve shown in FIG. 8B is used, in which the luminance value 312 that is the maximum luminance value in which the histogram distribution exists is set as the upper limit of the input luminance, and the luminance value 312 is assigned to the maximum luminance value that the image data can take. A gamma curve such as 320 is set. The D-gamma curve 320 effectively assigns output luminance to input luminance up to the input luminance 324 and does not assign luminance exceeding the input luminance 324. FIG. 8B shows a case where the luminance distribution area and the input luminance allocation range of the D-gamma curve 320 completely match. However, when selecting one of a plurality of D-gamma curves prepared in advance, the input luminance distribution and the input luminance allocation range of the D-gamma curve may not completely match.

(3)第3の階調補正方法
本実施の形態では、第3の階調補正方法として、撮影した画像の低周波領域、輝度情報、人物顔の有無といった状況に応じて、低周波かつ低輝度な領域の輝度レベルを調節する階調補正方法とする。以後、この第3の階調補正方法を暗部補正と呼ぶ。
(3) Third Gradation Correction Method In the present embodiment, as the third gradation correction method, low frequency and low frequency are selected according to the situation such as the low frequency area of the captured image, the luminance information, and the presence or absence of a human face. A gradation correction method for adjusting the luminance level of a luminance region is adopted. Hereinafter, this third gradation correction method is referred to as dark portion correction.

図9に、暗部補正が有効なシーンと、そのシーンを暗部補正した結果のイメージ図を示す。図9は人物が太陽を背にして立っているシーンである。暗部補正前は、人物顔、人物の体、地面などが逆光シーンのせいで暗く写っている。この暗くなった暗部を明るくするように、一律のトーンカーブで階調補正を行おうとすると、人物の黒目や着用している横縞シャツの模様も必要以上に明るく補正されてしまう場合がある。その場合には、画像としてはコントラストが低下したような質の低い画像となってしまう。そこで、低周波輝度成分を抽出し、低輝度領域がある程度の面積を持った場合に階調補正を行うように暗部補正を行う。   FIG. 9 shows a scene in which dark part correction is effective and an image diagram of the result of dark part correction of the scene. FIG. 9 shows a scene where a person stands with the sun behind. Before the dark part correction, the human face, the human body, the ground, etc. appear dark due to the backlight scene. If tone correction is performed with a uniform tone curve so as to brighten the darkened dark part, the black eyes of the person and the pattern of the worn horizontal stripe shirt may be corrected more brightly than necessary. In that case, the image is a low quality image with a reduced contrast. Therefore, a low frequency luminance component is extracted, and dark portion correction is performed so that gradation correction is performed when the low luminance region has a certain area.

図10にその様子を示す。画像の低周波成分を抽出するために、図10ではオリジナル画像から3つの異なる解像度の画像を生成する。図10(a)はほぼオリジナル画像の解像度を保っているが、図10(b)、図10(c)と解像度を落としている。図10(c)に至っては人物の判別が困難になっている。この解像度の低下の程度は、得たい暗部補正効果により様々に設定するようにしても良い。これら複数の画像に対し、図11に示すような暗部補正用ガンマをかける。このガンマは、入力輝度が低い領域は高い出力輝度が得られるような変換テーブルとなっている。それぞれの画像の階調補正を行った後、3つの画像を加算平均するように合成する。すると、目や洋服の模様といったある程度の輝度周波数を持つ領域はそれほど暗部補正がかからず、ズボンや地面といった、輝度周波数の低い領域に対しては暗部補正がかかってくる効果が得られる。   This is shown in FIG. In order to extract the low-frequency component of the image, in FIG. 10, three different resolution images are generated from the original image. In FIG. 10A, the resolution of the original image is almost maintained, but the resolution is lowered as in FIGS. 10B and 10C. In FIG. 10C, it is difficult to determine a person. The degree of the resolution reduction may be set variously depending on the dark part correction effect to be obtained. A dark portion correction gamma as shown in FIG. 11 is applied to the plurality of images. This gamma is a conversion table in which a high output luminance is obtained in a region where the input luminance is low. After tone correction of each image, the three images are combined so as to be averaged. Then, an area having a certain luminance frequency such as an eye or clothes pattern is not so darkly corrected, and an effect of applying dark area correction to an area having a low luminance frequency such as pants or the ground can be obtained.

●全体の補正処理の流れ
次に、上述した3つの階調補正方法を用いて、より適切な階調の画像を得るための全体の流れを図2〜図7のフローチャートを参照しながら説明する。
Flow of Overall Correction Processing Next, an overall flow for obtaining an image with a more appropriate gradation using the above-described three gradation correction methods will be described with reference to the flowcharts of FIGS. .

撮像装置100の起動後、各種デバイスの初期化、起動を経てEVF画像表示などの撮影準備作業を行い、シャッタスイッチ104の押下によるSW1のON待ちに入る(S201)。SW1ONが検知されると、D+補正に用いるD+量の仮決定処理を実行する(S203)。ここで、D+量の仮決定処理について、図3を参照して説明する。   After the image pickup apparatus 100 is started, various devices are initialized and started to perform preparations for shooting such as EVF image display, and the switch waits for SW1 to be turned on by pressing the shutter switch 104 (S201). When SW1ON is detected, a D + amount tentative determination process used for D + correction is executed (S203). Here, the D + amount tentative determination process will be described with reference to FIG.

まず、撮像素子16により撮影して得られた画像データを、画像処理回路50において、例えば縦横4ブロックに均等分割し、ブロック毎にヒストグラムを生成して輝度分布を取得する(S301)。なお、ここで生成するヒストグラムは、画面全体のものであってもよいが、ブロック毎に生成することで、より詳細な分布状況を把握することができる。そして、システム制御部60は、各ブロックのヒストグラムの特に高輝度側の輝度分布を解析し、このままの露出で撮影するとどれくらいの白飛びが発生するかを判断する(S303)。そして、白飛びの発生を抑えるためにはどの程度露出を抑えればよいかを算出するが(S305)、これをD+量と呼ぶ。なお、画像全体の白飛び状況から判断するので、ここで得られるD+量を、以下、「全体D+量DPAll」と呼ぶ。本実施の形態では全体D+量DPAllとして、画像全体の白飛び状況に応じて、補正無し(DPAll=0)、弱補正(DPAll=Low)、中補正(DPAll=Mild)、強補正(DPAll=High)の4段階とする。   First, in the image processing circuit 50, image data obtained by photographing with the image sensor 16 is equally divided into, for example, four blocks in length and width, and a histogram is generated for each block to obtain a luminance distribution (S301). The histogram generated here may be for the entire screen, but it is possible to grasp a more detailed distribution situation by generating each block. Then, the system control unit 60 analyzes the luminance distribution on the high-luminance side of the histogram of each block, and determines how much whiteout occurs when shooting with this exposure (S303). Then, how much exposure should be suppressed in order to suppress the occurrence of overexposure is calculated (S305), which is referred to as the D + amount. Since the determination is made based on the whiteout condition of the entire image, the D + amount obtained here is hereinafter referred to as “total D + amount DPAll”. In the present embodiment, as the total D + amount DPAll, there is no correction (DPAll = 0), weak correction (DPAll = Low), medium correction (DPAll = Mild), and strong correction (DPAll = DPAll) according to the overexposure state of the entire image. High).

また、画像認識回路38は同じ画像データから、例えば人の顔などの予め設定された被写体(以下、「人の顔」として説明する。)を検出し、顔の有無、顔領域の座標及び大きさを含む顔情報を取得する(S315)。ここで、画像中に顔が無いと判断された場合(S317でNO)、ステップS305で求めた全体D+量DPAllを仮D+量DP1として採用する(S337)。一方、画像中に顔が有ると判断された場合(S317でYES)、主顔領域付近のヒストグラムを生成して輝度分布を取得する(S319)。そして、システム制御部60は、顔領域付近の輝度分布の高輝度領域を解析し、顔領域に限定した白飛び状況を把握し(S321)、この白飛び状況に応じてD+量を決定する(S323)。なお、顔領域に限定した白飛び状況から判断するので、ここで得られるD+量を、以下、「顔D+量DPFace」と呼ぶ。本実施の形態では、顔D+量DPFaceとして、ステップS305と同様に、補正無し(DPFace=0)、弱補正(DPFace=Low)、中補正(DPFace=Mild)、強補正(DPFace=High)の4段階とする。なお、D+量は段数で表し、本実施の形態では、Low=1/3段、Mild=2/3段、Hi=1段とする。   Further, the image recognition circuit 38 detects a preset subject (hereinafter referred to as “human face”) such as a human face from the same image data, and the presence or absence of the face, the coordinates and size of the face area. The face information including the length is acquired (S315). If it is determined that there is no face in the image (NO in S317), the total D + amount DPAll obtained in step S305 is adopted as the temporary D + amount DP1 (S337). On the other hand, if it is determined that there is a face in the image (YES in S317), a histogram near the main face region is generated to obtain a luminance distribution (S319). Then, the system control unit 60 analyzes the high brightness area of the brightness distribution near the face area, grasps the whiteout situation limited to the face area (S321), and determines the D + amount according to this whiteout situation ( S323). Since the determination is made based on the whiteout situation limited to the face area, the D + amount obtained here is hereinafter referred to as “face D + amount DPFace”. In this embodiment, as face D + amount DPFace, as in step S305, no correction (DPFace = 0), weak correction (DPFace = Low), medium correction (DPFace = Mild), and strong correction (DPFace = High). There are four stages. Note that the D + amount is represented by the number of stages, and in this embodiment, Low = 1/3, Mild = 2/3, and Hi = 1.

そして、全体D+量DPAllと顔D+量DPFaceとを比較する(S335)。比較の結果、全体D+量DPAllの方が大きければ全体D+量DPAllを(S337)、そうでなければ顔D+量DPFaceを(S339)、仮D+量DP1として採用する。   Then, the total D + amount DPAll and the face D + amount DPFace are compared (S335). As a result of comparison, if the total D + amount DPAll is larger, the total D + amount DPAll is adopted as (S337), and if not, the face D + amount DPFace is adopted (S339) as the provisional D + amount DP1.

D+量の仮決定が終了すると、図2の処理に戻ってステップS205に進み、図3で求めた仮D+量DP1に基づいて、最終的な絞り値、シャッタ速度、ゲイン、D+量を決定する最終決定処理を行う(S205)。ここで、この最終決定処理について図4を参照して説明する。   When the provisional determination of the D + amount is completed, the process returns to the process of FIG. 2 and proceeds to step S205, where the final aperture value, shutter speed, gain, and D + amount are determined based on the provisional D + amount DP1 obtained in FIG. Final decision processing is performed (S205). Here, the final determination process will be described with reference to FIG.

まず、撮像素子16により撮影して得られた画像データから、被写体輝度Bv1を取得する(S401)。この被写体輝度は画面を縦横24x16程度の細かさのブロックに分割し、それぞれの輝度積分値をもとに算出する。スポット測光などのように、画面内の任意の狭い領域の測光を行う測光方式の場合、ブロック分割せずにその場所の1ブロックの輝度積分値から輝度値を算出することもできる。求めた被写体輝度Bv1と撮影感度Svから露出値Ev1を求め、露出値と絞り値、シャッタ速度、ゲインの組み合わせを表現した公知のプログラム線図テーブルに基づいて、絞り値Av1、シャッタ速度Tv1、ゲインGain1を求める(S403)。なお、このプログラム線図は、撮影モードごとに異なる線図を持つ構成にすることも可能である。   First, subject brightness Bv1 is acquired from image data obtained by photographing with the image sensor 16 (S401). The subject luminance is calculated based on the luminance integrated values obtained by dividing the screen into blocks of about 24 × 16 vertical and horizontal dimensions. In the case of a photometric method that performs photometry of an arbitrary narrow area in the screen, such as spot photometry, the luminance value can be calculated from the integrated luminance value of one block at that location without dividing the block. An exposure value Ev1 is obtained from the obtained subject brightness Bv1 and photographing sensitivity Sv, and based on a known program diagram table expressing a combination of the exposure value, the aperture value, the shutter speed, and the gain, the aperture value Av1, the shutter speed Tv1, and the gain Gain 1 is obtained (S403). Note that the program diagram can be configured to have a diagram different for each photographing mode.

次に、図3で説明した仮D+量DP1分、露出を抑えるために必要なゲイン及びシャッタ速度の調整を行う。まず、プログラム線図から求めたゲインGain1と仮D+量DP1とを比較する(S405)。ゲインGain1が大きい場合、ゲインGain1から仮D+量DP1を引いた値を新たなゲイン値Gain2とする(S407)。この場合、ゲインを調整するのみでD+量を露出アンダーにできるため、シャッタ速度はプログラム線図から求めたTv1をそのまま採用してTv2とする(S409)。一方、ゲインGain1が仮D+量DP1以下の場合、ゲインだけでは仮D+量DP1分、露出アンダーにすることができないことになる。そこで、まず、ゲインを設定可能な最小値MinGainにする(S411)。続いて、シャッタ速度を速くすることで、仮D+量DP1分の露出アンダーを実現する。ここでは、プログラム線図から求めたTv1に対し、ゲインで調整しきれなかった段数分だけシャッタ速度を速くし、Tv2とする(S413)。   Next, the gain and shutter speed necessary for suppressing exposure are adjusted by the provisional D + amount DP1 described with reference to FIG. First, the gain Gain1 obtained from the program diagram is compared with the provisional D + amount DP1 (S405). When the gain Gain1 is large, a value obtained by subtracting the temporary D + amount DP1 from the gain Gain1 is set as a new gain value Gain2 (S407). In this case, since the D + amount can be underexposed only by adjusting the gain, Tv1 obtained from the program diagram is directly adopted as Tv2 as the shutter speed (S409). On the other hand, when the gain Gain1 is equal to or less than the provisional D + amount DP1, it is impossible to underexpose the provisional D + amount DP1 by the gain alone. Therefore, first, the minimum value MinGain that can be set with the gain is set (S411). Subsequently, by increasing the shutter speed, underexposure for the provisional D + amount DP1 is realized. Here, with respect to Tv1 obtained from the program diagram, the shutter speed is increased by the number of stages that cannot be adjusted by the gain, and is set to Tv2 (S413).

上述したようにして、仮D+量DP1分だけ露出アンダーとなるようにゲインとシャッタ速度を調整した後、この露出が実現可能かどうかをチェックする(S415)。この撮像装置100で設定されている撮影モードにおける露出限界は、メカ的な制御限界から決められるのはもちろん、モード毎に制御限界を設定することが可能である。そのため、絞り値、シャッタ速度、ゲインからなる露出値が、露出限界MaxEv(これ以上シャッター速度を速くしたり、ゲインを下げたりすることができない状態での露出)を超えていないかをチェックする。限界内に収まっている場合、仮D+量DP1を最終的なD+量DP2として確定する(S417)。逆に、限界を超えていた場合、仮D+量DP1を超過分だけ補正した値を最終的なD+量DP2として確定する(S419)。これは、被写体が高輝度のために、設定された露出値が露出限界付近である場合、D+補正を実施すれば効果的ではあるが、D+補正を実施できない状態であるためである。なお、D+補正を行う必要が無い場合には仮D+量DP1=0であり、必ずGain1よりも小さくなる。そのため、ステップS405、S407、S409の流れにより、ステップS403で求めたAv1、Tv1、Gain1がそのまま露出値(Av1、Tv2、Gain2)として確定すると共に、D+量DP2=0となる。   As described above, after adjusting the gain and the shutter speed so that the exposure is underexposed by the provisional D + amount DP1, it is checked whether or not this exposure can be realized (S415). The exposure limit in the shooting mode set by the imaging apparatus 100 is determined from the mechanical control limit, and the control limit can be set for each mode. Therefore, it is checked whether the exposure value including the aperture value, shutter speed, and gain exceeds the exposure limit MaxEv (exposure when the shutter speed cannot be further increased or the gain cannot be decreased). If it is within the limit, the provisional D + amount DP1 is determined as the final D + amount DP2 (S417). On the other hand, if the limit is exceeded, a value obtained by correcting the provisional D + amount DP1 by the excess is determined as the final D + amount DP2 (S419). This is because, since the subject has high brightness, when the set exposure value is near the exposure limit, it is effective to perform D + correction, but D + correction cannot be performed. When there is no need to perform D + correction, the provisional D + amount DP1 = 0, which is always smaller than Gain1. Therefore, Av1, Tv1, and Gain1 obtained in step S403 are determined as exposure values (Av1, Tv2, and Gain2) as they are and the D + amount DP2 = 0 is obtained through the flow of steps S405, S407, and S409.

図13は、SW1ON前後の撮像素子16の垂直同期信号VD、撮像素子16への露光、撮像素子16からの蓄積電荷の読み出し、顔検出、ヒストグラム生成、測光用ブロック輝度検出、D+量算出、露出値算出のタイミングを示すタイミング図である。露光及び蓄積電荷の読み出しは毎垂直期間行われる。図13では、顔検出は2垂直期間に1回の周期で行われることを示しているが、この限りではなく、画像認識回路38による画像認識処理の性能次第で検出周期は変わってくる。ヒストグラム生成に関して、同一露光で得られた画像データに基づく顔検出とヒストグラム生成が行われた結果を用いてD+量算出を行いたいため、顔検出周期にあわせてヒストグラムを生成する周期になるように制御している。   FIG. 13 shows the vertical synchronization signal VD of the image sensor 16 before and after SW1 ON, exposure to the image sensor 16, reading of accumulated charges from the image sensor 16, face detection, histogram generation, photometric block luminance detection, D + amount calculation, exposure It is a timing diagram which shows the timing of value calculation. Exposure and readout of accumulated charge are performed every vertical period. FIG. 13 shows that face detection is performed once every two vertical periods, but this is not a limitation, and the detection period varies depending on the performance of image recognition processing by the image recognition circuit 38. Regarding the histogram generation, since it is desired to calculate the D + amount using the result of face detection and histogram generation based on image data obtained by the same exposure, the histogram generation period is set in accordance with the face detection period. I have control.

このような関係において、SW1がONとなった場合、直前に検出されていた顔検出結果(5)と、画像データ(5)から生成されたヒストグラム(5)とを用いて、D+量算出を行う。D+量仮決定処理511では、図3を参照して説明した処理が実行される。D+量仮決定処理511が終了した後、絞り値、シャッタ速度、ゲイン、D+量の最終決定が行われる(513)。自動露出制御で使用する測光結果は、同様に画像データ(5)から検出された画面ブロック分割輝度を元に算出されたものを使用する。露出値算出513では、図4を参照して説明した処理が実行される。   In this relationship, when SW1 is turned on, the D + amount calculation is performed using the face detection result (5) detected immediately before and the histogram (5) generated from the image data (5). Do. In the D + amount provisional determination process 511, the process described with reference to FIG. 3 is executed. After the D + amount provisional determination process 511 is completed, final determination of the aperture value, shutter speed, gain, and D + amount is performed (513). Similarly, the photometric result used in the automatic exposure control is calculated based on the screen block division luminance detected from the image data (5). In the exposure value calculation 513, the process described with reference to FIG. 4 is executed.

上述したようにして、D+補正のための絞り値、シャッタ速度、ゲイン、D+量が確定すると、図2に戻って、SW2のON待ちに入る(S207)。SW2ONが検知されると、ステップS205で求めた露出値を用いて撮像素子16を露光し、露光時間経過後に電荷を読み出して、画像データに変換する(S209)。そして得られた画像データに対し、ステップS205で決定したD+量DP2から、D+補正を実施するか否かを判断する(S211)。具体的には、D+量DP2>0であるかどうかを判断する。D+補正を実施しない場合(つまり、DP2が0の場合)は、D−量の決定処理を行う(S213)。ここで、D−量の決定処理について、図5を参照して説明する。   As described above, when the aperture value, shutter speed, gain, and D + amount for D + correction are determined, the process returns to FIG. 2 and waits for SW2 to be turned on (S207). When SW2ON is detected, the image sensor 16 is exposed using the exposure value obtained in step S205, and the charge is read after the exposure time has elapsed and converted to image data (S209). Then, it is determined whether or not to perform D + correction on the obtained image data from the D + amount DP2 determined in step S205 (S211). Specifically, it is determined whether D + amount DP2> 0. When D + correction is not performed (that is, when DP2 is 0), D-amount determination processing is performed (S213). Here, the D-amount determination process will be described with reference to FIG.

まず、撮像素子16により撮影して得られた画像データから、画像処理回路50において画面全体のヒストグラムを生成する(S501)。そして、システム制御部60はこのヒストグラムにより得られた輝度分布情報のうち、特に高輝度領域の状況を解析し、高輝度領域にどれくらいのデータが存在するかを把握する。そして、ガンマ出力輝度を割り当てる必要が無い領域がどの程度存在するかを分析し、ガンマ出力輝度割当が不要な領域の程度に応じて、D−量DM1を決定する(S505)。本実施の形態では、D−量DM1は、ガンマ出力輝度割当が不要な領域の程度に応じて、補正無し(DM1=0)、弱補正(DM1=Low)、中補正(DM1=Mild)、強補正(DM1=High)の4段階とする。なお、D−量は段数で表し、本実施の形態では、Low=1/3段、Mild=2/3段、Hi=1段とする。   First, a histogram of the entire screen is generated in the image processing circuit 50 from image data obtained by photographing with the image sensor 16 (S501). Then, the system control unit 60 analyzes the situation of the high luminance area in the luminance distribution information obtained from this histogram, and grasps how much data exists in the high luminance area. Then, the extent to which there is no need to assign the gamma output luminance is analyzed, and the D-amount DM1 is determined according to the degree of the region that does not require the gamma output luminance assignment (S505). In the present embodiment, the D-amount DM1 has no correction (DM1 = 0), weak correction (DM1 = Low), medium correction (DM1 = Mild), depending on the extent of the area where gamma output luminance allocation is unnecessary. There are four levels of strong correction (DM1 = High). The D-amount is represented by the number of stages, and in this embodiment, Low = 1/3 stage, Mild = 2/3 stage, and Hi = 1 stage.

続いて、ステップS205で求めたD+量DP2が0より大きいか否か、すなわち、D+補正を行うかどうかを再度チェックする(S515)。そして、D+補正を行わない場合にはステップS505で決定したDM1をD−量として確定し、D+補正を行う場合には念のためD−補正が行われないようににDM1を0に設定する(S517)。このように、本実施の形態では、D+補正実施時にはD−補正を行わない処理としているが、これは、D+補正とD−補正を同時に行う必要があるシーンは想定しづらいからである。D+補正は高輝度による白飛びの発生の恐れがあるシーンに対して作用するが、図4で説明したように白飛びを防ぐために露出アンダーとなるように露出値を決定した場合、高輝度領域ぎりぎりまで輝度分布があるようなヒストグラムになることが想定される。このようなヒストグラムを有する画像データに対してD−補正を実施する必要は無い。   Subsequently, it is checked again whether or not the D + amount DP2 obtained in step S205 is larger than 0, that is, whether or not D + correction is performed (S515). If D + correction is not performed, DM1 determined in step S505 is determined as the D-amount. If D + correction is performed, DM1 is set to 0 so that D-correction is not performed. (S517). As described above, in the present embodiment, when D + correction is performed, D-correction is not performed. This is because it is difficult to assume a scene where D + correction and D- correction need to be performed simultaneously. The D + correction operates on a scene where there is a risk of whiteout due to high luminance. However, as described with reference to FIG. 4, when the exposure value is determined so as to be underexposed in order to prevent whiteout, It is assumed that the histogram has a luminance distribution up to the limit. There is no need to perform D-correction on image data having such a histogram.

上述したようにしてD−量が確定すると、図2の処理に戻る。ステップS215では、D−補正を実施するか否かを判断する(S215)。上述したように、D+補正を実施する場合にはD−補正を行わないので、ステップS211でYESであれば、ここではNOの判断となる。また、ステップS213で設定されたD−値DM1=0であれば実施しない、D−値DM1=0でなければ実施する、と判断する。D−補正を実施しない場合には、暗部補正量の決定処理を行う(S217)。一方、D−補正を実施する場合は、暗部補正は行わない。これは、D−補正と暗部補正は共に輝度レベルを上げる効果を持ち、ここで両者の補正を行うように判断してしまうと、必要以上に補正がかかり、明るすぎる画像となってしまう可能性があるからである。また、D−補正がかかるシーンは高輝度領域に輝度分布が無いシーンであるため、逆光シーンのような輝度差が激しいシーンである可能性が低く、暗部補正をかける必要がないシーンであることが想定される。ここで、ステップS217で行われる暗部補正量の決定処理について、図6を参照して説明する。   When the D-amount is determined as described above, the process returns to the process of FIG. In step S215, it is determined whether or not D-correction is performed (S215). As described above, when D + correction is performed, D- correction is not performed. Therefore, if “YES” is determined in the step S211, NO is determined here. In addition, it is determined that if the D-value DM1 = 0 set in step S213 is not implemented, it is determined that the D-value DM1 = 0 is not implemented. When the D-correction is not performed, a dark portion correction amount determination process is performed (S217). On the other hand, when D-correction is performed, dark part correction is not performed. This is because both D-correction and dark area correction have the effect of increasing the luminance level, and if it is determined that both corrections are to be performed here, there is a possibility that the correction will be applied more than necessary, resulting in an image that is too bright. Because there is. In addition, since a scene to which D-correction is applied is a scene having no luminance distribution in a high luminance area, it is unlikely that the scene has a strong luminance difference such as a backlight scene, and is a scene that does not require dark part correction. Is assumed. Here, the dark part correction amount determination process performed in step S217 will be described with reference to FIG.

まず、撮像素子16により撮影して得られた画像データを、画像処理回路50において複数ブロックに分割し、ブロック毎に積分値を求めることで、ブロック輝度を取得する(S601)。求めたブロック輝度に対して、ステップS205で求めたD+量DP2により、簡易的に輝度補正を行う(S602)。これは、D+補正が行われている場合、撮像素子16から読み出したままの画像データはD+量分だけ露出アンダーであるため、本来の輝度レベルに戻すために簡易的な輝度補正を行う。続いて、画像認識回路38により輝度補正した画像データから、顔の有無、顔座標、顔の大きさを含む顔情報を取得する(S605)。そして、得られた顔情報とブロック輝度から、顔付近の輝度値(顔輝度)を計算すると共に(S607)、画面全体のヒストグラムを生成する(S609)。システム制御部60は、画面全体のヒストグラムから低輝度領域への輝度分布がどの程度あるのかを解析するが(S611)、これは、低輝度領域に輝度分布が無い場合は暗部補正を実施する必要がないため、その判断に用いる。次に、露出条件としてISO感度(ゲイン)情報を取得する(S613)。暗部補正は、低輝度レベルの画素のレベルを増幅する効果を得るために行うものであるが、低輝度レベルであるがゆえに、S/N悪化による画質劣化が露呈しやすい。もともと高ISO感度(高ゲイン)で得られた画像データであれば、既にS/Nが悪化している可能性があるので、ゲイン値に応じて暗部補正量を抑える判断を行うためにISO感度情報を取得する。   First, image data obtained by photographing with the image sensor 16 is divided into a plurality of blocks in the image processing circuit 50, and an integral value is obtained for each block, thereby obtaining block luminance (S601). Brightness correction is simply performed on the obtained block brightness using the D + amount DP2 obtained in step S205 (S602). This is because when the D + correction is performed, the image data as read from the image sensor 16 is underexposed for the amount of D +, and thus simple brightness correction is performed to return to the original brightness level. Subsequently, face information including the presence / absence of a face, face coordinates, and face size is acquired from the image data whose luminance has been corrected by the image recognition circuit 38 (S605). Then, a luminance value (face luminance) near the face is calculated from the obtained face information and block luminance (S607), and a histogram of the entire screen is generated (S609). The system control unit 60 analyzes the extent of the luminance distribution from the histogram of the entire screen to the low luminance region (S611), and this requires dark portion correction when there is no luminance distribution in the low luminance region. Because there is no, it is used for the judgment. Next, ISO sensitivity (gain) information is acquired as an exposure condition (S613). The dark portion correction is performed in order to obtain an effect of amplifying the level of a pixel having a low luminance level. However, since the luminance is low, image quality deterioration due to S / N deterioration is easily exposed. If the image data is originally obtained with high ISO sensitivity (high gain), the S / N may have already deteriorated, so the ISO sensitivity is used to make a determination to suppress the dark portion correction amount according to the gain value. Get information.

そして、得られた各種情報を基にして、最大暗部補正量を決定する(S615)。人物顔が検出されている場合、例え逆光シーンであっても、あまりに大きい暗部補正をかけると人物顔のS/Nが悪化し、印象の悪い画像となってしまう。そのため、先に述べたように、画像データのもともとのS/Nを知る為にISO感度情報も加味して最大暗部補正量を決定する。   Then, based on the obtained various information, the maximum dark part correction amount is determined (S615). When a human face is detected, even if it is a backlight scene, if too large dark area correction is applied, the S / N of the human face deteriorates, resulting in a poor impression image. Therefore, as described above, in order to know the original S / N of the image data, the maximum dark part correction amount is determined in consideration of ISO sensitivity information.

次に、ヒストグラム解析結果、及び、最大暗部補正量に基づいて、画面全体としてどの程度の暗部補正を実施すべきかどうかを決定する(S617)。ここで決められた補正量を全体暗部補正量DarkGainAllとする。続いて、顔の有無を判断し(S619)、顔が無い場合、先に求めた全体暗部補正量DarkGainAllを暗部補正量DarkGain1として採用する(S625)。一方、顔がある場合には、ステップS607で求めた顔輝度、及び、最大暗部補正量に基づいて顔暗部補正量DarkGainFaceを決定する(S621)。そして、全体暗部補正量DarkGainAllと顔暗部補正量DarkGainFaceとを比較し(S623)、補正量の大きいほうを暗部補正量DarkGain1として採用する(S625またはS627)。   Next, based on the histogram analysis result and the maximum dark area correction amount, it is determined how much dark area correction should be performed for the entire screen (S617). The correction amount determined here is set as the overall dark portion correction amount DarkGainAll. Subsequently, the presence / absence of a face is determined (S619), and if there is no face, the previously determined overall dark portion correction amount DarkGainAll is adopted as the dark portion correction amount DarkGain1 (S625). On the other hand, if there is a face, the face dark portion correction amount DarkGainFace is determined based on the face luminance and the maximum dark portion correction amount obtained in step S607 (S621). Then, the overall dark portion correction amount DarkGainAll and the face dark portion correction amount DarkGainFace are compared (S623), and the larger correction amount is adopted as the dark portion correction amount DarkGain1 (S625 or S627).

以上のようにして暗部補正量DarkGain1が決まると、図2の処理に戻る。ステップS217までの処理により、各補正の実施、非実施、実施の際の補正量が決定されているので、これらの情報に基づいて画像処理を行い(S219)、補正後の画像データをメモリカード等へ保存する。ここで、図7を参照して、ステップS219で行割れる画像処理の詳細について説明する。   When the dark portion correction amount DarkGain1 is determined as described above, the processing returns to FIG. By performing the processing up to step S217, the correction amount at the time of execution, non-execution, and execution of each correction is determined. Therefore, image processing is performed based on such information (S219), and the corrected image data is stored in the memory card. Save to etc. Here, with reference to FIG. 7, the details of the image processing that can be divided in step S219 will be described.

まずD+量DP2を参照し、DP2が0より大きいかどうか、即ち、D+補正を行うかどうかを判断し(S703)、D+補正を行う場合、D+量DP2からトーンカーブを決定する(S707)。   First, referring to the D + amount DP2, it is determined whether DP2 is greater than 0, that is, whether D + correction is to be performed (S703). If D + correction is to be performed, a tone curve is determined from the D + amount DP2 (S707).

通常撮影時は自動焦点調節処理で求めた絞り、シャッタ、ゲインで撮影するが、D+補正では、上述したように、この露出条件に対して、算出されたD+量分だけ露出アンダーで露光することで白飛びを抑えている。しかしながら、白飛びを抑えるために露出アンダーにすると、画面全体の輝度がアンダーとなってしまう。ここで、アンダー露出撮影により得られた画像データのうち、本来アンダーにすべきでない輝度領域の輝度値をアンダー分だけ元に戻すように補正されるようにトーンカーブを設定すれば、高輝度領域の白飛びは抑えられる。また、白飛びしていない輝度領域の輝度レベルも暗くなりすぎず、良好な結果が得られるはずである。   During normal shooting, shooting is performed with the aperture, shutter, and gain obtained by the automatic focus adjustment processing, but with D + correction, as described above, exposure is underexposed for the calculated D + amount for this exposure condition. To suppress overexposure. However, if underexposure is performed to suppress overexposure, the brightness of the entire screen will be underexposed. Here, if the tone curve is set so that the luminance value of the luminance area that should not be under-exposure among the image data obtained by under-exposure shooting is corrected so as to return it to the original amount, the high-luminance area Can be suppressed. Also, the brightness level of the brightness area that is not overexposed does not become too dark, and a good result should be obtained.

図12は、D+補正で用いるトーンカーブの一例を説明する図であり、D+補正を行わない場合の通常ガンマカーブ302に対し、1段分のD+補正を行うD+ガンマカーブ300を示している。D+補正を行わずに適正露光で通常撮影した場合のある入力輝度304を通常ガンマカーブ302で変換すると、出力輝度308となる。これに対し、図4を参照して説明したようにD+量分(1段分)、露出アンダーで露光した場合、入力輝度304は輝度レベルが半分の入力輝度306となる。そこで、この半分の輝度レベルになっている入力輝度306を、露出アンダーではない、つまり、適正露出で撮影した場合と同じ出力輝度308に変換するために、D+ガンマカーブ300を適用して変換する。ここで、露出アンダーで露光した場合には、高輝度領域では白飛びが抑えられているはずである。そこで、D+ガンマカーブ300に示すように、低輝度部分では輝度を持ち上げ、高輝度にいくほどカーブを寝かせていくことで、白とびが抑えられたままの出力輝度を得ることができる。なお、図12ではD+量を1段とした場合のガンマカーブを示しているが、本発明はこれに限るものではなく、例えば1/3段、2/3段、という風に、D+量をさらに細かい段数にすることも可能である。その場合、各D+量に応じたガンマカーブを設定することが必要となる。また、上述したようにD+量に応じてトーンカーブを予め複数種類用意し、その中から選択する方法でも良いが、D+量からトーンカーブを計算して求めてもよい。   FIG. 12 is a diagram for explaining an example of a tone curve used for D + correction, and shows a D + gamma curve 300 for performing D + correction for one stage with respect to the normal gamma curve 302 when D + correction is not performed. When the input luminance 304 that has been normally shot with appropriate exposure without performing D + correction is converted with the normal gamma curve 302, an output luminance 308 is obtained. On the other hand, as described with reference to FIG. 4, when the exposure is underexposed for D + amount (one stage), the input luminance 304 becomes the input luminance 306 having a luminance level of half. Therefore, in order to convert the input luminance 306 having the half luminance level into the output luminance 308 that is not underexposed, that is, the same as the case of photographing with appropriate exposure, the D + gamma curve 300 is applied for conversion. . Here, when the exposure is underexposed, overexposure should be suppressed in the high luminance region. Therefore, as shown in the D + gamma curve 300, by increasing the luminance in the low luminance portion and laying the curve as the luminance increases, it is possible to obtain an output luminance in which overexposure is suppressed. Note that FIG. 12 shows a gamma curve when the D + amount is one stage, but the present invention is not limited to this. For example, the D + amount is set to 1/3 stage, 2/3 stage. It is also possible to make the number of steps finer. In that case, it is necessary to set a gamma curve corresponding to each D + amount. Further, as described above, a plurality of types of tone curves may be prepared in advance according to the D + amount and selected from them, or the tone curve may be calculated from the D + amount.

D+補正を行わない場合(S703でNO)、D−量DM1を参照し、DM1が0より大きいかどうか、即ち、D−補正を行うかどうかを判断する(S705)。D−補正を行う場合、D−量DM1から、図8を参照して上述したようにしてトーンカーブを決定する(S709)。このトーンカーブもD+補正用のトーンカーブと同様に、複数のD−用トーンカーブから選択するようにしても、D−量からトーンカーブを計算して求めてもよい。   When D + correction is not performed (NO in S703), it is determined whether DM1 is larger than 0, that is, whether D-correction is performed (S705) with reference to the D-amount DM1. When performing D-correction, a tone curve is determined from the D-quantity DM1 as described above with reference to FIG. 8 (S709). Similar to the D + correction tone curve, this tone curve may be selected from a plurality of D− tone curves, or may be obtained by calculating a tone curve from the D− amount.

D+補正もD−補正も行わない場合、特定の階調補正を実施する必要がないと判断し、デフォルトのトーンカーブ(例えば、通常ガンマカーブ302)を選択する(S711)。そして、このようにして選択されたいずれかのトーンカーブにより、画像データにトーンカーブ処理を施す(S713)。   When neither D + correction nor D- correction is performed, it is determined that it is not necessary to perform specific gradation correction, and a default tone curve (for example, the normal gamma curve 302) is selected (S711). Then, tone curve processing is performed on the image data with any of the tone curves selected in this way (S713).

その後、暗部補正を実施するか否かを判断するためにD−量DM1を参照する(S715)。DM1>0ではない場合(即ち、D−補正を行わない場合)、暗部補正の実施が許可され、ステップS217で求めた暗部補正量DarkGain1から暗部補正用トーンカーブを決定する(S717)。そして、このトーンカーブを用いて、暗部補正処理を行う(S719)。暗部補正処理では図10に示した低解像度画像と、図11で示した暗部補正用トーンカーブを用い、低輝度周波数かつ低輝度な領域の輝度を明るく補正するように処理を行う。   Thereafter, the D-amount DM1 is referred to in order to determine whether or not to perform dark part correction (S715). When DM1> 0 is not satisfied (that is, when D-correction is not performed), dark portion correction is permitted, and a dark portion correction tone curve is determined from the dark portion correction amount DarkGain1 obtained in step S217 (S717). Then, dark portion correction processing is performed using this tone curve (S719). In the dark portion correction process, the low resolution image shown in FIG. 10 and the dark portion correction tone curve shown in FIG. 11 are used to perform processing to brightly correct the luminance of the low luminance frequency and low luminance region.

このように、暗部補正量DarkGain1を用いて、図10及び図11を参照して上述した低解像度画像と暗部補正用トーンカーブ処理を行うことで、コントラストを損なわずに暗部の輝度レベルを補正することができる。   In this way, by using the dark portion correction amount DarkGain1, the low-resolution image and the dark portion correction tone curve processing described above with reference to FIGS. 10 and 11 are performed, thereby correcting the luminance level of the dark portion without impairing the contrast. be able to.

一方、D−補正が行われる場合には、暗部補正の実施が制限される。本実施の形態では、実施が許可されず、そのまま処理を終了する。   On the other hand, when D-correction is performed, execution of dark part correction is limited. In the present embodiment, the implementation is not permitted and the processing is terminated as it is.

図14は、図7に示す階調補正処理のSW2ON後のタイミング図である。SW2のON後、撮像素子16を露光して読み出された電荷信号(554)は、画像データとして一時記憶メモリ30に保存される(556)と同時に、輝度検出(558)、顔検出(560)、輝度低周波検出が行われる(562)。そうして得られた検出結果を基に、暗部補正量や、D−量の算出を行い(564)、画像処理回路50にて階調補正(566)が行われる。   FIG. 14 is a timing chart after the SW2 ON of the gradation correction processing shown in FIG. After the SW2 is turned on, the charge signal (554) read by exposing the image sensor 16 is stored in the temporary storage memory 30 as image data (556), and at the same time, luminance detection (558) and face detection (560). ), Luminance low frequency detection is performed (562). Based on the detection result thus obtained, the dark part correction amount and the D-amount are calculated (564), and the image processing circuit 50 performs gradation correction (566).

上記の通り本実施の形態によれば、画像の異なる輝度分布にそれぞれ適した複数の階調補正方法を実行可能な撮像装置において、撮像した画像の輝度分布に応じて、複数の階調補正方法の実施/非実施を判断する。そして、実行する階調補正方法のD+量、またはD−量、及び暗部補正量から適切なトーンカーブを設定して補正することで、明るさ及びコントラストが良好な画像を得ることができる。特に、共に輝度レベルを上げる効果を持つD−補正と暗部補正の両者の補正を行わないように制限している。これにより、必要以上に補正がかかり、明るすぎる画像となってしまうことを回避できるので、画質の低下を起こすこともない。   As described above, according to the present embodiment, in an imaging apparatus capable of executing a plurality of gradation correction methods suitable for different luminance distributions of an image, a plurality of gradation correction methods according to the luminance distribution of the captured image. Determine whether or not to implement. An image having good brightness and contrast can be obtained by setting and correcting an appropriate tone curve from the D + amount or D− amount of the gradation correction method to be executed and the dark portion correction amount. In particular, both the D-correction and dark part correction, both of which have the effect of increasing the luminance level, are restricted from being performed. As a result, it is possible to avoid excessive correction and an image that is too bright, so that the image quality does not deteriorate.

<変形例>
上記実施の形態では、D−補正を行う場合、暗部補正の実施が許可されなかったが、実施する量を制限するようにしてもよい。その場合、図7のステップS715において、DM1>0と判断された後に、ステップS717及びS719と同様の処理を行うが、図11に示した暗部補正ガンマよりも変化が少ないガンマを決定し、これに基づいて補正を行う。即ち、D−補正を行わない場合よりも、輝度領域間のゲインの差が少ないガンマとする。
<Modification>
In the above embodiment, when D-correction is performed, dark portion correction is not permitted to be performed, but the amount to be performed may be limited. In that case, after determining that DM1> 0 in step S715 in FIG. 7, the same processing as in steps S717 and S719 is performed, but a gamma having a smaller change than the dark part correction gamma shown in FIG. Correction based on That is, the gamma is set to have a smaller gain difference between the luminance regions than when D-correction is not performed.

10:撮影レンズ、12:メカニカルシャッタ、14:絞り、16:撮像素子、18:CDS、20:PGA回路、22:A/D回路、24:TG、26:絞り駆動回路、28:シャッタ駆動回路、34:VRAM、36:D/A回路、38:画像認識回路、50:画像処理回路、60:システム制御部、70:操作部、108:画像表示装置   10: photographic lens, 12: mechanical shutter, 14: aperture, 16: image sensor, 18: CDS, 20: PGA circuit, 22: A / D circuit, 24: TG, 26: aperture drive circuit, 28: shutter drive circuit , 34: VRAM, 36: D / A circuit, 38: image recognition circuit, 50: image processing circuit, 60: system control unit, 70: operation unit, 108: image display device

Claims (6)

撮像して得られた画像データに対し、出力輝度の輝度範囲に対応する入力輝度の輝度範囲を変更する階調補正を実施するための第1の補正データを決定する第1の決定手段と、 撮像して得られた画像データに対し、輝度周波数の高さに応じた階調補正を実施するための第2の補正データを決定する第2の決定手段と、  First determination means for determining first correction data for performing gradation correction for changing the luminance range of the input luminance corresponding to the luminance range of the output luminance for the image data obtained by imaging; Second determination means for determining second correction data for performing gradation correction according to the height of the luminance frequency for the image data obtained by imaging;
前記第1及び第2の補正データの一方を用いた階調補正が実施される画像データに対し、前記第1及び第2の補正データの他方を用いた階調補正の実施を制限する制御手段と、 を有することを特徴とする撮像装置。  Control means for restricting execution of gradation correction using the other of the first and second correction data for image data subjected to gradation correction using one of the first and second correction data An imaging apparatus comprising:
前記第1の決定手段は、前記撮像して得られた画像データの輝度分布に基づいて前記第1の補正データを決定することを特徴とする請求項1に記載の撮像装置。  The imaging apparatus according to claim 1, wherein the first determination unit determines the first correction data based on a luminance distribution of the image data obtained by the imaging. 前記第1の決定手段は、前記撮像して得られた画像データの高輝度領域の輝度に基づいて前記第1の補正データを決定することを特徴とする請求項1または2に記載の撮像装置。  3. The imaging apparatus according to claim 1, wherein the first determination unit determines the first correction data based on a luminance of a high luminance region of the image data obtained by imaging. . 前記第2の決定手段は、前記撮像して得られた画像データの輝度分布に基づいて前記第2の補正データを決定することを特徴とする請求項1乃至3のいずれか1項に記載の撮像装置。  The said 2nd determination means determines the said 2nd correction data based on the luminance distribution of the image data obtained by the said imaging, The one of Claim 1 thru | or 3 characterized by the above-mentioned. Imaging device. 前記制御手段は、前記第1及び第2の補正データの一方を用いた階調補正が実施される画像データに対し、前記第1及び第2の補正データの他方を用いた階調補正を実施しないことを特徴とする請求項1乃至4のいずれか1項に記載の撮像装置。  The control means performs gradation correction using the other of the first and second correction data on image data on which gradation correction using one of the first and second correction data is performed. The imaging device according to claim 1, wherein the imaging device is not. 第1の決定手段が、撮像して得られた画像データに対し、出力輝度の輝度範囲に対応する入力輝度の輝度範囲を変更する階調補正を実施するための第1の補正データを決定する第1の決定工程と、  The first determining means determines first correction data for performing gradation correction for changing the luminance range of the input luminance corresponding to the luminance range of the output luminance for the image data obtained by imaging. A first determination step;
第2の決定手段が、撮像して得られた画像データに対し、輝度周波数の高さに応じた階調補正を実施するための第2の補正データを決定する第2の決定工程と、  A second determination step in which a second determination unit determines second correction data for performing gradation correction in accordance with the height of the luminance frequency for the image data obtained by imaging;
制御手段が、前記第1及び第2の補正データの一方を用いた階調補正が実施される画像データに対し、前記第1及び第2の補正データの他方を用いた階調補正の実施を制限する制御工程と、  The control means performs gradation correction using the other of the first and second correction data on the image data on which the gradation correction using one of the first and second correction data is performed. Control process to limit,
を有することを特徴とする画像処理方法。  An image processing method comprising:
JP2013084336A 2013-04-12 2013-04-12 Imaging apparatus and image processing method Active JP5460909B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013084336A JP5460909B2 (en) 2013-04-12 2013-04-12 Imaging apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013084336A JP5460909B2 (en) 2013-04-12 2013-04-12 Imaging apparatus and image processing method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2009034391A Division JP5249077B2 (en) 2009-02-17 2009-02-17 Imaging apparatus and image processing method

Publications (2)

Publication Number Publication Date
JP2013176119A true JP2013176119A (en) 2013-09-05
JP5460909B2 JP5460909B2 (en) 2014-04-02

Family

ID=49268565

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013084336A Active JP5460909B2 (en) 2013-04-12 2013-04-12 Imaging apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP5460909B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015079157A (en) * 2013-10-17 2015-04-23 キヤノン株式会社 Image capturing device and control method therefor

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007067907A (en) * 2005-08-31 2007-03-15 Sony Corp Image pickup apparatus, image pickup method, and image pickup program; and image processor, image processing method, and image processing program
JP2008104009A (en) * 2006-10-19 2008-05-01 Sony Corp Imaging apparatus and method
JP2008301371A (en) * 2007-06-01 2008-12-11 Nikon Corp Imaging apparatus and image processing program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007067907A (en) * 2005-08-31 2007-03-15 Sony Corp Image pickup apparatus, image pickup method, and image pickup program; and image processor, image processing method, and image processing program
JP2008104009A (en) * 2006-10-19 2008-05-01 Sony Corp Imaging apparatus and method
JP2008301371A (en) * 2007-06-01 2008-12-11 Nikon Corp Imaging apparatus and image processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015079157A (en) * 2013-10-17 2015-04-23 キヤノン株式会社 Image capturing device and control method therefor

Also Published As

Publication number Publication date
JP5460909B2 (en) 2014-04-02

Similar Documents

Publication Publication Date Title
JP5249077B2 (en) Imaging apparatus and image processing method
US9148561B2 (en) Image capturing apparatus, executable autoexposure bracketing and control method thereof
EP2216987B1 (en) Image capturing apparatus and control method thereof
CN109194882B (en) Image processing method, image processing device, electronic equipment and storage medium
US8937677B2 (en) Digital photographing apparatus, method of controlling the same, and computer-readable medium
CN101800858B (en) Image capturing apparatus and control method thereof
JP5759190B2 (en) Imaging apparatus and control method thereof
JP4999871B2 (en) Imaging apparatus and control method thereof
JP5869808B2 (en) Imaging apparatus and control method thereof
JP6873679B2 (en) Imaging device, control method and program of imaging device
JP5371719B2 (en) Imaging apparatus and control method thereof
JP2014179920A (en) Imaging apparatus, control method thereof, program, and storage medium
JP2010183460A (en) Image capturing apparatus and method of controlling the same
JP3297485B2 (en) Imaging device
JP2010011153A (en) Imaging apparatus, imaging method and program
JP5335964B2 (en) Imaging apparatus and control method thereof
JP5460909B2 (en) Imaging apparatus and image processing method
JP2018181070A (en) Image processing device and image processing method
JP6294607B2 (en) IMAGING DEVICE, ITS CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
JP5587045B2 (en) Imaging apparatus and control method thereof
JP2010183461A (en) Image capturing apparatus and method of controlling the same
JP2017009952A (en) Imaging device
JP2011055171A (en) Imaging apparatus, and method of controlling the same
JP2008205842A (en) Imaging apparatus and its control method, and program
JP2018207429A (en) Imaging apparatus

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131212

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140114

R151 Written notification of patent or utility model registration

Ref document number: 5460909

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151