JP2004207923A - Edge generating apparatus, edge generating method, and edge generating program - Google Patents

Edge generating apparatus, edge generating method, and edge generating program Download PDF

Info

Publication number
JP2004207923A
JP2004207923A JP2002373384A JP2002373384A JP2004207923A JP 2004207923 A JP2004207923 A JP 2004207923A JP 2002373384 A JP2002373384 A JP 2002373384A JP 2002373384 A JP2002373384 A JP 2002373384A JP 2004207923 A JP2004207923 A JP 2004207923A
Authority
JP
Japan
Prior art keywords
edge
pixel
image
enlargement
enlarged
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.)
Granted
Application number
JP2002373384A
Other languages
Japanese (ja)
Other versions
JP3997415B2 (en
Inventor
Tatsuya Hosoda
達矢 細田
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 JP2002373384A priority Critical patent/JP3997415B2/en
Publication of JP2004207923A publication Critical patent/JP2004207923A/en
Application granted granted Critical
Publication of JP3997415B2 publication Critical patent/JP3997415B2/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 transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/403Edge-driven scaling

Abstract

<P>PROBLEM TO BE SOLVED: To solve the defects in prior arts that accuracy of the edge position of a magnified image is not excellent with conspicuous jaggy edges. <P>SOLUTION: The edge generating apparatus or the like is configured such that edge position information representing an edge position corresponding to a position of each pixel of an image before magnification in finer units than that of pixels of the image before magnification is acquired on the basis of image data for applying gradation expression to the image before magnification in dot matrix shaped pixels, and edge information representing a region of edges of the magnified image is generated, the edge information corresponding to the position of each pixel of the magnified image in units of the pixels of the magnified image on the basis of the edge position information. The edges of the magnified image are formed in thin lines with high accuracy, the processing such as sharpening is easily performed and the jaggy edges can be reduced. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、拡大前画像を拡大した拡大画像のエッジの領域を表すエッジ情報を生成するエッジ生成装置、エッジ生成方法およびエッジ生成プログラムに関する。
【0002】
【従来の技術】
従来、拡大前の画像(以下、拡大前画像とも記載)から拡大した拡大画像を生成する際、拡大前画像の画素単位でエッジの位置を検出し、当該エッジの位置を拡大画像の画素に対応させて拡大画像のエッジの領域を形成している。
また、拡大前画像の各画素の画像データと所定の複数のマッチングパターンとを比較する演算を行い、一致したマッチングパターンに応じた形状のエッジ領域を拡大画像に形成することも行われている(例えば、特許文献1参照)。
さらに、拡大前画像を表現する画像データに対して補間処理を行うことにより非エッジ部用の拡大画像を作成するとともに、同拡大前画像を表現する画像データに対して離散コサイン変換等の直交変換とその逆直交変換を行うことによりエッジ部用の拡大画像を作成し、両拡大画像に基づいて拡大画像のエッジ位置を検出し、拡大画像のエッジの領域を形成することも行われている(例えば、特許文献2参照)。
【0003】
【特許文献1】
特開2002−63573号公報(段落0011−0094、第1−18図)
【特許文献2】
特開2000−99713号公報(段落0019−0054、第1−27図)
【0004】
【発明が解決しようとする課題】
上述した従来の技術においては、次のような課題があった。
拡大前画像の画素単位でエッジの位置を検出する場合、拡大画像のエッジ位置の精度がよくなく、拡大画像のエッジにいわゆるジャギーと呼ばれるギザギザ状の模様が目立っていた。
特許文献1に開示された技術では、拡大画像にエッジの領域を局所的に形成するため、巨視的に見た場合にエッジのジャギーが目立っていた。
特許文献2に開示された技術では、拡大前画像全体の画像データに対して直交変換のような数学的手法を用いることにより、拡大画像のエッジのジャギーは比較的目立たなくすることはできるものの、エッジの鮮鋭化等の処理をするのが困難であった。また、拡大前画像を拡大した後に拡大画像のエッジ位置を検出するためエッジ位置の精度がよくなく、さらに、エッジ部用の拡大画像を別途格納するための記憶領域を多く確保することが必要であった。
【0005】
本発明は、上記課題にかんがみてなされたもので、拡大画像のエッジを精度よく細線で形成して鮮鋭化等の処理を容易に行うことが可能であるとともに、エッジのジャギーを少なくさせることが可能なエッジ生成装置、エッジ生成方法およびエッジ生成プログラムの提供を目的とする。
【0006】
【課題を解決するための手段および発明の効果】
上記目的を達成するため、請求項1にかかる発明では、位置取得手段は、拡大前画像をドットマトリクス状の画素で階調表現する画像データに基づいて、同拡大前画像の画素よりも細かい単位で当該拡大前画像の各画素の位置に対応させたエッジの位置を表すエッジ位置情報を取得する。すると、エッジ生成手段は、位置取得手段にて取得されたエッジ位置情報に基づいて、拡大前画像を拡大した拡大画像の画素単位で当該拡大画像の各画素の位置に対応させて拡大画像のエッジの領域を表すエッジ情報を生成する。
すなわち、拡大前画像を拡大した拡大画像の画素単位でエッジの領域が形成されるので、拡大画像のエッジを精度よく細線で形成して鮮鋭化等の処理を容易に行うことが可能であるとともに、エッジのジャギーを少なくさせることが可能となる。その際、エッジ位置を表す情報を取得するためにエッジ検出用の拡大画像を生成する必要がないので、少ない容量の記憶領域で拡大画像のエッジの領域を表す情報を生成することができる。
【0007】
ここで、上記画像データは、例えば、ビットマップデータ、圧縮されたデータ、等、様々なデータ形式の情報が考えられる。また、同画像データは、例えば、輝度データ(Y)と色差データ(Cb,Cr)とから構成されるYCbCrデータ、レッドデータ(R)とグリーンデータ(G)とブルーデータ(B)とから構成されるRGBデータ、シアンデータ(C)とマゼンタデータ(M)とイエローデータ(Ye)とグリーンデータ(G)とから構成されるCMYeGデータ、CIE規格とされたLab空間内のLabデータ、等、様々な種類のデータが考えられる。
【0008】
上記位置取得手段は、上記拡大前画像の明るさが表された上記画像データに基づいて上記エッジ位置情報を取得してもよい。すると、より確実にエッジの位置を表す情報を精度よく取得することができ、精度よく拡大画像のエッジの領域を表す情報を生成することができる。なお、明るさが表された画像データは、輝度データ、明度データ、RGB各データの平均、等、様々な種類のデータが考えられる。
【0009】
上記エッジ生成手段は、上記エッジ位置情報に基づいて上記拡大前画像のエッジの位置に対応する上記拡大画像のエッジの位置を表す拡大エッジ位置情報を同拡大画像の画素単位で取得する拡大位置取得手段と、同拡大エッジ位置情報に基づいて近隣する同拡大画像のエッジどうしを連結して上記拡大画像のエッジの領域を表すエッジ情報を生成する連結手段とを備える構成としてもよい。すると、拡大前画像のエッジに対応する拡大画像のエッジどうしが連結されるので、より確実に、拡大画像のエッジを精度よく細線で形成することが可能となる。
【0010】
上記位置取得手段は、上記拡大前画像上で注目画素を順次移動させながら、同注目画素とその近隣に位置する画素との画像データの差分を演算し、演算結果に基づいて同注目画素の近隣に存在するエッジの位置が表された上記エッジ位置情報を取得する構成としてもよい。画像データの差分を演算するという簡易な構成で、エッジの位置を表す情報を取得することができる。
その際、エッジの強度を反映させてエッジ位置情報を取得してもよい。
【0011】
上記位置取得手段は、上記拡大前画像上で注目画素とその周囲の画素の画像データに対してラプラシアンフィルタを用いた演算を行って同拡大前画像の各画素に対応して階調表現された中間データを生成し、当該中間データに対応するドットマトリクス状の画素上で注目画素を順次移動させながら、注目画素およびその近隣に位置する画素の位置および中間データに基づいて同中間データを略0にする位置が表された上記エッジ位置情報を取得する構成としてもよい。公知のラプラシアンフィルタを用いてエッジの位置を検出することにより、簡易な構成で精度よくエッジの位置を表す情報を取得することができ、精度よく拡大画像のエッジの領域を表す情報を生成することができる。
【0012】
なお、周囲の画素は、注目画素に隣接していてもよいし、隣接していなくてもよい。
ラプラシアンフィルタは、8方向ラプラシアンフィルタ、4方向ラプラシアンフィルタ、等、を採用することができる。
むろん、ラプラシアンフィルタを用いる以外にも、一次空間微分フィルタ、非線形差分フィルタ、等、を用いてエッジの位置を検出してもよい。
【0013】
上記位置取得手段は、上記中間データに対応するドットマトリクス状の画素上の注目画素とその近隣に位置する画素との中間データの符号が異なるときに、上記注目画素およびその近隣に位置する画素の位置および中間データに基づいて同中間データを略0にする位置が表された上記エッジ位置情報を取得してもよい。エッジが存在するのは主に中間データの符号が異なるときであるので、さらに精度よくエッジの位置を表す情報を取得することができ、精度よく拡大画像のエッジの領域を表す情報を生成することができる。
【0014】
この場合、上記位置取得手段は、上記中間データの絶対値の少なくとも一つが所定の閾値以上またはより大のときに、上記注目画素およびその近隣に位置する画素の位置および中間データに基づいて同中間データを略0にする位置が表された上記エッジ位置情報を取得してもよい。エッジが存在するのは主に両画素間の画像データの値の差が大きいときであるので、さらに精度よくエッジの位置を表す情報を取得することができ、精度よく拡大画像のエッジの領域を表す情報を生成することができる。
【0015】
また、上記位置取得手段は、上記中間データに対応するドットマトリクス状の画素上の注目画素とその近隣に位置する画素との中間データの符号が異なるとともに当該中間データの絶対値がいずれも所定の閾値以下またはより小であり、かつ、同注目画素とその周囲の画素との画像データの異なり度合が所定の閾値以上またはより大であるときに、同注目画素およびその近隣に位置する画素の位置および中間データに基づいて同中間データを略0にする位置が表された上記エッジ位置情報を取得する構成としてもよい。注目画素とその近隣に位置する画素との画像データの値の差が小さくても、注目画素およびその周囲に位置する画素内では画像データの値の差が大きいことがある。従って、さらに精度よくエッジの位置を表す情報を取得することができ、精度よく拡大画像のエッジの領域を表す情報を生成することができる。
【0016】
上記連結手段は、上記拡大前画像上で注目画素を順次移動させながら、同注目画素およびその近隣に位置する画素の画像データを2値化して2値化データを生成し、当該2値化データと、エッジの向きに対応した所定の複数のマッチングパターンと、に基づいてエッジの向きを決定し、上記近隣する拡大画像のエッジどうしを同決定したエッジの向きとなるように連結して上記エッジ情報を生成する構成としてもよい。簡易な構成で確実に拡大画像のエッジどうしを連結することができ、高速な処理にて確実に拡大画像のエッジを精度よく細線で形成することが可能となる。
【0017】
上記連結手段は、上記近隣する拡大画像のエッジどうしを連結して上記エッジ情報を生成する際、上記拡大画像上で横方向と縦方向とで距離の差が大きい方向の画素単位毎に同拡大画像のエッジの領域とする画素の位置を表す連結位置情報を取得し、当該連結位置情報を含めて上記エッジ情報を生成する構成としてもよい。近隣する拡大画像のエッジどうしの間で画素単位毎にエッジの領域とされるので、より確実に拡大画像のエッジを精度よく細線で形成することが可能となる。
【0018】
上記拡大位置取得手段は、上記拡大前画像の画素に対応して上記拡大画像の画素を区分した画素区分毎に同拡大画像上で注目画素区分を順次移動させながら、注目画素区分に入る上記拡大画像のエッジが所定数以下となるように同注目画素区分のエッジの位置が表された上記拡大エッジ位置情報を取得する構成としてもよい。画素区分に入る拡大画像のエッジが所定数より多くならないので、拡大画像のエッジの領域を表す情報を生成する処理を高速化させることができる。なお、画素区分に入る拡大画像のエッジが2以下となるようにすると、拡大画像のエッジ位置について良好な精度を維持しながら高速にて拡大画像のエッジの領域を表す情報を生成することができる。
むろん、より確実に良好なエッジ位置の精度を得るために画素区分に入る拡大画像のエッジが3以下となるようにしてもよいし、より高速にてエッジ情報を生成するために画素区分に入る拡大画像のエッジが1以下となるようにしてもよい。
【0019】
上記位置取得手段は、上記拡大前画像上で注目画素を順次移動させながら、同注目画素とその近隣に位置する画素の画像データに対してガウスぼかしを行う演算を行い、当該ガウスぼかしが行われた画像データに基づいて上記エッジ位置情報を取得する構成としてもよい。ガウスぼかしを行うことによりノイズが除去されるのでさらに精度が向上し、より滑らかとされたエッジの位置を表す情報を生成することができる。
なお、注目画素の近隣に位置する画素は、注目画素に隣接していてもよいし、隣接していなくてもよい。
【0020】
上述したエッジ生成装置は、単独で実施される場合もあるし、ある機器に組み込まれた状態で他の方法とともに実施されることもあるなど、発明の思想としては各種の態様を含むものであって、適宜、変更可能である。
また、所定の手順に従って上述した手段に対応した処理を行う方法にも発明は存在する。従って、本発明はエッジ生成装置の制御方法としても適用可能であり、請求項11にかかる発明においても、基本的には同様の作用となる。
さらに、生成したエッジ情報を反映した拡大画像の画像データ(拡大画像を表現する画像データ。以下、同様)に基づいて印刷を行う印刷装置に対して印刷制御を行う印刷制御装置としても適用可能であるし、同印刷制御装置と印刷装置を備える印刷システムとしても適用可能であり、基本的には同様の作用となる。
【0021】
本発明を実施しようとする際に、上記装置にて所定のプログラムを実行させる場合もある。そこで、エッジ生成装置の制御プログラムとしても適用可能であり、請求項12にかかる発明においても、基本的には同様の作用となる。さらに、同プログラムを記録した媒体が流通し、同記録媒体からプログラムを適宜コンピュータに読み込むことが考えられる。すなわち、そのプログラムを記録したコンピュータ読み取り可能な記録媒体としても適用可能であり、基本的には同様の作用となる。
むろん、請求項2〜請求項9に記載した構成を上記方法、印刷制御装置、印刷システム、プログラム、プログラムを記録した媒体に対応させることも可能である。
ここで、上記記録媒体は、磁気記録媒体や光磁気記録媒体の他、今後開発されるいかなる記録媒体であってもよい。一次複製品、二次複製品などの複製段階も問わない。一部がハードウェアで実現される場合や、一部を記録媒体上に記録しておいて必要に応じて適宜読み込む場合も本発明の思想に含まれる。
【0022】
【発明の実施の形態】
以下、下記の順序に従って本発明の実施形態を説明する。
(1)印刷システムの構成:
(2)エッジ生成装置の構成の概略:
(3)エッジ生成装置が行う処理:
(3−1)ゼロクロス検出処理:
(3−2)ゼロクロス連結処理:
(4)変形例:
【0023】
(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を採用しているが、コンピュータとしては一般的な構成を有するものを採用可能である。
【0024】
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を接続する構成としてもよい。
【0025】
プリンタ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に書き込まれたプログラムに従って各部を制御する。
【0026】
PC10では、以上のハードウェアを基礎としてバイオスが実行され、その上層にてOSとAPLとが実行される。OSには、プリンタI/F17eを制御するプリンタドライバ等の各種のドライバ類が組み込まれ、ハードウェアの制御を実行する。プリンタドライバは、プリンタI/F17eを介してプリンタ20と双方向の通信を行うことが可能であり、APLから画像データを受け取って印刷ジョブを作成し、プリンタ20に送出する。本発明のエッジ生成プログラムは、APLから構成されるが、プリンタドライバにより構成されてもよい。また、HD14は同プログラムを記録した媒体であるが、同媒体は、例えば、CD−ROM、FD16a、光磁気ディスク、不揮発性メモリ、パンチカード、バーコード等の符号が印刷された印刷媒体、等であってもよい。むろん、通信I/F17dからインターネット網を介して所定のサーバに格納された上記の制御プログラムをダウンロードして実行させることも可能である。
そして、上記ハードウェアと上記プログラムとが協働してエッジ生成装置を構築する。
【0027】
(2)エッジ生成装置の構成の概略:
図3は、上記エッジ生成装置の構成の概略を模式的に示している。PCをエッジ生成装置U0として機能させるエッジ生成プログラムは、以下に述べる各種手段に対応した複数のモジュールから構成されている。
本エッジ生成装置U0は、概略、拡大前画像I1の各画素I1uの位置に対応させたエッジの位置を表すゼロクロス位置Z(エッジ位置情報D3)を取得する位置取得手段U1と、取得されたゼロクロス位置Zに基づいて拡大画像I2のエッジの領域を表すエッジ情報D5を生成するエッジ生成手段U2とから構成されている。画像拡大などを行う際、エッジ部分の処理によって、拡大後の画像の見栄えがまったく違うものになってしまうし、ジャギーが少ない、拡大エッジ画像を作成することは、画像拡大処理において非常に重要である。本装置は、両手段U1,U2により、ジャギーの少ない、きれいなエッジのラインを作成する。
【0028】
拡大前画像の画像データD1は、拡大前画像をドットマトリクス状の多数の画素で階調表現するデータであり、拡大前画像の明るさが表されたデータである。本実施形態の階調データD8は、Y(輝度)、Cb(ブルーの色差)、Cr(レッドの色差)からなるYCbCrデータであるとして説明するが、R(レッド)、G(グリーン)、B(ブルー)からなるRGBデータ等であってもよい。また、YCbCr各成分は、256階調であるとして説明するが、1024階調、100階調、等であってもよい。
位置取得手段U1は、同画像データD1の輝度値Yに基づいてゼロクロス位置Zを算出して取得する。その際、拡大前画像I1上で注目画素を順次移動させながら、同注目画素とその近隣に位置する画素の画像データに対して公知のガウスぼかしを行う演算を行う。次に、ガウスぼかしが行われた拡大前画像上で注目画素を順次移動させながら、同注目画素とその周囲の画素の画像データに対して公知のラプラシアンフィルタを用いた演算を行って拡大前画像の各画素I1uに対応して階調表現された中間データD2を生成する。ラプラシアンフィルタでのエッジ検出では、ゼロクロス位置Zをピクセル以下の単位で求めることができる。そして、中間データD2に対応するドットマトリクス状の画素上で注目画素を順次移動させながら、同注目画素とその近隣に位置する画素との位置と中間データとに基づいて同中間データを略0にする位置が表されたエッジ位置情報D3、すなわち、ゼロクロス位置Zを取得する。ゼロクロス位置Zは、拡大前画像の画素I1uをxy平面上に置いたとき、拡大前画像の画素I1uよりも細かい単位で拡大前画像の各画素I1uの位置に対応させたエッジの位置を表す座標値とされている。
【0029】
なお、輝度値Yを用いてゼロクロス位置Zを取得する以外にも、各RGBの階調値の平均値を用いてゼロクロス位置Zを取得してもよいし、以下の式により輝度値Yを算出して同輝度値Yを用いてゼロクロス位置Zを取得してもよい。
Y=0.30r+0.59g+0.11b …(1)
ここで、r,g,bは、各RGBの階調値を表している。
【0030】
エッジ生成手段U2は、ゼロクロス位置Zに基づいて拡大前画像I1のエッジの位置に対応する拡大画像I2のエッジの位置を表す拡大エッジ位置情報D4を取得する拡大位置取得手段U21と、取得された拡大エッジ位置情報D4に基づいて近隣する拡大画像I2のエッジどうしを連結して拡大画像I2のエッジの領域を表すエッジ情報D5を生成する連結手段U22とから構成されている。
拡大位置取得手段U21は、拡大前画像の画素I1uに対応して拡大画像I2の画素I2uを区分した画素区分I2d(図では3×3画素)毎に拡大画像I2上で注目画素区分を順次移動させながら、同注目画素区分のエッジの位置が表された拡大エッジ位置情報D4を取得する。すなわち、ゼロクロス位置Zが、拡大後のどのピクセルに相当するかを計算し、その位置を拡大後のゼロクロス位置(拡大エッジ位置情報D4)とする。拡大エッジ位置情報D4は、拡大画像の画素I2uをxy平面上に置いたとき、拡大画像の画素I2u単位で拡大画像の各画素I2uの位置に対応させたエッジの位置を表す座標値とされている。
【0031】
連結手段U22は、エッジ情報D5を生成する際、まず、拡大前画像I1上で注目画素を順次移動させながら、注目画素を中心とした3×3画素(注目画素およびその近隣に位置する画素)の画像データを2値化して2値化データD6を生成する。次に、2値化データD6と、所定の複数のマッチングパターンと、に基づいてエッジの向きを決定する。本実施形態のマッチングパターンは、エッジの向きに対応した3×3のパターンとされている。さらに、近隣する拡大画像I2のエッジどうしを同決定したエッジの向きとなるように連結する連結位置情報D7を取得する。連結位置情報D7は、拡大画像のエッジの領域とする画素の位置を表す情報である。マッチングパターンを用いることにより、連結の際にパターンマッチング結果を用いて適切な方向のみ連結することができ、拡大エッジ画像でのエッジを高精細の細線で取得することができる。そして、拡大エッジ位置情報D4と連結位置情報D7とを合わせて、エッジ情報D5を生成する。エッジ情報D5は、拡大画像の画素I2uをxy平面上に置いたとき、拡大画像の画素I2u単位で拡大画像の各画素I2uの位置に対応させたエッジの領域を表す座標値の集合とされている。
【0032】
従来の技術では、拡大前画像の画素単位でエッジの位置を検出するため、拡大画像のエッジ位置の精度がよくなく、拡大画像のエッジにジャギーが目立っていた。本エッジ生成装置U0で生成されるエッジ情報は拡大画像の画素単位でエッジの領域が表されているので、拡大画像のエッジを精度よく細線で形成して鮮鋭化等の処理を容易に行うことが可能であるとともに、エッジのジャギーを少なくさせ、高い精度と計算量の少ない、拡大エッジ画像の作成が可能となる。
【0033】
(3)エッジ生成装置が行う処理:
以下、エッジ生成装置が行う処理とともに、動作を詳細に説明していく。
図4は、本エッジ生成装置が行う処理をフローチャートにより示している。具体的には、PC10のCPU11が本処理を行う。
まず、位置取得手段と拡大位置取得手段により、ゼロクロス位置Zを取得するゼロクロス検出処理を行う(ステップS105。以下、「ステップ」の記載を省略)。次に、連結手段により、ゼロクロスを連結してエッジ情報を生成するゼロクロス連結処理を行い(S110)、本フローを終了する。その後は、生成したエッジ情報に基づいて拡大画像の画像データを生成すれば、ディスプレイにて画像データに対応する拡大画像を表示したり、プリンタ20に対して画像データを出力することにより画像データに対応する拡大画像を印刷したりすることができる。
【0034】
(3−1)ゼロクロス検出処理:
図5は、上記ゼロクロス検出処理をフローチャートにより示している。
まず、図3で模式的に示したように拡大前画像をドットマトリクス状の画素別の階調データで表現する画像データに対してガウスぼかしを行うガウスぼかし処理を行う(S205)。
【0035】
図6は、上記ガウスぼかし処理をフローチャートにより示している。
まず、拡大前画像を多数の画素別のYCbCrデータで表現する画像データを入力する(S305)。デジタルカメラ30等から画像データを入力する場合、データ全体を一括して読み込む必要はなく、部分的に読み込むようにしてもよいし、他のAPLから呼び出されるような場合にはデータの受け渡しに利用されるバッファ領域を表すポインタの受け渡しだけであってもよい。
次に、拡大前画像上で注目画素の位置を設定する(S310)。本実施形態では、注目画素の位置を設定する順序は、左上の画素から開始して順番に右上の画素までとし、その後一つずつ下の左端の画素から順番に右端の画素までとして、最後に右下の画素としている。以下、各種処理にて注目画素の位置を設定する場合も同様にしている。むろん、注目画素の位置を設定する順序は、適宜変更可能であり、拡大前画像の種類等に応じて異なる順序とすることも可能である。
【0036】
さらに、図7に示すように、注目画素とその近隣に位置する3×3画素(所定領域)の輝度値Y(画像データ)を取得する(S315)。図の例では、注目画素の輝度値d5と、その周囲である近隣に位置する8画素の輝度値d1〜d4,d6〜d9を取得することになる。
なお、図8の上段に示すように、注目画素が拡大前画像の端部にある場合には、拡大前画像の端部の画素における輝度値が拡大前画像の外側にある(折り返されている)ものとして輝度値を取得する。
【0037】
そして、図6のフロー中に示した公知のガウスぼかし演算用フィルタF1を用いてガウスぼかし演算を行う(S320)。ここで、図7に示すように、フィルタ演算を行うための演算用フィルタFは、参照する3×3画素のそれぞれに対応した係数f1〜f9を有しており、各画素に対応する画像データd1〜d9のそれぞれに同係数を乗じた総和を求めて注目画素のフィルタ演算後の階調データd’を算出するものである。実際には、以下の式のように、同総和に所定係数(kとする)を乗じてフィルタ演算後のデータd’とする。

Figure 2004207923
後述するラプラシアンフィルタのように係数f1〜f9の合計Σfiが0となるフィルタの場合にはk=1とし、ガウスぼかし演算用フィルタF1のように係数f1〜f9の合計Σfiが0となるフィルタの場合にはk=1/Σfiとする。
【0038】
なお、ガウスぼかし演算用フィルタは、拡大前画像の種類等に応じて様々なフィルタを採用することができる。例えば、より滑らかでノイズの少ない画像に変換するために5×5画素のフィルタを用いてもよいし、演算処理を高速化させるために図7で示した演算用フィルタFの各係数のうちf2,f4,f5,f6,f8のみを備えるフィルタを用いてもよい。
むろん、フィルタ演算の概念に入らないようなガウスぼかし演算を行ってもよい。
その後、拡大前画像の全画素について、ガウスぼかし演算を行ったか否かを判断する(S325)。ガウスぼかし演算を行っていない画素が残っている場合には、拡大前画像上で注目画素を順次移動させながら繰り返しS310〜S325により注目画素とその近隣に位置する画素の画像データに対してガウスぼかしを行う演算を行う。全画素についてガウスぼかし演算を行った場合には、本フローを終了する。
すると、図8の中段に示すように、拡大前画像の画像データD1からガウスぼかし処理後の画像データD1’が生成される。ガウスぼかし処理が行われた画像データD1’は、元の拡大前画像の各画素に対応したドットマトリクス状の画素で階調表現するデータである。
【0039】
ガウスぼかし処理が終了すると、図5のS210に進み、ガウスぼかしが行われた画像データに基づいてゼロクロス位置Zが取得され、拡大画像のエッジの領域を表すエッジ情報が生成される。
なお、ガウスぼかし処理を行わなくてもエッジ情報を生成することは可能であるが、ガウスぼかし処理を行うことによりノイズが除去されるのでエッジ位置の精度が向上し、より滑らかとされたエッジの位置を表す情報を生成することができる。ここで、ガウスぼかし処理を行うのは拡大前画像のノイズを除去するため、上述したフィルタF1を用いた処理等、比較的強度の小さいガウスぼかし処理を行うことが望ましい。
【0040】
図5のS210では、ガウスぼかし処理が行われた画像データに対してラプラシアンフィルタを用いたラプラシアンフィルタ演算処理を行う。
図9は、上記ラプラシアンフィルタ演算処理をフローチャートにより示している。
まず、ガウスぼかし処理が行われた画像データで階調表現される拡大前画像上で注目画素の位置を設定する(S405)。次に、図7で示したように、注目画素とその近隣に位置する3×3画素の輝度値d1〜d9を取得する(S410)。
なお、図8の中段に示すように、注目画素が拡大前画像の端部にある場合には、拡大前画像の端部の画素における輝度値が拡大前画像の外側にあるものとして輝度値を取得する。
そして、図9のフロー中に示した公知の8方向ラプラシアンフィルタF2を用いてラプラシアンフィルタ演算を行い、図3で模式的に示したようにドットマトリクス状の画素で階調表現された中間データD2を生成する(S415)。
【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である。
このように、ラプラシアンフィルタ演算を行うことにより、注目画素とその近隣に位置する画素との画像データの差分を演算し、演算結果に基づいて同注目画素の近隣に存在するエッジの位置が表されたゼロクロス位置Zを取得することができる。
【0042】
なお、ラプラシアンフィルタは、拡大前画像の種類等に応じて様々なフィルタを採用することができる。
図10の上段に示すように、上記フィルタF2とは符号が逆とされた8方向ラプラシアンフィルタを用いてもよいし、図の下段に示すように、演算処理を高速化させるために図7で示した演算用フィルタFの各係数のうちf2,f4,f5,f6,f8のみを備える4方向ラプラシアンフィルタを用いてもよい。
むろん、ラプラシアンフィルタ演算を行う代わりに、縦横方向別に差分フィルタ等のフィルタを用いて演算を行ってもよいし、フィルタ演算の概念に入らないような差分演算を行ってもよい。
【0043】
そして、ガウスぼかし処理が行われた拡大前画像の全画素について、ラプラシアンフィルタ演算を行ったか否かを判断する(S420)。ラプラシアンフィルタ演算を行っていない画素が残っている場合には、同拡大前画像上で注目画素を順次移動させながら繰り返しS405〜S420により注目画素とその周囲に位置する画素の画像データに対してラプラシアンフィルタを用いた演算を行って中間データを生成する。全画素についてラプラシアンフィルタ演算を行った場合には、本フローを終了する。
すると、図8の下段に示すように、ガウスぼかし処理後の画像データD1’から中間データD2が生成される。ラプラシアンフィルタ演算処理が行われて生成される中間データは、元の拡大前画像の各画素に対応したドットマトリクス状の画素で階調表現するデータである。
【0044】
その後、図5のS215に進み、ラプラシアンフィルタ演算処理により生成された中間データに基づいてゼロクロス位置Zが取得され、拡大画像のエッジの領域を表すエッジ情報が生成される。
ラプラシアンフィルタ演算処理を行ってエッジの位置を検出することにより、簡易な構成で精度よくエッジの位置を表す情報を取得することができ、精度よく拡大画像のエッジの領域を表す情報を生成することができる。
【0045】
ラプラシアンフィルタ演算処理を行うと、ゼロクロス位置Zを記憶するバッファ領域をRAM内に確保する(S215)。次に、生成した中間データに対応するドットマトリクス状の画素上で注目画素の位置を設定する(図5のS220)。そして、注目画素の中間データと注目画素の右隣(近隣)に位置する画素(右隣画素)の中間データの符号が異なるか否かを判断する(S225)。ここで、注目画素の設定順序は左から右方向であるので、右隣画素は注目画素とされておらず、現在の注目画素との間でゼロクロスが存在するか否かを判定する意義がある。符号が異ならない場合、注目画素と右隣画素との間にゼロクロスはほとんど存在しないため、S245のゼロクロス位置算出処理を行わずにS250に進む。
【0046】
S225で符号が異なると判断した場合、ゼロクロス位置を算出すべきか否かを判断するため、現在位置である注目画素の中間データの絶対値と右隣画素の中間データの絶対値の少なくとも一方が所定のしきい値L1以上であるか否かを判断する(S230)。むろん、しきい値L1より大であるか否かを判断するようにしてもよい。拡大前画像の輝度値が256階調であるとき、中間データの階調値も256階調となり、しきい値L1を例えば256階調の略中間値である128等とすればよい。両絶対値の少なくとも一方がしきい値L1以上である場合、ゼロクロス位置を算出すべきと判断したことになり、S245に進んでゼロクロス位置算出処理を行う。エッジが存在するのは主に両画素間の輝度値の差が大きく、中間データの符号が異なるときであるので、精度よくエッジの位置を表す情報を取得することができ、その結果、精度よく拡大画像のエッジの領域を表す情報を生成することが可能となる。
【0047】
注目画素の中間データの絶対値と右隣画素の中間データの絶対値がいずれも所定の閾値より小(または以下)である場合、さらにゼロクロス位置を算出すべきか否かを判断するため、ガウスぼかし処理が行われた拡大前画像上で注目画素を中心とする3×3画素(注目画素とその周囲の画素)の輝度値の最大値と最小値の差(画像データの異なり度合)を求める(S235)。なお、ガウスぼかし処理が行われる前の拡大前画像上で注目画素を中心とする3×3画素の輝度値の最大値と最小値の差を求めてもよい。そして、求めた差が所定の閾値L2以上であるか否かを判断する(S240)。むろん、しきい値L2より大であるか否かを判断するようにしてもよい。ガウスぼかし処理後の拡大前画像の輝度値が256階調であるとき、しきい値L2を例えば50等とすればよい。輝度値の最大値と最小値の差がしきい値L2以上である場合、ゼロクロス位置を算出すべきと判断したことになり、S245に進んでゼロクロス位置算出処理を行う。注目画素と右隣画素の輝度値の差が小さいためにラプラシアンフィルタ演算処理を行った結果S230ではゼロクロスを検出することができなくても、注目画素を中心とした3×3画素の輝度値の差が大きいことがあるので、ゼロクロスの検出精度を向上させることができる。すなわち、精度よくエッジの位置を表す情報を取得することができ、その結果、精度よく拡大画像のエッジの領域を表す情報を生成することが可能となる。
一方、輝度値の最大値と最小値の差がしきい値L2より小(または以下)である場合、ゼロクロス位置を算出する必要がないと判断したことになり、S245のゼロクロス位置算出処理を行わずにS250に進む。
なお、注目画素とその周囲の画素の画像データの異なり度合は、上記最大値と最小値との差等の最大値と最小値との組み合わせに基づく値の他、2番目に大きい値と2番目に小さい値との組み合わせに基づく値、これらに中間値も組み合わせた値、等、様々なものを採用可能である。
【0048】
図8で示した例において、中間データD2に対応する画素上での注目画素がx=2,y=1であるとき、注目画素の中間データは−170、右隣画素の中間データが4であるので、S225で条件成立となる。また、注目画素の中間データの絶対値が128以上であるので、S230でも条件成立となり、注目画素と右隣画素の中間データが急変しているためエッジが存在すると判断してゼロクロス位置算出処理を行うことになる。
また、中間データD2に対応する画素上での注目画素がx=1,y=2であるとき、注目画素の中間データは−125、右隣画素の中間データが53であるので、S225で条件成立となる。しかし、注目画素と右隣画素の中間データの絶対値はいずれも128より小さいので、S230では条件不成立となる。ここで、ガウスぼかし処理後の拡大前画像上で注目画素を中心とした3×3画素の輝度値は214(最大値),206,181,206,171,111,161,108,56(最小値)であるので、最大値と最小値の差は214−56=158と50以上になってS240で条件成立となり、注目画素を中心とした3×3画素の領域で輝度値が急変しているためエッジが存在すると判断してゼロクロス位置算出処理を行うことになる。
【0049】
図11は、上記S245で行われるゼロクロス位置算出処理をフローチャートにより示している。
まず、拡大前画像から拡大画像への拡大率Mを取得する(S505)。例えば、ディスプレイに解像度選択欄を有する印刷インターフェイス画面を表示し、解像度選択欄への操作入力から画像の拡大率を表すパラメータを取得してRAMに格納すればよい。ここで、拡大率がMであるとき、横方向(x方向)の画素数をM倍にするとともに、縦方向(y方向)の画素数もM倍にすることを意味するものとする。むろん、拡大率としてMx,Myを取得し、横方向の画素数をMx倍にし、縦方向の画素数をMy倍にするようにしてよい。
【0050】
次に、拡大率Mを反映させた画素の位置をX1、その画素の中間データをY1として、注目画素と隣接画素(S245で本処理が行われる場合には右隣画素)のX1,Y1の関係式Y1=A1・X1+B1のA1,B1を算出する(S510)。すなわち、注目画素と隣接画素の2点のラプラシアンフィルタ適用結果から、その2点を通る直線の式を求めることになる。ここで、画素の位置X1は、注目画素と右隣画素の2点について直線の式を求める場合には拡大画像上での横方向のx座標であり、注目画素と下隣画素の2点について直線の式を求める場合には拡大画像上での縦方向のy座標である。注目画素の中間データをLP0、隣接画素の中間データをLP1、拡大前画像上での注目画素の位置をx0とすると、A1,B1は以下の式により算出することができる。
A1=(LP1−LP0)/M …(4)
B1=LP0−A1×(x0×M+M/2) …(5)
【0051】
A1,B1を算出すると、以下の式により、拡大率Mを反映させたゼロクロス位置Z1を算出する(S515)。
Z1=−B1/A1 …(6)
ここで、Z1は小数点以下の情報を有する値とされ、拡大前画像の画素よりも細かい単位とされている。そして、拡大前画像の画素の位置に拡大率Mを乗じた値であるので、ゼロクロス位置Z1は拡大前画像の各画素の位置に対応させたエッジの位置を表すエッジ位置情報とされている。
以上の処理により、注目画素およびその近隣に位置する画素の位置および中間データに基づいて、中間データを略0にする位置が表されたエッジ位置情報を取得することができる。
【0052】
ゼロクロス位置Z1を算出すると、同ゼロクロス位置Z1に基づいて拡大前画像のエッジの位置に対応する拡大画像のエッジの位置Z1’(拡大エッジ位置情報の一種)を取得する(S520)。拡大画像のエッジの位置Z1’は、以下の式により算出することができる。
Z1’=INT(Z1) …(7)
ここで、INTは小数点以下を切り捨てる関数である。すなわち、Z1’は拡大画像の画素単位で拡大画像のエッジの位置を表す数値情報とされている。
【0053】
図12は、拡大率Mが3であるときに拡大エッジ位置情報を取得する様子を模式的に示している。
拡大前画像のx=1,y=2に中間データLP0=−125の注目画素51があり、注目画素の右隣であるx=2,y=2に中間データLP1=53の隣接画素52があるとする。ここで、拡大前画像の画素に対応して拡大画像の画素を区分したブロック(画素区分)54,55中でゼロクロス56がどこに存在するかを上記式(4)〜(6)を用いて求める。言い換えると、拡大前画像に対応した中間データで表されるドットマトリクス状の画素上でゼロクロス53がどこに存在するかを求めることになる。なお、拡大前画像の注目画素51、隣接画素52に対応してそれぞれ注目ブロック54、隣接ブロック55があるものとする。
図の中段下寄りに示したX1−Y1グラフのように、X1(画素のx座標またはy座標)−Y1(中間データ)平面上での注目画素と隣接画素とを結ぶ直線がX1軸と交差する点(Y1=0となる点)がゼロクロスである。上記例では、x0=1であるから、A1={53−(−125)}/3=59.3、B1=−125−59.3×(1×3+3/2)=−392.0となり、ゼロクロス位置はZ1=−(−392.0)/59.3=6.6となる。
最後に、上記式(7)を用いると、Z1’=INT(6.6)=6となる。従って、拡大エッジ位置情報57は、隣接ブロック55内の左側にあるx=6,y=7の画素の位置を表す情報となる。
【0054】
なお、拡大前画像のx=1,y=2の中間データLP0が2であり、x=2,y=2の中間データLP1が−215であるとすると、A1=(−215−2)/3=−72.3、B1=2−(−72.3)×(3×3+3/2)=761.5、Z1=−761.5/(−72.3)=10.5となり、Z1’=INT(10.5)=10となる。すなわち、拡大エッジ位置情報57は、注目ブロック54内の中央にあるx=4,y=7の画素の位置を表す情報となる。
このように、拡大エッジ位置情報は拡大画像のブロックよりも細かい画素単位で画素の位置を表す情報とされる。拡大前画像の画素単位でエッジの位置を検出していた従来であれば、拡大画像のブロック全体をエッジの位置としたり、同ブロック内の所定位置のみをエッジの位置としていたため、拡大画像のエッジ位置の精度がよくなく、拡大画像のエッジにジャギーが目立っていた。本発明により、拡大画像のエッジ位置の精度が向上し、拡大画像のエッジのジャギーは目立たなくなる。
【0055】
拡大画像のエッジの位置を取得すると、拡大画像のブロック内のエッジが所定数以下であるか否かを判断する(S525)。ブロック内にはエッジが最大4個入る可能性があるが、試験を行ったところ、所定数を2とすると、良好な精度を維持しながら高速にて拡大画像のエッジの領域を表す情報を生成することができた。ブロック内のエッジが所定数以下である場合には、拡大画像のエッジの位置Z1’に対応する拡大画像上のエッジの座標値(拡大エッジ位置情報の一種)をバッファに記憶し(S530)、本フローを終了する。なお、同じ座標値がバッファに格納されている場合には、エッジの座標値をバッファに記憶する処理を省略することにより、拡大画像のエッジの領域を表す情報を生成する処理を高速化させている。このようにして、拡大エッジ位置情報を取得することができる。一方、ブロック内のエッジが所定数より多い場合には、S530の処理を行わずに本フローを終了する。なお、拡大前画像上で注目画素を順次移動させているので、拡大画像上で注目ブロックを順次移動させながら注目ブロックに入る拡大画像のエッジが所定数以下となるように注目のエッジの位置が表された拡大エッジ位置情報を取得していることになる。
【0056】
以上の処理にて、同じブロック内で3番目以降に検出されたゼロクロスを無視することにより、ブロックに入る拡大画像のエッジが所定数以下に抑えられるので、拡大画像のエッジの領域を表す情報を生成する処理を高速化させることができる。むろん、1ブロックに対して4つのゼロクロスの座標値を格納する記憶バッファを用意しておけば、検出した全てのゼロクロスを使用して非常に高精度に拡大画像のエッジの領域を表す情報を生成することが可能となる。
【0057】
ところで、図13に示すように、拡大率Mを反映させない拡大前画像上での画素の位置と中間データとの関係式を用いてゼロクロス位置(図12のゼロクロス53の位置)を算出し、拡大エッジ位置情報を取得するようにしてもよい。
まず、拡大前画像上での画素の位置をX0、その画素の中間データをY0として、注目画素と隣接画素のX0,Y0の関係式Y0=A0・X0+B0のA0,B0を算出する(S555)。注目画素の中間データをLP0、隣接画素の中間データをLP1、拡大前画像上での注目画素の位置をx0とすると、A0,B0は以下の式により算出することができる。
A0=LP1−LP0 …(8)
B0=LP0−A1×(x0+1/2) …(9)
A0,B0を算出すると、以下の式により、ゼロクロス位置Z0を算出する(S560)。
Z0=−B0/A0 …(10)
ここで、Z0は小数点以下の情報を有する値とされ、拡大前画像の画素よりも細かい単位とされている。そして、ゼロクロス位置Z0は拡大前画像の各画素の位置に対応させたエッジの位置を表すエッジ位置情報とされている。
【0058】
ゼロクロス位置Z0を算出すると、拡大率Mを取得し(S565)、以下の式により、拡大前画像のエッジの位置に対応する拡大画像のエッジの位置Z0’を算出して取得する(S570)。
Z0’=INT(Z0×M) …(11)
すなわち、Z0’は拡大画像の画素単位で拡大画像のエッジの位置を表す数値情報とされている。
拡大画像のエッジの位置を取得すると、拡大画像のブロック内のエッジが所定数以下であるか否かを判断する(S575)。ブロック内のエッジが所定数以下である場合には、拡大画像のエッジの位置Z0’に対応する拡大画像上のエッジの座標値をバッファに記憶し(S580)、本フローを終了する。このようにしても、拡大エッジ位置情報を取得することができる。一方、ブロック内のエッジが所定数より多い場合には、S580の処理を行わずに本フローを終了する。
【0059】
注目画素と右隣画素との間でゼロクロス位置算出処理を行うと、図5のS250に進み、注目画素と下隣画素との間で同様の処理を行う。
すなわち、注目画素の中間データと注目画素の下隣(近隣)に位置する画素(下隣画素)の中間データの符号が異なるか否かを判断する(S250)。ここで、注目画素の設定順序は左から右方向を上から下へ向かって繰り返しているので、下隣画素は注目画素とされておらず、現在の注目画素との間でゼロクロスが存在するか否かを判定する意義がある。符号が異ならない場合、S270のゼロクロス位置算出処理を行わずにS275に進む。
S250で符号が異なると判断した場合、現在位置である注目画素の中間データの絶対値と下隣画素の中間データの絶対値の少なくとも一方が所定のしきい値L3(例えば128)以上(またはより大)であるか否かを判断する(S255)。本実施形態ではL1=L3としているが、L1とL3とは異なる値であってもよい。両絶対値の少なくとも一方がしきい値L3以上である場合、S270に進んでゼロクロス位置算出処理を行う。
【0060】
注目画素の中間データの絶対値と下隣画素の中間データの絶対値がいずれも所定の閾値より小(または以下)である場合、ガウスぼかし処理が行われた拡大前画像上で注目画素を中心とする3×3画素の輝度値の最大値と最小値の差を求め(S260)、求めた差が所定の閾値L4(例えば50)以上であるか否かを判断する(S265)。L2とL4とは異なる値であってもよい。輝度値の最大値と最小値の差がしきい値L4以上(またはより大)である場合、S270に進んでゼロクロス位置算出処理を行う。一方、輝度値の最大値と最小値の差がしきい値L4より小(または以下)である場合、ゼロクロス位置を算出する必要がないと判断したことになり、S270のゼロクロス位置算出処理を行わずにS275に進む。
【0061】
S270でゼロクロス位置算出処理を行うと、ガウスぼかし処理が行われた拡大前画像の全画素についてS220〜S270の処理を行ったか否かを判断する(S275)。同処理を行っていない画素が残っている場合には、同拡大前画像上で注目画素を順次移動させながら繰り返しS220〜S275によりゼロクロス位置Zを算出して拡大エッジ位置情報を取得する処理を行う。全画素について同処理を行った場合には、本フローを終了する。このようにして、ラスタスキャンでのエッジ検出が可能となり、拡大前画像の画素よりも細かい単位で高精度にてエッジの位置を求めることができる。
すなわち、S205〜S240,S250〜S265,S275,図11のS505〜S515の処理を行うPC10は、位置取得手段を構成し、図11のS520〜S530の処理を行うPC10は、拡大位置取得手段を構成する。
【0062】
(3−2)ゼロクロス連結処理:
ゼロクロス検出処理を終了すると、図4のS110に進み、ゼロクロス連結処理を行う。
図14は、上記ゼロクロス連結処理をフローチャートにより示している。
まず、ガウスぼかし処理後の拡大前画像上で注目画素の位置を設定する(S605)。次に、拡大画像の画素を区分した3×3画素のブロック毎に、注目画素の位置に対応する注目ブロックの位置を設定する(S610)。
【0063】
さらに、図15に示すように、注目画素を中心とした3×3画素(拡大画像の3×3ブロックに相当)の輝度値(画像データD1’)を2値化して拡大前画像の各画素に対応した2値化データD6を生成する(S615)。注目画素が拡大前画像の端部にある場合には、拡大前画像の端部の画素における輝度値が拡大前画像の外側にあるものとして2値化データを生成する。本実施形態では、3×3画素の輝度値の最大値と最小値の平均値をしきい値L5として、各画素の輝度値がしきい値L5以上(またはより大)である場合に2値化データを1とし、しきい値L5より小(または以下)である場合に2値化データを−1としている。
その後、拡大画像の注目ブロック内に同拡大画像の画素単位とされたゼロクロス、すなわち、エッジが存在するか否かを判断する(S620)。注目ブロック内にエッジが存在しない(対応する拡大画像上のエッジの座標値がバッファに格納されていない)場合、拡大画像上でエッジを連結する処理を行う必要がないので、S655に進む。
【0064】
注目ブロック内にエッジが存在する場合、同注目ブロック内に複数のエッジが存在するか否かを判断する(S625)。複数のエッジが存在する場合には後述するエッジ生成処理を行って(S630)S635に進み、エッジが一つしか存在しない場合には即座にS635に進む。
S635では、注目ブロックの右隣のブロック、左下の隣接ブロック、下隣のブロック、右下の隣接ブロックのいずれかにゼロクロスが存在するか否かを判断する。注目ブロックの設定順序は左から右方向を上から下へ向かって繰り返しているので、これらの隣接ブロックは注目ブロックとされておらず、ゼロクロスが存在するか否かを判定する意義がある。本実施形態では、注目ブロックが拡大画像の端部にあり、隣接ブロックが拡大画像外となる場合には、その隣接ブロックについてはゼロクロスが存在しないものとしてエッジを連結する処理を行わない。むろん、拡大画像の端部のブロックにおけるエッジが拡大前画像の外側にある(折り返されている)ものとしてエッジを連結する処理を行ってもよい。
これらの隣接ブロックにゼロクロスが存在しない場合には、拡大画像上でエッジを連結する処理を行う必要がないので、S655に進む。
上記隣接ブロックにゼロクロスが存在する場合、2値化データと、所定の複数のマッチングパターンと、に基づいてエッジの向きを決定し、エッジの向きを表す情報を取得する(S640)。
【0065】
図16は、検出用の3×3フィルタマトリクスであるマッチングパターンの一例を模式的に示している。図において、エッジの向き90度、30度、45度に対応して、それぞれ90度用のマッチングパターンが12種類、30度用のマッチングパターンが16種類、45度用のマッチングパターンが8種類示されている。これらの他、60度用、135度用、180度用、等のマッチングパターンもそれぞれ複数種類用意されている。むろん、マッチングパターンは、図に示したものに限定されない。
2値化データとマッチングパターンとがマッチ(一致)するかどうかは、図7を用いて説明すると、3×3の各画素の2値化データ(d1〜d9とする)と、マッチングパターンの各要素値(f1〜f9とする)との積の総和S1=Σfi・diを算出し、この総和S1がマッチングパターンの各要素値の絶対値の総和S2=Σ|fi|と等しくなるか否かにより判断する。S1=S2となれば拡大前画像のエッジの傾きがマッチングパターンとマッチしたことになり、マッチしたマッチングパターンに対応するエッジの向きを表す情報を取得する。
【0066】
図15の例では、2値化データD6と図16の「90-1」の90度用マッチングパターンとの総和S1を算出すると、−2となる。「90-1」のマッチングパターンにおける各要素の絶対値の総和S2は6であるので、2値化データD6は「90-1」のマッチングパターンとマッチしない(一致しない)ことになる。一方、2値化データD6と図16の「30-12」の30度用マッチングパターンとの総和S1を算出すると、5となる。「30-12」のマッチングパターンにおける各要素の絶対値の総和S2は5であるので、2値化データD6は「30-12」のマッチングパターンとマッチ(一致)することになる。この場合、エッジの向きは30度と決定される。
このように、マッチングパターンを用いるという簡易な構成で確実に拡大画像のエッジどうしを連結することができ、確実に拡大画像のエッジを精度よく細線で形成する処理を高速にて行うことが可能となる。
【0067】
むろん、マッチングパターンを用いる以外にも、二つの画素値の差(輝度値差、RGB値差、各色値の差、等)が小さくなる方向をエッジの向きに決定してもよいし、近隣する画素のエッジの方向を反映させてエッジの向きを決定してもよいし、近隣する画素のエッジの強度を反映させてエッジの方向を決定してもよい。また、処理は複雑になるものの、ベクトルの概念を導入してエッジの方向を決定してもよい。さらに、それらの組み合わせによりエッジの向きを決定してもよい。
【0068】
エッジの向きを決定すると、注目ブロック内のエッジと隣接ブロック内のエッジとを結ぶ直線の傾きが、マッチングパターンを用いて決定されたエッジの向きと一致するか否かを判断する(S645)。具体的には、各マッチングパターンに対してパターンの角度を含むエッジの向きの許容範囲を設けておき、両ゼロクロスを結ぶ直線の向きが同許容範囲内に入るか否かにより判断する。ここで、拡大画像上におけるxy座標平面での注目ブロック内のエッジの位置を(x1,y1)、隣接ブロック内のエッジの位置を(x2,y2)、両エッジの位置を通る直線の傾きをGとするとき、Gは以下の式により算出することができる。
G=(y2−y1)/(x2−x1) …(12)
そして、マッチングパターン別に直線の傾きGの許容範囲の下限値G1と上限値G2とを設けておき、G1≦G≦G2が成立するときに対応するマッチングパターンのエッジの向きと一致していると判断すればよい。
エッジの向きが一致するマッチングパターンが存在する場合にはS650に進んで後述するエッジ生成処理を行い、エッジの向きが一致するマッチングパターンが存在しない場合にはS655に進む。なお、ある隣接ブロック内に複数のエッジが存在する場合には、それぞれのエッジと注目ブロック内のエッジとを連結するように、繰り返しエッジ生成処理を行う。
【0069】
図17は、上記S630,S650で行われるエッジ生成処理をフローチャートにより示している。
まず、拡大画像上でエッジとされた二画素間の横方向(x方向)の距離差が縦方向(y方向)の距離差以上(またはより大)であるか否かを判断する(S705)。条件成立の場合にはS710に進み、条件不成立の場合にはS730に進む。なお、エッジとされた二画素を通る直線の傾きGが求められているので、この傾きGの絶対値が1以下(またはより小)である場合にS710に進み、同傾きGの絶対値が1より大(または以上)である場合にS730に進むようにしてもよい。
横方向の距離差が縦方向の距離差以上である場合、まず、拡大画像上で横方向の画素の位置を設定する(S710)。次に、設定した横方向の位置で、拡大画像のエッジの領域とする縦方向の画素の位置を取得する(S715)。さらに、取得した画素の位置(具体的には、座標値)をエッジの領域とする画素の位置を表す連結位置情報としてバッファに格納する(S720)。そして、次の横方向の画素の位置が存在するか否かを判断する(S725)。連結位置情報を取得していない横方向の画素の位置が存在する場合には、横方向の画素の位置を画素単位で順次移動させながら繰り返しS710〜S725の処理を行う。横方向の画素の全位置について連結位置情報を取得した場合には、S750に進む。
【0070】
図18の左側は、横方向の距離差が縦方向の距離差以上である場合に連結位置情報を取得する様子を示している。ここで、エッジ画素61a,bは、拡大画像の画素単位でエッジとされた画素である。そして、横方向の画素の位置を画素単位で順次移動させながら、例えば連結画素61c,61d,61eの順に当該画素の座標値を連結位置情報として取得する。縦方向の画素の位置を画素単位で順次移動させると、縦方向の位置が同じ連結画素61c,dのいずれかが抜けてしまうため良好なエッジの線を得ることができない。本発明では、図の左側のように横方向の距離差が縦方向の距離差以上であるときに連結画素の抜けを生じさせないため、良好なエッジを細線で得ることが可能となっている。
【0071】
横方向の距離差が縦方向の距離差より小さい場合、今度は、拡大画像上で縦方向の画素の位置を設定する(S730)。次に、設定した縦方向の位置で、拡大画像のエッジの領域とする横方向の画素の位置を取得する(S735)。さらに、取得した画素の座標値を連結位置情報としてバッファに格納する(S740)。そして、次の縦方向の画素の位置が存在するか否かを判断する(S745)。縦方向の画素の位置が存在する場合には縦方向の画素の位置を画素単位で順次移動させながら繰り返しS730〜S745の処理を行い、縦方向の画素の全位置について連結位置情報を取得した場合にはS750に進む。
【0072】
図18の右側は、縦方向の距離差が縦方向の距離差以上である場合にエッジ画素62a,b間で連結位置情報を取得する様子を示している。この場合、縦方向の画素の位置を画素単位で順次移動させながら、例えば連結画素62c,62d,62eの順に当該画素の座標値を連結位置情報として取得する。横方向の距離差が縦方向の距離差より小さいときでも連結画素の抜けを生じさせないため、良好なエッジを細線で得ることが可能となっている。
以上の処理により、近隣する拡大画像のエッジどうしを連結してエッジ情報を生成する際、拡大画像上で横方向と縦方向とで距離の差が大きい方向の画素単位毎に同拡大画像のエッジの領域とする画素の位置を表す情報を取得する。
【0073】
S750では、上記処理により取得した連結位置情報を含めて、拡大画像のエッジの領域を表すエッジ情報を生成し、本フローを終了する。
図19に示すように、拡大画像I2のハッチングを付した位置がエッジ画素の位置であり、○印を付した位置が連結の結果新たにエッジの領域となった連結画素の位置であるとする。図11で示したゼロクロス位置算出処理により、拡大前画像の位置に対応させて拡大画像の画素単位とされたエッジ画素の位置を表す拡大エッジ位置情報D4が取得されている。この拡大エッジ位置情報D4と、エッジどうしを連結する連結位置情報D7とが合わされて、画像拡大後のエッジの領域を表すエッジ情報D5が生成される。
このようにして、拡大エッジ位置情報に基づいて近隣する拡大画像のエッジどうしを連結して拡大画像のエッジの領域を表す情報を生成することができる。そして、簡易な構成で確実に拡大画像のエッジどうしを連結することができ、また、近隣する拡大画像のエッジどうしの間で画素単位毎にエッジの領域とされるので、確実に拡大画像のエッジを精度よく細線で形成することが可能となる。
【0074】
図14のS650のエッジ生成処理を終了すると、拡大画像の全ブロックについてエッジ情報を生成するS605〜S650の処理を行ったか否かを判断する(S655)。同処理を行っていないブロックが残っている場合には、拡大前画像上で注目画素を順次移動させるとともに拡大画像上で注目ブロックを順次移動させながら繰り返しS605〜S655によりエッジ情報を生成する処理を行う。全ブロックについて同処理を行った場合には、本フローを終了する。
【0075】
以上の処理により、拡大画像の画素単位でエッジの領域が形成されるので、拡大画像のエッジを精度よく細線で形成して鮮鋭化等の処理を容易に行うことが可能であるとともに、エッジのジャギーを少なくさせることが可能となる。従って、生成されるエッジ情報を用いて拡大画像を生成すると、ジャギーの少ない滑らかな拡大エッジ画像を得ることができ、拡大後でもジャギーの少ない拡大画像を得ることが可能となる。むろん、画像の拡大率を上げても、滑らかなエッジを細線にて得ることができる。その際、エッジ位置を表す情報を取得するためにエッジ検出用の拡大画像を生成する必要がないので、拡大前画像全体の画像データに対して直交変換のような数学的手法を用いる場合のようにエッジ検出用の拡大画像を別途格納するための記憶領域を多く確保する必要はなく、少ない容量の記憶領域で拡大画像のエッジの領域を表す情報を生成することができる。
また、エッジが存在するブロックのみパターンマッチング処理を行うため、パターンを増やしたりしても、エッジ情報を生成する処理の速度低下が少なくて済む。
【0076】
なお、拡大後の拡大画像に対応する滑らかなエッジを得ることができるので、2次元デジタル画像の拡大処理にこの方法を適用すれば、ジャギーの少ない拡大画像を得ることができる。
また、エッジ位置が明確に分かるので、エッジ鮮鋭化処理にも役立つ。
【0077】
(4)変形例:
本発明のエッジ生成装置は、様々な構成が可能である。
例えば、プリンタは、コンピュータと一体化されたものであってもよい。上述したフローについては、コンピュータ本体内で実行する以外にも、一部または全部をプリンタあるいは専用の画像出力装置で実行するようにしてもよい。
画像データを構成する多数の画素は、縦横に整然と並んだドットマトリクス状とされる以外にも、様々な構成が考えられる。例えば、正六角形を密に並べたような蜂の巣状に整然と並んだドットマトリクス状の画素から画像データを構成してもよい。
以上説明したように、本発明によると、種々の態様により、拡大画像のエッジを精度よく細線で形成して鮮鋭化等の処理を容易に行うことが可能であるとともに、エッジのジャギーを少なくさせることが可能なエッジ生成装置およびエッジ生成プログラムを提供することができる。また、エッジ生成方法としても適用可能である。
【図面の簡単な説明】
【図1】印刷システムのハードウェア構成の概略を示すブロック図。
【図2】プリンタのハードウェア構成の概略を示すブロック図。
【図3】エッジ生成装置の構成の概略を模式的に示す図。
【図4】エッジ生成装置が行う処理を示すフローチャート。
【図5】ゼロクロス検出処理を示すフローチャート。
【図6】ガウスぼかし処理を示すフローチャート。
【図7】演算用フィルタを用いて演算を行う様子を説明する図。
【図8】拡大前画像の画像データから中間データを生成する様子を模式的に示す図。
【図9】ラプラシアンフィルタ演算処理を示すフローチャート。
【図10】ラプラシアンフィルタを示す図。
【図11】ゼロクロス位置算出処理を示すフローチャート。
【図12】拡大エッジ位置情報を取得する様子を模式的に示す図。
【図13】変形例にかかるゼロクロス位置算出処理を示すフローチャート。
【図14】ゼロクロス連結処理を示すフローチャート。
【図15】2値化データを生成してエッジの向きを決定する様子を模式的に示す図。
【図16】マッチングパターンの一例を模式的に示す図。
【図17】エッジ生成処理を示すフローチャート。
【図18】連結位置情報を取得する様子を模式的に示す図。
【図19】拡大エッジ位置情報と連結位置情報とを合わせてエッジ情報を生成する様子を模式的に示す図。
【符号の説明】
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…エッジ位置情報、D4…拡大エッジ位置情報、D5…エッジ情報、D6…2値化データ、D7…連結位置情報、D8…階調データ、I1…拡大前画像、I1u…画素、I2…拡大画像、I2d…画素区分、I2u…画素、U0…エッジ生成装置、U1…位置取得手段、U2…エッジ生成手段、U21…拡大位置取得手段、U22…連結手段[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an edge generation device, an edge generation method, and an edge generation program for generating edge information representing an edge region of an enlarged image obtained by enlarging an image before enlargement.
[0002]
[Prior art]
Conventionally, when generating an enlarged image from an image before enlargement (hereinafter also referred to as an image before enlargement), an edge position is detected in pixel units of the image before enlargement, and the position of the edge corresponds to a pixel of the enlarged image. Thus, an edge area of the enlarged image is formed.
Further, an operation of comparing the image data of each pixel of the pre-enlargement image with a plurality of predetermined matching patterns is performed to form an edge region having a shape corresponding to the matched matching pattern in the enlarged image ( For example, see Patent Document 1).
Further, an interpolation process is performed on the image data representing the image before enlargement to create an enlarged image for the non-edge portion, and the image data representing the image before enlargement is subjected to an orthogonal transform such as a discrete cosine transform. And an inverse orthogonal transform thereof to generate an enlarged image for an edge portion, detect an edge position of the enlarged image based on both enlarged images, and form an edge region of the enlarged image ( For example, see Patent Document 2).
[0003]
[Patent Document 1]
JP-A-2002-63573 (paragraphs 0011-0094, FIG. 1-18)
[Patent Document 2]
JP-A-2000-99713 (paragraphs 0019-0054, FIG. 1-27)
[0004]
[Problems to be solved by the invention]
The above-described conventional technology has the following problems.
When edge positions are detected in pixel units of the image before the enlargement, the edge positions of the enlarged image are not accurately accurate, and jaggies such as so-called jaggies are conspicuous at the edges of the enlarged image.
In the technique disclosed in Patent Literature 1, since an edge region is locally formed in an enlarged image, jaggies of the edge are noticeable when viewed macroscopically.
According to the technique disclosed in Patent Document 2, jaggies at edges of an enlarged image can be made relatively inconspicuous by using a mathematical method such as orthogonal transformation on image data of the entire image before enlargement. It was difficult to perform processing such as edge sharpening. In addition, since the edge position of the enlarged image is detected after the image before the enlargement is enlarged, the accuracy of the edge position is not good. Further, it is necessary to secure a large storage area for separately storing the enlarged image for the edge portion. there were.
[0005]
The present invention has been made in view of the above problems, and it is possible to easily perform processing such as sharpening by forming an edge of an enlarged image with a fine line with high accuracy, and reduce jaggies of the edge. An object of the present invention is to provide a possible edge generation device, an edge generation method, and an edge generation program.
[0006]
Means for Solving the Problems and Effects of the Invention
In order to achieve the above object, in the invention according to claim 1, the position acquisition unit is based on image data that expresses a gradation of an image before enlargement by a dot matrix pixel, and is a unit smaller than a pixel of the image before enlargement. Then, edge position information indicating an edge position corresponding to the position of each pixel of the pre-enlargement image is obtained. Then, based on the edge position information acquired by the position acquisition unit, the edge generation unit associates the edge of the enlarged image in pixel units of the enlarged image obtained by enlarging the image before enlargement with the position of each pixel of the enlarged image. Is generated.
That is, since an edge region is formed in a pixel unit of the enlarged image obtained by enlarging the image before enlargement, it is possible to form the edge of the enlarged image with a fine line with high precision and easily perform processing such as sharpening. This makes it possible to reduce jaggies at the edges. At this time, it is not necessary to generate an enlarged image for edge detection in order to acquire information representing an edge position, so that information representing an edge region of an enlarged image can be generated with a small storage area.
[0007]
Here, the image data may be information in various data formats, for example, bitmap data, compressed data, and the like. The image data includes, for example, YCbCr data composed of luminance data (Y) and color difference data (Cb, Cr), and 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 a Lab space defined by the CIE standard, and the like. Various types of data are possible.
[0008]
The position acquiring means may acquire the edge position information based on the image data representing the brightness of the image before enlargement. Then, information representing the position of the edge can be more accurately obtained, and information representing the edge region of the enlarged image can be generated more accurately. Various types of data such as brightness data, brightness data, and an average of RGB data can be considered as the image data representing the brightness.
[0009]
The edge generation means obtains enlarged edge position information indicating an edge position of the enlarged image corresponding to an edge position of the pre-enlarged image in pixel units of the enlarged image based on the edge position information. Means for connecting the edges of the same enlarged image adjacent to each other based on the enlarged edge position information to generate edge information representing an edge area of the enlarged image. Then, the edges of the enlarged image corresponding to the edges of the pre-enlargement image are connected to each other, so that the edges of the enlarged image can be more reliably formed with fine lines.
[0010]
The position acquiring means calculates a difference between image data of the pixel of interest and a pixel located in the vicinity of the pixel of interest while sequentially moving the pixel of interest on the image before enlargement, and calculates a neighborhood of the pixel of interest based on the calculation result. May be configured to acquire the edge position information indicating the position of the edge existing in the edge position. With a simple configuration of calculating a difference between image data, it is possible to acquire information indicating the position of an edge.
At this time, edge position information may be acquired by reflecting the edge strength.
[0011]
The position obtaining means performs a calculation using a Laplacian filter on the image data of the target pixel and the surrounding pixels on the pre-enlargement image, and performs gradation expression corresponding to each pixel of the pre-enlargement image. Intermediate data is generated, and while the target pixel is sequentially moved on a dot matrix pixel corresponding to the intermediate data, the intermediate data is set to approximately 0 based on the position of the target pixel and a pixel located in the vicinity thereof and the intermediate data. May be configured to acquire the edge position information indicating the position to be set. By detecting the position of an edge using a known Laplacian filter, information representing the position of the edge can be accurately obtained with a simple configuration, and information representing the edge region of the enlarged image can be generated with high accuracy. Can be.
[0012]
Note that the surrounding pixels may or may not be adjacent to the pixel of interest.
As the Laplacian filter, an 8-directional Laplacian filter, a 4-directional Laplacian filter, or the like can be employed.
Of course, in addition to using the Laplacian filter, the position of the edge may be detected using a primary spatial differential filter, a non-linear differential filter, or the like.
[0013]
The position acquiring means, when the sign of the intermediate data of the target pixel on the dot matrix pixel corresponding to the intermediate data is different from the sign of the intermediate data of the pixel located in the vicinity thereof, the position of the pixel of interest and the pixel located in the vicinity thereof. Based on the position and the intermediate data, the edge position information indicating the position at which the intermediate data is made substantially zero may be obtained. Since the edge exists mainly when the sign of the intermediate data is different, it is possible to obtain information representing the position of the edge with higher accuracy, and to generate information representing the edge region of the enlarged image with higher accuracy. Can be.
[0014]
In this case, when at least one of the absolute values of the intermediate data is equal to or larger than a predetermined threshold value, the position acquiring means performs the intermediate processing based on the position of the pixel of interest and a pixel located in the vicinity thereof and the intermediate data. The edge position information indicating the position where the data is set to substantially 0 may be obtained. Since the edge exists mainly when the difference in the value of the image data between the two pixels is large, it is possible to obtain the information indicating the position of the edge with higher accuracy, and to accurately determine the edge region of the enlarged image. The information that represents can be generated.
[0015]
In addition, the position acquisition means may be configured such that the sign of the intermediate data between the pixel of interest on the dot matrix pixel corresponding to the intermediate data and the pixel located in the vicinity thereof is different, and the absolute value of the intermediate data is a predetermined value. When the difference between the image data of the target pixel and its surrounding pixels is equal to or larger than or equal to or less than a predetermined threshold, the position of the pixel of interest and the pixels located in the vicinity thereof is equal to or smaller than the threshold. Alternatively, the edge position information indicating a position where the intermediate data is set to substantially 0 based on the intermediate data may be acquired. Even if the difference between the value of the image data of the pixel of interest and the pixel located near the pixel of interest is small, the difference between the values of the image data may be large within the pixel of interest and the pixels located therearound. Therefore, information representing the position of the edge can be acquired more accurately, and information representing the edge region of the enlarged image can be generated more accurately.
[0016]
The connecting means binarizes image data of the pixel of interest and pixels located near the pixel of interest while sequentially moving the pixel of interest on the pre-enlarged image to generate binarized data. And a plurality of predetermined matching patterns corresponding to the directions of the edges, and determine the direction of the edges, and connect the edges of the neighboring enlarged images so that the determined directions of the edges are the same. The information may be generated. The edges of the enlarged image can be reliably connected to each other with a simple configuration, and the edges of the enlarged image can be reliably formed with a fine line with high-speed processing.
[0017]
When the edge information is generated by connecting the edges of the adjacent enlarged images to each other, the connecting unit expands the same image for each pixel unit in a direction in which a difference in distance between the horizontal direction and the vertical direction is large on the enlarged image. A configuration may be adopted in which connection position information indicating a position of a pixel serving as an edge region of an image is obtained, and the edge information is generated including the connection position information. Since an edge region is set for each pixel between adjacent edges of the enlarged image, the edge of the enlarged image can be more reliably formed with a fine line.
[0018]
The enlargement position acquiring unit is configured to sequentially move the target pixel section on the enlarged image for each pixel section obtained by dividing the pixels of the enlarged image corresponding to the pixels of the pre-enlargement image, and to enter the target pixel section. The configuration may be such that the enlarged edge position information indicating the position of the edge of the target pixel section is obtained so that the number of edges of the image is equal to or less than a predetermined number. Since the number of edges of the enlarged image included in the pixel section does not exceed the predetermined number, the process of generating information representing the edge region of the enlarged image can be speeded up. If the number of edges of the enlarged image included in the pixel section is set to 2 or less, information representing the edge area of the enlarged image can be generated at a high speed while maintaining good accuracy for the edge position of the enlarged image. .
Needless to say, the number of edges of the enlarged image entering the pixel section may be set to 3 or less in order to more reliably obtain good edge position accuracy, or the pixel section may be entered in order to generate edge information at higher speed. The edge of the enlarged image may be 1 or less.
[0019]
The position obtaining means performs an operation of performing Gaussian blurring on the image data of the pixel of interest and pixels located in the vicinity thereof while sequentially moving the pixel of interest on the pre-enlargement image, and the Gaussian blurring is performed. The edge position information may be obtained based on the image data. By performing the Gaussian blur, noise is removed, so that the accuracy is further improved, and information indicating the position of a smoother edge can be generated.
Note that a pixel located in the vicinity of the target pixel may or may not be adjacent to the target pixel.
[0020]
The above-described edge generation apparatus may be implemented independently, or may be implemented together with another method while being incorporated in a certain device, and the idea of the invention includes various aspects. It can be changed as appropriate.
The invention also exists in a method for performing processing corresponding to the above-described means according to a predetermined procedure. Therefore, the present invention is also applicable as a control method of the edge generation device, and the same effect is basically obtained in the invention according to claim 11.
Furthermore, the present invention can also be applied as a print control device that performs print control on a printing device that performs printing based on image data of an enlarged image reflecting the generated edge information (image data representing an enlarged image; the same applies hereinafter). Alternatively, the present invention can be applied to a printing system including the printing control device and the printing device, and basically has the same operation.
[0021]
When implementing the present invention, a predetermined program may be executed by the above-mentioned device. Therefore, the present invention can be applied as a control program of the edge generation device, and the invention according to claim 12 basically has the same operation. Further, a medium on which the program is recorded may be distributed, and the program may be read from the recording medium into a computer as appropriate. That is, the present invention can be applied as a computer-readable recording medium on which the program is recorded, and basically has the same operation.
Of course, it is also possible to make the configuration described in claims 2 to 9 correspond to the method, the print control device, the printing system, the program, and the medium on which the program is recorded.
Here, the recording medium may be any recording medium to be developed in the future, in addition to a magnetic recording medium and a magneto-optical recording medium. The duplication stage of the primary duplicated product, the secondary duplicated product, etc. does not matter. The scope of the present invention includes a case in which a part is realized by hardware, and a case in which a part is recorded on a recording medium and read as needed.
[0022]
BEST MODE FOR CARRYING OUT 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 edge generation device:
(3) Processing performed by the edge generation device:
(3-1) Zero cross detection processing:
(3-2) Zero cross connection processing:
(4) Modification:
[0023]
(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, an inkjet printer 20 capable of printing in color, which is a printing device, and the like. Note that the PC 10 is an edge generation device according to the present invention in the sense of generating edge information representing an edge region of an enlarged image. Further, the print control device is a means for generating image data of an enlarged image reflecting the generated edge information and causing the printer 20 to print a corresponding output image.
The PC 10 includes a CPU 11 which is a 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 the present embodiment, a computer having a general configuration can be employed as the computer.
[0024]
The HD 14 stores an operating system (OS), an application program (APL) capable of creating image information, and the like. At the time of execution, the CPU 11 transfers the software to the RAM 13 as appropriate, and executes the program while appropriately accessing the RAM 13 as a temporary work area.
A digital camera 30, a color scanner (not shown), and the like are connected to the peripheral device I / F (PIF) 17a. The digital camera 30 is capable of generating image data that expresses a captured image using a dot matrix of pixels in gradations and outputting the image data to the PC 10. A display 18a that displays an image based on image data is connected to the CRTI / F 17b, and a keyboard 18b and a mouse 18c are connected as input devices for operation to the input I / F 17c. 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.
[0025]
The printer 20 uses the inks of C (cyan), M (magenta), Ye (yellow), and K (black) to correspond to the gradation values constituting the image data on the printing paper (printing medium). The ink is discharged so as to have the ink amount, and the image is printed. Of course, a printer using inks other than four colors may be adopted. Further, various printing apparatuses such as a bubble-type printer that generates bubbles in an ink passage to discharge ink and a laser printer can be employed.
As shown in FIG. 2, in the printer 20, a CPU 21, a ROM 22, a RAM 23, a communication I / O 24, a control IC 25, an ASIC 26, an 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 data converted into CMYeK and a print job including a 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 and receiving predetermined signals to and from the CPU 21. The head driving unit 26a generates an applied voltage pattern to a piezo element incorporated in the print head based on the applied voltage data, and causes the print head to discharge CMYeK ink. A carriage mechanism 27a and a paper feed mechanism 27b connected to the I / F 27 cause the print head to perform main scanning, and sequentially feed media while performing a page break operation as appropriate to perform sub-scanning. Then, the CPU 21 controls each unit according to the program written in the ROM 22 while using the RAM 23 as a work area.
[0026]
In the PC 10, the BIOS is executed based on the above hardware, and the OS and the APL are executed on the BIOS. Various drivers such as a printer driver for controlling the printer I / F 17e are incorporated in the OS, and control the hardware. The printer driver can perform bidirectional communication with the printer 20 via the printer I / F 17e, receives image data from the APL, creates a print job, and sends it to the printer 20. The edge generation program of the present invention is configured by the APL, but may be configured by 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 bar code is printed. It may be. Of course, it is also possible to download and execute the above-described control program stored in a predetermined server from the communication I / F 17d via the Internet network.
Then, the hardware and the program cooperate to construct an edge generation device.
[0027]
(2) Outline of configuration of edge generation device:
FIG. 3 schematically shows the outline of the configuration of the edge generation device. The edge generation program that causes the PC to function as the edge generation device U0 is composed of a plurality of modules corresponding to various units described below.
The edge generation device U0 includes a position acquisition unit U1 that roughly acquires a zero-cross position Z (edge position information D3) representing the position of an edge corresponding to the position of each pixel I1u of the pre-enlargement image I1, and the acquired zero-cross. And edge generation means U2 for generating edge information D5 representing an edge area of the enlarged image I2 based on the position Z. When performing image enlargement etc., the appearance of the enlarged image will be completely different due to the processing of the edge part, and creating an enlarged edge image with less jaggedness is very important in the image enlargement process is there. The present apparatus creates a clean edge line with less jaggies by both means U1 and U2.
[0028]
The image data D1 of the pre-enlargement image is data that expresses the pre-enlargement image in gradations using a large number of pixels in a dot matrix, and is data indicating the brightness of the pre-enlargement image. The gradation data D8 of the present 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), B (Blue) RGB data or the like. Further, each component of YCbCr will be described as having 256 gradations, but may be 1024 gradations, 100 gradations, or the like.
The position obtaining means U1 calculates and obtains a zero-cross position Z based on the luminance value Y of the image data D1. At this time, while sequentially moving the pixel of interest on the pre-enlargement image I1, a calculation for performing a known Gaussian blur on the image data of the pixel of interest and pixels located in the vicinity thereof is performed. Next, while sequentially moving the pixel of interest on the pre-enlarged image subjected to Gaussian blurring, the image data of the pixel of interest and its surrounding pixels are subjected to an arithmetic operation using a known Laplacian filter to perform the calculation using the known Laplacian filter. And generates intermediate data D2 expressed in gradation corresponding to each pixel I1u. In the edge detection by the Laplacian filter, the zero cross position Z can be obtained in a unit of a pixel or less. Then, while sequentially moving the target pixel on the dot matrix-shaped pixel corresponding to the intermediate data D2, the intermediate data is reduced to approximately 0 based on the position of the target pixel and a pixel located in the vicinity thereof and the intermediate data. Edge position information D3 indicating the position to be changed, that is, the zero-cross position Z is acquired. When the pixel I1u of the image before enlargement is placed on the xy plane, the zero-cross position Z is a coordinate representing an edge position corresponding to the position of each pixel I1u of the image before enlargement in a unit smaller than the pixel I1u of the image before enlargement. Value.
[0029]
Note that, besides 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 RGB gradation values, or the luminance value Y is calculated by the following equation. Then, the zero-cross position Z may be obtained 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.
[0030]
The edge generation means U2 obtains enlarged edge position information D4 indicating the position of the edge of the enlarged image I2 corresponding to the position of the edge of the image I1 before enlargement based on the zero cross position Z, and the acquired enlarged position acquiring means U21. And a linking unit U22 that links adjacent edges of the enlarged image I2 based on the enlarged edge position information D4 to generate edge information D5 representing an edge area of the enlarged image I2.
The enlarged position acquisition unit U21 sequentially moves the target pixel section on the enlarged image I2 for each pixel section I2d (3 × 3 pixels in the figure) obtained by dividing the pixel I2u of the enlarged image I2 corresponding to the pixel I1u of the image before enlargement. Then, enlarged edge position information D4 indicating the position of the edge of the target pixel section is acquired. That is, it calculates which pixel after the enlargement the zero-cross position Z corresponds to, and sets the position as the zero-cross position after the enlargement (enlarged edge position information D4). When the pixel I2u of the enlarged image is placed on the xy plane, the enlarged edge position information D4 is a coordinate value representing an edge position corresponding to the position of each pixel I2u of the enlarged image in units of the pixel I2u of the enlarged image. I have.
[0031]
When generating the edge information D5, the connecting unit U22 first moves the target pixel on the pre-enlargement image I1 while sequentially moving the target pixel into a 3 × 3 pixel centered on the target pixel (the target pixel and its neighboring pixels). Is binarized to generate binarized data D6. Next, the direction of the edge is determined based on the binarized data D6 and a plurality of predetermined matching patterns. The matching pattern according to the present embodiment is a 3 × 3 pattern corresponding to the direction of the edge. Further, connection position information D7 for connecting the edges of the neighboring enlarged images I2 so as to have the determined edge directions is obtained. The connection position information D7 is information indicating a position of a pixel to be an edge region of the enlarged image. By using the matching pattern, it is possible to connect only in an appropriate direction using the pattern matching result at the time of connection, and it is possible to obtain an edge in the enlarged edge image with a high-definition thin line. Then, the edge information D5 is generated by combining the enlarged edge position information D4 and the connection position information D7. When the pixel I2u of the enlarged image is placed on the xy plane, the edge information D5 is a set of coordinate values representing an edge area corresponding to the position of each pixel I2u of the enlarged image in units of the pixel I2u of the enlarged image. I have.
[0032]
In the related art, since the position of the edge is detected for each pixel of the image before enlargement, the accuracy of the edge position of the enlarged image is not good, and jaggies are conspicuous at the edge of the enlarged image. Since the edge information generated by the edge generation device U0 represents an edge region in pixel units of the enlarged image, it is possible to easily perform processing such as sharpening by forming edges of the enlarged image with fine lines with high accuracy. In addition to the above, it is possible to reduce the jaggies of edges, and to create an enlarged edge image with high accuracy and a small amount of calculation.
[0033]
(3) Processing performed by the edge generation device:
Hereinafter, the operation will be described in detail along with the processing performed by the edge generation device.
FIG. 4 is a flowchart illustrating processing performed by the edge generation device. Specifically, the CPU 11 of the PC 10 performs this processing.
First, a zero-cross detection process for obtaining the zero-cross position Z is performed by the position obtaining unit and the enlarged position obtaining unit (Step S105; hereinafter, the description of “Step” is omitted). Next, the connecting means performs a zero cross connecting process of connecting the zero crosses to generate edge information (S110), and ends the flow. Thereafter, if the image data of the enlarged image is generated based on the generated edge information, the enlarged image corresponding to the image data is displayed on the display, and the image data is output to the printer 20 by outputting the image data to the printer 20. A corresponding enlarged image can be printed.
[0034]
(3-1) Zero cross detection processing:
FIG. 5 is a flowchart showing the zero-crossing detection process.
First, as schematically shown in FIG. 3, Gaussian blur processing is performed to perform Gaussian blurring on image data that expresses an image before enlargement in a dot matrix in the form of gradation data for each pixel (S205).
[0035]
FIG. 6 is a flowchart showing the Gaussian blur processing.
First, image data for expressing the pre-enlargement image by a large number of YCbCr data for each pixel is input (S305). When inputting image data from the digital camera 30 or the like, it is not necessary to read the entire data at once, and it may be partially read, or used for data transfer when called from another APL. Only a pointer indicating the buffer area to be transferred may be passed.
Next, the position of the target pixel is set on the image before enlargement (S310). In the present embodiment, the order of setting the position of the pixel of interest is, starting from the upper left pixel, sequentially up to the upper right pixel, and then, one by one, starting from the lower left pixel to the right pixel, and finally. It is the lower right pixel. Hereinafter, 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 target pixel is set can be changed as appropriate, and may be different depending on the type of the pre-enlargement image and the like.
[0036]
Further, as shown in FIG. 7, the luminance value Y (image data) of the target pixel and 3 × 3 pixels (predetermined area) located in the vicinity thereof is acquired (S315). In the example of the figure, the luminance value d5 of the target pixel and the luminance values d1 to d4 and d6 to d9 of eight pixels located in the vicinity thereof are obtained.
As shown in the upper part of FIG. 8, when the target pixel is located at the end of the pre-enlargement image, the luminance value of the pixel at the end of the pre-enlargement image is outside the pre-enlargement image (returned). ) To obtain the luminance value.
[0037]
Then, the Gaussian blur calculation is performed using the well-known Gaussian blur calculation filter F1 shown in the flow of FIG. 6 (S320). Here, as shown in FIG. 7, an operation filter F for performing a filter operation has coefficients f1 to f9 corresponding to each of 3 × 3 pixels to be referred to, and image data corresponding to each pixel. The sum of the respective coefficients d1 to d9 is multiplied by the same coefficient to calculate the gradation data d 'of the target pixel after the filter operation. Actually, as shown in the following equation, the sum is multiplied by a predetermined coefficient (k) to obtain data d ′ after the filter operation.
Figure 2004207923
In the case of a filter in which the sum 係数 fi of the coefficients f1 to f9 is 0, such as a Laplacian filter described later, k = 1. In the case of a filter in which the sum Σfi of the coefficients f1 to f9 is 0, such as the filter F1 for Gaussian blur operation, In this case, k = 1 / Σfi.
[0038]
It should be noted that various filters can be employed as the Gaussian blur calculation filter according to the type of the pre-enlargement image and the like. For example, a 5 × 5 pixel filter may be used to convert the image into a smoother and less noisy image, or f2 among the coefficients of the calculation filter F shown in FIG. , F4, f5, f6, f8 only.
Of course, a Gaussian blur operation that does not fall within the concept of the filter operation may be performed.
Thereafter, it is determined whether or not the Gaussian blur calculation has been performed for all the pixels of the image before enlargement (S325). In the case where the pixels for which the Gaussian blurring operation has not been performed remain, the Gaussian blurring is performed on the image data of the target pixel and the pixels located in the vicinity thereof by repeating steps S <b> 310 to S <b> 325 while sequentially moving the target pixel on the image before enlargement. Is performed. If the Gaussian blur operation has been performed for all the pixels, the flow is terminated.
Then, as shown in the middle part of FIG. 8, the image data D1 ′ after the Gaussian blur processing is generated from the image data D1 of the pre-enlargement image. The image data D1 ′ on which the Gaussian blurring processing has been performed is data that is expressed in gradation by using a dot matrix pixel corresponding to each pixel of the original pre-enlargement image.
[0039]
When the Gaussian blur processing is completed, the process proceeds to S210 in FIG. 5, where the zero-cross position Z is acquired based on the image data on which the Gaussian blur has been performed, and edge information representing the edge region of the enlarged image is generated.
Although it is possible to generate edge information without performing Gaussian blur processing, noise is removed by performing Gaussian blur processing, so that the accuracy of edge positions is improved, and smoother edges can be generated. Information representing a position can be generated. Here, the Gaussian blur processing is preferably performed with a relatively small intensity Gaussian blur processing such as the above-described processing using the filter F1 in order to remove noise of the image before enlargement.
[0040]
In S210 in FIG. 5, a Laplacian filter calculation process using a Laplacian filter is performed on the image data on which the Gaussian blurring process has been performed.
FIG. 9 is a flowchart illustrating the Laplacian filter calculation process.
First, the position of the pixel of interest is set on the pre-enlargement image that is toned with the image data subjected to the Gaussian blurring processing (S405). Next, as shown in FIG. 7, the luminance values d1 to d9 of the target pixel and 3 × 3 pixels located in the vicinity thereof are acquired (S410).
As shown in the middle part of FIG. 8, when the target pixel is located at the end of the pre-enlargement image, the luminance value of the pixel at the end of the pre-enlargement image is determined to be outside the pre-enlargement image. get.
Then, a Laplacian filter operation is performed using the known eight-direction Laplacian filter F2 shown in the flow of FIG. 9, and the intermediate data D2 gradationally expressed by the pixels in the dot matrix form as schematically shown in FIG. Is generated (S415).
[0041]
Here, all the coefficients f1 to f4 and f6 to f9 around the coefficient f5 of the filter F2 corresponding to the target pixel are set to 1, and the coefficient f5 at the center is the sign of the sum of the coefficients f1 to f4 and f6 to f9. It is set to -8 which is reversed. That is, by performing the filter operation using the filter F2, the sum of the differences between the luminance value of the pixel around the target pixel and the luminance value of the target pixel is calculated as in the following equation, and the Laplacian filter operation is performed. Is the gradation data d ′.
d ′ = Σ (di−d5) (3)
However, i = 1 to 4, 6 to 9.
As described above, by performing the Laplacian filter operation, the difference between the image data of the target pixel and the pixel located in the vicinity thereof is calculated, and the position of the edge present in the vicinity of the target pixel is represented based on the calculation result. The zero cross position Z can be obtained.
[0042]
It should be noted that various filters can be employed as the Laplacian filter according to the type of the pre-enlargement image and the like.
As shown in the upper part of FIG. 10, an eight-way Laplacian filter having the opposite sign to the above-described filter F2 may be used, or as shown in the lower part of FIG. A four-way Laplacian filter including only f2, f4, f5, f6, and f8 among the coefficients of the illustrated calculation filter F may be used.
Of course, instead of performing the Laplacian filter operation, the operation may be performed using a filter such as a difference filter in the vertical and horizontal directions, or a difference operation that does not fall within the concept of the filter operation may be performed.
[0043]
Then, it is determined whether the Laplacian filter operation has been performed for all the pixels of the pre-enlargement image on which the Gaussian blur processing has been performed (S420). If there remains a pixel on which the Laplacian filter operation has not been performed, the image data of the pixel of interest and the pixels located around the pixel of interest are repeatedly moved by repeating steps S405 to S420 while sequentially moving the pixel of interest on the same pre-enlargement image. An intermediate data is generated by performing an operation using a filter. When the Laplacian filter operation has been performed for all the pixels, this flow ends.
Then, as shown in the lower part of FIG. 8, intermediate data D2 is generated from the image data D1 ′ after the Gaussian blur processing. The intermediate data generated by performing the Laplacian filter operation processing is data that is expressed in gradation by using a dot matrix-shaped pixel corresponding to each pixel of the original pre-enlargement image.
[0044]
Thereafter, the process proceeds to S215 in FIG. 5, where the zero-cross position Z is acquired based on the intermediate data generated by the Laplacian filter operation processing, and edge information representing the edge region of the enlarged image is generated.
By performing the Laplacian filter operation processing and detecting the position of the edge, information representing the position of the edge can be accurately obtained with a simple configuration, and information representing the edge region of the enlarged image can be accurately generated. Can be.
[0045]
After performing the Laplacian filter operation processing, a buffer area for storing the zero cross position Z is secured in the RAM (S215). Next, the position of the target pixel is set on the dot matrix pixel corresponding to the generated intermediate data (S220 in FIG. 5). Then, it is determined whether or not the sign of the intermediate data of the target pixel and the sign of the intermediate data of the pixel located on the right (neighbor) of the target pixel (neighboring pixel) are different (S225). Here, since the setting order of the target pixel is from left to right, the pixel on the right side is not set as the target pixel, and it is meaningful to determine whether there is a zero crossing with the current target pixel. . If the signs are not different, since there is almost no zero cross between the target pixel and the right neighboring pixel, the process proceeds to S250 without performing the zero cross position calculation processing of S245.
[0046]
If it is determined in S225 that the sign is different, at least one of the absolute value of the intermediate data of the pixel of interest, which is the current position, and the absolute value of the intermediate data of the pixel on the right side is a predetermined value in order to determine whether to calculate the zero cross position. It is determined whether or not is equal to or more than the threshold value L1 (S230). Of course, it may be determined whether the value is larger than the threshold value L1. 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, for example, 128 which is a substantially intermediate value of 256 gradations. If at least one of the absolute values is equal to or larger than the threshold value L1, it is determined that the zero cross position should be calculated, and the process proceeds to S245 to perform the zero cross position calculation process. Since the edge exists mainly when the difference between the luminance values of the two pixels is large and the sign of the intermediate data is different, it is possible to obtain information representing the position of the edge with high accuracy. It is possible to generate information representing an edge area of the enlarged image.
[0047]
If the absolute value of the intermediate data of the pixel of interest and the absolute value of the intermediate data of the pixel on the right side are both smaller (or less) than a predetermined threshold, Gaussian blurring is performed to determine whether or not to calculate a further zero-cross position. The difference (the degree of difference in image data) between the maximum value and the minimum value of the luminance values of 3 × 3 pixels (the pixel of interest and its surrounding pixels) centering on the pixel of interest on the processed pre-enlargement image is obtained ( S235). Note that the difference between the maximum value and the minimum value of the luminance value of 3 × 3 pixels centering on the target pixel on the pre-enlargement image before the Gaussian blur processing is performed may be obtained. Then, it is determined whether or not the obtained difference is equal to or greater than a predetermined threshold L2 (S240). Of course, it may be determined whether the value is larger than the threshold value L2. When the luminance value of the pre-enlargement image after the Gaussian blur processing has 256 gradations, the threshold value L2 may be set to, for example, 50 or the like. When the difference between the maximum value and the minimum value of the luminance value is equal to or larger than the threshold value L2, it is determined that the zero cross position should be calculated, and the process proceeds to S245 to perform the zero cross position calculation process. As a result of performing the Laplacian filter operation processing because the difference between the luminance value of the target pixel and the pixel on the right side is small, even if a zero cross cannot be detected in S230, the luminance value of the 3 × 3 pixel centering on the target pixel is obtained. Since the difference may be large, the detection accuracy of the zero cross can be improved. That is, information representing the position of the edge can be acquired with high accuracy, and as a result, information representing the edge region of the enlarged image can be generated with high accuracy.
On the other hand, if the difference between the maximum value and the minimum value of the luminance value is smaller (or less) than the threshold value L2, it is determined that there is no need to calculate the zero-cross position, and the zero-cross position calculation process of S245 is performed. Instead, the process proceeds to S250.
The degree of difference between the image data of the target pixel and the surrounding pixels is determined based on the combination of the maximum value and the minimum value, such as the difference between the maximum value and the minimum value, in addition to the second largest value and the second largest value. Various values such as a value based on a combination with a small value, a value obtained by combining an intermediate value with the value, and the like can be adopted.
[0048]
In the example shown in FIG. 8, when the pixel of interest on the pixel corresponding to the intermediate data D2 is x = 2, y = 1, the intermediate data of the pixel of interest is −170, and the intermediate data of the pixel on the right is 4 Therefore, the condition is satisfied in S225. Further, since the absolute value of the intermediate data of the target pixel is 128 or more, the condition is also satisfied in S230, and it is determined that an edge exists because the intermediate data of the target pixel and the right adjacent pixel are suddenly changed, and the zero cross position calculation processing is performed. Will do.
When the pixel of interest on the pixel corresponding to the intermediate data D2 is x = 1 and y = 2, the intermediate data of the pixel of interest is −125 and the intermediate data of the pixel on the right is 53. It is established. However, since the absolute values of the intermediate data of the target pixel and the right neighboring pixel are both smaller than 128, the condition is not satisfied in S230. Here, the luminance value of 3 × 3 pixels centered on the target pixel on the pre-enlargement image after the Gaussian blur processing is 214 (maximum value), 206, 181, 206, 171, 111, 161, 108, 56 (minimum value). Value), the difference between the maximum value and the minimum value is 214−56 = 158, which is 50 or more, the condition is satisfied in S240, and the luminance value suddenly changes in a 3 × 3 pixel region centered on the target pixel. Therefore, it is determined that an edge exists, and a zero-cross position calculation process is performed.
[0049]
FIG. 11 is a flowchart illustrating the zero-cross position calculation process performed in S245.
First, an enlargement ratio M from an image before enlargement to an enlarged image is acquired (S505). For example, a print interface screen having a resolution selection field may be displayed on a display, 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 M times and the number of pixels in the vertical direction (y direction) is also 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.
[0050]
Next, assuming that the position of the pixel reflecting the enlargement factor M is X1 and the intermediate data of the pixel is Y1, X1 and Y1 of the pixel of interest and the neighboring pixel (the right neighboring pixel in the case where this processing is performed in S245) are X1 and Y1. A1 and B1 of the relational expression Y1 = A1.X1 + B1 are calculated (S510). That is, from the result of applying the Laplacian filter of the two points of the target pixel and the adjacent pixel, an equation of a straight line passing through the two points is obtained. Here, the pixel position X1 is a horizontal x coordinate on the enlarged image when a straight line equation is obtained for the two points of the target pixel and the right neighboring pixel. When the equation of the straight line is obtained, it is the vertical y-coordinate on the enlarged image. Assuming that the intermediate data of the target pixel is LP0, the intermediate data of the adjacent pixel is LP1, and the position of the target pixel 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)
[0051]
When A1 and B1 are calculated, a zero-cross position Z1 reflecting the enlargement ratio M is calculated by the following equation (S515).
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 image before enlargement. Since the value is obtained by multiplying the position of the pixel of the image before enlargement by the enlargement ratio M, the zero cross position Z1 is edge position information indicating the position of the edge corresponding to the position of each pixel of the image before enlargement.
With the above processing, it is possible to acquire edge position information indicating a position where the intermediate data is set to substantially 0 based on the position of the pixel of interest and the pixels located in the vicinity thereof and the intermediate data.
[0052]
When the zero-cross position Z1 is calculated, an edge position Z1 ′ (a type of enlarged edge position information) of the enlarged image corresponding to the edge position of the image before enlargement is acquired based on the zero-cross position Z1 (S520). The position Z1 'of the edge of the enlarged image can be calculated by the following equation.
Z1 ′ = INT (Z1) (7)
Here, INT is a function for rounding down decimal places. That is, Z1 'is numerical information indicating the position of the edge of the enlarged image in pixel units of the enlarged image.
[0053]
FIG. 12 schematically shows how to acquire enlarged edge position information when the enlargement ratio M is 3.
At x = 1, y = 2 of the pre-enlargement image, there is a target pixel 51 of intermediate data LP0 = −125, and at x = 2, y = 2 on the right of the target pixel, an adjacent pixel 52 of intermediate data LP1 = 53. Suppose there is. Here, where the zero cross 56 exists in the blocks (pixel divisions) 54 and 55 obtained by dividing the pixels of the enlarged image corresponding to the pixels of the image before enlargement is obtained by using the above equations (4) to (6). . In other words, it is necessary to determine where the zero cross 53 exists on the dot matrix pixel represented by the intermediate data corresponding to the image before the enlargement. It is assumed that there is 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 shown in the X1-Y1 graph shown in the lower part of the middle of the figure, a straight line connecting the target pixel and the adjacent pixel on the X1 (x-coordinate or y-coordinate of the pixel) -Y1 (intermediate data) plane intersects the X1-axis. A point (a point where Y1 = 0) is a zero cross. In the above example, since x0 = 1, A1 = {53 − (− 125)} / 3 = 59.3 and B1 = −125−59.3 × (1 × 3 + 3/2) = − 392.0. , The zero-cross position is Z1 = − (− 392.0) /59.3=6.6.
Finally, using the above equation (7), Z1 ′ = INT (6.6) = 6. Therefore, the enlarged edge position information 57 is information indicating the positions of the pixels of x = 6 and y = 7 on the left side in the adjacent block 55.
[0054]
If the intermediate data LP0 of x = 1 and y = 2 of the pre-enlargement image is 2, and the intermediate data LP1 of x = 2 and y = 2 is -215, A1 = (− 215-2) / 3 = −72.3, B1 = 2 − (− 72.3) × (3 × 3 + 3/2) = 761.5, Z1 = −761.5 / (− 72.3) = 10.5, and Z1 '= INT (10.5) = 10. That is, the enlarged edge position information 57 is information representing the position of the pixel at x = 4, y = 7 at the center in the block of interest 54.
As described above, the enlarged edge position information is information representing the position of a pixel in units of pixels smaller than the block of the enlarged image. In the conventional case where the position of the edge is detected in pixel units of the image before the enlargement, the entire block of the enlarged image is set as the edge position, or only the predetermined position in the block is set as the edge position. The accuracy of the edge position was not good, and jaggies were conspicuous at the edges of the enlarged image. According to the present invention, the accuracy of the edge position of the enlarged image is improved, and the jaggies of the edges of the enlarged image are less noticeable.
[0055]
When the position of the edge of the enlarged image is obtained, it is determined whether the number of edges in the block of the enlarged image is equal to or smaller than a predetermined number (S525). There may be a maximum of four edges in the block, but tests have shown that if the predetermined number is 2, the information representing the edge area of the enlarged image is generated at high speed while maintaining good accuracy. We were able to. If the number of edges in the block is equal to or less than the predetermined number, the coordinate value (a type of enlarged edge position information) of the edge on the enlarged image corresponding to the edge position Z1 'of the enlarged image is stored in the buffer (S530). This flow ends. If the same coordinate value is stored in the buffer, the process of storing information representing the edge area of the enlarged image is speeded up by omitting the process of storing the edge coordinate value in the buffer. I have. In this way, enlarged edge position information can be obtained. On the other hand, if the number of edges in the block is larger than the predetermined number, the flow ends without performing the processing of S530. Since the pixel of interest is sequentially moved on the pre-enlargement image, the position of the edge of interest is moved so that the edge of the enlarged image entering the block of interest becomes a predetermined number or less while sequentially moving the block of interest on the enlarged image. This means that the represented enlarged edge position information has been acquired.
[0056]
By ignoring the third and subsequent zero crossings detected in the same block in the above process, the number of edges of the enlarged image entering the block can be suppressed to a predetermined number or less. The generation process can be sped up. Of course, if a storage buffer for storing the coordinate values of four zero crosses for one block is prepared, information representing the edge area of the enlarged image can be generated with very high accuracy using all the detected zero crosses. It is possible to do.
[0057]
By the way, as shown in FIG. 13, the zero-cross position (the position of the zero-cross 53 in FIG. 12) is calculated using the relational expression between the pixel position and the intermediate data on the pre-enlargement image that does not reflect the enlargement ratio M, and Edge position information may be obtained.
First, assuming that the position of a pixel on the image before enlargement is X0 and the intermediate data of the pixel is Y0, the relational expression Y0 = A0.X0 + B0 between A0 and Y0 of the target pixel and the adjacent pixel is calculated (S555). . Assuming that the intermediate data of the target pixel is LP0, the intermediate data of the adjacent pixel is LP1, and the position of the target pixel on the image before enlargement is x0, A0 and B0 can be calculated by the following equations.
A0 = LP1-LP0 (8)
B0 = LP0−A1 × (x0 + /) (9)
After calculating A0 and B0, the zero-cross position Z0 is calculated by the following equation (S560).
Z0 = −B0 / A0 (10)
Here, Z0 is a value having information after the decimal point, and is a unit finer than the pixel of the image before enlargement. The zero-cross position Z0 is edge position information indicating an edge position corresponding to the position of each pixel of the pre-enlargement image.
[0058]
When the zero-cross position Z0 is calculated, the enlargement factor M is obtained (S565), and the edge position Z0 'of the enlarged image corresponding to the edge position of the image before enlargement is calculated and obtained by the following equation (S570).
Z0 ′ = INT (Z0 × M) (11)
That is, Z0 'is numerical information indicating the position of the edge of the enlarged image in pixel units of the enlarged image.
When the position of the edge of the enlarged image is obtained, it is determined whether the number of edges in the block of the enlarged image is equal to or less than a predetermined number (S575). If the number of edges in the block is equal to or less than the predetermined number, the coordinate values of the edge on the enlarged image corresponding to the edge position Z0 'of the enlarged image are stored in the buffer (S580), and this flow ends. Even in this manner, enlarged edge position information can be obtained. On the other hand, if the number of edges in the block is larger than the predetermined number, the flow ends without performing the processing of S580.
[0059]
When the zero cross position calculation processing is performed between the target pixel and the right neighboring pixel, the process proceeds to S250 in FIG. 5, and the same processing is performed between the target pixel and the lower neighboring pixel.
That is, it is determined whether or not the sign of the intermediate data of the target pixel is different from that of the intermediate data of the pixel (lower adjacent pixel) located below (nearby) the target pixel (S250). Here, since the setting order of the target pixel is repeated from left to right from top to bottom, the lower neighboring pixel is not set as the target pixel and there is a zero crossing with the current target pixel. It is meaningful to determine whether or not. If the signs are not different, the process proceeds to S275 without performing the zero-cross position calculation process in S270.
If it is determined in S250 that the sign is different, at least one of the absolute value of the intermediate data of the target pixel at the current position and the absolute value of the intermediate data of the lower neighboring pixel is equal to or greater than a predetermined threshold L3 (for example, 128) (or more). (S255). In this embodiment, L1 = L3, but L1 and L3 may be different values. If at least one of the two absolute values is equal to or greater than the threshold value L3, the process proceeds to S270 to perform a zero cross position calculation process.
[0060]
If the absolute value of the intermediate data of the pixel of interest and the absolute value of the intermediate data of the lower neighboring pixel are both smaller (or smaller) than a predetermined threshold, the pixel of interest is centered on the pre-enlargement image subjected to the Gaussian blurring process. Then, the difference between the maximum value and the minimum value of the luminance values of the 3 × 3 pixels is calculated (S260), and it is determined whether or not the calculated difference is equal to or larger than a predetermined threshold L4 (for example, 50) (S265). L2 and L4 may be different values. When the difference between the maximum value and the minimum value of the luminance value is equal to or larger than the threshold value L4 (or larger), the process proceeds to S270 to perform a zero-cross position calculation process. On the other hand, if the difference between the maximum value and the minimum value of the luminance value is smaller (or less) than the threshold value L4, it is determined that it is not necessary to calculate the zero cross position, and the zero cross position calculation processing of S270 is performed. Instead, the process proceeds to S275.
[0061]
When the zero-cross position calculation processing is performed in S270, it is determined whether or not the processing in S220 to S270 has been performed for all the pixels of the pre-enlargement image on which the Gaussian blur processing has been performed (S275). If there remains a pixel that has not been subjected to the same process, a process of repeatedly calculating the zero-cross position Z and acquiring enlarged edge position information in steps S220 to S275 while sequentially moving the pixel of interest on the same pre-enlargement image is performed. . When the same processing has been performed for all the pixels, the present flow ends. In this way, edge detection in raster scanning becomes possible, and the position of the edge can be obtained with high accuracy in units smaller than the pixels of the image before enlargement.
That is, the PC 10 that performs the processing of S205 to S240, S250 to S265, S275, and S505 to S515 in FIG. 11 constitutes a position acquisition unit, and the PC 10 that performs the processing of S520 to S530 in FIG. Constitute.
[0062]
(3-2) Zero cross connection processing:
When the zero-crossing detection process is completed, the process proceeds to S110 in FIG. 4, where a zero-cross connection process is performed.
FIG. 14 is a flowchart illustrating the above-mentioned zero cross connection processing.
First, the position of the pixel of interest is set on the pre-enlargement image after the Gaussian blurring processing (S605). Next, the position of the target block corresponding to the position of the target pixel is set for each 3 × 3 pixel block obtained by dividing the pixels of the enlarged image (S610).
[0063]
Further, as shown in FIG. 15, the luminance value (image data D1 ′) of 3 × 3 pixels (corresponding to a 3 × 3 block of the enlarged image) centering on the pixel of interest is binarized, and each pixel of the image before enlargement is converted. Is generated (S615). If the target pixel is at the end of the pre-enlargement image, the binarized data is generated on the assumption that the luminance value of the pixel at the end of the pre-enlargement image is outside the pre-enlargement image. In this embodiment, an average value of the maximum value and the minimum value of the luminance values of the 3 × 3 pixels is set as the threshold value L5, and if the luminance value of each pixel is equal to or more than (or larger than) the threshold value L5, The binarized data is set to 1 and the binary data is set to -1 when the binarized data is smaller (or less) than the threshold value L5.
Thereafter, it is determined whether or not a zero cross, which is a pixel unit of the enlarged image, that is, an edge exists in the target block of the enlarged image (S620). If there is no edge in the block of interest (the coordinate value of the corresponding edge on the enlarged image is not stored in the buffer), it is not necessary to perform the process of connecting the edges on the enlarged image, and the process proceeds to S655.
[0064]
If there is an edge in the block of interest, it is determined whether there are a plurality of edges in the block of interest (S625). If there are a plurality of edges, an edge generation process described later is performed (S630), and the process proceeds to S635. If there is only one edge, the process immediately proceeds to S635.
In S635, it is determined whether or not a zero cross exists in any of the block on the right of the target block, the block on the lower left, the block on the lower side, and the block on the lower right. Since the setting order of the block of interest is repeated from left to right from top to bottom, these adjacent blocks are not set as the block of interest and it is meaningful to determine whether or not a zero cross exists. In the present embodiment, when the block of interest is located at the end of the enlarged image and the adjacent block is outside the enlarged image, the process of connecting edges is not performed for the adjacent block on the assumption that there is no zero crossing. As a matter of course, a process of linking edges may be performed assuming that an edge in a block at the end of the enlarged image is outside (folded back) the image before enlargement.
If there is no zero crossing in these adjacent blocks, there is no need to perform a process of connecting edges on the enlarged image, so the process proceeds to S655.
If a zero cross exists in the adjacent block, the direction of the edge is determined based on the binarized data and a plurality of predetermined matching patterns, and information representing the direction of the edge is obtained (S640).
[0065]
FIG. 16 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. Have been. In addition, a plurality of types of matching patterns for 60 degrees, 135 degrees, 180 degrees, and the like are prepared. Of course, the matching patterns are not limited to those shown in the figures.
Whether the binarized data and the matching pattern match (match) will be described with reference to FIG. 7. The binarized data of each 3 × 3 pixel (d1 to d9) and each of the matching patterns Calculate the sum S1 = Σfi · di of the products with the element values (f1 to f9), and determine whether this sum S1 is equal to the sum S2 of the absolute values of the element values of the matching pattern = パ タ ー ン | fi | Judge by When S1 = S2, the inclination of the edge of the pre-enlargement image matches the matching pattern, and information indicating the direction of the edge corresponding to the matched matching pattern is obtained.
[0066]
In the example of FIG. 15, when the sum S1 of the binarized data D6 and the 90-degree matching pattern of “90-1” in FIG. 16 is calculated, it becomes −2. Since the sum S2 of the absolute values of the elements in the matching pattern of “90-1” is 6, the binarized data D6 does not match (does not match) with the matching pattern of “90-1”. On the other hand, when the sum S1 of the binarized data D6 and the 30-degree matching pattern “30-12” in FIG. 16 is calculated, it becomes 5. Since the sum S2 of the absolute values of the elements in the matching pattern of “30-12” is 5, the binarized data D6 matches (matches) the matching pattern of “30-12”. In this case, the direction of the edge is determined to be 30 degrees.
As described above, the edges of the enlarged image can be reliably connected to each other with a simple configuration using a matching pattern, and the processing of reliably forming the edges of the enlarged image with fine lines can be performed at high speed. Become.
[0067]
Needless to say, in addition to using the matching pattern, the direction in which the difference between the two pixel values (brightness value difference, RGB value difference, difference between each color value, etc.) becomes smaller may be determined as the direction of the edge, or may be adjacent. The direction of the edge may be determined by reflecting the direction of the edge of the pixel, or the direction of the edge may be determined by reflecting the intensity of the edge of a neighboring pixel. Although the processing is complicated, the direction of the edge may be determined by introducing the concept of a vector. Further, the direction of the edge may be determined based on the combination thereof.
[0068]
When the direction of the edge is determined, it is determined whether or not 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 (S645). Specifically, an allowable range of the direction of the edge including the angle of the pattern is provided for each matching pattern, and the determination is made based on whether or not the direction of the straight line connecting both zero crosses falls within the allowable range. Here, the position of the edge in the block of interest on the xy coordinate plane on the enlarged image is (x1, y1), the position of the edge in the adjacent block is (x2, y2), and the slope of a straight line passing through the positions of both edges is When G is used, G can be calculated by the following equation.
G = (y2-y1) / (x2-x1) (12)
The lower limit value G1 and the upper limit value G2 of the allowable range of the gradient G of the straight line are provided for each matching pattern, and when G1 ≦ G ≦ G2 is satisfied, the direction of the edge of the corresponding matching pattern coincides. Judge it.
If there is a matching pattern having the same edge direction, the process proceeds to S650 to perform an edge generation process described later, and if there is no matching pattern having the same edge direction, the process proceeds to S655. When a plurality of edges exist in a certain adjacent block, an edge generation process is repeatedly performed so as to connect each edge to the edge in the target block.
[0069]
FIG. 17 is a flowchart illustrating the edge generation processing performed in S630 and S650.
First, it is determined whether or not the distance difference in the horizontal direction (x direction) between the two pixels that are edges on the enlarged image is equal to or greater than (or larger than) the distance difference in the vertical direction (y direction) (S705). . When the condition is satisfied, the process proceeds to S710, and when the condition is not satisfied, the process proceeds to S730. Since the gradient G of the straight line passing through the two pixels as edges is determined, if the absolute value of the gradient G is equal to or smaller than 1 (or smaller), the process proceeds to S710, and the absolute value of the gradient G is calculated. If it is greater than (or greater than) 1, the process may proceed to S730.
If the horizontal distance difference is equal to or greater than the vertical distance difference, first, the position of the horizontal pixel on the enlarged image is set (S710). Next, at the set horizontal position, the position of a pixel in the vertical direction as an edge area of the enlarged image is acquired (S715). 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 area (S720). Then, it is determined whether or not the next horizontal pixel position exists (S725). If there is a horizontal pixel position for which connection position information has not been acquired, the processes of S710 to S725 are repeatedly performed while sequentially moving the horizontal pixel position in pixel units. If the connection position information has been acquired for all the positions of the pixels in the horizontal direction, the process proceeds to S750.
[0070]
The left side of FIG. 18 illustrates a state where the connection position information is acquired when the horizontal distance difference is equal to or greater than the vertical distance difference. Here, the edge pixels 61a and 61b are pixels that are edged in pixel units of the enlarged image. Then, while sequentially moving the positions of the pixels in the horizontal direction in pixel units, 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. If the positions of the pixels in the vertical direction are sequentially moved in pixel units, one of the connected pixels 61c and 61d at the same position in the vertical direction is missed, so that a good edge line cannot be obtained. In the present invention, when the distance difference in the horizontal direction is equal to or greater than the distance difference in the vertical direction as shown on the left side of the figure, the omission of the connected pixel does not occur, so that a good edge can be obtained by a thin line.
[0071]
If the horizontal distance difference is smaller than the vertical distance difference, the position of the vertical pixel on the enlarged image is set (S730). Next, at the set vertical position, the position of a horizontal pixel to be an edge area of the enlarged image is acquired (S735). Further, the obtained coordinate value of the pixel is stored in the buffer as the connection position information (S740). Then, it is determined whether or not the next vertical pixel position exists (S745). When the position of the pixel in the vertical direction exists, the processing of S730 to S745 is repeatedly performed while sequentially moving the position of the pixel in the vertical direction in pixel units, and the connection position information is obtained for all the positions of the pixel in the vertical direction. To S750.
[0072]
The right side of FIG. 18 illustrates a state in which connection position information is obtained between the edge pixels 62a and 62b when the vertical distance difference is equal to or greater than the vertical distance difference. In this case, while sequentially moving the positions of the pixels in the vertical direction in pixel units, for example, the coordinate values of the pixels are acquired as the connection position information in the order of the connection pixels 62c, 62d, and 62e. Even when the distance difference in the horizontal direction is smaller than the distance difference in the vertical direction, missing of connected pixels does not occur, so that a good edge can be obtained by a thin line.
When the edge information is generated by connecting the edges of the neighboring enlarged images by the above processing, the edge of the enlarged image is generated for each pixel unit in the direction in which the distance difference between the horizontal direction and the vertical direction is large on the enlarged image. Information indicating the position of a pixel to be an area is obtained.
[0073]
In S750, edge information representing the edge area of the enlarged image is generated, including the connection position information acquired by the above processing, and the flow ends.
As shown in FIG. 19, the hatched position of the enlarged image I2 is the position of an edge pixel, and the position marked with a circle is the position of a connected pixel that has newly become an edge area as a result of the connection. . As a result of the zero-cross position calculation processing shown in FIG. 11, enlarged edge position information D4 indicating the position of an edge pixel that is a pixel unit of the enlarged image corresponding to the position of the image before enlargement has been acquired. The enlarged edge position information D4 and the connection position information D7 for connecting the edges are combined to generate edge information D5 representing an edge area after image enlargement.
In this way, it is possible to generate information representing an edge area of an enlarged image by connecting edges of adjacent enlarged images based on the enlarged edge position information. Then, the edges of the enlarged image can be reliably connected to each other with a simple configuration, and the edges of the enlarged image are reliably set as an edge area for each pixel between adjacent edges of the enlarged image. Can be formed with fine lines with high accuracy.
[0074]
When the edge generation processing of S650 in FIG. 14 ends, it is determined whether or not the processing of S605 to S650 for generating edge information has been performed for all blocks of the enlarged image (S655). If there remains a block on which the same process has not been performed, a process of sequentially moving the target pixel on the pre-enlargement image and sequentially moving the target block on the enlarged image to repeatedly generate edge information in steps S605 to S655 is performed. Do. When the same process has been performed for all blocks, the present flow ends.
[0075]
By the above-described processing, an edge region is formed for each pixel of the enlarged image. Therefore, it is possible to form the edge of the enlarged image with a fine line with high precision and easily perform processing such as sharpening. Jaggy can be reduced. 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. Of course, even if the magnification of the image is increased, a smooth edge can be obtained with a thin line. At this time, since it is not necessary to generate an enlarged image for edge detection in order to obtain information indicating the edge position, it is necessary to use a mathematical method such as an orthogonal transformation on the image data of the entire pre-enlarged image. It is not necessary to secure a large storage area for separately storing an enlarged image for edge detection, and information representing an edge area of an enlarged image can be generated with a small storage area.
Further, since the pattern matching process is performed only on the block where the edge exists, even if the number of patterns is increased, the speed of the process of generating the edge information can be reduced only slightly.
[0076]
Since a smooth edge corresponding to the enlarged image after the enlargement can be obtained, if this method is applied to the enlargement processing of the two-dimensional digital image, an enlarged image with less jaggies can be obtained.
In addition, since the edge position can be clearly understood, it is useful for edge sharpening processing.
[0077]
(4) Modification:
The edge generation 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 may have various configurations in addition to a dot matrix that is arranged vertically and horizontally. For example, the image data may be composed of dot-matrix pixels arranged neatly in a honeycomb pattern in which regular hexagons are densely arranged.
As described above, according to the present invention, according to various aspects, it is possible to easily perform processing such as sharpening by forming edges of an enlarged image with fine lines with high accuracy, and reduce jaggies of edges. It is possible to provide an edge generation device and an edge generation program capable of performing the above. Further, the present invention is also applicable as an edge generation 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 the printer.
FIG. 3 is a diagram schematically illustrating an outline of a configuration of an edge generation device.
FIG. 4 is a flowchart illustrating processing performed by the edge generation device.
FIG. 5 is a flowchart showing a zero cross detection process.
FIG. 6 is a flowchart showing Gaussian blur processing;
FIG. 7 is a diagram illustrating a state in which a calculation is performed using a calculation filter.
FIG. 8 is a diagram schematically showing a state in which intermediate data is generated from image data of an image before enlargement.
FIG. 9 is a flowchart illustrating a Laplacian filter calculation process.
FIG. 10 is a diagram showing a Laplacian filter.
FIG. 11 is a flowchart illustrating a zero cross position calculation process.
FIG. 12 is a diagram schematically showing how to acquire enlarged edge position information.
FIG. 13 is a flowchart illustrating a zero-cross position calculation process according to a modification.
FIG. 14 is a flowchart illustrating a zero cross connection process.
FIG. 15 is a diagram schematically illustrating a state in which binarized data is generated and an edge direction is determined.
FIG. 16 is a diagram schematically illustrating an example of a matching pattern.
FIG. 17 is a flowchart illustrating edge generation processing.
FIG. 18 is a diagram schematically showing a state of acquiring connection position information.
FIG. 19 is a diagram schematically showing how edge information is generated by combining enlarged edge position information and connection position information.
[Explanation 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 to e interface (I / F), 18a: display, 18b: keyboard, 18c: mouse, 20: inkjet printer, 30: digital camera, 51: target pixel, 52: adjacent pixel, 53, 56: zero cross, 54: target block, 55: adjacent Block, 57: enlarged edge position information, 61a, b, 62a, b: edge pixels, 61c to e, 62c to e: connected pixels, 100: printing system, D1: image data, D2: intermediate data, D3: edge position Information, D4 ... Enlarged edge position information, D5 ... Edge information, D6 ... Binary data D7: linked position information, D8: gradation data, I1: pre-enlargement image, I1u: pixel, I2: enlarged image, I2d: pixel division, I2u: pixel, U0: edge generation device, U1: position acquisition means, U2 ... Edge generating means, U21 ... enlarged position obtaining means, U22 ... connecting means

Claims (12)

拡大前画像をドットマトリクス状の画素で階調表現する画像データから同拡大前画像を拡大した拡大画像のエッジの領域を表すエッジ情報を生成するエッジ生成装置であって、
上記画像データに基づいて、上記拡大前画像の画素よりも細かい単位で当該拡大前画像の各画素の位置に対応させたエッジの位置を表すエッジ位置情報を取得する位置取得手段と、
上記エッジ位置情報に基づいて、上記拡大画像の画素単位で当該拡大画像の各画素の位置に対応させて上記拡大画像のエッジの領域を表すエッジ情報を生成するエッジ生成手段とを具備することを特徴とするエッジ生成装置。
An edge generation device that generates edge information representing an area of an edge of an enlarged image obtained by enlarging the pre-enlargement image from image data that expresses the pre-enlargement image by using a dot matrix of pixels,
Based on the image data, position acquisition means for acquiring edge position information representing an edge position corresponding to the position of each pixel of the pre-enlargement image in units smaller than the pixels of the pre-enlargement image,
Edge generating means for generating, based on the edge position information, 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. Edge generation device to be characterized.
上記エッジ生成手段は、上記エッジ位置情報に基づいて上記拡大前画像のエッジの位置に対応する上記拡大画像のエッジの位置を表す拡大エッジ位置情報を同拡大画像の画素単位で取得する拡大位置取得手段と、同拡大エッジ位置情報に基づいて近隣する同拡大画像のエッジどうしを連結して上記拡大画像のエッジの領域を表すエッジ情報を生成する連結手段とを備えることを特徴とする請求項1に記載のエッジ生成装置。The edge generation means obtains enlarged edge position information indicating an edge position of the enlarged image corresponding to an edge position of the pre-enlarged image in pixel units of the enlarged image based on the edge position information. 2. The image processing apparatus according to claim 1, further comprising: connecting means for connecting edges of the same enlarged image adjacent to each other based on the enlarged edge position information to generate edge information representing an edge area of the enlarged image. 5. The edge generation device according to claim 1. 上記位置取得手段は、上記拡大前画像上で注目画素を順次移動させながら、同注目画素とその近隣に位置する画素との画像データの差分を演算し、演算結果に基づいて同注目画素の近隣に存在するエッジの位置が表された上記エッジ位置情報を取得することを特徴とする請求項2に記載のエッジ生成装置。The position acquiring means calculates a difference between image data of the pixel of interest and a pixel located in the vicinity of the pixel of interest while sequentially moving the pixel of interest on the image before enlargement, and calculates a neighborhood of the pixel of interest based on the calculation result. 3. The edge generation apparatus according to claim 2, wherein the edge position information indicating the position of the edge existing in the edge information is acquired. 上記位置取得手段は、上記拡大前画像上で注目画素とその周囲の画素の画像データに対してラプラシアンフィルタを用いた演算を行って同拡大前画像の各画素に対応して階調表現された中間データを生成し、当該中間データに対応するドットマトリクス状の画素上で注目画素を順次移動させながら、注目画素およびその近隣に位置する画素の位置および中間データに基づいて同中間データを略0にする位置が表された上記エッジ位置情報を取得することを特徴とする請求項3に記載のエッジ生成装置。The position obtaining means performs a calculation using a Laplacian filter on the image data of the target pixel and the surrounding pixels on the pre-enlargement image, and performs gradation expression corresponding to each pixel of the pre-enlargement image. Intermediate data is generated, and while the target pixel is sequentially moved on a dot matrix pixel corresponding to the intermediate data, the intermediate data is set to approximately 0 based on the position of the target pixel and a pixel located in the vicinity thereof and the intermediate data. The edge generating apparatus according to claim 3, wherein the edge position information indicating a position to be expressed is obtained. 上記位置取得手段は、上記中間データに対応するドットマトリクス状の画素上の注目画素とその近隣に位置する画素との中間データの符号が異なるとともに当該中間データの絶対値の少なくとも一つが所定の閾値以上またはより大のときに、同注目画素およびその近隣に位置する画素の位置および中間データに基づいて同中間データを略0にする位置が表された上記エッジ位置情報を取得することを特徴とする請求項4に記載のエッジ生成装置。The position acquisition means is configured such that the sign of the intermediate data between the pixel of interest on the dot matrix pixel corresponding to the intermediate data and the pixel located in the vicinity thereof is different, and at least one of the absolute values of the intermediate data is a predetermined threshold value. The edge position information indicating a position where the intermediate data is set to substantially 0 based on the position of the pixel of interest and a pixel located in the vicinity thereof and the intermediate data when the pixel is the above or larger. The edge generating apparatus according to claim 4, wherein 上記位置取得手段は、上記中間データに対応するドットマトリクス状の画素上の注目画素とその近隣に位置する画素との中間データの符号が異なるとともに当該中間データの絶対値がいずれも所定の閾値以下またはより小であり、かつ、同注目画素とその周囲の画素との画像データの異なり度合が所定の閾値以上またはより大であるときに、同注目画素およびその近隣に位置する画素の位置および中間データに基づいて同中間データを略0にする位置が表された上記エッジ位置情報を取得することを特徴とする請求項4または請求項5のいずれかに記載のエッジ生成装置。The position acquisition means may have a different sign of intermediate data between a target pixel on a dot matrix pixel corresponding to the intermediate data and a pixel located in the vicinity thereof, and the absolute value of the intermediate data may be equal to or less than a predetermined threshold. Or, when the difference between the image data of the pixel of interest and its surrounding pixels is smaller than or equal to or greater than a predetermined threshold value, and the pixel of interest and a pixel located in the vicinity of the pixel of interest are smaller and smaller. The edge generation device according to claim 4, wherein the edge position information indicating a position at which the intermediate data is set to substantially zero based on the data is acquired. 上記連結手段は、上記拡大前画像上で注目画素を順次移動させながら、同注目画素およびその近隣に位置する画素の画像データを2値化して2値化データを生成し、当該2値化データと、エッジの向きに対応した所定の複数のマッチングパターンと、に基づいてエッジの向きを決定し、上記近隣する拡大画像のエッジどうしを同決定したエッジの向きとなるように連結して上記エッジ情報を生成することを特徴とする請求項2〜請求項6のいずれかに記載のエッジ生成装置。The connecting means binarizes image data of the pixel of interest and pixels located near the pixel of interest while sequentially moving the pixel of interest on the pre-enlarged image to generate binarized data. And a plurality of predetermined matching patterns corresponding to the direction of the edge, and determining the direction of the edge, and connecting the edges of the adjacent enlarged image so as to have the determined direction of the edge. The edge generation device according to claim 2, wherein the information is generated. 上記連結手段は、上記近隣する拡大画像のエッジどうしを連結して上記エッジ情報を生成する際、上記拡大画像上で横方向と縦方向とで距離の差が大きい方向の画素単位毎に同拡大画像のエッジの領域とする画素の位置を表す連結位置情報を取得し、当該連結位置情報を含めて上記エッジ情報を生成することを特徴とする請求項2〜請求項7のいずれかに記載のエッジ生成装置。When the edge information is generated by connecting the edges of the adjacent enlarged images to each other, the connecting unit expands the same image for each pixel unit in a direction in which a difference in distance between the horizontal direction and the vertical direction is large on the enlarged image. The method according to any one of claims 2 to 7, wherein connection position information indicating a position of a pixel serving as an edge region of the image is obtained, and the edge information is generated including the connection position information. Edge generator. 上記拡大位置取得手段は、上記拡大前画像の画素に対応して上記拡大画像の画素を区分した画素区分毎に同拡大画像上で注目画素区分を順次移動させながら、注目画素区分に入る上記拡大画像のエッジが所定数以下となるように同注目画素区分のエッジの位置が表された上記拡大エッジ位置情報を取得することを特徴とする請求項2〜請求項8のいずれかに記載のエッジ生成装置。The enlargement position acquiring unit is configured to sequentially move the target pixel section on the enlarged image for each pixel section obtained by dividing the pixels of the enlarged image corresponding to the pixels of the pre-enlargement image, and to enter the target pixel section. The edge according to any one of claims 2 to 8, wherein the enlarged edge position information indicating the position of the edge of the target pixel section is obtained so that the number of edges of the image is equal to or smaller than a predetermined number. Generator. 上記位置取得手段は、上記拡大前画像上で注目画素を順次移動させながら、同注目画素とその近隣に位置する画素の画像データに対してガウスぼかしを行う演算を行い、当該ガウスぼかしが行われた画像データに基づいて上記エッジ位置情報を取得することを特徴とする請求項1〜請求項9のいずれかに記載のエッジ生成装置。The position obtaining means performs an operation of performing Gaussian blurring on the image data of the pixel of interest and pixels located in the vicinity thereof while sequentially moving the pixel of interest on the pre-enlargement image, and the Gaussian blurring is performed. 10. The edge generation device according to claim 1, wherein the edge position information is acquired based on the obtained image data. 拡大前画像をドットマトリクス状の画素で階調表現する画像データから同拡大前画像を拡大した拡大画像のエッジの領域を表すエッジ情報を生成するエッジ生成方法であって、
上記画像データに基づいて、上記拡大前画像の画素よりも細かい単位で当該拡大前画像の各画素の位置に対応させたエッジの位置を表すエッジ位置情報を取得する位置取得工程と、
上記エッジ位置情報に基づいて、上記拡大画像の画素単位で当該拡大画像の各画素の位置に対応させて上記拡大画像のエッジの領域を表すエッジ情報を生成するエッジ生成工程とを具備することを特徴とするエッジ生成方法。
An edge generation method for generating edge information representing an edge area of an enlarged image obtained by enlarging the pre-enlargement image from image data in which the pre-enlargement image is expressed by gradations of pixels in a dot matrix.
Based on the image data, a position acquisition step of acquiring edge position information indicating an edge position corresponding to the position of each pixel of the pre-enlargement image in units smaller than the pixels of the pre-enlargement image,
An edge generating step of generating edge information representing an edge area of the enlarged image in correspondence with the position of each pixel of the enlarged image on a pixel basis of the enlarged image based on the edge position information. Edge generation method to be featured.
拡大前画像をドットマトリクス状の画素で階調表現する画像データから同拡大前画像を拡大した拡大画像のエッジの領域を表すエッジ情報を生成する機能をコンピュータに実現させるエッジ生成プログラムであって、
上記画像データに基づいて、上記拡大前画像の画素よりも細かい単位で当該拡大前画像の各画素の位置に対応させたエッジの位置を表すエッジ位置情報を取得する位置取得機能と、
上記エッジ位置情報に基づいて、上記拡大画像の画素単位で当該拡大画像の各画素の位置に対応させて上記拡大画像のエッジの領域を表すエッジ情報を生成するエッジ生成機能とを実現させることを特徴とするエッジ生成プログラム。
An edge generation program for causing a computer to realize a function of generating edge information representing an edge area of an enlarged image obtained by enlarging the pre-enlargement image from image data in which the pre-enlargement image is expressed by gradations of pixels in a dot matrix.
Based on the image data, a position acquisition function for acquiring edge position information representing an edge position corresponding to the position of each pixel of the pre-enlargement image in units smaller than the pixels of the pre-enlargement image,
An edge generation function of generating edge information representing an edge area of the enlarged image in correspondence with the position of each pixel of the enlarged image in pixel units of the enlarged image based on the edge position information. Edge generation program to be characterized.
JP2002373384A 2002-12-25 2002-12-25 Edge generation apparatus, edge generation method, and edge generation program Expired - Fee Related JP3997415B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002373384A JP3997415B2 (en) 2002-12-25 2002-12-25 Edge generation apparatus, edge generation method, and edge generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002373384A JP3997415B2 (en) 2002-12-25 2002-12-25 Edge generation apparatus, edge generation method, and edge generation program

Publications (2)

Publication Number Publication Date
JP2004207923A true JP2004207923A (en) 2004-07-22
JP3997415B2 JP3997415B2 (en) 2007-10-24

Family

ID=32811676

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002373384A Expired - Fee Related JP3997415B2 (en) 2002-12-25 2002-12-25 Edge generation apparatus, edge generation method, and edge generation program

Country Status (1)

Country Link
JP (1) JP3997415B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009151571A (en) * 2007-12-20 2009-07-09 Canon Inc Image data supply device and method
JP2011501835A (en) * 2007-09-19 2011-01-13 トムソン ライセンシング System and method for scaling an image
US9008463B2 (en) 2012-03-14 2015-04-14 Kabushiki Kaisha Toshiba Image expansion apparatus for performing interpolation processing on input image data, and image expansion method thereof

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07302333A (en) * 1994-04-14 1995-11-14 Hewlett Packard Co <Hp> Expansion method of digital image by using edge mapping

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07302333A (en) * 1994-04-14 1995-11-14 Hewlett Packard Co <Hp> Expansion method of digital image by using edge mapping

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011501835A (en) * 2007-09-19 2011-01-13 トムソン ライセンシング System and method for scaling an image
US8351730B2 (en) 2007-09-19 2013-01-08 Thomson Licensing System and method for scaling images
JP2009151571A (en) * 2007-12-20 2009-07-09 Canon Inc Image data supply device and method
US8295598B2 (en) 2007-12-20 2012-10-23 Canon Kabushiki Kaisha Processing method and apparatus
US9008463B2 (en) 2012-03-14 2015-04-14 Kabushiki Kaisha Toshiba Image expansion apparatus for performing interpolation processing on input image data, and image expansion method thereof

Also Published As

Publication number Publication date
JP3997415B2 (en) 2007-10-24

Similar Documents

Publication Publication Date Title
US6175663B1 (en) Method and apparatus for preserving background continuity in images
JP2797224B2 (en) Method and apparatus for modifying an image displayed by an apparatus for generating a digitized image in a dot matrix format
US6757431B2 (en) Resolution conversion for anti-aliased images using loose gray scale template matching
JPH11331609A (en) Method for detecting pixel where alias in raster-converted image data is removed
JPH08228282A (en) Processing method of document picture and binary picture picture element processor
JPH10302059A (en) Data resolution increase method
US8456711B2 (en) SUSAN-based corner sharpening
JP4582204B2 (en) Image processing apparatus, image conversion method, and computer program
JP2004166007A (en) Device, method and program for image processing, and storage medium
JP2009171560A (en) Image processor, image processing method, program for executing image processing method, and storage medium
JP5049922B2 (en) Image processing apparatus and image processing method
JPH07322057A (en) Increase of resolution of binary input picture and its increasing device together with improvement of appearance ofbinary input picture
EP2166741A1 (en) Image processing apparatus, image forming apparatus and program
RU2534005C2 (en) Method and system for converting screenshot into metafile
JP5111242B2 (en) Image processing apparatus and method
JP3952188B2 (en) Image interpolation apparatus, image interpolation method, and image interpolation program
JP2004207923A (en) Edge generating apparatus, edge generating method, and edge generating program
JP4873554B2 (en) Image distribution apparatus and image distribution method
JP4259949B2 (en) Image creating apparatus, image creating program, and recording medium
US9363414B2 (en) Halftone mechanism
JP3888090B2 (en) Image processing apparatus and image processing method
JP4311292B2 (en) Image processing apparatus, image processing method, and program thereof
JP3294249B2 (en) Image processing device
JP2788554B2 (en) Image processing method and apparatus
JP4080973B2 (en) Image output device, image output program, and recording medium on which program is recorded

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

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

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070404

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070514

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070724

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110817

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120817

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130817

Year of fee payment: 6

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