JP3740739B2 - Dither matrix creation method - Google Patents

Dither matrix creation method Download PDF

Info

Publication number
JP3740739B2
JP3740739B2 JP12183396A JP12183396A JP3740739B2 JP 3740739 B2 JP3740739 B2 JP 3740739B2 JP 12183396 A JP12183396 A JP 12183396A JP 12183396 A JP12183396 A JP 12183396A JP 3740739 B2 JP3740739 B2 JP 3740739B2
Authority
JP
Japan
Prior art keywords
matrix
value
binary
elements
predetermined value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP12183396A
Other languages
Japanese (ja)
Other versions
JPH09307755A (en
Inventor
康成 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP12183396A priority Critical patent/JP3740739B2/en
Publication of JPH09307755A publication Critical patent/JPH09307755A/en
Application granted granted Critical
Publication of JP3740739B2 publication Critical patent/JP3740739B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、多値画像を2値画像化するためのディザマトリックスの作成方法に関する。
【0002】
【従来の技術】
画像を構成するデータは通常8ビット程度の濃淡階調で表現されている。しかし、この画像データを人が見ることのできる画像として出力する機器、例えばプリンタなどの出力機器においては、機構が簡単であることや制御の容易性から、インク等の色素を記録紙にドットとして付着させるか否かしか行わない、いわゆる2値記録が一般的である。
【0003】
このような2値記録の出力機器を使用して、8ビット濃淡階調で表された画像を記録する場合には、単に各画素の値を閾値で判断してインクを付着させるか否かを決定することになる。しかし、このように閾値で単純に2値化するだけでは、8ビット濃淡階調が持つ豊富な濃淡状態(1色なら256階調、3原色が各256階調ならば、約1670万色を表すことができる。)を表現することは不可能となる。そのため、このような2値記録の出力機器でも疑似的に濃淡状態を表現する方法が考えられている。すなわち、所定の面積の中で配置されるドット数によって濃淡を表現しようと言う面積階調の考え方である。
【0004】
この考え方を実現する方法としては種々の提案がなされている。例えば、誤差拡散法、乱数発生型ディザ法、組織的ディザ法等である。
【0005】
【発明が解決しようとする課題】
しかし、これらの方法には、次のような問題があった。
誤差拡散法は、各画素毎に誤差拡散あるいは誤差分配のための演算を実行しなければならないため、2値化の処理が遅くなってしまうという問題がある。乱数発生型ディザ法は、各要素位置毎の閾値を配置したディザマトリックスを使用するために2値化処理自体は高速であるが、乱数を用いて閾値を決定するため、各要素における閾値が全くのランダムとなって、画質が非常にノイジー、すなわち、多くのノイズが画像に満ちているような画質になると言う問題があった。
【0006】
ディザマトリックスを用いる他の方法として、組織的ディザ法に属する渦巻型があるが、この渦巻型は、閾値の順序をなるべく近い画素位置から順にとっていくため、ドットが密集し易く、密集したものが大きなドットと認識されるので解像度が低下し易かった。また、組織的ディザ法の内で、ベイヤー(Bayer)法があるが、このベイヤー(Bayer)法では、閾値の順序をなるべく離れた画素位置から順にとっていくため、ドットが分散して解像度は良いものの、ドットの分散パターンが規則的になって、目障りな紋様が発生し易かった。
【0007】
本発明は、ディザ法を用いて画像処理を行っても、画像がノイジーになったり、解像度が低下したりすることが無く、また紋様の発生をも抑制することが可能なディザマトリックスを作成する方法の提供を目的とするものである。
【0008】
【課題を解決するための手段、及び発明の効果】
請求項1に記載の本発明のディザマトリックス作成方法においては、
予め各要素が第1所定値あるいは該第1所定値よりも小さい第2所定値に2値化された2値マトリックスについて、第1所定値を有する要素の集合状態が最も密である位置(換言すれば、第2所定値を有する要素の集合状態が最も粗である位置)を検出し、その位置に存在する要素の値を第1所定値から第2所定値に置換することで、前記2値マトリックスよりも第1所定値を有する要素が1つ少ない新たなマトリックスを生成する第1のマトリックス生成処理を、
予め用意した所定の基本マトリックスを最初の2値マトリックスとして用いると共に、前記生成した新たなマトリックスを次回の2値マトリックスとして用いることで繰り返し行うことにより、前記基本マトリックスよりも第1所定値を有する要素が1つずつ少ないマトリックスを複数生成し、
また、予め各要素が第1所定値あるいは該第1所定値よりも小さい第2所定値に2値化された2値マトリックスについて、第1所定値を有する要素の集合状態が最も粗である位置(換言すれば、第2所定値を有する要素の集合状態が最も密である位置)を検出し、その位置に存在する要素の値を第2所定値から第1所定値に置換することで、前記2値マトリックスよりも第1所定値を有する要素が1つ多い新たなマトリックスを生成する第2のマトリックス生成処理を、
前記基本マトリックスを最初の2値トリックスとして用いると共に、前記生成した新たなマトリックスを次回の2値マトリックスとして用いることで繰り返し行うことにより、前記基本マトリックスよりも第1所定値を有する要素が1つずつ多いマトリックスを複数生成し、
前記第1及び第2のマトリックス生成処理の繰り返しによって生成された複数のマトリックスと、前記基本マトリックスと、からなるマトリックス群に基づいて、同一位置の要素の2値化値を合計し、その合計値の大きい要素から順にディザマトリックスにおける各要素の閾値を設定する。
【0009】
ここで、上記の如く第1のマトリックス生成処理の繰り返しによって生成される複数の各マトリックスは、夫々独立に形成されるのではなく、自己よりも第1所定値を有する要素が1つ多いマトリックスにおいて第1所定値を有する要素の集合状態が最も密である位置に存在する要素の値を、第1所定値から第2所定値に置換することで形成され、しかも、第1所定値から第2所定値に順次置換されていく要素の位置は、特定の領域に偏ることなく適度に分散することとなる。
【0010】
また同様に、上記の如く第2のマトリックス生成処理の繰り返しによって生成される複数の各マトリックスも、夫々独立に形成されるのではなく、自己よりも第1所定値を有する要素が1つ少ないマトリックスにおいて第1所定値を有する要素の集合状態が最も粗である位置に存在する要素の値を、第2所定値から第1所定値に置換することで形成され、しかも、第2所定値から第1所定値に順次置換されていく要素の位置は、特定の領域に偏ることなく適度に分散する。
【0011】
この結果、第1及び第2のマトリックス生成処理の繰り返しにより生成された複数のマトリックスと、これらマトリックスの元となる前記基本マトリックスとを、例えば第1所定値を有する要素の数が少ないものから順に配列させれば、各マトリックスは、第1所定値を有する要素が、全くのランダムではないが不規則に分散して順次1つずつ増えていくものとなる。
【0012】
このため、第1及び第2のマトリックス生成処理の繰り返しにより生成された複数のマトリックスと前記基本マトリックスとからなるマトリックス群に基づいて、ディザマトリックスにおける各要素の閾値を設定すると、ディザマトリックスの各要素における閾値は、特定の値に偏ることが無く、ランダムともならず、更に各種の値に適度に分散して分布するものとなり、形成されるディザマトリックスを用いて画像処理しても解像度は低下せずに、目障りな紋様が抑制され、またランダムでないのでノイジーともならない。
【0013】
ところで、第1及び第2のマトリックス生成処理にて、第1所定値を有する要素の集合状態が最も密である位置あるいは最も粗である位置を検出する際には、人間の主観によって、密である位置あるいは粗である位置を判断することが考えられる。しかし、このようにすると、粗密の判断基準が曖昧になってしまい、特にマトリックスのサイズ(全要素数)が大きい場合には、粗密を判断することができなくなる。
【0014】
そこで特に、本発明のディザマトリックス作成方法における前記第1及び第2のマトリックス生成処理では、
処理対象マトリックスの各要素を所定の走査方向の順に注目要素として順次選択すると共に、選択した注目要素の値を該注目要素から見て予め定められた周辺位置に存在する周辺要素の値に応じて補正していくことで、前記処理対象マトリックスの元の全要素の平均値と前記補正後の全要素の平均値とがほぼ一致するように、前記処理対象マトリックスの各要素の値を他の要素の値に拡散させる拡散処理を、前記2値マトリックスに対して行い、
更に、前記第1のマトリックス生成処理では、前記拡散処理により補正した後の全要素の内で最大値を有する要素の位置を、前記2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置として検出し、前記第2のマトリックス生成処理では、前記拡散処理により補正した後の全要素の内で最小値を有する要素の位置を、前記2値マトリックスにて第1所定値を有する要素の集合状態が最も粗である位置として検出するようにしている。
【0015】
つまり、本発明では、2値マトリックスの元の全要素の平均値と、補正後の全要素の平均値とがほぼ一致するように、2値マトリックスの各要素の値を他の要素の値に拡散させる拡散処理を行い、その補正後(拡散後)の値が最も大きかった要素の位置を、2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置と判断し、逆に、補正後(拡散後)の値が最も小さかった要素の位置を、2値マトリックスにて第1所定値を有する要素の集合状態が最も粗である位置と判断するようにしている。
【0016】
従って、本発明のディザマトリックス作成方法によれば、2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置、あるいは最も粗である位置を、人間の主観に頼ることなく、定量的且つ確実に検出することができる。この結果、上述したように解像度の低下,目障りな紋様の発生,及びノイジー性を抑制可能なディザマトリックスを、経験や勘を必要とせずに極めて簡単に作成することができるようになる。
【0017】
しかも、本発明によれば、基本マトリックス(2値マトリックス)のサイズが大きくても、第1及び第2のマトリックス生成処理にて、第1所定値を有する要素の粗密を確実に判断することができるようになるため、大きなサイズのディザマトリックスを容易に作成でき、一層大きな効果を得ることができる。
【0018】
即ち、ディザマトリックスの大きさよりも広い画像を2値化する場合には、画像の部分部分を順次、ディザマトリックスの大きさの領域毎に2値化処理することになるが、この場合、ディザマトリックスのサイズが小さいと、2値化後の画像上に、ディザマトリックスを繰り返して用いることに起因する一定パターンの紋様が現れ易くなってしまう。これに対して、本発明によれば、大きなサイズのディザマトリックスを簡単に作成することができるため、このような問題を解決することができるのである。
【0019】
尚、拡散処理としては、請求項2に記載のように、処理対象マトリックスの各要素を所定の走査方向の順に注目要素として順次選択し、その選択した注目要素の値に対して、該注目要素から見て予め定められた1つあるいは複数の周辺位置に存在する周辺要素の値に所定の重み付け係数を乗じた値を加算すると共に、前記処理対象マトリックスの元の全要素の平均値に前記重み付け係数の総和を乗じた値を減じ、前記加算及び減算を行った後の値を、前記注目要素の補正後の値として記憶する、という処理により行うことができる。
【0020】
つまり、注目要素の値を周辺要素の値に応じて補正するためには、基本的には、注目要素の値に対して、周辺要素の値に所定の重み付け係数を乗じた値を加算すれば良いが、ただ単にこのようにすると、各要素の値は大きくなる方にしか補正されず、補正後の全要素の平均値が元の全要素の平均値と比べて非常に大きな値となってしまう。そこで、上記加算を行うだけでなく、元の全要素の平均値に各周辺要素の重み付け係数の総和を乗じた値を減じる減算を行うことで、処理対象マトリックス(2値マトリックス)の元の全要素の平均値と、補正後の全要素の平均値とをほぼ一致させつつ、2値マトリックスの各要素の値を他の要素の値に拡散させることができるのである。
【0021】
一方、第1及び第2のマトリックス生成処理では、請求項3に記載のように、前記2値マトリックスに対して走査方向が夫々異なる複数の前記拡散処理を実行すると共に、前記各拡散処理の実行によって得た各要素の値を同一位置の要素毎に平均した平均値に基づき、前記2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置あるいは粗である位置を検出するようにしても良い。
【0022】
これは、同一の2値マトリックスであっても、拡散処理の走査方向(つまり、注目要素を選択していく方向)が異なれば、各要素の補正後の値が変わり、延いては、第1所定値を有する要素が最も密であると検出される位置、あるいは最も粗であると検出される位置が変わってくるからである。そして、請求項3に記載のように、走査方向が異なる複数の拡散処理を実行して、その各拡散処理の実行によって得た各要素の値を同一位置の要素毎に平均化することにより、2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置あるいは粗である位置を、より確実に検出できるようになる。
【0023】
一方更に、第1及び第2のマトリックス生成処理では、請求項4に記載のように、前記2値マトリックスを複数個配置してなる拡大マトリックスに対して前記拡散処理を実行すると共に、その拡散処理の実行によって得た各要素の値のうち、前記拡散処理が開始された先頭要素ライン部分を含まない2値マトリックスに対応する領域の各要素の値に基づき、前記2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置あるいは粗である位置を検出するようにしても良い。
【0024】
これは、拡散処理が開始された先頭要素ライン部分やそれに近い領域では、各要素の値が十分に拡散されていないためであり、換言すれば、上記先頭要素ライン部分やそれに近い領域に関しては、第1所定値を有する要素の粗密を適切に判断することができない可能性があるためである。
【0025】
そして、請求項4に記載の如く処理すれば、2値マトリックスの元の全要素の平均値と、補正後の全要素の平均値とをほぼ一致させつつ、2値マトリックスの各要素の値を他の要素の値に十分拡散させた補正後の値に基づき、第1所定値を有する要素の粗密を判断することができ、この結果、2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置あるいは最も粗である位置を、より確実に検出できるようになる。特に、請求項3に記載の処理と請求項4に記載の処理とを組み合わせて行えば、一層確実である。
【0026】
ところで、請求項1〜請求項4に記載のディザマトリックス作成方法において、前記基本マトリックスは、第1所定値を有する要素と第2所定値を有する要素とを、ランダムに配置したものでも良いが、請求項5に記載のように、全ての要素が同一の多値からなるマトリックスを誤差拡散処理して、各要素を第1所定値あるいは第2所定値に2値化して形成したものであれば、一層大きな効果を得ることができる。
【0027】
つまり、誤差拡散法により生じる2値(第1所定値及び第2所定値)の並びは、一見不規則に見えるけれども、全くのでたらめ(ランダム)ではない。即ち、強い紋様はでき難いがノイジーな画像にはなり難い性質がある。そして、このような誤差拡散法により生じる2値の並びを利用することにより、最終的にディザマトリックスにも誤差拡散法における2値の並びの性質がある程度取り込まれる。従って、解像度が低下せず、目障りな紋様が発生せず、しかも人間の目に対してノイジーとならない、という効果を一層高めることができるのである。
【0028】
勿論、基本マトリックスとして、第1所定値を有する要素と第2所定値を有する要素とをランダムに配置したものを用いた場合にも、ノイジー性は多少懸念されるが、基本マトリックスから直接ランダムとされない新しい複数の2値マトリックスが生成され、これらマトリックス群に基づいてディザマトリックスが作成されるため、ノイジー性を大幅に薄めることができる。
【0029】
【発明の実施の形態】
[実施の形態1]
図1は、ディザマトリックス作成装置2の主要ブロック図である。
このディザマトリックス作成装置2の主体を成すマイクロコンピュータ部11は、CPU12、ROMからなるプログラムメモリ13、RAMからなるワーキングメモリ14、RAMからなるディザマトリックス格納メモリ16、及びRAMからなる出力イメージメモリ17により構成されている。また、マイクロコンピュータ部11にはシステムバス18を介して入力部10及び出力部19が接続されている。
【0030】
入力部10は、キーボードや外部の記憶装置から入力するためのインターフェースを備え、ディザマトリックス作成に必要なデータや指示の入力を行うものである。また、入力部10は、作成されたディザマトリックスの効果を確認するために、各画素が8ビットで表される階調を有する画像データを入力する。
【0031】
CPU12は、後述する如くディザマトリックスの作成をプログラムに従って実行するためのものであり、プログラムメモリ13は、ディザマトリックス作成プログラムを含め、CPU12で行う様々な制御を実施するためのプログラムを記憶している。また、ワーキングメモリ14は、CPU12がプログラムメモリ13に記憶されたプログラムを実行するときに必要なデータを一時的に記憶するものである。
【0032】
ディザマトリックス格納メモリ16は、CPU12の処理によって形成されたディザマトリックスデータを記憶する。
出力イメージメモリ17は、CPU12が、ディザマトリックス格納メモリ16に格納されているディザマトリックスを用いて、8ビットで表される階調を有する画像データを2値化した、その2値化された出力イメージデータを記憶する。
【0033】
出力部19は、出力イメージメモリ17に格納した2値化画像データを電子写真方式によりドットの有無で印字する装置(カラープリンタ)である。
次に、ディザマトリックス作成装置2により実行されるディザマトリックス作成処理について説明する。ディザマトリックス作成処理のフローチャートを図2以下に示す。尚、本実施の形態では、1画素の濃度値が0〜255の256階調で表される中間調画像の2値化処理に用いられ、その大きさ(即ち、閾値の数)がk(例えばk=128×128)であるディザマトリックスを作成している。
【0034】
図2に示すように、ディザマトリックス作成処理の実行が開始されると、まず、ステップ(以下、単に「S」と記す)100にて、画素数がk(=128×128)であり、且つ全画素が所定の均一濃度値(最大濃度値を255とした場合、例えば70)に設定された均一濃度画素マトリックスを、ワーキングメモリ14に読み込み、その均一濃度画素マトリックスを誤差拡散法により2値化処理する。
【0035】
尚、ここで言う誤差拡散法とは、広い意味で用いており、ある画素を2値化した場合に2値化の誤差を未だ2値化していない周辺の画素の濃度に分配する方法(狭い意味の誤差拡散法・文献:Robert W.Floyd and Louis Steinberg,"An Adaptive Algorithm for Spatial Greyscale",Proceeding of the S.I.D. Vol.17/2,1976等)、あるいは2値化する際に周辺に存在する既に2値化した画素からその2値化の際に生じた誤差の所定割合を受け取る方法(平均誤差最小法とも言う。文献:J.F.Jarvis,C.N.Judice,and W.H.Ninke,"A Survey of Techniques forthe Display of Continuous Tone Pictures on Bilevel Displays",Computer Graphics and Image Processing.5,13-40(1976)等)等が良く知られているので、誤差拡散法自体の詳細な説明は省略する。
【0036】
また、本実施の形態では、上記均一濃度画素マトリックスの各画素は、誤差拡散法により「1」(ドット有り=オン)又は「0」(ドット無し=オフ)の何れかの要素に2値化され、その2値化後の2値マトリックスにおいて、「1」である要素の数(以下、ドット数とも言う)は、n(0<n<k)個であるものとする。また更に、以下の説明において、例えば「nドット」とは、ドット数がn個であることを示している。
【0037】
次に、続くS200にて、S100の2値化処理で得た2値マトリックスを、以下の処理で基本となるnドットの2値マトリックス(以下、基本マトリックスと言う)Fn として、ワーキングメモリ14に保存する。
そして、続くS300にて、上記基本マトリックスFn を元にして、(n−1)ドットの2値マトリックスFn-1 から0ドットの2値マトリックスF0 までの、n個の2値マトリックス(つまり、基本マトリックスFn よりも「1」の要素が1つずつ少ないn個の2値マトリックス)Fn-1 〜F0 を作成する、少ドットマトリックス作成処理を実行する。
【0038】
S300の少ドットマトリックス作成処理の詳細を、図3のフローチャートに示す。
図3に示すように、少ドットマトリックス作成処理の実行が開始されると、まず、S310にて、今回の処理対象となる2値マトリックスを特定するためのドット数番号iに、初期値として、上記基本マトリックスFn のドット数である「n」を設定する。
【0039】
そして、続くS320にて、ワーキングメモリ14の中から、ドット数がドット数番号iと一致する2値マトリックス(iドットの2値マトリックス)Fi を選択し、その2値マトリックスFi に対して、図4に示す粗密計算処理を実行することにより、当該2値マトリックスFi について「1」である要素の粗密(ドットの粗密)を計算する。尚、このS320の処理が最初に実行された場合には、ドット数番号iは上記S310で「n」に設定されているため、iドットの2値マトリックスFi としては、S200でワーキングメモリ14に保存した基本マトリックスFn が選択される。
【0040】
ここで、S320の粗密計算処理では、図4に示すように、まずS325にて、今回の処理対象として選択したiドットの2値マトリックスFi の全要素の平均値Hi を算出し、続くS327にて、上記選択した2値マトリックスFi をワーキングメモリ14上でコピーして、その2値マトリックスFi と全く同一の処理対象マトリックスSMi を作る。尚、本実施の形態では、2値マトリックスの各要素は、「1」又は「0」に2値化されているため、S325で算出される平均値Hi は、2値マトリックスFi のドット数iを全要素数kで割った値(i/k)となる。
【0041】
そして、続くS330にて、S327で作った処理対象マトリックスSMi から注目要素(x,y)を選択して、その注目要素(x,y)の値(つまり、元の2値化値)Dx,y を読み込む。尚、本実施の形態においては、図6に示すように、処理対象マトリックスSMi の左上の位置を原点(0,0)とし、この原点(0,0)からはじめて、右方向を主走査方向x、下方向を副走査方向yとして、各要素を、順次、注目要素として選択する。
【0042】
次に、続くS335にて、図6に示す如く、処理対象マトリックスSMi において注目画素「*」(x,y)に隣接した4つの周辺位置に存在する4個の要素(x−1,y−1)、(x,y−1)、(x+1,y−1)、(x−1,y)を周辺要素として選択し、後述するS345の処理によって補正が行われた後の、上記各周辺要素の値Dx-1,y-1 、Dx,y-1 、Dx+1,y-1 、Dx-1,y を、ワーキングメモリ14から読み込む。
【0043】
尚、図6にて斜線で示すように、当該粗密計算処理が主走査方向xと副走査方向yとに夫々最初に実行される領域(先頭要素ライン部)に存在する要素が、上記S330で注目要素「*」として選択された場合には、4個全ての周辺要素が存在しない。よって、この場合に、存在しない周辺要素の値としては、予め定められた所定値(本実施の形態では「0」としたが、全要素の平均値Hi とするのが望ましい)が用いられる。
【0044】
そして、続くS340にて、予めプログラムメモリ13又はワーキングメモリ14に格納されており、「*」を注目要素位置として図7に示した拡散分配マトリックスから、上記各周辺要素(x−1,y−1)、(x,y−1)、(x+1,y−1)、(x−1,y)の夫々に対応する重み付け係数α1(=2/16),α2(=4/16),α3(=3/16),α4(=4/16)を読み出す。
【0045】
そして、続くS345にて、S325で求めた平均値Hi 、S330で読み込んだ注目要素(x,y)の値(元の2値化値)Dx,y 、S335で読み込んだ周辺要素の補正後の値Dx-1,y-1 、Dx,y-1 、Dx+1,y-1 、Dx-1,y 、及びS340で読み込んだ周辺要素の重み付け係数α1,α2,α3,α4から、下記の式1に基づいて、注目要素(x,y)の補正値D′x,y を算出し、その補正値D′x,y を、下記の式2の如く、注目要素(x,y)の値Dx,y としてワーキングメモリ14に再保存する。
【0046】
【数1】

Figure 0003740739
【0047】
尚、このように補正された今回の注目要素の値Dx,y は、その後、上記S330で他の要素が注目要素として選択された場合に、前述のS335にて、周辺要素の補正後の値として読み込まれることとなる。
このようにしてS345の処理が終わると、続くS350にて、処理対象マトリックスSMi の全要素について処理が終了したか否かを判定し、未処理の要素が存在すれば、S330に戻り、処理対象マトリックスSMi における次の座標の要素を注目要素として、前述したS330〜S345の処理を繰り返す。そして、S350にて、全要素についての処理が終了したと判定すれば、当該粗密計算処理を終了する。
【0048】
つまり、粗密計算処理では、注目要素の値Dx,y に対して、周辺要素の値Dx-1,y-1 、Dx,y-1 、Dx+1,y-1 、Dx-1,y に所定の重み付け係数α1,α2,α3,α4を乗じた値を加算すると共に、処理対象マトリックスSMi の元の全要素の平均値Hi に重み付け係数の総和(α1+α2+α3+α4)を乗じた値を減じ、その加算及び減算を行った後の値D′x,y を、注目要素の補正後の値Dx,y として保存する、という式1,2の演算を、2値マトリックスFi をコピーした処理対象マトリックスSMi の各要素について順次実行するようにしている。
【0049】
そして、この粗密計算処理が行われた後の処理対象マトリックスSMi は、全要素の平均値が2値マトリックスFi の全要素の平均値Hi とほぼ一致するように、2値マトリックスFi の各要素の値を他の要素の値に拡散させたマトリックスとなる。
【0050】
上述したように少ドットマトリックス生成処理のS320で、図4の粗密計算処理の実行が終了すると、図3に示すようにS360へ進む。
そして、このS360にて、粗密計算処理が行われた後の処理対象マトリックスSMi の全要素の内で最大値を有する要素の位置を、2値マトリックスFi にて「1」の要素が最も密である位置(ドットが最も密な位置)と判断し、更に、2値マトリックスFi において、「1」の要素が最も密である位置と判断した位置の要素の値を「1」から「0」に変更することで、2値マトリックスFi よりも「1」の要素が1つ少ない(i−1)ドットの2値マトリックスFi-1 を作成し、その2値マトリックスFi-1 をワーキングメモリ14に保存する。
【0051】
その後、続くS370にて、ドット数番号iの値を1つ減少させ(デクリメントし)、続くS380にて、ドット数番号iの値が0よりも大きいか否かを判定する。ここで、ドット数番号iの値が未だ0よりも大きければ、S320に戻り、ドット数が今回のドット数番号iに一致する2値マトリックスFi (つまり、前回のS360で新たに作成した2値マトリックスFi-1 )を今回の処理対象として、前述したS320〜S370の処理を繰り返す。そして、S380にて、ドット数番号iが0よりも大きくないと判定すれば、当該少ドットマトリックス作成処理を終了する。
【0052】
よって、この少ドットマトリックス作成処理が終了すると、ワーキングメモリ14には、上記基本マトリックスFn と、その基本マトリックスFn よりも「1」の要素が1つずつ少ないn個の2値マトリックスFn-1 〜F0 とが保存されることになる。
【0053】
ここで、説明を簡単にするため、S200で保存された基本マトリックスFnが、例えば図8(a)に示すように、全要素数kが25(=5×5)で、ドット数nが8であった場合について説明する。
この場合、少ドットマトリックス作成処理(図3)のS320では、上記基本マトリックスFn が、最初に処理対象としての2値マトリックスF8 として選択され、その2値マトリックスF8 に対して図4の粗密計算処理が実行される。すると、粗密計算処理のS327で上記2値マトリックスF8 をコピーして作られる処理対象マトリックスSM8 の各要素の値は、最終的に図8(b)の様な値となる。
【0054】
そして、少ドットマトリックス作成処理の次のS360では、処理対象マトリックスSM8 の全要素の内で最大値(max)である「0.73」の要素の位置を、2値マトリックスF8 にて「1」の要素が最も密である位置と判断する。そして更に、S360では、図8(c)の○印で示すように、2値マトリックスF8 において、上記の如く「1」の要素が最も密である位置と判断した位置の要素の値を「1」から「0」に変更することで、「1」の要素が7個の(7ドットの)2値マトリックスF7 を作成する。
【0055】
その後、新たに作成した2値マトリックスF7 に対しても、S320及びS360の処理を実行することで、「1」の要素が6個の(6ドットの)2値マトリックスF6 を作成し、以後同様に処理を繰り返すことで、図8(d)に示すように、全ての要素が「0」である2値マトリックスF0 まで作成するのである。
【0056】
このように、少ドットマトリックス作成処理を実行して、基本マトリックスFn よりも「1」の要素が1つずつ少ないn個の2値マトリックスFn-1 〜F0 を作成すると、図2に示す如く次のS400に進む。
そして、このS400にて、今度は、上記基本マトリックスFn を元にして、(n+1)ドットの2値マトリックスFn+1 からkドットの2値マトリックスFk までの、(k−n)個の2値マトリックス(つまり、基本マトリックスFn よりも「1」の要素が1つずつ多い(k−n)個の2値マトリックス)Fn+1 〜Fk を作成する、多ドットマトリックス作成処理を実行する。
【0057】
ここで、S400の多ドットマトリックス作成処理の詳細を、図5のフローチャートに示す。
図5に示すように、多ドットマトリックス作成処理の実行が開始されると、S410及びS420にて、前述した少ドットマトリックス作成処理のS310及びS320と全く同様の処理を行う。
【0058】
即ち、まずS410にて、今回の処理対象となる2値マトリックスを特定するためのドット数番号iに、初期値として、上記基本マトリックスFn のドット数である「n」を設定する。次にS420にて、ワーキングメモリ14の中から、ドット数がドット数番号iと一致する2値マトリックス(iドットの2値マトリックス)Fi を選択し、その2値マトリックスFi に対して、前述した図4の粗密計算処理を実行することにより、当該2値マトリックスFi について「1」である要素の粗密(ドットの粗密)を計算する。
【0059】
そして、S420にて図4に示した粗密計算処理の実行が終了すると、S460に進んで、粗密計算処理が行われた後の処理対象マトリックスSMi の全要素の内で最小値を有する要素の位置を、2値マトリックスFi にて「1」の要素が最も粗である位置(ドットが最も粗な位置)と判断し、更に、2値マトリックスFi において、「1」の要素が最も粗である位置と判断した位置の要素の値を「0」から「1」に変更することで、2値マトリックスFi よりも「1」の要素が1つ多い(i+1)ドットの2値マトリックスFi+1 を作成し、その2値マトリックスFi+1 をワーキングメモリ14に保存する。
【0060】
その後、続くS470にて、ドット数番号iの値を1つ増加させ(インクリメントし)、続くS480にて、ドット数番号iの値が全要素数k以下であるか否かを判定する。ここで、ドット数番号iの値が未だk以下であれば、S420に戻り、ドット数が今回のドット数番号iに一致する2値マトリックスFi (つまり、前回のS460で新たに作成した2値マトリックスFi+1 )を今回の処理対象として、前述したS420〜S470の処理を繰り返す。そして、S480にて、ドット数番号iがk以下でないと判定すれば、当該多ドットマトリックス作成処理を終了する。
【0061】
つまり、多ドットマトリックス作成処理では、少ドットマトリックス作成処理の場合とは逆に、今回選択した2値マトリックスFi に対し図4の粗密計算処理を実行して得た処理対象マトリックスSMi の全要素の内で、最小値を有する要素の位置を、2値マトリックスFi にて「1」の要素が最も粗である位置と判断し、2値マトリックスFi において、その位置の要素の値を「0」から「1」に変更することで、2値マトリックスFi よりも「1」の要素が1つ多い2値マトリックスFi+1 を作成する、という処理を繰り返すようにしている。
【0062】
例えば、基本マトリックスFn が、図8(a)に例示したように、全要素数kが25(=5×5)で、ドット数nが8であった場合について説明する。
この場合、多ドットマトリックス作成処理(図5)のS420では、少ドットマトリックス作成処理の場合と同様に、まず基本マトリックスFn が、最初に処理対象としての2値マトリックスF8 として選択され、その2値マトリックスF8 に対して図4の粗密計算処理が実行される。そして、前述した様に、粗密計算処理のS327で上記2値マトリックスF8 をコピーして作られる処理対象マトリックスSM8 の各要素の値は、図8(b)の様な値となる。
【0063】
すると、多ドットマトリックス作成処理のS460では、処理対象マトリックスSM8 の全要素の内で最小値(min)である「−0.28」の要素の位置を、2値マトリックスF8 にて「1」の要素が最も粗である位置と判断し、図8(e)の○印で示すように、2値マトリックスF8 において、上記の如く「1」の要素が最も粗である位置と判断した位置の要素の値を「0」から「1」に変更することで、「1」の要素が9個の(9ドットの)2値マトリックスF9 を作成する。
【0064】
そして、新たに作成した2値マトリックスF9 に対しても、S420及びS460の処理を実行することで、「1」の要素が10個の(10ドットの)2値マトリックスF10を作成し、以後同様に処理を繰り返すことで、図8(f)に示すように、全ての要素が「1」である2値マトリックスF25(=Fk )まで作成するのである。
【0065】
よって、図2のS400にて、多ドットマトリックス作成処理の実行が終了すると、基本マトリックスFn よりも「1」の要素が1つずつ多い(k−n)個の2値マトリックスFn+1 〜Fk が新たに作成され、この結果、ワーキングメモリ14内には、図9に示すように、基本マトリックスFn を含めて、全要素が「0」である2値マトリックスF0 から全要素が「1」である2値マトリックスFkまでの、(k+1)個の2値マトリックスF0 〜Fk が保存される。
【0066】
こうして多ドットマトリックス作成処理の実行を終えると、図2に示す如くS500に進む。そして、このS500にて、ワーキングメモリ14内の全ての2値マトリックスF0 〜Fk について、同一位置の要素の2値化値を合計し、この合計値を要素とする集積結果マトリックスMを形成する。即ち、全ての2値マトリックスF0 〜Fk の各要素位置について、その値を合計し、その合計値を、図10に示す如くワーキングメモリ14内に用意された集積結果マトリックスMの同一位置に格納するのである。
【0067】
そして、続くS600にて、集積結果マトリックスMの合計値の大きい要素位置から順に、ディザマトリックス用の閾値を設定し、続くS700にて、その閾値からなるマトリックスをディザマトリックスとして、ディザマトリックス格納メモリ16に保存した後、当該ディザマトリックス作成処理を終了する。
【0068】
尚、S600での閾値の設定は、例えば以下の様に行われる。
まず、集積結果マトリックスMの合計値の大きい要素位置から順に番号を付けると、その番号は、1〜16384(=128×128=k)となり、全ての2値マトリックスF0 〜Fk において「1」の要素が1つずつ増加していく要素位置に対応する。また、2値化処理する中間調画像の各画素の濃度値は、前述したように0〜255の256階調である。
【0069】
そこで、S600では、上記番号の順に、例えば、番号が1〜64(=16384/256)の要素位置については、ディザマトリックス用の閾値として「0」を設定し、番号が65〜128の要素位置については、閾値として「1」を設定し、番号が129〜192の要素位置については、閾値として「2」を設定し、・・・、番号が16257〜16320の要素位置については、閾値として「254」を設定し、番号が16321〜16384の要素位置については、閾値として「255」を設定するといった具合いに、番号が小さい要素位置から順に閾値を大きく設定していくのである。
【0070】
また、S600では、上述とは逆に、番号が1〜64の要素位置では、閾値として「255」を設定し、番号が65〜128の要素位置では、閾値として「254」を設定し、・・・、番号が16257〜16320の要素位置については、閾値として「1」を設定し、番号が16321〜16384の要素位置については、閾値として「0」を設定するといった具合いに、番号が小さい要素位置から順に閾値を小さく設定していくようにしても良い。
【0071】
尚、本実施の形態では、図3に示した少ドットマトリックス作成処理のS320及びS360が、第1のマトリックス生成処理に相当し、図5に示した多ドットマトリックス作成処理のS420及びS460が、第2のマトリックス生成処理に相当している。そして、少ドットマトリックス作成処理のS320及び多ドットマトリックス作成処理のS420で夫々実行される図4の粗密計算処理が、拡散処理に相当している。
【0072】
以上詳述したように、本実施の形態のディザマトリックス作成装置2では、まず、均一濃度画素マトリックスを、誤差拡散法により2値化処理することで、nドット(「1」の要素がn個)の基本マトリックスFn を生成するようにしている(S100,S200)。
【0073】
そして、iドットの2値マトリックスFi について、「1」の要素が最も密である位置に存在する要素の値を「1」から「0」に置換することで、「1」の要素が1つ少ない新たな2値マトリックスFi-1 を生成するS320及びS360の処理を、上記基本マトリックスFn を最初の2値マトリックスFi として、繰り返し行うことにより、基本マトリックスFn よりも「1」の要素が1つずつ少ないn個の2値マトリックスFn-1 〜F0 を生成し(S300)、また、iドットの2値マトリックスFi について、「1」の要素が最も粗である位置に存在する要素の値を「0」から「1」に置換することで、「1」の要素が1つ多い新たな2値マトリックスFi+1 を生成するS420及びS460の処理を、上記基本マトリックスFn を最初の2値マトリックスFi として、繰り返し行うことにより、基本マトリックスFn よりも「1」の要素が1つずつ多い(k−n)個の2値マトリックスFn+1 〜Fk を生成している(S400)。
【0074】
よって、上記S320及びS360の繰り返しにより生成される2値マトリックスFn-1 〜F0 において「1」から「0」に順次置換されていく要素の位置、及び、上記S420及びS460の繰り返しにより生成される2値マトリックスFn+1 〜Fk において「0」から「1」に順次置換されていく要素の位置は、特定の領域に偏ることなく適度に分散することとなり、この結果、上記処理の繰り返しにより生成された複数のマトリックスF0 〜Fn-1, Fn+1 〜Fk と、これらマトリックスの元となる基本マトリックスFn とを、図9に示す如く「1」の要素が少ないものから順に配列させれば、各マトリックスF0 〜Fk は、「1」の要素が、全くのランダムではないが不規則に分散して順次1つずつ増えていくものとなる。
【0075】
そこで、本実施の形態のディザマトリックス作成装置2では、基本マトリックスFn と、上記の如く生成した2値マトリックスF0 〜Fn-1,Fn+1 〜Fk と、からなるマトリックス群に基づいて、ディザマトリックスにおける各要素の閾値を設定している(S500〜S700)。
【0076】
このため、ディザマトリックスの各要素における閾値は、特定の値に偏ることが無く、ランダムともならず、更に各種の値に適度に分散して分布するものとなる。
そして、このように作成したディザマトリックスを用いて、中間調のカラー画像を2値化処理し、出力部19(カラープリンタ)にて記録したところ、人間の目に対してノイジーとならず、かつ解像度が悪化せず、紋様の発生が抑制された疑似中間調の2値化画像を生成することができた。勿論、画像の2値化処理時はディザ法であり、誤差拡散法のように多数の計算は行わないので、迅速に処理することができた。
【0077】
そして特に、本実施の形態では、前述したS320,S420にて、図4の粗密計算処理を実行することにより、2値マトリックスFi をコピーした処理対象マトリックスSMi の各要素について、図7の拡散配分マトリックスに基づく式1,2の演算を順次行い、全要素の平均値が2値マトリックスFi の全要素の平均値Hi とほぼ一致するように、2値マトリックスFi の各要素の値を他の要素の値に拡散させた処理対象マトリックスSMi を得るようにしている。
【0078】
そして、前述したS360では、粗密計算処理が行われた後の処理対象マトリックスSMi の全要素の内で最大値を有する要素の位置を、2値マトリックスFi にて「1」の要素が最も密である位置と判断し、前述したS460では、粗密計算処理が行われた後の処理対象マトリックスSMi の全要素の内で最小値を有する要素の位置を、2値マトリックスFi にて「1」の要素が最も粗である位置と判断するようにしている。
【0079】
従って、本実施の形態によれば、2値マトリックスFi にて「1」の要素が最も密である位置、あるいは最も粗である位置を、人間の主観に頼ることなく、定量的且つ確実に検出することができ、この結果、上述したように解像度の低下,目障りな紋様の発生,及びノイジー性を抑制可能なディザマトリックスを、経験や勘を必要とせずに極めて簡単に作成することができる。
【0080】
しかも、本実施の形態によれば、基本マトリックスFn (2値マトリックスFi )のマトリックスサイズが大きくても、前述したS360,S460の処理にて、「1」の要素の粗密を確実に判断できるため、大きなサイズのディザマトリックスを容易に作成でき、一層大きな効果を得ることができる。
【0081】
即ち、ディザマトリックスの大きさよりも広い中間調画像を2値化する場合には、画像の部分部分を順次、ディザマトリックスの大きさの領域毎に2値化処理することになるが、この場合、ディザマトリックスのサイズが小さいと、2値化後の画像上に、ディザマトリックスを繰り返して用いることに起因する一定パターンの紋様が現れ易くなってしまう。これに対して、本実施の形態によれば、128×128といった大きなサイズのディザマトリックスを簡単に作成することができるため、このような問題を解決することができるのである。
【0082】
[実施の形態2]
次に、実施の形態2として、前述した少ドットマトリックス作成処理(図3)のS320、及び多ドットマトリックス作成処理(図5)のS420にて、走査方向が異なる複数の粗密計算処理を実行する、ディザマトリックス作成装置について説明する。尚、以下では、前述した実施の形態1に対して異なる点についてのみ説明する。
【0083】
まず、本実施の形態2において、図3のS320及び図5のS420では、ワーキングメモリ14の中からドット数がドット数番号iと一致する2値マトリックスFi を選択すると、その2値マトリックスFi に対し、図4に示した粗密計算処理を、図11にてNo.1〜No.8で示される8種類の拡散配分マトリックス及び走査方向(つまり、注目要素を順次選択する主走査方向x,副走査方向y)に基づき、合計8回実行する。そして、この8回の実行により、2値マトリックスFi の各要素の値を、No.1〜No.8の走査方向で夫々拡散させた、8個の処理対象マトリックスSM1i 〜SM8i を作成する。
【0084】
尚、図11に示すNo.1の拡散配分マトリックス及び走査方向は、実施の形態1のものと同じである。また、他のNo.2〜No.8は、No.1に対して、走査方向(主走査方向x,副走査方向y)が夫々異なっており、それに応じて拡散配分マトリックスにおける各重み付け係数α1〜α4の注目要素位置「*」に対する配置順が異なっている。そして、No.1〜No.8の拡散配分マトリックス及び走査方向に夫々基づいて実行される各粗密計算処理のS335では、対応する拡散分配マトリックスにて、注目要素位置「*」から見て重み付け係数α1〜α4が設定されている位置の要素が、周辺要素として選択される。
【0085】
即ち、S320及びS420で1回目に実行される粗密計算処理(図4)では、そのS327にて、2値マトリックスFi をコピーして第1の処理対象マトリックスSM1i を作る。そして、S330にて、図11のNo.1に示す如く、実施の形態1の場合と同様に、処理対象マトリックスSM1i の左上の位置を原点とし、その原点からはじめて右方向を主走査方向x,下方向を副走査方向yとして、各要素を注目要素として順次選択することにより、2値マトリックスFiの各要素の値を、右方向を主走査方向x,下方向を副走査方向yとして拡散させた処理対処マトリックスSM1i を得る。
【0086】
一方、2回目に実行される粗密計算処理では、S327にて、2値マトリックスFi をコピーして第2の処理対象マトリックスSM2i を作り、S330にて、図11のNo.2に示す如く、処理対象マトリックスSM2i の右上の位置を原点とし、その原点からはじめて左方向を主走査方向x,下方向を副走査方向yとして、各要素を注目要素として順次選択する。そして、これにより、2値マトリックスFi の各要素の値を、左方向を主走査方向x,下方向を副走査方向yとして拡散させた処理対処マトリックスSM2i を得る。
【0087】
また、3回目に実行される粗密計算処理では、S327にて、2値マトリックスFi をコピーして第3の処理対象マトリックスSM3i を作り、S330にて、図11のNo.3に示す如く、処理対象マトリックスSM3i の左下の位置を原点とし、その原点からはじめて右方向を主走査方向x,上方向を副走査方向yとして、各要素を注目要素として順次選択する。そして、これにより、2値マトリックスFi の各要素の値を、右方向を主走査方向x,上方向を副走査方向yとして拡散させた処理対処マトリックスSM3i を得る。
【0088】
また更に、4回目〜8回目に実行される粗密計算処理でも、上記と同様に、S327の夫々にて、2値マトリックスFi をコピーして処理対象マトリックスSM4i ないしSM8i を作り、S330にて、図11のNo.4〜No.8に夫々示す走査方向の順で、処理対象マトリックスSM4i ないしSM8i の各要素を注目要素として順次選択する。これにより、2値マトリックスFi の各要素の値をNo.4〜No.8の走査方向で夫々拡散させた処理対処マトリックスSM4i 〜SM8i を得る。
【0089】
そして、本実施の形態2において、図3のS360及び図5のS460では、前述の如く粗密計算処理を8回実行して得た8個の処理対象マトリックスSM1i 〜SM8i について、各要素の値を同一位置の要素毎に平均した平均値を算出し、その平均値に基づき、2値マトリックスFi にて「1」の要素が最も密である位置、あるいは「1」の要素が最も粗である位置を判断する。
【0090】
即ち、図3のS360では、算出した平均値が最も大きい要素の位置を、2値マトリックスFi にて「1」の要素が最も密である位置と判断し、図4のS460では、算出した平均値が最も小さい要素の位置を、2値マトリックスFi にて「1」の要素が最も粗である位置と判断するのである。
【0091】
以上のように、本実施の形態2においては、2値マトリックスFi に対して、走査方向が異なる複数の粗密計算処理を実行し、その計算結果の平均値に基づいて、2値マトリックスFi にて「1」の要素が最も密である位置あるいは最も粗である位置を判断するようにしている。
【0092】
これは、前述した式1,2から明らかなように、粗密計算処理では、注目要素の値を既に補正した周辺要素の値に応じて補正していくようにしているため、同一の2値マトリックスFi であっても、粗密計算処理の走査方向(つまり、注目要素を選択していく方向)が異なれば、各要素の補正後の値が変わり、延いては、「1」の要素が最も密であると判断される位置、あるいは最も粗であると判断される位置が変わってくるからである。
【0093】
そして、本実施の形態2のように、走査方向が異なる複数の粗密計算処理を実行するようにすることで、2値マトリックスFi にて「1」の要素が最も密である位置、あるいは最も粗である位置を、より確実に検出できるようになる。
[実施の形態3]
次に、実施の形態3について説明する。本実施の形態3のディザマトリックス作成装置では、前述した実施の形態2に対して、以下に述べる処理を更に追加して実行している。
【0094】
まず、本実施の形態3において、図3のS320及び図5のS420では、ワーキングメモリ14の中からドット数がドット数番号iと一致する2値マトリックスFi を選択すると、図12に示すように、その2値マトリックスFi を複数個(本実施の形態では、6×6の合計36個)配置してなる拡大処理対象マトリックスF′i を作成し、その作成した拡大処理対象マトリックスF′i に対して、前述した如く走査方向が夫々異なる8種類の粗密計算処理を実行する。そして更に、S320及びS420では、粗密計算処理を実行して得た計算結果のうち、図12にて斜線で如く、拡大処理対象マトリックスF′i の中でほぼ中央に配置された1つの2値マトリックスFi に対応する領域Rの各要素の値だけを、次の処理で用いる処理対象マトリックスSM1i 〜SM8i として、ワーキングメモリ14内に保存する。
【0095】
すると、図3のS360では、S320で保存された上記領域Rに対応する処理対象マトリックスSM1i 〜SM8i に基づき、2値マトリックスFi にて「1」の要素が最も密である位置を判断し、図5のS460では、S420で保存された上記領域Rに対応する処理対象マトリックスSM1i 〜SM8i に基づき、2値マトリックスFi にて「1」の要素が最も粗である位置を判断することとなる。
【0096】
そして、上述した処理を追加して行う本実施の形態3によれば、2値マトリックスFi にて「1」の要素が最も密である位置、あるいは「1」の要素が最も粗である位置を、より一層確実に検出できるようになる。
つまり、既述したように、粗密計算処理のS330で注目要素として選択された要素が、図6にて斜線で示したように当該粗密計算処理が主走査方向xと副走査方向yとに夫々最初に実行される領域(先頭要素ライン部)に存在する要素であった場合には、その注目要素に対する全ての周辺要素が存在しないため、その存在しない周辺要素の値としては、予め定められた所定値(例えば「0」)が用いられる。
【0097】
よって、このように粗密計算処理が開始される先頭要素ライン部分やそれに近い領域では、各要素の値が十分且つ正確に他の要素の値へ拡散されなくなり、この結果、上記先頭要素ライン部分やそれに近い領域に関しては、「1」の要素の粗密を適切に判断することができない場合が生じてしまう。
【0098】
そこで、本実施の形態3では、「1」の要素の粗密を計算すべき2値マトリックスFi を複数個配置してなる拡大処理対象マトリックスF′i に対して、粗密計算処理を実行し、その計算結果のうち、上記先頭要素ライン部分やそれに近い領域を全く含まない領域(即ち、本実施の形態3では、拡大処理対象マトリックスF′i の中でほぼ中央に配置された2値マトリックスFi に対応する領域R)についての計算結果を用いて、「1」の要素の粗密を判断するようにしており、この結果、2値マトリックスFi にて「1」の要素が最も密である位置、あるいは最も粗である位置を、より一層確実に検出できるのである。そして、これにより、解像度の低下,目障りな紋様の発生,及びノイジー性を抑制可能なディザマトリックスを、常に安定して作成することが可能となる。
【図面の簡単な説明】
【図1】 実施の形態1のディザマトリックス作成装置の主要ブロック図である。
【図2】 実施の形態1のディザマトリックス作成処理を表すフローチャートである。
【図3】 図2のディザマトリックス作成処理で実行される少ドットマトリックス作成処理を表すフローチャートである。
【図4】 実施の形態1の粗密計算処理を表わすフローチャートである。
【図5】 図2のディザマトリックス作成処理で実行される多ドットマトリックス作成処理を表すフローチャートである。
【図6】 実施の形態1の注目要素「*」に対する周辺要素の配置説明図である。
【図7】 実施の形態1の拡散分配マトリックスの構成説明図である。
【図8】 図3の少ドットマトリックス作成処理及び図5の多ドットマトリックス作成処理の作用を説明する説明図である。
【図9】 実施の形態1でワーキングメモリに保存される2値マトリックスの説明図である。
【図10】 実施の形態1の集積結果マトリックスの説明図である。
【図11】 実施の形態2の粗密計算処理を説明する説明図である。
【図12】 実施の形態3の粗密計算処理を説明する説明図である。
【符号の説明】
2…ディザマトリックス作成装置 10…入力部
11…マイクロコンピュータ部 12…CPU 13…プログラムメモリ
14…ワーキングメモリ 16…ディザマトリックス格納メモリ
17…出力イメージメモリ 18…システムバス 19…出力部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a method of creating a dither matrix for converting a multi-value image into a binary image.
[0002]
[Prior art]
The data constituting the image is usually expressed in shades of about 8 bits. However, in a device that outputs this image data as an image that can be seen by humans, for example, an output device such as a printer, a dye such as ink is used as dots on recording paper because of its simple mechanism and ease of control. So-called binary recording, in which only the attachment is performed, is common.
[0003]
When using such a binary recording output device to record an image expressed in 8-bit grayscale, whether or not to apply ink by simply judging the value of each pixel based on a threshold value. Will be determined. However, by simply binarizing with the threshold value in this way, the rich shade state possessed by the 8-bit shade gradation (256 gradations for one color and 256 gradations for each of the three primary colors, approximately 16.7 million colors) can be obtained. It is impossible to express. For this reason, a method of expressing a shaded state in a pseudo manner in such a binary recording output device has been considered. In other words, this is the concept of area gradation in which shading is expressed by the number of dots arranged in a predetermined area.
[0004]
Various proposals have been made as methods for realizing this concept. For example, an error diffusion method, a random number generation type dither method, a systematic dither method, or the like.
[0005]
[Problems to be solved by the invention]
However, these methods have the following problems.
The error diffusion method has a problem that the binarization process is slowed down because an operation for error diffusion or error distribution must be executed for each pixel. Since the random number generation type dither method uses a dither matrix in which threshold values for each element position are arranged, the binarization process itself is fast, but since the threshold values are determined using random numbers, the threshold values in each element are completely different. There is a problem that the image quality is very noisy, that is, the image quality is such that a lot of noise is filled with the image.
[0006]
As another method using the dither matrix, there is a spiral type belonging to the systematic dither method. However, since this spiral type moves the threshold order from the closest pixel position, the dots are likely to be dense and dense. Since it was recognized as a large dot, the resolution was easily lowered. Further, among the systematic dither methods, there is a Bayer method. In this Bayer method, the order of threshold values is shifted from a pixel position as far as possible, so that dots are dispersed and resolution is good. However, the dispersion pattern of the dots became regular, and an unsightly pattern was likely to occur.
[0007]
The present invention creates a dither matrix capable of suppressing generation of a pattern without causing an image to become noisy or a decrease in resolution even when image processing is performed using a dither method. The purpose is to provide a method.
[0008]
[Means for solving the problems and effects of the invention]
In the dither matrix creating method of the present invention according to claim 1,
In a binary matrix in which each element is binarized in advance to a first predetermined value or a second predetermined value smaller than the first predetermined value, the position where the set state of elements having the first predetermined value is the most dense (in other words, Then, the position of the element having the second predetermined value is detected at the most rough position), and the value of the element existing at the position is replaced from the first predetermined value to the second predetermined value. A first matrix generation process for generating a new matrix having one less element having a first predetermined value than the value matrix;
By using a predetermined basic matrix prepared in advance as the first binary matrix and repeatedly using the generated new matrix as the next binary matrix, an element having a first predetermined value over the basic matrix Generate multiple matrices with one less
Further, in a binary matrix in which each element is binarized in advance to a first predetermined value or a second predetermined value smaller than the first predetermined value, the set state of elements having the first predetermined value is the coarsest (In other words, the position where the set state of the elements having the second predetermined value is the densest) is detected, and the value of the element existing at that position is replaced from the second predetermined value to the first predetermined value, A second matrix generation process for generating a new matrix having one more element having a first predetermined value than the binary matrix;
By using the basic matrix as the first binary matrix and repeatedly using the generated new matrix as the next binary matrix, one element having a first predetermined value than the basic matrix is obtained one by one. Generate multiple matrices,
Based on a matrix group consisting of a plurality of matrices generated by repeating the first and second matrix generation processes and the basic matrix, Sum the binarized values of the elements at the same position, starting from the element with the largest total value. Set a threshold for each element in the dither matrix.
[0009]
Here, each of the plurality of matrices generated by repeating the first matrix generation process as described above is not formed independently, but in a matrix having one element having the first predetermined value more than itself. It is formed by replacing the value of the element existing at the position where the set state of the elements having the first predetermined value is the most dense from the first predetermined value to the second predetermined value, and from the first predetermined value to the second The positions of the elements that are sequentially replaced with the predetermined value are appropriately dispersed without being biased toward a specific region.
[0010]
Similarly, each of the plurality of matrices generated by repeating the second matrix generation process as described above is not independently formed, but is a matrix having one less element having the first predetermined value than itself. Is formed by replacing the value of the element existing at the position where the aggregate state of the elements having the first predetermined value is the coarsest from the second predetermined value with the first predetermined value, and from the second predetermined value to the first predetermined value. 1 The positions of elements that are sequentially replaced with a predetermined value are moderately dispersed without being biased toward a specific region.
[0011]
As a result, a plurality of matrices generated by repetition of the first and second matrix generation processes and the basic matrix that is the basis of these matrices are, for example, in order from the smallest number of elements having the first predetermined value. If arranged, the elements having the first predetermined value in each matrix are not random at all, but are irregularly distributed and sequentially increased one by one.
[0012]
For this reason, when a threshold value of each element in the dither matrix is set based on a matrix group composed of a plurality of matrices generated by repeating the first and second matrix generation processes and the basic matrix, each element of the dither matrix The thresholds in are not biased to specific values, are not random, and are distributed in various values in a moderately distributed manner, and the resolution decreases even when image processing is performed using the dither matrix that is formed. In addition, annoying patterns are suppressed, and it is not random, so it is not noisy.
[0013]
By the way, in the first and second matrix generation processes, when the position where the set state of the elements having the first predetermined value is the densest or the coarsest is detected, the denseness is determined by human subjectivity. It is conceivable to determine a certain position or a rough position. However, if this is done, the criteria for determining the density will be ambiguous. In particular, if the size of the matrix (the total number of elements) is large, the density cannot be determined.
[0014]
Therefore, in particular, in the first and second matrix generation processes in the dither matrix creation method of the present invention,
Each element of the matrix to be processed is sequentially selected as a target element in the order of a predetermined scanning direction, and the value of the selected target element is determined according to the value of a peripheral element existing in a predetermined peripheral position when viewed from the target element By correcting, the value of each element of the processing target matrix is changed to the other element so that the average value of all the original elements of the processing target matrix and the average value of all the elements after the correction substantially match. A diffusion process for diffusing to the value of is performed on the binary matrix,
Furthermore, in the first matrix generation process, the position of the element having the maximum value among all the elements corrected by the diffusion process is expressed as the set state of the elements having the first predetermined value in the binary matrix. In the second matrix generation process, the position of the element having the minimum value among all the elements corrected by the diffusion process is detected as the first predetermined value in the binary matrix. Is detected as a position where the set state of the elements having the roughest is the most rough.
[0015]
In other words, in the present invention, the value of each element of the binary matrix is changed to the value of the other element so that the average value of all the original elements of the binary matrix and the average value of all the elements after correction are substantially the same. Performing a diffusion process to diffuse, and determining the position of the element having the largest value after correction (after diffusion) as the position where the set state of the elements having the first predetermined value is the densest in the binary matrix; Conversely, the position of the element having the smallest value after correction (after diffusion) is determined to be the position where the set state of the elements having the first predetermined value is the coarsest in the binary matrix.
[0016]
Therefore, according to the dither matrix creation method of the present invention, the position where the set state of the elements having the first predetermined value is the densest or the coarsest position in the binary matrix can be determined without depending on human subjectivity. Quantitative and reliable detection. As a result, as described above, a dither matrix capable of suppressing the reduction in resolution, the generation of annoying patterns, and noisiness can be created very easily without requiring experience or intuition.
[0017]
Moreover, according to the present invention, even if the size of the basic matrix (binary matrix) is large, it is possible to reliably determine the density of elements having the first predetermined value in the first and second matrix generation processes. As a result, a dither matrix having a large size can be easily created, and a greater effect can be obtained.
[0018]
That is, when binarizing an image wider than the size of the dither matrix, the partial portion of the image is sequentially binarized for each area of the dither matrix size. If the size of the pattern is small, a pattern having a certain pattern due to repeated use of the dither matrix tends to appear on the binarized image. On the other hand, according to the present invention, a dither matrix having a large size can be easily created, so that such a problem can be solved.
[0019]
As the diffusion processing, as described in claim 2, each element of the processing target matrix is sequentially selected as a target element in the order of a predetermined scanning direction, and the target element is selected with respect to the value of the selected target element. A value obtained by multiplying a value of a peripheral element existing at one or a plurality of peripheral positions determined in advance by a predetermined weighting coefficient is added, and the average value of all the original elements of the processing target matrix is added. The value obtained by multiplying the sum of the coefficients can be reduced, and the value after the addition and subtraction can be stored as the corrected value of the element of interest.
[0020]
In other words, in order to correct the value of the element of interest according to the value of the peripheral element, basically, the value obtained by multiplying the value of the peripheral element by a predetermined weighting factor is added to the value of the target element. It is good, but if you just do this, the value of each element will only be corrected to be larger, and the average value of all elements after correction will be very large compared to the original average value of all elements. End up. Therefore, not only the above addition, but also the subtraction of subtracting the value obtained by multiplying the average value of all the original elements by the sum of the weighting coefficients of the respective peripheral elements, so that all the original elements of the processing target matrix (binary matrix) are obtained. The value of each element of the binary matrix can be diffused to the value of the other element while the average value of the elements and the average value of all the elements after correction are substantially matched.
[0021]
On the other hand, in the first and second matrix generation processes, as described in claim 3, a plurality of diffusion processes with different scanning directions are executed on the binary matrix, and the respective diffusion processes are executed. Based on the average value obtained by averaging the values of each element obtained for each element at the same position, the position where the set state of the elements having the first predetermined value is the densest or the coarsest is detected in the binary matrix. You may make it do.
[0022]
This is because even if the same binary matrix is used, if the scanning direction of the diffusion process (that is, the direction in which the element of interest is selected) is different, the corrected value of each element changes, and as a result, the first This is because the position where the element having the predetermined value is detected as being the densest or the position where the element is detected as being the coarsest changes. Then, as described in claim 3, by performing a plurality of diffusion processes with different scanning directions, and averaging the values of each element obtained by executing each of the diffusion processes for each element at the same position, In the binary matrix, it is possible to more reliably detect the position where the aggregate state of the elements having the first predetermined value is the densest or the coarsest.
[0023]
On the other hand, in the first and second matrix generation processes, as described in claim 4, the diffusion process is performed on an expanded matrix in which a plurality of binary matrices are arranged, and the diffusion process is performed. Among the values of the elements obtained by executing the first predetermined value in the binary matrix based on the values of the elements in the region corresponding to the binary matrix that does not include the head element line portion for which the diffusion processing has been started. You may make it detect the position where the assembly state of the element which has a value is the densest or the coarsest.
[0024]
This is because the value of each element is not sufficiently diffused in the head element line portion where the spreading process has been started or in the region close thereto, in other words, regarding the head element line portion and the region close thereto, This is because there is a possibility that the density of the element having the first predetermined value cannot be properly determined.
[0025]
Then, if processing is performed as set forth in claim 4, the value of each element of the binary matrix is made substantially equal to the average value of all the original elements of the binary matrix and the average value of all the elements after correction. Based on the corrected value sufficiently diffused to the values of the other elements, the density of the elements having the first predetermined value can be determined. As a result, the set of elements having the first predetermined value in the binary matrix The position where the state is the densest or the coarsest can be detected more reliably. In particular, the combination of the process according to claim 3 and the process according to claim 4 is more reliable.
[0026]
By the way, in the dither matrix creating method according to claim 1 to claim 4, the basic matrix may be a random arrangement of elements having a first predetermined value and elements having a second predetermined value. As described in claim 5, if all elements are formed by performing error diffusion processing on a matrix having the same multivalue and binarizing each element into a first predetermined value or a second predetermined value A greater effect can be obtained.
[0027]
That is, the arrangement of the binary values (first predetermined value and second predetermined value) generated by the error diffusion method looks irregular at first glance, but is not random (random) at all. That is, there is a property that it is difficult to make a strong pattern but a noisy image. Then, by using the binary sequence generated by such an error diffusion method, the dither matrix finally incorporates the characteristics of the binary sequence in the error diffusion method to some extent. Therefore, it is possible to further enhance the effect that the resolution is not lowered, an unobtrusive pattern does not occur, and the human eye is not noisy.
[0028]
Of course, when a basic matrix having elements having a first predetermined value and elements having a second predetermined value arranged at random is used, there is some concern about noisy, A plurality of new binary matrices that are not generated are generated, and a dither matrix is created based on these matrix groups, so that noisiness can be greatly reduced.
[0029]
DETAILED DESCRIPTION OF THE INVENTION
[Embodiment 1]
FIG. 1 is a main block diagram of the dither matrix creation device 2.
The microcomputer unit 11 constituting the main body of the dither matrix creating apparatus 2 includes a CPU 12, a program memory 13 composed of ROM, a working memory 14 composed of RAM, a dither matrix storage memory 16 composed of RAM, and an output image memory 17 composed of RAM. It is configured. An input unit 10 and an output unit 19 are connected to the microcomputer unit 11 via a system bus 18.
[0030]
The input unit 10 includes an interface for inputting from a keyboard or an external storage device, and inputs data and instructions necessary for creating a dither matrix. In addition, the input unit 10 inputs image data having a gradation in which each pixel is represented by 8 bits in order to confirm the effect of the created dither matrix.
[0031]
The CPU 12 is for executing creation of a dither matrix according to a program as will be described later, and the program memory 13 stores programs for performing various controls performed by the CPU 12, including a dither matrix creation program. . The working memory 14 temporarily stores data necessary for the CPU 12 to execute a program stored in the program memory 13.
[0032]
The dither matrix storage memory 16 stores dither matrix data formed by the processing of the CPU 12.
The output image memory 17 uses the dither matrix stored in the dither matrix storage memory 16 by the CPU 12 to binarize image data having a gradation represented by 8 bits. Store image data.
[0033]
The output unit 19 is a device (color printer) that prints binary image data stored in the output image memory 17 with or without dots by an electrophotographic method.
Next, a dither matrix creation process executed by the dither matrix creation device 2 will be described. A flowchart of the dither matrix creation process is shown in FIG. In this embodiment, the density value of one pixel is used for binarization processing of a halftone image represented by 256 gradations of 0 to 255, and the size (that is, the number of threshold values) is k ( For example, a dither matrix with k = 128 × 128) is created.
[0034]
As shown in FIG. 2, when the execution of the dither matrix generation process is started, first, in step (hereinafter simply referred to as “S”) 100, the number of pixels is k (= 128 × 128), and A uniform density pixel matrix in which all pixels are set to a predetermined uniform density value (for example, 70 when the maximum density value is 255) is read into the working memory 14, and the uniform density pixel matrix is binarized by an error diffusion method. To process.
[0035]
The error diffusion method referred to here is used in a broad sense. When a certain pixel is binarized, a binarization error is distributed to the density of surrounding pixels that have not yet been binarized (narrow). Meaning error diffusion method / literature: Robert W. Floyd and Louis Steinberg, "An Adaptive Algorithm for Spatial Greyscale", Proceeding of the SID Vol.17 / 2, 1976, etc.) A method of receiving a predetermined ratio of errors generated during binarization from already binarized pixels (also called the mean error minimum method. Reference: JFJarvis, CNJudice, and WHNinke, "A Survey of Techniques for the Display of Continuous Tone" Since Pictures on Bilevel Displays ", Computer Graphics and Image Processing.5, 13-40 (1976), etc.) are well known, detailed description of the error diffusion method itself is omitted.
[0036]
In the present embodiment, each pixel of the uniform density pixel matrix is binarized into either “1” (with dots = on) or “0” (without dots = off) by an error diffusion method. In the binary matrix after binarization, the number of elements “1” (hereinafter also referred to as the number of dots) is assumed to be n (0 <n <k). In the following description, for example, “n dots” indicates that the number of dots is n.
[0037]
Next, in the subsequent S200, the binary matrix obtained by the binarization process of S100 is stored in the working memory 14 as an n-dot binary matrix (hereinafter referred to as a basic matrix) Fn that is the basis of the following process. save.
In the subsequent S300, n binary matrices (that is, the basic matrix) from the binary matrix Fn-1 of (n-1) dots to the binary matrix F0 of 0 dots are based on the basic matrix Fn. A small dot matrix creating process for creating n binary matrices (Fn-1 to F0) each having one less "1" element than the matrix Fn is executed.
[0038]
Details of the small dot matrix creation processing in S300 are shown in the flowchart of FIG.
As shown in FIG. 3, when the execution of the small dot matrix creation process is started, first, in S310, the dot number number i for specifying the binary matrix to be processed this time is set as an initial value. “N” which is the number of dots of the basic matrix Fn is set.
[0039]
In the subsequent S320, a binary matrix (i-dot binary matrix) Fi having the number of dots matching the dot number number i is selected from the working memory 14, and the binary matrix Fi is shown in FIG. By executing the density calculation processing shown in FIG. 4, the density (dot density) of the element that is “1” is calculated for the binary matrix Fi. When the process of S320 is first executed, the dot number number i is set to “n” in S310, so that the binary matrix Fi of i dots is stored in the working memory 14 in S200. The saved basic matrix Fn is selected.
[0040]
Here, in the coarse / fine calculation processing of S320, as shown in FIG. 4, first, in S325, the average value Hi of all elements of the binary matrix Fi of i dots selected as the current processing target is calculated, and then to S327. Then, the selected binary matrix Fi is copied on the working memory 14, and a processing target matrix SMi identical to the binary matrix Fi is created. In this embodiment, since each element of the binary matrix is binarized to “1” or “0”, the average value Hi calculated in S325 is the number of dots i in the binary matrix Fi. Divided by the total number of elements k (i / k).
[0041]
In subsequent S330, the target element (x, y) is selected from the processing target matrix SMi created in S327, and the value of the target element (x, y) (that is, the original binarized value) Dx, Read y. In the present embodiment, as shown in FIG. 6, the upper left position of the processing target matrix SMi is the origin (0, 0), and starting from this origin (0, 0), the right direction is the main scanning direction x. Each element is sequentially selected as a target element, with the downward direction as the sub-scanning direction y.
[0042]
Next, in the subsequent S335, as shown in FIG. 6, four elements (x-1, y-) existing at four peripheral positions adjacent to the target pixel "*" (x, y) in the processing target matrix SMi. 1) Each of the above peripherals after (x, y-1), (x + 1, y-1), (x-1, y) are selected as peripheral elements and corrected by the process of S345 described later. The element values Dx-1, y-1, Dx, y-1, Dx + 1, y-1 and Dx-1, y are read from the working memory 14.
[0043]
Note that, as indicated by hatching in FIG. 6, the elements present in the region (first element line portion) where the coarse / fine calculation process is first executed in the main scanning direction x and the sub-scanning direction y are determined in S330. When the element of interest “*” is selected, all four peripheral elements do not exist. Therefore, in this case, as a value of a peripheral element that does not exist, a predetermined value (“0” in the present embodiment, but preferably an average value Hi of all elements) is used.
[0044]
Then, in subsequent S340, it is stored in advance in the program memory 13 or the working memory 14, and from the diffusion distribution matrix shown in FIG. 1), weighting coefficients α1 (= 2/16), α2 (= 4/16), α3 corresponding to (x, y−1), (x + 1, y−1), and (x−1, y), respectively. (= 3/16) and α4 (= 4/16) are read.
[0045]
In the subsequent S345, the average value Hi obtained in S325, the value of the element of interest (x, y) read in S330 (original binarized value) Dx, y, and the peripheral elements read in S335 are corrected. From the values Dx-1, y-1, Dx, y-1, Dx + 1, y-1, Dx-1, y, and the weighting factors α1, α2, α3, α4 of the peripheral elements read in S340, Based on Expression 1, a correction value D′ x, y of the element of interest (x, y) is calculated, and the correction value D′ x, y is calculated for the element of attention (x, y) as shown in Expression 2 below. The value is saved in the working memory 14 as the value Dx, y.
[0046]
[Expression 1]
Figure 0003740739
[0047]
It should be noted that the value Dx, y of the current element of interest corrected in this way is the value after correction of the peripheral elements in S335 described above when another element is selected as the element of interest in S330. Will be read as
When the process of S345 is completed in this way, in subsequent S350, it is determined whether or not the process has been completed for all the elements of the process target matrix SMi. If there are any unprocessed elements, the process returns to S330 and the process target is processed. The process of S330 to S345 described above is repeated with the element of the next coordinate in the matrix SMi as the target element. If it is determined in S350 that the processes for all elements have been completed, the coarse / fine calculation process is terminated.
[0048]
In other words, in the coarse / fine calculation processing, the values Dx-1, y-1, Dx, y-1, Dx + 1, y-1, and Dx-1, y of the peripheral elements are set to the value Dx, y of the target element. A value obtained by multiplying a predetermined weighting coefficient α1, α2, α3, α4 is added, and a value obtained by multiplying the average value Hi of all the original elements of the processing target matrix SMi by the sum of weighting coefficients (α1 + α2 + α3 + α4) is added. And the operation of Equations 1 and 2 in which the value D′ x, y after the subtraction is stored as the corrected value Dx, y of the element of interest is the same as the processing target matrix SMi copied from the binary matrix Fi. Each element is executed sequentially.
[0049]
Then, the processing target matrix SMi after this coarse / fine calculation processing is performed is such that the average value of all elements substantially coincides with the average value Hi of all elements of the binary matrix Fi. This is a matrix in which values are diffused to the values of other elements.
[0050]
As described above, when the execution of the coarse / dense calculation process of FIG. 4 ends in S320 of the small dot matrix generation process, the process proceeds to S360 as shown in FIG.
In S360, the position of the element having the maximum value among all the elements of the processing target matrix SMi after the density calculation processing is performed, and the element "1" is the most dense in the binary matrix Fi. It is determined that there is a certain position (the dot is the densest position), and further, in the binary matrix Fi, the value of the element at the position where the element “1” is determined to be the densest is changed from “1” to “0”. By making the change, a binary matrix Fi-1 having (i-1) dots, which is one less than the binary matrix Fi, is created, and the binary matrix Fi-1 is stored in the working memory 14. To do.
[0051]
Thereafter, in the subsequent S370, the value of the dot number number i is decreased by 1 (decremented), and in the subsequent S380, it is determined whether or not the value of the dot number number i is greater than zero. If the value of the dot number number i is still larger than 0, the process returns to S320, and the binary matrix Fi whose dot number matches the current dot number number i (that is, the binary newly created in the previous S360). The above-described processing of S320 to S370 is repeated with the matrix Fi-1) as the current processing target. If it is determined in S380 that the dot number number i is not greater than 0, the small dot matrix creation process is terminated.
[0052]
Therefore, when this small dot matrix creation process is completed, the working memory 14 stores the above-mentioned basic matrix Fn and n binary matrices Fn-1 to n elements, each of which is one less than the basic matrix Fn. F0 is saved.
[0053]
Here, in order to simplify the description, the basic matrix Fn stored in S200 has a total number of elements k of 25 (= 5 × 5) and a number of dots n of 8 as shown in FIG. 8A, for example. The case will be described.
In this case, in S320 of the small dot matrix creation process (FIG. 3), the basic matrix Fn is first selected as the binary matrix F8 as the processing target, and the coarse / fine calculation process of FIG. 4 is performed on the binary matrix F8. Is executed. Then, the value of each element of the processing object matrix SM8 produced by copying the binary matrix F8 in S327 of the coarse / fine calculation process finally becomes a value as shown in FIG.
[0054]
In S360 following the small dot matrix creation process, the position of the element of “0.73” which is the maximum value (max) among all the elements of the processing target matrix SM8 is set to “1” in the binary matrix F8. It is judged that the element of is the densest position. In S360, as indicated by a circle in FIG. 8C, the value of the element at the position where the element "1" is determined to be the most dense position as described above in the binary matrix F8 is "1". By changing from “0” to “0”, a binary matrix F7 having 7 elements (1 dot) is created.
[0055]
Thereafter, the processing of S320 and S360 is also executed for the newly created binary matrix F7 to create a binary matrix F6 having 6 elements (1 dot), and so on. By repeating this process, as shown in FIG. 8D, a binary matrix F 0 in which all elements are “0” is created.
[0056]
As described above, when the small dot matrix creating process is executed to create n binary matrices Fn-1 to F0 each having one less "1" element than the basic matrix Fn, as shown in FIG. The process proceeds to S400.
At S400, this time, (k−n) binary values from the (n + 1) dot binary matrix Fn + 1 to the k dot binary matrix Fk based on the basic matrix Fn. A multi-dot matrix creating process for creating a matrix (that is, (k−n) binary matrices having one more “1” element than the basic matrix Fn) one by one is executed.
[0057]
Here, the details of the multi-dot matrix creation process of S400 are shown in the flowchart of FIG.
As shown in FIG. 5, when the execution of the multi-dot matrix creation process is started, the same processing as S310 and S320 of the small dot matrix creation process described above is performed in S410 and S420.
[0058]
That is, first in S410, “n”, which is the number of dots of the basic matrix Fn, is set as an initial value to the dot number number i for specifying the binary matrix to be processed this time. Next, in S420, a binary matrix (i-dot binary matrix) Fi having the number of dots matching the dot number number i is selected from the working memory 14, and the binary matrix Fi has been described above. By executing the coarse / fine calculation process of FIG. 4, the coarse / fine (dot coarse / dense) of the element which is “1” is calculated for the binary matrix Fi.
[0059]
When the execution of the coarse / fine calculation process shown in FIG. 4 is completed in S420, the process proceeds to S460, and the position of the element having the minimum value among all the elements of the processing target matrix SMi after the coarse / fine calculation process is performed. Is determined as the position where the element “1” is the coarsest in the binary matrix Fi (the position where the dot is the coarsest), and the position where the element “1” is the coarsest in the binary matrix Fi. By changing the value of the element at the determined position from “0” to “1”, a binary matrix Fi + 1 having (i + 1) dots having one more “1” element than the binary matrix Fi is created. Then, the binary matrix Fi + 1 is stored in the working memory 14.
[0060]
Thereafter, in the subsequent S470, the value of the dot number number i is incremented by 1 (incremented), and in the subsequent S480, it is determined whether or not the value of the dot number number i is equal to or less than the total number of elements k. If the value of the dot number number i is still less than or equal to k, the process returns to S420 and the binary matrix Fi whose dot number matches the current dot number number i (that is, the binary newly created in the previous S460). The processing of S420 to S470 described above is repeated with the matrix Fi + 1) as the current processing target. If it is determined in S480 that the dot number number i is not less than or equal to k, the multi-dot matrix creation process is terminated.
[0061]
That is, in the multi-dot matrix creation process, contrary to the small-dot matrix creation process, all the elements of the processing target matrix SMi obtained by executing the coarse / fine calculation process of FIG. 4 on the binary matrix Fi selected this time are used. In the binary matrix Fi, the position of the element having the minimum value is determined to be the position where the element of “1” is the coarsest, and the value of the element at that position is changed from “0” in the binary matrix Fi. By changing to “1”, the process of creating a binary matrix Fi + 1 having one more “1” element than the binary matrix Fi is repeated.
[0062]
For example, the case where the basic matrix Fn has a total number of elements k of 25 (= 5 × 5) and the number of dots n is 8 as illustrated in FIG. 8A will be described.
In this case, in S420 of the multi-dot matrix creation process (FIG. 5), as in the case of the small-dot matrix creation process, first, the basic matrix Fn is first selected as the binary matrix F8 to be processed, and its binary value is selected. The coarse / fine calculation process of FIG. 4 is performed on the matrix F8. As described above, the values of the respective elements of the processing target matrix SM8 produced by copying the binary matrix F8 in the coarse / dense calculation process S327 are as shown in FIG. 8B.
[0063]
Then, in S460 of the multi-dot matrix creation process, the position of the element “−0.28” that is the minimum value (min) among all the elements of the processing target matrix SM8 is set to “1” in the binary matrix F8. The element is determined to be the most rough position, and as indicated by the circle in FIG. 8 (e), in the binary matrix F8, the element at the position where the element "1" is determined to be the roughest position as described above. By changing the value of “0” from “0” to “1”, a binary matrix F9 having nine (9 dots) elements is created.
[0064]
Then, by executing the processing of S420 and S460 for the newly created binary matrix F9, a binary matrix F10 with 10 elements (1 dot) is created, and so on. By repeating the process, the binary matrix F25 (= Fk) in which all elements are "1" is created as shown in FIG. 8 (f).
[0065]
Therefore, when the execution of the multi-dot matrix creation process is completed in S400 of FIG. 2, (k−n) binary matrices Fn + 1 to Fk, each having one more “1” element than the basic matrix Fn. As a result, as shown in FIG. 9, in the working memory 14, all elements including the basic matrix Fn are “1” from the binary matrix F0 having all elements “0”. Up to a certain binary matrix Fk, (k + 1) binary matrices F0 to Fk are stored.
[0066]
When the execution of the multi-dot matrix creation process is completed in this way, the process proceeds to S500 as shown in FIG. In S500, the binarized values of the elements at the same position are summed for all the binary matrices F0 to Fk in the working memory 14, and an integration result matrix M having the sum as an element is formed. That is, the values for all element positions of all binary matrices F0 to Fk are summed, and the total value is stored in the same position of the integration result matrix M prepared in the working memory 14 as shown in FIG. It is.
[0067]
Subsequently, in S600, threshold values for the dither matrix are set in order from the element position with the largest total value of the accumulation result matrix M, and in S700, the dither matrix storage memory 16 uses the matrix composed of the threshold values as a dither matrix. Then, the dither matrix creation process is terminated.
[0068]
The setting of the threshold value in S600 is performed as follows, for example.
First, when numbers are assigned in order from the element positions having the largest total value in the accumulation result matrix M, the numbers become 1 to 16384 (= 128 × 128 = k), and “1” in all the binary matrices F0 to Fk. It corresponds to the element position where the element increases by one. Further, the density value of each pixel of the halftone image to be binarized is 256 gradations from 0 to 255 as described above.
[0069]
Therefore, in S600, in the order of the above numbers, for example, for the element positions with numbers 1 to 64 (= 16384/256), “0” is set as the threshold for the dither matrix, and the element positions with numbers 65 to 128 are set. Is set to “1” as the threshold value, “2” is set as the threshold value for the element positions with numbers 129 to 192,..., And the threshold value is set to “2” for the element positions with numbers 16257 to 16320. “254” is set, and the element positions with numbers 16321 to 16384 are set in such a manner that “255” is set as the threshold value, and the threshold value is set in order from the element position with the smallest number.
[0070]
Also, in S600, contrary to the above, “255” is set as the threshold for the element positions with numbers 1 to 64, and “254” is set as the threshold for the element positions with numbers 65 to 128. .. For elements positions with numbers 16257 to 16320, “1” is set as the threshold value, and for element positions with numbers 16321 to 16384, “0” is set as the threshold value. You may make it set a threshold value small sequentially from a position.
[0071]
In the present embodiment, S320 and S360 of the small dot matrix creation process shown in FIG. 3 correspond to the first matrix generation process, and S420 and S460 of the multi-dot matrix creation process shown in FIG. This corresponds to the second matrix generation process. The coarse / fine calculation processing of FIG. 4 executed in S320 of the small dot matrix creation processing and S420 of the multi-dot matrix creation processing corresponds to the diffusion processing.
[0072]
As described above in detail, in the dither matrix creation device 2 of the present embodiment, first, the uniform density pixel matrix is binarized by the error diffusion method, so that n dots (n elements of “1” are included). ) Is generated (S100, S200).
[0073]
Then, in the i-dot binary matrix Fi, the value of the element existing in the position where the element of “1” is the densest is replaced from “1” to “0”, so that one element of “1” is obtained. By repeating the processes of S320 and S360 for generating a small new binary matrix Fi-1 with the basic matrix Fn as the first binary matrix Fi, there is one "1" element than the basic matrix Fn. N binary matrices Fn-1 to F0 which are smaller by one are generated (S300), and the value of the element existing at the position where the element of "1" is the coarsest is obtained for the binary matrix Fi of i dots. By replacing “0” with “1”, the processing of S420 and S460 for generating a new binary matrix Fi + 1 having one more “1” element is performed, and the basic matrix Fn is replaced with the first binary. As trix Fi, by repeating, it has generated one by one element of "1" than the basic matrix Fn often (k-n) pieces of binary matrix Fn + 1 ~Fk (S400).
[0074]
Therefore, in the binary matrixes Fn-1 to F0 generated by repeating S320 and S360, the positions of elements that are sequentially replaced from "1" to "0", and generated by repeating S420 and S460. In the binary matrixes Fn + 1 to Fk, the positions of the elements that are sequentially replaced from “0” to “1” are moderately dispersed without being biased toward a specific region, and as a result, are generated by repeating the above processing. If the plurality of matrixes F0 to Fn-1, Fn + 1 to Fk and the basic matrix Fn which is the basis of these matrices are arranged in order from the one with the smallest number of elements "1" as shown in FIG. In each matrix F0 to Fk, the elements of "1" are not random at all, but are irregularly distributed and sequentially increased one by one.
[0075]
Therefore, in the dither matrix creating apparatus 2 of the present embodiment, the dither matrix is based on the matrix group consisting of the basic matrix Fn and the binary matrices F0 to Fn-1 and Fn + 1 to Fk generated as described above. The threshold value of each element is set (S500 to S700).
[0076]
For this reason, the threshold value in each element of the dither matrix is not biased to a specific value, is not random, and is distributed appropriately distributed in various values.
Then, using the dither matrix created in this way, a halftone color image is binarized and recorded by the output unit 19 (color printer). It was possible to generate a pseudo-halftone binary image in which the resolution was not deteriorated and the generation of patterns was suppressed. Of course, the binarization processing of the image is a dither method, and since many calculations are not performed unlike the error diffusion method, the image can be processed quickly.
[0077]
In this embodiment, in particular, in the above-described S320 and S420, the coarse / dense calculation process of FIG. 4 is executed, so that each element of the processing target matrix SMi copied from the binary matrix Fi is diffused and distributed as shown in FIG. The operations of Equations 1 and 2 based on the matrix are sequentially performed, and the value of each element of the binary matrix Fi is changed to the other elements so that the average value of all the elements substantially matches the average value Hi of all the elements of the binary matrix Fi The processing object matrix SMi diffused to the value of is obtained.
[0078]
In S360 described above, the position of the element having the maximum value among all the elements of the processing target matrix SMi after the density calculation processing is performed, and the element of “1” is the most dense in the binary matrix Fi. In S460 described above, the position of the element having the minimum value among all the elements of the processing target matrix SMi after the coarse / dense calculation process is performed is set to the element “1” in the binary matrix Fi. Is determined to be the roughest position.
[0079]
Therefore, according to the present embodiment, the position where the element “1” is the densest or the coarsest in the binary matrix Fi is quantitatively and reliably detected without depending on human subjectivity. As a result, as described above, a dither matrix capable of suppressing a decrease in resolution, generation of an unsightly pattern, and noisiness can be created very easily without requiring experience or intuition.
[0080]
In addition, according to the present embodiment, even if the matrix size of the basic matrix Fn (binary matrix Fi) is large, the density of the element “1” can be reliably determined by the processing of S360 and S460 described above. A dither matrix having a large size can be easily created, and a greater effect can be obtained.
[0081]
That is, when binarizing a halftone image wider than the size of the dither matrix, the partial portions of the image are sequentially binarized for each area of the dither matrix size. If the size of the dither matrix is small, a pattern with a certain pattern due to repeated use of the dither matrix tends to appear on the binarized image. On the other hand, according to the present embodiment, a dither matrix having a large size of 128 × 128 can be easily created, so that such a problem can be solved.
[0082]
[Embodiment 2]
Next, as the second embodiment, a plurality of density calculation processes with different scanning directions are executed in S320 of the small dot matrix creation process (FIG. 3) and S420 of the multidot matrix creation process (FIG. 5). A dither matrix creation device will be described. In the following, only differences from the first embodiment will be described.
[0083]
First, in the second embodiment, in S320 of FIG. 3 and S420 of FIG. 5, when a binary matrix Fi whose dot number matches the dot number number i is selected from the working memory 14, the binary matrix Fi is selected. On the other hand, the coarse / fine calculation processing shown in FIG. 1-No. This is executed a total of eight times based on the eight types of diffusion distribution matrixes indicated by 8 and the scanning direction (that is, the main scanning direction x and the sub-scanning direction y for sequentially selecting the target element). Then, by executing this eight times, the value of each element of the binary matrix Fi is changed to No. 1-No. Eight processing target matrices SM1i to SM8i are created by diffusing in the eight scanning directions.
[0084]
In addition, No. shown in FIG. 1 diffusion distribution matrix and the scanning direction are the same as those in the first embodiment. In addition, other No. 2-No. 8 is No.8. 1, the scanning direction (main scanning direction x, sub-scanning direction y) is different, and the arrangement order of the weighting coefficients α1 to α4 in the diffusion distribution matrix with respect to the target element position “*” differs accordingly. Yes. And No. 1-No. In S335 of each of the coarse / dense calculation processes executed based on each of the eight diffusion distribution matrices and the scanning direction, weighting coefficients α1 to α4 are set in the corresponding diffusion distribution matrix as viewed from the target element position “*”. A position element is selected as a peripheral element.
[0085]
That is, in the coarse / fine calculation processing executed in S320 and S420 for the first time (FIG. 4), in S327, the binary matrix Fi is copied to create the first processing target matrix SM1i. In S330, No. 1 in FIG. As shown in FIG. 1, as in the case of the first embodiment, the upper left position of the processing target matrix SM1i is the origin, and starting from the origin, the right direction is the main scanning direction x and the lower direction is the sub scanning direction y. Are sequentially selected as elements of interest to obtain a processing countermeasure matrix SM1i in which the values of the elements of the binary matrix Fi are diffused with the rightward direction as the main scanning direction x and the downward direction as the subscanning direction y.
[0086]
On the other hand, in the coarse / fine calculation processing executed for the second time, in S327, the binary matrix Fi is copied to create the second processing target matrix SM2i. As shown in FIG. 2, each element is sequentially selected as a target element, with the upper right position of the processing target matrix SM2i as the origin, the left direction as the main scanning direction x and the lower direction as the sub scanning direction y starting from the origin. Thus, a processing countermeasure matrix SM2i is obtained in which the values of the elements of the binary matrix Fi are diffused with the left direction as the main scanning direction x and the downward direction as the sub-scanning direction y.
[0087]
In the coarse / fine calculation processing executed for the third time, the binary matrix Fi is copied to create a third processing target matrix SM3i in S327, and in S330, No. 1 in FIG. 3, the lower left position of the processing target matrix SM3i is set as the origin, and from the origin, the right direction is the main scanning direction x, the upper direction is the sub scanning direction y, and each element is sequentially selected as a target element. Thus, a processing countermeasure matrix SM3i is obtained in which the values of the elements of the binary matrix Fi are diffused with the right direction as the main scanning direction x and the upward direction as the sub-scanning direction y.
[0088]
Further, in the coarse / fine calculation processing executed for the fourth time to the eighth time, similarly to the above, in S327, the binary matrix Fi is copied to create the processing target matrices SM4i to SM8i, and in S330, No. 11 no. 4-No. Each element of the processing object matrices SM4i to SM8i is sequentially selected as a target element in the order of the scanning direction shown in FIG. As a result, the value of each element of the binary matrix Fi is set to No. 4-No. The processing countermeasure matrices SM4i to SM8i diffused in the eight scanning directions are obtained.
[0089]
In the second embodiment, in S360 of FIG. 3 and S460 of FIG. 5, the values of the respective elements are set for the eight processing target matrices SM1i to SM8i obtained by executing the coarse / dense calculation process eight times as described above. An average value is calculated for each element at the same position, and based on the average value, the position where the element “1” is the densest or the position where the element “1” is the coarsest in the binary matrix Fi Judging.
[0090]
That is, in S360 of FIG. 3, the position of the element having the largest calculated average value is determined as the position where the element “1” is the densest in the binary matrix Fi, and in S460 of FIG. The position of the element having the smallest value is determined as the position where the element of “1” is the coarsest in the binary matrix Fi.
[0091]
As described above, in the second embodiment, a plurality of coarse / fine calculation processes with different scanning directions are performed on the binary matrix Fi, and the binary matrix Fi is used based on the average value of the calculation results. The position where the element “1” is the densest or the coarsest is determined.
[0092]
As is clear from the above-described equations 1 and 2, in the coarse / fine calculation process, the value of the element of interest is corrected according to the value of the peripheral element that has already been corrected. Even in the case of Fi, if the scanning direction of the density calculation process (that is, the direction in which the element of interest is selected) is different, the corrected value of each element changes, and the element “1” is the most dense. This is because the position determined to be or the position determined to be the coarsest changes.
[0093]
Then, by executing a plurality of coarse / fine calculation processes with different scanning directions as in the second embodiment, the position where the element “1” is the densest or the coarsest in the binary matrix Fi. It is possible to more reliably detect the position.
[Embodiment 3]
Next, Embodiment 3 will be described. In the dither matrix creating apparatus according to the third embodiment, the processing described below is further added to the above-described second embodiment and executed.
[0094]
First, in the third embodiment, in S320 of FIG. 3 and S420 of FIG. 5, when a binary matrix Fi whose dot number matches the dot number number i is selected from the working memory 14, as shown in FIG. Then, an enlargement processing target matrix F′i is formed by arranging a plurality of the binary matrices Fi (in this embodiment, a total of 36 × 6 × 6), and the created enlargement processing target matrix F′i On the other hand, as described above, eight types of coarse / fine calculation processes with different scanning directions are executed. Further, in S320 and S420, among the calculation results obtained by executing the coarse / fine calculation process, one binary value arranged almost at the center in the enlargement process target matrix F′i, as shown by the oblique line in FIG. Only the values of the respective elements in the region R corresponding to the matrix Fi are stored in the working memory 14 as processing target matrices SM1i to SM8i used in the next processing.
[0095]
Then, in S360 of FIG. 3, based on the processing target matrices SM1i to SM8i corresponding to the region R stored in S320, the position where the element of “1” is the densest in the binary matrix Fi is determined. In S460 of No. 5, based on the processing target matrices SM1i to SM8i corresponding to the region R stored in S420, the position where the element “1” is the coarsest in the binary matrix Fi is determined.
[0096]
Then, according to the third embodiment which is performed by adding the above-described processing, the position where the element “1” is the densest or the position where the element “1” is the coarsest in the binary matrix Fi. , It becomes possible to detect more reliably.
That is, as described above, the element selected as the element of interest in S330 of the coarse / fine calculation process is processed by the coarse / fine calculation process in the main scanning direction x and the sub-scanning direction y, respectively, as indicated by hatching in FIG. If it is an element that exists in the area to be executed first (first element line part), since there are not all peripheral elements for the element of interest, the value of the peripheral element that does not exist is determined in advance. A predetermined value (for example, “0”) is used.
[0097]
Therefore, in the head element line portion where the coarse / fine calculation processing is started in this way or in an area close thereto, the value of each element is not sufficiently and accurately diffused to the value of the other element. For a region close to that, the density of the element “1” cannot be appropriately determined.
[0098]
In the third embodiment, therefore, a coarse / fine calculation process is performed on an enlargement processing target matrix F′i in which a plurality of binary matrices Fi for calculating the coarse / fine of the element “1” are arranged. Of the calculation results, the area that does not include the head element line portion or the area close thereto (that is, in the third embodiment, the binary matrix Fi arranged almost at the center in the enlargement processing target matrix F′i). The calculation result for the corresponding region R) is used to determine the density of the element “1”. As a result, the position where the element “1” is the densest in the binary matrix Fi, or The most rough position can be detected more reliably. As a result, it is possible to always stably create a dither matrix capable of suppressing a reduction in resolution, occurrence of an unsightly pattern, and noisiness.
[Brief description of the drawings]
FIG. 1 is a main block diagram of a dither matrix creating apparatus according to a first embodiment.
FIG. 2 is a flowchart showing a dither matrix creation process according to the first embodiment.
FIG. 3 is a flowchart showing a small dot matrix creation process executed in the dither matrix creation process of FIG. 2;
FIG. 4 is a flowchart showing a coarse / fine calculation process according to the first embodiment.
FIG. 5 is a flowchart showing a multi-dot matrix creation process executed in the dither matrix creation process of FIG.
FIG. 6 is an explanatory diagram of arrangement of peripheral elements with respect to a target element “*” according to the first embodiment.
7 is a configuration explanatory diagram of a diffusion distribution matrix according to Embodiment 1. FIG.
FIG. 8 is an explanatory diagram for explaining the operation of the small dot matrix creation process of FIG. 3 and the multi-dot matrix creation process of FIG. 5;
FIG. 9 is an explanatory diagram of a binary matrix stored in the working memory in the first embodiment.
10 is an explanatory diagram of an integration result matrix according to Embodiment 1. FIG.
FIG. 11 is an explanatory diagram for explaining coarse / dense calculation processing according to the second embodiment;
FIG. 12 is an explanatory diagram for explaining coarse / dense calculation processing according to the third embodiment;
[Explanation of symbols]
2 ... Dither matrix creation device 10 ... Input section
11 ... Microcomputer part 12 ... CPU 13 ... Program memory
14 ... Working memory 16 ... Dither matrix storage memory
17 ... Output image memory 18 ... System bus 19 ... Output unit

Claims (5)

予め各要素が第1所定値あるいは該第1所定値よりも小さい第2所定値に2値化された2値マトリックスについて、第1所定値を有する要素の集合状態が最も密である位置を検出し、その位置に存在する要素の値を第1所定値から第2所定値に置換することで、前記2値マトリックスよりも第1所定値を有する要素が1つ少ない新たなマトリックスを生成する第1のマトリックス生成処理を、予め用意した所定の基本マトリックスを最初の2値マトリックスとして用いると共に、前記生成した新たなマトリックスを次回の2値マトリックスとして用いることで繰り返し行うことにより、前記基本マトリックスよりも第1所定値を有する要素が1つずつ少ないマトリックスを複数生成し、
また、予め各要素が第1所定値あるいは該第1所定値よりも小さい第2所定値に2値化された2値マトリックスについて、第1所定値を有する要素の集合状態が最も粗である位置を検出し、その位置に存在する要素の値を第2所定値から第1所定値に置換することで、前記2値マトリックスよりも第1所定値を有する要素が1つ多い新たなマトリックスを生成する第2のマトリックス生成処理を、前記基本マトリックスを最初の2値トリックスとして用いると共に、前記生成した新たなマトリックスを次回の2値マトリックスとして用いることで繰り返し行うことにより、前記基本マトリックスよりも第1所定値を有する要素が1つずつ多いマトリックスを複数生成し、
前記第1及び第2のマトリックス生成処理の繰り返しによって生成された複数のマトリックスと、前記基本マトリックスと、からなるマトリックス群に基づいて、同一位置の要素の2値化値を合計し、その合計値の大きい要素から順にディザマトリックスにおける各要素の閾値を設定するディザマトリックス作成方法であって、
前記第1及び第2のマトリックス生成処理では、
処理対象マトリックスの各要素を所定の走査方向の順に注目要素として順次選択すると共に、選択した注目要素の値を該注目要素から見て予め定められた周辺位置に存在する周辺要素の値に応じて補正していくことで、前記処理対象マトリックスの元の全要素の平均値と前記補正後の全要素の平均値とがほぼ一致するように、前記処理対象マトリックスの各要素の値を他の要素の値に拡散させる拡散処理を、前記2値マトリックスに対して行い、
更に、前記第1のマトリックス生成処理では、
前記拡散処理により補正した後の全要素の内で最大値を有する要素の位置を、前記2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置として検出し、
前記第2のマトリックス生成処理では、
前記拡散処理により補正した後の全要素の内で最小値を有する要素の位置を、前記2値マトリックスにて第1所定値を有する要素の集合状態が最も粗である位置として検出すること、
を特徴とするディザマトリックス作成方法。
For a binary matrix in which each element is binarized in advance to a first predetermined value or a second predetermined value smaller than the first predetermined value, a position where the set state of elements having the first predetermined value is the densest is detected. Then, by replacing the value of the element existing at that position from the first predetermined value to the second predetermined value, a new matrix that has one element having the first predetermined value less than the binary matrix is generated. 1 matrix generation processing is performed by repeatedly using a predetermined basic matrix prepared in advance as the first binary matrix and using the generated new matrix as the next binary matrix. Generating a plurality of matrices having one element each having a first predetermined value,
Further, in a binary matrix in which each element is binarized in advance to a first predetermined value or a second predetermined value smaller than the first predetermined value, the set state of elements having the first predetermined value is the coarsest And a new matrix having one more element having the first predetermined value than the binary matrix is generated by replacing the value of the element existing at that position with the first predetermined value from the second predetermined value. The second matrix generation process is performed repeatedly by using the basic matrix as the first binary matrix and using the generated new matrix as the next binary matrix. Generate multiple matrices with one element each having a predetermined value,
Based on a matrix group consisting of a plurality of matrices generated by repeating the first and second matrix generation processes and the basic matrix, the binarized values of elements at the same position are summed, and the total value A dither matrix creation method for setting a threshold value of each element in a dither matrix in order from an element having a larger size ,
In the first and second matrix generation processes,
Each element of the matrix to be processed is sequentially selected as a target element in the order of a predetermined scanning direction, and the value of the selected target element is determined according to the value of a peripheral element existing in a predetermined peripheral position when viewed from the target element By correcting, the value of each element of the processing target matrix is changed to the other element so that the average value of all the original elements of the processing target matrix and the average value of all the elements after the correction substantially match. A diffusion process for diffusing to the value of is performed on the binary matrix,
Furthermore, in the first matrix generation process,
Detecting the position of the element having the maximum value among all the elements corrected by the diffusion process as the position where the set state of the elements having the first predetermined value is the densest in the binary matrix;
In the second matrix generation process,
Detecting the position of the element having the minimum value among all the elements corrected by the diffusion processing as the position where the set state of the elements having the first predetermined value is the coarsest in the binary matrix;
A dither matrix creation method characterized by
前記拡散処理は、
前記選択した注目要素の値に対して、該注目要素から見て予め定められた1つあるいは複数の周辺位置に存在する周辺要素の値に所定の重み付け係数を乗じた値を加算すると共に、前記処理対象マトリックスの元の全要素の平均値に前記重み付け係数の総和を乗じた値を減じ、前記加算及び減算を行った後の値を前記注目要素の補正後の値として記憶する処理であること、
を特徴とする請求項1記載のディザマトリックス作成方法。
The diffusion process is
A value obtained by multiplying a value of a peripheral element existing at one or a plurality of predetermined peripheral positions as viewed from the target element by a predetermined weighting coefficient is added to the value of the selected target element. A process of subtracting a value obtained by multiplying the average value of all the original elements of the processing target matrix by the sum of the weighting coefficients and storing the value after the addition and subtraction as the corrected value of the element of interest. ,
The method of creating a dither matrix according to claim 1.
前記第1及び第2のマトリックス生成処理では、
前記2値マトリックスに対して走査方向が夫々異なる複数の前記拡散処理を実行すると共に、前記各拡散処理の実行によって得た各要素の値を同一位置の要素毎に平均した平均値に基づき、前記2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置あるいは粗である位置を検出すること、
を特徴とする請求項1または請求項2記載のディザマトリックス作成方法。
In the first and second matrix generation processes,
Based on an average value obtained by averaging the values of each element obtained by executing each of the diffusion processes for each element at the same position, while executing a plurality of the diffusion processes with different scanning directions for the binary matrix Detecting a position in which a set state of elements having the first predetermined value is the densest or the coarsest in the binary matrix;
The dither matrix creating method according to claim 1, wherein:
前記第1及び第2のマトリックス生成処理では、
前記2値マトリックスを複数個配置してなる拡大マトリックスに対して前記拡散処理を実行すると共に、該拡散処理の実行によって得た各要素の値のうち、前記拡散処理が開始された先頭要素ライン部分を含まない2値マトリックスに対応する領域の各要素の値に基づき、前記2値マトリックスにて第1所定値を有する要素の集合状態が最も密である位置あるいは粗である位置を検出すること、
を特徴とする請求項1〜請求項3記載のディザマトリックス作成方法。
In the first and second matrix generation processes,
The first element line portion where the diffusion processing is started among the values of each element obtained by executing the diffusion processing on the enlarged matrix formed by arranging a plurality of binary matrices. Detecting a position in which a set state of elements having the first predetermined value is the densest or coarsest in the binary matrix based on the value of each element in the region corresponding to the binary matrix not including
The dither matrix creating method according to claim 1, wherein:
前記基本マトリックスは、全ての要素が同一の多値からなるマトリックスを誤差拡散処理して、各要素を第1所定値あるいは第2所定値に2値化して形成されたものであること、
を特徴とする請求項1〜請求項4記載のディザマトリックス作成方法。
The basic matrix is formed by performing error diffusion processing on a matrix having all the same multivalues and binarizing each element into a first predetermined value or a second predetermined value,
The dither matrix creating method according to claim 1, wherein:
JP12183396A 1996-05-16 1996-05-16 Dither matrix creation method Expired - Fee Related JP3740739B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12183396A JP3740739B2 (en) 1996-05-16 1996-05-16 Dither matrix creation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12183396A JP3740739B2 (en) 1996-05-16 1996-05-16 Dither matrix creation method

Publications (2)

Publication Number Publication Date
JPH09307755A JPH09307755A (en) 1997-11-28
JP3740739B2 true JP3740739B2 (en) 2006-02-01

Family

ID=14821067

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12183396A Expired - Fee Related JP3740739B2 (en) 1996-05-16 1996-05-16 Dither matrix creation method

Country Status (1)

Country Link
JP (1) JP3740739B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010214962A (en) * 2010-05-06 2010-09-30 Seiko Epson Corp Dither matrix generating method and printing using dither matrix

Also Published As

Publication number Publication date
JPH09307755A (en) 1997-11-28

Similar Documents

Publication Publication Date Title
JP4396896B2 (en) Threshold matrix generation method, threshold matrix generation apparatus, and recording medium
JP3571716B2 (en) Improved error variance system
US8405877B2 (en) Laser print apparatus with dual half tones
US7791766B2 (en) Image processing apparatus and image processing method
US20030231348A1 (en) Image processing method and image processing apparatus
JP5124268B2 (en) Method and apparatus for generating a dither mask by interpolation between preferred patterns
JP4783566B2 (en) System and method for processing color image data
JP3740739B2 (en) Dither matrix creation method
US7295347B2 (en) Image processing method for generating multi-level data
JP4241441B2 (en) Image processing apparatus, image processing method, and image processing program
JP4108517B2 (en) Halftoning processing method and halftoning processing system
JP3740732B2 (en) Dither matrix creation method
JP3287717B2 (en) Image processing device
JP3709599B2 (en) Dither matrix creation method
JP3431779B2 (en) Threshold value matrix error diffusion binarization method and computer system
JP3965713B2 (en) Color image binarization method by error diffusion method
JP2003153001A (en) Image processing method based on error diffusion method
JPH10136205A (en) Image processor
JP5018878B2 (en) Resolution conversion program, resolution conversion method, and resolution conversion apparatus
JP4222151B2 (en) Image processing apparatus, image processing method, and image processing program
JP3928576B2 (en) Image processing apparatus, method, program, and recording medium recording the program
JP2005039413A (en) Image processor, image processing method and program
JP2005252807A (en) Image processing method, printing system and printer
JP4965378B2 (en) Image forming method and image forming system
JP2003023540A (en) Image processor

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050726

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050907

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051031

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091118

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20101118

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101118

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20111118

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20111118

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20121118

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20131118

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees