JP2005151549A - Image processing device and method, and program - Google Patents

Image processing device and method, and program Download PDF

Info

Publication number
JP2005151549A
JP2005151549A JP2004307645A JP2004307645A JP2005151549A JP 2005151549 A JP2005151549 A JP 2005151549A JP 2004307645 A JP2004307645 A JP 2004307645A JP 2004307645 A JP2004307645 A JP 2004307645A JP 2005151549 A JP2005151549 A JP 2005151549A
Authority
JP
Japan
Prior art keywords
color
intensity
target
pixel
value
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
JP2004307645A
Other languages
Japanese (ja)
Other versions
JP4501070B2 (en
Inventor
Tomoo Mitsunaga
知生 光永
Nobukuni Nomura
宜邦 野村
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 JP2004307645A priority Critical patent/JP4501070B2/en
Publication of JP2005151549A publication Critical patent/JP2005151549A/en
Application granted granted Critical
Publication of JP4501070B2 publication Critical patent/JP4501070B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To improve the reproduction of the high frequency component of luminance, to reduce jaggyness, and to improve a feeling in resolution. <P>SOLUTION: A G strength estimating unit 291 is designed to calculate an estimation value of G strength at a remarkable pixel position by using a pixel in a local domain. An E strength estimating unit 292 is designed to calculate the estimation value of E strength at the remarkable pixel position by using the pixel in the local domain. A summing processing unit 293 is designed to sum the calculated G strength estimation value and the E strength estimation value, and to calculate a (G+E) strength estimation value at the remarkable pixel position. A high frequency image signal cannot be reproduced by only a G or E interpolation process in a mosaic picture by a color filter with primary 4 color arrangements in which signals of G and E exist only in every other one pixel. The generation of jaggyness and noise in an output image can be reduced and image signals having high frequencies higher than each limit thereof can be reproduced by reproducing such signals added with G and E signals and arranged at the position with one pixel shifted horizontally and vertically on all pixel positions. The present invention is applicable to a digital still camera. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、画像処理装置および画像処理方法、並びに、プログラムに関し、特に、カラー固体撮像素子を用いて得られたモザイク画像信号から、全画素に複数色を補間してカラー画像信号を獲得するデモザイク処理(色補間処理、または、同時化処理)が実行される場合に用いて好適な、画像処理装置および画像処理方法、並びに、プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program, and more particularly, a demosaic that obtains a color image signal by interpolating a plurality of colors into all pixels from a mosaic image signal obtained using a color solid-state imaging device. The present invention relates to an image processing apparatus, an image processing method, and a program suitable for use when processing (color interpolation processing or synchronization processing) is executed.

CCDイメージセンサやCMOSイメージセンサなどの固体撮像素子は、通常、受光素子が格子状に配置され、各受光素子の光電変換によって生じた電荷量を順次読み出すことができるような構造を有している。通常、これらの受光素子は、単一の分光特性を有するので、固体撮像素子から得られる画像信号は、色に関して1チャネル(単色)である。したがって、1つの固体撮像素子でカラー画像(例えばRGBなどの3チャネル画像)を得たい場合、受光素子ごとに分光特性(色)の異なるフィルタをつけた固体撮像素子を用いるようになされている。このような1つのカラー固体撮像素子を用いた撮像装置は、一般に単板カラー撮像装置と称される。   A solid-state imaging device such as a CCD image sensor or a CMOS image sensor usually has a structure in which light receiving elements are arranged in a lattice shape, and the amount of charge generated by photoelectric conversion of each light receiving element can be sequentially read out. . Usually, since these light receiving elements have a single spectral characteristic, the image signal obtained from the solid-state image sensor is one channel (monochrome) with respect to color. Therefore, when it is desired to obtain a color image (for example, a three-channel image such as RGB) with a single solid-state image sensor, a solid-state image sensor having filters with different spectral characteristics (colors) for each light-receiving element is used. An imaging apparatus using such a single color solid-state imaging device is generally called a single-plate color imaging apparatus.

カラー固体撮像素子から得られる画像信号は1チャネル画像なので、1画素ごとに得られるのは、対応する受光素子のフィルタの色の強度のみである。すなわち、カラー固体撮像素子から得られる画像信号は、色に関してモザイク状の画像となる。単板カラー撮像装置のカラー固体撮像素子の出力画像であるモザイク画像から、多チャネル画像を得るためには、適当な画像処理によって、モザイク画像の各画素の色情報を、その周囲の画素位置に補間することが必要である。このような画像処理は、一般に、色補間処理、デモザイク処理、または、同時化処理などと称される。このように、デモザイク処理は、カラー固体撮像素子を使った単板カラー撮像装置には必須の処理であり、従来からさまざまな技術が開発されてきた。   Since the image signal obtained from the color solid-state image sensor is a one-channel image, only the intensity of the color of the filter of the corresponding light receiving element is obtained for each pixel. That is, the image signal obtained from the color solid-state imaging device becomes a mosaic image with respect to color. In order to obtain a multi-channel image from a mosaic image that is an output image of a color solid-state imaging device of a single-plate color imaging device, the color information of each pixel of the mosaic image is converted to the surrounding pixel positions by appropriate image processing. It is necessary to interpolate. Such image processing is generally referred to as color interpolation processing, demosaic processing, or synchronization processing. As described above, the demosaic process is an essential process for a single-plate color image pickup apparatus using a color solid-state image pickup device, and various techniques have been developed.

このデモザイク処理において問題となるのが、高周波の画像信号の再現特性である。固体撮像素子においては、2次元格子状に配置された受光素子に、それぞれ異なるオンチップカラーフィルタが貼られているために、同じ色、すなわち、同じ分光感度を持つ画素は、本来の受光素子の配列ピッチよりも大きいピッチでしか配列されていない。そのため、カラー固体撮像素子は、オンチップカラーフィルタがない白黒の固体撮像素子と比較すると、撮像した画像にエイリアシングが発生しやすい。画像の輝度成分にエイリアシングが発生した場合、それは、しばしば被写体輪郭部におけるジャギネスとして観察される。デモザイク処理においては、ジャギネスをいかに抑制するかということが重要な課題である。   A problem in this demosaic processing is the reproduction characteristics of high-frequency image signals. In solid-state imaging devices, different on-chip color filters are attached to the light receiving elements arranged in a two-dimensional grid, so that pixels having the same color, that is, the same spectral sensitivity, are the same as the original light receiving elements. They are arranged only at a pitch larger than the arrangement pitch. Therefore, the color solid-state imaging device is likely to cause aliasing in the captured image as compared with a black and white solid-state imaging device having no on-chip color filter. When aliasing occurs in the luminance component of an image, it is often observed as jagginess in the subject outline. In demosaic processing, how to suppress Jugginess is an important issue.

現在最も広く用いられている色配列である原色系ベイヤー(Bayer)配列を図1に示す。ベイヤー配列では、R,G,Bの3つの原色系色フィルタを用い、Gを市松状に、RとBを線順次に配置するようになされている(以降、原色系ベイヤー配列を単にベイヤー配列と称する)。ベイヤー配列においては、Gは市松状に配置されるため、G信号は、水平、垂直の全位相において存在するが、RおよびBは線順次であるために、それぞれに対応する信号は、水平、垂直にそれぞれ1ラインおきにしか存在しない。   FIG. 1 shows a primary color Bayer array which is the most widely used color array at present. In the Bayer array, three primary color filters of R, G, and B are used, G is arranged in a checkered pattern, and R and B are line-sequentially arranged (hereinafter, the primary color Bayer array is simply referred to as Bayer array). Called). In the Bayer array, G is arranged in a checkered pattern, so that the G signal exists in all horizontal and vertical phases, but R and B are line sequential, so the corresponding signals are horizontal, There is only every other vertical line.

ベイヤー配列では、RGBのうち、人の視感度特性に最も近い分光特性を持つGが一番密に存在するので、従来用いられている技術によれば、もっぱらGの画素情報から輝度成分を作り出す方法が主流である。この方法の場合、再現される輝度成分の限界周波数はベイヤー配列のGのサンプリング周波数で決まり、水平および垂直方向には、0.5cycle/pixel、斜め45度方向には、1/(2×sqrt(2))cycle/pixelとなる。理論的には水平または垂直に最も限界が高いが、実際には水平・垂直方向には1画素おきにしかGが存在しないので、0.5cycle/pixelの水平または垂直の波を再現するには、水平または垂直それぞれの波に、最適な補間フィルタを適用する必要がある。この問題に対し、水平方向および垂直方向それぞれの波に最適な補間フィルタを準備し、画像上の各局所領域での波の方向を判別し、判別した結果に応じて水平方向の補間フィルタの結果と垂直方向の補間フィルタの結果を合成した値を補間値とする技術がある(例えば、特許文献1および非特許文献1)。これらの技術を用いることによって、ベイヤー配列のGの画素情報を用いて、水平および垂直方向に、理論的限界である0.5cycle/pixelに近い高周波の再現が可能となる。   In the Bayer array, G having the spectral characteristic closest to the human visual sensitivity characteristic among RGB is most closely present. Therefore, according to a conventionally used technique, a luminance component is generated exclusively from G pixel information. The method is mainstream. In this method, the limit frequency of the reproduced luminance component is determined by the sampling frequency of G in the Bayer array, 0.5 cycle / pixel in the horizontal and vertical directions, and 1 / (2 × sqrt in the oblique 45 degree direction. (2)) It will be cycle / pixel. Theoretically, the limit is the highest in the horizontal or vertical direction, but in reality there is only G in every other pixel in the horizontal and vertical directions, so to reproduce a horizontal or vertical wave of 0.5 cycle / pixel It is necessary to apply an optimum interpolation filter to each of the horizontal and vertical waves. To solve this problem, prepare an optimal interpolation filter for each horizontal and vertical wave, determine the direction of the wave in each local area on the image, and the result of the horizontal interpolation filter according to the determined result And a value obtained by synthesizing the result of the interpolation filter in the vertical direction is used as an interpolation value (for example, Patent Document 1 and Non-Patent Document 1). By using these techniques, it is possible to reproduce high frequencies close to the theoretical limit of 0.5 cycle / pixel in the horizontal and vertical directions using the G pixel information of the Bayer array.

特開平7−236147JP-A-7-236147

村田、森、前中、岡田および千原、“PS−CCDにおける相関判別色分離方式”、映像情報メディア学会誌、Vol.55,No.1,pp.120−132,2001Murata, Mori, Maenaka, Okada and Chihara, “Correlation Discrimination Color Separation Method in PS-CCD”, Journal of the Institute of Image Information and Television Engineers, Vol. 55, no. 1, pp. 120-132,2001

一方、カラー固体撮像素子に用いられるオンチップカラーフィルタの分光特性を人の視覚の等色関数に一致させることが原理的に不可能であることから、例えば、ベイヤー配列の3原色に対して、更に1色追加した4色の強度を得るようにした撮像素子を用い、更に、このような撮像素子により取得された4色の強度値にリニアマトリックスを適用することによって、3原色の強度値を得て、撮像装置の色再現を向上させる方法がある。例えば、4色の強度を得るために従来の3原色に黄色のオンチップフィルタを追加した4色配列を持つカラー固体撮像素子を用いて、色再現性を向上させることができる技術がある(例えば、特許文献2)。   On the other hand, since it is theoretically impossible to match the spectral characteristics of an on-chip color filter used in a color solid-state imaging device with a human color matching function, for example, for the three primary colors of the Bayer array, Furthermore, by using an image sensor that obtains the intensity of four colors obtained by adding one color, and by applying a linear matrix to the intensity values of the four colors acquired by such an image sensor, the intensity values of the three primary colors are obtained. Thus, there is a method for improving the color reproduction of the imaging apparatus. For example, there is a technique that can improve color reproducibility using a color solid-state imaging device having a four-color arrangement in which a yellow on-chip filter is added to the conventional three primary colors to obtain the intensity of four colors (for example, Patent Document 2).

特開2002−271804JP 2002-271804 A

しかしながら、4色配列のカラーフィルタを用いた従来技術においては、どのようなデモザイク処理を実行することによって、4色配列から各画素に同時化された4色強度を得ることができるかについては具体的に示されていなかった。   However, in the prior art using a color filter of a four-color array, what kind of demosaicing process can be performed to obtain a four-color intensity synchronized with each pixel from the four-color array is concrete. Was not shown.

補色系(シアン、マゼンタ、イエロー、グリーン)の4色配列は、従来からビデオカメラ等の撮像素子に用いられているが、これと同様に、原色系4色の色配列を有するカラーフィルタも実用化されている。従来の原色系4色の色配列では、ベイヤー配列のように全画素の半分をGに割り当てることができないため、市松状のG配列を利用して輝度成分の高周波を再現する従来技術は利用できなくなる。そのため、従来の原色系4色配列を用いると、色再現は向上するが、輝度の高周波成分を再現されずにジャギネスが顕著に現れるか、または平滑化されたような精彩のない画像になってしまう問題があった。   Complementary color systems (cyan, magenta, yellow, and green) have been used for image sensors such as video cameras, but color filters having primary color system colors are also practical. It has become. In the conventional color arrangement of the four primary colors, half of all pixels cannot be assigned to G as in the Bayer arrangement, so the conventional technique for reproducing the high frequency of the luminance component using the checkered G arrangement can be used. Disappear. For this reason, when the conventional primary color four-color arrangement is used, the color reproduction is improved, but the high-frequency component of the luminance is not reproduced, and the juginess appears remarkably or the image becomes smooth without smoothness. There was a problem.

本発明はこのような状況に鑑みてなされたものであり、原色系の4色以上の色で構成されている配列を用いる単板カラー撮像装置において、輝度の高域成分の再現を向上させ、ジャギネスを低減させるとともに、解像度感の向上を可能とするものである。   The present invention has been made in view of such a situation, and in a single-plate color imaging device using an array composed of four or more colors of primary colors, it is possible to improve reproduction of high frequency components of luminance, It is possible to reduce the jegginess and improve the resolution.

本発明の画像処理装置は、分光感度が異なる少なくとも4種類のフィルタを有し、複数種類のフィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する画像取得手段と、画像取得手段により取得されたモザイク画像から、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理手段とを備え、画像取得手段の画像センサの色フィルタ配列は、全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性(例えば比視感度曲線)に強い相関を有する分光特性を持つものであって、画像処理手段は、市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの強度推定値に基づいて各画素の輝度値を算出することを特徴とする。   The image processing apparatus according to the present invention includes at least four types of filters having different spectral sensitivities, and an image acquisition unit that acquires a mosaic image by an image sensor in which any of a plurality of types of filters is used for each pixel. And image processing means for generating, from the mosaic image acquired by the image acquisition means, a color image in which intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is aligned in all pixels, and image acquisition The color filter array of the image sensor of the means has a spectral characteristic in which the filters of the pixels arranged in a checkered pattern in half of all the pixels have a strong correlation with the spectral characteristic of luminance (for example, the relative visibility curve). The image processing means calculates the color intensity estimation value of the pixels arranged in a checkered pattern for each pixel, and each pixel is calculated based on the intensity estimation value. And calculates the luminance value.

画像取得手段の画像センサの色フィルタ配列は、複数種類のフィルタうちの輝度の分光特性(例えば比視感度曲線)に強い相関を有する分光特性を持つ第1の色に対応する第1のフィルタが、水平および垂直に1ラインおきに配置され、第1の色とは異なる輝度の分光特性(例えば比視感度曲線)に強い相関を有する分光特性を持つ第2の色に対応する第2のフィルタが、水平および垂直に1ラインおき、かつ、第1のフィルタとは異なるラインに配置され、画像処理手段は、モザイク画像のうちの注目画素位置における第1の色の強度推定値である第1の強度推定値を算出する第1の算出手段と、注目画素位置における第2の色の強度推定値である第2の強度推定値を算出する第2の算出手段と、第1の算出手段により算出された第1の強度推定値と、第2の算出手段により算出された第2の強度推定値とを合成する合成手段とを備えるものとすることができる。   The color filter array of the image sensor of the image acquisition means includes a first filter corresponding to a first color having a spectral characteristic having a strong correlation with a spectral characteristic of luminance (for example, a relative visibility curve) among a plurality of types of filters. The second filter corresponding to the second color that is arranged every other line in the horizontal and vertical directions and has a spectral characteristic having a strong correlation with a spectral characteristic (for example, a relative visibility curve) having a luminance different from that of the first color. Are arranged on a line different from the first filter every other line in the horizontal and vertical directions, and the image processing means is a first color intensity estimation value at the target pixel position in the mosaic image. A first calculation unit that calculates an intensity estimation value of the second color, a second calculation unit that calculates a second intensity estimation value that is an intensity estimation value of the second color at the target pixel position, and a first calculation unit. Calculated first strength And estimates can be made and a synthesizing means for synthesizing the second intensity estimation value calculated by the second calculation means.

第1の算出手段には、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段を含み、注目画素が第1の色でなかった場合、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、第3の算出手段により第1の強度推定値を算出させるようにすることができる。   The first calculating means is based on an intensity value corresponding to a known color already obtained at the target pixel position and a correlation between a known color calculated from a pixel near the target pixel and a target color to be estimated. A third calculation unit that calculates an intensity estimation value corresponding to the target color at the target pixel position, and if the target pixel is not the first color, the color of the filter at the target pixel position is a known color; The first intensity estimated value can be calculated by the third calculating means using one color as the target color.

第3の算出手段には、注目画素近傍における、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第4の算出手段と、第4の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第5の算出手段とを備えさせるようにすることができる。   The third calculating means includes a generating means for generating a plurality of sets of pixel intensities of pixels corresponding to known colors and pixel intensities corresponding to target colors in the vicinity of the target pixel, and a known generated by the generating means. A fourth calculating means for calculating the center of gravity and inclination of the color distribution between the known color and the target color from a plurality of sets of the pixel intensity of the pixel corresponding to the color and the pixel intensity of the pixel corresponding to the target color; Fifth calculating means for calculating an intensity estimated value corresponding to the target color at the target pixel position based on the gravity center and inclination of the color distribution calculated by the calculating means and the intensity value corresponding to the known color at the target pixel position. Can be provided.

第5の算出手段には、回帰演算を用いて注目画素位置における目標色に対応する強度推定値を算出させるようにすることができる。   The fifth calculation means can calculate an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.

第2の算出手段には、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段を含ませるようにすることができ、注目画素が第2の色でなかった場合、注目画素位置におけるフィルタの色を既知色とし、第2の色を目標色として、第3の算出手段により第2の強度推定値を算出させるようにすることができる。   The second calculation means is based on the intensity value corresponding to the known color already obtained at the target pixel position and the correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated. Thus, a third calculating means for calculating an intensity estimation value corresponding to the target color at the target pixel position can be included. If the target pixel is not the second color, the filter of the target pixel position The second intensity estimated value can be calculated by the third calculation means with the color as the known color and the second color as the target color.

第3の算出手段には、注目画素近傍における、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第4の算出手段と、第4の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第5の算出手段とを備えさせるようにすることができる。   The third calculating means includes a generating means for generating a plurality of sets of pixel intensities of pixels corresponding to known colors and pixel intensities corresponding to target colors in the vicinity of the target pixel, and a known generated by the generating means. A fourth calculating means for calculating the center of gravity and inclination of the color distribution between the known color and the target color from a plurality of sets of the pixel intensity of the pixel corresponding to the color and the pixel intensity of the pixel corresponding to the target color; Fifth calculating means for calculating an intensity estimated value corresponding to the target color at the target pixel position based on the gravity center and inclination of the color distribution calculated by the calculating means and the intensity value corresponding to the known color at the target pixel position. Can be provided.

第5の算出手段には、回帰演算を用いて注目画素位置における目標色に対応する強度推定値を算出させるようにすることができる。   The fifth calculation means can calculate an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.

第1の算出手段には、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段を2以上含ませるようにすることができ、注目画素が第1の色でなかった場合、第1の第3の算出手段には、注目画素位置におけるフィルタの色を既知色とし、第2の色を目標色として、注目画素位置における第2の色に対応する強度値を算出させるようにすることができ、第2の第3の算出手段には、第2の色を既知色とし、第1の色を目標色として、第1の強度推定値を算出させるようにすることができる。   The first calculating means is based on an intensity value corresponding to a known color already obtained at the target pixel position and a correlation between a known color calculated from a pixel near the target pixel and a target color to be estimated. Thus, it is possible to include two or more third calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position. When the target pixel is not the first color, the first first The calculation unit 3 can calculate an intensity value corresponding to the second color at the target pixel position, with the filter color at the target pixel position being a known color and the second color being a target color. The second third calculation means may be configured to calculate the first intensity estimation value using the second color as a known color and the first color as a target color.

第3の算出手段には、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第4の算出手段と、第4の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第5の算出手段とを備えさせるようにすることができる。   The third calculating means includes a generating means for generating a plurality of sets of pixel intensities of pixels corresponding to known colors and pixel intensities of pixels corresponding to target colors, and pixels corresponding to known colors generated by the generating means. Calculated by a fourth calculation means and a fourth calculation means for calculating the centroid and inclination of the color distribution between the known color and the target color from a plurality of sets of the pixel intensity and the pixel intensity of the pixel corresponding to the target color. And a fifth calculating means for calculating an estimated intensity value corresponding to the target color at the target pixel position based on the center of gravity and inclination of the color distribution and the intensity value corresponding to the known color at the target pixel position. Can be.

第5の算出手段には、回帰演算を用いて注目画素位置における目標色に対応する強度推定値を算出させるようにすることができる。   The fifth calculation means can calculate an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.

第2の算出手段には、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段を2以上含ませるようにすることができ、注目画素が第2の色でなかった場合、第1の第3の算出手段には、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、注目画素位置における第1の色に対応する強度値を算出させるようにすることができ、第2の第3の算出手段には、第1の色を既知色とし、第2の色を目標色として、第2の強度推定値を算出させるようにすることができる。   The second calculation means is based on the intensity value corresponding to the known color already obtained at the target pixel position and the correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated. Thus, it is possible to include two or more third calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position. If the target pixel is not the second color, the first first The calculation unit 3 may calculate an intensity value corresponding to the first color at the target pixel position, with the filter color at the target pixel position being a known color and the first color as a target color. The second and third calculation means may be configured to calculate the second intensity estimation value using the first color as a known color and the second color as a target color.

第3の算出手段には、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第4の算出手段と、第4の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第5の算出手段とを備えさせるようにすることができる。   The third calculating means includes a generating means for generating a plurality of sets of pixel intensities of pixels corresponding to known colors and pixel intensities of pixels corresponding to target colors, and pixels corresponding to known colors generated by the generating means. Calculated by a fourth calculation means and a fourth calculation means for calculating the centroid and inclination of the color distribution between the known color and the target color from a plurality of sets of the pixel intensity and the pixel intensity of the pixel corresponding to the target color. And a fifth calculating means for calculating an estimated intensity value corresponding to the target color at the target pixel position based on the center of gravity and inclination of the color distribution and the intensity value corresponding to the known color at the target pixel position. Can be.

第5の算出手段には、回帰演算を用いて注目画素位置における目標色に対応する強度推定値を算出させるようにすることができる。   The fifth calculation means can calculate an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.

第1の算出手段には、第1の強度推定値の第1の推定値を算出する第1の強度推定手段と、第1の強度推定値の第2の推定値を算出する第2の強度推定手段と、注目画素近傍におけるテクスチャ方向を判別する判別手段と、判別手段による判別結果に基づいて、第1の強度推定手段により推定された第1の推定値と、第2の強度推定手段により推定された第2の推定値のうち、適した推定値を選択する選択手段とを備えさせるようにすることができ、第1の強度推定手段には、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段を含ませるようにすることができ、注目画素が第1の色でなかった場合、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、第3の算出手段により第1の強度推定値の第1の推定値を算出させるようにすることができ、第2の強度推定手段には、2以上の第3の算出手段を含ませるようにすることができ、注目画素が第1の色でなかった場合、第1の第3の算出手段には、注目画素位置におけるフィルタの色を既知色とし、第2の色を目標色として、注目画素位置における第2の色に対応する強度値を算出させるようにすることができ、第2の第3の算出手段には、第2の色を既知色とし、第1の色を目標色として、第1の強度推定値の第2の推定値を算出させるようにすることができ、選択手段には、判別手段による判別結果、および、注目画素位置に対して、第1の色に対応するフィルタが、水平方向に位置しているか、垂直方向に位置しているかに基づいて、第1の強度推定手段により推定された第1の推定値と、第2の強度推定手段により推定された第2の推定値のうち、適した推定値を選択させるようにすることができる。   The first calculating means includes first intensity estimating means for calculating a first estimated value of the first intensity estimated value, and second intensity for calculating a second estimated value of the first intensity estimated value. An estimation means, a discrimination means for discriminating a texture direction in the vicinity of the target pixel, a first estimated value estimated by the first intensity estimation means based on a discrimination result by the discrimination means, and a second intensity estimation means A selection means for selecting a suitable estimated value among the estimated second estimated values can be provided, and the first intensity estimating means has a known already obtained position at the target pixel position. Based on the intensity value corresponding to the color and the correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated, an intensity estimation value corresponding to the target color at the target pixel position is calculated. Include 3 calculation means If the target pixel is not the first color, the third calculation means sets the first intensity estimated value by the third calculation unit using the filter color at the target pixel position as the known color and the first color as the target color. The first estimated value can be calculated, the second intensity estimating means can include two or more third calculating means, and the pixel of interest is in the first color. If not, the first third calculation means uses the filter color at the target pixel position as the known color, the second color as the target color, and the intensity value corresponding to the second color at the target pixel position. The second and third calculation means can use the second color as a known color and the first color as a target color, and a second estimated value of the first intensity estimated value. The selection means includes a determination result by the determination means, and The first estimation estimated by the first intensity estimating unit based on whether the filter corresponding to the first color is positioned in the horizontal direction or the vertical direction with respect to the target pixel position. A suitable estimated value can be selected from the value and the second estimated value estimated by the second intensity estimating means.

第2の算出手段には、第2の強度推定値の第1の推定値を算出する第1の強度推定手段と、第2の強度推定値の第2の推定値を算出する第2の強度推定手段と、注目画素近傍におけるテクスチャ方向を判別する判別手段と、判別手段による判別結果に基づいて、第1の強度推定手段により推定された第1の推定値と、第2の強度推定手段により推定された第2の推定値のうち、適した推定値を選択する選択手段とを備えさせるようにすることができ、第1の強度推定手段には、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段を含ませるようにすることができ、注目画素が第2の色でなかった場合、注目画素位置におけるフィルタの色を既知色とし、第2の色を目標色として、第3の算出手段により第2の強度推定値の第1の推定値を算出させるようにすることができ、第2の強度推定手段には、2以上の第3の算出手段を含ませるようにすることができ、注目画素が第2の色でなかった場合、第1の第3の算出手段には、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、注目画素位置における第1の色に対応する強度値を算出させるようにすることができ、第2の第3の算出手段には、第1の色を既知色とし、第2の色を目標色として、第2の強度推定値の第2の推定値を算出させるようにすることができ、選択手段には、判別手段による判別結果、および、注目画素位置に対して、第2の色に対応するフィルタが、水平方向に位置しているか、垂直方向に位置しているかに基づいて、第1の強度推定手段により推定された第1の推定値と、第2の強度推定手段により推定された第2の推定値のうち、適した推定値を選択させるようにすることができる。   The second calculating means includes a first intensity estimating means for calculating a first estimated value of the second intensity estimated value, and a second intensity for calculating a second estimated value of the second intensity estimated value. An estimation means, a discrimination means for discriminating a texture direction in the vicinity of the target pixel, a first estimated value estimated by the first intensity estimation means based on a discrimination result by the discrimination means, and a second intensity estimation means A selection means for selecting a suitable estimated value among the estimated second estimated values can be provided, and the first intensity estimating means has a known already obtained position at the target pixel position. Based on the intensity value corresponding to the color and the correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated, an intensity estimation value corresponding to the target color at the target pixel position is calculated. Include 3 calculation means If the target pixel is not the second color, the third calculation means calculates the second intensity estimated value by using the filter color at the target pixel position as the known color and the second color as the target color. The first estimated value can be calculated, the second intensity estimating means can include two or more third calculating means, and the target pixel is in the second color. If not, the first third calculation means sets the color of the filter at the target pixel position as the known color, the first color as the target color, and the intensity value corresponding to the first color at the target pixel position. The second and third calculation means may use the first color as a known color and the second color as a target color, and a second estimated value of the second intensity estimated value. The selection means includes a determination result by the determination means, and The first estimation estimated by the first intensity estimating unit based on whether the filter corresponding to the second color is positioned in the horizontal direction or the vertical direction with respect to the target pixel position. A suitable estimated value can be selected from the value and the second estimated value estimated by the second intensity estimating means.

画像取得手段の画像センサの複数種類のフィルタのフィルタ配列は、フィルタのうちの第1の色および第2の色とのうちのいずれとも異なる第3の色のフィルタが、水平および垂直に1ラインおき、かつ、第1のフィルタとは異なる水平ラインに配置され、フィルタのうちの第1の色、第2の色、および、第3の色とのうちのいずれとも異なる第4の色のフィルタが、水平および垂直に1ラインおき、かつ、第2のフィルタとは異なる水平ラインに配置されるものとすることができる。   The filter arrangement of the plurality of types of filters of the image sensor of the image acquisition means is such that the third color filter different from any of the first color and the second color of the filters is one line horizontally and vertically. And a fourth color filter arranged on a horizontal line different from the first filter and different from any of the first color, the second color, and the third color of the filters. However, it is possible to arrange every other line horizontally and vertically and on a different horizontal line from the second filter.

画像取得手段の画像センサの複数種類のフィルタのフィルタ配列は、フィルタのうちの第1の色および第2の色とのうちのいずれとも異なる第3の色および第4の色のフィルタが、水平および垂直に1ラインおき、かつ、第1のフィルタとは異なる水平ラインに交互に配置されものとすることができ、フィルタのうちの第1の色、第2の色、第3の色、および、第4の色とのうちのいずれとも異なる第5の色および第6の色のフィルタが、水平および垂直に1ラインおき、かつ、第2のフィルタとは異なる水平ラインに交互に配置されものとすることができる。   The filter arrangement of the plurality of types of filters of the image sensor of the image acquisition means is such that the third color and fourth color filters different from any of the first color and the second color of the filters are horizontal. And every other line vertically and alternately on a horizontal line different from the first filter, the first color of the filter, the second color, the third color, and , The fifth and sixth color filters different from any of the fourth color are arranged alternately in horizontal and vertical lines and on different horizontal lines from the second filter. It can be.

第3の色および第4の色は、互いに高い相関を有する分光特性を持つものとすることができ、第5の色および第6の色は、互いに高い相関を有する分光特性を持つものとすることができる。   The third color and the fourth color can have spectral characteristics having high correlation with each other, and the fifth color and the sixth color have spectral characteristics with high correlation with each other. be able to.

第3の色および第4の色は、同一の色であるものとすることができる。   The third color and the fourth color may be the same color.

第5の色および第6の色は、同一の色であるものとすることができる。   The fifth color and the sixth color may be the same color.

画像取得手段の画像センサの色フィルタ配列は、複数種類のフィルタうちの輝度の分光特性(例えば比視感度曲線)に強い相関を有する分光特性を持つ第1の色に対応する第1のフィルタが、市松状に配置されるものとすることができ、画像処理手段には、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第1の算出手段を含ませるようにすることができ、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、第1の算出手段により第1の強度推定値を算出させるようにすることができる。   The color filter array of the image sensor of the image acquisition means includes a first filter corresponding to a first color having a spectral characteristic having a strong correlation with a spectral characteristic of luminance (for example, a relative visibility curve) among a plurality of types of filters. The image processing means includes an intensity value corresponding to a known color already obtained at the target pixel position, and a known color calculated from pixels near the target pixel. Based on the correlation between the target colors to be estimated, a first calculation unit that calculates an intensity estimation value corresponding to the target color at the target pixel position can be included. The first intensity estimated value can be calculated by the first calculating means using the color as the known color and the first color as the target color.

第1の算出手段には、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第2の算出手段と、第2の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段とを含ませるようにすることができる。   The first calculating means includes a generating means for generating a plurality of sets of pixel intensities of pixels corresponding to known colors and pixel intensities of pixels corresponding to target colors, and pixels corresponding to known colors generated by the generating means. Calculated by a second calculating means and a second calculating means for calculating the center of gravity and inclination of the color distribution between the known color and the target color from a plurality of sets of the pixel intensity corresponding to the target color and the pixel intensity of the pixel corresponding to the target color. And third calculating means for calculating an estimated intensity value corresponding to the target color at the target pixel position based on the center of gravity and inclination of the color distribution and the intensity value corresponding to the known color at the target pixel position. Can be.

第2の算出手段には、回帰演算を用いて注目画素位置における目標色に対応する強度推定値を算出させるようにすることができる。   The second calculation means may be configured to calculate an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.

画像取得手段の画像センサの複数種類のフィルタのフィルタ配列は、フィルタのうちの第1の色とは異なる第2の色のフィルタが、水平および垂直に1ラインおきに配置されるものとすることができ、フィルタのうちの第1の色および第2の色のフィルタが配置されていないフィルタ位置には、フィルタのうちの第1の色および第2の色とのうちのいずれとも異なる第3の色と第4の色のフィルタが、斜め方向に1画素おきの斜め格子状となるように配置されるものとすることができる。   The filter arrangement of the plurality of types of filters of the image sensor of the image acquisition means is such that filters of the second color different from the first color of the filters are arranged every other line in the horizontal and vertical directions. In the filter position where the filters of the first color and the second color of the filters are not arranged, a third different from both the first color and the second color of the filters is provided. The fourth color filter and the fourth color filter may be arranged so as to form a diagonal lattice pattern every other pixel in the diagonal direction.

第2の色は、第1の色より長波長側に感度を持つような分光特性のフィルタ色であるものとすることができ、第3の色および第2の色のうちの少なくとも一方は、第1の色より短波長側に感度を持つような分光特性のフィルタ色であるものとすることができる。   The second color may be a filter color having a spectral characteristic that has sensitivity on a longer wavelength side than the first color, and at least one of the third color and the second color is: The filter color may have a spectral characteristic that has sensitivity on a shorter wavelength side than the first color.

画像取得手段の画像センサの複数種類のフィルタのフィルタ配列は、フィルタのうちの第1の色とは異なる第2の色、第3の色、第4の色、第5の色、のフィルタが、水平および垂直に2ラインおき、かつ、斜め方向に1画素おきの斜め格子状となり、第2の色および第3の色と、第4の色および第5の色とは、互いに異なる水平および垂直のライン上に位置するように配置されるようにすることができる。   The filter arrangement of the plurality of types of filters of the image sensor of the image acquisition means includes filters of the second color, the third color, the fourth color, and the fifth color that are different from the first color of the filters. The second color and the third color, and the fourth color and the fifth color are different from each other in the horizontal and vertical directions. It can be arranged so as to be located on a vertical line.

第2の色および第3の色は、互いに高い相関を有する分光特性を持つものとすることができ、第4の色および第5の色は、互いに高い相関を有する分光特性を持つものとすることができる。   The second color and the third color may have spectral characteristics having high correlation with each other, and the fourth color and the fifth color may have spectral characteristics with high correlation with each other. be able to.

第2の色および第3の色は、同一の色であるものとすることができる。   The second color and the third color may be the same color.

第4の色および第5の色は、同一の色であるものとすることができる。   The fourth color and the fifth color may be the same color.

本発明の画像処理方法は、分光感度が異なる少なくとも4種類のフィルタを有し、複数種類のフィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する取得ステップと、取得ステップの処理により取得されたモザイク画像から、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理ステップとを含み、取得ステップの処理では、全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性(例えば比視感度曲線)に強い相関を有する分光特性を持つような色配列をもつモザイク画像が取得され、画像処理ステップは、市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの強度推定値に基づいて各画素の輝度値を算出する算出ステップを含むことを特徴とする。   The image processing method of the present invention has at least four types of filters having different spectral sensitivities, and an acquisition step of acquiring a mosaic image by an image sensor in which any of a plurality of types of filters is used for each pixel; An image processing step for generating a color image in which intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is aligned in all pixels from the mosaic image acquired by the processing of the acquisition step, and the acquisition step In the above processing, a mosaic image having a color arrangement such that a filter of pixels arranged in a checkered pattern in half of all pixels has a spectral characteristic having a strong correlation with a spectral characteristic of luminance (for example, a relative visibility curve). The image processing step calculates the color intensity estimation value of the pixels arranged in a checkered pattern for each pixel, and calculates the intensity of each pixel. Characterized in that it comprises a calculation step of calculating a luminance value of each pixel on the basis of the value.

本発明のプログラムは、分光感度が異なる少なくとも4種類のフィルタを有し、複数種類のフィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する取得ステップと、取得ステップの処理により取得されたモザイク画像から、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理ステップとを含み、取得ステップの処理では、全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性(例えば比視感度曲線)に強い相関を有する分光特性を持つような色配列をもつモザイク画像が取得され、画像処理ステップは、市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの強度推定値に基づいて各画素の輝度値を算出する算出ステップを含むことを特徴とする処理をコンピュータに実行させる。   The program of the present invention includes an acquisition step of acquiring a mosaic image by an image sensor having at least four types of filters having different spectral sensitivities, and any of the plurality of types of filters is used for each pixel, and an acquisition step An image processing step for generating intensity images for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter from the mosaic image acquired by the processing in step (a). Then, a mosaic image having a color arrangement such that the filter of pixels arranged in a checkered pattern in half of all pixels has a spectral characteristic that has a strong correlation with the spectral characteristic of luminance (for example, the relative visibility curve) is acquired. In the image processing step, an estimated color intensity value of pixels arranged in a checkered pattern is calculated for each pixel, and the intensity estimation is performed for each pixel. To execute a process characterized in that it comprises a calculation step of calculating a luminance value of each pixel based on the values in the computer.

本発明の画像処理装置および画像処理方法、並びにプログラムにおいては、分光感度が異なる少なくとも4種類のフィルタを有し、複数種類のフィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像が取得され、取得されたモザイク画像から、モザイク画像のうちの市松状に配置された輝度の分光特性(例えば、比視感度曲線)に強い相関を有するフィルタの色に対応する強度推定値が算出され、算出された強度推定値を基に、輝度値が算出され、更に、輝度値に基づいた演算により、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像が生成される。   In the image processing apparatus, the image processing method, and the program according to the present invention, the image sensor includes at least four types of filters having different spectral sensitivities, and any of the plurality of types of filters is used for each pixel. An image is acquired, and from the acquired mosaic image, an intensity estimation value corresponding to a color of a filter having a strong correlation with a spectral characteristic of luminance (for example, a relative visibility curve) arranged in a checkered pattern in the mosaic image is obtained. Based on the calculated intensity estimation value, a luminance value is calculated, and further, intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is obtained for all pixels by calculation based on the luminance value. A similar color image is generated.

本発明によれば、モザイク画像が取得されて、モザイク画像が処理されて、カラー画像が生成される。特に、取得されたモザイク画像から、モザイク画像のうちの市松状に配置された輝度の分光特性(例えば、比視感度曲線)に強い相関を有するフィルタの色に対応する強度推定値が算出され、算出された強度推定値を基に輝度値が算出され、更に輝度値に基づいた演算によって、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像が生成されるので、原色系の4色以上の色で構成されている配列を用いる単板カラー撮像装置において、輝度の高域成分の再現を向上させ、ジャギネスを低減させるとともに、解像度感の向上を可能とすることができる。   According to the present invention, a mosaic image is acquired, the mosaic image is processed, and a color image is generated. In particular, from the acquired mosaic image, an intensity estimation value corresponding to the color of the filter having a strong correlation with the spectral characteristic of luminance (for example, the relative visibility curve) arranged in a checkered pattern in the mosaic image is calculated, A color image in which the luminance value is calculated based on the calculated intensity estimation value, and the intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is obtained by calculation based on the luminance value. In a single-plate color imaging device that uses an array composed of four or more primary colors, the reproduction of high-frequency components of luminance is improved, and jagginess is reduced, and the sense of resolution is improved. Can be made possible.

以下に本発明の実施の形態を説明するが、本明細書に記載の発明と、発明の実施の形態との対応関係を例示すると、次のようになる。この記載は、本明細書に記載されている発明をサポートする実施の形態が、本明細書に記載されていることを確認するためのものである。したがって、発明の実施の形態中には記載されているが、発明に対応するものとして、ここには記載されていない実施の形態があったとしても、そのことは、その実施の形態が、その発明に対応するものではないことを意味するものではない。逆に、実施の形態が発明に対応するものとしてここに記載されていたとしても、そのことは、その実施の形態が、その発明以外の発明には対応しないものであることを意味するものでもない。   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)は、分光感度が異なる少なくとも4種類のフィルタ(例えば、RGBEの各色に対応するカラーフィルタ)を有し、複数種類のフィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する画像取得手段(例えば、図2のCCDイメージセンサ213)と、画像取得手段により取得されたモザイク画像から、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理手段(例えば、図5のデモザイク処理部253)とを含み、画像取得手段の画像センサの色フィルタ配列は、全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性(例えば比視感度曲線)に強い相関を有する分光特性を持つものであって、画像処理手段は、市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの強度推定値に基づいて各画素の輝度値を算出し、その輝度情報を用いて、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像を生成することができる。   According to the present invention, an image processing apparatus can be provided. This image processing apparatus (for example, the digital still camera 201 in FIG. 2) has at least four types of filters (for example, color filters corresponding to each color of RGBE) having different spectral sensitivities, and any of the plurality of types of filters. The image acquisition means (for example, the CCD image sensor 213 in FIG. 2) for acquiring a mosaic image by the image sensor used for each pixel and the mosaic image acquired by the image acquisition means are determined by the spectral sensitivity of the filter. Image processing means (for example, demosaic processing unit 253 in FIG. 5) that generates a color image in which intensity information for each pixel position corresponding to a plurality of colors is the same for all pixels, and a color filter of the image sensor of the image acquisition means The array has a filter with pixels arranged in a checkered pattern in half of all pixels, and the spectral characteristics of luminance (for example, The image processing means calculates the color intensity estimation value of the pixels arranged in a checkered pattern at each pixel, and has the intensity estimation value. The luminance value of each pixel is calculated on the basis of the pixel value, and the luminance information is used to generate a color image in which the intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is uniform in all pixels. it can.

画像取得手段の画像センサの色フィルタ配列は、複数種類のフィルタうちの輝度の分光特性に強い相関を有する分光特性(例えば、比視感度曲線)を持つ第1の色(例えば、G)に対応する第1のフィルタが、水平および垂直に1ラインおきに配置され、第1の色とは異なる、輝度の分光特性に強い相関を有する分光特性(例えば、比視感度曲線)を持つ第2の色(例えば、E)に対応する第2のフィルタが、水平および垂直に1ラインおき、かつ、第1のフィルタとは異なるラインに配置され、画像処理手段は、モザイク画像のうちの注目画素位置における第1の色の強度推定値である第1の強度推定値を算出する第1の算出手段(例えば、図7のG強度推定部291)と、注目画素位置における第2の色の強度推定値である第2の強度推定値を算出する第2の算出手段(例えば、図7のE強度推定部292)と、第1の算出手段により算出された第1の強度推定値と、第2の算出手段により算出された第2の強度推定値とを合成する合成手段(例えば、図7の加算処理部293)とを備えることができる。   The color filter array of the image sensor of the image acquisition unit corresponds to the first color (for example, G) having a spectral characteristic (for example, a relative luminous sensitivity curve) that has a strong correlation with the spectral characteristic of the luminance among a plurality of types of filters. The first filter is arranged every other line in the horizontal and vertical directions, and has a spectral characteristic (for example, a relative visibility curve) that is different from the first color and has a strong correlation with the spectral characteristic of luminance. The second filter corresponding to the color (for example, E) is arranged on every other line in the horizontal and vertical directions and on a line different from the first filter, and the image processing means A first calculation unit (for example, a G intensity estimation unit 291 in FIG. 7) that calculates a first intensity estimation value that is an intensity estimation value of the first color in the image, and an intensity estimation of the second color at the target pixel position. Second strength estimate The second calculation means for calculating the value (for example, the E intensity estimation unit 292 in FIG. 7), the first intensity estimation value calculated by the first calculation means, and the first calculation value calculated by the second calculation means. A combining unit (for example, the addition processing unit 293 in FIG. 7) that combines the two estimated intensity values can be provided.

第1の算出手段は、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段(例えば、図8の第1の強度推定部311、第2の強度推定部321、第3の強度推定部322)を含むことができ、注目画素が第1の色でなかった場合、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、第3の算出手段により第1の強度推定値を算出させることができる。   The first calculation means is based on an intensity value corresponding to a known color already obtained at the target pixel position and a correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated. , Third calculating means for calculating an intensity estimated value corresponding to the target color at the target pixel position (for example, the first intensity estimating unit 311, the second intensity estimating unit 321, and the third intensity estimating unit 322 in FIG. 8). ) And the pixel of interest is not the first color, the color of the filter at the pixel of interest is the known color, the first color is the target color, and the first intensity is calculated by the third calculation means. An estimated value can be calculated.

第3の算出手段は、注目画素近傍における、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段(例えば、図10の粗補間処理部341)と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第4の算出手段(例えば、図10の統計量算出部342および図16の傾き算出部381)と、第4の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第5の算出手段(例えば、図16の画素強度推定部382)とを備えることができる。   The third calculating means is a generating means for generating a plurality of sets of pixel intensities corresponding to the known colors and pixel intensities corresponding to the target colors in the vicinity of the target pixel (for example, the rough interpolation processing unit in FIG. 10). 341) and a plurality of sets of pixel intensities of pixels corresponding to the known colors generated by the generating means and pixel intensities of the pixels corresponding to the target colors, the center of gravity and inclination of the color distribution between the known colors and the target colors are calculated. Fourth calculating means (for example, the statistic calculating section 342 in FIG. 10 and the slope calculating section 381 in FIG. 16), the centroid and inclination of the color distribution calculated by the fourth calculating means, and the known pixel position. A fifth calculating unit (for example, a pixel intensity estimating unit 382 in FIG. 16) that calculates an intensity estimated value corresponding to the target color at the target pixel position based on the intensity value corresponding to the color can be provided.

第5の算出手段は、回帰演算(例えば、式(10)、式(11)、または、式(12)による演算)を用いて注目画素位置における目標色に対応する強度推定値を算出することができる。   The fifth calculation means calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation (for example, calculation according to Expression (10), Expression (11), or Expression (12)). Can do.

第2の算出手段は、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段(例えば、第1の強度推定部311、図8の第2の強度推定部321、第3の強度推定部322)を含み、注目画素が第2の色でなかった場合、注目画素位置におけるフィルタの色を既知色とし、第2の色を目標色として、第3の算出手段により第2の強度推定値を算出することができる。   The second calculation means is based on the intensity value corresponding to the known color already obtained at the target pixel position and the correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated. , Third calculating means for calculating an intensity estimated value corresponding to the target color at the target pixel position (for example, the first intensity estimating unit 311, the second intensity estimating unit 321 in FIG. 8, the third intensity estimating unit 322). ) And the target pixel is not the second color, the filter color at the target pixel position is the known color, the second color is the target color, and the second intensity estimated value is calculated by the third calculation means. Can be calculated.

第3の算出手段は、注目画素近傍における、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段(例えば、図10の粗補間処理部341)と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第4の算出手段(例えば、図10の統計量算出部342および図16の傾き算出部381)と、第4の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第5の算出手段(例えば、図16の画素強度推定部382)とを備えることができる。   The third calculating means is a generating means for generating a plurality of sets of pixel intensities corresponding to the known colors and pixel intensities corresponding to the target colors in the vicinity of the target pixel (for example, the rough interpolation processing unit in FIG. 10). 341) and a plurality of sets of pixel intensities of pixels corresponding to the known colors generated by the generating means and pixel intensities of the pixels corresponding to the target colors, the center of gravity and inclination of the color distribution between the known colors and the target colors are calculated. Fourth calculating means (for example, the statistic calculating section 342 in FIG. 10 and the slope calculating section 381 in FIG. 16), the centroid and inclination of the color distribution calculated by the fourth calculating means, and the known pixel position. A fifth calculating unit (for example, a pixel intensity estimating unit 382 in FIG. 16) that calculates an intensity estimated value corresponding to the target color at the target pixel position based on the intensity value corresponding to the color can be provided.

第5の算出手段は、回帰演算(例えば、式(10)、式(11)、または、式(12)による演算)を用いて注目画素位置における目標色に対応する強度推定値を算出することができる。   The fifth calculation means calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation (for example, calculation according to Expression (10), Expression (11), or Expression (12)). Can do.

第1の算出手段は、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段を2以上含み、注目画素が第1の色でなかった場合、第1の第3の算出手段(例えば、図8の第2の強度推定部321、第3の強度推定部322)は、注目画素位置におけるフィルタの色を既知色とし、第2の色を目標色として、注目画素位置における第2の色に対応する強度値を算出し、第2の第3の算出手段(例えば、図8の第4の強度推定部323)は、第2の色を既知色とし、第1の色を目標色として、第1の強度推定値を算出することができる。   The first calculation means is based on an intensity value corresponding to a known color already obtained at the target pixel position and a correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated. If there are two or more third calculation means for calculating the intensity estimation value corresponding to the target color at the target pixel position, and the target pixel is not the first color, the first third calculation means (for example, FIG. 8, the second intensity estimating unit 321 and the third intensity estimating unit 322) use the filter color at the target pixel position as the known color, the second color as the target color, and the second color at the target pixel position. The corresponding intensity value is calculated, and the second and third calculating means (for example, the fourth intensity estimating unit 323 in FIG. 8) sets the second color as the known color and the first color as the target color. A first intensity estimate can be calculated.

第3の算出手段は、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段(例えば、図10の粗補間処理部341)と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第4の算出手段(例えば、図10の統計量算出部342および図16の傾き算出部381)と、第4の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第5の算出手段(例えば、図16の画素強度推定部382)とを備えることができる。   The third calculating means generates generating means (for example, the coarse interpolation processing unit 341 in FIG. 10) that generates a plurality of sets of pixel intensities of pixels corresponding to known colors and pixel intensities corresponding to target colors, Fourth calculation for calculating the gravity center and inclination of the color distribution between the known color and the target color from a plurality of sets of the pixel intensity of the pixel corresponding to the known color and the pixel intensity of the pixel corresponding to the target color generated by the means Means (for example, the statistic calculator 342 in FIG. 10 and the slope calculator 381 in FIG. 16), the gravity center and slope of the color distribution calculated by the fourth calculator, and the intensity corresponding to the known color at the target pixel position. And a fifth calculation unit (for example, a pixel intensity estimation unit 382 in FIG. 16) that calculates an intensity estimation value corresponding to the target color at the target pixel position based on the value.

第5の算出手段は、回帰演算(例えば、式(10)、式(11)、または、式(12)による演算)を用いて注目画素位置における目標色に対応する強度推定値を算出することができる。   The fifth calculation means calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation (for example, calculation according to Expression (10), Expression (11), or Expression (12)). Can do.

第2の算出手段は、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段を2以上含み、注目画素が第2の色でなかった場合、第1の第3の算出手段(例えば、図8の第2の強度推定部321、第3の強度推定部322)は、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、注目画素位置における第1の色に対応する強度値を算出し、第2の第3の算出手段(例えば、図8の第4の強度推定部323)は、第1の色を既知色とし、第2の色を目標色として、第2の強度推定値を算出することができる。   The second calculation means is based on the intensity value corresponding to the known color already obtained at the target pixel position and the correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated. When there are two or more third calculation means for calculating an estimated intensity value corresponding to the target color at the target pixel position, and the target pixel is not the second color, the first third calculation means (for example, FIG. 8, the second intensity estimation unit 321 and the third intensity estimation unit 322) use the filter color at the target pixel position as the known color, the first color as the target color, and the first color at the target pixel position. The corresponding intensity value is calculated, and the second and third calculating means (for example, the fourth intensity estimating unit 323 in FIG. 8) uses the first color as the known color and the second color as the target color. A second intensity estimate can be calculated.

第3の算出手段は、前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度との組を複数生成する生成手段(例えば、図10の粗補間処理部341)と、前記生成手段により生成された前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度の複数の組から、前記既知色と前記目標色間の色分布の重心および傾きを算出する第4の算出手段(例えば、図10の統計量算出部342および図16の傾き算出部381)と、前記第4の算出手段により算出された前記色分布の重心および傾きと、前記注目画素位置における前記既知色に対応する強度値とに基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第5の算出手段(例えば、図16の画素強度推定部382)とを備えることができる。   Third calculation means includes generation means for generating a plurality of sets of pixel intensities of pixels corresponding to the known color and pixel intensities of pixels corresponding to the target color (for example, the rough interpolation processing unit 341 in FIG. 10); Centroid and inclination of a color distribution between the known color and the target color from a plurality of sets of pixel intensity of the pixel corresponding to the known color and pixel intensity of the pixel corresponding to the target color generated by the generating unit A fourth calculation unit (for example, the statistic calculation unit 342 in FIG. 10 and the inclination calculation unit 381 in FIG. 16), the centroid and inclination of the color distribution calculated by the fourth calculation unit, Based on the intensity value corresponding to the known color at the target pixel position, fifth calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position (for example, the pixel intensity estimation unit 382 in FIG. 16). And It can be obtained.

第5の算出手段は、回帰演算(例えば、式(10)、式(11)、または、式(12)による演算)を用いて注目画素位置における目標色に対応する強度推定値を算出することができる。   The fifth calculation means calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation (for example, calculation according to Expression (10), Expression (11), or Expression (12)). Can do.

第1の算出手段は、第1の強度推定値の第1の推定値を算出する第1の強度推定手段(例えば、図8の第2の処理ブロック303における第2の強度推定部321、または、第3の処理ブロック304における第3の強度推定部322)と、第1の強度推定値の第2の推定値を算出する第2の強度推定手段(例えば、図8の第2の処理ブロック303における第3の強度推定部322および第4の強度推定部323、または、第3の処理ブロック304における第2の強度推定部321および第4の強度推定部323)と、注目画素近傍におけるテクスチャ方向を判別する判別手段(例えば、図8のテクスチャ方向判定部305)と、判別手段による判別結果に基づいて、第1の強度推定手段により推定された第1の推定値と、第2の強度推定手段により推定された第2の推定値のうち、適した推定値を選択する選択手段(例えば、図8のスイッチ324)とを備えることができ、第1の強度推定手段は、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段(例えば、図8の第2の強度推定部321、第3の強度推定部322)を含むことができ、注目画素が第1の色でなかった場合、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、第3の算出手段により第1の強度推定値の第1の推定値を算出し、第2の強度推定手段は、2以上の第3の算出手段を含み、注目画素が第1の色でなかった場合、第1の第3の算出手段(例えば、図8の第2の強度推定部321、第3の強度推定部322)は、注目画素位置におけるフィルタの色を既知色とし、第2の色を目標色として、注目画素位置における第2の色に対応する強度値を算出し、第2の第3の算出手段(例えば、図8の第4の強度推定部323)は、第2の色を既知色とし、第1の色を目標色として、第1の強度推定値の第2の推定値を算出し、選択手段は、判別手段による判別結果、および、注目画素位置に対して、第1の色に対応するフィルタが、水平方向に位置しているか、垂直方向に位置しているかに基づいて、第1の強度推定手段により推定された第1の推定値と、第2の強度推定手段により推定された第2の推定値のうち、適した推定値を選択することができる。   The first calculation means is first intensity estimation means for calculating the first estimated value of the first intensity estimated value (for example, the second intensity estimation unit 321 in the second processing block 303 in FIG. 8 or , A third intensity estimating unit 322 in the third processing block 304) and second intensity estimating means for calculating a second estimated value of the first estimated intensity value (for example, the second processing block in FIG. 8). The third intensity estimator 322 and the fourth intensity estimator 323 in 303, or the second intensity estimator 321 and the fourth intensity estimator 323 in the third processing block 304), and the texture in the vicinity of the target pixel A first estimation value estimated by the first intensity estimation unit and a second intensity based on the determination unit (for example, the texture direction determination unit 305 in FIG. 8) for determining the direction and the determination result by the determination unit. Guess Selecting means (for example, switch 324 in FIG. 8) for selecting a suitable estimated value from the second estimated values estimated by the means, and the first intensity estimating means may be provided at the target pixel position. The intensity corresponding to the target color at the target pixel position based on the intensity value corresponding to the known color already obtained and the correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated When a third calculation unit (for example, the second intensity estimation unit 321 and the third intensity estimation unit 322 in FIG. 8) that calculates an estimated value can be included, and the pixel of interest is not the first color, A first estimated value of the first intensity estimated value is calculated by the third calculating means using the filter color at the target pixel position as the known color and the first color as the target color, and the second intensity estimating means Including two or more third calculation means; When the pixel is not in the first color, the first third calculating unit (for example, the second intensity estimating unit 321 and the third intensity estimating unit 322 in FIG. 8) uses the filter color at the target pixel position. Is the known color, the second color is the target color, the intensity value corresponding to the second color at the target pixel position is calculated, and the second third calculating means (for example, the fourth intensity estimation in FIG. 8) is calculated. The unit 323) calculates the second estimated value of the first intensity estimated value using the second color as the known color and the first color as the target color, and the selecting unit is configured to determine the determination result by the determining unit, and The first intensity estimated by the first intensity estimating unit based on whether the filter corresponding to the first color is positioned in the horizontal direction or the vertical direction with respect to the target pixel position. Of the estimated value and the second estimated value estimated by the second intensity estimating means, a suitable estimated value Can be selected.

第2の算出手段は、第2の強度推定値の第1の推定値を算出する第1の強度推定手段(例えば、図8の第2の処理ブロック303における第2の強度推定部321、または、第3の処理ブロック304における第3の強度推定部322)と、第2の強度推定値の第2の推定値を算出する第2の強度推定手段(例えば、図8の第2の処理ブロック303における第3の強度推定部322および第4の強度推定部323、または、第3の処理ブロック304における第2の強度推定部321および第4の強度推定部323)と、注目画素近傍におけるテクスチャ方向を判別する判別手段(例えば、図8のテクスチャ方向判定部305)と、判別手段による判別結果に基づいて、第1の強度推定手段により推定された第1の推定値と、第2の強度推定手段により推定された第2の推定値のうち、適した推定値を選択する選択手段(例えば、図8のスイッチ324)とを備えることができ、第1の強度推定手段は、注目画素位置におけるすでに得られている既知色に対応する強度値と、注目画素近傍の画素より算出される既知色と推定したい目標色の間の相関関係とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段(例えば、図8の第2の強度推定部321、第3の強度推定部322)を含むことができ、注目画素が第2の色でなかった場合、注目画素位置におけるフィルタの色を既知色とし、第2の色を目標色として、第3の算出手段により第2の強度推定値の第1の推定値を算出し、第2の強度推定手段は、2以上の前記第3の算出手段を含み、注目画素が第2の色でなかった場合、第1の第3の算出手段(例えば、図8の第2の強度推定部321、第3の強度推定部322)は、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、注目画素位置における第1の色に対応する強度値を算出し、第2の第3の算出手段(例えば、図8の第4の強度推定部323)は、第1の色を既知色とし、第2の色を目標色として、第2の強度推定値の第2の推定値を算出し、選択手段は、判別手段による判別結果、および、注目画素位置に対して、第2の色に対応するフィルタが、水平方向に位置しているか、垂直方向に位置しているかに基づいて、第1の強度推定手段により推定された第1の推定値と、第2の強度推定手段により推定された第2の推定値のうち、適した推定値を選択することができる。   The second calculating means is first intensity estimating means for calculating a first estimated value of the second intensity estimated value (for example, the second intensity estimating unit 321 in the second processing block 303 in FIG. 8 or , A third intensity estimating unit 322) in the third processing block 304, and second intensity estimating means for calculating a second estimated value of the second estimated intensity value (for example, the second processing block in FIG. 8). The third intensity estimator 322 and the fourth intensity estimator 323 in 303, or the second intensity estimator 321 and the fourth intensity estimator 323 in the third processing block 304), and the texture in the vicinity of the target pixel A first estimation value estimated by the first intensity estimation unit and a second intensity based on the determination unit (for example, the texture direction determination unit 305 in FIG. 8) for determining the direction and the determination result by the determination unit. Guess Selecting means (for example, switch 324 in FIG. 8) for selecting a suitable estimated value from the second estimated values estimated by the means, and the first intensity estimating means may be provided at the target pixel position. The intensity corresponding to the target color at the target pixel position based on the intensity value corresponding to the known color already obtained and the correlation between the known color calculated from the pixels near the target pixel and the target color to be estimated When the third calculation means (for example, the second intensity estimation unit 321 and the third intensity estimation unit 322 in FIG. 8) for calculating the estimated value can be included, and the pixel of interest is not the second color, Using the filter color at the target pixel position as the known color and the second color as the target color, the third calculation means calculates the first estimated value of the second intensity estimated value, and the second intensity estimating means Including two or more third calculation means When the pixel of interest is not the second color, the first third calculating means (for example, the second intensity estimating unit 321 and the third intensity estimating unit 322 in FIG. 8) An intensity value corresponding to the first color at the target pixel position is calculated using the color as the known color and the first color as the target color, and second third calculation means (for example, the fourth intensity in FIG. 8). The estimation unit 323) calculates the second estimated value of the second intensity estimated value using the first color as the known color and the second color as the target color, and the selecting unit is configured to determine the determination result by the determining unit, The first intensity estimated by the first intensity estimating unit is based on whether the filter corresponding to the second color is positioned in the horizontal direction or the vertical direction with respect to the target pixel position. Of the estimated value and the second estimated value estimated by the second intensity estimating means. A constant value can be selected.

画像取得手段の画像センサの複数種類のフィルタのフィルタ配列は、フィルタのうちの第1の色および第2の色とのうちのいずれとも異なる第3の色(例えば、R)のフィルタが、水平および垂直に1ラインおき、かつ、第1のフィルタとは異なる水平ラインに配置され、フィルタのうちの第1の色、第2の色、および、第3の色とのうちのいずれとも異なる第4の色(例えば、B)のフィルタが、水平および垂直に1ラインおき、かつ、第2のフィルタとは異なる水平ラインに配置されることができる。   The filter arrangement of the plurality of types of filters of the image sensor of the image acquisition means is such that a filter of a third color (for example, R) different from any of the first color and the second color of the filters is horizontal. The first and second colors are arranged on a horizontal line different from the first filter and are different from any one of the first color, the second color, and the third color. Four color (e.g., B) filters can be arranged on a horizontal line that is different from the second filter every other line in the horizontal and vertical directions.

画像取得手段の画像センサの複数種類のフィルタのフィルタ配列は、フィルタのうちの第1の色および第2の色とのうちのいずれとも異なる第3の色(例えば、図53のR1)および第4の色(例えば、図53のR2)のフィルタが、水平および垂直に1ラインおき、かつ、第1のフィルタとは異なる水平ラインに交互に配置され、フィルタのうちの第1の色、第2の色、第3の色、および、第4の色とのうちのいずれとも異なる第5の色(例えば、図53のB1)および第6の色(例えば、図53のB2)のフィルタが、水平および垂直に1ラインおき、かつ、第2のフィルタとは異なる水平ラインに交互に配置されることができる。   The filter array of the plurality of types of filters of the image sensor of the image acquisition means has a third color (for example, R1 in FIG. 53) different from any of the first color and the second color of the filter and the first color. Filters of four colors (for example, R2 in FIG. 53) are alternately arranged on a horizontal line different from the first filter every other line in the horizontal and vertical directions. Filters of a fifth color (for example, B1 in FIG. 53) and a sixth color (for example, B2 in FIG. 53) that are different from any of the second color, the third color, and the fourth color are provided. , Every other line in the horizontal and vertical directions, and can be alternately arranged on a different horizontal line from the second filter.

第3の色および第4の色は、互いに高い相関を有する分光特性を持つことができ、第5の色および第6の色は、互いに高い相関を有する分光特性を持つことができる。   The third color and the fourth color can have spectral characteristics having a high correlation with each other, and the fifth color and the sixth color can have spectral characteristics with a high correlation with each other.

第3の色および第4の色は、同一の色であるようにすることができる。   The third color and the fourth color may be the same color.

第5の色および第6の色は、同一の色であるようにすることができる。   The fifth color and the sixth color may be the same color.

画像取得手段の画像センサの色フィルタ配列は、複数種類のフィルタうちの輝度の分光特性(例えば、比視感度曲線)に強い相関を有する分光特性を持つ第1の色(例えば、G)に対応する第1のフィルタが、市松状に配置され、画像処理手段には、第3の算出手段(例えば、図56の第1の強度推定部621、第3の強度推定部622)を含み、注目画素位置におけるフィルタの色を既知色とし、第1の色を目標色として、第3の算出手段により第1の強度推定値を算出させるようにすることができる。   The color filter array of the image sensor of the image acquisition unit corresponds to the first color (for example, G) having a spectral characteristic having a strong correlation with the spectral characteristic of luminance (for example, the relative visibility curve) among the plurality of types of filters. The first filter is arranged in a checkered pattern, and the image processing means includes third calculation means (for example, the first intensity estimation unit 621 and the third intensity estimation unit 622 in FIG. 56). The first intensity estimated value can be calculated by the third calculation means with the filter color at the pixel position as the known color and the first color as the target color.

第1の算出手段には、既知色に対応する画素の画素強度と目標色に対応する画素の画素強度との組を複数生成する生成手段(例えば、図57の粗補間処理部631)と、生成手段により生成された既知色に対応する画素の画素強度と目標色に対応する画素の画素強度の複数の組から、既知色と目標色間の色分布の重心および傾きを算出する第2の算出手段(例えば、図57の統計量算出部342および図16の傾き算出部381)と、第4の算出手段により算出された色分布の重心および傾きと、注目画素位置における既知色に対応する強度値とに基づいて、注目画素位置における目標色に対応する強度推定値を算出する第3の算出手段(例えば、図57の画素強度推定部382)とを備えさせることができる。   The first calculation means includes generation means (for example, a rough interpolation processing unit 631 in FIG. 57) that generates a plurality of sets of pixel intensities of pixels corresponding to known colors and pixel intensities corresponding to target colors, A second calculation unit that calculates a center of gravity and an inclination of a color distribution between the known color and the target color from a plurality of sets of pixel intensity of the pixel corresponding to the known color and pixel intensity of the pixel corresponding to the target color generated by the generation unit The calculation means (for example, the statistic calculation unit 342 in FIG. 57 and the inclination calculation unit 381 in FIG. 16) and the gravity center and inclination of the color distribution calculated by the fourth calculation unit correspond to the known color at the target pixel position. Based on the intensity value, a third calculating unit (for example, a pixel intensity estimating unit 382 in FIG. 57) that calculates an intensity estimated value corresponding to the target color at the target pixel position can be provided.

第2の算出手段は、回帰演算(例えば、式(10)、式(11)、または、式(12)による演算)を用いて注目画素位置における目標色に対応する強度推定値を算出することができる。   The second calculation means calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation (for example, calculation according to Expression (10), Expression (11), or Expression (12)). Can do.

画像取得手段の画像センサの複数種類のフィルタのフィルタ配列は、フィルタのうちの第1の色とは異なる第2の色(例えば、R)のフィルタが、水平および垂直に1ラインおきに配置され、フィルタのうちの第1の色および第2の色のフィルタが配置されていないフィルタ位置には、フィルタのうちの第1の色および第2の色とのうちのいずれとも異なる第3の色(例えば、B)と第4の色(例えば、E)のフィルタが、斜め方向に1画素おきの斜め格子状となるように配置されるものとすることができる。   In the filter arrangement of the plurality of types of filters of the image sensor of the image acquisition means, filters of the second color (for example, R) different from the first color of the filters are arranged every other line in the horizontal and vertical directions. A third color different from any of the first color and the second color of the filter is provided at a filter position where the filters of the first color and the second color of the filter are not disposed. The filters of (for example, B) and the fourth color (for example, E) can be arranged so as to form an oblique lattice pattern every other pixel in the oblique direction.

第2の色は、第1の色より長波長側に感度を持つような分光特性のフィルタ色であり、第3の色および第4の色のうちの少なくとも一方は、第1の色より短波長側に感度を持つような分光特性のフィルタ色であるものとすることができる。   The second color is a filter color having a spectral characteristic that has a sensitivity on a longer wavelength side than the first color, and at least one of the third color and the fourth color is shorter than the first color. The filter color may have spectral characteristics that have sensitivity on the wavelength side.

画像取得手段の画像センサの複数種類のフィルタのフィルタ配列は、フィルタのうちの第1の色とは異なる第2の色(例えば、図68のR1)、第3の色(例えば、図68のR2)、第4の色(例えば、図68のB1)、第5の色(例えば、図68のB2)、のフィルタが、それぞれ、水平および垂直に2ラインおき、かつ、斜め方向に1画素おきの斜め格子状となり、第2の色および第3の色と、第4の色および第5の色とは、互いに異なる水平および垂直のライン上に位置するように配置されるものとすることができる。   The filter arrangement of the plurality of types of filters of the image sensor of the image acquisition means includes a second color (for example, R1 in FIG. 68) different from the first color, and a third color (for example, in FIG. 68). R2), the fourth color (for example, B1 in FIG. 68), and the fifth color (for example, B2 in FIG. 68) have two horizontal and vertical filters, and one pixel in the diagonal direction. Each of the second and third colors, and the fourth and fifth colors are arranged so as to be located on different horizontal and vertical lines. Can do.

第2の色および第3の色は、互いに高い相関を有する分光特性を持つものとすることができ、第4の色および第5の色は、互いに高い相関を有する分光特性を持つものとすることができる。   The second color and the third color may have spectral characteristics having high correlation with each other, and the fourth color and the fifth color may have spectral characteristics with high correlation with each other. be able to.

第2の色および第3の色は、同一の色であるものとすることができる。   The second color and the third color may be the same color.

第4の色および第5の色は、同一の色であるものとすることができる。   The fourth color and the fifth color may be the same color.

また、本発明によれば、画像処理方法が提供される。この画像処理方法は、分光感度が異なる少なくとも4種類のフィルタ(例えば、RGBEの各色に対応するカラーフィルタ)を有し、複数種類のフィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する取得ステップ(例えば、図23のステップS1の処理)と、取得ステップの処理により取得されたモザイク画像から、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理ステップ(例えば、図23のステップS4の処理)とを含み、取得ステップの処理では、全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性(例えば、比視感度曲線)に強い相関を有する分光特性を持つような色配列をもつモザイク画像が取得され、画像処理ステップは、前記市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの強度推定値に基づいて各画素の輝度値を算出する算出ステップ(例えば、図24のステップS23、または、図62のステップS453の処理)を含む。   According to the present invention, an image processing method is provided. This image processing method has at least four types of filters (for example, color filters corresponding to each color of RGBE) having different spectral sensitivities, and any one of a plurality of types of filters is used for each pixel. The acquisition step (for example, the process of step S1 in FIG. 23) for acquiring the mosaic image by the above, and the intensity for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter from the mosaic image acquired by the process of the acquisition step And an image processing step (for example, the processing in step S4 in FIG. 23) for generating a color image in which information is aligned for all pixels. In the processing in the acquisition step, pixels arranged in a checkered pattern in half of all pixels The color filter has a spectral characteristic that has a spectral characteristic that has a strong correlation with the spectral characteristic of luminance (for example, the relative visibility curve). One mosaic image is acquired, and the image processing step calculates the color intensity estimation value of the pixels arranged in the checkered pattern at each pixel, and calculates the luminance value of each pixel based on the intensity estimation value Calculation step (for example, step S23 in FIG. 24 or step S453 in FIG. 62).

また、本発明によれば、プログラムが提供される。このプログラムは、分光感度が異なる少なくとも4種類のフィルタ(例えば、RGBEの各色に対応するカラーフィルタ)を有し、複数種類のフィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する取得ステップ(例えば、図23のステップS1の処理)と、取得ステップの処理により取得されたモザイク画像から、フィルタの分光感度により決まる複数の色に対応する画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理ステップ(例えば、図23のステップS4の処理)とを含み、取得ステップの処理では、全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性(例えば、比視感度曲線)に強い相関を有する分光特性を持つような色配列をもつモザイク画像が取得され、画像処理ステップは、前記市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの強度推定値に基づいて各画素の輝度値を算出する算出ステップ(例えば、図24のステップS23、または、図62のステップS453の処理)を含むことを特徴とする処理をコンピュータに実行させる。   According to the present invention, a program is provided. This program has at least four types of filters (for example, color filters corresponding to each color of RGBE) having different spectral sensitivities, and mosaic is performed by an image sensor in which any one of a plurality of types of filters is used for each pixel. Intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is obtained from the acquisition step (for example, the processing of step S1 in FIG. 23) for acquiring an image and the mosaic image acquired by the processing of the acquisition step. An image processing step (for example, the processing in step S4 in FIG. 23) for generating a color image that matches all pixels, and in the processing of the acquisition step, a filter included in pixels arranged in a checkered pattern in half of all the pixels However, color arrangements that have spectral characteristics that have a strong correlation with the spectral characteristics of luminance (for example, the relative visibility curve) are also included. A mosaic image is acquired, and the image processing step calculates the color intensity estimation value of the pixels arranged in the checkered pattern for each pixel, and calculates the luminance value of each pixel based on the intensity estimation value. A computer is caused to execute a process including a calculation step (for example, the process of step S23 of FIG. 24 or the process of step S453 of FIG. 62).

以下、図を参照して、本発明の実施の形態について説明する。   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 still camera 201 that executes arithmetic processing 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、CPU223、および、操作入力部224から構成される。   As shown in FIG. 2, a digital still camera 201 includes a lens 211, an aperture 212, a CCD (Charge Coupled Devices) image sensor 213, a correlated double sampling (CDS) circuit 214, an A / D converter 215, and a DSP. (Digital Signal Processor) From 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 223, and operation input unit 224 Composed.

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を持つブロックで、信号処理用プロセッサが画像用RAMに格納された画像データに対して、予めプログラムされた画像処理、または、ハードウェアによる演算処理として構成された画像処理を行うものである。タイミングジェネレータ217は、CCDを駆動するために必要な、水平および垂直の各種駆動パルス、並びに、アナログフロント処理で用いるパルスを、基準クロックに同期して発生させるロジック回路である。また、タイミングジェネレータ217により発生されるタイミングクロックは、バス225を介して、コーデック処理部221、メモリ222、および、CPU223にも供給されている。   The DSP block 216 is a block having a signal processing processor and an image RAM, and the signal processing processor performs pre-programmed image processing or hardware arithmetic processing on the image data stored in the image RAM. The image processing configured as follows is performed. 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は、例えば、JPEG(Joint Picture Experts Group)などの、デジタル画像データの圧縮または伸張アルゴリズムによる処理を実行する。メモリ222は、例えば、半導体メモリ、磁気ディスク、光磁気ディスク、または、光ディスクなどにより構成され、CPU223の制御に基づいて、供給されたデータを記憶したり、または、記憶しているデータを出力する。なお、メモリ222は、デジタルスチルカメラ201に対して着脱可能なようになされていても良い。   The codec processing unit 221 executes processing based on a compression or expansion algorithm of digital image data such as JPEG (Joint Picture Experts Group). 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 still camera 201.

CPU223は、バス225を介して、操作入力部224から供給されたユーザの操作入力を基に、デジタルスチルカメラ201の各部を制御する。操作入力部224は、録画を指令する場合のボタンをはじめとして、例えば、ジョグダイヤル、キー、レバー、ボタン、またはタッチパネルなどにより構成され、ユーザによる操作入力を受ける。   The CPU 223 controls each unit of the digital still 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 a role of a camera finder in the digital still 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色に対して、第4の色(以下、Eと称する)を加えた原色4色の配列の例を、図3に示す。   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. For example, FIG. 3 shows an example of an array of four primary colors in which a fourth color (hereinafter referred to as E) is added to three colors RGB (Red, Green, Blue). .

図3に示される配列においては、ベイヤー配列のうちの、緑色(G)の光のみを透過するGのフィルタのうちの一方をEの光のみを透過するフィルタとし、赤(R)の光のみを透過するRのフィルタが1個、青(B)の光のみを透過するBのフィルタが1個の、合計4個を最小単位として構成されている。RGBのうち、Gは、人の視感度特性に最も近い分光特性を有している。図3に示される配列のGとEとは、輝度の分光特性(例えば、比視感度曲線)に強い相関を有する分光特性を有する。   In the array shown in FIG. 3, one of the G filters that transmits only green (G) light in the Bayer array is a filter that transmits only E light, and only red (R) light is present. One filter of R that transmits light and one filter of B that transmits only blue (B) light, a total of four is configured as a minimum unit. Of RGB, G has a spectral characteristic closest to human visibility characteristics. G and E in the array shown in FIG. 3 have spectral characteristics that have a strong correlation with the spectral characteristics of luminance (for example, the relative visibility curve).

ここで、CCDイメージセンサ213のオンチップカラーフィルタの4色配列について更に説明する。CCDイメージセンサ213のオンチップカラーフィルタによって得られるモザイク画像の各画素の強度は、対応するオンチップフィルタの分光特性と入射光の分光特性の積に比例する。図3に示される原色系4色配列の各色の分光特性の1例を図4に示す。フィルタの分光特性は、センサ自体の分光特性およびノイズ特性、後述するリニアマトリックスの係数、フィルタに用いる材質の物理的制約等を考慮しながら注意深く設計する必要がある。本発明を適用する場合、これらのフィルタの分光感度特性に、効果が特に左右されることはないので、上述した色再現性とノイズの特性に配慮して、分光感度を設計するようにすればよい。例えば、図4では、第4の色Eの分光特性を、Gよりも短波長側にピークを持つような例を示したが、Eは、Gよりも長波長側にピークを持つ(少し黄色よりの色に見える)ような分光特性であってもかまわない。   Here, the four-color arrangement of the on-chip color filter of the CCD image sensor 213 will be further described. The intensity of each pixel of the mosaic image obtained by the on-chip color filter of the CCD image sensor 213 is proportional to the product of the spectral characteristic of the corresponding on-chip filter and the spectral characteristic of incident light. FIG. 4 shows an example of the spectral characteristics of each color in the primary color system four-color arrangement shown in FIG. The spectral characteristics of the filter need to be carefully designed in consideration of the spectral characteristics and noise characteristics of the sensor itself, the coefficients of a linear matrix, which will be described later, and the physical constraints of the material used for the filter. When applying the present invention, the effect is not particularly affected by the spectral sensitivity characteristics of these filters. Therefore, if the spectral sensitivity is designed in consideration of the above-described color reproducibility and noise characteristics. Good. For example, FIG. 4 shows an example in which the spectral characteristic of the fourth color E has a peak on the shorter wavelength side than G, but E has a peak on the longer wavelength side than G (slightly yellow). Spectral characteristics such as (more visible colors) may be used.

このように、CCDイメージセンサ213のオンチップカラーフィルタに、図3に示される色配列のカラーフィルタが用いられている場合、DSPブロック216の画像用RAMに一時格納されている画像は、各画素とも、R,G,B,Eのうちのいずれか1つの色しか持たない。そこで、DSPブロック216の信号処理用プロセッサは、予め組み込まれた画像処理プログラムまたはハードウェアによって、この画像を処理し、全画素において全色のデータを有する画像データを生成する。   As described above, when the color filter having the color arrangement shown in FIG. 3 is used as 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.

図5は、図2のDSPブロック216の更に詳細な構成を示すブロック図である。   FIG. 5 is a block diagram showing a more detailed configuration of the DSP block 216 of FIG.

DSPブロック216は、上述したように、画像用RAM241および信号処理用プロセッサ242で構成され、信号処理用プロセッサ242は、ホワイトバランス調整部251、ガンマ補正部252、デモザイク処理部253、ガンマ逆補正部254、マトリックス処理部255、ガンマ補正部256、および、YC変換部257で構成される。   As described above, the DSP block 216 includes the image RAM 241 and the signal processing processor 242, and the signal processing processor 242 includes the white balance adjustment unit 251, the gamma correction unit 252, the demosaic processing unit 253, and the gamma inverse correction unit. 254, a matrix processing unit 255, a gamma correction unit 256, and a YC conversion unit 257.

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 determined by the color filter used in the CCD image sensor 213 (for example, FIG. It is composed of periodic pattern intensity signals of the primary color four-color arrangement described above.

ホワイトバランス調整部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の全ての強度(強度情報)を揃えるデモザイク処理を実行する。したがって、デモザイク処理部253からの出力信号は、R,G,B,Eの4つの色に対応する4つの画像信号となる。ガンマ逆補正部254は、後段のマトリックス処理部255においてマトリックス処理を施すために、デモザイク後の4チャネル画像に適用したガンマ特性の逆を適用して、リニア特性に直す処理を行う。   The demosaic processing unit 253 statistically calculates the color distribution shape, thereby performing demosaic processing for aligning all the intensities (intensity information) of R, G, B, and E at each pixel position of the mosaic image subjected to gamma correction. Execute. 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 gamma inverse correction unit 254 performs a process of correcting the linear characteristic by applying the inverse of the gamma characteristic applied to the demosaiced 4-channel image in order to perform matrix processing in the matrix processing unit 255 in the subsequent stage.

マトリックス処理部255は、予め設定された係数による3行4列のリニアマトリックスを、供給された各画素[R,G,B,E]に適用することにより、3原色の強度値[Rm,Gm,Bm]に変換する。このマトリックス処理は、リニア特性の画像強度に対して適用する必要がある。リニアマトリックスの係数は、最適な色再現を発揮するために重要な設計項目であるが、マトリックス処理はデモザイク処理後に適用されるので、リニアマトリックス係数の具体値は、デモザイク処理とは関係なく設計することができる。マトリックス処理部255の出力は、色補正されたRm,Gm,Bmの3つの色に対応する3つの画像となる。   The matrix processing unit 255 applies an intensity value [Rm, Gm] of the three primary colors by applying a 3 × 4 linear matrix based on preset coefficients to the supplied pixels [R, G, B, E]. , Bm]. This matrix processing needs to be applied to linear image intensity. Linear matrix coefficients are important design items for optimal color reproduction, but since matrix processing is applied after demosaicing, the specific values of linear matrix coefficients are designed independently of demosaicing. be able to. The output of the matrix processing unit 255 is three images corresponding to the three colors Rm, Gm, and Bm that have been color corrected.

マトリックス処理後、ガンマ補正部256は、色補正された3チャネル画像に対して再度ガンマ補正を行う。YC変換部257はR,G,Bの3チャネル画像に、マトリックス処理およびクロマ成分に対する帯域制限を行うことで、Y画像およびC画像(YCbCr画像信号)を生成し、出力する。   After the matrix processing, the gamma correction unit 256 performs gamma correction again on the color-corrected three-channel image. The YC conversion unit 257 generates and outputs a Y image and a C image (YCbCr image signal) by subjecting the three-channel image of R, G, B to band processing for matrix processing and 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.

また、デモザイク処理前に適用するガンマ補正部252のガンマ特性と、YC変換前に適用するガンマ補正部256のガンマ特性は同じである必要はない。また、もちろん、本発明を適用する上で、デモザイク処理前のガンマ補正が必須というわけではない。   Further, the gamma characteristic of the gamma correction unit 252 applied before the demosaic process and the gamma characteristic of the gamma correction unit 256 applied before the YC conversion need not be the same. Of course, gamma correction before demosaic processing is not essential in applying the present invention.

次に、図6は、全画素位置でRGBEの全ての色が存在するように、画素位置ごとに順次、そこにない色の強度を補間または推定していく処理であるデモザイク処理を実行する、図5のデモザイク処理部253の更に詳細な構成を示すブロック図である。   Next, FIG. 6 executes a demosaic process that is a process of sequentially interpolating or estimating the intensity of a color that does not exist so that all RGBE colors exist at all pixel positions. It is a block diagram which shows the further detailed structure of the demosaic process part 253 of FIG.

デモザイク処理部253は、局所領域抽出部281、G+E強度推定処理部282、R強度推定部283−1、G強度推定部283−2、B強度推定部283−3、および、E強度推定部283−4で構成される。   The demosaic processing unit 253 includes a local region extraction unit 281, a G + E intensity estimation processing unit 282, an R intensity estimation unit 283-1, a G intensity estimation unit 283-2, a B intensity estimation unit 283-3, and an E intensity estimation unit 283. -4.

局所領域抽出部281は、ガンマ補正されたモザイク画像から、注目画素位置周囲の決まった大きさの局所領域の画素を切り出す。ここでは、切り出す局所領域を、注目画素位置を中心とした9×9画素の矩形領域とする。G+E強度推定処理部282は、局所領域内に存在する画素を用いて、注目画素位置におけるG+E強度を算出する。R強度推定部283−1、G強度推定部283−2、B強度推定部283−3、および、E強度推定部283−4は、局所領域内に存在する画素と、G+E強度推定処理部282が算出した注目画素位置のG+E強度とを用いて、RGBEのそれぞれの強度の推定値を演算する。R強度推定部283−1、G強度推定部283−2、B強度推定部283−3、および、E強度推定部283−4は、基本的に同様の構成を有しているので、以下、R強度推定部283−1、G強度推定部283−2、B強度推定部283−3、および、E強度推定部283−4を個別に区別する必要のない場合、R(G,B,またはE)強度推定部283と称するか、または、R強度推定部283−1、G強度推定部283−2、B強度推定部283−3、および、E強度推定部283−4の全てを、RGBE強度推定部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 area to be cut out is a 9 × 9 pixel rectangular area centered on the target pixel position. The G + E intensity estimation processing unit 282 calculates the G + E intensity at the target pixel position using pixels existing in the local region. The R intensity estimation unit 283-1, the G intensity estimation unit 283-2, the B intensity estimation unit 283-3, and the E intensity estimation unit 283-4 are the pixels existing in the local region and the G + E intensity estimation processing unit 282. Is used to calculate an estimated value of each RGBE intensity. Since the R intensity estimating unit 283-1, the G intensity estimating unit 283-2, the B intensity estimating unit 283-3, and the E intensity estimating unit 283-4 have basically the same configuration, When it is not necessary to individually distinguish the R intensity estimating unit 283-1, the G intensity estimating unit 283-2, the B intensity estimating unit 283-3, and the E intensity estimating unit 283-4, R (G, B, or E) Intensity estimation unit 283, or R intensity estimation unit 283-1, G intensity estimation unit 283-2, B intensity estimation unit 283-3, and E intensity estimation unit 283-4 are all RGBE It is assumed to be called an intensity estimation unit 283.

図7は、図6のG+E強度推定処理部282の構成を示すブロック図である。   FIG. 7 is a block diagram showing a configuration of the G + E intensity estimation processing unit 282 of FIG.

G+E強度推定処理部282は、G強度推定部291、E強度推定部292、および、加算処理部293により構成される。   The G + E intensity estimation processing unit 282 includes a G intensity estimation unit 291, an E intensity estimation unit 292, and an addition processing unit 293.

G強度推定部291は局所領域の画素を用いて注目画素位置のG強度の推定値を算出する。E強度推定部292は局所領域の画素を用いて注目画素位置のE強度の推定値を算出する。加算処理部293は算出されたG強度推定値とE強度推定値を加算することによって、注目画素位置の(G+E)強度推定値を算出する。図3を用いて説明した原色4色配列のカラーフィルタによって得られるモザイク画像においては、GとEとはどちらも1画素おきの間隔でしか信号が存在しないので、GのみまたはEのみの補間処理だけでは高周波の画像信号を再現できずにジャギネスやジッパーノイズを発生させやすい。しかしながら、互いに水平および垂直に1画素ずれた位置に配置されていることを利用し、GとEの信号を加算したような信号をすべての画素位置に再現することによって、それぞれの限界よりも高い高域の画像信号を再現することが可能になり、出力画像でジャギネスやノイズが発生するのを抑えることができる。   The G intensity estimation unit 291 calculates an estimated value of the G intensity at the target pixel position using the pixels in the local region. The E intensity estimation unit 292 calculates an estimated value of the E intensity at the target pixel position using the pixels in the local region. The addition processing unit 293 calculates the (G + E) intensity estimated value of the target pixel position by adding the calculated G intensity estimated value and the E intensity estimated value. In the mosaic image obtained by the color filter of the primary color four-color arrangement described with reference to FIG. 3, since both G and E have signals only at intervals of every other pixel, interpolation processing of only G or only E It is not easy to reproduce high-frequency image signals by itself, and it is easy to generate jagginess and zipper noise. However, by using the fact that they are arranged at a position that is deviated by one pixel horizontally and vertically, by reproducing a signal such as the sum of G and E signals at all pixel positions, it is higher than the respective limits. It becomes possible to reproduce a high-frequency image signal, and it is possible to suppress the occurrence of jagginess and noise in the output image.

図8は、G強度推定部291およびE強度推定部292の構成を示すブロック図である。まず、G強度推定部291とE強度推定部292との共通点について説明し、その後、G強度推定部291とE強度推定部292との差異について説明する。   FIG. 8 is a block diagram showing the configuration of the G intensity estimating unit 291 and the E intensity estimating unit 292. First, common points between the G intensity estimating unit 291 and the E intensity estimating unit 292 will be described, and then differences between the G intensity estimating unit 291 and the E intensity estimating unit 292 will be described.

G強度推定部291およびE強度推定部292は、それぞれ、注目画素選択部301、第1の処理ブロック302、第2の処理ブロック303、第3の処理ブロック304、テクスチャ方向判定部305、および、スイッチ306で構成されている。また、第1の処理ブロック302は、第1の強度推定部311で構成され、第2の処理ブロック303および第3の処理ブロック304は、第2の強度推定部321、第3の強度推定部322、第4の強度推定部323、スイッチ324で構成される。   The G intensity estimator 291 and the E intensity estimator 292 are a pixel-of-interest selector 301, a first processing block 302, a second processing block 303, a third processing block 304, a texture direction determination unit 305, and The switch 306 is configured. The first processing block 302 includes a first intensity estimation unit 311, and the second processing block 303 and the third processing block 304 include a second intensity estimation unit 321 and a third intensity estimation unit. 322, a fourth intensity estimation unit 323, and a switch 324.

注目画素選択部301は9×9画素の局所領域から注目画素位置すなわち中心の画素を選んでその画素強度を出力する。テクスチャ方向判定部305は、局所領域における画像のテクスチャを調べ、それが主に縦縞か横縞かを判定した結果を出力する。第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、第4の強度推定部323は、局所領域の画素と注目画素位置における所定の色の強度推定値に基づいて推定すべき色の強度を算出するものである。ここで、推定すべき色とは、G強度推定部291であればG、E強度推定部292であればEをさす。強度推定部が4種類存在するのは、与えられた注目画素位置の色強度が何色であるかということと、局所領域の色の配置によって処理の種類が4種類あるという理由による。スイッチ324は、テクスチャ方向判定部305が出力するテクスチャ方向の判定結果に基づき、入力された2つの強度推定値のどちらを使用するべきかを選択して出力する。スイッチ306は、本来のモザイク画像において注目画素位置の色が何色であるかに基づき、入力された4つの強度推定値のどれを使用するべきかを選択して出力する。スイッチ306の出力がG強度推定部291およびE強度推定部292の出力となる。   The target pixel selection unit 301 selects a target pixel position, that is, a central pixel from a 9 × 9 pixel local region, and outputs the pixel intensity. The texture direction determination unit 305 examines the texture of the image in the local region and outputs a result of determining whether it is mainly a vertical stripe or a horizontal stripe. The first intensity estimator 311, the second intensity estimator 321, the third intensity estimator 322, and the fourth intensity estimator 323 calculate the intensity estimate values of predetermined colors at the local region pixel and the target pixel position. Based on this, the intensity of the color to be estimated is calculated. Here, the color to be estimated indicates G for the G intensity estimation unit 291 and E for the E intensity estimation unit 292. The four types of intensity estimation units exist because of the color intensity of a given target pixel position and the reason that there are four types of processing depending on the color arrangement of the local region. The switch 324 selects and outputs which of the two input intensity estimation values should be used based on the texture direction determination result output by the texture direction determination unit 305. The switch 306 selects and outputs which of the four input intensity estimation values should be used based on the color of the target pixel position in the original mosaic image. The output of the switch 306 becomes the output of the G intensity estimating unit 291 and the E intensity estimating unit 292.

前述のように、G強度推定部291およびE強度推定部292の動作は、注目画素位置の色が本来何色であるかによって切り替わらなければならない。図8に示される構成では、注目画素の色に基づいた4種類の動作について、選択された注目画素をそのまま出力するか、または、第1の処理ブロック302、第2の処理ブロック303、第3の処理ブロック304において推定値を算出し、最後にスイッチ306によって、いずれの値を出力するかが選択されて出力されるようになされている。   As described above, the operations of the G intensity estimation unit 291 and the E intensity estimation unit 292 must be switched depending on the original color of the target pixel position. In the configuration shown in FIG. 8, for the four types of operations based on the color of the pixel of interest, the selected pixel of interest is output as it is, or the first processing block 302, the second processing block 303, and the third In the processing block 304, an estimated value is calculated, and finally, which value is to be output is selected and output by the switch 306.

4種類の動作について説明する。第1に、モザイク画像の注目画素位置が補間すべき色そのものであれば、特別な推定処理は必要なく、注目画素選択部301によって選択されたモザイク画像の注目画素の強度がそのまま出力されればよいので、注目画素選択部301の出力がスイッチ306から出力される(図中の入力aが出力される)ようになされる。第2に、モザイク画像の注目画素位置がGもしくはEであるが補間すべき色ではない場合は、第1の処理ブロック302の第1の強度推定部311によって、局所領域のGとEの画素情報に基づいて算出された強度推定値が、スイッチ306のから出力される(図中の入力bが出力される)ようになされる。   Four types of operations will be described. First, if the target pixel position of the mosaic image is the color to be interpolated, no special estimation process is required, and if the intensity of the target pixel of the mosaic image selected by the target pixel selection unit 301 is output as it is. Therefore, the output of the pixel-of-interest selection unit 301 is output from the switch 306 (the input a in the figure is output). Second, when the target pixel position of the mosaic image is G or E but is not a color to be interpolated, the first intensity estimation unit 311 of the first processing block 302 performs G and E pixels in the local region. An intensity estimated value calculated based on the information is output from the switch 306 (input b in the figure is output).

第3に、モザイク画像の注目画素位置が補間すべき色の画素と水平に1画素ずれた状態である場合、すなわち、補間すべき色がGならば注目画素位置がBで、補間すべき色がEならば注目画素位置がRであるときである場合、第2の処理ブロック303の第2の強度推定部321、第3の強度推定部322、第4の強度推定部323、および、スイッチ324の処理により算出された強度推定値が、スイッチ306から出力される(図中の入力cが出力される)ようになされる。第4に、モザイク画像の注目画素位置が補間すべき色の画素と垂直に1画素ずれた状態であるとき、すなわち、補間すべき色がGならば注目画素位置がRで、補間すべき色がEならば注目画素位置がBであるときである場合、第3の処理ブロック304の第3の強度推定部322、第2の強度推定部321、第4の強度推定部323、およびスイッチ324により算出された強度推定値が、スイッチ306から出力される(図中の入力dが出力される)ようになされる。   Third, when the target pixel position of the mosaic image is shifted horizontally by one pixel from the pixel to be interpolated, that is, if the color to be interpolated is G, the target pixel position is B, and the color to be interpolated If E is E, and the target pixel position is R, the second intensity estimating unit 321, the third intensity estimating unit 322, the fourth intensity estimating unit 323, and the switch of the second processing block 303 The estimated intensity value calculated by the process 324 is output from the switch 306 (the input c in the figure is output). Fourth, when the target pixel position of the mosaic image is shifted by one pixel vertically from the pixel of the color to be interpolated, that is, if the color to be interpolated is G, the target pixel position is R and the color to be interpolated If E is E, and the target pixel position is B, the third intensity estimating unit 322, the second intensity estimating unit 321, the fourth intensity estimating unit 323, and the switch 324 of the third processing block 304 are used. The intensity estimated value calculated by the above is output from the switch 306 (the input d in the figure is output).

ここで第2の処理ブロック303の動作について説明する。第2の強度推定部321は注目画素位置の色強度と局所領域の画素情報を用いて補間すべき色の強度推定値を算出する。第3の強度推定部322は注目画素位置の色強度と局所領域の画素情報を用いてGもしくはEのうち補間すべき色とは反対の色の強度推定値を算出する。そして、第3の強度推定部322による強度推定値に基づいて、第4の強度推定部323が補間すべき色の強度推定値を算出するようになっている。このようにして2つの強度推定値が算出されているが、それらはスイッチ324において、テクスチャ方向判定部305が判定したテクスチャ方向に基づき、いずれか一方が選択されて出力される。   Here, the operation of the second processing block 303 will be described. The second intensity estimation unit 321 calculates an intensity estimation value of the color to be interpolated using the color intensity of the target pixel position and the pixel information of the local region. The third intensity estimation unit 322 calculates an intensity estimation value of a color opposite to the color to be interpolated out of G or E using the color intensity of the target pixel position and the pixel information of the local region. Then, based on the intensity estimation value by the third intensity estimation unit 322, the fourth intensity estimation unit 323 calculates the intensity estimation value of the color to be interpolated. Two intensity estimation values are calculated in this way, and one of them is selected and output by the switch 324 based on the texture direction determined by the texture direction determination unit 305.

上述したように、第2の処理ブロック303の出力がスイッチ306で選択されるのは、モザイク画像の注目画素位置が補間すべき色の画素と水平に1画素ずれた状態である場合である。この時、画像が横縞のような水平方向に相関が高いようなテクスチャを持っているならば、注目画素位置の色は補間すべき色と強い相関を持っていることが期待できる。一方、画像が縦縞のような垂直方向に相関が高いようなテクスチャを持っているならば、注目画素位置の色は補間すべき色と強い相関を持っていることを期待することはできない。そこで、テクスチャが横縞に近い場合は、第2の強度推定部321によって注目画素位置の色から直接補間すべき色の強度を推定するようにし、逆に、テクスチャが縦縞に近い場合は、第3の強度推定部322によって注目画素位置の色から補間すべき色とは異なる色(Gに対するEまたはEに対するG)の強度を推定し、その後第4の強度推定部323によって算出された、補間すべき色の強度推定値が選択されるようになされている。   As described above, the output of the second processing block 303 is selected by the switch 306 when the target pixel position of the mosaic image is horizontally shifted from the pixel of the color to be interpolated by one pixel. At this time, if the image has a texture such as a horizontal stripe that has a high correlation in the horizontal direction, it can be expected that the color at the target pixel position has a strong correlation with the color to be interpolated. On the other hand, if the image has a texture that is highly correlated in the vertical direction, such as vertical stripes, it cannot be expected that the color at the target pixel position has a strong correlation with the color to be interpolated. Therefore, when the texture is close to horizontal stripes, the second intensity estimation unit 321 estimates the intensity of the color to be directly interpolated from the color at the target pixel position. Conversely, when the texture is close to vertical stripes, The intensity estimation unit 322 estimates the intensity of a color (E for G or G for E) different from the color to be interpolated from the color of the target pixel position, and then the interpolation calculated by the fourth intensity estimation unit 323 is performed. A power color intensity estimate is selected.

次に、第3の処理ブロック304の動作について説明する。第3の強度推定部322は注目画素位置の色強度と局所領域の画素情報を用いて補間すべき色の強度推定値を算出する。第2の強度推定部321は注目画素位置の色強度と局所領域の画素情報を用いてGもしくはEのうち補間すべき色とは反対の色の強度推定値を算出する。そして、第2の強度推定部321による強度推定値に基づいて、第4の強度推定部323が補間すべき色の強度推定値を算出するようになっている。このようにして2つの強度推定値が算出されているが、それらはスイッチ324において、テクスチャ方向判定部305が判定したテクスチャ方向に基づき、いずれか一方が選択されて出力される。   Next, the operation of the third processing block 304 will be described. The third intensity estimating unit 322 calculates an estimated intensity value of the color to be interpolated using the color intensity of the target pixel position and the pixel information of the local region. The second intensity estimation unit 321 calculates an intensity estimation value of a color of G or E opposite to the color to be interpolated using the color intensity of the target pixel position and the pixel information of the local region. Then, based on the intensity estimated value by the second intensity estimating unit 321, the fourth intensity estimating unit 323 calculates the intensity estimated value of the color to be interpolated. In this way, two intensity estimation values are calculated, and one of them is selected and output by the switch 324 based on the texture direction determined by the texture direction determination unit 305.

上述したように、第3の処理ブロック304の出力がスイッチ306で選択されるのは、モザイク画像の注目画素位置が補間すべき色の画素と垂直に1画素ずれた状態である場合である。この時、画像がたて縞のような垂直方向に相関が高いようなテクスチャを持っているならば、注目画素位置の色は補間すべき色と強い相関を持っていることが期待できる。一方、画像が横縞のような水平方向に相関が高いようなテクスチャを持っているならば、注目画素位置の色は補間すべき色と強い相関を持っていることを期待することはできない。そこで、テクスチャがたて縞に近い場合は、第3の強度推定部322によって注目画素位置の色から直接補間すべき色の強度を推定するようにし、逆に、テクスチャが横縞に近い場合は、第2の強度推定部321によって注目画素位置の色から補間すべき色とは異なる色(Gに対するEまたはEに対するG)の強度を推定し、その後第4の強度推定部323によって算出された、補間すべき色の強度推定値が選択されるようになされている。   As described above, the output of the third processing block 304 is selected by the switch 306 when the target pixel position of the mosaic image is shifted by one pixel vertically from the pixel of the color to be interpolated. At this time, if the image has a texture having a high correlation in the vertical direction such as a vertical stripe, it can be expected that the color at the target pixel position has a strong correlation with the color to be interpolated. On the other hand, if the image has a texture that is highly correlated in the horizontal direction, such as horizontal stripes, it cannot be expected that the color at the target pixel position has a strong correlation with the color to be interpolated. Therefore, when the texture is close to a vertical stripe, the third intensity estimation unit 322 estimates the intensity of the color to be directly interpolated from the color at the target pixel position. Conversely, when the texture is close to a horizontal stripe, The second intensity estimating unit 321 estimates the intensity of a color (E for G or G for E) different from the color to be interpolated from the color of the target pixel position, and then calculated by the fourth intensity estimating unit 323. A color intensity estimation value to be interpolated is selected.

このようにすることによって、細かい縞模様のように高周波成分が大きい画像信号に対する再現性を向上させることができる。   By doing in this way, the reproducibility with respect to an image signal with a large high frequency component like a fine stripe pattern can be improved.

以上、G強度推定部291およびE強度推定部292の動作の共通部分について説明したが、G強度推定部291とE強度推定部292との違いは、補間すべき色がGかEか、また、それによって、水平に隣接する色および垂直に隣接する色がRかBかの違いであって、それによってスイッチ306の振る舞いが異なる、という点のみである。図9を用いて、注目画素の色に対して、G強度推定部291とE強度推定部292のそれぞれのスイッチ306の出力について説明する。   The common part of the operations of the G intensity estimation unit 291 and the E intensity estimation unit 292 has been described above. The difference between the G intensity estimation unit 291 and the E intensity estimation unit 292 is that the color to be interpolated is G or E, Thus, the only difference is that the horizontally adjacent color and the vertically adjacent color are R or B, which causes the switch 306 to behave differently. The output of each switch 306 of the G intensity estimation unit 291 and the E intensity estimation unit 292 will be described with reference to FIG.

図9に示されるように、G強度推定部291のスイッチ306は、注目画素がRのとき、第3の処理ブロック304で算出された強度推定値を、スイッチ306から出力(図中の入力dを出力)し、注目画素がGのとき、注目画素選択部301の出力をスイッチ306から出力(図中の入力aを出力)し、注目画素がBのとき、第2の処理ブロック303で算出された強度推定値を、スイッチ306から出力(図中の入力cを出力)し、注目画素がEのとき、第1の処理ブロック302で算出された強度推定値を、スイッチ306のから出力(図中の入力bを出力)する。また、図9に示されるように、E強度推定部292のスイッチ306は、注目画素がRのとき、第2の処理ブロック303で算出された強度推定値を、スイッチ306から出力(図中の入力cを出力)し、注目画素がGのとき、第1の処理ブロック302で算出された強度推定値を、スイッチ306のから出力(図中の入力bを出力)し、注目画素がBのとき、第3の処理ブロック304で算出された強度推定値を、スイッチ306から出力(図中の入力dを出力)し、注目画素がEのとき、注目画素選択部301の出力をスイッチ306から出力(図中の入力aを出力)する。   As shown in FIG. 9, when the target pixel is R, the switch 306 of the G intensity estimating unit 291 outputs the intensity estimated value calculated in the third processing block 304 from the switch 306 (input d in the figure). When the target pixel is G, the output of the target pixel selection unit 301 is output from the switch 306 (output a in the figure), and when the target pixel is B, the second processing block 303 calculates The output intensity estimation value is output from the switch 306 (output c in the figure is output). When the target pixel is E, the intensity estimation value calculated in the first processing block 302 is output from the switch 306 ( The input b in the figure is output). Further, as shown in FIG. 9, when the target pixel is R, the switch 306 of the E intensity estimating unit 292 outputs the intensity estimated value calculated in the second processing block 303 from the switch 306 (in the drawing). Output c), and when the target pixel is G, the estimated intensity calculated in the first processing block 302 is output from the switch 306 (output b in the figure is output), and the target pixel is B At this time, the intensity estimation value calculated in the third processing block 304 is output from the switch 306 (output d in the figure), and when the target pixel is E, the output of the target pixel selection unit 301 is output from the switch 306. Output (output the input a in the figure).

図10は、図8の第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、または、第4の強度推定部323の構成を示すブロック図である。図8の第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、および、第4の強度推定部323は、粗補間処理部341において粗補間を実行する場合に取得される第2の色の選択方法が異なる以外は、基本的に同様の構成を有するものである。   FIG. 10 is a block diagram illustrating a configuration of the first intensity estimating unit 311, the second intensity estimating unit 321, the third intensity estimating unit 322, or the fourth intensity estimating unit 323 of FIG. 8. When the first intensity estimation unit 311, the second intensity estimation unit 321, the third intensity estimation unit 322, and the fourth intensity estimation unit 323 in FIG. 8 perform coarse interpolation in the coarse interpolation processing unit 341. The second color acquisition method basically has the same configuration except that the second color selection method is different.

粗補間処理部341は、所定の画素位置とその周辺の8画素を用いて、局所領域内の複数の画素位置において第1の色Crと第2の色Ceとの強度の組が作れるよう、簡単な演算によって、第1の色と第2の色との画素強度の推定値(以下、ラフな推定値と称する)を、後述する補間方法を用いて算出する。本発明においては色分布形状を推定するために、2次の統計量、または、それに相当する値を計算することが必要であり、そのために、同一画素位置における各色の強度が組となって得られている必要がある。この強度の組を生成するために、粗補間処理部341は、局所領域内の複数の画素(ここでは、n×n画素の局所領域に対して、注目画素を中心とした(n−2)×(n−2)画素)における第1の色と第2の色とのラフな推定値を算出する。   The coarse interpolation processing unit 341 uses a predetermined pixel position and the surrounding eight pixels so that a set of intensities of the first color Cr and the second color Ce can be created at a plurality of pixel positions in the local region. The pixel intensity estimation values (hereinafter referred to as rough estimation values) of the first color and the second color are calculated by a simple calculation using an interpolation method described later. In the present invention, in order to estimate the color distribution shape, it is necessary to calculate a second-order statistic or a value corresponding thereto, and for this reason, the intensity of each color at the same pixel position can be taken as a set. Need to be. In order to generate this intensity set, the coarse interpolation processing unit 341 has a plurality of pixels in the local region (here, the pixel of interest is centered on the local region of n × n pixels (n−2)). A rough estimated value of the first color and the second color in (× (n−2) pixels) is calculated.

統計量算出部342は、粗補間処理部341により算出された局所領域内の各画素における第1の色と第2の色との強度の組を用いて、2色間の統計量を算出する。具体的には、統計量算出部342は、第1の色の平均値、第2の色の平均値、第1の色の分散値、および、第1の色と第2の色の共分散値を演算して出力する。   The statistic calculation unit 342 calculates a statistic between two colors by using a pair of intensities of the first color and the second color in each pixel in the local area calculated by the coarse interpolation processing unit 341. . Specifically, the statistic calculation unit 342 calculates the average value of the first color, the average value of the second color, the dispersion value of the first color, and the covariance of the first color and the second color. Calculate and output the value.

回帰演算処理部343は、注目画素の画素強度と、統計量算出部342が算出した統計量とに基づいて、色分布形状の線形回帰計算を行い、注目画素位置における強度推定値を算出する。   The regression calculation processing unit 343 performs linear regression calculation of the color distribution shape based on the pixel intensity of the pixel of interest and the statistic calculated by the statistic calculator 342, and calculates an intensity estimation value at the pixel position of interest.

図8の第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、および、第4の強度推定部323は、以上説明したように、2つの色の統計的関係に基づいて、第1の色の強度推定値から第2の色の強度推定値を算出するものである。4種類の強度推定部の違いは、この2つの色をどのように選ぶかの違いであって、それは粗補間処理部341が第1の色Crと第2の色Ceとして2つの色を選択する方法の差であり、統計量算出部342および回帰演算処理部343の処理は共通である。第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、および、第4の強度推定部323のそれぞれの粗補間処理部341の処理について、図11乃至図14を用いて説明する。   As described above, the first intensity estimator 311, the second intensity estimator 321, the third intensity estimator 322, and the fourth intensity estimator 323 in FIG. Based on the relationship, the intensity estimate value of the second color is calculated from the intensity estimate value of the first color. The difference between the four types of intensity estimation units is the difference in how to select these two colors. The coarse interpolation processing unit 341 selects two colors as the first color Cr and the second color Ce. The processing of the statistic calculation unit 342 and the regression calculation processing unit 343 is common. The processing of the coarse interpolation processing unit 341 of each of the first intensity estimating unit 311, the second intensity estimating unit 321, the third intensity estimating unit 322, and the fourth intensity estimating unit 323 is described with reference to FIGS. Will be described.

第1の強度推定部311の粗補間処理部341は、2つの色として、注目画素位置にある色とその斜めに隣接する色を選択する。図11に注目画素がEである場合の局所領域を示す。注目画素がEである場合、斜めに存在するのはGなので、第1の強度推定部311の粗補間処理部341は、GとEの補間値の対を求める。   The coarse interpolation processing unit 341 of the first intensity estimating unit 311 selects a color at the target pixel position and a color adjacent thereto obliquely as two colors. FIG. 11 shows a local region when the pixel of interest is E. When the target pixel is E, since G is present obliquely, the coarse interpolation processing unit 341 of the first intensity estimating unit 311 obtains a pair of G and E interpolation values.

第2の強度推定部321の粗補間処理部341は、2つの色として注目画素位置にある色とその左右に隣接する色を選択する。図12に注目画素がBである場合の局所領域を示す。注目画素がBである場合、左右に存在するのはGなので、第2の強度推定部321の粗補間処理部341は、GとBの補間値の対を求める。   The coarse interpolation processing unit 341 of the second intensity estimation unit 321 selects a color at the target pixel position and two colors adjacent to the left and right as two colors. FIG. 12 shows a local region when the target pixel is B. When the target pixel is B, since G is present on the left and right, the coarse interpolation processing unit 341 of the second intensity estimating unit 321 obtains a pair of G and B interpolation values.

第3の強度推定部322の粗補間処理部341は、2つの色として注目画素位置にある色とその上下に隣接する色を選択する。図13に注目画素がRである場合の局所領域を示す。注目画素がRである場合、上下に存在するのはGなので、第3の強度推定部322の粗補間処理部341は、GとRの補間値の対を求める。   The coarse interpolation processing unit 341 of the third intensity estimation unit 322 selects a color at the target pixel position and two adjacent colors above and below it as two colors. FIG. 13 shows a local region when the target pixel is R. When the target pixel is R, since G is present above and below, the coarse interpolation processing unit 341 of the third intensity estimation unit 322 obtains a pair of G and R interpolation values.

第4の強度推定部323の粗補間処理部341は、2つの色として注目画素位置の左右に隣接する色と上下に隣接する色の2つを選択する。図14に注目画素がRである場合の局所領域を示す。注目画素がRである場合は左右および上下に存在するのはEとGなので、第4の強度推定部323の粗補間処理部341は、GとEの補間値の対を求める。   The coarse interpolation processing unit 341 of the fourth intensity estimation unit 323 selects two colors, the color adjacent to the left and right of the target pixel position and the color adjacent to the top and bottom as the two colors. FIG. 14 shows a local region when the target pixel is R. When the pixel of interest is R, E and G are present on the left and right and top and bottom, so the coarse interpolation processing unit 341 of the fourth intensity estimation unit 323 obtains a pair of G and E interpolation values.

図15は、図10の統計量算出部342の構成を示すブロック図である。   FIG. 15 is a block diagram illustrating a configuration of the statistic calculation unit 342 of FIG.

統計量算出部342は、平均値算出部361、平均値算出部363、分散算出部362、および、共分散算出部364によって構成されている。平均値算出部361は粗補間処理部341が算出した、局所領域におけるラフな2色の補間値のうちの第1の色の値の平均値を算出する。同様に、平均値算出部363は、粗補間処理部284が算出した、局所領域におけるラフな2色の補間値のうちの第2の平均値を算出する。分散算出部362は、平均値算出部361が算出した第1の色の平均値と、局所領域における第1の色のラフな補間値から、第1の色の分散値を算出する。共分散算出部364は、平均値算出部361が算出した第1の色の平均値と第1の色のラフな補間値、および、平均値算出部363が算出した第2の色の平均値と第2の色のラフな補間値から、第1の色と第2の色との共分散値を算出する。   The statistic calculation unit 342 includes an average value calculation unit 361, an average value calculation unit 363, a variance calculation unit 362, and a covariance calculation unit 364. The average value calculation unit 361 calculates the average value of the values of the first color among the rough two-color interpolation values in the local region calculated by the rough interpolation processing unit 341. Similarly, the average value calculation unit 363 calculates the second average value of the rough two-color interpolation values in the local region calculated by the rough interpolation processing unit 284. The variance calculation unit 362 calculates the variance value of the first color from the average value of the first color calculated by the average value calculation unit 361 and the rough interpolation value of the first color in the local region. The covariance calculation unit 364 calculates the average value of the first color calculated by the average value calculation unit 361, the rough interpolation value of the first color, and the average value of the second color calculated by the average value calculation unit 363. And a rough interpolated value of the second color, a covariance value of the first color and the second color is calculated.

平均値算出部361および平均値算出部363は、例えば、次の式(1)を用いて、平均値Mcを計算する。   The average value calculation unit 361 and the average value calculation unit 363 calculate the average value Mc using, for example, the following equation (1).

Figure 2005151549
・・・(1)
Figure 2005151549
... (1)

式(1)において、Croughiは、供給された色C(R,G,B、または、E)のラフな強度補間値のi(i=1乃至N)番目のデータである。色Cは、平均値算出部361においてはGであり、平均値算出部363においてはRである。また、wiは、i番目のデータに対する重み値(重み付け係数)である。 In Expression (1), C roughi is i (i = 1 to N) th data of the rough intensity interpolation value of the supplied color C (R, G, B, or E). The color C is G in the average value calculation unit 361 and R in the average value calculation unit 363. Wi is a weight value (weighting coefficient) for the i-th data.

重み値wiは、i番目のデータの位置から注目画素位置への距離などを指標として、予め設定されている値である。重み値wiは、注目画素位置に近いほど重み値が大きくなるように設定されるほうが好適である。   The weight value wi is a value set in advance using the distance from the position of the i-th data to the target pixel position as an index. It is preferable that the weight value wi is set so that the weight value becomes larger as the pixel position is closer.

分散算出部362は、例えば次の式(2)に示される計算式によって第1の色強度の分散値VC1C1を計算する。 The variance calculating unit 362 calculates the variance value V C1C1 of the first color intensity using, for example, the calculation formula shown in the following formula (2).

Figure 2005151549
・・・(2)
Figure 2005151549
... (2)

この式において、C1roughiは、色C1のラフな強度補間値のi番目のデータ、MC1は色C1の平均値、wiはi番目のデータに対する重み値である。重み値wiは、平均値算出部361および平均値算出部363が用いたものと同じものを用いればよい。 In this equation, C 1roughi is the i-th data of the rough intensity interpolation value of the color C1, M C1 is the average value of the color C1, and wi is a weight value for the i-th data. The weight value wi may be the same as that used by the average value calculation unit 361 and the average value calculation unit 363.

共分散算出部364は、例えば次の式(3)に示される計算式によって、第1の信号(ここではG)と、第2の信号(ここではR)の共分散値VC1C2を計算する。 The covariance calculation unit 364 calculates the covariance value V C1C2 of the first signal (here, G) and the second signal (here, R), for example, by the calculation formula shown in the following formula (3). .

この式において、C2roughiは色C2(ここでは、R)のラフな強度補間値のi番目のデータ、MC2は色C2の平均値である。 In this equation, C 2roughi is the i-th data of the rough intensity interpolation value of the color C2 (here, R), and M C2 is the average value of the color C2.

Figure 2005151549
・・・(3)
Figure 2005151549
... (3)

式(2)を用いて説明した分散値の計算、および、式(3)を用いて説明した共分散の計算が実行された場合、定義どおりの正確な統計量が得られる。しかしながら、式(2)および式(3)の計算が実行された場合、積算が多く出現するために計算時間が長くなり、この演算をハードウェアで実現したときの回路規模が増加してしまう。そこで、より簡易な計算で、分散および共分散を算出するようにしてもよい。   When the calculation of the variance value described using the equation (2) and the calculation of the covariance described using the equation (3) are executed, accurate statistics as defined can be obtained. However, when the calculations of Formula (2) and Formula (3) are executed, a large amount of integration appears, so that the calculation time becomes long, and the circuit scale when this calculation is realized by hardware increases. Therefore, the variance and covariance may be calculated by simpler calculation.

例えば、共分散の演算に、次の式(4)を用いるようにしても良い。   For example, the following equation (4) may be used for the covariance calculation.

Figure 2005151549
・・・(4)
Figure 2005151549
... (4)

ここで、関数sgn(a,b)は、2変数aとbの符号の一致を調べるものである。sgn(a,b)の出力は{1,0,-1}のうちのいずれかであるので、sgn{a,b}の演算は、実際には積算を必要としない。式(4)の計算は、式(3)の計算の各i番目のGとRとの偏差の積算を、GとRとの絶対偏差の和算に置き換えたものである。式(4)を用いて積算を和算に置き換えても、本発明の目的とする局所領域の色分布形状推定には充分な精度を有する近似値を算出することができる。   Here, the function sgn (a, b) is for checking the coincidence of the signs of the two variables a and b. Since the output of sgn (a, b) is one of {1, 0, -1}, the operation of sgn {a, b} does not actually require integration. The calculation of equation (4) replaces the i-th deviation of G and R in the calculation of equation (3) with the sum of absolute deviations of G and R. Even if the integration is replaced with summation using equation (4), it is possible to calculate an approximate value having sufficient accuracy for estimating the color distribution shape of the local region targeted by the present invention.

また、例えば、共分散の演算に、次の式(5)を用いるようにしても良い。   Further, for example, the following equation (5) may be used for the covariance calculation.

Figure 2005151549
・・・(5)
Figure 2005151549
... (5)

ここで、式(5)の計算は、式(3)の計算の各i番目のGとRとの偏差の積算を、GとRとの最小値の選択処理に置き換えたものである。なお、式(4)の計算より、式(5)の計算のほうが、式(3)における共分散演算への近似精度が良い。   Here, the calculation of Expression (5) is obtained by replacing the integration of deviations of each i-th G and R in the calculation of Expression (3) with the process of selecting the minimum value of G and R. Note that the calculation of equation (5) has better approximation accuracy to the covariance calculation in equation (3) than the calculation of equation (4).

式(4)または式(5)を用いて、式(3)に示される共分散の演算に対する近似演算が可能であることについて説明したが、式(2)を用いて説明した分散演算は、2つの入力が等しい場合の共分散と同等であるので、式(2)を用いて説明した分散演算も、式(4)または式(5)を用いて、同様にして近似演算することが可能であることは言うまでもない。具体的には、分散演算を近似した場合は、式(4)または式(5)のいずれを用いても、(C1roughi−MC12が(C1roughi−MC1)に近似される。 The expression (4) or the expression (5) is used to explain that the approximation operation for the covariance operation shown in the expression (3) is possible, but the dispersion operation described using the expression (2) is Since it is equivalent to the covariance when the two inputs are equal, the variance calculation described using equation (2) can be similarly approximated using equation (4) or equation (5). Needless to say. Specifically, when the variance calculation is approximated, (C 1roughi −M C1 ) 2 is approximated to (C 1roughi −M C1 ) regardless of which of the equations (4) and (5) is used.

次に、図16は、回帰演算処理部343の構成を示すブロック図である。回帰演算処理部286は、次の式(6)に示される回帰直線を求めることにより、所定の画素強度を推定する。   Next, FIG. 16 is a block diagram illustrating a configuration of the regression calculation processing unit 343. The regression calculation processing unit 286 estimates a predetermined pixel intensity by obtaining a regression line represented by the following equation (6).

Figure 2005151549
・・・(6)
Figure 2005151549
... (6)

回帰演算処理部343は、傾き算出部381、および、画素強度推定部382で構成されている。   The regression calculation processing unit 343 includes an inclination calculation unit 381 and a pixel intensity estimation unit 382.

傾き算出部381は、Rの平均値MRとGの平均値MGに基づいたG−R色分布の傾きKmを算出する。具体的には、回帰演算処理部286は、式(7)の数式に示されるように、2つの平均値の比率を計算する。ここでは、C1はG、C2はRである。 The inclination calculation unit 381 calculates the inclination Km of the GR color distribution based on the average value MR of R and the average value MG of G. Specifically, the regression calculation processing unit 286 calculates the ratio of the two average values as shown in the equation (7). Here, C1 is G and C2 is R.

Figure 2005151549
・・・(7)
Figure 2005151549
... (7)

Mthresholdはゼロで除算することにより値が発散するのを回避するための定数であり、
十分に小さい正の値が予め設定されている。
M threshold is a constant to avoid divergence by dividing by zero,
A sufficiently small positive value is preset.

または、傾き算出部381は、C1とC2の共分散値VC1,C2とC1の分散値VC1,C1に基づいたC1−C2の色分布の傾きKsを算出する。ここで、C1はG、C2はRである。具体的には、傾き算出部381は、式(8)に示されるように、分散、共分散値の比率を計算する。 Alternatively, the slope calculation unit 381 calculates the slope Ks of the C1-C2 color distribution based on the C1 and C2 covariance values V C1, C2 and the C1 variance values V C1, C1 . Here, C1 is G and C2 is R. Specifically, the slope calculation unit 381 calculates the ratio between the variance and the covariance value as shown in Expression (8).

Figure 2005151549
・・・(8)
Figure 2005151549
... (8)

Vthresholdは、ゼロで除算することによって値が発散するのを回避するための定数であり、十分に小さい正の値が予め設定される。式(8)におけるVthresholdを用いて、分母のC1の分散をクリップすることにより、ゼロによる除算を回避することができるが、Vthresholdを用いたクリッピングは、更に、画像の平坦部分におけるノイズを低減するために活用することができる。 V threshold is a constant for avoiding the value to diverge by dividing by zero, and a sufficiently small positive value is set in advance. Using V threshold in Equation (8) to clip the variance of C1 in the denominator, division by zero can be avoided, but clipping with V threshold further reduces noise in the flat part of the image. Can be used to reduce.

すなわち、分母であるC1の分散は、その局所領域の輝度のばらつきを反映した値であり、その値が小さいことは、その局所領域が平坦であることと同義である。固体撮像素子のノイズは、画像が平坦であるほど良く目立つため、画像の平坦な部分に限ってノイズ低減処理を施すようにすると、全体の画像の品質を下げることなく、目立つノイズを効果的に低減させることができ、好適である。また、色分布の傾きKsの分母をクリップし、それ以上分母が小さくならないようにすることによって、Ksの絶対値が元の値より小さい値となるように抑制することができる。傾きKsの絶対値が小さく抑制されることによって、C1に対するC2の変化率が小さくなり、結果的に、その局所領域でのC2の振幅を抑制することができるという効果が生じる。   That is, the variance of C1 as the denominator is a value reflecting the variation in luminance of the local region, and a small value is synonymous with the fact that the local region is flat. Since the noise of a solid-state image sensor stands out better as the image becomes flat, if noise reduction processing is performed only on the flat part of the image, the noticeable noise is effectively reduced without degrading the overall image quality. This can be reduced and is preferable. Also, by clipping the denominator of the gradient Ks of the color distribution so that the denominator does not become any smaller, the absolute value of Ks can be suppressed to be smaller than the original value. By suppressing the absolute value of the slope Ks to be small, the rate of change of C2 with respect to C1 is reduced, and as a result, the effect that the amplitude of C2 in the local region can be suppressed occurs.

以上のように、傾きKsの分母に対するクリッピング処理により、画像が平坦かどうかの判定と出力振幅の抑制との両方の処理を実行した場合と同様に、ノイズ低減の作用がある。このように、本発明の色推定方法を用いれば、別途ノイズ低減処理を追加しなくても画像の平坦な部分で目立つノイズを抑制することができる。   As described above, the clipping process for the denominator of the slope Ks has the effect of reducing noise, as in the case where both the process of determining whether the image is flat and the process of suppressing the output amplitude are executed. Thus, by using the color estimation method of the present invention, it is possible to suppress noticeable noise in a flat portion of an image without adding a separate noise reduction process.

すなわち、傾き算出部381は、KsまたはKmのいずれか一方を、回帰直線の傾きKとして、画素強度推定部382に供給する。ここで、KsよりもKmのほうが計算が簡易な反面、第1の色と第2の色との間に強い相関をあまり期待できない場合、Ksを用いたほうがより正しい推定値が得られる。逆に、第1の色と第2の色との間に強い相関を期待してよい場合、Kmを用いても十分な推定値を得ることができる。すなわち、図4を用いて説明したように、GとEとの分光特性に強い相関がある場合には、得られるGとEの画像信号にも強い相関を期待してよいので、GとEを第1の色と第2の色として用いる第1の強度推定部311および第4の強度推定部323では、傾きKにKmを用いてより簡易な計算で強度推定を行うことが可能である。逆にRもしくはBのどちらを必ず用いる第2の強度推定部321および第3の強度推定部322では、傾きKにKsを用いたほうがよい。   That is, the inclination calculation unit 381 supplies either Ks or Km to the pixel intensity estimation unit 382 as the inclination K of the regression line. Here, Km is easier to calculate than Ks, but if a strong correlation between the first color and the second color cannot be expected so much, a more accurate estimated value can be obtained by using Ks. Conversely, when a strong correlation between the first color and the second color can be expected, a sufficient estimated value can be obtained even if Km is used. That is, as described with reference to FIG. 4, when there is a strong correlation between the spectral characteristics of G and E, a strong correlation may be expected for the obtained G and E image signals. In the first intensity estimating unit 311 and the fourth intensity estimating unit 323 using the first and second colors as the first color and the second color, it is possible to perform the intensity estimation by simpler calculation using Km as the slope K. . Conversely, in the second intensity estimation unit 321 and the third intensity estimation unit 322 that always use either R or B, it is better to use Ks for the slope K.

図17は、図16のR強度推定部283−1乃至E強度推定部283−4の構成を示すブロック図である。図17においては、信頼度算出部471、粗補間処理部472、および、合成処理部473をそれぞれ1つずつ図示し、RGBE強度推定部283として図示しているが、R強度推定部283−1乃至E強度推定部283−4のそれぞれに、信頼度算出部471、粗補間処理部472、および、合成処理部473を設けるようにしてもよいことは言うまでもない。   FIG. 17 is a block diagram illustrating a configuration of the R intensity estimating unit 283-1 to the E intensity estimating unit 283-4 of FIG. In FIG. 17, each of the reliability calculation unit 471, the rough interpolation processing unit 472, and the synthesis processing unit 473 is illustrated as one RGBE intensity estimating unit 283, but the R intensity estimating unit 283-1 is illustrated. It goes without saying that the reliability calculation unit 471, the rough interpolation processing unit 472, and the synthesis processing unit 473 may be provided in each of the E intensity estimation units 283-4.

信頼度算出部471は、局所領域抽出部281により抽出されたn×n(例えば、9×9)画素の矩形局所領域の画素と、G+E強度推定処理部282が算出した注目画素位置のG+E強度とを用いて、注目画素位置における色分布形状推定の信頼度を算出する。本発明を適用したデモザイク処理における色分布形状推定では、抽出された局所領域内に、2種類の異なる色の領域があることを想定している。通常の物体輪郭領域に関しては、この仮定が当てはまることが多いので、この仮定で、充分正確な輪郭の色再現が可能である。しかしながら、画像の中にはその仮定が当てはまらず、局所領域内に異なる3色が存在するような場合もあり得る。典型的には、細い縞模様状のテクスチャにおける場合であり、このようなテクスチャにおいて、局所領域内に多くの色が含まれ易い。そこで、信頼度算出部471は、このような細い縞模様状のテクスチャを検出し、そのテクスチャの強度に基づいて、この局所領域における色分布形状の推定の正確さを予想する値である信頼度値を出力する。信頼度をどのように算出するかについては後述する。   The reliability calculation unit 471 includes n × n (for example, 9 × 9) pixels in the rectangular local region extracted by the local region extraction unit 281 and the G + E intensity of the target pixel position calculated by the G + E intensity estimation processing unit 282. Are used to calculate the reliability of color distribution shape estimation at the target pixel position. In the color distribution shape estimation in the demosaic process to which the present invention is applied, it is assumed that there are two different color regions in the extracted local region. Since this assumption is often applied to a normal object contour region, sufficiently accurate contour color reproduction is possible with this assumption. However, the assumption is not true in the image, and there may be cases where three different colors exist in the local region. Typically, this is a case of a thin striped texture. In such a texture, many colors are likely to be included in the local region. Therefore, the reliability calculation unit 471 detects such a thin striped texture, and the reliability is a value that predicts the accuracy of estimation of the color distribution shape in this local region based on the intensity of the texture. Output the value. How to calculate the reliability will be described later.

粗補間処理部472は、局所領域内の複数の画素位置においてR,G,B,E各色の強度の組が作れるよう、簡単な演算によって、R,G,B,Eの画素強度の推定値(以下、ラフな推定値と称する)を、後述する補間方法を用いて算出する。本発明においては色分布形状を推定するために、2次の統計量、または、それに相当する値を計算することが必要であり、そのために、同一画素位置における各色の強度が組となって得られている必要がある。この強度の組を生成するために、粗補間処理部742は、局所領域内の複数の画素(ここでは、n×n画素の局所領域に対して、注目画素を中心とした(n−2)×(n−2)画素)におけるR,G,B,Eのラフな推定値を算出する。   The coarse interpolation processing unit 472 estimates the R, G, B, and E pixel intensities by a simple calculation so that a set of intensities of R, G, B, and E colors can be created at a plurality of pixel positions in the local region. (Hereinafter, referred to as a rough estimated value) is calculated using an interpolation method described later. In the present invention, in order to estimate the color distribution shape, it is necessary to calculate a second-order statistic or a value corresponding thereto, and for this reason, the intensity of each color at the same pixel position can be taken as a set. Need to be. In order to generate this set of intensities, the coarse interpolation processing unit 742 has a plurality of pixels in the local region (here, the pixel of interest is centered on the n × n pixel local region (n−2)). A rough estimated value of R, G, B, E in (× (n−2) pixels) is calculated.

合成処理部473は、粗補間処理部472により算出されたR,G,B,Eのラフな推定値のうち、GとEのラフな推定値を合成し、GEの合成されたラフな推定値を算出する。   The synthesis processing unit 473 combines the rough estimation values of G and E among the rough estimation values of R, G, B, and E calculated by the rough interpolation processing unit 472, and generates a rough estimation by combining the GEs. Calculate the value.

統計量算出部342−1乃至統計量算出部342−4は、図15を用いて説明した統計量算出部342と基本的に同様の構成を有している。統計量算出部342−1は、合成処理部473から供給されたGEの合成されたラフな推定値と、粗補間処理部472により算出されたRのラフな推定値を基に、統計量を算出し、回帰演算処理部474−1に供給する。統計量算出部342−2は、合成処理部473から供給されたGEの合成されたラフな推定値と、粗補間処理部472により算出されたGのラフな推定値を基に、統計量を算出し、回帰演算処理部474−2に供給する。統計量算出部342−3は、合成処理部473から供給されたGEの合成されたラフな推定値と、粗補間処理部472により算出されたBのラフな推定値を基に、統計量を算出し、回帰演算処理部474−3に供給する。統計量算出部342−4は、合成処理部473から供給されたGEの合成されたラフな推定値と、粗補間処理部472により算出されたEのラフな推定値を基に、統計量を算出し、回帰演算処理部474−4に供給する。   The statistic calculators 342-1 to 342-4 have basically the same configuration as the statistic calculators 342 described with reference to FIG. The statistic calculation unit 342-1 calculates the statistic based on the rough estimated value synthesized by the GE supplied from the synthesis processing unit 473 and the rough estimated value of R calculated by the rough interpolation processing unit 472. It calculates and supplies to the regression calculation process part 474-1. The statistic calculation unit 342-2 calculates a statistic based on the rough estimated value obtained by combining the GE supplied from the combining processing unit 473 and the rough estimated value of G calculated by the rough interpolation processing unit 472. It calculates and supplies to the regression calculation process part 474-2. The statistic calculation unit 342-3 calculates the statistic based on the rough estimated value obtained by combining the GE supplied from the combining processing unit 473 and the rough estimated value of B calculated by the rough interpolation processing unit 472. It calculates and supplies to the regression calculation process part 474-3. The statistic calculation unit 342-4 calculates the statistic based on the rough estimated value obtained by combining the GE supplied from the combining processing unit 473 and the rough estimated value of E calculated by the rough interpolation processing unit 472. It calculates and supplies to the regression calculation process part 474-4.

回帰演算処理部474−1乃至474−4は、G+E強度推定処理部282が算出した注目画素位置のG+E強度、信頼度算出部471が算出した信頼度情報、および、統計量算出部342−1乃至統計量算出部342−4のうちのいずれか対応するものが算出した統計量を基に、回帰演算を行い、回帰演算処理部474−1はRの推定値を、回帰演算処理部474−2はGの推定値を、回帰演算処理部474−3はBの推定値を、回帰演算処理部474−4はEの推定値をそれぞれ算出して出力する。   The regression calculation processing units 474-1 to 474-4 include the G + E intensity of the target pixel position calculated by the G + E intensity estimation processing unit 282, the reliability information calculated by the reliability calculation unit 471, and the statistic calculation unit 342-1. Thru | or the statistic calculation part 342-4 based on the statistic which the corresponding one calculated, performs a regression calculation, and the regression calculation process part 474-1 uses the estimated value of R as a regression calculation process part 474-. 2 calculates an estimated value of G, a regression calculation processing unit 474-3 calculates an estimated value of B, and a regression calculation processing unit 474-4 calculates and outputs an estimated value of E.

図18は、信頼度算出部471の構成を示すブロック図である。信頼度算出部471は、具体的には、細い縞模様状のテクスチャを検出するために、注目画素位置周囲の(G+E)強度に対する方向別の低周波フィルタを算出して、注目画素位置の(G+E)強度との差分演算処理を実行することにより、高周波抽出を行って、注目画素位置周囲において「明−暗−明」または「暗−明−暗」といった輝度変化がある場合、これを方向別に検出し、方向別の検出結果を統合することによって信頼度を算出する。信頼度算出部471は、高周波抽出部481−1乃至481−6、加算処理部482、および、クリップ処理部483で構成される。6つの高周波抽出部481−1乃至481−6は、注目画素を中心として、それぞれ異なる6つの方向の高周波抽出を行い、その強度を出力する。   FIG. 18 is a block diagram illustrating a configuration of the reliability calculation unit 471. Specifically, the reliability calculation unit 471 calculates a low-frequency filter for each direction with respect to the (G + E) intensity around the target pixel position in order to detect a texture with a thin striped pattern. G + E) By performing a difference calculation process with intensity, high-frequency extraction is performed, and when there is a luminance change such as “bright-dark-bright” or “dark-bright-dark” around the target pixel position, this is indicated as a direction. The reliability is calculated by separately detecting and integrating the detection results for each direction. The reliability calculation unit 471 includes high frequency extraction units 481-1 to 481-6, an addition processing unit 482, and a clip processing unit 483. The six high-frequency extraction units 481-1 to 481-6 perform high-frequency extraction in six different directions around the target pixel and output the intensity.

信頼度算出部471の周波抽出部481−1乃至481−6による方向別高周波抽出の具体例について、図19を用いて説明する。図19は、局所領域抽出部281により抽出された、9×9画素の局所領域を示したものである。説明のため、図中、画素の行および列に1乃至9の番号が割り当てられている。図19Aは、注目画素(図中、5行5列目の位置にある画素)がEである場合、図19Bは、注目画素がRである場合を示す。なお、信頼度の算出に関してはGおよびEの画素のみを用いるので、注目画素がGである場合はEである場合と同様の処理が実行されて、注目画素がBである場合はRである場合と同様の処理が実行される。   A specific example of direction-specific high-frequency extraction by the frequency extraction units 481-1 to 481-6 of the reliability calculation unit 471 will be described with reference to FIG. FIG. 19 shows a local area of 9 × 9 pixels extracted by the local area extraction unit 281. For purposes of illustration, numbers 1-9 are assigned to pixel rows and columns in the figure. 19A shows the case where the pixel of interest (the pixel at the position of the fifth row and the fifth column in the figure) is E, and FIG. 19B shows the case where the pixel of interest is R. Since only the G and E pixels are used for the calculation of the reliability, when the target pixel is G, the same processing as that for E is executed, and when the target pixel is B, it is R. The same processing as in the case is executed.

まず、画素から水平および垂直にちょうど1/2だけずれた(すなわち、4つの画素に囲まれる)位置であって、注目画素に近い位置から12箇所の位置(図中、丸印で示される位置)の(G+E)強度が算出される。具体的には、図19に示した12箇所の位置の全てにおいて、斜めにGの画素とEの画素とが隣接しているので、その2つの画素の強度の平均値を用いて、12箇所それぞれの(G+E)強度とする。ここで、注目画素がGまたはEである場合と、注目画素がRまたはBである場合とでは、隣接するGの方向が異なるが、いずれの場合においても、それぞれの位置でGおよびEが存在する方向は、注目画素がGもしくはEであるか、または、RもしくはBのいずれかであるかを基に判別することができる。   First, 12 positions from positions close to the target pixel (positions indicated by circles in the figure) that are shifted from the pixel by exactly ½ in the horizontal and vertical directions (that is, surrounded by four pixels). ) (G + E) intensity is calculated. Specifically, since the G pixel and the E pixel are diagonally adjacent to each other at the 12 positions shown in FIG. 19, the average value of the intensity of the two pixels is used to determine the 12 positions. Each (G + E) intensity is used. Here, when the target pixel is G or E, and when the target pixel is R or B, the directions of adjacent G are different, but in either case, G and E exist at each position. The direction to be determined can be determined based on whether the target pixel is G or E, or R or B.

このようにして、12箇所において(G+E)強度が算出された後、それらを用いて6方向の低周波フィルタを計算する。図20を用いてフィルタの方向について説明する。図20においては、局所領域中、特に、注目画素付近の5×5画素のみが図示されている。   Thus, after the (G + E) intensity is calculated at 12 locations, a low frequency filter in 6 directions is calculated using them. The direction of the filter will be described with reference to FIG. In FIG. 20, only 5 × 5 pixels in the vicinity of the target pixel are shown in the local region.

12箇所の(G+E)強度の算出位置は、注目画素位置(図20における図中の3行3列目)を中心に点対称の配置となっていて、互いに対称の位置にある(G+E)強度の対が、図中、Aで示される(G+E)強度の組、Dで示される(G+E)強度の組、VAで示される(G+E)強度の組、VDで示される(G+E)強度の組、HAで示される(G+E)強度の組、および、HDで示される(G+E)強度の組の、合計6つできる。これらの6つの(G+E)強度の対において、それぞれ平均値を算出するようなフィルタを用いれば、6方向の低周波フィルタが算出される。更に、それら低周波フィルタの出力と注目画素位置の(G+E)強度の差分をとれば、方向別の高周波抽出ができる。   The 12 (G + E) intensity calculation positions are arranged symmetrically with respect to the pixel position of interest (the third row and the third column in the drawing in FIG. 20), and the (G + E) intensities are in mutually symmetrical positions. In the figure, a pair of (G + E) intensity indicated by A, a group of (G + E) intensity indicated by D, a group of (G + E) intensity indicated by VA, and a group of (G + E) intensity indicated by VD , (G + E) intensity set indicated by HA and (G + E) intensity set indicated by HD. In these six (G + E) intensity pairs, if a filter that calculates an average value is used, a low-frequency filter in six directions is calculated. Further, if the difference between the output of the low-frequency filter and the (G + E) intensity at the target pixel position is taken, high-frequency extraction for each direction can be performed.

そして、加算処理部482は、6つの高周波抽出結果を適当なバランスで加算した値を出力する。クリップ処理部483は、加算処理部482による加算処理結果にクリッピング処理を施し、クリップされた高周波抽出の加算値を信頼度値として出力する。   Then, the addition processing unit 482 outputs a value obtained by adding the six high-frequency extraction results with an appropriate balance. The clip processing unit 483 performs clipping processing on the addition processing result of the addition processing unit 482, and outputs the added value of the clipped high frequency extraction as a reliability value.

算出される信頼度値は、細い縞模様状のテクスチャの強度が大きいほど信頼度値が大きくなるので、信頼度値が小さいほうが統計量による色分布形状の推定が確かである可能性が高いということになる。   The calculated reliability value increases as the strength of the thin striped texture increases, so the smaller the reliability value is, the more likely it is that the estimation of the color distribution shape by statistics is more certain. It will be.

次に、粗補間処理部284は、局所領域内の複数の位置においてR,G,B,E各色の強度の組が作れるよう、複雑な計算方法でない方法で、R,G,B,Eの推定値(ラフな推定値)を、補間によって算出する。図21を用いて、粗補間処理部284による粗補間処理について説明する。   Next, the coarse interpolation processing unit 284 uses a method that is not a complicated calculation method so that a set of intensities of R, G, B, and E colors can be created at a plurality of positions in the local region. An estimated value (rough estimated value) is calculated by interpolation. The coarse interpolation process by the coarse interpolation processing unit 284 will be described with reference to FIG.

図21は、局所領域抽出部281により抽出された、9×9画素の局所領域の画素を示したものである。粗補間処理部284は、この9×9の画素領域のうち、2行目乃至8行目および2列目乃至8列目の7×7の画素位置上に、ラフな補間を用いてR,G,B,E強度を揃えるようにする。例えば、Eに注目すると、図中2行2列目の画素に示されるように、周囲斜め4方向の画素からGの補間値を計算することができ、2行4列目の画素に示されるように、上下2画素からRの補間値を計算することができ、また、2行6列目の画素に示されるように、左右2画素からBの補間値を計算することができる。カラーフィルタの色配列がベイヤー配列である場合、このような斜め4画素、上下2画素、左右2画素からの補間はどの画素位置でも可能であり、自分自身の画素値を含めると、それぞれR,G,B,Eのいずれかの補間値となる。すなわち、各画素位置の信号の色(補正前の色)を含めると、各画素で必ずRの補間値が1つ、Gの補間値が1つ、Bの補間値が1つ、Eの補間値が1つ得られる。このようにして、粗補間処理部284は、R,G,B,Eのラフな推定値を各画素位置で算出することができる。   FIG. 21 shows the pixels in the local area of 9 × 9 pixels extracted by the local area extraction unit 281. The rough interpolation processing unit 284 uses the rough interpolation to perform R, R on the 7 × 7 pixel positions in the second to eighth rows and the second to eighth columns in the 9 × 9 pixel region. Make the G, B, and E intensities uniform. For example, when attention is paid to E, as shown in the pixel in the second row and the second column in the figure, the interpolation value of G can be calculated from the pixels in the surrounding oblique four directions, and is shown in the pixel in the second row and the fourth column. Thus, the interpolation value of R can be calculated from the upper and lower two pixels, and the interpolation value of B can be calculated from the two left and right pixels as shown by the pixel in the second row and the sixth column. If the color arrangement of the color filter is a Bayer arrangement, interpolation from four diagonal pixels, two upper and lower pixels, and two left and right pixels can be performed at any pixel position. Interpolated value of any of G, B, E. That is, if the color of the signal at each pixel position (color before correction) is included, each pixel always has one R interpolation value, one G interpolation value, one B interpolation value, and E interpolation. One value is obtained. In this way, the rough interpolation processing unit 284 can calculate rough estimated values of R, G, B, and E at each pixel position.

ここで、粗補間処理部284で得られるR,G,B,Eの推定値は、同じ位置におけるR,G,B,Eの推定値の組が得られればよいのであって、必ずしも本来のセンサの画素位置上でなくてもかまわない。   Here, the estimated values of R, G, B, and E obtained by the coarse interpolation processing unit 284 only need to obtain a set of estimated values of R, G, B, and E at the same position. It does not have to be on the pixel position of the sensor.

次に、図22は、回帰演算処理部474の構成を示すブロック図である。図22においては、Rに関する回帰演算処理部474(すなわち、回帰演算処理部474−1)を示しているが、G,BおよびEに関する動作は、RをG,BまたはEに置き換えればよいだけであり、基本的に同一の処理が実行される。   Next, FIG. 22 is a block diagram illustrating a configuration of the regression calculation processing unit 474. In FIG. 22, the regression calculation processing unit 474 (that is, the regression calculation processing unit 474-1) relating to R is shown, but the operation relating to G, B, and E only needs to replace R with G, B, or E. Basically, the same processing is executed.

回帰演算処理部474は、傾き算出部501、傾き算出部502、傾き合成部503、および、画素強度推定部504で構成されている。   The regression calculation processing unit 474 includes an inclination calculation unit 501, an inclination calculation unit 502, an inclination synthesis unit 503, and a pixel intensity estimation unit 504.

傾き算出部501は、Rの平均値MRとGの平均値MGに基づいたG−R色分布の傾きKmを算出する。具体的には、回帰演算処理部474は、上述した式(7)を用いて、2つの平均値の比率を計算する。ここでは、C1はG、C2はRである。 The inclination calculation unit 501 calculates an inclination Km of the GR color distribution based on the average value MR of R and the average value MG of G. Specifically, the regression calculation processing unit 474 calculates the ratio of the two average values using the above-described equation (7). Here, C1 is G and C2 is R.

Mthresholdはゼロで除算することにより値が発散するのを回避するための定数であり、十分に小さい正の値が予め設定されている。 M threshold is a constant for avoiding the value to diverge by dividing by zero, and a sufficiently small positive value is set in advance.

傾き算出部502は、C1とC2の共分散値VC1,C2とC1の分散値VC1,C1に基づいたC1−C2の色分布の傾きKsを算出する。ここで、C1はG、C2はRである。具体的には、傾き算出部502は、上述した式(8)を用いて、分散、共分散値の比率を計算する。 The slope calculation unit 502 calculates the slope Ks of the color distribution of C1-C2 based on the covariance values V C1, C2 of C1 and C2 and the variance values V C1, C1 of C1. Here, C1 is G and C2 is R. Specifically, the slope calculation unit 502 calculates the ratio of variance and covariance values using the above-described equation (8).

Vthresholdは、ゼロで除算することによって値が発散するのを回避するための定数であり、十分に小さい正の値が予め設定される。式(8)におけるVthresholdを用いて、分母のC1の分散をクリップすることにより、ゼロによる除算を回避することができるが、Vthresholdを用いたクリッピングは、更に、画像の平坦部分におけるノイズを低減するために活用することができる。 V threshold is a constant for avoiding the value to diverge by dividing by zero, and a sufficiently small positive value is set in advance. Using V threshold in Equation (8) to clip the variance of C1 in the denominator, division by zero can be avoided, but clipping with V threshold further reduces noise in the flat part of the image. Can be used to reduce.

すなわち、分母であるC1の分散は、その局所領域の輝度のばらつきを反映した値であり、その値が小さいことは、その局所領域が平坦であることと同義である。固体撮像素子のノイズは、画像が平坦であるほど良く目立つため、画像の平坦な部分に限ってノイズ低減処理を施すようにすると、全体の画像の品質を下げることなく、目立つノイズを効果的に低減させることができ、好適である。また、色分布の傾きKsの分母をクリップし、それ以上分母が小さくならないようにすることによって、Ksの絶対値が元の値より小さい値となるように抑制することができる。傾きKsの絶対値が小さく抑制されることによって、C1に対するC2の変化率が小さくなり、結果的に、その局所領域でのC2の振幅を抑制することができるという効果が生じる。   That is, the variance of C1 as the denominator is a value reflecting the variation in luminance of the local region, and a small value is synonymous with the fact that the local region is flat. Since the noise of a solid-state image sensor stands out better as the image becomes flat, if noise reduction processing is performed only on the flat part of the image, the noticeable noise is effectively reduced without degrading the overall image quality. This can be reduced and is preferable. Also, by clipping the denominator of the gradient Ks of the color distribution so that the denominator does not become any smaller, the absolute value of Ks can be suppressed to be smaller than the original value. By suppressing the absolute value of the slope Ks to be small, the rate of change of C2 with respect to C1 is reduced, and as a result, the effect that the amplitude of C2 in the local region can be suppressed occurs.

以上のように、傾きKsの分母に対するクリッピング処理により、画像が平坦かどうかの判定と出力振幅の抑制との両方の処理を実行した場合と同様に、ノイズ低減の作用がある。このように、本発明の色推定方法を用いれば、別途ノイズ低減処理を追加しなくても画像の平坦な部分で目立つノイズを抑制することができる。   As described above, the clipping process for the denominator of the slope Ks has the effect of reducing noise, as in the case where both the process of determining whether the image is flat and the process of suppressing the output amplitude are executed. Thus, by using the color estimation method of the present invention, it is possible to suppress noticeable noise in a flat portion of an image without adding a separate noise reduction process.

傾き合成部503は、2つの傾き推定値KmとKsとを、信頼度hに基づいて合成し、傾き推定値Kを算出する。上述したとおり、分散、共分散に基づく傾き推定値Ksは、細い縞模様状のテクスチャがある領域では正しい推定ができるとは限らない。そこで、傾き合成部503は、細い縞模様状のテクスチャの強度を反映した信頼度hを用いて、例えば式(9)を用いて、平均値に基づく傾き推定値Kmと合成して、傾き推定値Kを算出するようにする。   The gradient combining unit 503 combines the two estimated gradient values Km and Ks based on the reliability h, and calculates the estimated gradient value K. As described above, the inclination estimation value Ks based on the variance and covariance cannot always be correctly estimated in a region having a thin striped texture. Therefore, the inclination synthesis unit 503 uses the reliability h that reflects the strength of the thin striped texture to synthesize the inclination estimation value Km based on the average value by using, for example, Equation (9) to estimate the inclination. The value K is calculated.

Figure 2005151549
・・・(9)
Figure 2005151549
... (9)

そして、画素強度推定手段354は、得られた傾き推定値K、2つの平均値MGおよびMR、並びに、注目画素位置のG強度を、次の式(10)の線形回帰式に当てはめることによって、注目画素位置のR強度の推定値を算出する。 Then, the pixel intensity estimation unit 354 applies the obtained gradient estimation value K, the two average values M G and M R , and the G intensity of the target pixel position to the linear regression equation of the following equation (10). Thus, an estimated value of the R intensity at the target pixel position is calculated.

Figure 2005151549
・・・(10)
Figure 2005151549
... (10)

ここで、C1center、および、C2centerは、それぞれ、注目画素位置の第1の信号に対応する色C1(すなわちG)の強度、および、注目画素位置の第2の信号に対応する色C2(すなわちR)の強度推定値である。 Here, C 1center and C 2center are respectively the intensity of the color C1 (that is, G) corresponding to the first signal at the target pixel position and the color C2 (corresponding to the second signal at the target pixel position). That is, the estimated intensity value of R).

また、画素強度推定手段504は、式(10)とは異なる回帰式を用いて、強度推定値を算出するようにしてもよい。例えば式(11)に示されるように、適当な定数uを傾き推定値Kに乗算させて、線形回帰計算を行うようにしてもよい。   Further, the pixel intensity estimation unit 504 may calculate the intensity estimation value using a regression equation different from the equation (10). For example, as shown in the equation (11), the linear regression calculation may be performed by multiplying the slope estimation value K by an appropriate constant u.

Figure 2005151549
・・・(11)
Figure 2005151549
(11)

式(11)において、第1項は第2の信号に対応する色C2(すなわち、R)強度の高周波成分、第2項は低周波成分と考えることができる。そして、式(11)においては、その高周波成分を適当な定数uで少し増強することにより、Rに対する適切な高域補正を実行した場合と同様の効果を得ることができる。このようにすることにより、別途高域補正処理を追加しなくても高域が補正された画像を得ることができる。   In the equation (11), the first term can be considered as a high frequency component of the color C2 (ie, R) intensity corresponding to the second signal, and the second term can be considered as a low frequency component. In the equation (11), by slightly enhancing the high frequency component with an appropriate constant u, it is possible to obtain the same effect as when appropriate high-frequency correction for R is executed. By doing so, it is possible to obtain an image in which the high frequency is corrected without adding a separate high frequency correction process.

以上においては、統計量算出部342において算出される、平均値、分散値、および共分散値を基に、回帰演算処理部474において、回帰直線の傾きKが算出される場合について説明したが、回帰直線の傾きは、これ以外の方法を用いて算出するようにしてもよい。   In the above description, the case where the regression line slope K is calculated in the regression calculation processing unit 474 based on the average value, the variance value, and the covariance value calculated in the statistic calculation unit 342 has been described. The slope of the regression line may be calculated using a method other than this.

例えば、標準偏差および相関係数を用いて回帰直線の傾きを計算する定義式は以下の式(12)に表される。   For example, a definition formula for calculating the slope of the regression line using the standard deviation and the correlation coefficient is represented by the following formula (12).

Figure 2005151549
・・・(12)
Figure 2005151549
(12)

標準偏差Sx,Syは、データ値が平均の周囲にどれだけの幅で分布しているのかを表す統計量であり、2変数のxy方向の変分を表すdx、dyに近い値であると考えられる。回帰直線は、この式(12)を用いて求めるようにしてもよい。   The standard deviations Sx and Sy are statistics indicating how much the data values are distributed around the average, and are values close to dx and dy representing the variation in the xy direction of two variables. Conceivable. You may make it obtain | require a regression line using this Formula (12).

また、特に、正の傾きの直線上にデータが分布し、Rxyが1になる場合、Sx,Syはdx、dyと等価になる。つまり、計算の複雑な標準偏差を用いる代わりに、データ分布幅を表し、演算がより簡単な他の統計量があれば、Sx,Syを、データ分布幅を表す他の統計量に置き換えても、回帰直線の傾きは、近い振る舞いを示すことが期待できる。   In particular, when data is distributed on a straight line having a positive slope and Rxy is 1, Sx and Sy are equivalent to dx and dy. That is, instead of using a complicated standard deviation of calculation, if there is another statistic that represents the data distribution width and is easier to calculate, Sx and Sy may be replaced with other statistic that represents the data distribution width. The slope of the regression line can be expected to show close behavior.

そこで、データ分布幅を表す他の統計量として、標準偏差と並んでデータの分布幅を表すために用いられる平均偏差を代替に用いる。xの平均偏差Axの定義は、次の式(13)で示される。   Therefore, as another statistic representing the data distribution width, an average deviation used to represent the data distribution width along with the standard deviation is used instead. The definition of the average deviation Ax of x is shown by the following formula (13).

Figure 2005151549
・・・(13)
Figure 2005151549
... (13)

同様にして、yの平均偏差Ayも、次の式(14)で示される。   Similarly, the average deviation Ay of y is also expressed by the following equation (14).

Figure 2005151549
・・・(14)
Figure 2005151549
(14)

平均偏差AxおよびAyを用いて、Rxyを書き改めると、次の式(15)が得られる。   When Rxy is rewritten using the average deviations Ax and Ay, the following equation (15) is obtained.

Figure 2005151549
・・・(15)
Figure 2005151549
... (15)

標準偏差を用いた演算に平方根や乗算が必要であることと比較して、平均偏差は少ない計算量で算出することができる。そして、更に、Vxyの算出に用いられる乗算や、Ax,Ayの乗算を近似演算することで、Rxyの近似を高速に算出することができる。   The average deviation can be calculated with a small amount of calculation compared to the fact that a square root or multiplication is necessary for the calculation using the standard deviation. Further, approximation of Rxy can be calculated at high speed by performing approximate calculation of multiplication used to calculate Vxy and multiplication of Ax and Ay.

このように、統計量算出部342において算出される、平均値、分散値、および共分散値を基に、回帰演算処理部474において、回帰直線の傾きKを算出する処理に代わって、標準偏差および相関関数を用いて、2系統のデータの2次元分布における回帰直線の傾きを計算したり、または、偏差と相関に関してそれぞれ近似演算した後、2系統のデータの2次元分布における回帰直線の傾きを計算するようにしてもよい。   As described above, instead of the process of calculating the slope K of the regression line in the regression calculation processing unit 474 based on the average value, the variance value, and the covariance value calculated in the statistic calculation unit 342, the standard deviation And using the correlation function to calculate the slope of the regression line in the two-dimensional distribution of the two systems of data, or after approximating the deviation and correlation, respectively, the slope of the regression line in the two-dimensional distribution of the two systems of data May be calculated.

次に、図23のフローチャートを参照して、図5のDSPブロック216の処理について説明する。   Next, processing of the DSP block 216 in FIG. 5 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) defined 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に表示される画像の明るさや色の彩度が正しく表示されるように、第1のガンマ補正を行う。   In step S3, the gamma correction unit 252 performs the first operation 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 the white balance. Perform gamma correction.

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

ステップS5において、ガンマ逆補正部254は、デモザイク処理部253からの出力であるRγ,Gγ,Bγ,Eγの4チャネル画像に適用したガンマ特性の逆を適用してガンマ逆補正処理を施し、ガンマ特性をリニア特性に直す処理を行う。 In step S5, the gamma reverse correction unit 254 applies the reverse of the gamma characteristics applied to the four-channel images of R γ , G γ , B γ , and E γ that are outputs from the demosaic processing unit 253 to perform the gamma reverse correction processing. The gamma characteristic is converted to a linear characteristic.

ステップS6において、マトリックス処理部255は、係数が予め設定された3行4列のリニアマトリックスを、ガンマ逆補正部254から供給されたR,G,B,Eの4チャネル画像に適用し、3原色の強度値[Rm,Gm,Bm]に変換する。このマトリックス処理は、リニア特性の画像強度に対して適用する必要があるので、その処理の前段において、ガンマ逆補正部254によりガンマ逆補正が施される必要がある。リニアマトリックスの係数は、最適な色再現を発揮するために重要な設計項目であり、マトリックス処理はデモザイク処理後に適用されるので、マトリックス処理部255により用いられるリニアマトリックス係数は、適宜設計される値であってよい。マトリックス処理部255の出力は、色補正されたRm,Gm,Bmの3つの色に対応する3つの画像となる。   In step S <b> 6, the matrix processing unit 255 applies a 3 × 4 linear matrix with coefficients set in advance to the R, G, B, and E four-channel images supplied from the gamma inverse correction unit 254. The intensity values are converted into primary color intensity values [Rm, Gm, Bm]. Since this matrix processing needs to be applied to the image intensity of linear characteristics, it is necessary to perform gamma reverse correction by the gamma reverse correction unit 254 in the previous stage of the processing. The coefficient of the linear matrix is an important design item for achieving optimum color reproduction, and the matrix processing is applied after the demosaic processing. Therefore, the linear matrix coefficient used by the matrix processing unit 255 is an appropriately designed value. It may be. The output of the matrix processing unit 255 is three images corresponding to the three colors Rm, Gm, and Bm that have been color corrected.

ステップS7において、ガンマ補正部256は、色補正された3チャネル画像に対して第2のガンマ補正を行う。   In step S7, the gamma correction unit 256 performs second gamma correction on the color-corrected three-channel image.

YC変換部257は、ステップS8において、ガンマ補正部256から供給される、R,G,Bの3チャネル画像に、YCマトリックス処理およびクロマ成分に対する帯域制限を行とで、YC変換を行い、Y画像およびC画像を生成し、ステップS9において、生成したY画像およびC画像を出力し、処理が終了される。   In step S8, the YC conversion unit 257 performs YC conversion on the R, G, and B three-channel images supplied from the gamma correction unit 256 by performing YC matrix processing and band limitation on chroma components in a row. An image and a C image are generated, and in step S9, 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 under 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.

次に、図24のフローチャートを参照して、図23のステップS4において実行されるデモザイク処理1について説明する。   Next, the demosaic process 1 executed in step S4 of FIG. 23 will be described with reference to the flowchart of FIG.

局所領域抽出部281は、ステップS21において、未処理の画素のうちのいずれかを注目画素とし、ステップS22において、注目画素位置の周辺の所定数(n×n)の画素を、局所領域として抽出し、G+E強度推定処理部282、および、RGBE強度推定部283に供給する。   In step S21, the local region extraction unit 281 extracts one of the unprocessed pixels as a target pixel, and in step S22 extracts a predetermined number (n × n) of pixels around the target pixel position as a local region. To the G + E intensity estimation processing unit 282 and the RGBE intensity estimation unit 283.

ステップS23において、図25のフローチャートを用いて後述するG+E強度推定処理が実行される。   In step S23, a G + E intensity estimation process, which will be described later, is executed using the flowchart of FIG.

ステップS24において、図50のフローチャートを用いて後述する、色強度推定処理1が、図6のRGBE強度推定部283のそれぞれにおいて並行して実行される。   In step S24, color intensity estimation processing 1 described later using the flowchart of FIG. 50 is executed in parallel in each of the RGBE intensity estimation units 283 of FIG.

ステップS25において、局所領域抽出部281は、全ての画素において処理が終了したか否かを判断する。ステップS25において、全ての画素において処理が終了していないと判断された場合、処理は、ステップS21に戻り、それ以降の処理が繰り返される。ステップS27において、全ての画素において処理が終了したと判断された場合、処理は、図23のステップ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 S27 that the process has been completed for all pixels, the process proceeds to step S5 in FIG.

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

このような処理により、CCDイメージセンサ213が有するカラーフィルタの配列に基づいて得られるモザイク画像をデモザイク(色補間、または、同時化)して、各画素において、カラーフィルタを構成する各色が補間された画像データを得ることができる。   By such processing, the mosaic image obtained based on the color filter array of the CCD image sensor 213 is demosaiced (color interpolation or synchronization), and each color constituting the color filter is interpolated in each pixel. Image data can be obtained.

次に、図25のフローチャートを参照して、図24のステップS23において実行されるG+E強度推定処理について説明する。   Next, the G + E intensity estimation process executed in step S23 of FIG. 24 will be described with reference to the flowchart of FIG.

ステップS41において、G強度推定部291は、図26を用いて後述する、注目画素位置のG強度推定値算出処理を実行する。   In step S41, the G intensity estimating unit 291 executes a G intensity estimated value calculation process for the target pixel position, which will be described later with reference to FIG.

ステップS42において、E強度推定部292は、図26を用いて後述する、注目画素位置のE強度推定値算出処理を実行する。   In step S42, the E intensity estimation unit 292 executes an E intensity estimated value calculation process for the target pixel position, which will be described later with reference to FIG.

加算処理部293は、ステップS43において、ステップS41において算出されたG強度推定値と、ステップS42において算出されたE強度推定値とを加算して、G+E強度推定値を算出し、ステップS44において、G+E強度推定値を出力して、処理は、図24のステップS24に戻る。   In step S43, the addition processing unit 293 calculates the G + E intensity estimated value by adding the G intensity estimated value calculated in step S41 and the E intensity estimated value calculated in step S42. In step S44, The G + E intensity estimated value is output, and the process returns to step S24 in FIG.

このような処理により、市松状に配置されたGとEとからなる新たな強度推定値であるG+E強度推定値を算出することができるので、後述するRGBEの各色の強度の推定演算に用いることが可能となる。   By such processing, a G + E intensity estimation value, which is a new intensity estimation value composed of G and E arranged in a checkered pattern, can be calculated. Therefore, it is used for an RGBE color intensity estimation calculation described later. Is possible.

なお、ステップS41の処理とステップS42の処理とは、並行して実行されても、その処理の順番を逆にしてもよい。   In addition, the process of step S41 and the process of step S42 may be performed in parallel, or the order of the processes may be reversed.

次に、図26のフローチャートを参照して、図25のG+E強度推定処理のステップS41およびステップS42において実行される注目画素位置のG強度推定値算出処理および注目画素位置のE強度推定値算出処理について説明する。   Next, referring to the flowchart of FIG. 26, the G intensity estimated value calculation process for the target pixel position and the E intensity estimated value calculation process for the target pixel position executed in steps S41 and S42 of the G + E intensity estimation process of FIG. Will be described.

すなわち、G強度推定部291が実行する注目画素位置のG強度推定値算出処理と、E強度推定部292が実行する注目画素位置のE強度推定値算出処理とは、補間するべき色がGであるかEであるかが異なるだけで、基本的に同様の処理が実行される。   That is, the G intensity estimated value calculation process for the target pixel position performed by the G intensity estimation unit 291 and the E intensity estimated value calculation process for the target pixel position performed by the E intensity estimation unit 292 are G to be interpolated. Basically, the same processing is executed only by whether or not there is E.

また、図8のG強度推定部291またはE強度推定部292のブロック図の説明においては、注目画素位置が何色であるかに基づいて異なる4種類の動作全てについて推定値を予め算出し、最後にスイッチ306によってどれを出力するかを選択するようにした。しかし同様の処理をソフトウェアで実現する場合では、まず注目画素が何色かを判別し、それにしたがって実行すべき動作を選択するような動作順序のほうが効率がよい。   Further, in the description of the block diagram of the G intensity estimating unit 291 or the E intensity estimating unit 292 in FIG. 8, estimated values are calculated in advance for all four types of operations based on the color of the target pixel position, Finally, the switch 306 selects which one to output. However, in the case where the same processing is realized by software, it is more efficient to first determine the color of the pixel of interest and select an operation to be executed according to the color.

ステップS61において、G強度推定部291またはE強度推定部292は、注目画素の色が補間するべき色(G強度推定部291の処理においてはG、E強度推定部292の処理においてはE)であるか否かを判断する。   In step S61, the G intensity estimator 291 or the E intensity estimator 292 uses the color of the pixel of interest to be interpolated (G in the process of the G intensity estimator 291 and E in the process of the E intensity estimator 292). Judge whether there is.

ステップS61において、注目画素の色が補間するべき色であると判断された場合、ステップS62において、G強度推定部291またはE強度推定部292は、注目画素位置の画素強度を出力して、処理は、図25のステップS42またはステップS43に進む。   If it is determined in step S61 that the color of the target pixel is a color to be interpolated, in step S62, the G intensity estimation unit 291 or the E intensity estimation unit 292 outputs the pixel intensity at the target pixel position and performs processing. Advances to step S42 or step S43 of FIG.

ステップS61において、注目画素の色が補間するべき色ではないと判断された場合、ステップS63において、G強度推定部291またはE強度推定部292は、注目画素の色が補間するべき色ではないGまたはEのいずれか(G強度推定部291の処理においてはE、E強度推定部292の処理においてはG)であるか否かを判断する。   When it is determined in step S61 that the color of the target pixel is not the color to be interpolated, in step S63, the G intensity estimation unit 291 or the E intensity estimation unit 292 determines that the color of the target pixel is not the color to be interpolated. It is determined whether or not any one of E (E in the process of the G intensity estimating unit 291 and G in the process of the E intensity estimating unit 292).

ステップS63において、注目画素の色が補間するべき色ではないGまたはEのいずれかであると判断された場合、ステップS64において、G強度推定部291またはE強度推定部292は、第1の処理ブロック302により補間すべき強度推定値を算出し、出力して、処理は、図25のステップS42またはステップS43に進む。   If it is determined in step S63 that the color of the target pixel is either G or E that is not a color to be interpolated, in step S64, the G intensity estimation unit 291 or the E intensity estimation unit 292 performs the first process. The intensity estimation value to be interpolated is calculated and output by the block 302, and the process proceeds to step S42 or step S43 in FIG.

ステップS63において、注目画素の色が補間するべき色ではないGまたはEのいずれかではないと判断された場合、ステップS65において、G強度推定部291またはE強度推定部292は、注目画素の色が補間するべき色の左右に配置された色(例えば、図3の4色配列がカラーフィルタとして用いられていた場合、G強度推定部291の処理においてはB、E強度推定部292の処理においてはR)であるか否かを判断する。   If it is determined in step S63 that the color of the target pixel is not G or E that is not the color to be interpolated, in step S65, the G intensity estimation unit 291 or the E intensity estimation unit 292 determines the color of the target pixel. Are arranged on the left and right sides of the color to be interpolated (for example, when the four-color array in FIG. 3 is used as a color filter, in the process of the G intensity estimation unit 291, Is R).

ステップS65において、注目画素の色が補間するべき色の左右に配置された色であると判断された場合、ステップS66において、G強度推定部291またはE強度推定部292は、第2の処理ブロック303により補間すべき強度推定値を算出し、出力して、処理は、図25のステップS42またはステップS43に進む。   When it is determined in step S65 that the color of the target pixel is a color arranged on the left and right of the color to be interpolated, in step S66, the G intensity estimating unit 291 or the E intensity estimating unit 292 performs the second processing block. In step 303, the estimated intensity value to be interpolated is calculated and output, and the process proceeds to step S42 or step S43 in FIG.

ステップS65において、注目画素の色が補間するべき色の左右に配置された色であると判断された場合、ステップS67において、G強度推定部291またはE強度推定部292は、第3の処理ブロック304により補間すべき強度推定値を算出し、出力して、処理は、図25のステップS42またはステップS43に進む。   When it is determined in step S65 that the color of the target pixel is a color arranged on the left and right of the color to be interpolated, in step S67, the G intensity estimation unit 291 or the E intensity estimation unit 292 performs the third processing block. The estimated intensity value to be interpolated is calculated and output by 304, and the process proceeds to step S42 or step S43 in FIG.

このような処理により、G強度推定部291またはE強度推定部292は、注目画素位置におけるGまたはEの強度を推定することができる。   Through such processing, the G intensity estimation unit 291 or the E intensity estimation unit 292 can estimate the G or E intensity at the target pixel position.

図26のステップS64、ステップS66、または、ステップS67の処理、すなわち、第1の処理ブロック302乃至第3の処理ブロック304がそれぞれ実行する処理においては、図10を用いて説明した第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、または、第4の強度推定部323において、粗補間処理部341による粗補間処理1、統計量算出部342による2色分布形状の統計量算出処理、および、回帰演算処理部343による補間画素推定処理1が実行される。   In the processing in step S64, step S66, or step S67 in FIG. 26, that is, the processing executed by each of the first processing block 302 to the third processing block 304, the first intensity described with reference to FIG. In the estimation unit 311, the second intensity estimation unit 321, the third intensity estimation unit 322, or the fourth intensity estimation unit 323, the coarse interpolation processing 1 by the coarse interpolation processing unit 341 and the two colors by the statistic calculation unit 342 The distribution shape statistic calculation process and the interpolation pixel estimation process 1 by the regression calculation processing unit 343 are executed.

図27乃至図34を用いて、粗補間処理部341による粗補間処理1、統計量算出部342による2色分布形状の統計量算出処理、および、回帰演算処理部343による補間画素推定処理1について説明する。   27 to 34, the rough interpolation processing 1 by the rough interpolation processing unit 341, the statistic calculation processing of the two-color distribution shape by the statistic calculation unit 342, and the interpolation pixel estimation processing 1 by the regression calculation processing unit 343. explain.

まず、図27のフローチャートを参照して、粗補間処理1について説明する。   First, the rough interpolation process 1 will be described with reference to the flowchart of FIG.

ここで、第1の強度推定部311の粗補間処理部341は、注目画素位置にある色を第1の色とし、その斜めに隣接する色を第2の色として選択するものとする。また、第2の強度推定部321の粗補間処理部341は、注目画素位置にある色を第1の色とし、その左右に隣接する色を第2の色として選択するものとする。第3の強度推定部322の粗補間処理部341は、注目画素位置にある色を第1の色とし、その上下に隣接する色を第2の色として選択するものとする。第4の強度推定部323の粗補間処理部341は、注目画素位置の左右に隣接する色と上下に隣接する色の2つを第1の色および第2の色として選択する。   Here, it is assumed that the coarse interpolation processing unit 341 of the first intensity estimation unit 311 selects the color at the target pixel position as the first color and the color adjacent to the diagonal as the second color. In addition, the rough interpolation processing unit 341 of the second intensity estimation unit 321 selects the color at the target pixel position as the first color and the colors adjacent to the left and right as the second color. The rough interpolation processing unit 341 of the third intensity estimation unit 322 selects the color at the target pixel position as the first color and selects the adjacent colors above and below it as the second color. The coarse interpolation processing unit 341 of the fourth intensity estimation unit 323 selects two colors, a color adjacent to the left and right of the target pixel position and a color adjacent to the top and bottom, as the first color and the second color.

粗補間処理部341は、ステップS71において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値sを初期化して、s=2とし、ステップS72において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値tを初期化して、t=2とする。   In step S71, the coarse interpolation processing unit 341 initializes the value s of the first register indicating the pixel position where the processing is performed among the pixels in the supplied local region, and sets s = 2. Among the supplied local area pixels, the value t of the second register indicating the pixel position where the process is executed is initialized to t = 2.

ステップS73において、粗補間処理部341は、画素(s、t)と、その周辺8画素から、第1の色の画素値を抽出し、その平均値を第1の画素の補間値として算出する。   In step S73, the coarse interpolation processing unit 341 extracts the pixel value of the first color from the pixel (s, t) and the surrounding eight pixels, and calculates the average value as the interpolation value of the first pixel. .

ステップS74において、粗補間処理部341は、画素(s、t)と、その周辺8画素から、第2の色の画素値を抽出し、その平均値を第2の画素の補間値として算出する。   In step S74, the coarse interpolation processing unit 341 extracts the pixel value of the second color from the pixel (s, t) and the surrounding eight pixels, and calculates the average value as the interpolation value of the second pixel. .

ステップS75において、粗補間処理部341は、第2のレジスタの値tを参照し、t=n−1であるか否かを判断する。   In step S75, the rough interpolation processing unit 341 refers to the value t of the second register and determines whether t = n−1.

ステップS75において、t=n−1ではないと判断された場合、ステップS76において、粗補間処理部341は、第2のレジスタの値tをt=t+1とし、処理は、ステップS73に戻り、それ以降の処理が繰り返される。   If it is determined in step S75 that t = n−1 is not true, the coarse interpolation processing unit 341 sets the value t of the second register to t = t + 1 in step S76, and the process returns to step S73. The subsequent processing is repeated.

ステップS75において、t=n−1であると判断された場合、ステップS77において、粗補間処理部341は、第1のレジスタの値sを参照し、s=n−1であるか否かを判断する。   If it is determined in step S75 that t = n−1, in step S77, the coarse interpolation processing unit 341 refers to the value s of the first register and determines whether s = n−1. to decide.

ステップS77において、s=n−1ではないと判断された場合、ステップS78において、粗補間処理部341は、第1のレジスタの値sをs=s+1とし、処理は、ステップS72に戻り、それ以降の処理が繰り返される。   If it is determined in step S77 that s = n−1 is not satisfied, in step S78, the coarse interpolation processing unit 341 sets the value s of the first register to s = s + 1, and the process returns to step S72. The subsequent processing is repeated.

ステップS77において、s=n−1ではあると判断された場合、ステップS79において、粗補間処理部341は、注目画素付近の(n−2)×(n−2)画素の第1の色および第2の色の補間値の組を出力して処理が終了される。   If it is determined in step S77 that s = n−1, in step S79, the coarse interpolation processing unit 341 determines the first color of (n−2) × (n−2) pixels near the target pixel and A set of interpolation values for the second color is output, and the process is terminated.

このような処理により、粗補間処理部341は、注目画素付近の画素から、第1の色のラフな補間値と第2の色のラフな補間値を算出することができる。   By such processing, the rough interpolation processing unit 341 can calculate the rough interpolation value of the first color and the rough interpolation value of the second color from the pixels near the target pixel.

次に、図28のフローチャートを参照して、統計量算出部342において実行される、2色分布形状の統計量算出処理について説明する。   Next, the two-color distribution shape statistic calculation process executed by the statistic calculation unit 342 will be described with reference to the flowchart of FIG.

ステップS91において、統計量算出部342の平均値算出部361は、粗補間値処理部284から供給された粗補間値のうちの、第1の信号を取得する。   In step S <b> 91, the average value calculation unit 361 of the statistic calculation unit 342 acquires a first signal among the coarse interpolation values supplied from the coarse interpolation value processing unit 284.

ステップS92において、平均値算出部361は、図29または図30のフローチャートを用いて後述する平均値計算処理を実行する。   In step S92, the average value calculation unit 361 executes an average value calculation process described later using the flowchart of FIG. 29 or FIG.

ステップS93において、平均値算出部363は、粗補間値処理部284から供給された粗補間値のうちの、第2の信号を取得する。   In step S <b> 93, the average value calculation unit 363 acquires a second signal among the rough interpolation values supplied from the rough interpolation value processing unit 284.

ステップS94において、平均値算出部363は、図29または図30のフローチャートを用いて後述する平均値計算処理を実行する。   In step S94, the average value calculation unit 363 executes an average value calculation process to be described later using the flowchart of FIG. 29 or FIG.

ステップS95において、分散算出部362は、図35または図36のフローチャートを用いて後述する、分散計算処理を実行する。   In step S95, the variance calculation unit 362 executes a variance calculation process, which will be described later using the flowchart of FIG.

ステップS96において、共分散算出部364は、図37のフローチャートを用いて後述する、共分散近似計算処理を実行する。   In step S96, the covariance calculation unit 364 executes a covariance approximation calculation process, which will be described later using the flowchart of FIG.

次に、図29のフローチャートを参照して、図28のステップS92またはステップS94において実行される平均値計算処理1について説明する。   Next, the average value calculation process 1 executed in step S92 or step S94 in FIG. 28 will be described with reference to the flowchart in FIG.

ステップS111において、平均値算出部361または平均値算出部363は、演算結果である平均値Mx(平均値Mxの添え字xは、第1の色Crの平均値が算出される場合Crに、第2の色Ceの平均値が算出される場合Ceに、それぞれ置き換えられる)を初期化する。   In step S111, the average value calculation unit 361 or the average value calculation unit 363 calculates the average value Mx (the subscript x of the average value Mx is the Cr if the average value of the first color Cr is calculated). When the average value of the second color Ce is calculated, it is replaced with Ce respectively).

ステップS112において、平均値算出部361または平均値算出部363は、取得した補間値(ここでは、(n−2)の2乗個の補間値)を合計する。   In step S112, the average value calculation unit 361 or the average value calculation unit 363 sums the acquired interpolation values (here, (n−2) square interpolation values).

ステップS113において、平均値算出部361または平均値算出部363は、ステップS112において算出された合計値を、取得した値の数(ここでは、(n−2)の2乗個)で除算する。   In step S113, the average value calculation unit 361 or the average value calculation unit 363 divides the total value calculated in step S112 by the number of acquired values (here, the square of (n−2)).

ステップS114において、平均値算出部361または平均値算出部363は、ステップS113の処理により算出された除算結果を出力する。   In step S114, the average value calculation unit 361 or the average value calculation unit 363 outputs the division result calculated by the process of step S113.

また、平均値を求める場合、粗補間された第1の色および第2の色のそれぞれの強度に、注目画素からの距離により、重み付けを施して、重み付けが施されたRGB強度を基に、平均値を求めるようにしても良い。   Further, when obtaining the average value, the first and second colors subjected to coarse interpolation are weighted according to the distance from the target pixel, and based on the weighted RGB intensity, An average value may be obtained.

図30のフローチャートを参照して、図28のステップS92またはステップS94において実行される平均値計算処理2について説明する。   The average value calculation process 2 executed in step S92 or step S94 in FIG. 28 will be described with reference to the flowchart in FIG.

ステップS121において、平均値算出部361または平均値算出部363は、演算結果である平均値Mx(平均値Mxの添え字xは、第1の色Crの平均値が算出される場合Crに、第2の色Ceの平均値が算出される場合Ceに、それぞれ置き換えられる)を初期化する。   In step S121, the average value calculation unit 361 or the average value calculation unit 363 calculates the average value Mx (the subscript x of the average value Mx is the calculation result when the average value of the first color Cr is calculated). When the average value of the second color Ce is calculated, it is replaced with Ce respectively).

ステップS122において、平均値算出部361または平均値算出部363は、取得した補間値(ここでは、(n−2)の2乗個の補間値)に、例えば、図31乃至図34に示されるような重み付けを施し、重み付けられた値を合計する。   In step S122, the average value calculation unit 361 or the average value calculation unit 363 uses the acquired interpolation values (here, (n−2) square interpolation values) as shown in FIGS. 31 to 34, for example. Such weighting is performed, and the weighted values are summed.

重み値wiは、i番目のデータの位置から注目画素位置への距離などを指標に予め設定され、また、第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、および、第4の強度推定部323のそれぞれで異なる重み値が設定されるようにしてもよい。図31乃至図34に、第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、および、第4の強度推定部323のそれぞれで用いられる重み値の例を示す。図中の四角形は9×9の局所領域における画素位置を示し、四角形内の数字が、該当する位置のデータの重み値を示す。 The weight value w i is set in advance using the distance from the position of the i-th data to the target pixel position as an index, and the first intensity estimation unit 311, the second intensity estimation unit 321, and the third intensity estimation. Different weight values may be set for each of the unit 322 and the fourth intensity estimating unit 323. FIG. 31 to FIG. 34 show examples of weight values used in the first intensity estimating unit 311, the second intensity estimating unit 321, the third intensity estimating unit 322, and the fourth intensity estimating unit 323, respectively. Show. The rectangle in the figure indicates the pixel position in the 9 × 9 local area, and the number in the rectangle indicates the weight value of the data at the corresponding position.

ステップS123において、平均値算出部361または平均値算出部363は、重み付けの総和を演算する。   In step S123, the average value calculation unit 361 or the average value calculation unit 363 calculates the sum of weights.

ステップS124において、平均値算出部361または平均値算出部363は、上述した式(1)を演算する。すなわち、ステップS124において、平均値算出部361または平均値算出部363は、ステップS122において算出された合計値を、取得した値の数(ここでは、(n−2)の2乗個)と、ステップS123において算出された重み付けの総和との積で除算する。   In step S124, the average value calculation unit 361 or the average value calculation unit 363 calculates the above-described equation (1). That is, in step S124, the average value calculation unit 361 or the average value calculation unit 363 calculates the total value calculated in step S122 as the number of acquired values (here, the square of (n−2)), Divide by the product of the weighted sum calculated in step S123.

ステップS125において、平均値算出部361または平均値算出部363は、ステップS124の処理により算出された除算結果を出力する。   In step S125, the average value calculation unit 361 or the average value calculation unit 363 outputs the division result calculated by the process of step S124.

このような処理により、式(1)を用いて説明した重み付け平均の演算が実行される。   By such processing, the calculation of the weighted average described using Expression (1) is executed.

次に、図35のフローチャートを参照して、図28のステップS95において実行される分散計算処理1について説明する。   Next, the distributed calculation process 1 executed in step S95 in FIG. 28 will be described with reference to the flowchart in FIG.

ステップS141において、統計量算出部342の分散算出部362は、演算結果であるとして出力する分散値Vxx(ここでは、第1の色Crの分散値であるのでVCrCrに置き換えられる。以下、省略する)を初期化する。 In step S141, the variance calculation unit 362 of the statistic calculation unit 342 outputs the variance value Vxx output as the calculation result (here, it is replaced with V CrCr because it is the variance value of the first color Cr. Initialize).

ステップS142において、分散算出部362は、平均値算出部361により算出された第1の信号の平均値Mx(ここでは、Mxの添え字xは、Crに置き換えられる。以下、省略する)を取得する。 In step S142, the variance calculation unit 362 calculates the average value M x of the first signal calculated by the average value calculation unit 361 (here, the subscript x of M x is replaced with Cr. Hereinafter, description is omitted). To get.

分散算出部362は、ステップS143において、局所領域のうちの一部(注目画素を中心とした、(n−2)×(n−2)の範囲)の画素の粗補間値の供給を受け、そのうち、処理を実行する画素位置を示す第1のレジスタの値s'を初期化して、s'=2とし、ステップS144において、局所領域のうちの一部(注目画素を中心とした、(n−2)×(n−2)の範囲)の画素の粗補間値のうち、処理を実行する画素位置を示す第2のレジスタの値t'を初期化して、t'=2とする。   In step S143, the variance calculation unit 362 receives a rough interpolation value of a part of the local region (range of (n−2) × (n−2) centered on the target pixel), Among them, the value s ′ of the first register indicating the pixel position to be processed is initialized to s ′ = 2, and in step S144, a part of the local region (centered on the target pixel (n −2) × (n−2) range) of pixels, the second register value t ′ indicating the pixel position to be processed is initialized to t ′ = 2.

ステップS145において、分散算出部362は、画素(s’,t’)の強度X(すなわち、Crroughi、以下、省略する)から、ステップS142において取得された平均値MCrを減算し、減算結果を2乗して、現在の分散値VCrCrに加えた値を、分散値VCrCrとして更新する。すなわち、分散算出部362は、VCrCr=VCrCr+(|画素(s’,t’)の強度X−平均値MCr|)2を演算する。分散算出部362は、この演算において、画素(s’,t’)の強度Xに対して、例えば、図11または図12を用いて説明したような重み付けを施すようにしても良い。 In step S145, the variance calculation unit 362 subtracts the average value M Cr acquired in step S142 from the intensity X (that is, Crroughi, hereinafter omitted) of the pixel (s ′, t ′), and obtains the subtraction result. The value added to the current variance value V CrCr is squared and updated as the variance value V CrCr . In other words, the variance calculating unit 362 calculates V CrCr = V CrCr + (| Intensity X of pixel (s ′, t ′) − Average value M Cr |) 2 . In this calculation, the variance calculation unit 362 may weight the intensity X of the pixel (s ′, t ′) as described with reference to FIG. 11 or FIG.

ステップS146において、分散算出部362は、処理を実行する画素位置を示す第2のレジスタの値t'を参照し、t'=n−1であるか否かを判断する。   In step S146, the variance calculation unit 362 refers to the value t ′ of the second register indicating the pixel position where the process is executed, and determines whether t ′ = n−1.

ステップS146において、t'=n−1ではないと判断された場合、ステップS147において、分散算出部362は、第2のレジスタの値t'を、t'=t'+1に更新して、処理は、ステップS145に戻り、それ以降の処理が繰り返される。   If it is determined in step S146 that t ′ = n−1 is not satisfied, in step S147, the variance calculating unit 362 updates the value t ′ of the second register to t ′ = t ′ + 1 to perform processing. Returns to step S145, and the subsequent processing is repeated.

ステップS146において、t'=n−1であると判断された場合、ステップS148において、分散算出部362は、処理を実行する画素位置を示す第1のレジスタの値s'を参照し、s'=n−1であるか否かを判断する。   When it is determined in step S146 that t ′ = n−1, in step S148, the variance calculation unit 362 refers to the value s ′ of the first register indicating the pixel position where the process is performed, and s ′ It is determined whether or not n = 1.

ステップS148において、s'=n−1ではないと判断された場合、ステップS149において、分散算出部362は、第1のレジスタの値s'を、s'=s'+1に更新して、処理は、ステップS144に戻り、それ以降の処理が繰り返される。   If it is determined in step S148 that s ′ = n−1 is not satisfied, in step S149, the variance calculating unit 362 updates the value s ′ of the first register to s ′ = s ′ + 1 to perform processing. Returns to step S144, and the subsequent processing is repeated.

ステップS148において、s'=n−1であると判断された場合、ステップS150において、分散算出部362は、局所領域のうちの一部(注目画素を中心とした、(n−2)×(n−2)の範囲)の粗補間値の分散値VCrCrを出力し、処理は、図28のステップS96に戻る。 If it is determined in step S148 that s ′ = n−1, in step S150, the variance calculating unit 362 selects a part of the local area ((n−2) × ( The variance value V CrCr of the coarse interpolation value in the range n-2) is output, and the process returns to step S96 in FIG.

分散値の算出は、定義上では、(|画素(s’,t’)の強度X−平均値MCr|)2を分散値の演算に用いた画素の数で除算する必要があるが、分散値の算出結果は、後述する処理により、共分散値の算出結果の除算に用いられるため、共分散値の算出においても同数で除算される場合は、除算処理を、分散値の演算および共分散値の演算の両方にて省略することが可能である。 For the calculation of the dispersion value, by definition, it is necessary to divide (| the intensity X of the pixel (s ′, t ′) − the average value M Cr |) 2 by the number of pixels used for the calculation of the dispersion value. Since the calculation result of the variance value is used to divide the calculation result of the covariance value by the process described later, when the covariance value is also divided by the same number, the division process is performed with the calculation of the variance value and the covariance value. It can be omitted in both of the calculation of the variance value.

なお、分散値の算出において、重み付けが施された場合、式(2)を用いて説明した分散値の定義に示されるように、(|画素(s’,t’)の強度X−平均値MCr|)2を重み係数の総和で除算することにより、分散値を算出することができる。しかしながら、分散値の算出結果は、後述する処理により、共分散値の算出結果の除算に用いられるため、共分散値の算出においても重み付けが施されているときは、重み係数の総和での除算処理を、分散値の演算および共分散値の演算の両方にて省略することが可能である。 In addition, in the calculation of the variance value, when weighting is performed, as shown in the definition of the variance value described using Expression (2), (| intensity X−average value of pixels (s ′, t ′)] The dispersion value can be calculated by dividing M Cr |) 2 by the sum of the weighting factors. However, since the calculation result of the variance value is used to divide the calculation result of the covariance value by the processing described later, when weighting is also applied in the calculation of the covariance value, the division by the sum of the weighting factors is performed. The processing can be omitted in both the variance value calculation and the covariance value calculation.

また、図35を用いて説明した分散計算処理1においては、2乗の計算があるため、演算処理に時間がかかったり、ハードウェアの規模が大きくなるという問題が発生する。そこで、近似計算により2乗の計算を省略するようにしても良い。   In the distributed calculation process 1 described with reference to FIG. 35, since there is a square calculation, there is a problem that the calculation process takes time and the scale of hardware increases. Therefore, the square calculation may be omitted by approximate calculation.

次に、図36のフローチャートを参照して、近似計算により2乗の計算を省略する場合に、図28のステップS95において実行される分散計算処理2について説明する。   Next, the variance calculation process 2 executed in step S95 in FIG. 28 when the square calculation is omitted by the approximate calculation will be described with reference to the flowchart in FIG.

ステップS171乃至ステップS174においては、図35を用いて説明したステップS141乃至ステップS144と同様の処理が実行される。   In steps S171 to S174, the same processes as those in steps S141 to S144 described with reference to FIG. 35 are executed.

ステップS175において、分散算出部362は、画素(s’,t’)の強度Xから、ステップS142において取得された平均値MCrを減算し、減算結果を2乗して、現在の分散値VCrCrに加えた値を、分散値VCrCrとして更新する。すなわち、分散算出部362は、VCrCr=VCrCr+(|画素(s’,t’)の強度X−平均値MCr|)を演算する。分散算出部362は、この演算において、画素(s’,t’)の強度Xに対して、例えば、図31乃至図34に示されるように、平均値の演算と同様の重み付けを施すようにしても良い。 In step S175, the variance calculation unit 362 subtracts the average value M Cr acquired in step S142 from the intensity X of the pixel (s ′, t ′), squares the subtraction result, and obtains the current variance value V The value added to CrCr is updated as the dispersion value V CrCr . In other words, the variance calculating unit 362 calculates V CrCr = V CrCr + (| Intensity X of pixel (s ′, t ′) − Average value M Cr |). In this calculation, the variance calculation unit 362 applies the same weighting to the intensity X of the pixel (s ′, t ′) as in the calculation of the average value as shown in FIGS. 31 to 34, for example. May be.

値|p|が正規化され、0≦|P|<1が成り立っているとき、p2は|p|で近似することが可能である。これは、式(4)または式(5)を用いて、式(3)に示される共分散の演算に対する近似演算が可能であることと同様である。 When the value | p | is normalized and 0 ≦ | P | <1, p 2 can be approximated by | p |. This is similar to the fact that the approximation calculation for the covariance calculation shown in Expression (3) is possible using Expression (4) or Expression (5).

そして、ステップS176乃至ステップS180においては、図35を用いて説明したステップS146乃至ステップS150と同様の処理が実行され、処理は、図28のステップS96に戻る。   In steps S176 to S180, processing similar to that in steps S146 to S150 described with reference to FIG. 35 is executed, and the processing returns to step S96 in FIG.

このように、式(4)または式(5)を用いて、式(3)に示される共分散の演算に対する近似演算を行う場合と同様の近似演算処理により、分散値の演算に必要な2乗の計算を省略した近似演算により、分散値の近似値を求めることが可能となる。   In this way, by using the approximate calculation processing similar to the case of performing the approximate calculation for the covariance calculation shown in Expression (3) using Expression (4) or Expression (5), 2 necessary for calculating the variance value is used. It is possible to obtain an approximate value of the variance value by an approximation operation that omits the calculation of the power.

次に、図37のフローチャートを参照して、図28のステップS96において実行される、共分散計算処理について説明する。   Next, the covariance calculation process executed in step S96 of FIG. 28 will be described with reference to the flowchart of FIG.

ステップS201において、共分散算出部364は、出力される値である共分散値Vxy(ここでは、第1の色Crと第2の色Crとの共分散値であるのでVCrCeに置き換えられる。以下、省略する)を初期化する。 In step S201, the covariance calculation unit 364 replaces the output value with a covariance value V xy (here, since it is a covariance value between the first color Cr and the second color Cr, V CrCe). (Hereinafter omitted) is initialized.

ステップS202において、共分散算出部364は、平均値算出部361による図28のステップS92の処理により算出された第1の信号の平均値MCr、および、平均値算出部363による図28のステップS94の処理により算出された第2の平均値MCeを取得する。 In step S202, the covariance calculation unit 364 performs the average value M Cr of the first signal calculated by the process of step S92 of FIG. 28 by the average value calculation unit 361 and the step of FIG. 28 by the average value calculation unit 363. The second average value M Ce calculated by the process of S94 is acquired.

ステップS203において、共分散算出部364は、局所領域のうちの一部(注目画素を中心とした、(n−2)×(n−2)の範囲)の画素の粗補間値の供給を受け、そのうち、処理を実行する画素位置を示す第1のレジスタの値s'を初期化して、s’=2とする。   In step S <b> 203, the covariance calculation unit 364 receives a rough interpolation value of pixels in a part of the local region (range of (n−2) × (n−2) centered on the target pixel). Among them, the value s ′ of the first register indicating the pixel position where the process is executed is initialized to s ′ = 2.

ステップS204において、共分散算出部364は、局所領域のうちの一部(注目画素を中心とした、(n−2)×(n−2)の範囲)の画素の粗補間値のうち、処理を実行する画素位置を示す第2のレジスタの値t'を初期化して、t’=2とする。   In step S204, the covariance calculation unit 364 performs processing among the coarse interpolation values of pixels in a part of the local region (range of (n−2) × (n−2) centered on the target pixel). Initialize the value t ′ of the second register indicating the pixel position to execute t ′ = 2.

ステップS205において、図39または図40を用いて後述する積算処理が実行される。   In step S205, integration processing described later with reference to FIG. 39 or FIG. 40 is executed.

ステップS206において、共分散算出部364は、処理を実行する画素位置を示す第2のレジスタの値t'を参照し、t’=n−1であるか否かを判断する。   In step S206, the covariance calculation unit 364 refers to the value t ′ of the second register indicating the pixel position where the process is executed, and determines whether t ′ = n−1.

ステップS206において、t'=n−1ではないと判断された場合、ステップS207において、共分散算出部364は、第2のレジスタの値t'を、t'=t'+1に更新して、処理は、ステップS205に戻り、それ以降の処理が繰り返される。   If it is determined in step S206 that t ′ = n−1 is not satisfied, the covariance calculation unit 364 updates the value t ′ of the second register to t ′ = t ′ + 1 in step S207, The processing returns to step S205, and the subsequent processing is repeated.

ステップS206において、t'=n−1であると判断された場合、ステップS208において、共分散算出部364は、処理を実行する画素位置を示す第1のレジスタの値s'を参照し、s'=n−1であるか否かを判断する。   If it is determined in step S206 that t ′ = n−1, in step S208, the covariance calculation unit 364 refers to the value s ′ of the first register indicating the pixel position where the process is performed, and s It is determined whether or not '= n-1.

ステップS208において、s'=n−1ではないと判断された場合、ステップS209において、共分散算出部364は、第1のレジスタの値s'を、s'=s'+1に更新して、処理は、ステップS204に戻り、それ以降の処理が繰り返される。   If it is determined in step S208 that s ′ = n−1 is not satisfied, in step S209, the covariance calculation unit 364 updates the value s ′ of the first register to s ′ = s ′ + 1, The process returns to step S204, and the subsequent processes are repeated.

ステップS208において、s'=n−1であると判断された場合、ステップS209において、共分散算出部364は、共分散値VCrCeを出力して、処理は、終了される。 If it is determined in step S208 that s ′ = n−1, in step S209, the covariance calculation unit 364 outputs the covariance value V CrCe , and the process ends.

共分散値の算出は、定義上では、(|画素(s’,t’)の強度X−平均値MCr|)(|画素(s’,t’)の強度y−平均値MCe|)を、共分散値の演算に用いた画素の数で除算する必要があるが、共分散値の算出結果は、後述する処理により、分散値の算出結果で除算されるため、分散値の算出においても同数で除算される場合は、除算処理を、分散値の演算および共分散値の演算の両方にて省略することが可能である。 The calculation of the covariance value is, by definition, (| intensity X of pixel (s ′, t ′) − average value M Cr |) (| intensity y of pixel (s ′, t ′) − average value M Ce | ) Must be divided by the number of pixels used in the calculation of the covariance value, but the calculation result of the covariance value is divided by the calculation result of the dispersion value by the processing described later. In the case of dividing by the same number, the division process can be omitted in both the variance value calculation and the covariance value calculation.

なお、共分散値の算出において、重み付けが施された場合、式(3)を用いて説明した分散値の定義に示されるように、(|画素(s’,t’)の強度X−平均値MCr|)(|画素(s’,t’)の強度y−平均値MCe|)を重み係数の総和で除算することにより、共分散値を算出することができる。しかしながら、共分散値の算出結果は、後述する処理により、分散値の算出結果で除算されるため、分散値の算出においても重み付けが施されているときは、重み係数の総和での除算処理を、分散値の演算および共分散値の演算の両方にて省略することが可能である。 In addition, in the calculation of the covariance value, when weighting is performed, as shown in the definition of the dispersion value described using Expression (3), the intensity X−average of (| pixel (s ′, t ′) The covariance value can be calculated by dividing the value M Cr |) (| intensity y of pixel (s ′, t ′) − average value M Ce |) by the sum of the weighting factors. However, since the calculation result of the covariance value is divided by the calculation result of the dispersion value by a process described later, when weighting is applied also in the calculation of the dispersion value, the division process by the sum of the weighting coefficients is performed. It is possible to omit both the calculation of the variance value and the calculation of the covariance value.

上述した図37の共分散計算処理のステップS205において実行される積算処理には、上述した式(3)を用いて、定義どおり、共分散値が算出される場合に実行される積算処理1と、近似演算を用いて共分散値が算出される場合に実行される積算処理2との、2種類の処理がある。   The integration process executed in step S205 of the above-described covariance calculation process of FIG. 37 includes the integration process 1 executed when the covariance value is calculated as defined using the above-described equation (3). There are two types of processing: integration processing 2 executed when the covariance value is calculated using approximate calculation.

次に、図38のフローチャートを参照して、図37のステップS205において実行される積算処理1について説明する。積算処理1は、上述した式(3)を用いて、定義どおり、共分散値が算出される場合に実行される処理である。   Next, the integration process 1 executed in step S205 of FIG. 37 will be described with reference to the flowchart of FIG. The integration process 1 is a process executed when a covariance value is calculated as defined using the above-described equation (3).

ステップS221において、共分散算出部364は、(第1の信号の画素(s’,t’)の強度X−第1の信号の平均値MCr)と、(第2の信号の画素(s’,t’)の強度Y(すなわち、Ceroughi。以下、省略する)−第2の信号の平均値MCe)の積を演算する。 In step S221, the covariance calculation unit 364 (the intensity X of the first signal pixel (s ′, t ′) − the average value M Cr of the first signal) and the (second signal pixel (s The product of the intensity Y of ', t') (that is, Ceroughi, hereinafter omitted) -average value M Ce of the second signal) is calculated.

ステップS222において、共分散算出部364は、VCrCe=VCrCe+wi(積算結果)とし、処理は、図37のステップS206に進む。ここで、wiは、画素(s’,t’)における重み付けの値である。 In step S222, the covariance calculation unit 364 sets V CrCe = V CrCe + wi (integration result), and the process proceeds to step S206 in FIG. Here, wi is a weighting value in the pixel (s ′, t ′).

このような積算処理が実行されることにより、上述した式(3)を用いて、定義どおり、共分散値が算出される。積算処理1が実行された場合、定義どおりの演算であるので、その演算結果は、非常に精度の高いものであるが、そのかわり、演算に時間がかかったり、ハードウェア実装におけるゲート数の増加を招いてしまう。   By executing such integration processing, a covariance value is calculated as defined using the above-described equation (3). When integration process 1 is executed, the calculation is as defined, so the calculation result is very accurate. Instead, the calculation takes time or the number of gates in the hardware implementation increases. Will be invited.

次に、図39のフローチャートを参照して、図37のステップS205において実行される積算処理2について説明する。積算処理2は、上述した式(4)または式(5)を用いて、近似された共分散値が算出される場合に実行される処理である。   Next, the integration process 2 executed in step S205 of FIG. 37 will be described with reference to the flowchart of FIG. The integration process 2 is a process executed when an approximate covariance value is calculated using the above-described equation (4) or equation (5).

ステップS241において、共分散算出部364は、{第1の信号の画素(s’,t’)の強度X−第1の信号の平均値MCr}をpとする。 In step S241, the covariance calculation unit 364 sets {the intensity X of the pixel (s ′, t ′) of the first signal−the average value M Cr of the first signal} to p.

ステップS242において、共分散算出部364は、{第2の信号の画素(s’,t’)の強度Y−第2の信号の平均値MCe}をqとする。 In step S242, the covariance calculating unit 364 sets {the intensity Y of the pixel (s ′, t ′) of the second signal−the average value M Ce of the second signal} to q.

ステップS243において、図40、または、図41を用いて後述する積算近似処理が実行される。   In step S243, integration approximation processing described later with reference to FIG. 40 or FIG. 41 is executed.

ステップS244において、共分散算出部364は、VCrCe=VCrCe+(pqの近似値)とし、処理は、処理は、図37のステップS206に進む。 In step S244, the covariance calculation unit 364 sets V CrCe = V CrCe + (approximate value of pq), and the process proceeds to step S206 in FIG.

次に、図40のフローチャートを参照して、図39のステップS243において実行される積算近似処理1について説明する。積算近似処理1は、上述した式(4)を用いて、近似された共分散値が算出される場合に実行される処理である。   Next, with reference to the flowchart of FIG. 40, the integration approximation process 1 executed in step S243 of FIG. 39 will be described. The integrated approximation process 1 is a process executed when an approximate covariance value is calculated using the above-described equation (4).

ステップS261において、共分散算出部364は、図39のステップS241およびステップS242において置き換えられた値pおよびqを用いて、|p|≧|q|であるか否かを判断する。   In step S261, the covariance calculation unit 364 determines whether or not | p | ≧ | q | using the values p and q replaced in steps S241 and S242 of FIG.

ステップS261において、|p|≧|q|であると判断された場合、ステップS262において、共分散算出部364は、p≧0であるか否かを判断する。   If it is determined in step S261 that | p | ≧ | q |, in step S262, the covariance calculation unit 364 determines whether or not p ≧ 0.

ステップS262において、p≧0であると判断された場合、ステップS263において、共分散算出部364は、pqの近似値=+qとし、処理は、図39のステップS244に戻る。   If it is determined in step S262 that p ≧ 0, in step S263, the covariance calculation unit 364 sets pq approximate value = + q, and the process returns to step S244 in FIG.

ステップS262において、p≧0ではないと判断された場合、ステップS264において、共分散算出部364は、pqの近似値=−qとし、処理は、図39のステップS244に戻る。   If it is determined in step S262 that p ≧ 0 is not satisfied, in step S264, the covariance calculation unit 364 sets an approximate value of pq = −q, and the process returns to step S244 in FIG.

ステップS261において、|p|≧|q|ではないと判断された場合、ステップS265において、共分散算出部364は、q≧0であるか否かを判断する。   If it is determined in step S261 that | p | ≧ | q | is not satisfied, the covariance calculation unit 364 determines whether q ≧ 0 in step S265.

ステップS265において、q≧0であると判断された場合、ステップS266において、共分散算出部364は、pqの近似値=+pとし、処理は、図39のステップS244に戻る。   When it is determined in step S265 that q ≧ 0, in step S266, the covariance calculation unit 364 sets pq approximate value = + p, and the process returns to step S244 in FIG.

ステップS265において、q≧0ではないと判断された場合、ステップS267において、共分散算出部364は、pqの近似値=−pとし、処理は、図39のステップS244に戻る。   If it is determined in step S265 that q ≧ 0 is not satisfied, in step S267, the covariance calculation unit 364 sets pq approximate value = −p, and the process returns to step S244 in FIG.

この処理において、qまたはpが0である場合、pqの近似値は必ず0となる。具体的には、qが0であるとき、|p|≧|q|は必ず成り立つので、pの値に関わらず、pqの近似値は0となる。また、pが0であるとき、|p|≧|q|は必ず成り立たないので、qの値に関わらず、pqの近似値は0となる。   In this process, when q or p is 0, the approximate value of pq is always 0. Specifically, when q is 0, | p | ≧ | q | always holds, so that the approximate value of pq is 0 regardless of the value of p. Also, when p is 0, | p | ≧ | q | does not always hold, so the approximate value of pq is 0 regardless of the value of q.

図40を用いて説明した処理により、上述した式(4)を用いて、共分散値を近似することが可能である。   By the processing described with reference to FIG. 40, the covariance value can be approximated using the above-described equation (4).

次に、図41のフローチャートを参照して、図39のステップS243において実行される積算近似処理2について説明する。積算近似処理2は、上述した式(5)を用いて、近似された共分散値が算出される場合に実行される処理である。   Next, the integration approximation process 2 executed in step S243 of FIG. 39 will be described with reference to the flowchart of FIG. The integrated approximation process 2 is a process executed when an approximate covariance value is calculated using the above-described equation (5).

ステップS281において、共分散算出部364は、図39のステップS241およびステップS242において置き換えられた値pおよびqを用いて、pまたはqが0であるか否かを判断する。   In step S281, the covariance calculation unit 364 determines whether p or q is 0 using the values p and q replaced in steps S241 and S242 of FIG.

ステップS281において、pまたはqが0であると判断された場合、ステップS281において、共分散算出部364は、pqの近似値を0とし、処理は、図39のステップS244に戻る。   If it is determined in step S281 that p or q is 0, in step S281, the covariance calculation unit 364 sets the approximate value of pq to 0, and the process returns to step S244 in FIG.

ステップS281において、pおよびqはいずれも0ではないと判断された場合、ステップS283において、共分散算出部364は、pおよびqの関係は、p>0かつq>0、または、p<0かつq<0のうちのいずれか一方であるか否かを判断する。   If it is determined in step S281 that p and q are not 0, in step S283, the covariance calculation unit 364 determines that the relationship between p and q is p> 0 and q> 0, or p <0. In addition, it is determined whether any one of q <0 is satisfied.

ステップS283において、pおよびqの関係は、p>0かつq>0、または、p<0かつq<0のうちのいずれか一方であると判断された場合、ステップS284において、共分散算出部364は、pqの近似値を(|p|+|q|)/2とし、処理は、図39のステップS244に戻る。   If it is determined in step S283 that the relationship between p and q is either p> 0 and q> 0, or p <0 and q <0, in step S284, the covariance calculation unit In step 364, the approximate value of pq is set to (| p | + | q |) / 2, and the process returns to step S244 in FIG.

テップS283において、pおよびqの関係は、p>0かつq>0、または、p<0かつq<0のうちのいずれでもないと判断された場合、ステップS285において、共分散算出部364は、pqの近似値を、(−|p|−|q|)/2とし、処理は、図39のステップS244に戻る。   If it is determined in step S283 that the relationship between p and q is neither p> 0 and q> 0, or p <0 and q <0, the covariance calculation unit 364 determines in step S285. , Pq is set to (− | p | − | q |) / 2, and the process returns to step S244 in FIG.

なお、図39のステップS241およびステップS242において置き換えられた値pまたはqが、0の値を取ることは、信号の種類によってはまれな場合がある。そこで、ステップS281およびステップS282の処理を省略するようにしてもよい。このようにすることにより、演算処理速度を高速化したり、ハードウェアの実装規模を縮小するようにすることが可能である。   Note that the value p or q replaced in step S241 and step S242 in FIG. 39 may be 0 depending on the type of signal. Therefore, the processing in step S281 and step S282 may be omitted. By doing so, it is possible to increase the calculation processing speed and reduce the hardware implementation scale.

図41を用いて説明した処理により、上述した式(5)を用いて、共分散値を近似することが可能である。   With the processing described with reference to FIG. 41, it is possible to approximate the covariance value using the above-described equation (5).

図39乃至図41を用いて説明した積算処理が実行されることにより、上述した式(4)または式(5)を用いて、共分散値を近似することが可能である。このようにした場合、式(3)に示される定義どおりの共分散値の演算が実行された場合と比較して、計算速度が高速化されたり、計算のために実装されるハードウェアのゲート数を少なくすることができるなどの利点が発生する。   By executing the integration process described with reference to FIGS. 39 to 41, it is possible to approximate the covariance value using the above-described equation (4) or equation (5). In such a case, compared with the case where the calculation of the covariance value as defined in Expression (3) is executed, the calculation speed is increased or the hardware gate implemented for the calculation is used. Advantages such as being able to reduce the number occur.

次に、図42のフローチャートを参照して、図16の回帰演算処理部343において実行される、補間画素推定処理1について説明する。   Next, the interpolation pixel estimation process 1 executed in the regression calculation processing unit 343 in FIG. 16 will be described with reference to the flowchart in FIG.

ステップS291において、傾き算出部381は、上述した式(7)または式(8)を用いて、分散値および共分散値に基づく傾きKを算出する。   In step S291, the inclination calculation unit 381 calculates the inclination K based on the variance value and the covariance value using the above-described equation (7) or equation (8).

ここで、傾き算出部381は、上述した式(8)に示されるように、傾きKをKsによって求める場合Ksの分母に対するクリッピング処理を行う。このクリッピング処理は、画像が平坦かどうかの判定と出力振幅の抑制との両方の処理を実行した場合と同様に、ノイズ低減の作用がある。この処理が実行されることにより、別途ノイズ低減処理を追加しなくても画像の平坦な部分で目立つノイズを抑制することができる。   Here, the slope calculation unit 381 performs clipping processing on the denominator of Ks when the slope K is obtained by Ks, as shown in the above-described equation (8). This clipping process has the effect of reducing noise, as in the case where both the determination of whether an image is flat and the process of suppressing the output amplitude are executed. By executing this process, it is possible to suppress noise that is noticeable in a flat portion of an image without adding a separate noise reduction process.

ステップS292において、画素強度推定部382は、ステップS291において算出された傾きK、2つの平均値MCrおよびMCe、並びに、注目画素の画素強度とを基に、上述した式(6)の線形回帰式を用いて、注目画素位置の強度推定値を算出し、処理が終了される。 In step S292, the pixel intensity estimating unit 382, the slope K, 2 single average value calculated in step S291 M Cr and M Ce, and, based on the pixel intensity of the pixel of interest, linear above equation (6) Using the regression equation, an intensity estimate value of the target pixel position is calculated, and the process is terminated.

このような処理により、注目画素位置の各色の推定強度を算出することができる。特に、推定強度を算出する場合の線形回帰式に、上述した式(11)と同様にして、傾きKに、1より大きな適当な定数uを乗算することにより、その高周波成分を少し増強して、適切な高域補正を実行した場合と同様の効果を得ることができる。このようにすることにより、別途高域補正処理を追加しなくても高域が補正された画像を得ることができる。   Through such processing, the estimated intensity of each color at the target pixel position can be calculated. In particular, by multiplying the slope K by an appropriate constant u greater than 1 in the linear regression equation for calculating the estimated intensity, the high-frequency component is slightly enhanced in the same manner as the equation (11) described above. The same effect as that obtained when appropriate high-frequency correction is executed can be obtained. By doing so, it is possible to obtain an image in which the high frequency is corrected without adding a separate high frequency correction process.

次に、図43のフローチャートを参照して、図8のテクスチャ方向判定部305が実行するテクスチャ方向判定処理について説明する。   Next, the texture direction determination process executed by the texture direction determination unit 305 in FIG. 8 will be described with reference to the flowchart in FIG.

ステップS301において、テクスチャ方向判定部305は、次の式(16)を用いて注目画素(j,k)における横方向のグラディエント値dHを算出するとともに、式(17)を用いて縦方向のグラディエント値dVを算出する。すなわち、テクスチャ強度算出処理部334は、注目画素(j’,k’)から左右(水平方向)に2つ離れた画素位置のモザイク画像信号Mと注目画素のモザイク画像信号Mの差の絶対値の平均に、注目画素の左右(水平方向)に1つ離れた画素位置のモザイク画像信号M同士の差の絶対値を加算したものをdHとして算出するとともに、注目画素の上下(垂直方向)に2つ離れた画素位置のモザイク画像信号Mと注目画素のモザイク画像信号Mの差の絶対値の平均に、注目画素の上下(垂直方向)に1つ離れた画素位置のモザイク画像信号M同士の差の絶対値を加算したものをdVとして算出する。   In step S301, the texture direction determination unit 305 calculates the horizontal gradient value dH at the target pixel (j, k) using the following equation (16), and uses the equation (17) to calculate the vertical gradient. The value dV is calculated. That is, the texture intensity calculation processing unit 334 calculates the absolute value of the difference between the mosaic image signal M at the pixel position two pixels left and right (horizontal direction) from the target pixel (j ′, k ′) and the mosaic image signal M of the target pixel. Is calculated as dH by adding the absolute value of the difference between the mosaic image signals M at pixel positions separated by one to the left and right (horizontal direction) of the target pixel, and above and below (vertical direction) the target pixel. The average of the absolute values of the differences between the mosaic image signal M at the pixel position two apart and the mosaic image signal M at the pixel of interest is the average of the mosaic image signals M at the pixel positions one distance above and below (vertical direction) the pixel of interest. The sum of the absolute values of the differences is calculated as dV.

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
・・・(16)
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
・・・(17)
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
... (16)
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
... (17)

ステップS302において、テクスチャ方向判定部305は、テクスチャ強度dH>テクスチャ強度dVであるか否かを判定し、dH>dVであると判定された場合、ステップS203においてテクスチャ強度算出処理部334は、注目画素(j’,k’)のテクスチャ強度THを0とし、注目画素(j’,k’)のテクスチャ強度TVを1とする。 In step S302, the texture direction determination unit 305 determines whether or not texture strength dH> texture strength dV. If it is determined that dH> dV, the texture strength calculation processing unit 334 checks in step S203 The texture intensity T H of the pixel (j ′, k ′) is set to 0, and the texture intensity T V of the pixel of interest (j ′, k ′) is set to 1.

ステップS302において、dH>dVでないと判定された場合、ステップS204において、テクスチャ方向判定部305は、注目画素Cのテクスチャ強度THを1とし、注目画素(j’,k’)のテクスチャ強度TVを0とする。 In step S302, if it is determined not dH> dV, at step S204, the texture direction determination unit 305, the texture-intensity T H of the pixel of interest C and 1, texture intensity in the target pixel (j ', k') T Let V be 0.

ステップS303またはステップS304の処理の後、ステップS305において、テクスチャ方向判定部305は、注目画素のテクスチャ強度TH,TVの組からテクスチャ方向を判定して出力し、処理が終了される。 After step S303 or step S304, in step S305, the texture direction determination unit 305 determines and outputs the texture direction from the set of the texture strengths T H and T V of the pixel of interest, and the process ends.

このような処理により、注目画素位置におけるテクスチャが、横縞に近いものであるか、縦縞に近いものであるかの判定結果が得られて、スイッチ324に供給される。   By such processing, a determination result is obtained as to whether the texture at the target pixel position is close to horizontal stripes or vertical stripes, and is supplied to the switch 324.

次に、図44のフローチャートを参照して、図8の第2の処理ブロック303の処理について説明する。   Next, the processing of the second processing block 303 in FIG. 8 will be described with reference to the flowchart in FIG.

ステップS311において、第2の処理ブロック303の第2の強度推定部321は、注目画素とその左右にある画素を用いて注目画素の強度推定を行い、第1の推定値を算出する。   In step S <b> 311, the second intensity estimation unit 321 of the second processing block 303 performs intensity estimation of the target pixel using the target pixel and the pixels on the left and right sides thereof, and calculates a first estimated value.

ステップS312において、第2の処理ブロック303の第3の強度推定部322は、注目画素とその上下にある画素を用いて注目画素の強度推定を行う。   In step S312, the third intensity estimation unit 322 of the second processing block 303 estimates the intensity of the target pixel using the target pixel and pixels above and below it.

ステップS313において、第2の処理ブロック303の第4の強度推定部323は、ステップS312において算出された注目画素とその上下にある画素を用いた注目画素の強度推定結果と、注目画素の上下左右の画素を用いて強度推定を行い、第2の推定値を算出する。   In step S313, the fourth intensity estimation unit 323 of the second processing block 303 calculates the intensity estimation result of the target pixel using the target pixel calculated in step S312 and the pixels above and below the target pixel, and the upper, lower, left, and right of the target pixel. Intensity estimation is performed using these pixels, and a second estimated value is calculated.

ステップS314において、第2の処理ブロック303のスイッチ324は、テクスチャ方向反転部305から供給されるテクスチャ方向の情報を取得する。   In step S314, the switch 324 of the second processing block 303 acquires the texture direction information supplied from the texture direction reversing unit 305.

ステップS315において、第2の処理ブロック303のスイッチ324は、テクスチャ方向は、横方向に近いか否かを判断する。   In step S315, the switch 324 of the second processing block 303 determines whether or not the texture direction is close to the horizontal direction.

ステップS315において、テクスチャ方向は、横方向に近いと判断された場合、ステップS316において、第2の処理ブロック303のスイッチ324は、注目画素とその左右にある画素を用いた注目画素の強度推定結果である第1の推定値を出力し、処理が終了される。   When it is determined in step S315 that the texture direction is close to the horizontal direction, in step S316, the switch 324 of the second processing block 303 determines the intensity estimation result of the target pixel using the target pixel and the pixels on the left and right sides thereof. Is output, and the process is terminated.

ステップS315において、テクスチャ方向は、横方向に近くない、すなわち、たて方向に近いと判断された場合、ステップS316において、第2の処理ブロック303のスイッチ324は、注目画素の上下左右の画素を用いた注目画素の強度推定結果である第2の推定値を出力して、処理が終了される。   When it is determined in step S315 that the texture direction is not close to the horizontal direction, that is, it is determined that the texture direction is close to the vertical direction, in step S316, the switch 324 of the second processing block 303 selects the upper, lower, left, and right pixels of the target pixel. The second estimated value, which is the intensity estimation result of the used pixel of interest, is output, and the process ends.

このような処理により、テクスチャ方向に対応して信頼度が高い推定値が選択されて、スイッチ306に供給される。   By such processing, an estimated value with high reliability corresponding to the texture direction is selected and supplied to the switch 306.

次に、図45のフローチャートを参照して、図8の第3の処理ブロック304の処理について説明する。   Next, the processing of the third processing block 304 of FIG. 8 will be described with reference to the flowchart of FIG.

ステップS331において、第3の処理ブロック303の第3の強度推定部322は、注目画素とその上下にある画素を用いて注目画素の強度推定を行い、第1の推定値を算出する。   In step S331, the third intensity estimation unit 322 of the third processing block 303 performs intensity estimation of the target pixel using the target pixel and pixels above and below it, and calculates a first estimated value.

ステップS332において、第3の処理ブロック303の第2の強度推定部321は、注目画素とその左右にある画素を用いて注目画素の強度推定を行う。   In step S332, the second intensity estimation unit 321 of the third processing block 303 estimates the intensity of the target pixel using the target pixel and the pixels on the left and right sides thereof.

ステップS333において、第3の処理ブロック303の第4の強度推定部323は、ステップS331において算出された注目画素とその左右にある画素を用いた注目画素の強度推定結果と、注目画素の上下左右の画素を用いて強度推定を行い、第2の推定値を算出する。   In step S333, the fourth intensity estimation unit 323 of the third processing block 303 calculates the intensity estimation result of the target pixel using the target pixel calculated in step S331 and the pixels on the left and right, and the upper, lower, left, and right of the target pixel. Intensity estimation is performed using these pixels, and a second estimated value is calculated.

ステップS334において、第3の処理ブロック303のスイッチ324は、テクスチャ方向反転部305から供給されるテクスチャ方向の情報を取得する。   In step S334, the switch 324 of the third processing block 303 acquires the texture direction information supplied from the texture direction reversing unit 305.

ステップS335において、第3の処理ブロック303のスイッチ324は、テクスチャ方向は、たて方向に近いか否かを判断する。   In step S335, the switch 324 of the third processing block 303 determines whether or not the texture direction is close to the vertical direction.

ステップS335において、テクスチャ方向は、たて方向に近いと判断された場合、ステップS336において、第3の処理ブロック303のスイッチ324は、注目画素とその上下にある画素を用いた注目画素の強度推定結果である第1の推定値を出力し、処理が終了される。   When it is determined in step S335 that the texture direction is close to the vertical direction, in step S336, the switch 324 of the third processing block 303 estimates the intensity of the target pixel using the target pixel and pixels above and below it. The first estimated value that is the result is output, and the process is terminated.

ステップS335において、テクスチャ方向は、たて方向に近くない、すなわち、横方向に近いと判断された場合、ステップS336において、第3の処理ブロック303のスイッチ324は、注目画素の上下左右の画素を用いた注目画素の強度推定結果である第2の推定値を出力して、処理が終了される。   If it is determined in step S335 that the texture direction is not close to the vertical direction, that is, close to the horizontal direction, in step S336, the switch 324 of the third processing block 303 sets the upper, lower, left, and right pixels of the target pixel. The second estimated value, which is the intensity estimation result of the used pixel of interest, is output, and the process ends.

このような処理により、テクスチャ方向に対応して信頼度が高い推定値が選択されて、スイッチ306に供給される。   By such processing, an estimated value with high reliability corresponding to the texture direction is selected and supplied to the switch 306.

図7を用いて説明したG+E強度推定部282の構成は、図8を用いて説明したように、G強度推定部291とE強度推定部292がそれぞれに注目画素位置のG強度とE強度を推定するものであった。更に、図8を用いて説明したように、G強度推定部291とE強度推定部292は同一の構成を有するものであった。ここで、図9をに示されたスイッチ306の動作と、図8を用いて説明したG強度推定部291とE強度推定部292の構成とより、G強度推定部291とE強度推定部292で構成を共有できる部分がある。すなわち、注目画素位置の色がGまたはEである場合には、G強度推定291とE強度推定部292のスイッチ306の出力はaまたはbであり、RまたはBである場合にはスイッチ306の出力はcまたはdである。そして、G強度推定部401とE強度推定部402の出力は加算器によって加算されるので、注目画素位置の色がGまたはEである場合には(a+b)を、RまたはBである場合には(c+d)を出力するようにすれば、G強度推定部291とE強度推定部292の共通部分をまとめてシンプルな構成とすることができる。   The configuration of the G + E intensity estimating unit 282 described with reference to FIG. 7 is such that the G intensity estimating unit 291 and the E intensity estimating unit 292 respectively set the G intensity and E intensity of the target pixel position as described with reference to FIG. It was an estimate. Further, as described with reference to FIG. 8, the G intensity estimation unit 291 and the E intensity estimation unit 292 have the same configuration. Here, based on the operation of the switch 306 shown in FIG. 9 and the configurations of the G intensity estimating unit 291 and the E intensity estimating unit 292 described with reference to FIG. 8, the G intensity estimating unit 291 and the E intensity estimating unit 292 are used. There is a part that can share the configuration. That is, when the color of the target pixel position is G or E, the output of the switch 306 of the G intensity estimation 291 and the E intensity estimation unit 292 is a or b, and when it is R or B, the output of the switch 306 The output is c or d. Since the outputs of the G intensity estimation unit 401 and the E intensity estimation unit 402 are added by an adder, (a + b) is selected when the color of the target pixel position is G or E, and R or B is selected. If (c + d) is output, the common parts of the G intensity estimator 291 and the E intensity estimator 292 can be combined into a simple configuration.

そのように構成を変更したG+E強度推定部551の構成を示すブロック図を図46に示す。注目画素選択部301、第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、第4の強度推定部323、およびスイッチ324の構成は、図8を用いて説明したG強度推定部291とE強度推定部292の構成と同一である。   FIG. 46 shows a block diagram showing the configuration of the G + E intensity estimation unit 551 whose configuration has been changed as described above. The configurations of the pixel-of-interest selection unit 301, the first intensity estimation unit 311, the second intensity estimation unit 321, the third intensity estimation unit 322, the fourth intensity estimation unit 323, and the switch 324 are described with reference to FIG. The configurations of the G intensity estimation unit 291 and the E intensity estimation unit 292 described are the same.

そして、注目画素選択部301により選択された注目画素と第1の強度推定部311により推定された強度推定値が、加算処理部561−1により加算処理されて、入力(a+b)としてスイッチ562に供給される。そして、第2の強度推定部321および第4の強度推定部323の処理により、テクスチャ方向が横方向に近い場合に信頼度が高い2つの推定値が加算処理部561−2により加算処理され、そして、第3の強度推定部321および第4の強度推定部323の処理により、テクスチャ方向がたて方向に近い場合に信頼度が高い2つの推定値が加算処理部561−3により加算処理され、テクスチャ方向判定部305によるテクスチャ方向の判定結果に基づいて、スイッチ324により選択された推定値の和が、入力(c+d)としてスイッチ562に供給される。   Then, the pixel of interest selected by the pixel-of-interest selection unit 301 and the intensity estimation value estimated by the first intensity estimation unit 311 are added by the addition processing unit 561-1 and input to the switch 562 as an input (a + b). Supplied. Then, by the processing of the second intensity estimation unit 321 and the fourth intensity estimation unit 323, two estimation values with high reliability are added by the addition processing unit 561-2 when the texture direction is close to the horizontal direction, Then, by the processes of the third intensity estimator 321 and the fourth intensity estimator 323, two estimated values with high reliability are added by the adder 561-3 when the texture direction is close to the vertical direction. Based on the texture direction determination result by the texture direction determination unit 305, the sum of the estimated values selected by the switch 324 is supplied to the switch 562 as an input (c + d).

この時のスイッチ562の動作は図47のようになる。すなわち、注目画素の色がRであるとき、スイッチ562の出力は(c+d)であり、注目画素の色がGであるとき、スイッチ562の出力は(a+b)であり、注目画素の色がBであるとき、スイッチ562の出力は(c+d)であり、注目画素の色がEであるとき、スイッチ562の出力は(a+b)である。   The operation of the switch 562 at this time is as shown in FIG. That is, when the color of the target pixel is R, the output of the switch 562 is (c + d), and when the color of the target pixel is G, the output of the switch 562 is (a + b), and the color of the target pixel is B , The output of the switch 562 is (c + d), and when the color of the pixel of interest is E, the output of the switch 562 is (a + b).

また、第1の強度推定部311、第2の強度推定部321、第3の強度推定部322、および、第4の強度推定部323は、いずれも、その内部に図10を用いて説明した粗補間処理部341、統計量算出部342、および、回帰演算処理部242を有している。したがって、図46を用いて説明したG+E強度推定部551に対して、粗補間処理部341、統計量算出部342、および、回帰演算処理部242の処理が共通する部分をまとめることにより、図48に示されるG+E強度推定部571を構成することが可能となる。G+E強度推定部571は、もちろん、G+E強度推定部551と同様の処理を実行することが可能なものである。   In addition, the first intensity estimating unit 311, the second intensity estimating unit 321, the third intensity estimating unit 322, and the fourth intensity estimating unit 323 are all described with reference to FIG. A coarse interpolation processing unit 341, a statistic calculation unit 342, and a regression calculation processing unit 242 are included. Therefore, the G + E intensity estimator 551 described with reference to FIG. 46 is combined with the common processes of the coarse interpolation processor 341, the statistic calculator 342, and the regression calculation processor 242 to obtain FIG. The G + E intensity estimation unit 571 shown in FIG. The G + E intensity estimation unit 571 can, of course, execute the same processing as the G + E intensity estimation unit 551.

すなわち、G+E強度推定部551における第1の強度推定部311と第4の強度推定部323との統計量の計算は共通のものであるので、G+E強度推定部571においては、統計量算出部342−1として、1つの統計量算出部により実行されるような構成となされている。また、G+E強度推定部551における第2の強度推定部321と第3の強度推定部322の出力は、注目画素の色がRまたはBのときに用いられるものであるので、G+E強度推定部571においては、スイッチ581が、粗補間処理部427から供給されたRのラフな補間値とBのラフな補間値のうち、注目画素と一致する色の補間値を選択して、統計量算出部342−2および統計量算出部342−3に供給するようになされている。   That is, since the G + E intensity estimator 551 has the same statistical calculation for the first intensity estimator 311 and the fourth intensity estimator 323, the G + E intensity estimator 571 includes the statistic calculator 342. −1 is configured to be executed by one statistic calculation unit. In addition, since the outputs of the second intensity estimator 321 and the third intensity estimator 322 in the G + E intensity estimator 551 are used when the color of the pixel of interest is R or B, the G + E intensity estimator 571 , The switch 581 selects the interpolation value of the color that matches the target pixel from the rough interpolation value of R and the rough interpolation value of B supplied from the rough interpolation processing unit 427, and calculates the statistical amount calculation unit. 342-2 and the statistic calculator 342-3 are supplied.

粗補間処理部427は、図49のフローチャートを用いて後述する処理により、RGBE4色のラフな補間値を算出する。また、スイッチ562の動作は、図47を用いて説明した場合と同様である。   The coarse interpolation processing unit 427 calculates rough interpolation values of the four RGBE colors by processing described later using the flowchart of FIG. The operation of the switch 562 is the same as that described with reference to FIG.

次に、図49のフローチャートを参照して、図48の粗補間処理部472において実行される粗補間処理(この処理は、図17を用いて説明した粗補間処理部472においても、後述する図50のステップS371で実行される)について説明する。   Next, referring to the flowchart of FIG. 49, the rough interpolation processing executed in the rough interpolation processing unit 472 of FIG. 48 (this processing is also described later in the rough interpolation processing unit 472 described with reference to FIG. 17). 50 executed in step S371).

粗補間処理部472は、ステップS351において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値sを初期化して、s=2とし、ステップS352において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値tを初期化して、t=2とする。   In step S351, the coarse interpolation processing unit 472 initializes the value s of the first register indicating the pixel position to be processed among the supplied pixels in the local region, and sets s = 2, and in step S352, Among the supplied local area pixels, the value t of the second register indicating the pixel position where the process is executed is initialized to t = 2.

ステップS353において、粗補間処理部472は、画素(s、t)の画素強度を補間値α1とする。   In step S353, the coarse interpolation processing unit 472 sets the pixel intensity of the pixel (s, t) as the interpolation value α1.

ステップS354において、粗補間処理部472は、画素(s、t)の隣の画素である画素(s−1、t)と、画素(s、t)に対して画素(s−1、t)と逆方向の隣の画素である画素(s+1、t)との平均強度を補間値α2とする。   In step S354, the rough interpolation processing unit 472 outputs the pixel (s-1, t), which is a pixel adjacent to the pixel (s, t), and the pixel (s-1, t) with respect to the pixel (s, t). And the average intensity of the pixel (s + 1, t) which is the adjacent pixel in the opposite direction is defined as an interpolation value α2.

ステップS355において、粗補間処理部472は、画素(s、t)に対して、画素(s−1、t)および画素(s+1、t)の方向と垂直な方向の隣の画素である画素(s、t−1)と、画素(s、t)に対して画素(s、t−1)と逆方向の隣の画素である画素(s、t+1)との平均強度を補間値α3とする。   In step S355, the coarse interpolation processing unit 472 is a pixel (s, t) and a pixel (s−1, t) and a pixel that is a pixel adjacent to the pixel (s + 1, t) in a direction perpendicular to the direction of the pixel (s + 1, t). The average intensity of s, t−1) and the pixel (s, t + 1) that is the pixel adjacent to the pixel (s, t−1) in the opposite direction to the pixel (s, t) is defined as an interpolation value α3. .

例えば、画素(s、t)が、図8における画素(2,2)である場合、その画素はG強度を示し、画素(s−1、t)と画素(s+1、t)とはR強度を示し、画素(s、t−1)と画素(s、t+1)とはB強度を示す。   For example, when the pixel (s, t) is the pixel (2, 2) in FIG. 8, the pixel indicates the G intensity, and the pixel (s−1, t) and the pixel (s + 1, t) have the R intensity. The pixel (s, t−1) and the pixel (s, t + 1) indicate B intensity.

ステップS356において、粗補間処理部472は、注目画素に対して、右斜め上、右斜め下、左斜め上、および、左斜め下方向である画素(s−1、t−1)、画素(s−1、t+1)、画素(s+1、t−1)、および、画素(s+1、t+1)の平均強度を補間値α4とする。   In step S356, the rough interpolation processing unit 472 performs the pixel (s-1, t-1), pixel (s) that are in the upper right direction, the lower right direction, the upper left direction, and the lower left direction with respect to the target pixel. The average intensity of s−1, t + 1), pixel (s + 1, t−1), and pixel (s + 1, t + 1) is set as an interpolation value α4.

例えば、画素(s、t)が、図8における画素(2,2)である場合、その画素はG強度を示し、画素(s−1、t−1)、画素(s−1、t+1)、画素(s+1、t−1)、および、画素(s+1、t+1)も、それぞれG強度を示す。また、画素(s、t)が、図8における画素(2,3)である場合、その画素はB強度を示し、画素(s−1、t−1)、画素(s−1、t+1)、画素(s+1、t−1)、および、画素(s+1、t+1)は、それぞれ、R強度を示す。そして、画素(s、t)が、図8における画素(3,2)である場合、その画素はR強度を示し、画素(s−1、t−1)、画素(s−1、t+1)、画素(s+1、t−1)、および、画素(s+1、t+1)は、それぞれ、B強度を示す。   For example, when the pixel (s, t) is the pixel (2, 2) in FIG. 8, the pixel indicates G intensity, and the pixel (s−1, t−1), pixel (s−1, t + 1) , Pixel (s + 1, t−1), and pixel (s + 1, t + 1) also each exhibit G intensity. In addition, when the pixel (s, t) is the pixel (2, 3) in FIG. 8, the pixel indicates B intensity, and the pixel (s−1, t−1), pixel (s−1, t + 1) , Pixel (s + 1, t−1) and pixel (s + 1, t + 1) each show R intensity. When the pixel (s, t) is the pixel (3, 2) in FIG. 8, the pixel indicates the R intensity, and the pixel (s−1, t−1), the pixel (s−1, t + 1) , Pixel (s + 1, t−1) and pixel (s + 1, t + 1) each show B intensity.

ステップS357において、粗補間処理部472は、ステップS353乃至ステップS356の処理により算出された補間値α1乃至α4が、それぞれ、RGBEのいずれに対応するかを判定する。   In step S357, the coarse interpolation processing unit 472 determines which of the RGBE values the interpolation values α1 to α4 calculated by the processing of steps S353 to S356 correspond to.

カラーフィルタの配列が、図3を用いて説明したような配列であった場合、画素(s、t)がGの画素であるとき、補間値α1はGに対する補間値であり、補間値α2はBに対する補間値であり、補間値α3はRに対する補間値であり、補間値α4はEに対する補間値である。また、画素(s、t)がRの画素であるとき、補間値α1はRに対する補間値であり、補間値α2はEに対する補間値であり、補間値α3はGに対する補間値であり、補間値α4はBに対する補間値となる。また、(s、t)がBの画素であるとき、補間値α1はBに対する補間値であり、補間値α2はGに対する補間値であり、補間値α3はEに対する補間値であり、補間値α4はRに対する補間値となる。そして、(s、t)がEの画素であるとき、補間値α1はEに対する補間値であり、補間値α2はRに対する補間値であり、補間値α3はBに対する補間値であり、補間値α4はGに対する補間値となる。   When the arrangement of the color filters is as described with reference to FIG. 3, when the pixel (s, t) is a G pixel, the interpolation value α1 is an interpolation value for G, and the interpolation value α2 is An interpolation value for B, an interpolation value α3 is an interpolation value for R, and an interpolation value α4 is an interpolation value for E. When the pixel (s, t) is an R pixel, the interpolation value α1 is an interpolation value for R, the interpolation value α2 is an interpolation value for E, and the interpolation value α3 is an interpolation value for G. The value α4 is an interpolation value for B. When (s, t) is a pixel of B, the interpolation value α1 is an interpolation value for B, the interpolation value α2 is an interpolation value for G, the interpolation value α3 is an interpolation value for E, and the interpolation value α4 is an interpolation value for R. When (s, t) is an E pixel, the interpolation value α1 is an interpolation value for E, the interpolation value α2 is an interpolation value for R, the interpolation value α3 is an interpolation value for B, and the interpolation value α4 is an interpolation value for G.

ステップS358において、粗補間処理部472は、Gに対応する2つの補間値の平均値を、画素(s、t)のG補間値とする。   In step S358, the coarse interpolation processing unit 472 sets the average value of the two interpolation values corresponding to G as the G interpolation value of the pixel (s, t).

ステップS359において、粗補間処理部472は、Rに対応する補間値を、画素(s、t)のR補間値とする。   In step S359, the coarse interpolation processing unit 472 sets the interpolation value corresponding to R as the R interpolation value of the pixel (s, t).

ステップS360において、粗補間処理部472は、Bに対応する補間値を、画素(s、t)のB補間値とする。   In step S360, the coarse interpolation processing unit 472 sets the interpolation value corresponding to B as the B interpolation value of the pixel (s, t).

ステップS361において、粗補間処理部472は、Eに対応する補間値を、画素(s、t)のE補間値とする。   In step S361, the coarse interpolation processing unit 472 sets the interpolation value corresponding to E as the E interpolation value of the pixel (s, t).

ステップS362において、粗補間処理部472は、処理を実行する画素位置を示す第2のレジスタの値tを参照し、t=n−1であるか否かを判断する。   In step S362, the rough interpolation processing unit 472 refers to the value t of the second register indicating the pixel position to be processed, and determines whether t = n−1.

ステップS362において、t=n−1ではないと判断された場合、ステップS363において、粗補間処理部472は、処理を実行する画素位置を示す第2のレジスタの値tを、t=t+1とし、処理は、ステップS353に戻り、それ以降の処理が繰り返される。   If it is determined in step S362 that t = n−1 is not satisfied, in step S363, the coarse interpolation processing unit 472 sets the value t of the second register indicating the pixel position to be processed to t = t + 1, The processing returns to step S353, and the subsequent processing is repeated.

ステップS364において、粗補間処理部472は、処理を実行する画素位置を示す第1のレジスタの値sを参照し、s=n−1であるか否かを判断する。   In step S364, the coarse interpolation processing unit 472 refers to the value s of the first register indicating the pixel position where the process is executed, and determines whether s = n−1.

ステップS364において、s=n−1ではないと判断された場合、ステップS365において、粗補間処理部472は、処理を実行する画素位置を示す第1のレジスタの値sを、s=s+1とし、処理は、ステップS352に戻り、それ以降の処理が繰り返される。   If it is determined in step S364 that s = n−1 is not satisfied, in step S365, the coarse interpolation processing unit 472 sets the value s of the first register indicating the pixel position to be processed as s = s + 1, The processing returns to step S352, and the subsequent processing is repeated.

ステップS364において、s=n−1ではあると判断された場合、ステップS366において、粗補間処理部472は、注目画素付近の(n−2)の2乗個の画素のRGBの補間値の組を出力し、処理が終了される。   When it is determined in step S364 that s = n−1, in step S366, the coarse interpolation processing unit 472 sets a set of RGB interpolation values of (n−2) square pixels near the target pixel. Is output and the process is terminated.

このような処理により、局所領域として抽出されたn×nの画素に対して、注目画素を中心とした(n−2)×(n−2)個所の画素位置のそれぞれにおけるRGBEの補間値が算出される。   With such a process, the RGBE interpolation values at the (n−2) × (n−2) pixel positions centered on the target pixel with respect to the n × n pixels extracted as the local region are obtained. Calculated.

ただし、図49を用いて説明した粗補間処理において、ステップS353乃至ステップS356の処理は相互に順序を入れ替えてもかまわなく、更にステップS358乃至ステップS361の処理も、相互に順序を入れ替えてもかまわない。   However, in the coarse interpolation process described with reference to FIG. 49, the order of steps S353 to S356 may be interchanged, and the order of steps S358 to S361 may also be interchanged. Absent.

図46を用いて説明したG+E強度推定部551およびG+E強度推定部571が、図6のG+E強度推定部282と置き換えられた場合においても、その後段の、R(GBまたはE)強度推定部283(またはRGBE強度推定部283)が実行する処理は同一である。   Even when the G + E intensity estimator 551 and the G + E intensity estimator 571 described with reference to FIG. 46 are replaced with the G + E intensity estimator 282 in FIG. 6, the R (GB or E) intensity estimator 283 at the subsequent stage is used. The processing executed by (or RGBE intensity estimation unit 283) is the same.

次に、図50のフローチャートを参照して、図17を用いて説明したRGBE強度推定部283が図24のステップS24において実行する色強度推定処理1について説明する。   Next, the color intensity estimation process 1 executed by the RGBE intensity estimation unit 283 described with reference to FIG. 17 in step S24 of FIG. 24 will be described with reference to the flowchart of FIG.

ステップS371において、粗補間処理部472は、図49を用いて説明した粗補間処理2を実行する。   In step S371, the coarse interpolation processing unit 472 executes the coarse interpolation process 2 described with reference to FIG.

ステップS372において、信頼度算出部471は、G+E強度推定処理部282において算出されたG+E強度を取得する。   In step S372, the reliability calculation unit 471 acquires the G + E intensity calculated by the G + E intensity estimation processing unit 282.

ステップS373において、信頼度算出部471は、図51のフローチャートを用いて後述する信頼度算出処理を実行する。   In step S373, the reliability calculation unit 471 executes a reliability calculation process to be described later using the flowchart of FIG.

ステップS374において、統計量算出部432−1乃至432−4は、図28を用いて説明した2色分布形状の統計量算出処理を実行する。   In step S374, the statistical amount calculation units 432-1 to 432-4 execute the two-color distribution shape statistical amount calculation processing described with reference to FIG.

ステップS375において、回帰演算処理部474−1乃至474−4は、図52を用いて説明する補間画素推定処理2を実行し、処理は、図24のステップS25に進む。   In step S375, the regression calculation processing units 474-1 to 474-4 execute interpolation pixel estimation processing 2 described with reference to FIG. 52, and the processing proceeds to step S25 in FIG.

次に、図51のフローチャートを参照して、図50のステップS373において実行される信頼度算出処理について説明する。   Next, the reliability calculation process executed in step S373 in FIG. 50 will be described with reference to the flowchart in FIG.

ステップS401において、信頼度算出部471の高周波抽出部481−1乃至481−6は、図19を用いて説明した、注目画素付近の所定の12の位置のG補間値のうち、自分自身が抽出する高周波を求めるために必要な画素位置のG+E補間値、すなわち、斜めに接しているGとEとの画素値の平均値を算出する。   In step S401, the high-frequency extraction units 481-1 to 481-6 of the reliability calculation unit 471 extract themselves from the G interpolation values at the predetermined 12 positions near the target pixel described with reference to FIG. The G + E interpolation value of the pixel position necessary for obtaining the high frequency to be calculated, that is, the average value of the pixel values of G and E that are in contact with each other obliquely is calculated.

ステップS402において、高周波抽出部481−1乃至481−6は、ステップS401の処理において算出されたG補間値を基に、注目画素を中心とした、6方向の高周波成分を、それぞれ抽出し、加算処理部482に供給する。   In step S402, the high frequency extraction units 481-1 to 481-6 extract and add high frequency components in six directions centered on the pixel of interest based on the G interpolation value calculated in the processing of step S401. This is supplied to the processing unit 482.

ステップS403において、加算処理部482は、高周波抽出部481−1乃至481−6から供給された、6つの高周波成分を加算して、クリッピング処理部483に出力する。   In step S403, the addition processing unit 482 adds the six high frequency components supplied from the high frequency extraction units 481-1 to 481-6 and outputs the result to the clipping processing unit 483.

ステップS404において、クリッピング処理部483は、加算処理部482から供給された加算結果をクリッピングし、その値を信頼度値として、回帰演算処理部286−1乃至286−3に出力し、処理は、図50のステップS374に進む。   In step S404, the clipping processing unit 483 clips the addition result supplied from the addition processing unit 482, and outputs the value as a reliability value to the regression calculation processing units 286-1 to 286-3. Proceed to step S374 in FIG.

このような処理により、注目画素近辺に高周波成分が存在するか否かを示す信頼度値が算出されて、回帰演算処理部474−1乃至474−4に出力される。算出される信頼度値は、細い縞模様状のテクスチャの強度が大きいほど信頼度値が大きくなるので、信頼度値が小さいほうが統計量による色分布形状の推定が確かである可能性が高い。   Through such processing, a reliability value indicating whether or not a high-frequency component exists in the vicinity of the target pixel is calculated and output to the regression calculation processing units 474-1 to 474-4. The calculated reliability value increases as the strength of the thin striped texture increases, so the smaller the reliability value, the higher the probability that the color distribution shape is estimated by the statistics.

次に、図52のフローチャートを参照して、図50のステップS375において実行される補間画素推定処理2について説明する。   Next, the interpolation pixel estimation processing 2 executed in step S375 in FIG. 50 will be described with reference to the flowchart in FIG.

ステップS421において、傾き算出部501は、上述した式(7)を用いて、平均値に基づく傾き推定値Kmを算出し、傾き合成部503に出力する。   In step S <b> 421, the inclination calculation unit 501 calculates the estimated inclination value Km based on the average value using the above-described equation (7), and outputs it to the inclination synthesis unit 503.

ステップS422において、傾き算出部502は、上述した式(8)を用いて、分散値および共分散値に基づく傾き推定値Ksを算出し、傾き合成部503に出力する。   In step S422, the inclination calculation unit 502 calculates the estimated inclination value Ks based on the variance value and the covariance value using the above-described equation (8), and outputs it to the inclination synthesis unit 503.

ここで、傾き算出部502は、上述した式(8)に示されるように、傾きKsの分母に対するクリッピング処理を行う。このクリッピング処理は、画像が平坦かどうかの判定と出力振幅の抑制との両方の処理を実行した場合と同様に、ノイズ低減の作用がある。この処理が実行されることにより、別途ノイズ低減処理を追加しなくても画像の平坦な部分で目立つノイズを抑制することができる。   Here, the inclination calculation unit 502 performs clipping processing on the denominator of the inclination Ks as shown in the above-described equation (8). This clipping process has the effect of reducing noise, as in the case where both the determination of whether an image is flat and the process of suppressing the output amplitude are executed. By executing this process, it is possible to suppress noise that is noticeable in a flat portion of an image without adding a separate noise reduction process.

ステップS423において、傾き合成部503は、ステップS421において算出された傾き推定値Kmと、ステップS422において算出された傾き推定値Ksとを、上述した式(9)を用いて、信頼度hに基づいて合成し、傾き推定値Kを算出し、画素強度推定部504に出力する。   In step S423, the slope composition unit 503 uses the slope estimate value Km calculated in step S421 and the slope estimate value Ks calculated in step S422 based on the reliability h using the above-described equation (9). Are combined to calculate an estimated slope value K and output it to the pixel intensity estimating unit 504.

ステップS424において、素強度推定部504は、ステップS423において算出された傾き推定値K、2つの平均値MGおよびMR(またはMB)、並びに、注目画素位置のG強度とを基に、上述した式(10)または式(11)の線形回帰式を用いて、注目画素位置のR強度(またはB強度)の推定値を算出し、処理が終了される。 In step S424, the elementary intensity estimation unit 504, based on the estimated slope value K calculated in step S423, the two average values M G and M R (or M B ), and the G intensity at the target pixel position, The estimated value of the R intensity (or B intensity) of the target pixel position is calculated using the linear regression equation of the above-described equation (10) or equation (11), and the process is terminated.

このような処理により、注目画素位置の各色の推定強度を算出することができる。特に、推定強度を算出する場合の線形回帰式に、上述した式(11)を用いて、傾きKに、1より大きな適当な定数uを乗算することにより、その高周波成分を少し増強して、Rに対する適切な高域補正を実行した場合と同様の効果を得ることができる。このようにすることにより、別途高域補正処理を追加しなくても高域が補正された画像を得ることができる。   Through such processing, the estimated intensity of each color at the target pixel position can be calculated. In particular, the high frequency component is slightly enhanced by multiplying the slope K by an appropriate constant u greater than 1 using the above-described equation (11) in the linear regression equation when calculating the estimated intensity, An effect similar to that obtained when appropriate high-frequency correction for R is executed can be obtained. By doing so, it is possible to obtain an image in which the high frequency is corrected without adding a separate high frequency correction process.

上述した処理は、カラーフィルタに用いられるモザイクパターンが、図53に示されるよう名6色配列である場合にも適用可能である。図53に示される6色配列は、図3の4色配列のRおよびBの画素のうちの半分をそれぞれ、RとBから若干分光特性が異なるものに置換した配列となっている(換言すれば、R1とR2,B1とB2の分光特性は、高い相関を有している)。すなわち、図53に示されるカラーフィルタは、輝度値の推定に用いられるGとEとが、それぞれ水平方向および垂直方向に同一のラインとならないように市松状に並べられ、このGとEとは異なる色R1とR2が、Eと同一ライン(すなわち、Gとは異なるライン)に位置し、G,E,R1、R2とは異なる色B1とB2が、Gと同一のライン(すなわち、Eとは異なるライン)に位置するようになされているカラーフィルタである。   The above-described processing can also be applied when the mosaic pattern used for the color filter is a six-color name array as shown in FIG. The six-color array shown in FIG. 53 is an array in which half of the R and B pixels in the four-color array in FIG. 3 are each replaced with one having a slightly different spectral characteristic from R and B (in other words, For example, the spectral characteristics of R1 and R2, B1 and B2 are highly correlated). That is, the color filter shown in FIG. 53 is arranged in a checkered pattern so that G and E used for luminance value estimation are not the same line in the horizontal direction and the vertical direction, respectively. Different colors R1 and R2 are located on the same line as E (ie, a line different from G), and colors B1 and B2 different from G, E, R1, and R2 are located on the same line as G (ie, E and Are color filters that are located on different lines.

この6色配列において、GとEの配列は、図3の4色配列と同じであるので、G+E強度の推定値を用いた輝度成分の算出方法をそのまま適用することができるのは明らかである。また、図53に示した6色配列はRとBの両方を2つの分光特性の近い色に分割したが、どちらか一方だけが分割された5色配列を構成しても、本発明は変わりなく適用可能であることは言うまでもない。このような6色配列を有するカラーフィルタを用いることにより、マルチスペクトル撮像によってより色再現に有利な画像信号を得ることが可能になる。更に、デモザイク処理は相関の高いGとEを用いてG+Eを全画素に補間するので、輝度の高域成分まで正確に算出できる。   In this six-color array, the G and E arrays are the same as the four-color array in FIG. 3, so it is clear that the luminance component calculation method using the estimated value of G + E intensity can be applied as it is. . In addition, although the six-color array shown in FIG. 53 divides both R and B into two colors having similar spectral characteristics, the present invention can be changed even if only one of the five-color arrays is configured. Needless to say, it is applicable. By using a color filter having such a six-color arrangement, it is possible to obtain an image signal that is more advantageous for color reproduction by multispectral imaging. Furthermore, since the demosaic process interpolates G + E for all pixels using G and E having high correlation, it is possible to accurately calculate even the high frequency component of the luminance.

図6乃至図53を用いて説明したデモザイク処理部253の処理においては、図3を用いて説明した4色のカラーフィルタ、または、図53に示される6色のカラーフィルタを用いて得られたモザイク画像に対して、G+E強度推定手段282、G+E強度推定手段401、または、G+E強度推定手段431において、G+E強度を推定し、これを基に、RGBEの4色の画像を得るようになされていた。これに対して、ある色が市松状に配置されているカラーフィルタが用いられている場合、G+E強度に代わって、市松状に配置されている色の情報を用いて注目画素の輝度値を推定し、これを基に、RGBEの4色の画像を得るようにしてもよい。   The processing of the demosaic processing unit 253 described with reference to FIGS. 6 to 53 was obtained using the four color filters described with reference to FIG. 3 or the six color filters illustrated in FIG. G + E intensity estimation means 282, G + E intensity estimation means 401, or G + E intensity estimation means 431 estimates the G + E intensity for the mosaic image, and an RGBE four-color image is obtained based on this. It was. On the other hand, when a color filter in which a certain color is arranged in a checkered pattern is used, the luminance value of the pixel of interest is estimated using information on the color arranged in a checkered pattern instead of the G + E intensity. And based on this, you may make it obtain the image of four colors of RGBE.

G+E強度に代わって、注目画素の輝度値を推定する場合、図5を用いて説明したDSPブロック216のデモザイク処理部253に代わって、図54に示されるデモザイク処理部601が用いられる。   When estimating the luminance value of the pixel of interest instead of the G + E intensity, the demosaic processing unit 601 shown in FIG. 54 is used instead of the demosaic processing unit 253 of the DSP block 216 described with reference to FIG.

図54のデモザイク処理部601は、G+E強度推定手段282に代わって、輝度推定処理部611が備えられ、R強度推定部283−1乃至E強度推定部283−4に代わって、R強度推定部612−1乃至E強度推定部612−4が備えられている以外は、図6を用いて説明したデモザイク処理部253と同様の構成を有するものである。   54 includes a luminance estimation processing unit 611 instead of the G + E intensity estimation unit 282, and an R intensity estimation unit instead of the R intensity estimation units 283-1 to 283-4. It has the same configuration as the demosaic processing unit 253 described with reference to FIG. 6 except that 612-1 to E intensity estimation unit 612-4 are provided.

図54のデモザイク処理部601は、図1に示されるベイヤー配列のみならず、例えば、図55に示されるように、図1に示されるベイヤー配列のBの半分をEに置き換え、Eの配置が、縦方向、横方向とも、1列おきに配置されるようになされている4色のカラーフィルタが用いられている場合に、好適なデモザイク処理を行うことができる。   The demosaic processing unit 601 in FIG. 54 replaces not only the Bayer array shown in FIG. 1 but also, for example, as shown in FIG. 55, half of the Bayer array B shown in FIG. In the case where four color filters arranged in every other row are used in both the vertical and horizontal directions, a suitable demosaic process can be performed.

輝度推定処理部611は、局所領域抽出部281が抽出した、n×n(例えば9×9など)の局所領域の画素の矩形領域の画素を用いて、注目画素位置の輝度推定値を算出する処理を行う。   The luminance estimation processing unit 611 calculates the luminance estimation value of the target pixel position using the pixels in the rectangular region of the n × n (for example, 9 × 9) local region pixels extracted by the local region extraction unit 281. Process.

R強度推定部612−1乃至E強度推定部612−4は、輝度推定処理部611が算出した輝度の推定値と、局所領域抽出部281が抽出した矩形領域の画素を用いて、RGBEのそれぞれの強度の推定値を演算する。R強度推定部612−1、G強度推定部612−2、B強度推定部612−3、および、E強度推定部612−4は、基本的に同様の構成を有しているので、以下、R強度推定部612−1、G強度推定部612−2、B強度推定部612−3、および、E強度推定部612−4を個別に区別する必要のない場合、R(G,B,またはE)強度推定部612と称するか、または、R強度推定部612−1、G強度推定部612−2、B強度推定部612−3、および、E強度推定部612−4の全てを、RGBE強度推定部612と称するものとする。   The R intensity estimation units 612-1 through E intensity estimation units 612-4 use the estimated luminance values calculated by the luminance estimation processing unit 611 and the pixels of the rectangular area extracted by the local area extraction unit 281 respectively. Calculate the estimated value of the intensity. The R intensity estimating unit 612-1, the G intensity estimating unit 612-2, the B intensity estimating unit 612-3, and the E intensity estimating unit 612-4 basically have the same configuration. When it is not necessary to individually distinguish the R intensity estimating unit 612-1, the G intensity estimating unit 612-2, the B intensity estimating unit 612-3, and the E intensity estimating unit 612-4, R (G, B, or E) Intensity estimation unit 612, or R intensity estimation unit 612-1, G intensity estimation unit 612-2, B intensity estimation unit 612-3, and E intensity estimation unit 612-4 are all RGBE It is assumed to be called an intensity estimation unit 612.

図56は、輝度推定処理部611の構成を示すブロック図である。   FIG. 56 is a block diagram showing a configuration of the luminance estimation processing unit 611.

輝度推定処理部611は、注目画素選択部301、テクスチャ方向判定部305、第1の強度推定部621、第2の強度推定部622、スイッチ623、および、スイッチ624で構成されている。注目画素選択部301およびテクスチャ方向判定部305は、それぞれ、図8を用いて説明した場合度同様の機能を有するものである。第1の強度推定部621および第2の強度推定部622は、局所領域の画素と注目画素位置にある色の強度推定値に基づいて、推定すべき色の強度を算出するものである。ここで推定すべき色とは、図55を用いて説明したカラーフィルタにおいて市松状に配置されているGである。輝度推定処理部611は、Gが市松状に存在することを利用し、G強度を輝度成分として算出する。すなわち、輝度推定処理部611が実行する輝度推定処理は、G強度を推定するものであるが、デモザイク手段の出力結果としてのG強度は、これとは別に算出されるので、それとは区別して、輝度推定処理部611が推定するG強度を輝度と称するものとする。第1の強度推定部621は、注目画素の左右の画素の画素値を用いて輝度を算出し、第2の強度推定部622は、注目画素の上下の画素の画素値を用いて輝度を算出する。   The luminance estimation processing unit 611 includes a target pixel selection unit 301, a texture direction determination unit 305, a first intensity estimation unit 621, a second intensity estimation unit 622, a switch 623, and a switch 624. The pixel-of-interest selection unit 301 and the texture direction determination unit 305 have the same functions as described with reference to FIG. The first intensity estimator 621 and the second intensity estimator 622 calculate the intensity of the color to be estimated based on the intensity estimation value of the color at the local region pixel and the target pixel position. The color to be estimated here is G arranged in a checkered pattern in the color filter described with reference to FIG. The luminance estimation processing unit 611 uses the fact that G exists in a checkered pattern, and calculates the G intensity as a luminance component. In other words, the luminance estimation process executed by the luminance estimation processing unit 611 estimates the G intensity, but the G intensity as the output result of the demosaic means is calculated separately from this, so that it is distinguished from it. The G intensity estimated by the luminance estimation processing unit 611 is referred to as luminance. The first intensity estimating unit 621 calculates the luminance using the pixel values of the left and right pixels of the target pixel, and the second intensity estimating unit 622 calculates the luminance using the pixel values of the pixels above and below the target pixel. To do.

スイッチ623は、テクスチャ方向判定部305が出力するテクスチャ方向の判定結果に基づき、入力された2つの強度推定値のどちらを使用するべきかを選択する。もしテクスチャの方向がより横縞に近いと判定された場合、第1の強度推定部621により算出された強度推定値が、スイッチ623から出力され、縦縞に近いと判定された場合、第2の強度推定部622により算出された強度推定値が、スイッチ623から出力されるようになされている。スイッチ624は、本来のモザイク画像において注目画素位置の色が何色であるかに基づき、入力された2つの強度推定値のどちらを使用するべきかを選択する。モザイク画像の注目画素位置がGそのものであれば、特別な推定処理の必要なくそのままモザイク画像の注目画素の強度を出力すればよいので、注目画素選択部301の出力が、スイッチ624の出力となるように、モザイク画像の注目画素位置がGではない場合は、スイッチ623の出力がスイッチ624の出力になるように、スイッチ624からの出力信号が選択される。   The switch 623 selects which of the two input intensity estimation values should be used based on the texture direction determination result output by the texture direction determination unit 305. If it is determined that the texture direction is closer to horizontal stripes, the intensity estimation value calculated by the first intensity estimation unit 621 is output from the switch 623, and if it is determined that the texture direction is closer to vertical stripes, the second intensity is calculated. The intensity estimated value calculated by the estimation unit 622 is output from the switch 623. The switch 624 selects which of the two input intensity estimation values should be used based on the color of the target pixel position in the original mosaic image. If the target pixel position of the mosaic image is G itself, the intensity of the target pixel of the mosaic image may be output as it is without the need for special estimation processing, so the output of the target pixel selection unit 301 becomes the output of the switch 624. As described above, when the target pixel position of the mosaic image is not G, the output signal from the switch 624 is selected so that the output of the switch 623 becomes the output of the switch 624.

図57は、図5の第1の強度推定部621または第2の強度推定部622の構成を示すブロック図である。粗補間処理部631は、モザイク画像を基に、第1の色と第2の色とのラフな補間値を求める処理を実行する。粗補間処理部631の詳細な処理については、図64および図65のフローチャートを参照して後述する。統計量算出部342、および、回帰演算処理部343は、図10を用いて説明した場合と同様の機能を有するものである。   FIG. 57 is a block diagram showing a configuration of the first intensity estimating unit 621 or the second intensity estimating unit 622 of FIG. The rough interpolation processing unit 631 executes processing for obtaining rough interpolation values between the first color and the second color based on the mosaic image. Detailed processing of the coarse interpolation processing unit 631 will be described later with reference to the flowcharts of FIGS. 64 and 65. The statistic calculation unit 342 and the regression calculation processing unit 343 have the same functions as those described with reference to FIG.

第1の強度推定部621と第2の強度推定部622との差異は、粗補間処理部631が実行する粗補間処理における第1の色と第2の色との選択の方法である。それらの違いについて、図58および図59を用いて説明する。図58および図59においては、注目画素がRである場合について説明するが、注目画素がBやEである場合も同様である。   The difference between the first intensity estimator 621 and the second intensity estimator 622 is a method for selecting the first color and the second color in the coarse interpolation process executed by the coarse interpolation processor 631. These differences will be described with reference to FIGS. 58 and 59, the case where the target pixel is R will be described, but the same applies to the case where the target pixel is B or E.

第1の強度推定部621は、図58に示されるように、第1の色Crとして注目画素位置にある色(図58においてはR)、第2の色CeとしてCrの左右に隣接する色、すなわちGを選択する。図中、ハッチがかけられている部分の画素であるRとGの画素が、第1の強度推定部621の粗補間処理部631で使用される画素である。一方、第2の強度推定部622は、図59に示されるように、第1の色Crとして注目画素位置にある色(図58においてはR)、第2の色CeとしてCrの上下に隣接する色、すなわちGを選択する。図中、ハッチがかけられている部分の画素であるRとGの画素が、第2の強度推定部622の粗補間処理部631で使用される画素である。   As shown in FIG. 58, the first intensity estimating unit 621 uses a color at the target pixel position as the first color Cr (R in FIG. 58), and a color adjacent to the left and right of Cr as the second color Ce. That is, G is selected. In the drawing, hatched portions of R and G pixels are pixels used in the coarse interpolation processing unit 631 of the first intensity estimation unit 621. On the other hand, as shown in FIG. 59, the second intensity estimation unit 622 is adjacent to the color at the target pixel position as the first color Cr (R in FIG. 58) and above and below Cr as the second color Ce. Color to be used, that is, G is selected. In the drawing, hatched portions of R and G pixels are pixels used in the coarse interpolation processing unit 631 of the second intensity estimating unit 622.

また、統計量算出部342において実行される平均値、分散値、共分散値の算出は、上述した場合と同様であり、例えば、その重み付け係数としては、図60に示されるように、注目画素位置において最も重み付け係数が高く、注目画素位置から遠くになるにしたがって、重み付け係数が小さくなるように定められているものが用いられる。   The calculation of the average value, variance value, and covariance value executed in the statistic calculation unit 342 is the same as that described above. For example, as the weighting coefficient, as shown in FIG. A position where the weighting coefficient is the highest at the position and the weighting coefficient becomes smaller as the distance from the target pixel position is increased is used.

図61は、図54のR強度推定部612−1乃至E強度推定部612−4の構成を示すブロック図である。図60においては、信頼度算出部471および粗補間処理部641をそれぞれ1つずつ図示し、RGBE強度推定部612として図示しているが、R強度推定部612−1乃至E強度推定部612−4のそれぞれに、信頼度算出部471および粗補間処理部641を設けるようにしてもよいことは言うまでもない。なお、図17を用いて説明したRGBE強度推定部283と対応する部分には同一の符号を付してある。すなわち、図60のRGBE強度推定部612は、合成処理部473が省略され、粗補間処理部472に代わって粗補間処理部641が設けられている以外は、図17のRGBE強度推定部283と基本的に同様の構成を有するものである。   61 is a block diagram showing a configuration of the R intensity estimating unit 612-1 to E intensity estimating unit 612-4 of FIG. In FIG. 60, each of the reliability calculation unit 471 and the rough interpolation processing unit 641 is illustrated as an RGBE intensity estimation unit 612, but the R intensity estimation unit 612-1 through the E intensity estimation unit 612 are illustrated. Needless to say, the reliability calculation unit 471 and the coarse interpolation processing unit 641 may be provided in each of the four. In addition, the same code | symbol is attached | subjected to the part corresponding to the RGBE intensity estimation part 283 demonstrated using FIG. That is, the RGBE intensity estimation unit 612 in FIG. 60 is the same as the RGBE intensity estimation unit 283 in FIG. 17 except that the synthesis processing unit 473 is omitted and a coarse interpolation processing unit 641 is provided instead of the coarse interpolation processing unit 472. It has basically the same configuration.

粗補間処理部641は、n×n画素の局所領域内にある画素を用いて、同一位置における異なる2つの色(第1の色をCr、第2の色をCeとする)のラフな補間値の組を複数個生成する。粗補間処理部641が実行する処理の詳細は、図67のフローチャートを用いて後述する。   The rough interpolation processing unit 641 uses pixels in an n × n pixel local region and performs rough interpolation of two different colors (first color is Cr and second color is Ce) at the same position. Generate multiple value pairs. Details of the processing executed by the coarse interpolation processing unit 641 will be described later with reference to the flowchart of FIG.

次に、図62のフローチャートを参照して、図23のステップS4において、図54のデモザイク処理部601が実行するデモザイク処理2について説明する。   Next, the demosaic process 2 executed by the demosaic processing unit 601 in FIG. 54 in step S4 in FIG. 23 will be described with reference to the flowchart in FIG.

局所領域抽出部281は、ステップS451において、未処理の画素のうちのいずれかを注目画素とし、ステップS452において、注目画素位置の周辺の所定数(n×n)の画素を、局所領域として抽出し、輝度推定処理部611、および、R(G,B,またはE)強度推定部612に供給する。   In step S451, the local region extraction unit 281 selects one of the unprocessed pixels as a target pixel, and in step S452, extracts a predetermined number (n × n) of pixels around the target pixel position as a local region. And supplied to the luminance estimation processing unit 611 and the R (G, B, or E) intensity estimation unit 612.

ステップS453において、図62のフローチャートを用いて後述する輝度推定処理が実行される。   In step S453, luminance estimation processing described later is executed using the flowchart of FIG.

ステップS454において、図63のフローチャートを用いて後述する、色強度推定処理が、図61のR(G,B,またはE)強度推定部612のそれぞれにおいて並行して実行される。   In step S454, a color intensity estimation process, which will be described later using the flowchart of FIG. 63, is executed in parallel in each of the R (G, B, or E) intensity estimation units 612 of FIG.

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

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

このような処理により、CCDイメージセンサ213が有するカラーフィルタの配列に基づいて得られるモザイク画像をデモザイク(色補間、または、同時化)して、各画素において、カラーフィルタを構成する各色が補間された画像データを得ることができる。   By such processing, the mosaic image obtained based on the color filter array of the CCD image sensor 213 is demosaiced (color interpolation or synchronization), and each color constituting the color filter is interpolated in each pixel. Image data can be obtained.

次に、図63のフローチャートを参照して、図61のステップS453において実行される輝度推定処理について説明する。   Next, the luminance estimation process executed in step S453 in FIG. 61 will be described with reference to the flowchart in FIG.

なお、図56を用いて説明した処理では、注目画素の色がGであるか否か、および、テクスチャの方向に基づいて、3つの推定値を予め求め、スイッチ623及ぶスイッチ624により、注目画素の色とテクスチャ方向に対応する輝度値の推定値を算出するものとして説明したが、ソフトウェアにより同様の処理が実行される場合は、注目画素の色がGであるか否か、および、テクスチャの方向を検出してから、適した強度推定値の算出方法を用いるようにしたほうが好適である。   In the processing described with reference to FIG. 56, three estimated values are obtained in advance based on whether the color of the pixel of interest is G and the texture direction, and the pixel of interest is obtained by the switch 623 and the switch 624. However, if the same processing is executed by software, whether or not the color of the pixel of interest is G, and the texture It is preferable to use a suitable intensity estimation value calculation method after detecting the direction.

ステップS471において、スイッチ624は、注目画素の色がGであるか否かを判断する。   In step S471, the switch 624 determines whether or not the color of the target pixel is G.

ステップS471において、注目画素の色がGであると判断された場合、ステップS472において、スイッチ624は、衆目画素選択部301によって選択された注目画素位置の画素強度を出力して、処理は、図62のステップS454に進む。   When it is determined in step S471 that the color of the target pixel is G, in step S472, the switch 624 outputs the pixel intensity at the target pixel position selected by the crowd pixel selection unit 301. The process advances to step S454 of 62.

ステップS471において、注目画素の色がGではないと判断された場合、ステップS473において、スイッチ623は、局所領域のテクスチャ方向は、横縞に近いか否かを判断する。   If it is determined in step S471 that the color of the target pixel is not G, in step S473, the switch 623 determines whether the texture direction of the local region is close to a horizontal stripe.

ステップS473において、局所領域のテクスチャ方向は、横縞に近いと判断された場合、ステップS474において、スイッチ623は、第1の強度推定部621により補間すべき強度推定値を算出し、出力して、処理は、図62のステップS454に進む。   When it is determined in step S473 that the texture direction of the local region is close to a horizontal stripe, in step S474, the switch 623 calculates and outputs an intensity estimation value to be interpolated by the first intensity estimation unit 621. The processing proceeds to step S454 in FIG.

ステップS473において、局所領域のテクスチャ方向は、横縞に近くない、すなわち、縦縞に近いと判断された場合、ステップS475において、スイッチ623は、第2の強度推定部622により補間すべき強度推定値を算出し、出力して、処理は、図62のステップS454に進む。   If it is determined in step S473 that the texture direction of the local region is not close to horizontal stripes, that is, close to vertical stripes, in step S475, the switch 623 determines the intensity estimation value to be interpolated by the second intensity estimation unit 622. After calculating and outputting, the process proceeds to step S454 in FIG.

このような処理により、注目画素の色がGであるか否か、および、テクスチャの方向に対応した輝度値の推定値が算出されて出力される。   Through such processing, an estimated value of the luminance value corresponding to whether or not the color of the pixel of interest is G and the texture direction is calculated and output.

次に、図64のフローチャートを参照して、図57の第1の強度推定部621の粗補間処理部631が実行する粗補間処理3について説明する。   Next, the rough interpolation process 3 executed by the rough interpolation processing unit 631 of the first intensity estimating unit 621 of FIG. 57 will be described with reference to the flowchart of FIG.

粗補間処理部631は、ステップS481において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値sを初期化して、s=2とし、ステップS482において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値tを初期化して、t=2とする。   In step S481, the coarse interpolation processing unit 631 initializes the value s of the first register indicating the pixel position where the processing is performed, out of the pixels in the supplied local region, and sets s = 2, and in step S482, Among the supplied local area pixels, the value t of the second register indicating the pixel position where the process is executed is initialized to t = 2.

ステップS483において、粗補間処理部631は、画素(s、t)は、注目画素と同一の色であるか否かを判断する。ステップS483において、画素(s、t)は、注目画素と同一の色ではないと判断された場合、処理は、ステップS486に進む。   In step S483, the rough interpolation processing unit 631 determines whether or not the pixel (s, t) has the same color as the target pixel. If it is determined in step S483 that the pixel (s, t) is not the same color as the target pixel, the process proceeds to step S486.

ステップS483において、画素(s、t)は、注目画素と同一の色であると判断された場合、ステップS484において、粗補間処理部631は、第1の色である画素(s、t)と、画素(s、t)の左側に位置する第2の色である画素の強度の組を作成する。   If it is determined in step S483 that the pixel (s, t) has the same color as the target pixel, in step S484, the coarse interpolation processing unit 631 determines that the pixel (s, t) is the first color. , A set of pixel intensities of the second color located on the left side of the pixel (s, t) is created.

ステップS485において、粗補間処理部631は、第1の色である画素(s、t)と、画素(s、t)の右側に位置する第2の色である画素の強度の組を作成する。   In step S485, the rough interpolation processing unit 631 creates a set of intensity of the pixel (s, t) that is the first color and the pixel that is the second color that is located to the right of the pixel (s, t). .

ステップS486において、粗補間処理部631は、第2のレジスタの値tを参照し、t=n−1であるか否かを判断する。   In step S486, the rough interpolation processing unit 631 refers to the value t of the second register and determines whether t = n−1.

ステップS486において、t=n−1ではないと判断された場合、ステップS487において、粗補間処理部631は、第2のレジスタの値tをt=t+1とし、処理は、ステップS483に戻り、それ以降の処理が繰り返される。   If it is determined in step S486 that t = n−1 is not satisfied, in step S487, the coarse interpolation processing unit 631 sets the value t of the second register to t = t + 1, and the process returns to step S483. The subsequent processing is repeated.

ステップS486において、t=n−1であると判断された場合、ステップS488において、粗補間処理部631は、第1のレジスタの値sを参照し、s=n−1であるか否かを判断する。   If it is determined in step S486 that t = n−1, in step S488, the coarse interpolation processing unit 631 refers to the value s of the first register and determines whether s = n−1. to decide.

ステップS488において、s=n−1ではないと判断された場合、ステップS489において、粗補間処理部631は、第1のレジスタの値sをs=s+1とし、処理は、ステップS482に戻り、それ以降の処理が繰り返される。   If it is determined in step S488 that s = n−1 is not satisfied, in step S489, the coarse interpolation processing unit 631 sets the value s of the first register to s = s + 1, and the process returns to step S482, The subsequent processing is repeated.

ステップS488において、s=n−1ではあると判断された場合、ステップS490において、粗補間処理部631は、第1の色および第2の色の組を出力して処理が終了される。   When it is determined in step S488 that s = n−1, in step S490, the coarse interpolation processing unit 631 outputs the first color and the second color set, and the process is ended.

このような処理により、横方向のテクスチャにおいて信頼度の高い輝度推定値が算出される。   By such processing, a luminance estimation value with high reliability is calculated for the texture in the horizontal direction.

次に、図65のフローチャートを参照して、図57の第2の強度推定部622の粗補間処理部631が実行する粗補間処理4について説明する。   Next, the rough interpolation process 4 executed by the coarse interpolation processing unit 631 of the second intensity estimating unit 622 in FIG. 57 will be described with reference to the flowchart in FIG.

粗補間処理部631は、ステップS491において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第1のレジスタの値sを初期化して、s=2とし、ステップS492において、供給された局所領域の画素のうち、処理を実行する画素位置を示す第2のレジスタの値tを初期化して、t=2とする。   In step S491, the coarse interpolation processing unit 631 initializes the value s of the first register indicating the pixel position where the processing is performed, out of the pixels in the supplied local region, and sets s = 2, and in step S492, Among the supplied local area pixels, the value t of the second register indicating the pixel position where the process is executed is initialized to t = 2.

ステップS493において、粗補間処理部631は、画素(s、t)は、注目画素と同一の色であるか否かを判断する。ステップS493において、画素(s、t)は、注目画素と同一の色ではないと判断された場合、処理は、ステップS496に進む。   In step S493, the coarse interpolation processing unit 631 determines whether or not the pixel (s, t) has the same color as the target pixel. If it is determined in step S493 that the pixel (s, t) is not the same color as the target pixel, the process proceeds to step S496.

ステップS493において、画素(s、t)は、注目画素と同一の色であると判断された場合、ステップS494において、粗補間処理部631は、第1の色である画素(s、t)と、画素(s、t)の上側に位置する第2の色である画素の強度の組を作成する。   If it is determined in step S493 that the pixel (s, t) has the same color as the target pixel, in step S494, the coarse interpolation processing unit 631 determines that the pixel (s, t) is the first color. , A set of pixel intensities that are the second color located above the pixel (s, t) is created.

ステップS495において、粗補間処理部631は、第1の色である画素(s、t)と、画素(s、t)の下側に位置する第2の色である画素の強度の組を作成する。   In step S495, the coarse interpolation processing unit 631 creates a set of intensity of the pixel (s, t) as the first color and the pixel as the second color located below the pixel (s, t). To do.

ステップS496において、粗補間処理部631は、第2のレジスタの値tを参照し、t=n−1であるか否かを判断する。   In step S496, the rough interpolation processing unit 631 refers to the value t of the second register and determines whether t = n−1.

ステップS496において、t=n−1ではないと判断された場合、ステップS497において、粗補間処理部631は、第2のレジスタの値tをt=t+1とし、処理は、ステップS493に戻り、それ以降の処理が繰り返される。   If it is determined in step S496 that t = n−1 is not true, the coarse interpolation processing unit 631 sets the value t of the second register to t = t + 1 in step S497, and the process returns to step S493, The subsequent processing is repeated.

ステップS496において、t=n−1であると判断された場合、ステップS498において、粗補間処理部631は、第1のレジスタの値sを参照し、s=n−1であるか否かを判断する。   If it is determined in step S496 that t = n−1, in step S498, the coarse interpolation processing unit 631 refers to the value s of the first register and determines whether s = n−1. to decide.

ステップS498において、s=n−1ではないと判断された場合、ステップS499において、粗補間処理部631は、第1のレジスタの値sをs=s+1とし、処理は、ステップS492に戻り、それ以降の処理が繰り返される。   When it is determined in step S498 that s = n−1 is not satisfied, in step S499, the coarse interpolation processing unit 631 sets the value s of the first register to s = s + 1, and the process returns to step S492. The subsequent processing is repeated.

ステップS498において、s=n−1ではあると判断された場合、ステップS490において、粗補間処理部631は、第1の色および第2の色の組を出力して処理が終了される。   If it is determined in step S498 that s = n−1, in step S490, the coarse interpolation processing unit 631 outputs the first color and the second color set, and the process is terminated.

このような処理により、縦方向のテクスチャにおいて信頼度の高い輝度推定値が算出される。   With such processing, a highly reliable luminance estimated value is calculated for the texture in the vertical direction.

次に、図66のフローチャートを参照して、図60を用いて説明したRGBE強度推定部283が図61のステップS454において実行する色強度推定処理2について説明する。   Next, the color intensity estimation process 2 executed by the RGBE intensity estimation unit 283 described with reference to FIG. 60 in step S454 of FIG. 61 will be described with reference to the flowchart of FIG.

ステップS501において、粗補間処理部472は、図67を用いて後述する粗補間処理5を実行する。   In step S501, the coarse interpolation processing unit 472 executes coarse interpolation processing 5 described later with reference to FIG.

ステップS502において、信頼度算出部471は、輝度推定処理部611において算出された輝度の推定値を取得する。   In step S <b> 502, the reliability calculation unit 471 acquires the estimated luminance value calculated by the luminance estimation processing unit 611.

ステップS503において、信頼度算出部471は、図51のフローチャートを用いて説明した信頼度算出処理を実行する。   In step S503, the reliability calculation unit 471 executes the reliability calculation process described with reference to the flowchart of FIG.

ステップS504において、統計量算出部432−1乃至432−4は、図28を用いて説明した2色分布形状の統計量算出処理を実行する。   In step S504, the statistic calculation units 432-1 to 432-4 execute the two-color distribution shape statistic calculation process described with reference to FIG.

ステップS505において、回帰演算処理部474−1乃至474−4は、図52を用いて説明した補間画素推定処理2を実行し、処理は、図61のステップS455に進む。   In step S505, the regression calculation processing units 474-1 to 474-4 execute the interpolation pixel estimation processing 2 described with reference to FIG. 52, and the processing proceeds to step S455 in FIG.

次に、図67のフローチャートを参照して、図61の粗補間処理部641が図66のステップS511において実行する粗補間処理5について説明する。   Next, with reference to the flowchart of FIG. 67, the rough interpolation process 5 which the rough interpolation process part 641 of FIG. 61 performs in step S511 of FIG. 66 is demonstrated.

ステップS531において、粗補間処理部641は、供給された局所領域のうちの注目画素を中心とした(n−2)×(n−2)の領域のうち、所定の画素位置の画素の色がGであるか否かを判断する。   In step S531, the rough interpolation processing unit 641 determines that the color of the pixel at the predetermined pixel position in the (n−2) × (n−2) area centered on the target pixel in the supplied local area. Whether or not it is G is determined.

ステップS531において、所定の画素位置の画素の色がGであると判断された場合、ステップS532において、粗補間処理部641は、注目画素の強度Ceと注目画素の強度Ceとの組(Ce,Ce)を作る。   When it is determined in step S531 that the color of the pixel at the predetermined pixel position is G, in step S532, the coarse interpolation processing unit 641 sets the set of the intensity Ce of the target pixel and the intensity Ce of the target pixel (Ce, Make Ce).

ステップS533において、粗補間処理部641は、(Ce,Ce)を、LgとGの組として追加して、処理は、図62のステップS455に進む。   In step S533, the coarse interpolation processing unit 641 adds (Ce, Ce) as a set of Lg and G, and the process proceeds to step S455 of FIG.

ステップS531において、所定の画素位置の画素の色がGではないと判断された場合、ステップS534において、粗補間処理部641は、所定の画素の4近傍、すなわち、その画素の上下左右の画素からG強度の値を2つ抽出する。   If it is determined in step S531 that the color of the pixel at the predetermined pixel position is not G, in step S534, the coarse interpolation processing unit 641 determines the vicinity of the predetermined pixel, that is, the upper, lower, left, and right pixels of the pixel. Two G intensity values are extracted.

ステップS535において、粗補間処理部641は、抽出したG強度をL1およびL2
とし、所定の画素の強度Ceとの組(L1,Ce)および(L2,Ce)を作る。
In step S535, the coarse interpolation processing unit 641 converts the extracted G intensity to L1 and L2.
And sets (L1, Ce) and (L2, Ce) with the intensity Ce of a predetermined pixel.

ステップS536において、粗補間処理部641は、所定の画素の色がRであるか否か
を判断する。
In step S536, the coarse interpolation processing unit 641 determines whether or not the color of the predetermined pixel is R.

ステップS536において、所定の画素の色がRであると判断された場合、ステップS537において、粗補間処理部641は、(L1,Ce)および(L2,Ce)を、LrとRの組として追加し、処理は、図62のステップS455に進む。   If it is determined in step S536 that the color of the predetermined pixel is R, in step S537, the coarse interpolation processing unit 641 adds (L1, Ce) and (L2, Ce) as a pair of Lr and R. Then, the process proceeds to step S455 in FIG.

ステップS536において、所定の画素の色がRではないと判断された場合、ステップS538において、粗補間処理部641は、所定の画素の色がBであるか否かを判断する。   If it is determined in step S536 that the color of the predetermined pixel is not R, the coarse interpolation processing unit 641 determines whether or not the color of the predetermined pixel is B in step S538.

ステップS538において、所定の画素の色がBであると判断された場合、ステップS539において、粗補間処理部641は、(L1,Ce)および(L2,Ce)を、LbとBの組として追加し、処理は、図62のステップS455に進む。   If it is determined in step S538 that the color of the predetermined pixel is B, in step S539, the coarse interpolation processing unit 641 adds (L1, Ce) and (L2, Ce) as a pair of Lb and B. Then, the process proceeds to step S455 in FIG.

ステップS538において、所定の画素の色がBではない、すなわち、Eであると判断された場合、ステップS540において、粗補間処理部641は、(L1,Ce)および(L2,Ce)を、LeとEの組として追加し、処理は、図62のステップS455に進む。   If it is determined in step S538 that the color of the predetermined pixel is not B, that is, E, in step S540, the coarse interpolation processing unit 641 changes (L1, Ce) and (L2, Ce) to Le. And the process proceeds to step S455 in FIG.

粗補間処理部641は、このような処理によりラフな補間値の組を、局所領域のうちの注目画素を中心とした(n−2)×(n−2)の領域において全て算出し、(n−2)×(n−2)の領域において算出されたすべてのラフな補間値の組を、統計量算出部342−1乃至341−4に出力する。   The coarse interpolation processing unit 641 calculates a rough set of interpolation values in the (n−2) × (n−2) region centered on the target pixel in the local region by such processing, A set of all rough interpolation values calculated in the (n-2) × (n-2) region is output to the statistic calculation units 342-1 to 341-4.

図67の処理においては、ステップS534において、粗補間処理部641は、所定の画素の4近傍、すなわち、その画素の上下左右の画素からG強度の値を2つ抽出するようになされているが、2つのG強度を選択する方法としては、異なる方法を用いるようにしてもよい、例えば、具体的には、上下のG強度と左右のG強度のそれぞれで差分値を算出し、上下かもしくは左右の2つのうち差分値が小さいほうを選択する。このようにすることによって、所定の画素の画素位置が、物体輪郭上など色変化が大きいところにあるときに、なるべく変化が小さい方向のGを選択することができる。また、同様にして、なるべく色変化が小さい方向を選択するための第2の方法として、上下左右のG強度のうち最大値、最小値を除いた2つを選択する方法もある。第3の方法としては、輝度推定処理部51中のテクスチャ方向判定部305によるテクスチャ方向の判定結果を流用し、横縞ならば左右のG強度、縦縞ならば上下のG強度を選択するようにしてもよい。また、所定の画素位置として、局所領域全てのn×nの画素を選択するようにした場合、画素位置が局所領域の角であるときには、隣接するGは2つしかないのでそれを選択するようにすればよい。   In the process of FIG. 67, in step S534, the coarse interpolation processing unit 641 extracts two G intensity values from four neighborhoods of a predetermined pixel, that is, from the upper, lower, left, and right pixels of the pixel. Different methods may be used as the method for selecting the two G intensities. For example, specifically, the difference value is calculated for each of the upper and lower G intensities and the left and right G intensities. The one with the smaller difference value is selected from the left and right. In this way, when the pixel position of the predetermined pixel is at a place where the color change is large, such as on the object outline, it is possible to select G in the direction where the change is as small as possible. Similarly, as a second method for selecting a direction in which the color change is as small as possible, there is also a method of selecting two of the upper, lower, left, and right G intensities excluding the maximum value and the minimum value. As a third method, the texture direction determination result by the texture direction determination unit 305 in the luminance estimation processing unit 51 is diverted to select the left and right G intensity for horizontal stripes and the upper and lower G intensity for vertical stripes. Also good. In addition, when n × n pixels in the entire local area are selected as the predetermined pixel position, when the pixel position is a corner of the local area, there are only two adjacent G, so that it is selected. You can do it.

また、図54のデモザイク処理部601は、図1に示されるベイヤー配列や図55に示される原色4色のカラーフィルタの配列のみならず、例えば、図68に示されるような、5色のカラーフィルタが用いられている場合にも、好適なデモザイク処理を行うことができる。この5色配列は、3色のベイヤー配列のRおよびBの画素位置の半分をそれぞれ若干分光特性が異なるものに置換した配列となっている(換言すれば、R1とR2,B1とB2の分光特性は、高い相関を有している)。この5色配列において、Gの配列は図55の4色配列と同じであるので、図54のデモザイク処理部601によるGを用いた輝度成分の算出方法を、そのまま適用することができる。   Also, the demosaic processing unit 601 in FIG. 54 is not limited to the Bayer arrangement shown in FIG. 1 or the arrangement of the four primary color filters shown in FIG. Even when a filter is used, suitable demosaic processing can be performed. This five-color array is an array in which half of the R and B pixel positions of the three-color Bayer array are replaced with ones having slightly different spectral characteristics (in other words, the spectrum of R1 and R2, B1 and B2). The characteristics are highly correlated). In this five-color array, the G array is the same as the four-color array in FIG. 55, and thus the luminance component calculation method using G by the demosaic processing unit 601 in FIG. 54 can be applied as it is.

なお、図68に示されるカラーフィルタ配列に対して、例えば、3色のベイヤー配列のR画素位置の半分をそれぞれ若干分光特性が異なるものに置換した4色配列や、3色のベイヤー配列のB画素位置の半分をそれぞれ若干分光特性が異なるものに置換した4色配列においても、本発明は適用可能であることはいうまでもない。   68, for example, a four-color array in which half of the R pixel positions of the three-color Bayer array are replaced with ones having slightly different spectral characteristics, or a three-color Bayer array B Needless to say, the present invention can also be applied to a four-color array in which half of the pixel positions are replaced with those having slightly different spectral characteristics.

このように、本発明は、4色以上の色配列に対しても適用され、同様に、ジャギネスの低減および解像度感の向上を可能とする。   As described above, the present invention is also applied to a color arrangement of four or more colors, and similarly, it is possible to reduce jegginess and improve the sense of resolution.

以上では、デジタルスチルカメラ201における画像処理について説明したが、動画像を撮像することが可能なデジタルビデオカメラについても、本発明は適用可能である。デジタルビデオカメラに本発明が適用される場合、コーデック処理部221は、例えば、MPEG(Moving Picture Coding Experts Group/Moving Picture Experts Group)やMotionJPEGなどの、デジタル動画像データの圧縮または伸張アルゴリズムによる処理を実行する。   The image processing in the digital still camera 201 has been described above, but the present invention can also be applied to a digital video camera that can capture a moving image. When the present invention is applied to a digital video camera, the codec processing unit 221 performs processing using a compression or expansion algorithm of digital moving image data such as MPEG (Moving Picture Coding Experts Group / Moving Picture Experts Group) or MotionJPEG. Execute.

上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。   The series of processes described above can be executed by hardware, but can also be executed by software.

この場合、ソフトウェアをDSPブロック216が実行することにより、上述した機能が実現される。また、例えば、デジタルスチルカメラ201の処理の一部は、図69に示されるようなパーソナルコンピュータ701により実行することが可能となる。   In this case, the above-described functions are realized by executing the software by the DSP block 216. Further, for example, part of the processing of the digital still camera 201 can be executed by a personal computer 701 as shown in FIG.

図69において、CPU(Central Processing Unit)711は、ROM(Read Only Memory)712に記憶されているプログラム、または記憶部718からRAM(Random Access Memory)713にロードされたプログラムに従って、各種の処理を実行する。RAM713にはまた、CPU711が各種の処理を実行する上において必要なデータなども適宜記憶される。   69, a CPU (Central Processing Unit) 711 performs various processes according to a program stored in a ROM (Read Only Memory) 712 or a program loaded from a storage unit 718 to a RAM (Random Access Memory) 713. Execute. The RAM 713 also appropriately stores data necessary for the CPU 711 to execute various processes.

CPU711、ROM712、およびRAM713は、バス714を介して相互に接続されている。このバス714にはまた、入出力インタフェース715も接続されている。   The CPU 711, the ROM 712, and the RAM 713 are connected to each other via the bus 714. An input / output interface 715 is also connected to the bus 714.

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

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

一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェア(例えば、DSPブロック216や、その中に含まれている、デモザイク処理部253またはデモザイク処理部601)に組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行することが可能な、例えば汎用のパーソナルコンピュータなどに、ネットワークや記録媒体からインストールされる。   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 demosaic processing unit 601 included therein). For example, a general-purpose personal computer or the like capable of executing various functions by installing various programs installed therein is installed from a network or a recording medium.

この記録媒体は、図69に示されるように、装置本体とは別に、ユーザにプログラムを供給するために配布される、プログラムが記憶されている磁気ディスク731(フロッピディスクを含む)、光ディスク732(CD-ROM(Compact Disk-Read Only Memory),DVD(Digital Versatile Disk)を含む)、光磁気ディスク733(MD(Mini-Disk)(商標)を含む)、もしくは半導体メモリ734などよりなるパッケージメディアにより構成されるだけでなく、装置本体に予め組み込まれた状態でユーザに供給される、プログラムが記憶されているROM712や、記憶部718に含まれるハードディスクなどで構成される。   As shown in FIG. 69, this recording medium includes a magnetic disk 731 (including a floppy disk) and an optical disk 732 (including a floppy disk) that are distributed to supply a program to the user separately from the apparatus main body. Package media including CD-ROM (compact disk-read only memory), DVD (including digital versatile disk), magneto-optical disk 733 (including MD (mini-disk) (trademark)), or semiconductor memory 734 In addition to being configured, it is configured by a ROM 712 storing a program and a hard disk included in the storage unit 718 supplied to the user in a state of being incorporated in the apparatus main body in advance.

なお、本明細書において、記録媒体に記憶されるプログラムを記述するステップは、含む順序に沿って時系列的に行われる処理はもちろん、必ずしも時系列的に処理されなくとも、並列的もしくは個別に実行される処理をも含むものである。   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 still camera to which this invention is applied. 図2のCCDイメージセンサに用いられているカラーフィルタについて説明するための図である。It is a figure for demonstrating the color filter used for the CCD image sensor of FIG. 図3のカラーフィルタの分光特性の例を示す図である。It is a figure which shows the example of the spectral characteristic of the color filter of FIG. 図1のDSPブロックの構成を示すブロック図である。It is a block diagram which shows the structure of the DSP block of FIG. 図5のデモザイク処理部の構成を示すブロック図である。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 intensity | strength estimation process part of FIG. 図7のG強度推定部およびE強度推定部の構成を示すブロック図である。It is a block diagram which shows the structure of the G intensity estimation part of FIG. 7, and an E intensity estimation part. 図8のスイッチの処理について説明するための図である。It is a figure for demonstrating the process of the switch of FIG. 図8の第1乃至第4の強度推定部の構成を示すブロック図である。It is a block diagram which shows the structure of the 1st thru | or 4th intensity | strength estimation part of FIG. 図10の粗補間処理部が選択する第1の色および第2の色について説明するための図である。It is a figure for demonstrating the 1st color and 2nd color which the rough interpolation process part of FIG. 10 selects. 図10の粗補間処理部が選択する第1の色および第2の色について説明するための図である。It is a figure for demonstrating the 1st color and 2nd color which the rough interpolation process part of FIG. 10 selects. 図10の粗補間処理部が選択する第1の色および第2の色について説明するための図である。It is a figure for demonstrating the 1st color and 2nd color which the rough interpolation process part of FIG. 10 selects. 図10の粗補間処理部が選択する第1の色および第2の色について説明するための図である。It is a figure for demonstrating the 1st color and 2nd color which the rough interpolation process part of FIG. 10 selects. 図10の統計量算出部の構成を示すブロック図である。It is a block diagram which shows the structure of the statistic calculation part of FIG. 図10の回帰演算処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the regression calculation process part of FIG. 図6のRGBE強度推定部の構成を示すブロック図である。It is a block diagram which shows the structure of the RGBE intensity estimation part of FIG. 図17の信頼度算出部の構成を示すブロック図である。It is a block diagram which shows the structure of the reliability calculation part of FIG. 信頼度算出部における画素強度の抽出位置について説明するための図である。It is a figure for demonstrating the extraction position of the pixel intensity | strength in a reliability calculation part. 信頼度算出部において高周波成分を抽出するための画素強度の組について説明するための図である。It is a figure for demonstrating the group of the pixel intensity | strength for extracting a high frequency component in a reliability calculation part. 図17の粗補間処理部の処理について説明するための図である。It is a figure for demonstrating the process of the rough interpolation process part of FIG. 図17の回帰演算処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the regression calculation process part of FIG. 図5のDSPブロックが実行する画像処理についてについて説明するためのフローチャートである。6 is a flowchart for explaining image processing executed by the DSP block of FIG. 5. デモザイク処理1について説明するためのフローチャートである。10 is a flowchart for explaining demosaic processing 1; G+E強度推定処理について説明するためのフローチャートである。It is a flowchart for demonstrating a G + E intensity estimation process. 注目画素位置のG(E)強度推定値算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating the G (E) intensity | strength estimated value calculation process of an attention pixel position. 粗補間処理1について説明するためのフローチャートである。6 is a flowchart for explaining rough interpolation processing 1; 2色分布形状の統計量算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating the statistic amount calculation process of 2 color distribution shape. 平均値計算処理1について説明するためのフローチャートである。6 is a flowchart for explaining an average value calculation process 1; 平均値計算処理2について説明するためのフローチャートである。10 is a flowchart for explaining average value calculation processing 2; 重み付け値について説明するための図である。It is a figure for demonstrating a weighting value. 重み付け値について説明するための図である。It is a figure for demonstrating a weighting value. 重み付け値について説明するための図である。It is a figure for demonstrating a weighting value. 重み付け値について説明するための図である。It is a figure for demonstrating a weighting value. 分散計算処理1について説明するためのフローチャートである。10 is a flowchart for explaining distributed calculation processing 1; 分散計算処理2について説明するためのフローチャートである。10 is a flowchart for explaining distributed calculation processing 2; 共分散計算処理について説明するためのフローチャートである。It is a flowchart for demonstrating a covariance calculation process. 積算処理1について説明するためのフローチャートである。5 is a flowchart for explaining an integration process 1; 積算処理2について説明するためのフローチャートである。5 is a flowchart for explaining an integration process 2; 積算近似処理1について説明するためのフローチャートである。5 is a flowchart for explaining integration approximation processing 1; 積算近似処理2について説明するためのフローチャートである。10 is a flowchart for explaining integration approximation processing 2; 補間画素推定処理1について説明するためのフローチャートである。6 is a flowchart for explaining interpolation pixel estimation processing 1; テクスチャ方向判定処理について説明するためのフローチャートである。It is a flowchart for demonstrating a texture direction determination process. 第2の処理ブロックの処理について説明するためのフローチャートである。It is a flowchart for demonstrating the process of a 2nd process block. 第3の処理ブロックの処理について説明するためのフローチャートである。It is a flowchart for demonstrating the process of a 3rd process block. G+E強度推定処理部の異なる構成を示すブロック図である。It is a block diagram which shows a different structure of a G + E intensity estimation process part. 図46のスイッチの処理について説明するための図である。FIG. 47 is a diagram for explaining processing of the switch of FIG. 46. G+E強度推定処理部の異なる構成を示すブロック図である。It is a block diagram which shows a different structure of a G + E intensity estimation process part. 粗補間処理2について説明するためのフローチャートである。10 is a flowchart for explaining rough interpolation processing 2; 色強度推定処理1について説明するためのフローチャートである。5 is a flowchart for explaining color intensity estimation processing 1; 信頼度算出処理について説明するためのフローチャートである。It is a flowchart for demonstrating reliability calculation processing. 補間画素推定処理2について説明するためのフローチャートである。It is a flowchart for demonstrating the interpolation pixel estimation process 2. FIG. 図2のCCDイメージセンサに用いられているカラーフィルタの異なる例について説明するための図である。It is a figure for demonstrating the example from which the color filter used for the CCD image sensor of FIG. 2 differs. 図5のデモザイク処理部の異なる構成例を示すブロック図である。It is a block diagram which shows the example of a different structure of the demosaic process part of FIG. 図54のデモザイク処理部を用いた場合に図2のCCDイメージセンサに用いられるカラーフィルタの例について説明するための図である。FIG. 55 is a diagram for describing an example of a color filter used in the CCD image sensor in FIG. 2 when the demosaic processing unit in FIG. 54 is used. 図54の輝度推定処理部の構成を示すブロック図である。It is a block diagram which shows the structure of the brightness | luminance estimation process part of FIG. 図54の第1および第2の強度推定部の構成を示すブロック図である。FIG. 57 is a block diagram showing a configuration of first and second intensity estimation units in FIG. 54. 図57の粗補間処理部が選択する第1の色および第2の色について説明するための図である。FIG. 58 is a diagram for describing a first color and a second color selected by the rough interpolation processing unit in FIG. 57. 図57の粗補間処理部が選択する第1の色および第2の色について説明するための図である。FIG. 58 is a diagram for describing a first color and a second color selected by the rough interpolation processing unit in FIG. 57. 重み付け値について説明するための図である。It is a figure for demonstrating a weighting value. 図54のRGBE強度推定部の構成を示すブロック図である。It is a block diagram which shows the structure of the RGBE intensity | strength estimation part of FIG. デモザイク処理2について説明するためのフローチャートである。10 is a flowchart for explaining demosaic processing 2; 輝度推定処理について説明するためのフローチャートである。It is a flowchart for demonstrating a brightness | luminance estimation process. 粗補間処理3について説明するためのフローチャートである。10 is a flowchart for explaining rough interpolation processing 3; 粗補間処理4について説明するためのフローチャートである。10 is a flowchart for explaining coarse interpolation processing 4; 色強度推定処理2について説明するためのフローチャートである。10 is a flowchart for explaining color intensity estimation processing 2; 粗補間処理5について説明するためのフローチャートである。10 is a flowchart for explaining rough interpolation processing 5; 図54のデモザイク処理部を用いた場合に図2のCCDイメージセンサに用いられるカラーフィルタの異なる例について説明するための図である。FIG. 55 is a diagram for describing a different example of a color filter used in the CCD image sensor in FIG. 2 when the demosaic processing unit in FIG. 54 is used. パーソナルコンピュータの構成を示すブロック図である。It is a block diagram which shows the structure of a personal computer.

符号の説明Explanation of symbols

201 デジタルスチルカメラ, 216 DSPブロック, 242 信号処理用プロセッサ, 253 デモザイク処理部, 281 局所領域抽出部, 282 G+E強度推定処理部, 283 RGBE強度推定部, 291 G強度推定部, 292 E強度推定部, 293 加算処理部, 301 注目画素選択部, ,305 テクスチャ強度判定部 306 スイッチ, 311 第1の強度推定部, 321 第2の強度推定部, 322 第3の強度推定部, 323 第4の強度推定部, 324 スイッチ, 341 粗補間処理部, 342 統計量算出部, 343 回帰演算処理部, 361 平均値算出部, 362 分散値算出部, 363 平均値算出部, 364 共分散算出部, 381 傾き算出部, 382 画素強度推定部, 471 信頼度算出部, 472 粗補間処理部, 473 回帰演算処理部, 481 高周波抽出部, 482 加算処理部, 483 クリップ処理部, 501,502 傾き算出部, 503 傾き合成部, 504 画素強度推定部, 551 G+E強度推定処理部, 562 スイッチ, 571 G+E強度推定処理部, 581 スイッチ, 601 デモザイク処理部, 611 輝度推定処理部, 612 RGBE強度推定部, 621 第1の強度推定部, 622 第2の強度推定部, 623 スイッチ, 624 スイッチ, 631 粗補間処理部, 641 粗補間処理部   201 digital still camera, 216 DSP block, 242 signal processing processor, 253 demosaic processing unit, 281 local region extraction unit, 282 G + E intensity estimation processing unit, 283 RGBE intensity estimation unit, 291 G intensity estimation unit, 292 E intensity estimation unit , 293 addition processing unit, 301 target pixel selection unit, 305 texture intensity determination unit 306 switch, 311 first intensity estimation unit, 321 second intensity estimation unit, 322 third intensity estimation unit, 323 fourth intensity Estimator, 324 switch, 341 coarse interpolation processor, 342 statistic calculator, 343 regression calculation processor, 361 average value calculator, 362 variance value calculator, 363 average value calculator, 364 covariance calculator, 381 slope A calculation unit, a 382 pixel intensity estimation unit, 471 reliability calculation unit, 472 rough interpolation processing unit, 473 regression calculation processing unit, 481 high frequency extraction unit, 482 addition processing unit, 483 clip processing unit, 501 502 slope calculation unit, 503 tilt synthesis unit, 504 pixel intensity estimation unit , 551 G + E intensity estimation processing unit, 562 switch, 571 G + E intensity estimation processing unit, 581 switch, 601 demosaic processing unit, 611 luminance estimation processing unit, 612 RGBE intensity estimation unit, 621 first intensity estimation unit, 622 second Strength estimation unit, 623 switch, 624 switch, 631 coarse interpolation processing unit, 641 coarse interpolation processing unit

Claims (32)

画像を撮像して処理する画像処理装置において、
分光感度が異なる少なくとも4種類のフィルタを有し、複数種類の前記フィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する画像取得手段と、
前記画像取得手段により取得された前記モザイク画像から、前記フィルタの前記分光感度により決まる複数の色に対応する前記画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理手段と
を備え、
前記画像取得手段の前記画像センサの色フィルタ配列は、全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性に強い相関を有する分光特性を持つものであり、
前記画像処理手段は、
前記市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの前記強度推定値に基づいて各画素の輝度値を算出する
ことを特徴とする画像処理装置。
In an image processing apparatus that captures and processes an image,
Image acquisition means for acquiring a mosaic image by an image sensor having at least four types of filters having different spectral sensitivities, and any of the plurality of types of filters being used for each pixel;
Image processing means for generating, from the mosaic image acquired by the image acquisition means, a color image in which intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is aligned in all pixels; Prepared,
The color filter array of the image sensor of the image acquisition means has a spectral characteristic in which a filter of pixels arranged in a checkered pattern in half of all pixels has a strong correlation with a spectral characteristic of luminance,
The image processing means includes
An image processing apparatus, wherein an estimated intensity value of a color of pixels arranged in a checkered pattern is calculated for each pixel, and a luminance value of each pixel is calculated based on the estimated intensity value.
前記画像取得手段の前記画像センサの色フィルタ配列は、
複数種類の前記フィルタうちの輝度の分光特性に強い相関を有する分光特性を持つ第1の色に対応する第1のフィルタが、水平および垂直に1ラインおきに配置され、
前記第1の色とは異なる、輝度の分光特性に強い相関を有する分光特性を持つ第2の色に対応する第2のフィルタが、水平および垂直に1ラインおき、かつ、前記第1のフィルタとは異なるラインに配置され、
前記画像処理手段は、
前記モザイク画像のうちの注目画素位置における前記第1の色の強度推定値である第1の強度推定値を算出する第1の算出手段と、
前記注目画素位置における前記第2の色の強度推定値である第2の強度推定値を算出する第2の算出手段と、
前記第1の算出手段により算出された前記第1の強度推定値と、前記第2の算出手段により算出された前記第2の強度推定値とを合成する合成手段と
を備えることを特徴とする請求項1に記載の画像処理装置。
The color filter array of the image sensor of the image acquisition means is
A first filter corresponding to a first color having a spectral characteristic having a strong correlation with a spectral characteristic of luminance among the plurality of types of filters is disposed every other line in the horizontal and vertical directions,
The second filter corresponding to the second color different from the first color and having a spectral characteristic having a strong correlation with the spectral characteristic of luminance is arranged every other line in the horizontal and vertical directions, and the first filter Placed on a different line from
The image processing means includes
First calculating means for calculating a first intensity estimated value that is an intensity estimated value of the first color at a target pixel position in the mosaic image;
Second calculating means for calculating a second intensity estimated value that is an intensity estimated value of the second color at the target pixel position;
And combining means for combining the first intensity estimated value calculated by the first calculating means and the second intensity estimated value calculated by the second calculating means. The image processing apparatus according to claim 1.
前記第1の算出手段は、
前記注目画素位置におけるすでに得られている既知色に対応する強度値と、
前記注目画素近傍の画素より算出される前記既知色と推定したい目標色の間の相関関係と
に基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第3の算出手段
を含み、
前記注目画素が前記第1の色でなかった場合、
前記注目画素位置におけるフィルタの色を前記既知色とし、前記第1の色を前記目標色として、前記第3の算出手段により前記第1の強度推定値を算出する
ことを特徴とする請求項2に記載の画像処理装置。
The first calculation means includes
An intensity value corresponding to a known color already obtained at the target pixel position;
Third calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position based on the correlation between the known color calculated from pixels near the target pixel and the target color to be estimated Including
If the pixel of interest is not the first color,
3. The first intensity estimation value is calculated by the third calculation unit using the filter color at the target pixel position as the known color and the first color as the target color. An image processing apparatus according to 1.
前記第3の算出手段は、
前記注目画素近傍における、前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度との組を複数生成する生成手段と、
前記生成手段により生成された前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度の複数の組から、前記既知色と前記目標色間の色分布の重心および傾きを算出する第4の算出手段と、
前記第4の算出手段により算出された前記色分布の重心および傾きと、前記注目画素位置における前記既知色に対応する強度値とに基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第5の算出手段と
を備えることを特徴とする請求項3に記載の画像処理装置。
The third calculation means includes:
Generating means for generating a plurality of sets of pixel intensities of pixels corresponding to the known color and pixel intensities of pixels corresponding to the target color in the vicinity of the target pixel;
From the plurality of sets of the pixel intensity of the pixel corresponding to the known color and the pixel intensity of the pixel corresponding to the target color generated by the generation unit, the centroid and inclination of the color distribution between the known color and the target color are calculated. A fourth calculating means for calculating;
Intensity estimation corresponding to the target color at the target pixel position based on the center of gravity and inclination of the color distribution calculated by the fourth calculation means and the intensity value corresponding to the known color at the target pixel position The image processing apparatus according to claim 3, further comprising: a fifth calculation unit that calculates a value.
前記第5の算出手段は、回帰演算を用いて前記注目画素位置における前記目標色に対応する強度推定値を算出する
ことを特徴とする請求項4に記載の画像処理装置。
The image processing apparatus according to claim 4, wherein the fifth calculation unit calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.
前記第2の算出手段は、
前記注目画素位置におけるすでに得られている既知色に対応する強度値と、
前記注目画素近傍の画素より算出される前記既知色と推定したい目標色の間の相関関係と
に基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第3の算出手段
を含み、
前記注目画素が前記第2の色でなかった場合、
前記注目画素位置におけるフィルタの色を前記既知色とし、前記第2の色を前記目標色として、前記第3の算出手段により前記第2の強度推定値を算出する
ことを特徴とする請求項2に記載の画像処理装置。
The second calculation means includes:
An intensity value corresponding to a known color already obtained at the target pixel position;
Third calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position based on the correlation between the known color calculated from pixels near the target pixel and the target color to be estimated Including
If the pixel of interest is not the second color,
3. The second intensity estimation value is calculated by the third calculation means, with the filter color at the target pixel position as the known color and the second color as the target color. An image processing apparatus according to 1.
前記第3の算出手段は、
前記注目画素近傍における、前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度との組を複数生成する生成手段と、
前記生成手段により生成された前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度の複数の組から、前記既知色と前記目標色間の色分布の重心および傾きを算出する第4の算出手段と、
前記第4の算出手段により算出された前記色分布の重心および傾きと、前記注目画素位置における前記既知色に対応する強度値とに基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第5の算出手段と
を備えることを特徴とする請求項6に記載の画像処理装置。
The third calculation means includes:
Generating means for generating a plurality of sets of pixel intensities of pixels corresponding to the known color and pixel intensities of pixels corresponding to the target color in the vicinity of the target pixel;
From the plurality of sets of the pixel intensity of the pixel corresponding to the known color and the pixel intensity of the pixel corresponding to the target color generated by the generation unit, the centroid and inclination of the color distribution between the known color and the target color A fourth calculating means for calculating;
Intensity estimation corresponding to the target color at the target pixel position based on the center of gravity and inclination of the color distribution calculated by the fourth calculation means and the intensity value corresponding to the known color at the target pixel position The image processing apparatus according to claim 6, further comprising: a fifth calculation unit that calculates a value.
前記第5の算出手段は、回帰演算を用いて前記注目画素位置における前記目標色に対応する強度推定値を算出する
ことを特徴とする請求項7に記載の画像処理装置。
The image processing apparatus according to claim 7, wherein the fifth calculation unit calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.
前記第1の算出手段は、
前記注目画素位置におけるすでに得られている既知色に対応する強度値と、
前記注目画素近傍の画素より算出される前記既知色と推定したい目標色の間の相関関係と
に基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第3の算出手段
を2以上含み、
前記注目画素が前記第1の色でなかった場合、
第1の前記第3の算出手段は、
前記注目画素位置におけるフィルタの色を前記既知色とし、前記第2の色を前記目標色として、前記注目画素位置における前記第2の色に対応する強度値を算出し、
第2の前記第3の算出手段は、
前記第2の色を前記既知色とし、前記第1の色を前記目標色として、前記第1の強度推定値を算出する
ことを特徴とする請求項2に記載の画像処理装置。
The first calculation means includes
An intensity value corresponding to a known color already obtained at the target pixel position;
Third calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position based on the correlation between the known color calculated from pixels near the target pixel and the target color to be estimated 2 or more
If the pixel of interest is not the first color,
The first third calculating means includes:
An intensity value corresponding to the second color at the target pixel position is calculated using the filter color at the target pixel position as the known color and the second color as the target color,
The second third calculating means includes:
The image processing apparatus according to claim 2, wherein the first intensity estimation value is calculated using the second color as the known color and the first color as the target color.
前記第3の算出手段は、
前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度との組を複数生成する生成手段と、
前記生成手段により生成された前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度の複数の組から、前記既知色と前記目標色間の色分布の重心および傾きを算出する第4の算出手段と、
前記第4の算出手段により算出された前記色分布の重心および傾きと、前記注目画素位置における前記既知色に対応する強度値とに基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第5の算出手段と
を備えることを特徴とする請求項9に記載の画像処理装置。
The third calculation means includes:
Generating means for generating a plurality of sets of pixel intensities of pixels corresponding to the known color and pixel intensities of pixels corresponding to the target color;
From the plurality of sets of the pixel intensity of the pixel corresponding to the known color and the pixel intensity of the pixel corresponding to the target color generated by the generation unit, the centroid and inclination of the color distribution between the known color and the target color A fourth calculating means for calculating;
Intensity estimation corresponding to the target color at the target pixel position based on the center of gravity and inclination of the color distribution calculated by the fourth calculation means and the intensity value corresponding to the known color at the target pixel position The image processing apparatus according to claim 9, further comprising: a fifth calculation unit that calculates a value.
前記第5の算出手段は、回帰演算を用いて前記注目画素位置における前記目標色に対応する強度推定値を算出する
ことを特徴とする請求項10に記載の画像処理装置。
The image processing apparatus according to claim 10, wherein the fifth calculation unit calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.
前記第2の算出手段は、
前記注目画素位置におけるすでに得られている既知色に対応する強度値と、
前記注目画素近傍の画素より算出される前記既知色と推定したい目標色の間の相関関係と
に基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第3の算出手段
を2以上含み、
前記注目画素が前記第2の色でなかった場合、
第1の前記第3の算出手段は、
前記注目画素位置におけるフィルタの色を前記既知色とし、前記第1の色を前記目標色として、前記注目画素位置における前記第1の色に対応する強度値を算出し、
第2の前記第3の算出手段は、
前記第1の色を前記既知色とし、前記第2の色を前記目標色として、前記第2の強度推定値を算出する
ことを特徴とする請求項2に記載の画像処理装置。
The second calculation means includes:
An intensity value corresponding to a known color already obtained at the target pixel position;
Third calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position based on the correlation between the known color calculated from pixels near the target pixel and the target color to be estimated 2 or more
If the pixel of interest is not the second color,
The first third calculating means includes:
An intensity value corresponding to the first color at the target pixel position is calculated using the filter color at the target pixel position as the known color and the first color as the target color,
The second third calculating means includes:
The image processing apparatus according to claim 2, wherein the second intensity estimation value is calculated using the first color as the known color and the second color as the target color.
前記第3の算出手段は、
前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度との組を複数生成する生成手段と、
前記生成手段により生成された前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度の複数の組から、前記既知色と前記目標色間の色分布の重心および傾きを算出する第4の算出手段と、
前記第4の算出手段により算出された前記色分布の重心および傾きと、前記注目画素位置における前記既知色に対応する強度値とに基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第5の算出手段と
を備えることを特徴とする請求項12に記載の画像処理装置。
The third calculation means includes:
Generating means for generating a plurality of sets of pixel intensities of pixels corresponding to the known color and pixel intensities of pixels corresponding to the target color;
From the plurality of sets of the pixel intensity of the pixel corresponding to the known color and the pixel intensity of the pixel corresponding to the target color generated by the generation unit, the centroid and inclination of the color distribution between the known color and the target color are calculated. A fourth calculating means for calculating;
Intensity estimation corresponding to the target color at the target pixel position based on the center of gravity and inclination of the color distribution calculated by the fourth calculation means and the intensity value corresponding to the known color at the target pixel position The image processing apparatus according to claim 12, further comprising: a fifth calculation unit that calculates a value.
前記第5の算出手段は、回帰演算を用いて前記注目画素位置における前記目標色に対応する強度推定値を算出する
ことを特徴とする請求項13に記載の画像処理装置。
The image processing apparatus according to claim 13, wherein the fifth calculation unit calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.
前記第1の算出手段は、
前記第1の強度推定値の第1の推定値を算出する第1の強度推定手段と、
前記第1の強度推定値の第2の推定値を算出する第2の強度推定手段と、
前記注目画素近傍におけるテクスチャ方向を判別する判別手段と、
前記判別手段による判別結果に基づいて、前記第1の強度推定手段により推定された前記第1の推定値と、前記第2の強度推定手段により推定された前記第2の推定値のうち、適した推定値を選択する選択手段と
を備え、
前記第1の強度推定手段は、
前記注目画素位置におけるすでに得られている既知色に対応する強度値と、
前記注目画素近傍の画素より算出される前記既知色と推定したい目標色の間の相関関係と
に基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第3の算出手段
を含み、
前記注目画素が前記第1の色でなかった場合、
前記注目画素位置におけるフィルタの色を前記既知色とし、前記第1の色を前記目標色として、前記第3の算出手段により前記第1の強度推定値の前記第1の推定値を算出し、
前記第2の強度推定手段は、
2以上の前記第3の算出手段を含み、
前記注目画素が前記第1の色でなかった場合、
第1の前記第3の算出手段は、前記注目画素位置におけるフィルタの色を前記既知色とし、前記第2の色を前記目標色として、前記注目画素位置における前記第2の色に対応する強度値を算出し、
第2の前記第3の算出手段は、前記第2の色を前記既知色とし、前記第1の色を前記目標色として、前記第1の強度推定値の前記第2の推定値を算出し、
前記選択手段は、前記判別手段による判別結果、および、前記注目画素位置に対して、前記第1の色に対応するフィルタが、水平方向に位置しているか、垂直方向に位置しているかに基づいて、前記第1の強度推定手段により推定された前記第1の推定値と、前記第2の強度推定手段により推定された前記第2の推定値のうち、適した推定値を選択する
ことを特徴とする請求項2に記載の画像処理装置。
The first calculation means includes
First intensity estimating means for calculating a first estimated value of the first intensity estimated value;
Second intensity estimating means for calculating a second estimated value of the first intensity estimated value;
Discrimination means for discriminating a texture direction in the vicinity of the target pixel;
Of the first estimated value estimated by the first intensity estimating means and the second estimated value estimated by the second intensity estimating means based on the discrimination result by the discriminating means, suitable Selecting means for selecting the estimated value,
The first intensity estimating means includes
An intensity value corresponding to a known color already obtained at the target pixel position;
Third calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position based on the correlation between the known color calculated from pixels near the target pixel and the target color to be estimated Including
If the pixel of interest is not the first color,
The first estimated value of the first intensity estimated value is calculated by the third calculating means using the color of the filter at the target pixel position as the known color and the first color as the target color,
The second intensity estimating means includes
Including two or more third calculation means,
If the pixel of interest is not the first color,
The first third calculating means uses the filter color at the target pixel position as the known color, the second color as the target color, and the intensity corresponding to the second color at the target pixel position. Calculate the value,
The second third calculating means calculates the second estimated value of the first intensity estimated value using the second color as the known color and the first color as the target color. ,
The selection unit is based on the determination result by the determination unit and whether the filter corresponding to the first color is positioned in the horizontal direction or the vertical direction with respect to the target pixel position. Selecting a suitable estimated value from among the first estimated value estimated by the first intensity estimating means and the second estimated value estimated by the second intensity estimating means. The image processing apparatus according to claim 2.
前記第2の算出手段は、
前記第2の強度推定値の第1の推定値を算出する第1の強度推定手段と、
前記第2の強度推定値の第2の推定値を算出する第2の強度推定手段と、
前記注目画素近傍におけるテクスチャ方向を判別する判別手段と、
前記判別手段による判別結果に基づいて、前記第1の強度推定手段により推定された前記第1の推定値と、前記第2の強度推定手段により推定された前記第2の推定値のうち、適した推定値を選択する選択手段と
を備え、
前記第1の強度推定手段は、
前記注目画素位置におけるすでに得られている既知色に対応する強度値と、
前記注目画素近傍の画素より算出される前記既知色と推定したい目標色の間の相関関係と
に基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第3の算出手段
を含み、
前記注目画素が前記第2の色でなかった場合、
前記注目画素位置におけるフィルタの色を前記既知色とし、前記第2の色を前記目標色として、前記第3の算出手段により前記第2の強度推定値の前記第1の推定値を算出し、
前記第2の強度推定手段は、
2以上の前記第3の算出手段を含み、
前記注目画素が前記第2の色でなかった場合、
第1の前記第3の算出手段は、前記注目画素位置におけるフィルタの色を前記既知色とし、前記第1の色を前記目標色として、前記注目画素位置における前記第1の色に対応する強度値を算出し、
第2の前記第3の算出手段は、前記第1の色を前記既知色とし、前記第2の色を前記目標色として、前記第2の強度推定値の前記第2の推定値を算出し、
前記選択手段は、前記判別手段による判別結果、および、前記注目画素位置に対して、前記第2の色に対応するフィルタが、水平方向に位置しているか、垂直方向に位置しているかに基づいて、前記第1の強度推定手段により推定された前記第1の推定値と、前記第2の強度推定手段により推定された前記第2の推定値のうち、適した推定値を選択する
ことを特徴とする請求項2に記載の画像処理装置。
The second calculation means includes:
First intensity estimating means for calculating a first estimated value of the second intensity estimated value;
Second intensity estimating means for calculating a second estimated value of the second intensity estimated value;
Discrimination means for discriminating a texture direction in the vicinity of the target pixel;
Of the first estimated value estimated by the first intensity estimating means and the second estimated value estimated by the second intensity estimating means based on the discrimination result by the discriminating means, suitable Selecting means for selecting the estimated value,
The first intensity estimating means includes
An intensity value corresponding to a known color already obtained at the target pixel position;
Third calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position based on the correlation between the known color calculated from pixels near the target pixel and the target color to be estimated Including
If the pixel of interest is not the second color,
The first estimated value of the second intensity estimated value is calculated by the third calculating means with the filter color at the target pixel position as the known color and the second color as the target color,
The second intensity estimating means includes
Including two or more third calculation means,
If the pixel of interest is not the second color,
The first third calculating means uses the filter color at the target pixel position as the known color, the first color as the target color, and the intensity corresponding to the first color at the target pixel position. Calculate the value,
The second third calculating means calculates the second estimated value of the second intensity estimated value using the first color as the known color and the second color as the target color. ,
The selection unit is based on the determination result by the determination unit and whether the filter corresponding to the second color is positioned in the horizontal direction or the vertical direction with respect to the target pixel position. Selecting a suitable estimated value from among the first estimated value estimated by the first intensity estimating means and the second estimated value estimated by the second intensity estimating means. The image processing apparatus according to claim 2.
前記画像取得手段の前記画像センサの複数種類の前記フィルタのフィルタ配列は、
前記フィルタのうちの前記第1の色および前記第2の色とのうちのいずれとも異なる第3の色のフィルタが、水平および垂直に1ラインおき、かつ、前記第1のフィルタとは異なる水平ラインに配置され、
前記フィルタのうちの前記第1の色、前記第2の色、および、前記第3の色とのうちのいずれとも異なる第4の色のフィルタが、水平および垂直に1ラインおき、かつ、前記第2のフィルタとは異なる水平ラインに配置される
ことを特徴とする請求項2に記載の画像処理装置。
The filter arrangement of the plurality of types of the filters of the image sensor of the image acquisition means is:
A third color filter different from any of the first color and the second color of the filters is horizontally and vertically spaced every other line, and is different from the first filter. Placed in line,
A filter of a fourth color different from any of the first color, the second color, and the third color of the filters is arranged every other line in the horizontal and vertical directions, and The image processing apparatus according to claim 2, wherein the image processing apparatus is arranged on a horizontal line different from the second filter.
前記画像取得手段の前記画像センサの複数種類の前記フィルタのフィルタ配列は、
前記フィルタのうちの前記第1の色および前記第2の色とのうちのいずれとも異なる第3の色および第4の色のフィルタが、水平および垂直に1ラインおき、かつ、前記第1のフィルタとは異なる水平ラインに交互に配置され、
前記フィルタのうちの前記第1の色、前記第2の色、前記第3の色、および、第4の色とのうちのいずれとも異なる第5の色および第6の色のフィルタが、水平および垂直に1ラインおき、かつ、前記第2のフィルタとは異なる水平ラインに交互に配置される
ことを特徴とする請求項2に記載の画像処理装置。
The filter arrangement of the plurality of types of the filters of the image sensor of the image acquisition means is:
A third color and a fourth color filter different from any of the first color and the second color of the filters are arranged every other line in the horizontal and vertical directions, and the first color Alternatingly arranged on a horizontal line different from the filter,
The filters of the fifth color and the sixth color different from any of the first color, the second color, the third color, and the fourth color of the filters are horizontal. The image processing apparatus according to claim 2, wherein the image processing apparatus is alternately arranged every other line vertically and on a horizontal line different from the second filter.
前記第3の色および前記第4の色は、互いに高い相関を有する分光特性を持ち、
前記第5の色および前記第6の色は、互いに高い相関を有する分光特性を持つ
ことを特徴とする請求項18に記載の画像処理装置。
The third color and the fourth color have spectral characteristics that are highly correlated with each other,
The image processing apparatus according to claim 18, wherein the fifth color and the sixth color have spectral characteristics having a high correlation with each other.
前記第3の色および前記第4の色は、同一の色である
ことを特徴とする請求項18に記載の画像処理装置
The image processing apparatus according to claim 18, wherein the third color and the fourth color are the same color.
前記第5の色および前記第6の色は、同一の色である
ことを特徴とする請求項18に記載の画像処理装置
The image processing apparatus according to claim 18, wherein the fifth color and the sixth color are the same color.
前記画像取得手段の前記画像センサの色フィルタ配列は、
複数種類の前記フィルタうちの輝度の分光特性に強い相関を有する分光特性を持つ第1の色に対応する第1のフィルタが、市松状に配置され、
前記画像処理手段は、
前記注目画素位置におけるすでに得られている既知色に対応する強度値と、
前記注目画素近傍の画素より算出される前記既知色と推定したい目標色の間の相関関係と
に基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第1の算出手段
を含み、
前記注目画素位置におけるフィルタの色を前記既知色とし、前記第1の色を前記目標色として、前記第1の算出手段により前記第1の強度推定値を算出する
ことを特徴とする請求項1に記載の画像処理装置。
The color filter array of the image sensor of the image acquisition means is
A first filter corresponding to a first color having spectral characteristics having a strong correlation with spectral characteristics of luminance among the plurality of types of filters is arranged in a checkered pattern,
The image processing means includes
An intensity value corresponding to a known color already obtained at the target pixel position;
First calculation means for calculating an intensity estimation value corresponding to the target color at the target pixel position based on the correlation between the known color calculated from pixels near the target pixel and the target color to be estimated Including
2. The first intensity estimation value is calculated by the first calculation unit with the filter color at the target pixel position as the known color and the first color as the target color. An image processing apparatus according to 1.
前記第1の算出手段は、
前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度との組を複数生成する生成手段と、
前記生成手段により生成された前記既知色に対応する画素の画素強度と前記目標色に対応する画素の画素強度の複数の組から、前記既知色と前記目標色間の色分布の重心および傾きを算出する第2の算出手段と、
前記第2の算出手段により算出された前記色分布の重心および傾きと、前記注目画素位置における前記既知色に対応する強度値とに基づいて、前記注目画素位置における前記目標色に対応する強度推定値を算出する第3の算出手段と
を備えることを特徴とする請求項24に記載の画像処理装置。
The first calculation means includes
Generating means for generating a plurality of sets of pixel intensities of pixels corresponding to the known color and pixel intensities of pixels corresponding to the target color;
From the plurality of sets of the pixel intensity of the pixel corresponding to the known color and the pixel intensity of the pixel corresponding to the target color generated by the generation unit, the centroid and inclination of the color distribution between the known color and the target color are calculated. A second calculating means for calculating;
Intensity estimation corresponding to the target color at the target pixel position based on the center of gravity and inclination of the color distribution calculated by the second calculation means and the intensity value corresponding to the known color at the target pixel position The image processing apparatus according to claim 24, further comprising: a third calculation unit that calculates a value.
前記第2の算出手段は、回帰演算を用いて前記注目画素位置における前記目標色に対応する強度推定値を算出する
ことを特徴とする請求項23に記載の画像処理装置。
The image processing apparatus according to claim 23, wherein the second calculation unit calculates an intensity estimation value corresponding to the target color at the target pixel position using regression calculation.
前記画像取得手段の前記画像センサの複数種類の前記フィルタのフィルタ配列は、
前記フィルタのうちの前記第1の色とは異なる第2の色のフィルタが、水平および垂直に1ラインおきに配置され、
前記フィルタのうちの前記第1の色および第2の色のフィルタが配置されていないフィルタ位置には、前記フィルタのうちの前記第1の色および前記第2の色とのうちのいずれとも異なる第3の色と第4の色のフィルタが、斜め方向に1画素おきの斜め格子状となるように配置される
ことを特徴とする請求項22に記載の画像処理装置。
The filter arrangement of the plurality of types of the filters of the image sensor of the image acquisition means is:
A second color filter different from the first color among the filters is arranged every other line in the horizontal and vertical directions;
At the filter position where the filters of the first color and the second color of the filters are not arranged, it is different from any of the first color and the second color of the filters. The image processing apparatus according to claim 22, wherein the filters of the third color and the fourth color are arranged so as to form an oblique lattice pattern every other pixel in the oblique direction.
前記第2の色は、前記第1の色より長波長側に感度を持つような分光特性のフィルタ色であり、
前記第3の色および前記第2の色のうちの少なくとも一方は、前記第1の色より短波長側に感度を持つような分光特性のフィルタ色である
ことを特徴とする請求項25に記載の画像処理装置。
The second color is a filter color having a spectral characteristic that has sensitivity on a longer wavelength side than the first color,
26. At least one of the third color and the second color is a filter color having a spectral characteristic that has sensitivity on a shorter wavelength side than the first color. Image processing apparatus.
前記画像取得手段の前記画像センサの複数種類の前記フィルタのフィルタ配列は、
前記フィルタのうちの前記第1の色とは異なる第2の色、第3の色、第4の色、第5の色、のフィルタが、水平および垂直に2ラインおき、かつ、斜め方向に1画素おきの斜め格子状となり、第2の色および第3の色と、第4の色および第5の色とは、互いに異なる水平および垂直のライン上に位置するように配置される
を備えることを特徴とする請求項22に記載の画像処理装置。
The filter arrangement of the plurality of types of the filters of the image sensor of the image acquisition means is:
Of the filters, the second color, third color, fourth color, and fifth color filters different from the first color are arranged every two lines horizontally and vertically and in an oblique direction. The second color and the third color, and the fourth color and the fifth color are arranged so as to be positioned on different horizontal and vertical lines. The image processing apparatus according to claim 22.
前記第2の色および前記第3の色は、互いに高い相関を有する分光特性を持ち、
前記第4の色および前記第5の色は、互いに高い相関を有する分光特性を持つ
ことを特徴とする請求項27に記載の画像処理装置。
The second color and the third color have spectral characteristics that are highly correlated with each other,
The image processing apparatus according to claim 27, wherein the fourth color and the fifth color have spectral characteristics having high correlation with each other.
前記第2の色および前記第3の色は、同一の色である
ことを特徴とする請求項27に記載の画像処理装置。
The image processing apparatus according to claim 27, wherein the second color and the third color are the same color.
前記第4の色および前記第5の色は、同一の色である
ことを特徴とする請求項27に記載の画像処理装置。
The image processing apparatus according to claim 27, wherein the fourth color and the fifth color are the same color.
画像を撮像して処理する画像処理装置の画像処理方法において、
分光感度が異なる少なくとも4種類のフィルタを有し、複数種類の前記フィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する取得ステップと、
前記取得ステップの処理により取得された前記モザイク画像から、前記フィルタの前記分光感度により決まる複数の色に対応する前記画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理ステップと
を含み、
前記取得ステップの処理では、
全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性に強い相関を有する分光特性を持つような色配列をもつモザイク画像が取得され、
前記画像処理ステップは、
前記市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの強度推定値に基づいて各画素の輝度値を算出する算出ステップ
を含むことを特徴とする画像処理方法。
In an image processing method of an image processing apparatus that captures and processes an image,
An acquisition step of acquiring a mosaic image by an image sensor having at least four types of filters having different spectral sensitivities, and any one of the plurality of types of filters is used for each pixel;
An image processing step of generating, from the mosaic image acquired by the processing of the acquisition step, a color image in which intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is aligned in all pixels; Including
In the process of the acquisition step,
A mosaic image having a color arrangement such that the filter of the pixels arranged in a checkered pattern in half of all the pixels has a spectral characteristic having a strong correlation with the spectral characteristic of luminance is acquired,
The image processing step includes
Image processing comprising: calculating a color intensity estimation value of pixels arranged in the checkered pattern at each pixel and calculating a luminance value of each pixel based on the intensity estimation value Method.
画像を撮像し、撮像した画像の処理を実行する処理をコンピュータに実行させるためのプログラムであって、
分光感度が異なる少なくとも4種類のフィルタを有し、複数種類の前記フィルタのうちのいずれかが画素ごとに用いられている画像センサによってモザイク画像を取得する取得ステップと、
前記取得ステップの処理により取得された前記モザイク画像から、前記フィルタの前記分光感度により決まる複数の色に対応する前記画素位置毎の強度情報が全画素でそろうようなカラー画像を生成する画像処理ステップと
を含み、
前記取得ステップの処理では、
全画素の半分に市松状に配置されている画素が持つフィルタが、輝度の分光特性に強い相関を有する分光特性を持つような色配列をもつモザイク画像が取得され、
前記画像処理ステップは、
前記市松状に配置されている画素が持つ色の強度推定値を各画素で算出し、それらの強度推定値に基づいて各画素の輝度値を算出する算出ステップ
を含むことを特徴とする処理をコンピュータに実行させるプログラム。
A program for causing a computer to execute processing for capturing an image and executing processing of the captured image,
An acquisition step of acquiring a mosaic image by an image sensor having at least four types of filters having different spectral sensitivities, and any one of the plurality of types of filters is used for each pixel;
An image processing step of generating, from the mosaic image acquired by the processing of the acquisition step, a color image in which intensity information for each pixel position corresponding to a plurality of colors determined by the spectral sensitivity of the filter is aligned in all pixels; Including
In the process of the acquisition step,
A mosaic image having a color arrangement such that the filter of the pixels arranged in a checkered pattern in half of all the pixels has a spectral characteristic having a strong correlation with the spectral characteristic of luminance is acquired,
The image processing step includes
Processing including calculating a color intensity estimation value of pixels arranged in the checkered pattern in each pixel and calculating a luminance value of each pixel based on the intensity estimation value. A program to be executed by a computer.
JP2004307645A 2003-10-23 2004-10-22 Image processing apparatus, image processing method, and program Expired - Fee Related JP4501070B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004307645A JP4501070B2 (en) 2003-10-23 2004-10-22 Image processing apparatus, image processing method, and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2003363714 2003-10-23
JP2004307645A JP4501070B2 (en) 2003-10-23 2004-10-22 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2005151549A true JP2005151549A (en) 2005-06-09
JP4501070B2 JP4501070B2 (en) 2010-07-14

Family

ID=34703166

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004307645A Expired - Fee Related JP4501070B2 (en) 2003-10-23 2004-10-22 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP4501070B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008258932A (en) * 2007-04-05 2008-10-23 Sony Corp Image processing device
JP2010212979A (en) * 2009-03-10 2010-09-24 Canon Inc Image processing unit and method of processing image
US8749672B2 (en) 2010-08-20 2014-06-10 Olympus Corporation Digital camera having a multi-spectral imaging device
JP2014515587A (en) * 2011-06-01 2014-06-30 ザ ボード オブ トラスティーズ オブ ザ レランド スタンフォード ジュニア ユニバーシティー Learning image processing pipelines for digital imaging devices

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001016598A (en) * 1999-04-30 2001-01-19 Olympus Optical Co Ltd Color imaging device and image pickup device
WO2002075654A2 (en) * 2001-03-20 2002-09-26 Hewlett-Packard Company System and method for asymmetrically demosaicing raw data images using color discontinuity equalization
JP2003087808A (en) * 2001-09-10 2003-03-20 Fuji Photo Film Co Ltd Image processing method and device, and program
JP2003152990A (en) * 2001-08-23 2003-05-23 Agilent Technol Inc Method for performing de-mosaic processing of raw data image and size adjustment
JP2003230159A (en) * 2002-02-01 2003-08-15 Sony Corp Image processing apparatus and method, program, and recording medium
JP2003230158A (en) * 2002-02-01 2003-08-15 Sony Corp Image processing apparatus and method, program, and recording medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001016598A (en) * 1999-04-30 2001-01-19 Olympus Optical Co Ltd Color imaging device and image pickup device
WO2002075654A2 (en) * 2001-03-20 2002-09-26 Hewlett-Packard Company System and method for asymmetrically demosaicing raw data images using color discontinuity equalization
JP2003152990A (en) * 2001-08-23 2003-05-23 Agilent Technol Inc Method for performing de-mosaic processing of raw data image and size adjustment
JP2003087808A (en) * 2001-09-10 2003-03-20 Fuji Photo Film Co Ltd Image processing method and device, and program
JP2003230159A (en) * 2002-02-01 2003-08-15 Sony Corp Image processing apparatus and method, program, and recording medium
JP2003230158A (en) * 2002-02-01 2003-08-15 Sony Corp Image processing apparatus and method, program, and recording medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008258932A (en) * 2007-04-05 2008-10-23 Sony Corp Image processing device
US8233733B2 (en) 2007-04-05 2012-07-31 Sony Corporation Image processing device
JP2010212979A (en) * 2009-03-10 2010-09-24 Canon Inc Image processing unit and method of processing image
US8749672B2 (en) 2010-08-20 2014-06-10 Olympus Corporation Digital camera having a multi-spectral imaging device
JP2014515587A (en) * 2011-06-01 2014-06-30 ザ ボード オブ トラスティーズ オブ ザ レランド スタンフォード ジュニア ユニバーシティー Learning image processing pipelines for digital imaging devices

Also Published As

Publication number Publication date
JP4501070B2 (en) 2010-07-14

Similar Documents

Publication Publication Date Title
KR101081000B1 (en) Image processing apparatus and image processing method, and recording medium
JP4385282B2 (en) Image processing apparatus and image processing method
JP5007767B2 (en) Image processing apparatus and method
JP4228699B2 (en) Imaging device and imaging device
WO2002056602A1 (en) Image processing device
JP4556102B2 (en) Image processing apparatus, image processing method, and program
WO1994018801A1 (en) Color wide dynamic range camera using a charge coupled device with mosaic filter
JP4501070B2 (en) Image processing apparatus, image processing method, and program
JP5131567B2 (en) Image processing apparatus, image processing method, program, and recording medium
KR100565429B1 (en) Apparatus and method for reconstructing missing color values in a color filter array
JP2009194721A (en) Image signal processing device, image signal processing method, and imaging device
KR100810155B1 (en) Image sensor for expanding wide dynamic range and output Bayer-pattern image
JP4449696B2 (en) Image processing apparatus, image processing method, and program
JP2005117540A (en) Apparatus and method for image processing, program
JP2003134523A (en) Image pickup apparatus and method
KR100741517B1 (en) Noise insensitive high resolution color interpolation method for considering cross-channel correlation
JP5035585B2 (en) Image processing apparatus and method, and program
JP2004172859A (en) Imaging unit and imaging method
JP3965556B2 (en) Image processing apparatus and method, recording medium, and program
JP4197821B2 (en) Image processing device
JP5105215B2 (en) Image processing apparatus and method, and program
JP5035646B2 (en) Image processing apparatus and method, and program
JP2009017583A (en) Image processing device
JP2003348608A (en) Image processing method, image processing program and image processing apparatus
JP4495355B2 (en) Image interpolation device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071015

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20091210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100105

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100301

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

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

R151 Written notification of patent or utility model registration

Ref document number: 4501070

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

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140430

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees