JP3646694B2 - Image processing apparatus and method - Google Patents

Image processing apparatus and method Download PDF

Info

Publication number
JP3646694B2
JP3646694B2 JP2001357296A JP2001357296A JP3646694B2 JP 3646694 B2 JP3646694 B2 JP 3646694B2 JP 2001357296 A JP2001357296 A JP 2001357296A JP 2001357296 A JP2001357296 A JP 2001357296A JP 3646694 B2 JP3646694 B2 JP 3646694B2
Authority
JP
Japan
Prior art keywords
data
value
gradation
binarization
error
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 - Lifetime
Application number
JP2001357296A
Other languages
Japanese (ja)
Other versions
JP2002218241A (en
Inventor
繁明 角谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2001357296A priority Critical patent/JP3646694B2/en
Publication of JP2002218241A publication Critical patent/JP2002218241A/en
Application granted granted Critical
Publication of JP3646694B2 publication Critical patent/JP3646694B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、多階調画像データを、中間調表示可能な2階調画像データに変換出力する画像処理装置、特に多階調画像データを誤差拡散法または平均誤差拡散最小法を用い、中間調表示な2階調画像データに変換出力する画像処理装置及び方法の改良に関する。
【0002】
【背景技術】
従来より、スキャナなどの画像入力を用いて読み取った多階調画像データや、コンピュータを用いて演算された多階調グラフィック画像データ等を、例えばディスプレイやプリンタ等を用いて再生表示させたり、あるいはファクシミリやデジタル複写機等を用いて再生表示させることが行われている。
【0003】
このとき、画像出力装置として、多階調の画像データが再生表示できるものを用いる場合には問題はないが、例えばドット単位での階調制御ができないプリンタ装置や、ディスプレイ装置を用いた場合には、各画素の階調を2階調に減らす二値化処理を行う必要がある。
【0004】
さらに、前記多階調画像データを保存し、あるいは転送するために、そのデータ容量を減らそうとする場合には、同様に各画素の階調数を2階調に減らす二値化処理することが広く行われている。
【0005】
このように、多階調画像データを二値化処理する手法としては、各種のものがある。その中で、最も画質の優れたものとして、誤差拡散法や、それと等価な平均誤差最小法が広く用いられている。前記誤差拡散法や平均誤差最小法は、高解像度でありながら、連続的な階調制御が可能であるという優れた特徴をもつ。
【0006】
前記誤差拡散法は、ある画素の二値化時に生じた量子化誤差を、周辺のまだ二値化していない画素に拡散して加えるものである。一方、平均誤差最小法は、周辺の二値化済みの画素に生じた量子化誤差の重み付き平均値で、次の注目画素のデータ値を修正するものである。誤差拡散法と、平均誤差最小法は、誤差の拡散作業をいつ行うかが異なるだけであり、論理的には等価である。誤差拡散法を使用した例としては、例えば特開平1−284173号公報の「画像処理方法及び装置」等がある。
【0007】
【発明が解決しようとする課題】
しかし誤差拡散法や平均誤差最小法を用いた従来の画像処理装置では、多階調画像データを2階調画像データに変換する際に、次のような問題があった。
【0008】
[第1の問題点]
低濃度領域(黒ドットが疎な領域)の立上がり部における黒ドットの生成および、高濃度領域(白ドットが疎な領域)の立上がり部における白ドットの生成が、大幅に遅延し、その結果、最悪の場合には画像が変形してしまう場合があるという問題があった。
【0009】
[第2の問題点]
また、低濃度領域や高濃度領域が終わった後も、周辺画素に対する異常な誤差の拡散が残り、低濃度領域の後に続く画像データは高濃度側に、高濃度領域の後に続く画像データは低濃度側に歪む「尾引き」という現象が生じるという問題があった。
【0010】
前記第1の問題点を、白い紙上に黒インクのドットを印画する2階調プリンタ装置の場合について考えると、黒ドットはインクが滲んで大きくなるのに対し、白ドットは周囲の黒ドットからの滲みで潰れて目立ちにくくなるので、前記第1の問題点は特に低濃度部で目立つ結果となる。
【0011】
前記第1の問題点および第2の問題点を、図面を用いてより詳細に説明する。
【0012】
図13は、多階調を用いて表示された原画像100である。この原画像100は、濃度階調値252(255で最高値)の正方形をした高濃度領域110の中に、濃度階調値3(0が最低濃度)の正方形の低濃度領域120が存在し、さらにこの低濃度領域120の右下に濃度階調値231(背景濃度252よりやや低濃度)の傾き45度の直線130が引いてある。
【0013】
図14(A)には、誤差拡散法を用いた従来技術により、図13に示す原画像100の多階調画像データを二値化した画像が示されている。なお、図14(B)には、図14(A)の場所を示すための概略図が示されている。この二値化画像は、原画像100の左上隅画素を二値化開始点とし、右方向に1行分二値化した後、1画素下の行の左端に移る、という二値化作業を繰り返し得られたものである。これに対し、図12は、同じ原画像100が理想的に二値化された場合の出力例であり、本発明の画像処理装置によるものである。
【0014】
両者を比較すると、図14では、正方形をした高濃度領域110の上辺および左辺の領域140(図14(B)参照)で白ドットの生成が遅延し、さらに正方形の低濃度領域120の上辺および左辺の領域142では、黒ドットの生成の遅延が生じている。すなわち、領域140,142では、前述した第1の問題が発生している。
【0015】
さらに、階調値3の正方形をした低濃度領域120の尾引きの影響で、その右下にある領域150において、直線130の一部132が消失してしまっている。このように、領域150では、前述した第2の問題が発生している。
【0016】
このような、第1および第2の問題を解決するために、特開平1−130945号公報にかかる「画像処理装置」の提案がなされている。
【0017】
この提案に記載の第1の実施例は、0〜255の256階調の入力濃度データを扱う場合に、入力濃度データ値が1以上29以下の場合に、しきい値が以下に示すようにランダムに変化するようにしている。
【0018】
入力データが1〜4の時は、20〜230、入力データが5〜14のときは50〜200、入力データが15〜29のときは100〜150の幅でしきい値をランダムに変化させる。ランダムノイズの幅は、データが1〜4の時はプラスマイナス105、データが5〜14のときはプラスマイナス75、データが15〜29のときはプラスマイナス25というふうになっており、0に近い低濃度領域ほど、大きなノイズを加える結果となっている。ただし、しきい値の期待値はいずれも125で一定となっている。
【0019】
このようにすると、低濃度時には大きなしきい値ノイズによってしきい値が非常に小さな値になるケースが生じる。このため、低濃度領域の立上り部でも255側に二値化される画素が発生し、ドット生成の遅延が改善される。しかし、この手法によって前記第1の問題点を改善しようとした場合には、低濃度領域は非常にノイズの多い、低品位な画像となってしまう。また、この従来例では、判定回路という特別な機構を設け、この判定回路を用い、注目画素周辺の二値化済み画素の二値化結果を調べ、周辺に既にドットがある場合には、注目画素をドット有りに二値化しないような判定処理を行っている。これは、前記問題を少しでも改善するためであろうと思われる。しかし、そのためには、判定回路が近傍の12画素という多くの画素の二値化結果を参照するという複雑な判定処理が必要となり、処理時間がかかる上に、画質的にもまだ十分ではないという問題があった。これに加えて、この従来技術では、第2の問題点の改善も不十分であった。
【0020】
また、この従来技術に記載の「その他の実施例1」には、信号410を定義する式と、その例を示す図1とが食い違って記載されており、その正確な理解は難しい。しかし、この従来技術には、「前述の実施例の場合と同じような閾値設定の機能をもたせて、かつハード規模を小さくできる」と述べられていることから、第1の実施例同様に、低濃度領域ではしきい値に大量のノイズを加えていると考えられる。従って、この従来例に記載の「その他の実施例1」は、「第1の実施例」と同様な問題点を有している。
【0021】
また、前記第1および第2の問題点を改善するための別の手法として、特開平3−112269号公報にかかる「画像処理装置」や、特開平4−126464号公報にかかる「画像形成装置」などの提案がある。これらの従来技術は、注目画素近傍の複数画素の二値化結果を参照することによって、平均濃度値を推定し、それをしきい値として注目画素の二値化を行っている。
【0022】
しかし、これらの従来技術は、次の▲1▼、▲2▼の問題があった。
【0023】
(1)周辺の10以上もの画素の二値化結果を参照する必要があり、処理時間がかかったり、複雑な処理回路が必要となったりするという問題があった。
【0024】
(2)さらに、データが急に変化しているエッジ部分では、周辺画素の平均濃度値を用いるのは適切でなく、この結果、不適切な二値化が行われ、ノイズが発生してしまうという問題があった。
【0025】
本発明は、このような従来の課題に鑑みなされたものであり、その目的は、低濃度領域、高濃度領域の立上り部でのドット生成の遅延や、低濃度領域、高濃度領域が終わった後の尾引きの問題を解決する事ができるとともに、画質劣化につながるがる副作用がなく、複雑な処理回路などを用いなくても多階調画像データを高速に二階調画像データに画像処理できる画像処理装置及び方法を得ることにある。
【0026】
【課題を解決するための手段】
(1)前記目標を達成するため、本発明は、
多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理装置において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正手段と、
前記注目画素の多階調画像データの階調値に応じて2値化のためのしきい値に異なる値を設定し得るしきい値設定手段と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化手段と、
を有し、
所定の多階調画像データ領域において、所定の多階調画像データの階調値に対して設定するしきい値は、該所定の階調値よりも大きい階調値に対して設定するしきい値以下となる関係が成り立ち、
前記2値化手段は、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う。
【0027】
前記所定の多階調画像データの領域とは、
実質的に前記第1階調値から前記第2階調値の全ての範囲とすることが可能である。
【0028】
前記所定の多階調画像データの領域とは、
前記第1階調値の近傍または前記第2階調値の近傍の少なくとも片方とすることが可能である。
【0029】
前記第1階調値と第2階調値の中間値をmとして、
前記所定の多階調画像データの領域とは前記第1階調値近傍であり、該所定の階調値よりも大きい階調値はm近傍であるか、または、
前記所定の多階調画像データの領域とは前記m近傍であり、該所定の階調値よりも大きい階調値は前記第2階調値近傍である、
の少なくとも片方を実質的に満たすようにすることが可能である。
【0030】
(2)また、本発明は、多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理装置において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正手段と、
前記注目画素の多階調画像データの階調値に応じて2値化のためのしきい値に異なる値を設定し得るしきい値設定手段と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化手段と、
を有し、前記注目画素の多階調画像データの階調値をdata、前記第1階調値および第2階調値の中間値をm、前記しきい値をslshとすると、
前記しきい値設定手段は、
dataが第1階調値近辺の値の場合には、data≦slsh≦(m+data)/2
dataが第2階調値近辺の値の場合には、(m+data)/2≦slsh≦data
のいずれかを満たすようにしきい値slshを設定し、
前記2値化手段は、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う。
【0031】
前記しきい値設定手段は、
slsh=(data*(K−1)+m)/K(ただし、Kは2以上の整数で表される定数)
を満たすようにしきい値slshを設定することが可能である。
【0032】
前記しきい値設定手段は、
前記階調値dataの値に応じて、前記しきい値slshを段階的に設定することが可能である。
【0033】
前記しきい値設定手段は、
data<m−L1の場合には、slsh=data+L1
m−L1<data<m+L2の場合には、slsh=m
m+L2<dataの場合には、slsh=data−L2
(ただし、L1 ,L2 は0〜mの間の整数で表される定数)
を満たすようにしきい値slshを設定することが可能である。
【0034】
(3)また、本発明は、多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理方法において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正工程と、
2値化のためのしきい値を設定するしきい値設定工程と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化工程と、
を含み、所定の多階調画像データの階調値に対してしきい値設定工程において設定するしきい値は、該所定の階調値よりも大きい階調値に対して設定するしきい値よりも低い関係が所定の多階調画像データ領域において成り立ち、
前記2値化工程では、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う。
【0035】
(4)また、本発明は、多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理方法において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正工程と、
2値化のためのしきい値を設定するしきい値設定工程と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化工程と、
を含み、前記注目画素の多階調画像データの階調値をdata、前記第1階調値および第2階調値の中間値をm、前記しきい値をslshとすると、
前記しきい値設定工程では、
dataが第1階調値近辺の値、または第2階調値近辺の値であるかを判別し、
dataが第1階調値近辺の値の場合には、data≦slsh≦(m+data)/2
dataが第2階調値近辺の値の場合には、(m+data)/2≦slsh≦data
を満たすようにしきい値slshを設定し、
前記2値化工程では、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う。
【0036】
【発明の実施の形態】
(1)本実施の形態は、
多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに変換出力する画像処理装置において、
注目画素の多階調画像データに、周辺の既に二値化済の画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正手段と、
前記注目画素の多階調画像データの階調値に基づき、2値化しきい値を設定するしきい値設定手段と、
設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに変換出力する二値化手段と、
を含み、
前記注目画素の多階調画像データの階調値をdata、前記第1階調値および第2階調値の中間の値をm、前記しきい値をslshとすると、
前記しきい値設定手段は、
前記二値化しきい値slshを、前記注目画素の多階調画像データの階調値dataに応じて、次式に示す許容範囲の少なくともいずれか一方を満たすように設定することを特徴とする。
【0037】
dataが第1階調値近辺の値の場合には、data≦slsh≦(m+data)/2
dataが第2階調値近辺の値の場合には、(m+data)/2≦slsh≦data
ここにおいて、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataが、前記第1階調値および第2階調値の付近の値であるとき、前記二値化しきい値slshを前記許容範囲に設定するよう形成できる。
【0038】
また、必要に応じ、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataが、前記第1階調値または第2階調値の付近の値であるとき、前記二値化しきい値slshを前記許容範囲に設定するよう形成することもできる。
【0039】
また、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataの値に基づき、次式に従い前記二値化しきい値slshを設定することも可能である。
【0040】
slsh=(data*(K−1)+m)/K
ただし、Kは2以上の整数で表される定数。
【0041】
また、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataの値に応じて、前記二値化しきい値slshを段階的に設定することも可能である。
【0042】
また、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataの値に基づき、次式に従い前記二値化しきい値slshを設定することも可能である。
【0043】
data<m−L1のときには、slsh=data+L1
m−L1<data<m+L2のときには、slsh=m
m+L2<dataのときには、slsh=data−L2
ただし、L2,L2は0〜mの間の整数で表される定数。
【0044】
また、前記二値化手段は、
設定されたしきい値または前記補正画素データにランダムノイズを加え、前記補正画素データに対する前記二値化処理を行うことも可能である。
【0045】
また、前記誤差補正手段は、
各画素毎の拡散誤差積算値を記憶する拡散誤差記憶部と、
補正画素データと二値化結果との二値化誤差を演算し、その二値化誤差を誤差拡散法を用い注目画素近傍の未二値化画素へ分配して拡散する演算を行い、前記拡散誤差記憶部に記憶された各画素毎の拡散誤差積算値に、前記注目画素からの拡散誤差を加算して新たな拡散誤差積算値を求め、前記拡散誤差記憶部に記憶された各画素毎の拡散誤差積算値を更新する誤差拡散部と、
注目画素の多階調画像データと、前記拡散誤差記憶部に記憶された注目画素の拡散誤差積算値とを加算し、前記補正画素データを演算するデータ補正部と、
を含み、注目画素の多階調画像データを誤差拡散法を用い補正し、補正画素データとして出力することも可能である。
【0046】
また、前記誤差補正手段は、
各画素毎の誤差を記憶する誤差記憶部と、
補正画素データと二値化結果との二値化誤差を演算し、その二値化誤差を前記誤差記憶部に記憶する誤差拡散部と、
前記誤差記憶部に記憶された注目画素の周辺の画素の二値化誤差を読み出し所定の重み付けをすることにより平均誤差を求め、この平均誤差を注目画素の多階調画像データに加算し、前記補正画素データを演算するデータ補正部と、
を含み、注目画素の多階調画像データを平均誤差最小法を用い補正し、補正画素データとして出力することも可能である。
【0047】
本実施の形態において、多階調画像データは、誤差補正手段およびしきい値決定手段に入力される。
【0048】
誤差補正手段は、注目画素の多階調データに、周辺の既に二値化済の画素から拡散された誤差を加えて補正し、補正画素データとして出力する。
【0049】
前記しきい値設定手段は、注目画素の多階調画像データの階調に基づき、二値化しきい値を設定する。このとき、注目画素の多階調画像データの階調値dataが、二値化された後の画像の第1階調値および第2階調値(第1階調値<第2階調値)の少なくともいづれか一方の付近の値を取るとき、二値化しきい値slshを次式に示す許容範囲内に設定する。
【0050】
dataが第1階調値近辺の値の時には、data≦slsh≦(m+data)/2
dataが第2階調値近辺の値の時には、(m+data)/2≦slsh≦data
そして、二値化設定手段は、設定されたしきい値に基づき、前記補正画素データを、中間調表示可能な第1階調値および第2階調値からなる2階調画像データに変換出力する。
【0051】
このように、本実施の形態では、多階調画像データ値が小さいときには、しきい値を小さく、画像データ値が大きいときには、しきい値も大きくするよう注目画素の多階調画像データの階調値に応じて二値化しきい値を最適化することで、二値化に伴い発生する誤差の蓄積を解消し、注目画素のドット生成を良好に行うことができる。
【0052】
また、本実施の形態のように、誤差拡散法または平均誤差最小法を用い二値化処理を行う場合には、二値化しきい値を変化させても、全体としての出力濃度はほとんど変動しないことが確認された。
【0053】
以上説明したように、本実施の形態によれば、低濃度領域や高濃度領域で、多量の誤差の蓄積が発生するという現象を解消することができ、それに起因して生じていた、低濃度または高濃度領域の立上り部でのドット生成の遅延や、低濃度領域または高濃度領域が終わった後の尾引きなどの問題を画質劣化につながる副作用なしに根本的に解決することができる。
【0054】
すなわち、本実施の形態によれば、多階調画像データを、誤差拡散法または平均誤差最小法を用いて補正し、しかも、注目画素の階調値画像データの階調値に基づき、二値化しきい値を最適化するしきい値設定手段を設けることにより、低濃度領域や高濃度領域で多量の誤差の蓄積が生じているという現象を解消することができ、それに起因して発生していた、低濃度領域や高濃度領域の立上り部でのドット生成の遅延や、低濃度領域や高濃度領域が終わった後の「尾引き」などの問題を、画質劣化に繋がる副作用なしに根本的に解消できる画像処理装置を得ることができるという効果がある。
【0055】
さらに、本実施の形態によれば、しきい値設定手段を、簡単な演算を行うか、または変換テーブルを参照するなどの単純な構成で実現できるため、複雑な処理回路を必要とせず、高速にかつ良好な画像処理を行うことができる。
【0056】
さらに、本実施の形態では、しきい値設定手段が設定するしきい値を増減させることで、ドット生成速度の調整が可能となり、必要に応じ過補正状態を設定することで、例えばエッジ強調的な効果を期待できるという副次的な効果が得られる。
【0057】
次に、本発明の好適な実施例を図面に基づき詳細に説明する。
【0058】
[システム全体の説明]
図1には、本発明にかかる画像処理装置を用いたシステムの概略が示されている。
【0059】
階調画像データ出力装置10から出力される原画像の多階調画像データ200は、画像処理装置30へ入力される。
【0060】
画像処理装置30は、入力された原画像の多階調画像データ200を、二値画像出力装置20の出力可能な2階調に階調数変換して出力する。すなわち、多階調画像データ200を、誤差拡散法または平均誤差最小法を用いて補正し、中間調表示可能な第1階調値および第2階調値のみからなる2階調画像データ230に変換して出力する。
【0061】
二値画像出力装置20は、画像処理装置30から出力される2階調画像データ230に基づき、原画像を再生出力する。
【0062】
本実施例において、前記階調画像データ出力装置10は、コンピュータを用いて形成されている。そして、このコンピュータは、ハードディスク等に記憶された多階調画像データ200を画像処理装置30へ向け出力するように構成されている。前記多階調画像データ200は、0〜255の256階調の濃度データとして表されている。なお、この階調画像データ出力装置10は、これ以外に、例えばコンピュータグラフィックの多階調画像データを出力するように形成してもよく、また、コンピュータ以外でも、例えば、スキャナ、ビデオカメラなど各種の手段を用いてもよい。
【0063】
そして、実施例の画像処理装置30は、入力される256階調の画像データを、誤差拡散法により、0(白)または255(黒)のみからなる2階調画像データ230に変換出力する。
【0064】
また、実施例の二値画像出力装置20は、画素単位での階調制御ができないプリンタを用いて形成され、入力される2階調画像データ230に基づき、原画像を中間調表示可能に再生出力する。なお、前記二値画像出力装置20は、プリンタ以外に、必要に応じ、ディスプレイや、ファクシミリ装置、デジタル複写機等を用いてもよい。
【0065】
[システムの具体例]
本実施例において、前記画像処理装置30は、階調画像データ出力装置10または二値画像出力装置20と別体に形成してもよいが、必要に応じ、これら各装置10,20と一体に形成してもよい。
【0066】
例えば、図15に示すよう、階調画像データ出力装置10としてホストコンピュータ12を用い、二値画像出力装置20としてプリンタ20を用いた場合には、本実施例の画像処理装置30を、プリンタ22内へ一体的に組み込んで形成することができる。この場合には、プリンタ22は、ホストコンピュータ12より出力する多階調画像データ200が入力されるデータ入力部24と、本実施例の画像処理装置30と、二値化ドット印画手段26とを含んで構成される。
【0067】
また、本実施例の画像処理装置30を、図16に示すよう、ホストコンピュータ12内へ一体的に組み込んで形成してもよい。この場合、ホストコンピュータ12は、階調画像ファイルの読込手段14と、プリンタドライバ16と、データ出力手段18とを含むように構成される。そして、前記プリンタドライバ16は、階調画像ファイル読込手段14から多階調画像データ200が入力される本実施例の画像処理装置30と、この画像処理装置30の出力に基づき、プリンタ制御コマンドを生成するプリンタ制御コマンド生成手段16aとを含み、プリンタ制御コマンドに基づき、プリンタ22を制御するように構成されている。
【0068】
なお、図17に示すよう、階調画像データ出力装置10としてスキャナ50を用い、このスキャナ50で読み込んだ多階調画像データを二値化データとしてホストコンピュータ60へ出力する場合には、スキャナ50に本実施例の画像処理装置30を一体的に組み込んで形成すればよい。この場合には、スキャナ50は、画像を光学的に読み取る階調画像データ読み取り部52と、読み取られた多階調画像データ200を2階調画像データ230として出力する本実施例の画像処理装置30と、出力された2階調画像データ230のデータをホストコンピュータへ向け出力する二値化データ出力部54とを含んで構成される。
【0069】
なお、本実施例の画像処理装置は必要に応じ、前述以外の装置に一体的に組み込んで形成することもできる。
【0070】
なお、説明の都合上、以降の説明では、図1に示すよう、本実施例の画像処理装置30は、階調画像データ出力装置10および二値画像データ出力装置20とは別体に形成されるものとして、その説明を行う。
【0071】
[画像処理装置]
図2には、前記画像処理装置30の機能ブロック図が示されている。
【0072】
実施例の画像処理装置30は、最適しきい値設定手段32と、誤差補正手段34と、二値化手段36とを含んで構成される。
【0073】
前記最適しきい値設定手段32および誤差補正手段34には、注目画素の多階調画像データ200として、i行j列目の画素P[i,j]のデータdata(i,j)が入力されている。
【0074】
前記最適しきい値設定手段32は、この注目画素P[i,j]の多階調画像データ200を二値化するのに用いるslsh(i,j)を、注目画素の多階調画像データdata(i,j)に応じ、次式に基づき設定する。
【0075】
slsh(i,j)=(data(i,j)*(K−1)+128)/K …(1)
ここで、Kは、2以上の整数で表される定数である。
【0076】
前記誤差補正手段34は、注目画素P[i,j]の多階調画像データdata(i,j)を、周辺画素の二値化によって生じる二値化誤差に基づき誤差拡散法を用いて補正し、補正画素データdata c(i,j)として二値化手段36へ向け出力する。
【0077】
二値化手段36は、入力される注目画素P[i,j]の補正画素データdata c(i,j)を、しきい値slsh(i,j)と比較して二値化し、その二値化結果result(i,j)を2階調画像データ230として出力する。すなわち、補正画素データを、次のように二値化して出力する。
【0078】
data c(i,j)≧slsh(i,j)ならば、result(i,j)=255
data c(i,j)<slsh(i,j)ならば、result(i,j)=0 …(2)
前記実施例の誤差補正手段34は、データ補正手段38、誤差拡散手段40、拡散誤差記憶手段42を含んで構成される。
【0079】
前記拡散誤差記憶手段42は、原画像の各画素毎の拡散誤差積算値total err(n,m)を記憶している。
【0080】
そして、誤差拡散手段40は、まず、二値化結果result(i,j)と補正データdata c(i,j)とにより、二値化誤差errを、
err(i,j)=data c(i,j)−result(i,j) …(3)
のようにして求める。次にその二値化誤差err (i,j)を近傍の未二値化画素P[m,n](P[i,j+1]、P[i+1,j]等)へ分配して拡散する。具体的には、拡散誤差記憶手段40が記憶している各画素毎の拡散誤差積算値total err(n,m)に、注目画素P[i,j]からの拡散誤差分を加算していく。いま、図3(a)のような誤差拡散重みマトリクスを用いるとする。図3の*が注目画素を示す。重みの合計値は16なので、注目画素での二値化誤差に、分配対象の画素位置に応じた重み値を乗じた後、16で割った値を、以下のようにtotal err(m,n)に加算する。
【0081】
total err(i ,j+1)=total err(i ,j+1)+err(i,j)*3/16
total err(i ,j+2)=total err(i ,j+2)+err(i,j) /16
total err(i+1,j-2)=total err(i+1,j-2)+err(i,j) /16
total err(i+1,j-1)=total err(i+1,j-1)+err(i,j)*2/16
total err(i+1,j )=total err(i+1,j )+err(i,j)*3/16
total err(i+1,j+1)=total err(i+1,j+1)+err(i,j)*2/16
total err(i+1,j+2)=total err(i+1,j+2)+err(i,j) /16
total err(i+2,j-1)=total err(i+2,j-1)+err(i,j) /16
total err(i+2,j )=total err(i+2,j )+err(i,j) /16
total err(i+2,j+1)=total err(i+2,j+1)+err(i,j) /16 …(4)
以上の工程により注目画素P[i,j]の二値化に伴う誤差拡散は終わる。
【0082】
以上の工程を、二値化手段36から二値化結果が出力される毎に繰り返して行う。なお、誤差拡散法の重みマトリクスの例としてはこれ以外にも、必要に応じ、例えば図3(b)、図3(c)など各種のものを採用することができる。
【0083】
そして、データ補正手段38は、注目画素P[i,j]の多階調画像データdata(i,j)が入力されると、その注目画素P[i,j]に対応した拡散誤差積算値total err(i,j)を拡散誤差記憶手段42から読み出し、これを次式に基づき注目画素の多階調画像データdata(i,j)に加え、補正画像データdata c(i,j)を求める。
【0084】
datac(i,j)=data(i,j)+total err(i,j) …(5)
このような動作を、全画素について繰り返し行うことで、全画面の二値化を行う。
【0085】
[第1,第2の問題点の解消]
このようにして、実施例の画像処理装置30は、入力される注目画素の多階調画像データ200を、誤差拡散法を用い、中間調表示可能な0階調値および255階調値のみからなる2階調画像データ230に変換出力する。
【0086】
本実施例の画像処理装置30の特徴は、低濃度領域や高濃度領域で多量の二値化誤差の蓄積が生じていたのを、最適しきい値設定手段32を用い解消し、それに起因して発生していた、低濃度領域または高濃度領域の立上り部でのドット生成の遅延や、低濃度領域または高濃度領域が終わった後の尾引き等の問題を解消したことにある。
【0087】
以下、本実施例の画像処理装置によって、前述した第1の問題点(ドット生成の遅延)および第2の問題点(尾引きの問題)の双方が解決される理由について説明する。
【0088】
本発明者は、まず、前記第1および第2の問題点の原因の解明を行った。このために、図2に示す画像処理装置30において、最適しきい値設定手段32が設定する二値化しきい値を128に固定し、しかも画像データ200として、全画素が一定階調値であるような画像のデータを入力した。そして、前記数式(5)で原画像データに加えられる二値化誤差err(i,j)の平均値がどうなるかを調べてみた。
【0089】
具体的には、図2に示す実施例の画像処理装置から最適しきい値設定手段32を取り除き、二値化しきい値を128にほぼ固定した。そして、図4に示すよう、原画像サイズが600画素×400画素であり、全画素が一定の階調値であるような原画像160を、その左上隅を出発点として二値化処理した。そして、ドット形成が安定状態に達したと思われる、右下隅の200画素×100画素の領域170について、前記数式(5)で原画像データに加えられる二値化誤差err(i,j)の平均値を、平均二値化誤差として求めた。ただし、しきい値は128に完全固定ではなく、特定の規則的パターンが生じる事態を回避する目的で、プラスマイナス6の範囲の少量のランダムノイズを加えてある。このノイズは、原画像データが本例のようにコンピュータで作り出した人工的なデータの場合に、パターンが規則的に生じるのを防ぐために付加したものである。
【0090】
図5には、以上の実験を、異なる階調値の原画像160について行った結果を表したものである。この実験結果から明らかなように、原画像160は、その階調値が1〜4という低濃度のものや、階調値が251〜254という高濃度のものでは、その平均二値化誤差が0になるどころか、絶対値で100にも達するような大きな値となっていることがわかる。平均二値化誤差は、定常状態における誤差の拡散、蓄積量の期待値に相当するものである。誤差拡散法は、二値化誤差の局所的平均値を最小にする手法であると考えられているから、低濃度領域や高濃度領域で平均二値化誤差が0ではなく、このような絶対値の大きな値を取るということは、非常に興味深い発見であった。
【0091】
この図5に示す実験データから、前述した第1および第2の問題点の生じるメカニズムを、次のように解析することができる。
【0092】
(1)原画像160の階調値が、1〜8や、247〜254というように0または255近辺の値をとる場合には、二値化しきい値を128のように固定すると、ドットが安定して形成される定常状態に落ち着くまでには、平均二値化誤差の絶対値が80以上に達するような多量の誤差蓄積がなされる必要がある。特に、階調値が1〜4や251〜254の値の原画像データ160では、ドットが安定して形成される定常状態に落ち着くまでに、100以上の多量の誤差が蓄積される必要がある。この誤差蓄積量は、多階調画像データ200の濃度値が二値化濃度値である0および255に近付くほど大きくなる。
【0093】
(2)誤差の蓄積時間
また、画像データの濃度が0付近の値の場合、それを0に二値化してもわずかな二値化誤差しか生じない。そのため、この二値化誤差が拡散・蓄積して80〜100前後の値に達するまでには、かなりの蓄積期間が必要となる。また、画像データの濃度が255付近の値の場合にも、その二値化誤差が拡散・蓄積して、80〜100前後の値に達するまでには、同様にかなりの蓄積期間が必要となる。しかも、蓄積速度も、画像データの濃度値が二値化濃度値である0および255に近付くほど遅くなる。
【0094】
(3)第1の問題点
誤差が蓄積されて、定常状態での蓄積量に達するまでの蓄積期間中は、ドットは形成されない。このため、ドット形成のために多量の誤差蓄積量が必要とされ、しかも、必要とされる誤差蓄積量に達するまでにかなりの蓄積期間が必要になると、ドット生成の遅延が発生することになる。これが、第1の問題の原因となる。
【0095】
(4)第2の問題点
ドット形成のために多量の誤差蓄積量が必要になると、多量に蓄積された誤差が、領域外部にまで拡散されて周辺の画像データを歪ませる。これが、第2の問題の原因となり、前述した尾引きの問題が生じる。
【0096】
以上、(1)〜(4)で述べたように、画像データが二値化濃度値である0および255付近の値をとる場合に、平均二値化誤差が非常に大きな絶対値を取り、「誤差の蓄積」現象が生じる。この「誤差の蓄積」現象が、前記第1および第2の問題点の発生原因である。
【0097】
本実施例の画像処理装置において、最適しきい値設定手段32は、この「誤差の蓄積」という根本原因を解消し、前記第1および第2の問題点を本質的に解決するものである。すなわち、原画像データ200が低濃度の時には、二値化しきい値を小さく、高濃度の時にはしきい値を大きくするようにして、原画像データ200の濃度に応じて二値化しきい値を最適化することで、「誤差の蓄積」自体を解消しつつ、「誤差の蓄積」なしでドット生成を行うことを可能とするものである。
【0098】
ここで、「低濃度領域でのしきい値を勝手に小さくしたりすると、255(黒ドット)に二値化される画素が増えて、濃度が大幅に上昇してしまうのではないか?」というような疑問が生じるかもしれない。確かに誤差拡散を行わない一般のディザ法においてはしきい値の変動は即濃度の変化に繋がる。しかし、本発明者が確認したところでは、誤差拡散法ではしきい値を変えてもトータルでの出力濃度はほとんど変動しなかった。すなわち、しきい値を128に固定して二値化した場合と、64や192に固定して二値化した場合とで、出力濃度はほとんど変わらないのである。これは、誤差拡散法では二値化誤差を捨て去ることなく、周辺の未二値化画素に拡散させるためである。例えば、しきい値を小さくしたために従来ならば0に二値化されていた画素が255に二値化される事態が生じても、その画素にはより絶対値の大きな負の二値化誤差が生じる。それが周辺の未二値化画素に拡散され、周辺画素階調レベルを下げる方向に働いて帳尻を合わせる。
【0099】
図6には、本実施例による「誤差の蓄積」の解消効果が示されている。すなわち、図6は、本実施例の最適しきい値設定手段32を用いた場合に、図5と同様にして調べた平均二値化誤差がどのようになるかを明らかにしたもので、図5に示したしきい値が128固定の場合に加えて、本実施例の数式(1)におけるKの値を、2,4,8,∞とした場合の結果がプロットしてある。K=∞の場合、slsh=dataとなる。ただし図6の場合も、図5の場合同様、数式(1)で決まったしきい値に、最大でプラスマイナス6の少量のランダムノイズを加えている。
【0100】
図6より、K=2、すなわち、slsh=(data+128)/2とすれば、平均二値化誤差が最大でも50以下と半分以下に減少し、誤差の蓄積量を大きく減少させる効果があるのがわかる。さらに、K=4とすると、全体的に平均二値化誤差が0に近付き、K=8とすると、画像データの濃度が1,2や253,254といった0や255に極めて近い階調値の場合でも、平均二値化誤差はほぼ0になる。
【0101】
図1に示す画像処理装置30から出力される2階調画像データ23に基づき、実際にプリンタを用いて印画を行い、前述した第2の問題点の「尾引き」の影響を評価する実験を行った。この評価実験の結果、平均二値化誤差の絶対値を50以下に押さえることにより、第2の問題点の「尾引き」の影響を大幅に軽減できることが確認された。このことから、前記数式(1)のKの値をK=2〜∞の範囲に設定することにより、すなわち、しきい値slshを画像データdataの階調値に応じて、
data<128のときには data≦slsh≦(128+data)/2
data>128のときには (128+data)/2≦slsh≦data …(6)
の範囲になるよう設定することにより、平均二値化誤差の絶対値を50以下に納めることができ、第2の問題点を解決することができる。
【0102】
次に、前記第1の問題点の「ドット生成遅れ」の影響を評価する実験も行った。この実験の結果、ドット生成遅れも、平均二値化誤差が減るに従って改善されることが確認された。前記数式(1)のKを大きくしすぎると、平均二値化誤差が0を越えて、その符号が逆転してしまう「過補正状態」が生じる。しかし、実際の印字結果の主観評価では、やや過補正状態にまでドット生成速度を早めたほうが、印字強調的な効果が生じて好ましい画質になった。data値が、1,2や253,254といったドット生成の遅れの最も大きいデータ領域の再現性を重視した主観評価結果では、K=8〜24程度の範囲が非常に良好で、K=16は最適であった。
【0103】
図7には、平均二値化誤差が常に0になる二値化しきい値が示されている。この二値化しきい値は、図6を基にして補間演算による推定値として求めた。
【0104】
実施例の画像処理装置の最適しきい値設定手段32を、図7に基づいて原画像データから二値化しきい値を決定するように形成すれば、前記第2の問題点の「尾引き」の期待値が0になる最良の最適しきい値設定手段が実現できる。なお、図7には、同時に、数式(1)のKの値が2,8,∞の場合の特性図が描かれている。これらの特性曲線から、Kの値をK=8前後に設定した場合に、平均二値化誤差を0にするための好適な近似値が得られることがわかる。また、先に述べたように、第1の問題点のドット生成の遅延の改善の点から、平均二値化誤差が0を越えて符号が逆転した「過補正状態」気味のほうがよい主観評価が得られる場合があり、主観評価では、K=16程度の近似式を用いた場合に最良の結果が得られた。K=∞までいくと、データ変化部のエッジがかなり強調される結果となるが、これも画像の使用目的によっては十分に有用なものとなる。
【0105】
また、図7では、原画像データ200が0または255の場合の最適しきい値を128としたが、データ階調値と二値化結果値が等しい場合のしきい値は、どのように設定しても大差なくなる。したがって、本実施例の最適しきい値設定手段32でも、データ値が0または255の場合には、しきい値をどのように設定してもよい。
【0106】
このように、本実施例によれば、多階調画像データ200を誤差拡散法を用いて、中間調表示可能な2階調画像データ230に変換出力するとともに、その二値化処理に使用する二値化しきい値を、多階調画像データ200の階調値に基づき、前記数式(6)の範囲に設定することにより、前記第1および第2の問題点を、画質劣化に繋がる副作用なしに根本的に解決することができた。
【0107】
しかも、本実施例によれば、数式(1)の定数Kの設定の仕方により、所望の特性をもった二値化出力画像を得ることができる。
【0108】
なお、図6,図7に示した補正データは、図3(a)に示した誤差拡散重みマトリクスを用いて誤差拡散した場合の例である。異なる重みマトリクスを用いた場合は、定量的には多少異なった結果が得られるが、定性的な傾向はほとんど変わりがない。このように、本発明は、異なる誤差拡散重みマトリクスを用いた場合にも、有効である。
【0109】
[本実施例と従来例との比較]
本実施例と同様に、原画像データ200の階調値に応じて、二値化しきい値を変化させるものとしては、特開平4−154370号公報の「画像処理装置及び画像処理方法」があった。しかし、この手法は、文字・線画部でのノイズの抑制に主目的をおいて、「原画濃度データが大きいほど、小さい二値化しきい値が対応させられる」ように、本実施例とは正反対の方向にしきい値を変化させるものであり、第1,第2の問題点の改善効果はほとんどなかった。なお、二値化手法に平均誤差最小法を用いた例については、特開平4−154370号公報を参照すればよい。
【0110】
図12は、図2に示す本実施例の画像処理装置30を用いて、図3に示す原画像100をした場合の出力例を示す図である。図14で問題となった、ドット生成の遅延や、低濃度領域120からの尾引きによる直線130の中央部の消失等の問題点が、完璧に解消しているのがわかる。
【0111】
このように、本実施例によれば、第1,第2の問題点を理想的に解決できることが確認された。さらに、本実施例によれば、有害な副作用を伴うことなく、第1,第2の問題点を解決できることも確認できた。
【0112】
[最適しきい値設定手段の他の実施例]
前記実施例において、最適しきい値設定手段32は、数式(1)に基づき二値化しきい値の設定を行っている。本発明はこれに限らず、必要に応じて他の手法を用い二値化しきい値の設定を行うようにしてもよい。
【0113】
図8には、最適しきい値設定手段32の他の実施例が示されている。
【0114】
本実施例の最適しきい値設定手段32は、注目画素の多階調画像データ200として入力されるデータdata[i,j]に基づき、次式に示すようにしてしきい値を設定するように形成されている。
【0115】
0≦data(i,j)<128-L1ならばslsh(i,j)=data(i,j)+L1
128-L1≦data(i,j)≦128+L2ならばslsh(i,j)=128
128+L2<data(i,j)≦255ならばslsh(i,j)=data(i,j)-L2 …(7)
ここにおいて、L1,L2は0〜64の適当な値でよいが、8〜16の範囲とすると最適となる。なお、L1,L2は同じ値に設定してもよい。本実施例の場合は、data値が128前後の場合には、数式(6)で示した
data<128の時にはdata≦slsh≦(128+data)/2
data>128の時には(128+data)/2≦slsh≦data
という範囲からはずれることになるが、本発明が解決しようとしている第1,第2の問題点が特に顕著になるのは、dataが0または255近辺の値(0および255は含まない)の場合である。したがって、全データ領域で数式(6)が満たされる必要はなく、dataが0または255近辺の値の場合に数式(6)が満たされればよい。
【0116】
したがって、二値化しきい値を、前記数式(7)に示すように設定することによっても、前記第1および第2の問題点を解決し、前記第1実施例と同様に良好な二値化画像を得ることができる。
【0117】
図8には、最適しきい値設定手段32のさらに別の実施例が示されている。
【0118】
実施例の最適しきい値設定手段32では、原画像データ200の階調値に応じ、二値化しきい値を連続的ではなく、段階的に設定する。このようにしても、前記実施例と同様に第1および第2の問題点を解決し、良好な二値化画像を得ることができる。
【0119】
また、図10には、最適しきい値設定手段32のさらに別の実施例が示されている。実施例の最適しきい値設定手段32は、低濃度領域のみに、本発明の特徴とするしきい値最適化動作が働くように形成されている。すなわち、画像データ200のしきい値が高濃度領域側にある場合には、二値化しきい値は128に固定され、画像データ200が低濃度領域側の0近辺の値にあった時に、最適しきい値を前記数式(6)を満足するように設定するよう形成されている。
【0120】
例えば、ドットの滲み量の大きいプリンタ装置では、高濃度部の孤立した白ドットがほとんど潰れてしまうため、高濃度部では、第1の問題点がもともと顕著に現われない。そのため、第1の問題点が目立ちやすい低濃度部のみを、本発明により改善しようとするものである。
【0121】
なお、画像出力装置の特性に応じ、これとは逆に高濃度部領域のみに本発明のしきい値最適化動作が働くように形成してもよい。
【0122】
このように、本発明の最適しきい値設定手段32は、その画像出力装置に応じて、必要な原画像濃度領域にのみ、最適しきい値設定するように形成してもよい。
【0123】
[しきい値設定手段の具体例]
前述した各実施例における最適しきい値設定手段32は、原画像データから二値化しきい値を設定するために、前記した数式(1)のような演算をその都度行うように形成してもよく、また原画像データの階調値と二値化しきい値との対応関係をあらかじめ変換テーブル内に記憶しておき、それを参照するように形成してもよい。
【0124】
図11には、最適しきい値設定手段32を、ROMを用いて構成した具体例が示されている。ROMのアドレスバスA0〜A7に8ビット原画像データを入力すると、それに対応した8ビットの二値化しきい値がデータバスD0〜D7に出力されるよう形成されている。
【0125】
また、各実施例の中には、最適しきい値設定手段32によって設定された二値化しきい値に、さらに少量のランダムノイズを加えている例があった。これは、原画像データが、コンピュータ等で描いた非常に整然としたデータの場合に、誤差拡散法での二値化により特定の規則的パターンが生じてしまうことがあるのを防ぐために行うものである。したがって、原画像データが、階調値の適当なばらつきをもった自然画の場合には、このようなランダムノイズを加える処理は不必要になる。
【0126】
また、ランダムノイズを付加した結果、しきい値が数式(6)で示した範囲からはずれてしまうことがありうるが、しきい値の期待値が数式(6)の範囲に入っていればよいものとする。
【0127】
また、しきい値ではなく、原画像データ側にノイズを付加しても、同様の効果が得られる。
【0128】
[他の実施例]
なお、本発明は前記各実施例に限定されるものではなく、本発明の要旨の範囲内で各種の変形実施が可能である。
【0129】
例えば、前記実施例では、原画像データが0で白、255で黒となるような濃度データである場合を例にとり説明したが、原画像データが0で黒、255で白となるような、明度データである場合も、本発明を同様に適用できることはいうまでもない。
【0130】
また、原画像データがA〜B(A>B)の範囲の値をとる場合に、この原画像データをaまたはb(a>b)に二値化する場合には、第1の実施例の数式(1)を、
slsh(i,j)=(data(i,j)*(K-1)+(a+b)/2)/K …(1)'
に変換し、数式(2)を
dataC(i,j)≧slsh(i,j)ならば、result(i,j)=a
dataC(i,j)<slsh(i,j)ならば、result(i,j)=b …(2)'
のように変更すればよい。一般にはA=a、B=bであるが、出力装置の出力可能濃度が原画像データの範囲と大きく異なっている場合には、Aとa、Bとbが一致しない例もある。
【0131】
この場合、数式(6)のしきい値設定のための条件式は、m=(a+b)/2として、
data<mの時にはdata≦slsh≦(m+data)/2
data>mの時には(m+data)/2≦slsh≦data …(8)
のようになる。
【0132】
また、前記実施例では、多階調画像データ200を、誤差拡散法を用いて補正する場合を例にとり説明したが、本発明はこれに限らず、平均誤差最小法を用いて補正する場合にも適用できる。
【0133】
図18には、平均誤差最小法を用いた画像処理装置30の好適な実施例が示されている。なお、図2に示す前記実施例と対応する部材には同一の符号を付しその説明は省略する。
【0134】
本実施例において、誤差補正手段34は、データ補正手段38と、誤差計算手段44と、誤差記憶手段46とを含んで構成される。
【0135】
前記誤差計算手段44は、前記数式(3)に基づき、注目画素の二値化誤差errを演算し、誤差記憶手段46の注目画素に対応したアドレスにその値を書き込むよう形成されている。この結果、誤差記憶手段46の各画素アドレスに対応した記憶エリアには、二値化済みの画素の二値化誤差が順次書き込み記憶されていく。
【0136】
データ補正手段38は、注目画素P[i,j]の多階調画像データdata(i,j)が入力されると、その注目画素P[i,j]近傍の二値化済みの画素の誤差を誤差記憶手段46から読み出す。そして、読み出した誤差データに所定の重みを付けをして平均誤差を求め、この平均誤差を注目画素の多階調画像データdata(i,j)に加え、これを補正画像データdata c(i,j)として二値化手段36へ向け出力する。
【0137】
なお、これ以外の構成は、前記第1実施例と同様であるので、ここではその説明は省略する。
【0138】
このような平均誤差最小法を用いた場合でも、前記第1実施例と同様な効果を奏することができる。
【図面の簡単な説明】
【図1】本発明が適用された画像処理システムの概略説明図である。
【図2】図1に示す画像処理システムに用いられる画像処理装置の機能ブロック図である。
【図3】本実施例で用いられる拡散重みマトリクスの具体例の説明図である。
【図4】平均二値化誤差を求めるために使用した原画像データと、平均二値化誤差を求める領域との関係を示す説明図である。
【図5】原画像データの階調値と、平均二値化誤差の関係を示す説明図である。
【図6】本発明の第1実施例で、平均二値化誤差がどのように発生するかを示す説明図である。
【図7】平均二値化誤差が常に0になる二値化しきい値の説明図である。
【図8】本発明に用いられるしきい値設定手段の他の実施例の説明図である。
【図9】本発明に用いられるしきい値設定手段の他の実施例の説明図である。
【図10】本発明に用いられるしきい値設定手段の他の実施例の説明図である。
【図11】本発明に用いられるしきい値設定手段をハードウェアにて構成した例の説明図である。
【図12】本発明の画像処理装置を用いて得られる二値化結果の説明図である。
【図13】図12,図14に示す二値化画像を得るために用いた原画像の説明図である。
【図14】従来の誤差拡散法により得られた、二値化結果の説明図である。
【図15】本発明の画像処理装置を組み込んだ画像処理システムの全体概略説明図である。
【図16】図15のシステムの他の実施例の説明図である。
【図17】図15のシステムの他の実施例の説明図である。
【図18】多階調画像データの補正に平均誤差最小法を用いる画像処理装置の実施例のブロック図である。
【符号の説明】
30 画像処理装置
32 しきい値設定手段
34 誤差補正手段
36 二値化手段
38 データ補正手段
40 誤差拡散手段
42 拡散誤差記憶手段
200 多階調画像データ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus that converts multi-tone image data into two-tone image data that can be displayed in halftone, and in particular, multi-tone image data using an error diffusion method or an average error diffusion minimum method. The present invention relates to an improvement in an image processing apparatus and method for converting and outputting display two-tone image data.
[0002]
[Background]
Conventionally, multi-tone image data read using an image input such as a scanner, multi-tone graphic image data calculated using a computer, and the like are reproduced and displayed using, for example, a display or a printer, or the like. Reproduction display is performed using a facsimile, a digital copying machine, or the like.
[0003]
At this time, there is no problem when an image output device that can reproduce and display multi-gradation image data is used. However, for example, when a printer device or a display device that cannot perform tone control in dot units is used. Needs to perform binarization processing to reduce the gradation of each pixel to two gradations.
[0004]
Further, when the data capacity is to be reduced in order to store or transfer the multi-gradation image data, the binarization process is similarly performed to reduce the number of gradations of each pixel to two gradations. Is widely practiced.
[0005]
As described above, there are various methods for binarizing multi-tone image data. Among them, the error diffusion method and the equivalent average error minimum method are widely used as the most excellent in image quality. The error diffusion method and the minimum average error method have an excellent feature that continuous gradation control is possible while having high resolution.
[0006]
In the error diffusion method, a quantization error generated when a certain pixel is binarized is diffused and added to surrounding pixels that have not yet been binarized. On the other hand, the minimum average error method corrects the data value of the next pixel of interest with a weighted average value of quantization errors occurring in the surrounding binarized pixels. The error diffusion method and the average error minimum method are logically equivalent except that they differ only when the error diffusion operation is performed. An example using the error diffusion method is, for example, “Image processing method and apparatus” disclosed in Japanese Patent Laid-Open No. 1-284173.
[0007]
[Problems to be solved by the invention]
However, the conventional image processing apparatus using the error diffusion method or the minimum average error method has the following problems when converting multi-tone image data to 2-tone image data.
[0008]
[First problem]
The generation of black dots at the rising edge of the low density area (area where the black dots are sparse) and the generation of white dots at the rising edge of the high density area (the area where the white dots are sparse) are significantly delayed. In the worst case, there is a problem that the image may be deformed.
[0009]
[Second problem]
In addition, even after the low density area or high density area ends, abnormal error diffusion remains in the surrounding pixels, so that image data following the low density area is on the high density side, and image data following the high density area is low. There was a problem that a phenomenon called “tailing” distorted on the density side occurred.
[0010]
Considering the first problem in the case of a two-tone printer that prints black ink dots on white paper, the black dots become larger due to ink smearing, whereas the white dots are separated from the surrounding black dots. The first problem is particularly conspicuous in the low-density part.
[0011]
The first problem and the second problem will be described in more detail with reference to the drawings.
[0012]
FIG. 13 shows an original image 100 displayed using multiple gradations. The original image 100 includes a square low density region 120 having a density gradation value 3 (0 is the lowest density) in a high density region 110 having a density gradation value 252 (255 is the highest value) square. Furthermore, a straight line 130 having a gradient of 45 degrees of the density gradation value 231 (slightly lower than the background density 252) is drawn at the lower right of the low density area 120.
[0013]
FIG. 14A shows an image obtained by binarizing the multi-tone image data of the original image 100 shown in FIG. 13 by the conventional technique using the error diffusion method. Note that FIG. 14B is a schematic diagram for showing the location of FIG. This binarized image has a binarization operation in which the upper left corner pixel of the original image 100 is set as a binarization start point, binarized by one line in the right direction, and then moved to the left end of the line below one pixel. It was obtained repeatedly. On the other hand, FIG. 12 shows an output example when the same original image 100 is ideally binarized, and is based on the image processing apparatus of the present invention.
[0014]
Comparing the two, in FIG. 14, generation of white dots is delayed in the upper side and the left side region 140 (see FIG. 14B) of the square high density region 110, and the upper side of the square low density region 120 and In the region 142 on the left side, there is a delay in black dot generation. That is, in the areas 140 and 142, the first problem described above occurs.
[0015]
Furthermore, a part 132 of the straight line 130 disappears in the region 150 at the lower right due to the tailing of the low density region 120 having a square with a gradation value of 3. As described above, in the region 150, the second problem described above occurs.
[0016]
In order to solve the first and second problems, an “image processing apparatus” according to Japanese Patent Application Laid-Open No. 1-130945 has been proposed.
[0017]
In the first embodiment described in this proposal, when the input density data of 256 gradations from 0 to 255 is handled, and the input density data value is 1 or more and 29 or less, the threshold value is as shown below. I try to change randomly.
[0018]
When the input data is 1 to 4, the threshold value is randomly changed within a range of 20 to 230, when the input data is 5 to 14, 50 to 200, and when the input data is 15 to 29, the threshold is changed to 100 to 150. . The random noise width is plus or minus 105 when the data is 1 to 4, plus or minus 75 when the data is 5 to 14, and plus or minus 25 when the data is 15 to 29. The closer the low density region, the greater the noise. However, the expected values of the threshold values are all constant at 125.
[0019]
In this case, there is a case where the threshold value becomes very small due to a large threshold noise at a low density. For this reason, a pixel that is binarized on the rising side of the low density region is generated on the 255 side, and the dot generation delay is improved. However, if the first problem is to be improved by this method, the low density region becomes a noisy and low quality image. In addition, in this conventional example, a special mechanism called a determination circuit is provided, and using this determination circuit, the binarization result of the binarized pixels around the pixel of interest is examined, and if there are already dots around the pixel of interest, Judgment processing is performed so as not to binarize pixels with dots. This seems to improve the problem as much as possible. However, this requires complicated determination processing in which the determination circuit refers to the binarization results of many neighboring pixels, such as 12 pixels, which requires processing time and is not sufficient in terms of image quality. There was a problem. In addition to this, the improvement of the second problem is insufficient in this conventional technique.
[0020]
Further, in the “other embodiment 1” described in this prior art, the equation defining the signal 410 and the example shown in FIG. 1 are different from each other, and it is difficult to understand accurately. However, since this prior art states that “the function of threshold setting similar to the case of the above-described embodiment can be provided and the hardware scale can be reduced”, as in the first embodiment, It is considered that a large amount of noise is added to the threshold value in the low concentration region. Therefore, the “other embodiment 1” described in this conventional example has the same problems as the “first embodiment”.
[0021]
As another method for improving the first and second problems, an “image processing apparatus” according to Japanese Patent Laid-Open No. 3-112269 and an “image forming apparatus” according to Japanese Patent Laid-Open No. 4-126464 are disclosed. There are proposals such as. In these conventional techniques, an average density value is estimated by referring to a binarization result of a plurality of pixels near the target pixel, and the target pixel is binarized using the average density value as a threshold value.
[0022]
However, these conventional techniques have the following problems (1) and (2).
[0023]
(1) There is a problem that it is necessary to refer to the binarization result of 10 or more pixels in the vicinity, which requires processing time and requires a complicated processing circuit.
[0024]
(2) Furthermore, it is not appropriate to use the average density value of the peripheral pixels at the edge portion where the data changes suddenly. As a result, inappropriate binarization is performed and noise is generated. There was a problem.
[0025]
The present invention has been made in view of such a conventional problem, and its purpose is to finish the delay of dot generation at the rising edge of the low density area and the high density area, and the low density area and the high density area. It can solve the problem of tailing later, has no side effects that lead to image quality degradation, and can process multi-tone image data to two-tone image data at high speed without using complicated processing circuits. It is to obtain an image processing apparatus and method.
[0026]
[Means for Solving the Problems]
(1) In order to achieve the goal, the present invention
Two-gradation image data composed of a first gradation value and a second gradation value (first gradation value <second gradation value) by using the error diffusion method or the average error minimum method. In an image processing apparatus that performs binarization conversion to
Error correction means for correcting multi-tone image data of a target pixel by adding an error diffused from surrounding binarized pixels, and outputting the corrected pixel data;
Threshold setting means capable of setting different values for the threshold for binarization according to the gradation value of the multi-tone image data of the target pixel;
Binarization means for binarizing and converting the correction pixel data into the two-tone image data based on the set threshold value;
Have
In the predetermined multi-tone image data area, the threshold value set for the tone value of the predetermined multi-tone image data is a threshold value set for a tone value larger than the predetermined tone value. The relationship below the value holds,
The binarization means includes
Binarization is performed after adding random noise to the set threshold value or the corrected pixel data.
[0027]
The region of the predetermined multi-tone image data is
Substantially the entire range from the first gradation value to the second gradation value can be achieved.
[0028]
The region of the predetermined multi-tone image data is
It may be at least one of the vicinity of the first gradation value or the vicinity of the second gradation value.
[0029]
An intermediate value between the first gradation value and the second gradation value is m,
The region of the predetermined multi-tone image data is in the vicinity of the first gradation value, and a gradation value larger than the predetermined gradation value is in the vicinity of m, or
The region of the predetermined multi-gradation image data is in the vicinity of m, and a gradation value larger than the predetermined gradation value is in the vicinity of the second gradation value.
It is possible to substantially satisfy at least one of the above.
[0030]
(2) Further, according to the present invention, the first gradation value and the second gradation value (first gradation value <second gradation) are obtained by using the error diffusion method or the average error minimum method. In an image processing apparatus that performs binarization conversion into two-tone image data consisting of
Error correction means for correcting multi-tone image data of a target pixel by adding an error diffused from surrounding binarized pixels, and outputting the corrected pixel data;
Threshold setting means capable of setting different values for the threshold for binarization according to the gradation value of the multi-tone image data of the target pixel;
Binarization means for binarizing and converting the correction pixel data into the two-tone image data based on the set threshold value;
And the gradation value of the multi-tone image data of the target pixel is data, the intermediate value of the first gradation value and the second gradation value is m, and the threshold value is slsh,
The threshold setting means includes
When data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
(m + data) / 2 ≦ slsh ≦ data when data is a value near the second gradation value
Set the threshold slsh to meet any of the
The binarization means includes
Binarization is performed after adding random noise to the set threshold value or the corrected pixel data.
[0031]
The threshold setting means includes
slsh = (data * (K−1) + m) / K (where K is a constant represented by an integer of 2 or more)
It is possible to set the threshold value slsh to satisfy the above condition.
[0032]
The threshold setting means includes
The threshold value slsh can be set stepwise in accordance with the value of the gradation value data.
[0033]
The threshold setting means includes
If data <m−L1, slsh = data + L1
When m−L1 <data <m + L2, slsh = m
If m + L2 <data, slsh = data-L2
(However, L1 and L2 are constants represented by integers between 0 and m)
It is possible to set the threshold value slsh to satisfy the above condition.
[0034]
(3) Further, according to the present invention, the first gradation value and the second gradation value (first gradation value <second gradation) are obtained by using the error diffusion method or the average error minimum method. In an image processing method for binarizing and converting to 2-tone image data consisting of
An error correction step of correcting the multi-tone image data of the target pixel by adding an error diffused from the surrounding binarized pixels, and outputting the corrected pixel data;
A threshold value setting step for setting a threshold value for binarization;
A binarization step of binarizing and converting the correction pixel data into the two-tone image data based on the set threshold value;
And the threshold value set in the threshold value setting step for the gradation value of the predetermined multi-gradation image data is a threshold value set for a gradation value larger than the predetermined gradation value A lower relationship holds for a given multi-tone image data area,
In the binarization step,
Binarization is performed after adding random noise to the set threshold value or the corrected pixel data.
[0035]
(4) Further, according to the present invention, the first gradation value and the second gradation value (first gradation value <second gradation) are obtained by using the error diffusion method or the average error minimum method. In an image processing method for binarizing and converting to two-gradation image data consisting of
An error correction step of correcting the multi-tone image data of the target pixel by adding an error diffused from the surrounding binarized pixels, and outputting the corrected pixel data;
A threshold value setting step for setting a threshold value for binarization;
A binarization step of binarizing and converting the correction pixel data into the two-tone image data based on the set threshold value;
And the gradation value of the multi-tone image data of the target pixel is data, the intermediate value of the first gradation value and the second gradation value is m, and the threshold is slsh,
In the threshold value setting step,
Determine whether data is a value near the first gradation value or a value near the second gradation value,
When data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
(m + data) / 2 ≦ slsh ≦ data when data is a value near the second gradation value
Set the threshold slsh to meet
In the binarization step,
Binarization is performed after adding random noise to the set threshold value or the corrected pixel data.
[0036]
DETAILED DESCRIPTION OF THE INVENTION
(1) This embodiment is
Two-gradation image data composed of a first gradation value and a second gradation value (first gradation value <second gradation value) by using the error diffusion method or the average error minimum method for the multi-gradation image data. In the image processing apparatus that converts and outputs to
Error correction means for correcting the multi-tone image data of the target pixel by adding an error diffused from the already binarized pixels in the periphery, and outputting the corrected pixel data;
Threshold setting means for setting a binarization threshold based on the gradation value of the multi-tone image data of the target pixel;
Binarization means for converting and outputting the corrected pixel data to the two-tone image data based on a set threshold value;
Including
When the gradation value of the multi-tone image data of the target pixel is data, the intermediate value between the first gradation value and the second gradation value is m, and the threshold value is slsh,
The threshold setting means includes
The binarization threshold value slsh is set so as to satisfy at least one of the permissible ranges shown in the following equation in accordance with the tone value data of the multi-tone image data of the target pixel.
[0037]
When data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
(m + data) / 2 ≦ slsh ≦ data when data is a value near the second gradation value
Here, the threshold value setting means includes:
When the gradation value data of the multi-gradation image data of the target pixel is a value in the vicinity of the first gradation value and the second gradation value, the binarization threshold value slsh is set within the allowable range. Can be formed.
[0038]
If necessary, the threshold value setting means
When the gradation value data of the multi-gradation image data of the target pixel is a value near the first gradation value or the second gradation value, the binarization threshold value slsh is set within the allowable range. It can also be formed.
[0039]
Further, the threshold value setting means includes:
Based on the value of the gradation value data of the multi-tone image data of the target pixel, the binarization threshold value slsh can be set according to the following equation.
[0040]
slsh = (data * (K-1) + m) / K
However, K is a constant represented by an integer of 2 or more.
[0041]
Further, the threshold value setting means includes:
It is also possible to set the binarization threshold value slsh stepwise in accordance with the gradation value data of the multi-gradation image data of the target pixel.
[0042]
Further, the threshold value setting means includes:
Based on the value of the gradation value data of the multi-tone image data of the target pixel, the binarization threshold value slsh can be set according to the following equation.
[0043]
When data <m−L1, slsh = data + L1
When m−L1 <data <m + L2, slsh = m
When m + L2 <data, slsh = data-L2
However, L2 and L2 are constants represented by integers between 0 and m.
[0044]
Further, the binarization means includes
It is also possible to add random noise to a set threshold value or the correction pixel data and perform the binarization processing on the correction pixel data.
[0045]
The error correction means includes
A diffusion error storage unit for storing a diffusion error integrated value for each pixel;
The binarization error between the corrected pixel data and the binarization result is calculated, and the binarization error is distributed and distributed to the non-binarized pixels near the target pixel using the error diffusion method. A new diffusion error integrated value is obtained by adding the diffusion error from the pixel of interest to the diffusion error integrated value for each pixel stored in the error storage unit, and for each pixel stored in the diffusion error storage unit. An error diffusion unit for updating the diffusion error integrated value;
A data correction unit that adds the multi-tone image data of the target pixel and the diffusion error integrated value of the target pixel stored in the diffusion error storage unit, and calculates the correction pixel data;
It is also possible to correct the multi-tone image data of the target pixel using the error diffusion method and output it as corrected pixel data.
[0046]
The error correction means includes
An error storage unit that stores an error for each pixel;
An error diffusion unit that calculates a binarization error between the correction pixel data and the binarization result, and stores the binarization error in the error storage unit;
An average error is obtained by reading out a binarization error of pixels around the target pixel stored in the error storage unit and performing a predetermined weighting, and adding the average error to the multi-gradation image data of the target pixel, A data correction unit for calculating correction pixel data;
It is also possible to correct the multi-tone image data of the target pixel using the average error minimum method and output it as corrected pixel data.
[0047]
In the present embodiment, multi-tone image data is input to an error correction unit and a threshold value determination unit.
[0048]
The error correction unit corrects the multi-tone data of the target pixel by adding an error diffused from the already binarized pixels in the vicinity, and outputs the corrected pixel data.
[0049]
The threshold setting means sets a binarization threshold based on the gradation of the multi-tone image data of the target pixel. At this time, the gradation value data of the multi-gradation image data of the target pixel is the first gradation value and the second gradation value (first gradation value <second gradation value) of the image after binarization. ), The binarization threshold slsh is set within the allowable range shown in the following equation.
[0050]
When data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
When data is near the second gradation value, (m + data) / 2 ≦ slsh ≦ data
Then, the binarization setting means converts and outputs the correction pixel data into two-gradation image data composed of the first gradation value and the second gradation value that can be displayed in halftones based on the set threshold value. To do.
[0051]
As described above, in this embodiment, when the multi-tone image data value is small, the threshold value is small, and when the image data value is large, the multi-tone image data level of the target pixel is large. By optimizing the binarization threshold value according to the tone value, accumulation of errors caused by binarization can be eliminated, and dot generation for the target pixel can be performed satisfactorily.
[0052]
Further, when binarization processing is performed using the error diffusion method or the average error minimum method as in the present embodiment, the overall output density hardly fluctuates even if the binarization threshold is changed. It was confirmed.
[0053]
As described above, according to the present embodiment, it is possible to eliminate the phenomenon that a large amount of error accumulation occurs in a low concentration region or a high concentration region. Alternatively, problems such as dot generation delay at the rising edge of the high density area and tailing after the low density area or after the high density area are finished can be fundamentally solved without side effects leading to image quality degradation.
[0054]
That is, according to the present embodiment, the multi-tone image data is corrected using the error diffusion method or the average error minimum method, and the binary value is based on the tone value of the tone value image data of the target pixel. By providing a threshold setting means that optimizes the threshold value, it is possible to eliminate the phenomenon that a large amount of error is accumulated in the low concentration region and the high concentration region, and this has occurred. In addition, problems such as dot generation delay at the rising edge of low density areas and high density areas, and "tailing" after the end of low density areas and high density areas are fundamentally eliminated without the side effects that lead to image quality degradation. There is an effect that it is possible to obtain an image processing apparatus that can be eliminated.
[0055]
Furthermore, according to the present embodiment, the threshold setting means can be realized with a simple configuration such as performing a simple calculation or referring to a conversion table, so that no complicated processing circuit is required and high speed is achieved. And good image processing can be performed.
[0056]
Furthermore, in the present embodiment, the dot generation speed can be adjusted by increasing or decreasing the threshold value set by the threshold value setting means. If necessary, an overcorrection state can be set, for example, edge enhancement. A secondary effect that a positive effect can be expected is obtained.
[0057]
Next, preferred embodiments of the present invention will be described in detail with reference to the drawings.
[0058]
[Description of the entire system]
FIG. 1 shows an outline of a system using an image processing apparatus according to the present invention.
[0059]
The multi-gradation image data 200 of the original image output from the gradation image data output device 10 is input to the image processing device 30.
[0060]
The image processing apparatus 30 converts the input multi-gradation image data 200 of the original image into two gradations that can be output by the binary image output apparatus 20 and outputs the result. That is, the multi-gradation image data 200 is corrected using the error diffusion method or the average error minimum method, and is converted into two-gradation image data 230 including only the first gradation value and the second gradation value that can be displayed in halftone. Convert and output.
[0061]
The binary image output device 20 reproduces and outputs the original image based on the two-tone image data 230 output from the image processing device 30.
[0062]
In this embodiment, the gradation image data output device 10 is formed using a computer. The computer is configured to output multi-gradation image data 200 stored in a hard disk or the like to the image processing apparatus 30. The multi-gradation image data 200 is represented as density data of 256 gradations from 0 to 255. In addition to this, the gradation image data output device 10 may be formed so as to output, for example, computer graphic multi-gradation image data. The following means may be used.
[0063]
Then, the image processing apparatus 30 according to the embodiment converts and outputs the input 256-gradation image data to 2-gradation image data 230 including only 0 (white) or 255 (black) by an error diffusion method.
[0064]
Also, the binary image output device 20 of the embodiment is formed using a printer that cannot perform gradation control in pixel units, and reproduces an original image so that halftone display is possible based on input two-gradation image data 230. Output. In addition to the printer, the binary image output apparatus 20 may use a display, a facsimile machine, a digital copying machine, or the like as necessary.
[0065]
[Specific system examples]
In the present embodiment, the image processing device 30 may be formed separately from the gradation image data output device 10 or the binary image output device 20, but may be integrated with these devices 10 and 20 as necessary. It may be formed.
[0066]
For example, as shown in FIG. 15, when the host computer 12 is used as the gradation image data output device 10 and the printer 20 is used as the binary image output device 20, the image processing device 30 of this embodiment is replaced with the printer 22. It can be formed by being integrally incorporated therein. In this case, the printer 22 includes a data input unit 24 to which the multi-tone image data 200 output from the host computer 12 is input, the image processing device 30 of the present embodiment, and the binarized dot printing unit 26. Consists of including.
[0067]
Further, the image processing apparatus 30 of the present embodiment may be integrally incorporated in the host computer 12 as shown in FIG. In this case, the host computer 12 is configured to include a gradation image file reading unit 14, a printer driver 16, and a data output unit 18. Then, the printer driver 16 sends a printer control command based on the image processing apparatus 30 of the present embodiment in which the multi-gradation image data 200 is input from the gradation image file reading means 14 and the output of the image processing apparatus 30. And a printer control command generating means 16a for generating, and configured to control the printer 22 based on the printer control command.
[0068]
As shown in FIG. 17, when the scanner 50 is used as the gradation image data output apparatus 10 and the multi-gradation image data read by the scanner 50 is output to the host computer 60 as binary data, the scanner 50 is used. The image processing apparatus 30 according to the present embodiment may be integrated and formed. In this case, the scanner 50 is a gradation image data reading unit 52 that optically reads an image, and the image processing apparatus of the present embodiment that outputs the read multi-gradation image data 200 as two-gradation image data 230. 30 and a binarized data output unit 54 that outputs the data of the output two-tone image data 230 to the host computer.
[0069]
Note that the image processing apparatus according to the present exemplary embodiment can be formed integrally with an apparatus other than those described above as necessary.
[0070]
For convenience of explanation, in the following explanation, as shown in FIG. 1, the image processing apparatus 30 of this embodiment is formed separately from the gradation image data output apparatus 10 and the binary image data output apparatus 20. As an example, the description will be given.
[0071]
[Image processing device]
FIG. 2 shows a functional block diagram of the image processing apparatus 30.
[0072]
The image processing apparatus 30 according to the embodiment includes an optimum threshold value setting unit 32, an error correction unit 34, and a binarization unit 36.
[0073]
The optimum threshold value setting means 32 and the error correction means 34 are input with data data (i, j) of the pixel P [i, j] in the i-th row and j-th column as the multi-tone image data 200 of the target pixel. Has been.
[0074]
The optimum threshold value setting means 32 uses slsh (i, j) used to binarize the multi-tone image data 200 of the target pixel P [i, j], and uses the multi-tone image data of the target pixel. It is set based on the following equation according to data (i, j).
[0075]
slsh (i, j) = (data (i, j) * (K-1) +128) / K (1)
Here, K is a constant represented by an integer of 2 or more.
[0076]
The error correction unit 34 corrects the multi-tone image data data (i, j) of the pixel of interest P [i, j] using an error diffusion method based on a binarization error caused by binarization of surrounding pixels. The corrected pixel data data c (i, j) is output to the binarizing means 36.
[0077]
The binarizing means 36 binarizes the correction pixel data data c (i, j) of the input target pixel P [i, j] with the threshold value slsh (i, j), The binarization result result (i, j) is output as two-tone image data 230. That is, the corrected pixel data is binarized and output as follows.
[0078]
If data c (i, j) ≧ slsh (i, j), result (i, j) = 255
If data c (i, j) <slsh (i, j), result (i, j) = 0 (2)
The error correction unit 34 of the embodiment includes a data correction unit 38, an error diffusion unit 40, and a diffusion error storage unit 42.
[0079]
The diffusion error storage means 42 stores a diffusion error integrated value total err (n, m) for each pixel of the original image.
[0080]
Then, the error diffusion means 40 first calculates the binarization error err from the binarization result result (i, j) and the correction data data c (i, j).
err (i, j) = data c (i, j) −result (i, j) (3)
It asks like this. Next, the binarization error err (i, j) is distributed and diffused to neighboring non-binarized pixels P [m, n] (P [i, j + 1], P [i + 1, j], etc.). Specifically, the diffusion error from the pixel of interest P [i, j] is added to the diffusion error integrated value total err (n, m) for each pixel stored in the diffusion error storage means 40. . Assume that an error diffusion weight matrix as shown in FIG. In FIG. 3, * indicates a target pixel. Since the total weight value is 16, the binarization error at the target pixel is multiplied by the weight value corresponding to the pixel position to be distributed, and then divided by 16, total err (m, n ).
[0081]
total err (i, j + 1) = total err (i, j + 1) + err (i, j) * 3/16
total err (i, j + 2) = total err (i, j + 2) + err (i, j) / 16
total err (i + 1, j-2) = total err (i + 1, j-2) + err (i, j) / 16
total err (i + 1, j-1) = total err (i + 1, j-1) + err (i, j) * 2/16
total err (i + 1, j) = total err (i + 1, j) + err (i, j) * 3/16
total err (i + 1, j + 1) = total err (i + 1, j + 1) + err (i, j) * 2/16
total err (i + 1, j + 2) = total err (i + 1, j + 2) + err (i, j) / 16
total err (i + 2, j-1) = total err (i + 2, j-1) + err (i, j) / 16
total err (i + 2, j) = total err (i + 2, j) + err (i, j) / 16
total err (i + 2, j + 1) = total err (i + 2, j + 1) + err (i, j) / 16… (4)
The error diffusion accompanying the binarization of the target pixel P [i, j] is completed through the above steps.
[0082]
The above process is repeated every time a binarization result is output from the binarization means 36. In addition to this, as an example of the weight matrix of the error diffusion method, various types such as FIG. 3B and FIG. 3C can be adopted as necessary.
[0083]
Then, when the multi-tone image data data (i, j) of the target pixel P [i, j] is input to the data correction unit 38, the diffusion error integrated value corresponding to the target pixel P [i, j]. Total err (i, j) is read from the diffusion error storage means 42, and this is added to the multi-tone image data data (i, j) of the target pixel based on the following equation, and the corrected image data data c (i, j) is Ask.
[0084]
datac (i, j) = data (i, j) + total err (i, j) (5)
By repeating such an operation for all the pixels, the entire screen is binarized.
[0085]
[Solving the first and second problems]
In this way, the image processing apparatus 30 according to the embodiment uses the error diffusion method to input the multi-gradation image data 200 of the target pixel from only the 0 gradation value and the 255 gradation value that can be displayed in halftone. The two-tone image data 230 is converted and output.
[0086]
A feature of the image processing apparatus 30 of the present embodiment is that the accumulation of a large amount of binarization error in the low density region and the high density region is eliminated by using the optimum threshold value setting means 32, which is attributed to this. In other words, the problems such as the delay of dot generation at the rising edge of the low density area or the high density area, and the tailing after the low density area or the high density area are finished, have been solved.
[0087]
The reason why both the first problem (dot generation delay) and the second problem (tailing problem) described above are solved by the image processing apparatus of this embodiment will be described below.
[0088]
The inventor first elucidated the causes of the first and second problems. Therefore, in the image processing apparatus 30 shown in FIG. 2, the binarization threshold value set by the optimum threshold value setting unit 32 is fixed to 128, and all pixels have a constant gradation value as the image data 200. The image data like this was input. Then, it was examined how the average value of the binarization error err (i, j) added to the original image data by the mathematical formula (5) was examined.
[0089]
Specifically, the optimum threshold value setting means 32 is removed from the image processing apparatus of the embodiment shown in FIG. Then, as shown in FIG. 4, an original image 160 having an original image size of 600 pixels × 400 pixels and all pixels having a constant gradation value is binarized from the upper left corner. Then, regarding the area 170 of 200 pixels × 100 pixels in the lower right corner where the dot formation seems to have reached a stable state, the binarization error err (i, j) added to the original image data in the above equation (5) The average value was determined as an average binarization error. However, the threshold value is not completely fixed at 128, and a small amount of random noise in the range of plus or minus 6 is added for the purpose of avoiding the occurrence of a specific regular pattern. This noise is added to prevent the occurrence of regular patterns when the original image data is artificial data generated by a computer as in this example.
[0090]
FIG. 5 shows the result of the above experiment performed on the original image 160 having different gradation values. As is clear from the experimental results, the original image 160 has an average binarization error when the tone value is low in density of 1 to 4 or high in tone values of 251 to 254. It turns out that it is a large value that reaches 100 in absolute value, rather than 0. The average binarization error corresponds to the expected value of error diffusion and accumulation in a steady state. Since the error diffusion method is considered to be a method for minimizing the local average value of the binarization error, the average binarization error is not zero in the low density region and the high density region, and such an absolute value is used. Taking a big value was a very interesting discovery.
[0091]
From the experimental data shown in FIG. 5, the mechanism causing the first and second problems described above can be analyzed as follows.
[0092]
(1) When the gradation value of the original image 160 takes a value around 0 or 255 such as 1 to 8 or 247 to 254, if the binarization threshold is fixed to 128, dots are It is necessary to accumulate a large amount of error so that the absolute value of the average binarization error reaches 80 or more before the steady state is stably formed. In particular, in the original image data 160 having gradation values of 1 to 4 and 251 to 254, a large amount of error of 100 or more needs to be accumulated before the steady state in which dots are stably formed. . The error accumulation amount increases as the density value of the multi-tone image data 200 approaches the binarized density values 0 and 255.
[0093]
(2) Error accumulation time
If the density of the image data is a value near 0, even if it is binarized to 0, only a slight binarization error occurs. Therefore, a considerable accumulation period is required until the binarization error diffuses and accumulates and reaches a value of around 80 to 100. Further, even when the density of the image data is a value near 255, a considerable accumulation period is similarly required until the binarization error diffuses and accumulates and reaches a value of around 80 to 100. . In addition, the accumulation speed also decreases as the density value of the image data approaches the binarized density values 0 and 255.
[0094]
(3) First problem
No dot is formed during the accumulation period from the accumulation of the error until the accumulation amount in the steady state is reached. For this reason, a large amount of error accumulation is required for dot formation, and if a considerable accumulation period is required to reach the required error accumulation amount, a dot generation delay occurs. . This causes the first problem.
[0095]
(4) Second problem
When a large amount of error accumulation is required for dot formation, a large amount of accumulated error is diffused to the outside of the area and distorts surrounding image data. This causes the second problem and causes the above-described tailing problem.
[0096]
As described above in (1) to (4), when the image data takes values in the vicinity of the binary density values 0 and 255, the average binarization error takes an extremely large absolute value, An “error accumulation” phenomenon occurs. This “error accumulation” phenomenon is the cause of the occurrence of the first and second problems.
[0097]
In the image processing apparatus of the present embodiment, the optimum threshold value setting means 32 eliminates the root cause of “error accumulation” and essentially solves the first and second problems. That is, when the original image data 200 has a low density, the binarization threshold value is decreased, and when the original image data 200 has a high density, the threshold value is increased, and the binarization threshold value is optimized according to the density of the original image data 200. By doing so, it is possible to perform dot generation without “accumulation of error” while eliminating “accumulation of error” itself.
[0098]
Here, “If the threshold value in the low density region is reduced arbitrarily, the number of pixels that are binarized to 255 (black dots) increases and the density increases significantly.” Such a question may arise. Certainly, in a general dither method that does not perform error diffusion, a change in threshold value immediately leads to a change in density. However, as the inventors have confirmed, in the error diffusion method, the total output density hardly fluctuated even if the threshold value was changed. That is, the output density hardly changes between the case where the threshold value is fixed to 128 and binarized, and the case where the threshold value is fixed to 64 and 192 and binarized. This is because, in the error diffusion method, the binarization error is diffused to the surrounding non-binarized pixels without being discarded. For example, even when a pixel that has been binarized to 0 in the past due to a small threshold is binarized to 255, a negative binarization error having a larger absolute value is generated in that pixel. Occurs. It is diffused to the surrounding non-binarized pixels and works in the direction of lowering the peripheral pixel gradation level to match the bottom of the book.
[0099]
FIG. 6 shows the effect of eliminating “error accumulation” according to the present embodiment. That is, FIG. 6 clarifies what the average binarization error examined in the same manner as in FIG. 5 when the optimum threshold value setting means 32 of this embodiment is used. In addition to the case where the threshold value shown in FIG. 5 is fixed at 128, the results when the value of K in Equation (1) of this embodiment is 2, 4, 8, and ∞ are plotted. When K = ∞, slsh = data. However, in the case of FIG. 6, as in FIG. 5, a small amount of random noise of plus or minus 6 at the maximum is added to the threshold value determined by the formula (1).
[0100]
As shown in FIG. 6, if K = 2, that is, slsh = (data + 128) / 2, the average binarization error is reduced to 50 or less and half or less at the maximum, and the accumulated amount of error is greatly reduced. I understand. Further, when K = 4, the average binarization error as a whole approaches 0, and when K = 8, the density of the image data has gradation values very close to 0 and 255 such as 1, 2, 253, and 254. Even in this case, the average binarization error is almost zero.
[0101]
Based on the two-tone image data 23 output from the image processing apparatus 30 shown in FIG. 1, an experiment is performed in which printing is actually performed using a printer and the influence of the “tailing” of the second problem described above is evaluated. went. As a result of this evaluation experiment, it was confirmed that the influence of the “tailing” of the second problem can be greatly reduced by keeping the absolute value of the average binarization error to 50 or less. From this, by setting the value of K in the formula (1) in the range of K = 2 to ∞, that is, the threshold value slsh is set according to the gradation value of the image data data.
When data <128, data ≦ slsh ≦ (128 + data) / 2
When data> 128, (128 + data) / 2 ≦ slsh ≦ data (6)
By setting so as to fall within the range, the absolute value of the average binarization error can be kept to 50 or less, and the second problem can be solved.
[0102]
Next, an experiment for evaluating the influence of the “dot generation delay” of the first problem was also conducted. As a result of this experiment, it was confirmed that the dot generation delay also improved as the average binarization error decreased. If K in Equation (1) is too large, an average binarization error exceeds 0 and an “overcorrection state” occurs in which the sign is reversed. However, in the subjective evaluation of the actual print result, the print enhancement effect is produced and the image quality is improved when the dot generation speed is increased to a slightly overcorrected state. In the subjective evaluation result that emphasizes the reproducibility of the data area where the data value is the largest dot generation delay such as 1, 2, 253, 254, the range of about K = 8 to 24 is very good, and K = 16 is It was optimal.
[0103]
FIG. 7 shows a binarization threshold value at which the average binarization error is always zero. The binarization threshold value was obtained as an estimated value by interpolation calculation based on FIG.
[0104]
If the optimum threshold value setting means 32 of the image processing apparatus of the embodiment is formed so as to determine the binarization threshold value from the original image data based on FIG. 7, the “tailing” of the second problem will be described. It is possible to realize the best optimum threshold setting means in which the expected value of 0 is zero. FIG. 7 also shows a characteristic diagram in the case where the value of K in Equation (1) is 2, 8, and ∞. From these characteristic curves, it can be seen that when the value of K is set to around K = 8, a suitable approximate value for making the average binarization error zero can be obtained. In addition, as described above, from the viewpoint of improving the dot generation delay of the first problem, the subjective evaluation is better in the “overcorrected state” where the average binarization error exceeds 0 and the sign is reversed. In subjective evaluation, the best result was obtained when an approximate expression of about K = 16 was used. When K = ∞, the edge of the data changing portion is considerably emphasized, but this is also sufficiently useful depending on the purpose of use of the image.
[0105]
In FIG. 7, the optimum threshold value when the original image data 200 is 0 or 255 is 128, but how is the threshold value set when the data gradation value is equal to the binarization result value? Even so, there is no big difference. Therefore, even in the optimum threshold value setting means 32 of this embodiment, when the data value is 0 or 255, the threshold value may be set in any way.
[0106]
As described above, according to the present embodiment, the multi-tone image data 200 is converted into the two-tone image data 230 that can be displayed in halftone using the error diffusion method, and used for the binarization process. By setting the binarization threshold value within the range of the mathematical formula (6) based on the gradation value of the multi-gradation image data 200, the first and second problems can be solved without causing side effects that lead to image quality degradation. It was possible to solve it fundamentally.
[0107]
In addition, according to the present embodiment, a binarized output image having desired characteristics can be obtained depending on how the constant K in Expression (1) is set.
[0108]
The correction data shown in FIGS. 6 and 7 is an example when error diffusion is performed using the error diffusion weight matrix shown in FIG. When different weight matrices are used, a slightly different result can be obtained quantitatively, but the qualitative tendency remains almost unchanged. Thus, the present invention is effective even when different error diffusion weight matrices are used.
[0109]
[Comparison between this example and conventional example]
As in the present embodiment, there is “Image processing apparatus and image processing method” disclosed in Japanese Patent Laid-Open No. 4-154370 as a method for changing the binarization threshold according to the gradation value of the original image data 200. It was. However, this method has the main purpose of suppressing noise in the character / line drawing part, and is the opposite of this example so that “the larger the original image density data, the smaller the binarization threshold value is made to correspond”. The threshold value was changed in the direction of, and there was almost no improvement effect of the first and second problems. For an example in which the average error minimum method is used for the binarization method, Japanese Patent Laid-Open No. 4-154370 may be referred to.
[0110]
FIG. 12 is a diagram illustrating an output example when the original image 100 illustrated in FIG. 3 is obtained using the image processing apparatus 30 of the present embodiment illustrated in FIG. 2. It can be seen that problems such as the delay in dot generation and the disappearance of the central portion of the straight line 130 due to the tailing from the low density region 120, which are problems in FIG.
[0111]
Thus, according to the present Example, it was confirmed that the 1st and 2nd problem can be solved ideally. Furthermore, according to the present Example, it has also confirmed that the 1st, 2nd problem could be solved without accompanying a harmful side effect.
[0112]
[Another Example of Optimal Threshold Setting Means]
In the above embodiment, the optimum threshold value setting means 32 sets the binarization threshold value based on the mathematical formula (1). The present invention is not limited to this, and the binarization threshold value may be set using other methods as necessary.
[0113]
FIG. 8 shows another embodiment of the optimum threshold value setting means 32.
[0114]
The optimum threshold value setting means 32 of this embodiment sets the threshold value as shown in the following equation based on the data data [i, j] input as the multi-tone image data 200 of the target pixel. Is formed.
[0115]
If 0 ≦ data (i, j) <128-L1, slsh (i, j) = data (i, j) + L1
If 128-L1 ≦ data (i, j) ≦ 128 + L2, slsh (i, j) = 128
If 128 + L2 <data (i, j) ≦ 255, slsh (i, j) = data (i, j) -L2 (7)
Here, L1 and L2 may be appropriate values of 0 to 64, but are optimally set to a range of 8 to 16. Note that L1 and L2 may be set to the same value. In the case of the present embodiment, when the data value is around 128, it is expressed by Equation (6).
When data <128, data ≦ slsh ≦ (128 + data) / 2
When data> 128, (128 + data) / 2 ≦ slsh ≦ data
The first and second problems to be solved by the present invention are particularly noticeable when data is 0 or a value near 255 (0 and 255 are not included). It is. Therefore, the formula (6) does not need to be satisfied in all data areas, and the formula (6) only needs to be satisfied when data is a value near 0 or 255.
[0116]
Therefore, by setting the binarization threshold as shown in the mathematical formula (7), the first and second problems can be solved, and good binarization can be performed as in the first embodiment. An image can be obtained.
[0117]
FIG. 8 shows still another embodiment of the optimum threshold value setting means 32.
[0118]
In the optimum threshold value setting means 32 of the embodiment, the binarization threshold value is set stepwise instead of continuously according to the gradation value of the original image data 200. Even in this case, the first and second problems can be solved and a good binarized image can be obtained in the same manner as in the above embodiment.
[0119]
FIG. 10 shows still another embodiment of the optimum threshold value setting means 32. The optimum threshold value setting means 32 of the embodiment is formed so that the threshold value optimization operation characterized by the present invention works only in the low density region. That is, when the threshold value of the image data 200 is on the high density region side, the binarization threshold value is fixed at 128, and is optimal when the image data 200 is at a value near 0 on the low density region side. The threshold is set so as to satisfy Equation (6).
[0120]
For example, in a printer device with a large amount of blurring of dots, the isolated white dots in the high density portion are almost crushed. Therefore, the first problem does not appear prominently in the high density portion. Therefore, only the low-concentration part where the first problem is easily noticeable is to be improved by the present invention.
[0121]
Depending on the characteristics of the image output apparatus, on the contrary, the threshold value optimization operation of the present invention may be performed only on the high density area.
[0122]
As described above, the optimum threshold value setting means 32 of the present invention may be formed so as to set the optimum threshold value only in a necessary original image density region according to the image output apparatus.
[0123]
[Specific examples of threshold setting means]
The optimum threshold value setting means 32 in each of the above-described embodiments may be formed so as to perform the calculation such as the above formula (1) each time in order to set the binarization threshold value from the original image data. Alternatively, the correspondence relationship between the gradation value of the original image data and the binarization threshold value may be stored in advance in the conversion table and may be formed so as to refer to it.
[0124]
FIG. 11 shows a specific example in which the optimum threshold value setting means 32 is configured using a ROM. When 8-bit original image data is input to the ROM address buses A0 to A7, a corresponding 8-bit binarization threshold value is output to the data buses D0 to D7.
[0125]
In each embodiment, there is an example in which a small amount of random noise is added to the binarized threshold value set by the optimum threshold value setting means 32. This is to prevent a specific regular pattern from being generated by binarization by the error diffusion method when the original image data is very orderly data drawn by a computer or the like. is there. Therefore, when the original image data is a natural image having an appropriate variation in gradation values, such a process of adding random noise is unnecessary.
[0126]
In addition, as a result of adding random noise, the threshold value may deviate from the range indicated by Equation (6), but the expected value of the threshold only needs to be within the range of Equation (6). Shall.
[0127]
The same effect can be obtained by adding noise to the original image data side instead of the threshold value.
[0128]
[Other embodiments]
The present invention is not limited to the embodiments described above, and various modifications can be made within the scope of the gist of the present invention.
[0129]
For example, in the above-described embodiment, the case where the original image data is density data such that 0 is white and 255 is black has been described as an example. However, original image data is 0 and black, and 255 is white. Needless to say, the present invention can also be applied to lightness data.
[0130]
Further, when the original image data takes a value in the range of A to B (A> B), when the original image data is binarized into a or b (a> b), the first embodiment Equation (1)
slsh (i, j) = (data (i, j) * (K-1) + (a + b) / 2) / K (1) '
And formula (2) is converted to
If dataC (i, j) ≧ slsh (i, j), result (i, j) = a
If dataC (i, j) <slsh (i, j), result (i, j) = b (2) '
It should be changed as follows. In general, A = a and B = b. However, when the output possible density of the output device is greatly different from the range of the original image data, there are cases where A and a and B and b do not match.
[0131]
In this case, the conditional expression for setting the threshold value in Expression (6) is m = (a + b) / 2,
When data <m, data ≦ slsh ≦ (m + data) / 2
When data> m, (m + data) / 2 ≦ slsh ≦ data (8)
become that way.
[0132]
In the above-described embodiment, the case where the multi-tone image data 200 is corrected using the error diffusion method has been described as an example. Is also applicable.
[0133]
FIG. 18 shows a preferred embodiment of the image processing apparatus 30 using the average error minimum method. In addition, the same code | symbol is attached | subjected to the member corresponding to the said Example shown in FIG. 2, and the description is abbreviate | omitted.
[0134]
In this embodiment, the error correction unit 34 includes a data correction unit 38, an error calculation unit 44, and an error storage unit 46.
[0135]
The error calculation unit 44 is configured to calculate a binarization error err of the target pixel based on the equation (3) and write the value to an address corresponding to the target pixel of the error storage unit 46. As a result, the binarization error of the binarized pixels is sequentially written and stored in the storage area corresponding to each pixel address of the error storage means 46.
[0136]
When the multi-tone image data data (i, j) of the target pixel P [i, j] is input to the data correction unit 38, the binarized pixel near the target pixel P [i, j] is input. The error is read from the error storage means 46. Then, the read error data is given a predetermined weight to obtain an average error, and this average error is added to the multi-tone image data data (i, j) of the target pixel, and this is added to the corrected image data data c (i , J) to the binarization means 36.
[0137]
Since the remaining configuration is the same as that of the first embodiment, the description thereof is omitted here.
[0138]
Even when such an average error minimum method is used, the same effects as those of the first embodiment can be obtained.
[Brief description of the drawings]
FIG. 1 is a schematic explanatory diagram of an image processing system to which the present invention is applied.
2 is a functional block diagram of an image processing apparatus used in the image processing system shown in FIG.
FIG. 3 is an explanatory diagram of a specific example of a diffusion weight matrix used in the present embodiment.
FIG. 4 is an explanatory diagram showing a relationship between original image data used for obtaining an average binarization error and an area for obtaining an average binarization error.
FIG. 5 is an explanatory diagram showing a relationship between a gradation value of original image data and an average binarization error.
FIG. 6 is an explanatory diagram showing how an average binarization error occurs in the first embodiment of the present invention.
FIG. 7 is an explanatory diagram of a binarization threshold value at which the average binarization error is always zero.
FIG. 8 is an explanatory diagram of another embodiment of threshold value setting means used in the present invention.
FIG. 9 is an explanatory diagram of another embodiment of threshold value setting means used in the present invention.
FIG. 10 is an explanatory diagram of another embodiment of threshold value setting means used in the present invention.
FIG. 11 is an explanatory diagram of an example in which threshold setting means used in the present invention is configured by hardware.
FIG. 12 is an explanatory diagram of a binarization result obtained using the image processing apparatus of the present invention.
13 is an explanatory diagram of an original image used for obtaining the binarized images shown in FIGS. 12 and 14. FIG.
FIG. 14 is an explanatory diagram of a binarization result obtained by a conventional error diffusion method.
FIG. 15 is an overall schematic explanatory diagram of an image processing system incorporating the image processing apparatus of the present invention.
16 is an explanatory diagram of another embodiment of the system of FIG.
FIG. 17 is an explanatory diagram of another embodiment of the system of FIG.
FIG. 18 is a block diagram of an embodiment of an image processing apparatus using a minimum average error method for correcting multi-tone image data.
[Explanation of symbols]
30 Image processing device
32 threshold setting means
34 Error correction means
36 Binarization means
38 Data correction means
40 Error diffusion means
42 Diffusion error storage means
200 Multi-tone image data

Claims (5)

多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理装置において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正手段と、
前記注目画素の多階調画像データの階調値に応じて2値化のためのしきい値に異なる値を設定し得るしきい値設定手段と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化手段と、
を有し、前記注目画素の多階調画像データの階調値をdata、前記第1階調値および第2階調値の中間値をm、前記しきい値をslshとすると、
前記しきい値設定手段は、
dataが第1階調値近辺の値の場合には、data≦slsh≦(m+data)/2
dataが第2階調値近辺の値の場合には、(m+data)/2≦slsh≦data
のいずれかを満たすようにしきい値slshを設定し、
前記2値化手段は、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う画像処理装置。
Two-gradation image data composed of a first gradation value and a second gradation value (first gradation value <second gradation value) by using the error diffusion method or the average error minimum method. In an image processing apparatus that performs binarization conversion to
Error correction means for correcting multi-tone image data of a target pixel by adding an error diffused from surrounding binarized pixels, and outputting the corrected pixel data;
Threshold setting means capable of setting different values for the threshold for binarization according to the gradation value of the multi-tone image data of the target pixel;
Binarization means for binarizing and converting the correction pixel data into the two-tone image data based on the set threshold value;
And the gradation value of the multi-tone image data of the target pixel is data, the intermediate value of the first gradation value and the second gradation value is m, and the threshold value is slsh,
The threshold setting means includes
When data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
(m + data) / 2 ≦ slsh ≦ data when data is a value near the second gradation value
Set the threshold slsh to meet any of the
The binarization means includes
An image processing apparatus that performs binarization processing after adding random noise to a set threshold value or the corrected pixel data.
前記しきい値設定手段は、
slsh=(data*(K−1)+m)/K(ただし、Kは2以上の整数で表される定数)
を満たすようにしきい値slshを設定する請求項記載の画像処理装置。
The threshold setting means includes
slsh = (data * (K−1) + m) / K (where K is a constant represented by an integer of 2 or more)
The image processing apparatus according to claim 1, wherein setting the threshold slsh to meet.
前記しきい値設定手段は、
前記階調値dataの値に応じて、前記しきい値slshを段階的に設定する請求項記載の画像処理装置。
The threshold setting means includes
Depending on the value of the gradation values data, an image processing apparatus according to claim 1, wherein setting the threshold slsh step by step.
前記しきい値設定手段は、
data<m−L1の場合には、slsh=data+L1
m−L1<data<m+L2の場合には、s lsh=m
m+L2<dataの場合には、slsh=data−L2
(ただし、L1,L2は0〜mの間の整数で表される定数)
を満たすようにしきい値slshを設定する請求項記載の画像処理装置。
The threshold setting means includes
If data <m−L1, slsh = data + L1
If m−L1 <data <m + L2, then s lsh = m
If m + L2 <data, slsh = data-L2
(However, L1 and L2 are constants represented by integers between 0 and m)
The image processing apparatus according to claim 1, wherein setting the threshold slsh to meet.
多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理方法において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正工程と、
2値化のためのしきい値を設定するしきい値設定工程と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化工程と、
を含み、前記注目画素の多階調画像データの階調値をdata、前記第1階調値および第2階調値の中間値をm、前記しきい値をslshとすると、
前記しきい値設定工程では、
dataが第1階調値近辺の値、または第2階調値近辺の値であるかを判別し、
dataが第1階調値近辺の値の場合には、data≦slsh≦(m+data)/2
dat aが第2階調値近辺の値の場合には、(m+data)/2≦slsh≦data
を満たすようにしきい値slshを設定し、
前記2値化工程では、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う画像処理方法。
Two-gradation image data composed of a first gradation value and a second gradation value (first gradation value <second gradation value) by using the error diffusion method or the average error minimum method. In an image processing method for binarizing and converting to
An error correction step of correcting the multi-tone image data of the target pixel by adding an error diffused from the surrounding binarized pixels, and outputting the corrected pixel data;
A threshold value setting step for setting a threshold value for binarization;
A binarization step of binarizing and converting the correction pixel data into the two-tone image data based on the set threshold value;
And the gradation value of the multi-tone image data of the target pixel is data, the intermediate value of the first gradation value and the second gradation value is m, and the threshold is slsh,
In the threshold value setting step,
Determine whether data is a value near the first gradation value or a value near the second gradation value,
When data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
When dat a is a value near the second gradation value, (m + data) / 2 ≦ slsh ≦ data
Set the threshold slsh to meet
In the binarization step,
An image processing method for performing binarization processing after adding random noise to a set threshold value or the corrected pixel data.
JP2001357296A 1993-06-24 2001-11-22 Image processing apparatus and method Expired - Lifetime JP3646694B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001357296A JP3646694B2 (en) 1993-06-24 2001-11-22 Image processing apparatus and method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP5-153566 1993-06-24
JP15356693 1993-06-24
JP2001357296A JP3646694B2 (en) 1993-06-24 2001-11-22 Image processing apparatus and method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP35289893A Division JP3360391B2 (en) 1993-06-24 1993-12-28 Image processing apparatus and image processing method

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2004116716A Division JP2004304814A (en) 1993-06-24 2004-04-12 Image processing unit and method

Publications (2)

Publication Number Publication Date
JP2002218241A JP2002218241A (en) 2002-08-02
JP3646694B2 true JP3646694B2 (en) 2005-05-11

Family

ID=26482149

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001357296A Expired - Lifetime JP3646694B2 (en) 1993-06-24 2001-11-22 Image processing apparatus and method

Country Status (1)

Country Link
JP (1) JP3646694B2 (en)

Also Published As

Publication number Publication date
JP2002218241A (en) 2002-08-02

Similar Documents

Publication Publication Date Title
JP3360391B2 (en) Image processing apparatus and image processing method
US5325448A (en) Image treatment method and apparatus with error dispersion and controllable quantization
JP3188330B2 (en) Preliminary compensation method for binary image bitmap
JP3097785B2 (en) Image processing device
EP0356225B1 (en) Image processing apparatus
JP4100782B2 (en) Error diffusion value processing method
JP3444094B2 (en) Image processing method and apparatus
EP0673000A1 (en) Pixel correction and smoothing method
US5642204A (en) Error diffusion method
US7620255B2 (en) Image processor and image processing program for binary processing
US5208684A (en) Half-tone image processing system
US5289294A (en) Image processing apparatus
JPH11187264A (en) Method and device for processing image
JPH0530361A (en) Method and device for reproducing intermediate tone picture
JPH07283946A (en) Method for correcting and smoothing picture element
JP3554077B2 (en) Image processing device
JP3685148B2 (en) Image processing apparatus and method
JP3769922B2 (en) Image processing device
JP3646694B2 (en) Image processing apparatus and method
JP2004304814A (en) Image processing unit and method
JPH08307669A (en) Image processing unit and its method
JP4182960B2 (en) Image processing apparatus and image processing program for binarization processing
JP4324532B2 (en) Image processing apparatus and storage medium
JP3679522B2 (en) Image processing method and apparatus
JP3059457B2 (en) Image processing device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040127

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040210

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040412

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20041012

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041210

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20041222

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050131

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090218

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090218

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100218

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110218

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110218

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120218

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130218

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130218

Year of fee payment: 8

EXPY Cancellation because of completion of term