JP2005160044A - Image processing apparatus, image processing method, and program - Google Patents

Image processing apparatus, image processing method, and program Download PDF

Info

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
Application number
JP2004309459A
Other languages
Japanese (ja)
Other versions
JP4449696B2 (en
Inventor
Nobukuni Nomura
宜邦 野村
Tomoo Mitsunaga
知生 光永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2004309459A priority Critical patent/JP4449696B2/en
Publication of JP2005160044A publication Critical patent/JP2005160044A/en
Application granted granted Critical
Publication of JP4449696B2 publication Critical patent/JP4449696B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To more accurately interpolate a mosaic image. <P>SOLUTION: A texture-intensity computation section 334 computes a texture intensity T<SB>H</SB>and a texture intensity T<SB>V</SB>of an R pixel position by using interpolation values GA and EA. A G interpolation section 333-1 computes an interpolation value GF using a horizontally adjacent interpolation value GA and a signal R, and an E interpolation section 333-2 computes an interpolation value EF using a vertically adjacent interpolation value EA and the signal R. The G interpolation section 333-1 computes an interpolation value GU using the interpolation values GA, EA and EF, and the E interpolation section 333-2 computes an interpolation value EU using the interpolation values GA, EA and GF. A G+E generation section 335 combines the interpolation values GU and EF to compute (G+E)<SB>V</SB>. A G+E generation section 336 combines the interpolation values GF and EU to compute (G+E)<SB>H</SB>. A combining section 337 determines the signal G+E using (G+E)<SB>H</SB>, and (G+E)<SB>V</SB>, and the texture intensities T<SB>H</SB>and T<SB>V</SB>. The present invention may be applied to digital cameras. <P>COPYRIGHT: (C)2005,JPO&NCIPI

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 Patent Document 1, G is pre-aligned with all pixels based on the assumption that the color ratio in the local region is substantially constant, and the average ratio of R and G and the average ratio of B and G in neighboring pixels. A pixel interpolation method for multiplying G at the target pixel position to estimate an unknown color component has been proposed. In such a pixel interpolation method using G as reference information, there is a problem that the final result depends greatly on the interpolation accuracy when all pixels are aligned in G.

そこで、特許文献2では、Gのグラディエント値に基づいて、補間に用いる近傍Gの画素を切り換えることで、補間精度を上げるといった工夫が行われている。また、特許文献3では、補間に用いる近傍Gの画素を切り換えるだけでなく、補間画素位置の水平、垂直の相関値を求め、水平方向の相関が強い場合に適した処理と、垂直方向の相関が強い場合に適した処理によって得られた2つの補間値を相関値によって混合する方法が提案されている。   Therefore, in Patent Document 2, a device is devised in which interpolation accuracy is increased by switching neighboring G pixels used for interpolation based on a G gradient value. Further, in Patent Document 3, not only the neighboring G pixels used for interpolation are switched, but also the horizontal and vertical correlation values of the interpolated pixel positions are obtained, and the processing suitable for the case where the horizontal correlation is strong, and the vertical correlation There has been proposed a method of mixing two interpolation values obtained by processing suitable for a case where the value is strong using a correlation value.

上述した様々な方法では、Gが市松状に配置され、他の色に比べてサンプリング周波数が高いというベイヤー配列の特徴が前提となっているが、単板式の固体撮像素子のフィルタは3色に限定されるものではなく、4色用いられる場合もある。いわゆる補色系のフィルタ配列以外でも、例えば、特許文献4には、色再現性の向上を狙って、RGBの3色にさらにもう1つの色(例えば、Y)を加えることで、4色の配列でフィルタを構成することが提案されている。また、例えば、ベイヤー配列においても、Gに隣接するR,Bの配置の違いや、特許文献5および特許文献6で言及されている、製造過程におけるフィルタの位置ずれ等を原因とした分光特性の違い、また、特許文献7で言及されている、偶数ライン、奇数ラインで別の信号出力経路を持つ固体撮像素子に発生するライン間でのゲインの誤差等により、2×2のフィルタ配列内の2つのGが必ずしも同一の特性とは限らなくなり、事実上、4色の配列となっている場合がある。
米国特許、Cok,David R.,USP 4,642,678 米国特許、Hibbard,Robert H.,USP 5,382,976 特許番号2931520号 特開2002−271804号公報 特開平7−135302号公報 特開平8−191141号公報 特開平4−154281号公報
The various methods described above are premised on the characteristics of the Bayer arrangement in which G is arranged in a checkered pattern and has a higher sampling frequency than other colors, but the filters of a single-plate solid-state imaging device are in three colors. It is not limited and there are cases where four colors are used. In addition to the so-called complementary color filter arrangement, for example, Patent Document 4 discloses an arrangement of four colors by adding another color (for example, Y) to the three RGB colors in order to improve color reproducibility. It has been proposed to construct a filter. Also, for example, in the Bayer array, the spectral characteristics caused by the difference in the arrangement of R and B adjacent to G and the positional deviation of the filter in the manufacturing process, which are mentioned in Patent Documents 5 and 6, are also mentioned. Due to the difference and the gain error between the lines generated in the solid-state imaging device having different signal output paths in the even lines and the odd lines mentioned in Patent Document 7, Two Gs do not necessarily have the same characteristics, and may actually be an array of four colors.
US Patent, Cok, David R., USP 4,642,678 US Patent, Hibbard, Robert H., USP 5,382,976 Patent No. 2931520 JP 2002-271804 A JP 7-135302 A JP-A-8-191141 Japanese Patent Laid-Open No. 4-154281

しかしながら、このような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 Patent Document 3, are directly interpolated. In the method to be used, if the correlation determination becomes wrong near the limit resolution due to the influence of noise or the like, the two interpolated values are mixed irregularly, and there is a problem that a very conspicuous artifact is generated.

本発明はこのような状況に鑑みてなされたものであり、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 digital camera 201 in FIG. 2), the first color component (for example, G) is arranged horizontally and vertically every other line, and the second color component (for example, E) is horizontal. And each pixel based on a mosaic image picked up by a single-plate color image pickup device using color filters arranged vertically and every other line, and arranged in horizontal and vertical lines different from the first color component Is an image processing apparatus (for example, the digital camera 201 in FIG. 2) that generates a color image having a plurality of color components, and the pixel of interest of the mosaic image, and pixels in the vertical and horizontal directions of the pixel of interest based on the calculated vertical direction of the change intensity in the pixel of interest (e.g., the texture-intensity-T V) and lateral change strength (e.g., texture strength T H) change Degree calculation means (for example, the texture intensity calculation processing unit 334 in FIG. 6), the target pixel (for example, R), and a pixel in the vertical direction of the target pixel (for example, the vertical pixel G of R). Based on the first estimated value (eg, GF) of the target pixel of the first color component (eg, G), and the horizontal direction between the target pixel (eg, R) and the target pixel. A first estimated value (for example, EF) for the target pixel of the second color component (for example, E) is calculated based on a neighboring pixel (for example, a pixel E in the lateral vicinity of R). Estimated value calculation means (for example, the G interpolation processing unit 332-1 or E interpolation processing unit 332-2 in FIG. 6), the vertical change intensity, the horizontal change intensity, the first estimated value, And the first color component based on the second estimate Second estimated value calculation means (for example, G + E generation processing unit 335 in FIG. 6) that calculates a third estimated value (for example, G + E) of the target pixel of the third color component that is the second color component. A G + E generation processing unit 336 and a synthesis processing unit 337).

変化強度算出手段は、注目画素における第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 generation processing unit 336 in FIG. 6) for calculating a fourth estimated value (for example, (G + E) H ), and first pixels of pixels in the vicinity of the target pixel. Fourth estimated value calculation for calculating a fifth estimated value (for example, (G + E) V ) of the third color component in the pixel of interest based on the color component (for example, G) and the second estimated value (for example, EF). Based on the means (for example, the G + E generation processing unit 335 in FIG. 6), the fourth estimated value, the fifth estimated value, the vertical change strength of the target pixel, and the horizontal change strength of the target pixel, A fifth estimate that calculates an estimate of 3 (eg, (G + E)) Calculating means (for example, synthesis processing unit 337 of FIG. 6) can be made to and a.

第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 digital camera 201 in FIG. 2) that generates an image, wherein a target pixel is based on a target pixel of a mosaic image and pixels in the vertical and horizontal directions of the target pixel. vertical change intensity in (e.g., texture strength T V) and lateral change strength (e.g., texture strength T H) changes intensity calculating step of calculating (for example, 9, the first color component (for example, G) based on the target pixel (for example, R) and the pixel in the vicinity of the target pixel in the vertical direction (for example, the pixel G in the vertical vicinity of R). A first estimated value calculating step (for example, step S54 in FIG. 9) for calculating a first estimated value (for example, GF) in the target pixel of the target pixel, and the vicinity of the target pixel (for example, R) and the target pixel in the horizontal direction Second estimated value calculation for calculating a second estimated value (for example, EF) at the target pixel of the second color component (for example, E) based on the pixel (for example, a pixel E in the vicinity of R in the lateral direction). The first color component and the second color based on the step (for example, step S55 in FIG. 9), the vertical change strength, the horizontal change strength, the first estimated value, and the second estimated value. A third color component (for example, G + E) of the third pixel in the target pixel Estimate (e.g., G + E) and a third estimate calculation step of calculating (for example, step S58 to step S60 of FIG. 9).

本発明によれば、プログラムが提供される。このプログラムは、第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 digital camera 201 in FIG. 2) to be generated, in which a vertical direction at a target pixel is determined based on a target pixel of a mosaic image and pixels in the vertical and horizontal directions of the target pixel. direction change strength (e.g., texture strength T V) and lateral change strength (e.g., texture strength T H) changes intensity calculating step of calculating (for example, FIG. Step S53), the target pixel (for example, R), and the pixel in the vertical direction of the target pixel (for example, the pixel G in the vertical vicinity of R) of the first color component (for example, G) A first estimated value calculating step (for example, step S54 in FIG. 9) for calculating a first estimated value (for example, GF) in the target pixel, and a horizontal vicinity of the target pixel (for example, R) and the target pixel. A second estimated value calculating step of calculating a second estimated value (for example, EF) in the target pixel of the second color component (for example, E) based on the pixel (for example, a pixel E in the vicinity of R). (For example, step S55 in FIG. 9), the first color component and the second color component based on the vertical direction change intensity, the horizontal direction change intensity, the first estimated value, and the second estimated value. A third color component (for example, G + E) Value (e.g., G + E) third estimate calculation step of calculating (for example, step S58 to step S60 in FIG. 9) and causing the computer to execute.

以下、図を参照して、本発明の実施の形態について説明する。   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 digital camera 201 to which the present invention is applied.

図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 digital camera 201 includes a lens 211, a diaphragm 212, a CCD (Charge Coupled Devices) image sensor 213, a correlated double sampling (CDS) circuit 214, an A / D converter 215, and a DSP (DSP). Digital Signal Processor) block 216, timing generator 217, D / A converter 218, video encoder 219, display unit 220, CODEC (CODEC: COmpression / DECompression) processing unit 221, memory 222, CPU (Central Processing Unit) 223, and The operation input unit 224 is configured.

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 CCD image sensor 213 has a plurality of light receiving elements (pixels) that convert light into electricity, and changes in light for each pixel. It converts to an electric signal independently. The correlated double sampling circuit 214 samples the reset noise, which is the main component of the noise included in the output signal of the CCD image sensor 213, from the sampled video signal period of the output pixel signals, and the reference period. Is a circuit that removes the signal by subtracting the sampled signal. The A / D converter 215 converts the supplied analog signal after noise removal into a digital signal.

DSPブロック216は、信号処理用プロセッサと画像用RAM(Random Access Memory)を持つブロックで、信号処理用プロセッサが画像用RAMに格納された画像データに対して、予めプログラムされた画像処理、または、ハードウェアによる演算処理として構成された画像処理を行うものである。タイミングジェネレータ217は、CCDを駆動するために必要な、水平および垂直の各種駆動パルス、並びに、アナログフロント処理で用いるパルスを、基準クロックに同期して発生させるロジック回路である。また、タイミングジェネレータ217により発生されるタイミングクロックは、バス225を介して、コーデック処理部221、メモリ222、および、CPU223にも供給されている。   The DSP block 216 is a block having a signal processing processor and an image RAM (Random Access Memory), and the signal processing processor performs pre-programmed image processing on image data stored in the image RAM, or It performs image processing configured as arithmetic processing by hardware. The timing generator 217 is a logic circuit that generates various horizontal and vertical driving pulses necessary for driving the CCD and pulses used in the analog front processing in synchronization with the reference clock. The timing clock generated by the timing generator 217 is also supplied to the codec processing unit 221, the memory 222, and the CPU 223 via the bus 225.

D/Aコンバータ218は、供給されたデジタル信号をアナログ信号に変換して出力する。ビデオエンコーダ219は、供給されたアナログ信号を、表示部220において表示可能な形式のビデオデータにエンコードする。表示部220は、例えば、LCD(Liquid Crystal Display)などで構成され、ビデオエンコーダ219から供給されたビデオ信号を表示する。   The D / A converter 218 converts the supplied digital signal into an analog signal and outputs the analog signal. The video encoder 219 encodes the supplied analog signal into video data in a format that can be displayed on the display unit 220. The display unit 220 is configured by, for example, an LCD (Liquid Crystal Display) and displays the video signal supplied from the video encoder 219.

コーデック処理部221は、例えば、MPEG(Moving Picture Coding Experts Group/Moving Picture Experts Group)などの、デジタルビデオデータの圧縮または伸張アルゴリズムによる処理を実行する。メモリ222は、例えば、半導体メモリ、磁気ディスク、光磁気ディスク、または、光ディスクなどにより構成され、CPU223の制御に基づいて、供給されたデータを記憶したり、または、記憶しているデータを出力する。なお、メモリ222は、デジタルカメラ201に対して着脱可能なようになされていても良い。   The codec processing unit 221 performs processing by digital video data compression or expansion algorithm such as MPEG (Moving Picture Coding Experts Group / Moving Picture Experts Group), for example. The memory 222 is configured by, for example, a semiconductor memory, a magnetic disk, a magneto-optical disk, or an optical disk, and stores supplied data or outputs stored data based on control of the CPU 223. . Note that the memory 222 may be detachable from the digital camera 201.

CPU223は、バス225を介して、操作入力部224から供給されたユーザの操作入力を基に、デジタルカメラ201の各部を制御する。操作入力部224は、録画を指令する場合のボタンをはじめとして、例えば、ジョグダイヤル、キー、レバー、ボタン、またはタッチパネルなどにより構成され、ユーザによる操作入力を受ける。   The CPU 223 controls each unit of the digital camera 201 based on a user operation input supplied from the operation input unit 224 via the bus 225. The operation input unit 224 includes, for example, a jog dial, a key, a lever, a button, or a touch panel as well as a button for instructing recording, and receives an operation input by a user.

レンズ211および絞り212を介して入力された光は、CCDイメージセンサ213に入射され、受光素子での光電変換によって電気信号に変換され、相関2重サンプリング回路214に供給される。相関2重サンプリング回路214は、CCDイメージセンサ213の出力の各画素信号のうち、映像信号期間をサンプリングしたものと、基準期間をサンプリングしたものとを引き算することによりノイズを除去し、A/Dコンバータ215に供給する。A/Dコンバータ215は、供給されたノイズ除去後のアナログ信号をデジタル信号に変換し、DSPブロック216の画像用RAMに一時格納する。   Light input through the lens 211 and the diaphragm 212 is incident on the CCD image sensor 213, converted into an electrical signal by photoelectric conversion at the light receiving element, and supplied to the correlated double sampling circuit 214. The correlated double sampling circuit 214 removes noise by subtracting the sampled video signal period and the sampled reference period from the pixel signals output from the CCD image sensor 213, and A / D This is supplied to the converter 215. The A / D converter 215 converts the supplied analog signal after noise removal into a digital signal, and temporarily stores it in the image RAM of the DSP block 216.

タイミングジェネレータ217は、撮像中の状態において、一定のフレームレートによる画像取り込みを維持するように、CCDイメージセンサ213、相関2重サンプリング回路214、A/Dコンバータ215、および、DSPブロック216を制御する。   The timing generator 217 controls the CCD image sensor 213, the correlated double sampling circuit 214, the A / D converter 215, and the DSP block 216 so as to maintain image capture at a constant frame rate during imaging. .

DSPブロック216は、一定のレートで画素のストリームデータの供給を受け、画像用RAMに一時格納し、信号処理用プロセッサにおいて、一時格納された画像データに対して、後述する画像処理を実行する。DSPブロック216は、画像処理の終了後、CPU223の制御に基づいて、その画像データを表示部220に表示させる場合は、D/Aコンバータ218に、メモリ222に記憶させる場合は、コーデック処理部221に画像データを供給する。   The DSP block 216 receives supply of pixel stream data at a constant rate, temporarily stores it in the image RAM, and executes image processing (to be described later) on the temporarily stored image data in the signal processing processor. When the image block is displayed on the display unit 220 after the image processing is completed, the DSP block 216 displays the code data in the D / A converter 218 and the codec processing unit 221 in the case where the image data is stored in the memory 222. Supply image data.

D/Aコンバータ218は、DSPブロック216から供給されたデジタルの画像データをアナログ信号に変換し、ビデオエンコーダ219に供給する。ビデオエンコーダ219は、供給されたアナログの画像信号を、ビデオ信号に変換し、表示部220に出力して表示させる。すなわち、表示部220は、デジタルカメラ201において、カメラのファインダの役割を担っている。コーデック処理部221は、DSPブロック216から供給された画像データに対して、所定の方式の符号化を施し、符号化された画像データをメモリ222に供給して記憶させる。   The D / A converter 218 converts the digital image data supplied from the DSP block 216 into an analog signal and supplies the analog signal to the video encoder 219. The video encoder 219 converts the supplied analog image signal into a video signal, and outputs the video signal to the display unit 220 for display. That is, the display unit 220 plays the role of a camera finder in the digital camera 201. The codec processing unit 221 performs a predetermined encoding on the image data supplied from the DSP block 216 and supplies the encoded image data to the memory 222 for storage.

また、コーデック処理部221は、操作入力部224からユーザの操作入力を受けたCPU223の制御に基づいて、メモリ222に記憶されているデータのうち、ユーザに指定されたデータを読み取り、所定の復号方法で復号し、復号した信号をDSPブロック216に出力する。これにより、復号された信号が、DSPブロック216を介してD/Aコンバータ218に供給され、アナログ変換された後、ビデオエンコーダ219によりエンコードされて、表示部220に表示される。   Further, the codec processing unit 221 reads data designated by the user from among the data stored in the memory 222 based on the control of the CPU 223 that has received the user's operation input from the operation input unit 224, and performs predetermined decoding. The decoded signal is output to the DSP block 216. Thus, the decoded signal is supplied to the D / A converter 218 via the DSP block 216, converted into an analog signal, encoded by the video encoder 219, and displayed on the display unit 220.

ところで、図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 CCD image sensor 213 in FIG. 2 normally uses three or four kinds of colors, and these on-chip color filters have different colors alternately for each light receiving element. They are arranged in a mosaic. In the present invention, four colors obtained by adding a color (hereinafter referred to as E (Emerald)) that has a spectral characteristic close to G to three colors of RGB (Red, Green, Blue). An on-chip color filter with an array of is used. An example of this four-color mosaic arrangement is shown in FIG. In the present specification, the fourth color having spectral characteristics close to G is E, but this color is not limited to Emerald, and any color may be used as long as the spectral characteristics are close to G.

図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 CCD image sensor 213, the image temporarily stored in the image RAM of the DSP block 216 is stored in each pixel. Both have only one color of R, G, B, and E. Therefore, the signal processing processor of the DSP block 216 processes this image by using an image processing program or hardware incorporated in advance, and generates image data having data of all colors in all pixels. Specifically, the signal processing processor of the DSP block 216 first generates a new color (hereinafter referred to as G + E) by combining G and E for all pixels, and G is set to all pixels in the three-color Bayer array. The interpolation method based on the premise of being aligned is also applicable to the mosaic arrangement of four colors.

図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 DSP block 216 includes the image RAM 241 and the signal processor 242. The signal processor 242 includes the white balance adjustment unit 251, the gamma correction unit 252, the demosaic processing unit 253, and the YC conversion. Part 254.

A/Dコンバータ215によってデジタル信号に変換されたモザイク画像は、画像用RAM241に一時保存される。モザイク画像は、各画素にR,G,BまたはEのいずれかの色に対応する強度信号、すなわち、CCDイメージセンサ213に用いられているカラーフィルタにより定められる配列(例えば、図3を用いて説明した4色のモザイク配列)の周期的なパターンの強度信号により構成されている。   The mosaic image converted into a digital signal by the A / D converter 215 is temporarily stored in the image RAM 241. The mosaic image is an intensity signal corresponding to any color of R, G, B, or E for each pixel, that is, an array defined by a color filter used in the CCD image sensor 213 (for example, using FIG. 3). This is composed of periodic pattern intensity signals of the four-color mosaic arrangement described.

ホワイトバランス調整部251は、モザイク画像に対して、無彩色の被写体領域の色バランスが無彩色になるように、各画素強度の持つ色に応じて適切な係数をかける処理(ホワイトバランスの調整処理)を実行する。ガンマ補正部252は、ホワイトバランスが調整されたモザイク画像の各画素強度に対して、ガンマ補正を行う。画像の階調の応答特性を表すために「ガンマ(γ)」という数値が使われる。ガンマ補正とは、表示部220に表示される画像の明るさや色の彩度を正しく表示するための補正処理のことである。表示部220に出力される信号は、画素ごとに特定の電圧を加えることで、画像の明るさや色が再現されるようになされている。しかしながら、実際に表示される画像の明るさや色は、表示部220が有する特性(ガンマ値)により、入力電圧を倍にしてもブラウン管の明るさが倍になるわけではない(非線形性を有する)ため、ガンマ補正部252において、表示部220に表示される画像の明るさや色の彩度が正しく表示されるように補正する処理が施される。   The white balance adjustment unit 251 performs processing (white balance adjustment processing) for applying an appropriate coefficient to the mosaic image according to the color of each pixel intensity so that the color balance of the achromatic subject region becomes an achromatic color. ). The gamma correction unit 252 performs gamma correction on each pixel intensity of the mosaic image whose white balance has been adjusted. A numerical value “gamma (γ)” is used to represent the response characteristics of the gradation of the image. The gamma correction is a correction process for correctly displaying the brightness and color saturation of the image displayed on the display unit 220. The signal output to the display unit 220 reproduces the brightness and color of the image by applying a specific voltage for each pixel. However, due to the characteristics (gamma value) of the display unit 220, the brightness and color of the actually displayed image does not double the brightness of the CRT even if the input voltage is doubled (has non-linearity). For this reason, the gamma correction unit 252 performs a correction process so that the brightness and color saturation of the image displayed on the display unit 220 are correctly displayed.

デモザイク処理部253は、色分布形状を統計的に算出することにより、ガンマ補正がなされたモザイク画像の各画素位置にR,G,B,Eの4色の強度を揃えるデモザイク処理を実行する。したがって、デモザイク処理部253からの出力信号は、R,G,B,Eの4つの色に対応する4つの画像信号となる。YC変換部254はR,G,B,Eの4チャネル画像に、マトリックス処理およびクロマ成分に対する帯域制限を行うことで、Y画像およびC画像(YCbCr画像信号)を生成し、出力する。   The demosaic processing unit 253 statistically calculates the color distribution shape, thereby executing demosaic processing for aligning the intensity of the four colors R, G, B, and E at each pixel position of the mosaic image subjected to gamma correction. Therefore, the output signals from the demosaic processing unit 253 are four image signals corresponding to the four colors R, G, B, and E. The YC conversion unit 254 generates and outputs a Y image and a C image (YCbCr image signal) by subjecting the four-channel image of R, G, B, and E to matrix processing and band limitation for chroma components.

DSPブロック216の信号処理用プロセッサ242においては、デモザイク処理部253によるデモザイク処理の前に、ガンマ補正部252によりガンマ補正を行うものとしている。これは、ガンマ補正された非線形な画素強度空間においてデモザイク演算を実行することにより、デモザイク処理部253のデモザイク処理の信頼性をより高めることができるためである。   In the signal processing processor 242 of the DSP block 216, the gamma correction unit 252 performs gamma correction before the demosaic processing by the demosaic processing unit 253. This is because the reliability of the demosaic processing of the demosaic processing unit 253 can be further improved by executing the demosaic operation in the non-linear pixel intensity space subjected to the gamma correction.

例えば、入力される画像が高コントラストな輪郭領域である場合、その色分布は、非常に明るい強度域と非常に暗い強度域に渡ってしまう。物理的に、物体反射光は、物体表面のばらつきに照明からの入射光強度が乗じられたものになることから、カメラへの入射光強度に比例する線形な画素強度空間においては、明るい強度域にある物体色の分布はスパースに(まばらに)広がり、暗い画素強度域にある物体色の分布はあまり広がらずにコンパクトに縮まる傾向にある。   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 demosaic processing unit 253, demosaic processing is executed by statistically calculating the color distribution shape. However, in the high-contrast contour region, the pixel intensity variation in the bright region and the pixel intensity variation in the dark region are greatly different, and it becomes difficult to apply statistical linear regression. Therefore, prior to demosaic processing in the demosaic processing unit 253, the input data is subjected to non-linear pixel intensity conversion such as gamma correction to raise the dark pixel intensity region (close to the bright pixel intensity region). ) By suppressing the dispersion of the pixel intensity to some extent, the reliability of the linear regression processing executed in the demosaic processing unit 253 can be improved.

このような目的で適用する非線形変換は、ガンマ補正のように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 demosaic processing unit 253. FIG.

デモザイク処理部253には、局所領域抽出部281、G+E算出処理部282、および画素値補間部283が設けられている。局所領域抽出部281は、ガンマ補正されたモザイク画像から、注目画素位置周囲の決まった大きさの局所領域の画素を切り出す。ここでは、切り出す局所領域を、注目画素位置を中心とした7×7画素の矩形領域とする。G+E算出処理部282は、局所領域内に存在する画素を用いて、注目画素位置におけるG+Eを算出する。画素値補間部283は、G+Eを用いて、全画素にRGBEの4色を補間する。   The demosaic processing unit 253 is provided with a local region extraction unit 281, a G + E calculation processing unit 282, and a pixel value interpolation unit 283. The local area extraction unit 281 cuts out a pixel of a local area having a predetermined size around the target pixel position from the gamma-corrected mosaic image. Here, the local region to be cut out is a 7 × 7 pixel rectangular region centered on the target pixel position. The G + E calculation processing unit 282 calculates G + E at the target pixel position using the pixels existing in the local region. The pixel value interpolation unit 283 interpolates four colors of RGBE for all pixels using G + E.

図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 calculation processing unit 282 of FIG. The G + E calculation processing unit 282 includes a G interpolation processing unit 331-1, an E interpolation processing unit 331-2, a G interpolation processing unit 332-1, an E interpolation processing unit 332-2, a G interpolation processing unit 333-1, and an E interpolation process. 333-2, texture intensity calculation processing unit 334, G + E generation processing unit 335, G + E generation processing unit 336, and composition processing unit 337. In this configuration, G + E is generated on R pixels using R, G, and E signals on the mosaic. Here, regression estimation is used to estimate the color component.

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 calculation processing unit 334 uses the interpolation values GA and EA obtained by the G interpolation processing unit 331-1 and the E interpolation processing unit 331-2 to use the texture strength T H (change strength in the horizontal direction of the R pixel position). ) And the texture intensity T V (change intensity) in the vertical direction. The G interpolation processing unit 332-1 calculates the second interpolation value GF of G using the horizontal neighboring interpolation value GA and the signal R, and the E interpolation processing unit 332-2 calculates the vertical neighboring interpolation value EA. And the second interpolation value EF of E is calculated using the signal R. The G interpolation processing unit 333-1 uses the interpolation values GA, EA, and EF to use the third interpolation value GU of G, and the E interpolation processing unit 333-2 uses the interpolation values GA, EA, and GF. A third interpolation value EU of E is calculated at the R pixel position.

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 generation processing unit 335 calculates (G + E) V by combining the interpolation values GU and EF, and the G + E generation processing unit 336 calculates (G + E) H by combining the interpolation values GF and EU. The composition processing unit 337 determines the signal G + E at the R pixel position by using two G + E values, that is, (G + E) V and (G + E) H and the texture intensities T H and T V.

以上の説明では、モザイク上の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 DSP block 216 in FIG. 4 will be described with reference to the flowchart in FIG.

ステップS1において、画像用RAM241は、CCDイメージセンサ213に用いられているカラーフィルタにより定められる配列(例えば、図3を用いて説明した4色配列)の周期的なパターンの強度信号により構成されるモザイク画像を取得して、一時保存する。   In step S1, the image RAM 241 is composed of periodic pattern intensity signals in an array (for example, the four-color array described with reference to FIG. 3) determined by the color filter used in the CCD image sensor 213. Obtain a mosaic image and save it temporarily.

ステップS2において、信号処理用プロセッサ242のホワイトバランス調整部251は、モザイク画像に対して、無彩色の被写体領域の色バランスが無彩色になるように、各画素強度の持つ色に応じて適切な係数をかける処理であるホワイトバランス調整処理を行う。   In step S2, the white balance adjustment unit 251 of the signal processing processor 242 applies an appropriate color according to the color of each pixel intensity so that the color balance of the achromatic subject region is achromatic with respect to the mosaic image. A white balance adjustment process, which is a process for applying a coefficient, is performed.

ステップS3において、ガンマ補正部252は、ホワイトバランスがとられたモザイク画像の各画素強度に対し、表示部220に表示される画像の明るさや色の彩度が正しく表示されるようにガンマ補正を行う。   In step S <b> 3, the gamma correction unit 252 performs gamma correction so that the brightness and color saturation of the image displayed on the display unit 220 are correctly displayed for each pixel intensity of the mosaic image with white balance. Do.

ステップS4において、デモザイク処理部253により、図8を用いて後述するデモザイク処理が実行される。   In step S4, the demosaic processing unit 253 performs a demosaic process described later with reference to FIG.

YC変換部254は、ステップS5において、デモザイク処理部253からの出力であるR,G,B,Eの4チャネル画像に、マトリックス処理およびクロマ成分に対する帯域制限をおこなうことで、YC変換を行い、Y画像およびC画像を生成し、ステップS6において、生成したY画像およびC画像を出力し、処理が終了される。   In step S5, the YC conversion unit 254 performs YC conversion by performing band limitation on the matrix processing and chroma components on the R, G, B, and E four-channel images that are output from the demosaic processing unit 253, A Y image and a C image are generated, and in step S6, the generated Y image and C image are output, and the process ends.

このような処理により、DSPブロック216は、供給されたモザイク画像信号に対して、各種処理を施して、Y画像およびC画像を生成し、CPU223の制御に基づいて、その画像データを表示部220に表示させる場合は、D/Aコンバータ218に、メモリ222に記憶させる場合は、コーデック処理部221に供給する。   Through such processing, the DSP block 216 performs various processing on the supplied mosaic image signal to generate a Y image and a C image, and displays the image data on the display unit 220 based on the control of the CPU 223. Is displayed in the D / A converter 218 and is stored in the memory 222, and is supplied to the codec processing unit 221.

次に、図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 region extraction unit 281 sets one of the unprocessed pixels as a target pixel, and in step S22, selects a predetermined number of pixels around the target pixel position (the pixel region required for the subsequent processing). A sufficient number of pixels) are extracted as local regions and supplied to the G + E calculation processing unit 282 and the pixel value interpolation unit 283.

ステップS23において、G+E算出処理部282は、図9のフローチャートを用いて後述する、G+E算出処理を実行し、算出したG+Eを画素値補間部283に供給する。   In step S <b> 23, the G + E calculation processing unit 282 executes G + E calculation processing, which will be described later using the flowchart of FIG. 9, and supplies the calculated G + E to the pixel value interpolation unit 283.

ステップS24において、画素値補間部283は、G+Eを用いて、各色の画素値を補間する。   In step S24, the pixel value interpolation unit 283 interpolates the pixel values of each color using G + E.

ステップS25において、局所領域抽出部281は、全ての画素において処理が終了したか否かを判断する。ステップS25において、全ての画素において処理が終了していないと判断された場合、処理は、ステップS21に戻り、それ以降の処理が繰り返される。ステップS25において、全ての画素において処理が終了したと判断された場合、処理は図7のステップS5に進む。   In step S25, the local region extraction unit 281 determines whether or not processing has been completed for all pixels. If it is determined in step S25 that the process has not been completed for all pixels, the process returns to step S21, and the subsequent processes are repeated. If it is determined in step S25 that the process has been completed for all pixels, the process proceeds to step S5 in FIG.

換言すれば、デモザイク処理部253を構成する各部は、ある注目画素位置が決定されたときにその注目画素位置においてそれぞれの処理を実行し、全画素において、ステップS21乃至ステップS24の処理が終了された場合、処理が終了される。   In other words, each unit constituting the demosaic processing unit 253 executes the respective processes at the target pixel position when a certain target pixel position is determined, and the processes of steps S21 to S24 are completed for all the pixels. If so, the process is terminated.

次に、図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 calculation processing unit 282 in FIG.

ステップ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 calculation processing unit 334 executes a corrected texture strength calculation process. Details of this will be described later with reference to FIG.

ステップ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 generation processing unit 335 executes a first G + E generation process. Details of this will be described later with reference to FIG.

ステップS59において、G+E生成処理部336は、第2のG+E生成処理を実行する。この詳細は、図35を参照して後述する。   In step S59, the G + E generation processing unit 336 executes a second G + E generation process. Details of this will be described later with reference to FIG.

ステップS60において、合成処理部337は、合成処理を実行する。この詳細は、図36を参照して後述する。   In step S60, the composition processing unit 337 executes composition processing. Details of this will be described later with reference to FIG.

図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 = −n + 1. In step S102, the value k of the second register indicating the pixel position to be processed in the local area is initialized to k = −n + 1. Here, processing is performed on a pixel group of (2n−1) × (2n−1) with the pixel (0, 0) as the center. Note that n is a positive integer, and (j, k) indicates a pixel position where the process is executed when the center (target pixel position) in the local region is (0, 0). Note that the value of n can be considered as an arbitrary constant required for processing. Therefore, when this embodiment is implemented, such detailed setting of register values can be omitted. In particular, if n is a sufficiently large value, it is considered that substantially the same result can be obtained. The same applies to n ′, n ″, and n ″ ″ described later.

ステップ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 = j + 1. Then, the process returns to step S102, and the subsequent processes are repeated.

ステップ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 calculation processing unit 334 in FIG.

ステップS151においてテクスチャ強度算出処理部334は、テクスチャ強度TH,TV算出処理を実行する。この処理の詳細は、図13を参照して後述する。 Texture intensity calculation processing unit 334 at step S151 executes the texture strength T H, the T V calculation process. Details of this processing will be described later with reference to FIG.

ステップS152においてテクスチャ強度算出処理部334は、重み付き平均値MTH算出処理を実行する。この処理の詳細は、図14を参照して後述する。 In step S152, the texture intensity calculation processing unit 334 executes a weighted average value M TH calculation process. Details of this processing will be described later with reference to FIG.

ステップS153においてテクスチャ強度算出処理部334は、重み付き平均偏差STH算出処理を実行する。この処理の詳細は、図16を参照して後述する。 In step S153, the texture intensity calculation processing unit 334 executes a weighted average deviation STH calculation process. Details of this processing will be described later with reference to FIG.

ステップS154においてテクスチャ強度算出処理部334は、テクスチャ強度TH,TV補正処理を実行する。この処理の詳細は、図17を参照して後述する。その後、処理は図9のステップS54に進む。 Texture intensity calculation processing unit 334 at step S154 executes the texture strength T H, the T V correction process. Details of this processing will be described later with reference to FIG. Thereafter, the processing proceeds to step S54 in FIG.

図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 calculation processing unit 334 initializes the value j ′ of the first register indicating the pixel position where the processing is performed among the pixels of the supplied local region to j ′ = − n ′, In step S202, among the supplied pixels in the local region, the value k ′ of the second register indicating the pixel position for executing the process is initialized to k ′ = − n ′. 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).

ステップS203において、テクスチャ強度算出処理部334は、式(1)を用いて横勾配評価値dHを算出するとともに、式(2)を用いて縦勾配評価値dVを算出する。すなわち、テクスチャ強度算出処理部334は、各画素位置でGA+EAを計算し、注目画素位置とその左右の間で減算を行って得られた横方向のグラディエント値の絶対値の和を横勾配評価値dHとして算出するとともに、注目画素位置とその上下の間で減算を行って得られた縦方向のグラディエント値の絶対値の和を縦勾配評価値dVとして算出する。   In step S203, the texture intensity calculation processing unit 334 calculates the lateral gradient evaluation value dH using the equation (1), and calculates the vertical gradient evaluation value dV using the equation (2). That is, the texture intensity calculation processing unit 334 calculates GA + EA at each pixel position, and calculates the sum of the absolute values of the gradient values in the horizontal direction obtained by performing subtraction between the target pixel position and the left and right sides thereof as the lateral gradient evaluation value. While calculating as dH, the sum of absolute values of the gradient values in the vertical direction obtained by performing subtraction between the target pixel position and the upper and lower sides thereof is calculated as the vertical gradient evaluation value dV.

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 calculation processing unit 334 determines whether or not the lateral gradient evaluation value dH> the vertical gradient evaluation value dV. If it is determined that dH> dV, the texture strength calculation processing unit in step S205. 334 sets the texture intensity T H of the pixel (j ′, k ′) to 0 and the texture intensity T V of the pixel (j ′, k ′) to 1.

ステップ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-calculation processing unit 334 in step S206, the texture-intensity T H of the pixel (j ', k') as a 1, the pixel of the (j ', k') the texture strength T V to 0.

ステップ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 calculation processing unit 334 refers to the value k ′ of the second register and determines whether k ′ = n ′. . When it is determined in step S207 that k ′ = n ′ is not satisfied, in step S208, the texture strength calculation processing unit 334 updates the value k ′ of the second register to k ′ = k ′ + 1, and the processing is performed in step S207. Returning to S203, the subsequent processing is repeated.

ステップ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 calculation processing unit 334 refers to the value j ′ of the first register indicating the pixel position where the process is performed, and j It is determined whether or not “= n”. If it is determined in step S209 that j ′ = n ′ is not satisfied, the texture intensity calculation processing unit 334 updates the value j ′ of the first register to j ′ = j ′ + 1 in step S210, and the processing is performed in step S210. Returning to S202, the subsequent processing is repeated.

ステップ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 calculation processing unit 334 in step S211 sets the texture intensity T H and T V of (2n ′ + 1) × (2n ′ + 1) pixels. And the process proceeds to step S152 of FIG.

図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 calculation processing unit 334 in FIG.

ステップS251において、テクスチャ強度算出処理部334は、重み付き平均値MTHを0に初期化する。 In step S251, the texture intensity calculation processing unit 334 initializes the weighted average value M TH to 0.

ステップS252において、テクスチャ強度算出処理部334は、テクスチャ強度THを取得する。このテクスチャ強度THは、上述した図13の処理により算出された値である。 In step S252, the texture-intensity-calculation processing unit 334 obtains a texture intensity T H. This texture strength TH is a value calculated by the above-described processing of FIG.

ステップS253において、テクスチャ強度算出処理部334は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’を初期化してj’=−n’とし、ステップS254において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’を初期化してk’=−n’とする。   In step S253, the texture intensity calculation processing unit 334 initializes the value j ′ of the first register indicating the pixel position where the processing is performed among the pixels of the supplied local region to j ′ = − n ′, In step S254, among the pixels in the supplied local region, the value k ′ of the second register indicating the pixel position where the process is executed is initialized to k ′ = − n ′.

ステップS255において、テクスチャ強度算出処理部334は、MTH=MTH+(重み係数wiが施された画素(j',k')のテクスチャ強度TH)とする。すなわち、MTHに重み付けが施された画素(j',k')のテクスチャ強度THを加算したものが新たなMTHとされる。 In step S255, the texture intensity calculation processing unit 334 sets M TH = M TH + (texture intensity T H of the pixel (j ′, k ′) to which the weight coefficient wi is applied). That is, the pixel weighted is applied to the M TH (j ', k' ) obtained by adding a texture intensity T H of is the new M TH.

この重み係数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 calculation processing unit 334 refers to the value k ′ of the second register and determines whether k ′ = n ′. If it is determined in step S256 that k ′ = n ′ is not satisfied, in step S257, the texture intensity calculation processing unit 334 updates the value k ′ of the second register to k ′ = k ′ + 1, and the processing is performed. Returning to step S255, the subsequent processing is repeated.

ステップ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 calculation processing unit 334 refers to the value j ′ of the first register indicating the pixel position where the processing is performed, and j It is determined whether or not “= n”. If it is determined in step S258 that j ′ = n ′ is not satisfied, the texture intensity calculation processing unit 334 updates the value j ′ of the first register to j ′ = j ′ + 1 in step S259, and the processing is performed in step S259. Returning to S254, the subsequent processing is repeated.

ステップS258において、j’=n’であると判定された場合、ステップS260において、テクスチャ強度算出処理部334は、MTH=MTH/Wとする。このWは、重み係数wiの総和Wとされる。 If it is determined in step S258 that j ′ = n ′, the texture intensity calculation processing unit 334 sets M TH = M TH / W in step S260. This W is the total sum W of the weighting factors wi.

ステップS261においてテクスチャ強度算出処理部334は、テクスチャ強度THの重み付き平均値MTHを出力し、処理は図12のステップS153に進む。 In step S261, the texture intensity calculation processing unit 334 outputs the weighted average value M TH of the texture intensity T H , and the process proceeds to step S153 in FIG.

図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 calculation processing unit 334 in FIG.

ステップS301において、テクスチャ強度算出処理部334は、重み付き平均偏差STHを0に初期化する。 In step S301, the texture intensity calculation processing unit 334 initializes the weighted average deviation STH to 0.

ステップS302において、テクスチャ強度算出処理部334は、テクスチャ強度THを取得する。このテクスチャ強度THは、上述した図13の処理により算出された値である。 In step S302, the texture-intensity-calculation processing unit 334 obtains a texture intensity T H. This texture strength TH is a value calculated by the above-described processing of FIG.

ステップS303において、テクスチャ強度算出処理部334は、重み付き平均値MTHを取得する。この重み付き平均値MTHは、上述した図14の処理により算出された値である。 In step S303, the texture intensity calculation processing unit 334 acquires the weighted average value M TH . This weighted average value M TH is a value calculated by the processing of FIG. 14 described above.

ステップS304において、テクスチャ強度算出処理部334は、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値j’を初期化してj’=−n’とし、ステップS305において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値k’を初期化してk’=−n’とする。   In step S304, the texture intensity calculation processing unit 334 initializes the value j ′ of the first register indicating the pixel position where the process is performed among the pixels of the supplied local region to j ′ = − n ′, In step S305, the value k ′ of the second register indicating the pixel position to be processed among the supplied pixels in the local region is initialized to k ′ = − n ′.

ステップ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 calculation processing unit 334 sets STH = STH + texture intensity T H of pixel (j ′, k ′) − (M TH ) | That is, the pixel (j ', k') to a value obtained by weighting taking the absolute value of the value obtained by subtracting the weighted average M TH from the texture strength T H of, those obtained by adding the S TH is a new S TH . This texture strength TH is calculated by the above-described processing of FIG. This weight coefficient wi is the same as the weight coefficient wi in FIG. 14 described above.

ステップS307において、テクスチャ強度算出処理部334は、第2のレジスタの値k’を参照し、k’=n’であるか否かを判定する。ステップS307において、k’=n’でないと判定された場合、ステップS308において、テクスチャ強度算出処理部334は、第2のレジスタの値k’をk’=k’+1に更新して、処理はステップS306に戻り、それ以降の処理が繰り返される。   In step S307, the texture intensity calculation processing unit 334 refers to the value k ′ of the second register and determines whether k ′ = n ′. If it is determined in step S307 that k ′ = n ′ is not satisfied, in step S308, the texture intensity calculation processing unit 334 updates the value k ′ of the second register to k ′ = k ′ + 1, and the processing is performed. Returning to step S306, the subsequent processing is repeated.

ステップ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 calculation processing unit 334 refers to the value j ′ of the first register indicating the pixel position where the process is performed, and j It is determined whether or not “= n”. If it is determined in step S309 that j ′ = n ′ is not satisfied, the texture strength calculation processing unit 334 updates the value j ′ of the first register to j ′ = j ′ + 1 in step S310, and the processing is performed in step S309. Returning to S305, the subsequent processing is repeated.

ステップ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 calculation processing unit 334 sets S TH = S TH / W. This W is the total sum W of the weighting factors wi as in the above-described processing of FIG.

ステップS312においてテクスチャ強度算出処理部334は、重み付き平均偏差STHを出力し、処理は図12のステップS154に進む。 In step S312, the texture intensity calculation processing unit 334 outputs the weighted average deviation STH , and the process proceeds to step S154 in FIG.

図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 calculation processing unit 334 in FIG.

ステップS351において、テクスチャ強度算出処理部334は、重み付き平均偏差STHを取得する。この重み付き平均偏差STHは上述した図16の処理で算出されたものである。 In step S351, the texture intensity calculation processing unit 334 acquires the weighted average deviation STH . This weighted average deviation S TH is calculated by the processing of FIG. 16 described above.

ステップS352において、テクスチャ強度算出処理部334は、RをSTH×(第1の定数)として算出する。この第1の定数は、例えば、経験的にまたは実験的に定められる所定の値である。 In step S352, the texture intensity calculation processing unit 334 calculates R as S TH × (first constant). This first constant is a predetermined value determined empirically or experimentally, for example.

ステップS353において、テクスチャ強度算出処理部334は、R>1であるか否かを判定し、R>1であると判定された場合、ステップS354においてR=1と設定する。   In step S353, the texture intensity calculation processing unit 334 determines whether or not R> 1, and if it is determined that R> 1, R = 1 is set in step S354.

ステップ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 calculation processing unit 334 sets T H = T H × (1−R) + R / 2, and T V = T V × (1−R) + R / 2. That is, the texture strengths T H and T V are corrected. Thereafter, the process in step S154 in FIG. 12 is terminated, and the process proceeds to step S54 in FIG.

図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).

Figure 2005160044
Figure 2005160044

しかしながら、式(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 generation processing unit 335 in FIG.

ステップS901において、G+E生成処理部335は、第3の補間処理により算出された注目画素位置のGの補間値GUを取得する。具体的には、図9のステップS56の処理で、G補間処理部333−1により算出されたGの補間値GU(図33の補間値XUに対応する値)が取得される。   In step S901, the G + E generation processing unit 335 acquires the G interpolation value GU at the target pixel position calculated by the third interpolation processing. Specifically, the G interpolation value GU (a value corresponding to the interpolation value XU in FIG. 33) calculated by the G interpolation processing unit 333-1 is acquired in the process of step S56 in FIG.

ステップS902において、G+E生成処理部335は、第2の補間処理により算出された注目画素位置のEの補間値EFを取得する。具体的には、図9のステップS55の処理で、E補間処理部332−2により算出されたEの補間値EF(図30の補間値XFに対応する値)が取得される。   In step S902, the G + E generation processing unit 335 acquires the interpolation value EF of E at the target pixel position calculated by the second interpolation process. Specifically, the E interpolation value EF calculated by the E interpolation processing unit 332-2 (a value corresponding to the interpolation value XF in FIG. 30) is acquired in the process of step S55 of FIG.

ステップS903において、G+E生成処理部335は、注目画素位置の(G+E)V=(注目画素位置のGU+注目画素位置のEF)/2とする。すなわち、注目画素位置のGUと注目画素位置のEFの平均値が注目画素位置の(G+E)Vとされる。 In step S903, the G + E generation processing unit 335 sets (G + E) V of the target pixel position = (GU of the target pixel position + EF of the target pixel position) / 2. That is, the average value of the GU at the target pixel position and the EF at the target pixel position is set to (G + E) V of the target pixel position.

ステップS904において、G+E生成処理部335は、注目画素位置の(G+E)Vを出力し、処理は図9のステップS59に進む。 In step S904, the G + E generation processing unit 335 outputs (G + E) V of the target pixel position, and the process proceeds to step S59 in FIG.

次に、図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 generation processing unit 336 in FIG.

ステップS951において、G+E生成処理部336は、第2の補間処理により算出された注目画素位置のGの補間値GFを取得する。具体的には、図9のステップS54の処理で、G補間処理部332−1により算出されたGの補間値GF(図30の補間値XFに対応する値)が取得される。   In step S951, the G + E generation processing unit 336 acquires the G interpolation value GF of the target pixel position calculated by the second interpolation process. Specifically, the G interpolation value GF (the value corresponding to the interpolation value XF in FIG. 30) calculated by the G interpolation processing unit 332-1 is acquired in the process of step S54 in FIG.

ステップS952において、G+E生成処理部336は、第3の補間処理により算出された注目画素位置のEの補間値EUを取得する。具体的には、図9のステップS57の処理で、E補間処理部333−2により算出されたEの補間値EU(図33の補間値XUに対応する値)が取得される。   In step S952, the G + E generation processing unit 336 acquires the interpolation value EU of E at the target pixel position calculated by the third interpolation process. Specifically, the E interpolation value EU (value corresponding to the interpolation value XU in FIG. 33) calculated by the E interpolation processing unit 333-2 is acquired in the process of step S57 in FIG.

ステップS953において、G+E生成処理部336は、注目画素位置の(G+E)H=(注目画素位置のGF+注目画素位置のEU)/2とする。すなわち、注目画素位置のGFと注目画素位置のEUの平均値が注目画素位置の(G+E)Hとされる。 In step S953, the G + E generation processing unit 336 sets (G + E) H = (GF of the target pixel position + EU of the target pixel position) / 2 of the target pixel position. That is, the average value of GF at the target pixel position and EU at the target pixel position is set to (G + E) H of the target pixel position.

ステップS954において、G+E生成処理部336は、注目画素位置の(G+E)Hを出力し、処理は図9のステップS60に進む。 In step S954, the G + E generation processing unit 336 outputs (G + E) H of the target pixel position, and the process proceeds to step S60 in FIG.

次に、図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 synthesis processing unit 337 in FIG.

ステップS1001において、合成処理部337は、第1のG+E生成処理により算出された注目画素位置の(G+E)Vを取得する。具体的には、図9のステップS58(図34)の処理で、G+E生成処理部335により算出された(G+E)Vが取得される。 In step S1001, the composition processing unit 337 acquires (G + E) V of the target pixel position calculated by the first G + E generation process. Specifically, (G + E) V calculated by the G + E generation processing unit 335 is acquired in the process of step S58 (FIG. 34) of FIG.

ステップS1002において、合成処理部337は、第2のG+E生成処理により算出された注目画素位置の(G+E)Hを取得する。具体的には、図9のステップS59(図35)の処理で、G+E生成処理部336により算出された(G+E)Hが取得される。 In step S1002, the composition processing unit 337 acquires (G + E) H of the target pixel position calculated by the second G + E generation process. Specifically, (G + E) H calculated by the G + E generation processing unit 336 is acquired in the process of step S59 (FIG. 35) of FIG.

ステップS1003において、合成処理部337は、補正テクスチャ強度算出処理により算出された、補正されたテクスチャ強度TH,TVを取得する。具体的には、図9のステップS53(図12)の処理で、テクスチャ強度算出処理部334により算出された補正されたテクスチャ強度TH,TVが取得される。 In step S1003, the synthesis processing unit 337 acquires the corrected texture strengths T H and T V calculated by the corrected texture strength calculation processing. Specifically, the corrected texture strengths T H and T V calculated by the texture strength calculation processing unit 334 are acquired in the process of step S53 (FIG. 12) of FIG.

ステップ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 composition processing unit 337 has (G + E) = (G + E) V × T H + target pixel position of the target pixel position = (G + E) (G + E) H × T V ).

ステップS1005において、合成処理部337は、注目画素位置の(G+E)を出力し、図9の処理は終了され、処理は、図8のステップS24に進む。   In step S1005, the composition processing unit 337 outputs (G + E) of the target pixel position, the processing in FIG. 9 is terminated, and the processing proceeds to step S24 in FIG.

なお、以上の例では、テクスチャ強度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 calculation processing unit 334 initializes the value j ′ of the first register indicating the pixel position where the process is executed among the pixels of the supplied local region to j ′ = − n ′, In step S1052, among the pixels in the supplied local region, the value k ′ of the second register indicating the pixel position for executing the process is initialized to k ′ = − n ′.

ステップS1053において、テクスチャ強度算出処理部334は、式(4)を用いて横勾配評価値dHを算出するとともに、式(5)を用いて縦勾配評価値dVを算出する。   In step S1053, the texture intensity calculation processing unit 334 calculates the lateral gradient evaluation value dH using Expression (4) and calculates the vertical gradient evaluation value dV using Expression (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)
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 DSP block 216. Further, for example, the demosaic processing unit 253 or the G + E calculation processing unit 282 can be configured by a personal computer 501 as shown in FIG.

図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 storage unit 518 to a RAM (Random Access Memory) 513. Execute. The RAM 513 also appropriately stores data necessary for the CPU 511 to execute various processes.

CPU511、ROM512、およびRAM513は、バス514を介して相互に接続されている。このバス514にはまた、入出力インタフェース515も接続されている。   The CPU 511, ROM 512, and RAM 513 are connected to each other via a bus 514. An input / output interface 515 is also connected to the bus 514.

入出力インタフェース515には、キーボード、マウスなどよりなる入力部516、ディスプレイやスピーカなどよりなる出力部517、ハードディスクなどより構成される記憶部518、モデム、ターミナルアダプタなどより構成される通信部519が接続されている。通信部519は、インターネットを含むネットワークを介しての通信処理を行う。   The input / output interface 515 includes an input unit 516 including a keyboard and a mouse, an output unit 517 including a display and a speaker, a storage unit 518 including a hard disk, and a communication unit 519 including a modem and a terminal adapter. It is connected. A communication unit 519 performs communication processing via a network including the Internet.

入出力インタフェース515にはまた、必要に応じてドライブ520が接続され、磁気ディスク531、光ディスク532、光磁気ディスク533、もしくは、半導体メモリ534などが適宜装着され、それらから読み出されたコンピュータプログラムが、必要に応じて記憶部518にインストールされる。   A drive 520 is connected to the input / output interface 515 as necessary, and a magnetic disk 531, an optical disk 532, a magneto-optical disk 533, a semiconductor memory 534, or the like is appropriately mounted, and a computer program read from them is loaded. It is installed in the storage unit 518 as necessary.

一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェア(例えば、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 demosaic processing unit 253 or the G + E calculation processing unit 282 included therein). The computer is installed from a network or a recording medium, for example, a general-purpose personal computer capable of executing various functions by installing various computers or various programs.

この記録媒体は、図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 semiconductor memory 534, etc. In addition, the program is configured by a ROM 512 storing a program supplied to the user in a state of being incorporated in the apparatus main body in advance, a hard disk included in the storage unit 518, and the like.

なお、本明細書において、記録媒体に記憶されるプログラムを記述するステップは、含む順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的もしくは個別に実行される処理をも含むものである。   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.

ベイヤー配列について説明するための図である。It is a figure for demonstrating a Bayer arrangement | sequence. 本発明を適用したデジタルカメラの構成を示すブロック図である。It is a block diagram which shows the structure of the digital camera to which this invention is applied. CCDイメージセンサのオンチップカラーフィルタの4色のモザイク配列の例について説明するための図である。It is a figure for demonstrating the example of the mosaic arrangement | sequence of 4 colors of the on-chip color filter of a CCD image sensor. 図2のDSPブロックの構成を示すブロック図である。FIG. 3 is a block diagram illustrating a configuration of a DSP block in FIG. 2. 図4のデモザイク処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the demosaic process part of FIG. 図5のG+E算出処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the G + E calculation process part of FIG. 図4のDSPブロックが実行する画像処理について説明するためのフローチャートである。6 is a flowchart for explaining image processing executed by the DSP block of FIG. 4. デモザイク処理について説明するためのフローチャートである。It is a flowchart for demonstrating a demosaic process. G+E算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating a G + E calculation process. 第1の補間処理について説明するためのフローチャートである。It is a flowchart for demonstrating a 1st interpolation process. 第1の補間処理について説明するためのフローチャートである。It is a flowchart for demonstrating a 1st interpolation process. 補正テクスチャ強度算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating correction | amendment texture intensity | strength calculation processing. テクスチャ強度TH,TV算出処理1について説明するためのフローチャートである。It is a flow chart for the texture strength T H, the T V calculation process 1 will be described. 重み付き平均値MTH算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating a weighted average value MTH calculation process. 重み付け係数の例について説明するための図である。It is a figure for demonstrating the example of a weighting coefficient. 重み付き平均偏差STH算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating weighted average deviation STH calculation processing. テクスチャ強度TH,TV補正処理について説明するためのフローチャートである。It is a flowchart for explaining the texture strength T H, the T V correction process. 縦方向のサンプルを用いる場合の重み付けについて説明するための図である。It is a figure for demonstrating the weighting in the case of using the sample of a vertical direction. 横方向のサンプルを用いる場合の重み付けについて説明するための図である。It is a figure for demonstrating the weighting in the case of using a sample of a horizontal direction. 第2の補間処理について説明するためのフローチャートである。It is a flowchart for demonstrating a 2nd interpolation process. 重み付き平均値MYdirについて説明するためのフローチャートである。It is a flowchart for demonstrating the weighted average value MYdir . Rの重み付き分散近似値VARRdir算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating the weighted dispersion | distribution approximate value VA RRdir calculation process of R. R,XAの重み付き共分散近似計算処理について説明するためのフローチャートである。It is a flowchart for demonstrating the weighted covariance approximation calculation process of R and XA. pとqの積がとりうる領域について説明するための図である。It is a figure for demonstrating the area | region which the product of p and q can take. 積算近似処理を実行した場合にpqの近似値がとりうる領域について説明するための図である。It is a figure for demonstrating the area | region which the approximation value of pq can take when the integral approximation process is performed. 積算近似処理を実行した場合のpqの近似値の2乗誤差について説明するための図である。It is a figure for demonstrating the square error of the approximate value of pq at the time of performing an integral approximation process. 積算処理について説明するためのフローチャートである。It is a flowchart for demonstrating an integrating | accumulating process. 積算近似処理について説明するためのフローチャートである。It is a flowchart for demonstrating an integral approximation process. 回帰直線の傾きKdir算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating the inclination Kdir calculation process of a regression line. 回帰直線によるXの推定値XF算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating the estimated value XF calculation process of X by a regression line. 第3の補間処理について説明するためのフローチャートである。It is a flowchart for demonstrating a 3rd interpolation process. 重み付き平均値MXA算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating a weighted average value MXA calculation process. Xの補間値XU算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating the interpolation value XU calculation process of X. 第1のG+E生成処理について説明するためのフローチャートである。It is a flowchart for demonstrating a 1st G + E production | generation process. 第2のG+E生成処理について説明するためのフローチャートである。It is a flowchart for demonstrating a 2nd G + E production | generation process. 合成処理について説明するためのフローチャートである。。It is a flowchart for demonstrating a synthetic | combination process. . テクスチャ強度TH,TV算出処理2について説明するためのフローチャートである。It is a flowchart for explaining the texture strength T H, the T V calculation process 2. 4色のフィルタ配列にさらに2色追加した場合について説明するための図である。It is a figure for demonstrating the case where two more colors are added to the filter arrangement of four colors. パーソナルコンピュータの構成を示すブロック図である。It is a block diagram which shows the structure of a personal computer.

符号の説明Explanation of symbols

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の色成分が水平および垂直に1ラインおきに配置され、かつ、前記第1の色成分とは異なる水平および垂直ラインに配置されたカラーフィルタを用いた単板式カラー撮像素子により撮像されたモザイク画像に基づいて、各画素が複数の色成分を有するカラー画像を生成する画像処理装置において、
前記モザイク画像の注目画素、並びに前記注目画素の縦方向および横方向の近傍の画素に基づいて、前記注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出手段と、
前記注目画素と、前記注目画素の縦方向の近傍の画素に基づいて、前記第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の推定値算出手段は、
前記注目画素の近傍の画素の前記第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.
前記第1の色成分および前記第2の色成分は、互いに相関の高い分光感度を有する
ことを特徴とする請求項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ラインおきに配置されるとともに、第2の色成分が水平および垂直に1ラインおきに配置され、かつ、前記第1の色成分とは異なる水平および垂直ラインに配置されたカラーフィルタを用いた単板式カラー撮像素子により撮像されたモザイク画像に基づいて、各画素が複数の色成分を有するカラー画像を生成する画像処理装置の画像処理方法において、
前記モザイク画像の注目画素、並びに前記注目画素の縦方向および横方向の近傍の画素に基づいて、前記注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出ステップと、
前記注目画素と、前記注目画素の縦方向の近傍の画素に基づいて、前記第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ラインおきに配置されるとともに、第2の色成分が水平および垂直に1ラインおきに配置され、かつ、前記第1の色成分とは異なる水平および垂直ラインに配置されたカラーフィルタを用いた単板式カラー撮像素子により撮像されたモザイク画像に基づいて、各画素が複数の色成分を有するカラー画像を生成するプログラムであって、
前記モザイク画像の注目画素、並びに前記注目画素の縦方向および横方向の近傍の画素に基づいて、前記注目画素における縦方向の変化強度および横方向の変化強度を算出する変化強度算出ステップと、
前記注目画素と、前記注目画素の縦方向の近傍の画素に基づいて、前記第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.
JP2004309459A 2003-10-31 2004-10-25 Image processing apparatus, image processing method, and program Expired - Fee Related JP4449696B2 (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (12)

* Cited by examiner, † Cited by third party
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