JP2004304814A - Image processing unit and method - Google Patents

Image processing unit and method Download PDF

Info

Publication number
JP2004304814A
JP2004304814A JP2004116716A JP2004116716A JP2004304814A JP 2004304814 A JP2004304814 A JP 2004304814A JP 2004116716 A JP2004116716 A JP 2004116716A JP 2004116716 A JP2004116716 A JP 2004116716A JP 2004304814 A JP2004304814 A JP 2004304814A
Authority
JP
Japan
Prior art keywords
value
data
tone
image data
binarization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2004116716A
Other languages
Japanese (ja)
Inventor
Shigeaki Sumiya
繁明 角谷
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 JP2004116716A priority Critical patent/JP2004304814A/en
Publication of JP2004304814A publication Critical patent/JP2004304814A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processing unit which can solve the problem of dot generation delays at the beginning of a low-density area or a high-density area or a lasting effect problem, after the low-density area or the high-density area, as well as can make a high-speed binarization image processing, without using a complex processing circuit or the like which does not generate side effects that lead to deterioration in the image quality. <P>SOLUTION: The image processing unit performs the binarization conversion of a multiple-tones image data into a double-tones image data, consisting of a first tone value and a second tone value (the first tone value < the second tone value), using an error diffusion method or an average error minimization method. In a predetermined multiple-tones image data region, the relation where the threshold for the binarization to be set for the tone value of the predetermined multiple-tone image data is smaller or equal to the threshold to be set for a tone value greater than the predetermined tone value is true. The binarization method 36 performs the binarization processing, after adding random noise to the set threshold or the corrected pixel data. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、多階調画像データを、中間調表示可能な2階調画像データに変換出力する画像処理装置、特に多階調画像データを誤差拡散法または平均誤差拡散最小法を用い、中間調表示な2階調画像データに変換出力する画像処理装置及び方法の改良に関する。   The present invention relates to an image processing apparatus for converting and outputting multi-tone image data into two-tone image data capable of displaying half-tone images, and in particular, to multi-tone image data using an error diffusion method or an average error diffusion minimum method. The present invention relates to improvements in an image processing apparatus and method for converting and outputting displayable two-tone image data.

従来より、スキャナなどの画像入力を用いて読み取った多階調画像データや、コンピュータを用いて演算された多階調グラフィック画像データ等を、例えばディスプレイやプリンタ等を用いて再生表示させたり、あるいはファクシミリやデジタル複写機等を用いて再生表示させることが行われている。   Conventionally, multi-tone image data read using an image input such as a scanner, or multi-tone graphic image data calculated using a computer, for example, reproduced and displayed using a display or a printer, or 2. Description of the Related Art Reproduction and display are performed using a facsimile, a digital copying machine, or the like.

このとき、画像出力装置として、多階調の画像データが再生表示できるものを用いる場合には問題はないが、例えばドット単位での階調制御ができないプリンタ装置や、ディスプレイ装置を用いた場合には、各画素の階調を2階調に減らす二値化処理を行う必要がある。   At this time, there is no problem when using an image output device capable of reproducing and displaying multi-gradation image data, but for example, when a printer device or a display device that cannot perform gradation control in dot units is used. It is necessary to perform a binarization process for reducing the gradation of each pixel to two gradations.

さらに、前記多階調画像データを保存し、あるいは転送するために、そのデータ容量を減らそうとする場合には、同様に各画素の階調数を2階調に減らす二値化処理することが広く行われている。   Further, when the data capacity is to be reduced in order to store or transfer the multi-tone image data, a binarization process is similarly performed to reduce the number of tones of each pixel to two. Is widely practiced.

このように、多階調画像データを二値化処理する手法としては、各種のものがある。その中で、最も画質の優れたものとして、誤差拡散法や、それと等価な平均誤差最小法が広く用いられている。前記誤差拡散法や平均誤差最小法は、高解像度でありながら、連続的な階調制御が可能であるという優れた特徴をもつ。   As described above, there are various methods for binarizing multi-tone image data. Among them, the error diffusion method and the equivalent average error minimization method which are the most excellent in image quality are widely used. The error diffusion method and the average error minimum method have an excellent feature that continuous gradation control is possible while having high resolution.

前記誤差拡散法は、ある画素の二値化時に生じた量子化誤差を、周辺のまだ二値化していない画素に拡散して加えるものである。一方、平均誤差最小法は、周辺の二値化済みの画素に生じた量子化誤差の重み付き平均値で、次の注目画素のデータ値を修正するものである。誤差拡散法と、平均誤差最小法は、誤差の拡散作業をいつ行うかが異なるだけであり、論理的には等価である。誤差拡散法を使用した例としては、例えば特開平1−284173号公報の「画像処理方法及び装置」等がある。
特開平1−284173号公報
According to the error diffusion method, a quantization error generated at the time of binarization of a certain pixel is diffused and added to surrounding pixels that have not been binarized. On the other hand, the average error minimization method corrects the data value of the next pixel of interest with a weighted average value of quantization errors generated in neighboring binarized pixels. The error diffusion method and the average error minimization method are only logically different when the error diffusion operation is performed, and are logically equivalent. As an example using the error diffusion method, there is “Image Processing Method and Apparatus” of JP-A-1-284173.
JP-A-1-284173

しかし誤差拡散法や平均誤差最小法を用いた従来の画像処理装置では、多階調画像データを2階調画像データに変換する際に、次のような問題があった。   However, the conventional image processing apparatus using the error diffusion method or the average error minimum method has the following problems when converting multi-gradation image data into two-gradation image data.

[第1の問題点]
低濃度領域(黒ドットが疎な領域)の立上がり部における黒ドットの生成および、高濃度領域(白ドットが疎な領域)の立上がり部における白ドットの生成が、大幅に遅延し、その結果、最悪の場合には画像が変形してしまう場合があるという問題があった。
[First problem]
The generation of black dots at the rising portion of a low-density region (region with sparse black dots) and the generation of white dots at the rising portion of a high-density region (region with sparse white dots) are greatly delayed. As a result, In the worst case, there is a problem that an image may be deformed.

[第2の問題点]
また、低濃度領域や高濃度領域が終わった後も、周辺画素に対する異常な誤差の拡散が残り、低濃度領域の後に続く画像データは高濃度側に、高濃度領域の後に続く画像データは低濃度側に歪む「尾引き」という現象が生じるという問題があった。
[Second problem]
Further, even after the low-density area or the high-density area ends, abnormal error diffusion to peripheral pixels remains, and image data following the low-density area is on the high-density side, and image data following the high-density area is on the low-density side. There is a problem that a phenomenon called "tailing" that is distorted toward the density side occurs.

前記第1の問題点を、白い紙上に黒インクのドットを印画する2階調プリンタ装置の場合について考えると、黒ドットはインクが滲んで大きくなるのに対し、白ドットは周囲の黒ドットからの滲みで潰れて目立ちにくくなるので、前記第1の問題点は特に低濃度部で目立つ結果となる。   Considering the first problem in the case of a two-tone printer device that prints black ink dots on white paper, the black dots become larger due to ink bleeding, while the white dots become larger than the surrounding black dots. The first problem is particularly conspicuous in low-density areas, because it is crushed by blurring and becomes less noticeable.

前記第1の問題点および第2の問題点を、図面を用いてより詳細に説明する。   The first problem and the second problem will be described in more detail with reference to the drawings.

図13は、多階調を用いて表示された原画像100である。この原画像100は、濃度階調値252(255で最高値)の正方形をした高濃度領域110の中に、濃度階調値3(0が最低濃度)の正方形の低濃度領域120が存在し、さらにこの低濃度領域120の右下に濃度階調値231(背景濃度252よりやや低濃度)の傾き45度の直線130が引いてある。   FIG. 13 is an original image 100 displayed using multiple gradations. In the original image 100, a square low-density area 120 having a density gradation value 3 (0 is the lowest density) exists in a square high-density area 110 having a density gradation value 252 (255 is the highest value). Further, a straight line 130 having a 45-degree gradient 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.

図14(A)には、誤差拡散法を用いた従来技術により、図13に示す原画像100の多階調画像データを二値化した画像が示されている。なお、図14(B)には、図14(A)の場所を示すための概略図が示されている。この二値化画像は、原画像100の左上隅画素を二値化開始点とし、右方向に1行分二値化した後、1画素下の行の左端に移る、という二値化作業を繰り返し得られたものである。これに対し、図12は、同じ原画像100が理想的に二値化された場合の出力例であり、本発明の画像処理装置によるものである。   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 showing the location of FIG. 14A. In this binarized image, a binarization operation is performed in which the upper left corner pixel of the original image 100 is used as a binarization start point, binarized by one line in the right direction, and then moved to the left end of the line one pixel below. 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 obtained by the image processing apparatus of the present invention.

両者を比較すると、図14では、正方形をした高濃度領域110の上辺および左辺の領域140(図14(B)参照)で白ドットの生成が遅延し、さらに正方形の低濃度領域120の上辺および左辺の領域142では、黒ドットの生成の遅延が生じている。すなわち、領域140,142では、前述した第1の問題が発生している。   Comparing the two, in FIG. 14, the generation of white dots is delayed in the upper side and the left side area 140 (see FIG. 14B) of the square high-density area 110, and the upper side and the square of the square low-density area 120 are further reduced. In the region 142 on the left side, the generation of black dots is delayed. That is, the first problem described above occurs in the regions 140 and 142.

さらに、階調値3の正方形をした低濃度領域120の尾引きの影響で、その右下にある領域150において、直線130の一部132が消失してしまっている。このように、領域150では、前述した第2の問題が発生している。   Further, a part 132 of the straight line 130 has disappeared in the lower right region 150 due to the trailing effect of the low-density region 120 having the square shape of the gradation value 3. As described above, the second problem described above occurs in the region 150.

このような、第1および第2の問題を解決するために、特開平1−130945号公報にかかる「画像処理装置」の提案がなされている。   In order to solve such first and second problems, an "image processing apparatus" according to Japanese Patent Application Laid-Open No. 1-130945 has been proposed.

この提案に記載の第1の実施例は、0〜255の256階調の入力濃度データを扱う場合に、入力濃度データ値が1以上29以下の場合に、しきい値が以下に示すようにランダムに変化するようにしている。   In the first embodiment described in this proposal, when handling input density data of 256 gradations from 0 to 255, when the input density data value is 1 or more and 29 or less, the threshold value is as follows. It changes randomly.

入力データが1〜4の時は、20〜230、入力データが5〜14のときは50〜200、入力データが15〜29のときは100〜150の幅でしきい値をランダムに変化させる。ランダムノイズの幅は、データが1〜4の時はプラスマイナス105、データが5〜14のときはプラスマイナス75、データが15〜29のときはプラスマイナス25というふうになっており、0に近い低濃度領域ほど、大きなノイズを加える結果となっている。ただし、しきい値の期待値はいずれも125で一定となっている。   When the input data is 1-4, the threshold is randomly changed in the range of 20-230, when the input data is 5-14, 50-200, and when the input data is 15-29, the threshold is changed in the range of 100-150. . The width of the random noise 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 result is that the closer the low density area is, the more noise is added. However, the expected values of the thresholds are all constant at 125.

このようにすると、低濃度時には大きなしきい値ノイズによってしきい値が非常に小さな値になるケースが生じる。このため、低濃度領域の立上り部でも255側に二値化される画素が発生し、ドット生成の遅延が改善される。しかし、この手法によって前記第1の問題点を改善しようとした場合には、低濃度領域は非常にノイズの多い、低品位な画像となってしまう。また、この従来例では、判定回路という特別な機構を設け、この判定回路を用い、注目画素周辺の二値化済み画素の二値化結果を調べ、周辺に既にドットがある場合には、注目画素をドット有りに二値化しないような判定処理を行っている。これは、前記問題を少しでも改善するためであろうと思われる。しかし、そのためには、判定回路が近傍の12画素という多くの画素の二値化結果を参照するという複雑な判定処理が必要となり、処理時間がかかる上に、画質的にもまだ十分ではないという問題があった。これに加えて、この従来技術では、第2の問題点の改善も不十分であった。   In this case, the threshold value becomes very small due to a large threshold noise when the density is low. For this reason, even at the rising portion of the low-density area, a pixel which is binarized to the 255 side occurs, and the delay of dot generation is improved. However, if this method is used to improve the first problem, the low-density area becomes a very noisy and low-quality image. Further, in this conventional example, a special mechanism called a determination circuit is provided, and using this determination circuit, the binarization result of the binarized pixel around the target pixel is checked. A determination process is performed so that a pixel is not binarized with a dot. This seems to be to improve the above problem a little. However, for that purpose, a complicated judgment process is required in which the judgment circuit refers to the binarization results of many pixels, that is, 12 pixels in the vicinity, and it takes a long processing time and the image quality is not yet sufficient. There was a problem. In addition, the conventional technique has not sufficiently improved the second problem.

また、この従来技術に記載の「その他の実施例1」には、信号410を定義する式と、その例を示す図1とが食い違って記載されており、その正確な理解は難しい。しかし、この従来技術には、「前述の実施例の場合と同じような閾値設定の機能をもたせて、かつハード規模を小さくできる」と述べられていることから、第1の実施例同様に、低濃度領域ではしきい値に大量のノイズを加えていると考えられる。従って、この従来例に記載の「その他の実施例1」は、「第1の実施例」と同様な問題点を有している。   Further, in “Other Embodiment 1” described in the related art, the equation defining the signal 410 is different from FIG. 1 showing the example, and it is difficult to accurately understand the equation. However, since this prior art states that "it is possible to provide a function of threshold setting similar to that of the above-described embodiment and to reduce the hardware scale", as in the first embodiment, It is considered that a large amount of noise is added to the threshold value in the low density region. Therefore, the “other embodiment 1” described in the conventional example has the same problem as the “first embodiment”.

また、前記第1および第2の問題点を改善するための別の手法として、特開平3−112269号公報にかかる「画像処理装置」や、特開平4−126464号公報にかかる「画像形成装置」などの提案がある。これらの従来技術は、注目画素近傍の複数画素の二値化結果を参照することによって、平均濃度値を推定し、それをしきい値として注目画素の二値化を行っている。   Further, as another method for improving the first and second problems, an "image processing apparatus" disclosed in JP-A-3-112269 and an "image forming apparatus" disclosed in JP-A-4-126644 are disclosed. And other proposals. In these conventional techniques, an average density value is estimated by referring to a binarization result of a plurality of pixels in the vicinity of a target pixel, and the target pixel is binarized using the average density value as a threshold value.

しかし、これらの従来技術は、次の(1)、(2)の問題があった。   However, these conventional techniques have the following problems (1) and (2).

(1)周辺の10以上もの画素の二値化結果を参照する必要があり、処理時間がかかったり、複雑な処理回路が必要となったりするという問題があった。   (1) It is necessary to refer to the binarization results of as many as 10 or more peripheral pixels, and there is a problem that processing time is required and a complicated processing circuit is required.

(2)さらに、データが急に変化しているエッジ部分では、周辺画素の平均濃度値を用いるのは適切でなく、この結果、不適切な二値化が行われ、ノイズが発生してしまうという問題があった。   (2) Further, in an edge portion where data changes rapidly, it is not appropriate to use an average density value of peripheral pixels, and as a result, inappropriate binarization is performed and noise occurs. There was a problem.

本発明は、このような従来の課題に鑑みなされたものであり、その目的は、低濃度領域、高濃度領域の立上り部でのドット生成の遅延や、低濃度領域、高濃度領域が終わった後の尾引きの問題を解決する事ができるとともに、画質劣化につながるがる副作用がなく、複雑な処理回路などを用いなくても多階調画像データを高速に二階調画像データに画像処理できる画像処理装置及び方法を得ることにある。   The present invention has been made in view of such a conventional problem, and its object is to end the low-density area, the delay of dot generation at the rising portion of the high-density area, the low-density area, and the high-density area. In addition to solving the problem of trailing, there is no side effect that leads to image quality degradation, and multi-tone image data can be processed at high speed into two-tone image data without using complicated processing circuits. An image processing apparatus and method are provided.

(1)前記目標を達成するため、本発明は、
多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理装置において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正手段と、
前記注目画素の多階調画像データの階調値に応じて2値化のためのしきい値に異なる値を設定し得るしきい値設定手段と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化手段と、
を有し、
所定の多階調画像データ領域において、所定の多階調画像データの階調値に対して設定するしきい値は、該所定の階調値よりも大きい階調値に対して設定するしきい値以下となる関係が成り立ち、
前記2値化手段は、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う。
(1) In order to achieve the above goal, the present invention provides:
The multi-tone image data is converted into two-tone image data including a first tone value and a second tone value (first tone value <second tone value) by using an error diffusion method or an average error minimum method. In an image processing apparatus for performing binarization conversion to
Error correction means for correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring binarized pixels, and outputting as corrected pixel data;
Threshold setting means for setting a different threshold value for binarization in accordance with the gradation value of the multi-gradation image data of the pixel of interest;
A binarizing unit that binarizes and converts the corrected pixel data into the binary image data based on the set threshold value;
Has,
In a predetermined multi-tone image data area, a threshold value set for a tone value of the predetermined multi-tone image data is a threshold set for a tone value larger than the predetermined tone value. The relationship below the value holds,
The binarizing means includes:
A binarization process is performed after adding random noise to the set threshold value or the corrected pixel data.

前記所定の多階調画像データの領域とは、
実質的に前記第1階調値から前記第2階調値の全ての範囲とすることが可能である。
The area of the predetermined multi-tone image data is
The range can be substantially the entire range from the first gradation value to the second gradation value.

前記所定の多階調画像データの領域とは、
前記第1階調値の近傍または前記第2階調値の近傍の少なくとも片方とすることが可能である。
The area of the predetermined multi-tone image data is
At least one of the vicinity of the first gradation value and the vicinity of the second gradation value can be set.

前記第1階調値と第2階調値の中間値をmとして、
前記所定の多階調画像データの領域とは前記第1階調値近傍であり、該所定の階調値よりも大きい階調値はm近傍であるか、または、
前記所定の多階調画像データの領域とは前記m近傍であり、該所定の階調値よりも大きい階調値は前記第2階調値近傍である、
の少なくとも片方を実質的に満たすようにすることが可能である。
Assuming that an intermediate value between the first gradation value and the second gradation value is m,
The area of the predetermined multi-tone image data is near the first tone value, and a tone value larger than the predetermined tone value is near m, or
The predetermined multi-tone image data area is near the m, and a tone value larger than the predetermined tone value is near the second tone value.
Can be substantially satisfied.

(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値化処理を行う。
(2) Further, according to the present invention, the multi-gradation image data is converted into a first gradation value and a second gradation value (first gradation value <second gradation value) using an error diffusion method or an average error minimization method. Image processing apparatus for binarizing and converting into binary image data consisting of
Error correction means for correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring binarized pixels, and outputting as corrected pixel data;
Threshold setting means for setting a different threshold value for binarization in accordance with the gradation value of the multi-gradation image data of the pixel of interest;
A binarizing unit that binarizes and converts the corrected pixel data into the binary image data based on the set threshold value;
Where data is a gradation value of multi-gradation image data of the pixel of interest, m is an intermediate value between the first and second gradation values, and slsh is the threshold value.
The threshold setting means,
If data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
When data is a value near the second gradation value, (m + data) / 2 ≦ slsh ≦ data
Set the threshold slsh to satisfy any of
The binarizing means includes:
A binarization process is performed after adding random noise to the set threshold value or the corrected pixel data.

前記しきい値設定手段は、
slsh=(data*(K−1)+m)/K(ただし、Kは2以上の整数で表される定数)
を満たすようにしきい値slshを設定することが可能である。
The threshold setting means,
slsh = (data * (K-1) + m) / K (where K is a constant represented by an integer of 2 or more)
The threshold slsh can be set to satisfy

前記しきい値設定手段は、
前記階調値dataの値に応じて、前記しきい値slshを段階的に設定することが可能である。
The threshold setting means,
The threshold value slsh can be set stepwise according to the value of the gradation value data.

前記しきい値設定手段は、
data<m−L1の場合には、slsh=data+L1
m−L1<data<m+L2の場合には、slsh=m
m+L2<dataの場合には、slsh=data−L2
(ただし、L1,L2は0〜mの間の整数で表される定数)
を満たすようにしきい値slshを設定することが可能である。
The threshold setting means,
If data <m−L1, slsh = data + L1
If m−L1 <data <m + L2, slsh = m
When m + L2 <data, slsh = data−L2
(However, L1 and L2 are constants represented by integers between 0 and m)
The threshold slsh can be set to satisfy

(3)また、本発明は、多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理方法において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正工程と、
2値化のためのしきい値を設定するしきい値設定工程と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化工程と、
を含み、所定の多階調画像データの階調値に対してしきい値設定工程において設定するしきい値は、該所定の階調値よりも大きい階調値に対して設定するしきい値よりも低い関係が所定の多階調画像データ領域において成り立ち、
前記2値化工程では、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う。
(3) Further, according to the present invention, the multi-gradation image data is converted into a first gradation value and a second gradation value (first gradation value <second gradation) by using an error diffusion method or an average error minimization method. Value) in the image processing method for binarizing and converting into binary gradation image data
An error correction step of correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring binarized pixels and outputting the corrected pixel data;
A threshold setting step of setting a threshold for binarization;
A binarizing step of binarizing and converting the corrected pixel data into the binary image data based on the set threshold value;
Wherein the threshold value set in the threshold value setting step for the gradation value of the predetermined multi-tone image data is a threshold value set for a gradation value larger than the predetermined gradation value. Lower relationship holds in a given multi-tone image data area,
In the binarization step,
A binarization process is performed after adding random noise to the set threshold value or the corrected pixel data.

(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値化処理を行う。
(4) Further, according to the present invention, the multi-gradation image data is converted into a first gradation value and a second gradation value (first gradation value <second gradation) by using an error diffusion method or an average error minimization method. Value) in the image processing method for binarizing and converting into binary gradation image data
An error correction step of correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring binarized pixels and outputting the corrected pixel data;
A threshold setting step of setting a threshold for binarization;
A binarizing step of binarizing and converting the corrected pixel data into the binary image data based on the set threshold value;
Where the grayscale value of the multi-grayscale image data of the target pixel is data, the intermediate value between the first grayscale value and the second grayscale value is m, and the threshold is slsh,
In the threshold setting step,
determining whether data is a value near the first tone value or a value near the second tone value,
If data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
When data is a value near the second gradation value, (m + data) / 2 ≦ slsh ≦ data
Set the threshold slsh to satisfy
In the binarization step,
A binarization process is performed after adding random noise to the set threshold value or the corrected pixel data.

(1)本実施の形態は、
多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに変換出力する画像処理装置において、
注目画素の多階調画像データに、周辺の既に二値化済の画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正手段と、
前記注目画素の多階調画像データの階調値に基づき、2値化しきい値を設定するしきい値設定手段と、
設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに変換出力する二値化手段と、
を含み、
前記注目画素の多階調画像データの階調値をdata、前記第1階調値および第2階調値の中間の値をm、前記しきい値をslshとすると、
前記しきい値設定手段は、
前記二値化しきい値slshを、前記注目画素の多階調画像データの階調値dataに応じて、次式に示す許容範囲の少なくともいずれか一方を満たすように設定することを特徴とする。
(1) In the present embodiment,
The multi-tone image data is converted into two-tone image data including a first tone value and a second tone value (first tone value <second tone value) by using an error diffusion method or an average error minimum method. In an image processing device that converts and outputs
Error correction means for correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring pixels that have already been binarized, and outputting the corrected pixel data;
Threshold value setting means for setting a binarization threshold value based on a gradation value of the multi-gradation image data of the pixel of interest;
A binarizing unit configured to convert and output the corrected pixel data to the two-tone image data based on the set threshold value;
Including
If the gradation value of the multi-gradation image data of the pixel of interest 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,
The binarization threshold value slsh is set so as to satisfy at least one of an allowable range shown in the following equation according to the gradation value data of the multi-gradation image data of the target pixel.

dataが第1階調値近辺の値の場合には、data≦slsh≦(m+data)/2
dataが第2階調値近辺の値の場合には、(m+data)/2≦slsh≦data
ここにおいて、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataが、前記第1階調値および第2階調値の付近の値であるとき、前記二値化しきい値slshを前記許容範囲に設定するよう形成できる。
If data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
When data is a value near the second gradation value, (m + data) / 2 ≦ slsh ≦ data
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 near the first gradation value and the second gradation value, the binarization threshold slsh is set to the allowable range. It can be formed as follows.

また、必要に応じ、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataが、前記第1階調値または第2階調値の付近の値であるとき、前記二値化しきい値slshを前記許容範囲に設定するよう形成することもできる。
Further, if necessary, the threshold value setting means includes:
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 to the allowable range. It can also be formed as follows.

また、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataの値に基づき、次式に従い前記二値化しきい値slshを設定することも可能である。
Further, the threshold value setting means includes:
Based on the value of the gradation value data of the multi-gradation image data of the target pixel, the binarization threshold value slsh can be set according to the following equation.

slsh=(data*(K−1)+m)/K
ただし、Kは2以上の整数で表される定数。
slsh = (data * (K-1) + m) / K
Here, K is a constant represented by an integer of 2 or more.

また、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataの値に応じて、前記二値化しきい値slshを段階的に設定することも可能である。
Further, the threshold value setting means includes:
The binarization threshold value slsh can be set stepwise according to the value of the gradation value data of the multi-gradation image data of the target pixel.

また、前記しきい値設定手段は、
前記注目画素の多階調画像データの階調値dataの値に基づき、次式に従い前記二値化しきい値slshを設定することも可能である。
Further, the threshold value setting means includes:
Based on the value of the gradation value data of the multi-gradation image data of the target pixel, the binarization threshold slsh can be set according to the following equation.

data<m−L1のときには、slsh=data+L1
m−L1<data<m+L2のときには、slsh=m
m+L2<dataのときには、slsh=data−L2
ただし、L2,L2は0〜mの間の整数で表される定数。
When data <m−L1, slsh = data + L1
When m−L1 <data <m + L2, slsh = m
When m + L2 <data, slsh = data−L2
Here, L2 and L2 are constants represented by integers between 0 and m.

また、前記二値化手段は、
設定されたしきい値または前記補正画素データにランダムノイズを加え、前記補正画素データに対する前記二値化処理を行うことも可能である。
Further, the binarization means includes:
It is also possible to add random noise to the set threshold value or the corrected pixel data, and perform the binarization process on the corrected pixel data.

また、前記誤差補正手段は、
各画素毎の拡散誤差積算値を記憶する拡散誤差記憶部と、
補正画素データと二値化結果との二値化誤差を演算し、その二値化誤差を誤差拡散法を用い注目画素近傍の未二値化画素へ分配して拡散する演算を行い、前記拡散誤差記憶部に記憶された各画素毎の拡散誤差積算値に、前記注目画素からの拡散誤差を加算して新たな拡散誤差積算値を求め、前記拡散誤差記憶部に記憶された各画素毎の拡散誤差積算値を更新する誤差拡散部と、
注目画素の多階調画像データと、前記拡散誤差記憶部に記憶された注目画素の拡散誤差積算値とを加算し、前記補正画素データを演算するデータ補正部と、
を含み、注目画素の多階調画像データを誤差拡散法を用い補正し、補正画素データとして出力することも可能である。
Further, the error correction means includes:
A diffusion error storage unit that stores a diffusion error integrated value for each pixel;
Calculating a binarization error between the corrected pixel data and the binarization result, and performing an operation of distributing and distributing the binarization error to non-binarized pixels in the vicinity of the pixel of interest using an error diffusion method; To the diffusion error integrated value for each pixel stored in the error storage unit, a diffusion error from the pixel of interest is added to obtain a new diffusion error integrated value, and for each pixel stored in the diffusion error storage unit. An error diffusion unit that updates a diffusion error integrated value;
A data correction unit that adds the multi-tone image data of the pixel of interest and the diffusion error integrated value of the pixel of interest stored in the diffusion error storage unit, and calculates the corrected pixel data;
And it is also possible to correct the multi-tone image data of the target pixel by using the error diffusion method and output the corrected pixel data as corrected pixel data.

また、前記誤差補正手段は、
各画素毎の誤差を記憶する誤差記憶部と、
補正画素データと二値化結果との二値化誤差を演算し、その二値化誤差を前記誤差記憶部に記憶する誤差拡散部と、
前記誤差記憶部に記憶された注目画素の周辺の画素の二値化誤差を読み出し所定の重み付けをすることにより平均誤差を求め、この平均誤差を注目画素の多階調画像データに加算し、前記補正画素データを演算するデータ補正部と、
を含み、注目画素の多階調画像データを平均誤差最小法を用い補正し、補正画素データとして出力することも可能である。
Further, 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 corrected pixel data and the binarization result, and stores the binarization error in the error storage unit.
An average error is obtained by reading a binarization error of a pixel around the pixel of interest stored in the error storage unit and performing a predetermined weighting, and adding this average error to multi-tone image data of the pixel of interest. A data correction unit for calculating correction pixel data,
And it is also possible to correct the multi-tone image data of the target pixel by using the average error minimum method and output the corrected pixel data.

本実施の形態において、多階調画像データは、誤差補正手段およびしきい値決定手段に入力される。   In the present embodiment, multi-tone image data is input to an error correction unit and a threshold value determination unit.

誤差補正手段は、注目画素の多階調データに、周辺の既に二値化済の画素から拡散された誤差を加えて補正し、補正画素データとして出力する。   The error correction unit corrects the multi-gradation data of the target pixel by adding an error diffused from the neighboring binarized pixels, and outputs the corrected pixel data.

前記しきい値設定手段は、注目画素の多階調画像データの階調に基づき、二値化しきい値を設定する。このとき、注目画素の多階調画像データの階調値dataが、二値化された後の画像の第1階調値および第2階調値(第1階調値<第2階調値)の少なくともいづれか一方の付近の値を取るとき、二値化しきい値slshを次式に示す許容範囲内に設定する。   The threshold value setting means sets a binarization threshold value based on the gradation of the multi-gradation image data of the target pixel. At this time, the gradation value data of the multi-gradation image data of the target pixel is changed to the first gradation value and the second gradation value (first gradation value <second gradation value) of the binarized image. ), The binarization threshold value slsh is set within an allowable range represented by the following equation.

dataが第1階調値近辺の値の時には、data≦slsh≦(m+data)/2
dataが第2階調値近辺の値の時には、(m+data)/2≦slsh≦data
そして、二値化設定手段は、設定されたしきい値に基づき、前記補正画素データを、中間調表示可能な第1階調値および第2階調値からなる2階調画像データに変換出力する。
When data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
When data is a value near the second gradation value, (m + data) / 2 ≦ slsh ≦ data
The binarization setting means converts the corrected pixel data into two-gradation image data composed of a first gradation value and a second gradation value capable of halftone display based on the set threshold value. I do.

このように、本実施の形態では、多階調画像データ値が小さいときには、しきい値を小さく、画像データ値が大きいときには、しきい値も大きくするよう注目画素の多階調画像データの階調値に応じて二値化しきい値を最適化することで、二値化に伴い発生する誤差の蓄積を解消し、注目画素のドット生成を良好に行うことができる。   As described above, in the present embodiment, when the multi-tone image data value is small, the threshold value is small, and when the image data value is large, the threshold value of the multi-tone image data of the pixel of interest is increased. By optimizing the binarization threshold value according to the tonal value, accumulation of errors generated due to binarization can be eliminated, and dot generation of the target pixel can be performed satisfactorily.

また、本実施の形態のように、誤差拡散法または平均誤差最小法を用い二値化処理を行う場合には、二値化しきい値を変化させても、全体としての出力濃度はほとんど変動しないことが確認された。   Further, when the binarization processing is performed using the error diffusion method or the average error minimum method as in the present embodiment, the output density as a whole hardly changes even if the binarization threshold is changed. It was confirmed that.

以上説明したように、本実施の形態によれば、低濃度領域や高濃度領域で、多量の誤差の蓄積が発生するという現象を解消することができ、それに起因して生じていた、低濃度または高濃度領域の立上り部でのドット生成の遅延や、低濃度領域または高濃度領域が終わった後の尾引きなどの問題を画質劣化につながる副作用なしに根本的に解決することができる。   As described above, according to the present embodiment, it is possible to eliminate the phenomenon that a large amount of error is accumulated in the low-density region or the high-density region. Alternatively, it is possible to fundamentally solve problems such as delay of dot generation at a rising portion of a high-density area and tailing after the end of a low-density area or a high-density area without a side effect of deteriorating image quality.

すなわち、本実施の形態によれば、多階調画像データを、誤差拡散法または平均誤差最小法を用いて補正し、しかも、注目画素の階調値画像データの階調値に基づき、二値化しきい値を最適化するしきい値設定手段を設けることにより、低濃度領域や高濃度領域で多量の誤差の蓄積が生じているという現象を解消することができ、それに起因して発生していた、低濃度領域や高濃度領域の立上り部でのドット生成の遅延や、低濃度領域や高濃度領域が終わった後の「尾引き」などの問題を、画質劣化に繋がる副作用なしに根本的に解消できる画像処理装置を得ることができるという効果がある。   That is, according to the present embodiment, the multi-tone image data is corrected using the error diffusion method or the average error minimization method, and furthermore, based on the tone value of the tone value image data of the target pixel, By providing the threshold setting means for optimizing the threshold, the phenomenon that a large amount of error is accumulated in the low-density region or the high-density region can be eliminated, and the phenomenon caused by the accumulation can be solved. In addition, problems such as delay in dot generation at the rising edge of low-density and high-density areas and “tailing” after the end of low-density and high-density areas are fundamentally eliminated without the side effects that lead to image quality degradation. Thus, there is an effect that an image processing apparatus that can be eliminated can be obtained.

さらに、本実施の形態によれば、しきい値設定手段を、簡単な演算を行うか、または変換テーブルを参照するなどの単純な構成で実現できるため、複雑な処理回路を必要とせず、高速にかつ良好な画像処理を行うことができる。   Further, according to the present embodiment, the threshold value setting means can be realized with a simple configuration such as performing a simple calculation or referring to a conversion table, and thus does not require a complicated processing circuit and has a high speed. And good image processing can be performed.

さらに、本実施の形態では、しきい値設定手段が設定するしきい値を増減させることで、ドット生成速度の調整が可能となり、必要に応じ過補正状態を設定することで、例えばエッジ強調的な効果を期待できるという副次的な効果が得られる。   Further, 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. A secondary effect is obtained in that a significant effect can be expected.

次に、本発明の好適な実施例を図面に基づき詳細に説明する。   Next, preferred embodiments of the present invention will be described in detail with reference to the drawings.

[システム全体の説明]
図1には、本発明にかかる画像処理装置を用いたシステムの概略が示されている。
[Description of the entire system]
FIG. 1 schematically shows a system using an image processing apparatus according to the present invention.

階調画像データ出力装置10から出力される原画像の多階調画像データ200は、画像処理装置30へ入力される。   The multi-tone image data 200 of the original image output from the tone image data output device 10 is input to the image processing device 30.

画像処理装置30は、入力された原画像の多階調画像データ200を、二値画像出力装置20の出力可能な2階調に階調数変換して出力する。すなわち、多階調画像データ200を、誤差拡散法または平均誤差最小法を用いて補正し、中間調表示可能な第1階調値および第2階調値のみからなる2階調画像データ230に変換して出力する。   The image processing device 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 device 20 and outputs it. That is, the multi-tone image data 200 is corrected using the error diffusion method or the average error minimization method, and is converted into the two-tone image data 230 including only the first tone value and the second tone value that can be displayed in a halftone. Convert and output.

二値画像出力装置20は、画像処理装置30から出力される2階調画像データ230に基づき、原画像を再生出力する。   The binary image output device 20 reproduces and outputs an original image based on the two-tone image data 230 output from the image processing device 30.

本実施例において、前記階調画像データ出力装置10は、コンピュータを用いて形成されている。そして、このコンピュータは、ハードディスク等に記憶された多階調画像データ200を画像処理装置30へ向け出力するように構成されている。前記多階調画像データ200は、0〜255の256階調の濃度データとして表されている。なお、この階調画像データ出力装置10は、これ以外に、例えばコンピュータグラフィックの多階調画像データを出力するように形成してもよく、また、コンピュータ以外でも、例えば、スキャナ、ビデオカメラなど各種の手段を用いてもよい。   In the present embodiment, the gradation image data output device 10 is formed using a computer. The computer is configured to output the multi-tone image data 200 stored in a hard disk or the like to the image processing device 30. The multi-tone image data 200 is represented as density data of 256 tones from 0 to 255. The gradation image data output device 10 may be formed so as to output, for example, multi-gradation image data of a computer graphic. May be used.

そして、実施例の画像処理装置30は、入力される256階調の画像データを、誤差拡散法により、0(白)または255(黒)のみからなる2階調画像データ230に変換出力する。   Then, the image processing device 30 of the embodiment converts the input 256-gradation image data into two-gradation image data 230 consisting of only 0 (white) or 255 (black) by the error diffusion method.

また、実施例の二値画像出力装置20は、画素単位での階調制御ができないプリンタを用いて形成され、入力される2階調画像データ230に基づき、原画像を中間調表示可能に再生出力する。なお、前記二値画像出力装置20は、プリンタ以外に、必要に応じ、ディスプレイや、ファクシミリ装置、デジタル複写機等を用いてもよい。   Further, the binary image output device 20 of the embodiment is formed by using a printer that cannot perform gradation control in units of pixels, and reproduces an original image to be capable of displaying halftones based on input two-gradation image data 230. Output. The binary image output device 20 may use a display, a facsimile machine, a digital copying machine, or the like, if necessary, other than the printer.

[システムの具体例]
本実施例において、前記画像処理装置30は、階調画像データ出力装置10または二値画像出力装置20と別体に形成してもよいが、必要に応じ、これら各装置10,20と一体に形成してもよい。
[Specific example of system]
In this 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.

例えば、図15に示すよう、階調画像データ出力装置10としてホストコンピュータ12を用い、二値画像出力装置20としてプリンタ20を用いた場合には、本実施例の画像処理装置30を、プリンタ22内へ一体的に組み込んで形成することができる。この場合には、プリンタ22は、ホストコンピュータ12より出力する多階調画像データ200が入力されるデータ入力部24と、本実施例の画像処理装置30と、二値化ドット印画手段26とを含んで構成される。   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 the present embodiment is replaced with the printer 22. It can be formed by being integrated into the inside. In this case, the printer 22 includes the 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. It is comprised including.

また、本実施例の画像処理装置30を、図16に示すよう、ホストコンピュータ12内へ一体的に組み込んで形成してもよい。この場合、ホストコンピュータ12は、階調画像ファイルの読込手段14と、プリンタドライバ16と、データ出力手段18とを含むように構成される。そして、前記プリンタドライバ16は、階調画像ファイル読込手段14から多階調画像データ200が入力される本実施例の画像処理装置30と、この画像処理装置30の出力に基づき、プリンタ制御コマンドを生成するプリンタ制御コマンド生成手段16aとを含み、プリンタ制御コマンドに基づき、プリンタ22を制御するように構成されている。   Further, as shown in FIG. 16, the image processing apparatus 30 according to the present embodiment may be formed integrally with the host computer 12. 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 receives the multi-gradation image data 200 from the gradation image file reading means 14, and outputs a printer control command based on the output of the image processing device 30. And a printer control command generating means 16a for generating, and is configured to control the printer 22 based on the printer control command.

なお、図17に示すよう、階調画像データ出力装置10としてスキャナ50を用い、このスキャナ50で読み込んだ多階調画像データを二値化データとしてホストコンピュータ60へ出力する場合には、スキャナ50に本実施例の画像処理装置30を一体的に組み込んで形成すればよい。この場合には、スキャナ50は、画像を光学的に読み取る階調画像データ読み取り部52と、読み取られた多階調画像データ200を2階調画像データ230として出力する本実施例の画像処理装置30と、出力された2階調画像データ230のデータをホストコンピュータへ向け出力する二値化データ出力部54とを含んで構成される。   As shown in FIG. 17, when a scanner 50 is used as the gradation image data output device 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 In this case, the image processing apparatus 30 of the present embodiment may be integrally incorporated. In this case, the scanner 50 includes a gradation image data reading unit 52 that optically reads an image, and an image processing apparatus according to 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 output binary grayscale image data 230 to the host computer.

なお、本実施例の画像処理装置は必要に応じ、前述以外の装置に一体的に組み込んで形成することもできる。   The image processing apparatus according to the present embodiment can be formed integrally with other apparatuses as necessary.

なお、説明の都合上、以降の説明では、図1に示すよう、本実施例の画像処理装置30は、階調画像データ出力装置10および二値画像データ出力装置20とは別体に形成されるものとして、その説明を行う。   For convenience of description, in the following description, as shown in FIG. 1, the image processing device 30 of the present embodiment is formed separately from the gradation image data output device 10 and the binary image data output device 20. The description will be given.

[画像処理装置]
図2には、前記画像処理装置30の機能ブロック図が示されている。
[Image processing device]
FIG. 2 shows a functional block diagram of the image processing device 30.

実施例の画像処理装置30は、最適しきい値設定手段32と、誤差補正手段34と、二値化手段36とを含んで構成される。   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.

前記最適しきい値設定手段32および誤差補正手段34には、注目画素の多階調画像データ200として、i行j列目の画素P[i,j]のデータdata(i,j)が入力されている。   The data (i, j) of the pixel P [i, j] of the i-th row and the j-th column is input to the optimum threshold value setting means 32 and the error correction means 34 as the multi-tone image data 200 of the target pixel. Have been.

前記最適しきい値設定手段32は、この注目画素P[i,j]の多階調画像データ200を二値化するのに用いるslsh(i,j)を、注目画素の多階調画像データdata(i,j)に応じ、次式に基づき設定する。   The optimum threshold value setting means 32 converts slsh (i, j) used for binarizing the multi-tone image data 200 of the target pixel P [i, j] into the multi-tone image data of the target pixel. Set according to the following equation according to data (i, j).

slsh(i,j)=(data(i,j)*(K−1)+128)/K …(1)
ここで、Kは、2以上の整数で表される定数である。
slsh (i, j) = (data (i, j) * (K-1) +128) / K (1)
Here, K is a constant represented by an integer of 2 or more.

前記誤差補正手段34は、注目画素P[i,j]の多階調画像データdata(i,j)を、周辺画素の二値化によって生じる二値化誤差に基づき誤差拡散法を用いて補正し、補正画素データdata c(i,j)として二値化手段36へ向け出力する。   The error correction means 34 corrects the multi-tone image data data (i, j) of the target pixel P [i, j] using an error diffusion method based on a binarization error generated by binarization of peripheral pixels. Then, the corrected pixel data is output to the binarizing unit 36 as corrected pixel data data c (i, j).

二値化手段36は、入力される注目画素P[i,j]の補正画素データdata c(i,j)を、しきい値slsh(i,j)と比較して二値化し、その二値化結果result(i,j)を2階調画像データ230として出力する。すなわち、補正画素データを、次のように二値化して出力する。   The binarizing means 36 binarizes the input corrected pixel data data c (i, j) of the target pixel P [i, j] by comparing it with a threshold value slsh (i, j). The binarization result result (i, j) is output as two-tone image data 230. That is, the correction pixel data is binarized and output as follows.

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を含んで構成される。
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 means 34 of the embodiment includes a data correction means 38, an error diffusion means 40, and a diffusion error storage means 42.

前記拡散誤差記憶手段42は、原画像の各画素毎の拡散誤差積算値total err
(n,m)を記憶している。
The diffusion error storage means 42 stores a diffusion error integrated value total err for each pixel of the original image.
(N, m) is stored.

そして、誤差拡散手段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)に加算する。
Then, the error diffusion means 40 first calculates a binarization error err based on 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)
Ask as follows. 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 target pixel 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. . It is assumed that an error diffusion weight matrix as shown in FIG. * In FIG. 3 indicates a target pixel. Since the total value of the weights is 16, the value obtained by multiplying the binarization error at the pixel of interest by the weight value corresponding to the pixel position to be distributed and dividing the result by 16 as follows is total err (m, n) ).

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]の二値化に伴う誤差拡散は終わる。
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 by the above steps.

以上の工程を、二値化手段36から二値化結果が出力される毎に繰り返して行う。なお、誤差拡散法の重みマトリクスの例としてはこれ以外にも、必要に応じ、例えば図3(b)、図3(c)など各種のものを採用することができる。   The above steps are repeated each time a binarization result is output from the binarization means 36. In addition, as examples of the weight matrix of the error diffusion method, various types such as, for example, FIGS. 3B and 3C can be adopted as needed.

そして、データ補正手段38は、注目画素P[i,j]の多階調画像データdata(i,j)が入力されると、その注目画素P[i,j]に対応した拡散誤差積算値total err(i,j)を拡散誤差記憶手段42から読み出し、これを次式に基づき注目画素の多階調画像データdata(i,j)に加え、補正画像データdata
c(i,j)を求める。
When the multi-gradation image data data (i, j) of the target pixel P [i, j] is input, the data correction unit 38 calculates the diffusion error integrated value corresponding to the target pixel P [i, j]. The total err (i, j) is read from the diffusion error storage means 42, and is added to the multi-gradation image data data (i, j) of the pixel of interest based on the following equation to obtain corrected image data data
Find c (i, j).

data c(i,j)=data(i,j)+total err(i,j) …(5)
このような動作を、全画素について繰り返し行うことで、全画面の二値化を行う。
data c (i, j) = data (i, j) + total err (i, j)… (5)
By repeating such an operation for all pixels, binarization of the entire screen is performed.

[第1,第2の問題点の解消]
このようにして、実施例の画像処理装置30は、入力される注目画素の多階調画像データ200を、誤差拡散法を用い、中間調表示可能な0階調値および255階調値のみからなる2階調画像データ230に変換出力する。
[Solution of first and second problems]
In this way, the image processing apparatus 30 of the embodiment converts the input multi-tone image data 200 of the target pixel from only the 0 tone values and the 255 tone values that can be displayed in a half tone using the error diffusion method. Is converted and output into two-tone image data 230.

本実施例の画像処理装置30の特徴は、低濃度領域や高濃度領域で多量の二値化誤差の蓄積が生じていたのを、最適しきい値設定手段32を用い解消し、それに起因して発生していた、低濃度領域または高濃度領域の立上り部でのドット生成の遅延や、低濃度領域または高濃度領域が終わった後の尾引き等の問題を解消したことにある。   The feature of the image processing apparatus 30 of the present embodiment is that the large amount of binarization errors accumulated in the low-density region or the high-density region is eliminated by using the optimum threshold value setting means 32. It is an object of the present invention to solve problems such as delay of dot generation at a rising portion of a low-density area or a high-density area and tailing after the end of a low-density area or a high-density area.

以下、本実施例の画像処理装置によって、前述した第1の問題点(ドット生成の遅延)および第2の問題点(尾引きの問題)の双方が解決される理由について説明する。   Hereinafter, the reason why both the first problem (the delay of dot generation) and the second problem (the problem of tailing) described above are solved by the image processing apparatus of this embodiment will be described.

本発明者は、まず、前記第1および第2の問題点の原因の解明を行った。このために、図2に示す画像処理装置30において、最適しきい値設定手段32が設定する二値化しきい値を128に固定し、しかも画像データ200として、全画素が一定階調値であるような画像のデータを入力した。そして、前記数式(5)で原画像データに加えられる二値化誤差err(i,j)の平均値がどうなるかを調べてみた。   The inventor first clarified the causes of the first and second problems. For this reason, in the image processing device 30 shown in FIG. 2, the binarization threshold value set by the optimum threshold value setting means 32 is fixed at 128, and all the pixels have a constant gradation value as the image data 200. Entered such image data. Then, it was examined how the average value of the binarization error err (i, j) added to the original image data in the above equation (5).

具体的には、図2に示す実施例の画像処理装置から最適しきい値設定手段32を取り除き、二値化しきい値を128にほぼ固定した。そして、図4に示すよう、原画像サイズが600画素×400画素であり、全画素が一定の階調値であるような原画像160を、その左上隅を出発点として二値化処理した。そして、ドット形成が安定状態に達したと思われる、右下隅の200画素×100画素の領域170について、前記数式(5)で原画像データに加えられる二値化誤差err(i,j)の平均値を、平均二値化誤差として求めた。ただし、しきい値は128に完全固定ではなく、特定の規則的パターンが生じる事態を回避する目的で、プラスマイナス6の範囲の少量のランダムノイズを加えてある。このノイズは、原画像データが本例のようにコンピュータで作り出した人工的なデータの場合に、パターンが規則的に生じるのを防ぐために付加したものである。   Specifically, the optimum threshold value setting means 32 was removed from the image processing apparatus of the embodiment shown in FIG. 2, and the binarization threshold value was almost fixed at 128. Then, as shown in FIG. 4, an original image 160 having an original image size of 600 × 400 pixels and all pixels having a constant gradation value was subjected to a binarization process with the upper left corner as a starting point. Then, for a region 170 of 200 pixels × 100 pixels at the lower right corner where it is considered that dot formation has reached a stable state, the binarization error err (i, j) added to the original image data by the above equation (5) is obtained. The average was determined as the 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 in order to prevent a pattern from occurring regularly when the original image data is artificial data generated by a computer as in this example.

図5には、以上の実験を、異なる階調値の原画像160について行った結果を表したものである。この実験結果から明らかなように、原画像160は、その階調値が1〜4という低濃度のものや、階調値が251〜254という高濃度のものでは、その平均二値化誤差が0になるどころか、絶対値で100にも達するような大きな値となっていることがわかる。平均二値化誤差は、定常状態における誤差の拡散、蓄積量の期待値に相当するものである。誤差拡散法は、二値化誤差の局所的平均値を最小にする手法であると考えられているから、低濃度領域や高濃度領域で平均二値化誤差が0ではなく、このような絶対値の大きな値を取るということは、非常に興味深い発見であった。   FIG. 5 shows the results of the above experiment performed on the original images 160 having different gradation values. As is clear from the experimental results, the average binarization error of the original image 160 is low when the tone value is as low as 1 to 4 or when the tone value is as high as 251 to 254. It can be seen that, instead of being zero, the absolute value is as large as 100. The average binarization error corresponds to the expected value of the amount of error diffusion and accumulation in a steady state. Since the error diffusion method is considered to be a method of minimizing the local average value of the binarization error, the average binarization error is not zero in a low density region or a high density region. Taking a large value was a very interesting finding.

この図5に示す実験データから、前述した第1および第2の問題点の生じるメカニズムを、次のように解析することができる。   From the experimental data shown in FIG. 5, the mechanism that causes the first and second problems described above can be analyzed as follows.

(1)原画像160の階調値が、1〜8や、247〜254というように0または255近辺の値をとる場合には、二値化しきい値を128のように固定すると、ドットが安定して形成される定常状態に落ち着くまでには、平均二値化誤差の絶対値が80以上に達するような多量の誤差蓄積がなされる必要がある。特に、階調値が1〜4や251〜254の値の原画像データ160では、ドットが安定して形成される定常状態に落ち着くまでに、100以上の多量の誤差が蓄積される必要がある。この誤差蓄積量は、多階調画像データ200の濃度値が二値化濃度値である0および255に近付くほど大きくなる。   (1) When the gradation value of the original image 160 takes a value near 0 or 255, such as 1 to 8, or 247 to 254, if the binarization threshold is fixed at 128, the dot becomes A large amount of error accumulation needs to be performed so that the absolute value of the average binarization error reaches 80 or more before reaching a stable and steady state. In particular, in the original image data 160 having a gradation value of 1 to 4 or 251 to 254, a large amount of error of 100 or more needs to be accumulated before the dot settles in a steady state in which dots are formed stably. . The error accumulation amount increases as the density value of the multi-tone image data 200 approaches the binarized density values 0 and 255.

(2)誤差の蓄積時間
また、画像データの濃度が0付近の値の場合、それを0に二値化してもわずかな二値化誤差しか生じない。そのため、この二値化誤差が拡散・蓄積して80〜100前後の値に達するまでには、かなりの蓄積期間が必要となる。また、画像データの濃度が255付近の値の場合にも、その二値化誤差が拡散・蓄積して、80〜100前後の値に達するまでには、同様にかなりの蓄積期間が必要となる。しかも、蓄積速度も、画像データの濃度値が二値化濃度値である0および255に近付くほど遅くなる。
(2) Accumulation time of error When the density of the image data is a value near 0, even if it is binarized to 0, only a small binarization error occurs. Therefore, a considerable accumulation period is required until the binarization error diffuses and accumulates to reach a value of about 80 to 100. 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 around 80 to 100. . Moreover, the accumulation speed becomes slower as the density value of the image data approaches the binarized density values of 0 and 255.

(3)第1の問題点
誤差が蓄積されて、定常状態での蓄積量に達するまでの蓄積期間中は、ドットは形成されない。このため、ドット形成のために多量の誤差蓄積量が必要とされ、しかも、必要とされる誤差蓄積量に達するまでにかなりの蓄積期間が必要になると、ドット生成の遅延が発生することになる。これが、第1の問題の原因となる。
(3) First Problem Dots are not formed during the accumulation period in which errors accumulate and reach the accumulation amount in a steady state. For this reason, if a large amount of error accumulation is required for dot formation, and a considerable accumulation period is required until the required error accumulation amount is reached, dot generation will be delayed. . This causes the first problem.

(4)第2の問題点
ドット形成のために多量の誤差蓄積量が必要になると、多量に蓄積された誤差が、領域外部にまで拡散されて周辺の画像データを歪ませる。これが、第2の問題の原因となり、前述した尾引きの問題が生じる。
(4) Second Problem If 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 to distort the surrounding image data. This causes the second problem, and the above-described problem of tailing occurs.

以上、(1)〜(4)で述べたように、画像データが二値化濃度値である0および255付近の値をとる場合に、平均二値化誤差が非常に大きな絶対値を取り、「誤差の蓄積」現象が生じる。この「誤差の蓄積」現象が、前記第1および第2の問題点の発生原因である。   As described above, as described in (1) to (4), when the image data takes values near the binarized density values 0 and 255, the average binarization error takes an extremely large absolute value, The "accumulation of error" phenomenon occurs. This "accumulation of errors" phenomenon is the cause of the first and second problems.

本実施例の画像処理装置において、最適しきい値設定手段32は、この「誤差の蓄積」という根本原因を解消し、前記第1および第2の問題点を本質的に解決するものである。すなわち、原画像データ200が低濃度の時には、二値化しきい値を小さく、高濃度の時にはしきい値を大きくするようにして、原画像データ200の濃度に応じて二値化しきい値を最適化することで、「誤差の蓄積」自体を解消しつつ、「誤差の蓄積」なしでドット生成を行うことを可能とするものである。   In the image processing apparatus of the present embodiment, the optimum threshold value setting means 32 solves the root cause of "accumulation of errors" and essentially solves the first and second problems. That is, when the original image data 200 has low density, the binarization threshold value is small, and when the original image data 200 has high density, the threshold value is increased. This makes it possible to perform dot generation without “accumulation of errors” while eliminating “accumulation of errors” itself.

ここで、「低濃度領域でのしきい値を勝手に小さくしたりすると、255(黒ドット)に二値化される画素が増えて、濃度が大幅に上昇してしまうのではないか?」というような疑問が生じるかもしれない。確かに誤差拡散を行わない一般のディザ法においてはしきい値の変動は即濃度の変化に繋がる。しかし、本発明者が確認したところでは、誤差拡散法ではしきい値を変えてもトータルでの出力濃度はほとんど変動しなかった。すなわち、しきい値を128に固定して二値化した場合と、64や192に固定して二値化した場合とで、出力濃度はほとんど変わらないのである。これは、誤差拡散法では二値化誤差を捨て去ることなく、周辺の未二値化画素に拡散させるためである。例えば、しきい値を小さくしたために従来ならば0に二値化されていた画素が255に二値化される事態が生じても、その画素にはより絶対値の大きな負の二値化誤差が生じる。それが周辺の未二値化画素に拡散され、周辺画素階調レベルを下げる方向に働いて帳尻を合わせる。   Here, "If the threshold value in the low-density region is reduced arbitrarily, may the number of pixels binarized to 255 (black dots) increase, resulting in a significant increase in density?" Such a question may arise. Certainly, in a general dither method in which error diffusion is not performed, a change in the threshold immediately leads to a change in density. However, the present inventor has confirmed that 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 is fixed at 128 and binarization and the case where the threshold is fixed at 64 or 192. This is because in the error diffusion method, the binarization error is diffused to surrounding non-binarized pixels without being discarded. For example, even if a pixel that was previously binarized to 0 due to a reduced threshold value is binarized to 255, the pixel has a negative binarization error having a larger absolute value. Occurs. It is diffused to the peripheral non-binarized pixels, and works in the direction of lowering the peripheral pixel gradation level to adjust the balance.

図6には、本実施例による「誤差の蓄積」の解消効果が示されている。すなわち、図6は、本実施例の最適しきい値設定手段32を用いた場合に、図5と同様にして調べた平均二値化誤差がどのようになるかを明らかにしたもので、図5に示したしきい値が128固定の場合に加えて、本実施例の数式(1)におけるKの値を、2,4,8,∞とした場合の結果がプロットしてある。K=∞の場合、slsh=dataとなる。ただし図6の場合も、図5の場合同様、数式(1)で決まったしきい値に、最大でプラスマイナス6の少量のランダムノイズを加えている。   FIG. 6 shows the effect of eliminating “accumulation of errors” according to this embodiment. That is, FIG. 6 clarifies how the average binarization error examined in the same manner as in FIG. 5 when the optimum threshold value setting means 32 of the present embodiment is used. In addition to the case where the threshold value shown in FIG. 5 is fixed at 128, the result when the value of K in the equation (1) of the present embodiment is set to 2, 4, 8, and ∞ is plotted. If K = ∞, slsh = data. However, in the case of FIG. 6, as in the case of FIG. 5, a small amount of random noise of at most ± 6 is added to the threshold value determined by the equation (1).

図6より、K=2、すなわち、slsh=(data+128)/2とすれば、平均二値化誤差が最大でも50以下と半分以下に減少し、誤差の蓄積量を大きく減少させる効果があるのがわかる。さらに、K=4とすると、全体的に平均二値化誤差が0に近付き、K=8とすると、画像データの濃度が1,2や253,254といった0や255に極めて近い階調値の場合でも、平均二値化誤差はほぼ0になる。   According to FIG. 6, if K = 2, that is, slsh = (data + 128) / 2, the average binarization error is reduced to 50 or less and 50% or less at the maximum, and there is an effect of greatly reducing the accumulated amount of error. I understand. Further, when K = 4, the average binarization error approaches 0 as a whole, and when K = 8, the gradation value of the image data density is very close to 0 or 255, such as 1, 2, 253, 254. Even in this case, the average binarization error becomes almost zero.

図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の問題点を解決することができる。
Based on the two-tone image data 23 output from the image processing device 30 shown in FIG. 1, an experiment was performed to actually print using a printer and evaluate the effect of the “tailing” of the second problem described above. went. As a result of this evaluation experiment, it was confirmed that by suppressing the absolute value of the average binarization error to 50 or less, the influence of the “tailing” of the second problem can be significantly reduced. From this, by setting the value of K in the equation (1) to a range of K = 2 to ∞, that is, by setting the threshold value slsh in accordance with the gradation value of the image data data,
When data <128, data ≦ slsh ≦ (128 + data) / 2
When data> 128, the absolute value of the average binarization error can be reduced to 50 or less by setting the range of (128 + data) / 2 ≦ slsh ≦ data (6). Can be solved.

次に、前記第1の問題点の「ドット生成遅れ」の影響を評価する実験も行った。この実験の結果、ドット生成遅れも、平均二値化誤差が減るに従って改善されることが確認された。前記数式(1)のKを大きくしすぎると、平均二値化誤差が0を越えて、その符号が逆転してしまう「過補正状態」が生じる。しかし、実際の印字結果の主観評価では、やや過補正状態にまでドット生成速度を早めたほうが、印字強調的な効果が生じて好ましい画質になった。data値が、1,2や253,254といったドット生成の遅れの最も大きいデータ領域の再現性を重視した主観評価結果では、K=8〜24程度の範囲が非常に良好で、K=16は最適であった。   Next, an experiment was conducted to evaluate the effect of the first problem, that is, the "dot generation delay". As a result of this experiment, it was confirmed that the dot generation delay was improved as the average binarization error was reduced. If K in the above equation (1) is too large, the average binarization error exceeds 0, and the "overcorrection state" occurs in which the sign is reversed. However, in the subjective evaluation of the actual print result, the higher the dot generation speed up to a slightly overcorrected state, the more the print emphasis effect was obtained, and the preferable image quality was obtained. According to the subjective evaluation result that emphasizes the reproducibility of the data area where the data value has the largest delay of dot generation such as 1, 2, 253, and 254, the range of about K = 8 to 24 is very good. It was optimal.

図7には、平均二値化誤差が常に0になる二値化しきい値が示されている。この二値化しきい値は、図6を基にして補間演算による推定値として求めた。   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 an interpolation operation based on FIG.

実施例の画像処理装置の最適しきい値設定手段32を、図7に基づいて原画像データから二値化しきい値を決定するように形成すれば、前記第2の問題点の「尾引き」の期待値が0になる最良の最適しきい値設定手段が実現できる。なお、図7には、同時に、数式(1)のKの値が2,8,∞の場合の特性図が描かれている。これらの特性曲線から、Kの値をK=8前後に設定した場合に、平均二値化誤差を0にするための好適な近似値が得られることがわかる。また、先に述べたように、第1の問題点のドット生成の遅延の改善の点から、平均二値化誤差が0を越えて符号が逆転した「過補正状態」気味のほうがよい主観評価が得られる場合があり、主観評価では、K=16程度の近似式を用いた場合に最良の結果が得られた。K=∞までいくと、データ変化部のエッジがかなり強調される結果となるが、これも画像の使用目的によっては十分に有用なものとなる。   If the optimum threshold value setting means 32 of the image processing apparatus according to 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 can be solved. The best optimal threshold value setting means for which the expected value of becomes 0 can be realized. Note that FIG. 7 also shows a characteristic diagram when the value of K in Expression (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 setting the average binarization error to 0 can be obtained. Also, as described above, from the viewpoint of improving the dot generation delay, which is the first problem, the subjective evaluation is better in the "overcorrected state" where the average binary error exceeds 0 and the sign is reversed. May be obtained. In the subjective evaluation, the best result was obtained when an approximate expression of K = 16 was used. When K = ∞, the edge of the data change portion is considerably enhanced, but this is also sufficiently useful depending on the use purpose of the image.

また、図7では、原画像データ200が0または255の場合の最適しきい値を128としたが、データ階調値と二値化結果値が等しい場合のしきい値は、どのように設定しても大差なくなる。したがって、本実施例の最適しきい値設定手段32でも、データ値が0または255の場合には、しきい値をどのように設定してもよい。   Further, in FIG. 7, the optimum threshold value when the original image data 200 is 0 or 255 is set to 128, but how the threshold value is set when the data gradation value and the binarization result value are equal is set. Even if there is no big difference. Therefore, even when the data value is 0 or 255, the optimum threshold value setting means 32 of this embodiment may set the threshold value in any manner.

このように、本実施例によれば、多階調画像データ200を誤差拡散法を用いて、中間調表示可能な2階調画像データ230に変換出力するとともに、その二値化処理に使用する二値化しきい値を、多階調画像データ200の階調値に基づき、前記数式(6)の範囲に設定することにより、前記第1および第2の問題点を、画質劣化に繋がる副作用なしに根本的に解決することができた。   As described above, according to the present embodiment, the multi-tone image data 200 is converted into two-tone image data 230 capable of halftone display using the error diffusion method, and is used for the binarization processing. By setting the binarization threshold value in the range of the expression (6) based on the gradation value of the multi-gradation image data 200, the first and second problems can be solved without side effects that lead to image quality deterioration. Could be solved fundamentally.

しかも、本実施例によれば、数式(1)の定数Kの設定の仕方により、所望の特性をもった二値化出力画像を得ることができる。   Moreover, according to the present embodiment, a binarized output image having desired characteristics can be obtained by setting the constant K in Expression (1).

なお、図6,図7に示した補正データは、図3(a)に示した誤差拡散重みマトリクスを用いて誤差拡散した場合の例である。異なる重みマトリクスを用いた場合は、定量的には多少異なった結果が得られるが、定性的な傾向はほとんど変わりがない。このように、本発明は、異なる誤差拡散重みマトリクスを用いた場合にも、有効である。   Note that the correction data shown in FIGS. 6 and 7 is an example in the case where error diffusion is performed using the error diffusion weight matrix shown in FIG. When different weight matrices are used, quantitatively slightly different results are obtained, but the qualitative tendency is almost the same. Thus, the present invention is effective even when different error diffusion weight matrices are used.

[本実施例と従来例との比較]
本実施例と同様に、原画像データ200の階調値に応じて、二値化しきい値を変化させるものとしては、特開平4−154370号公報の「画像処理装置及び画像処理方法」があった。しかし、この手法は、文字・線画部でのノイズの抑制に主目的をおいて、「原画濃度データが大きいほど、小さい二値化しきい値が対応させられる」ように、本実施例とは正反対の方向にしきい値を変化させるものであり、第1,第2の問題点の改善効果はほとんどなかった。なお、二値化手法に平均誤差最小法を用いた例については、特開平4−154370号公報を参照すればよい。
[Comparison between the present embodiment and the conventional example]
As in the present embodiment, an image processing apparatus and image processing method disclosed in Japanese Patent Application Laid-Open No. 4-154370 is one that changes the binarization threshold value according to the gradation value of the original image data 200. Was. However, this method has the main purpose of suppressing noise in the character / line image portion, and is the opposite of the present embodiment, such 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 on the first and second problems. It should be noted that Japanese Patent Application Laid-Open No. 4-154370 may be referred to for an example in which the average error minimum method is used for the binarization method.

図12は、図2に示す本実施例の画像処理装置30を用いて、図3に示す原画像100をした場合の出力例を示す図である。図14で問題となった、ドット生成の遅延や、低濃度領域120からの尾引きによる直線130の中央部の消失等の問題点が、完璧に解消しているのがわかる。   FIG. 12 is a diagram illustrating an output example when the original image 100 illustrated in FIG. 3 is formed using the image processing apparatus 30 according to the present embodiment illustrated in FIG. It can be seen that the problems such as the delay in dot generation and the disappearance of the center of the straight line 130 due to the tailing from the low density region 120, which were problems in FIG. 14, have been completely solved.

このように、本実施例によれば、第1,第2の問題点を理想的に解決できることが確認された。さらに、本実施例によれば、有害な副作用を伴うことなく、第1,第2の問題点を解決できることも確認できた。   As described above, according to the present embodiment, it was confirmed that the first and second problems can be ideally solved. Furthermore, according to the present example, it was confirmed that the first and second problems could be solved without any harmful side effects.

[最適しきい値設定手段の他の実施例]
前記実施例において、最適しきい値設定手段32は、数式(1)に基づき二値化しきい値の設定を行っている。本発明はこれに限らず、必要に応じて他の手法を用い二値化しきい値の設定を行うようにしてもよい。
[Another Embodiment of Optimal Threshold Setting Means]
In the above embodiment, the optimal threshold value setting means 32 sets the binarization threshold value based on the equation (1). The present invention is not limited to this, and the binarization threshold may be set using another method as needed.

図8には、最適しきい値設定手段32の他の実施例が示されている。   FIG. 8 shows another embodiment of the optimum threshold value setting means 32.

本実施例の最適しきい値設定手段32は、注目画素の多階調画像データ200として入力されるデータdata[i,j]に基づき、次式に示すようにしてしきい値を設定するように形成されている。   The optimum threshold value setting means 32 of this embodiment sets a threshold value as shown in the following equation based on data data [i, j] input as the multi-tone image data 200 of the target pixel. Is formed.

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)が満たされればよい。
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 optimal if they are in the 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 the equation (6).
When data <128, data ≦ slsh ≦ (128 + data) / 2
When data> 128, (128 + data) / 2 ≦ slsh ≦ data
However, the first and second problems to be solved by the present invention are particularly remarkable when data is a value near 0 or 255 (excluding 0 and 255). It is. Therefore, Expression (6) does not need to be satisfied in the entire data area, and Expression (6) only needs to be satisfied when data is 0 or a value near 255.

したがって、二値化しきい値を、前記数式(7)に示すように設定することによっても、前記第1および第2の問題点を解決し、前記第1実施例と同様に良好な二値化画像を得ることができる。   Therefore, the first and second problems can be solved by setting the binarization threshold as shown in the equation (7), and the binarization threshold can be improved as in the first embodiment. Images can be obtained.

図8には、最適しきい値設定手段32のさらに別の実施例が示されている。   FIG. 8 shows still another embodiment of the optimum threshold value setting means 32.

実施例の最適しきい値設定手段32では、原画像データ200の階調値に応じ、二値化しきい値を連続的ではなく、段階的に設定する。このようにしても、前記実施例と同様に第1および第2の問題点を解決し、良好な二値化画像を得ることができる。   The optimum threshold value setting means 32 of the embodiment sets the binarization threshold value stepwise, not continuously, according to the gradation value of the original image data 200. Even in this case, the first and second problems can be solved in the same manner as in the above embodiment, and a good binary image can be obtained.

また、図10には、最適しきい値設定手段32のさらに別の実施例が示されている。実施例の最適しきい値設定手段32は、低濃度領域のみに、本発明の特徴とするしきい値最適化動作が働くように形成されている。すなわち、画像データ200のしきい値が高濃度領域側にある場合には、二値化しきい値は128に固定され、画像データ200が低濃度領域側の0近辺の値にあった時に、最適しきい値を前記数式(6)を満足するように設定するよう形成されている。   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 optimizing operation characteristic of the present invention operates only in the low density region. That is, when the threshold value of the image data 200 is on the high density area side, the binarization threshold value is fixed at 128, and when the image data 200 is near 0 on the low density area side, the optimum The threshold value is set so as to satisfy Expression (6).

例えば、ドットの滲み量の大きいプリンタ装置では、高濃度部の孤立した白ドットがほとんど潰れてしまうため、高濃度部では、第1の問題点がもともと顕著に現われない。そのため、第1の問題点が目立ちやすい低濃度部のみを、本発明により改善しようとするものである。   For example, in a printer device having a large amount of dot bleeding, isolated white dots in a high-density portion are almost completely crushed, so that the first problem does not appear remarkably in a high-density portion. Therefore, the present invention is intended to improve only the low-density portion where the first problem is conspicuous.

なお、画像出力装置の特性に応じ、これとは逆に高濃度部領域のみに本発明のしきい値最適化動作が働くように形成してもよい。   It should be noted that, depending on the characteristics of the image output device, the threshold value optimization operation of the present invention may be performed only in the high-density portion region.

このように、本発明の最適しきい値設定手段32は、その画像出力装置に応じて、必要な原画像濃度領域にのみ、最適しきい値設定するように形成してもよい。   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 area according to the image output device.

[しきい値設定手段の具体例]
前述した各実施例における最適しきい値設定手段32は、原画像データから二値化しきい値を設定するために、前記した数式(1)のような演算をその都度行うように形成してもよく、また原画像データの階調値と二値化しきい値との対応関係をあらかじめ変換テーブル内に記憶しておき、それを参照するように形成してもよい。
[Specific example 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 an operation such as the above-described formula (1) each time to set a binarization threshold value from original image data. Alternatively, the correspondence between the gradation value of the original image data and the binarization threshold may be stored in a conversion table in advance, and the conversion table may be referred to.

図11には、最適しきい値設定手段32を、ROMを用いて構成した具体例が示されている。ROMのアドレスバスA0〜A7に8ビット原画像データを入力すると、それに対応した8ビットの二値化しきい値がデータバスD0〜D7に出力されるよう形成されている。   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 address buses A0 to A7 of the ROM, the corresponding 8-bit binarization threshold is output to the data buses D0 to D7.

また、各実施例の中には、最適しきい値設定手段32によって設定された二値化しきい値に、さらに少量のランダムノイズを加えている例があった。これは、原画像データが、コンピュータ等で描いた非常に整然としたデータの場合に、誤差拡散法での二値化により特定の規則的パターンが生じてしまうことがあるのを防ぐために行うものである。したがって、原画像データが、階調値の適当なばらつきをもった自然画の場合には、このようなランダムノイズを加える処理は不必要になる。   Further, in each embodiment, there is an example in which a small amount of random noise is added to the binarization threshold value set by the optimum threshold value setting means 32. This is done to prevent a specific regular pattern from being generated due to binarization by the error diffusion method when the original image data is very ordered 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.

また、ランダムノイズを付加した結果、しきい値が数式(6)で示した範囲からはずれてしまうことがありうるが、しきい値の期待値が数式(6)の範囲に入っていればよいものとする。   Also, as a result of adding random noise, the threshold value may deviate from the range shown in Expression (6), but it is sufficient that the expected value of the threshold value falls within the range of Expression (6). Shall be.

また、しきい値ではなく、原画像データ側にノイズを付加しても、同様の効果が得られる。   Similar effects can be obtained by adding noise to the original image data instead of the threshold.

[他の実施例]
なお、本発明は前記各実施例に限定されるものではなく、本発明の要旨の範囲内で各種の変形実施が可能である。
[Other Examples]
Note that the present invention is not limited to the above embodiments, and various modifications can be made within the scope of the present invention.

例えば、前記実施例では、原画像データが0で白、255で黒となるような濃度データである場合を例にとり説明したが、原画像データが0で黒、255で白となるような、明度データである場合も、本発明を同様に適用できることはいうまでもない。   For example, in the above-described embodiment, the case where the original image data is density data such that it is 0, white, and black at 255 is described as an example. It is needless to say that the present invention can be similarly applied to brightness data.

また、原画像データが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が一致しない例もある。
In the case where the original image data takes a value in the range of AB (A> B) and the original image data is binarized to a or b (a> b), the first embodiment Equation (1)
slsh (i, j) = (data (i, j) * (K-1) + (a + b) / 2) / K… (1) '
And convert equation (2) 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 can be changed as follows. Generally, A = a and B = b. However, when the outputable density of the output device is significantly different from the range of the original image data, A and a, and B and b may not match.

この場合、数式(6)のしきい値設定のための条件式は、m=(a+b)/2として、
data<mの時にはdata≦slsh≦(m+data)/2
data>mの時には(m+data)/2≦slsh≦data …(8)
のようになる。
In this case, the conditional expression for setting the threshold value of Expression (6) is m = (a + b) / 2,
When data <m, data ≦ slsh ≦ (m + data) / 2
(m + data) / 2 ≦ slsh ≦ data when data> m (8)
become that way.

また、前記実施例では、多階調画像データ200を、誤差拡散法を用いて補正する場合を例にとり説明したが、本発明はこれに限らず、平均誤差最小法を用いて補正する場合にも適用できる。   Further, 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. However, the present invention is not limited to this. Is also applicable.

図18には、平均誤差最小法を用いた画像処理装置30の好適な実施例が示されている。なお、図2に示す前記実施例と対応する部材には同一の符号を付しその説明は省略する。   FIG. 18 shows a preferred embodiment of the image processing apparatus 30 using the minimum average error method. The members corresponding to those in the embodiment shown in FIG. 2 are denoted by the same reference numerals, and the description thereof will be omitted.

本実施例において、誤差補正手段34は、データ補正手段38と、誤差計算手段44と、誤差記憶手段46とを含んで構成される。   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.

前記誤差計算手段44は、前記数式(3)に基づき、注目画素の二値化誤差errを演算し、誤差記憶手段46の注目画素に対応したアドレスにその値を書き込むよう形成されている。この結果、誤差記憶手段46の各画素アドレスに対応した記憶エリアには、二値化済みの画素の二値化誤差が順次書き込み記憶されていく。   The error calculating means 44 is formed so as to calculate the binarization error err of the pixel of interest based on the formula (3), and write the value to an address of the error storage means 46 corresponding to the pixel of interest. As a result, the binarization errors of the binarized pixels are sequentially written and stored in the storage area corresponding to each pixel address of the error storage unit 46.

データ補正手段38は、注目画素P[i,j]の多階調画像データdata(i,j)が入力されると、その注目画素P[i,j]近傍の二値化済みの画素の誤差を誤差記憶手段46から読み出す。そして、読み出した誤差データに所定の重みを付けをして平均誤差を求め、この平均誤差を注目画素の多階調画像データdata(i,j)に加え、これを補正画像データdata c(i,j)として二値化手段36へ向け出力する。   When the multi-tone image data data (i, j) of the target pixel P [i, j] is input, the data correction unit 38 determines the binarized pixels near the target pixel P [i, j]. The error is read from the error storage means 46. Then, a predetermined weight is given to the read error data to obtain an average error, the average error is added to the multi-gradation image data data (i, j) of the pixel of interest, and this is corrected image data data c (i , J) to the binarizing means 36.

なお、これ以外の構成は、前記第1実施例と同様であるので、ここではその説明は省略する。   Since the other configuration is the same as that of the first embodiment, the description is omitted here.

このような平均誤差最小法を用いた場合でも、前記第1実施例と同様な効果を奏することができる。   Even when such an average error minimizing method is used, the same effect as in the first embodiment can be obtained.

本発明が適用された画像処理システムの概略説明図である。FIG. 1 is a schematic explanatory diagram of an image processing system to which the present invention has been applied. 図1に示す画像処理システムに用いられる画像処理装置の機能ブロック図である。FIG. 2 is a functional block diagram of an image processing device used in the image processing system shown in FIG. 1. 本実施例で用いられる拡散重みマトリクスの具体例の説明図である。FIG. 5 is an explanatory diagram of a specific example of a diffusion weight matrix used in the embodiment. 平均二値化誤差を求めるために使用した原画像データと、平均二値化誤差を求める領域との関係を示す説明図である。FIG. 9 is an explanatory diagram showing a relationship between original image data used for obtaining an average binarization error and a region for obtaining the average binarization error. 原画像データの階調値と、平均二値化誤差の関係を示す説明図である。FIG. 5 is an explanatory diagram showing a relationship between a tone value of original image data and an average binarization error. 本発明の第1実施例で、平均二値化誤差がどのように発生するかを示す説明図である。FIG. 4 is an explanatory diagram showing how an average binarization error occurs in the first embodiment of the present invention. 平均二値化誤差が常に0になる二値化しきい値の説明図である。FIG. 9 is an explanatory diagram of a binarization threshold value at which an average binarization error is always zero. 本発明に用いられるしきい値設定手段の他の実施例の説明図である。FIG. 11 is an explanatory diagram of another embodiment of the threshold value setting means used in the present invention. 本発明に用いられるしきい値設定手段の他の実施例の説明図である。FIG. 11 is an explanatory diagram of another embodiment of the threshold value setting means used in the present invention. 本発明に用いられるしきい値設定手段の他の実施例の説明図である。FIG. 11 is an explanatory diagram of another embodiment of the threshold value setting means used in the present invention. 本発明に用いられるしきい値設定手段をハードウェアにて構成した例の説明図である。FIG. 3 is an explanatory diagram of an example in which a threshold setting unit used in the present invention is configured by hardware. 本発明の画像処理装置を用いて得られる二値化結果の説明図である。FIG. 9 is an explanatory diagram of a binarization result obtained by using the image processing device of the present invention. 図12,図14に示す二値化画像を得るために用いた原画像の説明図である。FIG. 15 is an explanatory diagram of an original image used to obtain the binarized images shown in FIGS. 従来の誤差拡散法により得られた、二値化結果の説明図である。FIG. 11 is an explanatory diagram of a binarization result obtained by a conventional error diffusion method. 本発明の画像処理装置を組み込んだ画像処理システムの全体概略説明図である。FIG. 1 is an overall schematic explanatory diagram of an image processing system incorporating an image processing apparatus of the present invention. 図15のシステムの他の実施例の説明図である。FIG. 16 is an explanatory diagram of another embodiment of the system in FIG. 15. 図15のシステムの他の実施例の説明図である。FIG. 16 is an explanatory diagram of another embodiment of the system in FIG. 15. 多階調画像データの補正に平均誤差最小法を用いる画像処理装置の実施例のブロック図である。FIG. 2 is a block diagram of an embodiment of an image processing apparatus that uses a minimum average error method for correcting multi-tone image data.

符号の説明Explanation of reference numerals

30 画像処理装置、 32 しきい値設定手段、 34 誤差補正手段、
36 二値化手段、 38 データ補正手段、 40 誤差拡散手段、
42 拡散誤差記憶手段、 200 多階調画像データ
30 image processing apparatus, 32 threshold value setting means, 34 error correction means,
36 binarization means, 38 data correction means, 40 error diffusion means,
42 diffusion error storage means, 200 multi-gradation image data

Claims (10)

多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理装置において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正手段と、
前記注目画素の多階調画像データの階調値に応じて2値化のためのしきい値に異なる値を設定し得るしきい値設定手段と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化手段と、
を有し、
所定の多階調画像データ領域において、所定の多階調画像データの階調値に対して設定するしきい値は、該所定の階調値よりも大きい階調値に対して設定するしきい値以下となる関係が成り立ち、
前記2値化手段は、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う画像処理装置。
The multi-tone image data is converted into two-tone image data including a first tone value and a second tone value (first tone value <second tone value) by using an error diffusion method or an average error minimum method. In an image processing apparatus for performing binarization conversion to
Error correction means for correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring binarized pixels, and outputting as corrected pixel data;
Threshold setting means for setting a different threshold value for binarization in accordance with the gradation value of the multi-gradation image data of the pixel of interest;
A binarizing unit that binarizes and converts the corrected pixel data into the binary image data based on the set threshold value;
Has,
In a predetermined multi-tone image data area, a threshold value set for a tone value of the predetermined multi-tone image data is a threshold set for a tone value larger than the predetermined tone value. The relationship below the value holds,
The binarizing means includes:
An image processing apparatus that performs a binarization process after adding random noise to a set threshold value or the corrected pixel data.
前記所定の多階調画像データの領域とは、
実質的に前記第1階調値から前記第2階調値の全ての範囲である請求項1記載の画像処理装置。
The area of the predetermined multi-tone image data is
The image processing apparatus according to claim 1, wherein substantially the entire range is from the first gradation value to the second gradation value.
前記所定の多階調画像データの領域とは、
前記第1階調値の近傍または前記第2階調値の近傍の少なくとも片方である請求項1記載の画像処理装置。
The area of the predetermined multi-tone image data is
The image processing apparatus according to claim 1, wherein at least one of the vicinity of the first gradation value and the vicinity of the second gradation value.
前記第1階調値と第2階調値の中間値をmとして、
前記所定の多階調画像データの領域とは前記第1階調値近傍であり、該所定の階調値よりも大きい階調値はm近傍であるか、または、
前記所定の多階調画像データの領域とは前記m近傍であり、該所定の階調値よりも大きい階調値は前記第2階調値近傍である、
の少なくとも片方を実質的に満たす請求項1記載の画像処理装置。
Assuming that an intermediate value between the first gradation value and the second gradation value is m,
The area of the predetermined multi-tone image data is near the first tone value, and a tone value larger than the predetermined tone value is near m, or
The predetermined multi-tone image data area is near the m, and a tone value larger than the predetermined tone value is near the second tone value.
2. The image processing apparatus according to claim 1, wherein at least one of the conditions is substantially satisfied.
多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第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値化処理を行う画像処理装置。
The multi-tone image data is converted into two-tone image data including a first tone value and a second tone value (first tone value <second tone value) by using an error diffusion method or an average error minimum method. In an image processing apparatus for performing binarization conversion to
Error correction means for correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring binarized pixels, and outputting as corrected pixel data;
Threshold setting means for setting a different threshold value for binarization in accordance with the gradation value of the multi-gradation image data of the pixel of interest;
A binarizing unit that binarizes and converts the corrected pixel data into the binary image data based on the set threshold value;
Where data is a gradation value of multi-gradation image data of the pixel of interest, m is an intermediate value between the first and second gradation values, and slsh is the threshold value.
The threshold setting means,
If data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
When data is a value near the second gradation value, (m + data) / 2 ≦ slsh ≦ data
Set the threshold slsh to satisfy any of
The binarizing means includes:
An image processing apparatus that performs a binarization process after adding random noise to a set threshold value or the corrected pixel data.
前記しきい値設定手段は、
slsh=(data*(K−1)+m)/K(ただし、Kは2以上の整数で表される定数)
を満たすようにしきい値slshを設定する請求項5記載の画像処理装置。
The threshold setting means,
slsh = (data * (K-1) + m) / K (where K is a constant represented by an integer of 2 or more)
6. The image processing apparatus according to claim 5, wherein the threshold value slsh is set so as to satisfy the following condition.
前記しきい値設定手段は、
前記階調値dataの値に応じて、前記しきい値slshを段階的に設定する請求項5記載の画像処理装置。
The threshold setting means,
6. The image processing apparatus according to claim 5, wherein the threshold value slsh is set stepwise according to the value of the gradation value data.
前記しきい値設定手段は、
data<m−L1の場合には、slsh=data+L1
m−L1<data<m+L2の場合には、slsh=m
m+L2<dataの場合には、slsh=data−L2
(ただし、L1,L2は0〜mの間の整数で表される定数)
を満たすようにしきい値slshを設定する請求項5記載の画像処理装置。
The threshold setting means,
If data <m−L1, slsh = data + L1
If m−L1 <data <m + L2, slsh = m
When m + L2 <data, slsh = data−L2
(However, L1 and L2 are constants represented by integers between 0 and m)
6. The image processing apparatus according to claim 5, wherein the threshold value slsh is set so as to satisfy the following condition.
多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第1階調値および第2階調値(第1階調値<第2階調値)からなる2階調画像データに2値化変換する画像処理方法において、
注目画素の多階調画像データを、周辺の既2値化済画素から拡散された誤差を加えて補正し、補正画素データとして出力する誤差補正工程と、
2値化のためのしきい値を設定するしきい値設定工程と、
前記設定されたしきい値に基づき、前記補正画素データを前記2階調画像データに2値化変換する2値化工程と、
を含み、所定の多階調画像データの階調値に対してしきい値設定工程において設定するしきい値は、該所定の階調値よりも大きい階調値に対して設定するしきい値よりも低い関係が所定の多階調画像データ領域において成り立ち、
前記2値化工程では、
設定されたしきい値または前記補正画素データにランダムノイズを加えた上で2値化処理を行う画像処理方法。
The multi-tone image data is converted into two-tone image data including a first tone value and a second tone value (first tone value <second tone value) by using an error diffusion method or an average error minimum method. In an image processing method for performing binarization conversion to
An error correction step of correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring binarized pixels and outputting the corrected pixel data;
A threshold setting step of setting a threshold for binarization;
A binarizing step of binarizing and converting the corrected pixel data into the binary image data based on the set threshold value;
Wherein the threshold value set in the threshold value setting step for the gradation value of the predetermined multi-tone image data is a threshold value set for a gradation value larger than the predetermined gradation value. Lower relationship holds in a given multi-tone image data area,
In the binarization step,
An image processing method of performing a binarization process after adding random noise to a set threshold value or the corrected pixel data.
多階調画像データを、誤差拡散法または平均誤差最小法を用いて、第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値化処理を行う画像処理方法。
The multi-tone image data is converted into two-tone image data including a first tone value and a second tone value (first tone value <second tone value) by using an error diffusion method or an average error minimum method. In an image processing method for performing binarization conversion to
An error correction step of correcting the multi-tone image data of the pixel of interest by adding an error diffused from neighboring binarized pixels and outputting the corrected pixel data;
A threshold setting step of setting a threshold for binarization;
A binarizing step of binarizing and converting the corrected pixel data into the binary image data based on the set threshold value;
Where the grayscale value of the multi-grayscale image data of the target pixel is data, the intermediate value between the first grayscale value and the second grayscale value is m, and the threshold is slsh,
In the threshold setting step,
determining whether data is a value near the first tone value or a value near the second tone value,
If data is a value near the first gradation value, data ≦ slsh ≦ (m + data) / 2
When data is a value near the second gradation value, (m + data) / 2 ≦ slsh ≦ data
Set the threshold slsh to satisfy
In the binarization step,
An image processing method of performing a binarization process after adding random noise to a set threshold value or the corrected pixel data.
JP2004116716A 1993-06-24 2004-04-12 Image processing unit and method Withdrawn JP2004304814A (en)

Priority Applications (1)

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

Applications Claiming Priority (2)

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

Related Parent Applications (1)

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

Publications (1)

Publication Number Publication Date
JP2004304814A true JP2004304814A (en) 2004-10-28

Family

ID=33421067

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JP2004304814A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006276642A (en) * 2005-03-30 2006-10-12 Mitsubishi Electric Corp Error diffusion circuit
JP2008268557A (en) * 2007-04-20 2008-11-06 Sony Corp Image generation device and method, program, and recording medium
JP2009110027A (en) * 2009-02-13 2009-05-21 Seiko Epson Corp Display driving device, display device, and electronic equipment
US8749658B2 (en) 2009-04-06 2014-06-10 Nec Corporation Data processing device, image matching method, program, and image matching system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006276642A (en) * 2005-03-30 2006-10-12 Mitsubishi Electric Corp Error diffusion circuit
JP2008268557A (en) * 2007-04-20 2008-11-06 Sony Corp Image generation device and method, program, and recording medium
JP2009110027A (en) * 2009-02-13 2009-05-21 Seiko Epson Corp Display driving device, display device, and electronic equipment
US8749658B2 (en) 2009-04-06 2014-06-10 Nec Corporation Data processing device, image matching method, program, and image matching system

Similar Documents

Publication Publication Date Title
JP3360391B2 (en) Image processing apparatus and image processing method
JP3188330B2 (en) Preliminary compensation method for binary image bitmap
US5325448A (en) Image treatment method and apparatus with error dispersion and controllable quantization
JP2500837B2 (en) Pixel value quantization method
JP3097785B2 (en) Image processing device
US5050000A (en) Error diffusion of subcells in digital halftoning
JP3444094B2 (en) Image processing method and apparatus
JP3247737B2 (en) Pixel value quantization method in image
US6373990B1 (en) Image processing utilizing luminance-density conversion
JPH08101912A (en) Method for quantization of gray-level pixel data with extended distribution set
JPH1084478A (en) Input image conversion method and pixel value quantization method
JPH1093820A (en) Error spread system and error spread method
JP3554077B2 (en) Image processing device
US6978045B1 (en) Image-processing apparatus
JP3685148B2 (en) Image processing apparatus and method
JP4068181B2 (en) Multilevel gradation pixel value level reduction method and system
JP2004304814A (en) Image processing unit and method
JP4182960B2 (en) Image processing apparatus and image processing program for binarization processing
JP4182959B2 (en) Image processing apparatus and image processing program for binarization processing
JPH08307669A (en) Image processing unit and its method
JP3646694B2 (en) Image processing apparatus and method
JP3679522B2 (en) Image processing method and apparatus
JP3059457B2 (en) Image processing device
JPH1070656A (en) Image processor
JPS63204375A (en) Half tone picture forming method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050329

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20050512