JP4703666B2 - Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium - Google Patents

Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium Download PDF

Info

Publication number
JP4703666B2
JP4703666B2 JP2008029767A JP2008029767A JP4703666B2 JP 4703666 B2 JP4703666 B2 JP 4703666B2 JP 2008029767 A JP2008029767 A JP 2008029767A JP 2008029767 A JP2008029767 A JP 2008029767A JP 4703666 B2 JP4703666 B2 JP 4703666B2
Authority
JP
Japan
Prior art keywords
pixel
color signal
directionality
color
image processing
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
JP2008029767A
Other languages
Japanese (ja)
Other versions
JP2008125132A (en
JP2008125132A5 (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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP2008029767A priority Critical patent/JP4703666B2/en
Publication of JP2008125132A publication Critical patent/JP2008125132A/en
Publication of JP2008125132A5 publication Critical patent/JP2008125132A5/ja
Application granted granted Critical
Publication of JP4703666B2 publication Critical patent/JP4703666B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、複数種類の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いた補間処理により生成する画像処理装置、これを用いた単板式のディジタルカメラ、ビデオカメラおよびカメラ付き携帯電話装置などの撮影装置、この画像処理装置を用いた画像処理方法、これをコンピュータに実行させるための画像処理プログラムおよびこの画像処理プログラムを格納したコンピュータ読み出し可能な可読記録媒体に関する。   According to the present invention, from a color signal output from a solid-state imaging device in which a plurality of types of color filters are discretely arranged in each pixel unit, all color signals in each pixel are obtained, and color signals of a target pixel and its neighboring pixels are obtained. Image processing apparatus generated by interpolation processing used, single-plate digital camera using the same, photographing apparatus such as video camera and camera-equipped mobile phone apparatus, image processing method using the image processing apparatus, and execution of this on a computer The present invention relates to an image processing program for causing a computer to read and a computer readable recording medium storing the image processing program.

従来、例えばディジタルカメラやビデオカメラなどで用いられているCCDやCMOSなどの固体撮像素子からは、一般に、光の明るさに関する情報のみが出力される。    Conventionally, only information relating to the brightness of light is generally output from a solid-state imaging device such as a CCD or CMOS used in, for example, a digital camera or a video camera.

したがって、固体撮像素子が一つである単板式カメラでは、色情報を得るために、CCDに含まれる1画素毎に一つの色成分のみを通過させる色フィルタがCCDの前に被せられ、動作時に各画素部から対応する色成分をそれぞれ出力するように構成されている。例えば原色フィルタの場合、色成分の種類は三原色のR(赤)、G(緑)およびB(青)の3種類である。    Therefore, in a single-plate camera with one solid-state image sensor, a color filter that passes only one color component for each pixel included in the CCD is placed in front of the CCD in order to obtain color information. Each pixel unit is configured to output a corresponding color component. For example, in the case of a primary color filter, there are three types of color components: R (red), G (green), and B (blue) of the three primary colors.

これらの色フィルタの各色成分の配列には、いくつかの種類が提案されている。その代表的なものとして、図11に示すようなベイヤ配列が挙げられる。このベイヤ配列は、輝度信号に寄与する割合が大きいGが市松状に配置され、残りの箇所にRおよびBが市松状に配置されている。    Several types of arrangement of each color component of these color filters have been proposed. A typical example is a Bayer array as shown in FIG. In this Bayer array, G having a large contribution to the luminance signal is arranged in a checkered pattern, and R and B are arranged in a checkered pattern in the remaining portions.

このようなベイヤ配列などの色フィルタが被せられたCCDから信号出力された時点では、各画素毎にRGBの色成分の中で1色分の色情報しか得られていない。    At the time when a signal is output from the CCD covered with such a color filter such as a Bayer array, only color information for one color among the RGB color components is obtained for each pixel.

そこで、画像処理部によって、各画素毎に残り2色分の情報を周辺画素の色信号値から推定して算出することにより、残りの色情報を得るという補間処理が行われている。    Therefore, the image processing unit performs interpolation processing for obtaining the remaining color information by estimating and calculating the information for the remaining two colors for each pixel from the color signal values of the surrounding pixels.

さらに、CCDにより得られた各画素毎の1色分の色情報に対しても、注目画素自体の色信号値およびその周辺画素(近傍画素)の色信号値から補間処理が行われることがある。    Furthermore, interpolation processing may be performed on the color information for one color for each pixel obtained by the CCD from the color signal value of the pixel of interest itself and the color signal value of the surrounding pixels (neighboring pixels). .

以下に、従来の補間処理法であるバイリニア法について、図12を用いて説明する。    Below, the bilinear method which is the conventional interpolation processing method is demonstrated using FIG.

図12(a)は注目画素の色成分がGである場合のベイヤ配列を示す図であり、図12(b)は注目画素の色成分がRまたはBである場合のベイヤ配列を示す図である。なお、記号PおよびQはそれぞれ色成分RおよびB、またはBおよびRを表しており、PがRを表す場合にはQはBを表し、逆にPがBを表す場合にはQはRを表すものとする。    FIG. 12A is a diagram illustrating a Bayer array when the color component of the target pixel is G, and FIG. 12B is a diagram illustrating the Bayer array when the color component of the target pixel is R or B. is there. The symbols P and Q represent the color components R and B, or B and R, respectively. When P represents R, Q represents B. Conversely, when P represents B, Q represents R. .

色フィルタがベイヤ配列である場合のバイリニア法における補間式(式1)は、以下の通りである。
(式1)
図12(a)に示すように注目画素がG33の場合(注目画素の色要素はG)、式1は、
Go=G33 または Go=(G33×4+G22+G42+G24+G44)/8 Po=(P32+P34)/2
Qo=(Q23+Q43)/2
である。
The interpolation formula (Formula 1) in the bilinear method when the color filter is a Bayer array is as follows.
(Formula 1)
When the pixel of interest is G33 as shown in FIG. 12A (the color element of the pixel of interest is G), Equation 1 is
Go = G33 or Go = (G33 × 4 + G22 + G42 + G24 + G44) / 8 Po = (P32 + P34) / 2
Qo = (Q23 + Q43) / 2
It is.

図12(b)に示すように注目画素がP33の場合(注目画素の色要素はRまたはB)、式1は、
Go=(G32+G23+G43+G34)/4
Po=P33
Qo=(Q22+Q42+Q24+Q44)/4
である。
As shown in FIG. 12B, when the target pixel is P33 (the color element of the target pixel is R or B), Equation 1 is
Go = (G32 + G23 + G43 + G34) / 4
Po = P33
Qo = (Q22 + Q42 + Q24 + Q44) / 4
It is.

但し、Go:注目画素の出力G信号
Po:注目画素の出力P信号
Qo:注目画素の出力Q信号
このとき、(P,Q)=(R,B)または(B,R)
しかしながら、上記従来のバイリニア法を用いて、白から黒に変化する画像に対して色信号の補間処理を行った場合、エッジ部分で偽の色信号(以下、偽色信号という)が発生することが知られている。
However, Go: Output G signal of the target pixel Po: Output P signal of the target pixel Qo: Output Q signal of the target pixel At this time, (P, Q) = (R, B) or (B, R)
However, when color signal interpolation processing is performed on an image that changes from white to black using the conventional bilinear method, a false color signal (hereinafter referred to as a false color signal) is generated at the edge portion. It has been known.

このような偽色信号を減少させる方法として、例えば特許文献1に、色の相関性を利用して偽色信号の発生を抑制した補間処理法が提案されている。    As a method for reducing such false color signals, for example, Patent Document 1 proposes an interpolation processing method that suppresses the generation of false color signals by utilizing the correlation of colors.

一般的な画像の特徴として、「色信号の局所的な領域において、特定の色成分の低域成分と、高域成分との比は他の色成分においても等しい」という性質と、「色信号の局所的な領域において、G信号とR信号との差、またはG信号とB信号との差は、隣接画素間においてほぼ等しい」という性質がある。    As a general image feature, “in the local region of the color signal, the ratio of the low-frequency component of the specific color component to the high-frequency component is the same in other color components” and “the color signal In the local region, the difference between the G signal and the R signal, or the difference between the G signal and the B signal is substantially equal between adjacent pixels.

これらの性質を利用して、特許文献1の補間処理法では、ベイヤ配列に配置された色信号から、垂直方向(縦方向)と水平方向(横方向)との相関性が検出され、この相関性を用いて補間処理が行われている。具体的には、垂直方向に相関を有する場合の補間処理による色信号と、水平方向に相関を有する場合の補間処理による色信号とが予め計算され、垂直方向の相関性と水平方向の相関性との強度に応じて、各方向性の補間処理で求めた色信号を混ぜ合わせる処理が行われている。
特許第2931520号公報
By utilizing these properties, the interpolation processing method of Patent Document 1 detects the correlation between the vertical direction (vertical direction) and the horizontal direction (horizontal direction) from the color signals arranged in the Bayer array. Interpolation processing is performed using characteristics. Specifically, the color signal by the interpolation process when there is a correlation in the vertical direction and the color signal by the interpolation process when there is a correlation in the horizontal direction are calculated in advance, and the correlation in the vertical direction and the correlation in the horizontal direction are calculated. In accordance with the intensity, the color signal obtained by the interpolation processing for each direction is mixed.
Japanese Patent No. 2931520

ところが、上記特許文献1に記載されている従来の補間処理法であっても、バイリニア法を用いた場合に比べて偽色信号が低減されている。しかしながら、一般的な画像では、垂直方向(縦方向)および水平方向(横方向)以外にも、様々な方向のエッジが多数存在する。特許文献1の補間処理法では、このように多数存在するエッジ方向に対して、垂直方向および水平方向の2種類の相関性データ(相関性の強度)に応じて、2方向の補間処理によって得られた色信号を混ぜ合わせているため、斜め方向のエッジによって偽色信号が発生する場合がある。    However, even with the conventional interpolation processing method described in Patent Document 1, the false color signal is reduced as compared with the case where the bilinear method is used. However, in a general image, there are many edges in various directions other than the vertical direction (longitudinal direction) and the horizontal direction (lateral direction). In the interpolation processing method of Patent Document 1, with respect to a large number of edge directions as described above, it is obtained by interpolation processing in two directions according to two types of correlation data (correlation strength) in the vertical direction and the horizontal direction. Since the received color signals are mixed, a false color signal may be generated by an oblique edge.

例えば、CCDなどの固体撮像素子が図13(b)に示すようなカラーフィルタを有し、A/D変換によって図13(a)に示すようなモノクロの色信号が得られた場合について説明する。    For example, a case where a solid-state imaging device such as a CCD has a color filter as shown in FIG. 13B and a monochrome color signal as shown in FIG. 13A is obtained by A / D conversion will be described. .

図13(a)は、垂直方向からやや右上側に傾いたエッジ部分の一部に相当する。図13(a)の色信号値に対して、特許文献1に記載されているように、5画素×3画素の色差を用いた相関により補間処理を行うと、各色信号は、
Rv=G33+(R32+R34)/2−(G31+2×G33+G35)/4
=64
Gv=G33
=2
Bv=G33+B23−G23
=G33+B23−{B23+(G22+G24)/2−(B21+2×B23+B25)/4}
=−60
Rh=G33+R32−G32
=G33+R32−{R32+(G22+G42)/2−(R12+2×R32+R52)/4}
=64
Gh=G33
=2
Bh=G33+(B23+B43)/2−(G13+2×G33+G53)/4
=64
となる。
FIG. 13A corresponds to a part of an edge portion that is slightly inclined to the upper right side from the vertical direction. When interpolation processing is performed on the color signal value of FIG. 13A by correlation using a color difference of 5 pixels × 3 pixels as described in Patent Document 1, each color signal is
Rv = G33 + (R32 + R34) / 2− (G31 + 2 × G33 + G35) / 4
= 64
Gv = G33
= 2
Bv = G33 + B23-G23
= G33 + B23− {B23 + (G22 + G24) / 2− (B21 + 2 × B23 + B25) / 4}
= -60
Rh = G33 + R32-G32
= G33 + R32- {R32 + (G22 + G42) / 2- (R12 + 2 × R32 + R52) / 4}
= 64
Gh = G33
= 2
Bh = G33 + (B23 + B43) / 2− (G13 + 2 × G33 + G53) / 4
= 64
It becomes.

ただし、色信号Rv、GvおよびBvは、垂直方向の相関が強い場合に適した処理がなされた場合の色信号である。また、色信号Rh、GhおよびBhは、水平方向の相関が強い場合に適した処理がなされた場合の色信号である。   However, the color signals Rv, Gv, and Bv are color signals when processing suitable for the case where the correlation in the vertical direction is strong is performed. The color signals Rh, Gh, and Bh are color signals when processing suitable for a case where the correlation in the horizontal direction is strong is performed.

上記特許文献1に記載されている方向性の相関係数の算出式を用いると、水平方向の相関係数は0となるため、色信号を求める際に、垂直方向のみの色信号が参照されることになる。    When the calculation formula for the directional correlation coefficient described in Patent Document 1 is used, the horizontal correlation coefficient is 0. Therefore, when obtaining the color signal, the color signal only in the vertical direction is referred to. Will be.

したがって、
Ro=Rv=64
Go=Gv=2
Bo=Bv=−60
となる。
Therefore,
Ro = Rv = 64
Go = Gv = 2
Bo = Bv = −60
It becomes.

本来、モノクロ画像はR=G=Bであるのに対して、算出された色信号はRo≠Go≠Boとなっている。これは、偽色信号が発生していることを示している。    Originally, a monochrome image has R = G = B, whereas a calculated color signal has Ro ≠ Go ≠ Bo. This indicates that a false color signal is generated.

このことについて、更に詳細に検討する。    This will be examined in more detail.

上記特許文献1に記載されている色相関性を利用した補間処理では、ベイヤ配列に配置されたカラーフィルタの垂直方向および水平方向に必ずG成分が含まれるという特徴を利用して、G成分と他の色成分との相関により注目画素の他の色成分を求めている。例えば、図12(a)の水平方向をその一例として説明する。   In the interpolation processing using the color correlation described in Patent Document 1, the G component and the G component are included in the vertical direction and the horizontal direction of the color filters arranged in the Bayer array. Other color components of the pixel of interest are obtained by correlation with other color components. For example, the horizontal direction in FIG. 12A will be described as an example.

図12(a)に示すように、注目画素G33を含む水平ラインには、GとQとが含まれる。よって、これらの値から注目画素のQ成分であるQ33を求めることができる。また、1ライン上のP32を含む水平ラインには、GとPとが含まれる。よって、これらの値から注目画素のG成分であるG32を求めることができる。    As shown in FIG. 12A, the horizontal line including the target pixel G33 includes G and Q. Therefore, Q33 which is the Q component of the target pixel can be obtained from these values. A horizontal line including P32 on one line includes G and P. Therefore, G32 which is the G component of the target pixel can be obtained from these values.

特許文献1に記載されている補間処理法では、前述したように、図12(a)に示すP32およびG33の画素に着目して、局所領域におけるGとPとの差がほぼ等しいという性質
(P33−G33=P32−G32)
または、局所領域におけるGとPの比がほぼ等しいという性質
(P33/G33=P32/G32)
を利用して、P33を求めている。
In the interpolation processing method described in Patent Document 1, as described above, paying attention to the pixels P32 and G33 shown in FIG. 12A, the difference between G and P in the local region is approximately equal. (P33-G33 = P32-G32)
Or the property that the ratio of G and P in the local region is almost equal (P33 / G33 = P32 / G32)
Is used to obtain P33.

一般的な画像に対して、エッジは様々な方向にあるため、方向性検出についても垂直および水平の2方向だけではなく、さらに多数の方向性を検出する方が好ましい。    Since edges are in various directions with respect to a general image, it is preferable to detect not only two directions, vertical and horizontal, but also a large number of directions.

しかしながら、上記特許文献1に記載されている補間処理法では、斜め方向の色相関を性を考慮して補間処理を行うことができない。    However, with the interpolation processing method described in Patent Document 1, it is not possible to perform an interpolation process in consideration of the color correlation in the oblique direction.

この理由は、例えば図12(a)において、斜め45度の方向にはG成分しか存在せず、また、図12(b)において、斜め45度の方向にはP成分およびQ成分(B成分およびR成分)しか存在しないためである。    This is because, for example, in FIG. 12A, only the G component exists in the direction of 45 degrees diagonally, and in FIG. 12B, the P component and the Q component (B component) exist in the direction of 45 degrees diagonally. And only the R component).

本発明は、上記従来の問題を解決するもので、ベイヤ配列などのように複数色の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いた補間処理により生成する際に、斜め方向を含む複数の方向のエッジに対する色信号の相関性を利用して、偽色信号の発生を更に抑制することができる画像処理装置、これを用いた撮影装置、この画像処理装置を用いた画像処理方法、これをコンピュータに実行させるための画像処理プログラムおよびこの画像処理プログラムを格納したコンピュータ読み出し可能な可読記録媒体を提供することを目的とする。    The present invention solves the above-described conventional problems. From a color signal output from a solid-state image pickup device in which a plurality of color filters are discretely arranged in each pixel unit, such as a Bayer array, in each pixel. When all the color signals are generated by interpolation processing using the color signals of the target pixel and its neighboring pixels, the false color signal of the false color signal is obtained by utilizing the correlation of the color signals with respect to edges in a plurality of directions including the oblique direction. Image processing apparatus capable of further suppressing generation, photographing apparatus using the same, image processing method using the image processing apparatus, image processing program for causing a computer to execute the same, and computer storing the image processing program It is an object to provide a readable recording medium that can be read.

本発明の画像処理装置は、複数種類の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いたデータ補間処理により生成するデータ補間部を有する画像処理装置において、該データ補間部は、注目画素付近における斜め方向を含む複数の方向に対するエッジの方向性を定量化した方向性データを算出する方向性データ算出手段と、該方向性データ算出手段で算出された、該複数の方向に対する方向性データを用いて注目画素付近におけるエッジの方向性を検出する方向性検出手段と、該方向性検出手段で検出された一または複数のエッジの方向性に対応する色信号を算出する方向性色信号算出手段と、該方向性色信号算出手段で算出された一つ以上の色信号を用いて注目画素の色信号を算出する注目画素色信号算出手段とを備えており、そのことにより上記目的が達成される。    The image processing apparatus according to the present invention, from a color signal output from a solid-state image pickup device in which a plurality of types of color filters are discretely arranged in each pixel unit, converts all color signals in each pixel into a target pixel and its neighboring pixels In the image processing apparatus having the data interpolation unit that is generated by the data interpolation process using the color signal of the color signal, the data interpolation unit quantifies the directionality of the edge with respect to a plurality of directions including the oblique direction near the target pixel. Directionality data calculation means for calculating data, directionality detection means for detecting the directionality of the edge near the target pixel using the directionality data for the plurality of directions calculated by the directionality data calculation means, Directional color signal calculation means for calculating a color signal corresponding to the directionality of one or a plurality of edges detected by the directionality detection means, and calculation by the directionality color signal calculation means Been provided with the target pixel color signal calculation means for calculating a color signal of the pixel of interest using one or more color signals, the object is achieved.

また、好ましくは、本発明の画像処理装置における方向性データ算出手段は、前記方向性データとして、指定された方向と注目画素付近における実際のエッジ方向との近似度に応じた値を算出する。    Preferably, the directionality data calculation means in the image processing apparatus of the present invention calculates a value corresponding to the degree of approximation between the designated direction and the actual edge direction in the vicinity of the target pixel as the directionality data.

さらに、好ましくは、本発明の画像処理装置における方向性データ算出手段は、前記方向性データとして、前記近似度が大きいほど小さい値を算出する。    Further preferably, the directionality data calculation means in the image processing apparatus of the present invention calculates a smaller value as the degree of approximation as the directionality data.

さらに、好ましくは、本発明の画像処理装置において、斜め方向を含む複数の方向は、注目画素付近における右斜め上方向および右斜め下方向の少なくとも一方を含む複数の方向である。    Further preferably, in the image processing apparatus according to the present invention, the plurality of directions including the oblique direction are a plurality of directions including at least one of an upper right oblique direction and an oblique lower right direction in the vicinity of the target pixel.

さらに、好ましくは、本発明の画像処理装置における方向性データ算出手段は、注目画素を通る右斜め上方向、水平方向、右斜め下方向および垂直方向の4方向に対して前記方向性データを算出する。    Further preferably, the directionality data calculation means in the image processing apparatus of the present invention calculates the directionality data with respect to four directions including a right upper direction, a horizontal direction, a right lower direction and a vertical direction passing through the target pixel. To do.

さらに、好ましくは、本発明の画像処理装置における方向性データ算出手段は、注目画素を中心として上方向、斜め右上方向、右方向、斜め右下方向、下方向、斜め左下方向、左方向および斜め左上方向の8方向に対して前記方向性データを算出する。    Further preferably, the directionality data calculation means in the image processing apparatus of the present invention is configured so that the pixel of interest has an upper direction, an oblique upper right direction, a right direction, an oblique lower right direction, a downward direction, an oblique lower left direction, a left direction and an oblique direction. The directionality data is calculated for the eight directions in the upper left direction.

さらに、好ましくは、本発明の画像処理装置における方向性データ算出手段は、注目画素付近の複数の方向に対するエッジの方向性を定量化する際に、該エッジの有無に応じて変化する色信号の相関性の強度を考慮する。    Further preferably, when the directionality data calculation means in the image processing apparatus of the present invention quantifies the directionality of the edge with respect to a plurality of directions in the vicinity of the target pixel, the color signal that changes depending on the presence or absence of the edge is used. Consider the strength of the correlation.

さらに、好ましくは、本発明の画像処理装置における方向性検出手段は、前記複数の方向に対する方向性データの最大値が所定の閾値よりも小さいか否かによって、注目画素付近にエッジがなく輝度勾配がなだらかな平坦部であるか否かを判定し、該平坦部の場合には「方向性なし」を検出し、該平坦部ではない場合には「方向性あり」を検出する。    Further preferably, the directionality detecting means in the image processing apparatus of the present invention has no brightness gradient near the target pixel depending on whether or not the maximum value of the directionality data for the plurality of directions is smaller than a predetermined threshold value. Is determined to be a gentle flat portion, and “no direction” is detected in the case of the flat portion, and “directional” is detected in the case of the flat portion.

さらに、好ましくは、本発明の画像処理装置における方向性検出手段は、前記「方向性あり」を検出した場合に、前記方向性データの値が最小値となる方向を注目画素付近におけるエッジ方向として検出する。    Further preferably, when the directionality detecting means in the image processing apparatus of the present invention detects the “with directionality”, the direction in which the value of the directionality data is the minimum value is set as the edge direction in the vicinity of the target pixel. To detect.

さらに、好ましくは、本発明の画像処理装置における方向性検出手段は、前記「方向性あり」を検出した場合であっても、前記方向性データの値が最小値となる方向が複数存在する場合には、「方向性なし」を検出する。    Further preferably, even when the directionality detecting means in the image processing apparatus of the present invention detects the “with directionality”, there are a plurality of directions in which the value of the directionality data has a minimum value. Detects “no directionality”.

さらに、好ましくは、本発明の画像処理装置における方向性検出手段は、複数の方向に対する各方向性データから値の小さい順に一つ以上の方向を注目画素付近におけるエッジの方向性候補として検出する。    Further preferably, the directionality detection means in the image processing apparatus of the present invention detects one or more directions as the directionality candidates of the edges in the vicinity of the target pixel from the respective directionality data for a plurality of directions in ascending order of values.

さらに、好ましくは、本発明の画像処理装置における方向性色信号算出手段は、注目画素近傍の任意の位置において前記エッジの方向性を考慮した異なる2色の色信号の差を算出する色差算出手段と、該色差算出手段で算出された色信号の差の相関性を用いて色信号を算出する色信号算出手段とを有する。    Further preferably, the directional color signal calculation means in the image processing apparatus of the present invention calculates a difference between two different color signals in consideration of the directionality of the edge at an arbitrary position near the target pixel. And a color signal calculation means for calculating a color signal using the correlation of the color signal difference calculated by the color difference calculation means.

さらに、好ましくは、本発明の画像処理装置における方向性色信号算出手段は、注目画素近傍の任意の位置において前記エッジの方向性を考慮した異なる2色の色信号の比を算出する色比算出手段と、該色比算出手段で算出された色信号の比の相関性を用いて色信号を算出する色信号算出手段とを有する。    Further preferably, the directional color signal calculation means in the image processing apparatus of the present invention calculates a ratio of two different color signals in consideration of the directionality of the edge at an arbitrary position near the target pixel. And color signal calculation means for calculating a color signal using the correlation of the ratios of the color signals calculated by the color ratio calculation means.

さらに、好ましくは、本発明の画像処理装置における方向性色信号算出手段は、前記注目画素近傍の任意の位置として、該注目画素の位置、該注目画素の近傍画素の中央位置、および、該注目画素の近傍において互いに隣接する画素間の交点のいずれかを用いる。    Further preferably, the directional color signal calculation means in the image processing apparatus of the present invention is arranged such that the position of the target pixel, the center position of the vicinity pixel of the target pixel, and the target position are arbitrary positions in the vicinity of the target pixel. Any of intersections between adjacent pixels in the vicinity of the pixel is used.

さらに、好ましくは、本発明の画像処理装置における方向性色信号算出手段は、前記方向性検出手段で検出された方向に対して、算出しようとする色成分の画素が存在しない場合に、該検出された方向以外の注目画素の近傍画素から、該算出しようとする色成分の画素を参照して前記エッジの方向性に対応する色信号を算出する。    Further preferably, the directional color signal calculation means in the image processing apparatus of the present invention detects the directional color signal when the pixel of the color component to be calculated does not exist with respect to the direction detected by the directional detection means. A color signal corresponding to the directionality of the edge is calculated with reference to the pixel of the color component to be calculated from the neighboring pixels of the target pixel other than the determined direction.

さらに、好ましくは、本発明の画像処理装置における方向性色信号算出手段は、前記検出された方向以外の注目画素の複数の近傍画素において前記算出しようとする色成分の平均値を用いる。    Further preferably, the directional color signal calculation means in the image processing apparatus of the present invention uses an average value of the color components to be calculated in a plurality of neighboring pixels of the target pixel other than the detected direction.

さらに、好ましくは、本発明の画像処理装置における注目画素色信号算出手段は、前記方向性検出手段で「方向性あり」と検出された画素に対して、前記方向性色信号算出手段で算出された色信号を注目画素における色信号として算出する。    Further preferably, the pixel-of-interest color signal calculation means in the image processing apparatus of the present invention is calculated by the directional color signal calculation means for the pixels detected as “directional” by the directional detection means. The obtained color signal is calculated as the color signal in the target pixel.

さらに、好ましくは、本発明の画像処理装置における注目画素色信号算出手段は、前記方向性検出手段で「方向性なし」と検出された画素に対して、バイリニア法を用いて注目画素における色信号を算出する。    Further preferably, the pixel-of-interest color signal calculation means in the image processing apparatus of the present invention uses the bilinear method for the pixel signal detected by the directionality detection means as “no directionality”, and the color signal at the pixel of interest. Is calculated.

さらに、好ましくは、本発明の画像処理装置における注目画素色信号算出手段は、前記方向性検出手段で検出された複数の方向性に対応する各色信号の平均色を注目画素における色信号として算出する平均色算出手段を有する。    Further preferably, the pixel-of-interest color signal calculation means in the image processing apparatus of the present invention calculates an average color of each color signal corresponding to a plurality of directions detected by the directionality detection means as a color signal in the pixel of interest. Average color calculation means is included.

さらに、好ましくは、本発明の画像処理装置における注目画素色信号算出手段は、前記方向性検出手段で検出された複数の方向性に対応する各色信号の平均色を算出する平均色算出手段と、該平均色算出手段で算出された平均色と注目画素の色との相関性を利用して注目画素における色信号を算出する多重色相関色信号算出手段とを有する。    Further preferably, the target pixel color signal calculation means in the image processing apparatus of the present invention comprises: an average color calculation means for calculating an average color of each color signal corresponding to a plurality of directions detected by the directionality detection means; A multi-color correlated color signal calculating unit that calculates a color signal at the target pixel using the correlation between the average color calculated by the average color calculating unit and the color of the target pixel;

本発明の撮影装置は、被写体を撮像可能とする固体撮像素子と、該固体撮像素子からの撮像データをアナログ/デジタル変換するアナログ/デジタル変換部と、該アナログ/デジタル変換部からのデジタル信号を信号処理する請求項1〜20のいずれかに記載の上記画像処理装置とを有しており、そのことにより上記目的が達成される。    The imaging device of the present invention includes a solid-state imaging device that can image a subject, an analog / digital conversion unit that performs analog / digital conversion on imaging data from the solid-state imaging device, and a digital signal from the analog / digital conversion unit. The image processing apparatus according to claim 1, which performs signal processing, achieves the object.

本発明の画像処理方法は、複数種類の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いたデータ補間処理により生成する画像処理方法において、注目画素付近における斜め方向を含む複数の方向に対するエッジの方向性を定量化した方向性データを算出する方向性データ算出ステップと、該方向性データ算出ステップで算出された、該複数の方向に対する方向性データを用いて注目画素付近におけるエッジの方向性を検出する方向性検出ステップと、該方向性検出ステップで検出された一または複数のエッジの方向性に対応する色信号を算出する方向性色信号算出ステップと、該方向性色信号算出ステップで算出された一つ以上の色信号を用いて注目画素の色信号を算出する注目画素色信号算出ステップとを有し、そのことにより上記目的が達成される。    In the image processing method of the present invention, from a color signal output from a solid-state imaging device in which a plurality of types of color filters are discretely arranged in each pixel unit, all color signals in each pixel are converted to the target pixel and its neighboring pixels. A directionality data calculation step for calculating directionality data in which the directionality of edges with respect to a plurality of directions including an oblique direction in the vicinity of the target pixel is quantified A directionality detection step for detecting the directionality of an edge in the vicinity of the target pixel using the directionality data for the plurality of directions calculated in the directionality data calculation step, and one or more detected in the directionality detection step A directional color signal calculation step for calculating a color signal corresponding to the directionality of a plurality of edges, and one or more calculated in the directional color signal calculation step. And a target pixel color signal calculation step of calculating a color signal of the pixel of interest by using the color signal, the object is achieved.

また、好ましくは、本発明の画像処理方法における方向性データ算出ステップは、指定されたエッジ方向と注目画素付近における実際のエッジ方向との近似度に応じた値を前記方向性データとして算出する。    Preferably, the directionality data calculation step in the image processing method of the present invention calculates a value corresponding to the degree of approximation between the designated edge direction and the actual edge direction near the target pixel as the directionality data.

さらに、好ましくは、本発明の画像処理方法における方向性データ算出ステップは、前記方向性データとして前記近似度が大きいほど小さい値を算出する。    Further preferably, the directionality data calculation step in the image processing method of the present invention calculates a smaller value as the degree of approximation as the directionality data.

さらに、好ましくは、本発明の画像処理方法における方向性データ算出ステップは、注目画素を通る右斜め上方向、水平方向、右斜め下方向および垂直方向の4方向に対して前記方向性データを算出する。    Further preferably, in the directionality data calculation step in the image processing method of the present invention, the directionality data is calculated with respect to four directions including a right upper direction, a horizontal direction, a right lower direction and a vertical direction passing through the target pixel. To do.

さらに、好ましくは、本発明の画像処理方法における方向性データ算出ステップは、注目画素を中心として上方向、斜め右上方向、右方向、斜め右下方向、下方向、斜め左下方向、左方向および斜め左上方向の8方向に対して前記方向性データを算出する。    Further preferably, the directionality data calculation step in the image processing method of the present invention is performed in the upward direction, the diagonally upper right direction, the right direction, the diagonally lower right direction, the downward direction, the diagonally lower left direction, the left direction and the diagonal direction with the target pixel as the center. The directionality data is calculated for the eight directions in the upper left direction.

さらに、好ましくは、本発明の画像処理方法における方向性データ算出ステップは、注目画素付近の複数の方向に対するエッジの方向性を定量化する際に、該エッジの有無に応じて変化する色信号の相関性の強度を考慮する。    Further preferably, in the directionality data calculation step in the image processing method of the present invention, when quantifying the directionality of the edge with respect to a plurality of directions in the vicinity of the target pixel, the color signal that changes depending on the presence or absence of the edge Consider the strength of the correlation.

さらに、好ましくは、本発明の画像処理方法における方向性検出ステップは、複数の方向に対する方向性データの最大値が所定の閾値よりも小さいか否かによって、注目画素付近にエッジがなく輝度勾配がなだらかな平坦部であるか否かを判定し、該平坦部の場合には「方向性なし」を検出し、該平坦部ではない場合には「方向性あり」を検出する。    Further preferably, in the directionality detecting step in the image processing method of the present invention, the luminance gradient has no edge near the target pixel depending on whether or not the maximum value of the directionality data for a plurality of directions is smaller than a predetermined threshold value. It is determined whether or not it is a gentle flat portion, and “no direction” is detected in the case of the flat portion, and “directional” is detected in the case of not being the flat portion.

さらに、好ましくは、本発明の画像処理方法における方向性検出ステップは、前記「方向性あり」を検出した場合に、前記方向性データの値が最小値となる方向を注目画素付近におけるエッジ方向として検出する。    Further preferably, in the directionality detection step in the image processing method of the present invention, when the “with directionality” is detected, a direction in which the value of the directionality data is a minimum value is set as an edge direction in the vicinity of the target pixel. To detect.

さらに、好ましくは、本発明の画像処理方法における方向性検出ステップは、前記「方向性あり」を検出した場合であっても、前記方向性データの値が最小値となる方向が複数存在する場合には、「方向性なし」を検出する。    Further preferably, in the directionality detection step in the image processing method of the present invention, even when the “with directionality” is detected, there are a plurality of directions in which the value of the directionality data has a minimum value. Detects “no directionality”.

さらに、好ましくは、本発明の画像処理方法における方向性検出ステップは、複数の方向に対する方向性データから値の小さい順に一つ以上の方向を注目画素付近におけるエッジ方向の方向性候補として検出する。    Further preferably, in the directionality detection step in the image processing method of the present invention, one or more directions are detected as directionality candidates in the edge direction in the vicinity of the target pixel from the directionality data for a plurality of directions in ascending order.

さらに、好ましくは、本発明の画像処理方法における方向性色信号算出ステップは、 注目画素の近傍の任意の位置において前記エッジの方向性を考慮した異なる2色の色信号の差を算出する色差算出ステップと、該色差算出ステップで算出された色信号の差の相関性を用いて色信号を算出する色信号算出ステップとを有する。    Further preferably, in the directional color signal calculation step in the image processing method of the present invention, the color difference calculation for calculating a difference between two different color signals in consideration of the directionality of the edge at an arbitrary position in the vicinity of the target pixel. And a color signal calculation step of calculating a color signal using the correlation of the color signal difference calculated in the color difference calculation step.

さらに、好ましくは、本発明の画像処理方法における方向性色信号算出ステップは、 注目画素の近傍の任意の位置において前記エッジの方向性を考慮した異なる2色の色信号の比を算出する色比算出ステップと、該色比算出ステップで算出された色信号の比の相関性を用いて色信号を算出する色信号算出ステップとを有する。    Still preferably, in the image processing method of the present invention, the directional color signal calculation step calculates a ratio between two different color signals in consideration of the directionality of the edge at an arbitrary position in the vicinity of the target pixel. A calculation step, and a color signal calculation step of calculating a color signal using the correlation of the ratio of the color signals calculated in the color ratio calculation step.

さらに、好ましくは、本発明の画像処理方法における方向性色信号算出ステップは、注目画素の近傍の任意の位置として、該注目画素の位置、該注目画素の近傍画素の中央位置、および、該注目画素の近傍において互いに隣接する画素間の交点のいずれかを用いる。    Further preferably, the directional color signal calculation step in the image processing method of the present invention includes the position of the target pixel, the center position of the neighboring pixel of the target pixel, and the target position as an arbitrary position in the vicinity of the target pixel. Any of intersections between adjacent pixels in the vicinity of the pixel is used.

さらに、好ましくは、本発明の画像処理方法における方向性色信号算出ステップは、前記方向性検出手段で検出された検出方向に対して、算出しようとする色成分の画素が存在しない場合に、該検出された方向以外の注目画素の複数の近傍画素から、該算出しようとする色成分の画素を参照して前記エッジの方向性に対応する色信号を算出する。    Further preferably, in the directional color signal calculation step in the image processing method of the present invention, when there is no pixel of a color component to be calculated with respect to the detection direction detected by the directional detection means, A color signal corresponding to the directionality of the edge is calculated from a plurality of neighboring pixels of the target pixel other than the detected direction with reference to the pixel of the color component to be calculated.

さらに、好ましくは、本発明の画像処理方法における方向性色信号算出ステップは、前記検出された方向以外の注目画素の複数の近傍画素において前記算出しようとする色成分の平均値を用いる。    Further preferably, the directional color signal calculation step in the image processing method of the present invention uses an average value of the color components to be calculated in a plurality of neighboring pixels of the target pixel other than the detected direction.

さらに、好ましくは、本発明の画像処理方法における注目画素色信号算出ステップは、前記方向性検出ステップで「方向性あり」と検出した画素に対して、前記方向性検出ステップで算出された色信号を注目画素における色信号として算出する。    Further preferably, in the image processing method of the present invention, the pixel-of-interest color signal calculation step calculates the color signal calculated in the directionality detection step for the pixel detected as “directional” in the directionality detection step. Is calculated as a color signal in the target pixel.

さらに、好ましくは、本発明の画像処理方法における注目画素色信号算出ステップは、前記方向性検出ステップで「方向性なし」と検出した画素に対して、バイリニア法を用いて注目画素における色信号を算出する。    Still preferably, in the image processing method of the present invention, the pixel-of-interest color signal calculation step calculates a color signal at the pixel of interest using a bilinear method for the pixel detected as “no directionality” in the directionality detection step. calculate.

さらに、好ましくは、本発明の画像処理方法における注目画素色信号算出ステップは、前記方向性検出ステップで検出された複数の方向性に対応する各色信号の平均色を注目画素における色信号として算出する平均色算出ステップを有する。    More preferably, the pixel-of-interest color signal calculation step in the image processing method of the present invention calculates an average color of each color signal corresponding to a plurality of directions detected in the directionality detection step as a color signal in the pixel of interest. An average color calculating step;

さらに、好ましくは、本発明の画像処理方法における注目画素色信号算出ステップは、前記方向性検出ステップで検出された複数の方向性に対応する各色信号の平均色を算出する平均色算出ステップと、該平均色算出ステップで算出した平均色と注目画素の色との相関性を利用して注目画素における色信号を算出する多重色相関色信号算出ステップとを有する。    Further preferably, the pixel-of-interest color signal calculation step in the image processing method of the present invention includes an average color calculation step of calculating an average color of each color signal corresponding to a plurality of directions detected in the directionality detection step; A multi-color correlated color signal calculating step for calculating a color signal at the target pixel using the correlation between the average color calculated at the average color calculating step and the color of the target pixel.

本発明の画像処理プログラムは、請求項22〜40のいずれかに記載の上記画像処理方法の各処理ステップをコンピュータに実行させるためのものであり、そのことにより上記目的が達成される。    An image processing program of the present invention is for causing a computer to execute each processing step of the image processing method according to any one of claims 22 to 40, thereby achieving the object.

本発明の可読記録媒体は、請求項41に記載の画像処理プログラムが格納されたコンピュータ読み取り可能なものであり、そのことにより上記目的が達成される。    A readable recording medium according to the present invention is a computer-readable recording medium storing the image processing program according to claim 41, whereby the above object is achieved.

上記構成により、以下に、本発明の作用について説明する。    The operation of the present invention will be described below with the above configuration.

一般的な画像には、前述したように、局所領域における特徴として、「局所領域では色信号の変化が少ないため、G、RおよびBの差、並びにG、RおよびBの比はほぼ一定である」という性質がある。    As described above, a general image has a characteristic in the local region that “the difference in G, R, and B and the ratio of G, R, and B are almost constant because there is little change in the color signal in the local region. There is a nature of “is.

従来の補間処理法では、上記画像の局所領域における特徴と、ベイヤ配列の垂直方向および水平方向には必ずG成分が含まれるという特徴とを利用して、水平方向および垂直方向の色相関を利用した補間を行っていた。    The conventional interpolation processing method uses the color correlation in the horizontal direction and the vertical direction by using the feature in the local region of the image and the feature that the vertical and horizontal directions of the Bayer array always include the G component. Interpolation was performed.

これに対して、本発明にあっては、上記従来法の場合と同様に画像の局所領域における特徴を利用すると共に、斜め方向の補間を行う際に、斜め方向に限らず、より広範囲の画素に注目し、また、必要に応じては画素の中心にとらわれず、任意の点(例えば、画素と画素との交点)における色信号を算出して、算出された色信号との色の相関によって注目画素の色信号を算出することにより、斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行うことが可能である。    On the other hand, in the present invention, as in the case of the conventional method described above, the feature in the local region of the image is used, and when performing the interpolation in the oblique direction, not only the oblique direction but also a wider range of pixels. In addition, if necessary, the color signal at an arbitrary point (for example, the intersection of the pixel and the pixel) is calculated regardless of the center of the pixel, and the color correlation with the calculated color signal is used. By calculating the color signal of the pixel of interest, it is possible to perform an interpolation process that also uses the correlation of the color signal with respect to the edge in the oblique direction.

このように、ベイヤ配列の補間処理は、より多くの方向性を調べて、それぞれの方向性に適応した色信号を算出した方が、色信号の誤差を減少させることができて、偽色信号の発生を更に抑制することが可能となる。    As described above, in the Bayer array interpolation processing, it is possible to reduce the error of the color signal by checking more directionality and calculating the color signal adapted to each directionality. Can be further suppressed.

即ち、本発明にあっては、斜め方向の色相関を利用して色信号を算出することができるため、従来の垂直方向および水平方向の色相関だけを利用した補間処理法よりも、より精密な画像の方向性検出を行うことが可能となって、偽色信号の発生を抑制した色信号算出を行うことが可能となる。   That is, in the present invention, since the color signal can be calculated using the color correlation in the oblique direction, it is more accurate than the conventional interpolation processing method using only the color correlation in the vertical and horizontal directions. Therefore, it is possible to detect the direction of the correct image, and to calculate the color signal while suppressing the generation of the false color signal.

また、注目画素を中心とする8方向の方向性検出を行って、色相関を利用した色信号を算出することにより、エッジの端点を考慮して、さらに偽色信号の少ない補間処理を行うことが可能となる。   Further, by performing directionality detection in eight directions centering on the pixel of interest and calculating a color signal using color correlation, interpolation processing with fewer false color signals can be performed in consideration of edge points. Is possible.

さらに、色相関の特徴を利用して算出した色信号を用いて、さらに色相関を利用して色信号を算出することにより、偽色信号をさらに低減することが可能となる。   Furthermore, it is possible to further reduce the false color signal by calculating the color signal using the color signal using the color signal calculated using the characteristics of the color correlation.

以上説明したように、本発明によれば、画像の局所領域における特徴を利用すると共に、斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行うことにより、偽色信号の発生を更に抑制した色信号の算出を行うことができる。    As described above, according to the present invention, generation of a false color signal can be achieved by performing the interpolation process using the feature of the local region of the image and also using the correlation of the color signal with the edge in the oblique direction. Further, it is possible to calculate a suppressed color signal.

また、注目画素を中心とする8方向の方向性検出を行って色信号算出を行うことにより、更に偽色信号の少ない補間処理を行うことができる。   In addition, by performing color signal calculation by detecting directionality in eight directions with the pixel of interest at the center, interpolation processing with fewer false color signals can be performed.

さらに、色相関の特徴を利用して算出した色信号を用いて、さらに色相関を利用して色信号を算出することにより、偽色信号を更に低減することができる。   Furthermore, the false color signal can be further reduced by calculating the color signal using the color correlation using the color signal calculated using the characteristics of the color correlation.

以下に、本発明の画像処理装置の実施形態1〜5を撮影装置に適用した場合について、図面を参照しながら詳細に説明する。
(実施形態1)
図1は、本発明の画像処理装置の実施形態1を用いた撮影装置の構成例を示すブロック図である。
Hereinafter, a case where the first to fifth embodiments of the image processing apparatus of the present invention are applied to a photographing apparatus will be described in detail with reference to the drawings.
(Embodiment 1)
FIG. 1 is a block diagram illustrating a configuration example of a photographing apparatus using the first embodiment of the image processing apparatus of the present invention.

図1に示すように、本実施形態1の撮影装置10は、被写体を撮像可能とする固体撮像素子1と、固体撮像素子1からの撮像データをA/D変換するA/D変換部2と、このA/D変換部2からのデジタル信号を各種信号処理する画像処理装置としての画像処理部3とを有している。    As illustrated in FIG. 1, the imaging device 10 according to the first embodiment includes a solid-state imaging device 1 that can image a subject, an A / D conversion unit 2 that performs A / D conversion on imaging data from the solid-state imaging device 1, and the like. And an image processing unit 3 as an image processing apparatus for performing various signal processing on the digital signal from the A / D conversion unit 2.

固体撮像素子1は、被写体光が所定のカラーフィルタを通ってフォトダイオード部に入射され、フォトダイオード部によって各画素に対応する色の大きさを表すアナログ電気信号に光電変換されて出力される。なお、この場合のカラーフィルタは、RGBの三原色でベイヤ配列とする。    In the solid-state imaging device 1, subject light is incident on a photodiode portion through a predetermined color filter, and is photoelectrically converted into an analog electric signal representing a color size corresponding to each pixel by the photodiode portion and output. Note that the color filter in this case is a Bayer array with three primary colors of RGB.

A/D変換部2は、固体撮像素子1から出力されるアナログ電気信号がディジタル信号(以下、ベイヤデータという)に変換されて出力される。    The A / D conversion unit 2 converts an analog electric signal output from the solid-state imaging device 1 into a digital signal (hereinafter referred to as Bayer data) and outputs the digital signal.

画像処理部3は、ホワイトバランス部4と、ガンマ補正部5と、データ補間部6とを有し、A/D変換部2から出力されるベイヤデータが入力されて、ホワイトバランス、ガンマ補正およびデータ補間などの各種画像処理が施された後に、各画素部毎にRGBデータが全て揃った画像データが画像処理部3から出力される。    The image processing unit 3 includes a white balance unit 4, a gamma correction unit 5, and a data interpolation unit 6. The Bayer data output from the A / D conversion unit 2 is input, and white balance, gamma correction, and data are input. After various image processing such as interpolation is performed, image data including all RGB data for each pixel unit is output from the image processing unit 3.

ホワイトバランス部4は、A/D変換部2から出力されるベイヤデータが入力されて、ベイヤデータの各画素値に対して、対応するRGBゲインが乗算されて白色の調整が行われ、白色調整後のベイヤデータが出力される。 The white balance unit 4 receives the Bayer data output from the A / D conversion unit 2 and multiplies each pixel value of the Bayer data by a corresponding RGB gain to perform white adjustment. Bayer data is output.

ガンマ補正部5は、ホワイトバランス部4から出力される白色調整後のベイヤデータが入力され、このベイヤデータの各画素値に対して、表示部に対応するように輝度の階調に関する調整(ガンマ補正)が行われ、ガンマ補正後のベイヤデータが出力される。    The gamma correction unit 5 receives the Bayer data after white adjustment output from the white balance unit 4, and adjusts the luminance gradation (gamma correction) for each pixel value of the Bayer data so as to correspond to the display unit. And Bayer data after gamma correction is output.

データ補間部6は、ガンマ補正部5から出力されるガンマ補正後のベイヤデータが入力されて、二次元状でマトリクス状に配列された各画素部に対してそれぞれ、注目画素付近におけるエッジ(輝度値が急激に変化する部分で平坦部ではない部分)の有無およびエッジの方向性が、注目画素とその近傍画素の色信号を用いた演算処理によって検出され、このエッジの有無および検出されたエッジの方向性に応じたデータ補間処理が行われて、各画素毎にRGB信号が出力される。    The data interpolation unit 6 receives the Bayer data after the gamma correction output from the gamma correction unit 5 and inputs an edge (luminance value) in the vicinity of the target pixel for each pixel unit arranged in a two-dimensional matrix. The presence or absence of the edge and the directionality of the edge are detected by arithmetic processing using the color signal of the target pixel and its neighboring pixels, and the presence or absence of this edge and the detected edge Data interpolation processing according to directionality is performed, and RGB signals are output for each pixel.

図2は、図1のデータ補間部6の構成例を示すブロック図である。    FIG. 2 is a block diagram illustrating a configuration example of the data interpolation unit 6 of FIG.

図2に示すように、データ補間部6は、方向性データ算出部61と、方向性検出部62と、方向性色信号算出部63と、注目画素色信号算出部64と、これらを制御する制御部65とを有し、エッジの有無およびエッジの方向性を検出し、この検出されたエッジの方向性に応じたデータ補間処理が行われる。この方向性データ算出部61と制御部65とによって方向性データ算出手段が構成されている。また、方向性検出部62と制御部65とによって方向性検出手段が構成され、方向性色信号算出部63と制御部65とによって方向性色信号算出手段が構成され、注目画素色信号算出部64と制御部65とによって注目画素色信号算出手段が構成されている。    As shown in FIG. 2, the data interpolation unit 6 controls the directional data calculation unit 61, the directional detection unit 62, the directional color signal calculation unit 63, and the target pixel color signal calculation unit 64. A controller 65 for detecting the presence / absence of an edge and the directionality of the edge, and performing data interpolation processing according to the detected directionality of the edge. The directionality data calculation unit 61 and the control unit 65 constitute a directionality data calculation unit. The directionality detection unit 62 and the control unit 65 constitute a directionality detection unit, and the directionality color signal calculation unit 63 and the control unit 65 constitute a directionality color signal calculation unit, and the target pixel color signal calculation unit. 64 and the control unit 65 constitute a pixel color signal calculation unit of interest.

方向性データ算出部61は、対象となるベイヤデータの各画素に対して、少なくとも斜め方向を含む指定方向と注目画素付近における実際のエッジ方向との近似度が大きいほど値が小さくなる方向性データが、予め決められた複数の指定方向に対してそれぞれ算出される。    The directionality data calculation unit 61 has, for each pixel of the target Bayer data, directionality data that decreases in value as the degree of approximation between the specified direction including at least an oblique direction and the actual edge direction in the vicinity of the target pixel increases. , Respectively, for a plurality of predetermined designated directions.

方向性検出部62は、方向性データ算出部61によって算出された複数の指定方向に対する各方向性データを用いて、注目画素付近(注目画素を通る付近画素を含む部分)におけるエッジの有無およびエッジの方向性が検出される。    The directionality detection unit 62 uses the respective directionality data for a plurality of designated directions calculated by the directionality data calculation unit 61, and the presence / absence of an edge and the edge in the vicinity of the target pixel (including the vicinity pixel passing through the target pixel). Directionality is detected.

方向性色信号算出部63は、方向性検出部62によって検出されたエッジの方向性に対応した色信号が算出される。本実施形態1では、方向性色信号算出部63は、注目画素の近傍の任意の点(画面上の位置)において方向性を考慮した異なる2色の色信号の差を算出する色差算出手段としての色差算出部(図示せず)と、その色差算出部によって算出された色信号の差の相関性を用いて色信号を算出する色信号算出手段としての色信号算出部(図示せず)とを有している。    The directional color signal calculation unit 63 calculates a color signal corresponding to the directionality of the edge detected by the directionality detection unit 62. In the first embodiment, the directional color signal calculation unit 63 is a color difference calculation unit that calculates a difference between two different color signals in consideration of the directionality at an arbitrary point (position on the screen) near the target pixel. And a color signal calculation unit (not shown) as color signal calculation means for calculating a color signal using the correlation of the color signal difference calculated by the color difference calculation unit. have.

注目画素色信号算出部64は、方向性検出部62によって検出されたエッジの方向性と、方向性色信号算出部63によって算出された色信号とを用いて、注目画素における色信号が算出される。    The pixel-of-interest color signal calculation unit 64 calculates the color signal of the pixel of interest using the directionality of the edge detected by the directionality detection unit 62 and the color signal calculated by the directionality color signal calculation unit 63. The

制御部65は、上記方向性データ算出部61、方向性検出部62、方向性色信号算出部63および注目画素色信号算出部64にそれぞれ接続されており、この制御部65によって、各部分の処理の流れを制御する。    The control unit 65 is connected to the directional data calculation unit 61, the directional detection unit 62, the directional color signal calculation unit 63, and the target pixel color signal calculation unit 64, respectively. Control the flow of processing.

以下に、図1および図2のデータ補間部6によるデータ補間処理の処理手順について、図3を用いて順に説明する。    Hereinafter, the processing procedure of the data interpolation processing by the data interpolation unit 6 of FIGS. 1 and 2 will be described in order with reference to FIG.

図3は、図2のデータ補間部6のデータ補間動作を説明するためのフローチャートである。なお、図3のステップS1〜S4の処理は、ステップS5により、入力されたベイヤデータ領域内の補間指定領域内における画素の数だけ繰り返される。また、図4に示すように、鎖線で囲まれた補間指定領域は、実線で囲まれたベイヤデータ領域内に収まり、かつ、補間指定領域の外側には、上下左右共に幅2画素分以上のベイヤデータが存在するものとする。これは、補間指定領域境界部の画素に対して、補間処理に必要なだけの近傍画素の情報を得ることができるようにするためである。   FIG. 3 is a flowchart for explaining the data interpolation operation of the data interpolation unit 6 of FIG. Note that the processing in steps S1 to S4 in FIG. 3 is repeated by the number of pixels in the interpolation designation area in the input Bayer data area in step S5. In addition, as shown in FIG. 4, the interpolation designation area surrounded by a chain line fits within the Bayer data area surrounded by a solid line, and outside the interpolation designation area, Bayer data having a width of 2 pixels or more in both the upper, lower, left and right directions. Shall exist. This is to make it possible to obtain information on neighboring pixels as much as necessary for the interpolation processing with respect to the pixels at the boundary portion of the interpolation designated area.

図3に示すように、方向性データ算出部61によって、まず、ステップS1では、注目画素毎の方向性データが、予め決められた複数の指定方向に対して算出される。    As shown in FIG. 3, first, in step S <b> 1, the directionality data calculation unit 61 calculates directionality data for each target pixel for a plurality of predetermined designated directions.

本実施形態1では、図5に示すように、複数の指定方向として、右斜め上、水平、右斜め下および垂直の4方向が用いられる。これらの指定方向に限らず、上記以外の指定方向も考えられるが、微小領域内においては、概ね上記4方向に近似することができる。    In the first embodiment, as shown in FIG. 5, four directions of upper right, horizontal, lower right, and vertical are used as a plurality of designated directions. Not only these designated directions but also designated directions other than those mentioned above are conceivable, but in a very small area, it can be approximated to the above four directions.

また、注目画素の付近に位置する複数の近傍画素として、本実施形態1では、例えば図12(a)に示すように注目画素に隣接する8つの近傍画素と、さらにそれらの周囲を取り囲むように位置する16の近傍画素とを用いるが、データ補間処理に必要な数の画素であって、注目画素を取り囲むように位置する画素であれば、これらに限らず、任意の数の近傍画素を用いることができる。    Further, as a plurality of neighboring pixels located in the vicinity of the pixel of interest, in the first embodiment, for example, as shown in FIG. 12A, eight neighboring pixels adjacent to the pixel of interest are further surrounded. 16 neighboring pixels are used, but any number of neighboring pixels is used as long as it is a pixel necessary for data interpolation processing and is located so as to surround the target pixel. be able to.

方向性データ算出部61では、注目画素付近における右斜め上方向、水平方向、右斜め下方向および垂直方向を含む複数の指定方向(ここでは4方向)に対するエッジの方向性を定量化した方向性データを算出する。即ち、方向性データとして、指定された方向(指定方向)と注目画素付近における実際のエッジ方向との近似度の値に応じた値を算出する。例えば、指定された方向(指定方向)と注目画素付近における実際のエッジ方向との近似度が大きいほど値が小さくなるように、方向性データが算出される。このような方向性データ算出式としては、各種のものが考えられるが、例えば、以下のような算出式(式2)を用いることができる。    The directionality data calculation unit 61 quantifies the directionality of edges in a plurality of designated directions (here, four directions) including the upper right direction, the horizontal direction, the lower right direction, and the vertical direction in the vicinity of the target pixel. Calculate the data. That is, as the directionality data, a value corresponding to the degree of approximation between the designated direction (designated direction) and the actual edge direction in the vicinity of the target pixel is calculated. For example, the directionality data is calculated such that the value decreases as the degree of approximation between the specified direction (specified direction) and the actual edge direction in the vicinity of the target pixel increases. Various types of directional data calculation formulas are conceivable. For example, the following calculation formula (Formula 2) can be used.

ただし、DDru:右斜め上方向の方向性データ算出式
DDho:水平方向の方向性データ算出式
DDrd:右斜め下方向の方向性データ算出式
DDve:垂直方向の方向性データ算出式
とする。
(式2)
・注目画素がG33の場合(図12(a)参照)
DDru={(|G51−G33|+|G42−G33|+|G24−G33|+|G15−G33|
+|G22−G31|+|G22−G13|+|G44−G53|+|G44−G35|)/2
+(|P32−P14|+|P52−P34|)
+(|Q41−Q23|+|Q43−Q25|)}/2
DDho={(|G13−G33|+|G53−G33|+|G22−G42|+|G24−G44|)
+(|Q23−Q43|)×2
+(|P12−P32|+|P52−P32|+|P14−P34|+|P54−P34|)/2}/2
DDrd={(|G11−G33|+G22−G33|+|G44−GG33|+|G55−G33|
+|G42−G31|+|G42−G53|+|G24−G13|+|G24−G35|)/2
+(|P32−P54|+|P12−P34|)
+(|Q21−Q43|+|Q23−Q45|)}/2
DDve={(|G31−G33|+|G35−G33|+|G22−G24|+|G42−G44|)
+(|P32−P34|)×2
+(|Q21−Q23|+|Q25−Q23|+|Q41−Q43|+|Q45−Q43|)/2}/2
・注目画素がP33の場合(図12(b)参照)
DDru=(|P15−P33|+|P51−P33|)
+(|Q42−Q24|)
+(|G32−G23|+|G43−G34|)/2
DDho=(|P13−P33|+|P53−P33|)
+(|G23−G43|)
+(|Q22−Q42|+|Q24−Q44|)/2
DDrd=(|P11−P33|+|P55−P33|)
+(|Q44−Q22|)
+(|G32−G43|+|G23−G34|)/2
DDve=(|P31−P33|+|P35−P33|)
+(|G32−G34|)
+(|Q22−Q24|+|Q42−Q44|)/2
次に、図3に戻って、ステップS2では、方向性検出部62によって、ステップS1で算出された方向性データを用いて、注目画素のエッジの有無およびエッジの方向性が検出される。
However, DDru: Directional data calculation formula in the upper right direction
DDho: Horizontal directionality data calculation formula
DDrd: Directional data calculation formula in the diagonally lower right direction
DDve: Formula for calculating directionality data in the vertical direction.
(Formula 2)
When the target pixel is G33 (see FIG. 12A)
DDru = {(| G51−G33 | + | G42−G33 | + | G24−G33 | + | G15−G33 |
+ | G22−G31 | + | G22−G13 | + | G44−G53 | + | G44−G35 |) / 2
+ (| P32−P14 | + | P52−P34 |)
+ (| Q41−Q23 | + | Q43−Q25 |)} / 2
DDho = {(| G13−G33 | + | G53−G33 | + | G22−G42 | + | G24−G44 |)
+ (| Q23−Q43 |) × 2
+ (| P12−P32 | + | P52−P32 | + | P14−P34 | + | P54−P34 |) / 2} / 2
DDrd = {(| G11−G33 | + G22−G33 | + | G44−GG33 | + | G55−G33 |
+ | G42−G31 | + | G42−G53 | + | G24−G13 | + | G24−G35 |) / 2
+ (| P32−P54 | + | P12−P34 |)
+ (| Q21−Q43 | + | Q23−Q45 |)} / 2
DDve = {(| G31−G33 | + | G35−G33 | + | G22−G24 | + | G42−G44 |)
+ (| P32−P34 |) × 2
+ (| Q21-Q23 | + | Q25-Q23 | + | Q41-Q43 | + | Q45-Q43 |) / 2} / 2
When the target pixel is P33 (see FIG. 12B)
DDru = (| P15−P33 | + | P51−P33 |)
+ (| Q42−Q24 |)
+ (| G32−G23 | + | G43−G34 |) / 2
DDho = (| P13−P33 | + | P53−P33 |)
+ (| G23−G43 |)
+ (| Q22-Q42 | + | Q24-Q44 |) / 2
DDrd = (| P11−P33 | + | P55−P33 |)
+ (| Q44−Q22 |)
+ (| G32−G43 | + | G23−G34 |) / 2
DDve = (| P31−P33 | + | P35−P33 |)
+ (| G32−G34 |)
+ (| Q22−Q24 | + | Q42−Q44 |) / 2
Next, returning to FIG. 3, in step S <b> 2, the directionality detection unit 62 detects the presence / absence of the edge of the target pixel and the directionality of the edge using the directionality data calculated in step S <b> 1.

以下に、図2の方向性検出部62による方向性検出処理の各処理手順について、図6を用いて説明する。    Below, each process sequence of the directionality detection process by the directionality detection part 62 of FIG. 2 is demonstrated using FIG.

図6は、図2の方向性検出部62(図3のステップS2の一例)の動作例を説明するためのフローチャートである。   FIG. 6 is a flowchart for explaining an operation example of the directionality detection unit 62 in FIG. 2 (an example of step S2 in FIG. 3).

図6に示すように、方向性検出部62によって、まず、ステップS21では、図3のステップS1で算出された図5の4種類の方向性データの最大値が検出される。    As shown in FIG. 6, first, in step S21, the maximum value of the four types of direction data of FIG. 5 calculated in step S1 of FIG. 3 is detected by the direction detection unit 62.

次に、ステップS22では、ステップS21で検出された方向性データの最大値が、図示しないレジスタに記憶された閾値Aよりも小さいか否か、即ち、注目画素付近にエッジがなく輝度勾配がなだらかな平坦部であるか否かが判定される。これが平坦部である場合(Yes)には、ステップS23において「方向性なし」を示す信号が出力され、注目画素の方向性検出処理が終了する。また、ステップS22で平坦部ではない場合(No)、即ち、エッジ部がある場合には「方向性あり」と判定して、次のステップS24の処理に移行する。このように、ステップS22では平坦部であるか否かを検出することによりエッジの有無を検出する。なお、この場合の閾値Aの取り得る値の範囲は、方向性データ算出式により異なるが、閾値Aを大きくするほど平坦部と判定される画素データが増加し、閾値Aを小さくするほど平坦部と判定される画素データが減少する。    Next, in step S22, whether or not the maximum value of the directionality data detected in step S21 is smaller than the threshold value A stored in a register (not shown), that is, there is no edge near the target pixel and the luminance gradient is gentle. It is determined whether or not it is a flat portion. If this is a flat portion (Yes), a signal indicating “no directionality” is output in step S23, and the directionality detection processing of the pixel of interest ends. If it is not a flat part in step S22 (No), that is, if there is an edge part, it is determined that there is a direction, and the process proceeds to the next step S24. Thus, in step S22, the presence / absence of an edge is detected by detecting whether or not it is a flat portion. The range of values that can be taken by the threshold A in this case varies depending on the directionality data calculation formula, but as the threshold A is increased, the pixel data determined to be a flat portion increases, and as the threshold A is decreased, the flat portion is increased. Pixel data determined to be reduced.

ステップS24では、ステップS1で算出された4種類の方向性データから、値の一番小さい方向性が検出される。    In step S24, the directionality with the smallest value is detected from the four types of directionality data calculated in step S1.

その後のステップS25では、最小となる値の方向性データを有する方向が複数存在するかどうかが検出され、最小となる値の方向性データが複数存在する場合(Yes)には、ステップS23の処理に移行し、ステップS23で「方向性なし」を示す信号が出力されて注目画素の方向性検出処理が終了する。また、最小となる値の方向性データが複数存在しない場合(No)に、ステップS26の処理に移行する。    In subsequent step S25, it is detected whether or not there are a plurality of directions having the direction data having the minimum value. If there are a plurality of direction data having the minimum value (Yes), the process of step S23 is performed. In step S23, a signal indicating “no directionality” is output, and the directionality detection processing of the target pixel ends. If there is not a plurality of directional data having a minimum value (No), the process proceeds to step S26.

ステップS26では、ステップS24で検出された最小の方向性が出力され、注目画素の方向性検出処理が終了する。    In step S26, the minimum directionality detected in step S24 is output, and the directionality detection processing of the target pixel ends.

次に、図3に戻って、ステップS3では、方向性色信号算出部63によって、方向性検出部62で検出されたエッジ方向(エッジの方向性)に対応する色信号が算出される。この方向性色信号算出部63による方向性色信号の算出処理については、本実施形態1の特徴構成であるので詳細に後述する。    Next, returning to FIG. 3, in step S <b> 3, the directional color signal calculation unit 63 calculates a color signal corresponding to the edge direction (edge directionality) detected by the directionality detection unit 62. Since the directional color signal calculation processing by the directional color signal calculation unit 63 is a characteristic configuration of the first embodiment, it will be described in detail later.

次に、ステップS4では、注目画素色信号算出部64によって、ステップS3で方向性色信号算出部63で算出された色信号が注目画素における色信号として算出される。なお、ステップS2で方向性検出部62によって「方向性なし」と検出された画素については、バイリニア法を用いて色信号が算出される。    Next, in step S4, the target pixel color signal calculation unit 64 calculates the color signal calculated by the directional color signal calculation unit 63 in step S3 as a color signal in the target pixel. For the pixels detected as “no directionality” by the directionality detection unit 62 in step S2, a color signal is calculated using the bilinear method.

ステップS5を介して、全画素における補間処理が終了するまでステップS1〜S4の処理が繰り返される。   Through steps S5, the processes in steps S1 to S4 are repeated until the interpolation process for all pixels is completed.

以下に、方向性色信号算出部63(図3のステップS3)による色信号算出方法について、詳細に説明する。   Hereinafter, the color signal calculation method by the directional color signal calculation unit 63 (step S3 in FIG. 3) will be described in detail.

各エッジ方向について色信号を算出する方法は多数存在するが、ここでは、垂直方向および右斜め上方向について、色信号算出式を説明する。水平方向の色信号算出式は、垂直方向の色信号算出式を90度回転させることにより求めることができる。これと同様に、右斜め下方向の色信号算出式は、右斜め上方向の色信号算出式を90度回転することにより求めることができる。    There are many methods for calculating a color signal for each edge direction. Here, a color signal calculation formula will be described for the vertical direction and the upper right diagonal direction. The horizontal color signal calculation formula can be obtained by rotating the vertical color signal calculation formula by 90 degrees. Similarly, the color signal calculation formula in the lower right direction can be obtained by rotating the color signal calculation formula in the upper right direction by 90 degrees.

下記(式3)は、方向性色信号算出部63によって用いられる色信号算出式の一例である。
(式3)
・注目画素がG33の場合(図12(a)参照)
Gve=G33
Pve=(P32+P34)/2
Qve=G33+(Q23−G23’+Q43−G43’)/2
ただし
G23’=(G22+G24)/2
G43’=(G42+G44)/2
Gru=(2×G33+G42+G24)/4
Pru=Gru+(P32−G32’+P34−G34’)/2
Qru=Gru+(Q23−G23’+Q43−G43’)/2
とする。
The following (Formula 3) is an example of a color signal calculation formula used by the directional color signal calculation unit 63.
(Formula 3)
When the target pixel is G33 (see FIG. 12A)
Gve = G33
Pve = (P32 + P34) / 2
Qve = G33 + (Q23−G23 ′ + Q43−G43 ′) / 2
However, G23 ′ = (G22 + G24) / 2
G43 ′ = (G42 + G44) / 2
Gru = (2 × G33 + G42 + G24) / 4
Pru = Gru + (P32−G32 ′ + P34−G34 ′) / 2
Qru = Gru + (Q23−G23 ′ + Q43−G43 ′) / 2
And

・注目画素がP33の場合(図12(b)参照)
Gve=(G32+G34)/2
Pve=P33
Qve=Gve+(Q23’−G23+Q43’−G43)/2
ただし、G32’=(G22+G42)/2
G34’=(G24+G44)/2
G23’=(G22+G24)/2
G43’=(G42+G44)/2
とする。
When the target pixel is P33 (see FIG. 12B)
Gve = (G32 + G34) / 2
Pve = P33
Qve = Gve + (Q23′−G23 + Q43′−G43) / 2
However, G32 ′ = (G22 + G42) / 2
G34 '= (G24 + G44) / 2
G23 ′ = (G22 + G24) / 2
G43 ′ = (G42 + G44) / 2
And

ただし、
Q23’=(Q22+Q24)/2
Q43’=(Q42+Q44)/2
Pru=P33
Qru=(Q42+Q24)/2
Gru=S33+(Ga−Sa+Gb−Sb)/2
とする。
However,
Q23 '= (Q22 + Q24) / 2
Q43 '= (Q42 + Q44) / 2
Pru = P33
Qru = (Q42 + Q24) / 2
Gru = S33 + (Ga-Sa + Gb-Sb) / 2
And

ただし、
S33=(2×P33+Q42+Q24)/4
Sa=(P33+Q22)/2
Ga=(G32+G23)/2
Sb=(P33+Q44)/2
Gb=(G34+G43)/2
Gve:垂直方向のG成分色信号
Pve:垂直方向のP成分色信号
Qve:垂直方向のQ成分色信号
Gru:右斜め上方向のG成分色信号
Pru:右斜め上方向のP成分色信号
Qru:右斜め上方向のQ成分色信号
とする。
However,
S33 = (2 × P33 + Q42 + Q24) / 4
Sa = (P33 + Q22) / 2
Ga = (G32 + G23) / 2
Sb = (P33 + Q44) / 2
Gb = (G34 + G43) / 2
Gve: G component color signal in the vertical direction Pve: P component color signal in the vertical direction Qve: Q component color signal in the vertical direction Gru: G component color signal in the upper right direction Pru: P component color signal in the upper right direction Qru : Q component color signal in the upper right direction.

以下に、上記(式3)の導き方について説明する。    Hereinafter, how to derive the above (formula 3) will be described.

まず、注目画素がG成分のときの垂直方向(検出エッジ方向が垂直方向の場合)の色信号の導き方、次に、注目画素がP成分のときの垂直方向の色信号の導き方、続いて、注目画素がG成分のときの右斜め上方向(検出エッジ方向が右斜め上方向の場合)の色信号の導き方、最後に、注目画素がP成分のときの右斜め上方向の色信号の導き方について順次説明する。    First, a method for deriving a color signal in the vertical direction when the pixel of interest is the G component (when the detection edge direction is the vertical direction), a method of deriving a color signal in the vertical direction when the pixel of interest is the P component, The method of deriving the color signal in the upper right direction when the target pixel is the G component (when the detection edge direction is the upper right direction), and finally, the color in the upper right direction when the target pixel is the P component. The method of deriving signals will be described sequentially.

まず、注目画素V33がG成分のときの垂直方向の色信号算出式(式3)の導き方について、画素の位置を示す図7および図12(a)を用いて説明する。   First, how to derive the vertical color signal calculation formula (Formula 3) when the pixel of interest V33 is the G component will be described with reference to FIGS. 7 and 12A showing the pixel positions.

上記(式3)において、垂直方向の色信号のG成分、R成分およびB成分は、Gve、PveおよびQveで表されている。ただし、PveはR成分またはB成分であり、QveはB成分またはR成分である。    In the above (Formula 3), the G component, R component, and B component of the color signal in the vertical direction are represented by Gve, Pve, and Qve. However, Pve is R component or B component, and Qve is B component or R component.

注目画素V33のG信号Gveとしては、値G33が用いられる。    The value G33 is used as the G signal Gve for the pixel of interest V33.

また、注目画素V33のP信号Pveとしては、垂直方向の1画素隣(V32とV34)の画素成分の平均値が用いられる。    As the P signal Pve for the target pixel V33, an average value of pixel components adjacent to one pixel in the vertical direction (V32 and V34) is used.

さらに、注目画素V33のQ信号Qveは、垂直方向における色信号の差に関する相関性を利用して算出される。    Further, the Q signal Qve of the pixel of interest V33 is calculated using the correlation related to the color signal difference in the vertical direction.

ここで、色信号の差に関する相関性とは、「局所領域において色信号の変化は少なく、異なる色成分の差はほぼ一定である」という性質のことである。即ち、方向性を考慮した近傍画素のQ成分Q’とG成分G’とを算出し、注目画素のQ成分QとG成分Gとの関係から、以下の(式4)を用いて、注目画素のQ成分Qを導くことができる。P成分に関しても同様である。
(式4)
Q=G+(Q’−G’)
P=G+(P’−G’)
ここでは、画素V23、画素V43および画素V33に注目して、画素V23におけるG成分G23’とQ成分Q23との差、画素V43におけるG成分G43’とQ成分Q43との差、および画素V33におけるG成分G33とQ成分Q33との差がほぼ等しいとする。画素V23におけるQ成分とG成分との差、および画素V43におけるQ成分とG成分との差の平均を、上記(式4)の(Q’−G’)として、注目画素V33におけるQ成分Q33が算出される。
Here, the correlation relating to the difference between the color signals is a property that “the change in the color signals is small in the local region and the difference between the different color components is substantially constant”. In other words, the Q component Q ′ and the G component G ′ of the neighboring pixels in consideration of the directionality are calculated, and the following (formula 4) is used to calculate the attention from the relationship between the Q component Q and the G component G of the target pixel. The Q component Q of the pixel can be derived. The same applies to the P component.
(Formula 4)
Q = G + (Q′−G ′)
P = G + (P′−G ′)
Here, paying attention to the pixel V23, the pixel V43, and the pixel V33, the difference between the G component G23 ′ and the Q component Q23 in the pixel V23, the difference between the G component G43 ′ and the Q component Q43 in the pixel V43, and the difference in the pixel V33 It is assumed that the difference between the G component G33 and the Q component Q33 is substantially equal. The average of the difference between the Q component and the G component in the pixel V23 and the difference between the Q component and the G component in the pixel V43 is defined as (Q′−G ′) in (Equation 4), and the Q component Q33 in the target pixel V33. Is calculated.

次に、注目画素V33がP成分のときの垂直方向の色信号算出式(式3)の導き方について、画素の位置を示す図7および図12(b)を用いて説明する。   Next, how to derive the vertical color signal calculation formula (Formula 3) when the pixel of interest V33 is the P component will be described with reference to FIGS. 7 and 12B showing the pixel positions.

注目画素V33のG信号Gveとしては、垂直方向の1画素隣(V32とV34)の画素成分の平均値が用いられる。    As the G signal Gve of the target pixel V33, an average value of pixel components adjacent to one pixel (V32 and V34) in the vertical direction is used.

また、注目画素V33のP信号Pveとしては、値P33が用いられる。    The value P33 is used as the P signal Pve for the pixel of interest V33.

さらに、注目画素V33のQ信号Qveは、注目画素がG成分のときと同様に、垂直方向における色信号の差に関する相関性を利用して算出される。    Further, the Q signal Qve of the target pixel V33 is calculated using the correlation regarding the color signal difference in the vertical direction as in the case where the target pixel is the G component.

ここでは、画素V23、画素V43および画素V33に注目して、画素V23におけるG成分G23とQ成分Q23’との差、画素V43におけるG成分G43とQ成分Q43’との差、および画素V33におけるG成分GveとQ成分Q33との差がほぼ等しいとする。画素V23におけるQ成分とG成分との差、および画素V43におけるQ成分とG成分との差の平均を、上記(式4)の(Q’−G’)として、注目画素V33におけるQ成分Q33が算出される。    Here, paying attention to the pixel V23, the pixel V43, and the pixel V33, the difference between the G component G23 and the Q component Q23 ′ in the pixel V23, the difference between the G component G43 and the Q component Q43 ′ in the pixel V43, and the difference in the pixel V33 It is assumed that the difference between the G component Gve and the Q component Q33 is almost equal. The average of the difference between the Q component and the G component in the pixel V23 and the difference between the Q component and the G component in the pixel V43 is defined as (Q′−G ′) in (Equation 4), and the Q component Q33 in the target pixel V33. Is calculated.

続いて、注目画素V33がG成分のときの右斜め上方向の色信号算出式(式3)の導き方について、画素の位置を示す図7および図12(a)を用いて説明する。   Next, a method of deriving the color signal calculation formula (formula 3) in the upper right direction when the target pixel V33 is the G component will be described with reference to FIGS. 7 and 12A showing the pixel positions.

上記(式3)において、右斜め上方向の色信号のG成分、R成分およびB成分は、Gru、PruおよびQruで表されている。ただし、PruはR成分またはB成分であり、QruはB成分またはR成分である。    In the above (Expression 3), the G component, the R component, and the B component of the color signal in the diagonally upper right direction are represented by Gru, Pru, and Qru. However, Pru is an R component or a B component, and Qru is a B component or an R component.

注目画素V33のG成分Gruは、画素V33、画素V42および画素V24から算出される。    The G component Gru of the target pixel V33 is calculated from the pixel V33, the pixel V42, and the pixel V24.

また、注目画素V33のP成分Pruおよび注目画素V33のQ成分Qruは、右斜め上方向における色信号の差に関する相関性を利用して算出される。    In addition, the P component Pru of the target pixel V33 and the Q component Qru of the target pixel V33 are calculated using the correlation regarding the color signal difference in the upper right direction.

まず、注目画素V33のP成分について、色相関を利用した色信号の算出方法を説明する。     First, a method for calculating a color signal using color correlation for the P component of the target pixel V33 will be described.

ここでは、画素V32、画素V34および画素V33に注目して、画素V32におけるP成分P32とG成分G32’との差、画素V34におけるP成分P34とG成分G34’との差、および画素V33におけるP成分P33とG成分G33との差がほぼ等しいとする。    Here, paying attention to the pixel V32, the pixel V34, and the pixel V33, the difference between the P component P32 and the G component G32 ′ in the pixel V32, the difference between the P component P34 and the G component G34 ′ in the pixel V34, and the difference in the pixel V33 Assume that the difference between the P component P33 and the G component G33 is substantially equal.

本発明の主な特徴構成の一つは、G成分G32’およびG34’の求め方にある。従来法では、画素V32の右斜め上方向のG成分を求めようとするときに、画素V32を含む右斜め上方向の画素から算出してきた。しかしながら、画素V32を含む右斜め上方向にはP成分とQ成分しか存在しないため、G成分を求めることができなかった。    One of the main characteristic configurations of the present invention is how to obtain the G components G32 'and G34'. In the conventional method, when trying to obtain the G component in the upper right direction of the pixel V32, the G component is calculated from the upper right pixel including the pixel V32. However, since only the P component and the Q component exist in the upper right direction including the pixel V32, the G component cannot be obtained.

これに対して、本実施形態1では、画素V32のG成分G32’の値を求めるために、右斜め上方向の画素以外の画素を参照することを特徴としている。    On the other hand, the first embodiment is characterized by referring to pixels other than the pixels in the diagonally upper right direction in order to obtain the value of the G component G32 'of the pixel V32.

例えば、画素V32におけるG成分G32’の値として、G成分G22とG成分G42との平均値が用いられる。同様に、画素V34におけるG成分G34’の値としてG成分、G24とG成分G44との平均値が用いられる。    For example, the average value of the G component G22 and the G component G42 is used as the value of the G component G32 'in the pixel V32. Similarly, the G component, and the average value of G24 and G component G44 are used as the value of the G component G34 'in the pixel V34.

このようにして算出されたG成分を用いて、上記垂直方向の色相関性のときと同様に、画素V32におけるP成分とG成分との差と、画素V34におけるP成分とG成分との差との平均値を上記(式4)の(P’−G’)として、注目画素V33におけるP成分P33が算出される。    Using the G component thus calculated, the difference between the P component and the G component in the pixel V32 and the difference between the P component and the G component in the pixel V34 are the same as in the case of the color correlation in the vertical direction. The P component P33 in the pixel of interest V33 is calculated using (P′−G ′) in (Equation 4) as an average value.

次に、注目画素V33のQ成分について、色相関を利用した色信号の算出方法を説明する。基本的には、P成分と同様の手順で色信号が算出される。    Next, a method for calculating a color signal using color correlation for the Q component of the target pixel V33 will be described. Basically, the color signal is calculated in the same procedure as the P component.

ここでは、画素V23、画素V43および画素V33に注目して、画素V23におけるQ成分Q23とG成分G23’との差、画素V43におけるQ成分Q43とG成分G43’との差、および画素V33におけるQ成分Q33とG成分G33との差がほぼ等しいとする。    Here, paying attention to the pixel V23, the pixel V43, and the pixel V33, the difference between the Q component Q23 and the G component G23 ′ in the pixel V23, the difference between the Q component Q43 and the G component G43 ′ in the pixel V43, and the difference in the pixel V33 Assume that the difference between the Q component Q33 and the G component G33 is substantially equal.

例えば、画素V23におけるQ成分とG成分との差と、画素V43におけるQ成分とG成分との差との平均値を上記(式4)の(Q’−G’)として、注目画素V33におけるQ成分Q33が算出される。    For example, the average value of the difference between the Q component and the G component in the pixel V23 and the difference between the Q component and the G component in the pixel V43 is defined as (Q′−G ′) in (Equation 4), and A Q component Q33 is calculated.

最後に、注目画素V33がP成分のときの右斜め上方向の色信号算出式(式3)の導き方について、画素の位置を示す図7および図12(b)を用いて説明する。    Finally, how to derive the color signal calculation formula (formula 3) in the upper right direction when the target pixel V33 is the P component will be described with reference to FIGS. 7 and 12B showing the pixel positions.

注目画素V33のP成分Pruとしては、値P33が用いられる。    The value P33 is used as the P component Pru of the target pixel V33.

また、注目画素V33のQ成分Qruとしては、右斜め上方向の1画素隣(V42とV24)の画素値の平均値が用いられる。    Further, as the Q component Qru of the target pixel V33, an average value of pixel values adjacent to one pixel (V42 and V24) in the diagonally upper right direction is used.

さらに、注目画素V33のG成分Gruは、右斜め上方向における色信号の差に関する相関性を利用して算出される。    Further, the G component Gru of the target pixel V33 is calculated by using the correlation regarding the color signal difference in the upper right direction.

図7において、画素V22、画素V32、画素V23および画素V33の4画素が交わる点(位置)を点Aとする。また、画素V33、画素V43、画素V34および画素V44の4画素が交わる点(位置)を点Bとする。    In FIG. 7, a point (position) where four pixels of the pixel V22, the pixel V32, the pixel V23, and the pixel V33 intersect is defined as a point A. In addition, a point (position) where four pixels of the pixel V33, the pixel V43, the pixel V34, and the pixel V44 intersect is a point B.

ここでは、画素V33の他に、点Aおよび点Bの各位置に注目する。画素V33におけるP成分とQ成分との平均値S33とG成分G33との差、点AにおけるP成分とQ成分との平均値SaとG成分Gaとの差、および点BにおけるP成分とQ成分の平均SbとG成分Gbとの差がほぼ等しいとする。    Here, attention is paid to the positions of point A and point B in addition to the pixel V33. The difference between the average value S33 and the G component G33 of the P component and the Q component in the pixel V33, the difference between the average value Sa and the G component Ga of the P component and the Q component at the point A, and the P component and the Q at the point B It is assumed that the difference between the component average Sb and the G component Gb is substantially equal.

ここで、局所領域における色信号の差に関する相関性より、上記(式4)と同様に、以下の(式5)が導かれる。
(式5)
G=S+(G’−S’)
G:注目画素のG成分
S:注目画素のP成分とQ成分の平均値
G’:注目画素の近傍点におけるG成分
S’:注目画素の近傍点におけるP成分とQ成分の平均値
ただし、
G’およびS’において、注目画素の近傍点は同じ位置
とする。
Here, the following (Formula 5) is derived from the correlation related to the color signal difference in the local region, as in the above (Formula 4).
(Formula 5)
G = S + (G′−S ′)
G: G component of the pixel of interest S: Average value of the P component and Q component of the pixel of interest G ′: G component at the neighborhood point of the pixel of interest S ′: Average value of the P component and Q component at the neighborhood point of the pixel of interest
In G ′ and S ′, the neighboring points of the target pixel are set to the same position.

これにより、点AにおけるS値とG成分との差、および点BにおけるS値とG成分との差の平均値を上記(式5)の(G’−S’)として、注目画素V33におけるG成分G33が算出される。    As a result, the average value of the difference between the S value and the G component at the point A and the difference between the S value and the G component at the point B is set as (G′−S ′) in the above (Expression 5). A G component G33 is calculated.

以上説明したように、本実施形態1によれば、画像の局所領域における特性を利用すると共に、斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行うことができる。斜め方向の色相関を利用して色信号を算出することができるため、従来の垂直方向および水平方向の色相関を利用した補間処理法よりも精密な画像の方向性検出を行って、色信号を算出することができる。    As described above, according to the first embodiment, it is possible to perform the interpolation process using the characteristics in the local region of the image and also using the correlation of the color signal with the edge in the oblique direction. Since the color signal can be calculated using the color correlation in the diagonal direction, the color signal can be detected more accurately than the conventional interpolation processing method using the color correlation in the vertical and horizontal directions. Can be calculated.

例えば、図13(a)に示す輝度値を有するベイヤ配列において、注目画素G33に対して、本実施形態1による方向性データ算出式(式2)を用いると、
DDru=248
DDho=744
DDrd=744
DDve=434
となり、方向性検出部62は、方向性データの値が最小値となる方向「DDru;右斜め上方向」を注目画素付近におけるエッジ方向として検出する。
For example, in the Bayer array having the luminance value shown in FIG. 13A, the directional data calculation formula (Formula 2) according to the first embodiment is used for the target pixel G33.
DDru = 248
DDho = 744
DDrd = 744
DDve = 434
Thus, the directionality detection unit 62 detects the direction “DDru; diagonally right upward” in which the value of the directionality data is the minimum value as the edge direction in the vicinity of the target pixel.

本実施形態1による色信号算出式(式3)を用いると、
Gru=(2×G33+G24+G42)/4=64
Rru=(R32+R34)/2+(2×G33−G22−G44)/4=64
Bru=(B23+B43)/2+(2×G33−G22−G44)/4=64
となり、
R=G=B
となるため、偽色信号のない色信号を算出することができる。
When the color signal calculation formula (Formula 3) according to the first embodiment is used,
Gru = (2 × G33 + G24 + G42) / 4 = 64
Rru = (R32 + R34) / 2 + (2 × G33−G22−G44) / 4 = 64
Bru = (B23 + B43) / 2 + (2 × G33−G22−G44) / 4 = 64
And
R = G = B
Therefore, a color signal without a false color signal can be calculated.

本発明の特徴構成の一つは、「注目画素の色成分は近傍点の色成分に相関性がある」ということを利用して、近傍画素以外の近傍点における色信号の相関性を用いた点にある。    One of the characteristic configurations of the present invention uses the correlation of color signals at neighboring points other than neighboring pixels by utilizing the fact that “the color component of the pixel of interest is correlated with the color components of neighboring points”. In the point.

従来法では、画素の中心における色信号を算出して、その画素値と算出された色信号とを用いて、注目画素の色成分との相関性により注目画素の色信号を算出していた。    In the conventional method, the color signal at the center of the pixel is calculated, and the color signal of the target pixel is calculated based on the correlation with the color component of the target pixel using the pixel value and the calculated color signal.

本発明では、注目画素付近の任意の点(位置)における色成分を算出して、注目画素の色信号との相関性により色信号を算出するため、同じ方向性における色信号算出式であっても、様々な色信号算出式を導くことが可能である。    In the present invention, the color component at an arbitrary point (position) near the target pixel is calculated, and the color signal is calculated based on the correlation with the color signal of the target pixel. In addition, various color signal calculation formulas can be derived.

なお、以下に、いくつかの色信号算出式の例について説明する。    Hereinafter, examples of several color signal calculation formulas will be described.

まず、図12(a)を参照して、注目画素がG成分の場合について、右斜め上方向の色信号算出式を下記(式6)および(式7)に示す。
(式6)
Gru=(2×G33+G42+G24)/4
Pru=Gru+(Pa−Ga+Pb−Gb)/2
Qru=Gru+(Qa−Ga+Qb−Gb)/2
ただし、
Ga=(G22+G33)/2
Pa=(3×P32+P14)/4
Qa=(3×Q23+Q41)/4
Gb=(G33+G44)/2
Pb=(3×P34+P52)/4
Qb=(3×Q43+Q25)/4
とする。
First, with reference to FIG. 12A, the color signal calculation formulas in the upper right direction when the pixel of interest is the G component are shown in the following (formula 6) and (formula 7).
(Formula 6)
Gru = (2 × G33 + G42 + G24) / 4
Pru = Gru + (Pa-Ga + Pb-Gb) / 2
Qru = Gru + (Qa-Ga + Qb-Gb) / 2
However,
Ga = (G22 + G33) / 2
Pa = (3 × P32 + P14) / 4
Qa = (3 × Q23 + Q41) / 4
Gb = (G33 + G44) / 2
Pb = (3 × P34 + P52) / 4
Qb = (3 × Q43 + Q25) / 4
And

上記(式6)は、図7に示すV22、V32、V23およびV33の交点Aの位置と、V33、V43、V34およびV44の交点Bの位置と、注目画素とにおけるG成分、P成分およびQ成分について、色信号の差に関する相関性を利用して色信号を求めた式である。
(式7)
Gru=(2×G33+G42+G24)/4
Pru=Gru+(Pa−Ga+Pb−Gb)/2
Qru=Gru+(Qa−Ga+Qb−Gb)/2
ただし、
Ga=(2×G24+G33+G15)/4
Pa=(P14+P34)/2
Qa=(Q23+Q25)/2
Gb=(2×G42+G33+G51)/4
Pb=(P32+P52)/2
Qb=(Q41+Q43)/2
とする。
The above (Expression 6) is obtained by calculating the position of the intersection A of V22, V32, V23 and V33 shown in FIG. 7, the position of the intersection B of V33, V43, V34 and V44, and the G component, P component and Q at the target pixel. This is an equation for obtaining a color signal using a correlation regarding a difference in color signals.
(Formula 7)
Gru = (2 × G33 + G42 + G24) / 4
Pru = Gru + (Pa-Ga + Pb-Gb) / 2
Qru = Gru + (Qa-Ga + Qb-Gb) / 2
However,
Ga = (2 × G24 + G33 + G15) / 4
Pa = (P14 + P34) / 2
Qa = (Q23 + Q25) / 2
Gb = (2 × G42 + G33 + G51) / 4
Pb = (P32 + P52) / 2
Qb = (Q41 + Q43) / 2
And

上記(式7)は、図7に示すV24、V42および注目画素におけるG成分、P成分およびQ成分について、色信号の差に関する相関性を利用して色信号を求めた式である。    The above (Expression 7) is an expression in which a color signal is obtained by utilizing the correlation regarding the difference between the color signals for V24, V42 and the G component, P component, and Q component in the target pixel shown in FIG.

次に、図12(b)を参照して、注目画素がP成分の場合について、右斜め上方向の色信号算出式を、下記(式8)および(式9)に示す。
(式8)
Pru=P33
Qru=(Q42+Q24)/2
Gru=P33+(Ga−Pa+Gb−Pb)/2
ただし、
Pa=(2×P33+P31+P13)/4
Ga=(G32+G23)/2
Pb=(2×P33+P35+P53)/4
Gb=(G34+G43)/2
とする。
Next, with reference to FIG. 12B, the following equations (Equation 8) and (Equation 9) show the color signal calculation expressions in the diagonally upper right direction when the target pixel is the P component.
(Formula 8)
Pru = P33
Qru = (Q42 + Q24) / 2
Gru = P33 + (Ga−Pa + Gb−Pb) / 2
However,
Pa = (2 × P33 + P31 + P13) / 4
Ga = (G32 + G23) / 2
Pb = (2 × P33 + P35 + P53) / 4
Gb = (G34 + G43) / 2
And

上記(式8)は、V22、V32、V23およびV33の交点Aの位置と、V33、V43、V34およびV44の交点Bの位置と、注目画素とにおけるG成分およびP成分について、色信号の差に関する相関性を利用して色信号を求めた式である。
(式9)
Pru=P33
Qru=(Q42+Q24)/2
Gru=S33+(Ga−Sa+Gb−Sb)/2
ただし、
S33=(2×P33+Q42+Q24)/4
Sa=(2×P33+P31+P13+2×Q22+Q24+Q42)/8
Ga=(G41+3×G32+3×G23+G14)/8
Sb=(2×P33+P35+P53+2×Q44+Q24+Q42)/8
Gb=(G25+3×G34+3×G43+G52)/8
とする。
The above (Equation 8) shows the difference in color signal between the position of the intersection A of V22, V32, V23 and V33, the position of the intersection B of V33, V43, V34 and V44, and the G component and P component at the target pixel. This is an equation for obtaining a color signal by utilizing the correlation of.
(Formula 9)
Pru = P33
Qru = (Q42 + Q24) / 2
Gru = S33 + (Ga-Sa + Gb-Sb) / 2
However,
S33 = (2 × P33 + Q42 + Q24) / 4
Sa = (2 × P33 + P31 + P13 + 2 × Q22 + Q24 + Q42) / 8
Ga = (G41 + 3 × G32 + 3 × G23 + G14) / 8
Sb = (2 × P33 + P35 + P53 + 2 × Q44 + Q24 + Q42) / 8
Gb = (G25 + 3 × G34 + 3 × G43 + G52) / 8
And

上記(式9)は、V22、V32、V23およびV33の交点Aの位置と、V33、V43、V34およびV44の交点Bの位置と、注目画素とにおけるG成分とP成分およびQ成分の平均値とについて、色信号の差に関する相関性を利用して色信号を求めた式である。    The above (Expression 9) is the average value of the G component, the P component, and the Q component at the position of the intersection A of V22, V32, V23, and V33, the position of the intersection B of V33, V43, V34, and V44, and the target pixel. Is a formula for obtaining a color signal by utilizing the correlation with respect to the difference between the color signals.

上記(式3)および(式6)〜(式9)以外にも、様々な色信号算出式を考えることが可能である。
(実施形態2)
本実施形態2では、上記実施形態1の方向性色信号算出部63による処理(図3のステップS3)が色差相関を用いる場合とは異なり、色比相関を用いる場合について説明する。即ち、上記実施形態1では色信号の差に関する相関性を利用して色信号を算出したが、本実施形態2では色信号の比に関する相関性を利用して色信号を算出する場合である。
In addition to the above (Expression 3) and (Expression 6) to (Expression 9), various color signal calculation expressions can be considered.
(Embodiment 2)
In the second embodiment, a case where the color ratio correlation is used is described, unlike the case where the process (step S3 in FIG. 3) by the directional color signal calculation unit 63 of the first embodiment uses the color difference correlation. That is, in the first embodiment, the color signal is calculated using the correlation related to the color signal difference, but in the second embodiment, the color signal is calculated using the correlation related to the ratio of the color signals.

図1および図2に示すように、本実施形態2のが画像処理装置10Aは、被写体を撮像可能とする固体撮像素子1と、固体撮像素子1からの撮像データをA/D変換するA/D変換部2と、このA/D変換部2からのデジタル信号を各種信号処理する画像処理装置としての画像処理部3Aとを有している。   As shown in FIGS. 1 and 2, the image processing apparatus 10 </ b> A according to the second embodiment is a solid-state imaging device 1 that can image a subject, and A / D that performs A / D conversion on imaging data from the solid-state imaging device 1. A D conversion unit 2 and an image processing unit 3A as an image processing apparatus that performs various signal processing on the digital signal from the A / D conversion unit 2 are provided.

画像処理部3Aは、ホワイトバランス部4と、ガンマ補正部5と、データ補間部6Aとを有している。データ補間部6Aは、方向性データ算出部61と、方向性検出部62と、方向性色信号算出部63Aと、注目画素色信号算出部64と、これらを制御する制御部65とを有している。   The image processing unit 3A includes a white balance unit 4, a gamma correction unit 5, and a data interpolation unit 6A. The data interpolation unit 6A includes a directional data calculation unit 61, a directional detection unit 62, a directional color signal calculation unit 63A, a target pixel color signal calculation unit 64, and a control unit 65 that controls these. ing.

方向性色信号算出部63Aは、注目画素の近傍の任意の点において方向性を考慮した異なる2色の色信号の比を算出する色差算出部(図示せず)と、その色比算出部によって算出された色信号の比の相関性を用いて色信号を算出する色信号算出部(図示せず)とを有する。   The directional color signal calculation unit 63A includes a color difference calculation unit (not shown) that calculates a ratio between two different color signals in consideration of the directionality at an arbitrary point near the target pixel, and the color ratio calculation unit. A color signal calculation unit (not shown) that calculates a color signal by using the correlation of the calculated ratio of the color signal.

以下に、本実施形態2における方向性色信号算出部63A(図3のステップS3に対応)による色信号算出方法について説明する。なお、方向性データ算出部61(図3のステップS1)、方向性検出部62(図3のステップS2)および注目画素色信号算出部64(図3のステップS4)については、上記実施形態1の場合と同様の処理を行うことができるので、ここではその説明を省略する。   Hereinafter, a color signal calculation method by the directional color signal calculation unit 63A (corresponding to step S3 in FIG. 3) according to the second embodiment will be described. The directionality data calculation unit 61 (step S1 in FIG. 3), the directionality detection unit 62 (step S2 in FIG. 3), and the target pixel color signal calculation unit 64 (step S4 in FIG. 3) are described in the first embodiment. Since the same processing as in the above case can be performed, the description thereof is omitted here.

ここで、色信号の比に関する相関性とは、「局所領域において色信号の変化は少なく、異なる色成分の比はほぼ一定である」という性質のことである。即ち、方向性を考慮した近傍画素のQ成分Q’とG成分G’とを算出し、注目画素のQ成分QとG成分Gとの関係から、以下の(式10)を用いて、注目画素のQ成分Qを導くことができる。P成分に関しても同様である。
(式10)
Q=G×(Q’/G’)
P=G×(P’/G’)
各方向について色信号を算出する方法は多数存在するが、ここでは、上記実施形態1の場合と同様に、垂直方向および右斜め上方向について、色信号算出式を説明する。水平方向の色信号算出式は、垂直方向の色信号算出式を90度回転することにより求めることができる。同様に、右斜め下方向の色信号算出式は、右斜め上方向の色信号算出式を90度回転することにより求めることができる。
Here, the correlation related to the ratio of the color signals is a property that “the change of the color signals is small in the local region and the ratio of the different color components is substantially constant”. That is, the Q component Q ′ and the G component G ′ of neighboring pixels are calculated in consideration of the directionality, and the following (formula 10) is used to calculate the attention from the relationship between the Q component Q and the G component G of the target pixel. The Q component Q of the pixel can be derived. The same applies to the P component.
(Formula 10)
Q = G × (Q ′ / G ′)
P = G × (P ′ / G ′)
There are many methods for calculating the color signal for each direction. Here, as in the case of the first embodiment, the color signal calculation formula will be described for the vertical direction and the diagonally upper right direction. The horizontal color signal calculation formula can be obtained by rotating the vertical color signal calculation formula by 90 degrees. Similarly, the color signal calculation formula in the lower right direction can be obtained by rotating the color signal calculation formula in the upper right direction by 90 degrees.

下記(式11)は、方向性色信号算出部63Aによって用いられる色信号算出式の一例である。
(式11)
・注目画素がG33の場合(図12(a)参照)
Gve=G33
Pve=(P32+P34)/2
Qve=G33×(Q23/G23’+Q43/G43’)/2
ただし、
G23’=(G22+G24)/2
G43’=(G42+G44)/2
Gru=(2×G33+G42+G24)/2
Pru=Gru×(P32/G32’+P34/G34’)/2
Qru=Gru×(Q23/G23’+Q43/G43’)/2
とする。
The following (Formula 11) is an example of a color signal calculation formula used by the directional color signal calculation unit 63A.
(Formula 11)
When the target pixel is G33 (see FIG. 12A)
Gve = G33
Pve = (P32 + P34) / 2
Qve = G33 × (Q23 / G23 ′ + Q43 / G43 ′) / 2
However,
G23 ′ = (G22 + G24) / 2
G43 ′ = (G42 + G44) / 2
Gru = (2 × G33 + G42 + G24) / 2
Pru = Gru × (P32 / G32 ′ + P34 / G34 ′) / 2
Qru = Gru × (Q23 / G23 ′ + Q43 / G43 ′) / 2
And

ただし、
G32’=(G22+G42)/2
G34’=(G24+G44)/2
G23’=(G22+G24)/2
G43’=(G42+G44)/2
とする。
However,
G32 '= (G22 + G42) / 2
G34 '= (G24 + G44) / 2
G23 ′ = (G22 + G24) / 2
G43 ′ = (G42 + G44) / 2
And

・注目画素がP33の場合(図12(b)参照)
Gve=(G32+G34)/2
Pve=P33
Qve=Gve×(Q23’/G23+Q43’/G43)/2
ただし、
Q23’=(Q22+Q24)/2
Q43’=(Q42+Q44)/2
Pru=P33
Qru=(Q42+Q24)/2
Gru=S33×(Ga/Sa+Gb/Sb)/2
とする。
When the target pixel is P33 (see FIG. 12B)
Gve = (G32 + G34) / 2
Pve = P33
Qve = Gve × (Q23 ′ / G23 + Q43 ′ / G43) / 2
However,
Q23 '= (Q22 + Q24) / 2
Q43 '= (Q42 + Q44) / 2
Pru = P33
Qru = (Q42 + Q24) / 2
Gru = S33 × (Ga / Sa + Gb / Sb) / 2
And

ただし、
S33=(2×P33+Q42+Q24)/4
Sa=(P33+Q22)/2
Ga=(G32+G23)/2
Sb=(P33+Q44)/2
Gb=(G34+G43)/2
Gve:垂直方向のG成分色信号
Pve:垂直方向のP成分色信号
Qve:垂直方向のQ成分色信号
Gru:右斜め上方向のG成分色信号
Pru:右斜め上方向のP成分色信号
Qru:右斜め上方向のQ成分色信号
とする。
However,
S33 = (2 × P33 + Q42 + Q24) / 4
Sa = (P33 + Q22) / 2
Ga = (G32 + G23) / 2
Sb = (P33 + Q44) / 2
Gb = (G34 + G43) / 2
Gve: G component color signal in the vertical direction Pve: P component color signal in the vertical direction Qve: Q component color signal in the vertical direction Gru: G component color signal in the upper right direction Pru: P component color signal in the upper right direction Qru : Q component color signal in the upper right direction.

以下に、上記(式11)の導き方について説明する。    In the following, how to derive the above (formula 11) will be described.

まず、注目画素がG成分のときの垂直方向(検出エッジ方向が垂直方向の場合)の色信号の導き方、次に、注目画素がP成分のときの垂直方向の色信号の導き方、続いて、注目画素がG成分のときの右斜め上方向(検出エッジ方向が右斜め上方向の場合)の色信号の導き方、最後に、注目画素がP成分のときの右斜め上方向の色信号の導き方について説明する。    First, a method for deriving a color signal in the vertical direction when the pixel of interest is the G component (when the detection edge direction is the vertical direction), a method of deriving a color signal in the vertical direction when the pixel of interest is the P component, The method of deriving the color signal in the upper right direction when the target pixel is the G component (when the detection edge direction is the upper right direction), and finally, the color in the upper right direction when the target pixel is the P component. A method for deriving signals will be described.

まず、注目画素V33がG成分のときの垂直方向の色信号算出式(式11)の導き方について、画素の位置を示す図7および図12(a)を用いて説明する。   First, how to derive the vertical color signal calculation formula (Formula 11) when the target pixel V33 is the G component will be described with reference to FIGS. 7 and 12A showing the pixel positions.

上記(式11)において、垂直方向の色信号のG成分、R成分およびB成分は、Gve、PveおよびQveで表されている。ただし、PveはR成分またはB成分であり、QveはB成分またはR成分である。    In the above (Formula 11), the G component, R component, and B component of the color signal in the vertical direction are represented by Gve, Pve, and Qve. However, Pve is R component or B component, and Qve is B component or R component.

注目画素V33のG信号Gveとしては、値G33が用いられる。    The value G33 is used as the G signal Gve for the pixel of interest V33.

また、注目画素V33のP信号Pveとしては、垂直方向の1画素隣(V32とV34)の画素成分の平均値が用いられる。    As the P signal Pve for the target pixel V33, an average value of pixel components adjacent to one pixel in the vertical direction (V32 and V34) is used.

さらに、注目画素V33のQ信号Qveは、垂直方向における色信号の比に関する相関性を利用して算出される。    Further, the Q signal Qve of the pixel of interest V33 is calculated using the correlation regarding the ratio of the color signals in the vertical direction.

ここでは、画素V23、画素V43および画素V33に注目して、画素V23におけるG成分G23’とQ成分Q23との比、画素V43におけるG成分G43’とQ成分Q43との比、および画素V33におけるG成分G33とQ成分Q33との比がほぼ等しいとする。画素V23におけるQ成分とG成分との比と、画素V43におけるQ成分とG成分との比の平均値を上記(式10)の(Q’/G’)として、注目画素V33におけるQ成分Q33が算出される。    Here, paying attention to the pixel V23, the pixel V43, and the pixel V33, the ratio between the G component G23 ′ and the Q component Q23 in the pixel V23, the ratio between the G component G43 ′ and the Q component Q43 in the pixel V43, and the ratio in the pixel V33 Assume that the ratio of the G component G33 and the Q component Q33 is substantially equal. The average value of the ratio between the Q component and the G component in the pixel V23 and the ratio between the Q component and the G component in the pixel V43 is set to (Q ′ / G ′) in the above (Equation 10), and the Q component Q33 in the target pixel V33. Is calculated.

次に、注目画素V33がP成分のときの垂直方向の色信号算出式(式11)の導き方について、画素の位置を示す図7および図12(b)を用いて説明する。   Next, how to derive the vertical color signal calculation formula (formula 11) when the pixel of interest V33 is the P component will be described with reference to FIGS. 7 and 12B showing the pixel positions.

注目画素V33のG成分Gveとしては、垂直方向の1画素隣(V32とV34)の画素値の平均値が用いられる。    As the G component Gve of the target pixel V33, an average value of pixel values adjacent to one pixel in the vertical direction (V32 and V34) is used.

また、注目画素V33のP成分Pveとしては、値P33が用いられる。    The value P33 is used as the P component Pve of the pixel of interest V33.

さらに、注目画素V33のQ成分Qveは、注目画素がG成分のときと同様に、垂直方向における色信号の比に関する相関性を利用して算出される。    Further, the Q component Qve of the target pixel V33 is calculated using the correlation regarding the ratio of the color signals in the vertical direction, as in the case where the target pixel is the G component.

ここでは、画素V23、画素V43および画素V33に注目して、画素V23におけるG成分G23とQ成分Q23’との比、画素V43におけるG成分G43とQ成分Q43’との比、および画素V33におけるG成分GveとQ成分Q33との比がほぼ等しいとする。画素V23におけるQ成分とG成分との比と、画素V43におけるQ成分とG成分との比の平均を上記(式10)の(Q’/G’)として、注目画素V33におけるQ成分Q33が算出される。    Here, paying attention to the pixel V23, the pixel V43, and the pixel V33, the ratio between the G component G23 and the Q component Q23 ′ in the pixel V23, the ratio between the G component G43 and the Q component Q43 ′ in the pixel V43, and the ratio in the pixel V33 Assume that the ratio between the G component Gve and the Q component Q33 is substantially equal. Assuming that the ratio of the Q component to the G component in the pixel V23 and the average ratio of the Q component to the G component in the pixel V43 are (Q ′ / G ′) in the above (Equation 10), the Q component Q33 in the target pixel V33 is Calculated.

続いて、注目画素V33がG成分のときの右斜め上方向の色信号算出式(式11)の導き方について、画素の位置を示す図7および図12(a)を用いて説明する。   Next, a method of deriving the color signal calculation formula (Formula 11) in the upper right direction when the target pixel V33 is the G component will be described with reference to FIGS. 7 and 12A showing the position of the pixel.

上記(式11)において、検出エッジ方向が右斜め上方向のときの色信号のG成分、R成分およびB成分は、Gru、PruおよびQruで表されている。ただし、PruはR成分またはB成分であり、QruはB成分またはR成分である。    In the above (Formula 11), the G component, R component, and B component of the color signal when the detected edge direction is obliquely upward to the right are represented by Gru, Pru, and Qru. However, Pru is an R component or a B component, and Qru is a B component or an R component.

注目画素V33のG成分Gruは、画素V33、画素V42および画素V24から求められる。    The G component Gru of the target pixel V33 is obtained from the pixel V33, the pixel V42, and the pixel V24.

また、注目画素V33のP成分Pruおよび注目画素V33のQ成分Qruは、右斜め上方向における色信号の比に関する相関性を利用して算出される。    In addition, the P component Pru of the target pixel V33 and the Q component Qru of the target pixel V33 are calculated using the correlation regarding the ratio of the color signals in the upper right diagonal direction.

まず、注目画素V33のP成分について、色相関を利用した色信号の算出方法を説明する。    First, a method for calculating a color signal using color correlation for the P component of the target pixel V33 will be described.

ここでは、画素V32、画素V34および画素V33に注目して、画素V32におけるP成分P32とG成分G32’との比、画素V34におけるP成分P34とG成分G34’との比、および画素V33におけるP成分P33とG成分G33との比がほぼ等しいとする。    Here, paying attention to the pixel V32, the pixel V34, and the pixel V33, the ratio between the P component P32 and the G component G32 ′ in the pixel V32, the ratio between the P component P34 and the G component G34 ′ in the pixel V34, and the ratio in the pixel V33 Assume that the ratio of the P component P33 and the G component G33 is substantially equal.

本発明の主な特徴構成の一つは、G32’およびG34’の求め方にある。従来法では、画素V32のG成分を求めようとするときに、画素V32を含む右斜め上方向の画素から算出してきた。しかしながら、画素V32を含む右斜め上方向にはP成分とQ成分しか存在しないため、G成分を求めることができなかった。    One of the main features of the present invention is how to obtain G32 'and G34'. In the conventional method, when the G component of the pixel V32 is to be obtained, the G component is calculated from the pixel in the upper right direction including the pixel V32. However, since only the P component and the Q component exist in the upper right direction including the pixel V32, the G component cannot be obtained.

これに対して、本発明では、画素V32のG成分G32’の値を求めるために、右斜め上方向の画素以外の画素を参照することを特徴とする。    In contrast, the present invention is characterized by referring to pixels other than the pixels in the diagonally upper right direction in order to obtain the value of the G component G32 'of the pixel V32.

例えば、画素V32におけるG成分G32’の値として、G22とG42との平均値が用いられる。同様に、画素V34におけるG成分G34’の値として、G24とG44との平均値が用いられる。    For example, the average value of G22 and G42 is used as the value of the G component G32 'in the pixel V32. Similarly, the average value of G24 and G44 is used as the value of the G component G34 'in the pixel V34.

このようにして算出されたG成分を用いて、上記垂直方向の色相関性のときと同様に、画素V32におけるP成分とG成分との比と、画素V34におけるP成分とG成分との比との平均値を上記(式10)の(P’/G’)として、注目画素V33におけるP成分P33が算出される。    Using the G component thus calculated, the ratio between the P component and the G component in the pixel V32 and the ratio between the P component and the G component in the pixel V34 are the same as in the case of the color correlation in the vertical direction. The P component P33 in the pixel of interest V33 is calculated with the average value of (P ′ / G ′) in (Equation 10) above.

次に、注目画素V33のQ成分について、色相関を利用した色信号の算出方法を説明する。基本的には、P成分の場合と同様の手順で色信号が算出される。    Next, a method for calculating a color signal using color correlation for the Q component of the target pixel V33 will be described. Basically, the color signal is calculated in the same procedure as in the case of the P component.

ここでは、画素V23、画素V43および画素V33に注目して、画素V23におけるQ成分Q23とG成分G23’との比、画素V43におけるQ成分Q43とG成分G43’との比、および画素V33におけるQ成分Q33とG成分G33との比がほぼ等しいとする。    Here, paying attention to the pixel V23, the pixel V43, and the pixel V33, the ratio between the Q component Q23 and the G component G23 ′ in the pixel V23, the ratio between the Q component Q43 and the G component G43 ′ in the pixel V43, and the ratio in the pixel V33 Assume that the ratio between the Q component Q33 and the G component G33 is substantially equal.

例えば、画素V23におけるQ成分とG成分との比と、画素V43におけるQ成分とG成分との比との平均値を上記(式10)の(Q’/G’)として、注目画素V33におけるQ成分Q33が算出される。    For example, the average value of the ratio between the Q component and the G component in the pixel V23 and the ratio between the Q component and the G component in the pixel V43 is (Q ′ / G ′) in the above (Equation 10), and A Q component Q33 is calculated.

最後に、注目画素V33がP成分のときの右斜め上方向の色信号算出式(式11)の導き方について、画素の位置を示す図7および図12(b)を用いて説明する。   Finally, a method of deriving the color signal calculation formula (Formula 11) in the upper right direction when the target pixel V33 is the P component will be described with reference to FIGS. 7 and 12B showing the pixel positions.

注目画素V33のP成分Pruとしては、値P33が用いられる。    The value P33 is used as the P component Pru of the target pixel V33.

また、注目画素V33のQ成分Qruとしては、右斜め上方向の1画素隣(V42とV24)の画素値の平均値が用いられる。    Further, as the Q component Qru of the target pixel V33, an average value of pixel values adjacent to one pixel (V42 and V24) in the diagonally upper right direction is used.

さらに、注目画素V33のG成分Gruは、右斜め上方向における色信号の比に関する相関性を利用して算出される。    Further, the G component Gru of the target pixel V33 is calculated using the correlation regarding the ratio of the color signals in the upper right direction.

図8において、画素V22、画素V32、画素V23および画素V33の4画素が交わる点(位置)を点Aとする。また、画素V33、画素V43、画素V34および画素V44の4画素が交わる点(位置)を点Bとする。    In FIG. 8, a point (position) where four pixels of the pixel V22, the pixel V32, the pixel V23, and the pixel V33 intersect is a point A. In addition, a point (position) where four pixels of the pixel V33, the pixel V43, the pixel V34, and the pixel V44 intersect is a point B.

ここでは、画素V33の他に、点Aおよび点Bに注目する。画素V33におけるP成分とQ成分との平均値S33とG成分G33との比、点AにおけるP成分とQ成分との平均値SaとG成分Gaとの比、および点BにおけるP成分とQ成分の平均SbとG成分Gbとの比がほぼ等しいものとする。    Here, attention is paid to point A and point B in addition to the pixel V33. The ratio of the average value S33 and the G component G33 of the P component and the Q component in the pixel V33, the ratio of the average value Sa and the G component Ga of the P component and the Q component at the point A, and the P component and the Q at the point B Assume that the ratio between the average Sb of the components and the G component Gb is substantially equal.

ここで、局所領域における色信号の比に関する相関性により、上記(式10)と同様に、以下の(式12)が導かれる。
(式12)
G=S×(G’/S’)
G:注目画素のG成分
S:注目画素のP成分とQ成分の平均値
G’:注目画素の近傍点におけるG成分
S’:注目画素の近傍点におけるP成分とQ成分の平均値
ただし、G’およびS’において、注目画素の近傍点は同じ位置
とする。
Here, the following (Formula 12) is derived in the same manner as the above (Formula 10) by the correlation regarding the ratio of the color signals in the local region.
(Formula 12)
G = S × (G ′ / S ′)
G: G component of the pixel of interest S: Average value of the P component and Q component of the pixel of interest G ′: G component at the neighborhood point of the pixel of interest S ′: Average value of the P component and Q component at the neighborhood point of the pixel of interest In G ′ and S ′, the neighboring points of the target pixel are set to the same position.

これにより、点AにおけるS値とG成分との比、および点BにおけるS値とG成分との比の平均値を上記(式12)の(G’/S’)として、注目画素V33におけるG成分G33が算出される。    As a result, the ratio of the S value and the G component at the point A and the average value of the ratio of the S value and the G component at the point B are set as (G ′ / S ′) in the above (Equation 12). A G component G33 is calculated.

以上説明したように、本実施形態2によれば、画像の局所領域における特性を利用すると共に、斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行うことができる。斜め方向の色相関を利用して色信号を算出することができるため、従来の垂直方向および水平方向の色相関を利用した補間処理法よりも精密な画像の方向性検出を行って、色信号を算出することができる。    As described above, according to the second embodiment, it is possible to perform the interpolation process using the characteristics in the local region of the image and also using the correlation of the color signal with the edge in the oblique direction. Since the color signal can be calculated using the color correlation in the diagonal direction, the color signal can be detected more accurately than the conventional interpolation processing method using the color correlation in the vertical and horizontal directions. Can be calculated.

例えば、図13(a)に示す輝度値を有するベイヤ配列において、注目画素G33に対して、本実施形態2による方向性データ算出式(式2)を用いると、
DDru=248
DDho=744
DDrd=744
DDve=434
となり、方向性検出部62は、方向性データの値が最小値となる方向「DDru;右斜め上方向」を注目画素付近におけるエッジ方向として検出する。
For example, in the Bayer array having the luminance value shown in FIG. 13A, the directional data calculation formula (Formula 2) according to the second embodiment is used for the target pixel G33.
DDru = 248
DDho = 744
DDrd = 744
DDve = 434
Thus, the directionality detection unit 62 detects the direction “DDru; diagonally right upward” in which the value of the directionality data is the minimum value as the edge direction in the vicinity of the target pixel.

本実施形態2による色信号算出式(式11)を用いると、
Gru=(2×G33+G24+G42)/2=128
Rru=Gru×[{(R32/(G22+G42)/2}+{(R34/(G24+G44)/2}]=128
Bru=Gru×[{(B23/(G22+G24)/2}+{(B43/(G42+G44)/2}]=128
となり、
R=G=B
となるため、偽色信号のない色信号を算出することができる。
(実施形態3)
本実施形態3では、注目画素を中心として上方向、斜め右上方向、右方向、斜め右下方向、下方向、斜め左下方向、左方向および斜め左上方向の8方向に対して方向性データを算出する場合であって、複数の方向に対する各方向性データから値の小さい順に一つ以上の方向を注目画素を含むその付近におけるエッジの方向性候補として検出する場合について説明する。
When the color signal calculation formula (Formula 11) according to the second embodiment is used,
Gru = (2 × G33 + G24 + G42) / 2 = 128
Rru = Gru × [{(R32 / (G22 + G42) / 2} + {(R34 / (G24 + G44) / 2}]) = 128
Bru = Gru × [{(B23 / (G22 + G24) / 2} + {(B43 / (G42 + G44) / 2}]) = 128
And
R = G = B
Therefore, a color signal without a false color signal can be calculated.
(Embodiment 3)
In the third embodiment, the directionality data is calculated with respect to the target pixel in the eight directions of the upward direction, the oblique upper right direction, the right direction, the oblique lower right direction, the downward direction, the oblique lower left direction, the left direction, and the oblique upper left direction. A case will be described in which one or more directions are detected as the edge directionality candidates in the vicinity including the target pixel from the directional data for a plurality of directions in ascending order.

図1および図2に示すように、本実施形態3のが画像処理装置10Bは、被写体を撮像可能とする固体撮像素子1と、固体撮像素子1からの撮像データをA/D変換するA/D変換部2と、このA/D変換部2からのデジタル信号を各種信号処理する画像処理装置としての画像処理部3Bとを有している。   As shown in FIGS. 1 and 2, the image processing apparatus 10 </ b> B according to the third embodiment is a solid-state imaging device 1 that can image a subject, and A / D that converts A / D conversion of imaging data from the solid-state imaging device 1. A D conversion unit 2 and an image processing unit 3B as an image processing apparatus that performs various signal processing on the digital signal from the A / D conversion unit 2 are provided.

画像処理部3Bは、ホワイトバランス部4と、ガンマ補正部5と、データ補間部6Bとを有している。データ補間部6Bは、方向性データ算出部61Bと、方向性検出部62Bと、方向性色信号算出部63Bと、注目画素色信号算出部64Bと、これらを制御する制御部65とを有している。   The image processing unit 3B includes a white balance unit 4, a gamma correction unit 5, and a data interpolation unit 6B. The data interpolation unit 6B includes a directional data calculation unit 61B, a directional detection unit 62B, a directional color signal calculation unit 63B, a target pixel color signal calculation unit 64B, and a control unit 65 that controls these. ing.

注目画素色信号算出部64Bは、方向性検出部62Bで検出された複数の方向性に対応する各色信号の平均色を算出する平均色算出手段としての平均色算出部(図示せず)と、この平均色算出部(図示せず)で算出された色と注目画素の色との相関性を利用して色信号を算出する多重色相関色信号算出手段としての多重色相関色信号算出部(図示せず)とを有している。    The target pixel color signal calculation unit 64B includes an average color calculation unit (not shown) as an average color calculation unit that calculates the average color of each color signal corresponding to the plurality of directions detected by the directionality detection unit 62B. A multi-color correlated color signal calculating unit (multi-color correlated color signal calculating unit) that calculates a color signal using the correlation between the color calculated by the average color calculating unit (not shown) and the color of the pixel of interest (Not shown).

図3は、本実施形態3のデータ補間部6Bの動作例を説明するためのフローチャートでもある。    FIG. 3 is also a flowchart for explaining an operation example of the data interpolation unit 6B of the third embodiment.

以下に、本実施形態3のデータ補間部6Bによるデータ補間処理の処理手順について、各ステップに従って順に説明する。なお、ステップS1〜S4の各処理は、図3および図4に示すように、入力されたベイヤデータ領域内の補間指定領域内における画素の数だけ繰り返される。   Hereinafter, the processing procedure of the data interpolation process performed by the data interpolation unit 6B according to the third embodiment will be described in order according to each step. Each process of steps S1 to S4 is repeated as many times as the number of pixels in the input interpolation designated area in the Bayer data area as shown in FIGS.

図3に示すように、まず、ステップS1では、方向性データ算出部61Bによって、注目画素の方向性データが、予め決められた複数のエッジ方向(指定方向)に対して算出される。    As shown in FIG. 3, first, in step S1, the directionality data calculation unit 61B calculates the directionality data of the target pixel for a plurality of predetermined edge directions (designated directions).

方向性データ算出部61Bでは、図8に示すように、複数のエッジ方向として、注目画素を中心として、右斜め上方向、右方向、右斜め下方向、下方向、左斜め下方向、左方向、左斜め上方向および上方向の8方向が用いられる。本実施形態3の特徴は、注目画素を中心として、8方向の方向性データを算出することにより、エッジの端点を考慮したエッジデータを算出することができる点である。    In the directionality data calculation unit 61B, as shown in FIG. 8, as a plurality of edge directions, with the pixel of interest at the center, right upward direction, right direction, right downward direction, down direction, left downward direction, left direction , 8 directions of diagonally upward left and upward are used. A feature of the third embodiment is that edge data in consideration of an end point of an edge can be calculated by calculating directional data in eight directions around the target pixel.

方向性データ算出部61Bでは、例えば、指定された方向と注目画素付近における実際のエッジ方向との近似度が大きいほど値が小さくなるように、方向性データが算出される。このような方向性データ算出式としては、各種のものが考えられるが、例えば、以下のような算出式(式13)が用いられる。
(式13)
・注目画素がG33の場合(図12(a)参照)
DDru=(|G51−G33|+|G42−G33|+|P52−P34|+|Q41−Q23|)
DDri=(|G53−G33|+|Q23−Q43|)
+(|G22−G42|+|G24−G44|+|P52−P32|+|P54−P34|)/2
DDrd=(|G44−G33|+|G55−G33|+|P32−P54|+|Q23−Q45|)
DDdo=(|G35−G33|+|P32−P34|)
+(|G22−G24|+|G42−G44|+|Q25−Q23|+|Q45−Q43|)/2
DDld=(|G15−G33|+|G24−G33|+|P25−P43|+|Q14−Q32|)
DDle=(|G13−G33|+|Q23−Q43|)
+(|G22−G42|+|G24−G44|+|P12−P32|+|P14−P34|)/2
DDlu=(|G22−G33|+|G11−G33|+|P12−P34|+|Q21−Q43|)
DDup=(|G31−G33|+|P32−P34|)
+(|G22−G24|+|G42−G44|+|Q21−Q23|+|Q41−Q43|)/2
・注目画素がP33の場合(図12(b)参照)
DDru=(|P51−P33|+|Q42−Q24|)
+(|G32−G23|+|G41−G32|+|G52−G43|+|G43−G34|)/2
DDri=(|P53−P33|+|G23−G43|)
+(|Q22−Q42|+|G32−G52|+|Q24−Q44|+|G34−G54|)/2
DDrd=(|P55−P33|+|Q44−Q22|)
+(|G32−G43|+|G43−G54|+|G23−G34|+|G34−G45|)/2
DDdo=(|P35−P33|+|G32−G34|)
+(|Q22−Q24|+|G23−G25|+|Q42−Q44|+|G43−G45|)/2
DDld=(|P15−P33|+|Q42−Q24|)
+(|G32−G23|+|G43−G34|+|G23−G14|+|G34−G25|)/2
DDle=(|P13−P33|+|G23−G43|)
+(|Q22−Q42|+|Q24−Q44|+|G12−G32|+|G14−G34|)/2
DDlu=(|P11−P33|+|Q22−Q44|)
+(|G21−G32|+|G32−G43|+|Q12−Q23|+|G23−G34|)/2
DDup=(|P31−P33|+|G32−G34|)
+(|Q22−Q24|+|Q42−Q44|+|G21−G23|+|G41−G43|)/2
ただし、
DDru:右斜め上方向の方向性データ算出式
DDri:右方向の方向性データ算出式
DDrd:右斜め下方向の方向性データ算出式
DDdo:下方向の方向性データ算出式
DDld:左斜め下方向の方向性データ算出式
DDle:左方向の方向性データ算出式
DDlu:左斜め上方向の方向性データ算出式
DDup:上方向の方向性データ算出式
とする。
In the directionality data calculation unit 61B, for example, the directionality data is calculated so that the value decreases as the degree of approximation between the designated direction and the actual edge direction in the vicinity of the target pixel increases. Various types of directional data calculation formulas are conceivable. For example, the following calculation formula (Formula 13) is used.
(Formula 13)
When the target pixel is G33 (see FIG. 12A)
DDru = (| G51−G33 | + | G42−G33 | + | P52−P34 | + | Q41−Q23 |)
DDri = (| G53−G33 | + | Q23−Q43 |)
+ (| G22−G42 | + | G24−G44 | + | P52−P32 | + | P54−P34 |) / 2
DDrd = (| G44−G33 | + | G55−G33 | + | P32−P54 | + | Q23−Q45 |)
DDdo = (| G35−G33 | + | P32−P34 |)
+ (| G22−G24 | + | G42−G44 | + | Q25−Q23 | + | Q45−Q43 |) / 2
DDld = (| G15−G33 | + | G24−G33 | + | P25−P43 | + | Q14−Q32 |)
DDle = (| G13−G33 | + | Q23−Q43 |)
+ (| G22−G42 | + | G24−G44 | + | P12−P32 | + | P14−P34 |) / 2
DDlu = (| G22−G33 | + | G11−G33 | + | P12−P34 | + | Q21−Q43 |)
DDup = (| G31−G33 | + | P32−P34 |)
+ (| G22-G24 | + | G42-G44 | + | Q21-Q23 | + | Q41-Q43 |) / 2
When the target pixel is P33 (see FIG. 12B)
DDru = (| P51−P33 | + | Q42−Q24 |)
+ (| G32−G23 | + | G41−G32 | + | G52−G43 | + | G43−G34 |) / 2
DDri = (| P53−P33 | + | G23−G43 |)
+ (| Q22-Q42 | + | G32-G52 | + | Q24-Q44 | + | G34-G54 |) / 2
DDrd = (| P55−P33 | + | Q44−Q22 |)
+ (| G32−G43 | + | G43−G54 | + | G23−G34 | + | G34−G45 |) / 2
DDdo = (| P35−P33 | + | G32−G34 |)
+ (| Q22-Q24 | + | G23-G25 | + | Q42-Q44 | + | G43-G45 |) / 2
DDld = (| P15−P33 | + | Q42−Q24 |)
+ (| G32−G23 | + | G43−G34 | + | G23−G14 | + | G34−G25 |) / 2
DDle = (| P13−P33 | + | G23−G43 |)
+ (| Q22-Q42 | + | Q24-Q44 | + | G12-G32 | + | G14-G34 |) / 2
DDlu = (| P11−P33 | + | Q22−Q44 |)
+ (| G21−G32 | + | G32−G43 | + | Q12−Q23 | + | G23−G34 |) / 2
DDup = (| P31−P33 | + | G32−G34 |)
+ (| Q22-Q24 | + | Q42-Q44 | + | G21-G23 | + | G41-G43 |) / 2
However,
DDru: Directional data calculation formula in the upper right direction DDri: Directional data calculation formula in the right direction DDrd: Directional data calculation formula in the lower right direction DDdo: Directional data calculation formula in the lower direction DDld: Lower left direction Directional data calculation formula DDle: Directional data calculation formula in the left direction DDlu: Directional data calculation formula in the diagonally upper left direction DDup: Directional data calculation formula in the upward direction

次に、ステップS2では、方向性検出部62Bによって、ステップS1で算出された方向性データを用いて、注目画素の方向性の有無および方向性が検出される。    Next, in step S2, the directionality detection unit 62B detects the directionality of the pixel of interest and the directionality using the directionality data calculated in step S1.

図9は、本実施形態3における方向性検出部62B(ステップS2の他の例)の動作例を説明するためのフローチャートである。    FIG. 9 is a flowchart for explaining an operation example of the directionality detection unit 62B (another example of step S2) according to the third embodiment.

以下に、方向性検出部62Bによる方向性検出処理の処理手順について、各ステップに従って順に説明する。   Below, the process procedure of the directionality detection process by the directionality detection part 62B is demonstrated in order according to each step.

図9に示すように、まず、ステップS21Bでは、ステップS1で算出された8種類の方向性データの最大値が検出される。    As shown in FIG. 9, first, in step S21B, the maximum values of the eight types of direction data calculated in step S1 are detected.

次に、ステップS22Bでは、ステップS21Bで検出された方向性データの最大値が、図示しないレジスタに記憶された閾値Bよりも小さいか否か、即ち、注目画素付近にエッジがなく輝度勾配がなだらかな平坦部であるか否かが判定される。平坦部であれば(Yes)、ステップS23Bにおいて「方向性なし」を示す信号が出力され、注目画素の方向性検出処理が終了される。また、平坦部ではない場合(No)には、ステップS24Bの処理に移行する。    Next, in step S22B, whether or not the maximum value of the directionality data detected in step S21B is smaller than the threshold value B stored in a register (not shown), that is, there is no edge near the target pixel and the luminance gradient is gentle. It is determined whether or not it is a flat portion. If it is a flat part (Yes), a signal indicating “no directionality” is output in step S23B, and the directionality detection processing of the target pixel is ended. If it is not a flat portion (No), the process proceeds to step S24B.

なお、閾値Bの取り得る値の範囲は、方向性データ算出式により異なるが、閾値Bを大きくするほど平坦部と判定される画素が増加し、小さくするほど平坦部と判定される画素が減少する。    The range of values that can be taken by the threshold B varies depending on the directionality data calculation formula, but as the threshold B is increased, the number of pixels determined to be a flat portion increases, and as the threshold B is decreased, the number of pixels determined to be a flat portion decreases. To do.

次に、ステップS24Bでは、ステップS1で算出された8種類の方向性データから、値の小さい順に一つ以上の方向性が検出される。このとき検出された一つ以上の方向性を方向性候補と呼ぶ。     Next, in step S24B, one or more directivities are detected in ascending order of values from the eight types of directivity data calculated in step S1. One or more directions detected at this time are called direction candidates.

例えば、以下の判定式(式14)を満たせば、その方向性データに対応する方向性が検出される。
(式14)
DDmin≧閾値C×DDi
DDi:注目画素の方向性データ
DDmin:方向性データの最小値
なお、閾値Cの取り得る値の範囲は0≦閾値C≦1であり、閾値Cを大きくするほど検出される方向性の数が減少し、小さくするほど検出される方向性の数が増加する。
For example, if the following judgment formula (Formula 14) is satisfied, the directionality corresponding to the directionality data is detected.
(Formula 14)
DDmin ≧ threshold C × DDi
DDi: Directionality data of target pixel DDmin: Minimum value of directionality data Note that the range of values that can be taken by the threshold C is 0 ≦ threshold C ≦ 1, and the larger the threshold C, the more the number of detected orientations. As the number decreases, the number of detected directions increases.

最後に、ステップS26Bでは、ステップS24Bで検出された方向性が出力され、注目画素の方向性検出処理が終了する。    Finally, in step S26B, the directionality detected in step S24B is output, and the directionality detection processing for the target pixel ends.

次に、図3のステップS3では、方向性色信号算出部63Bによって、方向性検出部62Bで検出された方向に対する色信号が算出される。    Next, in step S3 of FIG. 3, the directional color signal calculation unit 63B calculates a color signal for the direction detected by the direction detection unit 62B.

本実施形態3では、色相関性を利用した色信号算出式により、斜め方向を含む8方向に対して、色信号を算出することができる。また、本実施形態3では、8方向に対応する色信号として、注目画素の色信号ではなく、注目画素に接する8近傍画素に対する色信号を算出する。    In the third embodiment, color signals can be calculated for eight directions including an oblique direction by a color signal calculation formula using color correlation. In the third embodiment, as a color signal corresponding to eight directions, a color signal for eight neighboring pixels in contact with the target pixel is calculated instead of the color signal of the target pixel.

例えば、図7における注目画素V33の例えば右斜め上方向の方向性色信号として、V42の色信号が算出される。    For example, the color signal V42 is calculated as the directional color signal in the upper right direction of the target pixel V33 in FIG.

また、図7における注目画素V33の例えば下方向の方向性色信号として、V34の色信号が算出される。    Further, a color signal of V34 is calculated as, for example, a downward direction color signal of the target pixel V33 in FIG.

方向性色信号を算出する際には、上記実施形態1で説明した色信号の差に関する相関性を利用した色信号算出式、または、上記実施形態2で説明した色信号の比の相関性を利用した色信号算出式を用いて、各方向性候補に対する色信号を算出することができる。    When calculating the directional color signal, the color signal calculation formula using the correlation related to the color signal difference described in the first embodiment or the color signal ratio correlation described in the second embodiment is used. The color signal for each directional candidate can be calculated using the used color signal calculation formula.

下記(式15)および(式16)は、8方向に対する方向性色信号算出式の一例である。なお、(式15)は注目画素がG33のとき(図12(a)参照)の方向性色信号算出式であり、(式16)は注目画素がP33のとき(図12(b)参照)の方向性色信号算出式である。
(式15)
Gru=(G33+2×G42+G51)/4
Pru=(P32+P52)/2+(2×G42−G31−G53)/4
Qru=(Q41+Q43)/2+(2×G42−G31−G53)/4
Gri=(G53+G33)/2
Pri=(P32+P52+P34+P54)/4
+(G33+G53−G42−G44)/2
Qri=Q43
Grd=(G33+2×G44+G55)/4
Prd=(P34+P54)/2+(2×G44−G35−G53)/4
Qrd=(Q43+Q45)/2+(2×G44−G35−G53)/4
Gdo=(G33+G35)/2
Pdo=P34
Qdo=(Q23+Q25+Q43+Q45)/4
+(G33+G35−G24−G44)/2
Gld=(G33+2×G24+G15)/4
Pld=(P14+P34)/2+(2×G24−G33−G15)/4
Qld=(Q23+Q25)/2+(2×G24−G33−G15)/4
Gle=(G33+G13)/2
Ple=(P12+P32+P14+P34)/4
+(G33+G13−G22−G24)/2
Qle=Q23
Glu=(G33+2×G22+G11)/4
Plu=(P12+P32)/2+(2×G22−G31−G13)/4
Qlu=(Q21+Q23)/2+(2×G22−G31−G13)/4
Gup=(G33+G31)/2
Pup=P32
Qup=(Q21+Q23+Q41+Q43)/4
+(G33+G31−G22−G42)/2
Gru:右斜め上方向のG成分
Pru:右斜め上方向のP成分
Qru:右斜め上方向のQ成分
Gri:右方向のG成分
Pri:右方向のP成分
Qri:右方向のQ成分
Grd:右斜め下方向のG成分
Prd:右斜め下方向のP成分
Qrd:右斜め下方向のQ成分
Gdo:下方向のG成分
Pdo:下方向のP成分
Qdo:下方向のQ成分
Gld:左斜め下方向のG成分
Pld:左斜め下方向のP成分
Qld:左斜め下方向のQ成分
Gle:左方向のG成分
Ple:左方向のP成分
Qle:左方向のQ成分
Glu:左斜め上方向のG成分
Plu:左斜め上方向のP成分
Qlu:左斜め上方向のQ成分
Gup:上方向のG成分
Pup:上方向のP成分
Qup:上方向のQ成分
(式16)
Gru=(G41+G32+G52+G43)/4
+(P33+P51−P31−P53)/4
Pru=(P33+P51)/2
Qru=Q42
Gri=G43
Pri=(P33+P53)/2
Qri=(Q42+Q44)/2
+(4×G43−G32−G52−G34−G54)/4
Grd=(G45+G34+G54+G43)/4
+(P33+P55−P35−P53)/4
Prd=(P33+P55)/2
Qrd=Q44
Gdo=G34
Pdo=(P33+P35)/2
Qdo=(Q24+Q44)/2
+(4×G34−G23−G25−G43−G45)/4
Gld=(G25+G23+G14+G34)/4
+(P33+P15−P13−P35)/4
Pld=(P33+P15)/2
Qld=Q24
Gle=G23
Ple=(P13+P33)/2
Qle=(Q22+Q24)/2
+(4×G23−G12−G32−G14−G34)/4
Glu=(G21+G12+G32+G23)/4
+(P33+P11−P31−P13)/4
Plu=(P33+P11)/2
Qlu=Q22
Gup=G32
Pup=(P33+P31)/2
Qup=(Q22+Q42)/2
+(4×G32−G21−G23−G41−G43)/4
次に、図3のステップS4では、注目画素色信号算出部64Bによって、方向性検出部62B(ステップS2)により検出された各方向性候補に対応して方向性色信号算出部63B(ステップS3)により算出された方向性色信号を基にして、色信号の平均(rr,gg,bb)が、注目画素の色信号として算出される。
The following (Expression 15) and (Expression 16) are examples of directional color signal calculation expressions for eight directions. (Expression 15) is a directional color signal calculation expression when the target pixel is G33 (see FIG. 12A), and (Expression 16) is when the target pixel is P33 (see FIG. 12B). This is a directional color signal calculation formula.
(Formula 15)
Gru = (G33 + 2 × G42 + G51) / 4
Pru = (P32 + P52) / 2 + (2 × G42−G31−G53) / 4
Qru = (Q41 + Q43) / 2 + (2 × G42−G31−G53) / 4
Gri = (G53 + G33) / 2
Pri = (P32 + P52 + P34 + P54) / 4
+ (G33 + G53-G42-G44) / 2
Qri = Q43
Grd = (G33 + 2 × G44 + G55) / 4
Prd = (P34 + P54) / 2 + (2 × G44−G35−G53) / 4
Qrd = (Q43 + Q45) / 2 + (2 × G44−G35−G53) / 4
Gdo = (G33 + G35) / 2
Pdo = P34
Qdo = (Q23 + Q25 + Q43 + Q45) / 4
+ (G33 + G35-G24-G44) / 2
Gld = (G33 + 2 × G24 + G15) / 4
Pld = (P14 + P34) / 2 + (2 × G24−G33−G15) / 4
Qld = (Q23 + Q25) / 2 + (2 × G24−G33−G15) / 4
Gle = (G33 + G13) / 2
Ple = (P12 + P32 + P14 + P34) / 4
+ (G33 + G13-G22-G24) / 2
Qle = Q23
Glu = (G33 + 2 × G22 + G11) / 4
Plu = (P12 + P32) / 2 + (2 × G22−G31−G13) / 4
Qlu = (Q21 + Q23) / 2 + (2 × G22−G31−G13) / 4
Gup = (G33 + G31) / 2
Pup = P32
Qup = (Q21 + Q23 + Q41 + Q43) / 4
+ (G33 + G31-G22-G42) / 2
Gru: G component in the upper right direction Pru: P component in the upper right direction Qru: Q component in the upper right direction Gri: G component in the right direction Pri: P component in the right direction Qri: Q component in the right direction Grd: G component in the lower right direction Prd: P component in the lower right direction Qrd: Q component in the lower right direction Gdo: G component in the lower direction Pdo: P component in the lower direction Qdo: Q component in the lower direction Gld: Oblique left G component in the downward direction Pld: P component in the diagonally lower left direction Qld: Q component in the diagonally lower left direction Gle: G component in the leftward direction Ple: P component in the leftward direction Qle: Q component in the leftward direction Glu: diagonally upward in the left direction Glu: P component in the diagonally upward left direction Qlu: Q component in the diagonally upward left direction Gup: G component in the upward direction Pup: P component in the upward direction Qup: Q component in the upward direction (Formula 16)
Gru = (G41 + G32 + G52 + G43) / 4
+ (P33 + P51-P31-P53) / 4
Pru = (P33 + P51) / 2
Qru = Q42
Gri = G43
Pri = (P33 + P53) / 2
Qri = (Q42 + Q44) / 2
+ (4 × G43−G32−G52−G34−G54) / 4
Grd = (G45 + G34 + G54 + G43) / 4
+ (P33 + P55-P35-P53) / 4
Prd = (P33 + P55) / 2
Qrd = Q44
Gdo = G34
Pdo = (P33 + P35) / 2
Qdo = (Q24 + Q44) / 2
+ (4 × G34-G23-G25-G43-G45) / 4
Gld = (G25 + G23 + G14 + G34) / 4
+ (P33 + P15-P13-P35) / 4
Pld = (P33 + P15) / 2
Qld = Q24
Gle = G23
Ple = (P13 + P33) / 2
Qle = (Q22 + Q24) / 2
+ (4 × G23−G12−G32−G14−G34) / 4
Glu = (G21 + G12 + G32 + G23) / 4
+ (P33 + P11-P31-P13) / 4
Plu = (P33 + P11) / 2
Qlu = Q22
Gup = G32
Pup = (P33 + P31) / 2
Qup = (Q22 + Q42) / 2
+ (4 × G32−G21−G23−G41−G43) / 4
Next, in step S4 of FIG. 3, the directional color signal calculation unit 63B (step S3) corresponding to each directionality candidate detected by the directionality detection unit 62B (step S2) by the target pixel color signal calculation unit 64B. ), The average (rr, gg, bb) of the color signals is calculated as the color signal of the target pixel.

ステップS5を介して、全画素における補間処理が終了するまでステップS1〜S4の処理が繰り返される。   Through steps S5, the processes in steps S1 to S4 are repeated until the interpolation process for all pixels is completed.

本実施形態3によれば、注目画素を中心として8方向の方向性検出を行うことにより、エッジの端点を考慮して、偽色信号の少ない補間処理を行うことができる。    According to the third embodiment, by performing directionality detection in eight directions around the target pixel, interpolation processing with few false color signals can be performed in consideration of the end points of the edges.

また、その他の注目画素色信号算出方法として、以上のようにして算出された方向性候補に対応する方向性色信号の平均色(rr,gg,bb)と、注目画素の色成分との色信号相関性を利用して、注目画素の色信号を算出する方法もある。    As another method of calculating the pixel-of-interest color signal, the color of the average color (rr, gg, bb) of the directional color signal corresponding to the direction candidate calculated as described above and the color component of the pixel of interest There is also a method for calculating the color signal of the pixel of interest using signal correlation.

例えば、注目画素の色成分がG成分gの場合に、注目画素の色信号の各色成分Go、RoおよびBoは、下記(式17)を用いて算出することができる。
(式17)
Go=g
Ro=g+rr−gg
Bo=g+bb−gg
上記(式17)を用いた方法によれば、各方向における方向性色信号を算出する際に、色信号の相関性を利用して色信号を算出し、それらの色信号の平均の色と注目画素の色成分の色との相関性を利用している。このように、色信号の相関性により求められた色信号に対して、再び色信号の相関性を利用して色信号を算出することにより、さらに偽色信号の発生を抑制することができる。
(実施形態4)
本実施形態4では、図2に示す方向性データ算出部61Cによる処理(図3のステップS1)が上記実施形態1〜3の場合とは異なる事例であって、注目画素付近の複数の方向に対するエッジの方向性を定量化する際に、色信号の相関性の強度を考慮する場合について説明する。
For example, when the color component of the target pixel is the G component g, the color components Go, Ro, and Bo of the color signal of the target pixel can be calculated using the following (Equation 17).
(Formula 17)
Go = g
Ro = g + rr−gg
Bo = g + bb-gg
According to the method using (Equation 17), when calculating the directional color signal in each direction, the color signal is calculated using the correlation between the color signals, and the average color of the color signals is calculated. The correlation with the color component color of the pixel of interest is used. As described above, by calculating the color signal again using the correlation of the color signal with respect to the color signal obtained by the correlation of the color signal, the generation of the false color signal can be further suppressed.
(Embodiment 4)
In the fourth embodiment, the process (step S1 in FIG. 3) by the directionality data calculation unit 61C shown in FIG. 2 is a case different from the cases of the first to third embodiments, and for a plurality of directions near the target pixel. A case where the intensity of the correlation of the color signal is taken into account when quantifying the directionality of the edge will be described.

図1および図2に示すように、本実施形態4の画像処理装置10Cは、被写体を撮像可能とする固体撮像素子1と、固体撮像素子1からの撮像データをA/D変換するA/D変換部2と、このA/D変換部2からのデジタル信号を各種信号処理する画像処理装置としての画像処理部3Cとを有している。   As illustrated in FIGS. 1 and 2, the image processing apparatus 10 </ b> C according to the fourth embodiment includes a solid-state imaging device 1 that can image a subject, and A / D that performs A / D conversion on imaging data from the solid-state imaging device 1. A conversion unit 2 and an image processing unit 3C as an image processing apparatus that performs various signal processing on the digital signal from the A / D conversion unit 2 are provided.

画像処理部3Cは、ホワイトバランス部4と、ガンマ補正部5と、データ補間部6Cとを有している。データ補間部6Cは、方向性データ算出部61Cと、方向性検出部62と、方向性色信号算出部63と、注目画素色信号算出部64と、これらを制御する制御部65とを有している。   The image processing unit 3C includes a white balance unit 4, a gamma correction unit 5, and a data interpolation unit 6C. The data interpolation unit 6C includes a directional data calculation unit 61C, a directional detection unit 62, a directional color signal calculation unit 63, a target pixel color signal calculation unit 64, and a control unit 65 that controls these. ing.

以下に、本実施形態4における方向性色データ算出部61C(図3のステップS1の他の例)による方向性データ算出方法について説明する。なお、方向性検出部62(図3のステップS2)、方向性色信号算出部63(図3のステップS3)および注目画素色信号算出部64(図3のステップS4)については、実施形態1〜3の場合と同様の処理を行うことができるので、ここではその説明を省略する。   Hereinafter, a direction data calculation method by the direction color data calculation unit 61C (another example of step S1 in FIG. 3) according to the fourth embodiment will be described. Note that the directionality detection unit 62 (step S2 in FIG. 3), the directionality color signal calculation unit 63 (step S3 in FIG. 3), and the target pixel color signal calculation unit 64 (step S4 in FIG. 3) are described in the first embodiment. Since the same processing as in the case of ~ 3 can be performed, the description thereof is omitted here.

上記実施形態1〜3では、例えば、指定されたエッジ方向と注目画素付近における実際のエッジ方向との近似度が大きいほど値が小さくなるように、方向性データが算出されている。これに対して、本実施形態4では、このような方向性データ算出式に、色信号の相関性の強度を表す項が加えられている。例えば、エッジ部分に色信号の相関があるときに値が小さくなり、色信号の相関がないときには値が大きくなるような項が、方向性データ算出式に加えられる。即ち、方向性データ算出部61Cは、注目画素を含む注目画素付近の複数の方向に対するエッジの方向性を定量化する際に、エッジの有無に応じて大きく変化する色信号の相関性の強度を考慮してエッジの方向性を定量化する。    In the first to third embodiments, for example, the directionality data is calculated such that the value decreases as the degree of approximation between the specified edge direction and the actual edge direction near the target pixel increases. On the other hand, in the fourth embodiment, a term representing the intensity of the correlation of the color signal is added to such a directional data calculation formula. For example, a term is added to the directional data calculation formula such that the value decreases when there is a color signal correlation at the edge portion and increases when there is no color signal correlation. That is, when the directionality data calculation unit 61C quantifies the directionality of the edge with respect to a plurality of directions in the vicinity of the target pixel including the target pixel, the correlation strength of the color signal that greatly changes depending on the presence or absence of the edge is obtained. The directionality of the edge is quantified in consideration.

注目画素の近傍の2点aおよびbにおいて、色信号のG成分とP成分とに相関性がある場合、
Ga−Pa=Gb−Pb
となる。したがって、
|Ga−Gb+Pb−Pa|
が0に近い値であるほど、2点aおよびbの間に色の相関性があると言うことができる。
When there is a correlation between the G component and the P component of the color signal at two points a and b in the vicinity of the target pixel,
Ga-Pa = Gb-Pb
It becomes. Therefore,
| Ga-Gb + Pb-Pa |
It can be said that the closer the value is to 0, the more there is a color correlation between the two points a and b.

例えば、上記実施形態1,2で用いられる方向性データ算出式(式2)に対して、下記式(式18)のような相関性強度の項が加えられる。
(式18)
・注目画素がG33の場合(図12(a)参照)
DDru’=DDru
+(|(G22+G42−G24−G44)/2+(P34−P32)|
+|(G42+G44−G22−G24)/2+(Q23−Q43)|)/2 DDho’=DDho
+|(G22+G42−G24−G44)/2+(P34−P32)|
DDrd’=DDrd
+(|(G22+G42−G24−G44)/2+(P34−P32)|
+|(G42+G44−G22−G24)/2+(Q23−Q43)|)/2 DDve’=DDve
+|(G42+G44−G22−G24)/2+(Q23−Q43)|
・注目画素がP33の場合(図12(b)参照)
DDru’=DDru
+|(G32+G23−G43−G34)/2+(Q44−Q22)|
DDho’=DDho
+|(G32−G34)+(Q24+Q44−Q22−Q42)/2|
DDrd’=DDrd
+|(G32+G23−G43−G34)/2+(Q24−Q22)|
DDve’=DDve
+|(G23−G43)+(Q42+Q44−Q22−Q24)/2|
DDru’:右斜め上方向の方向性データ算出式
DDho’:水平方向の方向性データ算出式
DDrd’:右斜め下方向の方向性データ算出式
DDve’:垂直方向の方向性データ算出式
また、上記実施形態3で用いられる方向性データ算出式(式13)には、下記式(式19)のような相関性強度の項が加えられる。
(式19)
・注目画素がG33の場合(図12(a)参照)
DDru’=DDru
+(|(G31+G51−G33−G53)/2+(Q43−Q41)|
+|(G31+G33−G51−G53)/2+(P52−P32)|)/2 DDri’=DDri
+(|(P32+P52−P34−P54)/2+(G44−G42)|)
DDrd’=DDrd
+(|(G33+G35−G53−G55)/2+(P54−P34)|
+|(G33+G53−G35−G55)/2+(Q45−Q43)|)/2 DDdo’=DDdo
+(|(Q23+Q25−Q43−Q45)/2+(G44−G24)|)
DDld’=DDld
+(|(G13+G33−G15−G35)/2+(Q25−Q23)|
+|(G13+G15−G33−G35)/2+(P34−P14)|)/2 DDle’=DDle
+(|(P12+P32−P14−P34)/2+(G24−G22)|)
DDlu’=DDlu
+(|(G11+G31−G13−G33)/2+(Q23−Q21)|
+|(G11+G13−G31−G33)/2+(P32−P12)|)/2 DDup’=DDup
+(|(Q21+Q23−Q41−Q43)/2+(G42−G22)|)
・注目画素がP33の場合(図12(b)参照)
DDru’=DDru
+(|(G41+G32−G52−G43)+(P53−P31)|)
DDri’=DDri
+(|(G32+G52−G34−G54)/2+(Q44−Q42)|)
DDrd’=DDrd
+(|(G43+G54−G34−G45)+(P35−P53)|)
DDdo’=DDdo
+(|(G23+G25−G43−G45)/2+(Q44−Q24)|)
DDld’=DDld
+(|(G23+G14−G34−G25)+(P35−P13)|)
DDle’=DDle
+(|(G12+G32−G14−G34)/2+(Q24−Q22)|)
DDlu’=DDlu
+(|(G21+G32−G12−G23)+(P13−P31)|)
DDup’=DDup
+(|(G21+G23−G41−G43)/2+(Q42−Q22)|)
DDru’:右斜め上方向の方向性データ算出式
DDri’:右方向の方向性データ算出式
DDrd’:右斜め下方向の方向性データ算出式
DDdo’:下方向の方向性データ算出式
DDld’:左斜め下方向の方向性データ算出式
DDle’:左方向の方向性データ算出式
DDlu’:左斜め上方向の方向性データ算出式
DDup’:上方向の方向性データ算出式
図2に示す方向性データ算出部61Cでは、方向性データ算出式として上記(式2)の代わりに(式18)を用いて方向性データが算出され、その方向性データを用いて、上記実施形態1,2で説明したように、方向性検出部62、方向性色信号算出部63および注目画素色信号算出部64による処理が行われる。
For example, a correlation strength term such as the following formula (formula 18) is added to the directionality data calculation formula (formula 2) used in the first and second embodiments.
(Formula 18)
When the target pixel is G33 (see FIG. 12A)
DDru '= DDru'
+ (| (G22 + G42-G24-G44) / 2 + (P34-P32) |
+ | (G42 + G44-G22-G24) / 2 + (Q23-Q43) |) / 2 DDho '= DDho
+ | (G22 + G42-G24-G44) / 2 + (P34-P32) |
DDrd ′ = DDrd
+ (| (G22 + G42-G24-G44) / 2 + (P34-P32) |
+ | (G42 + G44-G22-G24) / 2 + (Q23-Q43) |) / 2 DDve '= DDve
+ | (G42 + G44-G22-G24) / 2 + (Q23-Q43) |
When the target pixel is P33 (see FIG. 12B)
DDru '= DDru'
+ | (G32 + G23-G43-G34) / 2 + (Q44-Q22) |
DDho '= DDho'
+ | (G32−G34) + (Q24 + Q44−Q22−Q42) / 2 |
DDrd ′ = DDrd
+ | (G32 + G23-G43-G34) / 2 + (Q24-Q22) |
DDve '= DDve
+ | (G23−G43) + (Q42 + Q44−Q22−Q24) / 2 |
DDru ': Directional data calculation formula in the upper right direction DDho': Directional data calculation formula in the horizontal direction DDrd ': Directional data calculation formula in the lower right direction DDve': Directional data calculation formula in the vertical direction A correlation strength term such as the following formula (formula 19) is added to the directional data calculation formula (formula 13) used in the third embodiment.
(Formula 19)
When the target pixel is G33 (see FIG. 12A)
DDru '= DDru'
+ (| (G31 + G51-G33-G53) / 2 + (Q43-Q41) |
+ | (G31 + G33−G51−G53) / 2 + (P52−P32) |) / 2 DDri ′ = DDri
+ (| (P32 + P52-P34-P54) / 2 + (G44-G42) |)
DDrd ′ = DDrd
+ (| (G33 + G35-G53-G55) / 2 + (P54-P34) |
+ | (G33 + G53-G35-G55) / 2 + (Q45-Q43) |) / 2 DDdo '= DDdo
+ (| (Q23 + Q25-Q43-Q45) / 2 + (G44-G24) |)
DDld '= DDld
+ (| (G13 + G33-G15-G35) / 2 + (Q25-Q23) |
+ | (G13 + G15−G33−G35) / 2 + (P34−P14) |) / 2 DDle ′ = DDle
+ (| (P12 + P32-P14-P34) / 2 + (G24-G22) |)
DDlu '= DDlu
+ (| (G11 + G31-G13-G33) / 2 + (Q23-Q21) |
+ | (G11 + G13−G31−G33) / 2 + (P32−P12) |) / 2 DDup ′ = DDup
+ (| (Q21 + Q23-Q41-Q43) / 2 + (G42-G22) |)
When the target pixel is P33 (see FIG. 12B)
DDru '= DDru'
+ (| (G41 + G32-G52-G43) + (P53-P31) |)
DDri '= DDri
+ (| (G32 + G52-G34-G54) / 2 + (Q44-Q42) |)
DDrd ′ = DDrd
+ (| (G43 + G54-G34-G45) + (P35-P53) |)
DDdo '= DDdo
+ (| (G23 + G25-G43-G45) / 2 + (Q44-Q24) |)
DDld '= DDld
+ (| (G23 + G14-G34-G25) + (P35-P13) |)
DDle '= DDle
+ (| (G12 + G32-G14-G34) / 2 + (Q24-Q22) |)
DDlu '= DDlu
+ (| (G21 + G32-G12-G23) + (P13-P31) |)
DDup '= DDup
+ (| (G21 + G23−G41−G43) / 2 + (Q42−Q22) |)
DDru ′: Directional data calculation formula for the upper right direction DDri ′: Directional data calculation formula for the right direction DDrd ′: Directional data calculation formula for the lower right direction DDdo ′: Directional data calculation formula for the lower direction DDld ′ : Directional data calculation formula for diagonally downward left direction DDle ': Directional data calculation formula for horizontal direction DDlu': Directional data calculation formula for diagonally upward left direction DDup ': Directional data calculation formula for upward direction In the directionality data calculation unit 61C, the directionality data is calculated by using (Equation 18) instead of the above (Equation 2) as an equation for calculating the directionality data. As described above, the processing by the directionality detection unit 62, the directional color signal calculation unit 63, and the target pixel color signal calculation unit 64 is performed.

または、図2に示す方向性データ算出部61Cでは、方向性データ算出式として上記(式3)の代わりに(式19)を用いて方向性データが算出され、その方向性データを用いて、上記実施形態3で説明したように、方向性検出部62、方向性色信号算出部63および注目画素色信号算出部64による処理が行われる。    Alternatively, in the directionality data calculation unit 61C shown in FIG. 2, the directionality data is calculated using (Equation 19) instead of the above (Equation 3) as the directionality data calculation formula, and using the directionality data, As described in the third embodiment, processing by the directionality detection unit 62, the directional color signal calculation unit 63, and the target pixel color signal calculation unit 64 is performed.

以上により、本実施形態4では、一般的な画像の局所領域における色信号の特徴を利用して、色信号の相関性を考慮した色信号算出が行われている。しかしながら、一般的には、画像全体において、色信号の相関性が必ずしもあるわけではない。本実施形態4は、画像のエッジ部分において、色信号の相関性が強い部分に対して、色信号の相関性を利用した補間を行う場合に特に適している。
(実施形態5)
本実施形態5では、パーソナルコンピュータ(以下パソコンという)本体、入出力装置、および本発明の画像処理プログラムと、閾値などの各種データが格納されたパラメータファイルと、ベイヤデータとが格納されたコンピュータ読み出し可能な可読記録媒体(記憶媒体)を備えたデータ処理装置を用いて、上記実施形態1〜4のいずれかの処理を行う場合について説明する。
As described above, in the fourth embodiment, the color signal calculation is performed in consideration of the correlation of the color signals by using the characteristics of the color signals in the local region of a general image. However, in general, there is not necessarily a correlation between color signals in the entire image. The fourth embodiment is particularly suitable for performing interpolation using the color signal correlation on the edge portion of the image where the color signal correlation is strong.
(Embodiment 5)
In the fifth embodiment, a personal computer (hereinafter referred to as a personal computer), an input / output device, an image processing program of the present invention, a parameter file storing various data such as threshold values, and a computer readable storing Bayer data are readable. A case will be described in which any one of the first to fourth embodiments is performed using a data processing apparatus including a readable recording medium (storage medium).

図10は、本実施形態5のデータ処理装置の構成例を示すブロック図である。   FIG. 10 is a block diagram illustrating a configuration example of the data processing apparatus according to the fifth embodiment.

図10に示すように、本実施形態5のデータ処理装置7は、パソコン本体8と、入出力装置9とを有している。    As shown in FIG. 10, the data processing device 7 of the fifth embodiment includes a personal computer main body 8 and an input / output device 9.

パソコン本体8には各部を制御する制御部としてのCPU81と、ハードディスクなどのメモリ82と、入出力インタフェース83とが内蔵されており、入出力装置9には光ディスクなどの可読記録媒体91が内蔵されている。なお、メモリ82も、画像処理プログラムが格納されたコンピュータ読み出し可能な可読記録媒体である。    The personal computer main body 8 includes a CPU 81 as a control unit for controlling each unit, a memory 82 such as a hard disk, and an input / output interface 83, and the input / output device 9 includes a readable recording medium 91 such as an optical disk. ing. The memory 82 is also a computer-readable readable recording medium in which an image processing program is stored.

CPU81によって、入出力インタフェース83を介して入出力装置9が制御され、入出力装置9内の可読記録媒体91から読み出された画像処理プログラム、パラメータファイルおよびベイヤデータが入出力インタフェース83を介して入力されてメモリ82内に格納される。   The CPU 81 controls the input / output device 9 via the input / output interface 83, and the image processing program, parameter file, and Bayer data read from the readable recording medium 91 in the input / output device 9 are input via the input / output interface 83. And stored in the memory 82.

また、CPU81によって、パソコン本体8内のメモリ82から画像処理プログラム、パラメータファイルおよびベイヤデータが読み取られ、画像処理プログラムの各命令に従って、入力されたベイヤデータに対して上記実施形態1〜4のいずれかの補間処理を含む画像処理が行われた後、パソコン本体8の入出力インタフェース83から入出力装置9が制御されて、入出力インタフェース83を介して画像処理後の画像データが可読記録媒体91に出力される。   Further, the CPU 81 reads the image processing program, the parameter file, and the Bayer data from the memory 82 in the personal computer main body 8, and according to each command of the image processing program, any one of the first to fourth embodiments described above is performed on the input Bayer data. After image processing including interpolation processing is performed, the input / output device 9 is controlled from the input / output interface 83 of the personal computer body 8, and the image data after image processing is output to the readable recording medium 91 via the input / output interface 83. Is done.

したがって、本実施形態5によれば、パソコン上で上記実施形態1〜4のいずれかの補間処理を含む画像処理を行うことができる。即ち、ここでは図示しないが、撮像装置からベイヤデータのみが出力され、パソコン本体8側で画像処理部3,3A〜3Cのいずれかによる画像処理が行われることによって、撮像装置側では高速な撮影を行うことができる。さらに、パソコン本体8側では閾値を変化させて複数回の画像処理を行うことも可能となり、所望の高画質の画像を容易に得ることができる。   Therefore, according to the fifth embodiment, the image processing including the interpolation processing according to any of the first to fourth embodiments can be performed on the personal computer. That is, although not shown here, only Bayer data is output from the imaging device, and image processing by any of the image processing units 3 and 3A to 3C is performed on the personal computer main body 8 side, whereby high-speed shooting is performed on the imaging device side. It can be carried out. Further, the personal computer main body 8 side can perform image processing a plurality of times by changing the threshold value, and a desired high-quality image can be easily obtained.

以上により、本実施形態1〜4によれば、データ補間部は、注目画素付近における右斜め上方向および右斜め下方向の少なくとも一方を含む複数の方向に対するエッジの方向性を定量化して方向性データを算出する方向性データ算出部と、この方向性データ算出部61で算出された複数の方向に対する方向性データを用いて注目画素付近におけるエッジの方向性を検出する方向性検出部と、この方向性検出部で検出された方向性に対応する色信号を算出する方向性色信号算出部と、この方向性色信号算出部で算出された一つ以上の色信号を用いて注目画素の色信号を算出する注目画素色信号算出部とを有している。これによって、斜め方向を含む複数の方向のエッジに対する色信号の相関性を利用して、偽色信号の発生を更に抑制することができる。   As described above, according to the first to fourth embodiments, the data interpolation unit quantifies the directionality of edges with respect to a plurality of directions including at least one of the upper right diagonal direction and the lower right diagonal direction near the target pixel. A directionality data calculation unit that calculates data, a directionality detection unit that detects the directionality of an edge near the target pixel using the directionality data for a plurality of directions calculated by the directionality data calculation unit 61, and A directional color signal calculation unit that calculates a color signal corresponding to the directionality detected by the directionality detection unit, and the color of the target pixel using one or more color signals calculated by the directionality color signal calculation unit A pixel-of-interest color signal calculation unit that calculates a signal. This makes it possible to further suppress the generation of false color signals by utilizing the correlation of the color signals with respect to edges in a plurality of directions including an oblique direction.

なお、以上のように、本発明の好ましい実施形態1〜5を用いて本発明を例示してきたが、本発明は、この実施形態1〜5に限定して解釈されるべきものではない。本発明は、特許請求の範囲によってのみその範囲が解釈されるべきであることが理解される。当業者は、本発明の具体的な好ましい実施形態1〜5の記載から、本発明の記載および技術常識に基づいて等価な範囲を実施することができることが理解される。本明細書において引用した特許、特許出願および文献は、その内容自体が具体的に本明細書に記載されているのと同様にその内容が本明細書に対する参考として援用されるべきであることが理解される。   In addition, as mentioned above, although this invention has been illustrated using preferable Embodiment 1-5 of this invention, this invention should not be limited and limited to this Embodiment 1-5. It is understood that the scope of the present invention should be construed only by the claims. It is understood that those skilled in the art can implement an equivalent range based on the description of the present invention and the common general technical knowledge from the description of specific preferred embodiments 1 to 5 of the present invention. Patents, patent applications, and documents cited herein should be incorporated by reference in their entirety, as if the contents themselves were specifically described herein. Understood.

本発明は、複数種類の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いた補間処理により生成する画像処理装置、これを用いた単板式のディジタルカメラ、ビデオカメラおよびカメラ付き携帯電話装置などの撮影装置、この画像処理装置を用いた画像処理方法、これをコンピュータに実行させるための画像処理プログラムおよびこの画像処理プログラムを格納したコンピュータ読み出し可能な可読記録媒体の分野において、複数種類の色フィルタが各画素ブロックに離散的に配置された固体撮像素子から出力される色信号から各画素における例えばRGB全ての色信号を、注目画素およびその近傍画素の色信号を用いた補間処理により生成する際に、画像の局所領域における特徴を利用すると共に、斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行うことにより、偽色信号の発生を更に抑制した色信号算出を行うことができる。また、注目画素を中心とする8方向の方向性検出を行って色信号算出を行うことにより、更に偽色信号の少ない補間処理を行うことができる。さらに、色相関の特徴を利用して算出した色信号を用いて、さらに色相関を利用して色信号を算出することにより、偽色信号を更に低減することができる。本発明の画像処理装置、撮像装置、画像処理方法、画像処理プログラムおよび可読記録媒体によれば、被写体に含まれるエッジを高い精度で検出して、偽色信号の発生を更に抑制した色信号を算出することができるため、高画質の画像を得ることができる。   According to the present invention, from a color signal output from a solid-state imaging device in which a plurality of types of color filters are discretely arranged in each pixel unit, all color signals in each pixel are obtained, and color signals of a target pixel and its neighboring pixels are obtained. Image processing apparatus generated by interpolation processing used, single-plate digital camera using the same, photographing apparatus such as video camera and camera-equipped mobile phone apparatus, image processing method using the image processing apparatus, and execution of this on a computer In the field of an image processing program for image processing and a computer-readable readable recording medium storing the image processing program, a color signal output from a solid-state imaging device in which a plurality of types of color filters are discretely arranged in each pixel block For example, all RGB color signals in each pixel are interpolated using the color signals of the target pixel and its neighboring pixels. The color signal calculation that further suppresses the generation of false color signals by using the feature in the local area of the image and performing the interpolation process that also uses the correlation of the color signal with the diagonal edge It can be performed. In addition, by performing color signal calculation by detecting directionality in eight directions with the pixel of interest at the center, interpolation processing with fewer false color signals can be performed. Furthermore, the false color signal can be further reduced by calculating the color signal using the color correlation using the color signal calculated using the characteristics of the color correlation. According to the image processing device, the imaging device, the image processing method, the image processing program, and the readable recording medium of the present invention, it is possible to detect a color signal in which an edge included in a subject is detected with high accuracy and generation of a false color signal is further suppressed. Since it can be calculated, a high-quality image can be obtained.

本発明の実施形態1〜4の画像処理装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the image processing apparatus of Embodiment 1-4 of this invention. 図1のデータ補間部の詳細構成例を示すブロック図である。It is a block diagram which shows the detailed structural example of the data interpolation part of FIG. 図2のデータ補間部による補間処理動作の一例を説明するためのフローチャートである。3 is a flowchart for explaining an example of an interpolation processing operation by a data interpolation unit in FIG. 2. 入力されたベイヤデータ領域内の補間指定領域を説明するための平面図である。It is a top view for demonstrating the interpolation designation | designated area | region in the input Bayer data area. 本発明の実施形態1,2で用いられる4種類の指定方向を説明するための模式図である。It is a schematic diagram for demonstrating four types of designated directions used by Embodiment 1, 2 of this invention. 図2の方向性検出部による方向性検出処理動作の一例(実施形態1,2)を説明するためのフローチャートである。5 is a flowchart for explaining an example (first and second embodiments) of a directionality detection processing operation by a directionality detection unit in FIG. 2. 注目画素の色成分がG、RまたはBである場合のベイヤ配列の画素位置を示す平面図である。It is a top view which shows the pixel position of a Bayer arrangement in case the color component of an attention pixel is G, R, or B. FIG. 本発明の実施形態3で用いる8種類の指定方向を説明するための模式図である。It is a schematic diagram for demonstrating eight types of designated directions used in Embodiment 3 of this invention. 図2の方向性検出部による方向性検出処理動作の他の例(実施形態3)を説明するためのフローチャートである。10 is a flowchart for explaining another example (third embodiment) of the directionality detection processing operation by the directionality detection unit of FIG. 本発明の実施形態5のデータ処理装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the data processor of Embodiment 5 of this invention. ベイヤ配列の色フィルタアレイの一例を示す平面図である。It is a top view which shows an example of the color filter array of a Bayer arrangement. (a)は注目画素の色成分がGである場合のベイヤ配列を示す平面図であり、(b)は注目画素の色成分がRまたはBである場合のベイヤ配列を示す平面図である。(A) is a top view which shows a Bayer arrangement | sequence when the color component of an attention pixel is G, (b) is a top view which shows a Bayer arrangement when the color component of an attention pixel is R or B. (a)は固体撮像素子の色信号値(輝度データ)の一例を示す平面図であり、(b)は各画素におけるベイヤ配列のカラーフィルタの配置例を示す平面図である。(A) is a top view which shows an example of the color signal value (luminance data) of a solid-state image sensor, (b) is a top view which shows the example of arrangement | positioning of the color filter of a Bayer array in each pixel.

符号の説明Explanation of symbols

1 固体撮像素子
2 A/D(アナログ/ディジタル)変換部
3,3A〜3C 画像処理部(画像処理装置)
4 ホワイトバランス部
5 ガンマ補正部
6,6A〜6C データ補間部
61,61B,61C 方向性データ算出部
62,62B 方向性検出部
63,63A,63B 方向性色信号算出部
64,64B 注目画素色信号算出部
65 制御部
7 データ処理装置
8 パソコン本体
81 CPU
82 メモリ
83 入出力インタフェース
9 入出力装置
91 可読記録媒体
10,10A〜10C 撮影装置
DESCRIPTION OF SYMBOLS 1 Solid-state image sensor 2 A / D (analog / digital) conversion part 3, 3A-3C Image processing part (image processing apparatus)
4 White balance unit 5 Gamma correction unit 6, 6A to 6C Data interpolation unit 61, 61B, 61C Directional data calculation unit 62, 62B Directional detection unit 63, 63A, 63B Directional color signal calculation unit 64, 64B Target pixel color Signal calculation unit 65 Control unit 7 Data processing device 8 Personal computer body 81 CPU
82 Memory 83 Input / output interface 9 Input / output device 91 Readable recording medium 10, 10A to 10C Imaging device

Claims (42)

複数種類の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いたデータ補間処理により生成するデータ補間部を有する画像処理装置において、
該データ補間部は、
注目画素付近における斜め方向を含む複数の方向に対するエッジの方向性を定量化した方向性データを算出する方向性データ算出手段と、
該方向性データ算出手段で算出された、該複数の方向に対する方向性データを用いて注目画素付近におけるエッジの方向性を検出する方向性検出手段と、
該方向性検出手段で検出された一または複数のエッジの方向性に対応する色信号を算出する方向性色信号算出手段と、
該方向性色信号算出手段で算出された一つ以上の色信号を用いて注目画素の色信号を算出する注目画素色信号算出手段とを備え、
該方向性色信号算出手段は、該データ補間処理において、ベイヤ配列の斜め方向のデータ補間を行う際に、該斜め方向の画素に隣接する画素と当該画素に更に隣接する画素とを含む範囲の画素に注目し、画素の中心にとらわれず互いに隣接しかつ注目した該範囲の画素に属する2×2の4画素の間の交点における色信号を算出し、算出された色信号との色の相関によって前記注目画素の色信号を算出することにより、該斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行う画像処理装置。
Data interpolation using color signals from a solid-state image sensor in which multiple types of color filters are discretely arranged in each pixel unit, using all the color signals in each pixel using the color signals of the pixel of interest and its neighboring pixels In an image processing apparatus having a data interpolation unit generated by processing,
The data interpolation unit
Directionality data calculating means for calculating directionality data quantifying the directionality of edges with respect to a plurality of directions including an oblique direction in the vicinity of the target pixel;
Directionality detection means for detecting the directionality of an edge in the vicinity of the target pixel using the directionality data for the plurality of directions calculated by the directionality data calculation means;
Directional color signal calculating means for calculating a color signal corresponding to the directionality of one or a plurality of edges detected by the directionality detecting means;
A pixel-of-interest color signal calculation unit that calculates a color signal of the pixel of interest using one or more color signals calculated by the directional color signal calculation unit;
In the data interpolation process, the directional color signal calculation means includes a pixel adjacent to the pixel in the diagonal direction and a pixel further adjacent to the pixel when performing data interpolation in the diagonal direction of the Bayer array. Pay attention to a pixel, calculate a color signal at an intersection between 2 × 2 four pixels that are adjacent to each other and are not related to the center of the pixel and belong to the pixel in the target range, and correlate the color with the calculated color signal An image processing apparatus that performs an interpolation process that also uses the correlation of the color signal to the edge in the diagonal direction by calculating the color signal of the pixel of interest by.
複数種類の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いたデータ補間処理により生成するデータ補間部を有する画像処理装置において、
該データ補間部は、
注目画素付近における斜め方向を含む複数の方向に対するエッジの方向性を定量化した方向性データを算出する方向性データ算出手段と、
該方向性データ算出手段で算出された、該複数の方向に対する方向性データを用いて注目画素付近におけるエッジの方向性を検出する方向性検出手段と、
該方向性検出手段で検出された一または複数のエッジの方向性に対応する色信号を算出する方向性色信号算出手段と、
該方向性色信号算出手段で算出された一つ以上の色信号を用いて注目画素の色信号を算出する注目画素色信号算出手段とを備え、
該方向性色信号算出手段は、該データ補間処理において、ベイヤ配列の斜め方向のデータ補間を行う際に、該注目画素および該斜め方向の一方の画素を含む2×2の4画素に注目し、画素の中心にとらわれず該4画素の交点における色信号を算出すると共に、該注目画素および該斜め方向の他方の画素を含む2×2の4画素に注目し、画素の中心にとらわれず当該4画素の交点における色信号を算出し、算出された各色信号との色の相関を用いて前記注目画素の色信号を算出することにより、該斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行う画像処理装置。
Data interpolation using color signals from a solid-state image sensor in which multiple types of color filters are discretely arranged in each pixel unit, using all the color signals in each pixel using the color signals of the pixel of interest and its neighboring pixels In an image processing apparatus having a data interpolation unit generated by processing,
The data interpolation unit
Directionality data calculating means for calculating directionality data quantifying the directionality of edges with respect to a plurality of directions including an oblique direction in the vicinity of the target pixel;
Directionality detection means for detecting the directionality of an edge in the vicinity of the target pixel using the directionality data for the plurality of directions calculated by the directionality data calculation means;
Directional color signal calculating means for calculating a color signal corresponding to the directionality of one or a plurality of edges detected by the directionality detecting means;
A pixel-of-interest color signal calculation unit that calculates a color signal of the pixel of interest using one or more color signals calculated by the directional color signal calculation unit;
In the data interpolation process, the directional color signal calculation means pays attention to the 2 × 2 4 pixels including the target pixel and one pixel in the diagonal direction when performing data interpolation in the diagonal direction of the Bayer array. In addition to calculating the color signal at the intersection of the four pixels without being bound by the center of the pixel, pay attention to the 2 × 2 four pixels including the target pixel and the other pixel in the oblique direction, and not depending on the center of the pixel By calculating the color signal at the intersection of four pixels and calculating the color signal of the pixel of interest using the color correlation with each calculated color signal, the correlation of the color signal with respect to the diagonal edge is also used. Image processing apparatus for performing the interpolation processing.
前記斜め方向を含む複数の方向は、注目画素付近における右斜め上方向および右斜め下方向の少なくとも一方を含む複数の方向である請求項1または2に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the plurality of directions including the oblique direction are a plurality of directions including at least one of an upper right oblique direction and an oblique lower right direction in the vicinity of the target pixel. 前記方向性データ算出手段は、注目画素を通る右斜め上方向、水平方向、右斜め下方向および垂直方向の4方向に対して前記方向性データを算出する請求項1〜3のいずれかに記載の画像処理装置。   The directionality data calculation unit calculates the directionality data with respect to four directions including a diagonally right upward direction, a horizontal direction, a diagonally right downward direction, and a vertical direction passing through the target pixel. Image processing apparatus. 前記方向性データ算出手段は、注目画素を中心として上方向、斜め右上方向、右方向、斜め右下方向、下方向、斜め左下方向、左方向および斜め左上方向の8方向に対して前記方向性データを算出する請求項1〜3のいずれかに記載の画像処理装置。   The directionality data calculating means has the directionality with respect to eight directions of an upward direction, an oblique upper right direction, a right direction, an oblique lower right direction, a downward direction, an oblique lower left direction, a left direction, and an oblique upper left direction with the target pixel as a center. The image processing apparatus according to claim 1, which calculates data. 前記方向性データ算出手段は、注目画素付近の複数の方向に対するエッジの方向性を定量化する際に、該エッジの有無に応じて変化する色信号の相関性の強度を表す項が方向性データ算出式に加えられている請求項1〜5のいずれかに記載の画像処理装置。   When the directionality data calculating means quantifies the directionality of the edge with respect to a plurality of directions near the target pixel, the term indicating the intensity of the correlation of the color signal that changes depending on the presence or absence of the edge is the directionality data. The image processing apparatus according to claim 1, wherein the image processing apparatus is added to the calculation formula. エッジ部分に色信号の相関があるときに値が小さくなり、該エッジ部分に該色信号の相関がないときには値が大きくなるような項が前記方向性データ算出式に加えられている請求項6に記載の画像処理装置。   7. A term is added to the directional data calculation formula such that a value decreases when there is a color signal correlation at an edge portion, and a value increases when there is no color signal correlation at the edge portion. An image processing apparatus according to 1. 前記方向性検出手段は、前記複数の方向に対する方向性データの最大値が所定の閾値よりも小さいか否かによって、注目画素付近にエッジがなく輝度勾配がなだらかな平坦部であるか否かを判定し、該平坦部の場合には「方向性なし」を検出し、該平坦部ではない場合には「方向性あり」を検出する請求項1または2に記載の画像処理装置。   The directionality detection means determines whether or not the flat portion has a smooth luminance gradient without an edge near the target pixel depending on whether or not the maximum value of the directionality data for the plurality of directions is smaller than a predetermined threshold value. The image processing apparatus according to claim 1, wherein the image processing apparatus determines and detects “no directionality” in the case of the flat portion, and detects “directionality” in the case of not being the flat portion. 前記方向性検出手段は、前記「方向性あり」を検出した場合に、前記方向性データの値が最小値となる方向を注目画素付近におけるエッジ方向として検出する請求項8に記載の画像処理装置。   The image processing apparatus according to claim 8, wherein the directionality detection unit detects a direction in which the value of the directionality data is a minimum value as an edge direction in the vicinity of a target pixel when detecting the “with directionality”. . 前記方向性検出手段は、前記「方向性あり」を検出した場合であっても、前記方向性データの値が最小値となる方向が複数存在する場合には、「方向性なし」を検出する請求項8に記載の画像処理装置。 The directionality detecting means detects “no directionality” when there are a plurality of directions in which the value of the directionality data is a minimum value even when the “directionality” is detected. The image processing apparatus according to claim 8. 前記方向性検出手段は、複数の方向に対する各方向性データから値の小さい順に一つ以上の方向を注目画素付近におけるエッジの方向性候補として検出する請求項1または2に記載の画像処理装置。   The image processing device according to claim 1, wherein the directionality detection unit detects one or more directions as directional candidates for edges in the vicinity of the target pixel in order of increasing value from each directionality data for a plurality of directions. 前記方向性色信号算出手段は、
注目画素近傍の任意の位置において前記エッジの方向における異なる2色の色信号の差を算出する色差算出手段と、
該色差算出手段で算出された色信号の差の相関性を用いて色信号を算出する色信号算出手段とを有する請求項1または2に記載の画像処理装置。
The directional color signal calculation means includes
Color difference calculating means for calculating a difference between two different color signals in the direction of the edge at an arbitrary position near the target pixel;
The image processing apparatus according to claim 1, further comprising: a color signal calculation unit that calculates a color signal using a correlation between the color signal differences calculated by the color difference calculation unit.
前記方向性色信号算出手段は、
注目画素近傍の任意の位置において前記エッジの方向における異なる2色の色信号の比を算出する色比算出手段と、
該色比算出手段で算出された色信号の比の相関性を用いて色信号を算出する色信号算出手段とを有する請求項1または2に記載の画像処理装置。
The directional color signal calculation means includes
Color ratio calculating means for calculating a ratio of two different color signals in the direction of the edge at an arbitrary position near the target pixel;
The image processing apparatus according to claim 1, further comprising: a color signal calculation unit that calculates a color signal by using the correlation of the ratio of the color signals calculated by the color ratio calculation unit.
前記方向性色信号算出手段は、前記注目画素近傍の任意の位置として、該注目画素の位置、該注目画素の近傍画素の中央位置、および、該注目画素の近傍において互いに隣接する画素間の交点のいずれかを用いる請求項12または13に記載の画像処理装置。   The directional color signal calculation means may include, as an arbitrary position in the vicinity of the target pixel, a position of the target pixel, a center position of the neighboring pixel of the target pixel, and an intersection between adjacent pixels in the vicinity of the target pixel. The image processing apparatus according to claim 12, wherein any one of the above is used. 前記方向性色信号算出手段は、前記方向性検出手段で検出された方向に対して、算出しようとする色成分の画素が存在しない場合に、該検出された方向以外の注目画素の近傍画素から、該算出しようとする色成分の画素を参照して前記エッジの方向性に対応する色信号を算出する請求項1、2および12〜14のいずれかに記載の画像処理装置。   The directional color signal calculation means calculates from the neighboring pixels of the target pixel other than the detected direction when there is no pixel of the color component to be calculated with respect to the direction detected by the directionality detection means. The image processing apparatus according to claim 1, wherein a color signal corresponding to the directionality of the edge is calculated with reference to pixels of the color component to be calculated. 前記方向性色信号算出手段は、前記検出された方向以外の注目画素の複数の近傍画素において前記算出しようとする色成分の平均値を用いる請求項15に記載の画像処理装置。   The image processing apparatus according to claim 15, wherein the directional color signal calculation unit uses an average value of the color components to be calculated in a plurality of neighboring pixels of the target pixel other than the detected direction. 前記注目画素色信号算出手段は、前記方向性検出手段で「方向性あり」と検出された画素に対して、前記方向性色信号算出手段で算出された色信号を注目画素における色信号として算出する請求項8または9に記載の画像処理装置。   The pixel-of-interest color signal calculation unit calculates the color signal calculated by the direction-color signal calculation unit as a color signal in the pixel of interest for the pixel detected as “directional” by the direction detection unit. The image processing apparatus according to claim 8 or 9. 前記注目画素色信号算出手段は、前記方向性検出手段で「方向性なし」と検出された画素に対して、バイリニア法を用いて注目画素における色信号を算出する請求項8または10に記載の画像処理装置。   The pixel-of-interest color signal calculation unit calculates a color signal of the pixel of interest using a bilinear method for a pixel detected as “no directionality” by the directionality detection unit. Image processing device. 前記注目画素色信号算出手段は、前記方向性検出手段で検出された複数の方向性に対応する各色信号の平均色を注目画素における色信号として算出する平均色算出手段を有する請求項1または2に記載の画像処理装置。   3. The target pixel color signal calculating unit includes an average color calculating unit that calculates an average color of each color signal corresponding to a plurality of directions detected by the direction detecting unit as a color signal in the target pixel. An image processing apparatus according to 1. 前記注目画素色信号算出手段は、前記方向性検出手段で検出された複数の方向性に対応する各色信号の平均色を算出する平均色算出手段と、該平均色算出手段で算出された平均色と注目画素の色との相関性を利用して注目画素における色信号を算出する多重色相関色信号算出手段とを有する請求項1または2に記載の画像処理装置。   The target pixel color signal calculation means includes an average color calculation means for calculating an average color of each color signal corresponding to a plurality of directions detected by the directionality detection means, and an average color calculated by the average color calculation means The image processing apparatus according to claim 1, further comprising: a multi-color correlated color signal calculating unit that calculates a color signal at the target pixel using a correlation between the color of the target pixel and the color of the target pixel. 被写体を撮像可能とする固体撮像素子と、該固体撮像素子からの撮像データをアナログ/デジタル変換するアナログ/デジタル変換部と、該アナログ/デジタル変換部からのデジタル信号を信号処理する請求項1〜20のいずれかに記載の画像処理装置とを有する撮影装置。   2. A solid-state imaging device capable of imaging a subject, an analog / digital conversion unit for analog / digital conversion of imaging data from the solid-state imaging device, and a digital signal from the analog / digital conversion unit are signal-processed. An image capturing apparatus comprising the image processing apparatus according to claim 20. 複数種類の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いたデータ補間処理により生成する画像処理方法において、
注目画素付近における斜め方向を含む複数の方向に対するエッジの方向性を定量化した方向性データを算出する方向性データ算出ステップと、
該方向性データ算出ステップで算出された、該複数の方向に対する方向性データを用いて注目画素付近におけるエッジの方向性を検出する方向性検出ステップと、
該方向性検出ステップで検出された一または複数のエッジの方向性に対応する色信号を算出する方向性色信号算出ステップと、
該方向性色信号算出ステップで算出された一つ以上の色信号を用いて注目画素の色信号を算出する注目画素色信号算出ステップとを有し、
該方向性色信号算出ステップは、該データ補間処理において、ベイヤ配列の斜め方向のデータ補間を行う際に、該斜め方向の画素に隣接する画素と当該画素に更に隣接する画素とを含む範囲の画素に注目し、画素の中心にとらわれず互いに隣接しかつ注目した該範囲の画素に属する2×2の4画素の間の交点における色信号を算出し、算出された色信号との色の相関によって前記注目画素の色信号を算出することにより、該斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行う画像処理方法。
Data interpolation using color signals from a solid-state image sensor in which multiple types of color filters are discretely arranged in each pixel unit, using all the color signals in each pixel using the color signals of the pixel of interest and its neighboring pixels In an image processing method generated by processing,
A directionality data calculation step for calculating directionality data quantifying the directionality of the edge with respect to a plurality of directions including an oblique direction in the vicinity of the target pixel;
A directionality detecting step for detecting the directionality of the edge in the vicinity of the target pixel using the directionality data for the plurality of directions calculated in the directionality data calculating step;
A directional color signal calculation step for calculating a color signal corresponding to the directionality of one or a plurality of edges detected in the directionality detection step;
A target pixel color signal calculation step of calculating a color signal of the target pixel using one or more color signals calculated in the directional color signal calculation step;
In the data interpolation process, the directional color signal calculation step includes a pixel including a pixel adjacent to the pixel in the diagonal direction and a pixel further adjacent to the pixel when performing data interpolation in the diagonal direction of the Bayer array. Pay attention to a pixel, calculate a color signal at an intersection between 2 × 2 four pixels that are adjacent to each other and are not related to the center of the pixel and belong to the pixel in the target range, and correlate the color with the calculated color signal An image processing method for performing an interpolation process that also uses the correlation of the color signal with respect to the diagonal edge by calculating the color signal of the pixel of interest by
複数種類の色フィルタが各画素部に離散的に配置された固体撮像素子から出力される色信号から、各画素における全ての色信号を、注目画素およびその近傍画素の色信号を用いたデータ補間処理により生成する画像処理方法において、
注目画素付近における斜め方向を含む複数の方向に対するエッジの方向性を定量化した方向性データを算出する方向性データ算出ステップと、
該方向性データ算出ステップで算出された、該複数の方向に対する方向性データを用いて注目画素付近におけるエッジの方向性を検出する方向性検出ステップと、
該方向性検出ステップで検出された一または複数のエッジの方向性に対応する色信号を算出する方向性色信号算出ステップと、
該方向性色信号算出ステップで算出された一つ以上の色信号を用いて注目画素の色信号を算出する注目画素色信号算出ステップとを有し、
該方向性色信号算出ステップは、該データ補間処理において、ベイヤ配列の斜め方向のデータ補間を行う際に、該注目画素および該斜め方向の一方の画素を含む2×2の4画素に注目し、画素の中心にとらわれず該4画素の交点における色信号を算出すると共に、該注目画素および該斜め方向の他方の画素を含む2×2の4画素に注目し、画素の中心にとらわれず当該4画素の交点における色信号を算出し、算出された各色信号との色の相関を用いて前記注目画素の色信号を算出することにより、該斜め方向のエッジに対する色信号の相関性をも利用した補間処理を行う画像処理方法。
Data interpolation using color signals from a solid-state image sensor in which multiple types of color filters are discretely arranged in each pixel unit, using all the color signals in each pixel using the color signals of the pixel of interest and its neighboring pixels In an image processing method generated by processing,
A directionality data calculation step for calculating directionality data quantifying the directionality of the edge with respect to a plurality of directions including an oblique direction in the vicinity of the target pixel;
A directionality detecting step for detecting the directionality of the edge in the vicinity of the target pixel using the directionality data for the plurality of directions calculated in the directionality data calculating step;
A directional color signal calculation step for calculating a color signal corresponding to the directionality of one or a plurality of edges detected in the directionality detection step;
A target pixel color signal calculation step of calculating a color signal of the target pixel using one or more color signals calculated in the directional color signal calculation step;
The directional color signal calculation step pays attention to 2 × 2 4 pixels including the target pixel and one pixel in the diagonal direction when performing data interpolation in the diagonal direction of the Bayer array in the data interpolation processing. In addition to calculating the color signal at the intersection of the four pixels without being bound by the center of the pixel, pay attention to the 2 × 2 four pixels including the target pixel and the other pixel in the oblique direction, and not depending on the center of the pixel By calculating the color signal at the intersection of four pixels and calculating the color signal of the pixel of interest using the color correlation with each calculated color signal, the correlation of the color signal with respect to the diagonal edge is also used. Image processing method for performing the interpolation processing.
前記方向性データ算出ステップは、注目画素を通る右斜め上方向、水平方向、右斜め下方向および垂直方向の4方向に対して前記方向性データを算出する請求項22または23に記載の画像処理方法。   The image processing according to claim 22 or 23, wherein the directionality data calculation step calculates the directionality data with respect to four directions including a right upper direction, a horizontal direction, a right lower direction, and a vertical direction passing through the target pixel. Method. 前記方向性データ算出ステップは、注目画素を中心として上方向、斜め右上方向、右方向、斜め右下方向、下方向、斜め左下方向、左方向および斜め左上方向の8方向に対して前記方向性データを算出する請求項22または23に記載の画像処理方法。   The directionality data calculating step includes the directionality with respect to eight directions of an upward direction, an oblique upper right direction, a right direction, an oblique lower right direction, a downward direction, an oblique lower left direction, a left direction, and an oblique upper left direction with the target pixel as a center. The image processing method according to claim 22 or 23, wherein data is calculated. 前記方向性データ算出ステップは、注目画素付近の複数の方向に対するエッジの方向性を定量化する際に、該エッジの有無に応じて変化する色信号の相関性の強度を表す項が方向性データ算出式に加えられる請求項22〜25のいずれかに記載の画像処理方法。   In the directionality data calculation step, when quantifying the directionality of the edge with respect to a plurality of directions in the vicinity of the target pixel, a term representing the intensity of the correlation of the color signal that changes depending on the presence or absence of the edge is the directionality data. The image processing method according to any one of claims 22 to 25, which is added to a calculation formula. エッジ部分に色信号の相関があるときに値が小さくなり、該エッジ部分に該色信号の相関がないときには値が大きくなるような項が前記方向性データ算出式に加えられる請求項26に記載の画像処理方法。   27. A term is added to the directional data calculation formula such that a value decreases when there is a color signal correlation at an edge portion, and a value increases when there is no color signal correlation at the edge portion. Image processing method. 前記方向性検出ステップは、複数の方向に対する方向性データの最大値が所定の閾値よりも小さいか否かによって、注目画素付近にエッジがなく輝度勾配がなだらかな平坦部であるか否かを判定し、該平坦部の場合には「方向性なし」を検出し、該平坦部ではない場合には「方向性あり」を検出する請求項22または23に記載の画像処理方法。   In the direction detection step, whether or not the maximum value of the direction data for a plurality of directions is smaller than a predetermined threshold value determines whether or not the pixel is a flat portion where there is no edge near the target pixel and the luminance gradient is gentle. 24. The image processing method according to claim 22, wherein “no directionality” is detected in the case of the flat portion, and “directionality” is detected in the case of not being the flat portion. 前記方向性検出ステップは、前記「方向性あり」を検出した場合に、前記方向性データの値が最小値となる方向を注目画素付近におけるエッジ方向として検出する請求項28に記載の画像処理方法。   29. The image processing method according to claim 28, wherein the direction detection step detects a direction in which a value of the direction data is a minimum value as an edge direction in the vicinity of a target pixel when the “with direction” is detected. . 前記方向性検出ステップは、前記「方向性あり」を検出した場合であっても、前記方向性データの値が最小値となる方向が複数存在する場合には、「方向性なし」を検出する請求項28に記載の画像処理方法。   The directionality detecting step detects “no directionality” when there are a plurality of directions in which the value of the directionality data has a minimum value even when the “directionality” is detected. The image processing method according to claim 28. 前記方向性検出ステップは、複数の方向に対する方向性データから値の小さい順に一つ以上の方向を注目画素付近におけるエッジ方向の方向性候補として検出する請求項22または23に記載の画像処理方法。   The image processing method according to claim 22 or 23, wherein the directionality detection step detects one or more directions as directionality candidates in the edge direction in the vicinity of the target pixel in order of increasing values from the directionality data for a plurality of directions. 前記方向性色信号算出ステップは、
注目画素の近傍の任意の位置において前記エッジの方向における異なる2色の色信号の差を算出する色差算出ステップと、
該色差算出ステップで算出された色信号の差の相関性を用いて色信号を算出する色信号算出ステップとを有する請求項22または23に記載の画像処理方法。
The directional color signal calculation step includes:
A color difference calculating step of calculating a difference between two different color signals in the direction of the edge at an arbitrary position in the vicinity of the target pixel;
24. The image processing method according to claim 22, further comprising: a color signal calculation step of calculating a color signal using the correlation of the color signal difference calculated in the color difference calculation step.
前記方向性色信号算出ステップは、
注目画素の近傍の任意の位置において前記エッジの方向における異なる2色の色信号の比を算出する色比算出ステップと、
該色比算出ステップで算出された色信号の比の相関性を用いて色信号を算出する色信号算出ステップとを有する請求項22または23に記載の画像処理方法。
The directional color signal calculation step includes:
A color ratio calculating step of calculating a ratio of two different color signals in the direction of the edge at an arbitrary position in the vicinity of the target pixel;
24. The image processing method according to claim 22, further comprising a color signal calculation step of calculating a color signal by using the correlation of the ratio of the color signals calculated in the color ratio calculation step.
前記方向性色信号算出ステップは、注目画素の近傍の任意の位置として、該注目画素の位置、該注目画素の近傍画素の中央位置、および、該注目画素の近傍において互いに隣接する画素間の交点のいずれかを用いる請求項32または33に記載の画像処理方法。   In the directional color signal calculation step, as an arbitrary position in the vicinity of the target pixel, the position of the target pixel, the center position of the vicinity pixel of the target pixel, and an intersection between adjacent pixels in the vicinity of the target pixel The image processing method according to claim 32 or 33, wherein any one of the above is used. 前記方向性色信号算出ステップは、前記方向性検出手段で検出された検出方向に対して、算出しようとする色成分の画素が存在しない場合に、該検出された方向以外の注目画素の複数の近傍画素から、該算出しようとする色成分の画素を参照して前記エッジの方向性に対応する色信号を算出する請求項22、23および32〜35のいずれかに記載の画像処理方法。   In the directional color signal calculation step, when there is no pixel of the color component to be calculated with respect to the detection direction detected by the directional detection unit, a plurality of pixels of interest other than the detected direction are detected. 36. The image processing method according to claim 22, wherein a color signal corresponding to the directionality of the edge is calculated from neighboring pixels with reference to a pixel of the color component to be calculated. 前記方向性色信号算出ステップは、前記検出された方向以外の注目画素の複数の近傍画素において前記算出しようとする色成分の平均値を用いる請求項35に記載の画像処理方法。   36. The image processing method according to claim 35, wherein the directional color signal calculation step uses an average value of the color components to be calculated in a plurality of neighboring pixels of the target pixel other than the detected direction. 前記注目画素色信号算出ステップは、前記方向性検出ステップで「方向性あり」と検出した画素に対して、前記方向性検出ステップで算出された色信号を注目画素における色信号として算出する請求項28または29に記載の画像処理方法。   The pixel-of-interest color signal calculation step calculates a color signal calculated in the directionality detection step as a color signal in the pixel-of-interest for a pixel detected as “directional” in the directionality detection step. 30. The image processing method according to 28 or 29. 前記注目画素色信号算出ステップは、前記方向性検出ステップで「方向性なし」と検出した画素に対して、バイリニア法を用いて注目画素における色信号を算出する請求項28または30に記載の画像処理方法。   31. The image according to claim 28 or 30, wherein the pixel-of-interest color signal calculation step calculates a color signal of the pixel of interest using a bilinear method for a pixel detected as “no directionality” in the directionality detection step. Processing method. 前記注目画素色信号算出ステップは、前記方向性検出ステップで検出された複数の方向性に対応する各色信号の平均色を注目画素における色信号として算出する平均色算出ステップを有する請求項22または23に記載の画像処理方法。   24. The target pixel color signal calculation step includes an average color calculation step of calculating an average color of each color signal corresponding to a plurality of directions detected in the direction detection step as a color signal in the target pixel. An image processing method described in 1. 前記注目画素色信号算出ステップは、前記方向性検出ステップで検出された複数の方向性に対応する各色信号の平均色を算出する平均色算出ステップと、該平均色算出ステップで算出した平均色と注目画素の色との相関性を利用して注目画素における色信号を算出する多重色相関色信号算出ステップとを有する請求項22または23に記載の画像処理方法。   The pixel-of-interest color signal calculation step includes an average color calculation step for calculating an average color of each color signal corresponding to a plurality of directions detected in the directionality detection step, and an average color calculated in the average color calculation step. 24. The image processing method according to claim 22 or 23, further comprising a multiple color correlated color signal calculation step of calculating a color signal at the target pixel using a correlation with the color of the target pixel. 請求項22〜40のいずれかに記載の画像処理方法の各処理ステップをコンピュータに実行させるための画像処理プログラム。   The image processing program for making a computer perform each process step of the image processing method in any one of Claims 22-40. 請求項41に記載の画像処理プログラムが格納されたコンピュータ読み取り可能な可読記録媒体。   42. A computer-readable readable recording medium in which the image processing program according to claim 41 is stored.
JP2008029767A 2008-02-08 2008-02-08 Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium Expired - Fee Related JP4703666B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008029767A JP4703666B2 (en) 2008-02-08 2008-02-08 Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008029767A JP4703666B2 (en) 2008-02-08 2008-02-08 Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2004244357A Division JP4333997B2 (en) 2004-08-24 2004-08-24 Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium

Publications (3)

Publication Number Publication Date
JP2008125132A JP2008125132A (en) 2008-05-29
JP2008125132A5 JP2008125132A5 (en) 2009-04-30
JP4703666B2 true JP4703666B2 (en) 2011-06-15

Family

ID=39509350

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008029767A Expired - Fee Related JP4703666B2 (en) 2008-02-08 2008-02-08 Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium

Country Status (1)

Country Link
JP (1) JP4703666B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003111092A (en) * 2001-09-27 2003-04-11 Mega Chips Corp Data conversion circuit
JP2003134523A (en) * 2001-10-25 2003-05-09 Mitsubishi Electric Corp Image pickup apparatus and method
JP2004180059A (en) * 2002-11-28 2004-06-24 Mega Chips Corp Pixel interpolation device, pixel interpolation method, and digital camera

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003111092A (en) * 2001-09-27 2003-04-11 Mega Chips Corp Data conversion circuit
JP2003134523A (en) * 2001-10-25 2003-05-09 Mitsubishi Electric Corp Image pickup apparatus and method
JP2004180059A (en) * 2002-11-28 2004-06-24 Mega Chips Corp Pixel interpolation device, pixel interpolation method, and digital camera

Also Published As

Publication number Publication date
JP2008125132A (en) 2008-05-29

Similar Documents

Publication Publication Date Title
JP4333997B2 (en) Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium
JP5574615B2 (en) Image processing apparatus, control method thereof, and program
US8958009B2 (en) Image-capturing device
JP5672776B2 (en) Image processing apparatus, image processing method, and program
WO2013031367A1 (en) Image processing device, image processing method, and program
US8588521B2 (en) Image processing apparatus and control method therefor
JP6282123B2 (en) Image processing apparatus, image processing method, and program
CN101115209A (en) Method and apparatus for color interpolation in digital photographing device
US7489822B2 (en) Image processing apparatus and method for detecting a direction of an edge in the vicinity of a pixel of interest and generating all color signals for each pixel by interpolation using color signals of a pixel of interest and its neighbor pixels, and a recording medium having a program recorded thereon for causing the apparatus to perform the method
JP4617870B2 (en) Imaging apparatus and method, and program
JP6415093B2 (en) Image processing apparatus, image processing method, and program
US8817137B2 (en) Image processing device, storage medium storing image processing program, and electronic camera
JP3905708B2 (en) Image interpolation device
JP5631769B2 (en) Image processing device
JP4718113B2 (en) White balance adjustment method and image processing apparatus
JP4703666B2 (en) Image processing apparatus, photographing apparatus, image processing method, image processing program, and recording medium
JP6459183B2 (en) Imaging device
JP2006135564A (en) Device and method for pixel interpolation
JP4708180B2 (en) Image processing device
JP4334150B2 (en) Image interpolation device
JP2016019245A (en) Image processing system and image processing method
JP4688044B2 (en) White balance adjustment method and image processing apparatus
JP5008122B2 (en) Defective pixel correction method and defective pixel correction device for solid-state image sensor
JP4334152B2 (en) Image interpolation device
JP4334151B2 (en) Image interpolation device

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090313

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100803

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100917

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110308

R150 Certificate of patent or registration of utility model

Ref document number: 4703666

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: R3D04

LAPS Cancellation because of no payment of annual fees