JP6397261B2 - Image processing apparatus and method - Google Patents

Image processing apparatus and method Download PDF

Info

Publication number
JP6397261B2
JP6397261B2 JP2014163929A JP2014163929A JP6397261B2 JP 6397261 B2 JP6397261 B2 JP 6397261B2 JP 2014163929 A JP2014163929 A JP 2014163929A JP 2014163929 A JP2014163929 A JP 2014163929A JP 6397261 B2 JP6397261 B2 JP 6397261B2
Authority
JP
Japan
Prior art keywords
luminance
area
gain
subject
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2014163929A
Other languages
Japanese (ja)
Other versions
JP2016039614A5 (en
JP2016039614A (en
Inventor
彰太 山口
彰太 山口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2014163929A priority Critical patent/JP6397261B2/en
Publication of JP2016039614A publication Critical patent/JP2016039614A/en
Publication of JP2016039614A5 publication Critical patent/JP2016039614A5/ja
Application granted granted Critical
Publication of JP6397261B2 publication Critical patent/JP6397261B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、画像処理装置及び方法に関し、階調特性を制御する画像処理装置及び方法に関する。   The present invention relates to an image processing apparatus and method, and more particularly to an image processing apparatus and method for controlling gradation characteristics.

従来より、入力画像に対し、入力輝度に応じて局所的に異なるゲインをかけることで、階調特性を制御するデジタル覆い焼き処理が提案されている。この覆い焼き処理は、例えば、撮影する主要被写体の明るさが背景の明るさと比較して著しく暗いような、いわゆる逆光シーンにおいて適用することができる。逆光シーンでは、画像全体の明るさを適切にするように制御すると、一般的には主要被写体が暗く撮影される。従って、覆い焼き処理により、暗部に比較的大きなゲインがかかるように設定した輝度別ゲインを用いることによって、暗く撮影された主要被写体が適切な明るさとなるように制御する。   Conventionally, there has been proposed a digital dodging process for controlling gradation characteristics by applying a locally different gain to an input image according to input luminance. This dodging process can be applied, for example, in a so-called backlight scene where the brightness of the main subject to be photographed is significantly darker than the brightness of the background. In a backlight scene, if the brightness of the entire image is controlled appropriately, the main subject is generally photographed dark. Therefore, by using the brightness-specific gain set so that a relatively large gain is applied to the dark part by the dodging process, the main subject photographed dark is controlled to have an appropriate brightness.

特許文献1では、入力画像を複数の区域に区分し、区域毎に階調変換特性を求めて処理を行うと共に、区分した区域の中から主となる領域を選出し、選出した主となる区域に関しては、階調変換特性を算出する際に高精度の処理を行うことが開示されている。   In Patent Document 1, an input image is divided into a plurality of areas, and gradation conversion characteristics are obtained for each area, processing is performed, a main area is selected from the divided areas, and the selected main area is selected. With respect to the above, it is disclosed that high-precision processing is performed when the gradation conversion characteristics are calculated.

特開2006−295582号公報JP 2006-295582 A

しかしながら、特許文献1に記載された技術では、各区域においては適切な階調処理を行うことができるが、区域間の関係が考慮されておらず、全体として見た場合に不自然な印象の画像が生成される懸念がある。   However, with the technique described in Patent Document 1, appropriate gradation processing can be performed in each area, but the relationship between the areas is not taken into consideration, and an unnatural impression appears when viewed as a whole. There is concern that an image will be generated.

本発明は上記問題点を鑑みてなされたものであり、階調補正を行う際に、不自然な画像となることを抑制することを目的とする。   The present invention has been made in view of the above-described problems, and an object thereof is to suppress an unnatural image when performing gradation correction.

上記目的を達成するために、本発明の画像処理装置は、入力した画像を、予め決められた条件に従って複数の被写体領域に分割する分割手段と、前記分割した各被写体領域の輝度の分布に基づいて、前記画像の輝度を複数の輝度領域に分割し、前記複数の被写体領域のうち、前記分割した各輝度領域に対応する1つの被写体領域の代表輝度値に基づいて、前記輝度領域ごとに第1のゲインを算出する算出手段と、前記複数の被写体領域のうち、前記輝度領域ごとに、対応する前記1つの被写体領域の輝度の分布と、当該輝度領域以外の少なくとも1つの輝度領域に対応する少なくとも1つの別の被写体領域の輝度の分布とに基づいて、前記第1のゲインを補正して、前記輝度領域ごとに第2のゲインを求める補正手段と、前記第2のゲインを用いて、前記画像の輝度を変換する変換手段とを有する。 In order to achieve the above object, an image processing apparatus according to the present invention is based on a dividing unit that divides an input image into a plurality of subject areas according to a predetermined condition, and a luminance distribution of each of the divided subject areas. Then, the luminance of the image is divided into a plurality of luminance areas, and each of the luminance areas is determined based on a representative luminance value of one subject area corresponding to each of the divided luminance areas. calculating means for calculating a first gain, among the plurality of object regions, each front Kiteru level area, the distribution of the luminance of the corresponding one of the subject region, at least one luminance area other than the luminance area Correction means for correcting the first gain based on the corresponding luminance distribution of at least one other subject area to obtain a second gain for each of the luminance areas; and There are, and a converting means for converting the luminance of the image.

本発明によれば、階調補正を行う際に、不自然な画像となることを抑制することができる。   According to the present invention, it is possible to suppress an unnatural image when performing gradation correction.

本発明の実施形態における画像処理装置の構成を示すブロック図。1 is a block diagram illustrating a configuration of an image processing apparatus according to an embodiment of the present invention. 逆光シーンの一例を示す図。The figure which shows an example of a backlight scene. 本実施形態における領域毎情報取得部による情報取得処理を示すフローチャート。The flowchart which shows the information acquisition process by the information acquisition part for every area | region in this embodiment. 本実施形態における領域判定処理を説明するための図。The figure for demonstrating the area | region determination process in this embodiment. 本実施形態における各被写体領域の輝度ヒストグラムの一例を示す図。The figure which shows an example of the brightness | luminance histogram of each to-be-photographed object area | region in this embodiment. 本実施形態における階調変換特性生成部による階調変換特性の生成処理を示すフローチャート。5 is a flowchart showing a tone conversion characteristic generation process by a tone conversion characteristic generation unit according to the present embodiment. 本実施形態における輝度の区間分割の概念を示す図。The figure which shows the concept of the area division of the brightness | luminance in this embodiment. 本実施形態における輝度の境界の算出方法を示す図。The figure which shows the calculation method of the boundary of the brightness | luminance in this embodiment. 本実施形態におけるGAIN_HUMAN、GAIN_BACK、GAIN_SKYの算出手順を示す図。The figure which shows the calculation procedure of GAIN_HUMAN, GAIN_BACK, and GAIN_SKY in this embodiment. 本実施形態におけるゲイン量調整処理を示すフローチャート。The flowchart which shows the gain amount adjustment process in this embodiment. 本実施形態における人物領域及び背景領域の出力Bv値の差Bv_HUMAN_OUT−Bv_BACK_OUTとゲイン調整係数の最小値k_low_minとの関係を示す図。The figure which shows the relationship between the difference Bv_HUMAN_OUT-Bv_BACK_OUT of the output Bv value of a person area | region and a background area | region in this embodiment, and the minimum value k_low_min of a gain adjustment coefficient. 本実施形態における背景領域の輝度ヒストグラムにおける低輝度領域と高輝度領域を示す図。The figure which shows the low-intensity area | region and high-intensity area | region in the luminance histogram of the background area | region in this embodiment. 本実施形態における低輝度画素率RATIO_LOWとゲイン調整量k_lowとの関係を示す図。The figure which shows the relationship between the low-intensity pixel rate RATIO_LOW and the gain adjustment amount k_low in this embodiment. 本実施形態における背景領域及び空領域の出力Bv値の差Bv_BACK_OUT−Bv_SKY_OUTとゲイン調整係数の最小値k_hi_maxとの関係を示す図。The figure which shows the relationship between the difference Bv_BACK_OUT-Bv_SKY_OUT of the output Bv value of a background area | region and a sky area | region in this embodiment, and the minimum value k_hi_max of a gain adjustment coefficient. 本実施形態における高輝度画素率RATIO_HIとゲイン調整量k_hiとの関係を示す図。The figure which shows the relationship between the high-intensity pixel rate RATIO_HI and the gain adjustment amount k_hi in this embodiment. ゲイン量の調整を行う理由を説明するための図。The figure for demonstrating the reason for adjusting gain amount.

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

図1は、本発明の実施形態における画像処理装置の構成を示すブロック図である。図1において、撮像部101では、処理対象となる画像を撮影する。本実施形態では、後述するように画像の輝度に応じたゲインをかけることで、高輝度部の飽和を抑制しつつ、低輝度部の被写体を明るくして出力する。従って、画像の撮影露出は適正露出よりもアンダーであることが望ましい。なお、本実施形態においては、画像の露出の決め方は特に限定されず、どのような手法を用いてもよい。画像の露出の決め方の例としては、撮影露出を適正露出から予め設定した段差分アンダーとする手法や、ライブビュー時の画像の輝度分布から、高輝度部が飽和しないような撮影露出を設定する手法等が挙げられる。なお、本実施形態では処理対象となる画像を撮像部101により撮影する場合について説明するが、処理対象となる画像を、通信や記憶媒体等を介して外部から入力するようにしてもよい。   FIG. 1 is a block diagram illustrating a configuration of an image processing apparatus according to an embodiment of the present invention. In FIG. 1, the imaging unit 101 captures an image to be processed. In this embodiment, as described later, by applying a gain according to the luminance of the image, the subject of the low luminance part is brightened and output while suppressing saturation of the high luminance part. Therefore, it is desirable that the imaged exposure of the image is under the proper exposure. In the present embodiment, the method for determining the image exposure is not particularly limited, and any method may be used. As an example of how to determine the exposure of the image, set the shooting exposure so that the high-brightness area does not saturate based on the method of setting the shooting exposure under the preset step from the appropriate exposure or the brightness distribution of the image during live view The method etc. are mentioned. In the present embodiment, a case where an image to be processed is shot by the imaging unit 101 will be described. However, an image to be processed may be input from the outside via communication, a storage medium, or the like.

信号処理部102では、撮像部101により撮影された画像に対し、所定の信号処理を施す。ここで、所定の信号処理の一例としては、撮像素子の欠陥画素補正や周辺光量落ち補正、及びノイズリダクション処理などが挙げられる。   The signal processing unit 102 performs predetermined signal processing on the image captured by the imaging unit 101. Here, examples of the predetermined signal processing include defective pixel correction of the image sensor, peripheral light amount drop correction, and noise reduction processing.

領域毎情報算出部103は、信号処理部102において所定の信号処理が施された画像を複数の被写体領域に分割し、被写体領域毎の情報を取得する。本実施形態においては、被写体領域毎の情報として、各領域の代表輝度値、輝度ヒストグラム、および階調変換特性を決定する際の優先度を取得する。なお、領域毎情報算出部103における被写体領域毎の情報取得処理については、詳細に後述する。   The area-by-area information calculation unit 103 divides the image that has been subjected to predetermined signal processing by the signal processing unit 102 into a plurality of object areas, and acquires information for each object area. In the present embodiment, the priority for determining the representative luminance value, the luminance histogram, and the gradation conversion characteristics of each area is acquired as information for each subject area. The information acquisition process for each subject area in the area-by-area information calculation unit 103 will be described in detail later.

階調変換特性生成部104は、領域毎情報算出部103から得られた被写体領域毎の情報に基づいて、階調変換特性を決定する。ここでは階調変換特性として、処理対象の画像に乗じるゲインを輝度別に決定する。なお、階調変換特性生成部104における階調変換特性の生成処理については、詳細に後述する。   The gradation conversion characteristic generation unit 104 determines the gradation conversion characteristic based on the information for each subject area obtained from the area information calculation unit 103. Here, as gradation conversion characteristics, a gain to be multiplied by the image to be processed is determined for each luminance. The gradation conversion characteristic generation processing in the gradation conversion characteristic generation unit 104 will be described in detail later.

階調変換処理部105では、階調変換特性生成部104において生成された輝度別のゲインを用いて、信号処理部102において処理された画像の画像信号に対し、階調変換処理(ゲイン処理)を行う。なお、ここで行われる階調変換処理は特に限定されるものではなく、輝度別のゲインと画像の輝度値に基づいて、画像の各画素値に適切なゲインを乗じることで、出力画像を生成する処理であれば良い。   In the gradation conversion processing unit 105, gradation conversion processing (gain processing) is performed on the image signal of the image processed in the signal processing unit 102 using the gain for each luminance generated in the gradation conversion characteristic generation unit 104. I do. Note that the gradation conversion processing performed here is not particularly limited, and an output image is generated by multiplying each pixel value of the image by an appropriate gain based on the gain for each luminance and the luminance value of the image. As long as it is a process to do.

最後に、階調変換処理部105において生成された出力画像が、画像表示部106及び画像記録部107に送られ、画像の表示及び記録が行われる。   Finally, the output image generated in the gradation conversion processing unit 105 is sent to the image display unit 106 and the image recording unit 107, where the image is displayed and recorded.

次に、領域毎情報算出部103及び階調変換特性生成部104で行われる処理について説明する。本実施形態では、領域毎情報算出部103及び階調変換特性生成部104による処理結果を用いて階調変換処理を行うが、階調変換処理を行う画像として、図2に示すような逆光シーンを一例にとって説明する。図2に示すように、逆光シーンでは、主要被写体201の明るさに対し、背景が著しく明るい。   Next, processing performed by the area information calculation unit 103 and the gradation conversion characteristic generation unit 104 will be described. In the present embodiment, tone conversion processing is performed using the processing results of the region-by-region information calculation unit 103 and the tone conversion characteristic generation unit 104. As an image to be subjected to tone conversion processing, a backlight scene as shown in FIG. Will be described as an example. As shown in FIG. 2, in the backlight scene, the background is significantly brighter than the brightness of the main subject 201.

まず、領域毎情報算出部103における被写体領域毎の情報取得処理について、図3のフローチャートを参照しながら説明する。S301において、処理対象の画像を予め決められた条件に従って複数の被写体領域に分割する。図2に示す例では、被写体領域として、人物領域、背景領域、空領域に分割するものとするが、画像の内容に応じて変えれば良い。この処理において、領域毎情報算出部103はまず、図4(a)に示すように、所定の大きさのブロックBlock[i][j]に分割する。そして、各ブロックBlock[i][j]が、人物領域、背景領域、空領域のいずれに含まれるかを判定する、領域判定処理を行う。なお、領域判定処理の手法は問わないが、例えば、各ブロックBlock[i][j]の代表輝度値や代表色情報などに基づいて領域判定処理を行うことができる。また、ブロックBlock[i][j]の大きさに関しても特に限定はせず、例えば画素単位で領域判定処理を行ってもよい。   First, information acquisition processing for each subject area in the area-by-area information calculation unit 103 will be described with reference to the flowchart of FIG. In S301, the image to be processed is divided into a plurality of subject areas in accordance with predetermined conditions. In the example shown in FIG. 2, the subject area is divided into a person area, a background area, and an empty area, but may be changed according to the contents of the image. In this process, the area-by-area information calculation unit 103 first divides the block into blocks [i] [j] having a predetermined size as shown in FIG. Then, an area determination process is performed to determine whether each block Block [i] [j] is included in a person area, a background area, or an empty area. The method of region determination processing is not limited, but the region determination processing can be performed based on, for example, the representative luminance value or representative color information of each block Block [i] [j]. Further, the size of the block Block [i] [j] is not particularly limited, and for example, the area determination process may be performed on a pixel basis.

そして、ブロックBlock[i][j]毎に人物領域、背景領域、空領域のいずれに含まれるかを判定すると、判定結果に応じて、例えば、図4(b)に示すように0〜3を割り当てる。ここでは、ブロックBlock[i][j]の判定結果、空だった場合は0を、背景だった場合は1を、人物だった場合は2を、いずれの領域でもない(該当なし)場合には3を割り当てる。ここで、該当なしとは、たとえば各領域の境界部分など、領域の判別が困難な部分を指す。そして、同じ値が割り当てられたブロックをまとめることで、被写体領域に分割することができる。つまり、0が割り当てられたブロックをまとめて空領域、1が割り当てられたブロックをまとめて背景領域、2が割り当てられたブロックをまとめて人物領域とする。なお、本実施形態では、3が割り当てられたブロックは用いない。   Then, when it is determined whether each block Block [i] [j] is included in the person area, the background area, or the empty area, for example, as shown in FIG. Assign. Here, the determination result of the block Block [i] [j] is 0 if it is empty, 1 if it is the background, 2 if it is a person, and if it is not in any area (not applicable) Assigns 3. Here, “not applicable” refers to a portion where it is difficult to determine the region, for example, a boundary portion between the regions. Then, the blocks to which the same value is assigned can be divided into subject areas. That is, the blocks assigned 0 are grouped together into an empty area, the blocks allocated 1 are grouped together as a background area, and the blocks allocated 2 are grouped as a person area. In the present embodiment, blocks to which 3 is assigned are not used.

次に、S302において、被写体領域毎に代表輝度値を算出する。代表輝度値は、各被写体領域に属する各ブロックの平均輝度値の重みづけ平均値である。具体的には、空領域、背景領域、人物領域のそれぞれの代表輝度値をそれぞれY_SKY、Y_BACK、Y_HUMANとすると、それぞれの値を以下の式(1)から(3)により算出する。
Y_SKY = Σ( W_SKY[i][j] × Block_Y[i][j] )/ ΣW_SKY[i][j]
(Block_id[i][j]=0のブロックのみ) …(1)
Y_BACK = Σ( W_BACK[i][j] × Block_Y[i][j] )/ ΣW_BACK[i][j]
(Block_id[i][j]=1のブロックのみ) …(2)
Y_HUMAN = Σ( W_HUMAN[i][j] × Block_Y[i][j] )/ ΣW_HUMAN[i][j]
(Block_id[i][j]=2のブロックのみ) …(3)
ここで、Block_Y[i][j]は各ブロックの平均輝度値、W_SKY[i][j]、W_BACK[i][j]、W_HUMAN[i][j]は各ブロックに対する重み係数である。なお、重み係数は任意に設定可能とする。
Next, in S302, a representative luminance value is calculated for each subject area. The representative luminance value is a weighted average value of the average luminance values of the blocks belonging to each subject area. Specifically, assuming that the representative luminance values of the sky area, the background area, and the person area are Y_SKY, Y_BACK, and Y_HUMAN, the respective values are calculated by the following equations (1) to (3).
Y_SKY = Σ (W_SKY [i] [j] × Block_Y [i] [j]) / ΣW_SKY [i] [j]
(Only blocks with Block_id [i] [j] = 0) (1)
Y_BACK = Σ (W_BACK [i] [j] × Block_Y [i] [j]) / ΣW_BACK [i] [j]
(Only blocks with Block_id [i] [j] = 1) (2)
Y_HUMAN = Σ (W_HUMAN [i] [j] × Block_Y [i] [j]) / ΣW_HUMAN [i] [j]
(Block_id [i] [j] = 2 block only) (3)
Here, Block_Y [i] [j] is an average luminance value of each block, and W_SKY [i] [j], W_BACK [i] [j], and W_HUMAN [i] [j] are weighting coefficients for each block. The weighting factor can be set arbitrarily.

被写体領域毎に重みを別々に設定可能とする理由は以下の通りである。まず、単一の被写体領域である人物や空領域では、代表輝度値は領域内に含まれる各ブロックの平均輝度値の平均値でよいと考えられるため、重みは全ブロックにわたり同一でよい。一方、背景領域には草木や建物など様々な輝度値の被写体が存在するため、撮影者の意図した被写体を反映した正確な代表輝度値を算出する必要がある。一般的に撮影者の意図した被写体は、画像中央部にあることが多いため、背景領域に対しては、例えば、画像中央部の重みを相対的に大きく設定する。このように、各被写体領域に対し、代表輝度値を算出する際の考え方が異なる場合があるため、本実施形態では重み係数を各被写体領域に対して別々に設定可能としている。   The reason why the weight can be set separately for each subject area is as follows. First, in a person or sky area that is a single subject area, the representative luminance value may be the average value of the average luminance values of the blocks included in the area, and thus the weight may be the same for all blocks. On the other hand, since there are subjects with various brightness values such as plants and buildings in the background area, it is necessary to calculate an accurate representative brightness value reflecting the subject intended by the photographer. In general, since the subject intended by the photographer is often in the center of the image, for example, the weight of the center of the image is set relatively large with respect to the background area. As described above, since the concept of calculating the representative luminance value may be different for each subject area, the weighting factor can be set separately for each subject area in the present embodiment.

次に、S303において、各被写体領域の輝度ヒストグラムを生成する。ここでは、各被写体領域に属する各ブロックの平均輝度値のヒストグラムを生成する。図5は生成された輝度ヒストグラムの一例を示す図であり、図5(a)は人物領域の輝度ヒストグラム、図5(b)は背景領域の輝度ヒストグラム、図5(c)は空領域の輝度ヒストグラムを示している。   Next, in S303, a luminance histogram of each subject area is generated. Here, a histogram of the average luminance value of each block belonging to each subject area is generated. 5A and 5B are diagrams illustrating an example of the generated luminance histogram, in which FIG. 5A is a luminance histogram of a person region, FIG. 5B is a luminance histogram of a background region, and FIG. 5C is a luminance of a sky region. A histogram is shown.

次に、S304において、各被写体領域に対し、階調変換特性を生成する際の優先度を決定する。ここで、優先度を設定する理由は、本実施形態で行う階調変換処理では、同じ特性の輝度別ゲインを画像全域に対して用いるため、全ての被写体領域に対して、必ずしも所望のゲインを乗じるのではないからである。従って、階調変換特性の生成に当たり、所望のゲインをかける領域の優先度を予め設定しておく必要がある。   Next, in step S304, a priority for generating gradation conversion characteristics is determined for each subject area. Here, the reason for setting the priority is that the tone conversion processing performed in the present embodiment uses the luminance-specific gain with the same characteristics for the entire image area, so that a desired gain is not necessarily applied to all subject areas. This is because they are not multiplied. Therefore, in generating the gradation conversion characteristics, it is necessary to set the priority of the region to which a desired gain is applied in advance.

優先度の具体的な決め方に関しては、本件では特に限定しないが、例えば、各被写体領域の面積に所定の係数を乗じた値を評価値とし、この評価値から優先度を決定するという手法が挙げられる。その他、代表輝度値が最も小さい領域の優先度を一番高くするといった手法も挙げられる。本実施形態で想定する図2に示す逆光シーンでは、低輝度領域には人物が、高輝度領域には空が、中輝度領域には背景が偏在していることを仮定しており、本実施形態においては、最も優先度の高い領域を背景領域とする。   The specific method of determining the priority is not particularly limited in this case. For example, a method of determining the priority from the evaluation value by using a value obtained by multiplying the area of each subject region by a predetermined coefficient is given. It is done. In addition, there is a method in which the priority of the region having the smallest representative luminance value is made highest. In the backlight scene shown in FIG. 2 assumed in the present embodiment, it is assumed that a person is present in the low brightness area, the sky is present in the high brightness area, and the background is unevenly distributed in the middle brightness area. In the form, the region with the highest priority is set as the background region.

以上説明した処理により、領域毎情報算出部103の出力として、各被写体領域の代表輝度値と輝度ヒストグラム、及び階調変換特性を生成する際の優先度が得られる。   Through the processing described above, the priority for generating the representative luminance value, the luminance histogram, and the gradation conversion characteristic of each subject area is obtained as the output of the area-by-area information calculation unit 103.

次に、階調変換特性生成部104における階調変換特性の生成処理について、図6のフローチャートを参照しながら説明する。階調変換特性生成部104では、領域毎情報算出部103から得られた各被写体領域の情報を基に、階調変換特性を決定する。ここで、階調変換特性の決定とは、処理対象の画像に乗じる輝度別のゲインを決定することである。   Next, the gradation conversion characteristic generation processing in the gradation conversion characteristic generation unit 104 will be described with reference to the flowchart of FIG. The gradation conversion characteristic generation unit 104 determines the gradation conversion characteristic based on the information on each subject area obtained from the area information calculation unit 103. Here, the determination of the gradation conversion characteristic is to determine a gain for each luminance to be multiplied to the image to be processed.

まず、S501において、領域毎情報算出部103から得られた各被写体領域の輝度ヒストグラムに基づいて輝度を区間分割し、S502において、輝度の区間毎のゲインを算出する。前述のように、本実施形態で対象とする典型的な逆光シーンでは、図5に示すように、被写体領域毎に輝度の分布が偏る傾向がある。人物領域の輝度は図5(a)に示すように低輝度領域に、空領域の輝度は図5(c)に示すように高輝度領域に偏っていることが分かる。そこで、被写体領域毎の情報から、図7に示すように、各被写体領域に対応する輝度の区間を算出し、それぞれの区間に応じた階調変換処理の特性、すなわち画像に乗じるゲインを決定する。   First, in S501, the luminance is divided into sections based on the luminance histogram of each subject area obtained from the area-by-area information calculation unit 103. In S502, the gain for each luminance section is calculated. As described above, in a typical backlight scene targeted in the present embodiment, the luminance distribution tends to be biased for each subject area as shown in FIG. It can be seen that the brightness of the person area is biased toward the low brightness area as shown in FIG. 5A, and the brightness of the sky area is biased toward the high brightness area as shown in FIG. 5C. Therefore, as shown in FIG. 7, luminance sections corresponding to each subject area are calculated from the information for each subject area, and the characteristics of gradation conversion processing corresponding to each section, that is, the gain to be multiplied by the image are determined. .

S501の具体的な処理は、図7に示す、輝度の境界となる輝度Y0及びY1を算出することである。算出方法の一例を図8に示す。図8(a)に示すように、人物領域の輝度ヒストグラムを、輝度が小さい順に順次累積していき、累積度数が領域面積N_humanに対し所定の割合TH_RATIO_HUMANに達したときの輝度値をY0とする。また、図8(b)に示すように、空領域の輝度ヒストグラムを、輝度が高い順に順次累積していき、累積度数が領域面積N_skyに対し所定の割合TH_RATIO_SKYに達したときの輝度値をY1とする。このようにして求めた境界の輝度Y0及びY1により、輝度を図7に示すように区分する。すなわち、輝度0〜Y0の領域を、人物の輝度が多く偏在する低輝度領域、輝度Y1〜2N−1の領域を、空の輝度が多く偏在する高輝度領域として区分する。そして、低輝度領域及び高輝度領域以外の輝度Y0〜Y1の領域を、背景の輝度が多く偏在する中輝度領域として区分する。 The specific processing of S501 is to calculate the luminances Y0 and Y1 that are the luminance boundaries shown in FIG. An example of the calculation method is shown in FIG. As shown in FIG. 8 (a), the luminance histogram of the person region is sequentially accumulated in ascending order of luminance, and the luminance value when the cumulative frequency reaches a predetermined ratio TH_RATIO_HUMAN with respect to the region area N_human is Y0. . Further, as shown in FIG. 8B, the luminance histogram of the sky region is sequentially accumulated in descending order of luminance, and the luminance value when the cumulative frequency reaches a predetermined ratio TH_RATIO_SKY with respect to the region area N_sky is expressed as Y1. And The brightness is divided as shown in FIG. 7 based on the brightness Y0 and Y1 of the boundary thus obtained. That is, the area of luminance 0 to Y0 is classified as a low luminance area where the luminance of the person is unevenly distributed, and the area of luminance Y1 to 2 N −1 is divided as a high luminance area where the luminance of the sky is unevenly distributed. Then, areas of luminance Y0 to Y1 other than the low luminance area and the high luminance area are classified as medium luminance areas where the background luminance is unevenly distributed.

次に、S502において、出力される画像の輝度が撮影者の印象に近づくように、区分された各輝度領域の輝度に乗じるゲインを決定する。   Next, in S502, a gain to be multiplied by the luminance of each divided luminance region is determined so that the luminance of the output image approaches the photographer's impression.

まず、各被写体領域を適正な明るさで出力するときの露光量(以下、「適正Bv値」と呼ぶ。)を算出する。各被写体領域の適正Bv値は、各被写体領域の代表輝度値が、予め設定された目標輝度値となる場合のBv値である。処理対象の画像の撮影時の露光量をBv_CAPTUREとすると、各被写体領域の適正Bv値は、図9に示すように、Bv_CAPTUREを基準として、各被写体領域の代表輝度値から以下のようにして算出することができる。
Bv_SKY = Bv_CAPTURE + ΔBv_SKY …(4)
Bv_BACK = Bv_CAPTURE + ΔBv_BACK …(5)
Bv_HUMAN = Bv_CAPTURE + ΔBv_HUMAN …(6)
ここで、
ΔBv_SKY = log2( Y_SKY_TARGET / Y_SKY ) …(7)
ΔBv_BACK = log2( Y_BACK_TARGET / Y_BACK ) …(8)
ΔBv_HUMAN = log2( Y_HUMAN_TARGET / Y_HUMAN ) …(9)
なお、Bv_SKY、Bv_BACK、Bv_HUMANは各被写体領域の適正Bv値であり、ΔBv_SKY、ΔBv_BACK、ΔBv_HUMANはBv_CAPTUREから各被写体領域の適正Bv値までの差分量である。また、Y_SKY_TARGET、Y_BACK_TARGET、Y_HUMAN_TARGETは、各被写体領域の目標輝度値、Y_SKY、Y_BACK、Y_HUMANは、各被写体領域の輝度値である。
First, an exposure amount (hereinafter referred to as “appropriate Bv value”) when each subject area is output with appropriate brightness is calculated. The appropriate Bv value of each subject area is a Bv value when the representative brightness value of each subject area becomes a preset target brightness value. Assuming that the exposure amount at the time of shooting the image to be processed is Bv_CAPTURE, the appropriate Bv value for each subject area is calculated from the representative brightness value of each subject area as shown in FIG. can do.
Bv_SKY = Bv_CAPTURE + ΔBv_SKY (4)
Bv_BACK = Bv_CAPTURE + ΔBv_BACK (5)
Bv_HUMAN = Bv_CAPTURE + ΔBv_HUMAN (6)
here,
ΔBv_SKY = log 2 (Y_SKY_TARGET / Y_SKY) (7)
ΔBv_BACK = log 2 (Y_BACK_TARGET / Y_BACK)… (8)
ΔBv_HUMAN = log 2 (Y_HUMAN_TARGET / Y_HUMAN)… (9)
Bv_SKY, Bv_BACK, and Bv_HUMAN are appropriate Bv values for each subject area, and ΔBv_SKY, ΔBv_BACK, and ΔBv_HUMAN are the difference amounts from Bv_CAPTURE to the appropriate Bv value for each subject area. Y_SKY_TARGET, Y_BACK_TARGET, and Y_HUMAN_TARGET are target brightness values for each subject area, and Y_SKY, Y_BACK, and Y_HUMAN are brightness values for each subject area.

ここで、各被写体領域を適正Bv値で得られる明るさで出力すると、画像全体の見た目が不自然になる。従って、見た目が自然となるような露光量(以下、「出力Bv値」と呼ぶ。)を算出し、各被写体領域の出力輝度が、各出力Bv値相当の明るさとなるようにゲインを設定する。出力Bv値は、各被写体領域の適正Bv値と撮影時の露光量との差分量ΔBvを、基準とする露光量に対して所定の比率で圧縮することで算出する。図9に示す例では、出力Bv値の基準を背景領域の出力Bv値とし、所定の比率を1/2としている。式としては、以下のように表わされる。
Bv_SKY_OUT = ( Bv_SKY + Bv_BACK )/2 …(10)
Bv_BACK_OUT = Bv_BACK …(11)
Bv_HUMAN_OUT = ( Bv_HUMAN + Bv_BACK )/2 …(12)
ここで、Bv_SKY_OUT、Bv_BACK_OUT、Bv_HUMAN_OUTは各被写体領域の出力Bv値である。
Here, if each subject area is output with brightness obtained with an appropriate Bv value, the overall appearance of the image becomes unnatural. Therefore, an exposure amount (hereinafter referred to as an “output Bv value”) that makes the appearance natural is calculated, and a gain is set so that the output luminance of each subject area becomes a brightness equivalent to each output Bv value. . The output Bv value is calculated by compressing the difference amount ΔBv between the appropriate Bv value of each subject area and the exposure amount at the time of shooting at a predetermined ratio with respect to the reference exposure amount. In the example shown in FIG. 9, the reference of the output Bv value is the output Bv value of the background area, and the predetermined ratio is 1/2. The formula is expressed as follows.
Bv_SKY_OUT = (Bv_SKY + Bv_BACK) / 2 ... (10)
Bv_BACK_OUT = Bv_BACK (11)
Bv_HUMAN_OUT = (Bv_HUMAN + Bv_BACK) / 2 ... (12)
Here, Bv_SKY_OUT, Bv_BACK_OUT, and Bv_HUMAN_OUT are output Bv values of each subject area.

各被写体領域に乗じるゲインは、図9に示すように、Bv_CAPTUREから出力Bv値を引いた差分から算出する。式としては、以下のように表わされる。
GAIN_SKY = 2^(Bv_CAPTURE - Bv_SKY_OUT) …(13)
GAIN_BACK = 2^(Bv_CAPTURE - Bv_BACK_OUT) …(14)
GAIN_HUMAN = 2^(Bv_CAPTURE - Bv_HUMAN_OUT) …(15)
ここで、GAIN_SKY、GAIN_BACK、GAIN_HUMANは、各被写体領域に乗じるゲインである。
As shown in FIG. 9, the gain multiplied to each subject area is calculated from the difference obtained by subtracting the output Bv value from Bv_CAPTURE. The formula is expressed as follows.
GAIN_SKY = 2 ^ (Bv_CAPTURE-Bv_SKY_OUT)… (13)
GAIN_BACK = 2 ^ (Bv_CAPTURE-Bv_BACK_OUT)… (14)
GAIN_HUMAN = 2 ^ (Bv_CAPTURE-Bv_HUMAN_OUT)… (15)
Here, GAIN_SKY, GAIN_BACK, and GAIN_HUMAN are gains multiplied by each subject area.

次に、S503において、ゲイン量の調整を行う。ここで、ゲイン量の調整を行う理由を図16を用いて説明する。図16(a)に示すように、逆光シーンの背景領域に人物領域と同様の輝度値を持った画素が多く分布している場合を想定する。図16(b)に示すような特性を有するゲインを用いた場合、背景領域内に存在する、人物領域と同程度の低い輝度を有する領域に対し、人物領域に乗じるゲインがかかることで、低輝度領域の輝度値が大きくなる。これにより、図16(c)に示すように、背景領域の暗部が浮いたような不自然な画像が生成されてしまう。これは、階調変換処理を一律の輝度別ゲインを用いて実現していることに起因しており、明るく出力したい人物領域と、明るく出力したくない背景領域の暗部の輝度レベルがほぼ同等の場合、これらの2領域を輝度値から区別できないことが原因である。   Next, in S503, the gain amount is adjusted. Here, the reason for adjusting the gain amount will be described with reference to FIG. As shown in FIG. 16A, a case is assumed where many pixels having the same luminance value as the person area are distributed in the background area of the backlight scene. When a gain having the characteristics shown in FIG. 16B is used, a gain multiplied by the person area is applied to an area having a luminance as low as that of the person area existing in the background area. The brightness value in the brightness area increases. As a result, as shown in FIG. 16C, an unnatural image in which the dark part of the background area is floating is generated. This is due to the fact that the gradation conversion processing is realized using a uniform gain by brightness, and the brightness level of the dark area in the background area not desired to be brightly output and the person area desired to be brightly output are substantially the same. This is because these two areas cannot be distinguished from the luminance values.

逆に、特に背景に対し空が非常に明るい場合には、空が白飛びしないように、高輝度領域のゲイン量を抑制し、階調を圧縮する。しかしながら、背景領域に、高輝度領域と同等の輝度を持った画素が多く分布している場合は、空領域と同様に輝度が圧縮され、コントラストが失われた出力画像となってしまう。   Conversely, especially when the sky is very bright against the background, the gain amount in the high luminance region is suppressed and the gradation is compressed so that the sky does not fly out. However, when many pixels having the same luminance as the high luminance region are distributed in the background region, the luminance is compressed in the same manner as in the sky region, resulting in an output image with lost contrast.

S503では、上記のような現象を緩和するために、ゲイン量の調整を行う。なお、上記のような現象が顕著となるのは、背景領域に低輝度及び、または高輝度の画素が多く分布し、且つ低輝度領域に乗じるゲイン量が大きい場合及び、または高輝度領域の階調圧縮量が大きい場合である。このような場合は、人物領域に乗じるゲイン量を小さくし、空領域に乗じるゲイン量を大きくする調整を行う。すなわち、所望としている効果を落とす方向の調整を行う。しかしながら、常にこのような調整を行うと、出力画像において期待している効果が得られない場合がある。従って、シーンに応じて適応的な制御を行うことが必要である。   In S503, the gain amount is adjusted to alleviate the above phenomenon. Note that the phenomenon described above becomes prominent when low luminance and / or high luminance pixels are distributed in the background area and the gain amount multiplied by the low luminance area is large, or when the level of the high luminance area is high. This is a case where the adjustment compression amount is large. In such a case, an adjustment is made to reduce the gain amount multiplied by the person area and increase the gain amount multiplied by the empty area. That is, the adjustment in the direction of reducing the desired effect is performed. However, if such an adjustment is always performed, the expected effect in the output image may not be obtained. Therefore, it is necessary to perform adaptive control according to the scene.

図10は、S503で行われるゲイン量調整処理を示すフローチャートである。図10に示すように、S503で行うゲイン調整処理には、低輝度側処理と高輝度側処理がある。S801〜S804で行う処理が低輝度側処理で、S805〜S808で行う処理が高輝度側処理である。まず、S801において、人物領域及び背景領域の出力Bv値の差Bv_HUMAN_OUT−Bv_BACK_OUTから、ゲイン調整係数の最小値k_low_min(下限)を求める。   FIG. 10 is a flowchart showing the gain amount adjustment processing performed in S503. As shown in FIG. 10, the gain adjustment processing performed in S503 includes low luminance side processing and high luminance side processing. The processing performed in S801 to S804 is low-luminance side processing, and the processing performed in S805 to S808 is high-luminance side processing. First, in S801, the minimum value k_low_min (lower limit) of the gain adjustment coefficient is obtained from the difference Bv_HUMAN_OUT−Bv_BACK_OUT between the output Bv values of the person area and the background area.

図11は、人物領域と背景領域の出力Bv値の差Bv_HUMAN_OUT−Bv_BACK_OUTとゲイン調整係数の最小値k_low_minとの関係を示すグラフである。図11から分かるように、ゲイン調整係数の最小値k_low_minは、人物領域と背景領域の出力Bv値の差が大きいほど小さい値を取る。この理由としては、出力Bv値の差が大きいほど逆光度合いが大きく、人物領域に乗じるゲインが大きくなるので、図16で説明した現象が顕著に起こり易く、ゲイン量を抑制した方が良い可能性があるからである。なお、図11に示す例では、出力Bv値の差Bv_HUMAN_OUT−Bv_BACK_OUTが閾値TH1_dBv_lowよりも小さい場合、ゲインの調整を行わないようにすると共に、閾値TH2_dBv_lowよりも大きい場合、ゲイン調整係数の最小値k_low_minをminに固定する。   FIG. 11 is a graph showing the relationship between the difference Bv_HUMAN_OUT−Bv_BACK_OUT between the output Bv values of the person area and the background area and the minimum value k_low_min of the gain adjustment coefficient. As can be seen from FIG. 11, the minimum value k_low_min of the gain adjustment coefficient takes a smaller value as the difference between the output Bv values of the person area and the background area increases. The reason for this is that the greater the difference in the output Bv value, the greater the degree of backlighting and the greater the gain applied to the person area. Therefore, the phenomenon described in FIG. 16 is likely to occur remarkably, and it is better to suppress the gain amount. Because there is. In the example illustrated in FIG. 11, when the output Bv value difference Bv_HUMAN_OUT−Bv_BACK_OUT is smaller than the threshold value TH1_dBv_low, the gain is not adjusted, and when the difference is larger than the threshold value TH2_dBv_low, the minimum value k_low_min of the gain adjustment coefficient. Is fixed to min.

次に、S802において、背景領域の輝度ヒストグラムから、低輝度画素率RATIO_LOWを算出する。低輝度画素率は、背景領域の全画素数に対し、輝度値が輝度Y0以下の低輝度領域に属する画素数の比率である。図12は、低輝度領域と、後述する高輝度領域を示す図である。図12で示される低輝度領域に属する画素は、人物領域の画素値の輝度レベルとおおよそ同一であり、輝度別ゲイン処理によって人物領域と同じ値のゲインがかかる。従って、低輝度画素率RATIO_LOWが大きいほど、図16で説明した現象が顕著になると考えられる。   Next, in S802, the low luminance pixel rate RATIO_LOW is calculated from the luminance histogram of the background area. The low luminance pixel rate is the ratio of the number of pixels belonging to the low luminance area whose luminance value is equal to or lower than the luminance Y0 to the total number of pixels in the background area. FIG. 12 is a diagram illustrating a low luminance region and a high luminance region described later. The pixels belonging to the low luminance area shown in FIG. 12 are approximately the same as the luminance level of the pixel value of the person area, and gain of the same value as that of the person area is applied by the luminance-specific gain processing. Therefore, it is considered that the phenomenon described with reference to FIG. 16 becomes more remarkable as the low luminance pixel rate RATIO_LOW is larger.

次に、S803において、低輝度画素率RATIO_LOWから最終的なゲイン調整量k_lowを求める。図13は、低輝度画素率RATIO_LOWとゲイン調整量k_lowとの関係を示すグラフである。上述したように、低輝度画素率RATIO_LOWが大きいほど、ゲイン調整量k_lowの値を小さくする。なお、図13に示す例では、低輝度画素率RATIO_LOWが閾値TH1_ratio_lowよりも小さい場合、ゲインの調整を行わないようにする。これは、背景領域における低輝度の画素が少ない場合、図16で説明した現象の影響が少ないと考えられるからである。また、低輝度画素率RATIO_LOWが閾値TH2_ratio_lowよりも大きい場合には、ゲイン調整量k_lowをゲイン調整係数の最小値k_low_minに固定する。即ち、低輝度画素率RATIO_LOWが閾値TH1_ratio_lowまたは閾値TH2_ratio_lowよりも大きい場合、閾値TH1_ratio_low以下の場合よりもゲイン調整係数を小さくする。   Next, in S803, a final gain adjustment amount k_low is obtained from the low luminance pixel rate RATIO_LOW. FIG. 13 is a graph showing the relationship between the low luminance pixel rate RATIO_LOW and the gain adjustment amount k_low. As described above, the value of the gain adjustment amount k_low is decreased as the low luminance pixel rate RATIO_LOW is increased. In the example shown in FIG. 13, when the low luminance pixel rate RATIO_LOW is smaller than the threshold value TH1_ratio_low, the gain is not adjusted. This is because when the number of low-luminance pixels in the background area is small, it is considered that the effect described in FIG. When the low luminance pixel rate RATIO_LOW is larger than the threshold value TH2_ratio_low, the gain adjustment amount k_low is fixed to the minimum value k_low_min of the gain adjustment coefficient. That is, when the low luminance pixel rate RATIO_LOW is larger than the threshold value TH1_ratio_low or the threshold value TH2_ratio_low, the gain adjustment coefficient is made smaller than that in the case of the threshold value TH1_ratio_low or less.

ただし、図11に示した通り、出力Bv値の差Bv_HUMAN_OUT−Bv_BACK_OUTに応じてゲイン調整係数の最小値k_low_minは1からminの間を取る。従って、例えば、出力Bv値の差Bv_HUMAN_OUT−Bv_BACK_OUTの差が小さく、ゲイン調整係数の最小値k_low_minが1の場合には、低輝度画素率RATIO_LOWによらず、ゲイン調整量k_lowは1となり、ゲインの調整は行われないことになる。   However, as shown in FIG. 11, the minimum value k_low_min of the gain adjustment coefficient is between 1 and min depending on the difference Bv_HUMAN_OUT−Bv_BACK_OUT of the output Bv value. Therefore, for example, when the difference between the output Bv values Bv_HUMAN_OUT−Bv_BACK_OUT is small and the minimum gain adjustment coefficient value k_low_min is 1, the gain adjustment amount k_low is 1 regardless of the low luminance pixel rate RATIO_LOW, and the gain No adjustment will be made.

次に、S804において、低輝度領域(人物領域)に乗じるゲインGAIN_HUMANを、以下の式(16)により再計算する。
GAIN_HUMAN = GAIN_HUMAN * k_low …(16)
Next, in S804, the gain GAIN_HUMAN multiplied by the low luminance area (person area) is recalculated by the following equation (16).
GAIN_HUMAN = GAIN_HUMAN * k_low (16)

以上が、ゲイン量調整の低輝度側処理の内容である。続いて、高輝度側処理の説明を行う。   The above is the content of the low luminance side processing of gain amount adjustment. Subsequently, the high luminance side processing will be described.

まず、S805において、背景領域及び空領域の出力Bv値の差Bv_BACK_OUT−Bv_SKY_OUTから、ゲイン調整係数の最大値k_hi_max(上限)を算出する。図14は、背景領域及び空領域の出力Bv値の差Bv_BACK_OUT−Bv_SKY_OUTとゲイン調整係数の最大値k_hi_maxとの関係を示すグラフである。図14から分かるように、ゲイン調整係数の最大値k_hi_maxは、背景領域と空領域の出力Bv値の差が大きいほど大きい値を取る。この理由としては、出力Bv値の差が大きいほど高輝度領域の階調圧縮度合が大きく、空領域に乗じるゲインが小さくなるので、図6で説明した現象が顕著になり易く、ゲイン量を大きくした方が良い可能性があるからである。なお、図14に示す例では、出力Bv値の差Bv_BACK_OUT−Bv_SKY_OUTが閾値TH1_dBv_hiよりも小さい場合、ゲインの調整を行わないようにすると共に、閾値TH2_dBv_hiよりも大きい場合、ゲイン調整係数の最大値k_hi_maxをmaxに固定する。   First, in S805, the maximum value k_hi_max (upper limit) of the gain adjustment coefficient is calculated from the difference Bv_BACK_OUT−Bv_SKY_OUT between the output Bv values of the background area and the sky area. FIG. 14 is a graph showing the relationship between the difference Bv_BACK_OUT−Bv_SKY_OUT between the output Bv values of the background area and the sky area and the maximum value k_hi_max of the gain adjustment coefficient. As can be seen from FIG. 14, the maximum value k_hi_max of the gain adjustment coefficient takes a larger value as the difference between the output Bv values of the background area and the sky area increases. This is because, as the difference in output Bv value is larger, the gradation compression degree in the high luminance region is larger and the gain multiplied in the sky region is smaller. Therefore, the phenomenon described with reference to FIG. This is because it may be better. In the example illustrated in FIG. 14, when the output Bv value difference Bv_BACK_OUT−Bv_SKY_OUT is smaller than the threshold value TH1_dBv_hi, the gain is not adjusted, and when the output Bv value difference is larger than the threshold value TH2_dBv_hi, the maximum value k_hi_max Is fixed to max.

次に、S806において、背景領域の輝度ヒストグラムから、高輝度画素率RATIO_HIを算出する。高輝度画素率は、背景領域の全画素数に対し、輝度値が輝度Y1以上の高輝度領域に属する画素数の比率である。図12で示される高輝度領域に属する画素は、空領域の画素値の輝度レベルとおおよそ同一であり、輝度別ゲイン処理によって空領域と同じ値のゲインがかかる。従って、高輝度画素率RATIO_HIが大きいほど、図16で説明した現象が顕著になると考えられる。   In step S806, the high luminance pixel rate RATIO_HI is calculated from the luminance histogram of the background area. The high luminance pixel rate is the ratio of the number of pixels belonging to the high luminance area whose luminance value is equal to or higher than the luminance Y1 to the total number of pixels in the background area. The pixels belonging to the high luminance area shown in FIG. 12 are approximately the same as the luminance level of the pixel value in the sky area, and gain of the same value as that in the sky area is applied by the luminance-specific gain processing. Therefore, it is considered that the phenomenon described with reference to FIG. 16 becomes more remarkable as the high luminance pixel rate RATIO_HI is larger.

次に、S807において、高輝度画素率RATIO_HIから最終的なゲイン調整量k_hiを求める。図15は、高輝度画素率RATIO_HIとゲイン調整量k_hiとの関係を示すグラフである。上述した考察より、RATIO_HIが大きいほど、k_hiの値を大きくする。なお、図15に示す例では、高輝度画素率RATIO_HIが閾値TH1_ratio_hiよりも小さい場合、ゲインの調整を行わないようにする。これは、背景領域における高輝度の画素が少ない場合、図16で説明した現象の影響が少ないと考えられるからである。また、高輝度画素率RATIO_HIが閾値TH2_ratio_hiよりも大きい場合には、ゲイン調整量k_hiをゲイン調整係数の最大値k_hi_maxに固定する。即ち、高輝度画素率RATIO_HIが閾値TH1_ratio_hiまたは閾値TH2_ratio_hiよりも大きい場合、閾値TH1_ratio_hi以下の場合よりもゲイン調整係数を大きくする。   Next, in S807, a final gain adjustment amount k_hi is obtained from the high luminance pixel rate RATIO_HI. FIG. 15 is a graph showing the relationship between the high luminance pixel rate RATIO_HI and the gain adjustment amount k_hi. From the above consideration, the value of k_hi is increased as RATIO_HI is larger. In the example illustrated in FIG. 15, when the high luminance pixel rate RATIO_HI is smaller than the threshold value TH1_ratio_hi, the gain is not adjusted. This is because when the number of high-luminance pixels in the background area is small, it is considered that the effect described in FIG. When the high luminance pixel rate RATIO_HI is larger than the threshold value TH2_ratio_hi, the gain adjustment amount k_hi is fixed to the maximum value k_hi_max of the gain adjustment coefficient. That is, when the high luminance pixel rate RATIO_HI is larger than the threshold value TH1_ratio_hi or the threshold value TH2_ratio_hi, the gain adjustment coefficient is made larger than when the threshold value TH1_ratio_hi is less than or equal to.

ただし、図14に示した通り、出力Bv値の差Bv_BACK_OUT−Bv_SKY_OUTに応じてゲイン調整係数の最大値k_hi_maxは1からmaxの間を取る。従って、例えば、出力Bv値の差Bv_BACK_OUT−Bv_SKY_OUTの差が小さく、ゲイン調整係数の最大値k_hi_maxが1の場合には、高輝度画素率RATIO_HIによらず、ゲイン調整量k_hiは1となり、ゲインの調整は行われないことになる。   However, as shown in FIG. 14, the maximum value k_hi_max of the gain adjustment coefficient is between 1 and max according to the difference Bv_BACK_OUT−Bv_SKY_OUT of the output Bv value. Therefore, for example, when the difference between the output Bv values Bv_BACK_OUT−Bv_SKY_OUT is small and the maximum value k_hi_max of the gain adjustment coefficient is 1, the gain adjustment amount k_hi is 1 regardless of the high luminance pixel rate RATIO_HI, and the gain No adjustment will be made.

次に、S808において、高輝度領域(空領域)に乗じるゲインGAIN_SKYを、以下の式(17)により再計算する。
GAIN_SKY = GAIN_SKY * k_hi …(17)
Next, in S808, the gain GAIN_SKY multiplied by the high luminance area (sky area) is recalculated by the following equation (17).
GAIN_SKY = GAIN_SKY * k_hi (17)

上記処理によって、図16で説明した現象を低減するように、低輝度領域に乗じるゲインGAIN_HUMAN及び、高輝度領域に乗じるゲインGAIN_SKYの値が再調整される。   By the above process, the gain GAIN_HUMAN multiplied by the low luminance region and the gain GAIN_SKY multiplied by the high luminance region are readjusted so as to reduce the phenomenon described in FIG.

上述したゲイン量調整処理後、図5に戻り、続くS504において、階調変換特性を生成する。ここで、階調変換特性とは輝度別ゲイン特性のことである。各輝度区間において、上述したようにして調整されたゲインGAIN_HUMAN、GAIN_BACK、GAIN_SKYを用いた場合、各輝度区間の境界部において、階調反転やトーンジャンプが起きる可能性がある。そのため、そのような問題が生じないようなゲイン特性を生成する。ゲイン特性の生成に関しては、本実施形態では特に限定しないが、例えば、適切なゲインをかけたい被写体領域の優先度や、各被写体領域の出力Bv値の関係から、処理対象の画像に適切なゲイン特性を決定する。   After the above-described gain amount adjustment processing, returning to FIG. 5, in step S504, the gradation conversion characteristics are generated. Here, the gradation conversion characteristics are gain characteristics by luminance. When the gains GAIN_HUMAN, GAIN_BACK, and GAIN_SKY adjusted as described above are used in each luminance section, gradation inversion and tone jump may occur at the boundary of each luminance section. Therefore, a gain characteristic that does not cause such a problem is generated. The generation of the gain characteristic is not particularly limited in the present embodiment. Determine characteristics.

上記処理により、階調変換特性生成部104の出力として、処理対象の画像に対し適応的に生成された輝度別ゲイン特性が生成される。   As a result of the above processing, the brightness-specific gain characteristics that are adaptively generated for the image to be processed are generated as the output of the gradation conversion characteristic generation unit 104.

以上説明したように、本実施形態によれば、各被写体領域の輝度差だけでなく、中間輝度領域の輝度分布を考慮して、低輝度領域及び高輝度領域のゲイン量を決定する。これにより、背景部分の暗部が不自然に浮き上がったり、明部が過剰に階調圧縮され、コントラストが低下した不自然な出力画像になることを抑制することができる。   As described above, according to the present embodiment, the gain amounts of the low luminance region and the high luminance region are determined in consideration of not only the luminance difference between the subject regions but also the luminance distribution of the intermediate luminance region. As a result, it is possible to suppress the dark portion of the background portion from floating unnaturally, or the bright portion from being excessively tone-compressed, resulting in an unnatural output image with a reduced contrast.

なお、上記の実施形態では、最も優先度の高い領域を背景領域とする場合を説明したが、最も優先度の高い領域が人物領域であっても空領域であっても構わない。例えば、最も優先度の高い領域が人物領域の場合には、図10に示す低輝度側処理に変えて中間輝度側処理として人物領域と背景領域との比較を行い、高輝度側処理として人物領域と空領域との比較を行えばよい。   In the above embodiment, the case where the highest priority area is set as the background area has been described. However, the highest priority area may be a person area or an empty area. For example, when the area with the highest priority is a person area, the person area is compared with the background area as intermediate luminance side processing instead of the low luminance side processing shown in FIG. And the empty area may be compared.

また、分割された被写体領域が人物領域、背景領域、空領域の3つの被写体領域を含まずに、例えば、人物領域と空領域というように2つの被写体領域のみであっても構わない。その場合、図10に示す2つの処理に相当する処理のうち一方のみを行うようにすればよい。   Further, the divided subject areas do not include the three subject areas of the person area, the background area, and the sky area, and may include only two subject areas such as a person area and a sky area. In that case, only one of the processes corresponding to the two processes shown in FIG. 10 may be performed.

<他の実施形態>
なお、本発明は、複数の機器(例えばホストコンピュータ、インターフェイス機器、スキャナ、ビデオカメラなど)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機、ファクシミリ装置など)に適用してもよい。
<Other embodiments>
Note that the present invention can be applied to a system composed of a plurality of devices (for example, a host computer, an interface device, a scanner, a video camera, etc.), or a device (for example, a copier, a facsimile device, etc.) composed of a single device You may apply to.

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

101:撮像部、102:信号処理部、103:領域毎情報取得部、104:階調変換特性生成部、105:階調変換処理部、106:画像表示部、107:画像記録部   101: Image processing unit, 102: Signal processing unit, 103: Information acquisition unit for each area, 104: Tone conversion characteristic generation unit, 105: Tone conversion processing unit, 106: Image display unit, 107: Image recording unit

Claims (12)

入力した画像を、予め決められた条件に従って複数の被写体領域に分割する分割手段と、
前記分割した各被写体領域の輝度の分布に基づいて、前記画像の輝度を複数の輝度領域に分割し、前記複数の被写体領域のうち、前記分割した各輝度領域に対応する1つの被写体領域の代表輝度値に基づいて、前記輝度領域ごとに第1のゲインを算出する算出手段と、
前記複数の被写体領域のうち、前記輝度領域ごとに、対応する前記1つの被写体領域の輝度の分布と、当該輝度領域以外の少なくとも1つの輝度領域に対応する少なくとも1つの別の被写体領域の輝度の分布とに基づいて、前記第1のゲインを補正して、前記輝度領域ごとに第2のゲインを求める補正手段と、
前記第2のゲインを用いて、前記画像の輝度を変換する変換手段と
を有することを特徴とする画像処理装置。
Dividing means for dividing the input image into a plurality of subject areas according to a predetermined condition;
Based on the luminance distribution of each of the divided subject areas, the luminance of the image is divided into a plurality of luminance areas, and a representative of one subject area corresponding to each of the divided luminance areas among the plurality of subject areas. Calculating means for calculating a first gain for each of the luminance regions based on a luminance value;
Of the plurality of subject areas, for each of the brightness areas, the brightness distribution of the corresponding one subject area and the brightness of at least one other subject area corresponding to at least one brightness area other than the brightness area. Correction means for correcting the first gain based on the distribution and obtaining a second gain for each of the luminance regions;
An image processing apparatus comprising: conversion means for converting the luminance of the image using the second gain.
前記算出手段は、前記第1のゲインとして、前記分割した各輝度領域に対応する前記1つの被写体領域の代表輝度値を予め決められた輝度に変換するゲインを算出することを特徴とする請求項1に記載の画像処理装置。   The calculation means calculates a gain for converting a representative luminance value of the one subject area corresponding to each of the divided luminance areas into a predetermined luminance as the first gain. The image processing apparatus according to 1. 前記複数の輝度領域は、前記複数の被写体領域のうち、最も低い代表輝度値を有する被写体領域に対応する低輝度領域を含み、
前記補正手段は、前記別の被写体領域に含まれる画像信号のうち、前記低輝度領域の輝度を有する画像信号の割合に基づいて、前記第1のゲインを補正し、
前記割合が予め決められた閾値よりも高い場合に、該閾値以下の場合よりも前記第1のゲインを小さくすることを特徴とする請求項1または2に記載の画像処理装置。
The plurality of luminance regions include a low luminance region corresponding to a subject region having the lowest representative luminance value among the plurality of subject regions,
The correction means corrects the first gain based on a ratio of an image signal having a luminance of the low luminance region among image signals included in the different subject region,
The image processing apparatus according to claim 1, wherein when the ratio is higher than a predetermined threshold, the first gain is made smaller than when the ratio is equal to or lower than the threshold.
前記補正手段は、更に、前記低輝度領域に対応する前記1つの被写体領域の輝度と、前記別の被写体領域の輝度との差に基づいて、前記第1のゲインを補正し、
前記差が予め決められた閾値よりも大きい場合に、該閾値以下の場合よりも、前記第2のゲインの下限を小さくすることをすることを特徴とする請求項3に記載の画像処理装置。
The correction means further corrects the first gain based on a difference between a luminance of the one subject region corresponding to the low luminance region and a luminance of the other subject region,
The image processing apparatus according to claim 3, wherein when the difference is larger than a predetermined threshold value, the lower limit of the second gain is made smaller than when the difference is equal to or smaller than the threshold value.
前記複数の輝度領域は、前記複数の被写体領域のうち、最も高い代表輝度値を有する被写体領域に対応する高輝度領域を含み、
前記補正手段は、前記別の被写体領域に含まれる画像信号のうち、前記高輝度領域の輝度を有する画像信号の割合に基づいて、前記第1のゲインを補正し、
前記割合が予め決められた閾値よりも高い場合に、該閾値以下の場合よりも前記第1のゲインを大きくすることを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。
The plurality of luminance regions include a high luminance region corresponding to a subject region having the highest representative luminance value among the plurality of subject regions,
The correction means corrects the first gain based on a ratio of an image signal having the luminance of the high-luminance region among image signals included in the different subject region,
5. The image processing apparatus according to claim 1, wherein when the ratio is higher than a predetermined threshold value, the first gain is made larger than when the ratio is equal to or lower than the threshold value. .
前記補正手段は、更に、前記高輝度領域に対応する前記1つの被写体領域の輝度と、前記別の被写体領域の輝度との差に基づいて、前記第1のゲインを補正し、
前記差が予め決められた閾値よりも大きい場合に、該閾値以下の場合よりも、前記第2のゲインの上限を大きくすることをすることを特徴とする請求項5に記載の画像処理装置。
The correction means further corrects the first gain based on a difference between a luminance of the one subject region corresponding to the high luminance region and a luminance of the another subject region,
The image processing apparatus according to claim 5, wherein when the difference is larger than a predetermined threshold, the upper limit of the second gain is set larger than when the difference is equal to or smaller than the threshold.
前記被写体領域は、少なくとも人物領域、背景領域、空領域を含むことを特徴とする請求項1乃至6のいずれか1項に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the subject area includes at least a person area, a background area, and a sky area. 前記補正手段は、更に、前記複数の被写体領域の優先度を決定し、該優先度に基づいて、前記第2のゲインを求めることを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。   The said correction | amendment means further determines the priority of these subject area | regions, and calculates | requires a said 2nd gain based on this priority, The one of Claim 1 thru | or 7 characterized by the above-mentioned. Image processing apparatus. 前記補正手段は、前記複数の被写体領域それぞれの面積に基づいて前記優先度を決定することを特徴とする請求項8に記載の画像処理装置。   The image processing apparatus according to claim 8, wherein the correction unit determines the priority based on an area of each of the plurality of subject regions. 分割手段が、入力した画像を、予め決められた条件に従って複数の被写体領域に分割する分割工程と、
算出手段が、前記分割した各被写体領域の輝度の分布に基づいて、前記画像の輝度を複数の輝度領域に分割する分割工程と、
前記算出手段が、前記複数の被写体領域のうち、前記分割した各輝度領域に対応する1つの被写体領域の代表輝度値に基づいて、前記輝度領域ごとに第1のゲインを算出する算出工程と、
補正手段が、前記複数の被写体領域のうち、前記輝度領域ごとに、対応する前記1つの被写体領域の輝度の分布と、当該輝度領域以外の少なくとも1つの輝度領域に対応する少なくとも1つの別の被写体領域の輝度の分布とに基づいて、前記第1のゲインを補正して、前記輝度領域ごとに第2のゲインを求める補正工程と、
変換手段が、前記第2のゲインを用いて、前記画像の輝度を変換する変換工程と
を有することを特徴とする画像処理方法。
A dividing step in which the dividing means divides the input image into a plurality of subject areas according to a predetermined condition;
A dividing step of dividing the luminance of the image into a plurality of luminance areas based on a luminance distribution of each of the divided subject areas;
A calculating step in which the calculation means calculates a first gain for each of the luminance regions based on a representative luminance value of one subject region corresponding to each of the divided luminance regions among the plurality of subject regions;
The correction means includes, for each of the plurality of subject areas, a brightness distribution of the corresponding one subject area and at least one other subject corresponding to at least one brightness area other than the brightness area. A correction step of correcting the first gain based on the luminance distribution of the region and obtaining a second gain for each of the luminance regions;
An image processing method, comprising: a conversion step in which conversion means converts the luminance of the image using the second gain.
コンピュータを、請求項1乃至のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。 The program for functioning a computer as each means of the image processing apparatus of any one of Claim 1 thru | or 9 . 請求項11に記載のプログラムを記憶したコンピュータが読み取り可能な記憶媒体。 A computer-readable storage medium storing the program according to claim 11 .
JP2014163929A 2014-08-11 2014-08-11 Image processing apparatus and method Active JP6397261B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014163929A JP6397261B2 (en) 2014-08-11 2014-08-11 Image processing apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014163929A JP6397261B2 (en) 2014-08-11 2014-08-11 Image processing apparatus and method

Publications (3)

Publication Number Publication Date
JP2016039614A JP2016039614A (en) 2016-03-22
JP2016039614A5 JP2016039614A5 (en) 2017-09-21
JP6397261B2 true JP6397261B2 (en) 2018-09-26

Family

ID=55530338

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014163929A Active JP6397261B2 (en) 2014-08-11 2014-08-11 Image processing apparatus and method

Country Status (1)

Country Link
JP (1) JP6397261B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018225360A1 (en) * 2017-06-08 2018-12-13 富士フイルム株式会社 Imaging device, control method for imaging device, and control program for imaging device
WO2022113917A1 (en) * 2020-11-27 2022-06-02 ソニーグループ株式会社 Imaging element, imaging method, and imaging device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6373533B1 (en) * 1997-03-06 2002-04-16 Matsushita Electric Industrial Co., Ltd. Image quality correction circuit for video signals
JP2006195651A (en) * 2005-01-12 2006-07-27 Sanyo Electric Co Ltd Gradation compensation device

Also Published As

Publication number Publication date
JP2016039614A (en) 2016-03-22

Similar Documents

Publication Publication Date Title
KR100990904B1 (en) The apparatus for enhancing image by generating and blending multiple image and method therefor
JP4622629B2 (en) Imaging device
JP6097588B2 (en) Image processing apparatus and image processing method
US9390482B2 (en) Image processing apparatus and method of processing image
JP6116272B2 (en) Image processing apparatus, image processing method, program, and storage medium
EP2911110A2 (en) Image signal processing apparatus, image signal processing method, and image capturing apparatus
JP6218389B2 (en) Image processing apparatus and image processing method
JP5887303B2 (en) Image signal processing apparatus, imaging apparatus, and image processing program
JP2014179756A (en) Image processing device, control method therefor and control program
US10218953B2 (en) Image processing apparatus, image processing method, and storage medium
EP3179716B1 (en) Image processing method, computer storage medium, device, and terminal
CN106575434B (en) Image processing apparatus, imaging apparatus, and image processing method
JP4879363B1 (en) Image processing system
JP6397261B2 (en) Image processing apparatus and method
JP5932392B2 (en) Image processing apparatus and image processing method
JP6080531B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP5591026B2 (en) Imaging apparatus and control method thereof
KR102199472B1 (en) Apparatus and method for processing image
JP5365881B2 (en) Image processing apparatus and image processing method
JP5520863B2 (en) Image signal processing device
JP2014098859A (en) Imaging apparatus and imaging method
JP5745482B2 (en) Image processing apparatus, image display apparatus, image imaging apparatus, image printing apparatus, gradation conversion method, and program
JP6423669B2 (en) Imaging apparatus and control method thereof
KR102170697B1 (en) Image processing apparatus and image processing method
JP2022112995A (en) Image processing method

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170810

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180425

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180507

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180621

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180831

R151 Written notification of patent or utility model registration

Ref document number: 6397261

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151