JP3806477B2 - Image processing device - Google Patents
Image processing device Download PDFInfo
- Publication number
- JP3806477B2 JP3806477B2 JP00137797A JP137797A JP3806477B2 JP 3806477 B2 JP3806477 B2 JP 3806477B2 JP 00137797 A JP00137797 A JP 00137797A JP 137797 A JP137797 A JP 137797A JP 3806477 B2 JP3806477 B2 JP 3806477B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- unit
- template
- neighborhood
- approximate
- 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
Links
Images
Landscapes
- Transforming Light Signals Into Electric Signals (AREA)
- Color Television Image Signal Generators (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、各画素位置に応じて少なくとも1つ以上の分光特性に関する情報が欠落する画像信号から元の画像信号を回復処理する画像処理装置に関する。
【0002】
【従来の技術】
電子撮像系を用いた電子スチルカメラなどの撮像装置において、色フィルタをモザイク状に受光面に配した撮像素子を用いる単板式や、一枚はG(緑)フィルタのみ、もう一枚はR(赤)とB(青)のモザイクフィルタを配した2枚のCCDで撮像を行う二板式の撮像系は、分光系と三枚の撮像素子を用いる三板方式の撮像系と比較して安価に構成できるという利点をもつ。ただし、これらの方式では画像の各画素位置において色情報が少なくとも一つ以上欠落するため、画像処理装置において、ある画素の欠落している色情報を他の画素の欠落していない色情報を用いて推定する補間処理が必要となる。
【0003】
しかし、単板方式や二板方式においては色フィルタ配置に特有のモアレが発生し、またこのモアレの生じ方は色フィルタごとに異なる。このため、単純な線形補間処理ではエッジ部の凹凸、角度変化、色付きなどのアーティファクトが生じる。従来、これらのアーティファクトを軽減するために様々な補間手法が提案されてきたが、なかでも効果のある補間手法として、
1.エッジ部の凹凸アーティファクトを軽減するために、局所的な画像の幾何学的構造を推定し、その構造に応じた補間を行う方法と、
2.エッジ部の色付きを軽減するために、簡単な補間法で広帯域の輝度信号を生成できる色フィルタ配置を持った撮像素子を用い、色信号は輝度信号と同様に変化するものと仮定して色信号の補間を行う方法と、
の二つが上げられる。
【0004】
以下に、1については特開昭61−501423号公報、2については特開平4−502096号公報に開示された手法を例に取りそれぞれの手法を説明する。
【0005】
特開昭61−501423号公報は、R、G、B色フィルタ配列の撮像素子において、輝度成分に対応するG信号の補間法を開示している。この方法では、G信号が欠落している画素の3×3近傍において、その近傍があらかじめ用意した縁、筋、隅の幾何学的特徴のうち、どれに最もよく当てはまるかを判定し、この判定結果に基づいてそれぞれの幾何学的特徴に特化した補間方法を選択している。
【0006】
また、特開平4−502096号公報は、輝度成分が高サンプリング密度で、他の色成分が相対的に低サンプリング密度で得られている画像信号において、低サンプリング密度の色成分に対する補間法を開示している。この方法では、低サンプリング密度の色成分は高サンプリング密度の輝度成分を用いて算出される。このため、低サンプリング密度の信号S2のサンプリング位置には必ず高サンプリング密度の信号S1の標本値が存在すると仮定する。そして、信号S2のサンプリング位置における信号S1の標本値の差を所定の閾値と比較し、閾値を下回る場合は信号S2の標本値のみを用いた単純な線形補間を行う。
【0007】
閾値を上回る場合は信号S2のサンプリング位置間にエッジがあると判断し、信号S1と信号S2がS2=aS1+bなる線形な関係にあると仮定して係数a及びbを信号S2のサンプリング位置におけるS1とS2の値から求める。
【0008】
【発明が解決しようとする課題】
上記した従来技術ではいずれも、相対的に高サンプリング密度で与えられる輝度成分においても欠落する情報が存在するので、三板方式で得られる輝度成分と比較して劣化した情報しか得られない。また、この輝度成分に基づき算出される他の色成分も、三板方式で得られる色成分に比較して劣化した情報しか得られない。
【0009】
また、上記した従来技術はいずれも任意の色フィルタ配置の入力画像を処理する方法に関しては記載していない。輝度成分の補間においては、あらかじめ用意された幾何学的特徴とこれに対応する補間方法を用意する必要があり、色フィルタ配置が変わると設計を変更する必要がある。
【0010】
また、上記した従来技術はいずれも、ノイズの影響による誤動作に対応する方法に関しては記載していない。輝度成分および他の色成分を処理する場合、一回の処理で補間を行うため、パルス性のノイズの影響を受けやすい。特に輝度成分の処理においては3×3の局所領域で幾何学的特徴を分類するため、ノイズによる誤分類が発生しやすい。
【0011】
また、上記した従来技術はいずれも、撮像装置の光学系により帯域制限される情報の回復に関しては記載していない。すなわち、輝度成分および他の色の色成分は帯域制限された範囲内で処理されており、この帯域制限によって失われた情報を回復することができない。
【0012】
本発明は上記した各課題に着目してなされたものであり、その第1の目的とするところは、三板方式に近似する高精細な画像を得ることができ、かつ、任意の色フィルタ配置の入力画像を処理することができる画像処理装置を提供することにある。
【0013】
また、本発明の第2の目的は、第1の目的に加えて、画像信号のノイズによる劣化を低減できる画像処理装置を提供することにある。
【0014】
また、本発明の第3の目的は、第1または第2の目的に加えて、帯域制限によって失われた情報を回復することができる画像処理装置を提供することにある。
【0015】
【課題を解決するための手段】
上記の第1の目的を達成するために、第1の発明は、画素の位置に応じて少なくとも1つ以上の分光特性に関する情報が欠落する画像信号から元の画像信号を回復処理する画像処理装置において、前記情報が欠落する画像信号から、指定された画素を包含する所定サイズの近傍画像を抽出する近傍画像抽出手段と、この近傍画像抽出手段によって抽出された近傍画像と同一サイズの複数の幾何学的パターンに基づくテンプレート群を保持するテンプレート保持手段と、前記近傍画像抽出手段によって抽出された近傍画像に含まれる複数の分光特性の情報と、上記テンプレート保持手段によって保持された複数のテンプレート群との間でマッチングを行なって近傍画像に最も類似する最適テンプレートを選択し、この最適テンプレートに基づき近傍画像を近似する近傍近似画像を生成する近傍近似画像生成手段と、この近傍近似画像生成手段によって生成された近傍近似画像に基づき、前記指定された画素における欠落する情報を復元する復元手段とを具備する。
【0016】
また、第2の発明は、第1の発明において、前記復元手段は、指定された画素を包含する複数の前記近傍画像から得られる複数の前記近傍近似画像の、前記少なくとも1つ以上の分光特性に関する情報を重みつき平均することで復元処理を行なう。
【0017】
また、第3の発明は、第1または第2の発明において、前記テンプレート保持手段は、複数の幾何学的パターンに基づく第1のテンプレート群と、この第1のテンプレート群を撮像装置の光学系の帯域制限特性に応じて劣化させた第2のテンプレート群とを有し、前記近傍近似画像生成手段は、前記第2のテンプレート群から前記近傍画像に類似する最適テンプレートを選択し、これに対応する前記第1のテンプレート群に基づき帯域制限前の近傍近似画像を生成する。
【0018】
すなわち、第1の発明は、画素の位置に応じて少なくとも1つ以上の分光特性に関する情報が欠落する画像信号から元の画像信号を回復処理するにあたって、まず、前記情報が欠落する画像信号から指定された画素を包含する所定サイズの近傍画像を抽出する。そして、抽出された近傍画像と同一サイズの複数の幾何学的パターンに基づくテンプレート群をテンプレート保持手段に保持しておく。次に、前記抽出された近傍画像に含まれる複数の分光特性の情報と、上記テンプレート保持手段によって保持された複数のテンプレート群との間でマッチングを行なって近傍画像に最も類似する最適テンプレートを選択し、この最適テンプレートに基づき近傍画像を近似する近傍近似画像を生成する。そして、生成された近傍近似画像に基づき、前記指定された画素における欠落する情報を復元するようにする。
【0019】
また、第2の発明は、第1の発明において、復元処理を行なう場合は、指定された画素を包含する複数の前記近傍画像から得られる複数の前記近傍近似画像の、前記少なくとも1つ以上の分光特性に関する情報を重みつき平均するようにする。
【0020】
また、第3の発明は、第1または第2の発明において、近傍近似画像を生成する場合は、複数の幾何学的パターンに基づく第1のテンプレート群と、この第1のテンプレート群を撮像装置の光学系の帯域制限特性に応じて劣化させた第2のテンプレート群とを用意し、前記第2のテンプレート群から前記近傍画像に類似する最適テンプレートを選択し、これに対応する前記第1のテンプレート群に基づき帯域制限前の近傍近似画像を生成するようにする。
【0021】
【発明の実施の形態】
以下、図面を参照して本発明の実施形態を詳細に説明する。まず、本発明の第1実施形態を説明する。
【0022】
図1は本実施形態が適用される画像処理システムの構成を示す図であり、図2は図1の最小自乗近似部112の構成及びその周辺回路を示す図であり、図3は色成分マスクに関する説明図である。
【0023】
本実施形態の画像処理システムは図1に示すように、電子カメラ100とこの電子カメラ100に接続された画像処理装置101とから構成される。電子カメラ100は光学系としてのレンズ102、及び光学的に帯域制限を行うための水晶フィルタ103、撮像素子としての単板RGBランダム配列CCD104を具備し、単板RGBランダム配列CCD104の出力はA/D変換部105を経て画像バッファ107に接続されている。電子カメラ100にはさらに単板RGBランダム配列CCD104のRGBフィルタ配列を記憶したフィルタ配置情報保持ROM106が設けられている。
【0024】
画像処理装置101は上記した画像バッファ107の出力に接続された入力画像バッファ108と、近傍読み出し部109と、劣化前テンプレート保持ROM111a及び劣化後テンプレート保持ROM111bを具備するテンプレート保持ROM111と、最小自乗近似部112と、帯域・色情報復元部114と、三板画像加算部115と、出力画像バッファ116とを具備している。
【0025】
図2は最小自乗近似部112の構成とその周辺回路を示す図である。図2に示すように、最小自乗近似部112は色成分マスク生成部112aと、最小自乗係数算出部112bと、近似誤差累積部112cと、近似係数保持バッファ112dと、テンプレート決定部112eとを具備する。最小自乗近似部112はさらに近傍読み出し部109に接続された近傍画像入力端子112rと、フィルタ配置情報保持ROM106に接続されたフィルタ情報入力端子112pと、劣化後テンプレート保持ROM111bに接続されたテンプレート入力端子112qと、帯域・色情報復元部114に接続された近似パラメータ出力端子112sとを有する。
【0026】
図1に示すように、電子カメラ100は2本の線で画像処理装置101に接続されているが、このうち画像バッファ107の出力は入力画像バッファ108、近傍読み出し部109を経て最小自乗近似部112に接続されている。
【0027】
一方、フィルタ配置情報保持ROM106は図2に示すようにフィルタ情報入力端子112p経由で最小自乗近似部112内の色成分マスク生成部112aに接続されている。最小自乗係数算出部112bはこの色成分マスク生成部112aのほかに、近傍画像入力端子112rを介して近傍読み出し部109、及びテンプレート入力端子112qを介して劣化後テンプレート保持ROM111bからの入力を受けるべく接続され、保持している情報を近似係数保持バッファ112d及び近似誤差累積部112cに出力すべく接続されている。
【0028】
近似係数保持バッファ112d及び近似誤差累積部112cはともにテンプレート決定部112eに接続され、テンプレート決定部112eは決定した内容を近似パラメータ出力端子112sを通じて帯域・色情報復元部114に出力すべく接続されている。
【0029】
図1に示すように帯域・色情報復元部114は最小自乗近似部112のほかに劣化前テンプレート保持ROM111aからの入力を受けるべく接続され、復元結果を三板画像加算部115経由で出力画像バッファ116に出力すべく接続されている。劣化前テンプレート保持ROM111aと劣化後テンプレート保持ROM111bはともにテンプレート保持ROM111の一部である。
【0030】
テンプレート保持ROM111の劣化前テンプレート保持ROM111aには、所定のN種の幾何学的特徴をもつ所定サイズのグレースケール画像であるテンプレートΨi(i=0〜N−1)が保持され、劣化後テンプレート保持ROM111bには劣化前テンプレート保持ROM111aの各テンプレートが電子カメラ100の光学系による帯域制限を受けた画像であるテンプレートΦi(i=0〜N−1)が保持されている。
【0031】
出力画像バッファ116は、入力画像の各画素における色の欠落と帯域劣化が補正された3色カラー画像を保持するが、この画像処理装置101では各画素につき処理中に複数の補正値が計算される。それらを補正値の信頼性に基づいて重みづけ計算するために、出力画像バッファ116にはさらに各画素位置における画素値の信頼性を表す信頼値が保持されている。
【0032】
以下に上記した構成を有する画像処理システムの作用を説明する。
【0033】
まず電子カメラ100を用いて被写体が撮像され、レンズ102、水晶フィルタ103を通じて帯域制限を受けた光学像が単板RGBランダム配列CCD104上に形成される。単板RGBランダム配列2次元CCD104の出力はA/D変換部105を経て画像バッファ107にそのまま転送され、CCD上での各画素位置につき単板RGBランダム配列CCD104における色フィルタ配置により定まる一つの色成分しか持たない画像が保存される。
【0034】
撮像が終了すると、画像バッファ107内の画像は入力画像バッファ108に転送される。同時に、電子カメラ100の撮像素子の色フィルタ配置を保持するフィルタ配置情報保持ROM106からも色フィルタ配置情報が色成分マスク生成部112aに転送される。さらに、出力画像バッファ116のカラー画像の画素値、及び信頼値はすべて0に初期化される。
【0035】
次に、近傍読み出し部109によりCCD上での各画素位置(x,y)を中心とする所定の矩形領域(例えば5×5画素)に対応する画像信号が入力画像バッファ108内より近傍画像h(p,q) として読み出され、最小自乗近似部112の最小自乗係数算出部112bに転送される。以下の説明において、変数の組(p,q)は、この近傍画像の中心画素(x,y)に対する相対座標であり、例えば近傍の大きさが5×5であれば[−2,−1,0,1,2]×[−2,−1,0,1,2]の範囲を動く。また、場合によって色R,G,Bをそれぞれ整数値c=0,1,2に対応させて説明する。
【0036】
近傍読み出し部109から最小自乗係数算出部112bに近傍画像が転送されると、色成分マスク生成部112aは当該近傍画像の各色成分について、当該色成分の存在する画素位置で1、その他の位置で0をとるマスクmask(p,q,c) (c=0,1,2)を計算する。図3は近傍画像におけるある特定の色フィルタ配置に対応する色成分マスクを例示したものである。
【0037】
一方、最小自乗係数算出部112bは、劣化後テンプレート保持ROM111bのテンプレートΦi(p,q) (i=0,1,2,〜,N−1)からテンプレートΦ0(p,q)を読み出し、転送された近傍画像hから色成分マスクにより生成された各色成分c(c=0,1,2)との近似誤差e0(1)、e0(2)、e0(3)を各々最小化する近似係数α0(c),β0(c)を、近似誤差を表す一般式
e(c) = ‖ mask(p,q,c) ・ ( α (c) Φ i(p,q) +β (c) − h(p,q) ‖
を用いて、各色成分毎に計算する。最小自乗係数算出部112bは、計算された近似係数α0(c)、β0(c)を近傍画像hと共に近似係数保持バッファ112dに送り、最小化された近似誤差e0(1)、e0(2)、e0(3)とそれに対応するテンプレートのインデックスi=0を近似誤差累積部112cに送る。
【0038】
近似誤差累積部112cは、転送された近似誤差e0(1)、e0(2)、e0(3)から累積加算誤差e0=e0(1)+e0(2)+e0(3)を計算し、テンプレート決定部112eに転送する。
【0039】
テンプレート決定部112eは、累積加算誤差eを最小とするテンプレートを決定するもので、各テンプレートに対応して得られる累積加算誤差eの値を比較して、その最小値を取るテンプレートを選択する。テンプレート決定部112eには、テンプレートのインデックスと、そのテンプレートに対応する累積加算誤差e、更に、このテンプレートに対応する近似係数α(c)、β(c)を記憶する記憶部が設けられている。そこで、テンプレートΦ0(p,q)のインデックスi=0と、そのテンプレートに対応する累積加算誤差e0とがテンプレート決定部112eに転送されると、これらを記憶部に保持する。また、このとき、近似係数保持バッファ112dから近似係数α0(c)、β0(c)が転送され、この記憶部に保持される。
【0040】
次に、最小自乗係数算出部112bが2番目のテンプレートΦ1(p,q)を読み出し、上記のステップを繰り返すことにより、テンプレートΦ1(p,q)のインデックスi=1と、このテンプレートに対応する累積加算誤差e1が求められる。テンプレート決定部112eは、累積加算誤差e0と累積加算誤差e1とを比較し、誤差が小さい方の値を対応するインデックスと共に記憶部に残す。また、近似係数についても、小さい累積加算誤差を発生するテンプレートの近似係数が記憶部に保持される。以降は、3番目のテンプレートΦ2(p,q)、4番目のテンプレートΦ3(p,q)、…と順番に読み出しては、累積加算誤差e2、e3…を求め、逐次記憶部に記憶された累積加算誤差の値と比較しては、より小さい方を記憶部にインデックス及び近似係数と共に残していくことにより、最終的に累積加算誤差を最小とするテンプレートを決定する。
【0041】
最小自乗係数算出部112bで全てのテンプレートが処理された後、テンプレート決定部112eは誤差の最小値 min_e を与えたインデックス min_i と近似係数 min_α(c) 、 min_β(c) 、および誤差の最小値 min_e に反比例する近似評価値Aを帯域・色情報復元部114に転送する。ここで、例えば近似評価値AはA=1/(1+ min_e )により計算する。
【0042】
帯域・色情報復元部114は、転送されたインデックス min_i に対応する劣化前のテンプレートΨ min_i(p,q)を劣化前テンプレート保持ROM111aから読み出し、転送された係数 min_α(c) 、min _β(c) を用いて式
f(p,q,c) = min_α(c) Ψ min_i(p,q)+ min_β(c) (c=0,1,2 )
を計算することにより、近傍画像h(p,q) の色成分の欠落を補正した近傍補正近似画像f(p,q,c) を得る。劣化前のテンプレートを用いていることにより、f(p,q,c) においてはさらに電子カメラ100の光学系による帯域の劣化も補正されている。帯域・色情報復元部114は、算出したf(p,q,c) を近似評価値Aとともに三板画像加算部115に転送する。
【0043】
処理の途中では、出力画像バッファ116の各画素位置にはこれまでの処理で得られた複数の補正画素値の平均値と信頼値が保持されるようになっている。三板画像加算部115は、出力画像バッファ116から当該近傍画像に対する領域の各画素の補正画素値と信頼値をそれぞれ変数Sf(p,q,c) およびQ(p,q) に読み出す。そして、これらと帯域・色情報復元部114から転送された近傍補正近似画像f(p,q,c) 及び近似評価値Aから、新たな補正画素値Sfnew (p,q,c) および信頼値Qnew (p,q) を式
により計算し、Sfnew (p,q,c) 及びQnew (p,q) を出力画像バッファ116の当該近傍画像に対応する領域に書き込む。
【0044】
全ての画素位置に関してこれらの処理が終了すると、入力画像バッファ108の画像の各画素について、当該画素を含むすべての近傍画像に対して近傍補正近似画像が計算される。その結果、各画素に関して複数の補正画素値が得られるが、これらの補正画素値は三板画像加算部115における処理により重み付き平均されて出力画像バッファ116に蓄積される。これによって最終的に色成分の欠落と電子カメラ100の光学系による劣化とが補正された3色カラー画像が得られる。
【0045】
なお、この実施形態の各構成要素は種々の変形、変更が可能である。例えば、単板RGBランダム配列CCD104は種々の色フィルタ配置のCCD、あるいは一枚はG、もう一枚はRとBといった二板構成のCCDでもよい。
【0046】
また、種々の光学系をもった電子カメラに対応させるために次のような構成も可能である。電子カメラ100の側ではフィルタ配置情報保持ROM106が色フィルタ配置情報以外に、レンズ102、水晶フィルタ103等の光学系の帯域制限情報をも保持するようにし、画像処理装置101の側では、劣化前テンプレート保持ROM111a内の各劣化前テンプレートに対し、種々の光学系の帯域制限による劣化を想定した複数の劣化後テンプレートを用意する。そして、最小自乗近似部112ではフィルタ配置情報保持ROM106の光学系情報に基づいて劣化後テンプレートを一つ選択するようにする。
【0047】
同様に、カメラの利用者により設定された被写体に関する情報を画像処理装置101に転送し、最小自乗近似部112がそれに応じてテンプレートのセットを選択するような構成にすることも可能である。三板画像加算部115も、各画素について得られた複数の近似値を蓄積しておき、それらの値から多数決などで近似値を決定する等の変更が可能である。
【0048】
また、電子カメラ100に水晶フィルタ103がなく帯域制限がなされていない場合には、テンプレート保持ROM111が劣化前テンプレート保持ROM111aのみからなり、最小自乗近似部112が劣化前テンプレート保持ROM111aに接続される構成にする。この場合、各部分の作用は、最小自乗近似部112がテンプレートとしてΦiのかわりにΨiを用いる点を除いて同一である。その結果、帯域・色情報復元部114では色成分の欠落は補正されるが帯域の劣化についてはなにもされない近傍補正近似画像が得られ、出力画像バッファ116には入力画像バッファ108内の画像の色成分の欠落が補正された3色カラー画像が得られる。
【0049】
以下に本発明の第2実施形態を説明する。図4は本発明の第2実施形態が適用される画像処理システムの構成を示す図であり、図5は図4における最小自乗近似部112の処理の流れを表すフローチャートである。
【0050】
図4において、本画像処理システムは電子カメラ200と、この電子カメラ200に接続された画像処理装置201とから構成される。電子カメラ200は、第1実施形態と同様、光学系としてレンズ202及び帯域制限を行うための水晶フィルタ203、撮像素子としての単板ベイヤー配列CCD204を具備し、単板ベイヤー配列CCD204の出力はA/D変換部205を経て画像バッファ207に接続されている。電子カメラ200内の単板ベイヤー配列CCD204の色フィルタ配列に関する情報は、後述するようにベイヤー配列の規則性を利用して画像処理装置201内で計算により求められる。
【0051】
画像処理装置201は、入力画像バッファ208と、近傍読み出し部209と、平坦度評価部210と、劣化前テンプレート保持ROM211a及び劣化後テンプレート保持ROM211bを具備するテンプレート保持ROM211と、最小自乗近似部212と、色情報復元部213と、帯域・色情報復元部214と、補間係数計算部215と、線形演算部216と、出力画像バッファ217とを具備する。
【0052】
電子カメラ200内の画像バッファ207の出力は、画像処理装置201内の入力画像バッファ208、近傍読み出し部209を経て平坦度評価部210に接続されている。
【0053】
最小自乗近似部212は、平坦度評価部210およびテンプレート保持ROM211内の劣化後テンプレート保持ROM211bの出力を受けるべく接続され、かつ処理結果を色情報復元部213及び帯域・色情報復元部214に出力すべく接続されている。帯域・色情報復元部214はこの最小自乗近似部212のほかに、テンプレート保持ROM211内の劣化前テンプレート保持ROM211aの出力を受けるべく接続されている。色情報復元部213は最小自乗近似部212のほかに、テンプレート保持ROM211内の劣化後テンプレート保持ROM211bの出力を受けるべく接続されている。
【0054】
テンプレート保持ROM211の劣化前テンプレート保持ROM211aには、第1実施形態と同様に、N種の幾何学的特徴をもつ所定サイズのグレースケール画像であるテンプレートΨi(i=0〜N−1)が保持され、劣化後テンプレート保持ROM211bには劣化前テンプレート保持ROM211aの各テンプレートが電子カメラ200の光学系による帯域制限を受けた画像であるテンプレートΦi(i=0〜N−1)が保持されている。
【0055】
色情報復元部213及び帯域・色情報復元部214は共に補間係数計算部215に接続されている。線形演算部216は補間係数計算部215及び平坦度評価部210の出力を受けるべく接続され、かつ復元結果を出力画像バッファ217に出力すべく接続されている。
【0056】
以下に、上記した構成を有する画像処理システムの作用を説明する。
【0057】
第2実施形態においても第1実施形態と同様に電子カメラ200で撮像が行われ、光学系で帯域劣化を受け、かつ各画素位置につき一つの色成分しか持たない画像が画像バッファ207に保持される。撮像が終了すると、画像バッファ207内の画像は入力画像バッファ208に転送される。第1実施形態と異なり、電子カメラ200内の撮像素子の色フィルタ配列は、電子カメラ200から画像処理装置201に転送される代わりにベイヤー配列の規則性を利用して後ほど画像処理装置201内で計算される。
【0058】
次に、入力画像バッファ208内の画像の各画素位置(x,y)につき、以下の処理が行われる。
【0059】
近傍読み出し部209により当該画素位置(x,y)の所定の矩形領域(例えば5×5画素)が近傍画像h(p,q) として読み出される。
【0060】
以下の説明において、変数の組(p,q)は、この近傍画像の中心画素(x,y)に対する相対座標であり、例えば近傍の大きさが5×5であれば[−2,−1,0,1,2]×[−2,−1,0,1,2]の範囲を動く、また、場合によって色R,G,Bをそれぞれ整数値c=0,1,2に対応させて説明する。
【0061】
読み出された近傍画像は、平坦度評価部210に送られる。平坦度評価部210では、各色成分ごとに画素値が存在する位置に対する画素値の分散を計算し、全ての色成分に対する分散の和が所定の閾値以上であれば、最小自乗近似部212に近傍画像を転送する。また、平坦度評価部210は、この評価とは無関係に近傍画像を線形演算部216に転送する。
【0062】
最小自乗係数算出部212は、近傍画像が転送されると図5に示すフローに従って処理を行い、第1実施形態と同様に、近傍画像を最もよく近似する劣化後テンプレートのインデックス min_i と近似係数 min_α(c) 、min _β(c) (c=0,1,2)を算出する。
【0063】
図5に示すフローチャートの各ステップ(S)は以下のような処理を行なう。
【0064】
S1:当該近傍画像の中心画素の座標(x,y)を得、この値とベイヤー配列の規則性に基づいて、近傍画像内の位置(p,q)に対し色成分cの色フィルタが存在すれば1、存在しなければ0をとる色成分マスクを表す配列変数mask(p,q,c) を計算する。図5中、関数rem(a,b)はaをbで割った余りを返し、関数abs(a)はaの絶対値を与える。また、変数Nをテンプレートの総数に、変数 min_i とc=0,1,2に対する配列変数 min_α(c) 、min _β(c) の値を0に初期化する。配列変数h(p,q) は近傍画像の画素値で初期化される。テンプレート要素のインデックスを表す変数iは0に初期化される。テンプレートの最小当てはめ誤差を表す変数 min_e は画像処理装置201で扱うことのできる最大の数に初期化される。
【0065】
S2:i番目のテンプレートΦi(p,q) を劣化後テンプレート保持ROM211bから読み出し、配列変数Φ(p,q) に代入する。色を表す変数cと誤差を表す変数eを0に初期化する。
【0066】
S3:変数h(p,q) 、Φ(p,q) 、mask(p,q,c) から定義される、色変数c、実数α,βの関数である誤差関数err(c,α, β)を最小化するα,βを求める。誤差関数err(c,α, β)は、色成分cの存在する位置において、テンプレート画像Φをゲインαとバイアスβにより加工した画像αΦ+βと近傍画像の誤差の尺度であり、図中において記号
【数1】
【0067】
は近傍画像内におけるa(p,q) の自乗和を表す。誤差関数err(c,α, β)を最小化するα,βを求めることは、近傍画像の各色成分を最もよく近似するようにテンプレートΦのゲインαとバイアスβを調整することに等しい。最小化された誤差関数の値は変数eに足し込まれ、求められたゲインαとバイアスβは配列変数の色cに対応する要素α(c) 、β(c) に代入される。その後、色を表す変数cはインクリメントされる。
【0068】
S4:すべての色成分RGBに対する処理S3が終了したかどうかを色を表すcが2、つまりBを越えたかどうかで判断し、越えた場合はS5、越えない場合は引き続きS3に分岐する。
【0069】
S5:S5に到達した時点で、変数eはi番目の劣化テンプレート要素を近傍画像に当てはめた場合の誤差を表している。変数 min_e は、i未満のすべての劣化テンプレート要素に関する当てはめ誤差の最小値を表している。eが min_e より小さい場合は、S6に分岐して当てはめ誤差最小のテンプレートに関する情報を更新する。大きい場合はS7に分岐する。
【0070】
S6: min_e をeに、 min_i をiに、c=0,1,2に関して min_α(c) 、 min_β(c) をα(c) 、β(c) に更新する。
【0071】
S7:インデックスiをインクリメントする。
【0072】
S8:インデックスiがNに一致しなければS2に、一致すればS9に分岐する。
【0073】
最小自乗近似部212の出力 min_i 、min _α(c) 、 min_β(c) は色情報復元部213及び帯域・色情報復元部214に転送される。色情報復元部213では劣化後テンプレート保持ROM211bから、帯域・色情報復元部214では劣化前テンプレート保持ROM211aからそれぞれインデックス min_i に対応するテンプレートΦ min_i(p,q)、Ψ min_i(p,q)を読み出し、近似係数 min_α(c) 、min _β(c) を用いて式
f(p,q,c) = min_α(c) Ψ min_i(p,q)+ min_β(c) 、
g(p,q,c) = min_α(c) Φ min_i(p,q)+ min_β(c) (c=0,1,2)
を計算し、近傍画像h(p,q) に対して色成分の欠落と帯域の劣化を補正した近傍補正近似画像f(p,q,c) 、および色成分の欠落のみを補正した近傍補正近似画像g(p,q,c) を得る。そして、これらを補間係数計算部215に転送する。
【0074】
補間係数計算部215では、f(p,q,c) 及びg(p,q,c) から、当該近傍画像内の画素値を用いて劣化前のカラー画素値を推定するのに適した情報を補間係数の形で算出する。そのために、近傍補正近似画像g(p,q,c) を当該近傍における電子カメラ200の色フィルタ配置に応じてサンプリングした入力画像バッファ208内の画像同様の単板状態の画像g′(p,q) とf(p,q,c) の関係を調べ、g′からfを線形演算で回復するのに必要な係数を計算する。ここでは、補間係数計算部215は例として以下の原理に従って係数を計算する。
【0075】
まずfの色cの各画素を自己回帰モデルの考えに基づいて3色画像gの各画素の線形和として
【数2】
【0076】
と近似することを考える。自己回帰モデルとは、ある画素の画素値が、その画素の周囲の画素値の重み付き線形和とノイズ項との和で示されるモデルのことである。ここではノイズ項は無視している。この式で整数変数組(u,v)は変数組(p,q)のとりうる範囲より狭い範囲Dを動く。
【0077】
H(u,v) は、近傍内の位置(u,v)における色フィルタの種類をR=0,G=1,B=2と表す整数値である。この式は各位置(p,q)のまわりで、位置(0,0)(中心画素)の回りにおけるものと同じ配置の色フィルタを通じてサンプリングされたgの画素値を使って位置(p,q)におけるfの値を推定することを表している。
【0078】
この式による近似の自乗誤差を最小にするためにwc uvの満たすべき式は、(u,v)の動く範囲Dと同じ範囲を動く整数変数組(k,l)に対し
【数3】
【0079】
となる。この式において、左辺及び右辺第2項は空間的相関情報を表している。右辺及び左辺におけるwc uv以外の量はすべてfとgから計算でき、式全体は行列演算により解くことができる。近傍の中心においては、(p,q)=(0,0)であり、g′(u,v) =g(u ,v ,H(u,v))となるので、係数wc uvを用いて近傍画像の劣化前の中心画素のRGB値を近傍画素内の画素値だけから求めることができる。
【0080】
この原理に基づいて、補間係数計算部215では、f(p,q,c) 及びg(p,q,c) から、すべての色c=0,1,2について(2)式に従って補間係数wc uvを計算し、線形演算部216に転送する。
【0081】
線形演算部216は、平坦度評価部210から最小自乗近似部212に画像転送が行われず、従って補間係数計算部215からの係数の転送も行われない場合には、図5のフローのS1において変数mask(p,q,c) を計算した方法と同様の方法で平坦度評価部210からあらかじめ転送されていた近傍画像の各色成分に対応する位置を求め、それらの位置における平均値を近傍画像の中心画素における当該色成分の推定値とし、出力画像バッファ216の対応する画素位置に書き込む。
【0082】
一方、補間係数計算部215からの係数の転送が行われた場合には、転送された係数によって近傍画像内の画素を重みつき加算し、出力画像バッファ217の対応する画素位置に書き込む。
【0083】
これらの処理が入力画像バッファ208内の画像のすべての画素位置につき終了すると、すべての画素位置について、その近傍の幾何学的特徴に応じて当該画素における色成分の欠落と帯域劣化を最適に補正する補間係数により線形補間が行われたことになり、出力画像バッファ217には電子カメラ200の光学系による帯域劣化および色成分の欠落が補正された3色カラー画像が得られる。
【0084】
この構成においても第1実施形態と同様に種々の変形が可能である。撮像素子は単板ベイヤー配列CCD204に限らないことはいうまでもない。補間係数計算部215の計算方式にも種々のものがありうる。例えば色情報復元部213から得られた画像と帯域・色情報復元部214から得られた画像に対する各画像値の比や近傍画像全体での画素値の自乗和の比を補間係数として用いる簡便なものでもよい。
【0085】
又、第2実施形態でも第1実施形態と同様に各画素位置を包含する複数の近傍に対する補正画像が得られる。これを有効に活用するために、帯域・色情報復元部214及び色情報復元部213の作用を以下のように変更することもできる。
【0086】
帯域・色情報復元部214及び色情報復元部213はそれぞれ内部に近傍画像と同サイズ(例えば5×5画素)の画像バッファを保持し、これらのバッファでは入力画像バッファ208に電子カメラ200から画像が転送された時点で全画素値が0に初期化される。入力画像バッファ208中の画像の画素位置(x,y)に対する処理の最中には、帯域・色情報復元部214内の画像バッファには、その直前の画素位置、例えば(x−1,y)に対する処理において帯域・色情報復元部214から補間係数計算部215に出力された画像f_prev(p,q,c) が保持されている。
【0087】
画素位置(x,y)に対する処理において最小自乗近似部212から min_i 、 min_α(c) 、min _β(c) が転送されると、帯域・色情報復元部214は内部の画像バッファからf_prev(p,q,c) を読み出し、また劣化前テンプレート保持ROM211aからインデックス min_i に対応するテンプレートΨ min_i(p,q)を読み出して、近似係数 min_α(c) 、min _β(c) を用いて式
によって近傍画像に対して色成分の欠落と帯域の劣化を補正した3色画像f(p,q,c) を得、補間係数計算部215に出力する。同時に、f(p,q,c) をf_prev(p,q,c) として内部バッファに保持する。
【0088】
同様に、入力画像バッファ208中の画像の画素位置(x,y)に対する処理の最中には、色情報復元部213内の画像バッファには、その直前の画素位置(x−1,y)に対する処理において色情報復元部214から補間係数計算部215に出力された画像g_prev(p,q,c) が保持されている。画素位置(x,y)に対する処理において最小自乗近似部212から min_i 、min _α(c) 、min _β(c) が転送されると、色情報復元部214は内部の画像バッファからg_prev(p,q,c) を読み出し、また劣化前テンプレート保持ROM211aからインデックス
min_i に対応するテンプレートΦ min_i(p,q)を読み出して、近似係数 min_α(c) 、 min_β(c) を用いて式
によって近傍画像に対して色成分の欠落を補正した3色画像g(p,q,c) を得、補間係数計算部215に出力する。同時に、g(p,q,c) をg_prev(p,q,c) として内部バッファに保持する。
【0089】
この作用により、帯域・色情報復元部214及び色情報復元部213においては各回の処理結果を前回の処理結果を用いて生成するため処理結果の信頼性が高まり、補間の精度が向上する。
【0090】
この実施形態では、電子カメラ200に水晶フィルタ203がなく帯域制限がなされていない場合にも容易に対応できる。この場合はテンプレート保持ROM211が劣化前テンプレート保持ROM211aのみからなるので、最小自乗近似部212は劣化前テンプレート保持ROM211aの出力を受けて、処理結果を帯域・色情報復元部214のみに出力するようにする。同時に、色情報復元部213を取り除いて補間係数算出部215は帯域・色情報復元部214のみから信号を受信する構成にする。この場合、各部分の作用は、最小自乗近似部212ではテンプレートとしてΦiのかわりにΨiを用いる点を除いて同一である。帯域・色情報復元部214の動作は同じだが、結果として色成分の欠落は補正されるが帯域の劣化についてはなにもされない近傍補正近似画像f(p,q,c) が得られる。
【0091】
補間係数算出部215では、g(p,q,c) をf(p,q,c) と同一の画像とし、計算を進める。その結果、補間係数算出部215では単板状態の近傍画像h(p,q) の中心画素h(0,0) の欠落色成分を補正するのに適切な補間係数が得られ、その係数を用いて線形演算部216が補間を行うため、出力画像バッファ217には入力画像バッファ208内の画像の色成分の欠落が補正された3色カラー画像が得られる。
【0092】
この変形例において、さらに帯域・色情報復元部214に前述の各画素位置を包含する複数の近傍に対する補正画像を有効活用する変形例と同一の変形を行えば、帯域制限がなされていない場合にも帯域・色情報復元部214において各回の処理結果を前回の処理結果を活用して生成することにより補間の精度を向上することができる。
【0093】
以下に本発明の第3実施形態を説明する。図6は本発明の第3実施形態が適用される画像処理システムの構成を示す図である。電子カメラ300は、第2実施形態と同一の構成である。電子カメラ300内の単板ベイヤー配列CCD304の色フィルタ配列に関する情報は、第2実施形態と同様に、ベイヤー配列の規則性を利用して画像処理装置301内で計算により求められる。
【0094】
画像処理装置301は、入力画像バッファ308と、近傍読み出し部309と、テンプレート選択部310と、劣化前テンプレート保持ROM311a及び劣化後テンプレート保持ROM311bを具備するテンプレート保持ROM311と、最小自乗近似部312と、劣化後テンプレート加工部313と、帯域・色情報復元部314と、三板画像加算部315aと、単板画像加算部315bと、単板画像バッファ316と、出力画像バッファ317と、差分計算部318と、差分画像バッファ319と、規則性評価部320とを具備する。
【0095】
電子カメラ300内の画像バッファ307の出力は第2実施形態と同様に、画像処理装置301内の入力画像バッファ308に接続されるが、入力画像バッファ308は近傍読み出し部309に加えて差分計算部318にも接続される。
【0096】
近傍読み出し部309は入力画像バッファ308のほかに、差分画像バッファ319の出力を受けるべく接続され、かつ読み出した情報を規則性評価部320に出力すべく接続されている。規則性評価部320はテンプレート選択部310及び最小自乗近似部312に接続されている。テンプレート選択部310は規則性評価部320のほかに、テンプレート保持ROM311内の劣化後テンプレート保持ROM311b及び劣化前テンプレート保持ROM311aの出力を受けるべく接続され、かつ選択結果を最小自乗近似部312、帯域・色情報復元部314及び劣化後テンプレート加工部313に出力すべく接続されている。
【0097】
テンプレート保持ROM311には、上記した第1、第2実施形態と同様に、劣化前テンプレート保持ROM311aにN種の幾何学的特徴をもつ所定サイズのグレースケール画像であるテンプレートΨi(i=0〜N−1)が保持され、劣化後テンプレート保持ROM311bには、劣化前テンプレート保持ROM311aの各テンプレートが電子カメラ300の光学系による帯域劣化を受けたテンプレートΦi(i=0〜N−1)が保持されている。
【0098】
第1、第2実施形態と異なる点は、各テンプレート要素の持つ幾何学的特徴がその構造的な複雑さによって分類され、個々の要素を読み出すのに単一の整数値iではなく二つの数の組(s,i)を必要とする点である。sは構造の複雑さを表し、個々のテンプレートを平均値に対する大小で2値化した場合の連結成分の数である。例えば、一つのエッジパターンしか含まないテンプレートに対してはs=2であり、一つの線分パターンしか含まないテンプレートではs=3となる。また、iは同じ複雑度sを持つテンプレートのクラスの個々の要素にアクセスするのに用いられる。
【0099】
最小自乗近似部312の内部構成及び作用は第2実施形態におけるものと同一である。最小自乗近似部312は処理結果を帯域・色情報復元部314及び劣化後テンプレート加工部313に出力すべく接続されている。
【0100】
帯域・色情報復元部314は、最小自乗近似部312およびテンプレート選択部310の出力を受けるべく接続され、かつ復元結果を三板画像加算部315aを経て出力画像バッファ317に出力すべく接続されている。
【0101】
劣化後テンプレート加工部313は、最小自乗近似部312およびテンプレート選択部310の出力を受けるべく接続され、かつ処理結果を単板画像加算部315bを経て単板画像バッファ316に出力すべく接続されている。単板画像バッファ316は差分計算部318に記憶している情報を出力すべく接続され、差分計算部318は差分画像バッファ319に処理結果を出力すべく接続されている。
【0102】
単板画像バッファ316および出力画像バッファ317は、入力画像バッファ308内の画像と同じ大きさの三色画像を保持するほか、各画素に付きカウンタを保持する。このカウンタは、それぞれのバッファの各画素位置に書き込みが行われた回数を保持するために設けられている。
【0103】
第1実施形態と同様に、それぞれのバッファの各画素位置で複数の画素値が計算されるため、ここでは三板画像加算部315a及び単板画像加算部315bでそれらを平均化する処理を行っている。この処理に書き込み回数が必要になる。
【0104】
以下に、上記した構成を有する画像処理システムの作用を説明する。第3実施形態においても、第1、第2実施形態と同様に、電子カメラ300で撮像が行われ、光学系で帯域劣化を受け各画素位置につき一つの色成分しか持たない画像が画像バッファ307に保持される。撮像が終了すると、画像バッファ307内の画像は入力画像バッファ308に転送され、出力画像バッファ317および単板画像バッファ316のカラー画像の画素値、及びカウンタはすべて0に初期化される。
【0105】
次に、類似の処理を複数回繰り返して補正を行う。1回目の処理は入力画像バッファ308内の画像に対して行われる。この処理の結果、入力画像は複雑度の低いテンプレートを用いて近似され、同時に色成分の欠落と帯域劣化が補正された画像が出力画像バッファ317に生成される。同じく、複雑度の低いテンプレートを用いて近似された入力画像の色成分の欠落を補正し、ついでベイヤー配列でサンプリングした画像が単板画像バッファ316に生成される。
【0106】
単板画像バッファ316内の画像は入力画像を複雑度の低いテンプレートで近似したものなので入力画像の大まかな幾何学的特徴しか反映しておらず、近似誤差が生じる。この誤差が差分画像バッファ319に誤差画像として保持される。
【0107】
二回目以降は、差分画像バッファ319内の誤差画像に対して処理が行われる。誤差画像はそれまでの繰り返しに比してより複雑度の高いテンプレートを用いて近似、劣化補正され、処理結果が出力画像バッファ317に加算される。差分画像には、それまで(一回目を含む)の段階的な近似をすべて加算した近似画像と入力画像の誤差画像が出力され、再びこの誤差画像に対する処理が行われる。以下にこの処理の詳細を説明する。
【0108】
まず、1回目は、入力画像バッファ308内の画像の各画素位置(x,y)につき、以下の処理が行われる。
【0109】
近傍読み出し部309により当該画素位置(x,y)の所定の矩形領域(例えば5×5画素)が近傍画像h(p,q) として読み出される。以下の説明において、変数の組(p,q)は、この近傍画像の中心画素(x,y)に対する相対座標であり、例えば近傍の大きさが5×5であれば[−2,−1,0,1,2]×[−2,−1,0,1,2]の範囲を動く。また、場合によって色R,G,Bをそれぞれ整数値c=0,1,2に対応させて説明する。
【0110】
読み出された近傍画像は規則性評価部320に送られる。この一回目の処理では、近傍画像はなにも処理を受けずに最小自乗近似部312に転送される。同時にテンプレート選択部310に対してはテンプレート保持ROM311に保持されたテンプレートのとりうる複雑度のうち最も近い値が出力される。
【0111】
テンプレート選択部310は、規則性評価部320から出力される値を複雑度をあらわす内部変数sにセットし、内部変数テンプレート保持ROM311と他の構成要素の仲立ちを行う。テンプレート選択部310に接続している構成要素からi番目のテンプレートの読み出し要求がある場合には、テンプレート選択部310は内部変数sを用いて読み出し信号(s,i)を生成し、要求が最小自乗近似部312及び劣化後テンプレート加工部313からの場合は劣化後テンプレート保持ROM311bに、また帯域・色情報復元部314からの場合には劣化前テンプレート保持ROM311aにアクセスする。
【0112】
最小自乗近似部312は、近傍画像h(p,q) が転送されると図5に示すフローに従って処理を行い、第1、第2実施形態と同様に、近傍画像を最もよく近似する劣化後テンプレートのインデックス min_i と近似係数 min_α(c) 、min _β(c) とを算出し、劣化後テンプレート加工部313及び帯域・色情報復元部314に転送する。
【0113】
帯域・色情報復元部314における処理は、テンプレート保持ROM311へのアクセスがテンプレート選択部310を経て行われること以外は第2実施形態と同一である。帯域・色情報復元部314は近傍補正近似画像f(p,q,c) を三板画像加算部315aに転送する。
【0114】
劣化後テンプレート加工部313は、まず第2実施形態中の色情報復元部213と同様に、近傍画像h(p,q) に対して色成分の欠落のみを補正した3色画像g(p,q,c) を計算する。次に、最終的にg(p,q,c) を当該近傍における電子カメラ300の色フィルタ配置に応じてサンプリングした画像g′(p,q) を生成し、単板画像加算部315bにそれぞれ転送する。
【0115】
処理の途中では、出力画像バッファ317および単板画像バッファ316において、それぞれ各画素位置につき複数の近似画素値が得られるが、両バッファではそれらの平均近似画素値が保持され、またこれまでに得られた近似画素値の個数がカウンタに保持されるようになっている。この個数は当該画素位置にこれまでに書き込みが行われた回数に等しい。
【0116】
三板画像加算部315aでは、画像出力バッファ317の当該近傍画像に対応する領域から平均近似画素値Sf(p,q,c) およびカウンタZf(p,q) が読み出され、新しい平均近似画素値Sfnew (p,q,c) が、計算式、
によって、また新しいカウンタZfnew (p,q) の値が式
Zfnew (p,q) =Zf(p,q) +1
によって計算され、Sfnew (p,q,c) およびZfnew (p,q) が出力画像バッファ317の当該近傍画像に対応する領域に書き戻される。
【0117】
一方、単板画像加算部315bでは、単板画像バッファ316から当該近傍画像に対応する領域内の各画素の平均近似画素値Sg′(p,q) 及びカウンタZg′(p,q) が読み出され、新しい平均近似画素値Sg′new (p,q) が、計算式、
によって、また新しいカウンタZg′new (p,q) の値が
Zg′new (p,q) =Zg′(p,q) +1
によって計算され、Sg′new (p,q) およびZg′new (p,q) が単板画像バッファ316の当該近傍画像に対応する領域に書き戻される。
【0118】
入力画像バッファ308内の画像の各画素位置につき、以上の処理が終了すると、単板画像バッファ316には、入力画像バッファ308内の画像を単純なテンプレートで近似し、帯域劣化補正はせずに色成分の欠落のみの補正を行い、得られた画像をさらに単板ベイヤー配列CCD304の色フィルタ配置でサンプリングした単板状態の画像が得られる。同じく出力画像バッファ317には単純なテンプレートで近似され、欠落色復元と帯域劣化の両方の補正を受けたカラー画像が得られる。
【0119】
一回目の処理では、最後に差分計算部318が単板画像バッファ316と入力画像バッファ308の差分をとり、近似誤差を表す差分画像を差分画像バッファ319に生成する。
【0120】
二回目以降の処理では、近傍読み出し部309が以降の入力を差分画像バッファ309に切り替え、差分画像に対しこれまでの処理が繰り返される。この繰り返しで、一回目と動作が異なるのは規則性評価部320だけである。
【0121】
規則性評価部320では、転送された近似画像に対してまず分散の大きさを計算し、所定の閾値以下であれば近似誤差は十分小さいとして最小自乗近似部312への近似画像の転送を行わない。所定の閾値以上の場合は、最大値を1、最小値を0に正規化した近傍画像にラプラシアンフィルタがかけられ、得られた画像内で自乗和が算出される。自乗和が所定の閾値より大きな場合は近傍画像はノイズであるとして同じく転送を行わない。
【0122】
その他の場合は近傍画像の複雑度sを計算し、テンプレート選択部310に複雑度sを転送し、最小自乗近似部312に近傍画像を転送する。差分画像のすべての画素位置で近傍画像が最小自乗近似部312に転送されなかった場合に差分画像に対する繰り返し処理は終了する。
【0123】
この間、以前の近似で捕捉できなかった微細構造が差分画像に計算され、差分画像がその微細構造に対応した複雑度をもつテンプレートによる近似で劣化補正され、結果が出力画像バッファ317に蓄積される。その結果、出力画像バッファ317には電子カメラ300の光学系による劣化と色の欠落が補正された3色カラー画像が得られる。
【0124】
第3実施形態においても構成要素は種々の変更が考えられる。例えば、複雑度sの定義はここで上げたもの以外に微分画像の強度などいろいろな候補があげられる。規則性評価部320のノイズ判定基準も種々のものが考えられる。また、各回の処理は独立しているので、繰り返し回数に応じて近傍読み出し部309から読み出す近傍画像のサイズを小さくすることも可能である。これにより、複雑度の高いテンプレートの種類を減らすことができる。
【0125】
処理を高速化するために、複数段階の処理を一段階ですませることも可能である。この場合、三板画像加算部315a、単板画像加算部315b、単板画像バッファ316及び差分画像バッファ319は不要となり、出力画像バッファ317においてカウンタを保持する必要もなくなる。帯域・色情報復元部314は復元結果を出力画像バッファ317に直接出力し、劣化後テンプレート加工部313は差分計算部318に、また差分計算部318は規則性評価部320に処理結果を直接出力する。また、作用も以下のように変更される。
【0126】
入力画像バッファ308内の画像の各画素位置(x,y)につき、近傍読み出し部309により近傍画像h(p,q) が読み出され、規則性評価部320に送られる。規則性評価部320はテンプレート保持ROM311に保持されたテンプレートのとりうる複雑度のうち最も低い値をテンプレート選択部310に出力し、近傍画像h(p,q) を最小自乗近似部312に転送する。
【0127】
最小自乗近似部312は、テンプレート選択部310により選択された劣化後テンプレートのうち、近傍画像h(p,q) を最もよく近似するもののインデックスと近似係数とを算出し、劣化後テンプレート加工部313及び帯域・色情報復元部314に転送する。
【0128】
帯域・色情報復元部314では、近傍画像に対して色成分の欠落と帯域の劣化を補正した近傍補正近似画像f(p,q,c) を得、その中心画素の値f(0,0,c) を出力画像バッファ317の対応する画素位置に足し込む。
【0129】
一方、劣化後テンプレート加工部313は、近傍画像h(p,q) に対して色成分の欠落のみを補正した3色画像g(p,q,c) を計算し、さらにg(p,q,c) を当該近傍画像における電子カメラ300の色フィルタ配置に応じてサンプリングして画像g′(p,q) を得る。g′(p,q) は差分計算部318に転送され、近傍画像h(p,q) との差分が近傍差分画像として計算されて規則性評価部320に転送される。
【0130】
規則性評価部320は、この実施形態の2回目の処理における処理と同様に転送された近傍差分画像の複雑度を調べ、近傍差分画像がノイズとみなされない場合には算出された複雑度をテンプレート選択部310に転送し、近傍差分画像を再び最小自乗近似部312に転送する。
【0131】
これにより、各画素位置の近傍画像に対して劣化後テンプレートが複雑度の低い順に当てはめられ、当てはめ結果により近傍画像の中心画素値の色成分の欠落および帯域の劣化が補正されて出力画像バッファ317に出力される。
【0132】
また、電子カメラ300に水晶フィルタ303がなく帯域制限がなされていない場合には、テンプレート保持ROM311が劣化前テンプレート保持ROM311aのみからなり、テンプレート選択部310が劣化前テンプレート保持ROM311aと規則性評価部320のみから入力を受けるように構成を変更する。この場合、各部分の作用で従来と異なる点は、テンプレート選択部310がどの構成要素からのテンプレートの読み出し要求に対しても劣化前テンプレート保持ROM311aにアクセスすること、最小自乗近似部212はテンプレートとしてΦiのかわりにΨiを用いること、及び帯域・色情報復元部314は動作は同じだが、結果として色成分の欠落は補正されるが帯域の劣化についてはなにもされない近傍補正近似画像f(p,q,c) を出力することのみである。その結果、二回目以降の繰り返し処理が進むにつれ、入力画像のより複雑度の高い幾何学的特徴まで反映し、色成分の欠落が補正された画像が保持されるようになり、最終的に入力画像バッファ308内の画像の色成分の欠落が補正された3色カラー画像が得られる。
【0133】
以下に、本発明の第4実施形態を説明する。図7は本発明の第4実施形態が適用される画像処理システムの構成を示す図であり、図8は図7に示す最小自乗近似部412の構成及びその周辺回路を示す図である。
【0134】
図7において電子カメラ400は、図4における単板ベイヤー配列CCDが単板RGBランダム配列CCD404に置き換わっている点を除いて第2実施形態と同一の構成である。電子カメラ400内の単板RGBランダム配列CCD404の色フィルタ配列に関する情報は、図8に示すようにあらかじめ画像処理装置401内の色成分マスク生成部412aに保持されている。
【0135】
画像処理装置401は、入力画像バッファ408と、近傍読み出し部409と、劣化前テンプレート保持ROM411a及び劣化後テンプレート保持ROM411bとを具備するテンプレート保持ROM411と、最小自乗近似部412と、帯域・色情報復元部414と、画像加算部415と、三板画像バッファ417a及び単板画像バッファ417bを具備する近似画像バッファ417と、残差演算部418と、規則性判定部419と、残差加算部420と、出力画像バッファ421とを具備する。
【0136】
最小自乗近似部412は図8に示すように、色成分マスク生成部412aと、最小自乗係数算出部412bと、近似誤差累積部412cと、近似係数保持バッファ412dと、テンプレート決定部412eとを具備する。上記最小自乗近似部412はさらに、近傍読み出し部409に接続された近傍画像入力端子412rと、劣化後テンプレート保持ROM411bに接続されたテンプレート入力端子412pと、帯域・色情報復元部414に接続された近似パラメータ出力端子412sと、画像加算部415に接続された近傍近似画像出力端子412tとを有する。
【0137】
図7において電子カメラ400内の画像バッファ407は画像処理装置401内の入力画像バッファ408に接続されている。入力画像バッファ408は近傍読み出し部409及び残差演算部418に接続されている。近傍読み出し部409は図8に示す近傍画像入力端子412rを経て最小自乗近似部412内の最小自乗係数算出部412bに接続されている。
【0138】
図8において、最小自乗係数算出部412bは近傍読み出し部409のほかに、色成分マスク生成部412aと、テンプレート入力端子412p経由で劣化後テンプレート保持ROM411bとに接続され、処理結果を近似係数保持バッファ412dおよび近似誤差累積部412cに出力すべく接続されている。
【0139】
テンプレート決定部412eは近似誤差累積部412c、近似係数保持バッファ412dおよび色成分マスク生成部412aの出力を受けるべく接続され、かつ決定した内容を近傍補正近似画像出力端子412tを経て画像加算部415に、近似パラメータ出力端子412sを経て帯域・色情報復元部414に出力すべく接続されている。
【0140】
テンプレート保持ROM411は、第2実施形態と同様に、劣化前テンプレート保持ROM411aと劣化後テンプレート保持ROM411bとからなる。劣化前テンプレート保持ROM411aには、所定のN種の幾何学的特徴をもつ所定サイズのグレースケール画像であるテンプレートΨi(i=0〜N−1)が保持され、帯域・色情報復元部414に接続されている。劣化後テンプレート保持ROM411bには、劣化前テンプレート保持ROM411aの各テンプレートが電子カメラ400の光学系による帯域劣化を受けた画像であるテンプレートΦi(i=0〜N−1)が保持されている。
【0141】
図7に示すように、帯域・色情報復元部414は最小自乗近似部412及び劣化前テンプレート保持ROM411aの出力を受けるべく接続され、かつ復元結果を画像加算部415に出力すべく接続されている。画像加算部415は帯域・色情報復元部414及び最小自乗近似部412からの出力を独立に処理すべく接続され、それぞれの処理結果を近似画像バッファ417内の三板画像バッファ417a及び単板画像バッファ417bに出力する。
【0142】
三板画像バッファ417aおよび単板画像バッファ417bは、入力画像バッファ408内の画像と同じ画素数の画像を保持するほか、各画素に付きカウンタを保持する。このカウンタは、それぞれのバッファの各画素位置に書き込みが行われた回数を保持するために設けられている。第1実施形態と同様に、それぞれのバッファの各画素位置で複数の画素値が計算されるため、ここでは画像加算部415でそれらを平均化する処理を行っている。この処理に書き込み回数が必要になる。
【0143】
単板画像バッファ417bは記憶している内容を残差演算部418及び規則性判定部419を経て残差加算部420に出力すべく接続されている。一方、三板画像バッファ417aは記憶した内容を残差加算部420に直接出力すべく接続されている。残差加算部420は処理結果を出力画像バッファ421に出力すべく接続されている。
【0144】
以下に、上記した構成を有する画像処理システムの作用を説明する。
【0145】
電子カメラ400により撮像された被写体像は、第1〜第3実施形態と同様に、レンズ402、水晶フィルタ403により帯域制限を受け、劣化した光学像として単板RGBランダム配列CCD404上に形成される。単板RGBランダム配列CCD404は各画素につき劣化画像のRGBのいずれか一つの色情報を取得し、得られた画像をA/D変換部405を経てデジタル画像信号として画像バッファ407に転送する。撮像が終了すると、画像バッファ407内の画像情報は画像処理装置401内の入力画像バッファ408に転送され、さらに三板画像バッファ417a及び単板画像バッファ417bの画素値及びカウンタはすべて0に初期化される
その後、画像処理装置401では入力画像バッファ408内の画像情報の各画素位置(x,y)ごとに以下の処理が行われる。
【0146】
近傍読み出し部409により処理画素位置を中心とする所定の矩形領域(例えば5×5画素)が近傍画像 h(p,q) として読み込まれ、最小自乗近似部412内の最小自乗係数算出部412bに転送される。以下の説明において、変数の組(p,q)は、この近傍画像の中心画素(x,y)に対する相対座標であり、例えば近傍の大きさが5×5であれば[−2,−1,0,1,2]×[−2,−1,0,1,2]の範囲を動く。また、場合によって色R,G,Bをそれぞれ整数値c=0,1,2に対応させて説明する。
【0147】
最小自乗係数算出部412bは、劣化後テンプレート保持ROM411bに予め記憶されているテンプレートΦi(p,q) (i=0〜N−1)を順に読み出し、転送された近傍画像h(p,q) の各色成分c(c=0,1,2)について、順に近似誤差
【数4】
【0148】
を最小化する近似係数α(c) 、β(c) を計算する。
【0149】
ここで、mask(p,q,c) は、単板RGBランダム配列CCD404上で、当該近傍画像内の座標(p,q) に対応する位置に色成分cに対応する色フィルタが存在すれば1、しなければ0をとるマスクであり、色成分マスク生成部412aにより算出される。図3は近傍画像における特定の色フィルタ配置に対応する色成分マスクを例示したものである。
【0150】
近似誤差e(c) は近似誤差累積部412cに出力され、近似誤差累積部412cでは近似誤差e(c) を全色成分について累積加算し、累積近似誤差eとしてテンプレート決定部412eに転送する。また、近似係数α(c) 、β(c) (c=0,1,2)は近似係数保持バッファ412dに順に出力され、そこに保持される。
【0151】
テンプレート決定部412eには、それ以前のテンプレートΦi′(p,q)(i′<i)に対する累積近似誤差の最小値 min_e と最小値を与えたテンプレートのインデックス min_i が保持されている。テンプレート決定部412eは、近似誤差累積部412cから転送された誤差eを、内部に保持する誤差の最小値 min_e と比較し、新たな誤差がより小さければ min_e をeに、また min_i をiに更新する。
【0152】
テンプレート決定部412eはまた誤差の最小値を与えるテンプレートに関する近似係数もこれらを min_α(c) および min_β(c) (c=0,1,2)として保持しており、 min_e の更新と同時にこれらの値も近似係数保持バッファ412dから読み込まれた近似係数α(c) 、β(c) にそれぞれ更新される。
【0153】
全ての劣化後テンプレートΦiが処理された後、テンプレート決定部412eに保持された近似係数 min_α(c) 、min _β(c) (c=0,1,2)とインデックスmin _i が帯域・色情報復元部414に出力される。同時に、テンプレート決定部412eはまず式g(p,q,c) = min_α(c) Φ min_i(p,q)+ min_β(c) によって当該近傍画像h(p,q) の色成分の欠落を補正した画像g(p,q,c) を計算する。
【0154】
次に色成分マスク生成部412aにより算出されたmask(p,q,c) を用いてカラー画像g(p,q,c) を当該近傍画像における電子カメラ400の色フィルタ配置に応じてサンプリングし、単板状態の画像g′(p,q) を得て、画像加算部415に転送する。
【0155】
帯域・色情報復元部414は、転送されたインデックス min_i に対応する劣化前テンプレートΨ min_i を劣化前テンプレート保持ROM411aから読み出し、転送された近似係数 min_α(c) 、min _β(c) (c=0,1,2)を用いて、近傍画像h(p,q) の色成分の欠落を補正し、さらに帯域の劣化も補正した近傍補正近似画像f(p,q,c) をf(p,q,c) = min_α(c) Ψ min_i(p,q)+ min_β(c) (c=0,1,2)により計算し、画像加算部415に転送する。
【0156】
処理の途中では、三板画像バッファ417aおよび単板画像バッファ417bにおいて、それぞれ各画素位置につき複数の近似画素値が得られるが、両バッファではそれらの平均近似画素値が保持され、またこれまでに得られた近似画素値の個数がカウンタに保持されるようになっている。これは、当該画素位置にこれまでに書き込みが行われた回数に等しい。
【0157】
画像加算部415では、帯域・色情報復元部414からf(p,q,c) が転送されると、三板画像バッファ417aから当該近傍画像に対応する領域内の各画素の平均近似画素値Sf(p,q,c) 及びカウンタZf(p,q) を読み出し、新しい平均近似画素値Sfnew (p,q,c) を、計算式
によって、また新しいカウンタZfnew (p,q) の値を式
Zfnew (p,q) =Zf(p,q)+1
によって計算し、Sfnew (p,q,c) およびZfnew (p,q) を三板画像バッファ417aの当該近傍画像に対する領域に書き戻す。
【0158】
一方、画像加算部415にテンプレート決定部412eからg′(p,q) が転送されると、画像加算部415は単板画像バッファ417bから当該近傍画像に対応する領域内の各画素の平均近似画素値Sg′(p,q) 及びカウンタZg′(p,q) を読み出し、新しい平均近似画素値Sg′new (p,q) を、計算式
によって、新しいカウンタZg′new (p,q) の値を
Zg′new (p,q) =Zg(p,q)+1
によって計算し、Sg′new (p,q) およびZg′new (p,q) を単板画像バッファ417bの当該近傍画像に対応する領域に書き戻す。
【0159】
入力画像バッファ408内の画像の各画素位置につき、以上の処理が終了すると、単板画像バッファ417bには、入力画像バッファ408内の画像をテンプレートで近似し、色成分の欠落を補正した後に再び単板RGBランダム配列CCD404の色フィルタ配置でサンプリングした単板状態の近似画像が得られる。同じく三板画像バッファ417aにはテンプレートで近似され、色成分欠落と帯域劣化の補正を受けたカラー画像が得られる。
【0160】
さらに、近似画像バッファ417内の画像に対して以下の処理が行われる。
【0161】
残差演算部418は、入力画像バッファ408内の画像の各画素位置(x,y)につき、その画素位置を中心とする所定の大きさの近傍画像h(p,q) を読み出す。同時に、単板画像バッファ417bから当該近傍画像の領域に対応する画像を読み出し、h(p,q) との差を計算し、残差画像d(p,q) として規則性判定部419に出力する。
【0162】
規則性判定部419は、入力した残差画像d(p,q) が規則的構造を有する画像であるか否かを第3実施形態と同様の判定基準で評価する。まずd(p,q) を最大値1、最小値0に正規化し、ラプラシアンフィルタをかける。その結果を画像全体で自乗和し、所定の閾値と比較する。閾値を下回る場合は規則的構造を有すると判定し、残差画像の中心画素の値d(0,0) を残差加算部420へ出力する。閾値を上回る場合はなにも転送しない。
【0163】
残差加算部420は、三板画像バッファ417aから入力画像バッファ408内の位置(x,y)に対応する位置の画素値Sf(0,0,c) (c=0,1,2)を読み出す。規則性判定部419から値d(0,0) が転送されてきた場合には、d(0,0) から3色分の画素値d′(0,0,c) を生成し、Sf(0,0,c) と各色c=0,12ごとに加算する。ここで、入力画像バッファ408内の位置(x,y)に対応する単板RGBランダム配列CCD404上の位置に存在する色フィルタの色をc′とすると、d′(0,0,c) はd(0,0) から以下の式で計算される。
【0164】
d′(0,0,c) =d(0,0) (c=c′の時)
【数5】
【0165】
すべての位置(x,y)についてこの処理が終了すると、各画素位置でその近傍の幾何学的特徴にテンプレート保持ROM411内のテンプレートが対応できる範囲で色成分の欠落と帯域劣化が補正され、さらに対応できない微細構造が輝度成分に反映されることにより、出力画像バッファ421に電子カメラ400の光学系による劣化と色の欠落が補正された3色カラー画像が得られる。
【0166】
電子カメラ400に水晶フィルタ403がなく帯域制限がなれていない場合には、テンプレート保持ROM411が劣化前テンプレート保持ROM411aのみからなり、最小自乗近似部412内の最小自乗係数算出部412bが劣化前テンプレート保持ROM411aから入力を受けるように構成を変更する。この場合、各部分の作用で特徴となるのは、最小自乗近似部412でテンプレートとしてΦiのかわりにΨiを用いる点と、帯域・色情報復元部414の動作は同じだが、結果として色成分の欠落は補正されるが帯域の劣化についてはなにもされない近傍補正近似画像f(p,q,c) が得られる点のみである。その結果、入力画像バッファ408内の画像の色成分の欠落のみが補正された3色カラー画像が出力画像バッファ421に得られる。
【0167】
処理を高速化するために、近似画像バッファ417を設けない構成も可能である。この場合、最小自乗近似部412は残差演算部418に直接出力し、帯域・色情報復元部414は残差加算部420に直接出力するため、画像加算部415も不要となる。作用としては、入力画像バッファ408の各画素位置(x,y)につき、残差演算部418が最小自乗近似部412から転送された単板状態の画像g′(p,q) と画素位置(x,y)を中心とする近傍画像h(p,q) の差分を計算して規則性判定部419に転送することと、帯域・色情報復元部414が算出したf(p,q,c) の中心画素値f(0,0,c) のみを残差加算部420に転送すること、および残差加算部420ではSf(0,0,c) の代わりに帯域・色情報復元部414から転送されたf(0,0,c) を用いてd′(0,0,c) を計算すること、の三点のみが上記した第4実施形態と異なる点である。これにより、補正の精度は落ちるが記憶容量が少なく、より高速な処理が可能になる。
【0168】
以下に、本発明の第5実施形態を説明する。図9は本発明の第5実施形態が適用される画像処理システムの構成を示す図であり、電子カメラ500と画像処理装置501とからなる。
【0169】
本実施形態の電子カメラ500では帯域制限のために設けられていた水晶フィルタ203が設けられていない点を除けば第2実施形態における電子カメラ200と同一の構成である。電子カメラ500内の画像バッファ507の出力は、第3実施形態と同様に画像処理装置501内の入力画像バッファ508に接続され、入力画像バッファ508は近傍読み出し部509及び差分計算部518に接続されている。
【0170】
画像処理装置501は、入力画像バッファ508と、近傍読み出し部509と、テンプレート選択部510と、テンプレート保持ROM511と、最小自乗近似部512と、単板画像生成部513と、色情報復元部514と、三板画像加算部515aと、単板画像加算部515bと、単板画像バッファ516と、出力画像バッファ517と、差分計算部518と、差分画像バッファ519と、規則性評価部520と、テンプレート生成部521とを具備する。
【0171】
図9において、近傍読み出し部509は入力画像バッファ508および差分画像バッファ519の出力を受けるべく接続され、かつ読み出した情報を規則性評価部520に出力すべく接続されている。規則性評価部520はテンプレート生成部521、三板画像加算部515aおよび最小自乗近似部512に接続されている。最小自乗近似部512は第2実施形態における構成と同一の構成であり、テンプレート選択部510と規則性評価部520の出力を受けるべく接続され、かつ処理結果を単板画像生成部513及び色情報復元部514に出力すべく接続されている。テンプレート選択部510はテンプレート保持ROM511及びテンプレート生成部521の出力を受けるべく接続され、かつ選択結果を単板画像生成部513及び色情報復元部514に出力すべく接続されている。
【0172】
入力画像に水晶フィルタによる帯域劣化がないのでテンプレート保持ROM511にはこれまでの実施形態と異なり帯域制限の劣化前と劣化後のテンプレートを保持しない。そのかわり、所定のN種の幾何学的特徴をもつ所定サイズのグレースケール画像がテンプレートΦi(i=0〜N−1)として保持される。ここで、レンズ502による帯域劣化は通常、少ないとして無視している。
【0173】
色情報復元部514は三板画像加算部515aを経て出力画像バッファ517に接続されている。単板画像生成部513は単板画像加算部515bを経て単板画像バッファ516に接続されている。単板画像バッファ516は差分計算部518に記憶内容を出力すべく接続され、差分計算部518は差分画像バッファ519に処理結果を出力すべく接続されている。
【0174】
単板画像バッファ516および出力画像バッファ517は、入力画像バッファ508内の画像と同じ画素数の画像を保持するが、その他に各画素につきカウンタを保持する。このカウンタは、それぞれのバッファの各画素位置に書き込みが行われた回数を保持するために設けられてる。第3実施形態と同様にそれぞれのバッファの各画素位置で複数の画素値が計算されるため、最終的にそれらを平均化する処理を行っている。この処理に書き込み回数が必要になる。
【0175】
以下に、上記した構成を有する画像処理システムの作用を説明する。
【0176】
電子カメラ500で撮像が行われ、レンズ502による帯域劣化しか含まず、各画素位置につき一つの色成分しか持たない画像がこれまでの実施形態と同様に画像バッファ507に保持される。撮像が終了すると、画像バッファ507内の画像は入力画像バッファ508に転送され、出力画像バッファ517および単板画像バッファ516のカラー画像の画素値、及びカウンタはすべて0に初期化される。次に、2段階で補正処理が行われる。1回目の処理では、入力画像バッファ508内の画像の各画素位置(x,y)につき、以下の処理が行われる。
【0177】
近傍読み出し部509により当該画素位置(x,y)の所定の矩形領域(例えば7×7画素)が近傍画像h(p,q) として読み出される。以下の説明において、変数の組(p,q)は、この近傍画像内の中心画素(x,y)に対する相対座標であり、例えば近傍の大きさが7×7であれば[−3,−2,−1,0,1,2,3]×[−3,−2,−1,0,1,2,3]の範囲を動く、また、場合によって色R,G,Bをそれぞれ整数値c=0,1,2に対応させて説明する。
【0178】
読み出された近傍画像は規則性評価部520に送られるが、そこではなにも処理を受けずに最小自乗近似部512に転送される。テンプレート生成部521には1回目の処理ではなにも転送しない。
【0179】
テンプレート生成部521は、近傍画像が転送されてくるとその画像をグレースケール画像とみなしてエッジを保ったまま平滑化し、新たなテンプレートを作成しテンプレート選択部510に転送する機能を持つが、1回目の処理にはなにもしない。
【0180】
テンプレート選択部510では、接続している他の構成要素からi番目のテンプレートの読み出し要求があった場合には、テンプレート生成部521からテンプレートが転送されてきている場合はそのテンプレートを返し、なにも転送されていない場合はテンプレート保持ROM511からi番目のテンプレートΦiを読み出す機能を持つ。1回目の処理では、テンプレート生成部521からなにも転送されないのでテンプレート保持ROM511にアクセスすることになる。
【0181】
最小自乗計数算出部512は、近傍画像が転送されると図5に示されたフローに従って処理を行い、これまでの実施形態と同様に近傍画像を最もよく近似するテンプレートのインデックス min_i と近似係数 min_α(c) 、 min_β(c) とを算出し、単板画像生成部513と色情報復元部514に転送する。
【0182】
色情報復元部514では、画素ごとの色成分の欠落を修復するために、式
g(p,q,c) = min_α(c) Φ min_i(p,q)+ min_β(c) (c=0,1,2)
に従って、近傍画像h(p,q) の色成分の欠落を近似的に埋めた3色画像g(p,q,c) を生成し、三板画像加算部515aに転送する。
【0183】
単板画像生成部513では、色情報復元部514と同様に近傍画像h(p,q) の色成分の欠落を近似的に埋めた3色画像g(p,q,c) を計算するが、さらにg(p,q,c) を当該近傍画像における電子カメラ500の色フィルタ配置に応じてサンプリングした画像g′(p,q) を生成する。そして、g′(p,q) を単板画像加算部515bに転送する。
【0184】
処理の途中では、出力画像バッファ517および単板画像バッファ516において、それぞれ各画素位置につき複数の近似画素値が得られるが、両バッファではそれらの平均近似画素値が保持され、またこれまでに得られた近似画素値の個数(=書き込み回数)がカウンタに保持されるようになっている。
【0185】
三板画像加算部515aでは、画像出力バッファ517から当該近傍画像に対応する領域内の各画素の平均近似画素値Sg(p,q,c) 及びカウンタZg(p,q) が読み出され、転送されたg(p,q,c) を用いて新しい平均近似画素値Sgnew (p,q,c) が計算式
によって計算され、また新しいカウンタZgnew (p,q) の値が式
Zgnew (p,q) =Zg(p,q) +1
によって計算され、Sgnew (p,q,c) およびZgnew (p,q) が画像出力バッファ517の当該近傍画像に対応する領域に書き戻される。
【0186】
一方、単板画像加算部515bでは、三板画像加算部515aと同様に単板画像バッファ516の当該近傍画像に対応する領域から平均近似画素値Sg′(p,q) 及びカウンタZg′(p,q) が読み出され、転送されたg′(p,q) を用いて新しい平均近似画素値Sg′new (p,q) が計算式
によって計算され、また新しいカウンタZg′new (p,q) の値が
Zg′new (p,q) =Zg′(p,q) +1
によって計算され、Sg′new (p,q) およびZg′new (p,q) が単板画像バッファ516の当該近傍画像に対応する領域に書き戻される。
【0187】
入力画像バッファ508内の画像の各画素位置につき、以上の処理が終了すると、単板画像バッファ516には、入力画像バッファ内508の画像をテンプレート保持ROM511内のテンプレートで近似し、色成分の欠落を補正した後、さらに単板ベイヤー配列CCD504の色フィルタ配置でサンプリングした状態の画像が得られる。同じく出力画像バッファ517にはテンプレート保持ROM511内のテンプレートで近似され、色成分の欠落が補正されたカラー画像が得られる。1回目の処理の最後に、差分計算部518は単板画像バッファ516と入力画像バッファ508の差分をとり、近似誤差を表す差分画像を差分画像バッファ519に出力する。
【0188】
2回目の処理では、入力画像バッファ508の各画素位置(x,y)につき、以下の処理を行う。
【0189】
近傍読み出し部509により当該画素位置(x,y)を中心とする一回目と同じサイズの矩形領域が再び近傍画像h(p,q) として読み出される。同時に、差分画像バッファ519の近傍画像に対応する領域が差分近傍画像d(p,q) として読み出される。二つの画像は規則性評価部520に転送される。
【0190】
規則性評価部520では、1回目の処理と異なり差分近傍画像d(p,q) の規則性を調べる。評価の基準には、画像を最大値1、最小値0に正規化した画像にラプラシアンフィルタをかけ、その結果について画像全体に対する自乗和をとった値をノイズ尺度として利用する。d(p,q) に対するノイズ尺度L1を求め、さらにホワイトノイズからなる画像に対してどの程度規則的かを判断するために、各画素値が最大値1、最小値0、平均値0.5の白色雑音を生じる乱数により生成されたd(p,q) と同一サイズの画像に対してあらかじめ計算したノイズ尺度L0を用いて、相対ノイズ尺度Lを式L=(1−L1/L0)により算出する。
【0191】
相対ノイズ尺度Lは、0〜1の範囲でd(p,q) の規則性を表す。Lが所定の閾値以下であれば、d(p,q) はノイズであるとしてなにもしない。所定の閾値以上であれば、d(p,q) をテンプレート生成部521に転送し、h(p,q) を最小自乗近似部512に転送し、また、相対ノイズ尺度Lを三板画像加算部515aに転送する。
【0192】
テンプレート生成部521は、1回目の処理とは異なり、転送されたd(p,q) をグレースケール画像とみなしてエッジを保ったまま平滑化し、新たなテンプレートΦ′(p,q) を作成しテンプレート選択部510に転送する。
【0193】
テンプレート選択部510では、転送されたテンプレートΦ′(p,q) を新たなテンプレート集合に設定し、以後他の構成要素からテンプレートの読み出し要求があった場合、Φ′(p,q) を返す。
【0194】
最小自乗係数算出部512は、近傍画像h(p,q) が転送されると1回目と同様の処理を行い、近傍画像h(p,q) を最もよく近似するテンプレートのインデックス min_i と近似係数 min_α(c) 、 min_β(c) とを算出し、色情報復元部514のみに転送する。ただし、最小自乗係数算出部512が読み出すテンプレートはテンプレート選択部510によってΦ′(p,q) の一つに限られているので、 min_α(c) 、 min_β(c) は、テンプレートΦ′(p,q) で近傍画像h(p,q) を近似する場合の最適な近似係数を意味する。
【0195】
色情報復元部514における処理は、1回目の処理と異なり、近傍画像h(p,q) の中心画素h(0,0) における欠落色成分の回復のみを行う。具体的には、式
g(0,0,c) = min_α(c) Φ′(p,q) + min_β(c) (c=0,1,2)
に従って、h(0,0) に対応する色成分の回復された画素値g(0,0,c) (c=0,1,2)を生成し、三板画像加算部515aに転送する。
【0196】
出力画像バッファ517の近傍画像h(p,q) に対応する領域内の各画素では、1回目の処理でテンプレート保持ROM511内のテンプレートにより近似されて求められた3色の画素値Sg(p,q,c) (c=0,1,2)が保持されている。三板画像加算部515aでは、画像出力バッファ517の近傍画像h(p,q) の中心画素の位置に対応する位置の画素値Sg(0,0,c) (c=0,1,2)を読み出し、規則性評価部520から転送されてきた相対ノイズ尺度Lを用いて、以前の近似結果Sg(0,0,c) と二回目の近似結果g(0,0,c) の重み付き和をとる。式
Sgnew (0,0,c) =(1−L)・Sg(0,0,c) +L・g(0,0,c) (c=0,1,2)
により当該画素位置の新しい値Sgnew (0,0,c) (c=0,1,2)を計算し、画像出力バッファ517に書き戻す。入力画像バッファの各画素位置につき、2回目の処理が終了すると、出力画像バッファ517には色成分の欠落が回復された3色カラー画像が得られる。
【0197】
以下に本発明の第6実施形態を説明する。図10〜12は第6実施形態を説明するための図であり、図10は本実施形態が適用される画像処理システムの構成を示す図であり、図11は図10中合成最小自乗近似部612の詳細図であり、図12は図10中合成最小自乗近似部612の作用の説明図である。
【0198】
図10において、本実施形態の画像処理システムは電子カメラ600と画像処理装置601とからなり、電子カメラ600は、第4実施形態における電子カメラ400と同一の構成である。電子カメラ600内の画像バッファ607は画像処理装置601内の入力画像バッファ608に接続されている。電子カメラ600内の単板RGBランダム配列フィルタCCD604の色フィルタ配置に関する情報は第4実施形態と同様にあらかじめ画像処理装置601内の色成分マスク生成部612aに保持されている。
【0199】
画像処理装置601は、入力画像バッファ608と、近傍読み出し部609と、劣化前テンプレート保持ROM611a及び劣化後テンプレート保持ROM611bを具備するテンプレート保持ROM611と、合成最小自乗近似部612と、帯域・色情報復元部614と、三板画像加算部615と、出力画像バッファ616とを具備する。
【0200】
また、図10に示す合成最小自乗近似部612は、図11に示すように、色成分マスク生成部612aと、最小自乗係数算出部612bと、近似誤差累積部612cと、近似係数保持バッファ612dと、テンプレート決定部612eと、近傍画像バッファ612fと、テンプレート累積部612gと、テンプレート合成部612hと、最小自乗係数算出部612iと、近似誤差累積部612jと、近似係数保持バッファ612kとを具備する。この合成最小自乗近似部612はさらに近傍画像入力端子612rと、テンプレート入力端子612pと、近似パラメータ出力端子612sとを有している。
【0201】
入力画像バッファ608は近傍読み出し部609に接続され、近傍読み出し部609は近傍画像入力端子612rを経て合成最小自乗近似部612内の近傍画像バッファ612fに接続されている。合成最小自乗近似部612は、テンプレート入力端子612pを介して劣化後テンプレート保持ROM611bに接続されるとともに、近似パラメータ出力端子612sを介して帯域・色情報復元部614に接続されている。
【0202】
テンプレート保持ROM611の構成と、テンプレート保持ROM611、帯域・色情報復元部614、三板画像加算部615および出力画像バッファ616間の接続関係は、第1実施形態と同一である。
【0203】
本実施形態では、第1実施形態と同様に、処理中に各画素につき複数の補正値が計算されるため、それらを各補正値の信頼性に基づいて重みつき平均する。そのため、出力画像バッファ616は、各画素位置において画像データ以外に重みつき平均の計算に必要な信頼値を保持する。
【0204】
合成最小自乗近似部612内の近傍画像バッファ612fは近傍画像入力端子612rを介して近傍読み出し部609の出力を受けるべく接続され、かつ記憶している情報を最小自乗係数算出部612b及び612iに出力すべく接続されている。最小自乗係数算出部612bは近傍画像バッファ612fのほかに、色成分マスク生成部612a及びテンプレート入力端子612p経由で劣化後テンプレート保持ROM611bの出力を受けるべく接続され、かつ処理結果を近似係数保持バッファ612d及び近似誤差累積部612cに出力すべく接続されている。
【0205】
テンプレート累積部612gは近似係数保持バッファ612d及び近似誤差累積部612cの出力を受けるべく接続され、かつ累積結果をテンプレート合成部612hに出力すべく接続されている。テンプレート合成部612hは合成結果を最小自乗係数算出部612iおよびテンプレート決定部612eに出力すべく接続されている。
【0206】
最小自乗係数算出部612iはテンプレート合成部612hのほかに、色成分マスク生成部612a及び近傍画像バッファ612fの出力を受けるべく接続され、かつ処理結果を近似係数保持バッファ612k及び近似誤差累積部612jに出力すべく接続されている。近似係数保持バッファ612k及び近似誤差累積部612jは共にテンプレート決定部612eに接続され、テンプレート決定部612eは近似パラメータ出力端子612sを経て帯域・色情報復元部614に接続されている。
【0207】
以下に上記した構成の画像処理システムの作用を説明する。
【0208】
電子カメラ600により撮像された被写体像は、これまでの第1乃至第4実施形態と同様に、レンズ602、水晶フィルタ603により帯域制限を受け、劣化した光学像として単板RGBランダム配列CCD604上に形成される。単板RGBランダム配列CCD604は各画素につき劣化画像のRGBのいずれか一つの色情報を取得し、得られた画像をA/D変換部605を経てデジタル画像信号として画像バッファ607に転送する。撮像が終了すると、画像バッファ607内の画像情報は画像処理装置601内の入力画像バッファ608に転送され、さらに出力画像バッファ616の画素値及び信頼値はすべて0に初期化される。
【0209】
その後、入力画像バッファ608内の画像情報の各画素位置(x,y)ごとに以下の処理が行われる。
【0210】
近傍読み出し部609により処理画素位置(x,y)を中心とする所定の矩形領域(例えば5×5画素)が近傍画像h(p,q) として読み出され、合成最小自乗近似部612に転送される。以下の説明において、変数の組(p,q)は、この近傍画像の中心画素(x,y)に対する相対座標であり、例えば近傍の大きさが5×5であれば[−2,−1,0,1,2]×[−2,−1,0,1,2]の範囲を動く、また、場合によって色R,G,Bをそれぞれ整数値c=0,1,2に対応させて説明する。
【0211】
近傍読み出し部609で読みだされた近傍画像h(p,q) は、合成最小自乗近似部612内の近傍画像バッファ612fに転送される。近傍画像バッファ612fにh(p,q) が転送されると、その一方で単板RGBランダム配列CCD604上で、当該近傍画像内の座標(p,q) に対応する位置に色成分cに対応する色フィルタが存在すれば1、存在しなければ0をとる変数mask(p,q,c) が色成分マスク生成部612aにより算出され、その内部に保持される。図3は近傍画像におけるある特定の色フィルタ配置に対応する色成分マスクを例示したものである。
【0212】
最小自乗係数算出部612bは、劣化後テンプレート保持ROM611bに予め記憶されているテンプレートΦi(p,q) (i=0〜N−1)を順に読み出し、近傍画像バッファ612fより転送された近傍画像h(p,q) の各色成分c(c=0,1,2)について、変数mask(p,q,c) を用いて、順に近似誤差
【数6】
【0213】
を最小化する近似係数α(c) 、β(c) を計算する。
【0214】
近似誤差e(c) は近似誤差累積部612cに出力され、近似誤差累積部612cでは近似誤差e(c) を全色成分について累積加算し、累積近似誤差eとしてテンプレート累積部612gに転送する。また、近似係数α(c) 、β(c) (c=0,1,2)は近似係数保持バッファ612dに順に出力され、そこに保持される。テンプレート累積部612gには、N行のテーブルTが保持される。
【0215】
図12は合成最小自乗近似部の作用を説明するための図であり、(a)は任意の近傍画像を示し、(b)は0からN−1までのN個のテンプレートを示し、(c)はテーブルTであり、(d)はソート後のテーブルTであり、(e)は集合Vであり、(f)は変数Uであり、(g)は合成テンプレートである。
【0216】
図12(c)に示すようにテーブルTには、それまでの各テンプレートΦi′(p,q)(i′<i)のインデックスi′、Φi′(p,q) に対応する累積近似誤差、および近似係数が(i′+1)番目の行に登録されている。図12(c)では図12(a)に示す近傍画像h(p,q) を図12(b)のテンプレートΦi(p,q) で近似した場合が例示してある。
【0217】
テンプレート累積部612gは、近似誤差累積部612cから累積近似誤差eが転送されると、近似係数保持バッファ612dに保持された近似係数α(c) 、β(c) (c=0,1,2)を読み出し、i,eとともにテーブルTの(i+1)番目の行に書き込む。
【0218】
最小自乗係数算出部612bがすべてのΦi(i=0〜N−1)について処理を終えると、テンプレート合成部612hはテンプレート累積部612gに保持されたテーブルTを用いて以下の手順で新たにテンプレート集合を構成する。
【0219】
まず、N個の内部変数mark(i) (i=0〜N−1)とカウンタ total_markをすべて0に初期化する。次に、テーブルTの行を図12(d)に示すように累積近似誤差の小さな順に並べ替え、最も累積近似誤差の小さな行に対応するテンプレートインデックスをk′とする。図12(d)においては、k′は3となっている。同時に、k′に対応する近似係数をαm(c) 、βm(c) (c=0,1,2)とする。さらに、mark(k′) を1、total _markを1に設定する。
【0220】
以後、並べ替えた行の順番に各行を読みこみ、累積近似誤差が所定の閾値より小さい場合には、その行の近似係数値を変数α(c) 、β(c) に読み出してそれぞれαm(c) 、βm(c) との差の絶対値eα,eβをとる。αm(c) とα(c) が同符号かつeαおよびeβが所定の閾値より小さな場合についてのみ、その行のテンプレートインデックスkを用いてmark(k) を1に設定し、 total_markを1増やす。 total_markが所定の上限値M′に達するか、全ての行に対しこの処理が完了すれば繰り返しは終了する。
【0221】
この処理が終了すると、図12(e)に示すようにmark(k) が1となっているテンプレートインデックスkの集合Vが構成されたことになる。整数集合Vの各要素は、最も累積近似誤差が小さかったテンプレートk′と近似誤差の生じ方が似ておりかつ近似誤差が十分小さいテンプレートのインデックスである。
【0222】
続いて、Vから要素数が所定の個数の部分集合をすべて作り、図12(f)に示すように各部分集合を値とする変数U(j) (j=0〜M−1)に登録する。図12(f)においては各部分集合の要素数は2である。ここで、Mは条件を満たす部分集合の総数である。さらに、変数U(j) に対して合成テンプレートΦ′j(p,q) を以下の式に従って構成する。
【0223】
【数7】
【0224】
この式において、kは整数集合U(j) に含まれるすべての整数値を取る。関数maxはすべてのkに関する引数の最大値を計算する。正実数λ(j,k) と正実数μ(j,k) はλ(j,k) Φk(p,q) +μ(j,k) を最大値1、最小値0に正規化するための正規化変数である。
【0225】
図12(g)に合成テンプレートΦ′j(p,q) を例示している。変数
【数8】
【0226】
はΦ′j(p,q) とともにテンプレート合成部612hに保持される。ここで、j=0〜M−1である。
【0227】
テンプレート合成部612hの処理が完了すると、最小自乗係数算出部612iはテンプレート合成部612hから順にテンプレートΦ′j(p,q) (j=0〜M−1)を読み出し、最小自乗係数算出部612bと同様に近傍画像バッファ612fから転送された近傍画像h(p,q) の各色成分c(c=0,1,2)について、順に近似誤差
【数9】
【0228】
を最小化する近似係数α′(c) 、β′(c) を計算し、近似誤差累積部612jに近似誤差e′(c)を出力する。近似誤差累積部612jでは近似誤差e′(c) を全色成分について累積加算し、累積近似誤差e′=e′(0) +e′(1) +e′(2) をテンプレート決定部612eに転送する。近似係数α′(c) 、β′(c) (c=0,1,2)は近似係数保持バッファ612kに順に出力され、保持される。
【0229】
テンプレート決定部612eには、それ以前のテンプレートΦ′j ′(p,q) (j′<j)に対する誤差の最小値 min_e ′と最小値を与えたインデックス min_j が保持されている。テンプレート決定部612eは、近似誤差累積部612dから転送された誤差e′を内部に保持する誤差の最小値 min_e ′と比較し、新たな誤差がより小さければ min_e ′をe′に、 min_j をjに更新する。
【0230】
また、テンプレート決定部612eは誤差の最小値を与えるテンプレートに関する近似係数をもこれらを min_α′(c) および min_β′(c) (c=0,1,2)として保持しており、 min_e ′の更新と同時にこれらの値も近似係数保持バッファ612kから読み込まれた近似係数α′(c) 、β′(c) にそれぞれ更新される。
【0231】
最小自乗係数算出部612iで全てのテンプレートΦ′j(p,q) が処理された後、テンプレート決定部612eは誤差の最小値 min_e ′を与えたインデックス min_j を用いてテンプレート合成部612hの内部変数
【数10】
【0232】
同時に、近似誤差誤差の最小値 min_e ′に反比例する近似評価値A′をA′=1/(1+ min_e ′)により計算する。そして、
【数11】
【0233】
およびA′を帯域・色情報復元部614に転送する。
【0234】
帯域・色情報復元部614は、転送された整数の集合U(min_j)に含まれるすべての整数kに対し、対応する劣化前のテンプレートΨk(p,q) を劣化前テンプレート保持ROM611aから読み出し、転送された係数
【数12】
【0235】
を用いて以下の式から近傍画像の劣化前の画像を近似する近傍補正近似画像f(p,q,c) を得る。
【0236】
【数13】
【0237】
そして、f(p,q,c) を近似評価値A′とともに三板画像加算部615に転送する。
【0238】
処理の途中では、出力画像バッファ616の各画素位置にこれまでの処理で得られた複数の補正画素値の平均値と信頼値が保持されるようになっている。三板画像加算部615は、出力画像バッファ616から当該近傍画像に対応する領域の補正画素値の平均値Sf(p,q,c) と信頼値Q(p,q,c) を読み出し、これらと帯域・色情報復元部614から転送された近傍補正近似画像f(p,q,c) 及び近似評価値A′から、新たな補正画素値の平均値Sfnew (p,q,c) および信頼値Qnew (p,q) を式
により計算し、Sfnew (p,q,c) 及びQnew (p,q) を出力画像バッファ616の当該近傍画像に対応する領域に書き込む。
【0239】
全ての画素位置に関してこれらの処理が終了すると、入力画像バッファ608の画像の各画素について、当該画素を含むすべての近傍画像に対する近傍補正近似画像が計算され、その結果得られる各画素に関する複数の補正画素値が三板画像加算部615における処理により重み付き平均されて出力画像バッファ616に蓄積されるため、最終的に電子カメラ600の光学系による劣化と色の欠落が補正された3色カラー画像が得られる。
【0240】
補正の精度は低いが、メモリ容量を削減し、処理を高速化しない場合には、画像加算部615を削除し、出力画像バッファ616内に信頼値を保持しない構成が考えられる。この場合、帯域・色情報復元部614は直接出力画像バッファ616に出力する。作用としては、帯域・色情報復元部614において、帯域・色情報を補正したf(p,q,c) のうち、中心画素の補正値f(0,0,c) (c=0,1,2)のみを出力画像バッファ616に出力するように変更する。
【0241】
また、電子カメラ600に水晶フィルタ603がなく帯域制限がなされていない場合には、テンプレート保持ROM611が劣化前テンプレート保持ROM611aのみからなり、合成最小自乗近似部612が劣化前テンプレート保持ROM611aに接続される構成にする。
【0242】
この場合、各部分の作用は、合成最小自乗近似部612内部では、テンプレートとしてΦiのかわりにΨiが用いられる点を除いて同一である。その結果、帯域・色情報復元部614では色成分の欠落は補正されるが帯域の劣化についてはなにもされない近傍補正近似画像が得られ、出力画像バッファ616には入力画像バッファ608内の画像の色成分の欠落が補正された3色カラー画像が得られる。
【0243】
この変形例において、さらに前述の処理を高速化する変形例と同一の変形を施せば同じく処理の高速化が達せられることは容易に推察されるであろう。
【0244】
なお、上記した具体的実施形態には、以下の構成を有する発明が含まれている。
【0245】
(1) 画素の位置に応じて少なくとも1つ以上の分光特性に関する情報が欠落する画像信号から元の画像信号を回復処理する画像処理装置において、
前記情報が欠落する画像信号から、指定された画素を包含する所定サイズの近傍画像を抽出する近傍画像抽出手段と、
この近傍画像抽出手段によって抽出された近傍画像と同一サイズの複数の幾何学的パターンに基づくテンプレート群を保持するテンプレート保持手段と、
前記近傍画像抽出手段によって抽出された近傍画像に含まれる複数の分光特性の情報と、上記テンプレート保持手段によって保持された複数のテンプレート群との間でマッチングを行なって近傍画像に最も類似する最適テンプレートを選択し、この最適テンプレートに基づき近傍画像を近似する近傍近似画像を生成する近傍近似画像生成手段と、
この近傍近似画像生成手段によって生成された近傍近似画像に基づき、前記指定された画素における欠落する情報を復元する復元手段と、
を具備することを特徴とする画像処理装置。
【0246】
(2) 前記復元手段は、指定された画素を包含する複数の前記近傍画像から得られる複数の前記近傍近似画像の、前記少なくとも1つ以上の分光特性に関する情報を重みつき平均することで復元処理を行なうことを特徴とする構成(1)に記載の画像処理装置。
【0247】
(3) 前記テンプレート保持手段は、複数の幾何学的パターンに基づく第1のテンプレート群と、この第1のテンプレート群を撮像装置の光学系の帯域制限特性に応じて劣化させた第2のテンプレート群とを有し、
前記近傍近似画像生成手段は、前記第2のテンプレート群から前記近傍画像に類似する最適テンプレートを選択し、これに対応する前記第1のテンプレート群に基づき帯域制限前の近傍近似画像を生成することを特徴とする構成(1)または(2)に記載の画像処理装置。
【0248】
(4) 前記復元手段は、前記近傍画像と前記近傍近似画像との差分情報を算出し、この差分情報から所定の評価関数に基づき構造成分のみを抽出し、この構造成分のコントラスト情報を用いて前記近傍近似画像の輝度成分を変調することで前記指定された画素における欠落する情報を復元することを特徴とする構成(2)または(3)記載の画像処理装置。
【0249】
(5) 前記復元手段は、前記近傍画像と前記近傍近似画像との差分情報を算出し、この差分情報から所定の評価関数に基づき構造成分のみを抽出し、
前記近傍近似画像生成手段は、前記構造成分に基づき第3のテンプレート群を生成し、この第3のテンプレート群により前記近傍画像を近似する近傍再近似画像を生成し、
前記復元手段は、前記近傍近似画像および前記近傍再近似画像に基づき前記指定された画素における欠落する情報を復元することを特徴とする構成(2)に記載の画像処理装置。
【0250】
(6) 前記テンプレート保持手段に保持された前記テンプレート群は異なる解像度ごとに分類されており、
前記復元手段は、前記近傍画像と前記近傍近似画像との差分情報を算出し、この差分情報から所定の評価関数に基づき構造成分のみを抽出し、
前記近傍近似画像生成手段は、前記構造成分と、前記テンプレート群における前記構造成分の解像度に対応したテンプレート群との間でマッチングを行って最適テンプレートを選択し、この最適テンプレートから前記差分情報を近似する差分近傍近似画像を生成し、
前記復元手段は、前記差分近傍近似画像と前記近傍近似画像に基づき前記指定された画素における欠落する情報を復元し、前記差分近傍近似画像と前記構造成分との差分情報から新たな構造成分を抽出し、この構造成分が所定の閾値以下になるまで復元処理を反復することを特徴とする構成(2)に記載の画像処理装置。
【0251】
(7) 前記テンプレート保持手段に保持された前記第2のテンプレート群は異なる解像度ごとに分類されており、
前記復元手段は、前記近傍画像と前記近傍近似画像との差分情報を算出し、この差分情報から所定の評価関数に基づき構造成分のみを抽出し、
前記近傍近似画像生成手段は、前記構造成分と、前記第2のテンプレート群における前記構造成分の解像度に対応したテンプレート群との間でマッチングを行って最適テンプレートを選択し、この最適テンプレートから前記差分情報を近似する差分近傍近似画像を生成し、
前記復元手段は、前記差分近傍近似画像と前記近傍近似画像に基づき前記指定された画素における欠落する情報を復元し、前記差分近傍近似画像と前記構造成分との差分情報から新たな構造成分を抽出し、この構造成分が所定の閾値以下になるまで復元処理を反復することを特徴とする構成(3)に記載の画像処理装置。
【0252】
(8) 前記復元手段は、前記近傍近似画像から空間的相関情報を算出し、この空間的相関情報に基づき前記指定された画素に対する自己回帰モデルを適用して前記指定された画素における欠落する情報を復元することを特徴とする構成(1)、(2)、(3)のいずれか1つに記載の画像処理装置。
【0253】
(9) 前記近傍近似画像生成手段は、前記近傍画像と前記複数のテンプレート群との間でマッチングを行い、マッチング誤差の少ない複数のテンプレートを合成して単一の最適テンプレートを生成することを特徴とする構成(1)または(2)に記載の画像処理装置。
【0254】
(10) 前記近傍近似画像生成手段は、前記近傍画像と前記第2のテンプレート群との間でマッチングを行い、マッチング誤差の少ない複数のテンプレートを合成して単一の最適テンプレートを生成することを特徴とする構成(3)に記載の画像処理装置。
【0255】
(11) 前記近傍近似画像生成手段は、前記テンプレート保持手段に保持された前記テンプレート群を定数αで乗算し、定数βを加算して変形させることで前記近傍画像に最も類似する最適テンプレートを選択することを特徴とする構成(1)、(2)、(4)〜(6)、(8)、(9)に記載の画像処理装置。
【0256】
(12) 前記近傍近似画像生成手段は、前記テンプレート保持手段に保持された前記第2のテンプレート群を定数αで乗算し、定数βを加算して変形させることで前記近傍画像に最も類似する最適テンプレートを選択することを特徴とする構成(3)、(7)、(10)に記載の画像処理装置。
【0257】
構成(1)〜(12)と上記した各実施形態との対応関係は以下の通りである。
【0258】
A.構成(1)には少なくとも第1〜第6実施形態が対応し、
第1実施形態では、近傍画像抽出手段は入力画像バッファ108及び近傍読み出し部109に対応する。テンプレート保持手段はテンプレート保持ROM111に対応する。近傍近似画像生成手段は最小自乗近似部112及び帯域・色情報復元部114に対応する。復元手段は三板画像加算部115および出力画像バッファ116に対応する。
【0259】
第2実施形態では、近傍画像抽出手段は入力画像バッファ208及び近傍読み出し部209に対応する。テンプレート保持手段はテンプレート保持ROM211に対応する。近傍近似画像生成手段は最小自乗近似部212、帯域・色情報復元部214及び色情報復元部213に対応する。復元手段は補間係数計算部215、線形演算部216及び出力画像バッファ217に対応する。
【0260】
第3実施形態では、近傍画像抽出手段は入力画像バッファ308及び近傍読み出し部309に対応する。テンプレート保持手段はテンプレート保持ROM311に対応する。近傍近似画像生成手段はテンプレート選択部310、最小自乗近似部312、帯域・色情報復元部314及び劣化後テンプレート加工部313に対応する。復元手段は三板画像加算部315a、出力画像バッファ317、単板画像加算部315b、単板画像バッファ316、差分計算部318、差分画像バッファ319及び規則性評価部320に対応する。
【0261】
第4実施形態では、近傍画像抽出手段は入力画像バッファ408及び近傍読み出し部409に対応する。テンプレート保持手段はテンプレート保持ROM411に対応する。近傍近似画像生成手段は最小自乗近似部412及び帯域・色情報復元部414に対応する。復元手段は画像加算部415、三板画像バッファ417a、単板画像バッファ417b、残差演算部418、規則性判定部419、残差加算部420及び出力画像バッファ421に対応する。
【0262】
第5実施形態では、近傍画像抽出手段は入力画像バッファ508及び近傍読み出し部509に対応する。テンプレート保持手段はテンプレート保持ROM511に対応する。近傍近似画像生成手段はテンプレート選択部510、テンプレート生成部521、最小自乗近似部512、色情報復元部514及び単板画像生成部513に対応する。復元手段は三板画像加算部515a、単板画像加算部515b、単板画像バッファ516、差分計算部518、差分画像バッファ519、規則性評価部520及び及び出力画像バッファ517に対応する。
【0263】
第6実施形態では、近傍画像抽出手段は入力画像バッファ608及び近傍読み出し部609に対応する。テンプレート保持手段はテンプレート保持ROM611に対応する。近傍近似画像生成手段は合成最小自乗近似部612及び帯域・色情報復元部614に対応する。復元手段は三板画像加算部615及び出力画像バッファ616に対応する。
【0264】
単板状態の画像の各近傍に対し、近傍近似画像生成手段が複数の分光成分全てを考慮して最も良く近似するテンプレートを一つ決定し、そのテンプレートに基づいた補間を復元手段が行うため、輝度成分、色成分を区別して扱う場合と比較してモアレに影響されることがなく、近傍に含まれる微細な幾何学的特徴を検出することができる。
【0265】
これによって、以下に述べる発明が解決しようとする課題のP1が解決される。また、特定の色成分を高サンプリング密度で得ておく必要もないため、P2も解決される。
【0266】
B.構成(2)には少なくとも第1〜第6実施形態が対応し、
第1実施形態では、復元手段は三板画像加算部115および出力画像バッファ116に対応する。
【0267】
第2実施形態では、復元手段は補間係数計算部215、線形演算部216及び出力画像バッファ217に対応する。
【0268】
第3実施形態では、復元手段は三板画像加算部315a、出力画像バッファ317、単板画像加算部315b、単板画像バッファ316、差分計算部318、差分画像バッファ319及び規則性評価部320に対応する。
【0269】
第4実施形態では、復元手段は画像加算部415、三板画像バッファ417a、単板画像バッファ417b、残差演算部418、規則性判定部419、残差加算部420及び出力画像バッファ421に対応する。
【0270】
第5実施形態では、復元手段は三板画像加算部515a、単板画像加算部515b、単板画像バッファ516、差分計算部518、差分画像バッファ519、規則性評価部520及び出力画像バッファ517に対応する。
【0271】
第6実施形態では、復元手段は三板画像加算部615及び出力画像バッファ616に対応する。
【0272】
入力画像の各画素について、近傍近似画像生成手段によりその画素を包含する複数の近傍の各々に対する近傍近似画像が生成され、復元手段がそれら複数の近傍近似画像における当該画素の近似値を重みつき平均して当該画素の最終的な近似値を計算する結果、各近傍における近似の誤りが補正される。
【0273】
これによって、以下に述べる発明が解決しようとする課題のP3が解決される。
【0274】
C.構成(3)には少なくとも第1、第2、第3、第4、第6実施形態が対応し、
第1実施形態では、テンプレート保持手段はテンプレート保持ROM111に対応する。近傍近似画像生成手段は、最小自乗近似部112及び帯域・色情報復元部114に対応する。
【0275】
第2実施形態では、テンプレート保持手段はテンプレート保持ROM211に対応する。近傍近似画像生成手段は最小自乗近似部212、帯域・色情報復元部214及び色情報復元部213に対応する。
【0276】
第3実施形態では、テンプレート保持手段はテンプレート保持ROM311に対応する。近傍近似画像生成手段はテンプレート選択部310、最小自乗近似部312、帯域・色情報復元部314及び劣化後テンプレート加工部313に対応する。
【0277】
第4実施形態では、テンプレート保持手段はテンプレート保持ROM411に対応する。近傍近似画像生成手段は最小自乗近似部412及び帯域・色情報復元部414に対応する。
【0278】
第6実施形態では、テンプレート保持手段はテンプレート保持ROM611に対応する。近傍近似画像生成手段は合成最小自乗近似部612及び帯域・色情報復元部614に対応する。
【0279】
テンプレート保持手段が複数の幾何学的パターンに基づく第1のテンプレート群と、この第1のテンプレート群を撮像装置の光学系の帯域制限特性に応じて劣化させた第2のテンプレート群を持ち、入力画像の各画素の近傍に対して近傍近似画像生成手段が第2のテンプレート群から最も類似する最適テンプレートを選択し、これに対応する前記第1のテンプレート群のテンプレートに基づき帯域制限前の近傍近似画像を生成する結果、光学系の帯域劣化が補正された画像が得られる。
【0280】
これによって、以下に述べる発明が解決しようとする課題のP5が解決される。
【0281】
D.構成(4)には少なくとも第4実施形態が対応する。
【0282】
復元手段は画像加算部415、三板画像バッファ417a、単板画像バッファ417b、残差演算部418、規則性判定部419、残差加算部420及び出力画像バッファ421に対応する。
【0283】
入力画像の各画素の近傍に対して近傍近似画像生成手段が近傍近似画像を生成し、復元手段が近傍とその近傍近似画像との差分情報を算出し、この差分情報から構造成分のみを抽出し、構造成分のコントラスト情報を用いて近傍近似画像の輝度成分を変調することで、近傍がテンプレートにより完全に近似できない場合でも近似誤差のうち規則的構造を持つ成分は出力画像の輝度成分に反映される。
【0284】
これによって、以下に述べる発明が解決しようとする課題のP7が解決される。
【0285】
E.構成(5)には少なくとも第5実施形態が対応する。
【0286】
近傍近似画像生成手段はテンプレート選択部510、テンプレート生成部521、最小自乗近似部512、色情報復元部514及び単板画像生成部513に対応する。復元手段は三板画像加算部515a、単板画像加算部515b、単板画像バッファ516、差分計算部518、差分画像バッファ519、規則性評価部520及び出力画像バッファ517に対応する。
【0287】
入力画像の各画素の近傍に対し、まず近傍近似画像生成手段が近傍近似画像を生成し、復元手段が近傍と近傍近似画像との誤差である差分画像を算出し、近傍近似画像生成手段が差分画像から所定の評価関数に基づき構造成分を算出して第3のテンプレート群を生成する。次に、近傍近似画像生成手段が近傍を第3のテンプレート群によって再び近似し、近傍再近似画像を生成する。最後に、復元手段が近傍近似画像と近傍再近似画像に基づいて補正を行う。その結果、近傍がテンプレート保持手段のテンプレートにより近似できない規則的構造を含んでいる場合でも、その構造を近似誤差を表わす差分画像から抽出して再近似を行う。
【0288】
これによって、以下に述べる発明が解決しようとする課題のP7が解決される。
【0289】
F.構成(6)、(7)には少なくとも第3実施形態が対応する。
【0290】
テンプレート保持手段はテンプレート保持ROM311に対応する。近傍近似画像生成手段はテンプレート選択部310、最小自乗近似部312、帯域・色情報復元部314及び劣化後テンプレート加工部313に対応する。復元手段は三板画像加算部315a、出力画像バッファ317、単板画像加算部315b、単板画像バッファ316、差分計算部318、差分画像バッファ319及び規則性評価部320に対応する。
【0291】
テンプレート保持手段が異なる解像度ごとに分類されたテンプレート群を有し、入力画像の各画素の近傍に対し、近傍近似画像生成手段が解像度の低いテンプレートから解像度の高いテンプレートへとテンプレートの解像度を上げながら近似誤差を減少させていくため、複雑な構造のテンプレートを用意することなく高速に近似処理が行える。
【0292】
これによって、以下に述べる発明が解決しようとする課題のP4が解決される。
【0293】
G.構成(8)には少なくとも第2実施形態が対応する。
【0294】
復元手段は補間係数計算部215、線形演算部216及び出力画像バッファ217に対応する。
【0295】
入力画像の各画素の近傍に対し、近傍近似画像生成手段が近傍近似画像を生成し、復元手段が近傍近似画像から空間的相関情報を算出し、この空間的相関情報に基づき当該画素に対する自己回帰モデルを適用して欠落する情報を復元することにより、近傍近似画像生成手段により選択されたテンプレートの如何にかかわらず共通の手順で補間処理が行われる。
【0296】
これによって、以下に述べる発明が解決しようとする課題のP6が解決される。
【0297】
H.構成(9)、(10)には少なくとも第6実施形態が対応する。
【0298】
近傍近似画像生成手段は合成最小自乗近似部612及び帯域・色情報復元部614に対応する。
【0299】
入力画像の各画素の近傍に対し、近傍近似画像生成手段が近似誤差の少ない複数のテンプレートを合成して単一の最適テンプレートを生成する。
【0300】
これによって、以下に述べる発明が解決しようとする課題のP8が解決される。
【0301】
I.構成(11)、(12)には少なくとも第1〜第6実施形態が対応する。
【0302】
第1実施形態では、近傍近似画像生成手段は最小自乗近似部112及び帯域・色情報復元部114に対応する。
【0303】
第2実施形態では、近傍近似画像生成手段は最小自乗近似部212、帯域・色情報復元部214及び色情報復元部213に対応する。
【0304】
第3実施形態では、近傍近似画像生成手段はテンプレート選択部310、最小自乗近似部312、帯域・色情報復元部314及び劣化後テンプレート加工部313に対応する。
【0305】
第4実施形態では、近傍近似画像生成手段は最小自乗近似部412及び帯域・色情報復元部414に対応する。
【0306】
第5実施形態では、近傍近似画像生成手段はテンプレート選択部510、テンプレート生成部521、最小自乗近似部512、色情報復元部514及び単板画像生成部513に対応する。
【0307】
第6実施形態では、近傍近似画像生成手段は合成最小自乗近似部612及び帯域・色情報復元部614に対応する。
【0308】
入力画像の各画素の近傍に対し、近傍近似画像生成手段において、まず近傍の各色成分ごとにテンプレートに定数αを乗算し、定数βを加算した変形テンプレートにより当該色成分を近似するための最適な係数α,βを求める。次に、各色成分ごとに最適な近似を与える係数α,βを用いた場合の変形テンプレートによる近似誤差を単色近似誤差として計算し、全ての色成分の単色近似誤差に基づいてテンプレートによる近傍の近似度を評価することにより、一つのテンプレートで複数の色成分の近似を行うことができる。
【0309】
これによって、以下に述べる発明が解決しようとする課題のP1、P2が解決される。
【0310】
上記した構成(1)〜(12)によって解決される発明が解決しようとする課題は以下の通りである。
【0311】
P1
従来技術では相対的に高サンプリング密度で与えられる輝度成分においても欠落する情報が存在し、三板方式で得られる輝度成分と比較して劣化した情報しか得られない。また、この輝度成分に基づき算出される他の色成分も、三板方式で得られる色成分に比較して劣化した情報しか得られない。
【0312】
P2
従来技術では任意の色フィルタ配置の入力画像を処理する方法に関しては記載していない。輝度成分の補間においては、あらかじめ用意された幾何学的特徴とこれに対応する補間方法を用意する必要があり、色フィルタ配置が変わると設計を変更する必要がある。
【0313】
P3
従来技術ではノイズの影響による誤動作に対応する方法に関しては記載していない。輝度成分および他の色成分を処理する場合、一回の処理で補間を行うため、パルス性のノイズの影響を受けやすい。特に輝度成分の処理においては3×3の局所領域で幾何学的特徴を分類するため、ノイズによる誤分類が発生しやすい。
【0314】
P4
従来技術ではノイズの影響を軽減するために幾何学的特徴を判定する領域のサイズを大きくした場合に高速な処理で判定を行なうことができない。
【0315】
P5
従来技術では撮像装置の光学系により帯域制限される情報の回復に関しては記載されていない。輝度成分および他の色の色成分は帯域制限された範囲内で処理されており、帯域の回復は扱うことはできない。
【0316】
P6
従来技術では複数の補間方法を幾何学的特徴に応じて用意しており、単一の方法に関しては記載されていない。輝度成分を幾何学的特徴に基づき補間する際には、幾何学的特徴の数だけ補間方法を用意しなければならない。高精度な処理のためには、幾何学的特徴の数を増やす必要があるが、これに応じて補間方法を考えねばならず、処理が煩雑になる。
【0317】
P7
従来技術ではあらかじめ用意された幾何学的特徴とこれに対応する補間方法に当てはまらない場合に対する対策に関しては記載されていない。輝度成分を幾何学的特徴に応じて分類する際には、強制的にどれかの幾何学的特徴に分類するため、当てはまらない領域に関しては誤差が発生して高精度な処理を行なうことができない。
【0318】
P8
従来技術ではあらかじめ用意された幾何学的特徴とこれに対応する補間方法に当てはまらない場合には高精度な処理を行なうことができない。
【0319】
【発明の効果】
請求項1に記載の発明によれば、従来に比べて高精細な画像を得ることができ、かつ、任意の色フィルタ配置の入力画像を処理することができるようになる。
【0320】
また、請求項2に記載の発明によれば、請求項1に記載の発明の効果に加えて、画像信号のノイズによる劣化を低減できるようになる。
【0321】
また、請求項3に記載の発明によれば、請求項1または請求項2に記載の発明の効果に加えて、帯域制限によって失われた情報を回復することができるようになる。
【図面の簡単な説明】
【図1】本発明の第1実施形態が適用される画像処理システムの構成を示す図である。
【図2】図1に示す最小自乗近似部の構成とその周辺回路を示す図である。
【図3】色成分マスク生成部により生成されるマスクの説明図である。
【図4】本発明の第2実施形態が適用される画像処理システムの構成を示す図である。
【図5】図4における最小自乗近似部112の処理の流れを表すフローチャートである。
【図6】本発明の第3実施形態が適用される画像処理システムの構成を示す図である。
【図7】本発明の第4実施形態が適用される画像処理システムの構成を示す図である。
【図8】図7に示す最小自乗近似部の構成とその周辺回路を示す図である。
【図9】本発明の第5実施形態が適用される画像処理システムの構成を示す図である。
【図10】本発明の第6実施形態が適用される画像処理システムの構成を示す図である。
【図11】図10に示す合成最小自乗近似部の構成とその周辺回路を示す図である。
【図12】合成最小自乗近似部の作用を説明するための図である。
【符号の説明】
100…電子カメラ、101…画像処理装置、102…レンズ、103…水晶フィルタ、104…単板RGBランダム配列CCD、105…A/D変換部、106…フィルタ配置情報保持ROM、107…画像バッファ、108…入力画像バッファ、109…近傍読み出し部、111…テンプレート保持ROM、112…最小自乗近似部、114…帯域・色情報復元部、115…三板画像加算部、116…出力画像バッファ。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus that recovers an original image signal from an image signal that lacks information on at least one or more spectral characteristics according to each pixel position.
[0002]
[Prior art]
In an imaging apparatus such as an electronic still camera using an electronic imaging system, a single plate type using an imaging element in which color filters are arranged in a mosaic pattern on a light receiving surface, one G (green) filter only, and one R ( A two-plate imaging system that captures images with two CCDs with red and B (blue) mosaic filters is less expensive than a three-plate imaging system that uses a spectroscopic system and three imaging elements. It has the advantage of being able to. However, in these methods, since at least one color information is missing at each pixel position of the image, in the image processing apparatus, the missing color information of one pixel is used as the missing color information of another pixel. Interpolation processing is required.
[0003]
However, in the single-plate method and the two-plate method, moiré peculiar to the color filter arrangement occurs, and the manner in which this moiré occurs differs for each color filter. For this reason, artifacts such as unevenness of the edge portion, angle change, and coloring occur in simple linear interpolation processing. Conventionally, various interpolation methods have been proposed to reduce these artifacts, but as an effective interpolation method,
1. In order to reduce the uneven artifacts of the edge, a method of estimating the geometric structure of the local image and performing interpolation according to the structure;
2. In order to reduce the coloring of the edges, an image sensor with a color filter arrangement that can generate a broadband luminance signal with a simple interpolation method is used, and the color signal is assumed to change in the same way as the luminance signal. A method of performing interpolation,
Are raised.
[0004]
Hereinafter, each method will be described by taking the method disclosed in Japanese Patent Laid-Open No. 61-501423 for 1 and the method disclosed in Japanese Patent Laid-Open No. 4-502096 for 2 as an example.
[0005]
Japanese Laid-Open Patent Publication No. 61-501423 discloses an interpolation method for G signals corresponding to luminance components in an image sensor with R, G, B color filter arrays. In this method, in the vicinity of the 3 × 3 pixel of the pixel in which the G signal is missing, it is determined to which of the geometrical features of the edge, streak, and corner prepared in advance the best fit. Based on the results, an interpolation method specialized for each geometric feature is selected.
[0006]
Japanese Patent Laid-Open No. 4-502096 discloses an interpolation method for color components having a low sampling density in an image signal in which luminance components are obtained at a high sampling density and other color components are obtained at a relatively low sampling density. is doing. In this method, a color component having a low sampling density is calculated using a luminance component having a high sampling density. For this reason, it is assumed that the sample value of the signal S1 having the high sampling density always exists at the sampling position of the signal S2 having the low sampling density. Then, the difference between the sample values of the signal S1 at the sampling position of the signal S2 is compared with a predetermined threshold value, and if it is below the threshold value, simple linear interpolation using only the sample value of the signal S2 is performed.
[0007]
When the threshold value is exceeded, it is determined that there is an edge between the sampling positions of the signal S2, and the coefficients a and b are set to S1 at the sampling position of the signal S2, assuming that the signal S1 and the signal S2 have a linear relationship of S2 = aS1 + b. And the value of S2.
[0008]
[Problems to be solved by the invention]
In any of the above prior arts, there is information that is missing even in a luminance component given at a relatively high sampling density, so that only degraded information can be obtained as compared with the luminance component obtained by the three-plate method. Also, other color components calculated based on the luminance component can only obtain information that is deteriorated as compared with the color components obtained by the three-plate method.
[0009]
In addition, none of the above-described conventional techniques describes a method for processing an input image having an arbitrary color filter arrangement. In the interpolation of the luminance component, it is necessary to prepare a geometric feature prepared in advance and an interpolation method corresponding to the geometric feature, and it is necessary to change the design when the color filter arrangement is changed.
[0010]
In addition, none of the above-described conventional techniques describes a method for dealing with a malfunction due to the influence of noise. When the luminance component and other color components are processed, the interpolation is performed in a single process, and therefore, the luminance component and other color components are easily affected by pulse noise. In particular, in the luminance component processing, geometric features are classified in a 3 × 3 local region, and therefore misclassification due to noise is likely to occur.
[0011]
In addition, none of the above-described conventional techniques describes the recovery of information whose bandwidth is limited by the optical system of the imaging apparatus. That is, the luminance component and the color components of other colors are processed within the band-limited range, and information lost due to the band limitation cannot be recovered.
[0012]
The present invention has been made by paying attention to each of the above-mentioned problems, and the first object thereof is to obtain a high-definition image that approximates a three-plate system, and an arbitrary color filter arrangement. An object of the present invention is to provide an image processing apparatus capable of processing an input image.
[0013]
In addition to the first object, a second object of the present invention is to provide an image processing apparatus capable of reducing deterioration of an image signal due to noise.
[0014]
In addition to the first or second object, a third object of the present invention is to provide an image processing apparatus capable of recovering information lost due to bandwidth limitation.
[0015]
[Means for Solving the Problems]
In order to achieve the first object, the first invention is an image processing apparatus that recovers an original image signal from an image signal that lacks information on at least one or more spectral characteristics according to the position of a pixel. A neighboring image extracting means for extracting a neighboring image of a predetermined size including the designated pixel from the image signal lacking the information, and a plurality of geometries having the same size as the neighboring image extracted by the neighboring image extracting means. A template holding means for holding a template group based on a geometric pattern, information on a plurality of spectral characteristics included in the neighboring image extracted by the neighboring image extracting means, and a plurality of template groups held by the template holding means, Matching is performed to select an optimal template that is most similar to neighboring images, and based on this optimal template Neighborhood approximate image generation means for generating a neighborhood approximation image that approximates a side image, and restoration means for restoring missing information in the designated pixel based on the neighborhood approximation image generated by the neighborhood approximation image generation means It has.
[0016]
According to a second aspect, in the first aspect, the restoration means includes the at least one spectral characteristic of the plurality of neighboring approximate images obtained from the plurality of neighboring images including a designated pixel. The restoration process is performed by averaging the information regarding the weighted average.
[0017]
According to a third invention, in the first or second invention, the template holding means includes a first template group based on a plurality of geometric patterns, and the first template group as an optical system of the imaging apparatus. A second template group degraded in accordance with the band-limiting characteristic of the image, and the neighborhood approximate image generation means selects an optimum template similar to the neighborhood image from the second template group, and corresponds to this Based on the first template group, a neighborhood approximate image before band limitation is generated.
[0018]
In other words, according to the first aspect of the present invention, when the original image signal is recovered from the image signal in which at least one or more spectral characteristic information is missing according to the pixel position, first, the image signal in which the information is missing is designated. A neighborhood image of a predetermined size that includes the processed pixels is extracted. A template group based on a plurality of geometric patterns having the same size as the extracted neighboring image is held in the template holding means. Next, matching is performed between information on a plurality of spectral characteristics included in the extracted neighborhood image and a plurality of template groups held by the template holding means, and an optimal template most similar to the neighborhood image is selected. Then, a neighborhood approximate image that approximates the neighborhood image is generated based on the optimum template. Then, based on the generated neighborhood approximate image, the missing information in the designated pixel is restored.
[0019]
In a second aspect based on the first aspect, when the restoration process is performed, the at least one or more of the plurality of neighboring approximate images obtained from the plurality of neighboring images including the designated pixel. Information on spectral characteristics is weighted and averaged.
[0020]
According to a third aspect, in the first or second aspect, when generating a neighborhood approximate image, the first template group based on a plurality of geometric patterns and the first template group are imaged. And a second template group degraded according to the band limiting characteristics of the optical system, and an optimal template similar to the neighboring image is selected from the second template group, and the first template corresponding thereto is selected. A neighborhood approximate image before band limitation is generated based on the template group.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. First, a first embodiment of the present invention will be described.
[0022]
FIG. 1 is a diagram showing a configuration of an image processing system to which the present embodiment is applied, FIG. 2 is a diagram showing a configuration of a least
[0023]
As shown in FIG. 1, the image processing system according to the present embodiment includes an electronic camera 100 and an image processing apparatus 101 connected to the electronic camera 100. The electronic camera 100 includes a lens 102 as an optical system, a crystal filter 103 for optically band-limiting, and a single-plate RGB random array CCD 104 as an image sensor. It is connected to the
[0024]
The image processing apparatus 101 includes an
[0025]
FIG. 2 is a diagram showing the configuration of the least
[0026]
As shown in FIG. 1, the electronic camera 100 is connected to the image processing apparatus 101 by two lines. Among these, the output of the
[0027]
On the other hand, the filter arrangement
[0028]
Both the approximate coefficient holding buffer 112d and the approximate
[0029]
As shown in FIG. 1, the band / color
[0030]
The
[0031]
The output image buffer 116 holds a three-color image in which color loss and band deterioration have been corrected in each pixel of the input image. In this image processing apparatus 101, a plurality of correction values are calculated during processing for each pixel. The In order to perform weighting calculation based on the reliability of the correction value, the output image buffer 116 further holds a reliability value representing the reliability of the pixel value at each pixel position.
[0032]
The operation of the image processing system having the above configuration will be described below.
[0033]
First, a subject is imaged using the electronic camera 100, and an optical image subjected to band limitation through the lens 102 and the crystal filter 103 is formed on the single-plate RGB random array CCD 104. The output of the single-plate RGB random array two-dimensional CCD 104 is transferred as it is to the
[0034]
When the imaging is finished, the image in the
[0035]
Next, an image signal corresponding to a predetermined rectangular area (for example, 5 × 5 pixels) centered on each pixel position (x, y) on the CCD is output from the
[0036]
When the neighborhood image is transferred from the
[0037]
On the other hand, the least square
e (c) = ‖ mask (p, q, c) ・ ( α (c) Φ i (p, q) + Β (c) − h (p, q) ‖
Using,Calculate for each color component. The least square
[0038]
The approximate
[0039]
The
[0040]
Next, the least square
[0041]
After all the templates have been processed by the least square
[0042]
The band / color
f (p, q, c) = min_α (c) Ψ min_i (p, q) + min_β (c) (c = 0,1,2)
Is calculated to obtain a neighborhood corrected approximate image f (p, q, c) in which the lack of color components in the neighborhood image h (p, q) is corrected. By using the template before deterioration, the band deterioration due to the optical system of the electronic camera 100 is further corrected at f (p, q, c). The band / color
[0043]
In the middle of processing, the average value and the reliability value of a plurality of corrected pixel values obtained by the processing so far are held at each pixel position of the output image buffer 116. The three-plate image adding unit 115 reads out the corrected pixel value and the reliability value of each pixel in the region corresponding to the neighboring image from the output image buffer 116 to the variables Sf (p, q, c) and Q (p, q), respectively. Then, a new corrected pixel value Sf is calculated from these, the neighborhood correction approximate image f (p, q, c) transferred from the band / color
Sfnew(p, q, c) and Qnew(p, q) is written in the area corresponding to the neighboring image in the output image buffer 116.
[0044]
When these processes are completed for all pixel positions, for each pixel of the image in the
[0045]
In addition, various deformation | transformation and a change are possible for each component of this embodiment. For example, the single-plate RGB random array CCD 104 may be a CCD having various color filter arrangements, or a CCD having a two-plate configuration in which one is G and the other is R and B.
[0046]
The following configuration is also possible in order to correspond to an electronic camera having various optical systems. On the electronic camera 100 side, the filter arrangement
[0047]
Similarly, it is also possible to transfer the information about the subject set by the camera user to the image processing apparatus 101 so that the least
[0048]
Further, when the electronic camera 100 does not have the crystal filter 103 and the band is not limited, the
[0049]
The second embodiment of the present invention will be described below. FIG. 4 is a diagram showing the configuration of an image processing system to which the second embodiment of the present invention is applied, and FIG. 5 is a flowchart showing the processing flow of the least
[0050]
In FIG. 4, the image processing system includes an electronic camera 200 and an image processing apparatus 201 connected to the electronic camera 200. Similar to the first embodiment, the electronic camera 200 includes a lens 202 as an optical system, a crystal filter 203 for performing band limitation, and a single-plate Bayer array CCD 204 as an imaging device. The output of the single-plate Bayer array CCD 204 is A It is connected to the image buffer 207 via the /
[0051]
The image processing apparatus 201 includes an
[0052]
The output of the image buffer 207 in the electronic camera 200 is connected to the
[0053]
The least
[0054]
The
[0055]
Both the color
[0056]
The operation of the image processing system having the above configuration will be described below.
[0057]
Also in the second embodiment, as in the first embodiment, an image is captured by the electronic camera 200, and an image that has undergone band degradation in the optical system and has only one color component at each pixel position is held in the image buffer 207. The When the imaging is finished, the image in the image buffer 207 is transferred to the
[0058]
Next, the following processing is performed for each pixel position (x, y) of the image in the
[0059]
The
[0060]
In the following description, the set of variables (p, q) is a relative coordinate with respect to the central pixel (x, y) of this neighboring image. For example, if the size of the neighborhood is 5 × 5, [−2, −1]. , 0, 1, 2] × [−2, −1, 0, 1, 2], and in some cases, the colors R, G, B correspond to the integer values c = 0, 1, 2, respectively. I will explain.
[0061]
The read neighborhood image is sent to the
[0062]
When the neighborhood image is transferred, the least square
[0063]
Each step (S) of the flowchart shown in FIG. 5 performs the following processing.
[0064]
S1: Obtain the coordinates (x, y) of the central pixel of the neighboring image, and based on this value and the regularity of the Bayer array, a color filter of the color component c exists for the position (p, q) in the neighboring image Then, an array variable mask (p, q, c) representing a color component mask that takes 1 if it does not exist and 0 if it does not exist is calculated. In FIG. 5, the function rem (a, b) returns the remainder obtained by dividing a by b, and the function abs (a) gives the absolute value of a. Further, the variable N is initialized to the total number of templates, and the values of the array variables min_α (c) and min_β (c) for the variables min_i and c = 0, 1, 2 are initialized to zero. The array variable h (p, q) is initialized with the pixel value of the neighborhood image. A variable i representing the index of the template element is initialized to 0. The variable min_e representing the minimum fitting error of the template is initialized to the maximum number that can be handled by the image processing apparatus 201.
[0065]
S2: The i-th template Φi (p, q) is read from the post-degradation
[0066]
S3: An error function err (c, α, which is a function of a color variable c and real numbers α, β defined from variables h (p, q), Φ (p, q), mask (p, q, c) Find α and β that minimize β). The error function err (c, α, β) is a measure of the error between the image αΦ + β obtained by processing the template image Φ with the gain α and the bias β and the neighboring image at the position where the color component c exists.
[Expression 1]
[0067]
Represents the sum of squares of a (p, q) in the neighborhood image. Obtaining α and β that minimize the error function err (c, α, β) is equivalent to adjusting the gain α and the bias β of the template Φ so as to best approximate each color component of the neighboring image. The minimized error function value is added to the variable e, and the obtained gain α and bias β are substituted into elements α (c) and β (c) corresponding to the color c of the array variable. Thereafter, the variable c representing the color is incremented.
[0068]
S4: It is determined whether or not the processing S3 for all the color components RGB is completed based on whether or not c representing the color exceeds 2, that is, whether it exceeds B. If it exceeds, the process branches to S5.
[0069]
S5: When reaching S5, the variable e represents an error when the i-th degradation template element is applied to the neighboring image. The variable min_e represents the minimum value of the fitting error for all degradation template elements less than i. If e is smaller than min_e, the process branches to S6 to update information on the template with the smallest fitting error. If larger, the process branches to S7.
[0070]
S6: Update min_e to e, min_i to i, and min_α (c) and min_β (c) to α (c) and β (c) for c = 0, 1, and 2.
[0071]
S7: The index i is incremented.
[0072]
S8: If the index i does not match N, the process branches to S2. If it matches, the process branches to S9.
[0073]
The outputs min_i, min_α (c), min_β (c) of the least
f (p, q, c) = min_α (c) Ψ min_i (p, q) + min_β (c)
g (p, q, c) = min_α (c) Φmin_i (p, q) + min_β (c) (c = 0,1,2)
The neighborhood correction approximate image f (p, q, c) which corrected the missing color component and the deterioration of the band for the neighborhood image h (p, q), and the neighborhood correction which corrected only the missing color component An approximate image g (p, q, c) is obtained. These are transferred to the interpolation coefficient calculator 215.
[0074]
In the interpolation coefficient calculation unit 215, information suitable for estimating a color pixel value before deterioration using pixel values in the neighboring image from f (p, q, c) and g (p, q, c). Is calculated in the form of an interpolation coefficient. For this purpose, the image g ′ (p, c, c) in the same single plate state as the image in the
[0075]
First, each pixel of color c of f is a linear sum of each pixel of three-color image g based on the idea of the autoregressive model.
[Expression 2]
[0076]
Approximate The autoregressive model is a model in which the pixel value of a certain pixel is represented by the sum of a weighted linear sum of pixel values around the pixel and a noise term. Here, the noise term is ignored. In this expression, the integer variable set (u, v) moves in a range D that is narrower than the range that the variable set (p, q) can take.
[0077]
H (u, v) is an integer value representing the color filter type at position (u, v) in the neighborhood as R = 0, G = 1, and B = 2. This equation uses each pixel value of g sampled through a color filter with the same arrangement around each position (p, q) and around position (0, 0) (center pixel). ) Represents the estimation of the value of f.
[0078]
In order to minimize the square error of approximation by this formula, wc uvThe expression to be satisfied is for an integer variable set (k, l) that moves in the same range as the moving range D of (u, v).
[Equation 3]
[0079]
It becomes. In this equation, the second term on the left side and the right side represents spatial correlation information. W on right and left sidesc uvAll other quantities can be calculated from f and g, and the entire equation can be solved by matrix operation. At the center of the neighborhood, (p, q) = (0,0) and g ′ (u, v) = g (u, v, H (u, v)), the coefficient wc uvCan be used to determine the RGB value of the central pixel before the deterioration of the neighboring image from only the pixel value in the neighboring pixel.
[0080]
Based on this principle, the interpolation coefficient calculation unit 215 calculates interpolation coefficients for all colors c = 0, 1, and 2 from f (p, q, c) and g (p, q, c) according to the equation (2). wc uvIs calculated and transferred to the
[0081]
In the case where no image transfer is performed from the
[0082]
On the other hand, when the coefficients are transferred from the interpolation coefficient calculation unit 215, the pixels in the neighboring image are weighted and added according to the transferred coefficients, and written to the corresponding pixel positions in the
[0083]
When these processes are completed for all the pixel positions of the image in the
[0084]
Even in this configuration, various modifications can be made as in the first embodiment. Needless to say, the image sensor is not limited to the single-plate Bayer array CCD 204. There are various calculation methods of the interpolation coefficient calculation unit 215. For example, the ratio of each image value to the image obtained from the color
[0085]
In the second embodiment, as in the first embodiment, corrected images for a plurality of neighborhoods including each pixel position are obtained. In order to effectively utilize this, the operations of the band / color
[0086]
Each of the band / color
[0087]
When min_i, min_α (c) and min_β (c) are transferred from the least
Thus, a three-color image f (p, q, c) obtained by correcting the missing of the color component and the deterioration of the band with respect to the neighboring image is obtained and output to the interpolation coefficient calculation unit 215. At the same time, f (p, q, c) is held in the internal buffer as f_prev (p, q, c).
[0088]
Similarly, during the process for the pixel position (x, y) of the image in the
Read template Φ min_i (p, q) corresponding to min_i and use approximate coefficients min_α (c) and min_β (c)
As a result, a three-color image g (p, q, c) obtained by correcting the lack of color components for the neighboring image is obtained and output to the interpolation coefficient calculation unit 215. At the same time, g (p, q, c) is held in the internal buffer as g_prev (p, q, c).
[0089]
As a result, the band / color
[0090]
This embodiment can easily cope with a case where the electronic camera 200 does not have the crystal filter 203 and the band is not limited. In this case, since the
[0091]
The interpolation coefficient calculation unit 215 sets g (p, q, c) as the same image as f (p, q, c), and proceeds with the calculation. As a result, the interpolation coefficient calculation unit 215 obtains an interpolation coefficient suitable for correcting the missing color component of the center pixel h (0,0) of the neighboring image h (p, q) in the single-plate state. Since the linear
[0092]
In this modified example, if the band / color
[0093]
The third embodiment of the present invention will be described below. FIG. 6 is a diagram showing the configuration of an image processing system to which the third embodiment of the present invention is applied. The electronic camera 300 has the same configuration as that of the second embodiment. Information on the color filter array of the single-plate Bayer array CCD 304 in the electronic camera 300 is obtained by calculation in the image processing apparatus 301 using the regularity of the Bayer array, as in the second embodiment.
[0094]
The image processing apparatus 301 includes an
[0095]
The output of the
[0096]
In addition to the
[0097]
Similar to the first and second embodiments described above, the template holding ROM 311 includes templates Ψi (i = 0 to N) which are grayscale images of a predetermined size having N types of geometric features in the pre-degradation template holding ROM 311a. -1) is held, and the template Φi (i = 0 to N−1) in which each template in the pre-degradation
[0098]
The difference from the first and second embodiments is that the geometric characteristics of each template element are classified according to their structural complexity, and two numbers are used instead of a single integer value i to read each element. This requires a set (s, i). s represents the complexity of the structure, and is the number of connected components when each template is binarized with respect to the average value. For example, s = 2 for a template including only one edge pattern, and s = 3 for a template including only one line segment pattern. I is also used to access individual elements of a class of templates with the same complexity s.
[0099]
The internal configuration and operation of the least square approximation unit 312 are the same as those in the second embodiment. The least square approximation unit 312 is connected to output the processing result to the band / color
[0100]
The band / color
[0101]
The post-degradation template processing unit 313 is connected to receive the outputs of the least square approximation unit 312 and the
[0102]
The single-
[0103]
As in the first embodiment, since a plurality of pixel values are calculated at each pixel position of each buffer, here, the three-plate
[0104]
The operation of the image processing system having the above configuration will be described below. Also in the third embodiment, as in the first and second embodiments, an image that is picked up by the electronic camera 300 and that has undergone band degradation in the optical system and has only one color component at each pixel position is the
[0105]
Next, correction is performed by repeating similar processing a plurality of times. The first process is performed on the image in the
[0106]
Since the image in the single-
[0107]
From the second time on, the error image in the
[0108]
First, the following processing is performed for each pixel position (x, y) of the image in the
[0109]
The neighborhood reading unit 309 reads a predetermined rectangular area (for example, 5 × 5 pixels) at the pixel position (x, y) as a neighborhood image h (p, q). In the following description, the set of variables (p, q) is a relative coordinate with respect to the central pixel (x, y) of this neighboring image. For example, if the size of the neighborhood is 5 × 5, [−2, −1]. , 0, 1, 2] × [−2, −1, 0, 1, 2]. In some cases, the colors R, G, and B will be described in correspondence with integer values c = 0, 1, and 2, respectively.
[0110]
The read neighborhood image is sent to the
[0111]
The
[0112]
When the neighborhood image h (p, q) is transferred, the least square approximation unit 312 performs processing according to the flow shown in FIG. 5, and after the degradation that approximates the neighborhood image best, as in the first and second embodiments. The template index min_i and approximate coefficients min_α (c) and min_β (c) are calculated and transferred to the post-degradation template processing unit 313 and the band / color
[0113]
The processing in the band / color
[0114]
The post-degradation template processing unit 313 first, like the color
[0115]
In the middle of the processing, a plurality of approximate pixel values are obtained for each pixel position in the
[0116]
In the three-plate
And the new counter ZfnewThe value of (p, q) is an expression
Zfnew(p, q) = Zf (p, q) +1
And Sfnew(p, q, c) and Zfnew(p, q) is written back to the area corresponding to the neighboring image in the
[0117]
On the other hand, the single plate
And a new counter Zg ′newThe value of (p, q) is
Zg 'new(p, q) = Zg '(p, q) +1
And Sg ′new(p, q) and Zg ′new(p, q) is written back to the area corresponding to the neighboring image in the single-
[0118]
When the above processing is completed for each pixel position of the image in the
[0119]
In the first process, finally, the
[0120]
In the second and subsequent processes, the neighborhood reading unit 309 switches the subsequent input to the difference image buffer 309, and the processes so far are repeated for the difference image. In this repetition, only the
[0121]
The
[0122]
In other cases, the complexity s of the neighborhood image is calculated, the complexity s is transferred to the
[0123]
During this time, the fine structure that could not be captured in the previous approximation is calculated into a difference image, the difference image is subjected to deterioration correction by approximation with a template having a complexity corresponding to the fine structure, and the result is accumulated in the
[0124]
In the third embodiment, various changes can be considered in the constituent elements. For example, the definition of the complexity s includes various candidates such as the intensity of the differential image in addition to the ones raised here. Various noise judgment criteria of the
[0125]
In order to speed up the processing, it is possible to perform a multi-step process in one step. In this case, the three-plate
[0126]
For each pixel position (x, y) of the image in the
[0127]
The least square approximation unit 312 calculates an index and an approximation coefficient of a template that best approximates the neighborhood image h (p, q) among the degraded templates selected by the
[0128]
The band / color
[0129]
On the other hand, the post-degradation template processing unit 313 calculates a three-color image g (p, q, c) in which only missing color components are corrected with respect to the neighborhood image h (p, q), and further calculates g (p, q , c) is sampled according to the color filter arrangement of the electronic camera 300 in the neighboring image to obtain an image g ′ (p, q). g ′ (p, q) is transferred to the
[0130]
The
[0131]
As a result, the post-degradation templates are applied to the neighboring images at the respective pixel positions in order of increasing complexity, and the omission of the color component of the central pixel value of the neighboring image and the degradation of the band are corrected based on the fitting result, and the
[0132]
When the electronic camera 300 does not have the crystal filter 303 and the band is not limited, the template holding ROM 311 includes only the pre-degradation
[0133]
The fourth embodiment of the present invention will be described below. FIG. 7 is a diagram showing the configuration of an image processing system to which the fourth embodiment of the present invention is applied, and FIG. 8 is a diagram showing the configuration of the least
[0134]
7, the electronic camera 400 has the same configuration as that of the second embodiment except that the single-plate Bayer array CCD in FIG. 4 is replaced with a single-plate RGB random array CCD 404. Information on the color filter array of the single-plate RGB random array CCD 404 in the electronic camera 400 is held in advance in the color component
[0135]
The image processing apparatus 401 includes an
[0136]
As shown in FIG. 8, the least
[0137]
In FIG. 7, an
[0138]
In FIG. 8, in addition to the
[0139]
The
[0140]
Similar to the second embodiment, the
[0141]
As shown in FIG. 7, the band / color
[0142]
The three-
[0143]
The single-panel image buffer 417b is connected to output the stored content to the residual adding
[0144]
The operation of the image processing system having the above configuration will be described below.
[0145]
The subject image captured by the electronic camera 400 is band-limited by the lens 402 and the crystal filter 403 and formed on the single-plate RGB random array CCD 404 as a deteriorated optical image, as in the first to third embodiments. . The single-plate RGB random array CCD 404 acquires any one of RGB color information of the deteriorated image for each pixel, and transfers the obtained image to the
Thereafter, the image processing apparatus 401 performs the following processing for each pixel position (x, y) of the image information in the
[0146]
A predetermined rectangular area (for example, 5 × 5 pixels) centered on the processing pixel position is read by the
[0147]
The least square
[Expression 4]
[0148]
Approximation coefficients α (c) and β (c) that minimize
[0149]
Here, mask (p, q, c) is determined if a color filter corresponding to the color component c exists at a position corresponding to the coordinates (p, q) in the neighboring image on the single-plate RGB random array CCD 404. 1 is a mask that takes 0 if not, and is calculated by the color component
[0150]
The approximate error e (c) is output to the approximate
[0151]
The
[0152]
The
[0153]
After all the post-degradation templates Φi are processed, the approximate coefficients min_α (c) and min_β (c) (c = 0, 1, 2) and the index min_i held in the
[0154]
Next, the color image g (p, q, c) is sampled according to the color filter arrangement of the electronic camera 400 in the neighboring image using the mask (p, q, c) calculated by the color component
[0155]
The band / color
[0156]
In the middle of the processing, in the three-
[0157]
In the
And the new counter Zfnewthe value of (p, q)
Zfnew(p, q) = Zf (p, q) +1
Calculated by Sfnew(p, q, c) and Zfnew(p, q) is written back into the region for the neighboring image in the three-
[0158]
On the other hand, when g ′ (p, q) is transferred from the
The new counter Zg ′newthe value of (p, q)
Zg 'new(p, q) = Zg (p, q) +1
And Sg ′new(p, q) and Zg ′new(p, q) is written back to the area corresponding to the neighboring image in the single-panel image buffer 417b.
[0159]
When the above processing is completed for each pixel position of the image in the
[0160]
Further, the following processing is performed on the image in the approximate image buffer 417.
[0161]
For each pixel position (x, y) of the image in the
[0162]
The regularity determination unit 419 evaluates whether or not the input residual image d (p, q) is an image having a regular structure, using the same determination criteria as in the third embodiment. First, d (p, q) is normalized to a maximum value of 1 and a minimum value of 0, and a Laplacian filter is applied. The result is squared over the entire image and compared with a predetermined threshold. If it is below the threshold value, it is determined that it has a regular structure, and the value d (0,0) of the central pixel of the residual image is output to the residual adding
[0163]
The residual adding
[0164]
d ′ (0,0, c) = d (0,0) (when c = c ′)
[Equation 5]
[0165]
When this process is completed for all the positions (x, y), the missing color component and the band deterioration are corrected within a range in which the template in the
[0166]
When the electronic camera 400 does not have the crystal filter 403 and the band is not limited, the
[0167]
In order to speed up the processing, a configuration without the approximate image buffer 417 is also possible. In this case, since the least
[0168]
The fifth embodiment of the present invention will be described below. FIG. 9 is a diagram showing a configuration of an image processing system to which the fifth embodiment of the present invention is applied, and includes an electronic camera 500 and an image processing device 501.
[0169]
The electronic camera 500 of this embodiment has the same configuration as that of the electronic camera 200 in the second embodiment except that the crystal filter 203 provided for band limitation is not provided. The output of the
[0170]
The image processing apparatus 501 includes an
[0171]
In FIG. 9, the
[0172]
Since there is no band deterioration due to the crystal filter in the input image, the
[0173]
The color
[0174]
The single-
[0175]
The operation of the image processing system having the above configuration will be described below.
[0176]
An image that is picked up by the electronic camera 500 and includes only band degradation due to the lens 502 and has only one color component at each pixel position is held in the
[0177]
The
[0178]
The read neighborhood image is sent to the
[0179]
The
[0180]
When there is a request for reading the i-th template from another connected component, the
[0181]
When the neighborhood image is transferred, the least squares count calculation unit 512 performs processing according to the flow shown in FIG. 5, and the template index min_i and the approximation coefficient min_α that best approximates the neighborhood image as in the previous embodiments. (c) and min_β (c) are calculated and transferred to the single panel
[0182]
In the color
g (p, q, c) = min_α (c) Φmin_i (p, q) + min_β (c) (c = 0,1,2)
Accordingly, a three-color image g (p, q, c) in which the lack of color components in the neighborhood image h (p, q) is approximately filled is generated and transferred to the three-plate image adding unit 515a.
[0183]
The single-panel
[0184]
In the middle of the processing, a plurality of approximate pixel values are obtained for each pixel position in the output image buffer 517 and the single-
[0185]
In the three-plate image adding unit 515a, the average approximate pixel value Sg (p, q, c) and the counter Zg (p, q) of each pixel in the region corresponding to the neighboring image are read from the image output buffer 517 and transferred. A new average approximate pixel value Sg using the obtained g (p, q, c)new(p, q, c) is the formula
And the new counter ZgnewThe value of (p, q) is an expression
Zgnew(p, q) = Zg (p, q) +1
Calculated by Sgnew(p, q, c) and Zgnew(p, q) is written back to the area corresponding to the neighboring image in the image output buffer 517.
[0186]
On the other hand, in the single-plate
And a new counter Zg ′newThe value of (p, q) is
Zg 'new(p, q) = Zg '(p, q) +1
And Sg ′new(p, q) and Zg ′new(p, q) is written back to the area corresponding to the neighboring image in the single-
[0187]
When the above processing is completed for each pixel position of the image in the
[0188]
In the second process, the following process is performed for each pixel position (x, y) in the
[0189]
The
[0190]
The
[0191]
The relative noise scale L represents the regularity of d (p, q) in the range of 0-1. If L is below a predetermined threshold, d (p, q) does nothing even if it is noise. If it is equal to or greater than a predetermined threshold, d (p, q) is transferred to the
[0192]
Unlike the first processing, the
[0193]
The
[0194]
When the neighborhood image h (p, q) is transferred, the least square coefficient calculation unit 512 performs the same process as the first time, and the index min_i and the approximation coefficient of the template that best approximates the neighborhood image h (p, q). min_α (c) and min_β (c) are calculated and transferred only to the color
[0195]
Unlike the first process, the process in the color
g (0,0, c) = min_α (c) Φ ′ (p, q) + min_β (c) (c = 0,1,2)
Thus, the recovered pixel value g (0,0, c) (c = 0,1,2,2) corresponding to h (0,0) is generated and transferred to the three-plate image adding unit 515a.
[0196]
For each pixel in the region corresponding to the neighborhood image h (p, q) in the output image buffer 517, the pixel values Sg (p, p, 3) of three colors obtained by approximation with the template in the
Sgnew(0,0, c) = (1-L) .Sg (0,0, c) + L.g (0,0, c) (c = 0,1,2)
The new value Sg of the pixel position bynew(0,0, c) (c = 0, 1, 2) is calculated and written back to the image output buffer 517. When the second process is completed for each pixel position in the input image buffer, the output image buffer 517 obtains a three-color image in which the lack of color components has been recovered.
[0197]
The sixth embodiment of the present invention will be described below. 10 to 12 are diagrams for explaining the sixth embodiment, FIG. 10 is a diagram illustrating a configuration of an image processing system to which the present embodiment is applied, and FIG. 11 is a combined least square approximation unit in FIG. FIG. 12 is an explanatory diagram of the operation of the combined least
[0198]
In FIG. 10, the image processing system according to the present embodiment includes an electronic camera 600 and an image processing apparatus 601, and the electronic camera 600 has the same configuration as the electronic camera 400 according to the fourth embodiment. An
[0199]
The image processing apparatus 601 includes an
[0200]
Further, as shown in FIG. 11, the combined least
[0201]
The
[0202]
The configuration of the template holding ROM 611 and the connection relationship among the template holding ROM 611, the band / color
[0203]
In the present embodiment, as in the first embodiment, a plurality of correction values are calculated for each pixel during processing, and therefore, they are weighted and averaged based on the reliability of each correction value. Therefore, the output image buffer 616 holds a confidence value necessary for calculating a weighted average in addition to image data at each pixel position.
[0204]
The neighborhood image buffer 612f in the combined least
[0205]
The
[0206]
In addition to the
[0207]
The operation of the image processing system configured as described above will be described below.
[0208]
The subject image picked up by the electronic camera 600 is subjected to band limitation by the lens 602 and the crystal filter 603 and is deteriorated on the single-plate RGB random array CCD 604 as a deteriorated optical image as in the first to fourth embodiments. It is formed. The single-plate RGB random array CCD 604 acquires any one of RGB color information of the deteriorated image for each pixel, and transfers the obtained image to the
[0209]
Thereafter, the following processing is performed for each pixel position (x, y) of the image information in the
[0210]
A predetermined rectangular region (for example, 5 × 5 pixels) centered on the processing pixel position (x, y) is read out as a neighborhood image h (p, q) by the
[0211]
The neighborhood image h (p, q) read by the
[0212]
The least square
[Formula 6]
[0213]
Approximation coefficients α (c) and β (c) that minimize
[0214]
The approximate error e (c) is output to the approximate
[0215]
FIG. 12 is a diagram for explaining the operation of the combined least square approximation unit. (A) shows an arbitrary neighborhood image, (b) shows N templates from 0 to N−1, and (c ) Is a table T, (d) is a table T after sorting, (e) is a set V, (f) is a variable U, and (g) is a composite template.
[0216]
As shown in FIG. 12C, the table T has a cumulative approximate error corresponding to the indexes i ′ and Φi ′ (p, q) of the templates Φi ′ (p, q) (i ′ <i) so far. , And the approximation coefficient are registered in the (i ′ + 1) th row. FIG. 12C illustrates a case where the neighborhood image h (p, q) shown in FIG. 12A is approximated by the template Φi (p, q) shown in FIG.
[0217]
When the accumulated approximate error e is transferred from the approximate
[0218]
When the least square
[0219]
First, N internal variables mark (i) (i = 0 to N−1) and a counter total_mark are all initialized to zero. Next, the rows of the table T are rearranged in ascending order of the cumulative approximate error as shown in FIG. 12D, and the template index corresponding to the row with the smallest cumulative approximate error is set to k ′. In FIG. 12D, k ′ is 3. At the same time, the approximation coefficients corresponding to k ′ are αm (c) and βm (c) (c = 0, 1, 2). Further, mark (k ′) is set to 1 and total_mark is set to 1.
[0220]
Thereafter, each row is read in the order of the rearranged rows, and if the cumulative approximation error is smaller than a predetermined threshold value, the approximate coefficient value of that row is read into the variables α (c) and β (c) and αm ( c) Take absolute values eα and eβ of the difference from βm (c). Only when αm (c) and α (c) have the same sign and eα and eβ are smaller than a predetermined threshold, mark (k) is set to 1 using the template index k of that row, and total_mark is incremented by 1. If the total_mark reaches a predetermined upper limit value M ′ or if this process is completed for all the rows, the repetition ends.
[0221]
When this process ends, a set V of template indexes k in which mark (k) is 1 is formed as shown in FIG. Each element of the integer set V is an index of a template in which the approximation error is similar to the template k ′ having the smallest cumulative approximation error and the approximation error is sufficiently small.
[0222]
Subsequently, all subsets having a predetermined number of elements are created from V and registered in variables U (j) (j = 0 to M−1) having values of the respective subsets as shown in FIG. To do. In FIG. 12F, the number of elements in each subset is two. Here, M is the total number of subsets that satisfy the condition. Further, a composite template Φ′j (p, q) is constructed for the variable U (j) according to the following equation.
[0223]
[Expression 7]
[0224]
In this expression, k takes all integer values included in the integer set U (j). The function max calculates the maximum value of the arguments for all k. Positive real number λ (j, k) and positive real number μ (j, k) are used to normalize λ (j, k) Φk (p, q) + μ (j, k) to
[0225]
FIG. 12G illustrates a composite template Φ′j (p, q). variable
[Equation 8]
[0226]
Is held in the
[0227]
When the processing of the
[Equation 9]
[0228]
Approximation coefficients α ′ (c) and β ′ (c) for minimizing are calculated, and an approximation error e ′ (c) is output to the approximation error accumulating unit 612j. In the approximate error accumulating unit 612j, the approximate error e ′ (c) is cumulatively added for all the color components, and the accumulated approximate error e ′ = e ′ (0) + e ′ (1) + e ′ (2) is transferred to the
[0229]
The
[0230]
Further, the
[0231]
After all the templates Φ′j (p, q) have been processed by the least square coefficient calculation unit 612i, the
[Expression 10]
[0232]
At the same time, an approximate evaluation value A ′ that is inversely proportional to the minimum value min_e ′ of the approximate error is calculated by A ′ = 1 / (1 + min_e ′). And
## EQU11 ##
[0233]
And A ′ are transferred to the band / color
[0234]
The band / color
[Expression 12]
[0235]
Is used to obtain a neighborhood corrected approximate image f (p, q, c) that approximates the image before degradation of the neighborhood image from the following equation.
[0236]
[Formula 13]
[0237]
Then, f (p, q, c) is transferred to the three-plate image adding unit 615 together with the approximate evaluation value A ′.
[0238]
In the middle of the process, the average value and the reliability value of a plurality of corrected pixel values obtained by the process so far are held at each pixel position of the output image buffer 616. The three-plate image adding unit 615 reads the average value Sf (p, q, c) and the reliability value Q (p, q, c) of the corrected pixel values in the region corresponding to the neighboring image from the output image buffer 616, and From the neighborhood correction approximate image f (p, q, c) and the approximate evaluation value A ′ transferred from the band / color
Sfnew(p, q, c) and Qnew(p, q) is written in the area corresponding to the neighboring image in the output image buffer 616.
[0239]
When these processes are completed for all the pixel positions, for each pixel of the image in the
[0240]
Although the accuracy of correction is low, when the memory capacity is reduced and the processing is not speeded up, a configuration in which the image adding unit 615 is deleted and no reliability value is held in the output image buffer 616 can be considered. In this case, the band / color
[0241]
Further, when the electronic camera 600 does not have the crystal filter 603 and the band is not limited, the template holding ROM 611 includes only the pre-degradation
[0242]
In this case, the operation of each part is the same except that Ψi is used instead of Φi as a template in the combined least
[0243]
In this modified example, it is easily guessed that the same processing speed can be achieved if the same modification as the modified example for speeding up the above-described processing is performed.
[0244]
The specific embodiment described above includes an invention having the following configuration.
[0245]
(1) In an image processing apparatus that recovers an original image signal from an image signal that lacks information on at least one or more spectral characteristics according to the position of a pixel,
A neighborhood image extracting means for extracting a neighborhood image of a predetermined size including a designated pixel from an image signal lacking the information;
A template holding means for holding a template group based on a plurality of geometric patterns of the same size as the neighboring image extracted by the neighboring image extracting means;
Optimal template that most closely resembles the neighborhood image by matching between the information of the plurality of spectral characteristics included in the neighborhood image extracted by the neighborhood image extraction means and the plurality of template groups held by the template holding means A neighborhood approximate image generation means for generating a neighborhood approximate image that approximates a neighborhood image based on the optimal template;
Based on the neighborhood approximate image generated by the neighborhood approximate image generation means, a restoration means for restoring missing information in the designated pixel;
An image processing apparatus comprising:
[0246]
(2) The restoration unit restores the weighted average of information on the at least one spectral characteristic of the plurality of neighboring approximate images obtained from the plurality of neighboring images including the designated pixel. The image processing apparatus according to configuration (1), wherein:
[0247]
(3) The template holding unit includes a first template group based on a plurality of geometric patterns, and a second template obtained by degrading the first template group according to the band limiting characteristic of the optical system of the imaging apparatus. And having a group
The neighborhood approximate image generation means selects an optimal template similar to the neighborhood image from the second template group, and generates a neighborhood approximate image before band limitation based on the first template group corresponding to the template. The image processing apparatus according to (1) or (2), characterized in that
[0248]
(4) The restoration unit calculates difference information between the neighborhood image and the neighborhood approximate image, extracts only a structural component from the difference information based on a predetermined evaluation function, and uses the contrast information of the structural component. The image processing apparatus according to the configuration (2) or (3), wherein the missing information in the designated pixel is restored by modulating a luminance component of the neighborhood approximate image.
[0249]
(5) The restoration unit calculates difference information between the neighborhood image and the neighborhood approximate image, extracts only a structural component from the difference information based on a predetermined evaluation function,
The neighborhood approximate image generation means generates a third template group based on the structural component, generates a neighborhood reapproximation image that approximates the neighborhood image by the third template group,
The image processing apparatus according to (2), wherein the restoration unit restores missing information in the designated pixel based on the neighborhood approximate image and the neighborhood re-approximation image.
[0250]
(6) The template group held in the template holding means is classified for each different resolution,
The restoration means calculates difference information between the neighborhood image and the neighborhood approximate image, extracts only a structural component from the difference information based on a predetermined evaluation function,
The neighborhood approximate image generation means performs matching between the structural component and a template group corresponding to the resolution of the structural component in the template group, selects an optimal template, and approximates the difference information from the optimal template. A difference neighborhood approximation image is generated,
The restoration means restores missing information in the designated pixel based on the difference neighborhood approximation image and the neighborhood approximation image, and extracts a new structural component from the difference information between the difference neighborhood approximation image and the structure component The image processing apparatus according to the configuration (2), wherein the restoration process is repeated until the structural component is equal to or less than a predetermined threshold value.
[0251]
(7) The second template group held in the template holding means is classified for each different resolution,
The restoration means calculates difference information between the neighborhood image and the neighborhood approximate image, extracts only a structural component from the difference information based on a predetermined evaluation function,
The neighborhood approximate image generation means performs matching between the structural component and a template group corresponding to the resolution of the structural component in the second template group, selects an optimal template, and calculates the difference from the optimal template. Generate a difference neighborhood approximation image that approximates information,
The restoration means restores missing information in the designated pixel based on the difference neighborhood approximation image and the neighborhood approximation image, and extracts a new structural component from the difference information between the difference neighborhood approximation image and the structure component The image processing apparatus according to the configuration (3), wherein the restoration process is repeated until the structural component falls below a predetermined threshold.
[0252]
(8) The restoration unit calculates spatial correlation information from the neighborhood approximated image, and applies an autoregressive model to the designated pixel based on the spatial correlation information, thereby missing information in the designated pixel. The image processing apparatus according to any one of configurations (1), (2), and (3), wherein:
[0253]
(9) The neighborhood approximate image generating means performs matching between the neighborhood image and the plurality of template groups, and generates a single optimum template by synthesizing a plurality of templates with a small matching error. The image processing device according to (1) or (2).
[0254]
(10) The neighborhood approximate image generation means performs matching between the neighborhood image and the second template group, and generates a single optimum template by synthesizing a plurality of templates with a small matching error. The image processing apparatus according to the feature (3).
[0255]
(11) The neighborhood approximate image generation unit selects the optimum template that is most similar to the neighborhood image by multiplying the template group held in the template holding unit by a constant α, and adding and deforming the constant β. The image processing apparatus according to any one of the configurations (1), (2), (4) to (6), (8), and (9).
[0256]
(12) The neighborhood approximate image generation means multiplies the second template group held in the template holding means by a constant α, adds the constant β, and deforms the optimal image that is most similar to the neighborhood image. The image processing apparatus according to any one of (3), (7), and (10), wherein a template is selected.
[0257]
Correspondences between configurations (1) to (12) and the above-described embodiments are as follows.
[0258]
A. The configuration (1) corresponds to at least the first to sixth embodiments,
In the first embodiment, the neighborhood image extraction unit corresponds to the
[0259]
In the second embodiment, the neighborhood image extraction unit corresponds to the
[0260]
In the third embodiment, the neighborhood image extraction unit corresponds to the
[0261]
In the fourth embodiment, the neighborhood image extraction unit corresponds to the
[0262]
In the fifth embodiment, the neighborhood image extraction unit corresponds to the
[0263]
In the sixth embodiment, the neighborhood image extraction unit corresponds to the
[0264]
For each neighborhood of an image in a single plate state, the neighborhood approximate image generation means determines one template that best approximates all of the plurality of spectral components, and the restoration means performs interpolation based on the template. Compared to the case where the luminance component and the color component are distinguished and handled, it is not affected by moire, and fine geometric features included in the vicinity can be detected.
[0265]
This solves the problem P1 to be solved by the invention described below. Further, since it is not necessary to obtain a specific color component at a high sampling density, P2 is also solved.
[0266]
B. The configuration (2) corresponds to at least the first to sixth embodiments,
In the first embodiment, the restoration unit corresponds to the three-plate image adding unit 115 and the output image buffer 116.
[0267]
In the second embodiment, the restoration unit corresponds to the interpolation coefficient calculation unit 215, the
[0268]
In the third embodiment, the restoration unit corresponds to the three-plate
[0269]
In the fourth embodiment, restoration means corresponds to the
[0270]
In the fifth embodiment, the restoration unit corresponds to the three-plate image addition unit 515a, the single-plate
[0271]
In the sixth embodiment, the restoring unit corresponds to the three-plate image adding unit 615 and the output image buffer 616.
[0272]
For each pixel of the input image, a neighborhood approximate image for each of a plurality of neighborhoods including the pixel is generated by the neighborhood approximate image generation unit, and a restoration unit weights the approximate value of the pixel in the plurality of neighborhood approximate images. As a result of calculating the final approximate value of the pixel, the approximation error in each neighborhood is corrected.
[0273]
This solves the problem P3 to be solved by the invention described below.
[0274]
C. The configuration (3) corresponds to at least the first, second, third, fourth, and sixth embodiments,
In the first embodiment, the template holding unit corresponds to the
[0275]
In the second embodiment, the template holding unit corresponds to the
[0276]
In the third embodiment, the template holding unit corresponds to the template holding ROM 311. The neighborhood approximate image generation unit corresponds to the
[0277]
In the fourth embodiment, the template holding unit corresponds to the
[0278]
In the sixth embodiment, the template holding unit corresponds to the template holding ROM 611. The neighborhood approximate image generation unit corresponds to the combined least
[0279]
The template holding means has a first template group based on a plurality of geometric patterns, and a second template group obtained by degrading the first template group in accordance with the band limiting characteristic of the optical system of the imaging apparatus, and an input The neighborhood approximate image generating means selects the most similar optimal template from the second template group for the neighborhood of each pixel of the image, and the neighborhood approximation before band limitation based on the template of the first template group corresponding thereto As a result of generating the image, an image in which the band degradation of the optical system is corrected is obtained.
[0280]
This solves the problem P5 to be solved by the invention described below.
[0281]
D. The configuration (4) corresponds to at least the fourth embodiment.
[0282]
The restoration means corresponds to the
[0283]
The neighborhood approximate image generating means generates a neighborhood approximate image for the neighborhood of each pixel of the input image, and the restoration means calculates difference information between the neighborhood and the neighborhood approximate image, and extracts only structural components from this difference information. By modulating the luminance component of the neighborhood approximate image using the contrast information of the structural component, even if the neighborhood cannot be completely approximated by the template, the component having a regular structure in the approximation error is reflected in the luminance component of the output image. The
[0284]
This solves the problem P7 to be solved by the invention described below.
[0285]
E. The configuration (5) corresponds to at least the fifth embodiment.
[0286]
The neighborhood approximate image generation unit corresponds to the
[0287]
For the neighborhood of each pixel of the input image, the neighborhood approximate image generating means first generates a neighborhood approximate image, the restoration means calculates a difference image that is an error between the neighborhood and the neighborhood approximate image, and the neighborhood approximate image generating means A structural component is calculated from the image based on a predetermined evaluation function to generate a third template group. Next, the neighborhood approximate image generating means approximates the neighborhood again with the third template group, and generates a neighborhood re-approximation image. Finally, the restoration unit performs correction based on the neighborhood approximate image and the neighborhood re-approximation image. As a result, even when the neighborhood includes a regular structure that cannot be approximated by the template of the template holding means, the structure is extracted from the difference image representing the approximation error and re-approximate.
[0288]
This solves the problem P7 to be solved by the invention described below.
[0289]
F. At least the third embodiment corresponds to configurations (6) and (7).
[0290]
The template holding unit corresponds to the template holding ROM 311. The neighborhood approximate image generation unit corresponds to the
[0291]
The template holding means has a group of templates classified for different resolutions, and the neighborhood approximate image generating means raises the resolution of the template from a template with a low resolution to a template with a high resolution for the vicinity of each pixel of the input image. Since the approximation error is reduced, approximation processing can be performed at high speed without preparing a template having a complicated structure.
[0292]
This solves the problem P4 to be solved by the invention described below.
[0293]
G. The configuration (8) corresponds to at least the second embodiment.
[0294]
The restoration unit corresponds to the interpolation coefficient calculation unit 215, the
[0295]
For each pixel neighborhood of the input image, the neighborhood approximate image generating means generates a neighborhood approximate image, and the restoration means calculates spatial correlation information from the neighborhood approximate image, and based on this spatial correlation information, autoregression for the pixel is performed. By restoring the missing information by applying the model, the interpolation process is performed in a common procedure regardless of the template selected by the neighborhood approximate image generating means.
[0296]
This solves the problem P6 to be solved by the invention described below.
[0297]
H. At least the sixth embodiment corresponds to the configurations (9) and (10).
[0298]
The neighborhood approximate image generation unit corresponds to the combined least
[0299]
The neighborhood approximate image generating means generates a single optimum template by synthesizing a plurality of templates with a small approximation error for the vicinity of each pixel of the input image.
[0300]
This solves the problem P8 to be solved by the invention described below.
[0301]
I. The configurations (11) and (12) correspond to at least the first to sixth embodiments.
[0302]
In the first embodiment, the neighborhood approximate image generation unit corresponds to the least
[0303]
In the second embodiment, the neighborhood approximate image generation unit corresponds to the least
[0304]
In the third embodiment, the neighborhood approximate image generation unit corresponds to the
[0305]
In the fourth embodiment, the neighborhood approximate image generation unit corresponds to the least
[0306]
In the fifth embodiment, the neighborhood approximate image generation unit corresponds to the
[0307]
In the sixth embodiment, the neighborhood approximate image generation unit corresponds to the combined least
[0308]
For the neighborhood of each pixel of the input image, the neighborhood approximate image generation means first multiplies the template by a constant α for each color component in the neighborhood, and optimally approximates the color component by a modified template obtained by adding the constant β. The coefficients α and β are obtained. Next, the approximation error due to the deformation template when the coefficients α and β that give the optimum approximation for each color component are used is calculated as a single color approximation error, and the neighborhood approximation by the template is based on the single color approximation error of all the color components. By evaluating the degree, it is possible to approximate a plurality of color components with one template.
[0309]
This solves the problems P1 and P2 to be solved by the invention described below.
[0310]
Problems to be solved by the invention solved by the above-described configurations (1) to (12) are as follows.
[0311]
P1
In the prior art, there is information that is missing even in a luminance component given at a relatively high sampling density, and only degraded information can be obtained as compared with the luminance component obtained by the three-plate method. Also, other color components calculated based on the luminance component can only obtain information that is deteriorated as compared with the color components obtained by the three-plate method.
[0312]
P2
The prior art does not describe a method for processing an input image having an arbitrary color filter arrangement. In the interpolation of the luminance component, it is necessary to prepare a geometric feature prepared in advance and an interpolation method corresponding to the geometric feature, and it is necessary to change the design when the color filter arrangement is changed.
[0313]
P3
The prior art does not describe a method for dealing with malfunction due to the influence of noise. When the luminance component and other color components are processed, the interpolation is performed in a single process, and therefore, the luminance component and other color components are easily affected by pulse noise. In particular, in the luminance component processing, geometric features are classified in a 3 × 3 local region, and therefore misclassification due to noise is likely to occur.
[0314]
P4
In the prior art, when the size of the region for determining the geometric feature is increased in order to reduce the influence of noise, the determination cannot be performed at high speed.
[0315]
P5
In the prior art, there is no description regarding recovery of information whose bandwidth is limited by the optical system of the imaging apparatus. Luminance components and color components of other colors are processed within a band-limited range, and band recovery cannot be handled.
[0316]
P6
In the prior art, a plurality of interpolation methods are prepared according to geometric features, and no single method is described. When the luminance component is interpolated based on geometric features, it is necessary to prepare interpolation methods corresponding to the number of geometric features. For high-precision processing, it is necessary to increase the number of geometric features, but an interpolation method must be considered in accordance with this, and the processing becomes complicated.
[0317]
P7
The prior art does not describe a countermeasure for a case where the geometric feature prepared in advance and the interpolation method corresponding thereto are not applicable. When the luminance component is classified according to geometric features, it is forcibly classified into one of the geometric features, so an error occurs in a non-applicable region and high-precision processing cannot be performed. .
[0318]
P8
In the prior art, high-precision processing cannot be performed unless the geometric features prepared in advance and the corresponding interpolation method are applied.
[0319]
【The invention's effect】
According to the first aspect of the present invention, it is possible to obtain a high-definition image as compared with the prior art and to process an input image having an arbitrary color filter arrangement.
[0320]
Further, according to the invention described in
[0321]
Further, according to the invention described in
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of an image processing system to which a first embodiment of the present invention is applied.
FIG. 2 is a diagram illustrating a configuration of a least square approximation unit illustrated in FIG. 1 and its peripheral circuits.
FIG. 3 is an explanatory diagram of a mask generated by a color component mask generation unit.
FIG. 4 is a diagram illustrating a configuration of an image processing system to which a second embodiment of the present invention is applied.
5 is a flowchart showing the flow of processing of a least
FIG. 6 is a diagram showing a configuration of an image processing system to which a third embodiment of the present invention is applied.
FIG. 7 is a diagram showing a configuration of an image processing system to which a fourth embodiment of the present invention is applied.
8 is a diagram showing a configuration of a least square approximation unit shown in FIG. 7 and its peripheral circuits.
FIG. 9 is a diagram showing a configuration of an image processing system to which a fifth embodiment of the present invention is applied.
FIG. 10 is a diagram illustrating a configuration of an image processing system to which a sixth embodiment of the present invention is applied.
11 is a diagram showing a configuration of a combined least squares approximation unit shown in FIG. 10 and its peripheral circuits.
FIG. 12 is a diagram for explaining the operation of a combined least squares approximation unit.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 100 ... Electronic camera, 101 ... Image processing apparatus, 102 ... Lens, 103 ... Crystal filter, 104 ... Single-plate RGB random array CCD, 105 ... A / D conversion part, 106 ... Filter arrangement information holding ROM, 107 ... Image buffer, DESCRIPTION OF
Claims (3)
前記情報が欠落する画像信号から、指定された画素を包含する所定サイズの近傍画像を抽出する近傍画像抽出手段と、
この近傍画像抽出手段によって抽出された近傍画像と同一サイズの複数の幾何学的パターンに基づくテンプレート群を保持するテンプレート保持手段と、
前記近傍画像抽出手段によって抽出された近傍画像に含まれる複数の分光特性の情報と、上記テンプレート保持手段によって保持された複数のテンプレート群との間でマッチングを行なって近傍画像に最も類似する最適テンプレートを選択し、この最適テンプレートに基づき近傍画像を近似する近傍近似画像を生成する近傍近似画像生成手段と、
この近傍近似画像生成手段によって生成された近傍近似画像に基づき、前記指定された画素における欠落する情報を復元する復元手段と、
を具備することを特徴とする画像処理装置。In an image processing apparatus for recovering an original image signal from an image signal in which information on at least one or more spectral characteristics is missing depending on the position of the pixel,
A neighborhood image extracting means for extracting a neighborhood image of a predetermined size including a designated pixel from an image signal lacking the information;
A template holding means for holding a template group based on a plurality of geometric patterns of the same size as the neighboring image extracted by the neighboring image extracting means;
Optimal template that most closely resembles the neighborhood image by matching between the information of the plurality of spectral characteristics included in the neighborhood image extracted by the neighborhood image extraction means and the plurality of template groups held by the template holding means A neighborhood approximate image generation means for generating a neighborhood approximate image that approximates a neighborhood image based on the optimal template;
Based on the neighborhood approximate image generated by the neighborhood approximate image generation means, a restoration means for restoring missing information in the designated pixel;
An image processing apparatus comprising:
前記近傍近似画像生成手段は、前記第2のテンプレート群から前記近傍画像に類似する最適テンプレートを選択し、これに対応する前記第1のテンプレート群に基づき帯域制限前の近傍近似画像を生成することを特徴とする請求項1または2記載の画像処理装置。The template holding means includes a first template group based on a plurality of geometric patterns, and a second template group obtained by degrading the first template group according to the band limiting characteristic of the optical system of the imaging device. Have
The neighborhood approximate image generating means selects an optimum template similar to the neighborhood image from the second template group, and generates a neighborhood approximate image before band limitation based on the first template group corresponding to the template. The image processing apparatus according to claim 1, wherein:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP00137797A JP3806477B2 (en) | 1997-01-08 | 1997-01-08 | Image processing device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP00137797A JP3806477B2 (en) | 1997-01-08 | 1997-01-08 | Image processing device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH10200902A JPH10200902A (en) | 1998-07-31 |
| JP3806477B2 true JP3806477B2 (en) | 2006-08-09 |
Family
ID=11499806
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP00137797A Expired - Fee Related JP3806477B2 (en) | 1997-01-08 | 1997-01-08 | Image processing device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3806477B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7164807B2 (en) * | 2003-04-24 | 2007-01-16 | Eastman Kodak Company | Method and system for automatically reducing aliasing artifacts |
| JP4545206B2 (en) * | 2008-05-09 | 2010-09-15 | オリンパス株式会社 | Image processing apparatus and recording medium storing image processing program |
-
1997
- 1997-01-08 JP JP00137797A patent/JP3806477B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH10200902A (en) | 1998-07-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6934056B2 (en) | Noise cleaning and interpolating sparsely populated color digital image using a variable noise cleaning kernel | |
| JP4610930B2 (en) | Image processing apparatus and image processing program | |
| JP3935548B2 (en) | Image signal processing device | |
| EP2160715B1 (en) | Image processing method and apparatus | |
| EP3706042B1 (en) | Image processing method, image processing apparatus, program, image processing system, and manufacturing method of learnt model | |
| CN103875019B (en) | Omni-focus image generation method and device, subject height information acquisition method and device | |
| US6646246B1 (en) | Method and system of noise removal for a sparsely sampled extended dynamic range image sensing device | |
| US8588521B2 (en) | Image processing apparatus and control method therefor | |
| CN112801870A (en) | Image splicing method based on grid optimization, splicing system and readable storage medium | |
| JP3233601B2 (en) | Image processing device | |
| US20090207271A1 (en) | Image Processor Correcting Color Misregistration, Image Processing Program, Image Processing Method, and Electronic Camera | |
| CN111010504A (en) | Image processing method, device and system, camera device and storage medium | |
| US7710470B2 (en) | Image processing apparatus that reduces noise, image processing method that reduces noise, electronic camera that reduces noise, and scanner that reduces noise | |
| WO1999067743A1 (en) | Image correcting method and image inputting device | |
| US6301381B1 (en) | Neurofilter, and method of training same to operate on image data such as to discriminate between text and picture regions of an image which is expressed by image data | |
| CN101534375A (en) | Method for correcting chromatic aberration | |
| JP3806477B2 (en) | Image processing device | |
| JP4583670B2 (en) | Image distortion correction apparatus and method | |
| Saito et al. | Demosaicing approach based on extended color total-variation regularization | |
| CN112241670B (en) | Image processing methods and devices | |
| JPH06153087A (en) | Method for correcting picture element defect | |
| JP3730063B2 (en) | Color component generation apparatus, color component generation method, and multicolor image pickup apparatus using the same | |
| JP3899144B2 (en) | Image processing device | |
| JP5153842B2 (en) | Image processing apparatus and image processing program | |
| JP2003134523A (en) | Image pickup apparatus and method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040106 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060414 |
|
| 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: 20060509 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060515 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100519 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100519 Year of fee payment: 4 |
|
| LAPS | Cancellation because of no payment of annual fees |