JP3952188B2 - Image interpolation apparatus, image interpolation method, and image interpolation program - Google Patents

Image interpolation apparatus, image interpolation method, and image interpolation program Download PDF

Info

Publication number
JP3952188B2
JP3952188B2 JP2003002192A JP2003002192A JP3952188B2 JP 3952188 B2 JP3952188 B2 JP 3952188B2 JP 2003002192 A JP2003002192 A JP 2003002192A JP 2003002192 A JP2003002192 A JP 2003002192A JP 3952188 B2 JP3952188 B2 JP 3952188B2
Authority
JP
Japan
Prior art keywords
image
pixel
data
interpolation
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003002192A
Other languages
Japanese (ja)
Other versions
JP2004215163A (en
Inventor
達矢 細田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2003002192A priority Critical patent/JP3952188B2/en
Publication of JP2004215163A publication Critical patent/JP2004215163A/en
Application granted granted Critical
Publication of JP3952188B2 publication Critical patent/JP3952188B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/403Edge-driven scaling; Edge-based scaling

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、画像を階調表現する画像データから補間処理を行って補間処理後の画像の各画素に対応した階調データを生成する画像補間装置、画像補間方法および画像補間プログラムに関する。
【0002】
【従来の技術】
従来、拡大前の画像(以下、拡大前画像とも記載)から構成画素数を増やした拡大画像を生成する際、拡大前画像の各画素の階調データ(拡大画像の階調データとも記載。以下、同様)を所定の補間処理により生成している。バイリニア法やバイキュービック法等による補間処理では、拡大画像上の注目画素の近隣に位置する拡大前画像における所定領域内の複数の画素の画像データを用いて拡大画像の階調データを生成している。また、拡大前画像の画素に対応して拡大画像の画素を区分したブロック単位で補間処理を行って拡大画像の階調データを生成するとともに、エッジ部分が鮮鋭となるように、拡大前画像の画像データに基づいてエッジの強調処理、鮮鋭化処理も行っている。
さらに、同じ画像の画像データに対して、複数の補間処理を行って階調データを重畳することも行われている(例えば、特許文献1参照)。同特許文献1に開示された技術では、一定条件ではキュービックコンボリューション補間を行って拡大画像の階調データを生成し、それ以外の条件では、拡大率別に補間データに対応させたマッチングパターンを用意しておき、パターンマッチングによりエッジとそのパターンを検出し、検出したパターンに対応する補間データを補間処理後の階調データとし、これらの階調データを重畳している。
【0003】
【特許文献1】
特開2002−165089号公報(段落0011−0094、第1−18図)
【0004】
【発明が解決しようとする課題】
上述した従来の技術においては、次のような課題があった。
エッジの領域を跨いだ複数の画素の画像データを用いて補間処理を行うと、注目画素に対してエッジの領域の向こう側にある画素の画像データが補間処理後の階調データに反映されるため、エッジ部分が平滑化され、ぼやけてしまうという問題があった。特に、ブロック単位で補間処理を行う場合、エッジのあるブロックについて鮮鋭化等の処理を行うと、エッジの領域が存在するブロック(エッジブロックとも記載)とエッジの領域が存在しないブロック(非エッジブロック)との間で色の差が発生してしまうという問題があった。
特許文献1に開示された技術でも、エッジの領域を跨いだ複数の画素の画像データが用いられてキュービックコンボリューション補間が行われると、エッジ部分が平滑化されてしまった。また、補間処理後のパターンを拡大率別に用意しておく必要があるため、固定された拡大率にしか適用することができず、任意倍率の実現が困難であった。さらに、階調データを重ね合わせる処理が必要であるため、補間処理に時間がかかりすぎていた。
【0005】
本発明は、上記課題にかんがみてなされたもので、補間処理後でもエッジ部分の鮮鋭さを維持して画質を向上させることが可能な画像補間装置、画像補間方法および画像補間プログラムの提供を目的とする。
【0006】
【課題を解決するための手段および発明の効果】
上記目的を達成するため、請求項1にかかる発明では、補間処理後の画像上の注目画素の近隣に位置する補間処理前の画像における所定領域内の複数の画素の画像データを参照して補間処理を行う際、同所定領域内の複数の画素のうち同注目画素に対応する補間処理前の画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて補間処理を行う。すると、補間処理の際に注目画素に対応した画素の画像データとの差異が大きい画素の画像データが用いられないので、実質的にはエッジの領域から注目画素側にある画素の画像データのみを用いた補間処理が行われる。すなわち、エッジ部分が平滑化されないので、補間処理後でもエッジ部分の鮮鋭さを維持して画質を向上させることが可能となる。
【0007】
ここで、複数の画素の画像データを参照する補間処理は、例えば、バイキュービック法による補間処理、バイリニア法による補間処理、等、様々な処理が考えられる。上記所定領域は、補間処理の種類に応じて、適宜決定すればよい。
上記所定領域内の複数の画素のうち上記注目画素に対応する補間処理前の画像における画素との画像データの差異が所定範囲内となる画素が一つとなっても、請求項1に記載した発明に含まれる。以下も、同様である。
上記画像データは、例えば、ビットマップデータ、圧縮されたデータ、等、様々なデータ形式の情報が考えられる。また、同画像データは、例えば、輝度データ(Y)と色差データ(Cb,Cr)とから構成されるYCbCrデータ、レッドデータ(R)とグリーンデータ(G)とブルーデータ(B)とから構成されるRGBデータ、シアンデータ(C)とマゼンタデータ(M)とイエローデータ(Ye)とグリーンデータ(G)とから構成されるCMYeGデータ、CIE規格とされたLab空間内のLabデータ、等、様々な種類のデータが考えられる。
【0008】
上記画像データは、上記画像の明るさが表されたデータであってもよい。なお、明るさが表された画像データは、輝度データ、明度データ、RGB各データの平均、等、様々な種類のデータが考えられる。同画像データの差異は、階調値の差、階調値の比、階調値の2乗の差、等、様々なものが考えられる。
【0009】
上記所定範囲には、境界部分を含めてもよいし、除いてもよい。画像データの差異が所定範囲内か否かは、例えば、同差異と所定のしきい値とを対比するにより判断することができる。ここで、しきい値は、固定された値でもよいし、条件に応じて変動する値でもよい。以下も、同様である。
【0010】
補間処理によりエッジ部分の平滑化が問題となるのは、特に画像を拡大する場合である。そこで、請求項2にかかる発明では、拡大画像上で注目画素を順次移動させながら同注目画素の近隣に位置する拡大前画像における所定領域内の複数の画素の画像データを参照して補間処理を行う際、同所定領域内の複数の画素のうち同注目画素に対応する拡大前画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて補間処理を行う。すなわち、エッジ部分の平滑化が特に問題となる画像拡大時でも、エッジ部分が平滑化されないので、補間処理後でもエッジ部分の鮮鋭さを維持して画質を向上させることが可能となる。
【0011】
ここで、拡大前画像の画素に対応して拡大画像の画素を区分した画素区分毎に同拡大画像上で注目画素区分を順次移動させながら同注目画素区分内の各画素について近隣に位置する拡大前画像における所定領域内の複数の画素の画像データを参照して補間処理を行う場合、同所定領域内の複数の画素のうち同注目画素区分に対応する拡大前画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて補間処理を行う構成としてもよい。すなわち、エッジ部分が平滑化されないので、補間処理後でもエッジ部分の鮮鋭さを維持して画質を向上させることが可能となる。また、エッジの領域が存在するブロックに鮮鋭化等の処理を行っても、エッジの領域が存在するブロックと存在しないブロックとで色の差が出なくなり、この点でも画質を向上させることができる。
【0012】
上記注目画素区分に対応する拡大前画像における画素との画像データの差異が所定範囲外となる画素の画像データを、同注目画素区分に対応する拡大前画像における画素の画像データに置き換えて上記補間処理を行う構成としてもよい。画像データを置き換えるという簡易な構成で、公知の補間処理を利用することができ、注目画素区分に対応する拡大前画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて容易に補間処理を行うことができる。
【0013】
上記画像データに基づいて上記拡大画像の画素単位で当該拡大画像の各画素の位置に対応させて上記拡大画像のエッジの領域を表すエッジ情報を生成するエッジ生成手段を備え、当該エッジ情報に基づいて上記注目画素区分にエッジの領域が存在するか否かを判断し、エッジの領域が存在すると判断したときには同注目画素区分の各画素について同エッジの領域から当該画素側にある上記拡大画像の画素の画像データのみを用いて上記階調データを生成する構成としてもよい。エッジの領域が存在する画素区分の各画素の階調データは、エッジの領域を越えた部分の画素の画像データが反映されないので、拡大画像のエッジ部分について鮮鋭さを維持して良好な画質を得ることが可能となる。
【0014】
なお、上記エッジ生成手段は、上記エッジ位置情報に基づいて上記拡大前画像のエッジの位置に対応する上記拡大画像のエッジの位置を表す拡大エッジ位置情報を同拡大画像の画素単位で取得する拡大位置取得手段と、同拡大エッジ位置情報に基づいて近隣する同拡大画像のエッジどうしを連結して上記拡大画像のエッジの領域を表すエッジ情報を生成する連結手段とを備える構成としてもよい。
【0015】
上記拡大前画像上で注目画素とその周囲の画素の画像データに対してラプラシアンフィルタを用いた演算を行って同拡大前画像の各画素に対応して階調表現された中間データを生成し、当該中間データに対応するドットマトリクス状の画素上で注目画素を順次移動させながら、注目画素およびその近隣に位置する画素の位置および中間データに基づいて同中間データを略0にする位置が表された上記エッジ位置情報を取得する位置取得手段を備えてもよい。なお、周囲の画素は、注目画素に隣接していてもよいし、隣接していなくてもよい。
ラプラシアンフィルタは、8方向ラプラシアンフィルタ、4方向ラプラシアンフィルタ、等、を採用することができる。むろん、一次空間微分フィルタ、非線形差分フィルタ、等、を用いてエッジの位置を検出してもよい。
【0016】
上記注目画素区分に対応する拡大前画像における画素およびその近隣に位置する画素の画像データを2値化して2値化データを生成し、当該2値化データと、エッジの存在を判定可能とする所定の複数のマッチングパターンと、に基づいて同注目画素区分およびその近隣に位置する画素区分にエッジが存在するか否かを判定し、エッジが存在すると判定したときに同注目画素区分の各画素について上記エッジの領域から当該画素側にある上記拡大画像の画素の画像データのみを用いて上記階調データを生成する構成としてもよい。簡易な構成で確実にエッジの領域が存在するブロックについて鮮鋭化処理を行うことができ、確実に拡大画像のエッジ部分を精度よく細線で形成することが可能となる。
【0017】
なお、上記連結手段は、上記拡大前画像上で注目画素を順次移動させながら、同注目画素およびその近隣に位置する画素の画像データを2値化して2値化データを生成し、当該2値化データと、エッジの向きに対応した所定の複数のマッチングパターンと、に基づいてエッジの向きを決定し、上記近隣する拡大画像のエッジどうしを同決定したエッジの向きとなるように連結して上記エッジ情報を生成する構成としてもよい。簡易な構成で確実に拡大画像のエッジどうしを連結することができ、高速な処理にて確実に拡大画像のエッジを精度よく細線で形成することが可能となる。また、この場合のマッチングパターンを、拡大画像の各画素に対応した階調データを生成するためのマッチングパターンにすることができるので、エッジ情報を生成してエッジブロックの各画素に対応した階調データを生成する処理を効率よく行うことが可能となる。
【0018】
上記2値化データと上記複数のマッチングパターンとが一致しない場合、上記拡大画素区分の近隣に位置する上記拡大前画像における所定領域内の画素の画像データを用いて上記補間処理を行って上記注目画素区分の各画素について階調データを生成してもよい。
【0019】
上記注目画素の近隣に位置する補間処理前の画像における第二の所定領域内の複数の画素についての画像データの異なり度合に応じて上記補間処理の種類を切り換える構成としてもよい。注目画素に近隣する画素の画像データに応じて適切な補間処理を行うことが可能となるので、エッジ部分の鮮鋭さを維持して補間処理後の画像の画質をさらに向上させることが可能となる。
【0020】
上記第二の所定領域内の複数の画素についての画像データの異なり度合が大きくなるほど、上記画像データを参照する画素の数を増やす構成としてもよい。画像データの異なり度合が大きいほど高精度にて補間処理を行う必要があるが、同異なり度合が大きくなるほど補間処理にて参照する画素の数が増えるため、補間処理により効率よく高画質の画像を得ることが可能となる。
【0021】
上述した画像補間装置は、単独で実施される場合もあるし、ある機器に組み込まれた状態で他の方法とともに実施されることもあるなど、発明の思想としては各種の態様を含むものであって、適宜、変更可能である。
また、所定の手順に従って上述した手段に対応した処理を行う方法にも発明は存在する。従って、本発明は画像補間装置の制御方法としても適用可能であり、請求項9にかかる発明においても、基本的には同様の作用となる。
さらに、拡大画像の画像データ(拡大画像を表現する画像データ。以下、同様)に基づいて印刷を行う印刷装置に対して印刷制御を行う印刷制御装置としても適用可能であるし、同印刷制御装置と印刷装置を備える印刷システムとしても適用可能であり、基本的には同様の作用となる。
【0022】
本発明を実施しようとする際に、上記装置にて所定のプログラムを実行させる場合もある。そこで、画像補間装置の制御プログラムとしても適用可能であり、請求項10にかかる発明においても、基本的には同様の作用となる。さらに、同プログラムを記録した媒体が流通し、同記録媒体からプログラムを適宜コンピュータに読み込むことが考えられる。すなわち、そのプログラムを記録したコンピュータ読み取り可能な記録媒体としても適用可能であり、基本的には同様の作用となる。
むろん、請求項2〜請求項8に記載した構成を上記方法、印刷制御装置、印刷システム、プログラム、プログラムを記録した媒体に対応させることも可能である。
ここで、上記記録媒体は、磁気記録媒体や光磁気記録媒体の他、今後開発されるいかなる記録媒体であってもよい。一次複製品、二次複製品などの複製段階も問わない。一部がハードウェアで実現される場合や、一部を記録媒体上に記録しておいて必要に応じて適宜読み込む場合も本発明の思想に含まれる。
【0023】
【発明の実施の形態】
以下、下記の順序に従って本発明の実施形態を説明する。
(1)印刷システムの構成:
(2)画像補間装置の構成の概略:
(3)画像補間装置が行う処理:
(3−1)ゼロクロス検出処理:
(3−2)ゼロクロス連結処理:
(3−3)補間処理:
(4)変形例:
【0024】
(1)印刷システムの構成:
図1は、本発明の一実施形態である印刷システム100の概略構成を示している。本システム100は、パーソナルコンピュータ(PC)10、印刷装置であるカラー印刷可能なインクジェットプリンタ20等から構成されている。なお、PC10は、補間処理を行う意味で本発明にいう画像補間装置となる。また、補間処理後の階調データからなる画像データを生成して対応する出力画像をプリンタ20に印刷させる意味で印刷制御装置となる。
PC10は演算処理の中枢をなすCPU11を備えており、このCPU11はシステムバス10aを介してPC10全体の制御を行う。同バス10aには、ROM12、RAM13、CD−ROMドライブ15、フレキシブルディスク(FD)ドライブ16、各種インターフェイス(I/F)17a〜e等が接続されている。また、ハードディスクドライブを介してハードディスク(HD)14も接続されている。本実施形態のコンピュータにはデスクトップ型PCを採用しているが、コンピュータとしては一般的な構成を有するものを採用可能である。
【0025】
HD14には、オペレーティングシステム(OS)や画像情報等を作成可能なアプリケーションプログラム(APL)等が格納されている。実行時には、CPU11がこれらのソフトウェアを適宜RAM13に転送し、RAM13を一時的なワークエリアとして適宜アクセスしながらプログラムを実行する。
周辺機器I/F(PIF)17aには、デジタルカメラ30や、図示しないカラースキャナ等が接続されるようになっている。同デジタルカメラ30は、撮影画像をドットマトリクス状の画素で階調表現する画像データを生成してPC10に出力可能である。CRTI/F17bには画像データに基づく画像を表示するディスプレイ18aが接続され、入力I/F17cにはキーボード18bやマウス18cが操作用入力機器として接続されている。また、プリンタI/F17eには、パラレルI/Fケーブルを介してプリンタ20が接続されている。むろん、USBケーブル等を介してプリンタ20を接続する構成としてもよい。
【0026】
プリンタ20は、C(シアン)、M(マゼンタ)、Ye(イエロー)、K(ブラック)のインクを使用して、印刷用紙(印刷媒体)に対して画像データを構成する階調値に対応したインク量となるようにインクを吐出し、画像を印刷する。むろん、4色以外のインクを使用するプリンタを採用してもよい。また、インク通路内に泡を発生させてインクを吐出するバブル方式のプリンタや、レーザープリンタ等、種々の印刷装置を採用可能である。
図2に示すように、プリンタ20では、CPU21、ROM22、RAM23、通信I/O24、コントロールIC25、ASIC26、I/F27、等がバス20aを介して接続されている。通信I/O24はPC10のプリンタI/F17eと接続されており、プリンタ20は通信I/O24を介してPC10から送信されるCMYeKに変換されたデータやページ記述言語等からなる印刷ジョブを受信する。ASIC26は、CPU21と所定の信号を送受信しつつヘッド駆動部26aに対してCMYeKデータに基づく印加電圧データを出力する。同ヘッド駆動部26aは、同印加電圧データに基づいて印刷ヘッドに内蔵されたピエゾ素子への印加電圧パターンを生成し、印刷ヘッドにCMYeKのインクを吐出させる。I/F27に接続されたキャリッジ機構27aや紙送り機構27bは、印刷ヘッドを主走査させたり、適宜改ページ動作を行いながらメディアを順次送り出して副走査を行ったりする。そして、CPU21が、RAM23をワークエリアとして利用しながらROM22に書き込まれたプログラムに従って各部を制御する。
【0027】
PC10では、以上のハードウェアを基礎としてバイオスが実行され、その上層にてOSとAPLとが実行される。OSには、プリンタI/F17eを制御するプリンタドライバ等の各種のドライバ類が組み込まれ、ハードウェアの制御を実行する。プリンタドライバは、プリンタI/F17eを介してプリンタ20と双方向の通信を行うことが可能であり、APLから画像データを受け取って印刷ジョブを作成し、プリンタ20に送出する。本発明の画像補間プログラムは、APLから構成されるが、プリンタドライバにより構成されてもよい。また、HD14は同プログラムを記録した媒体であるが、同媒体は、例えば、CD−ROM、FD16a、光磁気ディスク、不揮発性メモリ、パンチカード、バーコード等の符号が印刷された印刷媒体、等であってもよい。むろん、通信I/F17dからインターネット網を介して所定のサーバに格納された上記の制御プログラムをダウンロードして実行させることも可能である。
そして、上記ハードウェアと上記プログラムとが協働して画像補間装置を構築する。
【0028】
(2)画像補間装置の構成の概略:
図3は、上記画像補間装置の構成の概略を模式的に示している。PCを画像補間装置U0として機能させる画像補間プログラムは、以下に述べる各種手段に対応した複数のモジュールから構成されている。本実施形態では画像を拡大する画像補間装置の例を取り上げているが、画像を拡大しない場合にも本発明を適用可能である。
本画像補間装置U0は、概略、拡大前画像I1の画像データD1に基づいて拡大画像I2のエッジの領域を表すエッジ情報D2を生成するエッジ生成手段U1と、拡大前画像の画像データD1から補間処理を行って補間処理後の拡大画像I2の各画素I2uに対応した階調データを生成する補間手段U2とから構成されている。その際、拡大前画像の画素I1uに対応して拡大画像の画素I2uを区分したブロック(画素区分。図では3×3画素)毎に、拡大画像I2上で注目ブロックN2を順次移動させながら、注目ブロックN2内の各画素について順次補間処理を行う。本装置は、このようなブロック単位の画像補間処理を行う際、エッジブロックに鮮鋭化処理を行っても、エッジブロックと非エッジブロックとで色の差が出ないようにすることができる。
【0029】
拡大前画像の画像データD1は、拡大前画像をドットマトリクス状の多数の画素で階調表現するデータであり、拡大前画像の明るさが表されたデータである。本実施形態の画像データは、Y(輝度)、Cb(ブルーの色差)、Cr(レッドの色差)からなるYCbCrデータであるとして説明するが、R(レッド)、G(グリーン)、B(ブルー)からなるRGBデータ等であってもよい。また、YCbCr各成分は、256階調であるとして説明するが、1024階調、100階調、等であってもよい。
エッジ生成手段U1は、まず、画像データD1の輝度値Yに基づいてゼロクロス位置Z(エッジ位置情報)を算出して取得する。
【0030】
なお、輝度値Yを用いてゼロクロス位置Zを取得する以外にも、各RGBの階調値の平均値を用いてゼロクロス位置Zを取得してもよいし、以下の式により輝度値Yを算出して同輝度値Yを用いてゼロクロス位置Zを取得してもよい。
Y=0.30r+0.59g+0.11b …(1)
ここで、r,g,bは、各RGBの階調値を表している。
【0031】
エッジ生成手段U1は、次に、ゼロクロス位置Zが拡大後のどのピクセルに相当するかを計算し、その位置を拡大後のゼロクロス位置(拡大エッジ位置情報)とする。さらに、近隣する拡大画像I2のエッジどうしを連結する連結位置情報を取得する。そして、拡大エッジ位置情報と連結位置情報とを合わせて、エッジ情報D2を生成する。エッジ情報D2は、拡大画像の画素I2uをxy平面上に置いたとき、拡大画像の画素I2u単位で拡大画像の各画素I2uの位置に対応させたエッジの領域を表す座標値の集合とされている。
【0032】
補間手段U2は、補間処理後の拡大画像I2上で階調データを生成する注目画素N1を順次移動させながら、注目画素N1の近隣に位置する補間処理前の拡大前画像I1における所定領域R1内の複数の画素の画像データを参照して補間処理を行う。バイキュービック法による補間処理を行う場合、注目画素の近隣に位置する拡大前画像の4×4画素の画像データを参照する。図では、便宜上、同4×4画素をP11〜P44と名付けている。補間処理を行う際、所定領域R1内の複数の画素P11〜P44上を画像のエッジの領域が横切っているか否かを拡大前画像の画像データD1に基づいて判断する。そして、横切っていると判断したときには、エッジの領域から注目画素側にある画素の画像データのみを用いて補間処理を行う。
図の例では、所定領域R1内にエッジの領域が横切っているため、注目画素N1側にある拡大前画像の画素P11〜P14,P21〜P24,P32〜P34,P43〜P44の画像データのみを用いて補間処理を行う。
【0033】
なお、図4に示すように、実際には、所定領域R1内の複数の画素I1uのうち拡大画像I2上の注目画素N1に対応する補間処理前の拡大前画像における画素(対応画素)N1uとの画像データの差異が所定範囲内となる画素の画像データのみを用いて補間処理を行っている。同対応画素N1uは、注目画素N1が含まれる拡大画像I2上のブロックに対応する拡大前画像I1上の画素とされている。このような処理を行うことにより、エッジ情報D2を生成しなくても所定領域R1内にエッジの領域が横切っているか否かを判定することができ、補間処理を簡素化させることができる。すなわち、本発明は、補間手段U2のみで構成しても有効である。ブロック単位で画像補間処理を行う場合には、エッジ情報を生成すると、エッジブロックに対してエッジ情報に基づいて容易に鮮鋭化処理を行うことができる。
エッジの領域を境にして画像データの値は大きく異なるため、図の下段に示すように、画素N1uとの画像データの差異が所定範囲内の画素の画像データのみを用いることにより、エッジの領域から注目画素N1側にある画素の画像データのみを用いて補間処理を行うことができる。
【0034】
図の例では、注目画素N1側にある画素の画像データは全て200であるため、当該画像データを用いて補間処理を行うと、注目画素N1の階調データは200となる。従来の技術では、注目画素N1からエッジの領域の向こう側にある画素P31,P41,P42の画像データ0も補間処理に用いられるため、注目画素N1の画像データは200より小さくなり、エッジ部分が平滑化され、ぼやけてしまうことになる。また、ブロック単位で補間処理を行う場合、エッジブロックについて鮮鋭化等の処理を行うと、エッジブロックと非エッジブロックとの間で色の差が発生してしまうことにもなる。本装置U0は、画素N1uとの画像データの差異が所定範囲外の画素の画像データを用いず、注目画素N1からエッジの領域の向こう側にある画素の画像データを用いないようにしたので、補間処理後でもエッジ部分の鮮鋭さを維持して画質を向上させることが可能となっている。
【0035】
(3)画像補間装置が行う処理:
以下、画像補間装置が行う処理とともに、動作を詳細に説明していく。
図5は、本画像補間装置が行う処理をフローチャートにより示している。具体的には、PC10のCPU11が本処理を行う。
まず、エッジ生成手段により、ゼロクロス位置Zを取得するゼロクロス検出処理を行い(ステップS105。以下、「ステップ」の記載を省略)、ゼロクロスを連結してエッジ情報を生成するゼロクロス連結処理を行う(S110)。次に、補間手段により、拡大前画像の画像データから補間処理を行って補間処理後の画像の各画素に対応した階調データを生成し(S115)、本フローを終了する。その後は、ディスプレイにて階調データから構成される画像データに対応する拡大画像を表示したり、プリンタ20に対して同画像データを出力することにより画像データに対応する拡大画像を印刷したりすることができる。
【0036】
(3−1)ゼロクロス検出処理:
図6は、上記ゼロクロス検出処理をフローチャートにより示している。
まず、図3で模式的に示したように拡大前画像をドットマトリクス状の画素別の階調データで表現する画像データに対してガウスぼかしを行うガウスぼかし処理を行う(S205)。同処理は、図7に示すフローに従って行われる。まず、拡大前画像を多数の画素別のYCbCrデータで表現する画像データを入力し、拡大前画像上で注目画素の位置を設定する(S305)。デジタルカメラ30等から画像データを入力する場合、データ全体を一括して読み込む必要はなく、部分的に読み込むようにしてもよいし、他のAPLから呼び出されるような場合にはデータの受け渡しに利用されるバッファ領域を表すポインタの受け渡しだけであってもよい。また、注目画素の位置を設定する順序は、左上の画素から開始して順番に右上の画素までとし、その後一つずつ下の左端の画素から順番に右端の画素までとして、最後に右下の画素としている。以下、各種処理にて注目画素の位置を設定する場合も同様にしている。むろん、注目画素の位置を設定する順序は、適宜変更可能であり、拡大前画像の種類等に応じて異なる順序とすることも可能である。
【0037】
さらに、注目画素とその近隣に位置する3×3画素(所定領域)の輝度値Y(画像データ)を取得する(S310)。3×3画素の画像データの値を左上〜右上、左中〜右中、左下〜右下の順にd1〜d9とすると、注目画素の輝度値がd5であり、その近隣に位置する8画素の輝度値はd1〜d4,d6〜d9である。なお、注目画素が拡大前画像の端部にある場合には、拡大前画像の端部の画素における輝度値が拡大前画像の外側にある(折り返されている)ものとして輝度値を取得する。以下も、同様である。
【0038】
そして、図7のフロー中に示した公知のガウスぼかし演算用フィルタF1を用いてガウスぼかし演算を行う(S315)。ここで、フィルタ演算を行うための演算用フィルタFは、参照する3×3画素のそれぞれに対応した係数f1〜f9を有しており、各画素に対応する画像データd1〜d9のそれぞれに同係数を乗じた総和を求めて注目画素のフィルタ演算後の階調データd’を算出するものである。実際には、以下の式のように、同総和に所定係数(kとする)を乗じてフィルタ演算後のデータd’とする。
d’=kΣfi・di …(2)
後述するラプラシアンフィルタのように係数f1〜f9の合計Σfiが0となるフィルタの場合にはk=1とし、ガウスぼかし演算用フィルタF1のように係数f1〜f9の合計Σfiが0となるフィルタの場合にはk=1/Σfiとする。
【0039】
その後、拡大前画像の全画素について、ガウスぼかし演算を行ったか否かを判断する(S320)。条件不成立の場合には、拡大前画像上で注目画素を順次移動させながら繰り返しS305〜S320によりガウスぼかしを行う演算を行う。条件成立の場合には、本フローを終了する。なお、ガウスぼかし処理を行わなくてもエッジ情報を生成することは可能であるが、ガウスぼかし処理を行うことによりノイズが除去されるのでエッジ位置の精度が向上し、より滑らかとされたエッジの位置を表す情報を生成することができる。
【0040】
ガウスぼかし処理が終了すると、図6のS210に進み、ガウスぼかし処理が行われた画像データに対してラプラシアンフィルタを用いたラプラシアンフィルタ演算処理を行う。同処理も、図7で示したフローに従って行われる。まず、ガウスぼかし処理が行われた画像データで階調表現される拡大前画像上で注目画素の位置を設定する(S305)。次に、注目画素とその近隣に位置する3×3画素の輝度値d1〜d9を取得する(S310)。そして、図7のフロー中に示した公知の8方向ラプラシアンフィルタF2を用いてラプラシアンフィルタ演算を行い、ドットマトリクス状の画素で階調表現された中間データを生成する(S315)。
【0041】
ここで、注目画素に対応するフィルタF2の係数f5の周囲にある係数f1〜f4,f6〜f9は全て1とされ、中心にある係数f5は係数f1〜f4,f6〜f9の総和の符号を逆にした−8とされている。すなわち、フィルタF2を用いてフィルタ演算を行うことにより、以下の式のように、注目画素の周囲にある画素の輝度値と注目画素の輝度値との差分の総和を演算してラプラシアンフィルタ演算後の階調データd’とすることになる。
d’=Σ(di−d5) …(3)
ただし、i=1〜4,6〜9である。
【0042】
そして、ガウスぼかし処理が行われた拡大前画像の全画素について、ラプラシアンフィルタ演算を行ったか否かを判断する(S320)。条件不成立の場合には、繰り返しS305〜S320の処理により中間データを生成する。条件成立の場合には、本フローを終了する。ラプラシアンフィルタ演算処理を行ってエッジの位置を検出することにより、簡易な構成で精度よくエッジの位置を表す情報を取得することができ、精度よく拡大画像のエッジの領域を表すエッジ情報を生成することができる。
【0043】
その後、ゼロクロス位置Zを記憶するバッファ領域をRAM内に確保する(図5のS215)。次に、生成した中間データに対応するドットマトリクス状の画素上で注目画素の位置を設定する(S220)。そして、注目画素の中間データと注目画素の右隣(近隣)に位置する画素(右隣画素)の中間データの符号が異なるか否かを判断する(S225)。符号が異ならない場合、注目画素と右隣画素との間にゼロクロスはほとんど存在しないため、S245のゼロクロス位置算出処理を行わずにS250に進む。符号が異なると判断した場合、ゼロクロス位置を算出すべきか否かを判断するため、現在位置である注目画素の中間データの絶対値と右隣画素の中間データの絶対値の少なくとも一方が所定のしきい値L1以上(またはより大)であるか否かを判断する(S230)。拡大前画像の輝度値が256階調であるとき、中間データの階調値も256階調となり、しきい値L1を例えば256階調の略中間値である128等とすればよい。条件成立の場合、S245に進んでゼロクロス位置算出処理を行う。エッジが存在するのは主に両画素間の輝度値の差が大きく、中間データの符号が異なるときであるので、精度よくエッジの位置を表す情報を取得することができ、その結果、精度よく拡大画像のエッジの領域を表す情報を生成することが可能となる。
【0044】
条件不成立の場合、さらにゼロクロス位置を算出すべきか否かを判断するため、ガウスぼかし処理が行われた拡大前画像上で注目画素を中心とする3×3画素の輝度値の最大値と最小値の差を求め(S235)、求めた差が所定のしきい値L2以上(またはより大)であるか否かを判断する(S240)。ガウスぼかし処理後の拡大前画像の輝度値が256階調であるとき、しきい値L2を例えば50等とすればよい。条件成立の場合、S245に進んでゼロクロス位置算出処理を行う。注目画素と右隣画素の輝度値の差が小さいためにラプラシアンフィルタ演算処理を行った結果S230ではゼロクロスを検出することができなくても、注目画素を中心とした3×3画素の輝度値の差が大きいことがあるので、ゼロクロスの検出精度を向上させることができる。すなわち、精度よくエッジの位置を表す情報を取得することができ、その結果、精度よく拡大画像のエッジの領域を表す情報を生成することが可能となる。一方、条件不成立の場合、S250に進む。
【0045】
図8は、上記ゼロクロス位置算出処理をフローチャートにより示している。
まず、拡大前画像から拡大画像への拡大率Mを取得する(S355)。例えば、ディスプレイに解像度選択欄を有する印刷インターフェイス画面を表示し、解像度選択欄への操作入力から画像の拡大率を表すパラメータを取得してRAMに格納すればよい。ここで、拡大率がMであるとき、横方向(x方向)の画素数をM倍にするとともに、縦方向(y方向)の画素数もM倍にすることを意味するものとする。むろん、拡大率としてMx,Myを取得し、横方向の画素数をMx倍にし、縦方向の画素数をMy倍にするようにしてよい。
【0046】
次に、拡大率Mを反映させた画素の位置をX1、その画素の中間データをY1として、注目画素と隣接画素(S245で本処理が行われる場合には右隣画素)のX1,Y1の関係式Y1=A1・X1+B1のA1,B1を算出する(S360)。ここで、画素の位置X1は、注目画素と右隣画素の2点について直線の式を求める場合には拡大画像上での横方向のx座標であり、注目画素と下隣画素の2点について直線の式を求める場合には拡大画像上での縦方向のy座標である。注目画素の中間データをLP0、隣接画素の中間データをLP1、拡大前画像上での注目画素の位置をx0とすると、A1,B1は以下の式により算出することができる。
A1=(LP1−LP0)/M …(4)
B1=LP0−A1×(x0×M+M/2) …(5)
【0047】
A1,B1を算出すると、以下の式により、拡大率Mを反映させたゼロクロス位置Z1を算出する(S365)。
Z1=−B1/A1 …(6)
ここで、Z1は小数点以下の情報を有する値とされ、拡大前画像の画素よりも細かい単位とされている。そして、拡大前画像の画素の位置に拡大率Mを乗じた値であるので、ゼロクロス位置Z1は拡大前画像の各画素の位置に対応させたエッジの位置を表すエッジ位置情報とされている。
【0048】
ゼロクロス位置Z1を算出すると、同ゼロクロス位置Z1に基づいて拡大前画像のエッジの位置に対応する拡大画像のエッジの位置Z1’(拡大エッジ位置情報の一種)を取得する(S370)。拡大画像のエッジの位置Z1’は、以下の式により算出することができる。
Z1’=INT(Z1) …(7)
ここで、INTは小数点以下を切り捨てる関数である。すなわち、Z1’は拡大画像の画素単位で拡大画像のエッジの位置を表す数値情報とされている。
【0049】
図9は、拡大率Mが3であるときに拡大エッジ位置情報を取得する様子を模式的に示している。
拡大前画像のx=1,y=2に中間データLP0=−125の注目画素51があり、注目画素の右隣であるx=2,y=2に中間データLP1=53の隣接画素52があるとする。ここで、拡大前画像の画素に対応して拡大画像の画素を区分したブロック54,55中でゼロクロス56がどこに存在するかを上記式(4)〜(6)を用いて求める。なお、拡大前画像の注目画素51、隣接画素52に対応してそれぞれ注目ブロック54、隣接ブロック55があるものとする。
図の中段下寄りに示したX1−Y1グラフのように、X1(画素のx座標またはy座標)−Y1(中間データ)平面上での注目画素と隣接画素とを結ぶ直線がX1軸と交差する点(Y1=0となる点)がゼロクロスである。上記例では、ゼロクロス位置はZ1=6.6となる。最後に、上記式(7)を用いると、Z1’=INT(6.6)=6となる。従って、拡大エッジ位置情報57は、隣接ブロック55内の左側にあるx=6,y=7の画素の位置を表す情報となる。
【0050】
このように、拡大エッジ位置情報は拡大画像のブロックよりも細かい画素単位で画素の位置を表す情報とされる。従って、拡大画像のエッジ位置の精度が向上し、拡大画像のエッジのジャギーは目立たなくなる。
拡大画像のエッジの位置を取得すると、拡大画像のエッジの位置Z1’に対応する拡大画像上のエッジの座標値(拡大エッジ位置情報の一種)をバッファに記憶し(S375)、本フローを終了する。
【0051】
注目画素と右隣画素との間でゼロクロス位置算出処理を行うと、図5のS250に進み、注目画素と下隣画素との間で同様の処理を行う。
すなわち、注目画素の中間データと注目画素の下隣(近隣)に位置する画素(下隣画素)の中間データの符号が異なるか否かを判断する(S250)。符号が異ならない場合、S270のゼロクロス位置算出処理を行わずにS275に進む。符号が異なると判断した場合、現在位置である注目画素の中間データの絶対値と下隣画素の中間データの絶対値の少なくとも一方が所定のしきい値L3(例えば128)以上(またはより大)であるか否かを判断する(S255)。条件成立の場合、S270に進んでゼロクロス位置算出処理を行う。
条件不成立の場合、ガウスぼかし処理が行われた拡大前画像上で注目画素を中心とする3×3画素の輝度値の最大値と最小値の差を求め(S260)、求めた差が所定のしきい値L4(例えば50)以上であるか否かを判断する(S265)。条件成立の場合、S270に進んでゼロクロス位置算出処理を行う。一方、条件不成立の場合、S275に進む。
【0052】
S270でゼロクロス位置算出処理を行うと、ガウスぼかし処理が行われた拡大前画像の全画素についてS220〜S270の処理を行ったか否かを判断する(S275)。条件不成立の場合には、繰り返しS220〜S275により拡大エッジ位置情報を取得する処理を行う。条件成立の場合には、本フローを終了する。このようにして、ラスタスキャンでのエッジ検出が可能となり、拡大前画像の画素よりも細かい単位で高精度にてエッジの位置を求めることができる。
【0053】
(3−2)ゼロクロス連結処理:
ゼロクロス検出処理を終了すると、図5のS110に進み、ゼロクロス連結処理を行う。
図10は、上記ゼロクロス連結処理をフローチャートにより示している。
まず、拡大画像の画素を区分した3×3画素のブロック毎に、注目ブロックの位置を設定する(S405)。次に、拡大画像の注目ブロック内に同拡大画像の画素単位とされたゼロクロス、すなわち、エッジが存在するか否かを判断する(S410)。注目ブロック内にエッジが存在しない(対応する拡大画像上のエッジの座標値がバッファに格納されていない)場合、S435に進む。
【0054】
注目ブロック内にエッジが存在する場合、同注目ブロック内に複数のエッジが存在するか否かを判断する(S415)。複数のエッジが存在する場合には後述するエッジ生成処理を行って(S420)S425に進み、エッジが一つしか存在しない場合には即座にS425に進む。
S425では、注目ブロックの右隣のブロック、左下の隣接ブロック、下隣のブロック、右下の隣接ブロックのいずれかにゼロクロスが存在するか否かを判断する。本実施形態では、注目ブロックが拡大画像の端部にあり、隣接ブロックが拡大画像外となる場合には、その隣接ブロックについてはゼロクロスが存在しないものとしてエッジを連結する処理を行わない。
これらの隣接ブロックにゼロクロスが存在する場合には後述するエッジ生成処理を行って(S430)S435に進み、ゼロクロスが存在しない場合には即座にS435に進む。
【0055】
図11は、上記S420,S430で行われるエッジ生成処理をフローチャートにより示している。
まず、拡大画像上でエッジとされた二画素間の横方向(x方向)の距離差が縦方向(y方向)の距離差以上(またはより大)であるか否かを判断する(S505)。条件成立の場合にはS510に進み、条件不成立の場合にはS530に進む。
S510では、拡大画像上で横方向の画素の位置を設定する。次に、設定した横方向の位置で、拡大画像のエッジの領域とする縦方向の画素の位置を取得する(S515)。さらに、取得した画素の位置(具体的には、座標値)をエッジの領域とする画素の位置を表す連結位置情報としてバッファに格納する(S520)。そして、次の横方向の画素の位置が存在するか否かを判断する(S525)。条件成立の場合には、横方向の画素の位置を画素単位で順次移動させながら繰り返しS510〜S525の処理を行う。条件不成立の場合には、S550に進む。
【0056】
一方、S530では、拡大画像上で縦方向の画素の位置を設定する。次に、設定した縦方向の位置で、拡大画像のエッジの領域とする横方向の画素の位置を取得する(S535)。さらに、取得した画素の座標値を連結位置情報としてバッファに格納する(S540)。そして、次の縦方向の画素の位置が存在するか否かを判断する(S545)。条件成立の場合には縦方向の画素の位置を画素単位で順次移動させながら繰り返しS530〜S545の処理を行い、条件不成立の場合にはS550に進む。
【0057】
図12の左側は、横方向の距離差が縦方向の距離差以上である場合に連結位置情報を取得する様子を示している。ここで、エッジ画素61a,bは、拡大画像の画素単位でエッジとされた画素である。そして、横方向の画素の位置を画素単位で順次移動させながら、例えば連結画素61c,61d,61eの順に当該画素の座標値を連結位置情報として取得する。一方、図の右側は、縦方向の距離差が縦方向の距離差以上である場合にエッジ画素62a,b間で連結位置情報を取得する様子を示している。この場合、縦方向の画素の位置を画素単位で順次移動させながら、例えば連結画素62c,62d,62eの順に当該画素の座標値を連結位置情報として取得する。このように、連結画素の抜けを生じさせないため、良好なエッジを細線で得ることが可能となっている。
【0058】
S550では、上記処理により取得した連結位置情報を含めて、拡大画像のエッジの領域を表すエッジ情報を生成し、本フローを終了する。このように、簡易な構成で確実に拡大画像のエッジどうしを連結することができ、また、近隣する拡大画像のエッジどうしの間で画素単位毎にエッジの領域とされるので、確実に拡大画像のエッジを精度よく細線で形成することが可能となる。
図10のS430のエッジ生成処理を終了すると、拡大画像の全ブロックについてエッジ情報を生成するS405〜S430の処理を行ったか否かを判断する(S435)。条件不成立の場合には、繰り返しS405〜S435によりエッジ情報を生成する処理を行う。条件成立の場合には、本フローを終了する。
【0059】
以上の処理により、拡大画像の画素単位でエッジの領域が形成されるので、拡大画像のエッジを精度よく細線で形成して鮮鋭化等の処理を容易に行うことが可能であるとともに、エッジのジャギーを少なくさせることが可能となる。従って、生成されるエッジ情報を用いて拡大画像を生成すると、ジャギーの少ない滑らかな拡大エッジ画像を得ることができ、拡大後でもジャギーの少ない拡大画像を得ることが可能となる。
【0060】
(3−3)補間処理:
ゼロクロス連結処理を終了すると、図5のS115に進み、補間処理を行う。
図13は、上記補間処理をフローチャートにより示している。
補間処理後の拡大画像の階調データを格納するバッファ領域をRAM内に確保したうえで、まず、拡大画像の画素を区分した3×3画素のブロック毎に、注目ブロックの位置を設定する(S605)。次に、エッジ情報に基づいて、拡大画像の注目ブロック内に同拡大画像の画素単位とされたゼロクロス、すなわち、エッジの領域が存在するか否かを判断する(S610)。注目ブロック内にエッジの領域が存在する(対応する拡大画像上のエッジの座標値がバッファに格納されていない)場合にはS615に進み、注目ブロック内にエッジの領域が存在しない場合にはS635に進む。
【0061】
S615では、図14に示すように、注目ブロックに対応する拡大前画像における対応画素I1uおよびその近隣に位置する3×3画素(拡大画像の3×3ブロックに相当)の輝度値(ガウスぼかし処理後の画像データD1’)を2値化して拡大前画像の各画素に対応した2値化データD3を生成する。対応画素I1uが拡大前画像の端部にある場合には、拡大前画像の端部の画素における輝度値が拡大前画像の外側にあるものとして2値化データを生成する。本実施形態では、3×3画素の輝度値の最大値と最小値の平均値をしきい値L5として、各画素の輝度値がしきい値L5以上(またはより大)である場合に2値化データを1とし、しきい値L5より小(または以下)である場合に2値化データを−1としている。
そして、2値化データと、所定の複数のマッチングパターンとがマッチ(一致)するか否かを判断するパターンマッチング処理を行う(S620)。
【0062】
図15は、検出用の3×3フィルタマトリクスであるマッチングパターンの一例を模式的に示している。図において、エッジの向き90度、30度、45度に対応して、それぞれ90度用のマッチングパターンが12種類、30度用のマッチングパターンが16種類、45度用のマッチングパターンが8種類示されている。これらの他、60度用、135度用、180度用、等のマッチングパターンもそれぞれ複数種類用意されている。各マッチングパターンは、拡大画像上の注目ブロックを中心とした3×3ブロックに相当する拡大前画像の3×3画素の領域内に各種形状のエッジが存在するか否かを判定可能とするパターンである。むろん、マッチングパターンは、図に示したものに限定されない。
2値化データとマッチングパターンとがマッチするかどうかは、3×3の各画素の2値化データ(d1〜d9とする)と、マッチングパターンの各要素値(f1〜f9とする)との積の総和S1=Σfi・diを算出し、この総和S1がマッチングパターンの各要素値の絶対値の総和S2=Σ|fi|と等しくなるか否かにより判断する。S1=S2となれば拡大前画像のエッジの傾きがマッチングパターンとマッチしたことになり、マッチしたマッチングパターンに対応する形状のエッジが注目ブロックおよびその近隣に位置するブロックに存在する旨の判定結果を表す情報を取得することになる。
【0063】
図14の例では、2値化データD3と図15の「90-1」の90度用マッチングパターンとの総和S1を算出すると、−2となる。「90-1」のマッチングパターンにおける各要素の絶対値の総和S2は6であるので、2値化データは「90-1」のマッチングパターンとマッチしない(一致しない)ことになる。一方、2値化データD3と図15の「30-12」の30度用マッチングパターンとの総和S1を算出すると、5となる。「30-12」のマッチングパターンにおける各要素の絶対値の総和S2は5であるので、2値化データは「30-12」のマッチングパターンとマッチ(一致)することになる。この場合、エッジの向きは30度であり、エッジが存在するか否かの判定結果を表す情報は「30-12」とされる。
むろん、マッチングパターンを用いる以外にも、二つの画素値の差(輝度値差、RGB値差、各色値の差、等)が小さくなる方向からエッジの存在を判定してもよいし、近隣する画素のエッジの方向を反映させてエッジの存在を判定してもよいし、近隣する画素のエッジの強度を反映させてエッジの存在を判定してもよい。また、処理は複雑になるものの、ベクトルの概念を導入してエッジの存在を判定してもよい。さらに、それらの組み合わせによりエッジの存在を判定してもよい。
【0064】
なお、図10のゼロクロス連結処理で、注目ブロックの右隣、左下、下隣、右下のいずれかの隣接ブロックにゼロクロスが存在する場合に、上記マッチングパターンに基づいてエッジの向きを決定して、エッジの向きを表す情報を取得し、当該情報に基づいて、注目ブロック内のエッジと隣接ブロック内のエッジとを結ぶ直線の傾きが、マッチングパターンを用いて決定されたエッジの向きと一致するか否かを判断し、一致すると判断したときのみ、S430のエッジ生成処理を行ってもよい。すると、簡易な構成で確実に拡大画像のエッジどうしを連結することができ、確実に拡大画像のエッジを精度よく細線で形成する処理を高速にて行うことが可能となる。また、エッジ情報を確実に生成するためのマッチングパターンを、拡大画像の各画素に対応した階調データを生成するためのマッチングパターンに流用することができるので、エッジ情報を生成してエッジブロックの鮮鋭化処理を効率よく行うことが可能となる。
S620で2値化データとマッチングパターンとがマッチすると判断した場合、注目ブロック内にエッジが確実に存在すると判定したことになり、エッジ色埋め処理を行って(S625)S670に進む。一方、マッチしないと判断した場合、バイキュービック法による補間処理で階調データを生成してもよいと判定したことになり、バイキュービック処理を行って(S630)S670に進む。
【0065】
図16は、上記エッジ色埋め処理をフローチャートにより示している。まず、パターンマッチング処理の結果から、エッジが存在するか否かの判定結果を表す情報を取得する(S705)。次に、エッジが2辺を通過しているか否かを判断する(S710)。
例えば、図17の上段に示すような手法により、エッジが2辺を通過しているか否かを判断することができる。注目ブロック内の各画素の位置を(x,y)で表すとして(x=0〜2、y=0〜2)、(0〜2,0),(0,1),(2,1),(0〜2,2)の4領域のうち2以上の領域にエッジの領域とされた拡大画像上の画素(エッジ画素とも記載)が存在し、かつ、(0,0〜2),(1,0),(1,2),(2,0〜2)の4領域のうち2以上の領域にエッジが存在するとき、エッジが2辺を通過していると判断することができる。むろん、この手法以外にも、様々な手法を採用可能である。
【0066】
エッジが2辺を通過していると判断した場合、注目ブロックにてエッジで分割される2領域それぞれの階調値を算出する(S715)。S620でパターンマッチング処理が行われた結果、2値化データとマッチするマッチングパターンが「30-5」であったとする。ここで、図17の中段に示すように、注目ブロックに対応する拡大前画像の対応画素を中心とした3×3画素のガウスぼかし処理前における画像データの各階調値をH1〜H9(左上がH1、右下がH9)で表すことにする。H1〜H9は、画像データがYCbCrデータである場合にはYCbCr各階調値であり、RGBデータである場合にはRGB各階調値である。なお、H1〜H9を、ガウスぼかし処理後の各階調値としてもよい。階調データ(YCbCr各階調値等)を生成する注目ブロック内において、明るい(階調値の大きい)領域の階調値をE1、暗い(階調値の小さい)領域の階調値をE2として、エッジ画素から明るい側の領域の階調値をE1とし、エッジ画素から暗い側の領域の階調値をE2とする。拡大前画像の明るい領域はマッチングパターンの「1」の部分に相当するので、階調値H1〜H9のうちマッチングパターンの「1」の部分に対応する階調値からE1を算出する。一方、拡大前画像の暗い領域はマッチングパターンの「−1」の部分に相当するので、階調値H1〜H9のうちマッチングパターンの「−1」の部分に対応する階調値からE2を算出する。
【0067】
複数のマッチングパターンのそれぞれに対応して階調値E1,E2を算出するための情報は予めHDに格納されており、同情報を読み出してマッチングパターン別に階調値E1,E2を算出する。マッチングパターン「30-5」の場合、以下の式により階調値E1,E2を計算する情報がHDに格納されている。
E1 = (2×H2 + H3 + H4)/4
E2 = (2×H5 + H6 + H7)/4
なお、パターンマトリクスの「1」、「−1」それぞれの周辺の画素について、計算したE1,E2と近ければその画素の階調値も計算に含めてもよい。すると、エッジブロックと非エッジブロックとで色の差をさらに少なくすることが可能となる。
【0068】
階調値E1,E2が求まると、補間処理後の拡大画像の階調データを記憶するバッファに対して注目ブロック内でエッジにより分割される領域別に階調値を格納し(S720)、本フローを終了する。注目ブロック内の各画素をエッジで2領域に分割する手法は、様々考えられる。例えば、注目ブロックのどの辺をエッジが横切っているかを調べるとともにエッジの傾きを調べ、エッジが立っていれば、どちらかの横方向から階調値を埋めていき、エッジが見つかったところ以降を別の階調値で埋めていくと、簡易な構成により容易に注目ブロック内の2領域に対して色を埋めることができる。
すなわち、例えば、パターンマッチング処理によりエッジの向きが30度、45度、135度、180度と決定した場合、エッジ画素よりも上側となる注目ブロック内の画素を階調値E1(マッチングパターン内で「1」の部分が「−1」の部分より上側のとき)または階調値E2(マッチングパターン内で「1」の部分が「−1」の部分より下側のとき)とする領域とし、エッジ画素よりも上側となる注目ブロック内の画素を残りの階調値とする領域とすればよい。また、パターンマッチング処理によりエッジの向きが90度、60度と決定した場合、エッジ画素よりも左側となる注目ブロック内の画素を階調値E1(マッチングパターン内で「1」の部分が「−1」の部分より左側のとき)または階調値E2(マッチングパターン内で「1」の部分が「−1」の部分より右側のとき)とする領域とし、エッジ画素よりも右側となる注目ブロック内の画素を階調値E1とする領域とすればよい。
【0069】
なお、エッジ画素については予めどちらの階調値にするかを決めておけばよいが、本実施形態では明るいほうの領域の階調値とするものとしている。従って、エッジ画素の階調値はE1とされる。
S705〜S720の処理を全ブロックについて繰り返すことにより、注目ブロックおよびその近隣に位置するブロックにエッジが存在すると判定したときに注目ブロックの各画素についてエッジの領域から当該画素側にある拡大画像の画素の画像データのみを用いて拡大画像の階調データを生成することができる。そして、マッチングパターンを用いてエッジの通過位置を決定するという簡易な構成で確実にエッジブロックについて鮮鋭化処理を行うことができ、確実に拡大画像のエッジ部分を精度よく細線で形成することが可能となって、同エッジ部分について鮮鋭さを維持して良好な画質の拡大画像を得ることが可能となる。また、エッジブロックと非エッジブロックとで色の差を軽減する拡大処理を実現することができる。
【0070】
S710でエッジが2辺を通過していないと判断した場合、注目ブロック内で領域を分割して階調データを生成する必要がないので、以下の手順に従って、注目ブロック内で画素別にバイキュービック法による補間処理を行う(S725)。
図3を参照して説明すると、まず、注目ブロックN2内で注目画素N1の位置を設定し、注目画素N1の近隣に位置する拡大前画像I1における所定領域R1内の複数の参照画素P11〜P44を決定する。
【0071】
図18は、参照画素P11〜P44を決定する様子を模式的に示している。ここで、注目ブロックに対応する拡大前画像における対応画素の位置を(X,Y)、注目ブロック内での注目画素N1の位置を(x,y)、画像の拡大率をM、s=M/2(ただし、小数点以下切り捨て)とすると、M=3のとき、x=0〜2、y=0〜2、s=1となり、16点の参照画素の位置は以下のように決定される。
【0072】
x<sかつy<s、すなわち、注目画素が(0,0)のとき、
(X-2,Y-2)〜(X+1,Y+1)
x≧sかつy<s、すなわち、注目画素が(1,0),(2,0)のとき、
(X-1,Y-2)〜(X+2,Y+1)
x<sかつy≧s、すなわち、注目画素が(0,1),(0,2)のとき、
(X-2,Y-1)〜(X+1,Y+2)
x≧sかつy≧s、すなわち、注目画素が(1,1),(1,2),(2,1),(2,2)のとき、
(X-1,Y-1)〜(X+2,Y+2)
このように、注目ブロック内の画素の位置に応じた適切な領域の参照画素が設定される。
【0073】
そして、ガウスぼかし処理が行われていない参照画素P11〜P44の画像データの階調値をP11〜P44で表すと、補間処理後の階調値Eは、以下の式により算出することができる。
【数1】

Figure 0003952188
ただし、バイキュービック法での距離係数dx,dyは、
x<sかつy<sのとき、dx=(x+M−s)/M, dy=(y+M-s)/M
x≧sかつy<sのとき、dx=(x-s)/M, dy=(y+M-s)/M
x<sかつy≧sのとき、dx=(x+M-s)/M, dy=(y-s)/M
x≧sかつy≧sのとき、dx=(x-s)/M, dy=(y-s)/M
である。
ここで、参照画素が拡大前画像の端部からはみ出るとき、拡大前画像の端部の画素が外側に向かって連続しているものとして階調値を計算する。
なお、ガウスぼかし処理が行われた階調値を用いて補間処理後の階調値Eを算出してもよい。
上記補間処理を行うと、注目ブロック内の画素別に算出した階調値Eをバッファに格納し(S730)、本フローを終了する。
【0074】
図13のS620で2値化データとマッチングパターンとがマッチしないと判断した場合に行われるバイキュービック処理(S630)は、図16の725〜S730と同様、バイキュービック法による補間処理を行って算出した階調値をバッファに格納する処理を行う。すなわち、2値化データと複数のマッチングパターンとが一致しない場合、拡大ブロックの近隣に位置する拡大前画像における所定領域内の画素の画像データを用いて補間処理を行って注目ブロックの各画素について階調データを生成する。従って、エッジの領域が存在するブロックとその近隣に位置するブロックについて、エッジの存在が検出されなくても、確実にそのブロックについて拡大画像の各画素に対応した階調データを生成することができる。
【0075】
S610で注目ブロック内にエッジの領域が存在しないと判断した場合、適切な補間処理を選択するため、拡大前画像上で注目ブロックに対応する対応画素を中心とする5×5画素のガウスぼかし処理前における輝度値Yの最大値と最小値の差(画像データの異なり度合)を求める(S635)。図18に示すように、同5×5画素は、注目画素の近隣に位置する補間処理前の拡大前画像における第二の所定領域R2内の複数の画素であり、注目ブロック内の画素の階調データを生成する際に参照画素とされる可能性のある画素である。なお、ガウスぼかし処理が行われた拡大前画像上で対応画素を中心とする5×5画素の輝度値の最大値と最小値の差を求めてもよい。
なお、対応画素とその近隣に位置する画素の画像データの異なり度合は、上記最大値と最小値との差等の最大値と最小値との組み合わせに基づく値の他、2番目に大きい値と2番目に小さい値との組み合わせに基づく値、これらに中間値も組み合わせた値、等、様々なものを採用可能である。
【0076】
そして、求めた差に応じて処理を分岐させ、補間処理の種類を切り換える(S640)。すなわち、所定のしきい値L6,L7(L6<L7)を用意しておき、求めた差がL6以下(またはより小)のときにニアリストネイバ処理を行って(S645)S670に進み、求めた差がL6より大(または以上)かつL7以下(またはより小)のときに選択バイリニア処理を行って(S650)S670に進み、求めた差がL7より大(または以上)のときに選択バイキュービック処理を行って(S655)S670に進む。注目ブロックに近隣する画素の画像データに応じて適切な補間処理を行うことが可能となるので、エッジ部分の鮮鋭さを維持して補間処理後の拡大画像を高画質にさせることが可能となる。ここで、参照する画素の数はニアリストネイバ法、バイリニア法、バイキュービック法の順に1、4、16と増えるので、領域R2内の5×5画素についての輝度値の最大値と最小値の差が大きくなるほど、画像データを参照する画素の数が増える。輝度値の異なり度合が大きいほど高精度にて補間処理を行う必要があるが、同異なり度合が大きくなるほど補間処理にて参照する画素の数が増えて高精度の補間処理が行われ、同異なり度合が小さくなるほど補間処理にて参照する画素の数が減って高速にて補間処理が行われる。従って、効率よく、高精度にて補間処理を行って高画質の拡大画像を得ることが可能となる。
なお、選択バイリニア処理と選択バイキュービック処理のいずれか一方のみを行うようにしてもよいし、ニアリストネイバ処理の代わりにバイリニア法による補間処理等を行ってもよい。
【0077】
図19は、S655で行われる選択バイキュービック処理をフローチャートにより示している。
図3を参照して説明すると、まず、注目ブロックN2内で注目画素N1の位置(x,y)を設定する(S805)。拡大画像上における注目ブロックの設定順序と同様、(0,0),(0,1)…(2,2)の順に設定する。次に、図18で示したように、注目画素N1の近隣に位置する拡大前画像I1における所定領域R1内の4×4の参照画素P11〜P44を決定する(S810)。
【0078】
その後、決定した複数の参照画素P11〜P44のそれぞれについて、順次、ガウスぼかし処理が行われていない画像データの階調値P'を取得する(S815)。画像データがYCbCrデータであれば、YCbCr各成分別に階調値を取得する。ガウスぼかし処理が行われた階調値を取得してもよい。なお、参照画素が拡大前画像の外側となる場合には、拡大前画像の端部の画素における階調値が拡大前画像の外側に向かって連続しているものとして階調値を取得する。そして、取得した階調値P'について、注目ブロックN2に対応する対応画素の階調値P0との差が所定のしきい値L8より大(または以上)であるか否か、すなわち、
|P'−P0|>L8
が成立するか否かを判断していく(S820)。拡大前画像の画像データの階調値が256階調であるとき、しきい値L8を例えば50等とすればよい。
【0079】
階調値の差がL8より大きい(所定範囲外)とき、参照画素Pijの階調値を対応画素の階調値P0に置き換えて上記補間処理の演算式(8)に代入する階調値Pijとし(S825)、S830に進む。一方、階調値の差がL8以下(所定範囲内)であるとき、階調値を置き換えることなく参照画素Pijの階調値をそのまま上記演算式(8)に代入する階調値Pijとし、S830に進む。対応画素の階調値との差異が大きい画素の階調値が用いられないので、S820では、注目画素の近隣に位置する所定領域内の複数の画素上を画像のエッジの領域が横切っているか否かを拡大前画像の画像データに基づいて判断していることになる。そして、横切っていると判断したとき、S825で、エッジの領域から注目画素側にある画素の画像データのみを用いて補間処理を行う。
S830では、S820の判断処理をしていない他の参照画素が存在するか否かを判断する。他の参照画素が存在している場合には繰り返しS815〜S830の処理を行い、全ての参照画素について同処理を行った場合にはS835に進む。
【0080】
S835では、階調値の置き換え処理が行われた参照画素の階調値Pijを用いて上記演算式(8)により補間処理後の階調値Eを算出するバイキュービック補間処理を行う。補間処理を行うと、算出した階調値Eをバッファに格納する(S840)。このように、階調値を置き換えるという簡易な構成で、公知の補間処理を利用することができ、注目ブロックに対応する拡大前画像における対応画素との階調値の差異が所定範囲内となる画素の画像データのみを用いて容易に補間処理を行うことができる。
その後、注目ブロック内の全画素について、補間処理を行ったか否かを判断する(S845)。条件不成立の場合には、注目ブロック内で注目画素を順次移動させながら繰り返しS805〜S845の処理を行い、バイキュービック法による補間処理を行う。条件成立の場合には、本フローを終了する。
【0081】
すなわち、補間処理後の画像上で階調データを生成する注目画素の近隣に位置する所定領域内の複数の画素の画像データを参照して補間処理を行う際、同所定領域内の複数の画素のうち注目画素に対応する補間処理前の画像における対応画素との画像データの差異が所定範囲内となる画素の画像データのみを用いた補間処理が行われる。
以上の処理により、補間処理の際に注目ブロックに対応した対応画素の画像データとの差異が大きい画素の画像データが用いられないので、図4で示したように、実質的にはエッジの領域から注目画素側にある画素の画像データのみを用いた補間処理が行われる。すなわち、エッジ部分が平滑化されないので、補間処理後でもエッジ部分の鮮鋭さを維持して画質を向上させることが可能となる。また、エッジブロックに鮮鋭化等の処理を行っても、エッジブロックと非エッジブロックとで色の差が出なくなり、この点でも画質を向上させることができる。
【0082】
バイリニア法による補間処理についても、同様のことが言える。
図20は、S650で行われる選択バイキュービック処理をフローチャートにより示している。
図21に示すように、まず、注目ブロックN2内で注目画素N1の位置(x,y)を設定する(S905)。次に、注目画素N1の近隣に位置する拡大前画像における所定領域R3内の2×2の参照画素A〜Dを決定する(S910)。ここで、注目ブロックN2に対応する拡大前画像における対応画素の位置を(X,Y)、注目ブロック内での注目画素N1の位置を(x,y)、画像の拡大率をM、s=M/2(ただし、小数点以下切り捨て)とすると、M=3のとき、x=0〜2、y=0〜2、s=1となり、4点の参照画素の位置は以下のように決定される。
【0083】
x<sかつy<s、すなわち、注目画素が(0,0)のとき、
(X-1,Y-1)〜(X,Y)
x≧sかつy<s、すなわち、注目画素が(1,0),(2,0)のとき、
(X,Y-1)〜(X+1,Y)
x<sかつy≧s、すなわち、注目画素が(0,1),(0,2)のとき、
(X-1,Y)〜(X,Y+1)
x≧sかつy≧s、すなわち、注目画素が(1,1),(1,2),(2,1),(2,2)のとき、
(X,Y)〜(X+1,Y+1)
このように、バイリニア法による補間処理を行う場合でも、注目ブロック内の画素の位置に応じた適切な領域の参照画素が設定される。
【0084】
そして、ガウスぼかし処理が行われていない参照画素A,B,C,Dの画像データの階調値をそれぞれa,b,c,dで表すと、補間処理後の階調値Eは、以下の式により算出することができる。
【数2】
Figure 0003952188
ただし、バイリニア法での距離係数di,djは、
x<sかつy<sのとき、di=(x-s+M), dj=(y-s+M)
x≧sかつy<sのとき、di=(x-s), dj=(y+M-s)
x<sかつy≧sのとき、di=(x+M-s), dj=(y-s)
x≧sかつy≧sのとき、di=(x-s), dj=(y-s)
である。
ここで、参照画素が拡大前画像の端部からはみ出るとき、拡大前画像の端部の画素における階調値が外側にある(折り返されている)ものとして階調値を計算する。
【0085】
その後、決定した複数の参照画素A〜Dのそれぞれについて、順次、ガウスぼかし処理が行われていない画像データの階調値を取得する(S915)。そして、取得した階調値について、注目ブロックN2に対応する対応画素の階調値P0との差が所定のしきい値L9より大(または以上)であるか否かを判断していく(S920)。拡大前画像の画像データの階調値が256階調であるとき、しきい値L9を例えば50等とすればよい。本実施形態ではL8=L9としているが、L8とL9とは異なる値であってもよい。
階調値の差がL9より大きいとき、参照画素A〜Dの階調値を対応画素の階調値P0に置き換えて上記補間処理の演算式(9)に代入する階調値a〜dとし(S925)、S930に進む。一方、階調値の差がL9以下であるとき、階調値を置き換えることなく参照画素A〜Dの階調値をそのまま上記演算式(9)に代入する階調値a〜dとし、S930に進む。
S930では、S920の判断処理をしていない他の参照画素が存在するか否かを判断する。他の参照画素が存在している場合には繰り返しS915〜S930の処理を行い、全ての参照画素について同処理を行った場合にはS935に進む。
【0086】
S935では、階調値の置き換え処理が行われた参照画素の階調値a〜dを用いて上記演算式(9)により補間処理後の階調値Eを算出するバイリニア補間処理を行う。補間処理を行うと、算出した階調値Eをバッファに格納する(S940)。その後、注目ブロック内の全画素について、補間処理を行ったか否かを判断する(S945)。条件不成立の場合には、注目ブロック内で注目画素を順次移動させながら繰り返しS905〜S945の処理を行い、バイリニア法による補間処理を行う。条件成立の場合には、本フローを終了する。
【0087】
なお、図13のS645で行われるニアリストネイバ処理では、注目画素から最短距離にある拡大前画像上の画素の画像データのみを参照するニアリストネイバ法によって補間処理を行い、算出した階調値をバッファに格納する処理を行う。
そして、S670では、拡大画像の全ブロックについて拡大画像の各画素に対応した階調データを生成したか否かを判断する。条件不成立の場合には、拡大画像上で注目ブロックを順次移動させながら繰り返しS605〜S655により拡大画像の各画素に対応した階調データを生成する処理を行う。条件成立の場合には、本フローを終了する。
【0088】
例えば、図22の上段に示すような輝度値Yを有する拡大前画像を3倍に拡大する場合を例に挙げる。わかりやすいように、ここでは拡大前画像の画像データD1として輝度値Yのみを用いているが、YCbCr各成分値やRGB各階調値等についても適用が可能である。
まず、同拡大前画像に対して、ゼロクロス検出処理、ゼロクロス連結処理を行い、エッジ情報を生成する。その結果、(4,0),(3,1),(2.2),(1,2),(1,3),(0,4)の画素に対応する拡大画像のブロック内の各画素に対応してエッジの領域を表すエッジ情報が生成されたとする。
【0089】
注目ブロックの位置が(0,0)である場合、エッジの領域が存在しないので、図13のS635で輝度値の異なり度合を求めることになる。注目ブロックに対応する対応画素(0,0)を中心とする5×5画素の輝度値Yは、図22の中段に示す値となる。なお、拡大前画像の外側となる部分については、端部の輝度値が拡大前画像の外側に向かって連続しているものとしている。ここで、5×5画素の輝度値の最大値は224、最小値は96であるので、最大値と最小値との差は128となり、しきい値L7(100)より大きくなる。そこで、図13の655で選択バイキュービック処理が行われる。
なお、一般的なバイキュービック補間は、ブロックの左上の画素に、拡大前画像の注目画素の値がくるようになっている。しかし、本画像補間装置は、エッジ検出の結果との整合性を取るため、図18で示したように、ブロックの中心に拡大前画像の注目画素の値がくるようにブロック内での補間ピクセルの位置によって参照するピクセルを変更して、補間演算を行っている。これは、エッジ検出の方法との兼ね合いで、する必要がない場合もある。
【0090】
注目ブロック内の右下の画素を補間する場合、このピクセル位置(x,y)はブロック内で(2,2)である。x,yともに拡大率Mの半分以上であるため、バイキュービック法による計算を行う際に、参照点として用いるのは、(-1,-1)〜(2,2)の16点となる。ここで、拡大前画像の端部からはみ出る部分については、端部のピクセルが連続しているものとして計算する。つまり、参照画素は、図22の下段に示す位置となる。
この場合、拡大前画像の画素(2,2)の輝度値(画像データの値)は96であるため、注目画素の対応する対応画素(注目ブロックに対応する対応画素と同じ)の輝度値203との差は107となり、しきい値L8(50)より大きい。すなわち、画素(2,2)の輝度値は所定範囲外であるため同画素(2,2)の輝度値を画素(0,0)の輝度値203で置き換え、他の画素の輝度値は所定範囲内であるためそのままとする。
また、距離係数は、dx=(2-1)/3=0.333、dy=(2-1)/3=0.333となる。これらの値を用いて、上記演算式(8)により補間処理後の階調値Eを計算する。
このような補間処理を注目ブロック内の全てのピクセルに対して繰り返すことになる。
【0091】
従来からのバイキュービック法やバイリニア法による補間処理では、エッジの領域を跨いで色の画素補間を行うため、エッジ部分に鮮鋭化処理を行い、同エッジ部分の近傍で補間処理を行うと、エッジブロックとその周囲でブロックとの間での色の差が発生していた。本発明によると、エッジの領域を越えた参照画素の画像データを用いないようにしたので、エッジブロックと非エッジブロックとで色の差の発生を少なくすることができる。また、補間処理後の階調データを生成するために所定のパターンを拡大率別に用意しておく必要がないため、任意倍率の画像拡大処理を容易に行うことができる。
なお、本画像補間装置は、2次元デジタル画像を拡大する場合や、プリンタ印刷時の画像拡大処理を行う場合、小型携帯機器などで撮影した低解像度画像を拡大する場合等、様々な場面に利用することができ、少ない計算量による、適切な色の補間処理を行うことができる。
【0092】
(4)変形例:
本発明の画像補間装置は、様々な構成が可能である。
例えば、プリンタは、コンピュータと一体化されたものであってもよい。上述したフローについては、コンピュータ本体内で実行する以外にも、一部または全部をプリンタあるいは専用の画像出力装置で実行するようにしてもよい。
画像データを構成する多数の画素は、縦横に整然と並んだドットマトリクス状とされる以外にも、様々な構成が考えられる。例えば、正六角形を密に並べたような蜂の巣状に整然と並んだドットマトリクス状の画素から画像データを構成してもよい。
以上説明したように、本発明によると、補間処理の際に注目画素に対応した対応画素の画像データとの差異が大きい画素の画像データが用いられないので、実質的には注目画素の近隣に位置する所定領域内の領域のうちエッジの領域を越えた領域の画素の画像データが用いられず、エッジ部分が平滑化されない。従って、補間処理後でもエッジ部分の鮮鋭さを維持して画質を向上させることが可能な画像補間装置および画像補間プログラムを提供することができる。また、画像補間方法としても適用可能である。
【図面の簡単な説明】
【図1】 印刷システムのハードウェア構成の概略を示すブロック図。
【図2】 プリンタのハードウェア構成の概略を示すブロック図。
【図3】 画像補間装置の構成の概略を模式的に示す図。
【図4】 補間処理の様子を模式的に示す図。
【図5】 画像補間装置が行う処理を示すフローチャート。
【図6】 ゼロクロス検出処理を示すフローチャート。
【図7】 フィルタ演算処理を示すフローチャート。
【図8】 ゼロクロス位置算出処理を示すフローチャート。
【図9】 拡大エッジ位置情報を取得する様子を模式的に示す図。
【図10】 ゼロクロス連結処理を示すフローチャート。
【図11】 エッジ生成処理を示すフローチャート。
【図12】 連結位置情報を取得する様子を模式的に示す図。
【図13】 補間処理を示すフローチャート。
【図14】 2値化データを生成してパターンマッチング処理を行う様子を模式的に示す図。
【図15】 マッチングパターンの一例を模式的に示す図。
【図16】 エッジ色埋め処理を示すフローチャート。
【図17】 エッジ色埋め処理を行う様子を模式的に示す図。
【図18】 選択バイキュービック処理で参照画素を決定する様子を模式的に示す図。
【図19】 選択バイキュービック処理を示すフローチャート。
【図20】 選択バイリニア処理を示すフローチャート。
【図21】 選択バイリニア処理で参照画素を決定する様子を模式的に示す図。
【図22】 補間処理を選択して参照画素を設定する様子を模式的に示す図。
【符号の説明】
10…パーソナルコンピュータ(PC)、11…CPU、12…ROM、13…RAM、14…ハードディスク(HD)、15…CD−ROMドライブ、16…フレキシブルディスク(FD)ドライブ、17a〜e…インターフェイス(I/F)、18a…ディスプレイ、18b…キーボード、18c…マウス、20…インクジェットプリンタ、30…デジタルカメラ、51…注目画素、52…隣接画素、53,56…ゼロクロス、54…注目ブロック、55…隣接ブロック、57…拡大エッジ位置情報、61a,b,62a,b…エッジ画素、61c〜e,62c〜e…連結画素、100…印刷システム、D1…画像データ、D2…エッジ情報、D3…2値化データ、I1…拡大前画像、I1u…画素、I2…拡大画像、I2d…ブロック(画素区分)、I2u…画素、N1…注目画素、N1u…対応画素、N2…注目ブロック、R1,R3…所定領域、R2…第二の所定領域、U0…画像補間装置、U1…エッジ生成手段、U2…補間手段[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image interpolation apparatus, an image interpolation method, and an image interpolation program that perform gradation processing from image data that represents a gradation of an image and generate gradation data corresponding to each pixel of the image after interpolation processing.
[0002]
[Prior art]
Conventionally, when generating an enlarged image in which the number of constituent pixels is increased from an image before enlargement (hereinafter also referred to as an image before enlargement), gradation data of each pixel of the image before enlargement (also referred to as gradation data of the enlarged image). , The same) is generated by a predetermined interpolation process. In interpolation processing using the bilinear method, bicubic method, etc., gradation data of an enlarged image is generated using image data of a plurality of pixels in a predetermined area in the pre-enlargement image located in the vicinity of the target pixel on the enlarged image. Yes. Also, interpolation processing is performed in units of blocks obtained by dividing the pixels of the enlarged image corresponding to the pixels of the pre-enlarged image to generate gradation data of the enlarged image, and the image of the pre-enlarged image is sharpened so that the edge portion is sharp. Edge enhancement processing and sharpening processing are also performed based on the image data.
Furthermore, gradation data is superimposed on image data of the same image by performing a plurality of interpolation processes (see, for example, Patent Document 1). In the technique disclosed in Patent Document 1, cubic convolution interpolation is performed under a certain condition to generate gradation data of an enlarged image, and under other conditions, a matching pattern corresponding to the interpolation data is prepared for each enlargement ratio. In addition, an edge and its pattern are detected by pattern matching, and interpolation data corresponding to the detected pattern is used as gradation data after interpolation processing, and these gradation data are superimposed.
[0003]
[Patent Document 1]
JP 2002-165089 A (paragraphs 0011-0094, FIG. 1-18)
[0004]
[Problems to be solved by the invention]
The conventional techniques described above have the following problems.
When interpolation processing is performed using image data of a plurality of pixels straddling the edge region, the image data of the pixel beyond the edge region with respect to the target pixel is reflected in the gradation data after the interpolation processing Therefore, there is a problem that the edge portion is smoothed and blurred. In particular, when interpolation processing is performed in units of blocks, if processing such as sharpening is performed on blocks with edges, blocks with edge areas (also referred to as edge blocks) and blocks without edge areas (non-edge blocks) ) Has a problem that a color difference occurs.
Even in the technique disclosed in Patent Document 1, when cubic convolution interpolation is performed using image data of a plurality of pixels straddling an edge region, the edge portion is smoothed. Further, since it is necessary to prepare a pattern after interpolation processing for each enlargement ratio, it can be applied only to a fixed enlargement ratio, and it is difficult to realize an arbitrary magnification. Furthermore, since the process of superimposing the gradation data is necessary, the interpolation process takes too much time.
[0005]
The present invention has been made in view of the above problems, and it is an object of the present invention to provide an image interpolation apparatus, an image interpolation method, and an image interpolation program capable of improving the image quality by maintaining the sharpness of the edge portion even after the interpolation processing. And
[0006]
[Means for Solving the Problems and Effects of the Invention]
To achieve the above object, according to the first aspect of the present invention, interpolation is performed by referring to image data of a plurality of pixels in a predetermined region in an image before interpolation processing located in the vicinity of a pixel of interest on the image after interpolation processing. When performing processing, interpolation processing is performed using only image data of pixels in which a difference in image data from a pixel in an image before interpolation processing corresponding to the pixel of interest among a plurality of pixels in the predetermined region falls within a predetermined range. I do. Then, since the image data of the pixel having a large difference from the image data of the pixel corresponding to the target pixel is not used in the interpolation process, substantially only the image data of the pixel on the target pixel side from the edge region is used. The interpolation processing used is performed. That is, since the edge portion is not smoothed, it is possible to improve the image quality while maintaining the sharpness of the edge portion even after the interpolation processing.
[0007]
Here, various processes such as an interpolation process using a bicubic method and an interpolation process using a bilinear method are conceivable as an interpolation process that refers to image data of a plurality of pixels. The predetermined area may be appropriately determined according to the type of interpolation processing.
2. The invention according to claim 1, wherein even if there is only one pixel in which a difference in image data from a pixel in an image before interpolation processing corresponding to the target pixel is within a predetermined range among a plurality of pixels in the predetermined region. include. The same applies to the following.
The image data may be information in various data formats such as bitmap data and compressed data. The image data includes, for example, YCbCr data composed of luminance data (Y) and color difference data (Cb, Cr), red data (R), green data (G), and blue data (B). RGB data, CMYeG data composed of cyan data (C), magenta data (M), yellow data (Ye) and green data (G), Lab data in Lab space defined as CIE standards, etc. Various types of data are possible.
[0008]
The image data may be data representing the brightness of the image. The image data representing the brightness may be various types of data such as luminance data, lightness data, average of RGB data, and the like. There are various differences in the image data, such as a difference in gradation values, a ratio of gradation values, a difference in square of gradation values, and the like.
[0009]
The predetermined range may include or exclude a boundary portion. Whether or not the difference between the image data is within a predetermined range can be determined, for example, by comparing the difference with a predetermined threshold value. Here, the threshold value may be a fixed value or a value that varies depending on conditions. The same applies to the following.
[0010]
The smoothing of the edge portion due to the interpolation processing becomes a problem particularly when the image is enlarged. Therefore, in the invention according to claim 2, interpolation processing is performed by referring to image data of a plurality of pixels in a predetermined region in the pre-enlargement image located in the vicinity of the target pixel while sequentially moving the target pixel on the enlarged image. When performing, an interpolation process is performed using only image data of a pixel in which a difference in image data from a pixel in the pre-enlargement image corresponding to the target pixel is within a predetermined range among a plurality of pixels in the predetermined region. That is, the edge portion is not smoothed even at the time of image enlargement where the smoothing of the edge portion is a problem, so that it is possible to improve the image quality while maintaining the sharpness of the edge portion even after the interpolation processing.
[0011]
Here, for each pixel segment obtained by segmenting the pixel of the enlarged image corresponding to the pixel of the pre-enlarged image, the target pixel segment is sequentially moved on the enlarged image, and each pixel in the target pixel segment is enlarged in the vicinity. When interpolation processing is performed with reference to image data of a plurality of pixels in a predetermined region in the previous image, image data of the pixels in the pre-enlargement image corresponding to the same pixel of interest among the plurality of pixels in the predetermined region A configuration may be adopted in which interpolation processing is performed using only image data of pixels whose difference falls within a predetermined range. That is, since the edge portion is not smoothed, it is possible to improve the image quality while maintaining the sharpness of the edge portion even after the interpolation processing. In addition, even when sharpening or the like is performed on a block in which an edge region exists, there is no color difference between the block in which the edge region exists and a block in which the edge region does not exist, and this also improves the image quality. .
[0012]
The above-described interpolation is performed by replacing the image data of the pixel whose image data difference with the pixel in the pre-enlargement image corresponding to the pixel-of-interest segment is outside a predetermined range with the image data of the pixel in the pre-enlargement image corresponding to the pixel-of-interest segment. It is good also as a structure which performs a process. With a simple configuration that replaces the image data, a known interpolation process can be used, and only the image data of the pixels in which the difference between the image data and the pixels in the pre-enlargement image corresponding to the target pixel classification falls within a predetermined range. Interpolation processing can be easily performed.
[0013]
Edge generation means for generating edge information representing an edge area of the enlarged image corresponding to the position of each pixel of the enlarged image in pixel units of the enlarged image based on the image data, and based on the edge information Whether or not there is an edge region in the target pixel section, and when it is determined that an edge region exists, for each pixel in the target pixel section, the enlarged image on the pixel side from the edge region is determined. The gradation data may be generated using only pixel image data. Since the gradation data of each pixel in the pixel section where the edge region exists does not reflect the image data of the pixel beyond the edge region, the sharpness of the edge portion of the enlarged image is maintained and good image quality is achieved. Can be obtained.
[0014]
In addition, the edge generation means acquires enlarged edge position information that represents the position of the edge of the enlarged image corresponding to the position of the edge of the pre-enlarged image based on the edge position information for each pixel of the enlarged image. A configuration may be provided that includes position acquisition means and connection means for connecting edges of neighboring enlarged images based on the enlarged edge position information to generate edge information representing the edge region of the enlarged image.
[0015]
Performing an operation using a Laplacian filter on the image data of the pixel of interest and the surrounding pixels on the pre-enlargement image to generate intermediate data expressed in gradation corresponding to each pixel of the pre-enlargement image, While the pixel of interest is sequentially moved on the dot matrix pixel corresponding to the intermediate data, the position of the pixel of interest and the position of the pixel located in the vicinity thereof and the position where the intermediate data is made substantially zero are represented based on the intermediate data. A position acquisition unit that acquires the edge position information may be provided. The surrounding pixels may be adjacent to the target pixel or may not be adjacent.
As the Laplacian filter, an 8-directional Laplacian filter, a 4-directional Laplacian filter, and the like can be adopted. Of course, the position of the edge may be detected using a first-order spatial differential filter, a nonlinear differential filter, or the like.
[0016]
The binarized data is generated by binarizing the image data of the pixel in the pre-enlargement image corresponding to the target pixel classification and the pixel located in the vicinity thereof, and the binarized data and the presence of the edge can be determined. Based on a plurality of predetermined matching patterns, it is determined whether or not an edge exists in the pixel segment of interest and a pixel segment located in the vicinity thereof, and each pixel of the pixel segment of interest when it is determined that an edge exists The gradation data may be generated using only the image data of the pixel of the enlarged image on the pixel side from the edge region. A sharpening process can be reliably performed on a block in which an edge region is reliably present with a simple configuration, and an edge portion of an enlarged image can be reliably formed with a fine line.
[0017]
The connecting means binarizes image data of the pixel of interest and its neighboring pixels while sequentially moving the pixel of interest on the pre-enlargement image, and generates binary data. The edge direction is determined on the basis of the digitized data and a plurality of predetermined matching patterns corresponding to the edge direction, and the edges of the adjacent enlarged images are connected so as to have the determined edge direction. The edge information may be generated. The edges of the enlarged images can be reliably connected with a simple configuration, and the edges of the enlarged image can be reliably formed with fine lines with high speed processing. In addition, since the matching pattern in this case can be a matching pattern for generating gradation data corresponding to each pixel of the enlarged image, the edge information is generated and the gradation corresponding to each pixel of the edge block is generated. The process of generating data can be performed efficiently.
[0018]
When the binarized data and the plurality of matching patterns do not match, the interpolation processing is performed using image data of pixels in a predetermined region in the pre-enlarged image located in the vicinity of the enlarged pixel section, and the attention is paid. Grayscale data may be generated for each pixel in the pixel section.
[0019]
The type of interpolation processing may be switched according to the degree of difference in image data for a plurality of pixels in the second predetermined region in an image before interpolation processing located in the vicinity of the pixel of interest. Appropriate interpolation processing can be performed according to the image data of the pixel adjacent to the target pixel, so that the sharpness of the edge portion can be maintained and the image quality of the image after interpolation processing can be further improved. .
[0020]
A configuration may be adopted in which the number of pixels that refer to the image data increases as the degree of difference in image data for the plurality of pixels in the second predetermined region increases. Interpolation processing needs to be performed with higher accuracy as the degree of difference in image data increases, but as the degree of difference increases, the number of pixels referred to in interpolation processing increases. Can be obtained.
[0021]
The image interpolating apparatus described above may be implemented alone, or may be implemented together with other methods in a state of being incorporated in a certain device. It can be changed as appropriate.
The invention also exists in a method for performing processing corresponding to the above-described means in accordance with a predetermined procedure. Therefore, the present invention can also be applied as a control method for an image interpolation apparatus, and the invention according to claim 9 has basically the same operation.
Furthermore, the present invention can also be applied as a print control apparatus that performs print control on a printing apparatus that performs printing based on image data of an enlarged image (image data representing an enlarged image; hereinafter the same). It can also be applied as a printing system including a printing apparatus, and basically has the same effect.
[0022]
When trying to implement the present invention, a predetermined program may be executed by the above apparatus. Therefore, the present invention can also be applied as a control program for an image interpolation apparatus, and the invention according to claim 10 basically has the same effect. Furthermore, it is conceivable that a medium on which the program is recorded is distributed and the program is appropriately read from the recording medium into a computer. That is, the present invention can be applied to a computer-readable recording medium that records the program, and basically has the same effect.
Of course, the configurations described in claims 2 to 8 can be made to correspond to the method, the printing control apparatus, the printing system, the program, and the medium on which the program is recorded.
Here, the recording medium may be any recording medium developed in the future in addition to the magnetic recording medium and the magneto-optical recording medium. There is no limitation on the replication stage such as primary replica and secondary replica. The idea of the present invention also includes a case where a part is realized by hardware, and a case where a part is recorded on a recording medium and read as needed.
[0023]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in the following order.
(1) Configuration of printing system:
(2) Outline of configuration of image interpolation apparatus:
(3) Processing performed by the image interpolation device:
(3-1) Zero cross detection processing:
(3-2) Zero cross connection processing:
(3-3) Interpolation processing:
(4) Modification:
[0024]
(1) Configuration of printing system:
FIG. 1 shows a schematic configuration of a printing system 100 according to an embodiment of the present invention. The system 100 includes a personal computer (PC) 10 and a color printing ink jet printer 20 as a printing apparatus. Note that the PC 10 is an image interpolation device according to the present invention in the sense of performing interpolation processing. Further, the printing control device is used in the sense that image data composed of gradation data after interpolation processing is generated and the corresponding output image is printed by the printer 20.
The PC 10 includes a CPU 11 that is the center of arithmetic processing, and the CPU 11 controls the entire PC 10 via a system bus 10a. The bus 10a is connected to a ROM 12, a RAM 13, a CD-ROM drive 15, a flexible disk (FD) drive 16, various interfaces (I / F) 17a to 17e, and the like. A hard disk (HD) 14 is also connected via a hard disk drive. Although a desktop PC is employed as the computer of this embodiment, a computer having a general configuration can be employed.
[0025]
The HD 14 stores an operating system (OS), an application program (APL) that can create image information, and the like. At the time of execution, the CPU 11 appropriately transfers these software to the RAM 13 and executes the program while appropriately accessing the RAM 13 as a temporary work area.
The peripheral device I / F (PIF) 17a is connected to a digital camera 30, a color scanner (not shown), and the like. The digital camera 30 can generate image data representing gradation of a captured image with dots in a matrix of dots and output the image data to the PC 10. A display 18a for displaying an image based on image data is connected to the CRTI / F 17b, and a keyboard 18b and a mouse 18c are connected to the input I / F 17c as operation input devices. Further, the printer 20 is connected to the printer I / F 17e via a parallel I / F cable. Of course, the printer 20 may be connected via a USB cable or the like.
[0026]
The printer 20 uses the inks of C (cyan), M (magenta), Ye (yellow), and K (black), and corresponds to the gradation values constituting the image data on the printing paper (printing medium). Ink is discharged so that the ink amount is reached, and an image is printed. Of course, you may employ | adopt the printer which uses inks other than four colors. In addition, various printing apparatuses such as a bubble printer that generates bubbles in the ink passage and ejects ink, a laser printer, and the like can be employed.
As shown in FIG. 2, in the printer 20, a CPU 21, ROM 22, RAM 23, communication I / O 24, control IC 25, ASIC 26, I / F 27, and the like are connected via a bus 20a. The communication I / O 24 is connected to the printer I / F 17e of the PC 10, and the printer 20 receives a print job composed of data converted to CMYeK and page description language transmitted from the PC 10 via the communication I / O 24. . The ASIC 26 outputs applied voltage data based on the CMYeK data to the head driving unit 26a while transmitting / receiving a predetermined signal to / from the CPU 21. The head drive unit 26a generates an applied voltage pattern to a piezo element built in the print head based on the applied voltage data, and causes the print head to eject CMYeK ink. The carriage mechanism 27a and the paper feed mechanism 27b connected to the I / F 27 perform main scanning of the print head, and sequentially feed the media while performing page break operation as appropriate, and perform sub-scanning. And CPU21 controls each part according to the program written in ROM22, using RAM23 as a work area.
[0027]
In the PC 10, the BIOS is executed based on the above hardware, and the OS and APL are executed in the upper layer. Various drivers such as a printer driver for controlling the printer I / F 17e are incorporated in the OS, and the hardware is controlled. The printer driver can perform two-way communication with the printer 20 via the printer I / F 17e, receives image data from the APL, creates a print job, and sends the print job to the printer 20. The image interpolation program of the present invention is composed of APL, but may be composed of a printer driver. The HD 14 is a medium on which the program is recorded. Examples of the medium include a CD-ROM, an FD 16a, a magneto-optical disk, a nonvolatile memory, a punch card, and a print medium on which a code such as a barcode is printed. It may be. Of course, it is also possible to download and execute the control program stored in a predetermined server from the communication I / F 17d via the Internet.
The hardware and the program cooperate to construct an image interpolation apparatus.
[0028]
(2) Outline of configuration of image interpolation apparatus:
FIG. 3 schematically shows a schematic configuration of the image interpolation apparatus. An image interpolation program for causing a PC to function as the image interpolation device U0 is composed of a plurality of modules corresponding to various means described below. In the present embodiment, an example of an image interpolation device that enlarges an image is taken up, but the present invention can also be applied when an image is not enlarged.
The image interpolating device U0 roughly includes edge generation means U1 for generating edge information D2 representing the edge area of the enlarged image I2 based on the image data D1 of the image before enlargement I1, and interpolation from the image data D1 of the image before enlargement. Interpolating means U2 that performs processing to generate gradation data corresponding to each pixel I2u of the enlarged image I2 after the interpolation processing. At this time, while sequentially moving the block of interest N2 on the enlarged image I2 for each block (pixel division, 3 × 3 pixels in the figure) obtained by dividing the pixel I2u of the enlarged image corresponding to the pixel I1u of the image before enlargement, Interpolation processing is sequentially performed for each pixel in the target block N2. When performing such block-unit image interpolation processing, the present apparatus can prevent color difference between the edge block and the non-edge block even if the edge block is sharpened.
[0029]
The image data D1 of the pre-enlargement image is data that represents the pre-enlargement image with a large number of pixels in a dot matrix and represents the brightness of the pre-enlargement image. The image data of this embodiment will be described as YCbCr data composed of Y (luminance), Cb (blue color difference), and Cr (red color difference), but R (red), G (green), and B (blue). ) RGB data or the like. Moreover, although each YCbCr component is described as having 256 gradations, it may be 1024 gradations, 100 gradations, or the like.
The edge generation unit U1 first calculates and acquires a zero cross position Z (edge position information) based on the luminance value Y of the image data D1.
[0030]
In addition to acquiring the zero-cross position Z using the luminance value Y, the zero-cross position Z may be acquired using the average value of the gradation values of each RGB, and the luminance value Y is calculated by the following formula: Then, the zero cross position Z may be acquired using the same luminance value Y.
Y = 0.30r + 0.59g + 0.11b (1)
Here, r, g, and b represent the gradation values of each RGB.
[0031]
Next, the edge generation means U1 calculates which pixel after the enlargement the zero-cross position Z corresponds to, and sets that position as the zero-cross position after enlargement (enlarged edge position information). Further, connection position information for connecting the edges of adjacent enlarged images I2 is acquired. Then, the edge information D2 is generated by combining the enlarged edge position information and the connection position information. The edge information D2 is a set of coordinate values representing an edge region corresponding to the position of each pixel I2u of the enlarged image in units of the pixel I2u of the enlarged image when the pixel I2u of the enlarged image is placed on the xy plane. Yes.
[0032]
The interpolating means U2 sequentially moves the pixel of interest N1 for generating gradation data on the enlarged image I2 after the interpolation process, and moves within the predetermined region R1 in the pre-enlargement image I1 before the interpolation process located in the vicinity of the pixel of interest N1. Interpolation processing is performed with reference to image data of a plurality of pixels. When performing the interpolation process by the bicubic method, the image data of 4 × 4 pixels of the pre-enlargement image located in the vicinity of the target pixel is referred to. In the figure, for convenience, the 4 × 4 pixels are named P11 to P44. When performing the interpolation processing, it is determined based on the image data D1 of the pre-enlargement image whether or not the edge region of the image crosses the plurality of pixels P11 to P44 in the predetermined region R1. When it is determined that the pixel has crossed, interpolation processing is performed using only the image data of the pixel on the target pixel side from the edge region.
In the example in the figure, since the edge region crosses within the predetermined region R1, only the image data of the pixels P11 to P14, P21 to P24, P32 to P34, and P43 to P44 of the pre-enlargement image on the target pixel N1 side. To perform interpolation processing.
[0033]
As shown in FIG. 4, in practice, among the plurality of pixels I1u in the predetermined region R1, the pixel (corresponding pixel) N1u in the pre-enlargement image corresponding to the target pixel N1 on the enlarged image I2 before the interpolation process Interpolation processing is performed using only image data of pixels in which the difference between the image data is within a predetermined range. The corresponding pixel N1u is a pixel on the pre-enlargement image I1 corresponding to a block on the enlarged image I2 including the target pixel N1. By performing such processing, it is possible to determine whether or not the edge region crosses the predetermined region R1 without generating the edge information D2, and the interpolation processing can be simplified. That is, the present invention is effective even if it is constituted only by the interpolation means U2. In the case where image interpolation processing is performed in units of blocks, when edge information is generated, sharpening processing can be easily performed on edge blocks based on the edge information.
Since the values of the image data greatly differ from the edge region, as shown in the lower part of the figure, the edge region is obtained by using only the image data of the pixel whose image data is different from the pixel N1u within a predetermined range. Thus, the interpolation process can be performed using only the image data of the pixel on the target pixel N1 side.
[0034]
In the example shown in the figure, the image data of the pixels on the target pixel N1 side is all 200, and when the interpolation process is performed using the image data, the gradation data of the target pixel N1 is 200. In the conventional technique, the image data 0 of the pixels P31, P41, and P42 on the other side of the edge region from the target pixel N1 is also used for the interpolation processing. Therefore, the image data of the target pixel N1 is smaller than 200, and the edge portion is It will be smoothed and blurred. In addition, when interpolation processing is performed in units of blocks, if a process such as sharpening is performed on an edge block, a color difference may be generated between the edge block and the non-edge block. Since the apparatus U0 does not use the image data of the pixel whose image data is different from the pixel N1u outside the predetermined range and does not use the image data of the pixel beyond the edge region from the target pixel N1. Even after the interpolation processing, it is possible to maintain the sharpness of the edge portion and improve the image quality.
[0035]
(3) Processing performed by the image interpolation device:
Hereinafter, the operation will be described in detail together with the processing performed by the image interpolation apparatus.
FIG. 5 is a flowchart showing processing performed by the image interpolation apparatus. Specifically, the CPU 11 of the PC 10 performs this process.
First, a zero-cross detection process for acquiring the zero-cross position Z is performed by the edge generation means (step S105; hereinafter, description of “step” is omitted), and a zero-cross connection process for generating edge information by connecting the zero crosses is performed (S110). ). Next, the interpolation means performs interpolation processing from the image data of the pre-enlargement image to generate gradation data corresponding to each pixel of the image after interpolation processing (S115), and this flow ends. Thereafter, the enlarged image corresponding to the image data composed of the gradation data is displayed on the display, or the enlarged image corresponding to the image data is printed by outputting the image data to the printer 20. be able to.
[0036]
(3-1) Zero cross detection processing:
FIG. 6 is a flowchart showing the zero cross detection process.
First, as schematically shown in FIG. 3, Gaussian blurring processing is performed to perform Gaussian blurring on image data that represents the pre-enlargement image with gradation data for each pixel in a dot matrix (S205). This process is performed according to the flow shown in FIG. First, image data representing the image before enlargement with a large number of pixel-specific YCbCr data is input, and the position of the target pixel is set on the image before enlargement (S305). When inputting image data from the digital camera 30 or the like, it is not necessary to read the entire data all at once, and it may be partially read. When called from another APL, it is used for data transfer. It is also possible to simply pass a pointer representing the buffer area to be processed. Also, the order of setting the position of the pixel of interest starts from the upper left pixel and goes to the upper right pixel in order, then from the lower left pixel to the right end pixel one by one, and finally the lower right It is a pixel. The same applies to the case where the position of the target pixel is set in various processes. Of course, the order in which the position of the pixel of interest is set can be changed as appropriate, and can be changed according to the type of the pre-enlargement image.
[0037]
Further, the luminance value Y (image data) of the 3 × 3 pixels (predetermined area) located in the vicinity of the target pixel is acquired (S310). When the values of the image data of 3 × 3 pixels are d1 to d9 in the order of upper left to upper right, left middle to right middle, and lower left to lower right, the luminance value of the target pixel is d5, and eight pixels located in the vicinity thereof are d5. The luminance values are d1 to d4 and d6 to d9. When the target pixel is at the end of the pre-enlargement image, the luminance value is acquired assuming that the luminance value at the end pixel of the pre-enlargement image is outside (folded back) of the pre-enlargement image. The same applies to the following.
[0038]
Then, a Gaussian blur calculation is performed using the known Gaussian blur calculation filter F1 shown in the flow of FIG. 7 (S315). Here, the calculation filter F for performing the filter calculation has coefficients f1 to f9 corresponding to the respective 3 × 3 pixels to be referred to, and is the same as the image data d1 to d9 corresponding to each pixel. The sum total multiplied by the coefficients is obtained to calculate the gradation data d ′ after the filter calculation of the target pixel. Actually, as shown in the following expression, the sum is multiplied by a predetermined coefficient (k) to obtain data d ′ after the filter operation.
d ′ = kΣfi · di (2)
In the case of a filter in which the sum Σfi of the coefficients f1 to f9 is 0 as in a Laplacian filter described later, k = 1, and in the filter in which the sum Σfi of the coefficients f1 to f9 is 0 as in the Gaussian blurring filter F1. In this case, k = 1 / Σfi.
[0039]
Thereafter, it is determined whether or not a Gaussian blur calculation has been performed for all the pixels of the pre-enlargement image (S320). If the condition is not satisfied, an operation for performing Gaussian blurring is repeatedly performed in steps S305 to S320 while sequentially moving the target pixel on the pre-enlargement image. If the condition is met, this flow ends. Although it is possible to generate edge information without performing Gaussian blurring processing, noise is eliminated by performing Gaussian blurring processing, so the accuracy of the edge position is improved and the smoothed edge Information representing the position can be generated.
[0040]
When the Gaussian blurring process is completed, the process proceeds to S210 in FIG. 6, and a Laplacian filter calculation process using a Laplacian filter is performed on the image data subjected to the Gaussian blurring process. This process is also performed according to the flow shown in FIG. First, the position of the pixel of interest is set on the pre-enlargement image represented by gradation using image data that has been subjected to Gaussian blur processing (S305). Next, the luminance values d1 to d9 of 3 × 3 pixels located in the vicinity of the target pixel are acquired (S310). Then, a Laplacian filter operation is performed using the known 8-direction Laplacian filter F2 shown in the flow of FIG. 7 to generate intermediate data expressed in gradation by dot matrix pixels (S315).
[0041]
Here, the coefficients f1 to f4 and f6 to f9 around the coefficient f5 of the filter F2 corresponding to the target pixel are all set to 1, and the coefficient f5 at the center is a sign of the sum of the coefficients f1 to f4 and f6 to f9. The inverted value is -8. That is, by performing the filter calculation using the filter F2, the sum of the differences between the luminance values of the pixels around the pixel of interest and the luminance value of the pixel of interest is calculated and the Laplacian filter is calculated, as in the following equation: Gradation data d ′.
d ′ = Σ (di−d5) (3)
However, i = 1 to 4, 6 to 9.
[0042]
Then, it is determined whether or not a Laplacian filter operation has been performed for all pixels of the pre-enlargement image that has undergone the Gaussian blurring process (S320). If the condition is not satisfied, intermediate data is generated by the processes of S305 to S320 repeatedly. If the condition is met, this flow ends. By performing Laplacian filter calculation processing to detect the edge position, information representing the edge position can be obtained with a simple configuration with high accuracy, and edge information representing the edge region of the enlarged image can be accurately generated. be able to.
[0043]
Thereafter, a buffer area for storing the zero-cross position Z is secured in the RAM (S215 in FIG. 5). Next, the position of the target pixel is set on the pixel in the dot matrix corresponding to the generated intermediate data (S220). Then, it is determined whether the intermediate data of the target pixel and the intermediate data of the pixel (right adjacent pixel) located on the right side (neighbor) of the target pixel are different (S225). If the signs are not different, there is almost no zero cross between the target pixel and the right adjacent pixel, so the process proceeds to S250 without performing the zero cross position calculation process of S245. If it is determined that the sign is different, at least one of the absolute value of the intermediate data of the pixel of interest and the absolute value of the intermediate data of the right adjacent pixel at the current position is a predetermined value in order to determine whether the zero cross position should be calculated. It is determined whether or not the threshold value is L1 or more (or greater) (S230). When the luminance value of the pre-enlargement image is 256 gradations, the gradation value of the intermediate data is also 256 gradations, and the threshold value L1 may be set to, for example, 128, which is a substantially intermediate value of 256 gradations. If the condition is satisfied, the process proceeds to S245 to perform a zero cross position calculation process. The edge exists mainly when the difference in luminance value between the two pixels is large and the sign of the intermediate data is different. Therefore, the information representing the position of the edge can be obtained with high accuracy. It is possible to generate information representing the edge area of the enlarged image.
[0044]
When the condition is not satisfied, the maximum value and the minimum value of the luminance values of 3 × 3 pixels centering on the target pixel on the pre-enlargement image on which the Gaussian blurring process has been performed are performed in order to determine whether or not the zero cross position should be calculated. Is determined (S235), and it is determined whether or not the determined difference is equal to or greater than (or greater than) a predetermined threshold L2 (S240). When the luminance value of the pre-enlargement image after the Gaussian blurring process is 256 gradations, the threshold value L2 may be set to 50, for example. If the condition is satisfied, the process proceeds to S245 to perform a zero cross position calculation process. As a result of performing Laplacian filter calculation processing because the difference between the luminance values of the target pixel and the right adjacent pixel is small, the luminance value of 3 × 3 pixels centered on the target pixel can be detected even if the zero cross cannot be detected in S230. Since the difference may be large, the zero-cross detection accuracy can be improved. That is, it is possible to acquire information representing the edge position with high accuracy, and as a result, it is possible to generate information representing the edge region of the enlarged image with high accuracy. On the other hand, if the condition is not satisfied, the process proceeds to S250.
[0045]
FIG. 8 is a flowchart showing the zero cross position calculation process.
First, the enlargement ratio M from the pre-enlargement image to the enlarged image is acquired (S355). For example, a print interface screen having a resolution selection field may be displayed on the display, and a parameter representing an image enlargement ratio may be acquired from an operation input to the resolution selection field and stored in the RAM. Here, when the enlargement ratio is M, it means that the number of pixels in the horizontal direction (x direction) is increased M times and the number of pixels in the vertical direction (y direction) is increased M times. Of course, Mx and My may be acquired as the enlargement ratio, the number of pixels in the horizontal direction may be multiplied by Mx, and the number of pixels in the vertical direction may be multiplied by My.
[0046]
Next, assuming that the position of the pixel reflecting the enlargement factor M is X1 and the intermediate data of the pixel is Y1, the pixel of interest and the adjacent pixels (the right adjacent pixel when this processing is performed in S245) X1 and Y1 A1 and B1 of the relational expression Y1 = A1 · X1 + B1 are calculated (S360). Here, the pixel position X1 is an x coordinate in the horizontal direction on the enlarged image when a straight line expression is obtained for two points of the target pixel and the right adjacent pixel, and about the two points of the target pixel and the lower adjacent pixel. When a straight line expression is obtained, the y coordinate in the vertical direction on the enlarged image is used. Assuming that the intermediate data of the pixel of interest is LP0, the intermediate data of adjacent pixels is LP1, and the position of the pixel of interest on the pre-enlargement image is x0, A1 and B1 can be calculated by the following equations.
A1 = (LP1-LP0) / M (4)
B1 = LP0−A1 × (x0 × M + M / 2) (5)
[0047]
When A1 and B1 are calculated, the zero cross position Z1 reflecting the enlargement factor M is calculated by the following equation (S365).
Z1 = −B1 / A1 (6)
Here, Z1 is a value having information after the decimal point, and is a unit smaller than the pixel of the pre-enlargement image. Since this is a value obtained by multiplying the pixel position of the pre-enlargement image by the enlargement factor M, the zero-cross position Z1 is edge position information representing the position of the edge corresponding to the position of each pixel of the pre-enlargement image.
[0048]
When the zero-cross position Z1 is calculated, an edge position Z1 ′ (a kind of enlarged edge position information) of the enlarged image corresponding to the edge position of the pre-enlarged image is acquired based on the zero-cross position Z1 (S370). The edge position Z1 ′ of the enlarged image can be calculated by the following equation.
Z1 ′ = INT (Z1) (7)
Here, INT is a function for truncating after the decimal point. That is, Z1 ′ is numerical information indicating the position of the edge of the enlarged image in pixel units of the enlarged image.
[0049]
FIG. 9 schematically shows how the enlarged edge position information is acquired when the enlargement ratio M is 3.
There is a target pixel 51 of intermediate data LP0 = -125 at x = 1, y = 2 of the pre-enlargement image, and an adjacent pixel 52 of intermediate data LP1 = 53 is at x = 2, y = 2, which is to the right of the target pixel. Suppose there is. Here, where the zero cross 56 exists in the blocks 54 and 55 in which the pixels of the enlarged image are divided corresponding to the pixels of the pre-enlarged image is obtained using the above equations (4) to (6). Assume that there are a target block 54 and an adjacent block 55 corresponding to the target pixel 51 and the adjacent pixel 52 of the pre-enlargement image, respectively.
As in the X1-Y1 graph shown in the lower part of the middle of the figure, the straight line connecting the target pixel and the adjacent pixel on the X1 (x coordinate or y coordinate) -Y1 (intermediate data) plane intersects the X1 axis. The point to perform (the point where Y1 = 0) is the zero cross. In the above example, the zero cross position is Z1 = 6.6. Finally, when using the above equation (7), Z1 ′ = INT (6.6) = 6. Therefore, the enlarged edge position information 57 is information indicating the position of the pixel of x = 6 and y = 7 on the left side in the adjacent block 55.
[0050]
In this way, the enlarged edge position information is information representing the pixel position in units of pixels smaller than the enlarged image block. Therefore, the accuracy of the edge position of the enlarged image is improved, and the jaggy of the edge of the enlarged image becomes inconspicuous.
When the edge position of the enlarged image is acquired, the coordinate value of the edge on the enlarged image corresponding to the edge position Z1 ′ of the enlarged image (a kind of enlarged edge position information) is stored in the buffer (S375), and this flow is finished. To do.
[0051]
When the zero cross position calculation process is performed between the target pixel and the right adjacent pixel, the process proceeds to S250 in FIG. 5 and the same process is performed between the target pixel and the lower adjacent pixel.
That is, it is determined whether the intermediate data of the target pixel and the intermediate data of the pixel (lower adjacent pixel) located below (neighboring) the target pixel are different (S250). If the signs are not different, the process proceeds to S275 without performing the zero cross position calculation process of S270. If it is determined that the signs are different, at least one of the absolute value of the intermediate data of the pixel of interest at the current position and the absolute value of the intermediate data of the lower adjacent pixel is greater than or equal to a predetermined threshold value L3 (for example, 128). It is determined whether or not (S255). If the condition is satisfied, the process proceeds to S270 to perform a zero cross position calculation process.
If the condition is not satisfied, the difference between the maximum value and the minimum value of the luminance value of 3 × 3 pixels centered on the target pixel is obtained on the pre-enlarged image on which the Gaussian blurring process has been performed (S260). It is determined whether or not the threshold value is L4 (for example, 50) or more (S265). If the condition is satisfied, the process proceeds to S270 to perform a zero cross position calculation process. On the other hand, if the condition is not satisfied, the process proceeds to S275.
[0052]
When the zero cross position calculation process is performed in S270, it is determined whether or not the processes of S220 to S270 have been performed for all pixels of the pre-enlargement image that has been subjected to the Gaussian blur process (S275). When the condition is not satisfied, the process of acquiring the enlarged edge position information is repeatedly performed through S220 to S275. If the condition is met, this flow ends. In this way, edge detection can be performed by raster scanning, and the position of the edge can be obtained with high accuracy in units smaller than the pixels of the pre-enlargement image.
[0053]
(3-2) Zero cross connection processing:
When the zero-cross detection process ends, the process proceeds to S110 in FIG. 5 to perform the zero-cross connection process.
FIG. 10 is a flowchart showing the zero-cross connection process.
First, the position of the target block is set for each 3 × 3 pixel block obtained by dividing the pixels of the enlarged image (S405). Next, it is determined whether or not there is a zero cross, that is, an edge, which is a pixel unit of the enlarged image in the target block of the enlarged image (S410). If no edge exists in the block of interest (the coordinate value of the edge on the corresponding enlarged image is not stored in the buffer), the process proceeds to S435.
[0054]
If there is an edge in the block of interest, it is determined whether or not there are a plurality of edges in the block of interest (S415). If there are a plurality of edges, an edge generation process described later is performed (S420), and the process proceeds to S425. If there is only one edge, the process immediately proceeds to S425.
In S425, it is determined whether or not a zero cross exists in any of the right adjacent block, the lower left adjacent block, the lower adjacent block, and the lower right adjacent block of the target block. In the present embodiment, when the target block is at the end of the enlarged image and the adjacent block is outside the enlarged image, the process of connecting the edges is not performed on the adjacent block on the assumption that no zero cross exists.
If a zero cross exists in these adjacent blocks, an edge generation process described later is performed (S430), and the process proceeds to S435. If a zero cross does not exist, the process immediately proceeds to S435.
[0055]
FIG. 11 is a flowchart showing the edge generation processing performed in S420 and S430.
First, it is determined whether or not the distance difference in the horizontal direction (x direction) between two pixels that are edges on the enlarged image is equal to or greater than (or greater than) the distance difference in the vertical direction (y direction) (S505). . If the condition is satisfied, the process proceeds to S510, and if the condition is not satisfied, the process proceeds to S530.
In S510, the position of the pixel in the horizontal direction on the enlarged image is set. Next, the position of the pixel in the vertical direction as the edge region of the enlarged image is acquired at the set horizontal position (S515). Further, the acquired position of the pixel (specifically, the coordinate value) is stored in the buffer as connection position information indicating the position of the pixel having the edge region (S520). Then, it is determined whether or not the next horizontal pixel position exists (S525). When the condition is satisfied, the processes of S510 to S525 are repeatedly performed while sequentially moving the pixel positions in the horizontal direction in units of pixels. If the condition is not satisfied, the process proceeds to S550.
[0056]
On the other hand, in S530, the position of the pixel in the vertical direction on the enlarged image is set. Next, the position of the pixel in the horizontal direction as the edge region of the enlarged image is acquired at the set vertical position (S535). Further, the obtained coordinate value of the pixel is stored in the buffer as connection position information (S540). Then, it is determined whether or not the next vertical pixel position exists (S545). When the condition is satisfied, the processes of S530 to S545 are repeatedly performed while sequentially moving the position of the pixel in the vertical direction in units of pixels, and when the condition is not satisfied, the process proceeds to S550.
[0057]
The left side of FIG. 12 shows a state in which connection position information is acquired when the distance difference in the horizontal direction is greater than or equal to the distance difference in the vertical direction. Here, the edge pixels 61a and 61b are pixels that are edged in pixel units of the enlarged image. Then, while sequentially moving the pixel positions in the horizontal direction in units of pixels, for example, the coordinate values of the pixels are acquired as the connection position information in the order of the connection pixels 61c, 61d, and 61e. On the other hand, the right side of the figure shows a state in which the link position information is acquired between the edge pixels 62a and 62b when the vertical distance difference is greater than or equal to the vertical distance difference. In this case, while sequentially moving the positions of the pixels in the vertical direction in units of pixels, for example, the coordinate values of the pixels are acquired as connection position information in the order of the connection pixels 62c, 62d, and 62e. In this way, it is possible to obtain a good edge with a thin line in order not to cause missing of the connected pixels.
[0058]
In S550, edge information representing the edge region of the enlarged image including the connection position information acquired by the above process is generated, and this flow ends. In this way, the edges of the enlarged images can be reliably connected with a simple configuration, and the edge region is set for each pixel unit between the edges of the adjacent enlarged images. It is possible to form the edges of the thin film with high precision.
When the edge generation process of S430 in FIG. 10 is completed, it is determined whether or not the processes of S405 to S430 for generating edge information for all the blocks of the enlarged image have been performed (S435). When the condition is not satisfied, processing for generating edge information is repeatedly performed through S405 to S435. If the condition is met, this flow ends.
[0059]
As a result of the above processing, an edge region is formed in units of pixels of the enlarged image, so that the edge of the enlarged image can be accurately formed with thin lines and processing such as sharpening can be easily performed. It becomes possible to reduce jaggy. Therefore, when an enlarged image is generated using the generated edge information, a smooth enlarged edge image with less jaggies can be obtained, and an enlarged image with less jaggies can be obtained even after enlargement.
[0060]
(3-3) Interpolation processing:
When the zero-cross connection process ends, the process proceeds to S115 in FIG. 5 to perform an interpolation process.
FIG. 13 is a flowchart showing the interpolation process.
After securing a buffer area for storing gradation data of the enlarged image after the interpolation processing in the RAM, first, the position of the block of interest is set for each 3 × 3 pixel block into which the pixels of the enlarged image are divided ( S605). Next, based on the edge information, it is determined whether or not there is a zero cross, that is, an edge region, which is the pixel unit of the enlarged image in the target block of the enlarged image (S610). If there is an edge region in the block of interest (the coordinate value of the edge on the corresponding enlarged image is not stored in the buffer), the process proceeds to S615. If there is no edge region in the block of interest, the process proceeds to S635. Proceed to
[0061]
In S615, as shown in FIG. 14, the luminance value (Gaussian blurring process) of the corresponding pixel I1u in the pre-enlargement image corresponding to the block of interest and 3 × 3 pixels (corresponding to the 3 × 3 block of the enlarged image) located in the vicinity thereof. The subsequent image data D1 ′) is binarized to generate binarized data D3 corresponding to each pixel of the pre-enlargement image. If the corresponding pixel I1u is at the end of the pre-enlargement image, the binarized data is generated assuming that the luminance value at the end pixel of the pre-enlargement image is outside the pre-enlargement image. In the present embodiment, the average value of the maximum and minimum luminance values of 3 × 3 pixels is set as a threshold value L5, and binary when the luminance value of each pixel is equal to or higher than the threshold value L5 (or higher). The binarized data is set to 1, and the binarized data is set to -1 when it is smaller (or less) than the threshold value L5.
Then, pattern matching processing is performed to determine whether or not the binarized data matches a plurality of predetermined matching patterns (S620).
[0062]
FIG. 15 schematically shows an example of a matching pattern which is a 3 × 3 filter matrix for detection. In the figure, 12 types of matching patterns for 90 degrees, 16 types of matching patterns for 30 degrees, and 8 types of matching patterns for 45 degrees are shown corresponding to the edge directions of 90 degrees, 30 degrees, and 45 degrees, respectively. Has been. In addition to these, a plurality of types of matching patterns for 60 degrees, 135 degrees, 180 degrees, and the like are also prepared. Each matching pattern is a pattern that can determine whether or not edges of various shapes exist in a 3 × 3 pixel area of the pre-enlargement image corresponding to a 3 × 3 block centered on the target block on the enlarged image. It is. Of course, the matching pattern is not limited to that shown in the figure.
Whether or not the binarized data matches the matching pattern is determined by comparing the binarized data (d1 to d9) of each 3 × 3 pixel and each element value (f1 to f9) of the matching pattern. The sum of products S1 = Σfi · di is calculated, and it is determined whether or not this sum S1 is equal to the sum of absolute values S2 = Σ | fi | of the element values of the matching pattern. If S1 = S2, the edge inclination of the pre-enlargement image matches the matching pattern, and the determination result that the edge of the shape corresponding to the matched matching pattern exists in the block of interest and its neighboring blocks The information representing is obtained.
[0063]
In the example of FIG. 14, the sum S1 of the binarized data D3 and the 90-degree matching pattern “90-1” of FIG. 15 is calculated to be −2. Since the sum S2 of absolute values of the elements in the matching pattern “90-1” is 6, the binarized data does not match (does not match) the matching pattern “90-1”. On the other hand, the sum S1 of the binarized data D3 and the 30-degree matching pattern “30-12” in FIG. Since the sum S2 of absolute values of the elements in the matching pattern “30-12” is 5, the binarized data matches (matches) the matching pattern “30-12”. In this case, the direction of the edge is 30 degrees, and information indicating the determination result of whether or not the edge exists is “30-12”.
Of course, in addition to using a matching pattern, the presence of an edge may be determined from the direction in which the difference between two pixel values (luminance value difference, RGB value difference, color value difference, etc.) becomes smaller, or is adjacent. The presence of an edge may be determined by reflecting the direction of the edge of the pixel, or the presence of an edge may be determined by reflecting the strength of the edge of a neighboring pixel. Further, although the process becomes complicated, the concept of vector may be introduced to determine the presence of an edge. Further, the presence of an edge may be determined by a combination thereof.
[0064]
In addition, in the zero cross connection process of FIG. 10, when the zero cross exists in any of the adjacent blocks on the right side, lower left, lower side, and lower right of the target block, the direction of the edge is determined based on the matching pattern. The information indicating the direction of the edge is acquired, and based on the information, the inclination of the straight line connecting the edge in the block of interest and the edge in the adjacent block matches the direction of the edge determined using the matching pattern. The edge generation processing of S430 may be performed only when it is determined whether or not they match. Then, the edges of the enlarged image can be reliably connected with a simple configuration, and the process for forming the edges of the enlarged image with fine lines with high accuracy can be performed at high speed. Also, since the matching pattern for generating edge information reliably can be used as the matching pattern for generating gradation data corresponding to each pixel of the enlarged image, the edge information is generated by generating edge information. Sharpening processing can be performed efficiently.
When it is determined in S620 that the binarized data matches the matching pattern, it is determined that the edge is surely present in the block of interest, and edge color filling processing is performed (S625), and the process proceeds to S670. On the other hand, when it is determined that they do not match, it is determined that the gradation data may be generated by the interpolation processing by the bicubic method, the bicubic processing is performed (S630), and the process proceeds to S670.
[0065]
FIG. 16 is a flowchart showing the edge color filling process. First, information representing the determination result of whether or not an edge exists is acquired from the result of the pattern matching process (S705). Next, it is determined whether or not the edge passes through two sides (S710).
For example, it is possible to determine whether or not the edge passes through two sides by a method as shown in the upper part of FIG. Assuming that the position of each pixel in the block of interest is represented by (x, y) (x = 0 to 2, y = 0 to 2), (0 to 2,0), (0,1), (2,1) , (0-2, 2), two or more of the four regions are pixels on the enlarged image that are defined as edge regions (also referred to as edge pixels), and (0, 0-2), ( When edges exist in two or more of the four areas (1,0), (1,2), and (2,0-2), it can be determined that the edge passes through two sides. Of course, various methods other than this method can be adopted.
[0066]
When it is determined that the edge passes through the two sides, the gradation value of each of the two regions divided by the edge in the target block is calculated (S715). It is assumed that the matching pattern matching the binarized data is “30-5” as a result of performing the pattern matching process in S620. Here, as shown in the middle of FIG. 17, the gradation values of the image data before the 3 × 3 pixel Gaussian blurring process centered on the corresponding pixel of the pre-enlargement image corresponding to the block of interest are represented by H1 to H9 (the upper left is H1 and the lower right are represented by H9). H1 to H9 are YCbCr gradation values when the image data is YCbCr data, and RGB gradation values when the image data is RGB data. Note that H1 to H9 may be the gradation values after the Gaussian blurring process. In a block of interest for generating gradation data (YCbCr gradation values, etc.), the gradation value of a bright (large gradation value) area is E1, and the gradation value of a dark (small gradation value) area is E2. The gradation value of the area on the bright side from the edge pixel is E1, and the gradation value of the area on the dark side from the edge pixel is E2. Since the bright area of the pre-enlargement image corresponds to the “1” portion of the matching pattern, E1 is calculated from the gradation values corresponding to the “1” portion of the matching pattern among the gradation values H1 to H9. On the other hand, since the dark region of the pre-enlargement image corresponds to the “−1” portion of the matching pattern, E2 is calculated from the gradation values corresponding to the “−1” portion of the matching pattern among the gradation values H1 to H9. To do.
[0067]
Information for calculating the gradation values E1 and E2 corresponding to each of the plurality of matching patterns is stored in advance in HD, and the gradation information E1 and E2 is calculated for each matching pattern by reading the same information. In the case of the matching pattern “30-5”, information for calculating the gradation values E1 and E2 is stored in the HD by the following formula.
E1 = (2 × H2 + H3 + H4) / 4
E2 = (2 × H5 + H6 + H7) / 4
Note that for the peripheral pixels of “1” and “−1” in the pattern matrix, the gradation values of the pixels may be included in the calculation if they are close to the calculated E1 and E2. Then, the color difference between the edge block and the non-edge block can be further reduced.
[0068]
When the gradation values E1 and E2 are obtained, the gradation value is stored for each area divided by the edge in the block of interest in the buffer for storing the gradation data of the enlarged image after the interpolation processing (S720). Exit. There are various methods for dividing each pixel in the block of interest into two regions with edges. For example, check which side of the block of interest the edge crosses and check the slope of the edge, and if the edge is standing, fill the gradation value from either side, and after the edge is found By filling with different gradation values, it is possible to easily fill the two regions in the block of interest with a simple configuration.
That is, for example, when the edge direction is determined to be 30 degrees, 45 degrees, 135 degrees, and 180 degrees by the pattern matching process, the pixel in the target block that is above the edge pixel is represented by the gradation value E1 (within the matching pattern). A region where “1” is above the “−1” portion or a gradation value E2 (when “1” is below the “−1” portion in the matching pattern); What is necessary is just to make it the area | region which makes the pixel in the attention block above an edge pixel the remaining gradation value. Further, when the edge direction is determined to be 90 degrees or 60 degrees by the pattern matching process, the pixel in the target block on the left side of the edge pixel is represented by the gradation value E1 (the portion “1” in the matching pattern is “−”). The block of interest that is the area that is the left side of the “1” portion) or the gradation value E2 (when the “1” portion is on the right side of the “−1” portion in the matching pattern) and that is on the right side of the edge pixel The inside pixel may be set as a region having the gradation value E1.
[0069]
Incidentally, it is sufficient to decide whether to advance either of tone values for edge pixels, but it is assumed that the gradation value of the lighter areas in the present embodiment. Therefore, the gradation value of the edge pixel is E1.
By repeating the processing of S705 to S720 for all blocks, when it is determined that an edge exists in the block of interest and a block located in the vicinity thereof, the pixel of the enlarged image located on the pixel side from the edge region for each pixel of the block of interest The gradation data of the enlarged image can be generated using only the image data. In addition, it is possible to reliably perform sharpening processing on edge blocks with a simple configuration in which the edge passing position is determined using a matching pattern, and the edge portion of the enlarged image can be reliably formed with fine lines. Thus, it becomes possible to obtain a magnified image with good image quality while maintaining sharpness at the edge portion. Further, it is possible to realize enlargement processing that reduces the color difference between the edge block and the non-edge block.
[0070]
If it is determined in S710 that the edge does not pass through two sides, there is no need to divide the region in the block of interest to generate gradation data, so the bicubic method for each pixel in the block of interest according to the following procedure Interpolation processing is performed according to (S725).
Referring to FIG. 3, first, the position of the target pixel N1 is set in the target block N2, and a plurality of reference pixels P11 to P44 in the predetermined region R1 in the pre-enlargement image I1 located in the vicinity of the target pixel N1. Decide.
[0071]
FIG. 18 schematically shows how the reference pixels P11 to P44 are determined. Here, the position of the corresponding pixel in the pre-enlargement image corresponding to the target block is (X, Y), the position of the target pixel N1 in the target block is (x, y), the image enlargement ratio is M, and s = M Assuming / 2 (however, the fractional part is rounded down), when M = 3, x = 0 to 2, y = 0 to 2, and s = 1, and the positions of 16 reference pixels are determined as follows: .
[0072]
x <s and y <s, that is, when the target pixel is (0,0),
(X-2, Y-2) to (X + 1, Y + 1)
x ≧ s and y <s, that is, when the target pixel is (1,0), (2,0)
(X-1, Y-2) to (X + 2, Y + 1)
x <s and y ≧ s, that is, when the target pixel is (0,1), (0,2),
(X-2, Y-1) to (X + 1, Y + 2)
x ≧ s and y ≧ s, that is, when the target pixel is (1,1), (1,2), (2,1), (2,2),
(X-1, Y-1) to (X + 2, Y + 2)
Thus, reference pixels in an appropriate area are set according to the position of the pixel in the block of interest.
[0073]
Then, the gradation values of the image data of the reference pixels P11 to P44 that have not been subjected to Gaussian blurring processing are set to P 11 ~ P 44 In other words, the gradation value E after the interpolation process can be calculated by the following equation.
[Expression 1]
Figure 0003952188
However, the distance coefficients dx and dy in the bicubic method are
When x <s and y <s, dx = (x + M−s) / M, dy = (y + Ms) / M
When x ≧ s and y <s, dx = (xs) / M, dy = (y + Ms) / M
When x <s and y ≧ s, dx = (x + Ms) / M, dy = (ys) / M
When x ≧ s and y ≧ s, dx = (xs) / M, dy = (ys) / M
It is.
Here, when the reference pixel protrudes from the edge of the pre-enlargement image, the gradation value is calculated assuming that the pixels at the edge of the pre-enlargement image are continuous outward.
Note that the gradation value E after the interpolation process may be calculated using the gradation value that has been subjected to the Gaussian blurring process.
When the interpolation processing is performed, the gradation value E calculated for each pixel in the block of interest is stored in the buffer (S730), and this flow ends.
[0074]
The bicubic process (S630) performed when it is determined in S620 of FIG. 13 that the binarized data and the matching pattern do not match is calculated by performing the interpolation process by the bicubic method as in 725 to S730 of FIG. The stored gradation value is stored in the buffer. That is, when the binarized data and the plurality of matching patterns do not match, interpolation processing is performed on the pixels of the target block by using the image data of the pixels in the predetermined area in the pre-enlarged image located in the vicinity of the enlarged block. Tone data is generated. Therefore, with respect to a block in which an edge region exists and a block located in the vicinity thereof, gradation data corresponding to each pixel of the enlarged image can be reliably generated for that block even if the presence of an edge is not detected. .
[0075]
If it is determined in S610 that there is no edge region in the target block, a 5 × 5 pixel Gaussian blurring process centering on the corresponding pixel corresponding to the target block on the pre-enlargement image is selected to select an appropriate interpolation process. The difference between the maximum value and the minimum value of the previous luminance value Y (difference in image data) is obtained (S635). As shown in FIG. 18, the 5 × 5 pixels are a plurality of pixels in the second predetermined region R2 in the pre-enlargement image located in the vicinity of the pixel of interest before interpolation processing. This is a pixel that may be used as a reference pixel when generating tone data. Note that the difference between the maximum value and the minimum value of the luminance values of 5 × 5 pixels centered on the corresponding pixel may be obtained on the pre-enlargement image on which the Gaussian blurring process has been performed.
Note that the degree of difference between the image data of the corresponding pixel and the pixel located in the vicinity thereof is the second largest value in addition to the value based on the combination of the maximum value and the minimum value such as the difference between the maximum value and the minimum value. Various values such as a value based on a combination with the second smallest value and a value obtained by combining an intermediate value with these values can be adopted.
[0076]
Then, the processing is branched according to the obtained difference, and the type of interpolation processing is switched (S640). That is, predetermined threshold values L6 and L7 (L6 <L7) are prepared, and when the obtained difference is equal to or less than L6 (or smaller), near neighbor processing is performed (S645), and the process proceeds to S670. When the difference is greater than (or greater than) L6 and less than or equal to L7 (or smaller), the selected bilinear process is performed (S650), and the process proceeds to S670. A cubic process is performed (S655), and the process proceeds to S670. Appropriate interpolation processing can be performed according to image data of pixels adjacent to the block of interest, so that the sharpness of the edge portion can be maintained and the enlarged image after the interpolation processing can be improved in image quality. . Here, the number of pixels to be referred to increases in the order of the nearest neighbor method, the bilinear method, and the bicubic method to 1, 4, and 16, so the maximum and minimum luminance values for 5 × 5 pixels in the region R2 As the difference increases, the number of pixels referring to the image data increases. Interpolation processing needs to be performed with high accuracy as the degree of brightness value increases, but the higher the degree of difference, the higher the number of pixels referenced in the interpolation processing and the higher accuracy interpolation processing is performed. As the degree decreases, the number of pixels referred to in the interpolation process decreases, and the interpolation process is performed at high speed. Therefore, it is possible to obtain an enlarged image with high image quality by efficiently performing interpolation processing with high accuracy.
Note that only one of the selected bilinear process and the selected bicubic process may be performed, or an interpolation process by a bilinear method may be performed instead of the near neighbor process.
[0077]
FIG. 19 is a flowchart showing the selected bicubic process performed in S655.
Referring to FIG. 3, first, the position (x, y) of the target pixel N1 is set in the target block N2 (S805). Similar to the setting order of the target block on the enlarged image, the setting is made in the order of (0, 0), (0, 1)... (2, 2). Next, as shown in FIG. 18, 4 × 4 reference pixels P11 to P44 in the predetermined region R1 in the pre-enlargement image I1 located in the vicinity of the target pixel N1 are determined (S810).
[0078]
Thereafter, for each of the determined plurality of reference pixels P11 to P44, the gradation value P ′ of the image data that has not been subjected to the Gaussian blur processing is sequentially acquired (S815). If the image data is YCbCr data, a gradation value is acquired for each YCbCr component. You may acquire the gradation value by which the Gaussian blurring process was performed. When the reference pixel is outside the pre-enlargement image, the grayscale value is acquired assuming that the grayscale values at the end pixels of the pre-enlargement image are continuous toward the outside of the pre-enlargement image. Whether or not the acquired gradation value P ′ is larger (or more) than the predetermined threshold value L8 from the difference from the gradation value P0 of the corresponding pixel corresponding to the target block N2, that is,
| P'-P0 |> L8
Whether or not is satisfied is determined (S820). When the gradation value of the image data of the pre-enlargement image is 256 gradations, the threshold value L8 may be set to 50, for example.
[0079]
When the gradation value difference is larger than L8 (outside the predetermined range), the gradation value P substituted for the gradation value P0 of the corresponding pixel by substituting the gradation value of the reference pixel Pij into the calculation formula (8) of the interpolation process. ij (S825), the process proceeds to S830. On the other hand, when the difference between the gradation values is L8 or less (within a predetermined range), the gradation value P for substituting the gradation value of the reference pixel Pij as it is into the above equation (8) without replacing the gradation value. ij And go to S830. Since the gradation value of the pixel having a large difference from the gradation value of the corresponding pixel is not used, in S820, whether the edge region of the image crosses over a plurality of pixels in the predetermined region located in the vicinity of the target pixel. Whether or not is determined based on the image data of the pre-enlargement image. If it is determined that the pixel has crossed, interpolation processing is performed in S825 using only the image data of the pixel located on the target pixel side from the edge region.
In S830, it is determined whether there is another reference pixel that has not been subjected to the determination process in S820. If another reference pixel exists, the processes of S815 to S830 are repeated, and if the same process is performed for all the reference pixels, the process proceeds to S835.
[0080]
In S835, the tone value P of the reference pixel on which the tone value replacement process has been performed. ij Is used to perform bicubic interpolation processing for calculating the gradation value E after the interpolation processing according to the above equation (8). When the interpolation process is performed, the calculated gradation value E is stored in the buffer (S840). In this way, a known interpolation process can be used with a simple configuration of replacing the gradation value, and the difference in gradation value from the corresponding pixel in the pre-enlargement image corresponding to the block of interest is within a predetermined range. Interpolation processing can be easily performed using only pixel image data.
Thereafter, it is determined whether or not interpolation processing has been performed for all pixels in the block of interest (S845). When the condition is not satisfied, the processes of S805 to S845 are repeatedly performed while sequentially moving the target pixel in the target block, and the interpolation process by the bicubic method is performed. If the condition is met, this flow ends.
[0081]
That is, when interpolation processing is performed with reference to image data of a plurality of pixels in a predetermined area located in the vicinity of a target pixel for generating gradation data on the image after interpolation processing, a plurality of pixels in the predetermined area Of these, interpolation processing is performed using only image data of pixels in which the difference in image data from the corresponding pixel in the image before interpolation processing corresponding to the target pixel falls within a predetermined range.
As a result of the above processing, image data of a pixel having a large difference from the image data of the corresponding pixel corresponding to the target block is not used in the interpolation process. Therefore, as shown in FIG. Thus, interpolation processing using only the image data of the pixel on the target pixel side is performed. That is, since the edge portion is not smoothed, it is possible to improve the image quality while maintaining the sharpness of the edge portion even after the interpolation processing. Further, even if the edge block is subjected to sharpening or the like, there is no color difference between the edge block and the non-edge block, and the image quality can be improved in this respect.
[0082]
The same can be said for the interpolation processing by the bilinear method.
FIG. 20 is a flowchart showing the selected bicubic process performed in S650.
As shown in FIG. 21, first, the position (x, y) of the target pixel N1 is set in the target block N2 (S905). Next, 2 × 2 reference pixels A to D in the predetermined region R3 in the pre-enlargement image located in the vicinity of the target pixel N1 are determined (S910). Here, the position of the corresponding pixel in the pre-enlargement image corresponding to the target block N2 is (X, Y), the position of the target pixel N1 in the target block is (x, y), the magnification rate of the image is M, s = If M / 2 (however, the fractional part is rounded down), when M = 3, x = 0-2, y = 0-2, s = 1, and the positions of the four reference pixels are determined as follows: The
[0083]
x <s and y <s, that is, when the target pixel is (0,0),
(X-1, Y-1) to (X, Y)
x ≧ s and y <s, that is, when the target pixel is (1,0), (2,0)
(X, Y-1) to (X + 1, Y)
x <s and y ≧ s, that is, when the target pixel is (0,1), (0,2),
(X-1, Y) to (X, Y + 1)
x ≧ s and y ≧ s, that is, when the target pixel is (1,1), (1,2), (2,1), (2,2),
(X, Y) to (X + 1, Y + 1)
As described above, even when the interpolation processing by the bilinear method is performed, a reference pixel in an appropriate region according to the position of the pixel in the block of interest is set.
[0084]
When the gradation values of the image data of the reference pixels A, B, C, and D that have not been subjected to the Gaussian blur processing are represented by a, b, c, and d, respectively, the gradation value E after the interpolation processing is as follows: It can be calculated by the following formula.
[Expression 2]
Figure 0003952188
However, the distance coefficients di and dj in the bilinear method are
When x <s and y <s, di = (x-s + M), dj = (y-s + M)
When x ≧ s and y <s, di = (xs), dj = (y + Ms)
When x <s and y ≧ s, di = (x + Ms), dj = (ys)
When x ≧ s and y ≧ s, di = (xs), dj = (ys)
It is.
Here, when the reference pixel protrudes from the end of the pre-enlargement image, the grayscale value is calculated assuming that the tone value at the end pixel of the pre-enlargement image is outside (folded).
[0085]
Thereafter, for each of the determined plurality of reference pixels A to D, the gradation value of the image data that has not been subjected to the Gaussian blur processing is sequentially acquired (S915). Then, it is determined whether or not the difference between the acquired gradation value and the gradation value P0 of the corresponding pixel corresponding to the target block N2 is greater than (or greater than) the predetermined threshold value L9 (S920). ). When the gradation value of the image data of the pre-enlargement image is 256 gradations, the threshold value L9 may be set to 50, for example. In this embodiment, L8 = L9, but L8 and L9 may be different values.
When the gradation value difference is larger than L9, the gradation values of the reference pixels A to D are replaced with the gradation value P0 of the corresponding pixel, and the gradation values a to d are substituted into the arithmetic expression (9) of the interpolation process. (S925), the process proceeds to S930. On the other hand, when the difference between the gradation values is equal to or less than L9, the gradation values of the reference pixels A to D are substituted as they are into the above equation (9) without replacing the gradation values, and S930 is obtained. Proceed to
In S930, it is determined whether there is another reference pixel that has not been subjected to the determination process in S920. If another reference pixel exists, the processes of S915 to S930 are repeated, and if the same process is performed for all the reference pixels, the process proceeds to S935.
[0086]
In S935, bilinear interpolation processing is performed to calculate the gradation value E after the interpolation processing according to the above equation (9) using the gradation values a to d of the reference pixels subjected to the gradation value replacement processing. When the interpolation process is performed, the calculated gradation value E is stored in the buffer (S940). Thereafter, it is determined whether or not interpolation processing has been performed for all the pixels in the block of interest (S945). When the condition is not satisfied, the processes of S905 to S945 are repeatedly performed while sequentially moving the target pixel in the target block, and the interpolation process by the bilinear method is performed. If the condition is met, this flow ends.
[0087]
In the near neighbor process performed in S645 of FIG. 13, the gradation value calculated by performing the interpolation process by the near list neighbor method that refers only to the image data of the pixel on the unenlarged image at the shortest distance from the target pixel. Is stored in the buffer.
In S670, it is determined whether gradation data corresponding to each pixel of the enlarged image has been generated for all blocks of the enlarged image. When the condition is not satisfied, the process of generating gradation data corresponding to each pixel of the enlarged image is repeatedly performed through S605 to S655 while sequentially moving the target block on the enlarged image. If the condition is met, this flow ends.
[0088]
For example, a case where the pre-enlargement image having the luminance value Y as shown in the upper part of FIG. For the sake of clarity, only the luminance value Y is used here as the image data D1 of the pre-enlargement image. However, the present invention can also be applied to YCbCr component values, RGB gradation values, and the like.
First, zero cross detection processing and zero cross connection processing are performed on the pre-enlarged image to generate edge information. As a result, each pixel in the block of the enlarged image corresponding to the pixels (4,0), (3,1), (2.2), (1,2), (1,3), (0,4) Assume that edge information representing an edge region is generated.
[0089]
When the position of the block of interest is (0, 0), there is no edge region, so the degree of brightness value difference is obtained in S635 in FIG. The luminance value Y of 5 × 5 pixels centering on the corresponding pixel (0,0) corresponding to the block of interest is a value shown in the middle part of FIG. In addition, about the part which becomes the outer side of the image before expansion, the luminance value of an edge part shall be continuing toward the outer side of the image before expansion. Here, since the maximum value of the luminance value of 5 × 5 pixels is 224 and the minimum value is 96, the difference between the maximum value and the minimum value is 128, which is larger than the threshold value L7 (100). Therefore, the selected bicubic process is performed at 655 in FIG.
In general bicubic interpolation, the value of the pixel of interest in the pre-enlargement image comes to the upper left pixel of the block. However, in order to maintain consistency with the result of edge detection, the present image interpolation apparatus, as shown in FIG. 18, interpolated pixels in the block so that the value of the target pixel of the pre-enlargement image comes to the center of the block. Interpolation calculation is performed by changing the pixel to be referred to according to the position of. This is in balance with the edge detection method and may not be necessary.
[0090]
When the lower right pixel in the block of interest is interpolated, this pixel position (x, y) is (2, 2) in the block. Since both x and y are more than half of the enlargement ratio M, 16 points (-1, -1) to (2,2) are used as reference points when performing the calculation by the bicubic method. Here, the portion that protrudes from the end of the pre-enlargement image is calculated assuming that the pixels at the end are continuous. That is, the reference pixel is at the position shown in the lower part of FIG.
In this case, since the luminance value (image data value) of the pixel (2, 2) of the pre-enlargement image is 96, the luminance value 203 of the corresponding pixel corresponding to the target pixel (same as the corresponding pixel corresponding to the target block). Is 107, which is larger than the threshold value L8 (50). That is, since the luminance value of the pixel (2, 2) is outside the predetermined range, the luminance value of the pixel (2, 2) is replaced with the luminance value 203 of the pixel (0, 0), and the luminance values of the other pixels are predetermined. Since it is within the range, it is left as it is.
The distance coefficients are dx = (2-1) /3=0.333 and dy = (2-1) /3=0.333. Using these values, the gradation value E after the interpolation processing is calculated by the above equation (8).
Such an interpolation process is repeated for all the pixels in the block of interest.
[0091]
In conventional interpolation processing by bicubic method or bilinear method, color pixel interpolation is performed across the edge region, so sharpening processing is performed on the edge part, and if interpolation processing is performed in the vicinity of the edge part, the edge There was a color difference between the block and the block around it. According to the present invention, since the image data of the reference pixel beyond the edge region is not used, the occurrence of a color difference between the edge block and the non-edge block can be reduced. In addition, since it is not necessary to prepare a predetermined pattern for each enlargement ratio in order to generate gradation data after interpolation processing, image enlargement processing at an arbitrary magnification can be easily performed.
This image interpolation device is used in various situations, such as when enlarging a two-dimensional digital image, performing image enlarging processing during printer printing, or enlarging a low-resolution image taken with a small portable device. Therefore, an appropriate color interpolation process can be performed with a small amount of calculation.
[0092]
(4) Modification:
The image interpolation device of the present invention can have various configurations.
For example, the printer may be integrated with a computer. The flow described above may be partially or entirely executed by a printer or a dedicated image output device in addition to being executed in the computer main body.
A large number of pixels constituting the image data can have various configurations other than a dot matrix that is regularly arranged vertically and horizontally. For example, the image data may be composed of dot-matrix pixels arranged regularly in a honeycomb shape in which regular hexagons are closely arranged.
As described above, according to the present invention, the image data of the pixel having a large difference from the image data of the corresponding pixel corresponding to the target pixel is not used in the interpolation process. The image data of the pixel in the region beyond the edge region in the region within the predetermined region is not used, and the edge portion is not smoothed. Therefore, it is possible to provide an image interpolation apparatus and an image interpolation program capable of improving the image quality while maintaining the sharpness of the edge portion even after the interpolation process. It can also be applied as an image interpolation method.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating an outline of a hardware configuration of a printing system.
FIG. 2 is a block diagram illustrating an outline of a hardware configuration of a printer.
FIG. 3 is a diagram schematically showing an outline of a configuration of an image interpolation apparatus.
FIG. 4 is a diagram schematically showing a state of interpolation processing.
FIG. 5 is a flowchart showing processing performed by the image interpolation apparatus.
FIG. 6 is a flowchart showing a zero-cross detection process.
FIG. 7 is a flowchart showing filter calculation processing.
FIG. 8 is a flowchart showing a zero-cross position calculation process.
FIG. 9 is a diagram schematically showing how to acquire enlarged edge position information.
FIG. 10 is a flowchart showing zero cross connection processing;
FIG. 11 is a flowchart showing edge generation processing;
FIG. 12 is a diagram schematically showing how to obtain connection position information.
FIG. 13 is a flowchart showing an interpolation process.
FIG. 14 is a diagram schematically illustrating a state in which binarized data is generated and pattern matching processing is performed.
FIG. 15 is a diagram schematically illustrating an example of a matching pattern.
FIG. 16 is a flowchart showing edge color filling processing;
FIG. 17 is a diagram schematically illustrating a state in which edge color filling processing is performed.
FIG. 18 is a diagram schematically illustrating how a reference pixel is determined by selection bicubic processing.
FIG. 19 is a flowchart showing selected bicubic processing.
FIG. 20 is a flowchart showing selection bilinear processing.
FIG. 21 is a diagram schematically showing how a reference pixel is determined by selective bilinear processing.
FIG. 22 is a diagram schematically illustrating a state in which a reference pixel is set by selecting an interpolation process.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10 ... Personal computer (PC), 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... Hard disk (HD), 15 ... CD-ROM drive, 16 ... Flexible disk (FD) drive, 17a-e ... Interface (I / F), 18a ... display, 18b ... keyboard, 18c ... mouse, 20 ... inkjet printer, 30 ... digital camera, 51 ... pixel of interest, 52 ... adjacent pixel, 53, 56 ... zero cross, 54 ... block of interest, 55 ... adjacent Block 57: Expanded edge position information 61a, b, 62a, b Edge pixel 61c to e 62c connected pixel 100 Printing system D1 Image data D2 Edge information D3 Binary Data, I1 ... pre-enlarged image, I1u ... pixel, I2 ... enlarged image, I2d ... block Pixel classification), I2u ... pixel, N1 ... target pixel, N1u ... corresponding pixel, N2 ... target block, R1, R3 ... predetermined region, R2 ... second predetermined region, U0 ... image interpolating device, U1 ... edge generating means, U2: Interpolation means

Claims (10)

画像をドットマトリクス状の画素で階調表現する画像データから補間処理を行って補間処理後の画像の各画素に対応した階調データを生成する画像補間装置であって、
上記補間処理後の画像上で上記階調データを生成する注目画素の近隣に位置する補間処理前の画像における所定領域内の複数の画素の画像データを参照して上記補間処理を行う際、同所定領域内の複数の画素のうち同注目画素に対応する補間処理前の画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて上記補間処理を行うことを特徴とする画像補間装置。
An image interpolating apparatus that generates gradation data corresponding to each pixel of an image after interpolation processing by performing interpolation processing from image data that represents the gradation of an image with a dot matrix pixel,
When performing the interpolation process with reference to the image data of a plurality of pixels in a predetermined region in the image before the interpolation process located in the vicinity of the target pixel for generating the gradation data on the image after the interpolation process, The interpolation process is performed using only the image data of a pixel in which a difference in image data from a pixel in an image before the interpolation process corresponding to the target pixel among a plurality of pixels in the predetermined area falls within a predetermined range. An image interpolation device.
拡大前画像をドットマトリクス状の画素で階調表現する画像データから補間処理を行って同拡大前画像を拡大した拡大画像の各画素に対応した階調データを生成する画像補間装置であって、
上記拡大画像上で注目画素を順次移動させながら同注目画素の近隣に位置する上記拡大前画像における所定領域内の複数の画素の画像データを参照して上記補間処理を行う際、同所定領域内の複数の画素のうち同注目画素に対応する拡大前画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて上記補間処理を行うことを特徴とする画像補間装置。
An image interpolating apparatus that generates gradation data corresponding to each pixel of an enlarged image obtained by performing interpolation processing from image data expressing gradation of an image before enlargement with pixels in a dot matrix shape,
When performing the interpolation process with reference to image data of a plurality of pixels in a predetermined area in the pre-enlarged image located in the vicinity of the target pixel while sequentially moving the target pixel on the enlarged image, An image interpolating apparatus that performs the above-described interpolation processing using only image data of a pixel in which a difference in image data with a pixel in an unenlarged image corresponding to the pixel of interest is within a predetermined range among the plurality of pixels .
拡大前画像をドットマトリクス状の画素で階調表現する画像データから補間処理を行って同拡大前画像を拡大した拡大画像の各画素に対応した階調データを生成する画像補間装置であって、
上記拡大前画像の画素に対応して上記拡大画像の画素を区分した画素区分毎に同拡大画像上で注目画素区分を順次移動させながら同注目画素区分内の各画素について近隣に位置する上記拡大前画像における所定領域内の複数の画素の画像データを参照して上記補間処理を行う際、同所定領域内の複数の画素のうち同注目画素区分に対応する拡大前画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて上記補間処理を行うことを特徴とする画像補間装置。
An image interpolating apparatus that generates gradation data corresponding to each pixel of an enlarged image obtained by performing interpolation processing from image data expressing gradation of an image before enlargement with pixels in a dot matrix shape,
The enlargement located in the vicinity of each pixel in the target pixel section while sequentially moving the target pixel section on the enlarged image for each pixel section obtained by dividing the pixel of the enlarged image corresponding to the pixel of the pre-enlargement image When performing the above interpolation processing with reference to image data of a plurality of pixels in a predetermined area in the previous image, image data with pixels in the pre-enlargement image corresponding to the same pixel of interest among the plurality of pixels in the predetermined area An image interpolating apparatus that performs the above-described interpolation processing using only image data of pixels whose difference is within a predetermined range.
上記注目画素区分に対応する拡大前画像における画素との画像データの差異が所定範囲外となる画素の画像データを、同注目画素区分に対応する拡大前画像における画素の画像データに置き換えて上記補間処理を行うことを特徴とする請求項3に記載の画像補間装置。  The above-described interpolation is performed by replacing the image data of the pixel whose image data difference with the pixel in the pre-enlargement image corresponding to the pixel-of-interest segment is outside a predetermined range with the image data of the pixel in the pre-enlargement image corresponding to the pixel-of-interest segment. 4. The image interpolating apparatus according to claim 3, wherein processing is performed. 上記画像データに基づいて上記拡大画像の画素単位で当該拡大画像の各画素の位置に対応させて上記拡大画像のエッジの領域を表すエッジ情報を生成するエッジ生成手段を備え、当該エッジ情報に基づいて上記注目画素区分にエッジの領域が存在するか否かを判断し、エッジの領域が存在すると判断したときには同注目画素区分の各画素について同エッジの領域から当該画素側にある上記拡大画像の画素の画像データのみを用いて上記階調データを生成することを特徴とする請求項3または請求項4に記載の画像補間装置。  Edge generation means for generating edge information representing an edge area of the enlarged image corresponding to the position of each pixel of the enlarged image in pixel units of the enlarged image based on the image data, and based on the edge information Whether or not there is an edge region in the target pixel section, and when it is determined that an edge region exists, for each pixel in the target pixel section, the enlarged image on the pixel side from the edge region is determined. 5. The image interpolating apparatus according to claim 3, wherein the gradation data is generated using only pixel image data. 上記注目画素区分に対応する拡大前画像における画素およびその近隣に位置する画素の画像データを2値化して2値化データを生成し、当該2値化データと、エッジの存在を判定可能とする所定の複数のマッチングパターンと、に基づいて同注目画素区分およびその近隣に位置する画素区分にエッジが存在するか否かを判定し、エッジが存在すると判定したときに同注目画素区分の各画素について上記エッジの領域から当該画素側にある上記拡大画像の画素の画像データのみを用いて上記階調データを生成することを特徴とする請求項3〜請求項5のいずれか一項に記載の画像補間装置。  The binarized data is generated by binarizing the image data of the pixel in the pre-enlargement image corresponding to the target pixel classification and the pixel located in the vicinity thereof, and the binarized data and the presence of the edge can be determined. Based on a plurality of predetermined matching patterns, it is determined whether or not an edge exists in the pixel segment of interest and a pixel segment located in the vicinity thereof, and each pixel of the pixel segment of interest when it is determined that an edge exists The gradation data is generated using only the image data of the pixel of the enlarged image located on the pixel side from the edge region. Image interpolation device. 上記注目画素の近隣に位置する補間処理前の画像における第二の所定領域内の複数の画素についての画像データの異なり度合に応じて上記補間処理の種類を切り換えることを特徴とする請求項1〜請求項6のいずれか一項に記載の画像補間装置。  The type of interpolation processing is switched according to the degree of difference in image data for a plurality of pixels in a second predetermined region in an image before interpolation processing located in the vicinity of the target pixel. The image interpolation apparatus according to claim 6. 上記第二の所定領域内の複数の画素についての画像データの異なり度合が大きくなるほど、上記画像データを参照する画素の数を増やすことを特徴とする請求項7に記載の画像補間装置。  The image interpolation apparatus according to claim 7, wherein the number of pixels that refer to the image data is increased as the degree of difference in image data for a plurality of pixels in the second predetermined area increases. 画像をドットマトリクス状の画素で階調表現する画像データから補間処理を行って補間処理後の画像の各画素に対応した階調データを生成する画像補間方法であって、
上記補間処理後の画像上で上記階調データを生成する注目画素の近隣に位置する補間処理前の画像における所定領域内の複数の画素の画像データを参照して上記補間処理を行う際、同所定領域内の複数の画素のうち同注目画素に対応する補間処理前の画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて上記補間処理を行うことを特徴とする画像補間方法。
An image interpolation method for generating gradation data corresponding to each pixel of an image after interpolation processing by performing interpolation processing from image data in which an image is expressed in gradation by a dot matrix pixel,
When performing the interpolation process with reference to the image data of a plurality of pixels in a predetermined region in the image before the interpolation process located in the vicinity of the target pixel for generating the gradation data on the image after the interpolation process, The interpolation process is performed using only the image data of a pixel in which a difference in image data from a pixel in an image before the interpolation process corresponding to the target pixel among a plurality of pixels in the predetermined area falls within a predetermined range. Image interpolation method.
画像をドットマトリクス状の画素で階調表現する画像データから補間処理を行って補間処理後の画像の各画素に対応した階調データを生成する機能をコンピュータに実現させる画像補間プログラムであって、
上記補間処理後の画像上で上記階調データを生成する注目画素の近隣に位置する補間処理前の画像における所定領域内の複数の画素の画像データを参照して上記補間処理を行う際、同所定領域内の複数の画素のうち同注目画素に対応する補間処理前の画像における画素との画像データの差異が所定範囲内となる画素の画像データのみを用いて上記補間処理を行う機能を実現させることを特徴とする画像補間プログラム。
An image interpolation program for causing a computer to perform a function of generating gradation data corresponding to each pixel of an image after interpolation processing by performing interpolation processing from image data representing gradation of an image with a dot matrix pixel,
When performing the interpolation process with reference to image data of a plurality of pixels in a predetermined region in an image before the interpolation process located in the vicinity of the target pixel for generating the gradation data on the image after the interpolation process, Implements the function to perform the above interpolation process using only the image data of the pixel whose image data difference with the pixel in the image before the interpolation process corresponding to the pixel of interest in the predetermined area is within the predetermined range. An image interpolation program characterized in that
JP2003002192A 2003-01-08 2003-01-08 Image interpolation apparatus, image interpolation method, and image interpolation program Expired - Fee Related JP3952188B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003002192A JP3952188B2 (en) 2003-01-08 2003-01-08 Image interpolation apparatus, image interpolation method, and image interpolation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003002192A JP3952188B2 (en) 2003-01-08 2003-01-08 Image interpolation apparatus, image interpolation method, and image interpolation program

Publications (2)

Publication Number Publication Date
JP2004215163A JP2004215163A (en) 2004-07-29
JP3952188B2 true JP3952188B2 (en) 2007-08-01

Family

ID=32820009

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003002192A Expired - Fee Related JP3952188B2 (en) 2003-01-08 2003-01-08 Image interpolation apparatus, image interpolation method, and image interpolation program

Country Status (1)

Country Link
JP (1) JP3952188B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7970198B2 (en) * 2006-09-13 2011-06-28 Asml Masktools B.V. Method for performing pattern decomposition based on feature pitch
US8717502B2 (en) 2007-03-19 2014-05-06 Sony Computer Entertainment Inc. Methods and apparatuses for upscaling video
JP2008276302A (en) * 2007-04-25 2008-11-13 Toshiba Corp Information processing apparatus, image processing method and image processing program
JP5176067B1 (en) * 2011-12-20 2013-04-03 株式会社アクセル Image processing apparatus and image processing method
US9536461B2 (en) 2014-07-01 2017-01-03 Sony Interactive Entertainment Inc. Method and system for use in uprendering multimedia content
CN106651991B (en) * 2016-09-12 2023-10-31 广州久邦世纪科技有限公司 Intelligent mapping realization method and system thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5446804A (en) * 1994-04-14 1995-08-29 Hewlett-Packard Company Magnifying digital image using edge mapping
JPH1169144A (en) * 1997-08-12 1999-03-09 Sony Corp Image signal converter and image signal conversion method
JP2000134477A (en) * 1998-10-26 2000-05-12 Canon Inc Image processor, controller for printer control, host computer, and control method for image processor
AUPP779898A0 (en) * 1998-12-18 1999-01-21 Canon Kabushiki Kaisha A method of kernel selection for image interpolation
JP2000253238A (en) * 1999-03-01 2000-09-14 Mitsubishi Electric Corp Picture processor and picture processing method
AUPQ377599A0 (en) * 1999-10-29 1999-11-25 Canon Kabushiki Kaisha Colour clamping

Also Published As

Publication number Publication date
JP2004215163A (en) 2004-07-29

Similar Documents

Publication Publication Date Title
JP4568460B2 (en) Image processing apparatus and recording medium
JP5274495B2 (en) How to change the document image size
JP4407801B2 (en) Edge generation apparatus, edge generation method, and edge generation program
JP4568459B2 (en) Image processing apparatus and recording medium
US8270663B2 (en) Watermarked information embedding apparatus
US8456711B2 (en) SUSAN-based corner sharpening
JP7071564B2 (en) Image processing system, image processing method, and image processing device
JP6781406B2 (en) Image processing equipment and computer programs
JP5049922B2 (en) Image processing apparatus and image processing method
JP3952188B2 (en) Image interpolation apparatus, image interpolation method, and image interpolation program
JPH07322057A (en) Increase of resolution of binary input picture and its increasing device together with improvement of appearance ofbinary input picture
RU2534005C2 (en) Method and system for converting screenshot into metafile
JP2015115957A (en) Binary periodic to multibit aperiodic halftone and resolution conversion
JP3997415B2 (en) Edge generation apparatus, edge generation method, and edge generation program
JP4050382B2 (en) Multi-value image smoothing apparatus and image forming apparatus
JP2006237858A (en) Image processing apparatus, image processing method, program for allowing computer to execute the method, and recording medium
US9363414B2 (en) Halftone mechanism
US20060119897A1 (en) Output apparatus and program thereof
JP3673675B2 (en) Image processing method, image processing apparatus, and recording medium
JP3888090B2 (en) Image processing apparatus and image processing method
JP6612167B2 (en) Rasterization processing apparatus, rasterization processing method, and program
JP5878167B2 (en) How to restore raster image edges
JP6648451B2 (en) Low overhead near unit scaling technology
JP2009301583A (en) Image processor, image processing method and image processing program
JP4517288B2 (en) Image processing apparatus, image processing method, and program thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050121

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060901

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060920

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061116

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070417

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110511

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120511

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120511

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130511

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20140511

Year of fee payment: 7

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees