JP2005160044A - Image processing apparatus, image processing method, and program - Google Patents
Image processing apparatus, image processing method, and program Download PDFInfo
- Publication number
- JP2005160044A JP2005160044A JP2004309459A JP2004309459A JP2005160044A JP 2005160044 A JP2005160044 A JP 2005160044A JP 2004309459 A JP2004309459 A JP 2004309459A JP 2004309459 A JP2004309459 A JP 2004309459A JP 2005160044 A JP2005160044 A JP 2005160044A
- Authority
- JP
- Japan
- Prior art keywords
- target pixel
- pixel
- processing unit
- color component
- interpolation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、画像処理装置および画像処理方法、並びにプログラムに関し、特に、モザイク画像の補間をより精度よく行うことができるようにした画像処理装置および画像処理方法、並びにプログラムに関する。 The present invention relates to an image processing device, an image processing method, and a program, and more particularly, to an image processing device, an image processing method, and a program that can perform interpolation of a mosaic image with higher accuracy.
単板式の固定撮像素子を用いた撮影装置で撮影した場合、単一の分光感度しか得られない。そのため、一般的には、多数の画素に対してそれぞれ異なる色フィルタを貼り、それらを特定のパターンで配置してカラー撮影を行う方法が利用されている。この方法で撮像された画像は、画素毎に1つの色しか得ることができないため、色に関してモザイク状になった画像が生成される。そこで、周囲の画素から得られる色情報を利用して補間を行うことにより、全画素で全ての色(例えばRGB)が揃った画像を生成することができる。 When photographing with a photographing device using a single plate type fixed imaging element, only a single spectral sensitivity can be obtained. Therefore, in general, a method is used in which different color filters are attached to a large number of pixels and arranged in a specific pattern to perform color photographing. Since an image captured by this method can obtain only one color for each pixel, an image having a mosaic shape with respect to the color is generated. Therefore, by performing interpolation using color information obtained from surrounding pixels, it is possible to generate an image in which all colors (for example, RGB) are aligned in all pixels.
一般的に、フィルタの配列には、図1に示されるようなベイヤー(Bayer)配列が用いられる。ベイヤー配列は、緑色(G)の光のみを透過するGのフィルタが2個、赤(R)の光のみを透過するRのフィルタが1個、青(B)の光のみを透過するBのフィルタが1個の、合計4個を最小単位として構成されている。すなわち、Gのフィルタは、市松状に配置され、RおよびBのフィルタの倍の密度で存在する。そのため、情報量が多く、輝度に強い相関を持つGについて全画素に色を揃え、それを参照情報として画素補間処理を行うことにより、他の色の情報を各画素において揃える方法がよく用いられる。 Generally, a Bayer array as shown in FIG. 1 is used for the filter array. The Bayer array consists of two G filters that transmit only green (G) light, one R filter that transmits only red (R) light, and B that transmits only blue (B) light. One filter is configured with a total of four as a minimum unit. That is, the G filters are arranged in a checkered pattern and exist at twice the density of the R and B filters. For this reason, a method is often used in which information on other colors is aligned in each pixel by aligning colors for all pixels for G having a large amount of information and having a strong correlation with luminance, and performing pixel interpolation processing using that as reference information. .
例えば特許文献1には、局所領域における色の比率がほぼ一定であるという仮定の元、全画素にあらかじめGを揃え、近傍画素におけるRとGの比率の平均、およびBとGの比率の平均を注目画素位置のGに乗算し、不明な色成分の推定を行う画素補間方法が提案されている。このようなGを参照情報とした画素補間方法では、Gを全画素揃える際の補間精度によって最終結果が大きく左右されるという課題があった。
For example, in
そこで、特許文献2では、Gのグラディエント値に基づいて、補間に用いる近傍Gの画素を切り換えることで、補間精度を上げるといった工夫が行われている。また、特許文献3では、補間に用いる近傍Gの画素を切り換えるだけでなく、補間画素位置の水平、垂直の相関値を求め、水平方向の相関が強い場合に適した処理と、垂直方向の相関が強い場合に適した処理によって得られた2つの補間値を相関値によって混合する方法が提案されている。
Therefore, in
上述した様々な方法では、Gが市松状に配置され、他の色に比べてサンプリング周波数が高いというベイヤー配列の特徴が前提となっているが、単板式の固体撮像素子のフィルタは3色に限定されるものではなく、4色用いられる場合もある。いわゆる補色系のフィルタ配列以外でも、例えば、特許文献4には、色再現性の向上を狙って、RGBの3色にさらにもう1つの色(例えば、Y)を加えることで、4色の配列でフィルタを構成することが提案されている。また、例えば、ベイヤー配列においても、Gに隣接するR,Bの配置の違いや、特許文献5および特許文献6で言及されている、製造過程におけるフィルタの位置ずれ等を原因とした分光特性の違い、また、特許文献7で言及されている、偶数ライン、奇数ラインで別の信号出力経路を持つ固体撮像素子に発生するライン間でのゲインの誤差等により、2×2のフィルタ配列内の2つのGが必ずしも同一の特性とは限らなくなり、事実上、4色の配列となっている場合がある。
しかしながら、このような4色のフィルタ配列から得られた信号に対して、ベイヤー配列でGの市松配置を利用した全画素にGを補間する方法は適用できず、当然ながら、Gが全色揃っていることを前提とした色補間方法をそのまま利用することはできないという課題があった。 However, the method of interpolating G to all pixels using the G checkered arrangement in the Bayer array cannot be applied to signals obtained from such a four-color filter array. Therefore, there is a problem that the color interpolation method based on the premise that the color image cannot be used as it is.
また、GもしくはGに代替される信号を何らかの方法で市松に揃えたとしても、特許文献3に提案されているような、注目画素位置で計算された水平、垂直方向の相関値をそのまま補間に使用する方法では、限界解像度付近でノイズ等の影響により相関判別を間違うようになると、2つの補間値が不規則に混合されることになり、非常に目立つアーチファクトが発生するという課題があった。
Even if G or a signal substituted for G is arranged in a checkered pattern by any method, the correlation values in the horizontal and vertical directions calculated at the target pixel position, as proposed in
本発明はこのような状況に鑑みてなされたものであり、4色のフィルタ配列においても、Gに代替される輝度信号を全画素に精度よく補間可能な処理を提供するとともに、その信号を元にした色成分の補間処理ができるようにするものである。 The present invention has been made in view of such a situation. Even in a four-color filter array, the present invention provides a process capable of accurately interpolating a luminance signal substituted for G into all pixels, and based on the signal. This makes it possible to perform interpolation processing of the color components.
本発明の画像処理装置は、モザイク画像の注目画素、並びに注目画素の縦方向および横方向の近傍の画素に基づいて、注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出手段と、注目画素と、注目画素の縦方向の近傍の画素に基づいて、第1の色成分の注目画素における第1の推定値を算出するとともに、注目画素と注目画素の横方向の近傍の画素に基づいて、第2の色成分の注目画素における第2の推定値を算出する第1の推定値算出手段と、縦方向の変化強度、横方向の変化強度、第1の推定値、および第2の推定値に基づいて、第1の色成分と第2の色成分からなる第3の色成分の注目画素における第3の推定値を算出する第2の推定値算出手段とを備えることを特徴とする。 The image processing apparatus according to the present invention calculates the change intensity in the vertical direction and the change intensity in the horizontal direction at the target pixel based on the target pixel of the mosaic image and pixels in the vertical and horizontal directions of the target pixel. Based on the calculation means, the target pixel, and the pixels in the vertical direction of the target pixel, the first estimated value of the target pixel of the first color component is calculated, and the horizontal vicinity of the target pixel and the target pixel is calculated A first estimated value calculating means for calculating a second estimated value of the target pixel of the second color component based on the pixels of the vertical direction, a vertical variation strength, a horizontal variation strength, a first estimated value, And a second estimated value calculating means for calculating a third estimated value for the target pixel of the third color component composed of the first color component and the second color component based on the second estimated value. It is characterized by that.
変化強度算出手段は、注目画素における第1の色成分および第2の色成分の第1の補間値を、注目画素の近傍の画素の画素値に基づいて補間し、注目画素の縦方向に位置する画素における第1の色成分および第2の色成分の第2の補間値を、注目画素の近傍の画素の画素値に基づいて補間し、注目画素の横方向に位置する画素における第1の色成分および第2の色成分の第3の補間値を、注目画素の近傍の画素の画素値に基づいて補間し、第1の補間値と、第2の補間値との差分の組により縦勾配評価値を算出し、第1の補間値と、第3の補間値との差分の組により横勾配評価値を算出し、縦勾配評価値および横勾配評価値に基づいて、変化強度を決定し、注目画素および注目画素の近傍における変化強度の偏差を算出し、偏差に基づいて、注目画素の変化強度を補正するようにすることができる。 The change intensity calculation means interpolates the first interpolation values of the first color component and the second color component in the target pixel based on the pixel values of pixels in the vicinity of the target pixel, and positions the vertical direction of the target pixel. The second interpolation value of the first color component and the second color component in the pixel to be interpolated based on the pixel value of the pixel in the vicinity of the target pixel, and the first color component in the pixel located in the horizontal direction of the target pixel The third interpolation value of the color component and the second color component is interpolated based on the pixel value of the pixel in the vicinity of the target pixel, and the vertical interpolation is performed according to the set of differences between the first interpolation value and the second interpolation value. A gradient evaluation value is calculated, a lateral gradient evaluation value is calculated based on a set of differences between the first interpolation value and the third interpolation value, and a change intensity is determined based on the vertical gradient evaluation value and the horizontal gradient evaluation value. Calculating the deviation of the change intensity in the vicinity of the target pixel and the target pixel, and based on the deviation, Change the intensity of the eye pixels can be made to be corrected.
第2の推定値算出手段は、注目画素の近傍の画素の第2の色成分および第1の推定値に基づいて、注目画素における第3の色成分の第4の推定値を算出する第3の推定値算出手段と、注目画素の近傍の画素の第1の色成分および第2の推定値に基づいて、注目画素における第3の色成分の第5の推定値を算出する第4の推定値算出手段と、第4の推定値、第5の推定値、注目画素における縦方向の変化強度、および注目画素における横方向の変化強度に基づいて、第3の推定値を算出する第5の推定値算出手段とを含むようにすることができる。 The second estimated value calculating means calculates a fourth estimated value of the third color component in the target pixel based on the second color component of the pixel in the vicinity of the target pixel and the first estimated value. 4th estimation which calculates the 5th estimated value of the 3rd color component in a focused pixel based on the 1st color component and 2nd estimated value of the pixel of the vicinity of a focused pixel and the estimated value calculation means of this A fifth estimation value is calculated based on the value calculation means, the fourth estimated value, the fifth estimated value, the vertical change intensity at the target pixel, and the horizontal change intensity at the target pixel. And an estimated value calculating means.
第1の色成分および第2の色成分は、互いに相関の高い分光感度を有するようにすることができる。 The first color component and the second color component can have spectral sensitivity highly correlated with each other.
本発明の画像処理方法は、モザイク画像の注目画素、並びに注目画素の縦方向および横方向の近傍の画素に基づいて、注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出ステップと、注目画素と、注目画素の縦方向の近傍の画素に基づいて、第1の色成分の注目画素における第1の推定値を算出する第1の推定値算出ステップと、注目画素と注目画素の横方向の近傍の画素に基づいて、第2の色成分の注目画素における第2の推定値を算出する第2の推定値算出ステップと、縦方向の変化強度、横方向の変化強度、第1の推定値、および第2の推定値に基づいて、第1の色成分と第2の色成分からなる第3の色成分の注目画素における第3の推定値を算出する第3の推定値算出ステップとを含むことを特徴とする。 According to the image processing method of the present invention, the change intensity for calculating the vertical change intensity and the horizontal change intensity of the target pixel based on the target pixel of the mosaic image and pixels in the vertical and horizontal directions of the target pixel. A first estimated value calculating step for calculating a first estimated value for the target pixel of the first color component based on the calculation step, the target pixel, and a pixel in the vertical direction of the target pixel; A second estimated value calculating step of calculating a second estimated value of the target pixel of the second color component based on pixels in the horizontal direction of the target pixel; a vertical direction change intensity; and a horizontal direction change intensity. The third estimated value for the target pixel of the third color component composed of the first color component and the second color component is calculated based on the first estimated value and the second estimated value. And an estimated value calculating step. That.
本発明のプログラムは、モザイク画像の注目画素、並びに注目画素の縦方向および横方向の近傍の画素に基づいて、注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出ステップと、注目画素と、注目画素の縦方向の近傍の画素に基づいて、第1の色成分の注目画素における第1の推定値を算出する第1の推定値算出ステップと、注目画素と注目画素の横方向の近傍の画素に基づいて、第2の色成分の注目画素における第2の推定値を算出する第2の推定値算出ステップと、縦方向の変化強度、横方向の変化強度、第1の推定値、および第2の推定値に基づいて、第1の色成分と第2の色成分からなる第3の色成分の注目画素における第3の推定値を算出する第3の推定値算出ステップとを含む処理をコンピュータに実行させることを特徴とする。 The program of the present invention is a change intensity calculation step for calculating a vertical change intensity and a horizontal change intensity of a target pixel based on the target pixel of the mosaic image and pixels in the vertical and horizontal directions of the target pixel. A first estimated value calculating step for calculating a first estimated value of the target pixel of the first color component based on the target pixel and a pixel in the vertical direction of the target pixel; and the target pixel and the target pixel A second estimated value calculating step of calculating a second estimated value of the target pixel of the second color component based on the neighboring pixels in the horizontal direction, a vertical change strength, a horizontal change strength, 3rd estimated value which calculates the 3rd estimated value in the attention pixel of the 3rd color component which consists of 1st color component and 2nd color component based on 1 estimated value and 2nd estimated value Computation process including calculation step Characterized in that to execute the data.
本発明によれば、モザイク画像の注目画素、並びに注目画素の縦方向および横方向の近傍の画素に基づいて、注目画素における縦方向の変化強度および横方向の変化強度が算出され、注目画素と、注目画素の縦方向の近傍の画素に基づいて、第1の色成分の注目画素における第1の推定値が算出されるとともに、注目画素と注目画素の横方向の近傍の画素に基づいて、第2の色成分の注目画素における第2の推定値が算出され、縦方向の変化強度、横方向の変化強度、第1の推定値、および第2の推定値に基づいて、第1の色成分と第2の色成分からなる第3の色成分の注目画素における第3の推定値が算出される。 According to the present invention, based on the target pixel of the mosaic image and the pixels in the vertical and horizontal directions of the target pixel, the vertical change strength and the horizontal change strength of the target pixel are calculated. The first estimated value for the target pixel of the first color component is calculated based on the pixels in the vertical direction of the target pixel, and based on the pixels in the horizontal direction of the target pixel and the target pixel, A second estimated value of the pixel of interest of the second color component is calculated, and the first color is based on the vertical direction change intensity, the horizontal direction change intensity, the first estimate value, and the second estimate value. A third estimated value of the target pixel of the third color component composed of the component and the second color component is calculated.
本発明によれば、モザイク画像の補間をより精度よく行うことができる。特に、この発明によれば、方向検出に誤りが生じやすい限界解像度付近であっても、安定した補間結果を得ることができる。 According to the present invention, mosaic image interpolation can be performed with higher accuracy. In particular, according to the present invention, a stable interpolation result can be obtained even in the vicinity of the limit resolution where an error is likely to occur in direction detection.
以下に本発明の実施の形態を説明するが、本明細書に記載の発明と、発明の実施の形態との対応関係を例示すると、次のようになる。この記載は、本明細書に記載されている発明をサポートする実施の形態が、本明細書に記載されていることを確認するためのものである。したがって、発明の実施の形態中には記載されているが、発明に対応するものとして、ここには記載されていない実施の形態があったとしても、そのことは、その実施の形態が、その発明に対応するものではないことを意味するものではない。逆に、実施の形態が発明に対応するものとしてここに記載されていたとしても、そのことは、その実施の形態が、その発明以外の発明には対応しないものであることを意味するものでもない。 Embodiments of the present invention will be described below. The correspondence relationship between the invention described in this specification and the embodiments of the invention is exemplified as follows. This description is intended to confirm that the embodiments supporting the invention described in this specification are described in this specification. Therefore, even if there is an embodiment that is described in the embodiment of the invention but is not described here as corresponding to the invention, the fact that the embodiment is not It does not mean that it does not correspond to the invention. Conversely, even if an embodiment is described herein as corresponding to an invention, that means that the embodiment does not correspond to an invention other than the invention. Absent.
更に、この記載は、本明細書に記載されている発明の全てを意味するものでもない。換言すれば、この記載は、本明細書に記載されている発明であって、この出願では請求されていない発明の存在、すなわち、将来、分割出願されたり、補正により出現、追加される発明の存在を否定するものではない。 Further, this description does not mean all the inventions described in this specification. In other words, this description is for the invention described in the present specification, which is not claimed in this application, that is, for the invention that will be applied for in the future or that will appear and be added by amendment. It does not deny existence.
本発明によれば画像処理装置が提供される。この画像処理装置(例えば、図2のデジタルカメラ201)は、第1の色成分(例えば、G)が水平および垂直に1ラインおきに配置され、第2の色成分(例えば、E)が水平および垂直に1ラインおきに配置され、かつ、第1の色成分とは異なる水平および垂直ラインに配置されたカラーフィルタを用いた単板式カラー撮像素子により撮像されたモザイク画像に基づいて、各画素が複数の色成分を有するカラー画像を生成する画像処理装置(例えば、図2のデジタルカメラ201)であって、前記モザイク画像の注目画素、並びに前記注目画素の縦方向および横方向の近傍の画素に基づいて、前記注目画素における縦方向の変化強度(例えば、テクスチャ強度TV)および横方向の変化強度(例えば、テクスチャ強度TH)を算出する変化強度算出手段(例えば、図6のテクスチャ強度算出処理部334)と、前記注目画素(例えば、R)と、前記注目画素の縦方向の近傍の画素(例えば、Rの縦近傍の画素G)に基づいて、前記第1の色成分(例えば、G)の前記注目画素における第1の推定値(例えば、GF)を算出するとともに、前記注目画素(例えば、R)と前記注目画素の横方向の近傍の画素(例えば、Rの横近傍の画素E)に基づいて、前記第2の色成分(例えば、E)の前記注目画素における第2の推定値(例えば、EF)を算出する第1の推定値算出手段(例えば、図6のG補間処理部332−1、またはE補間処理部332−2)と、前記縦方向の変化強度、前記横方向の変化強度、前記第1の推定値、および前記第2の推定値に基づいて、前記第1の色成分と前記第2の色成分からなる第3の色成分の前記注目画素における第3の推定値(例えば、G+E)を算出する第2の推定値算出手段(例えば、図6のG+E生成処理部335、G+E生成処理部336、および合成処理部337)とを含む。
According to the present invention, an image processing apparatus is provided. In this image processing apparatus (for example, the
変化強度算出手段は、注目画素における第1の色成分および第2の色成分の第1の補間値(例えば、GA(j’,k’)およびEA(j’,k’)(但し、(j’,k’)は処理画素位置))を、注目画素の近傍の画素の画素値に基づいて補間し、注目画素の縦方向に位置する画素における第1の色成分および第2の色成分の第2の補間値(例えば、GA(j’,k’−1)およびGA(j’,k’+1)、並びにEA(j’,k’−1)およびEA(j’,k’+1))を、注目画素の近傍の画素の画素値に基づいて補間し、注目画素の横方向に位置する画素における第1の色成分および第2の色成分の第3の補間値(例えば、GA(j’−1,k’)およびGA(j’+1,k’)、並びにEA(j’−1,k’)およびEA(j’+1,k’))を、注目画素の近傍の画素の画素値に基づいて補間し、第1の補間値(例えば、注目画素位置(j’,k’)のGA(j’,k’)およびEA(j’,k’))と、第2の補間値(例えば、GA(j’,k’−1)およびGA(j’,k’+1)、並びにEA(j’,k’−1)およびEA(j’,k’+1))との差分の組により縦勾配評価値(例えば、dV)を算出し(例えば、図13のステップS203)、第1の補間値(例えば、GA(j’,k’)およびEA(j’,k’))と、第3の補間値(例えば、GA(j’−1,k’)およびGA(j’+1,k’)、並びにEA(j’−1,k’)およびEA(j’+1,k’))との差分の組により横勾配評価値(例えば、dH)を算出し(例えば、図13のステップS203)、縦勾配評価値および横勾配評価値に基づいて、変化強度を決定し(例えば、図13のステップS211)、注目画素および注目画素の近傍における変化強度の偏差を算出し、偏差に基づいて、注目画素の変化強度を補正する(例えば、図12のステップS154)ことができる。 The change intensity calculating means calculates the first interpolation values (for example, GA (j ′, k ′) and EA (j ′, k ′) (for example, (( j ′, k ′) interpolate the processing pixel position)) based on the pixel value of the pixel in the vicinity of the target pixel, and the first color component and the second color component in the pixel positioned in the vertical direction of the target pixel Second interpolation values (eg, GA (j ′, k′−1) and GA (j ′, k ′ + 1), and EA (j ′, k′−1) and EA (j ′, k ′ + 1) )) Is interpolated based on the pixel values of pixels in the vicinity of the target pixel, and third interpolation values (for example, GA) of the first color component and the second color component in the pixel located in the horizontal direction of the target pixel. (J′-1, k ′) and GA (j ′ + 1, k ′) and EA (j′−1, k ′) and EA (j ′ + 1, k ′)) Interpolation is performed based on the pixel values of the pixels in the vicinity of the eye pixel, and first interpolation values (for example, GA (j ′, k ′) and EA (j ′, k ′) at the target pixel position (j ′, k ′) are obtained. )) And second interpolated values (eg, GA (j ′, k′−1) and GA (j ′, k ′ + 1), and EA (j ′, k′−1) and EA (j ′, k ′ + 1)) is used to calculate a longitudinal gradient evaluation value (eg, dV) (eg, step S203 of FIG. 13), and a first interpolation value (eg, GA (j ′, k ′)) EA (j ′, k ′)) and third interpolation values (eg, GA (j′−1, k ′) and GA (j ′ + 1, k ′), and EA (j′−1, k ′) ) And EA (j ′ + 1, k ′)), a lateral gradient evaluation value (for example, dH) is calculated (for example, step S203 in FIG. 13), and the vertical gradient evaluation value and the lateral gradient are calculated. The change intensity is determined based on the distribution evaluation value (for example, step S211 in FIG. 13), the deviation of the change intensity in the vicinity of the target pixel and the target pixel is calculated, and the change intensity of the target pixel is corrected based on the deviation. (For example, step S154 in FIG. 12).
第2の推定値算出手段は、注目画素の近傍の画素の第2の色成分(例えば、E)および第1の推定値(例えばGF)に基づいて、注目画素における第3の色成分(例えば、G+E)の第4の推定値(例えば(G+E)H)を算出する第3の推定値算出手段(例えば、図6のG+E生成処理部336)と、注目画素の近傍の画素の第1の色成分(例えばG)および第2の推定値(例えばEF)に基づいて、注目画素における第3の色成分の第5の推定値(例えば(G+E)V)を算出する第4の推定値算出手段(例えば、図6のG+E生成処理部335)と、第4の推定値、第5の推定値、注目画素における縦方向の変化強度、および注目画素における横方向の変化強度に基づいて、第3の推定値(例えば、(G+E))を算出する第5の推定値算出手段(例えば、図6の合成処理部337)とを備えるようにすることができる。
Based on the second color component (for example, E) and the first estimated value (for example, GF) of the pixel in the vicinity of the target pixel, the second estimated value calculation unit calculates the third color component (for example, the target pixel) , G + E) third estimated value calculating means (for example, G + E
第1の色成分および第2の色成分は、互いに相関の高い分光感度を有するようにすることができる。 The first color component and the second color component can have spectral sensitivity highly correlated with each other.
本発明によれば、画像処理方法が提供される。この画像処理方法は、第1の色成分(例えば、G)が水平および垂直に1ラインおきに配置されるとともに、第2の色成分(例えば、E)が水平および垂直に1ラインおきに配置され、かつ、第1の色成分とは異なる水平および垂直ラインに配置されたカラーフィルタを用いた単板式カラー撮像素子により撮像されたモザイク画像に基づいて、各画素が複数の色成分を有するカラー画像を生成する画像処理装置(例えば、図2のデジタルカメラ201)の画像処理方法であって、モザイク画像の注目画素、並びに注目画素の縦方向および横方向の近傍の画素に基づいて、注目画素における縦方向の変化強度(例えば、テクスチャ強度TV)および横方向の変化強度(例えば、テクスチャ強度TH)を算出する変化強度算出ステップ(例えば、図9のステップS53)と、注目画素(例えば、R)と、注目画素の縦方向の近傍の画素(例えば、Rの縦近傍の画素G)に基づいて、第1の色成分(例えば、G)の注目画素における第1の推定値(例えば、GF)を算出する第1の推定値算出ステップ(例えば、図9のステップS54)と、注目画素(例えば、R)と注目画素の横方向の近傍の画素(例えば、Rの横近傍の画素E)に基づいて、第2の色成分(例えば、E)の注目画素における第2の推定値(例えば、EF)を算出する第2の推定値算出ステップ(例えば、図9のステップS55)と、縦方向の変化強度、横方向の変化強度、第1の推定値、および第2の推定値に基づいて、第1の色成分と第2の色成分からなる第3の色成分(例えば、G+E)の注目画素における第3の推定値(例えば、G+E)を算出する第3の推定値算出ステップ(例えば、図9のステップS58乃至ステップS60)とを含む。
According to the present invention, an image processing method is provided. In this image processing method, the first color component (for example, G) is arranged every other line in the horizontal and vertical directions, and the second color component (for example, E) is arranged every other line in the horizontal and vertical directions. And each pixel has a plurality of color components based on a mosaic image captured by a single-plate color image sensor using color filters arranged on horizontal and vertical lines different from the first color component An image processing method of an image processing apparatus (for example, the
本発明によれば、プログラムが提供される。このプログラムは、第1の色成分(例えば、G)が水平および垂直に1ラインおきに配置されるとともに、第2の色成分(例えば、E)が水平および垂直に1ラインおきに配置され、かつ、第1の色成分とは異なる水平および垂直ラインに配置されたカラーフィルタを用いた単板式カラー撮像素子により撮像されたモザイク画像に基づいて、各画素が複数の色成分を有するカラー画像を生成する画像処理装置(例えば、図2のデジタルカメラ201)の画像処理方法であって、モザイク画像の注目画素、並びに注目画素の縦方向および横方向の近傍の画素に基づいて、注目画素における縦方向の変化強度(例えば、テクスチャ強度TV)および横方向の変化強度(例えば、テクスチャ強度TH)を算出する変化強度算出ステップ(例えば、図9のステップS53)と、注目画素(例えば、R)と、注目画素の縦方向の近傍の画素(例えば、Rの縦近傍の画素G)に基づいて、第1の色成分(例えば、G)の注目画素における第1の推定値(例えば、GF)を算出する第1の推定値算出ステップ(例えば、図9のステップS54)と、注目画素(例えば、R)と注目画素の横方向の近傍の画素(例えば、Rの横近傍の画素E)に基づいて、第2の色成分(例えば、E)の注目画素における第2の推定値(例えば、EF)を算出する第2の推定値算出ステップ(例えば、図9のステップS55)と、縦方向の変化強度、横方向の変化強度、第1の推定値、および第2の推定値に基づいて、第1の色成分と第2の色成分からなる第3の色成分(例えば、G+E)の注目画素における第3の推定値(例えば、G+E)を算出する第3の推定値算出ステップ(例えば、図9のステップS58乃至ステップS60)とをコンピュータに実行させる。
According to the present invention, a program is provided. The program includes a first color component (eg, G) arranged horizontally and vertically every other line, and a second color component (eg, E) arranged horizontally and vertically every other line, In addition, a color image in which each pixel has a plurality of color components based on a mosaic image picked up by a single-plate color image pickup device using color filters arranged on horizontal and vertical lines different from the first color component. An image processing method of an image processing apparatus (for example, the
以下、図を参照して、本発明の実施の形態について説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
図2は、本発明を適用したデジタルカメラ201の構成を示すブロック図である。
FIG. 2 is a block diagram showing a configuration of a
図2に示すように、デジタルカメラ201は、レンズ211、絞り212、CCD(Charge Coupled Devices)イメージセンサ213、相関2重サンプリング(CDS:Correlated Double Sampling)回路214、A/Dコンバータ215、DSP(Digital Signal Processor)ブロック216、タイミングジェネレータ217、D/Aコンバータ218、ビデオエンコーダ219、表示部220、コーデック(CODEC:COmpression/DECompression)処理部221、メモリ222、CPU(Central Processing Unit)223、および、操作入力部224から構成される。
As shown in FIG. 2, the
CCDとは、光情報を電気信号に変換する(光電変換)半導体素子であり、CCDイメージセンサ213は、光を電気に変換する受光素子(画素)を複数個並べ、光の変化を画素ごとに独立して電気信号に変換するものである。相関2重サンプリング回路214は、CCDイメージセンサ213の出力信号に含まれるノイズのうちの主な成分であるリセットノイズを、出力の各画素信号のうち、映像信号期間をサンプリングしたものと、基準期間をサンプリングしたものとを引き算することにより除去する回路である。A/Dコンバータ215は、供給されたノイズ除去後のアナログ信号をデジタル信号に変換する。
The CCD is a semiconductor element that converts light information into an electrical signal (photoelectric conversion). The
DSPブロック216は、信号処理用プロセッサと画像用RAM(Random Access Memory)を持つブロックで、信号処理用プロセッサが画像用RAMに格納された画像データに対して、予めプログラムされた画像処理、または、ハードウェアによる演算処理として構成された画像処理を行うものである。タイミングジェネレータ217は、CCDを駆動するために必要な、水平および垂直の各種駆動パルス、並びに、アナログフロント処理で用いるパルスを、基準クロックに同期して発生させるロジック回路である。また、タイミングジェネレータ217により発生されるタイミングクロックは、バス225を介して、コーデック処理部221、メモリ222、および、CPU223にも供給されている。
The
D/Aコンバータ218は、供給されたデジタル信号をアナログ信号に変換して出力する。ビデオエンコーダ219は、供給されたアナログ信号を、表示部220において表示可能な形式のビデオデータにエンコードする。表示部220は、例えば、LCD(Liquid Crystal Display)などで構成され、ビデオエンコーダ219から供給されたビデオ信号を表示する。
The D /
コーデック処理部221は、例えば、MPEG(Moving Picture Coding Experts Group/Moving Picture Experts Group)などの、デジタルビデオデータの圧縮または伸張アルゴリズムによる処理を実行する。メモリ222は、例えば、半導体メモリ、磁気ディスク、光磁気ディスク、または、光ディスクなどにより構成され、CPU223の制御に基づいて、供給されたデータを記憶したり、または、記憶しているデータを出力する。なお、メモリ222は、デジタルカメラ201に対して着脱可能なようになされていても良い。
The
CPU223は、バス225を介して、操作入力部224から供給されたユーザの操作入力を基に、デジタルカメラ201の各部を制御する。操作入力部224は、録画を指令する場合のボタンをはじめとして、例えば、ジョグダイヤル、キー、レバー、ボタン、またはタッチパネルなどにより構成され、ユーザによる操作入力を受ける。
The
レンズ211および絞り212を介して入力された光は、CCDイメージセンサ213に入射され、受光素子での光電変換によって電気信号に変換され、相関2重サンプリング回路214に供給される。相関2重サンプリング回路214は、CCDイメージセンサ213の出力の各画素信号のうち、映像信号期間をサンプリングしたものと、基準期間をサンプリングしたものとを引き算することによりノイズを除去し、A/Dコンバータ215に供給する。A/Dコンバータ215は、供給されたノイズ除去後のアナログ信号をデジタル信号に変換し、DSPブロック216の画像用RAMに一時格納する。
Light input through the
タイミングジェネレータ217は、撮像中の状態において、一定のフレームレートによる画像取り込みを維持するように、CCDイメージセンサ213、相関2重サンプリング回路214、A/Dコンバータ215、および、DSPブロック216を制御する。
The
DSPブロック216は、一定のレートで画素のストリームデータの供給を受け、画像用RAMに一時格納し、信号処理用プロセッサにおいて、一時格納された画像データに対して、後述する画像処理を実行する。DSPブロック216は、画像処理の終了後、CPU223の制御に基づいて、その画像データを表示部220に表示させる場合は、D/Aコンバータ218に、メモリ222に記憶させる場合は、コーデック処理部221に画像データを供給する。
The
D/Aコンバータ218は、DSPブロック216から供給されたデジタルの画像データをアナログ信号に変換し、ビデオエンコーダ219に供給する。ビデオエンコーダ219は、供給されたアナログの画像信号を、ビデオ信号に変換し、表示部220に出力して表示させる。すなわち、表示部220は、デジタルカメラ201において、カメラのファインダの役割を担っている。コーデック処理部221は、DSPブロック216から供給された画像データに対して、所定の方式の符号化を施し、符号化された画像データをメモリ222に供給して記憶させる。
The D /
また、コーデック処理部221は、操作入力部224からユーザの操作入力を受けたCPU223の制御に基づいて、メモリ222に記憶されているデータのうち、ユーザに指定されたデータを読み取り、所定の復号方法で復号し、復号した信号をDSPブロック216に出力する。これにより、復号された信号が、DSPブロック216を介してD/Aコンバータ218に供給され、アナログ変換された後、ビデオエンコーダ219によりエンコードされて、表示部220に表示される。
Further, the
ところで、図2のCCDイメージセンサ213のオンチップカラーフィルタには、通常、3種類または4種類の色が用いられており、これらのオンチップカラーフィルタは、受光素子ごとに、交互に異なる色になるようモザイク状に配列されている。本発明においては、RGB(Red,Green,Blue:赤、緑、青)の3色に、Gに分光特性が近い4色目となる色(以下、E(Emerald)と称する)を加えた4色を用いた配列のオンチップカラーフィルタを用いる。この4色のモザイク配列の例を、図3に示す。なお、本明細書中では、Gに近い分光特性の4色目となる色をEとしたが、この色はEmeraldに限定されず、Gに近い分光特性であれば何色でもよい。
Incidentally, the on-chip color filter of the
図3に示されるように4色配列は、赤(R)の光のみを透過するRのフィルタが1個、緑色(G)の光のみを透過するGのフィルタが1個、青(B)の光のみを透過するBのフィルタが1個、エメラルド(E)の光のみを透過するEのフィルタが1個の、合計4個を最小単位として構成されている。すなわち、R,G,B,Eの各フィルタは、同じ密度で存在する。 As shown in FIG. 3, the four-color arrangement has one R filter that transmits only red (R) light, one G filter that transmits only green (G) light, and blue (B). One filter for transmitting only B light and one E filter for transmitting only light of emerald (E), a total of four is configured as a minimum unit. That is, the R, G, B, and E filters exist at the same density.
このように、CCDイメージセンサ213のオンチップカラーフィルタに図3に示されるような4色のモザイクが用いられている場合、DSPブロック216の画像用RAMに一時格納されている画像は、各画素とも、R,G,B,Eのうちのいずれか1つの色しか持たない。そこで、DSPブロック216の信号処理用プロセッサは、予め組み込まれた画像処理プログラムまたはハードウェアによって、この画像を処理し、全画素において全色のデータを有する画像データを生成する。具体的には、DSPブロック216の信号処理用プロセッサは、まず、G,Eを合成した新たな色(以下、G+Eと称する)を全画素に生成し、3色のベイヤー配列においてGを全画素揃えることを前提とした補間方法を、4色のモザイク配列においても同様に適用できるようにする。
As described above, when the four-color mosaic as shown in FIG. 3 is used for the on-chip color filter of the
図4は、図2のDSPブロック216の更に詳細な構成を示すブロック図である。 FIG. 4 is a block diagram showing a more detailed configuration of the DSP block 216 of FIG.
DSPブロック216は、上述したように、画像用RAM241および信号処理用プロセッサ242で構成され、信号処理用プロセッサ242は、ホワイトバランス調整部251、ガンマ補正部252、デモザイク処理部253、および、YC変換部254で構成される。
As described above, the
A/Dコンバータ215によってデジタル信号に変換されたモザイク画像は、画像用RAM241に一時保存される。モザイク画像は、各画素にR,G,BまたはEのいずれかの色に対応する強度信号、すなわち、CCDイメージセンサ213に用いられているカラーフィルタにより定められる配列(例えば、図3を用いて説明した4色のモザイク配列)の周期的なパターンの強度信号により構成されている。
The mosaic image converted into a digital signal by the A /
ホワイトバランス調整部251は、モザイク画像に対して、無彩色の被写体領域の色バランスが無彩色になるように、各画素強度の持つ色に応じて適切な係数をかける処理(ホワイトバランスの調整処理)を実行する。ガンマ補正部252は、ホワイトバランスが調整されたモザイク画像の各画素強度に対して、ガンマ補正を行う。画像の階調の応答特性を表すために「ガンマ(γ)」という数値が使われる。ガンマ補正とは、表示部220に表示される画像の明るさや色の彩度を正しく表示するための補正処理のことである。表示部220に出力される信号は、画素ごとに特定の電圧を加えることで、画像の明るさや色が再現されるようになされている。しかしながら、実際に表示される画像の明るさや色は、表示部220が有する特性(ガンマ値)により、入力電圧を倍にしてもブラウン管の明るさが倍になるわけではない(非線形性を有する)ため、ガンマ補正部252において、表示部220に表示される画像の明るさや色の彩度が正しく表示されるように補正する処理が施される。
The white
デモザイク処理部253は、色分布形状を統計的に算出することにより、ガンマ補正がなされたモザイク画像の各画素位置にR,G,B,Eの4色の強度を揃えるデモザイク処理を実行する。したがって、デモザイク処理部253からの出力信号は、R,G,B,Eの4つの色に対応する4つの画像信号となる。YC変換部254はR,G,B,Eの4チャネル画像に、マトリックス処理およびクロマ成分に対する帯域制限を行うことで、Y画像およびC画像(YCbCr画像信号)を生成し、出力する。
The
DSPブロック216の信号処理用プロセッサ242においては、デモザイク処理部253によるデモザイク処理の前に、ガンマ補正部252によりガンマ補正を行うものとしている。これは、ガンマ補正された非線形な画素強度空間においてデモザイク演算を実行することにより、デモザイク処理部253のデモザイク処理の信頼性をより高めることができるためである。
In the
例えば、入力される画像が高コントラストな輪郭領域である場合、その色分布は、非常に明るい強度域と非常に暗い強度域に渡ってしまう。物理的に、物体反射光は、物体表面のばらつきに照明からの入射光強度が乗じられたものになることから、カメラへの入射光強度に比例する線形な画素強度空間においては、明るい強度域にある物体色の分布はスパースに(まばらに)広がり、暗い画素強度域にある物体色の分布はあまり広がらずにコンパクトに縮まる傾向にある。 For example, when the input image is a high-contrast contour region, the color distribution covers a very bright intensity region and a very dark intensity region. Physically, the object reflected light is obtained by multiplying the variation of the object surface by the incident light intensity from the illumination. Therefore, in the linear pixel intensity space proportional to the incident light intensity to the camera, the bright intensity region The distribution of the object color in the sparsely spreads (sparsely), and the distribution of the object color in the dark pixel intensity region does not spread so much and tends to be compact.
デモザイク処理部253においては、色分布形状を統計的に算出することにより、デモザイク処理を実行する。しかしながら、高コントラストな輪郭領域では、明るい領域での画素強度のちらばりと暗い領域での画素強度のちらばりが大きく異なり、統計的な線形回帰が適用しにくくなる。したがって、入力されたデータに対して、デモザイク処理部253におけるデモザイク処理に先立って、ガンマ補正のような非線形の画素強度変換を施して、暗い画素強度域を持ち上げて(明るい画素強度領域に近づけて)、画素強度の分散をある程度抑制するようにすることにより、デモザイク処理部253において実行される線形回帰処理の信頼性を向上させることができる。
In the
このような目的で適用する非線形変換は、ガンマ補正のように1より小さい指数によるべき乗変換が望ましいが、通常カラープロファイル等で用いられているsRGBガンマのように、べき乗部と線形部を組み合わせたような変換であっても、略べき乗関数と同じとみなせるようなものであれば、いずれの非線形変換であってもよい。また、非線形変換を省略するようにしても、デモザイク処理の後に、ガンマ補正などの非線形変換処理を行うようにしてもよいことは言うまでもない。 The nonlinear transformation applied for such a purpose is preferably a power transformation with an exponent smaller than 1 as in gamma correction, but a combination of a power portion and a linear portion as in sRGB gamma usually used in a color profile or the like. Even if it is such a conversion, any non-linear conversion may be used as long as it can be regarded as being substantially the same as a power function. Needless to say, even if the non-linear conversion is omitted, a non-linear conversion process such as gamma correction may be performed after the demosaic process.
図5は、全画素位置でRGBEの4色が存在するように、各画素位置ごとに順次、そこにない色の強度を補間または推定していく処理であるデモザイク処理を実行する、図4のデモザイク処理部253の更に詳細な構成を示すブロック図である。
5 executes a demosaic process, which is a process of sequentially interpolating or estimating the intensity of a color that is not present at each pixel position so that there are four RGBE colors at all pixel positions. 4 is a block diagram showing a more detailed configuration of a
デモザイク処理部253には、局所領域抽出部281、G+E算出処理部282、および画素値補間部283が設けられている。局所領域抽出部281は、ガンマ補正されたモザイク画像から、注目画素位置周囲の決まった大きさの局所領域の画素を切り出す。ここでは、切り出す局所領域を、注目画素位置を中心とした7×7画素の矩形領域とする。G+E算出処理部282は、局所領域内に存在する画素を用いて、注目画素位置におけるG+Eを算出する。画素値補間部283は、G+Eを用いて、全画素にRGBEの4色を補間する。
The
図6は、図5のG+E算出処理部282の詳細な構成例を示すブロック図である。G+E算出処理部282は、G補間処理部331−1、E補間処理部331−2、G補間処理部332−1、E補間処理部332−2、G補間処理部333−1、E補間処理部333−2、テクスチャ強度算出処理部334、G+E生成処理部335、G+E生成処理部336、および合成処理部337で構成される。本構成は、モザイク上のR,G,Eの信号を用いて、R画素上にG+Eを生成するものである。ここでは色成分の推定に回帰推定を用いる。
FIG. 6 is a block diagram illustrating a detailed configuration example of the G + E
G補間処理部331−1は、注目R画素の近傍画素位置全てにGの簡易的な補間値GAを算出し、同様にE補間処理部331−2は、Eの補間値EAを算出する。テクスチャ強度算出処理部334は、G補間処理部331−1とE補間処理部331−2により得られた補間値GA,EAを用いて、R画素位置の横方向のテクスチャ強度TH(変化強度)と縦方向のテクスチャ強度TV(変化強度)を算出する。G補間処理部332−1は、横近傍の補間値GAと信号Rを用いて、Gの2つ目の補間値GFを算出し、E補間処理部332−2は、縦近傍の補間値EAと信号Rを用いて、Eの2つ目の補間値EFを算出する。またG補間処理部333−1は、補間値GA,EA,EFを用いてGの3つ目の補間値GUを、E補間処理部333−2は、補間値GA,EA,GFを用いてEの3つ目の補間値EUを、R画素位置に算出する。
The G interpolation processing unit 331-1 calculates a simple G interpolation value GA for all neighboring pixel positions of the target R pixel, and similarly, the E interpolation processing unit 331-2 calculates an E interpolation value EA. The texture strength
G+E生成処理部335は、補間値GU,EFを合成して(G+E)Vを算出するとともに、G+E生成処理部336は、補間値GF,EUを合成して(G+E)Hを算出する。合成処理部337は、2つのG+Eの値、すなわち(G+E)V、(G+E)Hとテクスチャ強度TH、TVを用いて、R画素位置での信号G+Eを決定する。
The G + E
以上の説明では、モザイク上のR,G,Eの信号を用いて、R画素上にG+Eを生成する場合について説明したが、B画素上にG+Eを生成する過程については、以上の説明においてRをBに、GをEに、EをGに読み替えることで得られる。また、G,E画素上にG+Eを生成する方法については、あらかじめG,Eいずれかの画素値が分かっている状態であり、簡易な補間方法によっても十分な精度が得られるため、ここでは説明を省略する。 In the above description, the case where G + E is generated on the R pixel using R, G, E signals on the mosaic has been described, but the process of generating G + E on the B pixel is described in the above description. To B, G to E, and E to G. The method for generating G + E on the G and E pixels is a state in which the pixel value of either G or E is known in advance, and sufficient accuracy can be obtained by a simple interpolation method. Is omitted.
次に、図7のフローチャートを参照して、図4のDSPブロック216の処理について説明する。
Next, processing of the
ステップS1において、画像用RAM241は、CCDイメージセンサ213に用いられているカラーフィルタにより定められる配列(例えば、図3を用いて説明した4色配列)の周期的なパターンの強度信号により構成されるモザイク画像を取得して、一時保存する。
In step S1, the
ステップS2において、信号処理用プロセッサ242のホワイトバランス調整部251は、モザイク画像に対して、無彩色の被写体領域の色バランスが無彩色になるように、各画素強度の持つ色に応じて適切な係数をかける処理であるホワイトバランス調整処理を行う。
In step S2, the white
ステップS3において、ガンマ補正部252は、ホワイトバランスがとられたモザイク画像の各画素強度に対し、表示部220に表示される画像の明るさや色の彩度が正しく表示されるようにガンマ補正を行う。
In step S <b> 3, the
ステップS4において、デモザイク処理部253により、図8を用いて後述するデモザイク処理が実行される。
In step S4, the
YC変換部254は、ステップS5において、デモザイク処理部253からの出力であるR,G,B,Eの4チャネル画像に、マトリックス処理およびクロマ成分に対する帯域制限をおこなうことで、YC変換を行い、Y画像およびC画像を生成し、ステップS6において、生成したY画像およびC画像を出力し、処理が終了される。
In step S5, the
このような処理により、DSPブロック216は、供給されたモザイク画像信号に対して、各種処理を施して、Y画像およびC画像を生成し、CPU223の制御に基づいて、その画像データを表示部220に表示させる場合は、D/Aコンバータ218に、メモリ222に記憶させる場合は、コーデック処理部221に供給する。
Through such processing, the
次に、図8のフローチャートを参照して、図7のステップS4において実行されるデモザイク処理について説明する。 Next, the demosaic process executed in step S4 of FIG. 7 will be described with reference to the flowchart of FIG.
局所領域抽出部281は、ステップS21において、未処理の画素のうちのいずれかを注目画素とし、ステップS22において、注目画素位置の周辺の所定数(以下に続く処理に必要とされる画素領域を含む十分な数)の画素を、局所領域として抽出し、G+E算出処理部282および画素値補間部283に供給する。
In step S21, the local
ステップS23において、G+E算出処理部282は、図9のフローチャートを用いて後述する、G+E算出処理を実行し、算出したG+Eを画素値補間部283に供給する。
In step S <b> 23, the G + E
ステップS24において、画素値補間部283は、G+Eを用いて、各色の画素値を補間する。
In step S24, the pixel
ステップS25において、局所領域抽出部281は、全ての画素において処理が終了したか否かを判断する。ステップS25において、全ての画素において処理が終了していないと判断された場合、処理は、ステップS21に戻り、それ以降の処理が繰り返される。ステップS25において、全ての画素において処理が終了したと判断された場合、処理は図7のステップS5に進む。
In step S25, the local
換言すれば、デモザイク処理部253を構成する各部は、ある注目画素位置が決定されたときにその注目画素位置においてそれぞれの処理を実行し、全画素において、ステップS21乃至ステップS24の処理が終了された場合、処理が終了される。
In other words, each unit constituting the
次に、図9のフローチャートを参照して、図8のステップS23において実行されるG+E算出処理について説明する。この処理は、図6のG+E算出処理部282により実行される処理である。
Next, the G + E calculation process executed in step S23 of FIG. 8 will be described with reference to the flowchart of FIG. This process is a process executed by the G + E
ステップS51において、G補間処理部331−1は、第1のG補間処理を実行する。この詳細は、図10および図11を参照して後述する。 In step S51, the G interpolation processing unit 331-1 executes the first G interpolation processing. Details of this will be described later with reference to FIGS.
ステップS52において、E補間処理部331−2は、第1のE補間処理を実行する。この詳細は、図10および図11を参照して後述する。 In step S52, the E interpolation processing unit 331-2 executes the first E interpolation processing. Details of this will be described later with reference to FIGS.
ステップS53において、テクスチャ強度算出処理部334は、補正テクスチャ強度算出処理を実行する。この詳細は、図12を参照して後述する。
In step S53, the texture strength
ステップS54において、G補間処理部332−1は、第2のG補間処理を実行する。この詳細は、図20を参照して後述する。 In step S54, the G interpolation processing unit 332-1 executes the second G interpolation processing. Details of this will be described later with reference to FIG.
ステップS55において、E補間処理部332−2は、第2のE補間処理を実行する。この詳細は、図20を参照して後述する。 In step S55, the E interpolation processing unit 332-2 executes a second E interpolation process. Details of this will be described later with reference to FIG.
ステップS56において、G補間処理部333−1は、第3のG補間処理を実行する。この詳細は、図31を参照して後述する。 In step S56, the G interpolation processing unit 333-1 executes a third G interpolation process. Details of this will be described later with reference to FIG.
ステップS57において、E補間処理部333−2は、第3のE補間処理を実行する。この詳細は、図31を参照して後述する。 In step S57, the E interpolation processing unit 333-2 executes a third E interpolation process. Details of this will be described later with reference to FIG.
ステップS58において、G+E生成処理部335は、第1のG+E生成処理を実行する。この詳細は、図34を参照して後述する。
In step S58, the G + E
ステップS59において、G+E生成処理部336は、第2のG+E生成処理を実行する。この詳細は、図35を参照して後述する。
In step S59, the G + E
ステップS60において、合成処理部337は、合成処理を実行する。この詳細は、図36を参照して後述する。
In step S60, the
図9の処理により、モザイク状のR,G,Eの信号に基づいて、R画素上にG+Eが生成される。 Through the process of FIG. 9, G + E is generated on the R pixel based on the mosaic R, G, and E signals.
次に、図10および図11のフローチャートを参照して、図9のステップS51またはステップS52において実行される第1の補間処理(第1のG補間処理および第1のE補間処理)を説明する。なお、GおよびEのいずれに対しても同様の処理が実行されるので、図10および図11においてXと記述されている部分については、適宜G,Eに読み替えられる。具体的には、図10および図11の処理がステップS51に対応する処理の場合、G補間処理部331−1が実行する処理であり、ステップS52に対応する処理の場合、E補間処理部331−2が実行する処理である。 Next, the first interpolation processing (first G interpolation processing and first E interpolation processing) executed in step S51 or step S52 of FIG. 9 will be described with reference to the flowcharts of FIGS. . Since the same processing is executed for both G and E, the portions described as X in FIGS. 10 and 11 are appropriately read as G and E. Specifically, when the processing of FIGS. 10 and 11 is processing corresponding to step S51, it is processing executed by the G interpolation processing unit 331-1. In the case of the processing corresponding to step S52, E interpolation processing unit 331. -2 is a process to be executed.
ステップS101において、G補間処理部331−1またはE補間処理部331−2は、局所領域のうち、処理を実行する画素位置を示す第1のレジスタの値jを初期化してj=−n+1とし、ステップS102において、局所領域のうち、処理を実行する画素位置を示す第2のレジスタの値kを初期化してk=−n+1とする。ここでは、画素(0,0)を中心とする(2n−1)×(2n−1)の画素群に対して処理が行われる。なお、nは、正の整数であり、(j,k)は局所領域における中心(注目画素位置)を(0,0)とした場合の、処理を実行する画素位置を示す。なお、nの値は、処理に必要な任意の定数と考えることができる。したがって、本実施形態を実装する際には、このようなレジスタ値の細かい設定を省略することも可能である。特に、nが十分大きな値であるとすれば、実質的に同一の結果を得ることができるものと考えられる。このことは、後述するn’、n’’、およびn’’’についても同様である。
In step S101, the G interpolation processing unit 331-1 or the E interpolation processing unit 331-2 initializes the value j of the first register indicating the pixel position to be processed in the local region to j = −
ステップS103において、G補間処理部331−1またはE補間処理部331−2は、画素(j,k)がXであるか否かを判定する。ここでXは、G補間処理部331−1がこの処理を実行している場合にはGとされ、E補間処理部331−2がこの処理を実行している場合にはEとされる(以下同様)。上述した図3に示される4色のフィルタ配列が公知であることから、この処理では、画素位置を用いて色を判定することができる。 In step S103, the G interpolation processing unit 331-1 or the E interpolation processing unit 331-2 determines whether or not the pixel (j, k) is X. Here, X is set to G when the G interpolation processing unit 331-1 is executing this processing, and is set to E when the E interpolation processing unit 331-2 is executing this processing ( The same applies below). Since the above-described four-color filter array shown in FIG. 3 is known, in this process, the color can be determined using the pixel position.
ステップS103において画素(j,k)の色がXであると判定された場合、ステップS104において、G補間処理部331−1またはE補間処理部331−2は、画素(j,k)の補間値XAを画素(j,k)の色Xとする。すなわち、処理画素位置の色がXであると判定された場合には、補間をする必要がないのでそのままの信号が用いられる。 When it is determined in step S103 that the color of the pixel (j, k) is X, in step S104, the G interpolation processing unit 331-1 or E interpolation processing unit 331-2 performs interpolation of the pixel (j, k). The value XA is the color X of the pixel (j, k). That is, when it is determined that the color at the processing pixel position is X, no interpolation is required and the signal is used as it is.
ステップS103において、画素(j,k)がXでないと判定された場合、ステップS105において、G補間処理部331−1またはE補間処理部331−2は、画素(j−1,k)の色がXであるか否かを判定する。 If it is determined in step S103 that the pixel (j, k) is not X, in step S105, the G interpolation processing unit 331-1 or E interpolation processing unit 331-2 determines the color of the pixel (j-1, k). Whether X is X or not.
ステップS105において画素(j−1,k)の色がXであると判定された場合、ステップS106において、G補間処理部331−1またはE補間処理部331−2は、画素(j,k)の補間値XAを画素(j−1,k)の色Xと(j+1,k)の色Xの平均値とする。すなわち、横に隣接する画素の色がXであると判定された場合、左右から補間が行われる。 If it is determined in step S105 that the color of the pixel (j-1, k) is X, in step S106, the G interpolation processing unit 331-1 or E interpolation processing unit 331-2 determines that the pixel (j, k) Is an average value of the color X of the pixel (j−1, k) and the color X of (j + 1, k). That is, when it is determined that the color of the horizontally adjacent pixel is X, interpolation is performed from the left and right.
ステップS105において画素(j−1,k)の色がXでないと判定された場合、ステップS107においてG補間処理部331−1またはE補間処理部331−2は、画素(j,k−1)の色がXであるか否かを判定し、画素(j,k−1)の色がXであると判定された場合、ステップS108において画素(j,k)の補間値XAを画素(j,k−1)の色と画素(j,k+1)の色の平均とする。すなわち、縦に隣接する画素がXであると判定された場合、上下補間が行われる。 If it is determined in step S105 that the color of the pixel (j-1, k) is not X, the G interpolation processing unit 331-1 or E interpolation processing unit 331-2 in step S107 determines that the pixel (j, k-1) If the color of the pixel (j, k−1) is determined to be X, the interpolated value XA of the pixel (j, k) is obtained from the pixel (j) in step S108. , K−1) and the average of the color of the pixel (j, k + 1). That is, when it is determined that the vertically adjacent pixel is X, vertical interpolation is performed.
ステップS107において画素(j,k−1)の色がXでないと判定された場合、ステップS109において、G補間処理部331−1またはE補間処理部331−2は、画素(j,k)の補間値XAを、画素(j−1,k−1)の色、画素(j+1,k−1)の色、画素(j−1,k+1)の色、画素(j+1,k+1)の色の平均とする。すなわち、画素(j,k)、画素(j−1,k)および画素(j,k−1)がXでないと判定された場合、左上、右上、左下、右下から補間が行われる。 If it is determined in step S107 that the color of the pixel (j, k-1) is not X, in step S109, the G interpolation processing unit 331-1 or E interpolation processing unit 331-2 determines the pixel (j, k). Interpolation value XA is the average of the color of pixel (j-1, k-1), the color of pixel (j + 1, k-1), the color of pixel (j-1, k + 1), and the color of pixel (j + 1, k + 1). And That is, when it is determined that the pixel (j, k), the pixel (j-1, k), and the pixel (j, k-1) are not X, interpolation is performed from the upper left, upper right, lower left, and lower right.
ステップS104、ステップS106、ステップS108、またはステップS109の処理の後、ステップS110において、G補間処理部331−1またはE補間処理部331−2は、第2のレジスタの値kを参照し、k=n−1であるか否かを判定する。ステップS110においてk=n−1でないと判定された場合、ステップS111において、G補間処理部331−1またはE補間処理部331−2は、第2のレジスタの値kをk=k+1に更新して、処理はステップS103に戻り、それ以降の処理が繰り返される。 After step S104, step S106, step S108, or step S109, in step S110, the G interpolation processing unit 331-1 or E interpolation processing unit 331-2 refers to the value k of the second register, and k It is determined whether or not n−1. When it is determined in step S110 that k = n−1 is not satisfied, in step S111, the G interpolation processing unit 331-1 or the E interpolation processing unit 331-2 updates the value k of the second register to k = k + 1. Then, the process returns to step S103, and the subsequent processes are repeated.
ステップS110においてk=n−1であると判定された場合、ステップS112において、G補間処理部331−1またはE補間処理部331−2は、処理を実行する画素位置を示す第1のレジスタの値jを参照し、j=n−1であるか否かを判定する。ステップS112においてj=n−1ではないと判定された場合、ステップS113においてG補間処理部331−1またはE補間処理部331−2は、第1のレジスタの値jをj=j+1に更新して、処理はステップS102に戻り、それ以降の処理が繰り返される。
When it is determined in step S110 that k = n−1, in step S112, the G interpolation processing unit 331-1 or the E interpolation processing unit 331-2 stores the first register indicating the pixel position to be processed. With reference to the value j, it is determined whether j = n−1. When it is determined in step S112 that j = n−1 is not satisfied, in step S113, the G interpolation processing unit 331-1 or the E interpolation processing unit 331-2 updates the value j of the first register to j =
ステップS112においてj=n−1であると判定された場合、ステップS114においてG補間処理部331−1またはE補間処理部331−2は、(2n−1)×(2n−1)画素のXの補間値XAの組を出力し、処理は図9のステップS52またはステップS53に進む。 When it is determined in step S112 that j = n−1, in step S114, the G interpolation processing unit 331-1 or the E interpolation processing unit 331-2 determines (2n−1) × (2n−1) pixel X. The set of interpolation values XA is output, and the process proceeds to step S52 or step S53 in FIG.
図10および図11の処理をまとめると、G補間処理部331−1またはE補間処理部331−2は、処理画素位置またはその近傍画素位置の色を判定し、それぞれ場合分けを行って線形補間によりXの補間値XAを算出している。すなわち、図10および図11の処理により、X(GまたはE)の補間値XAを算出することができる。換言すると、図10および図11の処理によりGの補間値GAおよびEの補間値EAが算出される。 10 and FIG. 11 are summarized, the G interpolation processing unit 331-1 or the E interpolation processing unit 331-2 determines the color of the processing pixel position or its neighboring pixel position, and performs linear interpolation by dividing each case. Thus, an interpolation value XA of X is calculated. That is, the interpolation value XA of X (G or E) can be calculated by the processing of FIGS. In other words, the G interpolation value GA and the E interpolation value EA are calculated by the processes of FIGS.
次に、図12のフローチャートを参照して、図9のステップS53において実行される補正テクスチャ強度算出処理を説明する。なお、この処理は図6のテクスチャ強度算出処理部334により実行される処理である。
Next, the corrected texture intensity calculation process executed in step S53 of FIG. 9 will be described with reference to the flowchart of FIG. This process is a process executed by the texture intensity
ステップS151においてテクスチャ強度算出処理部334は、テクスチャ強度TH,TV算出処理を実行する。この処理の詳細は、図13を参照して後述する。
Texture intensity
ステップS152においてテクスチャ強度算出処理部334は、重み付き平均値MTH算出処理を実行する。この処理の詳細は、図14を参照して後述する。
In step S152, the texture intensity
ステップS153においてテクスチャ強度算出処理部334は、重み付き平均偏差STH算出処理を実行する。この処理の詳細は、図16を参照して後述する。
In step S153, the texture intensity
ステップS154においてテクスチャ強度算出処理部334は、テクスチャ強度TH,TV補正処理を実行する。この処理の詳細は、図17を参照して後述する。その後、処理は図9のステップS54に進む。
Texture intensity
図12の処理により、補正されたテクスチャ強度TH,TVが算出される。 The corrected texture strengths T H and T V are calculated by the process of FIG.
次に、図13のフローチャートを参照して、図12のステップS151において実行されるテクスチャ強度TH,TV算出処理の詳細を説明する。なおこの処理は、注目画素位置およびその上下左右の計5箇所のGA,EAを用いてテクスチャ強度TH,TVを算出する処理である。なお、n’は、正の整数である。 Next, details of the texture intensity T H and T V calculation processing executed in step S151 of FIG. 12 will be described with reference to the flowchart of FIG. This process is a process for calculating the texture intensities T H and T V using the target pixel position and the total of GA and EA at five locations, that is, the top, bottom, left and right. Note that n ′ is a positive integer.
ステップS201において、テクスチャ強度算出処理部334は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’を初期化してj’=−n’とし、ステップS202において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’を初期化してk’=−n’とする。なお、(j’,k’)は局所領域における中心(注目画素位置)を(0,0)とした場合の、処理を実行する画素位置を示す。
In step S201, the texture intensity
ステップS203において、テクスチャ強度算出処理部334は、式(1)を用いて横勾配評価値dHを算出するとともに、式(2)を用いて縦勾配評価値dVを算出する。すなわち、テクスチャ強度算出処理部334は、各画素位置でGA+EAを計算し、注目画素位置とその左右の間で減算を行って得られた横方向のグラディエント値の絶対値の和を横勾配評価値dHとして算出するとともに、注目画素位置とその上下の間で減算を行って得られた縦方向のグラディエント値の絶対値の和を縦勾配評価値dVとして算出する。
In step S203, the texture intensity
dH=|GA(j'−1,k')+EA(j'−1,k')−(GA(j',k')+EA(j',k'))|+|GA(j'+1,k')+EA(j'+1,k')−(GA(j',k')+EA(j',k'))| ・・・(1)
dV=|GA(j',k'−1)+EA(j',k'−1)−(GA(j',k')+EA(j',k'))|+|GA(j',k'+1)+EA(j',k'+1)−(GA(j',k')+EA(j',k'))| ・・・(2)
dH = | GA (j′−1, k ′) + EA (j′−1, k ′) − (GA (j ′, k ′) + EA (j ′, k ′)) | + | GA (j ′ + 1 , K ′) + EA (j ′ + 1, k ′) − (GA (j ′, k ′) + EA (j ′, k ′)) | (1)
dV = | GA (j ′, k′−1) + EA (j ′, k′−1) − (GA (j ′, k ′) + EA (j ′, k ′)) | + | GA (j ′, k ′ + 1) + EA (j ′, k ′ + 1) − (GA (j ′, k ′) + EA (j ′, k ′)) |
ステップS204においてテクスチャ強度算出処理部334は、横勾配評価値dH>縦勾配評価値dVであるか否かを判定し、dH>dVであると判定された場合、ステップS205においてテクスチャ強度算出処理部334は、画素(j’,k’)のテクスチャ強度THを0とし、画素(j’,k’)のテクスチャ強度TVを1とする。
In step S204, the texture strength
ステップS204においてdH>dVでないと判定された場合、ステップS206においてテクスチャ強度算出処理部334は、画素(j’,k’)のテクスチャ強度THを1とし、画素(j’,k’)のテクスチャ強度TVを0とする。
If it is determined not dH> dV in step S204, the texture-intensity-
ステップS205またはステップS206の処理の後、処理はステップS207に進み、テクスチャ強度算出処理部334は、第2のレジスタの値k’を参照し、k’=n’であるか否かを判定する。ステップS207においてk’=n’でないと判定された場合、ステップS208において、テクスチャ強度算出処理部334は、第2のレジスタの値k’をk’=k’+1に更新して、処理はステップS203に戻り、それ以降の処理が繰り返される。
After the process of step S205 or step S206, the process proceeds to step S207, and the texture intensity
ステップS207において、k’=n’であると判定された場合、ステップS209において、テクスチャ強度算出処理部334は、処理を実行する画素位置を示す第1のレジスタの値j’を参照し、j’=n’であるか否かを判定する。ステップS209においてj’=n’ではないと判定された場合、ステップS210においてテクスチャ強度算出処理部334は、第1のレジスタの値j’をj’=j’+1に更新して、処理はステップS202に戻り、それ以降の処理が繰り返される。
When it is determined in step S207 that k ′ = n ′, in step S209, the texture intensity
ステップS209において、j’=n’であると判定された場合、ステップS211においてテクスチャ強度算出処理部334は、(2n’+1)×(2n’+1)画素のテクスチャ強度TH,TVの組を出力し、処理は図12のステップS152に進む。
If it is determined in step S209 that j ′ = n ′, the texture intensity
図13の処理により、処理画素位置およびその上下左右の計5箇所のGA,EAを用いてテクスチャ強度が算出される。 With the processing in FIG. 13, the texture intensity is calculated using the processing pixel position and the GA, EA in a total of five locations above, below, left, and right.
次に、図14のフローチャートを参照して、図12のステップS152において実行される重み付き平均値MTH算出処理の詳細を説明する。なお、この処理は、図6のテクスチャ強度算出処理部334により実行される処理である。
Next, details of the weighted average value M TH calculation process executed in step S152 of FIG. 12 will be described with reference to the flowchart of FIG. This process is a process executed by the texture intensity
ステップS251において、テクスチャ強度算出処理部334は、重み付き平均値MTHを0に初期化する。
In step S251, the texture intensity
ステップS252において、テクスチャ強度算出処理部334は、テクスチャ強度THを取得する。このテクスチャ強度THは、上述した図13の処理により算出された値である。
In step S252, the texture-intensity-
ステップS253において、テクスチャ強度算出処理部334は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’を初期化してj’=−n’とし、ステップS254において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’を初期化してk’=−n’とする。
In step S253, the texture intensity
ステップS255において、テクスチャ強度算出処理部334は、MTH=MTH+(重み係数wiが施された画素(j',k')のテクスチャ強度TH)とする。すなわち、MTHに重み付けが施された画素(j',k')のテクスチャ強度THを加算したものが新たなMTHとされる。
In step S255, the texture intensity
この重み係数wiは、i番目のデータの位置から注目画素への距離などを指標として予め設定されている値である。例えば、7×7の局所領域に対しては図15に示されるように設定することができる。図中四角形は局所領域の画素位置を示し、四角形中の数字が該当する位置のデータの重み係数を示す。これらの重み係数は、図15に示されるものに限定されないことはいうまでもないが、図15に示されるように、注目画素に近い程重み係数が大きくなるようにした方が好適である。 The weighting factor wi is a value set in advance using the distance from the position of the i-th data to the target pixel as an index. For example, a 7 × 7 local region can be set as shown in FIG. In the figure, the square indicates the pixel position of the local area, and the number in the square indicates the weighting coefficient of the data at the corresponding position. Needless to say, these weighting factors are not limited to those shown in FIG. 15, but as shown in FIG. 15, it is preferable that the weighting factors become larger as the pixel is closer to the target pixel.
ステップS256において、テクスチャ強度算出処理部334は、第2のレジスタの値k’を参照し、k’=n’であるか否かを判定する。ステップS256において、k’=n’でないと判定された場合、ステップS257において、テクスチャ強度算出処理部334は、第2のレジスタの値k’をk’=k’+1に更新して、処理はステップS255に戻り、それ以降の処理が繰り返される。
In step S256, the texture intensity
ステップS256において、k’=n’であると判定された場合、ステップS258において、テクスチャ強度算出処理部334は、処理を実行する画素位置を示す第1のレジスタの値j’を参照し、j’=n’であるか否かを判定する。ステップS258においてj’=n’ではないと判定された場合、ステップS259においてテクスチャ強度算出処理部334は、第1のレジスタの値j’をj’=j’+1に更新して、処理はステップS254に戻り、それ以降の処理が繰り返される。
If it is determined in step S256 that k ′ = n ′, in step S258, the texture intensity
ステップS258において、j’=n’であると判定された場合、ステップS260において、テクスチャ強度算出処理部334は、MTH=MTH/Wとする。このWは、重み係数wiの総和Wとされる。
If it is determined in step S258 that j ′ = n ′, the texture intensity
ステップS261においてテクスチャ強度算出処理部334は、テクスチャ強度THの重み付き平均値MTHを出力し、処理は図12のステップS153に進む。
In step S261, the texture intensity
図14の処理により、テクスチャ強度THの重み付き平均値MTHが算出される。 The weighted average value M TH of the texture intensity T H is calculated by the process of FIG.
次に、図16のフローチャートを参照して、図12のステップS153において実行される重み付き平均偏差STH算出処理の詳細を説明する。なお、この処理は、図6のテクスチャ強度算出処理部334により実行される処理である。
Next, details of the weighted average deviation S TH calculation processing executed in step S153 of FIG. 12 will be described with reference to the flowchart of FIG. This process is a process executed by the texture intensity
ステップS301において、テクスチャ強度算出処理部334は、重み付き平均偏差STHを0に初期化する。
In step S301, the texture intensity
ステップS302において、テクスチャ強度算出処理部334は、テクスチャ強度THを取得する。このテクスチャ強度THは、上述した図13の処理により算出された値である。
In step S302, the texture-intensity-
ステップS303において、テクスチャ強度算出処理部334は、重み付き平均値MTHを取得する。この重み付き平均値MTHは、上述した図14の処理により算出された値である。
In step S303, the texture intensity
ステップS304において、テクスチャ強度算出処理部334は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’を初期化してj’=−n’とし、ステップS305において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’を初期化してk’=−n’とする。
In step S304, the texture intensity
ステップS306において、テクスチャ強度算出処理部334は、STH=STH+重み係数wiが施された|(画素(j',k')のテクスチャ強度TH)−(MTH)|とする。すなわち、画素(j’,k’)のテクスチャ強度THから重み付き平均MTHを減算した値の絶対値を取って重み付けした値に、STHを加算したものが新たなSTHとされる。このテクスチャ強度THは、上述した図13の処理で算出されたものである。この重み係数wiは、上述した図14における重み係数wiと同様である。
In step S306, the texture intensity
ステップS307において、テクスチャ強度算出処理部334は、第2のレジスタの値k’を参照し、k’=n’であるか否かを判定する。ステップS307において、k’=n’でないと判定された場合、ステップS308において、テクスチャ強度算出処理部334は、第2のレジスタの値k’をk’=k’+1に更新して、処理はステップS306に戻り、それ以降の処理が繰り返される。
In step S307, the texture intensity
ステップS307において、k’=n’であると判定された場合、ステップS309において、テクスチャ強度算出処理部334は、処理を実行する画素位置を示す第1のレジスタの値j’を参照し、j’=n’であるか否かを判定する。ステップS309においてj’=n’ではないと判定された場合、ステップS310においてテクスチャ強度算出処理部334は、第1のレジスタの値j’をj’=j’+1に更新して、処理はステップS305に戻り、それ以降の処理が繰り返される。
If it is determined in step S307 that k ′ = n ′, in step S309, the texture intensity
ステップS309において、j’=n’であると判定された場合、ステップS311において、テクスチャ強度算出処理部334は、STH=STH/Wとする。このWは、上述した図14の処理と同様に、重み係数wiの総和Wとされる。
If it is determined in step S309 that j ′ = n ′, in step S311, the texture intensity
ステップS312においてテクスチャ強度算出処理部334は、重み付き平均偏差STHを出力し、処理は図12のステップS154に進む。
In step S312, the texture intensity
図16の処理により、テクスチャ強度THの重み付き平均偏差STHが算出される。 The weighted average deviation S TH of the texture intensity T H is calculated by the process of FIG.
次に、図17のフローチャートを参照して、図12のステップS154において実行されるテクスチャ強度TH,TV補正処理の詳細を説明する。なお、この処理は、図6のテクスチャ強度算出処理部334により実行される処理である。
Next, details of the texture intensity T H and T V correction processing executed in step S154 of FIG. 12 will be described with reference to the flowchart of FIG. This process is a process executed by the texture intensity
ステップS351において、テクスチャ強度算出処理部334は、重み付き平均偏差STHを取得する。この重み付き平均偏差STHは上述した図16の処理で算出されたものである。
In step S351, the texture intensity
ステップS352において、テクスチャ強度算出処理部334は、RをSTH×(第1の定数)として算出する。この第1の定数は、例えば、経験的にまたは実験的に定められる所定の値である。
In step S352, the texture intensity
ステップS353において、テクスチャ強度算出処理部334は、R>1であるか否かを判定し、R>1であると判定された場合、ステップS354においてR=1と設定する。
In step S353, the texture intensity
ステップS353においてR>1でない、すなわちR≦1であると判定された場合、ステップS354の処理はスキップされる。 If it is determined in step S353 that R> 1 is not satisfied, that is, R ≦ 1, the process of step S354 is skipped.
ステップS353においてR>1でないと判定された場合、またはステップS354の処理の後、ステップS355において、テクスチャ強度算出処理部334は、TH=TH×(1−R)+R/2とし、TV=TV×(1−R)+R/2とする。すなわち、テクスチャ強度TH,TVが補正される。その後、図12のステップS154の処理が終了され、処理は図9のステップS54に進む。
When it is determined in step S353 that R> 1 is not satisfied, or after the processing in step S354, in step S355, the texture intensity
図17の処理により、重み付き平均偏差STHに基づいて、テクスチャ強度TH,TVの値が補正される。 By the processing of FIG. 17, the values of the texture strengths T H and T V are corrected based on the weighted average deviation S TH .
次に、図9のステップS54およびステップS55において実行される第2のG補間処理および第2のE補間処理について説明する。図6のG補間処理部332−1とE補間処理部332−2の違いは、処理に用いる近傍画素の違いであり、重み付けによって、縦方向および横方向のうち、どちらの近傍画素を用いるのかを切り換えることができる。例えば、図18の重みを用いれば、縦方向のサンプルを用いることになり、図19の重みを用いれば、横方向のサンプルを用いることになる。本実施の形態では、G補間処理部332−1に横方向のサンプルを用い、E補間処理部332−2に縦方向のサンプルを用いる。注意すべき点はテクスチャの方向が縦方向であるからといって、必ずしも推定に縦近傍画素が用いられるとは限らないという点である。例えば、本実施の形態で用いている局所領域の色分布に対して線形回帰を適用し、不明な色成分の推定を行う手法では、回帰直線の算出に適した色分布を得るためには、テクスチャ方向に対して垂直な方向の近傍画素を用いた方が良い推定結果を得られる場合がある。どのような推定方法を用いるにしても、推定に用いる近傍画素の違いによって、横方向のテクスチャに対して信頼度の高い推定値と、縦方向のテクスチャに対して信頼度の高い推定値の2つの推定値が得られればよい。以下において、X,dirと記述されている部分については、G補間処理部332−1の処理ではGとHに読み替え、E補間処理部332−2の処理ではEとVに適宜読み替える。方向を表すために付けられたH,Vは補間処理に用いられる近傍画素の方向を表す。 Next, the second G interpolation process and the second E interpolation process executed in steps S54 and S55 of FIG. 9 will be described. The difference between the G interpolation processing unit 332-1 and the E interpolation processing unit 332-2 in FIG. 6 is the difference between the neighboring pixels used in the processing. Which of the neighboring pixels is used in the vertical direction and the horizontal direction by weighting? Can be switched. For example, if the weight in FIG. 18 is used, a sample in the vertical direction is used, and if the weight in FIG. 19 is used, a sample in the horizontal direction is used. In the present embodiment, a sample in the horizontal direction is used for the G interpolation processing unit 332-1, and a sample in the vertical direction is used for the E interpolation processing unit 332-2. It should be noted that just because the texture direction is the vertical direction, vertical neighboring pixels are not always used for estimation. For example, by applying linear regression to the color distribution of the local region used in the present embodiment and estimating the unknown color component, in order to obtain a color distribution suitable for calculating the regression line, In some cases, better estimation results can be obtained by using neighboring pixels in a direction perpendicular to the texture direction. Regardless of which estimation method is used, the estimated value with high reliability for the texture in the horizontal direction and the estimated value with high reliability for the texture in the vertical direction are determined depending on the difference in the neighboring pixels used for the estimation. It is only necessary to obtain two estimated values. In the following description, the portions described as X and dir are read as G and H in the process of the G interpolation processing unit 332-1 and appropriately read as E and V in the process of the E interpolation processing unit 332-2. H and V attached to represent the direction represent the directions of neighboring pixels used for the interpolation process.
図20は、図9のステップS54またはステップS55において実行される第2の補間処理(第2のG補間処理または第2のE補間処理)を説明するフローチャートである。なお、GおよびEのいずれに対しても同様の処理が実行されるので、図20においてX,dirと記述されている部分については、適宜、GおよびH、並びにEおよびVに読み替えられる。具体的には、図20の処理がステップS54の処理に対応する処理の場合、G補間処理部332−1が実行する処理であるので、X,dirは、G,Hに読み替えられ、図20の処理がステップS55の処理に対応する処理の場合、E補間処理部332−2が実行する処理であるので、X,dirは、E,Vに読み替えられる。 FIG. 20 is a flowchart illustrating the second interpolation process (second G interpolation process or second E interpolation process) executed in step S54 or step S55 of FIG. Since the same processing is executed for both G and E, the portions described as X and dir in FIG. 20 are appropriately read as G and H, and E and V. Specifically, when the process in FIG. 20 corresponds to the process in step S54, the process is executed by the G interpolation processing unit 332-1. Therefore, X and dir are read as G and H, and FIG. In the case of the process corresponding to the process of step S55, X and dir are read as E and V because the process is executed by the E interpolation processing unit 332-2.
ステップS401において、G補間処理部332−1またはE補間処理部332−2は、Rの重み付き平均値MRdir算出処理を実行する。この処理の詳細は、図21を参照して後述する。 In step S401, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 executes an R weighted average value M Rdir calculation process. Details of this processing will be described later with reference to FIG.
ステップS402において、G補間処理部332−1またはE補間処理部332−2は、XAの重み付き平均値MXAdir算出処理を実行する。この処理の詳細は、図21を参照して後述する。 In step S402, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 executes the XA weighted average value M XAdir calculation processing. Details of this processing will be described later with reference to FIG.
ステップS403において、G補間処理部332−1またはE補間処理部332−2は、Rの重み付き分散近似値VARRdir算出処理を実行する。この処理の詳細は、図22を参照して後述する。 In step S403, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 performs an R weighted variance approximate value VA RRdir calculation process. Details of this processing will be described later with reference to FIG.
ステップS404において、G補間処理部332−1またはE補間処理部332−2は、R,XAの重み付き共分散近似値VARXAdir算出処理を実行する。この処理の詳細は、図23を参照して後述する。 In step S404, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 executes R, XA weighted covariance approximate value VA RXAdir calculation processing. Details of this processing will be described later with reference to FIG.
ステップS405において、G補間処理部332−1またはE補間処理部332−2は、回帰直線の傾きKdir算出処理を実行する。この処理の詳細は、図29を参照して後述する。 In step S405, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 executes a regression line inclination K dir calculation process. Details of this processing will be described later with reference to FIG.
ステップS406においてG補間処理部332−1またはE補間処理部332−2は、回帰直線によるXの推定値XF算出処理を実行する。この処理の詳細は、図30を参照して後述する。ステップS406の処理の後、処理は、図9のステップS56に進む。 In step S406, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 executes an X estimated value XF calculation process using a regression line. Details of this processing will be described later with reference to FIG. After the process of step S406, the process proceeds to step S56 of FIG.
次に、図21のフローチャートを参照して、図20のステップS401、またはステップS402において実行されるRの重み付き平均値MRdir算出処理、またはXAの重み付き平均値MXAdir算出処理の詳細を説明する。なお、RおよびXAのいずれに対しても同様の処理が実行されるので、図21においてYと記述されている部分については、適宜R,XAに読み替えられる。具体的には、図21の処理が図9のステップS54に対応する処理の場合、G補間処理部332−1が実行する処理であり、図21の処理が図9のステップS55に対応する処理の場合、E補間処理部332−2が実行する処理となる。なお、n’’は、正の偶数である。なお、(j’’,k’’)は局所領域における中心(注目画素位置)を(0,0)とした場合の、処理を実行する画素位置を示す。 Next, with reference to the flowchart of FIG. 21, the details of the R weighted average value M Rdir calculation processing or the XA weighted average value M XAdir calculation processing executed in step S401 or step S402 of FIG. explain. Since the same processing is executed for both R and XA, the portion described as Y in FIG. 21 is appropriately read as R and XA. Specifically, when the process in FIG. 21 is a process corresponding to step S54 in FIG. 9, the G interpolation processing unit 332-1 performs the process, and the process in FIG. 21 corresponds to step S55 in FIG. In this case, the process is executed by the E interpolation processing unit 332-2. Note that n ″ is a positive even number. Note that (j ″, k ″) indicates a pixel position where the process is executed when the center (target pixel position) in the local region is (0, 0).
ステップS451において、G補間処理部332−1またはE補間処理部332−2は、重み付き平均値MYdirを0に初期化する。 In step S451, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 initializes the weighted average value M Ydir to 0.
ステップS452において、G補間処理部332−1またはE補間処理部332−2は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’’を初期化してj’’=−n’’とし、ステップS453において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’’を初期化してk’’=−n’’とする。 In step S452, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 initially sets the value j ″ of the first register indicating the pixel position to be processed among the supplied pixels in the local region. J ″ = − n ″, and in step S453, among the supplied pixels in the local region, a value k ″ of the second register indicating the pixel position for executing the processing is initialized and k ″. = −n ″.
ステップS454において、G補間処理部332−1またはE補間処理部332−2は、MYdir=MYdir+(重み係数widirが施された画素(j'’,k'’)のY)とする。すなわち、MYdirに重み付けが施された画素(j’’,k’’)のYを加算したものが新たなMYdirとされる。 In step S454, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 determines that M Ydir = M Ydir + (Y of the pixel (j ″, k ″) to which the weight coefficient w i dir is applied). To do. That, M pixel weighting is applied to Ydir (j '', k ' ') obtained by adding the Y of is the new M YDIR.
ステップS455において、G補間処理部332−1またはE補間処理部332−2は、第2のレジスタの値k’’を参照し、k’’=n’’であるか否かを判定する。ステップS455において、k’’=n’’でないと判定された場合、ステップS456において、G補間処理部332−1またはE補間処理部332−2は、第2のレジスタの値k’’をk’’=k’’+2に更新して、処理はステップS454に戻り、それ以降の処理が繰り返される。 In step S455, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 refers to the value k ″ of the second register and determines whether k ″ = n ″. When it is determined in step S455 that k ″ = n ″ is not satisfied, in step S456, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets the value k ″ of the second register to k. After updating to “= k” +2, the processing returns to step S454, and the subsequent processing is repeated.
ステップS455において、k’’=n’’であると判定された場合、ステップS457において、G補間処理部332−1またはE補間処理部332−2は、処理を実行する画素位置を示す第1のレジスタの値j’’を参照し、j’’=n’’であるか否かを判定する。ステップS457においてj’’=n’’ではないと判定された場合、ステップS458においてG補間処理部332−1またはE補間処理部332−2は、第1のレジスタの値j’’をj’’=j’’+2に更新して、処理はステップS453に戻り、それ以降の処理が繰り返される。 If it is determined in step S455 that k ″ = n ″, in step S457, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 indicates the first pixel position indicating the pixel to be processed. Referring to the register value j ″, it is determined whether j ″ = n ″. When it is determined in step S457 that j ″ = n ″ is not satisfied, in step S458, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets the value j ″ of the first register to j ′. After updating to '= j' '+ 2, the process returns to step S453, and the subsequent processes are repeated.
ステップS457において、j’’=n’’であると判定された場合、ステップS459において、G補間処理部332−1またはE補間処理部332−2は、MYdir=MYdir/Wdirとする。このWdirは重み係数widirの総和Wdirとされる。 If it is determined in step S457 that j ″ = n ″, in step S459, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets M Ydir = M Ydir / W dir . . The W dir is the sum W dir weighting coefficients wi dir.
ステップS460において、G補間処理部332−1またはE補間処理部332−2は、重み付き平均値MYdirを出力し、処理は図20のステップS402またはステップS403に進む。 In step S460, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 outputs the weighted average value MYdir , and the process proceeds to step S402 or step S403 in FIG.
図21の処理により、注目画素近傍のR,XAの重み付き平均値が算出される。 By the processing in FIG. 21, the weighted average values of R and XA in the vicinity of the target pixel are calculated.
次に、図22のフローチャートを参照して、図20のステップS403において実行されるRの重み付き分散近似値VARRdir算出処理の詳細を説明する。なお、この処理は、図6のG補間処理部332−1またはE補間処理部332−2により実行される処理である。 Next, details of the R weighted variance approximate value VA RRdir calculation process executed in step S403 of FIG. 20 will be described with reference to the flowchart of FIG. This process is a process executed by the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 in FIG.
ステップS501において、G補間処理部332−1またはE補間処理部332−2は、重み付き分散近似値VARRdirを0に初期化する。 In step S501, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 initializes the weighted variance approximate value VA RRdir to 0.
ステップS502において、G補間処理部332−1またはE補間処理部332−2は、重み付き平均MRdirを取得する。この重み付き平均MRdirは、上述した図21の処理(図20のステップS401の処理)により算出された値である。 In step S502, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 acquires the weighted average M Rdir . This weighted average M Rdir is a value calculated by the above-described processing in FIG. 21 (processing in step S401 in FIG. 20).
ステップS503において、G補間処理部332−1またはE補間処理部332−2は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’’を初期化してj’’=−n’’とし、ステップS504において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’’を初期化してk’’=−n’’とする。 In step S503, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 initially sets the value j ″ of the first register indicating the pixel position to be processed among the supplied local region pixels. J ″ = − n ″, and in step S504, the value k ″ of the second register indicating the pixel position for executing the processing is initialized among the supplied pixels in the local region, and k ″. = −n ″.
ステップS505において、G補間処理部332−1またはE補間処理部332−2は、VARRdir=VARRdir+重み係数widirが施された|(画素(j'’,k'’)のR)−(MRdir)|とする。すなわち、画素(j’’,k’’)のRからRの重み付き平均値MRdirを減算した値の絶対値を取って重み付けした値に、VARRdirを加算したものが新たなVARRdirとされる。 In step S505, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 is subjected to VA RRdir = VA RRdir + weighting coefficient w i dir | (R of pixel (j ″, k ″)) − (M Rdir ) | That is, a value obtained by adding the VA RRdir to the weighted value obtained by subtracting the R weighted average value M Rdir from the R of the pixel (j ″, k ″) is a new VA RRdir . Is done.
ステップS506において、G補間処理部332−1またはE補間処理部332−2は、第2のレジスタの値k’’を参照し、k’’=n’’であるか否かを判定する。ステップS506において、k’’=n’’でないと判定された場合、ステップS507において、G補間処理部332−1またはE補間処理部332−2は、第2のレジスタの値k’’をk’’=k’’+2に更新して、処理はステップS505に戻り、それ以降の処理が繰り返される。 In step S506, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 refers to the value k ″ of the second register and determines whether k ″ = n ″. When it is determined in step S506 that k ″ = n ″ is not satisfied, in step S507, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets the value k ″ of the second register to k. After updating to "= k" +2, the process returns to step S505, and the subsequent processes are repeated.
ステップS506において、k’’=n’’であると判定された場合、ステップS508において、G補間処理部332−1またはE補間処理部332−2は、処理を実行する画素位置を示す第1のレジスタの値j’’を参照し、j’’=n’’であるか否かを判定する。ステップS508においてj’’=n’’ではないと判定された場合、ステップS509において、G補間処理部332−1またはE補間処理部332−2は、第1のレジスタの値j’’をj’’=j’’+2に更新して、処理はステップS504に戻り、それ以降の処理が繰り返される。 When it is determined in step S506 that k ″ = n ″, in step S508, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 indicates the first pixel position indicating the pixel position to be processed. Referring to the register value j ″, it is determined whether j ″ = n ″. When it is determined in step S508 that j ″ = n ″ is not satisfied, in step S509, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets the value j ″ of the first register to j. After updating to “= j” +2, the process returns to step S504, and the subsequent processes are repeated.
ステップS508において、j’’=n’’であると判定された場合、ステップS510において、G補間処理部332−1またはE補間処理部332−2は、VARRdir=VARRdir/Wdirとする。このWdirは、重み係数widirの総和Wdirとされる。 When it is determined in step S508 that j ″ = n ″, in step S510, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets VA RRdir = VA RRdir / W dir . . The W dir is the sum W dir weighting coefficients wi dir.
ステップS511において、G補間処理部332−1またはE補間処理部332−2は、Rの重み付き分散近似値VARRdirを出力し、処理は図20のステップS404に進む。 In step S511, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 outputs the R weighted variance approximate value VA RRdir , and the process proceeds to step S404 in FIG.
図22の処理により、Rの重み付き分散近似値VARRdirが算出される。 The R weighted variance approximate value VA RRdir is calculated by the process of FIG.
次に、図23のフローチャートを参照して、図20のステップS404において実行される、R,XAの重み付き共分散近似計算処理について説明する。 Next, the R and XA weighted covariance approximation calculation processing executed in step S404 in FIG. 20 will be described with reference to the flowchart in FIG.
ステップS521において、G補間処理部332−1またはE補間処理部332−2は、出力される値であるR,XAの重み付き共分散値VAXAdirを0に初期化する。 In step S521, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 initializes the R, XA weighted covariance value VA XAdir that is the output value to 0.
ステップS522において、G補間処理部332−1またはE補間処理部332−2は、重み付き平均MRdirおよび重み付き平均MXAdirを取得する。重み付き平均MRdirは、図20のステップS401の処理(図21の処理)で算出された値であり、重み付き平均MXAdirは、図20のステップS402の処理(図21の処理)で算出された値である。 In step S522, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 acquires the weighted average M Rdir and the weighted average M XAdir . The weighted average M Rdir is a value calculated by the process of step S401 in FIG. 20 (process of FIG. 21), and the weighted average M XAdir is calculated by the process of step S402 of FIG. 20 (process of FIG. 21). Value.
ステップS523において、G補間処理部332−1またはE補間処理部332−2は、処理を実行する画素位置を示す第1のレジスタの値j’’を初期化して、j’’=−n’’とする In step S523, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 initializes the value j ″ of the first register indicating the pixel position to be processed, and j ″ = − n ′. 'And
ステップS524において、G補間処理部332−1またはE補間処理部332−2は、処理を実行する画素位置を示す第2のレジスタの値k’’を初期化して、k’’=−n’’とする In step S524, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 initializes the value k ″ of the second register indicating the pixel position to be processed, and k ″ = − n ′. 'And
ステップS525において、G補間処理部332−1またはE補間処理部332−2は、図27を用いて後述する積算処理を実行する。 In step S525, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 performs an integration process which will be described later with reference to FIG.
ステップS526において、G補間処理部332−1またはE補間処理部332−2は、処理を実行する画素位置を示す第2のレジスタの値k’’を参照し、k’’=n’’であるか否かを判断する。 In step S526, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 refers to the value k ″ of the second register indicating the pixel position to be processed, and k ″ = n ″. Judge whether there is.
ステップS526において、k’’=n’’ではないと判断された場合、ステップS527において、G補間処理部332−1またはE補間処理部332−2は、第2のレジスタの値k’’を、k’’=k’’+2に更新して、処理は、ステップS525に戻り、それ以降の処理が繰り返される。 When it is determined in step S526 that k ″ = n ″ is not satisfied, in step S527, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets the value k ″ of the second register. , K ″ = k ″ +2, and the process returns to step S525, and the subsequent processes are repeated.
ステップS526において、k’’=n’’であると判断された場合、ステップS528において、G補間処理部332−1またはE補間処理部332−2は、処理を実行する画素位置を示す第1のレジスタの値j’’を参照し、j’’=n’’であるか否かを判断する。 If it is determined in step S526 that k ″ = n ″, in step S528, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 indicates the first pixel position indicating the pixel position to be processed. Referring to the register value j ″, it is determined whether or not j ″ = n ″.
ステップS528において、j’’=n’’ではないと判断された場合、ステップS529において、G補間処理部332−1またはE補間処理部332−2は、第1のレジスタの値j’’を、j’’=j’’+2に更新して、処理は、ステップS524に戻り、それ以降の処理が繰り返される。 If it is determined in step S528 that j ″ = n ″ is not satisfied, in step S529, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets the value j ″ of the first register. , J ″ = j ″ +2, and the process returns to step S524, and the subsequent processes are repeated.
ステップS528において、j’’=n’’であると判断された場合、ステップS530において、G補間処理部332−1またはE補間処理部332−2は、VARXAdir=VARXAdir/Wdirとし、これをR,XAの重み付き共分散近似値VARRdirとして出力して、処理は図20のステップS405に進む。 If it is determined in step S528 that j ″ = n ″, in step S530, the G interpolation processing unit 332-1 or E interpolation processing unit 332-2 sets VA RXAdir = VA RXAdir / W dir , This is output as a weighted covariance approximate value VA RRdir of R and XA, and the process proceeds to step S405 in FIG.
従来の方法により回帰直線の傾きを算出する場合、以下の式(3)に示されるような演算を行う必要がある。 When calculating the slope of the regression line by a conventional method, it is necessary to perform an operation as shown in the following equation (3).
しかしながら、式(3)を用いて演算を実行した場合、乗算の回数がデータの個数Nに比例して増大する点が問題となる。そこで、この乗算を簡単な演算で近似することを考える。簡単のためデータXiおよびデータYiが、区間[0,1]に正規化されているとすると、0≦Mx,My≦1が成立するとともに、−1<Xi−Mx,Yi−My<1が成立する。そこで、−1<p,q<1となる2変数p=Xi−Mxおよびq=Yi−Myの乗算pqを考えると、pqは、図24に示される値域をとる。このp、qの符号と絶対値に基づいて、近似した値を得る方法として、条件演算、絶対値演算、および、加減算のみの演算で実現可能な近似方法の一例を説明する。 However, when the calculation is performed using Expression (3), the problem is that the number of multiplications increases in proportion to the number N of data. Therefore, consider approximating this multiplication with a simple operation. If the data Xi and the data Yi are normalized to the interval [0, 1] for simplicity, 0 ≦ Mx and My ≦ 1 are satisfied, and −1 <Xi−Mx and Yi−My <1 are satisfied. To establish. Therefore, considering a multiplication pq of two variables p = Xi−Mx and q = Yi−My satisfying −1 <p, q <1, pq takes a range shown in FIG. As an example of a method for obtaining an approximate value based on the signs and absolute values of p and q, an example of an approximation method that can be realized by conditional calculation, absolute value calculation, and calculation only by addition / subtraction will be described.
すなわち、
|p|≧|q|かつp≧0のとき、pqをqで近似し、
|p|≧|q|かつp<0のとき、pqを−qで近似し、
|p|<|q|かつq≧0のとき、pqをpで近似し、
|p|<|q|かつq<0のとき、pqを−pで近似する
ことにより、演算を簡略化することができる。
That is,
When | p | ≧ | q | and p ≧ 0, pq is approximated by q,
When | p | ≧ | q | and p <0, approximate pq by −q,
When | p | <| q | and q ≧ 0, pq is approximated by p,
When | p | <| q | and q <0, the calculation can be simplified by approximating pq by −p.
また、この近似方法においては、p=qの場合、pの2乗(またはqの2乗)は、p(またはq)の絶対値に近似される。 In this approximation method, when p = q, the square of p (or the square of q) is approximated to the absolute value of p (or q).
この近似方法を用いて近似されたpqを図25に示し、近似演算による2乗誤差を図26に示す。図24を用いて説明したpqの値のとりうる範囲と、図25に示される近似方法を用いて近似されたpqの値のとりうる範囲は、大きな違いがないことが分かる。図26に示される近似演算による2乗誤差からも、違いがわずかなものであることが分かる。 FIG. 25 shows pq approximated using this approximation method, and FIG. 26 shows the square error due to the approximation calculation. It can be seen that there is no significant difference between the possible range of the pq value described with reference to FIG. 24 and the possible range of the pq value approximated using the approximation method shown in FIG. It can be seen from the square error by the approximation calculation shown in FIG. 26 that the difference is slight.
次に、図27のフローチャートを参照して、図23のステップS525において実行される積算処理について説明する。積算処理は、色成分の値が[0,1]に正規化されているものとして、上述した積の近似方法を用いて、近似された共分散値が算出される場合に実行される処理である。 Next, the integration process executed in step S525 of FIG. 23 will be described with reference to the flowchart of FIG. The integration process is a process executed when an approximate covariance value is calculated using the product approximation method described above, assuming that the value of the color component is normalized to [0, 1]. is there.
ステップS551において、G補間処理部332−1またはE補間処理部332−2は、{R(j’’,k’’)−MRdir}をpとする。 In step S551, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets {R (j ″, k ″) − M Rdir } to p.
ステップS552において、G補間処理部332−1またはE補間処理部332−2は、{XA(j’’,k’’)−MXAdir}をqとする。 In step S552, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets {XA (j ″, k ″) − M XAdir } to q.
ステップS553において、図28を参照して後述する積算近似処理が実行される。 In step S553, an integration approximation process described later with reference to FIG. 28 is executed.
ステップS554において、G補間処理部332−1またはE補間処理部332−2は、VAXAdir=VAXAdir+重み係数widirが施された(pqの近似値)とし、処理は、図23のステップS526に進む。 In step S554, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 performs VA XAdir = VA XAdir + weighting coefficient w i dir (approximate value of pq). The process proceeds to S526.
次に、図28のフローチャートを参照して、図27のステップ553において実行される積算近似処理について説明する。 Next, the integration approximation process executed in step 553 in FIG. 27 will be described with reference to the flowchart in FIG.
ステップS601において、G補間処理部332−1またはE補間処理部332−2は、図27のステップS551およびステップS552において置き換えられた値pおよびqを用いて、|p|≧|q|であるか否かを判断する。 In step S601, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 satisfies | p | ≧ | q | using the values p and q replaced in step S551 and step S552 in FIG. Determine whether or not.
ステップS601において、|p|≧|q|であると判断された場合、ステップS602において、G補間処理部332−1またはE補間処理部332−2は、p≧0であるか否かを判断する。 When it is determined in step S601 that | p | ≧ | q |, in step S602, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 determines whether p ≧ 0. To do.
ステップS602において、p≧0ではないと判断された場合、ステップS603において、G補間処理部332−1またはE補間処理部332−2は、pqの近似値を−qとし、処理は、図27のステップS554に進む。 When it is determined in step S602 that p ≧ 0 is not satisfied, in step S603, the G interpolation processing unit 332-1 or E interpolation processing unit 332-2 sets the approximate value of pq to −q, and the processing is as shown in FIG. The process proceeds to step S554.
ステップS602において、p≧0であると判断された場合、ステップS604において、G補間処理部332−1またはE補間処理部332−2は、pqの近似値を+qとし、処理は図27のステップS554に進む。 If it is determined in step S602 that p ≧ 0, in step S604, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets the approximate value of pq to + q, and the processing is the step of FIG. The process proceeds to S554.
ステップS601において、|p|≧|q|ではないと判断された場合、ステップS605において、G補間処理部332−1またはE補間処理部332−2は、q≧0であるか否かを判断する。 If it is determined in step S601 that | p | ≧ | q | is not satisfied, in step S605, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 determines whether q ≧ 0. To do.
ステップS605において、q≧0であると判断された場合、ステップS606において、G補間処理部332−1またはE補間処理部332−2は、pqの近似値を+pとし、処理は、図27のステップS554に進む。 When it is determined in step S605 that q ≧ 0, in step S606, the G interpolation processing unit 332-1 or E interpolation processing unit 332-2 sets the approximate value of pq to + p, and the process is as shown in FIG. Proceed to step S554.
ステップS605において、q≧0ではないと判断された場合、ステップS607において、G補間処理部332−1またはE補間処理部332−2は、pqの近似値を−pとし、処理は、図27のステップS554に進む。 When it is determined in step S605 that q ≧ 0 is not satisfied, in step S607, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 sets the approximate value of pq to −p, and the processing is as shown in FIG. The process proceeds to step S554.
次に、図29のフローチャートを参照して、図20のステップS405において実行される回帰直線の傾きKdir算出処理の詳細を説明する。なお、この処理は、図6のG補間処理部332−1またはE補間処理部332−2により実行される処理である。 Next, details of the regression line inclination K dir calculation processing executed in step S405 of FIG. 20 will be described with reference to the flowchart of FIG. This process is a process executed by the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 in FIG.
ステップS651において、G補間処理部332−1またはE補間処理部332−2は、重み付き分散近似値VARRdirを取得する。この値は、上述した図20のステップS403(図22)の処理で算出されたものである。 In step S651, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 acquires the weighted variance approximate value VA RRdir . This value is calculated by the process in step S403 (FIG. 22) in FIG.
ステップS652において、G補間処理部332−1またはE補間処理部332−2は、重み付き共分散近似値VARXAdirを取得する。この値は上述した図20のステップS404(図23)の処理で算出されたものである。 In step S652, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 acquires the weighted covariance approximation value VA RXAdir . This value is calculated by the processing in step S404 (FIG. 23) of FIG.
ステップS653において、G補間処理部332−1またはE補間処理部332−2は、VARRdir<(第2の定数)であるか否かを判定し、VARRdir<(第2の定数)であると判定された場合、ステップS654においてVARRdir=(第2の定数)と設定する。なお、第2の定数は、例えば、経験的にまたは実験的に定められる所定の値である。 In step S653, G interpolation processing section 332-1 or E interpolation processing section 332-2 determines whether the VA RRdir <(second constant) is the VA RRdir <(second constant) If it is determined, VA RRdir = (second constant) is set in step S654. The second constant is a predetermined value determined empirically or experimentally, for example.
ステップS653において、VARRdir<(第2の定数)でない、すなわちVARRdir≧(第2の定数)であると判定された場合、ステップS654の処理はスキップされる。 If it is determined in step S653 that VA RRdir <(second constant) is not satisfied, that is, VA RRdir ≥ (second constant), the process of step S654 is skipped.
ステップS653においてVARRdir<(第2の定数)でないと判定された場合、またはステップS654の処理の後、ステップS655において、G補間処理部332−1またはE補間処理部332−2は、Kdir=VARXAdir/VARRdirとする。その後処理は、図20のステップS406に進む。 If it is determined in step S653 that VA RRdir <(second constant) is not satisfied, or after the processing in step S654, in step S655, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 performs K dir = VA RXAdir / VA RRdir . Thereafter, the processing proceeds to step S406 in FIG.
図29の処理により、回帰直線の傾きKdirが算出される。 The slope K dir of the regression line is calculated by the process of FIG.
次に、図30のフローチャートを参照して、図20のステップS406において実行される回帰直線によるXの推定値XF算出処理を説明する。 Next, the X estimated value XF calculation process by the regression line executed in step S406 of FIG. 20 will be described with reference to the flowchart of FIG.
ステップS701において、G補間処理部332−1またはE補間処理部332−2は、重み付き平均MRdirを取得する。この値は、上述した図20のステップS401で算出されたものである。 In step S701, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 acquires the weighted average M Rdir . This value is calculated in step S401 of FIG. 20 described above.
ステップS702において、G補間処理部332−1またはE補間処理部332−2は、重み付き平均MXAdirを取得する。この値は、上述した図20のステップS402で算出されたものである。 In step S702, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 acquires the weighted average M XAdir . This value is calculated in step S402 in FIG.
ステップS703において、G補間処理部332−1またはE補間処理部332−2は、回帰直線の傾きKdirを取得する。この値は、上述した図20のステップS405で算出されたものである。 In step S703, G interpolation processing section 332-1 or E interpolation processing section 332-2 obtains the inclination K dir of the regression line. This value is calculated in step S405 of FIG.
ステップS704において、G補間処理部332−1またはE補間処理部332−2は、注目画素Xの推定値XF={Kdir(注目画素のR−重み付き平均MRdir)+重み付き平均MXAdir}とする。すなわち、回帰直線の傾きKdirに注目画素のRから重み付き平均MRdirが減算された値が乗算され、その値に重み付き平均MXAdirが加算された値が注目画素Xの推定値XFとされる。その後、図20の処理は終了され、処理は、図9のステップS56に進む。 In step S704, the G interpolation processing unit 332-1 or the E interpolation processing unit 332-2 estimates the estimated value XF of the pixel of interest XF = {K dir (R-weighted average M Rdir of the pixel of interest) + weighted average M XAdir. }. That is, the regression line slope K dir is multiplied by a value obtained by subtracting the weighted average M Rdir from the R of the pixel of interest, and the value obtained by adding the weighted average M XAdir to the value is the estimated value XF of the pixel of interest X. Is done. Thereafter, the process in FIG. 20 is terminated, and the process proceeds to step S56 in FIG.
図30の処理により、G補間処理部332−1は注目画素Gの推定値GFを算出し、E補間処理部332−2は注目画素Eの推定値EFを算出する。 30, the G interpolation processing unit 332-1 calculates the estimated value GF of the target pixel G, and the E interpolation processing unit 332-2 calculates the estimated value EF of the target pixel E.
次に、図31を参照して、図9のステップS56またはステップS57において実行される第3の補間処理(第3のG補間処理または第3のE補間処理)を説明する。なお、GおよびEのいずれに対しても同様の処理が実行されるので、図31においてXと記述されている部分については、適宜、G,Eに読み替えられる。具体的には、図31の処理が図9ステップS56の処理に対応する処理の場合、G補間処理部333−1が実行する処理であるので、Xは、Gに読み替えられ、図31の処理が図9のステップS57の処理に対応する処理の場合、E補間処理部333−2が実行する処理であるので、Xは、Eに読み替えられる。また、ここでは、XがGの場合にはYをEとし、XがEの場合にはYをGとする。 Next, the third interpolation process (third G interpolation process or third E interpolation process) executed in step S56 or step S57 in FIG. 9 will be described with reference to FIG. Since the same processing is executed for both G and E, the portion described as X in FIG. 31 is appropriately read as G and E. Specifically, when the process of FIG. 31 is a process corresponding to the process of step S56 of FIG. 9, the process is executed by the G interpolation processing unit 333-1, so that X is read as G and the process of FIG. 9 is a process executed by the E interpolation processing unit 333-2 in the case of the process corresponding to the process of step S57 in FIG. Here, when X is G, Y is E, and when X is E, Y is G.
ステップS751において、G補間処理部333−1またはE補間処理部333−2は、注目画素のYFを取得する。具体的には、XがGの場合にはYがEであり、XがEの場合にはYがGであるので、G補間処理部333−1は、EFを取得し、E補間処理部333−2は、GFを取得する。すなわち、G補間処理部333−1は、図30の処理でE補間処理部332−2により算出された推定値XF(EF)を取得し、E補間処理部333−2は、図30の処理でG補間処理部332−1により算出された推定値XF(GF)を取得する。 In step S751, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 acquires the YF of the target pixel. Specifically, when X is G, Y is E, and when X is E, Y is G. Therefore, the G interpolation processing unit 333-1 acquires EF, and the E interpolation processing unit 333-2 acquires GF. That is, the G interpolation processing unit 333-1 acquires the estimated value XF (EF) calculated by the E interpolation processing unit 332-2 in the process of FIG. 30, and the E interpolation processing unit 333-2 receives the process of FIG. To obtain the estimated value XF (GF) calculated by the G interpolation processing unit 332-1.
ステップS752において、G補間処理部333−1またはE補間処理部333−2は、重み付き平均MXA算出処理を実行する。この処理の詳細は、図32を参照して後述する。 In step S752, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 executes a weighted average M XA calculation process. Details of this processing will be described later with reference to FIG.
ステップS753において、G補間処理部333−1またはE補間処理部333−2は、重み付き平均MYA算出処理を実行する。この処理の詳細は、図32を参照して後述する。 In step S753, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 executes a weighted average M YA calculation process. Details of this processing will be described later with reference to FIG.
ステップS754において、G補間処理部333−1またはE補間処理部333−2は、Xの補間値XU算出処理を実行する。この処理の詳細は、図33を参照して後述する。ステップS754の処理の後、図31の処理は終了され、処理は、図9のステップS58に進む。 In step S754, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 executes an X interpolation value XU calculation process. Details of this processing will be described later with reference to FIG. After the process of step S754, the process of FIG. 31 is terminated, and the process proceeds to step S58 of FIG.
次に、図32のフローチャートを参照して、図31のステップS752における重み付き平均MXA算出処理について説明する。なお、n’’’は、正の整数である。また、(j’’’,k’’’)は、局所領域における中心(注目画素位置)を(0,0)とした場合の、処理を実行する画素位置を示す。 Next, the weighted average M XA calculation process in step S752 of FIG. 31 will be described with reference to the flowchart of FIG. Note that n ′ ″ is a positive integer. In addition, (j ′ ″, k ′ ″) indicates a pixel position where the process is executed when the center (target pixel position) in the local region is (0, 0).
ステップS801において、G補間処理部333−1またはE補間処理部333−2は、重み付き平均値MXAを0に初期化する。 In step S801, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 initializes the weighted average value M XA to 0.
ステップS802において、G補間処理部333−1またはE補間処理部333−2は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’’’を初期化してj’’’=−n’’’とし、ステップS803において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’’’を初期化してk’’’=−n’’’とする。 In step S802, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 sets the value j ′ ″ of the first register indicating the pixel position where the processing is performed among the supplied pixels in the local region. In step S803, the value k ′ ″ of the second register indicating the pixel position where the process is executed is initialized in step S803. K ′ ″ = − n ′ ″.
ステップS804において、G補間処理部333−1またはE補間処理部333−2は、MXA=MXA+(重み係数w’iが施された画素(j''’,k''')の補間値XA)とする。すなわち、MXAに重み係数w’iが施された画素(j''',k''')の補間値XAを加算したものが新たなMXAとされる。 In step S804, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 sets M XA = M XA + (pixel (j ′ ″, k ′ ″) to which the weight coefficient w′i is applied). Interpolated value XA). That is, the pixel weighting factor w'i has been subjected to M XA (j ''',k''') obtained by adding the interpolated value XA of is the new M XA.
ステップS805において、G補間処理部333−1またはE補間処理部333−2は、第2のレジスタの値k’’’を参照し、k’’’=n’’’であるか否かを判定する。ステップS805において、k’’’=n’’’でないと判定された場合、ステップS806において、G補間処理部333−1またはE補間処理部333−2は、第2のレジスタの値k’’’をk’’’=k’’’+1に更新して、処理はステップS804に戻り、それ以降の処理が繰り返される。 In step S805, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 refers to the value k ″ ′ of the second register and determines whether k ′ ″ = n ′ ″. judge. If it is determined in step S805 that k ′ ″ = n ′ ″ is not satisfied, in step S806, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 sets the value k ″ of the second register. 'Is updated to k' '' = k '' '+ 1, the process returns to step S804, and the subsequent processes are repeated.
ステップS805において、k’’’=n’’’であると判定された場合、ステップS807において、G補間処理部333−1またはE補間処理部333−2は、処理を実行する画素位置を示す第1のレジスタの値j’’’を参照し、j’’’=n’’’であるか否かを判定する。ステップS807においてj’’’=n’’’ではないと判定された場合、ステップS808においてG補間処理部333−1またはE補間処理部333−2は、第1のレジスタの値j’’’をj’’=j’’’+1に更新して、処理はステップS803に戻り、それ以降の処理が繰り返される。 When it is determined in step S805 that k ′ ″ = n ′ ″, in step S807, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 indicates a pixel position where the process is executed. With reference to the value j ′ ″ of the first register, it is determined whether j ′ ″ = n ′ ″. When it is determined in step S807 that j ′ ″ = n ′ ″ is not satisfied, in step S808, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 determines the value j ′ ″ of the first register. Is updated to j ″ = j ′ ″ + 1, the process returns to step S803, and the subsequent processes are repeated.
ステップS807において、j’’’=n’’’であると判定された場合、ステップS809において、G補間処理部333−1またはE補間処理部333−2は、MXA=MXA/W’とする。このW’は重み係数w'iの総和W’とされる。 If it is determined in step S807 that j ′ ″ = n ′ ″, in step S809, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 determines that M XA = M XA / W ′. And This W ′ is the sum W ′ of the weighting factors w′i.
ステップS810において、G補間処理部333−1またはE補間処理部333−2は、重み付き平均値MXAを出力し、処理は図31のステップS753に進む。 In step S810, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 outputs the weighted average value M XA , and the process proceeds to step S753 in FIG.
図32の処理により、XAの重み付き平均値MXAが算出される。 The weighted average value M XA of XA is calculated by the processing of FIG.
なお、図32の処理では、重み付き平均MXAについてしか記載されていないが、上述したように、この処理をG補間処理部333−1が実行する場合、XはGに読み替えられ、YがEに読み替えられ、この処理をE補間処理部333−2が実行する場合、XはEに読み替えられ、YがGに読み替えられる。すなわち、G補間処理部333−1およびE補間処理部333−2によって、G,Eについて図32の処理が実行されることにより、MXAおよびMYAが算出される。図32において、重み付き平均MXAおよび重み付き平均MYAが算出された場合、処理は図31のステップS754に進む。 In the process of FIG. 32, only the weighted average M XA is described, but as described above, when the G interpolation processing unit 333-1 executes this process, X is read as G, and Y is When E is read as E and this process is executed by the E interpolation processing unit 333-2, X is read as E and Y is read as G. That is, M XA and M YA are calculated by executing the processing of FIG. 32 for G and E by the G interpolation processing unit 333-1 and the E interpolation processing unit 333-2. In FIG. 32, when the weighted average M XA and the weighted average M YA are calculated, the process proceeds to step S754 in FIG.
次に、図33のフローチャートを参照して、図31のステップS754において実行されるXの補間値XU算出処理について説明する。ここでは、XがGの場合はYをEに、XがEの場合はYをGに適宜読み替えられる。 Next, the X interpolation value XU calculation process executed in step S754 in FIG. 31 will be described with reference to the flowchart in FIG. Here, when X is G, Y is appropriately replaced with E, and when X is E, Y is appropriately replaced with G.
ステップS851において、G補間処理部333−1またはE補間処理部333−2は、注目画素の補間値YFを取得する。この値は、上述した図31のステップS751の処理で取得されたものと同じものである。 In step S851, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 acquires the interpolation value YF of the target pixel. This value is the same as that acquired in step S751 of FIG. 31 described above.
ステップS852において、G補間処理部333−1またはE補間処理部333−2は、重み付き平均MXAを取得する。この値は、上述した図31のステップS752(図32)の処理で算出されたものである。 In step S852, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 acquires the weighted average M XA . This value is calculated by the process of step S752 (FIG. 32) of FIG.
ステップS853において、G補間処理部333−1またはE補間処理部333−2は、重み付き平均MYAを取得する。この値は、上述した図31のステップS753(図32)の処理で算出されたものである。 In step S853, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 acquires the weighted average M YA . This value is calculated by the processing in step S753 (FIG. 32) of FIG.
ステップS854において、G補間処理部333−1またはE補間処理部333−2は、MYA<(第3の定数)であるか否かを判定し、MYA<(第3の定数)であると判定された場合、ステップS855においてM’YA=(第3の定数)と設定する。なお、第3の定数は、例えば、経験的にまたは実験的に定められる所定の値である。 In step S854, G interpolation processing section 333-1 or E interpolation processing section 333-2 determines whether an M YA <(third constant) is the M YA <(third constant) If it is determined, M ′ YA = (third constant) is set in step S855. Note that the third constant is a predetermined value determined empirically or experimentally, for example.
ステップS854において、MYA<(第3の定数)ではない、すなわちMYA≧(第3の定数)であると判定された場合、ステップS856においてG補間処理部333−1またはE補間処理部333−2は、M’YA=MYAと設定する。 If it is determined in step S854 that M YA <(third constant) is not satisfied, that is, M YA ≧ (third constant), the G interpolation processing unit 333-1 or the E interpolation processing unit 333 is determined in step S856. -2 is set as M ′ YA = M YA .
ステップS855の処理の後、またはステップS856の処理の後、ステップS857において、G補間処理部333−1またはE補間処理部333−2は、注目画素位置のXの補間値XU=(MXA/M’YA)(注目画素位置のYF−MYA)+MXAとする。これにより、Xの補間値XUが算出される。 After the process of step S855 or the process of step S856, in step S857, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 determines the X interpolation value XU = (M XA / M ′ YA ) (YF−M YA at the target pixel position) + M XA . Thereby, an interpolation value XU of X is calculated.
ステップS858において、G補間処理部333−1またはE補間処理部333−2は、注目画素位置のXの補間値XUを出力し、その後図33の処理は終了され、処理は図9のステップS58に進む。 In step S858, the G interpolation processing unit 333-1 or the E interpolation processing unit 333-2 outputs the X interpolation value XU of the target pixel position, and then the processing in FIG. 33 is terminated, and the processing is performed in step S58 in FIG. Proceed to
次に、図34のフローチャートを参照して、図9のステップS58において実行される第1のG+E生成処理について説明する。なおこの処理は、図6のG+E生成処理部335により実行される処理である。
Next, the first G + E generation process executed in step S58 of FIG. 9 will be described with reference to the flowchart of FIG. This process is a process executed by the G + E
ステップS901において、G+E生成処理部335は、第3の補間処理により算出された注目画素位置のGの補間値GUを取得する。具体的には、図9のステップS56の処理で、G補間処理部333−1により算出されたGの補間値GU(図33の補間値XUに対応する値)が取得される。
In step S901, the G + E
ステップS902において、G+E生成処理部335は、第2の補間処理により算出された注目画素位置のEの補間値EFを取得する。具体的には、図9のステップS55の処理で、E補間処理部332−2により算出されたEの補間値EF(図30の補間値XFに対応する値)が取得される。
In step S902, the G + E
ステップS903において、G+E生成処理部335は、注目画素位置の(G+E)V=(注目画素位置のGU+注目画素位置のEF)/2とする。すなわち、注目画素位置のGUと注目画素位置のEFの平均値が注目画素位置の(G+E)Vとされる。
In step S903, the G + E
ステップS904において、G+E生成処理部335は、注目画素位置の(G+E)Vを出力し、処理は図9のステップS59に進む。
In step S904, the G + E
次に、図35のフローチャートを参照して、図9のステップS59において実行される第2のG+E生成処理について説明する。なおこの処理は、図6のG+E生成処理部336により実行される処理である。
Next, the second G + E generation process executed in step S59 of FIG. 9 will be described with reference to the flowchart of FIG. This process is a process executed by the G + E
ステップS951において、G+E生成処理部336は、第2の補間処理により算出された注目画素位置のGの補間値GFを取得する。具体的には、図9のステップS54の処理で、G補間処理部332−1により算出されたGの補間値GF(図30の補間値XFに対応する値)が取得される。
In step S951, the G + E
ステップS952において、G+E生成処理部336は、第3の補間処理により算出された注目画素位置のEの補間値EUを取得する。具体的には、図9のステップS57の処理で、E補間処理部333−2により算出されたEの補間値EU(図33の補間値XUに対応する値)が取得される。
In step S952, the G + E
ステップS953において、G+E生成処理部336は、注目画素位置の(G+E)H=(注目画素位置のGF+注目画素位置のEU)/2とする。すなわち、注目画素位置のGFと注目画素位置のEUの平均値が注目画素位置の(G+E)Hとされる。
In step S953, the G + E
ステップS954において、G+E生成処理部336は、注目画素位置の(G+E)Hを出力し、処理は図9のステップS60に進む。
In step S954, the G + E
次に、図36のフローチャートを参照して、図9のステップS60において実行される合成処理について説明する。なお、この処理は、図6の合成処理部337により実行される処理である。
Next, the synthesis process executed in step S60 of FIG. 9 will be described with reference to the flowchart of FIG. This process is a process executed by the
ステップS1001において、合成処理部337は、第1のG+E生成処理により算出された注目画素位置の(G+E)Vを取得する。具体的には、図9のステップS58(図34)の処理で、G+E生成処理部335により算出された(G+E)Vが取得される。
In step S1001, the
ステップS1002において、合成処理部337は、第2のG+E生成処理により算出された注目画素位置の(G+E)Hを取得する。具体的には、図9のステップS59(図35)の処理で、G+E生成処理部336により算出された(G+E)Hが取得される。
In step S1002, the
ステップS1003において、合成処理部337は、補正テクスチャ強度算出処理により算出された、補正されたテクスチャ強度TH,TVを取得する。具体的には、図9のステップS53(図12)の処理で、テクスチャ強度算出処理部334により算出された補正されたテクスチャ強度TH,TVが取得される。
In step S1003, the
ステップS1004において、本実施の形態で用いた線形回帰による色の補間では、縦方向のサンプルを用いて作られた(G+E)Vは横方向のテクスチャに信頼性が高く、横方向のサンプルを用いて作られた(G+E)Hは縦方向のテクスチャに信頼性が高いので、合成処理部337は、注目画素位置の(G+E)=(注目画素位置の(G+E)V×TH+注目画素位置の(G+E)H×TV)とする。
In step S1004, in the color interpolation by linear regression used in this embodiment, (G + E) V created using the vertical sample is highly reliable for the horizontal texture, and the horizontal sample is used. Since (G + E) H created in this way has high reliability in the texture in the vertical direction, the
ステップS1005において、合成処理部337は、注目画素位置の(G+E)を出力し、図9の処理は終了され、処理は、図8のステップS24に進む。
In step S1005, the
なお、以上の例では、テクスチャ強度TH,TVの算出をG補間処理部331−1(第1のG補間処理)およびE補間処理部331−2(第1のE補間処理)により補間されたGAおよびEAを用いて行ったが、簡易的に原信号であるモザイク画像から直接行うこともできる。図37は、図13に代えてテクスチャ強度TH,TVをモザイク画像から直接算出する処理を説明するフローチャートである。図37の例において、Mと記述されている部分は、モザイク画像信号を表す。 In the above example, the texture intensities T H and T V are interpolated by the G interpolation processor 331-1 (first G interpolation process) and the E interpolation processor 331-2 (first E interpolation process). However, it can also be directly performed directly from a mosaic image that is an original signal. FIG. 37 is a flowchart for describing processing for directly calculating the texture strengths T H and T V from the mosaic image instead of FIG. In the example of FIG. 37, a portion described as M represents a mosaic image signal.
ステップS1051において、テクスチャ強度算出処理部334は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’を初期化してj’=−n’とし、ステップS1052において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’を初期化してk’=−n’とする。
In step S1051, the texture intensity
ステップS1053において、テクスチャ強度算出処理部334は、式(4)を用いて横勾配評価値dHを算出するとともに、式(5)を用いて縦勾配評価値dVを算出する。
In step S1053, the texture intensity
dH={(|M(j'−2,k')−M(j',k')|+|M(j'+2,k')−M(j',k')|)/2+|M(j'−1,k')−M(j'+1,k')|}/2
・・・(4)
dV={(|M(j',k'−2)−M(j',k')|+|M(j',k'+2)−M(j',k')|)/2+|M(j',k'−1)−M(j',k'+1)|}/2
・・・(5)
dH = {(| M (j′−2, k ′) − M (j ′, k ′) | + | M (j ′ + 2, k ′) − M (j ′, k ′) |) / 2 + | M (j′−1, k ′) − M (j ′ + 1, k ′) |} / 2
... (4)
dV = {(| M (j ′, k′−2) −M (j ′, k ′) | + | M (j ′, k ′ + 2) −M (j ′, k ′) |) / 2 + | M (j ′, k′−1) −M (j ′, k ′ + 1) |} / 2
... (5)
ステップS1054乃至ステップS1061の処理は、上述した図13のステップS204乃至ステップS211の処理と同様であるので、その説明は省略する。 Since the processing from step S1054 to step S1061 is the same as the processing from step S204 to step S211 of FIG. 13 described above, the description thereof is omitted.
図37の処理により、簡単にテクスチャ強度TH,TVを算出することができる。図37の処理で得られたテクスチャ強度TH,TVは、注目画素の色がRであるかBであるかによって、フィルタ配列の違いによる影響を受けるものの、図13の処理で得られるテクスチャ強度TH,TVに近い結果が得られるので、この処理を適用するようにしてもよい。 The texture strengths T H and T V can be easily calculated by the processing of FIG. The texture intensities T H and T V obtained by the process of FIG. 37 are affected by the difference in filter arrangement depending on whether the color of the pixel of interest is R or B, but the texture obtained by the process of FIG. Since results close to the intensities T H and T V are obtained, this processing may be applied.
以上の処理をまとめると、以下の通りとなる。 The above processing is summarized as follows.
テクスチャ強度は、注目画素位置におけるグラディエント値より算出された、テクスチャの方向性を表す値(変化強度)である。色成分の推定精度は、推定に用いる近傍画素の選択に大きく左右される。そこで、縦方向の近傍画素を用いた推定と横方向の近傍画素を用いた推定を行い、それぞれの推定結果をテクスチャ強度に基づいてブレンドすることで適切な推定を行うようにする。 The texture intensity is a value (change intensity) representing the directionality of the texture calculated from the gradient value at the target pixel position. The estimation accuracy of the color component greatly depends on the selection of neighboring pixels used for estimation. Therefore, estimation using the neighboring pixels in the vertical direction and estimation using the neighboring pixels in the horizontal direction are performed, and appropriate estimation is performed by blending each estimation result based on the texture intensity.
テクスチャ強度の算出には2段階の処理が行われる。最初に、注目画素位置の縦方向、横方向のグラディエント値に基づいて、縦勾配評価値と横勾配評価値を算出し、テクスチャの変化が大きい方向を判定する。ここではテクスチャの変化が大きい方向のテクスチャ強度を0、小さい方向のテクスチャ強度を1とする。ここで、縦方向のテクスチャ強度をTV、横方向のテクスチャ強度をTHとする。次に、1度求めたテクスチャ強度を近傍画素位置で得られたテクスチャ強度の状態も考慮に入れて補正を行う。テクスチャ方向が横であれば、局所領域全ての画素TH=1,TV=0となり、テクスチャ方向が縦になるに連れてTH=0,TV=1となる画素が増えていく。すなわち、テクスチャ方向が縦または横である時に判定のばらつきが最小であり、45度付近でもっともばらつきが多くなると考えられる。この性質を用いて注目画素位置におけるテクスチャ強度を補正すると、あらゆる角度のテクスチャに対応できると同時に、限界解像度付近のテクスチャの方向が判定できなくなる領域における、判定結果のばらつきに起因する不自然なブレンドを防ぐことができる。補正方法の例を以下に示す。局所領域のTH,TVを用いて横方向のテクスチャ強度の平均偏差STHと縦方向のテクスチャ強度の平均偏差STVを算出し、式(6)乃至式(8)に示される補正式によりテクスチャ強度が補正される。 A two-stage process is performed to calculate the texture intensity. First, a vertical gradient evaluation value and a horizontal gradient evaluation value are calculated based on gradient values in the vertical direction and horizontal direction of the target pixel position, and a direction in which the texture change is large is determined. Here, the texture strength in the direction in which the texture change is large is 0, and the texture strength in the small direction is 1. Here, the texture strength in the vertical direction is T V and the texture strength in the horizontal direction is T H. Next, the texture intensity obtained once is corrected in consideration of the state of the texture intensity obtained at the neighboring pixel position. If the texture direction is horizontal, the pixels T H = 1 and T V = 0 in all the local regions, and the pixels with T H = 0 and T V = 1 increase as the texture direction becomes vertical. That is, it is considered that the determination variation is the smallest when the texture direction is vertical or horizontal, and the variation is largest near 45 degrees. If this property is used to correct the texture intensity at the target pixel position, it can handle textures of all angles, and at the same time, an unnatural blend caused by variations in judgment results in areas where the texture direction near the limit resolution cannot be judged. Can be prevented. An example of the correction method is shown below. The horizontal texture intensity average deviation S TH and the vertical texture intensity average deviation S TV are calculated using the local regions T H and T V, and the correction formulas shown in the equations (6) to (8) are calculated. Thus, the texture strength is corrected.
R=STH×(第1の定数) ・・・(6)
T’H(x,y)=TH(x,y)×(1−R)+R/2 ・・・(7)
T’V(x,y)=TV(x,y)×(1−R)+R/2 ・・・(8)
R = S TH × (first constant) (6)
T ′ H (x, y) = T H (x, y) × (1−R) + R / 2 (7)
T ′ V (x, y) = T V (x, y) × (1−R) + R / 2 (8)
また、(G+E)Hおよび(G+E)Vのブレンド結果(G+E)は、補正されたテクスチャ強度T’H,T’Vに基づいて、式(9)により算出される。 Further, the blend result (G + E) of (G + E) H and (G + E) V is calculated by the equation (9) based on the corrected texture strengths T ′ H and T ′ V.
(G+E)=(G+E)V×T’H+(G+E)H×T’V ・・・(9) (G + E) = (G + E) V × T ′ H + (G + E) H × T ′ V (9)
ここで、Rが1より大きくなる場合には、1にクリップされる。式(6)乃至式(9)により、判定結果のばらつきが小さい場合Rは0に近づき、TH,TVがそのまま出力される。また、判定結果のばらつきが大きい場合Rは大きくなり、T’H=0.5,T’V=0.5に近づくことになる。また、式(6)乃至式(9)によれば、T’H,T’Vの和が必ず1になると同時に、第1の定数によりT’H,T’Vの値の挙動をコントロールすることができる。 Here, if R is greater than 1, it is clipped to 1. According to the equations (6) to (9), when the variation of the determination result is small, R approaches 0 and T H and T V are output as they are. Further, when the variation of the determination result is large, R becomes large and approaches T ′ H = 0.5 and T ′ V = 0.5. Further, according to the equations (6) to (9), the sum of T ′ H and T ′ V always becomes 1, and at the same time, the behavior of the values of T ′ H and T ′ V is controlled by the first constant. be able to.
回帰推定の場合、なるべく(G+E)H,(G+E)Vをブレンドしない方が良いMTF(Modulation Transfer function)を得ることができるため、限界解像度付近でのアーチファクトが除去される程度に第1の定数を小さく設定することで、高いMTF性能を引き出すことができる。ここでは、注目画素位置を含む局所領域におけるテクスチャ強度のばらつきを評価するために平均偏差を用いているが、標準偏差等、他の統計量を用いても構わない。また、式(6)におけるRの算出をSTHだけでなくSTVも用いた以下の式(10)としてもよい。 In the case of regression estimation, it is possible to obtain an MTF (Modulation Transfer function) that is better not to blend (G + E) H and (G + E) V as much as possible, so the first constant is such that artifacts near the limit resolution are removed. By setting small, high MTF performance can be obtained. Here, the average deviation is used to evaluate the variation of the texture intensity in the local region including the target pixel position, but other statistics such as a standard deviation may be used. The calculation of R in equation (6) may be the following equation (10) using not only S TH but also S TV .
R=(STH+STV)×(第2の定数) ・・・(10) R = (S TH + S TV ) × (second constant) (10)
本発明では、ベイヤー配列(図1)におけるGに代わる輝度成分として(G+E)という新たな色成分を生成する。G+Eは同一画素上のGとEを加算平均することにより得られる。G+Eは、少なくとも半分はG成分からできているため、Gと相関が高いことが期待できる上、さらにG,Eが互いに相関の高い分光感度を持っているならば、G+EをGの代わりに用いて画像処理を行っても相応の結果を期待できる。つまり、G,Eがそれぞれベイヤー配列におけるGに近い分光特性を持つ場合、G+Eと同様に輝度を代表する色成分として用いることができ、本発明において輝度を全画素に揃える処理は、注目画素位置において横方向のテクスチャに対して信頼性の高い推定値(G+E)Vと、縦方向のテクスチャに対して信頼性の高い推定値(G+E)Hの2つのG+Eの値を算出し、テクスチャ強度に基づいてブレンドして、テクスチャ方向に適応したG+Eを全画素に揃える処理であるといえる。 In the present invention, a new color component (G + E) is generated as a luminance component instead of G in the Bayer array (FIG. 1). G + E is obtained by averaging the G and E on the same pixel. Since G + E is made up of at least half of the G component, it can be expected that G + E has a high correlation with G, and if G and E have a spectral sensitivity highly correlated with each other, use G + E instead of G. Even if image processing is performed, a corresponding result can be expected. That is, when G and E each have spectral characteristics close to G in the Bayer array, it can be used as a color component representing luminance as in G + E. 2 calculates a G + E value for the texture in the horizontal direction (G + E) V and a reliable estimate value (G + E) H for the texture in the vertical direction. It can be said that this is a process of blending and aligning G + E adapted to the texture direction for all pixels.
注目画素位置の色がG,Eのいずれかである場合、例えば、Eが存在する画素位置においてはGを、Gが存在する画素位置においてはEを補間して(G+E)を生成する。この補間に用いられる近傍画素を縦近傍にするか横近傍にするかによって、得られたG+Eのテクスチャ方向に対する信頼性を切り換えることができる。注目画素位置の色がEでもGでもないRまたはGである場合は、E,G双方とも補間された結果を用いなければならないので、この画素位置におけるG+Eを精度良く補間するには工夫が必要である。 When the color of the target pixel position is either G or E, for example, G is interpolated at a pixel position where E is present, and E is interpolated at a pixel position where G is present (G + E). The reliability of the obtained G + E with respect to the texture direction can be switched depending on whether the neighboring pixels used for the interpolation are vertical or horizontal. If the color at the pixel position of interest is R or G, which is neither E nor G, then the result of interpolation of both E and G must be used, so some effort is needed to accurately interpolate G + E at this pixel position. It is.
本発明では、注目画素位置の色がRまたはBの場合には、EとGの補間に、RまたはBに含まれる高周波成分を利用することを提案する。つまり、従来の補間方法において色のDC成分に輝度の高周波成分を加えていたのと同様に、注目画素位置にあるRまたはBの高周波成分に近傍画素から得られたEまたはGのDC成分を加えてEまたはGの補間を行う。この際、補間に用いる近傍画素を切り替え、縦近傍の画素を補間に用いたEの補間値EFと、横近傍の画素を補間に用いたGの補間値GFを算出する。さらにEFの高周波成分と近傍画素から得られるGのDC成分を用いて、注目画素位置のGを補間し、EFと加算平均して(G+E)Vを得る。同じく、GFの高周波成分と近傍画素から得られるEのDC成分を用いて、注目画素位置のEを補間し、GFと加算平均して(G+E)Hを得る。 In the present invention, when the color of the target pixel position is R or B, it is proposed to use a high-frequency component included in R or B for interpolation between E and G. That is, the E or G DC component obtained from the neighboring pixels is added to the R or B high frequency component at the target pixel position in the same way as the luminance high frequency component is added to the color DC component in the conventional interpolation method. In addition, E or G interpolation is performed. At this time, the neighboring pixels used for the interpolation are switched, and the interpolation value EF for E using the pixels near the vertical for interpolation and the interpolation value GF for G using the pixels near the horizontal for interpolation are calculated. Further, G at the target pixel position is interpolated using the high frequency component of EF and the DC component of G obtained from the neighboring pixels, and is added and averaged with EF to obtain (G + E) V. Similarly, using the high frequency component of GF and the DC component of E obtained from the neighboring pixels, E at the target pixel position is interpolated and averaged with GF to obtain (G + E) H.
なお、以上の例では、4色のフィルタ配列について述べてきたが、図38に示されるように、4色のフィルタ配列にさらに2色(この追加される2色を、以下、O,Sと記述する)追加した場合においても、上述した方法と同様の方法を用いることにより、G+Eを生成することができる。単に、配列に依存する近傍画素の選び方のみ、すなわち、図21乃至図23、図27および図28のループの条件を変更するだけでよい。人間の視覚が色成分に対して輝度に対するほど敏感でないことを考慮すると、輝度に強い相関を持つG+E信号さえ高いサンプリング周波数を保持していれば、他の色成分個々のサンプル数が減ることは、それほど問題にならない。それゆえGが水平及び垂直に1ラインおきに配置、Eが水平及び垂直に1ラインおきでEとは異なるラインに配置されるという配置が守られていれば、同様にして、さらに多くの色を用いた配列を用いることができる。 In the above example, the four-color filter array has been described. However, as shown in FIG. 38, two more colors are added to the four-color filter array. Even when added, G + E can be generated by using the same method as described above. Only the method of selecting neighboring pixels depending on the arrangement, that is, the conditions of the loops in FIGS. 21 to 23, 27 and 28 need only be changed. Considering that human vision is not so sensitive to luminance with respect to color components, if even G + E signals that have a strong correlation with luminance retain a high sampling frequency, the number of samples for other color components can be reduced. It does n’t matter so much. Therefore, if G is arranged horizontally and vertically every other line, and E is arranged every other line horizontally and vertically, it is arranged on a different line from E. A sequence using can be used.
なお、図14のステップS260、図16のステップS311、図21のステップS459、図22のステップS510、図23のステップS530、および図32のステップS809において、重み係数(例えば、w)の総和(例えば、W)で、所定の値が除算されているが、重み係数wを中心位置からの距離に応じて変化させ、その総和を2の累乗となるように定めることにより、重み係数wの総和Wで、所定の値を除算する処理(画素数を用いた除算)に代わって、シフト演算を用いるようにしてもよい。これにより、除算を簡略化することが可能となる。 14, step S311 in FIG. 16, step S459 in FIG. 21, step S510 in FIG. 22, step S530 in FIG. 23, and step S809 in FIG. 32, the sum of weight coefficients (for example, w) ( For example, a predetermined value is divided by W), but the weighting factor w is changed according to the distance from the center position, and the sum is determined to be a power of 2 to obtain the sum of the weighting factors w. Instead of the process of dividing a predetermined value by W (division using the number of pixels), a shift operation may be used. This makes it possible to simplify division.
なお、本発明は、デジタルカメラを初めとする、固体撮像素子および固体撮像素子を利用した撮像装置(例えば、デジタルスチルカメラ)に適用することができる。具体的には、1つの固体撮像素子によってカラー画像を得る方式(単板カラー方式)の撮像装置に本発明を適用することによって、不明な色成分を推定することができる。 Note that the present invention can be applied to a solid-state imaging device and an imaging device using the solid-state imaging device (for example, a digital still camera) including a digital camera. Specifically, an unknown color component can be estimated by applying the present invention to an imaging apparatus that obtains a color image with a single solid-state imaging device (single-plate color system).
以上により、4色配列を持つ単板カラー撮像素子によって撮像された色のモザイク画像より、テクスチャ方向を表す値としてテクスチャ強度を算出することができる。また、縦方向の近傍画素を用いて推定した推定値と、横方向の近傍画素を用いて推定した推定値とをテクスチャ強度に基づいてブレンドし、精度良く不明な色成分を推定することができる。 As described above, the texture intensity can be calculated as a value representing the texture direction from the mosaic image of the color imaged by the single-plate color imaging element having the four-color arrangement. In addition, the estimated value estimated using the neighboring pixels in the vertical direction and the estimated value estimated using the neighboring pixels in the horizontal direction can be blended based on the texture intensity, and the unknown color component can be estimated with high accuracy. .
これにより、方向検出に誤りが生じやすい限界解像度付近であっても、テクスチャ強度に適切な補正処理が加えられているため、安定した補間結果を得ることができる。 As a result, even in the vicinity of the limit resolution where an error is likely to occur in the direction detection, an appropriate correction process is applied to the texture intensity, so that a stable interpolation result can be obtained.
上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。 The series of processes described above can be executed by hardware, but can also be executed by software.
この場合、ソフトウェアをDSPブロック216が実行することにより、上述した機能が実現される。また、例えば、デモザイク処理部253、または、G+E算出処理部282は、図39に示されるようなパーソナルコンピュータ501により構成することが可能となる。
In this case, the above-described functions are realized by executing the software by the
図39において、CPU(Central Processing Unit)511は、ROM(Read Only Memory)512に記憶されているプログラム、または記憶部518からRAM(Random Access Memory)513にロードされたプログラムに従って、各種の処理を実行する。RAM513にはまた、CPU511が各種の処理を実行する上において必要なデータなども適宜記憶される。
39, a CPU (Central Processing Unit) 511 performs various processes according to a program stored in a ROM (Read Only Memory) 512 or a program loaded from a
CPU511、ROM512、およびRAM513は、バス514を介して相互に接続されている。このバス514にはまた、入出力インタフェース515も接続されている。
The
入出力インタフェース515には、キーボード、マウスなどよりなる入力部516、ディスプレイやスピーカなどよりなる出力部517、ハードディスクなどより構成される記憶部518、モデム、ターミナルアダプタなどより構成される通信部519が接続されている。通信部519は、インターネットを含むネットワークを介しての通信処理を行う。
The input /
入出力インタフェース515にはまた、必要に応じてドライブ520が接続され、磁気ディスク531、光ディスク532、光磁気ディスク533、もしくは、半導体メモリ534などが適宜装着され、それらから読み出されたコンピュータプログラムが、必要に応じて記憶部518にインストールされる。
A
一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェア(例えば、DSPブロック216や、その中に含まれている、デモザイク処理部253またはG+E算出処理部282)に組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のパーソナルコンピュータなどに、ネットワークや記録媒体からインストールされる。
When a series of processing is executed by software, a program constituting the software is dedicated hardware (for example, the DSP block 216 or the
この記録媒体は、図39に示されるように、装置本体とは別に、ユーザにプログラムを供給するために配布される、プログラムが記憶されている磁気ディスク531(フロッピディスクを含む)、光ディスク532(CD-ROM(Compact Disk-Read Only Memory),DVD(Digital Versatile Disk)を含む)、光磁気ディスク533(MO(Magnet Optical Disk)を含む)、もしくは半導体メモリ534などよりなるパッケージメディアにより構成されるだけでなく、装置本体に予め組み込まれた状態でユーザに供給される、プログラムが記憶されているROM512や、記憶部518に含まれるハードディスクなどで構成される。
As shown in FIG. 39, this recording medium is distributed to supply a program to the user separately from the apparatus main body, and includes a magnetic disk 531 (including a floppy disk) and an optical disk 532 (including a floppy disk) stored therein. CD-ROM (compact disk-read only memory), DVD (including digital versatile disk)), magneto-optical disk 533 (including MO (magnet optical disk)), or a package medium composed of
なお、本明細書において、記録媒体に記憶されるプログラムを記述するステップは、含む順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的もしくは個別に実行される処理をも含むものである。 In the present specification, the step of describing the program stored in the recording medium is not limited to the processing performed in chronological order in the order in which they are included, but is not necessarily processed in chronological order, either in parallel or individually. The process to be executed is also included.
201 デジタルカメラ, 216 DSPブロック, 251 ホワイトバランス調整部, 253 デモザイク処理部, 331−1 G補間処理部, 331−2 E補間処理部, 332−1 G補間処理部, 332−2 E補間処理部, 333−1 G補間処理部, 333−2 E補間処理部, 334 テクスチャ強度算出処理部, 335,336 G+E生成処理部, 337 合成処理部 201 digital camera, 216 DSP block, 251 white balance adjustment unit, 253 demosaic processing unit, 331-1 G interpolation processing unit, 331-2 E interpolation processing unit, 332-1 G interpolation processing unit, 332-2 E interpolation processing unit 3333-1 G interpolation processing unit, 333-2 E interpolation processing unit, 334 texture intensity calculation processing unit, 335,336 G + E generation processing unit, 337 synthesis processing unit
Claims (6)
前記モザイク画像の注目画素、並びに前記注目画素の縦方向および横方向の近傍の画素に基づいて、前記注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出手段と、
前記注目画素と、前記注目画素の縦方向の近傍の画素に基づいて、前記第1の色成分の前記注目画素における第1の推定値を算出するとともに、前記注目画素と前記注目画素の横方向の近傍の画素に基づいて、前記第2の色成分の前記注目画素における第2の推定値を算出する第1の推定値算出手段と、
前記縦方向の変化強度、前記横方向の変化強度、前記第1の推定値、および前記第2の推定値に基づいて、前記第1の色成分と前記第2の色成分からなる第3の色成分の前記注目画素における第3の推定値を算出する第2の推定値算出手段と
を備えることを特徴とする画像処理装置。 The first color component is arranged every other line in the horizontal and vertical directions, and the second color component is arranged every other line in the horizontal and vertical directions, and is different from the first color component in the horizontal and vertical directions. In an image processing apparatus for generating a color image in which each pixel has a plurality of color components based on a mosaic image captured by a single-plate color image sensor using color filters arranged in a line,
A change intensity calculating means for calculating a vertical change intensity and a horizontal change intensity of the target pixel based on the target pixel of the mosaic image and pixels in the vertical and horizontal directions of the target pixel;
Based on the pixel of interest and pixels in the vertical direction of the pixel of interest, a first estimated value of the pixel of interest of the first color component is calculated, and the horizontal direction of the pixel of interest and the pixel of interest First estimated value calculating means for calculating a second estimated value of the target pixel of the second color component based on pixels in the vicinity of
Based on the vertical change intensity, the horizontal change intensity, the first estimated value, and the second estimated value, a third color component composed of the first color component and the second color component. An image processing apparatus comprising: a second estimated value calculating unit configured to calculate a third estimated value of the color component in the target pixel.
前記注目画素における前記第1の色成分および前記第2の色成分の第1の補間値を、前記注目画素の近傍の画素の画素値に基づいて補間し、
前記注目画素の縦方向に位置する画素における前記第1の色成分および前記第2の色成分の第2の補間値を、前記注目画素の近傍の画素の画素値に基づいて補間し、
前記注目画素の横方向に位置する画素における前記第1の色成分および前記第2の色成分の第3の補間値を、前記注目画素の近傍の画素の画素値に基づいて補間し、
前記第1の補間値と、前記第2の補間値との差分の組により縦勾配評価値を算出し、
前記第1の補間値と、前記第3の補間値との差分の組により横勾配評価値を算出し、
前記縦勾配評価値および前記横勾配評価値に基づいて、前記変化強度を決定し、
前記注目画素および前記注目画素の近傍における変化強度の偏差を算出し、前記偏差に基づいて、前記注目画素の前記変化強度を補正する
ことを特徴とする請求項1に記載の画像処理装置。 The change intensity calculation means includes
Interpolating the first interpolation values of the first color component and the second color component in the target pixel based on pixel values of pixels in the vicinity of the target pixel;
Interpolating a second interpolation value of the first color component and the second color component in a pixel located in the vertical direction of the target pixel based on a pixel value of a pixel in the vicinity of the target pixel;
Interpolating a third interpolation value of the first color component and the second color component in a pixel located in a lateral direction of the target pixel based on a pixel value of a pixel in the vicinity of the target pixel;
A longitudinal gradient evaluation value is calculated from a set of differences between the first interpolation value and the second interpolation value,
A lateral gradient evaluation value is calculated by a set of differences between the first interpolation value and the third interpolation value,
Determining the intensity of change based on the longitudinal gradient evaluation value and the lateral gradient evaluation value;
The image processing apparatus according to claim 1, wherein a deviation of change intensity in the vicinity of the target pixel and the target pixel is calculated, and the change intensity of the target pixel is corrected based on the deviation.
前記注目画素の近傍の画素の前記第2の色成分および前記第1の推定値に基づいて、前記注目画素における前記第3の色成分の第4の推定値を算出する第3の推定値算出手段と、
前記注目画素の近傍の画素の前記第1の色成分および前記第2の推定値に基づいて、前記注目画素における前記第3の色成分の第5の推定値を算出する第4の推定値算出手段と、
前記第4の推定値、前記第5の推定値、前記注目画素における前記縦方向の変化強度、および前記注目画素における前記横方向の変化強度に基づいて、前記第3の推定値を算出する第5の推定値算出手段と
を備えることを特徴とする請求項1に記載の画像処理装置。 The second estimated value calculation means includes:
Third estimated value calculation for calculating a fourth estimated value of the third color component in the target pixel based on the second color component and the first estimated value of the pixel in the vicinity of the target pixel. Means,
Fourth estimated value calculation for calculating a fifth estimated value of the third color component in the target pixel based on the first color component and the second estimated value of the pixel in the vicinity of the target pixel. Means,
The third estimated value is calculated based on the fourth estimated value, the fifth estimated value, the vertical change intensity of the target pixel, and the horizontal change intensity of the target pixel. The image processing apparatus according to claim 1, further comprising: 5 estimated value calculation means.
ことを特徴とする請求項3に記載の画像処理装置。 The image processing apparatus according to claim 3, wherein the first color component and the second color component have spectral sensitivity highly correlated with each other.
前記モザイク画像の注目画素、並びに前記注目画素の縦方向および横方向の近傍の画素に基づいて、前記注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出ステップと、
前記注目画素と、前記注目画素の縦方向の近傍の画素に基づいて、前記第1の色成分の前記注目画素における第1の推定値を算出する第1の推定値算出ステップと、
前記注目画素と前記注目画素の横方向の近傍の画素に基づいて、前記第2の色成分の前記注目画素における第2の推定値を算出する第2の推定値算出ステップと、
前記縦方向の変化強度、前記横方向の変化強度、前記第1の推定値、および前記第2の推定値に基づいて、前記第1の色成分と前記第2の色成分からなる第3の色成分の前記注目画素における第3の推定値を算出する第3の推定値算出ステップと
を含むことを特徴とする画像処理方法。 The first color component is arranged every other line in the horizontal and vertical directions, and the second color component is arranged every other line in the horizontal and vertical directions, and is different from the first color component in the horizontal and vertical directions. In an image processing method of an image processing apparatus for generating a color image in which each pixel has a plurality of color components based on a mosaic image captured by a single-plate color image sensor using color filters arranged in a line,
A change intensity calculating step of calculating a vertical change intensity and a horizontal change intensity of the target pixel based on the target pixel of the mosaic image and pixels in the vertical and horizontal directions of the target pixel;
A first estimated value calculation step of calculating a first estimated value of the first color component in the target pixel based on the target pixel and a pixel in the vertical direction of the target pixel;
A second estimated value calculating step of calculating a second estimated value of the second color component in the target pixel based on the target pixel and a pixel in the horizontal direction of the target pixel;
Based on the vertical change intensity, the horizontal change intensity, the first estimated value, and the second estimated value, a third color component composed of the first color component and the second color component. And a third estimated value calculating step for calculating a third estimated value for the target pixel of the color component.
前記モザイク画像の注目画素、並びに前記注目画素の縦方向および横方向の近傍の画素に基づいて、前記注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出ステップと、
前記注目画素と、前記注目画素の縦方向の近傍の画素に基づいて、前記第1の色成分の前記注目画素における第1の推定値を算出する第1の推定値算出ステップと、
前記注目画素と前記注目画素の横方向の近傍の画素に基づいて、前記第2の色成分の前記注目画素における第2の推定値を算出する第2の推定値算出ステップと、
前記縦方向の変化強度、前記横方向の変化強度、前記第1の推定値、および前記第2の推定値に基づいて、前記第1の色成分と前記第2の色成分からなる第3の色成分の前記注目画素における第3の推定値を算出する第3の推定値算出ステップと
を含む処理をコンピュータに実行させることを特徴とするプログラム。 The first color component is arranged every other line in the horizontal and vertical directions, and the second color component is arranged every other line in the horizontal and vertical directions, and is different from the first color component in the horizontal and vertical directions. A program for generating a color image in which each pixel has a plurality of color components based on a mosaic image captured by a single-plate color image sensor using a color filter arranged in a line,
A change intensity calculating step of calculating a vertical change intensity and a horizontal change intensity of the target pixel based on the target pixel of the mosaic image and pixels in the vertical and horizontal directions of the target pixel;
A first estimated value calculation step of calculating a first estimated value of the first color component in the target pixel based on the target pixel and a pixel in the vertical direction of the target pixel;
A second estimated value calculating step of calculating a second estimated value of the second color component in the target pixel based on the target pixel and a pixel in the horizontal direction of the target pixel;
Based on the vertical change intensity, the horizontal change intensity, the first estimated value, and the second estimated value, a third color component composed of the first color component and the second color component. A program causing a computer to execute a process including a third estimated value calculating step of calculating a third estimated value of the target pixel of a color component.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004309459A JP4449696B2 (en) | 2003-10-31 | 2004-10-25 | Image processing apparatus, image processing method, and program |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003371538 | 2003-10-31 | ||
JP2004309459A JP4449696B2 (en) | 2003-10-31 | 2004-10-25 | Image processing apparatus, image processing method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2005160044A true JP2005160044A (en) | 2005-06-16 |
JP4449696B2 JP4449696B2 (en) | 2010-04-14 |
Family
ID=34741238
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004309459A Expired - Fee Related JP4449696B2 (en) | 2003-10-31 | 2004-10-25 | Image processing apparatus, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4449696B2 (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2005112470A1 (en) * | 2004-05-13 | 2005-11-24 | Olympus Corporation | Image processing device and image processing program |
US7710476B2 (en) | 2006-03-14 | 2010-05-04 | Sony Corporation | Color filter array, imaging device, and image processing unit |
WO2011150211A2 (en) * | 2010-05-27 | 2011-12-01 | Gentex Corporation | Improved digital image processing and systems incorporating the same |
WO2011152174A1 (en) | 2010-06-02 | 2011-12-08 | ソニー株式会社 | Image processing device, image processing method and program |
US8436925B2 (en) | 2008-12-08 | 2013-05-07 | Sony Corporation | Solid-state imaging device, method for processing signal of solid-state imaging device, and imaging apparatus |
US9041838B2 (en) | 2012-02-14 | 2015-05-26 | Gentex Corporation | High dynamic range imager system |
US9769430B1 (en) | 2011-06-23 | 2017-09-19 | Gentex Corporation | Imager system with median filter and method thereof |
-
2004
- 2004-10-25 JP JP2004309459A patent/JP4449696B2/en not_active Expired - Fee Related
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2005112470A1 (en) * | 2004-05-13 | 2005-11-24 | Olympus Corporation | Image processing device and image processing program |
US7710476B2 (en) | 2006-03-14 | 2010-05-04 | Sony Corporation | Color filter array, imaging device, and image processing unit |
US8339487B2 (en) | 2006-03-14 | 2012-12-25 | Sony Corporation | Color filter array, imaging device, and image processing unit |
US8436925B2 (en) | 2008-12-08 | 2013-05-07 | Sony Corporation | Solid-state imaging device, method for processing signal of solid-state imaging device, and imaging apparatus |
US8463035B2 (en) | 2009-05-28 | 2013-06-11 | Gentex Corporation | Digital image processing for calculating a missing color value |
WO2011150211A2 (en) * | 2010-05-27 | 2011-12-01 | Gentex Corporation | Improved digital image processing and systems incorporating the same |
WO2011150211A3 (en) * | 2010-05-27 | 2012-03-01 | Gentex Corporation | Improved digital image processing and systems incorporating the same |
WO2011152174A1 (en) | 2010-06-02 | 2011-12-08 | ソニー株式会社 | Image processing device, image processing method and program |
US8804012B2 (en) | 2010-06-02 | 2014-08-12 | Sony Corporation | Image processing apparatus, image processing method, and program for executing sensitivity difference correction processing |
US9769430B1 (en) | 2011-06-23 | 2017-09-19 | Gentex Corporation | Imager system with median filter and method thereof |
US10044991B2 (en) | 2011-06-23 | 2018-08-07 | Gentex Corporation | Imager system with median filter and method thereof |
US9041838B2 (en) | 2012-02-14 | 2015-05-26 | Gentex Corporation | High dynamic range imager system |
Also Published As
Publication number | Publication date |
---|---|
JP4449696B2 (en) | 2010-04-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4385282B2 (en) | Image processing apparatus and image processing method | |
US7548264B2 (en) | Image processing apparatus and image processing method, and program | |
US9288454B2 (en) | Color imaging apparatus having color imaging element | |
CN101778201B (en) | Image processing device, image processing method, program, and imaging device | |
JP4482031B2 (en) | Video alignment apparatus, method, and program | |
KR100782812B1 (en) | Method and apparatus for edge adaptive color interpolation | |
US7499089B2 (en) | Color interpolation method in bayer array | |
US20130077862A1 (en) | Image processing apparatus, image processing method and program | |
KR20090087811A (en) | Imaging device, image processing device, image processing method, program for image processing method, and recording medium having program for image processing method recorded thereon | |
JP2008258931A (en) | Image processing device | |
JP2004048465A (en) | Apparatus and program for image processing | |
EP1394742B1 (en) | Method for filtering the noise of a digital image sequence | |
JP2011244069A (en) | Imaging apparatus, integrated circuit and image processing method | |
US7412092B2 (en) | Image processing apparatus, image processing method, and program | |
JP4449696B2 (en) | Image processing apparatus, image processing method, and program | |
US20050007470A1 (en) | Data processing apparatus, image processing apparatus, camera, and data processing method | |
JP4556102B2 (en) | Image processing apparatus, image processing method, and program | |
JP5131567B2 (en) | Image processing apparatus, image processing method, program, and recording medium | |
JPWO2017203941A1 (en) | IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND PROGRAM | |
JP2009194721A (en) | Image signal processing device, image signal processing method, and imaging device | |
Wang et al. | Demosaicing with improved edge direction detection | |
JP4292950B2 (en) | Image processing apparatus, image processing method, and program | |
JP5484015B2 (en) | Imaging apparatus, imaging method, and program | |
JP2005117540A (en) | Apparatus and method for image processing, program | |
JP3655927B2 (en) | Scene change detection device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070914 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20091210 |
|
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: 20100105 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100118 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 4449696 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130205 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130205 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140205 Year of fee payment: 4 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |