JP2005136976A - Image processing apparatus, image processing method, and program - Google Patents
Image processing apparatus, image processing method, and program Download PDFInfo
- Publication number
- JP2005136976A JP2005136976A JP2004296548A JP2004296548A JP2005136976A JP 2005136976 A JP2005136976 A JP 2005136976A JP 2004296548 A JP2004296548 A JP 2004296548A JP 2004296548 A JP2004296548 A JP 2004296548A JP 2005136976 A JP2005136976 A JP 2005136976A
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- value
- pixel group
- pixels
- gradation
- 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.)
- Pending
Links
Images
Landscapes
- Color, Gradation (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
Description
本発明は、レーザプリンタなどの画像処理装置における階調画像データのハーフトーン処理に関する。詳しくは、閾値に達するまでセルを構成する画素を選択し、そのセルの基準点にドットを発生させるように処理を行うが、画素の入力階調値に応じて閾値を変更するようにした処理に関する。 The present invention relates to halftone processing of gradation image data in an image processing apparatus such as a laser printer. Specifically, a pixel constituting a cell is selected until the threshold value is reached, and processing is performed so that dots are generated at the reference point of the cell, but the threshold value is changed according to the input gradation value of the pixel. About.
従来から、プリンタなどの画像出力装置は、各画素ごとに多値の階調値を有する階調データに対して、ドットの有無を表す2値の値に変換処理して印刷用紙に印刷を行うようになされている。一般には、多値の階調値を2値の値に変換する処理のことをハーフトーン処理と称されている。 2. Description of the Related Art Conventionally, an image output device such as a printer converts gradation data having multi-value gradation values for each pixel into binary values representing the presence or absence of dots, and prints on printing paper. It is made like that. In general, a process of converting a multi-value gradation value into a binary value is referred to as a halftone process.
かかるハーフトーン処理の方法としては、所定の閾値が格納された閾値マトリックスを利用して、入力階調値が閾値よりも大きいか小さいかにより2値化するディザ法や、閾値を設定しその閾値よりも大きいか小さいかにより2値化するとともにその誤差分をまわりの画素に分散して処理を進める誤差拡散法もある。 As a halftone processing method, a threshold matrix in which a predetermined threshold value is stored is used, and a dither method for binarizing depending on whether an input gradation value is larger or smaller than the threshold value, or a threshold value is set and the threshold value is set. There is also an error diffusion method in which binarization is performed depending on whether it is larger or smaller than that and the error is distributed to surrounding pixels to proceed with processing.
さらに、入力画像の各画素の階調値の合計が所定の閾値になるまでセルを構成する画素を選択し、セルの中心位置にドットを生成させるようにしたハーフトーン処理も知られている(例えば、特許文献1)。
しかしながら、上述した特開平11−27528においては、セルを構成する画素の選択を所定のテーブルを用いて行っているが、テーブル内で左側に存在する画素は既に処理済みの場合が多く、結果的に生成されるセルが歪んだ形となってしまう。かかる場合に、セルの中心にドットを生成させるとある部分では隣のドットを重なって形成されてしまうことになる。かかるハーフトーン処理における印刷出力は、ドットがある部分で重なって発生するため、全体として見た場合に粒状的にドットが存在し、視覚的に不快な印刷出力となっていた。 However, in the above-mentioned Japanese Patent Application Laid-Open No. 11-27528, selection of pixels constituting a cell is performed using a predetermined table, but the pixels existing on the left side in the table are often already processed, and as a result The generated cells are distorted. In such a case, if a dot is generated at the center of a cell, an adjacent dot is overlapped and formed at a certain portion. Since the print output in such halftone processing is overlapped at a portion where dots are present, the dots are present in a granular manner when viewed as a whole, resulting in a visually unpleasant print output.
とくに、レーザプリンタの場合に例えば1画素おきにドットを生成させるような場合に、その性能によってはドットが重なってしまい、滑らかな階調を表現したドットを生成させることができない場合もある。 In particular, in the case of a laser printer, for example, when dots are generated every other pixel, the dots may overlap depending on the performance, and it may not be possible to generate dots that express a smooth gradation.
さらに、上述した特開平11−27528において、階調値の変化の大きいエッジの部分ではセルの形状が歪んだ形になりやすく、セルの中心にドットを打つようにしてもエッジの領域でドットが離れすぎたり重なったりするなど、再現性がよいものとはいえず、不快な印刷出力となっていた。 Further, in Japanese Patent Laid-Open No. 11-27528 described above, the shape of the cell tends to be distorted at the edge portion where the change in gradation value is large, and even if the dot is hit at the center of the cell, the dot is formed in the edge region. The reproducibility was not good because it was too far away or overlapped, and the print output was unpleasant.
そこで、本発明の目的は、ドット間距離を保ちつつ、滑らかな階調とエッジの再現性の高い、快適な印刷出力を得ることにある。 Accordingly, an object of the present invention is to obtain a comfortable print output with a smooth gradation and high reproducibility of edges while maintaining a distance between dots.
上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理装置において、画素選択のための第1の基準点に基づいて、画素ごとのN種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成手段と、画素群生成手段で生成した画素群の第2の基準点を決定する画素群基準点決定手段と、画素群基準点決定手段で決定した第2の基準点に位置する画素にM種類のレベル値を付与する付与手段と、を備え、画素群生成手段は、第1の基準点を更新して当該第1の基準点に基づいて画素を選択し、さらに生成した画素群内のレベル値に応じて閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。 In order to achieve the above object, the present invention converts gradation data having N or more level values for each pixel into data having M (M is an integer) level values for each pixel. In the image processing apparatus, a pixel group generation unit that generates a pixel group by selecting a pixel based on a first reference point for pixel selection until a total of N kinds of level values for each pixel becomes equal to or greater than a threshold value A pixel group reference point determining means for determining the second reference point of the pixel group generated by the pixel group generating means, and M types of pixels located at the second reference point determined by the pixel group reference point determining means. And a pixel group generation unit that updates the first reference point, selects a pixel based on the first reference point, and further generates a level value in the pixel group It is characterized in that the threshold value is updated according to the above. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.
さらに、本発明は上記画像処理装置において、上記画素群生成手段は、生成した画素群内の画素のレベル値の平均値に応じて前記閾値を更新することを特徴としている。これにより、例えば、セルとして画素を選択している領域が平均階調値が高いと高濃度の領域と判断して、閾値を変更することでドット間距離を保つことができる。 Furthermore, the present invention is characterized in that, in the image processing apparatus, the pixel group generation means updates the threshold value according to an average value of level values of pixels in the generated pixel group. Thereby, for example, if the area where a pixel is selected as a cell has a high average gradation value, it is determined that the area is a high density area, and the inter-dot distance can be maintained by changing the threshold value.
さらに、本発明は上記画像処理装置において、上記画素群生成手段は、生成した画素群内のレベル値が第1の値より大きいとき閾値をこれまでの第2の値から第2の値より大きい第3の値に更新することを特徴としている。これにより、例えば、レベル値の変化が大きいとそれだけ閾値の値を大きくとることでセルの大きさを保ち、ドット間距離を保つことができる。 Further, in the image processing apparatus according to the aspect of the invention, the pixel group generation unit may increase the threshold value from the previous second value to the second value when the level value in the generated pixel group is larger than the first value. It is characterized by updating to the third value. Thereby, for example, if the change in the level value is large, the threshold value is increased accordingly, so that the cell size can be maintained and the inter-dot distance can be maintained.
さらに、本発明は上記画像処理装置において、上記画素群生成手段は、生成した画素群内のレベル値の最大値と最小値の差が第4の値よりも大きいとき、閾値をこれまでの第5の値から第5の値より低い第6の値に更新することを特徴としている。これにより、例えば、エッジの領域ではドット密度を高めてその再現性を向上させることができる。 Furthermore, in the image processing apparatus according to the aspect of the invention, the pixel group generation unit may set the threshold value when the difference between the maximum value and the minimum value of the level value in the generated pixel group is larger than the fourth value. It is characterized by updating from a value of 5 to a sixth value lower than the fifth value. Thereby, for example, in the edge region, the dot density can be increased to improve the reproducibility thereof.
さらに、本発明は上記画像処理装置において、上記第2の基準点は画素群の各画素位置と各画素のN種類のレベル値とから演算した重心位置であることを特徴としている。これにより、例えば、円状に成長した画素群の重心位置にドットが打たれるようになるため各ドットの間隔が一定距離に保たれた快適な印刷出力を得ることができる。 Furthermore, the present invention is characterized in that, in the image processing apparatus, the second reference point is a barycentric position calculated from each pixel position of a pixel group and N kinds of level values of each pixel. Thereby, for example, since dots are hit at the center of gravity of the pixel group grown in a circle, a comfortable print output in which the intervals between the dots are maintained at a constant distance can be obtained.
さらに、本発明は上記画像処理装置において、上記画素群生成手段は、第1の基準点に基づいて選択すべき画素が複数あるときはランダムにいづれか一の画素を選択することを特徴としている。これにより、例えば、画素群が円状に成長しやすくなり、第2の基準点にドットを打てばそのドット間距離が一定に保たれる。 Furthermore, the present invention is characterized in that, in the image processing apparatus, the pixel group generation means randomly selects one pixel when there are a plurality of pixels to be selected based on the first reference point. Thereby, for example, the pixel group easily grows in a circular shape, and if a dot is hit at the second reference point, the distance between the dots is kept constant.
また、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理装置において、N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成手段と、画素群生成手段で生成した画素群の所定画素に対してM種類のレベル値を付与する付与手段と、を備え、画素群生成手段は、生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。 In order to achieve the above object, the present invention provides gradation data having N (N is an integer) or more level values for each pixel, and data having M (M is an integer) types of level values for each pixel. A pixel group generating unit that selects pixels having N level values and selects unprocessed pixels until the sum of the level values for each selected pixel reaches a threshold value in the image processing apparatus for converting to And an adding means for giving M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generating means, the pixel group generating means depending on the generated level value in the pixel group The threshold value is updated. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.
さらに、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理方法において、画素選択のための第1の基準点に基づいて、画素ごとのN種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成工程と、画素群生成工程で生成した画素群の第2の基準点を決定する画素群基準点決定工程と、画素群基準点決定工程で決定した前記第2の基準点に位置する画素にM種類のレベル値を付与する付与工程とを備え、画素群生成工程は、第1の基準点を更新して当該第1の基準点に基づいて画素を選択し、さらに生成した前記画素群内のレベル値に応じて閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。 Furthermore, in order to achieve the above object, the present invention provides gradation data having N (N is an integer) or more level values for each pixel, and data having M (M is an integer) types of level values for each pixel. In the image processing method for converting to a pixel group, a pixel group is generated by selecting a pixel based on a first reference point for pixel selection until a sum of N kinds of level values for each pixel is equal to or greater than a threshold value. A pixel group reference point determination step for determining a second reference point of the pixel group generated in the generation step, a pixel group generation step, and a pixel located at the second reference point determined in the pixel group reference point determination step. A pixel group generation step that updates the first reference point, selects a pixel based on the first reference point, and further generates a pixel in the generated pixel group. The threshold value is updated according to the level value of There. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.
さらに、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データを、画素ごとにM(Mは整数)種類のレベル値を有するデータに変換する画像処理方法において、N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成工程と、画素群生成手段で生成した画素群の所定画素に対してM種類のレベル値を付与する付与工程とを備え、画素群生成工程は、生成した前記画素群内のレベル値に応じて閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。 Furthermore, in order to achieve the above object, the present invention provides gradation data having N (N is an integer) or more level values for each pixel, and data having M (M is an integer) types of level values for each pixel. In the image processing method for converting to a pixel group, a pixel group generation step of selecting a pixel having N types of level values and generating a pixel group by selecting unprocessed pixels until the sum of the level values for each selected pixel reaches a threshold value And an assigning step of assigning M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generating means, and the pixel group generating step includes a threshold value according to the generated level value in the pixel group. It is characterized by updating. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.
さらに、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データに対して、画素ごとにM(Mは整数)種類のレベル値を有するデータを出力する処理をコンピュータに実行させるためのプログラムにおいて、画素選択のための第1の基準点に基づいて、画素ごとのN種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成処理と、画素群生成処理で生成した画素群の第2の基準点を決定する画素群基準点決定処理と、画素群基準点決定処理で決定した第2の基準点に位置する画素にM種類のレベル値を付与する付与処理とを備え、画素群生成処理は、第1の基準点を更新して当該第1の基準点に基づいて画素を選択し、さらに生成した画素群内のレベル値に応じて閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。 Furthermore, in order to achieve the above object, the present invention provides M (M is an integer) type level values for each pixel with respect to gradation data having N (N is an integer) type level values or more for each pixel. In a program for causing a computer to execute a process of outputting data, pixels are selected based on the first reference point for pixel selection until the sum of N level values for each pixel is equal to or greater than a threshold value. A pixel group generation process for generating a pixel group, a pixel group reference point determination process for determining a second reference point of the pixel group generated by the pixel group generation process, and a second determined by the pixel group reference point determination process A pixel group generation process that updates the first reference point and selects a pixel based on the first reference point. Furthermore, it corresponds to the level value in the generated pixel group. It is characterized by updating the threshold Te. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.
さらに、上記目的を達成するために本発明は、画素ごとにN(Nは整数)種類以上のレベル値を有する階調データに対して、画素ごとにM(Mは整数)種類のレベル値を有するデータを出力する処理をコンピュータに実行させるプログラムにおいて、N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成処理と、画素群生成手段で生成した画素群の所定画素に対してM種類のレベル値を付与する付与処理とを備え、画素群生成処理は、生成した画素群内のレベル値に応じて前記閾値を更新することを特徴としている。これにより、例えば、ドット間距離を保ちつつ、滑らかな階調を表現した快適な印刷出力を得ることができる。 Furthermore, in order to achieve the above object, the present invention provides M (M is an integer) type level values for each pixel with respect to gradation data having N (N is an integer) type level values or more for each pixel. In a program for causing a computer to execute a process of outputting data having N values, pixels having N types of level values are selected, and unprocessed pixels are selected until the sum of the level values for each selected pixel becomes a threshold value. A pixel group generation process to be generated, and an adding process to give M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generation unit. The pixel group generation process is a level within the generated pixel group. The threshold value is updated according to the value. Thereby, for example, a comfortable print output expressing smooth gradation can be obtained while maintaining the distance between dots.
以下、図面を参照して本発明を実施するための最良の形態を説明する。図1は、本発明が適用されるシステム全体の構成を示す図である。全体としてホストコンピュータ10と、画像出力装置20とから構成される。
The best mode for carrying out the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing the configuration of the entire system to which the present invention is applied. As a whole, the
ホストコンピュータ10は、アプリケーション部11とラスタライズ部12とから構成される。アプリケーション部11では、文字データ、図形データ、ビットマップデータ等の印刷対象のデータが生成される。例えば、ホストコンピュータ10でワードプロセッサや図形ツールなどのアプリケーションプログラムを使用してキーボード等の操作により文字データや図形データなどが生成される。生成されたこれらのデータは、ラスタライズ部12へ出力される。
The
ラスタライズ部12では、アプリケーション部11から出力された印刷対象のデータを画素ごと(又はドットごと)に8ビットの階調データに変換される。したがって、各画素ごと0から255までの階調値(レベル値)を有することになる。ラスタライズ部12における階調データの生成は、実際にはホストコンピュータ10に実装されたドライバによって処理が行われる。ラスタライズ部12から出力される階調データは、画像出力装置20に出力される。なお、本実施例においてこの階調データはモノクロデータとして以下説明する。
The rasterizing
画像出力装置20は、全体として画像処理部21と印刷エンジン22とから構成される。画像処理部21では、ホストコンピュータ10から出力された階調データに対してハーフトーン処理等を行う。処理後のデータは印刷エンジン22に出力され、この印刷エンジン22にて実際に印刷用紙等の記録媒体への印刷が行われる。
The
画像処理部21は、ハーフトーン処理部211と、パルス幅変換部212とから構成される。ハーフトーン処理部211は、ホストコンピュータ10から出力された階調データが入力され、2値以上の多値の値(レベル値)に変換し、量子化データを出力する。ハーフトーン処理としては、本実施例では複数の画素からなるセルを構成してその重心にドットを生成させる重心利用した処理(Circular Cell法、以下CC法)を行う。本処理の具
体的な内容は後述する。
The image processing unit 21 includes a
パルス幅変調部212は、ハーフトーン処理部211から出力された量子化データが入力され、この量子化データに対してドットごとにレーザ駆動パルス有り又は無し等の駆動データを生成する。生成した駆動データは、印刷エンジン22に出力される。
The pulse
印刷エンジン22は、レーザドライバ221とレーザーダイオード(LD)222とから構成される。レーザドライバ221は、パルス幅変調部212からの駆動データが入力され、その駆動データをもとに駆動パルスあり又はなし等を示す制御データを生成し、レーザーダイオード222に出力する。レーザーダイオード222は、レーザドライバ221から出力された制御データに基づいて駆動され、さらに図示しない感光ドラムや転写ベルトが駆動されて、実際に印刷用紙等の記録媒体にホストコンピュータ10からのデータが印刷されることになる。
The
次に図2を参照して、画像出力装置20の具体的構成について説明する。ここで、図1の画像出力装置20のうち、ハーフトーン処理部211及びパルス幅変調部212は、図2におけるCPU24、ROM25、及びRAM26に対応する。
Next, a specific configuration of the
画像出力装置20は、全体として、入力インターフェース(I/F)23、CPU24、ROM25、RAM26、印刷エンジン22とから構成され、バスを介して互いに接続されている。入力I/F23は、ホストコンピュータ10と画像出力装置20とのインターフェースの役割を果たす。入力I/F23には、所定の伝送方式により伝送された、ホストコンピュータ20からの階調データが入力され、画像出力装置20で処理できるデータに変換される。入力された階調データは、一旦RAM26に格納される。
The
CPU24は、バスを介して入力I/F23、ROM25、RAM26、印刷エンジン22と接続され、ROM25に格納されたプログラムを読み出して、ハーフトーン処理等の各種処理を行う。その詳細は後述する。RAM26は、CPU24で実行される各処理のワーキングメモリとして役割を果たし、処理後の各種データが格納される。また、印刷エンジン22のレーザドライバ221を駆動させるための駆動データも格納される。RAM26の具体的構成等も後述する。
The
印刷エンジン22は、図1の印刷エンジンと同様の構成で、RAM26に格納された駆動データがCPU24の制御により入力されて、上述した印刷処理が行われることになる。
The
次に、このハーフトーン処理部212における処理について以下、具体的に説明するが、その前にCC法についての概要を簡単に説明する。CC法によるハーフトーン処理は、まず初期画素を選択し、所定の閾値に達するまで初期画素周辺の未処理画素を選択して、複数画素からなるセルを構成する。セルを構成する未処理画素選択の際、それまで構成したセルの重心位置から最も近い画素を選択する。そして、閾値に達するとそのセルの重心位置に位置する画素にドット生成を示す値(例えば“255”)を割り当て、それ以外の画素はドットの生成を行わないことを示す値(例えば“0”)を割り当てる。CC法は、以上の処理を入力画像の全てのデータに対して行うことで、量子化されたデータを得るのである。
Next, processing in the
上述した特開平11−27528では、セルに取り込むべき未処理画素の選択にテーブルを利用して予め決められた位置の画素を選択するようにしている。一方、CC法は重心位置を利用してセルに取り込むべき未処理画素を選択するようにしているため、特開平11−27528と比較して、セルが円状に成長し、ドット間距離を一定に保つことができ、ドットの分散性を向上させて視覚的に快適な印刷出力を得ることができるのである。 In the above-mentioned Japanese Patent Laid-Open No. 11-27528, a pixel at a predetermined position is selected using a table for selecting an unprocessed pixel to be taken into a cell. On the other hand, since the CC method uses the position of the center of gravity to select the unprocessed pixels to be taken into the cell, the cell grows in a circular shape and the inter-dot distance is constant as compared with JP-A-11-27528. Therefore, the dispersibility of dots can be improved, and a visually comfortable print output can be obtained.
一方、レーザプリンタの場合、露光ユニット内のレーザ光を感光体ドラムに照射することで潜像を形成するが、1画素分のドットを形成させるとき光の特質により正確に1画素分の大きさのドットを形成させることができない。隣接画素から除々に光量が多くなり照射すべき画素内で最も高い光量となり、また除々に少ない光量となる。すなわち、隣接画素に跨って光が照射されてしまうのである。このため、1画素おきにドットを形成させるような場合、使用するレーザプリンタによっては連続してドットが発生することがあり、これが粒状的なドットを発生させる原因にもなっている。 On the other hand, in the case of a laser printer, a latent image is formed by irradiating a photosensitive drum with laser light in an exposure unit. When a dot for one pixel is formed, the size of one pixel is accurately determined by the characteristics of the light. Dots cannot be formed. The amount of light gradually increases from adjacent pixels, and becomes the highest amount of light in the pixel to be irradiated, and gradually decreases. That is, light is irradiated across adjacent pixels. For this reason, when dots are formed every other pixel, dots may be continuously generated depending on the laser printer to be used, and this also causes the generation of granular dots.
ここで、CC法による処理をレーザプリンタに応用した場合に、セルを構成するための閾値を一定にすると各画素の階調値が小さい領域では階調値の合計がなかなか閾値に達することができないためにセルの大きさは比較的大きくその重心にドットを生成させると、ドット間の距離が長く保たれているので粒状的なドットの発生を抑える確率は高くなる。しかしながら、階調値が大きい領域ではすぐに閾値に達してしまうためセルの大きさは比較的小さくその重心にドットを打つようにしても隣接するドットどうしが重なりドット間距離が保つことができず、粒状的なドットを発生させてしまう確率が高くなる。そこで、本発明ではセルを構成するための閾値をセル内の画素の階調値によって変化させることで、粒状的なドットの発生を抑え、滑らかな階調表現を実現しようとするものである。具体的には、セルを構成する画素の階調値の平均値が一定値以上のとき、その閾値を高くし、セルの大きさを大きく保つようにすることで、ドット間距離を保ち粒状的なドットの発生を抑えるのである。 Here, when processing by the CC method is applied to a laser printer, if the threshold value for configuring the cell is made constant, the sum of the gradation values cannot easily reach the threshold value in a region where the gradation value of each pixel is small. Therefore, if the size of the cell is relatively large and dots are generated at the center of gravity, the distance between the dots is kept long, so the probability of suppressing the generation of granular dots increases. However, since the threshold value is reached immediately in a region where the gradation value is large, the cell size is relatively small, and even if dots are hit at the center of gravity, adjacent dots overlap and the inter-dot distance cannot be maintained. The probability of generating granular dots increases. Therefore, in the present invention, by changing the threshold value for configuring the cell according to the gradation value of the pixel in the cell, it is intended to suppress the generation of granular dots and realize a smooth gradation expression. Specifically, when the average value of the gradation values of the pixels constituting the cell is equal to or greater than a certain value, the threshold value is increased and the cell size is kept large, thereby maintaining the inter-dot distance and granularity. This suppresses the generation of new dots.
また、上述したようにレーザプリンタは、例えば1画素分の大きさのような小さいドットを安定して出力することは困難である。このようなプリンタでCC法による閾値を固定にすると入力階調値が低い領域では、例えば1画素分の領域にしかドットが発生しない場合が多い。これでは、上述したように隣の画素までドットが発生したりするなど、粒状的なドットを発生させてしまう。そこで、入力階調値に応じてその閾値を更新して、できるだけ2画素分のドット、3画素分のドットなど安定したサイズのドットを発生させるようにするのである。このようにすることで、本発明では階調値が低い領域でも小さいドットを発生させる確率を低くして、粒状的でない安定したサイズのドットを発生させることができる。したがって、ドットサイズが小さいと粒状的なドットを発生させてしまうレーザプリンタであっても、入力階調値に応じて閾値を変更することで、ドット間距離は広がるものの1つ1つのドットが安定した、粒状的でないドットを発生し快適な印刷出力を得ることができるのである。 Further, as described above, it is difficult for a laser printer to stably output small dots such as the size of one pixel. In such a printer, when the threshold value by the CC method is fixed, in an area where the input gradation value is low, for example, dots often occur only in an area for one pixel. In this case, as described above, a dot is generated up to the adjacent pixel, and a granular dot is generated. Therefore, the threshold value is updated in accordance with the input gradation value so that dots having a stable size such as dots for two pixels and dots for three pixels are generated as much as possible. In this way, in the present invention, it is possible to reduce the probability of generating a small dot even in a region having a low gradation value, and to generate a dot having a stable size that is not granular. Therefore, even in a laser printer that generates granular dots when the dot size is small, changing the threshold value according to the input tone value increases the inter-dot distance, but makes each dot stable. As a result, a non-granular dot is generated and a comfortable print output can be obtained.
図3には、レーザプリンタによる出力例を示す。図3(a)は閾値を一定にした場合の例、図3(b)は閾値をセル内の画素の平均階調値によって高くした場合の例である。入力階調値は双方とも図面上左から右にかけて除々にその値が大きくなっている。閾値を一定にすると(図3(a)の場合)、階調値が大きい領域(図面右側)ではドットが密集し、上述したレーザプリンタの特性から、所々でドットどうしが引っ付いたりするなど粒状的なドットが発生している。一方、図3(b)の場合、階調値が大きい領域でもドット間距離が保たれ粒状的なドットは発生していない。かかるドットは全体的に滑らかな階調を表現している、といえる。 FIG. 3 shows an output example from the laser printer. FIG. 3A shows an example when the threshold value is made constant, and FIG. 3B shows an example when the threshold value is increased by the average gradation value of the pixels in the cell. Both of the input tone values gradually increase from the left to the right in the drawing. If the threshold value is made constant (in the case of FIG. 3A), the dots are densely gathered in the region where the gradation value is large (the right side of the drawing), and the dots are stuck in places due to the characteristics of the laser printer described above. Dots are generated. On the other hand, in the case of FIG. 3B, the inter-dot distance is maintained even in the region where the gradation value is large, and no granular dots are generated. It can be said that such dots express a smooth gradation as a whole.
また、階調の表現自体も図3(a)の場合、右側にいくに従って除々にドットが密集するように配置されることで階調が表現されている。一方、図3(b)の場合はドット間距離が保たれたまま右側にいくに従ってドットの1つ1つが除々に大きくなることで階調が表現されている。これは、CC法による処理の場合に閾値を高く設定するとセルの大きさが大きくなる分、セルに取り込んだ画素の階調値の合計値も大きくなり、ドットが1画素分ではなく2画素分、3画素分と大きく成長するためである。 Also, in the case of FIG. 3A, the gradation expression itself is expressed by arranging dots so that the dots gradually gather toward the right side. On the other hand, in the case of FIG. 3B, gradation is expressed by increasing each dot gradually toward the right while maintaining the distance between dots. This is because when the threshold value is set high in the case of processing by the CC method, the total size of the pixels captured in the cell increases as the size of the cell increases, and the dot is not for one pixel but for two pixels. This is because it grows as large as 3 pixels.
しかしながら、このように閾値を変化させたとしても以下のような問題点である。すなわち、突然その画素の階調値が変化する領域(以下、エッジという)でドット間距離が空いてしまうと却ってエッジの再現性が悪くなってしまう。距離が大きい分、エッジの表現が劣化してしまうのである。このようなエッジの部分では、むしろセルの大きさを小さくしドット密度を上げて解像度を良くすべきである。図4には、エッジの部分を何ら検出せず、セルを構成する画素の平均階調値が高くなると閾値を上げるように処理した場合の出力例である。図に示すように、とくに文字“S”のカーブの部分ではドット間距離が広がりすぎていたり、ドットが重なって発生したりしているため、エッジの再現性が良くない。この図では、文字“S”の領域は入力階調値を“0”にしているため、セルがエッジの部分で円状に成長せず歪んだ形となってしまい、その重心にドットを打っても隣接するセルのドットと重なってしまうことがあるからである。 However, even if the threshold value is changed in this way, there are the following problems. In other words, if the distance between dots suddenly increases in a region where the tone value of the pixel changes (hereinafter referred to as an edge), the reproducibility of the edge deteriorates. As the distance increases, the expression of the edge deteriorates. In such an edge portion, the resolution should be improved by reducing the cell size and increasing the dot density. FIG. 4 shows an output example when processing is performed such that no threshold is detected and the threshold value is increased when the average gradation value of the pixels constituting the cell increases. As shown in the drawing, the reproducibility of the edge is not good because the inter-dot distance is excessively wide or the dots are overlapped particularly in the curve portion of the character “S”. In this figure, since the input gradation value is set to “0” in the region of the character “S”, the cell does not grow in a circular shape at the edge portion, and is distorted, and a dot is hit at the center of gravity. This is because the dots of adjacent cells may overlap.
そこで、入力階調値の変化が大きい領域を検出するとその閾値を下げるように処理することで、セルの大きさが小さくなりその分ドット密度が上がるため、エッジの再現性がよくなる。図5にかかる処理を行った場合の出力例を示す。文字“S”のカーブの部分では、まわりのドットと比較してその大きさが小さくなるがその分多くのドットが打たれ、図4の場合と比較して再現性がよい。この場合に、上述したレーザプリンタの特性、すなわちドットどうしが引っ付いてしまう確率が高まるが、それよりも解像度を上げてエッジの再現性を良くすべきである。図5の場合でもエッジの部分で隣接するドットが引っ付いている箇所も存在するが、却ってそのことが文字“S”を強調しており再現性は高くなっているといえる。もちろん、できるだけドットどうしが距離を保ち、かつ再現性を高めるようにするためには、ドットどうしが引っ付いてしまうことのないような閾値を設定するようにすればよいのである。 Therefore, if an area where the change in the input tone value is large is detected, the threshold value is reduced, so that the cell size is reduced and the dot density is increased accordingly, so that the edge reproducibility is improved. An output example when the processing according to FIG. 5 is performed is shown. In the curve portion of the letter “S”, the size of the dot is smaller than that of the surrounding dots, but more dots are hit, and the reproducibility is better than in the case of FIG. In this case, the above-described characteristics of the laser printer, that is, the probability that dots are stuck to each other increases, but the resolution should be increased to improve the edge reproducibility. Even in the case of FIG. 5, there is a portion where an adjacent dot is stuck at the edge portion, but on the contrary, this emphasizes the letter “S” and it can be said that the reproducibility is high. Of course, in order to keep the distance between the dots as much as possible and to improve the reproducibility, it is only necessary to set a threshold value that does not cause the dots to be caught.
このように入力階調値によってセルを構成するための閾値を変化させることで、図3に示すようにドット間距離を保って滑らかな階調を表現し、入力階調値の変化が大きいとその閾値を下げるようにすることで、図5に示すようにエッジの再現性が優れた印刷出力を得ることができる。 In this way, by changing the threshold value for configuring the cell according to the input gradation value, a smooth gradation is expressed while maintaining the distance between dots as shown in FIG. 3, and when the change of the input gradation value is large, By reducing the threshold value, a print output with excellent edge reproducibility can be obtained as shown in FIG.
以下、本発明によるCC法によるハーフトーン処理の詳細について図面を参照しながら説明する。ここで図6乃至図11は処理の動作を示すフローチャートであり、図12乃至図29はRAM26に格納された階調データの例を示すものである。以下、フローチャートに沿って説明することにする。
The details of the halftone processing by the CC method according to the present invention will be described below with reference to the drawings. 6 to 11 are flowcharts showing processing operations, and FIGS. 12 to 29 show examples of gradation data stored in the
図6は、本発明のCC法によるハーフトーン処理全体のフローチャートを示すものである。まず、図6に示すように、CPU24は本処理を実行するためのプログラムをROM25から読み出すことによって、処理が開始されることになる(ステップS10)。ホストコンピュータ10からの入力階調データはRAM26に格納されているものとする。その例を図12(a)に示す。この図に示すようにRAM26には、入力データ格納領域261aを有し、ホストコンピュータ10からの入力階調データがCPU24の制御によってこの入力データ領域261aに格納さる。この領域261aにおいて各座標位置は、全体画像の画素位置に対応するものである。例えば入力データ格納領域261aで(0,0)の座標位置は、全体画像の(0,0)に位置する画素に対応する。また、各座標位置に格納された値は当該画素の入力階調値を示す。なお、図12(a)に示す例は7行12列の構成であるが、これは説明を容易にするためであって、例えば1ページ(1フレーム)分の画像を格納できる構成であってもよいし、この図より少ない行と列の構成であってもよい。また、RAM26内には量子化データを格納するための出力データ領域261bを有する。この領域261bも、入力データ領域261aと同様に各座標位置は全体画像の画素位置に対応するもので、構成も7行12列となっているがそれ以外の構成であってもよい。さらに、RAM26には図12(b)に示すようにワーキングメモリ領域270を有し、基準点としての重心位置の座標とこれまでセルとして選択した画素の階調値の合計値とを格納する領域270aと、セル内の画素の階調値の最大値と最小値とを格納する領域270bと、セル内の階調値の平均値を格納する領域270cと、セルを構成する画素を選択するための閾値を格納する領域270dと、から構成される。各領域270a〜270dはCPU24によって演算されてその値が格納される。なお、領域270dには閾値のデフォルト値として“255”が格納されているものとする。
FIG. 6 shows a flowchart of the entire halftone process according to the CC method of the present invention. First, as shown in FIG. 6, the
図6に戻り、次いでCPU24は初期画素を決定し、基準点を初期画素の座標に設定する(ステップS11)。初期画素の決定に際しては、CPU24はラスタ方向に入力データ領域261a内を探索する。ここでラスタ方向とは、ホストコンピュータ10で生成される画像、すなわち入力データ格納領域261aで最も上の最も左側の方向である。このようにラスタ方向に探索することで、CC法により円状に成長した2つのセルの中間にすぐ下にセルが配置されるようになる。そのセルの重心位置にドットを打てば、印刷用紙全体として見ると、上の行のドット間の真ん中あたりに下の行のドットが配置されるように構成される。すなわち、全体的にドットが斜め方向に形成されるのである。このように配列されたドットは視覚的に目立ちにくく快適な印刷出力を得ることができる。上の行のドットと下の行のドットとが鉛直方向で同じ位置に配置されている場合はドットが正確に並びすぎて却ってドットが視覚的に目立ってしまう。このようなドットの配列を防止するためにラスタ方向に探索するのである。図12(b)の例では、ラスタ方向に探索すると、入力データ領域261aの(0,0)に位置する画素が未処理画素となる(図12(c)の入力データ領域261a参照)。よって、CPU24は初期画素として(0,0)に位置する画素を選択する。なお、CPU24はCC法による処理を行った画素に対して“−1”を入力データ領域261aの当該画素位置に格納していく。以後の処理でセルを構成する未処理画素として選択されないようにするためである。よって、ラスタ方向に探索して未処理画素か否かは、選択した画素位置に“−1”が格納されているか否かで判断される。
Returning to FIG. 6, the
さらにCPU24は、本ステップS11において重心位置を演算する。画素選択のためと、最後にセル内にドットを打つ処理を行うためである。この重心位置の演算には、以下に示す演算式を用いる。
(式1)
x重心={{(セルの重心のx座標)×(セルの階調値の合計)}
+{(選択した未処理画素のx座標)×(選択した未処理画素の階調値)}}
/(セルの階調値の合計+選択した未処理画素の階調値)
y重心={{(セルの重心のy座標)×(セルの階調値の合計)}
+{(選択した未処理画素のy座標)×(選択した未処理画素の階調値)}}
/(セルの階調値の合計+選択した未処理画素の階調値)
(x重心、y重心は重心位置の座標)
この演算式はROM25に格納され、重心位置の演算のときにCPU24がROM25から読み出して演算を行うことになる。ちなみに、初期画素の場合は、(式1)においてセルの重心のx、y座標、及びセルの階調値の合計はともに0として演算される。なお、セルとは、上述したように複数の画素から構成される画素群で、上式で“セルの重心”とあるのは、これまで構成したセルの重心のことである。初期画素の場合の重心を演算すると、x重心=0、y重心=0となる。本ステップS11で演算した重心位置は、CPU24によってワーキングメモリ270の領域270aに格納されることになる(図13(a)の領域270a参照)。また、CPU24は、階調値の合計値、この場合は(0,0)の画素のみ選択したので当該画素の階調値“20”も領域270aに格納される。
Further, the
(Formula 1)
x centroid = {{(x coordinate of centroid of cell) × (sum of cell gradation values)}
+ {(X coordinate of selected unprocessed pixel) × (tone value of selected unprocessed pixel)}}
/ (Total tone value of cells + tone value of selected unprocessed pixel)
y centroid = {{(y coordinate of the centroid of the cell) × (total sum of cell gradation values)}
+ {(Y coordinate of selected unprocessed pixel) × (tone value of selected unprocessed pixel)}}
/ (Total tone value of cells + tone value of selected unprocessed pixel)
(X center of gravity , y center of gravity are coordinates of the center of gravity)
This calculation formula is stored in the
さらに、CPU24は本ステップS11において、セルを構成する画素の階調値の最大値(max)、最小値(min)、その選択画素の平均階調値(mean)を各領域270b、270cに格納する。図13(a)の例では、1つの画素(0,0)のみしか選択していないので、最大値“20”、最小値“20”、平均階調値“20”が各領域270b、270cに格納されることになる。
Further, in this step S11, the
また、CPU24はセルを構成する画素を選択すると、上述したように以後未処理画素として選択されないようにするために“−1”をその画素位置に格納する。図13(a)の入力データ領域261aに示すように、初期画素として(0,0)に位置する画素を選択したので、CPU24はこの画素位置に“−1”を格納することになる。以上が、CPU24が本ステップS11で行う処理である。
Further, when the
図6に戻り、次いでCPU24は決定した初期画素が低濃度か否か判断する(ステップS12)。低濃度の場合とは、選択画素で黒成分が少なく白成分が多い場合である。高濃度の場合とは選択画素で黒成分が多く白成分が多い場合である。かかる低濃度と高濃度の画素に対して全く同じように処理を行うことは必ずしも好ましいことではない。すなわち、高濃度の成分に対して、低濃度と同様に閾値に達するまでセルを構成するように処理を進めると、すぐに閾値に達してしまいセルの大きさを確保することができず、隣り合ったセルどうしでドットが隣接して発生してしまう。このようなドットは印刷出力全体として目立ちやすく、快適な印刷出力を得られない。そこで、黒成分が多い画素と白成分が多い画素とを分けて処理を進めるのである。この判断は、CPU24がROM25内に格納された所定値(本実施例では“127”)を読出し、選択画素の階調値がその値より大きいか小さいかで判断する。図13(a)の例では、(0,0)の画素の階調値“20”は所定値“127”より小さい値なので、低濃度と判定され(ステップS12で“YES”)、ステップS13に移行する。なお、高濃度の場合(ステップS12で“NO”)は白濃度処理(ステップS24)に移行するがその詳細は後述する。
Returning to FIG. 6, the
図6に戻り、次いでCPU24は、未処理画素の選択を行う(ステップS13)。未処理画素の選択は、ワーキングメモリ270に格納した重心位置の座標に最も近い位置にある画素を選択する。重心を利用してセルを構成する未処理画素を選択するため、上述したようにセルは円状になりやすく、その重心にドットを形成させることで、ドット間距離が一定で快適な印刷出力を得ることができるのである。図13(a)の例では、ワーキングメモリ領域270の領域270aに重心位置x重心=0、y重心=0が格納されているので、この位置から最も近い画素位置を選択することになる。この例の場合に、重心位置に最も近い画素としては、(1,0)と(0,1)に位置する2つの画素が存在する。この場合CPU24は、ランダムにいずれか1つの画素を選択することにする。固定順(例えば次に選択すべき未処理画素は右隣の画素、次に選択すべき画素はその画素の下にある画素など)に選択すると、最終的に構成されるセルが規則的に並びすぎることによって、印刷出力のある領域でドットが周期的に発生する周期パターンが生じることになる。このようなパターンは視覚に入り易く快適な印刷出力を得ることができない。このような理由から、選択すべき画素が複数あれば、ランダムに選択するのである。図13(a)の例では、CPU24は、(1,0)に位置する画素をランダムに未処理画素として選択することにする(図13(b)の入力データ領域261a参照)。
Returning to FIG. 6, the
図6に戻り、次いでCPU24は閾値制御処理を行う(ステップS14)。セルを構成するための閾値を変化させることで、滑らかな階調を表現するとともにエッジの再現性を高めるためである。図8に閾値制御処理のフローチャートを示す。
Returning to FIG. 6, the
まず、CPU24は本処理(ステップS14)に移行すると新たに選択した画素を含めた最大値と最小値、及び平均階調値を演算する(ステップS141)。図13(a)の例では、新たに(1,0)の画素を未処理画素として選択した(ステップS13)ので、この画素を含めたセル内の最大値等を演算する。この場合、選択画素(1,0)の階調値は“20”なので、最大値は“20”、最小値も“20”、そして平均階調値も“20”(=(20+20)/2)となり、これらの値をCPU24は各領域270b、270cに格納することになる(図13(b)の領域270b、270c参照)。
First, when proceeding to this process (step S14), the
次いでCPU24は、セルの平均階調値を引数とする関数により画素を選択するための閾値を変更する(ステップS142)。平均階調値が高いとき、閾値となるまで画素を選択するとすぐに閾値に達してしまい上述したようにドットが密集することで粒状的なドットを発生させてしまう。滑らかな階調を表現するために閾値を変更するのである。本実施例では、平均階調値(mean)が“30”より小さいときは閾値は“255”、“30”以上で“80”よりも小さいとき閾値を“510”に変更し、さらに“80”以上のときは“765”に変更する。もちろん、これは一例でこれ以外の平均値の値でもよいし、これ以外の閾値でもよい。また、3段階で閾値を設定するようにしているが、2段階に設定しても、4段階以上であってもよい。粒状的なドットを発生させないように、画像出力装置20ごとにその値を設定すればよい。この場合の関数の一例を図23に示す。この関数は、いわゆるプログラム上の読出し関数(threshold())である。この図に示すように平均階調値(mean)の値によって出力する閾値(threshold)を変化させている。もちろん、関数として数式を用いた演算式によって閾値を変化させてもよい。例えば、以下の演算式である。
(式2)
threshold = (2+75×(階調値の合計値)/(選択画素数)/255)×255(thresholdは閾値)
この式で、“2”は画像出力装置20の特性に合わせた特性値を示し、“75”は閾値を線形に変化させるための係数である。(階調値の合計値)/(選択画素数)で平均階調値を表すことになる。この関数も平均階調値が高いほど閾値も高くなるように設定されている。なお、この演算式及び図23に示した呼び出し関数ともにROM25等に格納され、CPU24が本処理(ステップS14)の際に適宜読み出して実行することで、各値が得られる。すなわち図13(b)に示すように、ステップS141で領域270cに格納した平均階調値“20”を読出して、(式2)や呼び出し関数(threshold())に代入等することで、閾値“255”を得て、領域270dにCPU24によって再び格納されることになる。
Next, the
(Formula 2)
threshold = (2 + 75 × (total value of gradation values) / (number of selected pixels) / 255) × 255 (threshold is a threshold value)
In this equation, “2” indicates a characteristic value that matches the characteristic of the
図8に戻り、次いでCPU24は画素群であるセル内の階調値の最大値と最小値の差が所定値よりも大きいか否か判断する(ステップS143)。上述したように入力階調値の差からエッジの領域であるか否かを検出するためである。ステップS141で最大階調値、最小階調値ともに領域270bに格納されているので、CPU24はこの値を領域270bから読み出すことによって処理を行う。本実施例では所定値として“50”を設定し、ROM25に格納されているものとする。図13(b)の例では、最大値“20”、最小値“20”でその差は“0”よって所定値“50”よりも小さいので本ステップS143で“NO”が選択され閾値制御処理が終了して図6のステップS15に移行する。なお、本ステップS143で所定値よりも大きいとき(“YES”のとき)、閾値を下げる処理を行う(ステップS144)がその詳細は後述する。
Returning to FIG. 8, next, the
図6に戻り、閾値制御処理が終了するとCPU24は階調値の合計が閾値を超えるか否か判断する(ステップS15)。閾値制御処理(ステップS14)で変更した閾値に基づき、セルを構成する画素を閾値に達するまで選択するためである。図13(b)の例では、セルを構成する画素の階調値の合計は、(0,0)と(1,0)の画素の階調値の合計値である“40”となり、閾値である“255”を超えない。よって本ステップS15で“NO”が選択され、ステップS16に移行する。
Returning to FIG. 6, when the threshold control process is completed, the
ステップS16でCPU24は、未処理画素を含めた基準点、すなわち重心位置の演算を行う。未処理画素として選択(ステップS13)した画素を含めたセルの重心位置を更新するためである。重心位置の演算は、上述した(式1)を用いる。図13(b)の例で重心位置を演算すると、x重心=0.5、y重心=0を得て、メモリ領域270の領域270aにCPU24によって格納されることになる(同図の領域270a参照)。
In step S16, the
次いでCPU24は、階調値の合計を演算してワーキングメモリ270の領域270aに格納する(ステップS17)。図13(b)の示すように選択画素((0,0)と(1,0))の階調値の合計は“40”なので、この値が領域270aに格納されることになる。また、CPU24は、ステップS13で未処理画素として選択した画素の入力データ領域261aの位置に“−1”を格納する(同図の入力データ領域261a参照)。以後の処理で未処理画素として選択されないようにするためである。さらに、CPU24は、対応する出力データ領域261bの画素位置(1,0)にドットを打たないことを示す値(ここでは“0”)を格納する(同図出力データ領域261b参照)。
Next, the
次いでCPU24は、ワーキングメモリ270の領域270aに格納した階調値の合計が閾値と等しいか否か判断する(ステップS18)。階調値の合計と閾値はそれぞれ領域270a、270dに格納されているのでこれらの値をCPU24が適宜読み出し比較することで処理が行われる。図13(b)の例では、階調値の合計は“40”、閾値は“255”で等しくないため本ステップS18で“NO”が選択され、再びステップS13に移行する。
Next, the
そして、CPU24は選択した画素の階調値の合計が閾値と等しい(ステップS18で“YES”)か、閾値を超える(ステップS15)まで、未処理画素を選択していく。図13(c)の例は、セルを構成する画素として4つの画素((0,0)、(1,0)、(0,1)、及び(1,1)の画素)を選択してステップS18に移行したときの状態を示す。ここまでは、階調値の合計は“80”、選択画素の階調値はすべて同じ値のためその最大値、最小値、平均階調値ともに“20”、閾値も平均階調値が“20”のままで“30”以上となっていないため“255”のままである。また、重心位置は(式1)により演算した結果、(0.5,0.5)となる(同図の領域270a〜270d参照)。ステップS18でCPU24は、階調値の合計“80”は閾値“255”と等しくないため本ステップで“NO”が選択され再び未処理画素の選択を行う(ステップS13)。
Then, the
図13(c)に示すように4つの画素を選択した後、重心位置(0.5,0.5)に最も近い画素として、(2,0)、(2,1)、(1,2)、(0,2)に位置する4つの画素があるがランダムに(2,0)の画素を選択するものとする(ステップS13、図14(a)の入力データ領域261a参照)。そして閾値制御処理(ステップS14)に移行するが、ステップS141にて選択画素(2,0)の階調値が“25”のため、セルを構成する画素の階調値の最大値が“25”、さらに平均階調値も“21”(=(80+25)/5)に更新される(図14(b)の領域270b、270c参照)。
As shown in FIG. 13C, after selecting four pixels, the pixels closest to the center of gravity (0.5, 0.5) are (2, 0), (2, 1), (1, 2 ), There are four pixels located at (0, 2), but the pixel of (2, 0) is selected at random (see step S13,
次いでCPU24は閾値の変更処理を行う(ステップS142)が、平均階調値は“21”で“30”以下となるので、閾値は変更されず“255”を領域270dに格納することになる。そして、階調値の最大値“25”と最小値“20”の差は“5”で所定値である“50”以下である。従ってステップS143で“NO”が選択され、閾値を下げることはせずに閾値制御処理は終了することになる。
Next, the
その後、階調値の合計は“105”なのでステップS15で“NO”が選択され、CPU24は重心位置を演算し(ステップS16)、階調値の演算(ステップS17)を行い、図14(b)の領域270aに示す値を得る。また、CPU24は当該画素位置(2,0)で入力データ領域261aに“−1”を格納し、出力データ領域261bに“0”を格納することになる(図14(b)の入力、出力各データ領域261a、261b参照)。この場合でも階調値の合計“105”は、閾値“255”以下なのでステップS18で“NO”が選択され、再び未処理画素を選択することになる(ステップS13)。
After that, since the total of the gradation values is “105”, “NO” is selected in step S15, and the
以後、図14(c)から順に説明すると、次にCPU24は未処理画素として(2,1)を選択する(ステップS13)。当該画素の階調値は“25”で、最大値はかわらず、平均階調値は“21.7”(≒(105+25)/6)に更新される(図14(c)メモリ領域270参照)。よって“30”以下なので閾値の変更はなく、また閾値を下げることもない。このときのセルを構成する画素の階調値の合計は、“130”で閾値“255”に達しないのでステップS18で“NO”が選択され再び未処理画素の選択を行う(ステップS13)。
Hereinafter, in order from FIG. 14C, the
次にCPU24は、未処理画素として図15(a)に示すように、重心位置に最も近い画素として(1,2)を選択する。当該画素の階調値は“20”、平均階調値は“21.4”(≒(130+20)/7)となる。平均階調値は“30”以下なので閾値の変更はなく、また最大、最小の差も“50”以下なので閾値を下げる処理も行われない。
Next, as shown in FIG. 15A, the
かかる処理を繰り返すことで、図15(b)の状態となる。これは、これまで選択した画素の階調値の合計が“250”で、閾値である“255”に達する直前の状態である。この状態での重心位置、最大値、最小値、平均階調値、閾値は図15(b)のメモリ270の各領域270a〜270dに示す値となっている。この状態のときも、階調値の合計は閾値と等しくないためステップS18で“NO”が選択され、再び未処理画素の選択を行う(ステップS13)。
By repeating such processing, the state shown in FIG. This is the state immediately before the sum of the gradation values of the pixels selected so far is “250” and reaches the threshold value “255”. The barycentric position, maximum value, minimum value, average gradation value, and threshold value in this state are values shown in the
CPU24はステップS13において、領域270aに格納された重心位置から、この位置に最も近い画素を選択する。複数あればランダムに選択する。図15(c)に示すように、CPU24は(2,3)に位置する画素を選択するものとする。当該画素の階調値は“25”なので、最大値は“25”のまま、平均階調値は“22.7”となる(ステップS141)。“30”以下なので閾値の変更は行われず(ステップS142)、また最大値と最小値の差も“50”以下なので、閾値を下げる処理も行われず(ステップS143で“NO”が選択)、ステップS15に移行する。
In step S13, the
ステップS15においてCPU24は、階調値の合計は最後に選択した画素を含めると“275”(=250+25)となるため閾値“255”を超えることになるため、本ステップで“YES”が選択され閾値を超えた場合の演算処理(ステップS22)に移行することになる。本処理のフローチャートを図9に示す。
In step S15, the
本処理に移行するとまずCPU24は、閾値から濃度の合計、すなわちこれまで構成したセルの階調値の合計の減算処理を行う(ステップS221)。図15(c)の例では、閾値“255”からこれまでの階調値の合計“250”を減算すると“5”を得る。上述したようにこれまで選択した画素の階調値の合計は領域270aに格納されているので、CPU24は適宜この領域270aから値を読み出すことで処理が行われる。
When shifting to this process, the
次いでCPU24は、このステップS221で減算した値を最後に選択した画素の階調値として重心位置の演算を行う(ステップS222)。すなわち、最後に選択した画素の階調値をそのまま用いると閾値を超えてしまうので、閾値と丁度等しくなる値を当該画素の階調値として重心演算を行うのである。演算式は以下の式を用いる。
(式3)
x重心={{(セルの重心のx座標)×(セルの階調値の合計)}
+{(選択した未処理画素のx座標)×(閾値までに必要な階調値)}}
/(セルの階調値の合計+閾値まで必要な階調値)
y重心={{(セルの重心のy座標)×(セルの階調値の合計)}
+{(選択した未処理画素のy座標)×(閾値までに必要な階調値)}}
/(セルの階調値の合計+閾値まで必要な階調値)
(x重心、y重心は重心位置の座標)
(式1)との違いは、選択した未処理画素の階調値をそのまま用いるのではなく、セルの階調値の合計が閾値と同じになる値(“閾値までに必要な階調値”)を用いる点が異なる。この演算式は、(式1)の場合と同様に予めROM25に格納されており、CPU24が本ステップを実行する際にROM25から読み出すことで処理される。図15(c)の例で演算すると、重心位置はx重心≒1.75、y重心≒0.96となる。演算した重心位置は、CPU24の制御によりワーキングメモリ270の領域270aに格納される(図15(c)の領域270a参照)。そして、CPU24は閾値を超えた場合の階調値演算処理を終了させ、図7のステップS23に移行する。
Next, the
(Formula 3)
x centroid = {{(x coordinate of centroid of cell) × (sum of cell gradation values)}
+ {(X coordinate of selected unprocessed pixel) × (gradation value necessary until threshold)}}
/ (Total tone value of cells + required tone value up to threshold)
y centroid = {{(y coordinate of the centroid of the cell) × (total sum of cell gradation values)}
+ {(Y coordinate of selected unprocessed pixel) × (gradation value necessary until threshold)}}
/ (Total tone value of cells + required tone value up to threshold)
(X center of gravity , y center of gravity are coordinates of the center of gravity)
The difference from (Equation 1) is that the gradation value of the selected unprocessed pixel is not used as it is, but the value in which the sum of the gradation values of the cells is the same as the threshold value (“the gradation value necessary until the threshold value”). ) Is different. This arithmetic expression is stored in advance in the
ステップS23でCPU24は、残った階調値を未処理画素に戻す処理を行う。図15(c)の例では、最後に選択した画素(2,3)の階調値は“25”、重心演算の際に“5”の階調値として演算したので、減算した“20”(=25−5)を入力データ領域261aの当該画素位置(2,3)に戻すことになる(同図の入力データ領域261a参照)。セルを構成する画素以外の画素に戻すことも考えられるが、それではその画素の階調値でない値を有することになるので、入力階調値に忠実なドットを生成させることができない。よって、最後に選択した画素に減算後の値を戻し、以後再び未処理画素として選択できるようにするのである。またCPU24は、選択した未処理画素の対応する出力データ領域261bに“0”を格納する。図15(c)の出力データ領域261bに示すように、この例では(2,3)に“0”が格納される。
In step S <b> 23, the
そしてCPU24は、重心位置に黒ドットを生成させる処理を行う(ステップS23)。すなわち、ワーキングメモリ270の領域270aにはこれまで構成したセルの重心位置が格納されているのでCPU24がこの値を読出し、出力データ領域261bの重心位置の存在する画素位置に“255”を格納することになる。図15(c)の例では、これまで演算した重心位置(1.75、0.96)がメモリ270に格納されているので、この位置にある出力データ領域261bの画素(2,1)にドット生成を示す“255”を格納することになる(図16(a)の出力データ領域261b参照)。そして、処理はステップS20に移行する。
And CPU24 performs the process which produces | generates a black dot in a gravity center position (step S23). That is, since the centroid position of the cell configured so far is stored in the
一方、ステップS18で閾値と等しい場合(“YES”の場合)も、すでにセルを構成する階調値の合計が閾値に達したことになるので、同様に重心位置に黒ドットを生成する処理(ステップS19)を行うことになる。そして、同様にステップS20に処理は移行する。 On the other hand, also in the case where it is equal to the threshold value in the step S18 (in the case of “YES”), since the sum of the gradation values already constituting the cell has reached the threshold value, similarly, a process of generating black dots at the center of gravity position ( Step S19) will be performed. Similarly, the process proceeds to step S20.
ステップS20においてCPU24は、未処理画素があるか否か判断する。図16(a)の例では、これまで1つのセルを構成しその重心位置に黒ドットを発生させるように処理を行ったことになるので、再び未処理画素を探索してセルを構成していくのである。なお、未処理画素か否かの判断は、入力データ領域261aで処理済みの画素には“−1”が格納されているので、すべての画素位置で“−1”が格納されたか否かで判断することができる。図16(a)の例では、すべての画素位置に“−1”が格納されていないので本ステップS20で“YES”が選択され、再びステップS11に移行することになる。
In step S20, the
ステップS11に移行するとCPU24は、上述したようにラスタ方向に未処理画素の探索を行い、図16(b)に示すように(4,0)の画素を初期画素として選択する。以後、上述したような処理を行うと、画素を4つ選択((4,0)、(5,0)、(4,1)、(5,1)の画素)し、再び未処理画素として(6,0)を選択した場合(ステップS13)で以下説明する。この4つの画素を選択したときの平均階調値は“30”(=(30×4)/4)であるが、(6,0)の階調値は“35”であるため、これを含めた平均階調値を演算すると(ステップS141)、“31”(=(120+35)/5)となる。この値は、図23に示す呼び出し関数から“30”を超える値のため閾値を“255”から“510”に変更することになる(ステップS142)。CPU24は、平均階調値“31”と、この変更された閾値“510”をワーキングメモリ270の各領域270c、270dに格納する(図16(c)の各領域270c、270d参照)。入力階調値が比較的大きな値を有する領域と判断したため、セルの大きさをさらに大きく確保するのである。上述したように、このように閾値を高く設定することでセルの大きさを確保し、ドット間距離を保つためである。また階調の表現も上述したように入力階調値が大きい領域ではセルが大きくなるものの、ドット1つはその変更した閾値分大きくなるため結果的に入力階調値に忠実な階調表現を実現しているのである。すなわち、滑らかな階調を表現することができるのである。もちろん、閾値の変更がない領域では入力階調値が高いとその分セルの大きさは小さくなり、結果的にドット密度が高くなるため、この場合でも滑らかな階調を表現することができる。
In step S11, the
具体的に図16(c)以降の図を参照しながら説明する。図16(c)で未処理画素(6,0)を選択して(ステップS13)、閾値制御処理(ステップS14)を終了すると、階調値の合計“155”(=120+35)は変更した閾値“510”を超えない。従って、ステップS15で“NO”が選択され、重心位置の演算(ステップS16)、階調値の合計値の演算等(ステップS17)を行い、各領域270a等にその値が格納される(図17(a)参照)。階調値の合計は閾値と等しくないためステップS18で“NO”が選択され再びセルを構成する未処理画素の選択を行う(ステップS13)。かかる処理を繰り返すことで、図17(b)に示す値を得る。この図に示すのは、階調値の合計が閾値である“510”となる直前の状態である。この図では、これまで8つの画素が選択されている。重心位置等の値は、図17(b)の各領域270a〜270dに示す値を得る。そして、CPU24は重心位置(5.67,1.4)から最も近い未処理画素として、図17(c)に示す(6,4)の画素を選択するものとする。当該画素の階調値は“35”、これまで構成したセルの階調値の合計は“490”、従って階調値の合計は“525”で閾値である“510”を超えることになり、ステップS15で“YES”が選択されステップS22に移行する。
This will be specifically described with reference to FIG. When the unprocessed pixel (6, 0) is selected in FIG. 16C (step S13) and the threshold value control process (step S14) is completed, the total gradation value “155” (= 120 + 35) is changed. It does not exceed “510”. Accordingly, “NO” is selected in step S15, the center of gravity position is calculated (step S16), the total value of the gradation values is calculated (step S17), and the value is stored in each
ステップS22の階調値演算処理において、まずCPU24は閾値“510”からこれまで構成したセルの階調値の合計値“490”を減算する(ステップS221)。その減算値“20”が最後に選択した(6,4)の画素の階調値として(式3)を用いて重心を演算する(ステップS222)。重心位置はメモリ270の領域270aに格納される。そして、図6に戻り、残り濃度“15”(=35−20)を選択画素(6,4)に戻して(図17(c)の入力データ領域261a参照)、重心位置に黒ドットを生成する(ステップS23)。
In the gradation value calculation process in step S22, first, the
この黒ドット生成の際、閾値として“510”を設定し階調値の合計が“510”となるまで画素を選択したため、ドット生成を示す値“255”を2画素に割り当てることになる。すなわち、図18(a)の出力データ領域261aに示すように、CPU24はまず重心位置に存在する画素(6,2)に“255”を割り当てる。このとき、階調値の合計値は“255”(=510−255)となる(同図の領域270a参照)。さらに、重心位置に最も近い画素(5,2)に“255”を割り当てる(図18(b)の出力データ領域261a参照)。このようにすることで、セルとして選択した階調値分の値を割り当てることになる。
At the time of black dot generation, since “510” is set as a threshold value and pixels are selected until the total of gradation values reaches “510”, a value “255” indicating dot generation is assigned to two pixels. That is, as shown in the
したがって、入力階調値が大きい領域では閾値を高く設定してセルの大きさを確保し、ドット間距離を保つとともに、入力階調値に応じた滑らかな階調を表現することができる。また、閾値を予め設定した値より高く設定することでセル内に取り込まれるべき画素数が増加する場合もある。このとき重心位置にドットを打つと上述したように閾値を高くした分、ドット生成を示す値を割り当てるべき画素の数も増加する。すなわち、セルの大きさは大きくなるがそのドットはそれに応じて大きく成長しやすいため、ドット間距離を保ったまま入力階調値に応じた階調を表現することができるのである。上述した図3(b)において、右側のドットは左側のドットを比較してその大きさは大きいもので全体としてみると右側の方がドット密度が上がっているように見える。入力階調値の変化に応じてドットどうしが引っ付いたりすることのない、滑らかな階調を表現している、といえる。 Therefore, in a region where the input tone value is large, the threshold value is set high to ensure the cell size, maintain the inter-dot distance, and express a smooth tone corresponding to the input tone value. Moreover, the number of pixels to be taken into the cell may increase by setting the threshold value higher than a preset value. At this time, when a dot is hit at the center of gravity, the number of pixels to which a value indicating dot generation is assigned increases as the threshold is increased as described above. That is, although the size of the cell increases, the dot easily grows accordingly, so that the gradation according to the input gradation value can be expressed while maintaining the distance between the dots. In FIG. 3B described above, the dots on the right side are larger in size than the dots on the left side, and as a whole, the dot density on the right side seems to be higher. It can be said that it expresses a smooth gradation in which dots do not stick to each other according to the change in the input gradation value.
再び処理に戻ると、CPU24は未処理画素がなくなる(図7のステップS20で“NO”)まで上述した処理を繰り返すことになる。その結果を図18(c)に示す。出力データ領域261aに格納された値が量子化データとしてハーフトーン処理部211から出力され、パルス幅変調部212を介して印刷エンジン22に出力されて、ホストコンピュータ10で生成した印刷データが印刷されるのである。
When returning to the processing again, the
上述の例では、入力階調値が図面上左側から除々に大きくなる例で説明したため、エッジの検出が結果的に行われず、図8の閾値制御処理においてステップS143で常に“NO”が選択され閾値を下げる処理が行われなかった。次の例としてかかるエッジの領域での処理について説明する。以下、図19以降に示した図を参照しながら説明する。なお、全体の処理自体は上述したものと全く同じで図6等に示したフローチャートに沿って処理が行われる。 In the above-described example, the input gradation value is gradually increased from the left side in the drawing, so that the edge detection is not performed as a result, and “NO” is always selected in step S143 in the threshold control process of FIG. Processing to lower the threshold was not performed. As a next example, processing in the edge region will be described. Hereinafter, description will be made with reference to the drawings shown in FIG. The entire process itself is exactly the same as described above, and the process is performed according to the flowchart shown in FIG.
入力データ領域261aには図19(a)に示す階調値がホストコンピュータ10から入力されたものとする。画素位置(5,0)を境に階調値が急激に変化している。
It is assumed that the gradation value shown in FIG. 19A is input from the
まずCPU24は、上述した処理と同様に初期画素を選択するため入力データ領域261a上をラスタ方向に探索する。そして、(0,0)に位置する画素を初期画素として選択する(ステップS11)。そして、重心位置を演算し、セルを構成する画素が閾値と等しくなる(ステップS18で“YES”)か、超える(ステップS15で“YES”)まで画素を選択し続ける。その結果、図19(b)の出力データ領域261bに示す出力データを得る。この選択の途中で、平均階調値は“30”を超えないので閾値の変更(ステップS142)は行われず、またその階調値の最大と最小の差も“50”を越えないため閾値を下げる処理(ステップS144)も行われない。
First, the
再び初期画素をラスタ方向に探索して、(4,0)に位置する画素を初期画素として選択し(ステップS11、図19(b)の入力データ領域261a参照)、閾値以上となるまで画素を選択する。この選択の途中で、4つの画素((4,0)、(4,1)、(5,0)、(5,1)の画素)をセルとして構成し、未処理画素として(6,0)を選択したときの状態を図19(c)に示す。
The initial pixel is searched again in the raster direction, the pixel located at (4, 0) is selected as the initial pixel (see step S11,
CPU24は、(6,0)の画素を未処理画素として選択すると(ステップS13)、閾値制御(ステップS14)に移行する。まず、CPU24は新たに選択した画素(6,0)を含めたセル内の画素の階調値の最大値、最小値、及び平均階調値を演算して対応する領域270b、270cに格納する(ステップS141)。最小値は変わらず“30”、最大値は(6,0)の画素の階調値“100”、平均階調値は“44”(=(120+100)/5)、となる(図20(a)の領域270b、270c参照)。
When the
次いでCPU24は、関数を読み出して平均階調値を引数として閾値を変更する(ステップS142)。この場合に、平均階調値は“30”より大きく“80”以下の範囲にあるので、図23に示す関数から閾値は“510”に変更されることになる(図20(a)の領域270d参照)。入力階調値が高い領域と判断されることになる。
Next, the
次いでCPU24は、セル内の画素の最大階調値と最小階調値の差が所定値である“50”を超えるか否か判断する(ステップS143)が、領域270b、270cに格納された値を読み出すとその差は“70”(=100−30)で所定値“50”を超える。よって本ステップで“YES”が選択されて閾値を下げる処理を行う。ここで、この領域はエッジの領域であると判断されたことになる。
Next, the
この閾値を下げる処理もステップS142と同様に関数を呼び出してこの値を決定するようにしてもよいし、(式2)のような演算式を用いて決定してもよい。本実施例では図23に示すように関数threshold()を呼び出してその値を決定するようにする。すなわち
、図23の後半部分にあるように最大値(max_value)と最小値(min_value)との差が50を超えると、その閾値を一律に“255”に設定するようにしている。図20(b)の領域270dに示すようにその閾値を“510”から“255”に変更することになる。閾値を下げる処理としては、これ以外にも例えば、ステップS142の閾値の変更と同様に平均階調値に応じて、段階的にその閾値を下げるようにすることでもよい。例えば、“30”以下のときの閾値は“255”のままで、“30”より大きく“80”以下のときも“255”、“80”より大きいときは“510”と設定することもできる。これまでの閾値より小さい値でかつドット間距離を保つように設定すればよい。
The process of lowering the threshold value may be determined by calling a function in the same manner as in step S142, or may be determined using an arithmetic expression such as (Expression 2). In this embodiment, as shown in FIG. 23, the function threshold () is called to determine its value. That is, as shown in the latter half of FIG. 23, when the difference between the maximum value (max_value) and the minimum value (min_value) exceeds 50, the threshold value is uniformly set to “255”. As shown in a
図20(b)の場合、閾値制御処理(ステップS14)が終了するとCPU24は、重心の演算(ステップS16)、階調値の演算(ステップS17)を行い、各演算値が領域270aに格納され、さらに入力データ領域261aの当該未処理画素(6,0)に“−1”、出力データ領域261bに“0”を格納することになる。なお、階調値の合計は“220”で閾値である“255”を超えないのでステップS15は“NO”が選択される。
In the case of FIG. 20B, when the threshold control process (step S14) is completed, the
次いでCPU24は、ステップS18で“NO”が選択され、再びセルを構成する未処理画素を重心位置から最も近い画素から選択する(ステップS13)。この例の場合、図21(a)に示すように、(6,1)の画素が選択される。閾値制御処理(ステップS14)に移行するとCPU24は、平均階調値等を演算する(ステップS141)が、この場合、平均値は“53.3”(≒(220+100)/6)となり、関数を呼び出して閾値が再び“510”に変更される(ステップS142、図21(a)の領域270d参照)。しかし、これまで構成したセルの最大階調値と最小階調値の差はこの場合も“70”で、所定値以上となるためステップS143で“YES”が選択され閾値を下げることになる(ステップS144)。この場合もエッジの領域であると判断されたためである。同様に閾値は“255”に変更されCPU24によって領域270dに格納されることになる(図21(b)の領域270d参照)。そして、閾値制御処理(ステップS14)が終了して、図6のステップS15に移行することになる。
Next, the
同様にCPU24は、最後に選択した画素を含めたセルの階調値の合計が閾値を超えるか否か判断する(ステップS15)が、この場合には閾値は“255”で、最後に選択した画素(6,1)を含めたセルの階調値の合計は“320”となるので、本ステップで“YES”が選択されることになる。そして、上述したように、閾値を超えた場合の階調値の演算処理(ステップS22)により、(6,1)の画素の階調値は“35”(=255−220)として(式3)を用いて重心を演算する(ステップS222)。残った階調値“65”(=100−35)を当該画素位置に戻して演算した重心位置に黒ドット生成を示す“255”を割り当てることになる(図21(c)参照)。
Similarly, the
かかる処理を未処理画素がなくなるまで(図7のステップS20で“NO”)繰り返すことで処理が終了する(ステップS21)。この結果を図22(a)に示す。 By repeating this process until there is no unprocessed pixel (“NO” in step S20 in FIG. 7), the process ends (step S21). The result is shown in FIG.
このようにエッジを検出すると設定した閾値を下げるようにすることで、セルの大きさが小さくなるため、ドット密度が上がり、エッジの再現性が向上した印刷出力を得ることができるのである。図22(a)の出力データ領域261bに示すように(5,0)から(5,6)までのエッジの領域はまわりの画素と比較して多数の小さいドットにより再現しているため、解像度が落ちることなく、エッジの再現性が向上した快適な印刷出力を得ることができる。
By detecting the edge in this way and lowering the set threshold value, the cell size is reduced, so that the dot density is increased and the print output with improved edge reproducibility can be obtained. As shown in the
次に出力ドットのサイズを“255”よりも小さい単位で出力する場合の例について説明する。上述した例では、1ドットの出力はすべて“255”としたため、1画素分すべての領域にドットを打った場合の例で説明したが、この例では1画素分の所定領域幅にドットを打つ場合である。 Next, an example in which the output dot size is output in units smaller than “255” will be described. In the above-described example, since the output of one dot is all “255”, the example has been described in which dots are applied to all areas for one pixel. In this example, dots are applied to a predetermined area width for one pixel. Is the case.
図24(a)の入力データの例を示す。この場合の入力データ領域261aの構成は、7行8列の構成である。説明の便宜のためであって、もちろんこれ以外の構成でもよいことは上述の例と同様である。各座標位置は入力画像の各画素位置に対応することも同様である。この図の例でも、入力データ領域261a上、左側から右側にかけて除々にその階調値が増加している。なお、ワーキングメモリ270、出力データ領域261bも上述の例と同様の構成である。
The example of the input data of Fig.24 (a) is shown. The configuration of the
CPU24が行う処理の動作も図6乃至図11に示すフローチャートに従う。すなわち、まずCPU24は本処理を実行するためのプログラムを読出しで処理が開始される(図6のステップS10)。次いで、初期画素を決定し、基準点を初期画素の座標位置に設定する(ステップS11)。図24(b)に示すように入力データ領域261aをラスタ方向に探索すると、(0,0)の画素が未処理画素なので(“−1”が格納されてないので)、この画素を初期画素とする。そして、セルを構成する画素のうち最大階調値と最小階調値、及び平均階調値をワーキングメモリ270の各領域270b、270cに格納する(同図の各領域270b、270c参照)。また、平均階調値は“70”なので、CPU24はセルを構成する画素を選択するための閾値を“510”に設定し、この値をメモリ270の領域270dに格納する(同図の領域270d参照)。さらに、CPU24は上述の(式1)を用いて重心位置を演算しその演算値と、セルを構成する画素の階調値の合計値とを領域270aに格納するとともに、入力データ領域261aの選択した初期画素の画素位置に“−1”、対応する出力データ領域261bに“0”を格納する(図24(c)参照)。
The processing operations performed by the
そして、図6に戻り、初期画素の初期濃度(階調値)“70”は“127”より小さい値なのでステップS11で低濃度と判定され(“YES”)以下ステップS13以降が実行される。すなわち、ワーキングメモリ270の領域270aに格納された重心位置に最も近い未処理画素を選択し(ステップS13)、セルを構成する画素の階調値の合計が閾値と等しいか(ステップS18で“YES”)、閾値を超えるまで(ステップS15で“YES”)、この未処理画素の選択を続ける。このとき、ステップS14でセルを構成する画素の階調値の平均値が、例えば30以下なら、この画素選択のための閾値を“255”のままにし、30より大きく80以下のときは閾値を“510”、80より大きいときは“765”にする(ステップS142)。セルの大きさをある程度大きくすることでドット間距離を保つためである。そして、セルを構成する画素の最大階調値と最小階調値の差が、例えば“50”より大きいときは(ステップS143で“YES”)、エッジの領域であるとして、その閾値を“255”にする(ステップS144)。ドット密度を上げることでエッジの再現性を向上させるためである。
Returning to FIG. 6, since the initial density (gradation value) “70” of the initial pixel is smaller than “127”, it is determined that the density is low in step S11 (“YES”), and step S13 and subsequent steps are executed. That is, the unprocessed pixel closest to the barycentric position stored in the
図25(a)は、6つの画素を未処理画素として選択し、さらに7番目の未処理画素として(2,1)の画素を選択したときの例である。このとき、セルを構成するこの7つの画素の階調値の合計は“500”で、画素選択のための閾値は、平均階調値が“71”なので “510”となっている(同図の領域270a、270d参照)。ちょうど、階調
値の合計が閾値となる直前の例である。
FIG. 25A shows an example in which six pixels are selected as unprocessed pixels, and (2,1) is selected as the seventh unprocessed pixel. At this time, the sum of the gradation values of the seven pixels constituting the cell is “500”, and the threshold value for pixel selection is “510” because the average gradation value is “71” (see FIG.
そして、領域270aに格納された重心位置から最も近い未処理画素として、(2,0)の画素を選択する(ステップS13、図25(b)の入力データ領域261a参照)。このとき、階調値の合計値は、“580”(=510+70)となるので領域270dに格納された閾値“510”を超えるのでステップS15で“YES”が選択され、閾値を超えた場合の階調値演算処理を行う(ステップS22)。
Then, the pixel of (2, 0) is selected as the unprocessed pixel closest to the barycentric position stored in the
すなわち、閾値“510”からこれまでセルとして選択した画素の階調値の合計値“500”を減算し(ステップS221)、その減算値“10”が最後に選択した画素(2,0)の階調値として重心の演算を行う(ステップS222)。演算結果がCPU24によって領域270aに格納され(図25(c)の領域270a参照)、残った階調値を(2,0)の画素に戻し、黒ドットの生成を行う(ステップS23)。
That is, the total value “500” of the gradation values of the pixels selected as the cells so far is subtracted from the threshold value “510” (step S221), and the subtraction value “10” is the value of the last selected pixel (2, 0). The center of gravity is calculated as the gradation value (step S222). The calculation result is stored in the
この黒ドットの生成で、上述の例ではまず重心位置に存在する画素にドット生成を示す値“255”を割り当て、閾値が“510”のときはさらにその重心位置に最も近い画素を選択、さらに閾値が“765”のときはその重心位置から2番目に近い画素を選択と、重心位置に近い画素から順にドット生成を示す値 “255”を割り当てるようにしてい
た。しかし、本例では、最初に重心位置に存在する画素に“255”を割り当てると、閾値がそれ以上のときはその選択画素に隣接する処理済みの画素を選択するようにする。そして、隣接する画素が複数あれば均等に割り当てるのである。このようにすることで、1画素分の大きさに1ドットすべて印刷するよりも、細かな階調表現が可能になる。
With this black dot generation, in the above example, first, a value “255” indicating dot generation is assigned to the pixel existing at the centroid position, and when the threshold is “510”, the pixel closest to the centroid position is selected. When the threshold is “765”, the second closest pixel from the center of gravity position is selected, and the value “255” indicating dot generation is assigned in order from the pixel near the center of gravity position. However, in this example, when “255” is first assigned to the pixel present at the center of gravity, a processed pixel adjacent to the selected pixel is selected when the threshold is higher than that. If there are a plurality of adjacent pixels, they are allocated equally. In this way, finer gradation expression can be achieved than when all the dots are printed in the size of one pixel.
図25(c)の例では、まず重心位置(0.76,0.98)に存在する画素(1,1)にドット生成を示す値“255”を割り当てる(同図の出力データ領域261b参照)。このとき閾値は“510”でさらに“255”の階調値分だけドットを割り当てる必要がある。この重心位置に存在する画素に隣接する処理済みの画素((1,0)、(0,1)、(1,1)、(1,2)に位置する画素)を選択し、4つの画素に全体として“255”となるよう均等に、64、64、64、63を割り当てる(図26(a)の出力データ領域261b参照)。そして、この出力データを量子化データとして、パルス幅変調部212を介して印刷エンジン22に出力する。この領域の印刷出力の例を図29(a)に示す。
In the example of FIG. 25C, first, a value “255” indicating dot generation is assigned to the pixel (1, 1) existing at the center of gravity (0.76, 0.98) (see the
この印刷出力の例に示すように(0,1)の画素と(2,1)の画素とは同じドットの生成を示す値“64”が割り当てられているが、前者の画素は右からドットが成長し、後者の画素は左からドットが成長している。すなわち、重心位置に存在する画素の左側の画素は右からドットが成長し、逆に右側に位置する画素は左からドットが成長している。CPU24は、この重心位置が存在する画素の右側に位置する画素か左側に位置する画素かによって左右どちらの側からドットが成長すべきかのデータを量子化データとともにパルス幅変調部212に出力するのである。
As shown in the example of the print output, the value “64” indicating the generation of the same dot is assigned to the pixel (0, 1) and the pixel (2, 1), but the former pixel is a dot from the right. The latter pixel has dots growing from the left. That is, the dot on the left side of the pixel located at the center of gravity is grown from the right, and conversely, the dot located on the right side is grown from the left. The
図26(a)の例でさらに処理を続けると、重心位置に黒ドットを生成すると、まだ未処理画素があるため再び未処理画素の選択を行う(ステップS20で“YES”が選択されて、ステップS11に移行する)。ラスタ方向に探索すると(2,0)の画素位置は未処理画素であるので、この画素を選択する。このとき、この画素の階調値は“70”であるが、例えば“20”となっているときに、次に未処理画素として(3,0)を選択すると、セルを構成する画素の最大階調値と最小最小値の差が“50”を超えてエッジとして検出されてしまう可能性がある。そこで、CPU24は未処理画素として選択された画素に対応する出力データ領域261bの画素にすでに処理すみである“0”が格納されていれば本来の階調値ではなく、ステップS23で戻しデータであることを認識して、最大階調値、最小階調値、及び平均階調値の演算をスキップするようにする。これにより、エッジとして間違って検出されるのを防ぐのである。
If the processing is further continued in the example of FIG. 26A, when a black dot is generated at the center of gravity position, since there are still unprocessed pixels, the unprocessed pixels are selected again ("YES" is selected in step S20, The process proceeds to step S11). When searching in the raster direction, the pixel position (2, 0) is an unprocessed pixel, so this pixel is selected. At this time, although the gradation value of this pixel is “70”, for example, when it is “20”, if (3, 0) is selected as the unprocessed pixel next, the maximum of the pixels constituting the cell There is a possibility that the difference between the gradation value and the minimum / minimum value exceeds 50 and is detected as an edge. Therefore, the
以後、セルを構成する未処理画素を選択していき図26(c)に示すように(4,0)を選択したとする。このとき、平均階調値は“83”となり、閾値制御処理(図6のステップS14)で閾値が“765”に変更される(ステップS142)ことになる。そして、同様に未処理画素の選択を続けて、図27(a)に示す値を得る。これは、セルを構成する画素の階調値の合計が閾値である“765”を超える直前の状態である。 Thereafter, it is assumed that an unprocessed pixel constituting the cell is selected and (4, 0) is selected as shown in FIG. At this time, the average gradation value is “83”, and the threshold value is changed to “765” (step S142) in the threshold value control process (step S14 in FIG. 6). Similarly, the selection of unprocessed pixels is continued to obtain the values shown in FIG. This is a state immediately before the sum of the gradation values of the pixels constituting the cell exceeds the threshold value “765”.
図27(a)に示すように(5,2)の画素を選択したとき、その階調値の合計は“850”(=760+90)で閾値である“765”を超えるため(図6のステップS15で“YES”)、閾値を超えた場合の演算処理(ステップS22)に移行する。閾値“765”からこれまでの階調値の合計“760”を減算し、その“5”が当該画素(5,2)の階調値として重心の演算を行う(ステップS221、S222、図27(c)参照)。 As shown in FIG. 27A, when the pixel of (5, 2) is selected, the sum of the gradation values is “850” (= 760 + 90) and exceeds the threshold value “765” (step in FIG. 6). If “YES” in S15), the process proceeds to a calculation process (step S22) when the threshold value is exceeded. The total “760” of the gradation values so far is subtracted from the threshold value “765”, and “5” is calculated as the gradation value of the pixel (5, 2) (steps S221 and S222, FIG. 27). (See (c)).
そして、最後に選択した画素(5,2)に残りの階調値“85”(=90−5)を戻し(図27(b)の入力データ領域261a参照)、黒ドットの生成を行う(ステップS23)。黒ドットの生成は、まず重心位置(3.74,0.79)に存在する画素(4,1)に“255”を割り当てる(図27(c)の出力データ領域261b参照)。階調値の合計はまだ“510”の値分あるので、この(4,1)の画素に隣接する4つの処理済みの画素((4,0)、(3,1)、(5,1)、(4,2)の画素)に均等に、128、128、127、127(全部で“510”)を割り当てることになる(図28(a)の出力データ領域261b参照)。この場合の、出力ドットは図29(b)に示すものを得る。まわりの画素から均等にドット生成を示す値を割り当てているので、入力階調値に忠実なドットで、さらに階調表現にすぐれたドットを生成することができる。この場合も、画素位置(3,1)は重心位置の左側なのでドットが右から成長するようにし、(5,1)の画素は重心位置の右側なのでドットが左側から成長するようにドットが打たれる。
Then, the remaining gradation value “85” (= 90−5) is returned to the last selected pixel (5, 2) (see the
以下、上述した処理を繰り返すことで図28(b)に示す出力データを得る。このように1画素分のドット幅のうち所定幅の領域にドットを生成させることのできる画像出力装置20であっても、上述した例と同様に滑らかな階調を表現でき、エッジの再現性が向上したドットを出力することができる。
Thereafter, the above-described processing is repeated to obtain output data shown in FIG. As described above, even in the
次に白濃度処理(図10乃至図11)について説明する。上述の例では、初期画素を選択した(ステップS11)あと、その階調値が“127”よりも低い値を有していたのでステップS12で低濃度と判定されて以下処理を行っていた。ここでは、初期画素の階調値が低濃度でない場合について説明する。例えば図30(a)の入力データ領域261aに示すデータが入力されるとすると、上述したようにラスタ方向に未処理画素を探索し(0,0)の画素を選択するとする。このとき、(0,0)に位置する画素の階調値は“185”で、“127”より高い値なのでステップS12で“NO”と判定され白濃度処理(ステップS24)に移行することになる。
Next, white density processing (FIGS. 10 to 11) will be described. In the above-described example, after the initial pixel is selected (step S11), the gradation value has a value lower than “127”. Therefore, it is determined that the density is low in step S12, and the following processing is performed. Here, a case where the gradation value of the initial pixel is not low density will be described. For example, if the data shown in the
白濃度処理の動作を示すフローチャートを図11乃至図12に示す。ほぼ、低濃度のときの処理(図6のステップS13からステップS20)と同様である。セルを構成する画素が閾値と等しいか(ステップS248で“YES”)、超える(ステップS245で“YES”)まで重心位置から最も近い画素を選択し続ける。複数あればランダムに選択する。そして、閾値制御処理(ステップS244、図8参照)も同様で、平均階調値が所定値以上のときこれまでの閾値をより大きな値に設定して(ステップS142)、最大階調値と最小階調値の差が所定値以上のときエッジの部分であるとしてその設定した閾値を低い値に設定する(ステップS144)。 Flow charts showing the operation of the white density processing are shown in FIGS. This is almost the same as the processing at the low density (step S13 to step S20 in FIG. 6). Until the pixel constituting the cell is equal to the threshold value ("YES" in step S248) or exceeded ("YES" in step S245), the pixel closest to the center of gravity position is continuously selected. If there are multiple, select randomly. The threshold control process (step S244, see FIG. 8) is the same. When the average gradation value is equal to or greater than a predetermined value, the threshold value so far is set to a larger value (step S142), and the maximum gradation value and the minimum gradation value are set. When the difference between the gradation values is equal to or greater than a predetermined value, the threshold value thus set is set to a low value as being an edge portion (step S144).
この白濃度処理で、低濃度の処理のときとの違いは、まず選択した未処理画素の階調値をそのまま使用するのではなく、入力階調値の最大値(ここでは“255”)からの差を演算して、その値が当該画素の階調値として重心等の演算を行うようにする。例えば、図30(a)の例では(0,0)の画素は“185”の階調値を有するが、最大値から減算すると“70”(=255−185)を得る。これを各未処理画素選択のたびに行うことで、図30(b)の入力データ領域261aに示す値を有することになる。ただし、処理の上では各未処理画素を選択した後に減算(ステップS242)を行っているので、すべての画素に対してこの図に示す値に直してから処理が行われるものではない。この場合、結局図24に示す値と同じ値を有するものとして処理が行われることになる。
The difference between the white density process and the low density process is that the gradation value of the selected unprocessed pixel is not used as it is, but from the maximum value of the input gradation value (here, “255”). And the value is used as the gradation value of the pixel to calculate the center of gravity. For example, in the example of FIG. 30A, the pixel (0, 0) has a gradation value of “185”, but when subtracted from the maximum value, “70” (= 255-185) is obtained. By performing this for each unprocessed pixel selection, the value shown in the
また、低濃度の処理のときとの違いは、未処理画素を選択すると、低濃度のときは対応する出力データ領域261bの画素位置にドットを生成しないことを示す値“0”を格納したが、白濃度処理のときでは対応する画素位置にドットを生成することを示す値(ここでは“255”)を格納する(図10のステップS243)。図30(c)に示すように(0,0)の画素を未処理画素として選択したとき、出力データ領域261bの対応する(0,0)に“255”をCPU24の制御によって格納されることになる。そして、セルを構成する画素の階調値の合計が閾値と等しい(ステップS248で“YES”)か、超える(ステップS245で“YES”)と重心位置にドットを生成することになるが、低濃度のときとは異なり、ドットを生成しないことを示す値(ここでも“0”)を重心位置に存在する画素位置に割り当てるのである(図30(d)参照)。ただし、複数の画素に“0”を割り当てなければならないとき、画素の選択は低濃度の処理と同様に重心位置に最も近い画素を選択したり、或いは最初に選択した画素に隣接する画素に均等に割り当てる方法であってもよい。均等に割り当てるときは、まわりの画素の“255”の値から減算した値となる。
Also, the difference from the low density processing is that a value “0” indicating that no dot is generated at the pixel position of the corresponding
さらに、階調値の合計が閾値を超えた場合に、低濃度のときは最後に選択した画素の階調値が丁度閾値と等しくなる値にし、残りを当該画素に戻していたが、白濃度処理も同様に残りの階調値を当該画素に戻す処理が行われる(ステップS253)。ただし、ステップS242で階調値の減算を行ったので、本来の階調値に直して戻すことになる。例えば、図30(d)に示すように最後に(2,0)を選択して当該画素の階調値を“10”(ステップS242の減算後階調値は“80”となり、これまでのセルの階調値の合計値が“500”だったので、閾値である“510”と等しくさせるために“10”とした)として演算し、残った階調値は“70”であるが、これは本来の階調値ではなくステップS242で減算した値である。よって、本来の階調値“185”に戻して当該画素に戻すのである(同図の入力データ領域261a参照)。
Furthermore, when the total of the gradation values exceeds the threshold value, when the density is low, the gradation value of the last selected pixel is set to a value that is exactly equal to the threshold value, and the rest is returned to the pixel. Similarly, the process of returning the remaining gradation value to the pixel is performed (step S253). However, since the gradation value is subtracted in step S242, the original gradation value is restored. For example, as shown in FIG. 30D, (2, 0) is finally selected and the gradation value of the pixel is “10” (the gradation value after subtraction in step S242 is “80”). Since the total value of the cell gradation values was “500”, it was calculated as “10” in order to make it equal to the threshold value “510”, and the remaining gradation value was “70”. This is not the original gradation value but the value obtained by subtraction in step S242. Therefore, the original gradation value “185” is restored and the pixel is restored (see the
このように、各画素で白成分が多い低濃度の場合と、黒成分が多い高濃度の場合(白濃度処理を行う場合)とで処理を異ならしめているのは、高濃度の成分に対して低濃度と同様の処理を行うと2つや3つの画素ですぐに閾値に達してしまうためセルの大きさを確保できず、その重心にドットを生成させてもセルが小さい分隣り合ったドットと距離を保てず、ドットが重なって発生するようになり、不快な印刷出力となってしまうからである。 As described above, the processing is different between the case of low density with many white components in each pixel and the case of high density with many black components (when performing white density processing). If the same processing as that for low density is performed, the threshold value is reached immediately at two or three pixels, so the size of the cell cannot be secured. This is because the distance cannot be maintained and dots are overlapped, resulting in an unpleasant print output.
以上のような白濃度処理においても、閾値制御処理自体の内容は低濃度の処理と同様であるため、滑らかな階調が表現され、エッジの再現性が向上した印刷出力を得ることができる。 Also in the white density processing as described above, since the content of the threshold control processing itself is the same as that of the low density processing, it is possible to obtain a print output in which smooth gradation is expressed and edge reproducibility is improved.
上述の例で低濃度、高濃度の双方とも画素選択のための閾値として“255”の整数倍(510、765、…)として処理を行ってきたが、必ずしもこれに拘泥せず任意の整数値であってもよい。図31(a)に示すように、閾値として“450”が設定された場合に、重心位置に“255”を割り当て、残りの値“195”をこの画素位置に隣接する処理済みの4つの画素に均等に割り当てている。また図31(b)に示すように、重心位置に“255”を割り当て、残りの値“195”を重心位置に最も近い画素に割り当ててもよい。このような場合でも、平均階調値が所定の値以上のときに画素選択のための閾値を“450”から例えば“480”にすることで、セルの大きさを確保しドット間距離を保つことができる。要するに、平均階調値を引数とする関数を用いて、平均階調値に応じた閾値を設定するようにすればよい。 In the above example, both low density and high density have been processed as an integer multiple of “255” (510, 765,...) As a threshold value for pixel selection. It may be. As shown in FIG. 31A, when “450” is set as the threshold value, “255” is assigned to the center of gravity position, and the remaining value “195” is processed four pixels adjacent to this pixel position. Are allocated evenly. Further, as shown in FIG. 31B, “255” may be assigned to the center of gravity position, and the remaining value “195” may be assigned to the pixel closest to the center of gravity position. Even in such a case, when the average gradation value is equal to or higher than a predetermined value, the threshold for pixel selection is changed from “450” to, for example, “480”, thereby ensuring the cell size and maintaining the inter-dot distance. be able to. In short, a threshold value corresponding to the average gradation value may be set using a function having the average gradation value as an argument.
さらに、以下のような変形例においても同様の効果を奏する。すなわち、上述の例において、本発明が適用されるハーフトーン処理部211は画像出力装置20において処理が行われていたが、それ以外にも図32に示すようにハーフトーン処理部211がホストコンピュータ10内に設けられ、このハーフトーン処理部211において本発明が適用されることによっても、上述したものと全く同様の効果を奏することができる。この場合、ハーフトーン処理211から出力される量子化データがホストコンピュータ10から画像出力装置20に入力されて、パルス幅変調212から印刷エンジン22にドット生成を示す制御データが出力され印刷が行われることになる。
Further, the same effect is obtained in the following modified example. That is, in the above-described example, the
また、ホストコンピュータ10以外にも例えば携帯電話やPDA(Personal Digital Assistance)、その他の情報携帯端末において、印刷対象のデータが生成されて画像出力
装置20に出力されるようになされていてもよい。さらには、かかる端末に本発明が適用されるハーフトーン処理部211を備えるようにしてもよい。さらには、紙とディスプレイとを組み合わせた、いわゆる電子ペーパーにおいてかかる本発明のハーフトーン処理211が設けられ、2値化(又は多値化)された値で文書や画像を表示したり、画像出力装置20との組み合わせて印刷出力を得るようにしてもよい。これらの場合でも、上述した効果を得ることができる。
In addition to the
また、CC法による処理で、セルを構成する画素を選択するとき、演算した重心位置を用いて選択したが、それ以外にも階調値を考慮せず座標位置のみの中心位置から最も近い画素を選択するようにしてもよい。すなわち、(座標位置の和)/(選択画素の数)により演算した(x、y)の座標位置からセルを構成する画素を選択するのである。例えば、(0,0)と(1,0)の2つの画素をセルを構成する画素として選択した場合、その中心位置は(0.5,0)、この中心位置から最も近い位置にある未処理画素を選択する。さらに(0,1)を加えた3つの画素の場合、その中心位置は(0.5,0.5)、その画素位置から最も近い画素位置を未処理画素として選択するようにする。要するに、セルを構成する未処理画素を選択するときに常にテーブル等を利用して固定して選択するのではなく、画素選択のための基準点の位置(上述の例で説明した重心位置や、階調値を考慮せず座標位置のみで演算した中心位置)が移動すればよい。このように移動することで、セルの形状が固定の場合と比較してより円状に成長する可能性が高まり、ドット間距離が保たれた快適な画像出力を得られるからである。 In addition, when selecting a pixel constituting a cell by processing by the CC method, the pixel is selected using the calculated center of gravity position, but other than that, the pixel closest to the center position of only the coordinate position without considering the gradation value May be selected. That is, the pixels constituting the cell are selected from the coordinate position (x, y) calculated by (sum of coordinate positions) / (number of selected pixels). For example, when two pixels (0, 0) and (1, 0) are selected as the pixels constituting the cell, the center position is (0.5, 0), which is not closest to the center position. A processing pixel is selected. Further, in the case of three pixels to which (0, 1) is added, the center position is (0.5, 0.5), and the pixel position closest to the pixel position is selected as an unprocessed pixel. In short, when selecting unprocessed pixels constituting a cell, it is not always fixed and selected using a table or the like, but the position of the reference point for pixel selection (the centroid position described in the above example, The center position calculated only by the coordinate position without considering the gradation value may be moved. By moving in this way, there is a higher possibility that the cell shape will grow more circularly than in the case where the cell shape is fixed, and a comfortable image output in which the inter-dot distance is maintained can be obtained.
上述の例では、平均階調値をセルを構成する画素を選択するごとに演算したが、例えば、初期画素選択後、1画素、2画素等、固定画素数選択したときまで平均階調値を演算し、その後は平均階調値の演算を行わない場合でも同様の効果を奏する。重心付近の数画素を選択して平均階調値を演算して閾値を設定するようにすることで、毎回画素選択のたびに演算するよりも、演算量を少なくすることができ全体の処理を早めることもできる。 In the above example, the average gradation value is calculated every time the pixel constituting the cell is selected. For example, after the initial pixel selection, the average gradation value is obtained until a fixed number of pixels such as one pixel, two pixels, etc. are selected. The same effect can be obtained even when the calculation is performed and thereafter the average gradation value is not calculated. By selecting several pixels near the center of gravity and calculating the average gradation value and setting a threshold value, the calculation amount can be reduced rather than calculating each time the pixel is selected. You can also speed up.
さらに、上述の例では平均階調値によりその閾値を更新させるようにしたが、画素数により閾値を変化させるようにしてもよい。例えば、最小画素数を設定し、それ以上の画素がセルを構成する画素として選択されると、閾値をこれまでの“255”から“510”に設定するなどとすることができる。 Furthermore, in the above example, the threshold value is updated by the average gradation value, but the threshold value may be changed by the number of pixels. For example, when the minimum number of pixels is set and more pixels are selected as the pixels constituting the cell, the threshold value can be set from “255” to “510” so far.
また、上述の例ではエッジの検出としてセル内の最大階調値と最小階調値の差から演算したが、例えばそれ以外にも階調値の分散値や標準偏差から演算するようにしても全く同様の作用効果を奏する。すなわち、平均階調値をμ、分散をσ2 とすると、分散、標準
偏差はそれぞれ、
σ2 = {1/(画素数)}×Σ(各画素の階調値―μ)2
標準偏差 = √σ2
となる。この分散値や、標準偏差の値がある値以上のときは、エッジであるとしてその閾値を更新させるのである。
In the above example, the edge is detected by calculating from the difference between the maximum gradation value and the minimum gradation value in the cell. However, for example, it may be calculated from the dispersion value or standard deviation of the gradation value. Exhibits exactly the same effect. That is, if the average gradation value is μ and the variance is σ2, the variance and standard deviation are
Standard deviation = √σ2
It becomes. When this variance value or standard deviation value is greater than or equal to a certain value, the threshold is updated as an edge.
さらに、上述の例では平均階調値によりその閾値を更新させるようにしたが、画素数により閾値を変化させるようにしてもよい。例えば、最小画素数を設定し、それ以上の画素がセルを構成する画素として選択されると、閾値をこれまでの“255”から“510”に設定するなどとすることができる。 Furthermore, in the above example, the threshold value is updated by the average gradation value, but the threshold value may be changed by the number of pixels. For example, when the minimum number of pixels is set and more pixels are selected as the pixels constituting the cell, the threshold value can be set from “255” to “510” so far.
さらに上述の例では、ホストコンピュータ10から出力されるデータはモノクロデータであるとして説明してきたが、CMYK(シアン、マゼンダ、イエロー、ブラック)のカラーデータに対して処理を行ってもよい。すなわち、ラスタライズ部12で各画素ごとRGB(レッド、グリーン、ブルー)の階調データを生成し、画像出力装置20内に色変換部を設けてこのRGBデータをテーブル又は関数等を利用することでCMYKの各色データに変換する。この変換後のCMYKの各データ(シアン、マゼンダ、イエロー、ブラックの各データごと)に対して上述したCC法による処理を行うのである。この場合でも、各色成分で平均階調値が高い領域では閾値をこれまでの値より大きくしてドット間距離を保ち、階調値の差が大きい領域ではエッジの部分としてその大きくした閾値を下げてドット密度を高めエッジの再現性を向上させるのである。もちろん、カラーを表現する色成分としてC、M、Y、Kの4色以外にもライトシアン、ライトマゼンダを含めた6色や、さらにそれ以外の色成分を含めた複数色の場合でも同様の効果を得ることができる。
Furthermore, in the above-described example, the data output from the
10 ホストコンピュータ 20 画像出力装置 21 画像処理部 211 ハーフトーン処理部 212 パルス幅変調部 22 印刷エンジン 24 CPU 25 ROM 261a 入力データ格納領域 261b 出力データ格納領域 270 ワーキングメモリ領域 270a 重心位置と階調値の合計値とが格納される領域 270b セルの最大階調値と最小階調値とが格納される領域 270c 平均階調値が格納される領域 270d 閾値が格納される領域
DESCRIPTION OF
Claims (11)
画素選択のための第1の基準点に基づいて、画素ごとの前記N種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成手段と、
前記画素群生成手段で生成した画素群の第2の基準点を決定する画素群基準点決定手段と、
前記画素群基準点決定手段で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与する付与手段と、を備え、
前記画素群生成手段は、前記第1の基準点を更新して当該第1の基準点に基づいて前記画素を選択し、さらに生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とする画像処理装置。 In an image processing apparatus that converts gradation data having N (N is an integer) or more level values for each pixel into data having M (M is an integer) level values for each pixel.
Pixel group generation means for selecting a pixel and generating a pixel group based on a first reference point for pixel selection until the sum of the N types of level values for each pixel is equal to or greater than a threshold;
Pixel group reference point determining means for determining a second reference point of the pixel group generated by the pixel group generating means;
Providing means for assigning the M types of level values to the pixels located at the second reference point determined by the pixel group reference point determining means;
The pixel group generation unit updates the first reference point, selects the pixel based on the first reference point, and further updates the threshold according to the generated level value in the pixel group. An image processing apparatus.
前記画素群生成手段は、生成した前記画素群内の画素のレベル値の平均値に応じて前記閾値を更新する、ことを特徴とする画像処理装置。 The image processing apparatus according to claim 1.
The image processing apparatus, wherein the pixel group generation unit updates the threshold value according to an average value of the level values of the generated pixels in the pixel group.
前記画素群生成手段は、生成した前記画素群内のレベル値が第1の値より大きいとき、前記閾値をこれまでの第2の値から前記第2の値より大きい第3の値に更新する、ことを特徴とする画像処理装置。 The image processing apparatus according to claim 1.
When the level value in the generated pixel group is larger than the first value, the pixel group generation unit updates the threshold value from the second value so far to a third value larger than the second value. An image processing apparatus characterized by that.
前記画素群生成手段は、生成した前記画素群内のレベル値の最大値と最小値の差が第4の値よりも大きいとき、前記閾値をこれまでの第5の値から前記第5の値より低い第6の値に更新する、ことを特徴とする画像処理装置。 The image processing apparatus according to claim 1.
When the difference between the maximum value and the minimum value of the level value in the generated pixel group is larger than the fourth value, the pixel group generation means changes the threshold value from the fifth value so far to the fifth value. An image processing apparatus that updates to a lower sixth value.
前記第2の基準点は、前記画素群の各画素位置と各画素の前記N種類のレベル値とから演算した重心位置である、ことを特徴とする画像処理装置。 The image processing apparatus according to claim 1.
The image processing apparatus according to claim 2, wherein the second reference point is a barycentric position calculated from each pixel position of the pixel group and the N kinds of level values of each pixel.
前記画素群生成手段は、前記第1の基準点に基づいて選択すべき画素が複数あるときはランダムにいづれか一の画素を選択する、ことを特徴とする画像処理装置。 The image processing apparatus according to claim 1.
The image processing apparatus, wherein the pixel group generation unit randomly selects one pixel when there are a plurality of pixels to be selected based on the first reference point.
前記N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成手段と、
前記画素群生成手段で生成した画素群の所定画素に対して前記M種類のレベル値を付与する付与手段と、を備え、
前記画素群生成手段は、生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とする画像処理装置。 In an image processing apparatus that converts gradation data having N (N is an integer) or more level values for each pixel into data having M (M is an integer) level values for each pixel.
A pixel group generation unit that selects pixels having the N types of level values, selects unprocessed pixels until a sum of level values for each selected pixel reaches a threshold value, and generates a pixel group;
Providing means for assigning the M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generating means;
The image processing apparatus, wherein the pixel group generation unit updates the threshold value according to the generated level value in the pixel group.
画素選択のための第1の基準点に基づいて、画素ごとの前記N種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成工程と、
前記画素群生成工程で生成した画素群の第2の基準点を決定する画素群基準点決定工程と、
前記画素群基準点決定工程で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与する付与工程と、を備え、
前記画素群生成工程は、前記第1の基準点を更新して当該第1の基準点に基づいて前記画素を選択し、さらに生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とする画像処理方法。 In an image processing method for outputting gradation data having N (N is an integer) or more level values for each pixel and data having M (M is an integer) level values for each pixel,
A pixel group generation step of selecting a pixel and generating a pixel group based on a first reference point for pixel selection until the sum of the N types of level values for each pixel is equal to or greater than a threshold;
A pixel group reference point determining step for determining a second reference point of the pixel group generated in the pixel group generating step;
An applying step of applying the M kinds of level values to the pixels located at the second reference point determined in the pixel group reference point determining step,
The pixel group generation step updates the first reference point, selects the pixel based on the first reference point, and further updates the threshold value according to the generated level value in the pixel group. An image processing method.
前記N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成工程と、
前記画素群生成手段で生成した画素群の所定画素に対して前記M種類のレベル値を付与する付与工程と、を備え、
前記画素群生成工程は、生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とする画像処理方法。 In an image processing method for outputting gradation data having N (N is an integer) or more level values for each pixel and data having M (M is an integer) level values for each pixel,
A pixel group generation step of selecting pixels having the N types of level values, and selecting unprocessed pixels until a sum of level values for the selected pixels reaches a threshold value to generate a pixel group;
An application step of applying the M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generation means,
The pixel group generation step updates the threshold value according to the generated level value in the pixel group.
画素選択のための第1の基準点に基づいて、画素ごとの前記N種類のレベル値の総和が閾値以上となるまで画素を選択して画素群を生成する画素群生成処理と、
前記画素群生成処理で生成した画素群の第2の基準点を決定する画素群基準点決定処理と、
前記画素群基準点決定処理で決定した前記第2の基準点に位置する画素に前記M種類のレベル値を付与する付与処理と、を備え、
前記画素群生成処理は、前記第1の基準点を更新して当該第1の基準点に基づいて前記画素を選択し、さらに生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とするプログラム。 For causing a computer to execute a process of outputting data having M (M is an integer) type of level value for each pixel with respect to gradation data having N or more (N is an integer) type of level value for each pixel. In the program
Based on a first reference point for pixel selection, a pixel group generation process for generating a pixel group by selecting pixels until the sum of the N kinds of level values for each pixel is equal to or greater than a threshold value;
A pixel group reference point determination process for determining a second reference point of the pixel group generated by the pixel group generation process;
A provisioning process for imparting the M kinds of level values to the pixels located at the second reference point determined by the pixel group reference point determination process,
The pixel group generation process updates the first reference point, selects the pixel based on the first reference point, and further updates the threshold according to the generated level value in the pixel group. A program characterized by that.
前記N種類のレベル値を有する画素を選択し、選択した画素ごとのレベル値の総和が閾値となるまで未処理画素を選択して画素群を生成する画素群生成処理と、
前記画素群生成手段で生成した画素群の所定画素に対して前記M種類のレベル値を付与する付与処理と、を備え、
前記画素群生成処理は、生成した前記画素群内のレベル値に応じて前記閾値を更新することを特徴とするプログラム。 In a program for causing a computer to execute a process of outputting data having M (M is an integer) type of level value for each pixel with respect to gradation data having N (N is an integer) type of level value or more for each pixel. ,
A pixel group generation process of selecting pixels having the N types of level values, selecting unprocessed pixels until a sum of level values for each selected pixel reaches a threshold value, and generating a pixel group;
A provisioning process for imparting the M kinds of level values to predetermined pixels of the pixel group generated by the pixel group generation unit,
The pixel group generation processing updates the threshold value according to the generated level value in the pixel group.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004296548A JP2005136976A (en) | 2003-10-10 | 2004-10-08 | Image processing apparatus, image processing method, and program |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003352270 | 2003-10-10 | ||
JP2004296548A JP2005136976A (en) | 2003-10-10 | 2004-10-08 | Image processing apparatus, image processing method, and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005136976A true JP2005136976A (en) | 2005-05-26 |
Family
ID=34656112
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004296548A Pending JP2005136976A (en) | 2003-10-10 | 2004-10-08 | Image processing apparatus, image processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005136976A (en) |
-
2004
- 2004-10-08 JP JP2004296548A patent/JP2005136976A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2005210731A (en) | Method for creating halftones from plural pixels, and method and system for processing halftones | |
JP5482535B2 (en) | Image processing apparatus and image processing method | |
JP7185186B2 (en) | Image processor, method for training machine learning model, and computer program | |
JP4412248B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JPWO2005109851A1 (en) | Image processing apparatus, image processing method, and program | |
JP2005136976A (en) | Image processing apparatus, image processing method, and program | |
JP5678501B2 (en) | Image processing apparatus and image processing method | |
JP2005136975A (en) | Image processing apparatus, image processing method, and program | |
JP2012165192A (en) | Printer and printing method | |
JP2005117642A (en) | Halftoning method, image processor, image processing method, and program | |
JP3951953B2 (en) | Printing apparatus, image processing apparatus, printing method, image processing method, and program | |
JP2005341142A (en) | Image processor, processing method and program, and recording medium with the program stored | |
JP2005295131A (en) | Apparatus, method, and program for processing image | |
JP5458969B2 (en) | Image processing apparatus, image processing method, and program | |
US10798267B2 (en) | Image processing to set output pixel values subject to edge or thin line correction | |
JP7257806B2 (en) | Image forming device, generation device, conversion method, and generation method | |
JP2004320374A (en) | Image processor, image processing method, printer, printing method, and program | |
JP6565711B2 (en) | Image processing apparatus, image forming apparatus, and threshold matrix shaping method | |
JP2005080217A (en) | Image processing apparatus, image processing method, and program | |
JP2005318402A (en) | Image processing device, method and program, and recording medium recorded with program | |
JP4337670B2 (en) | Image processing apparatus, image processing method, and program | |
JP2005269131A (en) | Image processing apparatus, image processing method, and image processing program | |
JP2005341351A (en) | Image processor, processing method and program | |
JP2006025220A (en) | Image processing apparatus, image processing method, image processing program, and recording medium recorded with the program | |
JP2006060645A (en) | Image processing device, method, and program, and recording medium with image processing program recorded thereon |