JP4688753B2 - Interpolation processing apparatus and interpolation processing method - Google Patents

Interpolation processing apparatus and interpolation processing method Download PDF

Info

Publication number
JP4688753B2
JP4688753B2 JP2006210865A JP2006210865A JP4688753B2 JP 4688753 B2 JP4688753 B2 JP 4688753B2 JP 2006210865 A JP2006210865 A JP 2006210865A JP 2006210865 A JP2006210865 A JP 2006210865A JP 4688753 B2 JP4688753 B2 JP 4688753B2
Authority
JP
Japan
Prior art keywords
value
component
color
color component
frequency component
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.)
Expired - Fee Related
Application number
JP2006210865A
Other languages
Japanese (ja)
Other versions
JP2008042313A (en
Inventor
正太郎 守谷
淳子 牧田
徹也 久野
博明 杉浦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2006210865A priority Critical patent/JP4688753B2/en
Publication of JP2008042313A publication Critical patent/JP2008042313A/en
Application granted granted Critical
Publication of JP4688753B2 publication Critical patent/JP4688753B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、補間処理装置および補間処理方法に関するものである。   The present invention relates to an interpolation processing apparatus and an interpolation processing method.

従来の補間処理装置および補間処理方法では、赤(R)、緑(G)、青(B)のカラーフィルタがベイヤ配列に従って配置されたイメージセンサを有する撮像装置において、各々の画素につき、G、BまたはB、RまたはR、Gの色成分値が不足しており、例えば下記特許文献1に示されるように、解像感を高めるために、色毎の局所的な画素信号の分布に基づいて各画素の画素信号を平均値で置き換え、これによって想定される既知色幾何学図形と不足色幾何学図形の線形相似比に基づく補間方法を用いている。   In the conventional interpolation processing apparatus and interpolation processing method, in an imaging apparatus having an image sensor in which red (R), green (G), and blue (B) color filters are arranged according to a Bayer array, G, The color component values of B or B, R, R, and G are insufficient. For example, as shown in Patent Document 1 below, based on the local pixel signal distribution for each color in order to improve the resolution. Thus, the pixel signal of each pixel is replaced with an average value, and an interpolation method based on the linear similarity ratio between the known color geometric figure and the insufficient color geometric figure is assumed.

特開2001−197512号公報JP 2001-197512 A

この従来の方法は、補間対象画素の近傍の領域においてそれぞれの色成分値(例えばベイヤ配列におけるR成分値、G成分値、B成分値)の間に正の相関があると仮定している。そのため、色成分値の間に正の相関がない領域(例えばある色と別の色との境界など)で補間を適切に行うことができず、補間誤差が大きくなるという問題があった。   This conventional method assumes that there is a positive correlation between each color component value (for example, an R component value, a G component value, and a B component value in a Bayer array) in a region near the interpolation target pixel. For this reason, there is a problem that interpolation cannot be appropriately performed in a region where there is no positive correlation between the color component values (for example, a boundary between one color and another color), and an interpolation error increases.

本発明は、補間対象画素の近傍の領域における色成分値の変化の仕方に係わらず常に最適な補間方法で補間を行うことのできる補間処理装置および補間処理方法を提供するものである。   The present invention provides an interpolation processing apparatus and an interpolation processing method that can always perform interpolation using an optimal interpolation method regardless of how color component values change in a region near the interpolation target pixel.

本発明は
第1から第N(Nは2以上の自然数)のN種類の異なる色成分のうち、
第J(Jは1からNのいずれか一つ)の色成分値を有する画素(以下、補間対象画素と呼ぶ)に対し、
第K(KはJを除く1からNのいずれか一つ)の色成分値を演算して、カラー画像を得る補間処理装置において、
前記補間対象画素における第Kの色成分の低周波成分値を出力する不足色低周波成分計算手段と、
前記補間対象画素における第Kの色成分の増分値を出力する不足色増分計算手段と、
第Jの色成分と第Kの色成分の間に正の相関が存在するのか、負の相関が存在するのか、相関がないのかを判別する相関判別手段と、
前記相関判別手段における判別の結果に基づいて、前記不足色増分計算手段で計算された前記第Kの色成分の増分値と、前記不足色低周波成分計算手段で計算された前記第Kの色成分の低周波成分値との演算を行う演算手段と
前記補間対象画素を中心とした少なくとも2つ以上の方向から、エッジの存在する方向を検出するエッジ検出手段とを有し、
前記エッジ検出手段の検出結果に応じて、前記不足色低周波成分計算手段、前記不足色増分計算手段、及び前記相関判別手段で行われる計算が切り替えられる
を有することを特徴とする補間処理装置を提供する。

The present invention provides the first to Nth (N is a natural number of 2 or more) N different color components,
For a pixel having a Jth color component value (J is any one of 1 to N) (hereinafter referred to as an interpolation target pixel),
In an interpolation processing apparatus that obtains a color image by calculating a Kth color component value (K is any one of 1 to N excluding J),
An insufficient color low frequency component calculating means for outputting a low frequency component value of the Kth color component in the interpolation target pixel;
An insufficient color increment calculating means for outputting an increment value of the Kth color component in the interpolation target pixel;
Correlation determining means for determining whether a positive correlation, a negative correlation, or no correlation exists between the Jth color component and the Kth color component;
Based on the result of discrimination in the correlation discriminating means, the increment value of the Kth color component calculated by the insufficient color increment calculating means and the Kth color calculated by the insufficient color low frequency component calculating means. Computing means for computing the low-frequency component value of the component ;
From at least two or more directions around the interpolation target pixel, it has a edge detecting means for detecting the direction in which the presence of an edge,
An interpolation processing apparatus comprising: a calculation performed by the insufficient color low-frequency component calculation unit, the insufficient color increment calculation unit, and the correlation determination unit according to a detection result of the edge detection unit. provide.

本発明によれば、補間対象画素の近傍の領域における色成分値の変化の仕方に関わらず常に最適な補間方法で補間を行うことができる。   According to the present invention, it is possible to always perform interpolation by an optimal interpolation method regardless of how color component values change in a region near the interpolation target pixel.

以下、図面を用いて本発明の実施の形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1はこの本発明の実施の形態による補間処理装置を備えた撮像装置の構成を表すブロック図である。   FIG. 1 is a block diagram showing a configuration of an image pickup apparatus provided with an interpolation processing apparatus according to an embodiment of the present invention.

レンズ1から入射した光は例えば固体撮像素子で構成されるイメージセンサ2の撮像面に結像する。イメージセンサ2から出力される撮像信号はA/D変換器3によりデジタル値に変換され、フレームメモリ4に記憶され、更に、補間処理回路5において色補間処理され、映像信号として出力される。   The light incident from the lens 1 forms an image on the imaging surface of the image sensor 2 constituted by, for example, a solid-state imaging device. The imaging signal output from the image sensor 2 is converted into a digital value by the A / D converter 3, stored in the frame memory 4, and further subjected to color interpolation processing in the interpolation processing circuit 5 and output as a video signal.

ここで、イメージセンサ2の撮像面は図2に示されるように2次元的に配列された複数の光電変換素子からなる。すなわち、各光電変換素子はベイヤ配列に従って、赤(R)、緑(G)、青(B)の3種類の色成分に対応したカラーフィルタのいずれかで覆われている。各光電変換素子は図1に示した撮像装置で撮像される画像の各画素に対応し、撮像面上で各光電変換素子の占める位置が各画素の位置に対応する。図2において横、縦はそれぞれ画像の水平方向(H)、垂直方向(V)に対応し、各画素は撮像面上に2次元的に配列されているので、各画素の位置はHV座標平面(またはHV平面)上の座標値で表すことができる。   Here, the imaging surface of the image sensor 2 is composed of a plurality of photoelectric conversion elements arranged two-dimensionally as shown in FIG. That is, each photoelectric conversion element is covered with one of color filters corresponding to three types of color components of red (R), green (G), and blue (B) according to the Bayer array. Each photoelectric conversion element corresponds to each pixel of an image captured by the imaging apparatus illustrated in FIG. 1, and the position occupied by each photoelectric conversion element on the imaging surface corresponds to the position of each pixel. In FIG. 2, the horizontal and vertical directions respectively correspond to the horizontal direction (H) and vertical direction (V) of the image, and each pixel is two-dimensionally arranged on the imaging surface. (Or HV plane) can be represented by coordinate values.

すなわち、水平方向の位置を表す水平座標値(i−2、i−1、i、i+1、i+2、i+3、…)および垂直方向の位置を表す垂直座標値(j−2、j−1、j、j+1、j+2、j+3、…)を組み合わせた座標で各画素を表すことができる。例えば水平座標値がi、垂直座標値がjの画素は(i,j)で表すことが出来る。   That is, horizontal coordinate values (i−2, i−1, i, i + 1, i + 2, i + 3,...) Representing horizontal positions and vertical coordinate values (j−2, j−1, j) representing vertical positions. , J + 1, j + 2, j + 3,...)) Can be used to represent each pixel. For example, a pixel having a horizontal coordinate value i and a vertical coordinate value j can be represented by (i, j).

以下、図1を参照して動作を詳細に説明する。なお、以下の説明では、Rのカラーフィルタで覆われた光電変換素子に対応した画素をR画素、Gのカラーフィルタで覆われた光電変換素子に対応した画素をG画素、Bのカラーフィルタで覆われた光電変換素子に対応した画素をB画素と呼ぶ。   Hereinafter, the operation will be described in detail with reference to FIG. In the following description, pixels corresponding to photoelectric conversion elements covered with R color filters are R pixels, pixels corresponding to photoelectric conversion elements covered with G color filters are G pixels, and B color filters. A pixel corresponding to the covered photoelectric conversion element is referred to as a B pixel.

イメージセンサ2の各光電変換素子からはR、G、Bいずれかの色成分に対応したアナログ信号が出力される。言い換えると、Rのカラーフィルタで覆われた光電変換素子からは、Rに対応したアナログ信号が、Gのカラーフィルタで覆われた光電変換素子からは、Gに対応したアナログ信号が、Bのカラーフィルタで覆われた光電変換素子からは、Bに対応したアナログ信号が出力される。各光電変換素子から出力されたアナログ信号は、A/D変換器3でデジタル値に変換される。各光電変換素子は各画素に対応するので、A/D変換器3から出力されるデジタル値が各画素の色成分値に対応する。   Each photoelectric conversion element of the image sensor 2 outputs an analog signal corresponding to any of R, G, and B color components. In other words, an analog signal corresponding to R is output from the photoelectric conversion element covered with the R color filter, and an analog signal corresponding to G is output from the photoelectric conversion element covered with the G color filter. An analog signal corresponding to B is output from the photoelectric conversion element covered with the filter. The analog signal output from each photoelectric conversion element is converted into a digital value by the A / D converter 3. Since each photoelectric conversion element corresponds to each pixel, the digital value output from the A / D converter 3 corresponds to the color component value of each pixel.

A/D変換器3から出力されるデジタル値は、各画素の持つ色成分値としてフレームメモリ4に書き込まれる。この際、各色成分値は各画素の撮像面上での位置、すなわちHV座標平面上での位置に対応付けて書き込まれる。   The digital value output from the A / D converter 3 is written in the frame memory 4 as the color component value of each pixel. At this time, each color component value is written in association with the position of each pixel on the imaging surface, that is, the position on the HV coordinate plane.

ここで、光電変換素子の各々は、R、G、Bの3種類の色成分のいずれかの色成分に対応したカラーフィルタで覆われているため、各画素について、1種類の色成分値しか得られない。すなわち、R画素に対してはR成分値のみが得られ、G画素に対しいてはG成分値のみが得られ、B画素に対してはB成分値のみが得られる。カラー画像を得るためには各画素に対しR成分値、G成分値、B成分値の3種類が必要なので、R画素に関してはR成分値が既知であるのに対してG成分値、B成分値が未知であり、G画素に関してはG成分値が既知であるのに対してB成分値、R成分値が未知であり、B画素に関してはB成分値が既知であるのに対してR成分値、G成分値が未知である。補間処理回路5は各画素において未知である色成分の値を補間により求め、カラー画像を得るものである。   Here, since each of the photoelectric conversion elements is covered with a color filter corresponding to any one of the three color components R, G, and B, only one color component value is provided for each pixel. I can't get it. That is, only the R component value is obtained for the R pixel, only the G component value is obtained for the G pixel, and only the B component value is obtained for the B pixel. In order to obtain a color image, three types of R component value, G component value, and B component value are required for each pixel. Therefore, while the R component value is known for the R pixel, the G component value and B component value are known. The value is unknown, the G component value is known for the G pixel, while the B component value and the R component value are unknown, and the B component value is known for the B pixel, the R component Value and G component value are unknown. The interpolation processing circuit 5 obtains a color image by obtaining an unknown color component value in each pixel by interpolation.

なお、以下の説明では各画素において色成分値が得られている色のことを既知色成分と呼び、色成分値が未知である色のことを不足色成分と呼ぶこともある。また既知色成分の色成分値を既知色成分値、不足色成分の色成分値を不足色成分値と呼ぶこともある。   In the following description, a color for which a color component value is obtained in each pixel may be referred to as a known color component, and a color for which the color component value is unknown may be referred to as an insufficient color component. Further, the color component value of the known color component may be referred to as a known color component value, and the color component value of the insufficient color component may be referred to as an insufficient color component value.

フレームメモリ4に書き込まれた色成分値はデマルチプレクサ5により、R成分値、G成分値、B成分値ごとに2次元メモリ6r、6g、6bに分配され、書き込まれる。すなわちR成分値が2次元メモリ6rに、G成分値が2次元メモリ6gに、B成分値が2次元メモリ6bに書き込まれる。ここで、2次元メモリ6r、6g、6bの各々においても色成分値は各画素の撮像面上での位置、すなわちHV座標平面上での位置に対応付けて書き込まれる。   The color component values written in the frame memory 4 are distributed and written to the two-dimensional memories 6r, 6g, and 6b by the demultiplexer 5 for each of the R component value, the G component value, and the B component value. That is, the R component value is written into the two-dimensional memory 6r, the G component value is written into the two-dimensional memory 6g, and the B component value is written into the two-dimensional memory 6b. Here, in each of the two-dimensional memories 6r, 6g, and 6b, the color component value is written in association with the position of each pixel on the imaging surface, that is, the position on the HV coordinate plane.

すなわち、2次元メモリ6rにR成分値が書き込まれた様子は図3(A)のように、2次元メモリ6gにG成分値が書き込まれた様子は図3(B)のように、2次元メモリ6bにB成分値が書き込まれた様子は図3(C)のように表すことができる。なお図3(A)〜(C)を含め、フレームメモリの様子を表す図において、大文字のRが記されている画素にはイメージセンサ2で得られたR成分値が、大文字のGが記されている画素にはイメージセンサ2で得られたG成分値が、大文字のBが記されている画素にはイメージセンサ2で得られたB成分値が書き込まれていることを表す。   That is, the state in which the R component value is written in the two-dimensional memory 6r is shown in FIG. 3A, and the state in which the G component value is written in the two-dimensional memory 6g is shown in FIG. The state in which the B component value is written in the memory 6b can be expressed as shown in FIG. 3A to 3C, which show the state of the frame memory, the R component value obtained by the image sensor 2 is indicated by the capital letter G in the pixel indicated by the capital letter R. This indicates that the G component value obtained by the image sensor 2 is written in the pixel, and the B component value obtained by the image sensor 2 is written in the pixel indicated by the capital letter B.

なお、フレームメモリ4は、イメージセンサ2として、図2に示した各画素の色成分値が2行に1行ずつ読み出されるいわゆるインターレース読み出し方式の固体撮像素子を用いた場合に必要である。イメージセンサ2として、図2に示した各画素の色成分値が上から順次1行ずつ読み出されるいわゆるプログレッシブ読み出し方式の固体撮像素子を用いた場合には、イメージセンサ2から読み出される信号をそのままデマルチプレクサ6が振り分ければよく、フレームメモリ4は不要となる。   The frame memory 4 is necessary when the image sensor 2 is a so-called interlaced readout solid-state imaging device that reads out the color component values of each pixel shown in FIG. When the image sensor 2 is a so-called progressive readout type solid-state imaging device in which the color component values of each pixel shown in FIG. 2 are sequentially read out row by row, the signal read out from the image sensor 2 is directly decoded. The multiplexer 6 only needs to be distributed, and the frame memory 4 becomes unnecessary.

補間処理回路5内部で各画素に対する不足色成分値が補間されると、その色成分値もまた、各画素の位置に対応付けて2次元メモリ6r、6g、6b内部に書き込まれる。そして全不足色成分値の補間が終了すると2次元メモリ6r、6g、6bに書き込まれた各色成分値が信号Soutとして補間処理回路5外部に出力される。   When the insufficient color component value for each pixel is interpolated in the interpolation processing circuit 5, the color component value is also written in the two-dimensional memory 6r, 6g, 6b in association with the position of each pixel. When the interpolation of all insufficient color component values is completed, each color component value written in the two-dimensional memory 6r, 6g, 6b is output to the outside of the interpolation processing circuit 5 as a signal Sout.

以下、補間処理回路5の内部構成について説明する。補間処理回路5は、デマルチプレクサ6、2次元メモリ6r、6g、6b、差分計算回路7h、7v、7p、7m、比較回路7c、ローパスフィルタ回路(Low Pass Filter、LPF)9a、9b、ハイパスフィルタ回路(High Pass Filter、HPF)8a、8b、係数決定回路11、変化量計算回路10a、10b、除算器10c、減算器12、乗算器13、14、加算器15からなる。   Hereinafter, the internal configuration of the interpolation processing circuit 5 will be described. The interpolation processing circuit 5 includes a demultiplexer 6, two-dimensional memories 6r, 6g, and 6b, difference calculation circuits 7h, 7v, 7p, and 7m, a comparison circuit 7c, low-pass filter circuits (Low Pass Filter, LPF) 9a and 9b, and a high-pass filter. Circuits (High Pass Filter, HPF) 8 a and 8 b, a coefficient determination circuit 11, change amount calculation circuits 10 a and 10 b, a divider 10 c, a subtractor 12, multipliers 13 and 14, and an adder 15.

ここでデマルチプレクサ6、2次元メモリ6r、6g、6bの動作は既に述べた通りである。また、差分計算回路7h、7v、7p、7m、および比較回路7cによりエッジ検出回路7が構成され、ハイパスフィルタ回路8a、8bおよび係数決定回路11により相関判別回路8が構成され、ローパスフィルタ回路9aおよび減算器12により既知色増分計算回路20が構成され、変化量算出回路10a、10bおよび除算器10cにより比率計算回路10が構成され、比率計算回路10および既知色増分計算回路20により不足色増分計算回路30が構成される。
なお、各構成要素の詳細動作については、補間処理回路5の動作、すなわち補間処理回路5内部で、各画素に対して不足色成分値を補間するために行われる計算の説明と合わせて後述する。
Here, the operations of the demultiplexer 6 and the two-dimensional memories 6r, 6g, and 6b are as described above. The difference calculation circuits 7h, 7v, 7p, and 7m and the comparison circuit 7c constitute an edge detection circuit 7, and the high-pass filter circuits 8a and 8b and the coefficient determination circuit 11 constitute a correlation determination circuit 8, and a low-pass filter circuit 9a. The subtractor 12 constitutes a known color increment calculation circuit 20, the change amount calculation circuits 10a and 10b and the divider 10c constitute a ratio calculation circuit 10, and the ratio calculation circuit 10 and the known color increment calculation circuit 20 increase an insufficient color. A calculation circuit 30 is configured.
The detailed operation of each component will be described later together with the description of the operation of the interpolation processing circuit 5, that is, the calculation performed to interpolate the insufficient color component value for each pixel in the interpolation processing circuit 5. .

以下に補間処理回路5の動作、すなわち補間処理回路5内部で、各画素に対して不足色成分値を補間するために行われる計算について述べる。なお、以下の説明では、HV座標平面上の座標(i,j)の位置に存在する画素に対するR成分値をR(i,j)で、G成分値をG(i,j)で、B成分値をB(i,j)で、表す。   The operation of the interpolation processing circuit 5, that is, the calculation performed to interpolate the insufficient color component value for each pixel in the interpolation processing circuit 5 will be described below. In the following description, the R component value for the pixel existing at the position of the coordinate (i, j) on the HV coordinate plane is R (i, j), the G component value is G (i, j), and B The component value is represented by B (i, j).

補間処理回路5は以下の順番で各画素に対する不足色成分値を補間する。
(1) R画素に対するG成分値およびB画素に対するG成分値の補間
(2) G画素に対するR成分値、B成分値の補間
(3) R画素に対するB成分値およびB画素に対するR成分値の補間
The interpolation processing circuit 5 interpolates the insufficient color component value for each pixel in the following order.
(1) Interpolation of G component value for R pixel and G component value for B pixel (2) Interpolation of R component value and B component value for G pixel (3) B component value for R pixel and R component value for B pixel interpolation

まず、R画素に対するG成分値およびB画素に対するG成分値を補間する方法について説明する。説明は、R画素に対するG成分値を補間する方法から行う。   First, a method of interpolating the G component value for the R pixel and the G component value for the B pixel will be described. The description will be made from a method of interpolating G component values for R pixels.

図4(A)及び(B)は2次元メモリ6r、6gにR成分値、G成分値が書き込まれている様子を、R画素を中心にして表した図である。以下にHV平面上の座標(i,j)の位置に存在するR画素に対するG成分値G(i,j)を補間する方法を述べる。   FIGS. 4A and 4B are diagrams showing the state in which R component values and G component values are written in the two-dimensional memories 6r and 6g, with the R pixel as the center. A method of interpolating the G component value G (i, j) for the R pixel existing at the position of the coordinate (i, j) on the HV plane will be described below.

なお、以下の説明では不足色成分値を補間する画素のことを補間対象画素と呼ぶこともある。   In the following description, a pixel that interpolates an insufficient color component value may be referred to as an interpolation target pixel.

まず、差分計算回路7hが画像水平方向の差分を表す値dhを、差分計算回路7vが画像垂直方向の差分を表す値dvを、差分計算回路7pを、差分計算回路7pが画像右上がり斜め方向の差分を表す値dpを、差分計算回路7mが画像左上がり斜め方向の差分を表す値dmを計算する。dh、dv、dp、dmは以下の式で計算される。
dh=|G(i−1,j)−G(i+1,j)|
dv=|G(i,j−1)−G(i,j+1)|
dp=|G(i−1,j)−G(i,j−1)|
+|G(i,j+1)−G(i+1,j)|
dm=|G(i−1,j)−G(i,j+1)|
+|G(i,j−1)−G(i+1,j)|
First, the difference calculation circuit 7h generates a value dh that represents the difference in the horizontal direction of the image, the difference calculation circuit 7v displays a value dv that represents the difference in the vertical direction of the image, the difference calculation circuit 7p, and the difference calculation circuit 7p increases the image to the right. The difference calculation circuit 7m calculates a value dm indicating the difference in the diagonally upward direction of the image. dh, dv, dp, dm are calculated by the following equations.
dh = | G (i−1, j) −G (i + 1, j) |
dv = | G (i, j-1) -G (i, j + 1) |
dp = | G (i−1, j) −G (i, j−1) |
+ | G (i, j + 1) -G (i + 1, j) |
dm = | G (i-1, j) -G (i, j + 1) |
+ | G (i, j-1) -G (i + 1, j) |

次に比較回路7cが、補間対象画素を中心にして、どの方向にエッジが存在するかを判断する。この処理は図5に示すフローに従って行われる。ここでエッジとは、カラー画像において色がある色から別の色へ変化する場所のことを表す。図6(A)〜(E)に様々なエッジの例を表す。図6(A)〜(E)において白色の部分とハッチングを施した部分では色が異なることを表す。図6(A)はエッジが存在しない場合を表し、図6(B)は水平方向にエッジが存在する場合を表し、図6(C)は垂直方向にエッジが存在する場合を表し、図6(D)は右上がり斜め方向にエッジが存在する場合を表し、図6(E)は左上がり斜め方向にエッジが存在する場合を表す。以下にエッジの方向を判別する係数決定回路の詳細を示す。   Next, the comparison circuit 7c determines in which direction the edge exists with the interpolation target pixel as the center. This process is performed according to the flow shown in FIG. Here, an edge represents a place where a color changes from one color to another color in a color image. 6A to 6E show examples of various edges. 6A to 6E, the white portion and the hatched portion are different in color. 6A shows a case where no edge exists, FIG. 6B shows a case where an edge exists in the horizontal direction, FIG. 6C shows a case where an edge exists in the vertical direction, and FIG. (D) represents a case where an edge exists in a diagonally upward direction, and FIG. 6 (E) represents a case where an edge exists in a diagonally upward direction. Details of the coefficient determining circuit for determining the direction of the edge will be described below.

まず、ステップST01で、dhおよびdvと閾値γ1を比較する。そしてdhおよびdvがともに閾値γ1より小さいとき、ステップST02に進み、エッジは存在しないと判断する。それ以外の場合はステップST03に進み、どの方向にエッジが存在するか判断する。まず、ステップST03で、dhとdvの差の絶対値を閾値σ1と比較する。そしてdhとdvの差の絶対値が閾値σ1より小さければステップST04に進み、そうでなければステップST07に進む。ステップST04ではdpとdmを比較し、右上がり斜め方向にエッジが存在するのか左上がり斜め方向にエッジが存在するのかを判断する。すなわちdpがdmより小さかった場合はステップST05に進み、右上がり斜め方向にエッジが存在すると判断し、そうでない場合、ステップST06に進み、左上がり斜め方向にエッジが存在すると判断する。一方ステップST07ではdhとdvを比較し、水平方向にエッジが存在するのか垂直方向にエッジが存在するのか判断する。すなわちdhがdvより小さかった場合、ステップST08に進み、水平方向にエッジが存在すると判断し、そうでない場合、ステップST09に進み、垂直方向にエッジが存在すると判断する。   First, in step ST01, dh and dv are compared with a threshold value γ1. When both dh and dv are smaller than the threshold γ1, the process proceeds to step ST02, and it is determined that no edge exists. In other cases, the process proceeds to step ST03 to determine in which direction the edge exists. First, in step ST03, the absolute value of the difference between dh and dv is compared with a threshold σ1. If the absolute value of the difference between dh and dv is smaller than the threshold σ1, the process proceeds to step ST04. Otherwise, the process proceeds to step ST07. In step ST04, dp and dm are compared to determine whether there is an edge in the diagonally upward direction or an edge in the diagonally upward direction. That is, if dp is smaller than dm, the process proceeds to step ST05, where it is determined that an edge exists in the diagonally upward direction. Otherwise, the process proceeds to step ST06, where it is determined that an edge exists in the diagonally upward direction. On the other hand, in step ST07, dh and dv are compared to determine whether an edge exists in the horizontal direction or an edge exists in the vertical direction. That is, if dh is smaller than dv, the process proceeds to step ST08, where it is determined that an edge exists in the horizontal direction, and otherwise, the process proceeds to step ST09, where it is determined that an edge exists in the vertical direction.

なお、比較回路7cの判定結果は、ローパスフィルタ回路9a、9b、変化量計算回路10a、10bおよび係数決定回路11に出力される。   The determination result of the comparison circuit 7c is output to the low-pass filter circuits 9a and 9b, the change amount calculation circuits 10a and 10b, and the coefficient determination circuit 11.

次に、ハイパスフィルタ回路8aの動作を説明する。ハイパスフィルタ回路8aは既知色成分Rの高周波成分値を計算する。なお、高周波成分値として以下の式で表される4種類の値Ruhpf、Rbhpf、Rlhpf、Rrhpfを計算する。   Next, the operation of the high pass filter circuit 8a will be described. The high-pass filter circuit 8a calculates the high frequency component value of the known color component R. In addition, four types of values Ruhpf, Rbhpf, Rlhpf, and Rrhpf represented by the following formulas are calculated as the high frequency component values.

Ruhpf
={−R(i−2,j−2)+2R(i,j−2)−R(i+2,j−2)}/2
Rbhpf
={−R(i−2,j+2)+2R(i,j+2)−R(i+2,j+2)}/2
Rlhpf
={−R(i−2,j−2)+2R(i−2,j)−R(i−2,j+2)}/2
Rrhpf
={−R(i+2,j−2)+2R(i+2,j)−R(i+2,j+2)}/2
Ruhpf
= {-R (i-2, j-2) + 2R (i, j-2) -R (i + 2, j-2)} / 2
Rbhpf
= {-R (i-2, j + 2) + 2R (i, j + 2) -R (i + 2, j + 2)} / 2
Rlhpf
= {-R (i-2, j-2) + 2R (i-2, j) -R (i-2, j + 2)} / 2
Rrhpf
= {-R (i + 2, j-2) + 2R (i + 2, j) -R (i + 2, j + 2)} / 2

次に、ハイパスフィルタ回路8bの動作を説明する。ハイパスフィルタ回路8bは不足色成分Gの高周波成分値を計算する。なお、高周波成分値として以下の式で表される4種類の値Guhpf、Gbhpf、Glhpf、Grhpfを計算する。
Guhpf
={−G(i−2,j−1)+2G(i,j−1)−G(i+2,j−1)}/2
Gbhpf
={−G(i−2,j+1)+2G(i,j+1)−G(i+2,j+1)}/2
Glhpf
={−G(i−1,j−2)+2G(i−1,j)−G(i−1,j+2)}/2
Grhpf
={−G(i+1,j−2)+2G(i+1,j)−G(i+1,j+2)}/2
Next, the operation of the high pass filter circuit 8b will be described. The high pass filter circuit 8b calculates the high frequency component value of the insufficient color component G. Note that four types of values Guhpf, Gbhpf, Glhpf, and Grhpf represented by the following formulas are calculated as high-frequency component values.
Guhpf
= {-G (i-2, j-1) + 2G (i, j-1) -G (i + 2, j-1)} / 2
Gbhpf
= {-G (i-2, j + 1) + 2G (i, j + 1) -G (i + 2, j + 1)} / 2
Glhpf
= {-G (i-1, j-2) + 2G (i-1, j) -G (i-1, j + 2)} / 2
Grhpf
= {-G (i + 1, j-2) + 2G (i + 1, j) -G (i + 1, j + 2)} / 2

次に、ローパスフィルタ回路9aの動作を説明する。ローパスフィルタ回路9aは既知色成分Rの低周波成分値Rlpfを計算する。ここでRlpfの計算式は比較回路7cでどの方向にエッジが存在すると判断したかに応じて(即ち、比較回路7cからの検出結果を示す信号EDに応じて)切り換えられる。すなわち、エッジがないと判断した場合、右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合、以下の式によりRlpfが計算される。
Rlpf
={R(i,j−2)+R(i−2,j)+4R(i,j)
+R(i+2,j)+R(i,j+2)}/8
水平方向にエッジが存在すると判断した場合、以下の式によりRlpfが計算される。
Rlpf
={R(i−2,j)+2R(i,j)+R(i+2,j)}/4
垂直方向にエッジが存在すると判断した場合、以下の式によりRlpfが計算される。
Rlpf
={R(i,j−2)+2R(i,j)+R(i,j+2)}/4
Next, the operation of the low-pass filter circuit 9a will be described. The low pass filter circuit 9a calculates a low frequency component value Rlpf of the known color component R. Here, the calculation formula of Rlpf is switched depending on in which direction the edge is present in the comparison circuit 7c (that is, according to the signal ED indicating the detection result from the comparison circuit 7c). That is, when it is determined that there is no edge, when it is determined that an edge exists in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction, Rlpf is calculated by the following equation.
Rlpf
= {R (i, j-2) + R (i-2, j) + 4R (i, j)
+ R (i + 2, j) + R (i, j + 2)} / 8
When it is determined that an edge exists in the horizontal direction, Rlpf is calculated by the following equation.
Rlpf
= {R (i-2, j) + 2R (i, j) + R (i + 2, j)} / 4
When it is determined that an edge exists in the vertical direction, Rlpf is calculated by the following equation.
Rlpf
= {R (i, j-2) + 2R (i, j) + R (i, j + 2)} / 4

以上のように、比較回路7cで、エッジがないと判断されたとき、右上がり斜め方向にエッジが存在すると判断されたとき、及び左上がり斜め方向にエッジが存在すると判断されたときは、補間対象画素及び補間対象画素に対して水平及び垂直方向に並び、かつ補間対象画素の近傍に位置する(図示の例では、間に一つの他の画素をおいて隣接する)画素の(同じ色成分の)画素値を用いてLPF処理(平均又は加重平均を取る演算)を行うことにより、既知色成分の低周波成分値Rlpfが計算される。   As described above, when the comparison circuit 7c determines that there is no edge, when it is determined that an edge exists in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction, interpolation is performed. (Same color component) of pixels that are aligned in the horizontal and vertical directions with respect to the target pixel and the interpolation target pixel and that are located in the vicinity of the interpolation target pixel (in the illustrated example, adjacent to each other with one other pixel in between) The low-frequency component value Rlpf of the known color component is calculated by performing LPF processing (calculation that takes an average or weighted average) using the pixel values.

また、比較回路7cで、水平方向にエッジが存在すると判断されたときは、補間対象画素及び補間対象画素に対して水平方向に並び、かつ補間対象画素の近傍に位置する(図示の例では、間に一つの他の画素をおいて隣接する)画素の(同じ色成分の)画素値を用いてLPF処理(平均又は加重平均を取る演算)を行うことにより、既知色成分の低周波成分値Rlpfが計算される。   When the comparison circuit 7c determines that an edge exists in the horizontal direction, the pixel is interpolated in the horizontal direction with respect to the interpolation target pixel and the interpolation target pixel, and is located in the vicinity of the interpolation target pixel (in the example shown in the drawing, Low-frequency component values of known color components by performing LPF processing (calculation that takes an average or weighted average) using pixel values (of the same color component) of adjacent pixels with one other pixel in between Rlpf is calculated.

また、比較回路7cで、垂直方向にエッジが存在すると判断されたときは、補間対象画素及び補間対象画素に対して垂直方向に並び、かつ補間対象画素の近傍に位置する(図示の例では、間に一つの他の画素をおいて隣接する)画素の(同じ色成分の)画素値を用いてLPF処理(平均又は加重平均を取る演算)を行うことにより、既知色成分の低周波成分値Rlpfが計算される。   When the comparison circuit 7c determines that an edge is present in the vertical direction, the pixel is interpolated in the vertical direction with respect to the interpolation target pixel and the interpolation target pixel, and is located in the vicinity of the interpolation target pixel (in the illustrated example, Low-frequency component values of known color components by performing LPF processing (calculation that takes an average or weighted average) using pixel values (of the same color component) of adjacent pixels with one other pixel in between Rlpf is calculated.

次に、ローパスフィルタ回路9bの動作を説明する。ローパスフィルタ回路9bは不足色成分Gの低周波成分値Glpfを計算する。ここでGlpfの計算式は比較回路7cでどの方向にエッジが存在すると判断したかに応じて(即ち、比較回路7cからの検出結果を示す信号EDに応じて)切り換えられる。
具体的には、エッジがないと判断した場合、右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合、以下の式によりGlpfが計算される。
={G(i,j−1)+G(i−1,j)+G(i+1,j)+G(i,j+1)}/4
水平方向にエッジが存在すると判断した場合、以下の式によりGlpfが計算される。
Glpf
={G(i−1,j)+G(i+1,j)}/2
垂直方向にエッジが存在すると判断した場合、以下の式によりGlpfが計算される。
Glpf
={G(i,j−1)+G(i,j−1)}/2
Next, the operation of the low-pass filter circuit 9b will be described. The low pass filter circuit 9b calculates the low frequency component value Glpf of the insufficient color component G. Here, the calculation formula of Glpf is switched according to which direction the edge is present in the comparison circuit 7c (that is, according to the signal ED indicating the detection result from the comparison circuit 7c).
Specifically, when it is determined that there is no edge, when it is determined that there is an edge in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction, Glpf is calculated by the following equation.
= {G (i, j-1) + G (i-1, j) + G (i + 1, j) + G (i, j + 1)} / 4
When it is determined that an edge exists in the horizontal direction, Glpf is calculated by the following equation.
Glpf
= {G (i-1, j) + G (i + 1, j)} / 2
When it is determined that an edge exists in the vertical direction, Glpf is calculated by the following equation.
Glpf
= {G (i, j-1) + G (i, j-1)} / 2

以上のように、比較回路7cで、エッジがないと判断されたとき、右上がり斜め方向にエッジが存在すると判断されたとき、及び左上がり斜め方向にエッジが存在すると判断されたときは、補間対象画素及びその上下左右に並び、かつ間に他の画素をおくことなく隣接する画素の(同じ色成分の)信号を用いてLPF処理(平均又は加重平均を取る演算)を行うことにより良い分Gの低周波成分値Glpfが計算される。   As described above, when the comparison circuit 7c determines that there is no edge, when it is determined that an edge exists in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction, interpolation is performed. It is better to perform LPF processing (calculation that takes an average or weighted average) using signals (of the same color component) of adjacent pixels that are arranged in the target pixel and its upper, lower, left, and right sides and that do not place other pixels in between. A low frequency component value Glpf of G is calculated.

また、比較回路7cで、水平方向にエッジが存在すると判断されたときは、補間対象画素に対して水平方向に並び、かつ間に他の画素をおくことなく隣接する画素の(同じ色成分の)信号を用いてLPF処理(平均又は加重平均を取る演算)を行うことにより不足色成分Gの低周波成分値Glpfが計算される。   When the comparison circuit 7c determines that an edge is present in the horizontal direction, the pixel is arranged in the horizontal direction with respect to the pixel to be interpolated and adjacent pixels (with the same color component) without any other pixels in between. ) The low frequency component value Glpf of the insufficient color component G is calculated by performing LPF processing (calculation that takes an average or weighted average) using the signal.

また、比較回路7cで、垂直方向にエッジが存在すると判断されたときは、補間対象画素に対して垂直方向に並び、かつ間に他の画素をおくことなく隣接する画素の(同じ色成分の)信号を用いてLPF処理(平均又は加重平均を取る演算)を行うことにより、不足色成分Gの低周波成分値Glpfが計算される。   If the comparison circuit 7c determines that an edge is present in the vertical direction, the pixel is arranged in the vertical direction with respect to the pixel to be interpolated, and adjacent pixels (with the same color component) without any other pixels in between. ) The low frequency component value Glpf of the insufficient color component G is calculated by performing LPF processing (calculation that takes an average or weighted average) using the signal.

次に、変化量計算回路10aの動作を説明する。変化量計算回路10aは既知色成分Rの変化量Rdispを計算する。ここでRdispの計算式は比較回路7cでどの方向にエッジが存在すると判断したかに応じて(即ち、比較回路7cからの検出結果を示す信号EDに応じて)切り換えられる。すなわち、エッジが存在しないと判断した場合、以下の式によりRdispが計算される。
Rdisp
=1+{|R(i,j−2)+R(i,j+2)|+|R(i−2,j)−R(i+2,j)|}/2
右上がり斜め方向にエッジが存在すると判断した場合、以下の式によりRdispが計算される。
Rdisp
=1+{|(R(i,j−2)+R(i−2,j))−(R(i,j+2)+R(i+2,j))|}/2
左上がり斜め方向にエッジが存在すると判断した場合、以下の式によりRdispが計算される。
Rdisp
=1+{|(R(i,j−2)+R(i+2,j))−(R(i,j+2)+R(i−2,j))|}/2
水平方向にエッジが存在すると判断した場合、以下の式によりRdispが計算される。
Rdisp=1+{|R(i−2,j)−R(i+2,j)|}/2
垂直方向にエッジが存在すると判断した場合、以下の式によりRdispが計算される。
Rdisp=1+{|R(i,j−2)−R(i,j+2)|}/2
Next, the operation of the change amount calculation circuit 10a will be described. The change amount calculation circuit 10a calculates the change amount Rdisp of the known color component R. Here, the calculation formula of Rdisp is switched according to which direction the edge is present in the comparison circuit 7c (that is, according to the signal ED indicating the detection result from the comparison circuit 7c). That is, when it is determined that no edge exists, Rdisp is calculated by the following equation.
Rdisp
= 1 + {| R (i, j-2) + R (i, j + 2) | + | R (i-2, j) -R (i + 2, j) |} / 2
If it is determined that there is an edge in the diagonally upward direction, Rdisp is calculated according to the following equation.
Rdisp
= 1 + {| (R (i, j-2) + R (i-2, j))-(R (i, j + 2) + R (i + 2, j)) |} / 2
If it is determined that an edge exists in the diagonally upward direction, Rdisp is calculated according to the following equation.
Rdisp
= 1 + {| (R (i, j-2) + R (i + 2, j))-(R (i, j + 2) + R (i-2, j)) |} / 2
If it is determined that an edge exists in the horizontal direction, Rdisp is calculated according to the following equation.
Rdisp = 1 + {| R (i-2, j) -R (i + 2, j) |} / 2
If it is determined that an edge exists in the vertical direction, Rdisp is calculated by the following equation.
Rdisp = 1 + {| R (i, j-2) -R (i, j + 2) |} / 2

以上のように、比較回路7cで、エッジがないと判断されたときは、補間対象画素に対して水平方向に並び、かつ補間対象画素を中心として反対側に位置し、かつ補間対象画素の近傍に位置する(図示の例では、補間対象画素に隣接する)画素の画素値の差の絶対値と、補間対象画素に対して垂直方向に並び、かつ補間対象画素を中心として反対側に位置し、かつ補間対象画素の近傍に位置する(図示の例では、補間対象画素に隣接する)画素の画素値の差の絶対値との和に(後述する)相似比である「1/2」を掛けたものに、所定の定数、例えば1を加算したものを、既知色成分Rの変化量Rdispとして求める。   As described above, when the comparison circuit 7c determines that there is no edge, the pixels are arranged in the horizontal direction with respect to the interpolation target pixel, located on the opposite side with respect to the interpolation target pixel, and in the vicinity of the interpolation target pixel. Are located in the vertical direction with respect to the interpolation target pixel and located on the opposite side with the interpolation target pixel at the center. In addition, the similarity ratio “1/2” (described later) is added to the sum of the absolute values of the pixel value differences of pixels located in the vicinity of the interpolation target pixel (adjacent to the interpolation target pixel in the illustrated example). A product obtained by adding a predetermined constant, for example, 1 to the product is obtained as the change amount Rdisp of the known color component R.

また、比較回路7cで、右上がり斜め方向にエッジが存在すると判断されたときは、補間対象画素を通る右上がり斜め方向の線に平行で、該補間対象画素を通る右上がり斜め方向の線よりも左上に位置する線上に位置し、かつ補間対象画素の近傍に位置する画素の画素値の和と、補間対象画素を通る右上がり斜め方向の線に平行で、該補間対象画素を通る右上がり斜め方向の線よりも右下に位置する線上に位置し、かつ補間対象画素の近傍に位置する画素の画素値の和との差の絶対値に相似比である「1/2」を掛けたものに、所定の定数、例えば1を加算したものを、既知色成分Rの変化量Rdispとして求める。   When the comparison circuit 7c determines that an edge is present in the diagonally upward direction, the line is parallel to the diagonally upward line passing through the interpolation target pixel and the diagonally upward line passing through the interpolation target pixel. Also, the sum of the pixel values of the pixels located on the upper left line and in the vicinity of the pixel to be interpolated is parallel to the diagonal line rising to the right passing through the pixel to be interpolated, and rising to the right through the pixel to be interpolated. The absolute value of the difference from the sum of the pixel values of pixels located on the lower right side of the diagonal line and in the vicinity of the pixel to be interpolated is multiplied by a similarity ratio of “1/2”. A value obtained by adding a predetermined constant, for example, 1 is obtained as the change amount Rdisp of the known color component R.

また、比較回路7cで、左上がり斜め方向にエッジが存在すると判断されたときは、補間対象画素を通る左上がり斜め方向の線に平行で、該補間対象画素を通る左上がり斜め方向の線よりも右上に位置する線上に位置し、かつ補間対象画素の近傍に位置する画素の画素値の和と、補間対象画素を通る左上がり斜め方向の線に平行で、該補間対象画素を通る左上がり斜め方向の線よりも左下に位置する線上に位置し、かつ補間対象画素の近傍に位置する画素の画素値の和との差の絶対値に相似比である「1/2」を掛けたものに、所定の定数、例えば1を加算したものを、既知色成分Rの変化量Rdispとして求める。   When the comparison circuit 7c determines that there is an edge in the diagonally upward left direction, the line is parallel to the diagonally upward left line passing through the interpolation target pixel and from the diagonally upward left line passing through the interpolation target pixel. Also, the sum of the pixel values of the pixels located on the upper right line and in the vicinity of the pixel to be interpolated is parallel to the line in the diagonally upward direction passing through the pixel to be interpolated, and is left upward through the pixel to be interpolated. The absolute value of the difference between the sum of the pixel values of the pixels located on the lower left of the diagonal line and in the vicinity of the interpolation target pixel is multiplied by the similarity ratio of “1/2” Then, a predetermined constant, for example, 1 is added as the change amount Rdisp of the known color component R.

また、比較回路7cで、水平方向にエッジが存在すると判断されたときは、補間対象画素に対して水平方向に並び、かつ、補間対象画素の近傍に位置する(図示の例では間に一つの他の画素をおいて隣接する)画素の(同じ色成分の)画素値の差の絶対値に相似比である「1/2」を掛けたものに、所定の定数、例えば1を加算したものを、既知色成分Rの変化量Rdispとして求める。   When the comparison circuit 7c determines that there is an edge in the horizontal direction, the comparison circuit 7c is arranged in the horizontal direction with respect to the interpolation target pixel and is located in the vicinity of the interpolation target pixel (in the example shown, there is one in the middle). A value obtained by multiplying the absolute value of the pixel value difference (of the same color component) of a pixel adjacent to another pixel by the similarity ratio “1/2” and adding a predetermined constant, for example, 1 Is obtained as the change amount Rdisp of the known color component R.

また、垂直方向にエッジが存在すると判断されたときは、補間対象画素に対して垂直方向に並び、かつ補間対象画素の近傍に位置する(図示の例では間に一つの他の画素をおいて隣接する)画素の(同じ色成分の)画素値の差の絶対値に相似比である「1/2」を掛けたものに、所定の定数、例えば1を加算したものを、既知色成分Rの変化量Rdispとして求める。   When it is determined that an edge exists in the vertical direction, the edges are aligned in the vertical direction with respect to the interpolation target pixel and are located in the vicinity of the interpolation target pixel (in the example shown in the figure, one other pixel is placed between them). A value obtained by multiplying the absolute value of the difference between the pixel values of the adjacent pixels (of the same color component) by the similarity ratio “½” and adding a predetermined constant, for example, 1 is the known color component R The amount of change Rdisp is obtained.

ここで「相似比」は、補間対象画素から補間対象画素の近傍に位置し、変化量計算回路10aで変化量計算に用いられる画素(図示の例では、補間対処画素に間に一つ他の画素を置いて隣接する画素)までの距離に対する、補間対象画素から補間対象画素に近傍に位置し、後述の変化量計算回路10bで変化量計算に用いられる不足色画素(図示の例では、補間対象画素に隣接する画素)までの距離の比であり、既知色幾何学図形に対する不足色幾何学図形の線形相似比とも呼ばれる。   Here, the “similarity ratio” is located in the vicinity of the interpolation target pixel from the interpolation target pixel, and is used for the change amount calculation in the change amount calculation circuit 10a (in the illustrated example, one other pixel is interposed between the interpolation target pixels). An insufficient color pixel (in the illustrated example, interpolation) that is located in the vicinity of the interpolation target pixel from the interpolation target pixel and is used for the change amount calculation by the change amount calculation circuit 10b described later with respect to the distance to the pixel adjacent to the pixel. This is the ratio of the distance to the pixel adjacent to the target pixel) and is also called the linear similarity ratio of the insufficient color geometric figure to the known color geometric figure.

次に、変化量計算回路10bの動作を説明する。変化量計算回路10bは不足色成分Gの変化量Gdispを計算する。ここでGdispの計算式は比較回路7cでどの方向にエッジが存在すると判断したかに応じて(即ち、比較回路7cからの検出結果を示す信号EDに応じて)切り換えられる。すなわち、エッジが存在しないと判断した場合、以下の式によりGdispが計算される。
Gdisp
=1+|G(i,j−1)−G(i,j+1)|
+|G(i−1,j)−G(i+1,j)|
右上がり斜め方向にエッジが存在すると判断した場合、以下の式によりGdispが計算される。
Gdisp
=1+|(G(i,j−1)+G(i−1,j))
−(G(i,j+1)+G(i+1,j))|
左上がり斜め方向にエッジが存在すると判断した場合、以下の式によりGdispが計算される。
Gdisp
=1+|(G(i,j−1)+G(i+1,j))
−(G(i,j+1)+G(i−1,j))|
水平方向にエッジが存在すると判断した場合、以下の式によりGdispが計算される。
Gdisp=1+|G(i−1,j)−G(i+1,j)|
垂直方向にエッジが存在すると判断した場合、以下の式によりGdispが計算される。
Gdisp=1+|G(i,j−1)−G(i,j+1)|
Next, the operation of the change amount calculation circuit 10b will be described. The change amount calculation circuit 10b calculates a change amount Gdisp of the insufficient color component G. Here, the Gdisp calculation formula is switched depending on in which direction the edge is present in the comparison circuit 7c (that is, according to the signal ED indicating the detection result from the comparison circuit 7c). That is, when it is determined that no edge exists, Gdisp is calculated by the following equation.
Gdisp
= 1 + | G (i, j-1) -G (i, j + 1) |
+ | G (i-1, j) -G (i + 1, j) |
If it is determined that an edge exists in the upward and diagonal direction, Gdisp is calculated by the following equation.
Gdisp
= 1 + | (G (i, j-1) + G (i-1, j))
− (G (i, j + 1) + G (i + 1, j)) |
If it is determined that an edge exists in the diagonally upward direction, Gdisp is calculated according to the following equation.
Gdisp
= 1 + | (G (i, j-1) + G (i + 1, j))
− (G (i, j + 1) + G (i−1, j)) |
When it is determined that an edge exists in the horizontal direction, Gdisp is calculated by the following equation.
Gdisp = 1 + | G (i-1, j) -G (i + 1, j) |
If it is determined that an edge exists in the vertical direction, Gdisp is calculated by the following equation.
Gdisp = 1 + | G (i, j-1) -G (i, j + 1) |

以上のように、比較回路7cで、エッジがないと判断されたときは、補間対象画素に対して水平方向に並び、かつ補間対象画素を中心として反対側に位置し、かつ補間対象画素の近傍に位置する(図示の例では、補間対象画素に隣接する)画素の(同じ色成分の)画素値の差の絶対値と、補間対象画素に対して垂直方向に並び、かつ補間対象画素を中心として反対側に位置し、かつ補間対象画素の近傍に位置する(図示の例では、補間対象画素に隣接する)画素の(同じ色成分の)画素値の差の絶対値との和に、所定の定数、例えば1を加算したものを、不足色成分Gの変化量Gdispとして求める。   As described above, when the comparison circuit 7c determines that there is no edge, the pixels are arranged in the horizontal direction with respect to the interpolation target pixel, located on the opposite side with respect to the interpolation target pixel, and in the vicinity of the interpolation target pixel. The absolute value of the difference between the pixel values (of the same color component) of the pixels located in (in the example shown, adjacent to the interpolation target pixel) and the pixels that are arranged in the vertical direction with respect to the interpolation target pixel and centered on the interpolation target pixel As the sum of the absolute values of the pixel value differences (of the same color component) of the pixels located in the opposite side and in the vicinity of the interpolation target pixel (adjacent to the interpolation target pixel in the illustrated example) Is obtained as the change amount Gdisp of the insufficient color component G.

また、比較回路7cで、右上がり斜め方向にエッジが存在すると判断されたときは、補間対象画素を通る右上がり斜め方向の線に平行で、該補間対象画素を通る右上がり斜め方向の線よりも左上に位置する線上に位置し、かつ補間対象画素の近傍に位置する画素の画素値の和と、補間対象画素を通る右上がり斜め方向の線に平行で、該補間対象画素を通る右上がり斜め方向の線よりも右下に位置する線上に位置し、かつ補間対象画素の近傍に位置する画素の画素値の和との差の絶対値に、所定の定数、例えば1を加算したものを、不足色成分Gの変化量Gdispとして求める。   When the comparison circuit 7c determines that an edge is present in the diagonally upward direction, the line is parallel to the diagonally upward line passing through the interpolation target pixel and the diagonally upward line passing through the interpolation target pixel. Also, the sum of the pixel values of the pixels located on the upper left line and in the vicinity of the pixel to be interpolated is parallel to the diagonal line rising to the right passing through the pixel to be interpolated, and rising to the right through the pixel to be interpolated. A value obtained by adding a predetermined constant, for example, 1 to the absolute value of the difference from the sum of pixel values of pixels located on the lower right side of the diagonal line and in the vicinity of the interpolation target pixel The change amount Gdisp of the insufficient color component G is obtained.

また、比較回路7cで、左上がり斜め方向にエッジが存在すると判断されたときは、補間対象画素を通る左上がり斜め方向の線に平行で、該補間対象画素を通る左上がり斜め方向の線よりも右上に位置する線上に位置し、かつ補間対象画素の近傍に位置する画素の画素値の和と、補間対象画素を通る左上がり斜め方向の線に平行で、該補間対象画素を通る左上がり斜め方向の線よりも左下に位置する線上に位置し、かつ補間対象画素の近傍に位置する画素の画素値の和との差の絶対値に、所定の定数、例えば1を加算したものを、不足色成分Gの変化量Gdispとして求める。   When the comparison circuit 7c determines that there is an edge in the diagonally upward left direction, the line is parallel to the diagonally upward left line passing through the interpolation target pixel and from the diagonally upward left line passing through the interpolation target pixel. Also, the sum of the pixel values of the pixels located on the upper right line and in the vicinity of the pixel to be interpolated is parallel to the line in the diagonally upward direction passing through the pixel to be interpolated, and is left upward through the pixel to be interpolated. A value obtained by adding a predetermined constant, for example, 1 to the absolute value of the difference from the sum of the pixel values of pixels located on the lower left side of the diagonal line and in the vicinity of the interpolation target pixel, The change amount Gdisp of the insufficient color component G is obtained.

また、比較回路7cで、水平方向にエッジが存在すると判断されたときは、補間対象画素に対して水平方向に並び、かつ、補間対象画素の近傍に位置する(図示の例では、補間対象画素に隣接する)画素の(同じ色成分の)画素値の差の絶対値に、所定の定数、例えば1を加算したものを、不足色成分Gの変化量Gdispとして求める。   When the comparison circuit 7c determines that an edge is present in the horizontal direction, the comparison circuit 7c is arranged in the horizontal direction with respect to the interpolation target pixel and is located in the vicinity of the interpolation target pixel (in the example illustrated, the interpolation target pixel A value obtained by adding a predetermined constant, for example, 1 to the absolute value of the difference between the pixel values (of the same color component) of the pixels adjacent to each other is obtained as the change amount Gdisp of the insufficient color component G.

また、比較回路7cで、垂直方向にエッジが存在すると判断されたときは、補間対象画素に対して垂直方向に並び、かつ、補間対象画素の近傍に位置する(図示の例では、補間対象画素に隣接する)画素の(同じ色成分の)画素値の差の絶対値に、所定の定数、例えば1を加算したものを、不足色成分Gの変化量Gdispとして求める。   When the comparison circuit 7c determines that there is an edge in the vertical direction, the comparison circuit 7c is arranged in the vertical direction with respect to the interpolation target pixel and is located in the vicinity of the interpolation target pixel (in the illustrated example, the interpolation target pixel A value obtained by adding a predetermined constant, for example, 1 to the absolute value of the difference between the pixel values (of the same color component) of the pixels adjacent to each other is obtained as the change amount Gdisp of the insufficient color component G.

次に、除算器10cの動作を説明する。除算器10cはGdispをRdispで割った値を出力する。すなわち、除算器10cの出力する値tは以下の計算式で表すことができる。
t=Gdisp/Rdisp
Next, the operation of the divider 10c will be described. The divider 10c outputs a value obtained by dividing Gdisp by Rdisp. That is, the value t output from the divider 10c can be expressed by the following calculation formula.
t = Gdisp / Rdisp

次に、係数決定回路11の動作を説明する。係数決定回路11はハイパスフィルタ回路8a、8bで計算された高周波成分値をもとに「1」、「0」、「−1」いずれかの値をとる係数sを出力する。なお、係数sの値は、比較回路7cでどの方向にエッジが存在すると判断したかに応じて(即ち、比較回路7cからの検出結果を示す信号EDに応じて)、図7または図8いずれかのフローに従って決定される。
比較回路7cで、エッジがないと判断した場合、水平方向にエッジが存在すると判断した場合、及び垂直方向にエッジが存在すると判断した場合には、図7のフローによる処理が行われ、比較回路7cで、右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合には、図8のフローによる処理が行われる。
Next, the operation of the coefficient determination circuit 11 will be described. The coefficient determination circuit 11 outputs a coefficient s having a value of “1”, “0”, or “−1” based on the high-frequency component values calculated by the high-pass filter circuits 8a and 8b. It should be noted that the value of the coefficient s depends on in which direction the edge is present in the comparison circuit 7c (that is, according to the signal ED indicating the detection result from the comparison circuit 7c). It is decided according to the flow.
When the comparison circuit 7c determines that there is no edge, when it is determined that there is an edge in the horizontal direction, and when it is determined that an edge exists in the vertical direction, processing according to the flow of FIG. If it is determined in 7c that an edge exists in the diagonally upward direction, and if it is determined that an edge exists in the diagonally upward direction, the process of the flow of FIG. 8 is performed.

ここで図7のステップST11及び図8のステップST21の「条件1」、並びに図8のステップST23の「条件2」は具体的には以下のように表される。
(条件1):不足色成分の高周波成分値が所定の閾値より小さい、例えば0である。
(条件2):既知色成分の高周波成分値と不足色成分の高周波成分値の符号が異なる。
Here, “condition 1” in step ST11 in FIG. 7 and step ST21 in FIG. 8 and “condition 2” in step ST23 in FIG. 8 are specifically expressed as follows.
(Condition 1): The high frequency component value of the insufficient color component is smaller than a predetermined threshold, for example, 0.
(Condition 2): Signs of high-frequency component values of known color components and high-frequency component values of insufficient color components are different.

すなわち、図7のフローに従う場合、まずステップST11において、条件1が満たされるかどうか、即ち、不足色成分の高周波成分値が所定の閾値より小さい、例えば0であるかどうか判断する。そして不足色成分の高周波成分値が0であると判断した場合は、ステップST12に進み、sの値を0にする。そうでない場合はステップST13に進み、sの値を1にする。   That is, in the case of following the flow of FIG. 7, first, in step ST11, it is determined whether or not the condition 1 is satisfied, that is, whether or not the high frequency component value of the insufficient color component is smaller than a predetermined threshold, for example, 0. If it is determined that the high frequency component value of the insufficient color component is 0, the process proceeds to step ST12, and the value of s is set to 0. Otherwise, the process proceeds to step ST13, and the value of s is set to 1.

また、図8のフローに従う場合、まずステップST21において、条件1が満たされるかどうか、即ち、不足色成分の高周波成分値が所定の閾値より小さい、例えば0であるかどうか判断する。そして不足色成分の高周波成分値が0であると判断した場合は、ステップST22に進み、sの値を0にする。そうでない場合、ステップST23に進み、条件2が満たされるかどうか、即ち、既知色成分の高周波成分値と不足色成分の高周波成分値の符号が異なるかどうか判断する。そして符号が異なると判断した場合は、ステップST24に進み、sの値を−1にする。そうでない場合はステップST25に進み、sの値を1にする。   In the case of following the flow of FIG. 8, first in step ST21, it is determined whether or not the condition 1 is satisfied, that is, whether or not the high frequency component value of the insufficient color component is smaller than a predetermined threshold, for example, 0. If it is determined that the high frequency component value of the insufficient color component is 0, the process proceeds to step ST22, and the value of s is set to 0. Otherwise, the process proceeds to step ST23, and it is determined whether or not the condition 2 is satisfied, that is, whether the high-frequency component value of the known color component and the high-frequency component value of the insufficient color component are different. If it is determined that the signs are different, the process proceeds to step ST24, and the value of s is set to -1. Otherwise, the process proceeds to step ST25, and the value of s is set to 1.

以下、比較回路7cの判断結果ごとに、係数決定回路11の動作をさらに詳しく説明する。なお以降の数式において、βはあらかじめ定められた正の値をとる閾値を表す。   Hereinafter, the operation of the coefficient determination circuit 11 will be described in more detail for each determination result of the comparison circuit 7c. In the following equations, β represents a threshold value that takes a predetermined positive value.

まず、比較回路7cでエッジがないと判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図7に示すフローに従って決定する。ここでステップST11では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Guhpf、Gbhpf、Glhpf、Grhpfが以下の式(1A)〜(1D)をすべて満たすとき、不足色成分の高周波成分値が0であり条件1が満たされると判断する。
|Guhpf|<β …(1A)
|Gbhpf|<β …(1B)
|Glhpf|<β …(1C)
|Grhpf|<β …(1D)
First, a case where the comparison circuit 7c determines that there is no edge will be described. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST11, when the high-frequency component values Guhpf, Gbhpf, Glhpf, and Grhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b satisfy all of the following expressions (1A) to (1D), It is determined that the component value is 0 and condition 1 is satisfied.
| Guhpf | <β (1A)
| Gbhpf | <β (1B)
| Glhpf | <β (1C)
| Grhpf | <β (1D)

すなわち、上記の式(1A)〜(1D)がすべて満たされるとき、ステップST12に進み、s=0とする。それ以外の場合、ステップST13に進み、s=1とする。   That is, when all of the above equations (1A) to (1D) are satisfied, the process proceeds to step ST12 and s = 0 is set. Otherwise, the process proceeds to step ST13, where s = 1.

次に、比較回路7cで右上がり斜め方向にエッジが存在すると判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図8に示すフローに従って決定する。ここでステップST21では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Guhpf、Gbhpf、Glhpf、Grhpfが上記の式(1A)〜(1D)をすべて満たすとき、不足色成分の高周波成分値が0であると判断する。   Next, a case will be described in which the comparison circuit 7c determines that an edge exists in a diagonally upward direction. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST21, when the high-frequency component values Guhpf, Gbhpf, Glhpf, and Grhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b satisfy all the above equations (1A) to (1D), It is determined that the component value is 0.

すなわち、上記の式(1A)〜(1D)がすべて満たされるとき、ステップST22に進み、s=0とする。それ以外の場合、ステップST23に進む。ステップST23では、高周波成分計算回路8aが計算した、既知色成分の高周波成分値Ruhpf、Rbhpf、Rlhpf、Rrhpfおよび高周波成分計算回路8bが計算した、不足色成分の高周波成分値Guhpf、Gbhpf、Glhpf、Grhpfが以下の条件(2A)〜(2D)のいずれかを満たすとき、既知色成分の高周波成分値と不足色成分の高周波成分値の符号が異なり、条件2が満たされると判断する。
(2A) Guhpf>β、かつGlhpf>β、かつ
Ruhpf<−β、かつRlhpf<−β
(2B) Guhpf<−β、かつGlhpf<−β、かつ
Ruhpf>β、かつRlhpf>β
(2C) Gbhpf>β、かつGlhpf>β、かつ
Rbhpf<−β、かつRrhpf<−β
(2D) Gbhpf<−β、かつGrhpf<−β、かつ
Rbhpf>β、かつRrhpf>β
That is, when all of the above equations (1A) to (1D) are satisfied, the process proceeds to step ST22, and s = 0 is set. Otherwise, the process proceeds to step ST23. In step ST23, the high-frequency component values Ruhpf, Rbhpf, Rlhpf, Rrhpf of the known color component calculated by the high-frequency component calculation circuit 8a and the high-frequency component values Guhpf, Gbhpf, Glhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b are calculated. When Grhpf satisfies any of the following conditions (2A) to (2D), the sign of the high-frequency component value of the known color component is different from the sign of the high-frequency component value of the insufficient color component, and it is determined that the condition 2 is satisfied.
(2A) Guhpf> β, Glhpf> β, Ruhpf <−β, and Rlhpf <−β
(2B) Guhpf <−β, Glhpf <−β, and Ruhpf> β, and Rlhpf> β
(2C) Gbhpf> β, Glhpf> β, Rbhpf <−β, and Rrhpf <−β
(2D) Gbhpf <−β, Grhpf <−β, Rbhpf> β, and Rrhpf> β

すなわち、条件(2A)〜(2D)のいずれかが満たされるとき、ステップST24に進みs=−1とし、それ以外のときs=1とする。   That is, when any of the conditions (2A) to (2D) is satisfied, the process proceeds to step ST24, where s = −1, and otherwise s = 1.

次に、比較回路7cで左上がり斜め方向にエッジが存在すると判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図8に示すフローに従って決定する。ここでステップST21では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Guhpf、Gbhpf、Glhpf、Grhpfが上記の式(1A)〜(1D)をすべて満たすとき、不足色成分の高周波成分値が0であると判断する。   Next, a case will be described in which the comparison circuit 7c determines that an edge is present in the diagonally upward direction. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST21, when the high-frequency component values Guhpf, Gbhpf, Glhpf, and Grhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b satisfy all the above equations (1A) to (1D), It is determined that the component value is 0.

すなわち、上記の式(1A)〜(1D)が満たされるとき、ステップST22に進み、s=0とする。それ以外の場合、ステップST23に進む。ステップST23では、高周波成分計算回路8aが計算した、既知色成分の高周波成分値Ruhpf、Rbhpf、Rlhpf、Rrhpfおよび高周波成分計算回路8bが計算した、不足色成分の高周波成分値Guhpf、Gbhpf、Glhpf、Grhpfが以下の条件(3A)〜(3D)のいずれかを満たすとき、既知色成分の高周波成分値と不足色成分の高周波成分値の符号が異なり、条件2が満たされると判断する。
(3A) Guhpf>β、かつGrhpf>β、かつ
Ruhpf<−β、かつRrhpf<−β
(3B) Guhpf<−β、かつGrhpf<−β、かつ
Ruhpf>β、かつRrhpf>β
(3C) Gbhpf>β、かつGlhpf>β、かつ
Rbhpf<−β、かつRlhpf<−β
(3D) Gbhpf<−β、かつGlhpf<−β、かつ
Rbhpf>β、かつRlhpf>β
That is, when the above equations (1A) to (1D) are satisfied, the process proceeds to step ST22 and s = 0 is set. Otherwise, the process proceeds to step ST23. In step ST23, the high-frequency component values Ruhpf, Rbhpf, Rlhpf, Rrhpf of the known color component calculated by the high-frequency component calculation circuit 8a and the high-frequency component values Guhpf, Gbhpf, Glhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b are calculated. When Grhpf satisfies any of the following conditions (3A) to (3D), the sign of the high-frequency component value of the known color component is different from the sign of the high-frequency component value of the insufficient color component, and it is determined that the condition 2 is satisfied.
(3A) Guhpf> β, Grhpf> β, and Ruhpf <−β, and Rrhpf <−β
(3B) Guhpf <−β, Grhpf <−β, and Ruhpf> β, and Rrhpf> β
(3C) Gbhpf> β, Glhpf> β, Rbhpf <−β, and Rlhpf <−β
(3D) Gbhpf <−β, Glhpf <−β, and Rbhpf> β, and Rlhpf> β

すなわち、条件(3A)〜(3D)のいずれかが満たされるとき、ステップST24に進みs=−1とし、それ以外のときs=1とする。   That is, when any of the conditions (3A) to (3D) is satisfied, the process proceeds to step ST24 where s = −1, and otherwise s = 1.

なお、上記の例では、比較回路7cで右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合には(エッジが存在しないと判断した場合と同様に)、不足色成分の高周波成分値Guhpf、Gbhpf、Glhpf、Grhpfが式(1A)〜(1D)をすべて満たすとき、不足色成分の高周波成分値が0であると判断しているが、比較回路7cで右上がり斜め方向にエッジが存在すると判断した場合には、式(1A)及び式(1C)をともに満たすとき、又は式(1B)及び式(1D)をともに満たすときに、不足色成分の高周波成分値が0であると判断し、比較回路7cで左上がり斜め方向にエッジが存在すると判断した場合には、式(1A)及び式(1D)をともに満たすとき、又は式(1B)及び式(1C)をともに満たすときに、不足色成分の高周波成分値が0であると判断しても良い。   In the above example, when it is determined by the comparison circuit 7c that an edge exists in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction (as in the case where it is determined that no edge exists) In addition, when the high-frequency component values Guhpf, Gbhpf, Glhpf, and Grhpf of the insufficient color component satisfy all the expressions (1A) to (1D), it is determined that the high-frequency component value of the insufficient color component is 0. When it is determined in the circuit 7c that an edge exists in the diagonally upward direction, when both the expressions (1A) and (1C) are satisfied, or when both the expressions (1B) and (1D) are satisfied, the insufficient color When it is determined that the high frequency component value of the component is 0, and the comparison circuit 7c determines that an edge exists in the diagonally upward left direction, both of the expressions (1A) and (1D) are satisfied Or equation (1B) and the formula (1C) when satisfying both high-frequency component value of the missing color components may be determined to be 0.

次に、比較回路7cで水平方向にエッジが存在すると判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図7に示すフローに従って決定する。ここでステップST11では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Guhpf、Gbhpfが以下の条件(4)を満たすとき、不足色成分の高周波成分値が0であり、条件1が満たされると判断する。
(4) |Guhpf|<β、かつ|Gbhpf|<β
Next, a case where the comparison circuit 7c determines that an edge exists in the horizontal direction will be described. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST11, when the high frequency component values Guhpf and Gbhpf of the insufficient color component calculated by the high frequency component calculation circuit 8b satisfy the following condition (4), the high frequency component value of the insufficient color component is 0, and the condition 1 Is determined to be satisfied.
(4) | Guhpf | <β and | Gbhpf | <β

すなわち、上記の条件(4)が満たされるとき、ステップST12に進み、s=0とする。それ以外の場合、ステップST13に進み、s=1とする。   That is, when the above condition (4) is satisfied, the process proceeds to step ST12 and s = 0. Otherwise, the process proceeds to step ST13, where s = 1.

次に、比較回路7cで垂直方向にエッジが存在すると判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図7に示すフローに従って決定する。ここでステップST11では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Glhpf、Grhpfが以下の条件(5)を満たすとき、不足色成分の高周波成分値が0であり、条件1が満たされると判断する。
(5) |Glhpf|<β、かつ|Grhpf|<β
Next, a case where the comparison circuit 7c determines that an edge exists in the vertical direction will be described. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST11, when the high-frequency component values Glhpf and Grhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b satisfy the following condition (5), the high-frequency component value of the insufficient color component is 0, and the condition 1 Is determined to be satisfied.
(5) | Glhpf | <β and | Grhpf | <β

すなわち、上記の条件(5)が満たされるとき、ステップST12に進み、s=0とする。それ以外の場合、ステップST13に進み、s=1とする。   That is, when the above condition (5) is satisfied, the process proceeds to step ST12 and s = 0. Otherwise, the process proceeds to step ST13, where s = 1.

以上のように、係数決定回路11は、比較回路7cで、エッジがないと判断した場合、水平方向にエッジが存在すると判断した場合、及び垂直方向にエッジが存在すると判断した場合には、図7のフローに従って処理を行い、条件1が満たされるとき(即ち、不足色成分の高周波成分値が所定の閾値より小さい、例えば0であるとき)は、係数sの値を0とし、条件1が満たされないときは、係数sの値を1とする。   As described above, when the coefficient determination circuit 11 determines that there is no edge in the comparison circuit 7c, when it is determined that an edge exists in the horizontal direction, and when it is determined that an edge exists in the vertical direction, FIG. When the condition 1 is satisfied (that is, when the high-frequency component value of the insufficient color component is smaller than a predetermined threshold, for example, 0), the coefficient s is set to 0, and the condition 1 is satisfied. When not satisfied, the value of the coefficient s is set to 1.

一方、比較回路7cで、右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合には、図8のフローに従って処理を行い、条件1が満たされるときは、係数sの値を1とし、条件1が満たされず、条件2が満たされるとき(既知色成分の高周波成分値と不足色成分の高周波成分値の符号が異なるとき)は、係数sの値を−1とし、条件1も条件2も満たされないときは、係数sの値を1とする。   On the other hand, when the comparison circuit 7c determines that an edge exists in the diagonally upward right direction and when it is determined that an edge exists in the diagonally upward left direction, processing is performed according to the flow of FIG. When the value of the coefficient s is 1, the condition 1 is not satisfied, and the condition 2 is satisfied (when the high frequency component value of the known color component and the high frequency component value of the insufficient color component are different), the coefficient s When the value is -1 and neither condition 1 nor condition 2 is satisfied, the value of the coefficient s is set to 1.

後述のように、係数sが1であれば、不足色増分ΔKが不足色低周波成分Klpfに加算され、係数sが−1であれば、不足色増分ΔKが不足色低周波成分Klpfから減算され、係数sが0であれば、不足色低周波成分Klpfに不足色増分ΔKが加算も減算もされず、不足色低周波成分Klpfが補間処理結果として出力される。   As will be described later, if the coefficient s is 1, the insufficient color increment ΔK is added to the insufficient color low frequency component Klpf, and if the coefficient s is −1, the insufficient color increment ΔK is subtracted from the insufficient color low frequency component Klpf. If the coefficient s is 0, the insufficient color low-frequency component Klpf is not added to or subtracted from the insufficient color low-frequency component Klpf, and the insufficient color low-frequency component Klpf is output as the interpolation processing result.

以上が係数決定回路11の動作である。   The above is the operation of the coefficient determination circuit 11.

次に減算器12の動作を説明する。減算器12は以下の式で計算される値ΔRを求める。
ΔR=R(i,j)−Rlpf
Next, the operation of the subtractor 12 will be described. The subtractor 12 obtains a value ΔR calculated by the following equation.
ΔR = R (i, j) −Rlpf

次に乗算器13、乗算器14、加算器15の動作を説明する。乗算器13は減算器12の出力値ΔRに除算器10cの出力値tを乗じた値を出力する。乗算器14は乗算器13の出力値に係数決定回路11の出力値sを乗じた値を出力する。加算器15はローパスフィルタ回路9bの出力値Glpfに乗算器14の出力値を加算した値を出力する。   Next, operations of the multiplier 13, the multiplier 14, and the adder 15 will be described. The multiplier 13 outputs a value obtained by multiplying the output value ΔR of the subtractor 12 by the output value t of the divider 10c. The multiplier 14 outputs a value obtained by multiplying the output value of the multiplier 13 by the output value s of the coefficient determination circuit 11. The adder 15 outputs a value obtained by adding the output value of the multiplier 14 to the output value Glpf of the low-pass filter circuit 9b.

そして加算器15の出力する値が補間対象画素のG成分値G(i,j)として2次元メモリ6gに書き込まれる。   The value output from the adder 15 is written in the two-dimensional memory 6g as the G component value G (i, j) of the interpolation target pixel.

言い換えると、補間処理回路5内部では以下の式に従って、R画素に対し不足色成分値G(i,j)を補間する。
G(i,j)=Glpf+s・t・{(R(i,j)−Rlpf}
In other words, in the interpolation processing circuit 5, the insufficient color component value G (i, j) is interpolated for the R pixel according to the following equation.
G (i, j) = Glpf + s · t · {(R (i, j) −Rlpf}

補間処理回路5内部では以上に述べた補間方法に従って、全てのR画素に対してG色成分値が補間される。   In the interpolation processing circuit 5, the G color component values are interpolated for all the R pixels according to the interpolation method described above.

次に、B画素に対するG成分値を補間する方法について述べる。   Next, a method for interpolating G component values for B pixels will be described.

図9(A)及び(B)は2次元メモリ6b、6gにB成分値、G成分値が書き込まれている様子を、B画素を中心にして表した図である。図4(A)及び(B)に記されているR成分値をB成分値に置き換えれば図9(A)及び(B)となることは明らかである。従ってB画素に対するG成分値を補間する方法は、R画素に対するG成分値を補間する方法と同様に扱うことができる。   FIGS. 9A and 9B are diagrams showing the B component value and the G component value written in the two-dimensional memories 6b and 6g, with the B pixel as the center. If the R component value shown in FIGS. 4A and 4B is replaced with the B component value, it is apparent that FIGS. 9A and 9B are obtained. Therefore, the method for interpolating the G component value for the B pixel can be handled in the same manner as the method for interpolating the G component value for the R pixel.

言い換えれば、B画素に対するG成分を補間する方法はR画素におけるG成分を補間する方法と同様の文章で説明することができるので、詳細な説明は省略する。   In other words, the method for interpolating the G component for the B pixel can be described in the same sentence as the method for interpolating the G component for the R pixel, and a detailed description thereof will be omitted.

以上の処理によりR画素に対するG成分値およびB画素に対するG成分値の補間が完了する。この時の2次元メモリ6r、6g、6bへの書き込みの様子を模式的に表すと図10(A)〜(C)のようになる。なお図10(A)〜(C)を含め、フレームメモリへの書き込みの様子を表す図において、小文字のgが記されている画素には補間によって得られたG成分値が書き込まれていることを表す。また、以降の補間処理では補間によって得られたG成分値gも既知色成分として扱うことができる。   Through the above processing, interpolation of the G component value for the R pixel and the G component value for the B pixel is completed. FIGS. 10A to 10C schematically show the state of writing to the two-dimensional memories 6r, 6g, and 6b at this time. In addition, in the figures showing the state of writing to the frame memory, including FIGS. 10A to 10C, the G component value obtained by interpolation is written in the pixel indicated by the lowercase letter g. Represents. In the subsequent interpolation processing, the G component value g obtained by interpolation can also be handled as a known color component.

言い換えれば、R画素におけるG成分値およびB画素におけるG成分値も既知の色成分値として扱うことができる。   In other words, the G component value in the R pixel and the G component value in the B pixel can also be handled as known color component values.

次に、G画素に対するR成分値、B成分値を補間する方法について述べる。   Next, a method for interpolating R component values and B component values for G pixels will be described.

図2に示した画素配列において、R画素とG画素が水平方向に並ぶラインを偶数行、G画素とB画素が水平方向に並ぶラインを奇数行と定義する。偶数行のG画素を中心に図2の画素配列を見た場合と、奇数行のG画素を中心に図2の画素配列を見た場合、R画素とB画素の並び方は異なっている。従って、偶数行のG画素に対するR成分値、B成分値の補間と奇数行のG画素に対するR成分値、B成分値の補間も異なったものとなる。ここではまず、偶数行のG画素に対するR成分値、B成分値の補間について先に述べ、次に奇数行のG画素に対するR成分値、B成分値の補間について述べる。   In the pixel array shown in FIG. 2, a line in which the R pixel and the G pixel are arranged in the horizontal direction is defined as an even line, and a line in which the G pixel and the B pixel are arranged in the horizontal direction is defined as an odd line. When the pixel array of FIG. 2 is viewed centering on the G pixels in the even rows and the pixel array of FIG. 2 is viewed centering on the G pixels in the odd rows, the arrangement of the R pixels and the B pixels is different. Therefore, the interpolation of the R component value and the B component value for the G pixels in the even rows is different from the interpolation of the R component value and the B component value for the G pixels in the odd rows. Here, first, interpolation of R component values and B component values for even-numbered G pixels will be described first, and then interpolation of R component values and B component values for odd-numbered G pixels will be described.

偶数行のG画素に対するR成分値、B成分値の補間のうち、偶数行のG画素に対するR成分値の補間について述べる。   Of the interpolation of the R component value and the B component value for the G pixels in the even rows, the interpolation of the R component value for the G pixels in the even rows will be described.

図11(A)〜(C)に偶数行のG画素を中心にして、2次元メモリ6r、6g、6bに各色成分値が書き込まれている様子を表す。なお、図11(A)が2次元メモリ6gを、図11(B)が2次元メモリ6rを、図11(C)が2次元メモリ6bの様子を表している。   FIGS. 11A to 11C show a state in which each color component value is written in the two-dimensional memories 6r, 6g, and 6b with the G pixels in even rows as the center. 11A shows the state of the two-dimensional memory 6g, FIG. 11B shows the state of the two-dimensional memory 6r, and FIG. 11C shows the state of the two-dimensional memory 6b.

以下に、図11(A)〜(C)に示されているHV座標平面上の座標(i,j)の位置に存在するG画素に対するR成分値R(i,j)を補間する方法について述べる。   Hereinafter, a method of interpolating the R component value R (i, j) for the G pixel existing at the position of the coordinate (i, j) on the HV coordinate plane shown in FIGS. State.

まず、差分計算回路7h、7v、7p、7m、比較回路7cの動作について説明する。これらの回路は特に動作を行わない。   First, the operations of the difference calculation circuits 7h, 7v, 7p, 7m and the comparison circuit 7c will be described. These circuits do not perform any particular operation.

次にハイパスフィルタ回路8a、8bおよび係数決定回路11の動作について説明する。ハイパスフィルタ回路8a、8bは特に動作を行わず、係数決定回路11は係数sの値として常に1を出力する。   Next, operations of the high-pass filter circuits 8a and 8b and the coefficient determination circuit 11 will be described. The high-pass filter circuits 8a and 8b do not perform any particular operation, and the coefficient determination circuit 11 always outputs 1 as the value of the coefficient s.

次にローパスフィルタ回路9aの動作について説明する。ローパスフィルタ回路9aは既知色成分Gの低周波成分値Glpfを以下の式に従って計算する。
Glpf={G(i−1,j)+2G(i,j)+G(i+1,j)}/4
Next, the operation of the low-pass filter circuit 9a will be described. The low pass filter circuit 9a calculates the low frequency component value Glpf of the known color component G according to the following equation.
Glpf = {G (i-1, j) + 2G (i, j) + G (i + 1, j)} / 4

次にローパスフィルタ回路9bの動作について説明する。ローパスフィルタ回路9bは不足色成分Rの低周波成分値Rlpfを以下の式に従って計算する。
Rlpf={R(i−1,j)+R(i+1,j)}/2
Next, the operation of the low-pass filter circuit 9b will be described. The low-pass filter circuit 9b calculates the low frequency component value Rlpf of the insufficient color component R according to the following equation.
Rlpf = {R (i-1, j) + R (i + 1, j)} / 2

次に変化量計算回路10a、10bの動作について説明する。変化量計算回路10aは既知色成分Gの変化量Gdispとして常に1を出力する。また変化量計算回路10bは不足色成分Rの変化量Rdispとして常に1を出力する。   Next, the operation of the variation calculation circuits 10a and 10b will be described. The change amount calculation circuit 10a always outputs 1 as the change amount Gdisp of the known color component G. Further, the change amount calculation circuit 10b always outputs 1 as the change amount Rdisp of the insufficient color component R.

次に除算器10cの動作について説明する。除算器10cはRdispをGdispで割った値を出力する。すなわち、除算器10cの出力値tは以下の計算式で表すことができる。
t=Rdisp/Gdisp
Next, the operation of the divider 10c will be described. The divider 10c outputs a value obtained by dividing Rdisp by Gdisp. That is, the output value t of the divider 10c can be expressed by the following calculation formula.
t = Rdisp / Gdisp

ここで、GdispおよびRdispの値は常に1なのでtの値は常に1となる。   Here, since the values of Gdisp and Rdisp are always 1, the value of t is always 1.

次に減算器12の動作を説明する。減算器12は以下の式で計算される値ΔGを計算する。
ΔG=G(i,j)−Glpf
Next, the operation of the subtractor 12 will be described. The subtractor 12 calculates a value ΔG calculated by the following equation.
ΔG = G (i, j) −Glpf

次に乗算器13、乗算器14、加算器15の動作を説明する。乗算器13は減算器12の出力値ΔGに除算器10cの出力値tを乗じた値を出力する。乗算器14は乗算器13の出力値に係数決定回路11の出力値sを乗じた値を出力する。加算器15はローパスフィルタ回路9bの出力値Rlpfに乗算器14の出力値を加算した値を出力する。   Next, operations of the multiplier 13, the multiplier 14, and the adder 15 will be described. The multiplier 13 outputs a value obtained by multiplying the output value ΔG of the subtractor 12 by the output value t of the divider 10 c. The multiplier 14 outputs a value obtained by multiplying the output value of the multiplier 13 by the output value s of the coefficient determination circuit 11. The adder 15 outputs a value obtained by adding the output value of the multiplier 14 to the output value Rlpf of the low-pass filter circuit 9b.

そして加算器15の出力する値が補間対象画素のR成分値R(i,j)として2次元メモリ6rに書き込まれる。   The value output from the adder 15 is written in the two-dimensional memory 6r as the R component value R (i, j) of the interpolation target pixel.

言い換えると、補間処理回路5内部では以下の式に従って、G画素に対し不足色成分値R(i,j)を補間する。なお、以下の式において係数sおよび係数tの値は常に1をとる。
R(i,j)=Rlpf+s・t・(G(i,j)−Glpf)
In other words, the deficient color component value R (i, j) is interpolated for the G pixel in the interpolation processing circuit 5 according to the following equation. In the following formula, the values of the coefficient s and the coefficient t are always 1.
R (i, j) = Rlpf + s · t · (G (i, j) −Glpf)

補間処理回路5内部では以上に述べた補間方法に従って、補間対象画素に対し不足色成分値R(i,j)を補間する。   In the interpolation processing circuit 5, the insufficient color component value R (i, j) is interpolated for the interpolation target pixel in accordance with the interpolation method described above.

次に偶数行のG画素に対するB成分値の補間、すなわち図11(A)〜(C)に示されているHV座標平面上の座標(i,j)の位置に存在するG画素に対するB成分値B(i,j)を補間する方法について述べる。   Next, interpolation of B component values for G pixels in even rows, that is, B components for G pixels existing at the position of coordinates (i, j) on the HV coordinate plane shown in FIGS. A method for interpolating the value B (i, j) will be described.

まず、差分計算回路7h、7v、7p、7m、比較回路7cの動作について説明する。これらの回路は特に動作を行わない。   First, the operations of the difference calculation circuits 7h, 7v, 7p, 7m and the comparison circuit 7c will be described. These circuits do not perform any particular operation.

次にハイパスフィルタ回路8a、8bおよび係数決定回路11の動作について説明する。ハイパスフィルタ回路8a、8bは特に動作を行わず、係数決定回路11は係数sの値として常に1を出力する。   Next, operations of the high-pass filter circuits 8a and 8b and the coefficient determination circuit 11 will be described. The high-pass filter circuits 8a and 8b do not perform any particular operation, and the coefficient determination circuit 11 always outputs 1 as the value of the coefficient s.

次にローパスフィルタ回路9aの動作について説明する。ローパスフィルタ回路9aは既知色成分Gの低周波成分値Glpfを以下の式に従って計算する。
Glpf={G(i,j−1)+2G(i,j)+G(i,j+1)}/4
Next, the operation of the low-pass filter circuit 9a will be described. The low pass filter circuit 9a calculates the low frequency component value Glpf of the known color component G according to the following equation.
Glpf = {G (i, j-1) + 2G (i, j) + G (i, j + 1)} / 4

次にローパスフィルタ回路9bの動作について説明する。ローパスフィルタ回路9bは不足色成分Bの低周波成分値Blpfを以下の式に従って計算する。
Blpf={B(i,j−1)+B(i,j+1)}/2
Next, the operation of the low-pass filter circuit 9b will be described. The low-pass filter circuit 9b calculates the low frequency component value Blpf of the insufficient color component B according to the following equation.
Blpf = {B (i, j-1) + B (i, j + 1)} / 2

次に変化量計算回路10a、10bの動作について説明する。変化量計算回路10aは既知色成分Gの変化量Gdispとして常に1を出力する。また変化量計算回路10bは不足色成分Bの変化量Bdispとして常に1を出力する。   Next, the operation of the variation calculation circuits 10a and 10b will be described. The change amount calculation circuit 10a always outputs 1 as the change amount Gdisp of the known color component G. The change amount calculation circuit 10b always outputs 1 as the change amount Bdisp of the insufficient color component B.

次に除算器10cの動作について説明する。除算器10cはBdispをGdispで割った値を出力する。すなわち、除算器10cの出力値tは以下の計算式で表すことができる。
t=Bdisp/Gdisp
Next, the operation of the divider 10c will be described. The divider 10c outputs a value obtained by dividing Bdisp by Gdisp. That is, the output value t of the divider 10c can be expressed by the following calculation formula.
t = Bdisp / Gdisp

ここで、Gdisp、Bdispの値は常に1なので、tの値も常に1となる。   Here, since the values of Gdisp and Bdisp are always 1, the value of t is always 1.

次に減算器12の動作を説明する。減算器12は以下の式で計算される値ΔGを計算する。
ΔG=G(i,j)−Glpf
Next, the operation of the subtractor 12 will be described. The subtractor 12 calculates a value ΔG calculated by the following equation.
ΔG = G (i, j) −Glpf

次に乗算器13、乗算器14、加算器15の動作を説明する。乗算器13は減算器12の出力値ΔGに除算器10cの出力値tを乗じた値を出力する。乗算器14は乗算器13の出力値に係数決定回路11の出力値sを乗じた値を出力する。加算器15はローパスフィルタ回路9bの出力値Blpfに乗算器14の出力値を加算した値を出力する。   Next, operations of the multiplier 13, the multiplier 14, and the adder 15 will be described. The multiplier 13 outputs a value obtained by multiplying the output value ΔG of the subtractor 12 by the output value t of the divider 10 c. The multiplier 14 outputs a value obtained by multiplying the output value of the multiplier 13 by the output value s of the coefficient determination circuit 11. The adder 15 outputs a value obtained by adding the output value of the multiplier 14 to the output value Blpf of the low-pass filter circuit 9b.

そして加算器15の出力する値が補間対象画素のB成分値B(i,j)として2次元メモリ6bに書き込まれる。   The value output from the adder 15 is written in the two-dimensional memory 6b as the B component value B (i, j) of the interpolation target pixel.

言い換えると、補間処理回路5内部では以下の式に従って、G画素に対し不足色成分値B(i,j)を補間する。なお、以下の式において係数sおよび係数tの値は常に1をとる。
B(i,j)=Blpf+s・t・(G(i,j)−Glpf)
In other words, in the interpolation processing circuit 5, the insufficient color component value B (i, j) is interpolated for the G pixel according to the following equation. In the following formula, the values of the coefficient s and the coefficient t are always 1.
B (i, j) = Blpf + s · t · (G (i, j) −Glpf)

補間処理回路5内部では以上に述べた補間方法に従って、G画素に対し不足色成分値B(i,j)を補間する。   In the interpolation processing circuit 5, the insufficient color component value B (i, j) is interpolated for the G pixel in accordance with the interpolation method described above.

次に、奇数行のG画素に対するR成分値、B成分値を補間する方法について述べる。   Next, a method of interpolating R component values and B component values for G pixels in odd rows will be described.

図12(A)〜(C)に奇数行のG画素を中心にして、2次元メモリ6r、6g、6bに各色成分値が書き込まれている様子を表す。なお、図12(A)が2次元メモリ6gを、図12(B)が2次元メモリ6bを、図12(C)が2次元メモリ6rの様子を表している。図11(A)〜(C)に記されているR成分値をB成分値に置き換え、B成分値をR成分値に置き換えれば図12(A)〜(C)となることは明らかである。従って奇数行のG画素に対するR成分値を補間する方法は、偶数行のG画素に対するB成分値を補間する方法と同様に扱うことができ、奇数行のG画素に対するB成分値を補間する方法は、偶数行のG画素に対するR成分値を補間する方法と同様に扱うことができる。   12A to 12C show a state in which each color component value is written in the two-dimensional memories 6r, 6g, and 6b, centering on the G pixels in odd rows. 12A shows the state of the two-dimensional memory 6g, FIG. 12B shows the state of the two-dimensional memory 6b, and FIG. 12C shows the state of the two-dimensional memory 6r. When the R component value shown in FIGS. 11A to 11C is replaced with the B component value and the B component value is replaced with the R component value, it is apparent that FIGS. 12A to 12C are obtained. . Therefore, the method of interpolating the R component values for the G pixels in the odd rows can be handled in the same manner as the method for interpolating the B component values for the G pixels in the even rows, and a method of interpolating the B component values for the G pixels in the odd rows. Can be handled in the same manner as the method of interpolating R component values for G pixels in even rows.

言い換えれば、奇数行のG画素に対するR成分値を補間する方法は、偶数行のG画素に対するB成分値を補間する方法と同様の文章で説明することができるので、詳細な説明は省略する。また、奇数行のG画素に対するB成分値を補間する方法も、偶数行のG画素に対するR成分値を補間する方法と同様の文章で説明することができるので、詳細な説明は省略する。   In other words, the method of interpolating the R component values for the odd-numbered G pixels can be described in the same sentence as the method for interpolating the B-component values for the even-numbered G pixels, and a detailed description thereof will be omitted. Further, the method of interpolating the B component values for the odd-numbered G pixels can also be described in the same sentence as the method for interpolating the R-component values for the even-numbered G pixels, and detailed description thereof will be omitted.

以上の処理によりG画素に対するR成分値、B成分値の補間が完了する。この時の2次元メモリ6r、6g、6bへの書き込みの様子を模式的に表すと図13(A)〜(C)のようになる。なお図13(A)〜(C)を含め、フレームメモリの様子を表す図において、小文字のr、bが記されている画素にはそれぞれ補間によって得られたR成分値、B成分値が書き込まれていることを表す。また、以降の処理では補間によって得られたR成分値、B成分値もまた、既知色成分として扱うことができる。   Through the above processing, interpolation of the R component value and the B component value for the G pixel is completed. FIGS. 13A to 13C schematically show the state of writing to the two-dimensional memories 6r, 6g, and 6b at this time. In addition, in the figures showing the state of the frame memory including FIGS. 13A to 13C, the R component value and the B component value obtained by interpolation are respectively written in the pixels indicated by the small letters r and b. Represents that In the subsequent processing, R component values and B component values obtained by interpolation can also be handled as known color components.

言い換えれば、G画素におけるR成分値、B成分値も既知の色成分値として扱うことができる。   In other words, the R component value and the B component value in the G pixel can also be handled as known color component values.

最後にB画素に対するR成分値およびR画素に対するB成分値を補間する方法について説明する。説明はまず、B画素に対するR成分値を補間する方法から行う。   Finally, a method for interpolating the R component value for the B pixel and the B component value for the R pixel will be described. First, the description will be made from the method of interpolating the R component value for the B pixel.

図14(A)〜(C)は2次元メモリ6r、6g、6bにR成分値、G成分値、B成分値が書き込まれている様子を、B画素を中心に表した図である。図14(A)は2次元メモリ6bを表しており、図14(B)は2次元メモリ6gを表しており、図14(C)は2次元メモリ6rを表している。以下に図14(A)〜(C)に示されているHV座標平面上の座標(i,j)の位置に存在するB画素に対するR成分値R(i,j)を補間する方法を述べる。   FIGS. 14A to 14C are diagrams showing the state in which the R component value, the G component value, and the B component value are written in the two-dimensional memories 6r, 6g, and 6b, with the B pixel as the center. FIG. 14A shows the two-dimensional memory 6b, FIG. 14B shows the two-dimensional memory 6g, and FIG. 14C shows the two-dimensional memory 6r. A method of interpolating the R component value R (i, j) for the B pixel existing at the position of the coordinate (i, j) on the HV coordinate plane shown in FIGS. 14 (A) to (C) will be described below. .

まず、差分計算回路7hが画像水平方向の差分を表すdh、差分計算回路7vが画像垂直方向の差分を表すdv、差分計算回路7pが画像右上がり斜め方向の差分を表すdp、差分計算回路7mが画像左上がり斜め方向の差分を表すdmを計算する。なお、dh、dv、dp、dmは以下の式で計算される。
dh=|G(i−1,j)−G(i+1,j)|
dv=|G(i,j−1)−G(i,j+1)|
dp
={|G(i,j−1)−G(i−1,j)|
+|G(i,j+1)−G(i+1,j)|}/2
dm
={|G(i,j−1)−G(i+1,j)|
+|G(i,j+1)−G(i−1,j)|}/2
First, the difference calculation circuit 7h represents the difference in the horizontal direction of the image, dh, the difference calculation circuit 7v represents the difference in the vertical direction of the image, the difference calculation circuit 7p represents the difference in the upward-right oblique direction of the image, and the difference calculation circuit 7m. Calculates dm representing the difference in the diagonal direction that rises to the left of the image. Note that dh, dv, dp, and dm are calculated by the following equations.
dh = | G (i−1, j) −G (i + 1, j) |
dv = | G (i, j-1) -G (i, j + 1) |
dp
= {| G (i, j-1) -G (i-1, j) |
+ | G (i, j + 1) -G (i + 1, j) |} / 2
dm
= {| G (i, j-1) -G (i + 1, j) |
+ | G (i, j + 1) -G (i-1, j) |} / 2

次に比較回路7cが、補間対象画素を中心にして、どの方向にエッジが存在するかを判断する。具体的にはdh、dv、dp、dmの値をもとに図15のフローに従ってエッジの存在する方向を決定する。以下にその手順を示す。   Next, the comparison circuit 7c determines in which direction the edge exists with the interpolation target pixel as the center. Specifically, the direction in which the edge exists is determined according to the flow of FIG. 15 based on the values of dh, dv, dp, and dm. The procedure is shown below.

まず、ステップST31で、dhおよびdvと閾値γ2を比較する。そしてdhおよびdvがともに閾値γ2より小さいとき、ステップST32に進み、エッジは存在しないと判断する。それ以外の場合はステップST33に進み、dhとdvの差の絶対値を閾値σ2と比較する。そしてdhとdvの差の絶対値が閾値σ2より小さければステップST34に進み、そうでなければステップST37に進む。ステップST34ではdpとdmを比較し、右上がり斜め方向にエッジが存在するのか左上がり斜め方向にエッジが存在するのかを判断する。すなわちdpがdmより小さかった場合はステップST35に進み、右上がり斜め方向にエッジが存在すると判断し、そうでない場合、ステップST36に進み、左上がり斜め方向にエッジが存在すると判断する。一方ステップST37ではdhとdvを比較し、水平方向にエッジが存在するのか垂直方向にエッジが存在するのかを判断する。すなわちdhがdvより小さかった場合、ステップST38に進み、水平方向にエッジが存在すると判断し、そうでない場合、ステップST39に進み、垂直方向にエッジが存在すると判断する。   First, in step ST31, dh and dv are compared with a threshold value γ2. When both dh and dv are smaller than the threshold γ2, the process proceeds to step ST32, and it is determined that no edge exists. Otherwise, the process proceeds to step ST33, and the absolute value of the difference between dh and dv is compared with the threshold σ2. If the absolute value of the difference between dh and dv is smaller than the threshold σ2, the process proceeds to step ST34. Otherwise, the process proceeds to step ST37. In step ST34, dp and dm are compared to determine whether there is an edge in the diagonally upward direction or an edge in the diagonally upward direction. That is, if dp is smaller than dm, the process proceeds to step ST35, where it is determined that an edge exists in the diagonally upward direction. Otherwise, the process proceeds to step ST36, where it is determined that an edge exists in the diagonally upward direction. On the other hand, in step ST37, dh and dv are compared to determine whether there is an edge in the horizontal direction or an edge in the vertical direction. That is, if dh is smaller than dv, the process proceeds to step ST38, where it is determined that an edge exists in the horizontal direction, and otherwise, the process proceeds to step ST39, where it is determined that an edge exists in the vertical direction.

次に、ハイパスフィルタ回路8aの動作を説明する。ハイパスフィルタ回路8aは既知色成分Gの高周波成分値を計算する。なお、高周波成分値として以下の式で表される4種類の値Guhpf、Gbhpf、Glhpf、Grhpfを計算する。
Guhpf
={−G(i−1,j−1)+2G(i,j−1)−G(i+1,j−1)}/2
Gbhpf
={−G(i−1,j+1)+2G(i,j+1)−G(i+1,j+1)}/2
Glhpf
={−G(i−1,j−1)+2G(i−1,j)−G(i−1,j+1)}/2
Grhpf
={−G(i+1,j−1)+2G(i+1,j)−G(i+1,j+1)}/2
Next, the operation of the high pass filter circuit 8a will be described. The high-pass filter circuit 8a calculates the high frequency component value of the known color component G. Note that four types of values Guhpf, Gbhpf, Glhpf, and Grhpf represented by the following formulas are calculated as high-frequency component values.
Guhpf
= {-G (i-1, j-1) + 2G (i, j-1) -G (i + 1, j-1)} / 2
Gbhpf
= {-G (i-1, j + 1) + 2G (i, j + 1) -G (i + 1, j + 1)} / 2
Glhpf
= {-G (i-1, j-1) + 2G (i-1, j) -G (i-1, j + 1)} / 2
Grhpf
= {-G (i + 1, j-1) + 2G (i + 1, j) -G (i + 1, j + 1)} / 2

次に、ハイパスフィルタ回路8bの動作を説明する。ハイパスフィルタ回路8bは不足色成分Rの高周波成分値を計算する。なお、高周波成分値として以下の式で表される4種類の値Ruhpf、Rbhpf、Rlhpf、Rrhpfを計算する。
Ruhpf
={−R(i−1,j−1)+2R(i,j−1)−R(i+1,j−1)}/2
Rbhpf
={−R(i−1,j+1)+2R(i,j+1)−R(i+1,j+1)}/2
Rlhpf
={−R(i−1,j−1)+2R(i−1,j)−R(i−1,j+1)}/2
Rrhpf
={−R(i+1,j−1)+2R(i+1,j)−R(i+1,j+1)}/2
Next, the operation of the high pass filter circuit 8b will be described. The high pass filter circuit 8b calculates the high frequency component value of the insufficient color component R. In addition, four types of values Ruhpf, Rbhpf, Rlhpf, and Rrhpf represented by the following formulas are calculated as the high frequency component values.
Ruhpf
= {-R (i-1, j-1) + 2R (i, j-1) -R (i + 1, j-1)} / 2
Rbhpf
= {-R (i-1, j + 1) + 2R (i, j + 1) -R (i + 1, j + 1)} / 2
Rlhpf
= {-R (i-1, j-1) + 2R (i-1, j) -R (i-1, j + 1)} / 2
Rrhpf
= {-R (i + 1, j-1) + 2R (i + 1, j) -R (i + 1, j + 1)} / 2

次に、ローパスフィルタ回路9aの動作を説明する。ローパスフィルタ回路9aは既知色成分Gの低周波成分値Glpfを計算する。ここでGlpfの計算式は比較回路7cでどの方向にエッジが存在すると判断したかに応じて切り換えられる。すなわち、エッジがないと判断した場合、右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合、以下の式によりGlpfが計算される。
Glpf
={G(i,j−1)+G(i−1,j)+4G(i,j)
+G(i+1,j)+G(i,j+1)}/8
水平方向にエッジが存在すると判断した場合、以下の式によりGlpfが計算される。
Glpf={G(i−1,j)+2G(i,j)+G(i+1,j)}/4
垂直方向にエッジが存在すると判断した場合、以下の式によりRlpfが計算される。
Glpf={G(i,j−1)+2G(i,j)+G(i,j+1)}/4
Next, the operation of the low-pass filter circuit 9a will be described. The low pass filter circuit 9a calculates the low frequency component value Glpf of the known color component G. Here, the calculation formula of Glpf is switched depending on in which direction the edge is present in the comparison circuit 7c. That is, when it is determined that there is no edge, when it is determined that an edge exists in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction, Glpf is calculated by the following equation.
Glpf
= {G (i, j-1) + G (i-1, j) + 4G (i, j)
+ G (i + 1, j) + G (i, j + 1)} / 8
When it is determined that an edge exists in the horizontal direction, Glpf is calculated by the following equation.
Glpf = {G (i-1, j) + 2G (i, j) + G (i + 1, j)} / 4
When it is determined that an edge exists in the vertical direction, Rlpf is calculated by the following equation.
Glpf = {G (i, j-1) + 2G (i, j) + G (i, j + 1)} / 4

次に、ローパスフィルタ回路9bの動作を説明する。ローパスフィルタ回路9bは不足色成分Rの低周波成分値Rlpfを計算する。ここでRlpfの計算式は比較回路7cでどの方向にエッジが存在すると判断したかに応じて切り換えられる。すなわち、エッジがないと判断した場合、右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合、以下の式によりRlpfが計算される。
Rlpf
={R(j−1,i)+R(i−1,j)+R(i+1,j)+R(j+1,i)}/4
水平方向にエッジが存在すると判断した場合、以下の式によりRlpfが計算される。
Rlpf={R(i−1,j)+R(i+1,j)}/2
垂直方向にエッジが存在すると判断した場合、以下の式によりRlpfが計算される。
Rlpf={R(i,j−1)+R(i,j+1)}/2
Next, the operation of the low-pass filter circuit 9b will be described. The low pass filter circuit 9b calculates the low frequency component value Rlpf of the insufficient color component R. Here, the calculation formula of Rlpf is switched depending on in which direction the edge is determined by the comparison circuit 7c. That is, when it is determined that there is no edge, when it is determined that an edge exists in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction, Rlpf is calculated by the following equation.
Rlpf
= {R (j-1, i) + R (i-1, j) + R (i + 1, j) + R (j + 1, i)} / 4
When it is determined that an edge exists in the horizontal direction, Rlpf is calculated by the following equation.
Rlpf = {R (i-1, j) + R (i + 1, j)} / 2
When it is determined that an edge exists in the vertical direction, Rlpf is calculated by the following equation.
Rlpf = {R (i, j-1) + R (i, j + 1)} / 2

次に、変化量計算回路10aの動作を説明する。変化量計算回路10aは既知色成分Gの変化量Gdispを計算する。ここでGdispの計算式は比較回路7cでどの方向にエッジが存在すると判断したかに応じて切り換えられる。すなわち、エッジが存在しないと判断した場合、以下の式によりGdispが計算される。
Gdisp
=1+|G(i,j−1)−G(i,j+1)|
+|G(i−1,j)−G(i+1,j)|
右上がり斜め方向にエッジが存在すると判断した場合、以下の式によりGdispが計算される。
Gdisp
=1+|(G(i,j−1)+G(i−1,j))
−(G(i,j+1)+G(i+1,j))|
左上がり斜め方向にエッジが存在すると判断した場合、以下の式によりGdispが計算される。
Gdisp
=1+|(G(i,j−1)+G(i+1,j))
−(G(i,j+1)+G(i−1,j))|
水平方向にエッジが存在すると判断した場合、以下の式によりGdispが計算される。
Gdisp=1+|G(i−1,j)−G(i+1,j)|
垂直方向にエッジが存在すると判断した場合、以下の式によりGdispが計算される。
Gdisp=1+|G(i,j−1)−G(i,j+1)|
Next, the operation of the change amount calculation circuit 10a will be described. The change amount calculation circuit 10a calculates the change amount Gdisp of the known color component G. Here, the Gdisp calculation formula is switched depending on in which direction the edge is present in the comparison circuit 7c. That is, when it is determined that no edge exists, Gdisp is calculated by the following equation.
Gdisp
= 1 + | G (i, j-1) -G (i, j + 1) |
+ | G (i-1, j) -G (i + 1, j) |
If it is determined that an edge exists in the upward and diagonal direction, Gdisp is calculated by the following equation.
Gdisp
= 1 + | (G (i, j-1) + G (i-1, j))
− (G (i, j + 1) + G (i + 1, j)) |
If it is determined that an edge exists in the diagonally upward direction, Gdisp is calculated according to the following equation.
Gdisp
= 1 + | (G (i, j-1) + G (i + 1, j))
− (G (i, j + 1) + G (i−1, j)) |
When it is determined that an edge exists in the horizontal direction, Gdisp is calculated by the following equation.
Gdisp = 1 + | G (i-1, j) -G (i + 1, j) |
If it is determined that an edge exists in the vertical direction, Gdisp is calculated by the following equation.
Gdisp = 1 + | G (i, j-1) -G (i, j + 1) |

次に、変化量計算回路10bの動作を説明する。変化量計算回路10bは不足色成分Rの変化量Rdispを計算する。ここでRdispの計算式は比較回路7cでどの方向にエッジが存在すると判断したかに応じて切り換えられる。すなわち、エッジが存在しないと判断した場合、以下の式によりRdispが計算される。
Rdisp
=1+|R(i,j−1)−R(i,j+1)|
+|R(i−1,j)−R(i+1,j)|
右上がり斜め方向にエッジが存在すると判断した場合、以下の式によりRdispが計算される。
Rdisp
=1+|(R(i,j−1)+R(i−1,j))
−(R(i,j+1)+R(i+1,j))|
左上がり斜め方向にエッジが存在すると判断した場合、以下の式によりRdispが計算される。
Rdisp
=1+|(R(i,j−1)+R(i+1,j))
−(R(i,j+1)+R(i−1,j))|
水平方向にエッジが存在すると判断した場合、以下の式によりRdispが計算される。
Rdisp=1+|R(i−1,j)−R(i+1,j)|
垂直方向にエッジが存在すると判断した場合、以下の式によりRdispが計算される。
Rdisp=1+|R(i,j−1)−R(i,j+1)|
Next, the operation of the change amount calculation circuit 10b will be described. The change amount calculation circuit 10b calculates the change amount Rdisp of the insufficient color component R. Here, the calculation formula of Rdisp is switched depending on in which direction the edge is determined by the comparison circuit 7c. That is, when it is determined that no edge exists, Rdisp is calculated by the following equation.
Rdisp
= 1 + | R (i, j-1) -R (i, j + 1) |
+ | R (i-1, j) -R (i + 1, j) |
If it is determined that there is an edge in the diagonally upward direction, Rdisp is calculated according to the following equation.
Rdisp
= 1 + | (R (i, j-1) + R (i-1, j))
− (R (i, j + 1) + R (i + 1, j)) |
If it is determined that an edge exists in the diagonally upward direction, Rdisp is calculated according to the following equation.
Rdisp
= 1 + | (R (i, j-1) + R (i + 1, j))
− (R (i, j + 1) + R (i−1, j)) |
If it is determined that an edge exists in the horizontal direction, Rdisp is calculated according to the following equation.
Rdisp = 1 + | R (i-1, j) -R (i + 1, j) |
If it is determined that an edge exists in the vertical direction, Rdisp is calculated by the following equation.
Rdisp = 1 + | R (i, j-1) -R (i, j + 1) |

次に、除算器10cの動作を説明する。除算器10cはRdispをGdispで割った値を出力する。すなわち、除算器10cの出力する値は以下の計算式で表すことができる。
t=Rdisp/Gdisp
Next, the operation of the divider 10c will be described. The divider 10c outputs a value obtained by dividing Rdisp by Gdisp. That is, the value output from the divider 10c can be expressed by the following calculation formula.
t = Rdisp / Gdisp

次に、係数決定回路11の動作を説明する。係数決定回路11はハイパスフィルタ回路8a、8bで計算された高周波成分値をもとに「1」、「0」、「−1」のいずれかの値をとる係数sを出力する。なお、係数sの値は、比較回路7cでどの方向にエッジが存在すると判断したかに応じて、図7または図8いずれかのフローに従って決定される。   Next, the operation of the coefficient determination circuit 11 will be described. The coefficient determination circuit 11 outputs a coefficient s having a value of “1”, “0”, or “−1” based on the high-frequency component values calculated by the high-pass filter circuits 8a and 8b. Note that the value of the coefficient s is determined according to the flow of either FIG. 7 or FIG. 8 depending on in which direction the edge is present in the comparison circuit 7c.

まず、比較回路7cでエッジがないと判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図7に示すフローに従って決定する。ここでステップST11では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Ruhpf、Rbhpf、Rlhpf、Rrhpfが以下の式(6A)〜(6D)をすべて満たすとき、不足色成分の高周波成分値が0であり、条件1が満たされると判断する。
|Ruhpf|<β …(6A)
|Rbhpf|<β …(6B)
|Rlhpf|<β …(6C)
|Rrhpf|<β …(6D)
First, a case where the comparison circuit 7c determines that there is no edge will be described. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST11, when the high-frequency component values Ruhpf, Rbhpf, Rlhpf, and Rrhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b satisfy all of the following expressions (6A) to (6D), It is determined that the component value is 0 and condition 1 is satisfied.
| Ruhpf | <β (6A)
| Rbhpf | <β (6B)
| Rlhpf | <β (6C)
| Rrhpf | <β (6D)

すなわち、上記の式(6A)〜(6D)がすべて満たされるとき、ステップST12に進み、s=0とし、そうでないときステップST13に進み、s=1とする。   That is, when all the above equations (6A) to (6D) are satisfied, the process proceeds to step ST12, and s = 0 is set. Otherwise, the process proceeds to step ST13, and s = 1 is set.

次に、比較回路7cで右上がり斜め方向にエッジが存在すると判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図8に示すフローに従って決定する。ここでステップST21では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Ruhpf、Rbhpf、Rlhpf、Rrhpfが上記の式(6A)〜(6D)をすべて満たすとき、不足色成分の高周波成分値が0であり、条件1が満たされると判断する。   Next, a case will be described in which the comparison circuit 7c determines that an edge exists in a diagonally upward direction. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST21, when the high-frequency component values Ruhpf, Rbhpf, Rlhpf, and Rrhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b satisfy all the above equations (6A) to (6D), It is determined that the component value is 0 and condition 1 is satisfied.

すなわち、上記の条件が満たされるとき、ステップST22に進み、s=0とする。また、それ以外のとき、ステップST23に進む。ステップST23では、高周波成分計算回路8aが計算した、既知色成分の高周波成分値Guhpf、Gbhpf、Glhpf、Grhpfおよび高周波成分計算回路8bが計算した、不足色成分の高周波成分値Ruhpf、Rbhpf、Rlhpf、Rrhpfが以下の条件(7A)〜(7D)のいずれかを満たすとき、既知色成分の高周波成分値と不足色成分の高周波成分値の符号が異なり、条件2が満たされると判断する。
(7A) Ruhpf>βかつRlhpf>βかつ
Guhpf<−βかつGlhpf<−β
(7B) Ruhpf<−βかつRlhpf<−βかつ
Guhpf>βかつGlhpf>β
(7C) Rbhpf>βかつRrhpf>βかつ
Gbhpf<−βかつGrhpf<−β
(7D) Rbhpf<−βかつRrhpf<−βかつ
Gbhpf>βかつGrhpf>β
That is, when the above condition is satisfied, the process proceeds to step ST22 and s = 0 is set. In other cases, the process proceeds to step ST23. In step ST23, the high-frequency component values Guhpf, Gbhpf, Glhpf, Grhpf of the known color component calculated by the high-frequency component calculation circuit 8a and the high-frequency component values Ruhpf, Rbhpf, Rlhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b are calculated. When Rrhpf satisfies any of the following conditions (7A) to (7D), the sign of the high-frequency component value of the known color component is different from the sign of the high-frequency component value of the insufficient color component, and it is determined that the condition 2 is satisfied.
(7A) Ruhpf> β and Rlhpf> β and Guhpf <−β and Glhpf <−β
(7B) Ruhpf <−β and Rlhpf <−β and Guhpf> β and Glhpf> β
(7C) Rbhpf> β and Rrhpf> β and Gbhpf <−β and Grhpf <−β
(7D) Rbhpf <−β and Rrhpf <−β and Gbhpf> β and Grhpf> β

すなわち、条件(7A)〜(7D)のいずれかが満たされるとき、ステップST24に進み、s=−1とし、それ以外のとき、ステップST25に進み、s=1とする。   That is, when any one of the conditions (7A) to (7D) is satisfied, the process proceeds to step ST24 and s = −1. Otherwise, the process proceeds to step ST25 and s = 1.

次に、比較回路7cで左上がり斜め方向にエッジが存在すると判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図8に示すフローに従って決定するここでステップST21では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Ruhpf、Rbhpf、Rlhpf、Rrhpfが上記の式(6A)〜(6D)をすべて満たすとき、不足色成分の高周波成分値が0であり、条件1が満たされると判断する。   Next, a case will be described in which the comparison circuit 7c determines that an edge is present in the diagonally upward direction. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. 8. In step ST21, the high-frequency component values Ruhpf, Rbhpf, Rlhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b are calculated. When Rrhpf satisfies all of the above equations (6A) to (6D), it is determined that the high frequency component value of the insufficient color component is 0 and the condition 1 is satisfied.

すなわち、上記の条件が満たされるとき、ステップST22に進み、s=0とする。また、それ以外のとき、ステップST23に進む。ステップST23では、高周波成分計算回路8aが計算した、既知色成分の高周波成分値Guhpf、Gbhpf、Glhpf、Grhpfおよび高周波成分計算回路8bが計算した、不足色成分の高周波成分値Ruhpf、Rbhpf、Rlhpf、Rrhpfが以下の条件(8A)〜(8D)のいずれかを満たすとき、既知色成分の高周波成分値と不足色成分の高周波成分値の符号が異なリ、条件2が満たされると判断する。
(8A) Ruhpf>βかつRrhpf>βかつ
Guhpf<−βかつGrhpf<−β
(8B) Ruhpf<−βかつRrhpf<−βかつ
Guhpf>βかつGrhpf>β
(8C) Rbhpf>βかつRlhpf>βかつ
Gbhpf<−βかつGlhpf<−β
(8D) Rbhpf<−βかつRlhpf<−βかつ
Gbhpf>βかつGlhpf>β
That is, when the above condition is satisfied, the process proceeds to step ST22 and s = 0 is set. In other cases, the process proceeds to step ST23. In step ST23, the high-frequency component values Guhpf, Gbhpf, Glhpf, Grhpf of the known color component calculated by the high-frequency component calculation circuit 8a and the high-frequency component values Ruhpf, Rbhpf, Rlhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b are calculated. When Rrhpf satisfies any of the following conditions (8A) to (8D), it is determined that the high-frequency component value of the known color component and the high-frequency component value of the insufficient color component are different and that the condition 2 is satisfied.
(8A) Ruhpf> β and Rrhpf> β and Guhpf <−β and Grhpf <−β
(8B) Ruhpf <−β and Rrhpf <−β and Guhpf> β and Grhpf> β
(8C) Rbhpf> β and Rlhpf> β and Gbhpf <−β and Glhpf <−β
(8D) Rbhpf <−β and Rlhpf <−β and Gbhpf> β and Glhpf> β

すなわち、条件(6A)〜(6D)のいずれかが満たされるとき、ステップST24に進み、s=−1とし、それ以外のとき、ステップST25に進み、s=1とする。   That is, when any one of the conditions (6A) to (6D) is satisfied, the process proceeds to step ST24 and s = −1. Otherwise, the process proceeds to step ST25 and s = 1.

なお、上記の例では、比較回路7cで右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合には(エッジが存在しないと判断した場合と同様に)、不足色成分の高周波成分値Ruhpf、Rbhpf、Rlhpf、Rrhpfが式(6A)〜(6D)をすべて満たすとき、不足色成分の高周波成分値が0であると判断しているが、比較回路7cで右上がり斜め方向にエッジが存在すると判断した場合には、式(6A)及び式(6C)をともに満たすとき、又は式(6B)及び式(6D)をともに満たすときに、不足色成分の高周波成分値が0であると判断し、比較回路7cで左上がり斜め方向にエッジが存在すると判断した場合には、式(6A)及び式(6D)をともに満たすとき、又は式(6B)及び式(6C)をともに満たすときに、不足色成分の高周波成分値が0であると判断しても良い。   In the above example, when it is determined by the comparison circuit 7c that an edge exists in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction (as in the case where it is determined that no edge exists) In addition, when the high-frequency component values Ruhpf, Rbhpf, Rlhpf, and Rrhpf of the insufficient color component satisfy all the expressions (6A) to (6D), it is determined that the high-frequency component value of the insufficient color component is 0. If the circuit 7c determines that an edge is present in the diagonally upward direction, the insufficient color is obtained when both the expressions (6A) and (6C) are satisfied, or when both the expressions (6B) and (6D) are satisfied. When it is determined that the high-frequency component value of the component is 0, and the comparison circuit 7c determines that an edge exists in the diagonally upward left direction, both the expressions (6A) and (6D) are satisfied Or equation (6B) and the formula (6C) when satisfying both high-frequency component value of the missing color components may be determined to be 0.

次に、比較回路7cで水平方向にエッジが存在すると判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図7に示すフローに従って決定する。ここでステップST11では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Ruhpf、Rbhpfが以下の条件(9)を満たすとき、不足色成分の高周波成分値が0であり、条件1が満たされると判断する。
(9) |Ruhpf|<βかつ|Rbhpf|<β
Next, a case where the comparison circuit 7c determines that an edge exists in the horizontal direction will be described. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST11, when the high frequency component values Ruhpf and Rbhpf of the insufficient color component calculated by the high frequency component calculation circuit 8b satisfy the following condition (9), the high frequency component value of the insufficient color component is 0, and the condition 1 Is determined to be satisfied.
(9) | Ruhpf | <β and | Rbhpf | <β

すなわち、上記の条件(9)が満たされるとき、ステップST12に進み、s=0とし、それ以外のときステップST13に進み、s=1とする。   That is, when the above condition (9) is satisfied, the process proceeds to step ST12, and s = 0 is set. Otherwise, the process proceeds to step ST13, and s = 1 is set.

次に、比較回路7cで垂直方向にエッジが存在すると判断した場合について述べる。この場合、係数決定回路11は、係数sの値を図7に示すフローに従って決定する。ここでステップST11では、高周波成分計算回路8bが計算した、不足色成分の高周波成分値Rlhpf、Rrhpfが以下の条件(10)を満たすとき、不足色成分の高周波成分値が0であり、条件1が満たされると判断する。
(10) |Rlhpf|<βかつ|Rrhpf|<β
Next, a case where the comparison circuit 7c determines that an edge exists in the vertical direction will be described. In this case, the coefficient determination circuit 11 determines the value of the coefficient s according to the flow shown in FIG. Here, in step ST11, when the high-frequency component values Rlhpf and Rrhpf of the insufficient color component calculated by the high-frequency component calculation circuit 8b satisfy the following condition (10), the high-frequency component value of the insufficient color component is 0, and the condition 1 Is determined to be satisfied.
(10) | Rlhpf | <β and | Rrhpf | <β

すなわち、上記の式(10)が満たされるとき、ステップST12に進み、s=0とし、それ以外のときステップST13に進み、s=1とする。   That is, when the above equation (10) is satisfied, the process proceeds to step ST12, and s = 0 is set. Otherwise, the process proceeds to step ST13, and s = 1 is set.

以上が係数決定回路11の動作である。   The above is the operation of the coefficient determination circuit 11.

次に減算器12の動作を説明する。減算器12は以下の式で計算される値ΔGを求める。
ΔG=G(i,j)−Glpf
Next, the operation of the subtractor 12 will be described. The subtractor 12 obtains a value ΔG calculated by the following equation.
ΔG = G (i, j) −Glpf

次に乗算器13、乗算器14、加算器15の動作を説明する。乗算器13は減算器12の出力値ΔGに除算器10cの出力値tを乗じた値を出力する。乗算器14は乗算器13の出力値に係数決定回路11の出力値sを乗じた値を出力する。加算器15はローパスフィルタ回路9bの出力値Rlpfに乗算器14の出力値を加算した値を出力する。   Next, operations of the multiplier 13, the multiplier 14, and the adder 15 will be described. The multiplier 13 outputs a value obtained by multiplying the output value ΔG of the subtractor 12 by the output value t of the divider 10 c. The multiplier 14 outputs a value obtained by multiplying the output value of the multiplier 13 by the output value s of the coefficient determination circuit 11. The adder 15 outputs a value obtained by adding the output value of the multiplier 14 to the output value Rlpf of the low-pass filter circuit 9b.

そして加算器15の出力する値が補間対象画素のR成分値R(i,j)として2次元メモリ6rに書き込まれる。   The value output from the adder 15 is written in the two-dimensional memory 6r as the R component value R (i, j) of the interpolation target pixel.

言い換えると、補間処理回路5内部では以下の式に従って、B画素に対し不足色成分値R(i,j)を補間する。
R(i,j)=Rlpf+s・t・(G(i,j)−Glpf)
In other words, in the interpolation processing circuit 5, the insufficient color component value R (i, j) is interpolated for the B pixel according to the following equation.
R (i, j) = Rlpf + s · t · (G (i, j) −Glpf)

補間処理回路5内部では以上に述べた補間方法に従って、全てのB画素に対するR色成分値が補間される。   In the interpolation processing circuit 5, the R color component values for all the B pixels are interpolated according to the interpolation method described above.

次に、R画素に対するB成分値を補間する方法について述べる。図16(A)〜(C)は2次元メモリ6r、6g、6bにR成分値、G成分値、B成分値が書き込まれている様子を、R画素を中心にして表した図である。図16(A)は2次元メモリ6rを表しており、図16(B)は2次元メモリ6gを表しており、図16(C)は2次元メモリ6bを表している。   Next, a method for interpolating B component values for R pixels will be described. FIGS. 16A to 16C are diagrams showing the R component value, the G component value, and the B component value written in the two-dimensional memories 6r, 6g, and 6b with the R pixel as the center. FIG. 16A shows the two-dimensional memory 6r, FIG. 16B shows the two-dimensional memory 6g, and FIG. 16C shows the two-dimensional memory 6b.

図14(A)〜(C)に記されているR成分値をB成分値に、B成分値をR成分値に置き換えれば図16(A)〜(C)となることは明らかである。従ってR画素に対するB成分値を補間する方法は、B画素に対するR成分値を補間する方法と同様に扱うことができる。   If the R component value shown in FIGS. 14A to 14C is replaced with the B component value and the B component value is replaced with the R component value, it is apparent that FIGS. 16A to 16C are obtained. Therefore, the method of interpolating the B component value for the R pixel can be handled in the same manner as the method of interpolating the R component value for the B pixel.

言い換えれば、R画素に対するB成分値を補間する方法はB画素に対するR成分を補間する方法と同様の文章で説明することができるので、詳細な説明は省略する。   In other words, since the method of interpolating the B component value for the R pixel can be described in the same sentence as the method of interpolating the R component for the B pixel, detailed description thereof is omitted.

以上の処理によりB画素に対するR成分値およびR画素に対するB成分値の補間が完了する。この時の2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を模式的に表すと図17(A)〜(C)のようになる。   Through the above processing, the interpolation of the R component value for the B pixel and the B component value for the R pixel is completed. FIGS. 17A to 17C schematically show how the R, G, and B component values are written in the two-dimensional memories 6r, 6g, and 6b at this time.

図17(A)〜(C)では全ての画素に対してR成分値、G成分値、B成分値が与えられている。すなわち、全ての不足色成分値の補間が終了したことになる。   In FIGS. 17A to 17C, the R component value, the G component value, and the B component value are given to all the pixels. That is, the interpolation of all the insufficient color component values is completed.

なお、HV平面上の座標(i,j)に存在する画素に関してJを既知色成分、Kを不足色成分としたとき、本発明の実施の形態による補間処理装置で行われる補間処理は、以下の式で表すことができる。
K(i,j)=Klpf+s・t(J(i,j)−Jlpf)
When J is a known color component and K is an insufficient color component for a pixel existing at coordinates (i, j) on the HV plane, the interpolation processing performed by the interpolation processing device according to the embodiment of the present invention is as follows. It can be expressed by the following formula.
K (i, j) = Klpf + s · t (J (i, j) −Jlpf)

ここでKlpfはローパスフィルタ回路9bで計算される既知色成分の低周波成分値であり、係数sは相関判別回路8における相関判別結果に応じて「1」、「0」、「−1」いずれかの値をとる係数であり、係数tは比率計算回路10の出力値であり、J(i,j)−Jlpfは既知色増分計算回路20の出力値であり、t(J(i,j)−Jlpf)は不足色増分計算回路30の出力値である。   Here, Klpf is the low-frequency component value of the known color component calculated by the low-pass filter circuit 9b, and the coefficient s is “1”, “0”, or “−1” depending on the correlation determination result in the correlation determination circuit 8. The coefficient t is the output value of the ratio calculation circuit 10, J (i, j) -Jlpf is the output value of the known color increment calculation circuit 20, and t (J (i, j ) −Jlpf) is an output value of the insufficient color increment calculation circuit 30.

本発明の実施の形態による補間処理装置の効果を以下に述べる。以下では説明を簡単にするため1次元方向に配列されたカラーフィルタを用いるが、カラーフィルタの配列が2次元平面上に配列された場合も同様の効果が得られることは明らかであろう。   The effects of the interpolation processing apparatus according to the embodiment of the present invention will be described below. In the following, a color filter arranged in a one-dimensional direction is used for the sake of simplicity, but it will be apparent that the same effect can be obtained when the arrangement of color filters is arranged on a two-dimensional plane.

図18(A)〜(C)は、Jで表される色成分とKで表される色成分からなるカラーフィルタおよびそのカラーフィルタから得られる色成分値を表す図である。すなわち、図18(A)〜(C)の横軸は画素の位置を表し、上部の「J」、「K」は、各画素の位置におけるカラーフィルタの色を表し、縦軸は色成分値の大きさを表し、「○」印は、各画素の色成分値を表す。また、各画素は横軸上の座標(i−1、i、i+1等)で表わされる。   18A to 18C are diagrams illustrating a color filter composed of a color component represented by J and a color component represented by K, and a color component value obtained from the color filter. That is, the horizontal axis of FIGS. 18A to 18C represents the pixel position, the upper “J” and “K” represent the color of the color filter at the position of each pixel, and the vertical axis represents the color component value. The symbol “◯” represents the color component value of each pixel. Each pixel is represented by coordinates (i-1, i, i + 1, etc.) on the horizontal axis.

ここで、図18(A)はJ成分とK成分の増減が一致する場合を表し、図18(B)はJ成分は変化するもののK成分はほとんど変化しない場合を表し、図18(C)はJ成分とK成分の増減が逆である場合を表す。   Here, FIG. 18A shows a case where the increase and decrease of the J component and the K component coincide with each other, FIG. 18B shows a case where the J component changes but the K component hardly changes, and FIG. Represents a case where the increase and decrease of the J component and the K component are opposite.

以下、図18(A)に表されるように、異なる色成分間の増減が一致する場合、「正の相関がある」と言い、図18(B)に表されるような、一方の色成分は増加または減少するものの、もう一方の色成分はほとんど変化しない場合、「相関がない」と言い、図18(C)に表されるような、異なる色成分間の増減が逆である場合、「負の相関がある」と言う。以下、J画素(Jのカラーフィルタで覆われた光電変換素子に対応した画素)の位置にK成分を補間する場合を例に説明を行う。   Hereinafter, as shown in FIG. 18A, when the increase / decrease between different color components coincides, it is said that there is “positive correlation”, and one color as shown in FIG. When the component increases or decreases but the other color component hardly changes, it is said that there is no correlation, and the increase / decrease between different color components as shown in FIG. 18C is reversed , "There is a negative correlation". Hereinafter, a case where the K component is interpolated at the position of the J pixel (the pixel corresponding to the photoelectric conversion element covered with the J color filter) will be described as an example.

なお、以下の説明では座標iの位置にある画素に対するJ成分値をJ(i)、K成分値をK(i)で表す。   In the following description, the J component value for the pixel at the coordinate i is represented by J (i), and the K component value is represented by K (i).

図19(A)〜(C)において、従来技術による補間により、座標i−2および座標iの位置にあるJ画素に与えられるK成分値を「●」印で表す。従来技術による補間では、J成分とK成分の信号変化には相似の関係があると仮定して補間を行う。例えば座標iの位置にあるJ画素(以下、補間対象画素と呼ぶ)に対するK成分値K(i)を補間する場合、補間対象画素近傍のJ画素(座標i−2および座標i+2の位置にあるJ画素)のJ成分値をJ成分の平均値Javeに置き換えた点と、補間対象画素におけるJ成分値J(i)に対応する点とで作られる三角形T1と、補間対象画素近傍のK画素(位置i−1、位置i+1にあるK画素)のK成分値をK成分の平均値Kaveに置き換えた点と、補間対象画素に与えられるK成分値K(i)とで作られる三角形T2が相似になるよう、補間処理を行う。   19A to 19C, K component values given to the J pixels at the positions of the coordinates i-2 and i are represented by “●” marks by interpolation according to the conventional technique. In the interpolation according to the prior art, interpolation is performed on the assumption that there is a similar relationship between signal changes of the J component and the K component. For example, when interpolating the K component value K (i) for the J pixel at the position of the coordinate i (hereinafter referred to as the interpolation target pixel), the J pixel in the vicinity of the interpolation target pixel (at the position of the coordinate i-2 and the coordinate i + 2). A triangle T1 formed by a point obtained by replacing the J component value of J pixel) with the average value Jave of the J component, and a point corresponding to the J component value J (i) in the interpolation target pixel, and K pixels in the vicinity of the interpolation target pixel A triangle T2 formed by replacing the K component value of (K pixel at position i−1, position i + 1) with the K component average value Kave and the K component value K (i) given to the interpolation target pixel is Interpolation processing is performed so that they are similar.

言い換えれば、J(i)−Javeで計算されるJ成分の増分に三角形T1と三角形T2の相似比(座標i−2から座標i+2までの距離に対する、座標i−1から座標i+1までの距離の比)をかけて、K成分の増分を求める。そして求めたK成分の増分をK成分の平均値に足して、J画素に対するK成分値を求める。図19(A)に表されるように、J成分とK成分の間に正の相関がある場合、J成分とK成分の信号変化は相似の関係にあるため、従来技術による補間では、K成分は適切に補間できる。一方、図19(B)に表されるように、J成分とK成分の間に相関がない場合や、図19(C)に表されるようにJ成分とK成分の間に負の相関がある場合、J成分とK成分の信号変化は相似の関係にないため、従来技術による補間では、補間誤差が発生する。   In other words, the similarity between the triangle T1 and the triangle T2 (the distance from the coordinate i-1 to the coordinate i + 1 with respect to the distance from the coordinate i-2 to the coordinate i + 2) is added to the increment of the J component calculated by J (i) -Jave. Ratio) to determine the increment of the K component. Then, the K component value for the J pixel is obtained by adding the obtained increment of the K component to the average value of the K component. As shown in FIG. 19A, when there is a positive correlation between the J component and the K component, the signal change between the J component and the K component has a similar relationship. The components can be interpolated appropriately. On the other hand, there is no correlation between the J component and the K component as shown in FIG. 19B, or a negative correlation between the J component and the K component as shown in FIG. 19C. When there is, there is no similar relationship between the signal changes of the J component and the K component, so that interpolation error occurs in the interpolation according to the conventional technique.

従来技術の補間で生じる補間誤差は以下のようにすれば解消できる。すなわち、J成分とK成分の間に負の相関がある場合は、J成分とK成分の増減は逆なので、K成分の平均値からK成分の増分を引いた値をJ画素に対するK成分値として求めればよい。また、J成分とK成分の間に相関がない場合は、K成分値はほとんど変化しないので、K成分の平均値そのものをJ画素に対するK成分値として求めてやればよい。本発明の実施の形態による補間処理装置によればこのような補間が可能になる。以下にその詳細を述べる。   Interpolation errors caused by conventional interpolation can be eliminated as follows. That is, when there is a negative correlation between the J component and the K component, the increase / decrease in the J component and the K component is opposite, so the value obtained by subtracting the increment of the K component from the average value of the K component is the K component value for the J pixel. As long as you ask. Further, when there is no correlation between the J component and the K component, the K component value hardly changes. Therefore, the average value of the K component itself may be obtained as the K component value for the J pixel. The interpolation processing apparatus according to the embodiment of the present invention enables such interpolation. Details are described below.

本発明の実施の形態による補間処理装置による補間処理は、1次元のカラーフィルタに対しては、以下の式で表すことができる。
K(i)=Klpf+s・t(J(i)−Jlpf)
The interpolation processing by the interpolation processing device according to the embodiment of the present invention can be expressed by the following equation for a one-dimensional color filter.
K (i) = Klpf + s · t (J (i) −Jlpf)

上記の式において、t(J(i)−Jlpf)がK成分の増分に対応し、KlpfがK成分の平均値に対応する。s=1とすると、K成分の平均値にK成分の増分を足した値をK成分値として求めることになり、s=0とするとK成分の平均値そのものをK成分値として求めることになり、s=−1とすると、K成分の平均値からK成分の増分を引いた値をK成分値として求めることになる。本発明による補間処理装置では、相関判別回路8においてJ成分とK成分の間の相関を判別し、J成分とK成分の間に正の相関がある場合、s=1とし、J成分とK成分の間に相関がない場合、s=0とし、J成分とK成分の間に負の相関がある場合、s=−1とするので、J成分とK成分の間の相関に応じて適切に補間を行うことができる。   In the above equation, t (J (i) −Jlpf) corresponds to the increment of the K component, and Klpf corresponds to the average value of the K component. When s = 1, the value obtained by adding the K component increment to the average value of the K component is obtained as the K component value. When s = 0, the average value of the K component itself is obtained as the K component value. , S = −1, a value obtained by subtracting the increment of the K component from the average value of the K component is obtained as the K component value. In the interpolation processing apparatus according to the present invention, the correlation discriminating circuit 8 discriminates the correlation between the J component and the K component, and when there is a positive correlation between the J component and the K component, s = 1 is set, and the J component and the K component When there is no correlation between the components, s = 0, and when there is a negative correlation between the J component and the K component, s = -1, so that it is appropriate depending on the correlation between the J component and the K component. Can be interpolated.

以下にt(J(i)−Jlpf)がJ成分から計算される増分に対応することの説明、およびJ成分とK成分の間の相関を判別して、sの値を決める方法についての説明を行う。   In the following description, t (J (i) -Jlpf) corresponds to the increment calculated from the J component, and a method for determining the value of s by determining the correlation between the J component and the K component. I do.

まず、t(J(i)−Jlpf)がK成分の増分に対応することの説明を行う。   First, it will be described that t (J (i) −Jlpf) corresponds to the increment of the K component.

tは以下の計算式で計算されるJdispとKdispの比、すなわち、Kdisp/Jdispで計算される値である。
Jdisp=1+{|J(i−2)−J(i+2)|}/2
Kdisp=1+|K(i−1)−K(i+1)|
t is a ratio of Jdisp and Kdisp calculated by the following formula, that is, a value calculated by Kdisp / Jdisp.
Jdisp = 1 + {| J (i−2) −J (i + 2) |} / 2
Kdisp = 1 + | K (i−1) −K (i + 1) |

ここで、JdispとKdispの意味について述べる。JdispとKdispの第2項は、それぞれ補間対象画素周辺でのJ成分およびK成分の変化量の大きさを表す値である。なお、Jdispの第2項を2で割っているが、これはJdispの計算に用いた画素間の距離が、Kdispの計算に用いた画素間の距離の2倍あるからである。   Here, the meaning of Jdisp and Kdisp will be described. The second term of Jdisp and Kdisp is a value representing the magnitude of the change amount of the J component and the K component around the interpolation target pixel, respectively. The second term of Jdisp is divided by 2. This is because the distance between pixels used in the calculation of Jdisp is twice the distance between pixels used in the calculation of Kdisp.

JdispとKdispは、それぞれ補間対象画素周辺でのJ成分およびK成分の変化量の大きさを表す値に1を足した値であるので、JdispおよびKdispも、J成分およびK成分の変化量の大きさを表す値といえる。   Jdisp and Kdisp are values obtained by adding 1 to the values indicating the magnitudes of changes in the J and K components around the interpolation target pixel, respectively. Therefore, Jdisp and Kdisp are also the values of the changes in the J and K components. It can be said that the value represents the size.

したがって、JdispとKdispの比、Kdisp/Jdispで計算されるtはJ成分の変化量とK成分の変化量の比を表している。J(i)−JlpfはJ成分の増分を表すので、t(J(i)−Jlpf)はJ成分の増分にJ成分の変化量とK成分の変化量の比をかけて、K成分の増分を計算している。   Accordingly, the ratio of Jdisp to Kdisp, t calculated by Kdisp / Jdisp represents the ratio of the change amount of the J component and the change amount of the K component. Since J (i) -Jlpf represents the increment of the J component, t (J (i) -Jlpf) is obtained by multiplying the increment of the J component by the ratio of the variation amount of the J component and the variation amount of the K component. The increment is being calculated.

図20(A)及び(B)を用いてさらに詳しく説明する。図20(A)は、K成分の増分K(i)−KlpfがJ成分の増分J(i)−Jlpfとほぼ等しい場合を表し、図20(B)はK成分の増分K(i)−KlpfがJ成分の増分J(i)−Jlpfのほぼ半分の場合を表す。JdispとKdispの計算式からも明らかなように、図20(A)の場合、JdispとKdispはほぼ同じ値となり、t=1となる。一方、図20(B)では、Kdispが図20(A)のおよそ半分となり、t=0.5となる。いずれも場合も、式t(J(i)−Jlpf)の計算結果は、K成分の増分とほぼ同じ値となる。すなわち、式t(J(i)−Jlpf)により、K成分の増分が計算されていることがわかる。   This will be described in more detail with reference to FIGS. 20A shows a case where the K component increment K (i) −Klpf is approximately equal to the J component increment J (i) −Jlpf, and FIG. 20B shows the K component increment K (i) −. This represents a case where Klpf is approximately half of the J component increment J (i) −Jlpf. As is apparent from the calculation formulas for Jdisp and Kdisp, in the case of FIG. 20A, Jdisp and Kdisp have substantially the same value, and t = 1. On the other hand, in FIG. 20B, Kdisp is approximately half that of FIG. 20A, and t = 0.5. In either case, the calculation result of the expression t (J (i) −Jlpf) is almost the same value as the increment of the K component. That is, it can be seen that the increment of the K component is calculated by the equation t (J (i) −Jlpf).

なお、JdispとKdispの第1項で1を加算している意味は以下の通りである。係数tは、KdispをJdispで割った値として計算される。ここでK(i−1)=K(i+1)のとき、Kdispの第1項が存在しないと、Kdispの値は0となる。一般的に、0による割り算は不可能なのでこのとき、tの値を計算できなくなる。このような、計算不能の状態を回避するために第1項で1を足している。   The meaning of adding 1 in the first term of Jdisp and Kdisp is as follows. The coefficient t is calculated as a value obtained by dividing Kdisp by Jdisp. Here, when K (i−1) = K (i + 1), if the first term of Kdisp does not exist, the value of Kdisp becomes 0. In general, since division by 0 is impossible, the value of t cannot be calculated at this time. In order to avoid such an incomputable state, 1 is added to the first term.

また、tの値に上限を設けることで過補正を防ぐこともできる。tはKdispをJdispで割ることで計算されるが、たとえば画像に含まれるノイズの影響でKdispの値が極端に大きくなったり、Jdispの値が極端に小さくなったりすると、tの値も必要以上に大きくなることがある。tの値が必要以上に大きくなると、K成分の増分を表す値、t(J(i)−Jlpf)も必要以上に大きくなり、その結果、求められる不足色成分値は必要以上に大きくなったり、必要以上に小さくなったりすることがある。すなわち、過補正がかかった状態で不足色成分値が求められてしまう。そこでtの値に上限を設け、例えば、tの値が1以上になった場合、t=1とするようにすれば、不足色成分値を補間する際に過補正がかかってしまうことを回避できる。   Moreover, overcorrection can be prevented by providing an upper limit for the value of t. t is calculated by dividing Kdisp by Jdisp. For example, if the value of Kdisp becomes extremely large or the value of Jdisp becomes extremely small due to the influence of noise included in the image, the value of t is also more than necessary. May become large. When the value of t becomes larger than necessary, the value representing the increment of the K component, t (J (i) −Jlpf), becomes larger than necessary, and as a result, the required insufficient color component value becomes larger than necessary. It may be smaller than necessary. That is, an insufficient color component value is obtained in a state where overcorrection is applied. Therefore, an upper limit is set to the value of t. For example, if the value of t is 1 or more, if t = 1, it is possible to avoid overcorrection when interpolating the insufficient color component value. it can.

また図20(A)及び(B)を用いた以上の説明では正の相関がある場合を例にしたが、負の相関がある場合も同様の効果が得られることは明らかであろう。   In the above description using FIGS. 20A and 20B, the case where there is a positive correlation is taken as an example, but it is obvious that the same effect can be obtained when there is a negative correlation.

次に、J成分とK成分の間の相関を判別する方法についての説明を行う。   Next, a method for determining the correlation between the J component and the K component will be described.

J成分とK成分の間の相関は、J成分とK成分の高周波成分を用いて判別することができる。図21(A)乃至(I)はJ成分とK成分の間の相関に応じた、J成分値、K成分値、J成分値の高周波成分JhpfおよびK成分値の高周波成分Khpfの変化の様子を表している。J成分とK成分の間に正の相関がある場合、図21(A)乃至(C)に表されるようにJhpfとKhpfの符号が一致する。J成分とK成分の間に相関がない場合、図21(D)乃至(F)に表されるようにKhpfの値は0となる。J成分とK成分の間に負の相関がある場合、図21(G)乃至(I)に表されるようにJhpfとKhpfの符号は逆になる。すなわち、Khpf=0の場合、J成分とK成分の間に相関はないと考え、s=0とし、JhpfとKhpfの符号が逆の場合、J成分とK成分の間に負の相関があると考えs=−1とし、それ以外の場合、s=1とすることで、J成分とK成分の間の相関に応じて適切に補間を行うことができる。   The correlation between the J component and the K component can be determined using the high frequency components of the J component and the K component. 21A to 21I show changes in the J component value, the K component value, the high frequency component Jhpf of the J component value, and the high frequency component Khpf of the K component value in accordance with the correlation between the J component and the K component. Represents. When there is a positive correlation between the J component and the K component, the signs of Jhpf and Khpf match as shown in FIGS. When there is no correlation between the J component and the K component, the value of Khpf is 0 as shown in FIGS. When there is a negative correlation between the J component and the K component, the signs of Jhpf and Khpf are reversed as shown in FIGS. That is, when Khpf = 0, it is considered that there is no correlation between the J component and the K component, and when s = 0 and the signs of Jhpf and Khpf are opposite, there is a negative correlation between the J component and the K component. Assuming that s = −1, and otherwise s = 1, interpolation can be appropriately performed according to the correlation between the J component and the K component.

なお、図21(D)乃至(F)では理想的な状態を考えているため、相関がない場合、Khpf=0となっているが、実際には画像に含まれるノイズその他の影響で、相関がない場合、Khpfの値は小さな値になる。したがって、本発明の実施の形態による補間処理装置では、Khpfの値が0であるかを判断する際、閾値βを用いることで、Khpfの計算誤差に対応している。すなわち、以下の条件(11)が満たされるとき、Khpfの値が0と考える。
(11) |Khpf|<β
In FIGS. 21D to 21F, an ideal state is considered, and Khpf = 0 when there is no correlation. However, the correlation is actually caused by noise and other effects included in the image. When there is no value, the value of Khpf becomes a small value. Therefore, in the interpolation processing apparatus according to the embodiment of the present invention, when determining whether the value of Khpf is 0, the threshold β is used to cope with the calculation error of Khpf. That is, the value of Khpf is considered to be 0 when the following condition (11) is satisfied.
(11) | Khpf | <β

同様に、JhpfとKhpfの符号が逆かどうかを判断する際も、閾値βを用いることで、JhpfおよびKhpfの計算誤差に対応している。すなわち、以下の条件(12A)、(12B)のいずれかが満たされるとき、JhpfとKhpfの符号が逆と判断する。
(12A) Khpf>βかつJhpf<−β
(12B) Khpf<−βかつJhpf>β
Similarly, when determining whether the signs of Jhpf and Khpf are opposite, the threshold β is used to deal with the calculation error of Jhpf and Khpf. That is, when any of the following conditions (12A) and (12B) is satisfied, it is determined that the signs of Jhpf and Khpf are opposite.
(12A) Khpf> β and Jhpf <−β
(12B) Khpf <−β and Jhpf> β

なお、本発明の実施の形態による補間処理装置では、エッジ検出回路7において、補間対象画素を中心にどの方向にエッジが存在するか判断し、その結果に応じて相関判別回路8で判別する相関の種類を変えている。すなわち、右上がり斜め方向または左上がり斜め方向にエッジが存在すると判断した場合は、正の相関があるのか、負の相関があるのか、相関がないのかを判別し、それ以外の場合は、正の相関があるのか、相関がないのかの判別を行い、負の相関については考慮しない。   In the interpolation processing apparatus according to the embodiment of the present invention, the edge detection circuit 7 determines in which direction the edge exists around the interpolation target pixel, and the correlation determination circuit 8 determines according to the result. The type of is changing. In other words, if it is determined that there is an edge in the diagonally upward right direction or the diagonally upward left direction, it is determined whether there is a positive correlation, a negative correlation, or no correlation. Whether or not there is a correlation is determined, and negative correlation is not considered.

これは以下のように説明できる。負の相関はエッジを横切るように色成分の変化を見た場合に発生しやすい。例えば赤系の色から緑系の色に変化するエッジを横切るように色成分の変化を見ると、R成分が減少する一方でG成分は増加し、R成分とG成分の間に負の相関が発生する。逆にエッジを横切らない場合、異なる色成分の間に負の相関が発生する可能性は低く、負の相関については考慮する必要がないと考えられる。したがって、エッジが存在しないと判断した場合、既知色成分と不足色成分の間に負の相関が発生することを考慮する必要はない。また、水平方向のエッジが存在する場合、補間対象画素を中心に水平方向に位置する画素の色成分の変化を見れば、エッジを横切ることはなく、負の相関を考慮しなくてもよい。本発明の実施の形態による補間処理装置では、水平方向のエッジが存在する場合は、補間対象画素を中心に水平方向に位置する画素のもつ色成分値のみを用いて補間処理を行っているので負の相関については考慮していない。垂直方向にエッジが存在する場合についても同様である。一方、右上がり斜め方向あるいは左上がり斜め方向にエッジが存在する場合、本発明の実施の形態による補間処理装置では、補間対象画素を中心に水平方向および垂直方向に位置する画素のもつ色成分値を用いて補間を行う。この場合は、色成分の変化を水平方向に見ても、垂直方向に見てもエッジを横切るため、負の相関も考慮に入れる必要がある。   This can be explained as follows. Negative correlations are likely to occur when looking at changes in color components across an edge. For example, when the change of the color component is observed so as to cross the edge that changes from a red color to a green color, the R component decreases while the G component increases, and a negative correlation is found between the R component and the G component. Will occur. On the contrary, when the edge is not crossed, it is unlikely that a negative correlation occurs between different color components, and it is considered that there is no need to consider the negative correlation. Therefore, when it is determined that no edge exists, it is not necessary to consider that a negative correlation occurs between the known color component and the insufficient color component. Further, when there is a horizontal edge, if the change in the color component of the pixel located in the horizontal direction around the pixel to be interpolated is observed, the edge is not crossed and negative correlation need not be considered. In the interpolation processing device according to the embodiment of the present invention, when there is a horizontal edge, the interpolation processing is performed using only the color component value of the pixel located in the horizontal direction centering on the interpolation target pixel. Negative correlation is not considered. The same applies to the case where an edge exists in the vertical direction. On the other hand, when there is an edge in the diagonally upward right direction or the diagonally upward left direction, the interpolation processing apparatus according to the embodiment of the present invention uses the color component values of pixels located in the horizontal and vertical directions centering on the interpolation target pixel. Interpolate using. In this case, since the change of the color component crosses the edge both in the horizontal direction and in the vertical direction, it is necessary to take into account the negative correlation.

要するにエッジの方向に適した相関判別を行うことができる。   In short, correlation determination suitable for the direction of the edge can be performed.

同様にローパスフィルタ回路9bや未知色増分計算回路30もエッジ検出回路7のエッジ検出結果に応じて内部で行う計算を変えることでエッジの方向に適した動作が可能になる。   Similarly, the low-pass filter circuit 9b and the unknown color increment calculation circuit 30 can perform operations suitable for the direction of the edge by changing the calculation performed internally according to the edge detection result of the edge detection circuit 7.

以上、本発明の実施の形態による補間処理装置を用いて本発明の実施の形態を述べたが本発明の実施の形態はこれに限るものではない。例えば本発明の実施の形態では補間処理を補間処理回路5によるハードウェア処理で実現したが、同様の処理をソフトウェア演算にて実現する構成としてもよい。   As mentioned above, although embodiment of this invention was described using the interpolation processing apparatus by embodiment of this invention, embodiment of this invention is not restricted to this. For example, in the embodiment of the present invention, the interpolation processing is realized by hardware processing by the interpolation processing circuit 5, but the same processing may be realized by software calculation.

また、補間処理回路5の構成も本発明の実施の形態で述べたものに限らない。たとえば2次元メモリ6r、6g、6bの代わりにラインメモリを用いてもよい。さらに、差分回路7h、7v、7p、7mやローパスフィルタ回路9a、9b等、補間処理回路5内部の回路で行う演算も本発明の実施の形態に述べたものに限らない。   Further, the configuration of the interpolation processing circuit 5 is not limited to that described in the embodiment of the present invention. For example, a line memory may be used instead of the two-dimensional memories 6r, 6g, 6b. Further, operations performed by the circuits inside the interpolation processing circuit 5 such as the difference circuits 7h, 7v, 7p, and 7m and the low-pass filter circuits 9a and 9b are not limited to those described in the embodiment of the present invention.

また、本発明の実施の形態ではG画素に対するR成分値、B成分値を補間する際、係数tや係数sの値を常に1とする例を記載したが、G画素に対するR成分値、B成分値の補間はこれに限るものではなく、例えば他の色成分値の補間同様、高周波成分を計算し、G成分とR成分、B成分の間に正の相関が存在するのか、負の相関が存在するのか、あるいは相関が存在しないのかを判別するようにしてもよい。   In the embodiment of the present invention, when the R component value and the B component value for the G pixel are interpolated, the values of the coefficient t and the coefficient s are always set to 1. However, the R component value for the G pixel, B The interpolation of component values is not limited to this. For example, as with the interpolation of other color component values, high-frequency components are calculated, and whether a positive correlation exists between the G component, the R component, and the B component, or a negative correlation. It may be determined whether or not there is a correlation.

上記の実施の形態ではカラーフィルタにベイヤ配列型のものを用いたが、カラーフィルタもこれに限定されるものではない。
また、上記の実施の形態では、2次元撮像素子として、R、G、Bの3つの色の色フィルタがベイヤ型に配置されたものが用いられているが、色フィルタの種類の数は3に限らず、本発明は一般的に言えば、第1から第N(Nは2以上の自然数)のN種類の異なる色成分のうち、第J(Jは1からNのいずれか一つ)の色成分値を有する画素(以下、補間対象画素と呼ぶ)に対し、第K(KはJを除く1からNのいずれか一つ)の色成分値を演算して、カラー画像を得る補間処理装置に適用可能である。
In the above embodiment, a Bayer array type color filter is used, but the color filter is not limited to this.
In the above-described embodiment, the two-dimensional image pickup device is used in which color filters of three colors R, G, and B are arranged in a Bayer shape, but the number of types of color filters is three. The present invention is not limited to this. Generally speaking, the first to Nth (N is a natural number equal to or greater than 2) N different color components, the Jth (J is any one of 1 to N). Interpolation for obtaining a color image by calculating the Kth (K is any one of 1 to N except for J) color component values of pixels having the following color component values (hereinafter referred to as interpolation target pixels). It is applicable to a processing device.

さらに、本発明の実施の形態では差分回路7h、7v、7p、7mおよび比較回路7cを用いてエッジの存在する方向を判別したが、これらの回路を設けず、常に高周波成分値を用いて、正の相関が存在するのか、負の相関が存在するのか、相関がないかを判別して補間を行うといった例も考えられる。   Further, in the embodiment of the present invention, the direction in which the edge exists is determined using the difference circuits 7h, 7v, 7p, and 7m and the comparison circuit 7c, but these circuits are not provided, and the high-frequency component value is always used. There may be an example in which interpolation is performed by determining whether a positive correlation exists, a negative correlation exists, or no correlation exists.

要するに、本発明の実施の形態をもとに様々な変形例を考えることが可能である。   In short, various modifications can be considered based on the embodiment of the present invention.

本発明の活用例として、撮像装置に適用できる。   As an application example of the present invention, it can be applied to an imaging apparatus.

本発明の実施の形態の補間処理装置を備えた撮像装置を示すブロック図である。It is a block diagram which shows the imaging device provided with the interpolation processing apparatus of embodiment of this invention. カラーフィルタの配列を示す図である。It is a figure which shows the arrangement | sequence of a color filter. (A)〜(C)は、2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を示す図である。(A)-(C) is a figure which shows the mode of the writing of the R, G, B component value to the two-dimensional memory 6r, 6g, 6b. (A)及び(B)は、2次元メモリ6r、6gへのR,G成分値の書き込みの様子を示す図である。(A) And (B) is a figure which shows the mode of the writing of the R and G component value to the two-dimensional memories 6r and 6g. 比較回路7cの動作を示すフローチャートである。It is a flowchart which shows operation | movement of the comparison circuit 7c. (A)〜(E)は、画像中のエッジの様子を示す図である。(A)-(E) are figures which show the mode of the edge in an image. 係数決定回路11の動作を示すフローチャートである。3 is a flowchart showing the operation of the coefficient determination circuit 11. 係数決定回路11の動作を示すフローチャートである。3 is a flowchart showing the operation of the coefficient determination circuit 11. (A)及び(B)は、2次元メモリ6b、6gへのB,G成分値の書き込みの様子を示す図である。(A) And (B) is a figure which shows the mode of the writing of the B and G component value to the two-dimensional memories 6b and 6g. (A)〜(C)は、2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を示す図である。(A)-(C) is a figure which shows the mode of the writing of the R, G, B component value to the two-dimensional memory 6r, 6g, 6b. (A)〜(C)は、2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を示す図である。(A)-(C) is a figure which shows the mode of the writing of the R, G, B component value to the two-dimensional memory 6r, 6g, 6b. (A)〜(C)は、2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を示す図である。(A)-(C) is a figure which shows the mode of the writing of the R, G, B component value to the two-dimensional memory 6r, 6g, 6b. (A)〜(C)は、2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を示す図である。(A)-(C) is a figure which shows the mode of the writing of the R, G, B component value to the two-dimensional memory 6r, 6g, 6b. (A)〜(C)は、2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を示す図である。(A)-(C) is a figure which shows the mode of the writing of the R, G, B component value to the two-dimensional memory 6r, 6g, 6b. 比較回路7cの動作を示すフローチャートである。It is a flowchart which shows operation | movement of the comparison circuit 7c. (A)〜(C)は、2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を示す図である。(A)-(C) is a figure which shows the mode of the writing of the R, G, B component value to the two-dimensional memory 6r, 6g, 6b. (A)〜(C)は、2次元メモリ6r、6g、6bへのR,G,B成分値の書き込みの様子を示す図である。(A)-(C) is a figure which shows the mode of the writing of the R, G, B component value to the two-dimensional memory 6r, 6g, 6b. (A)〜(C)は、J成分とK成分の変化の様子を示す図である。(A)-(C) are figures which show the mode of a change of J component and K component. (A)〜(C)は、従来技術による補間結果を示す図である。(A)-(C) are figures which show the interpolation result by a prior art. J成分とK成分の変化の様子を示す図である。It is a figure which shows the mode of a change of J component and K component. (A)〜(I)は、J成分とK成分およびその高周波成分の変化の様子を示す図である。(A)-(I) is a figure which shows the mode of a change of J component, K component, and its high frequency component.

符号の説明Explanation of symbols

8 相関判別回路、 8a 高周波成分計算回路、 8b 高周波成分計算回路、 11 係数決定回路、 9a 低周波成分計算回路、 9b 低周波成分計算回路、 10 比率計算回路、 10a 変化量計算回路、 10b 変化量計算回路、 10c 除算器、 12 減算器、 13 乗算器、 14 乗算器、 15 加算器、 20 既知色増分計算回路、 30 不足色増分計算回路。
8 correlation discrimination circuit, 8a high frequency component calculation circuit, 8b high frequency component calculation circuit, 11 coefficient determination circuit, 9a low frequency component calculation circuit, 9b low frequency component calculation circuit, 10 ratio calculation circuit, 10a change amount calculation circuit, 10b change amount Calculation circuit, 10c divider, 12 subtractor, 13 multiplier, 14 multiplier, 15 adder, 20 known color increment calculation circuit, 30 insufficient color increment calculation circuit.

Claims (24)

第1から第N(Nは2以上の自然数)のN種類の異なる色成分のうち、
第J(Jは1からNのいずれか一つ)の色成分値を有する画素(以下、補間対象画素と呼ぶ)に対し、
第K(KはJを除く1からNのいずれか一つ)の色成分値を演算して、カラー画像を得る補間処理装置において、
前記補間対象画素における第Kの色成分の低周波成分値を出力する不足色低周波成分計算手段と、
前記補間対象画素における第Kの色成分の増分値を出力する不足色増分計算手段と、
第Jの色成分と第Kの色成分の間に正の相関が存在するのか、負の相関が存在するのか、相関がないのかを判別する相関判別手段と、
前記相関判別手段における判別の結果に基づいて、前記不足色増分計算手段で計算された前記第Kの色成分の増分値と、前記不足色低周波成分計算手段で計算された前記第Kの色成分の低周波成分値との演算を行う演算手段と
前記補間対象画素を中心とした少なくとも2つ以上の方向から、エッジの存在する方向を検出するエッジ検出手段とを有し、
前記エッジ検出手段の検出結果に応じて、前記不足色低周波成分計算手段、前記不足色増分計算手段、及び前記相関判別手段で行われる計算が切り替えられる
ことを特徴とする補間処理装置。
Among the first to Nth (N is a natural number of 2 or more) N different color components,
For a pixel having a Jth color component value (J is any one of 1 to N) (hereinafter referred to as an interpolation target pixel),
In an interpolation processing apparatus that obtains a color image by calculating a Kth color component value (K is any one of 1 to N excluding J),
An insufficient color low frequency component calculating means for outputting a low frequency component value of the Kth color component in the interpolation target pixel;
An insufficient color increment calculating means for outputting an increment value of the Kth color component in the interpolation target pixel;
Correlation determining means for determining whether a positive correlation, a negative correlation, or no correlation exists between the Jth color component and the Kth color component;
Based on the result of discrimination in the correlation discriminating means, the increment value of the Kth color component calculated by the insufficient color increment calculating means and the Kth color calculated by the insufficient color low frequency component calculating means. Computing means for computing the low-frequency component value of the component ;
From at least two or more directions around the interpolation target pixel, it has a edge detecting means for detecting the direction in which the presence of an edge,
An interpolation processing apparatus , wherein calculations performed by the insufficient color low frequency component calculating means, the insufficient color increment calculating means, and the correlation determining means are switched in accordance with a detection result of the edge detecting means .
前記演算手段は、
前記相関判別手段により、前記第Jの色成分と前記第Kの色成分の間に正の相関が存在すると判断されたときは、前記第Kの色成分の増分値を、前記第Kの色成分の低周波成分値に加算し、
前記相関判別手段により、前記第Jの色成分と前記第Kの色成分の間に負の相関が存在すると判断されたときは、前記第Kの色成分の増分値を、前記第Kの色成分の低周波成分値から減算し、
前記相関判別手段により、前記第Jの色成分と前記第Kの色成分の間に相関がないと判断されたときは、前記第Kの色成分の低周波成分値に、前記第Kの色成分の増分値を加算も減算もせず出力する
ことを特徴とする請求項1に記載の補間処理装置。
The computing means is
When the correlation determining means determines that a positive correlation exists between the J-th color component and the K-th color component, the increment value of the K-th color component is used as the K-th color component. Add to the low frequency component value of the component,
When the correlation determining means determines that a negative correlation exists between the J-th color component and the K-th color component, the increment value of the K-th color component is used as the K-th color component. Subtract from the low frequency component value of the component,
When the correlation determining unit determines that there is no correlation between the Jth color component and the Kth color component, the low frequency component value of the Kth color component is set to the Kth color component. The interpolation processing apparatus according to claim 1, wherein the increment value of the component is output without addition or subtraction.
前記不足色低周波成分計算手段は、前記エッジ検出手段で検出されたエッジの方向に並んだ画素を用いて加重平均を計算することで、低周波成分を計算することを特徴とする請求項に記載の補間処理装置。 The lack of color a low-frequency component computing means, by calculating a weighted average using pixels arranged in the direction of the detected edge in said edge detection means, according to claim 1, characterized in that to calculate the low-frequency component The interpolation processing device described in 1. 前記相関判別手段は、
前記エッジ検出手段で、エッジがないと判断した場合、水平方向にエッジが存在すると判断した場合、及び垂直方向にエッジが存在すると判断した場合には、前記第Kの色成分の高周波成分値の絶対値が所定の閾値より小さいときは、係数の値を0とし、前記第Kの色成分の高周波成分値の絶対値が前記所定の閾値以上であるときは、前記係数の値を1とし、
前記エッジ検出手段で、右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合には、前記第Kの色成分の高周波成分値の絶対値が前記所定の閾値より小さいときは前記係数の値を1とし、前記第Kの色成分の高周波成分値の絶対値が前記所定の閾値以上であり、前記第Jの色成分の高周波成分値と前記第Kの色成分の高周波成分値の符号が異なるときは、前記係数の値を−1とし、前記第Kの色成分の高周波成分値が前記所定の閾値以上であり、前記第Jの色成分の高周波成分値と前記第Kの色成分の高周波成分値の符号が異ならないときは、前記係数の値を1とし、
前記演算手段は、
前記係数が1であれば、前記第Kの色成分の増分値を前記第Kの色成分の低周波成分値に加算し、
前記係数が−1であれば、前記第Kの色成分の増分値を前記第Kの色成分の低周波成分値から減算し、
前記係数が0であれば、前記第Kの色成分の低周波成分値に前記第Kの色成分の増分値を加算も減算もせずに、前記第Kの色成分の低周波成分値を補間処理結果として出力する
ことを特徴とする請求項に記載の補間処理装置。
The correlation determination means includes
When the edge detection unit determines that there is no edge, when it is determined that an edge exists in the horizontal direction, and when it is determined that an edge exists in the vertical direction, the high-frequency component value of the Kth color component is When the absolute value is smaller than the predetermined threshold value, the coefficient value is set to 0. When the absolute value of the high frequency component value of the Kth color component is equal to or larger than the predetermined threshold value, the coefficient value is set to 1.
When the edge detecting unit determines that an edge exists in the diagonally upward direction and when it is determined that an edge exists in the diagonally upward direction, the absolute value of the high-frequency component value of the Kth color component is When the value is smaller than a predetermined threshold, the value of the coefficient is set to 1, the absolute value of the high frequency component value of the Kth color component is greater than or equal to the predetermined threshold, and the high frequency component value of the Jth color component and the first When the sign of the high-frequency component value of the K color component is different, the coefficient value is set to −1, the high-frequency component value of the K-th color component is equal to or greater than the predetermined threshold value, and the J-th color component When the sign of the high frequency component value and the high frequency component value of the Kth color component are not different, the value of the coefficient is set to 1.
The computing means is
If the coefficient is 1, the increment value of the Kth color component is added to the low frequency component value of the Kth color component;
If the coefficient is -1, the increment value of the Kth color component is subtracted from the low frequency component value of the Kth color component;
If the coefficient is 0, the low frequency component value of the Kth color component is interpolated without adding or subtracting the increment value of the Kth color component to the low frequency component value of the Kth color component. The interpolation processing apparatus according to claim 1 , wherein the interpolation processing apparatus outputs the processing result.
前記不足色増分計算手段は、
前記補間対象画素における第Jの色成分の増分値を出力する既知色増分計算手段と、
前記補間対象画素における第Jの色成分の変化量に対する第Kの色成分の変化量の比を表す比率を出力する比率計算手段を有し、
前記第Kの色成分の増分値として、前記第Jの色成分の増分値に、前記比率を乗じた値を出力する
ことを特徴とする請求項1乃至のいずれかに記載の補間処理装置。
The insufficient color increment calculating means includes
A known color increment calculating means for outputting an increment value of the Jth color component in the interpolation target pixel;
A ratio calculating means for outputting a ratio representing a ratio of a change amount of the Kth color component to a change amount of the Jth color component in the interpolation target pixel;
As increment color component of the first K, the increment of the color components of the first J, interpolation processing apparatus according to any one of claims 1 to 4, characterized in that outputs a value obtained by multiplying the ratio .
前記比率計算手段は、前記エッジ検出手段で検出されたエッジの方向に並んだ画素を用いて、前記第Jの色成分の変化量と前記第Kの色成分の変化量を計算することを特徴とする請求項に記載の補間処理装置。 The ratio calculation means calculates the amount of change in the Jth color component and the amount of change in the Kth color component using pixels arranged in the direction of the edge detected by the edge detection means. The interpolation processing apparatus according to claim 5 . 前記既知色増分計算手段は、
前記補間対象画素における前記第Jの色成分の低周波成分値を計算する既知色低周波成分計算手段を有し、
前記第Jの色成分の増分値として、
前記補間対象画素における第Jの色成分値から、前記第Jの色成分の低周波成分値を引いた値を出力することを特徴とする
請求項に記載の補間処理装置。
The known color increment calculation means includes:
A known color low frequency component calculating means for calculating a low frequency component value of the Jth color component in the interpolation target pixel;
As an increment value of the Jth color component,
The interpolation processing apparatus according to claim 5 , wherein a value obtained by subtracting a low frequency component value of the Jth color component from a Jth color component value in the interpolation target pixel is output.
前記相関判別手段は、
前記補間対象画素における前記第Jの色成分の高周波成分値を出力する既知色高周波成分計算手段と、
前記補間対象画素における前記第Kの色成分の高周波成分値を出力する不足色高周波成分計算手段とを有し、
前記第Jの色成分の高周波成分値と前記第Kの色成分の高周波成分値とに基づき相関を判別することを特徴とする
請求項1乃至のいずれかに記載の補間処理装置。
The correlation determination means includes
A known color high-frequency component calculating means for outputting a high-frequency component value of the J-th color component in the interpolation target pixel;
A deficient color high frequency component calculating means for outputting a high frequency component value of the Kth color component in the interpolation target pixel;
Interpolation processing apparatus according to any one of claims 1 to 7, characterized in that to determine the correlation based on the frequency component values of the color components of the high-frequency component value and the first K color component of said first J.
前記相関判別手段は、
前記第Kの色成分の高周波成分値の絶対値があらかじめ定められた閾値より小さい(以下、「第1の条件」と言う)ときは、前記第Jの色成分と前記第Kの色成分の間に相関がないと判別することを特徴とする
請求項に記載の補間処理装置。
The correlation determination means includes
When the absolute value of the high-frequency component value of the Kth color component is smaller than a predetermined threshold (hereinafter referred to as “first condition”), the Jth color component and the Kth color component The interpolation processing apparatus according to claim 8 , wherein it is determined that there is no correlation between them.
前記相関判別手段は、前記第1の条件が満たされないときは、前記第Jの色成分と前記第Kの色成分の間に正の相関があると判別することを特徴とする請求項に記載の補間処理装置。 The correlation determining means, when the first condition is not satisfied, to claim 9, characterized in that determining that there is a positive correlation between the color components of the first K color components of said first J The interpolation processing apparatus described. 前記相関判別手段は、
前記第Jの色成分の高周波成分値の絶対値および前記第Kの色成分の高周波成分値の絶対値があらかじめ定められた閾値より大きく、かつ
前記第Jの色成分の高周波成分値および前記第Kの色成分の高周波成分値の符号が一致しない(以下、「第2の条件」と言う)とき、
前記第Jの色成分と前記第Kの色成分の間に負の相関があると判別することを特徴とする
請求項に記載の補間処理装置。
The correlation determination means includes
The absolute value of the high-frequency component value of the J-th color component and the absolute value of the high-frequency component value of the K-th color component are greater than a predetermined threshold, and the high-frequency component value of the J-th color component and the When the sign of the high-frequency component value of the K color component does not match (hereinafter referred to as “second condition”),
The interpolation processing apparatus according to claim 9 , wherein it is determined that there is a negative correlation between the Jth color component and the Kth color component.
前記相関判別手段は、前記第1の条件および前記第2の条件が満たされないとき、第Jの色成分と第Kの色成分の間に正の相関があると判別することを特徴とする請求項11に記載の補間処理装置。 The correlation determination unit determines that there is a positive correlation between the Jth color component and the Kth color component when the first condition and the second condition are not satisfied. Item 12. The interpolation processing device according to Item 11 . 不足色低周波成分計算手段と、不足色増分計算手段と、相関判別手段と、演算手段と、エッジ検出手段とを有する補間処理装置により実行される補間処理方法であって、
第1から第N(Nは2以上の自然数)のN種類の異なる色成分のうち、
第J(Jは1からNのいずれか一つ)の色成分値を有する画素(以下、補間対象画素と呼ぶ)に対し、
第K(KはJを除く1からNのいずれか一つ)の色成分値を演算して、カラー画像を得る補間処理方法において、
前記不足色低周波成分計算手段が、前記補間対象画素における第Kの色成分の低周波成分値を出力する不足色低周波成分計算ステップと、
前記不足色増分計算手段が、前記補間対象画素における第Kの色成分の増分値を出力する不足色増分計算ステップと、
前記相関判別手段が、第Jの色成分と第Kの色成分の間に正の相関が存在するのか、負の相関が存在するのか、相関がないのかを判別する相関判別ステップと、
前記演算手段が、前記相関判別ステップにおける判別の結果に基づいて、前記不足色増分計算ステップで計算された前記第Kの色成分の増分値と、前記不足色低周波成分計算ステップで計算された前記第Kの色成分の低周波成分値との演算を行う演算ステップと
前記エッジ検出手段が、前記補間対象画素を中心とした少なくとも2つ以上の方向から、エッジの存在する方向を検出するエッジ検出ステップとを有し、
前記エッジ検出ステップの検出結果に応じて、前記不足色低周波成分計算ステップ、前記不足色増分計算ステップ、及び前記相関判別ステップで行われる計算が切り替えられる
ことを特徴とする補間処理方法。
An interpolation processing method executed by an interpolation processing apparatus having an insufficient color low frequency component calculation means, an insufficient color increment calculation means, a correlation determination means, a calculation means, and an edge detection means,
Among the first to Nth (N is a natural number of 2 or more) N different color components,
For a pixel having a Jth color component value (J is any one of 1 to N) (hereinafter referred to as an interpolation target pixel),
In an interpolation processing method for calculating a K-th color component value (K is any one of 1 to N excluding J) to obtain a color image,
The insufficient color low frequency component calculating means for outputting a low frequency component value of the Kth color component in the interpolation target pixel;
An insufficient color increment calculating step in which the insufficient color increment calculating means outputs an increment value of the Kth color component in the interpolation target pixel;
A correlation determination step in which the correlation determination means determines whether a positive correlation, a negative correlation, or no correlation exists between the Jth color component and the Kth color component;
The calculation means is calculated in the increment value of the Kth color component calculated in the insufficient color increment calculation step and in the insufficient color low frequency component calculation step based on the determination result in the correlation determination step. A calculation step of calculating a low frequency component value of the Kth color component ;
It said edge detection means, at least two or more directions around the interpolation target pixel, possess an edge detection step of detecting a direction of the edge,
An interpolation processing method , wherein calculations performed in the insufficient color low frequency component calculation step, the insufficient color increment calculation step, and the correlation determination step are switched according to the detection result of the edge detection step .
前記演算ステップは、
前記相関判別ステップにより、前記第Jの色成分と前記第Kの色成分の間に正の相関が存在すると判断されたときは、前記第Kの色成分の増分値を、前記第Kの色成分の低周波成分値に加算し、
前記相関判別ステップにより、前記第Jの色成分と前記第Kの色成分の間に負の相関が存在すると判断されたときは、前記第Kの色成分の増分値を、前記第Kの色成分の低周波成分値から減算し、
前記相関判別ステップにより、前記第Jの色成分と前記第Kの色成分の間に相関がないと判断されたときは、前記第Kの色成分の低周波成分値に、前記第Kの色成分の増分値を加算も減算もせず出力する
ことを特徴とする請求項13に記載の補間処理方法。
The calculation step includes:
When it is determined by the correlation determination step that a positive correlation exists between the Jth color component and the Kth color component, an increment value of the Kth color component is set as the Kth color component. Add to the low frequency component value of the component,
When it is determined by the correlation determination step that a negative correlation exists between the Jth color component and the Kth color component, an increment value of the Kth color component is calculated as the Kth color component. Subtract from the low frequency component value of the component,
When it is determined by the correlation determination step that there is no correlation between the Jth color component and the Kth color component, the low frequency component value of the Kth color component is set to the Kth color component. The interpolation processing method according to claim 13 , wherein the increment value of the component is output without addition or subtraction.
前記不足色低周波成分計算ステップは、前記エッジ検出ステップで検出されたエッジの方向に並んだ画素を用いて加重平均を計算することで、低周波成分を計算することを特徴とする請求項13に記載の補間処理方法。 The lack of color a low-frequency component calculating step, the weighted average using pixels arranged in the direction of the edge detected by the edge detection step to calculate the claim 13, characterized in that to calculate the low-frequency component The interpolation processing method described in 1. 前記相関判別ステップは、
前記エッジ検出ステップで、エッジがないと判断した場合、水平方向にエッジが存在すると判断した場合、及び垂直方向にエッジが存在すると判断した場合には、前記第Kの色成分の高周波成分値の絶対値が所定の閾値より小さいときは、係数の値を0とし、前記第Kの色成分の高周波成分値の絶対値が前記所定の閾値以上であるときは、前記係数の値を1とし、
前記エッジ検出ステップで、右上がり斜め方向にエッジが存在すると判断した場合、及び左上がり斜め方向にエッジが存在すると判断した場合には、前記第Kの色成分の高周波成分値の絶対値が前記所定の閾値より小さいときは前記係数の値を1とし、前記第Kの色成分の高周波成分値の絶対値が前記所定の閾値以上であり、前記第Jの色成分の高周波成分値と前記第Kの色成分の高周波成分値の符号が異なるときは、前記係数の値を−1とし、前記第Kの色成分の高周波成分値が前記所定の閾値以上であり、前記第Jの色成分の高周波成分値と前記第Kの色成分の高周波成分値の符号が異ならないときは、前記係数の値を1とし、
前記演算ステップは、
前記係数が1であれば、前記第Kの色成分の増分値を前記第Kの色成分の低周波成分値に加算し、
前記係数が−1であれば、前記第Kの色成分の増分値を前記第Kの色成分の低周波成分値から減算し、
前記係数が0であれば、前記第Kの色成分の低周波成分値に前記第Kの色成分の増分値を加算も減算もせずに、前記第Kの色成分の低周波成分値を補間処理結果として出力する
ことを特徴とする請求項13に記載の補間処理方法。
The correlation determination step includes
In the edge detection step, when it is determined that there is no edge, when it is determined that an edge exists in the horizontal direction, and when it is determined that an edge exists in the vertical direction, the high-frequency component value of the Kth color component is determined. When the absolute value is smaller than the predetermined threshold value, the coefficient value is set to 0. When the absolute value of the high frequency component value of the Kth color component is equal to or larger than the predetermined threshold value, the coefficient value is set to 1.
In the edge detection step, when it is determined that an edge exists in the diagonally upward direction, and when it is determined that an edge exists in the diagonally upward direction, the absolute value of the high-frequency component value of the Kth color component is When the value is smaller than a predetermined threshold, the value of the coefficient is set to 1, the absolute value of the high frequency component value of the Kth color component is greater than or equal to the predetermined threshold, and the high frequency component value of the Jth color component and the first When the sign of the high-frequency component value of the K color component is different, the coefficient value is set to −1, the high-frequency component value of the K-th color component is equal to or greater than the predetermined threshold value, and the J-th color component When the sign of the high frequency component value and the high frequency component value of the Kth color component are not different, the value of the coefficient is set to 1.
The calculation step includes:
If the coefficient is 1, the increment value of the Kth color component is added to the low frequency component value of the Kth color component;
If the coefficient is -1, the increment value of the Kth color component is subtracted from the low frequency component value of the Kth color component;
If the coefficient is 0, the low frequency component value of the Kth color component is interpolated without adding or subtracting the increment value of the Kth color component to the low frequency component value of the Kth color component. It outputs as a processing result. The interpolation processing method of Claim 13 characterized by the above-mentioned.
前記不足色増分計算手段が、既知色増分計算手段と、比率計算手段とを有し、
前記不足色増分計算ステップは、
前記既知色増分計算手段が、前記補間対象画素における第Jの色成分の増分値を出力する既知色増分計算ステップと、
前記比率計算手段が、前記補間対象画素における第Jの色成分の変化量に対する第Kの色成分の変化量の比を表す比率を出力する比率計算ステップを有し、
前記第Kの色成分の増分値として、前記第Jの色成分の増分値に、前記比率を乗じた値を出力する
ことを特徴とする請求項13乃至16のいずれかに記載の補間処理方法。
The insufficient color increment calculating means includes a known color increment calculating means and a ratio calculating means,
The insufficient color increment calculation step includes:
A known color increment calculating step in which the known color increment calculating means outputs an increment value of the Jth color component in the interpolation target pixel;
The ratio calculating means includes a ratio calculating step of outputting a ratio representing a ratio of a change amount of the Kth color component to a change amount of the Jth color component in the interpolation target pixel;
The interpolation processing method according to any one of claims 13 to 16 , wherein a value obtained by multiplying the increment value of the Jth color component by the ratio is output as the increment value of the Kth color component. .
前記比率計算ステップは、前記エッジ検出ステップで検出されたエッジの方向に並んだ画素を用いて、前記第Jの色成分の変化量と前記第Kの色成分の変化量を計算することを特徴とする請求項17に記載の補間処理方法。 In the ratio calculation step, the change amount of the J-th color component and the change amount of the K-th color component are calculated using pixels arranged in the direction of the edge detected in the edge detection step. The interpolation processing method according to claim 17 . 前記既知色増分計算手段が、既知色低周波成分計算手段を有し、
前記既知色増分計算ステップは、
前記既知色低周波成分計算手段が、前記補間対象画素における前記第Jの色成分の低周波成分値を計算する既知色低周波成分計算ステップを有し、
前記第Jの色成分の増分値として、
前記補間対象画素における第Jの色成分値から、前記第Jの色成分の低周波成分値を引いた値を出力することを特徴とする
請求項17に記載の補間処理方法。
The known color increment calculating means includes known color low frequency component calculating means;
The known color increment calculation step includes:
The known color low frequency component calculating means includes a known color low frequency component calculating step of calculating a low frequency component value of the J-th color component in the interpolation target pixel;
As an increment value of the Jth color component,
The interpolation processing method according to claim 17 , wherein a value obtained by subtracting a low-frequency component value of the J-th color component from a J-th color component value in the interpolation target pixel is output.
前記相関判別手段が、既知色高周波成分計算手段と、不足色高周波成分計算手段とを有し、
前記相関判別ステップは、
前記既知色高周波成分計算手段が、前記補間対象画素における前記第Jの色成分の高周波成分値を出力する既知色高周波成分計算ステップと、
前記不足色高周波成分計算手段が、前記補間対象画素における前記第Kの色成分の高周波成分値を出力する不足色高周波成分計算ステップとを有し、
前記第Jの色成分の高周波成分値と前記第Kの色成分の高周波成分値とに基づき相関を判別することを特徴とする
請求項13乃至19のいずれかに記載の補間処理方法。
The correlation determination means includes known color high frequency component calculation means and insufficient color high frequency component calculation means,
The correlation determination step includes
The known color high frequency component calculating means for outputting a high frequency component value of the Jth color component in the interpolation target pixel;
The insufficient color high-frequency component calculating means includes an insufficient color high-frequency component calculating step of outputting a high-frequency component value of the K-th color component in the interpolation target pixel;
The interpolation processing method according to claim 13 , wherein the correlation is determined based on a high-frequency component value of the J-th color component and a high-frequency component value of the K-th color component.
前記相関判別ステップは、
前記第Kの色成分の高周波成分値の絶対値があらかじめ定められた閾値より小さい(以下、「第1の条件」と言う)ときは、前記第Jの色成分と前記第Kの色成分の間に相関がないと判別することを特徴とする
請求項20に記載の補間処理方法。
The correlation determination step includes
When the absolute value of the high-frequency component value of the Kth color component is smaller than a predetermined threshold (hereinafter referred to as “first condition”), the Jth color component and the Kth color component The interpolation processing method according to claim 20 , wherein it is determined that there is no correlation between them.
前記相関判別ステップは、前記第1の条件が満たされないときは、前記第Jの色成分と前記第Kの色成分の間に正の相関があると判別することを特徴とする請求項21に記載の補間処理方法。 The correlation determination step, when said first condition is not satisfied, the claim 21, characterized in that to determine that between color components of the first K color components of said first J is a positive correlation The interpolation processing method described. 前記相関判別ステップは、
前記第Jの色成分の高周波成分値の絶対値および前記第Kの色成分の高周波成分値の絶対値があらかじめ定められた閾値より大きく、かつ
前記第Jの色成分の高周波成分値および前記第Kの色成分の高周波成分値の符号が一致しない(以下、「第2の条件」と言う)とき、
前記第Jの色成分と前記第Kの色成分の間に負の相関があると判別することを特徴とする
請求項21に記載の補間処理方法。
The correlation determination step includes
The absolute value of the high-frequency component value of the J-th color component and the absolute value of the high-frequency component value of the K-th color component are greater than a predetermined threshold, and the high-frequency component value of the J-th color component and the When the sign of the high-frequency component value of the K color component does not match (hereinafter referred to as “second condition”),
The interpolation processing method according to claim 21 , wherein it is determined that there is a negative correlation between the Jth color component and the Kth color component.
前記相関判別ステップは、前記第1の条件および前記第2の条件が満たされないとき、第Jの色成分と第Kの色成分の間に正の相関があると判別することを特徴とする請求項23に記載の補間処理方法。 The correlation determination step determines that there is a positive correlation between the Jth color component and the Kth color component when the first condition and the second condition are not satisfied. Item 24. The interpolation processing method according to Item 23 .
JP2006210865A 2006-08-02 2006-08-02 Interpolation processing apparatus and interpolation processing method Expired - Fee Related JP4688753B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006210865A JP4688753B2 (en) 2006-08-02 2006-08-02 Interpolation processing apparatus and interpolation processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006210865A JP4688753B2 (en) 2006-08-02 2006-08-02 Interpolation processing apparatus and interpolation processing method

Publications (2)

Publication Number Publication Date
JP2008042313A JP2008042313A (en) 2008-02-21
JP4688753B2 true JP4688753B2 (en) 2011-05-25

Family

ID=39176885

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006210865A Expired - Fee Related JP4688753B2 (en) 2006-08-02 2006-08-02 Interpolation processing apparatus and interpolation processing method

Country Status (1)

Country Link
JP (1) JP4688753B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5272581B2 (en) 2008-08-25 2013-08-28 ソニー株式会社 Image processing apparatus, imaging apparatus, image processing method, and program
JP5248368B2 (en) * 2009-03-06 2013-07-31 株式会社東芝 Image processing device
JP5631769B2 (en) * 2011-02-17 2014-11-26 株式会社東芝 Image processing device
CN102938843B (en) * 2012-11-22 2014-12-03 华为技术有限公司 Image processing method, image processing device and imaging device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001292452A (en) * 2000-04-07 2001-10-19 Casio Comput Co Ltd Image pickup device and processing method for color image pickup signal
JP2005210274A (en) * 2004-01-21 2005-08-04 Mitsubishi Electric Corp Pixel signal processing method and apparatus
JP2006115408A (en) * 2004-10-18 2006-04-27 Mitsubishi Electric Corp Pixel signal generation device, imaging device, and pixel signal generation method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001292452A (en) * 2000-04-07 2001-10-19 Casio Comput Co Ltd Image pickup device and processing method for color image pickup signal
JP2005210274A (en) * 2004-01-21 2005-08-04 Mitsubishi Electric Corp Pixel signal processing method and apparatus
JP2006115408A (en) * 2004-10-18 2006-04-27 Mitsubishi Electric Corp Pixel signal generation device, imaging device, and pixel signal generation method

Also Published As

Publication number Publication date
JP2008042313A (en) 2008-02-21

Similar Documents

Publication Publication Date Title
JP4289419B2 (en) Imaging device, defective pixel correction device, processing method thereof, and program
KR100780932B1 (en) Color interpolation method and device
JP6046927B2 (en) Image processing apparatus and control method thereof
JP2005159957A (en) Color interpolation method
US8253829B2 (en) Image processing apparatus, imaging apparatus, and image processing method
US7433547B2 (en) Image signal processing apparatus
US7643074B2 (en) Pixel signal processing apparatus and pixel signal processing method
JP4688753B2 (en) Interpolation processing apparatus and interpolation processing method
JP3926363B2 (en) Pixel signal processing apparatus and pixel signal processing method
US8773556B2 (en) Signal processing device, imaging device, and signal processing method for color interpolation
US20100134661A1 (en) Image processing apparatus, image processing method and program
JP4624054B2 (en) Noise reduction device, noise reduction method, and imaging device
JP2009194721A (en) Image signal processing device, image signal processing method, and imaging device
JP2013232829A (en) Image processing device and image processing method and program
JP5250315B2 (en) Signal processing device, imaging device, and synchronization processing program
JPH11355667A (en) Picture element signal processor
US8154627B2 (en) Imaging device
JP2003134523A (en) Image pickup apparatus and method
JP6422500B2 (en) Imaging apparatus and imaging method
JP2009017583A (en) Image processing device
JP4197821B2 (en) Image processing device
JP3926019B2 (en) Imaging device
JP5106221B2 (en) Imaging device
JP3926023B2 (en) Imaging device
JP4334484B2 (en) Pixel signal processing apparatus and method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090128

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101119

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101221

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110121

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

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

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140225

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees