JP4334151B2 - Image interpolation device - Google Patents

Image interpolation device Download PDF

Info

Publication number
JP4334151B2
JP4334151B2 JP2001010084A JP2001010084A JP4334151B2 JP 4334151 B2 JP4334151 B2 JP 4334151B2 JP 2001010084 A JP2001010084 A JP 2001010084A JP 2001010084 A JP2001010084 A JP 2001010084A JP 4334151 B2 JP4334151 B2 JP 4334151B2
Authority
JP
Japan
Prior art keywords
signal
pixel
interpolation
image
pattern
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
JP2001010084A
Other languages
Japanese (ja)
Other versions
JP2002218484A (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.)
Hoya Corp
Original Assignee
Hoya 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 Hoya Corp filed Critical Hoya Corp
Priority to JP2001010084A priority Critical patent/JP4334151B2/en
Priority to US10/043,318 priority patent/US7106341B2/en
Publication of JP2002218484A publication Critical patent/JP2002218484A/en
Application granted granted Critical
Publication of JP4334151B2 publication Critical patent/JP4334151B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、例えばデジタルカメラにおいて、カラー画像の画質を向上させるために設けられる画像補間装置に関する。
【0002】
【従来の技術】
従来デジタルカメラにおいて、カラー画像を検出するために、CCD等の撮像素子の前面にベイヤー配列のカラーフィルタを設けたものが知られている。このカラーフィルタは、レッド(R)、グリーン(G)およびブルー(B)の各カラーフィルタ要素を市松模様に配列して構成され、これらのカラーフィルタ要素は撮像素子のフォトダイオードにそれぞれ対応している。したがってフォトダイオードにより、各カラーフィルタ要素に対応した色の画素信号が生成され、例えばRのカラーフィルタ要素に対応したフォトダイオードによりRの画素信号が生成される。
【0003】
撮像素子から出力された画素信号をそのまま用いるよりも高画質のカラー画像を表示するため、画素信号に対して補間処理を施すことがある。通常の補間処理では、フォトダイオードによってR信号が得られた画素に対しては、その周囲に位置する画素のG信号の相加平均をとることによってG信号が生成され、また、その周囲に位置する画素のB信号の相加平均をとることによってB信号が生成される。ところが、例えば空間周波数の高い画像において、補間処理によって求めようとしている画素の実際の色とその周囲の画素の実際の色とが大きく異なることがあり、このような場合、補間処理により得られた画素の色信号の値によって、再生画像に色にじみが生じる。
【0004】
【発明が解決しようとする課題】
したがって本発明は、補間処理によって再生画像に色にじみが生じることを減少させることを目的としている。
【0005】
【課題を解決するための手段】
本発明に係る画像補間装置は、カラーフィルタと撮像素子とパターン設定手段とG補間処理手段とR/B補間処理手段と第1の補間/修正処理手段と第2の補間/修正処理手段とを備える。
カラーフィルタは、水平方向にレッド(R)とグリーン(G)のカラーフィルタ要素が交互に並ぶ第1の列と、この第1の列の上下側に隣接し、水平方向にGとブルー(B)のカラーフィルタ要素が交互に並ぶ第2の列とから構成される。撮像素子は、各カラーフィルタ要素に対応した画素信号であるR,G,B信号を生成する。パターン設定手段は、撮像素子によって生成されたR,G,B信号から、2×2の画素マトリクスにおいて左上にR信号が位置する第1パターンと、右上にG信号が位置する第2パターンと、左下にG信号が位置する第3パターンと、右下にB信号が位置する第4パターンとにそれぞれ属する画像を抽出する。G補間処理手段は、第1および第4パターンに属する画像の各画素に関し、隣接する画素のG信号を利用してG信号を求める。R/B補間処理手段は、第2および第3パターンに属する画像の各画素に関し、隣接する画素のRおよびB信号を利用してRおよびB信号を求める。第1の補間/修正処理手段は、第1パターンに属する画像の各画素に関し、隣接する画素の中から輝度値が最も近い類似画素を抽出し、類似画素との間における輝度値の変化率に対応した第1の補正値と類似画素のB,G,R信号とに基づいて、B信号を求めるとともに、G補間処理手段により求められたG信号と撮像素子により生成されたR信号とを修正する。第2の補間/修正処理手段は、第4パターンに属する画像の各画素に関し、隣接する画素の中から輝度値が最も近い類似画素を抽出し、類似画素との間における輝度値の変化率に対応した第2の補正値と類似画素のR,G,B信号とに基づいて、R信号を求めるとともに、G補間処理手段により求められたG信号と撮像素子により生成されたB信号とを修正する。
【0006】
G補間処理手段において、隣接する画素は第2および第3パターンに属する画像に含まれる。R/B補間処理手段において、隣接する画素は第1および第4パターンに属する画像に含まれる。第1の補間/修正処理手段および第2の補間/修正処理手段において、隣接する画素は第2および第3パターンに属する画像に含まれる。
【0007】
第1の補間/修正処理手段および第2の補間/修正処理手段は、好ましくは、隣接する画素におけるG信号の値を用いて、輝度値が最も近い類似画素を抽出する。類似画素の色合いが補間処理によって求めようとしている画素の色合いに近いと推定することにより、色にじみが減少する。
【0008】
第1の補間/修正処理手段は、第1パターンに属する画像の各画素に関し、類似画素のB,G,R信号にそれぞれ第1の補正値を加えることにより、B信号を求めるとともにG信号とR信号を修正する。
【0009】
第1の補正値は例えば、第1パターンに属する画像の各画素に関し、類似画素との間におけるG信号の変化率に類似画素の輝度値を乗じて求められる。
【0010】
第1の補間/修正処理手段は、例えば下記式に従ってB信号を求めるとともにG信号とR信号を修正する。
Y=0.299×R(x',y')+0.587×G(x',y')+0.114×B(x',y')
YG=Y×(G(x,y)-G(x',Y'))/G(x',y')
r’=YG+R(x',y')
g’=YG+G(x',y')
b=YG+B(x',y')
ただし、Yは類似画素の輝度値、YGは第1の補正値、R(x',y'), G(x',y'),B(x',y')は類似画素のR,G,B信号、G(x,y)は第1パターンに属する画像の画素のG信号、bは第1の補間/修正処理手段により求められた第1パターンに属する画素のB信号、r’は修正されたR信号、g’は修正されたG信号である。
【0011】
第2の補間/修正処理手段は、第4パターンに属する画像の各画素に関し、類似画素のR,G,B信号にそれぞれ第2の補正値を加えることにより、R信号を求めるとともにG信号とB信号を修正する。
【0012】
第2の補正値は例えば、第4パターンに属する画像の各画素に関し、類似画素との間におけるG信号の変化率に類似画素の輝度値を乗じて求められる。
【0013】
第2の補間/修正処理手段は、例えば下記式に従ってR信号を求めるとともにG信号とB信号を修正する。
Y=0.299×R(x',y')+0.587×G(x',y')+0.114×B(x',y')
YG=Y×(G(x,y)-G(x',y'))/G(x',y')
r=YG+R(x',y')
g’=YG+G(x',y')
b’=YG+B(x',y')
ただし、Yは類似画素の輝度値、YGは第2の補正値、R(x',y'), G(x',y'),B(x',y')は類似画素のR,G,B信号、G(x,y)は第4パターンに属する画像の画素のG信号、rは第2の補間/修正処理手段により求められた第4パターンに属する画像の画素のR信号、g’は修正されたG信号、b’は修正されたB信号である。
【0014】
第1の補間/修正処理手段は、隣接する画素におけるG信号およびR信号の値を用いて、類似画素を抽出する。また、第2の補間/修正処理手段は、隣接する画素におけるG信号および信号の値を用いて、類似画素を抽出する。
【0015】
第1の補正値は、第1パターンに属する画像の各画素に関し、その画素と類似画素におけるG信号およびR信号に基づいて得られる第1の参照値と類似画素のG信号およびR信号に基づいて得られる第2の参照値との比率を輝度値に乗じて求められる。
【0016】
第1の補間/修正処理手段は、下記式に従ってB信号を求めるとともにG信号とR信号を修正してもよい。
Y=0.299×R(x',y')+0.587×G(x',y')+0.114×B(x',y')
YG=Y×(0.587×(G(x,y)-G(x',y')+0.299×(R(x,y)-R(x',y'))
/(0.587×G(x',y')+0.299×R(x',y'))
r’=YG+R(x',y)
g’=YG+G(x',y')
b=YG+B(x',y')
ただし、Yは類似画素の輝度値、YGは第1の補正値、R(x',y'), G(x',y'),B(x',y')は類似画素のR,G,B信号、G(x,y)は第1パターンに属する画像の画素のG信号、bは第1の補間/修正処理手段により求められた第1パターンに属する画像の画素のB信号、r’は修正されたR信号、g’は修正されたG信号である。
【0017】
第2の補間/修正処理手段は、第4パターンに属する画像の各画素に関し、その画素と類似画素におけるG信号およびB信号に基づいて得られる第1の参照値と類似画素のG信号およびB信号に基づいて得られる第2の参照値との比率を輝度値に乗じて求められる。
【0018】
第2の補間/修正処理手段は、下記式に従ってR信号を求めるとともにG信号とB信号を修正してもよい。
Y=0.299×R(x',y')+0.587×G(x',y')+0.114×B(x',y')
YG=Y×(0.587×(G(x,y)-G(x',y'))+0.114×(B(x,y)-B(x',y'))
/(0.587×G(x',y')+0.114×B(x',y'))
r=YG+R(x',y')
g’=YG+G(x',y')
b’=YG+B(x',y')
ただし、Yは類似画素の輝度値、YGは第2の補正値、R(x',y'), G(x',y'),B(x',y')は類似画素のR,G,B信号、G(x,y)は第4パターンに属する画像の画素のG信号、rは第2の補間/修正処理手段により求められた第4パターンに属する画像の画素のR信号、g’は修正されたG信号、b’は修正されたB信号である。
【0019】
【発明の実施の形態】
以下、本発明の実施形態を図面を参照して説明する。図1は、本発明の第1実施形態である画像補間装置を備えたデジタルカメラ10の概略的な構成を示している。
【0020】
撮影レンズ11の後方には撮像素子であるCCD12が配設され、CCD12の受光面にはカラーフィルタ13が設けられている。すなわち撮影レンズ11によって得られた被写体Sの光学像がCCD12の受光面に結像され、CCD12のフォトダイオードには、被写体像を構成するカラーの画素信号が発生する。画素信号はCCD12から読み出され、A/D変換器14においてデジタル信号に変換される。そして画素信号はホワイトバランス調整回路15においてホワイトバランス調整を施され、画像メモリ16に格納される。
【0021】
画素信号は画像メモリ16から読み出され、パターン設定部17に入力される。パターン設定部17では、後述するように、所定の配列パターンを構成する画素信号が全画素信号の中から抽出され、第1、第2、第3および第4パターンに分類される。補間処理部18では、パターン設定部17において抽出された画素信号がそのパターンに応じた補間処理を施される。補間処理部18から出力された、補間後の画素信号はメモリカード等の記録媒体Dに記録される。なおホワイトバランス調整回路15は、A/D変換器14の後段ではなく、補間処理部18の後段に設けられてもよい。
【0022】
図2はカラーフィルタ13におけるカラーフィルタ要素の配列と、パターン設定部17において抽出される、各パターンに属する画像の画素信号とを示している。カラーフィルタ13は、ベイヤー配列に従って配置されたレッド(R)、グリーン(G)およびブルー(B)のカラーフィルタ要素から構成される。すなわちカラーフィルタ13は、水平方向にRとGのカラーフィルタ要素が交互に並ぶ第1の列13aと、この第1の列13aの上下側に隣接し、水平方向にGとBのカラーフィルタ要素が交互に並ぶ第2の列13bとから構成され、CCD12では、各カラーフィルタ要素に対応した画素信号であるR,G,B信号が生成される。
【0023】
カラーフィルタ13は、左上にR、右上と左下にG、右下にBのカラーフィルタ要素が配置された2×2の画素マトリクスM1に区画される。パターン設定部17では、CCD12によって生成されるR,G,B信号から、画素マトリクスM1において左上にR信号が位置する第1パターンと、右上にG信号が位置する第2パターンと、左下にG信号が位置する第3パターンと、右下にB信号が位置する第4パターンとにそれぞれ属する画像が抽出される。
【0024】
パターン設定部17において、第1パターンは、C言語で表わされた論理式(1)に従って、1つの画像を構成する全ての画素信号から抽出される。
!(x%2) && !(y%2) (1)
なお論理式(1)において、「x」と「y」は画像の左隅を原点とする横座標と縦座標をそれぞれ示す。すなわち、左隅のR信号の座標は(0,0)その右隣のG信号の座標は(1,0)である。また論理式(1)において、「!」は論理否定、「%」は剰余、「&&」は論理積を示す。したがって論理式(1)によれば、x座標とy座標がともに偶数である画素信号(すなわちR信号)から成る画像が抽出される。
【0025】
同様に、第2パターン、第3パターンおよび第4パターンは、論理式(2)、(3)および(4)に従って抽出される。
(x%2) && !(y%2) (2)
!(x%2) && (y%2) (3)
(x%2) && (y%2) (4)
【0026】
図3〜図9を参照して補間処理部18における処理を説明する。図3は、画像メモリ16に格納された、1つの画像を構成する画素の座標と色を示している。補間処理部18では、後述するように、G補間処理ルーチン(図4)と、R/B補間処理ルーチン(図5)と、第1の補間/修正処理ルーチンと(図7、8)、第2の補間/修正処理ルーチン(図9)とが実行される。これらの処理ルーチンにおいて、補間等によって画素データを求めようとしている対象画素の座標は(x,y)である。
【0027】
図4はG補間処理ルーチンのフローチャートである。G補間処理ルーチンでは、第1および第4パターンに属する画像に関する補間処理が行われる。
【0028】
ステップ101では、対象画素の左側に隣接する画素のG信号であるG(x-1,y)と右側に隣接する画素のG信号であるG(x+1,y)との差の絶対値が、対象画素の上側に隣接する画素のG信号であるG(x,y-1)と下側に隣接する画素のG信号であるG(x,y+1)との差の絶対値よりも小さいか否かが判定される。対象画素の座標が(2,2)である場合(すなわち第1パターンの画像)を例にとって説明すると、対象画素はR(2,2)であり、ステップ101では|G(1,2)-G(3,2)|が|G(2,1)-G(2,3)|よりも小さいか否かが判定される。
【0029】
なお対象画素が第1パターンに属する画像に含まれるとき、すなわちR信号であるとき、その左右に隣接する画素は第2パターンに属する画像に含まれ、またその上下に隣接する画素は第3パターンに含まれる。一方、対象画素が第4パターンに属する画像に含まれるとき、すなわちB信号であるとき、その左右に隣接する画素は第3パターンに属する画像に含まれ、またその上下に隣接する画素は第2パターンに含まれる。
【0030】
ステップ101において、対象画素の左右に隣接する画素信号の差の絶対値の方が上下に隣接する画素信号の差の絶対値よりも小さいと判定されたとき、ステップ102が実行され、左右に隣接する画素信号であるG(x-1,y)とG(x+1,y)の相加平均が、対象画素のG信号gとして求められる。これに対して、対象画素の左右に隣接する画素信号の差の絶対値が上下に隣接する画素信号の差の絶対値よりも小さくないと判定されたとき、ステップ103において、上下に隣接する画素信号であるG(x,y-1)とG(x,y+1)の相加平均が、対象画素のG信号gとして求められる。ステップ102または103の実行により、G補間処理ルーチンは終了する。
【0031】
このようにG補間処理ルーチンでは、第1および第4パターンに属する画像の各画素に関し、左右および上下に隣接する4つのG信号において、差の小さい方の組の2つのG信号の平均値が対象画素のG信号として求められる。第1および第4パターンに属する画像の全ての画素に対してG補間処理ルーチンが実行されると、1つの画像を構成する全画素におけるG信号が求められたことになる。
【0032】
図5はR/B補間処理ルーチンのフローチャートである。R/B補間処理ルーチンでは、第2および第3パターンに属する画像に関する補間処理が行われる。
【0033】
ステップ201では対象画素が第2パターンに属する画像に含まれるか否かが判定される。対象画素が第2パターンに属する画像に含まれるとき、すなわち対象画素が画素マトリクスM1(図2)の右上のG信号であるとき、ステップ202が実行される。これに対して対象画素が第2パターンに含まれないとき、すなわち第3パターンに含まれ、画素マトリクスM1(図2)の左下のG信号であるとき、ステップ203が実行される。
【0034】
ステップ202では、対象画素の左右に隣接する画素信号(第1パターンの画像)であるR(x-1,y)とR(x+1,y)の相加平均が対象画素のR信号rとして求められる。また対象画素の上下に隣接する画素信号(第4パターンの画像)であるB(x,y-1)とB(x,y+1)の相加平均が対象画素のB信号bとして求められる。
【0035】
ステップ203では、対象画素の上下に隣接する画素信号(第1パターンの画像)であるR(x,y-1)とR(x,y+1)の相加平均が対象画素のR信号rとして求められる。また対象画素の左右に隣接する画素信号(第4パターンの画像)であるB(x-1,y)とB(x+1,y)の相加平均が対象画素のB信号bとして求められる。
【0036】
ステップ202または203の実行によりR/B補間処理ルーチンは終了する。このようにR/B補間処理ルーチンでは、第2および第3パターンに属する画像の各画素に関し、左右および上下に隣接する画素信号を補間することにより、対象画素のRおよびB信号が求められる。G補間処理ルーチン(図4)が完了し、かつ第2および第3パターンに属する画像の全ての画素に対してR/B補間処理ルーチンが実行されると、図6から理解されるように、1つの画像を構成する全画素におけるG信号が求められ、また第2および第3パターンに属する画像の各画素に関してR信号rとB信号bが求められたことになる。すなわち第1パターンに属する画像に関しては、B信号がまだ求められておらず、また第4パターンに属する画像に関しては、R信号がまだ求められていない。
【0037】
図7および図8は、第1パターンに属する画像の各画素に関してB信号を求めるとともに、G補間処理ルーチン(図4)により求められたG信号とCCD12により生成されたR信号とを修正する第1の補間/修正処理ルーチンのフローチャートである。
【0038】
ステップ301では、対象画素の左側に隣接する画素のG信号であるG(x-1,y)と対象画素のG信号であるG(x,y)との差の絶対値が、対象画素の右側に隣接する画素のG信号であるG(x+1,y)と対象画素のG信号であるG(x,y)との差の絶対値よりも小さいか否かが判定される。換言すれば、対象画素の左右に隣接するいずれの画素のG信号が対象画素のG信号に近い値を有するか否かが判定される。左側の画素のG信号が対象画素のG信号により近いとき、ステップ302において、パラメータpが−1に定められる。これに対し、右側の画素のG信号が対象画素のG信号により近い、あるいは等しいとき、ステップ303において、パラメータpが1に定められる。
【0039】
ステップ304では、対象画素の上側に隣接する画素のG信号であるG(x,y-1)と対象画素のG信号であるG(x,y)との差の絶対値が、対象画素の下側に隣接する画素のG信号であるG(x,y+1)と対象画素のG信号であるG(x,y)との差の絶対値よりも小さいか否かが判定される。すなわち対象画素の上下に隣接するいずれの画素のG信号が対象画素のG信号に近い値を有するか否かが判定される。上側のG信号が対象画素のG信号により近いとき、ステップ305において、パラメータqが−1に定められる。これに対し、下側のG信号が対象画素のG信号により近い、あるいは等しいとき、ステップ306において、パラメータqが1に定められる。
【0040】
ステップ307では、対象画素の左右のいずれかに隣接する画素と、上下のいずれかに隣接する画素と、対象画素とに関し、G信号の大きさが比較される。対象画素の左側の画素のG信号が右側の画素のG信号よりも対象画素のG信号に近く、かつ対象画素の上側の画素のG信号が下側の画素のG信号よりも対象画素のG信号に近いとき、パラメータp,qはともに−1であり、G(x-1,y)とG(x,y)との差の絶対値が、G(x,y-1)とG(x,y)との差の絶対値よりも小さいか否かが判定される。左側のG信号が対象画素のG信号により近いとき、ステップ308において、パラメータsがpすなわち−1に定められる。これに対し、上側のG信号が対象画素のG信号により近い、あるいは等しいとき、ステップ309においてパラメータsが2×qすなわち−2に定められる。
【0041】
パラメータp,qがともに1であるとき、パラメータp,qがそれぞれ−1,1であるとき、パラメータp,qがそれぞれ1,−1であるときも同様にしてステップ307、308または309が実行される。このようにして第1の補間/修正処理ルーチンでは、対象画素のG信号に関し、第2および第3パターンに属する画像に含まれる、隣接する画素のG信号の値が検討され、左側に隣接する画素のG信号が最も近ければパラメータsは−1に、右側に隣接する画素のG信号が最も近ければパラメータsは1に、上側に隣接する画素のG信号が最も近ければパラメータsは−2に、下側に隣接する画素のG信号が最も近ければパラメータsは2に、それぞれ定められる。
【0042】
この明細書では、4つの隣接する画素において、対象画素のG信号に最も近いG信号を有する画素を類似画素と呼ぶ。類似画素は、輝度値が対象画素の輝度値に最も近いものが好ましいが、対象画素の輝度値が未知であるため、G信号を用いて輝度値を判定し、類似画素を抽出している。
【0043】
ステップ310ではパラメータsが−1であるか否か、すなわち類似画素が対象画素の左側に隣接する画素であるか否かが判定される。パラメータsが−1であるとき、ステップ311が実行され、類似画素のR,G,B信号であるR(x-1,y),G(x-1,y),B(x-1,y)を用いて輝度値Yが求められ、また類似画素のG信号であるG(x-1,y)と対象画素のG信号であるG(x,y)と輝度値Yとを用いて補正値YGが求められる。
【0044】
輝度値Yおよび補正値YGはそれぞれ(5)式および(6)式に従って演算される。
Y=0.299×R(x-1,y)+0.587×G(x-1,y)+0.114×B(x-1,y) (5)
YG=Y×(G(x,y)-G(x-1,y))/G(x-1,y) (6)
【0045】
(5)式は従来公知である。補正値YGは、(6)式から理解されるように、対象画素と類似画素との間におけるG信号の変化率に類似画素の輝度値Yを乗じて求められる。
【0046】
ステップ312では、対象画素のG信号とR信号が(7)式と(8)式に従って演算され、修正されたG信号g’と修正されたR信号r’が求められる。また対象画素のB信号が(9)式に従って演算され、補間されたB信号bが求められる。これにより、第1の補間/修正処理ルーチンは終了する。
r’=YG+R(x',y') (7)
g’=YG+G(x',y') (8)
b=YG+B(x',y') (9)
【0047】
なおR(x',y'),G(x',y'),B(x',y')は、ステップ311の後ステップ312が実行されるときはR(x-1,y),G(x-1,y),B(x-1,y)であり、ステップ314の後ステップ312が実行されるときはR(x+1,y),G(x+1,y),B(x+1,y)であり、ステップ316の後ステップ312が実行されるときはR(x,y-1),G(x,y-1),B(x,y-1)であり、ステップ317の後ステップ312が実行されるときはR(x,y+1),G(x,y+1),B(x,y+1) である。
【0048】
ステップ310においてパラメータsが−1ではないと判定されたとき、ステップ313へ進み、パラメータsが1であるか否かが判定され、類似画素が対象画素の右側に隣接する画素であるか否かが判定される。パラメータsが1であるとき、ステップ314が実行され、類似画素のR,G,B信号を用いて輝度値Yおよび補正値YGが求められる。
【0049】
輝度値Yおよび補正値YGはそれぞれ(5a)式および(6a)式に従って演算される。
Y=0.299×R(x+1,y)+0.587×G(x+1,y)+0.114×B(x+1,y) (5a)
YG=Y×(G(x,y)-G(x+1,y))/G(x+1,y) (6a)
【0050】
次いでステップ312が実行される。すなわち、対象画素のG信号とR信号が(7)式と(8)式に従って演算され、修正されたG信号g’と修正されたR信号r’が求められる。また対象画素のB信号が(9)式に従って演算され、補間されたB信号bが求められる。これにより第1の補間/修正処理ルーチンは終了する。
【0051】
ステップ313においてパラメータsが1ではないと判定されたとき、ステップ315へ進み、パラメータsが−2であるか否かが判定され、類似画素が対象画素の上側に隣接する画素であるか否かが判定される。パラメータsが−2であるとき、ステップ316が実行され、類似画素のR,G,B信号を用いて輝度値Yおよび補正値YGが求められる。
【0052】
輝度値Yおよび補正値YGはそれぞれ(5b)式および(6b)式に従って演算される。
Y=0.299×R(x,y-1)+0.587×G(x,y-1)+0.114×B(x,y-1) (5b)
YG=Y×(G(x,y)-G(x,y-1))/G(x,y-1) (6b)
【0053】
次いで、ステップ311、314の場合と同様に、ステップ312が実行され、対象画素のG信号とR信号が(7)式と(8)式に従って修正され、また対象画素のB信号が(9)式に従って演算され、第1の補間/修正処理ルーチンは終了する。
【0054】
ステップ315においてパラメータsが−2ではないと判定されたとき、パラメータsは2である、すなわち類似画素が対象画素の下側に隣接する画素であると見做され、ステップ317において、類似画素のR,G,B信号を用いて輝度値Yおよび補正値YGが求められる。
【0055】
輝度値Yおよび補正値YGはそれぞれ(5c)式および(6c)式に従って演算される。
Y=0.299×R(x,y+1)+0.587×G(x,y+1)+0.114×B(x,y+1) (5c)
YG=Y×(G(x,y)-G(x,y+1))/G(x,y+1) (6c)
【0056】
次いで、ステップ311、314、316の場合と同様に、ステップ312が実行され、対象画素のG信号とR信号が(7)式と(8)式に従って修正され、また対象画素のB信号が(9)式に従って演算され、第1の補間/修正処理ルーチンは終了する。
【0057】
このように第1の補間/修正処理ルーチンでは、類似画素のR,G,B信号に補正値YGを加えることによって、対象画素のB信号を求めるとともに、それまでに求められているG信号とR信号を修正している。
【0058】
第1の補間/修正処理ルーチンは、第1パターンに属する画像の全ての画素に関して実行される。G補間処理ルーチン(図4)、R/B補間処理ルーチン(図5)および第1の補間/修正処理ルーチン(図7及び図8)が完了した時点において、第1、第2および第3パターンに属する画像に関して、R,G,B信号が求められており、第4パターンに属する画像におけるR信号はまだ決定されていない。
【0059】
第4パターンの画像のR信号は、第2の補間/修正処理ルーチンにより求められる。また第2の補間/修正処理ルーチンでは、G補間処理ルーチン(図4)により求められたG信号とCCD12により生成されたB信号とが修正される。図9は第2の補間/修正処理ルーチンのフローチャートの後半部分を示している。なお第2の補間/修正処理ルーチンの前半部分は図7に示す第1の補間/修正処理ルーチンと同じであるので、図示を省略する。
【0060】
ステップ410、413、415の処理内容はステップ310、313、315(図8)と同じである。ステップ411、414、416、417の処理内容はステップ311、314、316、317と同じである。
【0061】
ステップ412では、対象画素のR信号が(10)式に従って演算され、補間されたR信号rが求められる。対象画素のG信号とB信号が(11)式と(12)式に従って演算され、修正されたG信号g’と修正されたB信号b’が求められる。
r=YG+R(x',y') (10)
g’=YG+G(x',y') (11)
b’=YG+B(x',y') (12)
【0062】
第2の補間/修正処理ルーチンは、第4パターンに属する画像の全ての画素に関して実行される。
【0063】
このように第2の補間/修正処理ルーチンでは、第1の補間/修正処理ルーチンと同様に、類似画素のR,G,B信号に補正値YGを加えることによって、対象画素のR信号を求めるとともに、それまでに求められているG信号とB信号を修正している。
【0064】
以上のように本実施形態では、特に第1の補間/修正処理ルーチン(図7および図8)と第2の補間/修正処理ルーチン(図9)において、対象画素に関して、その左右および上下に位置する画素から輝度値が最も近いものを類似画素として抽出し、補間処理を行っている。この補間処理において、2つの画素における輝度値が近いほど色の相関が強いため、対象画素の色差信号を類似画素の色差信号とすることにより、実際の色により近い画素信号を得ることができる。したがって本実施形態によれば、再生画像における色にじみを減少させることができる。
【0065】
さらに本実施形態では、G補間処理ルーチンにより求められたG信号と、CCD12により生成されたR信号とB信号が(7)、(8)、(11)および(12)式に従って修正されるので、対象画素の色合いが周囲に位置する画素の色合いに近くなり、画像全体として色にじみがより減少する。
【0066】
図10および図11を参照して第2実施形態を説明する。図10は、第1の補間/修正処理ルーチンの前半部分を示し、図11は、第2の補間/修正処理ルーチンの前半部分を示している。その他の構成は第1実施形態と同じであるので省略する。
【0067】
ステップ501では、対象画素の左側および右側に隣接する画素と対象画素における輝度値の比較として、不等式(13)が成立するか否かが判定される。
|0.587×(G(x-1,y)-G(x,y))+0.299×(R(x-1,y)-R(x,y))|<
|0.587×(G(x+1,y)-G(x,y))+0.299×(R(x+1,y)-R(x,y))| (13)
不等式(13)が真であるとき、すなわち左側の画素の輝度値が対象画素の輝度値の値により近いとき、ステップ502において、パラメータpが−1に定められる。これに対し、不等式(13)が偽であるとき、すなわち右側の画素の輝度値が対象画素の輝度値により近い、あるいは等しいとき、ステップ503において、パラメータpが1に定められる。
【0068】
ステップ504では、対象画素の上側および下側に隣接する画素と対象画素における輝度値の比較として、不等式(14)が成立するか否かが判定される。
|0.587×(G(x,y-1)-G(x,y))+0.299×(R(x,y-1)-R(x,y))|<
|0.587×(G(x,y+1)-G(x,y))+0.299×(R(x,y+1)-R(x,y))| (14)
不等式(14)が真であるとき、すなわち上側の画素の輝度値が対象画素の輝度値の値により近いとき、ステップ505において、パラメータqが−1に定められる。これに対し、不等式(14)が偽であるとき、すなわち下側の画素の輝度値が対象画素の輝度値により近い、あるいは等しいとき、ステップ506において、パラメータqが1に定められる。
【0069】
ステップ507では、対象画素の左右のいずれかに隣接する画素と、上下のいずれかに隣接する画素と、対象画素とに関し、不等式(15)に従って輝度値が比較される。
|0.587×(G(x+p,y)-G(x,y))+0.299×(R(x+p,y)-R(x,y))|<
|0.587×(G(x,y+q)-G(x,y))+0.299×(R(x,y+q)-R(x,y))| (15)
パラメータp,qがともに−1であり、かつ不等式(15)が真であるとき、左側の画素の輝度値が対象画素の輝度値に最も近く、この場合ステップ508においてパラメータsがpすなわち−1に定められる。これに対し、不等式(15)が偽であるとき、すなわち上側の画素の輝度値が対象画素の輝度値により近い、あるいは等しいとき、ステップ509においてパラメータsが2×qすなわち−2に定められる。
【0070】
パラメータp,qがともに1であるとき、パラメータp,qがそれぞれ−1,1であるとき、パラメータp,qがそれぞれ1,−1であるときも同様にしてステップ507、508または509が実行される。このようにして第1の補間/修正処理ルーチンでは、対象画素のG信号およびR信号と、第2および第3パターンに属する画像に含まれる、隣接する画素のG信号およびR信号とを用いて輝度値が検討され、左側に隣接する画素の輝度値が最も近ければパラメータsは−1に、右側に隣接する画素の輝度値が最も近ければパラメータsは1に、上側に隣接する画素の輝度値が最も近ければパラメータsは−2に、下側に隣接する画素の輝度値が最も近ければパラメータsは2に、それぞれ定められる。
【0071】
このようにして、対象画素の輝度値に最も近い輝度値を有する類似画素が抽出された後、図8に示されるフローチャートと同様な処理によって、類似画素のR,G,B信号を用いて輝度値Yおよび補正値YGが求められ、対象画素のB信号が補間により求められるとともに、G信号とR信号が修正される。なお補正値YGは、対象画素と類似画素のG信号とR信号を用いて、(16)式に従って求められる。その他の式については、第1実施形態と同じである。
YG=Y×(0.587×(G(x,y)-G(x',y'))+0.299×(R(x,y)-R(x',y')))
/(0.587×G(x',y')+0.299×R(x',y')) (16)
ただし、G(x',y')は類似画素のG信号、R(x',y')は類似画素のR信号を示す。
【0072】
第2の補間/修正処理ルーチン(図11)では、第4パターンの画像のR信号が補間により求められるとともに、G信号とB信号が修正される。ステップ601では、対象画素の左側および右側に隣接する画素と対象画素における輝度値の比較として、不等式(17)が成立するか否かが判定される。
|0.587×(G(x-1,y)-G(x,y))+0.144×(B(x-1,y)-B(x,y))|<
|0.587×(G(x+1,y)-G(x,y))+0.144×(B(x+1,y)-B(x,y))| (17)
不等式(17)が真であるときは、ステップ602においてパラメータpが−1に定められ、不等式(17)が偽であるときは、ステップ603においてパラメータpが1に定められる。
【0073】
ステップ604では、対象画素の上側および下側に隣接する画素と対象画素における輝度値の比較として、不等式(18)が成立するか否かが判定される。
|0.587×(G(x,y-1)-G(x,y))+0.144×(B(x,y-1)-B(x,y))|<
|0.587×(G(x,y+1)-G(x,y))+0.144×(B(x,y+1)-B(x,y))| (18)
不等式(18)が真であるときは、ステップ605においてパラメータqが−1に定められ、不等式(18)が偽であるときは、ステップ606においてパラメータqが1に定められる。
【0074】
ステップ607では、対象画素の左右のいずれかに隣接する画素と、上下のいずれかに隣接する画素と、対象画素とに関し、不等式(19)に従って輝度値が比較される。
|0.587×(G(x+p,y)-G(x,y))+0.144×(B(x+p,y)-B(x,y))|<
|0.587×(G(x,y+q)-G(x,y))+0.144×(B(x,y+q)-B(x,y))| (19)
パラメータp,qがともに−1であり、かつ不等式(19)が真であるとき、左側の画素の輝度値が対象画素の輝度値に最も近く、この場合ステップ608においてパラメータsがpすなわち−1に定められる。これに対し、不等式(19)が偽であるとき、すなわち上側の画素の輝度値が対象画素の輝度値により近い、あるいは等しいとき、ステップ609においてパラメータsが2×qすなわち−2に定められる。
【0075】
パラメータp,qがともに1であるとき、パラメータp,qがそれぞれ−1,1であるとき、パラメータp,qがそれぞれ1,−1であるときも同様にしてステップ607、608または609が実行される。このようにして第2の補間/修正処理ルーチンでは、対象画素のG信号およびB信号と、第2および第3パターンに属する画像に含まれる、隣接する画素のG信号およびB信号とを用いて輝度値が検討され、左側に隣接する画素の輝度値が最も近ければパラメータsは−1に、右側に隣接する画素の輝度値が最も近ければパラメータsは1に、上側に隣接する画素の輝度値が最も近ければパラメータsは−2に、下側に隣接する画素の輝度値が最も近ければパラメータsは2に、それぞれ定められる。
【0076】
このようにして、対象画素の輝度値に最も近い輝度値を有する類似画素が抽出された後、図9に示されるフローチャートと同じ処理によって、類似画素のR,G,B信号を用いて輝度値Yおよび補正値YGが求められ、対象画素のR信号が補間により求められるとともに、G信号とB信号が修正される。なお補正値YGは、対象画素と類似画素のG信号とB信号を用いて、(20)式に従って求められる。
YG=Y×(0.587×(G(x,y)-G(x',y'))+0.114×(B(x,y)-B(x',y')))
/(0.587×G(x',y')+0.114×B(x',y')) (20)
ただし、G(x',y')は類似画素のG信号、B(x',y')は類似画素のB信号を示す。
【0077】
以上のように本実施形態では、第1の補間/修正処理ルーチン(図10)と第2の補間/修正処理ルーチン(図11)において、輝度値としてG信号およびR信号あるいはB信号を用いているので、輝度信号をより正確に検討することができる。したがって、再生画像における色にじみを、第1実施形態よりも減少させることができる。
【0078】
【発明の効果】
以上のように本発明によれば、補間処理によって再生画像に生じる色にじみを減少させることができる。
【図面の簡単な説明】
【図1】本発明の第1実施形態である画像補間装置を備えたデジタルカメラの概略的な構成を示すブロック図である。
【図2】カラーフィルタにおけるカラーフィルタ要素の配列と、パターン設定部において抽出される各パターンに属する画像の画素信号とを示す図である。
【図3】1つの画像を構成する画素の座標と色を示す図である。
【図4】G補間処理ルーチンのフローチャートである。
【図5】R/B補間処理ルーチンのフローチャートである。
【図6】G補間処理ルーチンとR/B補間処理ルーチンが実行されたことによって求められた画素信号を示す図である。
【図7】第1の補間/修正処理ルーチンのフローチャートの前半部分である。
【図8】第1の補間/修正処理ルーチンのフローチャートの後半部分である。
【図9】第2の補間/修正処理ルーチンのフローチャートの後半部分である。
【図10】第2実施形態における第1の補間/修正処理ルーチンのフローチャートの前半部分である。
【図11】第2実施形態における第2の補間/修正処理ルーチンのフローチャートの前半部分である。
【符号の説明】
12 撮像素子
13 カラーフィルタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image interpolation device provided to improve the image quality of a color image, for example, in a digital camera.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, a digital camera is known in which a Bayer array color filter is provided in front of an image sensor such as a CCD in order to detect a color image. This color filter is configured by arranging red (R), green (G) and blue (B) color filter elements in a checkered pattern, and these color filter elements correspond to the photodiodes of the image sensor, respectively. Yes. Therefore, a pixel signal of a color corresponding to each color filter element is generated by the photodiode, and for example, an R pixel signal is generated by the photodiode corresponding to the R color filter element.
[0003]
In order to display a high-quality color image rather than using the pixel signal output from the image sensor as it is, interpolation processing may be performed on the pixel signal. In a normal interpolation process, a G signal is generated by taking an arithmetic average of G signals of pixels located in the periphery of a pixel from which an R signal is obtained by a photodiode. The B signal is generated by taking the arithmetic mean of the B signals of the pixels to be processed. However, in an image having a high spatial frequency, for example, the actual color of the pixel to be obtained by the interpolation process and the actual color of the surrounding pixels may be greatly different. Depending on the value of the color signal of the pixel, color blur occurs in the reproduced image.
[0004]
[Problems to be solved by the invention]
Accordingly, an object of the present invention is to reduce the occurrence of color blur in a reproduced image due to interpolation processing.
[0005]
[Means for Solving the Problems]
An image interpolation apparatus according to the present invention includes a color filter, an image sensor, a pattern setting unit, a G interpolation processing unit, an R / B interpolation processing unit, a first interpolation / correction processing unit, and a second interpolation / correction processing unit. Prepare.
The color filter includes a first row in which red (R) and green (G) color filter elements are alternately arranged in the horizontal direction, and adjacent to the upper and lower sides of the first row, and in the horizontal direction G and blue (B ) Color filter elements are alternately arranged in the second row. The image sensor generates R, G, and B signals that are pixel signals corresponding to each color filter element. The pattern setting means includes a first pattern in which an R signal is located on the upper left side in a 2 × 2 pixel matrix, and a second pattern in which a G signal is located on the upper right side from the R, G, and B signals generated by the image sensor. Images belonging to the third pattern in which the G signal is located in the lower left and the fourth pattern in which the B signal is located in the lower right are extracted. The G interpolation processing unit obtains a G signal for each pixel of the image belonging to the first and fourth patterns using the G signal of the adjacent pixel. The R / B interpolation processing means obtains R and B signals for each pixel of the images belonging to the second and third patterns using the R and B signals of adjacent pixels. For each pixel of the image belonging to the first pattern, the first interpolation / correction processing means extracts a similar pixel having the closest luminance value from adjacent pixels, and determines the change rate of the luminance value between the similar pixels. Based on the corresponding first correction value and the B, G, and R signals of similar pixels, the B signal is obtained, and the G signal obtained by the G interpolation processing unit and the R signal generated by the image sensor are corrected. To do. For each pixel of the image belonging to the fourth pattern, the second interpolation / correction processing means extracts a similar pixel having the closest luminance value from adjacent pixels, and determines the change rate of the luminance value between the similar pixels. Based on the corresponding second correction value and the R, G, B signals of similar pixels, the R signal is obtained, and the G signal obtained by the G interpolation processing means and the B signal generated by the image sensor are corrected. To do.
[0006]
In the G interpolation processing means, adjacent pixels are included in images belonging to the second and third patterns. In the R / B interpolation processing means, adjacent pixels are included in the images belonging to the first and fourth patterns. In the first interpolation / correction processing means and the second interpolation / correction processing means, adjacent pixels are included in the images belonging to the second and third patterns.
[0007]
The first interpolation / correction processing unit and the second interpolation / correction processing unit preferably extract a similar pixel having the closest luminance value by using the value of the G signal in the adjacent pixel. By estimating that the hue of the similar pixel is close to the hue of the pixel to be obtained by the interpolation process, the color blur is reduced.
[0008]
The first interpolation / correction processing means obtains a B signal and adds a G signal to each pixel of an image belonging to the first pattern by adding a first correction value to the B, G, and R signals of similar pixels. Correct the R signal.
[0009]
For example, for each pixel of the image belonging to the first pattern, the first correction value is obtained by multiplying the change rate of the G signal with the similar pixel by the luminance value of the similar pixel.
[0010]
The first interpolation / correction processing means obtains the B signal and corrects the G signal and the R signal according to the following formula, for example.
Y = 0.299 × R (x ′, y ′) + 0.587 × G (x ′, y ′) + 0.114 × B (x ′, y ′)
YG = Y × (G (x, y) −G (x ′, Y ′)) / G (x ′, y ′)
r ′ = YG + R (x ′, y ′)
g ′ = YG + G (x ′, y ′)
b = YG + B (x ′, y ′)
Where Y is the luminance value of the similar pixel, YG is the first correction value, R (x ′, y ′), G (x ′, y ′), B (x ′, y ′) are the R, G, B signals, G (x, y) are G signals of the pixels of the image belonging to the first pattern, b is B signals of the pixels belonging to the first pattern obtained by the first interpolation / correction processing means, r ′ Is a modified R signal and g ′ is a modified G signal.
[0011]
The second interpolation / correction processing means obtains the R signal and adds the G signal to each of the pixels of the image belonging to the fourth pattern by adding the second correction value to the R, G, B signals of the similar pixels. Correct the B signal.
[0012]
For example, for each pixel of the image belonging to the fourth pattern, the second correction value is obtained by multiplying the change rate of the G signal with the similar pixel by the luminance value of the similar pixel.
[0013]
The second interpolation / correction processing means obtains the R signal according to, for example, the following formula and corrects the G signal and the B signal.
Y = 0.299 × R (x ′, y ′) + 0.587 × G (x ′, y ′) + 0.114 × B (x ′, y ′)
YG = Y × (G (x, y) −G (x ′, y ′)) / G (x ′, y ′)
r = YG + R (x ', y')
g ′ = YG + G (x ′, y ′)
b '= YG + B (x', y ')
Where Y is the luminance value of the similar pixel, YG is the second correction value, R (x ′, y ′), G (x ′, y ′), and B (x ′, y ′) are R, G, B signals, G (x, y) are G signals of the pixels of the image belonging to the fourth pattern, r is an R signal of the pixels of the image belonging to the fourth pattern obtained by the second interpolation / correction processing means, g ′ is a modified G signal and b ′ is a modified B signal.
[0014]
The first interpolation / correction processing means extracts similar pixels using the values of the G signal and R signal in adjacent pixels. Further, the second interpolation / correction processing means is configured to output the G signal in the adjacent pixel and B Similar pixels are extracted using the value of the signal.
[0015]
The first correction value is based on the first reference value obtained based on the G signal and R signal in the pixel and similar pixels and the G signal and R signal of the similar pixel for each pixel of the image belonging to the first pattern. The luminance value is obtained by multiplying the ratio with the second reference value obtained in this way.
[0016]
The first interpolation / correction processing means may obtain the B signal according to the following formula and modify the G signal and the R signal.
Y = 0.299 × R (x ′, y ′) + 0.587 × G (x ′, y ′) + 0.114 × B (x ′, y ′)
YG = Y × (0.587 × (G (x, y) −G (x ′, y ′) + 0.299 × (R (x, y) −R (x ′, y ′)))
/(0.587×G(x',y')+0.299×R(x',y '))
r ′ = YG + R (x ′, y)
g ′ = YG + G (x ′, y ′)
b = YG + B (x ′, y ′)
Where Y is the luminance value of the similar pixel, YG is the first correction value, R (x ′, y ′), G (x ′, y ′), B (x ′, y ′) are the R, G, B signals, G (x, y) are G signals of pixels of the image belonging to the first pattern, b is B signals of pixels of the image belonging to the first pattern obtained by the first interpolation / correction processing means, r ′ is a modified R signal and g ′ is a modified G signal.
[0017]
The second interpolation / correction processing means relates to each pixel of the image belonging to the fourth pattern, the first reference value obtained based on the G signal and B signal in the pixel and similar pixels, and the G signal and B of similar pixels. The luminance value is obtained by multiplying the ratio with the second reference value obtained based on the signal.
[0018]
The second interpolation / correction processing means may obtain the R signal according to the following equation and correct the G signal and the B signal.
Y = 0.299 × R (x ′, y ′) + 0.587 × G (x ′, y ′) + 0.114 × B (x ′, y ′)
YG = Y × (0.587 × (G (x, y) −G (x ′, y ′)) + 0.114 × (B (x, y) −B (x ′, y ′))
/(0.587×G(x',y')+0.114×B(x',y '))
r = YG + R (x ', y')
g ′ = YG + G (x ′, y ′)
b '= YG + B (x', y ')
Where Y is the luminance value of the similar pixel, YG is the second correction value, R (x ′, y ′), G (x ′, y ′), and B (x ′, y ′) are R, G, B signals, G (x, y) are G signals of the pixels of the image belonging to the fourth pattern, r is an R signal of the pixels of the image belonging to the fourth pattern obtained by the second interpolation / correction processing means, g ′ is a modified G signal and b ′ is a modified B signal.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 shows a schematic configuration of a digital camera 10 provided with an image interpolation device according to the first embodiment of the present invention.
[0020]
A CCD 12 as an image pickup device is disposed behind the photographing lens 11, and a color filter 13 is provided on the light receiving surface of the CCD 12. That is, the optical image of the subject S obtained by the photographing lens 11 is formed on the light receiving surface of the CCD 12, and a color pixel signal constituting the subject image is generated in the photodiode of the CCD 12. The pixel signal is read from the CCD 12 and converted into a digital signal by the A / D converter 14. The pixel signal is subjected to white balance adjustment in the white balance adjustment circuit 15 and stored in the image memory 16.
[0021]
The pixel signal is read from the image memory 16 and input to the pattern setting unit 17. In the pattern setting unit 17, as will be described later, pixel signals constituting a predetermined array pattern are extracted from all pixel signals and classified into first, second, third and fourth patterns. In the interpolation processing unit 18, the pixel signal extracted in the pattern setting unit 17 is subjected to interpolation processing according to the pattern. The interpolated pixel signal output from the interpolation processing unit 18 is recorded on a recording medium D such as a memory card. Note that the white balance adjustment circuit 15 may be provided not in the subsequent stage of the A / D converter 14 but in the subsequent stage of the interpolation processing unit 18.
[0022]
FIG. 2 shows an array of color filter elements in the color filter 13 and pixel signals of images belonging to each pattern extracted by the pattern setting unit 17. The color filter 13 is composed of red (R), green (G), and blue (B) color filter elements arranged according to the Bayer array. That is, the color filter 13 includes a first row 13a in which R and G color filter elements are alternately arranged in the horizontal direction, and adjacent to the upper and lower sides of the first row 13a, and the G and B color filter elements in the horizontal direction. Are alternately arranged in the second row 13b, and the CCD 12 generates R, G, and B signals that are pixel signals corresponding to the respective color filter elements.
[0023]
The color filter 13 is divided into a 2 × 2 pixel matrix M1 in which color filter elements R are arranged in the upper left, G in the upper right and lower left, and B in the lower right. In the pattern setting unit 17, from the R, G, and B signals generated by the CCD 12, the first pattern in which the R signal is located at the upper left in the pixel matrix M1, the second pattern in which the G signal is located in the upper right, and the G in the lower left. Images belonging to the third pattern in which the signal is located and the fourth pattern in which the B signal is located in the lower right are extracted.
[0024]
In the pattern setting unit 17, the first pattern is extracted from all the pixel signals constituting one image according to the logical expression (1) expressed in C language.
! (X% 2) &&! (Y% 2) (1)
In the logical expression (1), “x” and “y” respectively indicate an abscissa and ordinate with the left corner of the image as the origin. That is, the coordinates of the R signal at the left corner are (0, 0) and the coordinates of the G signal at the right are (1,0). In the logical expression (1), “!” Indicates a logical negation, “%” indicates a remainder, and “&&” indicates a logical product. Therefore, according to the logical expression (1), an image composed of pixel signals (that is, R signals) whose x coordinate and y coordinate are both even numbers is extracted.
[0025]
Similarly, the second pattern, the third pattern, and the fourth pattern are extracted according to the logical expressions (2), (3), and (4).
(X% 2) &&! (Y% 2) (2)
! (X% 2) && (y% 2) (3)
(X% 2) && (y% 2) (4)
[0026]
Processing in the interpolation processing unit 18 will be described with reference to FIGS. FIG. 3 shows the coordinates and colors of the pixels constituting one image stored in the image memory 16. As will be described later, the interpolation processing unit 18 performs the G interpolation processing routine (FIG. 4), the R / B interpolation processing routine (FIG. 5), the first interpolation / correction processing routine (FIGS. 7 and 8), the first 2 interpolation / correction processing routine (FIG. 9) is executed. In these processing routines, the coordinates of the target pixel for which pixel data is to be obtained by interpolation or the like are (x, y).
[0027]
FIG. 4 is a flowchart of the G interpolation processing routine. In the G interpolation processing routine, interpolation processing relating to images belonging to the first and fourth patterns is performed.
[0028]
In step 101, the absolute value of the difference between G (x-1, y), which is the G signal of the pixel adjacent to the left side of the target pixel, and G (x + 1, y), which is the G signal of the pixel adjacent to the right side. Is the absolute value of the difference between G (x, y-1) which is the G signal of the pixel adjacent to the upper side of the target pixel and G (x, y + 1) which is the G signal of the pixel adjacent to the lower side It is also determined whether or not is smaller. The case where the coordinates of the target pixel is (2, 2) (that is, the image of the first pattern) will be described as an example. The target pixel is R (2, 2). In step 101, | G (1, 2) − It is determined whether G (3,2) | is smaller than | G (2,1) -G (2,3) |.
[0029]
When the target pixel is included in the image belonging to the first pattern, that is, the R signal, the pixels adjacent to the left and right are included in the image belonging to the second pattern, and the pixels adjacent to the top and bottom thereof are the third pattern. include. On the other hand, when the target pixel is included in the image belonging to the fourth pattern, that is, a B signal, the pixels adjacent to the left and right are included in the image belonging to the third pattern, and the pixels adjacent to the top and bottom thereof are the second. Included in the pattern.
[0030]
When it is determined in step 101 that the absolute value of the difference between the pixel signals adjacent to the left and right of the target pixel is smaller than the absolute value of the difference between the pixel signals adjacent to the upper and lower sides, step 102 is executed. An arithmetic average of G (x−1, y) and G (x + 1, y) that are pixel signals to be obtained is obtained as the G signal g of the target pixel. On the other hand, when it is determined that the absolute value of the difference between the pixel signals adjacent to the left and right of the target pixel is not smaller than the absolute value of the difference between the pixel signals adjacent vertically, in step 103, the pixels adjacent vertically An arithmetic average of the signals G (x, y-1) and G (x, y + 1) is obtained as the G signal g of the target pixel. Execution of step 102 or 103 ends the G interpolation processing routine.
[0031]
As described above, in the G interpolation processing routine, for each pixel of the image belonging to the first and fourth patterns, the average value of the two G signals of the smaller difference group among the four G signals adjacent to the left and right and the top and bottom is obtained. It is obtained as the G signal of the target pixel. When the G interpolation processing routine is executed for all the pixels of the images belonging to the first and fourth patterns, the G signals for all the pixels constituting one image are obtained.
[0032]
FIG. 5 is a flowchart of the R / B interpolation processing routine. In the R / B interpolation processing routine, interpolation processing relating to images belonging to the second and third patterns is performed.
[0033]
In step 201, it is determined whether or not the target pixel is included in an image belonging to the second pattern. When the target pixel is included in the image belonging to the second pattern, that is, when the target pixel is the upper right G signal of the pixel matrix M1 (FIG. 2), step 202 is executed. On the other hand, when the target pixel is not included in the second pattern, that is, is included in the third pattern and is the lower left G signal of the pixel matrix M1 (FIG. 2), step 203 is executed.
[0034]
In step 202, the arithmetic mean of R (x-1, y) and R (x + 1, y), which are pixel signals (first pattern image) adjacent to the left and right of the target pixel, is the R signal r of the target pixel. As required. Also, an arithmetic average of B (x, y-1) and B (x, y + 1), which are pixel signals (fourth pattern image) adjacent to the upper and lower sides of the target pixel, is obtained as the B signal b of the target pixel. .
[0035]
In step 203, the arithmetic mean of R (x, y-1) and R (x, y + 1), which are pixel signals (first pattern image) adjacent to the upper and lower sides of the target pixel, is the R signal r of the target pixel. As required. Further, an arithmetic average of B (x−1, y) and B (x + 1, y), which are pixel signals (fourth pattern image) adjacent to the left and right of the target pixel, is obtained as the B signal b of the target pixel. .
[0036]
Execution of step 202 or 203 ends the R / B interpolation processing routine. As described above, in the R / B interpolation processing routine, the R and B signals of the target pixel are obtained by interpolating the pixel signals adjacent to the left and right and top and bottom for each pixel of the image belonging to the second and third patterns. When the G interpolation processing routine (FIG. 4) is completed and the R / B interpolation processing routine is executed for all the pixels of the image belonging to the second and third patterns, as understood from FIG. The G signal is obtained for all the pixels constituting one image, and the R signal r and the B signal b are obtained for each pixel of the image belonging to the second and third patterns. That is, the B signal has not yet been obtained for the image belonging to the first pattern, and the R signal has not yet been obtained for the image belonging to the fourth pattern.
[0037]
7 and 8 show the B signal for each pixel of the image belonging to the first pattern, and the G signal obtained by the G interpolation processing routine (FIG. 4) and the R signal generated by the CCD 12 are corrected. 2 is a flowchart of a first interpolation / correction processing routine.
[0038]
In step 301, the absolute value of the difference between G (x−1, y), which is the G signal of the pixel adjacent to the left side of the target pixel, and G (x, y), which is the G signal of the target pixel, is calculated. It is determined whether or not the absolute value of the difference between G (x + 1, y), which is the G signal of the pixel adjacent to the right side, and G (x, y), which is the G signal of the target pixel, is smaller. In other words, it is determined whether the G signal of any pixel adjacent to the left and right of the target pixel has a value close to the G signal of the target pixel. When the G signal of the left pixel is closer to the G signal of the target pixel, in step 302, the parameter p is set to -1. On the other hand, when the G signal of the right pixel is closer to or equal to the G signal of the target pixel, the parameter p is set to 1 in step 303.
[0039]
In step 304, the absolute value of the difference between G (x, y-1), which is the G signal of the pixel adjacent to the upper side of the target pixel, and G (x, y), which is the G signal of the target pixel, is It is determined whether or not the absolute value of the difference between G (x, y + 1) which is the G signal of the pixel adjacent on the lower side and G (x, y) which is the G signal of the target pixel is smaller. That is, it is determined whether or not the G signal of any pixel adjacent to the top and bottom of the target pixel has a value close to the G signal of the target pixel. When the upper G signal is closer to the G signal of the target pixel, in step 305, the parameter q is set to -1. On the other hand, when the lower G signal is closer to or equal to the G signal of the target pixel, the parameter q is set to 1 in step 306.
[0040]
In step 307, the magnitude of the G signal is compared with respect to a pixel adjacent to any one of the left and right of the target pixel, a pixel adjacent to any one of the top and bottom, and the target pixel. The G signal of the left pixel of the target pixel is closer to the G signal of the target pixel than the G signal of the right pixel, and the G signal of the upper pixel of the target pixel is higher than the G signal of the lower pixel. When close to the signal, the parameters p and q are both -1, and the absolute value of the difference between G (x-1, y) and G (x, y) is G (x, y-1) and G ( It is determined whether or not the absolute value of the difference from x, y) is smaller. When the left G signal is closer to the G signal of the target pixel, in step 308, the parameter s is set to p, that is, -1. On the other hand, when the upper G signal is closer or equal to the G signal of the target pixel, the parameter s is set to 2 × q, that is, −2 in step 309.
[0041]
When the parameters p and q are both 1, the parameters p and q are −1 and 1 respectively, and the parameters p and q are respectively 1 and −1, the same steps 307, 308 or 309 are executed. Is done. In this way, in the first interpolation / correction processing routine, regarding the G signal of the target pixel, the value of the G signal of the adjacent pixel included in the images belonging to the second and third patterns is examined, and is adjacent to the left side. The parameter s is -1 if the G signal of the pixel is closest, the parameter s is 1 if the G signal of the pixel adjacent on the right side is closest, and the parameter s is -2 if the G signal of the pixel adjacent on the upper side is closest. In addition, the parameter s is set to 2 if the G signal of the adjacent pixel on the lower side is closest.
[0042]
In this specification, among four adjacent pixels, a pixel having a G signal closest to the G signal of the target pixel is referred to as a similar pixel. The similar pixel preferably has a luminance value closest to the luminance value of the target pixel. However, since the luminance value of the target pixel is unknown, the similar pixel is extracted by determining the luminance value using the G signal.
[0043]
In step 310, it is determined whether or not the parameter s is -1, that is, whether or not the similar pixel is a pixel adjacent to the left side of the target pixel. When the parameter s is -1, step 311 is executed, and R (x-1, y), G (x-1, y), B (x-1, y) is used to determine the luminance value Y, and G (x−1, y) which is the G signal of the similar pixel, G (x, y) which is the G signal of the target pixel, and the luminance value Y are used. A correction value YG is obtained.
[0044]
The luminance value Y and the correction value YG are calculated according to the equations (5) and (6), respectively.
Y = 0.299 × R (x-1, y) + 0.587 × G (x-1, y) + 0.114 × B (x-1, y) (5)
YG = Y × (G (x, y) -G (x-1, y)) / G (x-1, y) (6)
[0045]
The formula (5) is conventionally known. As understood from the equation (6), the correction value YG is obtained by multiplying the change rate of the G signal between the target pixel and the similar pixel by the luminance value Y of the similar pixel.
[0046]
In step 312, the G signal and R signal of the target pixel are calculated according to equations (7) and (8), and a corrected G signal g ′ and a corrected R signal r ′ are obtained. Further, the B signal of the target pixel is calculated according to the equation (9), and the interpolated B signal b is obtained. Thereby, the first interpolation / correction processing routine ends.
r '= YG + R (x', y ') (7)
g ′ = YG + G (x ′, y ′) (8)
b = YG + B (x ′, y ′) (9)
[0047]
Note that R (x ′, y ′), G (x ′, y ′), and B (x ′, y ′) are R (x−1, y), when step 312 is executed after step 311. G (x-1, y), B (x-1, y), and when step 312 is executed after step 314, R (x + 1, y), G (x + 1, y), B (x + 1, y), and when step 312 is executed after step 316, R (x, y-1), G (x, y-1), B (x, y-1) Yes, when step 312 is executed after step 317, R (x, y + 1), G (x, y + 1), B (x, y + 1).
[0048]
When it is determined in step 310 that the parameter s is not -1, the process proceeds to step 313, where it is determined whether or not the parameter s is 1, and whether or not the similar pixel is a pixel adjacent to the right side of the target pixel. Is determined. When the parameter s is 1, step 314 is executed, and the luminance value is calculated using the R, G, B signals of similar pixels. Y And a correction value YG is obtained.
[0049]
Luminance value Y and correction value YG are calculated according to equations (5a) and (6a), respectively.
Y = 0.299 × R (x + 1, y) + 0.587 × G (x + 1, y) + 0.114 × B (x + 1, y) (5a)
YG = Y * (G (x, y) -G (x + 1, y)) / G (x + 1, y) (6a)
[0050]
Step 312 is then executed. That is, the G signal and R signal of the target pixel are calculated according to the equations (7) and (8), and the corrected G signal g ′ and the corrected R signal r ′ are obtained. Further, the B signal of the target pixel is calculated according to the equation (9), and the interpolated B signal b is obtained. This completes the first interpolation / correction processing routine.
[0051]
When it is determined in step 313 that the parameter s is not 1, the process proceeds to step 315, where it is determined whether the parameter s is −2, and whether the similar pixel is a pixel adjacent to the upper side of the target pixel. Is determined. When the parameter s is −2, step 316 is executed, and the luminance value Y and the correction value YG are obtained using the R, G, B signals of similar pixels.
[0052]
The luminance value Y and the correction value YG are calculated according to the equations (5b) and (6b), respectively.
Y = 0.299 × R (x, y-1) + 0.587 × G (x, y-1) + 0.114 × B (x, y-1) (5b)
YG = Y * (G (x, y) -G (x, y-1)) / G (x, y-1) (6b)
[0053]
Next, as in the case of steps 311 and 314, step 312 is executed, the G signal and R signal of the target pixel are corrected according to equations (7) and (8), and the B signal of the target pixel is changed to (9). The first interpolation / correction processing routine is completed according to the equation.
[0054]
When it is determined in step 315 that the parameter s is not −2, the parameter s is 2, that is, the similar pixel is considered to be a pixel adjacent to the lower side of the target pixel. A luminance value Y and a correction value YG are obtained using the R, G, and B signals.
[0055]
The luminance value Y and the correction value YG are calculated according to the equations (5c) and (6c), respectively.
Y = 0.299 × R (x, y + 1) + 0.587 × G (x, y + 1) + 0.114 × B (x, y + 1) (5c)
YG = Y * (G (x, y) -G (x, y + 1)) / G (x, y + 1) (6c)
[0056]
Next, as in steps 311, 314, and 316, step 312 is executed, the G signal and R signal of the target pixel are corrected according to equations (7) and (8), and the B signal of the target pixel is ( 9), the first interpolation / correction processing routine is completed.
[0057]
As described above, in the first interpolation / correction processing routine, the correction signal YG is added to the R, G, and B signals of the similar pixels to obtain the B signal of the target pixel, and the G signal that has been obtained so far. The R signal is corrected.
[0058]
The first interpolation / correction processing routine is executed for all pixels of the image belonging to the first pattern. When the G interpolation processing routine (FIG. 4), the R / B interpolation processing routine (FIG. 5), and the first interpolation / correction processing routine (FIGS. 7 and 8) are completed, the first, second, and third patterns R, G, B signals are obtained for the images belonging to, and the R signals in the images belonging to the fourth pattern have not yet been determined.
[0059]
The R signal of the fourth pattern image is obtained by the second interpolation / correction processing routine. In the second interpolation / correction processing routine, the G signal obtained by the G interpolation processing routine (FIG. 4) and the B signal generated by the CCD 12 are corrected. FIG. 9 shows the latter half of the flowchart of the second interpolation / correction processing routine. The first half of the second interpolation / correction processing routine is the same as the first interpolation / correction processing routine shown in FIG.
[0060]
The processing contents of steps 410, 413, and 415 are the same as those of steps 310, 313, and 315 (FIG. 8). The processing contents of steps 411, 414, 416, and 417 are the same as those of steps 311, 314, 316, and 317.
[0061]
In step 412, the R signal of the target pixel is calculated according to equation (10), and an interpolated R signal r is obtained. The G signal and B signal of the target pixel are calculated according to the equations (11) and (12), and the corrected G signal g ′ and the corrected B signal b ′ are obtained.
r = YG + R (x ′, y ′) (10)
g ′ = YG + G (x ′, y ′) (11)
b '= YG + B (x', y ') (12)
[0062]
The second interpolation / correction processing routine is executed for all pixels of the image belonging to the fourth pattern.
[0063]
As described above, in the second interpolation / correction processing routine, as in the first interpolation / correction processing routine, the correction value YG is added to the R, G, and B signals of similar pixels to obtain the R signal of the target pixel. At the same time, the G signal and the B signal that have been obtained so far are corrected.
[0064]
As described above, in the present embodiment, in particular in the first interpolation / correction processing routine (FIGS. 7 and 8) and the second interpolation / correction processing routine (FIG. 9), the target pixel is positioned on the left and right and top and bottom. A pixel having a luminance value closest to the pixel to be extracted is extracted as a similar pixel, and interpolation processing is performed. In this interpolation process, the closer the luminance values of the two pixels are, the stronger the color correlation is. Therefore, by using the color difference signal of the target pixel as the color difference signal of the similar pixel, a pixel signal closer to the actual color can be obtained. Therefore, according to the present embodiment, it is possible to reduce color bleeding in the reproduced image.
[0065]
Furthermore, in the present embodiment, the G signal obtained by the G interpolation processing routine and the R signal and B signal generated by the CCD 12 are corrected according to the equations (7), (8), (11) and (12). The color of the target pixel is close to the color of the surrounding pixels, and the color blur is further reduced in the entire image.
[0066]
A second embodiment will be described with reference to FIGS. 10 and 11. FIG. 10 shows the first half of the first interpolation / correction processing routine, and FIG. 11 shows the first half of the second interpolation / correction processing routine. Other configurations are the same as those of the first embodiment, and thus are omitted.
[0067]
In step 501, it is determined whether or not the inequality (13) is established as a comparison of the luminance values of the pixel adjacent to the left and right sides of the target pixel and the target pixel.
| 0.587 × (G (x-1, y) -G (x, y)) + 0.299 × (R (x-1, y) -R (x, y)) | <
| 0.587 × (G (x + 1, y) −G (x, y)) + 0.299 × (R (x + 1, y) −R (x, y)) | (13)
When the inequality (13) is true, that is, when the luminance value of the left pixel is closer to the luminance value of the target pixel, the parameter p is set to −1 in step 502. On the other hand, when the inequality (13) is false, that is, when the luminance value of the right pixel is closer to or equal to the luminance value of the target pixel, the parameter p is set to 1 in step 503.
[0068]
In step 504, it is determined whether or not the inequality (14) is established as a comparison between the luminance values of the pixel adjacent to the upper side and the lower side of the target pixel and the target pixel.
| 0.587 × (G (x, y-1) -G (x, y)) + 0.299 × (R (x, y-1) -R (x, y)) | <
| 0.587 × (G (x, y + 1) −G (x, y)) + 0.299 × (R (x, y + 1) −R (x, y)) | (14)
When the inequality (14) is true, that is, when the luminance value of the upper pixel is closer to the luminance value of the target pixel, in step 505, the parameter q is set to -1. On the other hand, when the inequality (14) is false, that is, when the luminance value of the lower pixel is closer to or equal to the luminance value of the target pixel, the parameter q is set to 1 in step 506.
[0069]
In step 507, the luminance value is compared according to the inequality (15) with respect to the pixel adjacent to one of the left and right of the target pixel, the pixel adjacent to one of the top and bottom, and the target pixel.
| 0.587 × (G (x + p, y) -G (x, y)) + 0.299 × (R (x + p, y) -R (x, y)) | <
| 0.587 × (G (x, y + q) -G (x, y)) + 0.299 × (R (x, y + q) -R (x, y)) | (15)
When the parameters p and q are both −1 and the inequality (15) is true, the luminance value of the left pixel is closest to the luminance value of the target pixel. In this case, in step 508, the parameter s is p, that is, −1. Determined. On the other hand, when the inequality (15) is false, that is, when the luminance value of the upper pixel is closer to or equal to the luminance value of the target pixel, the parameter s is set to 2 × q, that is, −2 in step 509.
[0070]
When the parameters p and q are both 1, the parameters p and q are −1 and 1 respectively, and the parameters p and q are respectively 1 and −1, the same steps 507, 508 or 509 are executed. Is done. In this way, in the first interpolation / correction processing routine, the G signal and R signal of the target pixel and the G signal and R signal of adjacent pixels included in the images belonging to the second and third patterns are used. The luminance value is examined. The parameter s is -1 if the luminance value of the pixel adjacent on the left side is closest, the parameter s is 1 if the luminance value of the pixel adjacent on the right side is closest, and the luminance of the pixel adjacent on the upper side. If the value is closest, the parameter s is set to -2, and if the luminance value of the adjacent pixel on the lower side is closest, the parameter s is set to 2.
[0071]
After the similar pixel having the luminance value closest to the luminance value of the target pixel is extracted in this way, the luminance is obtained using the R, G, and B signals of the similar pixel by the same process as the flowchart shown in FIG. The value Y and the correction value YG are obtained, the B signal of the target pixel is obtained by interpolation, and the G signal and the R signal are corrected. The correction value YG is obtained according to the equation (16) using the G signal and R signal of the target pixel and similar pixels. Other formulas are the same as those in the first embodiment.
YG = Y × (0.587 × (G (x, y) −G (x ′, y ′)) + 0.299 × (R (x, y) −R (x ′, y ′)))
/(0.587×G(x',y')+0.299×R(x',y ')) (16)
However, G (x ′, y ′) indicates the G signal of the similar pixel, and R (x ′, y ′) indicates the R signal of the similar pixel.
[0072]
In the second interpolation / correction processing routine (FIG. 11), the R signal of the fourth pattern image is obtained by interpolation, and the G signal and the B signal are corrected. In step 601, it is determined whether or not the inequality (17) is established as a comparison of the luminance values of the pixel adjacent to the left and right sides of the target pixel and the target pixel.
| 0.587 × (G (x-1, y) -G (x, y)) + 0.144 × (B (x-1, y) -B (x, y)) | <
| 0.587 × (G (x + 1, y) -G (x, y)) + 0.144 × (B (x + 1, y) -B (x, y)) | (17)
When the inequality (17) is true, the parameter p is set to −1 at step 602, and when the inequality (17) is false, the parameter p is set to 1 at step 603.
[0073]
In step 604, it is determined whether or not the inequality (18) is established as a comparison of the luminance values of the target pixel and the pixels adjacent to the upper and lower sides of the target pixel.
| 0.587 × (G (x, y-1) -G (x, y)) + 0.144 × (B (x, y-1) -B (x, y)) | <
| 0.587 × (G (x, y + 1) -G (x, y)) + 0.144 × (B (x, y + 1) -B (x, y)) | (18)
When the inequality (18) is true, the parameter q is set to −1 at step 605, and when the inequality (18) is false, the parameter q is set to 1 at step 606.
[0074]
In step 607, the luminance value is compared according to the inequality (19) with respect to the pixel adjacent to any of the left and right of the target pixel, the pixel adjacent to either of the top and bottom, and the target pixel.
| 0.587 × (G (x + p, y) -G (x, y)) + 0.144 × (B (x + p, y) -B (x, y)) | <
| 0.587 × (G (x, y + q) -G (x, y)) + 0.144 × (B (x, y + q) -B (x, y)) | (19)
When the parameters p and q are both −1 and the inequality (19) is true, the luminance value of the left pixel is closest to the luminance value of the target pixel. In this case, in step 608, the parameter s is p, that is, −1. Determined. On the other hand, when the inequality (19) is false, that is, when the luminance value of the upper pixel is closer to or equal to the luminance value of the target pixel, the parameter s is set to 2 × q, that is, −2 in step 609.
[0075]
When the parameters p and q are both 1, the parameters p and q are −1 and 1, respectively, and the parameters p and q are respectively 1 and −1, steps 607, 608 or 609 are executed in the same manner. Is done. In this way, in the second interpolation / correction processing routine, the G signal and B signal of the target pixel and the G signal and B signal of the adjacent pixels included in the images belonging to the second and third patterns are used. The luminance value is examined. The parameter s is -1 if the luminance value of the pixel adjacent on the left side is closest, the parameter s is 1 if the luminance value of the pixel adjacent on the right side is closest, and the luminance of the pixel adjacent on the upper side. If the value is closest, the parameter s is set to -2, and if the luminance value of the adjacent pixel on the lower side is closest, the parameter s is set to 2.
[0076]
After the similar pixel having the luminance value closest to the luminance value of the target pixel is extracted in this way, the luminance value is obtained using the R, G, B signals of the similar pixel by the same processing as the flowchart shown in FIG. Y and the correction value YG are obtained, the R signal of the target pixel is obtained by interpolation, and the G signal and the B signal are corrected. The correction value YG is obtained according to the equation (20) using the G signal and B signal of the target pixel and similar pixels.
YG = Y × (0.587 × (G (x, y) −G (x ′, y ′)) + 0.114 × (B (x, y) −B (x ′, y ′)))
/(0.587×G(x',y')+0.114×B(x',y ')) (20)
However, G (x ′, y ′) indicates the G signal of the similar pixel, and B (x ′, y ′) indicates the B signal of the similar pixel.
[0077]
As described above, in this embodiment, in the first interpolation / correction processing routine (FIG. 10) and the second interpolation / correction processing routine (FIG. 11), the G signal and the R signal or the B signal are used as luminance values. Therefore, the luminance signal can be examined more accurately. Therefore, the color blur in the reproduced image can be reduced as compared with the first embodiment.
[0078]
【The invention's effect】
As described above, according to the present invention, it is possible to reduce color bleeding that occurs in a reproduced image by interpolation processing.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a schematic configuration of a digital camera including an image interpolation device according to a first embodiment of the present invention.
FIG. 2 is a diagram illustrating an array of color filter elements in a color filter and pixel signals of an image belonging to each pattern extracted by a pattern setting unit.
FIG. 3 is a diagram illustrating coordinates and colors of pixels constituting one image.
FIG. 4 is a flowchart of a G interpolation processing routine.
FIG. 5 is a flowchart of an R / B interpolation processing routine.
FIG. 6 is a diagram illustrating pixel signals obtained by executing a G interpolation process routine and an R / B interpolation process routine.
FIG. 7 is a first half of a flowchart of a first interpolation / correction processing routine.
FIG. 8 is the latter half of the flowchart of the first interpolation / correction processing routine.
FIG. 9 is the latter half of the flowchart of the second interpolation / correction processing routine.
FIG. 10 is a first half of a flowchart of a first interpolation / correction processing routine in the second embodiment.
FIG. 11 is a first half of a flowchart of a second interpolation / correction processing routine in the second embodiment.
[Explanation of symbols]
12 Image sensor
13 Color filter

Claims (16)

水平方向にレッド(R)とグリーン(G)のカラーフィルタ要素が交互に並ぶ第1の列と、この第1の列の上下側に隣接し、水平方向にGとブルー(B)のカラーフィルタ要素が交互に並ぶ第2の列とから構成されるカラーフィルタと、
前記各カラーフィルタ要素に対応した画素信号であるR,G,B信号を生成する撮像素子と、
前記撮像素子によって生成されたR,G,B信号から、2×2の画素マトリクスにおいて左上にR信号が位置する第1パターンと、右上にG信号が位置する第2パターンと、左下にG信号が位置する第3パターンと、右下にB信号が位置する第4パターンとにそれぞれ属する画像を抽出するパターン設定手段と、
前記第1および第4パターンに属する画像の各画素に関し、隣接する画素のG信号を利用してG信号を求めるG補間処理手段と、
前記第2および第3パターンに属する画像の各画素に関し、隣接する画素のRおよびB信号を利用してRおよびB信号を求めるR/B補間処理手段と、
前記第1パターンに属する画像の各画素に関し、隣接する画素の中から輝度値が最も近い類似画素を抽出し、前記類似画素との間における輝度値の変化率に対応した第1の補正値と前記類似画素のB,G,R信号とに基づいて、B信号を求めるとともに、前記G補間処理手段により求められたG信号と前記撮像素子により生成されたR信号とを修正する第1の補間/修正処理手段と、
前記第4パターンに属する画像の各画素に関し、隣接する画素の中から輝度値が最も近い類似画素を抽出し、前記類似画素との間における輝度値の変化率に対応した第2の補正値と前記類似画素のR,G,B信号とに基づいて、R信号を求めるとともに、前記G補間処理手段により求められたG信号と前記撮像素子により生成されたB信号とを修正する第2の補間/修正処理手段とを備え
前記第1の補間/修正処理手段が、前記第1パターンに属する画像の各画素に関し、前記類似画素のB,G,R信号にそれぞれ前記第1の補正値を加えることにより、前記B信号を求めるとともに前記G信号とR信号を修正することを特徴とする画像補間装置。
A first column in which red (R) and green (G) color filter elements are arranged alternately in the horizontal direction, and a color filter of G and blue (B) in the horizontal direction adjacent to the upper and lower sides of the first column A color filter composed of a second row of alternating elements;
An image sensor that generates R, G, and B signals that are pixel signals corresponding to the color filter elements;
From the R, G, B signals generated by the imaging device, a first pattern in which the R signal is located at the upper left in the 2 × 2 pixel matrix, a second pattern in which the G signal is located in the upper right, and a G signal in the lower left Pattern setting means for extracting images belonging to the third pattern in which B is located and the fourth pattern in which the B signal is located in the lower right,
G interpolation processing means for obtaining a G signal using the G signal of an adjacent pixel for each pixel of the image belonging to the first and fourth patterns;
R / B interpolation processing means for obtaining R and B signals using R and B signals of adjacent pixels for each pixel of the images belonging to the second and third patterns;
For each pixel of the image belonging to the first pattern, a similar pixel having the closest luminance value is extracted from adjacent pixels, and a first correction value corresponding to a change rate of the luminance value between the similar pixels and A first interpolation that obtains a B signal based on the B, G, and R signals of the similar pixels and that corrects the G signal obtained by the G interpolation processing unit and the R signal generated by the imaging device. / Correction processing means,
For each pixel of the image belonging to the fourth pattern, a similar pixel having the closest luminance value is extracted from adjacent pixels, and a second correction value corresponding to the change rate of the luminance value between the similar pixels and Based on the R, G, and B signals of the similar pixels, a second interpolation that obtains the R signal and corrects the G signal obtained by the G interpolation processing means and the B signal generated by the image sensor. / Correction processing means ,
The first interpolation / correction processing means adds the first correction value to each of the B, G, R signals of the similar pixels for each pixel of the image belonging to the first pattern, thereby obtaining the B signal. An image interpolating apparatus characterized in that the G signal and the R signal are corrected and obtained.
前記G補間処理手段において、前記隣接する画素が前記第2および第3パターンに属する画像に含まれることを特徴とする請求項1に記載の画像補間装置。  The image interpolation apparatus according to claim 1, wherein in the G interpolation processing unit, the adjacent pixels are included in an image belonging to the second and third patterns. 前記R/B補間処理手段において、前記隣接する画素が前記第1および第4パターンに属する画像に含まれることを特徴とする請求項1に記載の画像補間装置。  2. The image interpolation apparatus according to claim 1, wherein in the R / B interpolation processing means, the adjacent pixels are included in an image belonging to the first and fourth patterns. 前記第1の補間/修正処理手段および前記第2の補間/修正処理手段において、前記隣接する画素が前記第2および第3パターンに属する画像に含まれることを特徴とする請求項1に記載の画像補間装置。  2. The first interpolation / correction processing unit and the second interpolation / correction processing unit, wherein the adjacent pixels are included in an image belonging to the second and third patterns. Image interpolation device. 前記第1の補間/修正処理手段および第2の補間/修正処理手段が、前記隣接する画素におけるG信号の値を用いて、前記類似画素を抽出することを特徴とする請求項1に記載の画像補間装置。  2. The similar pixel according to claim 1, wherein the first interpolation / correction processing unit and the second interpolation / correction processing unit extract the similar pixel by using a value of a G signal in the adjacent pixel. Image interpolation device. 前記第1の補正値が、前記第1パターンに属する画像の各画素に関し、前記類似画素との間におけるG信号の変化率に前記類似画素の輝度値を乗じて求められることを特徴とする請求項1に記載の画像補間装置。  The first correction value is obtained for each pixel of an image belonging to the first pattern by multiplying a change rate of a G signal with the similar pixel by a luminance value of the similar pixel. Item 2. The image interpolation device according to Item 1. 前記第1の補間/修正処理手段が、下記式に従って前記B信号を求めるとともに前記G信号とR信号を修正することを特徴とする請求項に記載の画像補間装置。
Y=0.299×R(x',y')+0.587×G(x',y')+0.114×B(x',y')
YG=Y×(G(x,y)-G(x',y'))/G(x',y')
r’=YG+R(x',y')
g’=YG+G(x',y')
b=YG+B(x',y')
ただし、Yは前記類似画素の輝度値、YGは前記第1の補正値、R(x',y'),G(x',y'),B(x',y')は前記類似画素のR,G,B信号、G(x,y)は第1パターンに属する画像の画素のG信号、bは前記第1の補間/修正処理手段により求められた前記第1パターンに属する画素のB信号、r’は修正されたR信号、g’は修正されたG信号である。
The image interpolation apparatus according to claim 6 , wherein the first interpolation / correction processing unit obtains the B signal according to the following formula and corrects the G signal and the R signal.
Y = 0.299 × R (x ′, y ′) + 0.587 × G (x ′, y ′) + 0.114 × B (x ′, y ′)
YG = Y × (G (x, y) −G (x ′, y ′ )) / G (x ′, y ′)
r ′ = YG + R (x ′, y ′)
g ′ = YG + G (x ′, y ′)
b = YG + B (x ′, y ′)
Where Y is the luminance value of the similar pixel, YG is the first correction value, and R (x ′, y ′), G (x ′, y ′), and B (x ′, y ′) are the similar pixels. R, G, B signals, G (x, y) are G signals of the pixels of the image belonging to the first pattern, and b is a pixel of the first pattern obtained by the first interpolation / correction processing means. B signal, r ′ is a modified R signal, and g ′ is a modified G signal.
前記第2の補間/修正処理手段が、前記第4パターンに属する画像の各画素に関し、前記類似画素のR,G,B信号にそれぞれ前記第2の補正値を加えることにより、前記R信号を求めるとともに前記G信号とB信号を修正することを特徴とする請求項1に記載の画像補間装置。  The second interpolation / correction processing means adds the second correction value to the R, G, and B signals of the similar pixels for each pixel of the image belonging to the fourth pattern, thereby obtaining the R signal. 2. The image interpolating apparatus according to claim 1, wherein the G signal and the B signal are corrected and obtained. 前記第2の補正値が、前記第4パターンに属する画像の各画素に関し、前記類似画素との間におけるG信号の変化率に前記類似画素の輝度値を乗じて求められることを特徴とする請求項1に記載の画像補間装置。  The second correction value is obtained for each pixel of the image belonging to the fourth pattern by multiplying a change rate of a G signal with the similar pixel by a luminance value of the similar pixel. Item 2. The image interpolation device according to Item 1. 前記第2の補間/修正処理手段が、下記式に従って前記R信号を求めるとともに前記G信号とB信号を修正することを特徴とする請求項に記載の画像補間装置。
Y=0.299×R(x',y')+0.587×G(x',y')+0.114×B(x',y')
YG=Y×(G(x,y)-G(x',y'))/G(x',y')
r=YG+R(x',y')
g’=YG+G(x',y')
b’=YG+B(x',y')
ただし、Yは前記類似画素の輝度値、YGは前記第2の補正値、R(x',y'),G(x',y'),B(x',y')は前記類似画素のR,G,B信号、G(x,y)は第4パターンに属する画像の画素のG信号、rは前記第2の補間/修正処理手段により求められた前記第4パターンに属する画像の画素のR信号、g’は修正されたG信号、b’は修正されたB信号である。
10. The image interpolation apparatus according to claim 9 , wherein the second interpolation / correction processing unit obtains the R signal according to the following formula and corrects the G signal and the B signal.
Y = 0.299 × R (x ′, y ′) + 0.587 × G (x ′, y ′) + 0.114 × B (x ′, y ′)
YG = Y × (G (x, y) −G (x ′, y ′)) / G (x ′, y ′)
r = YG + R (x ', y')
g ′ = YG + G (x ′, y ′)
b '= YG + B (x', y ')
Where Y is the luminance value of the similar pixel, YG is the second correction value, and R (x ′, y ′), G (x ′, y ′), and B (x ′, y ′) are the similar pixels. R, G, B signals, G (x, y) are G signals of pixels of an image belonging to the fourth pattern, and r is an image of the image belonging to the fourth pattern obtained by the second interpolation / correction processing means. The R signal of the pixel, g ′ is a modified G signal, and b ′ is a modified B signal.
前記第1の補間/修正処理手段が、前記隣接する画素におけるG信号およびR信号の値を用いて、前記類似画素を抽出することを特徴とする請求項1に記載の画像補間装置。  The image interpolation apparatus according to claim 1, wherein the first interpolation / correction processing unit extracts the similar pixels by using values of a G signal and an R signal in the adjacent pixels. 前記第2の補間/修正処理手段が、前記隣接する画素におけるG信号およびB信号の値を用いて、前記類似画素を抽出することを特徴とする請求項1に記載の画像補間装置。  The image interpolation apparatus according to claim 1, wherein the second interpolation / correction processing unit extracts the similar pixels by using values of a G signal and a B signal in the adjacent pixels. 前記第1の補正値が、前記第1パターンに属する画像の各画素に関し、その画素と前記類似画素におけるG信号およびR信号に基づいて得られる第1の参照値と前記類似画素のG信号およびR信号に基づいて得られる第2の参照値との比率を前記輝度値に乗じて求められることを特徴とする請求項1に記載の画像補間装置。  For each pixel of the image belonging to the first pattern, the first correction value is obtained based on a G signal and an R signal in the pixel and the similar pixel, and a G signal of the similar pixel and The image interpolation apparatus according to claim 1, wherein the luminance value is obtained by multiplying a ratio with a second reference value obtained based on the R signal. 前記第1の補間/修正処理手段が、下記式に従って前記B信号を求めるとともに前記G信号とR信号を修正することを特徴とする請求項13に記載の画像補間装置。
Y=0.299×R(x',y')+0.587×G(x',y')+0.114×B(x',y')
YG=Y×(0.587×(G(x,y)-G(x',y')+0.299×(R(x,y)-R(x',y'))/(0.587×G(x',y')+0.299×R(x',y'))
r’=YG+R(x',y')
g’=YG+G(x',y')
b=YG+B(x',y')
ただし、Yは前記類似画素の輝度値、YGは前記第1の補正値、R(x',y'),G(x',y'),B(x',y')は前記類似画素のR,G,B信号、G(x,y)は第1パターンに属する画像の画素のG信号、bは前記第1の補間/修正処理手段により求められた前記第1パターンに属する画像の画素のB信号、r’は修正されたR信号、g’は修正されたG信号である。
14. The image interpolating apparatus according to claim 13 , wherein the first interpolation / correction processing means obtains the B signal according to the following equation and corrects the G signal and the R signal.
Y = 0.299 × R (x ′, y ′) + 0.587 × G (x ′, y ′) + 0.114 × B (x ′, y ′)
YG = Y × (0.587 × (G (x, y) −G (x ′, y ′) + 0.299 × (R (x, y) −R (x ′, y ′)) / (0.587 × G (x ', y') + 0.299 × R (x ', y'))
r '= YG + R (x', y ' )
g ′ = YG + G (x ′, y ′)
b = YG + B (x ′, y ′)
Where Y is the luminance value of the similar pixel, YG is the first correction value, and R (x ′, y ′), G (x ′, y ′), and B (x ′, y ′) are the similar pixels. R, G, B signals, G (x, y) are G signals of pixels of an image belonging to the first pattern, and b is an image of the image belonging to the first pattern obtained by the first interpolation / correction processing means. The B signal of the pixel, r ′ is the modified R signal, and g ′ is the modified G signal.
前記第2の補間/修正処理手段が、前記第4パターンに属する画像の各画素に関し、その画素と前記類似画素におけるG信号およびB信号に基づいて得られる第1の参照値と前記類似画素のG信号およびB信号に基づいて得られる第2の参照値との比率を前記輝度値に乗じて求められることを特徴とする請求項1に記載の画像補間装置。  The second interpolation / correction processing means, for each pixel of the image belonging to the fourth pattern, the first reference value obtained based on the G signal and the B signal in the pixel and the similar pixel, and the similar pixel The image interpolation apparatus according to claim 1, wherein the luminance value is obtained by multiplying a ratio with a second reference value obtained based on the G signal and the B signal. 前記第2の補間/修正処理手段が、下記式に従って前記R信号を求めるとともに前記G信号とB信号を修正することを特徴とする請求項15に記載の画像補間装置。
Y=0.299×R(x',y')+0.587×G(x',y')+0.114×B(x',y')
YG=Y×(0.587×(G(x,y)-G(x',y'))+0.114×(B(x,y)-B(x',y'))/(0.587×G(x',y')+0.114×B(x',y'))
r=YG+R(x',y')
g’=YG+G(x',y')
b’=YG+B(x',y')
ただし、Yは前記類似画素の輝度値、YGは前記第2の補正値、R(x',y'),G(x',y'),B(x',y')は前記類似画素のR,G,B信号、G(x,y)は第4パターンに属する画像の画素のG信号、rは前記第2の補間/修正処理手段により求められた前記第4パターンに属する画像の画素のR信号、g’は修正されたG信号、b’は修正されたB信号である。
16. The image interpolation apparatus according to claim 15 , wherein the second interpolation / correction processing unit obtains the R signal according to the following formula and corrects the G signal and the B signal.
Y = 0.299 × R (x ′, y ′) + 0.587 × G (x ′, y ′) + 0.114 × B (x ′, y ′)
YG = Y × (0.587 × (G (x, y) −G (x ′, y ′)) + 0.114 × (B (x, y) −B (x ′, y ′)) / (0.587 × G ( x ', y') + 0.114 × B (x ', y'))
r = YG + R (x ', y')
g ′ = YG + G (x ′, y ′)
b '= YG + B (x', y ')
Where Y is the luminance value of the similar pixel, YG is the second correction value, and R (x ′, y ′), G (x ′, y ′), and B (x ′, y ′) are the similar pixels. R, G, B signals, G (x, y) are G signals of pixels of an image belonging to the fourth pattern, and r is an image of the image belonging to the fourth pattern obtained by the second interpolation / correction processing means. The R signal of the pixel, g ′ is a modified G signal, and b ′ is a modified B signal.
JP2001010084A 2001-01-15 2001-01-18 Image interpolation device Expired - Fee Related JP4334151B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2001010084A JP4334151B2 (en) 2001-01-18 2001-01-18 Image interpolation device
US10/043,318 US7106341B2 (en) 2001-01-15 2002-01-14 Image interpolating device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001010084A JP4334151B2 (en) 2001-01-18 2001-01-18 Image interpolation device

Publications (2)

Publication Number Publication Date
JP2002218484A JP2002218484A (en) 2002-08-02
JP4334151B2 true JP4334151B2 (en) 2009-09-30

Family

ID=18877464

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001010084A Expired - Fee Related JP4334151B2 (en) 2001-01-15 2001-01-18 Image interpolation device

Country Status (1)

Country Link
JP (1) JP4334151B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4495355B2 (en) * 2001-01-15 2010-07-07 Hoya株式会社 Image interpolation device

Also Published As

Publication number Publication date
JP2002218484A (en) 2002-08-02

Similar Documents

Publication Publication Date Title
US11244209B2 (en) Image processing device, imaging device, and image processing method
US8446477B2 (en) Imaging apparatus, aberration correcting method, and program
JP5872408B2 (en) Color imaging apparatus and image processing method
US7667738B2 (en) Image processing device for detecting chromatic difference of magnification from raw data, image processing program, and electronic camera
TW201944773A (en) Image demosaicer and method
JP4548390B2 (en) Imaging apparatus and signal processing method
JP3905708B2 (en) Image interpolation device
US7046277B2 (en) Image interpolating device, including interpolation and modification processors
JP4334150B2 (en) Image interpolation device
JP2009194721A (en) Image signal processing device, image signal processing method, and imaging device
JP6415094B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
US7106341B2 (en) Image interpolating device
JP4334151B2 (en) Image interpolation device
US6900833B2 (en) Image interpolating device
JP4334152B2 (en) Image interpolation device
JP5036524B2 (en) Image processing apparatus, image processing method, program, and imaging apparatus
JP4666786B2 (en) Image interpolation device
JP4495355B2 (en) Image interpolation device
JP5269954B2 (en) Imaging device
JP5673186B2 (en) Imaging apparatus and interpolation processing method of imaging apparatus
JP2003134523A (en) Image pickup apparatus and method
US7916188B2 (en) Correction approximating straight line group information generating method of multi-divided reading CCD, and correction processing device manufacturing method of multi-divided reading CCD
KR100996797B1 (en) Image processing apparatus, image processing method, and program for attaining image processing
JP2002232903A (en) Image interpolation device
JP4334484B2 (en) Pixel signal processing apparatus and method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061124

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20080425

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090213

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090324

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090521

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090623

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

Free format text: PAYMENT UNTIL: 20120703

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

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

Free format text: PAYMENT UNTIL: 20120703

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20120703

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130703

Year of fee payment: 4

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees