[go: up one dir, main page]

JP2017068513A - Image processing device and method thereof, program, and storage medium - Google Patents

Image processing device and method thereof, program, and storage medium Download PDF

Info

Publication number
JP2017068513A
JP2017068513A JP2015192219A JP2015192219A JP2017068513A JP 2017068513 A JP2017068513 A JP 2017068513A JP 2015192219 A JP2015192219 A JP 2015192219A JP 2015192219 A JP2015192219 A JP 2015192219A JP 2017068513 A JP2017068513 A JP 2017068513A
Authority
JP
Japan
Prior art keywords
image
gain
image processing
images
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2015192219A
Other languages
Japanese (ja)
Inventor
賢治 小貫
Kenji Konuki
賢治 小貫
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 JP2015192219A priority Critical patent/JP2017068513A/en
Publication of JP2017068513A publication Critical patent/JP2017068513A/en
Pending legal-status Critical Current

Links

Landscapes

  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing device with which it is possible to perform appropriate gradation control while maintaining the local contrast of an image, with a photographed scene taken into account.SOLUTION: The image processing device comprises: a division unit for dividing an inputted image into a plurality of regions; a determination unit for determining gradation characteristics for applying gradation correction to the image on the basis of luminance information on each of a plurality of regions divided by the division unit; a generation unit for generating a plurality of images differing in frequency band from the inputted image; a conversion unit for converting the signals of the plurality of generated images differing in frequency band into gains on the basis of the gradation characteristics; an addition unit for adding up the gain-converted signals of the plurality of images differing in frequency band that are weighted; and a correction unit for multiplying the image by the gain added up by the addition means and thereby correcting the image. The addition unit determines weighting of the signals of plurality of images differing in frequency band on the basis of at least one of a photographing condition when the inputted image was photographed and information on the plurality of regions.SELECTED DRAWING: Figure 12

Description

本発明は、デジタルカメラなどの撮像装置における露出制御技術および撮影後の信号に対して階調補正を行う画像処理技術に関するものである。   The present invention relates to an exposure control technique in an imaging apparatus such as a digital camera and an image processing technique for performing gradation correction on a signal after photographing.

従来より、画像の部分的なコントラストを補正する覆い焼き処理やHDR(ハイダイナミックレンジ)処理等、入力信号のダイナミックレンジを拡大した信号を出力段階で階調圧縮する処理が知られている。このような技術において、撮影時のシーンを判別した結果を露出制御や階調補正にさらに適用することによって、そのシーンの雰囲気を保持した画像を出力する方法が知られている。   2. Description of the Related Art Conventionally, processing for gradation-compressing a signal with an expanded dynamic range of an input signal, such as dodging processing for correcting a partial contrast of an image or HDR (High Dynamic Range) processing, is known. In such a technique, a method of outputting an image retaining the atmosphere of the scene by further applying the result of determining the scene at the time of shooting to exposure control and gradation correction is known.

特許文献1では、シーン判別結果に基づいて、入力画像に対する階調補正処理条件を設定する技術が開示されている。具体的には、例えば主要被写体が明るすぎる場合には輝度値を下げるように、ガンマ特性とオフセット補正を適用する方法が開示されている。また、特許文献2では、異なる周波数成分に基づいた各々の覆い焼き補正効果の差異に基づいて、補正量を制御する技術が開示されている。   Japanese Patent Application Laid-Open No. 2004-151561 discloses a technique for setting gradation correction processing conditions for an input image based on a scene discrimination result. Specifically, for example, a method is disclosed in which gamma characteristics and offset correction are applied so as to lower the luminance value when the main subject is too bright. Patent Document 2 discloses a technique for controlling a correction amount based on a difference in dodging correction effects based on different frequency components.

特開2007−293528号公報JP 2007-293528 A 特開2010−244360号公報JP 2010-244360 A

しかしながら、特許文献1に開示されている技術では、シーンを判別した情報を用いても、ガンマ特性による階調制御では画素値に敏感な補正となり、局所的なコントラストが低下する可能性がある。   However, with the technique disclosed in Patent Document 1, even when information that identifies a scene is used, tone control based on gamma characteristics results in correction that is sensitive to pixel values, and local contrast may be reduced.

また、特許文献2に開示されている技術では、例えば高輝度に隣接した低輝度部分に対して低周波成分による補正効果を抑制すると、画素値に敏感な補正効果となり、結果的にコントラストが低下する可能性がある。   In the technique disclosed in Patent Document 2, for example, if the correction effect by the low frequency component is suppressed for a low luminance part adjacent to the high luminance, the correction effect is sensitive to the pixel value, resulting in a decrease in contrast. there's a possibility that.

本発明は上述した課題に鑑みてなされたものであり、その目的は、撮影されたシーンを考慮した上で、画像の局所的なコントラストを保持しながら、適切な階調制御を行うことができる画像処理装置を提供することである。   The present invention has been made in view of the above-described problems, and an object thereof is to perform appropriate gradation control while maintaining local contrast of an image in consideration of a photographed scene. An image processing apparatus is provided.

本発明に係わる画像処理装置は、入力された画像を複数の領域に分割する分割手段と、前記分割手段により分割された前記複数の領域のそれぞれの輝度情報に基づいて、前記画像に階調補正を行うための階調特性を決定する決定手段と、前記入力された画像から周波数帯域の異なる複数の画像を生成する生成手段と、生成された前記周波数帯域の異なる複数の画像の信号を前記階調特性に基づいてゲインに変換する変換手段と、ゲインに変換された前記周波数帯域の異なる複数の画像の信号を重み付けして加算する加算手段と、前記画像に前記加算手段により加算されたゲインを乗じることにより前記画像を補正する補正手段と、を備え、前記加算手段は、前記入力された画像が撮影された時の撮影条件および前記複数の領域の情報の少なくとも一つに基づいて、前記周波数帯域の異なる複数の画像の信号の重み付けを決定することを特徴とする。   An image processing apparatus according to the present invention includes a dividing unit that divides an input image into a plurality of regions, and gradation correction for the image based on luminance information of each of the plurality of regions divided by the dividing unit. Determining means for determining gradation characteristics for performing image generation, generating means for generating a plurality of images having different frequency bands from the input image, and signals of the generated images having different frequency bands from Conversion means for converting to gain based on tonal characteristics, addition means for weighting and adding signals of a plurality of images having different frequency bands converted to gain, and gain added to the image by the addition means Correcting means for correcting the image by multiplying, wherein the adding means reduces a shooting condition when the input image is shot and information on the plurality of areas. It is based on one, and determines the weighting of the signals of multiple different images of the frequency band.

本発明によれば、撮影されたシーンを考慮した上で、画像の局所的なコントラストを保持しながら、適切な階調制御を行うことができる画像処理装置を提供することが可能となる。   According to the present invention, it is possible to provide an image processing apparatus that can perform appropriate gradation control while maintaining local contrast of an image in consideration of a photographed scene.

本発明の画像処理装置の第1の実施形態であるデジタルカメラの構成を示す図。1 is a diagram showing a configuration of a digital camera that is a first embodiment of an image processing apparatus of the present invention. FIG. 画像処理部104の構成を示すブロック図。FIG. 2 is a block diagram showing a configuration of an image processing unit 104. 撮影者により撮影の指示がなされたときの本撮影の露光量を決定するまでの処理の流れを示すフローチャート。6 is a flowchart showing a flow of processing up to determining an exposure amount for main photographing when a photographing instruction is given by a photographer. 輝度値算出時の重みの一例を示す図。The figure which shows an example of the weight at the time of luminance value calculation. 入力画像の例を示す図。The figure which shows the example of an input image. 領域分割結果を示す図。The figure which shows an area | region division result. 第1の実施形態における露光量算出方法を示す図。The figure which shows the exposure amount calculation method in 1st Embodiment. 本撮影された画像に対して行う階調補正処理の流れを示すフローチャート。6 is a flowchart showing a flow of gradation correction processing performed on a real captured image. 第1の実施形態におけるゲイン量算出方法を示す図。The figure which shows the gain amount calculation method in 1st Embodiment. 第1の実施形態におけるゲイン適用範囲の算出方法を示す図。The figure which shows the calculation method of the gain application range in 1st Embodiment. 第1の実施形態における階調特性の一例を示す図。FIG. 6 is a diagram illustrating an example of gradation characteristics according to the first embodiment. 第1の実施形態におけるゲイン処理部、ゲイン画像生成部、ゲイン加算処理部の構成を示すブロック図。The block diagram which shows the structure of the gain process part in 1st Embodiment, a gain image generation part, and a gain addition process part. 覆い焼き処理における輝度境界に発生する弊害の一例を示す図。The figure which shows an example of the bad effect which generate | occur | produces in the brightness | luminance boundary in a dodging process. 第1の実施形態におけるゲイン加算処理を示す図。The figure which shows the gain addition process in 1st Embodiment. 第1の実施形態におけるゲイン加算処理を示す図。The figure which shows the gain addition process in 1st Embodiment. 第2の加算処理部の処理内容を示すフローチャート。The flowchart which shows the processing content of a 2nd addition process part. 覆い焼き処理における輝度境界に発生する弊害の一例を示す図。The figure which shows an example of the bad effect which generate | occur | produces in the brightness | luminance boundary in a dodging process. 第2の実施形態における画像処理装置の動作を示すフローチャート。10 is a flowchart illustrating an operation of the image processing apparatus according to the second embodiment. 第2の実施形態における上位階層および下位階層ゲインの一例を示す図。The figure which shows an example of the upper hierarchy and lower hierarchy gain in 2nd Embodiment.

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

(第1の実施形態)
第1の実施形態は、被写体領域の情報および撮影条件に関する情報などの撮影シーンに関する情報を用いて露出制御を行い、さらに覆い焼き処理による階調補正処理を行うものである。なお本実施形態では、本実施形態の方法を用いることにより効果が見込めるシーンの一つである夜景を想定して説明する。ただし、本実施形態の方法は夜景以外のシーンにも適用可能である。
(First embodiment)
In the first embodiment, exposure control is performed using information related to a shooting scene such as information on a subject region and information related to shooting conditions, and gradation correction processing is performed by dodging processing. In the present embodiment, a description will be given assuming a night view, which is one of the scenes where an effect can be expected by using the method of the present embodiment. However, the method of the present embodiment can be applied to scenes other than night views.

図1は、本発明の画像処理装置の第1の実施形態であるデジタルカメラの構成を示す図である。図1において、光学系101は、ズームレンズやフォーカスレンズから構成されるレンズ群、絞り、およびシャッターを備えている。この光学系101は、撮像部102に結像される被写体像の倍率やピント位置、あるいは、光量を調整する。撮像部102は、光学系101を通過した被写体からの光束を光電変換し電気信号に変換するCCDやCMOSセンサー等の撮像素子を有する。   FIG. 1 is a diagram showing a configuration of a digital camera which is a first embodiment of an image processing apparatus of the present invention. In FIG. 1, an optical system 101 includes a lens group including a zoom lens and a focus lens, a diaphragm, and a shutter. The optical system 101 adjusts the magnification, focus position, or light amount of the subject image formed on the imaging unit 102. The imaging unit 102 includes an imaging element such as a CCD or a CMOS sensor that photoelectrically converts a light beam from a subject that has passed through the optical system 101 and converts it into an electrical signal.

A/D変換部103は、入力されたアナログ映像信号をデジタル映像信号に変換する。画像処理部104は、通常の信号処理の他に、本実施形態における階調補正処理を行う。画像処理部104はA/D変換部103から出力された画像のみでなく、記録部110から読み出された画像に対しても同様の画像処理を行うことができる。   The A / D converter 103 converts the input analog video signal into a digital video signal. The image processing unit 104 performs gradation correction processing in the present embodiment in addition to normal signal processing. The image processing unit 104 can perform similar image processing not only on the image output from the A / D conversion unit 103 but also on the image read out from the recording unit 110.

露光量算出部105は、本実施形態の階調補正処理を行うのに適した入力画像を得るために、撮影時の露光量を算出する部分である。画像処理部104の処理結果を入力として露光量を算出し、露光量制御部106に入力する。露光量制御部106は、露光量算出部105によって算出された露光量を実現するために、光学系101と撮像部102に指令を送り、絞り値、シャッタースピード、撮像素子のアナログゲインを制御する。   The exposure amount calculation unit 105 is a part that calculates an exposure amount at the time of shooting in order to obtain an input image suitable for performing the gradation correction processing of the present embodiment. An exposure amount is calculated using the processing result of the image processing unit 104 as an input, and input to the exposure amount control unit 106. In order to realize the exposure amount calculated by the exposure amount calculation unit 105, the exposure amount control unit 106 sends a command to the optical system 101 and the imaging unit 102 to control the aperture value, shutter speed, and analog gain of the imaging element. .

表示部107は、画像処理部104から出力される画像をLCDなどの表示器に逐次表示させることにより、電子ビューファインダ(EVF)として機能する。記録部110は、画像を記録する機能を有し、たとえば、半導体メモリが搭載されたメモリカードや、光磁気ディスク等の回転記録体を収容したパッケージなどを用いた情報記録媒体などを含んでもよい。   The display unit 107 functions as an electronic viewfinder (EVF) by sequentially displaying an image output from the image processing unit 104 on a display device such as an LCD. The recording unit 110 has a function of recording an image, and may include, for example, an information recording medium using a memory card on which a semiconductor memory is mounted, a package containing a rotating recording body such as a magneto-optical disk, or the like. .

図2は、画像処理部104の構成を示すブロック図である。以下、画像処理部104の各ブロックが担う処理について、その流れとともに説明する。まず、画面内の輝度情報に基づいて本撮影前の露出を制御し、階調補正処理を行う上で適切な本撮影時の露光量を算出する露光量算出部105、さらに階調特性算出部204の処理内容について説明する。   FIG. 2 is a block diagram illustrating a configuration of the image processing unit 104. Hereinafter, processing performed by each block of the image processing unit 104 will be described together with the flow thereof. First, an exposure amount calculation unit 105 that controls exposure before actual photographing based on luminance information in the screen and calculates an appropriate exposure amount during main photographing for performing gradation correction processing, and a gradation characteristic calculating unit The processing content of 204 will be described.

図3は、撮影者により撮影の指示がなされたときの本撮影の露光量を決定するまでの処理の流れを示すフローチャートである。   FIG. 3 is a flowchart showing the flow of processing until the exposure amount for the main photographing when the photographing instruction is given by the photographer.

まず、ステップS601では、ライブビュー動作によって露光量算出部105が露光量を算出するための画像を連続的に取得し、所定の間隔(例えば2フレームに1回)で画像全体の輝度値を算出した上で露出を変更する。具体的には、画像を図4に示すように複数のブロック領域に分割し、各ブロックの平均輝度値を求める。そして、各ブロックの平均輝度に対して中央部のブロックに重みを付けるように加重加算して画面全体の輝度値を求める。この加重加算した画面全体の輝度値が適正の値、すなわち予め設定された目標輝度値(例えば10bitで130)に近づくように露光量を定める。   First, in step S601, the exposure amount calculation unit 105 continuously acquires images for calculating the exposure amount by the live view operation, and calculates the luminance value of the entire image at a predetermined interval (for example, once every two frames). And change the exposure. Specifically, the image is divided into a plurality of block areas as shown in FIG. 4, and the average luminance value of each block is obtained. Then, the luminance value of the entire screen is obtained by performing weighted addition so as to weight the central block with respect to the average luminance of each block. The amount of exposure is determined so that the weighted and added luminance value of the entire screen approaches an appropriate value, that is, a preset target luminance value (for example, 130 at 10 bits).

図5は、ステップS601で求められた露光量で露光した場合に得られる画像の一例を示す図である。これは夜景シーンを示す画像であり、建物の内部や点光源などの高輝度領域は白飛びしているのに対し、それ以外の背景領域の大部分は黒潰れしかけて階調が無くなっている。   FIG. 5 is a diagram illustrating an example of an image obtained when exposure is performed with the exposure amount obtained in step S601. This is an image showing a night view scene, while high brightness areas such as the interior of a building and point light sources are whiteout, while most of the other background areas are blacked out and have no gradation. .

ステップS602では、ステップS601で求められた露光量で取得した画像から被写体領域検出部201が高輝度領域であるか低輝度領域であるかの被写体領域の判別を行う。本実施形態では、図4に示したようなブロック領域ごとに輝度の積分値を算出し、それが所定の閾値以上の場合にはそのブロックを高輝度領域、所定の閾値よりも小さい場合にはそのブロックを低輝度領域と判別する。図6は、入力画像に対して領域判別を行った結果の例を示した図である。図中の斜線部分は高輝度領域、黒塗り部分は低輝度領域をそれぞれ示している。   In step S602, the subject area is determined whether the subject area detection unit 201 is a high-luminance area or a low-luminance area from the image acquired with the exposure amount obtained in step S601. In the present embodiment, the integral value of luminance is calculated for each block area as shown in FIG. The block is determined as a low luminance area. FIG. 6 is a diagram illustrating an example of a result of performing region discrimination on an input image. In the figure, the shaded portion indicates the high luminance region, and the black portion indicates the low luminance region.

ステップS603では、露光量算出部105がステップS602で判別した高輝度領域と低輝度領域の分布に基づいて撮影時の本露光量を決定する。図7は露光量の決定方法を示す図であり、グラフの横軸は高輝度領域が画像全体に対して占める割合、グラフの縦軸は適正の露光量に対する露出の変更量を表す値である。具体的には、横軸の割合とは高輝度領域のブロック数を総分割ブロック数で除算して100を乗算した値であり、露出の変更量とは前述した目標輝度値となる適正の露光量からどれだけ露出を変えるかを表す値である。図に示すように、高輝度領域の割合が大きいほど適正露出に対してよりアンダーに制御する。これは夜景において白とびしやすい高輝度な被写体(光源や建物内部など)の階調を失わないようにしつつ、後述するゲイン処理によってノイズ成分が増大しないようにゲイン量を抑制することが目的である。   In step S603, the exposure amount calculation unit 105 determines the main exposure amount at the time of shooting based on the distribution of the high luminance region and the low luminance region determined in step S602. FIG. 7 is a diagram showing a method for determining the exposure amount, in which the horizontal axis of the graph represents the ratio of the high luminance area to the entire image, and the vertical axis of the graph represents the amount of change in exposure with respect to the appropriate exposure amount. . Specifically, the ratio on the horizontal axis is a value obtained by dividing the number of blocks in the high luminance area by the total number of divided blocks and multiplying by 100, and the exposure change amount is an appropriate exposure that achieves the target luminance value described above. It is a value that represents how much the exposure changes from the amount. As shown in the drawing, the underexposure is controlled with respect to the appropriate exposure as the ratio of the high luminance region is larger. The purpose of this is to suppress the amount of gain so that the noise component does not increase by the gain processing described later, while avoiding losing the gradation of a high-luminance subject (such as a light source or the inside of a building) that is easily overexposed in a night scene. is there.

ステップS604では、ステップS603で決定した露光量に基づいて露光量制御部106により本撮影が行われる。以上により、入力画像を取得してから、露光量算出部105で露光量を算出し、本撮影を行うまでの処理の説明は終了となる。   In step S604, the actual exposure is performed by the exposure control unit 106 based on the exposure determined in step S603. Thus, the description of the processing from the acquisition of the input image to the calculation of the exposure amount by the exposure amount calculation unit 105 until the actual photographing is finished.

次に、図8は、図3のステップS604において本撮影された画像に対して行う階調補正処理の流れを示すフローチャートである。   Next, FIG. 8 is a flowchart showing the flow of gradation correction processing performed on the image actually captured in step S604 of FIG.

ステップS701では、ステップS604で本撮影された画像を取得する。ステップS702では、ステップS602と同様にして、入力画像から高輝度領域および低輝度領域を判別する。判別の方法はステップS602と同様であるため説明は省略する。   In step S701, the image captured in step S604 is acquired. In step S702, similarly to step S602, a high luminance region and a low luminance region are determined from the input image. Since the determination method is the same as that in step S602, description thereof is omitted.

ステップS703では、階調特性算出部204が画面全体に一様に適用する階調特性を生成する処理を行う。まずステップS702において検出した高輝度領域および低輝度領域の各々に対して、ゲイン量およびそのゲイン量を適用する輝度範囲を算出する。低輝度領域に対するゲイン量LGは、ステップS603で決定した本撮影時の露出と適正露出との差分に基づいて算出する。図9は低輝度領域に対するゲイン量LGの算出方法を示す図であり、本撮影時の露出が適正露出よりも大きい場合にはゲイン量を1倍以下(すなわちゲインダウン)とし、小さい場合にはゲイン量を1倍以上(すなわちゲインアップ)とする。これは、夜景において暗部を必要以上に明るくして見た目が不自然になることや、ゲインアップによりノイズが目立つようになることを抑制するためである。さらに高輝度領域に対するゲイン量HGは、白とびを抑えるために1倍(すなわち等倍ゲイン)とする。 続いて、算出したゲイン量LG,HGを適用する輝度範囲を各々算出する。図10はそれらの算出方法を示す図である。まず領域別輝度値算出部203は、低輝度領域および高輝度領域の各々のヒストグラムを算出する。図10(a)は低輝度領域の輝度ヒストグラムを示す図であり、横軸が輝度値、縦軸が該当する輝度値の頻度を表す。図10(a)において、まず最小の輝度値から頻度数を累積加算していく。図10(b)は累積加算した値を縦軸にとった図であり、この累積加算値が所定の値(LOW_TH)に到達したときの輝度値を低輝度領域に対するゲイン適用範囲の上限輝度値LPとする。同様にして、高輝度領域の輝度ヒストグラムの頻度数を高輝度側から累積加算していき、所定の値(HI_TH)に到達したときの輝度値を高輝度領域に対するゲイン適用範囲の下限輝度値HPとする。   In step S703, the gradation characteristic calculation unit 204 performs a process of generating gradation characteristics that are uniformly applied to the entire screen. First, a gain amount and a luminance range to which the gain amount is applied are calculated for each of the high luminance region and the low luminance region detected in step S702. The gain LG for the low luminance region is calculated based on the difference between the exposure at the time of actual photographing and the appropriate exposure determined in step S603. FIG. 9 is a diagram illustrating a method of calculating the gain amount LG for the low luminance region. When the exposure at the time of actual photographing is larger than the appropriate exposure, the gain amount is set to 1 time or less (that is, gain down), and when the exposure is small. The gain amount is set to 1 or more (that is, gain up). This is to prevent the dark portion from being brightened more than necessary in the night scene and making it look unnatural and preventing noise from becoming noticeable due to gain increase. Further, the gain amount HG for the high luminance region is set to 1 time (that is, equal gain) in order to suppress overexposure. Subsequently, a luminance range to which the calculated gain amounts LG and HG are applied is calculated. FIG. 10 is a diagram showing the calculation method. First, the region-specific luminance value calculation unit 203 calculates histograms for each of the low luminance region and the high luminance region. FIG. 10A is a diagram showing a luminance histogram of a low luminance region, where the horizontal axis represents the luminance value and the vertical axis represents the frequency of the corresponding luminance value. In FIG. 10A, first, the frequency number is cumulatively added from the minimum luminance value. FIG. 10B is a diagram in which the cumulative addition value is plotted on the vertical axis, and the luminance value when the cumulative addition value reaches a predetermined value (LOW_TH) is the upper limit luminance value of the gain application range for the low luminance region. LP. Similarly, the frequency number of the luminance histogram of the high luminance region is cumulatively added from the high luminance side, and the luminance value when reaching a predetermined value (HI_TH) is the lower limit luminance value HP of the gain application range for the high luminance region. And

これら4つの値LG,HG,LP,HPに基づいて生成される階調特性を図11に示す。図中、横軸は入力輝度、縦軸は出力輝度となっている。直線の傾きはゲイン量を表しており、階調特性をゲイン量GAINを用いて式で示すと、
階調特性: 出力Y=GAIN×入力Y …(1)
となる。点線で示した直線が1倍のゲイン(等倍ゲイン)を示しており、実線LGはゲインダウン、実線HGは等倍ゲインとなる。この階調特性を用いてゲインテーブル生成部205は、輝度別ゲインテーブルすなわち入力輝度に対するゲイン量を表すテーブルを生成する。
FIG. 11 shows the gradation characteristics generated based on these four values LG, HG, LP, HP. In the figure, the horizontal axis represents input luminance, and the vertical axis represents output luminance. The slope of the straight line represents the gain amount, and the gradation characteristic is expressed by an equation using the gain amount GAIN.
Gradation characteristics: Output Y = GAIN × input Y (1)
It becomes. A straight line indicated by a dotted line indicates a 1 × gain (equal gain), a solid line LG is a gain reduction, and a solid line HG is an equal gain. Using this gradation characteristic, the gain table generation unit 205 generates a gain table for each luminance, that is, a table representing a gain amount with respect to input luminance.

ステップS704では、ゲイン画像を生成する処理を行う。図12はステップS704のゲイン画像の生成およびステップS705のゲイン処理を実行するゲイン処理部202の構成を示したブロック図である。以下、図12を用いてステップS704、ステップS705の処理について説明する。   In step S704, a process for generating a gain image is performed. FIG. 12 is a block diagram illustrating the configuration of the gain processing unit 202 that executes the generation of the gain image in step S704 and the gain processing in step S705. Hereinafter, the processing in steps S704 and S705 will be described with reference to FIG.

図12(a)はゲイン処理部202の構成を示しており、図中1201は入力画像、1202はゲイン画像生成部、1203はゲイン乗算部である。さらに、図12(b)はゲイン画像生成部1202の構成を示している。図中、輝度信号生成部1212は入力画像1201から輝度信号を生成する。帯域制限部1213は画像が持つ周波数帯域を制限するために、輝度信号生成部1212が出力する輝度信号に対して所定のLPF(ローパスフィルタ)をかける。これにより、後述するぼかし処理部1214には、輝度信号生成部1212から出力される高周波帯域を含む階層の画像信号が入力され、ぼかし処理部1215には帯域制限部1213を通った低周波帯域のみを残した階層の画像信号が入力される。なお、ここでは帯域制限の手法としてローパスフィルタを用いたが、これに限定されず、縮小や拡大といったリサイズ処理を行うことによって実現してもよい。   FIG. 12A shows the configuration of the gain processing unit 202, in which 1201 is an input image, 1202 is a gain image generation unit, and 1203 is a gain multiplication unit. Further, FIG. 12B shows the configuration of the gain image generation unit 1202. In the figure, a luminance signal generator 1212 generates a luminance signal from an input image 1201. The band limiting unit 1213 applies a predetermined low pass filter (LPF) to the luminance signal output from the luminance signal generating unit 1212 in order to limit the frequency band of the image. As a result, an image signal of a hierarchy including a high frequency band output from the luminance signal generation unit 1212 is input to the blurring processing unit 1214 described later, and only the low frequency band that has passed through the band limiting unit 1213 is input to the blurring processing unit 1215. The image signal of the hierarchy that leaves is input. Although a low-pass filter is used here as a band limiting method, the present invention is not limited to this, and may be realized by performing a resizing process such as reduction or enlargement.

ぼかし処理部1214及び1215では、輝度信号生成部1212からの高周波帯域を含む階層の画像および帯域制限部1213からの低周波帯域のみを残した階層の画像に対し、所定のぼかし処理を実行する。これは、細かいテクスチャに対するゲインの敏感度を下げ、コントラストをより良好に維持することを目的としている。その一方で、たとえば図13に示すような高輝度領域と低輝度領域の境界では、ぼかし処理を行わない方がよい。その理由としては、覆い焼きゲイン処理において、このような境界部でぼかし処理を行うと、境界部付近の領域に所望のゲインがかからずに疑似輪郭の発生が顕著になると考えられるからである。従って、輝度差が大きなエッジを保存したままボカシ処理を行うことが必要である。   The blurring processing units 1214 and 1215 execute predetermined blurring processing on the layer image including the high frequency band from the luminance signal generation unit 1212 and the layer image remaining only from the low frequency band from the band limiting unit 1213. This is intended to reduce gain sensitivity to fine textures and maintain better contrast. On the other hand, for example, it is better not to perform the blurring process at the boundary between the high luminance region and the low luminance region as shown in FIG. The reason for this is that, in the dodging gain process, if the blur process is performed at such a boundary part, it is considered that the generation of a pseudo contour becomes conspicuous without applying a desired gain to the area near the boundary part. . Therefore, it is necessary to perform the blurring process while keeping an edge having a large luminance difference.

輝度→ゲイン変換処理部1216および1217では、ぼかし処理部1214および1215から出力される輝度画像の各々を、ゲインテーブル生成部205で算出した輝度別ゲインテーブル1210を用いて、ゲイン画像へ変換する。ゲイン画像とは、画像において最も左上に位置する画素位置を(0,0)として、撮影された入力画像の画素位置を(x,y)としたとき、入力信号Yin(x,y)から出力されるゲインをGain(x,y)とした画像である。すなわち、以下に示すゲインテーブル関数GainTblを用いたとき、
Gain(x,y)=GainTbl(Yin(x,y)) …(2)
で表わされるゲイン画像におけるGain(x,y)が、撮影された入力画像の(x,y)に位置する画素に対応するゲインである。
The luminance → gain conversion processing units 1216 and 1217 convert each luminance image output from the blur processing units 1214 and 1215 into a gain image using the luminance-specific gain table 1210 calculated by the gain table generation unit 205. The gain image is output from the input signal Yin (x, y), where (0, 0) is the pixel position located in the upper left corner of the image and (x, y) is the pixel position of the captured input image. It is an image which made gain to be Gain (x, y). That is, when the gain table function GainTbl shown below is used,
Gain (x, y) = GainTbl (Yin (x, y)) (2)
Gain (x, y) in the gain image represented by is a gain corresponding to the pixel located at (x, y) of the photographed input image.

画像サイズ調整部1218では、帯域制限部1213が入力画像に対してサイズを変更する処理を行った場合、輝度→ゲイン変換処理部1217の出力画像サイズを入力画像1201と同じとなるように調整する処理を行う。本実施形態では、帯域制限部1213では画像サイズは変更されず、ローパスフィルタがかけられるのみであることからサイズの調整は行わないこととする。   The image size adjustment unit 1218 adjusts the output image size of the luminance → gain conversion processing unit 1217 to be the same as that of the input image 1201 when the band limiting unit 1213 performs a process of changing the size of the input image. Process. In the present embodiment, the band limiter 1213 does not change the image size, and only the low-pass filter is applied, so the size is not adjusted.

ゲイン加算処理部1219では、輝度→ゲイン変換処理部1216および画像サイズ調整部1218の出力ゲイン画像を画素毎に加算する処理を行う。図12(c)は、ゲイン加算処理部1219の構成を示す図である。入力輝度に対して帯域制限を行っていない相対的に高周波帯域を含む階層の画像から生成したゲイン画像と、低周波帯域のみを残した階層の画像から生成したゲイン画像とを加算する。以下、各々を上位階層画像1251、下位階層画像1252と呼び、ゲイン加算処理について詳細に説明する。   The gain addition processing unit 1219 performs processing for adding the output gain images of the luminance → gain conversion processing unit 1216 and the image size adjustment unit 1218 for each pixel. FIG. 12C is a diagram illustrating a configuration of the gain addition processing unit 1219. A gain image generated from an image of a layer including a relatively high frequency band that is not subjected to band limitation on the input luminance and a gain image generated from an image of a layer leaving only the low frequency band are added. Hereinafter, each of these will be referred to as an upper layer image 1251 and a lower layer image 1252, and the gain addition processing will be described in detail.

図13に示すように、上位階層と下位階層のゲインを単純に加算平均するだけでは、輝度差の大きなエッジ部付近で、ゲインテーブルの形によっては疑似輪郭が生じてしまうため、加算処理の方法を工夫する必要がある。   As shown in FIG. 13, simply adding and averaging the gains of the upper layer and the lower layer generates a pseudo contour depending on the shape of the gain table near the edge portion where the luminance difference is large. It is necessary to devise.

図14は、第1の加算処理部1253、第2の加算処理部1254、加重加算部1256を模式的に示した図である。図14に示すように、第1の加算処理部1253では上位階層の着目位置(着目画素)のゲイン(以下、着目ゲインと呼ぶ)に所定の重みW1を掛けて下位階層の着目位置のゲインと加重加算する。ただしこの結果だけでは前述したような疑似輪郭が発生する可能性がある。重みW1の算出方法については後述する。   FIG. 14 is a diagram schematically illustrating the first addition processing unit 1253, the second addition processing unit 1254, and the weighted addition unit 1256. As shown in FIG. 14, the first addition processing unit 1253 multiplies the gain of the target position (target pixel) in the upper hierarchy (hereinafter referred to as the target gain) by a predetermined weight W1 and the gain of the target position in the lower hierarchy. Add weight. However, the pseudo contour as described above may be generated only by this result. A method for calculating the weight W1 will be described later.

次に、第2の加算処理部1254での処理内容について説明する。図14に示すように、第2の加算処理部1254では、上位階層の着目ゲインと下位階層の周辺領域のゲイン(以下、周辺ゲインと呼ぶ)を使用する。ここで周辺領域とは、着目位置から上下左右方向に所定の範囲内にある画素の集合である。第2の加算処理部1254の目的は、前述の疑似輪郭を低減させることである。図15は、図13と同様の考え方で、エッジ部付近に疑似輪郭が生じる場合の上位階層ゲインおよび下位階層ゲインの形状と、第2の加算処理部1254の処理イメージを示した図である。図15に示した例では、輝度差の大きなエッジ部付近で、下位階層ゲインが極端に小さくなる。従って、位置Xでゲインを加算する場合、四角印で示されている着目ゲイン同士を加算すると、疑似輪郭の弊害が大きくなる。従って、下位階層ゲインは着目位置ではなく、位置Xから左右にLの範囲を探索し、上位階層の着目ゲインに最も近い値を持つゲインを選択する方がよい。図の例では、丸印で表された位置X−Lのゲインを使用することで、下位階層の極端に小さなゲインから受ける影響を低減できる。以上の加算処理により、エッジ部付近で極端に異なるゲインを乗じることによる疑似輪郭の発生は抑制される。なお、図15では、説明を分かりやすくするために1次元の例を挙げて説明したが、実際の第2の加算処理部1254においては、同様の処理を2次元で行う。   Next, processing contents in the second addition processing unit 1254 will be described. As shown in FIG. 14, the second addition processing unit 1254 uses a higher-level target gain and a gain in a peripheral area in the lower hierarchy (hereinafter referred to as a peripheral gain). Here, the peripheral region is a set of pixels within a predetermined range in the vertical and horizontal directions from the position of interest. The purpose of the second addition processing unit 1254 is to reduce the aforementioned pseudo contour. FIG. 15 is a diagram showing the shape of the upper layer gain and the lower layer gain when the pseudo contour is generated near the edge portion and the processing image of the second addition processing unit 1254 in the same way as FIG. In the example shown in FIG. 15, the lower layer gain becomes extremely small in the vicinity of the edge portion where the luminance difference is large. Therefore, when gains are added at the position X, if the gains of interest indicated by square marks are added together, the adverse effect of the pseudo contour increases. Therefore, it is better to search for a range of L from the position X to the left and right from the position X, and select a gain having a value closest to the target gain of the upper hierarchy, not the position of interest. In the example of the figure, by using the gain at the position XL indicated by a circle, it is possible to reduce the influence received from an extremely small gain in the lower layer. By the above addition processing, generation of a pseudo contour due to multiplication of extremely different gains in the vicinity of the edge portion is suppressed. In FIG. 15, a one-dimensional example is described for easy understanding, but the actual second addition processing unit 1254 performs the same processing two-dimensionally.

図16は、この第2の加算処理部の処理内容を示すフローチャートである。ステップS1601では、下位階層の周辺ゲインのそれぞれについて、上位階層の着目ゲインとの差分絶対値を算出する。ステップS1602では、ステップS1601で算出した差分絶対値が小さい順に、M個の周辺ゲインを選択する。ここで、Mは所定の個数とする。この処理により、図15に示したように、上位階層の着目ゲインに近いゲイン値を持つ下位階層の周辺ゲインを選択することができる。なお本実施形態では、周辺ゲインを選択する際に差分絶対値が小さい順に所定個数を選択するという手法をとったが、他の手法を用いてもよい。たとえば演算コストを抑制するために、差分絶対値が所定の閾値以下であるものをすべて選択するといった方法を用いてもよい。   FIG. 16 is a flowchart showing the processing contents of the second addition processing unit. In step S1601, for each of the peripheral gains in the lower layer, an absolute difference value from the target gain in the upper layer is calculated. In step S1602, M peripheral gains are selected in ascending order of the absolute difference value calculated in step S1601. Here, M is a predetermined number. By this processing, as shown in FIG. 15, it is possible to select the lower-layer peripheral gain having a gain value close to the target gain of the upper layer. In the present embodiment, when the peripheral gain is selected, a predetermined number is selected in ascending order of the absolute difference value. However, another method may be used. For example, in order to suppress the calculation cost, a method may be used in which all those whose difference absolute values are equal to or less than a predetermined threshold value are selected.

ステップS1603では、ステップS1602で選択したM個の周辺ゲインを加重加算する。ここで、加重加算時の重みは以下の式(1)で決定される。   In step S1603, the M peripheral gains selected in step S1602 are weighted and added. Here, the weight at the time of weighted addition is determined by the following equation (1).

W(k)=A/|GL(k)−GH| …(3)
式(1)において、GL(k)は、選択した下位階層の周辺ゲインのうち、k番目のゲインを表し、W(k)はそれに対応する加重加算の重みを表す。また、GHは上位階層の着目ゲインを表し、Aは所定の定数である。式(1)から分かるように、重みW(k)は、上位階層の着目ゲインとの差分が小さいほど大きくなる。
W (k) = A / | GL (k) −GH | (3)
In Expression (1), GL (k) represents the k-th gain among the peripheral gains of the selected lower layer, and W (k) represents the weight of weighted addition corresponding thereto. GH represents the gain of interest in the upper layer, and A is a predetermined constant. As can be seen from equation (1), the weight W (k) increases as the difference from the target gain in the upper layer is smaller.

さらに、式(1)により各周辺ゲインに対する重みW(k)を算出後、以下の式(4)により加重加算を行う。   Further, after calculating the weight W (k) for each peripheral gain by the equation (1), the weighted addition is performed by the following equation (4).

…(4)
式(2)において、GL’は、加重加算後の下位階層ゲインである。
... (4)
In Expression (2), GL ′ is a lower layer gain after weighted addition.

ステップS1604では、加重加算して得られた下位階層の周辺ゲインGL’と、上位階層の着目ゲインGHに所定の重みW2を掛けたものを加重加算し、加算されたゲイン値が第2の加算処理部1254の出力となる。   In step S1604, the lower layer peripheral gain GL ′ obtained by weighted addition and the higher layer target gain GH multiplied by the predetermined weight W2 are weighted and the added gain value is the second addition. This is an output of the processing unit 1254.

ここで、前述した第1の加算処理部1253において用いる重みW1および第2の加算処理部1254において用いる重みW2の算出方法について説明する。図17は入力輝度が飽和している領域と、それに対する上位階層および下位階層のゲイン信号を示す図である。図17を見ると、上位階層では低輝度部に対してゲインダウン、高輝度部に対しては等倍ゲインとなっており、それに対して下位階層では低輝度部だけでなく高輝度領域の一部もゲインダウンとなっていることがわかる。これは、下位階層は帯域制限によって輝度に対する敏感度が下がったゲインとなっているためである。これによって飽和部周辺の高輝度がゲインダウンされることとなり、結果的にRGBのバランスが所望の値とならない弊害が発生する。   Here, a calculation method of the weight W1 used in the first addition processing unit 1253 and the weight W2 used in the second addition processing unit 1254 will be described. FIG. 17 is a diagram showing a region where the input luminance is saturated and the gain signals of the upper and lower layers corresponding thereto. Referring to FIG. 17, the upper layer has a gain reduction for the low luminance part, and the high luminance part has the same gain, whereas the lower layer has not only the low luminance part but also the high luminance region. It can be seen that the gain is also reduced. This is because the lower layer has a gain that is less sensitive to luminance due to band limitation. As a result, the high luminance around the saturated portion is reduced in gain, resulting in a problem that the balance of RGB does not become a desired value.

そこで本実施形態では、上記の2つの重みW1,W2をいくつかの評価値に基づいて決定することにより、上述した弊害を抑制することを考える。具体的には、露光量算出部105が撮影前に算出したBv(ブライトバリュー)値が大きいほど、そして高輝度領域の面積割合が大きいほど上位階層にかかる重みW1およびW2の値を大きくするように制御する。これは、撮影時のBv値が小さいほど夜景シーンである可能性が高く、また高輝度領域の面積が小さいほどゲインダウンとなる階調特性になりやすいため、前述したような飽和部付近のゲインダウンが発生しないように下位階層の重みを小さくすることが目的である。   Therefore, in the present embodiment, it is considered that the above-described adverse effects are suppressed by determining the two weights W1 and W2 based on several evaluation values. Specifically, the values of the weights W1 and W2 applied to the upper layer are increased as the Bv (bright value) value calculated by the exposure amount calculation unit 105 before photographing is increased and as the area ratio of the high luminance region is increased. To control. This is because the smaller the Bv value at the time of shooting, the higher the possibility that the scene is a night scene, and the smaller the area of the high luminance region, the more likely the tone characteristics are to reduce the gain. The purpose is to reduce the weight of the lower layer so that the down does not occur.

加重加算部1256は、第1の加算処理部1253の結果と第2の加算処理部1254の結果を加重加算し、その時の重みは、着目位置における上位階層と下位階層のゲイン差に基づき、輝度→重み算出部1255によって決定する。具体的には、上位階層と下位階層の着目ゲインの差分値が大きいほど、第2の加算処理部1254の結果を重視するような設定とする。これは、輝度差が大きくゲイン差も大きくなるようなエッジ部付近は、第2の加算処理部1254の結果を用いて疑似輪郭を抑制するのが望ましいからである。一方、ゲイン差が小さいテクスチャ部分では、第2の加算処理部1254の結果を用いると、画像のコントラストが低下してしまう。ゲイン差が小さければ疑似輪郭が顕在化しなくなることから、第1の加算処理部1253の結果を用いてコントラストの低下を抑制するのが望ましいと考えられる。   The weighted addition unit 1256 performs weighted addition of the result of the first addition processing unit 1253 and the result of the second addition processing unit 1254, and the weight at that time is based on the gain difference between the upper layer and the lower layer at the position of interest. → Determined by the weight calculation unit 1255. Specifically, the setting is made such that the result of the second addition processing unit 1254 is emphasized as the difference value between the target gains of the upper layer and the lower layer is larger. This is because it is desirable to suppress the pseudo contour using the result of the second addition processing unit 1254 in the vicinity of the edge portion where the luminance difference is large and the gain difference is large. On the other hand, in the texture portion where the gain difference is small, if the result of the second addition processing unit 1254 is used, the contrast of the image is lowered. If the gain difference is small, the pseudo contour does not appear, so it is desirable to suppress the decrease in contrast using the result of the first addition processing unit 1253.

以上で、図8のステップS704におけるゲイン加算処理部1219およびゲイン画像生成部1202の説明を終了する。これにより、出力ゲイン画像1221が得られることになる。   Above, description of the gain addition process part 1219 and the gain image generation part 1202 in step S704 of FIG. 8 is complete | finished. As a result, an output gain image 1221 is obtained.

図8の説明に戻り、ステップS705では、ゲイン画像生成部1202で生成されたゲイン画像を、ゲイン乗算部1203において、所定の信号処理が施された元画像に乗じる。ゲイン乗算部1203の出力は、階調圧縮処理部206において、ガンマ変換処理などにより所定の出力レンジに階調圧縮される。最後に、階調圧縮処理部206において階調圧縮を施された画像が表示部107および記録部110に出力される。   Returning to the description of FIG. 8, in step S705, the gain image generated by the gain image generation unit 1202 is multiplied by the original image subjected to predetermined signal processing by the gain multiplication unit 1203. The output of the gain multiplication unit 1203 is tone-compressed to a predetermined output range by a tone compression processing unit 206 by gamma conversion processing or the like. Finally, the image subjected to the gradation compression in the gradation compression processing unit 206 is output to the display unit 107 and the recording unit 110.

以上説明したように本実施形態によれば、局所的に階調特性を制御する処理において、低周波画像を使用することによる疑似輪郭や、主に夜景シーンにおいて発生しやすい飽和部の色バランスのずれといった弊害を抑制することができる。また、着目位置のゲイン差に基づいて、(1)コントラスト維持を優先する第1の加算結果と(2)疑似階調の抑制を優先する第2の加算結果のそれぞれを加重加算することで、コントラストの低下を抑制しつつ、疑似階調の抑制を行うことができる。   As described above, according to the present embodiment, in the process of locally controlling the gradation characteristics, the pseudo contour due to the use of a low-frequency image and the color balance of the saturated portion that is likely to occur mainly in night scenes. Detrimental effects such as deviation can be suppressed. Further, based on the gain difference of the position of interest, (1) weighted addition of each of the first addition result prioritizing contrast maintenance and (2) the second addition result prioritizing suppression of pseudo gradation, It is possible to suppress the pseudo gradation while suppressing the decrease in contrast.

本実施形態では、ゲイン加算処理の際に入力画像から2種類の周波数帯域を持つ上位階層の画像と下位階層の画像を生成したが、これに限らず、3以上の異なる周波数帯域を持つ画像を生成し、順次加算処理を行うようにしてもよい。   In the present embodiment, the upper layer image and the lower layer image having two types of frequency bands are generated from the input image during the gain addition process. However, the present invention is not limited to this, and images having three or more different frequency bands are generated. They may be generated and sequentially added.

(第2の実施形態)
次に、本発明の第2の実施形態について説明する。図18は、第2の実施形態における画像処理装置の動作を示すフローチャートである。本実施形態では、近接した被写体にフォーカスを合わせて遠くの被写体領域が大きくぼけるようなシーンでの例について説明する。なお、第1の実施形態と同様の処理や公知の技術を用いる処理については説明を省略し、本実施形態の特徴的な処理について主に説明する。図18(a) は、撮影者により撮影の指示がなされた場合の本撮影の露光量を決定するまでの処理の流れを示すフローチャートである。
(Second Embodiment)
Next, a second embodiment of the present invention will be described. FIG. 18 is a flowchart illustrating the operation of the image processing apparatus according to the second embodiment. In the present embodiment, an example in a scene where a distant subject area is greatly blurred by focusing on a close subject will be described. Note that a description of processes similar to those in the first embodiment and processes using known techniques is omitted, and the characteristic processes of the present embodiment are mainly described. FIG. 18A is a flowchart showing a flow of processing up to determining the exposure amount of the main photographing when the photographing instruction is given by the photographer.

まず、ステップS1801では、図3のステップS601と同様にして露光量を算出するための画像を連続的に取得する。ステップS1802〜ステップS1803では、領域別トーンマッピングの思想を取り入れることにより被写体領域を判別し、露光量を決定する。すなわち、輝度・色相・彩度などの特徴量を用いて入力画像を空領域、背景領域に分割し、各領域の持つ代表輝度値および輝度値の段差に基づいて本露光量を決定する。ステップS1804では、S1803で決定した露光量に基づいて露光量制御部106により本撮影が行われる。   First, in step S1801, images for calculating an exposure amount are continuously acquired as in step S601 in FIG. In steps S1802 to S1803, the subject area is determined by incorporating the concept of area-specific tone mapping, and the exposure amount is determined. That is, the input image is divided into a sky region and a background region using feature amounts such as luminance, hue, and saturation, and the main exposure amount is determined based on the representative luminance value and the luminance value step of each region. In step S1804, actual exposure is performed by the exposure control unit 106 based on the exposure determined in step S1803.

続いて、図18(b)は、本撮影された画像に対して行う階調補正処理の流れを示すフローチャートである。ステップS1811では、ステップS1804で本撮影された画像を取得する。ステップS1812〜ステップS1813では、前述した領域別トーンマッピングの思想を取り入れることで、階調特性算出部204が被写体の明るさを考慮した階調特性を生成する。すなわち、領域別輝度値算出部203が算出した空領域および背景領域の輝度情報に基づいて、それぞれの明るさとそのバランスが適切となるような階調を生成する。   Next, FIG. 18B is a flowchart showing the flow of gradation correction processing performed on the actually captured image. In step S1811, the image actually captured in step S1804 is acquired. In steps S1812 to S1813, the tone characteristic calculation unit 204 generates the tone characteristics in consideration of the brightness of the subject by incorporating the above-described tone mapping by area. That is, based on the brightness information of the sky area and the background area calculated by the area-specific brightness value calculation unit 203, a gradation is generated so that each brightness and its balance are appropriate.

ステップS1814では、ゲイン画像を生成する処理を行う。以下、図12を用いてステップS1814の処理について説明する。まずゲイン画像生成部1202において、ゲイン加算処理部1219以外の部分が行う処理については第1の実施形態と同様であるため、説明を省略する。ゲイン加算処理部1219には帯域の異なる2つのゲイン画像、すなわち上位階層画像1251および下位階層画像1252が入力される。第1の加算処理部1253は、上位階層の着目ゲインに所定の重みW1を掛けたうえで、下位階層の着目ゲインと加重加算する。重みW1の算出方法については後述する。   In step S1814, a process for generating a gain image is performed. Hereinafter, the process of step S1814 will be described with reference to FIG. First, in the gain image generation unit 1202, processing performed by parts other than the gain addition processing unit 1219 is the same as that in the first embodiment, and thus description thereof is omitted. Two gain images having different bands, that is, an upper layer image 1251 and a lower layer image 1252 are input to the gain addition processing unit 1219. The first addition processing unit 1253 multiplies the target gain of the upper layer by a predetermined weight W1, and then performs weighted addition with the target gain of the lower layer. A method for calculating the weight W1 will be described later.

図18(c)は、第2の加重加算部が行う処理の流れを示すフローチャートである。図中ステップS1821〜S1824はそれぞれ第1の実施形態で説明した図16のステップS1601〜S1604と同様であるため、説明を省略する。ステップS1824では、加重加算した下位階層の周辺ゲインGL’と、上位階層の着目ゲインGHに所定の重みW2を掛けたものとを加重加算し、加算されたゲイン値が第2の加算処理部1254の出力となる。   FIG. 18C is a flowchart showing the flow of processing performed by the second weighted addition unit. Steps S1821 to S1824 in the figure are the same as steps S1601 to S1604 of FIG. 16 described in the first embodiment, and thus description thereof is omitted. In step S1824, the weighted addition of the lower layer peripheral gain GL ′ and the higher layer of interest gain GH multiplied by the predetermined weight W2 are weighted and the added gain value is the second addition processing unit 1254. Output.

ここで、前述した第1の加算処理部1253において用いる重みW1および第2の加算処理部1254において用いる重みW2の算出方法について説明する。図19は、入力輝度において高輝度部と低輝度部の境界がぼけている背景領域の一部と、それに対する上位階層および下位階層のゲイン信号を示す図である。これを見ると、境界部のぼけている領域のゲイン値が、下位階層では滑らかに変化しているのに対して上位階層では所定の輝度値を境目にゲイン値が急峻に切り替わっているのがわかる。これは、ステップS1813で生成した階調特性において所定の輝度値を境界にゲインの値が急峻に変化することによるものである。この境界部分に対しては、上位階層のゲインが適用されるほど、ゲイン適用後の画像に不自然な輝度の切り替わりが弊害として発生する。   Here, a calculation method of the weight W1 used in the first addition processing unit 1253 and the weight W2 used in the second addition processing unit 1254 will be described. FIG. 19 is a diagram illustrating a part of the background area where the boundary between the high luminance part and the low luminance part is blurred in the input luminance, and the upper layer and lower layer gain signals corresponding thereto. As can be seen, the gain value in the blurred area of the boundary changes smoothly in the lower layer, whereas the gain value changes sharply at the boundary of the predetermined luminance value in the upper layer. Recognize. This is because the gain value changes sharply with a predetermined luminance value as a boundary in the gradation characteristics generated in step S1813. As the higher-layer gain is applied to this boundary portion, an unnatural brightness switch occurs in the image after gain application.

そこで本実施形態では、2つの重みW1,W2をいくつかの評価値に基づいて決定することにより、上述した弊害を抑制することを考える。具体的には、本撮影時に露光量制御部106が設定した絞り値が小さいほど、そしてフォーカス時の焦点距離が近いほど上位階層の重みW1,W2を小さくするように制御する。これは、絞りが開放値に近いほど、そして焦点距離が近いほどフォーカス距離以外の領域がぼけやすく、前述したような弊害が発生しやすいため、ゲインが滑らかに変化する下位階層の重みを大きくすることで弊害の発生を抑えることが目的である。   Therefore, in the present embodiment, it is considered to suppress the above-described adverse effects by determining the two weights W1 and W2 based on several evaluation values. Specifically, control is performed such that the lower layer weights W1 and W2 are decreased as the aperture value set by the exposure amount control unit 106 during actual photographing is smaller and as the focal length during focusing is shorter. This is because the closer the aperture is to the open value and the shorter the focal distance, the more easily the area other than the focus distance is blurred, and the above-mentioned adverse effects are likely to occur, so the weight of the lower layer where the gain changes smoothly is increased. The purpose is to suppress the occurrence of harmful effects.

以上で、ステップS1814におけるゲイン加算処理部1219およびゲイン画像生成部1202の動作の説明を終了する。これにより、出力ゲイン画像が得られる。   Above, description of operation | movement of the gain addition process part 1219 and the gain image generation part 1202 in step S1814 is complete | finished. Thereby, an output gain image is obtained.

図18(b)の説明に戻り、ステップS1815では、ゲイン画像生成部1202で生成されたゲイン画像を、ゲイン乗算部1203において、所定の信号処理が施された元画像に乗じる。ゲイン乗算部1203の出力は、階調圧縮処理部206において、ガンマ変換処理などにより所定の出力レンジに階調圧縮される。最後に、階調圧縮処理部206において階調圧縮を施された画像が画像表示部107および画像記録部110に出力される。   Returning to the description of FIG. 18B, in step S1815, the gain image generated by the gain image generation unit 1202 is multiplied by the original image subjected to the predetermined signal processing in the gain multiplication unit 1203. The output of the gain multiplication unit 1203 is tone-compressed to a predetermined output range by a tone compression processing unit 206 by gamma conversion processing or the like. Finally, the image subjected to the gradation compression in the gradation compression processing unit 206 is output to the image display unit 107 and the image recording unit 110.

以上説明したように、本実施形態によれば、局所的に階調特性を制御する処理において、主に近接撮影において発生しやすいぼけた輝度境界部の不自然な切り替わりといった弊害を抑制することができる。   As described above, according to the present embodiment, it is possible to suppress adverse effects such as unnatural switching of a blurred luminance boundary portion, which is likely to occur mainly in close-up photography, in processing for locally controlling gradation characteristics. it can.

以上、本発明の好ましい実施形態について説明したが、本発明はこれらの実施形態に限定されず、その要旨の範囲内で種々の変形及び変更が可能である。   As mentioned above, although preferable embodiment of this invention was described, this invention is not limited to these embodiment, A various deformation | transformation and change are possible within the range of the summary.

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

101:光学系、102:撮像部、103:A/D変換部、104:画像処理部、105:露光量算出部、106:露光量制御部、107:表示部、110:記録部 101: Optical system, 102: Imaging unit, 103: A / D conversion unit, 104: Image processing unit, 105: Exposure amount calculation unit, 106: Exposure amount control unit, 107: Display unit, 110: Recording unit

Claims (12)

入力された画像を複数の領域に分割する分割手段と、
前記分割手段により分割された前記複数の領域のそれぞれの輝度情報に基づいて、前記画像に階調補正を行うための階調特性を決定する決定手段と、
前記入力された画像から周波数帯域の異なる複数の画像を生成する生成手段と、
生成された前記周波数帯域の異なる複数の画像の信号を前記階調特性に基づいてゲインに変換する変換手段と、
ゲインに変換された前記周波数帯域の異なる複数の画像の信号を重み付けして加算する加算手段と、
前記画像に前記加算手段により加算されたゲインを乗じることにより前記画像を補正する補正手段と、を備え、
前記加算手段は、前記入力された画像が撮影された時の撮影条件および前記複数の領域の情報の少なくともいずれかに基づいて、前記周波数帯域の異なる複数の画像の信号の重み付けを決定することを特徴とする画像処理装置。
Dividing means for dividing the input image into a plurality of regions;
Determining means for determining gradation characteristics for performing gradation correction on the image based on luminance information of each of the plurality of regions divided by the dividing means;
Generating means for generating a plurality of images having different frequency bands from the input image;
Conversion means for converting the generated signals of the plurality of images having different frequency bands into gains based on the gradation characteristics;
Adding means for weighting and adding signals of a plurality of images having different frequency bands converted into gain;
Correction means for correcting the image by multiplying the image by the gain added by the addition means,
The adding means determines weights of signals of a plurality of images having different frequency bands based on at least one of imaging conditions when the input image is captured and information on the plurality of regions. A featured image processing apparatus.
前記画像を撮像するための撮像手段をさらに備えることを特徴とする請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, further comprising an imaging unit configured to capture the image. 前記撮影条件は、撮影時のBv値、絞り値、焦点距離の少なくとも一つであることを特徴とする請求項2に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the photographing condition is at least one of a Bv value, an aperture value, and a focal length at the time of photographing. 前記決定手段は、前記撮影条件に基づいて前記階調特性を変更することを特徴とする請求項2または3に記載の画像処理装置。   The image processing apparatus according to claim 2, wherein the determination unit changes the gradation characteristic based on the photographing condition. 前記生成手段は、相対的に高い周波数帯域を含む上位階層の画像と、該上位階層の画像に比べて低い周波数帯域を含む下位階層の画像の少なくとも2つの画像を生成することを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。   The generation unit generates at least two images: an upper layer image including a relatively high frequency band and a lower layer image including a lower frequency band than the upper layer image. Item 5. The image processing apparatus according to any one of Items 1 to 4. 前記加算手段は、前記上位階層の画像と前記下位階層の画像のそれぞれの着目画素に対応する着目ゲイン同士の加算結果である第1の加算結果と、前記上位階層の着目ゲインと前記下位階層における前記着目画素から所定の範囲の周辺領域において、前記上位階層の着目ゲインと近い値を持つ前記下位階層のゲインの加算結果である第2の加算結果とを重み付けして加算することを特徴とする請求項5に記載の画像処理装置。   The adding means includes a first addition result that is a result of adding the target gains corresponding to the target pixels of the upper layer image and the lower layer image, and the upper layer target gain and the lower layer. In a peripheral region within a predetermined range from the target pixel, the second addition result that is the addition result of the lower layer gain having a value close to the upper layer target gain is weighted and added. The image processing apparatus according to claim 5. 前記複数の領域の情報は、前記入力された画像における高輝度領域の占める割合または低輝度領域の占める割合であることを特徴とする請求項1乃至5のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the information on the plurality of areas is a ratio of a high luminance area or a low luminance area in the input image. . 前記生成手段は、前記画像にフィルタをかけることにより、前記周波数帯域の異なる複数の画像を生成することを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the generation unit generates a plurality of images having different frequency bands by filtering the image. 前記生成手段は、前記画像にリサイズ処理を施すことにより、前記周波数帯域の異なる複数の画像を生成することを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the generation unit generates a plurality of images having different frequency bands by performing a resizing process on the image. 入力された画像を複数の領域に分割する分割工程と、
前記分割工程において分割された前記複数の領域のそれぞれの輝度情報に基づいて、前記画像に階調補正を行うための階調特性を決定する決定工程と、
前記入力された画像から周波数帯域の異なる複数の画像を生成する生成工程と、
生成された前記周波数帯域の異なる複数の画像の信号を前記階調特性に基づいてゲインに変換する変換工程と、
ゲインに変換された前記周波数帯域の異なる複数の画像の信号を重み付けして加算する加算工程と、
前記画像に前記加算工程において加算されたゲインを乗じることにより前記画像を補正する補正工程と、を備え、
前記加算工程では、前記入力された画像が撮影された時の撮影条件および前記複数の領域の情報の少なくともいずれかに基づいて、前記周波数帯域の異なる複数の画像の信号の重み付けを決定することを特徴とする画像処理方法。
A division step of dividing the input image into a plurality of regions;
A determination step of determining gradation characteristics for performing gradation correction on the image based on luminance information of each of the plurality of regions divided in the division step;
Generating a plurality of images having different frequency bands from the input image; and
A conversion step of converting the generated signals of the plurality of images having different frequency bands into gains based on the gradation characteristics;
An adding step of weighting and adding signals of a plurality of images having different frequency bands converted into gains;
A correction step of correcting the image by multiplying the image by the gain added in the addition step,
In the adding step, the weighting of the signals of the plurality of images having different frequency bands is determined based on at least one of photographing conditions when the input image is photographed and information on the plurality of regions. A featured image processing method.
請求項10に記載の画像処理方法の各工程をコンピュータに実行させるためのプログラム。   The program for making a computer perform each process of the image processing method of Claim 10. 請求項10に記載の画像処理方法の各工程をコンピュータに実行させるためのプログラムを記憶したコンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute each step of the image processing method according to claim 10.
JP2015192219A 2015-09-29 2015-09-29 Image processing device and method thereof, program, and storage medium Pending JP2017068513A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015192219A JP2017068513A (en) 2015-09-29 2015-09-29 Image processing device and method thereof, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015192219A JP2017068513A (en) 2015-09-29 2015-09-29 Image processing device and method thereof, program, and storage medium

Publications (1)

Publication Number Publication Date
JP2017068513A true JP2017068513A (en) 2017-04-06

Family

ID=58492519

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015192219A Pending JP2017068513A (en) 2015-09-29 2015-09-29 Image processing device and method thereof, program, and storage medium

Country Status (1)

Country Link
JP (1) JP2017068513A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018181070A (en) * 2017-04-17 2018-11-15 キヤノン株式会社 Image processing device and image processing method
US11363193B2 (en) 2017-11-03 2022-06-14 Samsung Electronics Co., Ltd. Electronic apparatus and image correction method thereof
JP7634943B2 (en) 2020-04-10 2025-02-25 キヤノン株式会社 Image processing device, image processing method, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018181070A (en) * 2017-04-17 2018-11-15 キヤノン株式会社 Image processing device and image processing method
US11363193B2 (en) 2017-11-03 2022-06-14 Samsung Electronics Co., Ltd. Electronic apparatus and image correction method thereof
JP7634943B2 (en) 2020-04-10 2025-02-25 キヤノン株式会社 Image processing device, image processing method, and program

Similar Documents

Publication Publication Date Title
JP5713752B2 (en) Image processing apparatus and control method thereof
CN101800857B (en) Image capturing apparatus and control method thereof
JP5408053B2 (en) Image processing apparatus and image processing method
JP5412553B2 (en) Visual processing device and visual processing method
JP6824817B2 (en) Image processing device and image processing method
JP5672796B2 (en) Image processing apparatus and image processing method
JP6312487B2 (en) Image processing apparatus, control method therefor, and program
JP2010193098A (en) Image sensing apparatus, and image processing method
JP2014153959A (en) Image processing device, image processing method, program, and storage medium
JP4999871B2 (en) Imaging apparatus and control method thereof
JP2019029833A (en) Imaging apparatus
WO2019124289A1 (en) Device, control method, and storage medium
JP2015144475A (en) Imaging apparatus, control method of the same, program and storage medium
US20140267885A1 (en) Image capturing apparatus and method of controlling the same
JP2017068513A (en) Image processing device and method thereof, program, and storage medium
JP7077100B2 (en) Imaging device and its control method, and program
JP2012109849A (en) Imaging device
JP6786273B2 (en) Image processing equipment, image processing methods, and programs
JP2010183460A (en) Image capturing apparatus and method of controlling the same
JP5335964B2 (en) Imaging apparatus and control method thereof
JP2018181070A (en) Image processing device and image processing method
JP2015080157A (en) Image processing device, image processing method and program
JP6157274B2 (en) Imaging apparatus, information processing method, and program
JP2010183461A (en) Image capturing apparatus and method of controlling the same
JP6554009B2 (en) IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, PROGRAM, AND RECORDING MEDIUM

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180921

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190826

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190902

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20200306