JP2004048194A - Image processor and method thereof - Google Patents

Image processor and method thereof Download PDF

Info

Publication number
JP2004048194A
JP2004048194A JP2002200521A JP2002200521A JP2004048194A JP 2004048194 A JP2004048194 A JP 2004048194A JP 2002200521 A JP2002200521 A JP 2002200521A JP 2002200521 A JP2002200521 A JP 2002200521A JP 2004048194 A JP2004048194 A JP 2004048194A
Authority
JP
Japan
Prior art keywords
threshold
noise
noise matrix
quantization
pixel
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.)
Withdrawn
Application number
JP2002200521A
Other languages
Japanese (ja)
Inventor
Shohei Tsutsumi
堤 正平
Atsushi Nochida
後田 淳
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2002200521A priority Critical patent/JP2004048194A/en
Publication of JP2004048194A publication Critical patent/JP2004048194A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To output a high quality image by preventing the chain bond of dots in an output image. <P>SOLUTION: A threshold variation LUT 102 stores a threshold variation LUT which gives it so that a mean quantization error is zero every density to avoid delaying the dot growth. A noise matrix memory 103 stores a noise matrix given to the threshold to control the dot dispersion. A threshold calculator 104 adds a noise component given in the noise matrix for a specified threshold to a threshold variation to obtain a quantizing threshold, and a quantizer 105 quantizes input pixels. An error diffuser 107 diffuses the quantization error and adds it to input pixel values. As the result, pixels are quantized by the error diffusion method and outputted. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、入力された多階調画像を、入力画像の階調数より少ない階調数を有する画像に変換する画像処理方法及びその装置に関するものである。
【0002】
【従来の技術】
(第1の従来例)
従来、多値画像データを二値画像(または二値以上で入力階調数よる少ない階調数を有する画像)に変換する手段としてR.Floydらによる誤差拡散法(”An adaptive algorithm for spatial gray scale”, SID International Symposium Digest of Technical Papers, vol4.3, 1975, pp.36−37)がある。この誤差拡散法は、ある画素で生じた二値化誤差を以降の複数画素へ拡散することにより、擬似的に階調表現を行うものである。
【0003】
しかしながら、従来の誤差拡散法を用いた画像処理装置では、低濃度領域(ハイライト領域)の立ち上り部におけるドット生成が大幅に遅延するという問題があった。上記問題点を解決するため、特開平8−307680では多値画像データの階調値に基づいて閾値を設定する誤差拡散法が開示されている。この方法を概説すると、多階調画像データを誤差拡散法又は平均誤差最小法を用いて第1階調値及び第2階調値に変換する画像処理装置において、注目画素の多階調画像データの階調値に基づいて閾値のベース成分を設定し、さらにそのベース成分に乱数値を加えて二値化のための閾値を設定する手法である。この手法によれば、注目画素の多階調画像データの階調値に応じて閾値を最適化することにより、ドットの生成遅延を抑制している。
【0004】
(第2の従来例)
また、従来の誤差拡散法を用いた画像処理装置では、図19に示されるように、ハイライト領域においては、生成されたドットが鎖状につながる傾向が強いことからドットの分散性が均一に保たれず、画品位が低下する問題があった。上記問題点を解決するため、特開平9−284552では閾値に印加するノイズの特性を二次元的に制御する誤差拡散法が開示されている。この方法を概説すると、入力画素の階調を、より少数の階調に変換して出力する擬似中間調処理方法であって、量子化時に用いる閾値として、低周波成分を抑制した二値の不規則信号を用いる手法である。この手法によれば、閾値に低周波成分を押さえた二値の二次元的な閾値マトリクスを用い、閾値マトリクスには「0」「1」の二値信号が予め格納されている。入力画像の画素位置における閾値マスクの信号成分が「0」の場合は閾値を192、「1」の場合は閾値を64と変動させることにより、ハイライト領域におけるドットの分散性を高めている。
【0005】
【発明が解決しようとする課題】
しかしながら、上記第1の従来例では、閾値に印加するノイズとして乱数を使用するため、前記ノイズの特性を二次元的に制御することが困難であり、前述のドットが鎖状に連結する現象に対して積極的な対策が講じられていなかった。更に、複数の色成分を有するカラーの入力画像に対して、互いの色成分を考慮して閾値及び閾値に印加されるノイズ量が規定されていないために、異なる色間でのドットの位置制御が不十分である欠点があった。
【0006】
また、上記第2の従来例では、全ての入力階調に対して、二値の閾値マトリックスを用いるため、ハイライト領域の立ち上り部におけるドットの生成遅延を防ぐことができない欠点があった。また、閾値として使用される64、192の二種の値については、両者の変動量が極めて著しいため、出力画像がノイズを多く含んだざらつき感の多い画像となる問題点もあった。
【0007】
本発明は、上記課題を鑑みてなされたものであり、誤差拡散法を用いた多値画像の擬似中間調表現処理に際し、ドットが鎖状に連結することを防止し、且つ、ハイライト領域の立ち上り部におけるドットの生成遅延を排除して、複数の色成分を有するカラーの入力画像に対しては、異なる色成分間でのドットの重なりを抑制するために相互の色成分に対するドットの位置制御を行いつつ、全階調にわたってドットの分散性が良好な処理結果を得られるような画像処理方法及び装置を提供することを目的とする。
【0008】
【課題を解決するための手段】
上記目的を達成するため次のような構成を有する。
【0009】
誤差拡散法により入力画像を量子化する画像処理装置であって、
量子化のための閾値の変動量を記憶する手段と、
前記閾値に印加するノイズの配置を規定するノイズマトリックスを記憶するメモリと、
前記閾値の変動量と前記ノイズマトリックスとを参照して量子化のための閾値を設定する閾値設定手段と、
前記閾値設定手段により設定された閾値により注目画素を量子化する量子化手段と、
前記量子化手段による量子化誤差を前記注目画素近傍の画素に拡散する誤差拡散手段とを有する。
【0010】
更に好ましくは、前記閾値設定手段は、入力画像の階調値に応じて前記閾値を設定する。
【0011】
この構成により、階調ごとに異なる閾値で量子化が行われるために、ドット生成の遅延を防止できる。
【0012】
更に好ましくは、前記閾値設定手段は、入力画像の階調値及び画素位置に応じて前記閾値を設定する。
【0013】
この構成により、階調ごとに異なる閾値で量子化が行われるために、ドット生成の遅延を防止でき、さらに画素位置に応じても異なる閾値で量子化することから、ドット生成される位置を制御することができる。
【0014】
更に好ましくは、前記閾値の変動量は、前記誤差拡散手段によって発生する量子化誤差の平均値が無視できる微小値となるように設定されている。
【0015】
この構成により、ドット生成の遅延を防止できる。
【0016】
更に好ましくは、前記閾値の変動量は、入力画像の階調値に応じて設定されている。
【0017】
この構成により、階調ごとに変動量を制御することで、ドットの分散を制御できる。
【0018】
更に好ましくは、前記ノイズマトリックスは、マトリックスの各要素の値が集中型の配置をした二次元配列である。
【0019】
この構成により、マトリクスの中央付近でドットが生成されやすくするため、ドットの連鎖による画質低下を防止できる。
【0020】
更に好ましくは、前記ノイズマトリックスは、量子化後のドットが、ノイズマトリクスを分割して成る領域ごとに集中的に生成されるよう値が配置される。
【0021】
この構成により、マトリクスを分割した領域ごとにその中央付近でドットが生成されやすくするため、ドットの連鎖による画質低下を防止できるとともに、集中する位置を、使用するマトリクスによって制御することもできる。
【0022】
更に好ましくは、前記ノイズマトリックスは、第一の値及び第二の値のみからなる二値の二次元配列である。
【0023】
この構成により、マトリクスのサイズを小さくできる。
【0024】
更に好ましくは、前記ノイズマトリックスは、入力画像の階調値に応じて選択される。
【0025】
この構成により、階調ごとに異なる閾値で量子化が行われるために、ドット生成の遅延を防止できる。
【0026】
更に好ましくは、前記入力画像は複数の色成分を含むカラー画像であり、前記ノイズマトリックスは、色成分毎に用意され、色成分ごとのノイズマトリクスは互いに相関がある。
【0027】
この構成により、色成分ごとにドットの分散を制御でき、画質低下を防止できる。
【0028】
更に好ましくは、前記色成分毎の相関は、ある色成分のノイズマトリックスに対して相対的に位置のずれたノイズマトリクスが、他の色成分について使用されることにある。
【0029】
この構成により、色成分ごとにドットの分散を制御でき、さらに色成分ごとに分散の仕方が異なるために、各色成分のドットの重複を制御でき、高品質の画像データを出力できる。
【0030】
【発明の実施の形態】
(第1の実施形態)
図1は、本発明の第1の実施形態である画像処理装置の構成を示したブロック図である。100は画素データの入力端子、101は累積誤差加算部、102は入力画素データの階調値に対応した閾値の変動量を格納してある閾値変動量ルックアップテーブル(以後、LUTと呼ぶ)、103は閾値に印加するノイズの配置を規定するノイズマトリックスが格納されたノイズマトリックスメモリ、104は量子化閾値を演算する閾値演算部、105は量子化部、106は量子化誤差を演算する誤差演算部、107は量子化誤差を拡散する誤差拡散部、108は累積誤差を格納する累積誤差メモリ、109は一連の処理後に形成された画像データの出力端子、110はアドレス入力端子である。
【0031】
以下、図1の画像処理装置の動作について図2のフローチャートに従って説明する。
【0032】
まず、図示しない画像走査部により入力画像が順次走査され各画素データが入力端子100より入力される(ステップS200)。図3は画像の走査を示した図である。30は入力画像の左上端の画素、31は入力画像の右下端の画素である。画像の走査は、画像領域の左上端の画素30から開始し、右方向に1画素ごとに進む。そして、画像データ列の右端に達したら1画素下の画像データ列の左端画素に移る。同処理を繰り返し行い右下端の画素31まで到達すると、画像の走査処理は完了する。
【0033】
次に、累積誤差加算部101において入力された画素データに累積誤差メモリの画素位置に対応する累積誤差値が加算される(ステップS201)。累積誤差メモリは1個の記憶領域E0と入力画像の横画素数Wと同数の記憶領域E(x)があり、後述する方法により量子化誤差が格納されている。なお、累積誤差メモリは処理開始前に全て初期値0で初期化されているものとする。図4は累積誤差メモリの詳細を示した図である。累積誤差加算部101では、入力画素データの横画素位置xに対応した誤差メモリE(x)の値が加算される。すなわち、入力画素データIは、累積誤差加算後の画素データをI’とすると、
I’=I+E(x)
となる。
【0034】
次に、閾値演算部104において、ノイズマトリックスメモリ103を参照し、閾値に印加されるノイズ量n_valを設定する(ステップS202)。まず、ノイズマトリックスメモリ103に格納されているノイズマトリックスより入力画素データの画素位置(x、y)に対応するノイズ量を求める。図8はノイズマトリックスの一例であり、マトリックスの各要素には当該位置の画素に印加するノイズ量を記載している。本実施形態1では、ノイズマトリックスの縦横の要素数を16×16とし、ノイズマトリックスにおける(i,j)番目のノイズ量をn(i,j)とすると、入力画素データの画素位置(x、y)に対応するノイズ量n_valは、
n_val=n(x%16、y%16)
となる。ここで、%はモジュロ(剰余)演算を表す。
【0035】
引き続き、閾値変動量LUT102を参照し、後述する方法に従って設定された閾値変動量と前記ノイズ量とを基に閾値が求められる(ステップS203)。すなわち、入力画素値が0から255の範囲の整数値とし、量子化時の基準となる閾値を128、前記閾値変動量をth_v(I)とすると、閾値th(I)は、
th(I)=128+th_v(I)+n_val
となる。
【0036】
続いて、量子化部105において、累積誤差加算後の画素データI’と閾値演算部104により設定された閾値th(I)とを比較し出力階調値Oを、式
O=0    (I’<th(I))
O=255  (I’≧th(I))
により決定する(ステップS204)。
【0037】
次に、誤差演算部106において、累積誤差加算後の画素データI’と出力値Oとの差分、すなわち量子化誤差Errを、式
Err=I’−O
により計算する(ステップS205)。
【0038】
次に、誤差拡散部107において、着目している画素の横方向位置xに応じて、以下のように量子化誤差Errの拡散処理が行われる(ステップS206)。
【0039】
E(x+1)←E(x+1)+Err×7/16  (x<W)
E(x−1)←E(x−1)+Err×3/16  (x>1)
E(x)←E0+Err×5/16        (1<x<W)
E(x)←E0+Err×8/16        (x=1)
E(x)←E0+Err×13/16       (x=W)
E0←Err×1/16             (x<W)
E0←0                    (x=W)。
【0040】
以上で、入力画像1画素分の二値化処理が完了する。前記二値化処理を入力画像の全画素に対して施されたか否かを判定し(ステップS207)、全画素に対して以上の処理が行われたと判断された場合、入力画像の擬似中間調処理が完了する。
【0041】
<閾値変動量設定手順>
次に、図5のフローチャートに従って、閾値変動量LUT102に格納される閾値変動量th_v(g)の設定手順を説明する。なお、gは階調値を表している。また、図7は前記閾値変動量の算出時に使用される画像を示しており、70は二値化処理が施される全画像領域であり、71は閾値変動量を算出する際の対象となる画像領域である。まず、全階調に対して閾値変動量th_v(g)及びノイズ量n(g)を0に初期化する(ステップS500)。つまり、閾値変動量を算出する際には、各階調値に対して閾値th(g)を、
th(g)=128
に設定する。図6は入力画素の階調値と後述する平均量子化誤差ave_E(g)の関係を示している。以下、入力階調値g=1における閾値変動量の設定手順について説明する。
【0042】
まず、図7に示すような512×512画素の一様な階調値g=1をもつ画像データに対して量子化処理を行い、量子化誤差の平均値ave_E(g)を求める(ステップS501)。画像の走査は、図3に示されるように、画像領域の左上端の画素から開始し、画像の右下端の画素に向かって二値化処理が行われる。そして、ドットの形成が安定状態に達したと思われる、画像の下端付近における256×256画素の画像領域71に対して、累積誤差加算後の画素データI’と出力画素値Oとの差分、すなわち量子化誤差Eの平均値ave_E(g)を求める。次に、量子化誤差の平均値ave_E(g)の符号を反転させた値を次式
th_v(g)=−ave_E(g)
に従って閾値変動量th_v(g)とし、閾値変動量LUT102に格納する(ステップS502)。
【0043】
次に、入力画素の階調データが取り得る全ての値(256階調)について上記処理が終了したか否かを確認し(ステップS503)、終了していれば、閾値変動量LUT102の作成処理を終了する。終了していなければ階調値gに1を加算してステップ501から繰り返す。一般に量子化誤差の平均値ave_E(g)が0とならない階調において、ドットの生成遅延が発生するとされている(特開平07−111591)。そこで本実施形態では、平均量子化誤差ave_E(g)が全ての入力階調に対して0となるように、量子化のための閾値変動量を設定する。上記の手順により、ドットの生成遅延を軽減できる閾値変動量を各階調値に応じて設定することができる。
【0044】
<ノイズマトリクス作成手順>
次に、ノイズマトリックスメモリ103に格納されるノイズマトリックス(図8)の作成手順を説明する。本実施形態ではノイズマトリックスのサイズは16×16画素とした。ノイズマトリックスにおける(i,j)番目のノイズ量をn(i,j)とすると、各画素位置におけるノイズ量は、ノイズマトリックスの中心画素位置(8,8)からの距離rに基づいて、次式
n(i,j)=floor(−10×cos(πr/8√2))
r=√((i−8)+(j−8)
で求められる。
【0045】
なお、関数floor(A)はAより大きくない最大の整数値を、πは円周率をそれぞれ表している。ここで、マイナスのノイズ量が与えられる画素は、当該画素の量子化時における閾値に印加されるノイズ量がマイナスであることを示す。これは同時に、前記閾値の値を低く設定することになり、如いてはドットが生成されやすいことを意味している。逆に、プラスのノイズ量が与えられる画素は、当該画素の量子化時における閾値に印加されるノイズ量がプラスであることを示す。これは同時に、前記閾値の値を高く設定することになり、如いてはドットが生成され難いことを意味している。上記の手順により、ドットが生成される傾向の強い画素位置と弱い画素位置を指定することが可能なノイズマトリックスが生成される。なお、ノイズマトリックス生成のための手段は本画像処理装置に組み込まれる必要はなく、予め別個のノイズマトリックス生成装置によりノイズマトリックスを生成し、結果のみをノイズマトリックスメモリに格納するものとする。
【0046】
以上のような構成により、ハイライト領域におけるドット分散性を向上させることができ、並びに、同領域の開始部におけるドットの生成の遅延が抑制され、ドット配置が均一な視覚的に好ましい二値ドットパターンを形成することができる。
【0047】
このように、図1に示す画像処理装置は、多値画像データを入力して2つ画像データを出力する。ここで、図1の画像処理装置が、画像スキャナ等の画像データ入力デバイスからの画像データを入力とし、電子写真式のプリンタなどの2値プリンタエンジンで2値化画像データを出力すれば、複写機や、各デバイスごと独立して使用できる複合機能デバイスなどが構成できる。画像入力デバイスを、通信媒体や蓄積媒体とのインターフェースに替えれば、対画像データを入力とするプリンタとして利用できる。
【0048】
これ以外にも、多値画像データを2値画像データに変換する機能を要するデバイスについて本実施形態の装置を適用できる。
【0049】
<コンピュータによる画像処理>
また、図1の画像処理装置はハードウエアにより構成することもできるが、図2の手順をプログラムとして実行することでコンピュータにより実現することもできる。
【0050】
図2の二値化処理や、図5の閾値変動量の設定手順を行うためのコンピュータの構成を図20に示す。図20のコンピュータにより図2の手順を実行することによっても、図1の構成が実現されることになる。
【0051】
図20において、ホストコンピュータ3000は、ROM3のプログラム用ROMやRAM2に記憶された、図2の手順および図5の手順のコンピュータプログラム、あるいはそれらのいずれかひとつのコンピュータプログラムに基づいて、それら手順を実行するCPU1を備える。システムバス4に接続される各デバイスはCPU1が統括的に制御する。RAM2は、CPU1の主メモリ、ワークエリア等として機能する。
【0052】
キーボードコントローラ(KBC)5は、キーボード9や不図示のポインティングデバイスからのキー入力を制御する。CRTコントローラ(CRTC)6は、CRTディスプレイ10の表示を制御する。ディスクコントローラ(DKC)7は、ブートプログラム、種々のアプリケーション、フォントデータ、ユーザファイル、編集ファイル等を記憶するハードディスク(HD)、フロッピーディスク(FD)等の外部メモリ11とのアクセスを制御する。RAM2および外部メモリ(例えばハードディスク)11は、図2や図5の手順のプログラムを格納するほか、閾値変動メモリ108や累積誤差メモリ107、ドットパターンメモリ109として機能する。プリンタコントローラ(PRTC)8は、所定の双方向インターフェース(双方向I/F)21を介して不図示のプリンタに接続されて、プリンタとの通信制御処理を実行する。
【0053】
この構成のコンピュータによっても本実施形態の画像処理を実行させることができる。
【0054】
このコンピュータによる本願発明の実現は、以下の各実施形態についても同様にして適用可能である。
【0055】
(第2の実施形態)
図9は、本発明の第2の実施形態である画像処理装置の構成を示したブロック図である。本実施形態の画像処置装置は、前記第1の実施形態の画像処理装置に対して、入力階調値を参照して前記ノイズマトリックスを選択するノイズマトリックス選択手段900が追加された構成となっている。また、処理手順はほぼ図2の通りであるが、本実施形態においては、ステップS202で、ノイズマトリックス選択手段900によって複数のノイズマトリクスから適切なものを選択して使用する点が、第1の実施形態と異なっている。
【0056】
まず、入力画像の階調値に応じて前記ノイズマトリックスを選択する方法について述べる。なお、本実施形態では、第1実施形態同様ノイズマトリックスの縦横の要素数を16×16とした。ノイズマトリックスnは入力画素値g(ただし、0≦g≦255)を参照して次の条件式によって選択される。
【0057】
n=n1      (g<4)
n=n2      (4≦g<16)
n=n3      (16≦g<64)
n=n4      (64≦g)。
【0058】
ここで、n1、n2、n3、n4は各入力階調値に応じて選択されるノイズマトリックスを表している。図10には、各ノイズマトリックスの一例を示しており、1000がノイズマトリックスn1を、1001がノイズマトリックスn2を、1002がノイズマトリックスn3、1003がノイズマトリックスn4をそれぞれ図示している。なお、ノイズマトリックスn1は前記実施形態1におけるノイズマトリックスと同一である。また、ノイズマトリックスn1、n2、n3、n4における(i,j)番目のノイズ量をそれぞれn1(i,j)、n2(i,j)、n3(i,j)、n4(i,j)とすると、各ノイズマトリックスのノイズ量は次式にて設定される。
【0059】
<ノイズマトリックスn1>
n1(i,j)=floor(−10×cos(πr/8√2))
=√((i−8)+(j−8)
<ノイズマトリックスn2>
n2(i,j)=floor(−10×cos(πr/4√2))
=√((i%8−4)+(j%8−4)
<ノイズマトリックスn3>
n3(i,j)=floor(−10×cos(πr/2√2))
=√((i%4−2)+(j%4−2)
<ノイズマトリックスn4>
n4(i,j)=floor(−10×cos(πr/√2))
=√((i%2−1)+(j%2−1))。
【0060】
なお、関数floor(A)はAより大きくない最大の整数値を、πは円周率をそれぞれ表している。なお、ノイズマトリックス生成のための手段は本画像処理装置に組み込まれる必要はなく、予め別個のノイズマトリックス生成装置によりノイズマトリックスを生成し、結果のみをノイズマトリックスメモリに格納するものとする。
【0061】
上記の手順により、ドットが生成される傾向の強い画素位置と弱い画素位置を指定することが可能なノイズマトリックスが生成される。なお、ノイズマトリックス生成のための手段は本画像処理装置に組み込まれる必要はなく、予め別個のノイズマトリックス生成装置によりノイズマトリックスを生成し、結果のみをノイズマトリックスメモリに格納するものとする。
【0062】
前述したように、ノイズマトリクスにおいて、マイナスのノイズ量が与えられる画素は、当該画素の量子化時における閾値に印加されるノイズ量がマイナスであることを示す。これは同時に、前記閾値の値を低く設定することになり、如いてはドットが生成されやすいことを意味している。逆に、プラスのノイズ量が与えられる画素は、当該画素の量子化時における閾値に印加されるノイズ量がプラスであることを示す。これは同時に、前記閾値の値を高く設定することになり、如いてはドットが生成され難いことを意味している。
【0063】
すなわち図10のノイズマトリクスn1(1000)を参照すると、ノイズマトリクスn1では、マトリクスの中央部を中心とする直径12程度の円形の領域にわたって、マイナスのノイズが分布している。マトリクスn1は、画素値が4未満の画素に対して選択されるために、画素値が4未満のドットはマトリクスの中央付近にまとまって生成されやすいことを意味する。
【0064】
また、ノイズマトリクスn2(1001)を参照すると、ノイズマトリクスn2では、マトリクスを8×8の領域に分割した各領域の中央部を中心とする直径6程度の円形の領域にわたって、マイナスのノイズが分布している。マトリクスn2は、画素値が4以上16未満の画素に対して選択されるために、画素値が4以上16未満のドットは、マトリクスを縦横それぞれに2等分した部分マトリクスそれぞれの中央部付近にまとまって生成されやすいことになる。すなわち、ノイズマトリクスを領域分割し、各領域についてその中央付近に集中的にドットが生成されやすいようにノイズが配置されている。これはノイズマトリクスn3,n4についても領域分割の仕方が異なるものの同様である。
【0065】
ノイズマトリクスn3(1002)を参照すると、ノイズマトリクスn3では、マトリクスを4×4の領域に分割した各領域の中央部を中心とする直径3程度の円形の領域にわたって、マイナスのノイズが分布している。マトリクスn3は、画素値が16以上64未満の画素に対して選択されるために、画素値が16以上64未満のドットは、マトリクスを縦横それぞれに4等分した部分マトリクスそれぞれの中央部付近にまとまって生成されやすいことになる。
【0066】
同様に、ノイズマトリクスn4(1003)を参照すると、ノイズマトリクスn4では、マトリクスを2×2の領域に分割した各領域に、マイナスのノイズが分散して分布している。マトリクスn4は、画素値が64以上の画素に対して選択されるために、画素値が64以上のドットは、マトリクスを縦横それぞれに2等分した部分マトリクスに分散されて生成されやすいことになる。
【0067】
このように、画素値に応じてドットの生成されやすい傾向の異なるマトリクスを選択的に使用することで、入力画像の階調値に応じてドットを分散させることができる。さらに、ハイライト領域におけるドット分散性を向上させることができ、並びに、同領域の開始部におけるドットの生成の遅延が抑制され点は、第1実施形態と同様である。
【0068】
以上のような構成により、入力画像の階調値に適したノイズマトリックスを選択することが可能となり、特にハイライト領域において階調毎のドット分散性がより向上する効果をもたらす。
【0069】
(第3の実施形態)
図11は、本発明の第3の実施形態である画像処理装置の構成を示したブロック図である。本実施形態の画像処置装置では、シアン(C)、マゼンタ(M)、イエロー(Y)、ブラック(K)の4つの色成分の画像プレーンからなるカラー画像に適用するものであり、第1の実施形態の画像処理装置に対して、前記ノイズマトリックスが複数の色成分に対応し、それらのノイズマトリックスを記憶するノイズマトリックスメモリ1100が追加、変更された構成となっている。すなわち、処理手順はほぼ図2の通りであるが、本実施形態においては、ステップS202で、色成分に応じて用意されている複数のノイズマトリクスから色成分に適したものを選択して使用する点が、第1の実施形態と異なっている。
【0070】
本実施形態における、各色成分毎のノイズマトリックスの生成手順について説明する。
【0071】
図12には、本実施形態におけるノイズマトリックスの一例を示している。ノイズマトリックス1200は色成分Cの入力画像に用いられるCノイズマトリックス、ノイズマトリックス1201は色成分Mの入力画像に用いられるMノイズマトリックス、ノイズマトリックス1202は色成分Yの入力画像に用いられるYノイズマトリックス、ノイズマトリックス1203は色成分Kの入力画像に用いられるKノイズマトリックスである。なお、本実施形態3におけるノイズマトリックスのサイズは、全ての色成分に共通の縦横の要素数を16×16とした。また、Cノイズマトリックスにおけるノイズ量の分布は第1実施形態のノイズマトリックス(図8)と同一の設定としている。すなわち、前記Cノイズマトリックスにおける(i,j)番目のノイズ量をn_c(i,j)とすると、Cノイズマトリックスのノイズ量は次式
n_c(i,j)=floor(−10×cos(πr/8√2))
r=√((i−8)+(j−8)
にて設定される。
【0072】
また、Mノイズマトリックス、Yノイズマトリックス及びKノイズマトリックスは、先程定めたCノイズマトリックスを基準として、前記Cノイズマトリックスを縦横方向にシフトすることにより生成される。すなわち、Mノイズマトリックス、Yノイズマトリックス及びKノイズマトリックスにおける(i,j)番目のノイズ量をそれぞれn_m(i,j)、n_y(i,j)、n_k(i,j)とすると、各色成分のノイズ量は、Cのノイズ量を表すn_c(i,j)を用いて次の式にて設定される。
【0073】
n_m(i,j)=n_c((i+8)%16,(j+8))%16)
n_y(i,j)=n_c((i+8)%16,j)
n_k(i,j)=n_c(i,(j+8))%16)。
【0074】
以上の手順により、各色成分毎のノイズマトリックスが生成される。なお、ノイズマトリックス生成のための手段は本画像処理装置に組み込まれる必要はなく、予め別個のノイズマトリックス生成装置によりノイズマトリックスを生成し、結果のみをノイズマトリックスメモリに格納するものとする。
【0075】
図12を参照すれば明らかなとおり、ノイズマトリクス1200〜1203では、マイナスのノイズは互いにすれた位置を中心として分布している。マイナスのノイズ量が与えられる画素は、ドットが生成されやすく、逆に、プラスのノイズ量が与えられる画素は、ドットが生成され難い。したがって、ドットの分布傾向は各色ごとに異なるものとなる。これにより、ドットが鎖状に連結することを防止し、且つ、ハイライト領域の立ち上り部におけるドットの生成遅延を排除して、複数の色成分を有するカラーの入力画像に対しては、異なる色成分間でのドットの重なりを抑制するために相互の色成分に対するドットの位置制御ができる。
【0076】
以上の構成により、色成分毎にドットが生成される傾向の強い画素位置と弱い画素位置を指定することが可能となり、同一の色成分間だけでなく異なる色成分間でのドットの重なり配置の抑制を目的としたドット位置制御を行うことができる。
【0077】
(第4の実施形態)
図13は、本発明の第4の実施形態である画像処理装置の構成を示したブロック図である。本実施形態では、第3の実施形態同様、シアン(C)、マゼンタ(M)、イエロー(Y)、ブラック(K)の4つの色成分の画像プレーンからなるカラー画像に適用するものであり、本実施形態4の画像処置装置は、第2の実施形態の画像処理装置に対して、前記ノイズマトリックスが複数の色成分に対応し、それらのノイズマトリックスを記憶するノイズマトリックスメモリ1300が追加、変更された構成となっている。すなわち、本実施形態は、第2実施形態と第3実施形態とを組みあわせた構成となる。
【0078】
本実施形態における、入力画像の階調値に応じた各色成分毎のノイズマトリックスの生成手順について説明する。なお、入力画像の画素値に応じて前記ノイズマトリックスを選択する方法については第2実施形態と同様であり、ノイズマトリックスnは入力画素値g(ただし、0≦g≦255)を参照して次の条件式によって選択される。
【0079】
n=n1    (g<4)
n=n2    (4≦g<16)
n=n3    (16≦g<64)
n=n4    (64≦g)
ここで、n1、n2、n3、n4は各入力階調に応じて選択されるノイズマトリックスを表しており、以後の説明の便宜上、順にレベル1、レベル2、レベル3、レベル4のノイズマトリックスと呼ぶことにする。また、ノイズマトリックスの縦横の要素数は16×16とした。図14には、色成分Cの入力画像に用いられるCノイズマトリックスを例示しており、1400がレベル1、1401がレベル2、1402がレベル3、1403がレベル4となる。図15には、色成分Mの入力画像に用いられるMノイズマトリックスを例示しており、1500がレベル1、1501がレベル2、1502がレベル3、1503がレベル4となる。図16には、色成分Yの入力画像に用いられるYノイズマトリックスを例示しており、1600がレベル1、1601がレベル2、1602がレベル3、1603がレベル4となる。最後に、図17には、色成分Kの入力画像に用いられるKノイズマトリックスを例示しており、1700がレベル1、1701がレベル2、1702がレベル3、1703がレベル4となる。なお、前記Cノイズマトリックスにおけるノイズ量の分布は前記実施形態2のノイズマトリックス(図10)と同一の設定としている。すなわち、前記Cノイズマトリックスにおける(i,j)番目のレベル1、レベル2、レベル3並びにレベル4にけるノイズ量を、n1_c(i,j)、n2_c(i,j)、n3_c(i,j)、n4_c(i,j)とすると、各ノイズマトリックスのノイズ量は次式にて設定される。
【0080】
<Cノイズマトリックス、レベル1>
n1_c(i,j)=floor(−10×cos(πr/8√2))
=√((i−8)+(j−8)
<Cノイズマトリックス、レベル2>
n2_c(i,j)=floor(−10×cos(πr/4√2))
=√((i%8−4)+(j%8−4)
<Cノイズマトリックス、レベル3>
n3_c(i,j)=floor(−10×cos(πr/2√2))
=√((i%4−2)+(j%4−2)
<Cノイズマトリックス、レベル4>
n4_c(i,j)=floor(−10×cos(πr/√2))
=√((i%2−1)+(j%2−1))。
【0081】
なお、関数floor(A)はAより大きくない最大の整数値を、πは円周率をそれぞれ表している。更に、Mノイズマトリックス、Yノイズマトリックス及びKノイズマトリックスは、先程定めたCノイズマトリックスを基準として、前記Cノイズマトリックスを縦横方向にシフトすることにより生成される。すなわち、Mノイズマトリックス、Yノイズマトリックス及びKノイズマトリックスにおける(i,j)番目のノイズ量を各レベルに応じてそれぞれn1_m(i,j)〜n4_m(i,j)、n1_y(i,j)〜n4_y(i,j)、n1_k(i,j)〜n4_k(i,j)とすると、各ノイズマトリックスレベルにおける各色成分のノイズ量は、Cのノイズ量を表すn1_c(i,j)〜n4_c(i,j)を用いて次の式にて設定される。
【0082】
<レベル1>
n1_m(i,j)=n1_c((i+8)%16,(j+8))%16)
n1_y(i,j)=n1_c((i+8)%16,j)
n1_k(i,j)=n1_c(i,(j+8))%16)
<レベル2>
n2_m(i,j)=n2_c((i+4)%16,(j+4))%16)
n2_y(i,j)=n2_c((i+4)%16,j)
n2_k(i,j)=n2_c(i,(j+4)%16)
<レベル3>
n3_m(i,j)=n3_c((i+2)%16,(j+2))%16)
n3_y(i,j)=n3_c((i+2)%16,j)
n3_k(i,j)=n3_c(i,(j+2)%16)
<レベル4>
n4_m(i,j)=n4_c((i+1)%16,(j+1))%16)
n4_y(i,j)=n4_c((i+1)%16,j)
n4_k(i,j)=n4_c(i,(j+1)%16)。
【0083】
以上の手順により、入力画像の階調値に応じた各色成分毎のノイズマトリックスが生成される。なお、ノイズマトリックス生成のための手段は本画像処理装置に組み込まれる必要はなく、予め別個のノイズマトリックス生成装置によりノイズマトリックスを生成し、結果のみをノイズマトリックスメモリに格納するものとする。
【0084】
すなわち、図14のCノイズマトリクス1400、図15のMノイズマトリクス1500、図16のYノイズマトリクス1600、図17のKノイズマトリクス1700は、それぞれ図12のCノイズマトリクス1200、Mノイズマトリクス1201、Yノイズマトリクス1202、Kノイズマトリクス1203と同じ構成を有する。そして、図14における輝度ごとのCノイズマトリクス1400〜1403は、図12における輝度ごとのノイズマトリクス1200〜1203とそれぞれ同じ内容を有している。輝度ごとのMノイズマトリクス1501〜1503、Yノイズマトリクス1601〜1603、Kノイズマトリクス1701〜1703それぞれは、Mノイズマトリクス1500、Yノイズマトリクス1600、Kノイズマトリクス1700それぞれが、Cノイズマトリクス1400に対してずれている分だけ互いにずれている。
【0085】
この結果、マイナスのノイズ量が与えられる画素は、ドットが生成されやすく、逆に、プラスのノイズ量が与えられる画素は、ドットが生成され難いことから、ドットの分布傾向は各色ごと、そして輝度水準ごとに異なるものとすることができる。これにより、ドットが鎖状に連結することを防止し、且つ、ハイライト領域の立ち上り部におけるドットの生成遅延を排除して、複数の色成分を有するカラーの入力画像に対しては、異なる色成分間でのドットの重なりを抑制するために相互の色成分に対するドットの位置制御とともに、輝度レベルに応じてもドットの配置を制御できる。
【0086】
以上のような構成により、入力画像の画素値に適したノイズマトリックスを選択でき、なおかつ、色成分毎にドットが生成される傾向の強い画素位置と弱い画素位置を指定することが可能となるため、特にハイライト領域における、ドットの重なり抑制効果と階調毎におけるドット分散性の向上の効果とをもたらす。
【0087】
(第5の実施形態)
上記第1から第4の実施形態では、ノイズノイズマトリックスに与えられるノイズ量は−10から+10の範囲に含まれる値としていたが、本実施形態においては、ノイズマトリクスは量子化時の閾値に印加するノイズの符号を表す役割を果たす構成とする。なお、装置の構成は第1実施形態における図8を図18に置換したものとなる。
【0088】
図18には、本実施形態に用いられるノイズマトリックスの一例を示した。各要素は+1又は−1のいずれかの値を持つ。本実施形態ではノイズマトリックスのサイズは16×16画素とした。ノイズマトリックスにおける(i,j)番目の要素値をe(i,j)とすると、各画素位置における要素値は、ノイズマトリックスの中心画素位置(8,8)からの距離rに対して次の式で求められる。
【0089】
if(r<=6)
e(i,j)=−1
else
e(i,j)=+1
但し、r=√((i−8)+(j−8))である。
【0090】
入力画素データの画素位置(x,y)に対応する前記量子化時の閾値に印加するノイズ量n_valは、選択されたノイズ符号e(i,j)を用いて次の式にて設定される。
【0091】
n_val=10×e(x%16,y%16)
つまり、マイナスのノイズ量が与えられる画素は、当該画素の量子化時における閾値に印加されるノイズ量が−10であることを示す。逆に、プラスのノイズ量が与えられる画素は、当該画素の量子化時における閾値に印加されるノイズ量が+10であることを示す。なお、ノイズマトリックス生成のための手段は本画像処理装置に組み込まれる必要はなく、予め別個のノイズマトリックス生成装置によりノイズマトリックスを生成し、結果のみをノイズマトリックスメモリに格納するものとする。
【0092】
このようにして、第1実施形態と同様に、ハイライト領域におけるドット分散性を向上させることができ、並びに、同領域の開始部におけるドットの生成の遅延が抑制され、ドット配置が均一な視覚的に好ましい二値ドットパターンを形成することができる。加えて、ノイズマトリクスのサイズを小さくできる。
【0093】
本実施形態では、入力画像が1色について言及したが、前記第3及び第4実施形態に示される方法に従うことにより、入力画像が複数の色成分から構成されるカラー画像の場合にも、本実施形態は適応可能であることは言うまでもない。第3及び第4実施形態のように多くのノイズマトリクスを使用する装置に対して適用することで、より大きな効果を上げることができる。
【0094】
以上の構成により、ノイズマトリックスの1要素に割り与えられるデータ量が1ビットに削減できるため、ノイズマトリクスメモリの小メモリ化並びにシステムの簡素化を達成することができる。
【0095】
(その他の実施形態)
なお本発明の目的は前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラム読出し実行することによっても、本発明の目的が達成される。
【0096】
この場合、記憶媒体から読出されたプログラムコード自体が本発明の新規な機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。
【0097】
プログラムコードを供給するための記憶媒体としては、例えば、フロッピーディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM、CD−R、磁気テープ、不揮発性のメモリカード、ROMなどを用いることができる。
【0098】
また、コンピュータが読出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOSなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれる。
【0099】
さらに、記憶媒体から読出されたプログラムコードが、コンピュータに挿入された機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれる。
【0100】
【発明の効果】
以上説明したように、本発明によれば、誤差拡散法を用いた多値画像の擬似中間調表現処理に際し、ドットが鎖状に連結することを防止し、且つ、ハイライト領域の立ち上り部におけるドットの生成遅延を排除することができる。
【0101】
また、画素の階調レベルに応じてドットの分散を制御できるために、多値画像の全階調にわたりドットの鎖状連結を防止できる。
【0102】
また、画素の色成分ごとにドットの分散を制御できるために、すべての色成分についてドットの鎖状連結を防止できる。
【0103】
また、複数の色成分を有するカラーの多値画像に対しては、異なる色成分間でのドットの重なりを抑制するために相互の色成分に対するドット位置制御を行い、全階調にわたってドットの分散性が良好な処理結果を得ることができる。
【0104】
また、ノイズマトリクスのサイズを縮小しつつ上記効果を達成することができる。
【図面の簡単な説明】
【図1】本発明の第一の実施形態である画像処理装置のブロック図。
【図2】第一の実施形態である画像処理装置の処理を説明するフローチャート。
【図3】画像の走査例の図
【図4】誤差拡散メモリの構成例の図。
【図5】閾値変動量の設定手順を説明するフローチャート。
【図6】階調値と平均量子化誤差との関係を示す図の一例。
【図7】閾値変動量の算出時に使用される画像例の図。
【図8】ノイズマトリックスの一例の図。
【図9】本発明の第二の実施形態である画像処理装置のブロック図。
【図10】階調毎に設定されたノイズマトリックスの一例の図。
【図11】本発明の第三の実施形態である画像処理装置のブロック図。
【図12】色成分毎に設定されたノイズマトリックスの一例の図。
【図13】本発明の第四の実施形態である画像処理装置のブロック図。
【図14】階調毎に設定されたシアンのノイズマトリックスの一例の図。
【図15】階調毎に設定されたマゼンタのノイズマトリックスの一例の図。
【図16】階調毎に設定されたイエローのノイズマトリックスの一例の図。
【図17】階調毎に設定されたブラックのノイズマトリックスの一例の図。
【図18】ノイズマトリックスの他の一例の図。
【図19】ドットが鎖状に連結した二値画像の一例の図。
【図20】コンピュータのブロック図。
【符号の説明】
100・・・画像データ入力端子。
101・・・累積誤差加算部。
102・・・閾値変動量LUT。
103・・・ノイズマトリックスメモリ。
104・・・閾値演算部。
105・・・量子化部。
106・・・誤差演算部。
107・・・誤差拡散部。
108・・・累積誤差メモリ。
109・・・画像データ出力端子。
110・・・アドレス入力端子。
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing method and an apparatus for converting an input multi-tone image into an image having a smaller number of tones than the number of tones of an input image.
[0002]
[Prior art]
(First conventional example)
Conventionally, as means for converting multi-valued image data into a binary image (or an image having a binary number or more and a smaller number of tones than the number of input tones), R.I. The error diffusion method by Floyd et al. (“An adaptive algorithm for spatial gray scale”, SID International Symposium Digest of Technical Papers, vol. 4, 1975, p. Pp. 37, 1937). In this error diffusion method, a gray scale expression is performed in a pseudo manner by diffusing a binarization error generated in a certain pixel to a plurality of subsequent pixels.
[0003]
However, in the image processing apparatus using the conventional error diffusion method, there is a problem that the dot generation at the rising portion of the low density area (highlight area) is greatly delayed. In order to solve the above problem, Japanese Patent Application Laid-Open No. 8-307680 discloses an error diffusion method for setting a threshold based on the gradation value of multi-valued image data. An outline of this method is as follows. In an image processing apparatus that converts multi-tone image data into a first tone value and a second tone value using an error diffusion method or an average error minimization method, the multi-tone image data of a target pixel is used. Is a method of setting a base component of a threshold value based on the gradation value of, and further adding a random value to the base component to set a threshold value for binarization. According to this method, the threshold value is optimized in accordance with the gradation value of the multi-gradation image data of the target pixel, thereby suppressing the dot generation delay.
[0004]
(Second conventional example)
Further, in the image processing apparatus using the conventional error diffusion method, as shown in FIG. 19, in the highlight region, the generated dots have a strong tendency to be connected in a chain, so that the dispersibility of the dots is uniform. However, there is a problem that the image quality is not maintained. To solve the above problem, Japanese Patent Application Laid-Open No. 9-284552 discloses an error diffusion method for two-dimensionally controlling the characteristics of noise applied to a threshold. An outline of this method is a pseudo halftone processing method in which the grayscale of an input pixel is converted into a smaller number of grayscales and output, and a binary threshold in which low-frequency components are suppressed is used as a threshold used in quantization. This is a technique using a rule signal. According to this method, a binary two-dimensional threshold matrix in which low-frequency components are suppressed is used as a threshold, and binary signals “0” and “1” are stored in the threshold matrix in advance. When the signal component of the threshold mask at the pixel position of the input image is “0”, the threshold is changed to 192, and when the signal component is “1”, the threshold is changed to 64, thereby increasing the dispersibility of dots in the highlight area.
[0005]
[Problems to be solved by the invention]
However, in the first conventional example, since a random number is used as noise applied to a threshold value, it is difficult to control the characteristics of the noise two-dimensionally. No proactive measures were taken. Further, for a color input image having a plurality of color components, since the threshold value and the amount of noise applied to the threshold value are not specified in consideration of each color component, dot position control between different colors is performed. Was insufficient.
[0006]
Further, in the second conventional example, since a binary threshold matrix is used for all input gradations, there is a disadvantage that it is not possible to prevent a delay in dot generation at a rising portion of a highlight area. Further, as for the two values 64 and 192 used as the threshold values, there is also a problem that the output image becomes an image containing a lot of noise and having a feeling of roughness since the amount of change between both is extremely large.
[0007]
The present invention has been made in view of the above problems, and in a pseudo halftone expression process of a multi-valued image using an error diffusion method, prevents dots from being connected in a chain, and For a color input image having a plurality of color components by eliminating the dot generation delay at the rising portion, dot position control with respect to each other color component to suppress dot overlap between different color components It is an object of the present invention to provide an image processing method and apparatus capable of obtaining a processing result with good dot dispersibility over all gradations while performing the above.
[0008]
[Means for Solving the Problems]
The following structure is provided to achieve the above object.
[0009]
An image processing device for quantizing an input image by an error diffusion method,
Means for storing a variation amount of a threshold value for quantization;
A memory that stores a noise matrix that defines the arrangement of noise applied to the threshold,
Threshold setting means for setting a threshold for quantization with reference to the variation amount of the threshold and the noise matrix,
Quantization means for quantizing the pixel of interest with a threshold value set by the threshold value setting means,
Error diffusion means for diffusing the quantization error by the quantization means to pixels near the pixel of interest.
[0010]
More preferably, the threshold value setting means sets the threshold value according to a tone value of an input image.
[0011]
With this configuration, since quantization is performed with a different threshold value for each gradation, a delay in dot generation can be prevented.
[0012]
More preferably, the threshold value setting means sets the threshold value according to a gradation value and a pixel position of the input image.
[0013]
With this configuration, quantization is performed at different threshold values for each gradation, so that delay in dot generation can be prevented. Further, quantization is performed at different threshold values according to pixel positions. can do.
[0014]
More preferably, the variation amount of the threshold value is set such that the average value of the quantization errors generated by the error diffusion means becomes a negligible small value.
[0015]
With this configuration, it is possible to prevent delay in dot generation.
[0016]
More preferably, the variation amount of the threshold value is set according to a gradation value of an input image.
[0017]
With this configuration, the dispersion of dots can be controlled by controlling the amount of change for each gradation.
[0018]
More preferably, the noise matrix is a two-dimensional array in which values of respective elements of the matrix are arranged in a concentrated manner.
[0019]
With this configuration, dots are easily generated in the vicinity of the center of the matrix, so that it is possible to prevent a decrease in image quality due to a chain of dots.
[0020]
More preferably, in the noise matrix, values are arranged so that dots after quantization are intensively generated for each region obtained by dividing the noise matrix.
[0021]
With this configuration, dots are easily generated in the vicinity of the center of each of the divided regions of the matrix, so that it is possible to prevent the image quality from being deteriorated due to the chain of dots, and it is also possible to control the concentration position by the matrix used.
[0022]
More preferably, the noise matrix is a binary two-dimensional array consisting of only a first value and a second value.
[0023]
With this configuration, the size of the matrix can be reduced.
[0024]
More preferably, the noise matrix is selected according to a tone value of an input image.
[0025]
With this configuration, since quantization is performed with a different threshold value for each gradation, a delay in dot generation can be prevented.
[0026]
More preferably, the input image is a color image including a plurality of color components, the noise matrix is prepared for each color component, and the noise matrices for each color component are correlated with each other.
[0027]
With this configuration, it is possible to control the dispersion of dots for each color component, and to prevent a decrease in image quality.
[0028]
More preferably, the correlation for each color component is that a noise matrix whose position is shifted relative to a noise matrix of a certain color component is used for another color component.
[0029]
With this configuration, the dispersion of dots can be controlled for each color component, and since the manner of dispersion differs for each color component, the overlap of dots of each color component can be controlled, and high-quality image data can be output.
[0030]
BEST MODE FOR CARRYING OUT THE INVENTION
(1st Embodiment)
FIG. 1 is a block diagram illustrating a configuration of an image processing apparatus according to a first embodiment of the present invention. 100 is an input terminal for pixel data, 101 is an accumulative error adder, 102 is a threshold change amount lookup table (hereinafter, referred to as LUT) storing a change amount of a threshold corresponding to the gradation value of the input pixel data, Reference numeral 103 denotes a noise matrix memory in which a noise matrix that defines the arrangement of noise to be applied to the threshold is stored. 104 is a threshold calculator that calculates a quantization threshold. 105 is a quantizer. 106 is an error calculation that calculates a quantization error. 107, an error diffusion unit for diffusing a quantization error, 108, a cumulative error memory for storing a cumulative error, 109, an output terminal for image data formed after a series of processing, and 110, an address input terminal.
[0031]
Hereinafter, the operation of the image processing apparatus of FIG. 1 will be described with reference to the flowchart of FIG.
[0032]
First, an input image is sequentially scanned by an image scanning unit (not shown), and each pixel data is input from the input terminal 100 (step S200). FIG. 3 is a diagram showing scanning of an image. Reference numeral 30 denotes a pixel at the upper left end of the input image, and reference numeral 31 denotes a pixel at the lower right end of the input image. The scanning of the image starts from the pixel 30 at the upper left corner of the image area and proceeds to the right in units of one pixel. Then, when reaching the right end of the image data sequence, the process moves to the left end pixel of the image data sequence one pixel lower. When the same processing is repeated to reach the pixel 31 at the lower right corner, the image scanning processing is completed.
[0033]
Next, the cumulative error value corresponding to the pixel position of the cumulative error memory is added to the input pixel data in the cumulative error adding unit 101 (step S201). The cumulative error memory has one storage area E0 and the same number of storage areas E (x) as the number of horizontal pixels W of the input image, and stores a quantization error by a method described later. It is assumed that all the accumulated error memories have been initialized to the initial value 0 before the processing is started. FIG. 4 is a diagram showing details of the accumulated error memory. In the cumulative error adding unit 101, the value of the error memory E (x) corresponding to the horizontal pixel position x of the input pixel data is added. That is, assuming that the pixel data after addition of the accumulated error is I ′,
I ′ = I + E (x)
It becomes.
[0034]
Next, the threshold calculator 104 sets the noise amount n_val applied to the threshold with reference to the noise matrix memory 103 (step S202). First, a noise amount corresponding to a pixel position (x, y) of input pixel data is obtained from a noise matrix stored in the noise matrix memory 103. FIG. 8 is an example of a noise matrix, and each element of the matrix describes the amount of noise applied to the pixel at that position. In the first embodiment, assuming that the number of vertical and horizontal elements of the noise matrix is 16 × 16 and the (i, j) -th noise amount in the noise matrix is n (i, j), the pixel position (x, The noise amount n_val corresponding to y) is
n_val = n (x% 16, y% 16)
It becomes. Here,% represents a modulo (remainder) operation.
[0035]
Subsequently, with reference to the threshold fluctuation amount LUT 102, a threshold is obtained based on the threshold fluctuation amount set according to a method described later and the noise amount (step S203). That is, assuming that the input pixel value is an integer value in the range of 0 to 255, the threshold value used as a reference at the time of quantization is 128, and the threshold variation amount is th_v (I), the threshold value th (I) is
th (I) = 128 + th_v (I) + n_val
It becomes.
[0036]
Subsequently, the quantization unit 105 compares the pixel data I ′ after the cumulative error addition with the threshold value th (I) set by the threshold value calculation unit 104, and calculates the output gradation value O by the equation
O = 0 (I '<th (I))
O = 255 (I ′ ≧ th (I))
(Step S204).
[0037]
Next, the error calculation unit 106 calculates the difference between the pixel data I ′ after the addition of the accumulated error and the output value O, that is, the quantization error Err by the following equation.
Err = I'-O
(Step S205).
[0038]
Next, in the error diffusion unit 107, the quantization error Err is diffused as follows according to the horizontal position x of the pixel of interest (step S206).
[0039]
E (x + 1) ← E (x + 1) + Err × 7/16 (x <W)
E (x-1) ← E (x-1) + Err × 3/16 (x> 1)
E (x) ← E0 + Err × 5/16 (1 <x <W)
E (x) ← E0 + Err × 8/16 (x = 1)
E (x) ← E0 + Err × 13/16 (x = W)
E0 ← Err × 1/16 (x <W)
E0 ← 0 (x = W).
[0040]
Thus, the binarization processing for one pixel of the input image is completed. It is determined whether or not the binarization processing has been performed on all pixels of the input image (step S207). If it is determined that the above processing has been performed on all pixels, the pseudo halftone of the input image is determined. Processing is completed.
[0041]
<Threshold fluctuation setting procedure>
Next, a procedure for setting the threshold variation th_v (g) stored in the threshold variation LUT 102 will be described with reference to the flowchart of FIG. Note that g represents a gradation value. FIG. 7 shows an image used when calculating the threshold fluctuation amount, 70 is an entire image area to be subjected to the binarization processing, and 71 is a target when calculating the threshold fluctuation amount. This is an image area. First, the threshold fluctuation amount th_v (g) and the noise amount n (g) are initialized to 0 for all gradations (step S500). That is, when calculating the threshold fluctuation amount, the threshold th (g) is set for each gradation value,
th (g) = 128
Set to. FIG. 6 shows the relationship between the gradation value of the input pixel and the average quantization error ave_E (g) described later. Hereinafter, a procedure for setting the threshold variation amount at the input tone value g = 1 will be described.
[0042]
First, quantization processing is performed on image data having a uniform gradation value g = 1 of 512 × 512 pixels as shown in FIG. 7 to obtain an average quantization error ave_E (g) (step S501). ). As shown in FIG. 3, the scanning of the image starts from the pixel at the upper left end of the image area, and the binarization process is performed toward the pixel at the lower right end of the image. Then, for the image area 71 of 256 × 256 pixels near the lower end of the image where the formation of dots seems to have reached a stable state, the difference between the pixel data I ′ after the addition of the accumulated error and the output pixel value O, That is, the average value ave_E (g) of the quantization error E is obtained. Next, the value obtained by inverting the sign of the average value ave_E (g) of the quantization error is expressed by the following equation.
th_v (g) =-ave_E (g)
Is stored in the threshold fluctuation amount LUT 102 (step S502).
[0043]
Next, it is confirmed whether or not the above processing has been completed for all possible values (256 gradations) of the gradation data of the input pixel (step S503). To end. If the processing has not been completed, 1 is added to the gradation value g, and the processing is repeated from step 501. In general, it is said that a dot generation delay occurs at a gradation where the average value ave_E (g) of the quantization error does not become 0 (Japanese Patent Laid-Open No. 07-111591). Therefore, in the present embodiment, the threshold fluctuation amount for quantization is set such that the average quantization error ave_E (g) becomes 0 for all input gray scales. According to the above procedure, the threshold fluctuation amount that can reduce the dot generation delay can be set according to each gradation value.
[0044]
<Noise matrix creation procedure>
Next, a procedure for creating a noise matrix (FIG. 8) stored in the noise matrix memory 103 will be described. In this embodiment, the size of the noise matrix is 16 × 16 pixels. Assuming that the (i, j) -th noise amount in the noise matrix is n (i, j), the noise amount at each pixel position is calculated based on the distance r from the center pixel position (8, 8) in the noise matrix as follows. formula
n (i, j) = floor (−10 × cos (πr / 8√2))
r = √ ((i-8) 2 + (J-8) 2 )
Is required.
[0045]
The function floor (A) represents the maximum integer value not larger than A, and π represents the pi. Here, a pixel to which a negative noise amount is given indicates that the noise amount applied to the threshold value at the time of quantization of the pixel is negative. At the same time, the value of the threshold is set low, which means that dots are easily generated. Conversely, a pixel to which a positive noise amount is given indicates that the noise amount applied to the threshold value at the time of quantization of the pixel is positive. This also means that the value of the threshold is set to be high, and thus it is difficult to generate dots. By the above procedure, a noise matrix capable of designating a pixel position where a dot tends to be generated and a pixel position where a dot is likely to be generated is generated. The means for generating a noise matrix does not need to be incorporated in the present image processing apparatus. A noise matrix is generated in advance by a separate noise matrix generating apparatus, and only the result is stored in the noise matrix memory.
[0046]
With the configuration as described above, the dot dispersibility in the highlight area can be improved, and the delay in the generation of dots at the start of the area is suppressed, and visually preferable binary dots with uniform dot arrangement. A pattern can be formed.
[0047]
As described above, the image processing apparatus shown in FIG. 1 receives multi-valued image data and outputs two pieces of image data. Here, if the image processing apparatus in FIG. 1 receives image data from an image data input device such as an image scanner and outputs binary image data with a binary printer engine such as an electrophotographic printer, copying is performed. And multifunction devices that can be used independently for each device. If the image input device is replaced with an interface with a communication medium or a storage medium, it can be used as a printer that receives image data.
[0048]
In addition, the apparatus according to the present embodiment can be applied to a device that requires a function of converting multi-valued image data into binary image data.
[0049]
<Image processing by computer>
The image processing apparatus in FIG. 1 can be configured by hardware, but can also be realized by a computer by executing the procedure in FIG. 2 as a program.
[0050]
FIG. 20 shows the configuration of a computer for performing the binarization process in FIG. 2 and the procedure for setting the threshold variation amount in FIG. The configuration in FIG. 1 is also realized by executing the procedure in FIG. 2 by the computer in FIG.
[0051]
20, the host computer 3000 executes the procedure based on the computer program of the procedure of FIG. 2 and the procedure of FIG. 5 stored in the program ROM of the ROM 3 or the RAM 2 or any one of the computer programs. It has a CPU 1 to execute. Each device connected to the system bus 4 is controlled overall by the CPU 1. The RAM 2 functions as a main memory, a work area, and the like for the CPU 1.
[0052]
A keyboard controller (KBC) 5 controls a key input from a keyboard 9 or a pointing device (not shown). A CRT controller (CRTC) 6 controls display on a CRT display 10. A disk controller (DKC) 7 controls access to an external memory 11 such as a hard disk (HD) that stores a boot program, various applications, font data, user files, edit files, and the like, and a floppy disk (FD). The RAM 2 and the external memory (for example, a hard disk) 11 store the programs of the procedures of FIGS. 2 and 5 and also function as a threshold variation memory 108, a cumulative error memory 107, and a dot pattern memory 109. The printer controller (PRTC) 8 is connected to a printer (not shown) via a predetermined bidirectional interface (bidirectional I / F) 21 and executes communication control processing with the printer.
[0053]
The computer having this configuration can also execute the image processing of the present embodiment.
[0054]
The realization of the present invention by this computer is similarly applicable to the following embodiments.
[0055]
(Second embodiment)
FIG. 9 is a block diagram illustrating a configuration of an image processing apparatus according to a second embodiment of the present invention. The image processing apparatus according to the present embodiment has a configuration in which a noise matrix selection unit 900 that selects the noise matrix with reference to an input gradation value is added to the image processing apparatus according to the first embodiment. I have. Although the processing procedure is substantially as shown in FIG. 2, in the present embodiment, the first point is that an appropriate one is selected from a plurality of noise matrices and used by the noise matrix selecting means 900 in step S202. This is different from the embodiment.
[0056]
First, a method of selecting the noise matrix according to the tone value of the input image will be described. In this embodiment, the number of vertical and horizontal elements of the noise matrix is set to 16 × 16 as in the first embodiment. The noise matrix n is selected by the following conditional expression with reference to the input pixel value g (where 0 ≦ g ≦ 255).
[0057]
n = n1 (g <4)
n = n2 (4 ≦ g <16)
n = n3 (16 ≦ g <64)
n = n4 (64 ≦ g).
[0058]
Here, n1, n2, n3, and n4 represent noise matrices selected according to each input tone value. FIG. 10 shows an example of each noise matrix. 1000 indicates the noise matrix n1, 1001 indicates the noise matrix n2, 1002 indicates the noise matrix n3, and 1003 indicates the noise matrix n4. The noise matrix n1 is the same as the noise matrix in the first embodiment. Also, the (i, j) -th noise amount in the noise matrices n1, n2, n3, and n4 is represented by n1 (i, j), n2 (i, j), n3 (i, j), and n4 (i, j), respectively. Then, the noise amount of each noise matrix is set by the following equation.
[0059]
<Noise matrix n1>
n1 (i, j) = floor (−10 × cos (πr 1 / 8√2))
r 1 = √ ((i-8) 2 + (J-8) 2 )
<Noise matrix n2>
n2 (i, j) = floor (−10 × cos (πr 2 / 4√2))
r 2 = √ ((i% 8-4) 2 + (J% 8-4) 2 )
<Noise matrix n3>
n3 (i, j) = floor (−10 × cos (πr 3 / 2√2))
r 3 = √ ((i% 4-2) 2 + (J% 4-2) 2 )
<Noise matrix n4>
n4 (i, j) = floor (−10 × cos (πr 4 / $ 2))
r 4 = √ ((i% 2-1) 2 + (J% 2-1) 2 ).
[0060]
The function floor (A) represents the maximum integer value not larger than A, and π represents the pi. The means for generating a noise matrix does not need to be incorporated in the present image processing apparatus. A noise matrix is generated in advance by a separate noise matrix generating apparatus, and only the result is stored in the noise matrix memory.
[0061]
By the above procedure, a noise matrix capable of designating a pixel position where a dot tends to be generated and a pixel position where a dot is likely to be generated is generated. The means for generating a noise matrix does not need to be incorporated in the present image processing apparatus. A noise matrix is generated in advance by a separate noise matrix generating apparatus, and only the result is stored in the noise matrix memory.
[0062]
As described above, a pixel to which a negative noise amount is given in the noise matrix indicates that the noise amount applied to the threshold value at the time of quantization of the pixel is negative. At the same time, the value of the threshold is set low, which means that dots are easily generated. Conversely, a pixel to which a positive noise amount is given indicates that the noise amount applied to the threshold value at the time of quantization of the pixel is positive. This also means that the value of the threshold is set to be high, and thus it is difficult to generate dots.
[0063]
That is, with reference to the noise matrix n1 (1000) in FIG. 10, in the noise matrix n1, negative noise is distributed over a circular region having a diameter of about 12 centered on the center of the matrix. The matrix n1 is selected for pixels having a pixel value of less than 4, which means that dots having a pixel value of less than 4 are likely to be generated near the center of the matrix.
[0064]
Referring to the noise matrix n2 (1001), in the noise matrix n2, negative noise is distributed over a circular area having a diameter of about 6 around the center of each area obtained by dividing the matrix into 8 × 8 areas. are doing. Since the matrix n2 is selected for pixels having a pixel value of 4 or more and less than 16, the dots having a pixel value of 4 or more and less than 16 are located near the center of each of the partial matrices obtained by dividing the matrix into two equal parts vertically and horizontally. It will be easy to generate them together. That is, the noise matrix is divided into regions, and noise is arranged so that dots are easily generated intensively near the center of each region. This is the same for the noise matrices n3 and n4, although the way of area division is different.
[0065]
Referring to the noise matrix n3 (1002), in the noise matrix n3, negative noise is distributed over a circular area having a diameter of about 3 around the center of each area obtained by dividing the matrix into 4 × 4 areas. I have. Since the matrix n3 is selected for pixels having a pixel value of 16 or more and less than 64, the dots having a pixel value of 16 or more and less than 64 are located near the center of each of the partial matrices obtained by dividing the matrix into four equal parts vertically and horizontally. It will be easy to generate them together.
[0066]
Similarly, with reference to the noise matrix n4 (1003), in the noise matrix n4, negative noise is distributed and distributed in each area obtained by dividing the matrix into 2 × 2 areas. Since the matrix n4 is selected for pixels having a pixel value of 64 or more, dots having a pixel value of 64 or more are likely to be generated by being distributed into a partial matrix obtained by dividing the matrix into two equal parts vertically and horizontally. .
[0067]
As described above, by selectively using a matrix having a different tendency to generate dots according to the pixel value, the dots can be dispersed according to the gradation value of the input image. Further, it is the same as in the first embodiment that the dot dispersibility in the highlight area can be improved, and the delay of dot generation at the start of the area is suppressed.
[0068]
With the above configuration, it is possible to select a noise matrix suitable for the gradation value of the input image, and it is possible to improve the dot dispersibility for each gradation particularly in a highlight region.
[0069]
(Third embodiment)
FIG. 11 is a block diagram illustrating a configuration of an image processing apparatus according to a third embodiment of the present invention. The image processing apparatus of the present embodiment is applied to a color image composed of image planes of four color components of cyan (C), magenta (M), yellow (Y), and black (K). The image processing apparatus according to the embodiment has a configuration in which the noise matrix corresponds to a plurality of color components, and a noise matrix memory 1100 that stores the noise matrix is added or changed. That is, although the processing procedure is almost as shown in FIG. 2, in this embodiment, in step S202, a noise matrix suitable for the color component is selected from a plurality of noise matrices prepared according to the color component and used. This is different from the first embodiment.
[0070]
A procedure for generating a noise matrix for each color component in the present embodiment will be described.
[0071]
FIG. 12 shows an example of a noise matrix in the present embodiment. The noise matrix 1200 is a C noise matrix used for the input image of the color component C, the noise matrix 1201 is an M noise matrix used for the input image of the color component M, and the noise matrix 1202 is a Y noise matrix used for the input image of the color component Y. , A noise matrix 1203 is a K noise matrix used for the input image of the color component K. The size of the noise matrix in the third embodiment is such that the number of vertical and horizontal elements common to all color components is 16 × 16. The distribution of the noise amount in the C noise matrix is set to be the same as the noise matrix (FIG. 8) of the first embodiment. That is, assuming that the (i, j) -th noise amount in the C noise matrix is n_c (i, j), the noise amount of the C noise matrix is expressed by the following equation.
n_c (i, j) = floor (−10 × cos (πr / 8√2))
r = √ ((i-8) 2 + (J-8) 2 )
Set by.
[0072]
The M noise matrix, the Y noise matrix, and the K noise matrix are generated by shifting the C noise matrix in the vertical and horizontal directions with reference to the previously determined C noise matrix. That is, assuming that the (i, j) -th noise amount in the M noise matrix, the Y noise matrix, and the K noise matrix is n_m (i, j), n_y (i, j), and n_k (i, j), respectively, Is set by the following equation using n_c (i, j) representing the noise amount of C.
[0073]
n_m (i, j) = n_c ((i + 8)% 16, (j + 8))% 16)
n_y (i, j) = n_c ((i + 8)% 16, j)
n_k (i, j) = n_c (i, (j + 8))% 16).
[0074]
Through the above procedure, a noise matrix for each color component is generated. The means for generating a noise matrix does not need to be incorporated in the present image processing apparatus. A noise matrix is generated in advance by a separate noise matrix generating apparatus, and only the result is stored in the noise matrix memory.
[0075]
As is apparent from FIG. 12, in the noise matrices 1200 to 1203, the negative noises are distributed around the mutually shifted positions. A pixel to which a negative amount of noise is given is likely to generate a dot, and a pixel to which a plus amount of noise is given is unlikely to generate a dot. Therefore, the distribution tendency of the dots differs for each color. This prevents dots from being linked in a chain and eliminates the delay of dot generation at the rising edge of the highlight area, thereby providing a different color image for a color input image having a plurality of color components. In order to suppress overlapping of dots between components, position control of dots with respect to mutual color components can be performed.
[0076]
With the above configuration, it is possible to specify a pixel position where a dot tends to be generated strongly and a pixel position where a dot tends to be generated for each color component, so that the overlapping arrangement of dots not only between the same color components but also between different color components can be specified. Dot position control for the purpose of suppression can be performed.
[0077]
(Fourth embodiment)
FIG. 13 is a block diagram illustrating a configuration of an image processing apparatus according to a fourth embodiment of the present invention. In the present embodiment, as in the third embodiment, the present invention is applied to a color image composed of image planes of four color components of cyan (C), magenta (M), yellow (Y), and black (K). The image processing apparatus according to the fourth embodiment is different from the image processing apparatus according to the second embodiment in that the noise matrix corresponds to a plurality of color components and a noise matrix memory 1300 that stores the noise matrix is added or changed. It is the configuration that was done. That is, the present embodiment has a configuration in which the second embodiment and the third embodiment are combined.
[0078]
A procedure for generating a noise matrix for each color component according to the gradation value of the input image in the present embodiment will be described. The method of selecting the noise matrix according to the pixel value of the input image is the same as in the second embodiment, and the noise matrix n is determined by referring to the input pixel value g (where 0 ≦ g ≦ 255). Is selected by the conditional expression.
[0079]
n = n1 (g <4)
n = n2 (4 ≦ g <16)
n = n3 (16 ≦ g <64)
n = n4 (64 ≦ g)
Here, n1, n2, n3, and n4 represent noise matrices selected according to each input gradation, and for convenience of the following description, noise matrices of level 1, level 2, level 3, and level 4 are sequentially used. I will call it. The number of vertical and horizontal elements of the noise matrix was 16 × 16. FIG. 14 illustrates a C noise matrix used for an input image of the color component C, where 1400 is level 1, 1401 is level 2, 1402 is level 3, and 1403 is level 4. FIG. 15 exemplifies an M noise matrix used for an input image of the color component M, where 1500 is level 1, 1501 is level 2, 1502 is level 3, and 1503 is level 4. FIG. 16 illustrates a Y noise matrix used for the input image of the color component Y, where 1600 is level 1, 1601 is level 2, 1602 is level 3, and 1603 is level 4. Finally, FIG. 17 illustrates a K noise matrix used for the input image of the color component K, where 1700 is level 1, 1701 is level 2, 1702 is level 3, and 1703 is level 4. Note that the noise amount distribution in the C noise matrix is set to be the same as the noise matrix of the second embodiment (FIG. 10). That is, the noise amounts at the (i, j) -th level 1, level 2, level 3 and level 4 in the C noise matrix are represented by n1_c (i, j), n2_c (i, j), n3_c (i, j). ), N4_c (i, j), the noise amount of each noise matrix is set by the following equation.
[0080]
<C noise matrix, level 1>
n1_c (i, j) = floor (−10 × cos (πr 1 / 8√2))
r 1 = √ ((i-8) 2 + (J-8) 2 )
<C noise matrix, level 2>
n2_c (i, j) = floor (−10 × cos (πr 2 / 4√2))
r 2 = √ ((i% 8-4) 2 + (J% 8-4) 2 )
<C noise matrix, level 3>
n3_c (i, j) = floor (−10 × cos (πr 3 / 2√2))
r 3 = √ ((i% 4-2) 2 + (J% 4-2) 2 )
<C noise matrix, level 4>
n4_c (i, j) = floor (−10 × cos (πr 4 / $ 2))
r 4 = √ ((i% 2-1) 2 + (J% 2-1) 2 ).
[0081]
The function floor (A) represents the maximum integer value not larger than A, and π represents the pi. Further, the M noise matrix, the Y noise matrix, and the K noise matrix are generated by shifting the C noise matrix in the vertical and horizontal directions with reference to the previously determined C noise matrix. That is, the (i, j) -th noise amount in the M noise matrix, the Y noise matrix, and the K noise matrix is n1_m (i, j) to n4_m (i, j) and n1_y (i, j) according to each level. Nn4_y (i, j) and n1_k (i, j) 〜n4_k (i, j), the noise amount of each color component at each noise matrix level is n1_c (i, j) 〜n4_c representing the noise amount of C. It is set by the following equation using (i, j).
[0082]
<Level 1>
n1_m (i, j) = n1_c ((i + 8)% 16, (j + 8))% 16)
n1_y (i, j) = n1_c ((i + 8)% 16, j)
n1_k (i, j) = n1_c (i, (j + 8))% 16)
<Level 2>
n2_m (i, j) = n2_c ((i + 4)% 16, (j + 4))% 16)
n2_y (i, j) = n2_c ((i + 4)% 16, j)
n2_k (i, j) = n2_c (i, (j + 4)% 16)
<Level 3>
n3_m (i, j) = n3_c ((i + 2)% 16, (j + 2))% 16)
n3_y (i, j) = n3_c ((i + 2)% 16, j)
n3_k (i, j) = n3_c (i, (j + 2)% 16)
<Level 4>
n4_m (i, j) = n4_c ((i + 1)% 16, (j + 1))% 16)
n4_y (i, j) = n4_c ((i + 1)% 16, j)
n4_k (i, j) = n4_c (i, (j + 1)% 16).
[0083]
Through the above procedure, a noise matrix for each color component according to the gradation value of the input image is generated. The means for generating a noise matrix does not need to be incorporated in the present image processing apparatus. A noise matrix is generated in advance by a separate noise matrix generating apparatus, and only the result is stored in the noise matrix memory.
[0084]
That is, the C noise matrix 1400 in FIG. 14, the M noise matrix 1500 in FIG. 15, the Y noise matrix 1600 in FIG. 16, and the K noise matrix 1700 in FIG. 17 are respectively the C noise matrix 1200, the M noise matrix 1201, and the Y noise matrix 1201 in FIG. It has the same configuration as the noise matrix 1202 and the K noise matrix 1203. The C noise matrices 1400 to 1403 for each luminance in FIG. 14 have the same contents as the noise matrices 1200 to 1203 for each luminance in FIG. Each of the M noise matrices 1501 to 1503, the Y noise matrices 1601 to 1603, and the K noise matrices 1701 to 1703 for each luminance is different from the M noise matrix 1500, the Y noise matrix 1600, and the K noise matrix 1700 with respect to the C noise matrix 1400. They are offset from each other by the offset.
[0085]
As a result, a pixel to which a negative noise amount is given is likely to generate a dot, and a pixel to which a plus noise amount is given is difficult to generate a dot. It can be different for each level. This prevents dots from linking in a chain and eliminates the delay in the generation of dots at the rising edge of the highlight area, thereby providing different colors for input images having a plurality of color components. In order to suppress overlapping of dots between components, it is possible to control the positions of the dots with respect to the mutual color components and also to control the arrangement of the dots according to the luminance level.
[0086]
With the above configuration, it is possible to select a noise matrix suitable for the pixel value of the input image and to specify a pixel position where a dot tends to be generated and a pixel position where a dot is weak for each color component. In particular, in the highlight region, an effect of suppressing dot overlap and an effect of improving dot dispersibility for each gradation are provided.
[0087]
(Fifth embodiment)
In the first to fourth embodiments, the amount of noise given to the noise noise matrix is a value included in the range of -10 to +10. However, in the present embodiment, the noise matrix is applied to the threshold value at the time of quantization. It is configured to play the role of representing the sign of the noise to be generated. It should be noted that the configuration of the device is the same as that of FIG.
[0088]
FIG. 18 shows an example of a noise matrix used in the present embodiment. Each element has a value of either +1 or -1. In this embodiment, the size of the noise matrix is 16 × 16 pixels. Assuming that the (i, j) -th element value in the noise matrix is e (i, j), the element value at each pixel position is the following with respect to the distance r from the center pixel position (8,8) in the noise matrix: It is obtained by the formula.
[0089]
if (r <= 6)
e (i, j) =-1
else
e (i, j) = + 1
Where r = √ ((i−8) 2 + (J-8) 2 ).
[0090]
The noise amount n_val to be applied to the quantization threshold corresponding to the pixel position (x, y) of the input pixel data is set by the following equation using the selected noise code e (i, j). .
[0091]
n_val = 10 × e (x% 16, y% 16)
That is, a pixel to which a negative noise amount is given indicates that the noise amount applied to the threshold value at the time of quantization of the pixel is −10. Conversely, a pixel to which a positive noise amount is given indicates that the noise amount applied to the threshold value at the time of quantization of the pixel is +10. The means for generating a noise matrix does not need to be incorporated in the present image processing apparatus. A noise matrix is generated in advance by a separate noise matrix generating apparatus, and only the result is stored in the noise matrix memory.
[0092]
In this manner, similarly to the first embodiment, the dot dispersibility in the highlight area can be improved, and the delay in the generation of dots at the start of the area can be suppressed, so that the visual arrangement with a uniform dot arrangement can be achieved. It is possible to form a binary dot pattern which is economically preferable. In addition, the size of the noise matrix can be reduced.
[0093]
In the present embodiment, the input image has been described with respect to one color. However, according to the methods described in the third and fourth embodiments, even when the input image is a color image composed of a plurality of color components, It goes without saying that the embodiments are adaptable. By applying the present invention to an apparatus using many noise matrices as in the third and fourth embodiments, a greater effect can be obtained.
[0094]
With the above configuration, the amount of data allocated to one element of the noise matrix can be reduced to one bit, so that the noise matrix memory can be reduced in size and the system can be simplified.
[0095]
(Other embodiments)
It is to be noted that an object of the present invention is to supply a storage medium storing program codes of software for realizing the functions of the above-described embodiments to a system or an apparatus, and to store the storage medium in a computer (or CPU or MPU) of the system or apparatus. The object of the present invention is also achieved by reading and executing the read program.
[0096]
In this case, the program code itself read from the storage medium implements the novel function of the present invention, and the storage medium storing the program code constitutes the present invention.
[0097]
As a storage medium for supplying the program code, for example, a floppy disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a nonvolatile memory card, a ROM, and the like can be used.
[0098]
When the computer executes the readout program code, not only the functions of the above-described embodiment are realized, but also the OS or the like running on the computer performs the actual processing based on the instruction of the program code. This includes a case where some or all of the functions are performed and the functions of the above-described embodiments are realized by the processing.
[0099]
Further, the program code read from the storage medium causes a CPU or the like provided in a function expansion board or a function expansion unit inserted in the computer to perform part or all of the actual processing, and the function of the above-described embodiment is performed by the processing. This includes the case where it is realized.
[0100]
【The invention's effect】
As described above, according to the present invention, in pseudo halftone expression processing of a multi-valued image using the error diffusion method, it is possible to prevent dots from being connected in a chain, and It is possible to eliminate a dot generation delay.
[0101]
Further, since the dispersion of dots can be controlled in accordance with the gradation levels of the pixels, it is possible to prevent the dot-like connection of dots over all gradations of the multi-valued image.
[0102]
In addition, since the dispersion of dots can be controlled for each color component of a pixel, chain connection of dots can be prevented for all color components.
[0103]
In addition, for a multi-valued image of a color having a plurality of color components, dot position control is performed on the mutual color components in order to suppress overlapping of dots between different color components, and dot distribution is performed over all gradations. A good processing result can be obtained.
[0104]
Further, the above effect can be achieved while reducing the size of the noise matrix.
[Brief description of the drawings]
FIG. 1 is a block diagram of an image processing apparatus according to a first embodiment of the present invention.
FIG. 2 is a flowchart illustrating processing of the image processing apparatus according to the first embodiment.
FIG. 3 is a diagram of an example of scanning an image.
FIG. 4 is a diagram of a configuration example of an error diffusion memory.
FIG. 5 is a flowchart illustrating a procedure for setting a threshold variation amount.
FIG. 6 is an example of a diagram illustrating a relationship between a gradation value and an average quantization error.
FIG. 7 is a diagram illustrating an example of an image used when calculating a threshold variation amount.
FIG. 8 is a diagram illustrating an example of a noise matrix.
FIG. 9 is a block diagram of an image processing apparatus according to a second embodiment of the present invention.
FIG. 10 is a diagram illustrating an example of a noise matrix set for each gradation.
FIG. 11 is a block diagram of an image processing apparatus according to a third embodiment of the present invention.
FIG. 12 is a diagram illustrating an example of a noise matrix set for each color component.
FIG. 13 is a block diagram of an image processing apparatus according to a fourth embodiment of the present invention.
FIG. 14 is a diagram illustrating an example of a cyan noise matrix set for each gradation.
FIG. 15 is a diagram illustrating an example of a magenta noise matrix set for each gradation.
FIG. 16 is a diagram illustrating an example of a yellow noise matrix set for each gradation.
FIG. 17 is a diagram showing an example of a black noise matrix set for each gradation.
FIG. 18 is a diagram illustrating another example of a noise matrix.
FIG. 19 is a diagram illustrating an example of a binary image in which dots are connected in a chain.
FIG. 20 is a block diagram of a computer.
[Explanation of symbols]
100 ... Image data input terminal.
101: cumulative error adding unit.
102: threshold change amount LUT.
103: noise matrix memory.
104: threshold value calculation unit.
105 ... Quantization unit.
106: Error calculation unit.
107: Error diffusion unit.
108 ... accumulated error memory.
109 ... Image data output terminal.
110 ... Address input terminal.

Claims (17)

誤差拡散法により入力画像を量子化する画像処理装置であって、
量子化のための閾値の変動量を記憶する手段と、
前記閾値に印加するノイズの配置を規定するノイズマトリックスを記憶するメモリと、
前記閾値の変動量と前記ノイズマトリックスとを参照して量子化のための閾値を設定する閾値設定手段と、
前記閾値設定手段により設定された閾値により注目画素を量子化する量子化手段と、
前記量子化手段による量子化誤差を前記注目画素近傍の画素に拡散する誤差拡散手段と
を有することを特徴とする画像処理装置。
An image processing device for quantizing an input image by an error diffusion method,
Means for storing a variation amount of a threshold value for quantization;
A memory that stores a noise matrix that defines the arrangement of noise applied to the threshold,
Threshold setting means for setting a threshold for quantization with reference to the variation amount of the threshold and the noise matrix,
Quantization means for quantizing the pixel of interest with a threshold value set by the threshold value setting means,
An image processing apparatus comprising: an error diffusion unit that diffuses a quantization error by the quantization unit to a pixel near the target pixel.
前記閾値設定手段は、入力画像の階調値に応じて前記閾値を設定することを特徴とする、請求項1記載の画像処理装置。The image processing apparatus according to claim 1, wherein the threshold setting unit sets the threshold according to a tone value of an input image. 前記閾値設定手段は、入力画像の階調値及び画素位置に応じて前記閾値を設定することを特徴とする、請求項1記載の画像処理装置。The image processing apparatus according to claim 1, wherein the threshold setting unit sets the threshold according to a gradation value and a pixel position of an input image. 前記閾値の変動量は、前記誤差拡散手段によって発生する量子化誤差の平均値が無視できる微小値となるように設定されていることを特徴とする、請求項1から請求項3のいずれかに記載の画像処理装置。4. The method according to claim 1, wherein the variation amount of the threshold value is set so that an average value of quantization errors generated by the error diffusion unit becomes a negligible small value. The image processing apparatus according to claim 1. 前記閾値の変動量は、入力画像の階調値に応じて設定されていることを特徴とする、請求項4記載の画像処理装置。The image processing apparatus according to claim 4, wherein the variation amount of the threshold is set according to a gradation value of an input image. 前記ノイズマトリックスは、マトリックスの各要素の値が集中型の配置をした二次元配列であることを特徴とする、請求項1から請求項5のいずれかに記載の画像処理装置。The image processing apparatus according to claim 1, wherein the noise matrix is a two-dimensional array in which values of respective elements of the matrix are arranged in a concentrated manner. 前記ノイズマトリックスは、量子化後のドットが、ノイズマトリクスを分割して成る領域ごとに集中的に生成されるよう値が配置されることを特徴とする、請求項1から請求項5のいずれかに記載の画像処理装置。6. The noise matrix according to claim 1, wherein values are arranged such that dots after quantization are generated intensively for each region obtained by dividing the noise matrix. An image processing apparatus according to claim 1. 前記ノイズマトリックスは、第一の値及び第二の値のみからなる二値の二次元配列であることを特徴とする、請求項6または7記載の画像処理装置。The image processing apparatus according to claim 6, wherein the noise matrix is a binary two-dimensional array including only a first value and a second value. 前記ノイズマトリックスは、入力画像の階調値に応じて選択されることを特徴とする、請求項1から請求項8のいずれかに記載の画像処理装置。9. The image processing apparatus according to claim 1, wherein the noise matrix is selected according to a tone value of an input image. 前記入力画像は複数の色成分を含むカラー画像であり、前記ノイズマトリックスは、色成分毎に用意され、色成分ごとのノイズマトリクスは互いに相関があることを特徴とする、請求項1乃至請求項9のいずれかに記載の画像処理装置。The input image is a color image including a plurality of color components, the noise matrix is prepared for each color component, and the noise matrices for each color component are correlated with each other. 10. The image processing device according to any one of items 9. 前記色成分毎の相関は、ある色成分のノイズマトリックスに対して相対的に位置のずれたノイズマトリクスが、他の色成分について使用されることにあることを特徴とする、請求項10記載の画像処理装置。11. The correlation according to claim 10, wherein the correlation for each color component is such that a noise matrix shifted in position relative to a noise matrix of a certain color component is used for another color component. Image processing device. 誤差拡散法により入力画像を量子化する画像処理方法であって、
量子化のための閾値の変動量を記憶する工程と、
前記閾値に印加するノイズの配置を規定するノイズマトリックスを記憶するメモリと、
前記閾値の変動量と前記ノイズマトリックスとを参照して量子化のための閾値を設定する閾値設定工程と、
前記閾値設定工程により設定された閾値により注目画素を量子化する量子化工程と、
前記量子化工程による量子化誤差を前記注目画素近傍の画素に拡散する誤差拡散工程と
を有することを特徴とする画像処理方法。
An image processing method for quantizing an input image by an error diffusion method,
Storing a variation amount of a threshold value for quantization;
A memory that stores a noise matrix that defines the arrangement of noise applied to the threshold,
A threshold setting step of setting a threshold for quantization with reference to the variation amount of the threshold and the noise matrix,
A quantization step of quantizing the pixel of interest with the threshold value set in the threshold value setting step,
An error diffusion step of diffusing a quantization error caused by the quantization step to a pixel near the target pixel.
前記閾値設定工程は、入力画像の階調値に応じて前記閾値を設定することを特徴とする、請求項12記載の画像処理方法。13. The image processing method according to claim 12, wherein the threshold setting step sets the threshold according to a tone value of an input image. 前記ノイズマトリックスは、量子化後のドットが、ノイズマトリクスを分割して成る領域ごとに集中的に生成されるよう値が配置されることを特徴とする、請求項12から請求項13のいずれかに記載の画像処理方法。14. The noise matrix according to claim 12, wherein values are arranged so that dots after quantization are generated intensively for each region obtained by dividing the noise matrix. 15. The image processing method according to 1. 前記入力画像は複数の色成分を含むカラー画像であり、前記ノイズマトリックスは、色成分毎に用意され、色成分ごとのノイズマトリクスは互いに相関があることを特徴とする、請求項12乃至請求項14のいずれかに記載の画像処理方法。The input image is a color image including a plurality of color components, the noise matrix is prepared for each color component, and the noise matrices for each color component are correlated with each other. 15. The image processing method according to any one of 14. コンピュータにより誤差拡散法により入力画像を量子化するためのプログラムであって、コンピュータを、
量子化のための閾値の変動量を記憶する手段と、
前記閾値に印加するノイズの配置を規定するノイズマトリックスを記憶するメモリと、
前記閾値の変動量と前記ノイズマトリックスとを参照して量子化のための閾値を設定する閾値設定手段と、
前記閾値設定手段により設定された閾値により注目画素を量子化する量子化手段と、
前記量子化手段による量子化誤差を前記注目画素近傍の画素に拡散する誤差拡散手段と
として機能させることを特徴とする画像処理装置。
A computer program for quantizing an input image by an error diffusion method, comprising:
Means for storing a variation amount of a threshold value for quantization;
A memory that stores a noise matrix that defines the arrangement of noise applied to the threshold,
Threshold setting means for setting a threshold for quantization with reference to the variation amount of the threshold and the noise matrix,
Quantization means for quantizing the pixel of interest with a threshold value set by the threshold value setting means,
An image processing apparatus characterized by functioning as an error diffusion unit for diffusing a quantization error by the quantization unit to a pixel near the pixel of interest.
コンピュータにより誤差拡散法により入力画像を量子化するためのプログラムを記録したコンピュータ可読記録媒体であって、前記プログラムによりコンピュータは、
量子化のための閾値の変動量を記憶する手段と、
前記閾値に印加するノイズの配置を規定するノイズマトリックスを記憶するメモリと、
前記閾値の変動量と前記ノイズマトリックスとを参照して量子化のための閾値を設定する閾値設定手段と、
前記閾値設定手段により設定された閾値により注目画素を量子化する量子化手段と、
前記量子化手段による量子化誤差を前記注目画素近傍の画素に拡散する誤差拡散手段と
として機能することを特徴とするコンピュータ可読記録媒体。
A computer-readable recording medium that records a program for quantizing an input image by an error diffusion method by a computer, and the computer according to the program includes:
Means for storing a variation amount of a threshold value for quantization;
A memory that stores a noise matrix that defines the arrangement of noise applied to the threshold,
Threshold setting means for setting a threshold for quantization with reference to the variation amount of the threshold and the noise matrix,
Quantization means for quantizing the pixel of interest with a threshold value set by the threshold value setting means,
A computer-readable recording medium that functions as an error diffusion unit that diffuses a quantization error by the quantization unit to a pixel near the pixel of interest.
JP2002200521A 2002-07-09 2002-07-09 Image processor and method thereof Withdrawn JP2004048194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002200521A JP2004048194A (en) 2002-07-09 2002-07-09 Image processor and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002200521A JP2004048194A (en) 2002-07-09 2002-07-09 Image processor and method thereof

Publications (1)

Publication Number Publication Date
JP2004048194A true JP2004048194A (en) 2004-02-12

Family

ID=31707361

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002200521A Withdrawn JP2004048194A (en) 2002-07-09 2002-07-09 Image processor and method thereof

Country Status (1)

Country Link
JP (1) JP2004048194A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006109263A (en) * 2004-10-07 2006-04-20 Ricoh Co Ltd Image processing apparatus, image processing method, program for computer to implement the method, image forming device, and computer readable recording medium
JP2006191457A (en) * 2005-01-07 2006-07-20 Ricoh Co Ltd Image processor, image-processing method, program for allowing computer to execute the method, image-forming apparatus, and computer-readable recording medium with the program recorded thereon
JP2007318525A (en) * 2006-05-26 2007-12-06 Ricoh Co Ltd Image forming apparatus
US20090262372A1 (en) * 2008-04-18 2009-10-22 Canon Kabushiki Kaisha Image processing apparatus and method thereof
US7760400B2 (en) 2004-10-07 2010-07-20 Ricoh Company, Limited Creating multiple threshold matrices to be used in error diffused multilevel halftoning

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006109263A (en) * 2004-10-07 2006-04-20 Ricoh Co Ltd Image processing apparatus, image processing method, program for computer to implement the method, image forming device, and computer readable recording medium
US7760400B2 (en) 2004-10-07 2010-07-20 Ricoh Company, Limited Creating multiple threshold matrices to be used in error diffused multilevel halftoning
JP4522812B2 (en) * 2004-10-07 2010-08-11 株式会社リコー Image processing apparatus, image processing method, program for causing computer to execute the method, and computer-readable recording medium
JP2006191457A (en) * 2005-01-07 2006-07-20 Ricoh Co Ltd Image processor, image-processing method, program for allowing computer to execute the method, image-forming apparatus, and computer-readable recording medium with the program recorded thereon
JP4537211B2 (en) * 2005-01-07 2010-09-01 株式会社リコー Image processing apparatus, image processing method, program causing computer to execute the method, image forming apparatus, and computer-readable recording medium recording the program
JP2007318525A (en) * 2006-05-26 2007-12-06 Ricoh Co Ltd Image forming apparatus
US8045809B2 (en) 2006-05-26 2011-10-25 Ricoh Company, Ltd. Image forming apparatus
US20090262372A1 (en) * 2008-04-18 2009-10-22 Canon Kabushiki Kaisha Image processing apparatus and method thereof
JP2009260844A (en) * 2008-04-18 2009-11-05 Canon Inc Image processing device and method
US8351083B2 (en) 2008-04-18 2013-01-08 Canon Kabushiki Kaisha Image processing apparatus and method thereof for decreasing the tonal number of an image

Similar Documents

Publication Publication Date Title
US7881553B2 (en) Image processing apparatus, image processing method, and computer program product
US5353127A (en) Method for quantization gray level pixel data with extended distribution set
JP3959698B2 (en) Image processing method and apparatus
JPH08107500A (en) Error diffusion halfton processing system and method of using homogeneous response of high/low brightness picture area
JP4236804B2 (en) Image processing method, apparatus and storage medium
JPH11164146A (en) System and method for image data processing
JPH10112801A (en) Input image processing method
JP4783566B2 (en) System and method for processing color image data
JP3489806B2 (en) Image processing apparatus and method
JP2004048194A (en) Image processor and method thereof
JP4068181B2 (en) Multilevel gradation pixel value level reduction method and system
US20080309983A1 (en) Method, apparatus and program for creating a threshold value matrix
JP2003069819A (en) Image processor and image processing method
JP2005182824A (en) Method for processing image data
Marcu Error diffusion algorithm with output position constraints for homogeneous highlight and shadow dot distribution
JP4293255B2 (en) Image processing method and image processing apparatus
JP4587153B2 (en) Image processing apparatus and method
JP3399341B2 (en) Image processing method and image processing apparatus
JP2003198843A (en) Reduced-buffer error diffusion
JP2000270210A (en) Picture processor
JP2006303999A (en) Image processing method, image processor, and image processing system
JP3844266B2 (en) Image processing device
JP2004112696A (en) Image processing device and method therefor
JP5464906B2 (en) Image processing apparatus and control method thereof
JPH10108009A (en) Image-processing method and its device

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20051004