JP4035280B2 - Image processing apparatus and processing method thereof - Google Patents

Image processing apparatus and processing method thereof Download PDF

Info

Publication number
JP4035280B2
JP4035280B2 JP2000234645A JP2000234645A JP4035280B2 JP 4035280 B2 JP4035280 B2 JP 4035280B2 JP 2000234645 A JP2000234645 A JP 2000234645A JP 2000234645 A JP2000234645 A JP 2000234645A JP 4035280 B2 JP4035280 B2 JP 4035280B2
Authority
JP
Japan
Prior art keywords
error
pixel
value
surrounding pixels
diffusion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2000234645A
Other languages
Japanese (ja)
Other versions
JP2002051212A (en
JP2002051212A5 (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.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2000234645A priority Critical patent/JP4035280B2/en
Publication of JP2002051212A publication Critical patent/JP2002051212A/en
Publication of JP2002051212A5 publication Critical patent/JP2002051212A5/ja
Application granted granted Critical
Publication of JP4035280B2 publication Critical patent/JP4035280B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、入力画像の処理対象画素を量子化して出力する画像処理装置及びその処理方法に関するものである。
【0002】
【従来の技術】
従来より、プリンタ、複写機、ファクシミリ等の画像処理装置において、階調再現性の高い疑似中間調処理方式として、誤差拡散法が広く用いられている。
【0003】
誤差拡散法は、1975年にFloyd及びSteinbergにより「An Adaptive Algorithm for Spatial Gray Scale」SID 75 Digestという論文に開示されている方法であり、処理対象画素の多値画像データを2値化し、その2値化レベルと2値化前の多値画像データとの誤差に所定の重み付けを行い、処理対象画素の近傍の各画素データに加算するものである。
【0004】
【発明が解決しようとする課題】
しかしながら、上記従来例では、誤差拡散法を用いて擬似中間調処理を行った場合、図1に示すように、低濃度の領域の上端付近等でドットの全く打たれない部分が発生し、それが画像の品位を著しく低下させるという欠点があった。
【0005】
この画像濃度の低い部分で全くドットが打たれない原因としては、以下のことが考えられる。
【0006】
誤差拡散法を用いて画像濃度の低い部分を2値化した場合、2値化時に生じる正の誤差は負の誤差の絶対値よりかなり小さくなる。例えば、入力画像が0から255の整数値で表現されていたとき、画素値1の領域を2値化した場合、出力画素値が0となるドットでは誤差の値が1(1−0)となるのに対し、出力画素値が255となるドットでは誤差の値が−254(1−255)となる。
【0007】
そのため、処理対象画素値に累積誤差を加算した値が、2値化の閾値を越えるような値になるまでに必要な画素数が多くなり、全くドットの打たれない部分が発生する。
【0008】
本発明は、上記課題を解決するためになされたもので、入力画素値が小さい領域でも、ドットが全く打たれない部分が発生することを防止することを目的とする。
【0009】
【課題を解決するための手段】
上記目的を達成するために、本発明は、入力画像の処理対象画素を量子化して出力する画像処理装置において、入力画像の処理対象画素を所定の閾値で量子化する際に発生する量子化誤差の正負の値に応じて、前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散するための拡散係数を設定する設定手段と、前記設定された拡散係数に従って前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散する拡散手段とを有し、前記設定手段は、前記量子化誤差が正の値のときは拡散する未処理の周囲画素の範囲を負の値のときに拡散する未処理の周囲画素の範囲に対して狭くした未処理の周囲画素に拡散するための拡散係数を設定することを特徴とする。
【0010】
また、本発明は、入力画像の処理対象画素を量子化して出力する画像処理装置の処理方法であって、入力画像の処理対象画素を所定の閾値で量子化する際に発生する量子化誤差の正負の値に応じて、前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散するための拡散係数を設定する設定工程と、前記設定された拡散係数に従って前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散する拡散工程とを有し、前記設定工程は、前記量子化誤差が正の値のときは拡散する未処理の周囲画素の範囲を負の値のときに拡散する未処理の周囲画素の範囲に対して狭くした未処理の周囲画素に拡散するための拡散係数を設定することを特徴とする。
【0011】
また、上記目的を達成するため、本発明は、入力画像の処理対象画素を量子化して出力する画像処理装置の処理方法であって、入力画像の処理対象画素を所定の閾値で量子化する際に発生する量子化誤差の値に応じて、前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散するための拡散係数を設定する設定工程と、前記設定された拡散係数に従って前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散する拡散工程とを有することを特徴とする。
【0012】
また、上記目的を達成するため、本発明は、入力画像の処理対象画素を量子化して出力する画像処理装置の処理方法であって、入力画像の処理対象画素の周囲画素の値に応じて量子化の閾値を決定する閾値決定工程と、決定された閾値を用いて前記入力画像の処理対象画素を量子化する量子化工程と、前記量子化の際に発生する量子化誤差を前記処理対象画素の未処理の周囲画素に拡散する拡散工程とを有することを特徴とする。
【0013】
【発明の実施の形態】
以下、図面を参照しながら本発明に係る実施の形態を詳細に説明する。
【0014】
[第1の実施形態]
図2は、第1の実施形態による画像処理装置の構成を示すブロック図である。同図において、201は入力端子であり、画素データを入力する。202は累積誤差加算部であり、入力端子201からの画素データに後述する誤差メモリからの誤差値を加算する。203は固定閾値設定端子であり、量子(2値)化の閾値を設定する。204は量子(2値)化部であり、固定閾値設定端子203により設定された閾値に基づき累積誤差加算部202からの画素データを量子(2値)化する。
【0015】
205は出力端子であり、誤差拡散処理された画素データを出力する。206は誤差演算部であり、累積誤差加算部202からの画素データと量子(2値)化された画素値との差分、即ち量子化誤差を演算する。207は誤差拡散部であり、後述する拡散係数に従って誤差を拡散する。208は誤差メモリであり、誤差拡散部207から拡散された誤差を累積して格納する。209は拡散係数切替部であり、誤差の拡散係数を切り替える。
【0016】
次に、図2に示す画像処理装置における誤差拡散処理の動作について、図3に示すフローチャートに従って以下に説明する。
【0017】
まず、図示しない画像走査部により画像が順次走査され、各画素データが入力端子201より入力される(ステップS301)。ここで、画像の走査は、画像領域の左上画素から開始され、方向に一画素毎に進み、右端に達すると一画素下の左端画素から順に右方向に進み、右下画素まで行われる。次に、累積誤差加算部202において、入力画素データに誤差メモリ208の画素位置に対応する値が加算される(ステップS302)。
【0018】
図4は、図2に示す誤差メモリ208の詳細を示す図である。この誤差メモリ208は1個の記憶領域E0と画像の横画素数Wと同数の記憶領域E(W)とがあり、詳細は後述する方法で量子化誤差が格納される。尚、誤差メモリ208は処理開始前にすべて初期値0で初期化されているものとする。
【0019】
上述の累積誤差加算部202では、入力画素データに横画素位置xに対応した誤差メモリE(x)の値が加えられる。即ち、入力画素データをI、誤差加算後の画素データをI’とすれば、次式のようになる。
【0020】
I’=I+E(x)
次に、量子化部204において、誤差加算後の画素データI’と固定閾値設定端子203により設定された閾値とを比較し、出力画素値を決定する(ステップS303)。ここで、閾値は通常、最大入力画素値と最小入力画素値の中央値に設定される。即ち、入力画素値が0から255の範囲の整数値とすれば、閾値Tは127乃至128に設定される。出力画素値Oは次式により決定される。
【0021】
O=0 (I’<T)
O=255(I’≧T)
次に、誤差演算部206において、誤差加算後の画素データI’と出力画素値との差分、即ち、量子化誤差Eを計算する(ステップS304)。
【0022】
E=I’−O
次に、拡散係数切替部209が、誤差Eの値に従って(ステップS305)、誤差拡散部207に対して誤差拡散係数を設定する。即ち、誤差値Eがゼロ又は正数の場合は、図5に示す拡散係数を設定し(ステップS306)、誤差値Eが負数の場合は、図6に示す拡散係数を設定する(ステップS307)。
【0023】
図5に示す(A)は、処理対象画素位置xが右端の位置(x<W)でないときの誤差拡散係数であり、同(B)は右端の位置(x=W)のときの誤差拡散係数であり、図中の501は処理対象画素、502,503は誤差が拡散される周囲の位置とその誤差拡散係数を表している。
【0024】
図6に示す(A)は、処理対象画素位置xが左端と右端の間(1<x<W)のときの誤差拡散係数であり、同(B)は左端の位置(x=1)のときの誤差拡散係数、そして、同(C)は右端の位置(x=W)のときの誤差拡散係数である。図中の601は処理対象画素、602〜610は誤差が拡散される周囲の位置とその誤差拡散係数を表している。
【0025】
次に、誤差拡散部207において、設定された拡散係数に従って誤差Eの拡散処理が行われる。ここで、誤差値Eがゼロ又は正数の場合、図5に示す誤差拡散係数により、処理対象画素位置xに応じて以下のように誤差拡散処理が行われる(ステップS308)。
【0026】
E(x+1)←E(x+1)+E×1(E≧0かつx<W)
E(x)←E0 (E≧0かつx<W)
E(x)←E0+E×1 (E≧0かつx=W)
E0←0 (E≧0)
一方、誤差値Eが負数の場合、図6に示す誤差拡散係数により、処理対象画素位置xに応じて以下のように誤差拡散処理が行われる(ステップS309)。
【0027】
E(x+1)←E(x+1)+E×7/16(E<0かつx<W)
E(x−1)←E(x−1)+E×3/16(E<0かつx>1)
E(x)←E0+E×5/16 (E<0かつ1<x<W)
E(x)←E0+E×8/16 (E<0かつx=1)
E(x)←E0+E×13/16 (E<0かつx=W)
E0←E×1/16 (E<0かつx<W)
E0←0 (E<0かつx=W)
上述の処理により、1画素分の誤差拡散処理が完了する。
【0028】
第1の実施形態によれば、正の誤差の拡散範囲を負の誤差の拡散範囲に対して狭くすることで、入力画素値が小さい時の正の誤差の蓄積を加速し、誤差加算後の入力画素データが閾値を越えるまでの距離を縮めることができる。その結果、入力画素値が小さい領域でもドットが全く打たれない領域が発生することを防ぐことができる。
【0029】
[第2の実施形態]
次に、図面を参照しながら本発明に係る第2の実施形態を詳細に説明する。
【0030】
第2の実施形態では、入力画像の処理対象画素の周囲画素の値に応じて量子化の閾値を決定し、量子化した際に発生する量子化誤差を拡散するものである。
【0031】
図7は、第2の実施形態による画像処理装置の構成を示すブロック図である。同図において、701は画素当たり8ビットの階調情報を持つ入力画像、702は2値化の閾値を決定するためのフィルタ、703は入力画像701の画素値と累積誤差の和を求める加算器、704は加算器703の出力と閾値とを比較し、出力画素値を決定する量子化器、705は加算器703の出力と出力画素値との差を求める誤差計算装置、706は累積誤差を記憶する誤差バッファ、707は画素当たり1ビットの階調情報を持つ出力画像である。
【0032】
次に、図7に示す画像処理装置における誤差拡散処理の動作について、図8に示すフローチャートに従って以下に説明する。
【0033】
まず、フィルタ702において、入力画像701の処理対象画素の周囲の画素値から閾値を決定する(ステップS801)。閾値決定の方法としては、例えば処理対象画素の周囲の8画素の平均値とする。即ち、位置(x,y)の画素値をG(x,y)とすれば、処理対象画素位置(I,J)に対する閾値THは次式で与えられる。
【0034】

Figure 0004035280
次に、加算器703により入力画像701の画素値Gと誤差バッファ706の累積誤差値Eとを加算する(ステップS802)。次に、量子化部704により、フィルタ702で算出された閾値と累積誤差値Eが加算された画素値とを比較し、出力画素値を決定する(ステップS803)。ここで、出力画素値Hは次式で与えられる。
【0035】
H=255(G+E>TH)
H=0 (G+E≦TH)
次に、誤差計算装置705により、上述の累積誤差値Eが加算された画素値と出力画素値Hとから誤差値Errorを求め、拡散係数に従って誤差バッファ706に誤差を保存する(ステップS804)。ここで、誤差拡散処理は次式によって表される。
【0036】
Error=(G+E)−H
E(I+1,J)←E(I+1,J)+Error/2
E(I,J+1)←E(I,J+1)+Error/2
以上の処理をすべての画素について行うことにより、擬似中間調画像が得られる。
【0037】
このように、処理対象画素の周囲の平均値を閾値として出力画素値を決定するため、低濃度の領域において閾値が小さくなり、ドット生成の遅延が生じることがない。
【0038】
尚、第2の実施形態では、処理対象画素の周囲8画素の平均値を閾値としたが、これを処理対象画素周囲の重み付けした平均値としても良い。重み付けの係数としては、例えば図9に示すような値を用いることができる。
【0039】
何れも、中心が処理対象画素位置に対応し、各マス目に記入した値が重み付け係数である。図9に示す901のフィルタでは処理対象画素を含む周囲9画素の平均値が閾値となる。また、902のフィルタでは中心からの距離に応じて重み付けした平均値が閾値となる。そして、903のフィルタでは既に処理済の画素値のみから閾値を求めることができる。
【0040】
また、誤差の拡散範囲及び係数も第2の実施形態に限定されるものではなく、Floyd及びSteinbergにより示された係数等、他のものを用いることもできる。
【0041】
以上説明したように、第2の実施形態によれば、処理対象画素の周囲の画素値から閾値を決定することにより低濃度の領域においてドット形成の遅延を生じることなく中間調処理を行うことが可能である。
【0042】
尚、本発明は複数の機器(例えば、ホストコンピュータ,インタフェイス機器,リーダ,プリンタなど)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機,ファクシミリ装置など)に適用してもよい。
【0043】
また、本発明の目的は前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システム或いは装置に供給し、そのシステム或いは装置のコンピュータ(CPU若しくはMPU)が記憶媒体に格納されたプログラムコードを読出し実行することによっても、達成されることは言うまでもない。
【0044】
この場合、記憶媒体から読出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。
【0045】
プログラムコードを供給するための記憶媒体としては、例えばフロッピーディスク,ハードディスク,光ディスク,光磁気ディスク,CD−ROM,CD−R,磁気テープ,不揮発性のメモリカード,ROMなどを用いることができる。
【0046】
また、コンピュータが読出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているOS(オペレーティングシステム)などが実際の処理の一部又は全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0047】
更に、記憶媒体から読出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部又は全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0048】
【発明の効果】
以上説明したように、本発明によれば、入力画素値が小さいときの正の誤差の蓄積を加速し、誤差加算後の入力画素値が閾値を越えるまでの距離を縮めることができ、その結果、入力画素値が小さい領域でも、ドットが全く打たれない部分が発生することを防止することができる
【図面の簡単な説明】
【図1】従来例による処理画像の一例を示す図である。
【図2】第1の実施形態による画像処理装置の構成を示すブロック図である。
【図3】第1の実施形態による誤差拡散処理を示すフローチャートである。
【図4】図2に示す誤差メモリ208の詳細を示す図である。
【図5】正の誤差に対する拡散係数の一例を示す図である。
【図6】負の誤差に対する拡散係数の一例を示す図である。
【図7】第2の実施形態による画像処理装置の構成を示すブロック図である。
【図8】第2の実施形態による誤差拡散処理を示すフローチャートである。
【図9】閾値を求めるためのフィルタの例を示す図である。
【符号の説明】
201 画素データ入力端子
202 累積誤差加算部
203 固定閾値設定端子
204 量子化部
205 画像データ出力端子
206 誤差演算部
207 誤差拡散部
208 誤差メモリ
209 拡散係数変更部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus that quantizes and outputs processing target pixels of an input image, and a processing method thereof.
[0002]
[Prior art]
Conventionally, an error diffusion method has been widely used as a pseudo halftone processing method with high gradation reproducibility in image processing apparatuses such as printers, copying machines, and facsimiles.
[0003]
The error diffusion method is a method disclosed by Floyd and Steinberg in a paper called “An Adaptive Algorithm for Spatial Gray Scale” SID 75 Digest in 1975, and binarizes multi-valued image data of a pixel to be processed. A predetermined weight is applied to the error between the binarization level and the multi-valued image data before binarization, and is added to each pixel data in the vicinity of the pixel to be processed.
[0004]
[Problems to be solved by the invention]
However, in the above conventional example, when pseudo halftone processing is performed using the error diffusion method, as shown in FIG. 1, a portion where dots are not hit at all occurs in the vicinity of the upper end of the low density region. However, there is a drawback that the image quality is remarkably lowered.
[0005]
The following are conceivable reasons why dots are not shot at all at a low image density.
[0006]
When binarizing a low image density portion using the error diffusion method, the positive error generated during binarization is considerably smaller than the absolute value of the negative error. For example, when the input image is represented by an integer value from 0 to 255 and the region of pixel value 1 is binarized, the error value is 1 (1-0) for a dot with an output pixel value of 0. On the other hand, the error value is −254 (1-255) for a dot whose output pixel value is 255.
[0007]
For this reason, the number of pixels required until the value obtained by adding the accumulated error to the pixel value to be processed exceeds the binarization threshold value increases, and a portion where no dots are formed occurs.
[0008]
The present invention has been made to solve the above-described problem, and an object of the present invention is to prevent the occurrence of a portion where dots are not hit at all even in a region where an input pixel value is small.
[0009]
[Means for Solving the Problems]
In order to achieve the above object, the present invention provides a quantization error that occurs when a pixel to be processed in an input image is quantized with a predetermined threshold in an image processing apparatus that quantizes and outputs the pixel to be processed in an input image. Setting means for setting a diffusion coefficient for diffusing the quantization error to unprocessed surrounding pixels of the pixel to be processed according to the positive and negative values of the quantization error, and the quantization error according to the set diffusion coefficient and a diffusing means for diffusing the unprocessed surrounding pixels of the target pixel, the setting means, the quantization error when the positive value, a negative value of the range of the peripheral pixels unprocessed diffusing A diffusion coefficient for diffusing to unprocessed surrounding pixels that is narrower than a range of unprocessed surrounding pixels that is sometimes diffused is set.
[0010]
In addition, the present invention is a processing method of an image processing apparatus that quantizes and outputs a processing target pixel of an input image, and a quantization error that occurs when the processing target pixel of the input image is quantized with a predetermined threshold. A setting step of setting a diffusion coefficient for diffusing the quantization error to unprocessed surrounding pixels of the pixel to be processed according to a positive / negative value, and processing the quantization error according to the set diffusion coefficient A diffusion step of diffusing to unprocessed surrounding pixels of the target pixel, and when the quantization error is a positive value, the setting step is when a range of unprocessed surrounding pixels to be diffused is a negative value A diffusion coefficient for diffusing to unprocessed surrounding pixels narrowed with respect to a range of unprocessed surrounding pixels to be diffused is set.
[0011]
In order to achieve the above object, the present invention provides a processing method for an image processing apparatus for quantizing and outputting a processing target pixel of an input image, wherein the processing target pixel of the input image is quantized with a predetermined threshold. A setting step for setting a diffusion coefficient for diffusing the quantization error to unprocessed surrounding pixels of the pixel to be processed according to a value of the quantization error generated in the pixel, and the quantum according to the set diffusion coefficient And a diffusion step of diffusing the conversion error to unprocessed surrounding pixels of the pixel to be processed.
[0012]
In order to achieve the above object, the present invention provides a processing method for an image processing apparatus that quantizes and outputs a processing target pixel of an input image, and performs quantum processing according to the values of surrounding pixels of the processing target pixel of the input image. A threshold value determining step for determining a threshold value for quantization, a quantization step for quantizing the pixel to be processed of the input image using the determined threshold value, and a quantization error generated during the quantization in the pixel to be processed And a diffusion step of diffusing to unprocessed surrounding pixels.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments according to the present invention will be described in detail with reference to the drawings.
[0014]
[First Embodiment]
FIG. 2 is a block diagram illustrating a configuration of the image processing apparatus according to the first embodiment. In the figure, 201 is an input terminal for inputting pixel data. An accumulated error adding unit 202 adds an error value from an error memory described later to pixel data from the input terminal 201. Reference numeral 203 denotes a fixed threshold value setting terminal for setting a threshold value for quantization (binary). A quantum (binarization) unit 204 quantizes (binarizes) the pixel data from the cumulative error addition unit 202 based on the threshold set by the fixed threshold setting terminal 203.
[0015]
Reference numeral 205 denotes an output terminal which outputs pixel data subjected to error diffusion processing. An error calculation unit 206 calculates a difference between the pixel data from the cumulative error addition unit 202 and the quantized pixel value, that is, a quantization error. An error diffusion unit 207 diffuses an error according to a diffusion coefficient described later. An error memory 208 accumulates and stores the error diffused from the error diffusion unit 207. A diffusion coefficient switching unit 209 switches the error diffusion coefficient.
[0016]
Next, the operation of error diffusion processing in the image processing apparatus shown in FIG. 2 will be described with reference to the flowchart shown in FIG.
[0017]
First, an image is sequentially scanned by an image scanning unit (not shown), and each pixel data is input from the input terminal 201 (step S301). Here, the scanning of the image starts from the upper left pixel of the image area, proceeds in the direction for each pixel, and when reaching the right end, proceeds in the right direction in order from the left end pixel one pixel below and continues to the lower right pixel. Next, in the cumulative error adding unit 202, a value corresponding to the pixel position in the error memory 208 is added to the input pixel data (step S302).
[0018]
FIG. 4 is a diagram showing details of the error memory 208 shown in FIG. This error memory 208 has one storage area E0 and the same number of storage areas E (W) as the number of horizontal pixels W of the image, and the quantization error is stored by a method described later in detail. It is assumed that the error memory 208 has been initialized with an initial value of 0 before the start of processing.
[0019]
In the cumulative error adding unit 202 described above, the value of the error memory E (x) corresponding to the horizontal pixel position x is added to the input pixel data. In other words, if the input pixel data is I and the pixel data after error addition is I ′, the following equation is obtained.
[0020]
I ′ = I + E (x)
Next, the quantization unit 204 compares the pixel data I ′ after the error addition and the threshold set by the fixed threshold setting terminal 203 to determine an output pixel value (step S303). Here, the threshold value is usually set to the median value of the maximum input pixel value and the minimum input pixel value. That is, if the input pixel value is an integer value in the range of 0 to 255, the threshold T is set to 127 to 128. The output pixel value O is determined by the following equation.
[0021]
O = 0 (I '<T)
O = 255 (I ′ ≧ T)
Next, the error calculation unit 206 calculates the difference between the pixel data I ′ after the error addition and the output pixel value, that is, the quantization error E (step S304).
[0022]
E = I'-O
Next, the diffusion coefficient switching unit 209 sets an error diffusion coefficient for the error diffusion unit 207 according to the value of the error E (step S305). That is, when the error value E is zero or a positive number, the diffusion coefficient shown in FIG. 5 is set (step S306), and when the error value E is a negative number, the diffusion coefficient shown in FIG. 6 is set (step S307). .
[0023]
5A shows the error diffusion coefficient when the processing target pixel position x is not the right end position (x <W), and FIG. 5B shows the error diffusion coefficient when the processing target pixel position x is not the right end position (x = W). In the figure, reference numeral 501 represents a pixel to be processed, and 502 and 503 represent surrounding positions where errors are diffused and their error diffusion coefficients.
[0024]
6A shows the error diffusion coefficient when the processing target pixel position x is between the left end and the right end (1 <x <W), and FIG. 6B shows the position of the left end (x = 1). (C) is the error diffusion coefficient at the right end position (x = W). In the figure, reference numeral 601 denotes a pixel to be processed, and reference numerals 602 to 610 denote surrounding positions where errors are diffused and their error diffusion coefficients.
[0025]
Next, the error diffusion unit 207 performs error E diffusion processing according to the set diffusion coefficient. If the error value E is zero or a positive number, error diffusion processing is performed as follows according to the processing target pixel position x using the error diffusion coefficient shown in FIG. 5 (step S308).
[0026]
E (x + 1) ← E (x + 1) + E × 1 (E ≧ 0 and x <W)
E (x) ← E0 (E ≧ 0 and x <W)
E (x) ← E0 + E × 1 (E ≧ 0 and x = W)
E0 ← 0 (E ≧ 0)
On the other hand, when the error value E is a negative number, the error diffusion processing is performed as follows according to the processing target pixel position x using the error diffusion coefficient shown in FIG. 6 (step S309).
[0027]
E (x + 1) ← E (x + 1) + E × 7/16 (E <0 and x <W)
E (x-1) ← E (x-1) + E × 3/16 (E <0 and x> 1)
E (x) ← E0 + E × 5/16 (E <0 and 1 <x <W)
E (x) ← E0 + E × 8/16 (E <0 and x = 1)
E (x) ← E0 + E × 13/16 (E <0 and x = W)
E0 ← E × 1/16 (E <0 and x <W)
E0 ← 0 (E <0 and x = W)
With the above-described processing, the error diffusion processing for one pixel is completed.
[0028]
According to the first embodiment, the positive error diffusion range is made narrower than the negative error diffusion range to accelerate the accumulation of positive errors when the input pixel value is small. The distance until the input pixel data exceeds the threshold can be reduced. As a result, it is possible to prevent the occurrence of a region where dots are not hit at all even in a region where the input pixel value is small.
[0029]
[Second Embodiment]
Next, a second embodiment according to the present invention will be described in detail with reference to the drawings.
[0030]
In the second embodiment, the quantization threshold is determined according to the values of the surrounding pixels of the processing target pixel of the input image, and the quantization error generated when the quantization is performed is diffused.
[0031]
FIG. 7 is a block diagram illustrating a configuration of an image processing apparatus according to the second embodiment. In the figure, 701 is an input image having 8-bit gradation information per pixel, 702 is a filter for determining a threshold value for binarization, and 703 is an adder for calculating the sum of the pixel value of the input image 701 and the accumulated error. , 704 is a quantizer that compares the output of the adder 703 with a threshold value and determines an output pixel value, 705 is an error calculation device that obtains a difference between the output of the adder 703 and the output pixel value, and 706 is an accumulated error. An error buffer 707 to be stored is an output image having gradation information of 1 bit per pixel.
[0032]
Next, the operation of error diffusion processing in the image processing apparatus shown in FIG. 7 will be described with reference to the flowchart shown in FIG.
[0033]
First, in the filter 702, a threshold value is determined from pixel values around the processing target pixel of the input image 701 (step S801). As a threshold value determination method, for example, an average value of eight pixels around the processing target pixel is used. That is, if the pixel value at the position (x, y) is G (x, y), the threshold value TH for the processing target pixel position (I, J) is given by the following equation.
[0034]
Figure 0004035280
Next, the adder 703 adds the pixel value G of the input image 701 and the accumulated error value E of the error buffer 706 (step S802). Next, the quantization unit 704 compares the threshold value calculated by the filter 702 with the pixel value to which the accumulated error value E is added, and determines the output pixel value (step S803). Here, the output pixel value H is given by the following equation.
[0035]
H = 255 (G + E> TH)
H = 0 (G + E ≦ TH)
Next, the error calculator 705 obtains an error value Error from the pixel value to which the cumulative error value E is added and the output pixel value H, and stores the error in the error buffer 706 according to the diffusion coefficient (step S804). Here, the error diffusion process is expressed by the following equation.
[0036]
Error = (G + E) −H
E (I + 1, J) ← E (I + 1, J) + Error / 2
E (I, J + 1) ← E (I, J + 1) + Error / 2
A pseudo halftone image is obtained by performing the above processing for all the pixels.
[0037]
As described above, since the output pixel value is determined using the average value around the processing target pixel as a threshold value, the threshold value becomes small in a low density region, and there is no delay in dot generation.
[0038]
In the second embodiment, the average value of eight pixels around the processing target pixel is used as the threshold value, but this may be a weighted average value around the processing target pixel. As the weighting coefficient, for example, a value as shown in FIG. 9 can be used.
[0039]
In any case, the center corresponds to the pixel position to be processed, and the value entered in each square is the weighting coefficient. In the filter 901 shown in FIG. 9, an average value of nine surrounding pixels including the pixel to be processed is a threshold value. In the filter 902, an average value weighted according to the distance from the center is a threshold value. In the filter 903, the threshold value can be obtained only from the already processed pixel values.
[0040]
Also, the error diffusion range and coefficient are not limited to those of the second embodiment, and other ones such as the coefficients shown by Floyd and Steinberg can be used.
[0041]
As described above, according to the second embodiment, halftone processing can be performed without causing dot formation delay in a low density region by determining a threshold value from pixel values around the processing target pixel. Is possible.
[0042]
Even if the present invention is applied to a system composed of a plurality of devices (for example, a host computer, interface device, reader, printer, etc.), a device (for example, a copier, a facsimile device, etc.) composed of a single device. You may apply to.
[0043]
Another object of the present invention is to supply a storage medium storing software program codes for realizing the functions of the above-described embodiments to a system or apparatus, and store the computer (CPU or MPU) of the system or apparatus in the storage medium. Needless to say, this can also be achieved by reading and executing the programmed program code.
[0044]
In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the program code constitutes the present invention.
[0045]
As a storage medium for supplying the program code, for example, a floppy disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.
[0046]
Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an OS (operating system) operating on the computer based on the instruction of the program code. It goes without saying that a case where the function of the above-described embodiment is realized by performing part or all of the actual processing and the processing is included.
[0047]
Further, after the program code read from the storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. It goes without saying that the CPU or the like provided in the board or the function expansion unit performs part or all of the actual processing and the functions of the above-described embodiments are realized by the processing.
[0048]
【The invention's effect】
As described above, according to the present invention, it is possible to accelerate the accumulation of positive errors when the input pixel value is small, and to shorten the distance until the input pixel value after the error addition exceeds the threshold value. Even in a region where the input pixel value is small, it is possible to prevent occurrence of a portion where dots are not hit at all .
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an example of a processed image according to a conventional example.
FIG. 2 is a block diagram showing a configuration of an image processing apparatus according to the first embodiment.
FIG. 3 is a flowchart showing error diffusion processing according to the first embodiment.
4 is a diagram showing details of an error memory 208 shown in FIG.
FIG. 5 is a diagram illustrating an example of a diffusion coefficient for a positive error.
FIG. 6 is a diagram illustrating an example of a diffusion coefficient for a negative error.
FIG. 7 is a block diagram illustrating a configuration of an image processing apparatus according to a second embodiment.
FIG. 8 is a flowchart showing error diffusion processing according to the second embodiment.
FIG. 9 is a diagram illustrating an example of a filter for obtaining a threshold value.
[Explanation of symbols]
201 Pixel data input terminal 202 Cumulative error addition unit 203 Fixed threshold setting terminal 204 Quantization unit 205 Image data output terminal 206 Error calculation unit 207 Error diffusion unit 208 Error memory 209 Diffusion coefficient change unit

Claims (3)

入力画像の処理対象画素を量子化して出力する画像処理装置において、
入力画像の処理対象画素を所定の閾値で量子化する際に発生する量子化誤差の正負の値に応じて、前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散するための拡散係数を設定する設定手段と、
前記設定された拡散係数に従って前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散する拡散手段とを有し、
前記設定手段は、前記量子化誤差が正の値のときは拡散する未処理の周囲画素の範囲を負の値のときに拡散する未処理の周囲画素の範囲に対して狭くした未処理の周囲画素に拡散するための拡散係数を設定することを特徴とする画像処理装置。
In an image processing apparatus that quantizes and outputs a pixel to be processed of an input image,
Diffusion for diffusing the quantization error to unprocessed surrounding pixels of the processing target pixel according to the positive / negative value of the quantization error generated when the processing target pixel of the input image is quantized with a predetermined threshold A setting means for setting a coefficient;
Diffusion means for diffusing the quantization error to unprocessed surrounding pixels of the processing target pixel according to the set diffusion coefficient;
The setting means, the quantization error when the positive value, the untreated narrowed for a range of unprocessed surrounding pixels to diffuse when the untreated negative value range of surrounding pixels of diffusing An image processing apparatus that sets a diffusion coefficient for diffusing to surrounding pixels .
入力画像の処理対象画素を量子化して出力する画像処理装置の処理方法であって、
入力画像の処理対象画素を所定の閾値で量子化する際に発生する量子化誤差の正負の値に応じて、前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散するための拡散係数を設定する設定工程と、
前記設定された拡散係数に従って前記量子化誤差を前記処理対象画素の未処理の周囲画素に拡散する拡散工程とを有し、
前記設定工程は、前記量子化誤差が正の値のときは拡散する未処理の周囲画素の範囲を負の値のときに拡散する未処理の周囲画素の範囲に対して狭くした未処理の周囲画素に拡散するための拡散係数を設定することを特徴とする画像処理装置の処理方法。
A processing method of an image processing apparatus for quantizing and outputting a processing target pixel of an input image,
Diffusion for diffusing the quantization error to unprocessed surrounding pixels of the processing target pixel according to the positive / negative value of the quantization error generated when the processing target pixel of the input image is quantized with a predetermined threshold A setting process for setting a coefficient;
A diffusion step of diffusing the quantization error into unprocessed surrounding pixels of the processing target pixel according to the set diffusion coefficient;
The setting step, the quantization error when the positive value, the untreated narrowed for a range of unprocessed surrounding pixels to diffuse when the untreated negative value range of surrounding pixels of diffusing A processing method of an image processing apparatus, characterized in that a diffusion coefficient for diffusing to surrounding pixels is set.
請求項2に記載の画像処理装置の処理方法をコンピュータに実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。  A computer-readable recording medium recording a program for causing a computer to execute the processing method of the image processing apparatus according to claim 2.
JP2000234645A 2000-08-02 2000-08-02 Image processing apparatus and processing method thereof Expired - Fee Related JP4035280B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000234645A JP4035280B2 (en) 2000-08-02 2000-08-02 Image processing apparatus and processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000234645A JP4035280B2 (en) 2000-08-02 2000-08-02 Image processing apparatus and processing method thereof

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2007056375A Division JP2007195226A (en) 2007-03-06 2007-03-06 Image processing apparatus and method thereof

Publications (3)

Publication Number Publication Date
JP2002051212A JP2002051212A (en) 2002-02-15
JP2002051212A5 JP2002051212A5 (en) 2004-11-25
JP4035280B2 true JP4035280B2 (en) 2008-01-16

Family

ID=18726986

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000234645A Expired - Fee Related JP4035280B2 (en) 2000-08-02 2000-08-02 Image processing apparatus and processing method thereof

Country Status (1)

Country Link
JP (1) JP4035280B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4095423B2 (en) 2002-12-06 2008-06-04 キヤノン株式会社 Image processing apparatus, image data processing method, storage medium, and program
JP4560730B2 (en) * 2005-08-22 2010-10-13 富士ゼロックス株式会社 Image processing apparatus, image forming apparatus, image processing method, and program

Also Published As

Publication number Publication date
JP2002051212A (en) 2002-02-15

Similar Documents

Publication Publication Date Title
JP5482535B2 (en) Image processing apparatus and image processing method
EP2111032B1 (en) Image processing apparatus and method thereof
JP2006065834A (en) Image processing device and image processing method
US7081972B2 (en) Image processing apparatus and image processing method
JP4035280B2 (en) Image processing apparatus and processing method thereof
US6563604B1 (en) Method of gradation reproduction
JPH1127528A (en) Pseudo-medium gradation processing method, device and record medium therefor
JP2007195226A (en) Image processing apparatus and method thereof
JPH10262151A (en) Half toning method for gray scale image and device having half toning means for gray scale image
JPH11328357A (en) Device and method for image processing
JPH05183737A (en) Picture processor
JP3475425B2 (en) Image processing apparatus, image processing method thereof, and recording medium recording image processing program
JP2006303999A (en) Image processing method, image processor, and image processing system
JP3279831B2 (en) Coding method and decoding method for binary pseudo gradation image
JPH11345327A (en) Picture processing method and picture processor
JP3459725B2 (en) Image processing apparatus and method
JP3990860B2 (en) Image processing apparatus and image processing method
JP3549700B2 (en) Image processing device
JP3943747B2 (en) Image processing apparatus and multi-value processing method
JP2702593B2 (en) Isolated point removal device
JP4469511B2 (en) Image processing method
JP2002094788A (en) Image processing unit and its processing method
US7612916B2 (en) Image processing device, image processing method, and computer program
JP4182918B2 (en) Image processing apparatus, image processing method, and program
JP2000299787A (en) Image processing method and image processing unit

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061204

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070105

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070306

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070727

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070912

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071029

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

Free format text: PAYMENT UNTIL: 20101102

Year of fee payment: 3

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111102

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121102

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131102

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees