JP2015032966A - Image processing apparatus, imaging apparatus, control method, and program - Google Patents

Image processing apparatus, imaging apparatus, control method, and program Download PDF

Info

Publication number
JP2015032966A
JP2015032966A JP2013160792A JP2013160792A JP2015032966A JP 2015032966 A JP2015032966 A JP 2015032966A JP 2013160792 A JP2013160792 A JP 2013160792A JP 2013160792 A JP2013160792 A JP 2013160792A JP 2015032966 A JP2015032966 A JP 2015032966A
Authority
JP
Japan
Prior art keywords
image
correction
correction characteristic
main subject
setting
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
JP2013160792A
Other languages
Japanese (ja)
Inventor
駿 松井
Shun Matsui
駿 松井
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 JP2013160792A priority Critical patent/JP2015032966A/en
Publication of JP2015032966A publication Critical patent/JP2015032966A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus which generates an image in which a main subject is expressed in a suitable gradation range.SOLUTION: An image processing apparatus detects a main subject from an image to be corrected and sets a first correction characteristic for expanding gradation width larger in a luminance range including more pixels to be classified, on the basis of luminance distribution of an image obtained by weighting the main subject. Further, the image processing apparatus sets a second correction characteristic for expanding the gradation width larger in an area having a high focusing degree, on the basis of a luminance distribution of an image obtained by weighting the area having the high focusing degree. Then the image processing apparatus corrects the gradation of the image, on the basis of a third correction characteristic composed by weighting the first correction characteristic and the second correction characteristic.

Description

本発明は、画像処理装置、撮像装置、制御方法、及びプログラムに関し、特に画像における階調範囲を補正する技術に関する。   The present invention relates to an image processing apparatus, an imaging apparatus, a control method, and a program, and more particularly to a technique for correcting a gradation range in an image.

デジタルカメラ等の撮像装置を使用して撮影を行う場合、逆光シーンにおける撮影では、主要被写体が暗く、該被写体以外の背景や空が明るい画像が得られることになる。即ち、主要被写体の画像について割り当てられる階調の幅が狭くなる。一般に、このような画像に対しては階調補正処理を適用し、コントラストが強調されるように画像の補正が行われる。例えば、画像に含まれる画素について生成された輝度値ヒストグラムについて、頻度が高い輝度値周辺の画素の階調範囲が拡大されるような階調補正曲線が決定され、該曲線に従って階調補正が行われる。   When shooting using an imaging device such as a digital camera, in shooting in a backlight scene, an image in which the main subject is dark and the background and sky other than the subject are bright is obtained. That is, the gradation range assigned to the main subject image is narrowed. In general, gradation correction processing is applied to such an image, and the image is corrected so that the contrast is enhanced. For example, with respect to the luminance value histogram generated for the pixels included in the image, a gradation correction curve is determined so that the gradation range of pixels around the luminance value with high frequency is expanded, and gradation correction is performed according to the curve. Is called.

しかしながら、このような基準で階調範囲を拡大する場合、主要被写体が画像において占有している面積によっては、主要被写体の輝度値が階調範囲の拡大対象とならないことがある。即ち、主要被写体以外の被写体が多くの面積を占有する場合、該被写体の輝度値が拡大対象となるため、逆に主要被写体の画素の階調範囲が狭められてしまう可能性があった。   However, when the gradation range is expanded based on such a reference, the luminance value of the main subject may not be the target of expansion of the gradation range depending on the area occupied by the main subject in the image. That is, when a subject other than the main subject occupies a large area, the luminance value of the subject becomes an object to be enlarged, and conversely, the gradation range of the pixel of the main subject may be narrowed.

また、画像内で、空のような輝度値の変動幅が狭い被写体の占有する面積が大きい場合、上述のような階調補正手法では、該被写体に不要な階調範囲が割り当てられる可能性があった。   In addition, when an area occupied by a subject with a small brightness fluctuation range such as the sky is large in the image, the tone correction method as described above may assign an unnecessary tone range to the subject. there were.

このような問題に対し、特許文献1には、階調の変動幅が大きくかつエッジ量の多い領域に重みをおいた階調補正曲線を生成することで、被写体の面積に依存しない階調補正を実現する手法が開示されている。   In order to solve such a problem, Japanese Patent Application Laid-Open No. H10-228561 generates a tone correction curve weighted in a region having a large tone fluctuation range and a large amount of edge, thereby correcting the tone without depending on the area of the subject. A technique for realizing the above is disclosed.

特開2010−130150号公報JP 2010-130150 A

しかしながら、特許文献1に記載の手法では、主要被写体以外の被写体が画像内で占有する面積が広く、かつ該被写体のエッジ量が多い場合、主要被写体以外の被写体に対して階調範囲の拡大が行われる可能性があった。   However, in the method described in Patent Document 1, when the area occupied by a subject other than the main subject is large in the image and the edge amount of the subject is large, the gradation range is expanded with respect to the subject other than the main subject. Could be done.

本発明は、上述の問題点に鑑みてなされたものであり、主要被写体が好適な階調範囲で表現された画像を生成する画像処理装置、撮像装置、制御方法、及びプログラムを提供することを目的とする。   The present invention has been made in view of the above-described problems, and provides an image processing apparatus, an imaging apparatus, a control method, and a program that generate an image in which a main subject is expressed in a suitable gradation range. Objective.

前述の目的を達成するために、本発明の画像処理装置は、以下の構成を備えることを特徴とする。具体的には画像処理装置は、補正対象の画像を取得する取得手段と、取得手段により取得された画像から主要被写体を検出する検出手段と、主要被写体に重み付けして得られた画像の輝度分布に基づき、分類される画素が多い輝度範囲ほど階調幅を拡張する第1の補正特性を設定する第1の設定手段と、合焦度合いが高い領域に重み付けして得られた画像の輝度分布に基づき、合焦度合いが高い領域ほど階調幅を拡張する第2の補正特性を設定する第2の設定手段と、第1の設定手段により設定された第1の補正特性と、第2の設定手段により設定された第2の補正特性とを重み付け合成した第3の補正特性に基づいて画像の階調を補正する補正手段と、を有することを特徴とする。   In order to achieve the above object, an image processing apparatus of the present invention is characterized by having the following configuration. Specifically, the image processing apparatus includes an acquisition unit that acquires an image to be corrected, a detection unit that detects a main subject from the image acquired by the acquisition unit, and a luminance distribution of an image obtained by weighting the main subject. The first setting means for setting the first correction characteristic for expanding the gradation width in the luminance range with more classified pixels, and the luminance distribution of the image obtained by weighting the region with a high degree of focus Based on the second setting means for setting the second correction characteristic for expanding the gradation width as the focus degree is higher, the first correction characteristic set by the first setting means, and the second setting means. Correction means for correcting the gradation of the image based on a third correction characteristic obtained by weighting and combining the second correction characteristic set by the above.

このような構成により本発明によれば、主要被写体が好適な階調範囲で表現された画像を生成することが可能となる。   With such a configuration, according to the present invention, it is possible to generate an image in which the main subject is expressed in a suitable gradation range.

本発明の実施形態に係るデジタルカメラ100の機能構成を示したブロック図1 is a block diagram showing a functional configuration of a digital camera 100 according to an embodiment of the present invention. 本発明の実施形態に係る画像処理部104の内部構成を示したブロック図The block diagram which showed the internal structure of the image process part 104 which concerns on embodiment of this invention. 本発明の実施形態に係る階調変換部203の詳細構成を示したブロック図The block diagram which showed the detailed structure of the gradation conversion part 203 which concerns on embodiment of this invention. 本発明の実施形態に係る画像処理部104において実行される階調補正処理を例示したフローチャートThe flowchart which illustrated the gradation correction process performed in the image process part 104 which concerns on embodiment of this invention. 本発明の実施形態に係る空領域の判定に係る信頼度を説明するための図The figure for demonstrating the reliability which concerns on determination of the empty area | region which concerns on embodiment of this invention 本発明の実施形態に係る第1曲線算出部302において実行される補正曲線決定処理(第1)を例示したフローチャートThe flowchart which illustrated the correction curve determination process (1st) performed in the 1st curve calculation part 302 which concerns on embodiment of this invention. 本発明の実施形態に係る逆光シーンを例示した図The figure which illustrated the backlit scene concerning the embodiment of the present invention 本発明の実施形態に係る被写体種類に応じて分割された領域ごとの輝度ヒストグラムを例示した図The figure which illustrated the brightness | luminance histogram for every area | region divided | segmented according to the to-be-photographed object type concerning embodiment of this invention. 本発明の実施形態に係る被写体種類の分布に応じて生成された輝度ヒストグラムを例示した図The figure which illustrated the brightness | luminance histogram produced | generated according to distribution of the to-be-photographed object type which concerns on embodiment of this invention 本発明の実施形態に係る被写体種類の分布に応じて決定された第1の階調補正曲線を例示した図The figure which illustrated the 1st gradation correction curve determined according to distribution of the photographic subject type concerning an embodiment of the present invention. 本発明の実施形態に係る第2曲線算出部304において実行される補正曲線決定処理(第2)を例示したフローチャートThe flowchart which illustrated the correction curve determination process (2nd) performed in the 2nd curve calculation part 304 which concerns on embodiment of this invention. 図7の逆光シーンに対応するエッジ量分布を例示した図The figure which illustrated edge amount distribution corresponding to the backlight scene of FIG. 本発明の実施形態に係る合焦度合いに応じて分割された領域ごとの輝度ヒストグラムを例示した図The figure which illustrated the brightness | luminance histogram for every area | region divided | segmented according to the focus degree which concerns on embodiment of this invention. 本発明の実施形態に係る合焦度合いの分布に応じて生成された輝度ヒストグラムを例示した図The figure which illustrated the brightness | luminance histogram produced | generated according to distribution of the focus degree which concerns on embodiment of this invention 本発明の実施形態に係る合焦度合いの分布に応じて決定された第2の階調補正曲線Second gradation correction curve determined according to the distribution of the degree of focus according to the embodiment of the present invention 本発明の実施形態に係る比率算出部305において実行される比率決定処理を例示したフローチャートThe flowchart which illustrated the ratio determination process performed in the ratio calculation part 305 which concerns on embodiment of this invention 本発明の実施形態に係る人物信頼度と第1の領域分割信頼度との関係を例示した図The figure which illustrated the relationship between the person reliability which concerns on embodiment of this invention, and 1st area division | segmentation reliability 本発明の実施形態に係るエッジ量の差分と第2の領域分割信頼度との関係を例示した図The figure which illustrated the relationship between the difference of the edge amount which concerns on embodiment of this invention, and 2nd area | region division reliability. 本発明の実施形態に係る加重加算判定信号と加重加算比率の関係を例示した図The figure which illustrated the relation between the weighted addition judgment signal and weighted addition ratio concerning an embodiment of the present invention 本発明の実施形態に係る逆光シーンを例示した別の図Another diagram illustrating a backlight scene according to an embodiment of the present invention 本発明の実施形態に係る逆光シーンを例示したさらに別の図Still another diagram illustrating a backlight scene according to an embodiment of the present invention.

[実施形態]
以下、本発明の例示的な実施形態について、図面を参照して詳細に説明する。なお、以下に説明する一実施形態は、画像処理装置の一例としての、入力された画像について階調補正処理を適用可能なデジタルカメラに、本発明を適用した例を説明する。しかし、本発明は、入力された画像について階調補正処理を適用することが可能な任意の機器に適用可能である。
[Embodiment]
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the drawings. In the following embodiment, an example in which the present invention is applied to a digital camera that can apply gradation correction processing to an input image as an example of an image processing apparatus will be described. However, the present invention can be applied to any device that can apply gradation correction processing to an input image.

《デジタルカメラ100の構成》
図1は、本発明の実施形態に係るデジタルカメラ100の機能構成を示すブロック図である。
<< Configuration of Digital Camera 100 >>
FIG. 1 is a block diagram showing a functional configuration of a digital camera 100 according to an embodiment of the present invention.

制御部106は、例えばCPUやマイクロコンピュータ等の制御装置である。制御部106は、デジタルカメラ100が有する各ブロックの動作を制御する。具体的には制御部106は、不図示のROMに格納されている各ブロックの動作プログラムを読み出し、RAMに展開して実行することにより、各ブロックの動作を制御する。   The control unit 106 is a control device such as a CPU or a microcomputer. The control unit 106 controls the operation of each block included in the digital camera 100. Specifically, the control unit 106 reads out an operation program of each block stored in a ROM (not shown), develops it in the RAM, and executes it to control the operation of each block.

撮像素子102は、例えばCCDやCMOSセンサ等の2次元配列の光電変換素子で構成された撮像素子である。撮像素子102は、光学系101により撮像面に結像された光学像を光電変換し、アナログ画像信号を出力する。光学系101には、フォーカスレンズや絞り、シャッタ等が含まれ、各光学部材は撮影時の露光量の調節のために駆動制御される。具体的には撮影時において、フォーカスレンズは被写体に合焦する位置に駆動され、撮影環境の光量や露光時間に応じて絞り及びシャッタが駆動制御される。A/D変換部103は、撮像素子102により出力されたアナログ画像信号をデジタルデータである画像信号(画像)に変換するA/D変換処理を適用する。   The image sensor 102 is an image sensor composed of a two-dimensional array of photoelectric conversion elements such as a CCD and a CMOS sensor. The image sensor 102 photoelectrically converts the optical image formed on the imaging surface by the optical system 101 and outputs an analog image signal. The optical system 101 includes a focus lens, a diaphragm, a shutter, and the like, and each optical member is driven and controlled to adjust the exposure amount at the time of photographing. Specifically, at the time of shooting, the focus lens is driven to a position where the subject is focused, and the diaphragm and shutter are driven and controlled according to the light amount and exposure time of the shooting environment. The A / D conversion unit 103 applies A / D conversion processing that converts an analog image signal output from the image sensor 102 into an image signal (image) that is digital data.

画像処理部104は、画像信号に対してホワイトバランス補正処理、階調補正処理等の種々の画像処理を適用する。記録用の画像処理が適用された画像は、記録部105に伝送された後、JPEGやMOV等の所定の記録形式に変換されて不図示の記録媒体に記録される。   The image processing unit 104 applies various image processing such as white balance correction processing and gradation correction processing to the image signal. An image to which image processing for recording is applied is transmitted to the recording unit 105, converted into a predetermined recording format such as JPEG or MOV, and recorded on a recording medium (not shown).

〈画像処理部104の構成〉
ここで、本実施形態の画像処理部104の内部構成について、図2を用いて説明する。
<Configuration of Image Processing Unit 104>
Here, the internal configuration of the image processing unit 104 of the present embodiment will be described with reference to FIG.

撮像によりA/D変換部103から出力された画像信号が画像処理部104に入力されると、画像信号はホワイトバランス補正部201においてゲイン処理が適用される。具体的には、例えば撮像素子が原色のベイヤー配列である場合、R、G1、G2、Bの画素信号のそれぞれに対して異なるゲインを乗じる。ゲインの算出方法については、例えば特許第3513506号に開示されている技術を用いて算出すればよい。該文献では、画像を複数の分割領域に分割し、各分割領域の位置に応じた条件に基づいて各分割領域内の画像データが白色であるかを判断する。そして白色であると判断された分割領域の画像データに基づいてホワイトバランス補正時のゲインを算出し、各信号に適用する。本実施形態では、特許第3513506号に開示の手法を用いてホワイトバランス補正時のゲインを算出するものとして説明するが、公知の他の手法を用いてゲインは算出されるものであってもよい。   When an image signal output from the A / D conversion unit 103 by imaging is input to the image processing unit 104, the white balance correction unit 201 applies gain processing to the image signal. Specifically, for example, when the imaging device has a primary color Bayer array, the R, G1, G2, and B pixel signals are multiplied by different gains. The gain calculation method may be calculated using, for example, the technique disclosed in Japanese Patent No. 3513506. In this document, an image is divided into a plurality of divided areas, and it is determined whether the image data in each divided area is white based on a condition corresponding to the position of each divided area. Then, the gain at the time of white balance correction is calculated based on the image data of the divided area determined to be white, and is applied to each signal. In the present embodiment, description is made assuming that the gain at the time of white balance correction is calculated using the method disclosed in Japanese Patent No. 3513506, but the gain may be calculated using another known method. .

ホワイトバランス補正がなされた画像信号(ベイヤー画像信号)は、第1信号変換部202に入力される。第1信号変換部202は、入力されたベイヤー画像信号から、輝度信号Yと色相信号Hを変換により生成する。ベイヤー画像信号から各信号への変換は、例えば以下の式(1)及び(2)を用いて行う。
Y=0.299×R+0.587×G+0.114×B ・・・(1)
ここで、G信号の値は、変換対象の画素信号に対応するG1信号とG2信号の加算平均により算出される値であってよい。第1信号変換部202は、入力されたベイヤー画像信号、及び生成した輝度信号Y及び色相信号Hを階調変換部203に出力する。
The image signal (Bayer image signal) subjected to white balance correction is input to the first signal conversion unit 202. The first signal conversion unit 202 generates a luminance signal Y and a hue signal H from the input Bayer image signal by conversion. Conversion from the Bayer image signal to each signal is performed using, for example, the following equations (1) and (2).
Y = 0.299 × R + 0.587 × G + 0.114 × B (1)
Here, the value of the G signal may be a value calculated by averaging the G1 signal and the G2 signal corresponding to the pixel signal to be converted. The first signal conversion unit 202 outputs the input Bayer image signal and the generated luminance signal Y and hue signal H to the gradation conversion unit 203.

階調変換部203は、入力されたベイヤー画像信号、輝度信号、及び色相信号を用いて後述の階調補正処理を実行し、主要被写体の階調範囲を好適に拡大したベイヤー画像信号を出力する。   The tone conversion unit 203 performs tone correction processing described later using the input Bayer image signal, luminance signal, and hue signal, and outputs a Bayer image signal in which the tone range of the main subject is suitably expanded. .

第2信号変換部204は、階調変換部203において階調補正が適用されたベイヤー信号をYUV色空間の画像信号(Y信号、U信号、及びV信号)に変換して出力する。例えばベイヤー信号からY信号への変換は式(1)を使用し、U信号及びV信号への変換は以下の式(3)及び(4)を用いて行う。
U=0.169×R−0.331×G+0.500×B ・・・(3)
V=0.500×R−0.419×G+0.081×B ・・・(4)
The second signal conversion unit 204 converts the Bayer signal to which the gradation correction is applied in the gradation conversion unit 203 into an image signal (Y signal, U signal, and V signal) in the YUV color space and outputs the image signal. For example, the conversion from the Bayer signal to the Y signal is performed using the expression (1), and the conversion to the U signal and the V signal is performed using the following expressions (3) and (4).
U = 0.169 × R−0.331 × G + 0.500 × B (3)
V = 0.500 × R−0.419 × G + 0.081 × B (4)

操作部107は、レリーズボタンや十字キー等のデジタルカメラ100が有するユーザインタフェースである。操作部107は、ユーザインタフェースがユーザにより操作されたことを検出すると、対応する制御信号を制御部106に出力する。   The operation unit 107 is a user interface of the digital camera 100 such as a release button or a cross key. When the operation unit 107 detects that the user interface is operated by the user, the operation unit 107 outputs a corresponding control signal to the control unit 106.

表示部108は、例えばLCD等のデジタルカメラ100が有する表示装置である。表示部108は、撮像により得られた画像信号や記録媒体から読み出された画像信号を表示する。また表示部108は、撮影時の操作の補助用途として、操作に係る情報提示を行うために用いられる。   The display unit 108 is a display device included in the digital camera 100 such as an LCD. The display unit 108 displays an image signal obtained by imaging or an image signal read from a recording medium. The display unit 108 is used to present information related to the operation as an auxiliary use of the operation at the time of shooting.

《階調補正処理》
このような構成をもつ本実施形態のデジタルカメラ100において実行される階調補正処理について、階調変換部203の詳細構成を示した図3、及び図4のフローチャートを用いて具体的な処理を説明する。なお、本階調補正処理は、例えば撮像により得られた画像信号が階調変換部203に入力された際に開始されるものとして説明する。
<Tone correction processing>
With respect to the gradation correction processing executed in the digital camera 100 of the present embodiment having such a configuration, specific processing is performed using the flowcharts of FIGS. 3 and 4 showing the detailed configuration of the gradation conversion unit 203. explain. The gradation correction process will be described as being started when, for example, an image signal obtained by imaging is input to the gradation conversion unit 203.

S401で、種類別分割部301は、輝度信号と色相信号とに基づいて、画像に含まれる被写体を種類ごとに分類し、該分類に応じて画像の領域を分割する。本実施形態では種類別分割部301は、主要被写体である人物と、空、空以外の背景との3種類に被写体を分類する。   In step S401, the type dividing unit 301 classifies subjects included in the image for each type based on the luminance signal and the hue signal, and divides the image area according to the classification. In the present embodiment, the type dividing unit 301 classifies subjects into three types: a person who is a main subject and a background other than the sky and the sky.

具体的には種類別分割部301はまず、画像を複数のブロックに分割し、各ブロックについて輝度、色相、エッジ量に基づいて空である領域を特定する。空領域であるか否かの判定は、例えばブロックについて取得された輝度、色相、及びエッジ量の各々が空領域とみなす輝度範囲、色相範囲、エッジ量に合致する度合いに応じて設定された信頼度に応じて行われる。信頼度の算出は、例えば図5(a)乃至(c)に示されるように輝度が所定の輝度値以上高く、色相が所定の色相範囲にあり、エッジ量が所定のエッジ量より少ないほど高くなるように設定された計算式に応じて行われる。即ち、輝度、色相、及びエッジ量の各々について算出された信頼度a乃至cを乗じることにより、最終的な領域についての信頼度Rsが算出される。なお、図5に示されるような信頼度決定に係るパラメータY1、Y2、H1乃至H4、E1、及びE2は、実験値や理論値に応じて任意に決められるものであってよい。   Specifically, the type dividing unit 301 first divides an image into a plurality of blocks, and specifies an empty region for each block based on luminance, hue, and edge amount. Whether or not it is a sky region is determined by, for example, the reliability set according to the degree of matching of the luminance range, hue range, and edge amount acquired for the block with the luminance range, hue range, and edge amount regarded as the sky region. Depending on the degree. For example, as shown in FIGS. 5A to 5C, the reliability is calculated higher when the luminance is higher than a predetermined luminance value, the hue is in a predetermined hue range, and the edge amount is smaller than the predetermined edge amount. This is performed according to the calculation formula set to be. That is, the reliability Rs for the final region is calculated by multiplying the reliability a to c calculated for each of the luminance, hue, and edge amount. Note that the parameters Y1, Y2, H1 to H4, E1, and E2 for determining reliability as shown in FIG. 5 may be arbitrarily determined according to experimental values or theoretical values.

また種類別分割部301は、主要被写体である人物の領域を、例えば特開2009−059326号公報に記載される手法を用いて特定する。具体的には種類別分割部301は、人物候補領域の検出結果に対して、人物と同色相の領域の数、人物領域内の輝度差、顔の面積、被写界の輝度(測光値)、及びフラッシュ発光の有無の情報のそれぞれについて信頼度を算出し、計5つの信頼度を算出する。そして種類別分割部301は、得られた5つの信頼度を乗じることで、検出結果の信頼度である人物信頼度Rhを取得し、該信頼度に応じて領域が人物領域であるか否かを判定する。   Further, the type division unit 301 identifies the area of the person who is the main subject using a technique described in, for example, Japanese Patent Application Laid-Open No. 2009-059326. Specifically, the type division unit 301 determines the number of regions having the same hue as the person, the luminance difference in the person region, the face area, and the luminance of the object scene (photometric value) for the detection result of the human candidate region. The reliability is calculated for each of the information on the presence or absence of flash emission, and a total of five reliability levels are calculated. Then, the type dividing unit 301 multiplies the obtained five reliability levels to obtain a person reliability level Rh that is a reliability level of the detection result, and whether or not the area is a person area according to the reliability level. Determine.

また種類別分割部301は、空領域及び人物領域のいずれにも属さない領域を、空以外の背景である領域として分類する。   Further, the type division unit 301 classifies an area that does not belong to either the sky area or the person area as an area that is a background other than the sky.

S402で、第1曲線算出部302は、補正曲線決定処理(第1)を実行し、画像における種類ごとの被写体の分布に基づく第1の階調補正曲線を決定する。   In S402, the first curve calculation unit 302 executes a correction curve determination process (first), and determines a first gradation correction curve based on the distribution of the subject for each type in the image.

〈補正曲線決定処理(第1)〉
ここで、本実施形態の補正曲線決定処理(第1)について、図6のフローチャートを参照して詳細を説明する。
<Correction curve determination process (first)>
Here, the correction curve determination process (first) of the present embodiment will be described in detail with reference to the flowchart of FIG.

S601で、第1曲線算出部302は、種類別分割部301において分割された領域ごとに輝度ヒストグラムを生成する。例えば図7のような逆光シーン(黒の色味が強いほど輝度の低さを示す)で撮影した画像において、図のように領域の分類がなされた場合、各領域についての輝度ヒストグラムは図8(a)乃至(c)のようになる。種類別分割部301は、生成されたそれぞれの輝度ヒストグラムを参照し、単純に面積の大きい領域が階調補正において支配的とならないよう、各輝度ヒストグラムの頻度を領域の面積に応じて除することで正規化する。   In step S <b> 601, the first curve calculation unit 302 generates a luminance histogram for each region divided by the type division unit 301. For example, in the case of an image taken in a backlight scene as shown in FIG. 7 (indicating that the luminance is lower as the black color is stronger), when the regions are classified as shown in FIG. 8, the luminance histogram for each region is shown in FIG. It becomes like (a) thru | or (c). The type division unit 301 refers to each of the generated luminance histograms, and simply divides the frequency of each luminance histogram according to the area of the area so that the area with a large area is not dominant in the gradation correction. Normalize with.

S602で、第1曲線算出部302は、正規化された各被写体についての輝度ヒストグラムを、主要被写体に重みを置いて加重加算する。加重加算における各被写体の重みは、第1曲線算出部302が画像全体の階調バランスを考慮することで決定される。例えば図8(a)では人物領域が低輝度範囲に分布しているが、このとき主要被写体である人物領域のヒストグラムに重点を置いた場合、図9のような輝度ヒストグラムが加重加算により得られる。各ヒストグラムに乗じられる重みは、例えば人物領域:空以外の背景領域:空領域=6:3:1のように予め定められたバランスで決定されてもよいし、各領域の占有する面積の割合を考慮して決定されてもよい。   In step S <b> 602, the first curve calculation unit 302 performs weighted addition on the normalized luminance histogram for each subject while placing a weight on the main subject. The weight of each subject in the weighted addition is determined by the first curve calculation unit 302 considering the gradation balance of the entire image. For example, in FIG. 8A, the person area is distributed in the low luminance range. At this time, when emphasis is placed on the histogram of the person area as the main subject, a luminance histogram as shown in FIG. 9 is obtained by weighted addition. . The weight multiplied by each histogram may be determined with a predetermined balance, for example, person area: background area other than sky: sky area = 6: 3: 1, or the ratio of the area occupied by each area May be determined in consideration of

S603で、第1曲線算出部302は、S602における加重加算により得られた輝度ヒストグラムを参照し、該ヒストグラムにおいて頻度の高い輝度範囲の階調幅が広くなる第1の階調補正曲線を決定する。本実施形態では加重加算により得られた輝度ヒストグラムを図9のような3つの輝度範囲に分け、第1曲線算出部302は各輝度範囲について割り当てる階調の幅を設定することで第1の階調補正曲線を決定する。各輝度範囲に割り当てる階調の幅Iは、各輝度範囲の画素数N(i=1〜3)を画像の総画素数で除した値に全階調幅(本実施形態では10ビット)を乗じる
により決定される。このようにして各輝度範囲に割り当てる階調幅が決定されると、図10に示されるように補正の前後での輝度値の対応を示す第1の階調補正曲線が得られる。即ち、図10に示されるように、頻度が高くなるように重みづけられた低輝度範囲の人物領域の画素に対して割り当てられる階調幅が広くなり、反対に、もともと階調幅の狭い空領域の階調幅を不要に拡張しないように補正する曲線を設定することができる。
In step S603, the first curve calculation unit 302 refers to the luminance histogram obtained by the weighted addition in step S602, and determines a first gradation correction curve in which the gradation width of a high-frequency luminance range is widened in the histogram. In this embodiment, the luminance histogram obtained by the weighted addition is divided into three luminance ranges as shown in FIG. 9, and the first curve calculation unit 302 sets the gradation width to be assigned to each luminance range, thereby setting the first floor. Determine the tone correction curve. The gradation width I i assigned to each luminance range is a value obtained by dividing the number of pixels N i (i = 1 to 3) of each luminance range by the total number of pixels of the image, and the total gradation width (10 bits in this embodiment). Multiply by
Determined by. When the gradation width to be assigned to each luminance range is determined in this way, a first gradation correction curve indicating the correspondence between the luminance values before and after correction is obtained as shown in FIG. That is, as shown in FIG. 10, the gradation width assigned to the pixels in the low brightness range human area weighted so as to increase in frequency is widened. A curve to be corrected so as not to unnecessarily expand the gradation width can be set.

なお、入力側の輝度範囲の分割は、例えば図8のように被写体分類ごとに生成した輝度ヒストグラムにおける画素数の比率に応じて決定されてよい。また、本実施形態では入力側の輝度範囲の分割数を3として設定したが、本発明の実施はこれに限られるものではなく、3以上の数が設定されてもよい。   The division of the luminance range on the input side may be determined according to the ratio of the number of pixels in the luminance histogram generated for each subject classification as shown in FIG. 8, for example. In this embodiment, the number of divisions of the luminance range on the input side is set to 3. However, the embodiment of the present invention is not limited to this, and a number of 3 or more may be set.

また階調補正処理のS403で、合焦度合別分割部303は、撮影された画像信号における合焦状態あるいは画像信号のエッジ量の情報に基づき、合焦度合いに応じて画像の領域を分割する。本実施形態では、エッジ量の情報に基づいて合焦度合いを判断する場合の例について説明する。合焦度合別分割部303は、入力された輝度信号に対して例えば[−1,0,2,0,−1]のようなフィルタを適用することでエッジ画像を生成する。そして、該画像を分割したブロックごとに合計エッジ量を取得し、合焦度合いが予め定めたいずれの段階に分類されるかを特定する。なお、エッジ量算出の際、低輝度領域の被写体についてのエッジ量が少なくなる傾向があるため、領域の輝度に基づいて正規化を行った上で合焦度合別分割部303は分類を行うものとする。   In step S403 of the gradation correction process, the focus degree classification division unit 303 divides the image area in accordance with the degree of focus based on the information on the focus state in the captured image signal or the edge amount of the image signal. . In the present embodiment, an example in which the degree of focusing is determined based on edge amount information will be described. The focusing degree division division unit 303 generates an edge image by applying a filter such as [-1, 0, 2, 0, -1] to the input luminance signal. Then, the total edge amount is acquired for each block obtained by dividing the image, and it is specified in which stage the degree of focus is classified. Note that, when calculating the edge amount, the edge amount of the subject in the low-luminance area tends to be small, so the focusing degree division division unit 303 performs classification after normalizing based on the luminance of the area. And

S404で、第2曲線算出部304は、補正曲線決定処理(第2)を実行し、画像における合焦度合いに応じた領域分布に基づく第2の階調補正曲線を決定する。   In S404, the second curve calculation unit 304 executes a correction curve determination process (second), and determines a second tone correction curve based on the region distribution according to the degree of focus in the image.

〈補正曲線決定処理(第2)〉
ここで、本実施形態の補正曲線決定処理(第2)について、図11のフローチャートを参照して詳細を説明する。
<Correction curve determination process (second)>
Here, the correction curve determination process (second) of the present embodiment will be described in detail with reference to the flowchart of FIG.

S1101で、第2曲線算出部304は、合焦度合別分割部303において分割された領域ごとに輝度ヒストグラムを生成する。本実施形態では、エッジ量に基づく合焦度合いを5段階に定め、図7の逆光シーンの画像信号が、図12のように空以外の背景領域にエッジ量が多い領域に分類されたケースについて説明する。該ケースにおいて、各合焦度合いの領域についての輝度ヒストグラムは図13のようになる。   In step S <b> 1101, the second curve calculation unit 304 generates a luminance histogram for each region divided by the focusing degree classification division unit 303. In this embodiment, the degree of focus based on the edge amount is set to 5 levels, and the image signal of the backlight scene in FIG. 7 is classified into a region with a large edge amount in the background region other than the sky as shown in FIG. explain. In this case, the luminance histogram for each in-focus area is as shown in FIG.

S1102で、第2曲線算出部304は、各合焦度合いの領域の輝度ヒストグラムを、合焦度合いの高い領域、即ち正規化されたエッジ量が多い領域ほど大きい重みを付して加重加算する。図12の例において領域5に最も高い重みが付されるようにして、図13(a)乃至(e)の輝度ヒストグラムを加重加算した場合、例えば図14のような輝度ヒストグラムが得られる。各ヒストグラムに乗じられる重みは、例えば領域5:領域4:領域3:領域2:領域1=5:4:3:2:1のように予め定められたバランスで決定されてもよいし、各領域の占有する面積の割合を考慮して決定されてもよい。   In step S1102, the second curve calculation unit 304 weights and adds the luminance histogram of each in-focus degree area to a higher in-focus area, that is, an area with a larger normalized edge amount. In the example of FIG. 12, when the luminance histograms of FIGS. 13A to 13E are weighted and added so that the region 5 is given the highest weight, a luminance histogram as shown in FIG. 14 is obtained, for example. The weight to be multiplied by each histogram may be determined with a predetermined balance such as, for example, region 5: region 4: region 3: region 2: region 1 = 5: 4: 3: 2: 1 It may be determined in consideration of the ratio of the area occupied by the region.

S1103で、第2曲線算出部304は、S1102における加重加算により得られた輝度ヒストグラムを参照し、該ヒストグラムにおいて頻度の高い輝度範囲の階調幅が広くなる第2の階調補正曲線を決定する。本実施形態では加重加算により得られた輝度ヒストグラムを図14のような3つの輝度範囲に分け、第2曲線算出部304は各輝度範囲について割り当てる階調幅を上述の式(5)を用いて決定する。そして第2曲線算出部304は、決定した各輝度範囲に割り当てる輝度幅に応じて、図15に示されるような補正の前後での輝度値の対応を示す第2の階調補正曲線を取得する。図14の例では、空以外の背景領域がエッジ量の多い輝度範囲に分布しているため、図15のように空以外の背景領域に対して割り当てられる輝度の階調幅が広く設定された階調補正曲線が得られる。   In step S1103, the second curve calculation unit 304 refers to the luminance histogram obtained by the weighted addition in step S1102, and determines a second gradation correction curve in which the gradation width of the high-frequency luminance range is widened in the histogram. In the present embodiment, the luminance histogram obtained by weighted addition is divided into three luminance ranges as shown in FIG. 14, and the second curve calculation unit 304 determines the gradation width to be assigned to each luminance range using the above-described equation (5). To do. Then, the second curve calculation unit 304 acquires a second gradation correction curve indicating the correspondence between the luminance values before and after the correction as shown in FIG. 15 according to the luminance width assigned to each determined luminance range. . In the example of FIG. 14, background areas other than the sky are distributed in a luminance range with a large amount of edge, so that the gradation level assigned to the background area other than the sky as shown in FIG. A tone correction curve is obtained.

また階調補正処理のS405で、比率算出部305は比率決定処理を実行し、第1曲線算出部302及び第2曲線算出部304により実行された補正曲線決定処理により得られた第1及び第2の階調補正曲線の合成比率を決定する。   In S405 of the gradation correction process, the ratio calculation unit 305 executes the ratio determination process, and the first and first curve obtained by the correction curve determination process executed by the first curve calculation unit 302 and the second curve calculation unit 304 are performed. The synthesis ratio of the gradation correction curve of 2 is determined.

〈比率決定処理〉
ここで、被写体種類の分布に応じて決定された第1の階調補正曲線と、合焦度合いに応じて決定された第2の階調補正曲線との合成比率を決定する、本実施形態の比率決定処理について図16のフローチャートを参照して詳細を説明する。
<Ratio determination processing>
Here, the composition ratio of the first gradation correction curve determined according to the distribution of the subject type and the second gradation correction curve determined according to the degree of focus is determined. Details of the ratio determination processing will be described with reference to the flowchart of FIG.

S1601で、比率算出部305は、補正曲線決定処理(第1)のS401において算出された人物領域の信頼度Rhに基づき、第1の領域分割信頼度を算出する。具体的には比率算出部305は、図17のような人物信頼度Rhと第1の領域分割信頼度の関係式に基づいて、人物信頼度Rhに対応する第1の領域分割信頼度を取得する。第1の領域分割信頼度は、図17に示されるように、人物信頼度が高いほど高くなる値とする。   In S1601, the ratio calculation unit 305 calculates the first region division reliability based on the human region reliability Rh calculated in S401 of the correction curve determination process (first). Specifically, the ratio calculation unit 305 acquires the first region division reliability corresponding to the person reliability Rh based on the relational expression between the person reliability Rh and the first region division reliability as shown in FIG. To do. As shown in FIG. 17, the first region division reliability is a value that increases as the person reliability increases.

S1602で、比率算出部305は、人物領域とそれ以外の領域のエッジ量の差に基づき、第2の領域分割信頼度を算出する。具体的には比率算出部305は、輝度信号から生成したエッジ画像を用いて2つの領域のエッジ量を取得した後、それぞれ対応領域の面積で正規化することで、単位面積当たりのエッジ量の差分を算出する。そして比率算出部305は、図18のようなエッジ量の差分と第2の領域分割信頼度との関係式に基づいて、算出したエッジ量の差分に対応する第2の領域分割信頼度を取得する。第2の領域分割信頼度は、図18に示されるように、エッジ量の差分が小さいほど高くなる値とする。   In step S1602, the ratio calculation unit 305 calculates the second region division reliability based on the difference in edge amount between the person region and the other regions. Specifically, the ratio calculation unit 305 obtains the edge amounts of the two regions using the edge image generated from the luminance signal, and then normalizes each of the corresponding regions to obtain the edge amount per unit area. Calculate the difference. Then, the ratio calculation unit 305 acquires the second region division reliability corresponding to the calculated edge amount difference based on the relational expression between the edge amount difference and the second region division reliability as illustrated in FIG. To do. As shown in FIG. 18, the second region division reliability is set to a value that increases as the difference in edge amount decreases.

S1603で、比率算出部305は、第1及び第2の領域分割信頼度をかけ合わせることで加重加算判定信号を算出し、該加重加算判定信号に基づいて第1及び第2の階調補正曲線の合成比率である加重加算比率を決定する。加重加算判定信号と加重加算比率の関係は、例えば図19のようであり、加重加算判定信号が大きいほど第1の階調補正曲線の加重が大きくなり、第2の階調補正曲線の加重が小さくなるように定められている。即ち、人物信頼度が高く、エッジ量の差分が小さいほど、被写体種類の分布に応じて決定された第1の階調補正曲線が優先される合成比率が決定される。また反対に、人物信頼度が小さく、エッジ量の差分が大きいほど、合焦度合いに応じて決定された第2の階調補正曲線が優先される合成比率が決定される。   In step S1603, the ratio calculation unit 305 calculates a weighted addition determination signal by multiplying the first and second region division reliability, and the first and second gradation correction curves based on the weighted addition determination signal. A weighted addition ratio that is a combination ratio of is determined. The relationship between the weighted addition determination signal and the weighted addition ratio is, for example, as shown in FIG. 19, and the larger the weighted addition determination signal, the greater the weight of the first gradation correction curve, and the second gradation correction curve is weighted. It is determined to be smaller. That is, the higher the person reliability and the smaller the difference in edge amount, the higher the composition ratio for which the first gradation correction curve determined according to the subject type distribution is prioritized. On the other hand, as the person reliability is smaller and the edge amount difference is larger, the combination ratio in which the second gradation correction curve determined according to the degree of focus is prioritized is determined.

つまり、例えば主要被写体である人物が認識されるようなケースでは、主要被写体の階調幅を広くし、一方で主要被写体よりもコントラストが高い背景領域の階調幅が広くなることを防ぐように補正されることが好ましい。このため、主要被写体である人物領域が認識された際の人物信頼度Rhが高いほど、人物被写体の階調幅が優先的に広くされる第1の階調補正曲線の加重が大きくなるようにしている。   In other words, for example, in the case where the person who is the main subject is recognized, the gradation width of the main subject is widened, while the gradation width of the background region having a higher contrast than the main subject is corrected to prevent widening. It is preferable. For this reason, the higher the person reliability Rh when the person region as the main subject is recognized, the higher the weight of the first gradation correction curve in which the gradation width of the person subject is preferentially widened. Yes.

一方、主要被写体である人物領域が認識された際の人物信頼度Rhが低い、即ち認識結果の信頼度が低いことになるため、主要被写体ではない領域の階調幅が拡張されることが考えられる。このため、第1の階調補正曲線ではなく、エッジ強度の強い、あるいはコントラストが高い(階調幅がもともと広い)領域の階調幅が拡張される第2の階調補正曲線の加重が大きくなるようにしている。   On the other hand, since the person reliability Rh when the person area that is the main subject is recognized is low, that is, the reliability of the recognition result is low, the gradation width of the area that is not the main subject may be expanded. . For this reason, not the first gradation correction curve but the weight of the second gradation correction curve in which the gradation width of the region having a strong edge strength or high contrast (the gradation width is originally wide) is expanded is increased. I have to.

また主要被写体以外の領域のエッジ量が少ない場合、該領域は空等のコントラストが低い(階調幅が狭い)被写体であるか、合焦度合いの低い被写体であると考えられる。例えば、合焦度合いの低い被写体である場合、空と、空以外の背景のうちの高輝度部分との判別が困難になり、領域抽出の精度は低いと考えられる。つまり、空と空以外の背景の輝度ヒストグラムの正当性が低く、第1の階調補正曲線は所望の結果が得られていないと考えられる。またポートレートのように主要被写体以外の領域と主要被写体との合焦度合いが極端に異なり、主要被写体以外の領域がボケている場合、背景の階調を優先せず、合焦している主要被写体のみの階調幅が拡張できればよいものと考えられる。このため、本実施形態では主要被写体とそれ以外の領域のエッジ量の差分が大きい場合は、合焦していると思われる領域の階調幅を拡張する第2の階調補正曲線の加重が大きくなるようにしている。   When the edge amount of the area other than the main subject is small, the area is considered to be a subject with a low contrast (narrow gradation width) such as sky or a subject with a low degree of focus. For example, in the case of a subject with a low degree of focus, it is difficult to discriminate between the sky and a high-luminance portion of the background other than the sky, and the region extraction accuracy is considered to be low. That is, the validity of the brightness histogram of the sky and the background other than the sky is low, and it is considered that the first gradation correction curve does not obtain a desired result. Also, when the focus level of the area other than the main subject and the main subject is extremely different and the area other than the main subject is blurred as in portraits, the background tone is not given priority and the main focus is in focus. It is considered that the gradation width only for the subject can be expanded. For this reason, in the present embodiment, when the difference between the edge amounts of the main subject and the other areas is large, the weight of the second gradation correction curve for expanding the gradation width of the area considered to be in focus is large. It is trying to become.

例えば図20(a)のような主要被写体に合焦していて、背景が極端にボケているシーンを考える。このとき、背景領域のエッジ量は少ないため、エッジ量に基づく領域分布は図20(b)のようになる。また主要被写体の領域2001、空以外の背景領域(2003及び2004)、空領域2002の判定を行った場合、図20(c)のようにエッジ量の少ない背景領域2003が空領域として誤認識されうる。即ち、被写体種類に応じた領域分割が正しく行われないため、第1の階調補正曲線は所望の入出力特性になっていないと考えられる。一方、主要被写体以外の背景がボケているため、ボケている被写体の階調を必要以上に拡張する必要はないため、結果としてコントラストの高い主要被写体の階調幅を優先的に拡張することが好ましい。故に、上述の関係に従い加重加算比率が決定された場合、図20(d)のような第1の階調補正曲線ではなく、図20(e)のような第2の階調補正曲線に重みを置いた第3の階調補正曲線が取得される。   For example, consider a scene in which the main subject as shown in FIG. 20A is focused and the background is extremely blurred. At this time, since the edge amount of the background region is small, the region distribution based on the edge amount is as shown in FIG. When the main subject area 2001, the background area other than the sky (2003 and 2004), and the sky area 2002 are determined, the background area 2003 with a small edge amount is erroneously recognized as a sky area as shown in FIG. sell. That is, it is considered that the first gradation correction curve does not have the desired input / output characteristics because the area division according to the subject type is not correctly performed. On the other hand, since the background other than the main subject is blurred, it is not necessary to expand the gradation of the blurred subject more than necessary, and as a result, it is preferable to preferentially expand the gradation width of the main subject with high contrast. . Therefore, when the weighted addition ratio is determined in accordance with the above-described relationship, the second gradation correction curve as shown in FIG. 20 (e) is weighted instead of the first gradation correction curve as shown in FIG. 20 (d). A third gradation correction curve is obtained with.

また、例えば図21(a)のように人物が存在しないシーンでは、主要被写体として人物が設定されている場合は、主要被写体領域は検出されないと考えられる。また図21(a)のシーンでは、低輝度な背景領域2101(車両)に合焦しており、車両よりも明るい背景領域2102がボケている。この場合、図21(c)に示されるように、被写体は空以外の背景領域と空領域の2種類の領域に分割される。しかしながら、背景領域2101と背景領域2102との合焦度合いが異なる条件で領域分類を判定した場合、図21(c)にも示されるように正しい領域分類が行えない可能性がある。さらに、好適な階調補正としては、合焦している背景領域2101を主要被写体として捉えて階調範囲の拡張を行うことが考えられるが、図21(c)のように背景領域2102の一部も空以外の背景領域として認識されうる。つまり、図21(d)に示されるように、空以外の背景領域についての輝度ヒストグラムでは、合焦していない領域の輝度分布の影響を受け、図21(f)のように第1の階調補正曲線が所望の入出力特性を示さない可能性がある。特に、図21(a)のように背景領域における輝度差が大きい場合は、このような問題が顕著化しうる。このため、図21(a)のようなシーンでは、エッジ量の多い領域の階調幅が拡張されるよう、図21(g)のような第2の階調補正曲線に重みが置かれることが好ましい。本実施形態では、主要被写体が検出されなかった場合は人物信頼度が0となるため、第3の階調補正曲線は第2の階調補正曲線となり、エッジ量の多い被写体の階調幅を拡張するよう、補正が行われる。   Further, for example, in a scene where no person exists as shown in FIG. 21A, when a person is set as the main subject, it is considered that the main subject region is not detected. In the scene of FIG. 21A, the background area 2101 (vehicle) with low luminance is in focus, and the background area 2102 brighter than the vehicle is blurred. In this case, as shown in FIG. 21C, the subject is divided into two types of areas, a background area other than the sky and an empty area. However, if the area classification is determined under the condition that the background area 2101 and the background area 2102 have different degrees of focus, there is a possibility that correct area classification cannot be performed as shown in FIG. Furthermore, as a suitable gradation correction, it is conceivable to expand the gradation range by capturing the focused background area 2101 as the main subject. However, as shown in FIG. The part can also be recognized as a background area other than the sky. That is, as shown in FIG. 21 (d), the luminance histogram for the background region other than the sky is affected by the luminance distribution of the non-focused region, and the first floor as shown in FIG. 21 (f). The tone correction curve may not exhibit the desired input / output characteristics. In particular, when the luminance difference in the background area is large as shown in FIG. For this reason, in the scene as shown in FIG. 21A, a weight is placed on the second gradation correction curve as shown in FIG. 21G so that the gradation width of the region with a large edge amount is expanded. preferable. In this embodiment, when the main subject is not detected, the person reliability is 0, so the third tone correction curve becomes the second tone correction curve, and the tone width of the subject with a large amount of edge is expanded. Correction is performed so that

このようにして合成比率が決定された後、階調補正処理のS406で合成部306は、第1の階調補正曲線と第2の階調補正曲線とを決定された合成比率に基づいて加重加算し、実際にベイヤー画像信号の補正に用いる第3の階調補正曲線を取得する。例えば図7のような人物信頼度が高く、人物領域及び背景領域のエッジ量が双方とも多いような逆光シーンでは、第1及び第2の領域分割信頼度が共に高くなるため、人物領域の階調幅が広くなる第3の階調補正曲線が得られる。   After the composition ratio is determined in this way, the composition unit 306 weights the first gradation correction curve and the second gradation correction curve based on the determined composition ratio in S406 of the gradation correction process. Addition is performed to obtain a third gradation correction curve that is actually used for correcting the Bayer image signal. For example, in a backlight scene where the person reliability is high as shown in FIG. 7 and both the person area and the background area have a large amount of edges, both the first and second area division reliability are high. A third gradation correction curve with an increased adjustment range is obtained.

そしてS407で、階調補正部307は、第3の階調補正曲線に基づいて入力されたベイヤー画像信号の階調補正を行い、得られた階調補正後のベイヤー画像信号を第2信号変換部204に出力し、本階調補正処理を終了する。   In step S407, the gradation correction unit 307 performs gradation correction on the Bayer image signal input based on the third gradation correction curve, and the obtained Bayer image signal after gradation correction is converted into the second signal. The gradation correction process is terminated.

このように本階調補正処理により、領域分割の信頼度に応じて2種類の階調補正曲線を加重加算することで、好適な被写体の階調幅が優先的に拡張されるような階調補正曲線を設定して階調補正処理を行うことができる。   In this way, the tone correction process that preferentially expands the tone width of a suitable subject by weighted addition of two types of tone correction curves according to the reliability of area division. A gradation can be corrected by setting a curve.

なお、本実施形態ではエッジ量の差分に応じて第2の領域分割信頼度を決定するものとして説明したが、本発明の実施はこれに限られるものではなく、例えば撮影時の絞り値及び被写体とデジタルカメラ100との距離に応じて決定されるものであってもよい。具体的には、撮影時の絞り量が大きいほど背景がボケにくく、合焦している主要被写体が近いほど背景がボケやすくなる。このため、絞り状態ほど第1の階調補正曲線の加重が大きくなり、主要被写体が近いほど第2の階調補正曲線の加重が大きくなるように、第2の領域分割信頼度が決定されるようにしてもよい。   In the present embodiment, the second region division reliability is determined according to the difference in edge amount. However, the present invention is not limited to this, and for example, the aperture value and subject at the time of shooting It may be determined according to the distance between the digital camera 100 and the digital camera 100. Specifically, the background is less blurred as the aperture amount at the time of shooting is larger, and the background is more blurred as the focused main subject is closer. For this reason, the second region division reliability is determined so that the weight of the first gradation correction curve increases as the aperture state increases, and the weight of the second gradation correction curve increases as the main subject is closer. You may do it.

また、本実施形態では主要被写体を人物であるものとして説明したが、本発明の実施はこれに限られず、例えば車や動物等、任意の被写体が主要被写体として設定可能な構成であってよい。   In the present embodiment, the main subject is described as being a person. However, the embodiment of the present invention is not limited to this, and an arbitrary subject such as a car or an animal may be set as the main subject.

また本実施形態の階調補正処理では、2つの階調補正曲線を加重加算した第3の階調補正曲線を用いて階調補正を行うものとして説明したが、第1及び第2の階調補正曲線をそれぞれ適用したベイヤー画像信号を合成比率に応じて合成してもよい。   In the gradation correction process of the present embodiment, the gradation correction is described using the third gradation correction curve obtained by weighted addition of the two gradation correction curves. However, the first and second gradations are described. Bayer image signals to which the correction curves are applied may be combined according to the combination ratio.

以上説明したように、本実施形態の画像処理装置は、主要被写体が好適な階調範囲で表現された画像を生成することができる。具体的には画像処理装置は、補正対象の画像から主要被写体を検出し、主要被写体に重み付けして得られた画像の輝度分布に基づき、分類される画素が多い輝度範囲ほど階調幅を拡張する第1の補正特性(例えば補正関数)を設定する。また合焦度合いが高い領域に重み付けして得られた画像の輝度分布に基づき、合焦度合いが高い領域ほど階調幅を拡張する第2の補正特性を設定する。そして画像処理装置は、第1の補正特性と第2の補正特性とを重み付け合成した第3の補正特性に基づいて画像の階調を補正する。   As described above, the image processing apparatus according to the present embodiment can generate an image in which the main subject is expressed in a suitable gradation range. Specifically, the image processing apparatus detects a main subject from an image to be corrected, and expands the gradation width for a luminance range with more classified pixels based on the luminance distribution of the image obtained by weighting the main subject. A first correction characteristic (for example, a correction function) is set. In addition, based on the luminance distribution of the image obtained by weighting the region with a high degree of focus, a second correction characteristic that sets the gradation width for the region with the higher degree of focus is set. The image processing apparatus corrects the gradation of the image based on the third correction characteristic obtained by weighting and combining the first correction characteristic and the second correction characteristic.

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

Claims (8)

補正対象の画像を取得する取得手段と、
前記取得手段により取得された前記画像から主要被写体を検出する検出手段と、
前記主要被写体に重み付けして得られた前記画像の輝度分布に基づき、分類される画素が多い輝度範囲ほど階調幅を拡張する第1の補正特性を設定する第1の設定手段と、
合焦度合いが高い領域に重み付けして得られた前記画像の輝度分布に基づき、合焦度合いが高い領域ほど階調幅を拡張する第2の補正特性を設定する第2の設定手段と、
前記第1の設定手段により設定された前記第1の補正特性と、前記第2の設定手段により設定された前記第2の補正特性とを重み付け合成した第3の補正特性に基づいて前記画像の階調を補正する補正手段と、を有する
ことを特徴とする画像処理装置。
An acquisition means for acquiring an image to be corrected;
Detecting means for detecting a main subject from the image acquired by the acquiring means;
A first setting means for setting a first correction characteristic for expanding a gradation width in a luminance range with more classified pixels based on a luminance distribution of the image obtained by weighting the main subject;
A second setting means for setting a second correction characteristic for expanding a gradation width in a region having a higher focus degree, based on the luminance distribution of the image obtained by weighting the region having a high focus degree;
Based on a third correction characteristic obtained by weighting and combining the first correction characteristic set by the first setting unit and the second correction characteristic set by the second setting unit. An image processing apparatus comprising: correction means for correcting gradation.
前記補正手段は、前記検出手段により検出された前記主要被写体の検出結果の信頼度が高いほど前記第1の補正特性の重みを大きくして合成することで前記第3の補正特性を生成することを特徴とする請求項1に記載の画像処理装置。   The correction unit generates the third correction characteristic by combining the first correction characteristic with a higher weight as the reliability of the detection result of the main subject detected by the detection unit is higher. The image processing apparatus according to claim 1. 前記補正手段は、前記画像における前記主要被写体の領域とそれ以外の領域との合焦度合いの差が大きいほど前記第2の補正特性の重みを大きく合成することで前記第3の補正特性を生成することを特徴とする請求項1または2に記載の画像処理装置。   The correction unit generates the third correction characteristic by combining the weights of the second correction characteristic as the difference in focus degree between the area of the main subject and the other area in the image increases. The image processing apparatus according to claim 1, wherein: 前記検出手段はさらに、前記画像から前記主要被写体とは異なる種類の被写体をそれぞれ検出し、
前記第1の設定手段は、前記検出手段により検出された前記主要被写体及び前記異なる種類の被写体のそれぞれについての輝度分布を、前記画像において占有する面積に応じて正規化した上で加重加算することで、前記主要被写体に重み付けして得られた前記画像の輝度分布を生成する
ことを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。
The detection means further detects each type of subject different from the main subject from the image,
The first setting unit performs weighted addition after normalizing the luminance distributions of the main subject and the different types of subjects detected by the detection unit according to the area occupied in the image. The image processing apparatus according to claim 1, wherein a luminance distribution of the image obtained by weighting the main subject is generated.
前記第2の設定手段は、前記合焦度合いを予め定められた数の段階で分類し、該段階のそれぞれについての輝度分布を、前記画像において占有する面積に応じて正規化した上で加重加算することで、前記合焦度合いが高い領域に重み付けして得られた前記画像の輝度分布を生成することを特徴とする請求項1乃至4のいずれか1項に記載の画像処理装置。   The second setting means classifies the degree of focus into a predetermined number of steps, and normalizes the luminance distribution for each of the steps according to the area occupied in the image, and then performs weighted addition. 5. The image processing apparatus according to claim 1, wherein a luminance distribution of the image obtained by weighting an area with a high degree of focus is generated. 撮像して画像を取得する撮像手段と、
前記撮像手段により取得された前記画像から主要被写体を検出する検出手段と、
前記主要被写体に重み付けして得られた前記画像の輝度分布に基づき、分類される画素が多い輝度範囲ほど階調幅を拡張する第1の補正特性を設定する第1の設定手段と、
合焦度合いが高い領域に重み付けして得られた前記画像の輝度分布に基づき、合焦度合いが高い領域ほど階調幅を拡張する第2の補正特性を設定する第2の設定手段と、
前記第1の設定手段により設定された前記第1の補正特性と、前記第2の設定手段により設定された前記第2の補正特性とを重み付け合成した第3の補正特性に基づいて前記画像の階調を補正する補正手段と、を有する
ことを特徴とする撮像装置。
Imaging means for capturing and acquiring images;
Detecting means for detecting a main subject from the image acquired by the imaging means;
A first setting means for setting a first correction characteristic for expanding a gradation width in a luminance range with more classified pixels based on a luminance distribution of the image obtained by weighting the main subject;
A second setting means for setting a second correction characteristic for expanding a gradation width in a region having a higher focus degree, based on the luminance distribution of the image obtained by weighting the region having a high focus degree;
Based on a third correction characteristic obtained by weighting and combining the first correction characteristic set by the first setting unit and the second correction characteristic set by the second setting unit. An image pickup apparatus comprising: correction means for correcting gradation.
画像処理装置の取得手段が、補正対象の画像を取得する取得工程と、
前記画像処理装置の検出手段が、前記取得工程において取得された前記画像から主要被写体を検出する検出工程と、
前記画像処理装置の第1の設定手段が、前記主要被写体に重み付けして得られた前記画像の輝度分布に基づき、分類される画素が多い輝度範囲ほど階調幅を拡張する第1の補正特性を設定する第1の設定工程と、
前記画像処理装置の第2の設定手段が、合焦度合いが高い領域に重み付けして得られた前記画像の輝度分布に基づき、合焦度合いが高い領域ほど階調幅を拡張する第2の補正特性を設定する第2の設定工程と、
前記画像処理装置の補正手段が、前記第1の設定工程において設定された前記第1の補正特性と、前記第2の設定工程において設定された前記第2の補正特性とを重み付け合成した第3の補正特性に基づいて前記画像の階調を補正する補正工程と、を有する
ことを特徴とする画像処理装置の制御方法。
An acquisition step in which an acquisition unit of the image processing apparatus acquires an image to be corrected; and
A detection step in which the detection means of the image processing device detects a main subject from the image acquired in the acquisition step;
Based on the luminance distribution of the image obtained by weighting the main subject, the first setting means of the image processing device has a first correction characteristic that expands the gradation width in a luminance range with more classified pixels. A first setting step to set;
A second correction characteristic in which the second setting unit of the image processing device expands the gradation width in a region with a higher degree of focus based on the luminance distribution of the image obtained by weighting a region with a higher degree of focus. A second setting step for setting
A third correction unit of the image processing apparatus weights and synthesizes the first correction characteristic set in the first setting step and the second correction characteristic set in the second setting step. And a correction step of correcting the gradation of the image on the basis of the correction characteristics of the image processing apparatus.
コンピュータを、請求項1乃至5のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claims 1 thru | or 5.
JP2013160792A 2013-08-01 2013-08-01 Image processing apparatus, imaging apparatus, control method, and program Pending JP2015032966A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013160792A JP2015032966A (en) 2013-08-01 2013-08-01 Image processing apparatus, imaging apparatus, control method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013160792A JP2015032966A (en) 2013-08-01 2013-08-01 Image processing apparatus, imaging apparatus, control method, and program

Publications (1)

Publication Number Publication Date
JP2015032966A true JP2015032966A (en) 2015-02-16

Family

ID=52517952

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013160792A Pending JP2015032966A (en) 2013-08-01 2013-08-01 Image processing apparatus, imaging apparatus, control method, and program

Country Status (1)

Country Link
JP (1) JP2015032966A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016157839A1 (en) * 2015-03-27 2016-10-06 パナソニックIpマネジメント株式会社 Signal processing device, record/replay device, signal processing method, and program
JP2017046072A (en) * 2015-08-24 2017-03-02 キヤノン株式会社 Image processing system and image processing method, program, and storage medium
JP2017069725A (en) * 2015-09-29 2017-04-06 キヤノン株式会社 Image processing apparatus, image processing method, program, and storage medium
JP2017097523A (en) * 2015-11-20 2017-06-01 セイコーエプソン株式会社 Image processing unit, image processing method and image processing program
JP2020504868A (en) * 2016-12-23 2020-02-13 マジック リープ, インコーポレイテッドMagic Leap,Inc. Techniques for determining settings for a content capture device
JP2020136928A (en) * 2019-02-20 2020-08-31 キヤノン株式会社 Image processing apparatus, image processing method, and program
US11462138B2 (en) * 2018-09-27 2022-10-04 Nippon Telegraph And Telephone Corporation Image generation device, image generation method, and program
EP4277259A1 (en) * 2022-05-13 2023-11-15 Sick Ag Image capture and brightness adjustment
JP7424140B2 (en) 2018-10-19 2024-01-30 ソニーグループ株式会社 Sensor device, signal processing method

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2016157838A1 (en) * 2015-03-27 2018-01-18 パナソニックIpマネジメント株式会社 Signal processing device, display device, signal processing method, and program
WO2016157838A1 (en) * 2015-03-27 2016-10-06 パナソニックIpマネジメント株式会社 Signal processing device, display device, signal processing method, and program
WO2016157839A1 (en) * 2015-03-27 2016-10-06 パナソニックIpマネジメント株式会社 Signal processing device, record/replay device, signal processing method, and program
JPWO2016157839A1 (en) * 2015-03-27 2018-03-01 パナソニックIpマネジメント株式会社 Signal processing apparatus, recording / reproducing apparatus, signal processing method, and program
JP2017046072A (en) * 2015-08-24 2017-03-02 キヤノン株式会社 Image processing system and image processing method, program, and storage medium
JP2017069725A (en) * 2015-09-29 2017-04-06 キヤノン株式会社 Image processing apparatus, image processing method, program, and storage medium
JP2017097523A (en) * 2015-11-20 2017-06-01 セイコーエプソン株式会社 Image processing unit, image processing method and image processing program
JP2020504868A (en) * 2016-12-23 2020-02-13 マジック リープ, インコーポレイテッドMagic Leap,Inc. Techniques for determining settings for a content capture device
JP2022172105A (en) * 2016-12-23 2022-11-15 マジック リープ, インコーポレイテッド Techniques for determining settings for content capture device
US11968456B2 (en) 2016-12-23 2024-04-23 Magic Leap, Inc. Techniques for determining settings for a content capture device
JP7472204B2 (en) 2016-12-23 2024-04-22 マジック リープ, インコーポレイテッド Techniques for determining settings for a content capture device - Patents.com
US11462138B2 (en) * 2018-09-27 2022-10-04 Nippon Telegraph And Telephone Corporation Image generation device, image generation method, and program
JP7424140B2 (en) 2018-10-19 2024-01-30 ソニーグループ株式会社 Sensor device, signal processing method
JP2020136928A (en) * 2019-02-20 2020-08-31 キヤノン株式会社 Image processing apparatus, image processing method, and program
JP7278096B2 (en) 2019-02-20 2023-05-19 キヤノン株式会社 Image processing device, image processing method, and program
EP4277259A1 (en) * 2022-05-13 2023-11-15 Sick Ag Image capture and brightness adjustment

Similar Documents

Publication Publication Date Title
JP5398156B2 (en) WHITE BALANCE CONTROL DEVICE, ITS CONTROL METHOD, AND IMAGING DEVICE
JP2015032966A (en) Image processing apparatus, imaging apparatus, control method, and program
JP5113514B2 (en) White balance control device and white balance control method
JP4826028B2 (en) Electronic camera
US9148578B2 (en) Image capture apparatus, control method thereof, and recording medium
US9148561B2 (en) Image capturing apparatus, executable autoexposure bracketing and control method thereof
US8059187B2 (en) Image capturing apparatus
JP6833415B2 (en) Image processing equipment, image processing methods, and programs
KR20080035981A (en) Image processing apparatus, imaging apparatus, image processing method, and computer program
JP6720881B2 (en) Image processing apparatus and image processing method
JP5804857B2 (en) Image processing apparatus, image processing method, and program
JP4948591B2 (en) Image processing apparatus, image processing method, and program
JP5782311B2 (en) Imaging apparatus and control method thereof
JP2011228807A (en) Image processing program, image processing apparatus, and image processing method
JP6904788B2 (en) Image processing equipment, image processing methods, and programs
US11115637B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP6552325B2 (en) Imaging device, control method of imaging device, and program
JP5245648B2 (en) Image processing apparatus and program
JP2008305122A (en) Image-processing apparatus, image processing method and program
US8154618B2 (en) Imaging apparatus and method for setting the same
JP2007312099A (en) Image-taking device
JP5106311B2 (en) White balance control device, imaging device using the same, and white balance control method
JP2015037222A (en) Image processing apparatus, imaging apparatus, control method, and program
JP2015119436A (en) Imaging apparatus
JP5943682B2 (en) Imaging apparatus, control method thereof, and program