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

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP6573798B2
JP6573798B2 JP2015155685A JP2015155685A JP6573798B2 JP 6573798 B2 JP6573798 B2 JP 6573798B2 JP 2015155685 A JP2015155685 A JP 2015155685A JP 2015155685 A JP2015155685 A JP 2015155685A JP 6573798 B2 JP6573798 B2 JP 6573798B2
Authority
JP
Japan
Prior art keywords
group
block
shading
image
shading estimation
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
JP2015155685A
Other languages
Japanese (ja)
Other versions
JP2016105578A (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.)
Samsung Electronics Co Ltd
Original Assignee
Samsung Electronics Co Ltd
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 Samsung Electronics Co Ltd filed Critical Samsung Electronics Co Ltd
Priority to KR1020150153810A priority Critical patent/KR102366254B1/en
Priority to US14/948,922 priority patent/US9661290B2/en
Publication of JP2016105578A publication Critical patent/JP2016105578A/en
Application granted granted Critical
Publication of JP6573798B2 publication Critical patent/JP6573798B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、画像処理装置及び画像処理方法に関する。   The present invention relates to an image processing apparatus and an image processing method.

撮像装置に赤外カットフィルタを適用したときに、撮像画像に色シェーディングが生じることがある。特許文献1には、そのような色シェーディングを補正する画像処理装置として、撮像画像に複数のシェーディング補正係数をそれぞれ適用し、適切に色シェーディングを補正できたシェーディング補正係数を選択し、当該撮像画像に選択したシェーディング補正係数を適用して、当該撮像画像の色シェーディングを補正し出力する画像処理装置が開示されている。   When an infrared cut filter is applied to the imaging apparatus, color shading may occur in the captured image. In Patent Document 1, as an image processing apparatus that corrects such color shading, a plurality of shading correction coefficients are applied to a captured image, and a shading correction coefficient that can appropriately correct color shading is selected. An image processing apparatus that corrects and outputs color shading of the captured image by applying the selected shading correction coefficient is disclosed.

なお、その他に関連する技術として、特許文献2、3が知られている。   Patent documents 2 and 3 are known as other related technologies.

特開2013−198041号公報JP 2013-198041 A 特開2006−080752号公報JP 2006080752 A 特開2015−099962号公報Japanese Patent Laying-Open No. 2015-099962

上記従来の画像処理装置では、撮像画像を複数のブロックに分割し、ブロック毎の画素値の統計値を求め、この統計値とシェーディング補正係数のブロック毎の係数値とを乗算し、乗算結果の撮像画像内での分散値を求める。この分散値をシェーディング補正係数毎に求め、分散値がいちばん小さいシェーディング補正係数を、適切に色シェーディングを補正できるシェーディング補正係数として選択する。   In the conventional image processing apparatus, the captured image is divided into a plurality of blocks, the statistical value of the pixel value for each block is obtained, the statistical value is multiplied by the coefficient value for each block of the shading correction coefficient, and the multiplication result A dispersion value in the captured image is obtained. This dispersion value is obtained for each shading correction coefficient, and the shading correction coefficient having the smallest dispersion value is selected as a shading correction coefficient that can appropriately correct the color shading.

しかしながら、従来技術では、画像によっては、適切に色シェーディングを補正できるシェーディング補正係数を選択できない場合があるという問題点があった。   However, the conventional technique has a problem that a shading correction coefficient that can appropriately correct color shading cannot be selected depending on an image.

本発明は、このような問題点を解決するためになされたものであり、画像に適したシェーディング補正係数を選択することができる画像処理装置及び画像処理方法を提供することを目的とする。   The present invention has been made to solve such problems, and an object thereof is to provide an image processing apparatus and an image processing method capable of selecting a shading correction coefficient suitable for an image.

本発明に係る画像処理装置は、撮像画像を複数のブロックに分割するブロック分割部と、前記ブロック毎に画素値の統計をとることでブロック統計値を算出する統計値算出部と、複数の光源にそれぞれ対応する複数のシェーディング推定係数を含む第1のシェーディング推定係数群を記憶する推定係数群記憶部と、前記撮像画像の画像平坦度、被写体明度、被写体色温度の少なくとも1つに応じて、前記記憶された第1のシェーディング推定係数群の中から前記撮像画像に適切な少なくとも1つのシェーディング推定係数を含む第2のシェーディング推定係数群を選択するシェーディング推定部と、前記選択された第2のシェーディング推定係数群に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するシェーディング補正部と、を備えるものである。   An image processing apparatus according to the present invention includes a block dividing unit that divides a captured image into a plurality of blocks, a statistical value calculating unit that calculates a block statistical value by taking pixel value statistics for each block, and a plurality of light sources According to at least one of an estimation coefficient group storage unit that stores a first shading estimation coefficient group including a plurality of shading estimation coefficients respectively corresponding to the image flatness, subject brightness, and subject color temperature of the captured image, A shading estimation unit that selects a second shading estimation coefficient group including at least one shading estimation coefficient appropriate for the captured image from the stored first shading estimation coefficient group; and the selected second shading estimation unit A shading correction coefficient corresponding to a shading estimation coefficient group is applied to the captured image, and shading of the captured image is performed. A shading correction unit that corrects, those comprising a.

本発明に係る画像処理装置は、撮像画像を複数のブロックに分割するブロック分割部と、前記ブロック毎に色別の画素値の統計をとることで第1のブロック統計値を算出する統計値算出部と、補正強度の異なる複数のシェーディング推定係数を記憶する推定係数記憶部と、前記算出された第1のブロック統計値を評価するブロック色評価値を算出するブロック色評価値算出部と、前記算出されたブロック色評価値のヒストグラムに基づいてシェーディング推定のための評価対象ブロックを選択するブロック評価値算出部と、前記選択された評価対象ブロックに基づいて、前記記憶されたシェーディング推定係数の中から前記撮像画像に適切なシェーディング推定係数を選択するシェーディング推定係数選択部と、前記選択されたシェーディング推定係数に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するシェーディング補正部と、を備えるものである。   An image processing apparatus according to the present invention includes: a block dividing unit that divides a captured image into a plurality of blocks; and a statistical value calculation that calculates a first block statistical value by taking statistics of pixel values for each color for each block A block color evaluation value calculation unit that calculates a block color evaluation value for evaluating the calculated first block statistical value, a block coefficient evaluation value calculation unit that stores a plurality of shading estimation coefficients having different correction strengths, A block evaluation value calculation unit that selects an evaluation target block for shading estimation based on a histogram of the calculated block color evaluation value, and among the stored shading estimation coefficients based on the selected evaluation target block A shading estimation coefficient selection unit that selects an appropriate shading estimation coefficient for the captured image from the image, and the selected shading The shading correction coefficient corresponding to the estimated coefficient is applied to the captured image, a shading correction section that corrects the shading of the captured image, but with a.

本発明に係る画像処理装置は、撮像画像を複数のブロックに分割するブロック分割部と、前記ブロック毎に色別の画素値の統計をとることでブロック統計値を算出する統計値算出部と、補正強度の異なる複数のシェーディング推定係数を記憶する推定係数記憶部と、前記撮像画像の中央部からの距離に応じて前記ブロックを複数のグループに分類するグループ分類部と、前記ブロック統計値に基づいて前記ブロックの有効または無効を判定する有効ブロック判定部と、前記グループ内の前記有効と判定されたブロックについて統計値の色別の総和に基づいてグループ評価値を算出するグループ評価値算出部と、前記算出されたグループ評価値に基づいて前記グループの有効または無効を判定する有効グループ判定部と、前記撮像画像の中央部から周辺部へ向かうグループのうち前記有効と判定されたグループについて、色の比率を直線近似する直線近似部と、前記近似した直線の傾きにしたがって、前記記憶されたシェーディング推定係数の中から前記撮像画像に適切なシェーディング推定係数を選択するシェーディング推定係数選択部と、前記選択されたシェーディング推定係数に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するシェーディング補正部と、を備えるものである。   An image processing apparatus according to the present invention includes a block dividing unit that divides a captured image into a plurality of blocks, a statistical value calculating unit that calculates a block statistical value by taking statistics of pixel values for each color for each block, Based on an estimation coefficient storage unit that stores a plurality of shading estimation coefficients having different correction strengths, a group classification unit that classifies the blocks into a plurality of groups according to the distance from the center of the captured image, and the block statistics An effective block determination unit that determines whether the block is valid or invalid, and a group evaluation value calculation unit that calculates a group evaluation value based on the sum of each statistical value for each of the blocks determined to be valid in the group; An effective group determination unit that determines whether the group is valid or invalid based on the calculated group evaluation value; and a central portion of the captured image Among the groups heading toward the periphery, the straight-line approximation unit that linearly approximates the color ratio for the group that is determined to be effective, and the imaging from the stored shading estimation coefficients according to the slope of the approximated straight line A shading estimation coefficient selection unit that selects an appropriate shading estimation coefficient for the image, a shading correction unit that applies a shading correction coefficient corresponding to the selected shading estimation coefficient to the captured image, and corrects shading of the captured image; , Are provided.

本発明に係る画像処理装置は、画像を、前記画像の中心部からの距離に基づいて複数のグループに分類するグループ分類部と、前記画像にシェーディング推定係数を適用したときの前記グループ毎のグループ評価値を算出するグループ評価値算出部と、前記グループ評価値に基づいて有効グループを判定し、隣接する前記有効グループをグループ連続領域として判定する有効グループ判定部と、前記グループ連続領域毎の前記グループ評価値の分散値を積算して前記シェーディング推定係数のテーブル評価値とし、最も小さいテーブル評価値を有するシェーディング推定係数を選択するシェーディング推定係数選択部と、前記選択したシェーディング推定係数に対応するシェーディング補正係数を用いて前記画像を補正するシェーディング補正部とを備えるものである。   An image processing apparatus according to the present invention includes a group classification unit that classifies an image into a plurality of groups based on a distance from a center of the image, and a group for each group when a shading estimation coefficient is applied to the image. A group evaluation value calculating unit for calculating an evaluation value; an effective group determining unit for determining an effective group based on the group evaluation value; and determining the adjacent effective group as a group continuous region; and the group continuous region A shading estimation coefficient selecting unit that accumulates the variance values of the group evaluation values to obtain a table evaluation value of the shading estimation coefficient, selects a shading estimation coefficient having the smallest table evaluation value, and shading corresponding to the selected shading estimation coefficient A shading correction that corrects the image using a correction coefficient. In which and a part.

本発明に係る画像処理方法は、撮像画像を複数のブロックに分割し、前記ブロック毎に画素値の統計をとることでブロック統計値を算出し、複数の光源にそれぞれ対応する複数のシェーディング推定係数を含む第1のシェーディング推定係数群を記憶し、前記撮像画像の画像平坦度、被写体明度、被写体色温度の少なくとも1つに応じて、前記記憶された第1のシェーディング推定係数群の中から前記撮像画像に適切な少なくとも1つのシェーディング推定係数を含む第2のシェーディング推定係数群を選択し、前記選択された第2のシェーディング推定係数群に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するものである。   An image processing method according to the present invention divides a captured image into a plurality of blocks, calculates a block statistical value by taking statistics of a pixel value for each block, and a plurality of shading estimation coefficients respectively corresponding to a plurality of light sources. And storing the first shading estimation coefficient group from the stored first shading estimation coefficient group according to at least one of image flatness, subject brightness, and subject color temperature of the captured image. Selecting a second shading estimation coefficient group including at least one shading estimation coefficient appropriate for the captured image, applying a shading correction coefficient corresponding to the selected second shading estimation coefficient group to the captured image, and This is to correct shading of a captured image.

本発明に係る画像処理方法は、撮像画像を複数のブロックに分割し、前記ブロック毎に色別の画素値の統計をとることで第1のブロック統計値を算出し、補正強度の異なる複数のシェーディング推定係数を記憶し、前記算出された第1のブロック統計値を評価するブロック色評価値を算出し、前記算出されたブロック色評価値のヒストグラムに基づいてシェーディング推定のための評価対象ブロックを選択し、前記選択された評価対象ブロックに基づいて、前記記憶されたシェーディング推定係数の中から前記撮像画像に適切なシェーディング推定係数を選択し、前記選択されたシェーディング推定係数に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するものである。   The image processing method according to the present invention divides a captured image into a plurality of blocks, calculates a first block statistical value by taking statistics of pixel values for each color for each of the blocks, and a plurality of different correction intensities. A shading estimation coefficient is stored, a block color evaluation value for evaluating the calculated first block statistical value is calculated, and an evaluation target block for shading estimation is calculated based on a histogram of the calculated block color evaluation value. Selecting a shading estimation coefficient appropriate for the captured image from the stored shading estimation coefficients based on the selected evaluation target block, and a shading correction coefficient corresponding to the selected shading estimation coefficient Is applied to the captured image to correct shading of the captured image.

本発明に係る画像処理方法は、撮像画像を複数のブロックに分割し、前記ブロック毎に色別の画素値の統計をとることでブロック統計値を算出し、補正強度の異なる複数のシェーディング推定係数を記憶し、前記撮像画像の中央部からの距離に応じて前記ブロックを複数のグループに分類し、前記ブロック統計値に基づいて前記ブロックの有効または無効を判定し、前記グループ内の前記有効と判定されたブロックについて統計値の色別の総和に基づいてグループ評価値を算出し、前記算出されたグループ評価値に基づいて前記グループの有効または無効を判定し、前記撮像画像の中央部から周辺部へ向かうグループのうち前記有効と判定されたグループについて、色の比率を直線近似し、前記近似した直線の傾きにしたがって、前記記憶されたシェーディング推定係数の中から前記撮像画像に適切なシェーディング推定係数を選択し、前記選択されたシェーディング推定係数に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するものである。   An image processing method according to the present invention divides a captured image into a plurality of blocks, calculates a block statistic value by taking a statistic of a pixel value for each color for each block, and a plurality of shading estimation coefficients having different correction strengths And classifying the blocks into a plurality of groups according to the distance from the center of the captured image, determining whether the block is valid or invalid based on the block statistics, and determining whether the block is valid or invalid. A group evaluation value is calculated based on the sum of each statistical value by color for the determined block, and the validity or invalidity of the group is determined based on the calculated group evaluation value. For the group judged to be effective among the groups heading to the section, the color ratio is linearly approximated, and the memory is stored according to the slope of the approximated straight line. Selecting an appropriate shading estimation coefficient for the captured image from among the estimated shading estimation coefficients, applying a shading correction coefficient corresponding to the selected shading estimation coefficient to the captured image, and correcting shading of the captured image It is.

本発明に係る画像処理方法は、画像を、前記画像の中心部からの距離に基づいて複数のグループに分類し、前記画像にシェーディング推定係数を適用したときの前記グループ毎のグループ評価値を算出し、前記グループ評価値に基づいて有効グループを判定し、隣接する前記有効グループをグループ連続領域として判定し、前記グループ連続領域毎の前記グループ評価値の分散値を積算して前記シェーディング推定係数のテーブル評価値とし、最も小さいテーブル評価値を有するシェーディング推定係数を選択し、前記選択したシェーディング推定係数に対応するシェーディング補正係数を用いて前記画像を補正するものである。   The image processing method according to the present invention classifies images into a plurality of groups based on distances from the center of the image, and calculates a group evaluation value for each group when a shading estimation coefficient is applied to the image. And determining an effective group based on the group evaluation value, determining the adjacent effective group as a group continuous region, integrating a variance value of the group evaluation value for each group continuous region, and calculating the shading estimation coefficient A shading estimation coefficient having the smallest table evaluation value is selected as a table evaluation value, and the image is corrected using a shading correction coefficient corresponding to the selected shading estimation coefficient.

本発明によれば、画像に適したシェーディング補正係数を選択することのできる画像処理装置及び画像処理方法を提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the image processing apparatus and image processing method which can select the shading correction coefficient suitable for an image can be provided.

実施の形態1に係るデジタルスチルカメラの構成を示すブロック図である。1 is a block diagram illustrating a configuration of a digital still camera according to Embodiment 1. FIG. 実施の形態1に係るシェーディング推定部の構成を示すブロック図である。3 is a block diagram showing a configuration of a shading estimation unit according to Embodiment 1. FIG. 実施の形態1に係るシェーディング推定部の動作を説明するためのフローチャートである。6 is a flowchart for explaining an operation of a shading estimation unit according to the first embodiment. 実施の形態1に係るフラット判定部の動作を説明するための画像ブロックの例を示す図である。6 is a diagram illustrating an example of an image block for explaining an operation of a flat determination unit according to Embodiment 1. FIG. 実施の形態1に係るフラット判定部の動作を説明するための画像値の例を示す図である。6 is a diagram illustrating an example of an image value for explaining an operation of a flat determination unit according to Embodiment 1. FIG. 実施の形態1に係るフラット判定部が処理する画像の例を示す図である。6 is a diagram illustrating an example of an image processed by a flat determination unit according to Embodiment 1. FIG. 実施の形態1に係るシェーディング推定係数選択部の動作を説明するためのフローチャートである。5 is a flowchart for explaining an operation of a shading estimation coefficient selection unit according to the first embodiment. 実施の形態1に係るシェーディング推定係数選択部が分類するグループの例を示す図である。It is a figure which shows the example of the group which the shading estimation coefficient selection part which concerns on Embodiment 1 classifies. 実施の形態1に係るシェーディング推定係数選択部が分類する別のグループの例を示す図である。It is a figure which shows the example of another group which the shading estimation coefficient selection part which concerns on Embodiment 1 classifies. 実施の形態2の概要を説明するための画像の例を示す図である。10 is a diagram illustrating an example of an image for explaining an overview of a second embodiment. FIG. 実施の形態2に係るシェーディング推定部124の構成を示すブロック図である。6 is a block diagram showing a configuration of a shading estimation unit 124 according to Embodiment 2. FIG. 実施の形態2に係るブロック色評価値算出部211の動作を説明するためのフローチャートである。10 is a flowchart for explaining an operation of a block color evaluation value calculation unit 211 according to the second embodiment. 実施の形態2に係るブロック色評価値算出部211、ブロック重み係数算出部212及びブロック評価値算出部213の動作を説明するためのフローチャートである。10 is a flowchart for explaining operations of a block color evaluation value calculation unit 211, a block weight coefficient calculation unit 212, and a block evaluation value calculation unit 213 according to the second embodiment. 実施の形態2に係るブロック色評価値算出部211、ブロック重み係数算出部212及びブロック評価値算出部213の動作を説明するためのフローチャートである。10 is a flowchart for explaining operations of a block color evaluation value calculation unit 211, a block weight coefficient calculation unit 212, and a block evaluation value calculation unit 213 according to the second embodiment. 実施の形態2に係るブロック重み係数算出部212が処理する画像の例を示す図である。It is a figure which shows the example of the image which the block weighting coefficient calculation part 212 which concerns on Embodiment 2 processes. 実施の形態2に係るブロック重み係数算出部212が生成するヒストグラムの例を示す図である。It is a figure which shows the example of the histogram which the block weight coefficient calculation part 212 which concerns on Embodiment 2 produces | generates. 実施の形態2に係るブロック重み係数算出部212が処理する画像の例を示す図である。It is a figure which shows the example of the image which the block weighting coefficient calculation part 212 which concerns on Embodiment 2 processes. 実施の形態3に係るシェーディング推定部の構成を示すブロック図である。FIG. 10 is a block diagram illustrating a configuration of a shading estimation unit according to Embodiment 3. 実施の形態3に係るグループ分類部及びグループ評価値算出部の動作を説明するためのフローチャートである。10 is a flowchart for explaining operations of a group classification unit and a group evaluation value calculation unit according to the third embodiment. 実施の形態3に係るグループ分類部が分類するグループの例を示す図である。It is a figure which shows the example of the group which the group classification part which concerns on Embodiment 3 classifies. 実施の形態3に係る有効グループ判定部及び近似推定部の動作を説明するためのフローチャートである。10 is a flowchart for explaining operations of an effective group determination unit and an approximate estimation unit according to Embodiment 3. 実施の形態3に係る有効グループ判定部及び近似推定部の動作を説明するためのフローチャートである。10 is a flowchart for explaining operations of an effective group determination unit and an approximate estimation unit according to Embodiment 3. 実施の形態3に係る有効グループ判定部が処理するグループの例を示す図である。It is a figure which shows the example of the group which the effective group determination part which concerns on Embodiment 3 processes. 実施の形態3に係る有効グループ判定部が処理するグループの例を示す図である。It is a figure which shows the example of the group which the effective group determination part which concerns on Embodiment 3 processes. 実施の形態3に係る有効グループ判定部が処理するグループの例を示す図である。It is a figure which shows the example of the group which the effective group determination part which concerns on Embodiment 3 processes. 実施の形態3に係る有効グループ判定部の補間方法を説明するための図である。10 is a diagram for explaining an interpolation method of an effective group determination unit according to Embodiment 3. FIG. 実施の形態3に係る近似推定部が処理する近似直線イメージを示すグラフである。10 is a graph showing an approximate straight line image processed by the approximate estimation unit according to the third embodiment. 実施の形態3に係る分散推定部の動作を説明するためのフローチャートである。10 is a flowchart for explaining an operation of a variance estimation unit according to the third embodiment. 実施の形態4に係るシェーディング推定部124の構成を示すブロック図である。FIG. 10 is a block diagram showing a configuration of a shading estimation unit 124 according to Embodiment 4. 実施の形態4に係るシェーディング推定部124の動作を説明するためのフローチャートである。10 is a flowchart for explaining an operation of a shading estimation unit 124 according to Embodiment 4. 実施の形態4に係る有効距離グループの判定方法を説明するための図である。FIG. 10 is a diagram for explaining an effective distance group determination method according to Embodiment 4; 実施の形態4に係る有効距離グループの判定方法の具体的な処理内容を説明するための図である。FIG. 10 is a diagram for describing specific processing contents of an effective distance group determination method according to Embodiment 4;

(実施の形態1)
以下、図面を参照して実施の形態1について説明する。
(Embodiment 1)
The first embodiment will be described below with reference to the drawings.

<実施の形態1の概要>
上記のように特許文献1に記載された従来の画像処理装置では、分散値がいちばん小さいシェーディング補正係数を、適切に色シェーディングを補正できたシェーディング補正係数として選択する。しかしながら、本発明者は、従来技術では撮像シーンが複雑であったときに、分散値がいちばん小さいシェーディング補正係数が、必ずしも適切に色シェーディングを補正できるシェーディング補正係数とならないという問題点を見出した。
<Outline of Embodiment 1>
As described above, in the conventional image processing apparatus described in Patent Document 1, the shading correction coefficient having the smallest variance value is selected as the shading correction coefficient that can appropriately correct the color shading. However, the present inventor has found that the shading correction coefficient with the smallest variance value does not necessarily become a shading correction coefficient that can appropriately correct color shading when the imaging scene is complicated in the prior art.

このような問題点を解決するため、本発明者は、色シェーディングを補正する画像処理装置の検討例として、ブロック統計値にシェーディング推定係数を適用してブロック毎にブロック特性値を算出するブロック特性部と、注目ブロックと近傍ブロックとのブロック特性類似度に基づいてブロック重みを算出するブロック重み部とを備え、複雑な被写体の影響を排除し適切なシェーディング推定係数を選択する例について検討した。また、画像にシェーディング推定係数を複数適用し、画像に適切なシェーディング推定係数を選択する推定部と、適切なシェーディング推定係数に対応するシェーディング補正係数を画像に適用し、画像のシェーディングを補正する補正部とを備え、推定部は、画像を前記画像の中央部からの距離に基づいて複数のグループに分類し、画像にシェーディング推定係数を適用したときの画像特性値を前記グループ毎に算出し、画像特性値の統計値を算出して、画像に適切なシェーディング推定係数を選択する例や、画像の複雑度に応じて評価重みを算出することで推定精度を向上させる例について検討した。   In order to solve such a problem, the present inventor, as a study example of an image processing apparatus that corrects color shading, applies a shading estimation coefficient to a block statistical value and calculates a block characteristic value for each block. And a block weight unit that calculates a block weight based on the block characteristic similarity between the block of interest and the neighboring block, and an example of selecting an appropriate shading estimation coefficient by eliminating the influence of a complicated subject has been studied. In addition, an estimation unit that applies a plurality of shading estimation coefficients to an image, selects an appropriate shading estimation coefficient for the image, and a correction that corrects shading of the image by applying a shading correction coefficient corresponding to the appropriate shading estimation coefficient to the image. And an estimation unit classifies the images into a plurality of groups based on the distance from the central portion of the image, calculates an image characteristic value for each group when a shading estimation coefficient is applied to the image, and An example of calculating a statistical value of an image characteristic value and selecting an appropriate shading estimation coefficient for the image, and an example of improving the estimation accuracy by calculating an evaluation weight according to the complexity of the image were studied.

検討の結果、撮像画像には未知の強度のシェーディングが生じているため、ブロック統計値に適用したシェーディング推定係数が必ずしも撮像画像の補正に適合するものではなく、近傍ブロックとの差分に、補正しきれないシェーディングの影響を受け平坦な被写体であってもブロック重みが低くなる場合があることを見出した。すなわち、上記のような検討例の技術を用いても、画像中央部と画像周辺部のシェーディングによる信号差と同程度の信号の違い(複雑さ)を持つ被写体は平坦であるものとして処理する必要があり、誤った補正係数を選択してしまう恐れがある。   As a result of the examination, shading of unknown intensity has occurred in the captured image, so the shading estimation coefficient applied to the block statistics value does not necessarily match the correction of the captured image, and it is corrected to the difference from the neighboring block. It has been found that the block weight may be low even for a flat subject due to the influence of shading that cannot be achieved. In other words, even with the above-described technique of the examination example, it is necessary to process an object having a signal difference (complexity) equivalent to the signal difference caused by shading between the central portion of the image and the peripheral portion of the image as flat. There is a risk of selecting an incorrect correction coefficient.

本実施の形態1は、上記のような従来技術や検討例をより改善し、画像に適したシェーディング補正係数の誤った選択の抑制を可能とする。すなわち、本実施の形態1では、画像端から中央へ向けて画像信号が滑らかに増加し、画像中央部から周辺部にかけて画像信号が滑らかに減衰する特徴に着目し、シェーディング発生時に特に目につきやすい平坦な被写体のシーンであることを検出して補正係数を選択することで、従来技術より精度よくシェーディング補正係数を選択できる画像処理装置を提供する。   The first embodiment further improves the above-described conventional techniques and examination examples, and makes it possible to suppress erroneous selection of a shading correction coefficient suitable for an image. That is, in the first embodiment, attention is paid to the feature that the image signal smoothly increases from the image edge toward the center and the image signal smoothly attenuates from the image center to the periphery, and is particularly noticeable when shading occurs. Provided is an image processing apparatus capable of selecting a shading correction coefficient more accurately than in the prior art by detecting a scene of a flat subject and selecting a correction coefficient.

<実施の形態1の構成>
図1は、本実施の形態1に係る画像処理装置を備えたデジタルスチルカメラ100の構成を示すブロック図である。図1に示すように、電子的撮像装置であるデジタルスチルカメラ100は、レンズ光学系102、撮像素子104、AFE回路106、画像信号処理回路108、画像表示部110、画像記録部112、ドライバ114、タイミングジェネレータ(TG)116、画像ブロック統計回路118、制御部120、係数記憶部122などを備えている。
<Configuration of Embodiment 1>
FIG. 1 is a block diagram illustrating a configuration of a digital still camera 100 including the image processing apparatus according to the first embodiment. As shown in FIG. 1, a digital still camera 100 that is an electronic imaging device includes a lens optical system 102, an imaging device 104, an AFE circuit 106, an image signal processing circuit 108, an image display unit 110, an image recording unit 112, and a driver 114. , A timing generator (TG) 116, an image block statistical circuit 118, a control unit 120, a coefficient storage unit 122, and the like.

レンズ光学系102は、レンズ、絞り、シャッターなどを有し、被写体像を撮像素子104の撮像面に結像する。撮像素子104はCCDやCMOSなどのイメージセンサであり、撮像素子104のレンズ光学系102側には赤外カットフィルタ(図示せず)が装着されている。撮像素子104は、被写体像を光電変換して画像信号(RGB色信号)を取得する。AFE回路106は、撮像素子104が取得し、CDS回路(図示せず)が信号処理を施した画像信号をA/D変換してデジタル信号とする。   The lens optical system 102 includes a lens, a diaphragm, a shutter, and the like, and forms a subject image on the imaging surface of the imaging element 104. The image sensor 104 is an image sensor such as a CCD or a CMOS, and an infrared cut filter (not shown) is mounted on the lens optical system 102 side of the image sensor 104. The image sensor 104 photoelectrically converts the subject image to obtain an image signal (RGB color signal). The AFE circuit 106 A / D converts an image signal acquired by the image sensor 104 and subjected to signal processing by a CDS circuit (not shown) into a digital signal.

画像信号処理回路108は、AFE回路106が出力した画像信号に、デモザイキング処理、エッジ強調処理、ホワイトバランス(WB)補正処理、シェーディング補正処理、ガンマ補正処理などを施す。画像表示部110は液晶表示ディスプレイ(LCD)などであり、画像信号処理回路108で各種処理が施された画像信号を表示する。画像記録部112はメモリであり、画像信号処理回路108で各種処理が施された画像信号を記録する。   The image signal processing circuit 108 performs demosaicing processing, edge enhancement processing, white balance (WB) correction processing, shading correction processing, gamma correction processing, and the like on the image signal output from the AFE circuit 106. The image display unit 110 is a liquid crystal display (LCD) or the like, and displays an image signal that has been subjected to various processes by the image signal processing circuit 108. The image recording unit 112 is a memory, and records the image signal that has been subjected to various processes by the image signal processing circuit 108.

ドライバ114は、レンズ光学系102のレンズ、絞り、シャッターを駆動する。タイミングジェネレータ116は、撮像素子104を駆動するためのタイミングを生成する。画像ブロック統計回路118は、AFE回路106でデジタル信号となった画像信号の撮像画像領域又は撮像画像領域の一部の領域を格子状に分割して複数のブロックとし、ブロック毎にブロック統計値を算出する。画像ブロック統計回路118は、ブロック分割部と統計値算出部を含んでいるとも言える。画像ブロック統計回路118は、ブロック統計値として、各ブロックでのRGB別の画素積算値やRGB別の画素平均値などの各ブロックの画像特性を示す値を算出する。画像ブロック統計回路118は、統計値以外の各ブロックの画像特性を示す値を算出しても良い。   The driver 114 drives the lens, aperture, and shutter of the lens optical system 102. The timing generator 116 generates timing for driving the image sensor 104. The image block statistical circuit 118 divides the captured image area or a part of the captured image area of the image signal converted into a digital signal by the AFE circuit 106 into a plurality of blocks, and calculates a block statistical value for each block. calculate. It can be said that the image block statistical circuit 118 includes a block dividing unit and a statistical value calculating unit. The image block statistical circuit 118 calculates a value indicating the image characteristic of each block, such as a pixel integrated value for each RGB and a pixel average value for each RGB, as a block statistical value. The image block statistical circuit 118 may calculate a value indicating the image characteristic of each block other than the statistical value.

制御部120は、画像ブロック統計回路118が算出したブロック統計値に基づいて、画像信号処理回路108のホワイトバランス補正処理を制御する。また、制御部120は、シェーディング推定部124、シェーディング補正部126を有している。   The control unit 120 controls white balance correction processing of the image signal processing circuit 108 based on the block statistical value calculated by the image block statistical circuit 118. In addition, the control unit 120 includes a shading estimation unit 124 and a shading correction unit 126.

シェーディング推定部124は、画像ブロック統計回路118が算出したブロック統計値と、係数記憶部122が記憶するシェーディング推定係数とに基づいてシェーディングを推定し、画像に適したシェーディング推定係数を選択する。シェーディング推定係数は光源毎に、また、R値、G値、B値毎に用意されており、ブロック毎の係数値を有している。シェーディング推定部124の構成及び動作については後述する。なお、光源別に設定された複数のシェーディング推定係数の集合を、シェーディング推定係数群と称する。   The shading estimation unit 124 estimates shading based on the block statistical value calculated by the image block statistical circuit 118 and the shading estimation coefficient stored in the coefficient storage unit 122, and selects a shading estimation coefficient suitable for the image. The shading estimation coefficient is prepared for each light source, for each R value, G value, and B value, and has a coefficient value for each block. The configuration and operation of the shading estimation unit 124 will be described later. A set of a plurality of shading estimation coefficients set for each light source is referred to as a shading estimation coefficient group.

シェーディング補正部126は、シェーディング推定部124が選択したシェーディング推定係数に対応するシェーディング補正係数を係数記憶部122から選択し、画像信号処理回路108において撮像画像のシェーディングを補正する。シェーディング補正係数は光源毎に、また、R値、G値、B値毎に用意されており、画素毎又は複数の画素毎の係数値を有している。   The shading correction unit 126 selects a shading correction coefficient corresponding to the shading estimation coefficient selected by the shading estimation unit 124 from the coefficient storage unit 122, and corrects shading of the captured image in the image signal processing circuit 108. The shading correction coefficient is prepared for each light source and for each R value, G value, and B value, and has a coefficient value for each pixel or for each of a plurality of pixels.

係数記憶部(推定係数記憶部及び補正係数記憶部)122は、シェーディング推定係数とシェーディング補正係数との組みを太陽光、電球、蛍光灯などの光源別に記憶している。多くの場合に、シェーディング推定係数とシェーディング推定係数とは1対1の組みとなっているが、これに限られるものではない。シェーディング推定係数及びシェーディング補正係数は、パソコンなどの外部装置において算出することができる。係数記憶部122は、各光源のそれぞれに対応する複数のシェーディング推定係数を含むシェーディング推定係数群を記憶し、また、補正強度の異なる複数のシェーディング推定係数を含むシェーディング推定係数群を記憶しているとも言える。   The coefficient storage unit (estimation coefficient storage unit and correction coefficient storage unit) 122 stores a combination of a shading estimation coefficient and a shading correction coefficient for each light source such as sunlight, a light bulb, and a fluorescent lamp. In many cases, the shading estimation coefficient and the shading estimation coefficient are in a one-to-one pair, but the present invention is not limited to this. The shading estimation coefficient and the shading correction coefficient can be calculated by an external device such as a personal computer. The coefficient storage unit 122 stores a shading estimation coefficient group including a plurality of shading estimation coefficients corresponding to each light source, and also stores a shading estimation coefficient group including a plurality of shading estimation coefficients having different correction strengths. It can also be said.

シェーディング推定係数は、各光源下で撮影した白色チャートの画像を用いて算出する。白色チャートには、標準白色反射板などの分光反射率が対象波長域全般に亘って一定でかつ90%以上の均等拡散反射面を用いることが望ましい。赤外光が多く含まれる電球などの光源に対しては、画像周辺部のR信号を強く補正するシェーディング推定係数が算出される。赤外光があまり含まれない蛍光灯などの光源に対しては、画像周辺部のR信号を弱く補正するシェーディング推定係数が算出される。本明細書では、画像周辺部のR信号を最も弱く補正するシェーディング推定係数を初期設定(デフォルト)のシェーディング推定係数とし、特に、シェーディング推定初期係数という。   The shading estimation coefficient is calculated using a white chart image taken under each light source. For the white chart, it is desirable to use a uniform diffuse reflection surface having a spectral reflectance such as a standard white reflector that is constant over the entire target wavelength range and 90% or more. For a light source such as a light bulb that contains a large amount of infrared light, a shading estimation coefficient that strongly corrects the R signal at the periphery of the image is calculated. For a light source such as a fluorescent lamp that does not contain much infrared light, a shading estimation coefficient for correcting the R signal at the periphery of the image weakly is calculated. In this specification, the shading estimation coefficient that corrects the R signal at the periphery of the image to the weakest level is set as an initial setting (default) shading estimation coefficient, and is particularly referred to as a shading estimation initial coefficient.

なお、本実施の形態1に係る画像処理装置は、画像信号処理回路108、画像ブロック統計回路118、制御部120、係数記憶部122などを含んで構成されるが、この構成に限られるものではない。   The image processing apparatus according to the first embodiment includes the image signal processing circuit 108, the image block statistical circuit 118, the control unit 120, the coefficient storage unit 122, and the like, but is not limited to this configuration. Absent.

また、制御部120が実現する各構成要素は、例えば、コンピュータである制御部120が備える演算装置(図示せず)の制御によって、プログラムを実行させることにより実現できる。より具体的には、制御部120は、記憶部(図示せず)に格納されたプログラムを主記憶装置(図示せず)にロードし、演算装置の制御によってプログラムを実行して実現する。また、各構成要素は、プログラムによるソフトウェアで実現することに限ることなく、ハードウェア、ファームウェア及びソフトウェアのうちのいずれかの組み合わせなどにより実現しても良い。   Moreover, each component which the control part 120 implement | achieves is realizable by making a program run by control of the arithmetic unit (not shown) with which the control part 120 which is a computer is provided, for example. More specifically, the control unit 120 is realized by loading a program stored in a storage unit (not shown) into a main storage device (not shown) and executing the program under the control of the arithmetic unit. Each component is not limited to being realized by software by a program, and may be realized by any combination of hardware, firmware, and software.

上述したプログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えば、フレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば、光磁気ディスク)、CD−ROM(Read Only Memory)、CD−R、CD−R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM(random access memory))を含む。   The above-described program can be stored using various types of non-transitory computer readable media and supplied to a computer. Non-transitory computer readable media include various types of tangible storage media. Examples of non-transitory computer-readable media include magnetic recording media (for example, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (for example, magneto-optical disks), CD-ROMs (Read Only Memory), CD-ROMs. R, CD-R / W, semiconductor memory (for example, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM (random access memory)).

また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されても良い。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバなどの有線通信路、または無線通信路を介して、プログラムをコンピュータに供給できる。   Further, the program may be supplied to the computer by various types of temporary computer readable media. Examples of transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. The transitory computer readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.

図2は、本実施の形態1に係るシェーディング推定部124の構成を示すブロック図である。シェーディング推定部124は、フラット判定部201、シェーディング推定係数選択部202などにより構成される。なお、後述の本実施の形態1の動作が実現できればよいため、この構成に限られない。例えば、被写体の明度を求める手段や、被写体の色温度を求める手段を備えていてもよい。   FIG. 2 is a block diagram showing the configuration of the shading estimation unit 124 according to the first embodiment. The shading estimation unit 124 includes a flat determination unit 201, a shading estimation coefficient selection unit 202, and the like. Note that the present embodiment is not limited to this configuration because it is only necessary to realize the operation of the first embodiment described later. For example, a means for obtaining the brightness of the subject and a means for obtaining the color temperature of the subject may be provided.

フラット判定部201は、撮影された被写体が平坦であるか否かを判定する。シェーディング推定係数選択部202は、被写体が平坦であるか否かに応じて、また、被写体輝度や光源色温度などの撮像条件に応じて、シェーディング推定係数群の中から、画像に適したシェーディング補正係数を選択する。   The flat determination unit 201 determines whether or not the photographed subject is flat. The shading estimation coefficient selection unit 202 selects a shading correction suitable for an image from the shading estimation coefficient group according to whether or not the subject is flat and according to imaging conditions such as subject brightness and light source color temperature. Select a coefficient.

<実施の形態1の動作>
図3は、本実施の形態1に係るシェーディング推定部124の動作を説明するためのフローチャートである。まず、フラット判定部201は、撮影された被写体が平坦であるか否かを判定する(ステップS1)。フラット判定部201は、画像の局所領域内の被写体による信号の変化の度合いを、すでに画像に発生しているシェーディングによる信号の変化を除外して求めることで、撮像した被写体が平坦であるか否かを判定する。なお、後述のように、明度や色温度を判定してもよい。画像平坦度、被写体明度、被写体色温度の少なくとも1つに応じて、ステップS2またはステップS3のいずれかを行ってもよい。
<Operation of Embodiment 1>
FIG. 3 is a flowchart for explaining the operation of shading estimation section 124 according to the first embodiment. First, the flat determination unit 201 determines whether or not the photographed subject is flat (step S1). The flat determination unit 201 obtains the degree of signal change due to the subject in the local area of the image by excluding the signal change due to shading that has already occurred in the image, so that whether the captured subject is flat or not. Determine whether. As will be described later, the brightness and color temperature may be determined. Either step S2 or step S3 may be performed according to at least one of image flatness, subject brightness, and subject color temperature.

ステップS1において、被写体がフラットであると判定された場合、シェーディング推定係数選択部202は、あらかじめ用意したシェーディング推定係数すべて(第1のシェーディング推定係数群)より、後述する式(13)で算出する評価値Edがもっとも小さいシェーディング推定係数を選択する(ステップS2)。   When it is determined in step S1 that the subject is flat, the shading estimation coefficient selection unit 202 calculates from all the shading estimation coefficients prepared in advance (first shading estimation coefficient group) by Expression (13) described later. A shading estimation coefficient having the smallest evaluation value Ed is selected (step S2).

一方、ステップS1において、被写体がフラットではない(複雑である)と判定された場合、シェーディング推定係数選択部202は、第1のシェーディング推定係数群のうち評価対象となるシェーディング推定係数を少なくとも1つ選択して第2のシェーディング推定係数群とする(ステップS3)。   On the other hand, when it is determined in step S1 that the subject is not flat (complex), the shading estimation coefficient selection unit 202 selects at least one shading estimation coefficient to be evaluated from the first shading estimation coefficient group. The second shading estimation coefficient group is selected to be selected (step S3).

続いて、シェーディング推定係数選択部202は、第2のシェーディング推定係数群より、評価値Edがもっとも小さいシェーディング推定係数を選択する(ステップS4)。また、シェーディング推定係数選択部202は、第2のシェーディング推定係数群を選択する場合、被写体輝度や光源色温度になどの撮像条件に応じて評価対象のシェーディング推定係数を選択する。   Subsequently, the shading estimation coefficient selection unit 202 selects a shading estimation coefficient having the smallest evaluation value Ed from the second shading estimation coefficient group (step S4). Further, when selecting the second shading estimation coefficient group, the shading estimation coefficient selection unit 202 selects a shading estimation coefficient to be evaluated according to imaging conditions such as subject brightness and light source color temperature.

次に、本実施の形態1に係るフラット判定部201の動作(図3のステップS1)について説明する。図4は、フラット判定部201が用いる検波ブロック(撮像画像)を模式的に示している。フラット判定部201は、撮像画像の周辺部から中央部に連続するブロックの画素値差分を積算することによって、画像平坦度を求める。   Next, the operation (step S1 in FIG. 3) of the flat determination unit 201 according to the first embodiment will be described. FIG. 4 schematically shows detection blocks (captured images) used by the flat determination unit 201. The flat determination unit 201 obtains the image flatness by integrating pixel value differences of blocks that are continuous from the peripheral part to the central part of the captured image.

フラット判定部201は、画像の対角線上にあたるブロックのG画素値を用いて、被写体がフラットであるかどうかを判定する。図4に示すように、画像の対角線上のブロックが判定対象のブロックとなるように、画像を4ラインで分割する。例えば、画像の左上から中央に延びるL2Cライン上の左上ブロック301から中央ブロック302まで、画像の中央から右下に延びるC2Rライン上の中央ブロック303から右下ブロック304まで、画像の右上から中央に延びるR2Cライン上の右上ブロック305から中央ブロック306まで、画像の中央から左下に延びるC2Lライン上の中央ブロック307から左下ブロック308までを、判定対象のブロックとする。なお、ここでは画像の角から中央に延びるラインと中央から対角に延びるラインを例示しているが、画像を分割するその他のラインを用いてもよい。   The flat determination unit 201 determines whether or not the subject is flat using the G pixel value of the block corresponding to the diagonal line of the image. As shown in FIG. 4, the image is divided into four lines so that the blocks on the diagonal of the image become the blocks to be determined. For example, from the upper left block 301 to the central block 302 on the L2C line extending from the upper left to the center of the image, from the central block 303 to the lower right block 304 on the C2R line extending from the center of the image to the lower right, from the upper right to the center of the image The blocks from the upper right block 305 to the center block 306 on the extending R2C line and the blocks from the center block 307 to the lower left block 308 on the C2L line extending from the center of the image to the lower left are set as the determination target blocks. Note that, here, a line extending from the corner of the image to the center and a line extending from the center to the diagonal are illustrated, but other lines for dividing the image may be used.

図5は、画像の対角線上のG画素値の例を示している。フラットな被写体である場合、例えば、画像の左上ブロック301から中央ブロック302まで、中央ブロック303から右下ブロック304へ向かうG画素の値は、図5のようになる。すなわち、左上ブロック301から中央ブロック302までの隣接ブロックの差分を加算し、中央ブロック303から右下ブロック304までの隣接ブロックの差分を減算すると(upG+dwG)、その値は0に近くなる。右上ブロック305から中央ブロック306までと、中央ブロック307から左下ブロック308までについても同様である。   FIG. 5 shows an example of the G pixel value on the diagonal line of the image. In the case of a flat subject, for example, the G pixel values from the upper left block 301 to the central block 302 and from the central block 303 to the lower right block 304 are as shown in FIG. That is, when the difference between adjacent blocks from the upper left block 301 to the central block 302 is added and the difference between adjacent blocks from the central block 303 to the lower right block 304 is subtracted (upG + dwG), the value becomes close to zero. The same applies to the upper right block 305 to the central block 306 and the central block 307 to the lower left block 308.

このように、シェーディング発生による隣接ブロックの画素値の変化の特徴を利用して、以下の式に示すフラット判定処理を行う。まず、フラット判定部201は、画像の左上から中央に延びるL2Cライン、画像の中央から右下に延びるC2Rライン、画像の右上から中央に延びるR2Cライン、画像の中央から左下に延びるC2LラインのG増分値(upG)とG減分値(dwG)の積算を次の(1)式にて求める。
In this way, the flat determination process shown in the following equation is performed using the feature of the change in the pixel value of the adjacent block due to the occurrence of shading. First, the flat determination unit 201 includes an L2C line extending from the upper left to the center of the image, a C2R line extending from the center of the image to the lower right, an R2C line extending from the upper right to the center of the image, and a G of a C2L line extending from the center of the image to the lower left. The integration of the increment value (upG) and the G decrement value (dwG) is obtained by the following equation (1).

次に、フラット判定部201は、上記式1の結果を用いて、L2CラインとC2Rラインのライン評価値El1、R2CラインとC2Lラインのライン評価値El2を次の(2)式にて求める。
Next, the flat determination unit 201 obtains the line evaluation value El1 of the L2C line and the C2R line and the line evaluation value El2 of the R2C line and the C2L line by the following expression (2) using the result of the above expression 1.

次に、フラット判定部201は、上記式2のライン評価値El1とEl2から、フラット評価値Efを次の(3)式にて求める。
Next, the flat determination unit 201 obtains the flat evaluation value Ef from the line evaluation values El1 and El2 of the above equation 2 using the following equation (3).

フラット判定部201は、上記(3)式の結果、フラット評価値Efが閾値未満の場合、フラットな被写体であると判定し、フラット評価値Efが閾値以上の場合はフラットではない被写体と判定する。例えば、図6(a)の画像の場合、フラット評価値Efが閾値未満であるため、被写体がフラットであると判定し、図6(b)の画像の場合、フラット評価値Efが閾値以上のため、被写体がフラットではないと判定する。   When the flat evaluation value Ef is less than the threshold value as a result of the above expression (3), the flat determination unit 201 determines that the object is a flat object, and determines that the object is not flat when the flat evaluation value Ef is equal to or greater than the threshold value. . For example, in the case of the image of FIG. 6A, since the flat evaluation value Ef is less than the threshold value, it is determined that the subject is flat. In the case of the image of FIG. 6B, the flat evaluation value Ef is greater than or equal to the threshold value. Therefore, it is determined that the subject is not flat.

次に、本実施の形態1に係るシェーディング推定係数選択部202が第1のシェーディング推定係数群から第2のシェーディング推定係数群を選択する動作(図3のステップS3)について説明する。シェーディング推定係数選択部202は、被写体がフラットかどうか、被写体明度(Bv)、色温度(R Color Gain)の値の組み合わせにより、シェーディング推定に使用する第2のシェーディング推定係数群を選択する。   Next, an operation (step S3 in FIG. 3) in which the shading estimation coefficient selection unit 202 according to the first embodiment selects the second shading estimation coefficient group from the first shading estimation coefficient group will be described. The shading estimation coefficient selection unit 202 selects a second shading estimation coefficient group to be used for shading estimation based on a combination of values of whether the subject is flat, subject brightness (Bv), and color temperature (R Color Gain).

以下に示す例では、光源色温度と被写体輝度(明度)とに応じて第2のシェーディング推定係数群を求める。例えば、次の表1に示すような、6種類の光源にそれぞれ対応する6種類のシェーディング推定係数(シェーディング推定テーブル)を含む第1のシェーディング推定係数群を予め記憶しておく。ここで、IRは光源に含まれる赤外光の量である。テーブル番号が大きくなるほど、赤外光が多い光源に対応して、Rの補正強度が強いシェーディング推定係数となる。

In the example shown below, the second shading estimation coefficient group is obtained according to the light source color temperature and the subject brightness (brightness). For example, as shown in Table 1 below, a first shading estimation coefficient group including six types of shading estimation coefficients (shading estimation table) respectively corresponding to six types of light sources is stored in advance. Here, IR is the amount of infrared light contained in the light source. As the table number increases, the shading estimation coefficient having a stronger R correction strength corresponds to a light source with more infrared light.

また、予め、電球色閾値(R Gain Limit Threshold)、屋内閾値(Indoor Bv Threshold)、屋外閾値(Outdoor Bv Threshold)を設定しておき、次の表2に示す条件1及び条件2に従い第2のシェーディング推定係数群を選択する。明度が屋内閾値より小さい場合、屋内の画像であると判定でき、明度が屋外閾値より大きい場合、屋外の画像であると判定できる。明度が屋内閾値以上、かつ、屋外閾値以下の場合、屋内から屋外寄りの画像であると判定できる。色温度が電球色閾値より小さい場合、電球の光源を含む画像であると判定でき、色温度が電球色閾値以上の場合、電球以外の光源を含む画像であると判定できる。

In addition, a light bulb color threshold (R Gain Limit Threshold), an indoor threshold (Indoor Bv Threshold), and an outdoor threshold (Outdoor Bv Threshold) are set in advance. Select a shading estimation coefficient group. When the brightness is smaller than the indoor threshold, it can be determined that the image is an indoor image, and when the brightness is larger than the outdoor threshold, it can be determined that the image is an outdoor image. When the brightness is equal to or greater than the indoor threshold and equal to or less than the outdoor threshold, it can be determined that the image is from indoor to outdoor. When the color temperature is lower than the light bulb color threshold, it can be determined that the image includes a light source of the light bulb, and when the color temperature is equal to or higher than the light bulb color threshold, it can be determined that the image includes a light source other than the light bulb.

すなわち、表2のように、フラットな被写体、または、Bv<屋内閾値である場合(条件1)、かつ、R Color Gain<電球色閾値である場合(条件2)には、表1に示した第1のシェーディング推定係数群の中から全光源のシェーディング推定係数(シェーディング推定テーブル0〜5)を第2のシェーディング推定係数群として選択する。また、フラットな被写体、または、Bv<屋内閾値である場合(条件1)、かつ、R Color Gain≧電球色閾値である場合(条件2)には、表1の中から電球色系光源以外のシェーディング推定係数(例えば、シェーディング推定テーブル0〜3)を選択する。また、フラットではない被写体の場合(条件1)、かつ、屋内閾値≦Bv≦屋外閾値である場合(条件2)には、表1の中から屋外寄りの光源のシェーディング推定係数(例えば、シェーディング推定テーブル1〜3)を選択する。また、フラットではない被写体の場合(条件1)、かつ、Bv>屋外閾値である場合(条件2)には、表1の中から屋外の光源のシェーディング推定係数(例えば、シェーディング推定テーブル1〜2)を選択する。すなわち、撮像画像が平坦であると判定した場合、被写体色温度に基づいて第1のシェーディング推定係数群の中から第2のシェーディング推定係数群を選択し、撮像画像が平坦ではないと判定した場合、被写体明度に基づいて第1のシェーディング推定係数群の中から第2のシェーディング推定係数群を選択する。また、被写体明度に基づいて撮像画像が屋内の画像であると判定した場合、被写体色温度に基づいて第1のシェーディング推定係数群の中から第2のシェーディング推定係数群を選択する。これにより、画像に適したシェーディング推定係数群を選択することができる。   That is, as shown in Table 2, when the subject is a flat object or when Bv <indoor threshold (condition 1) and R Color Gain <bulb color threshold (condition 2), the results are shown in Table 1. From the first shading estimation coefficient group, the shading estimation coefficients (shading estimation tables 0 to 5) of all the light sources are selected as the second shading estimation coefficient group. Further, in the case of a flat subject or when Bv <indoor threshold (condition 1) and R Color Gain ≧ light bulb color threshold (condition 2), a light source other than the bulb color light source is selected from Table 1. A shading estimation coefficient (for example, shading estimation tables 0 to 3) is selected. In the case of a non-flat subject (Condition 1) and when the indoor threshold ≦ Bv ≦ Outdoor threshold (Condition 2), the shading estimation coefficient (for example, shading estimation) of the outdoor light source from Table 1 is used. Select Tables 1-3). When the subject is not flat (condition 1) and Bv> outdoor threshold (condition 2), the shading estimation coefficient of the outdoor light source (for example, shading estimation tables 1 to 2) is selected from Table 1. ) Is selected. That is, when it is determined that the captured image is flat, the second shading estimation coefficient group is selected from the first shading estimation coefficient group based on the subject color temperature, and it is determined that the captured image is not flat The second shading estimation coefficient group is selected from the first shading estimation coefficient group based on the subject brightness. When it is determined that the captured image is an indoor image based on the subject brightness, a second shading estimation coefficient group is selected from the first shading estimation coefficient group based on the subject color temperature. Thereby, the shading estimation coefficient group suitable for the image can be selected.

次に、図3のように、シェーディング推定係数選択部202が第1のシェーディング推定係数群からシェーディング推定係数を選択する動作(ステップS2)、または、選択された第2のシェーディング推定係数群からシェーディング推定係数を選択する動作(ステップS4)について説明する。これらは同様の動作であり、図7はこの動作例を示している。すなわち、図7の動作により、シェーディング推定係数選択部202は第1または第2のシェーディング推定係数群からシェーディング推定係数を選択するが、これに限られるものではない。   Next, as shown in FIG. 3, the shading estimation coefficient selection unit 202 selects a shading estimation coefficient from the first shading estimation coefficient group (step S2), or shading from the selected second shading estimation coefficient group. The operation (step S4) for selecting the estimation coefficient will be described. These are similar operations, and FIG. 7 shows an example of this operation. That is, according to the operation of FIG. 7, the shading estimation coefficient selection unit 202 selects a shading estimation coefficient from the first or second shading estimation coefficient group, but the present invention is not limited to this.

まず、シェーディング推定係数選択部202は、画像ブロック統計回路118がシェーディング補正の対象となる画像から算出したブロック統計値を用いて、全てのブロックのR値、G値、B値の平均値Rav、Gav、Bavを算出する(ステップS010)。   First, the shading estimation coefficient selection unit 202 uses the block statistical value calculated from the image subjected to shading correction by the image block statistical circuit 118, and the average value Rav, R value, G value, and B value of all the blocks. Gav and Bav are calculated (step S010).

次に、(4)式に示すように、規格化係数Rg、Bg、Ggを算出する(ステップS020)。規格化係数Rg、Bg、Ggは、全画面のRGBバランスを一致させるための係数であって、画像を規格化するゲインである。
Next, normalization coefficients Rg, Bg, and Gg are calculated as shown in equation (4) (step S020). The normalization coefficients Rg, Bg, and Gg are coefficients for matching the RGB balance of the entire screen, and are gains that normalize the image.

次に、(5)式に示すように、全てのブロック統計値R(x,y)、G(x,y)、B(x,y)に対して、シェーディング推定係数Cr[t](x,y)、Cg[t](x,y)、Cg[t](x,y)及び規格化係数Rg、Bg、Ggを適用して乗算し、ブロック毎にRc[t](x,y)、Gc[t](x,y)、Bc[t](x,y) を算出する(ステップS030)。
Next, as shown in the equation (5), the shading estimation coefficient Cr [t] (x) for all the block statistical values R (x, y), G (x, y), and B (x, y) , y), Cg [t] (x, y), Cg [t] (x, y) and normalization coefficients Rg, Bg, Gg are applied and multiplied, and Rc [t] (x, y) is applied to each block. ), Gc [t] (x, y), Bc [t] (x, y) are calculated (step S030).

ここでは、後述する基準グループを選択するためのグループ毎のR信号比を算出するために、シェーディング推定係数として、前述のシェーディング推定初期係数を用いる。また、規格化係数は撮像画像のRGB平均値を無彩色とみなし、このRGB平均値から当該ブロックの色差がどの程度あるかを判定するために適用する。シェーディング推定係数が画像に適しているほど、Rc[t](x,y)、Gc[t](x,y)、Bc[t](x,y)は等しく1.0に近くなり、Rc[t](x,y)、Gc[t](x,y)、Bc[t](x,y)を画像化すると、画像は灰色一色となる。   Here, the aforementioned shading estimation initial coefficient is used as the shading estimation coefficient in order to calculate the R signal ratio for each group for selecting a reference group to be described later. In addition, the normalization coefficient is applied to determine the degree of color difference of the block from the RGB average value by regarding the RGB average value of the captured image as an achromatic color. Rc [t] (x, y), Gc [t] (x, y), Bc [t] (x, y) are equally close to 1.0 as the shading estimation coefficient is more suitable for an image. When [t] (x, y), Gc [t] (x, y), and Bc [t] (x, y) are imaged, the image becomes a single gray color.

次に、(6)式に示すように、ブロック毎にブロック特性値となるR信号比Rr[t](x,y)を求める(ステップS040、ステップS050)。
Next, as shown in equation (6), an R signal ratio Rr [t] (x, y) that is a block characteristic value is obtained for each block (step S040, step S050).

なお、(6)式の分母は、Rc[t](x,y)、Gc[t](x,y)、Bc[t](x,y)の和であっても良い。また、ブロック毎のR信号比に加えて、または、ブロック毎のR信号比に代えて、ブロック毎のB信号比を算出し、以降の処理に用いても良い。   Note that the denominator of equation (6) may be the sum of Rc [t] (x, y), Gc [t] (x, y), and Bc [t] (x, y). Further, in addition to the R signal ratio for each block or instead of the R signal ratio for each block, the B signal ratio for each block may be calculated and used for the subsequent processing.

(6)式では、規格化係数を適用したRGB画像についてR信号比を求めているため、シェーディング推定係数が画像に適しているときほど、有彩色の被写体、例えば、画像全面が赤となるような被写体であってもR信号比は1.0に近い値となる。逆に、シェーディング推定係数が画像に適していないときほど、R信号比は1.0から離れた値となる。   In the equation (6), since the R signal ratio is obtained for the RGB image to which the normalization coefficient is applied, the chromatic subject, for example, the entire image becomes red as the shading estimation coefficient is suitable for the image. Even if the subject is a small subject, the R signal ratio is close to 1.0. Conversely, the R signal ratio becomes a value farther from 1.0 when the shading estimation coefficient is not suitable for an image.

次に、シェーディング推定係数選択部202が、(7)式、(8)式に示すように、空間フィルタmを用いて注目ブロックとその近傍のブロックのR信号比の差Rd(x,y)を算出し、(9)式に示すように、ブロック毎の重みWb(x,y)を算出する(ステップS060、ステップS070)。RdmaxはR信号比の差Rd(x,y)の最大値である。撮影した被写体の複雑さ、画像の局所領域の複雑さをブロック重みに反映させて、画像の変化が小さく滑らかなとき、すなわちブロック間の類似度が大きいときにはブロック重みが大きくなるように、画像の変化が大きいとき、すなわちブロック間の類似度が小さいときにはブロック重みが小さくなるように算出する。
Next, the shading estimation coefficient selection unit 202 uses the spatial filter m to change the R signal ratio difference Rd (x, y) between the block of interest and its neighboring blocks, as shown in equations (7) and (8). And the weight Wb (x, y) for each block is calculated as shown in the equation (9) (steps S060 and S070). Rdmax is the maximum value of the R signal ratio difference Rd (x, y). The complexity of the photographed subject and the complexity of the local area of the image are reflected in the block weight, and when the image change is small and smooth, that is, when the similarity between blocks is large, the block weight is increased. When the change is large, that is, when the similarity between blocks is small, the block weight is calculated to be small.

なお、ブロック重みWb(x,y)を算出するときに、R信号比に加えて、または、R信号比に代えて、B信号比を用いても良い。   In calculating the block weight Wb (x, y), the B signal ratio may be used in addition to the R signal ratio or instead of the R signal ratio.

次に、シェーディング推定係数選択部202が、グループ特性値となるグループ毎のR信号比を算出する(ステップS080、ステップS090)。図8は、本実施の形態1に係るグループの例を説明するための図である。シェーディング推定係数選択部202は、画像ブロック統計回路118が画像領域を格子状に分割して取得した各ブロックを画像中央部からの距離に基づいて複数のグループに分類する。図8に示す画像400では、画像中央部から画像周辺部に向けて、この画像の各ブロックをグループ0からグループ5までの6つのグループに分類している。   Next, the shading estimation coefficient selection unit 202 calculates an R signal ratio for each group that is a group characteristic value (steps S080 and S090). FIG. 8 is a diagram for explaining an example of a group according to the first embodiment. The shading estimation coefficient selection unit 202 classifies each block acquired by the image block statistical circuit 118 by dividing the image region into a grid pattern into a plurality of groups based on the distance from the center of the image. In the image 400 shown in FIG. 8, each block of the image is classified into six groups from group 0 to group 5 from the center of the image toward the periphery of the image.

そして、(10)式に示すように、ブロック重みWb(x,y)を用いて、グループに含まれるブロックのR信号比Rr(i)を加重平均し、グループ毎のR信号比GpRr[j]を算出する。注目ブロックと近接ブロックとの類似度に基づくブロック重みWb(x,y)を用いることにより、画像の変化が小さく、滑らかなブロックやそれらのブロックが構成する領域の特性値をより重視してグループ毎の特性値を算出することができる。例えば、緑の葉、赤い花、空、建物などが写っている画像では、緑の葉と赤い花とが隣接しているようなブロックや領域の特性値よりも、空や建物があるブロックや領域の特性値を重視することができる。
Then, as shown in the equation (10), the block weight Wb (x, y) is used to average the R signal ratio Rr (i) of the blocks included in the group, and the R signal ratio GpRr [j for each group. ] Is calculated. By using the block weight Wb (x, y) based on the similarity between the target block and the neighboring block, the change in the image is small, and the characteristic value of the smooth block and the area formed by those blocks is more emphasized. Each characteristic value can be calculated. For example, in an image that shows green leaves, red flowers, sky, buildings, etc., the block or area characteristic values that are adjacent to green leaves and red flowers are more The characteristic value of the area can be emphasized.

次に、シェーディング推定係数選択部202が、基準グループの選択を行う(ステップS100)。画像中央部のグループより順次、外側のグループに向かって探索し、基準グループとして1つのグループを選択する。例えば、図8に示すグループ0より探索を開始し、シェーディングの影響を受けていないと考えられるグループ3までを探索する。このとき、(11)式に示すように、グループのR信号比GpRr[j]の閾値判定を行い、最初に(11)式を満たすグループを基準グループとして選択する。閾値Th1、Th2は、その間に1.0が含まれるように、例えば、0.9、1.1に設定する。規格化係数を適用した後に基準グループを選択しているので、無彩色の被写体の場合に限らず一様な有彩色の被写体の場合であっても基準グループを選択することができる。
Next, the shading estimation coefficient selection unit 202 selects a reference group (step S100). A search is performed sequentially from the group in the center of the image toward the outer group, and one group is selected as the reference group. For example, the search is started from the group 0 shown in FIG. 8, and the search is performed up to the group 3 that is considered not affected by the shading. At this time, as shown in the equation (11), threshold determination of the R signal ratio GpRr [j] of the group is performed, and a group satisfying the equation (11) is first selected as a reference group. The threshold values Th1 and Th2 are set to, for example, 0.9 and 1.1 so that 1.0 is included between them. Since the reference group is selected after applying the normalization coefficient, the reference group can be selected not only for an achromatic subject but also for a uniform chromatic subject.

次に、基準グループの有無を判定する(ステップS110)。基準グループが有ったとき(ステップS110のYes)は、グループ評価値を算出する(ステップS120、ステップS130)。グループ評価値は、ステップS100で選択した基準グループよりも外側の各グループについて算出する。例えば、基準グループとしてグループ1を選択したときには、外側のグループ2〜グループ5の各グループについてグループ評価値を算出する。(12)式に示すように、基準グループのR信号比GpRr[j]と外側のグループのR信号比GpRr[j+k]との差分を求め、あらかじめ用意した外側のグループの重みWg[j+k]を乗算して各グループ評価値Dg[j+k]を算出する。
Next, the presence / absence of a reference group is determined (step S110). When there is a reference group (Yes in step S110), a group evaluation value is calculated (step S120, step S130). The group evaluation value is calculated for each group outside the reference group selected in step S100. For example, when group 1 is selected as the reference group, a group evaluation value is calculated for each of the outer groups 2 to 5. As shown in the equation (12), the difference between the R signal ratio GpRr [j] of the reference group and the R signal ratio GpRr [j + k] of the outer group is obtained, and the weight Wg [j + k] of the outer group prepared in advance is obtained. Each group evaluation value Dg [j + k] is calculated by multiplication.

グループの重みWgは次の表3のようにグループ毎に用意する。画像周辺部のグループの方が、重みWgは大きい。これにより、シェーディング推定係数の画像周辺部のシェーディング補正の適否をより精度良く評価できるようになる。
The group weight Wg is prepared for each group as shown in Table 3 below. The group at the periphery of the image has a larger weight Wg. As a result, it is possible to more accurately evaluate the suitability of the shading correction of the shading estimation coefficient at the periphery of the image.

次に、(13)式に示すように、グループ評価値Dg[j+k]の絶対値の総和をとり、ステップS030で適用したシェーディング推定係数の評価値Edとする(ステップS140)。
Next, as shown in the equation (13), the sum of absolute values of the group evaluation values Dg [j + k] is taken to obtain the evaluation value Ed of the shading estimation coefficient applied in step S030 (step S140).

この評価値Edは画像中心部から周辺部にかけて減衰するR信号比の特徴を抽出するもので、シェーディング補正の対象となる画像に対して、ステップS030で用いたシェーディング推定係数が適しているか否かを判断するときの指標となる。   This evaluation value Ed is used to extract the characteristic of the R signal ratio that attenuates from the center to the periphery of the image. Whether or not the shading estimation coefficient used in step S030 is appropriate for the image subjected to shading correction. It becomes an index when judging.

次に、シェーディング推定係数選択部202は、シェーディング補正の対象となる画像について、すべてのシェーディング推定係数(第1のシェーディング推定係数群または第2のシェーディング推定係数群に含まれるシェーディング推定係数)の評価値Edを算出したか判定する(ステップS150)。すべてのシェーディング推定係数の評価値Edを算出していないとき(ステップS150のNo)は、ステップS030に戻り、評価値Edを算出していないシェーディング推定係数、すなわち、シェーディング推定初期係数以外のシェーディング推定係数について、ステップS030からステップS150までの処理を繰り返す。   Next, the shading estimation coefficient selection unit 202 evaluates all the shading estimation coefficients (the shading estimation coefficients included in the first shading estimation coefficient group or the second shading estimation coefficient group) for the image to be subjected to shading correction. It is determined whether the value Ed has been calculated (step S150). When the evaluation values Ed of all the shading estimation coefficients have not been calculated (No in step S150), the process returns to step S030, and the shading estimation coefficients for which the evaluation value Ed has not been calculated, that is, shading estimation other than the shading estimation initial coefficient, are returned. The processing from step S030 to step S150 is repeated for the coefficient.

なお、シェーディング推定初期係数以外のシェーディング推定係数の評価値Edを算出するときには、ステップS100の基準グループの選択、及び、ステップS110の基準グループの有無の判定を行わない。そして、シェーディング推定初期係数の評価値Edを算出するときに選択した基準グループ、例えば、グループ1を、そのまま、シェーディング推定初期係数以外のシェーディング推定係数の評価値Edを算出するときの基準グループとして選択する。つまり、シェーディング推定初期係数の評価値Edを算出するときに選択した基準グループに基づいて、シェーディング推定初期係数以外のシェーディング推定係数の評価値Edを算出する。   When calculating the evaluation value Ed of the shading estimation coefficient other than the shading estimation initial coefficient, the selection of the reference group in step S100 and the determination of the presence or absence of the reference group in step S110 are not performed. Then, the reference group selected when calculating the evaluation value Ed of the shading estimation initial coefficient, for example, the group 1 is selected as the reference group when calculating the evaluation value Ed of the shading estimation coefficient other than the shading estimation initial coefficient. To do. That is, the evaluation value Ed of the shading estimation coefficient other than the shading estimation initial coefficient is calculated based on the reference group selected when calculating the evaluation value Ed of the shading estimation initial coefficient.

最後に、シェーディング推定係数選択部202は、すべてのシェーディング推定係数の評価値Edを算出した後に(ステップS150のYes)、シェーディング推定初期係数を含むすべてのシェーディング推定係数の中で、評価値Edが最も小さくなるものを、シェーディング補正の対象となる画像に適したシェーディング推定係数であるとして選択する(ステップS160)。   Finally, after the shading estimation coefficient selection unit 202 calculates the evaluation values Ed of all the shading estimation coefficients (Yes in step S150), among all the shading estimation coefficients including the shading estimation initial coefficient, the evaluation value Ed is The smallest one is selected as the shading estimation coefficient suitable for the image to be subjected to shading correction (step S160).

また、シェーディング推定係数選択部202は、基準グループが無かったとき(ステップS110のNo)は、シェーディング推定初期係数をシェーディング補正の対象となる画像に適したシェーディング推定係数であるとして選択する(ステップS160)。   Further, when there is no reference group (No in step S110), the shading estimation coefficient selection unit 202 selects a shading estimation initial coefficient as a shading estimation coefficient suitable for an image to be subjected to shading correction (step S160). ).

なお、本実施の形態1では、シェーディング推定係数選択部202が、図8に示すように、シェーディング補正の対象となる画像全体に対して、基準グループ選択処理から評価値算出処理まで(ステップS100〜ステップS150)を行っているが、シェーディング補正の対象となる画像を複数の領域に分けて、それぞれの領域において、基準グループ選択処理から評価値算出処理までを行って良い。   In the first embodiment, as shown in FIG. 8, the shading estimation coefficient selection unit 202 performs the process from the reference group selection process to the evaluation value calculation process for the entire image to be subjected to shading correction (steps S100 to S100). Step S150) is performed, but the image to be subjected to the shading correction may be divided into a plurality of areas, and the process from the reference group selection process to the evaluation value calculation process may be performed in each area.

図9は、本実施の形態1に係る別のグループを説明するための図である。シェーディング推定係数選択部202は、シェーディング補正の対象となる画像401を4つの領域I〜IVに分け、更に、領域I〜IV内の各ブロックを画像中央部からの距離に基づいて複数のグループに分類する。例えば、図9に示す画像401では、領域Iにおいて、各ブロックをグループI−1からグループI−5までの5つのグループに分類する。そして、シェーディング推定係数選択部202が、領域I〜IVのそれぞれの領域において基準グループ選択処理から評価値算出処理までを行う。これにより、領域I〜IV毎に各シェーディング推定係数の評価値を算出し、領域I〜IV毎に被写体に適したシェーディング推定係数を選択することができる。   FIG. 9 is a diagram for explaining another group according to the first embodiment. The shading estimation coefficient selection unit 202 divides the image 401 to be subjected to shading correction into four regions I to IV, and further blocks each block in the regions I to IV into a plurality of groups based on the distance from the center of the image. Classify. For example, in the image 401 shown in FIG. 9, in the region I, each block is classified into five groups from group I-1 to group I-5. Then, the shading estimation coefficient selection unit 202 performs from the reference group selection process to the evaluation value calculation process in each of the areas I to IV. Thereby, the evaluation value of each shading estimation coefficient can be calculated for each of the regions I to IV, and the shading estimation coefficient suitable for the subject can be selected for each of the regions I to IV.

また、本実施の形態1においては、デジタルスチルカメラ100を例にして画像処理装置を説明したが、画像処理装置をパソコンなどの外部装置により構成し、当該装置において画像のシェーディング推定及びシェーディング補正を行うようにしても良い。   In the first embodiment, the image processing apparatus has been described using the digital still camera 100 as an example. However, the image processing apparatus is configured by an external apparatus such as a personal computer, and the apparatus performs shading estimation and shading correction of the image. You may make it do.

また、本実施の形態1においては、特許文献1記載のように選択した推定係数をそのまま補正係数として選択して用いても良い。すなわち、本実施の形態1に係るシェーディング補正係数には、シェーディング推定係数と異なるものと、シェーディング推定係数と同一のものとがあっても良い。   In the first embodiment, the estimated coefficient selected as described in Patent Document 1 may be selected and used as a correction coefficient as it is. That is, the shading correction coefficient according to the first embodiment may be different from the shading estimation coefficient or may be the same as the shading estimation coefficient.

また、本実施の形態1においては、シェーディング推定係数選択部202がシェーディング推定係数の評価値Edをグループ評価値Dgの絶対値の総和により求めたが、シェーディング推定係数の評価値をグループ評価値の分散などにより求めても良い。すなわち、本実施の形態1に係るシェーディング推定係数の評価値をグループ評価値の何らかの統計値により求めても良い。   In the first embodiment, the shading estimation coefficient selection unit 202 calculates the evaluation value Ed of the shading estimation coefficient by the sum of the absolute values of the group evaluation value Dg. You may obtain | require by dispersion | distribution etc. That is, the evaluation value of the shading estimation coefficient according to the first embodiment may be obtained from some statistical value of the group evaluation value.

また、本実施の形態1においては、シェーディング推定係数選択部202が各グループ評価値Dgを、基準グループのR信号比GpRrと外側のグループのR信号比GpRrとの差分を求め、これに外側のグループの重みWgを乗算して求めたが、各グループ評価値を、基準グループのR信号比と外側のグループのR信号比との差分として求めても良い。すなわち、外側のグループの重みを乗算することを省略しても良い。   Further, in the first embodiment, the shading estimation coefficient selection unit 202 obtains each group evaluation value Dg by obtaining a difference between the R signal ratio GpRr of the reference group and the R signal ratio GpRr of the outer group. Although it is obtained by multiplying the group weight Wg, each group evaluation value may be obtained as a difference between the R signal ratio of the reference group and the R signal ratio of the outer group. That is, multiplying the weight of the outer group may be omitted.

また、本実施の形態1においては、RGB色空間を用いてシェーディング推定係数を評価したが、HSVなどの他の色空間を用いてシェーディング推定係数を評価しても良い。具体的には、ブロック間の類似度であるブロック重みを算出するときに、RGB値をHSV変換して、ブロック間の彩度や輝度の変化に応じてブロック重みを算出しても良い。   In Embodiment 1, the shading estimation coefficient is evaluated using the RGB color space. However, the shading estimation coefficient may be evaluated using another color space such as HSV. Specifically, when calculating a block weight that is a degree of similarity between blocks, the RGB values may be subjected to HSV conversion, and the block weight may be calculated according to a change in saturation or luminance between the blocks.

以上、説明したように、本実施の形態1では、撮像画像を複数のブロックに分割しブロック毎に画素値を統計する統計値算出部を備え、ブロック統計値より撮像画像に発生するシェーディング推定を行う画像処理装置において、画像に発生するシェーディングの影響を除外した画像平坦度を求め、画像平坦度に応じてあらかじめ用意した複数のシェーディング推定係数(第1のシェーディング推定係数群)のうち評価対象の推定係数を少なくとも1つ選択して第2のシェーディング推定係数群とするシェーディング推定係数選択部を備え、第2のシェーディング推定係数群を用いて、画像に発生するシェーディングを推定して補正することで、誤ったシェーディング補正係数を選択することによって発生する副作用を低減することができる。本実施の形態1では、被写体明度、被写体複雑度、色温度に従ってシェーディング推定を誤りやすいシーンを検出し、シェーディング推定テーブルの拘束条件による副作用の発生を抑えることができる。   As described above, the first embodiment includes a statistical value calculation unit that divides a captured image into a plurality of blocks and statistically calculates a pixel value for each block, and performs shading estimation generated in the captured image from the block statistical values. In the image processing apparatus to perform, the image flatness excluding the influence of shading that occurs in the image is obtained, and the evaluation target among the plurality of shading estimation coefficients (first shading estimation coefficient group) prepared in advance according to the image flatness A shading estimation coefficient selection unit that selects at least one estimation coefficient and sets it as a second shading estimation coefficient group, and estimates and corrects shading generated in the image using the second shading estimation coefficient group; Side effects caused by selecting an incorrect shading correction coefficient can be reduced. In the first embodiment, it is possible to detect a scene in which shading estimation is likely to be erroneous in accordance with subject brightness, subject complexity, and color temperature, and to suppress the occurrence of side effects due to the constraint conditions of the shading estimation table.

(実施の形態2)
以下、図面を参照して実施の形態2について説明する。
(Embodiment 2)
The second embodiment will be described below with reference to the drawings.

<実施の形態2の概要>
上記のように、従来技術や検討例について検討し、実施の形態1では、検討例などの技術を用いても画像中央部と画像周辺部のシェーディングによる信号差と同程度の信号の違い(複雑さ)を持つ被写体は平坦であるものとして処理する必要があり、誤った補正係数を選択してしまう問題を解決するため、撮影された被写体が平坦(単純)であるかを判定し、シェーディング推定係数群のうち選択対象のシェーディング推定係数を限定することで推定精度の向上を可能とした。
<Outline of Embodiment 2>
As described above, the conventional technique and the examination example are examined. In the first embodiment, even if the technique such as the examination example is used, the signal difference (complexity) is the same as the signal difference due to the shading between the central portion of the image and the peripheral portion of the image. To solve the problem of selecting an incorrect correction coefficient, it is determined whether the photographed subject is flat (simple) and shading estimation is performed. The estimation accuracy can be improved by limiting the shading estimation coefficients to be selected from the coefficient group.

一方、図10に示すような2つ以上の異なる色相が混在した平坦な被写体を含む画像410であった場合には、前記いずれの手法を用いても誤推定が発生する場合がある。図10の画像410では、グレーの背景に青い平坦な被写体が含まれている。例えば青と赤など異なる色相の平坦な被写体が混在するような複雑ではない単調なシーンでは、近傍ブロックのブロック特性類似度が高くなるため複雑な被写体にはならない。このようなシーンでは異なる色相の平坦部は同様の重みとなるため、シェーディング推定結果が被写体色の影響を受け誤推定する恐れがある。   On the other hand, in the case of the image 410 including a flat subject in which two or more different hues are mixed as shown in FIG. 10, an erroneous estimation may occur even if any of the above methods is used. In the image 410 of FIG. 10, a blue flat subject is included on a gray background. For example, in a non-complex monotonous scene in which flat subjects of different hues such as blue and red are mixed, the block characteristic similarity of neighboring blocks is high, so that the subject is not complicated. In such a scene, flat portions having different hues have the same weight, so that the shading estimation result may be erroneously estimated due to the influence of the subject color.

本実施の形態2は、上記のような検討例や実施の形態1をより改善し、局所的には複雑ではなく単調な複数の色相が混在するシーンにおけるシェーディング推定の誤推定を低減させる。すなわち、本実施の形態2では、画像中の大面積を占める色相のブロックを抽出し評価することによって、画像に適したシェーディング補正係数の誤推定を抑制することのできる画像処理装置及び画像処理方法を提供する。   The second embodiment further improves the above examination example and the first embodiment, and reduces erroneous estimation of shading estimation in a scene in which a plurality of monotonous hues that are not complicated locally are mixed. That is, in the second embodiment, an image processing apparatus and an image processing method that can suppress erroneous estimation of a shading correction coefficient suitable for an image by extracting and evaluating a block of a hue that occupies a large area in the image. I will provide a.

<実施の形態2の構成>
本実施の形態2に係る画像処理装置を備えたデジタルスチルカメラ100の構成は、実施の形態1の図1と同様であるため、説明を省略する。
<Configuration of Embodiment 2>
Since the configuration of the digital still camera 100 including the image processing apparatus according to the second embodiment is the same as that of FIG. 1 of the first embodiment, the description thereof is omitted.

図11は、本実施の形態2に係るシェーディング推定部124の構成を示すブロック図である。シェーディング推定部124は、ブロック色評価値算出部211、ブロック重み係数算出部212、ブロック評価値算出部213、シェーディング推定係数選択部214などにより構成される。なお、後述の本実施の形態2の動作が実現できればよいため、この構成に限られない。例えば、ブロック色評価値算出部211とブロック重み係数算出部212とを1つのブロックとしてもよい。   FIG. 11 is a block diagram showing a configuration of shading estimation section 124 according to the second embodiment. The shading estimation unit 124 includes a block color evaluation value calculation unit 211, a block weight coefficient calculation unit 212, a block evaluation value calculation unit 213, a shading estimation coefficient selection unit 214, and the like. Note that the present embodiment is not limited to this configuration because it is only necessary to realize the operation of the second embodiment described later. For example, the block color evaluation value calculation unit 211 and the block weight coefficient calculation unit 212 may be a single block.

ブロック色評価値算出部211は、ブロック統計値と正規化ゲインとを用いてブロック色評価値Hbを算出する。ブロック重み係数算出部212は、ブロック色評価値Hbからヒストグラム重みを算出し、ヒストグラム重みとGレベル重みとを用いてブロック重みWbを算出する。ブロック評価値算出部213は、ブロック統計値とブロック重みWbとを用いてブロック評価値Ebを算出する。シェーディング推定係数選択部214は、ブロック評価値Ebを用いてグループ評価値を算出し、グループ評価値の変化量に基づいて、シェーディング推定係数(シェーディング推定テーブル)を選択する。   The block color evaluation value calculation unit 211 calculates a block color evaluation value Hb using the block statistical value and the normalization gain. The block weight coefficient calculation unit 212 calculates a histogram weight from the block color evaluation value Hb, and calculates a block weight Wb using the histogram weight and the G level weight. The block evaluation value calculation unit 213 calculates a block evaluation value Eb using the block statistical value and the block weight Wb. The shading estimation coefficient selection unit 214 calculates a group evaluation value using the block evaluation value Eb, and selects a shading estimation coefficient (shading estimation table) based on the change amount of the group evaluation value.

<実施の形態2の動作>
次に、本実施の形態2における画像中の大面積を占める色相のブロックを抽出する処理について説明する。このために、シェーディング推定部124は、シェーディング補正の対象画像のブロック統計値にシェーディング推定初期係数を乗算したものを用いてブロック重みBwを算出する。
図12は、本実施の形態2に係るブロック色評価値算出部211の動作を説明するためのフローチャートである。まず、ブロック色評価値算出部211は、評価するブロック内のR,G,B値を正規化するため、図12の動作により、シェーディング補正前のブロック統計値にデフォルトの最も補正強度が弱いシェーディング推定係数(シェーディング推定初期係数)を乗算してシェーディングを軽減し、正規化ゲインを算出する。
<Operation of Embodiment 2>
Next, a process for extracting a block of a hue that occupies a large area in an image according to the second embodiment will be described. For this purpose, the shading estimation unit 124 calculates the block weight Bw by using the block statistical value of the target image for shading correction multiplied by the shading estimation initial coefficient.
FIG. 12 is a flowchart for explaining the operation of the block color evaluation value calculation unit 211 according to the second embodiment. First, the block color evaluation value calculation unit 211 normalizes the R, G, and B values in the block to be evaluated. Therefore, by the operation in FIG. Multiplication by an estimation coefficient (shading estimation initial coefficient) reduces shading and calculates a normalized gain.

すなわち、ブロック色評価値算出部211は、次の(14)式を用いて、ブロック検波データにシェーディング推定初期係数を乗算する(ステップS201)。ブロック統計値をRi、Gi、Biとし、シェーディング推定初期係数の係数値をNr、Ng、Nbとしたとき、シェーディング推定初期係数を乗算後のブロック統計値Rn(N,M)、Gn(N,M)、Bn(N,M)は(14)式で表される。
That is, the block color evaluation value calculation unit 211 multiplies the block detection data by the shading estimation initial coefficient using the following equation (14) (step S201). When the block statistical values are Ri, Gi, Bi and the coefficient values of the shading estimation initial coefficients are Nr, Ng, Nb, the block statistical values Rn (N, M), Gn (N, Nb) after multiplication of the shading estimation initial coefficients M) and Bn (N, M) are expressed by the equation (14).

次に、シェーディング推定初期係数を乗算したブロック統計値Rn(N,M)、Gn(N,M)、Bn(N,M)を全ブロック分積算し(ステップS202、S203)、そのブロック統計値の比から正規化ゲイン(Average Gain)を算出する。ここでは、G画素の正規化ゲインは1.0とし、R画素とB画素の正規化ゲインを求める。   Next, block statistical values Rn (N, M), Gn (N, M), and Bn (N, M) multiplied by the shading estimation initial coefficient are added up for all blocks (steps S202 and S203), and the block statistical values are obtained. A normalization gain (Average Gain) is calculated from the ratio. Here, the normalization gain of the G pixel is 1.0, and the normalization gain of the R pixel and the B pixel is obtained.

具体的には、ブロック色評価値算出部211は、次の(15)式を用いて、正規化ゲインを求める。
Specifically, the block color evaluation value calculation unit 211 obtains a normalization gain using the following equation (15).

すなわち、Rn(N,M)またはBn(N,M)の積算値が0か否か判定し(ステップS204、S207)、0の場合、R画素またはB画素の正規化ゲイン(Average Gain R/Average Gain B)を1.0とする(ステップS206、S209)。一方、Rn(N,M)またはBn(N,M)の積算値が0ではない場合、R画素の正規化ゲイン=G積算値/R積算値またはB画素の正規化ゲイン=G積算値/B積算値とする(ステップS205、S208)。また、オーバーフロー防止のため、R画素またはB画素の正規化ゲインは、正規化ゲイン上限値(Average Gain Limit)(R,B)の値で上限クリップする(上限値とする)。   That is, it is determined whether or not the integrated value of Rn (N, M) or Bn (N, M) is 0 (steps S204 and S207). If 0, the normalized gain (Average Gain R / R) of the R pixel or B pixel is determined. (Average Gain B) is set to 1.0 (steps S206 and S209). On the other hand, when the integrated value of Rn (N, M) or Bn (N, M) is not 0, normalized gain of R pixel = G integrated value / R integrated value or normalized gain of B pixel = G integrated value / The B integrated value is set (steps S205 and S208). In order to prevent overflow, the normalization gain of the R pixel or B pixel is clipped to the upper limit with the value of the normalization gain upper limit (Average Gain Limit) (R, B) (set as the upper limit).

図13A及び図13Bは、本実施の形態2に係るブロック色評価値算出部211、ブロック重み係数算出部212及びブロック評価値算出部213の動作を説明するためのフローチャートである。図12の動作に続いて、ブロック重み係数算出部212は、図14に示すように、暗部や飽和付近のブロックを評価対処から除外する目的でGレベル重みを算出する(ステップS210)。Gレベル重みは、シェーディング推定係数を乗算後のブロック統計値のG値のレベルを参照し、あらかじめ設定した上限閾値と下限閾値の範囲内のブロックを1.0とし閾値範囲外のブロックを0.0とする。また、R画素値、G画素値、B画素値のいずれかの値が、予め設定した範囲外のブロックを、評価対象ブロックから除外してもよい。   13A and 13B are flowcharts for explaining operations of the block color evaluation value calculation unit 211, the block weight coefficient calculation unit 212, and the block evaluation value calculation unit 213 according to the second embodiment. Following the operation of FIG. 12, the block weight coefficient calculation unit 212 calculates the G level weight for the purpose of excluding dark blocks and blocks near saturation from the evaluation measures as shown in FIG. 14 (step S210). The G level weight refers to the level of the G value of the block statistical value after being multiplied by the shading estimation coefficient, and the block within the range of the upper limit threshold and the lower limit threshold set to 1.0 is set to 0. 0. Further, a block in which any one of the R pixel value, the G pixel value, and the B pixel value is outside the preset range may be excluded from the evaluation target block.

続いて、以降の処理で画像中の大面積を占める色相のブロックを抽出する。まず、ブロック色評価値算出部211は、全ブロックのブロック色評価値Hbを算出する(ステップS211)。(16)式のように、(14)式及び(15)式で求めた、シェーディング推定初期係数を乗算後のブロック統計値Gn(N,M)、Bn(N,M)に正規化ゲイン(Average Gain)を乗算し、ブロック色評価値Hb(N,M)を算出する。これは、第1のブロック統計値に正規化ゲインを乗算して第2のブロック統計値とし、第2のブロック統計値に基づいてブロック色評価値Hbを求めていると言える。また、第2のブロック統計値のRの比率、Gの比率、Bの比率のうち少なくとも1つに基づいてブロック色評価値を求めてもよい。Rの比率は、(16)式のように全RGBに対するRの比率の3倍(3R/(R+G+B))でもよいし、全RGBに対するRの比率(R/(R+G+B))でもよい。
Subsequently, hue blocks occupying a large area in the image are extracted in the subsequent processing. First, the block color evaluation value calculation unit 211 calculates block color evaluation values Hb for all blocks (step S211). Like the equation (16), the normalized gains (B, N, M) are multiplied by the block statistical values Gn (N, M) and Bn (N, M) obtained by multiplying the shading estimation initial coefficients obtained by the equations (14) and (15). (Average Gain) is multiplied to calculate a block color evaluation value Hb (N, M). It can be said that the block color evaluation value Hb is obtained based on the second block statistical value by multiplying the first block statistical value by the normalization gain to obtain the second block statistical value. The block color evaluation value may be obtained based on at least one of the R ratio, the G ratio, and the B ratio of the second block statistical value. The ratio of R may be three times the ratio of R to all RGB (3R / (R + G + B)) as shown in the equation (16), or may be the ratio of R to all RGB (R / (R + G + B)).

次に、ブロック重み係数算出部212は、ブロック色評価値Hbのヒストグラムを生成し(ステップS212)、最頻値から離れているブロックを除外する目的でヒストグラム重みを算出する(ステップS213〜S218)。図15(a)は、生成するヒストグラムとヒストグラム重みの一例を示しており、0.65〜1.35を0.05刻みのビンとした設定例である。   Next, the block weight coefficient calculation unit 212 generates a histogram of the block color evaluation value Hb (step S212), and calculates histogram weights for the purpose of excluding blocks that are far from the mode value (steps S213 to S218). . FIG. 15A shows an example of a histogram to be generated and histogram weights, and is a setting example in which 0.65 to 1.35 are bins with 0.05 increments.

具体的には、ヒストグラムの最頻値を探索し(ステップS213)、各ブロックについて、ブロック色評価値Hbがヒストグラム最頻値から有効レンジ内か否か判定し(ステップS214)、図15(b)のように、有効レンジ内の場合、ヒストグラム重み=1(ステップS215)とし、有効レンジ外の場合、ヒストグラム重み=0とする(ステップS217)。そして、ヒストグラム重み=1のブロックが、評価対象ブロックとして選択される。また、ステップS215に続いて、図16のように、Gレベル重みとヒストグラム重みを乗算しブロック重みBwを生成する(ステップS216)。これらの処理を繰り返し、全ブロックについてブロック重みBwを算出する(ステップS218)。これにより、ヒストグラムの最頻値の近傍のビンに分類されたブロックを評価対象ブロックに選択できる。シェーディング推定部124は、ブロック重みBw算出までの処理(ステップS201〜ステップS218)を、シェーディング補正の対象画像のブロック統計値にシェーディング推定初期係数を乗算したものを用いて行う。   Specifically, the mode value of the histogram is searched (step S213), and for each block, it is determined whether the block color evaluation value Hb is within the effective range from the histogram mode value (step S214), and FIG. ), The histogram weight = 1 (step S215) when the value is within the effective range, and the histogram weight = 0 when the value is outside the effective range (step S217). Then, the block having the histogram weight = 1 is selected as the evaluation target block. Further, following step S215, as shown in FIG. 16, the G level weight and the histogram weight are multiplied to generate a block weight Bw (step S216). These processes are repeated to calculate the block weight Bw for all blocks (step S218). Thereby, a block classified into bins in the vicinity of the mode value of the histogram can be selected as an evaluation target block. The shading estimation unit 124 performs processing up to the calculation of the block weight Bw (steps S201 to S218) by using the block statistical value of the target image for shading correction multiplied by the shading estimation initial coefficient.

次に、シェーディング推定部124は、各シェーディング推定係数(シェーディング推定テーブル)について、シェーディング推定評価値を算出し、画像を適切にシェーディング補正するシェーディング推定係数を選択する。具体的には、まず、ブロック評価値算出部213は、(17)式を用いて、シェーディング補正前のブロック統計値にシェーディング推定候補の一つのシェーディング推定テーブルの係数値を乗算し、乗算後のブロック統計値Rc、Gcを求める(ステップS219、S220)。シェーディング補正前のブロック統計値をRi、Giとし、推定候補のシェーディング推定テーブルをの係数値をCr[t]、Cg[t]としたとき、テーブル番号tにおける乗算後のブロック統計値Rc(N,M)、Gc(N,M)は(17)式で表される。
Next, the shading estimation unit 124 calculates a shading estimation evaluation value for each shading estimation coefficient (shading estimation table), and selects a shading estimation coefficient for appropriately shading correcting the image. Specifically, first, the block evaluation value calculation unit 213 uses the equation (17) to multiply the block statistical value before shading correction by the coefficient value of one shading estimation table of the shading estimation candidate, and after the multiplication. Block statistical values Rc and Gc are obtained (steps S219 and S220). If the block statistical values before shading correction are Ri and Gi, and the coefficient values of the estimation candidate shading estimation table are Cr [t] and Cg [t], the block statistical value Rc (N , M) and Gc (N, M) are expressed by equation (17).

次に、(18)式を用いて、ブロック(N,M)毎に、ブロック重みBw(N,M)を乗算したブロック評価値Eb(N,M)を算出する(ステップS221、S222)。
Next, the block evaluation value Eb (N, M) obtained by multiplying the block weight Bw (N, M) is calculated for each block (N, M) using the equation (18) (steps S221 and S222).

ブロック評価値算出部213は、ブロック評価値Ebを算出することで、評価対象ブロックを選択しているといえる。シェーディング推定係数選択部214は、すべてのブロックのブロック評価値Ebを算出後、画像領域を画像中心からの距離に応じて区画したグループ毎に、グループ内のブロック評価値が0のものを除いて平均化してグループ評価値とする。そして、中心部のグループから周辺部のグループにかけてグループ評価値の変化量をシェーディング推定評価値とする。以上の処理を繰り返して、各シェーディング推定係数についてシェーディング推定評価値を算出した後、シェーディング推定係数選択部214は、これらのシェーディング推定評価値に基づいて、適切なシェーディング推定係数(シェーディング補正係数)を選択する。なお、ブロック評価値算出以降の処理については、後述の実施の形態3のように処理してもよい。   It can be said that the block evaluation value calculation unit 213 selects the evaluation target block by calculating the block evaluation value Eb. After calculating the block evaluation value Eb of all blocks, the shading estimation coefficient selection unit 214 excludes the block evaluation value in the group that is 0 for each group in which the image area is divided according to the distance from the image center. Average to make the group evaluation value. Then, the amount of change in the group evaluation value from the central group to the peripheral group is used as the shading estimation evaluation value. After repeating the above processing to calculate the shading estimation evaluation value for each shading estimation coefficient, the shading estimation coefficient selection unit 214 calculates an appropriate shading estimation coefficient (shading correction coefficient) based on these shading estimation evaluation values. select. The processing after the block evaluation value calculation may be processed as in the third embodiment described later.

以上、説明したように、本実施の形態2では、撮像画像を複数のブロックに分割しブロック毎に画素値を統計する統計値算出部を備え、ブロック統計値より撮像画像に発生するシェーディング推定を行う画像処理装置において、ブロック統計値の「3R/(R+G+B)」または「R/(R+G+B)」で算出されるR比のヒストグラムによって、シェーディング推定に用いる有効ブロックを選択することにより、被写体による誤推定を低減してシェーディング推定精度を向上させることができる。本実施の形態2では、R比のヒストグラム最頻値付近のブロックを評価するため、複数の色相が混在するシーンでシェーディング誤推定を抑制することができる。   As described above, the second embodiment includes a statistical value calculation unit that divides a captured image into a plurality of blocks and statistically calculates pixel values for each block, and performs shading estimation generated in the captured image from the block statistical values. In the image processing apparatus, the effective block used for the shading estimation is selected by the histogram of the R ratio calculated by the block statistical value “3R / (R + G + B)” or “R / (R + G + B)”. The estimation can be reduced and the shading estimation accuracy can be improved. In the second embodiment, since the blocks near the histogram mode value of the R ratio are evaluated, shading error estimation can be suppressed in a scene in which a plurality of hues are mixed.

(実施の形態3)
以下、図面を参照して実施の形態3について説明する。
(Embodiment 3)
The third embodiment will be described below with reference to the drawings.

<実施の形態3の概要>
上記特許文献3に係る画像処理装置では、画像の各ブロックを画像の中央部からの距離に基づいて複数のグループに分類し、画像にシェーディング推定テーブルを適用したときの画像特性値をグループ毎に算出し、グループ毎の画像特性値を画像中央部からの距離に応じた重み付けをし、画像中央部のグループより順次外側のグループに向かって、基準グループを探索し、基準グループのR比と基準グループより外側のグループのR比との差分絶対値を求め、あらかじめ用意したグループ重みを乗算したものの総和をシェーディング推定テーブルの評価値としていた。これにより、画像中央部に彩度が高い被写体があった場合の誤判定を低減する効果が得られた。
<Outline of Embodiment 3>
In the image processing apparatus according to Patent Document 3, each block of the image is classified into a plurality of groups based on the distance from the center of the image, and the image characteristic value when the shading estimation table is applied to the image is determined for each group. The image characteristic value for each group is weighted according to the distance from the center of the image, the reference group is searched for sequentially toward the outer group from the group at the center of the image, and the R ratio of the reference group and the reference The absolute value of the difference from the R ratio of the group outside the group is obtained, and the sum of multiplications of group weights prepared in advance is used as the evaluation value of the shading estimation table. As a result, an effect of reducing erroneous determination when there is a subject with high saturation in the center of the image is obtained.

しかしながら、従来技術では、基準グループより周辺部に有彩色の被写体がある場合に誤った判定がなされることがある。   However, in the prior art, an erroneous determination may be made when there is a chromatic subject in the periphery of the reference group.

本実施の形態3では、あらかじめ用意した光源別のシェーディング推定テーブルを適用したブロック統計値に対し、ブロックの有効無効を判定し、ブロックの集合で構成されるグループの有効無効を判定し、画像中央のグループから周辺のグループへ向かう有効グループの連続性を判定する判定部を新たに設け、グループ連続性の判定結果に従い無効グループを補間して有効化し、同系色の被写体領域のグループを抽出し、有効グループの画像中央部から周辺部にかけてのR比の近似直線の傾きにしたがって、撮像画像の補正に適切なシェーディング補正テーブルを選択することで被写体による誤判定を低減する。   In the third embodiment, the block statistical value to which the shading estimation table for each light source prepared in advance is applied is determined whether the block is valid or invalid, the validity of the group composed of a set of blocks is determined, and the center of the image is determined. A determination unit that determines the continuity of the effective group from the group to the surrounding group is newly provided, and the invalid group is interpolated and enabled according to the determination result of the group continuity, and a group of subject areas of similar colors is extracted. By selecting a shading correction table appropriate for correcting the captured image according to the slope of the approximate straight line of the R ratio from the center to the periphery of the image of the effective group, erroneous determination by the subject is reduced.

<実施の形態3の構成>
本実施の形態3に係る画像処理装置を備えたデジタルスチルカメラ100の構成は、実施の形態1の図1と同様であるため、説明を省略する。
<Configuration of Embodiment 3>
Since the configuration of the digital still camera 100 provided with the image processing apparatus according to the third embodiment is the same as that of FIG. 1 of the first embodiment, the description thereof is omitted.

図17は、本実施の形態3に係るシェーディング推定部124の構成を示すブロック図である。実施の形態2の構成に加えて、グループ分類部221、グループ評価値算出部222、有効グループ判定部223、近似推定部224、分散推定部225を備えている。この例では、近似推定部224、分散推定部225は、シェーディング推定係数選択部214に含まれている。なお、後述の本実施の形態3の動作が実現できればよいため、この構成に限られない。例えば、近似推定部224の近似にしたがって、シェーディング推定係数選択部214がシェーディング推定係数を選択してもよい。   FIG. 17 is a block diagram showing a configuration of shading estimation section 124 according to the third embodiment. In addition to the configuration of the second embodiment, a group classification unit 221, a group evaluation value calculation unit 222, an effective group determination unit 223, an approximate estimation unit 224, and a variance estimation unit 225 are provided. In this example, the approximate estimation unit 224 and the variance estimation unit 225 are included in the shading estimation coefficient selection unit 214. Note that the present embodiment is not limited to this configuration as long as the operation of the third embodiment described later can be realized. For example, the shading estimation coefficient selection unit 214 may select a shading estimation coefficient according to the approximation of the approximation estimation unit 224.

グループ分類部221は、画像の中央部からの距離に応じて、画像のブロックを複数のグループに分類する。グループ評価値算出部222は、ブロック統計値に基づいてグループ評価値を算出する。グループ評価値算出部222は、ブロック統計値に基づいてブロックの有効または無効を判定する有効ブロック判定部を含んでいてもよく、グループ内の有効ブロックについて統計値の色別の総和に基づいてグループ評価値を算出する。有効グループ判定部223は、グループ評価値またはグループ内の有効ブロック数に基づいてグループの有効/無効を判定する。近似推定部(直線近似部)224は、グループ評価値に基づいて、シェーディング推定テーブルによる補正を近似する近似式を算出し、近似式に基づいてシェーディング推定テーブルを選択する。近似推定部224は、撮像画像の中央部から周辺部への有効グループについて、色(R)の比率を直線近似しているとも言える。分散推定部225は、ブロック評価値の標本分散を算出し、分散値が最小となるシェーディング推定テーブルを選択する。   The group classification unit 221 classifies the image blocks into a plurality of groups according to the distance from the center of the image. The group evaluation value calculation unit 222 calculates a group evaluation value based on the block statistical value. The group evaluation value calculation unit 222 may include an effective block determination unit that determines whether the block is valid or invalid based on the block statistical value. The group evaluation value calculation unit 222 performs grouping based on the sum of the statistical values for each of the effective blocks in the group. An evaluation value is calculated. The effective group determination unit 223 determines the validity / invalidity of the group based on the group evaluation value or the number of effective blocks in the group. The approximate estimation unit (straight line approximation unit) 224 calculates an approximate expression that approximates correction by the shading estimation table based on the group evaluation value, and selects the shading estimation table based on the approximate expression. It can be said that the approximate estimation unit 224 linearly approximates the ratio of the color (R) for the effective group from the center to the periphery of the captured image. The variance estimation unit 225 calculates the sample variance of the block evaluation value and selects a shading estimation table that minimizes the variance value.

<実施の形態3の動作>
本実施の形態3では、まず、実施の形態2におけるブロック評価値Eb算出までと同様の動作を行う。図18は、本実施の形態3に係るグループ分類部221、グループ評価値算出部222の動作を説明するためのフローチャートである。
<Operation of Embodiment 3>
In the third embodiment, first, the same operation as the calculation up to the block evaluation value Eb in the second embodiment is performed. FIG. 18 is a flowchart for explaining operations of the group classification unit 221 and the group evaluation value calculation unit 222 according to the third embodiment.

まず、グループ分類部221は、図19に示すように、検波ブロックを象限Q[0]〜[3]に四分割し、さらに中央からの距離に応じてG[0]〜[g]にグループ分けする(ステップS301)。   First, as shown in FIG. 19, the group classification unit 221 divides the detection block into four quadrants Q [0] to [3], and further groups the groups into G [0] to [g] according to the distance from the center. (Step S301).

次に、グループ評価値算出部222は、ブロック検波データに推定候補のシェーディング推定テーブル(Small Table)を乗算し(ステップS302)、ブロック評価値Ebを算出する(ステップS303)。実施の形態2と同様に、(17)式を用いて、シェーディング補正前のブロック統計値に推定候補のシェーディング推定テーブルを乗算し、さらに(18)式を用いてブロック重みBwを乗算してブロック評価値Ebを算出する。   Next, the group evaluation value calculation unit 222 multiplies the block detection data by an estimation candidate shading estimation table (Small Table) (step S302), and calculates a block evaluation value Eb (step S303). As in the second embodiment, the block statistics value before shading correction is multiplied by the shading estimation table of the estimation candidate using the equation (17), and the block weight Bw is further multiplied by the equation (18). An evaluation value Eb is calculated.

次に、グループ評価値算出部222は、(19)式のように、グループG[0]〜[g]毎にブロック評価値Eb(N,M)を積算したグループ積算値Eg[g]を算出し(ステップS304)、また、(20)式のように、グループG[0]〜[g]毎にブロック重みBw(N,M)を積算した有効ブロック数Nb[g]を算出する(ステップS305)。全ての推定候補のシェーディング推定テーブルについて、以上の処理(ステップS301〜ステップS306)を行う。グループ評価値算出部222は、グループ内に含まれるシェーディング推定係数を順次適用したブロック統計値のうち有効ブロックのブロック統計値の総和をグループ積算値Egとしている。
Next, the group evaluation value calculation unit 222 calculates the group integrated value Eg [g] obtained by integrating the block evaluation value Eb (N, M) for each of the groups G [0] to [g] as shown in the equation (19). (Step S304), and the number of effective blocks Nb [g] obtained by integrating the block weights Bw (N, M) for each of the groups G [0] to [g] is calculated as shown in the equation (20) ( Step S305). The above processing (steps S301 to S306) is performed on the shading estimation tables of all estimation candidates. The group evaluation value calculation unit 222 sets the sum of the block statistical values of the effective blocks among the block statistical values to which the shading estimation coefficients included in the group are sequentially applied as the group integrated value Eg.

次に、本実施の形態3に係るシェーディング推定テーブルの評価方法(シェーディング推定方法)について説明する。本実施の形態3では、グループ積算値Eg[g]を元に最小二乗法などを用いて近似直線推定を行い、近似直線の傾きの値から求めたテーブル番号tを推定結果とする。   Next, a method for evaluating a shading estimation table (shading estimation method) according to the third embodiment will be described. In the third embodiment, approximate line estimation is performed using the least square method based on the group integrated value Eg [g], and the table number t obtained from the slope value of the approximate line is used as the estimation result.

図20A及び部20Bは、本実施の形態3に係る有効グループ判定部223、近似推定部224の動作を説明するためのフローチャートである。   FIG. 20A and unit 20B are flowcharts for explaining operations of effective group determination unit 223 and approximation estimation unit 224 according to Embodiment 3.

まず、有効グループ判定部223は、グループG[0]〜[g]毎に有効ブロック数Nb[g]を判定する(ステップS310)。有効ブロック数Nb<有効ブロック数閾値の場合、有効ブロック数Nb=0とする。   First, the effective group determination unit 223 determines the effective block number Nb [g] for each of the groups G [0] to [g] (step S310). When the number of effective blocks Nb <the threshold number of effective blocks, the number of effective blocks Nb = 0.

次に、有効グループ判定部223は、(21)式を用いて、グループG[0]〜[g]毎にブロック評価値Ebの平均値Ag[g]を算出する(ステップS311)。有効ブロック数Nb<グループ内有効ブロック数閾値の場合、平均値Ag=0とし、有効ブロック(ブロック重みBw=1)の数Nbがグループ内有効ブロック数閾値(Enableグループ Count Threshold)未満のグループを推定から除外する。
Next, the effective group determination unit 223 calculates an average value Ag [g] of the block evaluation values Eb for each of the groups G [0] to [g] using the equation (21) (step S311). When the number of effective blocks Nb <the number of effective blocks in a group threshold, an average value Ag = 0, and a group in which the number Nb of effective blocks (block weight Bw = 1) is less than the number of effective blocks in a group (Enable Group Count Threshold) Exclude from estimation.

次に、(22)式を用いて、有効グループ判定部223は、ブロック評価値Ebの平均値Ag[g]を画像中央からの距離D[0]〜[d]毎に平均してグループ評価値Ad[d]を算出する(ステップS312)。図21は、距離D[0]〜[6]のグループの例を示している。
Next, using the equation (22), the effective group determination unit 223 averages the average value Ag [g] of the block evaluation values Eb for each of the distances D [0] to [d] from the center of the image, and performs group evaluation. A value Ad [d] is calculated (step S312). FIG. 21 shows an example of a group of distances D [0] to [6].

次に、有効グループ判定部223は、各距離グループについて、隣接距離グループとのグループ評価値Adの差分値Diffを算出する(ステップS313)。以上の処理(ステップS310〜ステップS313)についても、全ての推定候補のシェーディング推定テーブルで行う。
次に、有効グループ判定部223は、デフォルトのシェーディング推定テーブルについて(ステップS314のYes)、グループ評価値Ad[d]の値を用いて距離D[0]〜[d]の各グループの有効/無効判定(Ed=1:有効、Ed=0:無効)を行う(ステップS315)。グループ評価値Ad[d]=0、もしくは隣接距離グループとのグループ評価値Adの差分Diffが大きい又は小さい距離Dのグループは無効とする。すなわち、差分値DiffがMinTh(最小閾値)〜MaxTh(最大閾値)内の場合は有効(Ed=1)、差分値DiffがMinTh〜MaxTh外の場合は無効(Ed=0)とする。図22Aは、D[0]〜[1]が無効、D[2]〜「6」が有効の例であり、図22Bは、D[0]〜[3]、[6]が有効であり、D[4]〜[5]が無効の例である。
Next, the effective group determination unit 223 calculates the difference value Diff of the group evaluation value Ad with the adjacent distance group for each distance group (step S313). The above processing (steps S310 to S313) is also performed with the shading estimation tables of all estimation candidates.
Next, the effective group determination unit 223 uses the value of the group evaluation value Ad [d] for the default shading estimation table (Yes in step S314), and determines whether each group of distances D [0] to [d] is valid / Invalidity determination (Ed = 1: Valid, Ed = 0: Invalid) is performed (step S315). The group evaluation value Ad [d] = 0, or a group having a distance D having a large or small difference Diff of the group evaluation value Ad from the adjacent distance group is invalid. That is, when the difference value Diff is within MinTh (minimum threshold) to MaxTh (maximum threshold), it is valid (Ed = 1), and when the difference value Diff is outside MinTh to MaxTh, it is invalid (Ed = 0). 22A is an example in which D [0] to [1] are invalid, and D [2] to “6” are valid. In FIG. 22B, D [0] to [3] and [6] are valid. , D [4] to [5] are invalid examples.

次に、有効グループ判定部(無効グループ有効化部)223は、単独の無効距離グループ(Ed=0)の両隣にそれぞれ2個以上の連続した有効距離グループ(Ed=1)があり、かつ、単独の無効距離グループと両隣の有効距離グループとのグループ評価値Adの差分Diffがそれぞれ無効距離グループ補間閾値以下である場合に、単独の無効距離グループのEd=0を1に補間して有効距離グループ化する(ステップS316)。
有効グループ判定部223は、撮像画像の中央部から周辺部へ向かうグループのうち有効グループの連続性を判定するグループ連続性判定部と、グループ連続性の判定結果に従い、無効と判定されたグループを有効化する無効グループ有効化部とを含んでいてもよい。例えば、無効グループ有効化部は、単独の無効クループの両隣に2個以上の連続して有効グループがあり、かつ、無効クループに隣接する2つの有効グループの差分が閾値以下の場合に無効グループを有効化する。図23(a)は、D[2]の両隣のグループ評価値Adの差分が閾値以下のため、補間対象となる例であり、図23(b)は、D[1]の両隣が連続していないため、補間対象外となる例であり、図23(c)は、D[2]〜[3]が単独のEd=0ではないため、補間対象外となる例である。
Next, the effective group determination unit (invalid group enabling unit) 223 has two or more consecutive effective distance groups (Ed = 1) on both sides of a single invalid distance group (Ed = 0), and When the difference Diff of the group evaluation value Ad between the single invalid distance group and the adjacent effective distance groups is equal to or smaller than the invalid distance group interpolation threshold, Ed = 0 of the single invalid distance group is interpolated to 1, and the effective distance is interpolated. Grouping is performed (step S316).
The effective group determination unit 223 includes a group continuity determination unit that determines the continuity of the effective group among the groups from the center to the periphery of the captured image, and the group determined to be invalid according to the determination result of the group continuity. It may include an invalid group validation unit to validate. For example, the invalid group enabling unit selects an invalid group when there are two or more consecutive valid groups on both sides of a single invalid group and the difference between two valid groups adjacent to the invalid group is equal to or less than a threshold value. Activate. FIG. 23A is an example in which the difference between the group evaluation values Ad on both sides of D [2] is equal to or smaller than the threshold value, and FIG. 23B is an example in which both sides of D [1] are continuous. Therefore, FIG. 23C is an example in which D [2] to [3] are not independent because Ed = 0 is not independent.

次に、有効グループ判定部(グループ連続性判定部)は、有効距離(Ed=1)の連続数Neにより推定方式を決定する(ステップS317)。Neの数が少ない場合、推定困難な複雑な被写体である可能性が高いため分散推定へ移行する。すなわち、Ne>有効距離グループ連続数閾値の場合、後述の近似直線推定処理を行い、Ne≦有効距離グループ連続数閾値の場合、分散推定処理(ステップS318)を行う。ここまでの処理(ステップS315〜ステップS318)はデフォルトのシェーディング推定テーブル(シェーディング推定初期係数)を用いて行う。   Next, the effective group determination unit (group continuity determination unit) determines an estimation method based on the number Ne of effective distances (Ed = 1) (step S317). When the number of Ne is small, there is a high possibility that the subject is a complicated subject that is difficult to estimate, so the process proceeds to variance estimation. That is, if Ne> effective distance group continuation number threshold value, approximate line estimation processing described later is performed, and if Ne ≦ effective distance group continuation number threshold value, variance estimation processing (step S318) is performed. The processing so far (steps S315 to S318) is performed using a default shading estimation table (shading estimation initial coefficient).

次に、近似推定部(近似直線推定部)224は、全ての推定候補のシェーディング推定テーブルについて、最小二乗法を用いて有効距離(Ed=1)のグループ評価値Adの近似直線を算出し(ステップS320、S321)、傾きの値から最適なテーブル番号tを求める(ステップS322)。このとき、有効距離(Ed=1)は、デフォルトのシェーディング推定テーブルを用いてステップS315、S316で求めたものを全ての推定候補のシェーディング推定テーブルに適用する。例えば、デフォルトのシェーディング推定テーブルの有効距離がD[2]〜[4]であったならば、全てのシェーディング推定テーブルの有効距離をD[2]〜[4]とする。そして、近似直線の傾きが負の場合、負の傾きの中で最も0に近いテーブル番号を推定結果とし(ステップS323)、また、傾きが負ではない(正である)場合、最小値のテーブル番号を推定結果とする(ステップS324)。近似推定部224(または、シェーディング推定係数選択部)は、近似した直線が水平に近くなるような、または、あらかじめ設定した基準の傾きに最も近くなるようなシェーディング推定係数群を選択してもよい。なお、Rの比率を近似する場合、全RGBに対するRの比率(R/(R+G+B))を用いてもよいし、全RGBに対するRの比率の3倍(3R/(R+G+B))を用いてもよい。   Next, the approximate estimator (approximate straight line estimator) 224 calculates an approximate straight line of the group evaluation value Ad of the effective distance (Ed = 1) using the least square method for all the estimation candidate shading estimation tables ( In steps S320 and S321), an optimum table number t is obtained from the value of the inclination (step S322). At this time, the effective distance (Ed = 1) obtained in Steps S315 and S316 using the default shading estimation table is applied to the shading estimation tables of all estimation candidates. For example, if the effective distance of the default shading estimation table is D [2] to [4], the effective distance of all the shading estimation tables is set to D [2] to [4]. If the slope of the approximate straight line is negative, the table number closest to 0 among the negative slopes is used as the estimation result (step S323). If the slope is not negative (positive), the minimum value table is used. The number is used as an estimation result (step S324). The approximate estimation unit 224 (or the shading estimation coefficient selection unit) may select a shading estimation coefficient group such that the approximated straight line is close to horizontal or closest to a preset reference inclination. . When approximating the ratio of R, the ratio of R to all RGB (R / (R + G + B)) may be used, or three times the ratio of R to all RGB (3R / (R + G + B)) may be used. Good.

次に、推定結果のテーブル番号と前回の推定テーブル番号との差分を求め(ステップS325)、差分が1の場合、推定結果が安定するようにヒステリシスを使用して推定結果の更新判定を行う。すなわち、推定結果テーブル番号−前回推定テーブル番号=1の場合、Slope(傾き)>SlopeHys(ヒステリシスの傾き)*−1を満たすか否か判定し(ステップS326)、推定結果テーブル番号−前回推定テーブル番号=−1の場合、Slope(傾き)<SlopeHys(ヒステリシスの傾き)を満たすか否か判定する(ステップS327)。Slope>SlopeHys*−1を満たす場合(ステップS326のYes)、または、Slope<SlopeHysを満たす場合(ステップS327のYes)、前回の推定結果を維持する(ステップS328、S330)。ステップS325で推定結果テーブル番号−前回推定テーブル番号が±1以外の場合(ステップS325のelse)、または、Slope>SlopeHys*−1を満たさない場合(ステップS326のNo)、または、Slope<SlopeHysを満たさない場合(ステップS327のNo)、推定結果を今回のテーブル番号に確定する(ステップS329)。   Next, the difference between the table number of the estimation result and the previous estimation table number is obtained (step S325). When the difference is 1, the update of the estimation result is determined using hysteresis so that the estimation result is stabilized. That is, when the estimation result table number-previous estimation table number = 1, it is determined whether or not Slope (slope)> SlopeHys (hysteresis slope) *-1 is satisfied (step S326). When the number = -1, it is determined whether or not Slope (slope) <SlopeHys (hysteresis slope) is satisfied (step S327). When Slope> SlopeHys * -1 is satisfied (Yes in step S326) or when Slope <SlopeHys is satisfied (Yes in step S327), the previous estimation result is maintained (steps S328 and S330). In step S325, if the estimation result table number−the previous estimation table number is other than ± 1 (else in step S325), or if Slope> SlopeHys * −1 is not satisfied (No in step S326), or Slope <SlopeHys. If not satisfied (No in step S327), the estimation result is fixed to the current table number (step S329).

図24は、推定候補シェーディング推定テーブル毎の近似直線イメージを示している。図24のように、過補正でなく、かつ、補正結果が水平に近いテーブル(図24の(a))を推定結果とする。また、全テーブルが過補正の場合、最も補正の弱いテーブルを推定結果とする。   FIG. 24 shows an approximate straight line image for each estimation candidate shading estimation table. As shown in FIG. 24, a table that is not overcorrected and the correction result is almost horizontal ((a) in FIG. 24) is used as the estimation result. If all the tables are overcorrected, the table with the weakest correction is used as the estimation result.

図25は、本実施の形態3に係る分散推定部225の動作を説明するためのフローチャートである。近似直線推定が困難な複雑な被写体の場合、分散推定部225は、画像全体のブロック評価値Ebの平均値であるブロック評価平均値Abと各ブロック評価値Ebとから標本分散を求め(有効ブロックのみ使用)、分散値が最小となるテーブル番号tを推定結果とする。   FIG. 25 is a flowchart for explaining the operation of variance estimation section 225 according to Embodiment 3. In the case of a complex subject for which approximate line estimation is difficult, the variance estimation unit 225 obtains a sample variance from the block evaluation average value Ab that is an average value of the block evaluation values Eb of the entire image and each block evaluation value Eb (effective block). Only table), and the table number t with the smallest variance value is taken as the estimation result.

すなわち、分散推定部225は、(23)式を用いて、有効ブロックのブロック評価平均値Abを算出する(ステップS331)。有効ブロック(ブロック重みBw=1)の数Nb、ブロック評価平均値Abは(23)式で表される。
That is, the variance estimation unit 225 calculates the block evaluation average value Ab of the effective block using the equation (23) (step S331). The number Nb of effective blocks (block weight Bw = 1) and the block evaluation average value Ab are expressed by equation (23).

次に、分散推定部225は、(24)式を用いて、有効ブロックの標本分散Varpを算出して記憶し(ステップS332、ステップS333)、全ての推定候補のシェーディング推定テーブルを用いて、以上の処理を繰り返す(ステップS334)。
Next, the variance estimation unit 225 calculates and stores the sample variance Varp of the effective block using the equation (24) (steps S332 and S333), and uses the shading estimation table of all estimation candidates, The above process is repeated (step S334).

次に、分散推定部225は、(25)式を用いて、分散値が最小となるテーブル番号tを推定結果とする(ステップS335)。
Next, the variance estimation unit 225 uses the equation (25) as the estimation result for the table number t that minimizes the variance value (step S335).

以上、説明したように、本実施の形態3では、撮像画像を複数のブロックに分割しブロック毎に画素値を統計する統計値算出部を備え、ブロック統計値により撮像画像に発生するシェーディングの推定を行う画像処理装置において、撮像画像に複数の光源に対応するシェーディング推定テーブルを順次適用する。シェーディング推定テーブルを適用したブロック画像に対し、画像中央部のブロックからの距離に応じてブロックをグループ分類し、推定に用いるグループであるかを判定する。画像中央のグループから画像周辺部のグループのR比を直線近似する。複数の光源に対応した推定テーブル分の近似直線の傾きにしたがって、シェーディング推定テーブルに一対一に対応したシェーディング補正テーブルを選択することで、従来技術より高精度にシェーディングを補正することができる。本実施の形態3では、画像中央領域から周辺領域へのR比変化の連続性を評価してテーブル評価値を算出するため、被写体色によるR比の変化を排除することでシェーディング誤推定を抑制することができる。   As described above, Embodiment 3 includes a statistical value calculation unit that divides a captured image into a plurality of blocks and statistically calculates pixel values for each block, and estimates shading generated in the captured image based on the block statistical values. In the image processing apparatus that performs the above, a shading estimation table corresponding to a plurality of light sources is sequentially applied to the captured image. For the block image to which the shading estimation table is applied, the blocks are grouped according to the distance from the block at the center of the image, and it is determined whether the group is used for estimation. The R ratio of the image peripheral group to the image peripheral group is linearly approximated. By selecting a shading correction table corresponding to the shading estimation table on a one-to-one basis according to the inclination of the approximate line for the estimation table corresponding to a plurality of light sources, the shading can be corrected with higher accuracy than in the prior art. In the third embodiment, since the table evaluation value is calculated by evaluating the continuity of the R ratio change from the center area of the image to the peripheral area, the shading error estimation is suppressed by eliminating the change of the R ratio due to the subject color. can do.

(実施の形態4)
以下、図面を参照して実施の形態4について説明する。
(Embodiment 4)
The fourth embodiment will be described below with reference to the drawings.

<実施の形態4の概要>
上記実施の形態3に係る画像処理装置では、ブロックの有効無効を判定し、グループの有効無効を判定し、画像中央のグループから周辺のグループへ向かう有効グループの連続性を判定し、無効グループを補間して有効化し、同系色の被写体領域のグループを抽出し、有効グループの画像中央部から画像周辺部にかけてのR比の近似直線の傾きにしたがって、撮像画像の補正に適切なシェーディング補正テーブルを選択した。
<Outline of Embodiment 4>
In the image processing apparatus according to the third embodiment, the validity / invalidity of the block is determined, the validity / invalidity of the group is determined, the continuity of the effective group from the group in the center of the image toward the peripheral group is determined, and the invalid group is determined. Validate by interpolating, extract a group of subject areas of similar colors, and create a shading correction table suitable for correcting captured images according to the slope of the approximate straight line of the R ratio from the center of the effective group to the periphery of the image Selected.

これに対し、本実施の形態4に係る画像処理装置は、有効グループの判定方法を変更して有効グループの数、すなわち、評価対象グループの数を増やし、また、連続する有効グループ毎に分散値を求め、当該分散値を加算したものをシェーディング推定テーブルの評価値とすることで、誤判定の発生を抑制し、シェーディング推定の精度向上を図るものである。   On the other hand, the image processing apparatus according to the fourth embodiment changes the effective group determination method to increase the number of effective groups, that is, the number of evaluation target groups, and the variance value for each continuous effective group. And by adding the variance value as an evaluation value of the shading estimation table, the occurrence of erroneous determination is suppressed and the accuracy of shading estimation is improved.

<実施の形態4の構成>
本実施の形態4に係る画像処理装置を備えたデジタルスチルカメラ100の構成も、実施の形態1の図1と同様であるため、説明を省略する。
<Configuration of Embodiment 4>
The configuration of the digital still camera 100 provided with the image processing apparatus according to the fourth embodiment is also the same as that of FIG.

図26は、本実施の形態4に係るシェーディング推定部124の構成を示すブロック図である。図17に示した実施の形態3に係るシェーディング推定係数選択部214の近似推定部224及び分散推定部225に代えて、グループ分散推定部226及びブロック分散推定部227を備えている。
もちろん、後述の本実施の形態4の動作が実現できればよいため、この構成に限られない。
FIG. 26 is a block diagram showing a configuration of shading estimation section 124 according to the fourth embodiment. A group variance estimation unit 226 and a block variance estimation unit 227 are provided instead of the approximate estimation unit 224 and the variance estimation unit 225 of the shading estimation coefficient selection unit 214 according to Embodiment 3 shown in FIG.
Of course, it is only necessary to realize the operation of the fourth embodiment to be described later, and the present invention is not limited to this configuration.

グループ分散推定部226は、連続する有効グループ(グループ連続領域)毎にグループ評価値Adの分散値を求め、当該分散値を積算したものをシェーディング推定係数の評価値とし、最も小さな評価値を有するシェーディング推定係数を画像に適切なシェーディング推定係数と判定するものである。
また、ブロック分散推定部227は、グループ連続領域の数が所定数よりも少ないときに、グループ分散推定部226の上記処理に代わりに、有効ブロック分散推定処理を行うものである。
つまり、本実施の形態4に係るシェーディング推定部124はグループ分散又はブロック分散のいずれかによってシェーディングを推定するということができる。
The group variance estimation unit 226 obtains the variance value of the group evaluation value Ad for each continuous effective group (group continuous region), and uses the sum of the variance values as the evaluation value of the shading estimation coefficient, and has the smallest evaluation value. The shading estimation coefficient is determined as a shading estimation coefficient appropriate for the image.
The block variance estimation unit 227 performs an effective block variance estimation process instead of the above process of the group variance estimation unit 226 when the number of group continuous regions is smaller than a predetermined number.
That is, it can be said that the shading estimation unit 124 according to the fourth embodiment estimates shading by either group variance or block variance.

<実施の形態4の動作>
本実施の形態4では、まず、実施の形態3に係るステップS301〜ステップS312と同様の処理を行い、ブロック評価値Ebの平均値Ag[g]を画像中央からの距離D[0]〜[d]毎に平均してグループ評価値Ad[d]を算出する。
<Operation of Embodiment 4>
In the fourth embodiment, first, processing similar to that in steps S301 to S312 according to the third embodiment is performed, and the average value Ag [g] of the block evaluation values Eb is calculated from the distances D [0] to [[ The group evaluation value Ad [d] is calculated by averaging every d].

図27は、本実施の形態4に係るシェーディング推定部124の動作を説明するためのフローチャートである。
実施の形態3に係るステップS301〜ステップS306と同様の処理を行った後に、有効グループ判定部223が距離グループG[0]〜G[g]毎に有効ブロック数Nb[g]を判定する(ステップS401)。このとき、有効ブロック数Nb<有効ブロック数閾値であれば、有効ブロック数Nb=0とする。
FIG. 27 is a flowchart for explaining the operation of shading estimation section 124 according to the fourth embodiment.
After performing the same processing as steps S301 to S306 according to the third embodiment, the effective group determination unit 223 determines the number of effective blocks Nb [g] for each of the distance groups G [0] to G [g] ( Step S401). At this time, if the effective block number Nb <the effective block number threshold, the effective block number Nb = 0.

次に、有効グループ判定部223が前述の(21)式を用いて、グループG[0]〜[g]毎にブロック評価値Ebの平均値Ag[g]を算出する(ステップS402)。このとき、有効ブロック数Nb=0であれば、平均値Ag[g]=0とする。つまり、グループ内の有効ブロック数が少ないときは、当該グループを無効として、以下の推定処理から除外する。   Next, the effective group determination unit 223 calculates the average value Ag [g] of the block evaluation values Eb for each of the groups G [0] to [g] using the above equation (21) (step S402). At this time, if the number of effective blocks Nb = 0, the average value Ag [g] = 0. That is, when the number of valid blocks in the group is small, the group is invalidated and excluded from the following estimation process.

次に、有効グループ判定部223が前述の(22)式を用いて、ブロック評価値Ebの平均値Ag[g]を画像中央からの距離D[0]〜[d]毎に平均してグループ評価値Ad[d]を算出する(ステップS403)。
以上のステップS403までの各処理は、デフォルトのシェーディング推定係数、すなわち、シェーディング推定初期係数を含む、全てのシェーディング推定係数について行う。
Next, the effective group determination unit 223 averages the average value Ag [g] of the block evaluation values Eb for each of the distances D [0] to [d] from the center of the image using the above-described equation (22). An evaluation value Ad [d] is calculated (step S403).
Each process up to step S403 is performed for all shading estimation coefficients including a default shading estimation coefficient, that is, a shading estimation initial coefficient.

次に、有効グループ判定部223は、撮像画像に適用したのが、シェーディング推定初期係数なのか、シェーディング推定初期係数以外のシェーディング推定係数なのかを判定する(ステップS404)。
撮像画像に適用したのがシェーディング推定初期係数であるときは(ステップS404のYes)、有効グループ判定部223は、隣接距離グループ間のグループ評価値Adの差分値Diffを算出し(ステップS405)、有効距離グループ及びグループ連続領域を判定する(ステップS406)。
Next, the effective group determination unit 223 determines whether the applied shading image is a shading estimation initial coefficient or a shading estimation coefficient other than the shading estimation initial coefficient (step S404).
When the shading estimation initial coefficient is applied to the captured image (Yes in step S404), the effective group determination unit 223 calculates a difference value Diff of the group evaluation values Ad between adjacent distance groups (step S405). An effective distance group and a group continuous area are determined (step S406).

図28は、本実施の形態4に係る有効距離グループの判定方法を説明するための図である。図の横方向は、画像を距離D[0]〜D[6]の7グループに分けたときの各グループを示す。図の縦方向は各距離D[n]におけるグループ評価値Adを示す。
本実施の形態4では、注目グループとその両隣のグループとの間のグループ評価値Adの差分値Diffがそれぞれ隣接グループ差判定閾値を超えていたときに、当該注目グループを無効グループと判定する。
FIG. 28 is a diagram for explaining an effective distance group determination method according to the fourth embodiment. The horizontal direction in the figure shows each group when the image is divided into seven groups of distances D [0] to D [6]. The vertical direction in the figure indicates the group evaluation value Ad at each distance D [n].
In the fourth embodiment, when the difference value Diff of the group evaluation value Ad between the target group and the groups adjacent to the target group exceeds the adjacent group difference determination threshold value, the target group is determined as an invalid group.

図28(A)に示すシーン1の場合には、D[0]〜D[2]のグループ評価値Ad及びD[3]〜D[6]のグループ評価値Adはそれぞれほぼ一定であり、これらの距離の間ではDiffはほぼ0である。また、D[2]とD[3]との間のDiffは隣接グループ差判定閾値よりも大きい。この場合、D[0]〜D[6]の各グループをいずれも有効距離グループと判定する。   In the case of the scene 1 shown in FIG. 28A, the group evaluation values Ad of D [0] to D [2] and the group evaluation values Ad of D [3] to D [6] are substantially constant, Between these distances, Diff is almost zero. Also, Diff between D [2] and D [3] is larger than the adjacent group difference determination threshold. In this case, each group of D [0] to D [6] is determined as an effective distance group.

図28(B)に示すシーン2の場合には、D[0]〜D[2]のグループ評価値Ad及びD[4]〜D[6]のグループ評価値Adはそれぞれほぼ一定であり、これらの距離の間ではDiffはほぼ0である。また、D[2]とD[3]との間及びD[3]とD[4]との間のDiffはそれぞれ隣接グループ差判定閾値よりも大きい。この場合、D[0]〜D[2]、D[4]〜D[6]の各グループを有効距離グループと判定し、D[3]を無効距離グループと判定する。
なお、D[0]又はD[6]のように隣接グループが一つだけ存在する注目グループは、当該一つの隣接グループとのグループ評価値Adの差Diffを閾値と比較して、有効無効の判定をする。
In the case of the scene 2 shown in FIG. 28B, the group evaluation values Ad of D [0] to D [2] and the group evaluation values Ad of D [4] to D [6] are substantially constant, Between these distances, Diff is almost zero. Also, Diff between D [2] and D [3] and between D [3] and D [4] are larger than the adjacent group difference determination threshold value. In this case, each group of D [0] to D [2] and D [4] to D [6] is determined as an effective distance group, and D [3] is determined as an invalid distance group.
Note that the attention group having only one adjacent group, such as D [0] or D [6], is effective / invalid by comparing the difference Diff of the group evaluation value Ad with the one adjacent group with a threshold value. Make a decision.

図29は、本実施の形態4に係る有効距離グループの判定方法の具体的な処理内容を説明するための図である。画像を距離D[0]〜D[6]の7グループに分けたときの処理内容である。上から距離グループD[0]〜D[6]とそのグループ評価値Ad値、Diff配列値、Ed配列値を示している。   FIG. 29 is a diagram for explaining specific processing contents of the effective distance group determination method according to the fourth embodiment. This is a processing content when images are divided into seven groups of distances D [0] to D [6]. From the top, distance groups D [0] to D [6] and their group evaluation values Ad values, Diff array values, and Ed array values are shown.

まず、隣接グループとのグループ評価値Adの差Diffが閾値以上の区間は0、閾値内の区間は1としてDiff配列に格納する。このとき、Diff配列は(隣接距離グループの数)+1の分を用意して、その先頭と末尾は「0」固定とする。この例では、Diff配列(*‐D0)、(D1‐D2)、(D2‐D3)、(D7‐*)の4箇所に「0」が格納される。   First, a section where the difference Diff of the group evaluation value Ad with the adjacent group is equal to or greater than the threshold is stored in the Diff array as 0, and a section within the threshold is set as 1. At this time, (difference group number) +1 is prepared for the Diff array, and the beginning and end thereof are fixed to “0”. In this example, “0” is stored in four locations of the Diff array (* -D0), (D1-D2), (D2-D3), and (D7- *).

次に、各グループの有効無効を判定する。具体的には、Diff配列の隣接要素の論理積を求めてEd配列に格納する。この例では、Ed配列(D2)の1箇所に「0」が格納される。つまり、距離グループD[2]を無効距離グループ、距離グループD[0]、D[1]、D[3]〜D[6]を有効距離グループと判定する。
そして、Ed配列内で2つ以上「1」が連続している箇所、すなわち、有効距離グループが2つ以上連続している箇所をグループ連続領域(Series)と判定する。この例では、D[0]〜D[1]が一つのグループ連続領域、D[3]〜D[6]がもう一つのグループ連続領域、すなわち、二つのグループ連続領域が判定される。
Next, the validity / invalidity of each group is determined. Specifically, the logical product of adjacent elements in the Diff array is obtained and stored in the Ed array. In this example, “0” is stored in one place of the Ed array (D2). That is, the distance group D [2] is determined as an invalid distance group, and the distance groups D [0], D [1], and D [3] to D [6] are determined as effective distance groups.
Then, a place where two or more “1” s continue in the Ed array, that is, a place where two or more effective distance groups continue is determined as a group continuous region (Series). In this example, D [0] to D [1] are determined as one group continuous area, and D [3] to D [6] as another group continuous area, that is, two group continuous areas are determined.

次に、有効グループ判定部223は、グループ連続領域の数が所定の閾値以上あるか判定し(ステップS407)、グループ連続領域の数が所定の閾値以上あるとき(ステップS407のYes)は、グループ分散推定部226によるステップS408以降の処理に進み、グループ連続領域の数が所定の閾値未満のとき(ステップS407のNo)は、ブロック分散推定部227によるステップS412の有効ブロック分散推定処理に進む。この例では、グループ連続領域の数Ns=2であり、ステップS408以降の処理に進む。
なお、ここまでの処理(ステップS405〜ステップS407)は、撮像画像にシェーディング推定初期係数を適用して得られた特性値を用いて行う。
Next, the effective group determination unit 223 determines whether the number of group continuous areas is equal to or greater than a predetermined threshold (step S407). When the number of group continuous areas is equal to or greater than the predetermined threshold (Yes in step S407), the group Proceeding to the processing after step S408 by the variance estimating unit 226, and when the number of group continuous regions is less than the predetermined threshold (No in step S407), the processing proceeds to the effective block variance estimating process of step S412 by the block variance estimating unit 227. In this example, the number of group continuous regions Ns = 2, and the process proceeds to step S408 and subsequent steps.
The processing so far (steps S405 to S407) is performed using the characteristic values obtained by applying the shading estimation initial coefficient to the captured image.

一方、撮像画像に適用したのがシェーディング推定初期係数以外のシェーディング推定係数であるときは(ステップS404のNo)、ただちに、グループ分散推定部226によるステップS408以降の処理に進む。   On the other hand, when a shading estimation coefficient other than the shading estimation initial coefficient is applied to the captured image (No in step S404), the process immediately proceeds to step S408 and subsequent steps by the group variance estimation unit 226.

次に、グループ分散推定部226は、(26)式、(27)式を用いて、グループ連続領域における分散値SeriesVarp[n]を求める(ステップS408、S409)。ここで、Neはグループ連続領域内のグループ数である。また、グループ連続領域は、撮像画像にシェーディング推定初期係数を適用したものを用いてステップS405、S406で求めたグループ連続領域の範囲(上記の例では、D[0]〜D[1]及びD[3]〜D[6])を、シェーディング推定初期係数に係る分散値を求めるときにも、シェーディング推定初期係数以外のシェーディング推定係数に係る分散値を求めるときにも共通して用いる。分散値SeriesVarp[n]を求めることにより、グループ連続領域毎のグループ評価値Ad値の起伏を評価することができる。
Next, the group variance estimation unit 226 obtains a variance value SeriesVarp [n] in the group continuous region using the equations (26) and (27) (steps S408 and S409). Here, Ne is the number of groups in the group continuous area. Further, the group continuous region is a range of group continuous regions obtained in steps S405 and S406 using a captured image obtained by applying a shading estimation initial coefficient (in the above example, D [0] to D [1] and D [3] to D [6]) are commonly used when obtaining a variance value related to a shading estimation initial coefficient and when obtaining a variance value relating to a shading estimation coefficient other than the shading estimation initial coefficient. By obtaining the variance value SeriesVarp [n], the undulation of the group evaluation value Ad value for each group continuous region can be evaluated.

次に、グループ分散推定部226は、(28)式を用いて、グループ連続領域毎の分散値SeriesVarp[n]を積算してテーブル評価値Et[t]を算出する(ステップS410)。
ここまでの処理(ステップS408〜S410)を、シェーディング推定初期係数を含む全てのシェーディング推定係数について行う。
Next, the group variance estimation unit 226 calculates the table evaluation value Et [t] by integrating the variance values SeriesVarp [n] for each group continuous region using the equation (28) (step S410).
The processing so far (steps S408 to S410) is performed for all the shading estimation coefficients including the shading estimation initial coefficient.

そして、グループ分散推定部226は、(29)式のように、全てのシェーディング推定係数の中で、そのテーブル評価値Et[t]が最も小さくなるものを、撮像画像に最も適したシェーディング推定係数であるとして選択する(ステップS411)。
なお、ブロック分散推定部227が行う有効ブロック分散推定処理(ステップS412)は、実施の形態3に係る分散推定部225が行う分散推定処理(ステップS318又はステップS331〜ステップS335)と同様であって、ここでは説明を省略する。
Then, the group variance estimation unit 226 calculates a shading estimation coefficient that is most suitable for the captured image from among all the shading estimation coefficients, as shown in equation (29), that has the smallest table evaluation value Et [t]. Is selected (step S411).
The effective block variance estimation process (step S412) performed by the block variance estimation unit 227 is the same as the variance estimation process (step S318 or steps S331 to S335) performed by the variance estimation unit 225 according to the third embodiment. The description is omitted here.

以上、説明したように、本実施の形態4に係る画像処理装置は、画像を、当該画像の中心部からの距離に基づいて複数のグループに分類するグループ分類部221と、当該画像にシェーディング推定係数を適用したときのグループ毎のグループ評価値を算出するグループ評価値算出部222と、グループ評価値に基づいて有効グループを判定し、隣接する有効グループをグループ連続領域として判定する有効グループ判定部223と、グループ連続領域毎のグループ評価値の分散値を積算してシェーディング推定係数のテーブル評価値とし、最も小さいテーブル評価値を有するシェーディング推定係数を選択するシェーディング推定係数選択部214と、選択したシェーディング推定係数に対応するシェーディング補正係数を用いて画像を補正するシェーディング補正部108とを備えるもので、誤判定の発生を抑制して、シェーディング推定の精度向上を図ることができる。   As described above, the image processing apparatus according to the fourth embodiment includes a group classification unit 221 that classifies an image into a plurality of groups based on the distance from the center of the image, and shading estimation on the image. A group evaluation value calculation unit 222 that calculates a group evaluation value for each group when the coefficient is applied, and an effective group determination unit that determines an effective group based on the group evaluation value and determines adjacent effective groups as a group continuous region 223 and a shading estimation coefficient selection unit 214 that selects a shading estimation coefficient having the smallest table evaluation value by accumulating the variance values of the group evaluation values for each group continuous region to obtain a table evaluation value of the shading estimation coefficient The image is compensated using the shading correction coefficient corresponding to the shading estimation coefficient. Those comprising a shading correction unit 108, and suppress the occurrence of erroneous determination, it is possible to improve the accuracy of the shading estimation.

なお、本発明は上記各実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。上記各実施の形態に係る構成を適宜組み合わせることも可能である。   Note that the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the spirit of the present invention. It is possible to appropriately combine the configurations according to the above embodiments.

上記の各実施形態の一部または全部は、以下の付記のようにも記載され得るが、以下には限られない。   A part or all of each of the above embodiments can be described as in the following supplementary notes, but is not limited thereto.

(付記1)
撮像画像を複数のブロックに分割するブロック分割部と、
ブロック毎に画素値を統計することでブロック統計値を算出する統計値算出部と、
前記ブロック統計値に、予め、複数の光源別に用意したシェーディング補正テーブルを順次適用したブロック統計値を解析処理することで、前記撮像画像に発生するシェーディングを推定する画像処理装置であって、
シェーディング推定に用いるテーブル群のうち推定に用いるテーブル群を、画像平坦度、被写体明度、被写体色温度の少なくとも1つに応じて、限定するシェーディング推定テーブル選択手段を備えることを特徴とする画像処理装置またはその画像処理方法。
(Appendix 1)
A block division unit that divides the captured image into a plurality of blocks;
A statistical value calculation unit that calculates block statistical values by statistically calculating pixel values for each block;
An image processing apparatus that estimates shading that occurs in the captured image by analyzing block statistic obtained by sequentially applying a shading correction table prepared for each light source in advance to the block statistic,
An image processing apparatus comprising: a shading estimation table selection unit that limits a table group used for estimation among at least one of image flatness, subject brightness, and subject color temperature among the table groups used for shading estimation. Or its image processing method.

(付記2)
前記画像平坦度は、ブロック統計値周辺部から中央部に連続するブロックの画素値差分を積算することによって、平坦な被写体シーンであることを判別することを特徴とする付記1記載の画像処理装置またはその画像処理方法。
(Appendix 2)
The image processing apparatus according to claim 1, wherein the image flatness is determined as a flat subject scene by integrating pixel value differences between blocks that are continuous from a block statistical value peripheral part to a central part. Or its image processing method.

(付記3)
撮像画像を複数のブロックに分割するブロック分割部と、
ブロック毎にRGB別の画素値を統計したブロック統計値を算出する統計値算出部と、
前記ブロック統計値に、予め、補正強度の異なる複数のシェーディング推定テーブルを順次適用したブロック統計値を解析処理することで、前記撮像画像に発生するシェーディングを推定する画像処理装置であって、
前記解析処理は、前記ブロック統計値より、ブロック色評価値を算出するブロック色評価値算出手段と、
前記ブロック色評価値のヒストグラムを算出し、ヒストグラム分布によってシェーディング推定のための評価対象ブロックを選択する評価ブロック選択手段を備えることを特徴とする画像処理装置またはその画像処理方法。
(Appendix 3)
A block division unit that divides the captured image into a plurality of blocks;
A statistical value calculation unit for calculating a block statistical value in which pixel values for each RGB are statistically calculated for each block;
An image processing apparatus that estimates shading occurring in the captured image by analyzing block statistic obtained by sequentially applying a plurality of shading estimation tables having different correction strengths to the block statistic in advance,
The analysis process includes a block color evaluation value calculation unit that calculates a block color evaluation value from the block statistical value;
An image processing apparatus or an image processing method therefor, comprising: an evaluation block selecting unit that calculates a histogram of the block color evaluation value and selects an evaluation target block for shading estimation based on the histogram distribution.

(付記4)
前記ブロック色評価値算出手段は、前記ブロック統計値に、最も補正強度が弱いシェーディング推定係数と正規化ゲインを乗算して第2のブロック統計値として、第2のブロック統計値よりブロック色評価値を算出することを特徴とする付記3記載の画像処理装置またはその画像処理方法。
(Appendix 4)
The block color evaluation value calculating means multiplies the block statistical value by a shading estimation coefficient having the weakest correction strength and a normalization gain to obtain a second block statistical value from the second block statistical value as a block color evaluation value. The image processing apparatus according to appendix 3, or an image processing method thereof.

(付記5)
前記正規化ゲインは全ブロック分のRGBを積算し、「積算G値/積算R値」をRゲイン、「積算G値/積算B値」をBゲインとすることを特徴とする付記4記載の画像処理装置またはその画像処理方法。
(Appendix 5)
The normalization gain is obtained by integrating RGB of all blocks, wherein “integrated G value / integrated R value” is R gain, and “integrated G value / integrated B value” is B gain. Image processing apparatus or image processing method thereof.

(付記6)
前記ブロック色評価値算出手段が求めるブロック色評価値は、第2のブロック統計値のR比、G比、B比の少なくとも1つに基づいて求められることを特徴とする付記4または5記載の画像処理装置またはその画像処理方法。
(Appendix 6)
The block color evaluation value obtained by the block color evaluation value calculation means is obtained based on at least one of the R ratio, G ratio, and B ratio of the second block statistical value. Image processing apparatus or image processing method thereof.

(付記7)
前記R比は「3R/(R+G+B)」または「R/(R+G+B)」で算出されることを特徴とする付記6記載の画像処理装置またはその画像処理方法。
(Appendix 7)
The image processing apparatus or the image processing method according to appendix 6, wherein the R ratio is calculated by “3R / (R + G + B)” or “R / (R + G + B)”.

(付記8)
前記評価ブロック選択手段は、ヒストグラム最頻値の近傍のビンに分類されたブロックを評価対象ブロックとすることを特徴とする付記3乃至7のいずれか1つに記載の画像処理装置またはその画像処理方法。
(Appendix 8)
8. The image processing apparatus according to any one of appendices 3 to 7, wherein the evaluation block selecting means sets a block classified into bins in the vicinity of a histogram mode value as an evaluation target block, or image processing thereof Method.

(付記9)
前記評価ブロック選択手段は、ブロックのR値、G値、B値のいずれかの値が、予め設定した範囲外の場合に評価対象ブロックから除外することを特徴とする付記3乃至8のいずれか1つに記載の画像処理装置またはその画像処理方法。
(Appendix 9)
Any one of Supplementary notes 3 to 8, wherein the evaluation block selecting unit excludes the block from the evaluation target when any of the R value, G value, and B value of the block is outside a preset range. The image processing apparatus or image processing method according to one of the above.

(付記10)
撮像画像を複数のブロックに分割するブロック分割部と、
ブロック毎にRGB別の画素値を統計したブロック統計値を算出する統計値算出部と、
前記ブロック統計値に、予め、補正強度の異なる複数のシェーディング推定テーブルを順次適用したブロック統計値を求め、画像中央部からの距離に応じてブロックをグループ分類するグループ分類手段と、
ブロック統計値の有効無効を判定する有効ブロック判定手段と、
グループ内の有効ブロックのRGB別統計値のRGB別総和をグループ統計値として求めるグループ統計値算出手段と、
を備えた画像処理装置であって、
各グループ内の有効ブロック数によってグループの有効無効を判定する有効グループ判定手段と、
画像中央部から周辺部の有効グループを「3R/(R+G+B)」または「R/(R+G+B)」で算出されるR比を直線近似するグループR比直線近似手段と、
前記グループR比直線近似手段で算出した近似直線の傾きにしたがって、撮像画像の補正に適切なシェーディング補正テーブルを選択するシェーディング補正テーブル選択手段を備えることを特徴とする画像処理装置またはその画像処理方法。
(Appendix 10)
A block division unit that divides the captured image into a plurality of blocks;
A statistical value calculation unit for calculating a block statistical value in which pixel values for each RGB are statistically calculated for each block;
A block classification value for obtaining a block statistical value obtained by sequentially applying a plurality of shading estimation tables having different correction strengths to the block statistical value in advance, and grouping the blocks according to the distance from the center of the image;
A valid block judging means for judging whether the block statistical value is valid or invalid;
A group statistical value calculation means for obtaining a sum by RGB of the statistical values by RGB of the effective blocks in the group as a group statistical value;
An image processing apparatus comprising:
Effective group determination means for determining the validity / invalidity of the group according to the number of effective blocks in each group;
A group R ratio linear approximation means for linearly approximating the R ratio calculated by “3R / (R + G + B)” or “R / (R + G + B)” from the central part of the image to the peripheral part;
An image processing apparatus or an image processing method therefor, comprising: a shading correction table selecting means for selecting a shading correction table suitable for correcting a captured image in accordance with the inclination of the approximate straight line calculated by the group R ratio straight line approximating means. .

(付記11)
前記グループ統計値算出手段は、グループ内に含まれるシェーディング推定テーブルを順次適用したブロック統計値のうちブロック判定手段によって有効と判断されたブロックの総和をグループ統計値とすることを特徴とする付記10記載の画像処理装置またはその画像処理方法。
(Appendix 11)
The group statistical value calculation means uses, as a group statistical value, a sum of blocks determined to be valid by the block determination means among block statistical values to which the shading estimation table included in the group is sequentially applied. The image processing apparatus or the image processing method thereof.

(付記12)
前記有効グループ判定手段は、画像中央のグループから周辺のグループへ向かう有効グループの連続性を判定するグループ連続性判定手段と、
前記グループ連続性の判定結果に従い無効グループを補間して有効化する無効グループ有効化手段を備えることを特徴とする付記10または11記載の画像処理装置またはその画像処理方法。
(Appendix 12)
The effective group determination unit is a group continuity determination unit that determines the continuity of the effective group from the group in the center of the image toward the peripheral group.
The image processing apparatus or the image processing method according to claim 10 or 11, further comprising invalid group validation means for interpolating and validating invalid groups according to the group continuity determination result.

(付記13)
前記無効グループ有効化手段は、単独の無効クループの両隣に2個以上の連続した有効グループがあり、かつ無効クループに隣接する2つの有効グループの差分が閾値以下の場合に無効グループを有効化することを特徴とする付記12に記載の画像処理装置またはその画像処理方法。
(Appendix 13)
The invalid group validating means validates an invalid group when there are two or more consecutive valid groups on both sides of a single invalid group and the difference between two valid groups adjacent to the invalid group is equal to or less than a threshold value. The image processing apparatus or the image processing method according to appendix 12, wherein

(付記14)
前記シェーディング補正テーブル選択手段は、近似直線が水平に近いもの、または、あらかじめ設定した基準の傾きに最も近いものが選択されることを特徴とする付記10乃至13のいずれか1つに記載の画像処理装置またはその画像処理方法。
(Appendix 14)
The image according to any one of appendices 10 to 13, wherein the shading correction table selection means selects an approximate straight line that is close to horizontal or that that is closest to a preset reference inclination. A processing apparatus or an image processing method thereof.

(付記15)
撮像画像を複数のブロックに分割し、ブロック毎に画素値を統計する統計値算出部を備え、ブロック統計値より撮像画像に発生するシェーディングの推定を行う画像処理装置において、
複数の光源にそれぞれ対応するシェーディング推定テーブルを撮像画像に順次適用し、
画像中央部からの距離に応じてブロックをグループに分類し、シェーディング推定に用いるグループであるかを判定し、
隣接グループとのR比の差が閾値より小さく連続したグループをグループ連続領域とし、
グループ連続領域毎に分散値を求めすべてのグループ連続領域の分散値を加算したものをテーブル評価値とし、
テーブル評価値が最も小さいシェーディング推定テーブルを撮像画像を適切に補正できるシェーディング推定テーブルとして選択することを特徴とする画像処理装置またはその画像処理方法。
(Appendix 15)
In an image processing apparatus that divides a captured image into a plurality of blocks, includes a statistical value calculation unit that statistically calculates a pixel value for each block, and estimates shading that occurs in the captured image from the block statistical values,
Apply a shading estimation table corresponding to each of a plurality of light sources to a captured image sequentially,
Classify blocks into groups according to the distance from the center of the image, determine whether the group is used for shading estimation,
A continuous group in which the difference in R ratio with an adjacent group is smaller than a threshold is defined as a group continuous region,
The table evaluation value is obtained by calculating the variance value for each group continuous area and adding the variance values of all the group continuous areas.
An image processing apparatus or an image processing method thereof, wherein a shading estimation table having the smallest table evaluation value is selected as a shading estimation table capable of appropriately correcting a captured image.

(付記16)
撮像画像を複数のブロックに分割するブロック分割部と、
ブロック毎に画素値を統計することでブロック統計値を算出する統計値算出部と、
ブロック統計値に、複数の光源別に予め用意したシェーディング補正テーブルを順次適用したブロック統計値を求め、画像中央部からの距離に応じてブロックをグループに分類するグループ分類手段と、
前記シェーディング補正テーブルを順次適用したブロック統計値からグループ統計値を求めるグループ統計値算出手段と、
前記グループ統計値よりグループ評価値を算出するグループ評価値算出手段を備えた画像処理装置であって、
各グループ内の有効ブロック数によってグループの有効無効を判定する有効グループ判定手段と、
画像中央のグループから周辺のグループへ向かう有効グループの連続性を判定するグループ連続性判定手段と、
グループ連続性の判定結果によって連続したグループとされたグループ連続領域毎に分散値を求めすべてのグループ連続領域の分散値を加算したものをテーブル評価値とするテーブル評価値算出手段と、
テーブル評価値が最も小さいシェーディング補正テーブルを選択するシェーディング補正テーブル選択手段を備え、
撮像画像の補正に適切なシェーディング補正を行うことができることを特徴とする画像処理装置またはその画像処理方法。
(Appendix 16)
A block division unit that divides the captured image into a plurality of blocks;
A statistical value calculation unit that calculates block statistical values by statistically calculating pixel values for each block;
A block statistic obtained by sequentially applying a shading correction table prepared in advance for each of a plurality of light sources to the block statistic, and grouping means for classifying the blocks into groups according to the distance from the center of the image;
Group statistical value calculating means for obtaining a group statistical value from block statistical values obtained by sequentially applying the shading correction table;
An image processing apparatus comprising group evaluation value calculation means for calculating a group evaluation value from the group statistical value,
Effective group determination means for determining the validity / invalidity of the group according to the number of effective blocks in each group
Group continuity determination means for determining the continuity of the effective group from the group in the center of the image to the surrounding group;
A table evaluation value calculating means for obtaining a dispersion value for each group continuous area determined as a continuous group based on the determination result of the group continuity and adding a dispersion value of all the group continuous areas;
A shading correction table selecting means for selecting a shading correction table having the smallest table evaluation value;
An image processing apparatus or an image processing method thereof capable of performing shading correction suitable for correction of a captured image.

100 デジタルスチルカメラ
102 レンズ光学系
104 撮像素子
106 AFE回路
108 画像信号処理回路
110 画像表示部
112 画像記録部
114 ドライバ
116 タイミングジェネレータ
118 画像ブロック統計回路
120 制御部
122 係数記憶部
124 シェーディング推定部
126 シェーディング補正部
201 フラット判定部
202 シェーディング推定係数選択部
211 ブロック色評価値算出部
212 ブロック重み係数算出部
213 ブロック評価値算出部
214 シェーディング推定係数選択部
221 グループ分類部
222 グループ評価値算出部
223 有効グループ判定部
224 近似推定部
225 分散推定部
226 グループ分散推定部
227 ブロック分散推定部
DESCRIPTION OF SYMBOLS 100 Digital still camera 102 Lens optical system 104 Image pick-up element 106 AFE circuit 108 Image signal processing circuit 110 Image display part 112 Image recording part 114 Driver 116 Timing generator 118 Image block statistical circuit 120 Control part 122 Coefficient memory | storage part 124 Shading estimation part 126 Shading Correction unit 201 Flat decision unit 202 Shading estimation coefficient selection unit 211 Block color evaluation value calculation unit 212 Block weight coefficient calculation unit 213 Block evaluation value calculation unit 214 Shading estimation coefficient selection unit 221 Group classification unit 222 Group evaluation value calculation unit 223 Effective group Determination unit 224 Approximate estimation unit 225 Variance estimation unit 226 Group variance estimation unit 227 Block variance estimation unit

Claims (28)

撮像画像を複数のブロックに分割するブロック分割部と、
前記ブロック毎に画素値の統計をとることでブロック統計値を算出する統計値算出部と、
複数の光源にそれぞれ対応する複数のシェーディング推定係数を含む第1のシェーディング推定係数群を記憶する推定係数群記憶部と、
前記統計値算出部によって算出された前記ブロック統計値と、前記推定係数群記憶部によって記憶された前記第1のシェーディング推定係数群とに基づいてシェーディングを推定するシェーディング推定部と、
を備え、
前記シェーディング推定部は、前記撮像画像の画像平坦度、被写体明度、被写体色温度の少なくとも1つに応じて、前記記憶された第1のシェーディング推定係数群の中から前記撮像画像に適切な少なくとも1つのシェーディング推定係数を含む第2のシェーディング推定係数群を選択
前記選択された第2のシェーディング推定係数群に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するシェーディング補正部を更に備える画像処理装置。
A block division unit that divides the captured image into a plurality of blocks;
A statistical value calculation unit that calculates a block statistical value by taking statistics of a pixel value for each block;
An estimation coefficient group storage unit that stores a first shading estimation coefficient group including a plurality of shading estimation coefficients respectively corresponding to a plurality of light sources;
A shading estimation unit that estimates shading based on the block statistical value calculated by the statistical value calculation unit and the first shading estimation coefficient group stored by the estimation coefficient group storage unit;
With
The shading estimation unit may select at least one suitable for the captured image from the stored first shading estimation coefficient group according to at least one of image flatness, subject brightness, and subject color temperature of the captured image. One of the select second shading estimation coefficient group including a shading estimation coefficients,
An image processing apparatus further comprising a shading correction unit that applies a shading correction coefficient corresponding to the selected second shading estimation coefficient group to the captured image and corrects shading of the captured image.
前記シェーディング推定部は、前記撮像画像の周辺部から中央部に連続する前記ブロックの画素値差分を積算することによって、前記画像平坦度を求める、
請求項1に記載の画像処理装置。
The shading estimation unit obtains the image flatness by accumulating pixel value differences of the blocks continuous from the peripheral part to the central part of the captured image.
The image processing apparatus according to claim 1.
前記シェーディング推定部は、前記画像平坦度に基づいて前記撮像画像が平坦ではないと判定した場合、前記第1のシェーディング推定係数群の中から前記第2のシェーディング推定係数群を選択する、
請求項1または2に記載の画像処理装置。
The shading estimation unit selects the second shading estimation coefficient group from the first shading estimation coefficient group when it is determined that the captured image is not flat based on the image flatness.
The image processing apparatus according to claim 1.
前記シェーディング推定部は、
前記画像平坦度に基づいて前記撮像画像が平坦であると判定した場合、前記被写体色温度に基づいて、前記第1のシェーディング推定係数群の中から前記第2のシェーディング推定係数群を選択し、
前記画像平坦度に基づいて前記撮像画像が平坦ではないと判定した場合、前記被写体明度に基づいて、前記第1のシェーディング推定係数群の中から前記第2のシェーディング推定係数群を選択する、
請求項1または2に記載の画像処理装置。
The shading estimation unit
When it is determined that the captured image is flat based on the image flatness, the second shading estimation coefficient group is selected from the first shading estimation coefficient group based on the subject color temperature,
When it is determined that the captured image is not flat based on the image flatness, the second shading estimation coefficient group is selected from the first shading estimation coefficient group based on the subject brightness.
The image processing apparatus according to claim 1.
前記シェーディング推定部は、前記被写体明度に基づいて前記撮像画像が屋内の画像であると判定した場合、前記被写体色温度に基づいて、前記第1のシェーディング推定係数群の中から前記第2のシェーディング推定係数群を選択する、
請求項1または2に記載の画像処理装置。
The shading estimation unit determines the second shading from the first shading estimation coefficient group based on the subject color temperature when it is determined that the captured image is an indoor image based on the subject brightness. Select an estimation coefficient group,
The image processing apparatus according to claim 1.
撮像画像を複数のブロックに分割するブロック分割部と、
前記ブロック毎に色別の画素値の統計をとることで第1のブロック統計値を算出する統計値算出部と、
補正強度の異なる複数のシェーディング推定係数を記憶する推定係数記憶部と、
前記算出された第1のブロック統計値を評価するブロック色評価値を算出するブロック色評価値算出部と、
前記算出されたブロック色評価値のヒストグラムに基づいてシェーディング推定のための評価対象ブロックを選択するブロック評価値算出部と、
前記選択された評価対象ブロックに基づいて、前記記憶されたシェーディング推定係数の中から前記撮像画像に適切なシェーディング推定係数を選択するシェーディング推定係数選択部と、
前記選択されたシェーディング推定係数に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するシェーディング補正部と、
を備える画像処理装置。
A block division unit that divides the captured image into a plurality of blocks;
A statistical value calculation unit that calculates the first block statistical value by taking the statistics of the pixel value for each color for each block;
An estimation coefficient storage unit that stores a plurality of shading estimation coefficients having different correction strengths;
A block color evaluation value calculation unit for calculating a block color evaluation value for evaluating the calculated first block statistical value;
A block evaluation value calculation unit that selects an evaluation target block for shading estimation based on the calculated block color evaluation value histogram;
A shading estimation coefficient selection unit that selects an appropriate shading estimation coefficient for the captured image from the stored shading estimation coefficients based on the selected evaluation target block;
Applying a shading correction coefficient corresponding to the selected shading estimation coefficient to the captured image, and correcting a shading of the captured image;
An image processing apparatus comprising:
前記ブロック色評価値算出部は、前記第1のブロック統計値に、最も補正強度が弱いシェーディング推定係数の係数値と正規化ゲインとを乗算して第2のブロック統計値とし、前記第2のブロック統計値に基づいて前記ブロック色評価値を算出する、
請求項6に記載の画像処理装置。
The block color evaluation value calculation unit multiplies the first block statistic value by a coefficient value of a shading estimation coefficient having the weakest correction strength and a normalization gain to obtain a second block statistic value. Calculating the block color evaluation value based on a block statistical value;
The image processing apparatus according to claim 6.
前記ブロック色評価値算出部は、全ブロック分のRGB画素値を積算し、前記積算したG画素値を前記積算したR画素値で割った値をRの前記正規化ゲインとし、また、前記積算したG画素値を前記積算したB画素値で割った値をBの前記正規化ゲインとする、
請求項7に記載の画像処理装置。
The block color evaluation value calculation unit integrates RGB pixel values for all blocks, and sets a value obtained by dividing the integrated G pixel value by the integrated R pixel value as the normalized gain of R. A value obtained by dividing the obtained G pixel value by the accumulated B pixel value is used as the normalized gain of B.
The image processing apparatus according to claim 7.
前記ブロック色評価値算出部は、前記第2のブロック統計値のRの比率、Gの比率、Bの比率のうち少なくとも1つに基づいて前記ブロック色評価値を求める、
請求項7または8に記載の画像処理装置。
The block color evaluation value calculating unit obtains the block color evaluation value based on at least one of an R ratio, a G ratio, and a B ratio of the second block statistical value;
The image processing apparatus according to claim 7 or 8.
前記Rの比率は、全RGBに対するRの比率、または、全RGBに対するRの比率の3倍である、
請求項9に記載の画像処理装置。
The ratio of R is 3 times the ratio of R to all RGB or the ratio of R to all RGB.
The image processing apparatus according to claim 9.
前記ブロック評価値算出部は、前記ヒストグラムの最頻値の近傍のビンに分類されたブロックを前記評価対象ブロックとする、
請求項6乃至10のいずれか一項に記載の画像処理装置。
The block evaluation value calculation unit sets a block classified into bins in the vicinity of the mode value of the histogram as the evaluation target block.
The image processing apparatus according to claim 6.
前記ブロック評価値算出部は、R画素値、G画素値、B画素値のいずれかの値が、予め設定した範囲外のブロックを、前記評価対象ブロックから除外する、
請求項6乃至11のいずれか一項に記載の画像処理装置。
The block evaluation value calculation unit excludes a block whose R pixel value, G pixel value, or B pixel value is outside a preset range from the evaluation target block,
The image processing apparatus according to claim 6.
撮像画像を複数のブロックに分割するブロック分割部と、
前記ブロック毎に色別の画素値の統計をとることでブロック統計値を算出する統計値算出部と、
補正強度の異なる複数のシェーディング推定係数を記憶する推定係数記憶部と、
前記撮像画像の中央部からの距離に応じて前記ブロックを複数のグループに分類するグループ分類部と、
前記ブロック統計値に基づいて前記ブロックの有効または無効を判定する有効ブロック判定部と、
前記グループ内の前記有効と判定されたブロックについて統計値の色別の総和に基づいてグループ評価値を算出するグループ評価値算出部と、
前記算出されたグループ評価値に基づいて前記グループの有効または無効を判定する有効グループ判定部と、
前記撮像画像の中央部から周辺部へ向かうグループのうち前記有効と判定されたグループについて、色の比率を直線近似する直線近似部と、
前記近似した直線の傾きにしたがって、前記記憶されたシェーディング推定係数の中から前記撮像画像に適切なシェーディング推定係数を選択するシェーディング推定係数選択部と、
前記選択されたシェーディング推定係数に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正するシェーディング補正部と
を備える画像処理装置。
A block division unit that divides the captured image into a plurality of blocks;
A statistical value calculation unit that calculates a block statistical value by taking statistics of pixel values for each color for each block;
An estimation coefficient storage unit that stores a plurality of shading estimation coefficients having different correction strengths;
A group classification unit that classifies the blocks into a plurality of groups according to the distance from the center of the captured image;
An effective block determination unit that determines whether the block is valid or invalid based on the block statistical value;
A group evaluation value calculation unit that calculates a group evaluation value based on the sum of each statistical value for each block in the group determined to be valid;
An effective group determination unit that determines the validity or invalidity of the group based on the calculated group evaluation value;
A linear approximation unit that linearly approximates a color ratio for the group determined to be effective among the groups from the center to the periphery of the captured image;
A shading estimation coefficient selection unit that selects an appropriate shading estimation coefficient for the captured image from the stored shading estimation coefficients according to the slope of the approximated straight line;
An image processing apparatus comprising: a shading correction unit that applies a shading correction coefficient corresponding to the selected shading estimation coefficient to the captured image and corrects shading of the captured image.
前記色の比率は、全RGBに対するRの比率、または、全RGBに対するRの比率の3倍である、
請求項13に記載の画像処理装置。
The color ratio is 3 times the ratio of R to all RGB or the ratio of R to all RGB.
The image processing apparatus according to claim 13.
前記グループ評価値算出部は、前記グループ内に含まれる前記シェーディング推定係数を適用した前記ブロック統計値のうち前記有効と判定されたブロックの総和に基づいて前記グループ評価値を算出する、
請求項13または14に記載の画像処理装置。
The group evaluation value calculation unit calculates the group evaluation value based on a sum of blocks determined to be valid among the block statistical values to which the shading estimation coefficient included in the group is applied.
The image processing apparatus according to claim 13 or 14.
前記有効グループ判定部は、前記撮像画像の中央部から周辺部へ向かうグループのうち、前記有効と判定されたグループの連続性を判定するグループ連続性判定部と、
前記グループの連続性の判定結果に従い、前記無効と判定されたグループを有効化する無効グループ有効化部と、
を備える請求項13乃至15のいずれか一項に記載の画像処理装置。
The effective group determination unit is a group continuity determination unit that determines the continuity of the group determined to be effective among the groups from the central part to the peripheral part of the captured image,
In accordance with the determination result of the continuity of the group, an invalid group enabling unit that validates the group determined to be invalid,
The image processing apparatus according to claim 13, further comprising:
前記無効グループ有効化部は、単独の前記無効と判定されたクループの両隣に2個以上の連続して前記有効と判定されたグループがあり、かつ、前記無効と判定されたクループに隣接する2つの前記有効と判定されたグループとの差分が閾値以下の場合に無効グループを有効化する、
請求項16に記載の画像処理装置。
The invalid group enabling unit includes two or more consecutive groups determined to be valid on both sides of the single group determined to be invalid, and 2 adjacent to the group determined to be invalid. Enabling the invalid group when the difference between the two groups determined to be valid is equal to or less than a threshold value,
The image processing apparatus according to claim 16.
前記シェーディング推定係数選択部は、前記近似した直線が水平に近くなるような、または、あらかじめ設定した基準の傾きに最も近くなるようなシェーディング推定係数を選択する、
請求項13乃至17のいずれか一項に記載の画像処理装置。
The shading estimation coefficient selection unit selects a shading estimation coefficient such that the approximate straight line is close to horizontal or closest to a preset reference inclination,
The image processing apparatus according to claim 13.
画像を、前記画像の中心部からの距離に基づいて複数のグループに分類するグループ分類部と、
前記画像にシェーディング推定係数を適用したときの前記グループ毎のグループ評価値を算出するグループ評価値算出部と、
前記グループ評価値に基づいて有効グループを判定し、隣接する前記有効グループをグループ連続領域として判定する有効グループ判定部と、
前記グループ連続領域毎の前記グループ評価値の分散値を積算して前記シェーディング推定係数のテーブル評価値とし、最も小さいテーブル評価値を有するシェーディング推定係数を選択するシェーディング推定係数選択部と、
前記選択したシェーディング推定係数に対応するシェーディング補正係数を用いて前記画像を補正するシェーディング補正部と
を備える画像処理装置。
A group classification unit that classifies the images into a plurality of groups based on the distance from the center of the image;
A group evaluation value calculation unit for calculating a group evaluation value for each group when a shading estimation coefficient is applied to the image;
An effective group determination unit that determines an effective group based on the group evaluation value and determines the adjacent effective group as a group continuous region;
A shading estimation coefficient selection unit that accumulates variance values of the group evaluation values for each group continuous region to obtain a table evaluation value of the shading estimation coefficient, and selects a shading estimation coefficient having the smallest table evaluation value;
An image processing apparatus comprising: a shading correction unit that corrects the image using a shading correction coefficient corresponding to the selected shading estimation coefficient.
前記有効グループ判定部は、
注目グループと、前記注目グループの両隣のグループとの間の前記グループ評価値の差分が所定の閾値を超える前記注目グループを無効グループと判定する
請求項19に記載の画像処理装置。
The effective group determination unit
The image processing device according to claim 19, wherein the attention group in which a difference in the group evaluation value between the attention group and a group adjacent to the attention group exceeds a predetermined threshold is determined as an invalid group.
前記有効グループ判定部は、前記画像に前記画像を最も弱く補正するシェーディング推定初期係数を適用したときの前記グループ評価値に基づいて前記有効グループを判定し、
前記シェーディング推定係数選択部は、前記画像に前記シェーディング推定初期係数を適用したときの前記グループ連続領域の範囲を、前記シェーディング推定初期係数以外のシェーディング推定係数を前記画像を適用したときにも用いる
請求項19または20に記載の画像処理装置。
The effective group determination unit determines the effective group based on the group evaluation value when applying a shading estimation initial coefficient that corrects the image weakest to the image,
The shading estimation coefficient selection unit uses the range of the group continuous area when the shading estimation initial coefficient is applied to the image, and also when a shading estimation coefficient other than the shading estimation initial coefficient is applied to the image. Item 19. The image processing apparatus according to Item 19 or 20.
前記画像を複数のブロックに分割し、前記ブロック毎に画素値を統計してブロック統計値を算出する統計値算出部と、
前記ブロック統計値と前記シェーディング推定係数とに基づいて、前記ブロック毎にブロック評価値を算出するブロック評価値算出部と
を更に備え、
前記グループ分類部は、前記画像の中心部からの距離に基づいて前記ブロックを前記複数のグループに分類し、
前記グループ評価値算出部は、前記ブロック評価値に基づいて、前記グループ評価値を算出する
請求項19乃至21のいずれか一項に記載の画像処理装置。
A statistical value calculation unit that divides the image into a plurality of blocks and calculates a block statistical value by statistically calculating a pixel value for each block;
A block evaluation value calculating unit that calculates a block evaluation value for each block based on the block statistical value and the shading estimation coefficient;
The group classification unit classifies the blocks into the plurality of groups based on a distance from the center of the image.
The image processing device according to any one of claims 19 to 21, wherein the group evaluation value calculation unit calculates the group evaluation value based on the block evaluation value.
前記ブロック評価値算出部は、更に、有効ブロックの数を算出し、
前記有効グループ判定部は、前記有効ブロックの数に基づいて、前記有効グループを判定する
請求項22に記載の画像処理装置。
The block evaluation value calculation unit further calculates the number of effective blocks,
The image processing device according to claim 22, wherein the effective group determination unit determines the effective group based on the number of the effective blocks.
前記シェーディング推定係数選択部は、前記グループ連続領域の数が所定の閾値よりも少ないときに、前記有効ブロックの前記ブロック統計値の分散値を算出し、前記ブロック統計値の分散値が最も小さい前記シェーディング推定係数を選択する
請求項23に記載の画像処理装置。
The shading estimation coefficient selection unit calculates a variance value of the block statistics value of the effective block when the number of the group continuous regions is less than a predetermined threshold, and the variance value of the block statistics value is the smallest The image processing apparatus according to claim 23, wherein a shading estimation coefficient is selected.
撮像画像を複数のブロックに分割し、
前記ブロック毎に画素値の統計をとることでブロック統計値を算出し、
複数の光源にそれぞれ対応する複数のシェーディング推定係数を含む第1のシェーディング推定係数群を記憶し、
前記ブロック統計値と、前記第1のシェーディング推定係数群とに基づいてシェーディングを推定し、
前記シェーディングを推定する処理において、前記撮像画像の画像平坦度、被写体明度、被写体色温度の少なくとも1つに応じて、前記記憶された第1のシェーディング推定係数群の中から前記撮像画像に適切な少なくとも1つのシェーディング推定係数を含む第2のシェーディング推定係数群を選択し、
前記選択された第2のシェーディング推定係数群に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正する、
画像処理方法。
Divide the captured image into multiple blocks,
Calculate block statistics by taking pixel value statistics for each block,
Storing a first shading estimation coefficient group including a plurality of shading estimation coefficients respectively corresponding to a plurality of light sources;
Estimating shading based on the block statistics and the first shading estimation coefficient group;
In the process of estimating the shading, an appropriate value for the captured image is selected from the stored first shading estimation coefficient group according to at least one of image flatness, subject brightness, and subject color temperature of the captured image. Selecting a second group of shading estimation coefficients including at least one shading estimation coefficient;
Applying a shading correction coefficient corresponding to the selected second shading estimation coefficient group to the captured image to correct shading of the captured image;
Image processing method.
撮像画像を複数のブロックに分割し、
前記ブロック毎に色別の画素値の統計をとることで第1のブロック統計値を算出し、
補正強度の異なる複数のシェーディング推定係数を記憶し、
前記算出された第1のブロック統計値を評価するブロック色評価値を算出し、
前記算出されたブロック色評価値のヒストグラムに基づいてシェーディング推定のための評価対象ブロックを選択し、
前記選択された評価対象ブロックに基づいて、前記記憶されたシェーディング推定係数の中から前記撮像画像に適切なシェーディング推定係数を選択し、
前記選択されたシェーディング推定係数に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正する、
画像処理方法。
Divide the captured image into multiple blocks,
The first block statistic value is calculated by taking the statistics of the pixel value for each color for each block,
Stores multiple shading estimation coefficients with different correction strengths,
Calculating a block color evaluation value for evaluating the calculated first block statistical value;
Selecting an evaluation target block for shading estimation based on the calculated block color evaluation value histogram;
Based on the selected evaluation target block, a suitable shading estimation coefficient for the captured image is selected from the stored shading estimation coefficients,
Applying a shading correction coefficient corresponding to the selected shading estimation coefficient to the captured image to correct shading of the captured image;
Image processing method.
撮像画像を複数のブロックに分割し、
前記ブロック毎に色別の画素値の統計をとることでブロック統計値を算出し、
補正強度の異なる複数のシェーディング推定係数を記憶し、
前記撮像画像の中央部からの距離に応じて前記ブロックを複数のグループに分類し、
前記ブロック統計値に基づいて前記ブロックの有効または無効を判定し、
前記グループ内の前記有効と判定されたブロックについて統計値の色別の総和に基づいてグループ評価値を算出し、
前記算出されたグループ評価値に基づいて前記グループの有効または無効を判定し、
前記撮像画像の中央部から周辺部へ向かうグループのうち前記有効と判定されたグループについて、色の比率を直線近似し、
前記近似した直線の傾きにしたがって、前記記憶されたシェーディング推定係数の中から前記撮像画像に適切なシェーディング推定係数を選択し、
前記選択されたシェーディング推定係数に対応するシェーディング補正係数を前記撮像画像に適用し、前記撮像画像のシェーディングを補正する、
画像処理方法。
Divide the captured image into multiple blocks,
By calculating the statistics of the pixel value for each color for each block, the block statistical value is calculated,
Stores multiple shading estimation coefficients with different correction strengths,
Classifying the blocks into a plurality of groups according to the distance from the center of the captured image;
Determining whether the block is valid or invalid based on the block statistics;
A group evaluation value is calculated based on the sum of each statistical value for each of the blocks determined to be valid in the group,
Determining whether the group is valid or invalid based on the calculated group evaluation value;
For the group determined to be effective among the groups from the center to the periphery of the captured image, the color ratio is linearly approximated,
According to the slope of the approximate line, select an appropriate shading estimation coefficient for the captured image from the stored shading estimation coefficients,
Applying a shading correction coefficient corresponding to the selected shading estimation coefficient to the captured image to correct shading of the captured image;
Image processing method.
画像を、前記画像の中心部からの距離に基づいて複数のグループに分類し、
前記画像にシェーディング推定係数を適用したときの前記グループ毎のグループ評価値を算出し、
前記グループ評価値に基づいて有効グループを判定し、隣接する前記有効グループをグループ連続領域として判定し、
前記グループ連続領域毎の前記グループ評価値の分散値を積算して前記シェーディング推定係数のテーブル評価値とし、最も小さいテーブル評価値を有するシェーディング推定係数を選択し、
前記選択したシェーディング推定係数に対応するシェーディング補正係数を用いて前記画像を補正する
画像処理方法。
Classifying the images into a plurality of groups based on the distance from the center of the image;
Calculating a group evaluation value for each group when a shading estimation coefficient is applied to the image;
An effective group is determined based on the group evaluation value, the adjacent effective group is determined as a group continuous region,
The table evaluation value of the shading estimation coefficient is accumulated by integrating the variance value of the group evaluation value for each group continuous region, and the shading estimation coefficient having the smallest table evaluation value is selected.
An image processing method for correcting the image using a shading correction coefficient corresponding to the selected shading estimation coefficient.
JP2015155685A 2014-11-21 2015-08-06 Image processing apparatus and image processing method Active JP6573798B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020150153810A KR102366254B1 (en) 2014-11-21 2015-11-03 Image processing apparatus and method
US14/948,922 US9661290B2 (en) 2014-11-21 2015-11-23 Image processing apparatus and method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2014236433 2014-11-21
JP2014236433 2014-11-21

Publications (2)

Publication Number Publication Date
JP2016105578A JP2016105578A (en) 2016-06-09
JP6573798B2 true JP6573798B2 (en) 2019-09-11

Family

ID=56102612

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015155685A Active JP6573798B2 (en) 2014-11-21 2015-08-06 Image processing apparatus and image processing method

Country Status (2)

Country Link
JP (1) JP6573798B2 (en)
KR (1) KR102366254B1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021256504A1 (en) * 2020-06-17 2021-12-23 ソニーグループ株式会社 Information processing device and information processing method
CN112819838B (en) * 2021-04-19 2021-07-06 浙江华创视讯科技有限公司 Image enhancement method, electronic device, and storage medium
CN113259556B (en) * 2021-05-06 2023-04-18 深圳市中诺通讯有限公司 Method, device and equipment for eliminating brightness difference and color difference in different areas and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11327497A (en) * 1998-05-14 1999-11-26 Hitachi Ltd Video signal processing device and display device
KR100541961B1 (en) * 2004-06-08 2006-01-12 삼성전자주식회사 Apparatus and method for saturation controlling of color image
JP4137015B2 (en) * 2004-06-30 2008-08-20 キヤノン株式会社 Image processing apparatus and method
JP4603319B2 (en) * 2004-09-01 2010-12-22 パナソニック株式会社 Image input device
JP2008053931A (en) * 2006-08-23 2008-03-06 Fujifilm Corp Imaging apparatus
JP2008277926A (en) * 2007-04-25 2008-11-13 Kyocera Corp Image data processing method and imaging device using same
JP5358344B2 (en) * 2009-08-12 2013-12-04 三星テクウィン株式会社 Imaging apparatus and imaging method
JP6004221B2 (en) * 2012-03-22 2016-10-05 三星電子株式会社Samsung Electronics Co.,Ltd. Image processing device

Also Published As

Publication number Publication date
JP2016105578A (en) 2016-06-09
KR20160061251A (en) 2016-05-31
KR102366254B1 (en) 2022-02-22

Similar Documents

Publication Publication Date Title
JP5496509B2 (en) System, method, and apparatus for image processing for color classification and skin color detection
US8941755B2 (en) Image processing device with automatic white balance
US8274583B2 (en) Radially-based chroma noise reduction for cameras
KR100983037B1 (en) Method for controlling auto white balance
US20100232705A1 (en) Device and method for detecting shadow in image
US8786729B2 (en) White balance method and apparatus thereof
EP2227025B1 (en) Apparatus and method for adjusting white balance of digital image
JP5847471B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program
KR101685887B1 (en) Image processing device, image processing method, and computer-readable storage medium having image processing program
WO2022257396A1 (en) Method and apparatus for determining color fringe pixel point in image and computer device
EP3015892A1 (en) Image pickup device and image pickup method
JP6573798B2 (en) Image processing apparatus and image processing method
KR20170030418A (en) Imaging processing device and Imaging processing method
US9219896B1 (en) Method of color processing using a color and white filter array
US20130155254A1 (en) Imaging apparatus, image processing apparatus, and image processing method
JP6346431B2 (en) Image processing apparatus and image processing method
JP6276564B2 (en) Image processing apparatus and image processing method
US9661290B2 (en) Image processing apparatus and method
JP7208379B2 (en) Calibration method
US8189067B2 (en) Determining the illuminant in a captured scene
McCann et al. Chromaticity limits in color constancy calculations
US11488286B2 (en) Method for determining Moire pattern, method for suppressing Moire pattern and circuit system thereof
Jo et al. Adaptive white point extraction based on dark channel prior for automatic white balance
JP5963913B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program
JP2023094991A (en) Image processing device and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180515

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190218

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190319

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190423

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190814

R150 Certificate of patent or registration of utility model

Ref document number: 6573798

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250